diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-12-05 00:39:57 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-12-05 00:39:57 (GMT) |
commit | 1e3fa9b79ebe55698e2aa7d5484baec7e8400a8f (patch) | |
tree | c3581ceb7f8586f2f6822de563927a1246dd33a5 /src/plugins/dt.c | |
parent | 6122bb7f34b178d4c07285adae16afcc55294b1f (diff) |
Rewritten the whole API dealing with panels.
Diffstat (limited to 'src/plugins/dt.c')
-rw-r--r-- | src/plugins/dt.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/plugins/dt.c b/src/plugins/dt.c index 69bd5df..c476dde 100644 --- a/src/plugins/dt.c +++ b/src/plugins/dt.c @@ -29,6 +29,9 @@ #include <string.h> +#include "../plugins/pglist.h" + + /* ------------------------- MODULE DE GESTION DES NOUVEAUX ------------------------- */ @@ -482,3 +485,34 @@ GType build_dynamic_type(GType parent, const char *name, GClassInitFunc cinit, g return result; } + + +/****************************************************************************** +* * +* Paramètres : type = type d'instance à créer. * +* * +* Description : Crée un objet à partir d'un type, dynamique ou classique. * +* * +* Retour : Instance d'objet mise en place ou NULL en cas d'erreur. * +* * +* Remarques : - * +* * +******************************************************************************/ + +gpointer create_object_from_type(GType type) +{ + GObject *result; /* Instance à retourner */ + + result = NULL; + + if (g_dynamic_types_find(_chrysalide_dtypes, type) != NULL) + result = build_type_instance(type); + + else + result = g_object_new(type, NULL); + + assert(result != NULL); + + return result; + +} |