summaryrefslogtreecommitdiffstats
path: root/ganv
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-12-19 03:42:30 +0000
committerDavid Robillard <d@drobilla.net>2013-12-19 03:42:30 +0000
commitceccd56f0f8c52512ca5e65247f1023eef9cc2aa (patch)
tree629f5fcadac839896e9caabcf075950fee8e8fc9 /ganv
parent39df78049d6cbb0b368215d5d37a3fa03042eb45 (diff)
downloadganv-ceccd56f0f8c52512ca5e65247f1023eef9cc2aa.tar.gz
ganv-ceccd56f0f8c52512ca5e65247f1023eef9cc2aa.tar.bz2
ganv-ceccd56f0f8c52512ca5e65247f1023eef9cc2aa.zip
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
Diffstat (limited to 'ganv')
-rw-r--r--ganv/Node.hpp1
-rw-r--r--ganv/canvas.h6
-rw-r--r--ganv/node.h8
3 files changed, 15 insertions, 0 deletions
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
@@ -97,6 +97,14 @@ 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:
*
* Return value: True iff node is entirely within the given rectangle.