diff options
Diffstat (limited to 'plugins/pychrysalide')
88 files changed, 184 insertions, 224 deletions
diff --git a/plugins/pychrysalide/analysis/binary.c b/plugins/pychrysalide/analysis/binary.c index d8f01e5..6599ecc 100644 --- a/plugins/pychrysalide/analysis/binary.c +++ b/plugins/pychrysalide/analysis/binary.c @@ -562,7 +562,7 @@ bool ensure_python_loaded_binary_is_registered(void) if (!ensure_python_loaded_content_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_LOADED_BINARY, type, get_python_loaded_content_type())) + if (!register_class_for_pygobject(dict, G_TYPE_LOADED_BINARY, type)) return false; } diff --git a/plugins/pychrysalide/analysis/block.c b/plugins/pychrysalide/analysis/block.c index 0b09eb7..7f74c2f 100644 --- a/plugins/pychrysalide/analysis/block.c +++ b/plugins/pychrysalide/analysis/block.c @@ -353,7 +353,7 @@ bool ensure_python_code_block_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_CODE_BLOCK, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_CODE_BLOCK, type)) return false; } @@ -612,7 +612,7 @@ bool ensure_python_block_list_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_BLOCK_LIST, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_BLOCK_LIST, type)) return false; } diff --git a/plugins/pychrysalide/analysis/cattribs.c b/plugins/pychrysalide/analysis/cattribs.c index 895fed8..84a5e1d 100644 --- a/plugins/pychrysalide/analysis/cattribs.c +++ b/plugins/pychrysalide/analysis/cattribs.c @@ -294,7 +294,7 @@ bool ensure_python_content_attributes_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_CONTENT_ATTRIBUTES, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_CONTENT_ATTRIBUTES, type)) return false; } diff --git a/plugins/pychrysalide/analysis/contents/encapsulated.c b/plugins/pychrysalide/analysis/contents/encapsulated.c index 0e09f81..a818bab 100644 --- a/plugins/pychrysalide/analysis/contents/encapsulated.c +++ b/plugins/pychrysalide/analysis/contents/encapsulated.c @@ -317,7 +317,7 @@ bool ensure_python_encaps_content_is_registered(void) if (!ensure_python_binary_content_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_ENCAPS_CONTENT, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_ENCAPS_CONTENT, type)) return false; } diff --git a/plugins/pychrysalide/analysis/contents/file.c b/plugins/pychrysalide/analysis/contents/file.c index 4786cdb..9552b6c 100644 --- a/plugins/pychrysalide/analysis/contents/file.c +++ b/plugins/pychrysalide/analysis/contents/file.c @@ -204,7 +204,7 @@ bool ensure_python_file_content_is_registered(void) if (!ensure_python_serializable_object_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_FILE_CONTENT, type, get_python_memory_content_type())) + if (!register_class_for_pygobject(dict, G_TYPE_FILE_CONTENT, type)) return false; } diff --git a/plugins/pychrysalide/analysis/contents/memory.c b/plugins/pychrysalide/analysis/contents/memory.c index e0ab267..b5448f0 100644 --- a/plugins/pychrysalide/analysis/contents/memory.c +++ b/plugins/pychrysalide/analysis/contents/memory.c @@ -172,7 +172,7 @@ bool ensure_python_memory_content_is_registered(void) if (!ensure_python_binary_content_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_MEMORY_CONTENT, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_MEMORY_CONTENT, type)) return false; } diff --git a/plugins/pychrysalide/analysis/contents/restricted.c b/plugins/pychrysalide/analysis/contents/restricted.c index 47df8c5..2609bb4 100644 --- a/plugins/pychrysalide/analysis/contents/restricted.c +++ b/plugins/pychrysalide/analysis/contents/restricted.c @@ -207,7 +207,7 @@ bool ensure_python_restricted_content_is_registered(void) if (!ensure_python_binary_content_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_RESTRICTED_CONTENT, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_RESTRICTED_CONTENT, type)) return false; } diff --git a/plugins/pychrysalide/analysis/db/admin.c b/plugins/pychrysalide/analysis/db/admin.c index a4694e6..10a150e 100644 --- a/plugins/pychrysalide/analysis/db/admin.c +++ b/plugins/pychrysalide/analysis/db/admin.c @@ -237,7 +237,7 @@ PyTypeObject *get_python_admin_client_type(void) * * * Paramètres : module = module dont la définition est à compléter. * * * -* Description : Prend en charge l'objet 'pychrysalide....db.AdminClient'. * +* Description : Prend en charge l'objet 'pychrysalide....db.AdminClient'. * * * * Retour : Bilan de l'opération. * * * @@ -255,14 +255,14 @@ bool ensure_python_admin_client_is_registered(void) if (!PyType_HasFeature(type, Py_TPFLAGS_READY)) { - if (!ensure_python_hub_client_is_registered()) - return false; - module = get_access_to_python_module("pychrysalide.analysis.db"); dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_ADMIN_CLIENT, type, get_python_hub_client_type())) + if (!ensure_python_hub_client_is_registered()) + return false; + + if (!register_class_for_pygobject(dict, G_TYPE_ADMIN_CLIENT, type)) return false; } diff --git a/plugins/pychrysalide/analysis/db/analyst.c b/plugins/pychrysalide/analysis/db/analyst.c index 3cb77d1..f2860ed 100644 --- a/plugins/pychrysalide/analysis/db/analyst.c +++ b/plugins/pychrysalide/analysis/db/analyst.c @@ -900,14 +900,14 @@ bool ensure_python_analyst_client_is_registered(void) if (!PyType_HasFeature(type, Py_TPFLAGS_READY)) { - if (!ensure_python_hub_client_is_registered()) - return false; - module = get_access_to_python_module("pychrysalide.analysis.db"); dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_ANALYST_CLIENT, type, get_python_hub_client_type())) + if (!ensure_python_hub_client_is_registered()) + return false; + + if (!register_class_for_pygobject(dict, G_TYPE_ANALYST_CLIENT, type)) return false; if (!define_loading_status_hint_constants(type)) diff --git a/plugins/pychrysalide/analysis/db/client.c b/plugins/pychrysalide/analysis/db/client.c index 0cd9704..7ef658e 100644 --- a/plugins/pychrysalide/analysis/db/client.c +++ b/plugins/pychrysalide/analysis/db/client.c @@ -235,7 +235,7 @@ bool ensure_python_hub_client_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_HUB_CLIENT, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_HUB_CLIENT, type)) return false; } diff --git a/plugins/pychrysalide/analysis/db/collection.c b/plugins/pychrysalide/analysis/db/collection.c index ca4151c..5970d15 100644 --- a/plugins/pychrysalide/analysis/db/collection.c +++ b/plugins/pychrysalide/analysis/db/collection.c @@ -165,7 +165,7 @@ bool ensure_python_db_collection_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_DB_COLLECTION, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_DB_COLLECTION, type)) return false; } diff --git a/plugins/pychrysalide/analysis/db/item.c b/plugins/pychrysalide/analysis/db/item.c index 836f902..cc9bdf4 100644 --- a/plugins/pychrysalide/analysis/db/item.c +++ b/plugins/pychrysalide/analysis/db/item.c @@ -369,7 +369,7 @@ bool ensure_python_db_item_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_DB_ITEM, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_DB_ITEM, type)) return false; if (!define_db_protocol_constants(type)) diff --git a/plugins/pychrysalide/analysis/db/items/bookmark.c b/plugins/pychrysalide/analysis/db/items/bookmark.c index af649e3..d2bc0f0 100644 --- a/plugins/pychrysalide/analysis/db/items/bookmark.c +++ b/plugins/pychrysalide/analysis/db/items/bookmark.c @@ -108,7 +108,7 @@ static PyObject *py_db_bookmark_new(PyTypeObject *type, PyObject *args, PyObject if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -366,7 +366,7 @@ bool ensure_python_db_bookmark_is_registered(void) if (!ensure_python_db_item_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_DB_BOOKMARK, type, get_python_db_item_type())) + if (!register_class_for_pygobject(dict, G_TYPE_DB_BOOKMARK, type)) return false; } @@ -473,7 +473,7 @@ static PyObject *py_bookmark_collection_new(PyTypeObject *type, PyObject *args, if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -570,7 +570,7 @@ bool ensure_python_bookmark_collection_is_registered(void) if (!ensure_python_db_collection_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_BM_COLLECTION, type, get_python_db_collection_type())) + if (!register_class_for_pygobject(dict, G_TYPE_BM_COLLECTION, type)) return false; } diff --git a/plugins/pychrysalide/analysis/db/items/comment.c b/plugins/pychrysalide/analysis/db/items/comment.c index 78d4902..1358f1d 100644 --- a/plugins/pychrysalide/analysis/db/items/comment.c +++ b/plugins/pychrysalide/analysis/db/items/comment.c @@ -117,7 +117,7 @@ static PyObject *py_db_comment_new(PyTypeObject *type, PyObject *args, PyObject if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -464,7 +464,7 @@ bool ensure_python_db_comment_is_registered(void) if (!ensure_python_db_item_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_DB_COMMENT, type, get_python_db_item_type())) + if (!register_class_for_pygobject(dict, G_TYPE_DB_COMMENT, type)) return false; if (!define_db_comment_constants(type)) @@ -574,7 +574,7 @@ static PyObject *py_comment_collection_new(PyTypeObject *type, PyObject *args, P if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -671,7 +671,7 @@ bool ensure_python_comment_collection_is_registered(void) if (!ensure_python_db_collection_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_COMMENT_COLLECTION, type, get_python_db_collection_type())) + if (!register_class_for_pygobject(dict, G_TYPE_COMMENT_COLLECTION, type)) return false; } diff --git a/plugins/pychrysalide/analysis/db/items/switcher.c b/plugins/pychrysalide/analysis/db/items/switcher.c index 6ac5cdf..5766fe1 100644 --- a/plugins/pychrysalide/analysis/db/items/switcher.c +++ b/plugins/pychrysalide/analysis/db/items/switcher.c @@ -114,7 +114,7 @@ static PyObject *py_db_switcher_new(PyTypeObject *type, PyObject *args, PyObject if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -398,7 +398,7 @@ bool ensure_python_db_switcher_is_registered(void) if (!ensure_python_db_item_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_DB_SWITCHER, type, get_python_db_item_type())) + if (!register_class_for_pygobject(dict, G_TYPE_DB_SWITCHER, type)) return false; } @@ -506,7 +506,7 @@ static PyObject *py_switcher_collection_new(PyTypeObject *type, PyObject *args, if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -603,7 +603,7 @@ bool ensure_python_switcher_collection_is_registered(void) if (!ensure_python_db_collection_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_SWITCHER_COLLECTION, type, get_python_db_collection_type())) + if (!register_class_for_pygobject(dict, G_TYPE_SWITCHER_COLLECTION, type)) return false; } diff --git a/plugins/pychrysalide/analysis/db/server.c b/plugins/pychrysalide/analysis/db/server.c index 9e4ee61..dae7b29 100644 --- a/plugins/pychrysalide/analysis/db/server.c +++ b/plugins/pychrysalide/analysis/db/server.c @@ -274,7 +274,7 @@ bool ensure_python_hub_server_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_HUB_SERVER, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_HUB_SERVER, type)) return false; if (!define_hub_server_constants(type)) diff --git a/plugins/pychrysalide/analysis/disass/block.c b/plugins/pychrysalide/analysis/disass/block.c index 38e65a1..d82e3e2 100644 --- a/plugins/pychrysalide/analysis/disass/block.c +++ b/plugins/pychrysalide/analysis/disass/block.c @@ -159,7 +159,10 @@ bool ensure_python_basic_block_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_BASIC_BLOCK, type, get_python_code_block_type())) + if (!ensure_python_code_block_is_registered()) + return false; + + if (!register_class_for_pygobject(dict, G_TYPE_BASIC_BLOCK, type)) return false; } diff --git a/plugins/pychrysalide/analysis/loaded.c b/plugins/pychrysalide/analysis/loaded.c index 84c9bfd..6e30ad2 100644 --- a/plugins/pychrysalide/analysis/loaded.c +++ b/plugins/pychrysalide/analysis/loaded.c @@ -199,7 +199,7 @@ static PyObject *py_loaded_content_new(PyTypeObject *type, PyObject *args, PyObj if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -1591,7 +1591,7 @@ bool ensure_python_loaded_content_is_registered(void) return false; #endif - if (!register_class_for_pygobject(dict, G_TYPE_LOADED_CONTENT, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_LOADED_CONTENT, type)) return false; } diff --git a/plugins/pychrysalide/analysis/loading.c b/plugins/pychrysalide/analysis/loading.c index dea4e31..8a60d8a 100644 --- a/plugins/pychrysalide/analysis/loading.c +++ b/plugins/pychrysalide/analysis/loading.c @@ -168,7 +168,7 @@ bool ensure_python_content_explorer_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_CONTENT_EXPLORER, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_CONTENT_EXPLORER, type)) return false; } @@ -294,7 +294,7 @@ bool ensure_python_content_resolver_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_CONTENT_RESOLVER, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_CONTENT_RESOLVER, type)) return false; } diff --git a/plugins/pychrysalide/analysis/project.c b/plugins/pychrysalide/analysis/project.c index e66119c..b00259a 100644 --- a/plugins/pychrysalide/analysis/project.c +++ b/plugins/pychrysalide/analysis/project.c @@ -402,7 +402,7 @@ bool ensure_python_study_project_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_STUDY_PROJECT, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_STUDY_PROJECT, type)) return false; } diff --git a/plugins/pychrysalide/analysis/routine.c b/plugins/pychrysalide/analysis/routine.c index e33ca90..535ba84 100644 --- a/plugins/pychrysalide/analysis/routine.c +++ b/plugins/pychrysalide/analysis/routine.c @@ -757,7 +757,7 @@ bool ensure_python_binary_routine_is_registered(void) if (!ensure_python_binary_symbol_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_BIN_ROUTINE, type, get_python_binary_symbol_type())) + if (!register_class_for_pygobject(dict, G_TYPE_BIN_ROUTINE, type)) return false; } diff --git a/plugins/pychrysalide/analysis/scan/context.c b/plugins/pychrysalide/analysis/scan/context.c index 1b418ea..524ec46 100644 --- a/plugins/pychrysalide/analysis/scan/context.c +++ b/plugins/pychrysalide/analysis/scan/context.c @@ -211,7 +211,7 @@ bool ensure_python_scan_context_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_SCAN_CONTEXT, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_SCAN_CONTEXT, type)) return false; } diff --git a/plugins/pychrysalide/analysis/scan/expr.c b/plugins/pychrysalide/analysis/scan/expr.c index 14d536f..d1b5145 100644 --- a/plugins/pychrysalide/analysis/scan/expr.c +++ b/plugins/pychrysalide/analysis/scan/expr.c @@ -291,7 +291,7 @@ bool ensure_python_scan_expression_is_registered(void) if (!ensure_python_comparable_item_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_SCAN_EXPRESSION, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_SCAN_EXPRESSION, type)) return false; if (!define_expression_value_type_constants(type)) diff --git a/plugins/pychrysalide/analysis/scan/func.c b/plugins/pychrysalide/analysis/scan/func.c index 5dd846f..0bff6e8 100644 --- a/plugins/pychrysalide/analysis/scan/func.c +++ b/plugins/pychrysalide/analysis/scan/func.c @@ -158,7 +158,7 @@ bool ensure_python_scan_function_is_registered(void) if (!ensure_python_registered_item_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_SCAN_FUNCTION, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_SCAN_FUNCTION, type)) return false; } diff --git a/plugins/pychrysalide/analysis/scan/item.c b/plugins/pychrysalide/analysis/scan/item.c index 9e9d4d3..aae5b73 100644 --- a/plugins/pychrysalide/analysis/scan/item.c +++ b/plugins/pychrysalide/analysis/scan/item.c @@ -150,7 +150,7 @@ bool ensure_python_registered_item_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_REGISTERED_ITEM, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_REGISTERED_ITEM, type)) return false; } diff --git a/plugins/pychrysalide/analysis/scan/options.c b/plugins/pychrysalide/analysis/scan/options.c index ddced33..30c3f18 100644 --- a/plugins/pychrysalide/analysis/scan/options.c +++ b/plugins/pychrysalide/analysis/scan/options.c @@ -278,7 +278,7 @@ PyTypeObject *get_python_scan_options_type(void) * * * Paramètres : - * * * -* Description : Prend en charge l'objet 'pychrysalide...scan.ScanOptions'. * +* Description : Prend en charge l'objet 'pychrysalide...scan.ScanOptions'. * * * * Retour : Bilan de l'opération. * * * @@ -300,7 +300,7 @@ bool ensure_python_scan_options_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_SCAN_OPTIONS, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_SCAN_OPTIONS, type)) return false; } diff --git a/plugins/pychrysalide/analysis/scan/patterns/backend.c b/plugins/pychrysalide/analysis/scan/patterns/backend.c index 6d668f4..03db143 100644 --- a/plugins/pychrysalide/analysis/scan/patterns/backend.c +++ b/plugins/pychrysalide/analysis/scan/patterns/backend.c @@ -147,7 +147,7 @@ bool ensure_python_engine_backend_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_ENGINE_BACKEND, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_ENGINE_BACKEND, type)) return false; } diff --git a/plugins/pychrysalide/analysis/scan/patterns/backends/acism.c b/plugins/pychrysalide/analysis/scan/patterns/backends/acism.c index 63e653a..fe89507 100644 --- a/plugins/pychrysalide/analysis/scan/patterns/backends/acism.c +++ b/plugins/pychrysalide/analysis/scan/patterns/backends/acism.c @@ -159,7 +159,7 @@ bool ensure_python_acism_backend_is_registered(void) if (!ensure_python_engine_backend_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_ACISM_BACKEND, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_ACISM_BACKEND, type)) return false; } diff --git a/plugins/pychrysalide/analysis/scan/patterns/backends/bitap.c b/plugins/pychrysalide/analysis/scan/patterns/backends/bitap.c index f961bf7..5ceade8 100644 --- a/plugins/pychrysalide/analysis/scan/patterns/backends/bitap.c +++ b/plugins/pychrysalide/analysis/scan/patterns/backends/bitap.c @@ -159,7 +159,7 @@ bool ensure_python_bitap_backend_is_registered(void) if (!ensure_python_engine_backend_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_BITAP_BACKEND, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_BITAP_BACKEND, type)) return false; } diff --git a/plugins/pychrysalide/analysis/scan/scanner.c b/plugins/pychrysalide/analysis/scan/scanner.c index 62e32b1..bf5a5f5 100644 --- a/plugins/pychrysalide/analysis/scan/scanner.c +++ b/plugins/pychrysalide/analysis/scan/scanner.c @@ -259,7 +259,7 @@ bool ensure_python_content_scanner_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_CONTENT_SCANNER, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_CONTENT_SCANNER, type)) return false; } diff --git a/plugins/pychrysalide/analysis/scan/space.c b/plugins/pychrysalide/analysis/scan/space.c index 9f29829..7d85fca 100644 --- a/plugins/pychrysalide/analysis/scan/space.c +++ b/plugins/pychrysalide/analysis/scan/space.c @@ -242,7 +242,7 @@ bool ensure_python_scan_namespace_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_SCAN_NAMESPACE, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_SCAN_NAMESPACE, type)) return false; } diff --git a/plugins/pychrysalide/analysis/storage/cache.c b/plugins/pychrysalide/analysis/storage/cache.c index 9859623..8cd5bac 100644 --- a/plugins/pychrysalide/analysis/storage/cache.c +++ b/plugins/pychrysalide/analysis/storage/cache.c @@ -100,7 +100,7 @@ static PyObject *py_object_cache_new(PyTypeObject *type, PyObject *args, PyObjec if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -304,7 +304,7 @@ bool ensure_python_object_cache_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_OBJECT_CACHE, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_OBJECT_CACHE, type)) return false; } diff --git a/plugins/pychrysalide/analysis/storage/storage.c b/plugins/pychrysalide/analysis/storage/storage.c index 7c03be0..c54fe0f 100644 --- a/plugins/pychrysalide/analysis/storage/storage.c +++ b/plugins/pychrysalide/analysis/storage/storage.c @@ -115,7 +115,7 @@ static PyObject *py_object_storage_new(PyTypeObject *type, PyObject *args, PyObj if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -601,7 +601,7 @@ bool ensure_python_object_storage_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_OBJECT_STORAGE, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_OBJECT_STORAGE, type)) return false; } diff --git a/plugins/pychrysalide/analysis/storage/tpmem.c b/plugins/pychrysalide/analysis/storage/tpmem.c index 491ee68..ae07008 100644 --- a/plugins/pychrysalide/analysis/storage/tpmem.c +++ b/plugins/pychrysalide/analysis/storage/tpmem.c @@ -108,7 +108,7 @@ static PyObject *py_type_memory_new(PyTypeObject *type, PyObject *args, PyObject if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -453,7 +453,7 @@ bool ensure_python_type_memory_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_TYPE_MEMORY, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_TYPE_MEMORY, type)) return false; } diff --git a/plugins/pychrysalide/analysis/type.c b/plugins/pychrysalide/analysis/type.c index 357d381..ea8affd 100644 --- a/plugins/pychrysalide/analysis/type.c +++ b/plugins/pychrysalide/analysis/type.c @@ -158,7 +158,7 @@ static PyObject *py_data_type_new(PyTypeObject *type, PyObject *args, PyObject * if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -1125,7 +1125,7 @@ bool ensure_python_data_type_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_DATA_TYPE, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_DATA_TYPE, type)) return false; if (!define_analysis_data_type_constants(type)) diff --git a/plugins/pychrysalide/analysis/types/array.c b/plugins/pychrysalide/analysis/types/array.c index 8055316..88b773e 100644 --- a/plugins/pychrysalide/analysis/types/array.c +++ b/plugins/pychrysalide/analysis/types/array.c @@ -423,7 +423,7 @@ bool ensure_python_array_type_is_registered(void) if (!ensure_python_data_type_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_ARRAY_TYPE, type, get_python_data_type_type())) + if (!register_class_for_pygobject(dict, G_TYPE_ARRAY_TYPE, type)) return false; } diff --git a/plugins/pychrysalide/analysis/types/basic.c b/plugins/pychrysalide/analysis/types/basic.c index 9ae4f8f..19fb9d1 100644 --- a/plugins/pychrysalide/analysis/types/basic.c +++ b/plugins/pychrysalide/analysis/types/basic.c @@ -210,7 +210,7 @@ bool ensure_python_basic_type_is_registered(void) if (!ensure_python_data_type_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_BASIC_TYPE, type, get_python_data_type_type())) + if (!register_class_for_pygobject(dict, G_TYPE_BASIC_TYPE, type)) return false; if (!define_basic_type_constants(type)) diff --git a/plugins/pychrysalide/analysis/types/cse.c b/plugins/pychrysalide/analysis/types/cse.c index 7701d48..0aab4d9 100644 --- a/plugins/pychrysalide/analysis/types/cse.c +++ b/plugins/pychrysalide/analysis/types/cse.c @@ -262,7 +262,7 @@ bool ensure_python_class_enum_type_is_registered(void) if (!ensure_python_data_type_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_CLASS_ENUM_TYPE, type, get_python_data_type_type())) + if (!register_class_for_pygobject(dict, G_TYPE_CLASS_ENUM_TYPE, type)) return false; if (!define_class_enum_type_constants(type)) diff --git a/plugins/pychrysalide/analysis/types/encaps.c b/plugins/pychrysalide/analysis/types/encaps.c index 3a5acb5..bc9f4db 100644 --- a/plugins/pychrysalide/analysis/types/encaps.c +++ b/plugins/pychrysalide/analysis/types/encaps.c @@ -223,7 +223,7 @@ bool ensure_python_encapsulated_type_is_registered(void) if (!ensure_python_data_type_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_ENCAPSULATED_TYPE, type, get_python_data_type_type())) + if (!register_class_for_pygobject(dict, G_TYPE_ENCAPSULATED_TYPE, type)) return false; if (!define_encapsulated_type_constants(type)) diff --git a/plugins/pychrysalide/analysis/types/expr.c b/plugins/pychrysalide/analysis/types/expr.c index 02cb02f..e3b2b0a 100644 --- a/plugins/pychrysalide/analysis/types/expr.c +++ b/plugins/pychrysalide/analysis/types/expr.c @@ -201,7 +201,7 @@ bool ensure_python_expr_type_is_registered(void) if (!ensure_python_data_type_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_EXPR_TYPE, type, get_python_data_type_type())) + if (!register_class_for_pygobject(dict, G_TYPE_EXPR_TYPE, type)) return false; } diff --git a/plugins/pychrysalide/analysis/types/literal.c b/plugins/pychrysalide/analysis/types/literal.c index e00104f..3d9d5e3 100644 --- a/plugins/pychrysalide/analysis/types/literal.c +++ b/plugins/pychrysalide/analysis/types/literal.c @@ -136,7 +136,7 @@ bool ensure_python_literal_type_is_registered(void) if (!ensure_python_data_type_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_LITERAL_TYPE, type, get_python_data_type_type())) + if (!register_class_for_pygobject(dict, G_TYPE_LITERAL_TYPE, type)) return false; } diff --git a/plugins/pychrysalide/analysis/types/override.c b/plugins/pychrysalide/analysis/types/override.c index 896163f..236a34c 100644 --- a/plugins/pychrysalide/analysis/types/override.c +++ b/plugins/pychrysalide/analysis/types/override.c @@ -247,7 +247,7 @@ bool ensure_python_override_type_is_registered(void) if (!ensure_python_data_type_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_OVERRIDE_TYPE, type, get_python_data_type_type())) + if (!register_class_for_pygobject(dict, G_TYPE_OVERRIDE_TYPE, type)) return false; } diff --git a/plugins/pychrysalide/analysis/types/proto.c b/plugins/pychrysalide/analysis/types/proto.c index 7c3ebed..1da3119 100644 --- a/plugins/pychrysalide/analysis/types/proto.c +++ b/plugins/pychrysalide/analysis/types/proto.c @@ -349,7 +349,7 @@ bool ensure_python_proto_type_is_registered(void) if (!ensure_python_data_type_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_PROTO_TYPE, type, get_python_data_type_type())) + if (!register_class_for_pygobject(dict, G_TYPE_PROTO_TYPE, type)) return false; } diff --git a/plugins/pychrysalide/analysis/types/template.c b/plugins/pychrysalide/analysis/types/template.c index 6fc50e4..68f390a 100644 --- a/plugins/pychrysalide/analysis/types/template.c +++ b/plugins/pychrysalide/analysis/types/template.c @@ -345,7 +345,7 @@ bool ensure_python_template_type_is_registered(void) if (!ensure_python_data_type_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_TEMPLATE_TYPE, type, get_python_data_type_type())) + if (!register_class_for_pygobject(dict, G_TYPE_TEMPLATE_TYPE, type)) return false; } diff --git a/plugins/pychrysalide/analysis/variable.c b/plugins/pychrysalide/analysis/variable.c index 3aeddf4..5f8d490 100644 --- a/plugins/pychrysalide/analysis/variable.c +++ b/plugins/pychrysalide/analysis/variable.c @@ -266,7 +266,7 @@ bool ensure_python_binary_variable_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_BIN_VARIABLE, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_BIN_VARIABLE, type)) return false; } diff --git a/plugins/pychrysalide/arch/context.c b/plugins/pychrysalide/arch/context.c index b1803a4..79c782f 100644 --- a/plugins/pychrysalide/arch/context.c +++ b/plugins/pychrysalide/arch/context.c @@ -121,7 +121,7 @@ static PyObject *py_proc_context_new(PyTypeObject *type, PyObject *args, PyObjec if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -522,7 +522,7 @@ bool ensure_python_proc_context_is_registered(void) if (!ensure_python_preload_info_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_PROC_CONTEXT, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_PROC_CONTEXT, type)) return false; if (!define_proc_context_constants(type)) diff --git a/plugins/pychrysalide/arch/instruction.c b/plugins/pychrysalide/arch/instruction.c index 5acb3bd..f77afca 100644 --- a/plugins/pychrysalide/arch/instruction.c +++ b/plugins/pychrysalide/arch/instruction.c @@ -896,8 +896,7 @@ bool ensure_python_arch_instruction_is_registered(void) if (!ensure_python_line_generator_is_registered()) return false; - if (!_register_class_for_pygobject(dict, G_TYPE_ARCH_INSTRUCTION, type, - &PyGObject_Type, get_python_line_generator_type(), NULL)) + if (!_register_class_for_pygobject(dict, G_TYPE_ARCH_INSTRUCTION, type)) return false; if (!define_arch_instruction_constants(type)) diff --git a/plugins/pychrysalide/arch/instructions/raw.c b/plugins/pychrysalide/arch/instructions/raw.c index c1366c6..7e58b96 100644 --- a/plugins/pychrysalide/arch/instructions/raw.c +++ b/plugins/pychrysalide/arch/instructions/raw.c @@ -99,7 +99,7 @@ static PyObject *py_raw_instruction_new(PyTypeObject *type, PyObject *args, PyOb if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -458,7 +458,7 @@ bool ensure_python_raw_instruction_is_registered(void) if (!ensure_python_arch_instruction_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_RAW_INSTRUCTION, type, get_python_arch_instruction_type())) + if (!register_class_for_pygobject(dict, G_TYPE_RAW_INSTRUCTION, type)) return false; if (!define_raw_instruction_constants(type)) diff --git a/plugins/pychrysalide/arch/instructions/undefined.c b/plugins/pychrysalide/arch/instructions/undefined.c index 99fd2ff..1246daa 100644 --- a/plugins/pychrysalide/arch/instructions/undefined.c +++ b/plugins/pychrysalide/arch/instructions/undefined.c @@ -88,7 +88,7 @@ static PyObject *py_undef_instruction_new(PyTypeObject *type, PyObject *args, Py if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -285,7 +285,7 @@ bool ensure_python_undefined_instruction_is_registered(void) if (!ensure_python_arch_instruction_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_UNDEF_INSTRUCTION, type, get_python_arch_instruction_type())) + if (!register_class_for_pygobject(dict, G_TYPE_UNDEF_INSTRUCTION, type)) return false; if (!define_undefined_instruction_constants(type)) diff --git a/plugins/pychrysalide/arch/operand.c b/plugins/pychrysalide/arch/operand.c index edddbe6..abd1f06 100644 --- a/plugins/pychrysalide/arch/operand.c +++ b/plugins/pychrysalide/arch/operand.c @@ -149,7 +149,7 @@ static PyObject *py_arch_operand_new(PyTypeObject *type, PyObject *args, PyObjec if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -787,7 +787,7 @@ bool ensure_python_arch_operand_is_registered(void) if (!ensure_python_singleton_candidate_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_ARCH_OPERAND, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_ARCH_OPERAND, type)) return false; } diff --git a/plugins/pychrysalide/arch/operands/immediate.c b/plugins/pychrysalide/arch/operands/immediate.c index 62f6328..2239eb2 100644 --- a/plugins/pychrysalide/arch/operands/immediate.c +++ b/plugins/pychrysalide/arch/operands/immediate.c @@ -603,7 +603,7 @@ bool ensure_python_imm_operand_is_registered(void) if (!ensure_python_renameable_operand_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_IMM_OPERAND, type, get_python_arch_operand_type())) + if (!register_class_for_pygobject(dict, G_TYPE_IMM_OPERAND, type)) return false; if (!define_imm_operand_constants(type)) diff --git a/plugins/pychrysalide/arch/operands/known.c b/plugins/pychrysalide/arch/operands/known.c index 435ea0f..fab426e 100644 --- a/plugins/pychrysalide/arch/operands/known.c +++ b/plugins/pychrysalide/arch/operands/known.c @@ -169,7 +169,7 @@ bool ensure_python_known_imm_operand_is_registered(void) if (!ensure_python_renamed_operand_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_KNOWN_IMM_OPERAND, type, get_python_imm_operand_type())) + if (!register_class_for_pygobject(dict, G_TYPE_KNOWN_IMM_OPERAND, type)) return false; } diff --git a/plugins/pychrysalide/arch/operands/proxy.c b/plugins/pychrysalide/arch/operands/proxy.c index 1cfd4a4..5009d29 100644 --- a/plugins/pychrysalide/arch/operands/proxy.c +++ b/plugins/pychrysalide/arch/operands/proxy.c @@ -105,7 +105,7 @@ static PyObject *py_proxy_operand_new(PyTypeObject *type, PyObject *args, PyObje if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -319,7 +319,10 @@ bool ensure_python_proxy_operand_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_PROXY_OPERAND, type, get_python_arch_operand_type())) + if (!ensure_python_arch_operand_is_registered()) + return false; + + if (!register_class_for_pygobject(dict, G_TYPE_PROXY_OPERAND, type)) return false; } diff --git a/plugins/pychrysalide/arch/operands/register.c b/plugins/pychrysalide/arch/operands/register.c index d032e04..2a48a0f 100644 --- a/plugins/pychrysalide/arch/operands/register.c +++ b/plugins/pychrysalide/arch/operands/register.c @@ -112,7 +112,7 @@ static PyObject *py_register_operand_new(PyTypeObject *type, PyObject *args, PyO if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -427,7 +427,10 @@ bool ensure_python_register_operand_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_REGISTER_OPERAND, type, get_python_arch_operand_type())) + if (!ensure_python_arch_operand_is_registered()) + return false; + + if (!register_class_for_pygobject(dict, G_TYPE_REGISTER_OPERAND, type)) return false; } diff --git a/plugins/pychrysalide/arch/operands/target.c b/plugins/pychrysalide/arch/operands/target.c index 76c8269..b8cd536 100644 --- a/plugins/pychrysalide/arch/operands/target.c +++ b/plugins/pychrysalide/arch/operands/target.c @@ -115,7 +115,7 @@ static PyObject *py_target_operand_new(PyTypeObject *type, PyObject *args, PyObj if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -429,10 +429,13 @@ bool ensure_python_target_operand_is_registered(void) dict = PyModule_GetDict(module); + if (!ensure_python_arch_operand_is_registered()) + return false; + if (!ensure_python_targetable_operand_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_TARGET_OPERAND, type, get_python_arch_operand_type())) + if (!register_class_for_pygobject(dict, G_TYPE_TARGET_OPERAND, type)) return false; } diff --git a/plugins/pychrysalide/arch/processor.c b/plugins/pychrysalide/arch/processor.c index 80b55d3..00b472f 100644 --- a/plugins/pychrysalide/arch/processor.c +++ b/plugins/pychrysalide/arch/processor.c @@ -186,7 +186,7 @@ static PyObject *py_arch_processor_new(PyTypeObject *type, PyObject *args, PyObj if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -1452,7 +1452,7 @@ bool ensure_python_arch_processor_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_ARCH_PROCESSOR, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_ARCH_PROCESSOR, type)) return false; if (!define_arch_processor_constants(type)) diff --git a/plugins/pychrysalide/arch/register.c b/plugins/pychrysalide/arch/register.c index 5d9e90b..615a5b7 100644 --- a/plugins/pychrysalide/arch/register.c +++ b/plugins/pychrysalide/arch/register.c @@ -144,7 +144,7 @@ static PyObject *py_arch_register_new(PyTypeObject *type, PyObject *args, PyObje if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -686,7 +686,7 @@ bool ensure_python_arch_register_is_registered(void) if (!ensure_python_serializable_object_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_ARCH_REGISTER, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_ARCH_REGISTER, type)) return false; } diff --git a/plugins/pychrysalide/core.c b/plugins/pychrysalide/core.c index c3a6cf2..acd8ad6 100644 --- a/plugins/pychrysalide/core.c +++ b/plugins/pychrysalide/core.c @@ -1037,7 +1037,6 @@ G_MODULE_EXPORT void chrysalide_plugin_on_plugins_loaded(GPluginModule *plugin, { PyGILState_STATE gstate; /* Sauvegarde d'environnement */ size_t count; /* Quantité de greffons chargés*/ - PyTypeObject *parent; /* Type Python pour greffon */ PyObject *module; /* Module à recompléter */ PyObject *dict; /* Dictionnaire du module */ GPluginModule **list; /* Ensemble de ces greffons */ @@ -1055,8 +1054,6 @@ G_MODULE_EXPORT void chrysalide_plugin_on_plugins_loaded(GPluginModule *plugin, if (ensure_python_plugin_module_is_registered()) { - parent = get_python_plugin_module_type(); - module = get_access_to_python_module("pychrysalide.plugins"); assert(module != NULL); @@ -1089,7 +1086,7 @@ G_MODULE_EXPORT void chrysalide_plugin_on_plugins_loaded(GPluginModule *plugin, type->tp_flags = Py_TPFLAGS_DEFAULT; type->tp_new = no_python_constructor_allowed; - if (register_class_for_pygobject(dict, G_OBJECT_TYPE(list[i]), type, parent)) + if (register_class_for_pygobject(dict, G_OBJECT_TYPE(list[i]), type)) g_object_set_data_full(G_OBJECT(list[i]), "python_type", type, (GDestroyNotify)free_native_plugin_type); diff --git a/plugins/pychrysalide/debug/debugger.c b/plugins/pychrysalide/debug/debugger.c index e65e295..b21087d 100644 --- a/plugins/pychrysalide/debug/debugger.c +++ b/plugins/pychrysalide/debug/debugger.c @@ -1195,7 +1195,7 @@ bool ensure_python_binary_debugger_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_BINARY_DEBUGGER, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_BINARY_DEBUGGER, type)) return false; } diff --git a/plugins/pychrysalide/format/executable.c b/plugins/pychrysalide/format/executable.c index ac0125d..ff2d14a 100644 --- a/plugins/pychrysalide/format/executable.c +++ b/plugins/pychrysalide/format/executable.c @@ -268,7 +268,7 @@ bool ensure_python_executable_format_is_registered(void) if (!ensure_python_binary_format_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_EXE_FORMAT, type, get_python_binary_format_type())) + if (!register_class_for_pygobject(dict, G_TYPE_EXE_FORMAT, type)) return false; } diff --git a/plugins/pychrysalide/format/flat.c b/plugins/pychrysalide/format/flat.c index 2c8e9fd..4df3646 100644 --- a/plugins/pychrysalide/format/flat.c +++ b/plugins/pychrysalide/format/flat.c @@ -173,7 +173,7 @@ bool ensure_python_flat_format_is_registered(void) if (!ensure_python_executable_format_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_FLAT_FORMAT, type, get_python_executable_format_type())) + if (!register_class_for_pygobject(dict, G_TYPE_FLAT_FORMAT, type)) return false; } diff --git a/plugins/pychrysalide/format/format.c b/plugins/pychrysalide/format/format.c index 66d346c..82c6c33 100644 --- a/plugins/pychrysalide/format/format.c +++ b/plugins/pychrysalide/format/format.c @@ -166,7 +166,7 @@ static PyObject *py_binary_format_new(PyTypeObject *type, PyObject *args, PyObje if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -1150,7 +1150,7 @@ bool ensure_python_binary_format_is_registered(void) if (!ensure_python_known_format_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_BIN_FORMAT, type, get_python_known_format_type())) + if (!register_class_for_pygobject(dict, G_TYPE_BIN_FORMAT, type)) return false; if (!define_binary_format_constants(type)) diff --git a/plugins/pychrysalide/format/known.c b/plugins/pychrysalide/format/known.c index a2fc18c..3167ba2 100644 --- a/plugins/pychrysalide/format/known.c +++ b/plugins/pychrysalide/format/known.c @@ -132,7 +132,7 @@ static PyObject *py_known_format_new(PyTypeObject *type, PyObject *args, PyObjec if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -789,7 +789,7 @@ bool ensure_python_known_format_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_KNOWN_FORMAT, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_KNOWN_FORMAT, type)) return false; } diff --git a/plugins/pychrysalide/format/preload.c b/plugins/pychrysalide/format/preload.c index 65e2ed0..e4f2a9c 100644 --- a/plugins/pychrysalide/format/preload.c +++ b/plugins/pychrysalide/format/preload.c @@ -152,7 +152,7 @@ bool ensure_python_preload_info_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_PRELOAD_INFO, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_PRELOAD_INFO, type)) return false; } diff --git a/plugins/pychrysalide/format/strsym.c b/plugins/pychrysalide/format/strsym.c index c85d61f..adc0e48 100644 --- a/plugins/pychrysalide/format/strsym.c +++ b/plugins/pychrysalide/format/strsym.c @@ -119,7 +119,7 @@ static PyObject *py_string_symbol_new(PyTypeObject *type, PyObject *args, PyObje if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -501,7 +501,7 @@ bool ensure_python_string_symbol_is_registered(void) if (!ensure_python_binary_symbol_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_STR_SYMBOL, type, get_python_binary_symbol_type())) + if (!register_class_for_pygobject(dict, G_TYPE_STR_SYMBOL, type)) return false; if (!define_string_symbol_constants(type)) diff --git a/plugins/pychrysalide/format/symbol.c b/plugins/pychrysalide/format/symbol.c index 1559b9a..d3a9c1e 100644 --- a/plugins/pychrysalide/format/symbol.c +++ b/plugins/pychrysalide/format/symbol.c @@ -157,7 +157,7 @@ static PyObject *py_binary_symbol_new(PyTypeObject *type, PyObject *args, PyObje if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -982,7 +982,7 @@ bool ensure_python_binary_symbol_is_registered(void) if (!ensure_python_serializable_object_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_BIN_SYMBOL, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_BIN_SYMBOL, type)) return false; if (!define_binary_symbol_constants(type)) diff --git a/plugins/pychrysalide/glibext/binarycursor.c b/plugins/pychrysalide/glibext/binarycursor.c index 4da040a..91dce3e 100644 --- a/plugins/pychrysalide/glibext/binarycursor.c +++ b/plugins/pychrysalide/glibext/binarycursor.c @@ -321,7 +321,7 @@ bool ensure_python_binary_cursor_is_registered(void) if (!ensure_python_line_cursor_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_BINARY_CURSOR, type, get_python_line_cursor_type())) + if (!register_class_for_pygobject(dict, G_TYPE_BINARY_CURSOR, type)) return false; } diff --git a/plugins/pychrysalide/glibext/binportion.c b/plugins/pychrysalide/glibext/binportion.c index 060f001..70eb314 100644 --- a/plugins/pychrysalide/glibext/binportion.c +++ b/plugins/pychrysalide/glibext/binportion.c @@ -112,7 +112,7 @@ static PyObject *py_bin_portion_new(PyTypeObject *type, PyObject *args, PyObject if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -674,7 +674,7 @@ bool ensure_python_binary_portion_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_BIN_PORTION, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_BIN_PORTION, type)) return false; if (!define_binary_portion_constants(type)) diff --git a/plugins/pychrysalide/glibext/buffercache.c b/plugins/pychrysalide/glibext/buffercache.c index 6ed516a..6afaffc 100644 --- a/plugins/pychrysalide/glibext/buffercache.c +++ b/plugins/pychrysalide/glibext/buffercache.c @@ -157,7 +157,7 @@ static PyObject *py_buffer_cache_new(PyTypeObject *type, PyObject *args, PyObjec if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -1233,7 +1233,7 @@ bool ensure_python_buffer_cache_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_BUFFER_CACHE, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_BUFFER_CACHE, type)) return false; } diff --git a/plugins/pychrysalide/glibext/bufferline.c b/plugins/pychrysalide/glibext/bufferline.c index c88fe7f..09404bc 100644 --- a/plugins/pychrysalide/glibext/bufferline.c +++ b/plugins/pychrysalide/glibext/bufferline.c @@ -106,7 +106,7 @@ static PyObject *py_buffer_line_new(PyTypeObject *type, PyObject *args, PyObject if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -339,7 +339,7 @@ bool ensure_python_buffer_line_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_BUFFER_LINE, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_BUFFER_LINE, type)) return false; if (!define_line_segment_constants(type)) diff --git a/plugins/pychrysalide/glibext/bufferview.c b/plugins/pychrysalide/glibext/bufferview.c index 98cc10a..d4cbdc2 100644 --- a/plugins/pychrysalide/glibext/bufferview.c +++ b/plugins/pychrysalide/glibext/bufferview.c @@ -146,7 +146,7 @@ bool ensure_python_buffer_view_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_BUFFER_VIEW, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_BUFFER_VIEW, type)) return false; } diff --git a/plugins/pychrysalide/glibext/configuration.c b/plugins/pychrysalide/glibext/configuration.c index b0586af..c630331 100644 --- a/plugins/pychrysalide/glibext/configuration.c +++ b/plugins/pychrysalide/glibext/configuration.c @@ -174,7 +174,7 @@ static PyObject *py_config_param_new(PyTypeObject *type, PyObject *args, PyObjec if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -733,7 +733,7 @@ bool ensure_python_config_param_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_CFG_PARAM, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_CFG_PARAM, type)) return false; if (!define_config_param_constants(type)) @@ -1036,7 +1036,7 @@ static PyObject *py_generic_config_new(PyTypeObject *type, PyObject *args, PyObj if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -1580,7 +1580,7 @@ bool ensure_python_generic_config_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_GEN_CONFIG, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_GEN_CONFIG, type)) return false; } diff --git a/plugins/pychrysalide/glibext/linecursor.c b/plugins/pychrysalide/glibext/linecursor.c index 217234a..4ac7f85 100644 --- a/plugins/pychrysalide/glibext/linecursor.c +++ b/plugins/pychrysalide/glibext/linecursor.c @@ -184,7 +184,7 @@ bool ensure_python_line_cursor_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_LINE_CURSOR, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_LINE_CURSOR, type)) return false; } diff --git a/plugins/pychrysalide/glibext/singleton.c b/plugins/pychrysalide/glibext/singleton.c index d00648c..8491473 100644 --- a/plugins/pychrysalide/glibext/singleton.c +++ b/plugins/pychrysalide/glibext/singleton.c @@ -922,7 +922,7 @@ static PyObject *py_singleton_factory_new(PyTypeObject *type, PyObject *args, Py if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -1110,7 +1110,7 @@ bool ensure_python_singleton_factory_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_SINGLETON_FACTORY, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_SINGLETON_FACTORY, type)) return false; } diff --git a/plugins/pychrysalide/gtkext/blockdisplay.c b/plugins/pychrysalide/gtkext/blockdisplay.c index 6741553..b4b8515 100644 --- a/plugins/pychrysalide/gtkext/blockdisplay.c +++ b/plugins/pychrysalide/gtkext/blockdisplay.c @@ -115,7 +115,7 @@ bool ensure_python_block_display_is_registered(void) if (!ensure_python_buffer_display_is_registered()) return false; - if (!register_class_for_pygobject(dict, GTK_TYPE_BLOCK_DISPLAY, type, get_python_buffer_display_type())) + if (!register_class_for_pygobject(dict, GTK_TYPE_BLOCK_DISPLAY, type)) return false; } diff --git a/plugins/pychrysalide/gtkext/bufferdisplay.c b/plugins/pychrysalide/gtkext/bufferdisplay.c index 310e60a..4babcc8 100644 --- a/plugins/pychrysalide/gtkext/bufferdisplay.c +++ b/plugins/pychrysalide/gtkext/bufferdisplay.c @@ -115,7 +115,7 @@ bool ensure_python_buffer_display_is_registered(void) if (!ensure_python_display_panel_is_registered()) return false; - if (!register_class_for_pygobject(dict, GTK_TYPE_BUFFER_DISPLAY, type, get_python_display_panel_type())) + if (!register_class_for_pygobject(dict, GTK_TYPE_BUFFER_DISPLAY, type)) return false; } diff --git a/plugins/pychrysalide/gtkext/displaypanel.c b/plugins/pychrysalide/gtkext/displaypanel.c index dc7b8e5..b2eb038 100644 --- a/plugins/pychrysalide/gtkext/displaypanel.c +++ b/plugins/pychrysalide/gtkext/displaypanel.c @@ -100,8 +100,6 @@ bool ensure_python_display_panel_is_registered(void) { bool result; /* Bilan à retourner */ PyTypeObject *type; /* Type Python 'DisplayPanel' */ - PyObject *parent_mod; /* Module Python Fixed */ - PyObject *fixed; /* Module "GtkFixed" */ PyObject *module; /* Module à recompléter */ PyObject *dict; /* Dictionnaire du module */ @@ -113,27 +111,13 @@ bool ensure_python_display_panel_is_registered(void) { module = get_access_to_python_module("pychrysalide.gtkext"); - parent_mod = PyImport_ImportModule("gi.repository.Gtk"); - - if (parent_mod == NULL) - goto rpdp_exit; - - fixed = PyObject_GetAttrString(parent_mod, "Fixed"); - - Py_DECREF(parent_mod); - dict = PyModule_GetDict(module); - result = register_class_for_pygobject(dict, GTK_TYPE_DISPLAY_PANEL, type, (PyTypeObject *)fixed); - Py_DECREF(fixed); + if (!register_class_for_pygobject(dict, GTK_TYPE_DISPLAY_PANEL, type)) + return false; } - else - result = true; - - rpdp_exit: - return result; } diff --git a/plugins/pychrysalide/gtkext/graph/cluster.c b/plugins/pychrysalide/gtkext/graph/cluster.c index fc73276..11cb8fa 100644 --- a/plugins/pychrysalide/gtkext/graph/cluster.c +++ b/plugins/pychrysalide/gtkext/graph/cluster.c @@ -656,7 +656,7 @@ bool ensure_python_graph_cluster_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_GRAPH_CLUSTER, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_GRAPH_CLUSTER, type)) return false; } diff --git a/plugins/pychrysalide/gtkext/graph/edge.c b/plugins/pychrysalide/gtkext/graph/edge.c index ce20ce9..d016e30 100644 --- a/plugins/pychrysalide/gtkext/graph/edge.c +++ b/plugins/pychrysalide/gtkext/graph/edge.c @@ -267,7 +267,7 @@ bool ensure_python_graph_edge_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_GRAPH_EDGE, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_GRAPH_EDGE, type)) return false; if (!define_graph_edge_constants(type)) diff --git a/plugins/pychrysalide/gtkext/named.c b/plugins/pychrysalide/gtkext/named.c index 1d336f1..ee963de 100644 --- a/plugins/pychrysalide/gtkext/named.c +++ b/plugins/pychrysalide/gtkext/named.c @@ -99,7 +99,7 @@ static PyObject *py_built_named_widget_new(PyTypeObject *type, PyObject *args, P if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -312,7 +312,7 @@ bool ensure_python_built_named_widget_is_registered(void) if (!ensure_python_named_widget_is_registered()) return false; - if (!register_class_for_pygobject(dict, GTK_TYPE_BUILT_NAMED_WIDGET, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, GTK_TYPE_BUILT_NAMED_WIDGET, type)) return false; } diff --git a/plugins/pychrysalide/gui/item.c b/plugins/pychrysalide/gui/item.c index eb140fb..0c604b5 100644 --- a/plugins/pychrysalide/gui/item.c +++ b/plugins/pychrysalide/gui/item.c @@ -691,7 +691,7 @@ bool ensure_python_editor_item_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_EDITOR_ITEM, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_EDITOR_ITEM, type)) return false; } diff --git a/plugins/pychrysalide/gui/menubar.c b/plugins/pychrysalide/gui/menubar.c index 5c6270e..29b76ac 100644 --- a/plugins/pychrysalide/gui/menubar.c +++ b/plugins/pychrysalide/gui/menubar.c @@ -160,7 +160,10 @@ bool ensure_python_menu_bar_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_MENU_BAR, type, get_python_editor_item_type())) + if (!ensure_python_editor_item_is_registered()) + return false; + + if (!register_class_for_pygobject(dict, G_TYPE_MENU_BAR, type)) return false; } diff --git a/plugins/pychrysalide/gui/panel.c b/plugins/pychrysalide/gui/panel.c index 2afb2a1..d0cbdf7 100644 --- a/plugins/pychrysalide/gui/panel.c +++ b/plugins/pychrysalide/gui/panel.c @@ -164,7 +164,7 @@ static PyObject *py_panel_item_new(PyTypeObject *type, PyObject *args, PyObject if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -1188,8 +1188,7 @@ bool ensure_python_panel_item_is_registered(void) if (!ensure_python_dockable_is_registered()) return false; - if (!_register_class_for_pygobject(dict, G_TYPE_PANEL_ITEM, type, - get_python_editor_item_type(), get_python_dockable_type(), NULL)) + if (!_register_class_for_pygobject(dict, G_TYPE_PANEL_ITEM, type)) return false; if (!define_panel_item_constants(type)) diff --git a/plugins/pychrysalide/helpers.c b/plugins/pychrysalide/helpers.c index b038340..cee7296 100644 --- a/plugins/pychrysalide/helpers.c +++ b/plugins/pychrysalide/helpers.c @@ -510,9 +510,10 @@ bool register_python_module_object(PyObject *module, PyTypeObject *type) /****************************************************************************** * * -* Paramètres : type = type du nouvel objet à mettre en place. * -* args = éventuelle liste d'arguments. * -* kwds = éventuel dictionnaire de valeurs mises à disposition. * +* Paramètres : type = type du nouvel objet à mettre en place. * +* gbase = type de base natif. * +* args = éventuelle liste d'arguments. * +* kwds = éventuel dictionnaire de valeurs mises à disposition.* * * * Description : Accompagne la création d'une instance dérivée en Python. * * * @@ -522,15 +523,18 @@ bool register_python_module_object(PyObject *module, PyTypeObject *type) * * ******************************************************************************/ -PyObject *python_constructor_with_dynamic_gtype(PyTypeObject *type, PyObject *args, PyObject *kwds, PyTypeObject *base, GType base_gtype) +PyObject *python_constructor_with_dynamic_gtype(PyTypeObject *type, GType gbase, PyObject *args, PyObject *kwds) { PyObject *result; /* Objet à retourner */ + PyTypeObject *base; /* Type parent version Python */ bool first_time; /* Evite les multiples passages*/ GType gtype; /* Nouveau type de processeur */ bool status; /* Bilan d'un enregistrement */ /* Validations diverses */ + base = pygobject_lookup_class(gbase); + if (type == base) goto simple_way; @@ -538,11 +542,11 @@ PyObject *python_constructor_with_dynamic_gtype(PyTypeObject *type, PyObject *ar first_time = (g_type_from_name(type->tp_name) == 0); - gtype = build_dynamic_type(base_gtype, type->tp_name, NULL, NULL, NULL); + gtype = build_dynamic_type(gbase, type->tp_name, NULL, NULL, NULL); if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -568,11 +572,10 @@ PyObject *python_constructor_with_dynamic_gtype(PyTypeObject *type, PyObject *ar /****************************************************************************** * * * Paramètres : type = type du nouvel objet à mettre en place. * -* args = éventuelle liste d'arguments. * -* kwds = éventuel dictionnaire de valeurs mises à disposition.* -* base = type de base en Python. * * gbase = type de base natif. * * cinit = procédure d'initialisation de la classe associée. * +* args = éventuelle liste d'arguments. * +* kwds = éventuel dictionnaire de valeurs mises à disposition.* * * * Description : Accompagne la création d'une instance dérivée en Python. * * * @@ -582,15 +585,18 @@ PyObject *python_constructor_with_dynamic_gtype(PyTypeObject *type, PyObject *ar * * ******************************************************************************/ -PyObject *python_abstract_constructor_with_dynamic_gtype(PyTypeObject *type, PyObject *args, PyObject *kwds, PyTypeObject *base, GType gbase, GClassInitFunc cinit) +PyObject *python_abstract_constructor_with_dynamic_gtype(PyTypeObject *type, GType gbase, GClassInitFunc cinit, PyObject *args, PyObject *kwds) { PyObject *result; /* Objet à retourner */ + PyTypeObject *base; /* Type parent version Python */ bool first_time; /* Evite les multiples passages*/ GType gtype; /* Nouveau type de processeur */ bool status; /* Bilan d'un enregistrement */ /* Validations diverses */ + base = pygobject_lookup_class(gbase); + if (type == base) { result = NULL; @@ -606,7 +612,7 @@ PyObject *python_abstract_constructor_with_dynamic_gtype(PyTypeObject *type, PyO if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -885,7 +891,6 @@ static void define_auto_documentation(PyTypeObject *type) * 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. * -* base = type de base de l'objet. * * * * Description : Enregistre correctement une surcouche de conversion GObject. * * * @@ -895,13 +900,11 @@ static void define_auto_documentation(PyTypeObject *type) * * ******************************************************************************/ -bool _register_class_for_pygobject(PyObject *dict, GType gtype, PyTypeObject *type, PyTypeObject *base, ...) +bool register_class_for_pygobject(PyObject *dict, GType gtype, PyTypeObject *type) { bool result; /* Bilan à retourner */ - Py_ssize_t size; /* Taille de liste actuelle */ - PyObject *static_bases; /* Base(s) de l'objet */ - va_list ap; /* Parcours des arguments */ - PyTypeObject *static_base; /* Base à rajouter à la liste */ + GType parent_type; /* Type parent version GObject */ + PyTypeObject *base; /* Type parent version Python */ assert(gtype != G_TYPE_INVALID); @@ -926,45 +929,17 @@ bool _register_class_for_pygobject(PyObject *dict, GType gtype, PyTypeObject *ty * Et quelqu'un doit se coller à la tâche. PyGObject ne fait rien, donc... */ + parent_type = g_type_parent(gtype); + + base = pygobject_lookup_class(parent_type); + if (type->tp_basicsize < base->tp_basicsize) { assert(type->tp_basicsize == 0); type->tp_basicsize = base->tp_basicsize; } - size = 1; - static_bases = PyTuple_New(size); - - Py_INCREF(base); - PyTuple_SetItem(static_bases, 0, (PyObject *)base); - - va_start(ap, base); - - while (1) - { - static_base = va_arg(ap, PyTypeObject *); - - if (static_base == NULL) break; - - _PyTuple_Resize(&static_bases, ++size); - - Py_INCREF(static_base); - PyTuple_SetItem(static_bases, size - 1, (PyObject *)static_base); - - } - - va_end(ap); - - /** - * les renseignements suivants ne semblent pas nécessaires... - */ - - /* - type->tp_weaklistoffset = offsetof(PyGObject, weakreflist); - type->tp_dictoffset = offsetof(PyGObject, inst_dict); - */ - - pygobject_register_class(dict, NULL, gtype, type, static_bases); + pygobject_register_class(dict, NULL, gtype, type, NULL); if (PyErr_Occurred() == NULL) result = true; @@ -1041,10 +1016,8 @@ bool register_interface_for_pygobject(PyObject *dict, GType gtype, PyTypeObject /****************************************************************************** * * -* Paramètres : dict = dictionnaire où conserver une référence au type créé.* -* gtype = type dans sa version GLib. * +* Paramètres : gtype = type dans sa version GLib. * * type = type dans sa version Python. * -* base = type de base de l'objet. * * * * Description : Enregistre un type Python dérivant d'un type GLib dynamique. * * * @@ -1054,7 +1027,7 @@ bool register_interface_for_pygobject(PyObject *dict, GType gtype, PyTypeObject * * ******************************************************************************/ -bool register_class_for_dynamic_pygobject(GType gtype, PyTypeObject *type, PyTypeObject *base) +bool register_class_for_dynamic_pygobject(GType gtype, PyTypeObject *type) { bool result; /* Bilan à retourner */ PyTypeObject *legacy_parent; /* Type parent d'origine */ @@ -1109,7 +1082,7 @@ bool register_class_for_dynamic_pygobject(GType gtype, PyTypeObject *type, PyTyp dict = PyModule_GetDict(module); - result = _register_class_for_pygobject(dict, gtype, type, &PyGObject_Type, base, NULL); + result = register_class_for_pygobject(dict, gtype, type); Py_SET_TYPE(type, legacy_parent); diff --git a/plugins/pychrysalide/helpers.h b/plugins/pychrysalide/helpers.h index c9cc098..962de74 100644 --- a/plugins/pychrysalide/helpers.h +++ b/plugins/pychrysalide/helpers.h @@ -156,10 +156,10 @@ bool register_python_module_object(PyObject *, PyTypeObject *); /* Accompagne la création d'une instance dérivée en Python. */ -PyObject *python_constructor_with_dynamic_gtype(PyTypeObject *, PyObject *, PyObject *, PyTypeObject *, GType); +PyObject *python_constructor_with_dynamic_gtype(PyTypeObject *, GType, PyObject *, PyObject *); /* Accompagne la création d'une instance dérivée en Python. */ -PyObject *python_abstract_constructor_with_dynamic_gtype(PyTypeObject *, PyObject *, PyObject *, PyTypeObject *, GType, GClassInitFunc); +PyObject *python_abstract_constructor_with_dynamic_gtype(PyTypeObject *, GType, GClassInitFunc, PyObject *, PyObject *); #define CREATE_DYN_CONSTRUCTOR(pyname, gbase) \ @@ -167,9 +167,7 @@ static PyObject *py_ ## pyname ## _new(PyTypeObject *, PyObject *, PyObject *); static PyObject *py_ ## pyname ## _new(PyTypeObject *type, PyObject *args, PyObject *kwds) \ { \ PyObject *result; /* Objet à retourner */ \ - PyTypeObject *base; /* Type de base à dériver */ \ - base = get_python_ ## pyname ## _type(); \ - result = python_constructor_with_dynamic_gtype(type, args, kwds, base, gbase); \ + result = python_constructor_with_dynamic_gtype(type, gbase, args, kwds); \ return result; \ } @@ -179,10 +177,8 @@ static PyObject *py_ ## pyname ## _new(PyTypeObject *, PyObject *, PyObject *); static PyObject *py_ ## pyname ## _new(PyTypeObject *type, PyObject *args, PyObject *kwds) \ { \ PyObject *result; /* Objet à retourner */ \ - PyTypeObject *base; /* Type de base à dériver */ \ - base = get_python_ ## pyname ## _type(); \ - result = python_abstract_constructor_with_dynamic_gtype(type, args, kwds, \ - base, gbase, (GClassInitFunc)cinit); \ + result = python_abstract_constructor_with_dynamic_gtype(type, gbase, (GClassInitFunc)cinit, \ + args, kwds); \ return result; \ } @@ -229,16 +225,13 @@ PyTypeObject *define_python_dynamic_type(const PyTypeObject *); /* Enregistre correctement une surcouche de conversion GObject. */ -bool _register_class_for_pygobject(PyObject *, GType, PyTypeObject *, PyTypeObject *, ...); - -#define register_class_for_pygobject(dict, gtype, type, base) \ - _register_class_for_pygobject(dict, gtype, type, base, NULL) +bool register_class_for_pygobject(PyObject *, GType, PyTypeObject *); /* Enregistre correctement une interface GObject pour Python. */ 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 *); +bool register_class_for_dynamic_pygobject(GType, PyTypeObject *); /* Fait suivre à la partie GObject une initialisation nouvelle. */ int forward_pygobjet_init(PyObject *); diff --git a/plugins/pychrysalide/mangling/demangler.c b/plugins/pychrysalide/mangling/demangler.c index 5779693..fb90dca 100644 --- a/plugins/pychrysalide/mangling/demangler.c +++ b/plugins/pychrysalide/mangling/demangler.c @@ -264,7 +264,7 @@ PyTypeObject *get_python_compiler_demangler_type(void) * * * Paramètres : module = module dont la définition est à compléter. * * * -* Description : Prend en charge l'objet 'pychrysalide.mangling.DexDemangler'.* +* Description : Prend en charge l'objet 'pychrysalide....CompDemangler'. * * * * Retour : Bilan de l'opération. * * * @@ -286,7 +286,7 @@ bool ensure_python_compiler_demangler_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_COMP_DEMANGLER, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_COMP_DEMANGLER, type)) return false; } diff --git a/plugins/pychrysalide/mangling/demangler.h b/plugins/pychrysalide/mangling/demangler.h index 0c31f7c..496aa21 100644 --- a/plugins/pychrysalide/mangling/demangler.h +++ b/plugins/pychrysalide/mangling/demangler.h @@ -34,7 +34,7 @@ /* Fournit un accès à une définition de type à diffuser. */ PyTypeObject *get_python_compiler_demangler_type(void); -/* Prend en charge l'objet 'pychrysalide.format.elf.ElfFormat'. */ +/* Prend en charge l'objet 'pychrysalide.mangling.CompDemangler'. */ bool ensure_python_compiler_demangler_is_registered(void); diff --git a/plugins/pychrysalide/plugins/plugin.c b/plugins/pychrysalide/plugins/plugin.c index 06bbd83..e4eb2c6 100644 --- a/plugins/pychrysalide/plugins/plugin.c +++ b/plugins/pychrysalide/plugins/plugin.c @@ -1745,7 +1745,7 @@ bool ensure_python_plugin_module_is_registered(void) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_PLUGIN_MODULE, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_PLUGIN_MODULE, type)) return false; if (!define_plugin_module_constants(type)) |