summaryrefslogtreecommitdiff
path: root/src/gtkext/gtkbinview.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2009-06-14 11:57:14 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2009-06-14 11:57:14 (GMT)
commitae0135d727fdc67a268ede1530042a42a2a1ccd3 (patch)
treed3dc13797072c261ea8bb49dc2e83b0858478bc7 /src/gtkext/gtkbinview.c
parentfa0509e2914e3cb562a7cc58293f1171886fafb0 (diff)
Cleaned and improved the binary views ; implemented some first steps for the graphical view.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@76 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gtkext/gtkbinview.c')
-rw-r--r--src/gtkext/gtkbinview.c88
1 files changed, 64 insertions, 24 deletions
diff --git a/src/gtkext/gtkbinview.c b/src/gtkext/gtkbinview.c
index 9ffb5f6..3799b25 100644
--- a/src/gtkext/gtkbinview.c
+++ b/src/gtkext/gtkbinview.c
@@ -106,6 +106,43 @@ GtkWidget* gtk_binview_new(void)
+
+
+/******************************************************************************
+* *
+* Paramètres : view = composant GTK à mettre à jour. *
+* lines = informations à intégrer. *
+* last = dernière ligne à intégrer ou NULL pour toutes. *
+* *
+* Description : Définit les lignes à associer à la représentation. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void gtk_bin_view_set_rendering_lines(GtkBinview *view, GRenderingLine *lines, GRenderingLine *last)
+{
+ view->lines = lines;
+ view->last = last;
+
+ view->set_lines(view, lines, last);
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
/******************************************************************************
* *
* Paramètres : binview = composant GTK à manipuler. *
@@ -134,6 +171,14 @@ void gtk_binview_show_vaddress(GtkBinview *binview, gboolean show)
}
+
+
+
+
+
+
+
+
/******************************************************************************
* *
* Paramètres : binview = composant GTK à manipuler. *
@@ -169,8 +214,8 @@ void gtk_binview_show_code(GtkBinview *binview, gboolean show)
/******************************************************************************
* *
-* Paramètres : binview = composant GTK à manipuler. *
-* address = adresse à présenter à l'écran. *
+* Paramètres : view = composant GTK à manipuler. *
+* addr = adresse à présenter à l'écran. *
* *
* Description : S'assure qu'une adresse donnée est visible à l'écran. *
* *
@@ -180,36 +225,31 @@ void gtk_binview_show_code(GtkBinview *binview, gboolean show)
* *
******************************************************************************/
-void gtk_binview_scroll_to_address(GtkBinview *binview, uint64_t address)
+void gtk_bin_view_scroll_to_address(GtkBinview *view, vmpa_t addr)
{
-#if 0
- GList *list; /* Ensemble des enfants */
- GList *iter; /* Boucle de parcours */
- GtkSnippet *snippet; /* Morceau de code présent */
- gint position; /* Position à garantir */
- GtkAdjustment *vadj; /* Défilement à mettre à jour */
+ gint x; /* Abscisse à garantir */
+ gint y; /* Ordonnée à garantir */
+ GtkViewport *support; /* Support avec défilements */
+ GtkAdjustment *adj; /* Défilement à mettre à jour */
- list = gtk_container_get_children(GTK_CONTAINER(binview));
-
- for (iter = g_list_first(list); iter != NULL; iter = g_list_next(iter))
+ if (view->get_coordinates(view, addr, &x, &y))
{
- snippet = GTK_SNIPPET(iter->data);
+ support = GTK_VIEWPORT(gtk_widget_get_parent(GTK_WIDGET(view)));
- if (gtk_snippet_get_address_vposition(snippet, address, &position))
- {
- vadj = GTK_VIEWPORT(binview)->vadjustment;
+ adj = gtk_viewport_get_hadjustment(support);
- gtk_adjustment_set_value(vadj, position);
+ if (x > (adj->upper - adj->page_size))
+ x = adj->upper - adj->page_size;
- break;
+ gtk_adjustment_set_value(adj, x);
- }
+ adj = gtk_viewport_get_vadjustment(support);
- }
-
- g_list_free(list);
-#endif
-}
+ if (y > (adj->upper - adj->page_size))
+ y = adj->upper - adj->page_size;
+ gtk_adjustment_set_value(adj, y);
+ }
+}