diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-12-05 10:28:15 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-12-05 10:44:28 (GMT) |
commit | 333e68541e376a7b86703fad8e917f71c0f243d0 (patch) | |
tree | a658682ed01ba8dbb4d5ad0edab4999dd9e9ff54 /src/plugins/plugin.c | |
parent | 1e3fa9b79ebe55698e2aa7d5484baec7e8400a8f (diff) |
Extended the plugin API to include some panel events.
Diffstat (limited to 'src/plugins/plugin.c')
-rw-r--r-- | src/plugins/plugin.c | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c index df593ea..8b3654e 100644 --- a/src/plugins/plugin.c +++ b/src/plugins/plugin.c @@ -373,6 +373,28 @@ GPluginModule *g_plugin_module_new(const gchar *filename) break; + case DPS_RUNNING: + + switch (action) + { + case PGA_PANEL_CREATION: + valid = check_plugin_symbol(module, "chrysalide_plugin_on_panel_creation"); + break; + + case PGA_PANEL_DOCKING: + valid = check_plugin_symbol(module, "chrysalide_plugin_on_panel_docking"); + break; + + default: + log_variadic_message(LMT_WARNING, + _("Unknown action '0x%02x' in plugin '%s'..."), + interface->actions[i], filename); + break; + + } + + break; + default: log_variadic_message(LMT_WARNING, _("Unknown sub-category '0x%02x' in plugin '%s'..."), sub, filename); @@ -640,6 +662,28 @@ static void g_plugin_module_init_gclass(GPluginModuleClass *class, GModule *modu break; + case DPS_RUNNING: + + switch (action) + { + case PGA_PANEL_CREATION: + load_plugin_symbol(module, "chrysalide_plugin_on_panel_creation", + &class->notify_panel); + break; + + case PGA_PANEL_DOCKING: + load_plugin_symbol(module, "chrysalide_plugin_on_panel_docking", + &class->notify_docking); + break; + + default: + assert(false); + break; + + } + + break; + default: assert(false); break; @@ -1270,6 +1314,57 @@ void g_plugin_module_include_theme(const GPluginModule *plugin, PluginAction act /****************************************************************************** * * +* Paramètres : plugin = greffon à manipuler. * +* action = type d'action attendue. * +* item = nouveau panneau créé. * +* * +* Description : Rend compte de la création d'un panneau. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_plugin_module_notify_panel_creation(const GPluginModule *plugin, PluginAction action, GPanelItem *item) +{ + GPluginModuleClass *class; /* Classe de l'instance active */ + + class = G_PLUGIN_MODULE_GET_CLASS(plugin); + + class->notify_panel(plugin, action, item); + +} + + +/****************************************************************************** +* * +* Paramètres : plugin = greffon à manipuler. * +* action = type d'action attendue. * +* item = panneau marqué par un changement d'affichage. * +* dock = indique une accroche et non un décrochage. * +* * +* Description : Rend compte d'un affichage ou d'un retrait de panneau. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_plugin_module_notify_panel_docking(const GPluginModule *plugin, PluginAction action, GPanelItem *item, bool dock) +{ + GPluginModuleClass *class; /* Classe de l'instance active */ + + class = G_PLUGIN_MODULE_GET_CLASS(plugin); + + class->notify_docking(plugin, action, item, dock); + +} + + +/****************************************************************************** +* * * Paramètres : plugin = greffon à manipuler. * * action = type d'action attendue. * * content = contenu binaire à traiter. * |