ReactOS  0.4.15-dev-5112-g22d8c0f
immdev.h
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS headers
3  * LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
4  * PURPOSE: Providing DDK-compatible <immdev.h> and IME/IMM development helper
5  * COPYRIGHT: Copyright 2021-2022 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6  */
7 
8 #ifndef _IMMDEV_
9 #define _IMMDEV_
10 
11 #pragma once
12 
13 #include <wingdi.h>
14 #include <imm.h>
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 /* wParam for WM_IME_CONTROL */
21 #define IMC_GETCONVERSIONMODE 0x0001
22 #define IMC_GETSENTENCEMODE 0x0003
23 #define IMC_GETOPENSTATUS 0x0005
24 #define IMC_GETSOFTKBDPOS 0x0013
25 #define IMC_SETSOFTKBDPOS 0x0014
26 
27 /* wParam for WM_IME_SYSTEM */
28 #define IMS_NOTIFYIMESHOW 0x05
29 #define IMS_UPDATEIMEUI 0x06
30 #define IMS_SETCANDFORM 0x09
31 #define IMS_SETCOMPFONT 0x0A
32 #define IMS_SETCOMPFORM 0x0B
33 #define IMS_CONFIGURE 0x0D
34 #define IMS_SETOPENSTATUS 0x0F
35 #define IMS_FREELAYOUT 0x11
36 #define IMS_GETCONVSTATUS 0x14
37 #define IMS_IMEHELP 0x15
38 #define IMS_IMEACTIVATE 0x17
39 #define IMS_IMEDEACTIVATE 0x18
40 #define IMS_ACTIVATELAYOUT 0x19
41 #define IMS_GETIMEMENU 0x1C
42 #define IMS_GETCONTEXT 0x1E
43 #define IMS_SENDNOTIFICATION 0x1F
44 #define IMS_COMPLETECOMPSTR 0x20
45 #define IMS_LOADTHREADLAYOUT 0x21
46 #define IMS_SETLANGBAND 0x23
47 #define IMS_UNSETLANGBAND 0x24
48 
49 #define IMMGWL_IMC 0
50 #define IMMGWL_PRIVATE (sizeof(LONG))
51 
52 #define IMMGWLP_IMC 0
53 #define IMMGWLP_PRIVATE (sizeof(LONG_PTR))
54 
55 typedef struct _tagINPUTCONTEXT {
62  union {
65  } lfFont;
77 
78 #ifdef _WIN64
80 C_ASSERT(offsetof(INPUTCONTEXT, fOpen) == 0x8);
81 C_ASSERT(offsetof(INPUTCONTEXT, ptStatusWndPos) == 0xc);
82 C_ASSERT(offsetof(INPUTCONTEXT, ptSoftKbdPos) == 0x14);
83 C_ASSERT(offsetof(INPUTCONTEXT, fdwConversion) == 0x1c);
84 C_ASSERT(offsetof(INPUTCONTEXT, fdwSentence) == 0x20);
85 C_ASSERT(offsetof(INPUTCONTEXT, lfFont) == 0x24);
86 C_ASSERT(offsetof(INPUTCONTEXT, cfCompForm) == 0x80);
87 C_ASSERT(offsetof(INPUTCONTEXT, cfCandForm) == 0x9c);
88 C_ASSERT(offsetof(INPUTCONTEXT, hCompStr) == 0x120);
89 C_ASSERT(offsetof(INPUTCONTEXT, hCandInfo) == 0x128);
90 C_ASSERT(offsetof(INPUTCONTEXT, hGuideLine) == 0x130);
91 C_ASSERT(offsetof(INPUTCONTEXT, hPrivate) == 0x138);
92 C_ASSERT(offsetof(INPUTCONTEXT, dwNumMsgBuf) == 0x140);
93 C_ASSERT(offsetof(INPUTCONTEXT, hMsgBuf) == 0x148);
94 C_ASSERT(offsetof(INPUTCONTEXT, fdwInit) == 0x150);
95 C_ASSERT(offsetof(INPUTCONTEXT, dwReserve) == 0x154);
96 C_ASSERT(sizeof(INPUTCONTEXT) == 0x160);
97 #else
99 C_ASSERT(offsetof(INPUTCONTEXT, fOpen) == 0x4);
100 C_ASSERT(offsetof(INPUTCONTEXT, ptStatusWndPos) == 0x8);
101 C_ASSERT(offsetof(INPUTCONTEXT, ptSoftKbdPos) == 0x10);
102 C_ASSERT(offsetof(INPUTCONTEXT, fdwConversion) == 0x18);
103 C_ASSERT(offsetof(INPUTCONTEXT, fdwSentence) == 0x1c);
104 C_ASSERT(offsetof(INPUTCONTEXT, lfFont) == 0x20);
105 C_ASSERT(offsetof(INPUTCONTEXT, cfCompForm) == 0x7c);
106 C_ASSERT(offsetof(INPUTCONTEXT, cfCandForm) == 0x98);
107 C_ASSERT(offsetof(INPUTCONTEXT, hCompStr) == 0x118);
108 C_ASSERT(offsetof(INPUTCONTEXT, hCandInfo) == 0x11c);
109 C_ASSERT(offsetof(INPUTCONTEXT, hGuideLine) == 0x120);
110 C_ASSERT(offsetof(INPUTCONTEXT, hPrivate) == 0x124);
111 C_ASSERT(offsetof(INPUTCONTEXT, dwNumMsgBuf) == 0x128);
112 C_ASSERT(offsetof(INPUTCONTEXT, hMsgBuf) == 0x12c);
113 C_ASSERT(offsetof(INPUTCONTEXT, fdwInit) == 0x130);
114 C_ASSERT(offsetof(INPUTCONTEXT, dwReserve) == 0x134);
115 C_ASSERT(sizeof(INPUTCONTEXT) == 0x140);
116 #endif
117 
118 struct IME_STATE;
119 
120 typedef struct INPUTCONTEXTDX /* unconfirmed */
121 {
128  struct IME_STATE *pState;
132 
133 #ifndef _WIN64
134 C_ASSERT(offsetof(INPUTCONTEXTDX, nVKey) == 0x140);
135 C_ASSERT(offsetof(INPUTCONTEXTDX, bNeedsTrans) == 0x144);
136 C_ASSERT(offsetof(INPUTCONTEXTDX, dwUIFlags) == 0x14c);
137 C_ASSERT(offsetof(INPUTCONTEXTDX, pState) == 0x154);
138 C_ASSERT(offsetof(INPUTCONTEXTDX, dwChange) == 0x158);
139 C_ASSERT(sizeof(INPUTCONTEXTDX) == 0x160);
140 #endif
141 
142 // bits of fdwInit of INPUTCONTEXT
143 #define INIT_STATUSWNDPOS 0x00000001
144 #define INIT_CONVERSION 0x00000002
145 #define INIT_SENTENCE 0x00000004
146 #define INIT_LOGFONT 0x00000008
147 #define INIT_COMPFORM 0x00000010
148 #define INIT_SOFTKBDPOS 0x00000020
149 
150 // bits for INPUTCONTEXTDX.dwChange
151 #define INPUTCONTEXTDX_CHANGE_OPEN 0x1
152 #define INPUTCONTEXTDX_CHANGE_CONVERSION 0x2
153 #define INPUTCONTEXTDX_CHANGE_SENTENCE 0x4
154 #define INPUTCONTEXTDX_CHANGE_FORCE_OPEN 0x100
155 
156 #ifndef WM_IME_REPORT
157  #define WM_IME_REPORT 0x280
158 #endif
159 
160 // WM_IME_REPORT wParam
161 #define IR_STRINGSTART 0x100
162 #define IR_STRINGEND 0x101
163 #define IR_OPENCONVERT 0x120
164 #define IR_CHANGECONVERT 0x121
165 #define IR_CLOSECONVERT 0x122
166 #define IR_FULLCONVERT 0x123
167 #define IR_IMESELECT 0x130
168 #define IR_STRING 0x140
169 #define IR_DBCSCHAR 0x160
170 #define IR_UNDETERMINE 0x170
171 #define IR_STRINGEX 0x180
172 #define IR_MODEINFO 0x190
173 
174 // for IR_UNDETERMINE
175 typedef struct tagUNDETERMINESTRUCT
176 {
192 
194 
195 typedef struct IME_SUBSTATE
196 {
201 
202 #ifndef _WIN64
203 C_ASSERT(sizeof(IME_SUBSTATE) == 0xc);
204 #endif
205 
206 typedef struct IME_STATE
207 {
208  struct IME_STATE *pNext;
216 
217 #ifndef _WIN64
218 C_ASSERT(sizeof(IME_STATE) == 0x18);
219 #endif
220 
221 #ifdef __cplusplus
222 } // extern "C"
223 #endif
224 
225 #endif /* ndef _IMMDEV_ */
DWORD HIMCC
Definition: dimm.idl:76
LOGFONTA A
Definition: immdev.h:63
DWORD dwUIFlags
Definition: immdev.h:126
DWORD dwInit
Definition: immdev.h:213
GLint x0
Definition: linetemp.h:95
struct tagUNDETERMINESTRUCT * LPUNDETERMINESTRUCT
CANDIDATEFORM cfCandForm[4]
Definition: immdev.h:67
struct _tagINPUTCONTEXT INPUTCONTEXT
HWND hWnd
Definition: settings.c:17
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC)
Definition: imm.c:1015
struct tagUNDETERMINESTRUCT UNDETERMINESTRUCT
DWORD fdwConversion
Definition: immdev.h:60
DWORD dwChange
Definition: immdev.h:129
HIMCC hPrivate
Definition: immdev.h:71
struct INPUTCONTEXTDX INPUTCONTEXTDX
struct IME_STATE IME_STATE
POINT ptSoftKbdPos
Definition: immdev.h:59
struct _tagINPUTCONTEXT * LPINPUTCONTEXT
union _tagINPUTCONTEXT::@2000 lfFont
DWORD dwSentence
Definition: immdev.h:212
HIMCC hCandInfo
Definition: immdev.h:69
DWORD dwUnknown2
Definition: immdev.h:127
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL bNeedsTrans
Definition: immdev.h:124
WORD wLang
Definition: immdev.h:209
DWORD dwUnknown5
Definition: immdev.h:130
UINT nVKey
Definition: immdev.h:123
UINT uDetermineTextPos
Definition: immdev.h:186
DWORD dwReserve[3]
Definition: immdev.h:75
POINT ptStatusWndPos
Definition: immdev.h:58
#define offsetof(TYPE, MEMBER)
DWORD HIMC
Definition: dimm.idl:75
C_ASSERT(offsetof(INPUTCONTEXT, hWnd)==0x0)
struct _tagINPUTCONTEXT * PINPUTCONTEXT
DWORD dwUnknown1
Definition: immdev.h:125
WORD fOpen
Definition: immdev.h:210
#define WINAPI
Definition: msvc.h:6
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
COMPOSITIONFORM cfCompForm
Definition: immdev.h:66
HIMCC hMsgBuf
Definition: immdev.h:73
HIMCC hCompStr
Definition: immdev.h:68
UINT uDetermineDelimPos
Definition: immdev.h:187
DWORD fdwInit
Definition: immdev.h:74
UINT_PTR HKL
Definition: msctf.idl:101
PIME_SUBSTATE pSubState
Definition: immdev.h:214
DWORD dwValue
Definition: immdev.h:199
DWORD dwConversion
Definition: immdev.h:211
HIMCC hGuideLine
Definition: immdev.h:70
DWORD dwNumMsgBuf
Definition: immdev.h:72
struct IME_STATE * PIME_STATE
unsigned int UINT
Definition: ndis.h:50
struct IME_SUBSTATE * PIME_SUBSTATE
UINT uDetermineTextLen
Definition: immdev.h:185
struct IME_STATE * pState
Definition: immdev.h:128
DWORD fdwSentence
Definition: immdev.h:61
struct IME_SUBSTATE IME_SUBSTATE
struct IME_STATE * pNext
Definition: immdev.h:208
struct IME_SUBSTATE * pNext
Definition: immdev.h:197
LOGFONTW W
Definition: immdev.h:64
struct tagUNDETERMINESTRUCT * PUNDETERMINESTRUCT