Upgraded gtkmm to gtkmm-2.10.7.
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / table.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3
4 #include <gtkmm/table.h>
5 #include <gtkmm/private/table_p.h>
6
7 // -*- c++ -*-
8 /* $Id$ */
9
10 /* 
11  *
12  * Copyright 1998-2002 The gtkmm Development Team
13  *
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.
18  *
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.
23  *
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.
27  */
28
29 #include <gtk/gtktable.h>
30
31 namespace Gtk
32 {
33
34 namespace Table_Helpers
35 {
36
37 Widget* Child::get_widget() const
38 {
39   return Glib::wrap(gobj()->widget);
40 }
41
42 guint16 Child::get_left_attach() const
43 {
44   return gobj()->left_attach;
45 }
46
47
48 guint16 Child::get_right_attach() const
49 {
50   return gobj()->right_attach;
51 }
52
53 guint16 Child::get_top_attach() const
54 {
55   return gobj()->top_attach;
56 }
57
58 guint16 Child::get_bottom_attach() const
59 {
60   return gobj()->bottom_attach;
61 }
62
63 guint16 Child::get_xpadding() const
64 {
65   return gobj()->xpadding;
66 }
67
68 guint16 Child::get_ypadding() const
69 {
70   return gobj()->ypadding;
71 }
72
73 bool Child::get_xexpand() const
74 {
75   return (bool)gobj()->xexpand;
76 }
77
78 bool Child::get_yexpand() const
79 {
80   return (bool)gobj()->yexpand;
81 }
82
83 bool Child::get_xshrink() const
84 {
85   return (bool)gobj()->xshrink;
86 }
87 bool Child::get_yshrink() const
88 {
89   return (bool)gobj()->yshrink;
90 }
91
92 bool Child::get_xfill() const
93 {
94   return (bool)gobj()->xfill;
95 }
96
97 bool Child::get_yfill() const
98 {
99   return (bool)gobj()->yfill;
100 }
101
102
103 } //namespace Table_Helpers
104
105
106 void Table::set_spacings(guint spacing)
107 {
108   set_row_spacings(spacing);
109   set_col_spacings(spacing);
110 }
111
112 Table::TableList& Table::children()
113 {
114   children_proxy_ = TableList(gobj());
115   return children_proxy_;
116 }
117
118 const Table::TableList& Table::children() const
119 {
120   children_proxy_ = TableList(const_cast<GtkTable*>(gobj()));
121   return children_proxy_;
122 }
123
124
125 } /* namespace Gtk */
126
127
128 namespace
129 {
130 } // anonymous namespace
131
132
133 namespace Glib
134 {
135
136 Gtk::Table* wrap(GtkTable* object, bool take_copy)
137 {
138   return dynamic_cast<Gtk::Table *> (Glib::wrap_auto ((GObject*)(object), take_copy));
139 }
140
141 } /* namespace Glib */
142
143 namespace Gtk
144 {
145
146
147 /* The *_Class implementation: */
148
149 const Glib::Class& Table_Class::init()
150 {
151   if(!gtype_) // create the GType if necessary
152   {
153     // Glib::Class has to know the class init function to clone custom types.
154     class_init_func_ = &Table_Class::class_init_function;
155
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();
159
160     // Create the wrapper type, with the same class/instance size as the base type.
161     register_derived_type(gtk_table_get_type());
162
163     // Add derived versions of interfaces, if the C type implements any interfaces:
164   }
165
166   return *this;
167 }
168
169 void Table_Class::class_init_function(void* g_class, void* class_data)
170 {
171   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
172   CppClassParent::class_init_function(klass, class_data);
173
174 #ifdef GLIBMM_VFUNCS_ENABLED
175 #endif //GLIBMM_VFUNCS_ENABLED
176
177 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
178 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
179 }
180
181 #ifdef GLIBMM_VFUNCS_ENABLED
182 #endif //GLIBMM_VFUNCS_ENABLED
183
184 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
185 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
186
187
188 Glib::ObjectBase* Table_Class::wrap_new(GObject* o)
189 {
190   return manage(new Table((GtkTable*)(o)));
191
192 }
193
194
195 /* The implementation: */
196
197 Table::Table(const Glib::ConstructParams& construct_params)
198 :
199   Gtk::Container(construct_params)
200 {
201   }
202
203 Table::Table(GtkTable* castitem)
204 :
205   Gtk::Container((GtkContainer*)(castitem))
206 {
207   }
208
209 Table::~Table()
210 {
211   destroy_();
212 }
213
214 Table::CppClassType Table::table_class_; // initialize static member
215
216 GType Table::get_type()
217 {
218   return table_class_.init().get_type();
219 }
220
221 GType Table::get_base_type()
222 {
223   return gtk_table_get_type();
224 }
225
226
227 namespace Table_Helpers
228 {
229
230 void TableList::remove(const_reference child)
231 {
232   gtk_container_remove(GTK_CONTAINER(gparent_),
233                        (GtkWidget*)(child.get_widget ()->gobj()));
234 }
235
236 void TableList::remove(Widget& widget)
237 {
238   gtk_container_remove(GTK_CONTAINER(gparent_), (GtkWidget*)(widget.gobj()));
239 }
240
241 TableList::iterator TableList::erase(iterator position)
242 {
243   //Check that it is a valid iterator, to a real item:
244   if ( !position.node_|| (position == end()) )
245     return end();
246
247   //Get an iterator the the next item, to return:
248   iterator next = position;
249   next++;
250
251   //Use GTK+ C function to remove it, by providing the GtkWidget*:
252   gtk_container_remove( GTK_CONTAINER(gparent_), (GtkWidget*)(position->get_widget ()->gobj()) );
253   return next;
254 }
255
256 } /* namespace Table_Helpers */
257
258
259 namespace Table_Helpers
260 {
261
262 TableList::TableList()
263 {}
264
265 TableList::TableList(GtkTable* gparent)
266 : type_base((GObject*)gparent)
267 {}
268
269 TableList::TableList(const TableList& src)
270 :
271   type_base(src)
272 {}
273
274 TableList& TableList::operator=(const TableList& src)
275 {
276   type_base::operator=(src);
277   return *this;
278 }
279
280 GList*& TableList::glist() const
281 {
282   return ((GtkTable*)gparent_)->children;
283 }
284
285 void TableList::erase(iterator start, iterator stop)
286 {
287   type_base::erase(start, stop);
288 }
289
290 GtkTable* TableList::gparent()
291 {
292   return (GtkTable*)type_base::gparent();
293 }
294
295 const GtkTable* TableList::gparent() const
296 {
297   return (GtkTable*)type_base::gparent();
298 }
299
300 TableList::reference TableList::operator[](size_type l) const
301 {
302   return type_base::operator[](l);
303 }
304
305 } /* namespace Table_Helpers */
306
307 Table::Table(guint n_rows, guint n_columns, bool homogeneous)
308 :
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))
311 {
312   }
313
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)
315 {
316 gtk_table_attach(gobj(), (child).gobj(), left_attach, right_attach, top_attach, bottom_attach, ((GtkAttachOptions)(xoptions)), ((GtkAttachOptions)(yoptions)), xpadding, ypadding); 
317 }
318
319 void Table::resize(guint rows, guint columns)
320 {
321 gtk_table_resize(gobj(), rows, columns); 
322 }
323
324 void Table::set_row_spacing(guint row, guint spacing)
325 {
326 gtk_table_set_row_spacing(gobj(), row, spacing); 
327 }
328
329 guint Table::get_row_spacing(guint row) const
330 {
331   return gtk_table_get_row_spacing(const_cast<GtkTable*>(gobj()), row);
332 }
333
334 void Table::set_col_spacing(guint column, guint spacing)
335 {
336 gtk_table_set_col_spacing(gobj(), column, spacing); 
337 }
338
339 guint Table::get_col_spacing(guint column) const
340 {
341   return gtk_table_get_col_spacing(const_cast<GtkTable*>(gobj()), column);
342 }
343
344 void Table::set_row_spacings(guint spacing)
345 {
346 gtk_table_set_row_spacings(gobj(), spacing); 
347 }
348
349 void Table::set_col_spacings(guint spacing)
350 {
351 gtk_table_set_col_spacings(gobj(), spacing); 
352 }
353
354 guint Table::get_default_row_spacing()
355 {
356   return gtk_table_get_default_row_spacing(gobj());
357 }
358
359 guint Table::get_default_col_spacing()
360 {
361   return gtk_table_get_default_col_spacing(gobj());
362 }
363
364 void Table::set_homogeneous(bool homogeneous)
365 {
366 gtk_table_set_homogeneous(gobj(), static_cast<int>(homogeneous)); 
367 }
368
369 bool Table::get_homogeneous() const
370 {
371   return gtk_table_get_homogeneous(const_cast<GtkTable*>(gobj()));
372 }
373
374
375 #ifdef GLIBMM_PROPERTIES_ENABLED
376 Glib::PropertyProxy<guint> Table::property_n_rows() 
377 {
378   return Glib::PropertyProxy<guint>(this, "n-rows");
379 }
380 #endif //GLIBMM_PROPERTIES_ENABLED
381
382 #ifdef GLIBMM_PROPERTIES_ENABLED
383 Glib::PropertyProxy_ReadOnly<guint> Table::property_n_rows() const
384 {
385   return Glib::PropertyProxy_ReadOnly<guint>(this, "n-rows");
386 }
387 #endif //GLIBMM_PROPERTIES_ENABLED
388
389 #ifdef GLIBMM_PROPERTIES_ENABLED
390 Glib::PropertyProxy<guint> Table::property_n_columns() 
391 {
392   return Glib::PropertyProxy<guint>(this, "n-columns");
393 }
394 #endif //GLIBMM_PROPERTIES_ENABLED
395
396 #ifdef GLIBMM_PROPERTIES_ENABLED
397 Glib::PropertyProxy_ReadOnly<guint> Table::property_n_columns() const
398 {
399   return Glib::PropertyProxy_ReadOnly<guint>(this, "n-columns");
400 }
401 #endif //GLIBMM_PROPERTIES_ENABLED
402
403 #ifdef GLIBMM_PROPERTIES_ENABLED
404 Glib::PropertyProxy<guint> Table::property_column_spacing() 
405 {
406   return Glib::PropertyProxy<guint>(this, "column-spacing");
407 }
408 #endif //GLIBMM_PROPERTIES_ENABLED
409
410 #ifdef GLIBMM_PROPERTIES_ENABLED
411 Glib::PropertyProxy_ReadOnly<guint> Table::property_column_spacing() const
412 {
413   return Glib::PropertyProxy_ReadOnly<guint>(this, "column-spacing");
414 }
415 #endif //GLIBMM_PROPERTIES_ENABLED
416
417 #ifdef GLIBMM_PROPERTIES_ENABLED
418 Glib::PropertyProxy<guint> Table::property_row_spacing() 
419 {
420   return Glib::PropertyProxy<guint>(this, "row-spacing");
421 }
422 #endif //GLIBMM_PROPERTIES_ENABLED
423
424 #ifdef GLIBMM_PROPERTIES_ENABLED
425 Glib::PropertyProxy_ReadOnly<guint> Table::property_row_spacing() const
426 {
427   return Glib::PropertyProxy_ReadOnly<guint>(this, "row-spacing");
428 }
429 #endif //GLIBMM_PROPERTIES_ENABLED
430
431
432 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
433 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
434
435 #ifdef GLIBMM_VFUNCS_ENABLED
436 #endif //GLIBMM_VFUNCS_ENABLED
437
438
439 } // namespace Gtk
440
441