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>
34 #ifndef GTKMM_DISABLE_DEPRECATED
35 Glib::SignalProxy3< bool,Tooltips*,const Glib::ustring&,const Glib::ustring& > ToolItem::signal_set_tooltip()
37 //This is an empty implementation to maintain API (and ABI, sort of, but blame GTK+) compatibility.
38 //GTK+ now never emits this signal.
39 return Glib::SignalProxy3< bool,Tooltips*,const Glib::ustring&,const Glib::ustring& >(this, 0);
41 #endif //GTKMM_DISABLE_DEPRECATED
51 static gboolean ToolItem_signal_create_menu_proxy_callback(GtkToolItem* self, void* data)
54 typedef sigc::slot< bool > SlotType;
56 // Do not try to call a signal on a disassociated wrapper.
57 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
59 #ifdef GLIBMM_EXCEPTIONS_ENABLED
62 #endif //GLIBMM_EXCEPTIONS_ENABLED
63 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
64 return static_cast<int>((*static_cast<SlotType*>(slot))());
65 #ifdef GLIBMM_EXCEPTIONS_ENABLED
69 Glib::exception_handlers_invoke();
71 #endif //GLIBMM_EXCEPTIONS_ENABLED
74 typedef gboolean RType;
78 static gboolean ToolItem_signal_create_menu_proxy_notify_callback(GtkToolItem* self, void* data)
81 typedef sigc::slot< void > SlotType;
83 // Do not try to call a signal on a disassociated wrapper.
84 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
86 #ifdef GLIBMM_EXCEPTIONS_ENABLED
89 #endif //GLIBMM_EXCEPTIONS_ENABLED
90 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
91 (*static_cast<SlotType*>(slot))();
92 #ifdef GLIBMM_EXCEPTIONS_ENABLED
96 Glib::exception_handlers_invoke();
98 #endif //GLIBMM_EXCEPTIONS_ENABLED
101 typedef gboolean RType;
105 static const Glib::SignalProxyInfo ToolItem_signal_create_menu_proxy_info =
108 (GCallback) &ToolItem_signal_create_menu_proxy_callback,
109 (GCallback) &ToolItem_signal_create_menu_proxy_notify_callback
113 static const Glib::SignalProxyInfo ToolItem_signal_toolbar_reconfigured_info =
115 "toolbar_reconfigured",
116 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
117 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
121 } // anonymous namespace
127 Gtk::ToolItem* wrap(GtkToolItem* object, bool take_copy)
129 return dynamic_cast<Gtk::ToolItem *> (Glib::wrap_auto ((GObject*)(object), take_copy));
132 } /* namespace Glib */
138 /* The *_Class implementation: */
140 const Glib::Class& ToolItem_Class::init()
142 if(!gtype_) // create the GType if necessary
144 // Glib::Class has to know the class init function to clone custom types.
145 class_init_func_ = &ToolItem_Class::class_init_function;
147 // This is actually just optimized away, apparently with no harm.
148 // Make sure that the parent type has been created.
149 //CppClassParent::CppObjectType::get_type();
151 // Create the wrapper type, with the same class/instance size as the base type.
152 register_derived_type(gtk_tool_item_get_type());
154 // Add derived versions of interfaces, if the C type implements any interfaces:
160 void ToolItem_Class::class_init_function(void* g_class, void* class_data)
162 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
163 CppClassParent::class_init_function(klass, class_data);
165 #ifdef GLIBMM_VFUNCS_ENABLED
166 #endif //GLIBMM_VFUNCS_ENABLED
168 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
169 klass->create_menu_proxy = &create_menu_proxy_callback;
170 klass->toolbar_reconfigured = &toolbar_reconfigured_callback;
171 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
174 #ifdef GLIBMM_VFUNCS_ENABLED
175 #endif //GLIBMM_VFUNCS_ENABLED
177 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
178 gboolean ToolItem_Class::create_menu_proxy_callback(GtkToolItem* self)
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 return static_cast<int>(obj->on_create_menu_proxy());
199 #ifdef GLIBMM_EXCEPTIONS_ENABLED
203 Glib::exception_handlers_invoke();
205 #endif //GLIBMM_EXCEPTIONS_ENABLED
209 BaseClassType *const base = static_cast<BaseClassType*>(
210 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
213 // Call the original underlying C function:
214 if(base && base->create_menu_proxy)
215 return (*base->create_menu_proxy)(self);
217 typedef gboolean RType;
220 void ToolItem_Class::toolbar_reconfigured_callback(GtkToolItem* self)
222 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
223 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
225 // Non-gtkmmproc-generated custom classes implicitly call the default
226 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
227 // generated classes can use this optimisation, which avoids the unnecessary
228 // parameter conversions if there is no possibility of the virtual function
230 if(obj_base && obj_base->is_derived_())
232 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
233 if(obj) // This can be NULL during destruction.
235 #ifdef GLIBMM_EXCEPTIONS_ENABLED
236 try // Trap C++ exceptions which would normally be lost because this is a C callback.
238 #endif //GLIBMM_EXCEPTIONS_ENABLED
239 // Call the virtual member method, which derived classes might override.
240 obj->on_toolbar_reconfigured();
242 #ifdef GLIBMM_EXCEPTIONS_ENABLED
246 Glib::exception_handlers_invoke();
248 #endif //GLIBMM_EXCEPTIONS_ENABLED
252 BaseClassType *const base = static_cast<BaseClassType*>(
253 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
256 // Call the original underlying C function:
257 if(base && base->toolbar_reconfigured)
258 (*base->toolbar_reconfigured)(self);
260 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
263 Glib::ObjectBase* ToolItem_Class::wrap_new(GObject* o)
265 return manage(new ToolItem((GtkToolItem*)(o)));
270 /* The implementation: */
272 ToolItem::ToolItem(const Glib::ConstructParams& construct_params)
274 Gtk::Bin(construct_params)
278 ToolItem::ToolItem(GtkToolItem* castitem)
280 Gtk::Bin((GtkBin*)(castitem))
284 ToolItem::~ToolItem()
289 ToolItem::CppClassType ToolItem::toolitem_class_; // initialize static member
291 GType ToolItem::get_type()
293 return toolitem_class_.init().get_type();
296 GType ToolItem::get_base_type()
298 return gtk_tool_item_get_type();
304 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
306 Gtk::Bin(Glib::ConstructParams(toolitem_class_.init()))
310 void ToolItem::set_homogeneous(bool homogeneous)
312 gtk_tool_item_set_homogeneous(gobj(), static_cast<int>(homogeneous));
315 bool ToolItem::get_homogeneous() const
317 return gtk_tool_item_get_homogeneous(const_cast<GtkToolItem*>(gobj()));
320 void ToolItem::set_expand(bool expand)
322 gtk_tool_item_set_expand(gobj(), static_cast<int>(expand));
325 bool ToolItem::get_expand() const
327 return gtk_tool_item_get_expand(const_cast<GtkToolItem*>(gobj()));
330 #ifndef GTKMM_DISABLE_DEPRECATED
332 void ToolItem::set_tooltip(Tooltips& tooltips, const Glib::ustring& tip_text, const Glib::ustring& tip_private)
334 gtk_tool_item_set_tooltip(gobj(), (tooltips).gobj(), tip_text.c_str(), tip_private.c_str());
337 #endif // GTKMM_DISABLE_DEPRECATED
339 void ToolItem::set_tooltip_text(const Glib::ustring& text)
341 gtk_tool_item_set_tooltip_text(gobj(), text.c_str());
344 void ToolItem::set_tooltip_markup(const Glib::ustring& markup)
346 gtk_tool_item_set_tooltip_markup(gobj(), markup.c_str());
349 void ToolItem::set_use_drag_window(bool use_drag_window)
351 gtk_tool_item_set_use_drag_window(gobj(), static_cast<int>(use_drag_window));
354 bool ToolItem::get_use_drag_window() const
356 return gtk_tool_item_get_use_drag_window(const_cast<GtkToolItem*>(gobj()));
359 void ToolItem::set_visible_horizontal(bool visible_horizontal)
361 gtk_tool_item_set_visible_horizontal(gobj(), static_cast<int>(visible_horizontal));
364 bool ToolItem::get_visible_horizontal() const
366 return gtk_tool_item_get_visible_horizontal(const_cast<GtkToolItem*>(gobj()));
369 void ToolItem::set_visible_vertical(bool visible_vertical)
371 gtk_tool_item_set_visible_vertical(gobj(), static_cast<int>(visible_vertical));
374 bool ToolItem::get_visible_vertical() const
376 return gtk_tool_item_get_visible_vertical(const_cast<GtkToolItem*>(gobj()));
379 bool ToolItem::get_is_important() const
381 return gtk_tool_item_get_is_important(const_cast<GtkToolItem*>(gobj()));
384 void ToolItem::set_is_important(bool is_important)
386 gtk_tool_item_set_is_important(gobj(), static_cast<int>(is_important));
389 IconSize ToolItem::get_icon_size() const
391 return IconSize(static_cast<int>(gtk_tool_item_get_icon_size(const_cast<GtkToolItem*>(gobj()))));
394 Orientation ToolItem::get_orientation() const
396 return ((Orientation)(gtk_tool_item_get_orientation(const_cast<GtkToolItem*>(gobj()))));
399 ToolbarStyle ToolItem::get_toolbar_style() const
401 return ((ToolbarStyle)(gtk_tool_item_get_toolbar_style(const_cast<GtkToolItem*>(gobj()))));
404 ReliefStyle ToolItem::get_relief_style() const
406 return ((ReliefStyle)(gtk_tool_item_get_relief_style(const_cast<GtkToolItem*>(gobj()))));
409 Widget* ToolItem::retrieve_proxy_menu_item()
411 return Glib::wrap(gtk_tool_item_retrieve_proxy_menu_item(gobj()));
414 const Widget* ToolItem::retrieve_proxy_menu_item() const
416 return const_cast<ToolItem*>(this)->retrieve_proxy_menu_item();
419 Widget* ToolItem::get_proxy_menu_item(const Glib::ustring& menu_item_id)
421 return Glib::wrap(gtk_tool_item_get_proxy_menu_item(gobj(), menu_item_id.c_str()));
424 const Widget* ToolItem::get_proxy_menu_item(const Glib::ustring& menu_item_id) const
426 return const_cast<ToolItem*>(this)->get_proxy_menu_item(menu_item_id);
429 void ToolItem::set_proxy_menu_item(const Glib::ustring& menu_item_id, Widget& menu_item)
431 gtk_tool_item_set_proxy_menu_item(gobj(), menu_item_id.c_str(), (menu_item).gobj());
434 void ToolItem::rebuild_menu()
436 gtk_tool_item_rebuild_menu(gobj());
440 Glib::SignalProxy0< bool > ToolItem::signal_create_menu_proxy()
442 return Glib::SignalProxy0< bool >(this, &ToolItem_signal_create_menu_proxy_info);
446 Glib::SignalProxy0< void > ToolItem::signal_toolbar_reconfigured()
448 return Glib::SignalProxy0< void >(this, &ToolItem_signal_toolbar_reconfigured_info);
452 #ifdef GLIBMM_PROPERTIES_ENABLED
453 Glib::PropertyProxy<bool> ToolItem::property_visible_horizontal()
455 return Glib::PropertyProxy<bool>(this, "visible-horizontal");
457 #endif //GLIBMM_PROPERTIES_ENABLED
459 #ifdef GLIBMM_PROPERTIES_ENABLED
460 Glib::PropertyProxy_ReadOnly<bool> ToolItem::property_visible_horizontal() const
462 return Glib::PropertyProxy_ReadOnly<bool>(this, "visible-horizontal");
464 #endif //GLIBMM_PROPERTIES_ENABLED
466 #ifdef GLIBMM_PROPERTIES_ENABLED
467 Glib::PropertyProxy<bool> ToolItem::property_visible_vertical()
469 return Glib::PropertyProxy<bool>(this, "visible-vertical");
471 #endif //GLIBMM_PROPERTIES_ENABLED
473 #ifdef GLIBMM_PROPERTIES_ENABLED
474 Glib::PropertyProxy_ReadOnly<bool> ToolItem::property_visible_vertical() const
476 return Glib::PropertyProxy_ReadOnly<bool>(this, "visible-vertical");
478 #endif //GLIBMM_PROPERTIES_ENABLED
480 #ifdef GLIBMM_PROPERTIES_ENABLED
481 Glib::PropertyProxy<bool> ToolItem::property_is_important()
483 return Glib::PropertyProxy<bool>(this, "is-important");
485 #endif //GLIBMM_PROPERTIES_ENABLED
487 #ifdef GLIBMM_PROPERTIES_ENABLED
488 Glib::PropertyProxy_ReadOnly<bool> ToolItem::property_is_important() const
490 return Glib::PropertyProxy_ReadOnly<bool>(this, "is-important");
492 #endif //GLIBMM_PROPERTIES_ENABLED
495 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
496 bool Gtk::ToolItem::on_create_menu_proxy()
498 BaseClassType *const base = static_cast<BaseClassType*>(
499 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
502 if(base && base->create_menu_proxy)
503 return (*base->create_menu_proxy)(gobj());
508 void Gtk::ToolItem::on_toolbar_reconfigured()
510 BaseClassType *const base = static_cast<BaseClassType*>(
511 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
514 if(base && base->toolbar_reconfigured)
515 (*base->toolbar_reconfigured)(gobj());
517 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
519 #ifdef GLIBMM_VFUNCS_ENABLED
520 #endif //GLIBMM_VFUNCS_ENABLED