gnomemm r1489 - in goocanvasmm/trunk: . goocanvas/src



Author: murrayc
Date: Tue May  6 10:05:38 2008
New Revision: 1489
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1489&view=rev

Log:
2008-05-06  Murray Cumming  <murrayc murrayc com>

* goocanvas/src/item.hg:
* goocanvas/src/itemmodel.hg: Added get_simple_transform().
* goocanvas/src/table.ccg:
* goocanvas/src/table.hg: Added documentation for attach().

* goocanvas/src/itemmodelsimple.hg:
* goocanvas/src/libgoocanvas_methods.defs:
* goocanvas/src/rectmodel.hg:
* goocanvas/src/tablemodel.ccg:
* goocanvas/src/tablemodel.hg: Use double instead of gdouble in the API, 
for consistency with gtkmm.


Modified:
   goocanvasmm/trunk/ChangeLog
   goocanvasmm/trunk/NEWS
   goocanvasmm/trunk/configure.in
   goocanvasmm/trunk/goocanvas/src/item.hg
   goocanvasmm/trunk/goocanvas/src/itemmodel.hg
   goocanvasmm/trunk/goocanvas/src/itemmodelsimple.hg
   goocanvasmm/trunk/goocanvas/src/libgoocanvas_methods.defs
   goocanvasmm/trunk/goocanvas/src/rectmodel.hg
   goocanvasmm/trunk/goocanvas/src/table.ccg
   goocanvasmm/trunk/goocanvas/src/table.hg
   goocanvasmm/trunk/goocanvas/src/tablemodel.ccg
   goocanvasmm/trunk/goocanvas/src/tablemodel.hg

Modified: goocanvasmm/trunk/NEWS
==============================================================================
--- goocanvasmm/trunk/NEWS	(original)
+++ goocanvasmm/trunk/NEWS	Tue May  6 10:05:38 2008
@@ -1,3 +1,18 @@
+0.6.0:
+
+* Item, ItemModel: Added get_simple_transform(). (Murray Cumming)
+* Table:
+  - Added attach() convenience method.
+  - Added x-border-spacing, y-border-spacing, vert-grid-line-width, 
+    horz-grid-line-width properties.
+* Added TableModel.
+* Added properties and vfuncs (there should be almost none left now).
+  (Armin Burgmeier, Openismus)
+* Documentation:
+  - Added tablemodel example, showing two canvases that display the same 
+  underlying model.
+  (Armin Burgmeier, Openismus)
+
 0.5.0:
 
 * Ellipse:

Modified: goocanvasmm/trunk/configure.in
==============================================================================
--- goocanvasmm/trunk/configure.in	(original)
+++ goocanvasmm/trunk/configure.in	Tue May  6 10:05:38 2008
@@ -16,7 +16,7 @@
 #  Version and initialization
 #########################################################################
 LIBGOOCANVASMM_MAJOR_VERSION=0
-LIBGOOCANVASMM_MINOR_VERSION=5
+LIBGOOCANVASMM_MINOR_VERSION=6
 LIBGOOCANVASMM_MICRO_VERSION=0
 
 #
@@ -26,7 +26,7 @@
 #  ? :+1 : ?   == just some internal changes, nothing breaks but might work
 #                 better
 # CURRENT : REVISION : AGE
-LIBGOOCANVASMM_SO_VERSION=1:0:0
+LIBGOOCANVASMM_SO_VERSION=2:0:0
 
 LIBGOOCANVASMM_VERSION=$LIBGOOCANVASMM_MAJOR_VERSION.$LIBGOOCANVASMM_MINOR_VERSION.$LIBGOOCANVASMM_MICRO_VERSION
 LIBGOOCANVASMM_RELEASE=$LIBGOOCANVASMM_MAJOR_VERSION.$LIBGOOCANVASMM_MINOR_VERSION

