diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-06-21 11:49:11 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-06-21 11:49:11 +0200 |
commit | 9d05dcf175ac6a26a1a263ea490df174f78ffc62 (patch) | |
tree | 7cba0b34e51f7a337a87a73c9752e4acf17659aa /src/plugins/scripts | |
parent | 2c04e9752359a603300d5c32f51a11e700f2f023 (diff) | |
download | weechat-9d05dcf175ac6a26a1a263ea490df174f78ffc62.zip |
Remove infobar
Diffstat (limited to 'src/plugins/scripts')
-rw-r--r-- | src/plugins/scripts/lua/weechat-lua-api.c | 77 | ||||
-rw-r--r-- | src/plugins/scripts/perl/weechat-perl-api.c | 60 | ||||
-rw-r--r-- | src/plugins/scripts/python/weechat-python-api.c | 68 | ||||
-rw-r--r-- | src/plugins/scripts/ruby/weechat-ruby-api.c | 83 | ||||
-rw-r--r-- | src/plugins/scripts/script-api.c | 25 | ||||
-rw-r--r-- | src/plugins/scripts/script-api.h | 4 |
6 files changed, 0 insertions, 317 deletions
diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c index ad1ddae0b..0b0db0ff3 100644 --- a/src/plugins/scripts/lua/weechat-lua-api.c +++ b/src/plugins/scripts/lua/weechat-lua-api.c @@ -2177,81 +2177,6 @@ weechat_lua_api_print_y (lua_State *L) } /* - * weechat_lua_api_infobar_print: print message to infobar - */ - -static int -weechat_lua_api_infobar_print (lua_State *L) -{ - const char *color, *message; - int delay, n; - - /* make C compiler happy */ - (void) L; - - if (!lua_current_script) - { - WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("infobar_print"); - LUA_RETURN_ERROR; - } - - delay = 1; - color = NULL; - message = NULL; - - n = lua_gettop (lua_current_interpreter); - - if (n < 3) - { - WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("infobar_print"); - LUA_RETURN_ERROR; - } - - delay = lua_tonumber (lua_current_interpreter, -3); - color = lua_tostring (lua_current_interpreter, -2); - message = lua_tostring (lua_current_interpreter, -1); - - script_api_infobar_printf (weechat_lua_plugin, - lua_current_script, - delay, - color, - "%s", - message); - - LUA_RETURN_OK; -} - -/* - * weechat_lua_api_infobar_remove: remove message(s) in infobar - */ - -static int -weechat_lua_api_infobar_remove (lua_State *L) -{ - int n, how_many; - - /* make C compiler happy */ - (void) L; - - if (!lua_current_script) - { - WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("infobar_remove"); - LUA_RETURN_ERROR; - } - - how_many = 0; - - n = lua_gettop (lua_current_interpreter); - - if (n == 1) - how_many = lua_tonumber (lua_current_interpreter, -1); - - weechat_infobar_remove (how_many); - - LUA_RETURN_OK; -} - -/* * weechat_lua_api_log_print: print message in WeeChat log file */ @@ -5033,8 +4958,6 @@ const struct luaL_reg weechat_lua_api_funcs[] = { { "print", &weechat_lua_api_print }, { "print_date_tags", &weechat_lua_api_print_date_tags }, { "print_y", &weechat_lua_api_print_y }, - { "infobar_print", &weechat_lua_api_infobar_print }, - { "infobar_remove", &weechat_lua_api_infobar_remove }, { "log_print", &weechat_lua_api_log_print }, { "hook_command", &weechat_lua_api_hook_command }, { "hook_timer", &weechat_lua_api_hook_timer }, diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c index 0ae18e0c7..a77fbe329 100644 --- a/src/plugins/scripts/perl/weechat-perl-api.c +++ b/src/plugins/scripts/perl/weechat-perl-api.c @@ -1792,64 +1792,6 @@ static XS (XS_weechat_print_y) } /* - * weechat::infobar_print: print message to infobar - */ - -static XS (XS_weechat_infobar_print) -{ - char *color, *message; - dXSARGS; - - /* make C compiler happy */ - (void) cv; - - if (!perl_current_script) - { - WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("infobar_print"); - PERL_RETURN_ERROR; - } - - if (items < 3) - { - WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("infobar_print"); - PERL_RETURN_ERROR; - } - - color = SvPV (ST (1), PL_na); - message = SvPV (ST (2), PL_na); - script_api_infobar_printf (weechat_perl_plugin, - perl_current_script, - SvIV (ST (0)), /* delay */ - color, - "%s", - message); - - PERL_RETURN_OK; -} - -/* - * weechat::infobar_remove: remove message(s) from infobar - */ - -static XS (XS_weechat_infobar_remove) -{ - dXSARGS; - - /* make C compiler happy */ - (void) cv; - - if (!perl_current_script) - { - WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("infobar_remove"); - PERL_RETURN_ERROR; - } - - weechat_infobar_remove ((items >= 1) ? SvIV (ST (0)) : 0); /* how_many */ - - PERL_RETURN_OK; -} - -/* * weechat::log_print: print message in WeeChat log file */ @@ -3947,8 +3889,6 @@ weechat_perl_api_init (pTHX) newXS ("weechat::print", XS_weechat_print, "weechat"); newXS ("weechat::print_date_tags", XS_weechat_print_date_tags, "weechat"); newXS ("weechat::print_y", XS_weechat_print_y, "weechat"); - newXS ("weechat::infobar_print", XS_weechat_infobar_print, "weechat"); - newXS ("weechat::infobar_remove", XS_weechat_infobar_remove, "weechat"); newXS ("weechat::log_print", XS_weechat_log_print, "weechat"); newXS ("weechat::hook_command", XS_weechat_hook_command, "weechat"); newXS ("weechat::hook_timer", XS_weechat_hook_timer, "weechat"); diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index 7420e1e74..8d7c4f990 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -1905,72 +1905,6 @@ weechat_python_api_prnt_y (PyObject *self, PyObject *args) } /* - * weechat_python_api_infobar_print: print message to infobar - */ - -static PyObject * -weechat_python_api_infobar_print (PyObject *self, PyObject *args) -{ - int delay; - char *color, *message; - - /* make C compiler happy */ - (void) self; - - if (!python_current_script) - { - WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("infobar_print"); - PYTHON_RETURN_ERROR; - } - - delay = 1; - message = NULL; - - if (!PyArg_ParseTuple (args, "iss", &delay, &color, &message)) - { - WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("infobar_print"); - PYTHON_RETURN_ERROR; - } - - script_api_infobar_printf (weechat_python_plugin, - python_current_script, - delay, color, "%s", message); - - PYTHON_RETURN_OK; -} - -/* - * weechat_python_api_infobar_remove: remove message(s) from infobar - */ - -static PyObject * -weechat_python_api_infobar_remove (PyObject *self, PyObject *args) -{ - int how_many; - - /* make C compiler happy */ - (void) self; - - if (!python_current_script) - { - WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("infobar_remove"); - PYTHON_RETURN_ERROR; - } - - how_many = 0; - - if (!PyArg_ParseTuple (args, "|i", &how_many)) - { - WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("infobar_remove"); - PYTHON_RETURN_ERROR; - } - - weechat_infobar_remove (how_many); - - PYTHON_RETURN_OK; -} - -/* * weechat_python_api_log_print: print message in WeeChat log file */ @@ -4197,8 +4131,6 @@ PyMethodDef weechat_python_funcs[] = { "prnt", &weechat_python_api_prnt, METH_VARARGS, "" }, { "prnt_date_tags", &weechat_python_api_prnt_date_tags, METH_VARARGS, "" }, { "prnt_y", &weechat_python_api_prnt_y, METH_VARARGS, "" }, - { "infobar_print", &weechat_python_api_infobar_print, METH_VARARGS, "" }, - { "infobar_remove", &weechat_python_api_infobar_remove, METH_VARARGS, "" }, { "log_print", &weechat_python_api_log_print, METH_VARARGS, "" }, { "hook_command", &weechat_python_api_hook_command, METH_VARARGS, "" }, { "hook_timer", &weechat_python_api_hook_timer, METH_VARARGS, "" }, diff --git a/src/plugins/scripts/ruby/weechat-ruby-api.c b/src/plugins/scripts/ruby/weechat-ruby-api.c index b63a0f59a..92e07af80 100644 --- a/src/plugins/scripts/ruby/weechat-ruby-api.c +++ b/src/plugins/scripts/ruby/weechat-ruby-api.c @@ -2200,87 +2200,6 @@ weechat_ruby_api_print_y (VALUE class, VALUE buffer, VALUE y, VALUE message) } /* - * weechat_ruby_api_infobar_print: print message to infobar - */ - -static VALUE -weechat_ruby_api_infobar_print (VALUE class, VALUE delay, VALUE color, - VALUE message) -{ - int c_delay; - char *c_color, *c_message; - - /* make C compiler happy */ - (void) class; - - if (!ruby_current_script) - { - WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("infobar_print"); - RUBY_RETURN_ERROR; - } - - c_delay = 1; - c_color = NULL; - c_message = NULL; - - if (NIL_P (delay) || NIL_P (color) || NIL_P (message)) - { - WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("infobar_print"); - RUBY_RETURN_ERROR; - } - - Check_Type (delay, T_FIXNUM); - Check_Type (color, T_STRING); - Check_Type (message, T_STRING); - - c_delay = FIX2INT (delay); - c_color = STR2CSTR (color); - c_message = STR2CSTR (message); - - script_api_infobar_printf (weechat_ruby_plugin, - ruby_current_script, - c_delay, c_color, "%s", c_message); - - RUBY_RETURN_OK; -} - -/* - * weechat_ruby_api_infobar_remove: remove message(s) from infobar - */ - -static VALUE -weechat_ruby_api_infobar_remove (int argc, VALUE *argv, VALUE class) -{ - VALUE how_many; - int c_how_many; - - /* make C compiler happy */ - (void) class; - - if (!ruby_current_script) - { - WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("infobar_remove"); - RUBY_RETURN_ERROR; - } - - how_many = Qnil; - - rb_scan_args (argc, argv, "01", &how_many); - - if (!NIL_P (how_many)) - { - Check_Type (how_many, T_FIXNUM); - c_how_many = FIX2INT (how_many); - } - else - c_how_many = 0; - - weechat_infobar_remove (c_how_many); - - RUBY_RETURN_OK; -} - -/* * weechat_ruby_api_log_print: print message in WeeChat log file */ @@ -4840,8 +4759,6 @@ weechat_ruby_api_init (VALUE ruby_mWeechat) rb_define_module_function (ruby_mWeechat, "print", &weechat_ruby_api_print, 2); rb_define_module_function (ruby_mWeechat, "print_date_tags", &weechat_ruby_api_print_date_tags, 4); rb_define_module_function (ruby_mWeechat, "print_y", &weechat_ruby_api_print_y, 3); - rb_define_module_function (ruby_mWeechat, "infobar_print", &weechat_ruby_api_infobar_print, 3); - rb_define_module_function (ruby_mWeechat, "infobar_remove", &weechat_ruby_api_infobar_remove, -1); rb_define_module_function (ruby_mWeechat, "log_print", &weechat_ruby_api_log_print, 1); rb_define_module_function (ruby_mWeechat, "hook_command", &weechat_ruby_api_hook_command, 6); rb_define_module_function (ruby_mWeechat, "hook_timer", &weechat_ruby_api_hook_timer, 4); diff --git a/src/plugins/scripts/script-api.c b/src/plugins/scripts/script-api.c index a00f48d66..6c2d5a743 100644 --- a/src/plugins/scripts/script-api.c +++ b/src/plugins/scripts/script-api.c @@ -536,31 +536,6 @@ script_api_printf_y (struct t_weechat_plugin *weechat_plugin, } /* - * script_api_infobar_printf: print a message in infobar - */ - -void -script_api_infobar_printf (struct t_weechat_plugin *weechat_plugin, - struct t_plugin_script *script, - int delay, const char *color_name, - const char *format, ...) -{ - va_list argptr; - char buf[1024]; - char *buf2; - - va_start (argptr, format); - vsnprintf (buf, sizeof (buf) - 1, format, argptr); - va_end (argptr); - - buf2 = (script->charset && script->charset[0]) ? - weechat_iconv_to_internal (script->charset, buf) : NULL; - weechat_infobar_printf (delay, color_name, "%s", (buf2) ? buf2 : buf); - if (buf2) - free (buf2); -} - -/* * script_api_log_printf: add a message in WeeChat log file */ diff --git a/src/plugins/scripts/script-api.h b/src/plugins/scripts/script-api.h index 9a8270775..573fab44f 100644 --- a/src/plugins/scripts/script-api.h +++ b/src/plugins/scripts/script-api.h @@ -80,10 +80,6 @@ extern void script_api_printf_y (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *script, struct t_gui_buffer *buffer, int y, const char *format, ...); -extern void script_api_infobar_printf (struct t_weechat_plugin *weechat_plugin, - struct t_plugin_script *script, - int delay, const char *color_name, - const char *format, ...); extern void script_api_log_printf (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *script, const char *format, ...); |