1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <atkmm/editabletext.h>
4 #include <atkmm/private/editabletext_p.h>
9 /* Copyright 1998-2002 The gtkmm Development Team
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public
22 * License along with this library; if not, write to the Free
23 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include <atkmm/object.h>
27 #include <atk/atkeditabletext.h>
32 } // anonymous namespace
38 Glib::RefPtr<Atk::EditableText> wrap(AtkEditableText* object, bool take_copy)
40 return Glib::RefPtr<Atk::EditableText>( dynamic_cast<Atk::EditableText*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
41 //We use dynamic_cast<> in case of multiple inheritance.
51 /* The *_Class implementation: */
53 const Glib::Interface_Class& EditableText_Class::init()
55 if(!gtype_) // create the GType if necessary
57 // Glib::Interface_Class has to know the interface init function
58 // in order to add interfaces to implementing types.
59 class_init_func_ = &EditableText_Class::iface_init_function;
61 // We can not derive from another interface, and it is not necessary anyway.
62 gtype_ = atk_editable_text_get_type();
68 void EditableText_Class::iface_init_function(void* g_iface, void*)
70 BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
72 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
73 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
76 klass->set_run_attributes = &set_run_attributes_vfunc_callback;
77 klass->set_text_contents = &set_text_contents_vfunc_callback;
78 klass->insert_text = &insert_text_vfunc_callback;
79 klass->copy_text = ©_text_vfunc_callback;
80 klass->cut_text = &cut_text_vfunc_callback;
81 klass->delete_text = &delete_text_vfunc_callback;
82 klass->paste_text = &paste_text_vfunc_callback;
85 gboolean EditableText_Class::set_run_attributes_vfunc_callback(AtkEditableText* self, AtkAttributeSet* attrib_set, gint start_offset, gint end_offset)
87 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
88 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
90 // Non-gtkmmproc-generated custom classes implicitly call the default
91 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
92 // generated classes can use this optimisation, which avoids the unnecessary
93 // parameter conversions if there is no possibility of the virtual function
95 if(obj && obj->is_derived_())
97 try // Trap C++ exceptions which would normally be lost because this is a C callback.
99 // Call the virtual member method, which derived classes might override.
100 return static_cast<int>(obj->set_run_attributes_vfunc(attrib_set, start_offset
106 Glib::exception_handlers_invoke();
111 BaseClassType *const base = static_cast<BaseClassType*>(
112 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
113 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
116 // Call the original underlying C function:
117 if(base && base->set_run_attributes)
118 return (*base->set_run_attributes)(self, attrib_set, start_offset, end_offset);
121 typedef gboolean RType;
125 void EditableText_Class::set_text_contents_vfunc_callback(AtkEditableText* self, const gchar* string)
127 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
128 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
130 // Non-gtkmmproc-generated custom classes implicitly call the default
131 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
132 // generated classes can use this optimisation, which avoids the unnecessary
133 // parameter conversions if there is no possibility of the virtual function
135 if(obj && obj->is_derived_())
137 try // Trap C++ exceptions which would normally be lost because this is a C callback.
139 // Call the virtual member method, which derived classes might override.
140 obj->set_text_contents_vfunc(Glib::convert_const_gchar_ptr_to_ustring(string)
145 Glib::exception_handlers_invoke();
150 BaseClassType *const base = static_cast<BaseClassType*>(
151 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
152 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
155 // Call the original underlying C function:
156 if(base && base->set_text_contents)
157 (*base->set_text_contents)(self, string);
161 void EditableText_Class::insert_text_vfunc_callback(AtkEditableText* self, const gchar* string, gint length, gint* position)
163 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
164 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
166 // Non-gtkmmproc-generated custom classes implicitly call the default
167 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
168 // generated classes can use this optimisation, which avoids the unnecessary
169 // parameter conversions if there is no possibility of the virtual function
171 if(obj && obj->is_derived_())
173 try // Trap C++ exceptions which would normally be lost because this is a C callback.
175 // Call the virtual member method, which derived classes might override.
176 obj->insert_text_vfunc(Glib::convert_const_gchar_ptr_to_ustring(string)
183 Glib::exception_handlers_invoke();
188 BaseClassType *const base = static_cast<BaseClassType*>(
189 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
190 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
193 // Call the original underlying C function:
194 if(base && base->insert_text)
195 (*base->insert_text)(self, string, length, position);
199 void EditableText_Class::copy_text_vfunc_callback(AtkEditableText* self, gint start_pos, gint end_pos)
201 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
202 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
204 // Non-gtkmmproc-generated custom classes implicitly call the default
205 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
206 // generated classes can use this optimisation, which avoids the unnecessary
207 // parameter conversions if there is no possibility of the virtual function
209 if(obj && obj->is_derived_())
211 try // Trap C++ exceptions which would normally be lost because this is a C callback.
213 // Call the virtual member method, which derived classes might override.
214 obj->copy_text_vfunc(start_pos
220 Glib::exception_handlers_invoke();
225 BaseClassType *const base = static_cast<BaseClassType*>(
226 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
227 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
230 // Call the original underlying C function:
231 if(base && base->copy_text)
232 (*base->copy_text)(self, start_pos, end_pos);
236 void EditableText_Class::cut_text_vfunc_callback(AtkEditableText* self, gint start_pos, gint end_pos)
238 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
239 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
241 // Non-gtkmmproc-generated custom classes implicitly call the default
242 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
243 // generated classes can use this optimisation, which avoids the unnecessary
244 // parameter conversions if there is no possibility of the virtual function
246 if(obj && obj->is_derived_())
248 try // Trap C++ exceptions which would normally be lost because this is a C callback.
250 // Call the virtual member method, which derived classes might override.
251 obj->cut_text_vfunc(start_pos
257 Glib::exception_handlers_invoke();
262 BaseClassType *const base = static_cast<BaseClassType*>(
263 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
264 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
267 // Call the original underlying C function:
268 if(base && base->cut_text)
269 (*base->cut_text)(self, start_pos, end_pos);
273 void EditableText_Class::delete_text_vfunc_callback(AtkEditableText* self, gint start_pos, gint end_pos)
275 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
276 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
278 // Non-gtkmmproc-generated custom classes implicitly call the default
279 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
280 // generated classes can use this optimisation, which avoids the unnecessary
281 // parameter conversions if there is no possibility of the virtual function
283 if(obj && obj->is_derived_())
285 try // Trap C++ exceptions which would normally be lost because this is a C callback.
287 // Call the virtual member method, which derived classes might override.
288 obj->delete_text_vfunc(start_pos
294 Glib::exception_handlers_invoke();
299 BaseClassType *const base = static_cast<BaseClassType*>(
300 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
301 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
304 // Call the original underlying C function:
305 if(base && base->delete_text)
306 (*base->delete_text)(self, start_pos, end_pos);
310 void EditableText_Class::paste_text_vfunc_callback(AtkEditableText* self, gint position)
312 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
313 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
315 // Non-gtkmmproc-generated custom classes implicitly call the default
316 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
317 // generated classes can use this optimisation, which avoids the unnecessary
318 // parameter conversions if there is no possibility of the virtual function
320 if(obj && obj->is_derived_())
322 try // Trap C++ exceptions which would normally be lost because this is a C callback.
324 // Call the virtual member method, which derived classes might override.
325 obj->paste_text_vfunc(position
330 Glib::exception_handlers_invoke();
335 BaseClassType *const base = static_cast<BaseClassType*>(
336 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
337 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
340 // Call the original underlying C function:
341 if(base && base->paste_text)
342 (*base->paste_text)(self, position);
347 Glib::ObjectBase* EditableText_Class::wrap_new(GObject* object)
349 return new EditableText((AtkEditableText*)(object));
353 /* The implementation: */
355 EditableText::EditableText()
357 Glib::Interface(editabletext_class_.init())
360 EditableText::EditableText(AtkEditableText* castitem)
362 Glib::Interface((GObject*)(castitem))
365 EditableText::~EditableText()
369 void EditableText::add_interface(GType gtype_implementer)
371 editabletext_class_.init().add_interface(gtype_implementer);
374 EditableText::CppClassType EditableText::editabletext_class_; // initialize static member
376 GType EditableText::get_type()
378 return editabletext_class_.init().get_type();
381 GType EditableText::get_base_type()
383 return atk_editable_text_get_type();
387 bool EditableText::set_run_attributes(const AttributeSet& attrib_set, int start_offset, int end_offset)
389 return atk_editable_text_set_run_attributes(gobj(), (attrib_set).data(), start_offset, end_offset);
392 void EditableText::set_text_contents(const Glib::ustring& string)
394 atk_editable_text_set_text_contents(gobj(), string.c_str());
397 void EditableText::insert_text(const Glib::ustring& string, int length, int& position)
399 atk_editable_text_insert_text(gobj(), string.c_str(), length, &position);
402 void EditableText::copy_text(int start_pos, int end_pos)
404 atk_editable_text_copy_text(gobj(), start_pos, end_pos);
407 void EditableText::cut_text(int start_pos, int end_pos)
409 atk_editable_text_cut_text(gobj(), start_pos, end_pos);
412 void EditableText::delete_text(int start_pos, int end_pos)
414 atk_editable_text_delete_text(gobj(), start_pos, end_pos);
417 void EditableText::paste_text(int position)
419 atk_editable_text_paste_text(gobj(), position);
423 bool Atk::EditableText::set_run_attributes_vfunc(AtkAttributeSet* attrib_set, int start_offset, int end_offset)
425 BaseClassType *const base = static_cast<BaseClassType*>(
426 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
427 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
430 if(base && base->set_run_attributes)
431 return (*base->set_run_attributes)(gobj(),attrib_set,start_offset,end_offset);
437 void Atk::EditableText::set_text_contents_vfunc(const Glib::ustring& string)
439 BaseClassType *const base = static_cast<BaseClassType*>(
440 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
441 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
444 if(base && base->set_text_contents)
445 (*base->set_text_contents)(gobj(),string.c_str());
448 void Atk::EditableText::insert_text_vfunc(const Glib::ustring& string, int length, int& position)
450 BaseClassType *const base = static_cast<BaseClassType*>(
451 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
452 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
455 if(base && base->insert_text)
456 (*base->insert_text)(gobj(),string.c_str(),length,&position);
459 void Atk::EditableText::copy_text_vfunc(int start_pos, int end_pos)
461 BaseClassType *const base = static_cast<BaseClassType*>(
462 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
463 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
466 if(base && base->copy_text)
467 (*base->copy_text)(gobj(),start_pos,end_pos);
470 void Atk::EditableText::cut_text_vfunc(int start_pos, int end_pos)
472 BaseClassType *const base = static_cast<BaseClassType*>(
473 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
474 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
477 if(base && base->cut_text)
478 (*base->cut_text)(gobj(),start_pos,end_pos);
481 void Atk::EditableText::delete_text_vfunc(int start_pos, int end_pos)
483 BaseClassType *const base = static_cast<BaseClassType*>(
484 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
485 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
488 if(base && base->delete_text)
489 (*base->delete_text)(gobj(),start_pos,end_pos);
492 void Atk::EditableText::paste_text_vfunc(int position)
494 BaseClassType *const base = static_cast<BaseClassType*>(
495 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
496 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
499 if(base && base->paste_text)
500 (*base->paste_text)(gobj(),position);