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.

191 lines
7.8 KiB

  1. //
  2. // cuischem.h
  3. //
  4. #ifndef CUISCHEM_H
  5. #define CUISCHEM_H
  6. #ifndef LAYOUT_RTL
  7. #define LAYOUT_RTL 0x00000001 // Right to left
  8. #endif // LAYOUT_RTL
  9. //
  10. // UIFrame scheme
  11. //
  12. typedef enum _UIFSCHEME
  13. {
  14. UIFSCHEME_DEFAULT,
  15. UIFSCHEME_OFC10MENU,
  16. UIFSCHEME_OFC10TOOLBAR,
  17. UIFSCHEME_OFC10WORKPANE,
  18. } UIFSCHEME;
  19. //
  20. // UIFrame color
  21. //
  22. typedef enum _UIFCOLOR
  23. {
  24. // base color
  25. UIFCOLOR_MENUBKGND,
  26. UIFCOLOR_MENUBARSHORT,
  27. UIFCOLOR_MENUBARLONG,
  28. UIFCOLOR_MOUSEOVERBKGND,
  29. UIFCOLOR_MOUSEOVERBORDER,
  30. UIFCOLOR_MOUSEOVERTEXT,
  31. UIFCOLOR_MOUSEDOWNBKGND,
  32. UIFCOLOR_MOUSEDOWNBORDER,
  33. UIFCOLOR_MOUSEDOWNTEXT,
  34. UIFCOLOR_CTRLBKGND,
  35. UIFCOLOR_CTRLTEXT,
  36. UIFCOLOR_CTRLTEXTDISABLED,
  37. UIFCOLOR_CTRLIMAGESHADOW,
  38. UIFCOLOR_CTRLBKGNDSELECTED,
  39. UIFCOLOR_BORDEROUTER,
  40. UIFCOLOR_BORDERINNER,
  41. UIFCOLOR_ACTIVECAPTIONBKGND,
  42. UIFCOLOR_ACTIVECAPTIONTEXT,
  43. UIFCOLOR_INACTIVECAPTIONBKGND,
  44. UIFCOLOR_INACTIVECAPTIONTEXT,
  45. UIFCOLOR_SPLITTERLINE,
  46. UIFCOLOR_DRAGHANDLE,
  47. // virtual color
  48. UIFCOLOR_WINDOW,
  49. UIFCOLOR_MAX, /* must be last */
  50. } UIFCOLOR;
  51. //
  52. // DrawControl flags
  53. //
  54. #define UIFDCF_FLATONNORMAL 0x00000000 /* used in default scheme */
  55. #define UIFDCF_RAISEDONNORMAL 0x00000001 /* used in default scheme */
  56. #define UIFDCF_SUNKENONNORMAL 0x00000002 /* used in default scheme */
  57. #define UIFDCF_FLATONMOUSEOVER 0x00000000 /* used in default scheme */
  58. #define UIFDCF_RAISEDONMOUSEOVER 0x00000004 /* used in default scheme */
  59. #define UIFDCF_SUNKENONMOUSEOVER 0x00000008 /* used in default scheme */
  60. #define UIFDCF_FLATONMOUSEDOWN 0x00000000 /* used in default scheme */
  61. #define UIFDCF_RAISEDONMOUSEDOWN 0x00000010 /* used in default scheme */
  62. #define UIFDCF_SUNKENONMOUSEDOWN 0x00000020 /* used in default scheme */
  63. #define UIFDCF_FLATONSELECT 0x00000000 /* used in default scheme */
  64. #define UIFDCF_RAISEDONSELECT 0x00000040 /* used in default scheme */
  65. #define UIFDCF_SUNKENONSELECT 0x00000080 /* used in default scheme */
  66. #define UIFDCF_BUTTON (UIFDCF_FLATONNORMAL | UIFDCF_RAISEDONMOUSEOVER | UIFDCF_RAISEDONMOUSEDOWN | UIFDCF_RAISEDONSELECT)
  67. #define UIFDCF_BUTTONSUNKEN (UIFDCF_RAISEDONNORMAL | UIFDCF_RAISEDONMOUSEOVER | UIFDCF_SUNKENONMOUSEDOWN | UIFDCF_SUNKENONSELECT)
  68. #define UIFDCF_CAPTIONBUTTON (UIFDCF_RAISEDONNORMAL | UIFDCF_RAISEDONMOUSEOVER | UIFDCF_SUNKENONMOUSEDOWN | UIFDCF_SUNKENONSELECT)
  69. //
  70. // DrawControl states
  71. //
  72. #define UIFDCS_NORMAL 0x00000000
  73. #define UIFDCS_MOUSEOVER 0x00000001
  74. #define UIFDCS_MOUSEDOWN 0x00000002
  75. #define UIFDCS_SELECTED 0x00000010
  76. #define UIFDCS_DISABLED 0x00000020
  77. #define UIFDCS_MOUSEOVERSELECTED (UIFDCS_MOUSEOVER | UIFDCS_SELECTED)
  78. #define UIFDCS_MOUSEDOWNSELECTED (UIFDCS_MOUSEDOWN | UIFDCS_SELECTED)
  79. #define UIFDCS_DISABLEDSELECTED (UIFDCS_DISABLED | UIFDCS_SELECTED)
  80. #define UIFDCS_MOUSEOVERDISABLED (UIFDCS_MOUSEOVER | UIFDCS_DISABLED)
  81. #define UIFDCS_MOUSEOVERDISABLEDSELECTED (UIFDCS_MOUSEOVER | UIFDCS_DISABLED | UIFDCS_SELECTED)
  82. #define UIFDCS_ACTIVE 0x00000040 /* used in DrawFrameCtrlXXX */
  83. #define UIFDCS_INACTIVE 0x00000000 /* used in DrawFrameCtrlXXX */
  84. //
  85. // DrawWndFrame flags
  86. //
  87. #define UIFDWF_THIN 0x00000000
  88. #define UIFDWF_THICK 0x00000001
  89. #define UIFDWF_ROUNDTHICK 0x00000002
  90. //
  91. // CUIFScheme
  92. //
  93. class CUIFScheme
  94. {
  95. public:
  96. CUIFScheme() {
  97. m_dwLayout = 0;
  98. }
  99. //
  100. //
  101. //
  102. virtual UIFSCHEME GetType( void ) = 0; /* PURE */
  103. //
  104. // scheme color
  105. //
  106. virtual COLORREF GetColor( UIFCOLOR iCol ) = 0; /* PURE */
  107. virtual HBRUSH GetBrush( UIFCOLOR iCol ) = 0; /* PURE */
  108. //
  109. // metrics
  110. //
  111. virtual int CyMenuItem( int cyMenuText ) = 0; /* PURE */
  112. virtual int CxSizeFrame( void ) = 0; /* PURE */
  113. virtual int CySizeFrame( void ) = 0; /* PURE */
  114. virtual int CxWndBorder( void ) = 0; /* PURE */
  115. virtual int CyWndBorder( void ) = 0; /* PURE */
  116. //
  117. // drawing helper
  118. //
  119. virtual void FillRect( HDC hDC, const RECT *prc, UIFCOLOR iCol ) = 0; /* PURE */
  120. virtual void FrameRect( HDC hDC, const RECT *prc, UIFCOLOR iCol ) = 0; /* PURE */
  121. virtual void DrawSelectionRect( HDC hDC, const RECT *prc, BOOL fMouseDown ) = 0; /* PURE */
  122. virtual void GetCtrlFaceOffset( DWORD dwFlag, DWORD dwState, SIZE *poffset ) = 0; /* PURE */
  123. virtual void DrawCtrlBkgd( HDC hDC, const RECT *prc, DWORD dwFlag, DWORD dwState ) = 0; /* PURE */
  124. virtual void DrawCtrlEdge( HDC hDC, const RECT *prc, DWORD dwFlag, DWORD dwState ) = 0; /* PURE */
  125. virtual void DrawCtrlText( HDC hDC, const RECT *prc, LPCWSTR pwch, int cwch, DWORD dwState, BOOL fVertical ) = 0; /* PURE */
  126. virtual void DrawCtrlIcon( HDC hDC, const RECT *prc, HICON hIcon, DWORD dwState , SIZE *psizeIcon) = 0; /* PURE */
  127. virtual void DrawCtrlBitmap( HDC hDC, const RECT *prc, HBITMAP hBmp, HBITMAP hBmpMask, DWORD dwState ) = 0; /* PURE */
  128. virtual void DrawMenuBitmap( HDC hDC, const RECT *prc, HBITMAP hBmp, HBITMAP hBmpMask, DWORD dwState ) = 0; /* PURE */
  129. virtual void DrawMenuSeparator( HDC hDC, const RECT *prc) = 0; /* PURE */
  130. virtual void DrawFrameCtrlBkgd( HDC hDC, const RECT *prc, DWORD dwFlag, DWORD dwState ) = 0; /* PURE */
  131. virtual void DrawFrameCtrlEdge( HDC hDC, const RECT *prc, DWORD dwFlag, DWORD dwState ) = 0; /* PURE */
  132. virtual void DrawFrameCtrlIcon( HDC hDC, const RECT *prc, HICON hIcon, DWORD dwState, SIZE *psizeIcon) = 0; /* PURE */
  133. virtual void DrawFrameCtrlBitmap( HDC hDC, const RECT *prc, HBITMAP hBmp, HBITMAP hBmpMask, DWORD dwState ) = 0; /* PURE */
  134. virtual void DrawWndFrame( HDC hDC, const RECT *prc, DWORD dwFlag, int cxFrame, int cyFrame ) = 0; /* PURE */
  135. virtual void DrawDragHandle( HDC hDC, const RECT *prc, BOOL fVertical) = 0; /* PURE */
  136. virtual void DrawSeparator( HDC hDC, const RECT *prc, BOOL fVertical) = 0; /* PURE */
  137. void SetLayout(DWORD dwLayout) {
  138. m_dwLayout = dwLayout;
  139. }
  140. BOOL IsRTLLayout() {
  141. return (m_dwLayout & LAYOUT_RTL) ? TRUE : FALSE;
  142. }
  143. protected:
  144. DWORD m_dwLayout;
  145. };
  146. //
  147. // exported functions
  148. //
  149. extern void InitUIFScheme( void );
  150. extern void DoneUIFScheme( void );
  151. extern void UpdateUIFScheme( void );
  152. extern CUIFScheme *CreateUIFScheme( UIFSCHEME scheme );
  153. #endif /* CUISCHEM_H */