Modified: goocanvasmm/trunk/goocanvas/src/item.hg
==============================================================================
--- goocanvasmm/trunk/goocanvas/src/item.hg	(original)
+++ goocanvasmm/trunk/goocanvas/src/item.hg	Tue May  6 10:05:38 2008
@@ -117,6 +117,7 @@
   _WRAP_METHOD(void set_transform(const Cairo::Matrix* matrix), goo_canvas_item_set_transform)
 
   _WRAP_METHOD(void set_simple_transform(double x, double y, double scale, double rotation), goo_canvas_item_set_simple_transform)
+  _WRAP_METHOD(bool get_simple_transform(double& x, double& y, double& scale, double& rotation) const, goo_canvas_item_get_simple_transform)
   _WRAP_METHOD(void translate(double tx, double ty), goo_canvas_item_translate)
   _WRAP_METHOD(void scale(double sx, double sy), goo_canvas_item_scale)
   _WRAP_METHOD(void rotate(double degrees, double cx, double cy), goo_canvas_item_rotate)

Modified: goocanvasmm/trunk/goocanvas/src/itemmodel.hg
==============================================================================
--- goocanvasmm/trunk/goocanvas/src/itemmodel.hg	(original)
+++ goocanvasmm/trunk/goocanvas/src/itemmodel.hg	Tue May  6 10:05:38 2008
@@ -82,6 +82,7 @@
   _WRAP_METHOD(bool get_transform(Cairo::Matrix* transform), goo_canvas_item_model_get_transform)
   _WRAP_METHOD(void set_transform(const Cairo::Matrix* transform), goo_canvas_item_model_set_transform)
   _WRAP_METHOD(void set_simple_transform(double x, double y, double scale, double rotation), goo_canvas_item_model_set_simple_transform)
+  _WRAP_METHOD(bool get_simple_transform(double& x, double& y, double& scale, double& rotation) const, goo_canvas_item_model_get_simple_transform)
   _WRAP_METHOD(void translate(double tx, double ty), goo_canvas_item_model_translate)
   _WRAP_METHOD(void scale(double sx, double sy), goo_canvas_item_model_scale)
   _WRAP_METHOD(void rotate(double degrees, double cx, double cy), goo_canvas_item_model_rotate)

Modified: goocanvasmm/trunk/goocanvas/src/itemmodelsimple.hg
==============================================================================
--- goocanvasmm/trunk/goocanvas/src/itemmodelsimple.hg	(original)
+++ goocanvasmm/trunk/goocanvas/src/itemmodelsimple.hg	Tue May  6 10:05:38 2008
@@ -53,8 +53,8 @@
   _WRAP_PROPERTY("line-cap", Cairo::LineCap)
   _WRAP_PROPERTY("line-dash", LineDash)
   _WRAP_PROPERTY("line-join", Cairo::LineJoin)
-  _WRAP_PROPERTY("line-join-miter-limit", gdouble)
-  _WRAP_PROPERTY("line-width", gdouble)
+  _WRAP_PROPERTY("line-join-miter-limit", double)
+  _WRAP_PROPERTY("line-width", double)
   _WRAP_PROPERTY("operator", Cairo::Operator)
   _WRAP_PROPERTY("stroke-color", Glib::ustring)
   _WRAP_PROPERTY("stroke-color-rgba", guint)

Modified: goocanvasmm/trunk/goocanvas/src/libgoocanvas_methods.defs
==============================================================================
--- goocanvasmm/trunk/goocanvas/src/libgoocanvas_methods.defs	(original)
+++ goocanvasmm/trunk/goocanvas/src/libgoocanvas_methods.defs	Tue May  6 10:05:38 2008
@@ -910,6 +910,18 @@
   )
 )
 
+(define-method get_simple_transform
+  (of-object "GooCanvasItem")
+  (c-name "goo_canvas_item_get_simple_transform")
+  (return-type "gboolean")
+  (parameters
+    '("gdouble*" "x")
+    '("gdouble*" "y")
+    '("gdouble*" "scale")
+    '("gdouble*" "rotation")
+  )
+)
+
 (define-method set_simple_transform
   (of-object "GooCanvasItem")
   (c-name "goo_canvas_item_set_simple_transform")
@@ -1338,6 +1350,18 @@
   )
 )
 
