diff options
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/pychrysalide/helpers.h | 24 | 
1 files changed, 24 insertions, 0 deletions
| diff --git a/plugins/pychrysalide/helpers.h b/plugins/pychrysalide/helpers.h index 7bc7577..ca393db 100644 --- a/plugins/pychrysalide/helpers.h +++ b/plugins/pychrysalide/helpers.h @@ -80,6 +80,30 @@ bool register_python_module_object(PyObject *, PyTypeObject *);  /** + * Aide à la définition de documentation pour Python. + */ + +#define PYTHON_METHOD_DEF(name, args, flags, meth, doc) \ +    {                                                   \ +        name, meth,                                     \ +        flags,                                          \ +        name "(" args ")\n--\n\n" doc                   \ +    } + +#define PYTHON_GETSET_DEF(name, get, set, doc, closure) \ +    {                                                   \ +        name, get, set,                                 \ +        doc,                                            \ +        closure                                         \ +    } + +#define PYTHON_GET_DEF_FULL(name, base, doc)            \ +    PYTHON_GETSET_DEF(#name, base ## _get_ ## name, NULL, doc, NULL) + +#define PYTHON_GETSET_DEF_FULL(name, base, doc)         \ +    PYTHON_GETSET_DEF(#name, base ## _get_ ## name, base ## _set_ ## name, doc, NULL) + +/**   * Quelque chose est mal fait au niveau de l'abstraction GObject.   * Du coup, Py_TPFLAGS_IS_ABSTRACT n'est pas pris en compte.   * On force alors la méthode de base pour obtenir un traitement correct. | 
