diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-07-16 20:11:21 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-07-16 20:11:21 (GMT) |
commit | f6e56cebfa878dd32a2405fd0c916a40140a1ff0 (patch) | |
tree | 3e364d2e2b2de19b85ab6d14f856d4b8db11737a /src/gui/menus/binary.c | |
parent | e0d03e3eddb9d240cc21ac1b7a7ade915fd17942 (diff) |
Applied a new GUI update with the new loaded panels features.
Diffstat (limited to 'src/gui/menus/binary.c')
-rw-r--r-- | src/gui/menus/binary.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/src/gui/menus/binary.c b/src/gui/menus/binary.c index b7be1b9..1360011 100644 --- a/src/gui/menus/binary.c +++ b/src/gui/menus/binary.c @@ -34,6 +34,7 @@ #include "../dialogs/gotox.h" #include "../dialogs/storage.h" #include "../../gtkext/easygtk.h" +#include "../../gtkext/gtkdisplaypanel.h" @@ -106,10 +107,9 @@ GtkWidget *build_menu_binary(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *ba /****************************************************************************** * * -* Paramètres : ref = espace de référencements à consulter. * -* panel = panneau d'affichage actif ou NULL si aucun. * +* Paramètres : new = nouveau contenu chargé à analyser. * * * -* Description : Met à jour les accès du menu "Binaire" selon le contenu. * +* Description : Réagit à un changement d'affichage principal de contenu. * * * * Retour : - * * * @@ -117,14 +117,17 @@ GtkWidget *build_menu_binary(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *ba * * ******************************************************************************/ -void update_access_in_menu_binary(GObject *ref, GtkDisplayPanel *panel) +void update_access_for_content_in_menu_binary(GLoadedContent *new) { + GObject *ref; /* Espace de référencements */ gboolean access; /* Accès à déterminer */ GtkWidget *item; /* Elément de menu à traiter */ /* Préliminaire */ - access = (panel != NULL); + ref = get_global_ref(); + + access = G_IS_LOADED_BINARY(new); /* Menus */ @@ -155,19 +158,14 @@ void update_access_in_menu_binary(GObject *ref, GtkDisplayPanel *panel) static void mcb_binary_entry_points(GtkMenuItem *menuitem, GMenuBar *bar) { - GEditorItem *item; /* Elément d'éditeur graphique */ - GObject *ref; /* Espace de référencements */ GLoadedBinary *binary; /* Binaire présenté à l'écran */ GtkWidget *dialog; /* Boîte de dialogue à montrer */ vmpa2t *addr; /* Adresse de destination */ GLoadedPanel *panel; /* Afficheur effectif de code */ - item = G_EDITOR_ITEM(bar); + binary = G_LOADED_BINARY(get_current_content()); - ref = g_editor_item_get_global_ref(item); - binary = get_current_binary(); - - dialog = create_gotox_dialog_for_entry_points(GTK_WINDOW(ref), binary); + dialog = create_gotox_dialog_for_entry_points(get_editor_window(), binary); if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) { @@ -226,14 +224,12 @@ static void mcb_binary_attach_debugger(GtkMenuItem *menuitem, GMenuBar *bar) static void mcb_binary_storage(GtkMenuItem *menuitem, GMenuBar *bar) { GLoadedBinary *binary; /* Edition courante */ - GObject *ref; /* Espace de référencements */ GtkBuilder *builder; /* Constructeur utilisé */ GtkWidget *dialog; /* Boîte de dialogue à montrer */ - binary = get_current_binary(); - ref = g_editor_item_get_global_ref(G_EDITOR_ITEM(bar)); + binary = G_LOADED_BINARY(get_current_content()); - dialog = create_storage_dialog(binary, GTK_WINDOW(ref), &builder); + dialog = create_storage_dialog(binary, get_editor_window(), &builder); gtk_dialog_run(GTK_DIALOG(dialog)); @@ -263,9 +259,9 @@ static void mcb_binary_export(GtkMenuItem *menuitem, GMenuBar *bar) { GLoadedBinary *binary; /* Edition courante */ - binary = get_current_binary(); + binary = G_LOADED_BINARY(get_current_content()); - run_export_assistant(binary, GTK_WINDOW(G_EDITOR_ITEM(bar)->ref)); + run_export_assistant(binary, get_editor_window()); g_object_unref(G_OBJECT(binary)); |