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 /plugins/pychrysalide/helpers.c | |
parent | 6122bb7f34b178d4c07285adae16afcc55294b1f (diff) |
Rewritten the whole API dealing with panels.
Diffstat (limited to 'plugins/pychrysalide/helpers.c')
-rw-r--r-- | plugins/pychrysalide/helpers.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/pychrysalide/helpers.c b/plugins/pychrysalide/helpers.c index 870035d..894b600 100644 --- a/plugins/pychrysalide/helpers.c +++ b/plugins/pychrysalide/helpers.c @@ -1129,6 +1129,45 @@ int forward_pygobjet_init(PyObject *self) * Paramètres : arg = argument quelconque à tenter de convertir. * * dst = destination des valeurs récupérées en cas de succès. * * * +* Description : Tente de convertir en valeur GType. * +* * +* Retour : Bilan de l'opération, voire indications supplémentaires. * +* * +* Remarques : - * +* * +******************************************************************************/ + +int convert_to_gtype(PyObject *arg, void *dst) +{ + int result; /* Bilan à retourner */ + GType type; /* Type obtenu ou 0 */ + + type = pyg_type_from_object(arg); + + switch (type) + { + case G_TYPE_INVALID: + /* L'exception est déjà fixée par Python */ + result = 0; + break; + + default: + *((GType *)dst) = type; + result = 1; + break; + + } + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : arg = argument quelconque à tenter de convertir. * +* dst = destination des valeurs récupérées en cas de succès. * +* * * Description : Tente de convertir en instance GObject. * * * * Retour : Bilan de l'opération, voire indications supplémentaires. * |