ReactOS 0.4.17-dev-573-g8315b8c
appearance.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  EFFECTS
 
struct  COLOR_SCHEME
 
struct  _THEME_STYLE
 
struct  _THEME
 
struct  _THEME_SELECTION
 
struct  tagGLOBALS
 

Macros

#define SIZE_BORDER_WIDTH   0
 
#define SIZE_SCROLL_WIDTH   1
 
#define SIZE_SCROLL_HEIGHT   2
 
#define SIZE_CAPTION_WIDTH   3
 
#define SIZE_CAPTION_HEIGHT   4
 
#define SIZE_SM_CAPTION_WIDTH   5
 
#define SIZE_SM_CAPTION_HEIGHT   6
 
#define SIZE_MENU_WIDTH   7
 
#define SIZE_MENU_HEIGHT   8
 
#define SIZE_ICON_SPACE_X   9
 
#define SIZE_ICON_SPACE_Y   10
 
#define SIZE_ICON   11
 
#define FONT_CAPTION   0
 
#define FONT_SMCAPTION   1
 
#define FONT_MENU   2
 
#define FONT_STATUS   3
 
#define FONT_MESSAGE   4
 
#define FONT_ICON   5
 
#define NUM_ELEMENTS   18
 
#define NUM_FONTS   6
 
#define NUM_SIZES   9
 
#define NUM_COLORS   31
 
#define MAX_TEMPLATES   50
 
#define MAX_TEMPLATENAMELENTGH   80
 

Typedefs

typedef struct COLOR_SCHEMEPCOLOR_SCHEME
 
typedef struct _THEME_STYLE THEME_STYLE
 
typedef struct _THEME_STYLEPTHEME_STYLE
 
typedef struct _THEME THEME
 
typedef struct _THEMEPTHEME
 
typedef struct _THEME_SELECTION THEME_SELECTION
 
typedef struct _THEME_SELECTIONPTHEME_SELECTION
 
typedef struct tagGLOBALS GLOBALS
 

Functions

VOID SchemeSetMetric (COLOR_SCHEME *scheme, int id, int value)
 
int SchemeGetMetric (COLOR_SCHEME *scheme, int id)
 
PLOGFONTW SchemeGetFont (COLOR_SCHEME *scheme, int id)
 
PTHEME LoadTheme (IN LPCWSTR pszThemeFileName, IN LPCWSTR pszThemeName)
 
PTHEME LoadThemes (VOID)
 
BOOL FindOrAppendTheme (IN PTHEME pThemeList, IN LPCWSTR pwszThemeFileName, IN LPCWSTR pwszColorBuff, IN LPCWSTR pwszSizeBuff, OUT PTHEME_SELECTION pSelectedTheme)
 
BOOL GetActiveTheme (PTHEME pThemeList, PTHEME_SELECTION pSelectedTheme)
 
BOOL GetActiveClassicTheme (PTHEME pThemeList, PTHEME_SELECTION pSelectedTheme)
 
BOOL LoadCurrentScheme (PCOLOR_SCHEME scheme)
 
BOOL LoadSchemeFromReg (PCOLOR_SCHEME scheme, PTHEME_SELECTION pSelectedTheme)
 
BOOL LoadSchemeFromTheme (PCOLOR_SCHEME scheme, PTHEME_SELECTION pSelectedTheme)
 
VOID ApplyScheme (PCOLOR_SCHEME scheme, PTHEME_SELECTION pSelectedTheme)
 
BOOL ActivateTheme (PTHEME_SELECTION pSelectedTheme)
 
void CleanupThemes (IN PTHEME pThemeList)
 
BOOL DrawThemePreview (HDC hdcMem, PCOLOR_SCHEME scheme, PTHEME_SELECTION pSelectedTheme, PRECT prcWindow)
 
BOOL ActivateThemeFile (LPCWSTR pwszFile)
 
INT_PTR CALLBACK AppearancePageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK AdvAppearanceDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK EffAppearanceDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Macro Definition Documentation

◆ FONT_CAPTION

#define FONT_CAPTION   0

Definition at line 18 of file appearance.h.

◆ FONT_ICON

#define FONT_ICON   5

Definition at line 23 of file appearance.h.

◆ FONT_MENU

#define FONT_MENU   2

Definition at line 20 of file appearance.h.

◆ FONT_MESSAGE

#define FONT_MESSAGE   4

Definition at line 22 of file appearance.h.

◆ FONT_SMCAPTION

#define FONT_SMCAPTION   1

Definition at line 19 of file appearance.h.

◆ FONT_STATUS

#define FONT_STATUS   3

Definition at line 21 of file appearance.h.

◆ MAX_TEMPLATENAMELENTGH

#define MAX_TEMPLATENAMELENTGH   80

Definition at line 30 of file appearance.h.

