container.h
Go to the documentation of this file.00001
00002
00003 #ifndef _CLUTTERMM_CONTAINER_H
00004 #define _CLUTTERMM_CONTAINER_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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
00037
00038
00039 namespace Clutter
00040 { class Container_Class; }
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
00061 Container(const Container&);
00062 Container& operator=(const Container&);
00063
00064 protected:
00065 Container();
00066
00073 explicit Container(const Glib::Interface_Class& interface_class);
00074
00075 public:
00076
00077
00078
00079 explicit Container(ClutterContainer* castitem);
00080
00081 protected:
00082 #endif
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
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
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
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
00324 #ifdef GLIBMM_VFUNCS_ENABLED
00325 #endif //GLIBMM_VFUNCS_ENABLED
00326
00327 protected:
00328
00329 #ifdef GLIBMM_VFUNCS_ENABLED
00330 #endif //GLIBMM_VFUNCS_ENABLED
00331
00332
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
00366
00367 }
00368
00369
00370 namespace Glib
00371 {
00380 Glib::RefPtr<Clutter::Container> wrap(ClutterContainer* object, bool take_copy = false);
00381
00382 }
00383
00384
00385 #endif
00386