summaryrefslogtreecommitdiffstats
path: root/ganv/canvas.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-11-14 04:51:59 +0000
committerDavid Robillard <d@drobilla.net>2012-11-14 04:51:59 +0000
commita1712c2f1ea3e7bc1de99e40bc7f33ab6c92332d (patch)
tree762946d242f7e0827e95ac52fa7c4a5fd1c74058 /ganv/canvas.h
parentdbb57216238de87aaf0486862d0395374af14120 (diff)
downloadganv-a1712c2f1ea3e7bc1de99e40bc7f33ab6c92332d.tar.gz
ganv-a1712c2f1ea3e7bc1de99e40bc7f33ab6c92332d.tar.bz2
ganv-a1712c2f1ea3e7bc1de99e40bc7f33ab6c92332d.zip
Fix wonky edge selection behaviour when selecting ports.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@4814 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'ganv/canvas.h')
-rw-r--r--ganv/canvas.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/ganv/canvas.h b/ganv/canvas.h
index bcc2e3d..bac6597 100644
--- a/ganv/canvas.h
+++ b/ganv/canvas.h
@@ -121,9 +121,23 @@ ganv_canvas_arrange(GanvCanvas* canvas);
void
ganv_canvas_export_dot(GanvCanvas* canvas, const char* filename);
-typedef void (*GanvNodeFunc)(GanvNode* node, void* data);
+/**
+ * A node function that takes a user data argument (for callbacks).
+ *
+ * Note that in the Gtk world it is considered safe to cast a function to a
+ * function with more arguments and call the resulting pointer, so functions
+ * like ganv_edge_select can safely be used where a GanvEdgeFunc is expected.
+ */
+typedef void (*GanvEdgeFunc)(GanvEdge* edge, void* data);
-typedef void (*GanvEdgeFunc)(GanvEdge* edge);
+/**
+ * A node function that takes a user data argument (for callbacks).
+ *
+ * Note that in the Gtk world it is considered safe to cast a function to a
+ * function with more arguments and call the resulting pointer, so functions
+ * like ganv_node_select can safely be used where a GanvNodeFunc is expected.
+ */
+typedef void (*GanvNodeFunc)(GanvNode* node, void* data);
/**
* ganv_canvas_for_each_node:
@@ -167,7 +181,8 @@ ganv_canvas_for_each_edge(GanvCanvas* canvas,
void
ganv_canvas_for_each_edge_from(GanvCanvas* canvas,
const GanvNode* tail,
- GanvEdgeFunc f);
+ GanvEdgeFunc f,
+ void* data);
/**
* ganv_canvas_for_each_edge_to:
@@ -178,7 +193,8 @@ ganv_canvas_for_each_edge_from(GanvCanvas* canvas,
void
ganv_canvas_for_each_edge_to(GanvCanvas* canvas,
const GanvNode* head,
- GanvEdgeFunc f);
+ GanvEdgeFunc f,
+ void* data);
/**
* ganv_canvas_for_each_edge_on:
@@ -189,7 +205,8 @@ ganv_canvas_for_each_edge_to(GanvCanvas* canvas,
void
ganv_canvas_for_each_edge_on(GanvCanvas* canvas,
const GanvNode* node,
- GanvEdgeFunc f);
+ GanvEdgeFunc f,
+ void* data);
/**
* ganv_canvas_destroy: