gnomemm r2081 - in gstreamermm/trunk: . gstreamer/src



Author: jaalburqu
Date: Thu Mar  5 04:19:35 2009
New Revision: 2081
URL: http://svn.gnome.org/viewvc/gnomemm?rev=2081&view=rev

Log:
2009-03-04  Josà Alburquerque  <jaalburqu svn gnome org>

	* gstreamer/src/interface.hg: Const correction.
	* gstreamer/src/colorbalance.ccg:
	* gstreamer/src/colorbalance.hg: Wrapped final Gst::ColorBalance vfunc
	list_channels_vfunc().

Modified:
   gstreamermm/trunk/ChangeLog
   gstreamermm/trunk/gstreamer/src/colorbalance.ccg
   gstreamermm/trunk/gstreamer/src/colorbalance.hg
   gstreamermm/trunk/gstreamer/src/interface.hg

Modified: gstreamermm/trunk/gstreamer/src/colorbalance.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/colorbalance.ccg	(original)
+++ gstreamermm/trunk/gstreamer/src/colorbalance.ccg	Thu Mar  5 04:19:35 2009
@@ -18,3 +18,68 @@
  */
 
  #include <gstreamermm/colorbalancechannel.h>
+
+ namespace Gst
+ {
+
+#ifdef GLIBMM_VFUNCS_ENABLED
+const GList* ColorBalance_Class::list_channels_vfunc_callback(GstColorBalance* self)
+{
+  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
+      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
+
+  // Non-gtkmmproc-generated custom classes implicitly call the default
+  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
+  // generated classes can use this optimisation, which avoids the unnecessary
+  // parameter conversions if there is no possibility of the virtual function
+  // being overridden:
+  if(obj_base && obj_base->is_derived_())
+  {
+    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
+    if(obj) // This can be NULL during destruction.
+    {
+      #ifdef GLIBMM_EXCEPTIONS_ENABLED
+      try // Trap C++ exceptions which would normally be lost because this is a C callback.
+      {
+      #endif //GLIBMM_EXCEPTIONS_ENABLED
+        // Call the virtual member method, which derived classes might override.
+        return (obj->list_channels_vfunc()).data();
+      #ifdef GLIBMM_EXCEPTIONS_ENABLED
+      }
+      catch(...)
+      {
+        Glib::exception_handlers_invoke();
+      }
+      #endif //GLIBMM_EXCEPTIONS_ENABLED
+    }
+  }
+  
+  BaseClassType *const base = static_cast<BaseClassType*>(
+      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
+g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
+)  );
+
+  // Call the original underlying C function:
+  if(base && base->list_channels)
+    return (*base->list_channels)(self);
+
+
+  typedef const GList* RType;
+  return RType();
+}
+Glib::ListHandle< Glib::RefPtr<ColorBalanceChannel> > Gst::ColorBalance::list_channels_vfunc() const
+{
+  BaseClassType *const base = static_cast<BaseClassType*>(
+      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
+g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
+)  );
+
+  if(base && base->list_channels)
+    return Glib::ListHandle< Glib::RefPtr<ColorBalanceChannel> >(const_cast<GList*>((*base->list_channels)(const_cast<GstColorBalance*>(gobj()))), Glib::OWNERSHIP_NONE);
+
+  typedef Glib::ListHandle< Glib::RefPtr<ColorBalanceChannel> > RType;
+  return RType(0, Glib::OWNERSHIP_NONE);
+}
+#endif //GLIBMM_VFUNCS_ENABLED
+
+} // namespace Gst

Modified: gstreamermm/trunk/gstreamer/src/colorbalance.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/colorbalance.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/colorbalance.hg	Thu Mar  5 04:19:35 2009
@@ -53,10 +53,12 @@
   _WRAP_SIGNAL(void value_changed(const Glib::RefPtr<ColorBalanceChannel>& channel, int value), "value-changed")
 
 #m4 _CONVERSION(`Glib::ListHandle< Glib::RefPtr<ColorBalanceChannel> >', `const GList*', `($3).data()')
-  //TODO: Include when bug #530416 is resolved.
-  ///** Lists the channels of the Gst::ColorBalance.
-   //*/
-  //_WRAP_VFUNC(Glib::ListHandle< Glib::RefPtr<ColorBalanceChannel> > list_channels(), "list_channels")
+
+#ifdef GLIBMM_VFUNCS_ENABLED
+  /** Lists the channels of the Gst::ColorBalance.
+   */
+  virtual Glib::ListHandle< Glib::RefPtr<ColorBalanceChannel> > list_channels_vfunc() const;
+#endif //GLIBMM_VFUNCS_ENABLED
 
   /** Sets the value of a Gst::ColorBalanceChannel of the Gst::ColorBalance.
    */
@@ -66,6 +68,16 @@
   /** Gets the value of a Gst::ColorBalanceChannel of the Gst::ColorBalance.
    */
   _WRAP_VFUNC(int get_value(const Glib::RefPtr<const ColorBalanceChannel>& channel) const, "get_value")
+
+protected:
+#m4begin
+  _PUSH(SECTION_PCC_CLASS_INIT_VFUNCS)
+    klass->list_channels = &list_channels_vfunc_callback;
+  _SECTION(SECTION_PH_VFUNCS)
+    static const GList* list_channels_vfunc_callback(GstColorBalance* self);
+  _POP()
+#m4end
+
 };
 
 } // namespace Gst

Modified: gstreamermm/trunk/gstreamer/src/interface.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/interface.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/interface.hg	Thu Mar  5 04:19:35 2009
@@ -47,7 +47,7 @@
 
   /** Virtual method to tell whether an interface is supported.
    */
-  _WRAP_VFUNC(bool supported(GType iface_type), "supported")
+  _WRAP_VFUNC(bool supported(GType iface_type) const, "supported")
 
   //For some reason, gmmproc thinks that all of the GstElement functions (and
   //signals) are also members of GstImplementsInterface.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]