1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <gtkmm/toolitem.h>
4 #include <gtkmm/private/toolitem_p.h>
11 * Copyright 1998-2002 The gtkmm Development Team
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version.
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Library General Public License for more details.
23 * You should have received a copy of the GNU Library General Public
24 * License along with this library; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <gtk/gtktoolitem.h>
40 gboolean ToolItem_signal_create_menu_proxy_callback(GtkToolItem* self, void* data)
43 typedef sigc::slot< bool > SlotType;
45 // Do not try to call a signal on a disassociated wrapper.
46 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
50 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
51 return static_cast<int>((*static_cast<SlotType*>(slot))());
55 Glib::exception_handlers_invoke();
59 typedef gboolean RType;
63 gboolean ToolItem_signal_create_menu_proxy_notify_callback(GtkToolItem* self, void* data)
66 typedef sigc::slot< void > SlotType;
68 // Do not try to call a signal on a disassociated wrapper.
69 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
73 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
74 (*static_cast<SlotType*>(slot))();
78 Glib::exception_handlers_invoke();
82 typedef gboolean RType;
86 const Glib::SignalProxyInfo ToolItem_signal_create_menu_proxy_info =
89 (GCallback) &ToolItem_signal_create_menu_proxy_callback,
90 (GCallback) &ToolItem_signal_create_menu_proxy_notify_callback
94 const Glib::SignalProxyInfo ToolItem_signal_toolbar_reconfigured_info =
96 "toolbar_reconfigured",
97 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
98 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
102 gboolean ToolItem_signal_set_tooltip_callback(GtkToolItem* self, GtkTooltips* p0,const gchar* p1,const gchar* p2,void* data)
105 typedef sigc::slot< bool,Tooltips*,const Glib::ustring&,const Glib::ustring& > SlotType;
107 // Do not try to call a signal on a disassociated wrapper.
108 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
112 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
113 return static_cast<int>((*static_cast<SlotType*>(slot))(Glib::wrap(p0)
114 , Glib::convert_const_gchar_ptr_to_ustring(p1)
115 , Glib::convert_const_gchar_ptr_to_ustring(p2)
120 Glib::exception_handlers_invoke();
124 typedef gboolean RType;
128 gboolean ToolItem_signal_set_tooltip_notify_callback(GtkToolItem* self, GtkTooltips* p0,const gchar* p1,const gchar* p2, void* data)
131 typedef sigc::slot< void,Tooltips*,const Glib::ustring&,const Glib::ustring& > SlotType;
133 // Do not try to call a signal on a disassociated wrapper.
134 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
138 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
139 (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
140 , Glib::convert_const_gchar_ptr_to_ustring(p1)
141 , Glib::convert_const_gchar_ptr_to_ustring(p2)
146 Glib::exception_handlers_invoke();
150 typedef gboolean RType;
154 const Glib::SignalProxyInfo ToolItem_signal_set_tooltip_info =
157 (GCallback) &ToolItem_signal_set_tooltip_callback,
158 (GCallback) &ToolItem_signal_set_tooltip_notify_callback
161 } // anonymous namespace
167 Gtk::ToolItem* wrap(GtkToolItem* object, bool take_copy)
169 return dynamic_cast<Gtk::ToolItem *> (Glib::wrap_auto ((GObject*)(object), take_copy));
172 } /* namespace Glib */
178 /* The *_Class implementation: */
180 const Glib::Class& ToolItem_Class::init()
182 if(!gtype_) // create the GType if necessary
184 // Glib::Class has to know the class init function to clone custom types.
185 class_init_func_ = &ToolItem_Class::class_init_function;
187 // This is actually just optimized away, apparently with no harm.
188 // Make sure that the parent type has been created.
189 //CppClassParent::CppObjectType::get_type();
191 // Create the wrapper type, with the same class/instance size as the base type.
192 register_derived_type(gtk_tool_item_get_type());
194 // Add derived versions of interfaces, if the C type implements any interfaces:
200 void ToolItem_Class::class_init_function(void* g_class, void* class_data)
202 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
203 CppClassParent::class_init_function(klass, class_data);
205 klass->create_menu_proxy = &create_menu_proxy_callback;
206 klass->toolbar_reconfigured = &toolbar_reconfigured_callback;
210 gboolean ToolItem_Class::create_menu_proxy_callback(GtkToolItem* self)
212 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
213 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
215 // Non-gtkmmproc-generated custom classes implicitly call the default
216 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
217 // generated classes can use this optimisation, which avoids the unnecessary
218 // parameter conversions if there is no possibility of the virtual function
220 if(obj && obj->is_derived_())
222 try // Trap C++ exceptions which would normally be lost because this is a C callback.
224 // Call the virtual member method, which derived classes might override.
225 return static_cast<int>(obj->on_create_menu_proxy());
229 Glib::exception_handlers_invoke();
234 BaseClassType *const base = static_cast<BaseClassType*>(
235 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
238 // Call the original underlying C function:
239 if(base && base->create_menu_proxy)
240 return (*base->create_menu_proxy)(self);
243 typedef gboolean RType;
247 void ToolItem_Class::toolbar_reconfigured_callback(GtkToolItem* self)
249 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
250 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
252 // Non-gtkmmproc-generated custom classes implicitly call the default
253 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
254 // generated classes can use this optimisation, which avoids the unnecessary
255 // parameter conversions if there is no possibility of the virtual function
257 if(obj && obj->is_derived_())
259 try // Trap C++ exceptions which would normally be lost because this is a C callback.
261 // Call the virtual member method, which derived classes might override.
262 obj->on_toolbar_reconfigured();
266 Glib::exception_handlers_invoke();
271 BaseClassType *const base = static_cast<BaseClassType*>(
272 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
275 // Call the original underlying C function:
276 if(base && base->toolbar_reconfigured)
277 (*base->toolbar_reconfigured)(self);
282 Glib::ObjectBase* ToolItem_Class::wrap_new(GObject* o)
284 return manage(new ToolItem((GtkToolItem*)(o)));
289 /* The implementation: */
291 ToolItem::ToolItem(const Glib::ConstructParams& construct_params)
293 Gtk::Bin(construct_params)
297 ToolItem::ToolItem(GtkToolItem* castitem)
299 Gtk::Bin((GtkBin*)(castitem))
303 ToolItem::~ToolItem()
308 ToolItem::CppClassType ToolItem::toolitem_class_; // initialize static member
310 GType ToolItem::get_type()
312 return toolitem_class_.init().get_type();
315 GType ToolItem::get_base_type()
317 return gtk_tool_item_get_type();
323 Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
324 Gtk::Bin(Glib::ConstructParams(toolitem_class_.init()))
328 void ToolItem::set_homogeneous(bool homogeneous)
330 gtk_tool_item_set_homogeneous(gobj(), static_cast<int>(homogeneous));
333 bool ToolItem::get_homogeneous() const
335 return gtk_tool_item_get_homogeneous(const_cast<GtkToolItem*>(gobj()));
338 void ToolItem::set_expand(bool expand)
340 gtk_tool_item_set_expand(gobj(), static_cast<int>(expand));
343 bool ToolItem::get_expand() const
345 return gtk_tool_item_get_expand(const_cast<GtkToolItem*>(gobj()));
348 void ToolItem::set_tooltip(Tooltips& tooltips, const Glib::ustring& tip_text, const Glib::ustring& tip_private)
350 gtk_tool_item_set_tooltip(gobj(), (tooltips).gobj(), tip_text.c_str(), tip_private.c_str());
353 void ToolItem::set_use_drag_window(bool use_drag_window)
355 gtk_tool_item_set_use_drag_window(gobj(), static_cast<int>(use_drag_window));
358 bool ToolItem::get_use_drag_window() const
360 return gtk_tool_item_get_use_drag_window(const_cast<GtkToolItem*>(gobj()));
363 void ToolItem::set_visible_horizontal(bool visible_horizontal)
365 gtk_tool_item_set_visible_horizontal(gobj(), static_cast<int>(visible_horizontal));
368 bool ToolItem::get_visible_horizontal() const
370 return gtk_tool_item_get_visible_horizontal(const_cast<GtkToolItem*>(gobj()));
373 void ToolItem::set_visible_vertical(bool visible_vertical)
375 gtk_tool_item_set_visible_vertical(gobj(), static_cast<int>(visible_vertical));
378 bool ToolItem::get_visible_vertical() const
380 return gtk_tool_item_get_visible_vertical(const_cast<GtkToolItem*>(gobj()));
383 bool ToolItem::get_is_important() const
385 return gtk_tool_item_get_is_important(const_cast<GtkToolItem*>(gobj()));
388 void ToolItem::set_is_important(bool is_important)
390 gtk_tool_item_set_is_important(gobj(), static_cast<int>(is_important));
393 IconSize ToolItem::get_icon_size() const
395 return IconSize(static_cast<int>(gtk_tool_item_get_icon_size(const_cast<GtkToolItem*>(gobj()))));
398 Orientation ToolItem::get_orientation() const
400 return ((Orientation)(gtk_tool_item_get_orientation(const_cast<GtkToolItem*>(gobj()))));
403 ToolbarStyle ToolItem::get_toolbar_style() const
405 return ((ToolbarStyle)(gtk_tool_item_get_toolbar_style(const_cast<GtkToolItem*>(gobj()))));
408 ReliefStyle ToolItem::get_relief_style() const
410 return ((ReliefStyle)(gtk_tool_item_get_relief_style(const_cast<GtkToolItem*>(gobj()))));
413 Widget* ToolItem::retrieve_proxy_menu_item()
415 return Glib::wrap(gtk_tool_item_retrieve_proxy_menu_item(gobj()));
418 const Widget* ToolItem::retrieve_proxy_menu_item() const
420 return Glib::wrap(gtk_tool_item_retrieve_proxy_menu_item(const_cast<GtkToolItem*>(gobj())));
423 Widget* ToolItem::get_proxy_menu_item(const Glib::ustring& menu_item_id)
425 return Glib::wrap(gtk_tool_item_get_proxy_menu_item(gobj(), menu_item_id.c_str()));
428 const Widget* ToolItem::get_proxy_menu_item(const Glib::ustring& menu_item_id) const
430 return Glib::wrap(gtk_tool_item_get_proxy_menu_item(const_cast<GtkToolItem*>(gobj()), menu_item_id.c_str()));
433 void ToolItem::set_proxy_menu_item(const Glib::ustring& menu_item_id, Widget& menu_item)
435 gtk_tool_item_set_proxy_menu_item(gobj(), menu_item_id.c_str(), (menu_item).gobj());
438 void ToolItem::rebuild_menu()
440 gtk_tool_item_rebuild_menu(gobj());
444 Glib::SignalProxy0< bool > ToolItem::signal_create_menu_proxy()
446 return Glib::SignalProxy0< bool >(this, &ToolItem_signal_create_menu_proxy_info);
449 Glib::SignalProxy0< void > ToolItem::signal_toolbar_reconfigured()
451 return Glib::SignalProxy0< void >(this, &ToolItem_signal_toolbar_reconfigured_info);
454 Glib::SignalProxy3< bool,Tooltips*,const Glib::ustring&,const Glib::ustring& > ToolItem::signal_set_tooltip()
456 return Glib::SignalProxy3< bool,Tooltips*,const Glib::ustring&,const Glib::ustring& >(this, &ToolItem_signal_set_tooltip_info);
460 Glib::PropertyProxy<bool> ToolItem::property_visible_horizontal()
462 return Glib::PropertyProxy<bool>(this, "visible-horizontal");
465 Glib::PropertyProxy_ReadOnly<bool> ToolItem::property_visible_horizontal() const
467 return Glib::PropertyProxy_ReadOnly<bool>(this, "visible-horizontal");
470 Glib::PropertyProxy<bool> ToolItem::property_visible_vertical()
472 return Glib::PropertyProxy<bool>(this, "visible-vertical");
475 Glib::PropertyProxy_ReadOnly<bool> ToolItem::property_visible_vertical() const
477 return Glib::PropertyProxy_ReadOnly<bool>(this, "visible-vertical");
480 Glib::PropertyProxy<bool> ToolItem::property_is_important()
482 return Glib::PropertyProxy<bool>(this, "is-important");
485 Glib::PropertyProxy_ReadOnly<bool> ToolItem::property_is_important() const
487 return Glib::PropertyProxy_ReadOnly<bool>(this, "is-important");
491 bool Gtk::ToolItem::on_create_menu_proxy()
493 BaseClassType *const base = static_cast<BaseClassType*>(
494 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
497 if(base && base->create_menu_proxy)
498 return (*base->create_menu_proxy)(gobj());
504 void Gtk::ToolItem::on_toolbar_reconfigured()
506 BaseClassType *const base = static_cast<BaseClassType*>(
507 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
510 if(base && base->toolbar_reconfigured)
511 (*base->toolbar_reconfigured)(gobj());