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.

132 lines
4.4 KiB

  1. /****************************************************************************
  2. UI.H
  3. Owner: cslim
  4. Copyright (c) 1997-1999 Microsoft Corporation
  5. UI functions
  6. History:
  7. 14-JUL-1999 cslim Copied from IME98 source tree
  8. *****************************************************************************/
  9. #if !defined (_UI_H__INCLUDED_)
  10. #define _UI_H__INCLUDED_
  11. // CIMEData class forward declaration.
  12. class CIMEData;
  13. // UI.CPP
  14. PUBLIC UINT WM_MSIME_PROPERTY; // Invoke property DLG
  15. PUBLIC UINT WM_MSIME_UPDATETOOLBAR; // Redraw status window(Toolbar)
  16. PUBLIC UINT WM_MSIME_OPENMENU; // Pop up status window context menu
  17. PUBLIC UINT WM_MSIME_IMEPAD; // Boot up IME Pad
  18. PUBLIC BOOL InitPrivateUIMsg();
  19. PUBLIC BOOL RegisterImeUIClass(HANDLE hInstance);
  20. PUBLIC BOOL UnregisterImeUIClass(HANDLE hInstance);
  21. PUBLIC BOOL OnUIProcessAttach();
  22. PUBLIC BOOL OnUIProcessDetach();
  23. PUBLIC BOOL OnUIThreadDetach();
  24. PUBLIC VOID SetActiveUIWnd(HWND hWnd);
  25. PUBLIC HWND GetActiveUIWnd();
  26. PUBLIC VOID UIPopupMenu(HWND hStatusWnd);
  27. //PUBLIC VOID HideStatus();
  28. ///////////////////////////////////////////////////////////////////////////////
  29. // StatusUI.Cpp
  30. PUBLIC VOID PASCAL OpenStatus(HWND hUIWnd);
  31. PUBLIC LRESULT CALLBACK StatusWndProc(HWND hStatusWnd, UINT uMessage, WPARAM wParam, LPARAM lParam);
  32. PUBLIC VOID ShowStatus(HWND hUIWnd, INT nShowStatusCmd);
  33. PUBLIC VOID UpdateStatusButtons(CIMEData &IMEData);
  34. PUBLIC VOID UpdateStatusWinDimension();
  35. PUBLIC VOID StatusDisplayChange(HWND hUIWnd);
  36. PUBLIC VOID InitButtonState();
  37. PUBLIC BOOL fSetStatusWindowPos(HWND hStatusWnd, POINT *ptStatusWndPos = NULL);
  38. ///////////////////////////////////////////////////////////////////////////////
  39. // CandUI.Cpp
  40. PUBLIC VOID PASCAL OpenCand(HWND hUIWnd);
  41. PUBLIC LRESULT CALLBACK CandWndProc(HWND hCandWnd, UINT uMessage, WPARAM wParam, LPARAM lParam);
  42. PUBLIC VOID ShowCand(HWND hUIWnd, INT nShowCandCmd);
  43. PUBLIC BOOL fSetCandWindowPos(HWND hCandWnd);
  44. ///////////////////////////////////////////////////////////////////////////////
  45. // CompUI.Cpp
  46. #define COMP_SIZEX 22
  47. #define COMP_SIZEY 22
  48. #define UI_GAPX 10
  49. PUBLIC VOID PASCAL OpenComp(HWND hUIWnd);
  50. PUBLIC LRESULT CALLBACK CompWndProc(HWND hCompWnd, UINT uMessage, WPARAM wParam, LPARAM lParam);
  51. PUBLIC VOID ShowComp(HWND hUIWnd, INT nShowCompCmd);
  52. PUBLIC BOOL fSetCompWindowPos(HWND hCompWnd);
  53. ///////////////////////////////////////////////////////////////////////////////
  54. // UISubs.CPP
  55. enum StatusButtonTypes
  56. {
  57. HAN_ENG_TOGGLE_BUTTON,
  58. JUNJA_BANJA_TOGGLE_BUTTON,
  59. HANJA_CONV_BUTTON,
  60. IME_PAD_BUTTON,
  61. NULL_BUTTON = 0xFF
  62. };
  63. // Button status
  64. #define BTNSTATE_NORMAL 0 // normal
  65. #define BTNSTATE_ONMOUSE 1 // mouse cursor on the button
  66. #define BTNSTATE_PUSHED 2 // pushed
  67. #define BTNSTATE_DOWN 4 // pushed
  68. #define BTNSTATE_HANJACONV 8 // If hanja conv mode, button always pushed
  69. // Button size
  70. #define BTN_SMALL 0
  71. #define BTN_MIDDLE 1
  72. #define BTN_LARGE 2
  73. struct StatusButton
  74. {
  75. StatusButtonTypes m_ButtonType;
  76. WORD m_BmpNormalID, m_BmpOnMouseID, m_BmpPushedID, m_BmpDownOnMouseID;
  77. WORD m_ToolTipStrID;
  78. INT m_uiButtonState;
  79. BOOL m_fEnable;
  80. };
  81. PUBLIC VOID PASCAL FrameControl(HDC hDC, RECT* pRc, INT iState);
  82. PUBLIC VOID PASCAL DrawBitmap(HDC hDC, LONG xStart, LONG yStart, HBITMAP hBitmap);
  83. PUBLIC BOOL PASCAL SetIndicatorIcon(INT nIconIndex, ATOM atomToolTip);
  84. PUBLIC VOID UpdateStatusButtonInfo();
  85. PUBLIC HANDLE WINAPI OurLoadImage( LPCTSTR pszName, UINT uiType, INT cx, INT cy, UINT uiLoad);
  86. PUBLIC BOOL WINAPI OurTextOutW(HDC hDC, INT x, INT y, WCHAR wch);
  87. #if 1 // MultiMonitor support
  88. PUBLIC void PASCAL ImeMonitorWorkAreaFromWindow(HWND hAppWnd, RECT* pRect);
  89. PUBLIC void PASCAL ImeMonitorWorkAreaFromPoint(POINT, RECT* pRect);
  90. PUBLIC void PASCAL ImeMonitorWorkAreaFromRect(LPRECT, RECT* pRect);
  91. PUBLIC HMONITOR PASCAL ImeMonitorFromRect(LPRECT lprcRect);
  92. #endif
  93. ///////////////////////////////////////////////////////////////////////////////
  94. // Inline Functions
  95. inline
  96. HIMC GethImcFromHwnd(HWND hWnd)
  97. {
  98. if (hWnd == (HWND)0 || IsWindow(hWnd) == fFalse)
  99. return (HIMC)NULL;
  100. else
  101. return (HIMC)GetWindowLongPtr(hWnd, IMMGWLP_IMC);
  102. }
  103. inline
  104. HGLOBAL GethUIPrivateFromHwnd(HWND hWnd)
  105. {
  106. if (hWnd == (HWND)0 || IsWindow(hWnd) == fFalse)
  107. return (HIMC)NULL;
  108. else
  109. return (HGLOBAL)GetWindowLongPtr(hWnd, IMMGWLP_PRIVATE);
  110. }
  111. #endif // !defined (_UI_H__INCLUDED_)