[gtkmm] CellLayout, CellAreaContext: Added methods.



commit 49a5329098857e34bd4ca75f96ade6fc105571e4
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Dec 21 10:33:48 2010 +0100

    CellLayout, CellAreaContext: Added methods.
    
    * gtk/src/cellareacontext.[hg|ccg]: Added get_area(), allocate(), reset() and
    get_preferred_width_for_height().
    * gtk/src/celllayout.[hg|ccg]: Added get_area().
    * tools/m4/convert_gtk.m4: Added necessary conversions.

 ChangeLog                   |    9 +++++++++
 gtk/src/cellareacontext.ccg |    1 +
 gtk/src/cellareacontext.hg  |   10 ++++++++++
 gtk/src/celllayout.ccg      |    1 +
 gtk/src/celllayout.hg       |    6 ++++++
 tools/m4/convert_gtk.m4     |    3 +++
 6 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8327f80..a653e1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2010-12-21  Murray Cumming  <murrayc murrayc com>
 
+	CellLayout, CellAreaContext: Added methods.
+
+	* gtk/src/cellareacontext.[hg|ccg]: Added get_area(), allocate(), reset() and 
+	get_preferred_width_for_height().
+	* gtk/src/celllayout.[hg|ccg]: Added get_area().
+	* tools/m4/convert_gtk.m4: Added necessary conversions.
+
+2010-12-21  Murray Cumming  <murrayc murrayc com>
+
 	TreeViewColumn: Added get_button().
 
 	* gtk/src/treeviewcolumn.hg: Wrap gtk_tree_view_column_get_button().
diff --git a/gtk/src/cellareacontext.ccg b/gtk/src/cellareacontext.ccg
index 725407d..a991b07 100644
--- a/gtk/src/cellareacontext.ccg
+++ b/gtk/src/cellareacontext.ccg
@@ -15,6 +15,7 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <gtkmm/cellarea.h>
 #include <gtk/gtk.h>
 
 namespace Gtk
diff --git a/gtk/src/cellareacontext.hg b/gtk/src/cellareacontext.hg
index 287ebca..5c6e299 100644
--- a/gtk/src/cellareacontext.hg
+++ b/gtk/src/cellareacontext.hg
@@ -23,6 +23,8 @@ _PINCLUDE(glibmm/private/object_p.h)
 namespace Gtk
 {
 
+class CellArea;
+
 /** A class representing an adjustable bounded value.
  *
  * The Gtk::CellAreaContext object represents a value which has an associated
@@ -49,9 +51,17 @@ protected:
  
 public:
 
+  _WRAP_METHOD(Glib::RefPtr<CellArea> get_area(), gtk_cell_area_context_get_area, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const CellArea> get_area() const, gtk_cell_area_context_get_area, refreturn, constversion)
+  
+  _WRAP_METHOD(void allocate(int width, int height), gtk_cell_area_context_allocate)
+  _WRAP_METHOD(void reset(), gtk_cell_area_context_reset)
+
   _WRAP_METHOD(void get_preferred_width(int& minimum_width, int& natural_width) const, gtk_cell_area_context_get_preferred_width)
   //TODO: _WRAP_METHOD(void get_preferred_height(int& minimum_height, int& natural_height) const, gtk_cell_area_context_get_preferred_height)
   _WRAP_METHOD(void get_preferred_height_for_width(int width, int& minimum_height, int& natural_height) const, gtk_cell_area_context_get_preferred_height_for_width)
+  _WRAP_METHOD(void get_preferred_width_for_height(int height, int& minimum_width, int& natural_width) const, gtk_cell_area_context_get_preferred_width_for_height)
+                                                                   
   _WRAP_METHOD(void get_allocation(int& width, int& height) const, gtk_cell_area_context_get_allocation)
 
   _WRAP_METHOD(void push_preferred_width(int minimum_width, int natural_width), gtk_cell_area_context_push_preferred_width)
diff --git a/gtk/src/celllayout.ccg b/gtk/src/celllayout.ccg
index 146100b..78d70fd 100644
--- a/gtk/src/celllayout.ccg
+++ b/gtk/src/celllayout.ccg
@@ -18,6 +18,7 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <gtkmm/cellarea.h>
 #include <gtk/gtk.h>
 
 
diff --git a/gtk/src/celllayout.hg b/gtk/src/celllayout.hg
index bfbd7f0..f976d41 100644
--- a/gtk/src/celllayout.hg
+++ b/gtk/src/celllayout.hg
@@ -18,6 +18,7 @@
  */
 
 #include <glibmm/interface.h>
+//#include <gtkmm/cellarea.h>
 #include <gtkmm/cellrenderer.h>
 #include <gtkmm/cellrenderer_generation.h>
 #include <gtkmm/treemodel.h>
@@ -35,6 +36,8 @@ typedef struct _GtkCellLayoutIface GtkCellLayoutIface;
 namespace Gtk
 {
 
+class CellArea;
+
 /** An interface for packing cells.
  * CellLayout is an interface to be implemented by all objects which want to provide a TreeView::Column-like API
  * for packing cells, setting attributes and data funcs.
@@ -89,6 +92,9 @@ public:
 
   _WRAP_METHOD(void reorder(CellRenderer& cell, int position), gtk_cell_layout_reorder)
 
+  _WRAP_METHOD(Glib::RefPtr<CellArea> get_area(), gtk_cell_layout_get_area, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const CellArea> get_area() const, gtk_cell_layout_get_area, refreturn, constversion)
+
 protected:
   _WRAP_VFUNC(void pack_start(CellRenderer* cell, bool expand), pack_start)
   _WRAP_VFUNC(void pack_end(CellRenderer* cell, bool expand), pack_end)
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index d04ddc6..29c463c 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -217,6 +217,9 @@ _CONVERSION(`GtkAccelGroup*',`Glib::RefPtr<const AccelGroup>',`Glib::wrap($3)')
 _CONVERSION(`const Glib::RefPtr<AccelGroup>&',`GtkAccelGroup*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`Gtk::Object&',`GObject*', `($3).Glib::Object::gobj()')
 
+_CONVERSION(`GtkCellArea*',`Glib::RefPtr<CellArea>',`Glib::wrap($3)')
+_CONVERSION(`GtkCellArea*',`Glib::RefPtr<const CellArea>',`Glib::wrap($3)')
+
 _CONVERSION(`GtkCellAreaContext*',`Glib::RefPtr<CellAreaContext>',`Glib::wrap($3)')
 _CONVERSION(`GtkCellAreaContext*',`Glib::RefPtr<const CellAreaContext>',`Glib::wrap($3)')
 _CONVERSION(`const Glib::RefPtr<CellAreaContext>&',`GtkCellAreaContext*',__CONVERT_REFPTR_TO_P)



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