1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-24 03:46:39 +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
@@ -3013,20 +3013,22 @@ weechat_python_api_bar_item_search (PyObject *self, PyObject *args)
char *
weechat_python_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 *python_argv[4], *ret;
static char buf[32];
char *python_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);
python_argv[0] = script_ptr2str (item);
python_argv[1] = script_ptr2str (window);
python_argv[2] = buf;
python_argv[3] = NULL;
python_argv[2] = str_width;
python_argv[3] = str_height;
python_argv[4] = NULL;
ret = (char *)weechat_python_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_STRING,