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

Add input bar item, add "hidden" flag for bars, fix some display bugs with bars

This commit is contained in:
Sebastien Helleu
2008-06-27 17:15:26 +02:00
parent c38eac19e3
commit 50f8bf0043
32 changed files with 1117 additions and 363 deletions
+7 -4
View File
@@ -4037,8 +4037,8 @@ weechat_lua_api_bar_search (lua_State *L)
static int
weechat_lua_api_bar_new (lua_State *L)
{
const char *name, *priority, *type, *conditions, *position, *filling;
const char *size, *size_max, *color_fg, *color_delim, *color_bg;
const char *name, *hidden, *priority, *type, *conditions, *position;
const char *filling, *size, *size_max, *color_fg, *color_delim, *color_bg;
const char *separator, *items;
char *result;
int n;
@@ -4053,6 +4053,7 @@ weechat_lua_api_bar_new (lua_State *L)
}
name = NULL;
hidden = NULL;
priority = NULL;
type = NULL;
conditions = NULL;
@@ -4068,13 +4069,14 @@ weechat_lua_api_bar_new (lua_State *L)
n = lua_gettop (lua_current_interpreter);
if (n < 13)
if (n < 14)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("bar_new");
LUA_RETURN_EMPTY;
}
name = lua_tostring (lua_current_interpreter, -13);
name = lua_tostring (lua_current_interpreter, -14);
hidden = lua_tostring (lua_current_interpreter, -13);
priority = lua_tostring (lua_current_interpreter, -12);
type = lua_tostring (lua_current_interpreter, -11);
conditions = lua_tostring (lua_current_interpreter, -10);
@@ -4089,6 +4091,7 @@ weechat_lua_api_bar_new (lua_State *L)
items = lua_tostring (lua_current_interpreter, -1);
result = script_ptr2str (weechat_bar_new (name,
hidden,
priority,
type,
conditions,
+18 -16
View File
@@ -3353,9 +3353,9 @@ static XS (XS_weechat_bar_search)
static XS (XS_weechat_bar_new)
{
char *result, *name, *priority, *type, *conditions, *position, *filling;
char *size, *size_max, *color_fg, *color_delim, *color_bg, *separator;
char *bar_items;
char *result, *name, *hidden, *priority, *type, *conditions, *position;
char *filling, *size, *size_max, *color_fg, *color_delim, *color_bg;
char *separator, *bar_items;
dXSARGS;
/* make C compiler happy */
@@ -3367,26 +3367,28 @@ static XS (XS_weechat_bar_new)
PERL_RETURN_EMPTY;
}
if (items < 13)
if (items < 14)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("bar_new");
PERL_RETURN_EMPTY;
}
name = SvPV (ST (0), PL_na);
priority = SvPV (ST (1), PL_na);
type = SvPV (ST (2), PL_na);
conditions = SvPV (ST (3), PL_na);
position = SvPV (ST (4), PL_na);
filling = SvPV (ST (5), PL_na);
size = SvPV (ST (6), PL_na);
size_max = SvPV (ST (7), PL_na);
color_fg = SvPV (ST (8), PL_na);
color_delim = SvPV (ST (9), PL_na);
color_bg = SvPV (ST (10), PL_na);
separator = SvPV (ST (11), PL_na);
bar_items = SvPV (ST (12), PL_na);
hidden = SvPV (ST (1), PL_na);
priority = SvPV (ST (2), PL_na);
type = SvPV (ST (3), PL_na);
conditions = SvPV (ST (4), PL_na);
position = SvPV (ST (5), PL_na);
filling = SvPV (ST (6), PL_na);
size = SvPV (ST (7), PL_na);
size_max = SvPV (ST (8), PL_na);
color_fg = SvPV (ST (9), PL_na);
color_delim = SvPV (ST (10), PL_na);
color_bg = SvPV (ST (11), PL_na);
separator = SvPV (ST (12), PL_na);
bar_items = SvPV (ST (13), PL_na);
result = script_ptr2str (weechat_bar_new (name,
hidden,
priority,
type,
conditions,
@@ -3565,9 +3565,9 @@ weechat_python_api_bar_search (PyObject *self, PyObject *args)
static PyObject *
weechat_python_api_bar_new (PyObject *self, PyObject *args)
{
char *name, *priority, *type, *conditions, *position, *filling, *size;
char *size_max, *color_fg, *color_delim, *color_bg, *separator, *items;
char *result;
char *name, *hidden, *priority, *type, *conditions, *position, *filling;
char *size, *size_max, *color_fg, *color_delim, *color_bg, *separator;
char *items, *result;
PyObject *object;
/* make C compiler happy */
@@ -3580,6 +3580,7 @@ weechat_python_api_bar_new (PyObject *self, PyObject *args)
}
name = NULL;
hidden = NULL;
priority = NULL;
type = NULL;
conditions = NULL;
@@ -3593,7 +3594,7 @@ weechat_python_api_bar_new (PyObject *self, PyObject *args)
separator = NULL;
items = NULL;
if (!PyArg_ParseTuple (args, "sssssssssssss", &name, &priority,
if (!PyArg_ParseTuple (args, "ssssssssssssss", &name, &hidden, &priority,
&conditions, &type, &position, &filling, &size,
&size_max, &color_fg, &color_delim, &color_bg,
&separator, &items))
@@ -3603,6 +3604,7 @@ weechat_python_api_bar_new (PyObject *self, PyObject *args)
}
result = script_ptr2str (weechat_bar_new (name,
hidden,
priority,
type,
conditions,
+18 -13
View File
@@ -4093,15 +4093,15 @@ weechat_ruby_api_bar_search (VALUE class, VALUE name)
*/
static VALUE
weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE priority, VALUE type,
VALUE conditions, VALUE position, VALUE filling,
VALUE size, VALUE size_max, VALUE color_fg,
VALUE color_delim, VALUE color_bg, VALUE separator,
VALUE items)
weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE hidden,
VALUE priority, VALUE type, VALUE conditions,
VALUE position, VALUE filling, VALUE size,
VALUE size_max, VALUE color_fg, VALUE color_delim,
VALUE color_bg, VALUE separator, VALUE items)
{
char *c_name, *c_priority, *c_type, *c_conditions, *c_position, *c_filling;
char *c_size, *c_size_max, *c_color_fg, *c_color_delim, *c_color_bg;
char *c_separator, *c_items;
char *c_name, *c_hidden, *c_priority, *c_type, *c_conditions, *c_position;
char *c_filling, *c_size, *c_size_max, *c_color_fg, *c_color_delim;
char *c_color_bg, *c_separator, *c_items;
char *result;
VALUE return_value;
@@ -4115,6 +4115,7 @@ weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE priority, VALUE type,
}
c_name = NULL;
c_hidden = NULL;
c_priority = NULL;
c_type = NULL;
c_conditions = NULL;
@@ -4128,16 +4129,18 @@ weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE priority, VALUE type,
c_separator = NULL;
c_items = NULL;
if (NIL_P (name) || NIL_P (priority) || NIL_P (type) || NIL_P (conditions)
|| NIL_P (position) || NIL_P (filling) || NIL_P (size)
|| NIL_P (size_max) || NIL_P (color_fg) || NIL_P (color_delim)
|| NIL_P (color_bg) || NIL_P (separator) || NIL_P (items))
if (NIL_P (name) || NIL_P (hidden) || NIL_P (priority) || NIL_P (type)
|| NIL_P (conditions) || NIL_P (position) || NIL_P (filling)
|| NIL_P (size) || NIL_P (size_max) || NIL_P (color_fg)
|| NIL_P (color_delim) || NIL_P (color_bg) || NIL_P (separator)
|| NIL_P (items))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("bar_new");
RUBY_RETURN_EMPTY;
}
Check_Type (name, T_STRING);
Check_Type (hidden, T_STRING);
Check_Type (priority, T_STRING);
Check_Type (type, T_STRING);
Check_Type (conditions, T_STRING);
@@ -4152,6 +4155,7 @@ weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE priority, VALUE type,
Check_Type (items, T_STRING);
c_name = STR2CSTR (name);
c_hidden = STR2CSTR (hidden);
c_priority = STR2CSTR (priority);
c_type = STR2CSTR (type);
c_conditions = STR2CSTR (conditions);
@@ -4166,6 +4170,7 @@ weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE priority, VALUE type,
c_items = STR2CSTR (items);
result = script_ptr2str (weechat_bar_new (c_name,
c_hidden,
c_priority,
c_type,
c_conditions,
@@ -4798,7 +4803,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
rb_define_module_function (ruby_mWeechat, "bar_item_update", &weechat_ruby_api_bar_item_update, 1);
rb_define_module_function (ruby_mWeechat, "bar_item_remove", &weechat_ruby_api_bar_item_remove, 1);
rb_define_module_function (ruby_mWeechat, "bar_search", &weechat_ruby_api_bar_search, 1);
rb_define_module_function (ruby_mWeechat, "bar_new", &weechat_ruby_api_bar_new, 13);
rb_define_module_function (ruby_mWeechat, "bar_new", &weechat_ruby_api_bar_new, 14);
rb_define_module_function (ruby_mWeechat, "bar_set", &weechat_ruby_api_bar_set, 3);
rb_define_module_function (ruby_mWeechat, "bar_update", &weechat_ruby_api_bar_update, 1);
rb_define_module_function (ruby_mWeechat, "bar_remove", &weechat_ruby_api_bar_remove, 1);