1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <atkmm/document.h>
5 #include <atkmm/private/document_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/atkdocument.h>
40 } // anonymous namespace
46 Glib::RefPtr<Atk::Document> wrap(AtkDocument* object, bool take_copy)
48 return Glib::RefPtr<Atk::Document>( dynamic_cast<Atk::Document*> (Glib::wrap_auto_interface<Atk::Document> ((GObject*)(object), take_copy)) );
49 //We use dynamic_cast<> in case of multiple inheritance.
59 /* The *_Class implementation: */
61 const Glib::Interface_Class& Document_Class::init()
63 if(!gtype_) // create the GType if necessary
65 // Glib::Interface_Class has to know the interface init function
66 // in order to add interfaces to implementing types.
67 class_init_func_ = &Document_Class::iface_init_function;
69 // We can not derive from another interface, and it is not necessary anyway.
70 gtype_ = atk_document_get_type();
76 void Document_Class::iface_init_function(void* g_iface, void*)
78 BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
80 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
81 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
84 #ifdef GLIBMM_VFUNCS_ENABLED
85 klass->get_document_type = &get_document_type_vfunc_callback;
86 klass->get_document = &get_document_vfunc_callback;
87 #endif //GLIBMM_VFUNCS_ENABLED
89 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
90 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
93 #ifdef GLIBMM_VFUNCS_ENABLED
94 const gchar* Document_Class::get_document_type_vfunc_callback(AtkDocument* self)
96 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
97 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
99 // Non-gtkmmproc-generated custom classes implicitly call the default
100 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
101 // generated classes can use this optimisation, which avoids the unnecessary
102 // parameter conversions if there is no possibility of the virtual function
104 if(obj_base && obj_base->is_derived_())
106 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
107 if(obj) // This can be NULL during destruction.
109 #ifdef GLIBMM_EXCEPTIONS_ENABLED
110 try // Trap C++ exceptions which would normally be lost because this is a C callback.
112 #endif //GLIBMM_EXCEPTIONS_ENABLED
113 // Call the virtual member method, which derived classes might override.
114 return obj->get_document_type_vfunc();
115 #ifdef GLIBMM_EXCEPTIONS_ENABLED
119 Glib::exception_handlers_invoke();
121 #endif //GLIBMM_EXCEPTIONS_ENABLED
125 BaseClassType *const base = static_cast<BaseClassType*>(
126 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
127 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
130 // Call the original underlying C function:
131 if(base && base->get_document_type)
132 return (*base->get_document_type)(self);
135 typedef const gchar* RType;
138 gpointer Document_Class::get_document_vfunc_callback(AtkDocument* self)
140 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
141 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
143 // Non-gtkmmproc-generated custom classes implicitly call the default
144 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
145 // generated classes can use this optimisation, which avoids the unnecessary
146 // parameter conversions if there is no possibility of the virtual function
148 if(obj_base && obj_base->is_derived_())
150 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
151 if(obj) // This can be NULL during destruction.
153 #ifdef GLIBMM_EXCEPTIONS_ENABLED
154 try // Trap C++ exceptions which would normally be lost because this is a C callback.
156 #endif //GLIBMM_EXCEPTIONS_ENABLED
157 // Call the virtual member method, which derived classes might override.
158 return obj->get_document_vfunc();
159 #ifdef GLIBMM_EXCEPTIONS_ENABLED
163 Glib::exception_handlers_invoke();
165 #endif //GLIBMM_EXCEPTIONS_ENABLED
169 BaseClassType *const base = static_cast<BaseClassType*>(
170 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
171 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
174 // Call the original underlying C function:
175 if(base && base->get_document)
176 return (*base->get_document)(self);
179 typedef gpointer RType;
182 #endif //GLIBMM_VFUNCS_ENABLED
184 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
185 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
188 Glib::ObjectBase* Document_Class::wrap_new(GObject* object)
190 return new Document((AtkDocument*)(object));
194 /* The implementation: */
198 Glib::Interface(document_class_.init())
201 Document::Document(AtkDocument* castitem)
203 Glib::Interface((GObject*)(castitem))
206 Document::~Document()
210 void Document::add_interface(GType gtype_implementer)
212 document_class_.init().add_interface(gtype_implementer);
215 Document::CppClassType Document::document_class_; // initialize static member
217 GType Document::get_type()
219 return document_class_.init().get_type();
222 GType Document::get_base_type()
224 return atk_document_get_type();
228 Glib::ustring Document::get_document_type() const
230 return Glib::convert_const_gchar_ptr_to_ustring(atk_document_get_document_type(const_cast<AtkDocument*>(gobj())));
233 gpointer Document::get_document()
235 return atk_document_get_document(gobj());
239 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
240 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
242 #ifdef GLIBMM_VFUNCS_ENABLED
243 const gchar* Atk::Document::get_document_type_vfunc()
245 BaseClassType *const base = static_cast<BaseClassType*>(
246 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
247 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
250 if(base && base->get_document_type)
251 return (*base->get_document_type)(gobj());
253 typedef const gchar* RType;
256 gpointer Atk::Document::get_document_vfunc() const
258 BaseClassType *const base = static_cast<BaseClassType*>(
259 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
260 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
263 if(base && base->get_document)
264 return (*base->get_document)(const_cast<AtkDocument*>(gobj()));
266 typedef gpointer RType;
269 #endif //GLIBMM_VFUNCS_ENABLED