[gtkmm/spread-table] Add SpreadTable
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm/spread-table] Add SpreadTable
- Date: Fri, 8 Oct 2010 08:21:08 +0000 (UTC)
commit c62eb862468d0ba9ca77ac983514cd975f351dc3
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Oct 8 10:18:10 2010 +0200
Add SpreadTable
* tools/extra_defs_gen/generate_defs_gtk.cc: Use GTK_SPREAD_TABLE.
* gtk/src/gtk_signas.defs: Add the generated GtkSpreadTable parts.
* gtk/src/gtk_methods.defs: Added parts for GtkSpreadTable, from h2defs.py.
* gtk/gtkmm.h: Include gtkmm/spreadtable.h.
* gtk/src/spreadtable.[hg|ccg]: New files, wrapping GtkSpreadTable.
* gtk/src/filelist.am: Mention the new files.
ChangeLog | 12 +
gtk/gtkmm.h | 1 +
gtk/src/filelist.am | 1 +
gtk/src/gtk_methods.defs | 77 +++++++
gtk/src/gtk_signals.defs | 335 +++++++++++++++++++++++++++++
gtk/src/spreadtable.ccg | 31 +++
gtk/src/spreadtable.hg | 63 ++++++
tools/extra_defs_gen/generate_defs_gtk.cc | 1 +
8 files changed, 521 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e541868..22f06ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-08 Murray Cumming <murrayc murrayc com>
+
+ Add SpreadTable
+
+ * tools/extra_defs_gen/generate_defs_gtk.cc: Use GTK_SPREAD_TABLE.
+ * gtk/src/gtk_signas.defs: Add the generated GtkSpreadTable parts.
+
+ * gtk/src/gtk_methods.defs: Added parts for GtkSpreadTable, from h2defs.py.
+ * gtk/gtkmm.h: Include gtkmm/spreadtable.h.
+ * gtk/src/spreadtable.[hg|ccg]: New files, wrapping GtkSpreadTable.
+ * gtk/src/filelist.am: Mention the new files.
+
2010-10-06 Murray Cumming <murrayc murrayc com>>
Fix the build with latest GTK+ from git master.
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index cfc8943..c1134ed 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -209,6 +209,7 @@ extern const int gtkmm_micro_version;
#include <gtkmm/sizegroup.h>
#include <gtkmm/spinbutton.h>
#include <gtkmm/spinner.h>
+#include <gtkmm/spreadtable.h>
#include <gtkmm/statusbar.h>
#include <gtkmm/statusicon.h>
#include <gtkmm/stock.h>
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index 7af311c..d74a2ce 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -136,6 +136,7 @@ gtkmm_files_any_hg = \
socket.hg \
spinbutton.hg \
spinner.hg \
+ spreadtable.hg \
statusbar.hg \
statusicon.hg \
stockitem.hg \
diff --git a/gtk/src/gtk_methods.defs b/gtk/src/gtk_methods.defs
index 5900365..f533d11 100644
--- a/gtk/src/gtk_methods.defs
+++ b/gtk/src/gtk_methods.defs
@@ -659,6 +659,13 @@
(gtype-id "GTK_TYPE_TABLE")
)
+(define-object SpreadTable
+ (in-module "Gtk")
+ (parent "GtkContainer")
+ (c-name "GtkSpreadTable")
+ (gtype-id "GTK_TYPE_SPREAD_TABLE")
+)
+
(define-object Socket
(in-module "Gtk")
(parent "GtkContainer")
@@ -18600,7 +18607,77 @@
(return-type "none")
)
+;; From gtkspreadtable.h
+
+(define-function gtk_spread_table_get_type
+ (c-name "gtk_spread_table_get_type")
+ (return-type "GType")
+)
+
+(define-function gtk_spread_table_new
+ (c-name "gtk_spread_table_new")
+ (is-constructor-of "GtkSpreadTable")
+ (return-type "GtkWidget*")
+ (parameters
+ '("GtkOrientation" "orientation")
+ '("guint" "lines")
+ )
+)
+
+(define-method insert_child
+ (of-object "GtkSpreadTable")
+ (c-name "gtk_spread_table_insert_child")
+ (return-type "none")
+ (parameters
+ '("GtkWidget*" "child")
+ '("gint" "index")
+ )
+)
+
+(define-method set_lines
+ (of-object "GtkSpreadTable")
+ (c-name "gtk_spread_table_set_lines")
+ (return-type "none")
+ (parameters
+ '("guint" "lines")
+ )
+)
+(define-method get_lines
+ (of-object "GtkSpreadTable")
+ (c-name "gtk_spread_table_get_lines")
+ (return-type "guint")
+)
+
+(define-method set_horizontal_spacing
+ (of-object "GtkSpreadTable")
+ (c-name "gtk_spread_table_set_horizontal_spacing")
+ (return-type "none")
+ (parameters
+ '("guint" "spacing")
+ )
+)
+
+(define-method get_horizontal_spacing
+ (of-object "GtkSpreadTable")
+ (c-name "gtk_spread_table_get_horizontal_spacing")
+ (return-type "guint")
+)
+
+(define-method set_vertical_spacing
+ (of-object "GtkSpreadTable")
+ (c-name "gtk_spread_table_set_vertical_spacing")
+ (return-type "none")
+ (parameters
+ '("guint" "spacing")
+ )
+)
+
+(define-method get_vertical_spacing
+ (of-object "GtkSpreadTable")
+ (c-name "gtk_spread_table_get_vertical_spacing")
+ (return-type "guint")
+)
;; From gtkstatusbar.h
diff --git a/gtk/src/gtk_signals.defs b/gtk/src/gtk_signals.defs
index 4bc97ae..31bf192 100644
--- a/gtk/src/gtk_signals.defs
+++ b/gtk/src/gtk_signals.defs
@@ -35813,6 +35813,341 @@
(construct-only #f)
)
+;; From GtkSpreadTable
+
+(define-property orientation
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamEnum")
+ (docs "The orientation of the orientable")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property name
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamString")
+ (docs "The name of the widget")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property parent
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamObject")
+ (docs "The parent widget of this widget. Must be a Container widget")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property width-request
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamInt")
+ (docs "Override for width request of the widget, or -1 if natural request should be used")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property height-request
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamInt")
+ (docs "Override for height request of the widget, or -1 if natural request should be used")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property visible
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamBoolean")
+ (docs "Whether the widget is visible")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property sensitive
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamBoolean")
+ (docs "Whether the widget responds to input")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property app-paintable
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamBoolean")
+ (docs "Whether the application will paint directly on the widget")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property can-focus
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamBoolean")
+ (docs "Whether the widget can accept the input focus")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property has-focus
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamBoolean")
+ (docs "Whether the widget has the input focus")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property is-focus
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamBoolean")
+ (docs "Whether the widget is the focus widget within the toplevel")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property can-default
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamBoolean")
+ (docs "Whether the widget can be the default widget")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property has-default
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamBoolean")
+ (docs "Whether the widget is the default widget")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property receives-default
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamBoolean")
+ (docs "If TRUE, the widget will receive the default action when it is focused")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property composite-child
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamBoolean")
+ (docs "Whether the widget is part of a composite widget")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property style
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamObject")
+ (docs "The style of the widget, which contains information about how it will look (colors etc)")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property events
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamFlags")
+ (docs "The event mask that decides what kind of GdkEvents this widget gets")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property extension-events
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamEnum")
+ (docs "The mask that decides what kind of extension events this widget gets")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property no-show-all
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamBoolean")
+ (docs "Whether gtk_widget_show_all() should not affect this widget")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property has-tooltip
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamBoolean")
+ (docs "Whether this widget has a tooltip")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property tooltip-markup
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamString")
+ (docs "The contents of the tooltip for this widget")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property tooltip-text
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamString")
+ (docs "The contents of the tooltip for this widget")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property window
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamObject")
+ (docs "The widget's window if it is realized")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property double-buffered
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamBoolean")
+ (docs "Whether the widget is double buffered")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property halign
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamEnum")
+ (docs "How to position in extra horizontal space")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property valign
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamEnum")
+ (docs "How to position in extra vertical space")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property margin-left
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamInt")
+ (docs "Pixels of extra space on the left side")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property margin-right
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamInt")
+ (docs "Pixels of extra space on the right side")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property margin-top
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamInt")
+ (docs "Pixels of extra space on the top side")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property margin-bottom
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamInt")
+ (docs "Pixels of extra space on the bottom side")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property margin
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamInt")
+ (docs "Pixels of extra space on all four sides")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property border-width
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamUInt")
+ (docs "The width of the empty border outside the containers children")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property resize-mode
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamEnum")
+ (docs "Specify how resize events are handled")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property child
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamObject")
+ (docs "Can be used to add a new child to the container")
+ (readable #f)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property horizontal-spacing
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamUInt")
+ (docs "The amount of horizontal space between two children")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property vertical-spacing
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamUInt")
+ (docs "The amount of vertical space between two children")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property lines
+ (of-object "GtkSpreadTable")
+ (prop-type "GParamUInt")
+ (docs "The number of lines (rows/columns) to evenly distribute children to.")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
;; From GtkSpinButton
(define-signal value-changed
diff --git a/gtk/src/spreadtable.ccg b/gtk/src/spreadtable.ccg
new file mode 100644
index 0000000..45f2a5a
--- /dev/null
+++ b/gtk/src/spreadtable.ccg
@@ -0,0 +1,31 @@
+/*
+ *
+ * Copyright 2010 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <glib.h>
+#include <gtk/gtk.h>
+
+namespace Gtk
+{
+
+void SpreadTable::append_child(Widget& widget)
+{
+ insert_child(widget, -1 /* see the C documentation */);
+}
+
+} // namespace Gtk
diff --git a/gtk/src/spreadtable.hg b/gtk/src/spreadtable.hg
new file mode 100644
index 0000000..4f9310e
--- /dev/null
+++ b/gtk/src/spreadtable.hg
@@ -0,0 +1,63 @@
+/* Copyright (C) 2010 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gtkmm/container.h>
+#include <gtkmm/orientable.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/container_p.h)
+
+namespace Gtk
+{
+
+/** TODO
+ *
+ * @newin{3,0}
+ *
+ * @ingroup Widgets
+ * @ingroup Containers
+ */
+class SpreadTable
+: public Container
+{
+ _CLASS_GTKOBJECT(SpreadTable, GtkSpreadTable, GTK_SPREAD_TABLE, Gtk::Container, GtkContainer)
+ _IMPLEMENTS_INTERFACE(Orientable)
+public:
+ _CTOR_DEFAULT()
+ _WRAP_CTOR(SpreadTable(Orientation orientation, guint lines), gtk_spread_table_new)
+
+ _WRAP_METHOD(void set_lines(guint lines), gtk_spread_table_set_lines)
+ _WRAP_METHOD(guint get_lines() const, gtk_spread_table_get_lines)
+
+ _WRAP_METHOD(void set_vertical_spacing(guint spacing), gtk_spread_table_set_vertical_spacing)
+ _WRAP_METHOD(guint get_vertical_spacing() const, gtk_spread_table_get_vertical_spacing)
+
+ _WRAP_METHOD(void set_horizontal_spacing(guint spacing), gtk_spread_table_set_horizontal_spacing)
+ _WRAP_METHOD(guint get_horizontal_spacing() const, gtk_spread_table_get_horizontal_spacing)
+
+ //TODO: Is the default packing appropriate (and like the default for a Box::pack_start())?
+ _WRAP_METHOD(void insert_child(Widget& widget, int index), gtk_spread_table_insert_child)
+
+ //TODO: Documentation
+ void append_child(Widget& widget);
+
+ _WRAP_PROPERTY("vertical-spacing", guint)
+ _WRAP_PROPERTY("horizontal-spacing", guint)
+ _WRAP_PROPERTY("lines", guint)
+};
+
+} // namespace Gtk
diff --git a/tools/extra_defs_gen/generate_defs_gtk.cc b/tools/extra_defs_gen/generate_defs_gtk.cc
index 6117993..f2f437a 100644
--- a/tools/extra_defs_gen/generate_defs_gtk.cc
+++ b/tools/extra_defs_gen/generate_defs_gtk.cc
@@ -166,6 +166,7 @@ int main(int argc, char** argv)
<< get_defs( GTK_TYPE_SOCKET )
#endif /* G_OS_WIN32 */
<< get_defs( GTK_TYPE_SPINNER )
+ << get_defs( GTK_TYPE_SPREAD_TABLE )
<< get_defs( GTK_TYPE_SPIN_BUTTON )
<< get_defs( GTK_TYPE_STATUSBAR )
<< get_defs( GTK_TYPE_STATUS_ICON )
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]