1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <atkmm/hyperlink.h>
4 #include <atkmm/private/hyperlink_p.h>
9 /* Copyright 2003 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/atkobject.h>
28 #include <atk/atkhyperlink.h>
40 const Glib::SignalProxyInfo Hyperlink_signal_link_activated_info =
43 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
44 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
47 } // anonymous namespace
53 Glib::RefPtr<Atk::Hyperlink> wrap(AtkHyperlink* object, bool take_copy)
55 return Glib::RefPtr<Atk::Hyperlink>( dynamic_cast<Atk::Hyperlink*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
56 //We use dynamic_cast<> in case of multiple inheritance.
59 } /* namespace Glib */
66 /* The *_Class implementation: */
68 const Glib::Class& Hyperlink_Class::init()
70 if(!gtype_) // create the GType if necessary
72 // Glib::Class has to know the class init function to clone custom types.
73 class_init_func_ = &Hyperlink_Class::class_init_function;
75 // This is actually just optimized away, apparently with no harm.
76 // Make sure that the parent type has been created.
77 //CppClassParent::CppObjectType::get_type();
79 // Create the wrapper type, with the same class/instance size as the base type.
80 register_derived_type(atk_hyperlink_get_type());
82 // Add derived versions of interfaces, if the C type implements any interfaces:
83 Action::add_interface(get_type());
89 void Hyperlink_Class::class_init_function(void* g_class, void* class_data)
91 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
92 CppClassParent::class_init_function(klass, class_data);
94 klass->get_uri = &get_uri_vfunc_callback;
95 klass->get_object = &get_object_vfunc_callback;
96 klass->get_end_index = &get_end_index_vfunc_callback;
97 klass->get_start_index = &get_start_index_vfunc_callback;
98 klass->is_valid = &is_valid_vfunc_callback;
99 klass->get_n_anchors = &get_n_anchors_vfunc_callback;
100 klass->link_state = &link_state_vfunc_callback;
101 klass->is_selected_link = &is_selected_link_vfunc_callback;
102 klass->link_activated = &link_activated_callback;
105 gchar* Hyperlink_Class::get_uri_vfunc_callback(AtkHyperlink* self, gint i)
107 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
108 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
110 // Non-gtkmmproc-generated custom classes implicitly call the default
111 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
112 // generated classes can use this optimisation, which avoids the unnecessary
113 // parameter conversions if there is no possibility of the virtual function
115 if(obj && obj->is_derived_())
117 try // Trap C++ exceptions which would normally be lost because this is a C callback.
119 // Call the virtual member method, which derived classes might override.
120 return obj->get_uri_vfunc(i
125 Glib::exception_handlers_invoke();
130 BaseClassType *const base = static_cast<BaseClassType*>(
131 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
134 // Call the original underlying C function:
135 if(base && base->get_uri)
136 return (*base->get_uri)(self, i);
139 typedef gchar* RType;
143 AtkObject* Hyperlink_Class::get_object_vfunc_callback(AtkHyperlink* self, gint i)
145 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
146 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
148 // Non-gtkmmproc-generated custom classes implicitly call the default
149 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
150 // generated classes can use this optimisation, which avoids the unnecessary
151 // parameter conversions if there is no possibility of the virtual function
153 if(obj && obj->is_derived_())
155 try // Trap C++ exceptions which would normally be lost because this is a C callback.
157 // Call the virtual member method, which derived classes might override.
158 return Glib::unwrap(obj->get_object_vfunc(i
163 Glib::exception_handlers_invoke();
168 BaseClassType *const base = static_cast<BaseClassType*>(
169 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
172 // Call the original underlying C function:
173 if(base && base->get_object)
174 return (*base->get_object)(self, i);
177 typedef AtkObject* RType;
181 gint Hyperlink_Class::get_end_index_vfunc_callback(AtkHyperlink* self)
183 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
184 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
186 // Non-gtkmmproc-generated custom classes implicitly call the default
187 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
188 // generated classes can use this optimisation, which avoids the unnecessary
189 // parameter conversions if there is no possibility of the virtual function
191 if(obj && obj->is_derived_())
193 try // Trap C++ exceptions which would normally be lost because this is a C callback.
195 // Call the virtual member method, which derived classes might override.
196 return obj->get_end_index_vfunc();
200 Glib::exception_handlers_invoke();
205 BaseClassType *const base = static_cast<BaseClassType*>(
206 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
209 // Call the original underlying C function:
210 if(base && base->get_end_index)
211 return (*base->get_end_index)(self);
218 gint Hyperlink_Class::get_start_index_vfunc_callback(AtkHyperlink* self)
220 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
221 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
223 // Non-gtkmmproc-generated custom classes implicitly call the default
224 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
225 // generated classes can use this optimisation, which avoids the unnecessary
226 // parameter conversions if there is no possibility of the virtual function
228 if(obj && obj->is_derived_())
230 try // Trap C++ exceptions which would normally be lost because this is a C callback.
232 // Call the virtual member method, which derived classes might override.
233 return obj->get_start_index_vfunc();
237 Glib::exception_handlers_invoke();
242 BaseClassType *const base = static_cast<BaseClassType*>(
243 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
246 // Call the original underlying C function:
247 if(base && base->get_start_index)
248 return (*base->get_start_index)(self);
255 gboolean Hyperlink_Class::is_valid_vfunc_callback(AtkHyperlink* self)
257 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
258 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
260 // Non-gtkmmproc-generated custom classes implicitly call the default
261 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
262 // generated classes can use this optimisation, which avoids the unnecessary
263 // parameter conversions if there is no possibility of the virtual function
265 if(obj && obj->is_derived_())
267 try // Trap C++ exceptions which would normally be lost because this is a C callback.
269 // Call the virtual member method, which derived classes might override.
270 return static_cast<int>(obj->is_valid_vfunc());
274 Glib::exception_handlers_invoke();
279 BaseClassType *const base = static_cast<BaseClassType*>(
280 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
283 // Call the original underlying C function:
284 if(base && base->is_valid)
285 return (*base->is_valid)(self);
288 typedef gboolean RType;
292 gint Hyperlink_Class::get_n_anchors_vfunc_callback(AtkHyperlink* self)
294 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
295 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
297 // Non-gtkmmproc-generated custom classes implicitly call the default
298 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
299 // generated classes can use this optimisation, which avoids the unnecessary
300 // parameter conversions if there is no possibility of the virtual function
302 if(obj && obj->is_derived_())
304 try // Trap C++ exceptions which would normally be lost because this is a C callback.
306 // Call the virtual member method, which derived classes might override.
307 return obj->get_n_anchors_vfunc();
311 Glib::exception_handlers_invoke();
316 BaseClassType *const base = static_cast<BaseClassType*>(
317 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
320 // Call the original underlying C function:
321 if(base && base->get_n_anchors)
322 return (*base->get_n_anchors)(self);
329 guint Hyperlink_Class::link_state_vfunc_callback(AtkHyperlink* self)
331 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
332 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
334 // Non-gtkmmproc-generated custom classes implicitly call the default
335 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
336 // generated classes can use this optimisation, which avoids the unnecessary
337 // parameter conversions if there is no possibility of the virtual function
339 if(obj && obj->is_derived_())
341 try // Trap C++ exceptions which would normally be lost because this is a C callback.
343 // Call the virtual member method, which derived classes might override.
344 return obj->link_state_vfunc();
348 Glib::exception_handlers_invoke();
353 BaseClassType *const base = static_cast<BaseClassType*>(
354 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
357 // Call the original underlying C function:
358 if(base && base->link_state)
359 return (*base->link_state)(self);
366 gboolean Hyperlink_Class::is_selected_link_vfunc_callback(AtkHyperlink* self)
368 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
369 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
371 // Non-gtkmmproc-generated custom classes implicitly call the default
372 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
373 // generated classes can use this optimisation, which avoids the unnecessary
374 // parameter conversions if there is no possibility of the virtual function
376 if(obj && obj->is_derived_())
378 try // Trap C++ exceptions which would normally be lost because this is a C callback.
380 // Call the virtual member method, which derived classes might override.
381 return static_cast<int>(obj->is_selected_link_vfunc());
385 Glib::exception_handlers_invoke();
390 BaseClassType *const base = static_cast<BaseClassType*>(
391 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
394 // Call the original underlying C function:
395 if(base && base->is_selected_link)
396 return (*base->is_selected_link)(self);
399 typedef gboolean RType;
404 void Hyperlink_Class::link_activated_callback(AtkHyperlink* self)
406 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
407 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
409 // Non-gtkmmproc-generated custom classes implicitly call the default
410 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
411 // generated classes can use this optimisation, which avoids the unnecessary
412 // parameter conversions if there is no possibility of the virtual function
414 if(obj && obj->is_derived_())
416 try // Trap C++ exceptions which would normally be lost because this is a C callback.
418 // Call the virtual member method, which derived classes might override.
419 obj->on_link_activated();
423 Glib::exception_handlers_invoke();
428 BaseClassType *const base = static_cast<BaseClassType*>(
429 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
432 // Call the original underlying C function:
433 if(base && base->link_activated)
434 (*base->link_activated)(self);
439 Glib::ObjectBase* Hyperlink_Class::wrap_new(GObject* object)
441 return new Hyperlink((AtkHyperlink*)object);
445 /* The implementation: */
447 AtkHyperlink* Hyperlink::gobj_copy()
453 Hyperlink::Hyperlink(const Glib::ConstructParams& construct_params)
455 Glib::Object(construct_params)
458 Hyperlink::Hyperlink(AtkHyperlink* castitem)
460 Glib::Object((GObject*)(castitem))
463 Hyperlink::~Hyperlink()
467 Hyperlink::CppClassType Hyperlink::hyperlink_class_; // initialize static member
469 GType Hyperlink::get_type()
471 return hyperlink_class_.init().get_type();
474 GType Hyperlink::get_base_type()
476 return atk_hyperlink_get_type();
480 Glib::ustring Hyperlink::get_uri(int i) const
482 return Glib::convert_return_gchar_ptr_to_ustring(atk_hyperlink_get_uri(const_cast<AtkHyperlink*>(gobj()), i));
485 Glib::RefPtr<Atk::Object> Hyperlink::get_object(int i)
488 Glib::RefPtr<Atk::Object> retvalue = Glib::wrap(atk_hyperlink_get_object(gobj(), i));
491 retvalue->reference(); //The function does not do a ref for us.
495 Glib::RefPtr<const Atk::Object> Hyperlink::get_object(int i) const
498 Glib::RefPtr<const Atk::Object> retvalue = Glib::wrap(atk_hyperlink_get_object(const_cast<AtkHyperlink*>(gobj()), i));
501 retvalue->reference(); //The function does not do a ref for us.
505 int Hyperlink::get_end_index() const
507 return atk_hyperlink_get_end_index(const_cast<AtkHyperlink*>(gobj()));
510 int Hyperlink::get_start_index() const
512 return atk_hyperlink_get_start_index(const_cast<AtkHyperlink*>(gobj()));
515 bool Hyperlink::is_valid() const
517 return atk_hyperlink_is_valid(const_cast<AtkHyperlink*>(gobj()));
520 bool Hyperlink::is_inline() const
522 return atk_hyperlink_is_inline(const_cast<AtkHyperlink*>(gobj()));
525 int Hyperlink::get_n_anchors() const
527 return atk_hyperlink_get_n_anchors(const_cast<AtkHyperlink*>(gobj()));
530 bool Hyperlink::is_selected_link() const
532 return atk_hyperlink_is_selected_link(const_cast<AtkHyperlink*>(gobj()));
536 Glib::SignalProxy0< void > Hyperlink::signal_link_activated()
538 return Glib::SignalProxy0< void >(this, &Hyperlink_signal_link_activated_info);
542 Glib::PropertyProxy_ReadOnly<bool> Hyperlink::property_selected_link() const
544 return Glib::PropertyProxy_ReadOnly<bool>(this, "selected-link");
547 Glib::PropertyProxy_ReadOnly<int> Hyperlink::property_number_of_anchors() const
549 return Glib::PropertyProxy_ReadOnly<int>(this, "number-of-anchors");
552 Glib::PropertyProxy_ReadOnly<int> Hyperlink::property_end_index() const
554 return Glib::PropertyProxy_ReadOnly<int>(this, "end-index");
557 Glib::PropertyProxy_ReadOnly<int> Hyperlink::property_start_index() const
559 return Glib::PropertyProxy_ReadOnly<int>(this, "start-index");
563 void Atk::Hyperlink::on_link_activated()
565 BaseClassType *const base = static_cast<BaseClassType*>(
566 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
569 if(base && base->link_activated)
570 (*base->link_activated)(gobj());
574 gchar* Atk::Hyperlink::get_uri_vfunc(int i) const
576 BaseClassType *const base = static_cast<BaseClassType*>(
577 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
580 if(base && base->get_uri)
581 return (*base->get_uri)(const_cast<AtkHyperlink*>(gobj()),i);
583 typedef gchar* RType;
587 Glib::RefPtr<Atk::Object> Atk::Hyperlink::get_object_vfunc(int i)
589 BaseClassType *const base = static_cast<BaseClassType*>(
590 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
593 if(base && base->get_object)
594 return Glib::wrap((*base->get_object)(gobj(),i));
596 typedef Glib::RefPtr<Atk::Object> RType;
600 int Atk::Hyperlink::get_end_index_vfunc() const
602 BaseClassType *const base = static_cast<BaseClassType*>(
603 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
606 if(base && base->get_end_index)
607 return (*base->get_end_index)(const_cast<AtkHyperlink*>(gobj()));
613 int Atk::Hyperlink::get_start_index_vfunc() const
615 BaseClassType *const base = static_cast<BaseClassType*>(
616 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
619 if(base && base->get_start_index)
620 return (*base->get_start_index)(const_cast<AtkHyperlink*>(gobj()));
626 bool Atk::Hyperlink::is_valid_vfunc() const
628 BaseClassType *const base = static_cast<BaseClassType*>(
629 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
632 if(base && base->is_valid)
633 return (*base->is_valid)(const_cast<AtkHyperlink*>(gobj()));
639 int Atk::Hyperlink::get_n_anchors_vfunc() const
641 BaseClassType *const base = static_cast<BaseClassType*>(
642 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
645 if(base && base->get_n_anchors)
646 return (*base->get_n_anchors)(const_cast<AtkHyperlink*>(gobj()));
652 guint Atk::Hyperlink::link_state_vfunc() const
654 BaseClassType *const base = static_cast<BaseClassType*>(
655 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
658 if(base && base->link_state)
659 return (*base->link_state)(const_cast<AtkHyperlink*>(gobj()));
665 bool Atk::Hyperlink::is_selected_link_vfunc() const
667 BaseClassType *const base = static_cast<BaseClassType*>(
668 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
671 if(base && base->is_selected_link)
672 return (*base->is_selected_link)(const_cast<AtkHyperlink*>(gobj()));