Source code of Windows XP (NT5)
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.

155 lines
4.3 KiB

  1. /*****************************************************************************\
  2. FILE: PreviewSM.h
  3. DESCRIPTION:
  4. This code will display a preview of system metrics.
  5. NOTE: This code will >hand< draw all the window controls, so if
  6. windows changes the way the windows controls are draw, this code
  7. needs to be manually updated. This is an issue for skinning.
  8. BryanSt 4/4/2000
  9. Copyright (C) Microsoft Corp 2000-2000. All rights reserved.
  10. \*****************************************************************************/
  11. #ifndef _PREVIEWSYSTEMMETRICS_H
  12. #define _PREVIEWSYSTEMMETRICS_H
  13. #include "regutil.h"
  14. #define PREVIEWSM_CLASSA "PreviewSystemMetrics"
  15. #define PREVIEWSM_CLASS TEXT(PREVIEWSM_CLASSA)
  16. #define FONT_NONE -1
  17. #define FONT_CAPTION 0
  18. #define FONT_SMCAPTION 1
  19. #define FONT_MENU 2
  20. #define FONT_ICONTITLE 3
  21. #define FONT_STATUS 4
  22. #define FONT_MSGBOX 5
  23. #define NUM_FONTS 6
  24. typedef struct {
  25. HFONT hfont;
  26. LOGFONT lf;
  27. } LOOK_FONT;
  28. extern LOOK_FONT g_fonts[];
  29. #define COLOR_NONE -1
  30. extern COLORREF g_rgb[];extern HBRUSH g_brushes[];
  31. extern HPALETTE g_hpal3D;
  32. #define SIZE_NONE -1
  33. #define SIZE_FRAME 0
  34. #define SIZE_SCROLL 1
  35. #define SIZE_CAPTION 2
  36. #define SIZE_SMCAPTION 3
  37. #define SIZE_MENU 4
  38. #define SIZE_DXICON 5
  39. #define SIZE_DYICON 6
  40. #define SIZE_ICON 7
  41. #define SIZE_SMICON 8
  42. #define NUM_SIZES 9
  43. typedef struct {
  44. int CurSize;
  45. int MinSize;
  46. int MaxSize;
  47. } LOOK_SIZE;
  48. extern LOOK_SIZE g_sizes[];
  49. typedef struct {
  50. int iMainColor;
  51. int iSize;
  52. BOOL fLinkSizeToFont;
  53. int iTextColor;
  54. int iFont;
  55. int iResId; // id of name in resource (or -1 if duplicate)
  56. int iBaseElement; // index of element that this overlaps (or -1)
  57. int iGradientColor; // index of element for Gradient Caption Bar (or -1)
  58. RECT rc;
  59. } LOOK_ELEMENT;
  60. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  61. //this order has to match the array order in lookdlg.c
  62. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  63. enum _ELEMENTS {
  64. ELEMENT_APPSPACE = 0,
  65. ELEMENT_DESKTOP, // 1
  66. ELEMENT_INACTIVEBORDER, // 2
  67. ELEMENT_ACTIVEBORDER, // 3
  68. ELEMENT_INACTIVECAPTION, // 4
  69. ELEMENT_INACTIVESYSBUT1, // 5
  70. ELEMENT_INACTIVESYSBUT2, // 6
  71. ELEMENT_ACTIVECAPTION, // 7
  72. ELEMENT_ACTIVESYSBUT1, // 8
  73. ELEMENT_ACTIVESYSBUT2, // 9
  74. ELEMENT_MENUNORMAL, // 10
  75. ELEMENT_MENUSELECTED, // 11
  76. ELEMENT_MENUDISABLED, // 12
  77. ELEMENT_WINDOW, // 13
  78. ELEMENT_MSGBOX, // 14
  79. ELEMENT_MSGBOXCAPTION, // 15
  80. ELEMENT_MSGBOXSYSBUT, // 16
  81. ELEMENT_SCROLLBAR, // 17
  82. ELEMENT_SCROLLUP, // 18
  83. ELEMENT_SCROLLDOWN, // 19
  84. ELEMENT_BUTTON, // 20
  85. ELEMENT_SMCAPTION, // 21
  86. ELEMENT_ICON, // 22
  87. ELEMENT_ICONHORZSPACING, // 23
  88. ELEMENT_ICONVERTSPACING, // 24
  89. ELEMENT_INFO // 25
  90. };
  91. // BOGUS: need to get a size from somewhere
  92. #define NUM_ELEMENTS ELEMENT_INFO+1
  93. #if 0
  94. // go fix lookdlg.cpp if you decide to add this back in
  95. ELEMENT_SMICON,
  96. #endif
  97. #define CPI_VGAONLY 0x0001
  98. #define CPI_PALETTEOK 0x0002
  99. typedef struct {
  100. HWND hwndParent; // parent for any modal dialogs (choosecolor et al)
  101. HWND hwndOwner; // control that owns mini color picker
  102. COLORREF rgb;
  103. UINT flags;
  104. HPALETTE hpal;
  105. } COLORPICK_INFO, FAR * LPCOLORPICK_INFO;
  106. #define WM_RECREATEBITMAP (WM_USER)
  107. extern int cyBorder;
  108. extern int cxBorder;
  109. extern int cyEdge;
  110. extern int cxEdge;
  111. // NOTE: the order in g_elements must match the enum order above
  112. extern LOOK_ELEMENT g_elements[];
  113. BOOL RegisterPreviewSystemMetricClass(HINSTANCE hInst);
  114. BOOL WINAPI ChooseColorMini(LPCOLORPICK_INFO lpcpi);
  115. DWORD FAR PASCAL AdjustLuma(DWORD rgb, int n, BOOL fScale);
  116. BOOL CreateGlobals(void);
  117. HRESULT DrawAppearance(HDC hdc, LPRECT prc, SYSTEMMETRICSALL* psysMet, BOOL fOnlyShowActiveWindow, BOOL fRTL);
  118. extern HDC g_hdcMem;
  119. // Macro to replace MAKEPOINT() since points now have 32 bit x & y
  120. #define LPARAM2POINT( lp, ppt ) \
  121. ((ppt)->x = (int)(short)LOWORD(lp), (ppt)->y = (int)(short)HIWORD(lp))
  122. #define CCH_MAX_STRING 256
  123. #define CCH_NONE 20 /* ARRAYSIZE( "(None)" ), big enough for German */
  124. #endif // _PREVIEWSYSTEMMETRICS_H