1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gstreamermm/colorbalance.h>
7 #include <gstreamermm/private/colorbalance_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 #include <gstreamermm/colorbalancechannel.h>
30
31 namespace Gst
32 {
33
list_channels_vfunc_callback(GstColorBalance * self)34 const GList* ColorBalance_Class::list_channels_vfunc_callback(GstColorBalance* self)
35 {
36 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
37 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
38
39 // Non-gtkmmproc-generated custom classes implicitly call the default
40 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
41 // generated classes can use this optimisation, which avoids the unnecessary
42 // parameter conversions if there is no possibility of the virtual function
43 // being overridden:
44 if(obj_base && obj_base->is_derived_())
45 {
46 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
47 if(obj) // This can be NULL during destruction.
48 {
49 try // Trap C++ exceptions which would normally be lost because this is a C callback.
50 {
51 // Call the virtual member method, which derived classes might override.
52 return (obj->list_channels_vfunc()).data();
53 }
54 catch(...)
55 {
56 Glib::exception_handlers_invoke();
57 }
58 }
59 }
60
61 BaseClassType *const base = static_cast<BaseClassType*>(
62 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
63 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
64 ) );
65
66 // Call the original underlying C function:
67 if(base && base->list_channels)
68 return (*base->list_channels)(self);
69
70
71 typedef const GList* RType;
72 return RType();
73 }
list_channels_vfunc() const74 Glib::ListHandle< Glib::RefPtr<ColorBalanceChannel> > Gst::ColorBalance::list_channels_vfunc() const
75 {
76 BaseClassType *const base = static_cast<BaseClassType*>(
77 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
78 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
79 ) );
80
81 if(base && base->list_channels)
82 return Glib::ListHandle< Glib::RefPtr<ColorBalanceChannel> >(const_cast<GList*>((*base->list_channels)(const_cast<GstColorBalance*>(gobj()))), Glib::OWNERSHIP_NONE);
83
84 typedef Glib::ListHandle< Glib::RefPtr<ColorBalanceChannel> > RType;
85 return RType(0, Glib::OWNERSHIP_NONE);
86 }
87
88 } // namespace Gst
89
90 namespace
91 {
92
93
ColorBalance_signal_value_changed_callback(GstColorBalance * self,GstColorBalanceChannel * p0,gint p1,void * data)94 static void ColorBalance_signal_value_changed_callback(GstColorBalance* self, GstColorBalanceChannel* p0,gint p1,void* data)
95 {
96 using namespace Gst;
97 using SlotType = sigc::slot< void,const Glib::RefPtr<Gst::ColorBalanceChannel>&,int >;
98
99 auto obj = dynamic_cast<ColorBalance*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
100 // Do not try to call a signal on a disassociated wrapper.
101 if(obj)
102 {
103 try
104 {
105 if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
106 (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
107 , p1
108 );
109 }
110 catch(...)
111 {
112 Glib::exception_handlers_invoke();
113 }
114 }
115 }
116
117 static const Glib::SignalProxyInfo ColorBalance_signal_value_changed_info =
118 {
119 "value-changed",
120 (GCallback) &ColorBalance_signal_value_changed_callback,
121 (GCallback) &ColorBalance_signal_value_changed_callback
122 };
123
124
125 } // anonymous namespace
126
127
128 namespace Glib
129 {
130
wrap(GstColorBalance * object,bool take_copy)131 Glib::RefPtr<Gst::ColorBalance> wrap(GstColorBalance* object, bool take_copy)
132 {
133 return Glib::RefPtr<Gst::ColorBalance>( dynamic_cast<Gst::ColorBalance*> (Glib::wrap_auto_interface<Gst::ColorBalance> ((GObject*)(object), take_copy)) );
134 //We use dynamic_cast<> in case of multiple inheritance.
135 }
136
137 } // namespace Glib
138
139
140 namespace Gst
141 {
142
143
144 /* The *_Class implementation: */
145
init()146 const Glib::Interface_Class& ColorBalance_Class::init()
147 {
148 if(!gtype_) // create the GType if necessary
149 {
150 // Glib::Interface_Class has to know the interface init function
151 // in order to add interfaces to implementing types.
152 class_init_func_ = &ColorBalance_Class::iface_init_function;
153
154 // We can not derive from another interface, and it is not necessary anyway.
155 gtype_ = gst_color_balance_get_type();
156 }
157
158 return *this;
159 }
160
iface_init_function(void * g_iface,void *)161 void ColorBalance_Class::iface_init_function(void* g_iface, void*)
162 {
163 const auto klass = static_cast<BaseClassType*>(g_iface);
164
165 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
166 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
167 g_assert(klass != nullptr);
168
169 klass->set_value = &set_value_vfunc_callback;
170 klass->get_value = &get_value_vfunc_callback;
171 klass->get_balance_type = &get_balance_type_vfunc_callback;
172 klass->list_channels = &list_channels_vfunc_callback;
173
174 klass->value_changed = &value_changed_callback;
175 }
176
set_value_vfunc_callback(GstColorBalance * self,GstColorBalanceChannel * balance,gint value)177 void ColorBalance_Class::set_value_vfunc_callback(GstColorBalance* self, GstColorBalanceChannel* balance, gint value)
178 {
179 const auto obj_base = static_cast<Glib::ObjectBase*>(
180 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
181
182 // Non-gtkmmproc-generated custom classes implicitly call the default
183 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
184 // generated classes can use this optimisation, which avoids the unnecessary
185 // parameter conversions if there is no possibility of the virtual function
186 // being overridden:
187 if(obj_base && obj_base->is_derived_())
188 {
189 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
190 if(obj) // This can be NULL during destruction.
191 {
192 try // Trap C++ exceptions which would normally be lost because this is a C callback.
193 {
194 // Call the virtual member method, which derived classes might override.
195 obj->set_value_vfunc(Glib::wrap(balance, true)
196 , value
197 );
198 return;
199 }
200 catch(...)
201 {
202 Glib::exception_handlers_invoke();
203 }
204 }
205 }
206
207 BaseClassType *const base = static_cast<BaseClassType*>(
208 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
209 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
210 ) );
211
212 // Call the original underlying C function:
213 if(base && base->set_value)
214 (*base->set_value)(self, balance, value);
215 }
get_value_vfunc_callback(GstColorBalance * self,GstColorBalanceChannel * balance)216 gint ColorBalance_Class::get_value_vfunc_callback(GstColorBalance* self, GstColorBalanceChannel* balance)
217 {
218 const auto obj_base = static_cast<Glib::ObjectBase*>(
219 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
220
221 // Non-gtkmmproc-generated custom classes implicitly call the default
222 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
223 // generated classes can use this optimisation, which avoids the unnecessary
224 // parameter conversions if there is no possibility of the virtual function
225 // being overridden:
226 if(obj_base && obj_base->is_derived_())
227 {
228 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
229 if(obj) // This can be NULL during destruction.
230 {
231 try // Trap C++ exceptions which would normally be lost because this is a C callback.
232 {
233 // Call the virtual member method, which derived classes might override.
234 return obj->get_value_vfunc(Glib::wrap(balance, true)
235 );
236 }
237 catch(...)
238 {
239 Glib::exception_handlers_invoke();
240 }
241 }
242 }
243
244 BaseClassType *const base = static_cast<BaseClassType*>(
245 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
246 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
247 ) );
248
249 // Call the original underlying C function:
250 if(base && base->get_value)
251 return (*base->get_value)(self, balance);
252
253 using RType = gint;
254 return RType();
255 }
get_balance_type_vfunc_callback(GstColorBalance * self)256 GstColorBalanceType ColorBalance_Class::get_balance_type_vfunc_callback(GstColorBalance* self)
257 {
258 const auto obj_base = static_cast<Glib::ObjectBase*>(
259 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
260
261 // Non-gtkmmproc-generated custom classes implicitly call the default
262 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
263 // generated classes can use this optimisation, which avoids the unnecessary
264 // parameter conversions if there is no possibility of the virtual function
265 // being overridden:
266 if(obj_base && obj_base->is_derived_())
267 {
268 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
269 if(obj) // This can be NULL during destruction.
270 {
271 try // Trap C++ exceptions which would normally be lost because this is a C callback.
272 {
273 // Call the virtual member method, which derived classes might override.
274 return ((GstColorBalanceType)(obj->get_balance_type_vfunc()));
275 }
276 catch(...)
277 {
278 Glib::exception_handlers_invoke();
279 }
280 }
281 }
282
283 BaseClassType *const base = static_cast<BaseClassType*>(
284 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
285 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
286 ) );
287
288 // Call the original underlying C function:
289 if(base && base->get_balance_type)
290 return (*base->get_balance_type)(self);
291
292 using RType = GstColorBalanceType;
293 return RType();
294 }
295
value_changed_callback(GstColorBalance * self,GstColorBalanceChannel * p0,gint p1)296 void ColorBalance_Class::value_changed_callback(GstColorBalance* self, GstColorBalanceChannel* p0, gint p1)
297 {
298 const auto obj_base = static_cast<Glib::ObjectBase*>(
299 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
300
301 // Non-gtkmmproc-generated custom classes implicitly call the default
302 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
303 // generated classes can use this optimisation, which avoids the unnecessary
304 // parameter conversions if there is no possibility of the virtual function
305 // being overridden:
306 if(obj_base && obj_base->is_derived_())
307 {
308 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
309 if(obj) // This can be NULL during destruction.
310 {
311 try // Trap C++ exceptions which would normally be lost because this is a C callback.
312 {
313 // Call the virtual member method, which derived classes might override.
314 obj->on_value_changed(Glib::wrap(p0, true)
315 , p1
316 );
317 return;
318 }
319 catch(...)
320 {
321 Glib::exception_handlers_invoke();
322 }
323 }
324 }
325
326 const auto base = static_cast<BaseClassType*>(
327 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
328 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
329 ) );
330
331 // Call the original underlying C function:
332 if(base && base->value_changed)
333 (*base->value_changed)(self, p0, p1);
334 }
335
336
wrap_new(GObject * object)337 Glib::ObjectBase* ColorBalance_Class::wrap_new(GObject* object)
338 {
339 return new ColorBalance((GstColorBalance*)(object));
340 }
341
342
343 /* The implementation: */
344
ColorBalance()345 ColorBalance::ColorBalance()
346 :
347 Glib::Interface(colorbalance_class_.init())
348 {}
349
ColorBalance(GstColorBalance * castitem)350 ColorBalance::ColorBalance(GstColorBalance* castitem)
351 :
352 Glib::Interface((GObject*)(castitem))
353 {}
354
ColorBalance(const Glib::Interface_Class & interface_class)355 ColorBalance::ColorBalance(const Glib::Interface_Class& interface_class)
356 : Glib::Interface(interface_class)
357 {
358 }
359
ColorBalance(ColorBalance && src)360 ColorBalance::ColorBalance(ColorBalance&& src) noexcept
361 : Glib::Interface(std::move(src))
362 {}
363
operator =(ColorBalance && src)364 ColorBalance& ColorBalance::operator=(ColorBalance&& src) noexcept
365 {
366 Glib::Interface::operator=(std::move(src));
367 return *this;
368 }
369
~ColorBalance()370 ColorBalance::~ColorBalance() noexcept
371 {}
372
373 // static
add_interface(GType gtype_implementer)374 void ColorBalance::add_interface(GType gtype_implementer)
375 {
376 colorbalance_class_.init().add_interface(gtype_implementer);
377 }
378
379 ColorBalance::CppClassType ColorBalance::colorbalance_class_; // initialize static member
380
get_type()381 GType ColorBalance::get_type()
382 {
383 return colorbalance_class_.init().get_type();
384 }
385
386
get_base_type()387 GType ColorBalance::get_base_type()
388 {
389 return gst_color_balance_get_type();
390 }
391
392
list_channels()393 Glib::ListHandle< Glib::RefPtr<Gst::ColorBalanceChannel> > ColorBalance::list_channels()
394 {
395 return Glib::ListHandle< Glib::RefPtr<Gst::ColorBalanceChannel> >(const_cast<GList*>(gst_color_balance_list_channels(gobj())), Glib::OWNERSHIP_NONE);
396 }
397
list_channels() const398 Glib::ListHandle< Glib::RefPtr<const Gst::ColorBalanceChannel> > ColorBalance::list_channels() const
399 {
400 return Glib::ListHandle< Glib::RefPtr<const Gst::ColorBalanceChannel> >(const_cast<GList*>(gst_color_balance_list_channels(const_cast<GstColorBalance*>(gobj()))), Glib::OWNERSHIP_NONE);
401 }
402
get_value(const Glib::RefPtr<const Gst::ColorBalanceChannel> & channel) const403 int ColorBalance::get_value(const Glib::RefPtr<const Gst::ColorBalanceChannel>& channel) const
404 {
405 return gst_color_balance_get_value(const_cast<GstColorBalance*>(gobj()), const_cast<GstColorBalanceChannel*>(Glib::unwrap(channel)));
406 }
407
set_value(const Glib::RefPtr<Gst::ColorBalanceChannel> & channel,int value)408 void ColorBalance::set_value(const Glib::RefPtr<Gst::ColorBalanceChannel>& channel, int value)
409 {
410 gst_color_balance_set_value(gobj(), Glib::unwrap(channel), value);
411 }
412
value_changed(const Glib::RefPtr<Gst::ColorBalanceChannel> & channel,int value)413 void ColorBalance::value_changed(const Glib::RefPtr<Gst::ColorBalanceChannel>& channel, int value)
414 {
415 gst_color_balance_value_changed(gobj(), Glib::unwrap(channel), value);
416 }
417
get_balance_type() const418 Gst::ColorBalanceType ColorBalance::get_balance_type() const
419 {
420 return ((Gst::ColorBalanceType)(gst_color_balance_get_balance_type(const_cast<GstColorBalance*>(gobj()))));
421 }
422
423
signal_value_changed()424 Glib::SignalProxy< void,const Glib::RefPtr<Gst::ColorBalanceChannel>&,int > ColorBalance::signal_value_changed()
425 {
426 return Glib::SignalProxy< void,const Glib::RefPtr<Gst::ColorBalanceChannel>&,int >(this, &ColorBalance_signal_value_changed_info);
427 }
428
429
on_value_changed(const Glib::RefPtr<Gst::ColorBalanceChannel> & channel,int value)430 void Gst::ColorBalance::on_value_changed(const Glib::RefPtr<Gst::ColorBalanceChannel>& channel, int value)
431 {
432 const auto base = static_cast<BaseClassType*>(
433 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
434 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
435 ) );
436
437 if(base && base->value_changed)
438 (*base->value_changed)(gobj(),Glib::unwrap(channel),value);
439 }
440
set_value_vfunc(const Glib::RefPtr<Gst::ColorBalanceChannel> & channel,int value)441 void Gst::ColorBalance::set_value_vfunc(const Glib::RefPtr<Gst::ColorBalanceChannel>& channel, int value)
442 {
443 const auto base = static_cast<BaseClassType*>(
444 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
445 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
446 ) );
447
448 if(base && base->set_value)
449 {
450 (*base->set_value)(gobj(),Glib::unwrap(channel),value);
451 }
452 }
get_value_vfunc(const Glib::RefPtr<const Gst::ColorBalanceChannel> & channel) const453 int Gst::ColorBalance::get_value_vfunc(const Glib::RefPtr<const Gst::ColorBalanceChannel>& channel) const
454 {
455 const auto base = static_cast<BaseClassType*>(
456 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
457 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
458 ) );
459
460 if(base && base->get_value)
461 {
462 int retval((*base->get_value)(const_cast<GstColorBalance*>(gobj()),const_cast<GstColorBalanceChannel*>(Glib::unwrap(channel))));
463 return retval;
464 }
465
466 using RType = int;
467 return RType();
468 }
get_balance_type_vfunc()469 Gst::ColorBalanceType Gst::ColorBalance::get_balance_type_vfunc()
470 {
471 const auto base = static_cast<BaseClassType*>(
472 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
473 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
474 ) );
475
476 if(base && base->get_balance_type)
477 {
478 Gst::ColorBalanceType retval(((Gst::ColorBalanceType)((*base->get_balance_type)(gobj()))));
479 return retval;
480 }
481
482 using RType = Gst::ColorBalanceType;
483 return RType();
484 }
485
486
487 } // namespace Gst
488
489
490