From ceccd56f0f8c52512ca5e65247f1023eef9cc2aa Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 19 Dec 2013 03:42:30 +0000 Subject: FDGL: Improve flow-directed layout. Allow apps to specify nodes as sources to improve layout. git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5186 a436a847-0d15-0410-975c-d299462d15a1 --- ganv/Node.hpp | 1 + ganv/canvas.h | 6 ++++++ ganv/node.h | 8 ++++++++ 3 files changed, 15 insertions(+) (limited to 'ganv') diff --git a/ganv/Node.hpp b/ganv/Node.hpp index 4b219e6..4de2d35 100644 --- a/ganv/Node.hpp +++ b/ganv/Node.hpp @@ -53,6 +53,7 @@ public: RW_PROPERTY(guint, border_color) RW_PROPERTY(gboolean, can_tail) RW_PROPERTY(gboolean, can_head) + RW_PROPERTY(gboolean, is_source) RW_PROPERTY(gboolean, selected) RW_PROPERTY(gboolean, highlighted) RW_PROPERTY(gboolean, draggable) diff --git a/ganv/canvas.h b/ganv/canvas.h index b569eeb..37fdc5d 100644 --- a/ganv/canvas.h +++ b/ganv/canvas.h @@ -53,6 +53,9 @@ struct _GanvCanvas { double width; double height; gboolean locked; +#ifdef GANV_FDGL + guint layout_idle_id; +#endif }; struct _GanvCanvasClass { @@ -70,6 +73,9 @@ GanvCanvas* ganv_canvas_new(double width, double height); void ganv_canvas_resize(GanvCanvas* canvas, double width, double height); +void +ganv_canvas_contents_changed(GanvCanvas* canvas); + /** * ganv_canvas_get_root: * diff --git a/ganv/node.h b/ganv/node.h index c17dc60..6823086 100644 --- a/ganv/node.h +++ b/ganv/node.h @@ -96,6 +96,14 @@ ganv_node_can_tail(const GanvNode* node); gboolean ganv_node_can_head(const GanvNode* node); +/** + * ganv_node_set_is_source: + * + * Flag a node as a source. This information is used to influence layout. + */ +void +ganv_node_set_is_source(const GanvNode* node, gboolean is_source); + /** * ganv_node_is_within: * -- cgit v1.2.1