diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-04-27 08:58:18 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-04-27 08:58:18 +0000 |
commit | 47f4d5c03a16988eab91de5e26218f8e0d35b8b8 (patch) | |
tree | ed8bb521a4301dfeea2e918f50830819db524762 /plugins/Boltun | |
parent | 68a6aa6db2eb165cfbebebc891a41be2f6917f44 (diff) |
Boltun common project
git-svn-id: http://svn.miranda-ng.org/main/trunk@13194 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Boltun')
22 files changed, 472 insertions, 1056 deletions
diff --git a/plugins/Boltun/Boltun.vcxproj b/plugins/Boltun/Boltun.vcxproj new file mode 100644 index 0000000000..5f7e9678dd --- /dev/null +++ b/plugins/Boltun/Boltun.vcxproj @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{98DF7761-41D7-4C5C-9FFE-E5CCB3997783}</ProjectGuid>
+ <ProjectName>Boltun</ProjectName>
+ </PropertyGroup>
+ <ImportGroup Label="PropertySheets">
+ <Import Project="$(ProjectDir)..\..\build\vc.common\common.props" />
+ </ImportGroup>
+ <ItemGroup>
+ <ClCompile Include="src\Engine\Mind.cpp">
+ <PrecompiledHeaderFile>..\stdafx.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <ClCompile Include="src\Engine\MyCodeCvt.cpp">
+ <PrecompiledHeaderFile>..\stdafx.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <ClCompile Include="src\Engine\TalkEngine.cpp">
+ <PrecompiledHeaderFile>..\stdafx.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <ClCompile Include="src\Engine\UnrecentChooser.cpp">
+ <PrecompiledHeaderFile>..\stdafx.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <ClCompile Include="src\Engine\WordsList.cpp">
+ <PrecompiledHeaderFile>..\stdafx.h</PrecompiledHeaderFile>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="src\Engine\*.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="src\Engine\boltun.mindw" />
+ </ItemGroup>
+ <ItemDefinitionGroup>
+ <ClCompile>
+ <ExceptionHandling>Sync</ExceptionHandling>
+ </ClCompile>
+ </ItemDefinitionGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/Boltun/Boltun.vcxproj.filters b/plugins/Boltun/Boltun.vcxproj.filters new file mode 100644 index 0000000000..5efef18450 --- /dev/null +++ b/plugins/Boltun/Boltun.vcxproj.filters @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(ProjectDir)..\..\build\vc.common\common.filters" />
+ <ItemGroup>
+ <Filter Include="Source Files\Enigne">
+ <UniqueIdentifier>{e94debaf-39e5-4d66-95b0-b02f301c140c}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Header Files\Engine">
+ <UniqueIdentifier>{614d736c-849c-4a07-ba4e-a6c9b895154b}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="src\Engine\*.cpp">
+ <Filter>Source Files\Enigne</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="src\Engine\*.h">
+ <Filter>Header Files\Engine</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="src\Engine\boltun.mindw">
+ <Filter>Source Files\Enigne</Filter>
+ </None>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/Boltun/Boltun_10.vcxproj b/plugins/Boltun/Boltun_10.vcxproj deleted file mode 100644 index 045dbbe0c4..0000000000 --- a/plugins/Boltun/Boltun_10.vcxproj +++ /dev/null @@ -1,222 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{98DF7761-41D7-4C5C-9FFE-E5CCB3997783}</ProjectGuid>
- <ProjectName>Boltun</ProjectName>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Plugins\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Plugins\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Plugins\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Plugins\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
- <IgnoreImportLibrary>true</IgnoreImportLibrary>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>Full</Optimization>
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
- <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
- <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <StringPooling>true</StringPooling>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <WarningLevel>Level3</WarningLevel>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <PrecompiledHeaderFile>boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
- </ResourceCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <SubSystem>Windows</SubSystem>
- <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
- <AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <Optimization>Full</Optimization>
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
- <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
- <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <StringPooling>true</StringPooling>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <WarningLevel>Level3</WarningLevel>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <PrecompiledHeaderFile>boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
- </ResourceCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <SubSystem>Windows</SubSystem>
- <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
- <AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <PrecompiledHeaderFile>boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
- </ResourceCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <SubSystem>Windows</SubSystem>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
- <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <PrecompiledHeaderFile>boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
- </ResourceCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <SubSystem>Windows</SubSystem>
- <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="src\actionQueue.cpp" />
- <ClCompile Include="src\boltun.cpp" />
- <ClCompile Include="src\config.cpp" />
- <ClCompile Include="src\Engine\Mind.cpp">
- <PrecompiledHeaderFile>..\boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\Engine\MyCodeCvt.cpp">
- <PrecompiledHeaderFile>..\boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\Engine\TalkEngine.cpp">
- <PrecompiledHeaderFile>..\boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\Engine\UnrecentChooser.cpp">
- <PrecompiledHeaderFile>..\boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\Engine\WordsList.cpp">
- <PrecompiledHeaderFile>..\boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\stdafx.cpp">
- <PrecompiledHeader>Create</PrecompiledHeader>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="src\actionQueue.h" />
- <ClInclude Include="src\boltun.h" />
- <ClInclude Include="src\config.h" />
- <ClInclude Include="src\resource.h" />
- <ClInclude Include="src\Engine\CriticalSection.h" />
- <ClInclude Include="src\Engine\Mind.h" />
- <ClInclude Include="src\Engine\MyCodeCvt.h" />
- <ClInclude Include="src\Engine\PerContactData.h" />
- <ClInclude Include="src\Engine\TalkEngine.h" />
- <ClInclude Include="src\Engine\UnrecentChooser.h" />
- <ClInclude Include="src\Engine\ValueChooser.h" />
- <ClInclude Include="src\Engine\WordsList.h" />
- <ClInclude Include="src\Version.h" />
- </ItemGroup>
- <ItemGroup>
- <None Include="src\Engine\boltun.mindw" />
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="res\boltun.rc" />
- <ResourceCompile Include="res\Version.rc" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file diff --git a/plugins/Boltun/Boltun_10.vcxproj.filters b/plugins/Boltun/Boltun_10.vcxproj.filters deleted file mode 100644 index 0bee6fadb1..0000000000 --- a/plugins/Boltun/Boltun_10.vcxproj.filters +++ /dev/null @@ -1,106 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{053e819b-1bb3-488b-8dbd-f6b29640c30c}</UniqueIdentifier>
- <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
- </Filter>
- <Filter Include="Source Files\Enigne">
- <UniqueIdentifier>{e94debaf-39e5-4d66-95b0-b02f301c140c}</UniqueIdentifier>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{db6f678c-e69c-4576-819a-360e80ffc84c}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl</Extensions>
- </Filter>
- <Filter Include="Header Files\Engine">
- <UniqueIdentifier>{614d736c-849c-4a07-ba4e-a6c9b895154b}</UniqueIdentifier>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{c04447a2-5567-4425-92b8-a4a1267e7e32}</UniqueIdentifier>
- <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="src\actionQueue.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="src\boltun.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="src\config.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="src\Engine\Mind.cpp">
- <Filter>Source Files\Enigne</Filter>
- </ClCompile>
- <ClCompile Include="src\Engine\MyCodeCvt.cpp">
- <Filter>Source Files\Enigne</Filter>
- </ClCompile>
- <ClCompile Include="src\Engine\TalkEngine.cpp">
- <Filter>Source Files\Enigne</Filter>
- </ClCompile>
- <ClCompile Include="src\Engine\UnrecentChooser.cpp">
- <Filter>Source Files\Enigne</Filter>
- </ClCompile>
- <ClCompile Include="src\Engine\WordsList.cpp">
- <Filter>Source Files\Enigne</Filter>
- </ClCompile>
- <ClCompile Include="src\stdafx.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="src\actionQueue.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="src\boltun.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="src\config.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="src\resource.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="src\Engine\CriticalSection.h">
- <Filter>Header Files\Engine</Filter>
- </ClInclude>
- <ClInclude Include="src\Engine\Mind.h">
- <Filter>Header Files\Engine</Filter>
- </ClInclude>
- <ClInclude Include="src\Engine\MyCodeCvt.h">
- <Filter>Header Files\Engine</Filter>
- </ClInclude>
- <ClInclude Include="src\Engine\PerContactData.h">
- <Filter>Header Files\Engine</Filter>
- </ClInclude>
- <ClInclude Include="src\Engine\TalkEngine.h">
- <Filter>Header Files\Engine</Filter>
- </ClInclude>
- <ClInclude Include="src\Engine\UnrecentChooser.h">
- <Filter>Header Files\Engine</Filter>
- </ClInclude>
- <ClInclude Include="src\Engine\ValueChooser.h">
- <Filter>Header Files\Engine</Filter>
- </ClInclude>
- <ClInclude Include="src\Engine\WordsList.h">
- <Filter>Header Files\Engine</Filter>
- </ClInclude>
- <ClInclude Include="src\Version.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="res\boltun.rc">
- <Filter>Resource Files</Filter>
- </ResourceCompile>
- <ResourceCompile Include="res\Version.rc">
- <Filter>Resource Files</Filter>
- </ResourceCompile>
- </ItemGroup>
- <ItemGroup>
- <None Include="src\Engine\boltun.mindw">
- <Filter>Source Files\Enigne</Filter>
- </None>
- </ItemGroup>
-</Project>
\ No newline at end of file diff --git a/plugins/Boltun/Boltun_12.vcxproj b/plugins/Boltun/Boltun_12.vcxproj deleted file mode 100644 index 8623be8122..0000000000 --- a/plugins/Boltun/Boltun_12.vcxproj +++ /dev/null @@ -1,225 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{98DF7761-41D7-4C5C-9FFE-E5CCB3997783}</ProjectGuid>
- <ProjectName>Boltun</ProjectName>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>v120_xp</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>v120_xp</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <PlatformToolset>v120_xp</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <PlatformToolset>v120_xp</PlatformToolset>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Plugins\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Plugins\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Plugins\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Plugins\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
- <IgnoreImportLibrary>true</IgnoreImportLibrary>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>Full</Optimization>
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
- <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
- <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <StringPooling>true</StringPooling>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <WarningLevel>Level3</WarningLevel>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <PrecompiledHeaderFile>boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
- </ResourceCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <SubSystem>Windows</SubSystem>
- <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin12\lib</AdditionalLibraryDirectories>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <Optimization>Full</Optimization>
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
- <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
- <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <StringPooling>true</StringPooling>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <WarningLevel>Level3</WarningLevel>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <PrecompiledHeaderFile>boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
- </ResourceCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <SubSystem>Windows</SubSystem>
- <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin12\lib</AdditionalLibraryDirectories>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <PrecompiledHeaderFile>boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
- </ResourceCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <SubSystem>Windows</SubSystem>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
- <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin12\lib</AdditionalLibraryDirectories>
- <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <PrecompiledHeaderFile>boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
- </ResourceCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <SubSystem>Windows</SubSystem>
- <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin12\lib</AdditionalLibraryDirectories>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="src\actionQueue.cpp" />
- <ClCompile Include="src\boltun.cpp" />
- <ClCompile Include="src\config.cpp" />
- <ClCompile Include="src\Engine\Mind.cpp">
- <PrecompiledHeaderFile>..\boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\Engine\MyCodeCvt.cpp">
- <PrecompiledHeaderFile>..\boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\Engine\TalkEngine.cpp">
- <PrecompiledHeaderFile>..\boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\Engine\UnrecentChooser.cpp">
- <PrecompiledHeaderFile>..\boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\Engine\WordsList.cpp">
- <PrecompiledHeaderFile>..\boltun.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\stdafx.cpp">
- <PrecompiledHeader>Create</PrecompiledHeader>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="src\actionQueue.h" />
- <ClInclude Include="src\boltun.h" />
- <ClInclude Include="src\config.h" />
- <ClInclude Include="src\resource.h" />
- <ClInclude Include="src\Engine\CriticalSection.h" />
- <ClInclude Include="src\Engine\Mind.h" />
- <ClInclude Include="src\Engine\MyCodeCvt.h" />
- <ClInclude Include="src\Engine\PerContactData.h" />
- <ClInclude Include="src\Engine\TalkEngine.h" />
- <ClInclude Include="src\Engine\UnrecentChooser.h" />
- <ClInclude Include="src\Engine\ValueChooser.h" />
- <ClInclude Include="src\Engine\WordsList.h" />
- <ClInclude Include="src\Version.h" />
- </ItemGroup>
- <ItemGroup>
- <None Include="src\Engine\boltun.mindw" />
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="res\boltun.rc" />
- <ResourceCompile Include="res\Version.rc" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file diff --git a/plugins/Boltun/Boltun_12.vcxproj.filters b/plugins/Boltun/Boltun_12.vcxproj.filters deleted file mode 100644 index 0bee6fadb1..0000000000 --- a/plugins/Boltun/Boltun_12.vcxproj.filters +++ /dev/null @@ -1,106 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{053e819b-1bb3-488b-8dbd-f6b29640c30c}</UniqueIdentifier>
- <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
- </Filter>
- <Filter Include="Source Files\Enigne">
- <UniqueIdentifier>{e94debaf-39e5-4d66-95b0-b02f301c140c}</UniqueIdentifier>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{db6f678c-e69c-4576-819a-360e80ffc84c}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl</Extensions>
- </Filter>
- <Filter Include="Header Files\Engine">
- <UniqueIdentifier>{614d736c-849c-4a07-ba4e-a6c9b895154b}</UniqueIdentifier>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{c04447a2-5567-4425-92b8-a4a1267e7e32}</UniqueIdentifier>
- <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="src\actionQueue.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="src\boltun.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="src\config.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="src\Engine\Mind.cpp">
- <Filter>Source Files\Enigne</Filter>
- </ClCompile>
- <ClCompile Include="src\Engine\MyCodeCvt.cpp">
- <Filter>Source Files\Enigne</Filter>
- </ClCompile>
- <ClCompile Include="src\Engine\TalkEngine.cpp">
- <Filter>Source Files\Enigne</Filter>
- </ClCompile>
- <ClCompile Include="src\Engine\UnrecentChooser.cpp">
- <Filter>Source Files\Enigne</Filter>
- </ClCompile>
- <ClCompile Include="src\Engine\WordsList.cpp">
- <Filter>Source Files\Enigne</Filter>
- </ClCompile>
- <ClCompile Include="src\stdafx.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="src\actionQueue.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="src\boltun.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="src\config.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="src\resource.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="src\Engine\CriticalSection.h">
- <Filter>Header Files\Engine</Filter>
- </ClInclude>
- <ClInclude Include="src\Engine\Mind.h">
- <Filter>Header Files\Engine</Filter>
- </ClInclude>
- <ClInclude Include="src\Engine\MyCodeCvt.h">
- <Filter>Header Files\Engine</Filter>
- </ClInclude>
- <ClInclude Include="src\Engine\PerContactData.h">
- <Filter>Header Files\Engine</Filter>
- </ClInclude>
- <ClInclude Include="src\Engine\TalkEngine.h">
- <Filter>Header Files\Engine</Filter>
- </ClInclude>
- <ClInclude Include="src\Engine\UnrecentChooser.h">
- <Filter>Header Files\Engine</Filter>
- </ClInclude>
- <ClInclude Include="src\Engine\ValueChooser.h">
- <Filter>Header Files\Engine</Filter>
- </ClInclude>
- <ClInclude Include="src\Engine\WordsList.h">
- <Filter>Header Files\Engine</Filter>
- </ClInclude>
- <ClInclude Include="src\Version.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="res\boltun.rc">
- <Filter>Resource Files</Filter>
- </ResourceCompile>
- <ResourceCompile Include="res\Version.rc">
- <Filter>Resource Files</Filter>
- </ResourceCompile>
- </ItemGroup>
- <ItemGroup>
- <None Include="src\Engine\boltun.mindw">
- <Filter>Source Files\Enigne</Filter>
- </None>
- </ItemGroup>
-</Project>
\ No newline at end of file diff --git a/plugins/Boltun/src/Engine/Mind.cpp b/plugins/Boltun/src/Engine/Mind.cpp index 1067711bdf..ec6c58528b 100644 --- a/plugins/Boltun/src/Engine/Mind.cpp +++ b/plugins/Boltun/src/Engine/Mind.cpp @@ -18,18 +18,18 @@ //
//***********************************************************
-#include "..\boltun.h"
+#include "..\stdafx.h"
using namespace std;
-typedef vector<tstring> string_vec;
-typedef multimap<tstring,tstring> string_mmap;
+typedef vector<tstring> string_vec;
+typedef multimap<tstring, tstring> string_mmap;
Mind::Mind()
{
data = new MindData();
data->referenceCount = 1;
- data->maxSmileLen = 0;
+ data->maxSmileLen = 0;
}
Mind::~Mind()
@@ -103,7 +103,7 @@ void Mind::Load(tstring filename) file.open(filename.c_str(), ios_base::in | ios_base::binary);
tstring s1, st;
- TCHAR *c, *co;
+ TCHAR *c, *co = NULL;
size_t count;
int error = 0;
int line = 1;
@@ -133,7 +133,7 @@ void Mind::Load(tstring filename) format(st);
count = st.length();
- c = co = new TCHAR[count+1];
+ c = co = new TCHAR[count + 1];
_tcscpy(c, st.c_str());
size_t pos = 0;
while (pos < count && _istspace(*c))
@@ -213,41 +213,41 @@ void Mind::Load(tstring filename) ++c;
count -= 2;
c[count] = '\0';
- if (_tcscmp(c,_T("QUESTION")) == 0)
+ if (_tcscmp(c, _T("QUESTION")) == 0)
{
toLowerStr(c);
data->question.insert(s1);
}
else
- if (_tcscmp(c,_T("IGNORED")) == 0)
- {
- toLowerStr(c);
- data->special.insert(s1);
- }
- else
- if (_tcscmp(c,_T("ESCAPE")) == 0)
- {
- data->escape.push_back(s1);
- }
- else
- if (_tcscmp(c,_T("FAILURE")) == 0)
- {
- data->failure.push_back(s1);
- }
- else
- if (_tcscmp(c,_T("REPEAT")) == 0)
- {
- data->repeats.push_back(s1);
- }
- else
- {
- if (_tcscmp(c,_T("INITIAL")) != 0)
- throw error;
- data->initial.push_back(s1);
- }
+ if (_tcscmp(c, _T("IGNORED")) == 0)
+ {
+ toLowerStr(c);
+ data->special.insert(s1);
+ }
+ else
+ if (_tcscmp(c, _T("ESCAPE")) == 0)
+ {
+ data->escape.push_back(s1);
+ }
+ else
+ if (_tcscmp(c, _T("FAILURE")) == 0)
+ {
+ data->failure.push_back(s1);
+ }
+ else
+ if (_tcscmp(c, _T("REPEAT")) == 0)
+ {
+ data->repeats.push_back(s1);
+ }
+ else
+ {
+ if (_tcscmp(c, _T("INITIAL")) != 0)
+ throw error;
+ data->initial.push_back(s1);
+ }
break;
case '@':
- {
+ {
if (file.eof())
throw error;
getline(file, s1);
@@ -267,8 +267,8 @@ void Mind::Load(tstring filename) data->raliases.insert(make_pair(sc, strs));
for (vector<tstring>::const_iterator it = strs.begin(); it != strs.end(); ++it)
data->aliases.insert(make_pair(*it, sc));
- }
- break;
+ }
+ break;
default:
if (file.eof())
throw error;
@@ -296,7 +296,7 @@ void Mind::Load(tstring filename) }
delete co;
}
- catch(...)
+ catch (...)
{
throw CorruptedMind(line);
delete co;
@@ -375,7 +375,7 @@ void Mind::Save(tstring filename) const file << _T(" <REPEAT>") << _T('\r') << endl;
file << (*it) << _T('\r') << endl;
}
- for (map<tstring,vector<tstring>>::const_iterator it = data->raliases.begin(); it != data->raliases.end(); ++it)
+ for (map<tstring, vector<tstring>>::const_iterator it = data->raliases.begin(); it != data->raliases.end(); ++it)
{
tstring s;
const vector<tstring>& v = (*it).second;
@@ -408,7 +408,7 @@ void Mind::LoadSmiles(tstring filename) {
getline(file, s);
if (s.length() > l)
- l = (int)s.length();
+ l = (int)s.length();
data->smiles.insert(s);
}
data->maxSmileLen = l;
@@ -427,7 +427,7 @@ void Mind::LoadSmiles(void *smiles, size_t size) lend++;
tstring s(buf, lend - buf);
if ((unsigned)(lend - buf) > l)
- l = (int)s.length();
+ l = (int)s.length();
data->smiles.insert(s);
if (lend == end)
break;
diff --git a/plugins/Boltun/src/Engine/Mind.h b/plugins/Boltun/src/Engine/Mind.h index 2b1e6a20c5..d11eb6cd78 100644 --- a/plugins/Boltun/src/Engine/Mind.h +++ b/plugins/Boltun/src/Engine/Mind.h @@ -37,7 +37,7 @@ typedef struct std::vector<std::tstring> escape;
std::vector<std::tstring> failure;
std::vector<std::tstring> repeats;
- unsigned int maxSmileLen;
+ unsigned int maxSmileLen;
std::set<std::tstring> smiles;
std::multimap<WordsList, std::tstring> keywords;
std::multimap<WordsList, std::tstring> qkeywords;
@@ -55,7 +55,7 @@ class Mind {
private:
MindData *data;
- bool fileTypeMark;
+ bool fileTypeMark;
std::vector<std::tstring> Parse(std::tstring s);
public:
diff --git a/plugins/Boltun/src/Engine/MyCodeCvt.cpp b/plugins/Boltun/src/Engine/MyCodeCvt.cpp index e34575f811..39a4d064b5 100644 --- a/plugins/Boltun/src/Engine/MyCodeCvt.cpp +++ b/plugins/Boltun/src/Engine/MyCodeCvt.cpp @@ -18,47 +18,47 @@ //
//***********************************************************
-#include "..\boltun.h"
+#include "..\stdafx.h"
using namespace std;
MyCodeCvt::MyCodeCvt(size_t _R)
- : MyCodeCvtBase(_R)
-{
+ : MyCodeCvtBase(_R)
+{
}
-MyCodeCvt::result MyCodeCvt::do_in(_St& _State ,
- const _To* _F1, const _To* _L1, const _To*& _Mid1,
- _E* F2, _E* _L2, _E*& _Mid2) const
+MyCodeCvt::result MyCodeCvt::do_in(_St&,
+ const _To*, const _To*, const _To*&,
+ _E*, _E*, _E*&) const
{
return noconv;
}
-
+
#ifdef MSVC
MyCodeCvt::result MyCodeCvt::do_out(_St& _State,
- const _E* _F1, const _E* _L1, const _E*& _Mid1,
- _To* F2, _E* _L2, _To*& _Mid2) const
+ const _E* _F1, const _E* _L1, const _E*& _Mid1,
+ _To* F2, _E* _L2, _To*& _Mid2) const
#else
-MyCodeCvt::result MyCodeCvt::do_out(_St& _State,
- const _E* _F1, const _E* _L1, const _E*& _Mid1,
- _To* F2, _To* _L2, _To*& _Mid2) const
+MyCodeCvt::result MyCodeCvt::do_out(_St&,
+ const _E*, const _E*, const _E*&,
+ _To*, _To*, _To*&) const
#endif
{
return noconv;
}
-MyCodeCvt::result MyCodeCvt::do_unshift( _St& _State,
- _To* _F2, _To* _L2, _To*& _Mid2) const
+MyCodeCvt::result MyCodeCvt::do_unshift(_St&,
+ _To*, _To*, _To*&) const
{
return noconv;
}
#ifdef MSVC
int MyCodeCvt::do_length(_St& _State, const _To* _F1,
- const _To* _L1, size_t _N2) const _THROW0()
+ const _To* _L1, size_t _N2) const _THROW0()
#else
-int MyCodeCvt::do_length(const _St& _State, const _To* _F1,
- const _To* _L1, size_t _N2) const _THROW0()
+int MyCodeCvt::do_length(const _St&, const _To* _F1,
+ const _To* _L1, size_t _N2) const _THROW0()
#endif
{
diff --git a/plugins/Boltun/src/Engine/MyCodeCvt.h b/plugins/Boltun/src/Engine/MyCodeCvt.h index 40ca093795..df78cbad1b 100644 --- a/plugins/Boltun/src/Engine/MyCodeCvt.h +++ b/plugins/Boltun/src/Engine/MyCodeCvt.h @@ -27,19 +27,19 @@ class MyCodeCvt : public MyCodeCvtBase
{
public:
- typedef wchar_t _E;
- typedef char _To;
- typedef std::mbstate_t _St;
- explicit MyCodeCvt( size_t _R=0 );
+ typedef wchar_t _E;
+ typedef char _To;
+ typedef std::mbstate_t _St;
+ explicit MyCodeCvt(size_t _R = 0);
protected:
- virtual result do_in(_St& _State, const _To* _F1, const _To* _L1, const _To*& _Mid1,
- _E* F2 , _E* _L2 , _E*& _Mid2) const;
+ virtual result do_in(_St& _State, const _To* _F1, const _To* _L1, const _To*& _Mid1,
+ _E* F2, _E* _L2, _E*& _Mid2) const;
#ifdef MSVC
virtual result do_out(_St& _State, const _E* _F1, const _E* _L1, const _E*& _Mid1,
- _To* F2, _E* _L2 , _To*& _Mid2) const;
+ _To* F2, _E* _L2, _To*& _Mid2) const;
#else
virtual result do_out(_St& _State, const _E* _F1, const _E* _L1, const _E*& _Mid1,
- _To* F2, _To* _L2 , _To*& _Mid2) const;
+ _To* F2, _To* _L2, _To*& _Mid2) const;
#endif
virtual result do_unshift(_St& _State, _To* _F2, _To* _L2, _To*& _Mid2) const;
#ifdef MSVC
@@ -48,8 +48,8 @@ protected: virtual int do_length(const _St& _State, const _To* _F1, const _To* _L1, size_t _N2) const _THROW0();
#endif
virtual bool do_always_noconv() const _THROW0();
- virtual int do_max_length() const _THROW0();
- virtual int do_encoding() const _THROW0();
-} ;
+ virtual int do_max_length() const _THROW0();
+ virtual int do_encoding() const _THROW0();
+};
#endif /* MYCODECVT_H */
\ No newline at end of file diff --git a/plugins/Boltun/src/Engine/PerContactData.h b/plugins/Boltun/src/Engine/PerContactData.h index d130a03838..e81192053f 100644 --- a/plugins/Boltun/src/Engine/PerContactData.h +++ b/plugins/Boltun/src/Engine/PerContactData.h @@ -41,7 +41,7 @@ class PerContactData }
inline InternalData()
- :data(NULL)
+ : data(NULL)
{
assert(false);
}
@@ -133,12 +133,12 @@ void PerContactData<Source, Data, ContactHandle>::CleanupData() mapLock.Enter();
time_t now;
time(&now);
- for (mapIt it = datas.begin(); it != datas.end(); )
+ for (mapIt it = datas.begin(); it != datas.end();)
{
if ((*it).second->time) //it's being in use
{
int diff = (int)difftime(now, (*it).second->time);
- if (diff >= 30*60) //half of an hour
+ if (diff >= 30 * 60) //half of an hour
{
mapIt tmp = it;
it++;
@@ -160,7 +160,7 @@ void PerContactData<Source, Data, ContactHandle>::CleanupData() }
template <class Source, class Data, class ContactHandle>
-VOID CALLBACK RunTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
+VOID CALLBACK RunTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
{
PerContactData<Source, Data, ContactHandle>* val = (PerContactData<Source, Data, ContactHandle>*)perContactDataObjects[idEvent];
val->CleanupData();
diff --git a/plugins/Boltun/src/Engine/TalkEngine.cpp b/plugins/Boltun/src/Engine/TalkEngine.cpp index 3fe283c64a..0391c11112 100644 --- a/plugins/Boltun/src/Engine/TalkEngine.cpp +++ b/plugins/Boltun/src/Engine/TalkEngine.cpp @@ -18,7 +18,7 @@ //
//***********************************************************
-#include "..\boltun.h"
+#include "..\stdafx.h"
#ifdef _DEBUG
@@ -61,7 +61,7 @@ void TalkBot::UpdateStartChar(tstring& str) TCHAR ncl = (TCHAR)CharLower((LPTSTR)(void*)(long)str[i + 1]);
TCHAR ncu = (TCHAR)CharUpper((LPTSTR)(void*)(long)str[i + 1]);
if (ncl != ncu && str[i + 1] == ncu)
- break;
+ break;
}
if (cl != cu)
{
@@ -73,7 +73,7 @@ void TalkBot::UpdateStartChar(tstring& str) }
TalkBot::TalkBot(const Mind& goodMind)
- :mind(goodMind), beSilent(false), makeLowercase(false),
+ :mind(goodMind), beSilent(false), makeLowercase(false),
understandAlways(false)
{
contactDatas = new PerContactData<Mind, ContactData, MCONTACT>(mind);
@@ -104,7 +104,7 @@ tstring TalkBot::ReplaceAliases(const tstring &message) {
unsigned max = (int)(sentence.length() - i);
if (max > mind.GetData()->maxSmileLen)
- max = mind.GetData()->maxSmileLen;
+ max = mind.GetData()->maxSmileLen;
for (unsigned j = max; j > 0; j--)
{
tstring item = sentence.substr(i, j);
@@ -116,7 +116,7 @@ tstring TalkBot::ReplaceAliases(const tstring &message) }
}
}
- len = (int)sentence.length();
+ len = (int)sentence.length();
bool hadQuestionSigns = false;
int it = 0;
while (it != len)
@@ -127,7 +127,7 @@ tstring TalkBot::ReplaceAliases(const tstring &message) hadQuestionSigns = true;
map<int, tstring>::iterator smit;
if (sentence[it] == '\1')
- {
+ {
smit = sm.find(it);
result.append((*smit).second);
}
@@ -162,7 +162,7 @@ tstring TalkBot::ReplaceAliases(const tstring &message) tstring TalkBot::AllReplies(const tstring &incomingMessage, ContactData *contactData, Level &maxValue, std::multimap<Level, tstring> &mm)
{
tstring res;
- //Part 1
+ //Part 1
if (FindExact(contactData, incomingMessage, mind.GetData()->widelyUsed, res)) //widelyUsed
{
return res;
@@ -222,16 +222,16 @@ tstring TalkBot::AllReplies(const tstring &incomingMessage, ContactData *contact if (maxValue > LOOKSLIKE)
maxValue = LOOKSLIKE;
}
-/* if (ures != _T(""))
- {
-#ifdef DEBUG_PREFIXES
- mm.insert(make_pair(LOOKSLIKE2, _T("(keywords_unstrict) ")+ures));
-#else
- mm.insert(make_pair(LOOKSLIKE2, ures));
-#endif
- if (maxValue > LOOKSLIKE2)
+ /* if (ures != _T(""))
+ {
+ #ifdef DEBUG_PREFIXES
+ mm.insert(make_pair(LOOKSLIKE2, _T("(keywords_unstrict) ")+ures));
+ #else
+ mm.insert(make_pair(LOOKSLIKE2, ures));
+ #endif
+ if (maxValue > LOOKSLIKE2)
maxValue = LOOKSLIKE2;
- }*/
+ }*/
//Part 9
if (FindByOthers(contactData, otherwords, res, isQuestion)) //specialEscapes
{
@@ -274,14 +274,14 @@ tstring TalkBot::AllReplies(const tstring &incomingMessage, ContactData *contact TalkBot::MessageInfo* TalkBot::Reply(MCONTACT contact, tstring incomingMessage, bool saveChoice)
{
- TCHAR* str = new TCHAR[incomingMessage.length()+1];
+ TCHAR* str = new TCHAR[incomingMessage.length() + 1];
_tcscpy(str, incomingMessage.c_str());
CharLower(str);
incomingMessage = str;
- delete [] str;
+ delete[] str;
ContactData *contactData = contactDatas->GetData(contact);
- if (incomingMessage == contactData->lastMessage && GetTickCount() < contactData->lastMessageTime + 30*60*1000)
+ if (incomingMessage == contactData->lastMessage && GetTickCount() < contactData->lastMessageTime + 30 * 60 * 1000)
{
MessageInfo *info;
//only 2-3 repeats
@@ -400,7 +400,7 @@ void TalkBot::SplitSectences(const tstring &incomingMessage, vector<tstring>& ve {
//FIXME: (THINK ABOUT IT:-))these chars not always mark the end of sentence.
const TCHAR symbols[] = _T(".?!");
- int it = 0, len = (int)incomingMessage.length();
+ int it = 0, len = (int)incomingMessage.length();
while (it != len)
{
while (it != len && _istspace(incomingMessage[it]))
@@ -411,9 +411,9 @@ void TalkBot::SplitSectences(const tstring &incomingMessage, vector<tstring>& ve if (_tcschr(symbols, incomingMessage[it++]))
{
//Test for a :-! smile
- if (it > 2 && incomingMessage[it-1] == _T('!')
- && incomingMessage[it-2] == _T('-')
- && incomingMessage[it-3] == _T(':'))
+ if (it > 2 && incomingMessage[it - 1] == _T('!')
+ && incomingMessage[it - 2] == _T('-')
+ && incomingMessage[it - 3] == _T(':'))
continue;
while (it != len && _tcschr(symbols, incomingMessage[it]))
it++;
@@ -427,14 +427,14 @@ void TalkBot::SplitSectences(const tstring &incomingMessage, vector<tstring>& ve #ifdef _DEBUG
tstring LevelToStr(TalkBot::Level target)
{
- tstring lev;
+ tstring lev;
switch (target)
{
- case TalkBot::BEST: lev = _T("BEST(0)"); break;
- case TalkBot::LOOKSLIKE: lev = _T("LOOKSLIKE(1)"); break;
- case TalkBot::BAD: lev = _T("BAD(2)"); break;
- case TalkBot::FAIL: lev = _T("FAIL(3)"); break;
- case TalkBot::NOTHING: lev = _T("NOTHING(4)"); break;
+ case TalkBot::BEST: lev = _T("BEST(0)"); break;
+ case TalkBot::LOOKSLIKE: lev = _T("LOOKSLIKE(1)"); break;
+ case TalkBot::BAD: lev = _T("BAD(2)"); break;
+ case TalkBot::FAIL: lev = _T("FAIL(3)"); break;
+ case TalkBot::NOTHING: lev = _T("NOTHING(4)"); break;
}
return lev;
}
@@ -451,14 +451,8 @@ tstring TalkBot::ChooseResult(ContactData *contactData, Level maxValue, const mu if (maxValue == NOTHING)
return _T("");
Level target = maxValue;
- int num = (int)mm.count(target);
-/* if (!num)
- {
- target = maxValue;
- num = mm.count(target);
- }*/
typedef multimap<Level, tstring>::const_iterator lt_cit;
- pair<lt_cit,lt_cit> range = mm.equal_range(target);
+ pair<lt_cit, lt_cit> range = mm.equal_range(target);
for (lt_cit it = range.first; it != range.second; ++it)
contactData->chooser.AddChoice((*it).second);
#ifdef DEBUG_SHOW_LEVEL
@@ -474,16 +468,16 @@ void TalkBot::FindByKeywords(ContactData *contactData, const vector<tstring> &ke {
if (keywords.size() == 0)
return;
- const multimap<WordsList, tstring> &keys = isQuestion ? mind.GetData()->qkeywords :
+ const multimap<WordsList, tstring> &keys = isQuestion ? mind.GetData()->qkeywords :
mind.GetData()->keywords;
for (multimap<WordsList, tstring>::const_iterator it = keys.begin(); it != keys.end(); ++it)
{
float prio;
if ((*it).first.MatchesAll(keywords/*, strict*/, prio))
#ifdef DEBUG_SHOW_SOLUTION_REASON
- contactData->chooser.AddChoice((tstring)(*it).first + _T(": - ") + (*it).second, prio);
+ contactData->chooser.AddChoice((tstring)(*it).first + _T(": - ") + (*it).second, prio);
#else
- contactData->chooser.AddChoice((*it).second, prio);
+ contactData->chooser.AddChoice((*it).second, prio);
#endif
}
res = contactData->chooser.Choose();
@@ -492,9 +486,9 @@ void TalkBot::FindByKeywords(ContactData *contactData, const vector<tstring> &ke bool TalkBot::FindByOthers(ContactData *contactData, const vector<tstring> &otherwords, tstring& res, bool isQuestion)
{
//vector<tstring> results;
- const multimap<WordsList, tstring> &specs = isQuestion ? mind.GetData()->qspecialEscapes :
+ const multimap<WordsList, tstring> &specs = isQuestion ? mind.GetData()->qspecialEscapes :
mind.GetData()->specialEscapes;
- for (multimap<WordsList, tstring>::const_iterator it = specs.begin();
+ for (multimap<WordsList, tstring>::const_iterator it = specs.begin();
it != specs.end(); ++it)
if ((*it).first.MatchesAny(otherwords))
{
@@ -527,7 +521,7 @@ void TalkBot::SplitAndSortWords(tstring sentence, vector<tstring>& keywords, {
unsigned max = (int)(sentence.length() - i);
if (max > mind.GetData()->maxSmileLen)
- max = mind.GetData()->maxSmileLen;
+ max = mind.GetData()->maxSmileLen;
for (unsigned j = max; j > 0; j--)
{
tstring item = sentence.substr(i, j);
@@ -540,7 +534,7 @@ void TalkBot::SplitAndSortWords(tstring sentence, vector<tstring>& keywords, }
}
}
- len = (int)sentence.length();
+ len = (int)sentence.length();
bool hadQuestionSigns = false;
int it = 0;
while (it != len)
@@ -556,7 +550,7 @@ void TalkBot::SplitAndSortWords(tstring sentence, vector<tstring>& keywords, }
if (it == len)
break;
- hadQuestionSigns = false;
+ hadQuestionSigns = false;
int start = it;
while (true)
{
diff --git a/plugins/Boltun/src/Engine/TalkEngine.h b/plugins/Boltun/src/Engine/TalkEngine.h index 423d6a2666..6f95541941 100644 --- a/plugins/Boltun/src/Engine/TalkEngine.h +++ b/plugins/Boltun/src/Engine/TalkEngine.h @@ -31,18 +31,18 @@ class TalkBot public:
struct MessageInfo
{
- private:
- std::tstring Question;
- MessageInfo(std::tstring q, std::tstring a)
- :Question(q), Answer(a)
- {
- }
- public:
- std::tstring Answer;
- MessageInfo(std::tstring q)
- :Question(q)
- {
- }
+ private:
+ std::tstring Question;
+ MessageInfo(std::tstring q, std::tstring a)
+ :Question(q), Answer(a)
+ {
+ }
+ public:
+ std::tstring Answer;
+ MessageInfo(std::tstring q)
+ :Question(q)
+ {
+ }
friend class TalkBot;
};
private:
@@ -50,7 +50,7 @@ private: {
BEST, LOOKSLIKE/*, LOOKSLIKE2*/, BAD, FAIL, NOTHING
} Level;
- friend std::tstring LevelToStr(TalkBot::Level target);
+ friend std::tstring LevelToStr(TalkBot::Level target);
struct ContactData
{
@@ -80,7 +80,7 @@ private: bool makeLowercase;
bool understandAlways;
void UpdateStartChar(std::tstring &str);
- typedef std::multimap<std::tstring, std::tstring>::const_iterator mm_cit;
+ typedef std::multimap<std::tstring, std::tstring>::const_iterator mm_cit;
bool FindExact(ContactData *contactData, const std::tstring &incomingMessage, const std::multimap<std::tstring, std::tstring> &map, std::tstring &res);
bool FindAny(ValueChooser<> &ch, std::tstring &res);
void FindByKeywords(ContactData *contactData, const std::vector<std::tstring> &keywords, std::tstring &res/*, std::tstring& ures*/, bool isQuestion);
diff --git a/plugins/Boltun/src/Engine/UnrecentChooser.cpp b/plugins/Boltun/src/Engine/UnrecentChooser.cpp index 5a3d4f7fd1..77e1a71d36 100644 --- a/plugins/Boltun/src/Engine/UnrecentChooser.cpp +++ b/plugins/Boltun/src/Engine/UnrecentChooser.cpp @@ -18,7 +18,7 @@ //
//***********************************************************
-#include "..\boltun.h"
+#include "..\stdafx.h"
using namespace std;
diff --git a/plugins/Boltun/src/Engine/ValueChooser.h b/plugins/Boltun/src/Engine/ValueChooser.h index e3f9f3c0b9..10256a5b70 100644 --- a/plugins/Boltun/src/Engine/ValueChooser.h +++ b/plugins/Boltun/src/Engine/ValueChooser.h @@ -37,12 +37,12 @@ public: numbers = NULL;
UpdateLength();
}
-
+
~ValueChooser()
{
delete numbers;
}
-
+
void UpdateLength()
{
delete numbers; //normal if numbers == NULL
diff --git a/plugins/Boltun/src/Engine/WordsList.cpp b/plugins/Boltun/src/Engine/WordsList.cpp index d9ba65aa90..439ee229dd 100644 --- a/plugins/Boltun/src/Engine/WordsList.cpp +++ b/plugins/Boltun/src/Engine/WordsList.cpp @@ -18,7 +18,7 @@ //
//***********************************************************
-#include "..\boltun.h"
+#include "..\stdafx.h"
using namespace std;
@@ -31,7 +31,7 @@ WordsList::operator tstring() const {
tstring res;
//if (unstrict)
- // res = _T("~");
+ // res = _T("~");
set<tstring>::const_iterator it = words.begin();
if (!words.empty())
while (true)
@@ -58,11 +58,11 @@ void WordsList::Parse(tstring s/*, bool allowUnstrict*/) isQuestion = false;
/*if (allowUnstrict && s.length() && s[0] == _T('~'))
{
- s = s.substr(1, s.npos);
- unstrict = true;
+ s = s.substr(1, s.npos);
+ unstrict = true;
}
else
- unstrict = false;*/
+ unstrict = false;*/
int len = (int)s.length() - 1;
while (len != -1 && _istspace(s[len]))
len--;
@@ -94,15 +94,15 @@ bool WordsList::MatchesAll(const vector<tstring>& s/*, bool& WasStrict*/, float& //WasStrict = true;
for (vector<tstring>::const_iterator it = s.begin(); it != s.end(); ++it)
{
-/* if (words.find(*it) == words.end())
- if (unstrict)
- {
- WasStrict = false;
- continue;
- }
- else
- return false;
- temp.insert((*it));*/
+ /* if (words.find(*it) == words.end())
+ if (unstrict)
+ {
+ WasStrict = false;
+ continue;
+ }
+ else
+ return false;
+ temp.insert((*it));*/
if (words.find(*it) != words.end())
temp.insert((*it));
}
@@ -137,10 +137,10 @@ vector<tstring> WordsList::DoesntIncludeAny(const set<tstring>& list) const res.push_back(*it);
return res;
}
-
+
bool WordsList::operator<(const WordsList& value) const
{
- return (tstring)*this < (tstring)value;
+ return (tstring)*this < (tstring)value;
}
bool WordsList::operator!=(const WordsList& value) const
diff --git a/plugins/Boltun/src/actionQueue.cpp b/plugins/Boltun/src/actionQueue.cpp index fa0ebe63b9..8625d3bde0 100644 --- a/plugins/Boltun/src/actionQueue.cpp +++ b/plugins/Boltun/src/actionQueue.cpp @@ -18,7 +18,7 @@ //
//***********************************************************
-#include "boltun.h"
+#include "stdafx.h"
#include "newpluginapi.h"
#include "m_database.h"
@@ -29,7 +29,7 @@ using namespace std; extern TalkBot* bot;
-typedef void (*ActionHandler)(MCONTACT hContact, const TalkBot::MessageInfo *inf);
+typedef void(*ActionHandler)(MCONTACT hContact, const TalkBot::MessageInfo *inf);
typedef struct _QueueElement {
MCONTACT hContact;
@@ -52,7 +52,7 @@ CriticalSection typingContactsLock; void UpdateTimer();
-VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
+VOID CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
{
cs.Enter();
QueueElement q = actionQueue.front();
@@ -67,7 +67,7 @@ void UpdateTimer() if (timerID)
KillTimer(NULL, timerID);
if (actionQueue.size())
- timerID = SetTimer(NULL, 0, actionQueue.front().TimeOffset, TimerProc);
+ timerID = SetTimer(NULL, 0, actionQueue.front().TimeOffset, TimerProc);
else
timerID = 0;
}
@@ -89,8 +89,8 @@ static void TimerAnswer(MCONTACT hContact, const TalkBot::MessageInfo* info) bufsize *= sizeof(TCHAR) + 1;
msg = new char[bufsize];
-
- if (!WideCharToMultiByte(CP_ACP, 0, info->Answer.c_str(), -1, msg, size,
+
+ if (!WideCharToMultiByte(CP_ACP, 0, info->Answer.c_str(), -1, msg, size,
NULL, NULL))
memset(msg, '-', (size - 1)); //In case of fault return "----" in ANSI part
memcpy(msg + size, info->Answer.c_str(), size * 2);
@@ -98,20 +98,20 @@ static void TimerAnswer(MCONTACT hContact, const TalkBot::MessageInfo* info) CallContactService(hContact, PSS_MESSAGE, PREF_TCHAR, (LPARAM)msg);
memset(&ldbei, 0, sizeof(ldbei));
- ldbei.cbSize = sizeof(ldbei);
+ ldbei.cbSize = sizeof(ldbei);
//FIXME: Error may happen
- ldbei.cbBlob = bufsize;
- ldbei.pBlob = (PBYTE)(void*)msg;
+ ldbei.cbBlob = bufsize;
+ ldbei.pBlob = (PBYTE)(void*)msg;
ldbei.eventType = EVENTTYPE_MESSAGE;
- ldbei.flags = DBEF_SENT;
- ldbei.szModule = BOLTUN_NAME;
+ ldbei.flags = DBEF_SENT;
+ ldbei.szModule = BOLTUN_NAME;
ldbei.timestamp = (DWORD)time(NULL);
db_event_add(hContact, &ldbei);
bot->AnswerGiven(hContact, *info);
delete info;
- delete [] msg;
+ delete[] msg;
typingContactsLock.Enter();
typingContacts.erase(hContact);
@@ -120,7 +120,7 @@ static void TimerAnswer(MCONTACT hContact, const TalkBot::MessageInfo* info) static void StartTyping(MCONTACT hContact, const TalkBot::MessageInfo*)
{
- CallService(MS_PROTO_SELFISTYPING, hContact,
+ CallService(MS_PROTO_SELFISTYPING, hContact,
(LPARAM)PROTOTYPE_SELFTYPING_ON);
typingContactsLock.Enter();
typingContacts.insert(hContact);
@@ -140,13 +140,13 @@ void DoAnswer(MCONTACT hContact, const TalkBot::MessageInfo *info, bool sticky = if (Config.PauseRandom)
{
//Let it be up to 4 times longer.
- waitTime = waitTime * (rand() % 300) / 100 + waitTime;
+ waitTime = waitTime * (rand() % 300) / 100 + waitTime;
}
if (waitTime == 0)
waitTime = 50; //it's essential, because otherwise message will be added later
- //then its response, that will cause incorrect ordering of
- //messages in the opened history (reopening will
- //help, but anyway it's no good)
+ //then its response, that will cause incorrect ordering of
+ //messages in the opened history (reopening will
+ //help, but anyway it's no good)
if (NotifyTyping(hContact) && Config.AnswerThinkTime)
{
thinkTime = Config.AnswerThinkTime * 1000;
@@ -154,7 +154,7 @@ void DoAnswer(MCONTACT hContact, const TalkBot::MessageInfo *info, bool sticky = {
//Let it be up to 4 times longer.
thinkTime = thinkTime * (rand() % 300) / 100 + thinkTime;
- }
+ }
}
cs.Enter();
//Check if this contact's timer handler is now waiting for a cs.
@@ -208,7 +208,7 @@ void DoAnswer(MCONTACT hContact, const TalkBot::MessageInfo *info, bool sticky = void AnswerToContact(MCONTACT hContact, const TCHAR* messageToAnswer)
{
- if (Config.TalkWarnContacts && db_get_b(hContact, BOLTUN_KEY,
+ if (Config.TalkWarnContacts && db_get_b(hContact, BOLTUN_KEY,
DB_CONTACT_WARNED, FALSE) == FALSE)
{
DoAnswer(hContact, new TalkBot::MessageInfo((const TCHAR*)Config.WarnText), true);
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index c00713880b..13fbecfee9 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -18,7 +18,7 @@ //
//***********************************************************
-#include "boltun.h"
+#include "stdafx.h"
int hLangpack;
@@ -44,7 +44,7 @@ PLUGININFOEX pluginInfo = { __AUTHORWEB,
UNICODE_AWARE,
// {488C5C84-56DA-434F-96F1-B18900DEF760}
- {0x488c5c84, 0x56da, 0x434f, {0x96, 0xf1, 0xb1, 0x89, 0x0, 0xde, 0xf7, 0x60}}
+ { 0x488c5c84, 0x56da, 0x434f, { 0x96, 0xf1, 0xb1, 0x89, 0x0, 0xde, 0xf7, 0x60 } }
};
static HGENMENU hMenuItemAutoChat, hMenuItemNotToChat, hMenuItemStartChatting;
@@ -72,7 +72,7 @@ TCHAR* GetFullName(const TCHAR* filename) if (!_tcschr(filename, _T(':')))
{
size_t plen = _tcslen(path);
- fullname = new TCHAR[plen+flen+1];
+ fullname = new TCHAR[plen + flen + 1];
fullname[0] = NULL;
_tcscat(fullname, path);
_tcscat(fullname, filename);
@@ -94,7 +94,7 @@ static bool LoadMind(const TCHAR* filename, int &line) {
mind->Load(fullname);
}
- catch(Mind::CorruptedMind c)
+ catch (Mind::CorruptedMind c)
{
line = c.line;
delete mind;
@@ -103,7 +103,7 @@ static bool LoadMind(const TCHAR* filename, int &line) SetCursor(oldCur);
return false;
}
- catch(...)
+ catch (...)
{
delete mind;
if (fullname != filename)
@@ -152,7 +152,7 @@ static bool LoadMind(const TCHAR* filename, int &line) {
mind->LoadSmiles(data, size);
}
- catch(...)
+ catch (...)
{
res = false;
}
@@ -172,10 +172,10 @@ static bool LoadMind(const TCHAR* filename, int &line) /*static bool SaveMind(const TCHAR* filename)
{
- if (!bot)
- return false;
- bot->GetMind().Save(filename);
- return true;
+if (!bot)
+return false;
+bot->GetMind().Save(filename);
+return true;
}*/
static bool BoltunAutoChat(MCONTACT hContact)
@@ -190,16 +190,16 @@ static bool BoltunAutoChat(MCONTACT hContact) if (Config.TalkEveryoneWhileAway)
{
int status = CallService(MS_CLIST_GETSTATUSMODE, 0, 0);
- if (status == ID_STATUS_AWAY ||
- status == ID_STATUS_DND ||
- status == ID_STATUS_NA ||
- status == ID_STATUS_OCCUPIED ||
+ if (status == ID_STATUS_AWAY ||
+ status == ID_STATUS_DND ||
+ status == ID_STATUS_NA ||
+ status == ID_STATUS_OCCUPIED ||
status == ID_STATUS_ONTHEPHONE ||
status == ID_STATUS_OUTTOLUNCH)
return true;
}
- if ((db_get_b(hContact,"CList","NotOnList",0) == 1) &&
+ if ((db_get_b(hContact, "CList", "NotOnList", 0) == 1) &&
Config.TalkWithNotInList)
return true;
@@ -244,7 +244,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDbEvent) return 0;
}
-BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInst = hinstDLL;
return TRUE;
@@ -266,78 +266,78 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR static bool loading = true;
switch (uMsg)
{
- case WM_INITDIALOG:
- loading = true;
- TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_EVERYBODY, Config.TalkWithEverybody ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTINLIST, Config.TalkWithNotInList ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOAWAY, Config.TalkEveryoneWhileAway ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_WARN, Config.TalkWarnContacts ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_MARKREAD, Config.MarkAsRead ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_PAUSEDEPENDS, Config.PauseDepends ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_PAUSERANDOM, Config.PauseRandom ? BST_CHECKED : BST_UNCHECKED);
- SendDlgItemMessage(hwndDlg, IDC_WAITTIME, EM_SETLIMITTEXT, 3, 0);
- SetDlgItemInt(hwndDlg, IDC_WAITTIME, Config.AnswerPauseTime, FALSE);
- SendDlgItemMessage(hwndDlg, IDC_THINKTIME, EM_SETLIMITTEXT, 3, 0);
- SetDlgItemInt(hwndDlg, IDC_THINKTIME, Config.AnswerThinkTime, FALSE);
- SendDlgItemMessage(hwndDlg, IDC_WARNTXT, EM_SETLIMITTEXT, MAX_WARN_TEXT, 0);
- SetDlgItemText(hwndDlg, IDC_WARNTXT, Config.WarnText);
+ case WM_INITDIALOG:
+ loading = true;
+ TranslateDialogDefault(hwndDlg);
+ CheckDlgButton(hwndDlg, IDC_EVERYBODY, Config.TalkWithEverybody ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTINLIST, Config.TalkWithNotInList ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOAWAY, Config.TalkEveryoneWhileAway ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_WARN, Config.TalkWarnContacts ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MARKREAD, Config.MarkAsRead ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_PAUSEDEPENDS, Config.PauseDepends ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_PAUSERANDOM, Config.PauseRandom ? BST_CHECKED : BST_UNCHECKED);
+ SendDlgItemMessage(hwndDlg, IDC_WAITTIME, EM_SETLIMITTEXT, 3, 0);
+ SetDlgItemInt(hwndDlg, IDC_WAITTIME, Config.AnswerPauseTime, FALSE);
+ SendDlgItemMessage(hwndDlg, IDC_THINKTIME, EM_SETLIMITTEXT, 3, 0);
+ SetDlgItemInt(hwndDlg, IDC_THINKTIME, Config.AnswerThinkTime, FALSE);
+ SendDlgItemMessage(hwndDlg, IDC_WARNTXT, EM_SETLIMITTEXT, MAX_WARN_TEXT, 0);
+ SetDlgItemText(hwndDlg, IDC_WARNTXT, Config.WarnText);
+ UpdateEverybodyCheckboxes(hwndDlg);
+ loading = false;
+ return TRUE;
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDC_EVERYBODY && HIWORD(wParam) == BN_CLICKED)
UpdateEverybodyCheckboxes(hwndDlg);
- loading = false;
- return TRUE;
- case WM_COMMAND:
- if (LOWORD(wParam) == IDC_EVERYBODY && HIWORD(wParam) == BN_CLICKED)
- UpdateEverybodyCheckboxes(hwndDlg);
- if (!loading)
- {
- bool notify = true;
- switch (LOWORD(wParam))
- {
- case IDC_WARNTXT:
- case IDC_WAITTIME:
- case IDC_THINKTIME:
- if (HIWORD(wParam) != EN_CHANGE)
- notify = false;
- break;
- }
- if (notify)
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- break;
- case WM_NOTIFY:
+ if (!loading)
{
- NMHDR* nmhdr = (NMHDR*)lParam;
- switch (nmhdr->code)
+ bool notify = true;
+ switch (LOWORD(wParam))
{
- case PSN_APPLY:
- case PSN_KILLACTIVE:
- {
- Config.TalkWithEverybody = IsDlgButtonChecked(hwndDlg, IDC_EVERYBODY) == BST_CHECKED ? TRUE : FALSE;
- Config.TalkWithNotInList = IsDlgButtonChecked(hwndDlg, IDC_NOTINLIST) == BST_CHECKED ? TRUE : FALSE;
- Config.TalkEveryoneWhileAway = IsDlgButtonChecked(hwndDlg, IDC_AUTOAWAY) == BST_CHECKED ? TRUE : FALSE;
- Config.TalkWarnContacts = IsDlgButtonChecked(hwndDlg, IDC_WARN) == BST_CHECKED ? TRUE : FALSE;
- Config.MarkAsRead = IsDlgButtonChecked(hwndDlg, IDC_MARKREAD) == BST_CHECKED ? TRUE : FALSE;
- Config.PauseDepends = IsDlgButtonChecked(hwndDlg, IDC_PAUSEDEPENDS) == BST_CHECKED ? TRUE : FALSE;
- Config.PauseRandom = IsDlgButtonChecked(hwndDlg, IDC_PAUSERANDOM) == BST_CHECKED ? TRUE : FALSE;
- Config.AnswerPauseTime = GetDlgItemInt(hwndDlg, IDC_WAITTIME, &bTranslated, FALSE);
- if (!bTranslated)
- Config.AnswerPauseTime = 2;
- Config.AnswerThinkTime = GetDlgItemInt(hwndDlg, IDC_THINKTIME, &bTranslated, FALSE);
- if (!bTranslated)
- Config.AnswerThinkTime = 4;
- TCHAR c[MAX_WARN_TEXT];
- bTranslated = GetDlgItemText(hwndDlg, IDC_WARNTXT, c, SIZEOF(c));
- if(bTranslated)
- Config.WarnText = c;
- else
- Config.WarnText = TranslateTS(DEFAULT_WARN_TEXT);
- }
- return TRUE;
+ case IDC_WARNTXT:
+ case IDC_WAITTIME:
+ case IDC_THINKTIME:
+ if (HIWORD(wParam) != EN_CHANGE)
+ notify = false;
+ break;
}
- break;
+ if (notify)
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ break;
+ case WM_NOTIFY:
+ {
+ NMHDR* nmhdr = (NMHDR*)lParam;
+ switch (nmhdr->code)
+ {
+ case PSN_APPLY:
+ case PSN_KILLACTIVE:
+ {
+ Config.TalkWithEverybody = IsDlgButtonChecked(hwndDlg, IDC_EVERYBODY) == BST_CHECKED ? TRUE : FALSE;
+ Config.TalkWithNotInList = IsDlgButtonChecked(hwndDlg, IDC_NOTINLIST) == BST_CHECKED ? TRUE : FALSE;
+ Config.TalkEveryoneWhileAway = IsDlgButtonChecked(hwndDlg, IDC_AUTOAWAY) == BST_CHECKED ? TRUE : FALSE;
+ Config.TalkWarnContacts = IsDlgButtonChecked(hwndDlg, IDC_WARN) == BST_CHECKED ? TRUE : FALSE;
+ Config.MarkAsRead = IsDlgButtonChecked(hwndDlg, IDC_MARKREAD) == BST_CHECKED ? TRUE : FALSE;
+ Config.PauseDepends = IsDlgButtonChecked(hwndDlg, IDC_PAUSEDEPENDS) == BST_CHECKED ? TRUE : FALSE;
+ Config.PauseRandom = IsDlgButtonChecked(hwndDlg, IDC_PAUSERANDOM) == BST_CHECKED ? TRUE : FALSE;
+ Config.AnswerPauseTime = GetDlgItemInt(hwndDlg, IDC_WAITTIME, &bTranslated, FALSE);
+ if (!bTranslated)
+ Config.AnswerPauseTime = 2;
+ Config.AnswerThinkTime = GetDlgItemInt(hwndDlg, IDC_THINKTIME, &bTranslated, FALSE);
+ if (!bTranslated)
+ Config.AnswerThinkTime = 4;
+ TCHAR c[MAX_WARN_TEXT];
+ bTranslated = GetDlgItemText(hwndDlg, IDC_WARNTXT, c, SIZEOF(c));
+ if (bTranslated)
+ Config.WarnText = c;
+ else
+ Config.WarnText = TranslateTS(DEFAULT_WARN_TEXT);
+ }
+ return TRUE;
}
break;
}
+ break;
+ }
return 0;
}
@@ -357,126 +357,126 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP static int changeCount = 0;
switch (uMsg)
{
- case WM_INITDIALOG:
- loading = true;
- TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_ENGINE_SILENT, Config.EngineStaySilent ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ENGINE_LOWERCASE, Config.EngineMakeLowerCase ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ENGINE_UNDERSTAND_ALWAYS, Config.EngineUnderstandAlways ? BST_CHECKED : BST_UNCHECKED);
- SetDlgItemText(hwndDlg, IDC_MINDFILE, Config.MindFileName);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BTNSAVE), blInit);
+ case WM_INITDIALOG:
+ loading = true;
+ TranslateDialogDefault(hwndDlg);
+ CheckDlgButton(hwndDlg, IDC_ENGINE_SILENT, Config.EngineStaySilent ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ENGINE_LOWERCASE, Config.EngineMakeLowerCase ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ENGINE_UNDERSTAND_ALWAYS, Config.EngineUnderstandAlways ? BST_CHECKED : BST_UNCHECKED);
+ SetDlgItemText(hwndDlg, IDC_MINDFILE, Config.MindFileName);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BTNSAVE), blInit);
+ UpdateUnderstandAlwaysCheckbox(hwndDlg);
+ loading = false;
+ return TRUE;
+ case WM_COMMAND:
+ param = LOWORD(wParam);
+ if (param == IDC_ENGINE_SILENT && HIWORD(wParam) == BN_CLICKED)
UpdateUnderstandAlwaysCheckbox(hwndDlg);
- loading = false;
- return TRUE;
- case WM_COMMAND:
- param = LOWORD(wParam);
- if (param == IDC_ENGINE_SILENT && HIWORD(wParam) == BN_CLICKED)
- UpdateUnderstandAlwaysCheckbox(hwndDlg);
- OPENFILENAME ofn;
- switch(param)
+ OPENFILENAME ofn;
+ switch (param)
+ {
+ case IDC_BTNPATH:
+ {
+ const size_t fileNameSize = 5000;
+ TCHAR *filename = new TCHAR[fileNameSize];
+ TCHAR *fullname = GetFullName(Config.MindFileName);
+ _tcscpy(filename, fullname);
+ if (fullname != Config.MindFileName)
+ delete[] fullname;
+
+ memset(&ofn, 0, sizeof(ofn));
+ ofn.lStructSize = sizeof(OPENFILENAME);
+ ofn.hwndOwner = GetParent(hwndDlg);
+
+ TCHAR* mind = TranslateTS(MIND_FILE_DESC);
+ TCHAR* anyfile = TranslateTS(ALL_FILES_DESC);
+ size_t l = _tcslen(MIND_DIALOG_FILTER)
+ + _tcslen(mind) + _tcslen(anyfile);
+ TCHAR *filt = new TCHAR[l];
+ mir_sntprintf(filt, l, MIND_DIALOG_FILTER, mind, anyfile);
+ for (size_t i = 0; i < l; i++)
+ if (filt[i] == '\1')
+ filt[i] = '\0';
+ ofn.lpstrFilter = filt;
+
+ ofn.lpstrFile = filename;
+ ofn.nMaxFile = fileNameSize;
+ ofn.Flags = OFN_FILEMUSTEXIST;
+ ofn.lpstrInitialDir = path;
+ if (!GetOpenFileName(&ofn))
{
- case IDC_BTNPATH:
- {
- const size_t fileNameSize = 5000;
- TCHAR *filename = new TCHAR[fileNameSize];
- TCHAR *fullname = GetFullName(Config.MindFileName);
- _tcscpy(filename, fullname);
- if (fullname != Config.MindFileName)
- delete[] fullname;
-
- memset(&ofn, 0, sizeof(ofn));
- ofn.lStructSize = sizeof(OPENFILENAME);
- ofn.hwndOwner = GetParent(hwndDlg);
-
- TCHAR* mind = TranslateTS(MIND_FILE_DESC);
- TCHAR* anyfile = TranslateTS(ALL_FILES_DESC);
- size_t l = _tcslen(MIND_DIALOG_FILTER)
- + _tcslen(mind) + _tcslen(anyfile);
- TCHAR *filt = new TCHAR[l];
- mir_sntprintf(filt, l, MIND_DIALOG_FILTER, mind, anyfile);
- for (size_t i = 0; i < l; i++)
- if (filt[i] == '\1')
- filt[i] = '\0';
- ofn.lpstrFilter = filt;
-
- ofn.lpstrFile = filename;
- ofn.nMaxFile = fileNameSize;
- ofn.Flags = OFN_FILEMUSTEXIST;
- ofn.lpstrInitialDir = path;
- if (!GetOpenFileName(&ofn))
- {
- delete[] filename;
- delete[] filt;
- break;
- }
- delete[] filt;
- TCHAR* origf = filename;
- TCHAR* f = filename;
- TCHAR* p = path;
- while (*p && *f)
- {
- TCHAR p1 = (TCHAR)CharLower((TCHAR*)(long)*p++);
- TCHAR f1 = (TCHAR)CharLower((TCHAR*)(long)*f++);
- if (p1 != f1)
- break;
- }
- if (!*p)
- filename = f;
- Config.MindFileName = filename;
- SetDlgItemText(hwndDlg, IDC_MINDFILE, filename);
- delete[] origf;
- }
- case IDC_BTNRELOAD:
- {
- const TCHAR *c = Config.MindFileName;
- int line;
- bTranslated = blInit = LoadMind(c, line);
- if (!bTranslated)
- {
- TCHAR message[5000];
- mir_sntprintf(message, SIZEOF(message), TranslateTS(FAILED_TO_LOAD_BASE), line, c);
- MessageBox(NULL, message, TranslateTS(BOLTUN_ERROR), MB_ICONERROR|MB_TASKMODAL|MB_OK);
- }
+ delete[] filename;
+ delete[] filt;
+ break;
+ }
+ delete[] filt;
+ TCHAR* origf = filename;
+ TCHAR* f = filename;
+ TCHAR* p = path;
+ while (*p && *f)
+ {
+ TCHAR p1 = (TCHAR)CharLower((TCHAR*)(long)*p++);
+ TCHAR f1 = (TCHAR)CharLower((TCHAR*)(long)*f++);
+ if (p1 != f1)
break;
- }
- default:
- if (!loading)
- {
- if (param == IDC_MINDFILE/* && HIWORD(wParam) != EN_CHANGE*/)
- break;
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
}
- break;
- case WM_NOTIFY:
+ if (!*p)
+ filename = f;
+ Config.MindFileName = filename;
+ SetDlgItemText(hwndDlg, IDC_MINDFILE, filename);
+ delete[] origf;
+ }
+ case IDC_BTNRELOAD:
{
- NMHDR* nmhdr = (NMHDR*)lParam;
- switch (nmhdr->code)
+ const TCHAR *c = Config.MindFileName;
+ int line;
+ bTranslated = blInit = LoadMind(c, line);
+ if (!bTranslated)
{
- case PSN_APPLY:
- case PSN_KILLACTIVE:
- {
- Config.EngineStaySilent = IsDlgButtonChecked(hwndDlg, IDC_ENGINE_SILENT) == BST_CHECKED ? TRUE : FALSE;
- Config.EngineMakeLowerCase = IsDlgButtonChecked(hwndDlg, IDC_ENGINE_LOWERCASE) == BST_CHECKED ? TRUE : FALSE;
- Config.EngineUnderstandAlways = IsDlgButtonChecked(hwndDlg, IDC_ENGINE_UNDERSTAND_ALWAYS) == BST_CHECKED ? TRUE : FALSE;
- UpdateEngine();
- TCHAR c[MAX_MIND_FILE];
- bTranslated = GetDlgItemText(hwndDlg, IDC_MINDFILE, c, SIZEOF(c));
- if (bTranslated)
- Config.MindFileName = c;
- else
- Config.MindFileName = DEFAULT_MIND_FILE;
- }
- return TRUE;
+ TCHAR message[5000];
+ mir_sntprintf(message, SIZEOF(message), TranslateTS(FAILED_TO_LOAD_BASE), line, c);
+ MessageBox(NULL, message, TranslateTS(BOLTUN_ERROR), MB_ICONERROR | MB_TASKMODAL | MB_OK);
}
break;
}
+ default:
+ if (!loading)
+ {
+ if (param == IDC_MINDFILE/* && HIWORD(wParam) != EN_CHANGE*/)
+ break;
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ case WM_NOTIFY:
+ {
+ NMHDR* nmhdr = (NMHDR*)lParam;
+ switch (nmhdr->code)
+ {
+ case PSN_APPLY:
+ case PSN_KILLACTIVE:
+ {
+ Config.EngineStaySilent = IsDlgButtonChecked(hwndDlg, IDC_ENGINE_SILENT) == BST_CHECKED ? TRUE : FALSE;
+ Config.EngineMakeLowerCase = IsDlgButtonChecked(hwndDlg, IDC_ENGINE_LOWERCASE) == BST_CHECKED ? TRUE : FALSE;
+ Config.EngineUnderstandAlways = IsDlgButtonChecked(hwndDlg, IDC_ENGINE_UNDERSTAND_ALWAYS) == BST_CHECKED ? TRUE : FALSE;
+ UpdateEngine();
+ TCHAR c[MAX_MIND_FILE];
+ bTranslated = GetDlgItemText(hwndDlg, IDC_MINDFILE, c, SIZEOF(c));
+ if (bTranslated)
+ Config.MindFileName = c;
+ else
+ Config.MindFileName = DEFAULT_MIND_FILE;
+ }
+ return TRUE;
+ }
break;
}
+ break;
+ }
return 0;
}
-static int MessageOptInit(WPARAM wParam, LPARAM lParam)
+static int MessageOptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 910000000;
@@ -487,7 +487,7 @@ static int MessageOptInit(WPARAM wParam, LPARAM lParam) odp.pszTemplate = MAKEINTRESOURCEA(IDD_MAIN);
odp.pszTab = TAB_GENERAL;
Options_AddPage(wParam, &odp);
-
+
odp.pfnDlgProc = EngineDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_ENGINE);
odp.pszTab = TAB_ENGINE;
@@ -495,7 +495,7 @@ static int MessageOptInit(WPARAM wParam, LPARAM lParam) return 0;
}
-static int ContactClick(WPARAM hContact, LPARAM lParam, BOOL clickNotToChat)
+static int ContactClick(WPARAM hContact, LPARAM, BOOL clickNotToChat)
{
BOOL boltunautochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE);
BOOL boltunnottochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE);
@@ -503,7 +503,7 @@ static int ContactClick(WPARAM hContact, LPARAM lParam, BOOL clickNotToChat) if (clickNotToChat)
{
boltunnottochat = !boltunnottochat;
- if(boltunnottochat)
+ if (boltunnottochat)
{
boltunautochat = FALSE;
}
@@ -511,7 +511,7 @@ static int ContactClick(WPARAM hContact, LPARAM lParam, BOOL clickNotToChat) else
{
boltunautochat = !boltunautochat;
- if(boltunautochat)
+ if (boltunautochat)
{
boltunnottochat = FALSE;
}
@@ -537,17 +537,17 @@ static INT_PTR ContactClickNotToChat(WPARAM hContact, LPARAM lParam) return ContactClick(hContact, lParam, 1);
}
-static INT_PTR ContactClickStartChatting(WPARAM hContact, LPARAM lParam)
+static INT_PTR ContactClickStartChatting(WPARAM hContact, LPARAM)
{
StartChatting(hContact);
return 0;
}
-static int MessagePrebuild(WPARAM hContact, LPARAM lParam)
+static int MessagePrebuild(WPARAM hContact, LPARAM)
{
CLISTMENUITEM clmi = { sizeof(clmi) };
- if (!blInit || (db_get_b(hContact,"CList","NotOnList",0) == 1)) {
+ if (!blInit || (db_get_b(hContact, "CList", "NotOnList", 0) == 1)) {
clmi.flags = CMIM_FLAGS | CMIF_GRAYED;
Menu_ModifyItem(hMenuItemAutoChat, &clmi);
@@ -557,18 +557,18 @@ static int MessagePrebuild(WPARAM hContact, LPARAM lParam) BOOL boltunautochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE);
BOOL boltunnottochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE);
- clmi.flags = CMIM_FLAGS | CMIM_ICON | (boltunautochat ? CMIF_CHECKED : 0);
- clmi.hIcon = LoadIcon( GetModuleHandle(NULL), MAKEINTRESOURCE((boltunautochat ? IDI_TICK : IDI_NOTICK)));
+ clmi.flags = CMIM_FLAGS | CMIM_ICON | (boltunautochat ? CMIF_CHECKED : 0);
+ clmi.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE((boltunautochat ? IDI_TICK : IDI_NOTICK)));
Menu_ModifyItem(hMenuItemAutoChat, &clmi);
- clmi.flags = CMIM_FLAGS | CMIM_ICON | (boltunnottochat ? CMIF_CHECKED : 0);
- clmi.hIcon = LoadIcon( GetModuleHandle(NULL), MAKEINTRESOURCE((boltunnottochat ? IDI_TICK : IDI_NOTICK)));
+ clmi.flags = CMIM_FLAGS | CMIM_ICON | (boltunnottochat ? CMIF_CHECKED : 0);
+ clmi.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE((boltunnottochat ? IDI_TICK : IDI_NOTICK)));
Menu_ModifyItem(hMenuItemNotToChat, &clmi);
}
return 0;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
@@ -590,7 +590,7 @@ extern "C" int __declspec(dllexport) Load(void) return false;
}
}
- *(_tcsrchr(path, _T('\\'))+1) = _T('\0');
+ *(_tcsrchr(path, _T('\\')) + 1) = _T('\0');
/*initialize miranda hooks and services on options dialog*/
HookEvent(ME_OPT_INITIALISE, MessageOptInit);
@@ -603,21 +603,21 @@ extern "C" int __declspec(dllexport) Load(void) CreateServiceFunction(SERV_CONTACT_START_CHATTING, ContactClickStartChatting);
{
CLISTMENUITEM mi = { sizeof(mi) };
- mi.position = -50010002; //TODO: check the warning
- mi.pszName = BOLTUN_AUTO_CHAT;
- mi.pszService = SERV_CONTACT_AUTO_CHAT;
- hMenuItemAutoChat = Menu_AddContactMenuItem(&mi);
-
- mi.position = -50010001; //TODO: check the warning
- mi.pszName = BOLTUN_NOT_TO_CHAT;
- mi.pszService = SERV_CONTACT_NOT_TO_CHAT;
- hMenuItemNotToChat = Menu_AddContactMenuItem(&mi);
-
- mi.flags = CMIF_NOTOFFLINE;
- mi.position = -50010000; //TODO: check the warning
- mi.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_RECVMSG));
- mi.pszName = BOLTUN_START_CHATTING;
- mi.pszService = SERV_CONTACT_START_CHATTING;
+ mi.position = -50010002; //TODO: check the warning
+ mi.pszName = BOLTUN_AUTO_CHAT;
+ mi.pszService = SERV_CONTACT_AUTO_CHAT;
+ hMenuItemAutoChat = Menu_AddContactMenuItem(&mi);
+
+ mi.position = -50010001; //TODO: check the warning
+ mi.pszName = BOLTUN_NOT_TO_CHAT;
+ mi.pszService = SERV_CONTACT_NOT_TO_CHAT;
+ hMenuItemNotToChat = Menu_AddContactMenuItem(&mi);
+
+ mi.flags = CMIF_NOTOFFLINE;
+ mi.position = -50010000; //TODO: check the warning
+ mi.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_RECVMSG));
+ mi.pszName = BOLTUN_START_CHATTING;
+ mi.pszService = SERV_CONTACT_START_CHATTING;
hMenuItemStartChatting = Menu_AddContactMenuItem(&mi);
}
@@ -627,7 +627,7 @@ extern "C" int __declspec(dllexport) Load(void) {
TCHAR path[2000];
mir_sntprintf(path, SIZEOF(path), TranslateTS(FAILED_TO_LOAD_BASE), line, (const TCHAR*)Config.MindFileName);
- MessageBox(NULL, path, TranslateTS(BOLTUN_ERROR), MB_ICONERROR|MB_TASKMODAL|MB_OK);
+ MessageBox(NULL, path, TranslateTS(BOLTUN_ERROR), MB_ICONERROR | MB_TASKMODAL | MB_OK);
}
return 0;
}
@@ -636,14 +636,14 @@ extern "C" int __declspec(dllexport) Unload(void) {
if (pTimer)
KillTimer(NULL, pTimer);
- if(blInit)
+ if (blInit)
{
#if 0 //No need to save, we don't have studying algorithm
if(Config.MindFileName && !SaveMind(Config.MindFileName))
{
-//This causes errors with development core when calling MessageBox.
-//It seems that it's now a Boltun problem.
-//So in case of saving error we will remain silent
+ //This causes errors with development core when calling MessageBox.
+ //It seems that it's now a Boltun problem.
+ //So in case of saving error we will remain silent
#if 0
TCHAR path[MAX_PATH];
mir_sntprintf(path, SIZEOF(path), TranslateTS(FAILED_TO_SAVE_BASE), (const TCHAR*)Config.MindFileName);
diff --git a/plugins/Boltun/src/config.cpp b/plugins/Boltun/src/config.cpp index b05a560b2b..40517216c1 100644 --- a/plugins/Boltun/src/config.cpp +++ b/plugins/Boltun/src/config.cpp @@ -18,7 +18,7 @@ //
//***********************************************************
-#include "boltun.h"
+#include "stdafx.h"
//Database keys
#define DB_EVERYBODY "Everybody"
@@ -142,7 +142,7 @@ BoltunConfig::~BoltunConfig() class _BoltunConfigInit
{
public:
- BoltunConfig cfg;
+ BoltunConfig cfg;
};
_BoltunConfigInit inst;
diff --git a/plugins/Boltun/src/config.h b/plugins/Boltun/src/config.h index a51240ad70..a1cd72c7de 100644 --- a/plugins/Boltun/src/config.h +++ b/plugins/Boltun/src/config.h @@ -27,8 +27,8 @@ template <class T, class BaseClass> class Property
{
public:
- typedef const T (__thiscall BaseClass::*Getter)();
- typedef const T (__thiscall BaseClass::*Setter)(const T);
+ typedef const T(__thiscall BaseClass::*Getter)();
+ typedef const T(__thiscall BaseClass::*Setter)(const T);
private:
const Getter getter;
const Setter setter;
diff --git a/plugins/Boltun/src/stdafx.cpp b/plugins/Boltun/src/stdafx.cxx index b3cf38f181..6fb37564b7 100644 --- a/plugins/Boltun/src/stdafx.cpp +++ b/plugins/Boltun/src/stdafx.cxx @@ -15,4 +15,4 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "boltun.h"
\ No newline at end of file +#include "stdafx.h"
\ No newline at end of file diff --git a/plugins/Boltun/src/boltun.h b/plugins/Boltun/src/stdafx.h index e831eaeb8d..2199be3cac 100644 --- a/plugins/Boltun/src/boltun.h +++ b/plugins/Boltun/src/stdafx.h @@ -21,8 +21,6 @@ #ifndef _BOLTUN_H
#define _BOLTUN_H
-#define _CRT_SECURE_NO_WARNINGS
-
#include <windows.h>
#include <time.h>
#include <fstream>
|