mirror of
https://github.com/weechat/weechat.git
synced 2026-06-27 21:36:37 +02:00
Add current_window function in plugin API, add window functions in english developer guide
This commit is contained in:
@@ -3605,7 +3605,7 @@ weechat_tcl_api_current_buffer (ClientData clientData, Tcl_Interp *interp,
|
||||
TCL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
result = script_ptr2str (weechat_current_buffer);
|
||||
result = script_ptr2str (weechat_current_buffer ());
|
||||
|
||||
TCL_RETURN_STRING_FREE(result);
|
||||
}
|
||||
@@ -3818,6 +3818,33 @@ weechat_tcl_api_buffer_set (ClientData clientData, Tcl_Interp *interp,
|
||||
TCL_RETURN_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_tcl_api_current_window: get current window
|
||||
*/
|
||||
|
||||
static int
|
||||
weechat_tcl_api_current_window (ClientData clientData, Tcl_Interp *interp,
|
||||
int objc, Tcl_Obj *CONST objv[])
|
||||
{
|
||||
Tcl_Obj *objp;
|
||||
char *result;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) clientData;
|
||||
(void) objc;
|
||||
(void) objv;
|
||||
|
||||
if (!tcl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("current_window");
|
||||
TCL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
result = script_ptr2str (weechat_current_window ());
|
||||
|
||||
TCL_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_tcl_api_window_get_integer: get a window property as integer
|
||||
*/
|
||||
@@ -5378,6 +5405,8 @@ void weechat_tcl_api_init (Tcl_Interp *interp) {
|
||||
weechat_tcl_api_buffer_get_pointer, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
||||
Tcl_CreateObjCommand (interp,"weechat::buffer_set",
|
||||
weechat_tcl_api_buffer_set, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
||||
Tcl_CreateObjCommand (interp,"weechat::current_window",
|
||||
weechat_tcl_api_current_window, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
||||
Tcl_CreateObjCommand (interp,"weechat::window_get_integer",
|
||||
weechat_tcl_api_window_get_integer, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
||||
Tcl_CreateObjCommand (interp,"weechat::window_get_string",
|
||||
|
||||
Reference in New Issue
Block a user