1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <gtkmm/table.h>
5 #include <gtkmm/private/table_p.h>
12 * Copyright 1998-2002 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/gtktable.h>
34 namespace Table_Helpers
37 Widget* Child::get_widget() const
39 return Glib::wrap(gobj()->widget);
42 guint16 Child::get_left_attach() const
44 return gobj()->left_attach;
48 guint16 Child::get_right_attach() const
50 return gobj()->right_attach;
53 guint16 Child::get_top_attach() const
55 return gobj()->top_attach;
58 guint16 Child::get_bottom_attach() const
60 return gobj()->bottom_attach;
63 guint16 Child::get_xpadding() const
65 return gobj()->xpadding;
68 guint16 Child::get_ypadding() const
70 return gobj()->ypadding;
73 bool Child::get_xexpand() const
75 return (bool)gobj()->xexpand;
78 bool Child::get_yexpand() const
80 return (bool)gobj()->yexpand;
83 bool Child::get_xshrink() const
85 return (bool)gobj()->xshrink;
87 bool Child::get_yshrink() const
89 return (bool)gobj()->yshrink;
92 bool Child::get_xfill() const
94 return (bool)gobj()->xfill;
97 bool Child::get_yfill() const
99 return (bool)gobj()->yfill;
103 } //namespace Table_Helpers
106 void Table::set_spacings(guint spacing)
108 set_row_spacings(spacing);
109 set_col_spacings(spacing);
112 Table::TableList& Table::children()
114 children_proxy_ = TableList(gobj());
115 return children_proxy_;
118 const Table::TableList& Table::children() const
120 children_proxy_ = TableList(const_cast<GtkTable*>(gobj()));
121 return children_proxy_;
125 } /* namespace Gtk */
130 } // anonymous namespace
136 Gtk::Table* wrap(GtkTable* object, bool take_copy)
138 return dynamic_cast<Gtk::Table *> (Glib::wrap_auto ((GObject*)(object), take_copy));
141 } /* namespace Glib */
147 /* The *_Class implementation: */
149 const Glib::Class& Table_Class::init()
151 if(!gtype_) // create the GType if necessary
153 // Glib::Class has to know the class init function to clone custom types.
154 class_init_func_ = &Table_Class::class_init_function;
156 // This is actually just optimized away, apparently with no harm.
157 // Make sure that the parent type has been created.
158 //CppClassParent::CppObjectType::get_type();
160 // Create the wrapper type, with the same class/instance size as the base type.
161 register_derived_type(gtk_table_get_type());
163 // Add derived versions of interfaces, if the C type implements any interfaces:
169 void Table_Class::class_init_function(void* g_class, void* class_data)
171 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
172 CppClassParent::class_init_function(klass, class_data);
174 #ifdef GLIBMM_VFUNCS_ENABLED
175 #endif //GLIBMM_VFUNCS_ENABLED
177 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
178 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
181 #ifdef GLIBMM_VFUNCS_ENABLED
182 #endif //GLIBMM_VFUNCS_ENABLED
184 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
185 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
188 Glib::ObjectBase* Table_Class::wrap_new(GObject* o)
190 return manage(new Table((GtkTable*)(o)));
195 /* The implementation: */
197 Table::Table(const Glib::ConstructParams& construct_params)
199 Gtk::Container(construct_params)
203 Table::Table(GtkTable* castitem)
205 Gtk::Container((GtkContainer*)(castitem))
214 Table::CppClassType Table::table_class_; // initialize static member
216 GType Table::get_type()
218 return table_class_.init().get_type();
221 GType Table::get_base_type()
223 return gtk_table_get_type();
227 namespace Table_Helpers
230 void TableList::remove(const_reference child)
232 gtk_container_remove(GTK_CONTAINER(gparent_),
233 (GtkWidget*)(child.get_widget ()->gobj()));
236 void TableList::remove(Widget& widget)
238 gtk_container_remove(GTK_CONTAINER(gparent_), (GtkWidget*)(widget.gobj()));
241 TableList::iterator TableList::erase(iterator position)
243 //Check that it is a valid iterator, to a real item:
244 if ( !position.node_|| (position == end()) )
247 //Get an iterator the the next item, to return:
248 iterator next = position;
251 //Use GTK+ C function to remove it, by providing the GtkWidget*:
252 gtk_container_remove( GTK_CONTAINER(gparent_), (GtkWidget*)(position->get_widget ()->gobj()) );
256 } /* namespace Table_Helpers */
259 namespace Table_Helpers
262 TableList::TableList()
265 TableList::TableList(GtkTable* gparent)
266 : type_base((GObject*)gparent)
269 TableList::TableList(const TableList& src)
274 TableList& TableList::operator=(const TableList& src)
276 type_base::operator=(src);
280 GList*& TableList::glist() const
282 return ((GtkTable*)gparent_)->children;
285 void TableList::erase(iterator start, iterator stop)
287 type_base::erase(start, stop);
290 GtkTable* TableList::gparent()
292 return (GtkTable*)type_base::gparent();
295 const GtkTable* TableList::gparent() const
297 return (GtkTable*)type_base::gparent();
300 TableList::reference TableList::operator[](size_type l) const
302 return type_base::operator[](l);
305 } /* namespace Table_Helpers */
307 Table::Table(guint n_rows, guint n_columns, bool homogeneous)
309 Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
310 Gtk::Container(Glib::ConstructParams(table_class_.init(), "n_rows", n_rows, "n_columns", n_columns, "homogeneous", static_cast<int>(homogeneous), (char*) 0))
314 void Table::attach(Widget& child, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach, AttachOptions xoptions, AttachOptions yoptions, guint xpadding, guint ypadding)
316 gtk_table_attach(gobj(), (child).gobj(), left_attach, right_attach, top_attach, bottom_attach, ((GtkAttachOptions)(xoptions)), ((GtkAttachOptions)(yoptions)), xpadding, ypadding);
319 void Table::resize(guint rows, guint columns)
321 gtk_table_resize(gobj(), rows, columns);
324 void Table::set_row_spacing(guint row, guint spacing)
326 gtk_table_set_row_spacing(gobj(), row, spacing);
329 guint Table::get_row_spacing(guint row) const
331 return gtk_table_get_row_spacing(const_cast<GtkTable*>(gobj()), row);
334 void Table::set_col_spacing(guint column, guint spacing)
336 gtk_table_set_col_spacing(gobj(), column, spacing);
339 guint Table::get_col_spacing(guint column) const
341 return gtk_table_get_col_spacing(const_cast<GtkTable*>(gobj()), column);
344 void Table::set_row_spacings(guint spacing)
346 gtk_table_set_row_spacings(gobj(), spacing);
349 void Table::set_col_spacings(guint spacing)
351 gtk_table_set_col_spacings(gobj(), spacing);
354 guint Table::get_default_row_spacing()
356 return gtk_table_get_default_row_spacing(gobj());
359 guint Table::get_default_col_spacing()
361 return gtk_table_get_default_col_spacing(gobj());
364 void Table::set_homogeneous(bool homogeneous)
366 gtk_table_set_homogeneous(gobj(), static_cast<int>(homogeneous));
369 bool Table::get_homogeneous() const
371 return gtk_table_get_homogeneous(const_cast<GtkTable*>(gobj()));
375 #ifdef GLIBMM_PROPERTIES_ENABLED
376 Glib::PropertyProxy<guint> Table::property_n_rows()
378 return Glib::PropertyProxy<guint>(this, "n-rows");
380 #endif //GLIBMM_PROPERTIES_ENABLED
382 #ifdef GLIBMM_PROPERTIES_ENABLED
383 Glib::PropertyProxy_ReadOnly<guint> Table::property_n_rows() const
385 return Glib::PropertyProxy_ReadOnly<guint>(this, "n-rows");
387 #endif //GLIBMM_PROPERTIES_ENABLED
389 #ifdef GLIBMM_PROPERTIES_ENABLED
390 Glib::PropertyProxy<guint> Table::property_n_columns()
392 return Glib::PropertyProxy<guint>(this, "n-columns");
394 #endif //GLIBMM_PROPERTIES_ENABLED
396 #ifdef GLIBMM_PROPERTIES_ENABLED
397 Glib::PropertyProxy_ReadOnly<guint> Table::property_n_columns() const
399 return Glib::PropertyProxy_ReadOnly<guint>(this, "n-columns");
401 #endif //GLIBMM_PROPERTIES_ENABLED
403 #ifdef GLIBMM_PROPERTIES_ENABLED
404 Glib::PropertyProxy<guint> Table::property_column_spacing()
406 return Glib::PropertyProxy<guint>(this, "column-spacing");
408 #endif //GLIBMM_PROPERTIES_ENABLED
410 #ifdef GLIBMM_PROPERTIES_ENABLED
411 Glib::PropertyProxy_ReadOnly<guint> Table::property_column_spacing() const
413 return Glib::PropertyProxy_ReadOnly<guint>(this, "column-spacing");
415 #endif //GLIBMM_PROPERTIES_ENABLED
417 #ifdef GLIBMM_PROPERTIES_ENABLED
418 Glib::PropertyProxy<guint> Table::property_row_spacing()
420 return Glib::PropertyProxy<guint>(this, "row-spacing");
422 #endif //GLIBMM_PROPERTIES_ENABLED
424 #ifdef GLIBMM_PROPERTIES_ENABLED
425 Glib::PropertyProxy_ReadOnly<guint> Table::property_row_spacing() const
427 return Glib::PropertyProxy_ReadOnly<guint>(this, "row-spacing");
429 #endif //GLIBMM_PROPERTIES_ENABLED
432 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
433 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
435 #ifdef GLIBMM_VFUNCS_ENABLED
436 #endif //GLIBMM_VFUNCS_ENABLED