diff options
Diffstat (limited to 'plugins/pychrysalide/format/program.c')
-rw-r--r-- | plugins/pychrysalide/format/program.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/plugins/pychrysalide/format/program.c b/plugins/pychrysalide/format/program.c index 01b9703..57a359a 100644 --- a/plugins/pychrysalide/format/program.c +++ b/plugins/pychrysalide/format/program.c @@ -55,9 +55,9 @@ /* Initialise la classe des formats de programmes. */ -static void py_program_format_init_gclass(GProgramFormatClass *, gpointer); +static int py_program_format_init_gclass(GProgramFormatClass *, PyTypeObject *); -CREATE_DYN_ABSTRACT_CONSTRUCTOR(program_format, G_TYPE_PROGRAM_FORMAT, py_program_format_init_gclass); +CREATE_DYN_ABSTRACT_CONSTRUCTOR(program_format, G_TYPE_PROGRAM_FORMAT); /* Initialise une instance sur la base du dérivé de GObject. */ static int py_program_format_init(PyObject *, PyObject *, PyObject *); @@ -140,21 +140,23 @@ static PyObject *py_program_format_get_errors(PyObject *, void *); /****************************************************************************** * * -* 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 formats de programmes. * * * -* Retour : - * +* Retour : 0 pour indiquer un succès de l'opération. * * * * Remarques : - * * * ******************************************************************************/ -static void py_program_format_init_gclass(GProgramFormatClass *class, gpointer unused) +static int py_program_format_init_gclass(GProgramFormatClass *gclass, PyTypeObject *pyclass) { - class->get_endian = py_program_format_get_endianness_wrapper; - class->find_range_by_name = py_program_format_find_section_range_by_name_wrapper; + PY_CLASS_SET_WRAPPER(gclass->get_endian, py_program_format_get_endianness_wrapper); + PY_CLASS_SET_WRAPPER(gclass->find_range_by_name, py_program_format_find_section_range_by_name_wrapper); + + return 0; } @@ -1273,6 +1275,8 @@ bool ensure_python_program_format_is_registered(void) if (!ensure_python_known_format_is_registered()) return false; + pyg_register_class_init(G_TYPE_PROGRAM_FORMAT, (PyGClassInitFunc)py_program_format_init_gclass); + if (!register_class_for_pygobject(dict, G_TYPE_PROGRAM_FORMAT, type)) return false; |