diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-07-14 13:09:58 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-07-14 13:09:58 (GMT) |
commit | ce1baffaf5917431602a6967f8df99a183b3f1c3 (patch) | |
tree | 396468ab1dc90d769bb6a61389e4fd0265c3d568 | |
parent | 6c751d40ab1b84a6979c143ed47702207edebed8 (diff) |
Switched to the new interface registration for Python bindings.
-rw-r--r-- | plugins/pychrysalide/analysis/content.c | 2 | ||||
-rw-r--r-- | plugins/pychrysalide/analysis/loaded.c | 2 | ||||
-rw-r--r-- | plugins/pychrysalide/analysis/storage/container.c | 2 | ||||
-rw-r--r-- | plugins/pychrysalide/analysis/storage/serialize.c | 2 | ||||
-rw-r--r-- | plugins/pychrysalide/arch/operands/feeder.c | 2 | ||||
-rw-r--r-- | plugins/pychrysalide/arch/operands/rename.c | 4 | ||||
-rw-r--r-- | plugins/pychrysalide/arch/operands/targetable.c | 2 | ||||
-rw-r--r-- | plugins/pychrysalide/glibext/linegen.c | 2 | ||||
-rw-r--r-- | plugins/pychrysalide/glibext/loadedpanel.c | 2 | ||||
-rw-r--r-- | plugins/pychrysalide/gtkext/dockable.c | 2 | ||||
-rw-r--r-- | plugins/pychrysalide/helpers.c | 45 | ||||
-rw-r--r-- | plugins/pychrysalide/helpers.h | 5 |
12 files changed, 13 insertions, 59 deletions
diff --git a/plugins/pychrysalide/analysis/content.c b/plugins/pychrysalide/analysis/content.c index 5b5608c..04c3bae 100644 --- a/plugins/pychrysalide/analysis/content.c +++ b/plugins/pychrysalide/analysis/content.c @@ -1410,7 +1410,7 @@ bool ensure_python_binary_content_is_registered(void) dict = PyModule_GetDict(module); - if (!register_interface_for_pygobject_2(dict, G_TYPE_BIN_CONTENT, type, &info)) + if (!register_interface_for_pygobject(dict, G_TYPE_BIN_CONTENT, type, &info)) return false; if (!define_analysis_content_constants(type)) diff --git a/plugins/pychrysalide/analysis/loaded.c b/plugins/pychrysalide/analysis/loaded.c index e3b2625..3eaed81 100644 --- a/plugins/pychrysalide/analysis/loaded.c +++ b/plugins/pychrysalide/analysis/loaded.c @@ -1445,7 +1445,7 @@ bool ensure_python_loaded_content_is_registered(void) dict = PyModule_GetDict(module); - if (!register_interface_for_pygobject_2(dict, G_TYPE_LOADED_CONTENT, type, &info)) + if (!register_interface_for_pygobject(dict, G_TYPE_LOADED_CONTENT, type, &info)) return false; } diff --git a/plugins/pychrysalide/analysis/storage/container.c b/plugins/pychrysalide/analysis/storage/container.c index d32c689..e412571 100644 --- a/plugins/pychrysalide/analysis/storage/container.c +++ b/plugins/pychrysalide/analysis/storage/container.c @@ -400,7 +400,7 @@ bool ensure_python_cache_container_is_registered(void) dict = PyModule_GetDict(module); - if (!register_interface_for_pygobject_2(dict, G_TYPE_CACHE_CONTAINER, type, &info)) + if (!register_interface_for_pygobject(dict, G_TYPE_CACHE_CONTAINER, type, &info)) return false; } diff --git a/plugins/pychrysalide/analysis/storage/serialize.c b/plugins/pychrysalide/analysis/storage/serialize.c index eeab8f5..3bf5183 100644 --- a/plugins/pychrysalide/analysis/storage/serialize.c +++ b/plugins/pychrysalide/analysis/storage/serialize.c @@ -457,7 +457,7 @@ bool ensure_python_serializable_object_is_registered(void) dict = PyModule_GetDict(module); - if (!register_interface_for_pygobject_2(dict, G_TYPE_SERIALIZABLE_OBJECT, type, &info)) + if (!register_interface_for_pygobject(dict, G_TYPE_SERIALIZABLE_OBJECT, type, &info)) return false; } diff --git a/plugins/pychrysalide/arch/operands/feeder.c b/plugins/pychrysalide/arch/operands/feeder.c index 68fa052..d32e965 100644 --- a/plugins/pychrysalide/arch/operands/feeder.c +++ b/plugins/pychrysalide/arch/operands/feeder.c @@ -397,7 +397,7 @@ bool ensure_python_proxy_feeder_is_registered(void) dict = PyModule_GetDict(module); - if (!register_interface_for_pygobject_2(dict, G_TYPE_PROXY_FEEDER, type, &info)) + if (!register_interface_for_pygobject(dict, G_TYPE_PROXY_FEEDER, type, &info)) return false; } diff --git a/plugins/pychrysalide/arch/operands/rename.c b/plugins/pychrysalide/arch/operands/rename.c index 60985db..bef2982 100644 --- a/plugins/pychrysalide/arch/operands/rename.c +++ b/plugins/pychrysalide/arch/operands/rename.c @@ -294,7 +294,7 @@ bool ensure_python_renamed_operand_is_registered(void) dict = PyModule_GetDict(module); - if (!register_interface_for_pygobject_2(dict, G_TYPE_RENAMED_OPERAND, type, &info)) + if (!register_interface_for_pygobject(dict, G_TYPE_RENAMED_OPERAND, type, &info)) return false; } @@ -591,7 +591,7 @@ bool ensure_python_renameable_operand_is_registered(void) dict = PyModule_GetDict(module); - if (!register_interface_for_pygobject_2(dict, G_TYPE_RENAMEABLE_OPERAND, type, &info)) + if (!register_interface_for_pygobject(dict, G_TYPE_RENAMEABLE_OPERAND, type, &info)) return false; } diff --git a/plugins/pychrysalide/arch/operands/targetable.c b/plugins/pychrysalide/arch/operands/targetable.c index de1a6b4..4d921be 100644 --- a/plugins/pychrysalide/arch/operands/targetable.c +++ b/plugins/pychrysalide/arch/operands/targetable.c @@ -331,7 +331,7 @@ bool ensure_python_targetable_operand_is_registered(void) dict = PyModule_GetDict(module); - if (!register_interface_for_pygobject_2(dict, G_TYPE_TARGETABLE_OPERAND, type, &info)) + if (!register_interface_for_pygobject(dict, G_TYPE_TARGETABLE_OPERAND, type, &info)) return false; } diff --git a/plugins/pychrysalide/glibext/linegen.c b/plugins/pychrysalide/glibext/linegen.c index 6d29dbc..1ab4ec6 100644 --- a/plugins/pychrysalide/glibext/linegen.c +++ b/plugins/pychrysalide/glibext/linegen.c @@ -834,7 +834,7 @@ bool ensure_python_line_generator_is_registered(void) dict = PyModule_GetDict(module); - if (!register_interface_for_pygobject_2(dict, G_TYPE_LINE_GENERATOR, type, &info)) + if (!register_interface_for_pygobject(dict, G_TYPE_LINE_GENERATOR, type, &info)) return false; } diff --git a/plugins/pychrysalide/glibext/loadedpanel.c b/plugins/pychrysalide/glibext/loadedpanel.c index 6e87cde..d2af7fe 100644 --- a/plugins/pychrysalide/glibext/loadedpanel.c +++ b/plugins/pychrysalide/glibext/loadedpanel.c @@ -297,7 +297,7 @@ bool ensure_python_loaded_panel_is_registered(void) dict = PyModule_GetDict(module); - if (!register_interface_for_pygobject_2(dict, G_TYPE_LOADED_PANEL, type, &info)) + if (!register_interface_for_pygobject(dict, G_TYPE_LOADED_PANEL, type, &info)) return false; if (!define_loaded_panel_constants(type)) diff --git a/plugins/pychrysalide/gtkext/dockable.c b/plugins/pychrysalide/gtkext/dockable.c index 1412589..e8a6cb1 100644 --- a/plugins/pychrysalide/gtkext/dockable.c +++ b/plugins/pychrysalide/gtkext/dockable.c @@ -609,7 +609,7 @@ bool ensure_python_dockable_is_registered(void) dict = PyModule_GetDict(module); - if (!register_interface_for_pygobject_2(dict, GTK_TYPE_DOCKABLE, type, &info)) + if (!register_interface_for_pygobject(dict, GTK_TYPE_DOCKABLE, type, &info)) return false; } diff --git a/plugins/pychrysalide/helpers.c b/plugins/pychrysalide/helpers.c index 3cd528e..1e83ac7 100644 --- a/plugins/pychrysalide/helpers.c +++ b/plugins/pychrysalide/helpers.c @@ -909,50 +909,7 @@ bool _register_class_for_pygobject(PyObject *dict, GType gtype, PyTypeObject *ty * * ******************************************************************************/ -bool register_interface_for_pygobject(PyObject *dict, GType gtype, PyTypeObject *type) -{ - bool result; /* Bilan à retourner */ - char *name; /* Désignation de la classe */ - - assert(gtype != G_TYPE_INVALID); - - name = strrchr(type->tp_name, '.'); - assert(name != NULL); - - name++; - - pyg_register_interface(dict, name, gtype, type); - - if (startswith(type->tp_name, "pychrysalide.")) - { - define_auto_documentation(type); - - result = include_python_type_into_features(dict, type); - - } - else - result = true; - - return result; - -} - - -/****************************************************************************** -* * -* Paramètres : dict = dictionnaire où conserver une référence au type créé.* -* gtype = type dans sa version GLib. * -* type = type dans sa version Python. * -* * -* Description : Enregistre correctement une interface GObject pour Python. * -* * -* Retour : Bilan de l'opération. * -* * -* Remarques : - * -* * -******************************************************************************/ - -bool register_interface_for_pygobject_2(PyObject *dict, GType gtype, PyTypeObject *type, const GInterfaceInfo *info) +bool register_interface_for_pygobject(PyObject *dict, GType gtype, PyTypeObject *type, const GInterfaceInfo *info) { bool result; /* Bilan à retourner */ char *name; /* Désignation de la classe */ diff --git a/plugins/pychrysalide/helpers.h b/plugins/pychrysalide/helpers.h index a74a747..c3ae535 100644 --- a/plugins/pychrysalide/helpers.h +++ b/plugins/pychrysalide/helpers.h @@ -173,10 +173,7 @@ bool _register_class_for_pygobject(PyObject *, GType, PyTypeObject *, PyTypeObje _register_class_for_pygobject(dict, gtype, type, base, NULL) /* Enregistre correctement une interface GObject pour Python. */ -bool register_interface_for_pygobject(PyObject *, GType, PyTypeObject *) __attribute__ ((deprecated)); - -/* Enregistre correctement une interface GObject pour Python. */ -bool register_interface_for_pygobject_2(PyObject *, GType, PyTypeObject *, const GInterfaceInfo *); +bool register_interface_for_pygobject(PyObject *, GType, PyTypeObject *, const GInterfaceInfo *); /* Enregistre un type Python dérivant d'un type GLib dynamique. */ bool register_class_for_dynamic_pygobject(GType, PyTypeObject *, PyTypeObject *); |