Upgrade gtkmm to 2.10.8, glibmm to 2.13.3 and add cairomm 1.2.4
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / menutoolbutton.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3
4 #include <gtkmm/menutoolbutton.h>
5 #include <gtkmm/private/menutoolbutton_p.h>
6
7 // -*- c++ -*-
8 /* $Id$ */
9
10 /* 
11  *
12  * Copyright 2003 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/gtkmenutoolbutton.h>
30
31 namespace Gtk
32 {
33
34 MenuToolButton::MenuToolButton(const Glib::ustring& label)
35 :
36   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
37   Gtk::ToolButton(Glib::ConstructParams(menutoolbutton_class_.init(), "label", label.c_str(), (char*) 0))
38 {
39 }
40
41 MenuToolButton::MenuToolButton(Widget& icon_widget, const Glib::ustring& label)
42 :
43   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
44   Gtk::ToolButton(Glib::ConstructParams(menutoolbutton_class_.init(), "icon_widget", (icon_widget).gobj(), "label", label.c_str(), (char*) 0))
45 {
46 }
47
48 } // namespace Gtk
49
50
51 namespace
52 {
53
54
55 static const Glib::SignalProxyInfo MenuToolButton_signal_show_menu_info =
56 {
57   "show_menu",
58   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
59   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
60 };
61
62
63 } // anonymous namespace
64
65
66 namespace Glib
67 {
68
69 Gtk::MenuToolButton* wrap(GtkMenuToolButton* object, bool take_copy)
70 {
71   return dynamic_cast<Gtk::MenuToolButton *> (Glib::wrap_auto ((GObject*)(object), take_copy));
72 }
73
74 } /* namespace Glib */
75
76 namespace Gtk
77 {
78
79
80 /* The *_Class implementation: */
81
82 const Glib::Class& MenuToolButton_Class::init()
83 {
84   if(!gtype_) // create the GType if necessary
85   {
86     // Glib::Class has to know the class init function to clone custom types.
87     class_init_func_ = &MenuToolButton_Class::class_init_function;
88
89     // This is actually just optimized away, apparently with no harm.
90     // Make sure that the parent type has been created.
91     //CppClassParent::CppObjectType::get_type();
92
93     // Create the wrapper type, with the same class/instance size as the base type.
94     register_derived_type(gtk_menu_tool_button_get_type());
95
96     // Add derived versions of interfaces, if the C type implements any interfaces:
97   }
98
99   return *this;
100 }
101
102 void MenuToolButton_Class::class_init_function(void* g_class, void* class_data)
103 {
104   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
105   CppClassParent::class_init_function(klass, class_data);
106
107 #ifdef GLIBMM_VFUNCS_ENABLED
108 #endif //GLIBMM_VFUNCS_ENABLED
109
110 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
111   klass->show_menu = &show_menu_callback;
112 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
113 }
114
115 #ifdef GLIBMM_VFUNCS_ENABLED
116 #endif //GLIBMM_VFUNCS_ENABLED
117
118 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
119 void MenuToolButton_Class::show_menu_callback(GtkMenuToolButton* self)
120 {
121   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
122       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
123
124   // Non-gtkmmproc-generated custom classes implicitly call the default
125   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
126   // generated classes can use this optimisation, which avoids the unnecessary
127   // parameter conversions if there is no possibility of the virtual function
128   // being overridden:
129   if(obj && obj->is_derived_())
130   {
131     #ifdef GLIBMM_EXCEPTIONS_ENABLED
132     try // Trap C++ exceptions which would normally be lost because this is a C callback.
133     {
134     #endif //GLIBMM_EXCEPTIONS_ENABLED
135       // Call the virtual member method, which derived classes might override.
136       obj->on_show_menu();
137     #ifdef GLIBMM_EXCEPTIONS_ENABLED
138     }
139     catch(...)
140     {
141       Glib::exception_handlers_invoke();
142     }
143     #endif //GLIBMM_EXCEPTIONS_ENABLED
144   }
145   else
146   {
147     BaseClassType *const base = static_cast<BaseClassType*>(
148         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
149     );
150
151     // Call the original underlying C function:
152     if(base && base->show_menu)
153       (*base->show_menu)(self);
154   }
155 }
156 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
157
158
159 Glib::ObjectBase* MenuToolButton_Class::wrap_new(GObject* o)
160 {
161   return manage(new MenuToolButton((GtkMenuToolButton*)(o)));
162
163 }
164
165
166 /* The implementation: */
167
168 MenuToolButton::MenuToolButton(const Glib::ConstructParams& construct_params)
169 :
170   Gtk::ToolButton(construct_params)
171 {
172   }
173
174 MenuToolButton::MenuToolButton(GtkMenuToolButton* castitem)
175 :
176   Gtk::ToolButton((GtkToolButton*)(castitem))
177 {
178   }
179
180 MenuToolButton::~MenuToolButton()
181 {
182   destroy_();
183 }
184
185 MenuToolButton::CppClassType MenuToolButton::menutoolbutton_class_; // initialize static member
186
187 GType MenuToolButton::get_type()
188 {
189   return menutoolbutton_class_.init().get_type();
190 }
191
192 GType MenuToolButton::get_base_type()
193 {
194   return gtk_menu_tool_button_get_type();
195 }
196
197
198 MenuToolButton::MenuToolButton()
199 :
200   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
201   Gtk::ToolButton(Glib::ConstructParams(menutoolbutton_class_.init()))
202 {
203   }
204
205 MenuToolButton::MenuToolButton(const Gtk::StockID& stock_id)
206 :
207   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
208   Gtk::ToolButton(Glib::ConstructParams(menutoolbutton_class_.init(), "stock_id", (stock_id).get_c_str(), (char*) 0))
209 {
210   }
211
212 void MenuToolButton::set_menu(Menu& menu)
213 {
214 gtk_menu_tool_button_set_menu(gobj(), (menu).Gtk::Widget::gobj()); 
215 }
216
217 Menu* MenuToolButton::get_menu()
218 {
219   return Glib::wrap((GtkMenu*)(gtk_menu_tool_button_get_menu(gobj())));
220 }
221
222 const Menu* MenuToolButton::get_menu() const
223 {
224   return const_cast<MenuToolButton*>(this)->get_menu();
225 }
226
227 void MenuToolButton::set_arrow_tooltip(Tooltips& tooltips, const Glib::ustring& tip_text, const Glib::ustring& tip_private)
228 {
229 gtk_menu_tool_button_set_arrow_tooltip(gobj(), (tooltips).gobj(), tip_text.c_str(), tip_private.c_str()); 
230 }
231
232
233 Glib::SignalProxy0< void > MenuToolButton::signal_show_menu()
234 {
235   return Glib::SignalProxy0< void >(this, &MenuToolButton_signal_show_menu_info);
236 }
237
238
239 #ifdef GLIBMM_PROPERTIES_ENABLED
240 Glib::PropertyProxy<Menu*> MenuToolButton::property_menu() 
241 {
242   return Glib::PropertyProxy<Menu*>(this, "menu");
243 }
244 #endif //GLIBMM_PROPERTIES_ENABLED
245
246 #ifdef GLIBMM_PROPERTIES_ENABLED
247 Glib::PropertyProxy_ReadOnly<Menu*> MenuToolButton::property_menu() const
248 {
249   return Glib::PropertyProxy_ReadOnly<Menu*>(this, "menu");
250 }
251 #endif //GLIBMM_PROPERTIES_ENABLED
252
253
254 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
255 void Gtk::MenuToolButton::on_show_menu()
256 {
257   BaseClassType *const base = static_cast<BaseClassType*>(
258       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
259   );
260
261   if(base && base->show_menu)
262     (*base->show_menu)(gobj());
263 }
264 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
265
266 #ifdef GLIBMM_VFUNCS_ENABLED
267 #endif //GLIBMM_VFUNCS_ENABLED
268
269
270 } // namespace Gtk
271
272