1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 05:16:38 +02:00

core: add infos "term_width" and "term_height"

This commit is contained in:
Sebastien Helleu
2013-11-09 15:55:11 +01:00
parent ff62f3edff
commit 18ff3064cf
19 changed files with 120 additions and 13 deletions
+14
View File
@@ -387,6 +387,16 @@ plugin_api_info_get_internal (void *data, const char *info_name,
snprintf (value, sizeof (value), "%d", gui_cursor_mode);
return value;
}
else if (string_strcasecmp (info_name, "term_width") == 0)
{
snprintf (value, sizeof (value), "%d", gui_window_get_width ());
return value;
}
else if (string_strcasecmp (info_name, "term_height") == 0)
{
snprintf (value, sizeof (value), "%d", gui_window_get_height ());
return value;
}
/* info not found */
return NULL;
@@ -1127,6 +1137,10 @@ plugin_api_init ()
&plugin_api_info_get_internal, NULL);
hook_info (NULL, "cursor_mode", N_("1 if cursor mode is enabled"), NULL,
&plugin_api_info_get_internal, NULL);
hook_info (NULL, "term_width", N_("width of terminal"), NULL,
&plugin_api_info_get_internal, NULL);
hook_info (NULL, "term_height", N_("height of terminal"), NULL,
&plugin_api_info_get_internal, NULL);
/* WeeChat core infolist hooks */
hook_infolist (NULL, "bar", N_("list of bars"),