1 // Generated by gmmproc 2.56.0 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <atkmm/editabletext.h>
7 #include <atkmm/private/editabletext_p.h>
8
9
10 // -*- c++ -*-
11 /* $Id: editabletext.ccg,v 1.1 2003/01/21 13:37:05 murrayc Exp $ */
12
13 /* Copyright 1998-2002 The gtkmm Development Team
14 *
15 * This library is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 2.1 of the License, or (at your option) any later version.
19 *
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29
30 #include <atkmm/object.h>
31 #include <atk/atkeditabletext.h>
32
33
34 namespace
35 {
36 } // anonymous namespace
37
38
39 namespace Glib
40 {
41
wrap(AtkEditableText * object,bool take_copy)42 Glib::RefPtr<Atk::EditableText> wrap(AtkEditableText* object, bool take_copy)
43 {
44 return Glib::RefPtr<Atk::EditableText>( dynamic_cast<Atk::EditableText*> (Glib::wrap_auto_interface<Atk::EditableText> ((GObject*)(object), take_copy)) );
45 //We use dynamic_cast<> in case of multiple inheritance.
46 }
47
48 } // namespace Glib
49
50
51 namespace Atk
52 {
53
54
55 /* The *_Class implementation: */
56
init()57 const Glib::Interface_Class& EditableText_Class::init()
58 {
59 if(!gtype_) // create the GType if necessary
60 {
61 // Glib::Interface_Class has to know the interface init function
62 // in order to add interfaces to implementing types.
63 class_init_func_ = &EditableText_Class::iface_init_function;
64
65 // We can not derive from another interface, and it is not necessary anyway.
66 gtype_ = atk_editable_text_get_type();
67 }
68
69 return *this;
70 }
71
iface_init_function(void * g_iface,void *)72 void EditableText_Class::iface_init_function(void* g_iface, void*)
73 {
74 const auto klass = static_cast<BaseClassType*>(g_iface);
75
76 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
77 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
78 g_assert(klass != nullptr);
79
80 klass->set_run_attributes = &set_run_attributes_vfunc_callback;
81 klass->set_text_contents = &set_text_contents_vfunc_callback;
82 klass->insert_text = &insert_text_vfunc_callback;
83 klass->copy_text = ©_text_vfunc_callback;
84 klass->cut_text = &cut_text_vfunc_callback;
85 klass->delete_text = &delete_text_vfunc_callback;
86 klass->paste_text = &paste_text_vfunc_callback;
87
88 }
89
set_run_attributes_vfunc_callback(AtkEditableText * self,AtkAttributeSet * attrib_set,gint start_offset,gint end_offset)90 gboolean EditableText_Class::set_run_attributes_vfunc_callback(AtkEditableText* self, AtkAttributeSet* attrib_set, gint start_offset, gint end_offset)
91 {
92 const auto obj_base = static_cast<Glib::ObjectBase*>(
93 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
94
95 // Non-gtkmmproc-generated custom classes implicitly call the default
96 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
97 // generated classes can use this optimisation, which avoids the unnecessary
98 // parameter conversions if there is no possibility of the virtual function
99 // being overridden:
100 if(obj_base && obj_base->is_derived_())
101 {
102 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
103 if(obj) // This can be NULL during destruction.
104 {
105 try // Trap C++ exceptions which would normally be lost because this is a C callback.
106 {
107 // Call the virtual member method, which derived classes might override.
108 return static_cast<int>(obj->set_run_attributes_vfunc(attrib_set, start_offset
109 , end_offset
110 ));
111 }
112 catch(...)
113 {
114 Glib::exception_handlers_invoke();
115 }
116 }
117 }
118
119 BaseClassType *const base = static_cast<BaseClassType*>(
120 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
121 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
122 ) );
123
124 // Call the original underlying C function:
125 if(base && base->set_run_attributes)
126 return (*base->set_run_attributes)(self, attrib_set, start_offset, end_offset);
127
128 using RType = gboolean;
129 return RType();
130 }
set_text_contents_vfunc_callback(AtkEditableText * self,const gchar * string)131 void EditableText_Class::set_text_contents_vfunc_callback(AtkEditableText* self, const gchar* string)
132 {
133 const auto obj_base = static_cast<Glib::ObjectBase*>(
134 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
135
136 // Non-gtkmmproc-generated custom classes implicitly call the default
137 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
138 // generated classes can use this optimisation, which avoids the unnecessary
139 // parameter conversions if there is no possibility of the virtual function
140 // being overridden:
141 if(obj_base && obj_base->is_derived_())
142 {
143 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
144 if(obj) // This can be NULL during destruction.
145 {
146 try // Trap C++ exceptions which would normally be lost because this is a C callback.
147 {
148 // Call the virtual member method, which derived classes might override.
149 obj->set_text_contents_vfunc(Glib::convert_const_gchar_ptr_to_ustring(string)
150 );
151 return;
152 }
153 catch(...)
154 {
155 Glib::exception_handlers_invoke();
156 }
157 }
158 }
159
160 BaseClassType *const base = static_cast<BaseClassType*>(
161 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
162 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
163 ) );
164
165 // Call the original underlying C function:
166 if(base && base->set_text_contents)
167 (*base->set_text_contents)(self, string);
168 }
insert_text_vfunc_callback(AtkEditableText * self,const gchar * string,gint length,gint * position)169 void EditableText_Class::insert_text_vfunc_callback(AtkEditableText* self, const gchar* string, gint length, gint* position)
170 {
171 const auto obj_base = static_cast<Glib::ObjectBase*>(
172 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
173
174 // Non-gtkmmproc-generated custom classes implicitly call the default
175 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
176 // generated classes can use this optimisation, which avoids the unnecessary
177 // parameter conversions if there is no possibility of the virtual function
178 // being overridden:
179 if(obj_base && obj_base->is_derived_())
180 {
181 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
182 if(obj) // This can be NULL during destruction.
183 {
184 try // Trap C++ exceptions which would normally be lost because this is a C callback.
185 {
186 // Call the virtual member method, which derived classes might override.
187 obj->insert_text_vfunc(Glib::convert_const_gchar_ptr_to_ustring(string)
188 , length
189 , *(position)
190 );
191 return;
192 }
193 catch(...)
194 {
195 Glib::exception_handlers_invoke();
196 }
197 }
198 }
199
200 BaseClassType *const base = static_cast<BaseClassType*>(
201 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
202 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
203 ) );
204
205 // Call the original underlying C function:
206 if(base && base->insert_text)
207 (*base->insert_text)(self, string, length, position);
208 }
copy_text_vfunc_callback(AtkEditableText * self,gint start_pos,gint end_pos)209 void EditableText_Class::copy_text_vfunc_callback(AtkEditableText* self, gint start_pos, gint end_pos)
210 {
211 const auto obj_base = static_cast<Glib::ObjectBase*>(
212 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
213
214 // Non-gtkmmproc-generated custom classes implicitly call the default
215 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
216 // generated classes can use this optimisation, which avoids the unnecessary
217 // parameter conversions if there is no possibility of the virtual function
218 // being overridden:
219 if(obj_base && obj_base->is_derived_())
220 {
221 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
222 if(obj) // This can be NULL during destruction.
223 {
224 try // Trap C++ exceptions which would normally be lost because this is a C callback.
225 {
226 // Call the virtual member method, which derived classes might override.
227 obj->copy_text_vfunc(start_pos
228 , end_pos
229 );
230 return;
231 }
232 catch(...)
233 {
234 Glib::exception_handlers_invoke();
235 }
236 }
237 }
238
239 BaseClassType *const base = static_cast<BaseClassType*>(
240 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
241 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
242 ) );
243
244 // Call the original underlying C function:
245 if(base && base->copy_text)
246 (*base->copy_text)(self, start_pos, end_pos);
247 }
cut_text_vfunc_callback(AtkEditableText * self,gint start_pos,gint end_pos)248 void EditableText_Class::cut_text_vfunc_callback(AtkEditableText* self, gint start_pos, gint end_pos)
249 {
250 const auto obj_base = static_cast<Glib::ObjectBase*>(
251 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
252
253 // Non-gtkmmproc-generated custom classes implicitly call the default
254 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
255 // generated classes can use this optimisation, which avoids the unnecessary
256 // parameter conversions if there is no possibility of the virtual function
257 // being overridden:
258 if(obj_base && obj_base->is_derived_())
259 {
260 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
261 if(obj) // This can be NULL during destruction.
262 {
263 try // Trap C++ exceptions which would normally be lost because this is a C callback.
264 {
265 // Call the virtual member method, which derived classes might override.
266 obj->cut_text_vfunc(start_pos
267 , end_pos
268 );
269 return;
270 }
271 catch(...)
272 {
273 Glib::exception_handlers_invoke();
274 }
275 }
276 }
277
278 BaseClassType *const base = static_cast<BaseClassType*>(
279 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
280 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
281 ) );
282
283 // Call the original underlying C function:
284 if(base && base->cut_text)
285 (*base->cut_text)(self, start_pos, end_pos);
286 }
delete_text_vfunc_callback(AtkEditableText * self,gint start_pos,gint end_pos)287 void EditableText_Class::delete_text_vfunc_callback(AtkEditableText* self, gint start_pos, gint end_pos)
288 {
289 const auto obj_base = static_cast<Glib::ObjectBase*>(
290 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
291
292 // Non-gtkmmproc-generated custom classes implicitly call the default
293 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
294 // generated classes can use this optimisation, which avoids the unnecessary
295 // parameter conversions if there is no possibility of the virtual function
296 // being overridden:
297 if(obj_base && obj_base->is_derived_())
298 {
299 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
300 if(obj) // This can be NULL during destruction.
301 {
302 try // Trap C++ exceptions which would normally be lost because this is a C callback.
303 {
304 // Call the virtual member method, which derived classes might override.
305 obj->delete_text_vfunc(start_pos
306 , end_pos
307 );
308 return;
309 }
310 catch(...)
311 {
312 Glib::exception_handlers_invoke();
313 }
314 }
315 }
316
317 BaseClassType *const base = static_cast<BaseClassType*>(
318 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
319 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
320 ) );
321
322 // Call the original underlying C function:
323 if(base && base->delete_text)
324 (*base->delete_text)(self, start_pos, end_pos);
325 }
paste_text_vfunc_callback(AtkEditableText * self,gint position)326 void EditableText_Class::paste_text_vfunc_callback(AtkEditableText* self, gint position)
327 {
328 const auto obj_base = static_cast<Glib::ObjectBase*>(
329 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
330
331 // Non-gtkmmproc-generated custom classes implicitly call the default
332 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
333 // generated classes can use this optimisation, which avoids the unnecessary
334 // parameter conversions if there is no possibility of the virtual function
335 // being overridden:
336 if(obj_base && obj_base->is_derived_())
337 {
338 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
339 if(obj) // This can be NULL during destruction.
340 {
341 try // Trap C++ exceptions which would normally be lost because this is a C callback.
342 {
343 // Call the virtual member method, which derived classes might override.
344 obj->paste_text_vfunc(position
345 );
346 return;
347 }
348 catch(...)
349 {
350 Glib::exception_handlers_invoke();
351 }
352 }
353 }
354
355 BaseClassType *const base = static_cast<BaseClassType*>(
356 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
357 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
358 ) );
359
360 // Call the original underlying C function:
361 if(base && base->paste_text)
362 (*base->paste_text)(self, position);
363 }
364
365
wrap_new(GObject * object)366 Glib::ObjectBase* EditableText_Class::wrap_new(GObject* object)
367 {
368 return new EditableText((AtkEditableText*)(object));
369 }
370
371
372 /* The implementation: */
373
EditableText()374 EditableText::EditableText()
375 :
376 Glib::Interface(editabletext_class_.init())
377 {}
378
EditableText(AtkEditableText * castitem)379 EditableText::EditableText(AtkEditableText* castitem)
380 :
381 Glib::Interface((GObject*)(castitem))
382 {}
383
EditableText(const Glib::Interface_Class & interface_class)384 EditableText::EditableText(const Glib::Interface_Class& interface_class)
385 : Glib::Interface(interface_class)
386 {
387 }
388
EditableText(EditableText && src)389 EditableText::EditableText(EditableText&& src) noexcept
390 : Glib::Interface(std::move(src))
391 {}
392
operator =(EditableText && src)393 EditableText& EditableText::operator=(EditableText&& src) noexcept
394 {
395 Glib::Interface::operator=(std::move(src));
396 return *this;
397 }
398
~EditableText()399 EditableText::~EditableText() noexcept
400 {}
401
402 // static
add_interface(GType gtype_implementer)403 void EditableText::add_interface(GType gtype_implementer)
404 {
405 editabletext_class_.init().add_interface(gtype_implementer);
406 }
407
408 EditableText::CppClassType EditableText::editabletext_class_; // initialize static member
409
get_type()410 GType EditableText::get_type()
411 {
412 return editabletext_class_.init().get_type();
413 }
414
415
get_base_type()416 GType EditableText::get_base_type()
417 {
418 return atk_editable_text_get_type();
419 }
420
421
set_run_attributes(const AttributeSet & attrib_set,int start_offset,int end_offset)422 bool EditableText::set_run_attributes(const AttributeSet& attrib_set, int start_offset, int end_offset)
423 {
424 return atk_editable_text_set_run_attributes(gobj(), (attrib_set).data(), start_offset, end_offset);
425 }
426
set_text_contents(const Glib::ustring & string)427 void EditableText::set_text_contents(const Glib::ustring& string)
428 {
429 atk_editable_text_set_text_contents(gobj(), string.c_str());
430 }
431
insert_text(const Glib::ustring & string,int length,int & position)432 void EditableText::insert_text(const Glib::ustring& string, int length, int& position)
433 {
434 atk_editable_text_insert_text(gobj(), string.c_str(), length, &(position));
435 }
436
copy_text(int start_pos,int end_pos)437 void EditableText::copy_text(int start_pos, int end_pos)
438 {
439 atk_editable_text_copy_text(gobj(), start_pos, end_pos);
440 }
441
cut_text(int start_pos,int end_pos)442 void EditableText::cut_text(int start_pos, int end_pos)
443 {
444 atk_editable_text_cut_text(gobj(), start_pos, end_pos);
445 }
446
delete_text(int start_pos,int end_pos)447 void EditableText::delete_text(int start_pos, int end_pos)
448 {
449 atk_editable_text_delete_text(gobj(), start_pos, end_pos);
450 }
451
paste_text(int position)452 void EditableText::paste_text(int position)
453 {
454 atk_editable_text_paste_text(gobj(), position);
455 }
456
457
set_run_attributes_vfunc(AtkAttributeSet * attrib_set,int start_offset,int end_offset)458 bool Atk::EditableText::set_run_attributes_vfunc(AtkAttributeSet* attrib_set, int start_offset, int end_offset)
459 {
460 const auto base = static_cast<BaseClassType*>(
461 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
462 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
463 ) );
464
465 if(base && base->set_run_attributes)
466 {
467 bool retval((*base->set_run_attributes)(gobj(),attrib_set,start_offset,end_offset));
468 return retval;
469 }
470
471 using RType = bool;
472 return RType();
473 }
set_text_contents_vfunc(const Glib::ustring & string)474 void Atk::EditableText::set_text_contents_vfunc(const Glib::ustring& string)
475 {
476 const auto base = static_cast<BaseClassType*>(
477 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
478 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
479 ) );
480
481 if(base && base->set_text_contents)
482 {
483 (*base->set_text_contents)(gobj(),string.c_str());
484 }
485 }
insert_text_vfunc(const Glib::ustring & string,int length,int & position)486 void Atk::EditableText::insert_text_vfunc(const Glib::ustring& string, int length, int& position)
487 {
488 const auto base = static_cast<BaseClassType*>(
489 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
490 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
491 ) );
492
493 if(base && base->insert_text)
494 {
495 (*base->insert_text)(gobj(),string.c_str(),length,&(position));
496 }
497 }
copy_text_vfunc(int start_pos,int end_pos)498 void Atk::EditableText::copy_text_vfunc(int start_pos, int end_pos)
499 {
500 const auto base = static_cast<BaseClassType*>(
501 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
502 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
503 ) );
504
505 if(base && base->copy_text)
506 {
507 (*base->copy_text)(gobj(),start_pos,end_pos);
508 }
509 }
cut_text_vfunc(int start_pos,int end_pos)510 void Atk::EditableText::cut_text_vfunc(int start_pos, int end_pos)
511 {
512 const auto 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(gobject_), CppObjectType::get_type()) // Get the interface.
515 ) );
516
517 if(base && base->cut_text)
518 {
519 (*base->cut_text)(gobj(),start_pos,end_pos);
520 }
521 }
delete_text_vfunc(int start_pos,int end_pos)522 void Atk::EditableText::delete_text_vfunc(int start_pos, int end_pos)
523 {
524 const auto base = static_cast<BaseClassType*>(
525 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
526 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
527 ) );
528
529 if(base && base->delete_text)
530 {
531 (*base->delete_text)(gobj(),start_pos,end_pos);
532 }
533 }
paste_text_vfunc(int position)534 void Atk::EditableText::paste_text_vfunc(int position)
535 {
536 const auto base = static_cast<BaseClassType*>(
537 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
538 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
539 ) );
540
541 if(base && base->paste_text)
542 {
543 (*base->paste_text)(gobj(),position);
544 }
545 }
546
547
548 } // namespace Atk
549
550
551