Remove ancient/unused flowcanvas and libglademm from repository.
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / cellrendereraccel.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3
4 #include <gtkmm/cellrendereraccel.h>
5 #include <gtkmm/private/cellrendereraccel_p.h>
6
7 // -*- c++ -*-
8 /* $Id: cellrendereraccel.ccg,v 1.2 2006/05/11 11:40:24 murrayc Exp $ */
9
10 /* 
11  *
12  * Copyright 2005 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/gtkcellrendereraccel.h>
30
31 namespace Gtk
32 {
33
34 #ifdef GLIBMM_PROPERTIES_ENABLED
35 Glib::PropertyProxy_Base CellRendererAccel::_property_renderable()
36 {
37   //Renderering just this one property would probably not be meaningful.
38   return property_accel_key();
39 }
40 #endif //GLIBMM_PROPERTIES_ENABLED
41
42 } //namespace Gtk
43
44 namespace
45 {
46
47
48 static void CellRendererAccel_signal_accel_edited_callback(GtkCellRendererAccel* self, const gchar* p0,guint p1,GdkModifierType p2,guint p3,void* data)
49 {
50   using namespace Gtk;
51   typedef sigc::slot< void,const Glib::ustring&,guint,Gdk::ModifierType,guint > SlotType;
52
53   // Do not try to call a signal on a disassociated wrapper.
54   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
55   {
56     #ifdef GLIBMM_EXCEPTIONS_ENABLED
57     try
58     {
59     #endif //GLIBMM_EXCEPTIONS_ENABLED
60       if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
61         (*static_cast<SlotType*>(slot))(Glib::convert_const_gchar_ptr_to_ustring(p0)
62 , p1, ((Gdk::ModifierType)(p2))
63 , p3);
64     #ifdef GLIBMM_EXCEPTIONS_ENABLED
65     }
66     catch(...)
67     {
68       Glib::exception_handlers_invoke();
69     }
70     #endif //GLIBMM_EXCEPTIONS_ENABLED
71   }
72 }
73
74 static const Glib::SignalProxyInfo CellRendererAccel_signal_accel_edited_info =
75 {
76   "accel_edited",
77   (GCallback) &CellRendererAccel_signal_accel_edited_callback,
78   (GCallback) &CellRendererAccel_signal_accel_edited_callback
79 };
80
81
82 static void CellRendererAccel_signal_accel_cleared_callback(GtkCellRendererAccel* self, const gchar* p0,void* data)
83 {
84   using namespace Gtk;
85   typedef sigc::slot< void,const Glib::ustring& > SlotType;
86
87   // Do not try to call a signal on a disassociated wrapper.
88   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
89   {
90     #ifdef GLIBMM_EXCEPTIONS_ENABLED
91     try
92     {
93     #endif //GLIBMM_EXCEPTIONS_ENABLED
94       if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
95         (*static_cast<SlotType*>(slot))(Glib::convert_const_gchar_ptr_to_ustring(p0)
96 );
97     #ifdef GLIBMM_EXCEPTIONS_ENABLED
98     }
99     catch(...)
100     {
101       Glib::exception_handlers_invoke();
102     }
103     #endif //GLIBMM_EXCEPTIONS_ENABLED
104   }
105 }
106
107 static const Glib::SignalProxyInfo CellRendererAccel_signal_accel_cleared_info =
108 {
109   "accel_cleared",
110   (GCallback) &CellRendererAccel_signal_accel_cleared_callback,
111   (GCallback) &CellRendererAccel_signal_accel_cleared_callback
112 };
113
114
115 } // anonymous namespace
116
117
118 namespace Glib
119 {
120
121 Gtk::CellRendererAccel* wrap(GtkCellRendererAccel* object, bool take_copy)
122 {
123   return dynamic_cast<Gtk::CellRendererAccel *> (Glib::wrap_auto ((GObject*)(object), take_copy));
124 }
125
126 } /* namespace Glib */
127
128 namespace Gtk
129 {
130
131
132 /* The *_Class implementation: */
133
134 const Glib::Class& CellRendererAccel_Class::init()
135 {
136   if(!gtype_) // create the GType if necessary
137   {
138     // Glib::Class has to know the class init function to clone custom types.
139     class_init_func_ = &CellRendererAccel_Class::class_init_function;
140
141     // This is actually just optimized away, apparently with no harm.
142     // Make sure that the parent type has been created.
143     //CppClassParent::CppObjectType::get_type();
144
145     // Create the wrapper type, with the same class/instance size as the base type.
146     register_derived_type(gtk_cell_renderer_accel_get_type());
147
148     // Add derived versions of interfaces, if the C type implements any interfaces:
149   }
150
151   return *this;
152 }
153
154 void CellRendererAccel_Class::class_init_function(void* g_class, void* class_data)
155 {
156   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
157   CppClassParent::class_init_function(klass, class_data);
158
159 #ifdef GLIBMM_VFUNCS_ENABLED
160 #endif //GLIBMM_VFUNCS_ENABLED
161
162 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
163   klass->accel_edited = &accel_edited_callback;
164   klass->accel_cleared = &accel_cleared_callback;
165 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
166 }
167
168 #ifdef GLIBMM_VFUNCS_ENABLED
169 #endif //GLIBMM_VFUNCS_ENABLED
170
171 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
172 void CellRendererAccel_Class::accel_edited_callback(GtkCellRendererAccel* self, const gchar* p0, guint p1, GdkModifierType p2, guint p3)
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       #ifdef GLIBMM_EXCEPTIONS_ENABLED
188       try // Trap C++ exceptions which would normally be lost because this is a C callback.
189       {
190       #endif //GLIBMM_EXCEPTIONS_ENABLED
191         // Call the virtual member method, which derived classes might override.
192         obj->on_accel_edited(Glib::convert_const_gchar_ptr_to_ustring(p0)
193 , p1, ((Gdk::ModifierType)(p2))
194 , p3);
195         return;
196       #ifdef GLIBMM_EXCEPTIONS_ENABLED
197       }
198       catch(...)
199       {
200         Glib::exception_handlers_invoke();
201       }
202       #endif //GLIBMM_EXCEPTIONS_ENABLED
203     }
204   }
205   
206   BaseClassType *const base = static_cast<BaseClassType*>(
207         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
208     );
209
210   // Call the original underlying C function:
211   if(base && base->accel_edited)
212     (*base->accel_edited)(self, p0, p1, p2, p3);
213 }
214 void CellRendererAccel_Class::accel_cleared_callback(GtkCellRendererAccel* self, const gchar* p0)
215 {
216   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
217       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
218
219   // Non-gtkmmproc-generated custom classes implicitly call the default
220   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
221   // generated classes can use this optimisation, which avoids the unnecessary
222   // parameter conversions if there is no possibility of the virtual function
223   // being overridden:
224   if(obj_base && obj_base->is_derived_())
225   {
226     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
227     if(obj) // This can be NULL during destruction.
228     {
229       #ifdef GLIBMM_EXCEPTIONS_ENABLED
230       try // Trap C++ exceptions which would normally be lost because this is a C callback.
231       {
232       #endif //GLIBMM_EXCEPTIONS_ENABLED
233         // Call the virtual member method, which derived classes might override.
234         obj->on_accel_cleared(Glib::convert_const_gchar_ptr_to_ustring(p0)
235 );
236         return;
237       #ifdef GLIBMM_EXCEPTIONS_ENABLED
238       }
239       catch(...)
240       {
241         Glib::exception_handlers_invoke();
242       }
243       #endif //GLIBMM_EXCEPTIONS_ENABLED
244     }
245   }
246   
247   BaseClassType *const base = static_cast<BaseClassType*>(
248         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
249     );
250
251   // Call the original underlying C function:
252   if(base && base->accel_cleared)
253     (*base->accel_cleared)(self, p0);
254 }
255 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
256
257
258 Glib::ObjectBase* CellRendererAccel_Class::wrap_new(GObject* o)
259 {
260   return manage(new CellRendererAccel((GtkCellRendererAccel*)(o)));
261
262 }
263
264
265 /* The implementation: */
266
267 CellRendererAccel::CellRendererAccel(const Glib::ConstructParams& construct_params)
268 :
269   Gtk::CellRendererText(construct_params)
270 {
271   }
272
273 CellRendererAccel::CellRendererAccel(GtkCellRendererAccel* castitem)
274 :
275   Gtk::CellRendererText((GtkCellRendererText*)(castitem))
276 {
277   }
278
279 CellRendererAccel::~CellRendererAccel()
280 {
281   destroy_();
282 }
283
284 CellRendererAccel::CppClassType CellRendererAccel::cellrendereraccel_class_; // initialize static member
285
286 GType CellRendererAccel::get_type()
287 {
288   return cellrendereraccel_class_.init().get_type();
289 }
290
291 GType CellRendererAccel::get_base_type()
292 {
293   return gtk_cell_renderer_accel_get_type();
294 }
295
296
297 CellRendererAccel::CellRendererAccel()
298 :
299   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
300   Glib::ObjectBase(0),
301   Gtk::CellRendererText(Glib::ConstructParams(cellrendereraccel_class_.init()))
302 {
303   }
304
305
306 Glib::SignalProxy4< void,const Glib::ustring&,guint,Gdk::ModifierType,guint > CellRendererAccel::signal_accel_edited()
307 {
308   return Glib::SignalProxy4< void,const Glib::ustring&,guint,Gdk::ModifierType,guint >(this, &CellRendererAccel_signal_accel_edited_info);
309 }
310
311
312 Glib::SignalProxy1< void,const Glib::ustring& > CellRendererAccel::signal_accel_cleared()
313 {
314   return Glib::SignalProxy1< void,const Glib::ustring& >(this, &CellRendererAccel_signal_accel_cleared_info);
315 }
316
317
318 #ifdef GLIBMM_PROPERTIES_ENABLED
319 Glib::PropertyProxy<guint> CellRendererAccel::property_accel_key() 
320 {
321   return Glib::PropertyProxy<guint>(this, "accel-key");
322 }
323 #endif //GLIBMM_PROPERTIES_ENABLED
324
325 #ifdef GLIBMM_PROPERTIES_ENABLED
326 Glib::PropertyProxy_ReadOnly<guint> CellRendererAccel::property_accel_key() const
327 {
328   return Glib::PropertyProxy_ReadOnly<guint>(this, "accel-key");
329 }
330 #endif //GLIBMM_PROPERTIES_ENABLED
331
332 #ifdef GLIBMM_PROPERTIES_ENABLED
333 Glib::PropertyProxy<Gdk::ModifierType> CellRendererAccel::property_accel_mods() 
334 {
335   return Glib::PropertyProxy<Gdk::ModifierType>(this, "accel-mods");
336 }
337 #endif //GLIBMM_PROPERTIES_ENABLED
338
339 #ifdef GLIBMM_PROPERTIES_ENABLED
340 Glib::PropertyProxy_ReadOnly<Gdk::ModifierType> CellRendererAccel::property_accel_mods() const
341 {
342   return Glib::PropertyProxy_ReadOnly<Gdk::ModifierType>(this, "accel-mods");
343 }
344 #endif //GLIBMM_PROPERTIES_ENABLED
345
346 #ifdef GLIBMM_PROPERTIES_ENABLED
347 Glib::PropertyProxy<guint> CellRendererAccel::property_keycode() 
348 {
349   return Glib::PropertyProxy<guint>(this, "keycode");
350 }
351 #endif //GLIBMM_PROPERTIES_ENABLED
352
353 #ifdef GLIBMM_PROPERTIES_ENABLED
354 Glib::PropertyProxy_ReadOnly<guint> CellRendererAccel::property_keycode() const
355 {
356   return Glib::PropertyProxy_ReadOnly<guint>(this, "keycode");
357 }
358 #endif //GLIBMM_PROPERTIES_ENABLED
359
360
361 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
362 void Gtk::CellRendererAccel::on_accel_edited(const Glib::ustring& path_string, guint accel_key, Gdk::ModifierType accel_mods, guint hardware_keycode)
363 {
364   BaseClassType *const base = static_cast<BaseClassType*>(
365       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
366   );
367
368   if(base && base->accel_edited)
369     (*base->accel_edited)(gobj(),path_string.c_str(),accel_key,((GdkModifierType)(accel_mods)),hardware_keycode);
370 }
371 void Gtk::CellRendererAccel::on_accel_cleared(const Glib::ustring& path_string)
372 {
373   BaseClassType *const base = static_cast<BaseClassType*>(
374       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
375   );
376
377   if(base && base->accel_cleared)
378     (*base->accel_cleared)(gobj(),path_string.c_str());
379 }
380 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
381
382 #ifdef GLIBMM_VFUNCS_ENABLED
383 #endif //GLIBMM_VFUNCS_ENABLED
384
385
386 } // namespace Gtk
387
388