Don't return from overlapped ReadFile on EAGAIN and other non-fatal
[wine/gsoc_dplay.git] / dlls / imm32 / imm_private.h
blobeae5d01f02e322496c7fbfcc07a0a3128dae420b
1 /*
2 * private header for implementing IMM.
4 * Copyright 2000 Hidenori Takeshima
5 */
7 typedef struct IMM32_tagTHREADDATA IMM32_THREADDATA;
9 struct IMM32_tagTHREADDATA
11 HWND hwndIME;
12 HIMC hIMC;
15 typedef struct IMM32_tagMOVEABLEMEM IMM32_MOVEABLEMEM;
17 /* IME APIs */
19 typedef BOOL WINAPI (*IMM32_pImeInquireA)(LPIMEINFO, LPSTR, LPCSTR);
20 typedef BOOL WINAPI (*IMM32_pImeInquireW)(LPIMEINFO, LPWSTR, LPCWSTR);
22 typedef BOOL WINAPI (*IMM32_pImeConfigureA)(HKL, HWND, DWORD, LPVOID);
23 typedef BOOL WINAPI (*IMM32_pImeConfigureW)(HKL, HWND, DWORD, LPVOID);
24 typedef DWORD WINAPI (*IMM32_pImeConversionListA)
25 (HIMC, LPCSTR, LPCANDIDATELIST, DWORD, UINT);
26 typedef DWORD WINAPI (*IMM32_pImeConversionListW)
27 (HIMC, LPCWSTR, LPCANDIDATELIST, DWORD, UINT);
28 typedef BOOL WINAPI (*IMM32_pImeDestroy)(UINT);
29 typedef UINT WINAPI (*IMM32_pImeEnumRegisterWordA)
30 (REGISTERWORDENUMPROCA, LPCSTR, DWORD, LPCSTR, LPVOID);
31 typedef UINT WINAPI (*IMM32_pImeEnumRegisterWordW)
32 (REGISTERWORDENUMPROCW, LPCWSTR, DWORD, LPCWSTR, LPVOID);
33 typedef UINT WINAPI (*IMM32_pImeGetRegisterWordStyleA)(UINT, LPSTYLEBUFA);
34 typedef UINT WINAPI (*IMM32_pImeGetRegisterWordStyleW)(UINT, LPSTYLEBUFW);
35 typedef LRESULT WINAPI (*IMM32_pImeEscapeA)(HIMC, UINT, LPVOID);
36 typedef LRESULT WINAPI (*IMM32_pImeEscapeW)(HIMC, UINT, LPVOID);
37 typedef BOOL WINAPI (*IMM32_pImeProcessKey)(HIMC, UINT, LPARAM, CONST LPBYTE);
38 typedef BOOL WINAPI (*IMM32_pImeRegisterWordA)(LPCSTR, DWORD, LPCSTR);
39 typedef BOOL WINAPI (*IMM32_pImeRegisterWordW)(LPCWSTR, DWORD, LPCWSTR);
40 typedef BOOL WINAPI (*IMM32_pImeSelect)(HIMC, BOOL);
41 typedef BOOL WINAPI (*IMM32_pImeSetActiveContext)(HIMC, BOOL);
42 typedef BOOL WINAPI (*IMM32_pImeSetCompositionStringA)
43 (HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD);
44 typedef BOOL WINAPI (*IMM32_pImeSetCompositionStringW)
45 (HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD);
46 typedef UINT WINAPI (*IMM32_pImeToAsciiEx)
47 (UINT, UINT, CONST LPBYTE, LPDWORD, UINT, HIMC);
48 typedef BOOL WINAPI (*IMM32_pImeUnregisterWordA)(LPCSTR, DWORD, LPCSTR);
49 typedef BOOL WINAPI (*IMM32_pImeUnregisterWordW)(LPCWSTR, DWORD, LPCWSTR);
50 typedef BOOL WINAPI (*IMM32_pNotifyIME)(HIMC, DWORD, DWORD, DWORD);
52 /* for Win98 and later */
53 typedef DWORD WINAPI (*IMM32_pImeGetImeMenuItemsA)
54 (HIMC, DWORD, DWORD, LPIMEMENUITEMINFOA, LPIMEMENUITEMINFOA, DWORD);
55 typedef DWORD WINAPI (*IMM32_pImeGetImeMenuItemsW)
56 (HIMC, DWORD, DWORD, LPIMEMENUITEMINFOW, LPIMEMENUITEMINFOW, DWORD);
58 struct IMM32_IME_EXPORTED_HANDLERS
60 union
62 IMM32_pImeInquireA A;
63 IMM32_pImeInquireW W;
64 } pImeInquire;
66 union
68 IMM32_pImeConfigureA A;
69 IMM32_pImeConfigureW W;
70 } pImeConfigure;
71 union
73 IMM32_pImeConversionListA A;
74 IMM32_pImeConversionListW W;
75 } pImeConversionList;
76 IMM32_pImeDestroy pImeDestroy;
77 union
79 IMM32_pImeEnumRegisterWordA A;
80 IMM32_pImeEnumRegisterWordW W;
81 } pImeEnumRegisterWord;
82 union
84 IMM32_pImeGetRegisterWordStyleA A;
85 IMM32_pImeGetRegisterWordStyleW W;
86 } pImeGetRegisterWordStyle;
87 union
89 IMM32_pImeEscapeA A;
90 IMM32_pImeEscapeW W;
91 } pImeEscape;
92 IMM32_pImeProcessKey pImeProcessKey;
93 union
95 IMM32_pImeRegisterWordA A;
96 IMM32_pImeRegisterWordW W;
97 } pImeRegisterWord;
98 IMM32_pImeSelect pImeSelect;
99 IMM32_pImeSetActiveContext pImeSetActiveContext;
100 union
102 IMM32_pImeSetCompositionStringA A;
103 IMM32_pImeSetCompositionStringW W;
104 } pImeSetCompositionString;
105 IMM32_pImeToAsciiEx pImeToAsciiEx;
106 union
108 IMM32_pImeUnregisterWordA A;
109 IMM32_pImeUnregisterWordW W;
110 } pImeUnregisterWord;
111 IMM32_pNotifyIME pNotifyIME;
113 /* for Win98 and later */
114 union
116 IMM32_pImeGetImeMenuItemsA A;
117 IMM32_pImeGetImeMenuItemsW W;
118 } pImeGetImeMenuItems;
121 typedef struct IMM32_tagIMEKL IMM32_IMEKL;
122 typedef struct IMM32_tagIMC IMM32_IMC;
124 /* Win9x DDK says the UI class name can be up to 16 TCHARs. */
125 #define IMM32_UICLASSNAME_MAX 16
127 struct IMM32_tagIMEKL
129 IMM32_IMEKL* pNext;
130 HKL hkl;
131 BOOL fUnicode;
132 HINSTANCE hInstIME;
133 LPSTR pszIMEFileName;
134 IMEINFO imeinfo;
135 struct IMM32_IME_EXPORTED_HANDLERS handlers;
136 union
138 CHAR A[IMM32_UICLASSNAME_MAX];
139 WCHAR W[IMM32_UICLASSNAME_MAX];
140 } UIClassName;
143 struct IMM32_tagIMC
145 INPUTCONTEXT context;
146 const IMM32_IMEKL* pkl;
147 BOOL fSelected;
154 /* main.c */
155 LPVOID IMM32_HeapAlloc( DWORD dwFlags, DWORD dwSize );
156 LPVOID IMM32_HeapReAlloc( DWORD dwFlags, LPVOID lpv, DWORD dwSize );
157 void IMM32_HeapFree( LPVOID lpv );
158 IMM32_THREADDATA* IMM32_GetThreadData( void );
159 HIMC IMM32_GetDefaultContext( void );
160 HWND IMM32_GetDefaultIMEWnd( void );
161 void IMM32_Lock( void );
162 void IMM32_Unlock( void );
164 /* memory.c */
165 IMM32_MOVEABLEMEM* IMM32_MoveableAlloc( DWORD dwHeapFlags, DWORD dwHeapSize );
166 void IMM32_MoveableFree( IMM32_MOVEABLEMEM* lpMoveable );
167 BOOL IMM32_MoveableReAlloc( IMM32_MOVEABLEMEM* lpMoveable,
168 DWORD dwHeapFlags, DWORD dwHeapSize );
169 LPVOID IMM32_MoveableLock( IMM32_MOVEABLEMEM* lpMoveable );
170 BOOL IMM32_MoveableUnlock( IMM32_MOVEABLEMEM* lpMoveable );
171 DWORD IMM32_MoveableGetLockCount( IMM32_MOVEABLEMEM* lpMoveable );
172 DWORD IMM32_MoveableGetSize( IMM32_MOVEABLEMEM* lpMoveable );
174 /* string.c */
175 INT IMM32_strlenAtoW( LPCSTR lpstr );
176 INT IMM32_strlenWtoA( LPCWSTR lpwstr );
177 LPWSTR IMM32_strncpyAtoW( LPWSTR lpwstr, LPCSTR lpstr, INT wbuflen );
178 LPSTR IMM32_strncpyWtoA( LPSTR lpstr, LPCWSTR lpwstr, INT abuflen );
179 LPWSTR IMM32_strdupAtoW( LPCSTR lpstr );
180 LPSTR IMM32_strdupWtoA( LPCWSTR lpwstr );
182 /* imewnd.c */
183 BOOL IMM32_RegisterIMEWndClass( HINSTANCE hInstDLL );
184 void IMM32_UnregisterIMEWndClass( HINSTANCE hInstDLL );
185 HWND IMM32_CreateDefaultIMEWnd( void );
187 /* imekl.c */
188 const IMM32_IMEKL* IMM32_GetIME( HKL hkl );
189 void IMM32_UnloadAllIMEs( void );
191 /* imc.c */
192 IMM32_IMC* IMM32_LockIMC( HIMC hIMC );
193 BOOL IMM32_UnlockIMC( HIMC hIMC );