From ef71a1da33a3c68cad782029cacbc1d01328b4d6 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 21 Feb 2015 23:32:24 +0000 Subject: Add API to specify module port order. Also fix various redundant resize/update issues, improve performance. git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5592 a436a847-0d15-0410-975c-d299462d15a1 --- ganv/canvas.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'ganv/canvas.h') diff --git a/ganv/canvas.h b/ganv/canvas.h index e923f65..e2a9867 100644 --- a/ganv/canvas.h +++ b/ganv/canvas.h @@ -91,6 +91,8 @@ typedef void (*GanvEdgeFunc)(GanvEdge* edge, void* data); */ typedef void (*GanvNodeFunc)(GanvNode* node, void* data); +typedef int (*GanvPortOrderFunc)(const GanvPort*, const GanvPort*, void* data); + /** * ganv_canvas_new: * @@ -99,6 +101,22 @@ typedef void (*GanvNodeFunc)(GanvNode* node, void* data); GanvCanvas* ganv_canvas_new(double width, double height); +/** + * ganv_canvas_set_wrapper: + * + * Set the opaque wrapper object for the canvas. + */ +void +ganv_canvas_set_wrapper(GanvCanvas* canvas, void* wrapper); + +/** + * ganv_canvas_get_wrapper: + * + * Return an opaque pointer to the wrapper for the canvas. + */ +void* +ganv_canvas_get_wrapper(GanvCanvas* canvas); + /** * ganv_canvas_clear: * @@ -592,6 +610,21 @@ ganv_canvas_get_move_cursor(const GanvCanvas* canvas); void ganv_canvas_move_contents_to(GanvCanvas* canvas, double x, double y); +/** + * ganv_canvas_set_port_order: + * @canvas The canvas to set the default port order on. + * @port_cmp Port comparison function. + * @data Data to be passed to order. + * + * Set a comparator function to use as the default order for ports on modules. + * If left unset, ports are shown in the order they are added. + */ +void +ganv_canvas_set_port_order(GanvCanvas* canvas, + GanvPortOrderFunc port_cmp, + void* data); + + G_END_DECLS #endif /* GANV_CANVAS_H */ -- cgit v1.2.1