https://git.reactos.org/?p=reactos.git;a=commitdiff;h=166786061cb1c3a3c11c4…
commit 166786061cb1c3a3c11c4d5adbe46c818e7d405a
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Thu Mar 31 13:52:16 2022 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu Mar 31 13:52:16 2022 +0900
[IMM32] Renaming about IME layout (#4419)
CORE-11700
---
dll/win32/imm32/candidate.c | 4 ++--
dll/win32/imm32/ime.c | 38 +++++++++++++++++++-------------------
dll/win32/imm32/precomp.h | 12 ++++++------
dll/win32/imm32/utils.c | 17 +++++++++++------
4 files changed, 38 insertions(+), 33 deletions(-)
diff --git a/dll/win32/imm32/candidate.c b/dll/win32/imm32/candidate.c
index 43f4e8d03c1..5d280f60ff4 100644
--- a/dll/win32/imm32/candidate.c
+++ b/dll/win32/imm32/candidate.c
@@ -400,7 +400,7 @@ BOOL WINAPI ImmSetCandidateWindow(HIMC hIMC, LPCANDIDATEFORM
lpCandidate)
ImmUnlockIMC(hIMC);
- Imm32NotifyAction(hIMC, hWnd, NI_CONTEXTUPDATED, 0, IMC_SETCANDIDATEPOS,
- IMN_SETCANDIDATEPOS, (1 << (BYTE)lpCandidate->dwIndex));
+ Imm32MakeIMENotify(hIMC, hWnd, NI_CONTEXTUPDATED, 0, IMC_SETCANDIDATEPOS,
+ IMN_SETCANDIDATEPOS, (1 << (BYTE)lpCandidate->dwIndex));
return TRUE;
}
diff --git a/dll/win32/imm32/ime.c b/dll/win32/imm32/ime.c
index 1b78374e07e..5dddb1b0f78 100644
--- a/dll/win32/imm32/ime.c
+++ b/dll/win32/imm32/ime.c
@@ -549,11 +549,11 @@ HKL WINAPI ImmInstallIMEW(LPCWSTR lpszIMEFileName, LPCWSTR
lpszLayoutText)
return NULL;
/* Get the IME layouts from registry */
- cLayouts = Imm32GetRegImes(NULL, 0);
+ cLayouts = Imm32GetImeLayout(NULL, 0);
if (cLayouts)
{
pLayouts = ImmLocalAlloc(0, cLayouts * sizeof(REG_IME));
- if (!pLayouts || !Imm32GetRegImes(pLayouts, cLayouts))
+ if (!pLayouts || !Imm32GetImeLayout(pLayouts, cLayouts))
{
ImmLocalFree(pLayouts);
return NULL;
@@ -585,19 +585,19 @@ HKL WINAPI ImmInstallIMEW(LPCWSTR lpszIMEFileName, LPCWSTR
lpszLayoutText)
/* If the source and the destination pathnames were different, then copy the IME file
*/
if (lstrcmpiW(szImeFileName, szImeDestPath) != 0 &&
- !Imm32CopyFile(szImeFileName, szImeDestPath))
+ !Imm32CopyImeFile(szImeFileName, szImeDestPath))
{
hNewKL = NULL;
goto Quit;
}
if (hNewKL == NULL)
- hNewKL = Imm32GetNextHKL(cLayouts, pLayouts, wLangID);
+ hNewKL = Imm32AssignNewLayout(cLayouts, pLayouts, wLangID);
if (hNewKL)
{
/* Write the IME layout to registry */
- if (Imm32WriteRegIme(hNewKL, pchFilePart, lpszLayoutText))
+ if (Imm32WriteImeLayout(hNewKL, pchFilePart, lpszLayoutText))
{
/* Load the keyboard layout */
Imm32UIntToStr((DWORD)(DWORD_PTR)hNewKL, 16, szImeKey, _countof(szImeKey));
@@ -1184,8 +1184,8 @@ BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
if (bHasChange)
{
- Imm32NotifyAction(hIMC, hWnd, NI_CONTEXTUPDATED, 0,
- IMC_SETOPENSTATUS, IMN_SETOPENSTATUS, 0);
+ Imm32MakeIMENotify(hIMC, hWnd, NI_CONTEXTUPDATED, 0,
+ IMC_SETOPENSTATUS, IMN_SETOPENSTATUS, 0);
NtUserNotifyIMEStatus(hWnd, fOpen, dwConversion);
}
@@ -1237,8 +1237,8 @@ BOOL WINAPI ImmSetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
ImmUnlockIMC(hIMC);
- Imm32NotifyAction(hIMC, hWnd, NI_CONTEXTUPDATED, 0,
- IMC_SETSTATUSWINDOWPOS, IMN_SETSTATUSWINDOWPOS, 0);
+ Imm32MakeIMENotify(hIMC, hWnd, NI_CONTEXTUPDATED, 0,
+ IMC_SETSTATUSWINDOWPOS, IMN_SETSTATUSWINDOWPOS, 0);
return TRUE;
}
@@ -1288,8 +1288,8 @@ BOOL WINAPI ImmSetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM
lpCompForm)
ImmUnlockIMC(hIMC);
- Imm32NotifyAction(hIMC, hWnd, NI_CONTEXTUPDATED, 0,
- IMC_SETCOMPOSITIONWINDOW, IMN_SETCOMPOSITIONWINDOW, 0);
+ Imm32MakeIMENotify(hIMC, hWnd, NI_CONTEXTUPDATED, 0,
+ IMC_SETCOMPOSITIONWINDOW, IMN_SETCOMPOSITIONWINDOW, 0);
return TRUE;
}
@@ -1418,8 +1418,8 @@ BOOL WINAPI ImmSetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
ImmUnlockIMC(hIMC);
- Imm32NotifyAction(hIMC, hWnd, NI_CONTEXTUPDATED, 0, IMC_SETCOMPOSITIONFONT,
- IMN_SETCOMPOSITIONFONT, 0);
+ Imm32MakeIMENotify(hIMC, hWnd, NI_CONTEXTUPDATED, 0, IMC_SETCOMPOSITIONFONT,
+ IMN_SETCOMPOSITIONFONT, 0);
return TRUE;
}
@@ -1476,8 +1476,8 @@ BOOL WINAPI ImmSetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
ImmUnlockIMC(hIMC);
- Imm32NotifyAction(hIMC, hWnd, NI_CONTEXTUPDATED, 0, IMC_SETCOMPOSITIONFONT,
- IMN_SETCOMPOSITIONFONT, 0);
+ Imm32MakeIMENotify(hIMC, hWnd, NI_CONTEXTUPDATED, 0, IMC_SETCOMPOSITIONFONT,
+ IMN_SETCOMPOSITIONFONT, 0);
return TRUE;
}
@@ -1657,16 +1657,16 @@ BOOL WINAPI ImmSetConversionStatus(HIMC hIMC, DWORD fdwConversion,
DWORD fdwSent
if (fConversionChange || fUseCicero)
{
- Imm32NotifyAction(hIMC, hWnd, NI_CONTEXTUPDATED, dwOldConversion,
- IMC_SETCONVERSIONMODE, IMN_SETCONVERSIONMODE, 0);
+ Imm32MakeIMENotify(hIMC, hWnd, NI_CONTEXTUPDATED, dwOldConversion,
+ IMC_SETCONVERSIONMODE, IMN_SETCONVERSIONMODE, 0);
if (fConversionChange)
NtUserNotifyIMEStatus(hWnd, fOpen, fdwConversion);
}
if (fSentenceChange || fUseCicero)
{
- Imm32NotifyAction(hIMC, hWnd, NI_CONTEXTUPDATED, dwOldSentence,
- IMC_SETSENTENCEMODE, IMN_SETSENTENCEMODE, 0);
+ Imm32MakeIMENotify(hIMC, hWnd, NI_CONTEXTUPDATED, dwOldSentence,
+ IMC_SETSENTENCEMODE, IMN_SETSENTENCEMODE, 0);
}
return TRUE;
diff --git a/dll/win32/imm32/precomp.h b/dll/win32/imm32/precomp.h
index 832d9bb1e77..f4a5dd4c33f 100644
--- a/dll/win32/imm32/precomp.h
+++ b/dll/win32/imm32/precomp.h
@@ -124,8 +124,8 @@ CandidateListAnsiToWide(const CANDIDATELIST *pAnsiCL, LPCANDIDATELIST
pWideCL, D
UINT uCodePage);
BOOL APIENTRY
-Imm32NotifyAction(HIMC hIMC, HWND hwnd, DWORD dwAction, DWORD_PTR dwIndex, DWORD_PTR
dwValue,
- DWORD_PTR dwCommand, DWORD_PTR dwData);
+Imm32MakeIMENotify(HIMC hIMC, HWND hwnd, DWORD dwAction, DWORD_PTR dwIndex, DWORD_PTR
dwValue,
+ DWORD_PTR dwCommand, DWORD_PTR dwData);
DWORD APIENTRY Imm32AllocAndBuildHimcList(DWORD dwThreadId, HIMC **pphList);
@@ -152,10 +152,10 @@ Imm32ReconvertWideFromAnsi(LPRECONVERTSTRING pDest, const
RECONVERTSTRING *pSrc,
HRESULT APIENTRY Imm32StrToUInt(LPCWSTR pszText, LPDWORD pdwValue, ULONG nBase);
HRESULT APIENTRY Imm32UIntToStr(DWORD dwValue, ULONG nBase, LPWSTR pszBuff, USHORT
cchBuff);
BOOL APIENTRY Imm32LoadImeVerInfo(PIMEINFOEX pImeInfoEx);
-UINT APIENTRY Imm32GetRegImes(PREG_IME pLayouts, UINT cLayouts);
-BOOL APIENTRY Imm32WriteRegIme(HKL hKL, LPCWSTR pchFilePart, LPCWSTR pszLayout);
-HKL APIENTRY Imm32GetNextHKL(UINT cKLs, const REG_IME *pLayouts, WORD wLangID);
-BOOL APIENTRY Imm32CopyFile(LPWSTR pszOldFile, LPCWSTR pszNewFile);
+UINT APIENTRY Imm32GetImeLayout(PREG_IME pLayouts, UINT cLayouts);
+BOOL APIENTRY Imm32WriteImeLayout(HKL hKL, LPCWSTR pchFilePart, LPCWSTR pszLayout);
+HKL APIENTRY Imm32AssignNewLayout(UINT cKLs, const REG_IME *pLayouts, WORD wLangID);
+BOOL APIENTRY Imm32CopyImeFile(LPWSTR pszOldFile, LPCWSTR pszNewFile);
static inline PTHREADINFO FASTCALL Imm32CurrentPti(VOID)
{
diff --git a/dll/win32/imm32/utils.c b/dll/win32/imm32/utils.c
index d73eb170a74..1195c6655b6 100644
--- a/dll/win32/imm32/utils.c
+++ b/dll/win32/imm32/utils.c
@@ -229,9 +229,10 @@ LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
return HeapAlloc(ghImmHeap, dwFlags, dwBytes);
}
+// Win: MakeIMENotify
BOOL APIENTRY
-Imm32NotifyAction(HIMC hIMC, HWND hwnd, DWORD dwAction, DWORD_PTR dwIndex, DWORD_PTR
dwValue,
- DWORD_PTR dwCommand, DWORD_PTR dwData)
+Imm32MakeIMENotify(HIMC hIMC, HWND hwnd, DWORD dwAction, DWORD_PTR dwIndex, DWORD_PTR
dwValue,
+ DWORD_PTR dwCommand, DWORD_PTR dwData)
{
DWORD dwThreadId;
HKL hKL;
@@ -668,7 +669,8 @@ Quit:
return ret;
}
-HKL APIENTRY Imm32GetNextHKL(UINT cKLs, const REG_IME *pLayouts, WORD wLangID)
+// Win: AssignNewLayout
+HKL APIENTRY Imm32AssignNewLayout(UINT cKLs, const REG_IME *pLayouts, WORD wLangID)
{
UINT iKL, wID, wLow = 0xE0FF, wHigh = 0xE01F, wNextID = 0;
@@ -713,7 +715,8 @@ HKL APIENTRY Imm32GetNextHKL(UINT cKLs, const REG_IME *pLayouts, WORD
wLangID)
return (HKL)(DWORD_PTR)MAKELONG(wLangID, wNextID);
}
-UINT APIENTRY Imm32GetRegImes(PREG_IME pLayouts, UINT cLayouts)
+// Win: GetImeLayout
+UINT APIENTRY Imm32GetImeLayout(PREG_IME pLayouts, UINT cLayouts)
{
HKEY hkeyLayouts, hkeyIME;
WCHAR szImeFileName[80], szImeKey[20];
@@ -780,7 +783,8 @@ UINT APIENTRY Imm32GetRegImes(PREG_IME pLayouts, UINT cLayouts)
return nCount;
}
-BOOL APIENTRY Imm32WriteRegIme(HKL hKL, LPCWSTR pchFilePart, LPCWSTR pszLayout)
+// Win: WriteImeLayout
+BOOL APIENTRY Imm32WriteImeLayout(HKL hKL, LPCWSTR pchFilePart, LPCWSTR pszLayout)
{
UINT iPreload;
HKEY hkeyLayouts, hkeyIME, hkeyPreload;
@@ -876,7 +880,8 @@ typedef INT (WINAPI *FN_LZOpenFileW)(LPWSTR, LPOFSTRUCT, WORD);
typedef LONG (WINAPI *FN_LZCopy)(INT, INT);
typedef VOID (WINAPI *FN_LZClose)(INT);
-BOOL APIENTRY Imm32CopyFile(LPWSTR pszOldFile, LPCWSTR pszNewFile)
+// Win: CopyImeFile
+BOOL APIENTRY Imm32CopyImeFile(LPWSTR pszOldFile, LPCWSTR pszNewFile)
{
BOOL ret = FALSE, bLoaded = FALSE;
HMODULE hinstLZ32;