aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/window
diff options
context:
space:
mode:
authorGravatar Szymon Tomasz Stefanek2008-01-02 04:06:48 +0000
committerGravatar Szymon Tomasz Stefanek2008-01-02 04:06:48 +0000
commit8e1fb06c090490317072f80b6b23838263186bc9 (patch)
treed82e4156ff900e105e5af599879f2df99a380520 /src/modules/window
parentReadded credits. (diff)
downloadKVIrc-8e1fb06c090490317072f80b6b23838263186bc9.tar.gz
KVIrc-8e1fb06c090490317072f80b6b23838263186bc9.tar.bz2
KVIrc-8e1fb06c090490317072f80b6b23838263186bc9.zip
Added context module
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1050 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/window')
-rw-r--r--src/modules/window/libkviwindow.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/modules/window/libkviwindow.cpp b/src/modules/window/libkviwindow.cpp
index 49baaa6b4..fee311552 100644
--- a/src/modules/window/libkviwindow.cpp
+++ b/src/modules/window/libkviwindow.cpp
@@ -687,6 +687,34 @@ static bool window_kvs_fnc_type(KviKvsModuleFunctionCall * c)
}
/*
+ @doc: window.context
+ @type:
+ function
+ @title:
+ $window.context
+ @short:
+ Returns the IRC context of a window
+ @syntax:
+ $window.context
+ $window.context(<window_id>)
+ @description:
+ Returns the IRC context of the window with the specified <window_id>.[br]
+ The form with no parameters returns the IRC context of the current window.[br]
+ If the window with the specified id does not exist, an empty string is returned.[br]
+ @seealso:
+*/
+
+static bool window_kvs_fnc_context(KviKvsModuleFunctionCall * c)
+{
+ GET_KVS_FNC_WINDOW_ID
+ if(pWnd)
+ {
+ c->returnValue()->setInteger(pWnd->console() ? pWnd->console()->ircContextId() : 0);
+ }
+ return true;
+}
+
+/*
@doc: window.caption
@type:
function
@@ -1450,6 +1478,7 @@ static bool window_module_init(KviModule *m)
KVSM_REGISTER_FUNCTION(m,"list",window_kvs_fnc_list);
KVSM_REGISTER_FUNCTION(m,"open",window_kvs_fnc_open);
KVSM_REGISTER_FUNCTION(m,"inputText",window_kvs_fnc_inputText);
+ KVSM_REGISTER_FUNCTION(m,"context",window_kvs_fnc_context);
KVSM_REGISTER_SIMPLE_COMMAND(m,"close",window_kvs_cmd_close);
KVSM_REGISTER_SIMPLE_COMMAND(m,"clearOutput",window_kvs_cmd_clearOutput);