1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <atkmm/image.h>
5 #include <atkmm/private/image_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/atkimage.h>
33 } // anonymous namespace
39 Glib::RefPtr<Atk::Image> wrap(AtkImage* object, bool take_copy)
41 return Glib::RefPtr<Atk::Image>( dynamic_cast<Atk::Image*> (Glib::wrap_auto_interface<Atk::Image> ((GObject*)(object), take_copy)) );
42 //We use dynamic_cast<> in case of multiple inheritance.
52 /* The *_Class implementation: */
54 const Glib::Interface_Class& Image_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_ = &Image_Class::iface_init_function;
62 // We can not derive from another interface, and it is not necessary anyway.
63 gtype_ = atk_image_get_type();
69 void Image_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->set_image_description = &set_image_description_vfunc_callback;
79 klass->get_image_description = &get_image_description_vfunc_callback;
80 klass->get_image_position = &get_image_position_vfunc_callback;
81 klass->get_image_size = &get_image_size_vfunc_callback;
82 #endif //GLIBMM_VFUNCS_ENABLED
84 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
85 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
88 #ifdef GLIBMM_VFUNCS_ENABLED
89 gboolean Image_Class::set_image_description_vfunc_callback(AtkImage* self, const gchar* description)
91 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
92 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
94 // Non-gtkmmproc-generated custom classes implicitly call the default
95 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
96 // generated classes can use this optimisation, which avoids the unnecessary
97 // parameter conversions if there is no possibility of the virtual function
99 if(obj_base && obj_base->is_derived_())
101 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
102 if(obj) // This can be NULL during destruction.
104 #ifdef GLIBMM_EXCEPTIONS_ENABLED
105 try // Trap C++ exceptions which would normally be lost because this is a C callback.
107 #endif //GLIBMM_EXCEPTIONS_ENABLED
108 // Call the virtual member method, which derived classes might override.
109 return static_cast<int>(obj->set_image_description_vfunc(Glib::convert_const_gchar_ptr_to_ustring(description)
111 #ifdef GLIBMM_EXCEPTIONS_ENABLED
115 Glib::exception_handlers_invoke();
117 #endif //GLIBMM_EXCEPTIONS_ENABLED
121 BaseClassType *const base = static_cast<BaseClassType*>(
122 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
123 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
126 // Call the original underlying C function:
127 if(base && base->set_image_description)
128 return (*base->set_image_description)(self, description);
131 typedef gboolean RType;
134 const gchar* Image_Class::get_image_description_vfunc_callback(AtkImage* self)
136 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
137 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
139 // Non-gtkmmproc-generated custom classes implicitly call the default
140 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
141 // generated classes can use this optimisation, which avoids the unnecessary
142 // parameter conversions if there is no possibility of the virtual function
144 if(obj_base && obj_base->is_derived_())
146 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
147 if(obj) // This can be NULL during destruction.
149 #ifdef GLIBMM_EXCEPTIONS_ENABLED
150 try // Trap C++ exceptions which would normally be lost because this is a C callback.
152 #endif //GLIBMM_EXCEPTIONS_ENABLED
153 // Call the virtual member method, which derived classes might override.
154 return obj->get_image_description_vfunc();
155 #ifdef GLIBMM_EXCEPTIONS_ENABLED
159 Glib::exception_handlers_invoke();
161 #endif //GLIBMM_EXCEPTIONS_ENABLED
165 BaseClassType *const base = static_cast<BaseClassType*>(
166 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
167 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
170 // Call the original underlying C function:
171 if(base && base->get_image_description)
172 return (*base->get_image_description)(self);
175 typedef const gchar* RType;
178 void Image_Class::get_image_position_vfunc_callback(AtkImage* self, gint* x, gint* y, AtkCoordType coord_type)
180 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
181 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
183 // Non-gtkmmproc-generated custom classes implicitly call the default
184 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
185 // generated classes can use this optimisation, which avoids the unnecessary
186 // parameter conversions if there is no possibility of the virtual function
188 if(obj_base && obj_base->is_derived_())
190 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
191 if(obj) // This can be NULL during destruction.
193 #ifdef GLIBMM_EXCEPTIONS_ENABLED
194 try // Trap C++ exceptions which would normally be lost because this is a C callback.
196 #endif //GLIBMM_EXCEPTIONS_ENABLED
197 // Call the virtual member method, which derived classes might override.
198 obj->get_image_position_vfunc(*(x)
200 , ((CoordType)(coord_type))
203 #ifdef GLIBMM_EXCEPTIONS_ENABLED
207 Glib::exception_handlers_invoke();
209 #endif //GLIBMM_EXCEPTIONS_ENABLED
213 BaseClassType *const base = static_cast<BaseClassType*>(
214 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
215 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
218 // Call the original underlying C function:
219 if(base && base->get_image_position)
220 (*base->get_image_position)(self, x, y, coord_type);
223 void Image_Class::get_image_size_vfunc_callback(AtkImage* self, gint* width, gint* height)
225 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
226 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
228 // Non-gtkmmproc-generated custom classes implicitly call the default
229 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
230 // generated classes can use this optimisation, which avoids the unnecessary
231 // parameter conversions if there is no possibility of the virtual function
233 if(obj_base && obj_base->is_derived_())
235 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
236 if(obj) // This can be NULL during destruction.
238 #ifdef GLIBMM_EXCEPTIONS_ENABLED
239 try // Trap C++ exceptions which would normally be lost because this is a C callback.
241 #endif //GLIBMM_EXCEPTIONS_ENABLED
242 // Call the virtual member method, which derived classes might override.
243 obj->get_image_size_vfunc(*(width)
247 #ifdef GLIBMM_EXCEPTIONS_ENABLED
251 Glib::exception_handlers_invoke();
253 #endif //GLIBMM_EXCEPTIONS_ENABLED
257 BaseClassType *const base = static_cast<BaseClassType*>(
258 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
259 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
262 // Call the original underlying C function:
263 if(base && base->get_image_size)
264 (*base->get_image_size)(self, width, height);
267 #endif //GLIBMM_VFUNCS_ENABLED
269 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
270 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
273 Glib::ObjectBase* Image_Class::wrap_new(GObject* object)
275 return new Image((AtkImage*)(object));
279 /* The implementation: */
283 Glib::Interface(image_class_.init())
286 Image::Image(AtkImage* castitem)
288 Glib::Interface((GObject*)(castitem))
295 void Image::add_interface(GType gtype_implementer)
297 image_class_.init().add_interface(gtype_implementer);
300 Image::CppClassType Image::image_class_; // initialize static member
302 GType Image::get_type()
304 return image_class_.init().get_type();
307 GType Image::get_base_type()
309 return atk_image_get_type();
313 bool Image::set_image_description(const Glib::ustring& description)
315 return atk_image_set_image_description(gobj(), description.c_str());
318 Glib::ustring Image::get_image_description() const
320 return Glib::convert_const_gchar_ptr_to_ustring(atk_image_get_image_description(const_cast<AtkImage*>(gobj())));
323 void Image::get_image_size(int& width, int& height) const
325 atk_image_get_image_size(const_cast<AtkImage*>(gobj()), &width, &height);
328 void Image::get_image_position(int& x, int& y, CoordType coord_type) const
330 atk_image_get_image_position(const_cast<AtkImage*>(gobj()), &x, &y, ((AtkCoordType)(coord_type)));
334 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
335 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
337 #ifdef GLIBMM_VFUNCS_ENABLED
338 bool Atk::Image::set_image_description_vfunc(const Glib::ustring& description)
340 BaseClassType *const base = static_cast<BaseClassType*>(
341 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
342 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
345 if(base && base->set_image_description)
346 return (*base->set_image_description)(gobj(),description.c_str());
351 const char* Atk::Image::get_image_description_vfunc() const
353 BaseClassType *const base = static_cast<BaseClassType*>(
354 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
355 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
358 if(base && base->get_image_description)
359 return (*base->get_image_description)(const_cast<AtkImage*>(gobj()));
361 typedef const char* RType;
364 void Atk::Image::get_image_position_vfunc(int& x, int& y, CoordType coord_type) const
366 BaseClassType *const base = static_cast<BaseClassType*>(
367 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
368 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
371 if(base && base->get_image_position)
372 (*base->get_image_position)(const_cast<AtkImage*>(gobj()),&x,&y,((AtkCoordType)(coord_type)));
374 void Atk::Image::get_image_size_vfunc(int& width, int& height) const
376 BaseClassType *const base = static_cast<BaseClassType*>(
377 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
378 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
381 if(base && base->get_image_size)
382 (*base->get_image_size)(const_cast<AtkImage*>(gobj()),&width,&height);
384 #endif //GLIBMM_VFUNCS_ENABLED