diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 02:13:59 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 02:13:59 +0000 |
commit | a6d58bb6052ac8cb01805a48c4ad2f129126116f (patch) | |
tree | dd867a099fcbb263a8009a9fb22695b87855dad6 /src/modules/tmphighlight | |
download | kvirc-a6d58bb6052ac8cb01805a48c4ad2f129126116f.tar.gz kvirc-a6d58bb6052ac8cb01805a48c4ad2f129126116f.zip |
Added KDE3 version of kvirc
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1095341 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/modules/tmphighlight')
-rw-r--r-- | src/modules/tmphighlight/Makefile.am | 22 | ||||
-rw-r--r-- | src/modules/tmphighlight/libkvitmphighlight.cpp | 174 |
2 files changed, 196 insertions, 0 deletions
diff --git a/src/modules/tmphighlight/Makefile.am b/src/modules/tmphighlight/Makefile.am new file mode 100644 index 00000000..6e5a02ac --- /dev/null +++ b/src/modules/tmphighlight/Makefile.am @@ -0,0 +1,22 @@ +############################################################################### +# KVirc IRC client Makestr - 10.03.2002 Juanjo �lvarez <[email protected]> +############################################################################### + +AM_CPPFLAGS = -I$(SS_TOPSRCDIR)/src/kvilib/include/ -I$(SS_TOPSRCDIR)/src/kvirc/include/ \ +-I/usr/include/kde/arts\ +$(SS_INCDIRS) $(SS_CPPFLAGS) -DGLOBAL_KVIRC_DIR=\"$(globalkvircdir)\" + +#ARTS_LD_FLAGS = -DPIC -fPIC +#ARTS_C_FLAGS = -L/usr/lib -ldl -lartsc -lpthread +pluglib_LTLIBRARIES = libkvitmphighlight.la + +libkvitmphighlight_la_LDFLAGS = -module -avoid-version $(SS_LDFLAGS) $(SS_LIBDIRS) + +libkvitmphighlight_la_SOURCES = libkvitmphighlight.cpp +libkvitmphighlight_la_LIBADD = $(SS_LIBLINK) ../../kvilib/build/libkvilib.la + + +#noinst_HEADERS= + +%.moc: %.h + $(SS_QT_MOC) $< -o $@ diff --git a/src/modules/tmphighlight/libkvitmphighlight.cpp b/src/modules/tmphighlight/libkvitmphighlight.cpp new file mode 100644 index 00000000..17f4ce17 --- /dev/null +++ b/src/modules/tmphighlight/libkvitmphighlight.cpp @@ -0,0 +1,174 @@ +// File : libkvitmphighlight.cpp +// Creation date : Oct 10 01:06:09 CEST 2002 by Juanjo �varez +// +// This file is part of the KVirc irc client distribution +// Copyright (C) 2002 Juanjo �varez ([email protected]) +// Copyright (C) 2002 Szymon Stefanek ([email protected]) +// +// This program is FREE software. You can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your opinion) any later version. +// +// This program is distributed in the HOPE that it will be USEFUL, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, write to the Free Software Foundation, +// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// + + +#include "kvi_module.h" + +#include "kvi_locale.h" +#include "kvi_channel.h" + +//------------------------------------------------- +/* + @doc: tmphighlight.add + @type: + command + @title: + tmphighlight.add + @short: + Adds a user to the channel temporary highlight list + @syntax: + tmphighlight.add <nick:string> + @description: + This command adds a user to the channel temporary highlight list, so that user messages[br] + will be highlighted until you close the channel. This is useful when you are in a very crowded [br] + channel with lots of conversations running in parallel and you want to follow one of them.[br] + @seealso: + [fnc]$tmphighlight.remove[/fnc] + [fnc]$tmphighlight.ishighlighted[/fnc] +*/ +//------------------------------------------- +// tmphighlight.add +//------------------------------------------- +static bool tmphighlight_kvs_cmd_add(KviKvsModuleCommandCall * c) +{ + + QString szNick; + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("nick",KVS_PT_NONEMPTYSTRING,0,szNick) + KVSM_PARAMETERS_END(c) + if( ( !c->window()->console()) || c->window()->console()->isNotConnected() )return c->context()->errorNoIrcContext(); + if(!c->window()->type() == KVI_WINDOW_TYPE_CHANNEL) + { + c->warning(__tr2qs("Current window is not a channel")); + return false; + } + + ((KviChannel *)c->window())->addHighlightedUser(szNick); + + return true; +} +//------------------------------------------------- +/* + @doc: tmphighlight.remove + @type: + command + @title: + tmphighlight.remove + @short: + Remove a user from the channel temporary highlight list + @syntax: + tmphighlight.remove <nick:string> + @description: + This command remove a user from the channel temporary highlight list, so that user messages[br] + stop being highlighted. + @seealso: + [fnc]$tmphighlight.add[/fnc] + [fnc]$tmphighlight.ishighlighted[/fnc] +*/ +//------------------------------------------- +// tmphighlight.remove +//------------------------------------------- + +static bool tmphighlight_kvs_cmd_remove(KviKvsModuleCommandCall * c) +{ + QString szNick; + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("nick",KVS_PT_NONEMPTYSTRING,0,szNick) + KVSM_PARAMETERS_END(c) + if( ( !c->window()->console()) || c->window()->console()->isNotConnected() )return c->context()->errorNoIrcContext(); + if(!c->window()->type() == KVI_WINDOW_TYPE_CHANNEL) + { + c->warning(__tr2qs("Current window is not a channel")); + return false; + } + + ((KviChannel *)c->window())->removeHighlightedUser(szNick); + return true; +} +//------------------------------------------------- +/* + @doc: tmphighlight.ishighlighted + @type: + function + @title: + $tmphighlight.ishighlighted + @short: + Returns 1 if the user is highlighted on this channel, 0 otherwise + @syntax: + <boolean> $tmphighlight.ishighlighted <nick:string> + @description: + This command returns 1 if the user is highlighted on this channel and on this session of 0 otherwise. + @seealso: + [fnc]$tmphighlight.add[/fnc] + [fnc]$tmphighlight.remove[/fnc] + +*/ +//------------------------------------------- +// tmphighlight.ishighlighted +//------------------------------------------- + +static bool tmphighlight_kvs_fnc_ishighlighted(KviKvsModuleFunctionCall * c) +{ + QString szNick; + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("nick",KVS_PT_NONEMPTYSTRING,0,szNick) + KVSM_PARAMETERS_END(c) + if( ( !c->window()->console()) || c->window()->console()->isNotConnected() )return c->context()->errorNoIrcContext(); + if(!c->window()->type() == KVI_WINDOW_TYPE_CHANNEL) + { + c->warning(__tr2qs("Current window is not a channel")); + return false; + } + c->returnValue()->setBoolean(((KviChannel *)c->window())->isHighlightedUser(szNick)); + return true; +} + +//------------------------------------------------- +static bool tmphighlight_module_init(KviModule * m) +{ + KVSM_REGISTER_SIMPLE_COMMAND(m,"add",tmphighlight_kvs_cmd_add); + KVSM_REGISTER_SIMPLE_COMMAND(m,"remove",tmphighlight_kvs_cmd_remove); + KVSM_REGISTER_FUNCTION(m,"isHighVisible",tmphighlight_kvs_fnc_ishighlighted); + KVSM_REGISTER_FUNCTION(m,"isHighLighted",tmphighlight_kvs_fnc_ishighlighted); + return true; +} +//------------------------------------------------- +static bool tmphighlight_module_cleanup(KviModule *m) +{ + return true; +} +//------------------------------------------------- +static bool tmphighlight_module_can_unload(KviModule *m) +{ + return true; +} +//------------------------------------------------- +KVIRC_MODULE( + "TmpHighlight", // module name + "1.0.0", // module version + " (C) 2002 Juanjo Alvarez ([email protected])", // author & (C) + "Temporal Highlightining of channel users", + tmphighlight_module_init, + tmphighlight_module_can_unload, + 0, + tmphighlight_module_cleanup +) |