summaryrefslogtreecommitdiffstats
path: root/ganv
diff options
context:
space:
mode:
Diffstat (limited to 'ganv')
-rw-r--r--ganv/Edge.hpp8
-rw-r--r--ganv/canvas.h9
-rw-r--r--ganv/edge.h14
3 files changed, 27 insertions, 4 deletions
diff --git a/ganv/Edge.hpp b/ganv/Edge.hpp
index ee2423c..6912eb2 100644
--- a/ganv/Edge.hpp
+++ b/ganv/Edge.hpp
@@ -46,7 +46,6 @@ public:
bool show_arrowhead = false,
bool curved = true)
: Item(GANV_ITEM(
- g_object_ref(
ganv_edge_new(
canvas.gobj(),
tail->gobj(),
@@ -54,11 +53,12 @@ public:
"color", color,
"curved", (gboolean)curved,
"arrowhead", (gboolean)show_arrowhead,
- NULL))))
- {}
+ NULL)))
+ {
+ }
Edge(GanvEdge* gobj)
- : Item(GANV_ITEM(g_object_ref(gobj)))
+ : Item(GANV_ITEM(gobj))
{}
virtual ~Edge() {
diff --git a/ganv/canvas.h b/ganv/canvas.h
index ddd420b..bbf6b97 100644
--- a/ganv/canvas.h
+++ b/ganv/canvas.h
@@ -77,6 +77,15 @@ void
ganv_canvas_add_node(GanvCanvas* canvas,
GanvNode* node);
+void
+ganv_canvas_disconnect_edge(GanvCanvas* canvas,
+ GanvEdge* edge);
+
+void
+ganv_canvas_remove_edge_between(GanvCanvas* canvas,
+ GanvNode* tail,
+ GanvNode* head);
+
/** Get the default font size in points. */
double
ganv_canvas_get_default_font_size(const GanvCanvas* canvas);
diff --git a/ganv/edge.h b/ganv/edge.h
index 9a409b2..2d51c89 100644
--- a/ganv/edge.h
+++ b/ganv/edge.h
@@ -71,6 +71,20 @@ ganv_edge_highlight(GanvEdge* edge);
void
ganv_edge_unhighlight(GanvEdge* edge);
+/**
+ * ganv_edge_disconnect:
+ * Disconnect the edge. This will disconnect the edge just as if it had been
+ * disconnected by the user via the canvas. The canvas disconnect signal will
+ * be emitted, allowing the application to control disconnect logic.
+ */
+void
+ganv_edge_disconnect(GanvEdge* edge);
+
+/**
+ * ganv_edge_remove:
+ * Remove the edge from the canvas. This will only remove the edge visually,
+ * it will not emit the canvas disconnect signal to notify the application.
+ */
void
ganv_edge_remove(GanvEdge* edge);