1 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
2 
3 #undef GTK_DISABLE_DEPRECATED
4 
5 
6 #include <glibmm.h>
7 
8 #include <gtkmm/toolitem.h>
9 #include <gtkmm/private/toolitem_p.h>
10 
11 
12 // -*- c++ -*-
13 /* $Id: toolitem.ccg,v 1.1 2003/10/22 15:40:19 murrayc Exp $ */
14 
15 /*
16  *
17  * Copyright 1998-2002 The gtkmm Development Team
18  *
19  * This library is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU Lesser General Public
21  * License as published by the Free Software Foundation; either
22  * version 2.1 of the License, or (at your option) any later version.
23  *
24  * This library is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27  * Lesser General Public License for more details.
28  *
29  * You should have received a copy of the GNU Lesser General Public
30  * License along with this library; if not, write to the Free
31  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
32  */
33 
34 #include <gtk/gtk.h>
35 
36 namespace Gtk
37 {
38 
39 #ifndef GTKMM_DISABLE_DEPRECATED
signal_set_tooltip()40 Glib::SignalProxy3< bool,Tooltips*,const Glib::ustring&,const Glib::ustring& > ToolItem::signal_set_tooltip()
41 {
42   //This is an empty implementation to maintain API (and ABI, sort of, but blame GTK+) compatibility.
43   //GTK+ now never emits this signal.
44   return Glib::SignalProxy3< bool,Tooltips*,const Glib::ustring&,const Glib::ustring& >(this, 0);
45 }
46 #endif //GTKMM_DISABLE_DEPRECATED
47 
48 
49 } // namespace Gtk
50 
51 
52 namespace
53 {
54 
55 
ToolItem_signal_create_menu_proxy_callback(GtkToolItem * self,void * data)56 static gboolean ToolItem_signal_create_menu_proxy_callback(GtkToolItem* self, void* data)
57 {
58   using namespace Gtk;
59   typedef sigc::slot< bool > SlotType;
60 
61   ToolItem* obj = dynamic_cast<ToolItem*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
62   // Do not try to call a signal on a disassociated wrapper.
63   if(obj)
64   {
65     try
66     {
67       if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
68         return static_cast<int>((*static_cast<SlotType*>(slot))());
69     }
70     catch(...)
71     {
72        Glib::exception_handlers_invoke();
73     }
74   }
75 
76   typedef gboolean RType;
77   return RType();
78 }
79 
ToolItem_signal_create_menu_proxy_notify_callback(GtkToolItem * self,void * data)80 static gboolean ToolItem_signal_create_menu_proxy_notify_callback(GtkToolItem* self,  void* data)
81 {
82   using namespace Gtk;
83   typedef sigc::slot< void > SlotType;
84 
85   ToolItem* obj = dynamic_cast<ToolItem*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
86   // Do not try to call a signal on a disassociated wrapper.
87   if(obj)
88   {
89     try
90     {
91       if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
92         (*static_cast<SlotType*>(slot))();
93     }
94     catch(...)
95     {
96       Glib::exception_handlers_invoke();
97     }
98   }
99 
100   typedef gboolean RType;
101   return RType();
102 }
103 
104 static const Glib::SignalProxyInfo ToolItem_signal_create_menu_proxy_info =
105 {
106   "create_menu_proxy",
107   (GCallback) &ToolItem_signal_create_menu_proxy_callback,
108   (GCallback) &ToolItem_signal_create_menu_proxy_notify_callback
109 };
110 
111 
112 static const Glib::SignalProxyInfo ToolItem_signal_toolbar_reconfigured_info =
113 {
114   "toolbar_reconfigured",
115   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
116   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
117 };
118 
119 
120 } // anonymous namespace
121 
122 
123 namespace Glib
124 {
125 
wrap(GtkToolItem * object,bool take_copy)126 Gtk::ToolItem* wrap(GtkToolItem* object, bool take_copy)
127 {
128   return dynamic_cast<Gtk::ToolItem *> (Glib::wrap_auto ((GObject*)(object), take_copy));
129 }
130 
131 } /* namespace Glib */
132 
133 namespace Gtk
134 {
135 
136 
137 /* The *_Class implementation: */
138 
init()139 const Glib::Class& ToolItem_Class::init()
140 {
141   if(!gtype_) // create the GType if necessary
142   {
143     // Glib::Class has to know the class init function to clone custom types.
144     class_init_func_ = &ToolItem_Class::class_init_function;
145 
146     // This is actually just optimized away, apparently with no harm.
147     // Make sure that the parent type has been created.
148     //CppClassParent::CppObjectType::get_type();
149 
150     // Create the wrapper type, with the same class/instance size as the base type.
151     register_derived_type(gtk_tool_item_get_type());
152 
153     // Add derived versions of interfaces, if the C type implements any interfaces:
154 
155   }
156 
157   return *this;
158 }
159 
160 
class_init_function(void * g_class,void * class_data)161 void ToolItem_Class::class_init_function(void* g_class, void* class_data)
162 {
163   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
164   CppClassParent::class_init_function(klass, class_data);
165 
166 
167   klass->create_menu_proxy = &create_menu_proxy_callback;
168   klass->toolbar_reconfigured = &toolbar_reconfigured_callback;
169 }
170 
171 
create_menu_proxy_callback(GtkToolItem * self)172 gboolean ToolItem_Class::create_menu_proxy_callback(GtkToolItem* self)
173 {
174   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
175       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
176 
177   // Non-gtkmmproc-generated custom classes implicitly call the default
178   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
179   // generated classes can use this optimisation, which avoids the unnecessary
180   // parameter conversions if there is no possibility of the virtual function
181   // being overridden:
182   if(obj_base && obj_base->is_derived_())
183   {
184     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
185     if(obj) // This can be NULL during destruction.
186     {
187       try // Trap C++ exceptions which would normally be lost because this is a C callback.
188       {
189         // Call the virtual member method, which derived classes might override.
190         return static_cast<int>(obj->on_create_menu_proxy());
191       }
192       catch(...)
193       {
194         Glib::exception_handlers_invoke();
195       }
196     }
197   }
198 
199   BaseClassType *const base = static_cast<BaseClassType*>(
200         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
201     );
202 
203   // Call the original underlying C function:
204   if(base && base->create_menu_proxy)
205     return (*base->create_menu_proxy)(self);
206 
207   typedef gboolean RType;
208   return RType();
209 }
toolbar_reconfigured_callback(GtkToolItem * self)210 void ToolItem_Class::toolbar_reconfigured_callback(GtkToolItem* self)
211 {
212   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
213       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
214 
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
219   // being overridden:
220   if(obj_base && obj_base->is_derived_())
221   {
222     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
223     if(obj) // This can be NULL during destruction.
224     {
225       try // Trap C++ exceptions which would normally be lost because this is a C callback.
226       {
227         // Call the virtual member method, which derived classes might override.
228         obj->on_toolbar_reconfigured();
229         return;
230       }
231       catch(...)
232       {
233         Glib::exception_handlers_invoke();
234       }
235     }
236   }
237 
238   BaseClassType *const base = static_cast<BaseClassType*>(
239         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
240     );
241 
242   // Call the original underlying C function:
243   if(base && base->toolbar_reconfigured)
244     (*base->toolbar_reconfigured)(self);
245 }
246 
247 
wrap_new(GObject * o)248 Glib::ObjectBase* ToolItem_Class::wrap_new(GObject* o)
249 {
250   return manage(new ToolItem((GtkToolItem*)(o)));
251 
252 }
253 
254 
255 /* The implementation: */
256 
ToolItem(const Glib::ConstructParams & construct_params)257 ToolItem::ToolItem(const Glib::ConstructParams& construct_params)
258 :
259   Gtk::Bin(construct_params)
260 {
261   }
262 
ToolItem(GtkToolItem * castitem)263 ToolItem::ToolItem(GtkToolItem* castitem)
264 :
265   Gtk::Bin((GtkBin*)(castitem))
266 {
267   }
268 
~ToolItem()269 ToolItem::~ToolItem()
270 {
271   destroy_();
272 }
273 
274 ToolItem::CppClassType ToolItem::toolitem_class_; // initialize static member
275 
get_type()276 GType ToolItem::get_type()
277 {
278   return toolitem_class_.init().get_type();
279 }
280 
281 
get_base_type()282 GType ToolItem::get_base_type()
283 {
284   return gtk_tool_item_get_type();
285 }
286 
287 
ToolItem()288 ToolItem::ToolItem()
289 :
290   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
291   Glib::ObjectBase(0),
292   Gtk::Bin(Glib::ConstructParams(toolitem_class_.init()))
293 {
294 
295 
296 }
297 
set_homogeneous(bool homogeneous)298 void ToolItem::set_homogeneous(bool homogeneous)
299 {
300   gtk_tool_item_set_homogeneous(gobj(), static_cast<int>(homogeneous));
301 }
302 
get_homogeneous() const303 bool ToolItem::get_homogeneous() const
304 {
305   return gtk_tool_item_get_homogeneous(const_cast<GtkToolItem*>(gobj()));
306 }
307 
set_expand(bool expand)308 void ToolItem::set_expand(bool expand)
309 {
310   gtk_tool_item_set_expand(gobj(), static_cast<int>(expand));
311 }
312 
get_expand() const313 bool ToolItem::get_expand() const
314 {
315   return gtk_tool_item_get_expand(const_cast<GtkToolItem*>(gobj()));
316 }
317 
318 #ifndef GTKMM_DISABLE_DEPRECATED
319 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
set_tooltip(Tooltips & tooltips,const Glib::ustring & tip_text,const Glib::ustring & tip_private)320 void ToolItem::set_tooltip(Tooltips& tooltips, const Glib::ustring& tip_text, const Glib::ustring& tip_private)
321 {
322   gtk_tool_item_set_tooltip(gobj(), (tooltips).gobj(), tip_text.c_str(), tip_private.c_str());
323 }
324 G_GNUC_END_IGNORE_DEPRECATIONS
325 #endif // GTKMM_DISABLE_DEPRECATED
326 
set_tooltip_text(const Glib::ustring & text)327 void ToolItem::set_tooltip_text(const Glib::ustring& text)
328 {
329   gtk_tool_item_set_tooltip_text(gobj(), text.c_str());
330 }
331 
set_tooltip_markup(const Glib::ustring & markup)332 void ToolItem::set_tooltip_markup(const Glib::ustring& markup)
333 {
334   gtk_tool_item_set_tooltip_markup(gobj(), markup.c_str());
335 }
336 
set_use_drag_window(bool use_drag_window)337 void ToolItem::set_use_drag_window(bool use_drag_window)
338 {
339   gtk_tool_item_set_use_drag_window(gobj(), static_cast<int>(use_drag_window));
340 }
341 
get_use_drag_window() const342 bool ToolItem::get_use_drag_window() const
343 {
344   return gtk_tool_item_get_use_drag_window(const_cast<GtkToolItem*>(gobj()));
345 }
346 
set_visible_horizontal(bool visible_horizontal)347 void ToolItem::set_visible_horizontal(bool visible_horizontal)
348 {
349   gtk_tool_item_set_visible_horizontal(gobj(), static_cast<int>(visible_horizontal));
350 }
351 
get_visible_horizontal() const352 bool ToolItem::get_visible_horizontal() const
353 {
354   return gtk_tool_item_get_visible_horizontal(const_cast<GtkToolItem*>(gobj()));
355 }
356 
set_visible_vertical(bool visible_vertical)357 void ToolItem::set_visible_vertical(bool visible_vertical)
358 {
359   gtk_tool_item_set_visible_vertical(gobj(), static_cast<int>(visible_vertical));
360 }
361 
get_visible_vertical() const362 bool ToolItem::get_visible_vertical() const
363 {
364   return gtk_tool_item_get_visible_vertical(const_cast<GtkToolItem*>(gobj()));
365 }
366 
get_is_important() const367 bool ToolItem::get_is_important() const
368 {
369   return gtk_tool_item_get_is_important(const_cast<GtkToolItem*>(gobj()));
370 }
371 
set_is_important(bool is_important)372 void ToolItem::set_is_important(bool is_important)
373 {
374   gtk_tool_item_set_is_important(gobj(), static_cast<int>(is_important));
375 }
376 
get_ellipsize_mode() const377 Pango::EllipsizeMode ToolItem::get_ellipsize_mode() const
378 {
379   return ((Pango::EllipsizeMode)(gtk_tool_item_get_ellipsize_mode(const_cast<GtkToolItem*>(gobj()))));
380 }
381 
get_icon_size() const382 IconSize ToolItem::get_icon_size() const
383 {
384   return IconSize(static_cast<int>(gtk_tool_item_get_icon_size(const_cast<GtkToolItem*>(gobj()))));
385 }
386 
get_orientation() const387 Orientation ToolItem::get_orientation() const
388 {
389   return ((Orientation)(gtk_tool_item_get_orientation(const_cast<GtkToolItem*>(gobj()))));
390 }
391 
get_toolbar_style() const392 ToolbarStyle ToolItem::get_toolbar_style() const
393 {
394   return ((ToolbarStyle)(gtk_tool_item_get_toolbar_style(const_cast<GtkToolItem*>(gobj()))));
395 }
396 
get_relief_style() const397 ReliefStyle ToolItem::get_relief_style() const
398 {
399   return ((ReliefStyle)(gtk_tool_item_get_relief_style(const_cast<GtkToolItem*>(gobj()))));
400 }
401 
get_text_alignment() const402 float ToolItem::get_text_alignment() const
403 {
404   return gtk_tool_item_get_text_alignment(const_cast<GtkToolItem*>(gobj()));
405 }
406 
get_text_orientation() const407 Orientation ToolItem::get_text_orientation() const
408 {
409   return ((Orientation)(gtk_tool_item_get_text_orientation(const_cast<GtkToolItem*>(gobj()))));
410 }
411 
get_text_size_group()412 Glib::RefPtr<SizeGroup> ToolItem::get_text_size_group()
413 {
414   Glib::RefPtr<SizeGroup> retvalue = Glib::wrap(gtk_tool_item_get_text_size_group(gobj()));
415   if(retvalue)
416     retvalue->reference(); //The function does not do a ref for us.
417   return retvalue;
418 }
419 
get_text_size_group() const420 Glib::RefPtr<const SizeGroup> ToolItem::get_text_size_group() const
421 {
422   return const_cast<ToolItem*>(this)->get_text_size_group();
423 }
424 
retrieve_proxy_menu_item()425 Widget* ToolItem::retrieve_proxy_menu_item()
426 {
427   return Glib::wrap(gtk_tool_item_retrieve_proxy_menu_item(gobj()));
428 }
429 
retrieve_proxy_menu_item() const430 const Widget* ToolItem::retrieve_proxy_menu_item() const
431 {
432   return const_cast<ToolItem*>(this)->retrieve_proxy_menu_item();
433 }
434 
get_proxy_menu_item(const Glib::ustring & menu_item_id)435 Widget* ToolItem::get_proxy_menu_item(const Glib::ustring& menu_item_id)
436 {
437   return Glib::wrap(gtk_tool_item_get_proxy_menu_item(gobj(), menu_item_id.c_str()));
438 }
439 
get_proxy_menu_item(const Glib::ustring & menu_item_id) const440 const Widget* ToolItem::get_proxy_menu_item(const Glib::ustring& menu_item_id) const
441 {
442   return const_cast<ToolItem*>(this)->get_proxy_menu_item(menu_item_id);
443 }
444 
set_proxy_menu_item(const Glib::ustring & menu_item_id,Widget & menu_item)445 void ToolItem::set_proxy_menu_item(const Glib::ustring& menu_item_id, Widget& menu_item)
446 {
447   gtk_tool_item_set_proxy_menu_item(gobj(), menu_item_id.c_str(), (menu_item).gobj());
448 }
449 
rebuild_menu()450 void ToolItem::rebuild_menu()
451 {
452   gtk_tool_item_rebuild_menu(gobj());
453 }
454 
toolbar_reconfigured()455 void ToolItem::toolbar_reconfigured()
456 {
457   gtk_tool_item_toolbar_reconfigured(gobj());
458 }
459 
460 
signal_create_menu_proxy()461 Glib::SignalProxy0< bool > ToolItem::signal_create_menu_proxy()
462 {
463   return Glib::SignalProxy0< bool >(this, &ToolItem_signal_create_menu_proxy_info);
464 }
465 
466 
signal_toolbar_reconfigured()467 Glib::SignalProxy0< void > ToolItem::signal_toolbar_reconfigured()
468 {
469   return Glib::SignalProxy0< void >(this, &ToolItem_signal_toolbar_reconfigured_info);
470 }
471 
472 
property_visible_horizontal()473 Glib::PropertyProxy< bool > ToolItem::property_visible_horizontal()
474 {
475   return Glib::PropertyProxy< bool >(this, "visible-horizontal");
476 }
477 
property_visible_horizontal() const478 Glib::PropertyProxy_ReadOnly< bool > ToolItem::property_visible_horizontal() const
479 {
480   return Glib::PropertyProxy_ReadOnly< bool >(this, "visible-horizontal");
481 }
482 
property_visible_vertical()483 Glib::PropertyProxy< bool > ToolItem::property_visible_vertical()
484 {
485   return Glib::PropertyProxy< bool >(this, "visible-vertical");
486 }
487 
property_visible_vertical() const488 Glib::PropertyProxy_ReadOnly< bool > ToolItem::property_visible_vertical() const
489 {
490   return Glib::PropertyProxy_ReadOnly< bool >(this, "visible-vertical");
491 }
492 
property_is_important()493 Glib::PropertyProxy< bool > ToolItem::property_is_important()
494 {
495   return Glib::PropertyProxy< bool >(this, "is-important");
496 }
497 
property_is_important() const498 Glib::PropertyProxy_ReadOnly< bool > ToolItem::property_is_important() const
499 {
500   return Glib::PropertyProxy_ReadOnly< bool >(this, "is-important");
501 }
502 
503 
on_create_menu_proxy()504 bool Gtk::ToolItem::on_create_menu_proxy()
505 {
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).
508   );
509 
510   if(base && base->create_menu_proxy)
511     return (*base->create_menu_proxy)(gobj());
512 
513   typedef bool RType;
514   return RType();
515 }
on_toolbar_reconfigured()516 void Gtk::ToolItem::on_toolbar_reconfigured()
517 {
518   BaseClassType *const base = static_cast<BaseClassType*>(
519       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
520   );
521 
522   if(base && base->toolbar_reconfigured)
523     (*base->toolbar_reconfigured)(gobj());
524 }
525 
526 
527 } // namespace Gtk
528 
529 
530