summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2025-02-22 17:53:07 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2025-02-22 17:53:07 (GMT)
commit8fe33f41ae9bd319298c601548a453020d23ad06 (patch)
treeb7936b22311f403616fc851d8715d7fee9a49cb2
parent0b8fbc0c0d6a18cf1b90337dbd20639316af1fe7 (diff)
Handle configuration edition for plugins.
-rw-r--r--plugins/pynb/Makefile.am2
-rw-r--r--plugins/pynb/core-ui.c73
-rw-r--r--plugins/pynb/prefs-int.h48
-rw-r--r--plugins/pynb/prefs.c143
-rw-r--r--plugins/pynb/prefs.h41
-rw-r--r--plugins/pynb/prefs.ui2
-rw-r--r--src/gtkext/tweak.h1
-rw-r--r--src/gui/dialogs/preferences.c24
-rw-r--r--src/plugins/Makefile.am4
-rw-r--r--src/plugins/manager-int.h10
-rw-r--r--src/plugins/pglist.h69
-rw-r--r--src/plugins/tweakable-int.h50
-rw-r--r--src/plugins/tweakable.c98
-rw-r--r--src/plugins/tweakable.h62
14 files changed, 602 insertions, 25 deletions
diff --git a/plugins/pynb/Makefile.am b/plugins/pynb/Makefile.am
index a4a3423..50e549f 100644
--- a/plugins/pynb/Makefile.am
+++ b/plugins/pynb/Makefile.am
@@ -35,6 +35,8 @@ libpynbui_la_SOURCES = \
panel.h panel.c \
params-int.h \
params.h params.c \
+ prefs-int.h \
+ prefs.h prefs.c \
resources.h resources.c
libpynbui_la_LIBADD = \
diff --git a/plugins/pynb/core-ui.c b/plugins/pynb/core-ui.c
index 1f89848..489284c 100644
--- a/plugins/pynb/core-ui.c
+++ b/plugins/pynb/core-ui.c
@@ -27,11 +27,13 @@
#include <i18n.h>
#include <gui/core/panels.h>
#include <plugins/self.h>
+#include <plugins/tweakable-int.h>
#include "core-ui-int.h"
#include "panel.h"
#include "params.h"
+#include "prefs.h"
@@ -41,6 +43,9 @@
/* Initialise la classe des recherches et identifications. */
static void g_python_notebook_plugin_ui_class_init(GPythonNotebookPluginUIClass *);
+/* Procède à l'initialisation de l'interface d'intervention. */
+static void g_python_notebook_plugin_ui_tweakable_plugin_interface_init(GTweakablePluginInterface *);
+
/* Initialise une instance de recherches et identifications. */
static void g_python_notebook_plugin_ui_init(GPythonNotebookPluginUI *);
@@ -63,13 +68,22 @@ static bool g_python_notebook_plugin_ui_disable(GPythonNotebookPluginUI *);
+/* ------------------- INTEGRATION DANS L'EDITION DES PREFERENCES ------------------- */
+
+
+/* Fournit une liste de sections de configuration. */
+static tweak_info_t *g_python_notebook_plugin_ui_get_tweak_info(const GTweakablePlugin *, size_t *);
+
+
+
/* ---------------------------------------------------------------------------------- */
/* COMPOSITION DE NOUVEAU GREFFON NATIF */
/* ---------------------------------------------------------------------------------- */
/* Indique le type défini pour un greffon de liaison Python */
-G_DEFINE_TYPE(GPythonNotebookPluginUI, g_python_notebook_plugin_ui, G_TYPE_NATIVE_PLUGIN);
+G_DEFINE_TYPE_WITH_CODE(GPythonNotebookPluginUI, g_python_notebook_plugin_ui, G_TYPE_NATIVE_PLUGIN,
+ G_IMPLEMENT_INTERFACE(G_TYPE_TWEAKABLE_PLUGIN, g_python_notebook_plugin_ui_tweakable_plugin_interface_init));
NATIVE_PLUGIN_ENTRYPOINT(g_python_notebook_plugin_ui_new);
@@ -107,6 +121,25 @@ static void g_python_notebook_plugin_ui_class_init(GPythonNotebookPluginUIClass
/******************************************************************************
* *
+* Paramètres : iface = interface GLib à initialiser. *
+* *
+* Description : Procède à l'initialisation de l'interface d'intervention. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_python_notebook_plugin_ui_tweakable_plugin_interface_init(GTweakablePluginInterface *iface)
+{
+ iface->get_info = g_python_notebook_plugin_ui_get_tweak_info;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : plugin = instance à initialiser. *
* *
* Description : Initialise une instance de recherches et identifications. *
@@ -290,3 +323,41 @@ static bool g_python_notebook_plugin_ui_disable(GPythonNotebookPluginUI *plugin)
return result;
}
+
+
+
+/* ---------------------------------------------------------------------------------- */
+/* INTEGRATION DANS L'EDITION DES PREFERENCES */
+/* ---------------------------------------------------------------------------------- */
+
+
+/******************************************************************************
+* *
+* Paramètres : plugin = interface à manipuler. *
+* count = taille de la liste renvoyée. [OUT] *
+* *
+* Description : Fournit une liste de sections de configuration. *
+* *
+* Retour : Définition(s) de section de configuration ou NULL. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static tweak_info_t *g_python_notebook_plugin_ui_get_tweak_info(const GTweakablePlugin *plugin, size_t *count)
+{
+ tweak_info_t *result; /* Liste à renvoyer */
+
+ tweak_info_t infos[] = {
+ TWEAK_SIMPLE_DEF("root", "Basics",
+ "pynb-symbolic", "pynotebook", "Notebook", GTK_TYPE_PYTHON_NOTEBOOK_PANEL_PANEL),
+ };
+
+ *count = 1;
+ result = malloc(*count * sizeof(tweak_info_t));
+
+ memcpy(result, infos, *count * sizeof(tweak_info_t));
+
+ return result;
+
+}
diff --git a/plugins/pynb/prefs-int.h b/plugins/pynb/prefs-int.h
new file mode 100644
index 0000000..9ce579e
--- /dev/null
+++ b/plugins/pynb/prefs-int.h
@@ -0,0 +1,48 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * prefs-int.h - définitions internes pour la configuration des paramètres liés aux notes
+ *
+ * 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 _PLUGINS_PYNB_PREFS_INT_H
+#define _PLUGINS_PYNB_PREFS_INT_H
+
+
+#include "prefs.h"
+
+
+
+/* Fenêtre d'édition générale de la configuration (instance) */
+struct _GtkPythonNotebookTweakPanel
+{
+ GtkBox parent; /* A laisser en premier */
+
+};
+
+/* Fenêtre d'édition générale de la configuration (classe) */
+struct _GtkPythonNotebookTweakPanelClass
+{
+ GtkBoxClass parent; /* A laisser en premier */
+
+};
+
+
+
+#endif /* _PLUGINS_PYNB_PREFS_INT_H */
diff --git a/plugins/pynb/prefs.c b/plugins/pynb/prefs.c
new file mode 100644
index 0000000..952f6c8
--- /dev/null
+++ b/plugins/pynb/prefs.c
@@ -0,0 +1,143 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * prefs.h - configuration des paramètres liés aux notes
+ *
+ * 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 "prefs.h"
+
+
+#include <gtkext/helpers.h>
+
+
+#include "prefs-int.h"
+
+
+
+/* Procède à l'initialisation de classe des configurations. */
+static void gtk_python_notebook_panel_panel_class_init(GtkPythonNotebookTweakPanelClass *);
+
+/* Procède à l'initialisation des configurations de sécurité. */
+static void gtk_python_notebook_panel_panel_init(GtkPythonNotebookTweakPanel *);
+
+/* Supprime toutes les références externes. */
+static void gtk_python_notebook_panel_panel_dispose(GObject *);
+
+/* Procède à la libération totale de la mémoire. */
+static void gtk_python_notebook_panel_panel_finalize(GObject *);
+
+
+
+/* Détermine le type du composant de configuration des notes. */
+G_DEFINE_TYPE(GtkPythonNotebookTweakPanel, gtk_python_notebook_panel_panel, GTK_TYPE_BOX);
+
+
+/******************************************************************************
+* *
+* Paramètres : class = classe GTK à initialiser. *
+* *
+* Description : Procède à l'initialisation de classe des configurations. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_python_notebook_panel_panel_class_init(GtkPythonNotebookTweakPanelClass *class)
+{
+ GObjectClass *object; /* Plus haut niveau équivalent */
+ GtkWidgetClass *widget; /* Classe de haut niveau */
+
+ object = G_OBJECT_CLASS(class);
+
+ object->dispose = gtk_python_notebook_panel_panel_dispose;
+ object->finalize = gtk_python_notebook_panel_panel_finalize;
+
+ widget = GTK_WIDGET_CLASS(class);
+
+ gtk_widget_class_set_template_from_resource(widget, "/re/chrysalide/framework/gui/panels/pynb-prefs.ui");
+
+ /* Stockage sécurisé */
+
+ //gtk_widget_class_bind_template_callback_full(widget, BUILDER_CB(gtk_python_notebook_panel_panel_on_new_passwords_changed));
+
+ //gtk_widget_class_bind_template_child(widget, GtkPythonNotebookTweakPanel, current_primary_passwd);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : panel = composant GTK à initialiser. *
+* *
+* Description : Procède à l'initialisation des configurations de sécurité. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_python_notebook_panel_panel_init(GtkPythonNotebookTweakPanel *panel)
+{
+ gtk_widget_init_template(GTK_WIDGET(panel));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : object = instance d'objet GLib à traiter. *
+* *
+* Description : Supprime toutes les références externes. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_python_notebook_panel_panel_dispose(GObject *object)
+{
+ gtk_widget_dispose_template(GTK_WIDGET(object), GTK_TYPE_PYTHON_NOTEBOOK_PANEL_PANEL);
+
+ G_OBJECT_CLASS(gtk_python_notebook_panel_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_python_notebook_panel_panel_finalize(GObject *object)
+{
+ G_OBJECT_CLASS(gtk_python_notebook_panel_panel_parent_class)->finalize(object);
+
+}
diff --git a/plugins/pynb/prefs.h b/plugins/pynb/prefs.h
new file mode 100644
index 0000000..9a20281
--- /dev/null
+++ b/plugins/pynb/prefs.h
@@ -0,0 +1,41 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * prefs.h - prototypes pour la configuration des paramètres liés aux notes
+ *
+ * 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 _PLUGINS_PYNB_PREFS_H
+#define _PLUGINS_PYNB_PREFS_H
+
+
+#include <gtk/gtk.h>
+
+
+#include <glibext/helpers.h>
+
+
+
+#define GTK_TYPE_PYTHON_NOTEBOOK_PANEL_PANEL (gtk_python_notebook_panel_panel_get_type())
+
+DECLARE_GTYPE(GtkPythonNotebookTweakPanel, gtk_python_notebook_panel_panel, GTK, PYTHON_NOTEBOOK_PANEL_PANEL);
+
+
+
+#endif /* _PLUGINS_PYNB_PREFS_H */
diff --git a/plugins/pynb/prefs.ui b/plugins/pynb/prefs.ui
index a6e44be..b8a6962 100644
--- a/plugins/pynb/prefs.ui
+++ b/plugins/pynb/prefs.ui
@@ -17,7 +17,7 @@
<child>
<object class="GtkLabel">
- <property name="label">Secret storage</property>
+ <property name="label">Notes config</property>
<property name="use-markup">true</property>
<property name="xalign">0</property>
<layout>
diff --git a/src/gtkext/tweak.h b/src/gtkext/tweak.h
index 568a793..8c44844 100644
--- a/src/gtkext/tweak.h
+++ b/src/gtkext/tweak.h
@@ -25,6 +25,7 @@
#define _GTKEXT_TWEAK_H
+#include <stdbool.h>
#include <gtk/gtk.h>
diff --git a/src/gui/dialogs/preferences.c b/src/gui/dialogs/preferences.c
index aca562a..68e7fd9 100644
--- a/src/gui/dialogs/preferences.c
+++ b/src/gui/dialogs/preferences.c
@@ -37,6 +37,8 @@
#include "prefs/security.h"
#include "../../common/cpp.h"
#include "../../gtkext/tweak.h"
+#include "../../plugins/pglist.h"
+#include "../../plugins/tweakable.h"
@@ -133,6 +135,8 @@ 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",
@@ -158,6 +162,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/plugins/Makefile.am b/src/plugins/Makefile.am
index 7d375e3..fa65484 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -10,7 +10,9 @@ libplugins_la_SOURCES = \
plugin-def.h \
plugin-int.h \
plugin.h plugin.c \
- self.h
+ self.h \
+ tweakable-int.h \
+ tweakable.h tweakable.c
libplugins_la_CFLAGS = $(TOOLKIT_CFLAGS) $(LIBXML_CFLAGS)
diff --git a/src/plugins/manager-int.h b/src/plugins/manager-int.h
index 5ccc8f8..dbd1d69 100644
--- a/src/plugins/manager-int.h
+++ b/src/plugins/manager-int.h
@@ -1,6 +1,6 @@
/* Chrysalide - Outil d'analyse de fichiers binaires
- * singleton-int.h - définitions internes propres aux interventions dans la gestion des extensions
+ * manager-int.h - définitions internes propres aux interventions dans la gestion des extensions
*
* Copyright (C) 2025 Cyrille Bagard
*
@@ -21,8 +21,8 @@
*/
-#ifndef _PLUGINS_CONTAINER_INT_H
-#define _PLUGINS_CONTAINER_INT_H
+#ifndef _PLUGINS_MANAGER_INT_H
+#define _PLUGINS_MANAGER_INT_H
#include "manager.h"
@@ -39,7 +39,7 @@ typedef void (* handle_native_plugins_cb) (GPluginManager *);
typedef void (* handle_all_plugins_cb) (GPluginManager *);
-/* Instance d'objet visant à être unique (interface) */
+/* Accompagnant dans la gestion des extensions (interface) */
struct _GPluginManagerInterface
{
GTypeInterface base_iface; /* A laisser en premier */
@@ -51,4 +51,4 @@ struct _GPluginManagerInterface
-#endif /* _PLUGINS_CONTAINER_INT_H */
+#endif /* _PLUGINS_MANAGER_INT_H */
diff --git a/src/plugins/pglist.h b/src/plugins/pglist.h
index 5541493..777b19c 100644
--- a/src/plugins/pglist.h
+++ b/src/plugins/pglist.h
@@ -69,25 +69,60 @@ GPluginModule **get_all_plugins(size_t *);
* Définitions des opérations appliquables à une catégories de greffons.
*/
-#define process_all_plugins_for(tp, cst, fc) \
- do \
- { \
- size_t __count; \
- GPluginModule **__list; \
- size_t __i; \
- __list = get_all_plugins(&__count); \
- for (__i = 0; __i < __count; __i++) \
- { \
- if (G_TYPE_CHECK_INSTANCE_TYPE(__list[__i], tp)) \
- fc(cst(__list[__i])); \
- unref_object(__list[__i]); \
- } \
- if (__list != NULL) \
- free(__list); \
- } \
+#define process_all_plugins_for(tp, cst, fc) \
+ do \
+ { \
+ size_t __count; \
+ GPluginModule **__list; \
+ size_t __i; \
+ GPluginModule *__pg; \
+ __list = get_all_plugins(&__count); \
+ for (__i = 0; __i < __count; __i++) \
+ { \
+ __pg = __list[__i]; \
+ if (G_TYPE_CHECK_INSTANCE_TYPE(__pg, tp)) \
+ fc(cst(__pg)); \
+ unref_object(__pg); \
+ } \
+ if (__list != NULL) \
+ free(__list); \
+ } \
while (0)
-
+#define accumulate_from_all_plugins(tp, cst, fc, atp, cnt) \
+ ({ \
+ atp *__acc_list; \
+ size_t __count; \
+ GPluginModule **__list; \
+ size_t __i; \
+ GPluginModule *__pg; \
+ size_t __tmp_count; \
+ atp *__tmp_list; \
+ *cnt = 0; \
+ __acc_list = NULL; \
+ __list = get_all_plugins(&__count); \
+ for (__i = 0; __i < __count; __i++) \
+ { \
+ __pg = __list[__i]; \
+ if (G_TYPE_CHECK_INSTANCE_TYPE(__pg, tp)) \
+ { \
+ __tmp_list = fc(cst(__pg), &__tmp_count); \
+ if (__tmp_list != NULL) \
+ { \
+ __acc_list = realloc(__acc_list, \
+ (*cnt + __tmp_count) * sizeof(atp)); \
+ memcpy(&__acc_list[*cnt], __tmp_list, \
+ __tmp_count * sizeof(atp)); \
+ *cnt += __tmp_count; \
+ free(__tmp_list); \
+ } \
+ } \
+ unref_object(__pg); \
+ } \
+ if (__list != NULL) \
+ free(__list); \
+ __acc_list; \
+ })
diff --git a/src/plugins/tweakable-int.h b/src/plugins/tweakable-int.h
new file mode 100644
index 0000000..776626f
--- /dev/null
+++ b/src/plugins/tweakable-int.h
@@ -0,0 +1,50 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * tweakable-int.h - définitions internes propres aux participations aux mécanismes de configuration
+ *
+ * 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 _PLUGINS_TWEAKABLE_INT_H
+#define _PLUGINS_TWEAKABLE_INT_H
+
+
+#include "tweakable.h"
+
+
+
+/* ------------------- INTEGRATION DANS L'EDITION DES PREFERENCES ------------------- */
+
+
+/* Fournit une liste de sections de configuration. */
+typedef tweak_info_t * (* get_tweakable_plugin_info) (const GTweakablePlugin *, size_t *);
+
+
+/* Greffon avec des compléments pour l'interface de configuration (interface) */
+struct _GTweakablePluginInterface
+{
+ GTypeInterface base_iface; /* A laisser en premier */
+
+ get_tweakable_plugin_info get_info; /* Récupération de section(s) */
+
+};
+
+
+
+#endif /* _PLUGINS_TWEAKABLE_INT_H */
diff --git a/src/plugins/tweakable.c b/src/plugins/tweakable.c
new file mode 100644
index 0000000..517c4a3
--- /dev/null
+++ b/src/plugins/tweakable.c
@@ -0,0 +1,98 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * tweakable.c - participation aux mécanismes de configuration
+ *
+ * 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 Foobar. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include "tweakable.h"
+
+
+#include "tweakable-int.h"
+
+
+
+/* ------------------- INTEGRATION DANS L'EDITION DES PREFERENCES ------------------- */
+
+
+/* Procède à l'initialisation de l'interface d'intervention. */
+static void g_tweakable_plugin_default_init(GTweakablePluginInterface *);
+
+
+
+/* ---------------------------------------------------------------------------------- */
+/* INTEGRATION DANS L'EDITION DES PREFERENCES */
+/* ---------------------------------------------------------------------------------- */
+
+
+/* Détermine le type d'une interface pour l'intervention dans la gestion des greffons. */
+G_DEFINE_INTERFACE(GTweakablePlugin, g_tweakable_plugin, G_TYPE_OBJECT)
+
+
+/******************************************************************************
+* *
+* Paramètres : iface = interface GLib à initialiser. *
+* *
+* Description : Procède à l'initialisation de l'interface d'intervention. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_tweakable_plugin_default_init(GTweakablePluginInterface *iface)
+{
+ iface->get_info = NULL;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : plugin = interface à manipuler. *
+* count = taille de la liste renvoyée. [OUT] *
+* *
+* Description : Fournit une liste de sections de configuration. *
+* *
+* Retour : Définition(s) de section de configuration ou NULL. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+tweak_info_t *g_tweakable_plugin_get_tweak_info(const GTweakablePlugin *plugin, size_t *count)
+{
+ tweak_info_t *result; /* Liste à renvoyer */
+ GTweakablePluginInterface *iface; /* Interface utilisée */
+
+ iface = G_TWEAKABLE_PLUGIN_GET_IFACE(plugin);
+
+ if (iface->get_info != NULL)
+ result = iface->get_info(plugin, count);
+
+ else
+ {
+ *count = 0;
+ result = NULL;
+ }
+
+ return result;
+
+}
diff --git a/src/plugins/tweakable.h b/src/plugins/tweakable.h
new file mode 100644
index 0000000..aea70b4
--- /dev/null
+++ b/src/plugins/tweakable.h
@@ -0,0 +1,62 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * tweakable.h - prototypes pour la participation aux mécanismes de configuration
+ *
+ * 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 Foobar. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _PLUGINS_TWEAKABLE_H
+#define _PLUGINS_TWEAKABLE_H
+
+
+#include "../glibext/helpers.h"
+#include "../gtkext/tweak.h"
+
+
+
+/* ------------------- INTEGRATION DANS L'EDITION DES PREFERENCES ------------------- */
+
+
+#define G_TYPE_TWEAKABLE_PLUGIN (g_tweakable_plugin_get_type())
+
+DECLARE_INTERFACE(GTweakablePlugin, g_tweakable_plugin, G, TWEAKABLE_PLUGIN);
+
+
+/* Fournit une liste de sections de configuration. */
+tweak_info_t *g_tweakable_plugin_get_tweak_info(const GTweakablePlugin *, size_t *);
+
+
+
+/* -------------------- SOLLICITATION DES FONCTIONNALITES CREEES -------------------- */
+
+
+#define get_tweakable_plugins_info(c) \
+ ({ \
+ tweak_info_t *__all_info; \
+ __all_info = accumulate_from_all_plugins(G_TYPE_TWEAKABLE_PLUGIN, \
+ G_TWEAKABLE_PLUGIN, \
+ g_tweakable_plugin_get_tweak_info, \
+ tweak_info_t, \
+ c); \
+ __all_info; \
+ })
+
+
+
+#endif /* _PLUGINS_TWEAKABLE_H */