From 7d7a56214cc1bd42a23bf915f3960e0edd8d710d Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 4 Jul 2008 18:52:19 +0000 Subject: implemented $window.highlighLevel (feature request #164) example usage: /echo $window.highlightLevel($channel(#name)); git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1998 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/window/libkviwindow.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/modules/window') diff --git a/src/modules/window/libkviwindow.cpp b/src/modules/window/libkviwindow.cpp index d48910271..1d39d88a6 100644 --- a/src/modules/window/libkviwindow.cpp +++ b/src/modules/window/libkviwindow.cpp @@ -657,6 +657,37 @@ static bool window_kvs_fnc_exists(KviKvsModuleFunctionCall * c) return true; } +/* + @doc: window.highlightLevel + @type: + function + @title: + $window.highlightLevel + @short: + Returns the current highlight (alert) level of a window + @syntax: + $window.highlightLevel + $window.highlightLevel() + @description: + @seealso: + [fnc]$window.activityTemperature[/fnc] + [fnc]$window.activityLevel[/fnc] +*/ + +static bool window_kvs_fnc_highlightLevel(KviKvsModuleFunctionCall * c) +{ + GET_KVS_FNC_WINDOW_ID + if(pWnd) + { + unsigned int v; + pWnd->highlightMeter(&v); + c->returnValue()->setInteger(v); + } else { + c->returnValue()->setInteger(0); + } + return true; +} + /* @doc: window.type @type: @@ -1466,6 +1497,7 @@ static bool window_module_init(KviModule *m) KVSM_REGISTER_FUNCTION(m,"activityTemperature",window_kvs_fnc_activityTemperature); KVSM_REGISTER_FUNCTION(m,"activityLevel",window_kvs_fnc_activityLevel); + KVSM_REGISTER_FUNCTION(m,"highlightLevel",window_kvs_fnc_highlightLevel); KVSM_REGISTER_FUNCTION(m,"console",window_kvs_fnc_console); KVSM_REGISTER_FUNCTION(m,"hasUserFocus",window_kvs_fnc_hasUserFocus); KVSM_REGISTER_FUNCTION(m,"hasOutput",window_kvs_fnc_hasOutput); @@ -1480,6 +1512,7 @@ static bool window_module_init(KviModule *m) KVSM_REGISTER_FUNCTION(m,"inputText",window_kvs_fnc_inputText); KVSM_REGISTER_FUNCTION(m,"context",window_kvs_fnc_context); + //KVSM_REGISTER_SIMPLE_COMMAND(m,"highlight",window_kvs_cmd_highlight); KVSM_REGISTER_SIMPLE_COMMAND(m,"close",window_kvs_cmd_close); KVSM_REGISTER_SIMPLE_COMMAND(m,"clearOutput",window_kvs_cmd_clearOutput); KVSM_REGISTER_SIMPLE_COMMAND(m,"dock",window_kvs_cmd_dock); -- cgit v1.3.1-10-gc9f91