1
// Generated by gtkmmproc -- DO NOT MODIFY!
4
#include <atkmm/editabletext.h>
5
#include <atkmm/private/editabletext_p.h>
8
/* $Id: editabletext.ccg,v 1.1 2003/01/21 13:37:05 murrayc Exp $ */
10
/* Copyright 1998-2002 The gtkmm Development Team
12
* This library is free software; you can redistribute it and/or
13
* modify it under the terms of the GNU Lesser General Public
14
* License as published by the Free Software Foundation; either
15
* version 2.1 of the License, or (at your option) any later version.
17
* This library is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
* Lesser General Public License for more details.
22
* You should have received a copy of the GNU Lesser General Public
23
* License along with this library; if not, write to the Free
24
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27
#include <atkmm/object.h>
28
#include <atk/atkeditabletext.h>
33
} // anonymous namespace
39
Glib::RefPtr<Atk::EditableText> wrap(AtkEditableText* object, bool take_copy)
41
return Glib::RefPtr<Atk::EditableText>( dynamic_cast<Atk::EditableText*> (Glib::wrap_auto_interface<Atk::EditableText> ((GObject*)(object), take_copy)) );
42
//We use dynamic_cast<> in case of multiple inheritance.
52
/* The *_Class implementation: */
54
const Glib::Interface_Class& EditableText_Class::init()
56
if(!gtype_) // create the GType if necessary
58
// Glib::Interface_Class has to know the interface init function
59
// in order to add interfaces to implementing types.
60
class_init_func_ = &EditableText_Class::iface_init_function;
62
// We can not derive from another interface, and it is not necessary anyway.
63
gtype_ = atk_editable_text_get_type();
69
void EditableText_Class::iface_init_function(void* g_iface, void*)
71
BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
73
//This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
74
//This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
77
klass->set_run_attributes = &set_run_attributes_vfunc_callback;
78
klass->set_text_contents = &set_text_contents_vfunc_callback;
79
klass->insert_text = &insert_text_vfunc_callback;
80
klass->copy_text = ©_text_vfunc_callback;
81
klass->cut_text = &cut_text_vfunc_callback;
82
klass->delete_text = &delete_text_vfunc_callback;
83
klass->paste_text = &paste_text_vfunc_callback;
87
gboolean EditableText_Class::set_run_attributes_vfunc_callback(AtkEditableText* self, AtkAttributeSet* attrib_set, gint start_offset, gint end_offset)
89
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
90
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
92
// Non-gtkmmproc-generated custom classes implicitly call the default
93
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
94
// generated classes can use this optimisation, which avoids the unnecessary
95
// parameter conversions if there is no possibility of the virtual function
97
if(obj_base && obj_base->is_derived_())
99
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
100
if(obj) // This can be NULL during destruction.
102
#ifdef GLIBMM_EXCEPTIONS_ENABLED
103
try // Trap C++ exceptions which would normally be lost because this is a C callback.
105
#endif //GLIBMM_EXCEPTIONS_ENABLED
106
// Call the virtual member method, which derived classes might override.
107
return static_cast<int>(obj->set_run_attributes_vfunc(attrib_set, start_offset
110
#ifdef GLIBMM_EXCEPTIONS_ENABLED
114
Glib::exception_handlers_invoke();
116
#endif //GLIBMM_EXCEPTIONS_ENABLED
120
BaseClassType *const base = static_cast<BaseClassType*>(
121
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
122
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
125
// Call the original underlying C function:
126
if(base && base->set_run_attributes)
127
return (*base->set_run_attributes)(self, attrib_set, start_offset, end_offset);
130
typedef gboolean RType;
133
void EditableText_Class::set_text_contents_vfunc_callback(AtkEditableText* self, const gchar* string)
135
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
136
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
138
// Non-gtkmmproc-generated custom classes implicitly call the default
139
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
140
// generated classes can use this optimisation, which avoids the unnecessary
141
// parameter conversions if there is no possibility of the virtual function
143
if(obj_base && obj_base->is_derived_())
145
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
146
if(obj) // This can be NULL during destruction.
148
#ifdef GLIBMM_EXCEPTIONS_ENABLED
149
try // Trap C++ exceptions which would normally be lost because this is a C callback.
151
#endif //GLIBMM_EXCEPTIONS_ENABLED
152
// Call the virtual member method, which derived classes might override.
153
obj->set_text_contents_vfunc(Glib::convert_const_gchar_ptr_to_ustring(string)
156
#ifdef GLIBMM_EXCEPTIONS_ENABLED
160
Glib::exception_handlers_invoke();
162
#endif //GLIBMM_EXCEPTIONS_ENABLED
166
BaseClassType *const base = static_cast<BaseClassType*>(
167
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
168
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
171
// Call the original underlying C function:
172
if(base && base->set_text_contents)
173
(*base->set_text_contents)(self, string);
176
void EditableText_Class::insert_text_vfunc_callback(AtkEditableText* self, const gchar* string, gint length, gint* position)
178
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
179
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
181
// Non-gtkmmproc-generated custom classes implicitly call the default
182
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
183
// generated classes can use this optimisation, which avoids the unnecessary
184
// parameter conversions if there is no possibility of the virtual function
186
if(obj_base && obj_base->is_derived_())
188
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
189
if(obj) // This can be NULL during destruction.
191
#ifdef GLIBMM_EXCEPTIONS_ENABLED
192
try // Trap C++ exceptions which would normally be lost because this is a C callback.
194
#endif //GLIBMM_EXCEPTIONS_ENABLED
195
// Call the virtual member method, which derived classes might override.
196
obj->insert_text_vfunc(Glib::convert_const_gchar_ptr_to_ustring(string)
201
#ifdef GLIBMM_EXCEPTIONS_ENABLED
205
Glib::exception_handlers_invoke();
207
#endif //GLIBMM_EXCEPTIONS_ENABLED
211
BaseClassType *const base = static_cast<BaseClassType*>(
212
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
213
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
216
// Call the original underlying C function:
217
if(base && base->insert_text)
218
(*base->insert_text)(self, string, length, position);
221
void EditableText_Class::copy_text_vfunc_callback(AtkEditableText* self, gint start_pos, gint end_pos)
223
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
224
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
226
// Non-gtkmmproc-generated custom classes implicitly call the default
227
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
228
// generated classes can use this optimisation, which avoids the unnecessary
229
// parameter conversions if there is no possibility of the virtual function
231
if(obj_base && obj_base->is_derived_())
233
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
234
if(obj) // This can be NULL during destruction.
236
#ifdef GLIBMM_EXCEPTIONS_ENABLED
237
try // Trap C++ exceptions which would normally be lost because this is a C callback.
239
#endif //GLIBMM_EXCEPTIONS_ENABLED
240
// Call the virtual member method, which derived classes might override.
241
obj->copy_text_vfunc(start_pos
245
#ifdef GLIBMM_EXCEPTIONS_ENABLED
249
Glib::exception_handlers_invoke();
251
#endif //GLIBMM_EXCEPTIONS_ENABLED
255
BaseClassType *const base = static_cast<BaseClassType*>(
256
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
257
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
260
// Call the original underlying C function:
261
if(base && base->copy_text)
262
(*base->copy_text)(self, start_pos, end_pos);
265
void EditableText_Class::cut_text_vfunc_callback(AtkEditableText* self, gint start_pos, gint end_pos)
267
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
268
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
270
// Non-gtkmmproc-generated custom classes implicitly call the default
271
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
272
// generated classes can use this optimisation, which avoids the unnecessary
273
// parameter conversions if there is no possibility of the virtual function
275
if(obj_base && obj_base->is_derived_())
277
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
278
if(obj) // This can be NULL during destruction.
280
#ifdef GLIBMM_EXCEPTIONS_ENABLED
281
try // Trap C++ exceptions which would normally be lost because this is a C callback.
283
#endif //GLIBMM_EXCEPTIONS_ENABLED
284
// Call the virtual member method, which derived classes might override.
285
obj->cut_text_vfunc(start_pos
289
#ifdef GLIBMM_EXCEPTIONS_ENABLED
293
Glib::exception_handlers_invoke();
295
#endif //GLIBMM_EXCEPTIONS_ENABLED
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->cut_text)
306
(*base->cut_text)(self, start_pos, end_pos);
309
void EditableText_Class::delete_text_vfunc_callback(AtkEditableText* self, gint start_pos, gint end_pos)
311
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
312
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
314
// Non-gtkmmproc-generated custom classes implicitly call the default
315
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
316
// generated classes can use this optimisation, which avoids the unnecessary
317
// parameter conversions if there is no possibility of the virtual function
319
if(obj_base && obj_base->is_derived_())
321
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
322
if(obj) // This can be NULL during destruction.
324
#ifdef GLIBMM_EXCEPTIONS_ENABLED
325
try // Trap C++ exceptions which would normally be lost because this is a C callback.
327
#endif //GLIBMM_EXCEPTIONS_ENABLED
328
// Call the virtual member method, which derived classes might override.
329
obj->delete_text_vfunc(start_pos
333
#ifdef GLIBMM_EXCEPTIONS_ENABLED
337
Glib::exception_handlers_invoke();
339
#endif //GLIBMM_EXCEPTIONS_ENABLED
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.
348
// Call the original underlying C function:
349
if(base && base->delete_text)
350
(*base->delete_text)(self, start_pos, end_pos);
353
void EditableText_Class::paste_text_vfunc_callback(AtkEditableText* self, gint position)
355
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
356
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
358
// Non-gtkmmproc-generated custom classes implicitly call the default
359
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
360
// generated classes can use this optimisation, which avoids the unnecessary
361
// parameter conversions if there is no possibility of the virtual function
363
if(obj_base && obj_base->is_derived_())
365
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
366
if(obj) // This can be NULL during destruction.
368
#ifdef GLIBMM_EXCEPTIONS_ENABLED
369
try // Trap C++ exceptions which would normally be lost because this is a C callback.
371
#endif //GLIBMM_EXCEPTIONS_ENABLED
372
// Call the virtual member method, which derived classes might override.
373
obj->paste_text_vfunc(position
376
#ifdef GLIBMM_EXCEPTIONS_ENABLED
380
Glib::exception_handlers_invoke();
382
#endif //GLIBMM_EXCEPTIONS_ENABLED
386
BaseClassType *const base = static_cast<BaseClassType*>(
387
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
388
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
391
// Call the original underlying C function:
392
if(base && base->paste_text)
393
(*base->paste_text)(self, position);
398
Glib::ObjectBase* EditableText_Class::wrap_new(GObject* object)
400
return new EditableText((AtkEditableText*)(object));
404
/* The implementation: */
406
EditableText::EditableText()
408
Glib::Interface(editabletext_class_.init())
411
EditableText::EditableText(AtkEditableText* castitem)
413
Glib::Interface((GObject*)(castitem))
416
EditableText::EditableText(const Glib::Interface_Class& interface_class)
417
: Glib::Interface(interface_class)
421
EditableText::~EditableText()
425
void EditableText::add_interface(GType gtype_implementer)
427
editabletext_class_.init().add_interface(gtype_implementer);
430
EditableText::CppClassType EditableText::editabletext_class_; // initialize static member
432
GType EditableText::get_type()
434
return editabletext_class_.init().get_type();
438
GType EditableText::get_base_type()
440
return atk_editable_text_get_type();
444
bool EditableText::set_run_attributes(const AttributeSet& attrib_set, int start_offset, int end_offset)
446
return atk_editable_text_set_run_attributes(gobj(), (attrib_set).data(), start_offset, end_offset);
449
void EditableText::set_text_contents(const Glib::ustring& string)
451
atk_editable_text_set_text_contents(gobj(), string.c_str());
454
void EditableText::insert_text(const Glib::ustring& string, int length, int& position)
456
atk_editable_text_insert_text(gobj(), string.c_str(), length, &position);
459
void EditableText::copy_text(int start_pos, int end_pos)
461
atk_editable_text_copy_text(gobj(), start_pos, end_pos);
464
void EditableText::cut_text(int start_pos, int end_pos)
466
atk_editable_text_cut_text(gobj(), start_pos, end_pos);
469
void EditableText::delete_text(int start_pos, int end_pos)
471
atk_editable_text_delete_text(gobj(), start_pos, end_pos);
474
void EditableText::paste_text(int position)
476
atk_editable_text_paste_text(gobj(), position);
480
bool Atk::EditableText::set_run_attributes_vfunc(AtkAttributeSet* attrib_set, int start_offset, int end_offset)
482
BaseClassType *const base = static_cast<BaseClassType*>(
483
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
484
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
487
if(base && base->set_run_attributes)
488
return (*base->set_run_attributes)(gobj(),attrib_set,start_offset,end_offset);
493
void Atk::EditableText::set_text_contents_vfunc(const Glib::ustring& string)
495
BaseClassType *const base = static_cast<BaseClassType*>(
496
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
497
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
500
if(base && base->set_text_contents)
501
(*base->set_text_contents)(gobj(),string.c_str());
503
void Atk::EditableText::insert_text_vfunc(const Glib::ustring& string, int length, int& position)
505
BaseClassType *const base = static_cast<BaseClassType*>(
506
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
507
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
510
if(base && base->insert_text)
511
(*base->insert_text)(gobj(),string.c_str(),length,&position);
513
void Atk::EditableText::copy_text_vfunc(int start_pos, int end_pos)
515
BaseClassType *const base = static_cast<BaseClassType*>(
516
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
517
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
520
if(base && base->copy_text)
521
(*base->copy_text)(gobj(),start_pos,end_pos);
523
void Atk::EditableText::cut_text_vfunc(int start_pos, int end_pos)
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(gobject_), CppObjectType::get_type()) // Get the interface.
530
if(base && base->cut_text)
531
(*base->cut_text)(gobj(),start_pos,end_pos);
533
void Atk::EditableText::delete_text_vfunc(int start_pos, int end_pos)
535
BaseClassType *const base = static_cast<BaseClassType*>(
536
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
537
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
540
if(base && base->delete_text)
541
(*base->delete_text)(gobj(),start_pos,end_pos);
543
void Atk::EditableText::paste_text_vfunc(int position)
545
BaseClassType *const base = static_cast<BaseClassType*>(
546
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
547
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
550
if(base && base->paste_text)
551
(*base->paste_text)(gobj(),position);