diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2025-01-14 03:02:42 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2025-01-14 03:02:42 (GMT) |
commit | d87c3d00f6448233cfcabc2b6d8bc82e395d4190 (patch) | |
tree | b2be6d75bd97189118124cb11fb1a535988dd4c4 /plugins/pychrysalide/glibext | |
parent | 9d6c6af8ea3a21e206b0ffb65c04db5cca7154b1 (diff) |
Update code for Python abstract GLib objects constructors.
Diffstat (limited to 'plugins/pychrysalide/glibext')
-rw-r--r-- | plugins/pychrysalide/glibext/work.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/plugins/pychrysalide/glibext/work.c b/plugins/pychrysalide/glibext/work.c index 6a15984..e6791e3 100644 --- a/plugins/pychrysalide/glibext/work.c +++ b/plugins/pychrysalide/glibext/work.c @@ -41,9 +41,9 @@ /* Initialise la classe des travaux programmés. */ -static void py_generic_work_init_gclass(GGenericWorkClass *, gpointer); +static int py_generic_work_init_gclass(GGenericWorkClass *, PyTypeObject *); -CREATE_DYN_ABSTRACT_CONSTRUCTOR(generic_work, G_TYPE_GENERIC_WORK, py_generic_work_init_gclass); +CREATE_DYN_ABSTRACT_CONSTRUCTOR(generic_work, G_TYPE_GENERIC_WORK); /* Initialise une instance sur la base du dérivé de GObject. */ static int py_generic_work_init(PyObject *, PyObject *, PyObject *); @@ -68,20 +68,22 @@ static PyObject *py_generic_work_process(PyObject *, PyObject *); /****************************************************************************** * * -* Paramètres : class = classe à initialiser. * -* unused = données non utilisées ici. * +* Paramètres : gclass = classe GLib à initialiser. * +* pyclass = classe Python à initialiser. * * * * Description : Initialise la classe des travaux programmés. * * * -* Retour : - * +* Retour : 0 pour indiquer un succès de l'opération. * * * * Remarques : - * * * ******************************************************************************/ -static void py_generic_work_init_gclass(GGenericWorkClass *class, gpointer unused) +static int py_generic_work_init_gclass(GGenericWorkClass *gclass, PyTypeObject *pyclass) { - class->run = py_generic_work_run_wrapper; + PY_CLASS_SET_WRAPPER(gclass->run, py_generic_work_run_wrapper); + + return 0; } @@ -296,6 +298,8 @@ bool ensure_python_generic_work_is_registered(void) dict = PyModule_GetDict(module); + pyg_register_class_init(G_TYPE_GENERIC_WORK, (PyGClassInitFunc)py_generic_work_init_gclass); + if (!register_class_for_pygobject(dict, G_TYPE_GENERIC_WORK, type)) return false; |