Debian Codegraph @

gstreamer/src/videoorientation.ccg

raw
1 /* gstreamermm - a C++ wrapper for gstreamer
2 *
3 * Copyright 2008 The gstreamermm Development Team
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 namespace Gst
21 {
22
23 bool VideoOrientation::get_hflip(bool& flip) const
24 {
25 gboolean gst_flip = 0;
26
27 const bool result =
28 gst_video_orientation_get_hflip(const_cast<GstVideoOrientation*>(gobj()),
29 &gst_flip);
30 flip = gst_flip;
31 return result;
32 }
33
34 bool VideoOrientation::get_vflip(bool& flip) const
35 {
36 gboolean gst_flip = 0;
37 const bool result =
38 gst_video_orientation_get_vflip(const_cast<GstVideoOrientation*>(gobj()),
39 &gst_flip);
40 flip = gst_flip;
41 return result;
42 }
43
44 gboolean VideoOrientation_Class::get_hflip_vfunc_callback(GstVideoOrientation* self, gboolean* flip)
45 {
46 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
47 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
48
49 // Non-gtkmmproc-generated custom classes implicitly call the default
50 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
51 // generated classes can use this optimisation, which avoids the unnecessary
52 // parameter conversions if there is no possibility of the virtual function
53 // being overridden:
54 if(obj_base && obj_base->is_derived_())
55 {
56 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
57 if(obj) // This can be NULL during destruction.
58 {
59 try // Trap C++ exceptions which would normally be lost because this is a C callback.
60 {
61 // Call the virtual member method, which derived classes might override.
62 bool cpp_flip = false;
63 const gboolean result =
64 static_cast<int>(obj->get_hflip_vfunc(cpp_flip));
65 *flip = cpp_flip;
66 return result;
67 }
68 catch(...)
69 {
70 Glib::exception_handlers_invoke();
71 }
72 }
73 }
74
75 BaseClassType *const base = static_cast<BaseClassType*>(
76 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
77 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
78 ) );
79
80 // Call the original underlying C function:
81 if(base && base->get_hflip)
82 return (*base->get_hflip)(self, flip);
83
84
85 typedef gboolean RType;
86 return RType();
87 }
88 bool Gst::VideoOrientation::get_hflip_vfunc(bool& flip) const
89 {
90 BaseClassType *const base = static_cast<BaseClassType*>(
91 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
92 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
93 ) );
94
95 if(base && base->get_hflip)
96 {
97 gboolean gst_flip = 0;
98
99 const bool result =
100 (*base->get_hflip)(const_cast<GstVideoOrientation*>(gobj()),&gst_flip);
101 flip = gst_flip;
102 return result;
103 }
104
105 typedef bool RType;
106 return RType();
107 }
108 gboolean VideoOrientation_Class::get_vflip_vfunc_callback(GstVideoOrientation* self, gboolean* flip)
109 {
110 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
111 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
112
113 // Non-gtkmmproc-generated custom classes implicitly call the default
114 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
115 // generated classes can use this optimisation, which avoids the unnecessary
116 // parameter conversions if there is no possibility of the virtual function
117 // being overridden:
118 if(obj_base && obj_base->is_derived_())
119 {
120 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
121 if(obj) // This can be NULL during destruction.
122 {
123 try // Trap C++ exceptions which would normally be lost because this is a C callback.
124 {
125 // Call the virtual member method, which derived classes might override.
126 bool cpp_flip = false;
127 const gboolean result =
128 static_cast<int>(obj->get_vflip_vfunc(cpp_flip));
129 *flip = cpp_flip;
130 return result;
131 }
132 catch(...)
133 {
134 Glib::exception_handlers_invoke();
135 }
136 }
137 }
138
139 BaseClassType *const base = static_cast<BaseClassType*>(
140 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
141 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
142 ) );
143
144 // Call the original underlying C function:
145 if(base && base->get_vflip)
146 return (*base->get_vflip)(self, flip);
147
148
149 typedef gboolean RType;
150 return RType();
151 }
152 bool Gst::VideoOrientation::get_vflip_vfunc(bool& flip) const
153 {
154 BaseClassType *const base = static_cast<BaseClassType*>(
155 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
156 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
157 ) );
158
159 if(base && base->get_vflip)
160 {
161 gboolean gst_flip = 0;
162
163 const bool result =
164 (*base->get_vflip)(const_cast<GstVideoOrientation*>(gobj()),&gst_flip);
165 flip = gst_flip;
166 return result;
167 }
168
169 typedef bool RType;
170 return RType();
171 }
172 } // namespace Gst