1 // Generated by gmmproc 2.56.0 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <atkmm/component.h>
7 #include <atkmm/private/component_p.h>
8
9 #include <atk/atk-enum-types.h>
10
11 // -*- c++ -*-
12 /* $Id: component.ccg,v 1.1 2003/01/21 13:37:05 murrayc Exp $ */
13
14 /* Copyright 1998-2002 The gtkmm Development Team
15 *
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License as published by the Free Software Foundation; either
19 * version 2.1 of the License, or (at your option) any later version.
20 *
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free
28 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 */
30
31 #include <atkmm/object.h>
32 #include <atk/atkcomponent.h>
33
34
35 namespace
36 {
37 } // anonymous namespace
38
39 // static
value_type()40 GType Glib::Value<Atk::CoordType>::value_type()
41 {
42 return atk_coord_type_get_type();
43 }
44
45 // static
value_type()46 GType Glib::Value<Atk::Layer>::value_type()
47 {
48 return atk_layer_get_type();
49 }
50
51
52 namespace Glib
53 {
54
wrap(AtkComponent * object,bool take_copy)55 Glib::RefPtr<Atk::Component> wrap(AtkComponent* object, bool take_copy)
56 {
57 return Glib::RefPtr<Atk::Component>( dynamic_cast<Atk::Component*> (Glib::wrap_auto_interface<Atk::Component> ((GObject*)(object), take_copy)) );
58 //We use dynamic_cast<> in case of multiple inheritance.
59 }
60
61 } // namespace Glib
62
63
64 namespace Atk
65 {
66
67
68 /* The *_Class implementation: */
69
init()70 const Glib::Interface_Class& Component_Class::init()
71 {
72 if(!gtype_) // create the GType if necessary
73 {
74 // Glib::Interface_Class has to know the interface init function
75 // in order to add interfaces to implementing types.
76 class_init_func_ = &Component_Class::iface_init_function;
77
78 // We can not derive from another interface, and it is not necessary anyway.
79 gtype_ = atk_component_get_type();
80 }
81
82 return *this;
83 }
84
iface_init_function(void * g_iface,void *)85 void Component_Class::iface_init_function(void* g_iface, void*)
86 {
87 const auto klass = static_cast<BaseClassType*>(g_iface);
88
89 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
90 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
91 g_assert(klass != nullptr);
92
93 klass->add_focus_handler = &add_focus_handler_vfunc_callback;
94 klass->contains = &contains_vfunc_callback;
95 klass->ref_accessible_at_point = &ref_accessible_at_point_vfunc_callback;
96 klass->get_extents = &get_extents_vfunc_callback;
97 klass->get_position = &get_position_vfunc_callback;
98 klass->get_size = &get_size_vfunc_callback;
99 klass->get_layer = &get_layer_vfunc_callback;
100 klass->get_mdi_zorder = &get_mdi_zorder_vfunc_callback;
101 klass->grab_focus = &grab_focus_vfunc_callback;
102 klass->remove_focus_handler = &remove_focus_handler_vfunc_callback;
103 klass->set_extents = &set_extents_vfunc_callback;
104 klass->set_position = &set_position_vfunc_callback;
105 klass->set_size = &set_size_vfunc_callback;
106
107 }
108
add_focus_handler_vfunc_callback(AtkComponent * self,AtkFocusHandler handler)109 guint Component_Class::add_focus_handler_vfunc_callback(AtkComponent* self, AtkFocusHandler handler)
110 {
111 const auto obj_base = static_cast<Glib::ObjectBase*>(
112 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
113
114 // Non-gtkmmproc-generated custom classes implicitly call the default
115 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
116 // generated classes can use this optimisation, which avoids the unnecessary
117 // parameter conversions if there is no possibility of the virtual function
118 // being overridden:
119 if(obj_base && obj_base->is_derived_())
120 {
121 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
122 if(obj) // This can be NULL during destruction.
123 {
124 try // Trap C++ exceptions which would normally be lost because this is a C callback.
125 {
126 // Call the virtual member method, which derived classes might override.
127 return obj->add_focus_handler_vfunc(handler);
128 }
129 catch(...)
130 {
131 Glib::exception_handlers_invoke();
132 }
133 }
134 }
135
136 BaseClassType *const base = static_cast<BaseClassType*>(
137 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
138 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
139 ) );
140
141 // Call the original underlying C function:
142 if(base && base->add_focus_handler)
143 return (*base->add_focus_handler)(self, handler);
144
145 using RType = guint;
146 return RType();
147 }
contains_vfunc_callback(AtkComponent * self,gint x,gint y,AtkCoordType coord_type)148 gboolean Component_Class::contains_vfunc_callback(AtkComponent* self, gint x, gint y, AtkCoordType coord_type)
149 {
150 const auto obj_base = static_cast<Glib::ObjectBase*>(
151 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
152
153 // Non-gtkmmproc-generated custom classes implicitly call the default
154 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
155 // generated classes can use this optimisation, which avoids the unnecessary
156 // parameter conversions if there is no possibility of the virtual function
157 // being overridden:
158 if(obj_base && obj_base->is_derived_())
159 {
160 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
161 if(obj) // This can be NULL during destruction.
162 {
163 try // Trap C++ exceptions which would normally be lost because this is a C callback.
164 {
165 // Call the virtual member method, which derived classes might override.
166 return static_cast<int>(obj->contains_vfunc(x
167 , y
168 , ((CoordType)(coord_type))
169 ));
170 }
171 catch(...)
172 {
173 Glib::exception_handlers_invoke();
174 }
175 }
176 }
177
178 BaseClassType *const base = static_cast<BaseClassType*>(
179 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
180 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
181 ) );
182
183 // Call the original underlying C function:
184 if(base && base->contains)
185 return (*base->contains)(self, x, y, coord_type);
186
187 using RType = gboolean;
188 return RType();
189 }
ref_accessible_at_point_vfunc_callback(AtkComponent * self,gint x,gint y,AtkCoordType coord_type)190 AtkObject* Component_Class::ref_accessible_at_point_vfunc_callback(AtkComponent* self, gint x, gint y, AtkCoordType coord_type)
191 {
192 const auto obj_base = static_cast<Glib::ObjectBase*>(
193 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
194
195 // Non-gtkmmproc-generated custom classes implicitly call the default
196 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
197 // generated classes can use this optimisation, which avoids the unnecessary
198 // parameter conversions if there is no possibility of the virtual function
199 // being overridden:
200 if(obj_base && obj_base->is_derived_())
201 {
202 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
203 if(obj) // This can be NULL during destruction.
204 {
205 try // Trap C++ exceptions which would normally be lost because this is a C callback.
206 {
207 // Call the virtual member method, which derived classes might override.
208 return Glib::unwrap_copy(obj->get_accessible_at_point_vfunc(x
209 , y
210 , ((CoordType)(coord_type))
211 ));
212 }
213 catch(...)
214 {
215 Glib::exception_handlers_invoke();
216 }
217 }
218 }
219
220 BaseClassType *const base = static_cast<BaseClassType*>(
221 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
222 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
223 ) );
224
225 // Call the original underlying C function:
226 if(base && base->ref_accessible_at_point)
227 return (*base->ref_accessible_at_point)(self, x, y, coord_type);
228
229 using RType = AtkObject*;
230 return RType();
231 }
get_extents_vfunc_callback(AtkComponent * self,gint * x,gint * y,gint * width,gint * height,AtkCoordType coord_type)232 void Component_Class::get_extents_vfunc_callback(AtkComponent* self, gint* x, gint* y, gint* width, gint* height, AtkCoordType coord_type)
233 {
234 const auto obj_base = static_cast<Glib::ObjectBase*>(
235 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
236
237 // Non-gtkmmproc-generated custom classes implicitly call the default
238 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
239 // generated classes can use this optimisation, which avoids the unnecessary
240 // parameter conversions if there is no possibility of the virtual function
241 // being overridden:
242 if(obj_base && obj_base->is_derived_())
243 {
244 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
245 if(obj) // This can be NULL during destruction.
246 {
247 try // Trap C++ exceptions which would normally be lost because this is a C callback.
248 {
249 // Call the virtual member method, which derived classes might override.
250 obj->get_extents_vfunc(*(x)
251 , *(y)
252 , *(width)
253 , *(height)
254 , ((CoordType)(coord_type))
255 );
256 return;
257 }
258 catch(...)
259 {
260 Glib::exception_handlers_invoke();
261 }
262 }
263 }
264
265 BaseClassType *const base = static_cast<BaseClassType*>(
266 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
267 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
268 ) );
269
270 // Call the original underlying C function:
271 if(base && base->get_extents)
272 (*base->get_extents)(self, x, y, width, height, coord_type);
273 }
get_position_vfunc_callback(AtkComponent * self,gint * x,gint * y,AtkCoordType coord_type)274 void Component_Class::get_position_vfunc_callback(AtkComponent* self, gint* x, gint* y, AtkCoordType coord_type)
275 {
276 const auto obj_base = static_cast<Glib::ObjectBase*>(
277 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
278
279 // Non-gtkmmproc-generated custom classes implicitly call the default
280 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
281 // generated classes can use this optimisation, which avoids the unnecessary
282 // parameter conversions if there is no possibility of the virtual function
283 // being overridden:
284 if(obj_base && obj_base->is_derived_())
285 {
286 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
287 if(obj) // This can be NULL during destruction.
288 {
289 try // Trap C++ exceptions which would normally be lost because this is a C callback.
290 {
291 // Call the virtual member method, which derived classes might override.
292 obj->get_position_vfunc(*(x)
293 , *(y)
294 , ((CoordType)(coord_type))
295 );
296 return;
297 }
298 catch(...)
299 {
300 Glib::exception_handlers_invoke();
301 }
302 }
303 }
304
305 BaseClassType *const base = static_cast<BaseClassType*>(
306 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
307 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
308 ) );
309
310 // Call the original underlying C function:
311 if(base && base->get_position)
312 (*base->get_position)(self, x, y, coord_type);
313 }
get_size_vfunc_callback(AtkComponent * self,gint * width,gint * height)314 void Component_Class::get_size_vfunc_callback(AtkComponent* self, gint* width, gint* height)
315 {
316 const auto obj_base = static_cast<Glib::ObjectBase*>(
317 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
318
319 // Non-gtkmmproc-generated custom classes implicitly call the default
320 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
321 // generated classes can use this optimisation, which avoids the unnecessary
322 // parameter conversions if there is no possibility of the virtual function
323 // being overridden:
324 if(obj_base && obj_base->is_derived_())
325 {
326 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
327 if(obj) // This can be NULL during destruction.
328 {
329 try // Trap C++ exceptions which would normally be lost because this is a C callback.
330 {
331 // Call the virtual member method, which derived classes might override.
332 obj->get_size_vfunc(*(width)
333 , *(height)
334 );
335 return;
336 }
337 catch(...)
338 {
339 Glib::exception_handlers_invoke();
340 }
341 }
342 }
343
344 BaseClassType *const base = static_cast<BaseClassType*>(
345 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
346 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
347 ) );
348
349 // Call the original underlying C function:
350 if(base && base->get_size)
351 (*base->get_size)(self, width, height);
352 }
get_layer_vfunc_callback(AtkComponent * self)353 AtkLayer Component_Class::get_layer_vfunc_callback(AtkComponent* self)
354 {
355 const auto obj_base = static_cast<Glib::ObjectBase*>(
356 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
357
358 // Non-gtkmmproc-generated custom classes implicitly call the default
359 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
360 // generated classes can use this optimisation, which avoids the unnecessary
361 // parameter conversions if there is no possibility of the virtual function
362 // being overridden:
363 if(obj_base && obj_base->is_derived_())
364 {
365 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
366 if(obj) // This can be NULL during destruction.
367 {
368 try // Trap C++ exceptions which would normally be lost because this is a C callback.
369 {
370 // Call the virtual member method, which derived classes might override.
371 return ((AtkLayer)(obj->get_layer_vfunc()));
372 }
373 catch(...)
374 {
375 Glib::exception_handlers_invoke();
376 }
377 }
378 }
379
380 BaseClassType *const base = static_cast<BaseClassType*>(
381 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
382 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
383 ) );
384
385 // Call the original underlying C function:
386 if(base && base->get_layer)
387 return (*base->get_layer)(self);
388
389 using RType = AtkLayer;
390 return RType();
391 }
get_mdi_zorder_vfunc_callback(AtkComponent * self)392 gint Component_Class::get_mdi_zorder_vfunc_callback(AtkComponent* self)
393 {
394 const auto obj_base = static_cast<Glib::ObjectBase*>(
395 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
396
397 // Non-gtkmmproc-generated custom classes implicitly call the default
398 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
399 // generated classes can use this optimisation, which avoids the unnecessary
400 // parameter conversions if there is no possibility of the virtual function
401 // being overridden:
402 if(obj_base && obj_base->is_derived_())
403 {
404 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
405 if(obj) // This can be NULL during destruction.
406 {
407 try // Trap C++ exceptions which would normally be lost because this is a C callback.
408 {
409 // Call the virtual member method, which derived classes might override.
410 return obj->get_mdi_zorder_vfunc();
411 }
412 catch(...)
413 {
414 Glib::exception_handlers_invoke();
415 }
416 }
417 }
418
419 BaseClassType *const base = static_cast<BaseClassType*>(
420 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
421 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
422 ) );
423
424 // Call the original underlying C function:
425 if(base && base->get_mdi_zorder)
426 return (*base->get_mdi_zorder)(self);
427
428 using RType = gint;
429 return RType();
430 }
grab_focus_vfunc_callback(AtkComponent * self)431 gboolean Component_Class::grab_focus_vfunc_callback(AtkComponent* self)
432 {
433 const auto obj_base = static_cast<Glib::ObjectBase*>(
434 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
435
436 // Non-gtkmmproc-generated custom classes implicitly call the default
437 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
438 // generated classes can use this optimisation, which avoids the unnecessary
439 // parameter conversions if there is no possibility of the virtual function
440 // being overridden:
441 if(obj_base && obj_base->is_derived_())
442 {
443 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
444 if(obj) // This can be NULL during destruction.
445 {
446 try // Trap C++ exceptions which would normally be lost because this is a C callback.
447 {
448 // Call the virtual member method, which derived classes might override.
449 return static_cast<int>(obj->grab_focus_vfunc());
450 }
451 catch(...)
452 {
453 Glib::exception_handlers_invoke();
454 }
455 }
456 }
457
458 BaseClassType *const base = static_cast<BaseClassType*>(
459 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
460 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
461 ) );
462
463 // Call the original underlying C function:
464 if(base && base->grab_focus)
465 return (*base->grab_focus)(self);
466
467 using RType = gboolean;
468 return RType();
469 }
remove_focus_handler_vfunc_callback(AtkComponent * self,guint handler_id)470 void Component_Class::remove_focus_handler_vfunc_callback(AtkComponent* self, guint handler_id)
471 {
472 const auto obj_base = static_cast<Glib::ObjectBase*>(
473 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
474
475 // Non-gtkmmproc-generated custom classes implicitly call the default
476 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
477 // generated classes can use this optimisation, which avoids the unnecessary
478 // parameter conversions if there is no possibility of the virtual function
479 // being overridden:
480 if(obj_base && obj_base->is_derived_())
481 {
482 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
483 if(obj) // This can be NULL during destruction.
484 {
485 try // Trap C++ exceptions which would normally be lost because this is a C callback.
486 {
487 // Call the virtual member method, which derived classes might override.
488 obj->remove_focus_handler_vfunc(handler_id);
489 return;
490 }
491 catch(...)
492 {
493 Glib::exception_handlers_invoke();
494 }
495 }
496 }
497
498 BaseClassType *const base = static_cast<BaseClassType*>(
499 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
500 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
501 ) );
502
503 // Call the original underlying C function:
504 if(base && base->remove_focus_handler)
505 (*base->remove_focus_handler)(self, handler_id);
506 }
set_extents_vfunc_callback(AtkComponent * self,gint x,gint y,gint width,gint height,AtkCoordType coord_type)507 gboolean Component_Class::set_extents_vfunc_callback(AtkComponent* self, gint x, gint y, gint width, gint height, AtkCoordType coord_type)
508 {
509 const auto obj_base = static_cast<Glib::ObjectBase*>(
510 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
511
512 // Non-gtkmmproc-generated custom classes implicitly call the default
513 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
514 // generated classes can use this optimisation, which avoids the unnecessary
515 // parameter conversions if there is no possibility of the virtual function
516 // being overridden:
517 if(obj_base && obj_base->is_derived_())
518 {
519 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
520 if(obj) // This can be NULL during destruction.
521 {
522 try // Trap C++ exceptions which would normally be lost because this is a C callback.
523 {
524 // Call the virtual member method, which derived classes might override.
525 return static_cast<int>(obj->set_extents_vfunc(x
526 , y
527 , width
528 , height
529 , ((CoordType)(coord_type))
530 ));
531 }
532 catch(...)
533 {
534 Glib::exception_handlers_invoke();
535 }
536 }
537 }
538
539 BaseClassType *const base = static_cast<BaseClassType*>(
540 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
541 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
542 ) );
543
544 // Call the original underlying C function:
545 if(base && base->set_extents)
546 return (*base->set_extents)(self, x, y, width, height, coord_type);
547
548 using RType = gboolean;
549 return RType();
550 }
set_position_vfunc_callback(AtkComponent * self,gint x,gint y,AtkCoordType coord_type)551 gboolean Component_Class::set_position_vfunc_callback(AtkComponent* self, gint x, gint y, AtkCoordType coord_type)
552 {
553 const auto obj_base = static_cast<Glib::ObjectBase*>(
554 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
555
556 // Non-gtkmmproc-generated custom classes implicitly call the default
557 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
558 // generated classes can use this optimisation, which avoids the unnecessary
559 // parameter conversions if there is no possibility of the virtual function
560 // being overridden:
561 if(obj_base && obj_base->is_derived_())
562 {
563 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
564 if(obj) // This can be NULL during destruction.
565 {
566 try // Trap C++ exceptions which would normally be lost because this is a C callback.
567 {
568 // Call the virtual member method, which derived classes might override.
569 return static_cast<int>(obj->set_position_vfunc(x
570 , y
571 , ((CoordType)(coord_type))
572 ));
573 }
574 catch(...)
575 {
576 Glib::exception_handlers_invoke();
577 }
578 }
579 }
580
581 BaseClassType *const base = static_cast<BaseClassType*>(
582 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
583 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
584 ) );
585
586 // Call the original underlying C function:
587 if(base && base->set_position)
588 return (*base->set_position)(self, x, y, coord_type);
589
590 using RType = gboolean;
591 return RType();
592 }
set_size_vfunc_callback(AtkComponent * self,gint width,gint height)593 gboolean Component_Class::set_size_vfunc_callback(AtkComponent* self, gint width, gint height)
594 {
595 const auto obj_base = static_cast<Glib::ObjectBase*>(
596 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
597
598 // Non-gtkmmproc-generated custom classes implicitly call the default
599 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
600 // generated classes can use this optimisation, which avoids the unnecessary
601 // parameter conversions if there is no possibility of the virtual function
602 // being overridden:
603 if(obj_base && obj_base->is_derived_())
604 {
605 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
606 if(obj) // This can be NULL during destruction.
607 {
608 try // Trap C++ exceptions which would normally be lost because this is a C callback.
609 {
610 // Call the virtual member method, which derived classes might override.
611 return static_cast<int>(obj->set_size_vfunc(width
612 , height
613 ));
614 }
615 catch(...)
616 {
617 Glib::exception_handlers_invoke();
618 }
619 }
620 }
621
622 BaseClassType *const base = static_cast<BaseClassType*>(
623 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
624 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
625 ) );
626
627 // Call the original underlying C function:
628 if(base && base->set_size)
629 return (*base->set_size)(self, width, height);
630
631 using RType = gboolean;
632 return RType();
633 }
634
635
wrap_new(GObject * object)636 Glib::ObjectBase* Component_Class::wrap_new(GObject* object)
637 {
638 return new Component((AtkComponent*)(object));
639 }
640
641
642 /* The implementation: */
643
Component()644 Component::Component()
645 :
646 Glib::Interface(component_class_.init())
647 {}
648
Component(AtkComponent * castitem)649 Component::Component(AtkComponent* castitem)
650 :
651 Glib::Interface((GObject*)(castitem))
652 {}
653
Component(const Glib::Interface_Class & interface_class)654 Component::Component(const Glib::Interface_Class& interface_class)
655 : Glib::Interface(interface_class)
656 {
657 }
658
Component(Component && src)659 Component::Component(Component&& src) noexcept
660 : Glib::Interface(std::move(src))
661 {}
662
operator =(Component && src)663 Component& Component::operator=(Component&& src) noexcept
664 {
665 Glib::Interface::operator=(std::move(src));
666 return *this;
667 }
668
~Component()669 Component::~Component() noexcept
670 {}
671
672 // static
add_interface(GType gtype_implementer)673 void Component::add_interface(GType gtype_implementer)
674 {
675 component_class_.init().add_interface(gtype_implementer);
676 }
677
678 Component::CppClassType Component::component_class_; // initialize static member
679
get_type()680 GType Component::get_type()
681 {
682 return component_class_.init().get_type();
683 }
684
685
get_base_type()686 GType Component::get_base_type()
687 {
688 return atk_component_get_type();
689 }
690
691
692 #ifndef ATKMM_DISABLE_DEPRECATED
693 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
add_focus_handler(AtkFocusHandler handler)694 guint Component::add_focus_handler(AtkFocusHandler handler)
695 {
696 return atk_component_add_focus_handler(gobj(), handler);
697 }
698 G_GNUC_END_IGNORE_DEPRECATIONS
699 #endif // ATKMM_DISABLE_DEPRECATED
700
contains(int x,int y,CoordType coord_type) const701 bool Component::contains(int x, int y, CoordType coord_type) const
702 {
703 return atk_component_contains(const_cast<AtkComponent*>(gobj()), x, y, ((AtkCoordType)(coord_type)));
704 }
705
get_accessible_at_point(int x,int y,CoordType coord_type)706 Glib::RefPtr<Atk::Object> Component::get_accessible_at_point(int x, int y, CoordType coord_type)
707 {
708 return Glib::wrap(atk_component_ref_accessible_at_point(gobj(), x, y, ((AtkCoordType)(coord_type))));
709 }
710
get_extents(int & x,int & y,int & width,int & height,CoordType coord_type) const711 void Component::get_extents(int& x, int& y, int& width, int& height, CoordType coord_type) const
712 {
713 atk_component_get_extents(const_cast<AtkComponent*>(gobj()), &(x), &(y), &(width), &(height), ((AtkCoordType)(coord_type)));
714 }
715
716 #ifndef ATKMM_DISABLE_DEPRECATED
717 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
get_position(int & x,int & y,CoordType coord_type) const718 void Component::get_position(int& x, int& y, CoordType coord_type) const
719 {
720 atk_component_get_position(const_cast<AtkComponent*>(gobj()), &(x), &(y), ((AtkCoordType)(coord_type)));
721 }
722 G_GNUC_END_IGNORE_DEPRECATIONS
723 #endif // ATKMM_DISABLE_DEPRECATED
724
725 #ifndef ATKMM_DISABLE_DEPRECATED
726 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
get_size(int & width,int & height) const727 void Component::get_size(int& width, int& height) const
728 {
729 atk_component_get_size(const_cast<AtkComponent*>(gobj()), &(width), &(height));
730 }
731 G_GNUC_END_IGNORE_DEPRECATIONS
732 #endif // ATKMM_DISABLE_DEPRECATED
733
get_layer() const734 Layer Component::get_layer() const
735 {
736 return ((Layer)(atk_component_get_layer(const_cast<AtkComponent*>(gobj()))));
737 }
738
get_mdi_zorder() const739 int Component::get_mdi_zorder() const
740 {
741 return atk_component_get_mdi_zorder(const_cast<AtkComponent*>(gobj()));
742 }
743
grab_focus()744 bool Component::grab_focus()
745 {
746 return atk_component_grab_focus(gobj());
747 }
748
749 #ifndef ATKMM_DISABLE_DEPRECATED
750 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
remove_focus_handler(guint handler_id)751 void Component::remove_focus_handler(guint handler_id)
752 {
753 atk_component_remove_focus_handler(gobj(), handler_id);
754 }
755 G_GNUC_END_IGNORE_DEPRECATIONS
756 #endif // ATKMM_DISABLE_DEPRECATED
757
set_extents(int x,int y,int width,int height,CoordType coord_type)758 bool Component::set_extents(int x, int y, int width, int height, CoordType coord_type)
759 {
760 return atk_component_set_extents(gobj(), x, y, width, height, ((AtkCoordType)(coord_type)));
761 }
762
set_position(int x,int y,CoordType coord_type)763 bool Component::set_position(int x, int y, CoordType coord_type)
764 {
765 return atk_component_set_position(gobj(), x, y, ((AtkCoordType)(coord_type)));
766 }
767
set_size(int width,int height)768 bool Component::set_size(int width, int height)
769 {
770 return atk_component_set_size(gobj(), width, height);
771 }
772
773
add_focus_handler_vfunc(AtkFocusHandler handler)774 guint Atk::Component::add_focus_handler_vfunc(AtkFocusHandler handler)
775 {
776 const auto base = static_cast<BaseClassType*>(
777 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
778 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
779 ) );
780
781 if(base && base->add_focus_handler)
782 {
783 guint retval((*base->add_focus_handler)(gobj(),handler));
784 return retval;
785 }
786
787 using RType = guint;
788 return RType();
789 }
contains_vfunc(int x,int y,CoordType coord_type) const790 bool Atk::Component::contains_vfunc(int x, int y, CoordType coord_type) const
791 {
792 const auto base = static_cast<BaseClassType*>(
793 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
794 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
795 ) );
796
797 if(base && base->contains)
798 {
799 bool retval((*base->contains)(const_cast<AtkComponent*>(gobj()),x,y,((AtkCoordType)(coord_type))));
800 return retval;
801 }
802
803 using RType = bool;
804 return RType();
805 }
get_accessible_at_point_vfunc(int x,int y,CoordType coord_type)806 Glib::RefPtr<Atk::Object> Atk::Component::get_accessible_at_point_vfunc(int x, int y, CoordType coord_type)
807 {
808 const auto base = static_cast<BaseClassType*>(
809 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
810 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
811 ) );
812
813 if(base && base->ref_accessible_at_point)
814 {
815 Glib::RefPtr<Atk::Object> retval(Glib::wrap((*base->ref_accessible_at_point)(gobj(),x,y,((AtkCoordType)(coord_type)))));
816 return retval;
817 }
818
819 using RType = Glib::RefPtr<Atk::Object>;
820 return RType();
821 }
get_extents_vfunc(int & x,int & y,int & width,int & height,CoordType coord_type) const822 void Atk::Component::get_extents_vfunc(int& x, int& y, int& width, int& height, CoordType coord_type) const
823 {
824 const auto base = static_cast<BaseClassType*>(
825 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
826 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
827 ) );
828
829 if(base && base->get_extents)
830 {
831 (*base->get_extents)(const_cast<AtkComponent*>(gobj()),&(x),&(y),&(width),&(height),((AtkCoordType)(coord_type)));
832 }
833 }
get_position_vfunc(int & x,int & y,CoordType coord_type) const834 void Atk::Component::get_position_vfunc(int& x, int& y, CoordType coord_type) const
835 {
836 const auto base = static_cast<BaseClassType*>(
837 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
838 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
839 ) );
840
841 if(base && base->get_position)
842 {
843 (*base->get_position)(const_cast<AtkComponent*>(gobj()),&(x),&(y),((AtkCoordType)(coord_type)));
844 }
845 }
get_size_vfunc(int & width,int & height) const846 void Atk::Component::get_size_vfunc(int& width, int& height) const
847 {
848 const auto base = static_cast<BaseClassType*>(
849 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
850 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
851 ) );
852
853 if(base && base->get_size)
854 {
855 (*base->get_size)(const_cast<AtkComponent*>(gobj()),&(width),&(height));
856 }
857 }
get_layer_vfunc() const858 Layer Atk::Component::get_layer_vfunc() const
859 {
860 const auto base = static_cast<BaseClassType*>(
861 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
862 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
863 ) );
864
865 if(base && base->get_layer)
866 {
867 Layer retval(((Layer)((*base->get_layer)(const_cast<AtkComponent*>(gobj())))));
868 return retval;
869 }
870
871 using RType = Layer;
872 return RType();
873 }
get_mdi_zorder_vfunc() const874 int Atk::Component::get_mdi_zorder_vfunc() const
875 {
876 const auto base = static_cast<BaseClassType*>(
877 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
878 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
879 ) );
880
881 if(base && base->get_mdi_zorder)
882 {
883 int retval((*base->get_mdi_zorder)(const_cast<AtkComponent*>(gobj())));
884 return retval;
885 }
886
887 using RType = int;
888 return RType();
889 }
grab_focus_vfunc()890 bool Atk::Component::grab_focus_vfunc()
891 {
892 const auto base = static_cast<BaseClassType*>(
893 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
894 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
895 ) );
896
897 if(base && base->grab_focus)
898 {
899 bool retval((*base->grab_focus)(gobj()));
900 return retval;
901 }
902
903 using RType = bool;
904 return RType();
905 }
remove_focus_handler_vfunc(guint handler_id)906 void Atk::Component::remove_focus_handler_vfunc(guint handler_id)
907 {
908 const auto base = static_cast<BaseClassType*>(
909 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
910 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
911 ) );
912
913 if(base && base->remove_focus_handler)
914 {
915 (*base->remove_focus_handler)(gobj(),handler_id);
916 }
917 }
set_extents_vfunc(int x,int y,int width,int height,CoordType coord_type)918 bool Atk::Component::set_extents_vfunc(int x, int y, int width, int height, CoordType coord_type)
919 {
920 const auto base = static_cast<BaseClassType*>(
921 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
922 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
923 ) );
924
925 if(base && base->set_extents)
926 {
927 bool retval((*base->set_extents)(gobj(),x,y,width,height,((AtkCoordType)(coord_type))));
928 return retval;
929 }
930
931 using RType = bool;
932 return RType();
933 }
set_position_vfunc(int x,int y,CoordType coord_type)934 bool Atk::Component::set_position_vfunc(int x, int y, CoordType coord_type)
935 {
936 const auto base = static_cast<BaseClassType*>(
937 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
938 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
939 ) );
940
941 if(base && base->set_position)
942 {
943 bool retval((*base->set_position)(gobj(),x,y,((AtkCoordType)(coord_type))));
944 return retval;
945 }
946
947 using RType = bool;
948 return RType();
949 }
set_size_vfunc(int width,int height)950 bool Atk::Component::set_size_vfunc(int width, int height)
951 {
952 const auto base = static_cast<BaseClassType*>(
953 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
954 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
955 ) );
956
957 if(base && base->set_size)
958 {
959 bool retval((*base->set_size)(gobj(),width,height));
960 return retval;
961 }
962
963 using RType = bool;
964 return RType();
965 }
966
967
968 } // namespace Atk
969
970
971