1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 12:26:40 +02:00

Remove infobar

This commit is contained in:
Sebastien Helleu
2008-06-21 11:49:11 +02:00
parent 2c04e97523
commit 9d05dcf175
45 changed files with 267 additions and 1505 deletions
-77
View File
@@ -2176,81 +2176,6 @@ weechat_lua_api_print_y (lua_State *L)
LUA_RETURN_OK;
}
/*
* 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 },
@@ -1791,64 +1791,6 @@ static XS (XS_weechat_print_y)
PERL_RETURN_OK;
}
/*
* 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");
@@ -1904,72 +1904,6 @@ weechat_python_api_prnt_y (PyObject *self, PyObject *args)
PYTHON_RETURN_OK;
}
/*
* 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, "" },
@@ -2199,87 +2199,6 @@ weechat_ruby_api_print_y (VALUE class, VALUE buffer, VALUE y, VALUE message)
RUBY_RETURN_OK;
}
/*
* 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);
-25
View File
@@ -535,31 +535,6 @@ script_api_printf_y (struct t_weechat_plugin *weechat_plugin,
free (buf2);
}
/*
* 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
*/
-4
View File
@@ -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, ...);