- Main Page
- Modules
- Namespaces
- Classes
- Files

# 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   static GType get_base_type() G_GNUC_CONST;
    00169 #endif
    00170
    00172   GstObject*       gobj()       { return reinterpret_cast<GstObject*>(gobject_); }
    00173
    00175   const GstObject* gobj() const { return reinterpret_cast<GstObject*>(gobject_); }
    00176
    00178   GstObject* gobj_copy();
    00179
    00180 private:
    00181
    00182
    00183 public:
    00186    guint32 get_flags() const;
    00187
    00188   //TODO: _MEMBER_GET(lock, lock, Glib::Mutex, GMutex)
    00189
    00190
    00202   bool set_name(const Glib::ustring& name);
    00203
    00209   Glib::ustring get_name() const;
    00210
    00222   bool set_parent(const Glib::RefPtr<Gst::Object>& parent);
    00223
    00230   Glib::RefPtr<Gst::Object> get_parent();
    00231
    00238   Glib::RefPtr<const Gst::Object> get_parent() const;
    00239
    00245   void unparent();
    00246
    00252   Glib::ustring get_name_prefix() const;
    00253
    00261   void set_name_prefix(const Glib::ustring& name_prefix);
    00262
    00263   // Ignore default signal and error callback.
    00264
    00265
    00278   static bool check_uniqueness(const Glib::ListHandle<const Gst::Object>& list, const Glib::ustring& name);
    00279
    00280
    00288   bool has_ancestor(const Glib::RefPtr<const Gst::Object>& ancestor) const;
    00289
    00294   xmlpp::Node* save(xmlpp::Node* parent);
    00295
    00296
    00301   const xmlpp::Node* save(const xmlpp::Node* parent) const;
    00302
    00303
    00307   void restore(xmlpp::Node* self);
    00308
    00317   Glib::ustring get_path_string();
    00318
    00319
    00324   //TODO: Maybe GParamSpec should be wrapped in glibmm?
    00325
    00331   Glib::SignalProxy2< void,const Glib::RefPtr<Object>&,GParamSpec* > signal_deep_notify();
    00332
    00333
    00337   //TODO: Use xmlpp::Node for parameter?
    00338
    00344   Glib::SignalProxy1< void,GstXmlNodePtr > signal_object_saved();
    00345
    00346
    00353   Glib::SignalProxy1< void,const Glib::RefPtr<Object>& > signal_parent_set();
    00354
    00355
    00362   Glib::SignalProxy1< void,const Glib::RefPtr<Object>& > signal_parent_unset();
    00363
    00364
    00365 #ifdef GLIBMM_VFUNCS_ENABLED
    00366   virtual xmlpp::Node* save_vfunc(xmlpp::Node* parent);
    00367   virtual void restore_vfunc(xmlpp::Node* self_node);
    00368 #endif //GLIBMM_VFUNCS_ENABLED
    00369
    00370 protected:
    00371
    00372
    00373 public:
    00374
    00375 public:
    00376   //C++ methods used to invoke GTK+ virtual functions:
    00377 #ifdef GLIBMM_VFUNCS_ENABLED
    00378 #endif //GLIBMM_VFUNCS_ENABLED
    00379
    00380 protected:
    00381   //GTK+ Virtual Functions (override these to change behaviour):
    00382 #ifdef GLIBMM_VFUNCS_ENABLED
    00383 #endif //GLIBMM_VFUNCS_ENABLED
    00384
    00385   //Default Signal Handlers::
    00386 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00387   virtual void on_deep_notify(const Glib::RefPtr<Object>& prop_object, GParamSpec* prop);
    00388   virtual void on_object_saved(GstXmlNodePtr xml_node);
    00389   virtual void on_parent_set(const Glib::RefPtr<Object>& parent);
    00390   virtual void on_parent_unset(const Glib::RefPtr<Object>& parent);
    00391 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00392
    00393
    00394 };
    00395
    00396 } // namespace Gst
    00397
    00398
    00399 namespace Glib
    00400 {
    00409   Glib::RefPtr<Gst::Object> wrap(GstObject* object, bool take_copy = false);
    00410 }
    00411
    00412
    00413 #endif /* _GSTREAMERMM_OBJECT_H */
    00414