1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <gtkmm/cellrendereraccel.h>
5 #include <gtkmm/private/cellrendereraccel_p.h>
8 /* $Id: cellrendereraccel.ccg,v 1.2 2006/05/11 11:40:24 murrayc Exp $ */
12 * Copyright 2005 The gtkmm Development Team
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.
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.
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.
29 #include <gtk/gtkcellrendereraccel.h>
34 #ifdef GLIBMM_PROPERTIES_ENABLED
35 Glib::PropertyProxy_Base CellRendererAccel::_property_renderable()
37 //Renderering just this one property would probably not be meaningful.
38 return property_accel_key();
40 #endif //GLIBMM_PROPERTIES_ENABLED
48 static void CellRendererAccel_signal_accel_edited_callback(GtkCellRendererAccel* self, const gchar* p0,guint p1,GdkModifierType p2,guint p3,void* data)
51 typedef sigc::slot< void,const Glib::ustring&,guint,Gdk::ModifierType,guint > SlotType;
53 // Do not try to call a signal on a disassociated wrapper.
54 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
56 #ifdef GLIBMM_EXCEPTIONS_ENABLED
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))
64 #ifdef GLIBMM_EXCEPTIONS_ENABLED
68 Glib::exception_handlers_invoke();
70 #endif //GLIBMM_EXCEPTIONS_ENABLED
74 static const Glib::SignalProxyInfo CellRendererAccel_signal_accel_edited_info =
77 (GCallback) &CellRendererAccel_signal_accel_edited_callback,
78 (GCallback) &CellRendererAccel_signal_accel_edited_callback
82 static void CellRendererAccel_signal_accel_cleared_callback(GtkCellRendererAccel* self, const gchar* p0,void* data)
85 typedef sigc::slot< void,const Glib::ustring& > SlotType;
87 // Do not try to call a signal on a disassociated wrapper.
88 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
90 #ifdef GLIBMM_EXCEPTIONS_ENABLED
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)
97 #ifdef GLIBMM_EXCEPTIONS_ENABLED
101 Glib::exception_handlers_invoke();
103 #endif //GLIBMM_EXCEPTIONS_ENABLED
107 static const Glib::SignalProxyInfo CellRendererAccel_signal_accel_cleared_info =
110 (GCallback) &CellRendererAccel_signal_accel_cleared_callback,
111 (GCallback) &CellRendererAccel_signal_accel_cleared_callback
115 } // anonymous namespace
121 Gtk::CellRendererAccel* wrap(GtkCellRendererAccel* object, bool take_copy)
123 return dynamic_cast<Gtk::CellRendererAccel *> (Glib::wrap_auto ((GObject*)(object), take_copy));
126 } /* namespace Glib */
132 /* The *_Class implementation: */
134 const Glib::Class& CellRendererAccel_Class::init()
136 if(!gtype_) // create the GType if necessary
138 // Glib::Class has to know the class init function to clone custom types.
139 class_init_func_ = &CellRendererAccel_Class::class_init_function;
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();
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());
148 // Add derived versions of interfaces, if the C type implements any interfaces:
154 void CellRendererAccel_Class::class_init_function(void* g_class, void* class_data)
156 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
157 CppClassParent::class_init_function(klass, class_data);
159 #ifdef GLIBMM_VFUNCS_ENABLED
160 #endif //GLIBMM_VFUNCS_ENABLED
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
168 #ifdef GLIBMM_VFUNCS_ENABLED
169 #endif //GLIBMM_VFUNCS_ENABLED
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)
174 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
175 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
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
182 if(obj_base && obj_base->is_derived_())
184 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
185 if(obj) // This can be NULL during destruction.
187 #ifdef GLIBMM_EXCEPTIONS_ENABLED
188 try // Trap C++ exceptions which would normally be lost because this is a C callback.
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))
196 #ifdef GLIBMM_EXCEPTIONS_ENABLED
200 Glib::exception_handlers_invoke();
202 #endif //GLIBMM_EXCEPTIONS_ENABLED
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).
210 // Call the original underlying C function:
211 if(base && base->accel_edited)
212 (*base->accel_edited)(self, p0, p1, p2, p3);
214 void CellRendererAccel_Class::accel_cleared_callback(GtkCellRendererAccel* self, const gchar* p0)
216 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
217 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
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
224 if(obj_base && obj_base->is_derived_())
226 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
227 if(obj) // This can be NULL during destruction.
229 #ifdef GLIBMM_EXCEPTIONS_ENABLED
230 try // Trap C++ exceptions which would normally be lost because this is a C callback.
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)
237 #ifdef GLIBMM_EXCEPTIONS_ENABLED
241 Glib::exception_handlers_invoke();
243 #endif //GLIBMM_EXCEPTIONS_ENABLED
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).
251 // Call the original underlying C function:
252 if(base && base->accel_cleared)
253 (*base->accel_cleared)(self, p0);
255 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
258 Glib::ObjectBase* CellRendererAccel_Class::wrap_new(GObject* o)
260 return manage(new CellRendererAccel((GtkCellRendererAccel*)(o)));
265 /* The implementation: */
267 CellRendererAccel::CellRendererAccel(const Glib::ConstructParams& construct_params)
269 Gtk::CellRendererText(construct_params)
273 CellRendererAccel::CellRendererAccel(GtkCellRendererAccel* castitem)
275 Gtk::CellRendererText((GtkCellRendererText*)(castitem))
279 CellRendererAccel::~CellRendererAccel()
284 CellRendererAccel::CppClassType CellRendererAccel::cellrendereraccel_class_; // initialize static member
286 GType CellRendererAccel::get_type()
288 return cellrendereraccel_class_.init().get_type();
291 GType CellRendererAccel::get_base_type()
293 return gtk_cell_renderer_accel_get_type();
297 CellRendererAccel::CellRendererAccel()
299 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
301 Gtk::CellRendererText(Glib::ConstructParams(cellrendereraccel_class_.init()))
306 Glib::SignalProxy4< void,const Glib::ustring&,guint,Gdk::ModifierType,guint > CellRendererAccel::signal_accel_edited()
308 return Glib::SignalProxy4< void,const Glib::ustring&,guint,Gdk::ModifierType,guint >(this, &CellRendererAccel_signal_accel_edited_info);
312 Glib::SignalProxy1< void,const Glib::ustring& > CellRendererAccel::signal_accel_cleared()
314 return Glib::SignalProxy1< void,const Glib::ustring& >(this, &CellRendererAccel_signal_accel_cleared_info);
318 #ifdef GLIBMM_PROPERTIES_ENABLED
319 Glib::PropertyProxy<guint> CellRendererAccel::property_accel_key()
321 return Glib::PropertyProxy<guint>(this, "accel-key");
323 #endif //GLIBMM_PROPERTIES_ENABLED
325 #ifdef GLIBMM_PROPERTIES_ENABLED
326 Glib::PropertyProxy_ReadOnly<guint> CellRendererAccel::property_accel_key() const
328 return Glib::PropertyProxy_ReadOnly<guint>(this, "accel-key");
330 #endif //GLIBMM_PROPERTIES_ENABLED
332 #ifdef GLIBMM_PROPERTIES_ENABLED
333 Glib::PropertyProxy<Gdk::ModifierType> CellRendererAccel::property_accel_mods()
335 return Glib::PropertyProxy<Gdk::ModifierType>(this, "accel-mods");
337 #endif //GLIBMM_PROPERTIES_ENABLED
339 #ifdef GLIBMM_PROPERTIES_ENABLED
340 Glib::PropertyProxy_ReadOnly<Gdk::ModifierType> CellRendererAccel::property_accel_mods() const
342 return Glib::PropertyProxy_ReadOnly<Gdk::ModifierType>(this, "accel-mods");
344 #endif //GLIBMM_PROPERTIES_ENABLED
346 #ifdef GLIBMM_PROPERTIES_ENABLED
347 Glib::PropertyProxy<guint> CellRendererAccel::property_keycode()
349 return Glib::PropertyProxy<guint>(this, "keycode");
351 #endif //GLIBMM_PROPERTIES_ENABLED
353 #ifdef GLIBMM_PROPERTIES_ENABLED
354 Glib::PropertyProxy_ReadOnly<guint> CellRendererAccel::property_keycode() const
356 return Glib::PropertyProxy_ReadOnly<guint>(this, "keycode");
358 #endif //GLIBMM_PROPERTIES_ENABLED
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)
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).
368 if(base && base->accel_edited)
369 (*base->accel_edited)(gobj(),path_string.c_str(),accel_key,((GdkModifierType)(accel_mods)),hardware_keycode);
371 void Gtk::CellRendererAccel::on_accel_cleared(const Glib::ustring& path_string)
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).
377 if(base && base->accel_cleared)
378 (*base->accel_cleared)(gobj(),path_string.c_str());
380 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
382 #ifdef GLIBMM_VFUNCS_ENABLED
383 #endif //GLIBMM_VFUNCS_ENABLED