1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <atkmm/value.h>
4 #include <atkmm/private/value_p.h>
9 /* Copyright 1998-2002 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 <atk/atkvalue.h>
31 } // anonymous namespace
37 Glib::RefPtr<Atk::Value> wrap(AtkValue* object, bool take_copy)
39 return Glib::RefPtr<Atk::Value>( dynamic_cast<Atk::Value*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
40 //We use dynamic_cast<> in case of multiple inheritance.
50 /* The *_Class implementation: */
52 const Glib::Interface_Class& Value_Class::init()
54 if(!gtype_) // create the GType if necessary
56 // Glib::Interface_Class has to know the interface init function
57 // in order to add interfaces to implementing types.
58 class_init_func_ = &Value_Class::iface_init_function;
60 // We can not derive from another interface, and it is not necessary anyway.
61 gtype_ = atk_value_get_type();
67 void Value_Class::iface_init_function(void* g_iface, void*)
69 BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
71 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
72 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
75 klass->get_current_value = &get_current_value_vfunc_callback;
76 klass->get_maximum_value = &get_maximum_value_vfunc_callback;
77 klass->get_minimum_value = &get_minimum_value_vfunc_callback;
78 klass->set_current_value = &set_current_value_vfunc_callback;
81 void Value_Class::get_current_value_vfunc_callback(AtkValue* self, GValue* value)
83 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
84 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
86 // Non-gtkmmproc-generated custom classes implicitly call the default
87 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
88 // generated classes can use this optimisation, which avoids the unnecessary
89 // parameter conversions if there is no possibility of the virtual function
91 if(obj && obj->is_derived_())
93 try // Trap C++ exceptions which would normally be lost because this is a C callback.
95 // Call the virtual member method, which derived classes might override.
96 obj->get_current_value_vfunc(*reinterpret_cast<Glib::ValueBase*>(value)
101 Glib::exception_handlers_invoke();
106 BaseClassType *const base = static_cast<BaseClassType*>(
107 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
108 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
111 // Call the original underlying C function:
112 if(base && base->get_current_value)
113 (*base->get_current_value)(self, value);
117 void Value_Class::get_maximum_value_vfunc_callback(AtkValue* self, GValue* value)
119 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
120 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
122 // Non-gtkmmproc-generated custom classes implicitly call the default
123 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
124 // generated classes can use this optimisation, which avoids the unnecessary
125 // parameter conversions if there is no possibility of the virtual function
127 if(obj && obj->is_derived_())
129 try // Trap C++ exceptions which would normally be lost because this is a C callback.
131 // Call the virtual member method, which derived classes might override.
132 obj->get_maximum_value_vfunc(*reinterpret_cast<Glib::ValueBase*>(value)
137 Glib::exception_handlers_invoke();
142 BaseClassType *const base = static_cast<BaseClassType*>(
143 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
144 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
147 // Call the original underlying C function:
148 if(base && base->get_maximum_value)
149 (*base->get_maximum_value)(self, value);
153 void Value_Class::get_minimum_value_vfunc_callback(AtkValue* self, GValue* value)
155 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
156 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
158 // Non-gtkmmproc-generated custom classes implicitly call the default
159 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
160 // generated classes can use this optimisation, which avoids the unnecessary
161 // parameter conversions if there is no possibility of the virtual function
163 if(obj && obj->is_derived_())
165 try // Trap C++ exceptions which would normally be lost because this is a C callback.
167 // Call the virtual member method, which derived classes might override.
168 obj->get_minimum_value_vfunc(*reinterpret_cast<Glib::ValueBase*>(value)
173 Glib::exception_handlers_invoke();
178 BaseClassType *const base = static_cast<BaseClassType*>(
179 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
180 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
183 // Call the original underlying C function:
184 if(base && base->get_minimum_value)
185 (*base->get_minimum_value)(self, value);
189 gboolean Value_Class::set_current_value_vfunc_callback(AtkValue* self, const GValue* value)
191 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
192 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
194 // Non-gtkmmproc-generated custom classes implicitly call the default
195 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
196 // generated classes can use this optimisation, which avoids the unnecessary
197 // parameter conversions if there is no possibility of the virtual function
199 if(obj && obj->is_derived_())
201 try // Trap C++ exceptions which would normally be lost because this is a C callback.
203 // Call the virtual member method, which derived classes might override.
204 return static_cast<int>(obj->set_current_value_vfunc(*reinterpret_cast<const Glib::ValueBase*>(value)
209 Glib::exception_handlers_invoke();
214 BaseClassType *const base = static_cast<BaseClassType*>(
215 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
216 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
219 // Call the original underlying C function:
220 if(base && base->set_current_value)
221 return (*base->set_current_value)(self, value);
224 typedef gboolean RType;
229 Glib::ObjectBase* Value_Class::wrap_new(GObject* object)
231 return new Value((AtkValue*)(object));
235 /* The implementation: */
239 Glib::Interface(value_class_.init())
242 Value::Value(AtkValue* castitem)
244 Glib::Interface((GObject*)(castitem))
251 void Value::add_interface(GType gtype_implementer)
253 value_class_.init().add_interface(gtype_implementer);
256 Value::CppClassType Value::value_class_; // initialize static member
258 GType Value::get_type()
260 return value_class_.init().get_type();
263 GType Value::get_base_type()
265 return atk_value_get_type();
269 void Value::get_current_value(Glib::ValueBase& value) const
271 atk_value_get_current_value(const_cast<AtkValue*>(gobj()), (value).gobj());
274 void Value::get_maximum_value(Glib::ValueBase& value) const
276 atk_value_get_maximum_value(const_cast<AtkValue*>(gobj()), (value).gobj());
279 void Value::get_minimum_value(Glib::ValueBase& value) const
281 atk_value_get_minimum_value(const_cast<AtkValue*>(gobj()), (value).gobj());
284 bool Value::set_current_value(const Glib::ValueBase& value)
286 return atk_value_set_current_value(gobj(), (value).gobj());
290 void Atk::Value::get_current_value_vfunc(Glib::ValueBase& value) const
292 BaseClassType *const base = static_cast<BaseClassType*>(
293 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
294 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
297 if(base && base->get_current_value)
298 (*base->get_current_value)(const_cast<AtkValue*>(gobj()),(value).gobj());
301 void Atk::Value::get_maximum_value_vfunc(Glib::ValueBase& value) const
303 BaseClassType *const base = static_cast<BaseClassType*>(
304 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
305 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
308 if(base && base->get_maximum_value)
309 (*base->get_maximum_value)(const_cast<AtkValue*>(gobj()),(value).gobj());
312 void Atk::Value::get_minimum_value_vfunc(Glib::ValueBase& value) const
314 BaseClassType *const base = static_cast<BaseClassType*>(
315 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
316 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
319 if(base && base->get_minimum_value)
320 (*base->get_minimum_value)(const_cast<AtkValue*>(gobj()),(value).gobj());
323 bool Atk::Value::set_current_value_vfunc(const Glib::ValueBase& value)
325 BaseClassType *const base = static_cast<BaseClassType*>(
326 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
327 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
330 if(base && base->set_current_value)
331 return (*base->set_current_value)(gobj(),(value).gobj());