mirror of
https://github.com/glfw/glfw
synced 2026-09-26 16:18:21 +03:00
WIN32: Better support for IME
This commit is contained in:
parent
cd151e1de3
commit
de0574f1ea
3 changed files with 9 additions and 1 deletions
|
|
@ -182,6 +182,8 @@ static GLFWbool loadLibraries(void)
|
|||
_glfwPlatformGetModuleSymbol(_glfw.win32.imm32.instance, "ImmNotifyIME");
|
||||
_glfw.win32.imm32.ImmReleaseContext_ = (PFN_ImmReleaseContext)
|
||||
_glfwPlatformGetModuleSymbol(_glfw.win32.imm32.instance, "ImmReleaseContext");
|
||||
_glfw.win32.imm32.ImmSetCompositionWindow_ = (PFN_ImmSetCompositionWindow)
|
||||
_glfwPlatformGetModuleSymbol(_glfw.win32.imm32.instance, "ImmSetCompositionWindow");
|
||||
_glfw.win32.imm32.ImmSetCandidateWindow_ = (PFN_ImmSetCandidateWindow)
|
||||
_glfwPlatformGetModuleSymbol(_glfw.win32.imm32.instance, "ImmSetCandidateWindow");
|
||||
_glfw.win32.imm32.ImmSetOpenStatus_ = (PFN_ImmSetOpenStatus)
|
||||
|
|
|
|||
|
|
@ -268,6 +268,7 @@ typedef UINT (WINAPI * PFN_ImmGetDescriptionW)(HKL,LPWSTR,UINT);
|
|||
typedef BOOL (WINAPI * PFN_ImmGetOpenStatus)(HIMC);
|
||||
typedef BOOL (WINAPI * PFN_ImmNotifyIME)(HIMC,DWORD,DWORD,DWORD);
|
||||
typedef BOOL (WINAPI * PFN_ImmReleaseContext)(HWND,HIMC);
|
||||
typedef BOOL (WINAPI * PFN_ImmSetCompositionWindow)(HIMC,LPCOMPOSITIONFORM);
|
||||
typedef BOOL (WINAPI * PFN_ImmSetCandidateWindow)(HIMC,LPCANDIDATEFORM);
|
||||
typedef BOOL (WINAPI * PFN_ImmSetOpenStatus)(HIMC,BOOL);
|
||||
#define ImmGetCandidateListW _glfw.win32.imm32.ImmGetCandidateListW_
|
||||
|
|
@ -278,6 +279,7 @@ typedef BOOL (WINAPI * PFN_ImmSetOpenStatus)(HIMC,BOOL);
|
|||
#define ImmGetOpenStatus _glfw.win32.imm32.ImmGetOpenStatus_
|
||||
#define ImmNotifyIME _glfw.win32.imm32.ImmNotifyIME_
|
||||
#define ImmReleaseContext _glfw.win32.imm32.ImmReleaseContext_
|
||||
#define ImmSetCompositionWindow _glfw.win32.imm32.ImmSetCompositionWindow_
|
||||
#define ImmSetCandidateWindow _glfw.win32.imm32.ImmSetCandidateWindow_
|
||||
#define ImmSetOpenStatus _glfw.win32.imm32.ImmSetOpenStatus_
|
||||
|
||||
|
|
@ -476,6 +478,7 @@ typedef struct _GLFWlibraryWin32
|
|||
PFN_ImmGetOpenStatus ImmGetOpenStatus_;
|
||||
PFN_ImmNotifyIME ImmNotifyIME_;
|
||||
PFN_ImmReleaseContext ImmReleaseContext_;
|
||||
PFN_ImmSetCompositionWindow ImmSetCompositionWindow_;
|
||||
PFN_ImmSetCandidateWindow ImmSetCandidateWindow_;
|
||||
PFN_ImmSetOpenStatus ImmSetOpenStatus_;
|
||||
} imm32;
|
||||
|
|
|
|||
|
|
@ -2855,8 +2855,11 @@ void _glfwUpdatePreeditCursorRectangleWin32(_GLFWwindow* window)
|
|||
int y = preedit->cursorPosY;
|
||||
int w = preedit->cursorWidth;
|
||||
int h = preedit->cursorHeight;
|
||||
CANDIDATEFORM excludeRect = { 0, CFS_EXCLUDE, { x, y }, { x, y, x + w, y + h } };
|
||||
|
||||
COMPOSITIONFORM areaRect = { CFS_RECT, { x, y }, { x, y, x + w, y + h } };
|
||||
ImmSetCompositionWindow(hIMC, &areaRect);
|
||||
|
||||
CANDIDATEFORM excludeRect = { 0, CFS_EXCLUDE, { x, y }, { x, y, x + w, y + h } };
|
||||
ImmSetCandidateWindow(hIMC, &excludeRect);
|
||||
|
||||
ImmReleaseContext(hWnd, hIMC);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue