- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

# object.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002 // Generated by gtkmmproc -- DO NOT MODIFY!
    00003 #ifndef _GSTREAMERMM_OBJECT_H
    00004 #define _GSTREAMERMM_OBJECT_H
    00005
    00006
    00007 #include <glibmm.h>
    00008
    00009 /* gstreamermm - a C++ wrapper for gstreamer
    00010  *
    00011  * Copyright 2008 The gstreamermm Development Team
    00012  *
    00013  * This library is free software; you can redistribute it and/or
    00014  * modify it under the terms of the GNU Lesser General Public
    00015  * License as published by the Free Software Foundation; either
    00016  * version 2.1 of the License, or (at your option) any later version.
    00017  *
    00018  * This library is distributed in the hope that it will be useful,
    00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00021  * Lesser General Public License for more details.
    00022  *
    00023  * You should have received a copy of the GNU Lesser General Public
    00024  * License along with this library; if not, write to the Free
    00025  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00026  */
    00027
    00028 #include <gst/gstobject.h>
    00029 #include <glibmm/object.h>
    00030 #include <libxml++/nodes/node.h>
    00031
    00032
    00033 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00034 typedef struct _GstObject GstObject;
    00035 typedef struct _GstObjectClass GstObjectClass;
    00036 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00037
    00038
    00039 namespace Gst
    00040 { class Object_Class; } // namespace Gst
    00041 namespace Gst
    00042 {
    00043
    00057 enum ObjectFlags
    00058 {
    00059   OBJECT_DISPOSING = 1<<0,
    00060   OBJECT_FLOATING = 1<<1,
    00061   OBJECT_FLAG_LAST = 1<<4
    00062 };
    00063
    00065 inline ObjectFlags operator|(ObjectFlags lhs, ObjectFlags rhs)
    00066   { return static_cast<ObjectFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
    00067
    00069 inline ObjectFlags operator&(ObjectFlags lhs, ObjectFlags rhs)
    00070   { return static_cast<ObjectFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
    00071
    00073 inline ObjectFlags operator^(ObjectFlags lhs, ObjectFlags rhs)
    00074   { return static_cast<ObjectFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
    00075
    00077 inline ObjectFlags operator~(ObjectFlags flags)
    00078   { return static_cast<ObjectFlags>(~static_cast<unsigned>(flags)); }
    00079
    00081 inline ObjectFlags& operator|=(ObjectFlags& lhs, ObjectFlags rhs)
    00082   { return (lhs = static_cast<ObjectFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
    00083
    00085 inline ObjectFlags& operator&=(ObjectFlags& lhs, ObjectFlags rhs)
    00086   { return (lhs = static_cast<ObjectFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
    00087
    00089 inline ObjectFlags& operator^=(ObjectFlags& lhs, ObjectFlags rhs)
    00090   { return (lhs = static_cast<ObjectFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
    00091
    00092 } // namespace Gst
    00093
    00094
    00095 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00096 namespace Glib
    00097 {
    00098
    00099 template <>
    00100 class Value<Gst::ObjectFlags> : public Glib::Value_Flags<Gst::ObjectFlags>
    00101 {
    00102 public:
    00103   static GType value_type() G_GNUC_CONST;
    00104 };
    00105
    00106 } // namespace Glib
    00107 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00108
    00109
    00110 namespace Gst
    00111 {
    00112
    00113
    00138 class Object : public Glib::Object
    00139 {
    00140
    00141 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00142
    00143 public:
    00144   typedef Object CppObjectType;
    00145   typedef Object_Class CppClassType;
    00146   typedef GstObject BaseObjectType;
    00147   typedef GstObjectClass BaseClassType;
    00148
    00149 private:  friend class Object_Class;
    00150   static CppClassType object_class_;
    00151
    00152 private:
    00153   // noncopyable
    00154   Object(const Object&);
    00155   Object& operator=(const Object&);
    00156
    00157 protected:
    00158   explicit Object(const Glib::ConstructParams& construct_params);
    00159   explicit Object(GstObject* castitem);
    00160
    00161 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00162
    00163 public:
    00164   virtual ~Object();
    00165
    00166 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00167   static GType get_type()      G_GNUC_CONST;
    00168
    00169
    00170   static GType get_base_type() G_GNUC_CONST;
    00171 #endif
    00172
    00174   GstObject*       gobj()       { return reinterpret_cast<GstObject*>(gobject_); }
    00175
    00177   const GstObject* gobj() const { return reinterpret_cast<GstObject*>(gobject_); }
    00178
    00180   GstObject* gobj_copy();
    00181
    00182 private:
    00183
    00184
    00185 public:
    00188    guint32 get_flags() const;
    00189
    00190   //TODO: _MEMBER_GET(lock, lock, Glib::Mutex, GMutex)
    00191
    00192
    00204   bool set_name(const Glib::ustring& name);
    00205
    00211   Glib::ustring get_name() const;
    00212
    00224   bool set_parent(const Glib::RefPtr<Gst::Object>& parent);
    00225
    00232   Glib::RefPtr<Gst::Object> get_parent();
    00233
    00240   Glib::RefPtr<const Gst::Object> get_parent() const;
    00241
    00247   void unparent();
    00248
    00254   Glib::ustring get_name_prefix() const;
    00255
    00263   void set_name_prefix(const Glib::ustring& name_prefix);
    00264
    00265   // Ignore default signal and error callback.
    00266
    00267
    00280   static bool check_uniqueness(const Glib::ListHandle<const Gst::Object>& list, const Glib::ustring& name);
    00281
    00282
    00290   bool has_ancestor(const Glib::RefPtr<const Gst::Object>& ancestor) const;
    00291
    00296   xmlpp::Node* save(xmlpp::Node* parent);
    00297
    00298
    00303   const xmlpp::Node* save(const xmlpp::Node* parent) const;
    00304
    00305
    00309   void restore(xmlpp::Node* self);
    00310
    00319   Glib::ustring get_path_string();
    00320
    00321
    00326   //TODO: Maybe GParamSpec should be wrapped in glibmm?
    00327
    00333   Glib::SignalProxy2< void,const Glib::RefPtr<Object>&,GParamSpec* > signal_deep_notify();
    00334
    00335
    00339   //TODO: Use xmlpp::Node for parameter?
    00340
    00346   Glib::SignalProxy1< void,GstXmlNodePtr > signal_object_saved();
    00347
    00348
    00355   Glib::SignalProxy1< void,const Glib::RefPtr<Object>& > signal_parent_set();
    00356
    00357
    00364   Glib::SignalProxy1< void,const Glib::RefPtr<Object>& > signal_parent_unset();
    00365
    00366
    00367 #ifdef GLIBMM_VFUNCS_ENABLED
    00368   virtual xmlpp::Node* save_vfunc(xmlpp::Node* parent);
    00369   virtual void restore_vfunc(xmlpp::Node* self_node);
    00370 #endif //GLIBMM_VFUNCS_ENABLED
    00371
    00372 protected:
    00373
    00374
    00375 public:
    00376
    00377 public:
    00378   //C++ methods used to invoke GTK+ virtual functions:
    00379 #ifdef GLIBMM_VFUNCS_ENABLED
    00380 #endif //GLIBMM_VFUNCS_ENABLED
    00381
    00382 protected:
    00383   //GTK+ Virtual Functions (override these to change behaviour):
    00384 #ifdef GLIBMM_VFUNCS_ENABLED
    00385 #endif //GLIBMM_VFUNCS_ENABLED
    00386
    00387   //Default Signal Handlers::
    00388 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00389   virtual void on_deep_notify(const Glib::RefPtr<Object>& prop_object, GParamSpec* prop);
    00390   virtual void on_object_saved(GstXmlNodePtr xml_node);
    00391   virtual void on_parent_set(const Glib::RefPtr<Object>& parent);
    00392   virtual void on_parent_unset(const Glib::RefPtr<Object>& parent);
    00393 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00394
    00395
    00396 };
    00397
    00398 } // namespace Gst
    00399
    00400
    00401 namespace Glib
    00402 {
    00411   Glib::RefPtr<Gst::Object> wrap(GstObject* object, bool take_copy = false);
    00412 }
    00413
    00414
    00415 #endif /* _GSTREAMERMM_OBJECT_H */
    00416