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 ((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 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
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 && obj->is_derived_())
106 #ifdef GLIBMM_EXCEPTIONS_ENABLED
107 try // Trap C++ exceptions which would normally be lost because this is a C callback.
109 #endif //GLIBMM_EXCEPTIONS_ENABLED
110 // Call the virtual member method, which derived classes might override.
111 return obj->get_document_type_vfunc();
112 #ifdef GLIBMM_EXCEPTIONS_ENABLED
116 Glib::exception_handlers_invoke();
118 #endif //GLIBMM_EXCEPTIONS_ENABLED
122 BaseClassType *const base = static_cast<BaseClassType*>(
123 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
124 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
127 // Call the original underlying C function:
128 if(base && base->get_document_type)
129 return (*base->get_document_type)(self);
132 typedef const gchar* RType;
135 gpointer Document_Class::get_document_vfunc_callback(AtkDocument* self)
137 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
138 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
140 // Non-gtkmmproc-generated custom classes implicitly call the default
141 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
142 // generated classes can use this optimisation, which avoids the unnecessary
143 // parameter conversions if there is no possibility of the virtual function
145 if(obj && obj->is_derived_())
147 #ifdef GLIBMM_EXCEPTIONS_ENABLED
148 try // Trap C++ exceptions which would normally be lost because this is a C callback.
150 #endif //GLIBMM_EXCEPTIONS_ENABLED
151 // Call the virtual member method, which derived classes might override.
152 return obj->get_document_vfunc();
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_document)
170 return (*base->get_document)(self);
173 typedef gpointer RType;
176 #endif //GLIBMM_VFUNCS_ENABLED
178 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
179 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
182 Glib::ObjectBase* Document_Class::wrap_new(GObject* object)
184 return new Document((AtkDocument*)(object));
188 /* The implementation: */
192 Glib::Interface(document_class_.init())
195 Document::Document(AtkDocument* castitem)
197 Glib::Interface((GObject*)(castitem))
200 Document::~Document()
204 void Document::add_interface(GType gtype_implementer)
206 document_class_.init().add_interface(gtype_implementer);
209 Document::CppClassType Document::document_class_; // initialize static member
211 GType Document::get_type()
213 return document_class_.init().get_type();
216 GType Document::get_base_type()
218 return atk_document_get_type();
222 Glib::ustring Document::get_document_type() const
224 return Glib::convert_const_gchar_ptr_to_ustring(atk_document_get_document_type(const_cast<AtkDocument*>(gobj())));
227 gpointer Document::get_document()
229 return atk_document_get_document(gobj());
233 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
234 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
236 #ifdef GLIBMM_VFUNCS_ENABLED
237 const gchar* Atk::Document::get_document_type_vfunc()
239 BaseClassType *const base = static_cast<BaseClassType*>(
240 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
241 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
244 if(base && base->get_document_type)
245 return (*base->get_document_type)(gobj());
247 typedef const gchar* RType;
250 gpointer Atk::Document::get_document_vfunc() const
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(gobject_), CppObjectType::get_type()) // Get the interface.
257 if(base && base->get_document)
258 return (*base->get_document)(const_cast<AtkDocument*>(gobj()));
260 typedef gpointer RType;
263 #endif //GLIBMM_VFUNCS_ENABLED