◆ MAX_TEMPLATES

#define MAX_TEMPLATES   50

Definition at line 29 of file appearance.h.

◆ NUM_COLORS

#define NUM_COLORS   31

Definition at line 28 of file appearance.h.

◆ NUM_ELEMENTS

#define NUM_ELEMENTS   18

Definition at line 25 of file appearance.h.

◆ NUM_FONTS

#define NUM_FONTS   6

Definition at line 26 of file appearance.h.

◆ NUM_SIZES

#define NUM_SIZES   9

Definition at line 27 of file appearance.h.

◆ SIZE_BORDER_WIDTH

#define SIZE_BORDER_WIDTH   0

Definition at line 4 of file appearance.h.

◆ SIZE_CAPTION_HEIGHT

#define SIZE_CAPTION_HEIGHT   4

Definition at line 8 of file appearance.h.

◆ SIZE_CAPTION_WIDTH

#define SIZE_CAPTION_WIDTH   3

Definition at line 7 of file appearance.h.

◆ SIZE_ICON

#define SIZE_ICON   11

Definition at line 16 of file appearance.h.

◆ SIZE_ICON_SPACE_X

#define SIZE_ICON_SPACE_X   9

Definition at line 14 of file appearance.h.

◆ SIZE_ICON_SPACE_Y

#define SIZE_ICON_SPACE_Y   10

Definition at line 15 of file appearance.h.

◆ SIZE_MENU_HEIGHT

#define SIZE_MENU_HEIGHT   8

Definition at line 12 of file appearance.h.

◆ SIZE_MENU_WIDTH

#define SIZE_MENU_WIDTH   7

Definition at line 11 of file appearance.h.

◆ SIZE_SCROLL_HEIGHT

#define SIZE_SCROLL_HEIGHT   2

Definition at line 6 of file appearance.h.

◆ SIZE_SCROLL_WIDTH

#define SIZE_SCROLL_WIDTH   1

Definition at line 5 of file appearance.h.

◆ SIZE_SM_CAPTION_HEIGHT

#define SIZE_SM_CAPTION_HEIGHT   6

Definition at line 10 of file appearance.h.

◆ SIZE_SM_CAPTION_WIDTH

#define SIZE_SM_CAPTION_WIDTH   5

Definition at line 9 of file appearance.h.

Typedef Documentation

◆ GLOBALS

◆ PCOLOR_SCHEME

◆ PTHEME

typedef struct _THEME * PTHEME

◆ PTHEME_SELECTION

◆ PTHEME_STYLE

◆ THEME

typedef struct _THEME THEME

◆ THEME_SELECTION

◆ THEME_STYLE

Function Documentation

◆ ActivateTheme()

BOOL ActivateTheme ( PTHEME_SELECTION  pSelectedTheme)

Referenced by AppearancePageProc().

◆ ActivateThemeFile()

BOOL ActivateThemeFile ( LPCWSTR  pwszFile)

Definition at line 1040 of file theme.c.

