1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <gtkmm/table.h>
4 #include <gtkmm/private/table_p.h>
11 * Copyright 1998-2002 The gtkmm Development Team
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version.
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Library General Public License for more details.
23 * You should have received a copy of the GNU Library General Public
24 * License along with this library; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <gtk/gtktable.h>
33 namespace Table_Helpers
36 Widget* Child::get_widget() const
38 return Glib::wrap(gobj()->widget);
41 guint16 Child::get_left_attach() const
43 return gobj()->left_attach;
47 guint16 Child::get_right_attach() const
49 return gobj()->right_attach;
52 guint16 Child::get_top_attach() const
54 return gobj()->top_attach;
57 guint16 Child::get_bottom_attach() const
59 return gobj()->bottom_attach;
62 guint16 Child::get_xpadding() const
64 return gobj()->xpadding;
67 guint16 Child::get_ypadding() const
69 return gobj()->ypadding;
72 bool Child::get_xexpand() const
74 return (bool)gobj()->xexpand;
77 bool Child::get_yexpand() const
79 return (bool)gobj()->yexpand;
82 bool Child::get_xshrink() const
84 return (bool)gobj()->xshrink;
86 bool Child::get_yshrink() const
88 return (bool)gobj()->yshrink;
91 bool Child::get_xfill() const
93 return (bool)gobj()->xfill;
96 bool Child::get_yfill() const
98 return (bool)gobj()->yfill;
102 } //namespace Table_Helpers
105 void Table::set_spacings(guint spacing)
107 set_row_spacings(spacing);
108 set_col_spacings(spacing);
111 Table::TableList& Table::children()
113 children_proxy_ = TableList(gobj());
114 return children_proxy_;
117 const Table::TableList& Table::children() const
119 children_proxy_ = TableList(const_cast<GtkTable*>(gobj()));
120 return children_proxy_;
124 } /* namespace Gtk */
129 } // anonymous namespace
135 Gtk::Table* wrap(GtkTable* object, bool take_copy)
137 return dynamic_cast<Gtk::Table *> (Glib::wrap_auto ((GObject*)(object), take_copy));
140 } /* namespace Glib */
146 /* The *_Class implementation: */
148 const Glib::Class& Table_Class::init()
150 if(!gtype_) // create the GType if necessary
152 // Glib::Class has to know the class init function to clone custom types.
153 class_init_func_ = &Table_Class::class_init_function;
155 // This is actually just optimized away, apparently with no harm.
156 // Make sure that the parent type has been created.
157 //CppClassParent::CppObjectType::get_type();
159 // Create the wrapper type, with the same class/instance size as the base type.
160 register_derived_type(gtk_table_get_type());
162 // Add derived versions of interfaces, if the C type implements any interfaces:
168 void Table_Class::class_init_function(void* g_class, void* class_data)
170 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
171 CppClassParent::class_init_function(klass, class_data);
176 Glib::ObjectBase* Table_Class::wrap_new(GObject* o)
178 return manage(new Table((GtkTable*)(o)));
183 /* The implementation: */
185 Table::Table(const Glib::ConstructParams& construct_params)
187 Gtk::Container(construct_params)
191 Table::Table(GtkTable* castitem)
193 Gtk::Container((GtkContainer*)(castitem))
202 Table::CppClassType Table::table_class_; // initialize static member
204 GType Table::get_type()
206 return table_class_.init().get_type();
209 GType Table::get_base_type()
211 return gtk_table_get_type();
215 namespace Table_Helpers
218 void TableList::remove(const_reference child)
220 gtk_container_remove(GTK_CONTAINER(gparent_),
221 (GtkWidget*)(child.gobj()));
224 void TableList::remove(Widget& widget)
226 gtk_container_remove(GTK_CONTAINER(gparent_), (GtkWidget*)(widget.gobj()));
229 TableList::iterator TableList::erase(iterator position)
231 //Check that it is a valid iterator, to a real item:
232 if ( !position.node_|| (position == end()) )
235 //Get an iterator the the next item, to return:
236 iterator next = position;
239 //Use GTK+ C function to remove it, by providing the GtkWidget*:
240 gtk_container_remove( GTK_CONTAINER(gparent_), (GtkWidget*)(position->gobj()) );
244 } /* namespace Table_Helpers */
247 namespace Table_Helpers
250 TableList::TableList()
253 TableList::TableList(GtkTable* gparent)
254 : type_base((GObject*)gparent)
257 TableList::TableList(const TableList& src)
262 TableList& TableList::operator=(const TableList& src)
264 type_base::operator=(src);
268 GList*& TableList::glist() const
270 return ((GtkTable*)gparent_)->children;
273 void TableList::erase(iterator start, iterator stop)
275 type_base::erase(start, stop);
278 GtkTable* TableList::gparent()
280 return (GtkTable*)type_base::gparent();
283 const GtkTable* TableList::gparent() const
285 return (GtkTable*)type_base::gparent();
288 TableList::reference TableList::operator[](size_type l) const
290 return type_base::operator[](l);
293 } /* namespace Table_Helpers */
295 Table::Table(guint n_rows, guint n_columns, bool homogeneous)
297 Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
298 Gtk::Container(Glib::ConstructParams(table_class_.init(), "n_rows", n_rows, "n_columns", n_columns, "homogeneous", static_cast<int>(homogeneous), (char*) 0))
302 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)
304 gtk_table_attach(gobj(), (child).gobj(), left_attach, right_attach, top_attach, bottom_attach, ((GtkAttachOptions)(xoptions)), ((GtkAttachOptions)(yoptions)), xpadding, ypadding);
307 void Table::resize(guint rows, guint columns)
309 gtk_table_resize(gobj(), rows, columns);
312 void Table::set_row_spacing(guint row, guint spacing)
314 gtk_table_set_row_spacing(gobj(), row, spacing);
317 guint Table::get_row_spacing(guint row) const
319 return gtk_table_get_row_spacing(const_cast<GtkTable*>(gobj()), row);
322 void Table::set_col_spacing(guint column, guint spacing)
324 gtk_table_set_col_spacing(gobj(), column, spacing);
327 guint Table::get_col_spacing(guint column) const
329 return gtk_table_get_col_spacing(const_cast<GtkTable*>(gobj()), column);
332 void Table::set_row_spacings(guint spacing)
334 gtk_table_set_row_spacings(gobj(), spacing);
337 void Table::set_col_spacings(guint spacing)
339 gtk_table_set_col_spacings(gobj(), spacing);
342 guint Table::get_default_row_spacing()
344 return gtk_table_get_default_row_spacing(gobj());
347 guint Table::get_default_col_spacing()
349 return gtk_table_get_default_col_spacing(gobj());
352 void Table::set_homogeneous(bool homogeneous)
354 gtk_table_set_homogeneous(gobj(), static_cast<int>(homogeneous));
357 bool Table::get_homogeneous() const
359 return gtk_table_get_homogeneous(const_cast<GtkTable*>(gobj()));
363 Glib::PropertyProxy<guint> Table::property_n_rows()
365 return Glib::PropertyProxy<guint>(this, "n-rows");
368 Glib::PropertyProxy_ReadOnly<guint> Table::property_n_rows() const
370 return Glib::PropertyProxy_ReadOnly<guint>(this, "n-rows");
373 Glib::PropertyProxy<guint> Table::property_n_columns()
375 return Glib::PropertyProxy<guint>(this, "n-columns");
378 Glib::PropertyProxy_ReadOnly<guint> Table::property_n_columns() const
380 return Glib::PropertyProxy_ReadOnly<guint>(this, "n-columns");
383 Glib::PropertyProxy<guint> Table::property_column_spacing()
385 return Glib::PropertyProxy<guint>(this, "column-spacing");
388 Glib::PropertyProxy_ReadOnly<guint> Table::property_column_spacing() const
390 return Glib::PropertyProxy_ReadOnly<guint>(this, "column-spacing");
393 Glib::PropertyProxy<guint> Table::property_row_spacing()
395 return Glib::PropertyProxy<guint>(this, "row-spacing");
398 Glib::PropertyProxy_ReadOnly<guint> Table::property_row_spacing() const
400 return Glib::PropertyProxy_ReadOnly<guint>(this, "row-spacing");