diff options
| author | 2008-01-02 04:06:48 +0000 | |
|---|---|---|
| committer | 2008-01-02 04:06:48 +0000 | |
| commit | 8e1fb06c090490317072f80b6b23838263186bc9 (patch) | |
| tree | d82e4156ff900e105e5af599879f2df99a380520 /src/modules | |
| parent | Readded credits. (diff) | |
| download | KVIrc-8e1fb06c090490317072f80b6b23838263186bc9.tar.gz KVIrc-8e1fb06c090490317072f80b6b23838263186bc9.tar.bz2 KVIrc-8e1fb06c090490317072f80b6b23838263186bc9.zip | |
Added context module
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1050 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/Makefile.am | 1 | ||||
| -rw-r--r-- | src/modules/context/.svnignore | 9 | ||||
| -rw-r--r-- | src/modules/context/Makefile.am | 18 | ||||
| -rwxr-xr-x | src/modules/context/context.vcproj | 149 | ||||
| -rw-r--r-- | src/modules/context/context_QT4_vc05.vcproj | 232 | ||||
| -rw-r--r-- | src/modules/context/context_vc05.vcproj | 225 | ||||
| -rw-r--r-- | src/modules/context/libkvicontext.cpp | 302 | ||||
| -rw-r--r-- | src/modules/window/libkviwindow.cpp | 29 |
8 files changed, 965 insertions, 0 deletions
diff --git a/src/modules/Makefile.am b/src/modules/Makefile.am index 47280a277..7f3254373 100644 --- a/src/modules/Makefile.am +++ b/src/modules/Makefile.am @@ -9,6 +9,7 @@ SUBDIRS = about \ clock \ codetester \ config \ + context \ dcc \ dialog \ editor \ diff --git a/src/modules/context/.svnignore b/src/modules/context/.svnignore new file mode 100644 index 000000000..05942bc9e --- /dev/null +++ b/src/modules/context/.svnignore @@ -0,0 +1,9 @@ +Makefile.in +Makefile +.deps +*.o +*.lo +*.la +*.moc +.libs +moc_editor.cpp diff --git a/src/modules/context/Makefile.am b/src/modules/context/Makefile.am new file mode 100644 index 000000000..e4ec3252d --- /dev/null +++ b/src/modules/context/Makefile.am @@ -0,0 +1,18 @@ +############################################################################### +# 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 = libkvicontext.la + +libkvicontext_la_LDFLAGS = -module -avoid-version $(SS_LDFLAGS) $(SS_LIBDIRS) + +libkvicontext_la_SOURCES = libkvicontext.cpp +libkvicontext_la_LIBADD = $(SS_LIBLINK) ../../kvilib/build/libkvilib.la + +# noinst_HEADERS= + +%.moc: %.h + $(SS_QT_MOC) $< -o $@ diff --git a/src/modules/context/context.vcproj b/src/modules/context/context.vcproj new file mode 100755 index 000000000..7ada36812 --- /dev/null +++ b/src/modules/context/context.vcproj @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="7.10" + Name="context" + ProjectGUID="{542FE556-EB89-4B2E-BE26-EA4A01ABEF48}" + Keyword="Win32Proj"> + <Platforms> + <Platform + Name="Win32"/> + </Platforms> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="$(SolutionDir)\win32build\bin\modules" + IntermediateDirectory="Debug" + ConfigurationType="2" + CharacterSet="2"> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui"" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STR_EXPORTS" + MinimalRebuild="TRUE" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="TRUE" + DebugInformationFormat="4"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="qt-mtnc321.lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib kvirc.lib msvcrt.lib" + OutputFile="$(OutDir)/kvi$(ProjectName).dll" + LinkIncremental="2" + AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin"" + IgnoreAllDefaultLibraries="TRUE" + GenerateDebugInformation="TRUE" + ProgramDatabaseFile="$(OutDir)/context.pdb" + SubSystem="2" + ImportLibrary="$(OutDir)/context.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" + EnableIntrinsicFunctions="FALSE" + FavorSizeOrSpeed="1" + OmitFramePointers="TRUE" + EnableFiberSafeOptimizations="TRUE" + AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui"" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;STR_EXPORTS" + RuntimeLibrary="0" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="TRUE" + DebugInformationFormat="3"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="qt-mtnc321.lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib kvirc.lib msvcrt.lib" + OutputFile="$(OutDir)/kvi$(ProjectName).dll" + LinkIncremental="1" + AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin"" + IgnoreAllDefaultLibraries="TRUE" + GenerateDebugInformation="TRUE" + SubSystem="2" + OptimizeReferences="2" + EnableCOMDATFolding="2" + OptimizeForWindows98="1" + ImportLibrary="$(OutDir)/context.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=".\libkvicontext.cpp"> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> + </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/context/context_QT4_vc05.vcproj b/src/modules/context/context_QT4_vc05.vcproj new file mode 100644 index 000000000..272978d0d --- /dev/null +++ b/src/modules/context/context_QT4_vc05.vcproj @@ -0,0 +1,232 @@ +<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="context"
+ ProjectGUID="{542FE556-EB89-4B2E-BE26-EA4A01ABEF48}"
+ RootNamespace="context"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)\win32build\bin\modules\"
+ IntermediateDirectory="Debug"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui";"$(QTDIR)\include\Qt3Support";"$(QTDIR)\include\QtCore\";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtNetwork";"$(QTDIR)\include\QtXml";"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STR_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 SSLeay32.lib libeay32.lib"
+ OutputFile="$(OutDir)/kvi$(ProjectName).dll"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)""
+ GenerateManifest="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/context.pdb"
+ SubSystem="2"
+ TurnOffAssemblyGeneration="true"
+ ImportLibrary="$(OutDir)/context.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=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui";"$(QTDIR)\include\Qt3Support";"$(QTDIR)\include\QtCore\";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtNetwork";"$(QTDIR)\include\QtXml";"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;STR_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="qtmain.lib kvilib.lib kvirc.lib qt3support4.lib qtcore4.lib qtgui4.lib libeay32.lib SSLeay32.lib"
+ OutputFile="$(OutDir)/kvi$(ProjectName).dll"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)""
+ GenerateManifest="true"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ LinkTimeCodeGeneration="1"
+ TurnOffAssemblyGeneration="true"
+ ImportLibrary="$(OutDir)/context.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=".\libkvicontext.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </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/context/context_vc05.vcproj b/src/modules/context/context_vc05.vcproj new file mode 100644 index 000000000..99432ad8f --- /dev/null +++ b/src/modules/context/context_vc05.vcproj @@ -0,0 +1,225 @@ +<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="context"
+ ProjectGUID="{542FE556-EB89-4B2E-BE26-EA4A01ABEF48}"
+ RootNamespace="context"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)\win32build\bin\modules\"
+ IntermediateDirectory="Debug"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STR_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=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)""
+ GenerateManifest="true"
+ IgnoreAllDefaultLibraries="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/context.pdb"
+ SubSystem="2"
+ TurnOffAssemblyGeneration="true"
+ ImportLibrary="$(OutDir)/context.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=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;STR_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=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)""
+ GenerateManifest="true"
+ IgnoreAllDefaultLibraries="true"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ TurnOffAssemblyGeneration="true"
+ ImportLibrary="$(OutDir)/context.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=".\libkvicontext.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </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/context/libkvicontext.cpp b/src/modules/context/libkvicontext.cpp new file mode 100644 index 000000000..28f3fb1bf --- /dev/null +++ b/src/modules/context/libkvicontext.cpp @@ -0,0 +1,302 @@ +//============================================================================= +// +// File : libkvistr.cpp +// Creation date : Wed Jan 02 2007 03:04:12 GMT by Szymon Stefanek +// +// This file is part of the KVirc irc client distribution +// Copyright (C) 2007 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. +// +//============================================================================= + +//#warning: FIXME: Incomplete documentation ('seealso', 'example', etc) + +#include "kvi_module.h" +#include "kvi_locale.h" +#include "kvi_qstring.h" +#include "kvi_window.h" +#include "kvi_frame.h" +#include "kvi_console.h" +#include "kvi_app.h" + +#include "kvi_ircserver.h" +#include "kvi_irccontext.h" +#include "kvi_ircconnection.h" +#include "kvi_ircconnectionserverinfo.h" +#include "kvi_ircconnectionuserinfo.h" +#include "kvi_ircconnectiontarget.h" + +#define GET_CONSOLE_FROM_STANDARD_PARAMS \ + kvs_int_t iContextId; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER("irc_context_id",KVS_PT_UINT,KVS_PF_OPTIONAL,iContextId) \ + KVSM_PARAMETERS_END(c) \ + KviConsole * pConsole = NULL; \ + if(c->parameterCount() > 0) \ + pConsole = g_pApp->findConsole(iContextId); \ + else \ + pConsole = c->window()->console(); + +#define GET_CONNECTION_FROM_STANDARD_PARAMS \ + GET_CONSOLE_FROM_STANDARD_PARAMS \ + KviIrcConnection * pConnection = NULL; \ + if(pConsole) \ + pConnection = pConsole->context()->connection(); + +#define STANDARD_IRC_CONNECTION_TARGET_PARAMETER(_fncName,_setCall) \ + static bool _fncName(KviKvsModuleFunctionCall * c) \ + { \ + GET_CONNECTION_FROM_STANDARD_PARAMS \ + if(pConnection) \ + { \ + if(pConnection->target()) \ + { \ + _setCall; \ + return true; \ + } \ + } \ + c->returnValue()->setNothing(); \ + return true; \ + } + + + +/* + @doc: context.serverName + @type: + function + @title: + $context.serverName + @short: + Returns the IRC server name of an IRC context + @syntax: + <string> $contex.serverName + <string> $contex.serverName(<irc_context_id:uint>) + @description: + Returns the name of the IRC server for the specified irc context. + If no irc_context_id is specified then the current irc_context is used. + If the irc_context_id specification is not valid then this function + returns nothing. If the specified IRC context is not currently connected + then this function returns nothing. + @seealso: + $context.serverPort, $context.serverIpAddress, $context.serverPassword +*/ + +STANDARD_IRC_CONNECTION_TARGET_PARAMETER( + context_kvs_fnc_serverName, + c->returnValue()->setString(pConnection->target()->server()->hostName()) + ) + +/* + @doc: context.serverIpAddress + @type: + function + @title: + $context.serverIpAddress + @short: + Returns the IRC server ip address of an IRC context + @syntax: + <string> $contex.serverIpAddress + <string> $contex.serverIpAddress(<irc_context_id:uint>) + @description: + Returns the ip address of the IRC server for the specified irc context. + If no irc_context_id is specified then the current irc_context is used. + If the irc_context_id specification is not valid then this function + returns nothing. If the specified IRC context is not currently connected + then this function returns nothing. + @seealso: + $context.serverPort, $context.serverName, $context.serverPassword +*/ + +STANDARD_IRC_CONNECTION_TARGET_PARAMETER( + context_kvs_fnc_serverIpAddress, + c->returnValue()->setString(pConnection->target()->server()->ipAddress()) + ) + +/* + @doc: context.serverPassword + @type: + function + @title: + $context.serverPassword + @short: + Returns the password used to login to the server of an IRC context + @syntax: + <string> $contex.serverPassword + <string> $contex.serverPassword(<irc_context_id:uint>) + @description: + Returns the password used to login to the IRC server for the specified irc context. + If no irc_context_id is specified then the current irc_context is used. + If the irc_context_id specification is not valid then this function + returns nothing. If the specified IRC context is not currently connected + then this function returns nothing. + @seealso: + $context.serverName, $context.serverIpAddress, $context.serverPort +*/ + +STANDARD_IRC_CONNECTION_TARGET_PARAMETER( + context_kvs_fnc_serverPassword, + c->returnValue()->setString(pConnection->target()->server()->password()) + ) + + +/* + @doc: context.serverPort + @type: + function + @title: + $context.serverPort + @short: + Returns the port of the IRC server of an IRC context + @syntax: + <uint> $contex.serverPort + <uint> $contex.serverPort(<irc_context_id:uint>) + @description: + Returns the port of the IRC server for the specified irc context. + If no irc_context_id is specified then the current irc_context is used. + If the irc_context_id specification is not valid then this function + returns nothing. If the specified IRC context is not currently connected + then this function returns nothing. + @seealso: + $context.serverName, $context.serverIpAddress +*/ + +STANDARD_IRC_CONNECTION_TARGET_PARAMETER( + context_kvs_fnc_serverPort, + c->returnValue()->setInteger(pConnection->target()->server()->port()) + ) + + +/* + @doc: context.state + @type: + function + @title: + $context.state + @short: + Returns the state of an IRC context + @syntax: + <string> $context.state + <string> $context.state(<irc_context_id:uint>) + @description: + Returns a string describing the state of the specified irc context. + The string will be either "idle","connecting","loggingin" or "connected". + If no irc_context_id is specified then the current irc_context is used. + If the irc_context_id specification is not valid then this function + returns nothing. + @seealso: + $context.serverName, $context.serverIpAddress +*/ + +static bool context_kvs_fnc_state(KviKvsModuleFunctionCall * c) +{ + GET_CONSOLE_FROM_STANDARD_PARAMS + + if(pConsole) + { + switch(pConsole->ircContext()->state()) + { + case KviIrcContext::Idle: + c->returnValue()->setString(QString("idle")); + break; + case KviIrcContext::Connecting: + c->returnValue()->setString(QString("connecting")); + break; + case KviIrcContext::LoggingIn: + c->returnValue()->setString(QString("loggingin")); + break; + case KviIrcContext::Connected: + c->returnValue()->setString(QString("connected")); + break; + default: + c->returnValue()->setString(QString("unknown")); + break; + } + return true; + } + + c->returnValue()->setNothing(); + return true; +} + + +/* + @doc: context.list + @type: + function + @title: + $context.list + @short: + Returns a list of existing IRC contexts + @syntax: + <array> $contex.list + @description: + Returns the array of currently existing IRC context identifiers. + @seealso: + @examples: + Print the names of the currently connected servers + [example] + foreach(%ic,$context.list) + echo "IRC Context" %ic ": " $context.serverName + [/example] +*/ + +static bool context_kvs_fnc_list(KviKvsModuleFunctionCall * c) +{ + KviKvsArray * pArray = new KviKvsArray(); + + KviPtrList<KviWindow> * pWinList = g_pFrame->windowList(); + int idx = 0; + for(KviWindow * pWnd = pWinList->first();pWnd;pWnd = pWinList->next()) + { + if(pWnd->type() == KVI_WINDOW_TYPE_CONSOLE) + { + pArray->set(idx,new KviKvsVariant((kvs_int_t)((KviConsole *)pWnd)->ircContextId())); + idx++; + } + } + + c->returnValue()->setArray(pArray); + return true; +} + +static bool context_module_init(KviModule * m) +{ + KVSM_REGISTER_FUNCTION(m,"serverName",context_kvs_fnc_serverName); + KVSM_REGISTER_FUNCTION(m,"serverIpAddress",context_kvs_fnc_serverIpAddress); + KVSM_REGISTER_FUNCTION(m,"serverPort",context_kvs_fnc_serverPort); + KVSM_REGISTER_FUNCTION(m,"serverPassword",context_kvs_fnc_serverPassword); + KVSM_REGISTER_FUNCTION(m,"state",context_kvs_fnc_state); + KVSM_REGISTER_FUNCTION(m,"list",context_kvs_fnc_list); + + return true; +} + +static bool context_module_cleanup(KviModule *m) +{ + return true; +} + +KVIRC_MODULE( + "context", + "1.0.0", + "Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)", + "Irc Context Related Functions", + context_module_init, + 0, + 0, + context_module_cleanup +) diff --git a/src/modules/window/libkviwindow.cpp b/src/modules/window/libkviwindow.cpp index 49baaa6b4..fee311552 100644 --- a/src/modules/window/libkviwindow.cpp +++ b/src/modules/window/libkviwindow.cpp @@ -687,6 +687,34 @@ static bool window_kvs_fnc_type(KviKvsModuleFunctionCall * c) } /* + @doc: window.context + @type: + function + @title: + $window.context + @short: + Returns the IRC context of a window + @syntax: + $window.context + $window.context(<window_id>) + @description: + Returns the IRC context of the window with the specified <window_id>.[br] + The form with no parameters returns the IRC context of the current window.[br] + If the window with the specified id does not exist, an empty string is returned.[br] + @seealso: +*/ + +static bool window_kvs_fnc_context(KviKvsModuleFunctionCall * c) +{ + GET_KVS_FNC_WINDOW_ID + if(pWnd) + { + c->returnValue()->setInteger(pWnd->console() ? pWnd->console()->ircContextId() : 0); + } + return true; +} + +/* @doc: window.caption @type: function @@ -1450,6 +1478,7 @@ static bool window_module_init(KviModule *m) KVSM_REGISTER_FUNCTION(m,"list",window_kvs_fnc_list); KVSM_REGISTER_FUNCTION(m,"open",window_kvs_fnc_open); KVSM_REGISTER_FUNCTION(m,"inputText",window_kvs_fnc_inputText); + KVSM_REGISTER_FUNCTION(m,"context",window_kvs_fnc_context); KVSM_REGISTER_SIMPLE_COMMAND(m,"close",window_kvs_cmd_close); KVSM_REGISTER_SIMPLE_COMMAND(m,"clearOutput",window_kvs_cmd_clearOutput); |