1041{
1042 PTHEME pThemes;
1045 BOOL ret = FALSE;
1046
1047 pThemes = LoadThemes();
1048 if (!pThemes)
1049 return FALSE;
1050
1052
1053 if (pwszFile)
1054 {
1055 ret = FindOrAppendTheme(pThemes, pwszFile, NULL, NULL, &selection);
1056 if (!ret)
1057 goto cleanup;
1058
1060 if (!ret)
1061 goto cleanup;
1062 }
1063 else
1064 {
1065 ret = GetActiveClassicTheme(pThemes, &selection);
1066 if (!ret)
1067 goto cleanup;
1068
1070 if (!ret)
1071 goto cleanup;
1072 }
1073
1075 if (!ret)
1076 goto cleanup;
1077
1079
1080 ret = TRUE;
1081
1082cleanup:
1083 CleanupThemes(pThemes);
1084
1085 return ret;
1086}
int selection
Definition: ctm.c:92
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
void CleanupThemes(IN PTHEME pThemeList)
Definition: theme.c:552
BOOL FindOrAppendTheme(IN PTHEME pThemeList, IN LPCWSTR pwszThemeFileName, IN LPCWSTR pwszColorBuff, IN LPCWSTR pwszSizeBuff, OUT PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:816
BOOL LoadSchemeFromTheme(OUT PCOLOR_SCHEME scheme, IN PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:963
BOOL GetActiveClassicTheme(IN PTHEME pThemeList, OUT PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:894
BOOL ActivateTheme(IN PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:936
VOID ApplyScheme(IN COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:330
PTHEME LoadThemes(VOID)
Definition: theme.c:774
BOOL LoadSchemeFromReg(OUT COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:243
BOOL LoadCurrentScheme(OUT COLOR_SCHEME *scheme)
Definition: theme.c:122
static void cleanup(void)
Definition: main.c:1335
return ret
Definition: mutex.c:146
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD scheme

Referenced by DisplayApplet().

◆ AdvAppearanceDlgProc()

INT_PTR CALLBACK AdvAppearanceDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 503 of file advappdlg.c.

504{
505 INT iSelection, iProperty;
506 GLOBALS* g;
507 PLOGFONTW plfFont;
508
509 g = (GLOBALS*)GetWindowLongPtr(hwndDlg, DWLP_USER);
510
511 switch (uMsg)
512 {
513 case WM_INITDIALOG:
514 g = (GLOBALS*)lParam;
516 AdvAppearanceDlg_Init(hwndDlg, g);
517 break;
518
519 case WM_DESTROY:
520 AdvAppearanceDlg_CleanUp(hwndDlg, g);
521 break;
522
523 case WM_COMMAND:
524 if (g == NULL)
525 return TRUE;
526
527 switch(LOWORD(wParam))
528 {
529 case IDOK:
530 SaveCurrentValues(hwndDlg, g);
531 EndDialog(hwndDlg, IDOK);
532 break;
533
534 case IDCANCEL:
535 g->SchemeAdv = g->Scheme;
536 EndDialog(hwndDlg, IDCANCEL);
537 break;
538
540 SaveCurrentValues(hwndDlg, g);
542 g->CurrentElement = (INT)lParam;
543 UpdateControls(hwndDlg, g);
544 break;
545
548 {
549 SaveCurrentValues(hwndDlg, g);
550 iSelection = SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_GETCURSEL, 0, 0);
551 g->CurrentElement = SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_GETITEMDATA, iSelection, 0);
552 UpdateControls(hwndDlg, g);
553 }
554 break;
555
557 if (HIWORD(wParam) == EN_CHANGE)
558 {
559 iProperty = g_Assignment[g->CurrentElement].Size;
560 if (iProperty == -1)
561 return TRUE;
562
564 SchemeSetMetric(&g->SchemeAdv, iProperty, iSelection);
565 SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETSIZE, iProperty, iSelection);
566
567 iProperty = g_Assignment[g->CurrentElement].Size2;
568 if (iProperty != -1)
569 SchemeSetMetric(&g->SchemeAdv, iProperty, iSelection);
570 }
571 break;
572
575 {
576 iProperty = g_Assignment[g->CurrentElement].Font;
577 if (iProperty == -1)
578 return TRUE;
579
580 plfFont = SchemeGetFont(&g->SchemeAdv, iProperty);
582 SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETFONT, iProperty, (LPARAM)plfFont);
583 }
584 break;
585
588 {
589 HDC hdcDlg;
590
591 iProperty = g_Assignment[g->CurrentElement].Font;
592 if (iProperty == -1)
593 return TRUE;
594
595 hdcDlg = GetDC(hwndDlg);
596
597 plfFont = SchemeGetFont(&g->SchemeAdv, iProperty);
599 plfFont->lfHeight = -MulDiv(iSelection , GetDeviceCaps(hdcDlg, LOGPIXELSY), 72);
601
602 ReleaseDC(hwndDlg, hdcDlg);
603 }
604 break;
605
607 if (HIWORD(wParam) == BN_CLICKED)
608 {
609 iProperty = g_Assignment[g->CurrentElement].Font;
610 if (iProperty == -1)
611 return TRUE;
612
613 plfFont = SchemeGetFont(&g->SchemeAdv, iProperty);
614 iSelection = (INT)SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTBOLD, BM_GETCHECK, 0, 0);
615 plfFont->lfWeight = (iSelection == BST_CHECKED) ? FW_BOLD : FW_NORMAL;
616 SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETFONT, iProperty, (LPARAM)plfFont);
617 }
618 break;
619
621 if (HIWORD(wParam) == BN_CLICKED)
622 {
623 iProperty = g_Assignment[g->CurrentElement].Font;
624 if (iProperty == -1)
625 return TRUE;
626
627 plfFont = SchemeGetFont(&g->SchemeAdv, iProperty);
628 iSelection = (INT)SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTITALIC, BM_GETCHECK, 0, 0);
629 plfFont->lfItalic = (iSelection == BST_CHECKED) ? TRUE : FALSE;
630 SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETFONT, iProperty, (LPARAM)plfFont);
631 }
632 break;
633
635 GetColor(hwndDlg, g, 0);
636 break;
637
639 GetColor(hwndDlg, g, 1);
640 break;
641
643 GetColor(hwndDlg, g, 2);
644 break;
645
646 default:
647 return FALSE;
648 }
649 break;
650
651 default:
652 return FALSE;
653 }
654
655 return TRUE;
656}
static VOID SelectComboByElement(HWND hwnd, INT id, LPARAM lParam)
Definition: advappdlg.c:445
static VOID AdvAppearanceDlg_CleanUp(HWND hwndDlg, GLOBALS *g)
Definition: advappdlg.c:437
static VOID UpdateControls(HWND hwndDlg, GLOBALS *g)
Definition: advappdlg.c:206
const ASSIGNMENT g_Assignment[NUM_ELEMENTS]
Definition: advappdlg.c:28
static VOID GetSelectedComboText(HWND hwnd, INT id, LPWSTR lpStr)
Definition: advappdlg.c:466
static BOOL GetColor(HWND hwndDlg, GLOBALS *g, INT nButton)
Definition: advappdlg.c:286
static INT GetSelectedComboInt(HWND hwnd, INT id)
Definition: advappdlg.c:486
static VOID SaveCurrentValues(HWND hwndDlg, GLOBALS *g)
Definition: advappdlg.c:261
static VOID AdvAppearanceDlg_Init(HWND hwndDlg, GLOBALS *g)
Definition: advappdlg.c:343
PLOGFONTW SchemeGetFont(COLOR_SCHEME *scheme, int id)
VOID SchemeSetMetric(COLOR_SCHEME *scheme, int id, int value)
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define IDC_ADVAPPEARANCE_COLOR2_B
Definition: resource.h:126
#define IDC_ADVAPPEARANCE_SIZE_UD
Definition: resource.h:122
#define IDC_ADVAPPEARANCE_SIZE_E
Definition: resource.h:121
#define IDC_ADVAPPEARANCE_FONTBOLD
Definition: resource.h:133
#define IDC_ADVAPPEARANCE_FONTSIZE_E
Definition: resource.h:130
#define IDC_ADVAPPEARANCE_FONTITALIC
Definition: resource.h:134
#define IDC_ADVAPPEARANCE_COLOR1_B
Definition: resource.h:124
#define IDC_APPEARANCE_PREVIEW
Definition: resource.h:97
#define IDC_ADVAPPEARANCE_ELEMENT
Definition: resource.h:119
#define IDC_ADVAPPEARANCE_FONTCOLOR_B
Definition: resource.h:132
#define IDC_ADVAPPEARANCE_FONT_C
Definition: resource.h:128
#define L(x)
Definition: resources.c:13
GLboolean GLboolean g
Definition: glext.h:6204
LONG_PTR LPARAM
Definition: minwindef.h:175
static HDC
Definition: imagelist.c:88
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
#define LOWORD(l)
Definition: pedump.c:82
#define INT
Definition: polytest.cpp:20
#define PVM_SETFONT
Definition: preview.h:28
#define PVM_SETSIZE
Definition: preview.h:26
#define PVM_UPDATETHEME
Definition: preview.h:33
#define UDM_GETPOS
Definition: commctrl.h:2149
int Font
Definition: advappdlg.c:21
int Size2
Definition: advappdlg.c:18
int Size
Definition: advappdlg.c:17
WCHAR lfFaceName[LF_FACESIZE]
Definition: wingdi.h:2356
LONG lfHeight
Definition: wingdi.h:2343
BYTE lfItalic
Definition: wingdi.h:2348
LONG lfWeight
Definition: wingdi.h:2347
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:378
#define LOGPIXELSY
Definition: wingdi.h:719
#define FW_NORMAL
Definition: wingdi.h:373
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define DWLP_USER
Definition: winuser.h:883
#define IDCANCEL
Definition: winuser.h:842
#define WM_COMMAND
Definition: winuser.h:1768
#define WM_INITDIALOG
Definition: winuser.h:1767
#define IDOK
Definition: winuser.h:841
#define CBN_SELCHANGE
Definition: winuser.h:2008
#define CB_GETITEMDATA
Definition: winuser.h:1979
HDC WINAPI GetDC(_In_opt_ HWND)
#define BN_CLICKED
Definition: winuser.h:1954
#define WM_DESTROY
Definition: winuser.h:1637
#define CB_GETCURSEL
Definition: winuser.h:1972
#define SendDlgItemMessage
Definition: winuser.h:6008
#define BST_CHECKED
Definition: winuser.h:197
#define CBN_EDITCHANGE
Definition: winuser.h:2004
#define BM_GETCHECK
Definition: winuser.h:1947
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define EN_CHANGE
Definition: winuser.h:2051

