diff options
Diffstat (limited to 'src/plugins/plugin-api.c')
-rw-r--r-- | src/plugins/plugin-api.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c index 6d06d922f..ffed78bb0 100644 --- a/src/plugins/plugin-api.c +++ b/src/plugins/plugin-api.c @@ -56,6 +56,7 @@ #include "../gui/gui-history.h" #include "../gui/gui-hotlist.h" #include "../gui/gui-key.h" +#include "../gui/gui-layout.h" #include "../gui/gui-line.h" #include "../gui/gui-nicklist.h" #include "../gui/gui-window.h" @@ -412,6 +413,7 @@ plugin_api_infolist_get_internal (void *data, const char *infolist_name, struct t_gui_hotlist *ptr_hotlist; struct t_gui_key *ptr_key; struct t_weechat_plugin *ptr_plugin; + struct t_gui_layout *ptr_layout; int context, number, i; char *error; @@ -713,6 +715,23 @@ plugin_api_infolist_get_internal (void *data, const char *infolist_name, return ptr_infolist; } } + else if (string_strcasecmp (infolist_name, "layout") == 0) + { + ptr_infolist = infolist_new (); + if (ptr_infolist) + { + for (ptr_layout = gui_layouts; ptr_layout; + ptr_layout = ptr_layout->next_layout) + { + if (!gui_layout_add_to_infolist (ptr_infolist,ptr_layout)) + { + infolist_free (ptr_infolist); + return NULL; + } + } + return ptr_infolist; + } + } else if (string_strcasecmp (infolist_name, "nicklist") == 0) { /* invalid buffer pointer ? */ @@ -1108,6 +1127,10 @@ plugin_api_init () N_("context (\"default\", \"search\", \"cursor\" or " "\"mouse\") (optional)"), &plugin_api_infolist_get_internal, NULL); + hook_infolist (NULL, "layout", N_("list of layouts"), + NULL, + NULL, + &plugin_api_infolist_get_internal, NULL); hook_infolist (NULL, "nicklist", N_("nicks in nicklist for a buffer"), N_("buffer pointer"), N_("nick_xxx or group_xxx to get only nick/group xxx " @@ -1159,6 +1182,12 @@ plugin_api_init () &gui_buffer_hdata_input_undo_cb, NULL); hook_hdata (NULL, "key", N_("a key (keyboard shortcut)"), &gui_key_hdata_key_cb, NULL); + hook_hdata (NULL, "layout", N_("layout"), + &gui_layout_hdata_layout_cb, NULL); + hook_hdata (NULL, "layout_buffer", N_("buffer layout"), + &gui_layout_hdata_layout_buffer_cb, NULL); + hook_hdata (NULL, "layout_window", N_("window layout"), + &gui_layout_hdata_layout_window_cb, NULL); hook_hdata (NULL, "lines", N_("structure with lines"), &gui_line_hdata_lines_cb, NULL); hook_hdata (NULL, "line", N_("structure with one line"), |