ReactOS  0.4.13-dev-544-gede3fdd
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 1014 of file theme.c.

1015 {
1016  PTHEME pThemes;
1019  BOOL ret = FALSE;
1020 
1021  pThemes = LoadThemes();
1022  if (!pThemes)
1023  return FALSE;
1024 
1026 
1027  if (pwszFile)
1028  {
1029  ret = FindOrAppendTheme(pThemes, pwszFile, NULL, NULL, &selection);
1030  if (!ret)
1031  goto cleanup;
1032 
1034  if (!ret)
1035  goto cleanup;
1036  }
1037  else
1038  {
1039  ret = GetActiveClassicTheme(pThemes, &selection);
1040  if (!ret)
1041  goto cleanup;
1042 
1044  if (!ret)
1045  goto cleanup;
1046  }
1047 
1049  if (!ret)
1050  goto cleanup;
1051 
1053 
1054  ret = TRUE;
1055 
1056 cleanup:
1057  CleanupThemes(pThemes);
1058 
1059  return ret;
1060 }
BOOL GetActiveClassicTheme(IN PTHEME pThemeList, OUT PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:869
#define TRUE
Definition: types.h:120
void CleanupThemes(IN PTHEME pThemeList)
Definition: theme.c:527
DWORD scheme
int selection
Definition: ctm.c:92
BOOL LoadSchemeFromReg(OUT COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:243
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
VOID ApplyScheme(IN COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:330
BOOL ActivateTheme(IN PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:911
BOOL LoadCurrentScheme(OUT COLOR_SCHEME *scheme)
Definition: theme.c:122
PTHEME LoadThemes(VOID)
Definition: theme.c:749
BOOL FindOrAppendTheme(IN PTHEME pThemeList, IN LPCWSTR pwszThemeFileName, IN LPCWSTR pwszColorBuff, IN LPCWSTR pwszSizeBuff, OUT PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:791
int ret
BOOL LoadSchemeFromTheme(OUT PCOLOR_SCHEME scheme, IN PTHEME_SELECTION pSelectedTheme)
Definition: theme.c:938
char * cleanup(char *str)
Definition: wpickclick.c:99

Referenced by DisplayApplet().

◆ AdvAppearanceDlgProc()

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

Definition at line 504 of file advappdlg.c.

505 {
506  INT iSelection, iProperty;
507  GLOBALS* g;
508  PLOGFONTW plfFont;
509 
510  g = (GLOBALS*)GetWindowLongPtr(hwndDlg, DWLP_USER);
511 
512  switch (uMsg)
513  {
514  case WM_INITDIALOG:
515  g = (GLOBALS*)lParam;
516  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)g);
517  AdvAppearanceDlg_Init(hwndDlg, g);
518  break;
519 
520  case WM_DESTROY:
521  AdvAppearanceDlg_CleanUp(hwndDlg, g);
522  break;
523 
524  case WM_COMMAND:
525  if (g == NULL)
526  return TRUE;
527 
528  switch(LOWORD(wParam))
529  {
530  case IDOK:
531  SaveCurrentValues(hwndDlg, g);
532  EndDialog(hwndDlg, IDOK);
533  break;
534 
535  case IDCANCEL:
536  g->SchemeAdv = g->Scheme;
537  EndDialog(hwndDlg, IDCANCEL);
538  break;
539 
541  SaveCurrentValues(hwndDlg, g);
543  g->CurrentElement = (INT)lParam;
544  UpdateControls(hwndDlg, g);
545  break;
546 
548  if (HIWORD(wParam) == CBN_SELCHANGE)
549  {
550  SaveCurrentValues(hwndDlg, g);
551  iSelection = SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_GETCURSEL, 0, 0);
552  g->CurrentElement = SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_GETITEMDATA, iSelection, 0);
553  UpdateControls(hwndDlg, g);
554  }
555  break;
556 
558  if (HIWORD(wParam) == EN_CHANGE)
559  {
560  iProperty = g_Assignment[g->CurrentElement].Size;
561  if (iProperty == -1)
562  return TRUE;
563 
564  iSelection = LOWORD(SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_SIZE_UD, UDM_GETPOS,0,0L));
565  SchemeSetMetric(&g->SchemeAdv, iProperty, iSelection);
566  SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETSIZE, iProperty, iSelection);
567 
568  iProperty = g_Assignment[g->CurrentElement].Size2;
569  if (iProperty != -1)
570  SchemeSetMetric(&g->SchemeAdv, iProperty, iSelection);
571  }
572  break;
573 
575  if (HIWORD(wParam) == CBN_SELCHANGE)
576  {
577  iProperty = g_Assignment[g->CurrentElement].Font;
578  if (iProperty == -1)
579  return TRUE;
580 
581  plfFont = SchemeGetFont(&g->SchemeAdv, iProperty);
583  SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETFONT, iProperty, (LPARAM)plfFont);
584  }
585  break;
586 
589  {
590  HDC hdcDlg;
591 
592  iProperty = g_Assignment[g->CurrentElement].Font;
593  if (iProperty == -1)
594  return TRUE;
595 
596  hdcDlg = GetDC(hwndDlg);
597 
598  plfFont = SchemeGetFont(&g->SchemeAdv, iProperty);
599  iSelection = GetSelectedComboInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E);
600  plfFont->lfHeight = -MulDiv(iSelection , GetDeviceCaps(hdcDlg, LOGPIXELSY), 72);
602 
603  ReleaseDC(hwndDlg, hdcDlg);
604  }
605  break;
606 
608  if (HIWORD(wParam) == BN_CLICKED)
609  {
610  iProperty = g_Assignment[g->CurrentElement].Font;
611  if (iProperty == -1)
612  return TRUE;
613 
614  plfFont = SchemeGetFont(&g->SchemeAdv, iProperty);
615  iSelection = (INT)SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTBOLD, BM_GETCHECK, 0, 0);
616  plfFont->lfWeight = (iSelection == BST_CHECKED) ? FW_BOLD : FW_NORMAL;
617  SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETFONT, iProperty, (LPARAM)plfFont);
618  }
619  break;
620 
622  if (HIWORD(wParam) == BN_CLICKED)
623  {
624  iProperty = g_Assignment[g->CurrentElement].Font;
625  if (iProperty == -1)
626  return TRUE;
627 
628  plfFont = SchemeGetFont(&g->SchemeAdv, iProperty);
629  iSelection = (INT)SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTITALIC, BM_GETCHECK, 0, 0);
630  plfFont->lfItalic = (iSelection == BST_CHECKED) ? TRUE : FALSE;
631  SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETFONT, iProperty, (LPARAM)plfFont);
632  }
633  break;
634 
636  GetColor(hwndDlg, g, 0);
637  break;
638 
640  GetColor(hwndDlg, g, 1);
641  break;
642 
644  GetColor(hwndDlg, g, 2);
645  break;
646 
647  default:
648  return FALSE;
649  }
650  break;
651 
652  default:
653  return FALSE;
654  }
655 
656  return TRUE;
657 }
#define PVM_SETSIZE
Definition: preview.h:26
#define TRUE
Definition: types.h:120
#define UDM_GETPOS
Definition: commctrl.h:2116
#define IDOK
Definition: winuser.h:824
HDC WINAPI GetDC(_In_opt_ HWND)
static INT GetSelectedComboInt(HWND hwnd, INT id)
Definition: advappdlg.c:487
#define CB_GETITEMDATA
Definition: winuser.h:1911
#define PVM_SETFONT
Definition: preview.h:28
static VOID UpdateControls(HWND hwndDlg, GLOBALS *g)
Definition: advappdlg.c:206
#define INT
Definition: polytest.cpp:20
static HDC
Definition: imagelist.c:92
#define IDC_ADVAPPEARANCE_COLOR1_B
Definition: resource.h:113
#define SendDlgItemMessage
Definition: winuser.h:5708
int Size
Definition: advappdlg.c:17
const ASSIGNMENT g_Assignment[NUM_ELEMENTS]
Definition: advappdlg.c:28
int32_t INT
Definition: typedefs.h:56
#define SetWindowLongPtr
Definition: treelist.c:70
#define CB_GETCURSEL
Definition: winuser.h:1904
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define IDC_ADVAPPEARANCE_COLOR2_B
Definition: resource.h:115
static VOID SaveCurrentValues(HWND hwndDlg, GLOBALS *g)
Definition: advappdlg.c:261
#define IDC_ADVAPPEARANCE_FONTCOLOR_B
Definition: resource.h:121
BYTE lfItalic
Definition: wingdi.h:1880
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define IDC_ADVAPPEARANCE_FONT_C
Definition: resource.h:117
LONG lfHeight
Definition: wingdi.h:1875
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define BM_GETCHECK
Definition: winuser.h:1879
#define IDC_ADVAPPEARANCE_FONTBOLD
Definition: resource.h:122
static VOID AdvAppearanceDlg_CleanUp(HWND hwndDlg, GLOBALS *g)
Definition: advappdlg.c:438
#define IDC_ADVAPPEARANCE_SIZE_E
Definition: resource.h:110
#define WM_DESTROY
Definition: winuser.h:1591
int Size2
Definition: advappdlg.c:18
GLboolean GLboolean g
Definition: glext.h:6204
#define CBN_EDITCHANGE
Definition: winuser.h:1936
#define BN_CLICKED
Definition: winuser.h:1886
#define PVM_UPDATETHEME
Definition: preview.h:33
static VOID GetSelectedComboText(HWND hwnd, INT id, LPWSTR lpStr)
Definition: advappdlg.c:467
static const WCHAR L[]
Definition: oid.c:1250
#define DWLP_USER
Definition: winuser.h:866
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define IDC_ADVAPPEARANCE_FONTITALIC
Definition: resource.h:123
#define WM_COMMAND
Definition: winuser.h:1716
#define IDC_APPEARANCE_PREVIEW
Definition: resource.h:86
#define IDC_ADVAPPEARANCE_SIZE_UD
Definition: resource.h:111
#define FW_BOLD
Definition: wingdi.h:377
static VOID SelectComboByElement(HWND hwnd, INT id, LPARAM lParam)
Definition: advappdlg.c:446
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
PLOGFONTW SchemeGetFont(COLOR_SCHEME *scheme, int id)
#define CBN_SELCHANGE
Definition: winuser.h:1940
#define IDC_ADVAPPEARANCE_ELEMENT
Definition: resource.h:108
#define BST_CHECKED
Definition: winuser.h:197
#define FW_NORMAL
Definition: wingdi.h:372
LONG lfWeight
Definition: wingdi.h:1879
VOID SchemeSetMetric(COLOR_SCHEME *scheme, int id, int value)
#define HIWORD(l)
Definition: typedefs.h:246
#define LOGPIXELSY
Definition: wingdi.h:718
#define GetWindowLongPtr
Definition: treelist.c:73
static BOOL GetColor(HWND hwndDlg, GLOBALS *g, INT nButton)
Definition: advappdlg.c:286
WCHAR lfFaceName[LF_FACESIZE]
Definition: wingdi.h:1888
#define IDCANCEL
Definition: winuser.h:825
#define IDC_ADVAPPEARANCE_FONTSIZE_E
Definition: resource.h:119
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define MulDiv(x, y, z)
Definition: gdifloat.h:86
int Font
Definition: advappdlg.c:21
static VOID AdvAppearanceDlg_Init(HWND hwndDlg, GLOBALS *g)
Definition: advappdlg.c:344
#define EN_CHANGE
Definition: winuser.h:1983

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 
262  if (HIWORD(wParam) == CBN_SELCHANGE)
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 
281  if (HIWORD(wParam) == CBN_SELCHANGE)
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 
307  case IDC_APPEARANCE_SIZE:
308  if (HIWORD(wParam) == CBN_SELCHANGE)
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 }
BOOL ActivateTheme(PTHEME_SELECTION pSelectedTheme)
INT_PTR CALLBACK EffAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: effappdlg.c:130
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define IDC_APPEARANCE_ADVANCED
Definition: resource.h:90
static VOID AppearancePage_OnDestroy(HWND hwndDlg, GLOBALS *g)
Definition: appearance.c:197
static void AppearancePage_ShowColorSchemes(HWND hwndDlg, GLOBALS *g)
Definition: appearance.c:72
static PVOID GetSelectedData(HWND hwndDlg, int nIDDlgItem)
Definition: appearance.c:203
COLORREF desktop_color
Definition: desk.h:106
#define IDC_APPEARANCE_COLORSCHEME
Definition: resource.h:87
HINSTANCE hApplet
Definition: access.c:17
#define COLOR_DESKTOP
Definition: winuser.h:904
#define PSN_APPLY
Definition: prsht.h:117
THEME_STYLE * SizesList
Definition: appearance.h:93
#define IDC_APPEARANCE_SIZE
Definition: resource.h:92
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3112
#define PSN_KILLACTIVE
Definition: prsht.h:116
struct _THEME_STYLE * PTHEME_STYLE
static void AppearancePage_UpdateThemePreview(HWND hwndDlg, GLOBALS *g)
Definition: appearance.c:16
INT_PTR CALLBACK AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: advappdlg.c:504
smooth NULL
Definition: ftsmooth.c:416
#define IDC_APPEARANCE_VISUAL_STYLE
Definition: resource.h:91
LONG_PTR LPARAM
Definition: windef.h:208
static void AppearancePage_LoadSelectedScheme(HWND hwndDlg, GLOBALS *g)
Definition: appearance.c:35
#define WM_DESTROY
Definition: winuser.h:1591
GLboolean GLboolean g
Definition: glext.h:6204
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define PSNRET_NOERROR
Definition: prsht.h:129
#define DialogBoxParam
Definition: winuser.h:5630
#define DWLP_USER
Definition: winuser.h:866
VOID ApplyScheme(PCOLOR_SCHEME scheme, PTHEME_SELECTION pSelectedTheme)
static INT_PTR AppearancePage_OnInit(HWND hwndDlg)
Definition: appearance.c:97
#define WM_COMMAND
Definition: winuser.h:1716
THEME_STYLE * ColoursList
Definition: appearance.h:92
HWND WINAPI GetParent(_In_ HWND)
#define IDD_ADVAPPEARANCE
Definition: resource.h:14
static void AppearancePage_ShowSizes(HWND hwndDlg, GLOBALS *g)
Definition: appearance.c:81
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define CBN_SELCHANGE
Definition: winuser.h:1940
GLOBAL_DATA g_GlobalData
Definition: background.c:84
#define HIWORD(l)
Definition: typedefs.h:246
#define IDC_APPEARANCE_EFFECTS
Definition: resource.h:89
#define IDD_EFFAPPEARANCE
Definition: resource.h:15
#define GetWindowLongPtr
Definition: treelist.c:73
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
struct _THEME * PTHEME
#define WM_NOTIFY
Definition: richedit.h:61

