1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <atkmm/document.h>
4 #include <atkmm/private/document_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/atkdocument.h>
39 } // anonymous namespace
45 Glib::RefPtr<Atk::Document> wrap(AtkDocument* object, bool take_copy)
47 return Glib::RefPtr<Atk::Document>( dynamic_cast<Atk::Document*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
48 //We use dynamic_cast<> in case of multiple inheritance.
58 /* The *_Class implementation: */
60 const Glib::Interface_Class& Document_Class::init()
62 if(!gtype_) // create the GType if necessary
64 // Glib::Interface_Class has to know the interface init function
65 // in order to add interfaces to implementing types.
66 class_init_func_ = &Document_Class::iface_init_function;
68 // We can not derive from another interface, and it is not necessary anyway.
69 gtype_ = atk_document_get_type();
75 void Document_Class::iface_init_function(void* g_iface, void*)
77 BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
79 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
80 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
83 klass->get_document_type = &get_document_type_vfunc_callback;
84 klass->get_document = &get_document_vfunc_callback;
87 const gchar* Document_Class::get_document_type_vfunc_callback(AtkDocument* self)
89 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
90 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
92 // Non-gtkmmproc-generated custom classes implicitly call the default
93 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
94 // generated classes can use this optimisation, which avoids the unnecessary
95 // parameter conversions if there is no possibility of the virtual function
97 if(obj && obj->is_derived_())
99 try // Trap C++ exceptions which would normally be lost because this is a C callback.
101 // Call the virtual member method, which derived classes might override.
102 return obj->get_document_type_vfunc();
106 Glib::exception_handlers_invoke();
111 BaseClassType *const base = static_cast<BaseClassType*>(
112 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
113 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
116 // Call the original underlying C function:
117 if(base && base->get_document_type)
118 return (*base->get_document_type)(self);
121 typedef const gchar* RType;
125 gpointer Document_Class::get_document_vfunc_callback(AtkDocument* self)
127 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
128 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
130 // Non-gtkmmproc-generated custom classes implicitly call the default
131 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
132 // generated classes can use this optimisation, which avoids the unnecessary
133 // parameter conversions if there is no possibility of the virtual function
135 if(obj && obj->is_derived_())
137 try // Trap C++ exceptions which would normally be lost because this is a C callback.
139 // Call the virtual member method, which derived classes might override.
140 return obj->get_document_vfunc();
144 Glib::exception_handlers_invoke();
149 BaseClassType *const base = static_cast<BaseClassType*>(
150 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
151 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
154 // Call the original underlying C function:
155 if(base && base->get_document)
156 return (*base->get_document)(self);
159 typedef gpointer RType;
164 Glib::ObjectBase* Document_Class::wrap_new(GObject* object)
166 return new Document((AtkDocument*)(object));
170 /* The implementation: */
174 Glib::Interface(document_class_.init())
177 Document::Document(AtkDocument* castitem)
179 Glib::Interface((GObject*)(castitem))
182 Document::~Document()
186 void Document::add_interface(GType gtype_implementer)
188 document_class_.init().add_interface(gtype_implementer);
191 Document::CppClassType Document::document_class_; // initialize static member
193 GType Document::get_type()
195 return document_class_.init().get_type();
198 GType Document::get_base_type()
200 return atk_document_get_type();
204 Glib::ustring Document::get_document_type() const
206 return Glib::convert_const_gchar_ptr_to_ustring(atk_document_get_document_type(const_cast<AtkDocument*>(gobj())));
209 gpointer Document::get_document()
211 return atk_document_get_document(gobj());
215 const gchar* Atk::Document::get_document_type_vfunc()
217 BaseClassType *const base = static_cast<BaseClassType*>(
218 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
219 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
222 if(base && base->get_document_type)
223 return (*base->get_document_type)(gobj());
225 typedef const gchar* RType;
229 gpointer Atk::Document::get_document_vfunc() const
231 BaseClassType *const base = static_cast<BaseClassType*>(
232 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
233 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
236 if(base && base->get_document)
237 return (*base->get_document)(const_cast<AtkDocument*>(gobj()));
239 typedef gpointer RType;