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 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
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 && obj->is_derived_())
184 #ifdef GLIBMM_EXCEPTIONS_ENABLED
185 try // Trap C++ exceptions which would normally be lost because this is a C callback.
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))
192 #ifdef GLIBMM_EXCEPTIONS_ENABLED
196 Glib::exception_handlers_invoke();
198 #endif //GLIBMM_EXCEPTIONS_ENABLED
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).
206 // Call the original underlying C function:
207 if(base && base->accel_edited)
208 (*base->accel_edited)(self, p0, p1, p2, p3);
211 void CellRendererAccel_Class::accel_cleared_callback(GtkCellRendererAccel* self, const gchar* p0)
213 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
214 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
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
221 if(obj && obj->is_derived_())
223 #ifdef GLIBMM_EXCEPTIONS_ENABLED
224 try // Trap C++ exceptions which would normally be lost because this is a C callback.
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)
230 #ifdef GLIBMM_EXCEPTIONS_ENABLED
234 Glib::exception_handlers_invoke();
236 #endif //GLIBMM_EXCEPTIONS_ENABLED
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).
244 // Call the original underlying C function:
245 if(base && base->accel_cleared)
246 (*base->accel_cleared)(self, p0);
249 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
252 Glib::ObjectBase* CellRendererAccel_Class::wrap_new(GObject* o)
254 return manage(new CellRendererAccel((GtkCellRendererAccel*)(o)));
259 /* The implementation: */
261 CellRendererAccel::CellRendererAccel(const Glib::ConstructParams& construct_params)
263 Gtk::CellRendererText(construct_params)
267 CellRendererAccel::CellRendererAccel(GtkCellRendererAccel* castitem)
269 Gtk::CellRendererText((GtkCellRendererText*)(castitem))
273 CellRendererAccel::~CellRendererAccel()
278 CellRendererAccel::CppClassType CellRendererAccel::cellrendereraccel_class_; // initialize static member
280 GType CellRendererAccel::get_type()
282 return cellrendereraccel_class_.init().get_type();
285 GType CellRendererAccel::get_base_type()
287 return gtk_cell_renderer_accel_get_type();
291 CellRendererAccel::CellRendererAccel()
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()))
299 Glib::SignalProxy4< void,const Glib::ustring&,guint,Gdk::ModifierType,guint > CellRendererAccel::signal_accel_edited()
301 return Glib::SignalProxy4< void,const Glib::ustring&,guint,Gdk::ModifierType,guint >(this, &CellRendererAccel_signal_accel_edited_info);
305 Glib::SignalProxy1< void,const Glib::ustring& > CellRendererAccel::signal_accel_cleared()
307 return Glib::SignalProxy1< void,const Glib::ustring& >(this, &CellRendererAccel_signal_accel_cleared_info);
311 #ifdef GLIBMM_PROPERTIES_ENABLED
312 Glib::PropertyProxy<guint> CellRendererAccel::property_accel_key()
314 return Glib::PropertyProxy<guint>(this, "accel-key");
316 #endif //GLIBMM_PROPERTIES_ENABLED
318 #ifdef GLIBMM_PROPERTIES_ENABLED
319 Glib::PropertyProxy_ReadOnly<guint> CellRendererAccel::property_accel_key() const
321 return Glib::PropertyProxy_ReadOnly<guint>(this, "accel-key");
323 #endif //GLIBMM_PROPERTIES_ENABLED
325 #ifdef GLIBMM_PROPERTIES_ENABLED
326 Glib::PropertyProxy<Gdk::ModifierType> CellRendererAccel::property_accel_mods()
328 return Glib::PropertyProxy<Gdk::ModifierType>(this, "accel-mods");
330 #endif //GLIBMM_PROPERTIES_ENABLED
332 #ifdef GLIBMM_PROPERTIES_ENABLED
333 Glib::PropertyProxy_ReadOnly<Gdk::ModifierType> CellRendererAccel::property_accel_mods() const
335 return Glib::PropertyProxy_ReadOnly<Gdk::ModifierType>(this, "accel-mods");
337 #endif //GLIBMM_PROPERTIES_ENABLED
339 #ifdef GLIBMM_PROPERTIES_ENABLED
340 Glib::PropertyProxy<guint> CellRendererAccel::property_keycode()
342 return Glib::PropertyProxy<guint>(this, "keycode");
344 #endif //GLIBMM_PROPERTIES_ENABLED
346 #ifdef GLIBMM_PROPERTIES_ENABLED
347 Glib::PropertyProxy_ReadOnly<guint> CellRendererAccel::property_keycode() const
349 return Glib::PropertyProxy_ReadOnly<guint>(this, "keycode");
351 #endif //GLIBMM_PROPERTIES_ENABLED
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)
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).
361 if(base && base->accel_edited)
362 (*base->accel_edited)(gobj(),path_string.c_str(),accel_key,((GdkModifierType)(accel_mods)),hardware_keycode);
364 void Gtk::CellRendererAccel::on_accel_cleared(const Glib::ustring& path_string)
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).
370 if(base && base->accel_cleared)
371 (*base->accel_cleared)(gobj(),path_string.c_str());
373 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
375 #ifdef GLIBMM_VFUNCS_ENABLED
376 #endif //GLIBMM_VFUNCS_ENABLED