diff options
Diffstat (limited to 'src/panels/panel.c')
-rw-r--r-- | src/panels/panel.c | 257 |
1 files changed, 257 insertions, 0 deletions
diff --git a/src/panels/panel.c b/src/panels/panel.c new file mode 100644 index 0000000..6258de8 --- /dev/null +++ b/src/panels/panel.c @@ -0,0 +1,257 @@ + +/* OpenIDA - Outil d'analyse de fichiers binaires + * panels.h - gestion des différents panneaux + * + * Copyright (C) 2006-2007 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 + */ + + +#include "panel.h" + + +#include "glimpse.h" +#include "panel-int.h" +#include "symbols.h" +#include "../gtkext/gtkdockpanel.h" + + + + + +/* Initialise la classe des panneaux d'éditeur. */ +static void g_editor_panel_class_init(GEditorPanelClass *); + +/* Initialise une instance de panneau d'éditeur. */ +static void g_editor_panel_init(GEditorPanel *); + + +/* -------------- */ + + +static GEditorPanel *panels_list = NULL; + + + + +/* Indique le type défini pour un panneau d'éditeur. */ +G_DEFINE_TYPE(GEditorPanel, g_editor_panel, G_TYPE_OBJECT); + + +/****************************************************************************** +* * +* Paramètres : klass = classe à initialiser. * +* * +* Description : Initialise la classe des panneaux d'éditeur. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_editor_panel_class_init(GEditorPanelClass *klass) +{ + +} + + +/****************************************************************************** +* * +* Paramètres : panel = instance à initialiser. * +* * +* Description : Initialise une instance de panneau d'éditeur. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_editor_panel_init(GEditorPanel *panel) +{ + DL_LIST_ITEM_INIT(&panel->link); + +} + + + + + +/****************************************************************************** +* * +* Paramètres : ref = espace de référencements global. * +* binary = nouveau binaire actif. * +* * +* Description : Répercute sur les panneaux un nouveau binaire actif. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void change_current_binary_in_panels(GObject *ref, GOpenidaBinary *binary) +{ + + +} + + + + + + + + +/* -------------- */ +/* -------------- */ +/* -------------- */ + + + + + +/****************************************************************************** +* * +* Paramètres : - * +* * +* Description : Procède au chargement de tous les panneaux internes. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void init_internal_panels(void) +{ + GEditorPanel *panel; /* Nouveau panneau chargé */ + + panel = g_symbols_panel_new(); + panels_list_add_tail(panel, &panels_list); + + panel = g_glimpse_panel_new(); + panels_list_add_tail(panel, &panels_list); + +} + + +/****************************************************************************** +* * +* Paramètres : top = espace courant d'affichage principal. * +* * +* Description : Incruste tous les panneaux dans la fenêtre de l'éditeur. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void place_all_panels_in_editor(GtkWidget *top) +{ + GEditorPanel *iter; /* Boucle de parcours */ + GtkDockItem *ditem; /* Panneau avec ses infos. */ + + panels_list_for_each(iter, panels_list) + { + ditem = gtk_dock_item_new(iter->name, iter->widget); + gtk_dock_panel_add_item(GTK_DOCK_PANEL(top), ditem); + } + +} + + +/****************************************************************************** +* * +* Paramètres : view = nouvelle visualisation de désassemblage. * +* same = changement de binaire ou de vue ? * +* * +* Description : Lance une actualisation du fait d'un changement de vue. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void notify_panels_of_view_change(GtkBinView *view, bool same) +{ + GEditorPanel *iter; /* Boucle de parcours */ + + panels_list_for_each(iter, panels_list) + if (iter->reload_view != NULL) + iter->reload_view(iter, view, same); + +} + + + + + + + +#include "log.h" +#include "registers.h" +#include "strings.h" + + + +static GtkWidget *panel_list[PNT_COUNT]; + + + +/****************************************************************************** +* * +* Paramètres : ref = espace de référencements global. * +* * +* Description : Procède au chargement de tous les panneaux. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void init_panels(GObject *ref) +{ + panel_list[PNT_LOG] = build_log_panel(); + panel_list[PNT_REGISTERS] = build_registers_panel(); + panel_list[PNT_STRINGS] = build_strings_panel(ref); + +} + + +/****************************************************************************** +* * +* Paramètres : id = identifiant du panneau visé. * +* * +* Description : Fournit la référence d'un panneau donné. * +* * +* Retour : Adresse du composant GTK en place. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GtkWidget *get_panel(PanelType id) +{ + return (id < PNT_COUNT ? panel_list[id] : NULL); + +} |