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.

175 lines
4.4 KiB

  1. /*++
  2. Copyright (c) 2001, Microsoft Corporation
  3. Module Name:
  4. globals.h
  5. Abstract:
  6. This file defines the global data.
  7. Author:
  8. Revision History:
  9. Notes:
  10. --*/
  11. #ifndef _GLOBAL_H_
  12. #define _GLOBAL_H_
  13. #include "template.h"
  14. #include "imc.h"
  15. #include "ciccs.h"
  16. /////////////////////////////////////////////////////////////////////////////
  17. // Prototype
  18. extern "C" {
  19. BOOL PASCAL AttachIME();
  20. void PASCAL DetachIME();
  21. LRESULT CALLBACK UIWndProc(HWND, UINT, WPARAM, LPARAM);
  22. HRESULT WINAPI Inquire(LPIMEINFO, LPWSTR, DWORD, HKL);
  23. BYTE GetCharsetFromLangId(LCID lcid);
  24. HIMC GetActiveContext();
  25. BOOL IsVKDBEKey(UINT uVKey);
  26. HRESULT WINAPI CtfImeThreadDetach();
  27. BOOL DllShutDownInProgress();
  28. }
  29. /////////////////////////////////////////////////////////////////////////////
  30. // Data
  31. extern const WCHAR s_szUIClassName[16];
  32. extern const WCHAR s_szCompClassName[];
  33. extern const GUID GUID_COMPARTMENT_CTFIME_DIMFLAGS;
  34. extern const GUID GUID_COMPARTMENT_CTFIME_CICINPUTCONTEXT;
  35. extern CCicCriticalSectionStatic g_cs;
  36. /////////////////////////////////////////////////////////////////////////////
  37. // Flags for GUID_COMPARTMENT_CTFIME_DIMFLAGS
  38. #define COMPDIMFLAG_OWNEDDIM 0x0001
  39. /////////////////////////////////////////////////////////////////////////////
  40. // Module instance
  41. __inline HINSTANCE GetInstance()
  42. {
  43. extern HINSTANCE g_hInst;
  44. return g_hInst;
  45. }
  46. __inline void SetInstance(HINSTANCE hInst)
  47. {
  48. extern HINSTANCE g_hInst;
  49. g_hInst = hInst;
  50. }
  51. /////////////////////////////////////////////////////////////////////////////
  52. // Mouse sink
  53. typedef struct tagPRIVATE_MOUSESINK {
  54. Interface<ITfRangeACP> range;
  55. HIMC hImc;
  56. } PRIVATE_MOUSESINK, *LPPRIVATE_MOUSESINK;
  57. typedef struct tagMOUSE_RANGE_RECT {
  58. ULONG uStartRangeEdge;
  59. ULONG uStartRangeQuadrant;
  60. ULONG uEndRangeEdge;
  61. ULONG uEndRangeQuadrant;
  62. } MOUSE_RANGE_RECT, *LPMOUSE_RANGE_RECT;
  63. /////////////////////////////////////////////////////////////////////////////
  64. // WM_MSIME_xxxx
  65. extern UINT WM_MSIME_SERVICE;
  66. extern UINT WM_MSIME_UIREADY;
  67. extern UINT WM_MSIME_RECONVERTREQUEST;
  68. extern UINT WM_MSIME_RECONVERT;
  69. extern UINT WM_MSIME_DOCUMENTFEED;
  70. extern UINT WM_MSIME_QUERYPOSITION;
  71. extern UINT WM_MSIME_MODEBIAS;
  72. extern UINT WM_MSIME_SHOWIMEPAD;
  73. extern UINT WM_MSIME_MOUSE;
  74. extern UINT WM_MSIME_KEYMAP;
  75. /////////////////////////////////////////////////////////////////////////////
  76. // WM_IME_NOTIFY
  77. #define IMN_PRIVATE_ONLAYOUTCHANGE (IMN_PRIVATE+1)
  78. #define IMN_PRIVATE_ONCLEARDOCFEEDBUFFER (IMN_PRIVATE+2)
  79. #define IMN_PRIVATE_GETCONTEXTFLAG (IMN_PRIVATE+3)
  80. #define IMN_PRIVATE_GETCANDRECTFROMCOMPOSITION (IMN_PRIVATE+4)
  81. #define IMN_PRIVATE_STARTLAYOUTCHANGE (IMN_PRIVATE+5)
  82. #define IMN_PRIVATE_GETTEXTEXT (IMN_PRIVATE+6)
  83. //
  84. // FrontPage XP call SendMessage(WM_IME_NOTIFY, NI_COMPOSITIONSTR)
  85. // So we can not use IMN_PRIVATE+7.
  86. //
  87. // #define IMN_PRIVATE_FRONTPAGERESERVE (IMN_PRIVATE+7)
  88. #define IMN_PRIVATE_DELAYRECONVERTFUNCCALL (IMN_PRIVATE+8)
  89. #define IMN_PRIVATE_GETUIWND (IMN_PRIVATE+9)
  90. /////////////////////////////////////////////////////////////////////////////
  91. #ifdef DEBUG
  92. extern DWORD g_dwThreadDllMain;
  93. #endif
  94. /////////////////////////////////////////////////////////////////////////////
  95. extern DWORD g_bWinLogon;
  96. /////////////////////////////////////////////////////////////////////////////
  97. // Delay load
  98. HRESULT Internal_CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID* ppv);
  99. /////////////////////////////////////////////////////////////////////////////
  100. // RotateSize
  101. inline void RotateSize(LPSIZE size)
  102. {
  103. int nTemp;
  104. nTemp = size->cx;
  105. size->cx = size->cy;
  106. size->cy = nTemp;
  107. }
  108. /////////////////////////////////////////////////////////////////////////////
  109. // IS_IME_KBDLAYOUT
  110. inline BOOL IS_IME_KBDLAYOUT(HKL hKL)
  111. {
  112. return ((HIWORD((ULONG_PTR)(hKL)) & 0xf000) == 0xe000);
  113. }
  114. inline BOOL IS_EA_KBDLAYOUT(HKL hKL)
  115. {
  116. switch (LOWORD((ULONG_PTR)(hKL)))
  117. {
  118. case 0x411:
  119. case 0x412:
  120. case 0x404:
  121. case 0x804:
  122. return TRUE;
  123. }
  124. return FALSE;
  125. }
  126. #endif // _GLOBAL_H_