summaryrefslogtreecommitdiff
path: root/src/gtkext/gtkbinarystrip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtkext/gtkbinarystrip.c')
-rw-r--r--src/gtkext/gtkbinarystrip.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/gtkext/gtkbinarystrip.c b/src/gtkext/gtkbinarystrip.c
index fff6a78..d1638ed 100644
--- a/src/gtkext/gtkbinarystrip.c
+++ b/src/gtkext/gtkbinarystrip.c
@@ -211,7 +211,7 @@ static void gtk_binary_strip_size_allocate(GtkWidget *widget, GtkAllocation *all
{
GtkBinaryStrip *strip; /* Autre version du composant */
GExeFormat *format; /* Format du binaire */
- GPortionLayer *layer; /* Couche première de portions */
+ GBinPortion *portions; /* Couche première de portions */
GdkRectangle area; /* Surface du composant */
GTK_WIDGET_CLASS(gtk_binary_strip_parent_class)->size_allocate(widget, allocation);
@@ -222,17 +222,17 @@ static void gtk_binary_strip_size_allocate(GtkWidget *widget, GtkAllocation *all
return;
format = g_loaded_binary_get_format(strip->binary);
- layer = g_exe_format_get_main_layer(format);
+ portions = g_exe_format_get_portions(format);
area.x = 0;
area.y = 0;
area.width = allocation->width;
area.height = allocation->height;
- if (!g_portion_layer_get_pos_from_addr(layer, &strip->cursor_addr, &area, &strip->cursor_pos))
+ if (!get_binary_portion_pos_from_addr(portions, &strip->cursor_addr, &area, &strip->cursor_pos))
strip->cursor_pos = 0;
- g_object_unref(G_OBJECT(layer));
+ g_object_unref(G_OBJECT(portions));
g_object_unref(G_OBJECT(format));
}
@@ -257,7 +257,7 @@ static gboolean gtk_binary_strip_button_release(GtkWidget *widget, GdkEventButto
gint height; /* Hauteur du composant */
GtkBinaryStrip *strip; /* Autre version du composant */
GExeFormat *format; /* Format du binaire */
- GPortionLayer *layer; /* Couche première de portions */
+ GBinPortion *portions; /* Couche première de portions */
GdkRectangle area; /* Surface du composant */
vmpa2t addr; /* Adresse à sélectionner */
@@ -272,14 +272,14 @@ static gboolean gtk_binary_strip_button_release(GtkWidget *widget, GdkEventButto
strip = GTK_BINARY_STRIP(widget);
format = g_loaded_binary_get_format(strip->binary);
- layer = g_exe_format_get_main_layer(format);
+ portions = g_exe_format_get_portions(format);
area.x = 0;
area.y = 0;
area.width = width;
area.height = height;
- if (g_portion_layer_get_addr_from_pos(layer, event->x, &area, &addr))
+ if (get_binary_portion_addr_from_pos(portions, event->x, &area, &addr))
{
copy_vmpa(&strip->cursor_addr, &addr);
strip->cursor_pos = event->x;
@@ -290,7 +290,7 @@ static gboolean gtk_binary_strip_button_release(GtkWidget *widget, GdkEventButto
}
- g_object_unref(G_OBJECT(layer));
+ g_object_unref(G_OBJECT(portions));
g_object_unref(G_OBJECT(format));
return FALSE;
@@ -314,10 +314,10 @@ static gboolean gtk_binary_strip_button_release(GtkWidget *widget, GdkEventButto
static gboolean gtk_binary_strip_draw(GtkWidget *widget, cairo_t *cr)
{
GtkBinaryStrip *strip; /* Autre vision du composant */
+ GtkStyleContext *context; /* Contexte du thème actuel */
GExeFormat *format; /* Format du binaire */
- GPortionLayer *layer; /* Couche première de portions */
+ GBinPortion *portions; /* Portions de binaire */
GdkRectangle full; /* Taille totale de la surface */
- GtkStyleContext *context; /* Contexte du thème actuel */
GdkRGBA *color; /* Couleur du curseur */
strip = GTK_BINARY_STRIP(widget);
@@ -325,21 +325,21 @@ static gboolean gtk_binary_strip_draw(GtkWidget *widget, cairo_t *cr)
if (strip->binary == NULL)
return FALSE;
+ context = gtk_widget_get_style_context(widget);
+
/* Dessin des portions de binaire */
format = g_loaded_binary_get_format(strip->binary);
- layer = g_exe_format_get_main_layer(format);
+ portions = g_exe_format_get_portions(format);
full.x = 0;
full.y = 1;
full.width = gtk_widget_get_allocated_width(widget);
full.height = gtk_widget_get_allocated_height(widget) - 1;
- context = gtk_widget_get_style_context(widget);
-
- g_portion_layer_draw(layer, context, cr, &full);
+ g_binary_portion_draw(portions, context, cr, &full);
- g_object_unref(G_OBJECT(layer));
+ g_object_unref(G_OBJECT(portions));
g_object_unref(G_OBJECT(format));
/* Dessin de la position */
@@ -348,8 +348,8 @@ static gboolean gtk_binary_strip_draw(GtkWidget *widget, cairo_t *cr)
{
cairo_set_line_width(cr, 1);
- gtk_style_context_get(gtk_widget_get_style_context(widget), GTK_STATE_FLAG_NORMAL,
- GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &color, NULL);
+ gtk_style_context_get(context, GTK_STATE_FLAG_NORMAL,
+ GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &color, NULL);
cairo_set_source_rgb(cr, color->red, color->green, color->blue);
@@ -395,7 +395,7 @@ static gboolean gtk_binary_strip_query_tooltip(GtkWidget *widget, gint x, gint y
gboolean result; /* Bilan à retourner */
GtkBinaryStrip *strip; /* Autre version du composant */
GExeFormat *format; /* Format du binaire */
- GPortionLayer *layer; /* Couches binaires à consulter*/
+ GBinPortion *portions; /* Couches binaires à consulter*/
GdkRectangle area; /* Surface du composant */
if (keyboard) return FALSE;
@@ -405,16 +405,16 @@ static gboolean gtk_binary_strip_query_tooltip(GtkWidget *widget, gint x, gint y
if (strip->binary != NULL)
{
format = g_loaded_binary_get_format(strip->binary);
- layer = g_exe_format_get_main_layer(format);
+ portions = g_exe_format_get_portions(format);
area.x = 0;
area.y = 0;
area.width = gtk_widget_get_allocated_width(widget);
area.height = gtk_widget_get_allocated_height(widget);
- result = g_portion_layer_query_tooltip(layer, x, y, &area, tooltip);
+ result = query_tooltip_for_binary_portion(portions, x, y, &area, tooltip);
- g_object_unref(G_OBJECT(layer));
+ g_object_unref(G_OBJECT(portions));
g_object_unref(G_OBJECT(format));
}