1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <gtkmm/toolitem.h>
5 #include <gtkmm/private/toolitem_p.h>
12 * Copyright 1998-2002 The gtkmm Development Team
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Library General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with this library; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <gtk/gtktoolitem.h>
42 static gboolean ToolItem_signal_create_menu_proxy_callback(GtkToolItem* self, void* data)
45 typedef sigc::slot< bool > SlotType;
47 // Do not try to call a signal on a disassociated wrapper.
48 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
50 #ifdef GLIBMM_EXCEPTIONS_ENABLED
53 #endif //GLIBMM_EXCEPTIONS_ENABLED
54 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
55 return static_cast<int>((*static_cast<SlotType*>(slot))());
56 #ifdef GLIBMM_EXCEPTIONS_ENABLED
60 Glib::exception_handlers_invoke();
62 #endif //GLIBMM_EXCEPTIONS_ENABLED
65 typedef gboolean RType;
69 static gboolean ToolItem_signal_create_menu_proxy_notify_callback(GtkToolItem* self, void* data)
72 typedef sigc::slot< void > SlotType;
74 // Do not try to call a signal on a disassociated wrapper.
75 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
77 #ifdef GLIBMM_EXCEPTIONS_ENABLED
80 #endif //GLIBMM_EXCEPTIONS_ENABLED
81 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
82 (*static_cast<SlotType*>(slot))();
83 #ifdef GLIBMM_EXCEPTIONS_ENABLED
87 Glib::exception_handlers_invoke();
89 #endif //GLIBMM_EXCEPTIONS_ENABLED
92 typedef gboolean RType;
96 static const Glib::SignalProxyInfo ToolItem_signal_create_menu_proxy_info =
99 (GCallback) &ToolItem_signal_create_menu_proxy_callback,
100 (GCallback) &ToolItem_signal_create_menu_proxy_notify_callback
104 static const Glib::SignalProxyInfo ToolItem_signal_toolbar_reconfigured_info =
106 "toolbar_reconfigured",
107 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
108 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
112 static gboolean ToolItem_signal_set_tooltip_callback(GtkToolItem* self, GtkTooltips* p0,const gchar* p1,const gchar* p2,void* data)
115 typedef sigc::slot< bool,Tooltips*,const Glib::ustring&,const Glib::ustring& > SlotType;
117 // Do not try to call a signal on a disassociated wrapper.
118 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
120 #ifdef GLIBMM_EXCEPTIONS_ENABLED
123 #endif //GLIBMM_EXCEPTIONS_ENABLED
124 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
125 return static_cast<int>((*static_cast<SlotType*>(slot))(Glib::wrap(p0)
126 , Glib::convert_const_gchar_ptr_to_ustring(p1)
127 , Glib::convert_const_gchar_ptr_to_ustring(p2)
129 #ifdef GLIBMM_EXCEPTIONS_ENABLED
133 Glib::exception_handlers_invoke();
135 #endif //GLIBMM_EXCEPTIONS_ENABLED
138 typedef gboolean RType;
142 static gboolean ToolItem_signal_set_tooltip_notify_callback(GtkToolItem* self, GtkTooltips* p0,const gchar* p1,const gchar* p2, void* data)
145 typedef sigc::slot< void,Tooltips*,const Glib::ustring&,const Glib::ustring& > SlotType;
147 // Do not try to call a signal on a disassociated wrapper.
148 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
150 #ifdef GLIBMM_EXCEPTIONS_ENABLED
153 #endif //GLIBMM_EXCEPTIONS_ENABLED
154 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
155 (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
156 , Glib::convert_const_gchar_ptr_to_ustring(p1)
157 , Glib::convert_const_gchar_ptr_to_ustring(p2)
159 #ifdef GLIBMM_EXCEPTIONS_ENABLED
163 Glib::exception_handlers_invoke();
165 #endif //GLIBMM_EXCEPTIONS_ENABLED
168 typedef gboolean RType;
172 static const Glib::SignalProxyInfo ToolItem_signal_set_tooltip_info =
175 (GCallback) &ToolItem_signal_set_tooltip_callback,
176 (GCallback) &ToolItem_signal_set_tooltip_notify_callback
180 } // anonymous namespace
186 Gtk::ToolItem* wrap(GtkToolItem* object, bool take_copy)
188 return dynamic_cast<Gtk::ToolItem *> (Glib::wrap_auto ((GObject*)(object), take_copy));
191 } /* namespace Glib */
197 /* The *_Class implementation: */
199 const Glib::Class& ToolItem_Class::init()
201 if(!gtype_) // create the GType if necessary
203 // Glib::Class has to know the class init function to clone custom types.
204 class_init_func_ = &ToolItem_Class::class_init_function;
206 // This is actually just optimized away, apparently with no harm.
207 // Make sure that the parent type has been created.
208 //CppClassParent::CppObjectType::get_type();
210 // Create the wrapper type, with the same class/instance size as the base type.
211 register_derived_type(gtk_tool_item_get_type());
213 // Add derived versions of interfaces, if the C type implements any interfaces:
219 void ToolItem_Class::class_init_function(void* g_class, void* class_data)
221 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
222 CppClassParent::class_init_function(klass, class_data);
224 #ifdef GLIBMM_VFUNCS_ENABLED
225 #endif //GLIBMM_VFUNCS_ENABLED
227 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
228 klass->create_menu_proxy = &create_menu_proxy_callback;
229 klass->toolbar_reconfigured = &toolbar_reconfigured_callback;
230 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
233 #ifdef GLIBMM_VFUNCS_ENABLED
234 #endif //GLIBMM_VFUNCS_ENABLED
236 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
237 gboolean ToolItem_Class::create_menu_proxy_callback(GtkToolItem* self)
239 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
240 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
242 // Non-gtkmmproc-generated custom classes implicitly call the default
243 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
244 // generated classes can use this optimisation, which avoids the unnecessary
245 // parameter conversions if there is no possibility of the virtual function
247 if(obj && obj->is_derived_())
249 #ifdef GLIBMM_EXCEPTIONS_ENABLED
250 try // Trap C++ exceptions which would normally be lost because this is a C callback.
252 #endif //GLIBMM_EXCEPTIONS_ENABLED
253 // Call the virtual member method, which derived classes might override.
254 return static_cast<int>(obj->on_create_menu_proxy());
255 #ifdef GLIBMM_EXCEPTIONS_ENABLED
259 Glib::exception_handlers_invoke();
261 #endif //GLIBMM_EXCEPTIONS_ENABLED
265 BaseClassType *const base = static_cast<BaseClassType*>(
266 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
269 // Call the original underlying C function:
270 if(base && base->create_menu_proxy)
271 return (*base->create_menu_proxy)(self);
274 typedef gboolean RType;
277 void ToolItem_Class::toolbar_reconfigured_callback(GtkToolItem* self)
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 #ifdef GLIBMM_EXCEPTIONS_ENABLED
290 try // Trap C++ exceptions which would normally be lost because this is a C callback.
292 #endif //GLIBMM_EXCEPTIONS_ENABLED
293 // Call the virtual member method, which derived classes might override.
294 obj->on_toolbar_reconfigured();
295 #ifdef GLIBMM_EXCEPTIONS_ENABLED
299 Glib::exception_handlers_invoke();
301 #endif //GLIBMM_EXCEPTIONS_ENABLED
305 BaseClassType *const base = static_cast<BaseClassType*>(
306 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
309 // Call the original underlying C function:
310 if(base && base->toolbar_reconfigured)
311 (*base->toolbar_reconfigured)(self);
314 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
317 Glib::ObjectBase* ToolItem_Class::wrap_new(GObject* o)
319 return manage(new ToolItem((GtkToolItem*)(o)));
324 /* The implementation: */
326 ToolItem::ToolItem(const Glib::ConstructParams& construct_params)
328 Gtk::Bin(construct_params)
332 ToolItem::ToolItem(GtkToolItem* castitem)
334 Gtk::Bin((GtkBin*)(castitem))
338 ToolItem::~ToolItem()
343 ToolItem::CppClassType ToolItem::toolitem_class_; // initialize static member
345 GType ToolItem::get_type()
347 return toolitem_class_.init().get_type();
350 GType ToolItem::get_base_type()
352 return gtk_tool_item_get_type();
358 Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
359 Gtk::Bin(Glib::ConstructParams(toolitem_class_.init()))
363 void ToolItem::set_homogeneous(bool homogeneous)
365 gtk_tool_item_set_homogeneous(gobj(), static_cast<int>(homogeneous));
368 bool ToolItem::get_homogeneous() const
370 return gtk_tool_item_get_homogeneous(const_cast<GtkToolItem*>(gobj()));
373 void ToolItem::set_expand(bool expand)
375 gtk_tool_item_set_expand(gobj(), static_cast<int>(expand));
378 bool ToolItem::get_expand() const
380 return gtk_tool_item_get_expand(const_cast<GtkToolItem*>(gobj()));
383 void ToolItem::set_tooltip(Tooltips& tooltips, const Glib::ustring& tip_text, const Glib::ustring& tip_private)
385 gtk_tool_item_set_tooltip(gobj(), (tooltips).gobj(), tip_text.c_str(), tip_private.c_str());
388 void ToolItem::set_use_drag_window(bool use_drag_window)
390 gtk_tool_item_set_use_drag_window(gobj(), static_cast<int>(use_drag_window));
393 bool ToolItem::get_use_drag_window() const
395 return gtk_tool_item_get_use_drag_window(const_cast<GtkToolItem*>(gobj()));
398 void ToolItem::set_visible_horizontal(bool visible_horizontal)
400 gtk_tool_item_set_visible_horizontal(gobj(), static_cast<int>(visible_horizontal));
403 bool ToolItem::get_visible_horizontal() const
405 return gtk_tool_item_get_visible_horizontal(const_cast<GtkToolItem*>(gobj()));
408 void ToolItem::set_visible_vertical(bool visible_vertical)
410 gtk_tool_item_set_visible_vertical(gobj(), static_cast<int>(visible_vertical));
413 bool ToolItem::get_visible_vertical() const
415 return gtk_tool_item_get_visible_vertical(const_cast<GtkToolItem*>(gobj()));
418 bool ToolItem::get_is_important() const
420 return gtk_tool_item_get_is_important(const_cast<GtkToolItem*>(gobj()));
423 void ToolItem::set_is_important(bool is_important)
425 gtk_tool_item_set_is_important(gobj(), static_cast<int>(is_important));
428 IconSize ToolItem::get_icon_size() const
430 return IconSize(static_cast<int>(gtk_tool_item_get_icon_size(const_cast<GtkToolItem*>(gobj()))));
433 Orientation ToolItem::get_orientation() const
435 return ((Orientation)(gtk_tool_item_get_orientation(const_cast<GtkToolItem*>(gobj()))));
438 ToolbarStyle ToolItem::get_toolbar_style() const
440 return ((ToolbarStyle)(gtk_tool_item_get_toolbar_style(const_cast<GtkToolItem*>(gobj()))));
443 ReliefStyle ToolItem::get_relief_style() const
445 return ((ReliefStyle)(gtk_tool_item_get_relief_style(const_cast<GtkToolItem*>(gobj()))));
448 Widget* ToolItem::retrieve_proxy_menu_item()
450 return Glib::wrap(gtk_tool_item_retrieve_proxy_menu_item(gobj()));
453 const Widget* ToolItem::retrieve_proxy_menu_item() const
455 return const_cast<ToolItem*>(this)->retrieve_proxy_menu_item();
458 Widget* ToolItem::get_proxy_menu_item(const Glib::ustring& menu_item_id)
460 return Glib::wrap(gtk_tool_item_get_proxy_menu_item(gobj(), menu_item_id.c_str()));
463 const Widget* ToolItem::get_proxy_menu_item(const Glib::ustring& menu_item_id) const
465 return const_cast<ToolItem*>(this)->get_proxy_menu_item(menu_item_id);
468 void ToolItem::set_proxy_menu_item(const Glib::ustring& menu_item_id, Widget& menu_item)
470 gtk_tool_item_set_proxy_menu_item(gobj(), menu_item_id.c_str(), (menu_item).gobj());
473 void ToolItem::rebuild_menu()
475 gtk_tool_item_rebuild_menu(gobj());
479 Glib::SignalProxy0< bool > ToolItem::signal_create_menu_proxy()
481 return Glib::SignalProxy0< bool >(this, &ToolItem_signal_create_menu_proxy_info);
485 Glib::SignalProxy0< void > ToolItem::signal_toolbar_reconfigured()
487 return Glib::SignalProxy0< void >(this, &ToolItem_signal_toolbar_reconfigured_info);
491 Glib::SignalProxy3< bool,Tooltips*,const Glib::ustring&,const Glib::ustring& > ToolItem::signal_set_tooltip()
493 return Glib::SignalProxy3< bool,Tooltips*,const Glib::ustring&,const Glib::ustring& >(this, &ToolItem_signal_set_tooltip_info);
497 #ifdef GLIBMM_PROPERTIES_ENABLED
498 Glib::PropertyProxy<bool> ToolItem::property_visible_horizontal()
500 return Glib::PropertyProxy<bool>(this, "visible-horizontal");
502 #endif //GLIBMM_PROPERTIES_ENABLED
504 #ifdef GLIBMM_PROPERTIES_ENABLED
505 Glib::PropertyProxy_ReadOnly<bool> ToolItem::property_visible_horizontal() const
507 return Glib::PropertyProxy_ReadOnly<bool>(this, "visible-horizontal");
509 #endif //GLIBMM_PROPERTIES_ENABLED
511 #ifdef GLIBMM_PROPERTIES_ENABLED
512 Glib::PropertyProxy<bool> ToolItem::property_visible_vertical()
514 return Glib::PropertyProxy<bool>(this, "visible-vertical");
516 #endif //GLIBMM_PROPERTIES_ENABLED
518 #ifdef GLIBMM_PROPERTIES_ENABLED
519 Glib::PropertyProxy_ReadOnly<bool> ToolItem::property_visible_vertical() const
521 return Glib::PropertyProxy_ReadOnly<bool>(this, "visible-vertical");
523 #endif //GLIBMM_PROPERTIES_ENABLED
525 #ifdef GLIBMM_PROPERTIES_ENABLED
526 Glib::PropertyProxy<bool> ToolItem::property_is_important()
528 return Glib::PropertyProxy<bool>(this, "is-important");
530 #endif //GLIBMM_PROPERTIES_ENABLED
532 #ifdef GLIBMM_PROPERTIES_ENABLED
533 Glib::PropertyProxy_ReadOnly<bool> ToolItem::property_is_important() const
535 return Glib::PropertyProxy_ReadOnly<bool>(this, "is-important");
537 #endif //GLIBMM_PROPERTIES_ENABLED
540 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
541 bool Gtk::ToolItem::on_create_menu_proxy()
543 BaseClassType *const base = static_cast<BaseClassType*>(
544 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
547 if(base && base->create_menu_proxy)
548 return (*base->create_menu_proxy)(gobj());
553 void Gtk::ToolItem::on_toolbar_reconfigured()
555 BaseClassType *const base = static_cast<BaseClassType*>(
556 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
559 if(base && base->toolbar_reconfigured)
560 (*base->toolbar_reconfigured)(gobj());
562 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
564 #ifdef GLIBMM_VFUNCS_ENABLED
565 #endif //GLIBMM_VFUNCS_ENABLED