+(define-method get_simple_transform
+  (of-object "GooCanvasItemModel")
+  (c-name "goo_canvas_item_model_get_simple_transform")
+  (return-type "gboolean")
+  (parameters
+    '("gdouble*" "x")
+    '("gdouble*" "y")
+    '("gdouble*" "scale")
+    '("gdouble*" "rotation")
+  )
+)
+
 (define-method set_simple_transform
   (of-object "GooCanvasItemModel")
   (c-name "goo_canvas_item_model_set_simple_transform")

Modified: goocanvasmm/trunk/goocanvas/src/rectmodel.hg
==============================================================================
--- goocanvasmm/trunk/goocanvas/src/rectmodel.hg	(original)
+++ goocanvasmm/trunk/goocanvas/src/rectmodel.hg	Tue May  6 10:05:38 2008
@@ -31,19 +31,19 @@
 
 protected:
 
-  RectModel(gdouble x, double y, gdouble width, gdouble height);
+  RectModel(double x, double y, double width, double height);
   _IGNORE(goo_canvas_rect_model_new)
 
 public:
 
-  _WRAP_CREATE(gdouble x, gdouble y, gdouble width, gdouble height)
+  _WRAP_CREATE(double x, double y, double width, double height)
 
-  _WRAP_PROPERTY("height", gdouble)
-  _WRAP_PROPERTY("radius-x", gdouble)
-  _WRAP_PROPERTY("radius-y", gdouble)
-  _WRAP_PROPERTY("width", gdouble)
-  _WRAP_PROPERTY("x", gdouble)
-  _WRAP_PROPERTY("y", gdouble)
+  _WRAP_PROPERTY("height", double)
+  _WRAP_PROPERTY("radius-x", double)
+  _WRAP_PROPERTY("radius-y", double)
+  _WRAP_PROPERTY("width", double)
+  _WRAP_PROPERTY("x", double)
+  _WRAP_PROPERTY("y", double)
 
 };
 

