// Generated by gmmproc 2.50.1 -- DO NOT MODIFY! #include #include #include /* gstreamermm - a C++ wrapper for gstreamer * * Copyright 2008-2016 The gstreamermm Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include namespace Gst { const GList* ColorBalance_Class::list_channels_vfunc_callback(GstColorBalance* self) { Glib::ObjectBase *const obj_base = static_cast( 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(obj_base); if(obj) // This can be NULL during destruction. { try // Trap C++ exceptions which would normally be lost because this is a C callback. { // Call the virtual member method, which derived classes might override. return (obj->list_channels_vfunc()).data(); } catch(...) { Glib::exception_handlers_invoke(); } } } BaseClassType *const base = static_cast( 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 > Gst::ColorBalance::list_channels_vfunc() const { BaseClassType *const base = static_cast( 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 >(const_cast((*base->list_channels)(const_cast(gobj()))), Glib::OWNERSHIP_NONE); typedef Glib::ListHandle< Glib::RefPtr > RType; return RType(0, Glib::OWNERSHIP_NONE); } } // namespace Gst namespace { static void ColorBalance_signal_value_changed_callback(GstColorBalance* self, GstColorBalanceChannel* p0,gint p1,void* data) { using namespace Gst; using SlotType = sigc::slot< void,const Glib::RefPtr&,int >; auto obj = dynamic_cast(Glib::ObjectBase::_get_current_wrapper((GObject*) self)); // Do not try to call a signal on a disassociated wrapper. if(obj) { try { if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data)) (*static_cast(slot))(Glib::wrap(p0, true) , p1 ); } catch(...) { Glib::exception_handlers_invoke(); } } } static const Glib::SignalProxyInfo ColorBalance_signal_value_changed_info = { "value-changed", (GCallback) &ColorBalance_signal_value_changed_callback, (GCallback) &ColorBalance_signal_value_changed_callback }; } // anonymous namespace namespace Glib { Glib::RefPtr wrap(GstColorBalance* object, bool take_copy) { return Glib::RefPtr( dynamic_cast (Glib::wrap_auto_interface ((GObject*)(object), take_copy)) ); //We use dynamic_cast<> in case of multiple inheritance. } } // namespace Glib namespace Gst { /* The *_Class implementation: */ const Glib::Interface_Class& ColorBalance_Class::init() { if(!gtype_) // create the GType if necessary { // Glib::Interface_Class has to know the interface init function // in order to add interfaces to implementing types. class_init_func_ = &ColorBalance_Class::iface_init_function; // We can not derive from another interface, and it is not necessary anyway. gtype_ = gst_color_balance_get_type(); } return *this; } void ColorBalance_Class::iface_init_function(void* g_iface, void*) { const auto klass = static_cast(g_iface); //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc g_assert(klass != nullptr); klass->set_value = &set_value_vfunc_callback; klass->get_value = &get_value_vfunc_callback; klass->get_balance_type = &get_balance_type_vfunc_callback; klass->list_channels = &list_channels_vfunc_callback; klass->value_changed = &value_changed_callback; } void ColorBalance_Class::set_value_vfunc_callback(GstColorBalance* self, GstColorBalanceChannel* balance, gint value) { const auto obj_base = static_cast( 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_()) { const auto obj = dynamic_cast(obj_base); if(obj) // This can be NULL during destruction. { try // Trap C++ exceptions which would normally be lost because this is a C callback. { // Call the virtual member method, which derived classes might override. obj->set_value_vfunc(Glib::wrap(balance, true) , value ); return; } catch(...) { Glib::exception_handlers_invoke(); } } } BaseClassType *const base = static_cast( 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->set_value) (*base->set_value)(self, balance, value); } gint ColorBalance_Class::get_value_vfunc_callback(GstColorBalance* self, GstColorBalanceChannel* balance) { const auto obj_base = static_cast( 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_()) { const auto obj = dynamic_cast(obj_base); if(obj) // This can be NULL during destruction. { try // Trap C++ exceptions which would normally be lost because this is a C callback. { // Call the virtual member method, which derived classes might override. return obj->get_value_vfunc(Glib::wrap(balance, true) ); } catch(...) { Glib::exception_handlers_invoke(); } } } BaseClassType *const base = static_cast( 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->get_value) return (*base->get_value)(self, balance); using RType = gint; return RType(); } GstColorBalanceType ColorBalance_Class::get_balance_type_vfunc_callback(GstColorBalance* self) { const auto obj_base = static_cast( 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_()) { const auto obj = dynamic_cast(obj_base); if(obj) // This can be NULL during destruction. { try // Trap C++ exceptions which would normally be lost because this is a C callback. { // Call the virtual member method, which derived classes might override. return ((GstColorBalanceType)(obj->get_balance_type_vfunc())); } catch(...) { Glib::exception_handlers_invoke(); } } } BaseClassType *const base = static_cast( 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->get_balance_type) return (*base->get_balance_type)(self); using RType = GstColorBalanceType; return RType(); } void ColorBalance_Class::value_changed_callback(GstColorBalance* self, GstColorBalanceChannel* p0, gint p1) { const auto obj_base = static_cast( 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_()) { const auto obj = dynamic_cast(obj_base); if(obj) // This can be NULL during destruction. { try // Trap C++ exceptions which would normally be lost because this is a C callback. { // Call the virtual member method, which derived classes might override. obj->on_value_changed(Glib::wrap(p0, true) , p1 ); return; } catch(...) { Glib::exception_handlers_invoke(); } } } const auto base = static_cast( 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->value_changed) (*base->value_changed)(self, p0, p1); } Glib::ObjectBase* ColorBalance_Class::wrap_new(GObject* object) { return new ColorBalance((GstColorBalance*)(object)); } /* The implementation: */ ColorBalance::ColorBalance() : Glib::Interface(colorbalance_class_.init()) {} ColorBalance::ColorBalance(GstColorBalance* castitem) : Glib::Interface((GObject*)(castitem)) {} ColorBalance::ColorBalance(const Glib::Interface_Class& interface_class) : Glib::Interface(interface_class) { } ColorBalance::ColorBalance(ColorBalance&& src) noexcept : Glib::Interface(std::move(src)) {} ColorBalance& ColorBalance::operator=(ColorBalance&& src) noexcept { Glib::Interface::operator=(std::move(src)); return *this; } ColorBalance::~ColorBalance() noexcept {} // static void ColorBalance::add_interface(GType gtype_implementer) { colorbalance_class_.init().add_interface(gtype_implementer); } ColorBalance::CppClassType ColorBalance::colorbalance_class_; // initialize static member GType ColorBalance::get_type() { return colorbalance_class_.init().get_type(); } GType ColorBalance::get_base_type() { return gst_color_balance_get_type(); } Glib::ListHandle< Glib::RefPtr > ColorBalance::list_channels() { return Glib::ListHandle< Glib::RefPtr >(const_cast(gst_color_balance_list_channels(gobj())), Glib::OWNERSHIP_NONE); } Glib::ListHandle< Glib::RefPtr > ColorBalance::list_channels() const { return Glib::ListHandle< Glib::RefPtr >(const_cast(gst_color_balance_list_channels(const_cast(gobj()))), Glib::OWNERSHIP_NONE); } int ColorBalance::get_value(const Glib::RefPtr& channel) const { return gst_color_balance_get_value(const_cast(gobj()), const_cast(Glib::unwrap(channel))); } void ColorBalance::set_value(const Glib::RefPtr& channel, int value) { gst_color_balance_set_value(gobj(), Glib::unwrap(channel), value); } void ColorBalance::value_changed(const Glib::RefPtr& channel, int value) { gst_color_balance_value_changed(gobj(), Glib::unwrap(channel), value); } Gst::ColorBalanceType ColorBalance::get_balance_type() const { return ((Gst::ColorBalanceType)(gst_color_balance_get_balance_type(const_cast(gobj())))); } Glib::SignalProxy< void,const Glib::RefPtr&,int > ColorBalance::signal_value_changed() { return Glib::SignalProxy< void,const Glib::RefPtr&,int >(this, &ColorBalance_signal_value_changed_info); } void Gst::ColorBalance::on_value_changed(const Glib::RefPtr& channel, int value) { const auto base = static_cast( 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->value_changed) (*base->value_changed)(gobj(),Glib::unwrap(channel),value); } void Gst::ColorBalance::set_value_vfunc(const Glib::RefPtr& channel, int value) { const auto base = static_cast( 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->set_value) { (*base->set_value)(gobj(),Glib::unwrap(channel),value); } } int Gst::ColorBalance::get_value_vfunc(const Glib::RefPtr& channel) const { const auto base = static_cast( 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->get_value) { int retval((*base->get_value)(const_cast(gobj()),const_cast(Glib::unwrap(channel)))); return retval; } using RType = int; return RType(); } Gst::ColorBalanceType Gst::ColorBalance::get_balance_type_vfunc() { const auto base = static_cast( 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->get_balance_type) { Gst::ColorBalanceType retval(((Gst::ColorBalanceType)((*base->get_balance_type)(gobj())))); return retval; } using RType = Gst::ColorBalanceType; return RType(); } } // namespace Gst