aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/dockwidget
diff options
context:
space:
mode:
authorGravatar Elvio Basello2008-03-27 03:03:51 +0000
committerGravatar Elvio Basello2008-03-27 03:03:51 +0000
commit5e9190bbe27bdfe9be90691cbb47c7d1ffc57347 (patch)
tree0b25976cf8f2b2b09587a6350e5300c1ad86516b /src/modules/dockwidget
parentsmall fix (diff)
downloadKVIrc-5e9190bbe27bdfe9be90691cbb47c7d1ffc57347.tar.gz
KVIrc-5e9190bbe27bdfe9be90691cbb47c7d1ffc57347.tar.bz2
KVIrc-5e9190bbe27bdfe9be90691cbb47c7d1ffc57347.zip
renamed module dockwidget in trayicon;
small fixes around; git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1297 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/dockwidget')
-rw-r--r--src/modules/dockwidget/.svnignore12
-rw-r--r--src/modules/dockwidget/Makefile.am33
-rwxr-xr-xsrc/modules/dockwidget/dockwidget.vcproj166
-rw-r--r--src/modules/dockwidget/dockwidget_QT4_vc05.vcproj271
-rw-r--r--src/modules/dockwidget/dockwidget_vc05.vcproj286
-rw-r--r--src/modules/dockwidget/kvi_dock.pngbin1960 -> 0 bytes
-rw-r--r--src/modules/dockwidget/kvi_dock_part-0.pngbin1478 -> 0 bytes
-rw-r--r--src/modules/dockwidget/kvi_dock_part-1.pngbin1028 -> 0 bytes
-rw-r--r--src/modules/dockwidget/kvi_dock_part-2.pngbin1035 -> 0 bytes
-rw-r--r--src/modules/dockwidget/kvi_dock_win32-0.pngbin1343 -> 0 bytes
-rw-r--r--src/modules/dockwidget/kvi_dock_win32-1.pngbin695 -> 0 bytes
-rw-r--r--src/modules/dockwidget/kvi_dock_win32-2.pngbin680 -> 0 bytes
-rwxr-xr-xsrc/modules/dockwidget/kvi_dock_win32.pngbin1299 -> 0 bytes
-rw-r--r--src/modules/dockwidget/kvidockwidget.dsp139
-rw-r--r--src/modules/dockwidget/kvidockwidget.dsw29
-rw-r--r--src/modules/dockwidget/libkvidockwidget.h34
-rw-r--r--src/modules/dockwidget/libkvidockwidget_qt3.cpp858
-rw-r--r--src/modules/dockwidget/libkvidockwidget_qt3.h95
-rw-r--r--src/modules/dockwidget/libkvidockwidget_qt4.cpp691
-rw-r--r--src/modules/dockwidget/libkvidockwidget_qt4.h81
-rw-r--r--src/modules/dockwidget/trayicon.cpp296
-rw-r--r--src/modules/dockwidget/trayicon.h100
-rw-r--r--src/modules/dockwidget/trayicon_mac.cpp25
-rw-r--r--src/modules/dockwidget/trayicon_win.cpp263
-rw-r--r--src/modules/dockwidget/trayicon_x11.cpp416
25 files changed, 0 insertions, 3795 deletions
diff --git a/src/modules/dockwidget/.svnignore b/src/modules/dockwidget/.svnignore
deleted file mode 100644
index 679d79f70..000000000
--- a/src/modules/dockwidget/.svnignore
+++ /dev/null
@@ -1,12 +0,0 @@
-Makefile.in
-Makefile
-.deps
-*.o
-*.lo
-*.la
-*.moc
-.libs
-.mospics
-.pics
-.xvpics
-moc_*
diff --git a/src/modules/dockwidget/Makefile.am b/src/modules/dockwidget/Makefile.am
deleted file mode 100644
index 71a2f0239..000000000
--- a/src/modules/dockwidget/Makefile.am
+++ /dev/null
@@ -1,33 +0,0 @@
-###############################################################################
-# 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 = libkvidockwidget.la
-
-libkvidockwidget_la_LDFLAGS = -module -avoid-version $(SS_LDFLAGS) $(SS_LIBDIRS)
-
-libkvidockwidget_la_SOURCES = libkvidockwidget_qt3.cpp libkvidockwidget_qt4.cpp
-
-#nodist_libkvidockwidget_la_SOURCES = moc_trayicon.cpp
-
-libkvidockwidget_la_LIBADD = $(SS_LIBLINK) ../../kvilib/build/libkvilib.la
-
-noinst_HEADERS= libkvidockwidget.h libkvidockwidget_qt4.h libkvidockwidget_qt3.h
-
-tmpdir = $(picsdir)
-
-tmp_DATA = kvi_dock.png kvi_dock_part-0.png kvi_dock_part-1.png kvi_dock_part-2.png
-
-EXTRA_DIST = $(tmp_DATA)
-
-%.moc: %.h
- $(SS_QT_MOC) $< -o $@
-
-moc_%.cpp: %.h
- $(SS_QT_MOC) $< -o $@
-
-libkvidockwidget_qt3.cpp: libkvidockwidget_qt3.moc
-libkvidockwidget_qt4.cpp: libkvidockwidget_qt4.moc
diff --git a/src/modules/dockwidget/dockwidget.vcproj b/src/modules/dockwidget/dockwidget.vcproj
deleted file mode 100755
index 10e30dfdd..000000000
--- a/src/modules/dockwidget/dockwidget.vcproj
+++ /dev/null
@@ -1,166 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="dockwidget"
- ProjectGUID="{4528E26C-195B-4EEE-BEC4-8CD73C564B0D}"
- 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="&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DOCKWIDGET_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="&quot;$(SSLLIBDIR)&quot;;&quot;$(QTDIR)\lib&quot;;&quot;$(SolutionDir)\win32build\bin&quot;"
- IgnoreAllDefaultLibraries="TRUE"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/dockwidget.pdb"
- SubSystem="2"
- ImportLibrary="$(OutDir)/dockwidget.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"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DOCKWIDGET_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="&quot;$(SSLLIBDIR)&quot;;&quot;$(QTDIR)\lib&quot;;&quot;$(SolutionDir)\win32build\bin&quot;"
- IgnoreAllDefaultLibraries="TRUE"
- GenerateDebugInformation="TRUE"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="1"
- ImportLibrary="$(OutDir)/dockwidget.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=".\libkvidockwidget.cpp">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- <File
- RelativePath=".\libkvidockwidget.h">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCustomBuildTool"
- CommandLine="$(QTDIR)\bin\moc -o &quot;$(InputDir)\$(InputName).moc&quot; &quot;$(InputDir)\$(InputFileName)&quot;
-"
- Outputs="$(InputDir)\$(InputName).moc"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCustomBuildTool"
- CommandLine="$(QTDIR)\bin\moc -o $(InputDir)\$(InputName).moc $(InputDir)\$(InputFileName)
-"
- Outputs="$(InputDir)\$(InputName).moc"/>
- </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/dockwidget/dockwidget_QT4_vc05.vcproj b/src/modules/dockwidget/dockwidget_QT4_vc05.vcproj
deleted file mode 100644
index e6c5597b2..000000000
--- a/src/modules/dockwidget/dockwidget_QT4_vc05.vcproj
+++ /dev/null
@@ -1,271 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8,00"
- Name="dockwidget"
- ProjectGUID="{4528E26C-195B-4EEE-BEC4-8CD73C564B0D}"
- RootNamespace="dockwidget"
- 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="&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DOCKWIDGET_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="qt3support4.lib qtcore4.lib qtgui4.lib qtmain.lib kvilib.lib kvirc.lib"
- OutputFile="$(OutDir)/kvi$(ProjectName).dll"
- LinkIncremental="2"
- AdditionalLibraryDirectories="&quot;$(SSLLIBDIR)&quot;;&quot;$(PERLDIR)\lib\CORE&quot;;&quot;$(QTDIR)\lib&quot;;&quot;$(SolutionDir)\win32build\bin&quot;;&quot;$(ZLIBLIBDIR)&quot;"
- GenerateManifest="true"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/dockwidget.pdb"
- SubSystem="2"
- TurnOffAssemblyGeneration="true"
- ImportLibrary="$(OutDir)/dockwidget.lib"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest"
- 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="1"
- OmitFramePointers="true"
- EnableFiberSafeOptimizations="true"
- WholeProgramOptimization="true"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DOCKWIDGET_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
- StringPooling="true"
- MinimalRebuild="true"
- ExceptionHandling="1"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="kvilib.lib kvirc.lib qt3support4.lib qtgui4.lib qtcore4.lib"
- OutputFile="$(OutDir)/kvi$(ProjectName).dll"
- LinkIncremental="1"
- AdditionalLibraryDirectories="&quot;$(SSLLIBDIR)&quot;;&quot;$(PERLDIR)\lib\CORE&quot;;&quot;$(QTDIR)\lib&quot;;&quot;$(SolutionDir)\win32build\bin&quot;;&quot;$(ZLIBLIBDIR)&quot;"
- GenerateManifest="true"
- IgnoreAllDefaultLibraries="false"
- GenerateDebugInformation="true"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="1"
- LinkTimeCodeGeneration="1"
- TurnOffAssemblyGeneration="true"
- ImportLibrary="$(OutDir)/dockwidget.lib"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest"
- EmbedManifest="false"
- 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=".\libkvidockwidget_qt4.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath=".\libkvidockwidget.h"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- CommandLine="$(QTDIR)\bin\moc -o &quot;$(InputDir)\$(InputName).moc&quot; &quot;$(InputDir)\$(InputFileName)&quot;&#x0D;&#x0A;"
- Outputs="$(InputDir)\$(InputName).moc"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- CommandLine=""
- Outputs=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath=".\libkvidockwidget_qt4.h"
- >
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- CommandLine="$(QTDIR)\bin\moc -o &quot;$(InputDir)\$(InputName).moc&quot; &quot;$(InputDir)\$(InputFileName)&quot;&#x0D;&#x0A;"
- Outputs="$(InputDir)\$(InputName).moc"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath=".\trayicon.h"
- >
- </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/dockwidget/dockwidget_vc05.vcproj b/src/modules/dockwidget/dockwidget_vc05.vcproj
deleted file mode 100644
index e62f7e5c3..000000000
--- a/src/modules/dockwidget/dockwidget_vc05.vcproj
+++ /dev/null
@@ -1,286 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8,00"
- Name="dockwidget"
- ProjectGUID="{4528E26C-195B-4EEE-BEC4-8CD73C564B0D}"
- RootNamespace="dockwidget"
- 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="&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DOCKWIDGET_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- 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="&quot;$(SSLLIBDIR)&quot;;&quot;$(PERLDIR)\lib\CORE&quot;;&quot;$(QTDIR)\lib&quot;;&quot;$(SolutionDir)\win32build\bin&quot;;&quot;$(ZLIBLIBDIR)&quot;"
- GenerateManifest="true"
- IgnoreAllDefaultLibraries="true"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/dockwidget.pdb"
- SubSystem="2"
- TurnOffAssemblyGeneration="true"
- ImportLibrary="$(OutDir)/dockwidget.lib"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest"
- 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"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DOCKWIDGET_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
- StringPooling="true"
- MinimalRebuild="false"
- ExceptionHandling="1"
- RuntimeLibrary="0"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- />
- <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="&quot;$(SSLLIBDIR)&quot;;&quot;$(PERLDIR)\lib\CORE&quot;;&quot;$(QTDIR)\lib&quot;;&quot;$(SolutionDir)\win32build\bin&quot;;&quot;$(ZLIBLIBDIR)&quot;"
- GenerateManifest="true"
- IgnoreAllDefaultLibraries="true"
- GenerateDebugInformation="true"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="1"
- TurnOffAssemblyGeneration="true"
- ImportLibrary="$(OutDir)/dockwidget.lib"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest"
- EmbedManifest="false"
- 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=".\libkvidockwidget_qt3.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath=".\libkvidockwidget.h"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- CommandLine="$(QTDIR)\bin\moc -o &quot;$(InputDir)\$(InputName).moc&quot; &quot;$(InputDir)\$(InputFileName)&quot;&#x0D;&#x0A;"
- Outputs="$(InputDir)\$(InputName).moc"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- CommandLine=""
- Outputs=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath=".\libkvidockwidget_qt3.h"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Moc&apos;ing libkvidockwidget_qt3.h..."
- CommandLine="$(QTDIR)\bin\moc -o &quot;$(InputDir)\$(InputName).moc&quot; &quot;$(InputDir)\$(InputFileName)&quot;&#x0D;&#x0A;"
- AdditionalDependencies="$(QTDIR)\bin\moc.exe;.\libkvidockwidget_qt3.h"
- Outputs="$(InputDir)\$(InputName).moc"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Moc&apos;ing libkvidockwidget_qt3.h..."
- CommandLine="$(QTDIR)\bin\moc -o &quot;$(InputDir)\$(InputName).moc&quot; &quot;$(InputDir)\$(InputFileName)&quot;&#x0D;&#x0A;"
- AdditionalDependencies="$(QTDIR)\bin\moc.exe;.\libkvidockwidget_qt3.h"
- Outputs="$(InputDir)\$(InputName).moc"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath=".\libkvidockwidget_qt3.h"
- >
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- CommandLine="$(QTDIR)\bin\moc -o &quot;$(InputDir)\moc_$(InputName).cpp&quot; &quot;$(InputDir)\$(InputFileName)&quot;&#x0D;&#x0A;"
- 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/dockwidget/kvi_dock.png b/src/modules/dockwidget/kvi_dock.png
deleted file mode 100644
index 16f99fb1c..000000000
--- a/src/modules/dockwidget/kvi_dock.png
+++ /dev/null
Binary files differ
diff --git a/src/modules/dockwidget/kvi_dock_part-0.png b/src/modules/dockwidget/kvi_dock_part-0.png
deleted file mode 100644
index a01c49408..000000000
--- a/src/modules/dockwidget/kvi_dock_part-0.png
+++ /dev/null
Binary files differ
diff --git a/src/modules/dockwidget/kvi_dock_part-1.png b/src/modules/dockwidget/kvi_dock_part-1.png
deleted file mode 100644
index bd326e80f..000000000
--- a/src/modules/dockwidget/kvi_dock_part-1.png
+++ /dev/null
Binary files differ
diff --git a/src/modules/dockwidget/kvi_dock_part-2.png b/src/modules/dockwidget/kvi_dock_part-2.png
deleted file mode 100644
index 949056eb5..000000000
--- a/src/modules/dockwidget/kvi_dock_part-2.png
+++ /dev/null
Binary files differ
diff --git a/src/modules/dockwidget/kvi_dock_win32-0.png b/src/modules/dockwidget/kvi_dock_win32-0.png
deleted file mode 100644
index c1d7c7efe..000000000
--- a/src/modules/dockwidget/kvi_dock_win32-0.png
+++ /dev/null
Binary files differ
diff --git a/src/modules/dockwidget/kvi_dock_win32-1.png b/src/modules/dockwidget/kvi_dock_win32-1.png
deleted file mode 100644
index cf65b4a6c..000000000
--- a/src/modules/dockwidget/kvi_dock_win32-1.png
+++ /dev/null
Binary files differ
diff --git a/src/modules/dockwidget/kvi_dock_win32-2.png b/src/modules/dockwidget/kvi_dock_win32-2.png
deleted file mode 100644
index fbaf5877c..000000000
--- a/src/modules/dockwidget/kvi_dock_win32-2.png
+++ /dev/null
Binary files differ
diff --git a/src/modules/dockwidget/kvi_dock_win32.png b/src/modules/dockwidget/kvi_dock_win32.png
deleted file mode 100755
index afec5798c..000000000
--- a/src/modules/dockwidget/kvi_dock_win32.png
+++ /dev/null
Binary files differ
diff --git a/src/modules/dockwidget/kvidockwidget.dsp b/src/modules/dockwidget/kvidockwidget.dsp
deleted file mode 100644
index 85e5cbbb9..000000000
--- a/src/modules/dockwidget/kvidockwidget.dsp
+++ /dev/null
@@ -1,139 +0,0 @@
-# Microsoft Developer Studio Project File - Name="kvidockwidget" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=kvidockwidget - 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 "kvidockwidget.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 "kvidockwidget.mak" CFG="kvidockwidget - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "kvidockwidget - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "kvidockwidget - 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)" == "kvidockwidget - 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 "KVIDOCKWIDGET_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /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 "KVIDOCKWIDGET_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 0x410 /d "NDEBUG"
-# ADD RSC /l 0x410 /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 kvirc.lib kernel32.lib 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 /machine:I386 /out:"..\..\..\win32build\bin\modules\kvidockwidget.dll" /libpath:"C:\OpenSSL\lib\VC" /libpath:"..\..\kvilib\Release" /libpath:"..\..\kvirc\Release"
-
-!ELSEIF "$(CFG)" == "kvidockwidget - 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 "KVIDOCKWIDGET_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 "KVIDCC_EXPORTS" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /Fp"Debug/kvidcc.pch" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x410 /d "_DEBUG"
-# ADD RSC /l 0x410 /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 imm32.lib wsock32.lib winmm.lib kvirc.lib kernel32.lib 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\kvidockwidget.dll" /pdbtype:sept /libpath:"C:\OpenSSL\lib\VC" /libpath:"..\..\kvilib\Debug" /libpath:"..\..\kvirc\Debug"
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF
-
-# Begin Target
-
-# Name "kvidockwidget - Win32 Release"
-# Name "kvidockwidget - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\libkvidockwidget.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\libkvidockwidget.h
-
-!IF "$(CFG)" == "kvidockwidget - Win32 Release"
-
-# Begin Custom Build
-InputDir=.
-InputPath=.\libkvidockwidget.h
-InputName=libkvidockwidget
-
-"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "kvidockwidget - Win32 Debug"
-
-# Begin Custom Build
-InputDir=.
-InputPath=.\libkvidockwidget.h
-InputName=libkvidockwidget
-
-"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc
-
-# 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/dockwidget/kvidockwidget.dsw b/src/modules/dockwidget/kvidockwidget.dsw
deleted file mode 100644
index 067707c5f..000000000
--- a/src/modules/dockwidget/kvidockwidget.dsw
+++ /dev/null
@@ -1,29 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "kvidockwidget"=.\kvidockwidget.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/src/modules/dockwidget/libkvidockwidget.h b/src/modules/dockwidget/libkvidockwidget.h
deleted file mode 100644
index 81f20bae7..000000000
--- a/src/modules/dockwidget/libkvidockwidget.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef _KVI_TAL_DOCK_H_
-#define _KVI_TAL_DOCK_H_
-
-//
-// File : libkvidockwidget.h
-// Creation date : Sun Jun 18 2000 12:53:08 by Szymon Stefanek
-//
-// This file is part of the KVirc irc client distribution
-// Copyright (C) 1999-2000 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"
-
-#ifdef COMPILE_USE_QT4
- #include "libkvidockwidget_qt4.h"
-#else
- #include "libkvidockwidget_qt3.h"
-#endif
-
-#endif // _KVI_TAL_DOCK_H_
diff --git a/src/modules/dockwidget/libkvidockwidget_qt3.cpp b/src/modules/dockwidget/libkvidockwidget_qt3.cpp
deleted file mode 100644
index 798718709..000000000
--- a/src/modules/dockwidget/libkvidockwidget_qt3.cpp
+++ /dev/null
@@ -1,858 +0,0 @@
-//
-// File : libkvidockwidget.cpp
-// Creation date : Tue Jan 02 20001 14:34:12 CEST by Szymon Stefanek
-//
-// This file is part of the KVirc irc client distribution
-// Copyright (C) 2000-2001 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"
-#ifndef COMPILE_USE_QT4
-
-#include "kvi_app.h"
-#include "kvi_module.h"
-#include "kvi_locale.h"
-#include "kvi_memmove.h"
-#include "kvi_taskbar.h"
-#include "kvi_window.h"
-#include "kvi_dynamictooltip.h"
-#include "kvi_iconmanager.h"
-#include "kvi_internalcmd.h"
-#include "kvi_console.h"
-#include "kvi_ircconnection.h"
-#include "kvi_ircconnectionuserinfo.h"
-#include "kvi_imagelib.h"
-#include "kvi_options.h"
-#include "kvi_ircview.h"
-
-#include "libkvidockwidget.h"
-#include "kvi_doublebuffer.h"
-
-#ifdef COMPILE_KDE_SUPPORT
- #include <kwin.h>
- #include <kpopupmenu.h>
-#else
- #include <qlabel.h>
-#endif
-
-#include "kvi_tal_popupmenu.h"
-
-
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <qtimer.h>
-#include <qevent.h>
-#include <qregexp.h>
-
-#include <stdlib.h>
-#include <time.h>
-
-#ifdef COMPILE_ON_WINDOWS
- #include <windows.h>
-
- #include <qbitmap.h>
- #include <qcursor.h>
-
- #define ID_DOCKWIDGET_TASKBAR_ICON 0xdeadbeef
- #define WM_KVIRC_NOTIFY_ICON_MESSAGE (WM_USER + 0xbeef)
-
- static UINT WM_KVIRC_TASKBAR_CREATED = 0;
-#else
-#ifndef Q_OS_MACX
- #include <X11/Xlib.h>
-
- //const int XFocusOut = FocusOut;
- const int XFocusIn = FocusIn;
- #undef FocusOut
- #undef FocusIn
- #undef KeyPress
- #undef KeyRelease
-
- //#warning "Later remove this stuff and use a wrapper for #include <X11/Xlib.h>"
- #ifdef Bool
- #undef Bool
- #endif
-#endif
-#endif
-
-extern KVIRC_API KviPointerHashTable<const char *,KviWindow> * g_pGlobalWindowDict;
-static KviPointerList<KviDockWidget> * g_pDockWidgetList = 0;
-
-static QPixmap * g_pDock1 = 0;
-static QPixmap * g_pDock2 = 0;
-static QPixmap * g_pDock3 = 0;
-
-#ifdef COMPILE_ON_WINDOWS
- static HICON g_pCurrentIcon = 0;
- static QPixmap * g_pCurrentPixmap = 0;
-#endif
-
-
-KviDockWidget::KviDockWidget(KviFrame * frm,const char * name)
-: QWidget(0,name)
-{
- m_iConsoles = 0;
- m_iChannels = 0;
- m_iQueries = 0;
- m_iOther = 0;
-
- m_pFlashingTimer = new QTimer(this,"flashing_timer");
- connect( m_pFlashingTimer, SIGNAL(timeout()), this, SLOT(flashingTimerShot()) );
- m_bFlashed=0;
- g_pDockWidgetList->append(this);
- m_pFrm = frm;
- m_pFrm->setDockExtension(this);
-
-#ifdef COMPILE_ON_WINDOWS
- // kode54
- if(!WM_KVIRC_TASKBAR_CREATED)WM_KVIRC_TASKBAR_CREATED = RegisterWindowMessage(TEXT("TaskbarCreated"));
- createTaskbarIcon();
-#else //!COMPILE_ON_WINDOWS
- setMinimumSize(22,22);
- #ifndef COMPILE_USE_QT4
- setBackgroundMode(X11ParentRelative);
- #endif
- #ifdef COMPILE_KDE_SUPPORT
- KWin::setSystemTrayWindowFor(winId(),frm->winId());
- #endif
-#endif //!COMPILE_ON_WINDOWS
-
-#ifdef COMPILE_USE_QT4
- m_pSysTrayIcon = new QSystemTrayIcon(m_pFrm);
-#endif
-
- m_pTip = new KviDynamicToolTip(this,"dock_tooltip");
- connect(m_pTip,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &)));
-
- m_pAwayPopup = new KviTalPopupMenu(this);
-
-#ifdef COMPILE_KDE_SUPPORT
- m_pContextPopup = new KPopupMenu(this);
- m_pContextPopup->insertTitle(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_KVIRC)),__tr2qs("KVIrc"));
-#else
- m_pContextPopup = new KviTalPopupMenu(this);
-#ifndef COMPILE_USE_QT4
- QLabel * l = new QLabel(__tr2qs("KVIrc"),m_pContextPopup);
- l->setFrameStyle(QFrame::Raised | QFrame::StyledPanel);
- m_pContextPopup->insertItem(l);
-#endif
-#endif
- m_pContextPopup->setCaption(__tr2qs("Context"));
- m_iAwayMenuId = m_pContextPopup->insertItem ( __tr2qs("Away"), m_pAwayPopup);
- m_pContextPopup->changeItem(m_iAwayMenuId,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_AWAY)),__tr2qs("Away"));
-
- int id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_OPTIONS)),__tr2qs("&Configure KVIrc..."),m_pFrm,SLOT(executeInternalCommand(int)));
- m_pContextPopup->setItemParameter(id,KVI_INTERNALCOMMAND_OPTIONS_DIALOG);
- id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_KVIRC)),__tr2qs("&About KVIrc"),m_pFrm,SLOT(executeInternalCommand(int)));
- m_pContextPopup->setItemParameter(id,KVI_INTERNALCOMMAND_ABOUT_ABOUTKVIRC);
- m_pContextPopup->insertSeparator();
- m_iToggleFrame = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_RAW)),QString(""),this,SLOT(toggleParentFrame()));
- m_pContextPopup->insertSeparator();
- id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DOCKWIDGET)),__tr2qs("Un&dock"),m_pFrm,SLOT(executeInternalCommand(int)));
- m_pContextPopup->setItemParameter(id,KVI_INTERNALCOMMAND_DOCKWIDGET_HIDE);
- id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_QUITAPP)),__tr2qs("&Quit"),g_pApp,SLOT(quit()));
- m_pContextPopup->setAccel(__tr2qs("Ctrl+Q"),id);
- connect(m_pContextPopup,SIGNAL(aboutToShow()),this,SLOT(fillContextPopup()));
-}
-
-
-KviDockWidget::~KviDockWidget()
-{
-#ifdef COMPILE_ON_WINDOWS
- destroyTaskbarIcon();
-#endif
- m_pFrm->setDockExtension(0);
- g_pDockWidgetList->removeRef(this);
-}
-
-void KviDockWidget::die()
-{
- delete this;
-}
-void KviDockWidget::flashingTimerShot()
-{
- m_bFlashed=!m_bFlashed;
-#ifdef COMPILE_ON_WINDOWS
- updateTaskbarIcon();
-#else
- update();
-#endif
-}
-
-#ifdef COMPILE_ON_WINDOWS
-void KviDockWidget::createTaskbarIcon()
-{
- ICONINFO inf;
- g_pCurrentPixmap=new QPixmap(*g_pDock1);
- inf.hbmColor = g_pCurrentPixmap->hbm();
- if(!g_pCurrentPixmap->mask())g_pCurrentPixmap->setMask(g_pCurrentPixmap->createHeuristicMask());
- inf.hbmMask = g_pCurrentPixmap->mask()->hbm();
- g_pCurrentIcon=CreateIconIndirect(&inf);
-
- NOTIFYICONDATA nid;
- nid.cbSize = sizeof(nid);
- nid.hWnd = winId();
- nid.uID = ID_DOCKWIDGET_TASKBAR_ICON;
- nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
- nid.uCallbackMessage = WM_KVIRC_NOTIFY_ICON_MESSAGE;
- kvi_memmove(nid.szTip,"KVIrc",6);
- nid.hIcon = g_pCurrentIcon;
- Shell_NotifyIcon(NIM_ADD,&nid);
-}
-
-void KviDockWidget::destroyTaskbarIcon()
-{
- NOTIFYICONDATA nid;
- nid.cbSize = sizeof(nid);
- nid.hWnd = winId();
- nid.uID = ID_DOCKWIDGET_TASKBAR_ICON;
- nid.uFlags = 0;
- Shell_NotifyIcon(NIM_DELETE,&nid);
-}
-
-void KviDockWidget::updateTaskbarIcon()
-{
- ICONINFO inf;
- QPixmap* pix = m_bFlashed ? g_pIconManager->getSmallIcon(KVI_SMALLICON_MESSAGE) : g_pCurrentPixmap;
- inf.hbmColor = pix->hbm();
- if(!pix->mask())pix->setMask(pix->createHeuristicMask());
- inf.hbmMask = pix->mask()->hbm();
- HICON hIcon=CreateIconIndirect(&inf);
-
- NOTIFYICONDATA nid;
- nid.cbSize = sizeof(nid);
- nid.hWnd = winId();
- nid.uID = ID_DOCKWIDGET_TASKBAR_ICON;
- nid.uFlags = NIF_ICON;
- nid.hIcon = hIcon;
- Shell_NotifyIcon(NIM_MODIFY,&nid);
- DestroyIcon(g_pCurrentIcon);
- g_pCurrentIcon=hIcon;
-}
-
-bool KviDockWidget::winEvent(MSG * m)
-{
- if(m->message == WM_KVIRC_NOTIFY_ICON_MESSAGE)
- {
- if(m->wParam == ID_DOCKWIDGET_TASKBAR_ICON)
- {
- switch(m->lParam)
- {
- case WM_MOUSEMOVE:
- tipRequest(m_pTip,QCursor::pos());
- break;
- case WM_LBUTTONDOWN:
- toggleParentFrame();
- break;
- case WM_RBUTTONDOWN:
- m_pContextPopup->popup(QCursor::pos());
- break;
- }
- return true;
- }
- } else if(m->message == WM_KVIRC_TASKBAR_CREATED)
- {
- // kode54 : when the window shell dies and is restarted
- // it sends the "TaskbarCreated" message to all the toplevel windows
- // We recreate the taskbar icon then
- createTaskbarIcon();
- refresh();
- }
- return false;
-}
-
-#endif
-
-#define NIDLEMSGS 18
-
-static const char * idlemsgs[NIDLEMSGS]=
-{
- __tr("Nothing is happening...") ,
- __tr("Just idling...") ,
- __tr("Dum de dum de dum...") ,
- __tr("Hey man... do something!") ,
- __tr("Umpf!") ,
- __tr("Silence speaking") ,
- __tr("Are ya here?") ,
- __tr("The world has stopped?") ,
- __tr("Everything is all right") ,
- __tr("idle()") ,
- __tr("It's so cold here...") ,
- __tr("Do not disturb... watching TV") ,
- __tr("Just vegetating") ,
- __tr("Hey... are ya sure that your network is up?") ,
- __tr("Seems like the world has stopped spinning") ,
- __tr("This silence is freaking me out!") ,
- __tr("Mieeeeeowww!") ,
- __tr("idle idle idle idle!")
-};
-
-#ifdef COMPILE_KDE_SUPPORT
- extern Time qt_x_time;
-#endif
-
-void KviDockWidget::enterEvent( QEvent* )
-{
-#ifdef COMPILE_KDE_SUPPORT
- if(!g_pApp->focusWidget())
- {
- XEvent ev;
- kvi_memset(&ev, 0, sizeof(ev));
- ev.xfocus.display = qt_xdisplay();
- ev.xfocus.type = XFocusIn;
- ev.xfocus.window = winId();
- ev.xfocus.mode = NotifyNormal;
- ev.xfocus.detail = NotifyAncestor;
- Time time = qt_x_time;
- qt_x_time = 1;
- g_pApp->x11ProcessEvent( &ev );
- qt_x_time = time;
- }
-#endif
-}
-
-void KviDockWidget::tipRequest(KviDynamicToolTip *tip,const QPoint &pnt)
-{
- QString tmp;
-
- KviTaskBarBase * t = m_pFrm->taskBar();
-
- QString line;
-
- for(KviTaskBarItem * b = t->firstItem();b;b = t->nextItem())
- {
-
- if(b->kviWindow()->view())
- {
- if(b->kviWindow()->view()->haveUnreadedMessages())
- {
- line = b->kviWindow()->lastMessageText();
- if(!line.isEmpty())
- {
- line.replace(QChar('&'),"&amp;");
- line.replace(QChar('<'),"&lt;");
- line.replace(QChar('>'),"&gt;");
- tmp += "<b>";
- tmp += b->kviWindow()->plainTextCaption();
- tmp += "</b><br>";
- tmp += line;
- tmp += "<br><br>\n";
- }
- }
- }
- }
-
-
- srand(time(0));
-
- // We use the bad way to generate random numbers :)))))
-
- if(tmp.isEmpty())tmp = __tr2qs_no_xgettext(idlemsgs[(int)(rand() % NIDLEMSGS)]);
-
-#ifdef COMPILE_ON_WINDOWS
-
-#else
- m_pTip->tip(rect(),tmp);
-#endif
-}
-
-//int KviDockWidget::message(int,void *)
-//{
-// debug("Message");
-// update();
-// return 0;
-//}
-
-void KviDockWidget::mousePressEvent(QMouseEvent *e)
-{
- if(e->button() & Qt::LeftButton)toggleParentFrame();
- else if(e->button() & Qt::RightButton)
- m_pContextPopup->popup(mapToGlobal(e->pos()));
-}
-
-void KviDockWidget::doAway(int id)
-{
- if(id<0)
- {
- KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict);
- while(KviWindow * wnd = it.current())
- {
- if(wnd->type()==KVI_WINDOW_TYPE_CONSOLE)
- {
- KviConsole* pConsole=(KviConsole*)wnd;
- if(pConsole->isConnected())
- if(id==-2)
- pConsole->connection()->sendFmtData("AWAY");
- else
- pConsole->connection()->sendFmtData("AWAY :%s",
- pConsole->connection()->encodeText(KVI_OPTION_STRING(KviOption_stringAwayMessage)).data()
- );
- }
- ++it;
- }
- } else {
- KviConsole* pConsole=g_pApp->findConsole((unsigned int)id);
- if(pConsole)
- if(pConsole->isConnected())
- if(pConsole->connection()->userInfo()->isAway())
- pConsole->connection()->sendFmtData("AWAY");
- else
- pConsole->connection()->sendFmtData("AWAY :%s",
- pConsole->connection()->encodeText(KVI_OPTION_STRING(KviOption_stringAwayMessage)).data()
- );
- }
-}
-
-void KviDockWidget::fillContextPopup()
-{
- m_pContextPopup->changeItem(m_iToggleFrame,m_pFrm->isVisible() ? __tr2qs("Hide Window") : __tr2qs("Show Window"));
- if(g_pApp->topmostConnectedConsole())
- {
- m_pContextPopup->setItemVisible(m_iAwayMenuId,true);
- m_pAwayPopup->clear();
-
- int iAllAway=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Away on all"),this,SLOT(doAway(int)));
- m_pAwayPopup->setItemParameter(iAllAway,-1);
-
- int iAllUnaway=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Back on all"),this,SLOT(doAway(int)));
- m_pAwayPopup->setItemParameter(iAllUnaway,-2);
-
- int iSeparator=m_pAwayPopup->insertSeparator();
-
- KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict);
- bool bAllAway=1;
- bool bAllUnaway=1;
- int iNetCount=0;
- while(KviWindow * wnd = it.current())
- {
- if(wnd->type()==KVI_WINDOW_TYPE_CONSOLE)
- {
- KviConsole* pConsole=(KviConsole*)wnd;
- if(pConsole->isConnected())
- {
- int id;
- if(pConsole->connection()->userInfo()->isAway())
- {
- id=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Back on %1").arg(pConsole->currentNetworkName()),this,SLOT(doAway(int)));
- bAllUnaway=0;
- } else {
- id=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Away on %1").arg(pConsole->currentNetworkName()),this,SLOT(doAway(int)));
- bAllAway=0;
- }
- m_pAwayPopup->setItemParameter(id,pConsole->ircContextId());
- iNetCount++;
- }
- }
- ++it;
- }
- if(iNetCount==1)
- {
- m_pAwayPopup->setItemVisible(iAllAway,false);
- m_pAwayPopup->setItemVisible(iAllUnaway,false);
- m_pAwayPopup->setItemVisible(iSeparator,false);
- } else {
- m_pAwayPopup->setItemVisible(iAllAway,!bAllAway);
- m_pAwayPopup->setItemVisible(iAllUnaway,!bAllUnaway);
- }
- } else {
- m_pContextPopup->setItemVisible(m_iAwayMenuId,false);
- }
-}
-
-void KviDockWidget::toggleParentFrame()
-{
- QWidget *top_widget = m_pFrm->topLevelWidget();
-
- if(m_pFrm->isVisible()) {
- m_pFrm->hide();
- } else {
- top_widget->show();
- top_widget->raise();
- top_widget->setActiveWindow();
- if(g_pActiveWindow) g_pActiveWindow->setFocus();
- if(m_pFrm->isMinimized())
- m_pFrm->showNormal();
- else
- m_pFrm->show();
- }
-}
-
-void KviDockWidget::refresh()
-{
- grabActivityInfo();
-
-#ifdef COMPILE_ON_WINDOWS
- // how to copy transparency????
- delete g_pCurrentPixmap;
- g_pCurrentPixmap=new QPixmap(16,16);
- bitBlt(g_pCurrentPixmap,0,0,m_iOther ? ((m_iOther == 2) ? g_pDock3 : g_pDock2) : g_pDock1,0,0,8,8,Qt::ClearROP);
- bitBlt(g_pCurrentPixmap,0,8,m_iConsoles ? ((m_iConsoles == 2) ? g_pDock3 : g_pDock2) : g_pDock1,0,8,8,8,Qt::ClearROP);
- bitBlt(g_pCurrentPixmap,8,0,m_iQueries ? ((m_iQueries == 2) ? g_pDock3 : g_pDock2) : g_pDock1,8,0,8,8,Qt::ClearROP);
- bitBlt(g_pCurrentPixmap,8,8,m_iChannels ? ((m_iChannels == 2) ? g_pDock3 : g_pDock2) : g_pDock1,8,8,8,8,Qt::ClearROP);
-#endif
-
- if( (m_iChannels == 2) || (m_iQueries == 2) )
- {
- if(!m_pFlashingTimer->isActive() && KVI_OPTION_BOOL(KviOption_boolEnableTrayIconFlashing) ) m_pFlashingTimer->start(1000);
- } else {
- if(m_pFlashingTimer->isActive()) m_pFlashingTimer->stop();
- m_bFlashed=false;
- }
-
-#ifdef COMPILE_ON_WINDOWS
- updateTaskbarIcon();
-#else
- update();
-#endif
-}
-
-void KviDockWidget::grabActivityInfo()
-{
- KviTaskBarBase * t = m_pFrm->taskBar();
-
- if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification))
- {
- if(KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)>5) KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)=5;
- if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)>5) KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=5;
-
- if(KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)<1) KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)=1;
- if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)<1) KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=1;
-
- if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)<KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage))
- KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage);
- }
-
- m_iConsoles = 0;
- m_iChannels = 0;
- m_iQueries = 0;
- m_iOther = 0;
-
- for(KviTaskBarItem * b = t->firstItem();b;b = t->nextItem())
- {
- if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification))
- {
- int iLevel = b->highlightLevel();
- switch(b->kviWindow()->type())
- {
- case KVI_WINDOW_TYPE_CONSOLE:
- if(m_iConsoles < iLevel) m_iConsoles = iLevel;
- break;
- case KVI_WINDOW_TYPE_CHANNEL:
- if(m_iChannels < iLevel) m_iChannels = iLevel;
- break;
- case KVI_WINDOW_TYPE_QUERY:
- if(m_iQueries < iLevel) m_iQueries = iLevel;
- break;
- default:
- if(m_iOther < iLevel) m_iOther = iLevel;
- break;
- }
- } else {
- int iLevel=0;
- if(b->kviWindow()->view())
- {
- if(b->kviWindow()->view()->haveUnreadedHighlightedMessages())
- {
- iLevel=2;
- } else if(b->kviWindow()->view()->haveUnreadedMessages())
- {
- iLevel=1;
- }
- if(iLevel>0)
- switch(b->kviWindow()->type())
- {
- case KVI_WINDOW_TYPE_CONSOLE:
- if(m_iConsoles < iLevel) m_iConsoles = iLevel;
- break;
- case KVI_WINDOW_TYPE_CHANNEL:
- if(m_iChannels < iLevel) m_iChannels = iLevel;
- break;
- case KVI_WINDOW_TYPE_QUERY:
- if(m_iQueries < iLevel) m_iQueries = iLevel;
- break;
- default:
- if(m_iOther < iLevel) m_iOther = iLevel;
- break;
- }
- }
- }
- }
-
- if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification))
- {
- if(m_iConsoles >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iConsoles=2;
- else if(m_iConsoles >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iConsoles=1;
- else m_iConsoles=0;
-
- if(m_iChannels >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iChannels=2;
- else if(m_iChannels >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iChannels=1;
- else m_iChannels=0;
-
- if(m_iQueries >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iQueries=2;
- else if(m_iQueries >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iQueries=1;
- else m_iQueries=0;
-
- if(m_iOther >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iOther=2;
- else if(m_iOther >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iOther=1;
- else m_iOther=0;
- }
-}
-
-void KviDockWidget::paintEvent(QPaintEvent * event)
-{
-#ifdef COMPILE_USE_QT4
- QPainter thisRestrictionOfQt4IsNotNice(this);
- if(m_bFlashed)
- {
- erase();
- thisRestrictionOfQt4IsNotNice.drawPixmap(4,4,16,16,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MESSAGE)),0,0,16,16);
- } else {
- thisRestrictionOfQt4IsNotNice.drawPixmap(0,0,12,12,m_iOther ? ((m_iOther == 2) ? *g_pDock3 : *g_pDock2) : *g_pDock1,0,0,12,12);
- thisRestrictionOfQt4IsNotNice.drawPixmap(0,12,12,12,m_iConsoles ? ((m_iConsoles == 2) ? *g_pDock3 : *g_pDock2) : *g_pDock1,0,12,12,12);
- thisRestrictionOfQt4IsNotNice.drawPixmap(12,0,12,12,m_iQueries ? ((m_iQueries == 2) ? *g_pDock3 : *g_pDock2) : *g_pDock1,12,0,12,12);
- thisRestrictionOfQt4IsNotNice.drawPixmap(12,12,12,12,m_iChannels ? ((m_iChannels == 2) ? *g_pDock3 : *g_pDock2) : *g_pDock1,12,12,12,12);
- }
-#else
- if(m_bFlashed)
- {
- erase();
- bitBlt(this,4,4,g_pIconManager->getSmallIcon(KVI_SMALLICON_MESSAGE),0,0,16,16);
- } else {
- bitBlt(this,0,0,m_iOther ? ((m_iOther == 2) ? g_pDock3 : g_pDock2) : g_pDock1,0,0,12,12,Qt::CopyROP,false);
- bitBlt(this,0,12,m_iConsoles ? ((m_iConsoles == 2) ? g_pDock3 : g_pDock2) : g_pDock1,0,12,12,12,Qt::CopyROP,false);
- bitBlt(this,12,0,m_iQueries ? ((m_iQueries == 2) ? g_pDock3 : g_pDock2) : g_pDock1,12,0,12,12,Qt::CopyROP,false);
- bitBlt(this,12,12,m_iChannels ? ((m_iChannels == 2) ? g_pDock3 : g_pDock2) : g_pDock1,12,12,12,12,Qt::CopyROP,false);
- }
-#endif
-}
-
-
-static KviDockWidget * dockwidget_find(KviFrame *f)
-{
- if(!g_pDockWidgetList)return 0;
- for(KviDockWidget * w = g_pDockWidgetList->first();w;w = g_pDockWidgetList->next())
- {
- if(w->frame() == f)return w;
- }
- return 0;
-}
-
-/*
- @doc: dockwidget.show
- @type:
- command
- @title:
- dockwidget.show
- @short:
- Shows the dock widget for the current frame window
- @keyterms:
- dock widget , system tray
- @syntax:
- dockwidget.show
- @description:
- Shows the dock widget for the current frame window.[br]
- The dock widget is a small widget that docks in the KDE panel.[br]
- It shows a small icon of the earth and eventually displays four squares
- that cover this icon: the bottom left square appears when there is some new
- text in any console window, the square becomes red if the text is highlighted.[br]
- The bottom right square appears when there is some new text in any channel window,
- and it becomes red when the text is highlighted.[br] The upper right square refers to
- query windows and the upper left one to any other kind of window (dcc , links...).[br]
- If you move the mouse over the dock widget a tooltip will show you the last lines
- of the "new" text in all these windows.[br]
- This is useful when you keep the main KVIrc window minimized and you're working on something else:
- if the dock widget shows nothing but the earth icon , nothing is happening in the main KVIrc window.
- If the dock widget shows one or more white (or red) squares , you can move the mouse over
- and check what's happened exactly and eventually bring up the main KVIrc window by clicking on the widget.[br]
- [big]tecnical details[/big]
- The dock widget is currently working in KDE compilation mode only:
- it relies on the KWin implementation of the Window Manager interaction protocol.
- @seealso:
- [cmd]dockwidget.hide[/cmd]
-*/
-
-static bool dockwidget_kvs_cmd_show(KviKvsModuleCommandCall * c)
-{
- if(!(dockwidget_find(c->window()->frame())))
- {
- KviDockWidget * w = new KviDockWidget(c->window()->frame(),"dock_widget");
-#ifndef COMPILE_ON_WINDOWS
- w->show();
-#else
- w->hide();
-#endif
- }
- return true;
-}
-
-/*
- @doc: dockwidget.hide
- @type:
- command
- @title:
- dockwidget.hide
- @short:
- Hides the dock widget for the current frame window
- @syntax:
- dockwidget.hide
- @description:
- Hides the dock widget for the current frame window
- @seealso:
- [cmd]dockwidget.show[/cmd]
-*/
-
-static bool dockwidget_kvs_cmd_hide(KviKvsModuleCommandCall * c)
-{
- KviDockWidget * w= dockwidget_find(c->window()->frame());
- if(w)delete w;
- // show the parent frame.. otherwise there will be no way to get it back
- if(!c->window()->frame()->isVisible())
- {
- c->window()->frame()->show();
- }
- return true;
-}
-
-/*
- @doc: dockwidget.hidewindow
- @type:
- command
- @title:
- dockwidget.hidewindow
- @short:
- Returns the state of the dock widget
- @syntax:
- dockwidget.hidewindow
- @description:
- Hides the window, assotiated with dockwidget
- @seealso:
- [cmd]dockwidget.show[/cmd], [cmd]dockwidget.hide[/cmd]
-*/
-
-static bool dockwidget_kvs_cmd_hidewindow(KviKvsModuleCommandCall * c)
-{
- KviDockWidget * w= dockwidget_find(c->window()->frame());
- if(w)
- {
-#if QT_VERSION > 0x030201
- w->setPrevWindowState(c->window()->frame()->windowState());
-#endif
- c->window()->frame()->hide();
- }
- return true;
-}
-
-/*
- @doc: dockwidget.isVisible
- @type:
- function
- @title:
- $dockwidget.isVisible
- @short:
- Returns the state of the dock widget
- @syntax:
- $reguser.isVisible()
- @description:
- Returns 1 if the dock widget is actually visible , 0 otherwise.
- @seealso:
- [cmd]dockwidget.show[/cmd]
-*/
-
-static bool dockwidget_kvs_fnc_isvisible(KviKvsModuleFunctionCall * c)
-{
- c->returnValue()->setBoolean(dockwidget_find(c->window()->frame()));
- return true;
-}
-
-
-
-// =======================================
-// init routine
-// =======================================
-static bool dockwidget_module_init(KviModule * m)
-{
- KviStr buffer;
-#ifdef COMPILE_ON_WINDOWS
- g_pApp->findImage(buffer,"kvi_dock_win32.png");
- KviImageLibrary l1(buffer.ptr(),16,16);
-#else
- g_pApp->findImage(buffer,"kvi_dock.png");
- KviImageLibrary l1(buffer.ptr(),22,22);
-#endif
- g_pDock1 = new QPixmap(l1.getImage(0));
- g_pDock2 = new QPixmap(l1.getImage(1));
- g_pDock3 = new QPixmap(l1.getImage(2));
-
-#ifdef COMPILE_ON_WINDOWS
-
-#endif
-
-
- g_pDockWidgetList = new KviPointerList<KviDockWidget>;
- g_pDockWidgetList->setAutoDelete(false);
-
-
- KVSM_REGISTER_SIMPLE_COMMAND(m,"hide",dockwidget_kvs_cmd_hide);
- KVSM_REGISTER_SIMPLE_COMMAND(m,"hidewindow",dockwidget_kvs_cmd_hidewindow);
- KVSM_REGISTER_SIMPLE_COMMAND(m,"show",dockwidget_kvs_cmd_show);
- KVSM_REGISTER_FUNCTION(m,"isVisible",dockwidget_kvs_fnc_isvisible);
-
- return true;
-}
-
-static bool dockwidget_module_cleanup(KviModule *m)
-{
- while(g_pDockWidgetList->first())delete g_pDockWidgetList->first();
- delete g_pDockWidgetList;
- g_pDockWidgetList = 0;
-
-#ifdef COMPILE_ON_WINDOWS
- DestroyIcon(g_pCurrentIcon);
-#endif
-
- delete g_pDock1;
- g_pDock1 = 0;
- delete g_pDock2;
- g_pDock2 = 0;
- delete g_pDock3;
- g_pDock3 = 0;
-
- return true;
-}
-
-static bool dockwidget_module_can_unload(KviModule *)
-{
- return g_pDockWidgetList->isEmpty();
-}
-
-// =======================================
-// plugin definition structure
-// =======================================
-KVIRC_MODULE(
- "KVIrc dock widget implementation",
- "1.0.0",
- "Szymon Stefanek <pragma at kvirc dot net>" ,
- "exports the /dockwidget.* interface\n",
- dockwidget_module_init ,
- dockwidget_module_can_unload,
- 0,
- dockwidget_module_cleanup
-)
-
-#include "libkvidockwidget_qt3.moc"
-
-#endif \ No newline at end of file
diff --git a/src/modules/dockwidget/libkvidockwidget_qt3.h b/src/modules/dockwidget/libkvidockwidget_qt3.h
deleted file mode 100644
index 427f57526..000000000
--- a/src/modules/dockwidget/libkvidockwidget_qt3.h
+++ /dev/null
@@ -1,95 +0,0 @@
-#ifndef _KVI_DOCKWIDGET_H_
-#define _KVI_DOCKWIDGET_H_
-//
-// This file is part of the KVirc irc client distribution
-// Creation date : Tue 02 Jan 2001 14:28:25 by Szymon Stefanek
-// Copyright (C) 2000-2001 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_frame.h"
-
-#ifdef COMPILE_KDE_SUPPORT
- class KPopupMenu;
-#else
- class KviTalPopupMenu;
-#endif
-
-
-
-
-class QPixmap;
-class QTimer;
-
-//class KviFrame;
-class KviDynamicToolTip;
-
-class KviDockWidget : public QWidget , public KviDockExtension
-{
- Q_OBJECT
-public:
- KviDockWidget(KviFrame * win,const char * name);
- ~KviDockWidget();
-protected:
- KviFrame * m_pFrm;
- KviDynamicToolTip * m_pTip;
-#ifdef COMPILE_KDE_SUPPORT
- KPopupMenu * m_pContextPopup;
-#else
- KviTalPopupMenu * m_pContextPopup;
-#endif
- KviTalPopupMenu * m_pAwayPopup;
- int m_iToggleFrame;
- int m_iAwayMenuId;
-
- bool m_bFlashed;
-
- QTimer* m_pFlashingTimer;
- int m_iConsoles;
- int m_iChannels;
- int m_iQueries;
- int m_iOther;
-public:
- KviFrame * frame(){ return m_pFrm; };
-public:
-// virtual int message(int msgtype,void * data);
- virtual void enterEvent(QEvent *);
- virtual void refresh();
- virtual void die();
-protected:
- virtual void paintEvent(QPaintEvent *e);
- virtual void mousePressEvent(QMouseEvent *e);
- void grabActivityInfo();
-
-#ifdef COMPILE_ON_WINDOWS
-private:
- void createTaskbarIcon();
- void destroyTaskbarIcon();
- void updateTaskbarIcon();
-protected:
- bool winEvent(MSG * m);
-#endif
-
-protected slots:
- void fillContextPopup();
- void toggleParentFrame();
- void tipRequest(KviDynamicToolTip *tip,const QPoint &pnt);
- void doAway(int);
- void flashingTimerShot();
-};
-
-#endif //_KVI_DOCKWIDGET_H_
diff --git a/src/modules/dockwidget/libkvidockwidget_qt4.cpp b/src/modules/dockwidget/libkvidockwidget_qt4.cpp
deleted file mode 100644
index c017ecd9e..000000000
--- a/src/modules/dockwidget/libkvidockwidget_qt4.cpp
+++ /dev/null
@@ -1,691 +0,0 @@
-//
-// File : libkvidockwidget.cpp
-// Creation date : Tue Jan 02 20001 14:34:12 CEST by Szymon Stefanek
-//
-// This file is part of the KVirc irc client distribution
-// Copyright (C) 2000-2001 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"
-
-#ifdef COMPILE_USE_QT4
-
-#ifdef COMPILE_ON_WINDOWS
- #define ICON_SIZE 16
-#else
- #define ICON_SIZE 22
-#endif
-
-#include "kvi_app.h"
-#include "kvi_module.h"
-#include "kvi_locale.h"
-#include "kvi_memmove.h"
-#include "kvi_taskbar.h"
-#include "kvi_window.h"
-#include "kvi_dynamictooltip.h"
-#include "kvi_iconmanager.h"
-#include "kvi_internalcmd.h"
-#include "kvi_console.h"
-#include "kvi_ircconnection.h"
-#include "kvi_ircconnectionuserinfo.h"
-#include "kvi_imagelib.h"
-#include "kvi_options.h"
-#include "kvi_ircview.h"
-
-#include "libkvidockwidget.h"
-#include "kvi_doublebuffer.h"
-
-#include <qlabel.h>
-
-#include "kvi_tal_popupmenu.h"
-
-
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <qtimer.h>
-#include <qevent.h>
-#include <qregexp.h>
-
-#include <stdlib.h>
-#include <time.h>
-
-
-extern KVIRC_API KviPointerHashTable<const char *,KviWindow> * g_pGlobalWindowDict;
-static KviPointerList<KviDockWidget> * g_pDockWidgetList = 0;
-
-static QPixmap * g_pDock1 = 0;
-static QPixmap * g_pDock2 = 0;
-static QPixmap * g_pDock3 = 0;
-
-KviDockWidget::KviDockWidget(KviFrame * frm)
-: QSystemTrayIcon(frm), m_CurrentPixmap(ICON_SIZE,ICON_SIZE)
-{
- m_pContextPopup = new KviTalPopupMenu(0);
- setContextMenu(m_pContextPopup);
-
- m_iConsoles = 0;
- m_iChannels = 0;
- m_iQueries = 0;
- m_iOther = 0;
-
- m_pFlashingTimer = new QTimer(this,"flashing_timer");
- connect( m_pFlashingTimer, SIGNAL(timeout()), this, SLOT(flashingTimerShot()) );
- m_bFlashed=0;
- g_pDockWidgetList->append(this);
- m_pFrm = frm;
- m_pFrm->setDockExtension(this);
-
- m_pTip = new KviDynamicToolTip(frm,"dock_tooltip");
- m_pAwayPopup = new KviTalPopupMenu(0);
-
- QLabel * l = new QLabel(__tr2qs("KVIrc"),m_pContextPopup);
- l->setFrameStyle(QFrame::Raised | QFrame::StyledPanel);
- m_pContextPopup->insertItem(l);
- m_pContextPopup->setCaption(__tr2qs("Context"));
- m_iAwayMenuId = m_pContextPopup->insertItem ( __tr2qs("Away"), m_pAwayPopup);
- m_pContextPopup->changeItem(m_iAwayMenuId,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_AWAY)),__tr2qs("Away"));
-
- int id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_OPTIONS)),__tr2qs("&Configure KVIrc..."),m_pFrm,SLOT(executeInternalCommand(int)));
- m_pContextPopup->setItemParameter(id,KVI_INTERNALCOMMAND_OPTIONS_DIALOG);
- id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_KVIRC)),__tr2qs("&About KVIrc"),m_pFrm,SLOT(executeInternalCommand(int)));
- m_pContextPopup->setItemParameter(id,KVI_INTERNALCOMMAND_ABOUT_ABOUTKVIRC);
- m_pContextPopup->insertSeparator();
- m_iToggleFrame = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_RAW)),QString(""),this,SLOT(toggleParentFrame()));
- m_pContextPopup->insertSeparator();
- id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DOCKWIDGET)),__tr2qs("Un&dock"),m_pFrm,SLOT(executeInternalCommand(int)));
- m_pContextPopup->setItemParameter(id,KVI_INTERNALCOMMAND_DOCKWIDGET_HIDE);
- id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_QUITAPP)),__tr2qs("&Quit"),g_pApp,SLOT(quit()));
- m_pContextPopup->setAccel(__tr2qs("Ctrl+Q"),id);
- connect(m_pContextPopup,SIGNAL(aboutToShow()),this,SLOT(fillContextPopup()));
-
- QIcon icon(*g_pDock1);
- setIcon(icon);
-
- connect(this,SIGNAL(activated ( QSystemTrayIcon::ActivationReason )),this,SLOT(activatedSlot ( QSystemTrayIcon::ActivationReason )));
-}
-
-
-KviDockWidget::~KviDockWidget()
-{
- m_pFrm->setDockExtension(0);
- g_pDockWidgetList->removeRef(this);
-}
-
-void KviDockWidget::die()
-{
- delete this;
-}
-
-void KviDockWidget::flashingTimerShot()
-{
- m_bFlashed=!m_bFlashed;
- refresh();
-}
-
-#define NIDLEMSGS 18
-
-static const char * idlemsgs[NIDLEMSGS]=
-{
- __tr("Nothing is happening...") ,
- __tr("Just idling...") ,
- __tr("Dum de dum de dum...") ,
- __tr("Hey man... do something!") ,
- __tr("Umpf!") ,
- __tr("Silence speaking") ,
- __tr("Are ya here?") ,
- __tr("The world has stopped?") ,
- __tr("Everything is all right") ,
- __tr("idle()") ,
- __tr("It's so cold here...") ,
- __tr("Do not disturb... watching TV") ,
- __tr("Just vegetating") ,
- __tr("Hey... are ya sure that your network is up?") ,
- __tr("Seems like the world has stopped spinning") ,
- __tr("This silence is freaking me out!") ,
- __tr("Mieeeeeowww!") ,
- __tr("idle idle idle idle!")
-};
-
-void KviDockWidget::tipRequest(KviDynamicToolTip *tip,const QPoint &pnt)
-{
- QString tmp;
-
- KviTaskBarBase * t = m_pFrm->taskBar();
-
- QString line;
-
- for(KviTaskBarItem * b = t->firstItem();b;b = t->nextItem())
- {
-
- if(b->kviWindow()->view())
- {
- if(b->kviWindow()->view()->haveUnreadedMessages())
- {
- line = b->kviWindow()->lastMessageText();
- if(!line.isEmpty())
- {
- line.replace(QChar('&'),"&amp;");
- line.replace(QChar('<'),"&lt;");
- line.replace(QChar('>'),"&gt;");
- tmp += "<b>";
- tmp += b->kviWindow()->plainTextCaption();
- tmp += "</b><br>";
- tmp += line;
- tmp += "<br><br>\n";
- }
- }
- }
- }
-
-
- srand(time(0));
-
- // We use the bad way to generate random numbers :)))))
-
- if(tmp.isEmpty())tmp = __tr2qs_no_xgettext(idlemsgs[(int)(rand() % NIDLEMSGS)]);
-
- //m_pTip->tip(rect(),tmp);
-}
-
-//int KviDockWidget::message(int,void *)
-//{
-// debug("Message");
-// update();
-// return 0;
-//}
-
-//FIXME: Qt4 port
-/*void KviDockWidget::mousePressEvent(QMouseEvent *e)
-{
- if(e->button() & Qt::LeftButton)toggleParentFrame();
- else if(e->button() & Qt::RightButton)
- m_pContextPopup->popup(mapToGlobal(e->pos()));
-}*/
-
-void KviDockWidget::doAway(int id)
-{
- if(id<0)
- {
- KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict);
- while(KviWindow * wnd = it.current())
- {
- if(wnd->type()==KVI_WINDOW_TYPE_CONSOLE)
- {
- KviConsole* pConsole=(KviConsole*)wnd;
- if(pConsole->isConnected())
- if(id==-2)
- pConsole->connection()->sendFmtData("AWAY");
- else
- pConsole->connection()->sendFmtData("AWAY :%s",
- pConsole->connection()->encodeText(KVI_OPTION_STRING(KviOption_stringAwayMessage)).data()
- );
- }
- ++it;
- }
- } else {
- KviConsole* pConsole=g_pApp->findConsole((unsigned int)id);
- if(pConsole)
- if(pConsole->isConnected())
- if(pConsole->connection()->userInfo()->isAway())
- pConsole->connection()->sendFmtData("AWAY");
- else
- pConsole->connection()->sendFmtData("AWAY :%s",
- pConsole->connection()->encodeText(KVI_OPTION_STRING(KviOption_stringAwayMessage)).data()
- );
- }
-}
-
-void KviDockWidget::fillContextPopup()
-{
- m_pContextPopup->changeItem(m_iToggleFrame,m_pFrm->isVisible() ? __tr2qs("Hide Window") : __tr2qs("Show Window"));
- if(g_pApp->topmostConnectedConsole())
- {
- m_pContextPopup->setItemVisible(m_iAwayMenuId,true);
- m_pAwayPopup->clear();
-
- int iAllAway=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Away on all"),this,SLOT(doAway(int)));
- m_pAwayPopup->setItemParameter(iAllAway,-1);
-
- int iAllUnaway=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Back on all"),this,SLOT(doAway(int)));
- m_pAwayPopup->setItemParameter(iAllUnaway,-2);
-
- int iSeparator=m_pAwayPopup->insertSeparator();
-
- KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict);
- bool bAllAway=1;
- bool bAllUnaway=1;
- int iNetCount=0;
- while(KviWindow * wnd = it.current())
- {
- if(wnd->type()==KVI_WINDOW_TYPE_CONSOLE)
- {
- KviConsole* pConsole=(KviConsole*)wnd;
- if(pConsole->isConnected())
- {
- int id;
- if(pConsole->connection()->userInfo()->isAway())
- {
- id=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Back on %1").arg(pConsole->currentNetworkName()),this,SLOT(doAway(int)));
- bAllUnaway=0;
- } else {
- id=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Away on %1").arg(pConsole->currentNetworkName()),this,SLOT(doAway(int)));
- bAllAway=0;
- }
- m_pAwayPopup->setItemParameter(id,pConsole->ircContextId());
- iNetCount++;
- }
- }
- ++it;
- }
- if(iNetCount==1)
- {
- m_pAwayPopup->setItemVisible(iAllAway,false);
- m_pAwayPopup->setItemVisible(iAllUnaway,false);
- m_pAwayPopup->setItemVisible(iSeparator,false);
- } else {
- m_pAwayPopup->setItemVisible(iAllAway,!bAllAway);
- m_pAwayPopup->setItemVisible(iAllUnaway,!bAllUnaway);
- }
- } else {
- m_pContextPopup->setItemVisible(m_iAwayMenuId,false);
- }
-}
-
-void KviDockWidget::toggleParentFrame()
-{
- QWidget *top_widget = m_pFrm->topLevelWidget();
-
- if(m_pFrm->isVisible()) {
- m_pFrm->hide();
- } else {
- top_widget->show();
- top_widget->raise();
- top_widget->setActiveWindow();
- if(g_pActiveWindow) g_pActiveWindow->setFocus();
- if(m_pFrm->isMinimized())
- m_pFrm->showNormal();
- else
- m_pFrm->show();
- }
-}
-
-void KviDockWidget::refresh()
-{
- grabActivityInfo();
-
- if( (m_iChannels == 2) || (m_iQueries == 2) )
- {
- if(!m_pFlashingTimer->isActive() && KVI_OPTION_BOOL(KviOption_boolEnableTrayIconFlashing) )
- m_pFlashingTimer->start(1000);
- } else {
- if(m_pFlashingTimer->isActive()) m_pFlashingTimer->stop();
- m_bFlashed=false;
- }
-
- m_CurrentPixmap.fill(Qt::transparent);
- QPainter thisRestrictionOfQt4IsNotNice(&m_CurrentPixmap);
- //thisRestrictionOfQt4IsNotNice.drawPixmap(0,0,22,22,*g_pDock1,0,0,22,22);
-
- if(m_bFlashed)
- {
- thisRestrictionOfQt4IsNotNice.drawPixmap((ICON_SIZE-16)/2,(ICON_SIZE-16)/2,16,16,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MESSAGE)),0,0,16,16);
- } else {
- thisRestrictionOfQt4IsNotNice.drawPixmap(0,0,ICON_SIZE/2,ICON_SIZE/2,
- m_iOther ?
- ((m_iOther == 2) ? *g_pDock3 : *g_pDock2)
- : *g_pDock1,0,0,ICON_SIZE/2,ICON_SIZE/2);
-
- thisRestrictionOfQt4IsNotNice.drawPixmap(0,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,
- m_iConsoles ?
- ((m_iConsoles == 2) ? *g_pDock3 : *g_pDock2)
- : *g_pDock1,0,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2);
-
- thisRestrictionOfQt4IsNotNice.drawPixmap(ICON_SIZE/2,0,ICON_SIZE/2,ICON_SIZE/2,
- m_iQueries ?
- ((m_iQueries == 2)
- ? *g_pDock3 : *g_pDock2)
- : *g_pDock1,ICON_SIZE/2,0,ICON_SIZE/2,ICON_SIZE/2);
-
- thisRestrictionOfQt4IsNotNice.drawPixmap(ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,
- m_iChannels ?
- ((m_iChannels == 2) ? *g_pDock3 : *g_pDock2)
- : *g_pDock1
- ,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2);
-
- }
- updateIcon();
-}
-
-void KviDockWidget::activatedSlot( QSystemTrayIcon::ActivationReason reason )
-{
- if(reason==QSystemTrayIcon::Trigger)
- {
- toggleParentFrame();
- }
-}
-
-void KviDockWidget::grabActivityInfo()
-{
- KviTaskBarBase * t = m_pFrm->taskBar();
-
- if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification))
- {
- if(KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)>5) KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)=5;
- if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)>5) KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=5;
-
- if(KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)<1) KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)=1;
- if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)<1) KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=1;
-
- if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)<KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage))
- KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage);
- }
-
- m_iConsoles = 0;
- m_iChannels = 0;
- m_iQueries = 0;
- m_iOther = 0;
-
- for(KviTaskBarItem * b = t->firstItem();b;b = t->nextItem())
- {
- if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification))
- {
- int iLevel = b->highlightLevel();
- switch(b->kviWindow()->type())
- {
- case KVI_WINDOW_TYPE_CONSOLE:
- if(m_iConsoles < iLevel) m_iConsoles = iLevel;
- break;
- case KVI_WINDOW_TYPE_CHANNEL:
- if(m_iChannels < iLevel) m_iChannels = iLevel;
- break;
- case KVI_WINDOW_TYPE_QUERY:
- if(m_iQueries < iLevel) m_iQueries = iLevel;
- break;
- default:
- if(m_iOther < iLevel) m_iOther = iLevel;
- break;
- }
- } else {
- int iLevel=0;
- if(b->kviWindow()->view())
- {
- if(b->kviWindow()->view()->haveUnreadedHighlightedMessages())
- {
- iLevel=2;
- } else if(b->kviWindow()->view()->haveUnreadedMessages())
- {
- iLevel=1;
- }
- if(iLevel>0)
- switch(b->kviWindow()->type())
- {
- case KVI_WINDOW_TYPE_CONSOLE:
- if(m_iConsoles < iLevel) m_iConsoles = iLevel;
- break;
- case KVI_WINDOW_TYPE_CHANNEL:
- if(m_iChannels < iLevel) m_iChannels = iLevel;
- break;
- case KVI_WINDOW_TYPE_QUERY:
- if(m_iQueries < iLevel) m_iQueries = iLevel;
- break;
- default:
- if(m_iOther < iLevel) m_iOther = iLevel;
- break;
- }
- }
- }
- }
-
- if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification))
- {
- if(m_iConsoles >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iConsoles=2;
- else if(m_iConsoles >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iConsoles=1;
- else m_iConsoles=0;
-
- if(m_iChannels >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iChannels=2;
- else if(m_iChannels >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iChannels=1;
- else m_iChannels=0;
-
- if(m_iQueries >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iQueries=2;
- else if(m_iQueries >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iQueries=1;
- else m_iQueries=0;
-
- if(m_iOther >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iOther=2;
- else if(m_iOther >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iOther=1;
- else m_iOther=0;
- }
-}
-
-void KviDockWidget::updateIcon()
-{
- setIcon(QIcon(m_CurrentPixmap));
-}
-
-
-static KviDockWidget * dockwidget_find(KviFrame *f)
-{
- if(!g_pDockWidgetList)return 0;
- for(KviDockWidget * w = g_pDockWidgetList->first();w;w = g_pDockWidgetList->next())
- {
- if(w->frame() == f)return w;
- }
- return 0;
-}
-
-/*
- @doc: dockwidget.show
- @type:
- command
- @title:
- dockwidget.show
- @short:
- Shows the dock widget for the current frame window
- @keyterms:
- dock widget , system tray
- @syntax:
- dockwidget.show
- @description:
- Shows the dock widget for the current frame window.[br]
- The dock widget is a small widget that docks in the KDE panel.[br]
- It shows a small icon of the earth and eventually displays four squares
- that cover this icon: the bottom left square appears when there is some new
- text in any console window, the square becomes red if the text is highlighted.[br]
- The bottom right square appears when there is some new text in any channel window,
- and it becomes red when the text is highlighted.[br] The upper right square refers to
- query windows and the upper left one to any other kind of window (dcc , links...).[br]
- If you move the mouse over the dock widget a tooltip will show you the last lines
- of the "new" text in all these windows.[br]
- This is useful when you keep the main KVIrc window minimized and you're working on something else:
- if the dock widget shows nothing but the earth icon , nothing is happening in the main KVIrc window.
- If the dock widget shows one or more white (or red) squares , you can move the mouse over
- and check what's happened exactly and eventually bring up the main KVIrc window by clicking on the widget.[br]
- [big]tecnical details[/big]
- The dock widget is currently working in KDE compilation mode only:
- it relies on the KWin implementation of the Window Manager interaction protocol.
- @seealso:
- [cmd]dockwidget.hide[/cmd]
-*/
-
-static bool dockwidget_kvs_cmd_show(KviKvsModuleCommandCall * c)
-{
- if(!(dockwidget_find(c->window()->frame())))
- {
- KviDockWidget * w = new KviDockWidget(c->window()->frame());
- w->show();
- }
- return true;
-}
-
-/*
- @doc: dockwidget.hide
- @type:
- command
- @title:
- dockwidget.hide
- @short:
- Hides the dock widget for the current frame window
- @syntax:
- dockwidget.hide
- @description:
- Hides the dock widget for the current frame window
- @seealso:
- [cmd]dockwidget.show[/cmd]
-*/
-
-static bool dockwidget_kvs_cmd_hide(KviKvsModuleCommandCall * c)
-{
- KviDockWidget * w= dockwidget_find(c->window()->frame());
- if(w)delete w;
- // show the parent frame.. otherwise there will be no way to get it back
- if(!c->window()->frame()->isVisible())
- {
- c->window()->frame()->show();
- }
- return true;
-}
-
-/*
- @doc: dockwidget.hidewindow
- @type:
- command
- @title:
- dockwidget.hidewindow
- @short:
- Returns the state of the dock widget
- @syntax:
- dockwidget.hidewindow
- @description:
- Hides the window, assotiated with dockwidget
- @seealso:
- [cmd]dockwidget.show[/cmd], [cmd]dockwidget.hide[/cmd]
-*/
-
-static bool dockwidget_kvs_cmd_hidewindow(KviKvsModuleCommandCall * c)
-{
- KviDockWidget * w= dockwidget_find(c->window()->frame());
- if(w)
- {
- c->window()->frame()->hide();
- }
- return true;
-}
-
-/*
- @doc: dockwidget.isVisible
- @type:
- function
- @title:
- $dockwidget.isVisible
- @short:
- Returns the state of the dock widget
- @syntax:
- $reguser.isVisible()
- @description:
- Returns 1 if the dock widget is actually visible , 0 otherwise.
- @seealso:
- [cmd]dockwidget.show[/cmd]
-*/
-
-static bool dockwidget_kvs_fnc_isvisible(KviKvsModuleFunctionCall * c)
-{
- c->returnValue()->setBoolean(dockwidget_find(c->window()->frame()));
- return true;
-}
-
-
-
-// =======================================
-// init routine
-// =======================================
-static bool dockwidget_module_init(KviModule * m)
-{
- QString buffer;
-#ifdef COMPILE_ON_WINDOWS
- g_pApp->findImage(buffer,"kvi_dock_win32-0.png");
-#else
- g_pApp->findImage(buffer,"kvi_dock_part-0.png");
-#endif
- g_pDock1 = new QPixmap(buffer);
-
-#ifdef COMPILE_ON_WINDOWS
- g_pApp->findImage(buffer,"kvi_dock_win32-1.png");
-#else
- g_pApp->findImage(buffer,"kvi_dock_part-1.png");
-#endif
- g_pDock2 = new QPixmap(buffer);
-
-#ifdef COMPILE_ON_WINDOWS
- g_pApp->findImage(buffer,"kvi_dock_win32-2.png");
-#else
- g_pApp->findImage(buffer,"kvi_dock_part-2.png");
-#endif
-
- g_pDock3 = new QPixmap(buffer);
-
-
- g_pDockWidgetList = new KviPointerList<KviDockWidget>;
- g_pDockWidgetList->setAutoDelete(false);
-
-
- KVSM_REGISTER_SIMPLE_COMMAND(m,"hide",dockwidget_kvs_cmd_hide);
- KVSM_REGISTER_SIMPLE_COMMAND(m,"hidewindow",dockwidget_kvs_cmd_hidewindow);
- KVSM_REGISTER_SIMPLE_COMMAND(m,"show",dockwidget_kvs_cmd_show);
- KVSM_REGISTER_FUNCTION(m,"isVisible",dockwidget_kvs_fnc_isvisible);
-
- return true;
-}
-
-static bool dockwidget_module_cleanup(KviModule *m)
-{
- while(g_pDockWidgetList->first())delete g_pDockWidgetList->first();
- delete g_pDockWidgetList;
- g_pDockWidgetList = 0;
-
- delete g_pDock1;
- g_pDock1 = 0;
-
- delete g_pDock2;
- g_pDock2 = 0;
-
- delete g_pDock3;
- g_pDock3 = 0;
-
- return true;
-}
-
-static bool dockwidget_module_can_unload(KviModule *)
-{
- return g_pDockWidgetList->isEmpty();
-}
-
-// =======================================
-// plugin definition structure
-// =======================================
-KVIRC_MODULE(
- "KVIrc dock widget implementation",
- "2.0.0",
- "Szymon Stefanek <pragma at kvirc dot net> and Alexey Uzhva <alexey at kvirc dot ru>" ,
- "exports the /dockwidget.* interface\n",
- dockwidget_module_init ,
- dockwidget_module_can_unload,
- 0,
- dockwidget_module_cleanup
-)
-
-#include "libkvidockwidget_qt4.moc"
-
-#endif
diff --git a/src/modules/dockwidget/libkvidockwidget_qt4.h b/src/modules/dockwidget/libkvidockwidget_qt4.h
deleted file mode 100644
index f9231a2b4..000000000
--- a/src/modules/dockwidget/libkvidockwidget_qt4.h
+++ /dev/null
@@ -1,81 +0,0 @@
-#ifndef _KVI_DOCKWIDGET_QT4_H_
-#define _KVI_DOCKWIDGET_QT4_H_
-//
-// This file is part of the KVirc irc client distribution
-// Creation date : Tue 02 Jan 2001 14:28:25 by Szymon Stefanek
-// Copyright (C) 2000-2001 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"
-//#ifdef COMPILE_USE_QT4
-
-#include "kvi_frame.h"
-
-class KviTalPopupMenu;
-#include <QSystemTrayIcon>
-
-class QPixmap;
-class QTimer;
-
-//class KviFrame;
-class KviDynamicToolTip;
-
-class KviDockWidget : public QSystemTrayIcon, public KviDockExtension
-{
- Q_OBJECT
-public:
- KviDockWidget(KviFrame * win);
- ~KviDockWidget();
-protected:
- KviFrame * m_pFrm;
- KviDynamicToolTip * m_pTip;
- KviTalPopupMenu * m_pContextPopup;
- KviTalPopupMenu * m_pAwayPopup;
-
- int m_iToggleFrame;
- int m_iAwayMenuId;
-
- bool m_bFlashed;
-
- QPixmap m_CurrentPixmap;
- QTimer* m_pFlashingTimer;
- int m_iConsoles;
- int m_iChannels;
- int m_iQueries;
- int m_iOther;
-public:
- KviFrame * frame(){ return m_pFrm; };
-public:
- virtual void refresh();
- virtual void die();
- void updateIcon();
-protected:
- void grabActivityInfo();
-
-protected slots:
- void fillContextPopup();
- void toggleParentFrame();
- void tipRequest(KviDynamicToolTip *tip,const QPoint &pnt);
- void doAway(int);
- void flashingTimerShot();
-
- void activatedSlot( QSystemTrayIcon::ActivationReason reason );
-};
-
-//#endif
-
-#endif //_KVI_DOCKWIDGET_QT4_H_
diff --git a/src/modules/dockwidget/trayicon.cpp b/src/modules/dockwidget/trayicon.cpp
deleted file mode 100644
index f3d08ab2f..000000000
--- a/src/modules/dockwidget/trayicon.cpp
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * trayicon.cpp - system-independent trayicon class (adapted from Qt example)
- * Copyright (C) 2003 Justin Karneges
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#if 0
-
-#include "trayicon.h"
-#include "kvi_tal_popupmenu.h"
-
-/*!
- \class TrayIcon qtrayicon.h
- \brief The TrayIcon class implements an entry in the system tray.
-*/
-
-/*!
- Creates a TrayIcon object. \a parent and \a name are propagated
- to the QObject constructor. The icon is initially invisible.
-
- \sa show
-*/
-TrayIcon::TrayIcon( QObject *parent, const char *name )
-: QObject(parent, name), pop(0), d(0)
-{
- v_isWMDock = FALSE;
-}
-
-/*!
- Creates a TrayIcon object displaying \a icon and \a tooltip, and opening
- \a popup when clicked with the right mousebutton. \a parent and \a name are
- propagated to the QObject constructor. The icon is initially invisible.
-
- \sa show
-*/
-TrayIcon::TrayIcon( const QPixmap &icon, const QString &tooltip, KviTalPopupMenu *popup, QObject *parent, const char *name )
-: QObject(parent, name), pop(popup), pm(icon), tip(tooltip), d(0)
-{
- v_isWMDock = FALSE;
-
- if ( !pm.width() || !pm.height() )
- pm = QPixmap( 16, 16 );
-}
-
-/*!
- Removes the icon from the system tray and frees all allocated resources.
-*/
-TrayIcon::~TrayIcon()
-{
- sysRemove();
-}
-
-/*!
- Informs the trayicon that the notification owner has probably been changed;
- and that it should attempt to register or re-register.
-*/
-void TrayIcon::newTrayOwner()
-{
- // detach ourself from any existing notification area.
- hide();
- // show ourself on the new notification area
- show();
-}
-
-
-/*!
- Sets the context menu to \a popup. The context menu will pop up when the
- user clicks the system tray entry with the right mouse button.
-*/
-void TrayIcon::setPopup( KviTalPopupMenu* popup )
-{
- pop = popup;
-}
-
-/*!
- Returns the current popup menu.
-
- \sa setPopup
-*/
-KviTalPopupMenu* TrayIcon::popup() const
-{
- return pop;
-}
-
-/*!
- \property TrayIcon::icon
- \brief the system tray icon.
-*/
-void TrayIcon::setIcon( const QPixmap &icon )
-{
- //if(!popup()) {
- // tip = "";
- //}
-
- pm = icon;
- sysUpdateIcon();
-}
-
-QPixmap TrayIcon::icon() const
-{
- return pm;
-}
-
-/*!
- \property TrayIcon::toolTip
- \brief the tooltip for the system tray entry
-
- On some systems, the tooltip's length is limited and will be truncated as necessary.
-*/
-void TrayIcon::setToolTip( const QString &tooltip )
-{
- tip = tooltip;
- sysUpdateToolTip();
-}
-
-QString TrayIcon::toolTip() const
-{
- return tip;
-}
-
-/*!
- Shows the icon in the system tray.
-
- \sa hide
-*/
-void TrayIcon::show()
-{
- sysInstall();
-}
-
-/*!
- Hides the system tray entry.
-*/
-void TrayIcon::hide()
-{
- sysRemove();
-}
-
-/*!
- \reimp
-*/
-bool TrayIcon::event( QEvent *e )
-{
- switch ( e->type() ) {
- case QEvent::MouseMove:
- mouseMoveEvent( (QMouseEvent*)e );
- break;
-
- case QEvent::MouseButtonPress:
- mousePressEvent( (QMouseEvent*)e );
- break;
-
- case QEvent::MouseButtonRelease:
- mouseReleaseEvent( (QMouseEvent*)e );
- break;
-
- case QEvent::MouseButtonDblClick:
- mouseDoubleClickEvent( (QMouseEvent*)e );
- break;
- default:
- return QObject::event( e );
- }
-
- return TRUE;
-}
-
-/*!
- This event handler can be reimplemented in a subclass to receive
- mouse move events for the system tray entry.
-
- \sa mousePressEvent(), mouseReleaseEvent(), mouseDoubleClickEvent(), QMouseEvent
-*/
-void TrayIcon::mouseMoveEvent( QMouseEvent *e )
-{
- e->ignore();
-}
-
-/*!
- This event handler can be reimplemented in a subclass to receive
- mouse press events for the system tray entry.
-
- \sa mouseReleaseEvent(), mouseDoubleClickEvent(),
- mouseMoveEvent(), QMouseEvent
-*/
-void TrayIcon::mousePressEvent( QMouseEvent *e )
-{
-#ifndef Q_WS_WIN
-// This is for X11, menus appear on mouse press
-// I'm not sure whether Mac should be here or below.. Somebody check?
- switch ( e->button() ) {
- case Qt::RightButton:
- if ( pop ) {
- pop->popup( e->globalPos() );
- e->accept();
- }
- break;
- case Qt::LeftButton:
- case Qt::MidButton:
- emit clicked( e->globalPos(), e->button() );
- break;
- default:
- break;
- }
-#endif
- e->ignore();
-}
-
-/*!
- This event handler can be reimplemented in a subclass to receive
- mouse release events for the system tray entry.
-
- The default implementations opens the context menu when the entry
- has been clicked with the right mouse button.
-
- \sa setPopup(), mousePressEvent(), mouseDoubleClickEvent(),
- mouseMoveEvent(), QMouseEvent
-*/
-void TrayIcon::mouseReleaseEvent( QMouseEvent *e )
-{
-#ifdef Q_WS_WIN
-// This is for Windows, where menus appear on mouse release
- switch ( e->button() ) {
- case Qt::RightButton:
- if ( pop ) {
- // Necessary to make keyboard focus
- // and menu closing work on Windows.
- pop->setActiveWindow();
- pop->popup( e->globalPos() );
- pop->setActiveWindow();
- e->accept();
- }
- break;
- case Qt::LeftButton:
- case Qt::MidButton:
- emit clicked( e->globalPos(), e->button() );
- break;
- default:
- break;
- }
-#endif
- e->ignore();
-}
-
-/*!
- This event handler can be reimplemented in a subclass to receive
- mouse double click events for the system tray entry.
-
- Note that the system tray entry gets a mousePressEvent() and a
- mouseReleaseEvent() before the mouseDoubleClickEvent().
-
- \sa mousePressEvent(), mouseReleaseEvent(),
- mouseMoveEvent(), QMouseEvent
-*/
-void TrayIcon::mouseDoubleClickEvent( QMouseEvent *e )
-{
- if ( e->button() == Qt::LeftButton )
- emit doubleClicked( e->globalPos() );
- e->accept();
-}
-
-/*!
- \fn void TrayIcon::clicked( const QPoint &p )
-
- This signal is emitted when the user clicks the system tray icon
- with the left mouse button, with \a p being the global mouse position
- at that moment.
-*/
-
-/*!
- \fn void TrayIcon::doubleClicked( const QPoint &p )
-
- This signal is emitted when the user double clicks the system tray
- icon with the left mouse button, with \a p being the global mouse position
- at that moment.
-*/
-
-void TrayIcon::gotCloseEvent()
-{
- closed();
-}
-
-#endif
diff --git a/src/modules/dockwidget/trayicon.h b/src/modules/dockwidget/trayicon.h
deleted file mode 100644
index 17184f638..000000000
--- a/src/modules/dockwidget/trayicon.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * trayicon.h - system-independent trayicon class (adapted from Qt example)
- * Copyright (C) 2003 Justin Karneges
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#ifndef CS_TRAYICON_H
-#define CS_TRAYICON_H
-
-#if 0
-
-#include "kvi_settings.h"
-
-#include <qobject.h>
-#include <qimage.h>
-
-class KviTalPopupMenu;
-
-class TrayIcon : public QObject
-{
- Q_OBJECT
-
- Q_PROPERTY( QString toolTip READ toolTip WRITE setToolTip )
- Q_PROPERTY( QPixmap icon READ icon WRITE setIcon )
-
-public:
- TrayIcon( QObject *parent = 0, const char *name = 0 );
- TrayIcon( const QPixmap &, const QString &, KviTalPopupMenu *popup = 0, QObject *parent = 0, const char *name = 0 );
- ~TrayIcon();
-
- // use WindowMaker dock mode. ignored on non-X11 platforms
- void setWMDock(bool use) { v_isWMDock = use; }
- bool isWMDock() { return v_isWMDock; }
-
- // Set a popup menu to handle RMB
- void setPopup( KviTalPopupMenu * );
- KviTalPopupMenu* popup() const;
-
- QPixmap icon() const;
- QString toolTip() const;
-
- void gotCloseEvent();
-
-public slots:
- void setIcon( const QPixmap &icon );
- void setToolTip( const QString &tip );
-
- void show();
- void hide();
-
- void newTrayOwner();
-
-signals:
- void clicked( const QPoint&, int);
- void doubleClicked( const QPoint& );
- void closed();
-
-protected:
- bool event( QEvent * );
- virtual void mouseMoveEvent( QMouseEvent *e );
- virtual void mousePressEvent( QMouseEvent *e );
- virtual void mouseReleaseEvent( QMouseEvent *e );
- virtual void mouseDoubleClickEvent( QMouseEvent *e );
-
-private:
- KviTalPopupMenu *pop;
- QPixmap pm;
- QString tip;
- bool v_isWMDock;
-
- // system-dependant part
-public:
- class TrayIconPrivate;
-private:
- TrayIconPrivate *d;
- void sysInstall();
- void sysRemove();
- void sysUpdateIcon();
- void sysUpdateToolTip();
-
- friend class TrayIconPrivate;
-};
-
-#endif
-
-#endif // CS_TRAYICON_H
diff --git a/src/modules/dockwidget/trayicon_mac.cpp b/src/modules/dockwidget/trayicon_mac.cpp
deleted file mode 100644
index d192a366b..000000000
--- a/src/modules/dockwidget/trayicon_mac.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#if 0
-
-#ifdef Q_OS_MACX
-
-#include "trayicon.h"
-
-void TrayIcon::sysInstall()
-{
-}
-
-void TrayIcon::sysRemove()
-{
-}
-
-void TrayIcon::sysUpdateIcon()
-{
-}
-
-void TrayIcon::sysUpdateToolTip()
-{
-}
-
-#endif
-
-#endif
diff --git a/src/modules/dockwidget/trayicon_win.cpp b/src/modules/dockwidget/trayicon_win.cpp
deleted file mode 100644
index b23ac93a8..000000000
--- a/src/modules/dockwidget/trayicon_win.cpp
+++ /dev/null
@@ -1,263 +0,0 @@
-#if 0
-
-/*
- * trayicon_win.cpp - Windows trayicon, adapted from Qt example
- * Copyright (C) 2003 Justin Karneges
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "trayicon.h"
-
-#include <qwidget.h>
-#include <qapplication.h>
-#include <qimage.h>
-#include <qpixmap.h>
-#include <qbitmap.h>
-#include <qcursor.h>
-#include <qlibrary.h>
-
-#include <qt_windows.h>
-
-static uint WM_TASKBARCREATED = 0;
-#define WM_NOTIFYICON (WM_APP+101)
-
-typedef BOOL (WINAPI *PtrShell_NotifyIcon)(DWORD,PNOTIFYICONDATA);
-static PtrShell_NotifyIcon ptrShell_NotifyIcon = 0;
-
-static void resolveLibs()
-{
- QLibrary lib("shell32");
- lib.setAutoUnload( FALSE );
- static bool triedResolve = FALSE;
- if ( !ptrShell_NotifyIcon && !triedResolve ) {
- triedResolve = TRUE;
- ptrShell_NotifyIcon = (PtrShell_NotifyIcon) lib.resolve( "Shell_NotifyIconW" );
- }
-}
-
-class TrayIcon::TrayIconPrivate : public QWidget
-{
-public:
- HICON hIcon;
- HBITMAP hMask;
- TrayIcon *iconObject;
-
- TrayIconPrivate( TrayIcon *object )
- : QWidget( 0 ), hIcon( 0 ), hMask( 0 ), iconObject( object )
- {
- if ( !WM_TASKBARCREATED )
- WM_TASKBARCREATED = RegisterWindowMessage( TEXT("TaskbarCreated") );
- }
-
- ~TrayIconPrivate()
- {
- if ( hMask ) {
- DeleteObject( hMask );
- hMask = 0; // michalj
- }
- if ( hIcon ) {
- DestroyIcon( hIcon );
- hIcon = 0; // michalj
- }
- }
-
- // the unavoidable A/W versions. Don't forget to keep them in sync!
- bool trayMessageA( DWORD msg )
- {
- NOTIFYICONDATAA tnd;
- ZeroMemory( &tnd, sizeof(NOTIFYICONDATAA) );
- tnd.cbSize = sizeof(NOTIFYICONDATAA);
- tnd.hWnd = winId();
- tnd.uID = 1; // michalj
-
- if ( msg != NIM_DELETE ) {
- tnd.uFlags = NIF_MESSAGE|NIF_ICON|NIF_TIP;
- tnd.uCallbackMessage= WM_NOTIFYICON;
- tnd.hIcon = hIcon;
- if ( !iconObject->toolTip().isNull() ) {
- // Tip is limited to 63 + NULL; lstrcpyn appends a NULL terminator.
- QString tip = iconObject->toolTip().left( 63 ) + QChar();
- lstrcpynA(tnd.szTip, (const char*)tip.local8Bit(), QMIN( tip.length()+1, 64 ) );
- }
- }
-
- return Shell_NotifyIconA(msg, &tnd);
- }
-
-#ifdef UNICODE
- bool trayMessageW( DWORD msg )
- {
- resolveLibs();
- if ( ! (ptrShell_NotifyIcon && qWinVersion() & Qt::WV_NT_based) )
- return trayMessageA( msg );
-
- NOTIFYICONDATAW tnd;
- ZeroMemory( &tnd, sizeof(NOTIFYICONDATAW) );
- tnd.cbSize = sizeof(NOTIFYICONDATAW);
- tnd.hWnd = winId();
- tnd.uID = 1; // michalj
-
- if ( msg != NIM_DELETE ) {
- tnd.uFlags = NIF_MESSAGE|NIF_ICON|NIF_TIP;
- tnd.uCallbackMessage= WM_NOTIFYICON;
- tnd.hIcon = hIcon;
- if ( !iconObject->toolTip().isNull() ) {
- // Tip is limited to 63 + NULL; lstrcpyn appends a NULL terminator.
- QString tip = iconObject->toolTip().left( 63 ) + QChar();
- lstrcpynW(tnd.szTip, (TCHAR*)tip.unicode(), QMIN( tip.length()+1, 64 ) );
- // lstrcpynW(tnd.szTip, (TCHAR*)qt_winTchar( tip, FALSE ), QMIN( tip.length()+1, 64 ) );
- }
- }
- return ptrShell_NotifyIcon(msg, &tnd);
- }
-#endif
-
- bool trayMessage( DWORD msg )
- {
- QT_WA(
- return trayMessageW(msg);
- ,
- return trayMessageA(msg);
- )
- }
-
- bool iconDrawItem(LPDRAWITEMSTRUCT lpdi)
- {
- if (!hIcon)
- return FALSE;
-
- DrawIconEx(lpdi->hDC, lpdi->rcItem.left, lpdi->rcItem.top, hIcon, 0, 0, 0, NULL, DI_NORMAL );
- return TRUE;
- }
-
- bool winEvent( MSG *m )
- {
- switch(m->message) {
- case WM_DRAWITEM:
- return iconDrawItem( (LPDRAWITEMSTRUCT)m->lParam );
- case WM_NOTIFYICON:
- {
- QMouseEvent *e = 0;
- QPoint gpos = QCursor::pos();
- switch (m->lParam) {
- case WM_MOUSEMOVE: e = new QMouseEvent( QEvent::MouseMove, mapFromGlobal( gpos ), gpos, 0, 0 ); break;
- case WM_LBUTTONDOWN: e = new QMouseEvent( QEvent::MouseButtonPress, mapFromGlobal( gpos ), gpos, Qt::LeftButton, Qt::LeftButton ); break;
- case WM_LBUTTONUP: e = new QMouseEvent( QEvent::MouseButtonRelease, mapFromGlobal( gpos ), gpos, Qt::LeftButton, Qt::LeftButton ); break;
- case WM_LBUTTONDBLCLK: e = new QMouseEvent( QEvent::MouseButtonDblClick, mapFromGlobal( gpos ), gpos, Qt::LeftButton, Qt::LeftButton ); break;
- case WM_RBUTTONDOWN: e = new QMouseEvent( QEvent::MouseButtonPress, mapFromGlobal( gpos ), gpos, Qt::RightButton, Qt::RightButton ); break;
- case WM_RBUTTONUP: e = new QMouseEvent( QEvent::MouseButtonRelease, mapFromGlobal( gpos ), gpos, Qt::RightButton, Qt::RightButton ); break;
- case WM_RBUTTONDBLCLK: e = new QMouseEvent( QEvent::MouseButtonDblClick, mapFromGlobal( gpos ), gpos, Qt::RightButton, Qt::RightButton ); break;
- case WM_MBUTTONDOWN: e = new QMouseEvent( QEvent::MouseButtonPress, mapFromGlobal( gpos ), gpos, Qt::MidButton, Qt::MidButton ); break;
- case WM_MBUTTONUP: e = new QMouseEvent( QEvent::MouseButtonRelease, mapFromGlobal( gpos ), gpos, Qt::MidButton, Qt::MidButton ); break;
- case WM_MBUTTONDBLCLK: e = new QMouseEvent( QEvent::MouseButtonDblClick, mapFromGlobal( gpos ), gpos, Qt::MidButton, Qt::MidButton ); break;
- case WM_CONTEXTMENU: e = new QMouseEvent( QEvent::MouseButtonRelease, mapFromGlobal( gpos ), gpos, Qt::RightButton, Qt::RightButton ); break;
- }
- if ( e ) {
- bool res = QApplication::sendEvent( iconObject, e );
- delete e;
- return res;
- }
- }
- break;
- default:
- if ( m->message == WM_TASKBARCREATED ) trayMessage( NIM_ADD );
- }
- return QWidget::winEvent( m );
- }
-};
-
-static HBITMAP createIconMask( const QPixmap &qp )
-{
- QImage bm = qp.convertToImage();
- int w = bm.width();
- int h = bm.height();
- int bpl = ((w+15)/16)*2; // bpl, 16 bit alignment
- uchar *bits = new uchar[bpl*h];
- bm.invertPixels();
- for ( int y=0; y<h; y++ )
- memcpy( bits+y*bpl, bm.scanLine(y), bpl );
- HBITMAP hbm = CreateBitmap( w, h, 1, 1, bits );
- delete [] bits;
- return hbm;
-}
-
-static HICON createIcon( const QPixmap &pm, HBITMAP &hbm )
-{
- QPixmap maskpm( pm.size(), pm.depth(), QPixmap::NormalOptim );
- QBitmap mask( pm.size(), FALSE, QPixmap::NormalOptim );
- if ( pm.mask() ) {
- maskpm.fill( Qt::black ); // make masked area black
- bitBlt( &mask, 0, 0, pm.mask() );
- } else
- maskpm.fill( Qt::color1 );
-
- bitBlt( &maskpm, 0, 0, &pm);
- ICONINFO iconInfo;
- iconInfo.fIcon = TRUE;
- iconInfo.hbmMask = hbm = createIconMask(mask);
- iconInfo.hbmColor = maskpm.hbm();
-
- HICON icon = CreateIconIndirect( &iconInfo );
- DeleteObject(iconInfo.hbmMask);
- iconInfo.hbmMask = hbm = 0; // michalj
- return icon;
-}
-
-void TrayIcon::sysInstall()
-{
- if ( !d ) {
- d = new TrayIconPrivate( this );
- d->hIcon = createIcon( pm, d->hMask );
-
- d->trayMessage( NIM_ADD );
- }
-}
-
-void TrayIcon::sysRemove()
-{
- if ( d ) {
- d->trayMessage( NIM_DELETE );
-
- delete d;
- d = 0;
- }
-}
-
-void TrayIcon::sysUpdateIcon()
-{
- if ( d ) {
- if ( d->hMask ) {
- DeleteObject( d->hMask );
- d->hMask = 0; // michalj
- }
- if ( d->hIcon ) {
- DestroyIcon( d->hIcon );
- d->hIcon = 0; // michalj
- }
-
- d->hIcon = createIcon( pm, d->hMask );
- d->trayMessage( NIM_MODIFY );
- }
-}
-
-void TrayIcon::sysUpdateToolTip()
-{
- if ( d )
- d->trayMessage( NIM_MODIFY );
-}
-
-#endif
diff --git a/src/modules/dockwidget/trayicon_x11.cpp b/src/modules/dockwidget/trayicon_x11.cpp
deleted file mode 100644
index a64580abb..000000000
--- a/src/modules/dockwidget/trayicon_x11.cpp
+++ /dev/null
@@ -1,416 +0,0 @@
-#if 0
-
-/*
- * trayicon_x11.cpp - X11 trayicon (for use with KDE and GNOME)
- * Copyright (C) 2003 Justin Karneges
- * GNOME2 Notification Area support: Tomasz Sterna
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kvi_settings.h" // Needed for the two define checks below
-#ifndef Q_OS_MACX
-#ifndef COMPILE_ON_WINDOWS
-
-#include "trayicon.h"
-
-#include <qapplication.h>
-#include <qimage.h>
-#include <qpixmap.h>
-#include <qtooltip.h>
-#include <qpainter.h>
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-
-//#if QT_VERSION < 0x030200
-extern Time qt_x_time;
-//#endif
-
-//----------------------------------------------------------------------------
-// common stuff
-//----------------------------------------------------------------------------
-
-// for Gnome2 Notification Area
-static XErrorHandler old_handler = 0;
-static int dock_xerror = 0;
-extern "C" int dock_xerrhandler(Display* dpy, XErrorEvent* err)
-{
- dock_xerror = err->error_code;
- return old_handler(dpy, err);
-}
-
-static void trap_errors()
-{
- dock_xerror = 0;
- old_handler = XSetErrorHandler(dock_xerrhandler);
-}
-
-static bool untrap_errors()
-{
- XSetErrorHandler(old_handler);
- return (dock_xerror == 0);
-}
-
-static bool send_message(
- Display* dpy, /* display */
- Window w, /* sender (tray icon window) */
- long message, /* message opcode */
- long data1, /* message data 1 */
- long data2, /* message data 2 */
- long data3 /* message data 3 */
-) {
- XEvent ev;
-
- memset(&ev, 0, sizeof(ev));
- ev.xclient.type = ClientMessage;
- ev.xclient.window = w;
- ev.xclient.message_type = XInternAtom (dpy, "_NET_SYSTEM_TRAY_OPCODE", False );
- ev.xclient.format = 32;
- ev.xclient.data.l[0] = CurrentTime;
- ev.xclient.data.l[1] = message;
- ev.xclient.data.l[2] = data1;
- ev.xclient.data.l[3] = data2;
- ev.xclient.data.l[4] = data3;
-
- trap_errors();
- XSendEvent(dpy, w, False, NoEventMask, &ev);
- XSync(dpy, False);
- return untrap_errors();
-}
-
-#define SYSTEM_TRAY_REQUEST_DOCK 0
-#define SYSTEM_TRAY_BEGIN_MESSAGE 1
-#define SYSTEM_TRAY_CANCEL_MESSAGE 2
-
-//----------------------------------------------------------------------------
-// TrayIcon::TrayIconPrivate
-//----------------------------------------------------------------------------
-
-class TrayIcon::TrayIconPrivate : public QWidget
-{
-public:
- TrayIconPrivate(TrayIcon *object, int size);
- ~TrayIconPrivate() { }
-
- virtual void initWM(WId icon);
-
- virtual void setPixmap(const QPixmap &pm);
-
- virtual void paintEvent(QPaintEvent *);
- virtual void enterEvent(QEvent *);
- virtual void mouseMoveEvent(QMouseEvent *e);
- virtual void mousePressEvent(QMouseEvent *e);
- virtual void mouseReleaseEvent(QMouseEvent *e);
- virtual void mouseDoubleClickEvent(QMouseEvent *e);
- virtual void closeEvent(QCloseEvent *e);
-
-private:
- TrayIcon *iconObject;
- QPixmap pix;
- int size;
-};
-
-TrayIcon::TrayIconPrivate::TrayIconPrivate(TrayIcon *object, int _size)
- : QWidget(0, "psidock", WRepaintNoErase)
-{
- iconObject = object;
- size = _size;
-
- setFocusPolicy(NoFocus);
- setBackgroundMode(X11ParentRelative);
-
- setMinimumSize(size, size);
- setMaximumSize(size, size);
-}
-
-// This base stuff is required by both FreeDesktop specification and WindowMaker
-void TrayIcon::TrayIconPrivate::initWM(WId icon)
-{
- Display *dsp = x11Display();
- WId leader = winId();
-
- // set the class hint
- XClassHint classhint;
- classhint.res_name = (char*)"psidock";
- classhint.res_class = (char*)"Psi";
- XSetClassHint(dsp, leader, &classhint);
-
- // set the Window Manager hints
- XWMHints *hints;
- hints = XGetWMHints(dsp, leader); // init hints
- hints->flags = WindowGroupHint | IconWindowHint | StateHint; // set the window group hint
- hints->window_group = leader; // set the window hint
- hints->initial_state = WithdrawnState; // initial state
- hints->icon_window = icon; // in WM, this should be winId() of separate widget
- hints->icon_x = 0;
- hints->icon_y = 0;
- XSetWMHints(dsp, leader, hints); // set the window hints for WM to use.
- XFree( hints );
-}
-
-void TrayIcon::TrayIconPrivate::setPixmap(const QPixmap &pm)
-{
- pix = pm;
- setIcon(pix);
- repaint();
-}
-
-void TrayIcon::TrayIconPrivate::paintEvent(QPaintEvent *)
-{
- QPainter p(this);
- p.drawPixmap((width() - pix.width())/2, (height() - pix.height())/2, pix);
-}
-
-void TrayIcon::TrayIconPrivate::enterEvent(QEvent *e)
-{
- // Taken from KSystemTray..
-//#if QT_VERSION < 0x030200
- //if ( !qApp->focusWidget() ) {
- XEvent ev;
- memset(&ev, 0, sizeof(ev));
- ev.xfocus.display = qt_xdisplay();
- ev.xfocus.type = FocusIn;
- ev.xfocus.window = winId();
- ev.xfocus.mode = NotifyNormal;
- ev.xfocus.detail = NotifyAncestor;
- Time time = qt_x_time;
- qt_x_time = 1;
- qApp->x11ProcessEvent( &ev );
- qt_x_time = time;
- //}
-//#endif
- QWidget::enterEvent(e);
-}
-
-void TrayIcon::TrayIconPrivate::mouseMoveEvent(QMouseEvent *e)
-{
- QApplication::sendEvent(iconObject, e);
-}
-
-void TrayIcon::TrayIconPrivate::mousePressEvent(QMouseEvent *e)
-{
- QApplication::sendEvent(iconObject, e);
-}
-
-void TrayIcon::TrayIconPrivate::mouseReleaseEvent(QMouseEvent *e)
-{
- QApplication::sendEvent(iconObject, e);
-}
-
-void TrayIcon::TrayIconPrivate::mouseDoubleClickEvent(QMouseEvent *e)
-{
- QApplication::sendEvent(iconObject, e);
-}
-
-void TrayIcon::TrayIconPrivate::closeEvent(QCloseEvent *e)
-{
- iconObject->gotCloseEvent();
- e->accept();
-}
-
-//----------------------------------------------------------------------------
-// TrayIconFreeDesktop
-//----------------------------------------------------------------------------
-
-class TrayIconFreeDesktop : public TrayIcon::TrayIconPrivate
-{
-public:
- TrayIconFreeDesktop(TrayIcon *object, const QPixmap &pm);
-protected:
- virtual bool x11Event(XEvent*);
-};
-
-TrayIconFreeDesktop::TrayIconFreeDesktop(TrayIcon *object, const QPixmap &pm)
- : TrayIconPrivate(object, 22)
-{
- initWM( winId() );
-
- // initialize NetWM
- Display *dsp = x11Display();
-
- // dock the widget (adapted from SIM-ICQ)
- Screen *screen = XDefaultScreenOfDisplay(dsp); // get the screen
- int screen_id = XScreenNumberOfScreen(screen); // and it's number
-
- // tell X that we want to see ClientMessage and Deleted events, which
- // are picked up by QApplication::x11EventFilter
- Window root_window = QApplication::desktop()->winId();
- XWindowAttributes attr;
-
- XGetWindowAttributes(dsp, root_window, &attr);
- XSelectInput(dsp, root_window, attr.your_event_mask | StructureNotifyMask);
-
- char buf[32];
- snprintf(buf, sizeof(buf), "_NET_SYSTEM_TRAY_S%d", screen_id);
- Atom selection_atom = XInternAtom(dsp, buf, false);
- XGrabServer(dsp);
- Window manager_window = XGetSelectionOwner(dsp, selection_atom);
- if ( manager_window != None )
- XSelectInput(dsp, manager_window, StructureNotifyMask);
- XUngrabServer(dsp);
- XFlush(dsp);
-
- if ( manager_window != None )
- send_message(dsp, manager_window, SYSTEM_TRAY_REQUEST_DOCK, winId(), 0, 0);
- else
- {
- object->hide();
- return;
- }
-
- // some KDE mumbo-jumbo... why is it there? anybody?
- Atom kwm_dockwindow_atom = XInternAtom(dsp, "KWM_DOCKWINDOW", false);
- Atom kde_net_system_tray_window_for_atom = XInternAtom(dsp, "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", false);
-
- long data = 0;
- XChangeProperty(dsp, winId(), kwm_dockwindow_atom, kwm_dockwindow_atom, 32, PropModeReplace, (uchar*)&data, 1);
- XChangeProperty(dsp, winId(), kde_net_system_tray_window_for_atom, XA_WINDOW, 32, PropModeReplace, (uchar*)&data, 1);
-
- setPixmap(pm);
-}
-
-bool TrayIconFreeDesktop::x11Event(XEvent *ev)
-{
- switch(ev->type)
- {
- case ReparentNotify:
- show();
-
- }
- return false;
-}
-
-//----------------------------------------------------------------------------
-// TrayIconWindowMaker
-//----------------------------------------------------------------------------
-
-class TrayIconWharf : public TrayIcon::TrayIconPrivate
-{
-public:
- TrayIconWharf(TrayIcon *object, const QPixmap &pm)
- : TrayIconPrivate(object, 44)
- {
- // set the class hint
- XClassHint classhint;
- classhint.res_name = (char*)"psidock-wharf";
- classhint.res_class = (char*)"Psi";
- XSetClassHint(x11Display(), winId(), &classhint);
-
- setPixmap(pm);
- }
-
- void setPixmap(const QPixmap &_pm)
- {
- QPixmap pm;
- QImage i = _pm.convertToImage();
- i = i.scale(i.width() * 2, i.height() * 2);
- pm.convertFromImage(i);
-
- TrayIconPrivate::setPixmap(pm);
-
- // thanks to Robert Spier for this:
- // for some reason the repaint() isn't being honored, or isn't for
- // the icon. So force one on the widget behind the icon
- erase();
- QPaintEvent pe( rect() );
- paintEvent(&pe);
- }
-};
-
-class TrayIconWindowMaker : public TrayIcon::TrayIconPrivate
-{
-public:
- TrayIconWindowMaker(TrayIcon *object, const QPixmap &pm);
- ~TrayIconWindowMaker();
-
- void setPixmap(const QPixmap &pm);
-
-private:
- TrayIconWharf *wharf;
-};
-
-TrayIconWindowMaker::TrayIconWindowMaker(TrayIcon *object, const QPixmap &pm)
- : TrayIconPrivate(object, 32)
-{
- wharf = new TrayIconWharf(object, pm);
-
- initWM( wharf->winId() );
-}
-
-TrayIconWindowMaker::~TrayIconWindowMaker()
-{
- delete wharf;
-}
-
-void TrayIconWindowMaker::setPixmap(const QPixmap &pm)
-{
- wharf->setPixmap(pm);
-}
-
-//----------------------------------------------------------------------------
-// TrayIcon
-//----------------------------------------------------------------------------
-
-void TrayIcon::sysInstall()
-{
- if ( d )
- return;
-
- if ( v_isWMDock )
- d = (TrayIconPrivate *)(new TrayIconWindowMaker(this, pm));
- else
- d = (TrayIconPrivate *)(new TrayIconFreeDesktop(this, pm));
-
- sysUpdateToolTip();
-
- if ( v_isWMDock )
- d->show();
-}
-
-void TrayIcon::sysRemove()
-{
- if ( !d )
- return;
-
- delete d;
- d = 0;
-}
-
-void TrayIcon::sysUpdateIcon()
-{
- if ( !d )
- return;
-
- QPixmap pix = pm;
- d->setPixmap(pix);
-}
-
-void TrayIcon::sysUpdateToolTip()
-{
- if ( !d )
- return;
-
- if ( tip.isEmpty() )
- QToolTip::remove(d);
- else
- QToolTip::add(d, tip);
-}
-
-#endif
-#endif
-#endif