moved 2.1-staging to trunk @ rev 1765
[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   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
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 && obj->is_derived_())
183   {
184     #ifdef GLIBMM_EXCEPTIONS_ENABLED
185     try // Trap C++ exceptions which would normally be lost because this is a C callback.
186     {
187     #endif //GLIBMM_EXCEPTIONS_ENABLED
188       // Call the virtual member method, which derived classes might override.
189       obj->on_accel_edited(Glib::convert_const_gchar_ptr_to_ustring(p0)
190 , p1, ((Gdk::ModifierType)(p2))
191 , p3);
192     #ifdef GLIBMM_EXCEPTIONS_ENABLED
193     }
194     catch(...)
195     {
196       Glib::exception_handlers_invoke();
197     }
198     #endif //GLIBMM_EXCEPTIONS_ENABLED
199   }
200   else
201   {
202     BaseClassType *const base = static_cast<BaseClassType*>(
203         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
204     );
205
206     // Call the original underlying C function:
207     if(base && base->accel_edited)
208       (*base->accel_edited)(self, p0, p1, p2, p3);
209   }
210 }
211 void CellRendererAccel_Class::accel_cleared_callback(GtkCellRendererAccel* self, const gchar* p0)
212 {
213   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
214       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
215
216   // Non-gtkmmproc-generated custom classes implicitly call the default
217   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
218   // generated classes can use this optimisation, which avoids the unnecessary
219   // parameter conversions if there is no possibility of the virtual function
220   // being overridden:
221   if(obj && obj->is_derived_())
222   {
223     #ifdef GLIBMM_EXCEPTIONS_ENABLED
224     try // Trap C++ exceptions which would normally be lost because this is a C callback.
225     {
226     #endif //GLIBMM_EXCEPTIONS_ENABLED
227       // Call the virtual member method, which derived classes might override.
228       obj->on_accel_cleared(Glib::convert_const_gchar_ptr_to_ustring(p0)
229 );
230     #ifdef GLIBMM_EXCEPTIONS_ENABLED
231     }
232     catch(...)
233     {
234       Glib::exception_handlers_invoke();
235     }
236     #endif //GLIBMM_EXCEPTIONS_ENABLED
237   }
238   else
239   {
240     BaseClassType *const base = static_cast<BaseClassType*>(
241         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
242     );
243
244     // Call the original underlying C function:
245     if(base && base->accel_cleared)
246       (*base->accel_cleared)(self, p0);
247   }
248 }
249 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
250
251
252 Glib::ObjectBase* CellRendererAccel_Class::wrap_new(GObject* o)
253 {
254   return manage(new CellRendererAccel((GtkCellRendererAccel*)(o)));
255
256 }
257
258
259 /* The implementation: */
260
261 CellRendererAccel::CellRendererAccel(const Glib::ConstructParams& construct_params)
262 :
263   Gtk::CellRendererText(construct_params)
264 {
265   }
266
267 CellRendererAccel::CellRendererAccel(GtkCellRendererAccel* castitem)
268 :
269   Gtk::CellRendererText((GtkCellRendererText*)(castitem))
270 {
271   }
272
273 CellRendererAccel::~CellRendererAccel()
274 {
275   destroy_();
276 }
277
278 CellRendererAccel::CppClassType CellRendererAccel::cellrendereraccel_class_; // initialize static member
279
280 GType CellRendererAccel::get_type()
281 {
282   return cellrendereraccel_class_.init().get_type();
283 }
284
285 GType CellRendererAccel::get_base_type()
286 {
287   return gtk_cell_renderer_accel_get_type();
288 }
289
290
291 CellRendererAccel::CellRendererAccel()
292 :
293   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
294   Gtk::CellRendererText(Glib::ConstructParams(cellrendereraccel_class_.init()))
295 {
296   }
297
298
299 Glib::SignalProxy4< void,const Glib::ustring&,guint,Gdk::ModifierType,guint > CellRendererAccel::signal_accel_edited()
300 {
301   return Glib::SignalProxy4< void,const Glib::ustring&,guint,Gdk::ModifierType,guint >(this, &CellRendererAccel_signal_accel_edited_info);
302 }
303
304
305 Glib::SignalProxy1< void,const Glib::ustring& > CellRendererAccel::signal_accel_cleared()
306 {
307   return Glib::SignalProxy1< void,const Glib::ustring& >(this, &CellRendererAccel_signal_accel_cleared_info);
308 }
309
310
311 #ifdef GLIBMM_PROPERTIES_ENABLED
312 Glib::PropertyProxy<guint> CellRendererAccel::property_accel_key() 
313 {
314   return Glib::PropertyProxy<guint>(this, "accel-key");
315 }
316 #endif //GLIBMM_PROPERTIES_ENABLED
317
318 #ifdef GLIBMM_PROPERTIES_ENABLED
319 Glib::PropertyProxy_ReadOnly<guint> CellRendererAccel::property_accel_key() const
320 {
321   return Glib::PropertyProxy_ReadOnly<guint>(this, "accel-key");
322 }
323 #endif //GLIBMM_PROPERTIES_ENABLED
324
325 #ifdef GLIBMM_PROPERTIES_ENABLED
326 Glib::PropertyProxy<Gdk::ModifierType> CellRendererAccel::property_accel_mods() 
327 {
328   return Glib::PropertyProxy<Gdk::ModifierType>(this, "accel-mods");
329 }
330 #endif //GLIBMM_PROPERTIES_ENABLED
331
332 #ifdef GLIBMM_PROPERTIES_ENABLED
333 Glib::PropertyProxy_ReadOnly<Gdk::ModifierType> CellRendererAccel::property_accel_mods() const
334 {
335   return Glib::PropertyProxy_ReadOnly<Gdk::ModifierType>(this, "accel-mods");
336 }
337 #endif //GLIBMM_PROPERTIES_ENABLED
338
339 #ifdef GLIBMM_PROPERTIES_ENABLED
340 Glib::PropertyProxy<guint> CellRendererAccel::property_keycode() 
341 {
342   return Glib::PropertyProxy<guint>(this, "keycode");
343 }
344 #endif //GLIBMM_PROPERTIES_ENABLED
345
346 #ifdef GLIBMM_PROPERTIES_ENABLED
347 Glib::PropertyProxy_ReadOnly<guint> CellRendererAccel::property_keycode() const
348 {
349   return Glib::PropertyProxy_ReadOnly<guint>(this, "keycode");
350 }
351 #endif //GLIBMM_PROPERTIES_ENABLED
352
353
354 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
355 void Gtk::CellRendererAccel::on_accel_edited(const Glib::ustring& path_string, guint accel_key, Gdk::ModifierType accel_mods, guint hardware_keycode)
356 {
357   BaseClassType *const base = static_cast<BaseClassType*>(
358       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
359   );
360
361   if(base && base->accel_edited)
362     (*base->accel_edited)(gobj(),path_string.c_str(),accel_key,((GdkModifierType)(accel_mods)),hardware_keycode);
363 }
364 void Gtk::CellRendererAccel::on_accel_cleared(const Glib::ustring& path_string)
365 {
366   BaseClassType *const base = static_cast<BaseClassType*>(
367       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
368   );
369
370   if(base && base->accel_cleared)
371     (*base->accel_cleared)(gobj(),path_string.c_str());
372 }
373 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
374
375 #ifdef GLIBMM_VFUNCS_ENABLED
376 #endif //GLIBMM_VFUNCS_ENABLED
377
378
379 } // namespace Gtk
380
381