diff options
Diffstat (limited to 'src/plugins/pglist.h')
-rw-r--r-- | src/plugins/pglist.h | 63 |
1 files changed, 44 insertions, 19 deletions
diff --git a/src/plugins/pglist.h b/src/plugins/pglist.h index 83e9091..5541493 100644 --- a/src/plugins/pglist.h +++ b/src/plugins/pglist.h @@ -52,9 +52,6 @@ void _lock_unlock_plugin_list_for_reading(bool lock); #define unlock_plugin_list_for_reading() _lock_unlock_plugin_list_for_reading(false) /* Ajoute un greffon à la liste principale de greffons. */ -void _register_plugin(GPluginModule *); - -/* Ajoute un greffon à la liste principale de greffons. */ void register_plugin(GPluginModule *); /* Charge tous les greffons restant à charger. */ @@ -66,16 +63,39 @@ GPluginModule *get_plugin_by_name(const char *, size_t *); /* Fournit la liste de l'ensemble des greffons. */ GPluginModule **get_all_plugins(size_t *); -/* Fournit les greffons offrant le service demandé. */ -GPluginModule **get_all_plugins_for_action(PluginAction, size_t *); - /** * Définitions des opérations appliquables à une catégories de greffons. */ -#define process_all_plugins_for(a, f, ...) \ +#define process_all_plugins_for(tp, cst, fc) \ + do \ + { \ + size_t __count; \ + GPluginModule **__list; \ + size_t __i; \ + __list = get_all_plugins(&__count); \ + for (__i = 0; __i < __count; __i++) \ + { \ + if (G_TYPE_CHECK_INSTANCE_TYPE(__list[__i], tp)) \ + fc(cst(__list[__i])); \ + unref_object(__list[__i]); \ + } \ + if (__list != NULL) \ + free(__list); \ + } \ + while (0) + + + + + +#if 0 + +// TODO : REMME + +#define process_all_plugins_for_old__(a, f, ...) \ do \ { \ size_t __count; \ @@ -114,11 +134,13 @@ GPluginModule **get_all_plugins_for_action(PluginAction, size_t *); /* DPS_PG_MANAGEMENT */ +/* #define notify_native_plugins_loaded() \ - process_all_plugins_for(PGA_NATIVE_PLUGINS_LOADED, g_plugin_module_notify_plugins_loaded, NULL) + process_all_plugins_for_old__(PGA_NATIVE_PLUGINS_LOADED, g_plugin_module_notify_plugins_loaded, NULL) #define notify_all_plugins_loaded() \ - process_all_plugins_for(PGA_ALL_PLUGINS_LOADED, g_plugin_module_notify_plugins_loaded, NULL) + process_all_plugins_for_old__(PGA_ALL_PLUGINS_LOADED, g_plugin_module_notify_plugins_loaded, NULL) +*/ #define build_type_instance(t) \ process_plugins_while_null(PGA_TYPE_BUILDING, g_plugin_module_build_type_instance, t) @@ -126,44 +148,47 @@ GPluginModule **get_all_plugins_for_action(PluginAction, size_t *); /* DPS_SETUP */ #define include_plugin_theme(d, r, c) \ - process_all_plugins_for(PGA_GUI_THEME, g_plugin_module_include_theme, d, r, c) + process_all_plugins_for_old__(PGA_GUI_THEME, g_plugin_module_include_theme, d, r, c) /* DPS_RUNNING */ #define notify_panel_creation(i) \ - process_all_plugins_for(PGA_PANEL_CREATION, g_plugin_module_notify_panel_creation, i) + process_all_plugins_for_old__(PGA_PANEL_CREATION, g_plugin_module_notify_panel_creation, i) #define notify_panel_docking(i, d) \ - process_all_plugins_for(PGA_PANEL_DOCKING, g_plugin_module_notify_panel_docking, i, d) + process_all_plugins_for_old__(PGA_PANEL_DOCKING, g_plugin_module_notify_panel_docking, i, d) /* DPS_CONTENT */ #define handle_binary_content(a, c, i, s) \ - process_all_plugins_for(a, g_plugin_module_handle_binary_content, c, i, s) + process_all_plugins_for_old__(a, g_plugin_module_handle_binary_content, c, i, s) #define handle_loaded_content(a, c, i, s) \ - process_all_plugins_for(a, g_plugin_module_handle_loaded_content, c, i, s) + process_all_plugins_for_old__(a, g_plugin_module_handle_loaded_content, c, i, s) /* DPS_FORMAT */ #define handle_known_format_analysis(a, f, g, s) \ - process_all_plugins_for(a, g_plugin_module_handle_known_format_analysis, f, g, s) + process_all_plugins_for_old__(a, g_plugin_module_handle_known_format_analysis, f, g, s) #define preload_binary_format(a, f, i, s) \ - process_all_plugins_for(a, g_plugin_module_preload_binary_format, f, i, s) + process_all_plugins_for_old__(a, g_plugin_module_preload_binary_format, f, i, s) #define attach_debug_format(f) \ - process_all_plugins_for(PGA_FORMAT_ATTACH_DEBUG, g_plugin_module_attach_debug_format, f) + process_all_plugins_for_old__(PGA_FORMAT_ATTACH_DEBUG, g_plugin_module_attach_debug_format, f) /* DPS_DISASSEMBLY */ #define process_disassembly_event(a, b, s, c) \ - process_all_plugins_for(a, g_plugin_module_process_disassembly_event, b, s, c) + process_all_plugins_for_old__(a, g_plugin_module_process_disassembly_event, b, s, c) /* DPS_DETECTION */ #define detect_external_tools(a, cnt, v, n, c) \ - process_all_plugins_for(a, g_plugin_module_detect_external_tools, cnt, v, n, c) + process_all_plugins_for_old__(a, g_plugin_module_detect_external_tools, cnt, v, n, c) + + +#endif |