- Main Page
- Modules
- Namespaces
- Classes
- Files

# plugin.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002 // Generated by gtkmmproc -- DO NOT MODIFY!
    00003 #ifndef _GSTREAMERMM_PLUGIN_H
    00004 #define _GSTREAMERMM_PLUGIN_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/gstplugin.h>
    00029 #include <gstreamermm/object.h>
    00030
    00031
    00032 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00033 typedef struct _GstPlugin GstPlugin;
    00034 typedef struct _GstPluginClass GstPluginClass;
    00035 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00036
    00037
    00038 namespace Gst
    00039 { class Plugin_Class; } // namespace Gst
    00040 namespace Gst
    00041 {
    00042
    00049 class PluginError : public Glib::Error
    00050 {
    00051 public:
    00052   enum Code
    00053   {
    00054     MODULE,
    00055     DEPENDENCIES,
    00056     NAME_MISMATCH
    00057   };
    00058
    00059   PluginError(Code error_code, const Glib::ustring& error_message);
    00060   explicit PluginError(GError* gobject);
    00061   Code code() const;
    00062
    00063 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00064 private:
    00065
    00066 #ifdef GLIBMM_EXCEPTIONS_ENABLED
    00067   static void throw_func(GError* gobject);
    00068 #else
    00069   //When not using exceptions, we just pass the Exception object around without throwing it:
    00070   static std::auto_ptr<Glib::Error> throw_func(GError* gobject);
    00071 #endif //GLIBMM_EXCEPTIONS_ENABLED
    00072
    00073   friend void wrap_init(); // uses throw_func()
    00074 #endif
    00075 };
    00076
    00077 } // namespace Gst
    00078
    00079 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00080 namespace Glib
    00081 {
    00082
    00083 template <>
    00084 class Value<Gst::PluginError::Code> : public Glib::Value_Enum<Gst::PluginError::Code>
    00085 {
    00086 public:
    00087   static GType value_type() G_GNUC_CONST;
    00088 };
    00089
    00090 } // namespace Glib
    00091 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00092
    00093
    00094 namespace Gst
    00095 {
    00096
    00097
    00120 class Plugin : public Object
    00121 {
    00122
    00123 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00124
    00125 public:
    00126   typedef Plugin CppObjectType;
    00127   typedef Plugin_Class CppClassType;
    00128   typedef GstPlugin BaseObjectType;
    00129   typedef GstPluginClass BaseClassType;
    00130
    00131 private:  friend class Plugin_Class;
    00132   static CppClassType plugin_class_;
    00133
    00134 private:
    00135   // noncopyable
    00136   Plugin(const Plugin&);
    00137   Plugin& operator=(const Plugin&);
    00138
    00139 protected:
    00140   explicit Plugin(const Glib::ConstructParams& construct_params);
    00141   explicit Plugin(GstPlugin* castitem);
    00142
    00143 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00144
    00145 public:
    00146   virtual ~Plugin();
    00147
    00148 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00149   static GType get_type()      G_GNUC_CONST;
    00150   static GType get_base_type() G_GNUC_CONST;
    00151 #endif
    00152
    00154   GstPlugin*       gobj()       { return reinterpret_cast<GstPlugin*>(gobject_); }
    00155
    00157   const GstPlugin* gobj() const { return reinterpret_cast<GstPlugin*>(gobject_); }
    00158
    00160   GstPlugin* gobj_copy();
    00161
    00162 private:
    00163
    00164
    00165 public:
    00171   typedef sigc::slot< bool, const Glib::RefPtr<Gst::Plugin>& > SlotInit;
    00172
    00178   typedef sigc::slot< bool, const Glib::RefPtr<Gst::Plugin>& > SlotFilter;
    00179
    00180
    00181   static Glib::QueryQuark error_quark();
    00182
    00186   Glib::ustring get_name() const;
    00187
    00191   Glib::ustring get_description() const;
    00192
    00196   Glib::ustring get_filename() const;
    00197
    00201   Glib::ustring get_license() const;
    00202
    00206   Glib::ustring get_package() const;
    00207
    00211   Glib::ustring get_origin() const;
    00212
    00216   Glib::ustring get_source() const;
    00217
    00221   Glib::ustring get_version() const;
    00222
    00223
    00229   GModule* get_module();
    00230
    00236   const GModule* get_module() const;
    00237
    00238
    00242   bool is_loaded() const;
    00243
    00252 #ifdef GLIBMM_EXCEPTIONS_ENABLED
    00253   static Glib::RefPtr<Gst::Plugin> load_file(const Glib::ustring& filename);
    00254 #else
    00255   static Glib::RefPtr<Gst::Plugin> load_file(const Glib::ustring& filename, std::auto_ptr<Glib::Error>& error);
    00256 #endif //GLIBMM_EXCEPTIONS_ENABLED
    00257
    00258
    00271   Glib::RefPtr<Gst::Plugin> load();
    00272
    00277   static Glib::RefPtr<Gst::Plugin> load_by_name(const Glib::ustring& name);
    00278
    00279   // Don't wrap gst_plugin_list_free because Glib::ListHandle<> already takes
    00280   // care of freeing.
    00281
    00282
    00283 //TODO: Include if bug #545787 is accepted; remove if not.
    00284 /*
    00285   bool register_static(int major_version, int minor_version,
    00286     const Glib::ustring& name, const Glib::ustring& description,
    00287     const SlotInit& init_slot, const Glib::ustring& version,
    00288     const Glib::ustring& license, const Glib::ustring& source,
    00289     const Glib::ustring& package, const Glib::ustring& origin);
    00290 */
    00291
    00292   //gst_plugin_name_filter is a C API convenience function which tells if a
    00293   //plugin has a given name so ignore it.
    00294
    00295
    00296 public:
    00297
    00298 public:
    00299   //C++ methods used to invoke GTK+ virtual functions:
    00300 #ifdef GLIBMM_VFUNCS_ENABLED
    00301 #endif //GLIBMM_VFUNCS_ENABLED
    00302
    00303 protected:
    00304   //GTK+ Virtual Functions (override these to change behaviour):
    00305 #ifdef GLIBMM_VFUNCS_ENABLED
    00306 #endif //GLIBMM_VFUNCS_ENABLED
    00307
    00308   //Default Signal Handlers::
    00309 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00310 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00311
    00312
    00313 };
    00314
    00315 } // namespace Gst
    00316
    00317
    00318 namespace Glib
    00319 {
    00328   Glib::RefPtr<Gst::Plugin> wrap(GstPlugin* object, bool take_copy = false);
    00329 }
    00330
    00331
    00332 #endif /* _GSTREAMERMM_PLUGIN_H */
    00333