1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <atkmm/implementor.h>
5 #include <atkmm/private/implementor_p.h>
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 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/atkobject.h>
33 } // anonymous namespace
39 Glib::RefPtr<Atk::Implementor> wrap(AtkImplementor* object, bool take_copy)
41 return Glib::RefPtr<Atk::Implementor>( dynamic_cast<Atk::Implementor*> (Glib::wrap_auto_interface<Atk::Implementor> ((GObject*)(object), take_copy)) );
42 //We use dynamic_cast<> in case of multiple inheritance.
52 /* The *_Class implementation: */
54 const Glib::Interface_Class& Implementor_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_ = &Implementor_Class::iface_init_function;
62 // We can not derive from another interface, and it is not necessary anyway.
63 gtype_ = atk_implementor_get_type();
69 void Implementor_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 #ifdef GLIBMM_VFUNCS_ENABLED
78 klass->ref_accessible = &ref_accessible_vfunc_callback;
79 #endif //GLIBMM_VFUNCS_ENABLED
81 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
82 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
85 #ifdef GLIBMM_VFUNCS_ENABLED
86 AtkObject* Implementor_Class::ref_accessible_vfunc_callback(AtkImplementor* self)
88 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
89 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
91 // Non-gtkmmproc-generated custom classes implicitly call the default
92 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
93 // generated classes can use this optimisation, which avoids the unnecessary
94 // parameter conversions if there is no possibility of the virtual function
96 if(obj_base && obj_base->is_derived_())
98 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
99 if(obj) // This can be NULL during destruction.
101 #ifdef GLIBMM_EXCEPTIONS_ENABLED
102 try // Trap C++ exceptions which would normally be lost because this is a C callback.
104 #endif //GLIBMM_EXCEPTIONS_ENABLED
105 // Call the virtual member method, which derived classes might override.
106 return Glib::unwrap(obj->ref_accessibile_vfunc());
107 #ifdef GLIBMM_EXCEPTIONS_ENABLED
111 Glib::exception_handlers_invoke();
113 #endif //GLIBMM_EXCEPTIONS_ENABLED
117 BaseClassType *const base = static_cast<BaseClassType*>(
118 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
119 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
122 // Call the original underlying C function:
123 if(base && base->ref_accessible)
124 return (*base->ref_accessible)(self);
127 typedef AtkObject* RType;
130 #endif //GLIBMM_VFUNCS_ENABLED
132 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
133 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
136 Glib::ObjectBase* Implementor_Class::wrap_new(GObject* object)
138 return new Implementor((AtkImplementor*)(object));
142 /* The implementation: */
144 Implementor::Implementor()
146 Glib::Interface(implementor_class_.init())
149 Implementor::Implementor(AtkImplementor* castitem)
151 Glib::Interface((GObject*)(castitem))
154 Implementor::~Implementor()
158 void Implementor::add_interface(GType gtype_implementer)
160 implementor_class_.init().add_interface(gtype_implementer);
163 Implementor::CppClassType Implementor::implementor_class_; // initialize static member
165 GType Implementor::get_type()
167 return implementor_class_.init().get_type();
170 GType Implementor::get_base_type()
172 return atk_implementor_get_type();
176 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
177 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
179 #ifdef GLIBMM_VFUNCS_ENABLED
180 Glib::RefPtr<Object> Atk::Implementor::ref_accessibile_vfunc()
182 BaseClassType *const base = static_cast<BaseClassType*>(
183 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
184 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
187 if(base && base->ref_accessible)
188 return Glib::wrap((*base->ref_accessible)(gobj()), true);
190 typedef Glib::RefPtr<Object> RType;
193 #endif //GLIBMM_VFUNCS_ENABLED