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
14 #define SIZE_ICON_SPACE_X 9
15 #define SIZE_ICON_SPACE_Y 10
18 #define FONT_CAPTION 0
19 #define FONT_SMCAPTION 1
22 #define FONT_MESSAGE 4
25 #define NUM_ELEMENTS 22
29 #define MAX_TEMPLATES 50
30 #define MAX_TEMPLATENAMELENTGH 80
32 /* Some typedefs for theme */
34 /* Most (but not all) fields below correspond to HKCU\Control Panel\Desktop\UserPreferencesMask */
37 BOOL bActiveWindowTracking
;
39 BOOL bComboBoxAnimation
;
40 BOOL bListBoxSmoothScrolling
;
41 BOOL bGradientCaptions
;
43 BOOL bActiveWndTrkZorder
;
47 BOOL bTooltipAnimation
;
52 BOOL bDragFullWindows
;
53 UINT uiFontSmoothingType
;
58 NONCLIENTMETRICSW ncMetrics
;
59 ICONMETRICSW icMetrics
;
60 COLORREF crColor
[NUM_COLORS
];
64 } COLOR_SCHEME
, *PCOLOR_SCHEME
;
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
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.
77 /* struct for holding theme colors and sizes */
78 typedef struct _THEME_STYLE
80 struct _THEME_STYLE
*NextStyle
;
81 struct _THEME_STYLE
*ChildStyle
;
84 } THEME_STYLE
, *PTHEME_STYLE
;
88 struct _THEME
*NextTheme
;
91 THEME_STYLE
*ColoursList
;
92 THEME_STYLE
*SizesList
;
95 typedef struct _THEME_SELECTION
101 } THEME_SELECTION
, *PTHEME_SELECTION
;
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.
108 typedef struct tagGLOBALS
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 )
116 THEME_SELECTION ClassicTheme
;
117 THEME_SELECTION ActiveTheme
;
120 COLOR_SCHEME SchemeAdv
;
123 HBITMAP hbmpColor
[3];
129 HBITMAP hbmpThemePreview
;
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
);
148 /* prototypes for appearance.c */
149 INT_PTR CALLBACK
AppearancePageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
151 /* prototypes for advappdlg.c */
152 INT_PTR CALLBACK
AdvAppearanceDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
154 /* prototypes for effappdlg.c */
155 INT_PTR CALLBACK
EffAppearanceDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);