Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

211 lines
7.2 KiB

  1. /****************************** Module Header ******************************\
  2. * Module Name: immuser.h
  3. *
  4. * Copyright (c) 1985 - 1999, Microsoft Corporation
  5. *
  6. * This header file contains the internal IMM structure definitions for
  7. * the user mode USER32/IMM32.
  8. *
  9. * History:
  10. * 25-Mar-1996 TakaoK Split from immstruc.h
  11. \***************************************************************************/
  12. #ifndef _IMMUSER_
  13. #define _IMMUSER_
  14. #include <imm.h>
  15. #include <immp.h>
  16. #include <ime.h>
  17. #include <imep.h>
  18. /*
  19. * Client side input context structure.
  20. */
  21. typedef struct tagCLIENTIMC {
  22. HANDLE hInputContext;
  23. LONG cLockObj;
  24. DWORD dwFlags;
  25. DWORD dwImeCompatFlags; // win95 compatible application compat flags
  26. RTL_CRITICAL_SECTION cs;
  27. DWORD dwCodePage;
  28. HKL SelectedHKL;
  29. #ifdef CUAS_ENABLE
  30. BOOL fCtfImeContext;
  31. #endif
  32. } CLIENTIMC, *PCLIENTIMC;
  33. #define InitImcCrit(pClientImc) RtlInitializeCriticalSection(&pClientImc->cs)
  34. #define DeleteImcCrit(pClientImc) RtlDeleteCriticalSection(&pClientImc->cs)
  35. #define EnterImcCrit(pClientImc) RtlEnterCriticalSection(&pClientImc->cs)
  36. #define LeaveImcCrit(pClientImc) RtlLeaveCriticalSection(&pClientImc->cs)
  37. /*
  38. * IME Dispatch Processing Interface
  39. */
  40. typedef BOOL (CALLBACK* PFNINQUIREA)(LPIMEINFO, LPSTR, DWORD);
  41. typedef BOOL (CALLBACK* PFNINQUIREW)(LPIMEINFO, LPWSTR, DWORD);
  42. typedef DWORD (CALLBACK* PFNCONVLISTA)(HIMC, LPCSTR, LPCANDIDATELIST, DWORD, UINT);
  43. typedef DWORD (CALLBACK* PFNCONVLISTW)(HIMC, LPCWSTR, LPCANDIDATELIST, DWORD, UINT);
  44. typedef BOOL (CALLBACK* PFNREGWORDA)(LPCSTR, DWORD, LPCSTR);
  45. typedef BOOL (CALLBACK* PFNREGWORDW)(LPCWSTR, DWORD, LPCWSTR);
  46. typedef BOOL (CALLBACK* PFNUNREGWORDA)(LPCSTR, DWORD, LPCSTR);
  47. typedef BOOL (CALLBACK* PFNUNREGWORDW)(LPCWSTR, DWORD, LPCWSTR);
  48. typedef UINT (CALLBACK* PFNGETREGWORDSTYA)(UINT, LPSTYLEBUFA);
  49. typedef UINT (CALLBACK* PFNGETREGWORDSTYW)(UINT, LPSTYLEBUFW);
  50. typedef UINT (CALLBACK* PFNENUMREGWORDA)(REGISTERWORDENUMPROCA, LPCSTR, DWORD, LPCSTR, LPVOID);
  51. typedef UINT (CALLBACK* PFNENUMREGWORDW)(REGISTERWORDENUMPROCW, LPCWSTR, DWORD, LPCWSTR, LPVOID);
  52. typedef BOOL (CALLBACK* PFNCONFIGURE)(HKL, HWND, DWORD, LPVOID);
  53. typedef BOOL (CALLBACK* PFNDESTROY)(UINT);
  54. typedef LRESULT (CALLBACK* PFNESCAPE)(HIMC, UINT, LPVOID);
  55. typedef BOOL (CALLBACK* PFNPROCESSKEY)(HIMC, UINT, LPARAM, CONST LPBYTE);
  56. typedef BOOL (CALLBACK* PFNSELECT)(HIMC, BOOL);
  57. typedef BOOL (CALLBACK* PFNSETACTIVEC)(HIMC, BOOL);
  58. typedef UINT (CALLBACK* PFNTOASCEX)(UINT, UINT, CONST LPBYTE, PTRANSMSGLIST, UINT, HIMC);
  59. typedef BOOL (CALLBACK* PFNNOTIFY)(HIMC, DWORD, DWORD, DWORD);
  60. typedef BOOL (CALLBACK* PFNSETCOMPSTR)(HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD);
  61. typedef DWORD (CALLBACK* PFNGETIMEMENUITEMS)(HIMC, DWORD, DWORD, LPVOID, LPVOID, DWORD);
  62. #ifdef CUAS_ENABLE
  63. /*
  64. * IME Dispatch Processing Interface for Cicero Unaware Apps Support.
  65. */
  66. typedef BOOL (CALLBACK* PFNINQUIREEXW)(LPIMEINFO, LPWSTR, DWORD, HKL);
  67. typedef HRESULT (CALLBACK* PFNSELECTEX)(HIMC, BOOL, HKL);
  68. typedef LRESULT (CALLBACK* PFNESCAPEEX)(HIMC, UINT, LPVOID, HKL);
  69. typedef HRESULT (CALLBACK* PFNGETGUIDATOM)(HIMC, BYTE, DWORD*);
  70. typedef BOOL (CALLBACK* PFNISGUIDMAPENABLE)(HIMC);
  71. #endif // CUAS_ENABLE
  72. #define IMEDPI_UNLOADED 1
  73. #define IMEDPI_UNLOCKUNLOAD 2
  74. typedef struct tagIMEDPI {
  75. struct tagIMEDPI *pNext;
  76. HANDLE hInst;
  77. HKL hKL;
  78. IMEINFO ImeInfo;
  79. DWORD dwCodePage;
  80. WCHAR wszUIClass[IM_UI_CLASS_SIZE];
  81. DWORD cLock;
  82. DWORD dwFlag;
  83. struct _tagImeFunctions {
  84. union {PFNINQUIREA a; PFNINQUIREW w; PVOID t;} ImeInquire;
  85. union {PFNCONVLISTA a; PFNCONVLISTW w; PVOID t;} ImeConversionList;
  86. union {PFNREGWORDA a; PFNREGWORDW w; PVOID t;} ImeRegisterWord;
  87. union {PFNUNREGWORDA a; PFNUNREGWORDW w; PVOID t;} ImeUnregisterWord;
  88. union {PFNGETREGWORDSTYA a; PFNGETREGWORDSTYW w; PVOID t;} ImeGetRegisterWordStyle;
  89. union {PFNENUMREGWORDA a; PFNENUMREGWORDW w; PVOID t;} ImeEnumRegisterWord;
  90. PFNCONFIGURE ImeConfigure;
  91. PFNDESTROY ImeDestroy;
  92. PFNESCAPE ImeEscape;
  93. PFNPROCESSKEY ImeProcessKey;
  94. PFNSELECT ImeSelect;
  95. PFNSETACTIVEC ImeSetActiveContext;
  96. PFNTOASCEX ImeToAsciiEx;
  97. PFNNOTIFY NotifyIME;
  98. PFNSETCOMPSTR ImeSetCompositionString;
  99. PFNGETIMEMENUITEMS ImeGetImeMenuItems;
  100. #ifdef CUAS_ENABLE
  101. PFNINQUIREEXW CtfImeInquireExW; // Unicode only
  102. PFNSELECTEX CtfImeSelectEx;
  103. PFNESCAPEEX CtfImeEscapeEx;
  104. PFNGETGUIDATOM CtfImeGetGuidAtom;
  105. PFNISGUIDMAPENABLE CtfImeIsGuidMapEnable;
  106. #endif // CUAS_ENABLE
  107. } pfn;
  108. } IMEDPI, *PIMEDPI;
  109. /*
  110. * IME Mode Saver
  111. */
  112. typedef struct tagIMEPRIVATESAVER {
  113. struct tagIMEPRIVATESAVER* next;
  114. HKL hkl;
  115. DWORD fdwSentence;
  116. } IMEPRIVATEMODESAVER, *PIMEPRIVATEMODESAVER;
  117. typedef struct tagIMEMODESAVER {
  118. struct tagIMEMODESAVER* next;
  119. USHORT langId; // Primary LangId
  120. BOOLEAN fOpen;
  121. DWORD fdwConversion;
  122. DWORD fdwSentence;
  123. DWORD fdwInit;
  124. PIMEPRIVATEMODESAVER pImePrivateModeSaver;
  125. } IMEMODESAVER, *PIMEMODESAVER;
  126. /*
  127. * Private client side routines in IMM32.DLL.
  128. */
  129. BOOL ImmSetActiveContext(
  130. HWND hWnd,
  131. HIMC hImc,
  132. BOOL fActivate);
  133. BOOL WINAPI ImmLoadIME(
  134. HKL hKL);
  135. BOOL WINAPI ImmUnloadIME(
  136. HKL hKL);
  137. BOOL WINAPI ImmFreeLayout(
  138. DWORD dwFlag);
  139. BOOL WINAPI ImmActivateLayout(
  140. HKL hSelKL);
  141. BOOL WINAPI ImmLoadLayout(
  142. HKL hKL,
  143. PIMEINFOEX piiex);
  144. BOOL WINAPI ImmDisableIme(
  145. DWORD dwThreadId);
  146. PCLIENTIMC WINAPI ImmLockClientImc(
  147. HIMC hImc);
  148. VOID WINAPI ImmUnlockClientImc(
  149. PCLIENTIMC pClientImc);
  150. PIMEDPI WINAPI ImmLockImeDpi(
  151. HKL hKL);
  152. VOID WINAPI ImmUnlockImeDpi(
  153. PIMEDPI pImeDpi);
  154. BOOL WINAPI ImmGetImeInfoEx(
  155. PIMEINFOEX piiex,
  156. IMEINFOEXCLASS SearchType,
  157. PVOID pvSearchKey);
  158. DWORD WINAPI ImmProcessKey(
  159. HWND hWnd,
  160. HKL hkl,
  161. UINT uVKey,
  162. LPARAM lParam,
  163. DWORD dwHotKeyID);
  164. BOOL ImmTranslateMessage(
  165. HWND hwnd,
  166. UINT message,
  167. WPARAM wParam,
  168. LPARAM lParam);
  169. VOID ImmInitializeHotKeys( BOOL bUserLoggedOn );
  170. #ifdef CUAS_ENABLE
  171. HRESULT CtfImmTIMActivate(HKL hKL);
  172. HRESULT CtfImmCoInitialize();
  173. void CtfImmCoUninitialize();
  174. #endif // CUAS_ENABLE
  175. #endif // _IMMUSER_