◆ 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
THEME_STYLE * SizesList
Definition: appearance.h:93
PWSTR DisplayName
Definition: appearance.h:91
static void CleanupStyles(IN PTHEME_STYLE pStylesList)
Definition: theme.c:509
THEME_STYLE * ColoursList
Definition: appearance.h:92
struct _THEME * NextTheme
Definition: appearance.h:89
PWSTR ThemeFileName
Definition: appearance.h:90

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;
140  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)g);
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 
174  if (HIWORD(wParam) == CBN_SELCHANGE)
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:161
#define IDC_EFFAPPEARANCE_DRAGFULLWINDOWS
Definition: resource.h:162
#define IDC_EFFAPPEARANCE_ANIMATIONTYPE
Definition: resource.h:157
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define IDC_EFFAPPEARANCE_SMOOTHING
Definition: resource.h:158
static VOID EffAppearanceDlgUpdateControls(HWND hwndDlg, GLOBALS *g)
Definition: effappdlg.c:15
int32_t INT
Definition: typedefs.h:56
#define SetWindowLongPtr
Definition: treelist.c:70
#define CB_GETCURSEL
Definition: winuser.h:1904
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define CB_ERR
Definition: winuser.h:2389
#define WM_DESTROY
Definition: winuser.h:1591
static VOID EffAppearanceDlg_Init(HWND hwndDlg, GLOBALS *g)
Definition: effappdlg.c:80
GLboolean GLboolean g
Definition: glext.h:6204
static const UCHAR Index[8]
Definition: usbohci.c:18
#define BN_CLICKED
Definition: winuser.h:1886
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDC_EFFAPPEARANCE_FLATMENUS
Definition: resource.h:163
#define DWLP_USER
Definition: winuser.h:866
static VOID EffAppearanceDlgSaveCurrentValues(HWND hwndDlg, GLOBALS *g)
Definition: effappdlg.c:59
#define WM_COMMAND
Definition: winuser.h:1716
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define CBN_SELCHANGE
Definition: winuser.h:1940
#define IDC_EFFAPPEARANCE_SMOOTHINGTYPE
Definition: resource.h:159
#define HIWORD(l)
Definition: typedefs.h:246
#define IDC_EFFAPPEARANCE_ANIMATION
Definition: resource.h:156
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define IDC_EFFAPPEARANCE_KEYBOARDCUES
Definition: resource.h:155

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 }
#define TRUE
Definition: types.h:120
#define ZeroMemory
Definition: winbase.h:1635
THEME_STYLE * SizesList
Definition: appearance.h:93
smooth NULL
Definition: ftsmooth.c:416
THEME_STYLE * ColoursList
Definition: appearance.h:92
struct _THEME * NextTheme
Definition: appearance.h:89
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)
PWSTR ThemeFileName
Definition: appearance.h:90

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 * CreateTheme(LPCWSTR pszName, LPCWSTR pszDisplayName)
Definition: theme.c:444
void CleanupThemes(IN PTHEME pThemeList)
Definition: theme.c:527
THEME_STYLE * SizesList
Definition: appearance.h:93
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
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI EnumThemeColors(LPWSTR pszThemeFileName, LPWSTR pszSizeName, DWORD dwColorNum, PTHEMENAMES pszColorNames)
Definition: system.c:1310
THEME_STYLE * ColoursList
Definition: appearance.h:92
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));
766  hret = SHGetFolderPathW (NULL, CSIDL_RESOURCES, NULL, SHGFP_TYPE_DEFAULT, 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 }
static THEME * CreateTheme(LPCWSTR pszName, LPCWSTR pszDisplayName)
Definition: theme.c:444
#define free
Definition: debug_ros.c:5
#define ZeroMemory
Definition: winbase.h:1635
HINSTANCE hApplet
Definition: access.c:17
PWSTR DisplayName
Definition: appearance.h:91
static THEME_STYLE * LoadClassicColorSchemes(VOID)
Definition: theme.c:625
smooth NULL
Definition: ftsmooth.c:416
#define IDS_CLASSIC_THEME
Definition: resource.h:100
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
static const WCHAR L[]
Definition: oid.c:1250
THEME_STYLE * ColoursList
Definition: appearance.h:92
struct _THEME * NextTheme
Definition: appearance.h:89
#define CSIDL_RESOURCES
Definition: shlobj.h:2055
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2085
GLuint res
Definition: glext.h:9613
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
HRESULT WINAPI EnumThemes(LPCWSTR pszThemePath, ENUMTHEMEPROC callback, LPVOID lpData)
Definition: system.c:1221
#define LoadString
Definition: winuser.h:5685
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

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 
)