diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-03-09 18:04:49 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-03-09 18:04:49 (GMT) |
commit | dc8a2b19dbb32bfe49b1ff6640cc609238b392ca (patch) | |
tree | 2103c99baeb3b792bc82fc3db28bd16ecf72b70e /src/gui/core | |
parent | f8f804cf7ff9a62404b843cf303c762101572784 (diff) |
Stored and loaded panels attributes using the global configuration.
Diffstat (limited to 'src/gui/core')
-rwxr-xr-x | src/gui/core/Makefile.am | 1 | ||||
-rw-r--r-- | src/gui/core/core.c | 97 | ||||
-rw-r--r-- | src/gui/core/core.h | 47 | ||||
-rw-r--r-- | src/gui/core/panels.c | 27 | ||||
-rw-r--r-- | src/gui/core/panels.h | 3 |
5 files changed, 163 insertions, 12 deletions
diff --git a/src/gui/core/Makefile.am b/src/gui/core/Makefile.am index 948bd24..2000f58 100755 --- a/src/gui/core/Makefile.am +++ b/src/gui/core/Makefile.am @@ -2,6 +2,7 @@ noinst_LTLIBRARIES = libguicore.la libguicore_la_SOURCES = \ + core.h core.c \ panels.h panels.c libguicore_la_LDFLAGS = $(LIBGTK_LIBS) $(LIBXML_LIBS) diff --git a/src/gui/core/core.c b/src/gui/core/core.c new file mode 100644 index 0000000..16e5cc8 --- /dev/null +++ b/src/gui/core/core.c @@ -0,0 +1,97 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * core.c - chargement et le déchargement du tronc commun pour l'éditeur graphique + * + * Copyright (C) 2016 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * 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 Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include "core.h" + + +#include "panels.h" + + +#include "../../core/params.h" + + + +/****************************************************************************** +* * +* Paramètres : ref = espace de référencement global. * +* * +* Description : Charge les éléments graphiques de l'éditeur. * +* * +* Retour : Bilan de l'opération. * +* * +* Remarques : - * +* * +******************************************************************************/ + +bool load_all_gui_components(GObject *ref) +{ + bool result; /* Bilan à retourner */ + + result = true; + + load_main_panels(ref); + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : config = configuration globale à utiliser. * +* * +* Description : Finalise le chargement des éléments graphiques de l'éditeur. * +* * +* Retour : Bilan de l'opération. * +* * +* Remarques : - * +* * +******************************************************************************/ + +bool complete_loading_of_all_gui_components(GGenConfig *config) +{ + bool result; /* Bilan à faire remonter */ + + result = browse_all_item_panels((handle_panel_item_fc)gtk_panel_item_apply_configuration, config); + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : - * +* * +* Description : Décharge les éléments graphiques de l'éditeur. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void unload_all_gui_components(void) +{ + +} diff --git a/src/gui/core/core.h b/src/gui/core/core.h new file mode 100644 index 0000000..f5ab761 --- /dev/null +++ b/src/gui/core/core.h @@ -0,0 +1,47 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * core.h - prototypes pour le chargement et le déchargement du tronc commun pour l'éditeur graphique + * + * Copyright (C) 2016 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * 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 Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef _GUI_CORE_CORE_H +#define _GUI_CORE_CORE_H + + +#include <glib-object.h> +#include <stdbool.h> + + +#include "../../glibext/configuration.h" + + + +/* Charge les éléments graphiques de l'éditeur. */ +bool load_all_gui_components(GObject *); + +/* Finalise le chargement des éléments graphiques de l'éditeur. */ +bool complete_loading_of_all_gui_components(GGenConfig *); + +/* Décharge les éléments graphiques de l'éditeur. */ +void unload_all_gui_components(void); + + + +#endif /* _GUI_CORE_CORE_H */ diff --git a/src/gui/core/panels.c b/src/gui/core/panels.c index 6b77e92..d8565f4 100644 --- a/src/gui/core/panels.c +++ b/src/gui/core/panels.c @@ -33,6 +33,7 @@ #include "../panels/regedit.h" #include "../panels/strings.h" #include "../panels/symbols.h" +#include "../../core/params.h" #include "../../gtkext/gtkdockable.h" @@ -56,36 +57,40 @@ static GPanelItem *_panels_list = NULL; void load_main_panels(GObject *ref) { + GGenConfig *config; /* Configuration globale */ GPanelItem *item; /* Panneau de base à charger */ + config = get_main_configuration(); + item = g_log_panel_new(); - register_panel_item(item, ref); + register_panel_item(item, ref, config); item = g_regedit_panel_new(); - register_panel_item(item, ref); + register_panel_item(item, ref, config); item = g_symbols_panel_new(); - register_panel_item(item, ref); + register_panel_item(item, ref, config); item = g_history_panel_new(); - register_panel_item(item, ref); + register_panel_item(item, ref, config); item = g_strings_panel_new(); - register_panel_item(item, ref); + register_panel_item(item, ref, config); item = g_glance_panel_new(); - register_panel_item(item, ref); + register_panel_item(item, ref, config); item = g_bookmarks_panel_new(); - register_panel_item(item, ref); + register_panel_item(item, ref, config); } /****************************************************************************** * * -* Paramètres : item = composant à présenter à l'affichage. * -* ref = espace de référencement global. * +* Paramètres : item = composant à présenter à l'affichage. * +* ref = espace de référencement global. * +* config = configuration à compléter. * * * * Description : Enregistre un panneau comme partie intégrante de l'éditeur. * * * @@ -95,7 +100,7 @@ void load_main_panels(GObject *ref) * * ******************************************************************************/ -void register_panel_item(GPanelItem *item, GObject *ref) +void register_panel_item(GPanelItem *item, GObject *ref, GGenConfig *config) { GEditorItem *parent; /* Autre version de l'élément */ @@ -116,7 +121,7 @@ void register_panel_item(GPanelItem *item, GObject *ref) gtk_dockable_setup_dnd(GTK_DOCKABLE(item)); - g_panel_item_dock(item); + gtk_panel_item_setup_configuration(item, config); } diff --git a/src/gui/core/panels.h b/src/gui/core/panels.h index 1a8f9d8..07ce133 100644 --- a/src/gui/core/panels.h +++ b/src/gui/core/panels.h @@ -30,6 +30,7 @@ #include "../panels/panel.h" +#include "../../glibext/configuration.h" @@ -37,7 +38,7 @@ void load_main_panels(GObject *); /* Enregistre un panneau comme partie intégrante de l'éditeur. */ -void register_panel_item(GPanelItem *, GObject *); +void register_panel_item(GPanelItem *, GObject *, GGenConfig *); /* Réalise un traitement sur un panneau de l'éditeur. */ typedef bool (* handle_panel_item_fc) (GPanelItem *, void *); |