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