diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/scripts/lua/weechat-lua-api.c | 19 | ||||
-rw-r--r-- | src/plugins/scripts/perl/weechat-perl-api.c | 17 | ||||
-rw-r--r-- | src/plugins/scripts/python/weechat-python-api.c | 11 | ||||
-rw-r--r-- | src/plugins/scripts/ruby/weechat-ruby-api.c | 24 | ||||
-rw-r--r-- | src/plugins/weechat-plugin.h | 16 |
5 files changed, 58 insertions, 29 deletions
diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c index 2cf5a3ee0..e720da46e 100644 --- a/src/plugins/scripts/lua/weechat-lua-api.c +++ b/src/plugins/scripts/lua/weechat-lua-api.c @@ -3878,7 +3878,8 @@ weechat_lua_api_bar_search (lua_State *L) static int weechat_lua_api_bar_new (lua_State *L) { - const char *name, *type, *position, *items, *size, *separator; + const char *name, *type, *conditions, *position, *size, *size_max; + const char *separator, *items; char *result; int n; @@ -3893,30 +3894,36 @@ weechat_lua_api_bar_new (lua_State *L) name = NULL; type = NULL; + conditions = NULL; position = NULL; size = NULL; + size_max = NULL; separator = NULL; items = NULL; n = lua_gettop (lua_current_interpreter); - if (n < 6) + if (n < 8) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("bar_new"); LUA_RETURN_EMPTY; } - name = lua_tostring (lua_current_interpreter, -6); - type = lua_tostring (lua_current_interpreter, -5); - position = lua_tostring (lua_current_interpreter, -4); - size = lua_tostring (lua_current_interpreter, -3); + name = lua_tostring (lua_current_interpreter, -8); + type = lua_tostring (lua_current_interpreter, -7); + conditions = lua_tostring (lua_current_interpreter, -6); + position = lua_tostring (lua_current_interpreter, -5); + size = lua_tostring (lua_current_interpreter, -4); + size_max = lua_tostring (lua_current_interpreter, -3); separator = lua_tostring (lua_current_interpreter, -2); items = lua_tostring (lua_current_interpreter, -1); result = script_ptr2str (weechat_bar_new ((char *)name, (char *)type, + (char *)conditions, (char *)position, (char *)size, + (char *)size_max, (char *)separator, (char *)items)); diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c index 4c6fefd25..a833f4125 100644 --- a/src/plugins/scripts/perl/weechat-perl-api.c +++ b/src/plugins/scripts/perl/weechat-perl-api.c @@ -3219,7 +3219,8 @@ static XS (XS_weechat_bar_search) static XS (XS_weechat_bar_new) { - char *result, *name, *type, *position, *size, *separator, *bar_items; + char *result, *name, *type, *conditions, *position, *size, *size_max; + char *separator, *bar_items; dXSARGS; /* make C compiler happy */ @@ -3231,7 +3232,7 @@ static XS (XS_weechat_bar_new) PERL_RETURN_EMPTY; } - if (items < 6) + if (items < 8) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("bar_new"); PERL_RETURN_EMPTY; @@ -3239,14 +3240,18 @@ static XS (XS_weechat_bar_new) name = SvPV (ST (0), PL_na); type = SvPV (ST (1), PL_na); - position = SvPV (ST (2), PL_na); - size = SvPV (ST (3), PL_na); - separator = SvPV (ST (4), PL_na); - bar_items = SvPV (ST (5), PL_na); + conditions = SvPV (ST (2), PL_na); + position = SvPV (ST (3), PL_na); + size = SvPV (ST (4), PL_na); + size_max = SvPV (ST (5), PL_na); + separator = SvPV (ST (6), PL_na); + bar_items = SvPV (ST (7), PL_na); result = script_ptr2str (weechat_bar_new (name, type, + conditions, position, size, + size_max, separator, bar_items)); diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index dc3e6d6fa..d2723def0 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -3426,7 +3426,8 @@ weechat_python_api_bar_search (PyObject *self, PyObject *args) static PyObject * weechat_python_api_bar_new (PyObject *self, PyObject *args) { - char *name, *type, *position, *size, *separator, *items, *result; + char *name, *type, *conditions, *position, *size, *size_max, *separator; + char *items, *result; PyObject *object; /* make C compiler happy */ @@ -3440,13 +3441,15 @@ weechat_python_api_bar_new (PyObject *self, PyObject *args) name = NULL; type = NULL; + conditions = NULL; position = NULL; size = NULL; + size_max = NULL; separator = NULL; items = NULL; - if (!PyArg_ParseTuple (args, "ssssss", &name, &type, &position, &size, - &separator, &items)) + if (!PyArg_ParseTuple (args, "ssssssss", &name, &conditions, &type, + &position, &size, &size_max, &separator, &items)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("bar_new"); PYTHON_RETURN_EMPTY; @@ -3454,8 +3457,10 @@ weechat_python_api_bar_new (PyObject *self, PyObject *args) result = script_ptr2str (weechat_bar_new (name, type, + conditions, position, size, + size_max, separator, items)); diff --git a/src/plugins/scripts/ruby/weechat-ruby-api.c b/src/plugins/scripts/ruby/weechat-ruby-api.c index 00525a3be..4ab36fccb 100644 --- a/src/plugins/scripts/ruby/weechat-ruby-api.c +++ b/src/plugins/scripts/ruby/weechat-ruby-api.c @@ -3942,11 +3942,12 @@ weechat_ruby_api_bar_search (VALUE class, VALUE name) */ static VALUE -weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE type, VALUE position, - VALUE size, VALUE separator, VALUE items) +weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE type, VALUE conditions, + VALUE position, VALUE size, VALUE size_max, + VALUE separator, VALUE items) { - char *c_name, *c_type, *c_position, *c_size, *c_separator, *c_items; - char *result; + char *c_name, *c_type, *c_conditions, *c_position, *c_size, *c_size_max; + char *c_separator, *c_items, *result; VALUE return_value; /* make C compiler happy */ @@ -3960,13 +3961,16 @@ weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE type, VALUE position, c_name = NULL; c_type = NULL; + c_conditions = NULL; c_position = NULL; c_size = NULL; + c_size_max = NULL; c_separator = NULL; c_items = NULL; - if (NIL_P (name) || NIL_P (type) || NIL_P (position) || NIL_P (size) - || NIL_P (separator) || NIL_P (items)) + if (NIL_P (name) || NIL_P (type) || NIL_P (conditions) || NIL_P (position) + || NIL_P (size) || NIL_P (size_max) || NIL_P (separator) + || NIL_P (items)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("bar_new"); RUBY_RETURN_EMPTY; @@ -3974,22 +3978,28 @@ weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE type, VALUE position, Check_Type (name, T_STRING); Check_Type (type, T_STRING); + Check_Type (conditions, T_STRING); Check_Type (position, T_STRING); Check_Type (size, T_STRING); + Check_Type (size_max, T_STRING); Check_Type (separator, T_STRING); Check_Type (items, T_STRING); c_name = STR2CSTR (name); c_type = STR2CSTR (type); + c_conditions = STR2CSTR (conditions); c_position = STR2CSTR (position); c_size = STR2CSTR (size); + c_size_max = STR2CSTR (size_max); c_separator = STR2CSTR (separator); c_items = STR2CSTR (items); result = script_ptr2str (weechat_bar_new (c_name, c_type, + c_conditions, c_position, c_size, + c_size_max, c_separator, c_items)); @@ -4589,7 +4599,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, 6); + rb_define_module_function (ruby_mWeechat, "bar_new", &weechat_ruby_api_bar_new, 8); 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); diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h index 4fdea2b2a..a2df880fa 100644 --- a/src/plugins/weechat-plugin.h +++ b/src/plugins/weechat-plugin.h @@ -376,9 +376,10 @@ struct t_weechat_plugin void (*bar_item_remove) (struct t_gui_bar_item *item); struct t_gui_bar *(*bar_search) (char *name); struct t_gui_bar *(*bar_new) (struct t_weechat_plugin *plugin, char *name, - char *type, char *position, char *size, - char *separator, char *items); - void (*bar_set) (struct t_gui_bar *bar, char *property, char *value); + char *type, char *condition, char *position, + char *size, char *size_max, char *separator, + char *items); + int (*bar_set) (struct t_gui_bar *bar, char *property, char *value); void (*bar_update) (char *name); void (*bar_remove) (struct t_gui_bar *bar); @@ -771,10 +772,11 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin); weechat_plugin->bar_item_remove(__item) #define weechat_bar_search(__name) \ weechat_plugin->bar_search(__name) -#define weechat_bar_new(__name, __type, __position, __size, \ - __separator, __items) \ - weechat_plugin->bar_new(weechat_plugin, __name, __type, __position, \ - __size, __separator, __items) +#define weechat_bar_new(__name, __type, __condition, __position, \ + __size, __size_max, __separator, __items) \ + weechat_plugin->bar_new(weechat_plugin, __name, __type, \ + __condition, __position, __size, \ + __size_max, __separator, __items) #define weechat_bar_set(__bar, __property, __value) \ weechat_plugin->bar_set(__bar, __property, __value) #define weechat_bar_update(__name) \ |