summaryrefslogtreecommitdiff
path: root/src/gui/panels
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-10-14 22:31:03 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-10-14 22:31:03 (GMT)
commitcfa7c9543b4265ae65bc7097350fcf8587117fe3 (patch)
treec4a3bd87e694b618536ddfc7a319daefd776b7cb /src/gui/panels
parent646dcfd9bfba1f9f913d0ee0580b3cba06f11ca9 (diff)
Added a way to load resources for plugins.
Diffstat (limited to 'src/gui/panels')
-rw-r--r--src/gui/panels/panel-int.h3
-rw-r--r--src/gui/panels/panel.c28
2 files changed, 29 insertions, 2 deletions
diff --git a/src/gui/panels/panel-int.h b/src/gui/panels/panel-int.h
index 4ea9182..a8326ad 100644
--- a/src/gui/panels/panel-int.h
+++ b/src/gui/panels/panel-int.h
@@ -123,6 +123,9 @@ struct _GPanelItemClass
/* Charge les éléments graphiques du panneau via les ressources. */
GtkBuilder *g_panel_item_build(GPanelItem *, const char *);
+/* Charge les éléments graphiques du panneau via les ressources. */
+GtkBuilder *g_panel_item_build_full(GPanelItem *, const char *);
+
/* ---------------------- MECANISMES DE MISE A JOUR DE PANNEAU ---------------------- */
diff --git a/src/gui/panels/panel.c b/src/gui/panels/panel.c
index 78f70f3..c21e1b2 100644
--- a/src/gui/panels/panel.c
+++ b/src/gui/panels/panel.c
@@ -295,14 +295,38 @@ GtkBuilder *g_panel_item_build(GPanelItem *item, const char *name)
{
GtkBuilder *result; /* Constructeur à retourner */
char *path; /* Chemin d'accès à constituer */
- GEditorItem *base; /* Version basique d'instance */
asprintf(&path, "/org/chrysalide/gui/panels/%s.ui", name);
- result = gtk_builder_new_from_resource(path);
+ result = g_panel_item_build_full(item, path);
free(path);
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : item = panneau dont la construction est à poursuivre. *
+* path = chemin d'accès complet à la ressource à charger. *
+* *
+* Description : Charge les éléments graphiques du panneau via les ressources.*
+* *
+* Retour : Constructeur mis en place, afin de faciliter son usage. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GtkBuilder *g_panel_item_build_full(GPanelItem *item, const char *path)
+{
+ GtkBuilder *result; /* Constructeur à retourner */
+ GEditorItem *base; /* Version basique d'instance */
+
+ result = gtk_builder_new_from_resource(path);
+
item->builder = result;
base = G_EDITOR_ITEM(item);