diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-08-26 22:15:05 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-08-26 22:15:05 (GMT) |
commit | 8ca477e012b11a19363542d171b8e973d637641c (patch) | |
tree | 94a4fcde1779f031946eff7a36075f41a17cd73b /src/gui/panels | |
parent | 4fb2ac107092671fe27fc3ebf9fc86dff7c3ec19 (diff) |
Removed most of the functions using the editor items as global access to active items.
Diffstat (limited to 'src/gui/panels')
-rw-r--r-- | src/gui/panels/bintree.c | 10 | ||||
-rw-r--r-- | src/gui/panels/bookmarks.c | 15 | ||||
-rw-r--r-- | src/gui/panels/errors.c | 10 | ||||
-rw-r--r-- | src/gui/panels/strings.c | 21 | ||||
-rw-r--r-- | src/gui/panels/symbols.c | 12 | ||||
-rw-r--r-- | src/gui/panels/welcome.c | 1 |
6 files changed, 42 insertions, 27 deletions
diff --git a/src/gui/panels/bintree.c b/src/gui/panels/bintree.c index 1fa0cfe..b7c31c1 100644 --- a/src/gui/panels/bintree.c +++ b/src/gui/panels/bintree.c @@ -33,6 +33,7 @@ #include "panel-int.h" +#include "../core/global.h" #include "../../gtkext/tmgt.h" @@ -114,7 +115,7 @@ static void on_search_entry_changed(GtkSearchEntry *, GBintreePanel *); static void apply_filter_on_portions(GtkTreeStore *); /* Réagit au changement de sélection des portions. */ -static void on_bintree_selection_changed(GtkTreeSelection *, GBintreePanel *); +static void on_bintree_selection_changed(GtkTreeSelection *, gpointer); @@ -686,7 +687,7 @@ static void apply_filter_on_portions(GtkTreeStore *store) /****************************************************************************** * * * Paramètres : selection = sélection modifiée. * -* panel = structure contenant les informations maîtresses. * +* unused = adresse non utilisée ici. * * * * Description : Réagit au changement de sélection des portions. * * * @@ -696,7 +697,7 @@ static void apply_filter_on_portions(GtkTreeStore *store) * * ******************************************************************************/ -static void on_bintree_selection_changed(GtkTreeSelection *selection, GBintreePanel *panel) +static void on_bintree_selection_changed(GtkTreeSelection *selection, gpointer unused) { GtkTreeIter iter; /* Point de sélection */ GtkTreeModel *model; /* Modèle de gestion */ @@ -712,8 +713,9 @@ static void on_bintree_selection_changed(GtkTreeSelection *selection, GBintreePa { range = g_binary_portion_get_range(portion); - display = g_editor_item_get_current_view(G_EDITOR_ITEM(panel)); + display = get_current_view(); gtk_display_panel_request_move(display, get_mrange_addr(range)); + g_object_unref(G_OBJECT(display)); g_object_unref(G_OBJECT(portion)); diff --git a/src/gui/panels/bookmarks.c b/src/gui/panels/bookmarks.c index 9b360f3..20d2bd0 100644 --- a/src/gui/panels/bookmarks.c +++ b/src/gui/panels/bookmarks.c @@ -36,6 +36,7 @@ #include "panel-int.h" +#include "../core/global.h" #include "../../analysis/db/items/bookmark.h" #include "../../common/cpp.h" #include "../../common/extstr.h" @@ -119,7 +120,7 @@ static void reload_bookmarks_into_treeview(GBookmarksPanel *, GLoadedBinary *); static void on_collection_content_changed(GDbCollection *, DBAction, GDbBookmark *, GBookmarksPanel *); /* Réagit au changement de sélection des signets. */ -static void on_bookmarks_selection_change(GtkTreeSelection *, GBookmarksPanel *); +static void on_bookmarks_selection_change(GtkTreeSelection *, gpointer); @@ -337,7 +338,7 @@ static void g_bookmarks_panel_init(GBookmarksPanel *panel) select = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); gtk_tree_selection_set_mode(select, GTK_SELECTION_SINGLE); - g_signal_connect(G_OBJECT(select), "changed", G_CALLBACK(on_bookmarks_selection_change), panel); + g_signal_connect(G_OBJECT(select), "changed", G_CALLBACK(on_bookmarks_selection_change), NULL); /* Préparation du menu contextuel */ @@ -646,7 +647,7 @@ static void on_collection_content_changed(GDbCollection *collec, DBAction action /****************************************************************************** * * * Paramètres : selection = sélection modifiée. * -* panel = structure contenant les informations maîtresses. * +* unused = adresse non utilisée ici. * * * * Description : Réagit au changement de sélection des signets. * * * @@ -656,7 +657,7 @@ static void on_collection_content_changed(GDbCollection *collec, DBAction action * * ******************************************************************************/ -static void on_bookmarks_selection_change(GtkTreeSelection *selection, GBookmarksPanel *panel) +static void on_bookmarks_selection_change(GtkTreeSelection *selection, gpointer unused) { GtkTreeIter iter; /* Point de sélection */ GtkTreeModel *model; /* Modèle de gestion */ @@ -670,8 +671,9 @@ static void on_bookmarks_selection_change(GtkTreeSelection *selection, GBookmark addr = g_db_bookmark_get_address(bookmark); - display = g_editor_item_get_current_view(G_EDITOR_ITEM(panel)); + display = get_current_view(); gtk_display_panel_request_move(display, addr); + g_object_unref(G_OBJECT(display)); g_object_unref(G_OBJECT(bookmark)); @@ -1061,8 +1063,9 @@ static gboolean on_button_press_over_bookmarks(GtkWidget *widget, GdkEventButton addr = g_db_bookmark_get_address(bookmark); - display = g_editor_item_get_current_view(G_EDITOR_ITEM(panel)); + display = get_current_view(); gtk_display_panel_request_move(display, addr); + g_object_unref(G_OBJECT(display)); g_object_unref(G_OBJECT(bookmark)); diff --git a/src/gui/panels/errors.c b/src/gui/panels/errors.c index 842f0ec..67965b5 100644 --- a/src/gui/panels/errors.c +++ b/src/gui/panels/errors.c @@ -34,6 +34,7 @@ #include "panel-int.h" +#include "../core/global.h" #include "../../core/global.h" #include "../../format/format.h" #include "../../gtkext/support.h" @@ -140,7 +141,7 @@ static void filter_error_panel(GErrorPanel *, GtkStatusStack *, activity_id_t); static void update_error_panel_summary(GPanelUpdate *, GErrorPanel *); /* Réagit au changement de sélection des portions. */ -static void on_error_selection_changed(GtkTreeSelection *, GErrorPanel *); +static void on_error_selection_changed(GtkTreeSelection *, gpointer); @@ -925,7 +926,7 @@ static void update_error_panel_summary(GPanelUpdate *update, GErrorPanel *panel) /****************************************************************************** * * * Paramètres : selection = sélection modifiée. * -* panel = structure contenant les informations maîtresses. * +* unused = adresse non utilisée ici. * * * * Description : Réagit au changement de sélection des portions. * * * @@ -935,7 +936,7 @@ static void update_error_panel_summary(GPanelUpdate *update, GErrorPanel *panel) * * ******************************************************************************/ -static void on_error_selection_changed(GtkTreeSelection *selection, GErrorPanel *panel) +static void on_error_selection_changed(GtkTreeSelection *selection, gpointer unused) { GtkTreeIter iter; /* Point de sélection */ GtkTreeModel *model; /* Modèle de gestion */ @@ -946,8 +947,9 @@ static void on_error_selection_changed(GtkTreeSelection *selection, GErrorPanel { gtk_tree_model_get(model, &iter, ETC_ADDR, &addr, -1); - display = g_editor_item_get_current_view(G_EDITOR_ITEM(panel)); + display = get_current_view(); gtk_display_panel_request_move(display, addr); + g_object_unref(G_OBJECT(display)); delete_vmpa(addr); diff --git a/src/gui/panels/strings.c b/src/gui/panels/strings.c index 8e7c702..c9d971e 100644 --- a/src/gui/panels/strings.c +++ b/src/gui/panels/strings.c @@ -30,6 +30,7 @@ #include "panel-int.h" +#include "../core/global.h" #include "../dialogs/gotox.h" #include "../../common/extstr.h" #include "../../core/params.h" @@ -105,7 +106,7 @@ static void g_strings_panel_finalize(GStringsPanel *); static void change_strings_panel_current_binary(GStringsPanel *, GLoadedBinary *); /* Réagit au changement de sélection des chaînes textuelles. */ -static void on_strings_selection_change(GtkTreeSelection *, GStringsPanel *); +static void on_strings_selection_change(GtkTreeSelection *, gpointer); /* Etablit une comparaison entre deux chaînes de caractères. */ static gint compare_strings_list_columns(GtkTreeModel *, GtkTreeIter *, GtkTreeIter *, gpointer); @@ -338,7 +339,7 @@ static void g_strings_panel_init(GStringsPanel *panel) g_generic_config_get_value(get_main_configuration(), MPK_DISPLAY_ON_SEL, &display); if (display) - g_signal_connect(G_OBJECT(select), "changed", G_CALLBACK(on_strings_selection_change), panel); + g_signal_connect(G_OBJECT(select), "changed", G_CALLBACK(on_strings_selection_change), NULL); /* Préparation du menu contextuel */ @@ -572,7 +573,7 @@ static void change_strings_panel_current_binary(GStringsPanel *panel, GLoadedBin /****************************************************************************** * * * Paramètres : selection = sélection modifiée. * -* panel = structure contenant les informations maîtresses. * +* unused = adresse non utilisée ici. * * * * Description : Réagit au changement de sélection des chaînes textuelles. * * * @@ -582,7 +583,7 @@ static void change_strings_panel_current_binary(GStringsPanel *panel, GLoadedBin * * ******************************************************************************/ -static void on_strings_selection_change(GtkTreeSelection *selection, GStringsPanel *panel) +static void on_strings_selection_change(GtkTreeSelection *selection, gpointer unused) { GtkTreeIter iter; /* Point de sélection */ GtkTreeModel *model; /* Modèle de gestion */ @@ -596,8 +597,9 @@ static void on_strings_selection_change(GtkTreeSelection *selection, GStringsPan addr = get_mrange_addr(g_binary_symbol_get_range(symbol)); - display = g_editor_item_get_current_view(G_EDITOR_ITEM(panel)); + display = get_current_view(); gtk_display_panel_request_move(display, addr); + g_object_unref(G_OBJECT(display)); g_object_unref(G_OBJECT(symbol)); @@ -835,8 +837,9 @@ static gboolean on_button_event_over_strings(GtkWidget *widget, GdkEventButton * addr = get_mrange_addr(g_binary_symbol_get_range(symbol)); - display = g_editor_item_get_current_view(G_EDITOR_ITEM(panel)); + display = get_current_view(); gtk_display_panel_request_move(display, addr); + g_object_unref(G_OBJECT(display)); g_object_unref(G_OBJECT(symbol)); @@ -1042,7 +1045,7 @@ static void mcb_strings_panel_find_refs(GtkMenuItem *menuitem, GStringsPanel *pa range = g_binary_symbol_get_range(symbol); - binary = g_editor_item_get_current_binary(G_EDITOR_ITEM(panel)); + binary = get_current_binary(); proc = g_loaded_binary_get_processor(binary); /** @@ -1059,8 +1062,9 @@ static void mcb_strings_panel_find_refs(GtkMenuItem *menuitem, GStringsPanel *pa { addr = get_address_from_gotox_dialog(dialog); - display = g_editor_item_get_current_view(G_EDITOR_ITEM(panel)); + display = get_current_view(); gtk_display_panel_request_move(display, addr); + g_object_unref(G_OBJECT(display)); delete_vmpa(addr); @@ -1072,6 +1076,7 @@ static void mcb_strings_panel_find_refs(GtkMenuItem *menuitem, GStringsPanel *pa g_object_unref(G_OBJECT(instr)); g_object_unref(G_OBJECT(proc)); + g_object_unref(G_OBJECT(binary)); g_object_unref(G_OBJECT(symbol)); diff --git a/src/gui/panels/symbols.c b/src/gui/panels/symbols.c index e73a847..5bd4eae 100644 --- a/src/gui/panels/symbols.c +++ b/src/gui/panels/symbols.c @@ -37,6 +37,7 @@ #include "panel-int.h" +#include "../core/global.h" #include "../../format/format.h" #include "../../gtkext/easygtk.h" #include "../../gtkext/support.h" @@ -107,7 +108,7 @@ static void g_symbols_panel_finalize(GSymbolsPanel *); static void on_symbols_display_change(GtkToggleToolButton *, GSymbolsPanel *); /* Réagit au changement de sélection des symboles. */ -static void on_symbols_selection_change(GtkTreeSelection *, GSymbolsPanel *); +static void on_symbols_selection_change(GtkTreeSelection *, gpointer); /* Réagit à un changement d'affichage principal de contenu. */ static void change_symbols_panel_current_binary(GSymbolsPanel *, GLoadedBinary *); @@ -387,7 +388,7 @@ static void g_symbols_panel_init(GSymbolsPanel *panel) select = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); gtk_tree_selection_set_mode(select, GTK_SELECTION_SINGLE); - g_signal_connect(G_OBJECT(select), "changed", G_CALLBACK(on_symbols_selection_change), panel); + g_signal_connect(G_OBJECT(select), "changed", G_CALLBACK(on_symbols_selection_change), NULL); } @@ -531,7 +532,7 @@ static void on_symbols_display_change(GtkToggleToolButton *button, GSymbolsPanel /****************************************************************************** * * * Paramètres : selection = sélection modifiée. * -* panel = structure contenant les informations maîtresses. * +* unused = adresse non utilisée ici. * * * * Description : Réagit au changement de sélection des symboles. * * * @@ -541,7 +542,7 @@ static void on_symbols_display_change(GtkToggleToolButton *button, GSymbolsPanel * * ******************************************************************************/ -static void on_symbols_selection_change(GtkTreeSelection *selection, GSymbolsPanel *panel) +static void on_symbols_selection_change(GtkTreeSelection *selection, gpointer unused) { GtkTreeIter iter; /* Point de sélection */ GtkTreeModel *model; /* Modèle de gestion */ @@ -557,8 +558,9 @@ static void on_symbols_selection_change(GtkTreeSelection *selection, GSymbolsPan { range = g_binary_symbol_get_range(symbol); - display = g_editor_item_get_current_view(G_EDITOR_ITEM(panel)); + display = get_current_view(); gtk_display_panel_request_move(display, get_mrange_addr(range)); + g_object_unref(G_OBJECT(display)); g_object_unref(G_OBJECT(symbol)); diff --git a/src/gui/panels/welcome.c b/src/gui/panels/welcome.c index a20810c..44ff517 100644 --- a/src/gui/panels/welcome.c +++ b/src/gui/panels/welcome.c @@ -37,6 +37,7 @@ #include "panel-int.h" +#include "../../analysis/project.h" #include "../../common/cpp.h" #include "../../common/io.h" #include "../../common/net.h" |