summaryrefslogtreecommitdiff
path: root/src/gtkext/gtkbinarystrip.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-09-16 20:08:57 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-09-16 20:08:57 (GMT)
commitaf083f8bd6da340214ae392451dde5782fb79039 (patch)
treeffc45880157f4fdd986b1e16aa6498bef149185a /src/gtkext/gtkbinarystrip.c
parent74642fbdeefaec21885e5fb6cad432e3e3b47cdb (diff)
Used the new vmpa_t type in binary portions.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@405 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gtkext/gtkbinarystrip.c')
-rw-r--r--src/gtkext/gtkbinarystrip.c38
1 files changed, 30 insertions, 8 deletions
diff --git a/src/gtkext/gtkbinarystrip.c b/src/gtkext/gtkbinarystrip.c
index 4ed5cf9..e0016d2 100644
--- a/src/gtkext/gtkbinarystrip.c
+++ b/src/gtkext/gtkbinarystrip.c
@@ -36,7 +36,7 @@ struct _GtkBinaryStrip
GLoadedBinary *binary; /* Binaire à représenter */
gint display_pos; /* Position à l'écran */
- gint cursor_addr; /* Adresse de la position */
+ vmpa2t cursor_addr; /* Adresse de la position */
gint cursor_pos; /* Position à l'écran */
};
@@ -46,7 +46,7 @@ struct _GtkBinaryStripClass
{
GtkDrawingAreaClass parent; /* A laisser en premier */
- void (* select_address) (GtkBinaryStrip *, vmpa_t);
+ void (* select_address) (GtkBinaryStrip *);
};
@@ -111,8 +111,8 @@ static void gtk_binary_strip_class_init(GtkBinaryStripClass *class)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET(GtkBinaryStripClass, select_address),
NULL, NULL,
- g_cclosure_user_marshal_VOID__UINT64,
- G_TYPE_NONE, 1, G_TYPE_UINT64);
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
}
@@ -229,7 +229,7 @@ static void gtk_binary_strip_size_allocate(GtkWidget *widget, GtkAllocation *all
area.width = allocation->width;
area.height = allocation->height;
- if (!g_binary_portion_get_pos_from_addr(portions, strip->cursor_addr, &area, &strip->cursor_pos))
+ if (!g_binary_portion_get_pos_from_addr(portions, &strip->cursor_addr, &area, &strip->cursor_pos))
strip->cursor_pos = 0;
}
@@ -256,7 +256,7 @@ static gboolean gtk_binary_strip_button_release(GtkWidget *widget, GdkEventButto
GExeFormat *format; /* Format du binaire */
GBinPortion *portions; /* Portions binaires à dessiner*/
GdkRectangle area; /* Surface du composant */
- vmpa_t addr; /* Adresse à sélectionner */
+ vmpa2t addr; /* Adresse à sélectionner */
if (event->x < 0 || event->y < 0)
return FALSE;
@@ -278,12 +278,15 @@ static gboolean gtk_binary_strip_button_release(GtkWidget *widget, GdkEventButto
if (g_binary_portion_get_addr_from_pos(portions, event->x, &area, &addr))
{
- strip->cursor_addr = addr;
+ copy_vmpa(&strip->cursor_addr, &addr);
strip->cursor_pos = event->x;
gtk_widget_queue_draw(GTK_WIDGET(strip));
- g_signal_emit_by_name(strip, "select-address", addr);
+ printf("got :: %p\n", &addr);
+ printf(" -> 0x%x 0x%x\n", (unsigned int)get_phy_addr(&addr), (unsigned int)get_virt_addr(&addr));
+
+ g_signal_emit_by_name(strip, "select-address");
}
@@ -441,6 +444,25 @@ void gtk_binary_strip_attach(GtkBinaryStrip *strip, GLoadedBinary *binary)
/******************************************************************************
* *
+* Paramètres : strip = composant GTK à consulter. *
+* *
+* Description : Indique l'adresse physique et virtuelle représentée. *
+* *
+* Retour : Localisation, initialisée ou non. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+const vmpa2t *gtk_binary_strip_get_location(const GtkBinaryStrip *strip)
+{
+ return &strip->cursor_addr;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : strip = composant GTK à mettre à jour. *
* binary = nouveau contenu binaire à représenter. *
* *