summaryrefslogtreecommitdiff
path: root/src/gui/menus
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/menus')
-rw-r--r--src/gui/menus/binary.c16
-rw-r--r--src/gui/menus/binary.h1
-rw-r--r--src/gui/menus/edition.c59
-rw-r--r--src/gui/menus/view.c66
-rw-r--r--src/gui/menus/view.h1
5 files changed, 85 insertions, 58 deletions
diff --git a/src/gui/menus/binary.c b/src/gui/menus/binary.c
index 0eb28fe..e67c377 100644
--- a/src/gui/menus/binary.c
+++ b/src/gui/menus/binary.c
@@ -29,6 +29,7 @@
#include "../editem-int.h"
+#include "../core/global.h"
#include "../dialogs/export.h"
#include "../dialogs/gotox.h"
#include "../dialogs/storage.h"
@@ -164,7 +165,7 @@ static void mcb_binary_entry_points(GtkMenuItem *menuitem, GMenuBar *bar)
item = G_EDITOR_ITEM(bar);
ref = g_editor_item_get_global_ref(item);
- binary = g_editor_item_get_current_binary(item);
+ binary = get_current_binary();
dialog = create_gotox_dialog_for_entry_points(GTK_WINDOW(ref), binary);
@@ -172,8 +173,9 @@ static void mcb_binary_entry_points(GtkMenuItem *menuitem, GMenuBar *bar)
{
addr = get_address_from_gotox_dialog(dialog);
- panel = g_editor_item_get_current_view(G_EDITOR_ITEM(bar));
+ panel = get_current_view();
gtk_display_panel_request_move(panel, addr);
+ g_object_unref(G_OBJECT(panel));
delete_vmpa(addr);
@@ -181,6 +183,8 @@ static void mcb_binary_entry_points(GtkMenuItem *menuitem, GMenuBar *bar)
gtk_widget_destroy(dialog);
+ g_object_unref(G_OBJECT(binary));
+
}
@@ -223,7 +227,7 @@ static void mcb_binary_storage(GtkMenuItem *menuitem, GMenuBar *bar)
GtkBuilder *builder; /* Constructeur utilisé */
GtkWidget *dialog; /* Boîte de dialogue à montrer */
- binary = g_editor_item_get_current_binary(G_EDITOR_ITEM(bar));
+ binary = get_current_binary();
ref = g_editor_item_get_global_ref(G_EDITOR_ITEM(bar));
dialog = create_storage_dialog(binary, GTK_WINDOW(ref), &builder);
@@ -234,6 +238,8 @@ static void mcb_binary_storage(GtkMenuItem *menuitem, GMenuBar *bar)
g_object_unref(G_OBJECT(builder));
+ g_object_unref(G_OBJECT(binary));
+
}
@@ -254,8 +260,10 @@ static void mcb_binary_export(GtkMenuItem *menuitem, GMenuBar *bar)
{
GLoadedBinary *binary; /* Edition courante */
- binary = g_editor_item_get_current_binary(G_EDITOR_ITEM(bar));
+ binary = get_current_binary();
run_export_assistant(binary, GTK_WINDOW(G_EDITOR_ITEM(bar)->ref));
+ g_object_unref(G_OBJECT(binary));
+
}
diff --git a/src/gui/menus/binary.h b/src/gui/menus/binary.h
index 7662293..a66fe26 100644
--- a/src/gui/menus/binary.h
+++ b/src/gui/menus/binary.h
@@ -30,6 +30,7 @@
#include "menubar.h"
+#include "../../gtkext/gtkdisplaypanel.h"
diff --git a/src/gui/menus/edition.c b/src/gui/menus/edition.c
index f41111d..2491e3d 100644
--- a/src/gui/menus/edition.c
+++ b/src/gui/menus/edition.c
@@ -31,6 +31,7 @@
#include <i18n.h>
+#include "../core/global.h"
#include "../dialogs/bookmark.h"
#include "../dialogs/goto.h"
#include "../dialogs/gotox.h"
@@ -44,13 +45,13 @@
static void mcb_edition_goto(GtkMenuItem *, GMenuBar *);
/* Réagit avec le menu "Edition -> Operande numérique -> ...". */
-static void mcb_edition_switch_numeric_operand(GtkMenuItem *, GMenuBar *);
+static void mcb_edition_switch_numeric_operand(GtkMenuItem *, gpointer);
/* Réagit avec le menu "Edition -> Revenir en arrière". */
static void mcb_edition_go_back(GtkMenuItem *, GMenuBar *);
/* Réagit avec le menu "Edition -> Suivre la référence". */
-static void mcb_edition_follow_ref(GtkMenuItem *, GMenuBar *);
+static void mcb_edition_follow_ref(GtkMenuItem *, gpointer);
/* Réagit avec le menu "Edition -> Lister toutes les réfs...". */
static void mcb_edition_list_xrefs(GtkMenuItem *, GMenuBar *);
@@ -116,25 +117,25 @@ GtkWidget *build_menu_edition(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *b
deepmenubar = qck_create_menu(GTK_MENU_ITEM(submenuitem));
deepmenuitem = qck_create_menu_item(ref, "mnu_edit_switch_hex", _("Hexadecimal"),
- G_CALLBACK(mcb_edition_switch_numeric_operand), bar);
+ G_CALLBACK(mcb_edition_switch_numeric_operand), NULL);
add_accelerator_to_menu_item(deepmenuitem, "H", accgroup);
g_object_set_data(G_OBJECT(deepmenuitem), "kind_of_switch", GUINT_TO_POINTER(IOD_HEX));
gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem);
deepmenuitem = qck_create_menu_item(ref, "mnu_edit_switch_dec", _("Decimal"),
- G_CALLBACK(mcb_edition_switch_numeric_operand), bar);
+ G_CALLBACK(mcb_edition_switch_numeric_operand), NULL);
add_accelerator_to_menu_item(deepmenuitem, "D", accgroup);
g_object_set_data(G_OBJECT(deepmenuitem), "kind_of_switch", GUINT_TO_POINTER(IOD_DEC));
gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem);
deepmenuitem = qck_create_menu_item(ref, "mnu_edit_switch_oct", _("Octal"),
- G_CALLBACK(mcb_edition_switch_numeric_operand), bar);
+ G_CALLBACK(mcb_edition_switch_numeric_operand), NULL);
add_accelerator_to_menu_item(deepmenuitem, "O", accgroup);
g_object_set_data(G_OBJECT(deepmenuitem), "kind_of_switch", GUINT_TO_POINTER(IOD_OCT));
gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem);
deepmenuitem = qck_create_menu_item(ref, "mnu_edit_switch_bin", _("Binary"),
- G_CALLBACK(mcb_edition_switch_numeric_operand), bar);
+ G_CALLBACK(mcb_edition_switch_numeric_operand), NULL);
add_accelerator_to_menu_item(deepmenuitem, "B", accgroup);
g_object_set_data(G_OBJECT(deepmenuitem), "kind_of_switch", GUINT_TO_POINTER(IOD_BIN));
gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem);
@@ -143,7 +144,7 @@ GtkWidget *build_menu_edition(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *b
gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem);
deepmenuitem = qck_create_menu_item(ref, "mnu_edit_switch_def", _("Default"),
- G_CALLBACK(mcb_edition_switch_numeric_operand), bar);
+ G_CALLBACK(mcb_edition_switch_numeric_operand), NULL);
g_object_set_data(G_OBJECT(deepmenuitem), "kind_of_switch", GUINT_TO_POINTER(IOD_COUNT));
gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem);
@@ -160,7 +161,7 @@ GtkWidget *build_menu_edition(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *b
gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
submenuitem = qck_create_menu_item(ref, "mnu_edit_follow_ref", _("Follow the reference"),
- G_CALLBACK(mcb_edition_follow_ref), bar);
+ G_CALLBACK(mcb_edition_follow_ref), NULL);
add_accelerator_to_menu_item(submenuitem, "Return", accgroup);
gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
@@ -321,8 +322,9 @@ static void mcb_edition_goto(GtkMenuItem *menuitem, GMenuBar *bar)
{
addr = get_address_from_goto_dialog(dialog);
- panel = g_editor_item_get_current_view(G_EDITOR_ITEM(bar));
+ panel = get_current_view();
gtk_display_panel_request_move(panel, addr);
+ g_object_unref(G_OBJECT(panel));
delete_vmpa(addr);
@@ -336,7 +338,7 @@ static void mcb_edition_goto(GtkMenuItem *menuitem, GMenuBar *bar)
/******************************************************************************
* *
* Paramètres : menuitem = élément de menu sélectionné. *
-* bar = barre de menu parente. *
+* unused = adresse non utilisée ici. *
* *
* Description : Réagit avec le menu "Edition -> Operande numérique -> ...". *
* *
@@ -346,10 +348,9 @@ static void mcb_edition_goto(GtkMenuItem *menuitem, GMenuBar *bar)
* *
******************************************************************************/
-static void mcb_edition_switch_numeric_operand(GtkMenuItem *menuitem, GMenuBar *bar)
+static void mcb_edition_switch_numeric_operand(GtkMenuItem *menuitem, gpointer unused)
{
ImmOperandDisplay display; /* Type de basculement */
- GEditorItem *editem; /* Autre version de la barre */
GtkDisplayPanel *panel; /* Afficheur effectif de code */
GBufferLine *line; /* Ligne de position courante */
GObject *creator; /* Créateur à l'orgine du seg. */
@@ -361,9 +362,7 @@ static void mcb_edition_switch_numeric_operand(GtkMenuItem *menuitem, GMenuBar *
display = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(menuitem), "kind_of_switch"));
- editem = G_EDITOR_ITEM(bar);
-
- panel = g_editor_item_get_current_view(editem);
+ panel = get_current_view();
if (gtk_display_panel_get_position(panel, &line, &creator))
{
@@ -371,7 +370,7 @@ static void mcb_edition_switch_numeric_operand(GtkMenuItem *menuitem, GMenuBar *
range = g_buffer_line_get_range(line);
- binary = g_editor_item_get_current_binary(editem);
+ binary = get_current_binary();
proc = g_loaded_binary_get_processor(binary);
instr = g_arch_processor_find_instr_by_address(proc, get_mrange_addr(range));
@@ -384,12 +383,15 @@ static void mcb_edition_switch_numeric_operand(GtkMenuItem *menuitem, GMenuBar *
g_loaded_binary_add_to_collection(binary, G_DB_ITEM(switcher));
g_object_unref(G_OBJECT(proc));
+ g_object_unref(G_OBJECT(binary));
g_object_unref(creator);
g_object_unref(G_OBJECT(line));
}
+ g_object_unref(G_OBJECT(panel));
+
}
@@ -415,7 +417,7 @@ static void mcb_edition_go_back(GtkMenuItem *menuitem, GMenuBar *bar)
/******************************************************************************
* *
* Paramètres : menuitem = élément de menu sélectionné. *
-* bar = barre de menu parente. *
+* unused = adresse non utilisée ici. *
* *
* Description : Réagit avec le menu "Edition -> Suivre la référence". *
* *
@@ -425,7 +427,7 @@ static void mcb_edition_go_back(GtkMenuItem *menuitem, GMenuBar *bar)
* *
******************************************************************************/
-static void mcb_edition_follow_ref(GtkMenuItem *menuitem, GMenuBar *bar)
+static void mcb_edition_follow_ref(GtkMenuItem *menuitem, gpointer unused)
{
GtkDisplayPanel *panel; /* Afficheur effectif de code */
GBufferLine *line; /* Ligne de position courante */
@@ -434,7 +436,7 @@ static void mcb_edition_follow_ref(GtkMenuItem *menuitem, GMenuBar *bar)
vmpa2t addr; /* Adresse de destination */
virt_t virt; /* Adresse virtuelle */
- panel = g_editor_item_get_current_view(G_EDITOR_ITEM(bar));
+ panel = get_current_view();
if (gtk_display_panel_get_position(panel, &line, &creator))
{
@@ -465,6 +467,8 @@ static void mcb_edition_follow_ref(GtkMenuItem *menuitem, GMenuBar *bar)
}
+ g_object_unref(G_OBJECT(panel));
+
}
@@ -493,13 +497,13 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar)
GtkWidget *dialog; /* Boîte de dialogue à montrer */
vmpa2t *addr; /* Adresse de destination */
- panel = g_editor_item_get_current_view(G_EDITOR_ITEM(bar));
+ panel = get_current_view();
if (gtk_display_panel_get_position(panel, &line, NULL))
{
range = g_buffer_line_get_range(line);
- binary = g_editor_item_get_current_binary(G_EDITOR_ITEM(bar));
+ binary = get_current_binary();
proc = g_loaded_binary_get_processor(binary);
/**
@@ -532,11 +536,14 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar)
g_object_unref(G_OBJECT(instr));
g_object_unref(G_OBJECT(proc));
+ g_object_unref(G_OBJECT(binary));
g_object_unref(G_OBJECT(line));
}
+ g_object_unref(G_OBJECT(panel));
+
}
@@ -555,7 +562,6 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar)
static void mcb_edition_bookmarks_toggle(GtkMenuItem *menuitem, GMenuBar *bar)
{
- GEditorItem *editem; /* Autre version de la barre */
GtkDisplayPanel *panel; /* Vue offrant l'affichage */
const vmpa2t *curloc; /* Localisation d'un curseur */
GLoadedBinary *binary; /* Binaire en cours d'étude */
@@ -566,17 +572,15 @@ static void mcb_edition_bookmarks_toggle(GtkMenuItem *menuitem, GMenuBar *bar)
GDbItem *bookmark; /* Nouveau signet défini */
gint ret; /* Retour de confirmation */
- editem = G_EDITOR_ITEM(bar);
-
/* Détermination de l'adresse visée */
- panel = g_editor_item_get_current_view(editem);
+ panel = get_current_view();
curloc = gtk_display_panel_get_caret_location(panel);
/* Accès à la collection */
- binary = g_editor_item_get_current_binary(editem);
+ binary = get_current_binary();
collec = g_loaded_binary_find_collection(binary, DBF_BOOKMARKS);
/**
@@ -632,6 +636,9 @@ static void mcb_edition_bookmarks_toggle(GtkMenuItem *menuitem, GMenuBar *bar)
}
g_object_unref(G_OBJECT(collec));
+ g_object_unref(G_OBJECT(binary));
+
+ g_object_unref(G_OBJECT(panel));
}
diff --git a/src/gui/menus/view.c b/src/gui/menus/view.c
index a00c614..5298af3 100644
--- a/src/gui/menus/view.c
+++ b/src/gui/menus/view.c
@@ -32,6 +32,8 @@
#include "../editem-int.h"
+#include "../core/global.h"
+#include "../core/items.h"
#include "../core/panels.h"
#include "../../analysis/project.h"
#include "../../gtkext/easygtk.h"
@@ -47,10 +49,10 @@ static void mcb_view_update_side_panels_list(GtkMenuItem *, GMenuBar *);
static void mcb_view_change_panel_docking(GtkCheckMenuItem *, GPanelItem *);
/* Réagit avec le menu "Affichage -> Vue xxx". */
-static void mcb_view_change_support(GtkRadioMenuItem *, GMenuBar *);
+static void mcb_view_change_support(GtkRadioMenuItem *, gpointer);
/* Réagit avec le menu "Affichage -> (colonne xxx)". */
-static void mcb_view_display_column(GtkCheckMenuItem *, GMenuBar *);
+static void mcb_view_display_column(GtkCheckMenuItem *, gpointer);
/* Réagit avec le menu "Affichage -> Plein écran". */
static void mcb_view_show_full_screen(GtkCheckMenuItem *, GMenuBar *);
@@ -99,7 +101,7 @@ GtkWidget *build_menu_view(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *bar)
/* Types de panneau de code */
submenuitem = qck_create_radio_menu_item(ref, "mnu_view_switch_textview", NULL, _("Text view"),
- G_CALLBACK(mcb_view_change_support), bar);
+ G_CALLBACK(mcb_view_change_support), NULL);
add_accelerator_to_menu_item(submenuitem, "F3", accgroup);
g_object_set_data(G_OBJECT(submenuitem), "kind_of_view", GUINT_TO_POINTER(BVW_BLOCK));
g_object_set_data(G_OBJECT(submenuitem), "kind_of_display", GSIZE_TO_POINTER(GTK_TYPE_BLOCK_DISPLAY));
@@ -108,7 +110,7 @@ GtkWidget *build_menu_view(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *bar)
rgroup = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(submenuitem));
submenuitem = qck_create_radio_menu_item(ref, "mnu_view_switch_graphview", rgroup, _("Graph view"),
- G_CALLBACK(mcb_view_change_support), bar);
+ G_CALLBACK(mcb_view_change_support), NULL);
add_accelerator_to_menu_item(submenuitem, "F4", accgroup);
g_object_set_data(G_OBJECT(submenuitem), "kind_of_view", GUINT_TO_POINTER(BVW_GRAPH));
g_object_set_data(G_OBJECT(submenuitem), "kind_of_display", GSIZE_TO_POINTER(GTK_TYPE_GRAPH_DISPLAY));
@@ -122,17 +124,17 @@ GtkWidget *build_menu_view(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *bar)
/* Affichage des données */
submenuitem = qck_create_check_menu_item(ref, "mnu_view_display_off", _("Physical offset"),
- G_CALLBACK(mcb_view_display_column), bar);
+ G_CALLBACK(mcb_view_display_column), NULL);
g_object_set_data(G_OBJECT(submenuitem), "kind_of_col", GUINT_TO_POINTER(BLC_PHYSICAL));
gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
submenuitem = qck_create_check_menu_item(ref, "mnu_view_display_addr", _("Virtual address"),
- G_CALLBACK(mcb_view_display_column), bar);
+ G_CALLBACK(mcb_view_display_column), NULL);
g_object_set_data(G_OBJECT(submenuitem), "kind_of_col", GUINT_TO_POINTER(BLC_VIRTUAL));
gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
submenuitem = qck_create_check_menu_item(ref, "mnu_view_display_code", _("Binary code"),
- G_CALLBACK(mcb_view_display_column), bar);
+ G_CALLBACK(mcb_view_display_column), NULL);
g_object_set_data(G_OBJECT(submenuitem), "kind_of_col", GUINT_TO_POINTER(BLC_BINARY));
gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
@@ -173,8 +175,8 @@ void update_menu_view_for_view(GtkWidget *widget, GtkDisplayPanel *panel, GMenuB
GtkRadioMenuItem *item; /* Elément de menu arbitraire */
GSList *radios; /* Liste des menus d'affichage */
GSList *found; /* Elément de menu à activer */
- GLoadedBinary *binary; /* Binaire courant */
BinaryView content; /* Type de vue active */
+ GLoadedBinary *binary; /* Binaire courant */
const bool *display; /* Règles d'affichage courantes*/
GtkWidget *submenuitem; /* Sous-élément de menu */
bool status; /* Consigne d'affichage */
@@ -189,7 +191,7 @@ void update_menu_view_for_view(GtkWidget *widget, GtkDisplayPanel *panel, GMenuB
void disconnect_display_radio(GtkWidget *wgt, gpointer unused)
{
- g_signal_handlers_disconnect_by_func(wgt, G_CALLBACK(mcb_view_change_support), bar);
+ g_signal_handlers_disconnect_by_func(wgt, G_CALLBACK(mcb_view_change_support), NULL);
}
@@ -216,7 +218,7 @@ void update_menu_view_for_view(GtkWidget *widget, GtkDisplayPanel *panel, GMenuB
void reconnect_display_radio(GtkWidget *wgt, gpointer unused)
{
- g_signal_connect(wgt, "toggled", G_CALLBACK(mcb_view_change_support), bar);
+ g_signal_connect(wgt, "toggled", G_CALLBACK(mcb_view_change_support), NULL);
}
@@ -224,44 +226,46 @@ void update_menu_view_for_view(GtkWidget *widget, GtkDisplayPanel *panel, GMenuB
/* - */
- binary = g_editor_item_get_current_binary(G_EDITOR_ITEM(bar));
-
content = gtk_display_panel_describe_content(panel);
+ binary = get_current_binary();
+
display = g_loaded_binary_get_column_display(binary, content);
+ g_object_unref(G_OBJECT(binary));
+
/* Positions physiques */
submenuitem = g_object_get_data(ref, "mnu_view_display_off");
- g_signal_handlers_disconnect_by_func(submenuitem, G_CALLBACK(mcb_view_display_column), bar);
+ g_signal_handlers_disconnect_by_func(submenuitem, G_CALLBACK(mcb_view_display_column), NULL);
status = display[BLC_PHYSICAL];
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(submenuitem), status);
- g_signal_connect(submenuitem, "toggled", G_CALLBACK(mcb_view_display_column), bar);
+ g_signal_connect(submenuitem, "toggled", G_CALLBACK(mcb_view_display_column), NULL);
/* Adresses virtuelles */
submenuitem = g_object_get_data(ref, "mnu_view_display_addr");
- g_signal_handlers_disconnect_by_func(submenuitem, G_CALLBACK(mcb_view_display_column), bar);
+ g_signal_handlers_disconnect_by_func(submenuitem, G_CALLBACK(mcb_view_display_column), NULL);
status = display[BLC_VIRTUAL];
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(submenuitem), status);
- g_signal_connect(submenuitem, "toggled", G_CALLBACK(mcb_view_display_column), bar);
+ g_signal_connect(submenuitem, "toggled", G_CALLBACK(mcb_view_display_column), NULL);
/* Code binaire */
submenuitem = g_object_get_data(ref, "mnu_view_display_code");
- g_signal_handlers_disconnect_by_func(submenuitem, G_CALLBACK(mcb_view_display_column), bar);
+ g_signal_handlers_disconnect_by_func(submenuitem, G_CALLBACK(mcb_view_display_column), NULL);
status = display[BLC_BINARY];
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(submenuitem), status);
- g_signal_connect(submenuitem, "toggled", G_CALLBACK(mcb_view_display_column), bar);
+ g_signal_connect(submenuitem, "toggled", G_CALLBACK(mcb_view_display_column), NULL);
}
@@ -447,7 +451,7 @@ static void mcb_view_change_panel_docking(GtkCheckMenuItem *menuitem, GPanelItem
/******************************************************************************
* *
* Paramètres : menuitem = élément de menu ayant basculé. *
-* bar = barre de menu parente. *
+* unused = adresse non utilisée ici. *
* *
* Description : Réagit avec le menu "Affichage -> Vue xxx". *
* *
@@ -457,7 +461,7 @@ static void mcb_view_change_panel_docking(GtkCheckMenuItem *menuitem, GPanelItem
* *
******************************************************************************/
-static void mcb_view_change_support(GtkRadioMenuItem *menuitem, GMenuBar *bar)
+static void mcb_view_change_support(GtkRadioMenuItem *menuitem, gpointer unused)
{
GSList *group; /* Liste de menus radio */
GSList *iter; /* Boucle de parcours */
@@ -465,6 +469,7 @@ static void mcb_view_change_support(GtkRadioMenuItem *menuitem, GMenuBar *bar)
GtkDisplayPanel *panel; /* Afficheur effectif de code */
GtkDockStation *station; /* Base du remplacement */
GtkWidget *scroll; /* Nouveau support à utiliser */
+ GtkDisplayPanel *new; /* Nouvel afficheur de code */
/* On ne traite qu'une seule fois ! */
if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem))) return;
@@ -477,19 +482,21 @@ static void mcb_view_change_support(GtkRadioMenuItem *menuitem, GMenuBar *bar)
wanted = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(iter->data), "kind_of_view"));
- panel = g_editor_item_get_current_view(G_EDITOR_ITEM(bar));
+ panel = get_current_view();
station = get_dock_station_for_view_panel(panel);
/* En vue du retrait de la station d'accueil... */
scroll = get_scroll_window_for_view_panel(panel);
g_object_ref(G_OBJECT(scroll));
- panel = get_alt_view_for_view_panel(panel, wanted);
- scroll = get_scroll_window_for_view_panel(panel);
+ new = get_alt_view_for_view_panel(panel, wanted);
+ scroll = get_scroll_window_for_view_panel(new);
gtk_dock_panel_change_active_widget(station, scroll);
- change_editor_items_current_view(G_EDITOR_ITEM(bar)->ref, panel);
+ change_editor_items_current_view(new);
+
+ g_object_unref(G_OBJECT(panel));
}
@@ -499,7 +506,7 @@ static void mcb_view_change_support(GtkRadioMenuItem *menuitem, GMenuBar *bar)
/******************************************************************************
* *
* Paramètres : menuitem = élément de menu ayant basculé. *
-* bar = barre de menu parente. *
+* unused = adresse non utilisée ici. *
* *
* Description : Réagit avec le menu "Affichage -> (colonne xxx)". *
* *
@@ -509,7 +516,7 @@ static void mcb_view_change_support(GtkRadioMenuItem *menuitem, GMenuBar *bar)
* *
******************************************************************************/
-static void mcb_view_display_column(GtkCheckMenuItem *menuitem, GMenuBar *bar)
+static void mcb_view_display_column(GtkCheckMenuItem *menuitem, gpointer unused)
{
BufferLineColumn col; /* Colonne à traiter */
GLoadedBinary *binary; /* Binaire courant */
@@ -519,15 +526,18 @@ static void mcb_view_display_column(GtkCheckMenuItem *menuitem, GMenuBar *bar)
col = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(menuitem), "kind_of_col"));
- binary = g_editor_item_get_current_binary(G_EDITOR_ITEM(bar));
+ binary = get_current_binary();
- panel = g_editor_item_get_current_view(G_EDITOR_ITEM(bar));
+ panel = get_current_view();
view = gtk_display_panel_describe_content(panel);
+ g_object_unref(G_OBJECT(panel));
active = gtk_check_menu_item_get_active(menuitem);
g_loaded_binary_set_column_display(binary, view, col, active);
+ g_object_unref(G_OBJECT(binary));
+
}
diff --git a/src/gui/menus/view.h b/src/gui/menus/view.h
index 65c57f7..d42bbc6 100644
--- a/src/gui/menus/view.h
+++ b/src/gui/menus/view.h
@@ -30,6 +30,7 @@
#include "menubar.h"
+#include "../../gtkext/gtkdisplaypanel.h"