[gtkmm] Added SizeRequest.



commit 51da537b3c624c86e4c5b6f75aad562b889e2b86
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Sep 1 12:22:03 2010 +0200

    Added SizeRequest.
    
    * tools/extra_defs_gen/generate_defs_gtk.cc: Added SizeRequest, though it
      has not properties or signals so there was no change to the .defs.
    * gtk/src/filelist.am:
    * gtk/src/sizerequest.[hg|ccg]: Added the SizeRequest interface.
    * gtk/src/widget.hg: Inherit from, and implement, SizeRequest.
    * tools/m4/convert_gtk.m4: Add an enum.

 ChangeLog                                 |   11 ++++++
 gtk/src/filelist.am                       |    1 +
 gtk/src/orientable.ccg                    |    3 +-
 gtk/src/sizerequest.ccg                   |   21 +++++++++++
 gtk/src/sizerequest.hg                    |   56 +++++++++++++++++++++++++++++
 gtk/src/widget.hg                         |    9 +++--
 tools/extra_defs_gen/generate_defs_gtk.cc |    1 +
 tools/m4/convert_gtk.m4                   |    1 +
 8 files changed, 97 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fb1a2ed..a627b38 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2010-09-01  Murray Cumming  <murrayc murrayc com>
 
+	Added SizeRequest.
+
+	* tools/extra_defs_gen/generate_defs_gtk.cc: Added SizeRequest, though it
+  has not properties or signals so there was no change to the .defs.
+	* gtk/src/filelist.am:
+	* gtk/src/sizerequest.[hg|ccg]: Added the SizeRequest interface.
+	* gtk/src/widget.hg: Inherit from, and implement, SizeRequest.
+	* tools/m4/convert_gtk.m4: Add an enum.
+
+2010-09-01  Murray Cumming  <murrayc murrayc com>
+
 	gtkmm.h: Remove incorrect include.
 
 	* gtk/gtkmm.h: REmove an include of the removed menu_elems.h header.
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index 2bb1d59..935dd17 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -133,6 +133,7 @@ gtkmm_files_any_hg =		\
 	separatortoolitem.hg	\
 	settings.hg		\
 	sizegroup.hg		\
+	sizerequest.hg		\
 	socket.hg		\
 	spinbutton.hg		\
 	spinner.hg		\
diff --git a/gtk/src/orientable.ccg b/gtk/src/orientable.ccg
index 2cf61fe..c1dee4d 100644
--- a/gtk/src/orientable.ccg
+++ b/gtk/src/orientable.ccg
@@ -1,5 +1,5 @@
 // -*- c++ -*-
-/* $Id: orientatoin.ccg,v 1.1 2003/01/21 13:38:48 murrayc Exp $ */
+/* $Id: orientable.ccg,v 1.1 2003/01/21 13:38:48 murrayc Exp $ */
 
 /* Copyright 2009 The gtkmm Development Team
  *
@@ -19,4 +19,3 @@
  */
 
 #include <gtk/gtk.h>
-
diff --git a/gtk/src/sizerequest.ccg b/gtk/src/sizerequest.ccg
new file mode 100644
index 0000000..e672a84
--- /dev/null
+++ b/gtk/src/sizerequest.ccg
@@ -0,0 +1,21 @@
+// -*- c++ -*-
+/* $Id: sizerequest.ccg,v 1.1 2003/01/21 13:38:48 murrayc Exp $ */
+
+/* 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 <gtk/gtk.h>
diff --git a/gtk/src/sizerequest.hg b/gtk/src/sizerequest.hg
new file mode 100644
index 0000000..d8cf8b5
--- /dev/null
+++ b/gtk/src/sizerequest.hg
@@ -0,0 +1,56 @@
+/* $Id: sizerequest.hg,v 1.3 2006/05/18 17:53:15 murrayc Exp $ */
+
+/* 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 <glibmm/interface.h>
+#include <gtkmm/enums.h>
+#include <gtk/gtk.h>
+_DEFS(gtkmm,gtk)
+_PINCLUDE(glibmm/private/interface_p.h)
+
+
+namespace Gtk
+{
+
+//TODO: Documentation.
+typedef GtkRequisition Requisition;
+
+_WRAP_ENUM(SizeRequestMode, GtkSizeRequestMode)
+
+/** TODO.
+ *
+ * @newin{3,0}
+ */
+class SizeRequest : public Glib::Interface
+{
+  _CLASS_INTERFACE(SizeRequest, GtkSizeRequest, GTK_SIZE_REQUEST, GtkSizeRequestIface)
+
+  //TODO: vfuncs
+
+public:
+  _WRAP_METHOD(SizeRequestMode get_request_mode() const, gtk_size_request_get_request_mode)
+  _WRAP_METHOD(void get_width(int& minimum_width, int& natural_width) const, gtk_size_request_get_width)
+  _WRAP_METHOD(void get_height_for_width(int width, int& minimum_height, int& natural_height) const, gtk_size_request_get_height_for_width)
+  _WRAP_METHOD(void get_height( int& minimum_height, int& natural_height) const, gtk_size_request_get_height)
+  _WRAP_METHOD(void get_width_for_height(int height, int& minimum_width, int& natural_width) const, gtk_size_request_get_width_for_height)
+  _WRAP_METHOD(void get_size(Requisition& minimum_size, Requisition& natural_size), gtk_size_request_get_size)
+
+  //There are no signals or properties.
+};
+
+} // namespace Gtk
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index fe43f09..14f24ea 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -40,6 +40,7 @@ _CONFIGINCLUDE(gtkmmconfig.h)
 #include <gtkmm/rc.h>
 #include <gtkmm/object.h>
 #include <gtkmm/clipboard.h>
