object.h

Go to the documentation of this file.
00001 #ifndef _GSTMM_OBJECT_H
00002 #define _GSTMM_OBJECT_H
00003 
00004 
00005 #include <glibmm.h>
00006 #include <glibmm/object.h>
00007 
00008 
00009 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00010 typedef struct _GstObject GstObject;
00011 typedef struct _GstObjectClass GstObjectClass;
00012 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00013 
00014 
00015 namespace Gst
00016 {
00017 class Object_Class;
00018 } // namespace Gst
00019 
00020 namespace Gst
00021 {
00022 
00023 //Note that this is hand-coded (instead of using .hg and .ccg files with gmmproc),
00024 //so that we can add code to the Object(GObject*) constructor.
00025 //(If this becomes difficult then we might add a _CUSTOM_CAST_CTOR() macro to gmmproc).
00026 
00030 class Object : public Glib::Object 
00031 {
00032   
00033 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00034 
00035 public:
00036   typedef Object CppObjectType;
00037   typedef Object_Class CppClassType;
00038   typedef GstObject BaseObjectType;
00039   typedef GstObjectClass BaseClassType;
00040 
00041 private:  friend class Object_Class;
00042   static CppClassType object_class_;
00043 
00044 private:
00045   // noncopyable
00046   Object(const Object&);
00047   Object& operator=(const Object&);
00048 
00049 protected:
00050   explicit Object(const Glib::ConstructParams& construct_params);
00051   explicit Object(GstObject* castitem);
00052 
00053 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00054 
00055 public:
00056   virtual ~Object();
00057 
00058 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00059   static GType get_type()      G_GNUC_CONST;
00060   static GType get_base_type() G_GNUC_CONST;
00061 #endif
00062 
00064   GstObject*       gobj()       { return reinterpret_cast<GstObject*>(gobject_); }
00065 
00067   const GstObject* gobj() const { return reinterpret_cast<GstObject*>(gobject_); }
00068 
00070   GstObject* gobj_copy();
00071 
00072 protected:
00073   Object();
00074 
00075 public:
00076 
00077   //Note that gst_object_ref() and gst_object_unref() just call the GObject functions, with some extra debug logging.
00078   void reference() const;
00079   void unreference() const;
00080 
00081   
00082   bool set_name(const Glib::ustring& name);
00083   Glib::ustring get_name() const;
00084   
00085   bool set_parent(const Glib::RefPtr<Object>& parent);
00086   Glib::RefPtr<Object> get_parent();
00087   Glib::RefPtr<const Object> get_parent() const;
00088 
00089   
00090   void unparent();
00091   
00092   Glib::ustring get_name_prefix() const;
00093   void set_name_prefix(const Glib::ustring& prefix);
00094 
00095   //TODO: Is this useful? (Note that the .def needs to be fixed by hand): _WRAP_SIGNAL(void deep_notify(Glib::RefPtr<Object> prop_object, GParamSpec* prop), "deep-notify")
00096   //TODO: Is this useful? _WRAP_SIGNAL(void object_saved(xmlNodePtr xml_node), "object-saved")  
00097   //TODO: When the C signal registration has been fixed: _WRAP_SIGNAL(void parent_set(Glib::RefPtr<Object> parent), "parent-set")
00098   //TODO: When the C signal registration has been fixed: _WRAP_SIGNAL(void parent_unset(Glib::RefPtr<Object> parent), "parent-unset")
00099 
00100   #ifdef GLIBMM_PROPERTIES_ENABLED
00101 
00107   Glib::PropertyProxy<Glib::ustring> property_name() ;
00108 #endif //#GLIBMM_PROPERTIES_ENABLED
00109 
00110 #ifdef GLIBMM_PROPERTIES_ENABLED
00111 
00117   Glib::PropertyProxy_ReadOnly<Glib::ustring> property_name() const;
00118 #endif //#GLIBMM_PROPERTIES_ENABLED
00119 
00120 };
00121 
00122 } // namespace Gst
00123 
00124 
00125 namespace Glib
00126 {
00135   Glib::RefPtr<Gst::Object> wrap(GstObject* object, bool take_copy = false);
00136 }
00137 
00138 
00139 #endif /* _GSTMM_OBJECT_H */
00140 

Generated on Sat Jan 26 11:53:53 2008 for gstreamermm by  doxygen 1.5.1