// 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 { bool ChildProxy::lookup(const Glib::ustring& name, Glib::RefPtr& target, GParamSpec*& pspec) { GObject* g_object = nullptr; bool const result = gst_child_proxy_lookup(gobj(), name.c_str(), &g_object, &pspec); target = Glib::wrap(g_object); return result; } Glib::RefPtr ChildProxy::get_proxy_property(const Glib::ustring& name, Glib::ValueBase& value) { gst_child_proxy_get_property(const_cast(gobj()), name.c_str(), value.gobj()); return Glib::wrap(gobj(), true); } Glib::RefPtr ChildProxy::get_proxy_property(const Glib::ustring& name, Glib::ValueBase& value) const { gst_child_proxy_get_property(const_cast(gobj()), name.c_str(), value.gobj()); return Glib::wrap(const_cast(gobj()), true); } Glib::RefPtr ChildProxy::set_proxy_property(const Glib::ustring& name, const Glib::ValueBase& value) { gst_child_proxy_set_property(const_cast(gobj()), name.c_str(), value.gobj()); return Glib::wrap(gobj(), true); } } //namespace Gst namespace { static void ChildProxy_signal_child_added_callback(GstChildProxy* self, GObject* p0,const gchar* p1,void* data) { using namespace Gst; using SlotType = sigc::slot< void,const Glib::RefPtr&,const Glib::ustring& >; 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(GST_OBJECT(p0), true) , Glib::convert_const_gchar_ptr_to_ustring(p1) ); } catch(...) { Glib::exception_handlers_invoke(); } } } static const Glib::SignalProxyInfo ChildProxy_signal_child_added_info = { "child-added", (GCallback) &ChildProxy_signal_child_added_callback, (GCallback) &ChildProxy_signal_child_added_callback }; static void ChildProxy_signal_child_removed_callback(GstChildProxy* self, GObject* p0,const gchar* p1,void* data) { using namespace Gst; using SlotType = sigc::slot< void,const Glib::RefPtr&,const Glib::ustring& >; 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(GST_OBJECT(p0), true) , Glib::convert_const_gchar_ptr_to_ustring(p1) ); } catch(...) { Glib::exception_handlers_invoke(); } } } static const Glib::SignalProxyInfo ChildProxy_signal_child_removed_info = { "child-removed", (GCallback) &ChildProxy_signal_child_removed_callback, (GCallback) &ChildProxy_signal_child_removed_callback }; } // anonymous namespace namespace Glib { Glib::RefPtr wrap(GstChildProxy* 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& ChildProxy_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_ = &ChildProxy_Class::iface_init_function; // We can not derive from another interface, and it is not necessary anyway. gtype_ = gst_child_proxy_get_type(); } return *this; } void ChildProxy_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->get_child_by_name = &get_child_by_name_vfunc_callback; klass->get_child_by_index = &get_child_by_index_vfunc_callback; klass->get_children_count = &get_children_count_vfunc_callback; klass->child_added = &child_added_callback; klass->child_removed = &child_removed_callback; } GObject* ChildProxy_Class::get_child_by_name_vfunc_callback(GstChildProxy* self, const gchar* name) { 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 Glib::unwrap(obj->get_child_by_name_vfunc(Glib::convert_const_gchar_ptr_to_ustring(name) )); } 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_child_by_name) return (*base->get_child_by_name)(self, name); using RType = GObject*; return RType(); } GObject* ChildProxy_Class::get_child_by_index_vfunc_callback(GstChildProxy* self, guint index) { 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 Glib::unwrap(obj->get_child_by_index_vfunc(index)); } 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_child_by_index) return (*base->get_child_by_index)(self, index); using RType = GObject*; return RType(); } guint ChildProxy_Class::get_children_count_vfunc_callback(GstChildProxy* 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 obj->get_children_count_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_children_count) return (*base->get_children_count)(self); using RType = guint; return RType(); } void ChildProxy_Class::child_added_callback(GstChildProxy* self, GObject* p0, const gchar* 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_child_added(Glib::wrap(GST_OBJECT(p0), true) , Glib::convert_const_gchar_ptr_to_ustring(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->child_added) (*base->child_added)(self, p0, p1); } void ChildProxy_Class::child_removed_callback(GstChildProxy* self, GObject* p0, const gchar* 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_child_removed(Glib::wrap(GST_OBJECT(p0), true) , Glib::convert_const_gchar_ptr_to_ustring(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->child_removed) (*base->child_removed)(self, p0, p1); } Glib::ObjectBase* ChildProxy_Class::wrap_new(GObject* object) { return new ChildProxy((GstChildProxy*)(object)); } /* The implementation: */ ChildProxy::ChildProxy() : Glib::Interface(childproxy_class_.init()) {} ChildProxy::ChildProxy(GstChildProxy* castitem) : Glib::Interface((GObject*)(castitem)) {} ChildProxy::ChildProxy(const Glib::Interface_Class& interface_class) : Glib::Interface(interface_class) { } ChildProxy::ChildProxy(ChildProxy&& src) noexcept : Glib::Interface(std::move(src)) {} ChildProxy& ChildProxy::operator=(ChildProxy&& src) noexcept { Glib::Interface::operator=(std::move(src)); return *this; } ChildProxy::~ChildProxy() noexcept {} // static void ChildProxy::add_interface(GType gtype_implementer) { childproxy_class_.init().add_interface(gtype_implementer); } ChildProxy::CppClassType ChildProxy::childproxy_class_; // initialize static member GType ChildProxy::get_type() { return childproxy_class_.init().get_type(); } GType ChildProxy::get_base_type() { return gst_child_proxy_get_type(); } guint ChildProxy::get_children_count() const { return gst_child_proxy_get_children_count(const_cast(gobj())); } Glib::RefPtr ChildProxy::get_child(const Glib::ustring& name) { return Glib::wrap(GST_OBJECT(gst_child_proxy_get_child_by_name(gobj(), name.c_str())), true); } Glib::RefPtr ChildProxy::get_child(const Glib::ustring& name) const { return const_cast(this)->get_child(name); } Glib::RefPtr ChildProxy::get_child(guint index) { return Glib::wrap(gst_child_proxy_get_child_by_index(gobj(), index)); } Glib::RefPtr ChildProxy::get_child(guint index) const { return const_cast(this)->get_child(index); } void ChildProxy::child_added(const Glib::RefPtr& child, const Glib::ustring& name) { gst_child_proxy_child_added(gobj(), G_OBJECT(Glib::unwrap(child)), name.c_str()); } void ChildProxy::child_removed(const Glib::RefPtr& child, const Glib::ustring& name) { gst_child_proxy_child_removed(gobj(), G_OBJECT(Glib::unwrap(child)), name.c_str()); } Glib::SignalProxy< void,const Glib::RefPtr&,const Glib::ustring& > ChildProxy::signal_child_added() { return Glib::SignalProxy< void,const Glib::RefPtr&,const Glib::ustring& >(this, &ChildProxy_signal_child_added_info); } Glib::SignalProxy< void,const Glib::RefPtr&,const Glib::ustring& > ChildProxy::signal_child_removed() { return Glib::SignalProxy< void,const Glib::RefPtr&,const Glib::ustring& >(this, &ChildProxy_signal_child_removed_info); } void Gst::ChildProxy::on_child_added(const Glib::RefPtr& object, const Glib::ustring& name) { 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->child_added) (*base->child_added)(gobj(),G_OBJECT(Glib::unwrap(object)),name.c_str()); } void Gst::ChildProxy::on_child_removed(const Glib::RefPtr& object, const Glib::ustring& name) { 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->child_removed) (*base->child_removed)(gobj(),G_OBJECT(Glib::unwrap(object)),name.c_str()); } Glib::RefPtr Gst::ChildProxy::get_child_by_name_vfunc(const Glib::ustring& name) 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_child_by_name) { Glib::RefPtr retval(Glib::wrap((*base->get_child_by_name)(const_cast(gobj()),name.c_str()))); return retval; } using RType = Glib::RefPtr; return RType(); } Glib::RefPtr Gst::ChildProxy::get_child_by_index_vfunc(guint index) 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_child_by_index) { Glib::RefPtr retval(Glib::wrap((*base->get_child_by_index)(const_cast(gobj()),index))); return retval; } using RType = Glib::RefPtr; return RType(); } guint Gst::ChildProxy::get_children_count_vfunc() 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_children_count) { guint retval((*base->get_children_count)(const_cast(gobj()))); return retval; } using RType = guint; return RType(); } } // namespace Gst