summaryrefslogtreecommitdiff
path: root/src/gui/menus
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/menus')
-rw-r--r--src/gui/menus/Makefile.am3
-rw-r--r--src/gui/menus/menubar.c8
-rw-r--r--src/gui/menus/view.c142
-rw-r--r--src/gui/menus/view.h38
4 files changed, 189 insertions, 2 deletions
diff --git a/src/gui/menus/Makefile.am b/src/gui/menus/Makefile.am
index 67d65b6..1275394 100644
--- a/src/gui/menus/Makefile.am
+++ b/src/gui/menus/Makefile.am
@@ -5,7 +5,8 @@ libguimenus_la_SOURCES = \
debug.h debug.c \
file.h file.c \
help.h help.c \
- menubar.h menubar.c
+ menubar.h menubar.c \
+ view.h view.c
libguimenus_la_LDFLAGS =
diff --git a/src/gui/menus/menubar.c b/src/gui/menus/menubar.c
index e6c9007..62a3cbe 100644
--- a/src/gui/menus/menubar.c
+++ b/src/gui/menus/menubar.c
@@ -2,7 +2,7 @@
/* OpenIDA - Outil d'analyse de fichiers binaires
* menubar.c - gestion des différents menus de la fenêtre principale
*
- * Copyright (C) 2011 Cyrille Bagard
+ * Copyright (C) 2011-2012 Cyrille Bagard
*
* This file is part of OpenIDA.
*
@@ -28,6 +28,7 @@
#include "debug.h"
#include "file.h"
#include "help.h"
+#include "view.h"
#include "../editem-int.h"
@@ -137,6 +138,11 @@ GEditorItem *g_menu_bar_new(GObject *ref, GtkAccelGroup *accgroup)
menuitem = build_menu_file(ref, accgroup);
gtk_container_add(GTK_CONTAINER(item->widget), menuitem);
+ /* Affichage */
+
+ menuitem = build_menu_view(ref, accgroup);
+ gtk_container_add(GTK_CONTAINER(item->widget), menuitem);
+
/* Débogage */
menuitem = build_menu_debug(ref, accgroup);
diff --git a/src/gui/menus/view.c b/src/gui/menus/view.c
new file mode 100644
index 0000000..d68ffa4
--- /dev/null
+++ b/src/gui/menus/view.c
@@ -0,0 +1,142 @@
+
+/* OpenIDA - Outil d'analyse de fichiers binaires
+ * view.c - gestion du menu 'Affichage'
+ *
+ * Copyright (C) 2012 Cyrille Bagard
+ *
+ * This view is part of OpenIDA.
+ *
+ * OpenIDA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenIDA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+#include "view.h"
+
+
+#include <i18n.h>
+
+
+#include "../../gtkext/easygtk.h"
+
+
+
+/* Réagit avec le menu "Affichage -> Adresse virtuelle". */
+void mcb_view_vaddress(GtkCheckMenuItem *, gpointer);
+
+/* Réagit avec le menu "Affichage -> code binaire". */
+void mcb_view_code(GtkCheckMenuItem *, gpointer);
+
+
+
+/******************************************************************************
+* *
+* Paramètres : ref = espace de référencement global. *
+* accgroup = groupe d'accélérateurs pour les menus. *
+* *
+* Description : Construit le menu "Fichier". *
+* *
+* Retour : Panneau de menus mis en place. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GtkWidget *build_menu_view(GObject *ref, GtkAccelGroup *accgroup)
+{
+ GtkWidget *result; /* Support à retourner */
+ GtkWidget *menubar; /* Support pour éléments */
+ GtkWidget *submenuitem; /* Sous-élément de menu */
+
+ result = gtk_menu_item_new_with_mnemonic(_("_View"));
+ gtk_widget_show(result);
+
+ menubar = gtk_menu_new();
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(result), menubar);
+
+ submenuitem = qck_create_menu_separator();
+ gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
+
+ submenuitem = qck_create_check_menu_item(NULL, NULL, _("Virtual address"), G_CALLBACK(mcb_view_vaddress), result);
+ gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
+
+ submenuitem = qck_create_check_menu_item(NULL, NULL, _("Binary code"), G_CALLBACK(mcb_view_code), result);
+ gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
+
+ submenuitem = qck_create_menu_separator();
+ gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : menuitem = élément de menu ayant basculé. *
+* data = adresse de l'espace de référencement global. *
+* *
+* Description : Réagit avec le menu "Affichage -> Adresse virtuelle". *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void mcb_view_vaddress(GtkCheckMenuItem *menuitem, gpointer data)
+{
+#if 0
+ GtkBinView *binview; /* Zone de code principale */
+ gboolean active; /* Etat de sélection du menu */
+
+ /* FIXME : "binview" -> "current_view" */
+ return;
+
+ binview = GTK_BIN_VIEW(g_object_get_data(G_OBJECT(data), "binview"));
+ active = gtk_check_menu_item_get_active(menuitem);
+
+ gtk_binview_show_vaddress(binview, active);
+#endif
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : menuitem = élément de menu ayant basculé. *
+* data = adresse de l'espace de référencement global. *
+* *
+* Description : Réagit avec le menu "Affichage -> code binaire". *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void mcb_view_code(GtkCheckMenuItem *menuitem, gpointer data)
+{
+#if 0
+ GtkBinView *binview; /* Zone de code principale */
+ gboolean active; /* Etat de sélection du menu */
+
+ /* FIXME : "binview" -> "current_view" */
+ return;
+
+ binview = GTK_BIN_VIEW(g_object_get_data(G_OBJECT(data), "binview"));
+ active = gtk_check_menu_item_get_active(menuitem);
+
+ gtk_binview_show_code(binview, active);
+#endif
+}
diff --git a/src/gui/menus/view.h b/src/gui/menus/view.h
new file mode 100644
index 0000000..4da6a11
--- /dev/null
+++ b/src/gui/menus/view.h
@@ -0,0 +1,38 @@
+
+/* OpenIDA - Outil d'analyse de fichiers binaires
+ * view.h - prototypes pour la gestion du menu 'Affichage'
+ *
+ * Copyright (C) 2012 Cyrille Bagard
+ *
+ * This file is part of OpenIDA.
+ *
+ * OpenIDA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenIDA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+#ifndef _GUI_MENUS_VIEW_H
+#define _GUI_MENUS_VIEW_H
+
+
+#include <gtk/gtk.h>
+
+
+
+/* Construit le menu "Fichier". */
+GtkWidget *build_menu_view(GObject *, GtkAccelGroup *);
+
+
+
+#endif /* _GUI_MENUS_VIEW_H */