diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-12-30 10:38:52 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-12-30 10:38:52 (GMT) |
commit | 932ea7c83c07d3982fee605c6dd9895fd2753874 (patch) | |
tree | 766ad53bab9e3e3005334c30e823493de8e84168 /src/gui | |
parent | 1b5d39bfbc48c33a0ea0924b60e48448c8b45dd4 (diff) |
Rewritten the line buffers using generators and on-demand building to save memory.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogs/export.c | 11 | ||||
-rw-r--r-- | src/gui/dialogs/gotox.c | 3 | ||||
-rw-r--r-- | src/gui/editem-int.h | 1 | ||||
-rw-r--r-- | src/gui/editem.c | 11 | ||||
-rw-r--r-- | src/gui/editor.c | 6 | ||||
-rw-r--r-- | src/gui/menus/edition.c | 1 | ||||
-rw-r--r-- | src/gui/menus/view.c | 75 | ||||
-rw-r--r-- | src/gui/status.c | 15 | ||||
-rw-r--r-- | src/gui/tb/Makefile.am | 1 | ||||
-rw-r--r-- | src/gui/tb/source.c | 321 | ||||
-rw-r--r-- | src/gui/tb/source.h | 56 |
11 files changed, 79 insertions, 422 deletions
diff --git a/src/gui/dialogs/export.c b/src/gui/dialogs/export.c index c16e7d8..b39a5c1 100644 --- a/src/gui/dialogs/export.c +++ b/src/gui/dialogs/export.c @@ -49,7 +49,7 @@ static void export_assistant_cancel(GtkAssistant *, gpointer); static void export_assistant_close(GtkAssistant *, GObject *); /* Réalise l'exportation d'un contenu binaire comme demandé. */ -static void do_binary_export(GCodeBuffer *, const vmpa2t *, const vmpa2t *, buffer_export_context *, BufferExportType, const bool *); +static void do_binary_export(void/*GCodeBuffer*/ *, const vmpa2t *, const vmpa2t *, buffer_export_context *, BufferExportType, const bool *); @@ -181,6 +181,8 @@ static void export_assistant_cancel(GtkAssistant *assistant, gpointer data) static void export_assistant_close(GtkAssistant *assistant, GObject *ref) { +#if 0 + GtkComboBox *combo; /* Selection du format */ BufferExportType type; /* Type d'exportation requise */ buffer_export_context ctx; /* Contexte à constituer */ @@ -283,7 +285,7 @@ static void export_assistant_close(GtkAssistant *assistant, GObject *ref) support = G_OBJECT(g_object_get_data(G_OBJECT(assistant), "html_options")); if (support != NULL) g_object_unref(support); - +#endif gtk_widget_destroy(GTK_WIDGET(assistant)); } @@ -306,8 +308,9 @@ static void export_assistant_close(GtkAssistant *assistant, GObject *ref) * * ******************************************************************************/ -static void do_binary_export(GCodeBuffer *buffer, const vmpa2t *start, const vmpa2t *end, buffer_export_context *ctx, BufferExportType type, const bool *display) +static void do_binary_export(void/*GCodeBuffer*/ *buffer, const vmpa2t *start, const vmpa2t *end, buffer_export_context *ctx, BufferExportType type, const bool *display) { +#if 0 typedef struct _export_data { buffer_export_context *ctx; /* Contexte d'exportation */ @@ -373,7 +376,7 @@ static void do_binary_export(GCodeBuffer *buffer, const vmpa2t *start, const vmp default: break; } - +#endif } diff --git a/src/gui/dialogs/gotox.c b/src/gui/dialogs/gotox.c index 872cd4f..abd9377 100644 --- a/src/gui/dialogs/gotox.c +++ b/src/gui/dialogs/gotox.c @@ -342,6 +342,7 @@ GtkWidget *create_gotox_dialog_for_cross_references(GtkWindow *parent, GLoadedBi static void add_new_location_to_list(GtkTreeStore *store, GLoadedBinary *binary, const vmpa2t *addr, GBinSymbol *hint) { +#if 0 GCodeBuffer *buffer; /* Tampon de désassemblage */ GBufferLine *line; /* Ligne présente à l'adresse */ char *virtual; /* Transcription d'adresse */ @@ -465,7 +466,7 @@ static void add_new_location_to_list(GtkTreeStore *store, GLoadedBinary *binary, if (line != NULL) g_object_unref(G_OBJECT(line)); - +#endif } diff --git a/src/gui/editem-int.h b/src/gui/editem-int.h index 919e8ae..f77cf99 100644 --- a/src/gui/editem-int.h +++ b/src/gui/editem-int.h @@ -33,7 +33,6 @@ #include "../common/dllist.h" -#include "../gtkext/gtkbufferview.h" #include "../gtkext/gtkdisplaypanel.h" diff --git a/src/gui/editem.c b/src/gui/editem.c index fc502a0..0ec2d72 100644 --- a/src/gui/editem.c +++ b/src/gui/editem.c @@ -27,7 +27,6 @@ #include "editem-int.h" #include "../analysis/db/items/move.h" -#include "../gtkext/gtkblockview.h" @@ -250,10 +249,14 @@ void change_editor_items_current_binary(GObject *ref, GLoadedBinary *binary) GEditorItem *iter; /* Boucle de parcours */ GEditorItemClass *klass; /* Classe correspondante */ - if (binary != NULL) - g_object_ref(G_OBJECT(binary)); + if (binary == NULL) + g_object_set_data(ref, "current_binary", NULL); - g_object_set_data_full(ref, "current_binary", binary, g_object_unref); + else + { + g_object_ref(G_OBJECT(binary)); + g_object_set_data_full(ref, "current_binary", binary, g_object_unref); + } editem_list_for_each(iter, _editem_list) { diff --git a/src/gui/editor.c b/src/gui/editor.c index f8922a1..7322ed7 100644 --- a/src/gui/editor.c +++ b/src/gui/editor.c @@ -41,7 +41,6 @@ #include "panels/panel.h" #include "panels/welcome.h" #include "tb/portions.h" -#include "tb/source.h" #include "../analysis/project.h" #include "../common/extstr.h" #include "../core/params.h" @@ -481,9 +480,6 @@ static GtkWidget *build_editor_toolbar(GObject *ref) g_object_set_data(ref, "toolbar", result); - item = create_source_tb_item(ref); - register_editor_item(item); - item = create_portions_tb_item(ref); register_editor_item(item); @@ -1097,7 +1093,7 @@ void on_panel_item_dock_request(GPanelItem *panel, void *unused) if (!g_welcome_panel_get_user_origin(G_WELCOME_PANEL(welcome))) { /* Equivalent d'un appel "g_panel_item_undock(welcome)", avec effet immédiat */ - on_panel_item_undock_request(welcome, NULL); + /////on_panel_item_undock_request(welcome, NULL); } } diff --git a/src/gui/menus/edition.c b/src/gui/menus/edition.c index 89b5fe9..d5ef541 100644 --- a/src/gui/menus/edition.c +++ b/src/gui/menus/edition.c @@ -37,7 +37,6 @@ #include "../../analysis/db/items/switcher.h" #include "../../arch/target.h" #include "../../gtkext/easygtk.h" -#include "../../gtkext/gtkbufferview.h" diff --git a/src/gui/menus/view.c b/src/gui/menus/view.c index 9447724..2b3f37e 100644 --- a/src/gui/menus/view.c +++ b/src/gui/menus/view.c @@ -25,6 +25,9 @@ #include "view.h" +#include <assert.h> + + #include <i18n.h> @@ -32,6 +35,8 @@ #include "../core/panels.h" #include "../../analysis/project.h" #include "../../gtkext/easygtk.h" +#include "../../gtkext/gtkblockdisplay.h" +#include "../../gtkext/gtkgraphdisplay.h" @@ -100,6 +105,7 @@ GtkWidget *build_menu_view(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *bar) G_CALLBACK(mcb_view_change_support), bar); 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)); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); rgroup = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(submenuitem)); @@ -108,14 +114,7 @@ GtkWidget *build_menu_view(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *bar) G_CALLBACK(mcb_view_change_support), bar); add_accelerator_to_menu_item(submenuitem, "F4", accgroup); g_object_set_data(G_OBJECT(submenuitem), "kind_of_view", GUINT_TO_POINTER(BVW_GRAPH)); - gtk_container_add(GTK_CONTAINER(menubar), submenuitem); - - rgroup = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(submenuitem)); - - submenuitem = qck_create_radio_menu_item(ref, "mnu_view_switch_sourceview", rgroup, _("Source code"), - G_CALLBACK(mcb_view_change_support), bar); - add_accelerator_to_menu_item(submenuitem, "F5", accgroup); - g_object_set_data(G_OBJECT(submenuitem), "kind_of_view", GUINT_TO_POINTER(BVW_SOURCE)); + g_object_set_data(G_OBJECT(submenuitem), "kind_of_display", GSIZE_TO_POINTER(GTK_TYPE_GRAPH_DISPLAY)); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); /* - */ @@ -174,6 +173,9 @@ GtkWidget *build_menu_view(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *bar) void update_menu_view_for_view(GtkWidget *widget, GtkDisplayPanel *panel, GMenuBar *bar) { GObject *ref; /* Espace de référencements */ + 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 */ const bool *display; /* Règles d'affichage courantes*/ @@ -182,6 +184,49 @@ void update_menu_view_for_view(GtkWidget *widget, GtkDisplayPanel *panel, GMenuB ref = g_editor_item_get_global_ref(G_EDITOR_ITEM(bar)); + /* Types de panneau de code */ + + item = GTK_RADIO_MENU_ITEM(g_object_get_data(ref, "mnu_view_switch_graphview")); + + radios = gtk_radio_menu_item_get_group(item); + + void disconnect_display_radio(GtkWidget *wgt, gpointer unused) + { + g_signal_handlers_disconnect_by_func(wgt, G_CALLBACK(mcb_view_change_support), bar); + + } + + g_slist_foreach(radios, (GFunc)disconnect_display_radio, NULL); + + gint find_suitable_display_radio(GObject *rdo, GObject *pnl) + { + GType rdo_type; /* Type d'affichage supporté */ + GType pnl_type; /* Type du panneau affiché */ + + rdo_type = GPOINTER_TO_SIZE(g_object_get_data(rdo, "kind_of_display")); + + pnl_type = G_OBJECT_TYPE(pnl); + + return (rdo_type == pnl_type ? 0 : -1); + + } + + found = g_slist_find_custom(radios, G_OBJECT(panel), (GCompareFunc)find_suitable_display_radio); + + assert(found != NULL); + + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(found->data), TRUE); + + void reconnect_display_radio(GtkWidget *wgt, gpointer unused) + { + g_signal_connect(wgt, "toggled", G_CALLBACK(mcb_view_change_support), bar); + + } + + g_slist_foreach(radios, (GFunc)reconnect_display_radio, NULL); + + /* - */ + binary = g_editor_item_get_current_binary(G_EDITOR_ITEM(bar)); content = gtk_display_panel_describe_content(panel); @@ -246,17 +291,6 @@ void update_access_in_menu_view(GObject *ref, GtkDisplayPanel *panel) access = (panel != NULL); - /* Types de panneau de code */ - - item = GTK_WIDGET(g_object_get_data(ref, "mnu_view_switch_textview")); - gtk_widget_set_sensitive(item, access); - - item = GTK_WIDGET(g_object_get_data(ref, "mnu_view_switch_graphview")); - gtk_widget_set_sensitive(item, access); - - item = GTK_WIDGET(g_object_get_data(ref, "mnu_view_switch_sourceview")); - gtk_widget_set_sensitive(item, access); - /* Affichage des données */ item = GTK_WIDGET(g_object_get_data(ref, "mnu_view_display_off")); @@ -450,7 +484,8 @@ static void mcb_view_change_support(GtkRadioMenuItem *menuitem, GMenuBar *bar) station = get_dock_station_for_view_panel(panel); /* En vue du retrait de la station d'accueil... */ - g_object_ref(G_OBJECT(panel)); + 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); diff --git a/src/gui/status.c b/src/gui/status.c index fc8eafd..daa5f91 100644 --- a/src/gui/status.c +++ b/src/gui/status.c @@ -36,8 +36,7 @@ #include "editem-int.h" #include "core/global.h" #include "../common/extstr.h" -#include "../gtkext/gtkbufferview.h" -#include "../gtkext/gtkblockview.h" +#include "../gtkext/gtkbufferdisplay.h" #include "../gtkext/gtkstatusstack.h" @@ -71,7 +70,7 @@ static void g_status_info_dispose(GStatusInfo *); static void g_status_info_finalize(GStatusInfo *); /* Imprime la position du parcours courant dans le statut. */ -static void track_caret_address_for_status_info(GStatusInfo *, GtkBufferView *, const vmpa2t *); +static void track_caret_address_for_status_info(GStatusInfo *, GtkBufferDisplay *, const vmpa2t *); /* Concentre l'attention de l'ensemble sur une adresse donnée. */ static void focus_address_in_status_info(GStatusInfo *, GLoadedBinary *, const vmpa2t *); @@ -209,9 +208,9 @@ GEditorItem *g_status_info_new(GObject *ref) /****************************************************************************** * * -* Paramètres : info = barre de statut présentant les informations. * -* view = composant d'affichage parcouru. * -* addr = nouvelle adresse du curseur courant. * +* Paramètres : info = barre de statut présentant les informations. * +* display = composant d'affichage parcouru. * +* addr = nouvelle adresse du curseur courant. * * * * Description : Imprime la position du parcours courant dans le statut. * * * @@ -221,7 +220,7 @@ GEditorItem *g_status_info_new(GObject *ref) * * ******************************************************************************/ -static void track_caret_address_for_status_info(GStatusInfo *info, GtkBufferView *view, const vmpa2t *addr) +static void track_caret_address_for_status_info(GStatusInfo *info, GtkBufferDisplay *display, const vmpa2t *addr) { GEditorItem *item; /* Autre version de l'élément */ GLoadedBinary *binary; /* Binaire courant */ @@ -257,7 +256,7 @@ static void focus_address_in_status_info(GStatusInfo *info, GLoadedBinary *binar item = G_EDITOR_ITEM(info); - if (addr == NULL) + if (is_invalid_vmpa(addr)) gtk_status_stack_reset_current_instruction(GTK_STATUS_STACK(item->widget)); else diff --git a/src/gui/tb/Makefile.am b/src/gui/tb/Makefile.am index 60aa031..b8559f7 100644 --- a/src/gui/tb/Makefile.am +++ b/src/gui/tb/Makefile.am @@ -3,7 +3,6 @@ noinst_LTLIBRARIES = libguitb.la libguitb_la_SOURCES = \ portions.h portions.c \ - source.h source.c \ tbitem-int.h \ tbitem.h tbitem.c diff --git a/src/gui/tb/source.c b/src/gui/tb/source.c deleted file mode 100644 index 504c532..0000000 --- a/src/gui/tb/source.c +++ /dev/null @@ -1,321 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * source.c - sélection du fichier ciblé lors d'une décompilation - * - * Copyright (C) 2010-2013 Cyrille Bagard - * - * This file is part of Chrysalide. - * - * Chrysalide 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. - * - * Chrysalide 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 "source.h" - - -#include <i18n.h> - - -#include "tbitem-int.h" -#include "../../format/format.h" -#include "../../gtkext/easygtk.h" -#include "../../gtkext/gtkbufferview.h" -#include "../../gtkext/gtksourceview.h" - - - -/* Elément réactif listant les fichiers décompilés (instance) */ -struct _GSourceTbItem -{ - GToolbarItem parent; /* A laisser en premier */ - -}; - - -/* Elément réactif listant les fichiers décompilés (classe) */ -struct _GSourceTbItemClass -{ - GToolbarItemClass parent; /* A laisser en premier */ - -}; - - - -/* Initialise la classe des éléments réactifs de l'éditeur. */ -static void g_source_tbitem_class_init(GSourceTbItemClass *); - -/* Initialise une instance d'élément réactif pour l'éditeur. */ -static void g_source_tbitem_init(GSourceTbItem *); - -/* Supprime toutes les références externes. */ -static void g_source_tbitem_dispose(GSourceTbItem *); - -/* Procède à la libération totale de la mémoire. */ -static void g_source_tbitem_finalize(GSourceTbItem *); - -/* Réagit à un changement du binaire courant. */ -static void update_source_item_binary(GEditorItem *, GLoadedBinary *); - -/* Réagit à un changement de panneau d'affichage courant. */ -static void update_source_item_view(GEditorItem *, GtkDisplayPanel *); - -/* Réagit à un changement de sélection de la source courante. */ -static void change_selected_source(GtkComboBox *, GSourceTbItem *); - - - -/* Indique le type défini pour une liste de fichiers destinée à une barre d'outils. */ -G_DEFINE_TYPE(GSourceTbItem, g_source_tbitem, G_TYPE_TOOLBAR_ITEM); - - -/****************************************************************************** -* * -* Paramètres : klass = classe à initialiser. * -* * -* Description : Initialise la classe des éléments réactifs de l'éditeur. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -static void g_source_tbitem_class_init(GSourceTbItemClass *klass) -{ - GObjectClass *object; /* Autre version de la classe */ - GEditorItemClass *item; /* Encore une autre vision */ - - object = G_OBJECT_CLASS(klass); - item = G_EDITOR_ITEM_CLASS(klass); - - object->dispose = (GObjectFinalizeFunc/* ! */)g_source_tbitem_dispose; - object->finalize = (GObjectFinalizeFunc)g_source_tbitem_finalize; - - item->update_binary = update_source_item_binary; - item->update_view = update_source_item_view; - -} - - -/****************************************************************************** -* * -* Paramètres : item = instance à initialiser. * -* * -* Description : Initialise une instance d'élément réactif pour l'éditeur. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -static void g_source_tbitem_init(GSourceTbItem *item) -{ - GtkWidget *widget; /* Composant principal */ - GtkWidget *hbox; /* Support interne */ - GtkWidget *label; /* Etiquette d'introduction */ - GtkWidget *comboboxentry; /* Liste de fichiers */ - - widget = GTK_WIDGET(gtk_tool_item_new()); - gtk_widget_show(widget); - - G_EDITOR_ITEM(item)->widget = widget; - - hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8); - gtk_widget_show(hbox); - gtk_container_add(GTK_CONTAINER(widget), hbox); - - label = qck_create_label(G_OBJECT(widget), "label", _(" Source: ")); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); - - comboboxentry = qck_create_combobox2(G_OBJECT(widget), "combo", - G_CALLBACK(change_selected_source), item); - gtk_box_pack_start(GTK_BOX(hbox), comboboxentry, TRUE, TRUE, 0); - -} - - -/****************************************************************************** -* * -* Paramètres : item = instance d'objet GLib à traiter. * -* * -* Description : Supprime toutes les références externes. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -static void g_source_tbitem_dispose(GSourceTbItem *item) -{ - G_OBJECT_CLASS(g_source_tbitem_parent_class)->dispose(G_OBJECT(item)); - -} - - -/****************************************************************************** -* * -* Paramètres : item = instance d'objet GLib à traiter. * -* * -* Description : Procède à la libération totale de la mémoire. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -static void g_source_tbitem_finalize(GSourceTbItem *item) -{ - G_OBJECT_CLASS(g_source_tbitem_parent_class)->finalize(G_OBJECT(item)); - -} - - -/****************************************************************************** -* * -* Paramètres : ref = espace de référencement global. * -* * -* Description : Crée un élément réactif présentant des source de binaire. * -* * -* Retour : Adresse de la structure d'encadrement mise en place. * -* * -* Remarques : - * -* * -******************************************************************************/ - -GEditorItem *create_source_tb_item(GObject *ref) -{ - GSourceTbItem *result; /* Structure à retourner */ - - result = g_object_new(G_TYPE_SOURCE_TBITEM, NULL); - - return g_toolbar_item_setup(G_TOOLBAR_ITEM(result), ref, "source", _("Source files")); - -} - - -/****************************************************************************** -* * -* Paramètres : item = élément réactif sollicité. * -* binary = binaire chargé nouvellement affiché. * -* * -* Description : Réagit à un changement du binaire courant. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -static void update_source_item_binary(GEditorItem *item, GLoadedBinary *binary) -{ -#if 0 - GtkComboBoxText *combo; /* Liste de sélection */ - GtkTreeModel *model; /* Gestionnaire d'éléments */ - GtkTreeIter iter; /* Boucle de parcours #2 */ - GExeFormat *format; /* Format d'exécutable associé */ - size_t count; /* Quantité de fichiers */ - size_t defsrc; /* Fichier source principal */ - const char * const *files; /* Liste de fichiers source */ - size_t i; /* Boucle de parcours #2 */ - - combo = GTK_COMBO_BOX_TEXT(g_object_get_data(G_OBJECT(item->widget), "combo")); - - /* Réinitialisation */ - - g_signal_handlers_block_by_func(combo, G_CALLBACK(change_selected_source), item); - - /* FIXME : 3.0 */ - //gtk_combo_box_text_remove_all(combo); - - model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo)); - - while (gtk_tree_model_get_iter_first(model, &iter)) - gtk_combo_box_text_remove(combo, 0); - - /* Inscriptions */ - - format = g_loaded_binary_get_format(binary); - files = g_binary_format_get_source_files(G_BIN_FORMAT(format), &count, &defsrc); - - for (i = 0; i < count; i++) - gtk_combo_box_text_append_text(combo, files[i]); - - /* Réactivation */ - - g_signal_handlers_unblock_by_func(combo, G_CALLBACK(change_selected_source), item); - - //gtk_combo_box_set_active(combo, defsrc); - - g_object_unref(G_OBJECT(format)); - -#endif -} - - -/****************************************************************************** -* * -* Paramètres : item = élément réactif sollicité. * -* panel = nouveau panneau d'affichage actif. * -* * -* Description : Réagit à un changement de panneau d'affichage courant. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -static void update_source_item_view(GEditorItem *item, GtkDisplayPanel *panel) -{ - gtk_widget_set_sensitive(item->widget, GTK_IS_SOURCE_VIEW(panel)); - -} - - -/****************************************************************************** -* * -* Paramètres : widget = composant GTK en cause. * -* item = élément réactif associé. * -* * -* Description : Réagit à un changement de sélection de la source courante. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -static void change_selected_source(GtkComboBox *widget, GSourceTbItem *item) -{ -#if 0 - gint index; /* Nouvelle source ciblée */ - GLoadedBinary *binary; /* Binaire chargé courant */ - GCodeBuffer *buffer; /* Nouveau tampon à présenter */ - GtkBufferView *view; /* Afficheur de tampons */ - - index = gtk_combo_box_get_active(widget); - - binary = G_LOADED_BINARY(g_object_get_data(ref, "current_binary")); - buffer = g_loaded_binary_get_decompiled_buffer(binary, index); - - view = GTK_BUFFER_VIEW(g_object_get_data(ref, /*"current_view"*/)); /* TODO : utiliser g_editor_item_get_current_view() */ - if (GTK_IS_BUFFER_VIEW(view)) - gtk_buffer_view_attach_buffer(view, buffer, - g_loaded_binary_display_decomp_lines(binary), NULL); -#endif -} diff --git a/src/gui/tb/source.h b/src/gui/tb/source.h deleted file mode 100644 index 760238d..0000000 --- a/src/gui/tb/source.h +++ /dev/null @@ -1,56 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * source.h - prototypes pour la sélection du fichier ciblé lors d'une décompilation - * - * Copyright (C) 2010-2014 Cyrille Bagard - * - * This file is part of Chrysalide. - * - * Chrysalide 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. - * - * Chrysalide 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_TB_SOURCE_H -#define _GUI_TB_SOURCE_H - - -#include "tbitem.h" - - - -#define G_TYPE_SOURCE_TBITEM g_source_tbitem_get_type() -#define G_SOURCE_TBITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_source_tbitem_get_type(), GToolbarItem)) -#define G_IS_SOURCE_TBITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_source_tbitem_get_type())) -#define G_SOURCE_TBITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_SOURCE_TBITEM, GToolbarItemClass)) -#define G_IS_SOURCE_TBITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_SOURCE_TBITEM)) -#define G_SOURCE_TBITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_SOURCE_TBITEM, GToolbarItemClass)) - - -/* Elément réactif listant les fichiers décompilés (instance) */ -typedef struct _GSourceTbItem GSourceTbItem; - -/* Elément réactif listant les fichiers décompilés (classe) */ -typedef struct _GSourceTbItemClass GSourceTbItemClass; - - -/* Indique le type défini pour une liste de fichiers destinée à une barre d'outils. */ -GType g_source_tbitem_get_type(void); - -/* Crée une sélection de fichier réactive pour barre d'outils. */ -GEditorItem *create_source_tb_item(GObject *ref); - - - -#endif /* _GUI_TB_SOURCE_H */ |