gnomemm r1352 - in goocanvasmm/trunk: . goocanvas/src tools/m4
- From: jjongsma svn gnome org
- To: svn-commits-list gnome org
- Subject: gnomemm r1352 - in goocanvasmm/trunk: . goocanvas/src tools/m4
- Date: Sun, 17 Feb 2008 03:30:42 +0000 (GMT)
Author: jjongsma
Date: Sun Feb 17 03:30:41 2008
New Revision: 1352
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1352&view=rev
Log:
* goocanvas/src/item.hg: modify get_items_at() to take a non-const
listhandle for found_items since the convention for C functions that
implement this function is to add any found items onto this list and then
pass it down to the child item which adds their found items.
Also wrapped a few more vfuncs
* goocanvas/src/itemsimple.hg: wrap vfuncs, add getters and setters for some
public data members
* goocanvas/src/libgoocanvas_vfuncs.defs: update get_items_at()
* tools/m4/convert_libgoocanvasmm.m4: minor changes to support the changes
above
Modified:
goocanvasmm/trunk/ChangeLog
goocanvasmm/trunk/goocanvas/src/item.hg
goocanvasmm/trunk/goocanvas/src/itemsimple.hg
goocanvasmm/trunk/goocanvas/src/libgoocanvas_vfuncs.defs
goocanvasmm/trunk/tools/m4/convert_libgoocanvasmm.m4
Modified: goocanvasmm/trunk/goocanvas/src/item.hg
==============================================================================
--- goocanvasmm/trunk/goocanvas/src/item.hg (original)
+++ goocanvasmm/trunk/goocanvas/src/item.hg Sun Feb 17 03:30:41 2008
@@ -51,6 +51,7 @@
_WRAP_METHOD(Canvas* get_canvas(), goo_canvas_item_get_canvas)
_WRAP_METHOD(const Canvas* get_canvas() const, goo_canvas_item_get_canvas, constversion)
+ // TODO: should this be passed by reference instead of by pointer?
_WRAP_METHOD(void set_canvas(Canvas* canvas), goo_canvas_item_set_canvas)
_WRAP_METHOD(bool is_visible() const, goo_canvas_item_is_visible)
@@ -99,8 +100,8 @@
_WRAP_METHOD(void allocate_area(const Cairo::RefPtr<Cairo::Context>& context, const Bounds& requested_area, const Bounds& allocated_area, double x_offset, double y_offset), goo_canvas_item_allocate_area)
#m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Item> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
-#m4 _CONVERSION(`const Glib::ListHandle< Glib::RefPtr<Item> >&',`GList*', `($3).data()')
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Item> > get_items_at(double x, double y, const Cairo::RefPtr<Cairo::Context>& context, bool is_pointer_event, bool parent_is_visible, const Glib::ListHandle< Glib::RefPtr<Item> >& found_items), goo_canvas_item_get_items_at)
+#m4 _CONVERSION(`Glib::ListHandle< Glib::RefPtr<Item> >&',`GList*', `($3).data()')
+ _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Item> > get_items_at(double x, double y, const Cairo::RefPtr<Cairo::Context>& context, bool is_pointer_event, bool parent_is_visible, Glib::ListHandle< Glib::RefPtr<Item> >& found_items), goo_canvas_item_get_items_at)
//TODO: Use Cairo::RefPtr?
_WRAP_METHOD(bool get_transform(Cairo::Matrix* matrix), goo_canvas_item_get_transform)
@@ -158,21 +159,16 @@
/* Virtual methods that group items must implement. */
-/*
- GooCanvas* (* get_canvas) (GooCanvasItem *item);
- void (* set_canvas(
- GooCanvas *canvas);
- gint (* get_n_children) (GooCanvasItem *item);
- GooCanvasItem* (* get_child(
- gint child_num);
- void (* request_update) (GooCanvasItem *item);
-*/
+ _WRAP_VFUNC(int get_n_children() const, get_n_children)
+ _WRAP_VFUNC(Glib::RefPtr<Item> get_child(int child_num), get_child)
+ _WRAP_VFUNC(void request_update(), request_update)
+ _WRAP_VFUNC(GooCanvas* get_canvas(), get_canvas)
+ // TODO: should this be passed by reference instead of by pointer?
+ _WRAP_VFUNC(void set_canvas(GooCanvas* canvas), set_canvas)
/* Virtual methods that group items may implement. */
+ _WRAP_VFUNC(void add_child(const Glib::RefPtr<Item>& child, int position), add_child)
/*
- void (* add_child(
- GooCanvasItem *child,
- gint position);
void (* move_child(
gint old_position,
gint new_position);
@@ -196,15 +192,16 @@
/* Virtual methods that all canvas items must implement. */
#m4 _CONVERSION(`Glib::RefPtr<Item>', `GooCanvasItem*', `(($3) ? ($3)->gobj() : 0)');
- _WRAP_VFUNC(Glib::RefPtr<Item> get_parent(), get_parent)
- _WRAP_VFUNC(void set_parent(const Glib::RefPtr<Item>& parent), set_parent)
+#m4 _CONVERSION(`GooCanvasItem*', `Glib::RefPtr<Item>', `Glib::wrap($3, true)')
+ _WRAP_VFUNC(GooCanvasItem* get_parent(), get_parent)
+ _WRAP_VFUNC(void set_parent(GooCanvasItem* parent), set_parent)
_WRAP_VFUNC(void get_bounds(GooCanvasBounds* bounds), get_bounds)
#m4 _CONVERSION(`cairo_t*',`const Cairo::RefPtr<Cairo::Context>&',`Cairo::RefPtr<Cairo::Context>(new Cairo::Context($3, false /* has_reference */))')
_WRAP_VFUNC(GList* get_items_at(double x, double y, const Cairo::RefPtr<Cairo::Context>& cr, bool is_pointer_event, bool parent_is_visible, GList* found_items), get_items_at)
- _WRAP_VFUNC(void update(bool entire_tree, const Cairo::RefPtr<Cairo::Context>& cr, GooCanvasBounds* bounds), update)
+ _WRAP_VFUNC(void update(bool entire_tree, const Cairo::RefPtr<Cairo::Context>& cr, Bounds& bounds), update)
#m4 _CONVERSION(`const GooCanvasBounds*', `const Bounds&', `Glib::wrap($3)');
_WRAP_VFUNC(void paint(const Cairo::RefPtr<Cairo::Context>& cr, const Bounds& bounds, double scale), paint)
Modified: goocanvasmm/trunk/goocanvas/src/itemsimple.hg
==============================================================================
--- goocanvasmm/trunk/goocanvas/src/itemsimple.hg (original)
+++ goocanvasmm/trunk/goocanvas/src/itemsimple.hg Sun Feb 17 03:30:41 2008
@@ -93,12 +93,14 @@
protected:
#m4 _CONVERSION(`cairo_t*',`const Cairo::RefPtr<Cairo::Context>&',`Cairo::RefPtr<Cairo::Context>(new Cairo::Context($3, false /* has reference */))')
#m4 _CONVERSION(`const GooCanvasBounds*',`const Bounds&',`Glib::wrap($3)')
- // TODO: wrapping these vfuncs causes classes that inherit from ItemSimple to
- // stop working (e.g. Ellipse, Rect). Ref-counting issue??
- //_WRAP_VFUNC(void simple_create_path(const Cairo::RefPtr<Cairo::Context>& cr), "simple_create_path")
- //_WRAP_VFUNC(void simple_update(const Cairo::RefPtr<Cairo::Context>& cr), "simple_update")
- //_WRAP_VFUNC(void simple_paint(const Cairo::RefPtr<Cairo::Context>& cr, const Bounds& bounds), "simple_paint")
- //_WRAP_VFUNC(bool simple_is_item_at(double x, double y, const Cairo::RefPtr<Cairo::Context>& cr, bool is_pointer_event), "simple_is_item_at")
+ _WRAP_VFUNC(void simple_create_path(const Cairo::RefPtr<Cairo::Context>& cr), "simple_create_path")
+ _WRAP_VFUNC(void simple_update(const Cairo::RefPtr<Cairo::Context>& cr), "simple_update")
+ _WRAP_VFUNC(void simple_paint(const Cairo::RefPtr<Cairo::Context>& cr, const Bounds& bounds), simple_paint)
+ _WRAP_VFUNC(bool simple_is_item_at(double x, double y, const Cairo::RefPtr<Cairo::Context>& cr, bool is_pointer_event), "simple_is_item_at")
+ _MEMBER_GET(need_update, need_update, bool, guint);
+ _MEMBER_SET(need_update, need_update, bool, guint);
+ _MEMBER_GET(need_entire_subtree_update, need_entire_subtree_update, bool, guint);
+ _MEMBER_SET(need_entire_subtree_update, need_entire_subtree_update, bool, guint);
};
} //namespace Goocanvas
Modified: goocanvasmm/trunk/goocanvas/src/libgoocanvas_vfuncs.defs
==============================================================================
--- goocanvasmm/trunk/goocanvas/src/libgoocanvas_vfuncs.defs (original)
+++ goocanvasmm/trunk/goocanvas/src/libgoocanvas_vfuncs.defs Sun Feb 17 03:30:41 2008
@@ -101,15 +101,16 @@
)
)
-(define-vfunc get_item_at
+(define-vfunc get_items_at
(of-object "GooCanvasItem")
- (return-type "GooCanvasItem*")
+ (return-type "GList*")
(parameters
'("gdouble" "x")
'("gdouble" "y")
'("cairo_t*" "cr")
'("gboolean" "is_pointer_event")
'("gboolean" "parent_is_visible")
+ '("GList*" "found_items")
)
)
Modified: goocanvasmm/trunk/tools/m4/convert_libgoocanvasmm.m4
==============================================================================
--- goocanvasmm/trunk/tools/m4/convert_libgoocanvasmm.m4 (original)
+++ goocanvasmm/trunk/tools/m4/convert_libgoocanvasmm.m4 Sun Feb 17 03:30:41 2008
@@ -8,6 +8,7 @@
_CONVERSION(`const Bounds&',`GooCanvasBounds*',__FCR2P))
_CONVERSION(`Goocanvas::Bounds&',`GooCanvasBounds*',($3).gobj())
_CONVERSION(`GooCanvasBounds*',`Goocanvas::Bounds*',`&Glib::wrap($3)')
+_CONVERSION(`GooCanvasBounds*',`Bounds&',`Glib::wrap($3)')
_CONVERSION(`const Bounds*',`const GooCanvasBounds*',($3).gobj())
_CONVERSION(`const Bounds&',`const GooCanvasBounds*',($3).gobj())
@@ -28,6 +29,7 @@
_CONVERSION(`GooCanvasStyle*',`Glib::RefPtr<const Style>',`Glib::wrap($3)')
_CONVERSION(`const Glib::RefPtr<Item>&',`GooCanvasItem*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`Glib::RefPtr<Item>',`GooCanvasItem*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`const Glib::RefPtr<ItemModel>&',`GooCanvasItemModel*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`const Glib::RefPtr<ItemSimple>&',`GooCanvasItemSimple*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`const Glib::RefPtr<Style>&',`GooCanvasStyle*',__CONVERT_REFPTR_TO_P)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]