summaryrefslogtreecommitdiff
path: root/src/gtkext/gtkgraphview.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtkext/gtkgraphview.c')
-rw-r--r--src/gtkext/gtkgraphview.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/gtkext/gtkgraphview.c b/src/gtkext/gtkgraphview.c
index aeb66ae..cb5c587 100644
--- a/src/gtkext/gtkgraphview.c
+++ b/src/gtkext/gtkgraphview.c
@@ -47,6 +47,8 @@ struct _GtkGraphView
GtkAllocation *allocs; /* Emplacements prévisibles */
size_t children_count; /* Taille de cette liste */
+ GGraphLayout *layout; /* Disposition en graphique */
+
GtkLinkRenderer **links; /* Liste des liens graphiques */
size_t links_count; /* Nombre de ces liens */
@@ -214,8 +216,10 @@ static void gtk_graph_view_size_request(GtkWidget *widget, GtkRequisition *requi
* On s'assure de ne couper aucun lien.
*/
+ /*
for (i = 0; i < view->links_count; i++)
gtk_link_renderer_size_request(view->links[i], requisition);
+ */
/**
* Traitement purement cosmétique : on ajoute la même bordure aux bords
@@ -333,12 +337,8 @@ static void gtk_graph_view_size_allocate(GtkWidget *widget, GtkAllocation *alloc
static gboolean gtk_graph_view_expose(GtkWidget *widget, GdkEventExpose *event, GtkGraphView *view)
{
- size_t i; /* Boucle de parcours */
-
- for (i = 0; i < view->links_count; i++)
- gtk_link_renderer_draw(view->links[i],
- GDK_DRAWABLE(widget->window),
- GTK_VIEW_PANEL(view)->gc);
+ if (view->layout != NULL)
+ g_graph_layout_draw(view->layout, GDK_DRAWABLE(widget->window), GTK_VIEW_PANEL(view)->gc);
return FALSE;
@@ -393,8 +393,22 @@ static void gtk_graph_view_define_main_address(GtkGraphView *view, vmpa_t addr)
view->allocs = (GtkAllocation *)calloc(view->children_count,
sizeof(GtkAllocation));
+
+ printf("Passage !!!\n");
+
+ /*
build_graph_view(view, g_binary_routine_get_basic_blocks(view->routine),
view->children, view->children_count);
+ */
+
+ view->layout = g_graph_layout_new(g_binary_routine_get_basic_blocks(view->routine),
+ view->children, view->children_count);
+
+ printf("----\n");
+
+ g_graph_layout_place(view->layout, view);
+
+ printf("--- done !!!\n");
break;
@@ -519,8 +533,8 @@ static void gtk_graph_view_cache_glance(GtkGraphView *view, cairo_t *cairo, cons
cairo_scale(cairo, scale, scale);
- for (i = 0; i < view->links_count; i++)
- _gtk_link_renderer_draw(view->links[i], cairo, false);
+ if (view->layout != NULL)
+ _g_graph_layout_draw(view->layout, cairo, false);
}
@@ -629,6 +643,7 @@ static void gtk_graph_view_reset(GtkGraphView *view)
view->start = VMPA_MAX;
view->end = VMPA_MAX;
+ /*
for (i = 0; i < view->links_count; i++)
gtk_object_destroy(GTK_OBJECT(view->links[i]));
@@ -640,6 +655,7 @@ static void gtk_graph_view_reset(GtkGraphView *view)
view->links_count = 0;
}
+ */
for (i = 0; i < view->children_count; i++)
gtk_widget_destroy(GTK_WIDGET(view->children[i]));