diff options
Diffstat (limited to 'plugins/pychrysalide/helpers.c')
| -rw-r--r-- | plugins/pychrysalide/helpers.c | 36 | 
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/pychrysalide/helpers.c b/plugins/pychrysalide/helpers.c index 2b62e57..d4c56e8 100644 --- a/plugins/pychrysalide/helpers.c +++ b/plugins/pychrysalide/helpers.c @@ -780,6 +780,42 @@ bool _register_class_for_pygobject(PyObject *dict, GType gtype, PyTypeObject *ty  *  Paramètres  : dict  = dictionnaire où conserver une référence au type créé.*  *                gtype = type dans sa version GLib.                           *  *                type  = type dans sa version Python.                         * +*                                                                             * +*  Description : Enregistre correctement une interface GObject pour Python.   * +*                                                                             * +*  Retour      : Bilan de l'opération.                                        * +*                                                                             * +*  Remarques   : -                                                            * +*                                                                             * +******************************************************************************/ + +bool register_interface_for_pygobject(PyObject *dict, GType gtype, PyTypeObject *type) +{ +    bool result;                            /* Bilan à retourner           */ +    char *name;                             /* Désignation de la classe    */ + +    name = strrchr(type->tp_name, '.'); +    assert(name != NULL); + +    name++; + +    pyg_register_interface(dict, name, gtype, type); + +    if (startswith(type->tp_name, "pychrysalide.")) +        result = include_python_type_into_features(dict, type); +    else +        result = true; + +    return result; + +} + + +/****************************************************************************** +*                                                                             * +*  Paramètres  : dict  = dictionnaire où conserver une référence au type créé.* +*                gtype = type dans sa version GLib.                           * +*                type  = type dans sa version Python.                         *  *                base  = type de base de l'objet.                             *  *                                                                             *  *  Description : Enregistre un type Python dérivant d'un type GLib dynamique. *  | 
