1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <atkmm/action.h>
4 #include <atkmm/private/action_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/atkaction.h>
31 } // anonymous namespace
37 Glib::RefPtr<Atk::Action> wrap(AtkAction* object, bool take_copy)
39 return Glib::RefPtr<Atk::Action>( dynamic_cast<Atk::Action*> (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& Action_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_ = &Action_Class::iface_init_function;
60 // We can not derive from another interface, and it is not necessary anyway.
61 gtype_ = atk_action_get_type();
67 void Action_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->do_action = &do_action_vfunc_callback;
76 klass->get_n_actions = &get_n_actions_vfunc_callback;
77 klass->get_description = &get_description_vfunc_callback;
78 klass->get_name = &get_name_vfunc_callback;
79 klass->get_keybinding = &get_keybinding_vfunc_callback;
80 klass->set_description = &set_description_vfunc_callback;
83 gboolean Action_Class::do_action_vfunc_callback(AtkAction* self, gint i)
85 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
86 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
88 // Non-gtkmmproc-generated custom classes implicitly call the default
89 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
90 // generated classes can use this optimisation, which avoids the unnecessary
91 // parameter conversions if there is no possibility of the virtual function
93 if(obj && obj->is_derived_())
95 try // Trap C++ exceptions which would normally be lost because this is a C callback.
97 // Call the virtual member method, which derived classes might override.
98 return static_cast<int>(obj->do_action_vfunc(i
103 Glib::exception_handlers_invoke();
108 BaseClassType *const base = static_cast<BaseClassType*>(
109 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
110 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
113 // Call the original underlying C function:
114 if(base && base->do_action)
115 return (*base->do_action)(self, i);
118 typedef gboolean RType;
122 gint Action_Class::get_n_actions_vfunc_callback(AtkAction* self)
124 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
125 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
127 // Non-gtkmmproc-generated custom classes implicitly call the default
128 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
129 // generated classes can use this optimisation, which avoids the unnecessary
130 // parameter conversions if there is no possibility of the virtual function
132 if(obj && obj->is_derived_())
134 try // Trap C++ exceptions which would normally be lost because this is a C callback.
136 // Call the virtual member method, which derived classes might override.
137 return obj->get_n_actions_vfunc();
141 Glib::exception_handlers_invoke();
146 BaseClassType *const base = static_cast<BaseClassType*>(
147 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
148 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
151 // Call the original underlying C function:
152 if(base && base->get_n_actions)
153 return (*base->get_n_actions)(self);
160 const gchar* Action_Class::get_description_vfunc_callback(AtkAction* self, gint i)
162 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
163 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
165 // Non-gtkmmproc-generated custom classes implicitly call the default
166 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
167 // generated classes can use this optimisation, which avoids the unnecessary
168 // parameter conversions if there is no possibility of the virtual function
170 if(obj && obj->is_derived_())
172 try // Trap C++ exceptions which would normally be lost because this is a C callback.
174 // Call the virtual member method, which derived classes might override.
175 return obj->get_description_vfunc(i
180 Glib::exception_handlers_invoke();
185 BaseClassType *const base = static_cast<BaseClassType*>(
186 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
187 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
190 // Call the original underlying C function:
191 if(base && base->get_description)
192 return (*base->get_description)(self, i);
195 typedef const gchar* RType;
199 const gchar* Action_Class::get_name_vfunc_callback(AtkAction* self, gint i)
201 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
202 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
204 // Non-gtkmmproc-generated custom classes implicitly call the default
205 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
206 // generated classes can use this optimisation, which avoids the unnecessary
207 // parameter conversions if there is no possibility of the virtual function
209 if(obj && obj->is_derived_())
211 try // Trap C++ exceptions which would normally be lost because this is a C callback.
213 // Call the virtual member method, which derived classes might override.
214 return obj->get_name_vfunc(i
219 Glib::exception_handlers_invoke();
224 BaseClassType *const base = static_cast<BaseClassType*>(
225 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
226 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
229 // Call the original underlying C function:
230 if(base && base->get_name)
231 return (*base->get_name)(self, i);
234 typedef const gchar* RType;
238 const gchar* Action_Class::get_keybinding_vfunc_callback(AtkAction* self, gint i)
240 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
241 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
243 // Non-gtkmmproc-generated custom classes implicitly call the default
244 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
245 // generated classes can use this optimisation, which avoids the unnecessary
246 // parameter conversions if there is no possibility of the virtual function
248 if(obj && obj->is_derived_())
250 try // Trap C++ exceptions which would normally be lost because this is a C callback.
252 // Call the virtual member method, which derived classes might override.
253 return obj->get_keybinding_vfunc(i
258 Glib::exception_handlers_invoke();
263 BaseClassType *const base = static_cast<BaseClassType*>(
264 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
265 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
268 // Call the original underlying C function:
269 if(base && base->get_keybinding)
270 return (*base->get_keybinding)(self, i);
273 typedef const gchar* RType;
277 gboolean Action_Class::set_description_vfunc_callback(AtkAction* self, gint i, const gchar* desc)
279 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
280 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
282 // Non-gtkmmproc-generated custom classes implicitly call the default
283 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
284 // generated classes can use this optimisation, which avoids the unnecessary
285 // parameter conversions if there is no possibility of the virtual function
287 if(obj && obj->is_derived_())
289 try // Trap C++ exceptions which would normally be lost because this is a C callback.
291 // Call the virtual member method, which derived classes might override.
292 return static_cast<int>(obj->set_description_vfunc(i
293 , Glib::convert_const_gchar_ptr_to_ustring(desc)
298 Glib::exception_handlers_invoke();
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(self), CppObjectType::get_type()) // Get the interface.
308 // Call the original underlying C function:
309 if(base && base->set_description)
310 return (*base->set_description)(self, i, desc);
313 typedef gboolean RType;
318 Glib::ObjectBase* Action_Class::wrap_new(GObject* object)
320 return new Action((AtkAction*)(object));
324 /* The implementation: */
328 Glib::Interface(action_class_.init())
331 Action::Action(AtkAction* castitem)
333 Glib::Interface((GObject*)(castitem))
340 void Action::add_interface(GType gtype_implementer)
342 action_class_.init().add_interface(gtype_implementer);
345 Action::CppClassType Action::action_class_; // initialize static member
347 GType Action::get_type()
349 return action_class_.init().get_type();
352 GType Action::get_base_type()
354 return atk_action_get_type();
358 bool Action::do_action(int i)
360 return atk_action_do_action(gobj(), i);
363 int Action::get_n_actions() const
365 return atk_action_get_n_actions(const_cast<AtkAction*>(gobj()));
368 Glib::ustring Action::get_description(int i) const
370 return Glib::convert_const_gchar_ptr_to_ustring(atk_action_get_description(const_cast<AtkAction*>(gobj()), i));
373 Glib::ustring Action::get_name(int i) const
375 return Glib::convert_const_gchar_ptr_to_ustring(atk_action_get_name(const_cast<AtkAction*>(gobj()), i));
378 Glib::ustring Action::get_keybinding(int i)
380 return Glib::convert_const_gchar_ptr_to_ustring(atk_action_get_keybinding(gobj(), i));
383 bool Action::set_description(int i, const Glib::ustring& desc)
385 return atk_action_set_description(gobj(), i, desc.c_str());
388 Glib::ustring Action::get_localized_name(int i)
390 return Glib::convert_const_gchar_ptr_to_ustring(atk_action_get_localized_name(gobj(), i));
394 bool Atk::Action::do_action_vfunc(int i)
396 BaseClassType *const base = static_cast<BaseClassType*>(
397 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
398 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
401 if(base && base->do_action)
402 return (*base->do_action)(gobj(),i);
408 int Atk::Action::get_n_actions_vfunc() const
410 BaseClassType *const base = static_cast<BaseClassType*>(
411 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
412 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
415 if(base && base->get_n_actions)
416 return (*base->get_n_actions)(const_cast<AtkAction*>(gobj()));
422 const char* Atk::Action::get_description_vfunc(int i) const
424 BaseClassType *const base = static_cast<BaseClassType*>(
425 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
426 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
429 if(base && base->get_description)
430 return (*base->get_description)(const_cast<AtkAction*>(gobj()),i);
432 typedef const char* RType;
436 const char* Atk::Action::get_name_vfunc(int i) const
438 BaseClassType *const base = static_cast<BaseClassType*>(
439 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
440 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
443 if(base && base->get_name)
444 return (*base->get_name)(const_cast<AtkAction*>(gobj()),i);
446 typedef const char* RType;
450 const char* Atk::Action::get_keybinding_vfunc(int i) const
452 BaseClassType *const base = static_cast<BaseClassType*>(
453 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
454 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
457 if(base && base->get_keybinding)
458 return (*base->get_keybinding)(const_cast<AtkAction*>(gobj()),i);
460 typedef const char* RType;
464 bool Atk::Action::set_description_vfunc(int i, const Glib::ustring& desc)
466 BaseClassType *const base = static_cast<BaseClassType*>(
467 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
468 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
471 if(base && base->set_description)
472 return (*base->set_description)(gobj(),i,desc.c_str());