1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <gtkmm/celleditable.h>
4 #include <gtkmm/private/celleditable_p.h>
9 /* Copyright 1998-2002 The gtkmm Development Team
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public
22 * License along with this library; if not, write to the Free
23 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include <gtk/gtkcelleditable.h>
32 const Glib::SignalProxyInfo CellEditable_signal_editing_done_info =
35 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
36 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
40 const Glib::SignalProxyInfo CellEditable_signal_remove_widget_info =
43 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
44 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
47 } // anonymous namespace
53 Glib::RefPtr<Gtk::CellEditable> wrap(GtkCellEditable* object, bool take_copy)
55 return Glib::RefPtr<Gtk::CellEditable>( dynamic_cast<Gtk::CellEditable*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
56 //We use dynamic_cast<> in case of multiple inheritance.
66 /* The *_Class implementation: */
68 const Glib::Interface_Class& CellEditable_Class::init()
70 if(!gtype_) // create the GType if necessary
72 // Glib::Interface_Class has to know the interface init function
73 // in order to add interfaces to implementing types.
74 class_init_func_ = &CellEditable_Class::iface_init_function;
76 // We can not derive from another interface, and it is not necessary anyway.
77 gtype_ = gtk_cell_editable_get_type();
83 void CellEditable_Class::iface_init_function(void* g_iface, void*)
85 BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
87 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
88 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
91 klass->start_editing = &start_editing_vfunc_callback;
92 klass->editing_done = &editing_done_callback;
93 klass->remove_widget = &remove_widget_callback;
96 void CellEditable_Class::start_editing_vfunc_callback(GtkCellEditable* self, GdkEvent* event)
98 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
99 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
101 // Non-gtkmmproc-generated custom classes implicitly call the default
102 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
103 // generated classes can use this optimisation, which avoids the unnecessary
104 // parameter conversions if there is no possibility of the virtual function
106 if(obj && obj->is_derived_())
108 try // Trap C++ exceptions which would normally be lost because this is a C callback.
110 // Call the virtual member method, which derived classes might override.
111 obj->start_editing_vfunc(event);
115 Glib::exception_handlers_invoke();
120 BaseClassType *const base = static_cast<BaseClassType*>(
121 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
122 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
125 // Call the original underlying C function:
126 if(base && base->start_editing)
127 (*base->start_editing)(self, event);
132 void CellEditable_Class::editing_done_callback(GtkCellEditable* self)
134 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
135 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
137 // Non-gtkmmproc-generated custom classes implicitly call the default
138 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
139 // generated classes can use this optimisation, which avoids the unnecessary
140 // parameter conversions if there is no possibility of the virtual function
142 if(obj && obj->is_derived_())
144 try // Trap C++ exceptions which would normally be lost because this is a C callback.
146 // Call the virtual member method, which derived classes might override.
147 obj->on_editing_done();
151 Glib::exception_handlers_invoke();
156 BaseClassType *const base = static_cast<BaseClassType*>(
157 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
158 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
161 // Call the original underlying C function:
162 if(base && base->editing_done)
163 (*base->editing_done)(self);
167 void CellEditable_Class::remove_widget_callback(GtkCellEditable* self)
169 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
170 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
172 // Non-gtkmmproc-generated custom classes implicitly call the default
173 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
174 // generated classes can use this optimisation, which avoids the unnecessary
175 // parameter conversions if there is no possibility of the virtual function
177 if(obj && obj->is_derived_())
179 try // Trap C++ exceptions which would normally be lost because this is a C callback.
181 // Call the virtual member method, which derived classes might override.
182 obj->on_remove_widget();
186 Glib::exception_handlers_invoke();
191 BaseClassType *const base = static_cast<BaseClassType*>(
192 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
193 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
196 // Call the original underlying C function:
197 if(base && base->remove_widget)
198 (*base->remove_widget)(self);
203 Glib::ObjectBase* CellEditable_Class::wrap_new(GObject* object)
205 return new CellEditable((GtkCellEditable*)(object));
209 /* The implementation: */
211 CellEditable::CellEditable()
213 Glib::Interface(celleditable_class_.init())
216 CellEditable::CellEditable(GtkCellEditable* castitem)
218 Glib::Interface((GObject*)(castitem))
221 CellEditable::~CellEditable()
225 void CellEditable::add_interface(GType gtype_implementer)
227 celleditable_class_.init().add_interface(gtype_implementer);
230 CellEditable::CppClassType CellEditable::celleditable_class_; // initialize static member
232 GType CellEditable::get_type()
234 return celleditable_class_.init().get_type();
237 GType CellEditable::get_base_type()
239 return gtk_cell_editable_get_type();
243 void CellEditable::start_editing(GdkEvent* event)
245 gtk_cell_editable_start_editing(gobj(), event);
248 void CellEditable::editing_done()
250 gtk_cell_editable_editing_done(gobj());
253 void CellEditable::remove_widget()
255 gtk_cell_editable_remove_widget(gobj());
259 Glib::SignalProxy0< void > CellEditable::signal_editing_done()
261 return Glib::SignalProxy0< void >(this, &CellEditable_signal_editing_done_info);
264 Glib::SignalProxy0< void > CellEditable::signal_remove_widget()
266 return Glib::SignalProxy0< void >(this, &CellEditable_signal_remove_widget_info);
270 void Gtk::CellEditable::on_editing_done()
272 BaseClassType *const base = static_cast<BaseClassType*>(
273 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
274 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
277 if(base && base->editing_done)
278 (*base->editing_done)(gobj());
281 void Gtk::CellEditable::on_remove_widget()
283 BaseClassType *const base = static_cast<BaseClassType*>(
284 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
285 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
288 if(base && base->remove_widget)
289 (*base->remove_widget)(gobj());
293 void Gtk::CellEditable::start_editing_vfunc(GdkEvent* event)
295 BaseClassType *const base = static_cast<BaseClassType*>(
296 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
297 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
300 if(base && base->start_editing)
301 (*base->start_editing)(gobj(),event);