1
// Generated by gtkmmproc -- DO NOT MODIFY!
3
#include <gtkmm/celllayout.h>
4
#include <gtkmm/private/celllayout_p.h>
9
/* Copyright 2003 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/gtkcelllayout.h>
32
// This Signal Proxy allows the C++ coder to specify
33
// a sigc::slot instead of a static function.
34
class SignalProxy_CellData
37
typedef Gtk::CellLayout::SlotCellData SlotType;
39
SignalProxy_CellData(const SlotType& slot)
42
~SignalProxy_CellData();
44
static void gtk_callback(GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer data);
45
static void gtk_callback_destroy(void* data);
51
SignalProxy_CellData::~SignalProxy_CellData()
54
void SignalProxy_CellData::gtk_callback(GtkCellLayout* /* cell_layout */, GtkCellRenderer* /* cell */, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer data)
56
SignalProxy_CellData *const self = static_cast<SignalProxy_CellData*>(data);
60
//We ignore the cell, because that was given as an argument to the connecting method, so the caller should know which one it is already.
61
//And we ignore the tree_model because that can be obtained from the iter or from the CellLayout itself.
62
(self->slot_)(Gtk::TreeModel::const_iterator(tree_model, iter));
66
Glib::exception_handlers_invoke();
71
void SignalProxy_CellData::gtk_callback_destroy(void* data)
73
delete static_cast<SignalProxy_CellData*>(data);
76
} // anonymous namespace
82
void CellLayout::add_attribute(const Glib::PropertyProxy_Base& property, const TreeModelColumnBase& column)
84
gtk_cell_layout_add_attribute(gobj(),
85
(GtkCellRenderer*) property.get_object()->gobj(), property.get_name(), column.index());
88
void CellLayout::set_cell_data_func(CellRenderer& cell, const SlotCellData& slot)
90
// Create a signal proxy. A pointer to this will be passed
91
// through the callback's data parameter. It will be deleted
92
// when SignalProxy_CellData::gtk_callback_destroy() is called.
93
SignalProxy_CellData *const pSignalProxy = new SignalProxy_CellData(slot);
95
gtk_cell_layout_set_cell_data_func(gobj(), cell.gobj(),
96
&SignalProxy_CellData::gtk_callback, pSignalProxy,
97
&SignalProxy_CellData::gtk_callback_destroy);
106
} // anonymous namespace
112
Glib::RefPtr<Gtk::CellLayout> wrap(GtkCellLayout* object, bool take_copy)
114
return Glib::RefPtr<Gtk::CellLayout>( dynamic_cast<Gtk::CellLayout*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
115
//We use dynamic_cast<> in case of multiple inheritance.
125
/* The *_Class implementation: */
127
const Glib::Interface_Class& CellLayout_Class::init()
129
if(!gtype_) // create the GType if necessary
131
// Glib::Interface_Class has to know the interface init function
132
// in order to add interfaces to implementing types.
133
class_init_func_ = &CellLayout_Class::iface_init_function;
135
// We can not derive from another interface, and it is not necessary anyway.
136
gtype_ = gtk_cell_layout_get_type();
142
void CellLayout_Class::iface_init_function(void* g_iface, void*)
144
BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
146
//This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
147
//This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
148
g_assert(klass != 0);
150
klass->pack_start = &pack_start_vfunc_callback;
151
klass->pack_end = &pack_end_vfunc_callback;
152
klass->clear = &clear_vfunc_callback;
153
klass->add_attribute = &add_attribute_vfunc_callback;
154
klass->clear_attributes = &clear_attributes_vfunc_callback;
155
klass->reorder = &reorder_vfunc_callback;
158
void CellLayout_Class::pack_start_vfunc_callback(GtkCellLayout* self, GtkCellRenderer* cell, gboolean expand)
160
CppObjectType *const obj = dynamic_cast<CppObjectType*>(
161
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
163
// Non-gtkmmproc-generated custom classes implicitly call the default
164
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
165
// generated classes can use this optimisation, which avoids the unnecessary
166
// parameter conversions if there is no possibility of the virtual function
168
if(obj && obj->is_derived_())
170
try // Trap C++ exceptions which would normally be lost because this is a C callback.
172
// Call the virtual member method, which derived classes might override.
173
obj->pack_start_vfunc(Glib::wrap(cell)
179
Glib::exception_handlers_invoke();
184
BaseClassType *const base = static_cast<BaseClassType*>(
185
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
186
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
189
// Call the original underlying C function:
190
if(base && base->pack_start)
191
(*base->pack_start)(self, cell, expand);
195
void CellLayout_Class::pack_end_vfunc_callback(GtkCellLayout* self, GtkCellRenderer* cell, gboolean expand)
197
CppObjectType *const obj = dynamic_cast<CppObjectType*>(
198
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
200
// Non-gtkmmproc-generated custom classes implicitly call the default
201
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
202
// generated classes can use this optimisation, which avoids the unnecessary
203
// parameter conversions if there is no possibility of the virtual function
205
if(obj && obj->is_derived_())
207
try // Trap C++ exceptions which would normally be lost because this is a C callback.
209
// Call the virtual member method, which derived classes might override.
210
obj->pack_end_vfunc(Glib::wrap(cell)
216
Glib::exception_handlers_invoke();
221
BaseClassType *const base = static_cast<BaseClassType*>(
222
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
223
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
226
// Call the original underlying C function:
227
if(base && base->pack_end)
228
(*base->pack_end)(self, cell, expand);
232
void CellLayout_Class::clear_vfunc_callback(GtkCellLayout* self)
234
CppObjectType *const obj = dynamic_cast<CppObjectType*>(
235
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
237
// Non-gtkmmproc-generated custom classes implicitly call the default
238
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
239
// generated classes can use this optimisation, which avoids the unnecessary
240
// parameter conversions if there is no possibility of the virtual function
242
if(obj && obj->is_derived_())
244
try // Trap C++ exceptions which would normally be lost because this is a C callback.
246
// Call the virtual member method, which derived classes might override.
251
Glib::exception_handlers_invoke();
256
BaseClassType *const base = static_cast<BaseClassType*>(
257
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
258
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
261
// Call the original underlying C function:
262
if(base && base->clear)
263
(*base->clear)(self);
267
void CellLayout_Class::add_attribute_vfunc_callback(GtkCellLayout* self, GtkCellRenderer* cell, const gchar* attribute, gint column)
269
CppObjectType *const obj = dynamic_cast<CppObjectType*>(
270
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
272
// Non-gtkmmproc-generated custom classes implicitly call the default
273
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
274
// generated classes can use this optimisation, which avoids the unnecessary
275
// parameter conversions if there is no possibility of the virtual function
277
if(obj && obj->is_derived_())
279
try // Trap C++ exceptions which would normally be lost because this is a C callback.
281
// Call the virtual member method, which derived classes might override.
282
obj->add_attribute_vfunc(Glib::wrap(cell)
283
, Glib::convert_const_gchar_ptr_to_ustring(attribute)
289
Glib::exception_handlers_invoke();
294
BaseClassType *const base = static_cast<BaseClassType*>(
295
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
296
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
299
// Call the original underlying C function:
300
if(base && base->add_attribute)
301
(*base->add_attribute)(self, cell, attribute, column);
305
void CellLayout_Class::clear_attributes_vfunc_callback(GtkCellLayout* self, GtkCellRenderer* cell)
307
CppObjectType *const obj = dynamic_cast<CppObjectType*>(
308
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
310
// Non-gtkmmproc-generated custom classes implicitly call the default
311
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
312
// generated classes can use this optimisation, which avoids the unnecessary
313
// parameter conversions if there is no possibility of the virtual function
315
if(obj && obj->is_derived_())
317
try // Trap C++ exceptions which would normally be lost because this is a C callback.
319
// Call the virtual member method, which derived classes might override.
320
obj->clear_attributes_vfunc(Glib::wrap(cell)
325
Glib::exception_handlers_invoke();
330
BaseClassType *const base = static_cast<BaseClassType*>(
331
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
332
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
335
// Call the original underlying C function:
336
if(base && base->clear_attributes)
337
(*base->clear_attributes)(self, cell);
341
void CellLayout_Class::reorder_vfunc_callback(GtkCellLayout* self, GtkCellRenderer* cell, gint position)
343
CppObjectType *const obj = dynamic_cast<CppObjectType*>(
344
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
346
// Non-gtkmmproc-generated custom classes implicitly call the default
347
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
348
// generated classes can use this optimisation, which avoids the unnecessary
349
// parameter conversions if there is no possibility of the virtual function
351
if(obj && obj->is_derived_())
353
try // Trap C++ exceptions which would normally be lost because this is a C callback.
355
// Call the virtual member method, which derived classes might override.
356
obj->reorder_vfunc(Glib::wrap(cell)
362
Glib::exception_handlers_invoke();
367
BaseClassType *const base = static_cast<BaseClassType*>(
368
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
369
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
372
// Call the original underlying C function:
373
if(base && base->reorder)
374
(*base->reorder)(self, cell, position);
379
Glib::ObjectBase* CellLayout_Class::wrap_new(GObject* object)
381
return new CellLayout((GtkCellLayout*)(object));
385
/* The implementation: */
387
CellLayout::CellLayout()
389
Glib::Interface(celllayout_class_.init())
392
CellLayout::CellLayout(GtkCellLayout* castitem)
394
Glib::Interface((GObject*)(castitem))
397
CellLayout::~CellLayout()
401
void CellLayout::add_interface(GType gtype_implementer)
403
celllayout_class_.init().add_interface(gtype_implementer);
406
CellLayout::CppClassType CellLayout::celllayout_class_; // initialize static member
408
GType CellLayout::get_type()
410
return celllayout_class_.init().get_type();
413
GType CellLayout::get_base_type()
415
return gtk_cell_layout_get_type();
419
void CellLayout::pack_start(CellRenderer& cell, bool expand)
421
gtk_cell_layout_pack_start(gobj(), (cell).gobj(), static_cast<int>(expand));
424
void CellLayout::pack_end(CellRenderer& cell, bool expand)
426
gtk_cell_layout_pack_end(gobj(), (cell).gobj(), static_cast<int>(expand));
429
void CellLayout::clear()
431
gtk_cell_layout_clear(gobj());
434
void CellLayout::add_attribute(CellRenderer& cell, const Glib::ustring& attribute, int column)
436
gtk_cell_layout_add_attribute(gobj(), (cell).gobj(), attribute.c_str(), column);
439
void CellLayout::clear_attributes(CellRenderer& cell)
441
gtk_cell_layout_clear_attributes(gobj(), (cell).gobj());
444
void CellLayout::reorder(CellRenderer& cell, int position)
446
gtk_cell_layout_reorder(gobj(), (cell).gobj(), position);
450
void Gtk::CellLayout::pack_start_vfunc(CellRenderer* cell, bool expand)
452
BaseClassType *const base = static_cast<BaseClassType*>(
453
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
454
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
457
if(base && base->pack_start)
458
(*base->pack_start)(gobj(),(GtkCellRenderer*)Glib::unwrap(cell),static_cast<int>(expand));
461
void Gtk::CellLayout::pack_end_vfunc(CellRenderer* cell, bool expand)
463
BaseClassType *const base = static_cast<BaseClassType*>(
464
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
465
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
468
if(base && base->pack_end)
469
(*base->pack_end)(gobj(),(GtkCellRenderer*)Glib::unwrap(cell),static_cast<int>(expand));
472
void Gtk::CellLayout::clear_vfunc()
474
BaseClassType *const base = static_cast<BaseClassType*>(
475
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
476
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
479
if(base && base->clear)
480
(*base->clear)(gobj());
483
void Gtk::CellLayout::add_attribute_vfunc(CellRenderer* cell, const Glib::ustring& attribute, int column)
485
BaseClassType *const base = static_cast<BaseClassType*>(
486
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
487
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
490
if(base && base->add_attribute)
491
(*base->add_attribute)(gobj(),(GtkCellRenderer*)Glib::unwrap(cell),attribute.c_str(),column);
494
void Gtk::CellLayout::clear_attributes_vfunc(CellRenderer* cell)
496
BaseClassType *const base = static_cast<BaseClassType*>(
497
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
498
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
501
if(base && base->clear_attributes)
502
(*base->clear_attributes)(gobj(),(GtkCellRenderer*)Glib::unwrap(cell));
505
void Gtk::CellLayout::reorder_vfunc(CellRenderer* cell, int position)
507
BaseClassType *const base = static_cast<BaseClassType*>(
508
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
509
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
512
if(base && base->reorder)
513
(*base->reorder)(gobj(),(GtkCellRenderer*)Glib::unwrap(cell),position);