Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / inputdialog.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3 #include <gtkmm/inputdialog.h>
4 #include <gtkmm/private/inputdialog_p.h>
5
6 // -*- c++ -*-
7 /* $Id$ */
8
9 /* 
10  *
11  * Copyright 1998-2002 The gtkmm Development Team
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Library General Public
15  * License as published by the Free Software Foundation; either
16  * version 2 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21  * Library General Public License for more details.
22  *
23  * You should have received a copy of the GNU Library General Public
24  * License along with this library; if not, write to the Free
25  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26  */
27
28 #include <gtk/gtkinputdialog.h>
29 #include <gtkmm/button.h>
30 #include <gtkmm/optionmenu.h>
31 #include <gtkmm/scrolledwindow.h>
32 #include <gtkmm/table.h>
33
34
35 namespace
36 {
37
38 void InputDialog_signal_enable_device_callback(GtkInputDialog* self, GdkDevice* p0,void* data)
39 {
40   using namespace Gtk;
41   typedef sigc::slot< void,const Glib::RefPtr<Gdk::Device>& > SlotType;
42
43   // Do not try to call a signal on a disassociated wrapper.
44   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
45   {
46     try
47     {
48       if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
49         (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
50 );
51     }
52     catch(...)
53     {
54       Glib::exception_handlers_invoke();
55     }
56   }
57 }
58
59 const Glib::SignalProxyInfo InputDialog_signal_enable_device_info =
60 {
61   "enable_device",
62   (GCallback) &InputDialog_signal_enable_device_callback,
63   (GCallback) &InputDialog_signal_enable_device_callback
64 };
65
66
67 void InputDialog_signal_disable_device_callback(GtkInputDialog* self, GdkDevice* p0,void* data)
68 {
69   using namespace Gtk;
70   typedef sigc::slot< void,const Glib::RefPtr<Gdk::Device>& > SlotType;
71
72   // Do not try to call a signal on a disassociated wrapper.
73   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
74   {
75     try
76     {
77       if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
78         (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
79 );
80     }
81     catch(...)
82     {
83       Glib::exception_handlers_invoke();
84     }
85   }
86 }
87
88 const Glib::SignalProxyInfo InputDialog_signal_disable_device_info =
89 {
90   "disable_device",
91   (GCallback) &InputDialog_signal_disable_device_callback,
92   (GCallback) &InputDialog_signal_disable_device_callback
93 };
94
95 } // anonymous namespace
96
97
98 namespace Glib
99 {
100
101 Gtk::InputDialog* wrap(GtkInputDialog* object, bool take_copy)
102 {
103   return dynamic_cast<Gtk::InputDialog *> (Glib::wrap_auto ((GObject*)(object), take_copy));
104 }
105
106 } /* namespace Glib */
107
108 namespace Gtk
109 {
110
111
112 /* The *_Class implementation: */
113
114 const Glib::Class& InputDialog_Class::init()
115 {
116   if(!gtype_) // create the GType if necessary
117   {
118     // Glib::Class has to know the class init function to clone custom types.
119     class_init_func_ = &InputDialog_Class::class_init_function;
120
121     // This is actually just optimized away, apparently with no harm.
122     // Make sure that the parent type has been created.
123     //CppClassParent::CppObjectType::get_type();
124
125     // Create the wrapper type, with the same class/instance size as the base type.
126     register_derived_type(gtk_input_dialog_get_type());
127
128     // Add derived versions of interfaces, if the C type implements any interfaces:
129   }
130
131   return *this;
132 }
133
134 void InputDialog_Class::class_init_function(void* g_class, void* class_data)
135 {
136   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
137   CppClassParent::class_init_function(klass, class_data);
138
139   klass->enable_device = &enable_device_callback;
140   klass->disable_device = &disable_device_callback;
141 }
142
143
144 void InputDialog_Class::enable_device_callback(GtkInputDialog* self, GdkDevice* p0)
145 {
146   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
147       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
148
149   // Non-gtkmmproc-generated custom classes implicitly call the default
150   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
151   // generated classes can use this optimisation, which avoids the unnecessary
152   // parameter conversions if there is no possibility of the virtual function
153   // being overridden:
154   if(obj && obj->is_derived_())
155   {
156     try // Trap C++ exceptions which would normally be lost because this is a C callback.
157     {
158       // Call the virtual member method, which derived classes might override.
159       obj->on_enable_device(Glib::wrap(p0, true)
160 );
161     }
162     catch(...)
163     {
164       Glib::exception_handlers_invoke();
165     }
166   }
167   else
168   {
169     BaseClassType *const base = static_cast<BaseClassType*>(
170         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
171     );
172
173     // Call the original underlying C function:
174     if(base && base->enable_device)
175       (*base->enable_device)(self, p0);
176   }
177 }
178
179 void InputDialog_Class::disable_device_callback(GtkInputDialog* self, GdkDevice* p0)
180 {
181   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
182       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
183
184   // Non-gtkmmproc-generated custom classes implicitly call the default
185   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
186   // generated classes can use this optimisation, which avoids the unnecessary
187   // parameter conversions if there is no possibility of the virtual function
188   // being overridden:
189   if(obj && obj->is_derived_())
190   {
191     try // Trap C++ exceptions which would normally be lost because this is a C callback.
192     {
193       // Call the virtual member method, which derived classes might override.
194       obj->on_disable_device(Glib::wrap(p0, true)
195 );
196     }
197     catch(...)
198     {
199       Glib::exception_handlers_invoke();
200     }
201   }
202   else
203   {
204     BaseClassType *const base = static_cast<BaseClassType*>(
205         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
206     );
207
208     // Call the original underlying C function:
209     if(base && base->disable_device)
210       (*base->disable_device)(self, p0);
211   }
212 }
213
214
215 Glib::ObjectBase* InputDialog_Class::wrap_new(GObject* o)
216 {
217   return new InputDialog((GtkInputDialog*)(o)); //top-level windows can not be manage()ed.
218
219 }
220
221
222 /* The implementation: */
223
224 InputDialog::InputDialog(const Glib::ConstructParams& construct_params)
225 :
226   Gtk::Dialog(construct_params)
227 {
228   }
229
230 InputDialog::InputDialog(GtkInputDialog* castitem)
231 :
232   Gtk::Dialog((GtkDialog*)(castitem))
233 {
234   }
235
236 InputDialog::~InputDialog()
237 {
238   destroy_();
239 }
240
241 InputDialog::CppClassType InputDialog::inputdialog_class_; // initialize static member
242
243 GType InputDialog::get_type()
244 {
245   return inputdialog_class_.init().get_type();
246 }
247
248 GType InputDialog::get_base_type()
249 {
250   return gtk_input_dialog_get_type();
251 }
252
253
254 InputDialog::InputDialog()
255 :
256   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
257   Gtk::Dialog(Glib::ConstructParams(inputdialog_class_.init()))
258 {
259   }
260
261 Table* InputDialog::get_axis_list()
262 {
263   return Glib::wrap((GtkTable*)(gobj()->axis_list));
264 }
265
266 const Table* InputDialog::get_axis_list() const
267 {
268   return Glib::wrap((GtkTable*)(gobj()->axis_list));
269 }
270
271 ScrolledWindow* InputDialog::get_axis_box()
272 {
273   return Glib::wrap((GtkScrolledWindow*)(gobj()->axis_listbox));
274 }
275
276 const ScrolledWindow* InputDialog::get_axis_box() const
277 {
278   return Glib::wrap((GtkScrolledWindow*)(gobj()->axis_listbox));
279 }
280
281 OptionMenu* InputDialog::get_mode_optionmenu()
282 {
283   return Glib::wrap((GtkOptionMenu*)(gobj()->mode_optionmenu));
284 }
285
286 const OptionMenu* InputDialog::get_mode_optionmenu() const
287 {
288   return Glib::wrap((GtkOptionMenu*)(gobj()->mode_optionmenu));
289 }
290
291 Button* InputDialog::get_close_button()
292 {
293   return Glib::wrap((GtkButton*)(gobj()->close_button));
294 }
295
296 const Button* InputDialog::get_close_button() const
297 {
298   return Glib::wrap((GtkButton*)(gobj()->close_button));
299 }
300
301 Button* InputDialog::get_save_button()
302 {
303   return Glib::wrap((GtkButton*)(gobj()->save_button));
304 }
305
306 const Button* InputDialog::get_save_button() const
307 {
308   return Glib::wrap((GtkButton*)(gobj()->save_button));
309 }
310
311 Glib::RefPtr<Gdk::Device> InputDialog::get_current_device()
312 {
313   Glib::RefPtr<Gdk::Device> ref_ptr(Glib::wrap(gobj()->current_device));
314
315   if(ref_ptr)
316     ref_ptr->reference();
317
318   return ref_ptr;
319 }
320
321 Glib::RefPtr<const Gdk::Device> InputDialog::get_current_device() const
322 {
323   Glib::RefPtr<const Gdk::Device> ref_ptr(Glib::wrap(gobj()->current_device));
324
325   if(ref_ptr)
326     ref_ptr->reference();
327
328   return ref_ptr;
329 }
330
331 Table* InputDialog::get_keys_list()
332 {
333   return Glib::wrap((GtkTable*)(gobj()->keys_list));
334 }
335
336 const Table* InputDialog::get_keys_list() const
337 {
338   return Glib::wrap((GtkTable*)(gobj()->keys_list));
339 }
340
341 ScrolledWindow* InputDialog::get_keys_box()
342 {
343   return Glib::wrap((GtkScrolledWindow*)(gobj()->keys_listbox));
344 }
345
346 const ScrolledWindow* InputDialog::get_keys_box() const
347 {
348   return Glib::wrap((GtkScrolledWindow*)(gobj()->keys_listbox));
349 }
350
351
352 Glib::SignalProxy1< void,const Glib::RefPtr<Gdk::Device>& > InputDialog::signal_enable_device()
353 {
354   return Glib::SignalProxy1< void,const Glib::RefPtr<Gdk::Device>& >(this, &InputDialog_signal_enable_device_info);
355 }
356
357 Glib::SignalProxy1< void,const Glib::RefPtr<Gdk::Device>& > InputDialog::signal_disable_device()
358 {
359   return Glib::SignalProxy1< void,const Glib::RefPtr<Gdk::Device>& >(this, &InputDialog_signal_disable_device_info);
360 }
361
362
363 void Gtk::InputDialog::on_enable_device(const Glib::RefPtr<Gdk::Device>& device)
364 {
365   BaseClassType *const base = static_cast<BaseClassType*>(
366       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
367   );
368
369   if(base && base->enable_device)
370     (*base->enable_device)(gobj(),Glib::unwrap(device));
371 }
372
373 void Gtk::InputDialog::on_disable_device(const Glib::RefPtr<Gdk::Device>& device)
374 {
375   BaseClassType *const base = static_cast<BaseClassType*>(
376       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
377   );
378
379   if(base && base->disable_device)
380     (*base->disable_device)(gobj(),Glib::unwrap(device));
381 }
382
383
384 } // namespace Gtk
385
386