diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c index 91f4a1110..61d92ab88 100644 --- a/src/plugins/plugin.c +++ b/src/plugins/plugin.c @@ -50,6 +50,7 @@ #include "../core/core-log.h" #include "../core/core-network.h" #include "../core/core-string.h" +#include "../core/core-theme.h" #include "../core/core-upgrade-file.h" #include "../core/core-utf8.h" #include "../core/core-util.h" @@ -799,6 +800,8 @@ plugin_load (const char *filename, int init_plugin, int argc, char **argv) new_plugin->config_set_desc_plugin = &plugin_api_config_set_desc_plugin; new_plugin->config_unset_plugin = &plugin_api_config_unset_plugin; + new_plugin->theme_register = &theme_register; + new_plugin->key_bind = &gui_key_bind_plugin; new_plugin->key_unbind = &gui_key_unbind_plugin; diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h index 7d644a657..0afecab82 100644 --- a/src/plugins/weechat-plugin.h +++ b/src/plugins/weechat-plugin.h @@ -62,6 +62,7 @@ struct t_hashtable; struct t_hdata; struct t_infolist; struct t_infolist_item; +struct t_theme; struct t_upgrade_file; struct t_weelist; struct t_weelist_item; @@ -76,7 +77,7 @@ struct t_weelist_item; * please change the date with current one; for a second change at same * date, increment the 01, otherwise please keep 01. */ -#define WEECHAT_PLUGIN_API_VERSION "20260530-01" +#define WEECHAT_PLUGIN_API_VERSION "20260531-01" /* macros for defining plugin infos */ #define WEECHAT_PLUGIN_NAME(__name) \ @@ -728,6 +729,10 @@ struct t_weechat_plugin int (*config_unset_plugin) (struct t_weechat_plugin *plugin, const char *option_name); + /* themes */ + struct t_theme *(*theme_register) (const char *name, + struct t_hashtable *overrides); + /* key bindings */ int (*key_bind) (const char *context, struct t_hashtable *keys); int (*key_unbind) (const char *context, const char *key); @@ -1855,6 +1860,10 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin); #define weechat_config_unset_plugin(__option) \ (weechat_plugin->config_unset_plugin)(weechat_plugin, __option) +/* themes */ +#define weechat_theme_register(__name, __overrides) \ + (weechat_plugin->theme_register)(__name, __overrides) + /* key bindings */ #define weechat_key_bind(__context, __keys) \ (weechat_plugin->key_bind)(__context, __keys)