diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-05-04 15:09:10 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-05-04 15:09:10 (GMT) |
commit | c9f7b4491b368f886b0852ba166cef969fd6d20f (patch) | |
tree | 3f24c5aef80e45481e934ad52c0aeada3d9d486b | |
parent | 1ae85114016fb51d3d6328385c7cd1b1a071a498 (diff) |
Setup helpers for Python bindings documentation.
-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. |