Referenced by AppearancePageProc().

◆ AppearancePageProc()

INT_PTR CALLBACK AppearancePageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 216 of file appearance.c.

217{
218 GLOBALS *g;
219 LPNMHDR lpnm;
220
221 g = (GLOBALS*)GetWindowLongPtr(hwndDlg, DWLP_USER);
222
223 switch (uMsg)
224 {
225 case WM_INITDIALOG:
226 return AppearancePage_OnInit(hwndDlg);
227
228 case WM_DESTROY:
229 AppearancePage_OnDestroy(hwndDlg, g);
230 break;
231
232 case WM_COMMAND:
233 if (g == NULL || g->bInitializing)
234 return FALSE;
235
236 switch (LOWORD(wParam))
237 {
240 hwndDlg, EffAppearanceDlgProc, (LPARAM)g) == IDOK)
241 {
242 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
243 g->Scheme = g->SchemeAdv;
244 g->bSchemeChanged = TRUE;
245
247 }
248 break;
249
252 hwndDlg, AdvAppearanceDlgProc, (LPARAM)g) == IDOK)
253 {
254 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
255 g->bSchemeChanged = TRUE;
256 g->Scheme = g->SchemeAdv;
257 g_GlobalData.desktop_color = g->Scheme.crColor[COLOR_DESKTOP];
258
260 }
261 break;
262
265 {
266 g->ActiveTheme.Color = (PTHEME_STYLE)GetSelectedData(hwndDlg, IDC_APPEARANCE_COLORSCHEME);
267 if (g->ActiveTheme.Color->ChildStyle != NULL)
268 g->ActiveTheme.Size = g->ActiveTheme.Color->ChildStyle;
269
270 g->bSchemeChanged = TRUE;
271 if (g->ActiveTheme.ThemeActive)
272 g->bThemeChanged = TRUE;
273
274 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
275
277 AppearancePage_ShowSizes(hwndDlg, g);
279 }
280 break;
281
284 {
286
287 if (g->ClassicTheme.Theme == pTheme)
288 g->ActiveTheme = g->ClassicTheme;
289 else
290 {
291 g->ActiveTheme.Theme = pTheme;
292 g->ActiveTheme.Size = pTheme->SizesList;
293 g->ActiveTheme.Color = pTheme->ColoursList;
294 g->ActiveTheme.ThemeActive = TRUE;
295 }
296
297 g->bThemeChanged = TRUE;
298 g->bSchemeChanged = TRUE;
299
300 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
301
303 AppearancePage_ShowSizes(hwndDlg, g);
306 }
307 break;
308
311 {
312 g->ActiveTheme.Size = (PTHEME_STYLE)GetSelectedData(hwndDlg, IDC_APPEARANCE_SIZE);
313 g->bSchemeChanged = TRUE;
314 if (g->ActiveTheme.ThemeActive)
315 g->bThemeChanged = TRUE;
316
317 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
318
321 }
322 }
323 break;
324
325 case WM_NOTIFY:
326 lpnm = (LPNMHDR)lParam;
327 switch (lpnm->code)
328 {
329 case PSN_APPLY:
330
331 if (g->bThemeChanged)
332 {
333 ActivateTheme(&g->ActiveTheme);
334 }
335
336 if (g->bSchemeChanged)
337 {
338 ApplyScheme(&g->Scheme, &g->ActiveTheme);
339 if (g->ActiveTheme.ThemeActive == FALSE)
340 g->ClassicTheme = g->ActiveTheme;
341 }
342
344 g->bThemeChanged = FALSE;
345 g->bSchemeChanged = FALSE;
347 return TRUE;
348
349 case PSN_KILLACTIVE:
351 return TRUE;
352
353 case PSN_SETACTIVE:
354 if (g->Scheme.crColor[COLOR_DESKTOP] != g_GlobalData.desktop_color)
355 {
356 g->Scheme.crColor[COLOR_DESKTOP] = g_GlobalData.desktop_color;
358 }
359 break;
360 }
361 break;
362 }
363
364 return FALSE;
365}
INT_PTR CALLBACK AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: advappdlg.c:503
static void AppearancePage_UpdateThemePreview(HWND hwndDlg, GLOBALS *g)
Definition: appearance.c:16
static INT_PTR AppearancePage_OnInit(HWND hwndDlg)
Definition: appearance.c:97
static VOID AppearancePage_OnDestroy(HWND hwndDlg, GLOBALS *g)
Definition: appearance.c:197
static void AppearancePage_ShowSizes(HWND hwndDlg, GLOBALS *g)
Definition: appearance.c:81
static PVOID GetSelectedData(HWND hwndDlg, int nIDDlgItem)
Definition: appearance.c:203
static void AppearancePage_LoadSelectedScheme(HWND hwndDlg, GLOBALS *g)
Definition: appearance.c:35
static void AppearancePage_ShowColorSchemes(HWND hwndDlg, GLOBALS *g)
Definition: appearance.c:72
struct _THEME_STYLE * PTHEME_STYLE
VOID ApplyScheme(PCOLOR_SCHEME scheme, PTHEME_SELECTION pSelectedTheme)
struct _THEME * PTHEME
BOOL ActivateTheme(PTHEME_SELECTION pSelectedTheme)
INT_PTR CALLBACK EffAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: effappdlg.c:155
GLOBAL_DATA g_GlobalData
Definition: background.c:71
HINSTANCE hApplet
Definition: access.c:17
#define IDC_APPEARANCE_VISUAL_STYLE
Definition: resource.h:102
#define IDC_APPEARANCE_ADVANCED
Definition: resource.h:101
#define IDC_APPEARANCE_EFFECTS
Definition: resource.h:100
#define IDC_APPEARANCE_COLORSCHEME
Definition: resource.h:98
#define IDD_ADVAPPEARANCE
Definition: resource.h:14
#define IDD_EFFAPPEARANCE
Definition: resource.h:15
#define IDC_APPEARANCE_SIZE
Definition: resource.h:103
#define MAKEINTRESOURCE(i)
Definition: ntverrsrc.c:25
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSN_KILLACTIVE
Definition: prsht.h:116
#define PSN_APPLY
Definition: prsht.h:117
#define PSNRET_NOERROR
Definition: prsht.h:129
#define PSN_SETACTIVE
Definition: prsht.h:115
#define WM_NOTIFY
Definition: richedit.h:61
COLORREF desktop_color
Definition: desk.h:163
THEME_STYLE * SizesList
Definition: appearance.h:93
THEME_STYLE * ColoursList
Definition: appearance.h:92
UINT code
Definition: winuser.h:3267
#define DialogBoxParam
Definition: winuser.h:5930
#define COLOR_DESKTOP
Definition: winuser.h:925
struct tagNMHDR * LPNMHDR
HWND WINAPI GetParent(_In_ HWND)
#define DWLP_MSGRESULT
Definition: winuser.h:881

