summaryrefslogtreecommitdiff
path: root/src/gui/panels/strings.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-11-12 20:03:12 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-11-12 20:03:12 (GMT)
commit771f21b9d5dd2b394359304a660418bbc84befda (patch)
tree60d6a9350d388f2db7ad571e6edddf46a99444f2 /src/gui/panels/strings.c
parentde62d34d2dc6135b42af7f8a103c8c7af09fd54f (diff)
Defined a new interface for displaying loaded contents.
Diffstat (limited to 'src/gui/panels/strings.c')
-rw-r--r--src/gui/panels/strings.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/gui/panels/strings.c b/src/gui/panels/strings.c
index 6ae44b1..23383a1 100644
--- a/src/gui/panels/strings.c
+++ b/src/gui/panels/strings.c
@@ -589,7 +589,7 @@ static void on_strings_selection_change(GtkTreeSelection *selection, gpointer un
GtkTreeModel *model; /* Modèle de gestion */
GBinSymbol *symbol; /* Symbole en cours d'étude */
const vmpa2t *addr; /* Adressse associée au signet */
- GtkDisplayPanel *display; /* Afficheur effectif de code */
+ GLoadedPanel *panel; /* Afficheur effectif de code */
if (gtk_tree_selection_get_selected(selection, &model, &iter))
{
@@ -597,9 +597,12 @@ static void on_strings_selection_change(GtkTreeSelection *selection, gpointer un
addr = get_mrange_addr(g_binary_symbol_get_range(symbol));
- display = get_current_view();
- gtk_display_panel_request_move(display, addr);
- g_object_unref(G_OBJECT(display));
+ panel = get_current_view();
+
+ if (GTK_IS_DISPLAY_PANEL(panel))
+ gtk_display_panel_request_move(GTK_DISPLAY_PANEL(panel), addr);
+
+ g_object_unref(G_OBJECT(panel));
g_object_unref(G_OBJECT(symbol));
@@ -820,7 +823,7 @@ static gboolean on_button_event_over_strings(GtkWidget *widget, GdkEventButton *
GtkTreeModel *model; /* Modèle de gestion */
GBinSymbol *symbol; /* Symbole en cours d'étude */
const vmpa2t *addr; /* Adressse associée au signet */
- GtkDisplayPanel *display; /* Afficheur effectif de code */
+ GLoadedPanel *display; /* Afficheur effectif de code */
switch (event->button)
{
@@ -838,7 +841,10 @@ static gboolean on_button_event_over_strings(GtkWidget *widget, GdkEventButton *
addr = get_mrange_addr(g_binary_symbol_get_range(symbol));
display = get_current_view();
- gtk_display_panel_request_move(display, addr);
+
+ if (GTK_IS_DISPLAY_PANEL(display))
+ gtk_display_panel_request_move(GTK_DISPLAY_PANEL(display), addr);
+
g_object_unref(G_OBJECT(display));
g_object_unref(G_OBJECT(symbol));
@@ -1038,7 +1044,7 @@ static void mcb_strings_panel_find_refs(GtkMenuItem *menuitem, GStringsPanel *pa
GObject *ref; /* Espace de référencements */
GtkWidget *dialog; /* Boîte de dialogue à montrer */
vmpa2t *addr; /* Adresse de destination */
- GtkDisplayPanel *display; /* Afficheur effectif de code */
+ GLoadedPanel *display; /* Afficheur effectif de code */
symbol = get_selected_panel_symbol(panel->treeview, NULL);
if (symbol == NULL) return;
@@ -1063,7 +1069,10 @@ static void mcb_strings_panel_find_refs(GtkMenuItem *menuitem, GStringsPanel *pa
addr = get_address_from_gotox_dialog(dialog);
display = get_current_view();
- gtk_display_panel_request_move(display, addr);
+
+ if (GTK_IS_DISPLAY_PANEL(display))
+ gtk_display_panel_request_move(GTK_DISPLAY_PANEL(display), addr);
+
g_object_unref(G_OBJECT(display));
delete_vmpa(addr);