2 * private header for implementing IMM.
4 * Copyright 2000 Hidenori Takeshima
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 typedef struct IMM32_tagTHREADDATA IMM32_THREADDATA;
23 struct IMM32_tagTHREADDATA
29 typedef struct IMM32_tagMOVEABLEMEM IMM32_MOVEABLEMEM;
33 typedef BOOL (WINAPI *IMM32_pImeInquireA)(LPIMEINFO, LPSTR, LPCSTR);
34 typedef BOOL (WINAPI *IMM32_pImeInquireW)(LPIMEINFO, LPWSTR, LPCWSTR);
36 typedef BOOL (WINAPI *IMM32_pImeConfigureA)(HKL, HWND, DWORD, LPVOID);
37 typedef BOOL (WINAPI *IMM32_pImeConfigureW)(HKL, HWND, DWORD, LPVOID);
38 typedef DWORD (WINAPI *IMM32_pImeConversionListA)
39 (HIMC, LPCSTR, LPCANDIDATELIST, DWORD, UINT);
40 typedef DWORD (WINAPI *IMM32_pImeConversionListW)
41 (HIMC, LPCWSTR, LPCANDIDATELIST, DWORD, UINT);
42 typedef BOOL (WINAPI *IMM32_pImeDestroy)(UINT);
43 typedef UINT (WINAPI *IMM32_pImeEnumRegisterWordA)
44 (REGISTERWORDENUMPROCA, LPCSTR, DWORD, LPCSTR, LPVOID);
45 typedef UINT (WINAPI *IMM32_pImeEnumRegisterWordW)
46 (REGISTERWORDENUMPROCW, LPCWSTR, DWORD, LPCWSTR, LPVOID);
47 typedef UINT (WINAPI *IMM32_pImeGetRegisterWordStyleA)(UINT, LPSTYLEBUFA);
48 typedef UINT (WINAPI *IMM32_pImeGetRegisterWordStyleW)(UINT, LPSTYLEBUFW);
49 typedef LRESULT (WINAPI *IMM32_pImeEscapeA)(HIMC, UINT, LPVOID);
50 typedef LRESULT (WINAPI *IMM32_pImeEscapeW)(HIMC, UINT, LPVOID);
51 typedef BOOL (WINAPI *IMM32_pImeProcessKey)(HIMC, UINT, LPARAM, CONST LPBYTE);
52 typedef BOOL (WINAPI *IMM32_pImeRegisterWordA)(LPCSTR, DWORD, LPCSTR);
53 typedef BOOL (WINAPI *IMM32_pImeRegisterWordW)(LPCWSTR, DWORD, LPCWSTR);
54 typedef BOOL (WINAPI *IMM32_pImeSelect)(HIMC, BOOL);
55 typedef BOOL (WINAPI *IMM32_pImeSetActiveContext)(HIMC, BOOL);
56 typedef BOOL (WINAPI *IMM32_pImeSetCompositionStringA)
57 (HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD);
58 typedef BOOL (WINAPI *IMM32_pImeSetCompositionStringW)
59 (HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD);
60 typedef UINT (WINAPI *IMM32_pImeToAsciiEx)
61 (UINT, UINT, CONST LPBYTE, LPDWORD, UINT, HIMC);
62 typedef BOOL (WINAPI *IMM32_pImeUnregisterWordA)(LPCSTR, DWORD, LPCSTR);
63 typedef BOOL (WINAPI *IMM32_pImeUnregisterWordW)(LPCWSTR, DWORD, LPCWSTR);
64 typedef BOOL (WINAPI *IMM32_pNotifyIME)(HIMC, DWORD, DWORD, DWORD);
66 /* for Win98 and later */
67 typedef DWORD (WINAPI *IMM32_pImeGetImeMenuItemsA)
68 (HIMC, DWORD, DWORD, LPIMEMENUITEMINFOA, LPIMEMENUITEMINFOA, DWORD);
69 typedef DWORD (WINAPI *IMM32_pImeGetImeMenuItemsW)
70 (HIMC, DWORD, DWORD, LPIMEMENUITEMINFOW, LPIMEMENUITEMINFOW, DWORD);
72 struct IMM32_IME_EXPORTED_HANDLERS
82 IMM32_pImeConfigureA A;
83 IMM32_pImeConfigureW W;
87 IMM32_pImeConversionListA A;
88 IMM32_pImeConversionListW W;
90 IMM32_pImeDestroy pImeDestroy;
93 IMM32_pImeEnumRegisterWordA A;
94 IMM32_pImeEnumRegisterWordW W;
95 } pImeEnumRegisterWord;
98 IMM32_pImeGetRegisterWordStyleA A;
99 IMM32_pImeGetRegisterWordStyleW W;
100 } pImeGetRegisterWordStyle;
106 IMM32_pImeProcessKey pImeProcessKey;
109 IMM32_pImeRegisterWordA A;
110 IMM32_pImeRegisterWordW W;
112 IMM32_pImeSelect pImeSelect;
113 IMM32_pImeSetActiveContext pImeSetActiveContext;
116 IMM32_pImeSetCompositionStringA A;
117 IMM32_pImeSetCompositionStringW W;
118 } pImeSetCompositionString;
119 IMM32_pImeToAsciiEx pImeToAsciiEx;
122 IMM32_pImeUnregisterWordA A;
123 IMM32_pImeUnregisterWordW W;
124 } pImeUnregisterWord;
125 IMM32_pNotifyIME pNotifyIME;
127 /* for Win98 and later */
130 IMM32_pImeGetImeMenuItemsA A;
131 IMM32_pImeGetImeMenuItemsW W;
132 } pImeGetImeMenuItems;
135 typedef struct IMM32_tagIMEKL IMM32_IMEKL;
136 typedef struct IMM32_tagIMC IMM32_IMC;
138 /* Win9x DDK says the UI class name can be up to 16 TCHARs. */
139 #define IMM32_UICLASSNAME_MAX 16
141 struct IMM32_tagIMEKL
147 LPSTR pszIMEFileName;
149 struct IMM32_IME_EXPORTED_HANDLERS handlers;
152 CHAR A[IMM32_UICLASSNAME_MAX];
153 WCHAR W[IMM32_UICLASSNAME_MAX];
159 INPUTCONTEXT context;
160 const IMM32_IMEKL* pkl;
169 LPVOID IMM32_HeapAlloc( DWORD dwFlags, DWORD dwSize );
170 LPVOID IMM32_HeapReAlloc( DWORD dwFlags, LPVOID lpv, DWORD dwSize );
171 void IMM32_HeapFree( LPVOID lpv );
172 IMM32_THREADDATA* IMM32_GetThreadData( void );
173 HIMC IMM32_GetDefaultContext( void );
174 HWND IMM32_GetDefaultIMEWnd( void );
175 void IMM32_Lock( void );
176 void IMM32_Unlock( void );
179 IMM32_MOVEABLEMEM* IMM32_MoveableAlloc( DWORD dwHeapFlags, DWORD dwHeapSize );
180 void IMM32_MoveableFree( IMM32_MOVEABLEMEM* lpMoveable );
181 BOOL IMM32_MoveableReAlloc( IMM32_MOVEABLEMEM* lpMoveable,
182 DWORD dwHeapFlags, DWORD dwHeapSize );
183 LPVOID IMM32_MoveableLock( IMM32_MOVEABLEMEM* lpMoveable );
184 BOOL IMM32_MoveableUnlock( IMM32_MOVEABLEMEM* lpMoveable );
185 DWORD IMM32_MoveableGetLockCount( IMM32_MOVEABLEMEM* lpMoveable );
186 DWORD IMM32_MoveableGetSize( IMM32_MOVEABLEMEM* lpMoveable );
189 INT IMM32_strlenAtoW( LPCSTR lpstr );
190 INT IMM32_strlenWtoA( LPCWSTR lpwstr );
191 LPWSTR IMM32_strncpyAtoW( LPWSTR lpwstr, LPCSTR lpstr, INT wbuflen );
192 LPSTR IMM32_strncpyWtoA( LPSTR lpstr, LPCWSTR lpwstr, INT abuflen );
193 LPWSTR IMM32_strdupAtoW( LPCSTR lpstr );
194 LPSTR IMM32_strdupWtoA( LPCWSTR lpwstr );
197 BOOL IMM32_RegisterIMEWndClass( HINSTANCE hInstDLL );
198 void IMM32_UnregisterIMEWndClass( HINSTANCE hInstDLL );
199 HWND IMM32_CreateDefaultIMEWnd( void );
202 const IMM32_IMEKL* IMM32_GetIME( HKL hkl );
203 void IMM32_UnloadAllIMEs( void );
206 IMM32_IMC* IMM32_LockIMC( HIMC hIMC );
207 BOOL IMM32_UnlockIMC( HIMC hIMC );