mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 21:06:38 +02:00
Add delimiter color for bars, fix some bugs with bars
This commit is contained in:
@@ -4038,7 +4038,8 @@ 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_bg, *separator, *items;
|
||||
const char *size, *size_max, *color_fg, *color_delim, *color_bg;
|
||||
const char *separator, *items;
|
||||
char *result;
|
||||
int n;
|
||||
|
||||
@@ -4060,27 +4061,29 @@ weechat_lua_api_bar_new (lua_State *L)
|
||||
size = NULL;
|
||||
size_max = NULL;
|
||||
color_fg = NULL;
|
||||
color_delim = NULL;
|
||||
color_bg = NULL;
|
||||
separator = NULL;
|
||||
items = NULL;
|
||||
|
||||
n = lua_gettop (lua_current_interpreter);
|
||||
|
||||
if (n < 12)
|
||||
if (n < 13)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("bar_new");
|
||||
LUA_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
name = lua_tostring (lua_current_interpreter, -12);
|
||||
priority = lua_tostring (lua_current_interpreter, -11);
|
||||
type = lua_tostring (lua_current_interpreter, -10);
|
||||
conditions = lua_tostring (lua_current_interpreter, -9);
|
||||
position = lua_tostring (lua_current_interpreter, -8);
|
||||
filling = lua_tostring (lua_current_interpreter, -7);
|
||||
size = lua_tostring (lua_current_interpreter, -6);
|
||||
size_max = lua_tostring (lua_current_interpreter, -5);
|
||||
color_fg = lua_tostring (lua_current_interpreter, -4);
|
||||
name = 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);
|
||||
position = lua_tostring (lua_current_interpreter, -9);
|
||||
filling = lua_tostring (lua_current_interpreter, -8);
|
||||
size = lua_tostring (lua_current_interpreter, -7);
|
||||
size_max = lua_tostring (lua_current_interpreter, -6);
|
||||
color_fg = lua_tostring (lua_current_interpreter, -5);
|
||||
color_delim = lua_tostring (lua_current_interpreter, -4);
|
||||
color_bg = lua_tostring (lua_current_interpreter, -3);
|
||||
separator = lua_tostring (lua_current_interpreter, -2);
|
||||
items = lua_tostring (lua_current_interpreter, -1);
|
||||
@@ -4094,6 +4097,7 @@ weechat_lua_api_bar_new (lua_State *L)
|
||||
size,
|
||||
size_max,
|
||||
color_fg,
|
||||
color_delim,
|
||||
color_bg,
|
||||
separator,
|
||||
items));
|
||||
|
||||
@@ -3354,7 +3354,8 @@ 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_bg, *separator, *bar_items;
|
||||
char *size, *size_max, *color_fg, *color_delim, *color_bg, *separator;
|
||||
char *bar_items;
|
||||
dXSARGS;
|
||||
|
||||
/* make C compiler happy */
|
||||
@@ -3366,7 +3367,7 @@ static XS (XS_weechat_bar_new)
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 12)
|
||||
if (items < 13)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("bar_new");
|
||||
PERL_RETURN_EMPTY;
|
||||
@@ -3381,9 +3382,10 @@ static XS (XS_weechat_bar_new)
|
||||
size = SvPV (ST (6), PL_na);
|
||||
size_max = SvPV (ST (7), PL_na);
|
||||
color_fg = SvPV (ST (8), PL_na);
|
||||
color_bg = SvPV (ST (9), PL_na);
|
||||
separator = SvPV (ST (10), PL_na);
|
||||
bar_items = SvPV (ST (11), 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);
|
||||
result = script_ptr2str (weechat_bar_new (name,
|
||||
priority,
|
||||
type,
|
||||
@@ -3393,6 +3395,7 @@ static XS (XS_weechat_bar_new)
|
||||
size,
|
||||
size_max,
|
||||
color_fg,
|
||||
color_delim,
|
||||
color_bg,
|
||||
separator,
|
||||
bar_items));
|
||||
|
||||
@@ -3566,7 +3566,8 @@ 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_bg, *separator, *items, *result;
|
||||
char *size_max, *color_fg, *color_delim, *color_bg, *separator, *items;
|
||||
char *result;
|
||||
PyObject *object;
|
||||
|
||||
/* make C compiler happy */
|
||||
@@ -3587,13 +3588,15 @@ weechat_python_api_bar_new (PyObject *self, PyObject *args)
|
||||
size = NULL;
|
||||
size_max = NULL;
|
||||
color_fg = NULL;
|
||||
color_delim = NULL;
|
||||
color_bg = NULL;
|
||||
separator = NULL;
|
||||
items = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple (args, "ssssssssssss", &name, &priority, &conditions,
|
||||
&type, &position, &filling, &size, &size_max,
|
||||
&color_fg, &color_bg, &separator, &items))
|
||||
if (!PyArg_ParseTuple (args, "sssssssssssss", &name, &priority,
|
||||
&conditions, &type, &position, &filling, &size,
|
||||
&size_max, &color_fg, &color_delim, &color_bg,
|
||||
&separator, &items))
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("bar_new");
|
||||
PYTHON_RETURN_EMPTY;
|
||||
@@ -3608,6 +3611,7 @@ weechat_python_api_bar_new (PyObject *self, PyObject *args)
|
||||
size,
|
||||
size_max,
|
||||
color_fg,
|
||||
color_delim,
|
||||
color_bg,
|
||||
separator,
|
||||
items));
|
||||
|
||||
@@ -4096,11 +4096,12 @@ 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_bg, VALUE separator, VALUE items)
|
||||
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_bg, *c_separator;
|
||||
char *c_items;
|
||||
char *c_size, *c_size_max, *c_color_fg, *c_color_delim, *c_color_bg;
|
||||
char *c_separator, *c_items;
|
||||
char *result;
|
||||
VALUE return_value;
|
||||
|
||||
@@ -4122,14 +4123,15 @@ weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE priority, VALUE type,
|
||||
c_size = NULL;
|
||||
c_size_max = NULL;
|
||||
c_color_fg = NULL;
|
||||
c_color_delim = NULL;
|
||||
c_color_bg = NULL;
|
||||
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_bg)
|
||||
|| NIL_P (separator) || NIL_P (items))
|
||||
|| 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;
|
||||
@@ -4144,6 +4146,7 @@ weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE priority, VALUE type,
|
||||
Check_Type (size, T_STRING);
|
||||
Check_Type (size_max, T_STRING);
|
||||
Check_Type (color_fg, T_STRING);
|
||||
Check_Type (color_delim, T_STRING);
|
||||
Check_Type (color_bg, T_STRING);
|
||||
Check_Type (separator, T_STRING);
|
||||
Check_Type (items, T_STRING);
|
||||
@@ -4157,6 +4160,7 @@ weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE priority, VALUE type,
|
||||
c_size = STR2CSTR (size);
|
||||
c_size_max = STR2CSTR (size_max);
|
||||
c_color_fg = STR2CSTR (color_fg);
|
||||
c_color_delim = STR2CSTR (color_delim);
|
||||
c_color_bg = STR2CSTR (color_bg);
|
||||
c_separator = STR2CSTR (separator);
|
||||
c_items = STR2CSTR (items);
|
||||
@@ -4170,6 +4174,7 @@ weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE priority, VALUE type,
|
||||
c_size,
|
||||
c_size_max,
|
||||
c_color_fg,
|
||||
c_color_delim,
|
||||
c_color_bg,
|
||||
c_separator,
|
||||
c_items));
|
||||
@@ -4793,7 +4798,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, 12);
|
||||
rb_define_module_function (ruby_mWeechat, "bar_new", &weechat_ruby_api_bar_new, 13);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user