1 // Generated by gmmproc 2.56.0 -- DO NOT MODIFY!
2 
3 
4 #include <glibmm.h>
5 
6 #include <atkmm/text.h>
7 #include <atkmm/private/text_p.h>
8 
9 #include <atk/atk-enum-types.h>
10 
11 // -*- c++ -*-
12 /* $Id: text.ccg,v 1.1 2003/01/21 13:37:07 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 <glib.h>
33 #include <algorithm> /* for std::swap() */
34 
35 
36 // static
value_type()37 GType Glib::Value<Atk::TextAttribute>::value_type()
38 {
39   return atk_text_attribute_get_type();
40 }
41 
42 
43 namespace Atk
44 {
45 
46 /**** Atk::Attribute *******************************************************/
47 
Attribute()48 Attribute::Attribute()
49 {
50   gobject_.name  = 0;
51   gobject_.value = 0;
52 }
53 
Attribute(const Glib::ustring & name,const Glib::ustring & value)54 Attribute::Attribute(const Glib::ustring& name, const Glib::ustring& value)
55 {
56   gobject_.name  = g_strndup(name .data(), name .bytes());
57   gobject_.value = g_strndup(value.data(), value.bytes());
58 }
59 
Attribute(const AtkAttribute * gobject)60 Attribute::Attribute(const AtkAttribute* gobject)
61 {
62   g_return_if_fail(gobject != 0);
63 
64   gobject_.name  = g_strdup(gobject->name);
65   gobject_.value = g_strdup(gobject->value);
66 }
67 
~Attribute()68 Attribute::~Attribute()
69 {
70   g_free(gobject_.name);
71   g_free(gobject_.value);
72 }
73 
Attribute(const Attribute & other)74 Attribute::Attribute(const Attribute& other)
75 {
76   gobject_.name  = g_strdup(other.gobject_.name);
77   gobject_.value = g_strdup(other.gobject_.value);
78 }
79 
operator =(const Attribute & other)80 Attribute& Attribute::operator=(const Attribute& other)
81 {
82   Attribute temp (other);
83   swap(temp);
84   return *this;
85 }
86 
swap(Attribute & other)87 void Attribute::swap(Attribute& other)
88 {
89   std::swap(gobject_.name,  other.gobject_.name);
90   std::swap(gobject_.value, other.gobject_.value);
91 }
92 
93 
94 /**** Atk::TextAttribute ***************************************************/
95 
96 // static
for_name(const Glib::ustring & name)97 TextAttribute TextAttribute::for_name(const Glib::ustring& name)
98 {
99   return TextAttribute(int(atk_text_attribute_for_name(name.c_str())));
100 }
101 
102 // static
get_name(TextAttribute attribute)103 Glib::ustring TextAttribute::get_name(TextAttribute attribute)
104 {
105   if(const char *const name = atk_text_attribute_get_name(AtkTextAttribute(int(attribute))))
106     return Glib::ustring(name);
107   else
108     return Glib::ustring();
109 }
110 
111 // static
get_value(TextAttribute attribute,int index)112 Glib::ustring TextAttribute::get_value(TextAttribute attribute, int index)
113 {
114   if(const char *const value = atk_text_attribute_get_value(AtkTextAttribute(int(attribute)), index))
115     return Glib::ustring(value);
116   else
117     return Glib::ustring();
118 }
119 
120 } // namespace Atk
121 
122 
123 namespace
124 {
125 
126 
Text_signal_text_changed_callback(AtkText * self,gint p0,gint p1,void * data)127 static void Text_signal_text_changed_callback(AtkText* self, gint p0,gint p1,void* data)
128 {
129   using namespace Atk;
130   using SlotType = sigc::slot< void,int,int >;
131 
132   auto obj = dynamic_cast<Text*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
133   // Do not try to call a signal on a disassociated wrapper.
134   if(obj)
135   {
136     try
137     {
138       if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
139         (*static_cast<SlotType*>(slot))(p0
140 , p1
141 );
142     }
143     catch(...)
144     {
145        Glib::exception_handlers_invoke();
146     }
147   }
148 }
149 
150 static const Glib::SignalProxyInfo Text_signal_text_changed_info =
151 {
152   "text_changed",
153   (GCallback) &Text_signal_text_changed_callback,
154   (GCallback) &Text_signal_text_changed_callback
155 };
156 
157 
Text_signal_text_caret_moved_callback(AtkText * self,gint p0,void * data)158 static void Text_signal_text_caret_moved_callback(AtkText* self, gint p0,void* data)
159 {
160   using namespace Atk;
161   using SlotType = sigc::slot< void,int >;
162 
163   auto obj = dynamic_cast<Text*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
164   // Do not try to call a signal on a disassociated wrapper.
165   if(obj)
166   {
167     try
168     {
169       if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
170         (*static_cast<SlotType*>(slot))(p0
171 );
172     }
173     catch(...)
174     {
175        Glib::exception_handlers_invoke();
176     }
177   }
178 }
179 
180 static const Glib::SignalProxyInfo Text_signal_text_caret_moved_info =
181 {
182   "text_caret_moved",
183   (GCallback) &Text_signal_text_caret_moved_callback,
184   (GCallback) &Text_signal_text_caret_moved_callback
185 };
186 
187 
188 static const Glib::SignalProxyInfo Text_signal_text_selection_changed_info =
189 {
190   "text_selection_changed",
191   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
192   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
193 };
194 
195 
196 static const Glib::SignalProxyInfo Text_signal_text_attributes_changed_info =
197 {
198   "text_attributes_changed",
199   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
200   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
201 };
202 
203 
204 } // anonymous namespace
205 
206 
207 namespace Atk
208 {
209 
210 
get_name() const211 Glib::ustring Attribute::get_name() const
212 {
213   return Glib::convert_const_gchar_ptr_to_ustring(gobj()->name);
214 }
215 
get_value() const216 Glib::ustring Attribute::get_value() const
217 {
218   return Glib::convert_const_gchar_ptr_to_ustring(gobj()->value);
219 }
220 
221 
222 } // namespace Atk
223 
224 // static
value_type()225 GType Glib::Value<Atk::BuiltinTextAttribute>::value_type()
226 {
227   return atk_text_attribute_get_type();
228 }
229 
230 // static
value_type()231 GType Glib::Value<Atk::TextBoundary>::value_type()
232 {
233   return atk_text_boundary_get_type();
234 }
235 
236 // static
value_type()237 GType Glib::Value<Atk::TextClipType>::value_type()
238 {
239   return atk_text_clip_type_get_type();
240 }
241 
242 // static
value_type()243 GType Glib::Value<Atk::TextGranularity>::value_type()
244 {
245   return atk_text_granularity_get_type();
246 }
247 
248 
249 namespace Glib
250 {
251 
wrap(AtkText * object,bool take_copy)252 Glib::RefPtr<Atk::Text> wrap(AtkText* object, bool take_copy)
253 {
254   return Glib::RefPtr<Atk::Text>( dynamic_cast<Atk::Text*> (Glib::wrap_auto_interface<Atk::Text> ((GObject*)(object), take_copy)) );
255   //We use dynamic_cast<> in case of multiple inheritance.
256 }
257 
258 } // namespace Glib
259 
260 
261 namespace Atk
262 {
263 
264 
265 /* The *_Class implementation: */
266 
init()267 const Glib::Interface_Class& Text_Class::init()
268 {
269   if(!gtype_) // create the GType if necessary
270   {
271     // Glib::Interface_Class has to know the interface init function
272     // in order to add interfaces to implementing types.
273     class_init_func_ = &Text_Class::iface_init_function;
274 
275     // We can not derive from another interface, and it is not necessary anyway.
276     gtype_ = atk_text_get_type();
277   }
278 
279   return *this;
280 }
281 
iface_init_function(void * g_iface,void *)282 void Text_Class::iface_init_function(void* g_iface, void*)
283 {
284   const auto klass = static_cast<BaseClassType*>(g_iface);
285 
286   //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
287   //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
288   g_assert(klass != nullptr);
289 
290   klass->get_text = &get_text_vfunc_callback;
291   klass->get_character_at_offset = &get_character_at_offset_vfunc_callback;
292   klass->get_text_after_offset = &get_text_after_offset_vfunc_callback;
293   klass->get_text_at_offset = &get_text_at_offset_vfunc_callback;
294   klass->get_text_before_offset = &get_text_before_offset_vfunc_callback;
295   klass->get_caret_offset = &get_caret_offset_vfunc_callback;
296   klass->get_character_extents = &get_character_extents_vfunc_callback;
297   klass->get_run_attributes = &get_run_attributes_vfunc_callback;
298   klass->get_default_attributes = &get_default_attributes_vfunc_callback;
299   klass->get_character_count = &get_character_count_vfunc_callback;
300   klass->get_offset_at_point = &get_offset_at_point_vfunc_callback;
301   klass->get_n_selections = &get_n_selections_vfunc_callback;
302   klass->get_selection = &get_selection_vfunc_callback;
303   klass->add_selection = &add_selection_vfunc_callback;
304   klass->remove_selection = &remove_selection_vfunc_callback;
305   klass->set_selection = &set_selection_vfunc_callback;
306   klass->set_caret_offset = &set_caret_offset_vfunc_callback;
307 
308   klass->text_changed = &text_changed_callback;
309   klass->text_caret_moved = &text_caret_moved_callback;
310   klass->text_selection_changed = &text_selection_changed_callback;
311   klass->text_attributes_changed = &text_attributes_changed_callback;
312 }
313 
get_text_vfunc_callback(AtkText * self,gint start_offset,gint end_offset)314 gchar* Text_Class::get_text_vfunc_callback(AtkText* self, gint start_offset, gint end_offset)
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         return g_strdup((obj->get_text_vfunc(start_offset
333 , end_offset
334 )).c_str());
335       }
336       catch(...)
337       {
338         Glib::exception_handlers_invoke();
339       }
340     }
341   }
342 
343   BaseClassType *const base = static_cast<BaseClassType*>(
344       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
345 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
346 )  );
347 
348   // Call the original underlying C function:
349   if(base && base->get_text)
350     return (*base->get_text)(self, start_offset, end_offset);
351 
352   using RType = gchar*;
353   return RType();
354 }
get_character_at_offset_vfunc_callback(AtkText * self,gint offset)355 gunichar Text_Class::get_character_at_offset_vfunc_callback(AtkText* self, gint offset)
356 {
357   const auto obj_base = static_cast<Glib::ObjectBase*>(
358       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
359 
360   // Non-gtkmmproc-generated custom classes implicitly call the default
361   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
362   // generated classes can use this optimisation, which avoids the unnecessary
363   // parameter conversions if there is no possibility of the virtual function
364   // being overridden:
365   if(obj_base && obj_base->is_derived_())
366   {
367     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
368     if(obj) // This can be NULL during destruction.
369     {
370       try // Trap C++ exceptions which would normally be lost because this is a C callback.
371       {
372         // Call the virtual member method, which derived classes might override.
373         return obj->get_character_at_offset_vfunc(offset
374 );
375       }
376       catch(...)
377       {
378         Glib::exception_handlers_invoke();
379       }
380     }
381   }
382 
383   BaseClassType *const base = static_cast<BaseClassType*>(
384       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
385 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
386 )  );
387 
388   // Call the original underlying C function:
389   if(base && base->get_character_at_offset)
390     return (*base->get_character_at_offset)(self, offset);
391 
392   using RType = gunichar;
393   return RType();
394 }
get_text_after_offset_vfunc_callback(AtkText * self,gint offset,AtkTextBoundary boundary_type,gint * start_offset,gint * end_offset)395 gchar* Text_Class::get_text_after_offset_vfunc_callback(AtkText* self, gint offset, AtkTextBoundary boundary_type, gint* start_offset, gint* end_offset)
396 {
397   const auto obj_base = static_cast<Glib::ObjectBase*>(
398       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
399 
400   // Non-gtkmmproc-generated custom classes implicitly call the default
401   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
402   // generated classes can use this optimisation, which avoids the unnecessary
403   // parameter conversions if there is no possibility of the virtual function
404   // being overridden:
405   if(obj_base && obj_base->is_derived_())
406   {
407     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
408     if(obj) // This can be NULL during destruction.
409     {
410       try // Trap C++ exceptions which would normally be lost because this is a C callback.
411       {
412         // Call the virtual member method, which derived classes might override.
413         return g_strdup((obj->get_text_after_offset_vfunc(offset
414 , ((TextBoundary)(boundary_type))
415 , *(start_offset)
416 , *(end_offset)
417 )).c_str());
418       }
419       catch(...)
420       {
421         Glib::exception_handlers_invoke();
422       }
423     }
424   }
425 
426   BaseClassType *const base = static_cast<BaseClassType*>(
427       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
428 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
429 )  );
430 
431   // Call the original underlying C function:
432   if(base && base->get_text_after_offset)
433     return (*base->get_text_after_offset)(self, offset, boundary_type, start_offset, end_offset);
434 
435   using RType = gchar*;
436   return RType();
437 }
get_text_at_offset_vfunc_callback(AtkText * self,gint offset,AtkTextBoundary boundary_type,gint * start_offset,gint * end_offset)438 gchar* Text_Class::get_text_at_offset_vfunc_callback(AtkText* self, gint offset, AtkTextBoundary boundary_type, gint* start_offset, gint* end_offset)
439 {
440   const auto obj_base = static_cast<Glib::ObjectBase*>(
441       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
442 
443   // Non-gtkmmproc-generated custom classes implicitly call the default
444   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
445   // generated classes can use this optimisation, which avoids the unnecessary
446   // parameter conversions if there is no possibility of the virtual function
447   // being overridden:
448   if(obj_base && obj_base->is_derived_())
449   {
450     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
451     if(obj) // This can be NULL during destruction.
452     {
453       try // Trap C++ exceptions which would normally be lost because this is a C callback.
454       {
455         // Call the virtual member method, which derived classes might override.
456         return g_strdup((obj->get_text_at_offset_vfunc(offset
457 , ((TextBoundary)(boundary_type))
458 , *(start_offset)
459 , *(end_offset)
460 )).c_str());
461       }
462       catch(...)
463       {
464         Glib::exception_handlers_invoke();
465       }
466     }
467   }
468 
469   BaseClassType *const base = static_cast<BaseClassType*>(
470       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
471 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
472 )  );
473 
474   // Call the original underlying C function:
475   if(base && base->get_text_at_offset)
476     return (*base->get_text_at_offset)(self, offset, boundary_type, start_offset, end_offset);
477 
478   using RType = gchar*;
479   return RType();
480 }
get_text_before_offset_vfunc_callback(AtkText * self,gint offset,AtkTextBoundary boundary_type,gint * start_offset,gint * end_offset)481 gchar* Text_Class::get_text_before_offset_vfunc_callback(AtkText* self, gint offset, AtkTextBoundary boundary_type, gint* start_offset, gint* end_offset)
482 {
483   const auto obj_base = static_cast<Glib::ObjectBase*>(
484       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
485 
486   // Non-gtkmmproc-generated custom classes implicitly call the default
487   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
488   // generated classes can use this optimisation, which avoids the unnecessary
489   // parameter conversions if there is no possibility of the virtual function
490   // being overridden:
491   if(obj_base && obj_base->is_derived_())
492   {
493     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
494     if(obj) // This can be NULL during destruction.
495     {
496       try // Trap C++ exceptions which would normally be lost because this is a C callback.
497       {
498         // Call the virtual member method, which derived classes might override.
499         return g_strdup((obj->get_text_before_offset_vfunc(offset
500 , ((TextBoundary)(boundary_type))
501 , *(start_offset)
502 , *(end_offset)
503 )).c_str());
504       }
505       catch(...)
506       {
507         Glib::exception_handlers_invoke();
508       }
509     }
510   }
511 
512   BaseClassType *const base = static_cast<BaseClassType*>(
513       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
514 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
515 )  );
516 
517   // Call the original underlying C function:
518   if(base && base->get_text_before_offset)
519     return (*base->get_text_before_offset)(self, offset, boundary_type, start_offset, end_offset);
520 
521   using RType = gchar*;
522   return RType();
523 }
get_caret_offset_vfunc_callback(AtkText * self)524 gint Text_Class::get_caret_offset_vfunc_callback(AtkText* self)
525 {
526   const auto obj_base = static_cast<Glib::ObjectBase*>(
527       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
528 
529   // Non-gtkmmproc-generated custom classes implicitly call the default
530   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
531   // generated classes can use this optimisation, which avoids the unnecessary
532   // parameter conversions if there is no possibility of the virtual function
533   // being overridden:
534   if(obj_base && obj_base->is_derived_())
535   {
536     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
537     if(obj) // This can be NULL during destruction.
538     {
539       try // Trap C++ exceptions which would normally be lost because this is a C callback.
540       {
541         // Call the virtual member method, which derived classes might override.
542         return obj->get_caret_offset_vfunc();
543       }
544       catch(...)
545       {
546         Glib::exception_handlers_invoke();
547       }
548     }
549   }
550 
551   BaseClassType *const base = static_cast<BaseClassType*>(
552       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
553 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
554 )  );
555 
556   // Call the original underlying C function:
557   if(base && base->get_caret_offset)
558     return (*base->get_caret_offset)(self);
559 
560   using RType = gint;
561   return RType();
562 }
get_character_extents_vfunc_callback(AtkText * self,gint offset,gint * x,gint * y,gint * width,gint * height,AtkCoordType coords)563 void Text_Class::get_character_extents_vfunc_callback(AtkText* self, gint offset, gint* x, gint* y, gint* width, gint* height, AtkCoordType coords)
564 {
565   const auto obj_base = static_cast<Glib::ObjectBase*>(
566       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
567 
568   // Non-gtkmmproc-generated custom classes implicitly call the default
569   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
570   // generated classes can use this optimisation, which avoids the unnecessary
571   // parameter conversions if there is no possibility of the virtual function
572   // being overridden:
573   if(obj_base && obj_base->is_derived_())
574   {
575     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
576     if(obj) // This can be NULL during destruction.
577     {
578       try // Trap C++ exceptions which would normally be lost because this is a C callback.
579       {
580         // Call the virtual member method, which derived classes might override.
581         obj->get_character_extents_vfunc(offset
582 , *(x)
583 , *(y)
584 , *(width)
585 , *(height)
586 , ((CoordType)(coords))
587 );
588         return;
589       }
590       catch(...)
591       {
592         Glib::exception_handlers_invoke();
593       }
594     }
595   }
596 
597   BaseClassType *const base = static_cast<BaseClassType*>(
598       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
599 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
600 )  );
601 
602   // Call the original underlying C function:
603   if(base && base->get_character_extents)
604     (*base->get_character_extents)(self, offset, x, y, width, height, coords);
605 }
get_run_attributes_vfunc_callback(AtkText * self,gint offset,gint * start_offset,gint * end_offset)606 AtkAttributeSet* Text_Class::get_run_attributes_vfunc_callback(AtkText* self, gint offset, gint* start_offset, gint* end_offset)
607 {
608   const auto obj_base = static_cast<Glib::ObjectBase*>(
609       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
610 
611   // Non-gtkmmproc-generated custom classes implicitly call the default
612   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
613   // generated classes can use this optimisation, which avoids the unnecessary
614   // parameter conversions if there is no possibility of the virtual function
615   // being overridden:
616   if(obj_base && obj_base->is_derived_())
617   {
618     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
619     if(obj) // This can be NULL during destruction.
620     {
621       try // Trap C++ exceptions which would normally be lost because this is a C callback.
622       {
623         // Call the virtual member method, which derived classes might override.
624         return obj->get_run_attributes_vfunc(offset
625 , *(start_offset)
626 , *(end_offset)
627 );
628       }
629       catch(...)
630       {
631         Glib::exception_handlers_invoke();
632       }
633     }
634   }
635 
636   BaseClassType *const base = static_cast<BaseClassType*>(
637       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
638 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
639 )  );
640 
641   // Call the original underlying C function:
642   if(base && base->get_run_attributes)
643     return (*base->get_run_attributes)(self, offset, start_offset, end_offset);
644 
645   using RType = AtkAttributeSet*;
646   return RType();
647 }
get_default_attributes_vfunc_callback(AtkText * self)648 AtkAttributeSet* Text_Class::get_default_attributes_vfunc_callback(AtkText* self)
649 {
650   const auto obj_base = static_cast<Glib::ObjectBase*>(
651       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
652 
653   // Non-gtkmmproc-generated custom classes implicitly call the default
654   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
655   // generated classes can use this optimisation, which avoids the unnecessary
656   // parameter conversions if there is no possibility of the virtual function
657   // being overridden:
658   if(obj_base && obj_base->is_derived_())
659   {
660     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
661     if(obj) // This can be NULL during destruction.
662     {
663       try // Trap C++ exceptions which would normally be lost because this is a C callback.
664       {
665         // Call the virtual member method, which derived classes might override.
666         return obj->get_default_attributes_vfunc();
667       }
668       catch(...)
669       {
670         Glib::exception_handlers_invoke();
671       }
672     }
673   }
674 
675   BaseClassType *const base = static_cast<BaseClassType*>(
676       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
677 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
678 )  );
679 
680   // Call the original underlying C function:
681   if(base && base->get_default_attributes)
682     return (*base->get_default_attributes)(self);
683 
684   using RType = AtkAttributeSet*;
685   return RType();
686 }
get_character_count_vfunc_callback(AtkText * self)687 gint Text_Class::get_character_count_vfunc_callback(AtkText* self)
688 {
689   const auto obj_base = static_cast<Glib::ObjectBase*>(
690       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
691 
692   // Non-gtkmmproc-generated custom classes implicitly call the default
693   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
694   // generated classes can use this optimisation, which avoids the unnecessary
695   // parameter conversions if there is no possibility of the virtual function
696   // being overridden:
697   if(obj_base && obj_base->is_derived_())
698   {
699     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
700     if(obj) // This can be NULL during destruction.
701     {
702       try // Trap C++ exceptions which would normally be lost because this is a C callback.
703       {
704         // Call the virtual member method, which derived classes might override.
705         return obj->get_character_count_vfunc();
706       }
707       catch(...)
708       {
709         Glib::exception_handlers_invoke();
710       }
711     }
712   }
713 
714   BaseClassType *const base = static_cast<BaseClassType*>(
715       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
716 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
717 )  );
718 
719   // Call the original underlying C function:
720   if(base && base->get_character_count)
721     return (*base->get_character_count)(self);
722 
723   using RType = gint;
724   return RType();
725 }
get_offset_at_point_vfunc_callback(AtkText * self,gint x,gint y,AtkCoordType coords)726 gint Text_Class::get_offset_at_point_vfunc_callback(AtkText* self, gint x, gint y, AtkCoordType coords)
727 {
728   const auto obj_base = static_cast<Glib::ObjectBase*>(
729       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
730 
731   // Non-gtkmmproc-generated custom classes implicitly call the default
732   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
733   // generated classes can use this optimisation, which avoids the unnecessary
734   // parameter conversions if there is no possibility of the virtual function
735   // being overridden:
736   if(obj_base && obj_base->is_derived_())
737   {
738     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
739     if(obj) // This can be NULL during destruction.
740     {
741       try // Trap C++ exceptions which would normally be lost because this is a C callback.
742       {
743         // Call the virtual member method, which derived classes might override.
744         return obj->get_offset_at_point_vfunc(x
745 , y
746 , ((CoordType)(coords))
747 );
748       }
749       catch(...)
750       {
751         Glib::exception_handlers_invoke();
752       }
753     }
754   }
755 
756   BaseClassType *const base = static_cast<BaseClassType*>(
757       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
758 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
759 )  );
760 
761   // Call the original underlying C function:
762   if(base && base->get_offset_at_point)
763     return (*base->get_offset_at_point)(self, x, y, coords);
764 
765   using RType = gint;
766   return RType();
767 }
get_n_selections_vfunc_callback(AtkText * self)768 gint Text_Class::get_n_selections_vfunc_callback(AtkText* self)
769 {
770   const auto obj_base = static_cast<Glib::ObjectBase*>(
771       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
772 
773   // Non-gtkmmproc-generated custom classes implicitly call the default
774   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
775   // generated classes can use this optimisation, which avoids the unnecessary
776   // parameter conversions if there is no possibility of the virtual function
777   // being overridden:
778   if(obj_base && obj_base->is_derived_())
779   {
780     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
781     if(obj) // This can be NULL during destruction.
782     {
783       try // Trap C++ exceptions which would normally be lost because this is a C callback.
784       {
785         // Call the virtual member method, which derived classes might override.
786         return obj->get_n_selections_vfunc();
787       }
788       catch(...)
789       {
790         Glib::exception_handlers_invoke();
791       }
792     }
793   }
794 
795   BaseClassType *const base = static_cast<BaseClassType*>(
796       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
797 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
798 )  );
799 
800   // Call the original underlying C function:
801   if(base && base->get_n_selections)
802     return (*base->get_n_selections)(self);
803 
804   using RType = gint;
805   return RType();
806 }
get_selection_vfunc_callback(AtkText * self,gint selection_num,gint * start_offset,gint * end_offset)807 gchar* Text_Class::get_selection_vfunc_callback(AtkText* self, gint selection_num, gint* start_offset, gint* end_offset)
808 {
809   const auto obj_base = static_cast<Glib::ObjectBase*>(
810       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
811 
812   // Non-gtkmmproc-generated custom classes implicitly call the default
813   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
814   // generated classes can use this optimisation, which avoids the unnecessary
815   // parameter conversions if there is no possibility of the virtual function
816   // being overridden:
817   if(obj_base && obj_base->is_derived_())
818   {
819     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
820     if(obj) // This can be NULL during destruction.
821     {
822       try // Trap C++ exceptions which would normally be lost because this is a C callback.
823       {
824         // Call the virtual member method, which derived classes might override.
825         return g_strdup((obj->get_selection_vfunc(selection_num
826 , *(start_offset)
827 , *(end_offset)
828 )).c_str());
829       }
830       catch(...)
831       {
832         Glib::exception_handlers_invoke();
833       }
834     }
835   }
836 
837   BaseClassType *const base = static_cast<BaseClassType*>(
838       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
839 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
840 )  );
841 
842   // Call the original underlying C function:
843   if(base && base->get_selection)
844     return (*base->get_selection)(self, selection_num, start_offset, end_offset);
845 
846   using RType = gchar*;
847   return RType();
848 }
add_selection_vfunc_callback(AtkText * self,gint start_offset,gint end_offset)849 gboolean Text_Class::add_selection_vfunc_callback(AtkText* self, gint start_offset, gint end_offset)
850 {
851   const auto obj_base = static_cast<Glib::ObjectBase*>(
852       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
853 
854   // Non-gtkmmproc-generated custom classes implicitly call the default
855   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
856   // generated classes can use this optimisation, which avoids the unnecessary
857   // parameter conversions if there is no possibility of the virtual function
858   // being overridden:
859   if(obj_base && obj_base->is_derived_())
860   {
861     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
862     if(obj) // This can be NULL during destruction.
863     {
864       try // Trap C++ exceptions which would normally be lost because this is a C callback.
865       {
866         // Call the virtual member method, which derived classes might override.
867         return static_cast<int>(obj->add_selection_vfunc(start_offset
868 , end_offset
869 ));
870       }
871       catch(...)
872       {
873         Glib::exception_handlers_invoke();
874       }
875     }
876   }
877 
878   BaseClassType *const base = static_cast<BaseClassType*>(
879       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
880 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
881 )  );
882 
883   // Call the original underlying C function:
884   if(base && base->add_selection)
885     return (*base->add_selection)(self, start_offset, end_offset);
886 
887   using RType = gboolean;
888   return RType();
889 }
remove_selection_vfunc_callback(AtkText * self,gint selection_num)890 gboolean Text_Class::remove_selection_vfunc_callback(AtkText* self, gint selection_num)
891 {
892   const auto obj_base = static_cast<Glib::ObjectBase*>(
893       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
894 
895   // Non-gtkmmproc-generated custom classes implicitly call the default
896   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
897   // generated classes can use this optimisation, which avoids the unnecessary
898   // parameter conversions if there is no possibility of the virtual function
899   // being overridden:
900   if(obj_base && obj_base->is_derived_())
901   {
902     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
903     if(obj) // This can be NULL during destruction.
904     {
905       try // Trap C++ exceptions which would normally be lost because this is a C callback.
906       {
907         // Call the virtual member method, which derived classes might override.
908         return static_cast<int>(obj->remove_selection_vfunc(selection_num
909 ));
910       }
911       catch(...)
912       {
913         Glib::exception_handlers_invoke();
914       }
915     }
916   }
917 
918   BaseClassType *const base = static_cast<BaseClassType*>(
919       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
920 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
921 )  );
922 
923   // Call the original underlying C function:
924   if(base && base->remove_selection)
925     return (*base->remove_selection)(self, selection_num);
926 
927   using RType = gboolean;
928   return RType();
929 }
set_selection_vfunc_callback(AtkText * self,gint selection_num,gint start_offset,gint end_offset)930 gboolean Text_Class::set_selection_vfunc_callback(AtkText* self, gint selection_num, gint start_offset, gint end_offset)
931 {
932   const auto obj_base = static_cast<Glib::ObjectBase*>(
933       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
934 
935   // Non-gtkmmproc-generated custom classes implicitly call the default
936   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
937   // generated classes can use this optimisation, which avoids the unnecessary
938   // parameter conversions if there is no possibility of the virtual function
939   // being overridden:
940   if(obj_base && obj_base->is_derived_())
941   {
942     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
943     if(obj) // This can be NULL during destruction.
944     {
945       try // Trap C++ exceptions which would normally be lost because this is a C callback.
946       {
947         // Call the virtual member method, which derived classes might override.
948         return static_cast<int>(obj->set_selection_vfunc(selection_num
949 , start_offset
950 , end_offset
951 ));
952       }
953       catch(...)
954       {
955         Glib::exception_handlers_invoke();
956       }
957     }
958   }
959 
960   BaseClassType *const base = static_cast<BaseClassType*>(
961       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
962 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
963 )  );
964 
965   // Call the original underlying C function:
966   if(base && base->set_selection)
967     return (*base->set_selection)(self, selection_num, start_offset, end_offset);
968 
969   using RType = gboolean;
970   return RType();
971 }
set_caret_offset_vfunc_callback(AtkText * self,gint offset)972 gboolean Text_Class::set_caret_offset_vfunc_callback(AtkText* self, gint offset)
973 {
974   const auto obj_base = static_cast<Glib::ObjectBase*>(
975       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
976 
977   // Non-gtkmmproc-generated custom classes implicitly call the default
978   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
979   // generated classes can use this optimisation, which avoids the unnecessary
980   // parameter conversions if there is no possibility of the virtual function
981   // being overridden:
982   if(obj_base && obj_base->is_derived_())
983   {
984     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
985     if(obj) // This can be NULL during destruction.
986     {
987       try // Trap C++ exceptions which would normally be lost because this is a C callback.
988       {
989         // Call the virtual member method, which derived classes might override.
990         return static_cast<int>(obj->set_caret_offset_vfunc(offset
991 ));
992       }
993       catch(...)
994       {
995         Glib::exception_handlers_invoke();
996       }
997     }
998   }
999 
1000   BaseClassType *const base = static_cast<BaseClassType*>(
1001       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1002 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1003 )  );
1004 
1005   // Call the original underlying C function:
1006   if(base && base->set_caret_offset)
1007     return (*base->set_caret_offset)(self, offset);
1008 
1009   using RType = gboolean;
1010   return RType();
1011 }
1012 
text_changed_callback(AtkText * self,gint p0,gint p1)1013 void Text_Class::text_changed_callback(AtkText* self, gint p0, gint p1)
1014 {
1015   const auto obj_base = static_cast<Glib::ObjectBase*>(
1016       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1017 
1018   // Non-gtkmmproc-generated custom classes implicitly call the default
1019   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1020   // generated classes can use this optimisation, which avoids the unnecessary
1021   // parameter conversions if there is no possibility of the virtual function
1022   // being overridden:
1023   if(obj_base && obj_base->is_derived_())
1024   {
1025     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
1026     if(obj) // This can be NULL during destruction.
1027     {
1028       try // Trap C++ exceptions which would normally be lost because this is a C callback.
1029       {
1030         // Call the virtual member method, which derived classes might override.
1031         obj->on_text_changed(p0
1032 , p1
1033 );
1034         return;
1035       }
1036       catch(...)
1037       {
1038         Glib::exception_handlers_invoke();
1039       }
1040     }
1041   }
1042 
1043   const auto base = static_cast<BaseClassType*>(
1044         g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1045 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1046 )    );
1047 
1048   // Call the original underlying C function:
1049   if(base && base->text_changed)
1050     (*base->text_changed)(self, p0, p1);
1051 }
text_caret_moved_callback(AtkText * self,gint p0)1052 void Text_Class::text_caret_moved_callback(AtkText* self, gint p0)
1053 {
1054   const auto obj_base = static_cast<Glib::ObjectBase*>(
1055       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1056 
1057   // Non-gtkmmproc-generated custom classes implicitly call the default
1058   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1059   // generated classes can use this optimisation, which avoids the unnecessary
1060   // parameter conversions if there is no possibility of the virtual function
1061   // being overridden:
1062   if(obj_base && obj_base->is_derived_())
1063   {
1064     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
1065     if(obj) // This can be NULL during destruction.
1066     {
1067       try // Trap C++ exceptions which would normally be lost because this is a C callback.
1068       {
1069         // Call the virtual member method, which derived classes might override.
1070         obj->on_text_caret_moved(p0
1071 );
1072         return;
1073       }
1074       catch(...)
1075       {
1076         Glib::exception_handlers_invoke();
1077       }
1078     }
1079   }
1080 
1081   const auto base = static_cast<BaseClassType*>(
1082         g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1083 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1084 )    );
1085 
1086   // Call the original underlying C function:
1087   if(base && base->text_caret_moved)
1088     (*base->text_caret_moved)(self, p0);
1089 }
text_selection_changed_callback(AtkText * self)1090 void Text_Class::text_selection_changed_callback(AtkText* self)
1091 {
1092   const auto obj_base = static_cast<Glib::ObjectBase*>(
1093       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1094 
1095   // Non-gtkmmproc-generated custom classes implicitly call the default
1096   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1097   // generated classes can use this optimisation, which avoids the unnecessary
1098   // parameter conversions if there is no possibility of the virtual function
1099   // being overridden:
1100   if(obj_base && obj_base->is_derived_())
1101   {
1102     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
1103     if(obj) // This can be NULL during destruction.
1104     {
1105       try // Trap C++ exceptions which would normally be lost because this is a C callback.
1106       {
1107         // Call the virtual member method, which derived classes might override.
1108         obj->on_text_selection_changed();
1109         return;
1110       }
1111       catch(...)
1112       {
1113         Glib::exception_handlers_invoke();
1114       }
1115     }
1116   }
1117 
1118   const auto base = static_cast<BaseClassType*>(
1119         g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1120 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1121 )    );
1122 
1123   // Call the original underlying C function:
1124   if(base && base->text_selection_changed)
1125     (*base->text_selection_changed)(self);
1126 }
text_attributes_changed_callback(AtkText * self)1127 void Text_Class::text_attributes_changed_callback(AtkText* self)
1128 {
1129   const auto obj_base = static_cast<Glib::ObjectBase*>(
1130       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1131 
1132   // Non-gtkmmproc-generated custom classes implicitly call the default
1133   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1134   // generated classes can use this optimisation, which avoids the unnecessary
1135   // parameter conversions if there is no possibility of the virtual function
1136   // being overridden:
1137   if(obj_base && obj_base->is_derived_())
1138   {
1139     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
1140     if(obj) // This can be NULL during destruction.
1141     {
1142       try // Trap C++ exceptions which would normally be lost because this is a C callback.
1143       {
1144         // Call the virtual member method, which derived classes might override.
1145         obj->on_text_attributes_changed();
1146         return;
1147       }
1148       catch(...)
1149       {
1150         Glib::exception_handlers_invoke();
1151       }
1152     }
1153   }
1154 
1155   const auto base = static_cast<BaseClassType*>(
1156         g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1157 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1158 )    );
1159 
1160   // Call the original underlying C function:
1161   if(base && base->text_attributes_changed)
1162     (*base->text_attributes_changed)(self);
1163 }
1164 
1165 
wrap_new(GObject * object)1166 Glib::ObjectBase* Text_Class::wrap_new(GObject* object)
1167 {
1168   return new Text((AtkText*)(object));
1169 }
1170 
1171 
1172 /* The implementation: */
1173 
Text()1174 Text::Text()
1175 :
1176   Glib::Interface(text_class_.init())
1177 {}
1178 
Text(AtkText * castitem)1179 Text::Text(AtkText* castitem)
1180 :
1181   Glib::Interface((GObject*)(castitem))
1182 {}
1183 
Text(const Glib::Interface_Class & interface_class)1184 Text::Text(const Glib::Interface_Class& interface_class)
1185 : Glib::Interface(interface_class)
1186 {
1187 }
1188 
Text(Text && src)1189 Text::Text(Text&& src) noexcept
1190 : Glib::Interface(std::move(src))
1191 {}
1192 
operator =(Text && src)1193 Text& Text::operator=(Text&& src) noexcept
1194 {
1195   Glib::Interface::operator=(std::move(src));
1196   return *this;
1197 }
1198 
~Text()1199 Text::~Text() noexcept
1200 {}
1201 
1202 // static
add_interface(GType gtype_implementer)1203 void Text::add_interface(GType gtype_implementer)
1204 {
1205   text_class_.init().add_interface(gtype_implementer);
1206 }
1207 
1208 Text::CppClassType Text::text_class_; // initialize static member
1209 
get_type()1210 GType Text::get_type()
1211 {
1212   return text_class_.init().get_type();
1213 }
1214 
1215 
get_base_type()1216 GType Text::get_base_type()
1217 {
1218   return atk_text_get_type();
1219 }
1220 
get_text(int start_offset,int end_offset) const1221 Glib::ustring Text::get_text(int start_offset, int end_offset) const
1222 {
1223   return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_text(const_cast<AtkText*>(gobj()), start_offset, end_offset));
1224 }
1225 
get_character_at_offset(int offset) const1226 gunichar Text::get_character_at_offset(int offset) const
1227 {
1228   return atk_text_get_character_at_offset(const_cast<AtkText*>(gobj()), offset);
1229 }
1230 
1231 #ifndef ATKMM_DISABLE_DEPRECATED
1232 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
get_text_after_offset(int offset,TextBoundary boundary_type,int & start_offset,int & end_offset) const1233 Glib::ustring Text::get_text_after_offset(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const
1234 {
1235   return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_text_after_offset(const_cast<AtkText*>(gobj()), offset, ((AtkTextBoundary)(boundary_type)), &(start_offset), &(end_offset)));
1236 }
1237 G_GNUC_END_IGNORE_DEPRECATIONS
1238 #endif // ATKMM_DISABLE_DEPRECATED
1239 
1240 #ifndef ATKMM_DISABLE_DEPRECATED
1241 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
get_text_at_offset(int offset,TextBoundary boundary_type,int & start_offset,int & end_offset) const1242 Glib::ustring Text::get_text_at_offset(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const
1243 {
1244   return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_text_at_offset(const_cast<AtkText*>(gobj()), offset, ((AtkTextBoundary)(boundary_type)), &(start_offset), &(end_offset)));
1245 }
1246 G_GNUC_END_IGNORE_DEPRECATIONS
1247 #endif // ATKMM_DISABLE_DEPRECATED
1248 
1249 #ifndef ATKMM_DISABLE_DEPRECATED
1250 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
get_text_before_offset(int offset,TextBoundary boundary_type,int & start_offset,int & end_offset) const1251 Glib::ustring Text::get_text_before_offset(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const
1252 {
1253   return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_text_before_offset(const_cast<AtkText*>(gobj()), offset, ((AtkTextBoundary)(boundary_type)), &(start_offset), &(end_offset)));
1254 }
1255 G_GNUC_END_IGNORE_DEPRECATIONS
1256 #endif // ATKMM_DISABLE_DEPRECATED
1257 
get_string_at_offset(int offset,TextGranularity granularity,int & start_offset,int & end_offset)1258 Glib::ustring Text::get_string_at_offset(int offset, TextGranularity granularity, int& start_offset, int& end_offset)
1259 {
1260   return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_string_at_offset(gobj(), offset, ((AtkTextGranularity)(granularity)), &(start_offset), &(end_offset)));
1261 }
1262 
get_caret_offset() const1263 int Text::get_caret_offset() const
1264 {
1265   return atk_text_get_caret_offset(const_cast<AtkText*>(gobj()));
1266 }
1267 
get_character_extents(int offset,int & x,int & y,int & width,int & height,CoordType coords) const1268 void Text::get_character_extents(int offset, int& x, int& y, int& width, int& height, CoordType coords) const
1269 {
1270   atk_text_get_character_extents(const_cast<AtkText*>(gobj()), offset, &(x), &(y), &(width), &(height), ((AtkCoordType)(coords)));
1271 }
1272 
get_run_attributes(int offset,int & start_offset,int & end_offset) const1273 AttributeSet Text::get_run_attributes(int offset, int& start_offset, int& end_offset) const
1274 {
1275   return AttributeSet(atk_text_get_run_attributes(const_cast<AtkText*>(gobj()), offset, &(start_offset), &(end_offset)), Glib::OWNERSHIP_DEEP);
1276 }
1277 
get_default_attributes() const1278 AttributeSet Text::get_default_attributes() const
1279 {
1280   return AttributeSet(atk_text_get_default_attributes(const_cast<AtkText*>(gobj())), Glib::OWNERSHIP_DEEP);
1281 }
1282 
get_character_count() const1283 int Text::get_character_count() const
1284 {
1285   return atk_text_get_character_count(const_cast<AtkText*>(gobj()));
1286 }
1287 
get_offset_at_point(int x,int y,CoordType coords) const1288 int Text::get_offset_at_point(int x, int y, CoordType coords) const
1289 {
1290   return atk_text_get_offset_at_point(const_cast<AtkText*>(gobj()), x, y, ((AtkCoordType)(coords)));
1291 }
1292 
get_n_selections() const1293 int Text::get_n_selections() const
1294 {
1295   return atk_text_get_n_selections(const_cast<AtkText*>(gobj()));
1296 }
1297 
get_selection(int selection_num,int & start_offset,int & end_offset) const1298 Glib::ustring Text::get_selection(int selection_num, int& start_offset, int& end_offset) const
1299 {
1300   return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_selection(const_cast<AtkText*>(gobj()), selection_num, &(start_offset), &(end_offset)));
1301 }
1302 
add_selection(int start_offset,int end_offset)1303 bool Text::add_selection(int start_offset, int end_offset)
1304 {
1305   return atk_text_add_selection(gobj(), start_offset, end_offset);
1306 }
1307 
remove_selection(int selection_num)1308 bool Text::remove_selection(int selection_num)
1309 {
1310   return atk_text_remove_selection(gobj(), selection_num);
1311 }
1312 
set_selection(int selection_num,int start_offset,int end_offset)1313 bool Text::set_selection(int selection_num, int start_offset, int end_offset)
1314 {
1315   return atk_text_set_selection(gobj(), selection_num, start_offset, end_offset);
1316 }
1317 
set_caret_offset(int offset)1318 bool Text::set_caret_offset(int offset)
1319 {
1320   return atk_text_set_caret_offset(gobj(), offset);
1321 }
1322 
get_range_extents(int start_offset,int end_offset,CoordType coord_type,Rectangle & rect)1323 void Text::get_range_extents(int start_offset, int end_offset, CoordType coord_type, Rectangle& rect)
1324 {
1325   atk_text_get_range_extents(gobj(), start_offset, end_offset, ((AtkCoordType)(coord_type)), &(rect));
1326 }
1327 
get_bounded_ranges(const Rectangle & rect,CoordType coord_type,TextClipType x_clip_type,TextClipType y_clip_type)1328 AtkTextRange** Text::get_bounded_ranges(const Rectangle& rect, CoordType coord_type, TextClipType x_clip_type, TextClipType y_clip_type)
1329 {
1330   return atk_text_get_bounded_ranges(gobj(), const_cast<AtkTextRectangle*>(&(rect)), ((AtkCoordType)(coord_type)), ((AtkTextClipType)(x_clip_type)), ((AtkTextClipType)(y_clip_type)));
1331 }
1332 
1333 
signal_text_changed()1334 Glib::SignalProxy< void,int,int > Text::signal_text_changed()
1335 {
1336   return Glib::SignalProxy< void,int,int >(this, &Text_signal_text_changed_info);
1337 }
1338 
1339 
signal_text_caret_moved()1340 Glib::SignalProxy< void,int > Text::signal_text_caret_moved()
1341 {
1342   return Glib::SignalProxy< void,int >(this, &Text_signal_text_caret_moved_info);
1343 }
1344 
1345 
signal_text_selection_changed()1346 Glib::SignalProxy< void > Text::signal_text_selection_changed()
1347 {
1348   return Glib::SignalProxy< void >(this, &Text_signal_text_selection_changed_info);
1349 }
1350 
1351 
signal_text_attributes_changed()1352 Glib::SignalProxy< void > Text::signal_text_attributes_changed()
1353 {
1354   return Glib::SignalProxy< void >(this, &Text_signal_text_attributes_changed_info);
1355 }
1356 
1357 
on_text_changed(int position,int length)1358 void Atk::Text::on_text_changed(int position, int length)
1359 {
1360   const auto base = static_cast<BaseClassType*>(
1361       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1362 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1363 )  );
1364 
1365   if(base && base->text_changed)
1366     (*base->text_changed)(gobj(),position,length);
1367 }
on_text_caret_moved(int location)1368 void Atk::Text::on_text_caret_moved(int location)
1369 {
1370   const auto base = static_cast<BaseClassType*>(
1371       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1372 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1373 )  );
1374 
1375   if(base && base->text_caret_moved)
1376     (*base->text_caret_moved)(gobj(),location);
1377 }
on_text_selection_changed()1378 void Atk::Text::on_text_selection_changed()
1379 {
1380   const auto base = static_cast<BaseClassType*>(
1381       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1382 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1383 )  );
1384 
1385   if(base && base->text_selection_changed)
1386     (*base->text_selection_changed)(gobj());
1387 }
on_text_attributes_changed()1388 void Atk::Text::on_text_attributes_changed()
1389 {
1390   const auto base = static_cast<BaseClassType*>(
1391       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1392 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1393 )  );
1394 
1395   if(base && base->text_attributes_changed)
1396     (*base->text_attributes_changed)(gobj());
1397 }
1398 
get_text_vfunc(int start_offset,int end_offset) const1399 Glib::ustring Atk::Text::get_text_vfunc(int start_offset, int end_offset) const
1400 {
1401   const auto base = static_cast<BaseClassType*>(
1402       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1403 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1404 )  );
1405 
1406   if(base && base->get_text)
1407   {
1408     Glib::ustring retval(Glib::convert_return_gchar_ptr_to_ustring((*base->get_text)(const_cast<AtkText*>(gobj()),start_offset,end_offset)));
1409     return retval;
1410   }
1411 
1412   using RType = Glib::ustring;
1413   return RType();
1414 }
get_character_at_offset_vfunc(int offset) const1415 gunichar Atk::Text::get_character_at_offset_vfunc(int offset) const
1416 {
1417   const auto base = static_cast<BaseClassType*>(
1418       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1419 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1420 )  );
1421 
1422   if(base && base->get_character_at_offset)
1423   {
1424     gunichar retval((*base->get_character_at_offset)(const_cast<AtkText*>(gobj()),offset));
1425     return retval;
1426   }
1427 
1428   using RType = gunichar;
1429   return RType();
1430 }
get_text_after_offset_vfunc(int offset,TextBoundary boundary_type,int & start_offset,int & end_offset) const1431 Glib::ustring Atk::Text::get_text_after_offset_vfunc(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const
1432 {
1433   const auto base = static_cast<BaseClassType*>(
1434       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1435 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1436 )  );
1437 
1438   if(base && base->get_text_after_offset)
1439   {
1440     Glib::ustring retval(Glib::convert_return_gchar_ptr_to_ustring((*base->get_text_after_offset)(const_cast<AtkText*>(gobj()),offset,((AtkTextBoundary)(boundary_type)),&(start_offset),&(end_offset))));
1441     return retval;
1442   }
1443 
1444   using RType = Glib::ustring;
1445   return RType();
1446 }
get_text_at_offset_vfunc(int offset,TextBoundary boundary_type,int & start_offset,int & end_offset) const1447 Glib::ustring Atk::Text::get_text_at_offset_vfunc(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const
1448 {
1449   const auto base = static_cast<BaseClassType*>(
1450       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1451 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1452 )  );
1453 
1454   if(base && base->get_text_at_offset)
1455   {
1456     Glib::ustring retval(Glib::convert_return_gchar_ptr_to_ustring((*base->get_text_at_offset)(const_cast<AtkText*>(gobj()),offset,((AtkTextBoundary)(boundary_type)),&(start_offset),&(end_offset))));
1457     return retval;
1458   }
1459 
1460   using RType = Glib::ustring;
1461   return RType();
1462 }
get_text_before_offset_vfunc(int offset,TextBoundary boundary_type,int & start_offset,int & end_offset) const1463 Glib::ustring Atk::Text::get_text_before_offset_vfunc(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const
1464 {
1465   const auto base = static_cast<BaseClassType*>(
1466       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1467 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1468 )  );
1469 
1470   if(base && base->get_text_before_offset)
1471   {
1472     Glib::ustring retval(Glib::convert_return_gchar_ptr_to_ustring((*base->get_text_before_offset)(const_cast<AtkText*>(gobj()),offset,((AtkTextBoundary)(boundary_type)),&(start_offset),&(end_offset))));
1473     return retval;
1474   }
1475 
1476   using RType = Glib::ustring;
1477   return RType();
1478 }
get_caret_offset_vfunc() const1479 int Atk::Text::get_caret_offset_vfunc() const
1480 {
1481   const auto base = static_cast<BaseClassType*>(
1482       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1483 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1484 )  );
1485 
1486   if(base && base->get_caret_offset)
1487   {
1488     int retval((*base->get_caret_offset)(const_cast<AtkText*>(gobj())));
1489     return retval;
1490   }
1491 
1492   using RType = int;
1493   return RType();
1494 }
get_character_extents_vfunc(int offset,int & x,int & y,int & width,int & height,CoordType coords) const1495 void Atk::Text::get_character_extents_vfunc(int offset, int& x, int& y, int& width, int& height, CoordType coords) const
1496 {
1497   const auto base = static_cast<BaseClassType*>(
1498       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1499 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1500 )  );
1501 
1502   if(base && base->get_character_extents)
1503   {
1504     (*base->get_character_extents)(const_cast<AtkText*>(gobj()),offset,&(x),&(y),&(width),&(height),((AtkCoordType)(coords)));
1505   }
1506 }
get_run_attributes_vfunc(int offset,int & start_offset,int & end_offset) const1507 AtkAttributeSet* Atk::Text::get_run_attributes_vfunc(int offset, int& start_offset, int& end_offset) const
1508 {
1509   const auto base = static_cast<BaseClassType*>(
1510       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1511 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1512 )  );
1513 
1514   if(base && base->get_run_attributes)
1515   {
1516     AtkAttributeSet* retval((*base->get_run_attributes)(const_cast<AtkText*>(gobj()),offset,&(start_offset),&(end_offset)));
1517     return retval;
1518   }
1519 
1520   using RType = AtkAttributeSet*;
1521   return RType();
1522 }
get_default_attributes_vfunc() const1523 AtkAttributeSet* Atk::Text::get_default_attributes_vfunc() const
1524 {
1525   const auto base = static_cast<BaseClassType*>(
1526       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1527 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1528 )  );
1529 
1530   if(base && base->get_default_attributes)
1531   {
1532     AtkAttributeSet* retval((*base->get_default_attributes)(const_cast<AtkText*>(gobj())));
1533     return retval;
1534   }
1535 
1536   using RType = AtkAttributeSet*;
1537   return RType();
1538 }
get_character_count_vfunc() const1539 int Atk::Text::get_character_count_vfunc() const
1540 {
1541   const auto base = static_cast<BaseClassType*>(
1542       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1543 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1544 )  );
1545 
1546   if(base && base->get_character_count)
1547   {
1548     int retval((*base->get_character_count)(const_cast<AtkText*>(gobj())));
1549     return retval;
1550   }
1551 
1552   using RType = int;
1553   return RType();
1554 }
get_offset_at_point_vfunc(int x,int y,CoordType coords) const1555 int Atk::Text::get_offset_at_point_vfunc(int x, int y, CoordType coords) const
1556 {
1557   const auto base = static_cast<BaseClassType*>(
1558       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1559 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1560 )  );
1561 
1562   if(base && base->get_offset_at_point)
1563   {
1564     int retval((*base->get_offset_at_point)(const_cast<AtkText*>(gobj()),x,y,((AtkCoordType)(coords))));
1565     return retval;
1566   }
1567 
1568   using RType = int;
1569   return RType();
1570 }
get_n_selections_vfunc() const1571 int Atk::Text::get_n_selections_vfunc() const
1572 {
1573   const auto base = static_cast<BaseClassType*>(
1574       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1575 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1576 )  );
1577 
1578   if(base && base->get_n_selections)
1579   {
1580     int retval((*base->get_n_selections)(const_cast<AtkText*>(gobj())));
1581     return retval;
1582   }
1583 
1584   using RType = int;
1585   return RType();
1586 }
get_selection_vfunc(int selection_num,int & start_offset,int & end_offset) const1587 Glib::ustring Atk::Text::get_selection_vfunc(int selection_num, int& start_offset, int& end_offset) const
1588 {
1589   const auto base = static_cast<BaseClassType*>(
1590       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1591 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1592 )  );
1593 
1594   if(base && base->get_selection)
1595   {
1596     Glib::ustring retval(Glib::convert_return_gchar_ptr_to_ustring((*base->get_selection)(const_cast<AtkText*>(gobj()),selection_num,&(start_offset),&(end_offset))));
1597     return retval;
1598   }
1599 
1600   using RType = Glib::ustring;
1601   return RType();
1602 }
add_selection_vfunc(int start_offset,int end_offset)1603 bool Atk::Text::add_selection_vfunc(int start_offset, int end_offset)
1604 {
1605   const auto base = static_cast<BaseClassType*>(
1606       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1607 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1608 )  );
1609 
1610   if(base && base->add_selection)
1611   {
1612     bool retval((*base->add_selection)(gobj(),start_offset,end_offset));
1613     return retval;
1614   }
1615 
1616   using RType = bool;
1617   return RType();
1618 }
remove_selection_vfunc(int selection_num)1619 bool Atk::Text::remove_selection_vfunc(int selection_num)
1620 {
1621   const auto base = static_cast<BaseClassType*>(
1622       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1623 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1624 )  );
1625 
1626   if(base && base->remove_selection)
1627   {
1628     bool retval((*base->remove_selection)(gobj(),selection_num));
1629     return retval;
1630   }
1631 
1632   using RType = bool;
1633   return RType();
1634 }
set_selection_vfunc(int selection_num,int start_offset,int end_offset)1635 bool Atk::Text::set_selection_vfunc(int selection_num, int start_offset, int end_offset)
1636 {
1637   const auto base = static_cast<BaseClassType*>(
1638       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1639 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1640 )  );
1641 
1642   if(base && base->set_selection)
1643   {
1644     bool retval((*base->set_selection)(gobj(),selection_num,start_offset,end_offset));
1645     return retval;
1646   }
1647 
1648   using RType = bool;
1649   return RType();
1650 }
set_caret_offset_vfunc(int offset)1651 bool Atk::Text::set_caret_offset_vfunc(int offset)
1652 {
1653   const auto base = static_cast<BaseClassType*>(
1654       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1655 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1656 )  );
1657 
1658   if(base && base->set_caret_offset)
1659   {
1660     bool retval((*base->set_caret_offset)(gobj(),offset));
1661     return retval;
1662   }
1663 
1664   using RType = bool;
1665   return RType();
1666 }
1667 
1668 
1669 } // namespace Atk
1670 
1671 
1672