mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-27 18:17:40 +00:00
fix(windows): add x64 build fix invalid memory access
This commit adds x64 build for the imsample.dll. It also fixes the a invalid memory access error that occured when UnloadRules was called when a Keyboard had been created but the rules not yet loadeded. KeymanIMReloadConfig function returned a invalid code excution point this was fixed by addeding it to the imsample.def
This commit is contained in:
parent
6ad28fb359
commit
c167d8bdda
22 changed files with 235 additions and 1146 deletions
|
|
@ -1,20 +1,31 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31424.327
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IMSample", "IMSample.vcxproj", "{0C9DB8F9-B788-8782-A97D-4F8294AA0B4E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0C9DB8F9-B788-8782-A97D-4F8294AA0B4E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0C9DB8F9-B788-8782-A97D-4F8294AA0B4E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0C9DB8F9-B788-8782-A97D-4F8294AA0B4E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0C9DB8F9-B788-8782-A97D-4F8294AA0B4E}.Debug|x64.Build.0 = Debug|x64
|
||||
{0C9DB8F9-B788-8782-A97D-4F8294AA0B4E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0C9DB8F9-B788-8782-A97D-4F8294AA0B4E}.Release|Win32.Build.0 = Release|Win32
|
||||
{0C9DB8F9-B788-8782-A97D-4F8294AA0B4E}.Release|x64.ActiveCfg = Release|x64
|
||||
{0C9DB8F9-B788-8782-A97D-4F8294AA0B4E}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {8F6CDDCE-41E9-4361-91F0-79BCC61E9957}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
|||
|
|
@ -5,10 +5,18 @@
|
|||
<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">
|
||||
<SccProjectName />
|
||||
|
|
@ -22,11 +30,21 @@
|
|||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
|
|
@ -34,26 +52,48 @@
|
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||
</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" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||
</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" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||
</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" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(ProjectDir)bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(ProjectDir)obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(ProjectDir)bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(ProjectDir)obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<TargetExt>.dll</TargetExt>
|
||||
<TargetName>$(ProjectName).x64</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(ProjectDir)bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(ProjectDir)obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(ProjectDir)bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(ProjectDir)obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetExt>.dll</TargetExt>
|
||||
<TargetName>$(ProjectName).x64</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
|
@ -84,13 +124,53 @@
|
|||
<LinkDLL>true</LinkDLL>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OutputFile>.\IMSample.dll</OutputFile>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<ImportLibrary>.\IMSample.lib</ImportLibrary>
|
||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>.\imsample.def</ModuleDefinitionFile>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderOutputFile>.\IMSample.pch</PrecompiledHeaderOutputFile>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<TypeLibraryName>.\IMSample.tlb</TypeLibraryName>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<RedirectOutputAndErrors>NUL</RedirectOutputAndErrors>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0c09</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\IMSample.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<Link>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<LinkDLL>true</LinkDLL>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
|
||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>.\imsample.def</ModuleDefinitionFile>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
|
|
@ -129,6 +209,43 @@
|
|||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<StringPooling>true</StringPooling>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderOutputFile>.\IMSample.pch</PrecompiledHeaderOutputFile>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<TypeLibraryName>.\IMSample.tlb</TypeLibraryName>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<RedirectOutputAndErrors>NUL</RedirectOutputAndErrors>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0c09</Culture>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\IMSample.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<Link>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<LinkDLL>true</LinkDLL>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>.\imsample.def</ModuleDefinitionFile>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="imlib.cpp" />
|
||||
<ClCompile Include="imsample.cpp" />
|
||||
|
|
|
|||
|
|
@ -7,16 +7,25 @@ VERSION_TXT_PATH=..\..
|
|||
!include ..\..\..\Defines.mak
|
||||
|
||||
build: dirs version.res
|
||||
$(MSBUILD) imsample.sln $(MSBUILD_BUILD)
|
||||
$(MSBUILD) imsample.sln $(MSBUILD_BUILD) "/p:Platform=Win32"
|
||||
$(COPY) $(WIN32_TARGET_PATH)\imsample.dll $(PROGRAM)\developer
|
||||
$(COPY) $(WIN32_TARGET_PATH)\imsample.pdb $(PROGRAM)\developer
|
||||
|
||||
$(MSBUILD) imsample.sln $(MSBUILD_BUILD) "/p:Platform=x64"
|
||||
$(COPY) $(X64_TARGET_PATH)\imsample.x64.dll $(PROGRAM)\developer
|
||||
$(COPY) $(X64_TARGET_PATH)\imsample.x64.pdb $(PROGRAM)\developer
|
||||
|
||||
|
||||
signcode:
|
||||
$(SIGNCODE) /d "Keyman IMX Sample" $(PROGRAM)\developer\imsample.dll
|
||||
$(SIGNCODE) /d "Keyman IMX Sample" $(PROGRAM)\developer\imsample.x64.dll
|
||||
|
||||
|
||||
wrap-symbols:
|
||||
$(SYMSTORE) $(PROGRAM)\developer\imsample.dll /t keyman-developer
|
||||
$(SYMSTORE) $(PROGRAM)\developer\imsample.x64.dll /t keyman-developer
|
||||
$(SYMSTORE) $(DEBUGPATH)\developer\imsample.pdb /t keyman-developer
|
||||
$(SYMSTORE) $(DEBUGPATH)\developer\imsample.x64.pdb /t keyman-developer
|
||||
|
||||
clean: def-clean
|
||||
$(MSBUILD) imsample.sln $(MSBUILD_CLEAN)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include <windows.h>
|
||||
#include "imlib.h"
|
||||
|
||||
HMODULE hModuleKeyman32 = 0;
|
||||
HMODULE hModuleKeyman = 0;
|
||||
KMSetOutputProc KMSetOutput = NULL;
|
||||
KMGetContextProc KMGetContext = NULL;
|
||||
KMQueueActionProc KMQueueAction = NULL;
|
||||
|
|
@ -20,34 +20,39 @@ BOOL WINAPI IntKMGetKeyboardPath(PSTR kbdname, PSTR buf, DWORD len)
|
|||
|
||||
BOOL PrepIM(void)
|
||||
{
|
||||
if(hModuleKeyman32 != 0) return TRUE;
|
||||
if(hModuleKeyman != 0) return TRUE;
|
||||
|
||||
hModuleKeyman32 = GetModuleHandle("keyman32.dll");
|
||||
if(hModuleKeyman32 == 0)
|
||||
#ifdef _WIN64
|
||||
hModuleKeyman = GetModuleHandle("keyman64.dll");
|
||||
#else
|
||||
hModuleKeyman = GetModuleHandle("keyman32.dll");
|
||||
#endif
|
||||
|
||||
if(hModuleKeyman == 0)
|
||||
{
|
||||
KMGetKeyboardPath = IntKMGetKeyboardPath;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
KMSetOutput = (KMSetOutputProc) GetProcAddress(hModuleKeyman32, "KMSetOutput");
|
||||
|
||||
KMSetOutput = (KMSetOutputProc) GetProcAddress(hModuleKeyman, "KMSetOutput");
|
||||
if(!KMSetOutput) return FALSE;
|
||||
|
||||
KMGetContext = (KMGetContextProc) GetProcAddress(hModuleKeyman32, "KMGetContext");
|
||||
KMGetContext = (KMGetContextProc) GetProcAddress(hModuleKeyman, "KMGetContext");
|
||||
if(!KMGetContext) return FALSE;
|
||||
|
||||
KMQueueAction = (KMQueueActionProc) GetProcAddress(hModuleKeyman32, "KMQueueAction");
|
||||
KMQueueAction = (KMQueueActionProc) GetProcAddress(hModuleKeyman, "KMQueueAction");
|
||||
if(!KMQueueAction) return FALSE;
|
||||
|
||||
KMDisplayIM = (KMDisplayIMProc) GetProcAddress(hModuleKeyman32, "KMDisplayIM");
|
||||
KMDisplayIM = (KMDisplayIMProc) GetProcAddress(hModuleKeyman, "KMDisplayIM");
|
||||
if(!KMDisplayIM) return FALSE;
|
||||
|
||||
KMHideIM = (KMHideIMProc) GetProcAddress(hModuleKeyman32, "KMHideIM");
|
||||
KMHideIM = (KMHideIMProc) GetProcAddress(hModuleKeyman, "KMHideIM");
|
||||
if(!KMHideIM) return FALSE;
|
||||
|
||||
KMGetActiveKeyboard = (KMGetActiveKeyboardProc) GetProcAddress(hModuleKeyman32, "KMGetActiveKeyboard");
|
||||
KMGetActiveKeyboard = (KMGetActiveKeyboardProc) GetProcAddress(hModuleKeyman, "KMGetActiveKeyboard");
|
||||
if(!KMGetActiveKeyboard) return FALSE;
|
||||
|
||||
KMGetKeyboardPath = (KMGetKeyboardPathProc) GetProcAddress(hModuleKeyman32, "KMGetKeyboardPath");
|
||||
KMGetKeyboardPath = (KMGetKeyboardPathProc) GetProcAddress(hModuleKeyman, "KMGetKeyboardPath");
|
||||
if(!KMGetKeyboardPath) return FALSE;
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -72,7 +77,7 @@ HCURSOR GetHitTestCursor(HWND hwnd, LRESULT ht, LPRECT sizerect)
|
|||
case HTBOTTOMRIGHT: cr = IDC_SIZENWSE; sizerect->bottom = sizerect->right = 1; break;
|
||||
case HTLEFT: cr = IDC_SIZEWE; sizerect->left = 1; break;
|
||||
case HTRIGHT: cr = IDC_SIZEWE; sizerect->right = 1; break;
|
||||
default: return (HCURSOR) GetClassLong(hwnd, GCL_HCURSOR);
|
||||
default: return (HCURSOR) GetClassLongPtr(hwnd, GCLP_HCURSOR);
|
||||
}
|
||||
|
||||
return LoadCursor(NULL, cr);
|
||||
|
|
@ -105,7 +110,7 @@ BOOL IMDefWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
|
|||
*lResult = HTCLIENT;
|
||||
|
||||
if(FMoveWindow || FSizeWindow) return TRUE;
|
||||
|
||||
|
||||
ht = DefWindowProc(hwnd, msg, wParam, lParam);
|
||||
SetCursor(FHitTestCursor = GetHitTestCursor(hwnd, ht, &sizerect));
|
||||
return TRUE;
|
||||
|
|
@ -131,20 +136,20 @@ BOOL IMDefWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
|
|||
SetCursor(FHitTestCursor);
|
||||
return TRUE;
|
||||
|
||||
case HTTOP:
|
||||
case HTTOPLEFT:
|
||||
case HTTOPRIGHT:
|
||||
case HTBOTTOM:
|
||||
case HTBOTTOMLEFT:
|
||||
case HTBOTTOMRIGHT:
|
||||
case HTLEFT:
|
||||
case HTRIGHT:
|
||||
case HTTOP:
|
||||
case HTTOPLEFT:
|
||||
case HTTOPRIGHT:
|
||||
case HTBOTTOM:
|
||||
case HTBOTTOMLEFT:
|
||||
case HTBOTTOMRIGHT:
|
||||
case HTLEFT:
|
||||
case HTRIGHT:
|
||||
FSizeWindow = TRUE;
|
||||
SetCapture(hwnd);
|
||||
FLastPoint = pt2;
|
||||
SetCursor(FHitTestCursor);
|
||||
return TRUE;
|
||||
|
||||
|
||||
default:
|
||||
return ht != HTCLIENT;
|
||||
}
|
||||
|
|
@ -156,36 +161,36 @@ BOOL IMDefWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
|
|||
|
||||
if(FMoveWindow)
|
||||
{
|
||||
MoveWindow(hwnd,
|
||||
rect.left+pt2.x - FLastPoint.x,
|
||||
rect.top+pt2.y - FLastPoint.y,
|
||||
rect.right-rect.left,
|
||||
rect.bottom-rect.top,
|
||||
MoveWindow(hwnd,
|
||||
rect.left+pt2.x - FLastPoint.x,
|
||||
rect.top+pt2.y - FLastPoint.y,
|
||||
rect.right-rect.left,
|
||||
rect.bottom-rect.top,
|
||||
TRUE);
|
||||
FLastPoint = pt2;
|
||||
SetCursor(FHitTestCursor);
|
||||
return TRUE;
|
||||
}
|
||||
else if(FSizeWindow)
|
||||
{
|
||||
{
|
||||
POINT pt3 = pt2; pt3.x -= FLastPoint.x; pt3.y -= FLastPoint.y;
|
||||
RECT r2;
|
||||
r2.left = rect.left + pt3.x*sizerect.left;
|
||||
r2.top = rect.top + pt3.y*sizerect.top;
|
||||
r2.right = rect.right + pt3.x*sizerect.right;
|
||||
r2.bottom = rect.bottom + pt3.y*sizerect.bottom;
|
||||
if(r2.right - r2.left < 16)
|
||||
if(r2.right - r2.left < 16)
|
||||
{
|
||||
r2.right = rect.right; r2.left = rect.left;
|
||||
}
|
||||
else FLastPoint.x = pt2.x;
|
||||
if(r2.bottom - r2.top < 10)
|
||||
if(r2.bottom - r2.top < 10)
|
||||
{
|
||||
r2.bottom = rect.bottom; r2.top = rect.top;
|
||||
}
|
||||
else FLastPoint.y = pt2.y;
|
||||
|
||||
MoveWindow(hwnd,
|
||||
MoveWindow(hwnd,
|
||||
r2.left,
|
||||
r2.top,
|
||||
r2.right-r2.left,
|
||||
|
|
@ -195,9 +200,9 @@ BOOL IMDefWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
|
|||
SetCursor(FHitTestCursor);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
return DefWindowProc(hwnd, WM_NCHITTEST, 0, MAKELONG(pt2.x, pt2.y)) != HTCLIENT;
|
||||
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
if(FMoveWindow || FSizeWindow)
|
||||
{
|
||||
|
|
@ -208,7 +213,7 @@ BOOL IMDefWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
|
|||
|
||||
pt = MAKEPOINTS(lParam); pt2.x = pt.x; pt2.y = pt.y;
|
||||
ClientToScreen(hwnd, &pt2);
|
||||
|
||||
|
||||
return DefWindowProc(hwnd, WM_NCHITTEST, 0, MAKELONG(pt2.x, pt2.y)) != HTCLIENT;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ typedef BOOL (WINAPI *KMGetActiveKeyboardProc)(PSTR kbdname, DWORD len);
|
|||
typedef BOOL (WINAPI *KMHideIMProc)();
|
||||
typedef BOOL (WINAPI *KMGetKeyboardPathProc)(PSTR kbdname, PSTR buf, DWORD len);
|
||||
|
||||
extern HMODULE hModuleKeyman32;
|
||||
extern HMODULE hModuleKeyman;
|
||||
extern KMSetOutputProc KMSetOutput;
|
||||
extern KMGetContextProc KMGetContext;
|
||||
extern KMQueueActionProc KMQueueAction;
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ void CalcScrollSize()
|
|||
{
|
||||
WCHAR buf[48];
|
||||
if(!(*KMGetContext)(buf, 48)) buf[0] = 0;
|
||||
int buflen=wcslen(buf);
|
||||
int buflen = (int)wcslen(buf);
|
||||
|
||||
wz.cellcount = 0;
|
||||
int i;
|
||||
|
|
@ -463,10 +463,10 @@ LRESULT CALLBACK IMSampleChildWndProc(HWND hwndChild, UINT msg, WPARAM wParam, L
|
|||
|
||||
SIZE sz2;
|
||||
|
||||
GetTextExtentPoint32W(hDC, currule->outputs[i], wcslen(currule->outputs[i]), &sz2);
|
||||
GetTextExtentPoint32W(hDC, currule->outputs[i], (int)wcslen(currule->outputs[i]), &sz2);
|
||||
|
||||
TextOutW(hDC, x * cx + (cx-sz2.cx)/2, -vpos + (y+1) * cy - sz2.cy - 2,
|
||||
currule->outputs[i], wcslen(currule->outputs[i]));
|
||||
currule->outputs[i], (int)wcslen(currule->outputs[i]));
|
||||
|
||||
if(++x >= wz.visiblecolcount) { x = 0; y++; }
|
||||
}
|
||||
|
|
@ -512,8 +512,8 @@ BOOL FindRule(group *g, rule **rp, WCHAR KeyChar)
|
|||
WCHAR buf[48];
|
||||
if(!(*KMGetContext)(buf, 48)) return FALSE;
|
||||
rule *r = g->rules;
|
||||
int buflen = wcslen(buf);
|
||||
int i;
|
||||
int buflen = (int)wcslen(buf);
|
||||
int i;
|
||||
for(i = 0; i < g->nrules; i++)
|
||||
{
|
||||
if(r[i].key == KeyChar && buflen >= r[i].contextlen && !wcscmp(buf+(buflen-r[i].contextlen), r[i].context))
|
||||
|
|
@ -738,9 +738,9 @@ PWSTR extstr(char *p)
|
|||
if(!q) return newempty();
|
||||
if(q == p) return newempty();
|
||||
*q = 0;
|
||||
int n = MultiByteToWideChar(CP_ACP, 0, p, strlen(p), NULL, 0);
|
||||
int n = MultiByteToWideChar(CP_ACP, 0, p, (int)strlen(p), NULL, 0);
|
||||
PWCHAR buf = new WCHAR[n+1];
|
||||
MultiByteToWideChar(CP_ACP, 0, p, strlen(p), buf, n);
|
||||
MultiByteToWideChar(CP_ACP, 0, p, (int)strlen(p), buf, n);
|
||||
buf[n] = 0;
|
||||
return buf;
|
||||
}
|
||||
|
|
@ -791,7 +791,9 @@ PWSTR extstr(char *p)
|
|||
void UnloadRules(PSTR KeyboardName)
|
||||
{
|
||||
int nkbi;
|
||||
|
||||
if (nkeyboards == 0) {
|
||||
return;
|
||||
}
|
||||
for(nkbi = 0; nkbi < nkeyboards; nkbi++)
|
||||
if(!_stricmp(KeyboardName, keyboards[nkbi].name)) break;
|
||||
|
||||
|
|
@ -801,7 +803,12 @@ void UnloadRules(PSTR KeyboardName)
|
|||
|
||||
if(kbi->hFont) DeleteObject(kbi->hFont);
|
||||
kbi->hFont = NULL;
|
||||
int i;
|
||||
|
||||
if (kbi->groups == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
int i;
|
||||
for(i = 0; i < kbi->ngroups; i++)
|
||||
{
|
||||
for(int j = 0; j < kbi->groups[i].nrules; j++)
|
||||
|
|
@ -940,7 +947,7 @@ BOOL LoadRules(PSTR KeyboardName)
|
|||
rule *r2 = &kbi->groups[i].rules[kbi->groups[i].nrules++];
|
||||
|
||||
r2->context = extstr(pcontext);
|
||||
r2->contextlen = wcslen(r2->context);
|
||||
r2->contextlen = (int)wcslen(r2->context);
|
||||
PWSTR pp = extstr(pkey);
|
||||
r2->key = pp[0];
|
||||
delete pp;
|
||||
|
|
@ -949,7 +956,7 @@ BOOL LoadRules(PSTR KeyboardName)
|
|||
while(poutput && i < 10)
|
||||
{
|
||||
r2->outputs[i++] = extstr(poutput);
|
||||
r2->outputlen += wcslen(r2->outputs[i-1]) + 2;
|
||||
r2->outputlen += (int)wcslen(r2->outputs[i-1]) + 2;
|
||||
poutput = strtokquoted(NULL, ", ", "\"\'");
|
||||
}
|
||||
if(i > kbi->maxoutputs) kbi->maxoutputs = i;
|
||||
|
|
@ -1001,6 +1008,8 @@ void CreateKeyboard(PSTR keyboardname)
|
|||
keyboards = kb2;
|
||||
strncpy_s(keyboards[nkeyboards].name, _countof(keyboards[nkeyboards].name), keyboardname, 127); // I3481
|
||||
keyboards[nkeyboards].name[127] = 0;
|
||||
keyboards[nkeyboards].groups = NULL;
|
||||
keyboards[nkeyboards].hFont = NULL;
|
||||
nkeyboards++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
LIBRARY IMSAMPLE
|
||||
LIBRARY
|
||||
|
||||
EXPORTS
|
||||
DF
|
||||
|
|
@ -7,3 +7,4 @@ EXPORTS
|
|||
KeymanIMActivate
|
||||
KeymanIMDeactivate
|
||||
KeymanIMConfigure
|
||||
KeymanIMReloadConfig
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
|
||||
VERSION 5.0
|
||||
NAME "IMTest"
|
||||
store(&VERSION) '6.0'
|
||||
store(&NAME) 'IMTest'
|
||||
|
||||
store(DLLFunction) "imsample.dll:DF"
|
||||
|
||||
|
||||
begin Unicode > use(main)
|
||||
|
||||
group(main) using keys
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ typedef BOOL (WINAPI *InitDllFunction)(PSTR name);
|
|||
static LPIMDLL AddIMDLL(LPINTKEYBOARDINFO lpkbi, LPSTR kbdpath, LPSTR dllfilename)
|
||||
{
|
||||
DWORD j;
|
||||
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "AddIMDLL: Enter");
|
||||
for(j = 0; j < lpkbi->nIMDLLs; j++)
|
||||
if(!_stricmp(lpkbi->IMDLLs[j].Filename, dllfilename)) break;
|
||||
|
||||
|
|
@ -62,8 +62,10 @@ static LPIMDLL AddIMDLL(LPINTKEYBOARDINFO lpkbi, LPSTR kbdpath, LPSTR dllfilenam
|
|||
|
||||
HINSTANCE hModule = LoadLibrary(fullname); // Try keyboard dir first
|
||||
if(!hModule) hModule = LoadLibrary(newdllname); // Try anywhere on the path -- LIBRARY_NAME dir first // I3094
|
||||
if(!hModule) return NULL;
|
||||
|
||||
if (!hModule) {
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "AddIMDLL: hModule not loadded fullname[%s] newdllname[%s]", fullname, newdllname);
|
||||
return NULL;
|
||||
}
|
||||
/* Initialise the DLL */
|
||||
|
||||
InitDllFunction idf = (InitDllFunction) GetProcAddress(hModule, "KeymanIMInit");
|
||||
|
|
@ -88,7 +90,7 @@ static LPIMDLL AddIMDLL(LPINTKEYBOARDINFO lpkbi, LPSTR kbdpath, LPSTR dllfilenam
|
|||
imd->Hooks = NULL;
|
||||
imd->hModule = hModule;
|
||||
lpkbi->nIMDLLs++;
|
||||
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "AddIMDLL: Exit");
|
||||
return imd;
|
||||
}
|
||||
|
||||
|
|
@ -96,7 +98,8 @@ static LPIMDLL AddIMDLL(LPINTKEYBOARDINFO lpkbi, LPSTR kbdpath, LPSTR dllfilenam
|
|||
|
||||
static BOOL AddIMDLLHook(LPIMDLL imd, LPSTR funcname, DWORD storeno, PWCHAR *dpString)
|
||||
{
|
||||
/* Get the procedure address for the function */
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "AddIMDLLHook: Enter");
|
||||
/* Get the procedure address for the function */
|
||||
|
||||
IMDLLHOOKProc dhp = (IMDLLHOOKProc) GetProcAddress(imd->hModule, funcname);
|
||||
if(!dhp) return FALSE;
|
||||
|
|
@ -115,6 +118,7 @@ static BOOL AddIMDLLHook(LPIMDLL imd, LPSTR funcname, DWORD storeno, PWCHAR *dpS
|
|||
imd->Hooks[imd->nHooks].storeno = storeno;
|
||||
imd->Hooks[imd->nHooks].function = dhp;
|
||||
*dpString = (PWCHAR) &imd->Hooks[imd->nHooks++];
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "AddIMDLLHook: Exit");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -139,13 +143,19 @@ BOOL LoadDLLs(LPINTKEYBOARDINFO lpkbi)
|
|||
{
|
||||
char fullname[_MAX_PATH];
|
||||
|
||||
//SendDebugMessageFormat(0, sdmKeyboard, 0, "LoadDLLs: Enter");
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "LoadDLLs: Enter");
|
||||
|
||||
if(lpkbi->nIMDLLs > 0) if(!UnloadDLLs(lpkbi)) return FALSE;
|
||||
|
||||
if(!GetKeyboardFileName(lpkbi->Name, fullname, _MAX_PATH)) return FALSE;
|
||||
if (!lpkbi->Keyboard) return FALSE;
|
||||
if (!GetKeyboardFileName(lpkbi->Name, fullname, _MAX_PATH)) {
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "LoadDLLs: Filename not found[%s]", lpkbi->Name);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
if (!lpkbi->Keyboard) {
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "LoadDLLs: Keyboard is null");
|
||||
return FALSE;
|
||||
}
|
||||
for(DWORD i = 0; i < lpkbi->Keyboard->cxStoreArray; i++)
|
||||
{
|
||||
LPSTORE s = &lpkbi->Keyboard->dpStoreArray[i];
|
||||
|
|
@ -173,7 +183,7 @@ BOOL LoadDLLs(LPINTKEYBOARDINFO lpkbi)
|
|||
}
|
||||
}
|
||||
|
||||
//SendDebugMessageFormat(0, sdmKeyboard, 0, "LoadDLLs: Exit");
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "LoadDLLs: Exit");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -224,7 +234,7 @@ BOOL DeactivateDLLs(LPINTKEYBOARDINFO lpkbi)
|
|||
|
||||
void CallDLL(LPINTKEYBOARDINFO lpkbi, DWORD storenum)
|
||||
{
|
||||
//SendDebugMessageFormat(0, sdmKeyboard, 0, "CallDll: Enter");
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "CallDll: Enter");
|
||||
if (!lpkbi->Keyboard) return;
|
||||
if(storenum >= lpkbi->Keyboard->cxStoreArray) return;
|
||||
|
||||
|
|
@ -240,32 +250,36 @@ void CallDLL(LPINTKEYBOARDINFO lpkbi, DWORD storenum)
|
|||
(*imdh->function)(_td->state.msg.hwnd, _td->state.vkey, _td->state.charCode, Globals::get_ShiftState());
|
||||
}
|
||||
|
||||
//SendDebugMessageFormat(0, sdmKeyboard, 0, "CallDll: Exit");
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "CallDll: Exit");
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern "C" BOOL _declspec(dllexport) WINAPI KMSetOutput(PWSTR buf, DWORD backlen)
|
||||
{
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "KMSetOutput: Enter");
|
||||
PKEYMAN64THREADDATA _td = ThreadGlobals();
|
||||
if(!_td) return FALSE;
|
||||
if(!_td->app) return FALSE;
|
||||
while(backlen-- > 0) _td->app->QueueAction(QIT_BACK, 0);
|
||||
while(*buf) _td->app->QueueAction(QIT_CHAR, *buf++);
|
||||
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "KMSetOutput: Exit");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
extern "C" BOOL _declspec(dllexport) WINAPI KMQueueAction(int ItemType, DWORD dwData)
|
||||
{
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "KMQueueAction: Enter");
|
||||
PKEYMAN64THREADDATA _td = ThreadGlobals();
|
||||
if(!_td) return FALSE;
|
||||
if(!_td->app) return FALSE;
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "KMQueueAction: Exit");
|
||||
return _td->app->QueueAction(ItemType, dwData);
|
||||
}
|
||||
|
||||
extern "C" BOOL _declspec(dllexport) WINAPI KMGetContext(PWSTR buf, DWORD len)
|
||||
{
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "KMGetContext: Enter");
|
||||
PKEYMAN64THREADDATA _td = ThreadGlobals();
|
||||
if(!_td) return FALSE;
|
||||
if(!_td->app) return FALSE;
|
||||
|
|
@ -274,6 +288,7 @@ extern "C" BOOL _declspec(dllexport) WINAPI KMGetContext(PWSTR buf, DWORD len)
|
|||
if(!q) return FALSE; // context buf does not exist
|
||||
|
||||
wcscpy_s(buf, len+1, q); // I3091
|
||||
SendDebugMessageFormat(0, sdmKeyboard, 0, "KMGetContext: Exit");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,106 +0,0 @@
|
|||
# Microsoft Developer Studio Project File - Name="IMSample" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=IMSample - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "IMSample.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "IMSample.mak" CFG="IMSample - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "IMSample - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "IMSample - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "IMSample - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ""
|
||||
# PROP Intermediate_Dir ""
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0xc09 /d "NDEBUG"
|
||||
# ADD RSC /l 0xc09 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "IMSample - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir ""
|
||||
# PROP Intermediate_Dir ""
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0xc09 /d "_DEBUG"
|
||||
# ADD RSC /l 0xc09 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "IMSample - Win32 Release"
|
||||
# Name "IMSample - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\imlib.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\imlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\imsample.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\imsample.def
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "IMSample"=.\IMSample.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "Keyman32"=..\..\dist\keyman32\Keyman32.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "imsmtest"=..\..\..\..\..\temp\imsmtest\imsmtest.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name IMSample
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "kdebug"=..\kdebug\kdebug.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,194 +0,0 @@
|
|||
# Microsoft Developer Studio Generated NMAKE File, Based on IMSample.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=IMSample - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to IMSample - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "IMSample - Win32 Release" && "$(CFG)" !=\
|
||||
"IMSample - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "IMSample.mak" CFG="IMSample - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "IMSample - Win32 Release" (based on\
|
||||
"Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "IMSample - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "IMSample - Win32 Release"
|
||||
|
||||
OUTDIR=.
|
||||
INTDIR=.
|
||||
# Begin Custom Macros
|
||||
OutDir=.
|
||||
# End Custom Macros
|
||||
|
||||
!IF "$(RECURSE)" == "0"
|
||||
|
||||
ALL : "$(OUTDIR)\IMSample.dll"
|
||||
|
||||
!ELSE
|
||||
|
||||
ALL : "$(OUTDIR)\IMSample.dll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\imlib.obj"
|
||||
-@erase "$(INTDIR)\imsample.obj"
|
||||
-@erase "$(INTDIR)\vc50.idb"
|
||||
-@erase "$(OUTDIR)\IMSample.dll"
|
||||
-@erase "$(OUTDIR)\IMSample.exp"
|
||||
-@erase "$(OUTDIR)\IMSample.lib"
|
||||
|
||||
CPP_PROJ=/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS"\
|
||||
/Fp"$(INTDIR)\IMSample.pch" /YX /FD /c
|
||||
CPP_OBJS=.
|
||||
CPP_SBRS=.
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\IMSample.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib /nologo /subsystem:windows /dll /incremental:no\
|
||||
/pdb:"$(OUTDIR)\IMSample.pdb" /machine:I386 /def:".\imsample.def"\
|
||||
/out:"$(OUTDIR)\IMSample.dll" /implib:"$(OUTDIR)\IMSample.lib"
|
||||
DEF_FILE= \
|
||||
".\imsample.def"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\imlib.obj" \
|
||||
"$(INTDIR)\imsample.obj"
|
||||
|
||||
"$(OUTDIR)\IMSample.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "IMSample - Win32 Debug"
|
||||
|
||||
OUTDIR=.
|
||||
INTDIR=.
|
||||
# Begin Custom Macros
|
||||
OutDir=.
|
||||
# End Custom Macros
|
||||
|
||||
!IF "$(RECURSE)" == "0"
|
||||
|
||||
ALL : "$(OUTDIR)\IMSample.dll"
|
||||
|
||||
!ELSE
|
||||
|
||||
ALL : "$(OUTDIR)\IMSample.dll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\imlib.obj"
|
||||
-@erase "$(INTDIR)\imsample.obj"
|
||||
-@erase "$(INTDIR)\vc50.idb"
|
||||
-@erase "$(INTDIR)\vc50.pdb"
|
||||
-@erase "$(OUTDIR)\IMSample.dll"
|
||||
-@erase "$(OUTDIR)\IMSample.exp"
|
||||
-@erase "$(OUTDIR)\IMSample.ilk"
|
||||
-@erase "$(OUTDIR)\IMSample.lib"
|
||||
-@erase "$(OUTDIR)\IMSample.pdb"
|
||||
|
||||
CPP_PROJ=/nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS"\
|
||||
/Fp"$(INTDIR)\IMSample.pch" /YX /FD /c
|
||||
CPP_OBJS=.
|
||||
CPP_SBRS=.
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\IMSample.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib /nologo /subsystem:windows /dll /incremental:yes\
|
||||
/pdb:"$(OUTDIR)\IMSample.pdb" /debug /machine:I386 /def:".\imsample.def"\
|
||||
/out:"$(OUTDIR)\IMSample.dll" /implib:"$(OUTDIR)\IMSample.lib" /pdbtype:sept
|
||||
DEF_FILE= \
|
||||
".\imsample.def"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\imlib.obj" \
|
||||
"$(INTDIR)\imsample.obj"
|
||||
|
||||
"$(OUTDIR)\IMSample.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
.c{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
|
||||
!IF "$(CFG)" == "IMSample - Win32 Release" || "$(CFG)" ==\
|
||||
"IMSample - Win32 Debug"
|
||||
SOURCE=.\imlib.cpp
|
||||
DEP_CPP_IMLIB=\
|
||||
".\imlib.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\imlib.obj" : $(SOURCE) $(DEP_CPP_IMLIB) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\imsample.cpp
|
||||
DEP_CPP_IMSAM=\
|
||||
".\imlib.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\imsample.obj" : $(SOURCE) $(DEP_CPP_IMSAM) "$(INTDIR)"
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
[Config]
|
||||
Font=Arial Unicode MS
|
||||
Size=20
|
||||
|
||||
[Groups]
|
||||
IPA
|
||||
|
||||
[Rules]
|
||||
IPA,"","a",U+00E6, "a", U+0251, U+0250, U+028C
|
||||
IPA,"","e",U+025B, U+025C, U+0259, "e", U+0258
|
||||
IPA,"","o", "o", U+00F8, U+0254
|
||||
IPA,"","m", "m", "M", "###"
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
#
|
||||
# imsample Makefile
|
||||
#
|
||||
|
||||
!include ..\..\Defines.mak
|
||||
|
||||
!ifdef DEBUG
|
||||
NMCFG=IMSample - Win32 Debug
|
||||
!else
|
||||
NMCFG=IMSample - Win32 Release
|
||||
!endif
|
||||
|
||||
install: dirs build
|
||||
$(COPY) imsample.dll $(PROGRAM)\dev
|
||||
|
||||
build: version.res
|
||||
$(NMAKE) /f imsample.mak "CFG=$(NMCFG)"
|
||||
|
||||
clean: def-clean
|
||||
$(NMAKE) /f imsample.mak "CFG=$(NMCFG)" CLEAN
|
||||
|
||||
!include ..\..\Target.mak
|
||||
|
|
@ -1,274 +0,0 @@
|
|||
{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
|
||||
{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f74\froman\fcharset238\fprq2 Times New Roman CE;}{\f75\froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\f77\froman\fcharset161\fprq2 Times New Roman Greek;}{\f78\froman\fcharset162\fprq2 Times New Roman Tur;}{\f79\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f80\fswiss\fcharset238\fprq2 Arial CE;}{\f81\fswiss\fcharset204\fprq2 Arial Cyr;}
|
||||
{\f83\fswiss\fcharset161\fprq2 Arial Greek;}{\f84\fswiss\fcharset162\fprq2 Arial Tur;}{\f85\fswiss\fcharset186\fprq2 Arial Baltic;}{\f86\fmodern\fcharset238\fprq1 Courier New CE;}{\f87\fmodern\fcharset204\fprq1 Courier New Cyr;}
|
||||
{\f89\fmodern\fcharset161\fprq1 Courier New Greek;}{\f90\fmodern\fcharset162\fprq1 Courier New Tur;}{\f91\fmodern\fcharset186\fprq1 Courier New Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;
|
||||
\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;
|
||||
\red192\green192\blue192;}{\stylesheet{\widctlpar\adjustright \fs20\lang3081\cgrid \snext0 Normal;}{\s1\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\lang3081\kerning28\cgrid \sbasedon0 \snext0 heading 1;}{\s2\sb240\sa60\keepn\widctlpar\adjustright
|
||||
\b\i\f1\lang3081\cgrid \sbasedon0 \snext0 heading 2;}{\s3\sb120\keepn\widctlpar\adjustright \b\f1\fs20\lang3081\cgrid \sbasedon0 \snext0 heading 3;}{\*\cs10 \additive Default Paragraph Font;}{\s15\fi-425\li709\widctlpar\adjustright
|
||||
\f2\fs16\lang3081\cgrid \sbasedon0 \snext15 Code;}{\s16\widctlpar\adjustright \b\f1\fs16\lang3081\cgrid \sbasedon0 \snext16 TableHeader;}{\*\cs17 \additive \f2\fs16 \sbasedon10 PCode;}{\s18\widctlpar\adjustright \f1\fs16\lang3081\cgrid
|
||||
\sbasedon0 \snext18 TCell;}{\s19\qc\sb240\sa60\widctlpar\outlinelevel0\adjustright \b\f1\fs32\lang3081\kerning28\cgrid \sbasedon0 \snext19 Title;}{\s20\fi-283\li567\widctlpar\adjustright \fs20\lang3081\cgrid \sbasedon0 \snext20 Arial;}{\*\cs21 \additive
|
||||
\f1\fs18 \sbasedon10 filename;}{\s22\widctlpar\adjustright \fs20\lang3081\cgrid \sbasedon0 \snext22 pc;}{\s23\widctlpar\tqc\tx4153\tqr\tx8306\adjustright \fs20\lang3081\cgrid \sbasedon0 \snext23 header;}{\s24\widctlpar\tqc\tx4153\tqr\tx8306\adjustright
|
||||
\fs20\lang3081\cgrid \sbasedon0 \snext24 footer;}{\*\cs25 \additive \sbasedon10 page number;}}{\*\listtable{\list\listtemplateid-963727900\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
|
||||
\'02\'00.;}{\levelnumbers\'01;}\fi-360\li1492\jclisttab\tx1492 }{\listname ;}\listid-132}{\list\listtemplateid1736061876\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}
|
||||
\fi-360\li1209\jclisttab\tx1209 }{\listname ;}\listid-131}{\list\listtemplateid-1759738300\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li926\jclisttab\tx926
|
||||
}{\listname ;}\listid-130}{\list\listtemplateid-1902884938\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li643\jclisttab\tx643 }{\listname ;}\listid-129}
|
||||
{\list\listtemplateid1956535276\listsimple{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li1492\jclisttab\tx1492 }{\listname ;}\listid-128}
|
||||
{\list\listtemplateid-392499776\listsimple{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li1209\jclisttab\tx1209 }{\listname ;}\listid-127}
|
||||
{\list\listtemplateid-967173064\listsimple{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li926\jclisttab\tx926 }{\listname ;}\listid-126}
|
||||
{\list\listtemplateid-1624359846\listsimple{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li643\jclisttab\tx643 }{\listname ;}\listid-125}
|
||||
{\list\listtemplateid-323179536\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360 }{\listname ;}\listid-120}{\list\listtemplateid1800809868
|
||||
\listsimple{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid-119}{\list\listtemplateid201916431\listsimple{\listlevel
|
||||
\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360 }{\listname ;}\listid1081215738}{\list\listtemplateid201916431\listsimple{\listlevel\levelnfc0\leveljc0
|
||||
\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360 }{\listname ;}\listid1620605434}}{\*\listoverridetable{\listoverride\listid-119\listoverridecount0\ls1}{\listoverride\listid-125
|
||||
\listoverridecount0\ls2}{\listoverride\listid-126\listoverridecount0\ls3}{\listoverride\listid-127\listoverridecount0\ls4}{\listoverride\listid-128\listoverridecount0\ls5}{\listoverride\listid-120\listoverridecount0\ls6}{\listoverride\listid-129
|
||||
\listoverridecount0\ls7}{\listoverride\listid-130\listoverridecount0\ls8}{\listoverride\listid-131\listoverridecount0\ls9}{\listoverride\listid-132\listoverridecount0\ls10}{\listoverride\listid1620605434\listoverridecount0\ls11}
|
||||
{\listoverride\listid1081215738\listoverridecount0\ls12}}{\info{\title DLL Interface for Keyman}{\author Marc Durdin}{\operator Marc Durdin}{\creatim\yr2001\mo6\dy5\hr11\min48}{\revtim\yr2001\mo6\dy5\hr12\min28}{\version3}{\edmins1}{\nofpages6}
|
||||
{\nofwords1968}{\nofchars11219}{\*\company Tavultesoft}{\nofcharsws13777}{\vern89}}\paperw11906\paperh16838 \widowctrl\ftnbj\aenddoc\hyphcaps0\formshade\viewkind1\viewscale117\viewzk2\pgbrdrhead\pgbrdrfoot \fet0\sectd
|
||||
\linex0\headery709\footery709\colsx709\endnhere\sectdefaultcl {\header \pard\plain \s23\widctlpar\brdrb\brdrs\brdrw10\brsp20 \tqc\tx4153\tqr\tx8306\adjustright \fs20\lang3081\cgrid {\b\f1 DLL Interface for Keyman\tab \tab 5 June 2001
|
||||
\par }}{\footer \pard\plain \s24\widctlpar\brdrt\brdrs\brdrw10\brsp20 \tqc\tx4153\tqr\tx8306\adjustright \fs20\lang3081\cgrid {\b\f1 Page }{\field{\*\fldinst {\cs25\b\f1 PAGE }}{\fldrslt {\cs25\b\f1\lang1024 5}}}{\cs25\b\f1 of }{\field{\*\fldinst {
|
||||
\cs25\b\f1 NUMPAGES }}{\fldrslt {\cs25\b\f1\lang1024 1}}}{\cs25\b\f1 \tab \tab \'a9 2001 Tavultesoft}{\b\f1
|
||||
\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}
|
||||
{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8
|
||||
\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \s19\qc\sb240\sa60\widctlpar\outlinelevel0\adjustright \b\f1\fs32\lang3081\kerning28\cgrid {
|
||||
DLL Interface for Keyman
|
||||
\par }\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs28\lang3081\kerning28\cgrid {Introduction
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
Keyman's multiple group processing is powerful, but sometimes you need to be able to do something a bit more complex, such as a dictionary lookup. Keyman's DLL interface let you do this. You can call a function in a DLL in the same way as you call anoth
|
||||
er group. The function can read the context, deadkeys and the current keystroke, and output characters, deadkeys, virtual keys, beeps and other items.
|
||||
\par
|
||||
\par The DLL interface also allows you to create a popup Input Method Composition (IMC) window. This window
|
||||
allows the user to select visually the characters they are wishing to input. The window can be set to be visible when the keyboard is active, or after an appropriate key sequence. When the window is visible, it can be set to capture all keyboard input,
|
||||
or be passive.
|
||||
\par }\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs28\lang3081\kerning28\cgrid {File locations
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {The DLL should be placed in any of the following locations:
|
||||
\par
|
||||
\par {\pntext\pard\plain\fs20\cgrid \hich\af0\dbch\af0\loch\f0 1.\tab}}\pard \fi-360\li1080\widctlpar\jclisttab\tx1080{\*\pn \pnlvlbody\ilvl0\ls12\pnrnot0\pndec\pnstart1\pnindent360\pnhang{\pntxta .}}\ls12\adjustright {
|
||||
The same directory as the .kmx file (e.g. use a package to install it)
|
||||
\par {\pntext\pard\plain\fs20\cgrid \hich\af0\dbch\af0\loch\f0 2.\tab}}\pard \fi-360\li1080\widctlpar\jclisttab\tx1080{\*\pn \pnlvlbody\ilvl0\ls12\pnrnot0\pndec\pnstart1\pnindent360\pnhang{\pntxta .}}\ls12\adjustright {
|
||||
The Keyman program directory (same place as keyman32.dll)
|
||||
\par {\pntext\pard\plain\fs20\cgrid \hich\af0\dbch\af0\loch\f0 3.\tab}}\pard \fi-360\li1080\widctlpar\jclisttab\tx1080{\*\pn \pnlvlbody\ilvl0\ls12\pnrnot0\pndec\pnstart1\pnindent360\pnhang{\pntxta .}}\ls12\adjustright {Anywhere on the path (suc
|
||||
h as the Windows directory)
|
||||
\par }\pard \widctlpar\adjustright {
|
||||
\par The best option is (1), as you can then include the DLL in a Keyman package for easy installation and uninstallation.
|
||||
\par }\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs28\lang3081\kerning28\cgrid {General usage information
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {DLL functions used in place of groups are called }{\i DLL group functions}{.
|
||||
\par
|
||||
\par All strings, apart from keyboard names, are passed as WCHAR, regardless of whether the active window is a Unicode window or not. ANSI characters are represented as 16-bit WCHAR, with high bits zeroed out.
|
||||
\par
|
||||
\par The DLL will be loaded for each process in which the keyboard is activated. Remember that the DLL will }{\b\i not}{
|
||||
share memory between these processes by default, so if you have large memory requirements, you should use memory mapped files or possibly SHARDATA segments to minimize the memory consumption.
|
||||
\par
|
||||
\par DLL group functi
|
||||
ons are called in a fairly time-critical environment. It is important that you minimise the processing time in these functions. It is essential that you avoid any window focus or activation -- message boxes are definitely out of the question. For debug
|
||||
ging purposes, there is a Keyman32.dll function exported for writing to the logfile (see the section titled }{\i Keyman32 imports}{).
|
||||
\par
|
||||
\par DLLs can handle multiple keyboards at once. The keyboards are identified by a name which is the filename of the keyboard, minus path and extension. For example, given }{\f1 c:\\keyman\\imsample\\imsample.kmx}{, the keyboard name is }{\cs17\f2\fs16
|
||||
imsample}{. These are the same names that Keyman uses internally, for example in the registry and directory names.
|
||||
\par }\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs28\lang3081\kerning28\cgrid {Registry settings
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par Par
|
||||
ameters for the DLL can be stored in two locations in the registry. They should always be stored under HKEY_CURRENT_USER, as the user may not have permission to change machine-wide settings, and the settings should not affect other users. The following
|
||||
locations are recommended:
|
||||
\par
|
||||
\par }\pard\plain \s20\fi-283\li567\widctlpar\adjustright \fs20\lang3081\cgrid {\f1\fs18 HKEY_CURRENT_USER\\Software\\Tavultesoft\\Keyman\\5.0\\<DLLName>
|
||||
\par HKEY_CURRENT_USER\\Software\\Tavultesoft\\Keyman\\5.0\\Installed Keyboards\\<kbdname>
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par The first key should be used for settings that pertain to any keyboard associated with t
|
||||
he DLL. The second key should be used for any keyboard-specific settings. Values stored under the second key should be prefixed with the name of the dll, so that they will not conflict with Keyman or other dll values.
|
||||
\par }\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs28\lang3081\kerning28\cgrid {The .kmn interface
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {Inside a .kmn file, you define the DLL group function interface as follows:
|
||||
\par
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {store(DLLFunction) "myfile.dll:KeyEvent"
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par You can use this anywhere where you would place the }{\cs17\f2\fs16 use}{ statement (except in the }{\cs17\f2\fs16 begin}{ statement), with the }{\cs17\f2\fs16 call}{ statement. For example,
|
||||
\par
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {+ 'a' > call(DLLFunction)
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par A single .kmn file can reference multiple DLL group functions, in a single or multiple DLLs.
|
||||
\par }\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs28\lang3081\kerning28\cgrid {DLL exports
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {The DLL is called from Keyman with LoadLibrary. All functions are then found with GetProcAddress. You must ensure that the function expor
|
||||
ts do not have ordinals encoded in the names. The best way to accomplish this in C/C++ is to use a .def file.
|
||||
\par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang3081\cgrid {DLL group function exports
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {The function declaration for the DLL group function is:
|
||||
\par
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {BOOL WINAPI }{\i KeyEvent}{(HWND hwndFocus, WORD KeyStroke, WCHAR KeyChar, DWORD ShiftFlags);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par Note that }{\cs17\f2\fs16 KeyEvent}{ is a placeholder for any name that you wish to use. You can have multiple exports for Keyman use in a single DLL.
|
||||
\par }\pard\plain \s3\sb120\keepn\widctlpar\outlinelevel2\adjustright \b\f1\fs20\lang3081\cgrid {Parameters
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par }\trowd \trgaph108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr
|
||||
\brdrs\brdrw10 \cltxlrtb \cellx1418\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx6238\pard\plain \s16\widctlpar\intbl\adjustright \b\f1\fs16\lang3081\cgrid {Parameter\cell Description
|
||||
\cell }\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\row }\trowd \trgaph108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \clvertalt\clbrdrt
|
||||
\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx1418\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx6238\pard
|
||||
\widctlpar\intbl\adjustright {\cs17\f2\fs16 hwndFocus\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {The currently focused window. You will probably never have a need to use this. \cell }\pard\plain
|
||||
\widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\row }\pard \widctlpar\intbl\adjustright {\cs17\f2\fs16 KeyStroke\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {The virtual key code for the current key.\cell }\pard\plain
|
||||
\widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\row }\pard \widctlpar\intbl\adjustright {\cs17\f2\fs16 KeyChar\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {
|
||||
The character code for the current key (based on US English layout). This will be 0 if KeyStroke does not generate a character (e.g. function keys).\cell }\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\row }\trowd \trgaph108\trbrdrt
|
||||
\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx1418
|
||||
\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx6238\pard \widctlpar\intbl\adjustright {\cs17\f2\fs16 ShiftFlags\cell }\pard\plain \s18\widctlpar\intbl\adjustright
|
||||
\f1\fs16\lang3081\cgrid {The shift state for the current key. See the table in the Notes section for possible shift states. \cell }\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\row }\pard\plain
|
||||
\s3\sb120\keepn\widctlpar\outlinelevel2\adjustright \b\f1\fs20\lang3081\cgrid {Notes
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par The following shift states are possible:
|
||||
\par
|
||||
\par }\trowd \trgaph108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr
|
||||
\brdrs\brdrw10 \cltxlrtb \cellx1701\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx2694\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr
|
||||
\brdrs\brdrw10 \cltxlrtb \cellx5670\pard\plain \s16\widctlpar\intbl\adjustright \b\f1\fs16\lang3081\cgrid {Flag\cell Value\cell Description\cell }\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\row }\trowd \trgaph108\trbrdrt\brdrs\brdrw10
|
||||
\trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx1701\clvertalt\clbrdrt
|
||||
\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx2694\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx5670\pard
|
||||
\widctlpar\intbl\adjustright {\cs17\f2\fs16 LCTRLFLAG\cell 0x0001\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {Left Control flag\cell }\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\fs16 \row }\pard
|
||||
\widctlpar\intbl\adjustright {\cs17\f2\fs16 RCTRLFLAG\cell 0x0002\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {Right Control flag\cell }\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\fs16 \row }\pard
|
||||
\widctlpar\intbl\adjustright {\cs17\f2\fs16 LALTFLAG\cell 0x0004\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {Left Alt flag\cell }\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\fs16 \row }\pard
|
||||
\widctlpar\intbl\adjustright {\cs17\f2\fs16 RALTFLAG\cell 0x0008\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {Right Alt flag\cell }\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\fs16 \row }\pard
|
||||
\widctlpar\intbl\adjustright {\cs17\f2\fs16 K_SHIFTFLAG\cell 0x0010\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {Shift flag\cell }\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\row }\pard
|
||||
\widctlpar\intbl\adjustright {\cs17\f2\fs16 K_CTRLFLAG\cell 0x0020\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {Ctrl flag (unused here; see l/r flags) \cell }\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {
|
||||
\row }\pard \widctlpar\intbl\adjustright {\cs17\f2\fs16 K_ALTFLAG\cell 0x0040\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {Alt flag (unused here; see l/r flags)\cell }\pard\plain \widctlpar\intbl\adjustright
|
||||
\fs20\lang3081\cgrid {\row }\pard \widctlpar\intbl\adjustright {\cs17\f2\fs16 CAPITALFLAG\cell 0x0100\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {Caps lock on\cell }\pard\plain \widctlpar\intbl\adjustright
|
||||
\fs20\lang3081\cgrid {\fs16 \row }\pard \widctlpar\intbl\adjustright {\cs17\f2\fs16 NUMLOCKFLAG\cell 0x0400\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {Num lock on\cell }\pard\plain \widctlpar\intbl\adjustright
|
||||
\fs20\lang3081\cgrid {\fs16 \row }\pard \widctlpar\intbl\adjustright {\cs17\f2\fs16 SCROLLFLAG\cell 0x1000\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {Scroll lock on\cell }\pard\plain \widctlpar\intbl\adjustright
|
||||
\fs20\lang3081\cgrid {\fs16 \row }\trowd \trgaph108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb
|
||||
\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx1701\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx2694\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb
|
||||
\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx5670\pard \widctlpar\intbl\adjustright {\cs17\f2\fs16 ISVIRTUALKEY\cell 0x4000\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {It is a Virtual Key Sequence\cell
|
||||
}\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\fs16 \row }\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs28\lang3081\kerning28\cgrid {Optional DLL exports
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
Keyman recognises a number of other exports, if they are defined in the DLL. None of these are required. These functions will be called when a keyboard that references the DLL is manipulated. They will not be called for keyboards that do not reference
|
||||
the DLL.
|
||||
\par
|
||||
\par The following exports are available:
|
||||
\par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang3081\cgrid {KeymanIMInit
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {BOOL WINAPI KeymanIMInit(PSTR keyboardname);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par }{\cs17\f2\fs16 KeymanIMInit}{ is called once when the keyboard identified by }{\cs17\f2\fs16 keyboardname}{ is loaded for a given process. It is called for each process in which the keyboard is loaded.
|
||||
\par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang3081\cgrid {KeymanIMDestroy
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {BOOL WINAPI KeymanIMDestroy(PSTR keyboardname);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par This is called once when the keyboard identified by }{\cs17\f2\fs16 keyboardname}{ is unloaded in a given process
|
||||
. It is called when the process exits normally, or when Keyman refreshes its keyboard list after keyboards are added or removed. If the keyboard is subsequently reloaded, }{\cs17\f2\fs16 KeymanIMInit}{ will be called again.
|
||||
\par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang3081\cgrid {KeymanIMActivate
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {BOOL WINAPI KeymanIMActivate(PSTR keyboardname);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par This function is called whenever the user or a program activates the keyboard. It is never called before KeymanIMInit (unless KeymanIMInit is not exported). This is an appropriate place to switch on permanently-visible IMC windows. }{\cs17\f2\fs16 Ke
|
||||
ymanIMActivate}{ can also be called when switching processes and the target process has a related keyboard already active.
|
||||
\par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang3081\cgrid {KeymanIMDeactivate
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {BOOL WINAPI KeymanIMDeactivate(PSTR keyboardname);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par This function is called when the user or a program switches off a related keyboard. It is always called before }{\cs17\f2\fs16 KeymanIMActivate}{
|
||||
for the next keyboard. It will also be called when the user activates another process, to give the DLL a chance to hide top-most IMC windows.
|
||||
\par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang3081\cgrid {KeymanIMConfigure
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {BOOL WINAPI KeymanIMConfigure(PSTR keyboardname, HWND hwndParent);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par KeymanIMConfigure is called when the user clicks the Configure button in KMShell to configure the DLL-specific functionality for the keyboard. The appropriate behaviour is to display a dialog box, and save the settings in the registry.
|
||||
\par
|
||||
\par This function is separate from all the other functions. It can be called when there are no keyboards loaded, or even if Keyman itself is not loaded. You should not attempt to call Keyman32.dll from this function.
|
||||
\par }\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs28\lang3081\kerning28\cgrid {The imlib.cpp library module
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {imlib.cpp, included in the development kit, contains a set of useful functions for interfacing to Keyman.
|
||||
\par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang3081\cgrid {PrepIM
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {BOOL PrepIM(void);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par }{\cs17\f2\fs16 PrepIM}{ initialises the Keyman32 imports. You should not call any of the Keyman imports without calling }{\cs17\f2\fs16 PrepIM}{ first. If }{\cs17\f2\fs16 PrepIM}{ fails, you should exit without doing any processing.
|
||||
\par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang3081\cgrid {IMDefWindowProc
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {BOOL IMDefWindowProc(HWND hwnd, UINT msg, WPARAM wParam, \line LPARAM lParam, LRESULT *lResult);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par }{\cs17\f2\fs16 IMDefWindowProc}{ should be called from an IMC window procedure (see section titled }{\i Input Method Composition windows}{). If it returns TRUE you should return the value stored in }{\cs17\f2\fs16 lResult}{
|
||||
without any further processing. }{\cs17\f2\fs16 IMDefWindowProc}{ mostly manages window activation and movement.
|
||||
\par
|
||||
\par }\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs28\lang3081\kerning28\cgrid {Keyman Imports
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
The DLL can call Keyman functions to interact with Keyman and the target application. It should not attempt to directly control the application as Keyman will be doing this. You should never call any of the functions here from the }{\cs17\f2\fs16
|
||||
KeymanIMConfigure}{ callback.
|
||||
\par
|
||||
\par You can use }{\cs17\f2\fs16 PrepIM()}{, declared in }{\cs21\f1\fs18 imlib.cpp}{ to get access to the the Keyman functions. When using }{\cs21\f1\fs18 imlib.cpp}{
|
||||
, the functions are declared as pointers, so you need to dereference them to call them in C (e.g. for }{\cs17\f2\fs16 KMGetContext}{, call }{\cs17\f2\fs16 (*KMGetcontext)(buf,len);}{
|
||||
\par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang3081\cgrid {KMGetContext
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {BOOL WINAPI KMGetContext(PWSTR buf, DWORD len);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par }{\cs17\f2\fs16 KMGetContext}{ returns the last }{\cs17\f2\fs16 len-1}{ characters of the context stack. If there are not enough characters in the context stack, it will return as many as it can. On success, the }{\cs17\f2\fs16 buf}{
|
||||
variable will be null terminated.
|
||||
\par
|
||||
\par The context stack can contain a special code for deadkeys. See }{\cs17\f2\fs16 KMQueueAction}{ for a way to output a deadkey. The code sequence for a deadkey is (3 words):
|
||||
\par
|
||||
\par }\pard\plain \s15\fi436\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {UC_SENTINEL, CODE_DEADKEY, }{\i deadkeyID}{
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par }{\cs17\f2\fs16 UC_SENTINEL}{ is }{\cs17\f2\fs16 0xFFFF}{; }{\cs17\f2\fs16 CODE_DEADKEY}{ is }{\cs17\f2\fs16 0x0008}{; }{\cs17\i\f2\fs16 deadkeyID}{ can be any value from }{\cs17\f2\fs16 0x0001}{ to }{\cs17\f2\fs16 0xFFFE}{.
|
||||
\par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang3081\cgrid {KMSetOutput
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {BOOL WINAPI KMSetOutput(PWSTR buf, DWORD backlen);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par }{\cs17\f2\fs16 KMSetOutput}{ is a wrapper for }{\cs17\f2\fs16 KMQueueAction}{. It simplifies the process of deleting contextual characte
|
||||
rs and outputting a new string. The results will not be output to the screen until the current function returns. If called within the context of an IMC window, the results will not be output to the screen until the window posts the }{\cs17\f2\fs16
|
||||
wm_keymanim_close}{ message.
|
||||
\par
|
||||
\par }{\cs17\f2\fs16 buf}{ is a pointer to a null-terminated string of characters to output.
|
||||
\par }{\cs17\f2\fs16 backlen}{ is the number of characters to backspace from the current context before displaying }{\cs17\f2\fs16 buf}{.
|
||||
\par
|
||||
\par This function modifies the context returned from }{\cs17\f2\fs16 KMGetContext}{, even if the output is not yet on the screen.
|
||||
\par
|
||||
\par Internally, this function does the following code:
|
||||
\par
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {while(backlen-- > 0) KMQueueAction(QIT_BACK, 0);
|
||||
\par while(*buf) KMQueueAction(QIT_CHAR, *buf++);
|
||||
\par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang3081\cgrid {KMQueueAction
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {BOOL WINAPI KMQueueAction(int itemType, DWORD dwData);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par KMQueueAction lets you send any Keyman action to a target application. This can be virtual keys, characters, shift keys up and down, deadkeys, beeps, or backspaces (a special case of virtual keys).
|
||||
\par
|
||||
\par }\trowd \trgaph108\trleft284\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr
|
||||
\brdrs\brdrw10 \cltxlrtb \cellx2519\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx6780\pard\plain \s16\widctlpar\intbl\adjustright \b\f1\fs16\lang3081\cgrid {itemType code\cell
|
||||
Description\cell }\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\row }\trowd \trgaph108\trleft284\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
|
||||
\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx2519\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx6780\pard
|
||||
\widctlpar\intbl\adjustright {\cs17\f2\fs16 QIT_VKEYDOWN\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {Simulate any key press on the keyboard; }{\b dwData}{ is the virtual key code\cell }\pard\plain
|
||||
\widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\row }\pard \widctlpar\intbl\adjustright {\cs17\f2\fs16 QIT_VKEYUP\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {Simulate any key release on the keyboard; }{\b dwData}{
|
||||
is the virtual key code\cell }\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\row }\pard \widctlpar\intbl\adjustright {\cs17\f2\fs16 QIT_VSHIFTDOWN\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {
|
||||
Simulate pressing a set of shift keys. }{\b dwData}{ can be a combination of the following flags:
|
||||
\par LCTRLFLAG, RCTRLFLAG, LALTFLAG, RALTFLAG, K_SHIFTFLAG, K_CTRLFLAG, K_ALTFLAG\cell }\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\row }\pard \widctlpar\intbl\adjustright {\cs17\f2\fs16 QIT_VSHIFTUP\cell }\pard\plain
|
||||
\s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {Release the shift state, }{\b dwData}{ is the same as the previous flags.\cell }\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\row }\pard \widctlpar\intbl\adjustright {
|
||||
\cs17\f2\fs16 QIT_CHAR\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {\b dwdata}{ is any WCHAR. For an ANSI window, zero-pad an 8-bit character.\cell }\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\row
|
||||
}\pard \widctlpar\intbl\adjustright {\cs17\f2\fs16 QIT_DEADKEY\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {\b dwData }{is any value from 0x0001 to 0xFFFE. This can be matched in the context with }{\b KMGetContext}{.\cell
|
||||
}\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\row }\pard \widctlpar\intbl\adjustright {\cs17\f2\fs16 QIT_BELL\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {\b dwData}{ should be zero (0).\cell }\pard\plain
|
||||
\widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\row }\trowd \trgaph108\trleft284\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \clvertalt\clbrdrt\brdrs\brdrw10
|
||||
\clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx2519\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx6780\pard \widctlpar\intbl\adjustright {
|
||||
\cs17\f2\fs16 QIT_BACK\cell }\pard\plain \s18\widctlpar\intbl\adjustright \f1\fs16\lang3081\cgrid {\b dwData}{ should be zero (0).\cell }\pard\plain \widctlpar\intbl\adjustright \fs20\lang3081\cgrid {\row }\pard\plain
|
||||
\s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang3081\cgrid {KMHideIM
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {BOOL WINAPI KMHideIM(HWND hwndIM);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par }{\cs17\f2\fs16 KMHideIM}{ hides the IMC window referred to by }{\cs17\f2\fs16 hwndIM}{ and ensures that Keyman processes input from the keyboard through the correct method. You should call this rather than hiding the window manually with }{
|
||||
\cs17\f2\fs16 ShowWindow(hwnd, SW_HIDE);}{ or post the message }{\cs17\f2\fs16 wm_keymanim_close}{ to hide the window.
|
||||
\par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang3081\cgrid {KMDisplayIM
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {BOOL WINAPI KMDisplayIM(HWND hwndIM, BOOL FCaptureAll);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par }{\cs17\f2\fs16 KMDisplayIM}{ displays the IMC window referred to by }{\cs17\f2\fs16 hwndIM}{. It does not do any movement of the window. If the }{\cs17\f2\fs16 FCaptureAll}{ flag is set, all keyboard input (character-generating keys only) will be red
|
||||
irected to the IMC window until the message }{\cs17\f2\fs16 wm_keymanim_close}{ is posted, }{\cs17\f2\fs16 KMHideIM}{ is called, or }{\cs17\f2\fs16 KMDisplayIM}{ with }{\cs17\f2\fs16 FCaptureAll}{ is set to false.
|
||||
\par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang3081\cgrid {KMGetKeyboardPath
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {BOOL WINAPI KMGetKeyboardPath(PSTR keyboardname, PWSTR dir, DWORD length);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par This function returns the full path to the keyboard referred to by }{\cs17\f2\fs16 keyboardname}{. The buffer }{\cs17\f2\fs16 dir}{ should be 260 characters long.
|
||||
\par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang3081\cgrid {KMGetActiveKeyboard
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {BOOL WINAPI KMGetActiveKeyboard(PSTR keyboardname, DWORD length);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par This function can be called while processing to determine which is the active keyboard. Alternatively, use the callbacks }{\cs17\f2\fs16 KeymanIMActivate}{ and }{\cs17\f2\fs16 KeymanIMDeactivate}{.
|
||||
\par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang3081\cgrid {KMSendDebugString
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {\cs17 BOOL WINAPI KMSendDebugString(PSTR str);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par This function outputs the string }{\cs17\f2\fs16 str}{ to the Keyman debug window or debug log file (usually }{\cs21\f1\fs18 c:\\keyman.log}{).
|
||||
\par }\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs28\lang3081\kerning28\cgrid {The Input Method Composition window
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {The IMC window can be shown or hidden at any time that the associated keyboard is active. This means that you can have an IMC window permanently open or open at appropriate times.
|
||||
\par
|
||||
\par The keyboard IMSample included with Keyman is a good example of manipulating the IMC display.
|
||||
\par
|
||||
\par The window should be created invisible, most probaly as a popup window. The window can use }{\cs17\f2\fs16 KMGetContext}{, }{\cs17\f2\fs16 KMSetOutput}{ at any time, but output will not be put to the screen until it has posted (}{\b not }{sent) }{
|
||||
\cs17\f2\fs16 wm_keymanim_close}{ to itself.
|
||||
\par }\pard\plain \s15\fi-425\li709\widctlpar\adjustright \f2\fs16\lang3081\cgrid {
|
||||
\par PostMessage(hwnd, wm_keymanim_close, (WPARAM) FSuccess, (LPARAM) FActuallyClose);
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {
|
||||
\par Keyman will manage the window display, focus, and message loop. The window procedure should set the position and size appropriately.
|
||||
\par
|
||||
\par Keyman will recognise this window and any child windows to be part of the IM and will not attempt to process any input that goes through the window.
|
||||
\par
|
||||
\par The IMC window must not take focus at any time.
|
||||
\par }\pard\plain \s3\sb120\keepn\widctlpar\outlinelevel2\adjustright \b\f1\fs20\lang3081\cgrid {Limitations
|
||||
\par {\pntext\pard\plain\fs20\cgrid \hich\af0\dbch\af0\loch\f0 1.\tab}}\pard\plain \fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls11\pnrnot0\pndec\pnstart1\pnindent360\pnhang{\pntxta .}}\ls11\adjustright \fs20\lang3081\cgrid {
|
||||
Clicks outside the window will cancel the IM and lose context.
|
||||
\par {\pntext\pard\plain\fs20\cgrid \hich\af0\dbch\af0\loch\f0 2.\tab}}\pard \fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls11\pnrnot0\pndec\pnstart1\pnindent360\pnhang{\pntxta .}}\ls11\adjustright {
|
||||
Switching applications will cancel the IM and lose context.
|
||||
\par }\pard \widctlpar\adjustright {
|
||||
\par }}
|
||||
|
|
@ -1,216 +0,0 @@
|
|||
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include "imlib.h"
|
||||
|
||||
HMODULE hModuleKeyman32 = 0;
|
||||
KMSetOutputProc KMSetOutput = NULL;
|
||||
KMGetContextProc KMGetContext = NULL;
|
||||
KMQueueActionProc KMQueueAction = NULL;
|
||||
KMDisplayIMProc KMDisplayIM = NULL;
|
||||
KMHideIMProc KMHideIM = NULL;
|
||||
KMGetActiveKeyboardProc KMGetActiveKeyboard = NULL;
|
||||
KMGetKeyboardPathProc KMGetKeyboardPath = NULL;
|
||||
|
||||
BOOL WINAPI IntKMGetKeyboardPath(PSTR kbdname, PSTR buf, DWORD len)
|
||||
{
|
||||
wsprintf(buf, "c:\\keyman\\imsample\\%s.kmx", kbdname);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PrepIM(void)
|
||||
{
|
||||
if(hModuleKeyman32 != 0) return TRUE;
|
||||
|
||||
hModuleKeyman32 = GetModuleHandle("keyman32.dll");
|
||||
if(hModuleKeyman32 == 0)
|
||||
{
|
||||
KMGetKeyboardPath = IntKMGetKeyboardPath;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
KMSetOutput = (KMSetOutputProc) GetProcAddress(hModuleKeyman32, "KMSetOutput");
|
||||
if(!KMSetOutput) return FALSE;
|
||||
|
||||
KMGetContext = (KMGetContextProc) GetProcAddress(hModuleKeyman32, "KMGetContext");
|
||||
if(!KMGetContext) return FALSE;
|
||||
|
||||
KMQueueAction = (KMQueueActionProc) GetProcAddress(hModuleKeyman32, "KMQueueAction");
|
||||
if(!KMQueueAction) return FALSE;
|
||||
|
||||
KMDisplayIM = (KMDisplayIMProc) GetProcAddress(hModuleKeyman32, "KMDisplayIM");
|
||||
if(!KMDisplayIM) return FALSE;
|
||||
|
||||
KMHideIM = (KMHideIMProc) GetProcAddress(hModuleKeyman32, "KMHideIM");
|
||||
if(!KMHideIM) return FALSE;
|
||||
|
||||
KMGetActiveKeyboard = (KMGetActiveKeyboardProc) GetProcAddress(hModuleKeyman32, "KMGetActiveKeyboard");
|
||||
if(!KMGetActiveKeyboard) return FALSE;
|
||||
|
||||
KMGetKeyboardPath = (KMGetKeyboardPathProc) GetProcAddress(hModuleKeyman32, "KMGetKeyboardPath");
|
||||
if(!KMGetKeyboardPath) return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// IMDefWindowProc returns TRUE if the window procedure should just return lResult, and
|
||||
// not process further.
|
||||
|
||||
HCURSOR GetHitTestCursor(HWND hwnd, LRESULT ht, LPRECT sizerect)
|
||||
{
|
||||
LPSTR cr = NULL;
|
||||
|
||||
memset(sizerect, 0, sizeof(RECT));
|
||||
|
||||
switch(ht)
|
||||
{
|
||||
case HTTOP: cr = IDC_SIZENS; sizerect->top = 1; break;
|
||||
case HTTOPLEFT: cr = IDC_SIZENWSE; sizerect->top = sizerect->left = 1; break;
|
||||
case HTTOPRIGHT: cr = IDC_SIZENESW; sizerect->top = sizerect->right = 1; break;
|
||||
case HTBOTTOM: cr = IDC_SIZENS; sizerect->bottom = 1; break;
|
||||
case HTBOTTOMLEFT: cr = IDC_SIZENESW; sizerect->bottom = sizerect->left = 1; break;
|
||||
case HTBOTTOMRIGHT: cr = IDC_SIZENWSE; sizerect->bottom = sizerect->right = 1; break;
|
||||
case HTLEFT: cr = IDC_SIZEWE; sizerect->left = 1; break;
|
||||
case HTRIGHT: cr = IDC_SIZEWE; sizerect->right = 1; break;
|
||||
default: return (HCURSOR) GetClassLong(hwnd, GCL_HCURSOR);
|
||||
}
|
||||
|
||||
return LoadCursor(NULL, cr);
|
||||
}
|
||||
|
||||
|
||||
BOOL IMDefWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
|
||||
{
|
||||
static POINT FLastPoint;
|
||||
static BOOL FMoveWindow=FALSE, FSizeWindow=FALSE;
|
||||
static RECT sizerect;
|
||||
static HCURSOR FHitTestCursor;
|
||||
|
||||
RECT rect;
|
||||
POINTS pt;
|
||||
POINT pt2;
|
||||
LRESULT ht;
|
||||
|
||||
switch(msg)
|
||||
{
|
||||
case WM_CREATE:
|
||||
PostMessage(hwnd, WM_NCACTIVATE, TRUE, 0);
|
||||
return FALSE;
|
||||
|
||||
case WM_NCACTIVATE:
|
||||
*lResult = DefWindowProc(hwnd, msg, TRUE, lParam);
|
||||
return TRUE;
|
||||
|
||||
case WM_NCHITTEST:
|
||||
*lResult = HTCLIENT;
|
||||
|
||||
if(FMoveWindow || FSizeWindow) return TRUE;
|
||||
|
||||
ht = DefWindowProc(hwnd, msg, wParam, lParam);
|
||||
SetCursor(FHitTestCursor = GetHitTestCursor(hwnd, ht, &sizerect));
|
||||
return TRUE;
|
||||
|
||||
case WM_MOUSEACTIVATE:
|
||||
*lResult = MA_NOACTIVATE;
|
||||
return TRUE;
|
||||
|
||||
case WM_LBUTTONDOWN:
|
||||
pt = MAKEPOINTS(lParam); pt2.x = pt.x; pt2.y = pt.y;
|
||||
ClientToScreen(hwnd, &pt2);
|
||||
|
||||
FMoveWindow = FALSE;
|
||||
FSizeWindow = FALSE;
|
||||
|
||||
ht = SendMessage(hwnd, WM_USER_NCHITTEST, 0, MAKELONG(pt2.x, pt2.y));
|
||||
switch(ht)
|
||||
{
|
||||
case HTCAPTION:
|
||||
FMoveWindow = TRUE;
|
||||
SetCapture(hwnd);
|
||||
FLastPoint = pt2;
|
||||
SetCursor(FHitTestCursor);
|
||||
return TRUE;
|
||||
|
||||
case HTTOP:
|
||||
case HTTOPLEFT:
|
||||
case HTTOPRIGHT:
|
||||
case HTBOTTOM:
|
||||
case HTBOTTOMLEFT:
|
||||
case HTBOTTOMRIGHT:
|
||||
case HTLEFT:
|
||||
case HTRIGHT:
|
||||
FSizeWindow = TRUE;
|
||||
SetCapture(hwnd);
|
||||
FLastPoint = pt2;
|
||||
SetCursor(FHitTestCursor);
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
return ht != HTCLIENT;
|
||||
}
|
||||
|
||||
case WM_MOUSEMOVE:
|
||||
GetWindowRect(hwnd, &rect);
|
||||
pt = MAKEPOINTS(lParam); pt2.x = pt.x; pt2.y = pt.y;
|
||||
ClientToScreen(hwnd, &pt2);
|
||||
|
||||
if(FMoveWindow)
|
||||
{
|
||||
MoveWindow(hwnd,
|
||||
rect.left+pt2.x - FLastPoint.x,
|
||||
rect.top+pt2.y - FLastPoint.y,
|
||||
rect.right-rect.left,
|
||||
rect.bottom-rect.top,
|
||||
TRUE);
|
||||
FLastPoint = pt2;
|
||||
SetCursor(FHitTestCursor);
|
||||
return TRUE;
|
||||
}
|
||||
else if(FSizeWindow)
|
||||
{
|
||||
POINT pt3 = pt2; pt3.x -= FLastPoint.x; pt3.y -= FLastPoint.y;
|
||||
RECT r2;
|
||||
r2.left = rect.left + pt3.x*sizerect.left;
|
||||
r2.top = rect.top + pt3.y*sizerect.top;
|
||||
r2.right = rect.right + pt3.x*sizerect.right;
|
||||
r2.bottom = rect.bottom + pt3.y*sizerect.bottom;
|
||||
if(r2.right - r2.left < 16)
|
||||
{
|
||||
r2.right = rect.right; r2.left = rect.left;
|
||||
}
|
||||
else FLastPoint.x = pt2.x;
|
||||
if(r2.bottom - r2.top < 10)
|
||||
{
|
||||
r2.bottom = rect.bottom; r2.top = rect.top;
|
||||
}
|
||||
else FLastPoint.y = pt2.y;
|
||||
|
||||
MoveWindow(hwnd,
|
||||
r2.left,
|
||||
r2.top,
|
||||
r2.right-r2.left,
|
||||
r2.bottom-r2.top,
|
||||
TRUE);
|
||||
|
||||
SetCursor(FHitTestCursor);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return SendMessage(hwnd, WM_USER_NCHITTEST, 0, MAKELONG(pt2.x, pt2.y)) != HTCLIENT;
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
if(FMoveWindow || FSizeWindow)
|
||||
{
|
||||
FMoveWindow = FSizeWindow = FALSE;
|
||||
ReleaseCapture();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
pt = MAKEPOINTS(lParam); pt2.x = pt.x; pt2.y = pt.y;
|
||||
ClientToScreen(hwnd, &pt2);
|
||||
|
||||
return SendMessage(hwnd, WM_USER_NCHITTEST, 0, MAKELONG(pt2.x, pt2.y)) != HTCLIENT;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
|
||||
#ifndef _IMLIB_H
|
||||
#define _IMLIB_H
|
||||
|
||||
#define QIT_VKEYDOWN 0
|
||||
#define QIT_VKEYUP 1
|
||||
#define QIT_VSHIFTDOWN 2
|
||||
#define QIT_VSHIFTUP 3
|
||||
#define QIT_CHAR 4
|
||||
#define QIT_DEADKEY 5
|
||||
#define QIT_BELL 6
|
||||
#define QIT_BACK 7
|
||||
|
||||
typedef BOOL (WINAPI *KMSetOutputProc)(PWSTR buf, DWORD backlen);
|
||||
typedef BOOL (WINAPI *KMGetContextProc)(PWSTR buf, DWORD len);
|
||||
typedef BOOL (WINAPI *KMQueueActionProc)(int action, DWORD dwData);
|
||||
typedef BOOL (WINAPI *KMDisplayIMProc)(HWND hwnd, BOOL FStayOpen);
|
||||
typedef BOOL (WINAPI *KMGetActiveKeyboardProc)(PSTR kbdname, DWORD len);
|
||||
typedef BOOL (WINAPI *KMHideIMProc)();
|
||||
typedef BOOL (WINAPI *KMGetKeyboardPathProc)(PSTR kbdname, PSTR buf, DWORD len);
|
||||
|
||||
extern HMODULE hModuleKeyman32;
|
||||
extern KMSetOutputProc KMSetOutput;
|
||||
extern KMGetContextProc KMGetContext;
|
||||
extern KMQueueActionProc KMQueueAction;
|
||||
extern KMDisplayIMProc KMDisplayIM;
|
||||
extern KMHideIMProc KMHideIM;
|
||||
extern KMGetActiveKeyboardProc KMGetActiveKeyboard;
|
||||
extern KMGetKeyboardPathProc KMGetKeyboardPath;
|
||||
|
||||
BOOL PrepIM(void);
|
||||
BOOL IMDefWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *lResult);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
|
||||
#define STRICT
|
||||
|
||||
#include <windows.h>
|
||||
#include "imlib.h"
|
||||
|
||||
/************************************************************************************************************
|
||||
* DLL entry functions
|
||||
************************************************************************************************************/
|
||||
|
||||
BOOL WINAPI DllEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
extern "C" BOOL __declspec(dllexport) WINAPI KeymanIMDestroy(PSTR keyboardname)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
extern "C" BOOL __declspec(dllexport) WINAPI KeymanIMInit(PSTR keyboardname)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
extern "C" BOOL __declspec(dllexport) WINAPI KeymanIMReloadConfig(PSTR keyboardname)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/************************************************************************************************************
|
||||
* IM Events
|
||||
************************************************************************************************************/
|
||||
|
||||
extern "C" BOOL __declspec(dllexport) WINAPI KeymanIMActivate(PSTR keyboardname)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
extern "C" BOOL __declspec(dllexport) WINAPI KeymanIMDeactivate(PSTR keyboardname)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
extern "C" BOOL __declspec(dllexport) WINAPI DF(HWND hwndFocus, WORD KeyStroke, WCHAR KeyChar, DWORD shiftFlags)
|
||||
{
|
||||
if(!PrepIM()) return FALSE;
|
||||
if(KeyChar == L'a') (*KMSetOutput)(L"Tavultesoft Keyman 5.1", 0);
|
||||
}
|
||||
|
||||
/************************************************************************************************************
|
||||
* IM Configuration
|
||||
************************************************************************************************************/
|
||||
|
||||
extern "C" BOOL __declspec(dllexport) WINAPI KeymanIMConfigure(PSTR keyboardname, HWND hwndParent)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
LIBRARY IMSAMPLE
|
||||
|
||||
EXPORTS
|
||||
DF
|
||||
KeymanIMInit
|
||||
KeymanIMDestroy
|
||||
KeymanIMActivate
|
||||
KeymanIMDeactivate
|
||||
KeymanIMConfigure
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
VERSION 5.0
|
||||
NAME "IMTest"
|
||||
|
||||
store(DLLFunction) "imsample.dll:DF"
|
||||
|
||||
begin Unicode > use(main)
|
||||
|
||||
group(main) using keys
|
||||
|
||||
+ [K_BKSP] > call(DLLFunction)
|
||||
+ [K_ESC] > call(DLLFunction)
|
||||
nomatch > call(DLLFunction)
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
|
||||
{\f16\froman\fcharset238\fprq2 Times New Roman CE;}{\f17\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f19\froman\fcharset161\fprq2 Times New Roman Greek;}{\f20\froman\fcharset162\fprq2 Times New Roman Tur;}
|
||||
{\f21\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f22\fswiss\fcharset238\fprq2 Arial CE;}{\f23\fswiss\fcharset204\fprq2 Arial Cyr;}{\f25\fswiss\fcharset161\fprq2 Arial Greek;}{\f26\fswiss\fcharset162\fprq2 Arial Tur;}
|
||||
{\f27\fswiss\fcharset186\fprq2 Arial Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;
|
||||
\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\widctlpar\adjustright \fs20\lang3081\cgrid \snext0 Normal;}{
|
||||
\s1\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\lang3081\kerning28\cgrid \sbasedon0 \snext0 heading 1;}{\*\cs10 \additive Default Paragraph Font;}}{\info{\title 4 June 2001}{\author Marc Durdin}{\operator Marc Durdin}
|
||||
{\creatim\yr2001\mo6\dy5\hr11\min48}{\revtim\yr2001\mo6\dy12\hr15\min57}{\version3}{\edmins1}{\nofpages1}{\nofwords277}{\nofchars1581}{\*\company Tavultesoft}{\nofcharsws0}{\vern89}}\paperw11906\paperh16838
|
||||
\widowctrl\ftnbj\aenddoc\hyphcaps0\formshade\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot \fet0\sectd \linex0\headery709\footery709\colsx709\endnhere\sectdefaultcl {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2
|
||||
\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6
|
||||
\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang
|
||||
{\pntxtb (}{\pntxta )}}\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs28\lang3081\kerning28\cgrid {4 June 2001
|
||||
\par IMSample Current Implementation
|
||||
\par }\pard\plain \widctlpar\adjustright \fs20\lang3081\cgrid {The current implementation of IMSample has three modes. The sample definition file I included (imsample.txt) contains definitions for the letters "a", "e" and "o".
|
||||
\par
|
||||
\par This example works only with Unicode and has not been tested on Windows 95/98. The final solution will be tested. It may work, but I haven't tried it.
|
||||
\par
|
||||
\par 1. Direct input (menu appears in text, similar to Peter Hauer's FCI Chinese keyboard)
|
||||
\par 2. Menu displayed on vowels. The window below is displayed when "a" is pressed.
|
||||
\par }{\lang1024 [Image deleted to save space]
|
||||
\par 3. Menu always visible, changes when keys pressed or menu clicked. The initial state of the menu is:}{
|
||||
\par }{\lang1024 [Image deleted to save space]
|
||||
\par It then changes to the same as the previous window, when "a" is pressed, or the "a" in the window is clicked with the mouse.
|
||||
\par
|
||||
\par The window can be dragged around with the title bar, and it will stay where it last was put. This position is global to all applications.
|
||||
\par
|
||||
\par We tried to use the caret (blinking cursor) position, but some apps (e.g. MS Word) create their own caret and don't use the Windows routines, so this wasn't reliable.
|
||||
\par
|
||||
\par To change the configuration of the imsample.dll, run the program rconfig.exe. This will later be integrated into the Keyman shell interface (specifically the Configuration dialog will
|
||||
have a separate configure button that is activated when the appropriate keyboard is selected for configuration). }{
|
||||
\par
|
||||
\par If you install this keyboard into Keyman, the imsample.dll and imsample.txt files should be copied into the directory of the keyboard. In Win2K this will be
|
||||
\par }{\f1\fs16 \\documents and settings\\all users\\application data\\tavultesoft\\keyman\\keyboards\\imsample
|
||||
\par }{or
|
||||
\par }{\f1\fs16 \\documents and settings\\}{\b\i\f1\fs16 yourname}{\f1\fs16 \\local settings\\application data\\tavultesoft\\keyman\\keyboards\\imsample
|
||||
\par }{
|
||||
\par In Win95/98, it will be:
|
||||
\par }{\f1\fs16 \\program files\\tavultesoft\\keyman\\keyboards\\imsample
|
||||
\par }{
|
||||
\par With only a bit more work, this IME sample could be usable for just about any menu-type keyboard.
|
||||
\par
|
||||
\par }}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
1 VERSIONINFO
|
||||
FILEVERSION 5,0,108,0
|
||||
PRODUCTVERSION 5,0,108,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
FILEFLAGS 0x0L
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "0C0904E4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", KV_COMPANY_NAME
|
||||
VALUE "FileDescription", "Keyman IM Sample\0"
|
||||
VALUE "FileVersion", "5.0.108.0\0"
|
||||
VALUE "InternalName", "IMSAMPLE\0"
|
||||
VALUE "LegalCopyright", KV_LEGAL_COPYRIGHT
|
||||
VALUE "LegalTrademarks", KV_LEGAL_TRADEMARKS
|
||||
VALUE "OriginalFilename", "IMSAMPLE.DLL\0"
|
||||
VALUE "ProductName", "SIL International Keyman Developer\0"
|
||||
VALUE "ProductVersion", "5.0.108.0\0"
|
||||
VALUE "Comments", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0xc09, 1252
|
||||
END
|
||||
END
|
||||
Loading…
Add table
Reference in a new issue