* Sync up to trunk head (r65095).
[reactos.git] / dll / cpl / desk / appearance.h
1 #pragma once
2
3 /* Some definitions for theme */
4 #define SIZE_BORDER_WIDTH 0
5 #define SIZE_SCROLL_WIDTH 1
6 #define SIZE_SCROLL_HEIGHT 2
7 #define SIZE_CAPTION_WIDTH 3
8 #define SIZE_CAPTION_HEIGHT 4
9 #define SIZE_SM_CAPTION_WIDTH 5
10 #define SIZE_SM_CAPTION_HEIGHT 6
11 #define SIZE_MENU_WIDTH 7
12 #define SIZE_MENU_HEIGHT 8
13
14 #define SIZE_ICON_SPACE_X 9
15 #define SIZE_ICON_SPACE_Y 10
16 #define SIZE_ICON 11
17
18 #define FONT_CAPTION 0
19 #define FONT_SMCAPTION 1
20 #define FONT_MENU 2
21 #define FONT_STATUS 3
22 #define FONT_MESSAGE 4
23 #define FONT_ICON 5
24
25 #define NUM_ELEMENTS 22
26 #define NUM_FONTS 6
27 #define NUM_SIZES 9
28 #define NUM_COLORS 31
29 #define MAX_TEMPLATES 50
30 #define MAX_TEMPLATENAMELENTGH 80
31
32 /* Some typedefs for theme */
33
34 /* Most (but not all) fields below correspond to HKCU\Control Panel\Desktop\UserPreferencesMask */
35 typedef struct
36 {
37 BOOL bActiveWindowTracking;
38 BOOL bMenuAnimation;
39 BOOL bComboBoxAnimation;
40 BOOL bListBoxSmoothScrolling;
41 BOOL bGradientCaptions;
42 BOOL bKeyboardCues;
43 BOOL bActiveWndTrkZorder;
44 BOOL bHotTracking;
45 BOOL bMenuFade;
46 BOOL bSelectionFade;
47 BOOL bTooltipAnimation;
48 BOOL bTooltipFade;
49 BOOL bCursorShadow;
50 BOOL bUiEffects;
51 BOOL bFontSmoothing;
52 BOOL bDragFullWindows;
53 UINT uiFontSmoothingType;
54 } EFFECTS;
55
56 typedef struct
57 {
58 NONCLIENTMETRICSW ncMetrics;
59 ICONMETRICSW icMetrics;
60 COLORREF crColor[NUM_COLORS];
61 INT iIconSize;
62 BOOL bFlatMenus;
63 EFFECTS Effects;
64 } COLOR_SCHEME, *PCOLOR_SCHEME;
65
66 /*
67 * The classic theme has several different 'colours' and every colour has
68 * several sizes. On visual styles however a theme has different colours
69 * and different sizes. In other words the user can select a combination
70 * of colour and size.
71 * That means that for the classic theme THEME.SizesList is unused and
72 * every color has some child styles that corespond its sizes.
73 * The themes for visual styles however will use both ColoursList and SizesList
74 * and ChildStyle will not be used.
75 */
76
77 /* struct for holding theme colors and sizes */
78 typedef struct _THEME_STYLE
79 {
80 struct _THEME_STYLE *NextStyle;
81 struct _THEME_STYLE *ChildStyle;
82 PWSTR StyleName;
83 PWSTR DisplayName;
84 } THEME_STYLE, *PTHEME_STYLE;
85
86 typedef struct _THEME
87 {
88 struct _THEME *NextTheme;
89 PWSTR ThemeFileName;
90 PWSTR DisplayName;
91 THEME_STYLE *ColoursList;
92 THEME_STYLE *SizesList;
93 } THEME, *PTHEME;
94
95 typedef struct _THEME_SELECTION
96 {
97 BOOL ThemeActive;
98 PTHEME Theme;
99 PTHEME_STYLE Color;
100 PTHEME_STYLE Size;
101 } THEME_SELECTION, *PTHEME_SELECTION;
102
103 /*
104 * This is the global structure used to store the current values.
105 * A pointer of this get's passed to the functions either directly
106 * or by passing hwnd and getting the pointer by GetWindowLongPtr.
107 */
108 typedef struct tagGLOBALS
109 {
110 PTHEME pThemes;
111
112 /*
113 * Keep a copy of the selected classic theme in order to select this
114 * when user selects the classic theme (and not a horrible random theme )
115 */
116 THEME_SELECTION ClassicTheme;
117 THEME_SELECTION ActiveTheme;
118
119 COLOR_SCHEME Scheme;
120 COLOR_SCHEME SchemeAdv;
121 BOOL bThemeChanged;
122 BOOL bSchemeChanged;
123 HBITMAP hbmpColor[3];
124 INT CurrentElement;
125 HFONT hBoldFont;
126 HFONT hItalicFont;
127 BOOL bInitializing;
128
129 HBITMAP hbmpThemePreview;
130 HDC hdcThemePreview;
131 } GLOBALS;
132
133 /* prototypes for theme.c */
134 VOID SchemeSetMetric(COLOR_SCHEME *scheme, int id, int value);
135 int SchemeGetMetric(COLOR_SCHEME *scheme, int id);
136 PLOGFONTW SchemeGetFont(COLOR_SCHEME *scheme, int id);
137 PTHEME LoadThemes(VOID);
138 BOOL GetActiveTheme(PTHEME pThemeList, PTHEME_SELECTION pSelectedTheme);
139 BOOL GetActiveClassicTheme(PTHEME pThemeList, PTHEME_SELECTION pSelectedTheme);
140 BOOL LoadCurrentScheme(PCOLOR_SCHEME scheme);
141 BOOL LoadSchemeFromReg(PCOLOR_SCHEME scheme, PTHEME_SELECTION pSelectedTheme);
142 BOOL LoadSchemeFromTheme(PCOLOR_SCHEME scheme, PTHEME_SELECTION pSelectedTheme);
143 VOID ApplyScheme(PCOLOR_SCHEME scheme, PTHEME_SELECTION pSelectedTheme);
144 BOOL ActivateTheme(PTHEME_SELECTION pSelectedTheme);
145 void CleanupThemes(IN PTHEME pThemeList);
146 BOOL DrawThemePreview(HDC hdcMem, PCOLOR_SCHEME scheme, PTHEME_SELECTION pSelectedTheme, PRECT prcWindow);
147
148 /* prototypes for appearance.c */
149 INT_PTR CALLBACK AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
150
151 /* prototypes for advappdlg.c */
152 INT_PTR CALLBACK AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
153
154 /* prototypes for effappdlg.c */
155 INT_PTR CALLBACK EffAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);