fix for type error on 64 bit systems
[ardour.git] / libs / gtkmm2 / atk / atkmm / hyperlink.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3 #include <atkmm/hyperlink.h>
4 #include <atkmm/private/hyperlink_p.h>
5
6 // -*- c++ -*-
7 /* $Id$ */
8
9 /* Copyright 2003 The gtkmm Development Team
10  *
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.
15  *
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.
20  *
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.
24  */
25
26 #include <atkmm/object.h>
27 #include <atk/atkobject.h>
28 #include <atk/atkhyperlink.h>
29
30
31 namespace Atk
32 {
33
34 } // namespace Atk
35
36
37 namespace
38 {
39
40 const Glib::SignalProxyInfo Hyperlink_signal_link_activated_info =
41 {
42   "link_activated",
43   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
44   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
45 };
46
47 } // anonymous namespace
48
49
50 namespace Glib
51 {
52
53 Glib::RefPtr<Atk::Hyperlink> wrap(AtkHyperlink* object, bool take_copy)
54 {
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.
57 }
58
59 } /* namespace Glib */
60
61
62 namespace Atk
63 {
64
65
66 /* The *_Class implementation: */
67
68 const Glib::Class& Hyperlink_Class::init()
69 {
70   if(!gtype_) // create the GType if necessary
71   {
72     // Glib::Class has to know the class init function to clone custom types.
73     class_init_func_ = &Hyperlink_Class::class_init_function;
74
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();
78
79     // Create the wrapper type, with the same class/instance size as the base type.
80     register_derived_type(atk_hyperlink_get_type());
81
82     // Add derived versions of interfaces, if the C type implements any interfaces:
83   Action::add_interface(get_type());
84   }
85
86   return *this;
87 }
88
89 void Hyperlink_Class::class_init_function(void* g_class, void* class_data)
90 {
91   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
92   CppClassParent::class_init_function(klass, class_data);
93
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;
103 }
104
105 gchar* Hyperlink_Class::get_uri_vfunc_callback(AtkHyperlink* self, gint i)
106 {
107   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
108       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
109
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
114   // being overridden:
115   if(obj && obj->is_derived_())
116   {
117     try // Trap C++ exceptions which would normally be lost because this is a C callback.
118     {
119       // Call the virtual member method, which derived classes might override.
120       return obj->get_uri_vfunc(i
121 );
122     }
123     catch(...)
124     {
125       Glib::exception_handlers_invoke();
126     }
127   }
128   else
129   {
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).
132     );
133
134     // Call the original underlying C function:
135     if(base && base->get_uri)
136       return (*base->get_uri)(self, i);
137   }
138
139   typedef gchar* RType;
140   return RType();
141 }
142
143 AtkObject* Hyperlink_Class::get_object_vfunc_callback(AtkHyperlink* self, gint i)
144 {
145   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
146       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
147
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
152   // being overridden:
153   if(obj && obj->is_derived_())
154   {
155     try // Trap C++ exceptions which would normally be lost because this is a C callback.
156     {
157       // Call the virtual member method, which derived classes might override.
158       return Glib::unwrap(obj->get_object_vfunc(i
159 ));
160     }
161     catch(...)
162     {
163       Glib::exception_handlers_invoke();
164     }
165   }
166   else
167   {
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).
170     );
171
172     // Call the original underlying C function:
173     if(base && base->get_object)
174       return (*base->get_object)(self, i);
175   }
176
177   typedef AtkObject* RType;
178   return RType();
179 }
180
181 gint Hyperlink_Class::get_end_index_vfunc_callback(AtkHyperlink* self)
182 {
183   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
184       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
185
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
190   // being overridden:
191   if(obj && obj->is_derived_())
192   {
193     try // Trap C++ exceptions which would normally be lost because this is a C callback.
194     {
195       // Call the virtual member method, which derived classes might override.
196       return obj->get_end_index_vfunc();
197     }
198     catch(...)
199     {
200       Glib::exception_handlers_invoke();
201     }
202   }
203   else
204   {
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).
207     );
208
209     // Call the original underlying C function:
210     if(base && base->get_end_index)
211       return (*base->get_end_index)(self);
212   }
213
214   typedef gint RType;
215   return RType();
216 }
217
218 gint Hyperlink_Class::get_start_index_vfunc_callback(AtkHyperlink* self)
219 {
220   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
221       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
222
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
227   // being overridden:
228   if(obj && obj->is_derived_())
229   {
230     try // Trap C++ exceptions which would normally be lost because this is a C callback.
231     {
232       // Call the virtual member method, which derived classes might override.
233       return obj->get_start_index_vfunc();
234     }
235     catch(...)
236     {
237       Glib::exception_handlers_invoke();
238     }
239   }
240   else
241   {
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).
244     );
245
246     // Call the original underlying C function:
247     if(base && base->get_start_index)
248       return (*base->get_start_index)(self);
249   }
250
251   typedef gint RType;
252   return RType();
253 }
254
255 gboolean Hyperlink_Class::is_valid_vfunc_callback(AtkHyperlink* self)
256 {
257   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
258       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
259
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
264   // being overridden:
265   if(obj && obj->is_derived_())
266   {
267     try // Trap C++ exceptions which would normally be lost because this is a C callback.
268     {
269       // Call the virtual member method, which derived classes might override.
270       return static_cast<int>(obj->is_valid_vfunc());
271     }
272     catch(...)
273     {
274       Glib::exception_handlers_invoke();
275     }
276   }
277   else
278   {
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).
281     );
282
283     // Call the original underlying C function:
284     if(base && base->is_valid)
285       return (*base->is_valid)(self);
286   }
287
288   typedef gboolean RType;
289   return RType();
290 }
291
292 gint Hyperlink_Class::get_n_anchors_vfunc_callback(AtkHyperlink* self)
293 {
294   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
295       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
296
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
301   // being overridden:
302   if(obj && obj->is_derived_())
303   {
304     try // Trap C++ exceptions which would normally be lost because this is a C callback.
305     {
306       // Call the virtual member method, which derived classes might override.
307       return obj->get_n_anchors_vfunc();
308     }
309     catch(...)
310     {
311       Glib::exception_handlers_invoke();
312     }
313   }
314   else
315   {
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).
318     );
319
320     // Call the original underlying C function:
321     if(base && base->get_n_anchors)
322       return (*base->get_n_anchors)(self);
323   }
324
325   typedef gint RType;
326   return RType();
327 }
328
329 guint Hyperlink_Class::link_state_vfunc_callback(AtkHyperlink* self)
330 {
331   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
332       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
333
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
338   // being overridden:
339   if(obj && obj->is_derived_())
340   {
341     try // Trap C++ exceptions which would normally be lost because this is a C callback.
342     {
343       // Call the virtual member method, which derived classes might override.
344       return obj->link_state_vfunc();
345     }
346     catch(...)
347     {
348       Glib::exception_handlers_invoke();
349     }
350   }
351   else
352   {
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).
355     );
356
357     // Call the original underlying C function:
358     if(base && base->link_state)
359       return (*base->link_state)(self);
360   }
361
362   typedef guint RType;
363   return RType();
364 }
365
366 gboolean Hyperlink_Class::is_selected_link_vfunc_callback(AtkHyperlink* self)
367 {
368   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
369       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
370
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
375   // being overridden:
376   if(obj && obj->is_derived_())
377   {
378     try // Trap C++ exceptions which would normally be lost because this is a C callback.
379     {
380       // Call the virtual member method, which derived classes might override.
381       return static_cast<int>(obj->is_selected_link_vfunc());
382     }
383     catch(...)
384     {
385       Glib::exception_handlers_invoke();
386     }
387   }
388   else
389   {
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).
392     );
393
394     // Call the original underlying C function:
395     if(base && base->is_selected_link)
396       return (*base->is_selected_link)(self);
397   }
398
399   typedef gboolean RType;
400   return RType();
401 }
402
403
404 void Hyperlink_Class::link_activated_callback(AtkHyperlink* self)
405 {
406   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
407       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
408
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
413   // being overridden:
414   if(obj && obj->is_derived_())
415   {
416     try // Trap C++ exceptions which would normally be lost because this is a C callback.
417     {
418       // Call the virtual member method, which derived classes might override.
419       obj->on_link_activated();
420     }
421     catch(...)
422     {
423       Glib::exception_handlers_invoke();
424     }
425   }
426   else
427   {
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).
430     );
431
432     // Call the original underlying C function:
433     if(base && base->link_activated)
434       (*base->link_activated)(self);
435   }
436 }
437
438
439 Glib::ObjectBase* Hyperlink_Class::wrap_new(GObject* object)
440 {
441   return new Hyperlink((AtkHyperlink*)object);
442 }
443
444
445 /* The implementation: */
446
447 AtkHyperlink* Hyperlink::gobj_copy()
448 {
449   reference();
450   return gobj();
451 }
452
453 Hyperlink::Hyperlink(const Glib::ConstructParams& construct_params)
454 :
455   Glib::Object(construct_params)
456 {}
457
458 Hyperlink::Hyperlink(AtkHyperlink* castitem)
459 :
460   Glib::Object((GObject*)(castitem))
461 {}
462
463 Hyperlink::~Hyperlink()
464 {}
465
466
467 Hyperlink::CppClassType Hyperlink::hyperlink_class_; // initialize static member
468
469 GType Hyperlink::get_type()
470 {
471   return hyperlink_class_.init().get_type();
472 }
473
474 GType Hyperlink::get_base_type()
475 {
476   return atk_hyperlink_get_type();
477 }
478
479
480 Glib::ustring Hyperlink::get_uri(int i) const
481 {
482   return Glib::convert_return_gchar_ptr_to_ustring(atk_hyperlink_get_uri(const_cast<AtkHyperlink*>(gobj()), i));
483 }
484
485 Glib::RefPtr<Atk::Object> Hyperlink::get_object(int i)
486 {
487
488   Glib::RefPtr<Atk::Object> retvalue = Glib::wrap(atk_hyperlink_get_object(gobj(), i));
489
490   if(retvalue)
491     retvalue->reference(); //The function does not do a ref for us.
492   return retvalue;
493 }
494
495 Glib::RefPtr<const Atk::Object> Hyperlink::get_object(int i) const
496 {
497
498   Glib::RefPtr<const Atk::Object> retvalue = Glib::wrap(atk_hyperlink_get_object(const_cast<AtkHyperlink*>(gobj()), i));
499
500   if(retvalue)
501     retvalue->reference(); //The function does not do a ref for us.
502   return retvalue;
503 }
504
505 int Hyperlink::get_end_index() const
506 {
507   return atk_hyperlink_get_end_index(const_cast<AtkHyperlink*>(gobj()));
508 }
509
510 int Hyperlink::get_start_index() const
511 {
512   return atk_hyperlink_get_start_index(const_cast<AtkHyperlink*>(gobj()));
513 }
514
515 bool Hyperlink::is_valid() const
516 {
517   return atk_hyperlink_is_valid(const_cast<AtkHyperlink*>(gobj()));
518 }
519
520 bool Hyperlink::is_inline() const
521 {
522   return atk_hyperlink_is_inline(const_cast<AtkHyperlink*>(gobj()));
523 }
524
525 int Hyperlink::get_n_anchors() const
526 {
527   return atk_hyperlink_get_n_anchors(const_cast<AtkHyperlink*>(gobj()));
528 }
529
530 bool Hyperlink::is_selected_link() const
531 {
532   return atk_hyperlink_is_selected_link(const_cast<AtkHyperlink*>(gobj()));
533 }
534
535
536 Glib::SignalProxy0< void > Hyperlink::signal_link_activated()
537 {
538   return Glib::SignalProxy0< void >(this, &Hyperlink_signal_link_activated_info);
539 }
540
541
542 Glib::PropertyProxy_ReadOnly<bool> Hyperlink::property_selected_link() const
543 {
544   return Glib::PropertyProxy_ReadOnly<bool>(this, "selected-link");
545 }
546
547 Glib::PropertyProxy_ReadOnly<int> Hyperlink::property_number_of_anchors() const
548 {
549   return Glib::PropertyProxy_ReadOnly<int>(this, "number-of-anchors");
550 }
551
552 Glib::PropertyProxy_ReadOnly<int> Hyperlink::property_end_index() const
553 {
554   return Glib::PropertyProxy_ReadOnly<int>(this, "end-index");
555 }
556
557 Glib::PropertyProxy_ReadOnly<int> Hyperlink::property_start_index() const
558 {
559   return Glib::PropertyProxy_ReadOnly<int>(this, "start-index");
560 }
561
562
563 void Atk::Hyperlink::on_link_activated()
564 {
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).
567   );
568
569   if(base && base->link_activated)
570     (*base->link_activated)(gobj());
571 }
572
573
574 gchar* Atk::Hyperlink::get_uri_vfunc(int i) const
575 {
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).
578   );
579
580   if(base && base->get_uri)
581     return (*base->get_uri)(const_cast<AtkHyperlink*>(gobj()),i);
582
583   typedef gchar* RType;
584   return RType();
585 }
586
587 Glib::RefPtr<Atk::Object> Atk::Hyperlink::get_object_vfunc(int i) 
588 {
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).
591   );
592
593   if(base && base->get_object)
594     return Glib::wrap((*base->get_object)(gobj(),i));
595
596   typedef Glib::RefPtr<Atk::Object> RType;
597   return RType();
598 }
599
600 int Atk::Hyperlink::get_end_index_vfunc() const
601 {
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).
604   );
605
606   if(base && base->get_end_index)
607     return (*base->get_end_index)(const_cast<AtkHyperlink*>(gobj()));
608
609   typedef int RType;
610   return RType();
611 }
612
613 int Atk::Hyperlink::get_start_index_vfunc() const
614 {
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).
617   );
618
619   if(base && base->get_start_index)
620     return (*base->get_start_index)(const_cast<AtkHyperlink*>(gobj()));
621
622   typedef int RType;
623   return RType();
624 }
625
626 bool Atk::Hyperlink::is_valid_vfunc() const
627 {
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).
630   );
631
632   if(base && base->is_valid)
633     return (*base->is_valid)(const_cast<AtkHyperlink*>(gobj()));
634
635   typedef bool RType;
636   return RType();
637 }
638
639 int Atk::Hyperlink::get_n_anchors_vfunc() const
640 {
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).
643   );
644
645   if(base && base->get_n_anchors)
646     return (*base->get_n_anchors)(const_cast<AtkHyperlink*>(gobj()));
647
648   typedef int RType;
649   return RType();
650 }
651
652 guint Atk::Hyperlink::link_state_vfunc() const
653 {
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).
656   );
657
658   if(base && base->link_state)
659     return (*base->link_state)(const_cast<AtkHyperlink*>(gobj()));
660
661   typedef guint RType;
662   return RType();
663 }
664
665 bool Atk::Hyperlink::is_selected_link_vfunc() const
666 {
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).
669   );
670
671   if(base && base->is_selected_link)
672     return (*base->is_selected_link)(const_cast<AtkHyperlink*>(gobj()));
673
674   typedef bool RType;
675   return RType();
676 }
677
678
679 } // namespace Atk
680
681