diff options
Diffstat (limited to 'src/gtkext')
-rw-r--r-- | src/gtkext/gtkblockview.c | 28 | ||||
-rw-r--r-- | src/gtkext/gtkblockview.h | 6 | ||||
-rw-r--r-- | src/gtkext/gtkgraphview.c | 10 |
3 files changed, 31 insertions, 13 deletions
diff --git a/src/gtkext/gtkblockview.c b/src/gtkext/gtkblockview.c index cfd4ee0..f0ee0dd 100644 --- a/src/gtkext/gtkblockview.c +++ b/src/gtkext/gtkblockview.c @@ -41,6 +41,8 @@ struct _GtkBlockView { GtkBinView parent; /* A laisser en premier */ + LinesMainOwner owner; /* Support final des lignes */ + bool show_vaddress; /* Affichage des adresses ? */ bool show_code; /* Affichage du code brut ? */ @@ -114,17 +116,30 @@ static void gtk_block_view_destroy(GtkObject *object); +/* Détermine le type du composant d'affichage en block. */ G_DEFINE_TYPE(GtkBlockView, gtk_block_view, GTK_TYPE_BIN_VIEW) +/****************************************************************************** +* * +* Paramètres : owner = support effectif des lignes au final. * +* * +* Description : Crée un nouveau composant pour l'affichage en block. * +* * +* Retour : Composant GTK créé. * +* * +* Remarques : - * +* * +******************************************************************************/ - -GtkWidget * gtk_block_view_new(void) +GtkWidget * gtk_block_view_new(LinesMainOwner owner) { GtkBlockView *result; result = gtk_type_new(gtk_block_view_get_type()); + result->owner = owner; + return GTK_WIDGET(result); } @@ -387,7 +402,7 @@ gtk_block_view_paint(GtkBlockView *view) { g_rendering_line_draw(iter, GDK_DRAWABLE(widget->window), GTK_BIN_VIEW(view)->gc, MARGIN_SPACE, 2 * MARGIN_SPACE + view->line_height, - y, view->line_height); + y, view->line_height, view->owner); y += view->line_height; @@ -513,7 +528,8 @@ static void gtk_block_view_set_rendering_lines(GtkBlockView *view, GRenderingLin G_CALLBACK(gtk_block_view_update_margin), view); } - g_rendering_line_update_bin_len(GTK_BIN_VIEW(view)->lines, GTK_BIN_VIEW(view)->last); + g_rendering_line_update_bin_len(GTK_BIN_VIEW(view)->lines, + GTK_BIN_VIEW(view)->last, view->owner); gtk_block_view_recompute_size_request(view); @@ -540,7 +556,9 @@ void gtk_block_view_recompute_size_request(GtkBlockView *view) int width; /* Largeur de l'objet actuelle */ int height; /* Hauteur de l'objet actuelle */ - g_rendering_line_get_size(GTK_BIN_VIEW(view)->lines, GTK_BIN_VIEW(view)->last, + g_rendering_line_get_size(GTK_BIN_VIEW(view)->lines, + GTK_BIN_VIEW(view)->last, + view->owner, &width, &height, &view->line_height); gtk_widget_set_size_request(GTK_WIDGET(view), diff --git a/src/gtkext/gtkblockview.h b/src/gtkext/gtkblockview.h index d56ed95..43561b1 100644 --- a/src/gtkext/gtkblockview.h +++ b/src/gtkext/gtkblockview.h @@ -51,11 +51,11 @@ typedef struct _GtkBlockViewClass GtkBlockViewClass; -/* Détermine le type du composant d'affichage en blockique. */ +/* Détermine le type du composant d'affichage en block. */ GType gtk_block_view_get_type(void); -/* Crée un nouveau composant pour l'affichage en blockique. */ -GtkWidget *gtk_block_view_new(void); +/* Crée un nouveau composant pour l'affichage en block. */ +GtkWidget *gtk_block_view_new(LinesMainOwner); diff --git a/src/gtkext/gtkgraphview.c b/src/gtkext/gtkgraphview.c index d060f69..03693d5 100644 --- a/src/gtkext/gtkgraphview.c +++ b/src/gtkext/gtkgraphview.c @@ -241,7 +241,7 @@ static void gtk_graph_view_set_rendering_lines(GtkGraphView *view, GRenderingLin view->childs = (GtkBinView **)calloc(2, sizeof(GtkBinView *)); view->childs_count = 2; - view->childs[0] = GTK_BIN_VIEW(gtk_block_view_new()); + view->childs[0] = GTK_BIN_VIEW(gtk_block_view_new(LMO_GRAPH)); gtk_widget_show(GTK_WIDGET(view->childs[0])); gtk_fixed_put(GTK_FIXED(view), GTK_WIDGET(view->childs[0]), 50, 50); @@ -256,7 +256,7 @@ static void gtk_graph_view_set_rendering_lines(GtkGraphView *view, GRenderingLin printf("mainl : %p\n", mainl); - view->childs[1] = GTK_BIN_VIEW(gtk_block_view_new()); + view->childs[1] = GTK_BIN_VIEW(gtk_block_view_new(LMO_GRAPH)); gtk_widget_show(GTK_WIDGET(view->childs[1])); gtk_fixed_put(GTK_FIXED(view), GTK_WIDGET(view->childs[1]), 100, 450); @@ -405,7 +405,7 @@ static GtkBinView **gtk_graph_view_load_nodes(openida_binary *binary, GRendering { result = (GtkBinView **)realloc(result, ++(*count) * sizeof(GtkBinView *)); - result[*count - 1] = GTK_BIN_VIEW(gtk_block_view_new()); + result[*count - 1] = GTK_BIN_VIEW(gtk_block_view_new(LMO_GRAPH)); gtk_widget_show(GTK_WIDGET(result[*count - 1])); gtk_bin_view_show_border(result[*count - 1], true); @@ -422,7 +422,7 @@ static GtkBinView **gtk_graph_view_load_nodes(openida_binary *binary, GRendering { result = (GtkBinView **)realloc(result, ++(*count) * sizeof(GtkBinView *)); - result[*count - 1] = GTK_BIN_VIEW(gtk_block_view_new()); + result[*count - 1] = GTK_BIN_VIEW(gtk_block_view_new(LMO_GRAPH)); gtk_widget_show(GTK_WIDGET(result[*count - 1])); gtk_bin_view_show_border(result[*count - 1], true); @@ -438,7 +438,7 @@ static GtkBinView **gtk_graph_view_load_nodes(openida_binary *binary, GRendering { result = (GtkBinView **)realloc(result, ++(*count) * sizeof(GtkBinView *)); - result[*count - 1] = GTK_BIN_VIEW(gtk_block_view_new()); + result[*count - 1] = GTK_BIN_VIEW(gtk_block_view_new(LMO_GRAPH)); gtk_widget_show(GTK_WIDGET(result[*count - 1])); gtk_bin_view_show_border(result[*count - 1], true); |