diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2025-02-22 17:53:07 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2025-02-22 17:53:07 (GMT) |
commit | 8fe33f41ae9bd319298c601548a453020d23ad06 (patch) | |
tree | b7936b22311f403616fc851d8715d7fee9a49cb2 /plugins/pynb/core-ui.c | |
parent | 0b8fbc0c0d6a18cf1b90337dbd20639316af1fe7 (diff) |
Handle configuration edition for plugins.
Diffstat (limited to 'plugins/pynb/core-ui.c')
-rw-r--r-- | plugins/pynb/core-ui.c | 73 |
1 files changed, 72 insertions, 1 deletions
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; + +} |