◆ ApplyScheme()

VOID ApplyScheme ( PCOLOR_SCHEME  scheme,
PTHEME_SELECTION  pSelectedTheme 
)

Referenced by AppearancePageProc().

◆ CleanupThemes()

void CleanupThemes ( IN PTHEME  pThemeList)

Definition at line 552 of file theme.c.

553{
554 PTHEME pTheme, pThemeOld;
555
556 pTheme = pThemeList;
557 while (pTheme)
558 {
559 CleanupStyles(pTheme->ColoursList);
560 if (pTheme->SizesList) CleanupStyles(pTheme->SizesList);
561 if (pTheme->DisplayName) free(pTheme->DisplayName);
562 if (pTheme->ThemeFileName) free(pTheme->ThemeFileName);
563
564 pThemeOld = pTheme;
565 pTheme = pTheme->NextTheme;
566 free(pThemeOld);
567 }
568}
#define free
Definition: debug_ros.c:5
static void CleanupStyles(IN PTHEME_STYLE pStylesList)
Definition: theme.c:534
PWSTR ThemeFileName
Definition: appearance.h:90
struct _THEME * NextTheme
Definition: appearance.h:89
PWSTR DisplayName
Definition: appearance.h:91

Referenced by ActivateThemeFile(), and LoadTheme().

