Debian Codegraph @

gstreamer/gstreamermm/videoorientation.cc

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gstreamermm/videoorientation.h>
7 #include <gstreamermm/private/videoorientation_p.h>
8
9
10 /* gstreamermm - a C++ wrapper for gstreamer
11 *
12 * Copyright 2008 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 namespace Gst
30 {
31
32 bool VideoOrientation::get_hflip(bool& flip) const
33 {
34 gboolean gst_flip = 0;
35
36 const bool result =
37 gst_video_orientation_get_hflip(const_cast<GstVideoOrientation*>(gobj()),
38 &gst_flip);
39 flip = gst_flip;
40 return result;
41 }
42
43 bool VideoOrientation::get_vflip(bool& flip) const
44 {
45 gboolean gst_flip = 0;
46 const bool result =
47 gst_video_orientation_get_vflip(const_cast<GstVideoOrientation*>(gobj()),
48 &gst_flip);
49 flip = gst_flip;
50 return result;
51 }
52
53 gboolean VideoOrientation_Class::get_hflip_vfunc_callback(GstVideoOrientation* self, gboolean* flip)
54 {
55 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
56 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
57
58 // Non-gtkmmproc-generated custom classes implicitly call the default
59 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
60 // generated classes can use this optimisation, which avoids the unnecessary
61 // parameter conversions if there is no possibility of the virtual function
62 // being overridden:
63 if(obj_base && obj_base->is_derived_())
64 {
65 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
66 if(obj) // This can be NULL during destruction.
67 {
68 try // Trap C++ exceptions which would normally be lost because this is a C callback.
69 {
70 // Call the virtual member method, which derived classes might override.
71 bool cpp_flip = false;
72 const gboolean result =
73 static_cast<int>(obj->get_hflip_vfunc(cpp_flip));
74 *flip = cpp_flip;
75 return result;
76 }
77 catch(...)
78 {
79 Glib::exception_handlers_invoke();
80 }
81 }
82 }
83
84 BaseClassType *const base = static_cast<BaseClassType*>(
85 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
86 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
87 ) );
88
89 // Call the original underlying C function:
90 if(base && base->get_hflip)
91 return (*base->get_hflip)(self, flip);
92
93
94 typedef gboolean RType;
95 return RType();
96 }
97 bool Gst::VideoOrientation::get_hflip_vfunc(bool& flip) const
98 {
99 BaseClassType *const base = static_cast<BaseClassType*>(
100 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
101 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
102 ) );
103
104 if(base && base->get_hflip)
105 {
106 gboolean gst_flip = 0;
107
108 const bool result =
109 (*base->get_hflip)(const_cast<GstVideoOrientation*>(gobj()),&gst_flip);
110 flip = gst_flip;
111 return result;
112 }
113
114 typedef bool RType;
115 return RType();
116 }
117 gboolean VideoOrientation_Class::get_vflip_vfunc_callback(GstVideoOrientation* self, gboolean* flip)
118 {
119 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
120 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
121
122 // Non-gtkmmproc-generated custom classes implicitly call the default
123 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
124 // generated classes can use this optimisation, which avoids the unnecessary
125 // parameter conversions if there is no possibility of the virtual function
126 // being overridden:
127 if(obj_base && obj_base->is_derived_())
128 {
129 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
130 if(obj) // This can be NULL during destruction.
131 {
132 try // Trap C++ exceptions which would normally be lost because this is a C callback.
133 {
134 // Call the virtual member method, which derived classes might override.
135 bool cpp_flip = false;
136 const gboolean result =
137 static_cast<int>(obj->get_vflip_vfunc(cpp_flip));
138 *flip = cpp_flip;
139 return result;
140 }
141 catch(...)
142 {
143 Glib::exception_handlers_invoke();
144 }
145 }
146 }
147
148 BaseClassType *const base = static_cast<BaseClassType*>(
149 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
150 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
151 ) );
152
153 // Call the original underlying C function:
154 if(base && base->get_vflip)
155 return (*base->get_vflip)(self, flip);
156
157
158 typedef gboolean RType;
159 return RType();
160 }
161 bool Gst::VideoOrientation::get_vflip_vfunc(bool& flip) const
162 {
163 BaseClassType *const base = static_cast<BaseClassType*>(
164 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
165 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
166 ) );
167
168 if(base && base->get_vflip)
169 {
170 gboolean gst_flip = 0;
171
172 const bool result =
173 (*base->get_vflip)(const_cast<GstVideoOrientation*>(gobj()),&gst_flip);
174 flip = gst_flip;
175 return result;
176 }
177
178 typedef bool RType;
179 return RType();
180 }
181 } // namespace Gst
182
183 namespace
184 {
185 } // anonymous namespace
186
187
188 namespace Glib
189 {
190
191 Glib::RefPtr<Gst::VideoOrientation> wrap(GstVideoOrientation* object, bool take_copy)
192 {
193 return Glib::RefPtr<Gst::VideoOrientation>( dynamic_cast<Gst::VideoOrientation*> (Glib::wrap_auto_interface<Gst::VideoOrientation> ((GObject*)(object), take_copy)) );
194 //We use dynamic_cast<> in case of multiple inheritance.
195 }
196
197 } // namespace Glib
198
199
200 namespace Gst
201 {
202
203
204 /* The *_Class implementation: */
205
206 const Glib::Interface_Class& VideoOrientation_Class::init()
207 {
208 if(!gtype_) // create the GType if necessary
209 {
210 // Glib::Interface_Class has to know the interface init function
211 // in order to add interfaces to implementing types.
212 class_init_func_ = &VideoOrientation_Class::iface_init_function;
213
214 // We can not derive from another interface, and it is not necessary anyway.
215 gtype_ = gst_video_orientation_get_type();
216 }
217
218 return *this;
219 }
220
221 void VideoOrientation_Class::iface_init_function(void* g_iface, void*)
222 {
223 const auto klass = static_cast<BaseClassType*>(g_iface);
224
225 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
226 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
227 g_assert(klass != nullptr);
228
229 klass->get_hcenter = &get_hcenter_vfunc_callback;
230 klass->get_vcenter = &get_vcenter_vfunc_callback;
231 klass->set_hflip = &set_hflip_vfunc_callback;
232 klass->set_vflip = &set_vflip_vfunc_callback;
233 klass->set_hcenter = &set_hcenter_vfunc_callback;
234 klass->set_vcenter = &set_vcenter_vfunc_callback;
235 klass->get_hflip = &get_hflip_vfunc_callback;
236 klass->get_vflip = &get_vflip_vfunc_callback;
237
238 }
239
240 gboolean VideoOrientation_Class::get_hcenter_vfunc_callback(GstVideoOrientation* self, gint* center)
241 {
242 const auto obj_base = static_cast<Glib::ObjectBase*>(
243 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
244
245 // Non-gtkmmproc-generated custom classes implicitly call the default
246 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
247 // generated classes can use this optimisation, which avoids the unnecessary
248 // parameter conversions if there is no possibility of the virtual function
249 // being overridden:
250 if(obj_base && obj_base->is_derived_())
251 {
252 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
253 if(obj) // This can be NULL during destruction.
254 {
255 try // Trap C++ exceptions which would normally be lost because this is a C callback.
256 {
257 // Call the virtual member method, which derived classes might override.
258 return static_cast<int>(obj->get_hcenter_vfunc(*(center)
259 ));
260 }
261 catch(...)
262 {
263 Glib::exception_handlers_invoke();
264 }
265 }
266 }
267
268 BaseClassType *const base = static_cast<BaseClassType*>(
269 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
270 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
271 ) );
272
273 // Call the original underlying C function:
274 if(base && base->get_hcenter)
275 return (*base->get_hcenter)(self, center);
276
277 using RType = gboolean;
278 return RType();
279 }
280 gboolean VideoOrientation_Class::get_vcenter_vfunc_callback(GstVideoOrientation* self, gint* center)
281 {
282 const auto obj_base = static_cast<Glib::ObjectBase*>(
283 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
284
285 // Non-gtkmmproc-generated custom classes implicitly call the default
286 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
287 // generated classes can use this optimisation, which avoids the unnecessary
288 // parameter conversions if there is no possibility of the virtual function
289 // being overridden:
290 if(obj_base && obj_base->is_derived_())
291 {
292 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
293 if(obj) // This can be NULL during destruction.
294 {
295 try // Trap C++ exceptions which would normally be lost because this is a C callback.
296 {
297 // Call the virtual member method, which derived classes might override.
298 return static_cast<int>(obj->get_vcenter_vfunc(*(center)
299 ));
300 }
301 catch(...)
302 {
303 Glib::exception_handlers_invoke();
304 }
305 }
306 }
307
308 BaseClassType *const base = static_cast<BaseClassType*>(
309 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
310 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
311 ) );
312
313 // Call the original underlying C function:
314 if(base && base->get_vcenter)
315 return (*base->get_vcenter)(self, center);
316
317 using RType = gboolean;
318 return RType();
319 }
320 gboolean VideoOrientation_Class::set_hflip_vfunc_callback(GstVideoOrientation* self, gboolean flip)
321 {
322 const auto obj_base = static_cast<Glib::ObjectBase*>(
323 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
324
325 // Non-gtkmmproc-generated custom classes implicitly call the default
326 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
327 // generated classes can use this optimisation, which avoids the unnecessary
328 // parameter conversions if there is no possibility of the virtual function
329 // being overridden:
330 if(obj_base && obj_base->is_derived_())
331 {
332 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
333 if(obj) // This can be NULL during destruction.
334 {
335 try // Trap C++ exceptions which would normally be lost because this is a C callback.
336 {
337 // Call the virtual member method, which derived classes might override.
338 return static_cast<int>(obj->set_hflip_vfunc(flip
339 ));
340 }
341 catch(...)
342 {
343 Glib::exception_handlers_invoke();
344 }
345 }
346 }
347
348 BaseClassType *const base = static_cast<BaseClassType*>(
349 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
350 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
351 ) );
352
353 // Call the original underlying C function:
354 if(base && base->set_hflip)
355 return (*base->set_hflip)(self, flip);
356
357 using RType = gboolean;
358 return RType();
359 }
360 gboolean VideoOrientation_Class::set_vflip_vfunc_callback(GstVideoOrientation* self, gboolean flip)
361 {
362 const auto obj_base = static_cast<Glib::ObjectBase*>(
363 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
364
365 // Non-gtkmmproc-generated custom classes implicitly call the default
366 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
367 // generated classes can use this optimisation, which avoids the unnecessary
368 // parameter conversions if there is no possibility of the virtual function
369 // being overridden:
370 if(obj_base && obj_base->is_derived_())
371 {
372 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
373 if(obj) // This can be NULL during destruction.
374 {
375 try // Trap C++ exceptions which would normally be lost because this is a C callback.
376 {
377 // Call the virtual member method, which derived classes might override.
378 return static_cast<int>(obj->set_vflip_vfunc(flip
379 ));
380 }
381 catch(...)
382 {
383 Glib::exception_handlers_invoke();
384 }
385 }
386 }
387
388 BaseClassType *const base = static_cast<BaseClassType*>(
389 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
390 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
391 ) );
392
393 // Call the original underlying C function:
394 if(base && base->set_vflip)
395 return (*base->set_vflip)(self, flip);
396
397 using RType = gboolean;
398 return RType();
399 }
400 gboolean VideoOrientation_Class::set_hcenter_vfunc_callback(GstVideoOrientation* self, gint center)
401 {
402 const auto obj_base = static_cast<Glib::ObjectBase*>(
403 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
404
405 // Non-gtkmmproc-generated custom classes implicitly call the default
406 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
407 // generated classes can use this optimisation, which avoids the unnecessary
408 // parameter conversions if there is no possibility of the virtual function
409 // being overridden:
410 if(obj_base && obj_base->is_derived_())
411 {
412 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
413 if(obj) // This can be NULL during destruction.
414 {
415 try // Trap C++ exceptions which would normally be lost because this is a C callback.
416 {
417 // Call the virtual member method, which derived classes might override.
418 return static_cast<int>(obj->set_hcenter_vfunc(center
419 ));
420 }
421 catch(...)
422 {
423 Glib::exception_handlers_invoke();
424 }
425 }
426 }
427
428 BaseClassType *const base = static_cast<BaseClassType*>(
429 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
430 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
431 ) );
432
433 // Call the original underlying C function:
434 if(base && base->set_hcenter)
435 return (*base->set_hcenter)(self, center);
436
437 using RType = gboolean;
438 return RType();
439 }
440 gboolean VideoOrientation_Class::set_vcenter_vfunc_callback(GstVideoOrientation* self, gint center)
441 {
442 const auto obj_base = static_cast<Glib::ObjectBase*>(
443 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
444
445 // Non-gtkmmproc-generated custom classes implicitly call the default
446 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
447 // generated classes can use this optimisation, which avoids the unnecessary
448 // parameter conversions if there is no possibility of the virtual function
449 // being overridden:
450 if(obj_base && obj_base->is_derived_())
451 {
452 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
453 if(obj) // This can be NULL during destruction.
454 {
455 try // Trap C++ exceptions which would normally be lost because this is a C callback.
456 {
457 // Call the virtual member method, which derived classes might override.
458 return static_cast<int>(obj->set_vcenter_vfunc(center
459 ));
460 }
461 catch(...)
462 {
463 Glib::exception_handlers_invoke();
464 }
465 }
466 }
467
468 BaseClassType *const base = static_cast<BaseClassType*>(
469 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
470 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
471 ) );
472
473 // Call the original underlying C function:
474 if(base && base->set_vcenter)
475 return (*base->set_vcenter)(self, center);
476
477 using RType = gboolean;
478 return RType();
479 }
480
481
482 Glib::ObjectBase* VideoOrientation_Class::wrap_new(GObject* object)
483 {
484 return new VideoOrientation((GstVideoOrientation*)(object));
485 }
486
487
488 /* The implementation: */
489
490 VideoOrientation::VideoOrientation()
491 :
492 Glib::Interface(videoorientation_class_.init())
493 {}
494
495 VideoOrientation::VideoOrientation(GstVideoOrientation* castitem)
496 :
497 Glib::Interface((GObject*)(castitem))
498 {}
499
500 VideoOrientation::VideoOrientation(const Glib::Interface_Class& interface_class)
501 : Glib::Interface(interface_class)
502 {
503 }
504
505 VideoOrientation::VideoOrientation(VideoOrientation&& src) noexcept
506 : Glib::Interface(std::move(src))
507 {}
508
509 VideoOrientation& VideoOrientation::operator=(VideoOrientation&& src) noexcept
510 {
511 Glib::Interface::operator=(std::move(src));
512 return *this;
513 }
514
515 VideoOrientation::~VideoOrientation() noexcept
516 {}
517
518 // static
519 void VideoOrientation::add_interface(GType gtype_implementer)
520 {
521 videoorientation_class_.init().add_interface(gtype_implementer);
522 }
523
524 VideoOrientation::CppClassType VideoOrientation::videoorientation_class_; // initialize static member
525
526 GType VideoOrientation::get_type()
527 {
528 return videoorientation_class_.init().get_type();
529 }
530
531
532 GType VideoOrientation::get_base_type()
533 {
534 return gst_video_orientation_get_type();
535 }
536
537
538 bool VideoOrientation::get_hcenter(int& center) const
539 {
540 return gst_video_orientation_get_hcenter(const_cast<GstVideoOrientation*>(gobj()), &(center));
541 }
542
543 bool VideoOrientation::get_vcenter(int& center) const
544 {
545 return gst_video_orientation_get_vcenter(const_cast<GstVideoOrientation*>(gobj()), &(center));
546 }
547
548 bool VideoOrientation::set_hcenter(int center)
549 {
550 return gst_video_orientation_set_hcenter(gobj(), center);
551 }
552
553 bool VideoOrientation::set_hflip(bool flip)
554 {
555 return gst_video_orientation_set_hflip(gobj(), static_cast<int>(flip));
556 }
557
558 bool VideoOrientation::set_vcenter(int center)
559 {
560 return gst_video_orientation_set_vcenter(gobj(), center);
561 }
562
563 bool VideoOrientation::set_vflip(bool flip)
564 {
565 return gst_video_orientation_set_vflip(gobj(), static_cast<int>(flip));
566 }
567
568
569 bool Gst::VideoOrientation::get_hcenter_vfunc(int& center) const
570 {
571 const auto base = static_cast<BaseClassType*>(
572 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
573 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
574 ) );
575
576 if(base && base->get_hcenter)
577 {
578 bool retval((*base->get_hcenter)(const_cast<GstVideoOrientation*>(gobj()),&(center)));
579 return retval;
580 }
581
582 using RType = bool;
583 return RType();
584 }
585 bool Gst::VideoOrientation::get_vcenter_vfunc(int& center) const
586 {
587 const auto base = static_cast<BaseClassType*>(
588 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
589 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
590 ) );
591
592 if(base && base->get_vcenter)
593 {
594 bool retval((*base->get_vcenter)(const_cast<GstVideoOrientation*>(gobj()),&(center)));
595 return retval;
596 }
597
598 using RType = bool;
599 return RType();
600 }
601 bool Gst::VideoOrientation::set_hflip_vfunc(bool flip)
602 {
603 const auto base = static_cast<BaseClassType*>(
604 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
605 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
606 ) );
607
608 if(base && base->set_hflip)
609 {
610 bool retval((*base->set_hflip)(gobj(),static_cast<int>(flip)));
611 return retval;
612 }
613
614 using RType = bool;
615 return RType();
616 }
617 bool Gst::VideoOrientation::set_vflip_vfunc(bool flip)
618 {
619 const auto base = static_cast<BaseClassType*>(
620 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
621 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
622 ) );
623
624 if(base && base->set_vflip)
625 {
626 bool retval((*base->set_vflip)(gobj(),static_cast<int>(flip)));
627 return retval;
628 }
629
630 using RType = bool;
631 return RType();
632 }
633 bool Gst::VideoOrientation::set_hcenter_vfunc(int center)
634 {
635 const auto base = static_cast<BaseClassType*>(
636 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
637 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
638 ) );
639
640 if(base && base->set_hcenter)
641 {
642 bool retval((*base->set_hcenter)(gobj(),center));
643 return retval;
644 }
645
646 using RType = bool;
647 return RType();
648 }
649 bool Gst::VideoOrientation::set_vcenter_vfunc(int center)
650 {
651 const auto base = static_cast<BaseClassType*>(
652 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
653 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
654 ) );
655
656 if(base && base->set_vcenter)
657 {
658 bool retval((*base->set_vcenter)(gobj(),center));
659 return retval;
660 }
661
662 using RType = bool;
663 return RType();
664 }
665
666
667 } // namespace Gst
668
669