From e4d0ea53301e7e30cef17192457e1449edafa716 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Mon, 15 Aug 2011 13:02:06 +0000 Subject: [PATCH] [desk] - Rename themes to color schemes svn path=/branches/GSoC_2011/ThemesSupport/; revision=53263 --- dll/cpl/desk/advappdlg.c | 110 +++++++++++++-------------- dll/cpl/desk/appearance.c | 56 +++++++------- dll/cpl/desk/appearance.h | 6 +- dll/cpl/desk/draw.c | 106 +++++++++++++------------- dll/cpl/desk/draw.h | 12 +-- dll/cpl/desk/effappdlg.c | 22 +++--- dll/cpl/desk/preview.c | 84 ++++++++++---------- dll/cpl/desk/theme.c | 156 +++++++++++++++++++------------------- dll/cpl/desk/theme.h | 16 ++-- 9 files changed, 284 insertions(+), 284 deletions(-) diff --git a/dll/cpl/desk/advappdlg.c b/dll/cpl/desk/advappdlg.c index 837adcf2d73..a839e2ae6c7 100644 --- a/dll/cpl/desk/advappdlg.c +++ b/dll/cpl/desk/advappdlg.c @@ -81,7 +81,7 @@ UpdateButtonColor(HWND hwndDlg, GLOBALS* g, INT ID, INT nButton, INT nColor) rect.top = 2; rect.right = 22; rect.bottom = 13; - hbrush = CreateSolidBrush(g->ThemeAdv.crColor[nColor]); + hbrush = CreateSolidBrush(g->SchemeAdv.crColor[nColor]); FillRect(hdcCompat, &rect, hbrush); DeleteObject(hbrush); @@ -111,7 +111,7 @@ InitColorButtons(HWND hwndDlg, GLOBALS* g) HPEN hPen; HWND hwndColorButton; HGDIOBJ hgdiTemp; - THEME *theme = &g->ThemeAdv; + COLOR_SCHEME *scheme = &g->SchemeAdv; const POINT Points[3] = {{29,6},{33,6},{31,8}}; @@ -133,7 +133,7 @@ InitColorButtons(HWND hwndDlg, GLOBALS* g) rect.top = 0; rect.right = 36; rect.bottom = 15; - hbrush = CreateSolidBrush(theme->crColor[COLOR_BTNFACE]); + hbrush = CreateSolidBrush(scheme->crColor[COLOR_BTNFACE]); FillRect(hdcCompat, &rect, hbrush); DeleteObject(hbrush); @@ -142,12 +142,12 @@ InitColorButtons(HWND hwndDlg, GLOBALS* g) rect.top = 1; rect.right = 23; rect.bottom = 14; - hbrush = CreateSolidBrush(theme->crColor[COLOR_BTNTEXT]); + hbrush = CreateSolidBrush(scheme->crColor[COLOR_BTNTEXT]); FillRect(hdcCompat, &rect, hbrush); DeleteObject(hbrush); /* Draw left side of line */ - hPen = CreatePen(PS_SOLID, 1, theme->crColor[COLOR_BTNSHADOW]); + hPen = CreatePen(PS_SOLID, 1, scheme->crColor[COLOR_BTNSHADOW]); SelectObject(hdcCompat, hPen); MoveToEx(hdcCompat, 26, 1, NULL); LineTo(hdcCompat, 26, 14); @@ -155,7 +155,7 @@ InitColorButtons(HWND hwndDlg, GLOBALS* g) DeleteObject(hPen); /* Draw right side of line */ - hPen = CreatePen(PS_SOLID, 1, theme->crColor[COLOR_BTNHIGHLIGHT]); + hPen = CreatePen(PS_SOLID, 1, scheme->crColor[COLOR_BTNHIGHLIGHT]); SelectObject(hdcCompat,hPen); MoveToEx(hdcCompat, 27, 1, NULL); LineTo(hdcCompat, 27, 14); @@ -163,8 +163,8 @@ InitColorButtons(HWND hwndDlg, GLOBALS* g) DeleteObject(hPen); /* Draw triangle */ - hPen = CreatePen(PS_SOLID, 1, theme->crColor[COLOR_BTNTEXT]); - hbrush = CreateSolidBrush(theme->crColor[COLOR_BTNTEXT]); + hPen = CreatePen(PS_SOLID, 1, scheme->crColor[COLOR_BTNTEXT]); + hbrush = CreateSolidBrush(scheme->crColor[COLOR_BTNTEXT]); SelectObject(hdcCompat, hPen); SelectObject(hdcCompat, hbrush); SetPolyFillMode(hdcCompat, WINDING); @@ -235,20 +235,20 @@ UpdateControls(HWND hwndDlg, GLOBALS *g) UpdateButtonColor(hwndDlg, g, IDC_ADVAPPEARANCE_FONTCOLOR_B, 2, g_Assignment[iElement].FontColor); if (g_Assignment[iElement].Size != -1) - SetDlgItemInt(hwndDlg, IDC_ADVAPPEARANCE_SIZE_E, g->ThemeAdv.Size[g_Assignment[iElement].Size], FALSE); + SetDlgItemInt(hwndDlg, IDC_ADVAPPEARANCE_SIZE_E, g->SchemeAdv.Size[g_Assignment[iElement].Size], FALSE); else SetDlgItemText(hwndDlg, IDC_ADVAPPEARANCE_SIZE_E, TEXT("")); hdcDlg = GetDC(hwndDlg); if (g_Assignment[iElement].Font != -1) { - LOGFONT lfFont = g->ThemeAdv.lfFont[g_Assignment[iElement].Font]; + LOGFONT lfFont = g->SchemeAdv.lfFont[g_Assignment[iElement].Font]; SetDlgItemText(hwndDlg, IDC_ADVAPPEARANCE_FONT_C, lfFont.lfFaceName); - SetDlgItemInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E, -MulDiv(g->ThemeAdv.lfFont[g_Assignment[iElement].Font].lfHeight, 72, GetDeviceCaps(hdcDlg, LOGPIXELSY)),FALSE); + SetDlgItemInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E, -MulDiv(g->SchemeAdv.lfFont[g_Assignment[iElement].Font].lfHeight, 72, GetDeviceCaps(hdcDlg, LOGPIXELSY)),FALSE); SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONT_C, CB_FINDSTRINGEXACT, -1, (WPARAM)lfFont.lfFaceName); - SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTBOLD, BM_SETCHECK, g->ThemeAdv.lfFont[g_Assignment[iElement].Font].lfWeight == FW_BOLD?1:0, 0); - SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTITALIC, BM_SETCHECK, g->ThemeAdv.lfFont[g_Assignment[iElement].Font].lfItalic, 0); + SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTBOLD, BM_SETCHECK, g->SchemeAdv.lfFont[g_Assignment[iElement].Font].lfWeight == FW_BOLD?1:0, 0); + SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTITALIC, BM_SETCHECK, g->SchemeAdv.lfFont[g_Assignment[iElement].Font].lfItalic, 0); } else { @@ -270,15 +270,15 @@ SaveCurrentValues(HWND hwndDlg, GLOBALS *g) if (g_Assignment[g->CurrentElement].Size != -1) { - g->ThemeAdv.Size[g_Assignment[g->CurrentElement].Size] = GetDlgItemInt(hwndDlg, IDC_ADVAPPEARANCE_SIZE_E, &bTranslated, FALSE); + g->SchemeAdv.Size[g_Assignment[g->CurrentElement].Size] = GetDlgItemInt(hwndDlg, IDC_ADVAPPEARANCE_SIZE_E, &bTranslated, FALSE); } if (g_Assignment[g->CurrentElement].Font != -1) { - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight = -MulDiv(GetDlgItemInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E, &bTranslated, FALSE), GetDeviceCaps(hdcDlg, LOGPIXELSY), 72); - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfWeight = (SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTBOLD, BM_GETCHECK, 0, 0) == 1) ? FW_BOLD : FW_NORMAL; - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfItalic = (BYTE)SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTITALIC, BM_GETCHECK, 0, 0); - GetDlgItemText(hwndDlg, IDC_ADVAPPEARANCE_FONT_C, g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfFaceName, LF_FACESIZE * sizeof(TCHAR)); + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight = -MulDiv(GetDlgItemInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E, &bTranslated, FALSE), GetDeviceCaps(hdcDlg, LOGPIXELSY), 72); + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfWeight = (SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTBOLD, BM_GETCHECK, 0, 0) == 1) ? FW_BOLD : FW_NORMAL; + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfItalic = (BYTE)SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTITALIC, BM_GETCHECK, 0, 0); + GetDlgItemText(hwndDlg, IDC_ADVAPPEARANCE_FONT_C, g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfFaceName, LF_FACESIZE * sizeof(TCHAR)); } ReleaseDC(hwndDlg, hdcDlg); @@ -314,7 +314,7 @@ GetColor(HWND hwndDlg, GLOBALS* g, INT nButton) break; } - crColor = g->ThemeAdv.crColor[ColorIndex]; + crColor = g->SchemeAdv.crColor[ColorIndex]; /* Prepare cc structure */ cc.lStructSize = sizeof(CHOOSECOLOR); @@ -330,11 +330,11 @@ GetColor(HWND hwndDlg, GLOBALS* g, INT nButton) /* Create the colorpicker */ if (ChooseColor(&cc)) { - g->ThemeAdv.crColor[ColorIndex] = cc.rgbResult; + g->SchemeAdv.crColor[ColorIndex] = cc.rgbResult; if (crColor != cc.rgbResult) { UpdateButtonColor(hwndDlg, g, ID, nButton, ColorIndex); - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); return TRUE; } } @@ -356,9 +356,9 @@ AdvAppearanceDlg_Init(HWND hwndDlg, GLOBALS *g) TCHAR Size[4]; /* Copy the current theme values */ - g->ThemeAdv = g->Theme; + g->SchemeAdv = g->Scheme; - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); /* Add the elements to the combo */ @@ -383,7 +383,7 @@ AdvAppearanceDlg_Init(HWND hwndDlg, GLOBALS *g) SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_SETCURSEL, iDeskIndex, 0); /* Create font for bold button */ - lfButtonFont = g->Theme.lfFont[FONT_DIALOG]; + lfButtonFont = g->Scheme.lfFont[FONT_DIALOG]; lfButtonFont.lfWeight = FW_BOLD; lfButtonFont.lfItalic = FALSE; hMyFont = CreateFontIndirect(&lfButtonFont); @@ -550,7 +550,7 @@ AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) break; case IDCANCEL: - g->ThemeAdv = g->Theme; + g->SchemeAdv = g->Scheme; EndDialog(hwndDlg, IDCANCEL); break; @@ -608,20 +608,20 @@ AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) case IDX_INACTIVE_CAPTION: case IDX_ACTIVE_CAPTION: GetSelectedComboText(hwndDlg, IDC_ADVAPPEARANCE_FONT_C, - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfFaceName); - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfFaceName); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); break; case IDX_MENU: GetSelectedComboText(hwndDlg, IDC_ADVAPPEARANCE_FONT_C, - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfFaceName); - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfFaceName); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); break; case IDX_DIALOG: GetSelectedComboText(hwndDlg, IDC_ADVAPPEARANCE_FONT_C, - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfFaceName); - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfFaceName); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); break; } } @@ -638,23 +638,23 @@ AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) case IDX_INACTIVE_CAPTION: case IDX_ACTIVE_CAPTION: i = GetSelectedComboInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E); - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight = + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight = -MulDiv(i , GetDeviceCaps(hdcDlg, LOGPIXELSY), 72); - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); break; case IDX_MENU: i = GetSelectedComboInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E); - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight = + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight = -MulDiv(i , GetDeviceCaps(hdcDlg, LOGPIXELSY), 72); - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); break; case IDX_DIALOG: i = GetSelectedComboInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E); - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight = + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight = -MulDiv(i , GetDeviceCaps(hdcDlg, LOGPIXELSY), 72); - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); break; } @@ -670,23 +670,23 @@ AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) case IDX_INACTIVE_CAPTION: case IDX_ACTIVE_CAPTION: i = GetEditedComboInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E); - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight = + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight = -MulDiv(i , GetDeviceCaps(hdcDlg, LOGPIXELSY), 72); - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); break; case IDX_MENU: i = GetEditedComboInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E); - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight = + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight = -MulDiv(i , GetDeviceCaps(hdcDlg, LOGPIXELSY), 72); - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); break; case IDX_DIALOG: i = GetEditedComboInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E); - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight = + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight = -MulDiv(i , GetDeviceCaps(hdcDlg, LOGPIXELSY), 72); - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); break; } @@ -704,24 +704,24 @@ AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) case IDX_INACTIVE_CAPTION: case IDX_ACTIVE_CAPTION: i = (INT)SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTBOLD, BM_GETCHECK, 0, 0); - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfWeight = + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfWeight = (i == BST_CHECKED) ? FW_BOLD : FW_NORMAL; - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); break; case IDX_MENU: i = (INT)SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTBOLD, BM_GETCHECK, 0, 0); - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfWeight = + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfWeight = (i == BST_CHECKED) ? FW_BOLD : FW_NORMAL; - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); break; case IDX_DIALOG: i = (INT)SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTBOLD, BM_GETCHECK, 0, 0); - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfWeight = + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfWeight = (i == BST_CHECKED) ? FW_BOLD : FW_NORMAL; - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); break; } } @@ -737,23 +737,23 @@ AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) case IDX_INACTIVE_CAPTION: case IDX_ACTIVE_CAPTION: i = (INT)SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTITALIC, BM_GETCHECK, 0, 0); - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfItalic = + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfItalic = (i == BST_CHECKED) ? TRUE : FALSE; - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); break; case IDX_MENU: i = (INT)SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTITALIC, BM_GETCHECK, 0, 0); - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfItalic = + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfItalic = (i == BST_CHECKED) ? TRUE : FALSE; - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); break; case IDX_DIALOG: i = (INT)SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTITALIC, BM_GETCHECK, 0, 0); - g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfItalic = + g->SchemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfItalic = (i == BST_CHECKED) ? TRUE : FALSE; - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); break; } } diff --git a/dll/cpl/desk/appearance.c b/dll/cpl/desk/appearance.c index 7670f4c9e00..0db24ebb4b9 100644 --- a/dll/cpl/desk/appearance.c +++ b/dll/cpl/desk/appearance.c @@ -29,25 +29,25 @@ AppearancePage_OnInit(HWND hwndDlg) SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)g); - LoadCurrentTheme(&g->Theme); - g->ThemeAdv = g->Theme; + LoadCurrentScheme(&g->Scheme); + g->SchemeAdv = g->Scheme; g->bHasChanged = FALSE; g->hBoldFont = g->hItalicFont = NULL; g->hbmpColor[0] = g->hbmpColor[1] = g->hbmpColor[2] = NULL; g->bInitializing = FALSE; - TemplateCount = LoadThemePresetEntries(strSelectedStyle); + TemplateCount = LoadSchemePresetEntries(strSelectedStyle); hwndCombo = GetDlgItem(hwndDlg, IDC_APPEARANCE_COLORSCHEME); - g->ThemeId = -1; + g->SchemeId = -1; g->bInitializing = TRUE; for(i = 0; i < TemplateCount; i++) { - iListIndex = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)g_ThemeTemplates[i].strLegacyName); + iListIndex = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)g_ColorSchemes[i].strLegacyName); SendMessage(hwndCombo, CB_SETITEMDATA, iListIndex, i); - if (lstrcmp(g_ThemeTemplates[i].strKeyName, strSelectedStyle) == 0) + if (lstrcmp(g_ColorSchemes[i].strKeyName, strSelectedStyle) == 0) { - g->ThemeId = i; + g->SchemeId = i; SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM)iListIndex, 0); } } @@ -100,13 +100,13 @@ AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) hwndDlg, EffAppearanceDlgProc, (LPARAM)g) == IDOK) { PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - g->Theme = g->ThemeAdv; + g->Scheme = g->SchemeAdv; g->bHasChanged = TRUE; // Effects dialog doesn't change the color scheme, therefore the following lines are commented out, until fixed finally - //g->ThemeId = -1; /* Customized */ + //g->SchemeId = -1; /* Customized */ //SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_COLORSCHEME, CB_SETCURSEL, (WPARAM)-1, 0); //SetDlgItemText(hwndDlg, IDC_APPEARANCE_COLORSCHEME, TEXT("")); - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Theme); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Scheme); } break; @@ -116,30 +116,30 @@ AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { PropSheet_Changed(GetParent(hwndDlg), hwndDlg); g->bHasChanged = TRUE; - g->Theme = g->ThemeAdv; - g->ThemeId = -1; /* Customized */ - g_GlobalData.desktop_color = g->Theme.crColor[COLOR_DESKTOP]; + g->Scheme = g->SchemeAdv; + g->SchemeId = -1; /* Customized */ + g_GlobalData.desktop_color = g->Scheme.crColor[COLOR_DESKTOP]; SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_COLORSCHEME, CB_SETCURSEL, (WPARAM)-1, 0); SetDlgItemText(hwndDlg, IDC_APPEARANCE_COLORSCHEME, TEXT("")); - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Theme); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Scheme); } break; case IDC_APPEARANCE_COLORSCHEME: if (HIWORD(wParam) == CBN_SELCHANGE && !g->bInitializing) { - THEME Theme; - INT ThemeId = GetSelectedThemeId(hwndDlg); + COLOR_SCHEME Scheme; + INT SchemeId = GetSelectedThemeId(hwndDlg); PropSheet_Changed(GetParent(hwndDlg), hwndDlg); g->bHasChanged = TRUE; - if (ThemeId != -1 && LoadThemeFromReg(&Theme, ThemeId)) + if (SchemeId != -1 && LoadSchemeFromReg(&Scheme, SchemeId)) { - g->Theme = Theme; - g->ThemeId = ThemeId; - g_GlobalData.desktop_color = g->Theme.crColor[COLOR_DESKTOP]; - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&Theme); + g->Scheme = Scheme; + g->SchemeId = SchemeId; + g_GlobalData.desktop_color = g->Scheme.crColor[COLOR_DESKTOP]; + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&Scheme); } } break; @@ -153,10 +153,10 @@ AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) case PSN_APPLY: if (g->bHasChanged) { - INT ThemeId = GetSelectedThemeId(hwndDlg); - ApplyTheme(&g->Theme, ThemeId); - g->ThemeId = ThemeId; - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Theme); + INT SchemeId = GetSelectedThemeId(hwndDlg); + ApplyScheme(&g->Scheme, SchemeId); + g->SchemeId = SchemeId; + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Scheme); g->bHasChanged = FALSE; } SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, (LONG_PTR)PSNRET_NOERROR); @@ -167,10 +167,10 @@ AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) return TRUE; case PSN_SETACTIVE: - if (g->Theme.crColor[COLOR_DESKTOP] != g_GlobalData.desktop_color) + if (g->Scheme.crColor[COLOR_DESKTOP] != g_GlobalData.desktop_color) { - g->Theme.crColor[COLOR_DESKTOP] = g_GlobalData.desktop_color; - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Theme); + g->Scheme.crColor[COLOR_DESKTOP] = g_GlobalData.desktop_color; + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Scheme); } break; } diff --git a/dll/cpl/desk/appearance.h b/dll/cpl/desk/appearance.h index 60c8ff66aae..9d95acc140c 100644 --- a/dll/cpl/desk/appearance.h +++ b/dll/cpl/desk/appearance.h @@ -5,9 +5,9 @@ or by passing hwnd and getting the pointer by GetWindowLongPtr */ typedef struct tagGLOBALS { - INT ThemeId; /* Theme is customized if ThemeId == -1 */ - THEME Theme; - THEME ThemeAdv; + INT SchemeId; /* Theme is customized if SchemeId == -1 */ + COLOR_SCHEME Scheme; + COLOR_SCHEME SchemeAdv; BOOL bHasChanged; HBITMAP hbmpColor[3]; INT CurrentElement; diff --git a/dll/cpl/desk/draw.c b/dll/cpl/desk/draw.c index 982ac9c1401..d6fc09d915e 100644 --- a/dll/cpl/desk/draw.c +++ b/dll/cpl/desk/draw.c @@ -58,7 +58,7 @@ static const signed char LTRBInnerMono[] = { }; static BOOL -MyIntDrawRectEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags, THEME *theme) +MyIntDrawRectEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags, COLOR_SCHEME *scheme) { signed char LTInnerI, LTOuterI; signed char RBInnerI, RBOuterI; @@ -100,7 +100,7 @@ MyIntDrawRectEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags, THEME *theme) RBOuterPen = GetStockObject(DC_PEN); { HBRUSH hbr; - hbr = CreateSolidBrush(theme->crColor[COLOR_BTNFACE]); + hbr = CreateSolidBrush(scheme->crColor[COLOR_BTNFACE]); FillRect(hdc, &InnerRect, hbr); DeleteObject(hbr); } @@ -108,7 +108,7 @@ MyIntDrawRectEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags, THEME *theme) /* Draw the outer edge */ SelectObject(hdc, LTOuterPen); - SetDCPenColor(hdc, theme->crColor[LTOuterI]); + SetDCPenColor(hdc, scheme->crColor[LTOuterI]); if(uFlags & BF_TOP) { MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL); @@ -120,7 +120,7 @@ MyIntDrawRectEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags, THEME *theme) LineTo(hdc, InnerRect.left, InnerRect.bottom); } SelectObject(hdc, RBOuterPen); - SetDCPenColor(hdc, theme->crColor[RBOuterI]); + SetDCPenColor(hdc, scheme->crColor[RBOuterI]); if(uFlags & BF_BOTTOM) { MoveToEx(hdc, InnerRect.left, InnerRect.bottom-1, NULL); @@ -134,7 +134,7 @@ MyIntDrawRectEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags, THEME *theme) /* Draw the inner edge */ SelectObject(hdc, LTInnerPen); - SetDCPenColor(hdc, theme->crColor[LTInnerI]); + SetDCPenColor(hdc, scheme->crColor[LTInnerI]); if(uFlags & BF_TOP) { MoveToEx(hdc, InnerRect.left+LTpenplus, InnerRect.top+1, NULL); @@ -146,7 +146,7 @@ MyIntDrawRectEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags, THEME *theme) LineTo(hdc, InnerRect.left+1, InnerRect.bottom-LBpenplus); } SelectObject(hdc, RBInnerPen); - SetDCPenColor(hdc, theme->crColor[RBInnerI]); + SetDCPenColor(hdc, scheme->crColor[RBInnerI]); if(uFlags & BF_BOTTOM) { MoveToEx(hdc, InnerRect.left+LBpenplus, InnerRect.bottom-2, NULL); @@ -183,14 +183,14 @@ MyIntDrawRectEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags, THEME *theme) } static BOOL -MyDrawFrameButton(HDC hdc, LPRECT rc, UINT uState, THEME *theme) +MyDrawFrameButton(HDC hdc, LPRECT rc, UINT uState, COLOR_SCHEME *scheme) { UINT edge; if(uState & (DFCS_PUSHED | DFCS_CHECKED | DFCS_FLAT)) edge = EDGE_SUNKEN; else edge = EDGE_RAISED; - return MyIntDrawRectEdge(hdc, rc, edge, (uState & DFCS_FLAT) | BF_RECT | BF_SOFT, theme); + return MyIntDrawRectEdge(hdc, rc, edge, (uState & DFCS_FLAT) | BF_RECT | BF_SOFT, scheme); } static int @@ -218,7 +218,7 @@ MyMakeSquareRect(LPRECT src, LPRECT dst) } static BOOL -MyDrawFrameCaption(HDC dc, LPRECT r, UINT uFlags, THEME *theme) +MyDrawFrameCaption(HDC dc, LPRECT r, UINT uFlags, COLOR_SCHEME *scheme) { LOGFONT lf; HFONT hFont, hOldFont; @@ -244,7 +244,7 @@ MyDrawFrameCaption(HDC dc, LPRECT r, UINT uFlags, THEME *theme) Symbol = '2'; break; } - MyIntDrawRectEdge(dc, r, (uFlags & DFCS_PUSHED) ? EDGE_SUNKEN : EDGE_RAISED, BF_RECT | BF_MIDDLE | BF_SOFT, theme); + MyIntDrawRectEdge(dc, r, (uFlags & DFCS_PUSHED) ? EDGE_SUNKEN : EDGE_RAISED, BF_RECT | BF_MIDDLE | BF_SOFT, scheme); ZeroMemory(&lf, sizeof(LOGFONT)); MyMakeSquareRect(r, &myr); myr.left += 1; @@ -268,10 +268,10 @@ MyDrawFrameCaption(HDC dc, LPRECT r, UINT uFlags, THEME *theme) if(uFlags & DFCS_INACTIVE) { /* draw shadow */ - SetTextColor(dc, theme->crColor[COLOR_BTNHIGHLIGHT]); + SetTextColor(dc, scheme->crColor[COLOR_BTNHIGHLIGHT]); TextOut(dc, myr.left + 1, myr.top + 1, &Symbol, 1); } - SetTextColor(dc, theme->crColor[(uFlags & DFCS_INACTIVE) ? COLOR_BTNSHADOW : COLOR_BTNTEXT]); + SetTextColor(dc, scheme->crColor[(uFlags & DFCS_INACTIVE) ? COLOR_BTNSHADOW : COLOR_BTNTEXT]); /* draw selected symbol */ TextOut(dc, myr.left, myr.top, &Symbol, 1); /* restore previous settings */ @@ -285,7 +285,7 @@ MyDrawFrameCaption(HDC dc, LPRECT r, UINT uFlags, THEME *theme) /******************************************************************************/ static BOOL -MyDrawFrameScroll(HDC dc, LPRECT r, UINT uFlags, THEME *theme) +MyDrawFrameScroll(HDC dc, LPRECT r, UINT uFlags, COLOR_SCHEME *scheme) { LOGFONT lf; HFONT hFont, hOldFont; @@ -312,7 +312,7 @@ MyDrawFrameScroll(HDC dc, LPRECT r, UINT uFlags, THEME *theme) Symbol = '4'; break; } - MyIntDrawRectEdge(dc, r, (uFlags & DFCS_PUSHED) ? EDGE_SUNKEN : EDGE_RAISED, (uFlags&DFCS_FLAT) | BF_MIDDLE | BF_RECT, theme); + MyIntDrawRectEdge(dc, r, (uFlags & DFCS_PUSHED) ? EDGE_SUNKEN : EDGE_RAISED, (uFlags&DFCS_FLAT) | BF_MIDDLE | BF_RECT, scheme); ZeroMemory(&lf, sizeof(LOGFONT)); MyMakeSquareRect(r, &myr); myr.left += 1; @@ -336,10 +336,10 @@ MyDrawFrameScroll(HDC dc, LPRECT r, UINT uFlags, THEME *theme) if(uFlags & DFCS_INACTIVE) { /* draw shadow */ - SetTextColor(dc, theme->crColor[COLOR_BTNHIGHLIGHT]); + SetTextColor(dc, scheme->crColor[COLOR_BTNHIGHLIGHT]); TextOut(dc, myr.left + 1, myr.top + 1, &Symbol, 1); } - SetTextColor(dc, theme->crColor[(uFlags & DFCS_INACTIVE) ? COLOR_BTNSHADOW : COLOR_BTNTEXT]); + SetTextColor(dc, scheme->crColor[(uFlags & DFCS_INACTIVE) ? COLOR_BTNSHADOW : COLOR_BTNTEXT]); /* draw selected symbol */ TextOut(dc, myr.left, myr.top, &Symbol, 1); /* restore previous settings */ @@ -351,28 +351,28 @@ MyDrawFrameScroll(HDC dc, LPRECT r, UINT uFlags, THEME *theme) } BOOL -MyDrawFrameControl(HDC hDC, LPRECT rc, UINT uType, UINT uState, THEME *theme) +MyDrawFrameControl(HDC hDC, LPRECT rc, UINT uType, UINT uState, COLOR_SCHEME *scheme) { switch(uType) { case DFC_BUTTON: - return MyDrawFrameButton(hDC, rc, uState, theme); + return MyDrawFrameButton(hDC, rc, uState, scheme); case DFC_CAPTION: - return MyDrawFrameCaption(hDC, rc, uState, theme); + return MyDrawFrameCaption(hDC, rc, uState, scheme); case DFC_SCROLL: - return MyDrawFrameScroll(hDC, rc, uState, theme); + return MyDrawFrameScroll(hDC, rc, uState, scheme); } return FALSE; } BOOL -MyDrawEdge(HDC hDC, LPRECT rc, UINT edge, UINT flags, THEME *theme) +MyDrawEdge(HDC hDC, LPRECT rc, UINT edge, UINT flags, COLOR_SCHEME *scheme) { - return MyIntDrawRectEdge(hDC, rc, edge, flags, theme); + return MyIntDrawRectEdge(hDC, rc, edge, flags, scheme); } VOID -MyDrawCaptionButtons(HDC hdc, LPRECT lpRect, BOOL bMinMax, int x, THEME *theme) +MyDrawCaptionButtons(HDC hdc, LPRECT lpRect, BOOL bMinMax, int x, COLOR_SCHEME *scheme) { RECT rc3; RECT rc4; @@ -383,7 +383,7 @@ MyDrawCaptionButtons(HDC hdc, LPRECT lpRect, BOOL bMinMax, int x, THEME *theme) rc3.right = lpRect->right - 2; rc3.bottom = lpRect->bottom - 2; - MyDrawFrameControl(hdc, &rc3, DFC_CAPTION, DFCS_CAPTIONCLOSE, theme); + MyDrawFrameControl(hdc, &rc3, DFC_CAPTION, DFCS_CAPTIONCLOSE, scheme); if (bMinMax) { @@ -392,19 +392,19 @@ MyDrawCaptionButtons(HDC hdc, LPRECT lpRect, BOOL bMinMax, int x, THEME *theme) rc4.right = rc3.right - x - 2; rc4.bottom = rc3.bottom; - MyDrawFrameControl(hdc, &rc4, DFC_CAPTION, DFCS_CAPTIONMAX, theme); + MyDrawFrameControl(hdc, &rc4, DFC_CAPTION, DFCS_CAPTIONMAX, scheme); rc5.left = rc4.left - x; rc5.top = rc4.top; rc5.right = rc4.right - x; rc5.bottom = rc4.bottom; - MyDrawFrameControl(hdc, &rc5, DFC_CAPTION, DFCS_CAPTIONMIN, theme); + MyDrawFrameControl(hdc, &rc5, DFC_CAPTION, DFCS_CAPTIONMIN, scheme); } } VOID -MyDrawScrollbar(HDC hdc, LPRECT rc, HBRUSH hbrScrollbar, THEME *theme) +MyDrawScrollbar(HDC hdc, LPRECT rc, HBRUSH hbrScrollbar, COLOR_SCHEME *scheme) { RECT rcTop; RECT rcBottom; @@ -428,8 +428,8 @@ MyDrawScrollbar(HDC hdc, LPRECT rc, HBRUSH hbrScrollbar, THEME *theme) rcBottom.top = rc->bottom - width; rcBottom.bottom = rc->bottom; - MyDrawFrameControl(hdc, &rcTop, DFC_SCROLL, DFCS_SCROLLUP, theme); - MyDrawFrameControl(hdc, &rcBottom, DFC_SCROLL, DFCS_SCROLLDOWN, theme); + MyDrawFrameControl(hdc, &rcTop, DFC_SCROLL, DFCS_SCROLLUP, scheme); + MyDrawFrameControl(hdc, &rcBottom, DFC_SCROLL, DFCS_SCROLLDOWN, scheme); FillRect(hdc, &rcMiddle, hbrScrollbar); } @@ -437,7 +437,7 @@ MyDrawScrollbar(HDC hdc, LPRECT rc, HBRUSH hbrScrollbar, THEME *theme) /******************************************************************************/ BOOL -MyDrawCaptionTemp(HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont, HICON hIcon, LPCWSTR str, UINT uFlags, THEME *theme) +MyDrawCaptionTemp(HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont, HICON hIcon, LPCWSTR str, UINT uFlags, COLOR_SCHEME *scheme) { ULONG Height; UINT VCenter, Padding; @@ -446,11 +446,11 @@ MyDrawCaptionTemp(HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont, HICON hIcon HGDIOBJ hFontOld; RECT rc; - Height = theme->Size[SIZE_CAPTION_Y] - 1; + Height = scheme->Size[SIZE_CAPTION_Y] - 1; VCenter = (rect->bottom - rect->top) / 2; Padding = VCenter - (Height / 2); - ButtonWidth = theme->Size[SIZE_SIZE_X] - 2; + ButtonWidth = scheme->Size[SIZE_SIZE_X] - 2; if (uFlags & DC_GRADIENT) { @@ -458,9 +458,9 @@ MyDrawCaptionTemp(HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont, HICON hIcon TRIVERTEX vert[2]; COLORREF Colors[2]; - Colors[0] = theme->crColor[((uFlags & DC_ACTIVE) ? + Colors[0] = scheme->crColor[((uFlags & DC_ACTIVE) ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION)]; - Colors[1] = theme->crColor[((uFlags & DC_ACTIVE) ? + Colors[1] = scheme->crColor[((uFlags & DC_ACTIVE) ? COLOR_GRADIENTACTIVECAPTION : COLOR_GRADIENTINACTIVECAPTION)]; vert[0].x = rect->left; @@ -482,9 +482,9 @@ MyDrawCaptionTemp(HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont, HICON hIcon else { if (uFlags & DC_ACTIVE) - hbr = CreateSolidBrush(theme->crColor[COLOR_ACTIVECAPTION]); + hbr = CreateSolidBrush(scheme->crColor[COLOR_ACTIVECAPTION]); else - hbr = CreateSolidBrush(theme->crColor[COLOR_INACTIVECAPTION]); + hbr = CreateSolidBrush(scheme->crColor[COLOR_INACTIVECAPTION]); FillRect(hdc, rect, hbr); DeleteObject(hbr); } @@ -492,9 +492,9 @@ MyDrawCaptionTemp(HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont, HICON hIcon hFontOld = SelectObject(hdc, hFont); SetBkMode(hdc, TRANSPARENT); if (uFlags & DC_ACTIVE) - SetTextColor(hdc, theme->crColor[COLOR_CAPTIONTEXT]); + SetTextColor(hdc, scheme->crColor[COLOR_CAPTIONTEXT]); else - SetTextColor(hdc, theme->crColor[COLOR_INACTIVECAPTIONTEXT]); + SetTextColor(hdc, scheme->crColor[COLOR_INACTIVECAPTIONTEXT]); rc.left = rect->left + 2; rc.top = rect->top; rc.right = rect->right; @@ -507,7 +507,7 @@ MyDrawCaptionTemp(HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont, HICON hIcon /******************************************************************************/ DWORD -MyDrawMenuBarTemp(HWND Wnd, HDC DC, LPRECT Rect, HMENU Menu, HFONT Font, THEME *theme) +MyDrawMenuBarTemp(HWND Wnd, HDC DC, LPRECT Rect, HMENU Menu, HFONT Font, COLOR_SCHEME *scheme) { HBRUSH hbr; HPEN hPen; @@ -518,16 +518,16 @@ MyDrawMenuBarTemp(HWND Wnd, HDC DC, LPRECT Rect, HMENU Menu, HFONT Font, THEME * WCHAR Text[128]; UINT uFormat = DT_CENTER | DT_VCENTER | DT_SINGLELINE; - flat_menu = theme->bFlatMenus; + flat_menu = scheme->bFlatMenus; if (flat_menu) - hbr = CreateSolidBrush(theme->crColor[COLOR_MENUBAR]); + hbr = CreateSolidBrush(scheme->crColor[COLOR_MENUBAR]); else - hbr = CreateSolidBrush(theme->crColor[COLOR_MENU]); + hbr = CreateSolidBrush(scheme->crColor[COLOR_MENU]); FillRect(DC, Rect, hbr); DeleteObject(hbr); - hPen = CreatePen(PS_SOLID, 0, theme->crColor[COLOR_3DFACE]); + hPen = CreatePen(PS_SOLID, 0, scheme->crColor[COLOR_3DFACE]); hPenOld = SelectObject(DC, hPen); MoveToEx(DC, Rect->left, Rect->bottom - 1, NULL); LineTo(DC, Rect->right, Rect->bottom - 1); @@ -553,35 +553,35 @@ MyDrawMenuBarTemp(HWND Wnd, HDC DC, LPRECT Rect, HMENU Menu, HFONT Font, THEME * { if (flat_menu) { - SetTextColor(DC, theme->crColor[COLOR_HIGHLIGHTTEXT]); - SetBkColor(DC, theme->crColor[COLOR_HIGHLIGHT]); + SetTextColor(DC, scheme->crColor[COLOR_HIGHLIGHTTEXT]); + SetBkColor(DC, scheme->crColor[COLOR_HIGHLIGHT]); InflateRect (&rect, -1, -1); - hbr = CreateSolidBrush(theme->crColor[COLOR_MENUHILIGHT]); + hbr = CreateSolidBrush(scheme->crColor[COLOR_MENUHILIGHT]); FillRect(DC, &rect, hbr); DeleteObject(hbr); InflateRect (&rect, 1, 1); - hbr = CreateSolidBrush(theme->crColor[COLOR_HIGHLIGHT]); + hbr = CreateSolidBrush(scheme->crColor[COLOR_HIGHLIGHT]); FrameRect(DC, &rect, hbr); DeleteObject(hbr); } else { - SetTextColor(DC, theme->crColor[COLOR_MENUTEXT]); - SetBkColor(DC, theme->crColor[COLOR_MENU]); + SetTextColor(DC, scheme->crColor[COLOR_MENUTEXT]); + SetBkColor(DC, scheme->crColor[COLOR_MENU]); DrawEdge(DC, &rect, BDR_SUNKENOUTER, BF_RECT); } } else { if (i == 1) - SetTextColor(DC, theme->crColor[COLOR_GRAYTEXT]); + SetTextColor(DC, scheme->crColor[COLOR_GRAYTEXT]); else - SetTextColor(DC, theme->crColor[COLOR_MENUTEXT]); + SetTextColor(DC, scheme->crColor[COLOR_MENUTEXT]); - SetBkColor(DC, theme->crColor[bkgnd]); - hbr = CreateSolidBrush(theme->crColor[bkgnd]); + SetBkColor(DC, scheme->crColor[bkgnd]); + hbr = CreateSolidBrush(scheme->crColor[bkgnd]); FillRect(DC, &rect, hbr); DeleteObject(hbr); } diff --git a/dll/cpl/desk/draw.h b/dll/cpl/desk/draw.h index be45a896454..8ecb0ae6d3d 100644 --- a/dll/cpl/desk/draw.h +++ b/dll/cpl/desk/draw.h @@ -1,12 +1,12 @@ BOOL -MyDrawFrameControl(HDC hDC, LPRECT rc, UINT uType, UINT uState, THEME *theme); +MyDrawFrameControl(HDC hDC, LPRECT rc, UINT uType, UINT uState, COLOR_SCHEME *scheme); BOOL -MyDrawEdge(HDC hDC, LPRECT rc, UINT edge, UINT flags, THEME *theme); +MyDrawEdge(HDC hDC, LPRECT rc, UINT edge, UINT flags, COLOR_SCHEME *scheme); VOID -MyDrawCaptionButtons(HDC hdc, LPRECT lpRect, BOOL bMinMax, int x, THEME *theme); +MyDrawCaptionButtons(HDC hdc, LPRECT lpRect, BOOL bMinMax, int x, COLOR_SCHEME *scheme); VOID -MyDrawScrollbar(HDC hdc, LPRECT rc, HBRUSH hbrScrollbar, THEME *theme); +MyDrawScrollbar(HDC hdc, LPRECT rc, HBRUSH hbrScrollbar, COLOR_SCHEME *scheme); BOOL -MyDrawCaptionTemp(HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont, HICON hIcon, LPCWSTR str, UINT uFlags, THEME *theme); +MyDrawCaptionTemp(HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont, HICON hIcon, LPCWSTR str, UINT uFlags, COLOR_SCHEME *scheme); DWORD -MyDrawMenuBarTemp(HWND Wnd, HDC DC, LPRECT Rect, HMENU Menu, HFONT Font, THEME *theme); +MyDrawMenuBarTemp(HWND Wnd, HDC DC, LPRECT Rect, HMENU Menu, HFONT Font, COLOR_SCHEME *scheme); diff --git a/dll/cpl/desk/effappdlg.c b/dll/cpl/desk/effappdlg.c index 910c5d3b395..a123a444759 100644 --- a/dll/cpl/desk/effappdlg.c +++ b/dll/cpl/desk/effappdlg.c @@ -18,16 +18,16 @@ UpdateControls(HWND hwndDlg, GLOBALS *g) { WPARAM state; state = SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_ANIMATION, BM_GETCHECK, 0, 0); - g->ThemeAdv.Effects.bMenuAnimation = (state == BST_CHECKED) ? TRUE : FALSE; - EnableWindow(GetDlgItem(hwndDlg, IDC_EFFAPPEARANCE_ANIMATIONTYPE), g->ThemeAdv.Effects.bMenuAnimation); + g->SchemeAdv.Effects.bMenuAnimation = (state == BST_CHECKED) ? TRUE : FALSE; + EnableWindow(GetDlgItem(hwndDlg, IDC_EFFAPPEARANCE_ANIMATIONTYPE), g->SchemeAdv.Effects.bMenuAnimation); //A boolean as an index for a 2-value list: - SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_ANIMATIONTYPE, CB_SETCURSEL, (WPARAM)g->ThemeAdv.Effects.bMenuFade, 0); + SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_ANIMATIONTYPE, CB_SETCURSEL, (WPARAM)g->SchemeAdv.Effects.bMenuFade, 0); state = SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_KEYBOARDCUES, BM_GETCHECK, 0, 0); - g->ThemeAdv.Effects.bKeyboardCues = (state == BST_CHECKED) ? TRUE : FALSE; + g->SchemeAdv.Effects.bKeyboardCues = (state == BST_CHECKED) ? TRUE : FALSE; state = SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_DRAGFULLWINDOWS, BM_GETCHECK, 0, 0); - g->ThemeAdv.Effects.bDragFullWindows = (state == BST_CHECKED) ? TRUE : FALSE; + g->SchemeAdv.Effects.bDragFullWindows = (state == BST_CHECKED) ? TRUE : FALSE; g->bHasChanged = TRUE; } @@ -58,17 +58,17 @@ EffAppearanceDlg_Init(HWND hwndDlg, GLOBALS *g) WPARAM state; /* Copy the current theme values */ - g->ThemeAdv = g->Theme; + g->SchemeAdv = g->Scheme; AddToCombo(hwndDlg, IDS_SLIDEEFFECT, IDS_FADEEFFECT, IDC_EFFAPPEARANCE_ANIMATIONTYPE); - state = g->ThemeAdv.Effects.bMenuAnimation ? BST_CHECKED : BST_UNCHECKED; + state = g->SchemeAdv.Effects.bMenuAnimation ? BST_CHECKED : BST_UNCHECKED; SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_ANIMATION, BM_SETCHECK, state, 0); - state = g->ThemeAdv.Effects.bKeyboardCues ? BST_CHECKED : BST_UNCHECKED; + state = g->SchemeAdv.Effects.bKeyboardCues ? BST_CHECKED : BST_UNCHECKED; SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_KEYBOARDCUES, BM_SETCHECK, state, 0); - state = g->ThemeAdv.Effects.bDragFullWindows ? BST_CHECKED : BST_UNCHECKED; + state = g->SchemeAdv.Effects.bDragFullWindows ? BST_CHECKED : BST_UNCHECKED; SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_DRAGFULLWINDOWS, BM_SETCHECK, state, 0); /* Update the controls */ @@ -109,7 +109,7 @@ EffAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) break; case IDCANCEL: - g->ThemeAdv = g->Theme; + g->SchemeAdv = g->Scheme; EndDialog(hwndDlg, IDCANCEL); break; @@ -126,7 +126,7 @@ EffAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) if (HIWORD(wParam) == CBN_SELCHANGE) { SaveCurrentValues(hwndDlg, g); - g->ThemeAdv.Effects.bMenuFade = SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_ANIMATIONTYPE, CB_GETCURSEL, 0, 0); + g->SchemeAdv.Effects.bMenuFade = SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_ANIMATIONTYPE, CB_GETCURSEL, 0, 0); UpdateControls(hwndDlg, g); } break; diff --git a/dll/cpl/desk/preview.c b/dll/cpl/desk/preview.c index c6e6a3210b5..56bbce869b2 100644 --- a/dll/cpl/desk/preview.c +++ b/dll/cpl/desk/preview.c @@ -17,7 +17,7 @@ typedef struct _PREVIEW_DATA { HWND hwndParent; - THEME Theme; + COLOR_SCHEME Scheme; HBRUSH hbrScrollbar; HBRUSH hbrDesktop; @@ -70,49 +70,49 @@ typedef struct _PREVIEW_DATA } PREVIEW_DATA, *PPREVIEW_DATA; -static VOID UpdatePreviewTheme(HWND hwnd, PPREVIEW_DATA pPreviewData, THEME *theme) +static VOID UpdatePreviewTheme(HWND hwnd, PPREVIEW_DATA pPreviewData, COLOR_SCHEME *scheme) { if (pPreviewData->hbrScrollbar != NULL) DeleteObject(pPreviewData->hbrScrollbar); - pPreviewData->hbrScrollbar = CreateSolidBrush(theme->crColor[COLOR_SCROLLBAR]); + pPreviewData->hbrScrollbar = CreateSolidBrush(scheme->crColor[COLOR_SCROLLBAR]); if (pPreviewData->hbrDesktop != NULL) DeleteObject(pPreviewData->hbrDesktop); - pPreviewData->hbrDesktop = CreateSolidBrush(theme->crColor[COLOR_DESKTOP]); + pPreviewData->hbrDesktop = CreateSolidBrush(scheme->crColor[COLOR_DESKTOP]); if (pPreviewData->hbrWindow != NULL) DeleteObject(pPreviewData->hbrWindow); - pPreviewData->hbrWindow = CreateSolidBrush(theme->crColor[COLOR_WINDOW]); + pPreviewData->hbrWindow = CreateSolidBrush(scheme->crColor[COLOR_WINDOW]); - pPreviewData->cxEdge = theme->Size[SIZE_EDGE_X] - 2; /* SM_CXEDGE */ - pPreviewData->cyEdge = theme->Size[SIZE_EDGE_Y] - 2; /* SM_CYEDGE */ + pPreviewData->cxEdge = scheme->Size[SIZE_EDGE_X] - 2; /* SM_CXEDGE */ + pPreviewData->cyEdge = scheme->Size[SIZE_EDGE_Y] - 2; /* SM_CYEDGE */ - pPreviewData->cySizeFrame = theme->Size[SIZE_FRAME_Y] - 1; /* SM_CYSIZEFRAME */ + pPreviewData->cySizeFrame = scheme->Size[SIZE_FRAME_Y] - 1; /* SM_CYSIZEFRAME */ - pPreviewData->cyCaption = theme->Size[SIZE_CAPTION_Y]; /* SM_CYCAPTION */ - pPreviewData->cyMenu = theme->Size[SIZE_MENU_Y]; /* SM_CYMENU */ - pPreviewData->cxScrollbar = theme->Size[SIZE_SCROLL_X]; /* SM_CXVSCROLL */ - pPreviewData->cyBorder = theme->Size[SIZE_BORDER_Y]; /* SM_CYBORDER */ + pPreviewData->cyCaption = scheme->Size[SIZE_CAPTION_Y]; /* SM_CYCAPTION */ + pPreviewData->cyMenu = scheme->Size[SIZE_MENU_Y]; /* SM_CYMENU */ + pPreviewData->cxScrollbar = scheme->Size[SIZE_SCROLL_X]; /* SM_CXVSCROLL */ + pPreviewData->cyBorder = scheme->Size[SIZE_BORDER_Y]; /* SM_CYBORDER */ if (pPreviewData->hCaptionFont != NULL) DeleteObject(pPreviewData->hCaptionFont); - pPreviewData->hCaptionFont = CreateFontIndirect(&theme->lfFont[FONT_CAPTION]); + pPreviewData->hCaptionFont = CreateFontIndirect(&scheme->lfFont[FONT_CAPTION]); if (pPreviewData->hMenuFont != NULL) DeleteObject(pPreviewData->hMenuFont); - pPreviewData->hMenuFont = CreateFontIndirect(&theme->lfFont[FONT_MENU]); + pPreviewData->hMenuFont = CreateFontIndirect(&scheme->lfFont[FONT_MENU]); if (pPreviewData->hMessageFont != NULL) DeleteObject(pPreviewData->hMessageFont); - pPreviewData->hMessageFont = CreateFontIndirect(&theme->lfFont[FONT_DIALOG]); + pPreviewData->hMessageFont = CreateFontIndirect(&scheme->lfFont[FONT_DIALOG]); - pPreviewData->Theme = *theme; + pPreviewData->Scheme = *scheme; InvalidateRect(hwnd, NULL, FALSE); } static VOID OnCreate(HWND hwnd, PPREVIEW_DATA pPreviewData) { - THEME *theme; + COLOR_SCHEME *scheme; pPreviewData->hClientFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); @@ -133,10 +133,10 @@ OnCreate(HWND hwnd, PPREVIEW_DATA pPreviewData) AllocAndLoadString(&pPreviewData->lpMessText, hApplet, IDS_MESSTEXT); AllocAndLoadString(&pPreviewData->lpButText, hApplet, IDS_BUTTEXT); - theme = &pPreviewData->Theme; - LoadCurrentTheme(theme); + scheme = &pPreviewData->Scheme; + LoadCurrentScheme(scheme); - UpdatePreviewTheme(hwnd, pPreviewData, theme); + UpdatePreviewTheme(hwnd, pPreviewData, scheme); } @@ -255,9 +255,9 @@ OnPaint(HWND hwnd, PPREVIEW_DATA pPreviewData) HFONT hOldFont; HDC hdc; RECT rc; - THEME *theme; + COLOR_SCHEME *scheme; - theme = &pPreviewData->Theme; + scheme = &pPreviewData->Scheme; hdc = BeginPaint(hwnd, &ps); @@ -265,61 +265,61 @@ OnPaint(HWND hwnd, PPREVIEW_DATA pPreviewData) FillRect(hdc, &pPreviewData->rcDesktop, pPreviewData->hbrDesktop); /* Inactive Window */ - MyDrawEdge(hdc, &pPreviewData->rcInactiveFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE, theme); - SetTextColor(hdc, theme->crColor[COLOR_INACTIVECAPTIONTEXT]); + MyDrawEdge(hdc, &pPreviewData->rcInactiveFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE, scheme); + SetTextColor(hdc, scheme->crColor[COLOR_INACTIVECAPTIONTEXT]); MyDrawCaptionTemp(NULL, hdc, &pPreviewData->rcInactiveCaption, pPreviewData->hCaptionFont, - NULL, pPreviewData->lpInAct, DC_GRADIENT | DC_ICON | DC_TEXT, theme); - MyDrawCaptionButtons(hdc, &pPreviewData->rcInactiveCaption, TRUE, pPreviewData->cyCaption - 2, theme); + NULL, pPreviewData->lpInAct, DC_GRADIENT | DC_ICON | DC_TEXT, scheme); + MyDrawCaptionButtons(hdc, &pPreviewData->rcInactiveCaption, TRUE, pPreviewData->cyCaption - 2, scheme); /* Active Window */ - MyDrawEdge(hdc, &pPreviewData->rcActiveFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE, theme); - SetTextColor(hdc, theme->crColor[COLOR_CAPTIONTEXT]); + MyDrawEdge(hdc, &pPreviewData->rcActiveFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE, scheme); + SetTextColor(hdc, scheme->crColor[COLOR_CAPTIONTEXT]); MyDrawCaptionTemp(NULL, hdc, &pPreviewData->rcActiveCaption, pPreviewData->hCaptionFont, - NULL, pPreviewData->lpAct, DC_ACTIVE | DC_GRADIENT | DC_ICON | DC_TEXT, theme); - MyDrawCaptionButtons(hdc, &pPreviewData->rcActiveCaption, TRUE, pPreviewData->cyCaption - 2, theme); + NULL, pPreviewData->lpAct, DC_ACTIVE | DC_GRADIENT | DC_ICON | DC_TEXT, scheme); + MyDrawCaptionButtons(hdc, &pPreviewData->rcActiveCaption, TRUE, pPreviewData->cyCaption - 2, scheme); /* Draw the menu bar */ MyDrawMenuBarTemp(hwnd, hdc, &pPreviewData->rcActiveMenuBar, pPreviewData->hMenu, - pPreviewData->hMenuFont, theme); + pPreviewData->hMenuFont, scheme); /* Draw the client area */ CopyRect(&rc, &pPreviewData->rcActiveClient); - MyDrawEdge(hdc, &rc, EDGE_SUNKEN, BF_RECT | BF_ADJUST, theme); + MyDrawEdge(hdc, &rc, EDGE_SUNKEN, BF_RECT | BF_ADJUST, scheme); FillRect(hdc, &rc, pPreviewData->hbrWindow); /* Draw the client text */ CopyRect(&rc, &pPreviewData->rcActiveClient); rc.left += 4; rc.top += 2; - SetTextColor(hdc, theme->crColor[COLOR_WINDOWTEXT]); + SetTextColor(hdc, scheme->crColor[COLOR_WINDOWTEXT]); hOldFont = SelectObject(hdc, pPreviewData->hClientFont); DrawText(hdc, pPreviewData->lpWinTxt, -1, &rc, DT_LEFT); SelectObject(hdc, hOldFont); /* Draw the scroll bar */ - MyDrawScrollbar(hdc, &pPreviewData->rcActiveScroll, pPreviewData->hbrScrollbar, theme); + MyDrawScrollbar(hdc, &pPreviewData->rcActiveScroll, pPreviewData->hbrScrollbar, scheme); /* Dialog Window */ - MyDrawEdge(hdc, &pPreviewData->rcDialogFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE, theme); - SetTextColor(hdc, theme->crColor[COLOR_WINDOW]); + MyDrawEdge(hdc, &pPreviewData->rcDialogFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE, scheme); + SetTextColor(hdc, scheme->crColor[COLOR_WINDOW]); MyDrawCaptionTemp(NULL, hdc, &pPreviewData->rcDialogCaption, pPreviewData->hCaptionFont, - NULL, pPreviewData->lpMessBox, DC_ACTIVE | DC_GRADIENT | DC_ICON | DC_TEXT, theme); - MyDrawCaptionButtons(hdc, &pPreviewData->rcDialogCaption, FALSE, pPreviewData->cyCaption - 2, theme); + NULL, pPreviewData->lpMessBox, DC_ACTIVE | DC_GRADIENT | DC_ICON | DC_TEXT, scheme); + MyDrawCaptionButtons(hdc, &pPreviewData->rcDialogCaption, FALSE, pPreviewData->cyCaption - 2, scheme); /* Draw the dialog text */ CopyRect(&rc, &pPreviewData->rcDialogClient); rc.left += 4; rc.top += 2; - SetTextColor(hdc, theme->crColor[COLOR_BTNTEXT]); + SetTextColor(hdc, scheme->crColor[COLOR_BTNTEXT]); hOldFont = SelectObject(hdc, pPreviewData->hMessageFont); DrawText(hdc, pPreviewData->lpMessText, -1, &rc, DT_LEFT); SelectObject(hdc, hOldFont); /* Draw Button */ - MyDrawFrameControl(hdc, &pPreviewData->rcDialogButton, DFC_BUTTON, DFCS_BUTTONPUSH, theme); + MyDrawFrameControl(hdc, &pPreviewData->rcDialogButton, DFC_BUTTON, DFCS_BUTTONPUSH, scheme); CopyRect(&rc, &pPreviewData->rcDialogButton); - SetTextColor(hdc, theme->crColor[COLOR_BTNTEXT]); + SetTextColor(hdc, scheme->crColor[COLOR_BTNTEXT]); hOldFont = SelectObject(hdc, pPreviewData->hMessageFont); DrawText(hdc, pPreviewData->lpButText, -1, &rc, DT_VCENTER | DT_CENTER | DT_SINGLELINE); SelectObject(hdc, hOldFont); @@ -497,7 +497,7 @@ PreviewWndProc(HWND hwnd, break; case PVM_UPDATETHEME: - UpdatePreviewTheme(hwnd, pPreviewData, (THEME *)lParam); + UpdatePreviewTheme(hwnd, pPreviewData, (COLOR_SCHEME *)lParam); break; default: diff --git a/dll/cpl/desk/theme.c b/dll/cpl/desk/theme.c index 821206fab2e..9335f3a6ba3 100644 --- a/dll/cpl/desk/theme.c +++ b/dll/cpl/desk/theme.c @@ -21,7 +21,7 @@ static const TCHAR g_SelectedStyle[] = TEXT("SelectedStyle"); /******************************************************************************/ -THEME_PRESET g_ThemeTemplates[MAX_TEMPLATES]; +SCHEME_PRESET g_ColorSchemes[MAX_TEMPLATES]; /* This is the list of names for the colors stored in the registry */ const TCHAR g_RegColorNames[NUM_COLORS][MAX_COLORNAMELENGTH] = @@ -85,7 +85,7 @@ const int g_SizeMetric[NUM_SIZES] = /******************************************************************************/ -VOID LoadCurrentTheme(THEME* theme) +VOID LoadCurrentScheme(COLOR_SCHEME* scheme) { INT i; NONCLIENTMETRICS NonClientMetrics; @@ -94,43 +94,43 @@ VOID LoadCurrentTheme(THEME* theme) for (i = 0; i < NUM_COLORS; i++) { g_ColorList[i] = i; - theme->crColor[i] = (COLORREF)GetSysColor(i); + scheme->crColor[i] = (COLORREF)GetSysColor(i); } /* Load sizes */ for (i = 0; i < NUM_SIZES; i++) { - theme->Size[i] = GetSystemMetrics(g_SizeMetric[i]); + scheme->Size[i] = GetSystemMetrics(g_SizeMetric[i]); } /* Load fonts */ NonClientMetrics.cbSize = sizeof(NONCLIENTMETRICS); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &NonClientMetrics, 0); - theme->lfFont[FONT_CAPTION] = NonClientMetrics.lfCaptionFont; - theme->lfFont[FONT_SMCAPTION] = NonClientMetrics.lfSmCaptionFont; - theme->lfFont[FONT_MENU] = NonClientMetrics.lfMenuFont; - theme->lfFont[FONT_INFO] = NonClientMetrics.lfStatusFont; - theme->lfFont[FONT_DIALOG] = NonClientMetrics.lfMessageFont; - SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &theme->lfFont[FONT_ICON], 0); + scheme->lfFont[FONT_CAPTION] = NonClientMetrics.lfCaptionFont; + scheme->lfFont[FONT_SMCAPTION] = NonClientMetrics.lfSmCaptionFont; + scheme->lfFont[FONT_MENU] = NonClientMetrics.lfMenuFont; + scheme->lfFont[FONT_INFO] = NonClientMetrics.lfStatusFont; + scheme->lfFont[FONT_DIALOG] = NonClientMetrics.lfMessageFont; + SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &scheme->lfFont[FONT_ICON], 0); /* Effects */ /* "Use the following transition effect for menus and tooltips" */ - SystemParametersInfo(SPI_GETMENUANIMATION, sizeof(BOOL), &theme->Effects.bMenuAnimation, 0); - SystemParametersInfo(SPI_GETMENUFADE, sizeof(BOOL), &theme->Effects.bMenuFade, 0); + SystemParametersInfo(SPI_GETMENUANIMATION, sizeof(BOOL), &scheme->Effects.bMenuAnimation, 0); + SystemParametersInfo(SPI_GETMENUFADE, sizeof(BOOL), &scheme->Effects.bMenuFade, 0); /* FIXME: XP seems to use grayed checkboxes to reflect differences between menu and tooltips settings * Just keep them in sync for now: */ - theme->Effects.bTooltipAnimation = theme->Effects.bMenuAnimation; - theme->Effects.bTooltipFade = theme->Effects.bMenuFade; + scheme->Effects.bTooltipAnimation = scheme->Effects.bMenuAnimation; + scheme->Effects.bTooltipFade = scheme->Effects.bMenuFade; /* show content of windows during dragging */ - SystemParametersInfo(SPI_GETDRAGFULLWINDOWS, 0, &theme->Effects.bDragFullWindows, 0); + SystemParametersInfo(SPI_GETDRAGFULLWINDOWS, 0, &scheme->Effects.bDragFullWindows, 0); /* "Hide underlined letters for keyboard navigation until I press the Alt key" */ - SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &theme->Effects.bKeyboardCues, 0); + SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &scheme->Effects.bKeyboardCues, 0); } -BOOL LoadThemeFromReg(THEME* theme, INT ThemeId) +BOOL LoadSchemeFromReg(COLOR_SCHEME* scheme, INT SchemeId) { INT i; TCHAR strSelectedStyle[4]; @@ -141,37 +141,37 @@ BOOL LoadThemeFromReg(THEME* theme, INT ThemeId) BOOL Ret = FALSE; if (!g_PresetLoaded) - LoadThemePresetEntries(strSelectedStyle); + LoadSchemePresetEntries(strSelectedStyle); - if (ThemeId == -1) + if (SchemeId == -1) return FALSE; if (RegOpenKeyEx(HKEY_CURRENT_USER, g_CPANewSchemes, 0, KEY_READ, &hkNewSchemes) == ERROR_SUCCESS) { - if (RegOpenKeyEx(hkNewSchemes, g_ThemeTemplates[ThemeId].strKeyName, 0, KEY_READ, &hkScheme) == ERROR_SUCCESS) + if (RegOpenKeyEx(hkNewSchemes, g_ColorSchemes[SchemeId].strKeyName, 0, KEY_READ, &hkScheme) == ERROR_SUCCESS) { - lstrcpyn(&strSizeName[6], g_ThemeTemplates[ThemeId].strSizeName, 3); + lstrcpyn(&strSizeName[6], g_ColorSchemes[SchemeId].strSizeName, 3); if (RegOpenKeyEx(hkScheme, strSizeName, 0, KEY_READ, &hkSize) == ERROR_SUCCESS) { Ret = TRUE; dwLength = sizeof(DWORD); - if (RegQueryValueEx(hkSize, TEXT("FlatMenus"), NULL, &dwType, (LPBYTE)&theme->bFlatMenus, &dwLength) != ERROR_SUCCESS || + if (RegQueryValueEx(hkSize, TEXT("FlatMenus"), NULL, &dwType, (LPBYTE)&scheme->bFlatMenus, &dwLength) != ERROR_SUCCESS || dwType != REG_DWORD) { /* Failed to read registry value */ - theme->bFlatMenus = FALSE; + scheme->bFlatMenus = FALSE; } for (i = 0; i < NUM_COLORS; i++) { wsprintf(strValueName, TEXT("Color #%d"), i); dwLength = sizeof(COLORREF); - if (RegQueryValueEx(hkSize, strValueName, NULL, &dwType, (LPBYTE)&theme->crColor[i], &dwLength) != ERROR_SUCCESS || + if (RegQueryValueEx(hkSize, strValueName, NULL, &dwType, (LPBYTE)&scheme->crColor[i], &dwLength) != ERROR_SUCCESS || dwType != REG_DWORD) { /* Failed to read registry value, initialize with current setting for now */ - theme->crColor[i] = GetSysColor(i); + scheme->crColor[i] = GetSysColor(i); } } @@ -179,7 +179,7 @@ BOOL LoadThemeFromReg(THEME* theme, INT ThemeId) { wsprintf(strValueName, TEXT("Font #%d"), i); dwLength = sizeof(LOGFONT); - if (RegQueryValueEx(hkSize, strValueName, NULL, &dwType, (LPBYTE)&theme->lfFont[i], &dwLength) != ERROR_SUCCESS || + if (RegQueryValueEx(hkSize, strValueName, NULL, &dwType, (LPBYTE)&scheme->lfFont[i], &dwLength) != ERROR_SUCCESS || dwType != REG_BINARY || dwLength != sizeof(LOGFONT)) { /* Failed to read registry value */ @@ -191,11 +191,11 @@ BOOL LoadThemeFromReg(THEME* theme, INT ThemeId) { wsprintf(strValueName, TEXT("Size #%d"), i); dwLength = sizeof(UINT64); - if (RegQueryValueEx(hkSize, strValueName, NULL, &dwType, (LPBYTE)&theme->Size[i], &dwLength) != ERROR_SUCCESS || + if (RegQueryValueEx(hkSize, strValueName, NULL, &dwType, (LPBYTE)&scheme->Size[i], &dwLength) != ERROR_SUCCESS || dwType != REG_QWORD || dwLength != sizeof(UINT64)) { /* Failed to read registry value, initialize with current setting for now */ - theme->Size[i] = GetSystemMetrics(g_SizeMetric[i]); + scheme->Size[i] = GetSystemMetrics(g_SizeMetric[i]); } } RegCloseKey(hkScheme); @@ -215,7 +215,7 @@ _UpdateUserPref(UINT SpiGet, UINT SpiSet, BOOL *pbFlag) } #define UPDATE_USERPREF(NAME,pbFlag) _UpdateUserPref(SPI_GET ## NAME, SPI_SET ## NAME, pbFlag) -VOID ApplyTheme(THEME* theme, INT ThemeId) +VOID ApplyScheme(COLOR_SCHEME* scheme, INT SchemeId) { INT i, Result; HKEY hKey; @@ -225,7 +225,7 @@ VOID ApplyTheme(THEME* theme, INT ThemeId) ICONMETRICS IconMetrics; /* Apply Colors from global variable */ - SetSysColors(NUM_COLORS, g_ColorList, theme->crColor); + SetSysColors(NUM_COLORS, g_ColorList, scheme->crColor); /* Save colors to registry */ Result = RegOpenKeyEx(HKEY_CURRENT_USER, g_CPColors, 0, KEY_ALL_ACCESS, &hKey); @@ -239,9 +239,9 @@ VOID ApplyTheme(THEME* theme, INT ThemeId) { for (i = 0; i < NUM_COLORS; i++) { - DWORD red = GetRValue(theme->crColor[i]); - DWORD green = GetGValue(theme->crColor[i]); - DWORD blue = GetBValue(theme->crColor[i]); + DWORD red = GetRValue(scheme->crColor[i]); + DWORD green = GetGValue(scheme->crColor[i]); + DWORD blue = GetBValue(scheme->crColor[i]); wsprintf(clText, TEXT("%d %d %d"), red, green, blue); RegSetValueEx(hKey, g_RegColorNames[i], 0, REG_SZ, (BYTE *)clText, (lstrlen(clText) + 1) * sizeof(TCHAR)); } @@ -251,20 +251,20 @@ VOID ApplyTheme(THEME* theme, INT ThemeId) /* Apply non client metrics */ NonClientMetrics.cbSize = sizeof(NONCLIENTMETRICS); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &NonClientMetrics, 0); - NonClientMetrics.lfCaptionFont = theme->lfFont[FONT_CAPTION]; - NonClientMetrics.lfSmCaptionFont = theme->lfFont[FONT_SMCAPTION]; - NonClientMetrics.lfMenuFont = theme->lfFont[FONT_MENU]; - NonClientMetrics.lfStatusFont = theme->lfFont[FONT_INFO]; - NonClientMetrics.lfMessageFont = theme->lfFont[FONT_DIALOG]; - NonClientMetrics.iBorderWidth = theme->Size[SIZE_BORDER_X]; - NonClientMetrics.iScrollWidth = theme->Size[SIZE_SCROLL_X]; - NonClientMetrics.iScrollHeight = theme->Size[SIZE_SCROLL_Y]; - NonClientMetrics.iCaptionWidth = theme->Size[SIZE_CAPTION_Y]; - NonClientMetrics.iCaptionHeight = theme->Size[SIZE_CAPTION_Y]; - NonClientMetrics.iSmCaptionWidth = theme->Size[SIZE_SMCAPTION_Y]; - NonClientMetrics.iSmCaptionHeight = theme->Size[SIZE_SMCAPTION_Y]; - NonClientMetrics.iMenuWidth = theme->Size[SIZE_MENU_SIZE_X]; - NonClientMetrics.iMenuHeight = theme->Size[SIZE_MENU_Y]; + NonClientMetrics.lfCaptionFont = scheme->lfFont[FONT_CAPTION]; + NonClientMetrics.lfSmCaptionFont = scheme->lfFont[FONT_SMCAPTION]; + NonClientMetrics.lfMenuFont = scheme->lfFont[FONT_MENU]; + NonClientMetrics.lfStatusFont = scheme->lfFont[FONT_INFO]; + NonClientMetrics.lfMessageFont = scheme->lfFont[FONT_DIALOG]; + NonClientMetrics.iBorderWidth = scheme->Size[SIZE_BORDER_X]; + NonClientMetrics.iScrollWidth = scheme->Size[SIZE_SCROLL_X]; + NonClientMetrics.iScrollHeight = scheme->Size[SIZE_SCROLL_Y]; + NonClientMetrics.iCaptionWidth = scheme->Size[SIZE_CAPTION_Y]; + NonClientMetrics.iCaptionHeight = scheme->Size[SIZE_CAPTION_Y]; + NonClientMetrics.iSmCaptionWidth = scheme->Size[SIZE_SMCAPTION_Y]; + NonClientMetrics.iSmCaptionHeight = scheme->Size[SIZE_SMCAPTION_Y]; + NonClientMetrics.iMenuWidth = scheme->Size[SIZE_MENU_SIZE_X]; + NonClientMetrics.iMenuHeight = scheme->Size[SIZE_MENU_Y]; SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &NonClientMetrics, @@ -273,9 +273,9 @@ VOID ApplyTheme(THEME* theme, INT ThemeId) /* Apply icon metrics */ IconMetrics.cbSize = sizeof(ICONMETRICS); SystemParametersInfo(SPI_GETICONMETRICS, sizeof(ICONMETRICS), &IconMetrics, 0); - IconMetrics.iHorzSpacing = theme->Size[SIZE_ICON_SPC_X]; - IconMetrics.iVertSpacing = theme->Size[SIZE_ICON_SPC_Y]; - IconMetrics.lfFont = theme->lfFont[FONT_ICON]; + IconMetrics.iHorzSpacing = scheme->Size[SIZE_ICON_SPC_X]; + IconMetrics.iVertSpacing = scheme->Size[SIZE_ICON_SPC_Y]; + IconMetrics.lfFont = scheme->lfFont[FONT_ICON]; SystemParametersInfo(SPI_SETICONMETRICS, sizeof(ICONMETRICS), &IconMetrics, @@ -285,44 +285,44 @@ VOID ApplyTheme(THEME* theme, INT ThemeId) /* FIXME: XP seems to use grayed checkboxes to reflect differences between menu and tooltips settings * Just keep them in sync for now. */ - theme->Effects.bTooltipAnimation = theme->Effects.bMenuAnimation; - theme->Effects.bTooltipFade = theme->Effects.bMenuFade; - SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, theme->Effects.bDragFullWindows, (PVOID)&theme->Effects.bDragFullWindows, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); - SystemParametersInfo(SPI_SETKEYBOARDCUES, 0, IntToPtr(theme->Effects.bKeyboardCues), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); - //UPDATE_USERPREF(ACTIVEWINDOWTRACKING, &theme->Effects.bActiveWindowTracking); - //UPDATE_USERPREF(MENUANIMATION, &theme->Effects.bMenuAnimation); - //UPDATE_USERPREF(COMBOBOXANIMATION, &theme->Effects.bComboBoxAnimation); - //UPDATE_USERPREF(LISTBOXSMOOTHSCROLLING, &theme->Effects.bListBoxSmoothScrolling); - //UPDATE_USERPREF(GRADIENTCAPTIONS, &theme->Effects.bGradientCaptions); - //UPDATE_USERPREF(ACTIVEWNDTRKZORDER, &theme->Effects.bActiveWndTrkZorder); - //UPDATE_USERPREF(HOTTRACKING, &theme->Effects.bHotTracking); - UPDATE_USERPREF(MENUFADE, &theme->Effects.bMenuFade); - //UPDATE_USERPREF(SELECTIONFADE, &theme->Effects.bSelectionFade); - UPDATE_USERPREF(TOOLTIPANIMATION, &theme->Effects.bTooltipAnimation); - UPDATE_USERPREF(TOOLTIPFADE, &theme->Effects.bTooltipFade); - //UPDATE_USERPREF(CURSORSHADOW, &theme->Effects.bCursorShadow); - //UPDATE_USERPREF(UIEFFECTS, &theme->Effects.bUiEffects); + scheme->Effects.bTooltipAnimation = scheme->Effects.bMenuAnimation; + scheme->Effects.bTooltipFade = scheme->Effects.bMenuFade; + SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, scheme->Effects.bDragFullWindows, (PVOID)&scheme->Effects.bDragFullWindows, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); + SystemParametersInfo(SPI_SETKEYBOARDCUES, 0, IntToPtr(scheme->Effects.bKeyboardCues), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); + //UPDATE_USERPREF(ACTIVEWINDOWTRACKING, &scheme->Effects.bActiveWindowTracking); + //UPDATE_USERPREF(MENUANIMATION, &scheme->Effects.bMenuAnimation); + //UPDATE_USERPREF(COMBOBOXANIMATION, &scheme->Effects.bComboBoxAnimation); + //UPDATE_USERPREF(LISTBOXSMOOTHSCROLLING, &scheme->Effects.bListBoxSmoothScrolling); + //UPDATE_USERPREF(GRADIENTCAPTIONS, &scheme->Effects.bGradientCaptions); + //UPDATE_USERPREF(ACTIVEWNDTRKZORDER, &scheme->Effects.bActiveWndTrkZorder); + //UPDATE_USERPREF(HOTTRACKING, &scheme->Effects.bHotTracking); + UPDATE_USERPREF(MENUFADE, &scheme->Effects.bMenuFade); + //UPDATE_USERPREF(SELECTIONFADE, &scheme->Effects.bSelectionFade); + UPDATE_USERPREF(TOOLTIPANIMATION, &scheme->Effects.bTooltipAnimation); + UPDATE_USERPREF(TOOLTIPFADE, &scheme->Effects.bTooltipFade); + //UPDATE_USERPREF(CURSORSHADOW, &scheme->Effects.bCursorShadow); + //UPDATE_USERPREF(UIEFFECTS, &scheme->Effects.bUiEffects); - /* Save ThemeId */ + /* Save SchemeId */ Result = RegOpenKeyEx(HKEY_CURRENT_USER, g_CPANewSchemes, 0, KEY_ALL_ACCESS, &hKey); if (Result == ERROR_SUCCESS) { - if (ThemeId == -1) + if (SchemeId == -1) clText[0] = TEXT('\0'); else - lstrcpy(clText, g_ThemeTemplates[ThemeId].strKeyName); + lstrcpy(clText, g_ColorSchemes[SchemeId].strKeyName); RegSetValueEx(hKey, g_SelectedStyle, 0, REG_SZ, (BYTE *)clText, (lstrlen(clText) + 1) * sizeof(TCHAR)); RegCloseKey(hKey); } } -BOOL SaveTheme(THEME* theme, LPCTSTR strLegacyName) +BOOL SaveScheme(COLOR_SCHEME* scheme, LPCTSTR strLegacyName) { /* FIXME: implement */ return FALSE; } -INT LoadThemePresetEntries(LPTSTR pszSelectedStyle) +INT LoadSchemePresetEntries(LPTSTR pszSelectedStyle) { HKEY hkNewSchemes, hkScheme, hkSizes, hkSize; FILETIME ftLastWriteTime; @@ -350,27 +350,27 @@ INT LoadThemePresetEntries(LPTSTR pszSelectedStyle) iStyle = 0; dwLength = MAX_TEMPLATENAMELENTGH; - while((RegEnumKeyEx(hkNewSchemes, iStyle, g_ThemeTemplates[iTemplateIndex].strKeyName, &dwLength, + while((RegEnumKeyEx(hkNewSchemes, iStyle, g_ColorSchemes[iTemplateIndex].strKeyName, &dwLength, NULL, NULL, NULL, &ftLastWriteTime) == ERROR_SUCCESS) && (iTemplateIndex < MAX_TEMPLATES)) { /* is it really a template or one of the other entries */ if (dwLength <= 4) { - if (RegOpenKeyEx(hkNewSchemes, g_ThemeTemplates[iTemplateIndex].strKeyName, 0, KEY_READ, &hkScheme) == ERROR_SUCCESS) + if (RegOpenKeyEx(hkNewSchemes, g_ColorSchemes[iTemplateIndex].strKeyName, 0, KEY_READ, &hkScheme) == ERROR_SUCCESS) { if (RegOpenKeyEx(hkScheme, TEXT("Sizes"), 0, KEY_READ, &hkSizes) == ERROR_SUCCESS) { iSize = 0; dwLength = 3; - while((RegEnumKeyEx(hkSizes, iSize, g_ThemeTemplates[iTemplateIndex].strSizeName, &dwLength, + while((RegEnumKeyEx(hkSizes, iSize, g_ColorSchemes[iTemplateIndex].strSizeName, &dwLength, NULL, NULL, NULL, &ftLastWriteTime) == ERROR_SUCCESS) && (iSize <= 4)) { - if(RegOpenKeyEx(hkSizes, g_ThemeTemplates[iTemplateIndex].strSizeName, 0, KEY_READ, &hkSize) == ERROR_SUCCESS) + if(RegOpenKeyEx(hkSizes, g_ColorSchemes[iTemplateIndex].strSizeName, 0, KEY_READ, &hkSize) == ERROR_SUCCESS) { dwLength = MAX_TEMPLATENAMELENTGH; - RegQueryValueEx(hkSize, TEXT("DisplayName"), NULL, &dwType, (LPBYTE)&g_ThemeTemplates[iTemplateIndex].strDisplayName, &dwLength); + RegQueryValueEx(hkSize, TEXT("DisplayName"), NULL, &dwType, (LPBYTE)&g_ColorSchemes[iTemplateIndex].strDisplayName, &dwLength); dwLength = MAX_TEMPLATENAMELENTGH; - RegQueryValueEx(hkSize, TEXT("LegacyName"), NULL, &dwType, (LPBYTE)&g_ThemeTemplates[iTemplateIndex].strLegacyName, &dwLength); + RegQueryValueEx(hkSize, TEXT("LegacyName"), NULL, &dwType, (LPBYTE)&g_ColorSchemes[iTemplateIndex].strLegacyName, &dwLength); RegCloseKey(hkSize); } iSize++; diff --git a/dll/cpl/desk/theme.h b/dll/cpl/desk/theme.h index 7c72c98193a..98cfeee48fe 100644 --- a/dll/cpl/desk/theme.h +++ b/dll/cpl/desk/theme.h @@ -67,7 +67,7 @@ typedef struct INT Size[NUM_SIZES]; BOOL bFlatMenus; EFFECTS Effects; -} THEME; +} COLOR_SCHEME; typedef struct { @@ -75,15 +75,15 @@ typedef struct TCHAR strSizeName[4]; TCHAR strDisplayName[MAX_TEMPLATENAMELENTGH]; TCHAR strLegacyName[MAX_TEMPLATENAMELENTGH]; -} THEME_PRESET; +} SCHEME_PRESET; extern const TCHAR g_RegColorNames[NUM_COLORS][MAX_COLORNAMELENGTH]; extern const INT g_SizeMetric[NUM_SIZES]; -extern THEME_PRESET g_ThemeTemplates[MAX_TEMPLATES]; +extern SCHEME_PRESET g_ColorSchemes[MAX_TEMPLATES]; /* prototypes for theme.c */ -VOID LoadCurrentTheme(THEME* theme); -BOOL LoadThemeFromReg(THEME* theme, INT ThemeId); -VOID ApplyTheme(THEME* theme, INT ThemeId); -BOOL SaveTheme(THEME* theme, LPCTSTR strLegacyName); -INT LoadThemePresetEntries(LPTSTR pszSelectedStyle); +VOID LoadCurrentScheme(COLOR_SCHEME* scheme); +BOOL LoadSchemeFromReg(COLOR_SCHEME* scheme, INT SchemeId); +VOID ApplyScheme(COLOR_SCHEME* scheme, INT SchemeId); +BOOL SaveScheme(COLOR_SCHEME* scheme, LPCTSTR strLegacyName); +INT LoadSchemePresetEntries(LPTSTR pszSelectedStyle);