ReactOS 0.4.15-dev-7953-g1f49173
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 1015 of file theme.c.

1016{
1017 PTHEME pThemes;
1020 BOOL ret = FALSE;
1021
1022 pThemes = LoadThemes();
1023 if (!pThemes)
1024 return FALSE;
1025
1027
1028 if (pwszFile)
1029 {
1030 ret = FindOrAppendTheme(pThemes, pwszFile, NULL, NULL, &selection);
1031 if (!ret)
1032 goto cleanup;
1033
1035 if (!ret)
1036 goto cleanup;
1037 }
1038 else
1039 {
1040 ret = GetActiveClassicTheme(pThemes, &selection);
1041 if (!ret)
1042 goto cleanup;
1043
1045 if (!ret)
1046 goto cleanup;
1047 }
1048
1050 if (!ret)
1051 goto cleanup;
1052
1054
1055 ret = TRUE;
1056
1057cleanup:
1058 CleanupThemes(pThemes);
1059
1060 return ret;
1061}
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:527
BOOL FindOrAppendTheme(IN PTHEME pThemeList, IN LPCWSTR pwszThemeFileName, IN LPCWSTR pwszColorBuff, IN LPCWSTR pwszSizeBuff, OUT PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:791
BOOL LoadSchemeFromTheme(OUT PCOLOR_SCHEME scheme, IN PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:938
BOOL GetActiveClassicTheme(IN PTHEME pThemeList, OUT PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:869
BOOL ActivateTheme(IN PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:911
VOID ApplyScheme(IN COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:330
PTHEME LoadThemes(VOID)
Definition: theme.c:749
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
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD scheme
int ret

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
GLboolean GLboolean g
Definition: glext.h:6204
static HDC
Definition: imagelist.c:92
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
#define L(x)
Definition: ntvdm.h:50
#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:2144
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:1910
LONG lfHeight
Definition: wingdi.h:1897
BYTE lfItalic
Definition: wingdi.h:1902
LONG lfWeight
Definition: wingdi.h:1901
#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
LONG_PTR LPARAM
Definition: windef.h:208
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:872
#define IDCANCEL
Definition: winuser.h:831
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_INITDIALOG
Definition: winuser.h:1739
#define IDOK
Definition: winuser.h:830
#define CBN_SELCHANGE
Definition: winuser.h:1979
#define CB_GETITEMDATA
Definition: winuser.h:1950
HDC WINAPI GetDC(_In_opt_ HWND)
#define BN_CLICKED
Definition: winuser.h:1925
#define WM_DESTROY
Definition: winuser.h:1609
#define CB_GETCURSEL
Definition: winuser.h:1943
#define SendDlgItemMessage
Definition: winuser.h:5842
#define BST_CHECKED
Definition: winuser.h:197
#define CBN_EDITCHANGE
Definition: winuser.h:1975
#define BM_GETCHECK
Definition: winuser.h:1918
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define EN_CHANGE
Definition: winuser.h:2022

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 }
246 break;
247
250 hwndDlg, AdvAppearanceDlgProc, (LPARAM)g) == IDOK)
251 {
252 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
253 g->bSchemeChanged = TRUE;
254 g->Scheme = g->SchemeAdv;
255 g_GlobalData.desktop_color = g->Scheme.crColor[COLOR_DESKTOP];
256
258 }
259 break;
260
263 {
264 g->ActiveTheme.Color = (PTHEME_STYLE)GetSelectedData(hwndDlg, IDC_APPEARANCE_COLORSCHEME);
265 if (g->ActiveTheme.Color->ChildStyle != NULL)
266 g->ActiveTheme.Size = g->ActiveTheme.Color->ChildStyle;
267
268 g->bSchemeChanged = TRUE;
269 if (g->ActiveTheme.ThemeActive)
270 g->bThemeChanged = TRUE;
271
272 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
273
275 AppearancePage_ShowSizes(hwndDlg, g);
277 }
278 break;
279
282 {
284
285 if (g->ClassicTheme.Theme == pTheme)
286 g->ActiveTheme = g->ClassicTheme;
287 else
288 {
289 g->ActiveTheme.Theme = pTheme;
290 g->ActiveTheme.Size = pTheme->SizesList;
291 g->ActiveTheme.Color = pTheme->ColoursList;
292 g->ActiveTheme.ThemeActive = TRUE;
293 }
294
295 g->bThemeChanged = TRUE;
296 g->bSchemeChanged = TRUE;
297
298 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
299
301 AppearancePage_ShowSizes(hwndDlg, g);
304 }
305 break;
306
309 {
310 g->ActiveTheme.Size = (PTHEME_STYLE)GetSelectedData(hwndDlg, IDC_APPEARANCE_SIZE);
311 g->bSchemeChanged = TRUE;
312 if (g->ActiveTheme.ThemeActive)
313 g->bThemeChanged = TRUE;
314
315 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
316
319 }
320 }
321 break;
322
323 case WM_NOTIFY:
324 lpnm = (LPNMHDR)lParam;
325 switch (lpnm->code)
326 {
327 case PSN_APPLY:
328
329 if (g->bThemeChanged)
330 {
331 ActivateTheme(&g->ActiveTheme);
332 }
333
334 if (g->bSchemeChanged)
335 {
336 ApplyScheme(&g->Scheme, &g->ActiveTheme);
337 if (g->ActiveTheme.ThemeActive == FALSE)
338 g->ClassicTheme = g->ActiveTheme;
339 }
340
342 g->bThemeChanged = FALSE;
343 g->bSchemeChanged = FALSE;
345 return TRUE;
346
347 case PSN_KILLACTIVE:
349 return TRUE;
350
351 case PSN_SETACTIVE:
352 if (g->Scheme.crColor[COLOR_DESKTOP] != g_GlobalData.desktop_color)
353 {
354 g->Scheme.crColor[COLOR_DESKTOP] = g_GlobalData.desktop_color;
356 }
357 break;
358 }
359 break;
360 }
361
362 return FALSE;
363}
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:130
GLOBAL_DATA g_GlobalData
Definition: background.c:70
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 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:159
THEME_STYLE * SizesList
Definition: appearance.h:93
THEME_STYLE * ColoursList
Definition: appearance.h:92
UINT code
Definition: winuser.h:3159
#define DialogBoxParam
Definition: winuser.h:5764
#define COLOR_DESKTOP
Definition: winuser.h:914
struct tagNMHDR * LPNMHDR
HWND WINAPI GetParent(_In_ HWND)
#define DWLP_MSGRESULT
Definition: winuser.h:870
#define MAKEINTRESOURCE
Definition: winuser.h:591

