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 Library General Public
00013  * License as published by the Free Software Foundation; either
00014  * version 2 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  * Library General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Library 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 <glibmm/interface.h>
00028 #include <glibmm/ustring.h>
00029 #include <clutter/clutter-container.h>
00030  
00031 
00032 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00033 typedef struct _ClutterContainer ClutterContainer;
00034 typedef struct _ClutterContainerClass ClutterContainerClass;
00035 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00036 
00037 
00038 namespace Clutter
00039 { class Container_Class; } // namespace Clutter
00040 namespace Clutter
00041 {
00042 
00043 
00044 class Container : public Glib::Interface
00045 {
00046   
00047 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00048 
00049 public:
00050   typedef Container CppObjectType;
00051   typedef Container_Class CppClassType;
00052   typedef ClutterContainer BaseObjectType;
00053   typedef ClutterContainerIface BaseClassType;
00054 
00055 private:
00056   friend class Container_Class;
00057   static CppClassType container_class_;
00058 
00059   // noncopyable
00060   Container(const Container&);
00061   Container& operator=(const Container&);
00062 
00063 protected:
00064   Container(); // you must derive from this class
00065 
00072   explicit Container(const Glib::Interface_Class& interface_class);
00073 
00074 public:
00075   // This is public so that C++ wrapper instances can be
00076   // created for C instances of unwrapped types.
00077   // For instance, if an unexpected C type implements the C interface. 
00078   explicit Container(ClutterContainer* castitem);
00079 
00080 protected:
00081 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00082 
00083 public:
00084   virtual ~Container();
00085 
00086   static void add_interface(GType gtype_implementer);
00087 
00088 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00089   static GType get_type()      G_GNUC_CONST;
00090   static GType get_base_type() G_GNUC_CONST;
00091 #endif
00092 
00094   ClutterContainer*       gobj()       { return reinterpret_cast<ClutterContainer*>(gobject_); }
00095 
00097   const ClutterContainer* gobj() const { return reinterpret_cast<ClutterContainer*>(gobject_); }
00098 
00099 private:
00100 
00101 
00102 public:
00103   
00112   void add_actor(const Glib::RefPtr<Actor>& actor);
00113   
00122   void remove_actor(const Glib::RefPtr<Actor>& actor);
00123 
00124  
00131   Glib::ListHandle<Glib::RefPtr<Actor> > get_children();
00132   
00139   Glib::ListHandle<Glib::RefPtr<const Actor> > get_children() const;
00140 
00141   
00148   void lower_child(const Glib::RefPtr<Actor>& actor, const Glib::RefPtr<Actor>& sibling);
00149   void lower_child(const Glib::RefPtr<Actor>& actor);
00150   
00157   void raise_child(const Glib::RefPtr<Actor>& actor, const Glib::RefPtr<Actor>& sibling);
00158   void raise_child(const Glib::RefPtr<Actor>& actor);
00159 
00160   
00169   Glib::RefPtr<Actor> find_child (const Glib::ustring& child_name);
00170   
00179   Glib::RefPtr<const Actor> find_child (const Glib::ustring& child_name) const;
00180 
00184   typedef sigc::slot<void, const Glib::RefPtr<Actor>&> SlotForEach;
00185 
00186   void foreach(const SlotForEach& slot);
00187   
00188 
00189   // not sure the valist stuff is good to wrap in C++
00190   
00191 
00192   template <class PropertyType> inline
00193   void set_child_property(const Glib::RefPtr<Actor>& child, const Glib::ustring& property_name, const PropertyType& value);
00194 
00195   
00203   void set_child_property_value(const Glib::RefPtr<Actor>& child, const Glib::ustring& property_name, const Glib::ValueBase& value);
00204 
00205   template <class PropertyType> inline
00206   void get_child_property(const Glib::RefPtr<const Actor>& child, const Glib::ustring& property_name, PropertyType& value) const;
00207 
00208   void get_child_property_value(const Glib::RefPtr<const Actor>& child, const Glib::ustring& property_name, Glib::ValueBase& value) const;
00209   
00210 
00211   /*
00212 
00213 void              clutter_container_child_get_property          (ClutterContainer *container,
00214                                                                  ClutterActor     *child,
00215                                                                  const gchar      *property,
00216                                                                  GValue           *value);
00217 void              clutter_container_child_set                   (ClutterContainer *container,
00218                                                                  ClutterActor     *actor,
00219                                                                  const gchar      *first_prop,
00220                                                                  ...) G_GNUC_NULL_TERMINATED;
00221 void              clutter_container_child_get                   (ClutterContainer *container,
00222                                                                  ClutterActor     *actor,
00223                                                                  const gchar      *first_prop,
00224                                                                  ...) G_GNUC_NULL_TERMINATED;
00225 
00226   */
00227 
00228   // TODO: clutter_container_get_child_meta?
00229 
00230 
00236   Glib::SignalProxy1< void,const Glib::RefPtr<Actor>& > signal_actor_added();
00237 
00238   
00244   Glib::SignalProxy1< void,const Glib::RefPtr<Actor>& > signal_actor_removed();
00245 
00246 
00247   // TODO: child-notify signal? Perhaps doesn't make sense until we wrap
00248   // the ClutterChildMeta stuff, and clutter_container_get/set_child_property.
00249 
00250 protected:
00251 
00252   // Only useful as a protected method for derived implementations.
00253   
00259   void sort_depth_order();
00260 
00261   #ifdef GLIBMM_VFUNCS_ENABLED
00262   virtual void add_vfunc(const Glib::RefPtr<Actor>& actor);
00263 #endif //GLIBMM_VFUNCS_ENABLED
00264 
00265   #ifdef GLIBMM_VFUNCS_ENABLED
00266   virtual void remove_vfunc(const Glib::RefPtr<Actor>& actor);
00267 #endif //GLIBMM_VFUNCS_ENABLED
00268 
00269   #ifdef GLIBMM_VFUNCS_ENABLED
00270   virtual void raise_vfunc(const Glib::RefPtr<Actor>& actor, const Glib::RefPtr<Actor>& sibling);
00271 #endif //GLIBMM_VFUNCS_ENABLED
00272 
00273   #ifdef GLIBMM_VFUNCS_ENABLED
00274   virtual void lower_vfunc(const Glib::RefPtr<Actor>& actor, const Glib::RefPtr<Actor>& lower);
00275 #endif //GLIBMM_VFUNCS_ENABLED
00276 
00277   #ifdef GLIBMM_VFUNCS_ENABLED
00278   virtual void sort_depth_order_vfunc();
00279 #endif //GLIBMM_VFUNCS_ENABLED
00280 
00281 
00282   #ifdef GLIBMM_VFUNCS_ENABLED
00283   virtual void foreach_vfunc(ClutterCallback callback, gpointer user_data);
00284 #endif //GLIBMM_VFUNCS_ENABLED
00285 
00286 
00287   // TODO: Do we want to wrap create_child_meta, destory_child_meta,
00288   // get_child_meta?
00289 
00290 
00291 public:
00292 
00293 public:
00294   //C++ methods used to invoke GTK+ virtual functions:
00295 #ifdef GLIBMM_VFUNCS_ENABLED
00296 #endif //GLIBMM_VFUNCS_ENABLED
00297 
00298 protected:
00299   //GTK+ Virtual Functions (override these to change behaviour):
00300 #ifdef GLIBMM_VFUNCS_ENABLED
00301 #endif //GLIBMM_VFUNCS_ENABLED
00302 
00303   //Default Signal Handlers::
00304 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00305   virtual void on_actor_added(const Glib::RefPtr<Actor>& actor);
00306   virtual void on_actor_removed(const Glib::RefPtr<Actor>& actor);
00307 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00308 
00309 
00310 };
00311 
00312 
00313 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00314 
00315 template <class PropertyType> inline
00316 void Container::set_child_property(const Glib::RefPtr<Actor>& child, const Glib::ustring& property_name, const PropertyType& value)
00317 {
00318   Glib::Value<PropertyType> property_value;
00319   property_value.init(Glib::Value<PropertyType>::value_type());
00320 
00321   property_value.set(value);
00322   this->set_child_property_value(child, property_name, property_value);
00323 }
00324 
00325 template <class PropertyType> inline
00326 void Container::get_child_property(const Glib::RefPtr<const Actor>& child, const Glib::ustring& property_name, PropertyType& value) const
00327 {
00328   Glib::Value<PropertyType> property_value;
00329   property_value.init(Glib::Value<PropertyType>::value_type());
00330 
00331   this->get_child_property_value(child, property_name, property_value);
00332 
00333   value = property_value.get();
00334 }
00335 
00336 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00337 
00338 
00339 } // namespace Clutter
00340 //vim: ts=2,sw=2
00341 
00342 
00343 namespace Glib
00344 {
00353   Glib::RefPtr<Clutter::Container> wrap(ClutterContainer* object, bool take_copy = false);
00354 
00355 } // namespace Glib
00356 
00357 
00358 #endif /* _CLUTTERMM_CONTAINER_H */
00359 

Generated on Mon Sep 15 05:42:28 2008 for cluttermm by  doxygen 1.5.6