summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-02-22 11:35:09 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-02-22 11:35:09 (GMT)
commitb639c1f4abca32152bf88f8fd47a9cd114da701b (patch)
tree3c10f78c94e2747f4c22d692d276ae24c1f6a44d /src/gui
parentd450f573d94f795d83d09526546d63c81fde2e1d (diff)
Created a dialog box to select an entry point to display.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@476 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/menus/binary.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/gui/menus/binary.c b/src/gui/menus/binary.c
index 9643663..c7c0347 100644
--- a/src/gui/menus/binary.c
+++ b/src/gui/menus/binary.c
@@ -30,11 +30,15 @@
#include "../editem-int.h"
#include "../../dialogs/export.h"
+#include "../../dialogs/gotox.h"
#include "../../dialogs/storage.h"
#include "../../gtkext/easygtk.h"
+/* Réagit au menu "Binaire -> Points d'entrée". */
+static void mcb_binary_entry_points(GtkMenuItem *, GMenuBar *);
+
/* Réagit au menu "Binaire -> Enregistrements...". */
static void mcb_binary_storage(GtkMenuItem *, GMenuBar *);
@@ -69,6 +73,14 @@ GtkWidget *build_menu_binary(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *ba
menubar = gtk_menu_new();
gtk_menu_item_set_submenu(GTK_MENU_ITEM(result), menubar);
+ submenuitem = qck_create_menu_item(NULL, NULL, _("Entry points"),
+ G_CALLBACK(mcb_binary_entry_points), bar);
+ add_accelerator_to_menu_item(submenuitem, "<Ctrl>E", accgroup);
+ gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
+
+ submenuitem = qck_create_menu_separator();
+ gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
+
submenuitem = qck_create_menu_item(ref, "mnu_binary_storage", _("Storage..."),
G_CALLBACK(mcb_binary_storage), bar);
gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
@@ -87,6 +99,51 @@ GtkWidget *build_menu_binary(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *ba
* Paramètres : menuitem = élément de menu sélectionné. *
* bar = barre de menu parente. *
* *
+* Description : Réagit au menu "Binaire -> Points d'entrée". *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+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 */
+ GtkViewPanel *vpanel; /* Afficheur effectif de code */
+
+ item = G_EDITOR_ITEM(bar);
+
+ ref = g_editor_item_get_global_ref(item);
+ binary = g_editor_item_get_current_binary(item);
+
+ dialog = create_gotox_dialog(GTK_WINDOW(ref), binary);
+
+ if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK)
+ {
+ addr = get_address_from_gotox_dialog(dialog);
+
+ vpanel = g_editor_item_get_current_view(G_EDITOR_ITEM(bar));
+ gtk_view_panel_scroll_to_address(vpanel, addr);
+
+ delete_vmpa(addr);
+
+ }
+
+ gtk_widget_destroy(dialog);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : menuitem = élément de menu sélectionné. *
+* bar = barre de menu parente. *
+* *
* Description : Réagit au menu "Binaire -> Enregistrements...". *
* *
* Retour : - *