Remove ancient/unused flowcanvas and libglademm from repository.
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / toolitem.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3
4 #include <gtkmm/toolitem.h>
5 #include <gtkmm/private/toolitem_p.h>
6
7 // -*- c++ -*-
8 /* $Id$ */
9
10 /* 
11  *
12  * Copyright 1998-2002 The gtkmm Development Team
13  *
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.
18  *
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.
23  *
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.
27  */
28
29 #include <gtk/gtktoolitem.h>
30
31 namespace Gtk
32 {
33
34 #ifndef GTKMM_DISABLE_DEPRECATED
35 Glib::SignalProxy3< bool,Tooltips*,const Glib::ustring&,const Glib::ustring& > ToolItem::signal_set_tooltip()
36 {
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);
40 }
41 #endif //GTKMM_DISABLE_DEPRECATED
42
43
44 } // namespace Gtk
45
46
47 namespace
48 {
49
50
51 static gboolean ToolItem_signal_create_menu_proxy_callback(GtkToolItem* self, void* data)
52 {
53   using namespace Gtk;
54   typedef sigc::slot< bool > SlotType;
55
56   // Do not try to call a signal on a disassociated wrapper.
57   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
58   {
59     #ifdef GLIBMM_EXCEPTIONS_ENABLED
60     try
61     {
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
66     }
67     catch(...)
68     {
69       Glib::exception_handlers_invoke();
70     }
71     #endif //GLIBMM_EXCEPTIONS_ENABLED
72   }
73
74   typedef gboolean RType;
75   return RType();
76 }
77
78 static gboolean ToolItem_signal_create_menu_proxy_notify_callback(GtkToolItem* self,  void* data)
79 {
80   using namespace Gtk;
81   typedef sigc::slot< void > SlotType;
82
83   // Do not try to call a signal on a disassociated wrapper.
84   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
85   {
86     #ifdef GLIBMM_EXCEPTIONS_ENABLED
87     try
88     {
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
93     }
94     catch(...)
95     {
96       Glib::exception_handlers_invoke();
97     }
98     #endif //GLIBMM_EXCEPTIONS_ENABLED
99   }
100
101   typedef gboolean RType;
102   return RType();
103 }
104
105 static const Glib::SignalProxyInfo ToolItem_signal_create_menu_proxy_info =
106 {
107   "create_menu_proxy",
108   (GCallback) &ToolItem_signal_create_menu_proxy_callback,
109   (GCallback) &ToolItem_signal_create_menu_proxy_notify_callback
110 };
111
112
113 static const Glib::SignalProxyInfo ToolItem_signal_toolbar_reconfigured_info =
114 {
115   "toolbar_reconfigured",
116   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
117   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
118 };
119
120
121 } // anonymous namespace
122
123
124 namespace Glib
125 {
126
127 Gtk::ToolItem* wrap(GtkToolItem* object, bool take_copy)
128 {
129   return dynamic_cast<Gtk::ToolItem *> (Glib::wrap_auto ((GObject*)(object), take_copy));
130 }
131
132 } /* namespace Glib */
133
134 namespace Gtk
135 {
136
137
138 /* The *_Class implementation: */
139
140 const Glib::Class& ToolItem_Class::init()
141 {
142   if(!gtype_) // create the GType if necessary
143   {
144     // Glib::Class has to know the class init function to clone custom types.
145     class_init_func_ = &ToolItem_Class::class_init_function;
146
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();
150
151     // Create the wrapper type, with the same class/instance size as the base type.
152     register_derived_type(gtk_tool_item_get_type());
153
154     // Add derived versions of interfaces, if the C type implements any interfaces:
155   }
156
157   return *this;
158 }
159
160 void ToolItem_Class::class_init_function(void* g_class, void* class_data)
161 {
162   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
163   CppClassParent::class_init_function(klass, class_data);
164
165 #ifdef GLIBMM_VFUNCS_ENABLED
166 #endif //GLIBMM_VFUNCS_ENABLED
167
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
172 }
173
174 #ifdef GLIBMM_VFUNCS_ENABLED
175 #endif //GLIBMM_VFUNCS_ENABLED
176
177 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
178 gboolean ToolItem_Class::create_menu_proxy_callback(GtkToolItem* self)
179 {
180   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
181       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
182
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
187   // being overridden:
188   if(obj_base && obj_base->is_derived_())
189   {
190     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
191     if(obj) // This can be NULL during destruction.
192     {
193       #ifdef GLIBMM_EXCEPTIONS_ENABLED
194       try // Trap C++ exceptions which would normally be lost because this is a C callback.
195       {
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
200       }
201       catch(...)
202       {
203         Glib::exception_handlers_invoke();
204       }
205       #endif //GLIBMM_EXCEPTIONS_ENABLED
206     }
207   }
208   
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).
211     );
212
213   // Call the original underlying C function:
214   if(base && base->create_menu_proxy)
215     return (*base->create_menu_proxy)(self);
216
217   typedef gboolean RType;
218   return RType();
219 }
220 void ToolItem_Class::toolbar_reconfigured_callback(GtkToolItem* self)
221 {
222   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
223       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
224
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
229   // being overridden:
230   if(obj_base && obj_base->is_derived_())
231   {
232     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
233     if(obj) // This can be NULL during destruction.
234     {
235       #ifdef GLIBMM_EXCEPTIONS_ENABLED
236       try // Trap C++ exceptions which would normally be lost because this is a C callback.
237       {
238       #endif //GLIBMM_EXCEPTIONS_ENABLED
239         // Call the virtual member method, which derived classes might override.
240         obj->on_toolbar_reconfigured();
241         return;
242       #ifdef GLIBMM_EXCEPTIONS_ENABLED
243       }
244       catch(...)
245       {
246         Glib::exception_handlers_invoke();
247       }
248       #endif //GLIBMM_EXCEPTIONS_ENABLED
249     }
250   }
251   
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).
254     );
255
256   // Call the original underlying C function:
257   if(base && base->toolbar_reconfigured)
258     (*base->toolbar_reconfigured)(self);
259 }
260 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
261
262
263 Glib::ObjectBase* ToolItem_Class::wrap_new(GObject* o)
264 {
265   return manage(new ToolItem((GtkToolItem*)(o)));
266
267 }
268
269
270 /* The implementation: */
271
272 ToolItem::ToolItem(const Glib::ConstructParams& construct_params)
273 :
274   Gtk::Bin(construct_params)
275 {
276   }
277
278 ToolItem::ToolItem(GtkToolItem* castitem)
279 :
280   Gtk::Bin((GtkBin*)(castitem))
281 {
282   }
283
284 ToolItem::~ToolItem()
285 {
286   destroy_();
287 }
288
289 ToolItem::CppClassType ToolItem::toolitem_class_; // initialize static member
290
291 GType ToolItem::get_type()
292 {
293   return toolitem_class_.init().get_type();
294 }
295
296 GType ToolItem::get_base_type()
297 {
298   return gtk_tool_item_get_type();
299 }
300
301
302 ToolItem::ToolItem()
303 :
304   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
305   Glib::ObjectBase(0),
306   Gtk::Bin(Glib::ConstructParams(toolitem_class_.init()))
307 {
308   }
309
310 void ToolItem::set_homogeneous(bool homogeneous)
311 {
312 gtk_tool_item_set_homogeneous(gobj(), static_cast<int>(homogeneous)); 
313 }
314
315 bool ToolItem::get_homogeneous() const
316 {
317   return gtk_tool_item_get_homogeneous(const_cast<GtkToolItem*>(gobj()));
318 }
319
320 void ToolItem::set_expand(bool expand)
321 {
322 gtk_tool_item_set_expand(gobj(), static_cast<int>(expand)); 
323 }
324
325 bool ToolItem::get_expand() const
326 {
327   return gtk_tool_item_get_expand(const_cast<GtkToolItem*>(gobj()));
328 }
329
330 #ifndef GTKMM_DISABLE_DEPRECATED
331
332 void ToolItem::set_tooltip(Tooltips& tooltips, const Glib::ustring& tip_text, const Glib::ustring& tip_private)
333 {
334 gtk_tool_item_set_tooltip(gobj(), (tooltips).gobj(), tip_text.c_str(), tip_private.c_str()); 
335 }
336
337 #endif // GTKMM_DISABLE_DEPRECATED
338
339 void ToolItem::set_tooltip_text(const Glib::ustring& text)
340 {
341 gtk_tool_item_set_tooltip_text(gobj(), text.c_str()); 
342 }
343
344 void ToolItem::set_tooltip_markup(const Glib::ustring& markup)
345 {
346 gtk_tool_item_set_tooltip_markup(gobj(), markup.c_str()); 
347 }
348
349 void ToolItem::set_use_drag_window(bool use_drag_window)
350 {
351 gtk_tool_item_set_use_drag_window(gobj(), static_cast<int>(use_drag_window)); 
352 }
353
354 bool ToolItem::get_use_drag_window() const
355 {
356   return gtk_tool_item_get_use_drag_window(const_cast<GtkToolItem*>(gobj()));
357 }
358
359 void ToolItem::set_visible_horizontal(bool visible_horizontal)
360 {
361 gtk_tool_item_set_visible_horizontal(gobj(), static_cast<int>(visible_horizontal)); 
362 }
363
364 bool ToolItem::get_visible_horizontal() const
365 {
366   return gtk_tool_item_get_visible_horizontal(const_cast<GtkToolItem*>(gobj()));
367 }
368
369 void ToolItem::set_visible_vertical(bool visible_vertical)
370 {
371 gtk_tool_item_set_visible_vertical(gobj(), static_cast<int>(visible_vertical)); 
372 }
373
374 bool ToolItem::get_visible_vertical() const
375 {
376   return gtk_tool_item_get_visible_vertical(const_cast<GtkToolItem*>(gobj()));
377 }
378
379 bool ToolItem::get_is_important() const
380 {
381   return gtk_tool_item_get_is_important(const_cast<GtkToolItem*>(gobj()));
382 }
383
384 void ToolItem::set_is_important(bool is_important)
385 {
386 gtk_tool_item_set_is_important(gobj(), static_cast<int>(is_important)); 
387 }
388
389 IconSize ToolItem::get_icon_size() const
390 {
391   return IconSize(static_cast<int>(gtk_tool_item_get_icon_size(const_cast<GtkToolItem*>(gobj()))));
392 }
393
394 Orientation ToolItem::get_orientation() const
395 {
396   return ((Orientation)(gtk_tool_item_get_orientation(const_cast<GtkToolItem*>(gobj()))));
397 }
398
399 ToolbarStyle ToolItem::get_toolbar_style() const
400 {
401   return ((ToolbarStyle)(gtk_tool_item_get_toolbar_style(const_cast<GtkToolItem*>(gobj()))));
402 }
403
404 ReliefStyle ToolItem::get_relief_style() const
405 {
406   return ((ReliefStyle)(gtk_tool_item_get_relief_style(const_cast<GtkToolItem*>(gobj()))));
407 }
408
409 Widget* ToolItem::retrieve_proxy_menu_item()
410 {
411   return Glib::wrap(gtk_tool_item_retrieve_proxy_menu_item(gobj()));
412 }
413
414 const Widget* ToolItem::retrieve_proxy_menu_item() const
415 {
416   return const_cast<ToolItem*>(this)->retrieve_proxy_menu_item();
417 }
418
419 Widget* ToolItem::get_proxy_menu_item(const Glib::ustring& menu_item_id)
420 {
421   return Glib::wrap(gtk_tool_item_get_proxy_menu_item(gobj(), menu_item_id.c_str()));
422 }
423
424 const Widget* ToolItem::get_proxy_menu_item(const Glib::ustring& menu_item_id) const
425 {
426   return const_cast<ToolItem*>(this)->get_proxy_menu_item(menu_item_id);
427 }
428
429 void ToolItem::set_proxy_menu_item(const Glib::ustring& menu_item_id, Widget& menu_item)
430 {
431 gtk_tool_item_set_proxy_menu_item(gobj(), menu_item_id.c_str(), (menu_item).gobj()); 
432 }
433
434 void ToolItem::rebuild_menu()
435 {
436 gtk_tool_item_rebuild_menu(gobj()); 
437 }
438
439
440 Glib::SignalProxy0< bool > ToolItem::signal_create_menu_proxy()
441 {
442   return Glib::SignalProxy0< bool >(this, &ToolItem_signal_create_menu_proxy_info);
443 }
444
445
446 Glib::SignalProxy0< void > ToolItem::signal_toolbar_reconfigured()
447 {
448   return Glib::SignalProxy0< void >(this, &ToolItem_signal_toolbar_reconfigured_info);
449 }
450
451
452 #ifdef GLIBMM_PROPERTIES_ENABLED
453 Glib::PropertyProxy<bool> ToolItem::property_visible_horizontal() 
454 {
455   return Glib::PropertyProxy<bool>(this, "visible-horizontal");
456 }
457 #endif //GLIBMM_PROPERTIES_ENABLED
458
459 #ifdef GLIBMM_PROPERTIES_ENABLED
460 Glib::PropertyProxy_ReadOnly<bool> ToolItem::property_visible_horizontal() const
461 {
462   return Glib::PropertyProxy_ReadOnly<bool>(this, "visible-horizontal");
463 }
464 #endif //GLIBMM_PROPERTIES_ENABLED
465
466 #ifdef GLIBMM_PROPERTIES_ENABLED
467 Glib::PropertyProxy<bool> ToolItem::property_visible_vertical() 
468 {
469   return Glib::PropertyProxy<bool>(this, "visible-vertical");
470 }
471 #endif //GLIBMM_PROPERTIES_ENABLED
472
473 #ifdef GLIBMM_PROPERTIES_ENABLED
474 Glib::PropertyProxy_ReadOnly<bool> ToolItem::property_visible_vertical() const
475 {
476   return Glib::PropertyProxy_ReadOnly<bool>(this, "visible-vertical");
477 }
478 #endif //GLIBMM_PROPERTIES_ENABLED
479
480 #ifdef GLIBMM_PROPERTIES_ENABLED
481 Glib::PropertyProxy<bool> ToolItem::property_is_important() 
482 {
483   return Glib::PropertyProxy<bool>(this, "is-important");
484 }
485 #endif //GLIBMM_PROPERTIES_ENABLED
486
487 #ifdef GLIBMM_PROPERTIES_ENABLED
488 Glib::PropertyProxy_ReadOnly<bool> ToolItem::property_is_important() const
489 {
490   return Glib::PropertyProxy_ReadOnly<bool>(this, "is-important");
491 }
492 #endif //GLIBMM_PROPERTIES_ENABLED
493
494
495 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
496 bool Gtk::ToolItem::on_create_menu_proxy()
497 {
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).
500   );
501
502   if(base && base->create_menu_proxy)
503     return (*base->create_menu_proxy)(gobj());
504
505   typedef bool RType;
506   return RType();
507 }
508 void Gtk::ToolItem::on_toolbar_reconfigured()
509 {
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).
512   );
513
514   if(base && base->toolbar_reconfigured)
515     (*base->toolbar_reconfigured)(gobj());
516 }
517 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
518
519 #ifdef GLIBMM_VFUNCS_ENABLED
520 #endif //GLIBMM_VFUNCS_ENABLED
521
522
523 } // namespace Gtk
524
525