summaryrefslogtreecommitdiffstats
path: root/ganv/canvas-base.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-12-13 21:22:11 +0000
committerDavid Robillard <d@drobilla.net>2011-12-13 21:22:11 +0000
commit646675f0d21abec2848ae8e25f906aa693139fbd (patch)
treef53846e77aa6ae10d44f5123990a1c9a0b81207b /ganv/canvas-base.h
parent650f610fc90c07aa5a09cd0117a01afd7b1a85c0 (diff)
downloadganv-646675f0d21abec2848ae8e25f906aa693139fbd.tar.gz
ganv-646675f0d21abec2848ae8e25f906aa693139fbd.tar.bz2
ganv-646675f0d21abec2848ae8e25f906aa693139fbd.zip
Remove libart dependency.
Replace unneeded arbitrary per-item affine with simple x, y coordinates. git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@3867 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'ganv/canvas-base.h')
-rw-r--r--ganv/canvas-base.h43
1 files changed, 15 insertions, 28 deletions
diff --git a/ganv/canvas-base.h b/ganv/canvas-base.h
index 94f9580..bca4951 100644
--- a/ganv/canvas-base.h
+++ b/ganv/canvas-base.h
@@ -56,15 +56,13 @@ typedef struct _GanvGroupClass GanvGroupClass;
/* Object flags for items */
enum {
- GANV_ITEM_REALIZED = 1 << 4,
- GANV_ITEM_MAPPED = 1 << 5,
- GANV_ITEM_ALWAYS_REDRAW = 1 << 6,
- GANV_ITEM_VISIBLE = 1 << 7,
- GANV_ITEM_NEED_UPDATE = 1 << 8,
- GANV_ITEM_NEED_AFFINE = 1 << 9,
- GANV_ITEM_NEED_CLIP = 1 << 10,
- GANV_ITEM_NEED_VIS = 1 << 11,
- GANV_ITEM_AFFINE_FULL = 1 << 12
+ GANV_ITEM_REALIZED = 1 << 1,
+ GANV_ITEM_MAPPED = 1 << 2,
+ GANV_ITEM_ALWAYS_REDRAW = 1 << 3,
+ GANV_ITEM_VISIBLE = 1 << 4,
+ GANV_ITEM_NEED_UPDATE = 1 << 5,
+ GANV_ITEM_NEED_CLIP = 1 << 6,
+ GANV_ITEM_NEED_VIS = 1 << 7,
};
/* Update flags for items */
@@ -92,12 +90,8 @@ struct _GanvItem {
/* Parent canvas group for this item (a GanvGroup) */
GanvItem* parent;
- /* If NULL, assumed to be the identity tranform. If flags does not have
- * AFFINE_FULL, then a two-element array containing a translation. If
- * flags contains AFFINE_FULL, a six-element array containing an affine
- * transformation.
- */
- double* xform;
+ /* Position in parent-relative coordinates. */
+ double x, y;
/* Bounding box for this item (in canvas coordinates) */
double x1, y1, x2, y2;
@@ -108,11 +102,10 @@ struct _GanvItemClass {
/* Tell the item to update itself. The flags are from the update flags
* defined above. The item should update its internal state from its
- * queued state, and recompute and request its repaint area. The
- * affine, if used, is a pointer to a 6-element array of doubles. The
- * update method also recomputes the bounding box of the item.
+ * queued state, and recompute and request its repaint area. The update
+ * method also recomputes the bounding box of the item.
*/
- void (* update)(GanvItem* item, double* affine, int flags);
+ void (* update)(GanvItem* item, int flags);
/* Realize an item -- create GCs, etc. */
void (* realize)(GanvItem* item);
@@ -182,12 +175,6 @@ void ganv_item_set_valist(GanvItem* item,
/* Move an item by the specified amount */
void ganv_item_move(GanvItem* item, double dx, double dy);
-/* Apply a relative affine transformation to the item. */
-void ganv_item_affine_relative(GanvItem* item, const double affine[6]);
-
-/* Apply an absolute affine transformation to the item. */
-void ganv_item_affine_absolute(GanvItem* item, const double affine[6]);
-
/* Raise an item in the z-order of its parent group by the specified number of
* positions.
*/
@@ -236,12 +223,12 @@ void ganv_item_i2w(GanvItem* item, double* x, double* y);
/* Gets the affine transform that converts from item-relative coordinates to
* world coordinates.
*/
-void ganv_item_i2w_affine(GanvItem* item, double affine[6]);
+void ganv_item_i2w_affine(GanvItem* item, cairo_matrix_t* matrix);
/* Gets the affine transform that converts from item-relative coordinates to
* canvas pixel coordinates.
*/
-void ganv_item_i2c_affine(GanvItem* item, double affine[6]);
+void ganv_item_i2c_affine(GanvItem* item, cairo_matrix_t* matrix);
/* Remove the item from its parent group and make the new group its parent. The
* item will be put on top of all the items in the new group. The item's
@@ -486,7 +473,7 @@ void ganv_canvas_base_request_redraw(GanvCanvasBase* canvas, int x1, int y1, int
/* Gets the affine transform that converts world coordinates into canvas pixel
* coordinates.
*/
-void ganv_canvas_base_w2c_affine(GanvCanvasBase* canvas, double affine[6]);
+void ganv_canvas_base_w2c_affine(GanvCanvasBase* canvas, cairo_matrix_t* matrix);
/* These functions convert from a coordinate system to another. "w" is world
* coordinates, "c" is canvas pixel coordinates (pixel coordinates that are