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

Added "max_height" parameter for bar item rebuild callbacks

This commit is contained in:
Sebastien Helleu
2008-03-07 10:54:33 +01:00
parent 32e976ae72
commit 519f62c11d
13 changed files with 159 additions and 66 deletions
+8 -6
View File
@@ -3412,20 +3412,22 @@ weechat_lua_api_bar_item_search (lua_State *L)
char *
weechat_lua_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
struct t_gui_window *window,
int max_width)
int max_width, int max_height)
{
struct t_script_callback *script_callback;
char *lua_argv[4], *ret;
static char buf[32];
char *lua_argv[5], *ret;
static char str_width[32], str_height[32];
script_callback = (struct t_script_callback *)data;
snprintf (buf, sizeof (buf) - 1, "%d", max_width);
snprintf (str_width, sizeof (str_width), "%d", max_width);
snprintf (str_height, sizeof (str_height), "%d", max_height);
lua_argv[0] = script_ptr2str (item);
lua_argv[1] = script_ptr2str (window);
lua_argv[2] = buf;
lua_argv[3] = NULL;
lua_argv[2] = str_width;
lua_argv[3] = str_height;
lua_argv[4] = NULL;
ret = (char *)weechat_lua_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_STRING,