diff options
| author | 2006-12-18 01:34:15 +0000 | |
|---|---|---|
| committer | 2006-12-18 01:34:15 +0000 | |
| commit | c75b9f00eaeee4b8503ba662b3d7ccc9e1914096 (patch) | |
| tree | a5e7ee244fa4124588a114732c4ecbc248c7c199 /src/modules/window | |
| parent | Switching from cvs to svn, initial import (diff) | |
| download | KVIrc-c75b9f00eaeee4b8503ba662b3d7ccc9e1914096.tar.gz KVIrc-c75b9f00eaeee4b8503ba662b3d7ccc9e1914096.tar.bz2 KVIrc-c75b9f00eaeee4b8503ba662b3d7ccc9e1914096.zip | |
Switching from cvs to svn, initial import
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@14 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/window')
| -rw-r--r-- | src/modules/window/.svnignore | 11 | ||||
| -rw-r--r-- | src/modules/window/Makefile.am | 21 | ||||
| -rw-r--r-- | src/modules/window/kviwindow.dsp | 146 | ||||
| -rw-r--r-- | src/modules/window/kviwindow.dsw | 29 | ||||
| -rw-r--r-- | src/modules/window/libkviwindow.cpp | 1517 | ||||
| -rw-r--r-- | src/modules/window/userwindow.cpp | 107 | ||||
| -rw-r--r-- | src/modules/window/userwindow.h | 48 | ||||
| -rwxr-xr-x | src/modules/window/window.vcproj | 174 | ||||
| -rw-r--r-- | src/modules/window/window_vc05.vcproj | 261 |
9 files changed, 2314 insertions, 0 deletions
diff --git a/src/modules/window/.svnignore b/src/modules/window/.svnignore new file mode 100644 index 000000000..06614f0eb --- /dev/null +++ b/src/modules/window/.svnignore @@ -0,0 +1,11 @@ +Makefile.in +Makefile +.deps +*.o +*.lo +*.la +*.moc +.libs +.mospics +.pics +moc_*.cpp diff --git a/src/modules/window/Makefile.am b/src/modules/window/Makefile.am new file mode 100644 index 000000000..529129257 --- /dev/null +++ b/src/modules/window/Makefile.am @@ -0,0 +1,21 @@ +############################################################################### +# KVirc IRC client Makefile - 10.03.2000 Szymon Stefanek <stefanek@tin.it> +############################################################################### + +AM_CPPFLAGS = -I$(SS_TOPSRCDIR)/src/kvilib/include/ -I$(SS_TOPSRCDIR)/src/kvirc/include/ \ +$(SS_INCDIRS) $(SS_CPPFLAGS) -DGLOBAL_KVIRC_DIR=\"$(globalkvircdir)\" + +pluglib_LTLIBRARIES = libkviwindow.la + +libkviwindow_la_LDFLAGS = -module -avoid-version $(SS_LDFLAGS) $(SS_LIBDIRS) + +nodist_libkviwindow_la_SOURCES = moc_userwindow.cpp + +libkviwindow_la_SOURCES = libkviwindow.cpp userwindow.cpp + +libkviwindow_la_LIBADD = $(SS_LIBLINK) ../../kvilib/build/libkvilib.la + +noinst_HEADERS= userwindow.h + +moc_%.cpp: %.h + $(SS_QT_MOC) $< -o $@ diff --git a/src/modules/window/kviwindow.dsp b/src/modules/window/kviwindow.dsp new file mode 100644 index 000000000..2156b6d85 --- /dev/null +++ b/src/modules/window/kviwindow.dsp @@ -0,0 +1,146 @@ +# Microsoft Developer Studio Project File - Name="kviwindow" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=kviwindow - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "kviwindow.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "kviwindow.mak" CFG="kviwindow - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "kviwindow - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "kviwindow - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "kviwindow - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ACTION_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "_$(QTDIR)\include" /I "$(QTDIR)\include" /I "..\..\kvilib\tal" /I "..\..\kvilib\system" /I "..\..\kvilib\irc" /I "..\..\kvilib\file" /I "..\..\kvilib\ext" /I "..\..\kvilib\net" /I "..\..\kvilib\core\wstring" /I "..\..\kvilib\core" /I "..\..\kvilib\config" /I "..\..\kvirc\kvs" /I "..\..\kvirc\module" /I "..\..\kvirc\uparser\scripttoolbar" /I "..\..\kvirc\uparser" /I "..\..\kvirc\sparser" /I "..\..\kvirc\kernel" /I "..\..\kvirc\ui" /I "C:\ssl" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ACTION_EXPORTS" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 imm32.lib wsock32.lib winmm.lib $(QTDIR)\lib\qt-mtnc321.lib $(QTDIR)\lib\qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib kvirc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /dll /machine:I386 /out:"..\..\..\win32build\bin\modules\kviwindow.dll" /libpath:"C:\OpenSSL\lib\VC" /libpath:"..\..\kvilib\Release" /libpath:"..\..\kvirc\Release" + +!ELSEIF "$(CFG)" == "kviwindow - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ACTION_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "_$(QTDIR)\include" /I "$(QTDIR)\include" /I "..\..\kvilib\tal" /I "..\..\kvilib\system" /I "..\..\kvilib\irc" /I "..\..\kvilib\file" /I "..\..\kvilib\ext" /I "..\..\kvilib\net" /I "..\..\kvilib\core\wstring" /I "..\..\kvilib\core" /I "..\..\kvilib\config" /I "..\..\kvirc\kvs" /I "..\..\kvirc\module" /I "..\..\kvirc\uparser\scripttoolbar" /I "..\..\kvirc\uparser" /I "..\..\kvirc\sparser" /I "..\..\kvirc\kernel" /I "..\..\kvirc\ui" /I "C:\ssl" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ACTION_EXPORTS" /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 odbc32.lib odbccp32.lib $(QTDIR)\lib\qt-mtnc321.lib $(QTDIR)\lib\qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib kvirc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\win32build\KviDebug\modules\kviwindow.dll" /pdbtype:sept /libpath:"C:\OpenSSL\lib\VC" /libpath:"..\..\kvilib\Debug" /libpath:"..\..\kvirc\Debug" + +!ENDIF + +# Begin Target + +# Name "kviwindow - Win32 Release" +# Name "kviwindow - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\libkviwindow.cpp +# End Source File +# Begin Source File + +SOURCE=.\moc_userwindow.cpp +# End Source File +# Begin Source File + +SOURCE=.\userwindow.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\userwindow.h + +!IF "$(CFG)" == "kviwindow - Win32 Release" + +# Begin Custom Build +InputDir=. +InputPath=.\userwindow.h +InputName=userwindow + +"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp + +# End Custom Build + +!ELSEIF "$(CFG)" == "kviwindow - Win32 Debug" + +# Begin Custom Build +InputDir=. +InputPath=.\userwindow.h +InputName=userwindow + +"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp + +# End Custom Build + +!ENDIF + +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/src/modules/window/kviwindow.dsw b/src/modules/window/kviwindow.dsw new file mode 100644 index 000000000..1f63a5bb1 --- /dev/null +++ b/src/modules/window/kviwindow.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "kviwindow"=.\kviwindow.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/src/modules/window/libkviwindow.cpp b/src/modules/window/libkviwindow.cpp new file mode 100644 index 000000000..df8efe6ab --- /dev/null +++ b/src/modules/window/libkviwindow.cpp @@ -0,0 +1,1517 @@ +//================================================================================= +// +// File : kvi_window.cpp +// Creation date : Sat Sep 01 2001 17:13:12 CEST by Szymon Stefanek +// +// This file is part of the KVirc irc client distribution +// Copyright (C) 2001-2005 Szymon Stefanek (pragma at kvirc dot net) +// +// 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. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +//================================================================================= + +#include "kvi_module.h" + +#include "kvi_console.h" +#include "kvi_options.h" +#include "kvi_ircsocket.h" +#include "kvi_frame.h" +#include "kvi_locale.h" +#include "kvi_app.h" +#include "kvi_error.h" +#include "kvi_ircview.h" +#include "kvi_input.h" +#include "kvi_iconmanager.h" +#include "kvi_modulemanager.h" +#include "kvi_memmove.h" +#include "kvi_malloc.h" + +#include "kvi_channel.h" +#include "userwindow.h" + +#include <qasciidict.h> +#include <qtimer.h> + + +#ifdef COMPILE_CRYPT_SUPPORT + #include "kvi_crypt.h" + #include "kvi_cryptcontroller.h" + // kvi_app.cpp + extern KVIRC_API KviCryptEngineManager * g_pCryptEngineManager; +#endif + + +// kvi_app.cpp +extern KVIRC_API QAsciiDict<KviWindow> * g_pGlobalWindowDict; +KviPtrList<KviUserWindow> * g_pUserWindowList = 0; + +// $window.caption $window.x $window.y $window.width $window.height $window.isActive $window.type +// $window.input.text $window.input.cursorpos $window.input.textlen + + +#define GET_KVS_WINDOW_ID \ + QString szWnd; \ + KviWindow * pWnd; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER("window_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWnd) \ + KVSM_PARAMETERS_END(c) \ + if(c->parameterList()->count() == 0) \ + { \ + pWnd = c->window(); \ + } else { \ + pWnd = g_pApp->findWindow(szWnd.utf8().data()); \ + if(!pWnd) \ + { \ + if(!c->hasSwitch('q',"quiet")) \ + c->warning(__tr2qs("The window with id '%s' does not exist"),szWnd.utf8().data()); \ + return true; \ + } \ + } + +#define GET_KVS_FNC_WINDOW_ID \ + QString szWnd; \ + KviWindow * pWnd; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER("window_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWnd) \ + KVSM_PARAMETERS_END(c) \ + if(c->parameterList()->count() == 0) \ + { \ + pWnd = c->window(); \ + } else { \ + pWnd = g_pApp->findWindow(szWnd.utf8().data()); \ + if(!pWnd) \ + return true; \ + } + +/* + @doc: window.clearOutput + @type: + command + @title: + window.clearOutput + @short: + Clears the output a window + @syntax: + window.clearOutput [-f] [-q] [window_id] + @switches: + !sw: -q | --quiet + Don't warn if the specified window doesn't exist. Just continue silently. + @description: + Clears the text output of the window specified by window_id. If window_id is missing then + the current window is used. If the window has no text output then no operation is performed. + If the specified window does not exist a warning is printed (unless the -q switch is used) + but the execution continues normally. + @seealso: + [fnc]$window.hasOutput[/fnc]() +*/ + +static bool window_kvs_cmd_clearOutput(KviKvsModuleCommandCall * c) +{ + GET_KVS_WINDOW_ID + if(pWnd) + { + if(pWnd->view())pWnd->view()->emptyBuffer(true); + if(pWnd->type() == KVI_WINDOW_TYPE_CHANNEL) + { + KviChannel *chan = (KviChannel *)pWnd; + if(chan->messageView()) chan->messageView()->emptyBuffer(true); + } + } + return true; +} + +/* + @doc: window.close + @type: + command + @title: + window.close + @short: + Closes a window + @syntax: + window.close [-q] [window_id] + @description: + Closes the window specified by window_id. If window_id is missing then + the current window is closed. The close operation is asynchronous: it is + performed immediately after the script has terminated the execution and + the control is returned to the main KVIrc core. If the specified window + does not exist a warning is printed unless the -q switch is used. +*/ + +static bool window_kvs_cmd_close(KviKvsModuleCommandCall * c) +{ + GET_KVS_WINDOW_ID + if(pWnd) + { + pWnd->delayedClose(); + } + return true; +} + +/* + @doc: window.dock + @type: + command + @title: + window.dock + @short: + Docks a window + @syntax: + window.dock [-q] [window_id] + @description: + Docks the window specified by window_id. If window_id is missing then + the current window is docked. If the specified window was already docked then + no operation is performed. If the specified window + does not exist a warning is printed unless the -q switch is used. + @seealso: + [cmd]window.undock[/cmd] +*/ + +static bool window_kvs_cmd_dock(KviKvsModuleCommandCall * c) +{ + GET_KVS_WINDOW_ID + if(pWnd) + { + pWnd->dock(); + } + return true; +} + +/* + @doc: window.undock + @type: + command + @title: + window.undock + @short: + Undocks a window + @syntax: + window.undock [-q] [window_id] + @description: + Undocks the window specified by window_id. If window_id is missing then + the current window is undocked. If the specified window was already undocked then + no operation is performed. If the specified window + does not exist a warning is printed unless the -q switch is used. + @seealso: + [cmd]window.dock[/cmd] +*/ + +static bool window_kvs_cmd_undock(KviKvsModuleCommandCall * c) +{ + GET_KVS_WINDOW_ID + if(pWnd) + { + pWnd->undock(); + } + return true; +} + +/* + @doc: window.maximize + @type: + command + @title: + window.maximize + @short: + Maximizes a window + @syntax: + window.maximize [-q] [window_id] + @description: + Maximizes the window specified by window_id. If window_id is missing then + the current window is maximized. If the specified window was already maximized then + no operation is performed. If the specified window + does not exist a warning is printed unless the -q switch is used. + @seealso: + [cmd]window.minimize[/cmd], [cmd]window.restore[/cmd], [fnc]$window.isMaxmimized[/cmd], + [fnc]$window.isMinimized[/cmd] +*/ + +static bool window_kvs_cmd_maximize(KviKvsModuleCommandCall * c) +{ + GET_KVS_WINDOW_ID + if(pWnd) + { + pWnd->maximize(); + } + return true; +} + +/* + @doc: window.minimize + @type: + command + @title: + window.minimize + @short: + Minimizes a window + @syntax: + window.minimize [-q] [window_id] + @description: + Minimizes the window specified by window_id. If window_id is missing then + the current window is minimized. If the specified window was already minimized then + no operation is performed. If the specified window + does not exist a warning is printed unless the -q switch is used. + @seealso: + [cmd]window.maximize[/cmd], [cmd]window.restore[/cmd], [fnc]$window.isMaxmimized[/cmd], + [fnc]$window.isMinimized[/cmd] +*/ + +static bool window_kvs_cmd_minimize(KviKvsModuleCommandCall * c) +{ + GET_KVS_WINDOW_ID + if(pWnd) + { + pWnd->minimize(); + } + return true; +} + +/* + @doc: window.restore + @type: + command + @title: + window.restore + @short: + Restores a window + @syntax: + window.restore [-q] [window_id] + @description: + Restores the window specified by window_id. If window_id is missing then + the current window is restored. If the specified window was already restored then + no operation is performed. If the specified window + does not exist a warning is printed unless the -q switch is used. + @seealso: + [cmd]window.maximize[/cmd], [cmd]window.minimize[/cmd], [fnc]$window.isMaxmimized[/cmd], + [fnc]$window.isMinimized[/cmd] +*/ + +static bool window_kvs_cmd_restore(KviKvsModuleCommandCall * c) +{ + GET_KVS_WINDOW_ID + if(pWnd) + { + pWnd->restore(); + } + return true; +} + +/* + @doc: window.activate + @type: + command + @title: + window.activate + @short: + Activates a window + @syntax: + window.activate [-q] [window_id] + @description: + Activates the window specified by window_id. If window_id is missing then + the current window is activated. If the specified window + does not exist a warning is printed unless the -q switch is used. + Please note that if the window is currently docked to a frame then this + command will NOT raise the frame window. If you're interested in + the user's attention then you might be interested in [cmd]window.demandAttention[/cmd]. + @seealso: + [cmd]window.demandAttention[/cmd] +*/ + +static bool window_kvs_cmd_activate(KviKvsModuleCommandCall * c) +{ + GET_KVS_WINDOW_ID + if(pWnd) + { + pWnd->autoRaise(); + } + return true; +} + +/* + @doc: window.demandAttention + @type: + command + @title: + window.demandAttention + @short: + Flashes a window's system taskbar entry + @syntax: + window.demandAttention [-q] [window_id] + @description: + Flashes the system taskbar entry of the window + specified by the window_id. If window_id is missing then + the current window's system taskbar entry is flashed. If the specified window + does not exist a warning is printed unless the -q switch is used. + If the window is currently docked in a frame then the frame's + system taskbar entry will be flashed. + Please note that this command is highly system dependant: + on systems that do not have a system taskbar or there + is no way to flash an etry this command will do nothing. + At the time of writing this command works flawlessly on + Windows and in KDE compilations. + @seealso: + [cmd]window.demandAttention[/cmd] +*/ + +static bool window_kvs_cmd_demandAttention(KviKvsModuleCommandCall * c) +{ + GET_KVS_WINDOW_ID + if(pWnd) + { + pWnd->demandAttention(); + } + return true; +} + +/* + @doc: window.isMaximized + @type: + function + @title: + $window.isMaximized + @short: + Checks if a window is currently maximized + @syntax: + $window.isMaximized + $window.isMaximized(<window_id>) + @description: + Returns 1 if the window specified by <window_id> is currently maximized and 0 otherwise. + The form with no parameters works on the current window. If the specified window + doesn't exist then 0 is returned. + @seealso: + [fnc]$window.isMinimized[/fnc](), [cmd]window.maximize[/cmd], + [cmd]window.minimize[/cmd], [cmd]window.restore[/cmd] +*/ + +static bool window_kvs_fnc_isMaximized(KviKvsModuleFunctionCall * c) +{ + GET_KVS_FNC_WINDOW_ID + if(pWnd) + { + c->returnValue()->setBoolean(pWnd->isMaximized() ? true : false); + } + return true; +} + +/* + @doc: window.activityLevel + @type: + function + @title: + $window.activityLevel + @short: + Returns the current activity level of a window + @syntax: + $window.activityLevel + $window.activityLevel(<window_id>) + @description: + Returns the current activity level of the window specified by <window_id>. + The form without parameters works on the current window.[br] + The activity level is a number describing the level of traffic in the window + and depends on the window type. On channels and queries it is dependant on the number + and frequency of actions performed by the users. + @seealso: + [fnc]$window.activityTemperature[/fnc] +*/ + +static bool window_kvs_fnc_activityLevel(KviKvsModuleFunctionCall * c) +{ + GET_KVS_FNC_WINDOW_ID + if(pWnd) + { + unsigned int v,t; + pWnd->activityMeter(&v,&t); + c->returnValue()->setInteger(v); + } else { + c->returnValue()->setInteger(0); + } + return true; +} + +/* + @doc: window.activityTemperature + @type: + function + @title: + $window.activityTemperature + @short: + Returns the current activity temperature of a window + @syntax: + $window.activityTemperature + $window.activityTemperature(<window_id>) + @description: + Returns the current activity temperature of the window specified by <window_id>. + The form without parameters works on the current window.[br] + The activity temperature describes the type of traffic in the window and is + strictly related to the [fnc]$window.activityLevel[/fnc].[br] + On channels and queries the temperature describes the type of the actions + performed by the users. High temperatures denote more "human" behaviour (like + speaking to the channel, changing the topic etc...), + low temperatures denote automatic behaviours (like changing the channel limit + or mode: actions often performed by bots).[br] + @seealso: + [fnc]$window.activityLevel[/fnc] +*/ + +static bool window_kvs_fnc_activityTemperature(KviKvsModuleFunctionCall * c) +{ + GET_KVS_FNC_WINDOW_ID + if(pWnd) + { + unsigned int v,t; + pWnd->activityMeter(&v,&t); + c->returnValue()->setInteger(t); + } else { + c->returnValue()->setInteger(0); + } + return true; +} + +/* + @doc: window.isMinimized + @type: + function + @title: + $window.isMinimized + @short: + Checks if a window is currently minimized + @syntax: + $window.isMinimized + $window.isMinimized(<window_id>) + @description: + Returns 1 if the window specified by <window_id> is currently minimized and 0 otherwise. + The form with no parameters works on the current window. If the specified window + doesn't exist then 0 is returned. + @seealso: + [fnc]$window.isMaximized[/fnc](), [cmd]window.maximize[/cmd], + [cmd]window.minimize[/cmd], [cmd]window.restore[/cmd] +*/ + +static bool window_kvs_fnc_isMinimized(KviKvsModuleFunctionCall * c) +{ + GET_KVS_FNC_WINDOW_ID + if(pWnd) + { + c->returnValue()->setBoolean(pWnd->isMinimized() ? true : false); + } + return true; +} + +/* + @doc: window.hasInput + @type: + function + @title: + $window.hasInput + @short: + Checks if a window has an input field + @syntax: + $window.hasInput + $window.hasInput(<window_id>) + @description: + Returns 1 if the window specified by <window_id> has an input field and 0 otherwise. + The form with no parameters works on the current window. If the specified window + doesn't exist then 0 is returned. + @seealso: + [fnc]$window.hasOutput[/fnc] +*/ + +static bool window_kvs_fnc_hasInput(KviKvsModuleFunctionCall * c) +{ + GET_KVS_FNC_WINDOW_ID + if(pWnd) + { + c->returnValue()->setBoolean(pWnd->input() ? true : false); + } else + c->returnValue()->setBoolean(false); + return true; +} + +/* + @doc: window.hasUserFocus + @type: + function + @title: + $window.hasUserFocus + @short: + Checks if a window has the user focus + @syntax: + $window.hasUserFocus + $window.hasUserFocus(<window_id>) + @description: + Returns 1 if the window specified by <window_id> has + currently the user focus and 0 otherwise. + The form with no parameters works on the current window. + If the specified window doesn't exist then 0 is returned. + A window has the user focus if it is the KVIrc's active + window and has the user's input focus (i.e. typing + on the keyboard will write in this window). + @seealso: +*/ + +static bool window_kvs_fnc_hasUserFocus(KviKvsModuleFunctionCall * c) +{ + GET_KVS_FNC_WINDOW_ID + if(pWnd) + { + bool b = (pWnd == g_pActiveWindow) && pWnd->isActiveWindow(); + c->returnValue()->setBoolean(b ? true : false); + } else + c->returnValue()->setBoolean(false); + return true; +} + +/* + @doc: window.console + @type: + function + @title: + $window.console + @short: + Returns the console that a window is attacched to + @syntax: + $window.console + $window.console(<window_id>) + @description: + Returns the id of the console window that the window specified by window_id is attacched to. + The console is the main (and only) console of the IRC context. If window_id is missing then + the current window is used. If this window does not belong to an irc context (and thus has + no attacched console) then 0 is returned. + @seealso: +*/ + +static bool window_kvs_fnc_console(KviKvsModuleFunctionCall * c) +{ + GET_KVS_FNC_WINDOW_ID + if(pWnd) + { + c->returnValue()->setInteger(pWnd->console() ? QString(pWnd->console()->id()).toInt() : 0); + } + return true; +} + +/* + @doc: window.hasOutput + @type: + function + @title: + $window.hasOutput + @short: + Checks if a window has a text output widget + @syntax: + $window.hasOutput + $window.hasOutput(<window_id>) + @description: + Returns 1 if the window specified by <window_id> has a text output widget and 0 otherwise. + The form with no parameters works on the current window. If the specified window + doesn't exist then 0 is returned. + @seealso: + [fnc]$window.hasInput[/fnc] +*/ + +static bool window_kvs_fnc_hasOutput(KviKvsModuleFunctionCall * c) +{ + GET_KVS_FNC_WINDOW_ID + if(pWnd) + { + c->returnValue()->setBoolean(pWnd->view() ? true : false); + } else + c->returnValue()->setBoolean(false); + return true; +} + +/* + @doc: window.exists + @type: + function + @title: + $window.exists + @short: + Checks for the existence of a window + @syntax: + $window.exists(<window_id>) + @description: + Returns 1 if a specified window exists + @seealso: +*/ + +static bool window_kvs_fnc_exists(KviKvsModuleFunctionCall * c) +{ + GET_KVS_FNC_WINDOW_ID + if(pWnd) + { + c->returnValue()->setBoolean(true); + } else + c->returnValue()->setBoolean(false); + return true; +} + +/* + @doc: window.type + @type: + function + @title: + $window.type + @short: + Returns the type of a window + @syntax: + $window.type + $window.type(<window_id>) + @description: + Returns the type of the window with <window_id>.[br] + The form with no parameters returns the type 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_type(KviKvsModuleFunctionCall * c) +{ + GET_KVS_FNC_WINDOW_ID + if(pWnd) + { + c->returnValue()->setString(pWnd->typeString()); + } + return true; +} + +/* + @doc: window.caption + @type: + function + @title: + $window.caption + @short: + Returns the caption of a window + @syntax: + $window.caption + $window.caption(<window_id>) + @description: + Returns the caption of the window with <window_id>.[br] + The form with no parameters returns the caption 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_caption(KviKvsModuleFunctionCall * c) +{ + GET_KVS_FNC_WINDOW_ID + if(pWnd) + { + c->returnValue()->setString(pWnd->plainTextCaption()); + } + return true; +} + +/* + @doc: window.listtypes + @type: + command + @title: + window.listtypes + @short: + Lists available types of windows + @syntax: + window.listtypes + @description: + Lists the types of windows that are built in the current release of KVIrc.[br] + This is actually a command and not a static list just because new window + types may be added in subsequent releases.[br] + @seealso: + [cmd]window.listtypes[/cmd] +*/ + +static bool window_kvs_cmd_listtypes(KviKvsModuleCommandCall * c) +{ + c->window()->listWindowTypes(); + return true; +} + +/* + @doc: window.list + @type: + function + @title: + $window.list + @short: + Generates lists of windows + @syntax: + $window.list(<type>[,<irc_context_id>]) + @description: + Returns an array of window identifiers with a speficied type and eventually belonging to a specified + irc context.[br] + <type> is a window type such as 'query' or 'channel'.[br] + See [cmd]window.listtypes[/cmd] for a list of available window types in this KVIrc release.[br] + If <type> is the special word 'all', all the window types are listed.[br] + <irc_context_id> specifies the irc context in which the windows are searched.[br] + If no <irc_context_id> is specified , the current one is used.[br] + If <irc_context_id> is the special word 'all', all the irc context are searched.[br] + If <irc_context_id> is the special word 'none' then only windows not belonging to any + irc context are listed.[br] + The special word 'any' used as <irc_context_id> merges the effects of 'all' and 'none' + by searching all the irc contexts AND the windows not belonging to any irc context.[br] + The windows that do not belong to any irc context (such as DCC windows), must be searched + by using 'none' or 'any' as <irc_context_id>. + @examples: + [example] + [comment]# List all the queries of the current irc context[/comment] + [cmd]echo[/cmd] $window.list(query) + [comment]# Equivalent to the above[/comment] + [cmd]echo[/cmd] $window.list(query,[fnc]$ic[/fnc]) + [comment]# List all the channels in all the irc contexts[/comment] + [cmd]echo[/cmd] $window.list(channel,all) + [comment]# List all the windows in the current irc context[/comment] + [cmd]echo[/cmd] $window.list(all) + [comment]# List all the windows in all irc contexts[/comment] + [cmd]echo[/cmd] $window.list(all,all) + [comment]# List all the DCC Send windows: They don't belong to any irc context[/comment] + [cmd]echo[/cmd] $window.list(dccsend,none) + [comment]# List all the user windows created with $window.open[/comment] + [comment]# They may either belong to an irc context or not[/comment] + [cmd]echo[/cmd] $window.list(userwnd,any) + [comment]# Ok , let's use it[/comment] + [comment]# A nice alias that allows iterating commands through all the consoles[/comment] + [comment]# Note the array returned by $window.list[/comment] + [comment]# This is by LatinSuD :)[/comment] + [cmd]alias[/cmd](iterate) + { + %ctxt[]=[fnc]$window.list[/fnc](console,all) + [cmd]for[/cmd](%i=0;%i<%ctxt[]#;%i++) + { + [cmd]eval[/cmd] -r=%ctxt[%i] $0- + } + } + iterate [cmd]echo[/cmd] Hi ppl! :) + [comment]# The returned array works nicely also in [cmd]foreach[/cmd][/comment] + [comment]# Say hi to all the channels :)[/comment] + [cmd]alias[/cmd](sayallchans) + { + [cmd]foreach[/cmd](%x,[fnc]$window.list[/fnc](channel,all)) + [cmd]say[/cmd] -r=%x $0-; + } + sayallchans Hi ppl :) + [/example] + @seealso: + [cmd]window.listtypes[/cmd] +*/ + +static bool window_kvs_fnc_list(KviKvsModuleFunctionCall * c) +{ + QString szType; + QString szContext; + + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("type",KVS_PT_STRING,0,szType) + KVSM_PARAMETER("irc_context_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szContext) + KVSM_PARAMETERS_END(c) + KviKvsArray* pArray = new KviKvsArray(); + c->returnValue()->setArray(pArray); + + if(szType.isEmpty()) + { + c->warning(__tr2qs("Window type or 'all' expected as first parameter")); + return true; + } + + int id=0; + + if(KviQString::equalCI(szContext,"all")) + { + // all contexts but no "no_context" windows + bool bAllWindows = KviQString::equalCI(szType,"all"); + QAsciiDictIterator<KviWindow> it(*g_pGlobalWindowDict); + + while(KviWindow * wnd = it.current()) + { + if(wnd->context()) + { + if(bAllWindows) + { + pArray->set(id, new KviKvsVariant(QString(wnd->id()))); + id++; + } else { + if(szType.lower()==wnd->typeString()) + { + pArray->set(id, new KviKvsVariant(QString(wnd->id()))); + id++; + } + } + } + ++it; + } + } else if(KviQString::equalCI(szContext,"any")) + { + // all contexts and also "no_context" windows + bool bAllWindows = KviQString::equalCI(szType.lower(),"all"); + QAsciiDictIterator<KviWindow> it(*g_pGlobalWindowDict); + + while(KviWindow * wnd = it.current()) + { + if(bAllWindows) + { + pArray->set(id, new KviKvsVariant(QString(wnd->id()))); + id++; + } else { + if(szType.lower()==wnd->typeString()) + { + pArray->set(id, new KviKvsVariant(QString(wnd->id()))); + id++; + } + } + ++it; + } + } else if(KviQString::equalCI(szContext,"none")) + { + // only "no_context" windows + bool bAllWindows = KviQString::equalCI(szType.lower(),"all"); + QAsciiDictIterator<KviWindow> it(*g_pGlobalWindowDict); + + while(KviWindow * wnd = it.current()) + { + if(!wnd->context()) + { + if(bAllWindows) + { + pArray->set(id, new KviKvsVariant(QString(wnd->id()))); + id++; + } else { + if(szType.lower()==wnd->typeString()) + { + pArray->set(id, new KviKvsVariant(QString(wnd->id()))); + id++; + } + } + } + ++it; + } + + } else { + // some specified context + unsigned int uId = 0; + + if(!szContext.isEmpty()) + { + // specific context + bool bOk; + uId = szContext.toUInt(&bOk); + if(!bOk) + { + c->warning(__tr2qs("Invalid IRC context id '%Q'"),&szContext); + return true; + } + } else { + // current irc context + if(!c->window()->console()) + { + return true; + } + uId = c->window()->console()->ircContextId(); + } + + bool bAllWindows = KviQString::equalCI(szType.lower(),"all"); + QAsciiDictIterator<KviWindow> it(*g_pGlobalWindowDict); + + while(KviWindow * wnd = it.current()) + { + if(wnd->console()) + { + if(wnd->console()->ircContextId() == uId) + { + if(bAllWindows) + { + pArray->set(id, new KviKvsVariant(QString(wnd->id()))); + id++; + } else { + if(szType.lower()==wnd->typeString()) + { + pArray->set(id, new KviKvsVariant(QString(wnd->id()))); + id++; + } + } + } + } + ++it; + } + } + return true; + +} + +/* + @doc: window.open + @type: + function + @title: + $window.open + @short: + Creates and opens a new window + @syntax: + $window.open([<flags:string>[,<caption:string>[,<irc_context:integer>[,<icon:integer>]]]]) + @description: + Creates a new window, opens it and returns its window identifier. + <flags> may be any combination of the following flag characters:[br] + [b]i[/b]: Causes the window to have an input field in that + the user can type commands or text. The text typed is reported + by the [event:ontextinput]OnTextInput[/event] event.[br] + [b]m[/b]: Creates a window that is initially minimized.[br] + [b]q[/b]: Don't print warning messages during the creation.[br] + If <caption> is given then the new window will have it as the initial plain text <caption>. + You can change the caption later by calling [cmd]window.setCaption[/cmd].[br] + If <irc_context> is given then the new window is bound to the specified irc context + and will be destroyed when the attacched console closes. + If <irc_context> is omitted or is 0 then the window will be context free (not bound + to any context) and will exist until it is closed by the GUI, by a [cmd]window.close[/cmd] + call or until KVIrc terminates. When <irc_context> is given but is not valid + then a warning is printed (unless the q flag is used) and the created window is context free.[br] + You will generally use the [fnc]$context[/fnc] function to retrieve the current IRC context id.[br] + [br] + <icon> is intepreted as the index of the internal icon to be used + for the window. If <icon> is omitted then a default icon is used.[br] + @examples: + [example] + %w = $window.open() + [cmd]window.close[/cmd] %w + %w = $window.open("m","My funky window") + [cmd]window.close[/cmd] %w + %w = $window.open("im","My funky window 2",$context,10) + [/example] + @seealso: + [cmd]window.close[/cmd] +*/ + +static bool window_kvs_fnc_open(KviKvsModuleFunctionCall * c) +{ + QString szFlags; + QString szCaption; + kvs_uint_t uCtx; + kvs_int_t iIcon; + + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) + KVSM_PARAMETER("caption",KVS_PT_STRING,KVS_PF_OPTIONAL,szCaption) + KVSM_PARAMETER("irc_context",KVS_PT_UINT,KVS_PF_OPTIONAL,uCtx) + KVSM_PARAMETER("icon",KVS_PT_INT,KVS_PF_OPTIONAL,iIcon) + KVSM_PARAMETERS_END(c) + iIcon = iIcon % KVI_NUM_SMALL_ICONS; + + int iFlags = 0; + if(szFlags.contains('i'))iFlags |= KviUserWindow::HasInput; + + KviConsole * pConsole = 0; + if(c->parameterList()->count() >= 3) + { + pConsole = g_pApp->findConsole(uCtx); + if(!pConsole) + { + c->warning(__tr2qs("The specified IRC context is not valid: creating a context free window")); + } + } + + KviUserWindow * wnd = new KviUserWindow( + c->window()->frame(), + szCaption, + iIcon, + pConsole, + iFlags); + + c->window()->frame()->addWindow(wnd,!szFlags.contains('m')); + if(szFlags.contains('m'))wnd->minimize(); + + c->returnValue()->setInteger(QString(wnd->id()).toUInt()); + return true; +} + +/* + @doc: window.setCaption + @type: + command + @title: + window.setCaption + @short: + Sets the caption of an user window + @syntax: + window.setCaption [-q] <window_id> <plain_text_caption> [html_inactive_caption] [html_active_caption] + @switches: + !sw: -q | --quiet + Be quiet + @description: + Sets the caption of the user window specified by <window_id> to <plain_text_caption>.[br] + If <window_id> is an empty string then the current window is assumed.[br] + The window must be of type userwnd and must have been created by [fnc]$window.open[/fnc]: + it is not possible to change the caption of other window types.[br] + If the window is not of the expected type then a warning is printed unless the -q switch is used.[br] + If [html_inactive_caption] and/or [html_active_caption] are given then + the html versions of the captions displayed in the window caption bars + are set too. If one of these parameters is missing then <plain_text_caption> is + used for the html versions too. The html captions can contain limited html code. In particular + you're allowed to use the <nobr>,<font>,<b> and <i> html tags. + It is better to avoid using colored fonts since you can't know which color scheme the + user will have set.[br] + If the specified window does not exist a warning is printed unless the -q switch is used. + @seealso: +*/ + +static bool window_kvs_cmd_setCaption(KviKvsModuleCommandCall * c) +{ + QString szWnd; + QString szPlain; + QString szInactive; + QString szActive; + KviWindow * pWnd; + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("window_id",KVS_PT_STRING,0,szWnd) + KVSM_PARAMETER("plain_text_caption",KVS_PT_STRING,0,szPlain) + KVSM_PARAMETER("html_inactive_caption",KVS_PT_STRING,KVS_PF_OPTIONAL,szInactive) + KVSM_PARAMETER("html_active_caption",KVS_PT_STRING,KVS_PF_OPTIONAL,szActive) + KVSM_PARAMETERS_END(c) + + pWnd = g_pApp->findWindow(szWnd.utf8().data()); + if(!pWnd) + { + if(!c->hasSwitch('q',"quiet")) + c->warning(__tr2qs("The window with id '%s' does not exist"),szWnd.utf8().data()); + return true; + } + + if(pWnd->type() == KVI_WINDOW_TYPE_USERWINDOW) + { + ((KviUserWindow *)pWnd)->setCaptionStrings(szPlain,szInactive,szActive); + } else { + if(!c->hasSwitch('q',"quiet"))c->warning(__tr2qs("The specified window is not of type \"userwnd\"")); + } + return true; +} + +/* + @doc: window.setInputText + @type: + command + @title: + window.setInputText + @short: + Sets the window input text to <text> + @syntax: + window.setInputText [-q] <window_id:integer> <text:string> + @switches: + !sw: -q | --quiet + Be quiet + @description: + Sets the window input text to <text> + @seealso: + [cmd]window.setInputText[/cmd] [cmd]window.insertInInputText[/cmd] [fnc]$window.inputText[/fnc] +*/ + +static bool window_kvs_cmd_setInputText(KviKvsModuleCommandCall * c) +{ + QString szWnd; + QString szText; + KviWindow * pWnd; + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("window_id",KVS_PT_STRING,0,szWnd) + KVSM_PARAMETER("text",KVS_PT_STRING,0, szText) + KVSM_PARAMETERS_END(c) + + pWnd = g_pApp->findWindow(szWnd.utf8().data()); + if(!pWnd) + { + if(!c->hasSwitch('q',"quiet")) + c->warning(__tr2qs("The window with id '%s' does not exist"),szWnd.utf8().data()); + return true; + } + if(pWnd->input()) + pWnd->input()->setText(szText); + else + if(!c->hasSwitch('q',"quiet")) c->warning(__tr2qs("Window doesn't have input widget")); + + return true; +} + + +/* + @doc: window.insertInInputText + @type: + command + @title: + window.insertInInputText + @short: + Sets the window input text to <text> + @syntax: + window.insertInInputText [-q] <window_id:integer> <text:string> + @switches: + !sw: -q | --quiet + Be quiet + @description: + Sets the window input text to <text> + @seealso: + [cmd]window.setInputText[/cmd] [fnc]$window.inputText[/fnc] +*/ + +static bool window_kvs_cmd_insertInInputText(KviKvsModuleCommandCall * c) +{ + QString szWnd; + QString szText; + KviWindow * pWnd; + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("window_id",KVS_PT_STRING,0,szWnd) + KVSM_PARAMETER("text",KVS_PT_STRING,0, szText) + KVSM_PARAMETERS_END(c) + + pWnd = g_pApp->findWindow(szWnd.utf8().data()); + if(!pWnd) + { + if(!c->hasSwitch('q',"quiet")) + c->warning(__tr2qs("The window with id '%s' does not exist"),szWnd.utf8().data()); + return true; + } + if(pWnd->input()) + pWnd->input()->insertText(szText); + else + if(!c->hasSwitch('q',"quiet")) c->warning(__tr2qs("Window doesn't have input widget")); + + return true; +} + +/* + @doc: $window.inputText + @type: + function + @title: + $window.inputText + @short: + Returns the window input line text + @syntax: + $window.inputText(<window_id:integer>) + @description: + Returns the window input line text + @seealso: + [cmd]window.setInputText[/cmd] [cmd]window.insertInInputText[/cmd] +*/ + +static bool window_kvs_fnc_inputText(KviKvsModuleFunctionCall * c) +{ + GET_KVS_FNC_WINDOW_ID + if(pWnd) + { + if(pWnd->input()) + c->returnValue()->setString(pWnd->input()->text()); + } + return true; +} + +/* + @doc: window.setBackground + @type: + command + @title: + window.setBackground + @short: + Sets the background image of a window + @syntax: + window.setBackground [-q] <window_id:integer> <image_id:string> + @switches: + !sw: -q | --quiet + Be quiet + @description: + Sets the background image of the window specified by <window_id> to <image_id>.[br] + If <window_id> is an empty string then the current window is assumed.[br] + If the specified window or the background image does not exist a warning is printed unless the -q switch is used. + @seealso: +*/ + +static bool window_kvs_cmd_setBackground(KviKvsModuleCommandCall * c) +{ + QString szWnd; + QString szBackground; + KviWindow * pWnd; + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("window_id",KVS_PT_STRING,0,szWnd) + KVSM_PARAMETER("plain_text_caption",KVS_PT_STRING,0, szBackground) + KVSM_PARAMETERS_END(c) + + pWnd = g_pApp->findWindow(szWnd.utf8().data()); + if(!pWnd) + { + if(!c->hasSwitch('q',"quiet")) + c->warning(__tr2qs("The window with id '%s' does not exist"),szWnd.utf8().data()); + return true; + } + + /* + QPixmap *pix=0; + pix = g_pIconManager->getImage(szBackground); + if (!pix){ + KviScriptObject * ob = g_pScriptObjectController->lookupObject(szBackground); + if(!ob){ + if(!c->hasSwitch('q',"quiet")) c->warning(__tr2qs("Background not found %Q "),&szBackground); + return true; + } + if(!ob->inherits("KviScriptPixmapObject")){ + c->warning(__tr("Pixmap objects required !")); + return true; + } + QVariant pix1= ob->property("pixmap"); + if (!pix1.asPixmap().isNull()){ + c->warning(__tr("Pixmap is null")); + return true; + } + pWnd->view()->setPrivateBackgroundPixmap(pix1.asPixmap()); + return true; + } + if(pWnd) + pWnd->view()->setPrivateBackgroundPixmap(*pix); + */ + + //FIXME: This is broken + + return true; +} + +/* + @doc: window.setCryptEngine + @type: + command + @title: + window.setCryptEngine + @short: + Sets the crypt engine for a window that supports it + @syntax: + window.setCryptEngine [-q] [-n] [-m] <window_id:integer> <enginename:string> <hex_encrypt_key;string> [hex_decrypt_key:string] + @switches: + !sw: -q | --quiet + Be quiet: do echo the raw data. + !sw: -n | --onlydecrypt + Disables encryption + !sw: -m | --onlyencrypt + Disables decryption + @description: + Sets the specified [doc:crypt_engines]cryptographic engine[/doc] for the window. If <enginename> is empty + then any current crypting engine is removed (i.e. crypting is disabled). + The must be both expressed in hexadecimal notation and are internally transformed in bytes. + If only the encrypt key is specified then it will be used for both encrypting and + decrypting. This command works only if crypt support is compiled in. + @examples: + [example] + [comment]# This is a really lame example :D[/comment] + alias(saylame) + { + window.setCryptEngine $window Lamerizer + say $0- + window.setCryptEngine $window + } + saylame Hello eleet! + [/example] + + @seealso: + [fnc]$asciitohex[/fnc], [fnc]$features[/fnc] +*/ + + +#ifdef COMPILE_CRYPT_SUPPORT +static bool initializeCryptEngine(KviCryptEngine * eng,KviStr &szEncryptKey,KviStr &szDecryptKey,QString &szError) +{ + char * encKey = 0; + int encKeyLen = 0; + + char * tmpKey; + encKeyLen = szEncryptKey.hexToBuffer(&tmpKey,false); + if(encKeyLen > 0) + { + encKey = (char *)kvi_malloc(encKeyLen); + kvi_memmove(encKey,tmpKey,encKeyLen); + KviStr::freeBuffer(tmpKey); + } else { + szError = __tr2qs("The encrypt key wasn't a valid hexadecimal string"); + return false; + } + + char * decKey = 0; + int decKeyLen = 0; + + decKeyLen = szDecryptKey.hexToBuffer(&tmpKey,false); + if(decKeyLen > 0) + { + decKey = (char *)kvi_malloc(decKeyLen); + kvi_memmove(decKey,tmpKey,decKeyLen); + KviStr::freeBuffer(tmpKey); + } else { + szError = __tr2qs("The decrypt key wasn't a valid hexadecimal string"); + return false; + } + bool bRet = eng->init(encKey,encKeyLen,decKey,decKeyLen); + if(!bRet) + szError = eng->lastError(); + if(encKey)kvi_free(encKey); + if(decKey)kvi_free(decKey); + return bRet; +} +#endif + +static bool window_kvs_cmd_setCryptEngine(KviKvsModuleCommandCall * c) +{ + QString szWnd; + QString szEngine; + QString szEncryptKey; + QString szDecryptKey; + KviWindow * pWnd; + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("window_id",KVS_PT_STRING,0,szWnd) + KVSM_PARAMETER("enginename",KVS_PT_STRING,KVS_PF_OPTIONAL,szEngine) + KVSM_PARAMETER("hex_encrypt_key",KVS_PT_STRING,KVS_PF_OPTIONAL,szEncryptKey) + KVSM_PARAMETER("hex_decrypt_key",KVS_PT_STRING,KVS_PF_OPTIONAL,szDecryptKey) + KVSM_PARAMETERS_END(c) + if(szDecryptKey.isEmpty())szDecryptKey = szEncryptKey; +#ifdef COMPILE_CRYPT_SUPPORT + pWnd = g_pApp->findWindow(szWnd.utf8().data()); + if(!pWnd) + { + if(!c->hasSwitch('q',"quiet")) + c->warning(__tr2qs("The window with id '%s' does not exist"),szWnd.utf8().data()); + return true; + } + if(c->hasSwitch('n',"onlydecrypt") && c->hasSwitch('m',"onlyencrypt")) + { + if(!c->hasSwitch('q',"quiet")) + c->warning(__tr2qs("Both -n and -m switchess specified, -n takes precedence")); + } + + if(szEngine.isEmpty()) + { + pWnd->setCryptSessionInfo(0); + } else { + if(szEncryptKey.isEmpty() || szDecryptKey.isEmpty()) + { + if(!c->hasSwitch('q',"quiet")) + c->warning(__tr2qs("No encrypt key specified: can't allocate engine")); + return true; + } + + (void)g_pModuleManager->loadModulesByCaps("crypt"); + + KviCryptEngine * e = g_pCryptEngineManager->allocateEngine(szEngine.utf8().data()); + if(e) + { + KviStr enc = KviStr(szEncryptKey.utf8().data()); + KviStr dec = KviStr(szDecryptKey.utf8().data()); + QString szError; + if(initializeCryptEngine(e,enc,dec,szError)) + { + KviCryptSessionInfo * inf = KviCryptController::allocateCryptSessionInfo(); + inf->pEngine = e; + inf->szEngineName = szEngine; + + inf->bDoEncrypt = (!c->hasSwitch('n',"onlydecrypt")); + inf->bDoDecrypt = (!c->hasSwitch('m',"onlyencrypt")) || c->hasSwitch('n',"onlydecrypt"); + pWnd->setCryptSessionInfo(inf); + } else { + if(szError.isEmpty())szError = __tr2qs("Unknown engine error"); + g_pCryptEngineManager->deallocateEngine(e); + if(!c->hasSwitch('q',"quiet")) + c->warning(__tr2qs("Failed to initialize the specified crypt engine: %Q"),&szError); + } + } else { + if(!c->hasSwitch('q',"quiet")) + c->warning(__tr2qs("The crypt engine \"%Q\" does not exist"),&szEngine); + } + } +#else + if(!c->hasSwitch('q',"quiet")) + c->warning(__tr2qs("This executable has been compiled without crypt support")); +#endif + return true; +} + +static bool window_module_init(KviModule *m) +{ + g_pUserWindowList = new KviPtrList<KviUserWindow>(); + g_pUserWindowList->setAutoDelete(false); + + KVSM_REGISTER_FUNCTION(m,"activityTemperature",window_kvs_fnc_activityTemperature); + KVSM_REGISTER_FUNCTION(m,"activityLevel",window_kvs_fnc_activityLevel); + 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); + KVSM_REGISTER_FUNCTION(m,"isMinimized",window_kvs_fnc_isMinimized); + KVSM_REGISTER_FUNCTION(m,"isMaximized",window_kvs_fnc_isMaximized); + KVSM_REGISTER_FUNCTION(m,"caption",window_kvs_fnc_caption); + KVSM_REGISTER_FUNCTION(m,"type",window_kvs_fnc_type); + KVSM_REGISTER_FUNCTION(m,"exists",window_kvs_fnc_exists); + KVSM_REGISTER_FUNCTION(m,"hasInput",window_kvs_fnc_hasInput); + 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_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); + KVSM_REGISTER_SIMPLE_COMMAND(m,"undock",window_kvs_cmd_undock); + KVSM_REGISTER_SIMPLE_COMMAND(m,"maximize",window_kvs_cmd_maximize); + KVSM_REGISTER_SIMPLE_COMMAND(m,"minimize",window_kvs_cmd_minimize); + KVSM_REGISTER_SIMPLE_COMMAND(m,"restore",window_kvs_cmd_restore); + KVSM_REGISTER_SIMPLE_COMMAND(m,"activate",window_kvs_cmd_activate); + KVSM_REGISTER_SIMPLE_COMMAND(m,"demandAttention",window_kvs_cmd_demandAttention); + KVSM_REGISTER_SIMPLE_COMMAND(m,"listtypes",window_kvs_cmd_listtypes); + KVSM_REGISTER_SIMPLE_COMMAND(m,"setBackground",window_kvs_cmd_setBackground); + KVSM_REGISTER_SIMPLE_COMMAND(m,"setCaption",window_kvs_cmd_setCaption); + KVSM_REGISTER_SIMPLE_COMMAND(m,"setCryptEngine",window_kvs_cmd_setCryptEngine); + KVSM_REGISTER_SIMPLE_COMMAND(m,"setInputText",window_kvs_cmd_setInputText); + KVSM_REGISTER_SIMPLE_COMMAND(m,"insertInInputText",window_kvs_cmd_insertInInputText); + + // saveOutput (view()->saveBuffer()) +/* + m->registerFunction("geometry",window_module_fnc_geometry); + m->registerCommand("setGeometry",window_module_cmd_setGeometry); + + m->registerFunction("isActive",window_module_fnc_isActive); + + + // Output stuff + m->registerFunction("outputBufferSize",window_module_fnc_outputBufferSize); + m->registerCommand("setOutputBufferSize",window_module_cmd_setOutputBufferSize); + + m->registerFunction("outputShowsImages",window_module_fnc_outputShowsImages); + m->registerCommand("setOutputShowsImages",window_module_cmd_setOutputShowsImages); + + m->registerFunction("outputTimestamp",window_module_fnc_outputTimestamp); + m->registerCommand("setOutputTimestamp",window_module_cmd_setOutputTimestamp); + + m->registerFunction("hasOutputBackgroundPixmap",window_module_fnc_hasOutputBackgroundPixmap); + m->registerCommand("setOutputBackgroundPixmap",window_module_cmd_setOutputBackgroundPixmap); + +*/ + return true; +} + +static bool window_module_cleanup(KviModule *m) +{ + while(KviUserWindow * w = g_pUserWindowList->first()) + w->close(); + delete g_pUserWindowList; + return true; +} + +static bool window_module_can_unload(KviModule *m) +{ + return g_pUserWindowList->isEmpty(); +} + +KVIRC_MODULE( + "Window", // module name + "1.0.0", // module version + "Copyright (C) 2001-2004 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "KVIrc window management functions", + window_module_init, + window_module_can_unload, + 0, + window_module_cleanup +) diff --git a/src/modules/window/userwindow.cpp b/src/modules/window/userwindow.cpp new file mode 100644 index 000000000..505e2843e --- /dev/null +++ b/src/modules/window/userwindow.cpp @@ -0,0 +1,107 @@ +//============================================================================= +// +// File : userwindow.cpp +// Created on Mon 30 Aug 2004 15:00:52 by Szymon Stefanek +// +// This file is part of the KVIrc IRC client distribution +// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> +// +// 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. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +//============================================================================= + +#include "userwindow.h" + +#include "kvi_iconmanager.h" +#include "kvi_input.h" +#include "kvi_ircview.h" +#include "kvi_frame.h" +#include "kvi_console.h" + +extern KviPtrList<KviUserWindow> * g_pUserWindowList; + + +KviUserWindow::KviUserWindow(KviFrame * pFrm,const char * name,int iIcon,KviConsole * pConsole,int iCreationFlags) +: KviWindow(KVI_WINDOW_TYPE_USERWINDOW,pFrm,name,pConsole) +{ + g_pUserWindowList->append(this); + + m_iIcon = iIcon; + + m_szPlainTextCaption = name; + m_szHtmlActiveCaption = name; + m_szHtmlInactiveCaption = name; + + // Register ourselves + //connection()->registerChannel(this); + // Central splitter +// m_pSplitter = new QSplitter(QSplitter::Horizontal,this,"main_splitter"); + // Spitted vertially on the left +// m_pVertSplitter = new QSplitter(QSplitter::Vertical,m_pSplitter, +// "vertical_splitter"); + // With the IRC view over + m_pIrcView = new KviIrcView(this,pFrm,this); + // connect(m_pIrcView,SIGNAL(rightClicked()),this,SLOT(textViewRightClicked())); + // The userlist on the right +// m_pUserListView = new KviUserListView(m_pSplitter,connection()->userDataBase(),this, +// AVERAGE_CHANNEL_USERS,__tr2qs("User List"),"user_list_view"); + // And finally the input line on the bottom + if(iCreationFlags & HasInput) + m_pInput = new KviInput(this,0); + else + m_pInput = 0; + // applyOptions(); + + if(context())context()->registerContextWindow(this); +} + +KviUserWindow::~KviUserWindow() +{ + if(context())context()->unregisterContextWindow(this); + g_pUserWindowList->removeRef(this); +} + +QPixmap * KviUserWindow::myIconPtr() +{ + return g_pIconManager->getSmallIcon(m_iIcon); +} + +void KviUserWindow::resizeEvent(QResizeEvent *e) +{ + if(m_pInput) + { + int hght = m_pInput->heightHint(); + m_pIrcView->setGeometry(0,0,width(),height() - hght); + m_pInput->setGeometry(0,height() - hght,width(),hght); + } else { + m_pIrcView->setGeometry(0,0,width(),height()); + } +} + +void KviUserWindow::fillCaptionBuffers() +{ + // nothing here +} + +void KviUserWindow::setCaptionStrings(const QString &szPlainText,const QString &szHtmlInactive,const QString &szHtmlActive) +{ + m_szPlainTextCaption = szPlainText; + m_szHtmlActiveCaption = szHtmlActive; + m_szHtmlInactiveCaption = szHtmlInactive; + if(m_szHtmlActiveCaption.isEmpty())m_szHtmlActiveCaption = szPlainText; + if(m_szHtmlInactiveCaption.isEmpty())m_szHtmlInactiveCaption = szPlainText; + updateCaption(); +} + diff --git a/src/modules/window/userwindow.h b/src/modules/window/userwindow.h new file mode 100644 index 000000000..ec0d2d12c --- /dev/null +++ b/src/modules/window/userwindow.h @@ -0,0 +1,48 @@ +#ifndef _USERWINDOW_H_ +#define _USERWINDOW_H_ +//============================================================================= +// +// File : userwindow.h +// Created on Mon 30 Aug 2004 15:00:52 by Szymon Stefanek +// +// This file is part of the KVIrc IRC client distribution +// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> +// +// 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. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +//============================================================================= + +#include "kvi_settings.h" +#include "kvi_window.h" + +class KviUserWindow : public KviWindow +{ + Q_OBJECT +public: + enum CreationFlags { HasInput = 1 }; +public: + KviUserWindow(KviFrame * pFrm,const char * name,int iIcon,KviConsole * pConsole = 0,int iCreationFlags = 0); + ~KviUserWindow(); +protected: + int m_iIcon; +protected: + virtual void resizeEvent(QResizeEvent *e); + virtual QPixmap * myIconPtr(); + virtual void fillCaptionBuffers(); +public: + void setCaptionStrings(const QString &szPlainText,const QString &szHtmlInactive,const QString &szHtmlActive); +}; + +#endif //!_USERWINDOW_H_ diff --git a/src/modules/window/window.vcproj b/src/modules/window/window.vcproj new file mode 100755 index 000000000..50d3bbc51 --- /dev/null +++ b/src/modules/window/window.vcproj @@ -0,0 +1,174 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="7.10" + Name="window" + ProjectGUID="{74B66905-5BD2-4639-9955-7AFBFCAD9C19}" + RootNamespace="window" + Keyword="Win32Proj"> + <Platforms> + <Platform + Name="Win32"/> + </Platforms> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="$(SolutionDir)\win32build\bin\modules" + IntermediateDirectory="Debug" + ConfigurationType="2" + CharacterSet="2"> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui"" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;WINDOW_EXPORTS" + MinimalRebuild="TRUE" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="TRUE" + DebugInformationFormat="4"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="qt-mtnc321.lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib kvirc.lib msvcrt.lib" + OutputFile="$(OutDir)/kvi$(ProjectName).dll" + LinkIncremental="2" + AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin"" + IgnoreAllDefaultLibraries="TRUE" + GenerateDebugInformation="TRUE" + ProgramDatabaseFile="$(OutDir)/window.pdb" + SubSystem="2" + ImportLibrary="$(OutDir)/window.lib" + TargetMachine="1"/> + <Tool + Name="VCMIDLTool"/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="$(SolutionDir)\win32build\bin\modules" + IntermediateDirectory="Release" + ConfigurationType="2" + CharacterSet="2"> + <Tool + Name="VCCLCompilerTool" + GlobalOptimizations="TRUE" + InlineFunctionExpansion="2" + FavorSizeOrSpeed="1" + OmitFramePointers="TRUE" + EnableFiberSafeOptimizations="TRUE" + AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui"" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;WINDOW_EXPORTS" + RuntimeLibrary="0" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="TRUE" + DebugInformationFormat="3"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="qt-mtnc321.lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib kvirc.lib msvcrt.lib" + OutputFile="$(OutDir)/kvi$(ProjectName).dll" + LinkIncremental="1" + AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin"" + IgnoreAllDefaultLibraries="TRUE" + GenerateDebugInformation="TRUE" + SubSystem="2" + OptimizeReferences="2" + EnableCOMDATFolding="2" + OptimizeForWindows98="1" + ImportLibrary="$(OutDir)/window.lib" + TargetMachine="1"/> + <Tool + Name="VCMIDLTool"/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> + <File + RelativePath=".\libkviwindow.cpp"> + </File> + <File + RelativePath=".\moc_userwindow.cpp"> + </File> + <File + RelativePath=".\userwindow.cpp"> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> + <File + RelativePath=".\userwindow.h"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" +" + Outputs="$(InputDir)\moc_$(InputName).cpp"/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" +" + Outputs="$(InputDir)\moc_$(InputName).cpp"/> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/src/modules/window/window_vc05.vcproj b/src/modules/window/window_vc05.vcproj new file mode 100644 index 000000000..53094bf26 --- /dev/null +++ b/src/modules/window/window_vc05.vcproj @@ -0,0 +1,261 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8,00" + Name="window" + ProjectGUID="{74B66905-5BD2-4639-9955-7AFBFCAD9C19}" + RootNamespace="window" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="$(SolutionDir)\win32build\bin\modules\" + IntermediateDirectory="Debug" + ConfigurationType="2" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui"" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;WINDOW_EXPORTS;_CRT_SECURE_NO_DEPRECATE" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="qt-$(QTTAG).lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib kvirc.lib msvcrt.lib perl58.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib" + OutputFile="$(OutDir)/kvi$(ProjectName).dll" + LinkIncremental="2" + AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)"" + GenerateManifest="true" + IgnoreAllDefaultLibraries="true" + GenerateDebugInformation="true" + ProgramDatabaseFile="$(OutDir)/window.pdb" + SubSystem="2" + TurnOffAssemblyGeneration="true" + ImportLibrary="$(OutDir)/window.lib" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + EmbedManifest="true" + VerboseOutput="true" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="$(SolutionDir)\win32build\bin\modules" + IntermediateDirectory="Release" + ConfigurationType="2" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="1" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="2" + OmitFramePointers="true" + EnableFiberSafeOptimizations="true" + WholeProgramOptimization="true" + AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui"" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;WINDOW_EXPORTS;_CRT_SECURE_NO_DEPRECATE" + StringPooling="true" + MinimalRebuild="true" + ExceptionHandling="1" + RuntimeLibrary="0" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="qt-$(QTTAG).lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib kvirc.lib msvcrt.lib perl58.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib" + OutputFile="$(OutDir)/kvi$(ProjectName).dll" + LinkIncremental="1" + AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)"" + GenerateManifest="true" + IgnoreAllDefaultLibraries="true" + GenerateDebugInformation="true" + SubSystem="2" + OptimizeReferences="2" + EnableCOMDATFolding="2" + OptimizeForWindows98="1" + LinkTimeCodeGeneration="1" + TurnOffAssemblyGeneration="true" + ImportLibrary="$(OutDir)/window.lib" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + EmbedManifest="true" + VerboseOutput="true" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" + > + <File + RelativePath=".\libkviwindow.cpp" + > + </File> + <File + RelativePath=".\moc_userwindow.cpp" + > + </File> + <File + RelativePath=".\userwindow.cpp" + > + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" + > + <File + RelativePath=".\userwindow.h" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCustomBuildTool" + CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)"
" + Outputs="$(InputDir)\moc_$(InputName).cpp" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCustomBuildTool" + CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)"
" + Outputs="$(InputDir)\moc_$(InputName).cpp" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" + > + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> |
