summaryrefslogtreecommitdiff
path: root/src/gtkext/graph/cluster.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-02-15 22:58:40 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-02-15 22:58:40 (GMT)
commit16242be5838a77690946cbb2f30b2e89f2df0b94 (patch)
treed3c2b2725f41f2a0d45ae7f32e2ab9cb1886b230 /src/gtkext/graph/cluster.c
parent5ed40f0afbd58fbfdf05be7b2a10ab8d0819759f (diff)
Displayed tooltips for graph view edges.
Diffstat (limited to 'src/gtkext/graph/cluster.c')
-rw-r--r--src/gtkext/graph/cluster.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/gtkext/graph/cluster.c b/src/gtkext/graph/cluster.c
index c4deeaa..765bbac 100644
--- a/src/gtkext/graph/cluster.c
+++ b/src/gtkext/graph/cluster.c
@@ -460,6 +460,8 @@ static gint compute_leaving_link_position(const leaving_link_t *link)
static incoming_link_t *create_incoming_link(GGraphCluster *owner, InstructionLinkType type, leaving_link_t *other)
{
incoming_link_t *result; /* Structure à retourner */
+ GCodeBlock *src; /* Bloc d'origine du lien */
+ GCodeBlock *dst; /* Bloc de destination du lien */
result = malloc(sizeof(incoming_link_t));
@@ -467,14 +469,23 @@ static incoming_link_t *create_incoming_link(GGraphCluster *owner, InstructionLi
result->type = type;
+ src = other->owner->block;
+ dst = owner->block;
+
if (type == ILT_JUMP_IF_TRUE)
- result->edge = g_graph_edge_new_true(&other->start[0], &other->start[1], &result->end[0], &result->end[1]);
+ result->edge = g_graph_edge_new_true(src, dst,
+ &other->start[0], &other->start[1],
+ &result->end[0], &result->end[1]);
else if (type == ILT_JUMP_IF_FALSE)
- result->edge = g_graph_edge_new_false(&other->start[0], &other->start[1], &result->end[0], &result->end[1]);
+ result->edge = g_graph_edge_new_false(src, dst,
+ &other->start[0], &other->start[1],
+ &result->end[0], &result->end[1]);
else
- result->edge = g_graph_edge_new(&other->start[0], &other->start[1], &result->end[0], &result->end[1]);
+ result->edge = g_graph_edge_new(src, dst,
+ &other->start[0], &other->start[1],
+ &result->end[0], &result->end[1]);
result->other = other;
@@ -499,6 +510,8 @@ static incoming_link_t *create_incoming_link(GGraphCluster *owner, InstructionLi
static incoming_link_t *create_incoming_loop_link(GGraphCluster *owner, const GdkPoint *midpts, leaving_link_t *other)
{
incoming_link_t *result; /* Structure à retourner */
+ GCodeBlock *src; /* Bloc d'origine du lien */
+ GCodeBlock *dst; /* Bloc de destination du lien */
result = malloc(sizeof(incoming_link_t));
@@ -506,7 +519,11 @@ static incoming_link_t *create_incoming_loop_link(GGraphCluster *owner, const Gd
result->type = ILT_LOOP;
- result->edge = g_graph_edge_new_loop(&other->start[0], &other->start[1],
+ src = other->owner->block;
+ dst = owner->block;
+
+ result->edge = g_graph_edge_new_loop(src, dst,
+ &other->start[0], &other->start[1],
&midpts[0], &midpts[1],
&result->end[0], &result->end[1]);