◆ DrawThemePreview()

BOOL DrawThemePreview ( HDC  hdcMem,
PCOLOR_SCHEME  scheme,
PTHEME_SELECTION  pSelectedTheme,
PRECT  prcWindow 
)

◆ EffAppearanceDlgProc()

INT_PTR CALLBACK EffAppearanceDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 155 of file effappdlg.c.

156{
157 GLOBALS* g;
158
159 g = (GLOBALS*)GetWindowLongPtr(hwndDlg, DWLP_USER);
160
161 switch (uMsg)
162 {
163 case WM_INITDIALOG:
164 g = (GLOBALS*)lParam;
166 EffAppearanceDlg_Init(hwndDlg, g);
167 break;
168
169 case WM_DESTROY:
170 break;
171
172 case WM_COMMAND:
173 switch(LOWORD(wParam))
174 {
175 case IDOK:
177 EndDialog(hwndDlg, IDOK);
178 break;
179
180 case IDCANCEL:
181 g->SchemeAdv = g->Scheme;
182 EndDialog(hwndDlg, IDCANCEL);
183 break;
184
192 if (HIWORD(wParam) == BN_CLICKED)
194 break;
195
199 {
200 INT Index =
202 CB_GETCURSEL, 0, 0);
203
204 g->SchemeAdv.Effects.bMenuFade =
206 CB_GETCURSEL, 0, 0);
207 g->SchemeAdv.Effects.uiFontSmoothingType = (Index == CB_ERR) ? 0 : (Index + 1);
208
210 }
211 break;
212
213 default:
214 return FALSE;
215 }
216 break;
217
218 default:
219 return FALSE;
220 }
221
222 return TRUE;
223}
#define IDC_EFFAPPEARANCE_LARGEICONS
Definition: resource.h:172
#define IDC_EFFAPPEARANCE_SETDROPSHADOW
Definition: resource.h:173
#define IDC_EFFAPPEARANCE_DRAGFULLWINDOWS
Definition: resource.h:174
#define IDC_EFFAPPEARANCE_FLATMENUS
Definition: resource.h:175
#define IDC_EFFAPPEARANCE_SMOOTHING
Definition: resource.h:170
#define IDC_EFFAPPEARANCE_ANIMATIONTYPE
Definition: resource.h:169
#define IDC_EFFAPPEARANCE_KEYBOARDCUES
Definition: resource.h:167
#define IDC_EFFAPPEARANCE_ANIMATION
Definition: resource.h:168
#define IDC_EFFAPPEARANCE_SMOOTHINGTYPE
Definition: resource.h:171
static VOID EffAppearanceDlg_Init(HWND hwndDlg, GLOBALS *g)
Definition: effappdlg.c:88
static VOID EffAppearanceDlgSaveCurrentValues(HWND hwndDlg, GLOBALS *g)
Definition: effappdlg.c:67
static VOID EffAppearanceDlgUpdateControls(HWND hwndDlg, GLOBALS *g)
Definition: effappdlg.c:18
_In_ WDFCOLLECTION _In_ ULONG Index
#define CB_ERR
Definition: winuser.h:2471
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by AppearancePageProc().

