| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | |
| 3 | |
| 4 | #include <glibmm.h> |
| 5 | |
| 6 | #include <gstreamermm/videooverlay.h> |
| 7 | #include <gstreamermm/private/videooverlay_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 |
| 30 | { |
| 31 | } // anonymous namespace |
| 32 | |
| 33 | |
| 34 | namespace Glib |
| 35 | { |
| 36 | |
| 37 | Glib::RefPtr<Gst::VideoOverlay> wrap(GstVideoOverlay* object, bool take_copy) |
| 38 | { |
| 39 | return Glib::RefPtr<Gst::VideoOverlay>( dynamic_cast<Gst::VideoOverlay*> (Glib::wrap_auto_interface<Gst::VideoOverlay> ((GObject*)(object), take_copy)) ); |
| 40 | //We use dynamic_cast<> in case of multiple inheritance. |
| 41 | } |
| 42 | |
| 43 | } // namespace Glib |
| 44 | |
| 45 | |
| 46 | namespace Gst |
| 47 | { |
| 48 | |
| 49 | |
| 50 | /* The *_Class implementation: */ |
| 51 | |
| 52 | const Glib::Interface_Class& VideoOverlay_Class::init() |
| 53 | { |
| 54 | if(!gtype_) // create the GType if necessary |
| 55 | { |
| 56 | // Glib::Interface_Class has to know the interface init function |
| 57 | // in order to add interfaces to implementing types. |
| 58 | class_init_func_ = &VideoOverlay_Class::iface_init_function; |
| 59 | |
| 60 | // We can not derive from another interface, and it is not necessary anyway. |
| 61 | gtype_ = gst_video_overlay_get_type(); |
| 62 | } |
| 63 | |
| 64 | return *this; |
| 65 | } |
| 66 | |
| 67 | void VideoOverlay_Class::iface_init_function(void* g_iface, void*) |
| 68 | { |
| 69 | const auto klass = static_cast<BaseClassType*>(g_iface); |
| 70 | |
| 71 | //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. |
| 72 | //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc |
| 73 | g_assert(klass != nullptr); |
| 74 | |
| 75 | klass->set_window_handle = &set_window_handle_vfunc_callback; |
| 76 | klass->expose = &expose_vfunc_callback; |
| 77 | klass->handle_events = &handle_events_vfunc_callback; |
| 78 | klass->set_render_rectangle = &set_render_rectangle_vfunc_callback; |
| 79 | |
| 80 | } |
| 81 | |
| 82 | void VideoOverlay_Class::set_window_handle_vfunc_callback(GstVideoOverlay* self, guintptr handle) |
| 83 | { |
| 84 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 85 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 86 | |
| 87 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 88 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 89 | // generated classes can use this optimisation, which avoids the unnecessary |
| 90 | // parameter conversions if there is no possibility of the virtual function |
| 91 | // being overridden: |
| 92 | if(obj_base && obj_base->is_derived_()) |
| 93 | { |
| 94 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 95 | if(obj) // This can be NULL during destruction. |
| 96 | { |
| 97 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 98 | { |
| 99 | // Call the virtual member method, which derived classes might override. |
| 100 | obj->set_window_handle_vfunc(handle); |
| 101 | return; |
| 102 | } |
| 103 | catch(...) |
| 104 | { |
| 105 | Glib::exception_handlers_invoke(); |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 111 | g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). |
| 112 | g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. |
| 113 | ) ); |
| 114 | |
| 115 | // Call the original underlying C function: |
| 116 | if(base && base->set_window_handle) |
| 117 | (*base->set_window_handle)(self, handle); |
| 118 | } |
| 119 | void VideoOverlay_Class::expose_vfunc_callback(GstVideoOverlay* self) |
| 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->expose_vfunc(); |
| 138 | return; |
| 139 | } |
| 140 | catch(...) |
| 141 | { |
| 142 | Glib::exception_handlers_invoke(); |
| 143 | } |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 148 | g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). |
| 149 | g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. |
| 150 | ) ); |
| 151 | |
| 152 | // Call the original underlying C function: |
| 153 | if(base && base->expose) |
| 154 | (*base->expose)(self); |
| 155 | } |
| 156 | void VideoOverlay_Class::handle_events_vfunc_callback(GstVideoOverlay* self, gboolean handle_events) |
| 157 | { |
| 158 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 159 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 160 | |
| 161 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 162 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 163 | // generated classes can use this optimisation, which avoids the unnecessary |
| 164 | // parameter conversions if there is no possibility of the virtual function |
| 165 | // being overridden: |
| 166 | if(obj_base && obj_base->is_derived_()) |
| 167 | { |
| 168 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 169 | if(obj) // This can be NULL during destruction. |
| 170 | { |
| 171 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 172 | { |
| 173 | // Call the virtual member method, which derived classes might override. |
| 174 | obj->handle_events_vfunc(handle_events |
| 175 | ); |
| 176 | return; |
| 177 | } |
| 178 | catch(...) |
| 179 | { |
| 180 | Glib::exception_handlers_invoke(); |
| 181 | } |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 186 | g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). |
| 187 | g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. |
| 188 | ) ); |
| 189 | |
| 190 | // Call the original underlying C function: |
| 191 | if(base && base->handle_events) |
| 192 | (*base->handle_events)(self, handle_events); |
| 193 | } |
| 194 | void VideoOverlay_Class::set_render_rectangle_vfunc_callback(GstVideoOverlay* self, gint x, gint y, gint width, gint height) |
| 195 | { |
| 196 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 197 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 198 | |
| 199 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 200 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 201 | // generated classes can use this optimisation, which avoids the unnecessary |
| 202 | // parameter conversions if there is no possibility of the virtual function |
| 203 | // being overridden: |
| 204 | if(obj_base && obj_base->is_derived_()) |
| 205 | { |
| 206 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 207 | if(obj) // This can be NULL during destruction. |
| 208 | { |
| 209 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 210 | { |
| 211 | // Call the virtual member method, which derived classes might override. |
| 212 | obj->set_render_rectangle_vfunc(x |
| 213 | , y |
| 214 | , width |
| 215 | , height |
| 216 | ); |
| 217 | return; |
| 218 | } |
| 219 | catch(...) |
| 220 | { |
| 221 | Glib::exception_handlers_invoke(); |
| 222 | } |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 227 | g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). |
| 228 | g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. |
| 229 | ) ); |
| 230 | |
| 231 | // Call the original underlying C function: |
| 232 | if(base && base->set_render_rectangle) |
| 233 | (*base->set_render_rectangle)(self, x, y, width, height); |
| 234 | } |
| 235 | |
| 236 | |
| 237 | Glib::ObjectBase* VideoOverlay_Class::wrap_new(GObject* object) |
| 238 | { |
| 239 | return new VideoOverlay((GstVideoOverlay*)(object)); |
| 240 | } |
| 241 | |
| 242 | |
| 243 | /* The implementation: */ |
| 244 | |
| 245 | VideoOverlay::VideoOverlay() |
| 246 | : |
| 247 | Glib::Interface(videooverlay_class_.init()) |
| 248 | {} |
| 249 | |
| 250 | VideoOverlay::VideoOverlay(GstVideoOverlay* castitem) |
| 251 | : |
| 252 | Glib::Interface((GObject*)(castitem)) |
| 253 | {} |
| 254 | |
| 255 | VideoOverlay::VideoOverlay(const Glib::Interface_Class& interface_class) |
| 256 | : Glib::Interface(interface_class) |
| 257 | { |
| 258 | } |
| 259 | |
| 260 | VideoOverlay::VideoOverlay(VideoOverlay&& src) noexcept |
| 261 | : Glib::Interface(std::move(src)) |
| 262 | {} |
| 263 | |
| 264 | VideoOverlay& VideoOverlay::operator=(VideoOverlay&& src) noexcept |
| 265 | { |
| 266 | Glib::Interface::operator=(std::move(src)); |
| 267 | return *this; |
| 268 | } |
| 269 | |
| 270 | VideoOverlay::~VideoOverlay() noexcept |
| 271 | {} |
| 272 | |
| 273 | // static |
| 274 | void VideoOverlay::add_interface(GType gtype_implementer) |
| 275 | { |
| 276 | videooverlay_class_.init().add_interface(gtype_implementer); |
| 277 | } |
| 278 | |
| 279 | VideoOverlay::CppClassType VideoOverlay::videooverlay_class_; // initialize static member |
| 280 | |
| 281 | GType VideoOverlay::get_type() |
| 282 | { |
| 283 | return videooverlay_class_.init().get_type(); |
| 284 | } |
| 285 | |
| 286 | |
| 287 | GType VideoOverlay::get_base_type() |
| 288 | { |
| 289 | return gst_video_overlay_get_type(); |
| 290 | } |
| 291 | |
| 292 | |
| 293 | void VideoOverlay::set_window_handle(guintptr window_handle) |
| 294 | { |
| 295 | gst_video_overlay_set_window_handle(gobj(), window_handle); |
| 296 | } |
| 297 | |
| 298 | void VideoOverlay::got_window_handle(guintptr window_handle) |
| 299 | { |
| 300 | gst_video_overlay_got_window_handle(gobj(), window_handle); |
| 301 | } |
| 302 | |
| 303 | void VideoOverlay::prepare_window_handle() |
| 304 | { |
| 305 | gst_video_overlay_prepare_window_handle(gobj()); |
| 306 | } |
| 307 | |
| 308 | void VideoOverlay::expose() |
| 309 | { |
| 310 | gst_video_overlay_expose(gobj()); |
| 311 | } |
| 312 | |
| 313 | void VideoOverlay::handle_events(bool handle_events) |
| 314 | { |
| 315 | gst_video_overlay_handle_events(gobj(), static_cast<int>(handle_events)); |
| 316 | } |
| 317 | |
| 318 | bool VideoOverlay::set_render_rectangle(int x, int y, int width, int height) |
| 319 | { |
| 320 | return gst_video_overlay_set_render_rectangle(gobj(), x, y, width, height); |
| 321 | } |
| 322 | |
| 323 | |
| 324 | void Gst::VideoOverlay::set_window_handle_vfunc(guintptr handle) |
| 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(gobject_), CppObjectType::get_type()) // Get the interface. |
| 329 | ) ); |
| 330 | |
| 331 | if(base && base->set_window_handle) |
| 332 | { |
| 333 | (*base->set_window_handle)(gobj(),handle); |
| 334 | } |
| 335 | } |
| 336 | void Gst::VideoOverlay::expose_vfunc() |
| 337 | { |
| 338 | const auto base = static_cast<BaseClassType*>( |
| 339 | g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). |
| 340 | g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. |
| 341 | ) ); |
| 342 | |
| 343 | if(base && base->expose) |
| 344 | { |
| 345 | (*base->expose)(gobj()); |
| 346 | } |
| 347 | } |
| 348 | void Gst::VideoOverlay::handle_events_vfunc(bool handle_events) |
| 349 | { |
| 350 | const auto base = static_cast<BaseClassType*>( |
| 351 | g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). |
| 352 | g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. |
| 353 | ) ); |
| 354 | |
| 355 | if(base && base->handle_events) |
| 356 | { |
| 357 | (*base->handle_events)(gobj(),static_cast<int>(handle_events)); |
| 358 | } |
| 359 | } |
| 360 | void Gst::VideoOverlay::set_render_rectangle_vfunc(int x, int y, int width, int height) |
| 361 | { |
| 362 | const auto base = static_cast<BaseClassType*>( |
| 363 | g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). |
| 364 | g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. |
| 365 | ) ); |
| 366 | |
| 367 | if(base && base->set_render_rectangle) |
| 368 | { |
| 369 | (*base->set_render_rectangle)(gobj(),x,y,width,height); |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | |
| 374 | } // namespace Gst |
| 375 | |
| 376 |