1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <atkmm/hypertext.h>
5 #include <atkmm/private/hypertext_p.h>
10 /* Copyright 2003 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 Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 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 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library 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/atkhypertext.h>
42 static void Hypertext_signal_link_selected_callback(AtkHypertext* self, gint p0,void* data)
45 typedef sigc::slot< void,int > SlotType;
47 // Do not try to call a signal on a disassociated wrapper.
48 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
50 #ifdef GLIBMM_EXCEPTIONS_ENABLED
53 #endif //GLIBMM_EXCEPTIONS_ENABLED
54 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
55 (*static_cast<SlotType*>(slot))(p0
57 #ifdef GLIBMM_EXCEPTIONS_ENABLED
61 Glib::exception_handlers_invoke();
63 #endif //GLIBMM_EXCEPTIONS_ENABLED
67 static const Glib::SignalProxyInfo Hypertext_signal_link_selected_info =
70 (GCallback) &Hypertext_signal_link_selected_callback,
71 (GCallback) &Hypertext_signal_link_selected_callback
75 } // anonymous namespace
81 Glib::RefPtr<Atk::Hypertext> wrap(AtkHypertext* object, bool take_copy)
83 return Glib::RefPtr<Atk::Hypertext>( dynamic_cast<Atk::Hypertext*> (Glib::wrap_auto_interface<Atk::Hypertext> ((GObject*)(object), take_copy)) );
84 //We use dynamic_cast<> in case of multiple inheritance.
94 /* The *_Class implementation: */
96 const Glib::Interface_Class& Hypertext_Class::init()
98 if(!gtype_) // create the GType if necessary
100 // Glib::Interface_Class has to know the interface init function
101 // in order to add interfaces to implementing types.
102 class_init_func_ = &Hypertext_Class::iface_init_function;
104 // We can not derive from another interface, and it is not necessary anyway.
105 gtype_ = atk_hypertext_get_type();
111 void Hypertext_Class::iface_init_function(void* g_iface, void*)
113 BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
115 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
116 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
117 g_assert(klass != 0);
119 #ifdef GLIBMM_VFUNCS_ENABLED
120 klass->get_link = &get_link_vfunc_callback;
121 klass->get_n_links = &get_n_links_vfunc_callback;
122 klass->get_link_index = &get_link_index_vfunc_callback;
123 #endif //GLIBMM_VFUNCS_ENABLED
125 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
126 klass->link_selected = &link_selected_callback;
127 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
130 #ifdef GLIBMM_VFUNCS_ENABLED
131 AtkHyperlink* Hypertext_Class::get_link_vfunc_callback(AtkHypertext* self, gint link_index)
133 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
134 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
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
141 if(obj_base && obj_base->is_derived_())
143 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
144 if(obj) // This can be NULL during destruction.
146 #ifdef GLIBMM_EXCEPTIONS_ENABLED
147 try // Trap C++ exceptions which would normally be lost because this is a C callback.
149 #endif //GLIBMM_EXCEPTIONS_ENABLED
150 // Call the virtual member method, which derived classes might override.
151 return Glib::unwrap(obj->get_link_vfunc(link_index
153 #ifdef GLIBMM_EXCEPTIONS_ENABLED
157 Glib::exception_handlers_invoke();
159 #endif //GLIBMM_EXCEPTIONS_ENABLED
163 BaseClassType *const base = static_cast<BaseClassType*>(
164 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
165 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
168 // Call the original underlying C function:
169 if(base && base->get_link)
170 return (*base->get_link)(self, link_index);
173 typedef AtkHyperlink* RType;
176 gint Hypertext_Class::get_n_links_vfunc_callback(AtkHypertext* self)
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 return obj->get_n_links_vfunc();
197 #ifdef GLIBMM_EXCEPTIONS_ENABLED
201 Glib::exception_handlers_invoke();
203 #endif //GLIBMM_EXCEPTIONS_ENABLED
207 BaseClassType *const base = static_cast<BaseClassType*>(
208 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
209 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
212 // Call the original underlying C function:
213 if(base && base->get_n_links)
214 return (*base->get_n_links)(self);
220 gint Hypertext_Class::get_link_index_vfunc_callback(AtkHypertext* self, gint char_index)
222 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
223 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
225 // Non-gtkmmproc-generated custom classes implicitly call the default
226 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
227 // generated classes can use this optimisation, which avoids the unnecessary
228 // parameter conversions if there is no possibility of the virtual function
230 if(obj_base && obj_base->is_derived_())
232 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
233 if(obj) // This can be NULL during destruction.
235 #ifdef GLIBMM_EXCEPTIONS_ENABLED
236 try // Trap C++ exceptions which would normally be lost because this is a C callback.
238 #endif //GLIBMM_EXCEPTIONS_ENABLED
239 // Call the virtual member method, which derived classes might override.
240 return obj->get_link_index_vfunc(char_index
242 #ifdef GLIBMM_EXCEPTIONS_ENABLED
246 Glib::exception_handlers_invoke();
248 #endif //GLIBMM_EXCEPTIONS_ENABLED
252 BaseClassType *const base = static_cast<BaseClassType*>(
253 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
254 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
257 // Call the original underlying C function:
258 if(base && base->get_link_index)
259 return (*base->get_link_index)(self, char_index);
265 #endif //GLIBMM_VFUNCS_ENABLED
267 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
268 void Hypertext_Class::link_selected_callback(AtkHypertext* self, gint p0)
270 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
271 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
273 // Non-gtkmmproc-generated custom classes implicitly call the default
274 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
275 // generated classes can use this optimisation, which avoids the unnecessary
276 // parameter conversions if there is no possibility of the virtual function
278 if(obj_base && obj_base->is_derived_())
280 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
281 if(obj) // This can be NULL during destruction.
283 #ifdef GLIBMM_EXCEPTIONS_ENABLED
284 try // Trap C++ exceptions which would normally be lost because this is a C callback.
286 #endif //GLIBMM_EXCEPTIONS_ENABLED
287 // Call the virtual member method, which derived classes might override.
288 obj->on_link_selected(p0
291 #ifdef GLIBMM_EXCEPTIONS_ENABLED
295 Glib::exception_handlers_invoke();
297 #endif //GLIBMM_EXCEPTIONS_ENABLED
301 BaseClassType *const base = static_cast<BaseClassType*>(
302 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
303 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
306 // Call the original underlying C function:
307 if(base && base->link_selected)
308 (*base->link_selected)(self, p0);
310 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
313 Glib::ObjectBase* Hypertext_Class::wrap_new(GObject* object)
315 return new Hypertext((AtkHypertext*)(object));
319 /* The implementation: */
321 Hypertext::Hypertext()
323 Glib::Interface(hypertext_class_.init())
326 Hypertext::Hypertext(AtkHypertext* castitem)
328 Glib::Interface((GObject*)(castitem))
331 Hypertext::~Hypertext()
335 void Hypertext::add_interface(GType gtype_implementer)
337 hypertext_class_.init().add_interface(gtype_implementer);
340 Hypertext::CppClassType Hypertext::hypertext_class_; // initialize static member
342 GType Hypertext::get_type()
344 return hypertext_class_.init().get_type();
347 GType Hypertext::get_base_type()
349 return atk_hypertext_get_type();
353 Glib::RefPtr<Hyperlink> Hypertext::get_link(int link_index)
355 return Glib::wrap(atk_hypertext_get_link(gobj(), link_index));
358 Glib::RefPtr<const Hyperlink> Hypertext::get_link(int link_index) const
360 return const_cast<Hypertext*>(this)->get_link(link_index);
363 int Hypertext::get_n_links() const
365 return atk_hypertext_get_n_links(const_cast<AtkHypertext*>(gobj()));
368 int Hypertext::get_link_index(int char_index) const
370 return atk_hypertext_get_link_index(const_cast<AtkHypertext*>(gobj()), char_index);
374 Glib::SignalProxy1< void,int > Hypertext::signal_link_selected()
376 return Glib::SignalProxy1< void,int >(this, &Hypertext_signal_link_selected_info);
380 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
381 void Atk::Hypertext::on_link_selected(int link_index)
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(gobject_), CppObjectType::get_type()) // Get the interface.
388 if(base && base->link_selected)
389 (*base->link_selected)(gobj(),link_index);
391 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
393 #ifdef GLIBMM_VFUNCS_ENABLED
394 Glib::RefPtr<Hyperlink> Atk::Hypertext::get_link_vfunc(int link_index)
396 BaseClassType *const base = static_cast<BaseClassType*>(
397 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
398 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
401 if(base && base->get_link)
402 return Glib::wrap((*base->get_link)(gobj(),link_index));
404 typedef Glib::RefPtr<Hyperlink> RType;
407 int Atk::Hypertext::get_n_links_vfunc() const
409 BaseClassType *const base = static_cast<BaseClassType*>(
410 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
411 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
414 if(base && base->get_n_links)
415 return (*base->get_n_links)(const_cast<AtkHypertext*>(gobj()));
420 int Atk::Hypertext::get_link_index_vfunc(int char_index) const
422 BaseClassType *const base = static_cast<BaseClassType*>(
423 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
424 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
427 if(base && base->get_link_index)
428 return (*base->get_link_index)(const_cast<AtkHypertext*>(gobj()),char_index);
433 #endif //GLIBMM_VFUNCS_ENABLED