summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-config.c4
-rw-r--r--src/gui/curses/gui-curses-main.c4
-rw-r--r--src/gui/curses/gui-curses-window.c142
-rw-r--r--src/gui/curses/gui-curses.h3
-rw-r--r--src/gui/gtk/gui-gtk-main.c4
-rw-r--r--src/gui/gtk/gui-gtk-window.c16
-rw-r--r--src/gui/gtk/gui-gtk.h3
-rw-r--r--src/gui/gui-window.h3
-rw-r--r--src/plugins/plugin.c1
-rw-r--r--src/plugins/scripts/lua/weechat-lua-api.c37
-rw-r--r--src/plugins/scripts/perl/weechat-perl-api.c29
-rw-r--r--src/plugins/scripts/python/weechat-python-api.c38
-rw-r--r--src/plugins/scripts/ruby/weechat-ruby-api.c34
-rw-r--r--src/plugins/scripts/tcl/weechat-tcl-api.c36
-rw-r--r--src/plugins/weechat-plugin.h5
15 files changed, 263 insertions, 96 deletions
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 4dcb0afa4..faf305292 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -214,9 +214,9 @@ config_change_title (void *data, struct t_config_option *option)
(void) option;
if (CONFIG_BOOLEAN(config_look_set_title))
- gui_window_title_set ();
+ gui_window_set_title (PACKAGE_NAME " " PACKAGE_VERSION);
else
- gui_window_title_reset ();
+ gui_window_set_title (NULL);
}
/*
diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c
index ce6571101..f6258d6f4 100644
--- a/src/gui/curses/gui-curses-main.c
+++ b/src/gui/curses/gui-curses-main.c
@@ -135,7 +135,7 @@ gui_main_init ()
gui_current_window = gui_windows;
if (CONFIG_BOOLEAN(config_look_set_title))
- gui_window_title_set ();
+ gui_window_set_title (PACKAGE_NAME " " PACKAGE_VERSION);
}
/* create bar windows for root bars (they were read from config,
@@ -382,7 +382,7 @@ gui_main_end (int clean_exit)
/* reset title */
if (CONFIG_BOOLEAN(config_look_set_title))
- gui_window_title_reset ();
+ gui_window_set_title (NULL);
/* end color */
gui_color_end ();
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index d60e37fb8..03195c672 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -1372,83 +1372,89 @@ gui_window_refresh_screen (int full_refresh)
}
/*
- * gui_window_title_set: set terminal title
+ * gui_window_set_title: set terminal title
*/
void
-gui_window_title_set ()
-{
- char *envterm = getenv ("TERM");
-
- if (envterm)
- {
- if (strcmp( envterm, "sun-cmd") == 0)
- printf ("\033]l%s %s\033\\", PACKAGE_NAME, PACKAGE_VERSION);
- else if (strcmp(envterm, "hpterm") == 0)
- printf ("\033&f0k%dD%s %s",
- (int)(strlen(PACKAGE_NAME) + strlen(PACKAGE_VERSION) + 1),
- PACKAGE_NAME, PACKAGE_VERSION);
- /* the following term supports the xterm excapes */
- else if (strncmp (envterm, "xterm", 5) == 0
- || strncmp (envterm, "rxvt", 4) == 0
- || strcmp (envterm, "Eterm") == 0
- || strcmp (envterm, "aixterm") == 0
- || strcmp (envterm, "iris-ansi") == 0
- || strcmp (envterm, "dtterm") == 0)
- printf ("\33]0;%s %s\7", PACKAGE_NAME, PACKAGE_VERSION);
- else if (strcmp (envterm, "screen") == 0)
- {
- printf ("\033k%s %s\033\\", PACKAGE_NAME, PACKAGE_VERSION);
- /* tryning to set the title of a backgrounded xterm like terminal */
- printf ("\33]0;%s %s\7", PACKAGE_NAME, PACKAGE_VERSION);
- }
- }
-}
-
-/*
- * gui_window_title_reset: reset terminal title
- */
-
-void
-gui_window_title_reset ()
+gui_window_set_title (const char *title)
{
char *shell, *shellname;
char *envterm = getenv ("TERM");
char *envshell = getenv ("SHELL");
-
+
if (envterm)
{
- if (strcmp( envterm, "sun-cmd") == 0)
- printf ("\033]l%s\033\\", "Terminal");
- else if (strcmp( envterm, "hpterm") == 0)
- printf ("\033&f0k%dD%s", (int)strlen("Terminal"), "Terminal");
- /* the following term supports the xterm excapes */
- else if (strncmp (envterm, "xterm", 5) == 0
- || strncmp (envterm, "rxvt", 4) == 0
- || strcmp (envterm, "Eterm") == 0
- || strcmp( envterm, "aixterm") == 0
- || strcmp( envterm, "iris-ansi") == 0
- || strcmp( envterm, "dtterm") == 0)
- printf ("\33]0;%s\7", "Terminal");
- else if (strcmp (envterm, "screen") == 0)
- {
- if (envshell)
- {
- shell = strdup (envshell);
- if (shell)
- {
- shellname = basename (shell);
- printf ("\033k%s\033\\", (shellname) ? shellname : shell);
- free (shell);
- }
- else
- printf ("\033k%s\033\\", envterm);
- }
- else
- printf ("\033k%s\033\\", envterm);
- /* tryning to reset the title of a backgrounded xterm like terminal */
- printf ("\33]0;%s\7", "Terminal");
- }
+ if (title && title[0])
+ {
+ if (strcmp (envterm, "sun-cmd") == 0)
+ {
+ printf ("\033]l%s\033\\", title);
+ }
+ else if (strcmp (envterm, "hpterm") == 0)
+ {
+ printf ("\033&f0k%dD%s", (int)(strlen(title) + 1), title);
+ }
+ /* the following term supports the xterm excapes */
+ else if ((strncmp (envterm, "xterm", 5) == 0)
+ || (strncmp (envterm, "rxvt", 4) == 0)
+ || (strcmp (envterm, "Eterm") == 0)
+ || (strcmp (envterm, "aixterm") == 0)
+ || (strcmp (envterm, "iris-ansi") == 0)
+ || (strcmp (envterm, "dtterm") == 0))
+ {
+ printf ("\33]0;%s\7", title);
+ }
+ else if (strcmp (envterm, "screen") == 0)
+ {
+ printf ("\033k%s\033\\", title);
+ /* tryning to set the title of a backgrounded xterm like terminal */
+ printf ("\33]0;%s\7", title);
+ }
+ }
+ else
+ {
+ if (strcmp (envterm, "sun-cmd") == 0)
+ {
+ printf ("\033]l%s\033\\", "Terminal");
+ }
+ else if (strcmp (envterm, "hpterm") == 0)
+ {
+ printf ("\033&f0k%dD%s", (int)strlen("Terminal"), "Terminal");
+ }
+ /* the following term supports the xterm excapes */
+ else if ((strncmp (envterm, "xterm", 5) == 0)
+ || (strncmp (envterm, "rxvt", 4) == 0)
+ || (strcmp (envterm, "Eterm") == 0)
+ || (strcmp( envterm, "aixterm") == 0)
+ || (strcmp( envterm, "iris-ansi") == 0)
+ || (strcmp( envterm, "dtterm") == 0))
+ {
+ printf ("\33]0;%s\7", "Terminal");
+ }
+ else if (strcmp (envterm, "screen") == 0)
+ {
+ if (envshell)
+ {
+ shell = strdup (envshell);
+ if (shell)
+ {
+ shellname = basename (shell);
+ printf ("\033k%s\033\\", (shellname) ? shellname : shell);
+ free (shell);
+ }
+ else
+ {
+ printf ("\033k%s\033\\", envterm);
+ }
+ }
+ else
+ {
+ printf ("\033k%s\033\\", envterm);
+ }
+ /* tryning to reset the title of a backgrounded xterm like terminal */
+ printf ("\33]0;%s\7", "Terminal");
+ }
+ }
}
}
diff --git a/src/gui/curses/gui-curses.h b/src/gui/curses/gui-curses.h
index a5125c0d3..3f7783b6b 100644
--- a/src/gui/curses/gui-curses.h
+++ b/src/gui/curses/gui-curses.h
@@ -83,7 +83,6 @@ extern void gui_window_set_custom_color_fg_bg (WINDOW *window, int fg, int bg);
extern void gui_window_set_custom_color_fg (WINDOW *window, int fg);
extern void gui_window_set_custom_color_bg (WINDOW *window, int bg);
extern void gui_window_clrtoeol_with_current_bg (WINDOW *window);
-extern void gui_window_title_set ();
-extern void gui_window_title_reset ();
+extern void gui_window_set_title (const char *title);
#endif /* gui-curses.h */
diff --git a/src/gui/gtk/gui-gtk-main.c b/src/gui/gtk/gui-gtk-main.c
index bc5d2d6b7..eff99b2c2 100644
--- a/src/gui/gtk/gui-gtk-main.c
+++ b/src/gui/gtk/gui-gtk-main.c
@@ -192,7 +192,7 @@ gui_main_init ()
gui_current_window = gui_windows;
if (CONFIG_BOOLEAN(config_look_set_title))
- gui_window_title_set ();
+ gui_window_set_title (PACKAGE_NAME " " PACKAGE_VERSION);
}
/* create bar windows for root bars (they were read from config,
@@ -270,7 +270,7 @@ gui_main_end (int clean_exit)
/* reset title */
if (CONFIG_BOOLEAN(config_look_set_title))
- gui_window_title_reset ();
+ gui_window_set_title (NULL);
/* end color */
gui_color_end ();
diff --git a/src/gui/gtk/gui-gtk-window.c b/src/gui/gtk/gui-gtk-window.c
index 627448c2e..5d1abe61b 100644
--- a/src/gui/gtk/gui-gtk-window.c
+++ b/src/gui/gtk/gui-gtk-window.c
@@ -786,26 +786,18 @@ gui_window_refresh_screen (int full_refresh)
}
/*
- * gui_window_title_set: set terminal title
+ * gui_window_set_title: set terminal title
*/
void
-gui_window_title_set ()
+gui_window_set_title (const char *title)
{
+ (void) title;
+
/* TODO: write this function for Gtk */
}
/*
- * gui_window_title_reset: reset terminal title
- */
-
-void
-gui_window_title_reset ()
-{
- /* This function does nothing in Gtk GUI */
-}
-
-/*
* gui_window_objects_print_log: print Gtk objects infos in log
* (usually for crash dump)
*/
diff --git a/src/gui/gtk/gui-gtk.h b/src/gui/gtk/gui-gtk.h
index bab6a7960..a7955cf13 100644
--- a/src/gui/gtk/gui-gtk.h
+++ b/src/gui/gtk/gui-gtk.h
@@ -103,7 +103,6 @@ extern void gui_keyboard_flush ();
/* window functions */
extern void gui_window_redraw_buffer (struct t_gui_buffer *buffer);
-extern void gui_window_title_set ();
-extern void gui_window_title_reset ();
+extern void gui_window_set_title (const char *title);
#endif /* gui-gtk.h */
diff --git a/src/gui/gui-window.h b/src/gui/gui-window.h
index ae81801c7..2c0afd74d 100644
--- a/src/gui/gui-window.h
+++ b/src/gui/gui-window.h
@@ -171,8 +171,7 @@ extern void gui_window_switch_down (struct t_gui_window *window);
extern void gui_window_switch_left (struct t_gui_window *window);
extern void gui_window_switch_right (struct t_gui_window *window);
extern void gui_window_refresh_screen (int full_refresh);
-extern void gui_window_title_set ();
-extern void gui_window_title_reset ();
+extern void gui_window_set_title (const char *title);
extern void gui_window_objects_print_log (struct t_gui_window *window);
#endif /* gui-window.h */
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index 06428efad..623e802cc 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -527,6 +527,7 @@ plugin_load (const char *filename)
new_plugin->window_get_integer = &gui_window_get_integer;
new_plugin->window_get_string = &gui_window_get_string;
new_plugin->window_get_pointer = &gui_window_get_pointer;
+ new_plugin->window_set_title = &gui_window_set_title;
new_plugin->nicklist_add_group = &gui_nicklist_add_group;
new_plugin->nicklist_search_group = &gui_nicklist_search_group;
diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c
index 854fc16a8..a19eb6b34 100644
--- a/src/plugins/scripts/lua/weechat-lua-api.c
+++ b/src/plugins/scripts/lua/weechat-lua-api.c
@@ -5003,6 +5003,42 @@ weechat_lua_api_window_get_pointer (lua_State *L)
}
/*
+ * weechat_lua_api_window_set_title: set window title
+ */
+
+static int
+weechat_lua_api_window_set_title (lua_State *L)
+{
+ const char *title;
+ int n;
+
+ /* make C compiler happy */
+ (void) L;
+
+ if (!lua_current_script)
+ {
+ WEECHAT_SCRIPT_MSG_NOT_INIT(LUA_CURRENT_SCRIPT_NAME, "window_set_title");
+ LUA_RETURN_ERROR;
+ }
+
+ title = NULL;
+
+ n = lua_gettop (lua_current_interpreter);
+
+ if (n < 1)
+ {
+ WEECHAT_SCRIPT_MSG_WRONG_ARGS(LUA_CURRENT_SCRIPT_NAME, "window_set_title");
+ LUA_RETURN_ERROR;
+ }
+
+ title = lua_tostring (lua_current_interpreter, -1);
+
+ weechat_window_set_title (title);
+
+ LUA_RETURN_OK;
+}
+
+/*
* weechat_lua_api_nicklist_add_group: add a group in nicklist
*/
@@ -7050,6 +7086,7 @@ const struct luaL_reg weechat_lua_api_funcs[] = {
{ "window_get_integer", &weechat_lua_api_window_get_integer },
{ "window_get_string", &weechat_lua_api_window_get_string },
{ "window_get_pointer", &weechat_lua_api_window_get_pointer },
+ { "window_set_title", &weechat_lua_api_window_set_title },
{ "nicklist_add_group", &weechat_lua_api_nicklist_add_group },
{ "nicklist_search_group", &weechat_lua_api_nicklist_search_group },
{ "nicklist_add_nick", &weechat_lua_api_nicklist_add_nick },
diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c
index 0b99bc2cf..419f8b45b 100644
--- a/src/plugins/scripts/perl/weechat-perl-api.c
+++ b/src/plugins/scripts/perl/weechat-perl-api.c
@@ -4268,6 +4268,34 @@ static XS (XS_weechat_api_window_get_pointer)
}
/*
+ * weechat::window_set_title: set window title
+ */
+
+static XS (XS_weechat_api_window_set_title)
+{
+ dXSARGS;
+
+ /* make C compiler happy */
+ (void) cv;
+
+ if (!perl_current_script)
+ {
+ WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "window_set_title");
+ PERL_RETURN_ERROR;
+ }
+
+ if (items < 1)
+ {
+ WEECHAT_SCRIPT_MSG_WRONG_ARGS(PERL_CURRENT_SCRIPT_NAME, "window_set_title");
+ PERL_RETURN_ERROR;
+ }
+
+ weechat_window_set_title (SvPV (ST (0), PL_na)); /* title */
+
+ PERL_RETURN_OK;
+}
+
+/*
* weechat::nicklist_add_group: add a group in nicklist
*/
@@ -5657,6 +5685,7 @@ weechat_perl_api_init (pTHX)
newXS ("weechat::window_get_integer", XS_weechat_api_window_get_integer, "weechat");
newXS ("weechat::window_get_string", XS_weechat_api_window_get_string, "weechat");
newXS ("weechat::window_get_pointer", XS_weechat_api_window_get_pointer, "weechat");
+ newXS ("weechat::window_set_title", XS_weechat_api_window_set_title, "weechat");
newXS ("weechat::nicklist_add_group", XS_weechat_api_nicklist_add_group, "weechat");
newXS ("weechat::nicklist_search_group", XS_weechat_api_nicklist_search_group, "weechat");
newXS ("weechat::nicklist_add_nick", XS_weechat_api_nicklist_add_nick, "weechat");
diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c
index 45282370f..6cf94d2e3 100644
--- a/src/plugins/scripts/python/weechat-python-api.c
+++ b/src/plugins/scripts/python/weechat-python-api.c
@@ -4298,7 +4298,7 @@ weechat_python_api_buffer_get_pointer (PyObject *self, PyObject *args)
if (!python_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INIT(PYTHON_CURRENT_SCRIPT_NAME, "buffer_get_pointer");
- PYTHON_RETURN_ERROR;
+ PYTHON_RETURN_EMPTY;
}
buffer = NULL;
@@ -4425,7 +4425,7 @@ weechat_python_api_window_get_string (PyObject *self, PyObject *args)
if (!python_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INIT(PYTHON_CURRENT_SCRIPT_NAME, "window_get_string");
- PYTHON_RETURN_ERROR;
+ PYTHON_RETURN_EMPTY;
}
window = NULL;
@@ -4458,7 +4458,7 @@ weechat_python_api_window_get_pointer (PyObject *self, PyObject *args)
if (!python_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INIT(PYTHON_CURRENT_SCRIPT_NAME, "window_get_pointer");
- PYTHON_RETURN_ERROR;
+ PYTHON_RETURN_EMPTY;
}
window = NULL;
@@ -4477,6 +4477,37 @@ weechat_python_api_window_get_pointer (PyObject *self, PyObject *args)
}
/*
+ * weechat_python_api_window_set_title: set window title
+ */
+
+static PyObject *
+weechat_python_api_window_set_title (PyObject *self, PyObject *args)
+{
+ char *title;
+
+ /* make C compiler happy */
+ (void) self;
+
+ if (!python_current_script)
+ {
+ WEECHAT_SCRIPT_MSG_NOT_INIT(PYTHON_CURRENT_SCRIPT_NAME, "window_set_title");
+ PYTHON_RETURN_ERROR;
+ }
+
+ title = NULL;
+
+ if (!PyArg_ParseTuple (args, "s", &title))
+ {
+ WEECHAT_SCRIPT_MSG_WRONG_ARGS(PYTHON_CURRENT_SCRIPT_NAME, "window_set_title");
+ PYTHON_RETURN_ERROR;
+ }
+
+ weechat_window_set_title (title);
+
+ PYTHON_RETURN_OK;
+}
+
+/*
* weechat_python_api_nicklist_add_group: add a group in nicklist
*/
@@ -5932,6 +5963,7 @@ PyMethodDef weechat_python_funcs[] =
{ "window_get_integer", &weechat_python_api_window_get_integer, METH_VARARGS, "" },
{ "window_get_string", &weechat_python_api_window_get_string, METH_VARARGS, "" },
{ "window_get_pointer", &weechat_python_api_window_get_pointer, METH_VARARGS, "" },
+ { "window_set_title", &weechat_python_api_window_set_title, METH_VARARGS, "" },
{ "nicklist_add_group", &weechat_python_api_nicklist_add_group, METH_VARARGS, "" },
{ "nicklist_search_group", &weechat_python_api_nicklist_search_group, METH_VARARGS, "" },
{ "nicklist_add_nick", &weechat_python_api_nicklist_add_nick, METH_VARARGS, "" },
diff --git a/src/plugins/scripts/ruby/weechat-ruby-api.c b/src/plugins/scripts/ruby/weechat-ruby-api.c
index 103d80ed3..082b918bb 100644
--- a/src/plugins/scripts/ruby/weechat-ruby-api.c
+++ b/src/plugins/scripts/ruby/weechat-ruby-api.c
@@ -5146,6 +5146,39 @@ weechat_ruby_api_window_get_pointer (VALUE class, VALUE window, VALUE property)
}
/*
+ * weechat_ruby_api_window_set_title: set window title
+ */
+
+static VALUE
+weechat_ruby_api_window_set_title (VALUE class, VALUE title)
+{
+ char *c_title;
+
+ /* make C compiler happy */
+ (void) class;
+
+ if (!ruby_current_script)
+ {
+ WEECHAT_SCRIPT_MSG_NOT_INIT(RUBY_CURRENT_SCRIPT_NAME, "window_set_title");
+ RUBY_RETURN_ERROR;
+ }
+
+ if (NIL_P (title))
+ {
+ WEECHAT_SCRIPT_MSG_WRONG_ARGS(RUBY_CURRENT_SCRIPT_NAME, "window_set_title");
+ RUBY_RETURN_ERROR;
+ }
+
+ Check_Type (title, T_STRING);
+
+ c_title = STR2CSTR (title);
+
+ weechat_window_set_title (c_title);
+
+ RUBY_RETURN_OK;
+}
+
+/*
* weechat_ruby_api_nicklist_add_group: add a group in nicklist
*/
@@ -6843,6 +6876,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
rb_define_module_function (ruby_mWeechat, "window_get_integer", &weechat_ruby_api_window_get_integer, 2);
rb_define_module_function (ruby_mWeechat, "window_get_string", &weechat_ruby_api_window_get_string, 2);
rb_define_module_function (ruby_mWeechat, "window_get_pointer", &weechat_ruby_api_window_get_pointer, 2);
+ rb_define_module_function (ruby_mWeechat, "window_set_title", &weechat_ruby_api_window_set_title, 1);
rb_define_module_function (ruby_mWeechat, "nicklist_add_group", &weechat_ruby_api_nicklist_add_group, 5);
rb_define_module_function (ruby_mWeechat, "nicklist_search_group", &weechat_ruby_api_nicklist_search_group, 3);
rb_define_module_function (ruby_mWeechat, "nicklist_add_nick", &weechat_ruby_api_nicklist_add_nick, 7);
diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c
index 92f247abc..9fc2e964b 100644
--- a/src/plugins/scripts/tcl/weechat-tcl-api.c
+++ b/src/plugins/scripts/tcl/weechat-tcl-api.c
@@ -4774,6 +4774,40 @@ weechat_tcl_api_window_get_pointer (ClientData clientData, Tcl_Interp *interp,
}
/*
+ * weechat_tcl_api_window_set_title: set window title
+ */
+
+static int
+weechat_tcl_api_window_set_title (ClientData clientData, Tcl_Interp *interp,
+ int objc, Tcl_Obj *CONST objv[])
+{
+ Tcl_Obj *objp;
+ char *title;
+ int i;
+
+ /* make C compiler happy */
+ (void) clientData;
+
+ if (!tcl_current_script)
+ {
+ WEECHAT_SCRIPT_MSG_NOT_INIT(TCL_CURRENT_SCRIPT_NAME, "window_set_title");
+ TCL_RETURN_ERROR;
+ }
+
+ if (objc < 1)
+ {
+ WEECHAT_SCRIPT_MSG_WRONG_ARGS(TCL_CURRENT_SCRIPT_NAME, "window_set_title");
+ TCL_RETURN_ERROR;
+ }
+
+ title = Tcl_GetStringFromObj (objv[1], &i);
+
+ weechat_window_set_title (title);
+
+ TCL_RETURN_OK;
+}
+
+/*
* weechat_tcl_api_nicklist_add_group: add a group in nicklist
*/
@@ -6478,6 +6512,8 @@ void weechat_tcl_api_init (Tcl_Interp *interp)
weechat_tcl_api_window_get_string, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
Tcl_CreateObjCommand (interp, "weechat::window_get_pointer",
weechat_tcl_api_window_get_pointer, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
+ Tcl_CreateObjCommand (interp, "weechat::window_set_title",
+ weechat_tcl_api_window_set_title, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
Tcl_CreateObjCommand (interp, "weechat::nicklist_add_group",
weechat_tcl_api_nicklist_add_group, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
Tcl_CreateObjCommand (interp, "weechat::nicklist_search_group",
diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h
index 9af6bbe16..110d2fc8d 100644
--- a/src/plugins/weechat-plugin.h
+++ b/src/plugins/weechat-plugin.h
@@ -33,7 +33,7 @@ struct t_infolist;
struct t_weelist;
/* API version (used to check that plugin has same API and can be loaded) */
-#define WEECHAT_PLUGIN_API_VERSION "20090502-01"
+#define WEECHAT_PLUGIN_API_VERSION "20090510-01"
/* macros for defining plugin infos */
#define WEECHAT_PLUGIN_NAME(__name) \
@@ -506,6 +506,7 @@ struct t_weechat_plugin
const char *property);
void *(*window_get_pointer) (struct t_gui_window *window,
const char *property);
+ void (*window_set_title) (const char *title);
/* nicklist */
struct t_gui_nick_group *(*nicklist_add_group) (struct t_gui_buffer *buffer,
@@ -1046,6 +1047,8 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
weechat_plugin->window_get_pointer(__window, __property)
#define weechat_current_window() \
weechat_plugin->window_get_pointer(NULL, "current")
+#define weechat_window_set_title(__title) \
+ weechat_plugin->window_set_title(__title)
/* nicklist */
#define weechat_nicklist_add_group(__buffer, __parent_group, __name, \