container.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _CLUTTERMM_CONTAINER_H
00004 #define _CLUTTERMM_CONTAINER_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 /* Copyright (C) 2007 The cluttermm Development Team
00010  *
00011  * This library is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU Lesser General Public
00013  * License as published by the Free Software Foundation; either
00014  * version 2.1 of the License, or (at your option) any later version.
00015  *
00016  * This library is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  * Lesser General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Lesser General Public
00022  * License along with this library; if not, write to the Free
00023  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00024  */
00025 
00026 #include <cluttermm/actor.h>
00027 #include <cluttermm/childmeta.h>
00028 #include <glibmm/interface.h>
00029 #include <glibmm/ustring.h>
00030 #include <clutter/clutter.h>
00031  
00032 
00033 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00034 typedef struct _ClutterContainer ClutterContainer;
00035 typedef struct _ClutterContainerClass ClutterContainerClass;
00036 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00037 
00038 
00039 namespace Clutter
00040 { class Container_Class; } // namespace Clutter
00041 namespace Clutter
00042 {
00043 
00044 
00045 class Container : public Glib::Interface
00046 {
00047   
00048 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00049 
00050 public:
00051   typedef Container CppObjectType;
00052   typedef Container_Class CppClassType;
00053   typedef ClutterContainer BaseObjectType;
00054   typedef ClutterContainerIface BaseClassType;
00055 
00056 private:
00057   friend class Container_Class;
00058   static CppClassType container_class_;
00059 
00060   // noncopyable
00061   Container(const Container&);
00062   Container& operator=(const Container&);
00063 
00064 protected:
00065   Container(); // you must derive from this class
00066 
00073   explicit Container(const Glib::Interface_Class& interface_class);
00074 
00075 public:
00076   // This is public so that C++ wrapper instances can be
00077   // created for C instances of unwrapped types.
00078   // For instance, if an unexpected C type implements the C interface. 
00079   explicit Container(ClutterContainer* castitem);
00080 
00081 protected:
00082 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00083 
00084 public:
00085   virtual ~Container();
00086 
00087   static void add_interface(GType gtype_implementer);
00088 
00089 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00090   static GType get_type()      G_GNUC_CONST;
00091   static GType get_base_type() G_GNUC_CONST;
00092 #endif
00093 
00095   ClutterContainer*       gobj()       { return reinterpret_cast<ClutterContainer*>(gobject_); }
00096 
00098   const ClutterContainer* gobj() const { return reinterpret_cast<ClutterContainer*>(gobject_); }
00099 
00100 private:
00101 
00102 
00103 public:
00104   
00113   void add_actor(const Glib::RefPtr<Actor>& actor);
00114   
00123   void remove_actor(const Glib::RefPtr<Actor>& actor);
00124 
00125  
00133   Glib::ListHandle<Glib::RefPtr<Actor> > get_children();
00134   
00142   Glib::ListHandle<Glib::RefPtr<const Actor> > get_children() const;
00143 
00144   
00151   void lower_child(const Glib::RefPtr<Actor>& actor, const Glib::RefPtr<Actor>& sibling);
00152   void lower_child(const Glib::RefPtr<Actor>& actor);
00153   
00160   void raise_child(const Glib::RefPtr<Actor>& actor, const Glib::RefPtr<Actor>& sibling);
00161   void raise_child(const Glib::RefPtr<Actor>& actor);
00162 
00163   
00172   Glib::RefPtr<Actor> find_child(const Glib::ustring& child_name);
00173   
00182   Glib::RefPtr<const Actor> find_child(const Glib::ustring& child_name) const;
00183 
00187   typedef sigc::slot<void, const Glib::RefPtr<Actor>&> SlotForEach;
00188 
00189   void foreach(const SlotForEach& slot);
00190   
00191 
00192   // not sure the valist stuff is good to wrap in C++
00193   
00194 
00195   template <class PropertyType> inline
00196   void set_child_property(const Glib::RefPtr<Actor>& child, const Glib::ustring& property_name, const PropertyType& value);
00197 
00198   
00206   void set_child_property_value(const Glib::RefPtr<Actor>& child, const Glib::ustring& property_name, const Glib::ValueBase& value);
00207 
00208   template <class PropertyType> inline
00209   void get_child_property(const Glib::RefPtr<const Actor>& child, const Glib::ustring& property_name, PropertyType& value) const;
00210 
00211   void get_child_property_value(const Glib::RefPtr<const Actor>& child, const Glib::ustring& property_name, Glib::ValueBase& value) const;
00212   
00213 
00223   Glib::RefPtr<ChildMeta> get_child_meta(const Glib::RefPtr<const Actor>& actor);
00224   
00234   Glib::RefPtr<const ChildMeta> get_child_meta(const Glib::RefPtr<const Actor>& actor) const;
00235 
00236  
00242   Glib::SignalProxy1< void,const Glib::RefPtr<Actor>& > signal_actor_added();
00243 
00244   
00250   Glib::SignalProxy1< void,const Glib::RefPtr<Actor>& > signal_actor_removed();
00251 
00252 
00258   Glib::SignalProxy2< void,const Glib::RefPtr<Actor>&,GParamSpec* > signal_child_notify();
00259 
00260 
00261 protected:
00262 
00263   // Only useful as a protected method for derived implementations.
00264   
00270   void sort_depth_order();
00271 
00272   #ifdef GLIBMM_VFUNCS_ENABLED
00273   virtual void add_vfunc(const Glib::RefPtr<Actor>& actor);
00274 #endif //GLIBMM_VFUNCS_ENABLED
00275 
00276   #ifdef GLIBMM_VFUNCS_ENABLED
00277   virtual void remove_vfunc(const Glib::RefPtr<Actor>& actor);
00278 #endif //GLIBMM_VFUNCS_ENABLED
00279 
00280   #ifdef GLIBMM_VFUNCS_ENABLED
00281   virtual void raise_vfunc(const Glib::RefPtr<Actor>& actor, const Glib::RefPtr<Actor>& sibling);
00282 #endif //GLIBMM_VFUNCS_ENABLED
00283 
00284   #ifdef GLIBMM_VFUNCS_ENABLED
00285   virtual void lower_vfunc(const Glib::RefPtr<Actor>& actor, const Glib::RefPtr<Actor>& sibling);
00286 #endif //GLIBMM_VFUNCS_ENABLED
00287 
00288   #ifdef GLIBMM_VFUNCS_ENABLED
00289   virtual void sort_depth_order_vfunc();
00290 #endif //GLIBMM_VFUNCS_ENABLED
00291 
00292 
00293   // TODO: C++ify?
00294   #ifdef GLIBMM_VFUNCS_ENABLED
00295   virtual void foreach_vfunc(ClutterCallback callback, gpointer user_data);
00296 #endif //GLIBMM_VFUNCS_ENABLED
00297 
00298 
00301   void actor_added(const Glib::RefPtr<Actor>& actor);
00302 
00305   void actor_removed(const Glib::RefPtr<Actor>& actor);
00306 
00307   #ifdef GLIBMM_VFUNCS_ENABLED
00308   virtual void create_child_meta_vfunc(const Glib::RefPtr<Actor>& actor);
00309 #endif //GLIBMM_VFUNCS_ENABLED
00310 
00311   #ifdef GLIBMM_VFUNCS_ENABLED
00312   virtual void destroy_child_meta_vfunc(const Glib::RefPtr<Actor>& actor);
00313 #endif //GLIBMM_VFUNCS_ENABLED
00314 
00315   #ifdef GLIBMM_VFUNCS_ENABLED
00316   virtual Glib::RefPtr<ChildMeta> get_child_meta_vfunc(const Glib::RefPtr<Actor>& actor);
00317 #endif //GLIBMM_VFUNCS_ENABLED
00318 
00319 
00320 public:
00321 
00322 public:
00323   //C++ methods used to invoke GTK+ virtual functions:
00324 #ifdef GLIBMM_VFUNCS_ENABLED
00325 #endif //GLIBMM_VFUNCS_ENABLED
00326 
00327 protected:
00328   //GTK+ Virtual Functions (override these to change behaviour):
00329 #ifdef GLIBMM_VFUNCS_ENABLED
00330 #endif //GLIBMM_VFUNCS_ENABLED
00331 
00332   //Default Signal Handlers::
00333 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00334   virtual void on_actor_added(const Glib::RefPtr<Actor>& actor);
00335   virtual void on_actor_removed(const Glib::RefPtr<Actor>& actor);
00336   virtual void on_child_notify(const Glib::RefPtr<Actor>& actor, GParamSpec* pspec);
00337 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00338 
00339 
00340 };
00341 
00342 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00343 
00344 template <class PropertyType> inline
00345 void Container::set_child_property(const Glib::RefPtr<Actor>& child, const Glib::ustring& property_name, const PropertyType& value)
00346 {
00347   Glib::Value<PropertyType> property_value;
00348   property_value.init(Glib::Value<PropertyType>::value_type());
00349 
00350   property_value.set(value);
00351   this->set_child_property_value(child, property_name, property_value);
00352 }
00353 
00354 template <class PropertyType> inline
00355 void Container::get_child_property(const Glib::RefPtr<const Actor>& child, const Glib::ustring& property_name, PropertyType& value) const
00356 {
00357   Glib::Value<PropertyType> property_value;
00358   property_value.init(Glib::Value<PropertyType>::value_type());
00359 
00360   this->get_child_property_value(child, property_name, property_value);
00361 
00362   value = property_value.get();
00363 }
00364 
00365 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00366 
00367 } // namespace Clutter
00368 
00369 
00370 namespace Glib
00371 {
00380   Glib::RefPtr<Clutter::Container> wrap(ClutterContainer* object, bool take_copy = false);
00381 
00382 } // namespace Glib
00383 
00384 
00385 #endif /* _CLUTTERMM_CONTAINER_H */
00386 

Generated on 7 Sep 2009 for cluttermm by  doxygen 1.6.1