/* Chrysalide - Outil d'analyse de fichiers binaires * panels.h - gestion des différents panneaux * * Copyright (C) 2009-2017 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 "panel.h" #include "breaks.h" #include "glimpse.h" #include "panel-int.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, GLoadedBinary *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_breaks_panel_new(); panels_list_add_tail(panel, &panels_list); //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 : binary = nouvelle instance de binaire analysé. * * * * Description : Lance une actualisation du fait d'un changement de binaire. * * * * Retour : - * * * * Remarques : - * * * ******************************************************************************/ void notify_panels_of_binary_change(GLoadedBinary *binary) { GEditorPanel *iter; /* Boucle de parcours */ panels_list_for_each(iter, panels_list) if (iter->reload_binary != NULL) iter->reload_binary(iter, binary); } /****************************************************************************** * * * Paramètres : panel = 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(GtkDisplayPanel *panel, bool same) { GEditorPanel *iter; /* Boucle de parcours */ panels_list_for_each(iter, panels_list) if (iter->reload_view != NULL) iter->reload_view(iter, panel, same); } #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); }