◆ ApplyScheme()

VOID ApplyScheme ( PCOLOR_SCHEME  scheme,
PTHEME_SELECTION  pSelectedTheme 
)

Referenced by AppearancePageProc().

◆ CleanupThemes()

void CleanupThemes ( IN PTHEME  pThemeList)

Definition at line 527 of file theme.c.

528{
529 PTHEME pTheme, pThemeOld;
530
531 pTheme = pThemeList;
532 while (pTheme)
533 {
534 CleanupStyles(pTheme->ColoursList);
535 if (pTheme->SizesList) CleanupStyles(pTheme->SizesList);
536 if (pTheme->DisplayName) free(pTheme->DisplayName);
537 if (pTheme->ThemeFileName) free(pTheme->ThemeFileName);
538
539 pThemeOld = pTheme;
540 pTheme = pTheme->NextTheme;
541 free(pThemeOld);
542 }
543}
#define free
Definition: debug_ros.c:5
static void CleanupStyles(IN PTHEME_STYLE pStylesList)
Definition: theme.c:509
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 130 of file effappdlg.c.

131{
132 GLOBALS* g;
133
134 g = (GLOBALS*)GetWindowLongPtr(hwndDlg, DWLP_USER);
135
136 switch (uMsg)
137 {
138 case WM_INITDIALOG:
139 g = (GLOBALS*)lParam;
141 EffAppearanceDlg_Init(hwndDlg, g);
142 break;
143
144 case WM_DESTROY:
145 break;
146
147 case WM_COMMAND:
148 switch(LOWORD(wParam))
149 {
150 case IDOK:
152 EndDialog(hwndDlg, IDOK);
153 break;
154
155 case IDCANCEL:
156 g->SchemeAdv = g->Scheme;
157 EndDialog(hwndDlg, IDCANCEL);
158 break;
159
166 if (HIWORD(wParam) == BN_CLICKED)
167 {
169 }
170 break;
171
175 {
176 INT Index =
178 CB_GETCURSEL, 0, 0);
179
180 g->SchemeAdv.Effects.bMenuFade =
182 CB_GETCURSEL, 0, 0);
183 g->SchemeAdv.Effects.uiFontSmoothingType = (Index == CB_ERR) ? 0 : (Index + 1);
184
186 }
187 break;
188
189 default:
190 return FALSE;
191 }
192 break;
193
194 default:
195 return FALSE;
196 }
197
198 return TRUE;
199}
#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:80
static VOID EffAppearanceDlgSaveCurrentValues(HWND hwndDlg, GLOBALS *g)
Definition: effappdlg.c:59
static VOID EffAppearanceDlgUpdateControls(HWND hwndDlg, GLOBALS *g)
Definition: effappdlg.c:15
_In_ WDFCOLLECTION _In_ ULONG Index
#define CB_ERR
Definition: winuser.h:2435
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 791 of file theme.c.

