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 18
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
;
53 UINT uiFontSmoothingType
;
54 BOOL bDragFullWindows
;
59 NONCLIENTMETRICSW ncMetrics
;
60 ICONMETRICSW icMetrics
;
61 COLORREF crColor
[NUM_COLORS
];
65 } COLOR_SCHEME
, *PCOLOR_SCHEME
;
68 * The classic theme has several different 'colours' and every colour has
69 * several sizes. On visual styles however a theme has different colours
70 * and different sizes. In other words the user can select a combination
72 * That means that for the classic theme THEME.SizesList is unused and
73 * every color has some child styles that corespond its sizes.
74 * The themes for visual styles however will use both ColoursList and SizesList
75 * and ChildStyle will not be used.
78 /* struct for holding theme colors and sizes */
79 typedef struct _THEME_STYLE
81 struct _THEME_STYLE
*NextStyle
;
82 struct _THEME_STYLE
*ChildStyle
;
85 } THEME_STYLE
, *PTHEME_STYLE
;
89 struct _THEME
*NextTheme
;
92 THEME_STYLE
*ColoursList
;
93 THEME_STYLE
*SizesList
;
96 typedef struct _THEME_SELECTION
102 } THEME_SELECTION
, *PTHEME_SELECTION
;
105 * This is the global structure used to store the current values.
106 * A pointer of this get's passed to the functions either directly
107 * or by passing hwnd and getting the pointer by GetWindowLongPtr.
109 typedef struct tagGLOBALS
114 * Keep a copy of the selected classic theme in order to select this
115 * when user selects the classic theme (and not a horrible random theme )
117 THEME_SELECTION ClassicTheme
;
118 THEME_SELECTION ActiveTheme
;
121 COLOR_SCHEME SchemeAdv
;
124 HBITMAP hbmpColor
[3];
130 HBITMAP hbmpThemePreview
;
134 /* prototypes for theme.c */
135 VOID
SchemeSetMetric(COLOR_SCHEME
*scheme
, int id
, int value
);
136 int SchemeGetMetric(COLOR_SCHEME
*scheme
, int id
);
137 PLOGFONTW
SchemeGetFont(COLOR_SCHEME
*scheme
, int id
);
138 PTHEME
LoadThemes(VOID
);
139 BOOL
GetActiveTheme(PTHEME pThemeList
, PTHEME_SELECTION pSelectedTheme
);
140 BOOL
GetActiveClassicTheme(PTHEME pThemeList
, PTHEME_SELECTION pSelectedTheme
);
141 BOOL
LoadCurrentScheme(PCOLOR_SCHEME scheme
);
142 BOOL
LoadSchemeFromReg(PCOLOR_SCHEME scheme
, PTHEME_SELECTION pSelectedTheme
);
143 BOOL
LoadSchemeFromTheme(PCOLOR_SCHEME scheme
, PTHEME_SELECTION pSelectedTheme
);
144 VOID
ApplyScheme(PCOLOR_SCHEME scheme
, PTHEME_SELECTION pSelectedTheme
);
145 BOOL
ActivateTheme(PTHEME_SELECTION pSelectedTheme
);
146 void CleanupThemes(IN PTHEME pThemeList
);
147 BOOL
DrawThemePreview(HDC hdcMem
, PCOLOR_SCHEME scheme
, PTHEME_SELECTION pSelectedTheme
, PRECT prcWindow
);
149 /* prototypes for appearance.c */
150 INT_PTR CALLBACK
AppearancePageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
152 /* prototypes for advappdlg.c */
153 INT_PTR CALLBACK
AdvAppearanceDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
155 /* prototypes for effappdlg.c */
156 INT_PTR CALLBACK
EffAppearanceDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);