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 <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
00036
00037
00038 namespace Clutter
00039 { class Container_Class; }
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
00060 Container(const Container&);
00061 Container& operator=(const Container&);
00062
00063 protected:
00064 Container();
00065
00072 explicit Container(const Glib::Interface_Class& interface_class);
00073
00074 public:
00075
00076
00077
00078 explicit Container(ClutterContainer* castitem);
00079
00080 protected:
00081 #endif
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
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
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
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
00248
00249
00250 protected:
00251
00252
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
00288
00289
00290
00291 public:
00292
00293 public:
00294
00295 #ifdef GLIBMM_VFUNCS_ENABLED
00296 #endif //GLIBMM_VFUNCS_ENABLED
00297
00298 protected:
00299
00300 #ifdef GLIBMM_VFUNCS_ENABLED
00301 #endif //GLIBMM_VFUNCS_ENABLED
00302
00303
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
00337
00338
00339 }
00340
00341
00342
00343 namespace Glib
00344 {
00353 Glib::RefPtr<Clutter::Container> wrap(ClutterContainer* object, bool take_copy = false);
00354
00355 }
00356
00357
00358 #endif
00359