+#include <gtkmm/sizerequest.h>
 //#include <gtkmm/action.h>
 
 _DEFS(gtkmm,gtk)
@@ -71,8 +72,6 @@ class Container;
 class Settings;
 class Tooltip;
 
-typedef GtkRequisition Requisition;
-
 // Gtk::Allocation is a typedef of Gdk::Rectangle because GtkAllocation is
 // a typedef of GdkRectangle.
 typedef Gdk::Rectangle Allocation;
@@ -99,14 +98,16 @@ typedef Gdk::Rectangle Allocation;
  */
 class Widget
 : public Object,
-  public Buildable
+  public Buildable,
+  public SizeRequest
 #ifdef GTKMM_ATKMM_ENABLED
   ,public Atk::Implementor
 #endif //GTKMM_ATKMM_ENABLED
 {
   _CLASS_GTKOBJECT(Widget,GtkWidget,GTK_WIDGET,Gtk::Object,GtkObject)
-  _IMPLEMENTS_INTERFACE(Atk::Implementor, ifdef GTKMM_ATKMM_ENABLED)
   _IMPLEMENTS_INTERFACE(Buildable)
+  _IMPLEMENTS_INTERFACE(SizeRequest)
+  _IMPLEMENTS_INTERFACE(Atk::Implementor, ifdef GTKMM_ATKMM_ENABLED)
   _IGNORE(gtk_widget_set, gtk_widget_queue_clear, gtk_widget_queue_clear_area, gtk_widget_draw,
           gtk_widget_set_uposition, gtk_widget_set_usize, gtk_widget_set_visual, gtk_widget_push_visual,
           gtk_widget_pop_visual, gtk_widget_set_default_visual, gtk_widget_set_rc_style, gtk_widget_restore_default_style)
diff --git a/tools/extra_defs_gen/generate_defs_gtk.cc b/tools/extra_defs_gen/generate_defs_gtk.cc
index d5a557a..8c83dcd 100644
--- a/tools/extra_defs_gen/generate_defs_gtk.cc
+++ b/tools/extra_defs_gen/generate_defs_gtk.cc
@@ -160,6 +160,7 @@ int main(int argc, char** argv)
             << get_defs( GTK_TYPE_SEPARATOR_TOOL_ITEM )
             << get_defs( GTK_TYPE_SETTINGS )
             << get_defs( GTK_TYPE_SIZE_GROUP )
+            << get_defs( GTK_TYPE_SIZE_REQUEST )
 #if !defined(G_OS_WIN32)
             << get_defs( GTK_TYPE_SOCKET )
 #endif /* G_OS_WIN32 */
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index 5b27fef..fd7feca 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -147,6 +147,7 @@ _CONV_ENUM(Gtk,NumberUpLayout)
 _CONV_ENUM(Gtk,EntryIconPosition)
 _CONV_ENUM(Gtk,WrapAllocationMode)
 _CONV_ENUM(Gtk,WrapBoxSpreading)
+_CONV_ENUM(Gtk,SizeRequestMode)
 
 _CONVERSION(`GtkIconSize',`IconSize',`IconSize(static_cast<int>($3))')
 _CONVERSION(`GtkIconSize',`Gtk::IconSize',`Gtk::IconSize(static_cast<int>($3))')



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]