◆ FindOrAppendTheme()

BOOL FindOrAppendTheme ( IN PTHEME  pThemeList,
IN LPCWSTR  pwszThemeFileName,
IN LPCWSTR  pwszColorBuff,
IN LPCWSTR  pwszSizeBuff,
OUT PTHEME_SELECTION  pSelectedTheme 
)

Definition at line 816 of file theme.c.

821{
822 PTHEME pTheme;
823 PTHEME pFoundTheme = NULL;
824
825 ZeroMemory(pSelectedTheme, sizeof(THEME_SELECTION));
826
827 for (pTheme = pThemeList; pTheme; pTheme = pTheme->NextTheme)
828 {
829 if (pTheme->ThemeFileName &&
830 _wcsicmp(pTheme->ThemeFileName, pwszThemeFileName) == 0)
831 {
832 pFoundTheme = pTheme;
833 break;
834 }
835
836 if (pTheme->NextTheme == NULL)
837 break;
838 }
839
840 if (!pFoundTheme)
841 {
842 pFoundTheme = LoadTheme(pwszThemeFileName, pwszThemeFileName);
843 if (!pFoundTheme)
844 return FALSE;
845
846 pTheme->NextTheme = pFoundTheme;
847 }
848
849 pSelectedTheme->ThemeActive = TRUE;
850 pSelectedTheme->Theme = pFoundTheme;
851 if (pwszColorBuff)
852 pSelectedTheme->Color = FindStyle(pFoundTheme->ColoursList, pwszColorBuff);
853 else
854 pSelectedTheme->Color = pFoundTheme->ColoursList;
855
856 if (pwszSizeBuff)
857 pSelectedTheme->Size = FindStyle(pFoundTheme->SizesList, pwszSizeBuff);
858 else
859 pSelectedTheme->Size = pFoundTheme->SizesList;
860
861 return TRUE;
862}
static PTHEME_STYLE FindStyle(IN PTHEME_STYLE pStylesList, IN PCWSTR StyleName)
Definition: theme.c:571
PTHEME LoadTheme(IN LPCWSTR pszThemeFileName, IN LPCWSTR pszThemeName)
Definition: theme.c:732
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:164
#define ZeroMemory
Definition: minwinbase.h:31

Referenced by ActivateThemeFile(), AppearancePage_OnInit(), and GetActiveTheme().

◆ GetActiveClassicTheme()

BOOL GetActiveClassicTheme ( PTHEME  pThemeList,
PTHEME_SELECTION  pSelectedTheme 
)

Referenced by AppearancePage_OnInit().

◆ GetActiveTheme()

BOOL GetActiveTheme ( PTHEME  pThemeList,
PTHEME_SELECTION  pSelectedTheme 
)

Referenced by AppearancePage_OnInit().

◆ LoadCurrentScheme()

BOOL LoadCurrentScheme ( PCOLOR_SCHEME  scheme)

Referenced by AppearancePage_OnInit(), and OnCreate().

◆ LoadSchemeFromReg()

BOOL LoadSchemeFromReg ( PCOLOR_SCHEME  scheme,
PTHEME_SELECTION  pSelectedTheme 
)

◆ LoadSchemeFromTheme()

BOOL LoadSchemeFromTheme ( PCOLOR_SCHEME  scheme,
PTHEME_SELECTION  pSelectedTheme 
)

◆ LoadTheme()

PTHEME LoadTheme ( IN LPCWSTR  pszThemeFileName,
IN LPCWSTR  pszThemeName 
)

