1 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gtkmm/editable.h>
7 #include <gtkmm/private/editable_p.h>
8
9
10 // -*- c++ -*-
11 /* $Id: editable.ccg,v 1.1 2003/01/21 13:38:48 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 <gtk/gtk.h>
31
32
33 namespace
34 {
35
36
Editable_signal_insert_text_callback(GtkEditable * self,const gchar * text,gint length,gint * position,void * data)37 static void Editable_signal_insert_text_callback(GtkEditable* self, const gchar* text,gint length,gint* position,void* data)
38 {
39 using namespace Gtk;
40 typedef sigc::slot< void,const Glib::ustring&,int* > SlotType;
41
42 Editable* obj = dynamic_cast<Editable*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
43 // Do not try to call a signal on a disassociated wrapper.
44 if(obj)
45 {
46 try
47 {
48 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
49 (*static_cast<SlotType*>(slot))( Glib::ustring(text, text + length), position);
50 }
51 catch(...)
52 {
53 Glib::exception_handlers_invoke();
54 }
55 }
56 }
57
58 static const Glib::SignalProxyInfo Editable_signal_insert_text_info =
59 {
60 "insert_text",
61 (GCallback) &Editable_signal_insert_text_callback,
62 (GCallback) &Editable_signal_insert_text_callback
63 };
64
65
Editable_signal_delete_text_callback(GtkEditable * self,gint p0,gint p1,void * data)66 static void Editable_signal_delete_text_callback(GtkEditable* self, gint p0,gint p1,void* data)
67 {
68 using namespace Gtk;
69 typedef sigc::slot< void,int,int > SlotType;
70
71 Editable* obj = dynamic_cast<Editable*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
72 // Do not try to call a signal on a disassociated wrapper.
73 if(obj)
74 {
75 try
76 {
77 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
78 (*static_cast<SlotType*>(slot))(p0
79 , p1
80 );
81 }
82 catch(...)
83 {
84 Glib::exception_handlers_invoke();
85 }
86 }
87 }
88
89 static const Glib::SignalProxyInfo Editable_signal_delete_text_info =
90 {
91 "delete_text",
92 (GCallback) &Editable_signal_delete_text_callback,
93 (GCallback) &Editable_signal_delete_text_callback
94 };
95
96
97 static const Glib::SignalProxyInfo Editable_signal_changed_info =
98 {
99 "changed",
100 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
101 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
102 };
103
104
105 } // anonymous namespace
106
107
108 namespace Glib
109 {
110
wrap(GtkEditable * object,bool take_copy)111 Glib::RefPtr<Gtk::Editable> wrap(GtkEditable* object, bool take_copy)
112 {
113 return Glib::RefPtr<Gtk::Editable>( dynamic_cast<Gtk::Editable*> (Glib::wrap_auto_interface<Gtk::Editable> ((GObject*)(object), take_copy)) );
114 //We use dynamic_cast<> in case of multiple inheritance.
115 }
116
117 } // namespace Glib
118
119
120 namespace Gtk
121 {
122
123
124 /* The *_Class implementation: */
125
init()126 const Glib::Interface_Class& Editable_Class::init()
127 {
128 if(!gtype_) // create the GType if necessary
129 {
130 // Glib::Interface_Class has to know the interface init function
131 // in order to add interfaces to implementing types.
132 class_init_func_ = &Editable_Class::iface_init_function;
133
134 // We can not derive from another interface, and it is not necessary anyway.
135 gtype_ = gtk_editable_get_type();
136 }
137
138 return *this;
139 }
140
iface_init_function(void * g_iface,void *)141 void Editable_Class::iface_init_function(void* g_iface, void*)
142 {
143 BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
144
145 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
146 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
147 g_assert(klass != 0);
148
149 klass->do_insert_text = &do_insert_text_vfunc_callback;
150 klass->do_delete_text = &do_delete_text_vfunc_callback;
151 klass->get_chars = &get_chars_vfunc_callback;
152 klass->set_selection_bounds = &set_selection_bounds_vfunc_callback;
153 klass->get_selection_bounds = &get_selection_bounds_vfunc_callback;
154 klass->set_position = &set_position_vfunc_callback;
155 klass->get_position = &get_position_vfunc_callback;
156
157 klass->insert_text = &insert_text_callback;
158 klass->delete_text = &delete_text_callback;
159 klass->changed = &changed_callback;
160 }
161
do_insert_text_vfunc_callback(GtkEditable * self,const gchar * text,gint length,gint * position)162 void Editable_Class::do_insert_text_vfunc_callback(GtkEditable* self, const gchar* text, gint length, gint* position)
163 {
164 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
165 Glib::ObjectBase::_get_current_wrapper((GObject*) self));
166
167 // Non-gtkmmproc-generated custom classes implicitly call the default
168 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
169 // generated classes can use this optimisation, which avoids the unnecessary
170 // parameter conversions if there is no possibility of the virtual function
171 // being overridden:
172 if(obj_base && obj_base->is_derived_())
173 {
174 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
175 if(obj) // This can be NULL during destruction.
176 {
177 try // Trap C++ exceptions which would normally be lost because this is a C callback.
178 {
179 // Call the virtual member method, which derived classes might override.
180 obj->insert_text_vfunc( Glib::ustring(text, text + length), *position);
181 return;
182 }
183 catch(...)
184 {
185 Glib::exception_handlers_invoke();
186 }
187 }
188 }
189
190 BaseClassType *const base = static_cast<BaseClassType*>(
191 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
192 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
193 ) );
194
195 // Call the original underlying C function:
196 if(base && base->do_insert_text)
197 {
198 (*base->do_insert_text)( self, text, length, position);
199 }
200
201 }
do_delete_text_vfunc_callback(GtkEditable * self,gint start_pos,gint end_pos)202 void Editable_Class::do_delete_text_vfunc_callback(GtkEditable* self, gint start_pos, gint end_pos)
203 {
204 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
205 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
206
207 // Non-gtkmmproc-generated custom classes implicitly call the default
208 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
209 // generated classes can use this optimisation, which avoids the unnecessary
210 // parameter conversions if there is no possibility of the virtual function
211 // being overridden:
212 if(obj_base && obj_base->is_derived_())
213 {
214 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
215 if(obj) // This can be NULL during destruction.
216 {
217 try // Trap C++ exceptions which would normally be lost because this is a C callback.
218 {
219 // Call the virtual member method, which derived classes might override.
220 obj->delete_text_vfunc(start_pos
221 , end_pos
222 );
223 return;
224 }
225 catch(...)
226 {
227 Glib::exception_handlers_invoke();
228 }
229 }
230 }
231
232 BaseClassType *const base = static_cast<BaseClassType*>(
233 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
234 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
235 ) );
236
237 // Call the original underlying C function:
238 if(base && base->do_delete_text)
239 {
240 (*base->do_delete_text)(self, start_pos, end_pos);
241 }
242
243 }
get_chars_vfunc_callback(GtkEditable * self,gint start_pos,gint end_pos)244 gchar* Editable_Class::get_chars_vfunc_callback(GtkEditable* self, gint start_pos, gint end_pos)
245 {
246 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
247 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
248
249 // Non-gtkmmproc-generated custom classes implicitly call the default
250 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
251 // generated classes can use this optimisation, which avoids the unnecessary
252 // parameter conversions if there is no possibility of the virtual function
253 // being overridden:
254 if(obj_base && obj_base->is_derived_())
255 {
256 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
257 if(obj) // This can be NULL during destruction.
258 {
259 try // Trap C++ exceptions which would normally be lost because this is a C callback.
260 {
261 // Call the virtual member method, which derived classes might override.
262 return g_strdup((obj->get_chars_vfunc(start_pos
263 , end_pos
264 )).c_str());
265 }
266 catch(...)
267 {
268 Glib::exception_handlers_invoke();
269 }
270 }
271 }
272
273 BaseClassType *const base = static_cast<BaseClassType*>(
274 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
275 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
276 ) );
277
278 // Call the original underlying C function:
279 if(base && base->get_chars)
280 {
281 gchar* retval = (*base->get_chars)(self, start_pos, end_pos);
282 return retval;
283 }
284
285 typedef gchar* RType;
286 return RType();
287 }
set_selection_bounds_vfunc_callback(GtkEditable * self,gint start_pos,gint end_pos)288 void Editable_Class::set_selection_bounds_vfunc_callback(GtkEditable* self, gint start_pos, gint end_pos)
289 {
290 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
291 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
292
293 // Non-gtkmmproc-generated custom classes implicitly call the default
294 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
295 // generated classes can use this optimisation, which avoids the unnecessary
296 // parameter conversions if there is no possibility of the virtual function
297 // being overridden:
298 if(obj_base && obj_base->is_derived_())
299 {
300 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
301 if(obj) // This can be NULL during destruction.
302 {
303 try // Trap C++ exceptions which would normally be lost because this is a C callback.
304 {
305 // Call the virtual member method, which derived classes might override.
306 obj->select_region_vfunc(start_pos
307 , end_pos
308 );
309 return;
310 }
311 catch(...)
312 {
313 Glib::exception_handlers_invoke();
314 }
315 }
316 }
317
318 BaseClassType *const base = static_cast<BaseClassType*>(
319 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
320 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
321 ) );
322
323 // Call the original underlying C function:
324 if(base && base->set_selection_bounds)
325 {
326 (*base->set_selection_bounds)(self, start_pos, end_pos);
327 }
328
329 }
get_selection_bounds_vfunc_callback(GtkEditable * self,gint * start_pos,gint * end_pos)330 gboolean Editable_Class::get_selection_bounds_vfunc_callback(GtkEditable* self, gint* start_pos, gint* end_pos)
331 {
332 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
333 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
334
335 // Non-gtkmmproc-generated custom classes implicitly call the default
336 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
337 // generated classes can use this optimisation, which avoids the unnecessary
338 // parameter conversions if there is no possibility of the virtual function
339 // being overridden:
340 if(obj_base && obj_base->is_derived_())
341 {
342 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
343 if(obj) // This can be NULL during destruction.
344 {
345 try // Trap C++ exceptions which would normally be lost because this is a C callback.
346 {
347 // Call the virtual member method, which derived classes might override.
348 return static_cast<int>(obj->get_selection_bounds_vfunc(*(start_pos)
349 , *(end_pos)
350 ));
351 }
352 catch(...)
353 {
354 Glib::exception_handlers_invoke();
355 }
356 }
357 }
358
359 BaseClassType *const base = static_cast<BaseClassType*>(
360 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
361 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
362 ) );
363
364 // Call the original underlying C function:
365 if(base && base->get_selection_bounds)
366 {
367 gboolean retval = (*base->get_selection_bounds)(self, start_pos, end_pos);
368 return retval;
369 }
370
371 typedef gboolean RType;
372 return RType();
373 }
set_position_vfunc_callback(GtkEditable * self,gint position)374 void Editable_Class::set_position_vfunc_callback(GtkEditable* self, gint position)
375 {
376 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
377 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
378
379 // Non-gtkmmproc-generated custom classes implicitly call the default
380 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
381 // generated classes can use this optimisation, which avoids the unnecessary
382 // parameter conversions if there is no possibility of the virtual function
383 // being overridden:
384 if(obj_base && obj_base->is_derived_())
385 {
386 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
387 if(obj) // This can be NULL during destruction.
388 {
389 try // Trap C++ exceptions which would normally be lost because this is a C callback.
390 {
391 // Call the virtual member method, which derived classes might override.
392 obj->set_position_vfunc(position
393 );
394 return;
395 }
396 catch(...)
397 {
398 Glib::exception_handlers_invoke();
399 }
400 }
401 }
402
403 BaseClassType *const base = static_cast<BaseClassType*>(
404 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
405 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
406 ) );
407
408 // Call the original underlying C function:
409 if(base && base->set_position)
410 {
411 (*base->set_position)(self, position);
412 }
413
414 }
get_position_vfunc_callback(GtkEditable * self)415 gint Editable_Class::get_position_vfunc_callback(GtkEditable* self)
416 {
417 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
418 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
419
420 // Non-gtkmmproc-generated custom classes implicitly call the default
421 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
422 // generated classes can use this optimisation, which avoids the unnecessary
423 // parameter conversions if there is no possibility of the virtual function
424 // being overridden:
425 if(obj_base && obj_base->is_derived_())
426 {
427 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
428 if(obj) // This can be NULL during destruction.
429 {
430 try // Trap C++ exceptions which would normally be lost because this is a C callback.
431 {
432 // Call the virtual member method, which derived classes might override.
433 return obj->get_position_vfunc();
434 }
435 catch(...)
436 {
437 Glib::exception_handlers_invoke();
438 }
439 }
440 }
441
442 BaseClassType *const base = static_cast<BaseClassType*>(
443 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
444 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
445 ) );
446
447 // Call the original underlying C function:
448 if(base && base->get_position)
449 {
450 gint retval = (*base->get_position)(self);
451 return retval;
452 }
453
454 typedef gint RType;
455 return RType();
456 }
457
insert_text_callback(GtkEditable * self,const gchar * text,gint length,gint * position)458 void Editable_Class::insert_text_callback(GtkEditable* self, const gchar* text, gint length, gint* position)
459 {
460 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
461 Glib::ObjectBase::_get_current_wrapper((GObject*) self));
462
463 // Non-gtkmmproc-generated custom classes implicitly call the default
464 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
465 // generated classes can use this optimisation, which avoids the unnecessary
466 // parameter conversions if there is no possibility of the virtual function
467 // being overridden:
468 if(obj_base && obj_base->is_derived_())
469 {
470 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
471 if(obj) // This can be NULL during destruction.
472 {
473 try // Trap C++ exceptions which would normally be lost because this is a C callback.
474 {
475 // Call the virtual member method, which derived classes might override.
476 obj->on_insert_text( Glib::ustring(text, text + length), position);
477 return;
478 }
479 catch(...)
480 {
481 Glib::exception_handlers_invoke();
482 }
483 }
484 }
485
486 BaseClassType *const base = static_cast<BaseClassType*>(
487 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
488 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
489 ) );
490
491 // Call the original underlying C function:
492 if(base && base->insert_text)
493 (*base->insert_text)( self, text, length, position);
494 }
delete_text_callback(GtkEditable * self,gint p0,gint p1)495 void Editable_Class::delete_text_callback(GtkEditable* self, gint p0, gint p1)
496 {
497 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
498 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
499
500 // Non-gtkmmproc-generated custom classes implicitly call the default
501 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
502 // generated classes can use this optimisation, which avoids the unnecessary
503 // parameter conversions if there is no possibility of the virtual function
504 // being overridden:
505 if(obj_base && obj_base->is_derived_())
506 {
507 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
508 if(obj) // This can be NULL during destruction.
509 {
510 try // Trap C++ exceptions which would normally be lost because this is a C callback.
511 {
512 // Call the virtual member method, which derived classes might override.
513 obj->on_delete_text(p0
514 , p1
515 );
516 return;
517 }
518 catch(...)
519 {
520 Glib::exception_handlers_invoke();
521 }
522 }
523 }
524
525 BaseClassType *const base = static_cast<BaseClassType*>(
526 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
527 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
528 ) );
529
530 // Call the original underlying C function:
531 if(base && base->delete_text)
532 (*base->delete_text)(self, p0, p1);
533 }
changed_callback(GtkEditable * self)534 void Editable_Class::changed_callback(GtkEditable* self)
535 {
536 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
537 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
538
539 // Non-gtkmmproc-generated custom classes implicitly call the default
540 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
541 // generated classes can use this optimisation, which avoids the unnecessary
542 // parameter conversions if there is no possibility of the virtual function
543 // being overridden:
544 if(obj_base && obj_base->is_derived_())
545 {
546 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
547 if(obj) // This can be NULL during destruction.
548 {
549 try // Trap C++ exceptions which would normally be lost because this is a C callback.
550 {
551 // Call the virtual member method, which derived classes might override.
552 obj->on_changed();
553 return;
554 }
555 catch(...)
556 {
557 Glib::exception_handlers_invoke();
558 }
559 }
560 }
561
562 BaseClassType *const base = static_cast<BaseClassType*>(
563 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
564 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
565 ) );
566
567 // Call the original underlying C function:
568 if(base && base->changed)
569 (*base->changed)(self);
570 }
571
572
wrap_new(GObject * object)573 Glib::ObjectBase* Editable_Class::wrap_new(GObject* object)
574 {
575 return new Editable((GtkEditable*)(object));
576 }
577
578
579 /* The implementation: */
580
Editable()581 Editable::Editable()
582 :
583 Glib::Interface(editable_class_.init())
584 {}
585
Editable(GtkEditable * castitem)586 Editable::Editable(GtkEditable* castitem)
587 :
588 Glib::Interface((GObject*)(castitem))
589 {}
590
Editable(const Glib::Interface_Class & interface_class)591 Editable::Editable(const Glib::Interface_Class& interface_class)
592 : Glib::Interface(interface_class)
593 {
594 }
595
~Editable()596 Editable::~Editable()
597 {}
598
599 // static
add_interface(GType gtype_implementer)600 void Editable::add_interface(GType gtype_implementer)
601 {
602 editable_class_.init().add_interface(gtype_implementer);
603 }
604
605 Editable::CppClassType Editable::editable_class_; // initialize static member
606
get_type()607 GType Editable::get_type()
608 {
609 return editable_class_.init().get_type();
610 }
611
612
get_base_type()613 GType Editable::get_base_type()
614 {
615 return gtk_editable_get_type();
616 }
617
618
cut_clipboard()619 void Editable::cut_clipboard()
620 {
621 gtk_editable_cut_clipboard(gobj());
622 }
623
copy_clipboard()624 void Editable::copy_clipboard()
625 {
626 gtk_editable_copy_clipboard(gobj());
627 }
628
paste_clipboard()629 void Editable::paste_clipboard()
630 {
631 gtk_editable_paste_clipboard(gobj());
632 }
633
delete_selection()634 void Editable::delete_selection()
635 {
636 gtk_editable_delete_selection(gobj());
637 }
638
set_editable(bool is_editable)639 void Editable::set_editable(bool is_editable)
640 {
641 gtk_editable_set_editable(gobj(), static_cast<int>(is_editable));
642 }
643
get_editable() const644 bool Editable::get_editable() const
645 {
646 return gtk_editable_get_editable(const_cast<GtkEditable*>(gobj()));
647 }
648
insert_text(const Glib::ustring & text,int length,int & position)649 void Editable::insert_text(const Glib::ustring& text, int length, int& position)
650 {
651 gtk_editable_insert_text(gobj(), text.c_str(), length, &(position));
652 }
653
delete_text(int start_pos,int end_pos)654 void Editable::delete_text(int start_pos, int end_pos)
655 {
656 gtk_editable_delete_text(gobj(), start_pos, end_pos);
657 }
658
get_chars(int start_pos,int end_pos) const659 Glib::ustring Editable::get_chars(int start_pos, int end_pos) const
660 {
661 return Glib::convert_return_gchar_ptr_to_ustring(gtk_editable_get_chars(const_cast<GtkEditable*>(gobj()), start_pos, end_pos));
662 }
663
select_region(int start_pos,int end_pos)664 void Editable::select_region(int start_pos, int end_pos)
665 {
666 gtk_editable_select_region(gobj(), start_pos, end_pos);
667 }
668
get_selection_bounds(int & start_pos,int & end_pos) const669 bool Editable::get_selection_bounds(int& start_pos, int& end_pos) const
670 {
671 return gtk_editable_get_selection_bounds(const_cast<GtkEditable*>(gobj()), &(start_pos), &(end_pos));
672 }
673
set_position(int position)674 void Editable::set_position(int position)
675 {
676 gtk_editable_set_position(gobj(), position);
677 }
678
get_position() const679 int Editable::get_position() const
680 {
681 return gtk_editable_get_position(const_cast<GtkEditable*>(gobj()));
682 }
683
684
signal_insert_text()685 Glib::SignalProxy2< void,const Glib::ustring&,int* > Editable::signal_insert_text()
686 {
687 return Glib::SignalProxy2< void,const Glib::ustring&,int* >(this, &Editable_signal_insert_text_info);
688 }
689
690
signal_delete_text()691 Glib::SignalProxy2< void,int,int > Editable::signal_delete_text()
692 {
693 return Glib::SignalProxy2< void,int,int >(this, &Editable_signal_delete_text_info);
694 }
695
696
signal_changed()697 Glib::SignalProxy0< void > Editable::signal_changed()
698 {
699 return Glib::SignalProxy0< void >(this, &Editable_signal_changed_info);
700 }
701
702
on_insert_text(const Glib::ustring & text,int * position)703 void Gtk::Editable::on_insert_text(const Glib::ustring& text, int* position)
704 {
705 BaseClassType *const base = static_cast<BaseClassType*>(
706 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
707 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
708 ) );
709
710 if(base && base->insert_text)
711 (*base->insert_text)(gobj(),text.data(),text.bytes(),position);
712 }
on_delete_text(int start_pos,int end_pos)713 void Gtk::Editable::on_delete_text(int start_pos, int end_pos)
714 {
715 BaseClassType *const base = static_cast<BaseClassType*>(
716 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
717 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
718 ) );
719
720 if(base && base->delete_text)
721 (*base->delete_text)(gobj(),start_pos,end_pos);
722 }
on_changed()723 void Gtk::Editable::on_changed()
724 {
725 BaseClassType *const base = static_cast<BaseClassType*>(
726 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
727 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
728 ) );
729
730 if(base && base->changed)
731 (*base->changed)(gobj());
732 }
733
insert_text_vfunc(const Glib::ustring & text,int & position)734 void Gtk::Editable::insert_text_vfunc(const Glib::ustring& text, int& position)
735 {
736 BaseClassType *const base = static_cast<BaseClassType*>(
737 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
738 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
739 ) );
740
741 if(base && base->do_insert_text)
742 {
743 (*base->do_insert_text)(gobj(),text.data(),text.bytes(),&position);
744 }
745 }
delete_text_vfunc(int start_pos,int end_pos)746 void Gtk::Editable::delete_text_vfunc(int start_pos, int end_pos)
747 {
748 BaseClassType *const base = static_cast<BaseClassType*>(
749 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
750 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
751 ) );
752
753 if(base && base->do_delete_text)
754 {
755 (*base->do_delete_text)(gobj(),start_pos,end_pos);
756 }
757 }
get_chars_vfunc(int start_pos,int end_pos) const758 Glib::ustring Gtk::Editable::get_chars_vfunc(int start_pos, int end_pos) const
759 {
760 BaseClassType *const base = static_cast<BaseClassType*>(
761 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
762 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
763 ) );
764
765 if(base && base->get_chars)
766 {
767 Glib::ustring retval(Glib::convert_const_gchar_ptr_to_ustring((*base->get_chars)(const_cast<GtkEditable*>(gobj()),start_pos,end_pos)));
768 return retval;
769 }
770
771 typedef Glib::ustring RType;
772 return RType();
773 }
select_region_vfunc(int start_pos,int end_pos)774 void Gtk::Editable::select_region_vfunc(int start_pos, int end_pos)
775 {
776 BaseClassType *const 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->set_selection_bounds)
782 {
783 (*base->set_selection_bounds)(gobj(),start_pos,end_pos);
784 }
785 }
get_selection_bounds_vfunc(int & start_pos,int & end_pos) const786 bool Gtk::Editable::get_selection_bounds_vfunc(int& start_pos, int& end_pos) const
787 {
788 BaseClassType *const base = static_cast<BaseClassType*>(
789 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
790 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
791 ) );
792
793 if(base && base->get_selection_bounds)
794 {
795 bool retval((*base->get_selection_bounds)(const_cast<GtkEditable*>(gobj()),&(start_pos),&(end_pos)));
796 return retval;
797 }
798
799 typedef bool RType;
800 return RType();
801 }
set_position_vfunc(int position)802 void Gtk::Editable::set_position_vfunc(int position)
803 {
804 BaseClassType *const base = static_cast<BaseClassType*>(
805 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
806 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
807 ) );
808
809 if(base && base->set_position)
810 {
811 (*base->set_position)(gobj(),position);
812 }
813 }
get_position_vfunc() const814 int Gtk::Editable::get_position_vfunc() const
815 {
816 BaseClassType *const base = static_cast<BaseClassType*>(
817 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
818 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
819 ) );
820
821 if(base && base->get_position)
822 {
823 int retval((*base->get_position)(const_cast<GtkEditable*>(gobj())));
824 return retval;
825 }
826
827 typedef int RType;
828 return RType();
829 }
830
831
832 } // namespace Gtk
833
834
835