From c9f7b4491b368f886b0852ba166cef969fd6d20f Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Sat, 4 May 2019 17:09:10 +0200 Subject: Setup helpers for Python bindings documentation. --- plugins/pychrysalide/helpers.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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. -- cgit v0.11.2-87-g4458