796{
797 PTHEME pTheme;
798 PTHEME pFoundTheme = NULL;
799
800 ZeroMemory(pSelectedTheme, sizeof(THEME_SELECTION));
801
802 for (pTheme = pThemeList; pTheme; pTheme = pTheme->NextTheme)
803 {
804 if (pTheme->ThemeFileName &&
805 _wcsicmp(pTheme->ThemeFileName, pwszThemeFileName) == 0)
806 {
807 pFoundTheme = pTheme;
808 break;
809 }
810
811 if (pTheme->NextTheme == NULL)
812 break;
813 }
814
815 if (!pFoundTheme)
816 {
817 pFoundTheme = LoadTheme(pwszThemeFileName, pwszThemeFileName);
818 if (!pFoundTheme)
819 return FALSE;
820
821 pTheme->NextTheme = pFoundTheme;
822 }
823
824 pSelectedTheme->ThemeActive = TRUE;
825 pSelectedTheme->Theme = pFoundTheme;
826 if (pwszColorBuff)
827 pSelectedTheme->Color = FindStyle(pFoundTheme->ColoursList, pwszColorBuff);
828 else
829 pSelectedTheme->Color = pFoundTheme->ColoursList;
830
831 if (pwszSizeBuff)
832 pSelectedTheme->Size = FindStyle(pFoundTheme->SizesList, pwszSizeBuff);
833 else
834 pSelectedTheme->Size = pFoundTheme->SizesList;
835
836 return TRUE;
837}
static PTHEME_STYLE FindStyle(IN PTHEME_STYLE pStylesList, IN PCWSTR StyleName)
Definition: theme.c:546
PTHEME LoadTheme(IN LPCWSTR pszThemeFileName, IN LPCWSTR pszThemeName)
Definition: theme.c:707
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define ZeroMemory
Definition: winbase.h:1712

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 707 of file theme.c.

708{
709 PTHEME pTheme = CreateTheme(pszThemeFileName, pszThemeName);
710 if (pTheme == NULL)
711 return NULL;
712
713 pTheme->SizesList = EnumThemeStyles( pszThemeFileName, (ENUMTHEMESTYLE)EnumThemeSizes);
714 pTheme->ColoursList = EnumThemeStyles( pszThemeFileName, (ENUMTHEMESTYLE)EnumThemeColors);
715 if(pTheme->SizesList == NULL || pTheme->ColoursList == NULL)
716 {
717 CleanupThemes(pTheme);
718 return NULL;
719 }
720
721 return pTheme;
722}
static THEME_STYLE * EnumThemeStyles(IN LPCWSTR pszThemeFileName, IN ENUMTHEMESTYLE pfnEnumTheme)
Definition: theme.c:687
HRESULT(WINAPI * ENUMTHEMESTYLE)(LPCWSTR, LPWSTR, DWORD, PTHEMENAMES)
Definition: theme.c:684
static THEME * CreateTheme(LPCWSTR pszName, LPCWSTR pszDisplayName)
Definition: theme.c:444
HRESULT WINAPI EnumThemeColors(LPWSTR pszThemeFileName, LPWSTR pszSizeName, DWORD dwColorNum, PTHEMENAMES pszColorNames)
Definition: system.c:1310
HRESULT WINAPI EnumThemeSizes(LPWSTR pszThemeFileName, LPWSTR pszColorName, DWORD dwSizeNum, PTHEMENAMES pszSizeNames)
Definition: system.c:1373

Referenced by EnumThemeProc(), and FindOrAppendTheme().

◆ LoadThemes()

PTHEME LoadThemes ( VOID  )

Definition at line 749 of file theme.c.

750{
751 HRESULT hret;
752 PTHEME pClassicTheme;
753 WCHAR strClassicTheme[40];
754 WCHAR szThemesPath[MAX_PATH], *pszClassicTheme;
755 int res;
756
757 /* Insert the classic theme */
758 res = LoadString(hApplet, IDS_CLASSIC_THEME, strClassicTheme, 40);
759 pszClassicTheme = (res > 0 ? strClassicTheme : L"Classic Theme");
760 pClassicTheme = CreateTheme(NULL, pszClassicTheme);
761 if (pClassicTheme == NULL) return NULL;
762 pClassicTheme->ColoursList = LoadClassicColorSchemes();
763
764 /* Get path to themes folder */
765 ZeroMemory(szThemesPath, sizeof(szThemesPath));
767 if (FAILED(hret)) return pClassicTheme;
768 lstrcatW (szThemesPath, L"\\Themes");
769
770 /* Enumerate themes */
771 hret = EnumThemes( szThemesPath, EnumThemeProc, &pClassicTheme->NextTheme);
772 if (FAILED(hret))
773 {
774 pClassicTheme->NextTheme = NULL;
775 if (pClassicTheme->ColoursList == NULL)
776 {
777 free(pClassicTheme->DisplayName);
778 free(pClassicTheme);
779 return NULL;
780 }
781 }
782
783 return pClassicTheme;
784}
#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:725
static THEME_STYLE * LoadClassicColorSchemes(VOID)
Definition: theme.c:625
#define MAX_PATH
Definition: compat.h:34
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2589
HRESULT WINAPI EnumThemes(LPCWSTR pszThemePath, ENUMTHEMEPROC callback, LPVOID lpData)
Definition: system.c:1221
GLuint res
Definition: glext.h:9613
#define FAILED(hr)
Definition: intsafe.h:51
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
@ SHGFP_TYPE_DEFAULT
Definition: shlobj.h:2135
#define CSIDL_RESOURCES
Definition: shlobj.h:2210
#define LoadString
Definition: winuser.h:5819
__wchar_t WCHAR
Definition: xmlstorage.h:180

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 
)