Definition at line 732 of file theme.c.

733{
734 PTHEME pTheme = CreateTheme(pszThemeFileName, pszThemeName);
735 if (pTheme == NULL)
736 return NULL;
737
738 pTheme->SizesList = EnumThemeStyles( pszThemeFileName, (ENUMTHEMESTYLE)EnumThemeSizes);
739 pTheme->ColoursList = EnumThemeStyles( pszThemeFileName, (ENUMTHEMESTYLE)EnumThemeColors);
740 if(pTheme->SizesList == NULL || pTheme->ColoursList == NULL)
741 {
742 CleanupThemes(pTheme);
743 return NULL;
744 }
745
746 return pTheme;
747}
static THEME_STYLE * EnumThemeStyles(IN LPCWSTR pszThemeFileName, IN ENUMTHEMESTYLE pfnEnumTheme)
Definition: theme.c:712
HRESULT(WINAPI * ENUMTHEMESTYLE)(LPCWSTR, LPWSTR, DWORD, PTHEMENAMES)
Definition: theme.c:709
static THEME * CreateTheme(LPCWSTR pszName, LPCWSTR pszDisplayName)
Definition: theme.c:469
HRESULT WINAPI EnumThemeColors(LPWSTR pszThemeFileName, LPWSTR pszSizeName, DWORD dwColorNum, PTHEMENAMES pszColorNames)
Definition: system.c:1433
HRESULT WINAPI EnumThemeSizes(LPWSTR pszThemeFileName, LPWSTR pszColorName, DWORD dwSizeNum, PTHEMENAMES pszSizeNames)
Definition: system.c:1496

Referenced by EnumThemeProc(), and FindOrAppendTheme().

◆ LoadThemes()

PTHEME LoadThemes ( VOID  )

Definition at line 774 of file theme.c.

775{
776 HRESULT hret;
777 PTHEME pClassicTheme;
778 WCHAR strClassicTheme[40];
779 WCHAR szThemesPath[MAX_PATH], *pszClassicTheme;
780 int res;
781
782 /* Insert the classic theme */
783 res = LoadString(hApplet, IDS_CLASSIC_THEME, strClassicTheme, 40);
784 pszClassicTheme = (res > 0 ? strClassicTheme : L"Classic Theme");
785 pClassicTheme = CreateTheme(NULL, pszClassicTheme);
786 if (pClassicTheme == NULL) return NULL;
787 pClassicTheme->ColoursList = LoadClassicColorSchemes();
788
789 /* Get path to themes folder */
790 ZeroMemory(szThemesPath, sizeof(szThemesPath));
792 if (FAILED(hret)) return pClassicTheme;
793 lstrcatW (szThemesPath, L"\\Themes");
794
795 /* Enumerate themes */
796 hret = EnumThemes( szThemesPath, EnumThemeProc, &pClassicTheme->NextTheme);
797 if (FAILED(hret))
798 {
799 pClassicTheme->NextTheme = NULL;
800 if (pClassicTheme->ColoursList == NULL)
801 {
802 free(pClassicTheme->DisplayName);
803 free(pClassicTheme);
804 return NULL;
805 }
806 }
807
808 return pClassicTheme;
809}
#define IDS_CLASSIC_THEME
Definition: resource.h:111
BOOL CALLBACK EnumThemeProc(IN LPVOID lpReserved, IN LPCWSTR pszThemeFileName, IN LPCWSTR pszThemeName, IN LPCWSTR pszToolTip, IN LPVOID lpReserved2, IN OUT LPVOID lpData)
Definition: theme.c:750
static THEME_STYLE * LoadClassicColorSchemes(VOID)
Definition: theme.c:650
#define MAX_PATH
Definition: compat.h:34
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2717
HRESULT WINAPI EnumThemes(LPCWSTR pszThemePath, ENUMTHEMEPROC callback, LPVOID lpData)
Definition: system.c:1344
GLuint res
Definition: glext.h:9613
#define FAILED(hr)
Definition: intsafe.h:51
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
short WCHAR
Definition: pedump.c:58
@ SHGFP_TYPE_DEFAULT
Definition: shlobj.h:2168
#define CSIDL_RESOURCES
Definition: shlobj.h:2243
#define LoadString
Definition: winuser.h:5985

Referenced by ActivateThemeFile(), and AppearancePage_OnInit().

◆ SchemeGetFont()

PLOGFONTW SchemeGetFont ( COLOR_SCHEME scheme,
int  id 
)

◆ SchemeGetMetric()

int SchemeGetMetric ( COLOR_SCHEME scheme,
int  id 
)

Referenced by PreviewWndProc(), and UpdateControls().

◆ SchemeSetMetric()

VOID SchemeSetMetric ( COLOR_SCHEME scheme,
int  id,
int  value 
)