| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | |
| 3 | |
| 4 | #include <glibmm.h> |
| 5 | |
| 6 | #include <gstreamermm/colorbalancechannel.h> |
| 7 | #include <gstreamermm/private/colorbalancechannel_p.h> |
| 8 | |
| 9 | |
| 10 | /* gstreamermm - a C++ wrapper for gstreamer |
| 11 | * |
| 12 | * Copyright 2008-2016 The gstreamermm Development Team |
| 13 | * |
| 14 | * This library is free software; you can redistribute it and/or |
| 15 | * modify it under the terms of the GNU Lesser General Public |
| 16 | * License as published by the Free Software Foundation; either |
| 17 | * version 2.1 of the License, or (at your option) any later version. |
| 18 | * |
| 19 | * This library is distributed in the hope that it will be useful, |
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 22 | * Lesser General Public License for more details. |
| 23 | * |
| 24 | * You should have received a copy of the GNU Lesser General Public |
| 25 | * License along with this library; if not, write to the Free |
| 26 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 27 | */ |
| 28 | |
| 29 | |
| 30 | #include <gst/video/colorbalancechannel.h> |
| 31 | |
| 32 | namespace |
| 33 | { |
| 34 | |
| 35 | |
| 36 | static void ColorBalanceChannel_signal_value_changed_callback(GstColorBalanceChannel* self, gint p0,void* data) |
| 37 | { |
| 38 | using namespace Gst; |
| 39 | using SlotType = sigc::slot< void,int >; |
| 40 | |
| 41 | auto obj = dynamic_cast<ColorBalanceChannel*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self)); |
| 42 | // Do not try to call a signal on a disassociated wrapper. |
| 43 | if(obj) |
| 44 | { |
| 45 | try |
| 46 | { |
| 47 | if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data)) |
| 48 | (*static_cast<SlotType*>(slot))(p0 |
| 49 | ); |
| 50 | } |
| 51 | catch(...) |
| 52 | { |
| 53 | Glib::exception_handlers_invoke(); |
| 54 | } |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | static const Glib::SignalProxyInfo ColorBalanceChannel_signal_value_changed_info = |
| 59 | { |
| 60 | "value-changed", |
| 61 | (GCallback) &ColorBalanceChannel_signal_value_changed_callback, |
| 62 | (GCallback) &ColorBalanceChannel_signal_value_changed_callback |
| 63 | }; |
| 64 | |
| 65 | |
| 66 | } // anonymous namespace |
| 67 | |
| 68 | |
| 69 | namespace Glib |
| 70 | { |
| 71 | |
| 72 | Glib::RefPtr<Gst::ColorBalanceChannel> wrap(GstColorBalanceChannel* object, bool take_copy) |
| 73 | { |
| 74 | return Glib::RefPtr<Gst::ColorBalanceChannel>( dynamic_cast<Gst::ColorBalanceChannel*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); |
| 75 | //We use dynamic_cast<> in case of multiple inheritance. |
| 76 | } |
| 77 | |
| 78 | } /* namespace Glib */ |
| 79 | |
| 80 | |
| 81 | namespace Gst |
| 82 | { |
| 83 | |
| 84 | |
| 85 | /* The *_Class implementation: */ |
| 86 | |
| 87 | const Glib::Class& ColorBalanceChannel_Class::init() |
| 88 | { |
| 89 | if(!gtype_) // create the GType if necessary |
| 90 | { |
| 91 | // Glib::Class has to know the class init function to clone custom types. |
| 92 | class_init_func_ = &ColorBalanceChannel_Class::class_init_function; |
| 93 | |
| 94 | // This is actually just optimized away, apparently with no harm. |
| 95 | // Make sure that the parent type has been created. |
| 96 | //CppClassParent::CppObjectType::get_type(); |
| 97 | |
| 98 | // Create the wrapper type, with the same class/instance size as the base type. |
| 99 | register_derived_type(gst_color_balance_channel_get_type()); |
| 100 | |
| 101 | // Add derived versions of interfaces, if the C type implements any interfaces: |
| 102 | |
| 103 | } |
| 104 | |
| 105 | return *this; |
| 106 | } |
| 107 | |
| 108 | |
| 109 | void ColorBalanceChannel_Class::class_init_function(void* g_class, void* class_data) |
| 110 | { |
| 111 | const auto klass = static_cast<BaseClassType*>(g_class); |
| 112 | CppClassParent::class_init_function(klass, class_data); |
| 113 | |
| 114 | |
| 115 | klass->value_changed = &value_changed_callback; |
| 116 | } |
| 117 | |
| 118 | |
| 119 | void ColorBalanceChannel_Class::value_changed_callback(GstColorBalanceChannel* self, gint p0) |
| 120 | { |
| 121 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 122 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 123 | |
| 124 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 125 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 126 | // generated classes can use this optimisation, which avoids the unnecessary |
| 127 | // parameter conversions if there is no possibility of the virtual function |
| 128 | // being overridden: |
| 129 | if(obj_base && obj_base->is_derived_()) |
| 130 | { |
| 131 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 132 | if(obj) // This can be NULL during destruction. |
| 133 | { |
| 134 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 135 | { |
| 136 | // Call the virtual member method, which derived classes might override. |
| 137 | obj->on_value_changed(p0 |
| 138 | ); |
| 139 | return; |
| 140 | } |
| 141 | catch(...) |
| 142 | { |
| 143 | Glib::exception_handlers_invoke(); |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | const auto base = static_cast<BaseClassType*>( |
| 149 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 150 | ); |
| 151 | |
| 152 | // Call the original underlying C function: |
| 153 | if(base && base->value_changed) |
| 154 | (*base->value_changed)(self, p0); |
| 155 | } |
| 156 | |
| 157 | |
| 158 | Glib::ObjectBase* ColorBalanceChannel_Class::wrap_new(GObject* object) |
| 159 | { |
| 160 | return new ColorBalanceChannel((GstColorBalanceChannel*)object); |
| 161 | } |
| 162 | |
| 163 | |
| 164 | /* The implementation: */ |
| 165 | |
| 166 | GstColorBalanceChannel* ColorBalanceChannel::gobj_copy() |
| 167 | { |
| 168 | reference(); |
| 169 | return gobj(); |
| 170 | } |
| 171 | |
| 172 | ColorBalanceChannel::ColorBalanceChannel(const Glib::ConstructParams& construct_params) |
| 173 | : |
| 174 | Glib::Object(construct_params) |
| 175 | { |
| 176 | |
| 177 | } |
| 178 | |
| 179 | ColorBalanceChannel::ColorBalanceChannel(GstColorBalanceChannel* castitem) |
| 180 | : |
| 181 | Glib::Object((GObject*)(castitem)) |
| 182 | {} |
| 183 | |
| 184 | |
| 185 | ColorBalanceChannel::ColorBalanceChannel(ColorBalanceChannel&& src) noexcept |
| 186 | : Glib::Object(std::move(src)) |
| 187 | {} |
| 188 | |
| 189 | ColorBalanceChannel& ColorBalanceChannel::operator=(ColorBalanceChannel&& src) noexcept |
| 190 | { |
| 191 | Glib::Object::operator=(std::move(src)); |
| 192 | return *this; |
| 193 | } |
| 194 | |
| 195 | |
| 196 | ColorBalanceChannel::~ColorBalanceChannel() noexcept |
| 197 | {} |
| 198 | |
| 199 | |
| 200 | ColorBalanceChannel::CppClassType ColorBalanceChannel::colorbalancechannel_class_; // initialize static member |
| 201 | |
| 202 | GType ColorBalanceChannel::get_type() |
| 203 | { |
| 204 | return colorbalancechannel_class_.init().get_type(); |
| 205 | } |
| 206 | |
| 207 | |
| 208 | GType ColorBalanceChannel::get_base_type() |
| 209 | { |
| 210 | return gst_color_balance_channel_get_type(); |
| 211 | } |
| 212 | |
| 213 | |
| 214 | Glib::ustring ColorBalanceChannel::get_label() const |
| 215 | { |
| 216 | return Glib::convert_const_gchar_ptr_to_ustring(gobj()->label); |
| 217 | } |
| 218 | |
| 219 | int ColorBalanceChannel::get_min_value() const |
| 220 | { |
| 221 | return gobj()->min_value; |
| 222 | } |
| 223 | |
| 224 | int ColorBalanceChannel::get_max_value() const |
| 225 | { |
| 226 | return gobj()->max_value; |
| 227 | } |
| 228 | |
| 229 | |
| 230 | Glib::SignalProxy< void,int > ColorBalanceChannel::signal_value_changed() |
| 231 | { |
| 232 | return Glib::SignalProxy< void,int >(this, &ColorBalanceChannel_signal_value_changed_info); |
| 233 | } |
| 234 | |
| 235 | |
| 236 | void Gst::ColorBalanceChannel::on_value_changed(int value) |
| 237 | { |
| 238 | const auto base = static_cast<BaseClassType*>( |
| 239 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 240 | ); |
| 241 | |
| 242 | if(base && base->value_changed) |
| 243 | (*base->value_changed)(gobj(),value); |
| 244 | } |
| 245 | |
| 246 | |
| 247 | } // namespace Gst |
| 248 | |
| 249 |