diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-12-05 00:39:57 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-12-05 00:39:57 (GMT) |
commit | 1e3fa9b79ebe55698e2aa7d5484baec7e8400a8f (patch) | |
tree | c3581ceb7f8586f2f6822de563927a1246dd33a5 /src/plugins/pglist.h | |
parent | 6122bb7f34b178d4c07285adae16afcc55294b1f (diff) |
Rewritten the whole API dealing with panels.
Diffstat (limited to 'src/plugins/pglist.h')
-rw-r--r-- | src/plugins/pglist.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/plugins/pglist.h b/src/plugins/pglist.h index ae71458..fd8e30a 100644 --- a/src/plugins/pglist.h +++ b/src/plugins/pglist.h @@ -69,6 +69,7 @@ GPluginModule **get_all_plugins_for_action(PluginAction, size_t *); */ #define process_all_plugins_for(a, f, ...) \ + do \ { \ size_t __count; \ GPluginModule **__list; \ @@ -84,12 +85,34 @@ GPluginModule **get_all_plugins_for_action(PluginAction, size_t *); } \ while (0) +#define process_plugins_while_null(a, f, ...) \ + ({ \ + void *__result; \ + size_t __count; \ + GPluginModule **__list; \ + size_t __i; \ + __result = NULL; \ + __list = get_all_plugins_for_action(a, &__count); \ + for (__i = 0; __i < __count; __i++) \ + { \ + if (__result == NULL) \ + __result = f(__list[__i], a, __VA_ARGS__); \ + g_object_unref(G_OBJECT(__list[__i])); \ + } \ + if (__list != NULL) \ + free(__list); \ + __result; \ + }) + /* DPS_PG_MANAGEMENT */ #define notify_native_loaded \ process_all_plugins_for(PGA_NATIVE_LOADED, g_plugin_module_notify_native_loaded, NULL) +#define build_type_instance(t) \ + process_plugins_while_null(PGA_TYPE_BUILDING, g_plugin_module_build_type_instance, t) + /* DPS_SETUP */ #define include_plugin_theme(d, r, c) \ |