summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/Makefile.am2
-rw-r--r--src/gui/core/core.c6
-rw-r--r--src/gui/core/logs.c32
-rw-r--r--src/gui/core/panels.c342
-rw-r--r--src/gui/core/panels.h58
-rw-r--r--src/gui/dialogs/Makefile.am2
-rw-r--r--src/gui/dialogs/about-int.h14
-rw-r--r--src/gui/dialogs/about.c57
-rw-r--r--src/gui/dialogs/about.css9
-rw-r--r--src/gui/dialogs/about.ui80
-rw-r--r--src/gui/dialogs/gresource.xml16
-rw-r--r--src/gui/dialogs/preferences.c27
-rw-r--r--src/gui/dialogs/prefs/Makefile.am3
-rw-r--r--src/gui/dialogs/prefs/appearance-int.h64
-rw-r--r--src/gui/dialogs/prefs/appearance.c251
-rw-r--r--src/gui/dialogs/prefs/appearance.h41
-rw-r--r--src/gui/dialogs/prefs/appearance.ui184
-rw-r--r--src/gui/dialogs/prefs/gresource.xml1
-rw-r--r--src/gui/dialogs/prefs/security-int.h4
-rw-r--r--src/gui/dialogs/prefs/security.c4
-rw-r--r--src/gui/panel-int.h71
-rw-r--r--src/gui/panel.c1207
-rw-r--r--src/gui/panel.h148
-rw-r--r--src/gui/panels/Makefile.am12
-rw-r--r--src/gui/panels/binary-int.h23
-rw-r--r--src/gui/panels/binary-launch.ui65
-rw-r--r--src/gui/panels/binary-params-int.h50
-rw-r--r--src/gui/panels/binary-params.c178
-rw-r--r--src/gui/panels/binary-params.h41
-rw-r--r--src/gui/panels/binary-params.ui (renamed from src/gui/panels/binary-props.ui)11
-rw-r--r--src/gui/panels/binary.c346
-rw-r--r--src/gui/panels/binary.h17
-rw-r--r--src/gui/panels/gresource.xml6
-rw-r--r--src/gui/panels/log.c451
-rw-r--r--src/gui/panels/log.h67
-rw-r--r--src/gui/panels/log.ui59
-rw-r--r--src/gui/panels/logs-col-icon.ui17
-rw-r--r--src/gui/panels/logs-col-message.ui19
-rw-r--r--src/gui/panels/logs-int.h53
-rw-r--r--src/gui/panels/logs.c227
-rw-r--r--src/gui/panels/logs.h47
-rw-r--r--src/gui/panels/logs.ui58
-rw-r--r--src/gui/panels/welcome-int.h28
-rw-r--r--src/gui/panels/welcome.c379
-rw-r--r--src/gui/panels/welcome.h21
-rw-r--r--src/gui/style.css18
-rw-r--r--src/gui/window-int.h5
-rw-r--r--src/gui/window.c282
-rw-r--r--src/gui/window.h8
-rw-r--r--src/gui/window.ui20
50 files changed, 2033 insertions, 3098 deletions
diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am
index 42761c4..be70445 100644
--- a/src/gui/Makefile.am
+++ b/src/gui/Makefile.am
@@ -26,8 +26,6 @@ libgui_la_CFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS)
libgui4_la_SOURCES = \
- panel-int.h \
- panel.h panel.c \
resources.h resources.c \
window-int.h \
window.h window.c
diff --git a/src/gui/core/core.c b/src/gui/core/core.c
index 4a6809c..57a398a 100644
--- a/src/gui/core/core.c
+++ b/src/gui/core/core.c
@@ -2,7 +2,7 @@
/* Chrysalide - Outil d'analyse de fichiers binaires
* core.c - chargement et le déchargement du tronc commun pour l'éditeur graphique
*
- * Copyright (C) 2016-2019 Cyrille Bagard
+ * Copyright (C) 2016-2025 Cyrille Bagard
*
* This file is part of Chrysalide.
*
@@ -63,7 +63,7 @@ bool load_gui_components(AvailableGuiComponent flags)
if ((flags & AGC_PANELS) != 0 && (__loaded & AGC_PANELS) == 0)
{
- result = load_main_panels();
+ result = load_main_framework_panel_definitions();
if (!result) goto done;
__loaded |= AGC_PANELS;
@@ -93,7 +93,7 @@ void unload_gui_components(AvailableGuiComponent flags)
{
if ((flags & AGC_PANELS) != 0 && (__loaded & AGC_PANELS) == 0)
{
- unload_all_panels();
+ unload_all_framework_panel_definitions();
__loaded &= ~AGC_PANELS;
diff --git a/src/gui/core/logs.c b/src/gui/core/logs.c
index 59910f1..cdb2a0d 100644
--- a/src/gui/core/logs.c
+++ b/src/gui/core/logs.c
@@ -24,6 +24,14 @@
#include "logs.h"
+#include <assert.h>
+
+
+#include "panels.h"
+#include "../panels/logs.h"
+#include "../../glibext/log.h"
+
+
/******************************************************************************
* *
@@ -38,26 +46,20 @@
* *
******************************************************************************/
-void do_log_message_alt2(LogMessageType type, const char *msg)
+void do_log_message_alt(LogMessageType type, const char *msg)
{
-#if 0
-
-#ifdef INCLUDE_GTK_SUPPORT
-
- GEditorItem *item; /* Eventuel affichage présent */
+ GLogEntry *entry; /* Nouvel élément de journal */
+ GtkTiledPanel *panel; /* Panneau de journalisation */
- item = find_editor_item_by_type(G_TYPE_LOG_PANEL);
+ entry = g_log_entry_new(type, msg);
- if (item != NULL)
- {
- g_log_panel_add_message(G_LOG_PANEL(item), type, msg);
- g_object_unref(G_OBJECT(item));
- }
+ panel = get_framework_panel_singleton(GTK_TYPE_LOGS_PANEL);
+ assert(panel != NULL);
-#endif
+ g_log_panel_add_message(GTK_LOGS_PANEL(panel), entry);
-#endif
+ unref_object(panel);
- printf("[log GUI] [%u] %s\n", type, msg);
+ unref_object(entry);
}
diff --git a/src/gui/core/panels.c b/src/gui/core/panels.c
index 69ab2aa..9fca411 100644
--- a/src/gui/core/panels.c
+++ b/src/gui/core/panels.c
@@ -2,7 +2,7 @@
/* Chrysalide - Outil d'analyse de fichiers binaires
* panels.c - gestion d'ensemble de tous les panneaux graphiques du framework
*
- * Copyright (C) 2016-2024 Cyrille Bagard
+ * Copyright (C) 2016-2025 Cyrille Bagard
*
* This file is part of Chrysalide.
*
@@ -25,25 +25,138 @@
#include "panels.h"
+#include <assert.h>
#include <malloc.h>
+#include <string.h>
+
+
+#include <i18n.h>
#include "../panels/binary.h"
+#include "../panels/binary-params.h"
+#include "../panels/logs.h"
#include "../panels/welcome.h"
+#include "../../gtkext/launcher.h"
+
+
+
+/* Définition générique complète d'un panneau */
+typedef struct _ext_panel_info_t
+{
+ /* Début des champs copiés de panel_info_t */
+
+ char *category; /* Groupe de rassemblement */
+
+ char *image; /* Eventuelle image associée */
+ char *title; /* Désignation humaine */
+ char *desc; /* Description humaine */
+
+ FrameworkPanelPersonality personality; /* Comportement attendu */
+
+ GType panel_type; /* Type du panneau représenté */
+ GType params_type; /* Composant de paramètre */
+ /* Fin des champs copiés de panel_info_t */
+
+ GtkTiledPanel *singleton; /* Conservation des allocations*/
+
+} ext_panel_info_t;
/* Liste des panneaux disponibles */
-static GPanelItem **_panels_list = NULL;
+static ext_panel_info_t **_panels_list = NULL;
static size_t _panels_count = 0;
+/* Copie une définition basique de panneau graphqiue. */
+static ext_panel_info_t *copy_panel_info(const panel_info_t *);
+
+/* Efface une définition étendue de panneau graphique. */
+static void delete_panel_info(ext_panel_info_t *);
+
+
+
+/******************************************************************************
+* *
+* Paramètres : info = information de base à copier. *
+* *
+* Description : Copie une définition basique de panneau graphqiue. *
+* *
+* Retour : Structure mémorisant l'ensemble des informations. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static ext_panel_info_t *copy_panel_info(const panel_info_t *info)
+{
+ ext_panel_info_t *result; /* Structure à retourner */
+
+ result = calloc(1, sizeof(ext_panel_info_t));
+
+ if (info->category != NULL)
+ result->category = strdup(info->category);
+
+ if (info->image != NULL)
+ result->image = strdup(info->image);
+
+ result->title = strdup(info->title);
+
+ if (info->desc != NULL)
+ result->desc = strdup(info->desc);
+
+ result->personality = info->personality;
+
+ result->panel_type = info->panel_type;
+ result->params_type = info->params_type;
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : info = informations à supprimer de la mémoire. *
+* *
+* Description : Efface une définition étendue de panneau graphique. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void delete_panel_info(ext_panel_info_t *info)
+{
+ if (info->category != NULL)
+ free(info->category);
+
+ if (info->image != NULL)
+ free(info->image);
+
+ free(info->title);
+
+ if (info->desc != NULL)
+ free(info->desc);
+
+ if (info->singleton != NULL)
+ {
+ assert(info->personality & FPP_SINGLETON);
+ unref_object(info->singleton);
+ }
+
+ free(info);
+
+}
+
/******************************************************************************
* *
* Paramètres : - *
* *
-* Description : Charge les principaux panneaux graphiques du framework. *
+* Description : Charge les définitions des principaux panneaux du framework. *
* *
* Retour : Bilan de l'opération. *
* *
@@ -51,19 +164,60 @@ static size_t _panels_count = 0;
* *
******************************************************************************/
-bool load_main_panels(void)
+bool load_main_framework_panel_definitions(void)
{
bool result; /* Bilan à retourner */
+ panel_info_t info; /* Infos d'enregistrement */
- result = true;
+ /* Chargement du panneau de rapport au plus tôt */
- // TODO register_panel_item(G_TYPE_LOG_PANEL, config);
+ info.category = NULL;
- /* Chargement du panneau de rapport au plus tôt */
- // TODO panel = g_panel_item_new(G_TYPE_LOG_PANEL, NULL);
+ info.image = NULL;
+ info.title = _("Logs");
+ info.desc = NULL;
+
+ info.personality = FPP_SINGLETON;
+
+ info.panel_type = GTK_TYPE_LOGS_PANEL;
+ info.params_type = G_TYPE_INVALID;
+
+ result = register_framework_panel_definition(&info);
+ if (!result) goto done;
+
+ /* Chargements des panneaux restants */
+
+ info.category = "Main";
+
+ info.image = "binfile-symbolic";
+ info.title = _("Binary analysis");
+ info.desc = _("Load a binary content and parse its format if recognized");
+
+ info.personality = FPP_MAIN_PANEL;
+
+ info.panel_type = GTK_TYPE_BINARY_PANEL;
+ info.params_type = GTK_TYPE_BINARY_PARAMETERS;
+
+ result = register_framework_panel_definition(&info);
+ if (!result) goto done;
+
+ /* --- */
+
+ info.category = NULL;
+
+ info.image = NULL;
+ info.title = _("Welcome");
+ info.desc = NULL;
+
+ info.personality = FPP_MAIN_PANEL | FPP_SINGLETON;
+
+ info.panel_type = GTK_TYPE_WELCOME_PANEL;
+ info.params_type = G_TYPE_INVALID;
- register_panel_item(g_binary_panel_new());
- register_panel_item(g_welcome_panel_new());
+ result = register_framework_panel_definition(&info);
+ if (!result) goto done;
+
+ done:
return result;
@@ -82,12 +236,12 @@ bool load_main_panels(void)
* *
******************************************************************************/
-void unload_all_panels(void)
+void unload_all_framework_panel_definitions(void)
{
size_t i; /* Boucle de parcours */
for (i = 0; i < _panels_count; i++)
- unref_object(_panels_list[i]);
+ delete_panel_info(_panels_list[i]);
_panels_list = NULL;
_panels_count = 0;
@@ -97,10 +251,9 @@ void unload_all_panels(void)
/******************************************************************************
* *
-* Paramètres : type = type du composant à présenter à l'affichage. *
-* config = configuration à compléter. *
+* Paramètres : info = information de base à copier. *
* *
-* Description : Enregistre un panneau comme partie intégrante de l'éditeur. *
+* Description : Enregistre la définition d'un panneau graphique. *
* *
* Retour : - *
* *
@@ -108,11 +261,36 @@ void unload_all_panels(void)
* *
******************************************************************************/
-void register_panel_item(/* __steal */ GPanelItem *item)
+bool register_framework_panel_definition(const panel_info_t *info)
{
- _panels_list = realloc(_panels_list, ++_panels_count * sizeof(GPanelItem *));
+ bool result; /* Bilan à retourner */
+ size_t i; /* Boucle de parcours */
+ ext_panel_info_t *ext_info; /* Informations conservées */
+
+ result = false;
+
+ /* Validation */
+
+ for (i = 0; i < _panels_count; i++)
+ if (_panels_list[i]->panel_type == info->panel_type)
+ break;
+
+ if (i < _panels_count)
+ goto done;
+
+ /* Enregistrement */
- _panels_list[_panels_count - 1] = item;
+ ext_info = copy_panel_info(info);
+
+ _panels_list = realloc(_panels_list, ++_panels_count * sizeof(ext_panel_info_t *));
+
+ _panels_list[_panels_count - 1] = ext_info;
+
+ result = true;
+
+ done:
+
+ return result;
}
@@ -121,7 +299,44 @@ void register_panel_item(/* __steal */ GPanelItem *item)
* *
* Paramètres : target = type de définition de panneau recherchée. *
* *
-* Description : Retrouve la définition d'un type de panneau. *
+* Description : Récupère les particularités d'un panneau graphique. *
+* *
+* Retour : Détails du comportement associé au panneau visé. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+FrameworkPanelPersonality get_framework_panel_personality(GType target)
+{
+ FrameworkPanelPersonality result; /* Propriétées à retourner */
+ size_t i; /* Boucle de parcours */
+ ext_panel_info_t *info; /* Informations conservées */
+
+ result = FPP_NONE;
+
+ for (i = 0; i < _panels_count; i++)
+ {
+ info = _panels_list[i];
+
+ if (info->panel_type == target)
+ {
+ result = info->personality;
+ break;
+ }
+
+ }
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : target = type de définition de panneau recherchée. *
+* *
+* Description : Met en place (au besoin) un panneau graphique unique. *
* *
* Retour : Instance de définition identifiée ou NULL en cas d'échec. *
* *
@@ -129,23 +344,27 @@ void register_panel_item(/* __steal */ GPanelItem *item)
* *
******************************************************************************/
-GPanelItem *find_item_panel_by_type(GType target)
+GtkTiledPanel *get_framework_panel_singleton(GType target)
{
- GPanelItem *result; /* Instance à renvoyer */
+ GtkTiledPanel *result; /* Instance à renvoyer */
size_t i; /* Boucle de parcours */
- GPanelItem *item; /* Définition de panneau */
+ ext_panel_info_t *info; /* Informations conservées */
result = NULL;
for (i = 0; i < _panels_count; i++)
{
- item = _panels_list[i];
+ info = _panels_list[i];
- if (G_OBJECT_TYPE(item) == target)
+ if (info->panel_type == target)
{
- result = item;
+ if (info->singleton == NULL)
+ info->singleton = g_object_new(target, NULL);
+
+ result = info->singleton;
ref_object(result);
break;
+
}
}
@@ -157,39 +376,84 @@ GPanelItem *find_item_panel_by_type(GType target)
/******************************************************************************
* *
-* Paramètres : skip = saute le panneau d'accueil lors du parcours ? *
-* handle = routine à appeler pour chaque panneau. *
-* data = données fournies pour accompagner cet appel. *
+* Paramètres : list = liste à compléter. *
* *
-* Description : Effectue le parcours de tous les panneaux chargés. *
+* Description : Intègre une définition de panneau enregistrée. *
* *
-* Retour : true si le parcours a été total, false sinon. *
+* Retour : true pour un parcours complet de la liste des définitions. *
* *
* Remarques : - *
* *
******************************************************************************/
-bool browse_all_item_panels(bool skip, handle_panel_item_fc handle, void *data)
+void populate_framework_panel_launcher_list(GtkListBox *list)
{
- bool result; /* Résultat à renvoyer */
size_t i; /* Boucle de parcours */
- GPanelItem *item; /* Définition de panneau */
-
- result = true;
+ ext_panel_info_t *info; /* Informations conservées */
+ GtkPanelLauncher *launcher; /* Lanceur à intégrer */
for (i = 0; i < _panels_count; i++)
{
- item = _panels_list[i];
+ info = _panels_list[i];
- if (skip && G_OBJECT_TYPE(item) == G_TYPE_WELCOME_PANEL)
+ if (info->category == NULL)
continue;
- result = handle(item, data);
+ launcher = gtk_panel_launcher_new(info->image, info->title, info->desc);
+
+ g_object_set_data(G_OBJECT(launcher), "panel_type", GSIZE_TO_POINTER(info->panel_type));
+
+ gtk_list_box_append(list, GTK_WIDGET(launcher));
+
+ }
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : row = lanceur sélectionné. *
+* *
+* Description : Fournit un composant d'édition de paramètres de panneau. *
+* *
+* Retour : Composant d'édition de paramètres ou NULL. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GtkWidget *get_framework_panel_parameters(GtkListBoxRow *row)
+{
+ GtkWidget *result; /* Composant à retourner */
+ gpointer *data; /* Valeur incrustée */
+ GType target; /* Type de panneau recherché */
+ ext_panel_info_t *info; /* Informations conservées */
+ size_t i; /* Boucle de parcours */
- if (!result) break;
+ data = g_object_get_data(G_OBJECT(row), "panel_type");
+ assert(data != NULL);
+
+ target = GPOINTER_TO_SIZE(data);
+
+ info = NULL;
+
+ for (i = 0; i < _panels_count; i++)
+ {
+ info = _panels_list[i];
+
+ if (info->panel_type == target)
+ break;
}
+ assert(info != NULL);
+ assert(i < _panels_count);
+
+ if (info->params_type == G_TYPE_INVALID)
+ result = NULL;
+ else
+ result = g_object_new(info->params_type, NULL);
+
return result;
}
diff --git a/src/gui/core/panels.h b/src/gui/core/panels.h
index aaea9e6..e17ef8a 100644
--- a/src/gui/core/panels.h
+++ b/src/gui/core/panels.h
@@ -2,7 +2,7 @@
/* Chrysalide - Outil d'analyse de fichiers binaires
* panels.h - prototypes pour la gestion d'ensemble de tous les panneaux graphiques du framework
*
- * Copyright (C) 2016-2024 Cyrille Bagard
+ * Copyright (C) 2016-2025 Cyrille Bagard
*
* This file is part of Chrysalide.
*
@@ -26,30 +26,62 @@
#define _GUI_CORE_PANELS_H
+#include <glib-object.h>
#include <stdbool.h>
+#include <gtk/gtk.h>
-#include "../panel.h"
+#include "../../gtkext/panel.h"
-/* Charge les principaux panneaux graphiques du framework. */
-bool load_main_panels(void);
+/* Types de panneaux pour éditeur */
+typedef enum _FrameworkPanelPersonality
+{
+ FPP_NONE = (0 << 0), /* Pas de particularité */
+
+ FPP_MAIN_PANEL = (1 << 0), /* Panneau principal */
+ FPP_SINGLETON = (1 << 1), /* Instance unique */
+
+} FrameworkPanelPersonality;
+
+/* Définition générique d'un panneau */
+typedef struct _panel_info_t
+{
+ const char *category; /* Groupe de rassemblement */
+
+ const char *image; /* Eventuelle image associée */
+ const char *title; /* Désignation humaine */
+ const char *desc; /* Description humaine */
+
+ FrameworkPanelPersonality personality; /* Comportement attendu */
+
+ GType panel_type; /* Type du panneau représenté */
+ GType params_type; /* Composant de paramètre */
+
+} panel_info_t;
+
+
+/* Charge les définitions des principaux panneaux du framework. */
+bool load_main_framework_panel_definitions(void);
/* Décharge tous les panneaux graphiques du framework. */
-void unload_all_panels(void);
+void unload_all_framework_panel_definitions(void);
+
+/* Enregistre la définition d'un panneau graphique. */
+bool register_framework_panel_definition(const panel_info_t *);
-/* Enregistre un panneau comme partie intégrante de l'éditeur. */
-void register_panel_item(/* __steal */ GPanelItem *);
+/* Récupère les particularités d'un panneau graphique. */
+FrameworkPanelPersonality get_framework_panel_personality(GType);
-/* Retrouve la définition d'un type de panneau. */
-GPanelItem *find_item_panel_by_type(GType);
+/* Met en place (au besoin) un panneau graphique unique. */
+GtkTiledPanel *get_framework_panel_singleton(GType);
-/* Réalise un traitement sur un panneau de l'éditeur. */
-typedef bool (* handle_panel_item_fc) (GPanelItem *, void *);
+/* Intègre une définition de panneau enregistrée. */
+void populate_framework_panel_launcher_list(GtkListBox *);
-/* Effectue le parcours de tous les panneaux chargés. */
-bool browse_all_item_panels(bool, handle_panel_item_fc, void *);
+/* Fournit un composant d'édition de paramètres de panneau. */
+GtkWidget *get_framework_panel_parameters(GtkListBoxRow *);
diff --git a/src/gui/dialogs/Makefile.am b/src/gui/dialogs/Makefile.am
index e910c96..3492f63 100644
--- a/src/gui/dialogs/Makefile.am
+++ b/src/gui/dialogs/Makefile.am
@@ -3,7 +3,9 @@ BUILT_SOURCES = resources.h resources.c
noinst_LTLIBRARIES = libguidialogs.la
+
UI_FILES = \
+ about.css \
about.ui \
preferences.ui
# bookmark.ui \
diff --git a/src/gui/dialogs/about-int.h b/src/gui/dialogs/about-int.h
index 616c73f..96a470e 100644
--- a/src/gui/dialogs/about-int.h
+++ b/src/gui/dialogs/about-int.h
@@ -37,20 +37,6 @@ struct _GtkAppAboutDialog
{
GtkWindow parent; /* A laisser en premier */
- union
- {
- struct
- {
- GtkPicture *revision_0; /* Numéro #0 */
- GtkPicture *revision_1; /* Numéro #1 */
- GtkPicture *revision_2; /* Numéro #2 */
- GtkPicture *revision_3; /* Numéro #3 */
- GtkPicture *revision_4; /* Numéro #4 */
- GtkPicture *revision_5; /* Numéro #5 */
- };
- GtkPicture *revisions[6]; /* Tous les numéros d'un coup */
- };
-
};
/* Boîte "A propos de" dédiée à l'application (classe) */
diff --git a/src/gui/dialogs/about.c b/src/gui/dialogs/about.c
index 956918b..1dca752 100644
--- a/src/gui/dialogs/about.c
+++ b/src/gui/dialogs/about.c
@@ -44,10 +44,10 @@ static void gtk_app_about_dialog_class_init(GtkAppAboutDialogClass *);
static void gtk_app_about_dialog_init(GtkAppAboutDialog *);
/* Supprime toutes les références externes. */
-static void gtk_app_about_dialog_dispose(GtkAppAboutDialog *);
+static void gtk_app_about_dialog_dispose(GObject *);
/* Procède à la libération totale de la mémoire. */
-static void gtk_app_about_dialog_finalize(GtkAppAboutDialog *);
+static void gtk_app_about_dialog_finalize(GObject *);
@@ -74,22 +74,17 @@ static void gtk_app_about_dialog_class_init(GtkAppAboutDialogClass *class)
object = G_OBJECT_CLASS(class);
- object->dispose = (GObjectFinalizeFunc/* ! */)gtk_app_about_dialog_dispose;
- object->finalize = (GObjectFinalizeFunc)gtk_app_about_dialog_finalize;
+ object->dispose = gtk_app_about_dialog_dispose;
+ object->finalize = gtk_app_about_dialog_finalize;
widget = GTK_WIDGET_CLASS(class);
+ gtk_widget_class_set_css_name(widget, "aboutdialog");
+
gtk_widget_class_add_binding_action(widget, GDK_KEY_Escape, 0, "window.close", NULL);
gtk_widget_class_set_template_from_resource(widget, "/re/chrysalide/framework/gui/dialogs/about.ui");
- gtk_widget_class_bind_template_child(widget, GtkAppAboutDialog, revision_0);
- gtk_widget_class_bind_template_child(widget, GtkAppAboutDialog, revision_1);
- gtk_widget_class_bind_template_child(widget, GtkAppAboutDialog, revision_2);
- gtk_widget_class_bind_template_child(widget, GtkAppAboutDialog, revision_3);
- gtk_widget_class_bind_template_child(widget, GtkAppAboutDialog, revision_4);
- gtk_widget_class_bind_template_child(widget, GtkAppAboutDialog, revision_5);
-
}
@@ -107,40 +102,14 @@ static void gtk_app_about_dialog_class_init(GtkAppAboutDialogClass *class)
static void gtk_app_about_dialog_init(GtkAppAboutDialog *dialog)
{
- unsigned int revision; /* Numéro de révision */
- unsigned int max; /* Nbre. de boucles à effectuer*/
- unsigned int i; /* Boucle de parcours */
- unsigned int level; /* Unité la plus importante */
- char buffer[64]; /* Nom d'image à forger */
-
gtk_widget_init_template(GTK_WIDGET(dialog));
- revision = REVISION;
- max = log(revision) / log(10);
-
- assert(max <= 6);
-
- for (i = 0; i <= max; i++)
- {
- level = pow(10, max - i);
-
- snprintf(buffer, 64, "/org/chrysalide/gui/dialogs/about/revision_%u.png", revision / level);
-
- gtk_picture_set_resource(dialog->revisions[i], buffer);
-
- revision %= level;
-
- }
-
- for (; i < 6; i++)
- gtk_widget_set_visible(GTK_WIDGET(dialog->revisions[i]), FALSE);
-
}
/******************************************************************************
* *
-* Paramètres : dialog = instance d'objet GLib à traiter. *
+* Paramètres : object = instance d'objet GLib à traiter. *
* *
* Description : Supprime toutes les références externes. *
* *
@@ -150,18 +119,18 @@ static void gtk_app_about_dialog_init(GtkAppAboutDialog *dialog)
* *
******************************************************************************/
-static void gtk_app_about_dialog_dispose(GtkAppAboutDialog *dialog)
+static void gtk_app_about_dialog_dispose(GObject *object)
{
- gtk_widget_dispose_template(GTK_WIDGET(dialog), GTK_TYPE_APP_ABOUT_DIALOG);
+ gtk_widget_dispose_template(GTK_WIDGET(object), GTK_TYPE_APP_ABOUT_DIALOG);
- G_OBJECT_CLASS(gtk_app_about_dialog_parent_class)->dispose(G_OBJECT(dialog));
+ G_OBJECT_CLASS(gtk_app_about_dialog_parent_class)->dispose(object);
}
/******************************************************************************
* *
-* Paramètres : dialog = instance d'objet GLib à traiter. *
+* Paramètres : object = instance d'objet GLib à traiter. *
* *
* Description : Procède à la libération totale de la mémoire. *
* *
@@ -171,9 +140,9 @@ static void gtk_app_about_dialog_dispose(GtkAppAboutDialog *dialog)
* *
******************************************************************************/
-static void gtk_app_about_dialog_finalize(GtkAppAboutDialog *dialog)
+static void gtk_app_about_dialog_finalize(GObject *object)
{
- G_OBJECT_CLASS(gtk_app_about_dialog_parent_class)->finalize(G_OBJECT(dialog));
+ G_OBJECT_CLASS(gtk_app_about_dialog_parent_class)->finalize(object);
}
diff --git a/src/gui/dialogs/about.css b/src/gui/dialogs/about.css
new file mode 100644
index 0000000..af3fa97
--- /dev/null
+++ b/src/gui/dialogs/about.css
@@ -0,0 +1,9 @@
+
+aboutdialog > box {
+
+ background-color: black;
+
+ background-image: url('resource:///re/chrysalide/framework/gui/dialogs/about/bg.png');
+ background-repeat: no-repeat;
+
+}
diff --git a/src/gui/dialogs/about.ui b/src/gui/dialogs/about.ui
index 989e53b..7b519d2 100644
--- a/src/gui/dialogs/about.ui
+++ b/src/gui/dialogs/about.ui
@@ -8,91 +8,13 @@
<property name="modal">true</property>
<property name="resizable">false</property>
- <style>
- <class name="black-bg"/>
- </style>
-
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
- <child>
- <object class="GtkPicture" id="logo">
- <property name="margin-top">10</property>
- <property name="file">resource://org/chrysalide/gui/dialogs/about/chrysalide-full.png</property>
- </object>
- </child>
-
- <!--
- Etage intermédiaire pour ne pas que l'image se voie allouer la largeur entière
- de la fenêtre. Sinon des marges sont placées autour du rendu lors que l'image
- n'est pas étendue pour couvrir cette largeur entière.
- -->
- <child>
- <object class="GtkBox">
- <property name="orientation">horizontal</property>
- <property name="halign">center</property>
- <property name="margin-top">14</property>
- <child>
- <object class="GtkPicture" id="text">
- <property name="width-request">253</property>
- <property name="file">resource:///org/chrysalide/gui/dialogs/about/chrysalide_text.png</property>
- </object>
- </child>
- </object>
- </child>
-
- <child>
- <object class="GtkBox">
- <property name="orientation">horizontal</property>
- <property name="margin-start">149</property>
- <child>
- <object class="GtkPicture" id="revision">
- <property name="width-request">14</property>
- <property name="file">resource:///org/chrysalide/gui/dialogs/about/revision.png</property>
- </object>
- </child>
- <child>
- <object class="GtkPicture" id="revision_0">
- <property name="width-request">14</property>
- <property name="file">resource:///org/chrysalide/gui/dialogs/about/revision.png</property>
- </object>
- </child>
- <child>
- <object class="GtkPicture" id="revision_1">
- <property name="width-request">14</property>
- <property name="file">resource:///org/chrysalide/gui/dialogs/about/revision.png</property>
- </object>
- </child>
- <child>
- <object class="GtkPicture" id="revision_2">
- <property name="width-request">14</property>
- <property name="file">resource:///org/chrysalide/gui/dialogs/about/revision.png</property>
- </object>
- </child>
- <child>
- <object class="GtkPicture" id="revision_3">
- <property name="width-request">14</property>
- <property name="file">resource:///org/chrysalide/gui/dialogs/about/revision.png</property>
- </object>
- </child>
- <child>
- <object class="GtkPicture" id="revision_4">
- <property name="width-request">14</property>
- <property name="file">resource:///org/chrysalide/gui/dialogs/about/revision.png</property>
- </object>
- </child>
- <child>
- <object class="GtkPicture" id="revision_5">
- <property name="width-request">14</property>
- <property name="file">resource:///org/chrysalide/gui/dialogs/about/revision.png</property>
- </object>
- </child>
- </object>
- </child>
<child>
<object class="GtkLabel">
- <property name="margin-top">22</property>
+ <property name="margin-top">368</property>
<property name="margin-bottom">10</property>
<property name="label" translatable="yes">&lt;span fgcolor='white'&gt;Copyright (C) 2008-2025 Cyrille Bagard&lt;/span&gt;</property>
<property name="use-markup">True</property>
diff --git a/src/gui/dialogs/gresource.xml b/src/gui/dialogs/gresource.xml
index 169f440..966d9c8 100644
--- a/src/gui/dialogs/gresource.xml
+++ b/src/gui/dialogs/gresource.xml
@@ -1,22 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/re/chrysalide/framework/gui/dialogs">
+ <file compressed="true">about.css</file>
<file compressed="true">about.ui</file>
<file compressed="true">preferences.ui</file>
</gresource>
- <gresource prefix="/org/chrysalide/gui/dialogs/about">
- <file compressed="true" alias="chrysalide-full.png">../../../pixmaps/chrysalide-full.png</file>
- <file compressed="true" alias="chrysalide_text.png">../../../pixmaps/chrysalide_text.png</file>
- <file compressed="true" alias="revision.png">../../../pixmaps/revision.png</file>
- <file compressed="true" alias="revision_0.png">../../../pixmaps/revision_0.png</file>
- <file compressed="true" alias="revision_1.png">../../../pixmaps/revision_1.png</file>
- <file compressed="true" alias="revision_2.png">../../../pixmaps/revision_2.png</file>
- <file compressed="true" alias="revision_3.png">../../../pixmaps/revision_3.png</file>
- <file compressed="true" alias="revision_4.png">../../../pixmaps/revision_4.png</file>
- <file compressed="true" alias="revision_5.png">../../../pixmaps/revision_5.png</file>
- <file compressed="true" alias="revision_6.png">../../../pixmaps/revision_6.png</file>
- <file compressed="true" alias="revision_7.png">../../../pixmaps/revision_7.png</file>
- <file compressed="true" alias="revision_8.png">../../../pixmaps/revision_8.png</file>
- <file compressed="true" alias="revision_9.png">../../../pixmaps/revision_9.png</file>
- </gresource>
</gresources>
diff --git a/src/gui/dialogs/preferences.c b/src/gui/dialogs/preferences.c
index aca562a..0369241 100644
--- a/src/gui/dialogs/preferences.c
+++ b/src/gui/dialogs/preferences.c
@@ -34,9 +34,12 @@
#include "preferences-int.h"
+#include "prefs/appearance.h"
#include "prefs/security.h"
#include "../../common/cpp.h"
#include "../../gtkext/tweak.h"
+#include "../../plugins/pglist.h"
+#include "../../plugins/tweakable.h"
@@ -133,9 +136,13 @@ static void gtk_preferences_dialog_init(GtkPreferencesDialog *dialog)
const tweak_info_t *info; /* Informations à considérer */
GtkListBox *navigation; /* Liste de sections à afficher*/
GtkTweakSection *section; /* Nouvelle section à présenter*/
+ tweak_info_t *dyn_infos; /* Informations supplémentaires*/
+ size_t dyn_count; /* Quantité de ces informations*/
tweak_info_t infos[] = {
TWEAK_SIMPLE_DEF("root", "Basics",
+ "security-high-symbolic", "appearance", "Appearance", GTK_TYPE_APPEARANCE_TWEAK_PANEL),
+ TWEAK_SIMPLE_DEF("root", "Basics",
"security-high-symbolic", "security", "Security", GTK_TYPE_SECURITY_TWEAK_PANEL),
};
@@ -158,6 +165,26 @@ static void gtk_preferences_dialog_init(GtkPreferencesDialog *dialog)
}
+ /* Chargement des sections dynamiques */
+
+ dyn_infos = get_tweakable_plugins_info(&dyn_count);
+
+ for (i = 0; i < dyn_count; i++)
+ {
+ info = &dyn_infos[i];
+
+ navigation = gtk_preferences_dialog_get_navigation(dialog, info->parent, true);
+ assert(navigation != NULL);
+
+ section = gtk_tweak_section_new(info);
+
+ gtk_list_box_append(navigation, GTK_WIDGET(section));
+
+ }
+
+ if (dyn_infos != NULL)
+ free(dyn_infos);
+
/* Affichage de la liste racine */
navigation = gtk_preferences_dialog_get_navigation(dialog, "root", false);
diff --git a/src/gui/dialogs/prefs/Makefile.am b/src/gui/dialogs/prefs/Makefile.am
index fa1af96..50bc3c8 100644
--- a/src/gui/dialogs/prefs/Makefile.am
+++ b/src/gui/dialogs/prefs/Makefile.am
@@ -4,9 +4,12 @@ BUILT_SOURCES = resources.h resources.c
noinst_LTLIBRARIES = libguidialogsprefs.la
UI_FILES = \
+ appearance.ui \
security.ui
libguidialogsprefs_la_SOURCES = \
+ appearance-int.h \
+ appearance.h appearance.c \
resources.h resources.c \
security-int.h \
security.h security.c
diff --git a/src/gui/dialogs/prefs/appearance-int.h b/src/gui/dialogs/prefs/appearance-int.h
new file mode 100644
index 0000000..886a562
--- /dev/null
+++ b/src/gui/dialogs/prefs/appearance-int.h
@@ -0,0 +1,64 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * appearance-int.h - définitions internes pour la configuration des paramètres liés aux apparences
+ *
+ * Copyright (C) 2025 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 Chrysalide. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _GUI_DIALOGS_PREFS_APPEARANCE_INT_H
+#define _GUI_DIALOGS_PREFS_APPEARANCE_INT_H
+
+
+#include "appearance.h"
+
+
+
+/* Composant d'édition des paramètres liés aux apparences (instance) */
+struct _GtkAppearanceTweakPanel
+{
+ GtkBox parent; /* A laisser en premier */
+
+ /* Disposition des panneaux */
+
+ GSettings *tiles_settings; /* Configuration sollicitée */
+
+ GtkWidget *layout_preview; /* Zone d'aperçu de dispositon*/
+
+ GtkWidget *top_panel; /* Composant d'aperçu #1 */
+ GtkWidget *left_panel; /* Composant d'aperçu #2 */
+ GtkWidget *right_panel; /* Composant d'aperçu #3 */
+ GtkWidget *bottom_panel; /* Composant d'aperçu #4 */
+
+ GtkCheckButton *left_top_reach; /* Paramètre de disposition #1 */
+ GtkCheckButton *left_bottom_reach; /* Paramètre de disposition #2 */
+ GtkCheckButton *right_top_reach; /* Paramètre de disposition #3 */
+ GtkCheckButton *right_bottom_reach; /* Paramètre de disposition #4 */
+
+};
+
+/* Composant d'édition des paramètres liés aux apparences (classe) */
+struct _GtkAppearanceTweakPanelClass
+{
+ GtkBoxClass parent; /* A laisser en premier */
+
+};
+
+
+
+#endif /* _GUI_DIALOGS_PREFS_APPEARANCE_INT_H */
diff --git a/src/gui/dialogs/prefs/appearance.c b/src/gui/dialogs/prefs/appearance.c
new file mode 100644
index 0000000..a8585fa
--- /dev/null
+++ b/src/gui/dialogs/prefs/appearance.c
@@ -0,0 +1,251 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * appearance.c - configuration des paramètres liés aux apparences
+ *
+ * Copyright (C) 2025 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 Chrysalide. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include "appearance.h"
+
+
+#include "appearance-int.h"
+#include "../../../gtkext/grid.h"
+#include "../../../gtkext/helpers.h"
+
+
+
+/* Procède à l'initialisation de classe des configurations. */
+static void gtk_appearance_tweak_panel_class_init(GtkAppearanceTweakPanelClass *);
+
+/* Procède à l'initialisation des configurations de sécurité. */
+static void gtk_appearance_tweak_panel_init(GtkAppearanceTweakPanel *);
+
+/* Supprime toutes les références externes. */
+static void gtk_appearance_tweak_panel_dispose(GObject *);
+
+/* Procède à la libération totale de la mémoire. */
+static void gtk_appearance_tweak_panel_finalize(GObject *);
+
+/* Réagit à un changement de paramètre de configuration. */
+static void gtk_appearance_tweak_panel_on_tiles_settings_changed(GSettings *, const gchar *, GtkAppearanceTweakPanel *);
+
+/* Change la disposition des panneaux de la fenêtre principale. */
+static void gtk_appearance_tweak_panel_on_panel_reach_toggled(GtkCheckButton *, GtkAppearanceTweakPanel *);
+
+
+/* Indique le type du composant de configuration des notes. */
+G_DEFINE_TYPE(GtkAppearanceTweakPanel, gtk_appearance_tweak_panel, GTK_TYPE_BOX);
+
+
+/******************************************************************************
+* *
+* Paramètres : class = classe GTK à initialiser. *
+* *
+* Description : Procède à l'initialisation de classe des configurations. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_appearance_tweak_panel_class_init(GtkAppearanceTweakPanelClass *class)
+{
+ GObjectClass *object; /* Plus haut niveau équivalent */
+ GtkWidgetClass *widget; /* Classe de haut niveau */
+
+ object = G_OBJECT_CLASS(class);
+
+ object->dispose = gtk_appearance_tweak_panel_dispose;
+ object->finalize = gtk_appearance_tweak_panel_finalize;
+
+ widget = GTK_WIDGET_CLASS(class);
+
+ gtk_widget_class_set_template_from_resource(widget, "/re/chrysalide/framework/gui/dialogs/prefs/appearance.ui");
+
+ gtk_widget_class_bind_template_callback_full(widget, BUILDER_CB(gtk_appearance_tweak_panel_on_panel_reach_toggled));
+
+ gtk_widget_class_bind_template_child(widget, GtkAppearanceTweakPanel, layout_preview);
+
+ gtk_widget_class_bind_template_child(widget, GtkAppearanceTweakPanel, top_panel);
+ gtk_widget_class_bind_template_child(widget, GtkAppearanceTweakPanel, left_panel);
+ gtk_widget_class_bind_template_child(widget, GtkAppearanceTweakPanel, right_panel);
+ gtk_widget_class_bind_template_child(widget, GtkAppearanceTweakPanel, bottom_panel);
+
+ gtk_widget_class_bind_template_child(widget, GtkAppearanceTweakPanel, left_top_reach);
+ gtk_widget_class_bind_template_child(widget, GtkAppearanceTweakPanel, left_bottom_reach);
+ gtk_widget_class_bind_template_child(widget, GtkAppearanceTweakPanel, right_top_reach);
+ gtk_widget_class_bind_template_child(widget, GtkAppearanceTweakPanel, right_bottom_reach);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : panel = composant GTK à initialiser. *
+* *
+* Description : Procède à l'initialisation des configurations de sécurité. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_appearance_tweak_panel_init(GtkAppearanceTweakPanel *panel)
+{
+ LayoutReachOptions options; /* Détails de disposition */
+
+ gtk_widget_init_template(GTK_WIDGET(panel));
+
+ panel->tiles_settings = g_settings_new_with_path("re.chrysalide.framework.tiledgrid",
+ "/re/chrysalide/framework/gui/tiles/");
+
+ options = g_settings_get_flags(panel->tiles_settings, "layout");
+
+ gtk_check_button_set_active(panel->left_top_reach, options & LRO_LEFT_TOP_REACH);
+ gtk_check_button_set_active(panel->left_bottom_reach, options & LRO_LEFT_BOTTOM_REACH);
+ gtk_check_button_set_active(panel->right_top_reach, options & LRO_RIGHT_TOP_REACH);
+ gtk_check_button_set_active(panel->right_bottom_reach, options & LRO_RIGHT_BOTTOM_REACH);
+
+ gtk_appearance_tweak_panel_on_tiles_settings_changed(panel->tiles_settings, "layout", panel);
+
+ g_signal_connect(panel->tiles_settings, "changed",
+ G_CALLBACK(gtk_appearance_tweak_panel_on_tiles_settings_changed), panel);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : object = instance d'objet GLib à traiter. *
+* *
+* Description : Supprime toutes les références externes. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_appearance_tweak_panel_dispose(GObject *object)
+{
+ GtkAppearanceTweakPanel *panel; /* Version spécialisée */
+
+ gtk_widget_dispose_template(GTK_WIDGET(object), GTK_TYPE_APPEARANCE_TWEAK_PANEL);
+
+ panel = GTK_APPEARANCE_TWEAK_PANEL(object);
+
+ g_clear_object(&panel->tiles_settings);
+
+ G_OBJECT_CLASS(gtk_appearance_tweak_panel_parent_class)->dispose(object);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : object = instance d'objet GLib à traiter. *
+* *
+* Description : Procède à la libération totale de la mémoire. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_appearance_tweak_panel_finalize(GObject *object)
+{
+ G_OBJECT_CLASS(gtk_appearance_tweak_panel_parent_class)->finalize(object);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : settings = ensemble de paramètres connaissant une évolution. *
+* key = identifiant du paramètre ayant changé. *
+* panel = panneau de paramétrage concerné par l'appel. *
+* *
+* Description : Réagit à un changement de paramètre de configuration. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_appearance_tweak_panel_on_tiles_settings_changed(GSettings *settings, const gchar *key, GtkAppearanceTweakPanel *panel)
+{
+ LayoutReachOptions options; /* Détails de disposition */
+
+ if (strcmp(key, "layout") == 0)
+ {
+ options = g_settings_get_flags(panel->tiles_settings, "layout");
+
+ apply_tiling_grid_layout(GTK_GRID(panel->layout_preview), options, (GtkWidget *[]) {
+ panel->top_panel, panel->left_panel, panel->right_panel, panel->bottom_panel
+ });
+
+ }
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : button = composant radio dont l'état vient de basculer. *
+* panel = panneau d'édition des préférences courant. *
+* *
+* Description : Change la disposition des panneaux de la fenêtre principale. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_appearance_tweak_panel_on_panel_reach_toggled(GtkCheckButton *button, GtkAppearanceTweakPanel *panel)
+{
+ gboolean left_top_reach; /* Paramètre de disposition #1 */
+ gboolean left_bottom_reach; /* Paramètre de disposition #2 */
+ gboolean right_top_reach; /* Paramètre de disposition #3 */
+ gboolean right_bottom_reach; /* Paramètre de disposition #4 */
+ LayoutReachOptions options; /* Options à appliquer */
+
+ /* Récupération des indications */
+
+ left_top_reach = gtk_check_button_get_active(panel->left_top_reach);
+ left_bottom_reach = gtk_check_button_get_active(panel->left_bottom_reach);
+ right_top_reach = gtk_check_button_get_active(panel->right_top_reach);
+ right_bottom_reach = gtk_check_button_get_active(panel->right_bottom_reach);
+
+ /* Conversion et application */
+
+ options = LRO_NONE;
+
+ if (left_top_reach) options |= LRO_LEFT_TOP_REACH;
+ if (left_bottom_reach) options |= LRO_LEFT_BOTTOM_REACH;
+ if (right_top_reach) options |= LRO_RIGHT_TOP_REACH;
+ if (right_bottom_reach) options |= LRO_RIGHT_BOTTOM_REACH;
+
+ g_settings_set_flags(panel->tiles_settings, "layout", options);
+
+}
diff --git a/src/gui/dialogs/prefs/appearance.h b/src/gui/dialogs/prefs/appearance.h
new file mode 100644
index 0000000..916b194
--- /dev/null
+++ b/src/gui/dialogs/prefs/appearance.h
@@ -0,0 +1,41 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * appearance.h - prototypes pour la configuration des paramètres liés aux apparences
+ *
+ * Copyright (C) 2025 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 Chrysalide. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _GUI_DIALOGS_PREFS_APPEARANCE_H
+#define _GUI_DIALOGS_PREFS_APPEARANCE_H
+
+
+#include <gtk/gtk.h>
+
+
+#include "../../../glibext/helpers.h"
+
+
+
+#define GTK_TYPE_APPEARANCE_TWEAK_PANEL (gtk_appearance_tweak_panel_get_type())
+
+DECLARE_GTYPE(GtkAppearanceTweakPanel, gtk_appearance_tweak_panel, GTK, APPEARANCE_TWEAK_PANEL);
+
+
+
+#endif /* _GUI_DIALOGS_PREFS_APPEARANCE_H */
diff --git a/src/gui/dialogs/prefs/appearance.ui b/src/gui/dialogs/prefs/appearance.ui
new file mode 100644
index 0000000..3410115
--- /dev/null
+++ b/src/gui/dialogs/prefs/appearance.ui
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+
+ <template class="GtkAppearanceTweakPanel" parent="GtkBox">
+
+ <property name="orientation">vertical</property>
+ <property name="margin-start">20</property>
+ <property name="margin-end">20</property>
+ <property name="margin-top">20</property>
+ <property name="margin-bottom">20</property>
+ <property name="spacing">10</property>
+
+ <!-- Disposition des panneaux -->
+
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Layout</property>
+ <property name="use-markup">true</property>
+ <property name="xalign">0</property>
+ <style>
+ <class name="heading"/>
+ </style>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Layout defines the global panel organization of the main window.</property>
+ <property name="wrap">true</property>
+ <property name="use-markup">true</property>
+ <property name="xalign">0</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ </child>
+
+
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">horizontal</property>
+
+ <!-- Aperçu -->
+
+ <child>
+ <object class="GtkGrid" id="layout_preview">
+ <property name="margin-start">20</property>
+ <property name="margin-end">20</property>
+ <property name="margin-top">10</property>
+ <property name="margin-bottom">10</property>
+ <property name="row-spacing">5</property>
+ <property name="column-spacing">5</property>
+ <property name="hexpand">false</property>
+ <property name="vexpand">false</property>
+ <property name="height-request">200</property>
+ <property name="width-request">300</property>
+
+ <child>
+ <object class="GtkFrame" id="top_panel">
+ <property name="hexpand">true</property>
+ <property name="vexpand">false</property>
+ <property name="height-request">20</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">0</property>
+ <property name="column-span">3</property>
+ </layout>
+ <style>
+ <class name="view"/>
+ </style>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkFrame" id="left_panel">
+ <property name="hexpand">false</property>
+ <property name="vexpand">true</property>
+ <property name="width-request">50</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">1</property>
+ </layout>
+ <style>
+ <class name="view"/>
+ </style>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkFrame">
+ <property name="hexpand">true</property>
+ <property name="vexpand">true</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">1</property>
+ </layout>
+ <style>
+ <class name="view"/>
+ </style>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkFrame" id="right_panel">
+ <property name="hexpand">false</property>
+ <property name="vexpand">true</property>
+ <property name="width-request">50</property>
+ <layout>
+ <property name="column">2</property>
+ <property name="row">1</property>
+ </layout>
+ <style>
+ <class name="view"/>
+ </style>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkFrame" id="bottom_panel">
+ <property name="hexpand">true</property>
+ <property name="vexpand">false</property>
+ <property name="height-request">50</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">2</property>
+ <property name="column-span">3</property>
+ </layout>
+ <style>
+ <class name="view"/>
+ </style>
+ </object>
+ </child>
+
+ </object>
+ </child>
+
+ <!-- Options -->
+
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <property name="valign">center</property>
+ <property name="spacing">10</property>
+
+ <child>
+ <object class="GtkCheckButton" id="left_top_reach">
+ <property name="label">Left panels reach the top of the window</property>
+ <property name="active">false</property>
+ <signal name="toggled" handler="gtk_appearance_tweak_panel_on_panel_reach_toggled"/>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkCheckButton" id="left_bottom_reach">
+ <property name="label">Left panels reach the bottom of the window</property>
+ <property name="active">false</property>
+ <signal name="toggled" handler="gtk_appearance_tweak_panel_on_panel_reach_toggled"/>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkCheckButton" id="right_top_reach">
+ <property name="label">Right panels reach the top of the window</property>
+ <property name="active">false</property>
+ <signal name="toggled" handler="gtk_appearance_tweak_panel_on_panel_reach_toggled"/>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkCheckButton" id="right_bottom_reach">
+ <property name="label">Right panels reach the bottom of the window</property>
+ <property name="active">false</property>
+ <signal name="toggled" handler="gtk_appearance_tweak_panel_on_panel_reach_toggled"/>
+ </object>
+ </child>
+
+ </object>
+ </child>
+
+ </object>
+ </child>
+
+ </template>
+</interface>
diff --git a/src/gui/dialogs/prefs/gresource.xml b/src/gui/dialogs/prefs/gresource.xml
index 7b18143..ad0f97f 100644
--- a/src/gui/dialogs/prefs/gresource.xml
+++ b/src/gui/dialogs/prefs/gresource.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/re/chrysalide/framework/gui/dialogs/prefs">
+ <file compressed="true">appearance.ui</file>
<file compressed="true">security.ui</file>
</gresource>
</gresources>
diff --git a/src/gui/dialogs/prefs/security-int.h b/src/gui/dialogs/prefs/security-int.h
index c693fdb..be7867c 100644
--- a/src/gui/dialogs/prefs/security-int.h
+++ b/src/gui/dialogs/prefs/security-int.h
@@ -30,7 +30,7 @@
-/* Fenêtre d'édition générale de la configuration (instance) */
+/* Composant d'édition des paramètres de sécurité (instance) */
struct _GtkSecurityTweakPanel
{
GtkBox parent; /* A laisser en premier */
@@ -52,7 +52,7 @@ struct _GtkSecurityTweakPanel
};
-/* Fenêtre d'édition générale de la configuration (classe) */
+/* Composant d'édition des paramètres de sécurité (classe) */
struct _GtkSecurityTweakPanelClass
{
GtkBoxClass parent; /* A laisser en premier */
diff --git a/src/gui/dialogs/prefs/security.c b/src/gui/dialogs/prefs/security.c
index cf2f6c8..2b82339 100644
--- a/src/gui/dialogs/prefs/security.c
+++ b/src/gui/dialogs/prefs/security.c
@@ -1,6 +1,6 @@
/* Chrysalide - Outil d'analyse de fichiers binaires
- * security.h - configuration des paramètres liés à la sécurité
+ * security.c - configuration des paramètres liés à la sécurité
*
* Copyright (C) 2025 Cyrille Bagard
*
@@ -82,7 +82,7 @@ static void gtk_security_tweak_panel_on_remove_password_clicked(GtkButton *, Gtk
/* ---------------------------------------------------------------------------------- */
-/* Détermine le type du composant d'affichage générique. */
+/* Indique le type du composant d'édition des paramètres de sécurité. */
G_DEFINE_TYPE(GtkSecurityTweakPanel, gtk_security_tweak_panel, GTK_TYPE_BOX);
diff --git a/src/gui/panel-int.h b/src/gui/panel-int.h
deleted file mode 100644
index 7e6f7e3..0000000
--- a/src/gui/panel-int.h
+++ /dev/null
@@ -1,71 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * panel-int.h - prototypes pour les définitions internes liées aux panneaux d'affichage
- *
- * Copyright (C) 2019-2024 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_PANEL_INT_H
-#define _GUI_PANEL_INT_H
-
-
-#include "panel.h"
-
-
-
-/* Fournit une indication sur la personnalité du panneau. */
-typedef PanelItemPersonality (* get_panel_item_personality_cb) (const GPanelItem *);
-
-/* Fournit un composant pour lancer l'activité d'un panneau. */
-typedef GtkWidget * (* get_panel_item_widget_cb) (GPanelItem *);
-
-/* Fournit un composant représentant un panneau graphique. */
-typedef GtkTiledPanel * (* get_panel_item_panel_cb) (GPanelItem *, GtkWidget *);
-
-
-/* Elément réactif pour panneaux de l'éditeur (instance) */
-struct _GPanelItem
-{
- GObject parent; /* A laisser en premier */
-
- GtkWidget *launcher; /* Eventuel lanceur associé */
- GtkWidget *properties; /* Propriétés de lancement */
-
- GtkTiledPanel **panels; /* Instances complètes ouvertes*/
- size_t pcount; /* Quantité de ces instances */
-
-};
-
-/* Elément réactif pour panneaux de l'éditeur (classe) */
-struct _GPanelItemClass
-{
- GObjectClass parent; /* A laisser en premier */
-
- get_panel_item_personality_cb get_personality; /* Fourniture de nature */
-
- get_panel_item_widget_cb get_launcher; /* Lancement d'une activité */
- get_panel_item_widget_cb get_properties;/* Préparation au lancement */
- get_panel_item_panel_cb get_panel; /* Panneau principal */
-
-};
-
-
-
-#endif /* _GUI_PANEL_INT_H */
diff --git a/src/gui/panel.c b/src/gui/panel.c
deleted file mode 100644
index b361153..0000000
--- a/src/gui/panel.c
+++ /dev/null
@@ -1,1207 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * panel.c - gestion des éléments réactifs spécifiques aux panneaux
- *
- * Copyright (C) 2019-2024 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 "panel-int.h"
-
-
-
-/* ---------------------- MANIPULATIONS D'UN PANNEAU GRAPHIQUE ---------------------- */
-
-
-
-
-
-/* Initialise la classe des panneaux graphiques de l'éditeur. */
-static void g_panel_item_class_init(GPanelItemClass *);
-
-/* Initialise une instance de panneau graphique pour l'éditeur. */
-static void g_panel_item_init(GPanelItem *);
-
-/* Supprime toutes les références externes. */
-static void g_panel_item_dispose(GPanelItem *);
-
-/* Procède à la libération totale de la mémoire. */
-static void g_panel_item_finalize(GPanelItem *);
-
-
-
-
-
-/* Indique le type défini pour un élément destiné à un panneau. */
-G_DEFINE_TYPE(GPanelItem, g_panel_item, G_TYPE_OBJECT);
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe à initialiser. *
-* *
-* Description : Initialise la classe des panneaux graphiques de l'éditeur. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_panel_item_class_init(GPanelItemClass *class)
-{
- GObjectClass *object; /* Autre version de la classe */
-
- object = G_OBJECT_CLASS(class);
-
- object->dispose = (GObjectFinalizeFunc/* ! */)g_panel_item_dispose;
- object->finalize = (GObjectFinalizeFunc)g_panel_item_finalize;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = instance à initialiser. *
-* *
-* Description : Initialise une instance de panneau graphique pour l'éditeur. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_panel_item_init(GPanelItem *item)
-{
- //item->docked = false;
-
- //item->widget = NULL;
- //item->cached_widget = NULL;
-
- //item->filter = NULL;
-
- //g_atomic_int_set(&item->switched, 0);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = instance d'objet GLib à traiter. *
-* *
-* Description : Supprime toutes les références externes. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_panel_item_dispose(GPanelItem *item)
-{
- //g_clear_object(&item->widget);
- //g_clear_object(&item->cached_widget);
-
- G_OBJECT_CLASS(g_panel_item_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_panel_item_finalize(GPanelItem *item)
-{
- G_OBJECT_CLASS(g_panel_item_parent_class)->finalize(G_OBJECT(item));
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = définition de panneau à consulter. *
-* *
-* Description : Fournit une indication sur la personnalité du panneau. *
-* *
-* Retour : Identifiant lié à la nature du panneau. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-PanelItemPersonality g_panel_item_get_personality(const GPanelItem *item)
-{
- PanelItemPersonality result; /* Personnalité à retourner */
- GPanelItemClass *class; /* Classe à actionner */
-
- class = G_PANEL_ITEM_GET_CLASS(item);
-
- result = class->get_personality(item);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = définition de panneau à manipuler. *
-* *
-* Description : Fournit un composant pour lancer l'activité d'un panneau. *
-* *
-* Retour : Composant GTK (déjà ?) mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GtkWidget *g_panel_item_get_launcher(GPanelItem *item)
-{
- GtkWidget *result; /* Composant à retourner */
- GPanelItemClass *class; /* Classe à actionner */
-
- if (item->launcher == NULL)
- {
- class = G_PANEL_ITEM_GET_CLASS(item);
- item->launcher = class->get_launcher(item);
- }
-
- result = item->launcher;
-
- if (result != NULL)
- ref_object(result);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = définition de panneau à manipuler. *
-* *
-* Description : Fournit un composant pour paramétrer l'activité d'un panneau.*
-* *
-* Retour : Composant GTK (déjà ?) mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GtkWidget *g_panel_item_get_properties(GPanelItem *item)
-{
- GtkWidget *result; /* Composant à retourner */
- GPanelItemClass *class; /* Classe à actionner */
-
- if (item->properties == NULL)
- {
- class = G_PANEL_ITEM_GET_CLASS(item);
- item->properties = class->get_properties(item);
- }
-
- result = item->properties;
-
- if (result != NULL)
- ref_object(result);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = définition de panneau à manipuler. *
-* *
-* Description : Fournit un composant représentant un panneau graphique. *
-* *
-* Retour : Composant GTK (déjà ?) mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GtkTiledPanel *g_panel_item_get_panel(GPanelItem *item)
-{
- GtkTiledPanel *result; /* Composant à retourner */
- GPanelItemClass *class; /* Classe à actionner */
-
- if (item->pcount == 0 /* || !singleton */)
- {
- class = G_PANEL_ITEM_GET_CLASS(item);
- result = class->get_panel(item, item->properties);
-
- if (result != NULL)
- {
- item->panels = realloc(item->panels, ++item->pcount * sizeof(GtkTiledPanel *));
- item->panels[item->pcount - 1] = result;
- }
-
- }
-
- else
- result = item->panels[item->pcount - 1];
-
- if (result != NULL)
- ref_object(result);
-
- return result;
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-#if 0
-
-
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-
-
-#include "panel-int.h"
-#include "core/global.h"
-#include "core/items.h"
-#include "../common/extstr.h"
-#include "../core/params.h"
-#include "../gtkext/gtkdockable-int.h"
-#include "../gtkext/named.h"
-#include "../plugins/dt.h"
-#include "../plugins/pglist.h"
-
-
-
-/* ------------------------- COEUR DES PANNEAUX D'AFFICHAGE ------------------------- */
-
-
-
-
-/* ------------------------- COEUR D'UN PANNEAU D'AFFICHAGE ------------------------- */
-
-
-/* Construit la chaîne d'accès à un élément de configuration. */
-static char *gtk_panel_item_class_build_configuration_key(const GPanelItemClass *, const char *);
-
-/* Fournit le nom court du composant encapsulable. */
-static char *gtk_panel_item_get_name(const GPanelItem *);
-
-/* Fournit le nom long du composant encapsulable. */
-static char *gtk_panel_item_get_desc(const GPanelItem *);
-
-/* Détermine si un panneau peut être filtré. */
-static bool gtk_panel_item_can_search(const GPanelItem *);
-
-/* Fournit le composant graphique intégrable dans un ensemble. */
-static GtkWidget *gtk_panel_item_get_widget(GPanelItem *);
-
-/* Démarre l'actualisation du filtrage du contenu. */
-static void gtk_panel_item_update_filtered(GPanelItem *, const char *);
-
-
-
-/* ---------------------- MECANISMES DE MISE A JOUR DE PANNEAU ---------------------- */
-
-
-/* Présente une copie de l'affichage du composant rafraîchi. */
-static gboolean g_panel_item_draw_mask(GtkWidget *, cairo_t *, GPanelItem *);
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* COEUR DES PANNEAUX D'AFFICHAGE */
-/* ---------------------------------------------------------------------------------- */
-
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe à consulter. *
-* *
-* Description : Fournit une indication sur la personnalité du panneau. *
-* *
-* Retour : Identifiant lié à la nature unique du panneau. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-PanelItemPersonality gtk_panel_item_class_get_personality_singleton(const GPanelItemClass *class)
-{
- PanelItemPersonality result; /* Personnalité à retourner */
-
- result = PIP_SINGLETON;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe à consulter. *
-* *
-* Description : Fournit une indication d'accroche du panneau au démarrage. *
-* *
-* Retour : true si le panneau doit être affiché de prime abord. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool gtk_panel_item_class_dock_at_startup(const GPanelItemClass *class)
-{
- bool result; /* Statut à retourner */
- GGenConfig *config; /* Configuration courante */
- char *key; /* Clef d'accès à un paramètre */
-#ifndef NDEBUG
- bool status; /* Bilan de consultation */
-#endif
-
- config = get_main_configuration();
-
- key = gtk_panel_item_class_build_configuration_key(class, "dock_at_startup");
-
-#ifndef NDEBUG
- status = g_generic_config_get_value(config, key, &result);
- assert(status);
-#else
- g_generic_config_get_value(config, key, &result);
-#endif
-
- free(key);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe associée à la consultation. *
-* *
-* Description : Renvoie false lors d'une consultation de la classe. *
-* *
-* Retour : false. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool gtk_panel_item_class_return_false(const GPanelItemClass *class)
-{
- bool result; /* Statut à retourner */
-
- result = false;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe associée à la consultation. *
-* *
-* Description : Renvoie true lors d'une consultation de la classe. *
-* *
-* Retour : true. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool gtk_panel_item_class_return_true(const GPanelItemClass *class)
-{
- bool result; /* Statut à retourner */
-
- result = true;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe à consulter. *
-* *
-* Description : Détermine si un panneau peut être filtré. *
-* *
-* Retour : Bilan de la consultation. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool gtk_panel_item_class_can_search(const GPanelItemClass *class)
-{
- bool result; /* Statut à retourner */
-
- result = class->can_search(class);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe à consulter. *
-* *
-* Description : Indique le chemin initial de la localisation d'un panneau. *
-* *
-* Retour : Chemin fixé associé à la position initiale. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-char *gtk_panel_item_class_get_path(const GPanelItemClass *class)
-{
- char *result; /* Emplacement à retourner */
- GGenConfig *config; /* Configuration courante */
- char *key; /* Clef d'accès à un paramètre */
- const char *path; /* Nouveau chemin de placement */
-#ifndef NDEBUG
- bool status; /* Statut de l'encapsulation */
-#endif
-
- config = get_main_configuration();
-
- key = gtk_panel_item_class_build_configuration_key(class, "path");
-
-#ifndef NDEBUG
- status = g_generic_config_get_value(config, key, &path);
- assert(status);
-#else
- g_generic_config_get_value(config, key, &path);
-#endif
-
- free(key);
-
- result = strdup(path);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe à consulter. *
-* *
-* Description : Indique la définition d'un éventuel raccourci clavier. *
-* *
-* Retour : Description d'un raccourci ou NULL si aucun de défini. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-char *gtk_panel_item_class_get_key_bindings(const GPanelItemClass *class)
-{
- char *result; /* Emplacement à retourner */
-
- if (class->get_bindings != NULL)
- result = class->get_bindings(class);
-
- else
- result = NULL;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe du type de panneau à traiter. *
-* attrib = élément de configuration à inclure dans le résultat.*
-* *
-* Description : Construit la chaîne d'accès à un élément de configuration. *
-* *
-* Retour : Chaîne de caractères à libérer après usage. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static char *gtk_panel_item_class_build_configuration_key(const GPanelItemClass *class, const char *attrib)
-{
- char *result; /* Construction à renvoyer */
- const char *name; /* Nom court du panneau */
-
- name = g_editor_item_class_get_key(G_EDITOR_ITEM_CLASS(class));
-
- asprintf(&result, "gui.panels.%s.%s", attrib, name);
-
- result = strrpl(result, " ", "_");
-
- result = strlower(result);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe de panneau à consulter. *
-* config = configuration à compléter. *
-* *
-* Description : Met en place les bases de la configuration d'un panneau. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool gtk_panel_item_class_setup_configuration(const GPanelItemClass *class, GGenConfig *config)
-{
- bool result; /* Bilan à retourner */
- char *key; /* Clef d'accès à un paramètre */
- bool dock_at_startup; /* Affichage dès le départ ? */
- char *path; /* Localisation du panneau */
-
- key = gtk_panel_item_class_build_configuration_key(class, "dock_at_startup");
-
- dock_at_startup = class->dock_at_startup(class);
-
- result = g_generic_config_create_param_if_not_exist(config, key, CPT_BOOLEAN, dock_at_startup);
-
- free(key);
-
- if (!result)
- goto exit;
-
- key = gtk_panel_item_class_build_configuration_key(class, "path");
-
- path = class->get_path(class);
-
- result = g_generic_config_create_param_if_not_exist(config, key, CPT_STRING, path);
-
- free(path);
-
- free(key);
-
- exit:
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : type = type de panneau à mettre en place. *
-* path = emplacement d'affichage ou NULL. *
-* *
-* Description : Crée un élément de panneau réactif. *
-* *
-* Retour : Adresse de la structure mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GPanelItem *g_panel_item_new(GType type, const char *path)
-{
- GPanelItem *result; /* Structure à retourner */
- GPanelItemClass *class; /* Classe associée au type */
- PanelItemPersonality personality; /* Caractéristique de panneau */
- GtkTiledGrid *grid; /* Composant d'affichage */
-
- class = g_type_class_ref(type);
-
- personality = gtk_panel_item_class_get_personality(class);
- assert(path != NULL || personality == PIP_PERSISTENT_SINGLETON);
-
- g_type_class_unref(class);
-
- if (personality == PIP_PERSISTENT_SINGLETON || personality == PIP_SINGLETON)
- {
- result = G_PANEL_ITEM(find_editor_item_by_type(type));
-
- if (result != NULL)
- goto singleton;
-
- }
-
- result = create_object_from_type(type);
-
- grid = get_tiled_grid();
-
- g_signal_connect_swapped(result, "dock-request", G_CALLBACK(gtk_tiled_grid_add), grid);
- g_signal_connect_swapped(result, "undock-request", G_CALLBACK(gtk_tiled_grid_remove), grid);
-
- gtk_dockable_setup_dnd(GTK_DOCKABLE(result));
-
- register_editor_item(G_EDITOR_ITEM(result));
-
- notify_panel_creation(result);
-
- singleton:
-
- if (path != NULL)
- {
- if (path[0] != '\0')
- gtk_panel_item_set_path(result, path);
-
- g_panel_item_dock(result);
-
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = instance de panneau à consulter. *
-* *
-* Description : Indique le composant graphique principal du panneau. *
-* *
-* Retour : Composant graphique avec nom constituant le panneau. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GNamedWidget *gtk_panel_item_get_named_widget(const GPanelItem *item)
-{
- GNamedWidget *result; /* Composant nommé à retourner */
-
- result = item->widget;
-
- g_object_ref(G_OBJECT(result));
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = instance GTK dont l'interface est à consulter. *
-* *
-* Description : Fournit le nom court du composant encapsulable. *
-* *
-* Retour : Désignation humaine pour titre d'onglet ou de fenêtre. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static char *gtk_panel_item_get_name(const GPanelItem *item)
-{
- char *result; /* Désignation à retourner */
-
- result = g_named_widget_get_name(G_NAMED_WIDGET(item->widget), false);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = instance GTK dont l'interface est à consulter. *
-* *
-* Description : Fournit le nom long du composant encapsulable. *
-* *
-* Retour : Désignation humaine pour titre d'onglet ou de fenêtre. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static char *gtk_panel_item_get_desc(const GPanelItem *item)
-{
- char *result; /* Description à retourner */
-
- result = g_named_widget_get_name(G_NAMED_WIDGET(item->widget), true);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = instance GTK dont l'interface est à consulter. *
-* *
-* Description : Détermine si un panneau peut être filtré. *
-* *
-* Retour : Bilan de la consultation. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool gtk_panel_item_can_search(const GPanelItem *item)
-{
- bool result; /* Indication à retourner */
- GPanelItemClass *class; /* Classe de l'élément visé */
-
- class = G_PANEL_ITEM_GET_CLASS(item);
-
- result = gtk_panel_item_class_can_search(class);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = instance GTK dont l'interface est à consulter. *
-* *
-* Description : Fournit le composant graphique intégrable dans un ensemble. *
-* *
-* Retour : Composant graphique prêt à emploi. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GtkWidget *gtk_panel_item_get_widget(GPanelItem *item)
-{
- GtkWidget *result; /* Composant à retourner */
-
- if (item->cached_widget == NULL)
- item->cached_widget = g_named_widget_get_widget(G_NAMED_WIDGET(item->widget));
-
- result = item->cached_widget;
-
- g_object_ref(G_OBJECT(result));
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = instance GTK dont l'interface est à sollicitée. *
-* *
-* Description : Démarre l'actualisation du filtrage du contenu. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void gtk_panel_item_update_filtered(GPanelItem *item, const char *filter)
-{
- assert(gtk_panel_item_can_search(item));
-
- if (item->filter != NULL)
- free(item->filter);
-
- item->filter = (filter ? strdup(filter) : NULL);
-
- G_PANEL_ITEM_GET_CLASS(item)->update_filtered(item);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = instance GTK à consulter. *
-* path = nouvelle emplacement d'inclusion. *
-* *
-* Description : Définit le chemin d'accès à utiliser pour les encapsulations.*
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void gtk_panel_item_set_path(GPanelItem *item, const char *path)
-{
- GGenConfig *config; /* Configuration courante */
- char *key; /* Clef d'accès à un paramètre */
-
- config = get_main_configuration();
-
- key = gtk_panel_item_class_build_configuration_key(G_PANEL_ITEM_GET_CLASS(item), "path");
-
- g_generic_config_set_value(config, key, path);
-
- free(key);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = composant à présenter à l'affichage. *
-* *
-* Description : Place un panneau dans l'ensemble affiché. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_panel_item_dock(GPanelItem *item)
-{
- assert(!item->docked);
-
- g_signal_emit_by_name(item, "dock-request");
-
- if (G_PANEL_ITEM_GET_CLASS(item)->ack_dock != NULL)
- G_PANEL_ITEM_GET_CLASS(item)->ack_dock(item);
-
- notify_panel_docking(item, true);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = composant d'affichage à mettre à jour. *
-* status = nouvel état d'encapsulation. *
-* *
-* Description : Définit si le composant repose sur un support de l'éditeur. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_panel_item_set_dock_at_startup(GPanelItem *item, bool status)
-{
- char *key; /* Clef d'accès à un paramètre */
-
- item->docked = status;
-
- key = gtk_panel_item_class_build_configuration_key(G_PANEL_ITEM_GET_CLASS(item), "dock_at_startup");
-
- g_generic_config_set_value(get_main_configuration(), key, status);
-
- free(key);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = composant d'affichage à consulter. *
-* *
-* Description : Indique si le composant repose sur un support de l'éditeur. *
-* *
-* Retour : true si le composant est bien incrusté quelque part. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool g_panel_item_is_docked(const GPanelItem *item)
-{
- bool result; /* Statut à retourner */
-
- result = item->docked;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = composant à retirer de l'affichage. *
-* *
-* Description : Supprime un panneau de l'ensemble affiché. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_panel_item_undock(GPanelItem *item)
-{
- PanelItemPersonality personality; /* Caractéristique de panneau */
-
- assert(item->docked);
-
- g_signal_emit_by_name(item, "undock-request");
-
- if (G_PANEL_ITEM_GET_CLASS(item)->ack_undock != NULL)
- G_PANEL_ITEM_GET_CLASS(item)->ack_undock(item);
-
- notify_panel_docking(item, false);
-
- personality = gtk_panel_item_class_get_personality(G_PANEL_ITEM_GET_CLASS(item));
-
- if (personality != PIP_PERSISTENT_SINGLETON)
- unregister_editor_item(G_EDITOR_ITEM(item));
-
-}
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* MECANISMES DE MISE A JOUR DE PANNEAU */
-/* ---------------------------------------------------------------------------------- */
-
-
-/******************************************************************************
-* *
-* Paramètres : item = panneau ciblé par une mise à jour. *
-* *
-* Description : Obtient le groupe de travail dédié à une mise à jour. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-wgroup_id_t g_panel_item_get_group(const GPanelItem *item)
-{
- wgroup_id_t result; /* Identifiant à retourner */
-
- result = G_PANEL_ITEM_GET_CLASS(item)->gid;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : widget = composant graphique sur lequel dessiner. *
-* cr = contexte graphique pour le dessin. *
-* panel = panneau ciblé par une mise à jour. *
-* *
-* Description : Présente une copie de l'affichage du composant rafraîchi. *
-* *
-* Retour : FALSE afin de poursuivre les traitements. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static gboolean g_panel_item_draw_mask(GtkWidget *widget, cairo_t *cr, GPanelItem *item)
-{
- int width; /* Largeur du composant actuel */
- int height; /* Hauteur du composant actuel */
-
- width = gtk_widget_get_allocated_width(widget);
- height = gtk_widget_get_allocated_height(widget);
-
- cairo_save(cr);
-
- cairo_set_source_surface(cr, item->surface, 0, 0);
- cairo_rectangle(cr, 0, 0, width, height);
-
- cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
- cairo_fill(cr);
-
- cairo_restore(cr);
-
- return FALSE;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = panneau ciblé par une mise à jour. *
-* *
-* Description : Bascule l'affichage d'un panneau avant sa mise à jour. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_panel_item_switch_to_updating_mask(GPanelItem *item)
-{
- GtkBuilder *builder; /* Constructeur sous-jacent */
- GtkWidget *content; /* Composant à faire évoluer */
- GdkWindow *window; /* Fenêtre au contenu à copier */
- int width; /* Largeur du composant actuel */
- int height; /* Hauteur du composant actuel */
- cairo_t *cr; /* Pinceau pour les dessins */
- GtkAdjustment *adj; /* Défilement éventuel */
- GtkStack *stack; /* Pile de composants GTK */
- GtkWidget *mask; /* Masque des travaux */
-
- if (g_atomic_int_add(&item->switched, 1) > 0)
- return;
-
- /* Copie de l'affichage courant */
-
- assert(item->surface == NULL);
-
- builder = gtk_built_named_widget_get_builder(GTK_BUILT_NAMED_WIDGET(item->widget));
-
- content = GTK_WIDGET(gtk_builder_get_object(builder, "content"));
-
- window = gtk_widget_get_window(content);
-
- if (window != NULL)
- {
- width = gtk_widget_get_allocated_width(content);
- height = gtk_widget_get_allocated_height(content);
-
- item->surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
-
- cr = cairo_create(item->surface);
-
- gdk_cairo_set_source_window(cr, window, 0, 0);
-
- cairo_paint(cr);
-
- cairo_destroy(cr);
-
- }
-
- /* Sauvegarde de l'éventuelle position */
-
- if (GTK_IS_SCROLLED_WINDOW(content))
- {
- adj = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(content));
- item->hadj_value = gtk_adjustment_get_value(adj);
-
- adj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(content));
- item->vadj_value = gtk_adjustment_get_value(adj);
-
- }
-
- /* Opération de basculement effectif */
-
- stack = GTK_STACK(gtk_builder_get_object(builder, "stack"));
-
- mask = GTK_WIDGET(gtk_builder_get_object(builder, "mask"));
-
- gtk_spinner_start(GTK_SPINNER(mask));
-
- if (item->surface != NULL)
- g_signal_connect(mask, "draw", G_CALLBACK(g_panel_item_draw_mask), item);
-
- gtk_stack_set_visible_child(stack, mask);
-
- g_object_unref(G_OBJECT(builder));
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = panneau ciblé par une mise à jour. *
-* *
-* Description : Bascule l'affichage d'un panneau après sa mise à jour. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_panel_item_switch_to_updated_content(GPanelItem *item)
-{
- GtkBuilder *builder; /* Constructeur sous-jacent */
- GtkWidget *content; /* Composant à faire évoluer */
- GtkAdjustment *adj; /* Défilement éventuel */
- GtkStack *stack; /* Pile de composants GTK */
- GtkWidget *mask; /* Masque des travaux */
-
- if (g_atomic_int_get(&item->switched) > 1)
- goto skip;
-
- /* Restauration d'une éventuelle position */
-
- builder = gtk_built_named_widget_get_builder(GTK_BUILT_NAMED_WIDGET(item->widget));
-
- content = GTK_WIDGET(gtk_builder_get_object(builder, "content"));
-
- if (GTK_IS_SCROLLED_WINDOW(content))
- {
- adj = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(content));
- gtk_adjustment_set_value(adj, item->hadj_value);
-
- adj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(content));
- gtk_adjustment_set_value(adj, item->vadj_value);
-
- }
-
- /* Opération de basculement effectif */
-
- stack = GTK_STACK(gtk_builder_get_object(builder, "stack"));
-
- gtk_stack_set_visible_child(stack, content);
-
- mask = GTK_WIDGET(gtk_builder_get_object(builder, "mask"));
-
- g_signal_handlers_disconnect_by_func(mask, G_CALLBACK(g_panel_item_draw_mask), item);
-
- gtk_spinner_stop(GTK_SPINNER(mask));
-
- /* Supression de la copie d'affichage */
-
- if (item->surface != NULL)
- {
- cairo_surface_destroy(item->surface);
- item->surface = NULL;
- }
-
- g_object_unref(G_OBJECT(builder));
-
- skip:
-
- g_atomic_int_dec_and_test(&item->switched);
-
-}
-
-
-#endif
diff --git a/src/gui/panel.h b/src/gui/panel.h
deleted file mode 100644
index 03b67d4..0000000
--- a/src/gui/panel.h
+++ /dev/null
@@ -1,148 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * panel.h - prototypes pour la gestion des éléments réactifs spécifiques aux panneaux
- *
- * Copyright (C) 2019-2024 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_PANEL_H
-#define _GUI_PANEL_H
-
-
-#include "../glibext/helpers.h"
-#include "../gtkext/panel.h"
-
-
-#include <gtk/gtk.h>
-
-
-
-#define G_TYPE_PANEL_ITEM (g_panel_item_get_type())
-
-DECLARE_GTYPE(GPanelItem, g_panel_item, G, PANEL_ITEM);
-
-
-/* Types de panneaux pour éditeur */
-typedef enum _PanelItemPersonality
-{
- PIP_NONE, /* Pas de particularité */
-
- PIP_MAIN_PANEL, /* Panneau principal */
- PIP_SINGLETON, /* Instance unique */
-
- PIP_COUNT
-
-} PanelItemPersonality;
-
-
-/* Fournit une indication sur la personnalité du panneau. */
-PanelItemPersonality g_panel_item_get_personality(const GPanelItem *);
-
-/* Fournit un composant pour lancer l'activité d'un panneau. */
-GtkWidget *g_panel_item_get_launcher(GPanelItem *);
-
-/* Fournit un composant pour paramétrer l'activité d'un panneau. */
-GtkWidget *g_panel_item_get_properties(GPanelItem *);
-
-/* Fournit un composant représentant un panneau graphique. */
-GtkTiledPanel *g_panel_item_get_panel(GPanelItem *);
-
-
-
-
-
-
-
-
-
-#if 0
-
-
-#include <stdbool.h>
-#include <gtk/gtk.h>
-
-
-#include "../glibext/configuration.h"
-#include "../glibext/named.h"
-
-
-
-#define G_TYPE_PANEL_ITEM g_panel_item_get_type()
-#define G_PANEL_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_PANEL_ITEM, GPanelItem))
-#define G_IS_PANEL_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_PANEL_ITEM))
-#define G_PANEL_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_PANEL_ITEM, GPanelItemClass))
-#define G_IS_PANEL_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_PANEL_ITEM))
-#define G_PANEL_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_PANEL_ITEM, GPanelItemClass))
-
-
-/* Elément réactif pour panneaux de l'éditeur (instance) */
-typedef struct _GPanelItem GPanelItem;
-
-/* Elément réactif pour panneaux de l'éditeur (classe) */
-typedef struct _GPanelItemClass GPanelItemClass;
-
-
-
-
-/* Indique le type défini pour un élément destiné à un panneau. */
-GType g_panel_item_get_type(void);
-
-/* Fournit une indication d'accroche du panneau au démarrage. */
-bool gtk_panel_item_class_dock_at_startup(const GPanelItemClass *);
-
-/* Détermine si un panneau peut être filtré. */
-bool gtk_panel_item_class_can_search(const GPanelItemClass *);
-
-/* Indique le chemin initial de la localisation d'un panneau. */
-char *gtk_panel_item_class_get_path(const GPanelItemClass *);
-
-/* Indique la définition d'un éventuel raccourci clavier. */
-char *gtk_panel_item_class_get_key_bindings(const GPanelItemClass *);
-
-/* Met en place les bases de la configuration du panneau. */
-bool gtk_panel_item_class_setup_configuration(const GPanelItemClass *, GGenConfig *);
-
-/* Crée un élément de panneau réactif. */
-GPanelItem *g_panel_item_new(GType, const char *);
-
-/* Indique le composant graphique principal du panneau. */
-GNamedWidget *gtk_panel_item_get_named_widget(const GPanelItem *);
-
-/* Définit le chemin d'accès à utiliser pour les encapsulations. */
-void gtk_panel_item_set_path(GPanelItem *, const char *);
-
-/* Place un panneau dans l'ensemble affiché. */
-void g_panel_item_dock(GPanelItem *);
-
-/* Définit si le composant repose sur un support de l'éditeur. */
-void g_panel_item_set_dock_at_startup(GPanelItem *, bool);
-
-/* Indique si le composant repose sur un support de l'éditeur. */
-bool g_panel_item_is_docked(const GPanelItem *);
-
-/* Supprime un panneau de l'ensemble affiché. */
-void g_panel_item_undock(GPanelItem *);
-
-
-#endif
-
-
-
-#endif /* _GUI_PANEL_H */
diff --git a/src/gui/panels/Makefile.am b/src/gui/panels/Makefile.am
index 476a436..ecff6c7 100644
--- a/src/gui/panels/Makefile.am
+++ b/src/gui/panels/Makefile.am
@@ -11,7 +11,6 @@ UI_FILES = \
errors.ui \
glance.ui \
history.ui \
- log.ui \
regedit.ui \
strings.ui \
symbols.ui
@@ -22,7 +21,6 @@ libguipanels_la_SOURCES = \
errors.h errors.c \
glance.h glance.c \
history.h history.c \
- log.h log.c \
regedit.h regedit.c \
resources.h resources.c \
strings.h strings.c \
@@ -38,9 +36,11 @@ IMG_PATH = ../../../data/images
RES_FILES = \
binary.ui \
- binary-launch.ui \
- binary-props.ui \
+ binary-params.ui \
$(IMG_PATH)/binfile-symbolic.svg \
+ logs.ui \
+ logs-col-icon.ui \
+ logs-col-message.ui \
welcome.ui \
welcome-hints.txt \
$(IMG_PATH)/tipoftheday-symbolic.svg
@@ -48,6 +48,10 @@ RES_FILES = \
libguipanels4_la_SOURCES = \
binary-int.h \
binary.h binary.c \
+ binary-params-int.h \
+ binary-params.h binary-params.c \
+ logs-int.h \
+ logs.h logs.c \
resources.h resources.c \
welcome-int.h \
welcome.h welcome.c
diff --git a/src/gui/panels/binary-int.h b/src/gui/panels/binary-int.h
index f68da9b..5116f5c 100644
--- a/src/gui/panels/binary-int.h
+++ b/src/gui/panels/binary-int.h
@@ -27,14 +27,10 @@
#include "binary.h"
-#include "../panel-int.h"
#include "../../gtkext/panel-int.h"
-/* ------------------------- COEUR D'UN PANNEAU D'AFFICHAGE ------------------------- */
-
-
/* Panneau d'accueil par défaut (instance) */
struct _GtkBinaryPanel
{
@@ -53,23 +49,4 @@ struct _GtkBinaryPanelClass
-/* ---------------------- MANIPULATIONS D'UN PANNEAU GRAPHIQUE ---------------------- */
-
-
-/* Définition pour gestion par le framework d'un panneau graphique (instance) */
-struct _GBinaryPanel
-{
- GPanelItem parent; /* A laisser en premier */
-
-};
-
-/* Définition pour gestion par le framework d'un panneau graphique (classe) */
-struct _GBinaryPanelClass
-{
- GPanelItemClass parent; /* A laisser en premier */
-
-};
-
-
-
#endif /* _GUI_PANELS_BINARY_INT_H */
diff --git a/src/gui/panels/binary-launch.ui b/src/gui/panels/binary-launch.ui
deleted file mode 100644
index 553f758..0000000
--- a/src/gui/panels/binary-launch.ui
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
-
- <object class="GtkGrid" id="launcher">
- <property name="margin-bottom">12</property>
- <property name="margin-end">12</property>
- <property name="margin-start">12</property>
- <property name="margin-top">12</property>
- <property name="column-spacing">12</property>
- <child>
- <object class="GtkImage">
- <property name="icon-name">binfile-symbolic</property>
- <property name="pixel-size">48</property>
- <layout>
- <property name="column">0</property>
- <property name="row">0</property>
- <property name="row-span">2</property>
- </layout>
- <style>
- <class name="icon-dropshadow"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="label">&lt;b&gt;Binary analysis&lt;/b&gt;</property>
- <property name="use-markup">TRUE</property>
- <property name="xalign">0</property>
- <layout>
- <property name="column">1</property>
- <property name="row">0</property>
- </layout>
- </object>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="label">Load a binary content and parse its format if recognized</property>
- <property name="hexpand">true</property>
- <property name="xalign">0</property>
- <layout>
- <property name="column">1</property>
- <property name="row">1</property>
- </layout>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkImage">
- <property name="icon-name">go-next-symbolic</property>
- <property name="margin-start">12</property>
- <layout>
- <property name="column">2</property>
- <property name="row">0</property>
- <property name="row-span">2</property>
- </layout>
- <style>
- <class name="icon-dropshadow"/>
- </style>
- </object>
- </child>
- </object>
-
-</interface>
diff --git a/src/gui/panels/binary-params-int.h b/src/gui/panels/binary-params-int.h
new file mode 100644
index 0000000..0fbef24
--- /dev/null
+++ b/src/gui/panels/binary-params-int.h
@@ -0,0 +1,50 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * binary-params-int.h - définitions internes pour l'édition des paramètres initiaux d'un chargement de binaire
+ *
+ * Copyright (C) 2025 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 Chrysalide. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _GUI_PANELS_BINARY_PARAMS_INT_H
+#define _GUI_PANELS_BINARY_PARAMS_INT_H
+
+
+#include "binary-params.h"
+
+
+
+/* Composant pour les paramètres de chargement d'un binaire (instance) */
+struct _GtkBinaryParameters
+{
+ GtkGrid parent; /* A laisser en premier */
+
+ GtkEntry *filename; /* CHemin d'un binaire */
+
+};
+
+/* Composant pour les paramètres de chargement d'un binaire (classe) */
+struct _GtkBinaryParametersClass
+{
+ GtkGridClass parent; /* A laisser en premier */
+
+};
+
+
+
+#endif /* _GUI_PANELS_BINARY_PARAMS_INT_H */
diff --git a/src/gui/panels/binary-params.c b/src/gui/panels/binary-params.c
new file mode 100644
index 0000000..1059761
--- /dev/null
+++ b/src/gui/panels/binary-params.c
@@ -0,0 +1,178 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * binary-params.c - édition des paramètres initiaux d'un chargement de binaire
+ *
+ * Copyright (C) 2025 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 Chrysalide. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include "binary-params.h"
+
+
+#include "binary.h"
+#include "binary-params-int.h"
+#include "../window.h"
+#include "../../analysis/contents/file.h"
+#include "../../gtkext/helpers.h"
+
+
+
+/* Initialise la classe des composants d'édition de paramètres. */
+static void gtk_binary_parameters_class_init(GtkBinaryParametersClass *);
+
+/* Initialise une instance de composant d'édition de paramètres. */
+static void gtk_binary_parameters_init(GtkBinaryParameters *);
+
+/* Supprime toutes les références externes. */
+static void gtk_binary_parameters_dispose(GObject *);
+
+/* Procède à la libération totale de la mémoire. */
+static void gtk_binary_parameters_finalize(GObject *);
+
+/* Ouvre une boîte de dialogue pour récupérer un fichier. */
+static void gtk_binary_parameters_on_new_file_entry_icon_release(GtkEntry *, GtkEntryIconPosition, GtkBinaryParameters *);
+
+
+
+/* Détermine le type du composant d'édition des paramètres de chargement. */
+G_DEFINE_TYPE(GtkBinaryParameters, gtk_binary_parameters, GTK_TYPE_GRID);
+
+
+/******************************************************************************
+* *
+* Paramètres : class = classe GTK à initialiser. *
+* *
+* Description : Initialise la classe des composants d'édition de paramètres. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_binary_parameters_class_init(GtkBinaryParametersClass *class)
+{
+ GObjectClass *object; /* Plus haut niveau équivalent */
+ GtkWidgetClass *widget; /* Classe de haut niveau */
+
+ object = G_OBJECT_CLASS(class);
+
+ object->dispose = gtk_binary_parameters_dispose;
+ object->finalize = gtk_binary_parameters_finalize;
+
+ widget = GTK_WIDGET_CLASS(class);
+
+ gtk_widget_class_set_template_from_resource(widget, "/re/chrysalide/framework/gui/panels/binary-params.ui");
+
+ gtk_widget_class_bind_template_callback_full(widget, BUILDER_CB(gtk_binary_parameters_on_new_file_entry_icon_release));
+
+ gtk_widget_class_bind_template_child(widget, GtkBinaryParameters, filename);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : params = composant GTK à initialiser. *
+* *
+* Description : Initialise une instance de composant d'édition de paramètres.*
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_binary_parameters_init(GtkBinaryParameters *params)
+{
+ gtk_widget_init_template(GTK_WIDGET(params));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : object = instance d'objet GLib à traiter. *
+* *
+* Description : Supprime toutes les références externes. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_binary_parameters_dispose(GObject *object)
+{
+ gtk_widget_dispose_template(GTK_WIDGET(object), GTK_TYPE_BINARY_PARAMETERS);
+
+ G_OBJECT_CLASS(gtk_binary_parameters_parent_class)->dispose(object);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : object = instance d'objet GLib à traiter. *
+* *
+* Description : Procède à la libération totale de la mémoire. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_binary_parameters_finalize(GObject *object)
+{
+ G_OBJECT_CLASS(gtk_binary_parameters_parent_class)->finalize(object);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : entry = zone de saisie concernée par l'appel. *
+* icon_pos = position de l'icone incrustée dans la zone. *
+* params = composant d'édition des paramètres. *
+* *
+* Description : Ouvre une boîte de dialogue pour récupérer un fichier. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_binary_parameters_on_new_file_entry_icon_release(GtkEntry *entry, GtkEntryIconPosition icon_pos, GtkBinaryParameters *params)
+{
+ GtkRoot *root; /* Racine du composant */
+ GBinContent *content; /* Contenu binaire à afficher */
+ GtkTiledPanel *tiled; /* Panneau d'affichage complet */
+
+ root = gtk_widget_get_root(GTK_WIDGET(entry));
+
+ content = g_file_content_new("/bin/id");
+
+ tiled = gtk_binary_panel_new_for_content(content);
+
+ unref_object(content);
+
+ gtk_framework_window_add(GTK_FRAMEWORK_WINDOW(root), tiled);
+
+}
diff --git a/src/gui/panels/binary-params.h b/src/gui/panels/binary-params.h
new file mode 100644
index 0000000..450da25
--- /dev/null
+++ b/src/gui/panels/binary-params.h
@@ -0,0 +1,41 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * binary-params.h - prototypes pour l'édition des paramètres initiaux d'un chargement de binaire
+ *
+ * Copyright (C) 2025 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 Chrysalide. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _GUI_PANELS_BINARY_PARAMS_H
+#define _GUI_PANELS_BINARY_PARAMS_H
+
+
+#include <gtk/gtk.h>
+
+
+#include "../../glibext/helpers.h"
+
+
+
+#define GTK_TYPE_BINARY_PARAMETERS (gtk_binary_parameters_get_type())
+
+DECLARE_GTYPE(GtkBinaryParameters, gtk_binary_parameters, GTK, BINARY_PARAMETERS);
+
+
+
+#endif /* _GUI_PANELS_BINARY_PARAMS_H */
diff --git a/src/gui/panels/binary-props.ui b/src/gui/panels/binary-params.ui
index bd48ea8..dcbaf7c 100644
--- a/src/gui/panels/binary-props.ui
+++ b/src/gui/panels/binary-params.ui
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <object class="GtkGrid" id="properties">
+ <template class="GtkBinaryParameters" parent="GtkGrid">
<property name="margin-bottom">12</property>
<property name="margin-end">12</property>
<property name="margin-start">12</property>
<property name="margin-top">12</property>
<property name="column-spacing">12</property>
<property name="row-spacing">8</property>
+
<child>
<object class="GtkLabel">
<property name="label">Load and analyze a new file:</property>
@@ -18,8 +19,9 @@
</layout>
</object>
</child>
+
<child>
- <object class="GtkEntry" id="new_file">
+ <object class="GtkEntry" id="filename">
<property name="secondary-icon-name">document-open-symbolic</property>
<property name="placeholder-text">File location</property>
<property name="hexpand">TRUE</property>
@@ -31,9 +33,10 @@
<style>
<class name="background"/>
</style>
- <signal name="icon-release" handler="g_binary_panel_on_new_file_entry_icon_release"/>
+ <signal name="icon-release" handler="gtk_binary_parameters_on_new_file_entry_icon_release"/>
</object>
</child>
- </object>
+
+ </template>
</interface>
diff --git a/src/gui/panels/binary.c b/src/gui/panels/binary.c
index de0a4d0..f58c06b 100644
--- a/src/gui/panels/binary.c
+++ b/src/gui/panels/binary.c
@@ -26,8 +26,6 @@
#include "binary-int.h"
-#include "../window.h"
-#include "../../analysis/contents/file.h"
#include "../../gtkext/helpers.h"
#include "../../gtkext/hexview.h"
@@ -43,10 +41,10 @@ static void gtk_binary_panel_class_init(GtkBinaryPanelClass *);
static void gtk_binary_panel_init(GtkBinaryPanel *);
/* Supprime toutes les références externes. */
-static void gtk_binary_panel_dispose(GtkBinaryPanel *);
+static void gtk_binary_panel_dispose(GObject *);
/* Procède à la libération totale de la mémoire. */
-static void gtk_binary_panel_finalize(GtkBinaryPanel *);
+static void gtk_binary_panel_finalize(GObject *);
@@ -57,49 +55,12 @@ static void gtk_binary_panel_finalize(GtkBinaryPanel *);
-/* ---------------------- MANIPULATIONS D'UN PANNEAU GRAPHIQUE ---------------------- */
-
-
-/* Initialise la classe des panneaux graphiques pour binaires. */
-static void g_binary_panel_class_init(GBinaryPanelClass *);
-
-/* Initialise une instance de panneau graphique pour binaire. */
-static void g_binary_panel_init(GBinaryPanel *);
-
-/* Supprime toutes les références externes. */
-static void g_binary_panel_dispose(GBinaryPanel *);
-
-/* Procède à la libération totale de la mémoire. */
-static void g_binary_panel_finalize(GBinaryPanel *);
-
-
-
-/* --------------------- IMPLEMENTATION DES FONCTIONS DE CLASSE --------------------- */
-
-
-/* Fournit une indication sur la personnalité du panneau. */
-static PanelItemPersonality g_binary_panel_get_personality(const GBinaryPanel *);
-
-/* Fournit un composant pour lancer l'activité d'un panneau. */
-static GtkWidget *g_binary_panel_get_launcher(GBinaryPanel *);
-
-/* Fournit un composant pour paramétrer l'activité d'un panneau. */
-static GtkWidget *g_binary_panel_get_properties(GBinaryPanel *);
-
-/* Ouvre une boîte de dialogue pour récupérer un fichier. */
-static void g_binary_panel_on_new_file_entry_icon_release(GtkEntry *, GtkEntryIconPosition, GBinaryPanel *);
-
-/* Fournit un composant représentant un panneau graphique. */
-static GtkTiledPanel *g_binary_panel_get_panel(GBinaryPanel *, GtkWidget *);
-
-
-
/* ---------------------------------------------------------------------------------- */
/* COEUR D'UN PANNEAU D'AFFICHAGE */
/* ---------------------------------------------------------------------------------- */
-/* Indique le type défini pour un panneau d'accueil. */
+/* Indique le type défini pour un panneau d'affichage de contenus d'un binaire. */
G_DEFINE_TYPE(GtkBinaryPanel, gtk_binary_panel, GTK_TYPE_TILED_PANEL);
@@ -122,8 +83,8 @@ static void gtk_binary_panel_class_init(GtkBinaryPanelClass *class)
object = G_OBJECT_CLASS(class);
- object->dispose = (GObjectFinalizeFunc/* ! */)gtk_binary_panel_dispose;
- object->finalize = (GObjectFinalizeFunc)gtk_binary_panel_finalize;
+ object->dispose = gtk_binary_panel_dispose;
+ object->finalize = gtk_binary_panel_finalize;
widget = GTK_WIDGET_CLASS(class);
@@ -155,7 +116,7 @@ static void gtk_binary_panel_init(GtkBinaryPanel *panel)
/******************************************************************************
* *
-* Paramètres : panel = instance d'objet GLib à traiter. *
+* Paramètres : object = instance d'objet GLib à traiter. *
* *
* Description : Supprime toutes les références externes. *
* *
@@ -165,18 +126,18 @@ static void gtk_binary_panel_init(GtkBinaryPanel *panel)
* *
******************************************************************************/
-static void gtk_binary_panel_dispose(GtkBinaryPanel *panel)
+static void gtk_binary_panel_dispose(GObject *object)
{
- gtk_widget_dispose_template(GTK_WIDGET(panel), GTK_TYPE_BINARY_PANEL);
+ gtk_widget_dispose_template(GTK_WIDGET(object), GTK_TYPE_BINARY_PANEL);
- G_OBJECT_CLASS(gtk_binary_panel_parent_class)->dispose(G_OBJECT(panel));
+ G_OBJECT_CLASS(gtk_binary_panel_parent_class)->dispose(object);
}
/******************************************************************************
* *
-* Paramètres : panel = instance d'objet GLib à traiter. *
+* Paramètres : object = instance d'objet GLib à traiter. *
* *
* Description : Procède à la libération totale de la mémoire. *
* *
@@ -186,9 +147,9 @@ static void gtk_binary_panel_dispose(GtkBinaryPanel *panel)
* *
******************************************************************************/
-static void gtk_binary_panel_finalize(GtkBinaryPanel *panel)
+static void gtk_binary_panel_finalize(GObject *object)
{
- G_OBJECT_CLASS(gtk_binary_panel_parent_class)->finalize(G_OBJECT(panel));
+ G_OBJECT_CLASS(gtk_binary_panel_parent_class)->finalize(object);
}
@@ -232,286 +193,3 @@ GtkTiledPanel *gtk_binary_panel_new_for_content(GBinContent *content)
-
-/* ---------------------------------------------------------------------------------- */
-/* MANIPULATIONS D'UN PANNEAU GRAPHIQUE */
-/* ---------------------------------------------------------------------------------- */
-
-
-/* Indique le type défini pour une manipulation de panneau pour binaires. */
-G_DEFINE_TYPE(GBinaryPanel, g_binary_panel, G_TYPE_PANEL_ITEM);
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe à initialiser. *
-* *
-* Description : Initialise la classe des panneaux graphiques pour binaires. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_binary_panel_class_init(GBinaryPanelClass *class)
-{
- GObjectClass *object; /* Autre version de la classe */
- GPanelItemClass *panel; /* Encore une autre vision... */
-
- object = G_OBJECT_CLASS(class);
-
- object->dispose = (GObjectFinalizeFunc/* ! */)g_binary_panel_dispose;
- object->finalize = (GObjectFinalizeFunc)g_binary_panel_finalize;
-
- panel = G_PANEL_ITEM_CLASS(class);
-
- panel->get_personality = (get_panel_item_personality_cb)g_binary_panel_get_personality;
- panel->get_launcher = (get_panel_item_widget_cb)g_binary_panel_get_launcher;
- panel->get_properties = (get_panel_item_widget_cb)g_binary_panel_get_properties;
- panel->get_panel = (get_panel_item_panel_cb)g_binary_panel_get_panel;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = instance à initialiser. *
-* *
-* Description : Initialise une instance de panneau graphique pour binaire. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_binary_panel_init(GBinaryPanel *panel)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = instance d'objet GLib à traiter. *
-* *
-* Description : Supprime toutes les références externes. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_binary_panel_dispose(GBinaryPanel *panel)
-{
- G_OBJECT_CLASS(g_binary_panel_parent_class)->dispose(G_OBJECT(panel));
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = instance d'objet GLib à traiter. *
-* *
-* Description : Procède à la libération totale de la mémoire. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_binary_panel_finalize(GBinaryPanel *panel)
-{
- G_OBJECT_CLASS(g_binary_panel_parent_class)->finalize(G_OBJECT(panel));
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Constitue une définition de manipulation de panneau. *
-* *
-* Retour : Définition de propriétés mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GPanelItem *g_binary_panel_new(void)
-{
- GPanelItem *result; /* Structure à retourner */
-
- result = g_object_new(G_TYPE_BINARY_PANEL, NULL);
-
- return result;
-
-}
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* IMPLEMENTATION DES FONCTIONS DE CLASSE */
-/* ---------------------------------------------------------------------------------- */
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = définition de panneau à consulter. *
-* *
-* Description : Fournit une indication sur la personnalité du panneau. *
-* *
-* Retour : Identifiant lié à la nature du panneau. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static PanelItemPersonality g_binary_panel_get_personality(const GBinaryPanel *panel)
-{
- PanelItemPersonality result; /* Personnalité à retourner */
-
- result = PIP_MAIN_PANEL;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = définition de panneau à manipuler. *
-* *
-* Description : Fournit un composant pour lancer l'activité d'un panneau. *
-* *
-* Retour : Composant GTK (déjà ?) mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GtkWidget *g_binary_panel_get_launcher(GBinaryPanel *panel)
-{
- GtkWidget *result; /* Composant à retourner */
- GtkBuilder *builder; /* Constructeur d'UI */
-
- builder = gtk_builder_new_from_resource("/re/chrysalide/framework/gui/panels/binary-launch.ui");
-
- result = GTK_WIDGET(gtk_builder_get_object(builder, "launcher"));
- ref_object(result);
-
- unref_object(builder);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = définition de panneau à manipuler. *
-* *
-* Description : Fournit un composant pour paramétrer l'activité d'un panneau.*
-* *
-* Retour : Composant GTK (déjà ?) mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GtkWidget *g_binary_panel_get_properties(GBinaryPanel *panel)
-{
- GtkWidget *result; /* Composant à retourner */
- GtkBuilderScope *scope; /* Fonctions pour signaux */
- GtkBuilderCScope *cscope; /* Fonctions pour signaux */
- GtkBuilder *builder; /* Constructeur d'UI */
-#ifndef NDEBUG
- gboolean status; /* Bilan d'un chargement */
-#endif
-
- scope = gtk_builder_cscope_new();
- cscope = GTK_BUILDER_CSCOPE(scope);
-
- gtk_builder_cscope_add_callback_symbol(cscope, BUILDER_CB(g_binary_panel_on_new_file_entry_icon_release));
-
- builder = gtk_builder_new();
- gtk_builder_set_scope(builder, scope);
- gtk_builder_set_current_object(builder, G_OBJECT(panel));
-
-#ifndef NDEBUG
- status = gtk_builder_add_from_resource(builder, "/re/chrysalide/framework/gui/panels/binary-props.ui", NULL);
- assert(status);
-#else
- gtk_builder_add_from_resource(builder, "/re/chrysalide/framework/gui/panels/binary-props.ui", NULL);
-#endif
-
- result = GTK_WIDGET(gtk_builder_get_object(builder, "properties"));
- ref_object(result);
-
- unref_object(builder);
- unref_object(scope);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : entry = zone de saisie concernée par l'appel. *
-* icon_pos = position de l'icone incrustée dans la zone. *
-* panel = définition de panneau à manipuler. *
-* *
-* Description : Ouvre une boîte de dialogue pour récupérer un fichier. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_binary_panel_on_new_file_entry_icon_release(GtkEntry *entry, GtkEntryIconPosition icon_pos, GBinaryPanel *panel)
-{
- GtkRoot *root; /* Racine du composant */
- GtkTiledPanel *tiled; /* Panneau d'affichage complet */
-
- root = gtk_widget_get_root(GTK_WIDGET(entry));
-
- tiled = g_binary_panel_get_panel(panel, NULL);
-
- gtk_framework_window_add(GTK_FRAMEWORK_WINDOW(root), tiled);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = définition de panneau à manipuler. *
-* props = éventuels éléments graphiques de paramétrages. *
-* *
-* Description : Fournit un composant représentant un panneau graphique. *
-* *
-* Retour : Composant GTK (déjà ?) mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GtkTiledPanel *g_binary_panel_get_panel(GBinaryPanel *panel, GtkWidget *props)
-{
- GtkTiledPanel *result; /* Composant à retourner */
- GBinContent *content; /* Contenu binaire à afficher */
-
- content = g_file_content_new("/bin/id");
-
- result = gtk_binary_panel_new_for_content(content);
-
- unref_object(content);
-
- return result;
-
-}
diff --git a/src/gui/panels/binary.h b/src/gui/panels/binary.h
index e92895b..26f8a7d 100644
--- a/src/gui/panels/binary.h
+++ b/src/gui/panels/binary.h
@@ -29,16 +29,12 @@
#include <gtk/gtk.h>
-#include "../panel.h"
#include "../../analysis/content.h"
#include "../../glibext/helpers.h"
#include "../../gtkext/panel.h"
-/* ------------------------- COEUR D'UN PANNEAU D'AFFICHAGE ------------------------- */
-
-
#define GTK_TYPE_BINARY_PANEL (gtk_binary_panel_get_type())
DECLARE_GTYPE(GtkBinaryPanel, gtk_binary_panel, GTK, BINARY_PANEL);
@@ -49,17 +45,4 @@ GtkTiledPanel *gtk_binary_panel_new_for_content(GBinContent *);
-/* ---------------------- MANIPULATIONS D'UN PANNEAU GRAPHIQUE ---------------------- */
-
-
-#define G_TYPE_BINARY_PANEL (g_binary_panel_get_type())
-
-DECLARE_GTYPE(GBinaryPanel, g_binary_panel, G, BINARY_PANEL);
-
-
-/* Constitue une définition de manipulation de panneau. */
-GPanelItem *g_binary_panel_new(void);
-
-
-
#endif /* _GUI_PANELS_BINARY_H */
diff --git a/src/gui/panels/gresource.xml b/src/gui/panels/gresource.xml
index d00953d..2765b25 100644
--- a/src/gui/panels/gresource.xml
+++ b/src/gui/panels/gresource.xml
@@ -2,8 +2,10 @@
<gresources>
<gresource prefix="/re/chrysalide/framework/gui/panels">
<file compressed="true">binary.ui</file>
- <file compressed="true">binary-launch.ui</file>
- <file compressed="true">binary-props.ui</file>
+ <file compressed="true">binary-params.ui</file>
+ <file compressed="true">logs.ui</file>
+ <file compressed="true">logs-col-icon.ui</file>
+ <file compressed="true">logs-col-message.ui</file>
<file compressed="true">welcome.ui</file>
<file compressed="true">welcome-hints.txt</file>
</gresource>
diff --git a/src/gui/panels/log.c b/src/gui/panels/log.c
deleted file mode 100644
index d11fbd2..0000000
--- a/src/gui/panels/log.c
+++ /dev/null
@@ -1,451 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * log.c - panneau d'affichage des messages système
- *
- * Copyright (C) 2012-2019 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 "log.h"
-
-
-#include <malloc.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-#include <gtk/gtk.h>
-
-
-#include "../panel-int.h"
-#include "../core/panels.h"
-#include "../../gtkext/easygtk.h"
-#include "../../gtkext/named.h"
-
-
-
-/* Colonnes de la liste des messages */
-typedef enum _LogColumn
-{
- LGC_PICTURE, /* Image de représentation */
- LGC_STRING, /* Chaîne de caractères */
-
- LGC_COUNT /* Nombre de colonnes */
-
-} LogColumn;
-
-
-/* Paramètres à transmettre pour un affichage */
-typedef struct _log_data
-{
- GPanelItem *item; /* Intermédiaire mis en place */
- LogMessageType type; /* Type de message à afficher */
- char *msg; /* Contenu du message */
-
-} log_data;
-
-
-/* Panneau d'accueil (instance) */
-struct _GLogPanel
-{
- GPanelItem parent; /* A laisser en premier */
-
-};
-
-
-/* Panneau d'accueil (classe) */
-struct _GLogPanelClass
-{
- GPanelItemClass parent; /* A laisser en premier */
-
-};
-
-
-/* Initialise la classe des panneaux d'affichage des messages. */
-static void g_log_panel_class_init(GLogPanelClass *);
-
-/* Initialise une instance de panneau d'affichage des messages. */
-static void g_log_panel_init(GLogPanel *);
-
-/* Supprime toutes les références externes. */
-static void g_log_panel_dispose(GLogPanel *);
-
-/* Procède à la libération totale de la mémoire. */
-static void g_log_panel_finalize(GLogPanel *);
-
-/* Fournit le nom interne attribué à l'élément réactif. */
-static char *g_log_panel_class_get_key(const GLogPanelClass *);
-
-/* Fournit une indication sur la personnalité du panneau. */
-static PanelItemPersonality g_log_panel_class_get_personality(const GLogPanelClass *);
-
-/* Indique le chemin initial de la localisation d'un panneau. */
-static char *g_log_panel_class_get_path(const GLogPanelClass *);
-
-/* Indique la définition d'un éventuel raccourci clavier. */
-static char *g_log_panel_class_get_key_bindings(const GLogPanelClass *);
-
-/* Affiche un message dans le journal des messages système. */
-static gboolean log_message(log_data *);
-
-
-
-/* Indique le type défini pour un panneau d'affichage de messages. */
-G_DEFINE_TYPE(GLogPanel, g_log_panel, G_TYPE_PANEL_ITEM);
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe à initialiser. *
-* *
-* Description : Initialise la classe des panneaux d'affichage des messages. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_log_panel_class_init(GLogPanelClass *class)
-{
- GObjectClass *object; /* Autre version de la classe */
- GEditorItemClass *item; /* Encore une autre vision... */
- GPanelItemClass *panel; /* Version parente de la classe*/
-
- object = G_OBJECT_CLASS(class);
-
- object->dispose = (GObjectFinalizeFunc/* ! */)g_log_panel_dispose;
- object->finalize = (GObjectFinalizeFunc)g_log_panel_finalize;
-
- item = G_EDITOR_ITEM_CLASS(class);
-
- item->get_key = (get_item_key_fc)g_log_panel_class_get_key;
-
- panel = G_PANEL_ITEM_CLASS(class);
-
- panel->get_personality = (get_panel_personality_fc)g_log_panel_class_get_personality;
- panel->get_path = (get_panel_path_fc)g_log_panel_class_get_path;
- panel->get_bindings = (get_panel_bindings_fc)g_log_panel_class_get_key_bindings;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = instance à initialiser. *
-* *
-* Description : Initialise une instance de panneau d'affichage des messages. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_log_panel_init(GLogPanel *panel)
-{
- GPanelItem *pitem; /* Version parente du panneau */
-
- /* Eléments de base */
-
- pitem = G_PANEL_ITEM(panel);
-
- pitem->widget = G_NAMED_WIDGET(gtk_built_named_widget_new_for_panel(_("Messages"),
- _("Misc information"),
- PANEL_LOG_ID));
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = instance d'objet GLib à traiter. *
-* *
-* Description : Supprime toutes les références externes. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_log_panel_dispose(GLogPanel *panel)
-{
- G_OBJECT_CLASS(g_log_panel_parent_class)->dispose(G_OBJECT(panel));
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = instance d'objet GLib à traiter. *
-* *
-* Description : Procède à la libération totale de la mémoire. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_log_panel_finalize(GLogPanel *panel)
-{
- G_OBJECT_CLASS(g_log_panel_parent_class)->finalize(G_OBJECT(panel));
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe à consulter. *
-* *
-* Description : Fournit le nom interne attribué à l'élément réactif. *
-* *
-* Retour : Désignation (courte) de l'élément de l'éditeur. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static char *g_log_panel_class_get_key(const GLogPanelClass *class)
-{
- char *result; /* Description à renvoyer */
-
- result = strdup(PANEL_LOG_ID);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe à consulter. *
-* *
-* Description : Fournit une indication sur la personnalité du panneau. *
-* *
-* Retour : Identifiant lié à la nature unique du panneau. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static PanelItemPersonality g_log_panel_class_get_personality(const GLogPanelClass *class)
-{
- PanelItemPersonality result; /* Personnalité à retourner */
-
- result = PIP_PERSISTENT_SINGLETON;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe à consulter. *
-* *
-* Description : Indique le chemin initial de la localisation d'un panneau. *
-* *
-* Retour : Chemin fixé associé à la position initiale. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static char *g_log_panel_class_get_path(const GLogPanelClass *class)
-{
- char *result; /* Emplacement à retourner */
-
- result = strdup("Ms");
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe à consulter. *
-* *
-* Description : Indique la définition d'un éventuel raccourci clavier. *
-* *
-* Retour : Description d'un raccourci ou NULL si aucun de défini. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static char *g_log_panel_class_get_key_bindings(const GLogPanelClass *class)
-{
- char *result; /* Emplacement à retourner */
-
- result = strdup("<Shift>F1");
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Crée un panneau d'affichage des messages système. *
-* *
-* Retour : Adresse de la structure mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GPanelItem *g_log_panel_new(void)
-{
- GPanelItem *result; /* Structure à retourner */
-
- result = g_object_new(G_TYPE_LOG_PANEL, NULL);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = instance d'objet GLib à traiter. *
-* type = espèce du message à ajouter. *
-* msg = message à faire apparaître à l'écran. *
-* *
-* Description : Affiche un message dans le journal des messages système. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_log_panel_add_message(GLogPanel *panel, LogMessageType type, const char *msg)
-{
- log_data *data; /* Paramètres à joindre */
-
- data = calloc(1, sizeof(log_data));
-
- data->item = G_PANEL_ITEM(panel);
- data->type = type;
- data->msg = strdup(msg);
-
- g_object_ref(G_OBJECT(data->item));
-
- g_main_context_invoke(NULL, (GSourceFunc)log_message, data);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = paramètres destinés à l'affichage d'un message. *
-* *
-* Description : Affiche un message dans le journal des messages système. *
-* *
-* Retour : - *
-* *
-* Remarques : Cette fonction, et c'est tout son intérêt, est toujours *
-* exécutée dans le contexte GTK principal. *
-* *
-******************************************************************************/
-
-static gboolean log_message(log_data *data)
-{
- GtkBuilder *builder; /* Constructeur utilisé */
- GtkListStore *store; /* Modèle de gestion */
- GtkTreeIter iter; /* Point d'insertion */
- GtkTreeView *treeview; /* Affichage de la liste */
-
- builder = gtk_built_named_widget_get_builder(GTK_BUILT_NAMED_WIDGET(G_PANEL_ITEM(data->item)->widget));
-
- /* Mise en place du message */
-
- store = GTK_LIST_STORE(gtk_builder_get_object(builder, "store"));
-
- gtk_list_store_append(store, &iter);
-
- switch (data->type)
- {
- case LMT_INFO:
- gtk_list_store_set(store, &iter,
- LGC_PICTURE, "gtk-info",
- LGC_STRING, data->msg,
- -1);
- break;
-
- case LMT_PROCESS:
- gtk_list_store_set(store, &iter,
- LGC_PICTURE, "gtk-execute",
- LGC_STRING, data->msg,
- -1);
- break;
-
- case LMT_WARNING:
- gtk_list_store_set(store, &iter,
- LGC_PICTURE, "gtk-dialog-warning",
- LGC_STRING, data->msg,
- -1);
- break;
-
- case LMT_BAD_BINARY:
- gtk_list_store_set(store, &iter,
- LGC_PICTURE, "gtk-dialog-warning",
- LGC_STRING, data->msg,
- -1);
- break;
-
- case LMT_ERROR:
- case LMT_EXT_ERROR:
- gtk_list_store_set(store, &iter,
- LGC_PICTURE, "gtk-dialog-error",
- LGC_STRING, data->msg,
- -1);
- break;
-
- default:
- gtk_list_store_set(store, &iter,
- LGC_STRING, data->msg,
- -1);
- break;
-
- }
-
- /* Défilement pour pointer à l'affichage */
-
- treeview = GTK_TREE_VIEW(gtk_builder_get_object(builder, "treeview"));
-
- scroll_to_treeview_iter(treeview, GTK_TREE_MODEL(store), &iter);
-
- g_object_unref(G_OBJECT(builder));
-
- /* Nettoyage de la mémoire */
-
- g_object_unref(G_OBJECT(data->item));
-
- free(data->msg);
-
- free(data);
-
- return G_SOURCE_REMOVE;
-
-}
diff --git a/src/gui/panels/log.h b/src/gui/panels/log.h
deleted file mode 100644
index 4d155a2..0000000
--- a/src/gui/panels/log.h
+++ /dev/null
@@ -1,67 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * log.h - prototypes pour le panneau d'affichage des messages système
- *
- * Copyright (C) 2012-2019 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_PANELS_LOG_H
-#define _GUI_PANELS_LOG_H
-
-
-#include <i18n.h>
-
-
-#include "../panel.h"
-#include "../../core/logs.h"
-
-
-
-#define PANEL_LOG_ID "log"
-
-
-#define G_TYPE_LOG_PANEL g_log_panel_get_type()
-#define G_LOG_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_log_panel_get_type(), GLogPanel))
-#define G_IS_LOG_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_log_panel_get_type()))
-#define G_LOG_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_LOG_PANEL, GLogPanelClass))
-#define G_IS_LOG_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_LOG_PANEL))
-#define G_LOG_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_LOG_PANEL, GLogPanelClass))
-
-
-/* Panneau d'affichage de messages (instance) */
-typedef struct _GLogPanel GLogPanel;
-
-/* Panneau d'affichage de messages (classe) */
-typedef struct _GLogPanelClass GLogPanelClass;
-
-
-
-/* Indique le type défini pour un panneau d'affichage de messages. */
-GType g_log_panel_get_type(void);
-
-/* Crée un panneau d'affichage des messages système. */
-GPanelItem *g_log_panel_new(void);
-
-/* Affiche un message dans le journal des messages système. */
-void g_log_panel_add_message(GLogPanel *, LogMessageType, const char *);
-
-
-
-#endif /* _GUI_PANELS_LOG_H */
diff --git a/src/gui/panels/log.ui b/src/gui/panels/log.ui
deleted file mode 100644
index 4ffe96c..0000000
--- a/src/gui/panels/log.ui
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.21.0 -->
-<interface>
- <requires lib="gtk+" version="3.20"/>
- <object class="GtkListStore" id="store">
- <columns>
- <!-- column-name picture -->
- <column type="gchararray"/>
- <!-- column-name string -->
- <column type="gchararray"/>
- </columns>
- </object>
- <object class="GtkOffscreenWindow">
- <property name="can_focus">False</property>
- <child>
- <object class="GtkScrolledWindow" id="box">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="shadow_type">in</property>
- <child>
- <object class="GtkTreeView" id="treeview">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="model">store</property>
- <property name="headers_visible">False</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection"/>
- </child>
- <child>
- <object class="GtkTreeViewColumn">
- <property name="title" translatable="yes">picture</property>
- <child>
- <object class="GtkCellRendererPixbuf"/>
- <attributes>
- <attribute name="stock-id">0</attribute>
- </attributes>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn">
- <property name="title" translatable="yes">string</property>
- <child>
- <object class="GtkCellRendererText"/>
- <attributes>
- <attribute name="markup">1</attribute>
- </attributes>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child type="titlebar">
- <placeholder/>
- </child>
- </object>
-</interface>
diff --git a/src/gui/panels/logs-col-icon.ui b/src/gui/panels/logs-col-icon.ui
new file mode 100644
index 0000000..6463e84
--- /dev/null
+++ b/src/gui/panels/logs-col-icon.ui
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+
+ <template class="GtkListItem">
+ <property name="child">
+ <object class="GtkImage">
+ <binding name="icon-name">
+ <lookup name="icon-name" type="GLogEntry">
+ <lookup name="item">GtkListItem</lookup>
+ </lookup>
+ </binding>
+ </object>
+ </property>
+
+ </template>
+
+</interface>
diff --git a/src/gui/panels/logs-col-message.ui b/src/gui/panels/logs-col-message.ui
new file mode 100644
index 0000000..49839e4
--- /dev/null
+++ b/src/gui/panels/logs-col-message.ui
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+
+ <template class="GtkListItem">
+ <property name="child">
+ <object class="GtkLabel">
+ <property name="xalign">0</property>
+ <property name="use-markup">true</property>
+ <binding name="label">
+ <lookup name="message" type="GLogEntry">
+ <lookup name="item">GtkListItem</lookup>
+ </lookup>
+ </binding>
+ </object>
+ </property>
+
+ </template>
+
+</interface>
diff --git a/src/gui/panels/logs-int.h b/src/gui/panels/logs-int.h
new file mode 100644
index 0000000..692c1b4
--- /dev/null
+++ b/src/gui/panels/logs-int.h
@@ -0,0 +1,53 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * logs-int.h - prototypes internes pour le panneau d'affichage des messages système
+ *
+ * Copyright (C) 2025 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_PANELS_LOGS_INT_H
+#define _GUI_PANELS_LOGS_INT_H
+
+
+#include "logs.h"
+#include "../../gtkext/panel-int.h"
+
+
+
+/* Panneau d'affichage de messages (instance) */
+struct _GtkLogsPanel
+{
+ GtkTiledPanel parent; /* A laisser en premier */
+
+ GListStore *store; /* Liste des eléments conservés*/
+ GtkWidget *list; /* Composant d'affichage */
+
+};
+
+/* Panneau d'affichage de messages (classe) */
+struct _GtkLogsPanelClass
+{
+ GtkTiledPanelClass parent; /* A laisser en premier */
+
+};
+
+
+
+#endif /* _GUI_PANELS_LOGS_INT_H */
diff --git a/src/gui/panels/logs.c b/src/gui/panels/logs.c
new file mode 100644
index 0000000..399c4c0
--- /dev/null
+++ b/src/gui/panels/logs.c
@@ -0,0 +1,227 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * logs.c - panneau d'affichage des messages système
+ *
+ * Copyright (C) 2012-2025 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 "logs.h"
+
+
+#include <assert.h>
+#include <string.h>
+
+
+#include "logs-int.h"
+#include "../../gtkext/helpers.h"
+
+
+
+/* ------------------------- COEUR D'UN PANNEAU D'AFFICHAGE ------------------------- */
+
+
+/* Initialise la classe des panneaux d'affichage des journaux. */
+static void gtk_logs_panel_class_init(GtkLogsPanelClass *);
+
+/* Initialise une instance de panneau d'affichage des journaux. */
+static void gtk_logs_panel_init(GtkLogsPanel *);
+
+/* Supprime toutes les références externes. */
+static void gtk_logs_panel_dispose(GObject *);
+
+/* Procède à la libération totale de la mémoire. */
+static void gtk_logs_panel_finalize(GObject *);
+
+
+
+/* --------------------- IMPLEMENTATION DES FONCTIONS DE CLASSE --------------------- */
+
+
+/* Indique l'emplacement par défaut pour un affichage. */
+static char *gtk_logs_panel_get_default_path(const GtkTiledPanel *);
+
+
+
+/* ---------------------------------------------------------------------------------- */
+/* COEUR D'UN PANNEAU D'AFFICHAGE */
+/* ---------------------------------------------------------------------------------- */
+
+
+/* Indique le type défini pour un panneau d'accueil. */
+G_DEFINE_TYPE(GtkLogsPanel, gtk_logs_panel, GTK_TYPE_TILED_PANEL);
+
+
+/******************************************************************************
+* *
+* Paramètres : class = classe à initialiser. *
+* *
+* Description : Initialise la classe des panneaux d'affichage des journaux. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_logs_panel_class_init(GtkLogsPanelClass *class)
+{
+ GObjectClass *object; /* Autre version de la classe */
+ GtkWidgetClass *widget; /* Classe de haut niveau */
+ GtkTiledPanelClass *panel; /* Classe parente */
+
+ object = G_OBJECT_CLASS(class);
+
+ object->dispose = gtk_logs_panel_dispose;
+ object->finalize = gtk_logs_panel_finalize;
+
+ widget = GTK_WIDGET_CLASS(class);
+
+ g_type_ensure(G_TYPE_LOG_ENTRY);
+
+ gtk_widget_class_set_template_from_resource(widget, "/re/chrysalide/framework/gui/panels/logs.ui");
+
+ //gtk_widget_class_bind_template_callback_full(widget, BUILDER_CB(gtk_logs_panel_on_selected_rows_changed));
+
+ gtk_widget_class_bind_template_child(widget, GtkLogsPanel, store);
+ gtk_widget_class_bind_template_child(widget, GtkLogsPanel, list);
+
+ panel = GTK_TILED_PANEL_CLASS(class);
+
+ panel->get_default_path = gtk_logs_panel_get_default_path;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : panel = instance à initialiser. *
+* *
+* Description : Initialise une instance de panneau d'affichage des journaux. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_logs_panel_init(GtkLogsPanel *panel)
+{
+ GtkWidget *headers; /* Composant à cacher */
+
+ gtk_widget_init_template(GTK_WIDGET(panel));
+
+ /**
+ * Retrait des entêtes de colonne de l'affichage.
+ */
+
+ headers = gtk_widget_get_first_child(panel->list);
+
+ gtk_widget_set_visible(headers, FALSE);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : object = instance d'objet GLib à traiter. *
+* *
+* Description : Supprime toutes les références externes. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_logs_panel_dispose(GObject *object)
+{
+ gtk_widget_dispose_template(GTK_WIDGET(object), GTK_TYPE_LOGS_PANEL);
+
+ G_OBJECT_CLASS(gtk_logs_panel_parent_class)->dispose(object);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : object = instance d'objet GLib à traiter. *
+* *
+* Description : Procède à la libération totale de la mémoire. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_logs_panel_finalize(GObject *object)
+{
+ G_OBJECT_CLASS(gtk_logs_panel_parent_class)->finalize(object);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : panel = instance d'objet GLib à traiter. *
+* entry = élément de journalisation à intégrer. *
+* *
+* Description : Affiche un message dans le journal des messages système. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void g_log_panel_add_message(GtkLogsPanel *panel, GLogEntry *entry)
+{
+ g_list_store_append(panel->store, entry);
+
+}
+
+
+
+/* ---------------------------------------------------------------------------------- */
+/* IMPLEMENTATION DES FONCTIONS DE CLASSE */
+/* ---------------------------------------------------------------------------------- */
+
+
+/******************************************************************************
+* *
+* Paramètres : panel = panneau graphique à consulter. *
+* *
+* Description : Indique l'emplacement par défaut pour un affichage. *
+* *
+* Retour : Chemin représenté ou NULL pour l'emplacement "M" par défaut. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static char *gtk_logs_panel_get_default_path(const GtkTiledPanel *panel)
+{
+ char *result; /* Chemin à retourner */
+
+ result = strdup("S");
+
+ return result;
+
+}
diff --git a/src/gui/panels/logs.h b/src/gui/panels/logs.h
new file mode 100644
index 0000000..a8b902b
--- /dev/null
+++ b/src/gui/panels/logs.h
@@ -0,0 +1,47 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * logs.h - prototypes pour le panneau d'affichage des messages système
+ *
+ * Copyright (C) 2012-2025 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_PANELS_LOGS_H
+#define _GUI_PANELS_LOGS_H
+
+
+#include <gtk/gtk.h>
+
+
+#include "../../glibext/helpers.h"
+#include "../../glibext/log.h"
+
+
+
+#define GTK_TYPE_LOGS_PANEL (gtk_logs_panel_get_type())
+
+DECLARE_GTYPE(GtkLogsPanel, gtk_logs_panel, GTK, LOGS_PANEL);
+
+
+/* Affiche un message dans le journal des messages système. */
+void g_log_panel_add_message(GtkLogsPanel *, GLogEntry *);
+
+
+
+#endif /* _GUI_PANELS_LOGS_H */
diff --git a/src/gui/panels/logs.ui b/src/gui/panels/logs.ui
new file mode 100644
index 0000000..ba920cd
--- /dev/null
+++ b/src/gui/panels/logs.ui
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+
+ <object class="GtkNoSelection" id="noselection">
+ <property name="model">
+ <object class="GListStore" id="store">
+ <property name="item-type">GLogEntry</property>
+ </object>
+ </property>
+ </object>
+
+ <template class="GtkLogsPanel" parent="GtkTiledPanel">
+
+ <child>
+ <object class="GtkScrolledWindow">
+ <property name="hscrollbar-policy">automatic</property>
+ <property name="vscrollbar-policy">automatic</property>
+ <property name="hexpand">true</property>
+ <property name="vexpand">true</property>
+ <property name="has-frame">0</property>
+
+ <child>
+ <object class="GtkColumnView" id="list">
+ <property name="vexpand">true</property>
+ <property name="model">noselection</property>
+
+ <child>
+ <object class="GtkColumnViewColumn">
+ <property name="title"></property>
+ <property name="factory">
+ <object class="GtkBuilderListItemFactory">
+ <property name="resource">/re/chrysalide/framework/gui/panels/logs-col-icon.ui</property>
+ </object>
+ </property>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkColumnViewColumn">
+ <property name="expand">true</property>
+ <property name="title">Message</property>
+ <property name="factory">
+ <object class="GtkBuilderListItemFactory">
+ <property name="resource">/re/chrysalide/framework/gui/panels/logs-col-message.ui</property>
+ </object>
+ </property>
+ </object>
+ </child>
+
+ </object>
+ </child>
+
+ </object>
+ </child>
+
+ </template>
+
+</interface>
diff --git a/src/gui/panels/welcome-int.h b/src/gui/panels/welcome-int.h
index d99d316..206bc2c 100644
--- a/src/gui/panels/welcome-int.h
+++ b/src/gui/panels/welcome-int.h
@@ -27,20 +27,15 @@
#include "welcome.h"
-#include "../panel-int.h"
#include "../../gtkext/panel-int.h"
-/* ------------------------- COEUR D'UN PANNEAU D'AFFICHAGE ------------------------- */
-
-
/* Panneau d'accueil par défaut (instance) */
struct _GtkWelcomePanel
{
GtkTiledPanel parent; /* A laisser en premier */
- GListStore *store; /* Données brutes */
GtkListBox *list; /* Liste de lanceurs */
GtkStack *properties; /* Premières propriétés */
@@ -62,28 +57,5 @@ struct _GtkWelcomePanelClass
};
-/* Met en place un nouveau panneau d'accueil. */
-bool gtk_welcome_panel_create(GtkWelcomePanel *);
-
-
-
-/* ---------------------- MANIPULATIONS D'UN PANNEAU GRAPHIQUE ---------------------- */
-
-
-/* Définition pour gestion par le framework d'un panneau graphique (instance) */
-struct _GWelcomePanel
-{
- GPanelItem parent; /* A laisser en premier */
-
-};
-
-/* Définition pour gestion par le framework d'un panneau graphique (classe) */
-struct _GWelcomePanelClass
-{
- GPanelItemClass parent; /* A laisser en premier */
-
-};
-
-
#endif /* _GUI_PANELS_WELCOME_INT_H */
diff --git a/src/gui/panels/welcome.c b/src/gui/panels/welcome.c
index 3cd349f..6e8763b 100644
--- a/src/gui/panels/welcome.c
+++ b/src/gui/panels/welcome.c
@@ -28,9 +28,6 @@
#include <assert.h>
-#include <i18n.h>
-
-
#include "welcome-int.h"
#include "../core/panels.h"
#include "../../common/shuffle.h"
@@ -48,16 +45,10 @@ static void gtk_welcome_panel_class_init(GtkWelcomePanelClass *);
static void gtk_welcome_panel_init(GtkWelcomePanel *);
/* Supprime toutes les références externes. */
-static void gtk_welcome_panel_dispose(GtkWelcomePanel *);
+static void gtk_welcome_panel_dispose(GObject *);
/* Procède à la libération totale de la mémoire. */
-static void gtk_welcome_panel_finalize(GtkWelcomePanel *);
-
-/* Intègre une définition de panneau enregistrée. */
-static bool gtk_welcome_panel_add_launcher(GPanelItem *, GListStore *);
-
-/* Prépare un composant pour représenter une définition. */
-static GtkWidget *gtk_welcome_panel_create_launcher_widget(GPanelItem *, gpointer);
+static void gtk_welcome_panel_finalize(GObject *);
/* Réagit à un changement de sélection de la liste de panneaux. */
static void gtk_welcome_panel_on_selected_rows_changed(GtkListBox *, GtkWelcomePanel *);
@@ -78,32 +69,6 @@ static void gtk_welcome_panel_on_next_hint_clicked(GtkButton *, GtkWelcomePanel
-/* ---------------------- MANIPULATIONS D'UN PANNEAU GRAPHIQUE ---------------------- */
-
-
-/* Initialise la classe des panneaux graphiques pour binaires. */
-static void g_welcome_panel_class_init(GWelcomePanelClass *);
-
-/* Initialise une instance de panneau graphique pour binaire. */
-static void g_welcome_panel_init(GWelcomePanel *);
-
-/* Supprime toutes les références externes. */
-static void g_welcome_panel_dispose(GWelcomePanel *);
-
-/* Procède à la libération totale de la mémoire. */
-static void g_welcome_panel_finalize(GWelcomePanel *);
-
-
-
-/* --------------------- IMPLEMENTATION DES FONCTIONS DE CLASSE --------------------- */
-
-
-/* Fournit une indication sur la personnalité du panneau. */
-static PanelItemPersonality g_welcome_panel_get_personality(const GWelcomePanel *);
-
-/* Fournit un composant représentant un panneau graphique. */
-static GtkTiledPanel *g_welcome_panel_get_panel(GWelcomePanel *, GtkWidget *);
-
/* ---------------------------------------------------------------------------------- */
@@ -134,8 +99,8 @@ static void gtk_welcome_panel_class_init(GtkWelcomePanelClass *class)
object = G_OBJECT_CLASS(class);
- object->dispose = (GObjectFinalizeFunc/* ! */)gtk_welcome_panel_dispose;
- object->finalize = (GObjectFinalizeFunc)gtk_welcome_panel_finalize;
+ object->dispose = gtk_welcome_panel_dispose;
+ object->finalize = gtk_welcome_panel_finalize;
widget = GTK_WIDGET_CLASS(class);
@@ -169,13 +134,16 @@ static void gtk_welcome_panel_init(GtkWelcomePanel *panel)
{
GBytes *bytes; /* Données brutes de ressource */
const gchar *data; /* Données brutes natives */
+ int min; /* Taille à gauche minimale */
+ GtkConstraintLayout *layout; /* Disposition fixant la taille*/
+ GtkConstraint *constraint; /* Contrainte à considérer */
gtk_widget_init_template(GTK_WIDGET(panel));
- panel->store = g_list_store_new(G_TYPE_PANEL_ITEM);
-
panel->other_child = NULL;
+ /* Chargement des astuces */
+
bytes = g_resources_lookup_data("/re/chrysalide/framework/gui/panels/welcome-hints.txt",
G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
assert(bytes != NULL);
@@ -191,105 +159,9 @@ static void gtk_welcome_panel_init(GtkWelcomePanel *panel)
panel->cur_hint = 0;
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = instance d'objet GLib à traiter. *
-* *
-* Description : Supprime toutes les références externes. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void gtk_welcome_panel_dispose(GtkWelcomePanel *panel)
-{
- gtk_widget_dispose_template(GTK_WIDGET(panel), GTK_TYPE_WELCOME_PANEL);
-
- g_clear_object(&panel->other_child);
-
- G_OBJECT_CLASS(gtk_welcome_panel_parent_class)->dispose(G_OBJECT(panel));
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = instance d'objet GLib à traiter. *
-* *
-* Description : Procède à la libération totale de la mémoire. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void gtk_welcome_panel_finalize(GtkWelcomePanel *panel)
-{
- G_OBJECT_CLASS(gtk_welcome_panel_parent_class)->finalize(G_OBJECT(panel));
-
- g_strfreev(panel->raw_hints);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Crée une nouvelle instance de panneau d'accueil. *
-* *
-* Retour : Composant GTK mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GtkTiledPanel *gtk_welcome_panel_new(void)
-{
- GtkTiledPanel *result; /* Instance à retourner */
-
- result = g_object_new(GTK_TYPE_WELCOME_PANEL, NULL);
-
- if (!gtk_welcome_panel_create(GTK_WELCOME_PANEL(result)))
- g_clear_object(&result);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = panneau d'accueil à initialiser. *
-* *
-* Description : Met en place un nouveau panneau d'accueil. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool gtk_welcome_panel_create(GtkWelcomePanel *panel)
-{
- bool result; /* Bilan à retourner */
- int min; /* Taille à gauche minimale */
- GtkConstraintLayout *layout; /* Disposition fixant la taille*/
- GtkConstraint *constraint; /* Contrainte à considérer */
-
/* Constitution de la liste des démarreurs */
- result = browse_all_item_panels(true, (handle_panel_item_fc)gtk_welcome_panel_add_launcher, panel->store);
-
- gtk_list_box_bind_model(panel->list, G_LIST_MODEL(panel->store),
- (GtkListBoxCreateWidgetFunc)gtk_welcome_panel_create_launcher_widget,
- NULL, NULL);
+ populate_framework_panel_launcher_list(panel->list);
/* Dimensionnement de la zone d'astuces */
@@ -327,57 +199,57 @@ bool gtk_welcome_panel_create(GtkWelcomePanel *panel)
gtk_label_set_markup(panel->hints, panel->raw_hints[panel->cur_hint]);
- return result;
-
}
/******************************************************************************
* *
-* Paramètres : item = définition de panneau à intégrer. *
-* store = liste à compléter. *
+* Paramètres : object = instance d'objet GLib à traiter. *
* *
-* Description : Intègre une définition de panneau enregistrée. *
+* Description : Supprime toutes les références externes. *
* *
-* Retour : true pour un parcours complet de la liste des définitions. *
+* Retour : - *
* *
* Remarques : - *
* *
******************************************************************************/
-static bool gtk_welcome_panel_add_launcher(GPanelItem *item, GListStore *store)
+static void gtk_welcome_panel_dispose(GObject *object)
{
- bool result; /* Poursuite du parcours */
+ GtkWelcomePanel *panel; /* Version spécialisée */
+
+ gtk_widget_dispose_template(GTK_WIDGET(object), GTK_TYPE_WELCOME_PANEL);
- result = true;
+ panel = GTK_WELCOME_PANEL(object);
- g_list_store_append(store, G_OBJECT(item));
+ g_clear_object(&panel->other_child);
- return result;
+ G_OBJECT_CLASS(gtk_welcome_panel_parent_class)->dispose(object);
}
/******************************************************************************
* *
-* Paramètres : item = définition de panneau à consulter. *
-* unused = adresse non utilisée ici. *
+* Paramètres : object = instance d'objet GLib à traiter. *
* *
-* Description : Prépare un composant pour représenter une définition. *
+* Description : Procède à la libération totale de la mémoire. *
* *
-* Retour : Composant de représentation de définition de panneau. *
+* Retour : - *
* *
* Remarques : - *
* *
******************************************************************************/
-static GtkWidget *gtk_welcome_panel_create_launcher_widget(GPanelItem *item, gpointer unused)
+static void gtk_welcome_panel_finalize(GObject *object)
{
- GtkWidget *result; /* Composant GTK à retourner */
+ GtkWelcomePanel *panel; /* Version spécialisée */
+
+ panel = GTK_WELCOME_PANEL(object);
- result = g_panel_item_get_launcher(item);
+ g_strfreev(panel->raw_hints);
- return result;
+ G_OBJECT_CLASS(gtk_welcome_panel_parent_class)->finalize(object);
}
@@ -398,8 +270,6 @@ static GtkWidget *gtk_welcome_panel_create_launcher_widget(GPanelItem *item, gpo
static void gtk_welcome_panel_on_selected_rows_changed(GtkListBox *box, GtkWelcomePanel *panel)
{
GtkListBoxRow *row; /* Ligne sélectionnée */
- int selected; /* Indice de sélection */
- GPanelItem *item; /* Elément correspondant */
GtkWidget *new; /* Nouvelles propriétés */
row = gtk_list_box_get_selected_row(box);
@@ -414,7 +284,7 @@ static void gtk_welcome_panel_on_selected_rows_changed(GtkListBox *box, GtkWelco
gtk_stack_set_visible_child(panel->properties, panel->def_child);
gtk_stack_remove(panel->properties, panel->other_child);
- g_clear_object(&panel->other_child);
+ panel->other_child = NULL;
}
@@ -423,24 +293,16 @@ static void gtk_welcome_panel_on_selected_rows_changed(GtkListBox *box, GtkWelco
*/
else
{
- selected = gtk_list_box_row_get_index(row);
- item = g_list_model_get_item(G_LIST_MODEL(panel->store), selected);
+ new = get_framework_panel_parameters(row);
+ assert(new != NULL);
- new = g_panel_item_get_properties(item);
-
- if (new == panel->other_child)
- unref_object(new);
-
- else
+ if (new != panel->other_child)
{
gtk_stack_add_child(panel->properties, new);
gtk_stack_set_visible_child(panel->properties, new);
if (panel->other_child != NULL)
- {
gtk_stack_remove(panel->properties, panel->other_child);
- g_clear_object(&panel->other_child);
- }
panel->other_child = new;
@@ -513,178 +375,3 @@ static void gtk_welcome_panel_on_next_hint_clicked(GtkButton *button, GtkWelcome
-
-/* ---------------------------------------------------------------------------------- */
-/* MANIPULATIONS D'UN PANNEAU GRAPHIQUE */
-/* ---------------------------------------------------------------------------------- */
-
-
-/* Indique le type défini pour une manipulation de panneau de bienvenue. */
-G_DEFINE_TYPE(GWelcomePanel, g_welcome_panel, G_TYPE_PANEL_ITEM);
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe à initialiser. *
-* *
-* Description : Initialise la classe des panneaux graphiques pour binaires. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_welcome_panel_class_init(GWelcomePanelClass *class)
-{
- GObjectClass *object; /* Autre version de la classe */
- GPanelItemClass *panel; /* Encore une autre vision... */
-
- object = G_OBJECT_CLASS(class);
-
- object->dispose = (GObjectFinalizeFunc/* ! */)g_welcome_panel_dispose;
- object->finalize = (GObjectFinalizeFunc)g_welcome_panel_finalize;
-
- panel = G_PANEL_ITEM_CLASS(class);
-
- panel->get_personality = (get_panel_item_personality_cb)g_welcome_panel_get_personality;
- panel->get_panel = (get_panel_item_panel_cb)g_welcome_panel_get_panel;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = instance à initialiser. *
-* *
-* Description : Initialise une instance de panneau graphique pour binaire. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_welcome_panel_init(GWelcomePanel *panel)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = instance d'objet GLib à traiter. *
-* *
-* Description : Supprime toutes les références externes. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_welcome_panel_dispose(GWelcomePanel *panel)
-{
- G_OBJECT_CLASS(g_welcome_panel_parent_class)->dispose(G_OBJECT(panel));
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = instance d'objet GLib à traiter. *
-* *
-* Description : Procède à la libération totale de la mémoire. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_welcome_panel_finalize(GWelcomePanel *panel)
-{
- G_OBJECT_CLASS(g_welcome_panel_parent_class)->finalize(G_OBJECT(panel));
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Constitue une définition de manipulation de panneau. *
-* *
-* Retour : Définition de propriétés mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GPanelItem *g_welcome_panel_new(void)
-{
- GPanelItem *result; /* Structure à retourner */
-
- result = g_object_new(G_TYPE_WELCOME_PANEL, NULL);
-
- return result;
-
-}
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* IMPLEMENTATION DES FONCTIONS DE CLASSE */
-/* ---------------------------------------------------------------------------------- */
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = définition de panneau à consulter. *
-* *
-* Description : Fournit une indication sur la personnalité du panneau. *
-* *
-* Retour : Identifiant lié à la nature du panneau. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static PanelItemPersonality g_welcome_panel_get_personality(const GWelcomePanel *panel)
-{
- PanelItemPersonality result; /* Personnalité à retourner */
-
- result = PIP_MAIN_PANEL | PIP_SINGLETON;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : panel = définition de panneau à manipuler. *
-* props = éventuels éléments graphiques de paramétrages. *
-* *
-* Description : Fournit un composant représentant un panneau graphique. *
-* *
-* Retour : Composant GTK (déjà ?) mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GtkTiledPanel *g_welcome_panel_get_panel(GWelcomePanel *panel, GtkWidget *props)
-{
- GtkTiledPanel *result; /* Composant à retourner */
-
- /**
- * Il n'existe pas de composants de paramètrage pour ce panneau.
- */
- assert(props == NULL);
-
- result = gtk_welcome_panel_new();
-
- return result;
-
-}
diff --git a/src/gui/panels/welcome.h b/src/gui/panels/welcome.h
index d267f80..d9ea18d 100644
--- a/src/gui/panels/welcome.h
+++ b/src/gui/panels/welcome.h
@@ -29,36 +29,15 @@
#include <gtk/gtk.h>
-#include "../panel.h"
#include "../../glibext/helpers.h"
#include "../../gtkext/panel.h"
-/* ------------------------- COEUR D'UN PANNEAU D'AFFICHAGE ------------------------- */
-
-
#define GTK_TYPE_WELCOME_PANEL (gtk_welcome_panel_get_type())
DECLARE_GTYPE(GtkWelcomePanel, gtk_welcome_panel, GTK, WELCOME_PANEL);
-/* Crée une nouvelle instance de panneau d'accueil. */
-GtkTiledPanel *gtk_welcome_panel_new(void);
-
-
-
-/* ---------------------- MANIPULATIONS D'UN PANNEAU GRAPHIQUE ---------------------- */
-
-
-#define G_TYPE_WELCOME_PANEL (g_welcome_panel_get_type())
-
-DECLARE_GTYPE(GWelcomePanel, g_welcome_panel, G, WELCOME_PANEL);
-
-
-/* Constitue une définition de manipulation de panneau. */
-GPanelItem *g_welcome_panel_new(void);
-
-
#endif /* _GUI_PANELS_WELCOME_H */
diff --git a/src/gui/style.css b/src/gui/style.css
index 9078310..dce41fa 100644
--- a/src/gui/style.css
+++ b/src/gui/style.css
@@ -36,11 +36,7 @@ list.boxed-list, list.boxed-list > row:last-child {
/* about.css */
-.black-bg {
-
- background-color: black;
-
-}
+@import url('resource:///re/chrysalide/framework/gui/dialogs/about.css');
/* welcome.css */
@@ -61,3 +57,15 @@ grid.hints > box {
min-width: 130px;
}
+
+
+/* dockstation.css */
+
+.control-button {
+
+ min-height: 0;
+ min-width: 0;
+
+ padding: 6px;
+
+}
diff --git a/src/gui/window-int.h b/src/gui/window-int.h
index d79e189..4f3dd57 100644
--- a/src/gui/window-int.h
+++ b/src/gui/window-int.h
@@ -37,7 +37,10 @@ struct _GtkFrameworkWindow
GSettings *settings; /* Paramètres globaux */
- GtkStack *grid; /* Réceptacle de panneaux */
+ GtkTilingGrid *grid; /* Réceptacle de panneaux */
+ GtkStatusStack *status; /* Barre de statut */
+
+ GtkTiledPanel *main; /* Panneau principal courant */
};
diff --git a/src/gui/window.c b/src/gui/window.c
index a11e8aa..e14ecf7 100644
--- a/src/gui/window.c
+++ b/src/gui/window.c
@@ -29,9 +29,10 @@
#include "core/panels.h"
#include "dialogs/about.h"
#include "dialogs/preferences.h"
+#include "panels/logs.h"
#include "panels/welcome.h"
+#include "../gtkext/grid.h"
#include "../gtkext/helpers.h"
-#include "../gtkext/statusstack.h"
@@ -42,10 +43,25 @@ static void gtk_framework_window_class_init(GtkFrameworkWindowClass *);
static void gtk_framework_window_init(GtkFrameworkWindow *);
/* Supprime toutes les références externes. */
-static void gtk_framework_window_dispose(GtkFrameworkWindow *);
+static void gtk_framework_window_dispose(GObject *);
/* Procède à la libération totale de la mémoire. */
-static void gtk_framework_window_finalize(GtkFrameworkWindow *);
+static void gtk_framework_window_finalize(GObject *);
+
+/* Bascule l'affichage d'un panneau de bordure. */
+static void gtk_framework_window_toggle_pannel_visibility(GtkFrameworkWindow *, TilingGridBorder);
+
+/* Réagit à une activation de bascule du panneau supérieur. */
+static void gtk_framework_window_activate_toggle_top(GSimpleAction *, GVariant *, gpointer);
+
+/* Réagit à une activation de bascule du panneau de gauche. */
+static void gtk_framework_window_activate_toggle_left(GSimpleAction *action, GVariant *, gpointer);
+
+/* Réagit à une activation de bascule du panneau de droite. */
+static void gtk_framework_window_activate_toggle_right(GSimpleAction *, GVariant *, gpointer);
+
+/* Réagit à une activation de bascule du panneau inférieur. */
+static void gtk_framework_window_activate_toggle_bottom(GSimpleAction *, GVariant *, gpointer);
/* Réagit à une activation du menu "Préférences" de la fenetre. */
static void gtk_framework_window_activate_preferences(GSimpleAction *, GVariant *, gpointer);
@@ -83,11 +99,13 @@ static void gtk_framework_window_class_init(GtkFrameworkWindowClass *class)
widget = GTK_WIDGET_CLASS(class);
+ g_type_ensure(GTK_TYPE_TILING_GRID);
g_type_ensure(GTK_TYPE_STATUS_STACK);
gtk_widget_class_set_template_from_resource(widget, "/re/chrysalide/framework/gui/window.ui");
gtk_widget_class_bind_template_child(widget, GtkFrameworkWindow, grid);
+ gtk_widget_class_bind_template_child(widget, GtkFrameworkWindow, status);
/* Active une action native (cf. https://docs.gtk.org/gtk4/class.Window.html#actions) */
gtk_widget_class_add_binding_action(widget, GDK_KEY_Q, GDK_CONTROL_MASK, "window.close", NULL);
@@ -111,7 +129,13 @@ static void gtk_framework_window_class_init(GtkFrameworkWindowClass *class)
static void gtk_framework_window_init(GtkFrameworkWindow *window)
{
+ GAction *action; /* Action mise en place */
+
static GActionEntry app_entries[] = {
+ { "toggle-top", gtk_framework_window_activate_toggle_top, NULL, NULL, NULL },
+ { "toggle-left", gtk_framework_window_activate_toggle_left, NULL, NULL, NULL },
+ { "toggle-right", gtk_framework_window_activate_toggle_right, NULL, NULL, NULL },
+ { "toggle-bottom", gtk_framework_window_activate_toggle_bottom, NULL, NULL, NULL },
{ "preferences", gtk_framework_window_activate_preferences, NULL, NULL, NULL },
{ "about", gtk_framework_window_activate_about, NULL, NULL, NULL },
};
@@ -124,16 +148,47 @@ static void gtk_framework_window_init(GtkFrameworkWindow *window)
g_settings_bind(window->settings, "window-height", G_OBJECT(window), "default-height", G_SETTINGS_BIND_DEFAULT);
g_settings_bind(window->settings, "window-maximized", G_OBJECT(window), "maximized", G_SETTINGS_BIND_DEFAULT);
+ window->main = NULL;
+
g_action_map_add_action_entries(G_ACTION_MAP(window),
app_entries, G_N_ELEMENTS(app_entries),
window);
+ /**
+ * Définition de l'accès aux actions pour obtenir un effet de bord sur
+ * l'accès aux boutons graphiques de déclenchement.
+ */
+
+ action = g_action_map_lookup_action(G_ACTION_MAP(window), "toggle-top");
+
+ g_object_bind_property(G_OBJECT(window->grid), "empty-top",
+ G_OBJECT(action), "enabled",
+ G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN);
+
+ action = g_action_map_lookup_action(G_ACTION_MAP(window), "toggle-left");
+
+ g_object_bind_property(G_OBJECT(window->grid), "empty-left",
+ G_OBJECT(action), "enabled",
+ G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN);
+
+ action = g_action_map_lookup_action(G_ACTION_MAP(window), "toggle-right");
+
+ g_object_bind_property(G_OBJECT(window->grid), "empty-right",
+ G_OBJECT(action), "enabled",
+ G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN);
+
+ action = g_action_map_lookup_action(G_ACTION_MAP(window), "toggle-bottom");
+
+ g_object_bind_property(G_OBJECT(window->grid), "empty-bottom",
+ G_OBJECT(action), "enabled",
+ G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN);
+
}
/******************************************************************************
* *
-* Paramètres : window = instance d'objet GLib à traiter. *
+* Paramètres : object = instance d'objet GLib à traiter. *
* *
* Description : Supprime toutes les références externes. *
* *
@@ -143,20 +198,26 @@ static void gtk_framework_window_init(GtkFrameworkWindow *window)
* *
******************************************************************************/
-static void gtk_framework_window_dispose(GtkFrameworkWindow *window)
+static void gtk_framework_window_dispose(GObject *object)
{
+ GtkFrameworkWindow *window; /* Version spécialisée */
+
+ window = GTK_FRAMEWORK_WINDOW(object);
+
gtk_widget_dispose_template(GTK_WIDGET(window), GTK_TYPE_FRAMEWORK_WINDOW);
g_clear_object(&window->settings);
- G_OBJECT_CLASS(gtk_framework_window_parent_class)->dispose(G_OBJECT(window));
+ g_clear_object(&window->main);
+
+ G_OBJECT_CLASS(gtk_framework_window_parent_class)->dispose(object);
}
/******************************************************************************
* *
-* Paramètres : window = instance d'objet GLib à traiter. *
+* Paramètres : object = instance d'objet GLib à traiter. *
* *
* Description : Procède à la libération totale de la mémoire. *
* *
@@ -166,9 +227,9 @@ static void gtk_framework_window_dispose(GtkFrameworkWindow *window)
* *
******************************************************************************/
-static void gtk_framework_window_finalize(GtkFrameworkWindow *window)
+static void gtk_framework_window_finalize(GObject *object)
{
- G_OBJECT_CLASS(gtk_framework_window_parent_class)->finalize(G_OBJECT(window));
+ G_OBJECT_CLASS(gtk_framework_window_parent_class)->finalize(object);
}
@@ -215,7 +276,6 @@ GtkApplicationWindow *gtk_framework_window_new(GtkApplication *app)
bool gtk_framework_window_create(GtkFrameworkWindow *window, GtkApplication *app)
{
bool result; /* Bilan à retourner */
- GPanelItem *item; /* Définition de panneau */
GtkTiledPanel *panel; /* Panneau d'affichage */
GtkCssProvider *css; /* Feuille de style maison */
@@ -225,12 +285,17 @@ bool gtk_framework_window_create(GtkFrameworkWindow *window, GtkApplication *app
/* Inclusion d'un écran d'accueil */
- item = find_item_panel_by_type(G_TYPE_WELCOME_PANEL);
+ panel = get_framework_panel_singleton(GTK_TYPE_WELCOME_PANEL);
- panel = g_panel_item_get_panel(item);
gtk_framework_window_add(window, panel);
- unref_object(item);
+ if (1/* FIXME : first time */)
+ {
+ panel = get_framework_panel_singleton(GTK_TYPE_LOGS_PANEL);
+
+ gtk_framework_window_add(window, panel);
+
+ }
/* Chargement des extensions de thème */
@@ -261,6 +326,116 @@ bool gtk_framework_window_create(GtkFrameworkWindow *window, GtkApplication *app
/******************************************************************************
* *
+* Paramètres : window = instance de fenêtre principale à manipuler. *
+* border = sélection de la zone à considérer. *
+* *
+* Description : Bascule l'affichage d'un panneau de bordure. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_framework_window_toggle_pannel_visibility(GtkFrameworkWindow *window, TilingGridBorder border)
+{
+ bool state; /* Etat courant à basculer */
+
+ state = gtk_tiling_grid_get_visible(window->grid, border);
+
+ state = !state;
+
+ gtk_tiling_grid_set_visible(window->grid, border, state);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : action = désignation de l'action concernée par l'appel. *
+* unused = adresse non utilisée ici. *
+* _window = instance de fenêtre principale à manipuler. *
+* *
+* Description : Réagit à une activation de bascule du panneau supérieur. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_framework_window_activate_toggle_top(GSimpleAction *action, GVariant *unused, gpointer _window)
+{
+ gtk_framework_window_toggle_pannel_visibility(_window, TGB_TOP);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : action = désignation de l'action concernée par l'appel. *
+* unused = adresse non utilisée ici. *
+* _window = instance de fenêtre principale à manipuler. *
+* *
+* Description : Réagit à une activation de bascule du panneau de gauche. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_framework_window_activate_toggle_left(GSimpleAction *action, GVariant *unused, gpointer _window)
+{
+ gtk_framework_window_toggle_pannel_visibility(_window, TGB_LEFT);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : action = désignation de l'action concernée par l'appel. *
+* unused = adresse non utilisée ici. *
+* _window = instance de fenêtre principale à manipuler. *
+* *
+* Description : Réagit à une activation de bascule du panneau de droite. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_framework_window_activate_toggle_right(GSimpleAction *action, GVariant *unused, gpointer _window)
+{
+ gtk_framework_window_toggle_pannel_visibility(_window, TGB_RIGHT);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : action = désignation de l'action concernée par l'appel. *
+* unused = adresse non utilisée ici. *
+* _window = instance de fenêtre principale à manipuler. *
+* *
+* Description : Réagit à une activation de bascule du panneau inférieur. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_framework_window_activate_toggle_bottom(GSimpleAction *action, GVariant *unused, gpointer _window)
+{
+ gtk_framework_window_toggle_pannel_visibility(_window, TGB_BOTTOM);
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : action = désignation de l'action concernée par l'appel. *
* unused = adresse non utilisée ici. *
* _window = instance de fenêtre principale à manipuler. *
@@ -317,6 +492,31 @@ static void gtk_framework_window_activate_about(GSimpleAction *action, GVariant
/******************************************************************************
* *
+* Paramètres : window = instance de fenêtre principale à consulter. *
+* *
+* Description : Fournit une référence à la barre de statut intégrée. *
+* *
+* Retour : Composant GTK en place. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GtkStatusStack *gtk_framework_window_get_status_stack(const GtkFrameworkWindow *window)
+{
+ GtkStatusStack *result; /* Instance à retourner */
+
+ result = window->status;
+ ref_object(result);
+
+ return result;
+
+}
+
+
+
+/******************************************************************************
+* *
* Paramètres : window = instance de fenêtre principale à remplir. *
* panel = nouveau panneau à afficher. *
* *
@@ -335,10 +535,12 @@ void gtk_framework_window_add(GtkFrameworkWindow *window, /* __steal */GtkTiledP
guint count; /* Nombre d'élements présents */
guint i; /* Boucle de parcours */
GtkWidget *widget; /* Composant à intégrer */
+ FrameworkPanelPersonality personality; /* Propriétés du panneau */
+
+
- gtk_stack_add_child(window->grid, GTK_WIDGET(panel));
+ gtk_tiling_grid_add_panel(window->grid, panel, G_OBJECT_TYPE(panel) == GTK_TYPE_WELCOME_PANEL);
- gtk_stack_set_visible_child(window->grid, GTK_WIDGET(panel));
@@ -366,4 +568,54 @@ void gtk_framework_window_add(GtkFrameworkWindow *window, /* __steal */GtkTiledP
}
+ /* Mise à jour des liens vers un panneau principal */
+
+ personality = get_framework_panel_personality(G_OBJECT_TYPE(panel));
+
+ if (personality & FPP_MAIN_PANEL)
+ gtk_framework_window_notify_new_main_panel_state(window, panel, true);
+
+ else
+ {
+ if (window->main != NULL)
+ gtk_tiled_panel_notify_new_main_panel_state(panel, window->main, true);
+ }
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : window = instance de fenêtre principale à manipuler. *
+* main = panneau principal visé par l'opération. *
+* activated = nature du changement de statut : ajout, retrait ?*
+* *
+* Description : Note un ajout ou un retrait de panneau principal. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void gtk_framework_window_notify_new_main_panel_state(GtkFrameworkWindow *window, GtkTiledPanel *main, bool activated)
+{
+ if (activated)
+ {
+ g_clear_object(&window->main);
+
+ window->main = main;
+ ref_object(main);
+
+ }
+
+ else
+ {
+ if (main == window->main)
+ g_clear_object(&window->main);
+
+ }
+
+ gtk_tiling_grid_notify_new_main_panel_state(window->grid, main, activated);
+
}
diff --git a/src/gui/window.h b/src/gui/window.h
index 56c56ec..077d51a 100644
--- a/src/gui/window.h
+++ b/src/gui/window.h
@@ -30,6 +30,7 @@
#include "../glibext/helpers.h"
#include "../gtkext/panel.h"
+#include "../gtkext/statusstack.h"
@@ -43,13 +44,18 @@
DECLARE_GTYPE(GtkFrameworkWindow, gtk_framework_window, GTK, FRAMEWORK_WINDOW);
-
/* Crée une nouvelle application principale pour Chrysalide. */
GtkApplicationWindow *gtk_framework_window_new(GtkApplication *);
+/* Fournit une référence à la barre de statut intégrée. */
+GtkStatusStack *gtk_framework_window_get_status_stack(const GtkFrameworkWindow *);
+
/* Ajoute un panneau à la fenêtre principale de Chrysalide. */
void gtk_framework_window_add(GtkFrameworkWindow *, GtkTiledPanel *);
+/* Note un ajout ou un retrait de panneau principal. */
+void gtk_framework_window_notify_new_main_panel_state(GtkFrameworkWindow *, GtkTiledPanel *, bool);
+
#endif /* _GUI_WINDOW_H */
diff --git a/src/gui/window.ui b/src/gui/window.ui
index 363ea54..1c6a89a 100644
--- a/src/gui/window.ui
+++ b/src/gui/window.ui
@@ -22,6 +22,23 @@
<child type="titlebar">
<object class="GtkHeaderBar">
+
+ <child type="start">
+ <object class="GtkToggleButton">
+ <property name="icon-name">dock-station-left-symbolic</property>
+ <property name="action-name">win.toggle-left</property>
+ <property name="active" bind-source="grid" bind-property="visible-left" bind-flags="sync-create"/>
+ </object>
+ </child>
+
+ <child type="end">
+ <object class="GtkToggleButton">
+ <property name="icon-name">dock-station-right-symbolic</property>
+ <property name="action-name">win.toggle-right</property>
+ <property name="active" bind-source="grid" bind-property="visible-right" bind-flags="sync-create"/>
+ </object>
+ </child>
+
<child type="end">
<object class="GtkMenuButton">
<property name="icon-name">open-menu-symbolic</property>
@@ -37,7 +54,7 @@
<property name="orientation">vertical</property>
<child>
- <object class="GtkStack" id="grid">
+ <object class="GtkTilingGrid" id="grid">
<property name="vexpand">TRUE</property>
</object>
</child>
@@ -50,6 +67,7 @@
<child>
<object class="GtkStatusStack" id="status">
+ <property name="show-bottom" bind-source="grid" bind-property="visible-bottom" bind-flags="sync-create"/>
</object>
</child>