Modified: goocanvasmm/trunk/goocanvas/src/table.ccg
==============================================================================
--- goocanvasmm/trunk/goocanvas/src/table.ccg	(original)
+++ goocanvasmm/trunk/goocanvas/src/table.ccg	Tue May  6 10:05:38 2008
@@ -23,7 +23,7 @@
 namespace Goocanvas
 {
 
-void Table::attach(const Glib::RefPtr<Item>& item, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach, Gtk::AttachOptions xoptions, Gtk::AttachOptions yoptions, gdouble left_padding, gdouble right_padding, gdouble top_padding, gdouble bottom_padding)
+void Table::attach(const Glib::RefPtr<Item>& item, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach, Gtk::AttachOptions xoptions, Gtk::AttachOptions yoptions, double left_padding, double right_padding, double top_padding, double bottom_padding)
 {
   const gboolean x_expand = (xoptions & Gtk::EXPAND) != 0;
   const gboolean x_fill = (xoptions & Gtk::FILL) != 0;

Modified: goocanvasmm/trunk/goocanvas/src/table.hg
==============================================================================
--- goocanvasmm/trunk/goocanvas/src/table.hg	(original)
+++ goocanvasmm/trunk/goocanvas/src/table.hg	Tue May  6 10:05:38 2008
@@ -35,7 +35,22 @@
 
   _WRAP_CREATE()
 
-  void attach(const Glib::RefPtr<Item>& item, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach, Gtk::AttachOptions xoptions = Gtk::FILL | Gtk::EXPAND, Gtk::AttachOptions yoptions = Gtk::FILL | Gtk::EXPAND, gdouble left_padding = 0.0, gdouble right_padding = 0.0, gdouble top_padding = 0.0, gdouble bottom_padding = 0.0);
+  /** This convenience method is easier than setting the properties individually,
+   * and is similar to Gtk::Table::attach().
+   *
+   * @param item The canvas item to add to the table.
+   * @param left_attach The left column to attach the item.
+   * @param right_attach The right column to attach the item. Just use left_attach+1 for a single column.
+   * @param top_attach The top column to attach the item.
+   * @param bottom_attach The bottom column to attach the item. Just use top_attach+1 for a single column.
+   * @param xoptions Whether the item should expand or shrink.
+   * @param yoptions Whether the item should expand or shrink.
+   * @param left_padding The padding at the left.
+   * @param right_padding The padding at the right.
+   * @param top_padding The padding at the top.
+   * @param bottom_padding The padding at the bottom.
+   */
+  void attach(const Glib::RefPtr<Item>& item, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach, Gtk::AttachOptions xoptions = Gtk::FILL | Gtk::EXPAND, Gtk::AttachOptions yoptions = Gtk::FILL | Gtk::EXPAND, double left_padding = 0.0, double right_padding = 0.0, double top_padding = 0.0, double bottom_padding = 0.0);
 
   // TODO: We should get rid of this overload with the next gtkmm API/ABI break.
   // See http://bugzilla.gnome.org/show_bug.cgi?id=142849.

Modified: goocanvasmm/trunk/goocanvas/src/tablemodel.ccg
==============================================================================
--- goocanvasmm/trunk/goocanvas/src/tablemodel.ccg	(original)
+++ goocanvasmm/trunk/goocanvas/src/tablemodel.ccg	Tue May  6 10:05:38 2008
@@ -23,7 +23,7 @@
 namespace Goocanvas
 {
 
-void TableModel::attach(const Glib::RefPtr<ItemModel>& item, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach, Gtk::AttachOptions xoptions, Gtk::AttachOptions yoptions, gdouble left_padding, gdouble right_padding, gdouble top_padding, gdouble bottom_padding)
+void TableModel::attach(const Glib::RefPtr<ItemModel>& item, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach, Gtk::AttachOptions xoptions, Gtk::AttachOptions yoptions, double left_padding, double right_padding, double top_padding, double bottom_padding)
 {
   const gboolean x_expand = (xoptions & Gtk::EXPAND) != 0;
   const gboolean x_fill = (xoptions & Gtk::FILL) != 0;

Modified: goocanvasmm/trunk/goocanvas/src/tablemodel.hg
==============================================================================
--- goocanvasmm/trunk/goocanvas/src/tablemodel.hg	(original)
+++ goocanvasmm/trunk/goocanvas/src/tablemodel.hg	Tue May  6 10:05:38 2008
@@ -35,7 +35,7 @@
 
   _WRAP_CREATE()
 
-  void attach(const Glib::RefPtr<ItemModel>& item, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach, Gtk::AttachOptions xoptions = Gtk::FILL | Gtk::EXPAND, Gtk::AttachOptions yoptions = Gtk::FILL | Gtk::EXPAND, gdouble left_padding = 0.0, gdouble right_padding = 0.0, gdouble top_padding = 0.0, gdouble bottom_padding = 0.0);
+  void attach(const Glib::RefPtr<ItemModel>& item, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach, Gtk::AttachOptions xoptions = Gtk::FILL | Gtk::EXPAND, Gtk::AttachOptions yoptions = Gtk::FILL | Gtk::EXPAND, double left_padding = 0.0, double right_padding = 0.0, double top_padding = 0.0, double bottom_padding = 0.0);
 
   void set_align(const Glib::RefPtr<ItemModel>& child, double xalign = 0.0, double yalign = 0.0);
   void set_align(const Glib::RefPtr<ItemModel>& child, Gtk::AlignmentEnum xalign = Gtk::ALIGN_LEFT, Gtk::AlignmentEnum yalign = Gtk::ALIGN_TOP);



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