Author: rharabien
Date: Tue Jul 26 11:12:56 2011
New Revision: 52893
URL:
http://svn.reactos.org/svn/reactos?rev=52893&view=rev
Log:
[DESK]
- Remove forgotten debug print
- Simplify a bit
Modified:
trunk/reactos/dll/cpl/desk/theme.c
trunk/reactos/dll/cpl/desk/theme.h
Modified: trunk/reactos/dll/cpl/desk/theme.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/theme.c?rev=5…
==============================================================================
--- trunk/reactos/dll/cpl/desk/theme.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/theme.c [iso-8859-1] Tue Jul 26 11:12:56 2011
@@ -24,7 +24,7 @@
THEME_PRESET g_ThemeTemplates[MAX_TEMPLATES];
/* This is the list of names for the colors stored in the registry */
-const TCHAR g_RegColorNames[NUM_COLORS][MAX_COLORNAMELENGTH] =
+static const TCHAR *g_RegColorNames[NUM_COLORS] =
{TEXT("Scrollbar"), /* 00 = COLOR_SCROLLBAR */
TEXT("Background"), /* 01 = COLOR_DESKTOP */
TEXT("ActiveTitle"), /* 02 = COLOR_ACTIVECAPTION */
@@ -59,7 +59,7 @@
};
/* This is the list of used metrics and their numbers */
-const int g_SizeMetric[NUM_SIZES] =
+static const int g_SizeMetric[NUM_SIZES] =
{
SM_CXBORDER, /* 00: SIZE_BORDER_X */
SM_CYBORDER, /* 01: SIZE_BORDER_Y */
@@ -134,7 +134,7 @@
{
INT i;
TCHAR strSelectedStyle[4];
- TCHAR strSizeName[20] = {TEXT("Sizes\\0")};
+ TCHAR strSizeName[20] = TEXT("Sizes\\0");
TCHAR strValueName[10];
HKEY hkNewSchemes, hkScheme, hkSize;
DWORD dwType, dwLength;
@@ -196,7 +196,7 @@
dwType != REG_QWORD || dwLength != sizeof(UINT64))
{
/* Failed to read registry value, initialize with current setting for now */
- theme->Size[i] = GetSystemMetrics(g_SizeMetric[i]); if(i == SIZE_CAPTION_Y)
OutputDebugStringA("GetSystemMetrics!\n");
+ theme->Size[i] = GetSystemMetrics(g_SizeMetric[i]);
}
else
theme->Size[i] = (INT)iSize;
@@ -211,18 +211,10 @@
return Ret;
}
-static VOID
-_UpdateUserPref(UINT SpiGet, UINT SpiSet, BOOL *pbFlag)
-{
- SystemParametersInfo(SpiSet, 0, (PVOID)pbFlag, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE);
-}
-#define UPDATE_USERPREF(NAME,pbFlag) _UpdateUserPref(SPI_GET ## NAME, SPI_SET ## NAME,
pbFlag)
-
VOID ApplyTheme(THEME* theme, INT ThemeId)
{
INT i, Result;
HKEY hKey;
- DWORD dwDisposition;
TCHAR clText[16];
NONCLIENTMETRICS NonClientMetrics;
ICONMETRICS IconMetrics;
@@ -231,13 +223,7 @@
SetSysColors(NUM_COLORS, g_ColorList, theme->crColor);
/* Save colors to registry */
- Result = RegOpenKeyEx(HKEY_CURRENT_USER, g_CPColors, 0, KEY_ALL_ACCESS, &hKey);
- if (Result != ERROR_SUCCESS)
- {
- /* Could not open the key, try to create it */
- Result = RegCreateKeyEx(HKEY_CURRENT_USER, g_CPColors, 0, NULL, 0, KEY_ALL_ACCESS,
NULL, &hKey, &dwDisposition);
- }
-
+ Result = RegCreateKeyEx(HKEY_CURRENT_USER, g_CPColors, 0, NULL, 0, KEY_ALL_ACCESS, NULL,
&hKey, NULL);
if (Result == ERROR_SUCCESS)
{
for (i = 0; i < NUM_COLORS; i++)
@@ -292,19 +278,19 @@
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);
+ //SystemParametersInfo(SPI_SETACTIVEWINDOWTRACKING, 0,
(PVOID)&theme->Effects.bActiveWindowTracking, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE);
+ //SystemParametersInfo(SPI_SETMENUANIMATION, 0,
(PVOID)&theme->Effects.bMenuAnimation, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE);
+ //SystemParametersInfo(SPI_SETCOMBOBOXANIMATION, 0,
(PVOID)&theme->Effects.bComboBoxAnimation, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE);
+ //SystemParametersInfo(SPI_SETLISTBOXSMOOTHSCROLLING, 0,
(PVOID)&theme->Effects.bListBoxSmoothScrolling,
SPIF_UPDATEINIFILE|SPIF_SENDCHANGE);
+ //SystemParametersInfo(SPI_SETGRADIENTCAPTIONS, 0,
(PVOID)&theme->Effects.bGradientCaptions, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE);
+ //SystemParametersInfo(SPI_SETACTIVEWNDTRKZORDER, 0,
(PVOID)&theme->Effects.bActiveWndTrkZorder, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE);
+ //SystemParametersInfo(SPI_SETHOTTRACKING, 0,
(PVOID)&theme->Effects.bHotTracking, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE);
+ SystemParametersInfo(SPI_SETMENUFADE, 0, (PVOID)&theme->Effects.bMenuFade,
SPIF_UPDATEINIFILE|SPIF_SENDCHANGE);
+ //SystemParametersInfo(SPI_SETSELECTIONFADE, 0,
(PVOID)&theme->Effects.bSelectionFade, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE);
+ SystemParametersInfo(SPI_SETTOOLTIPANIMATION, 0,
(PVOID)&theme->Effects.bTooltipAnimation, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE);
+ SystemParametersInfo(SPI_SETTOOLTIPFADE, 0, (PVOID)&theme->Effects.bTooltipFade,
SPIF_UPDATEINIFILE|SPIF_SENDCHANGE);
+ //SystemParametersInfo(SPI_SETCURSORSHADOW, 0,
(PVOID)&theme->Effects.bCursorShadow, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE);
+ //SystemParametersInfo(SPI_SETUIEFFECTS, 0, (PVOID)&theme->Effects.bUiEffects,
SPIF_UPDATEINIFILE|SPIF_SENDCHANGE);
/* Save ThemeId */
Result = RegOpenKeyEx(HKEY_CURRENT_USER, g_CPANewSchemes, 0, KEY_ALL_ACCESS,
&hKey);
Modified: trunk/reactos/dll/cpl/desk/theme.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/theme.h?rev=5…
==============================================================================
--- trunk/reactos/dll/cpl/desk/theme.h [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/theme.h [iso-8859-1] Tue Jul 26 11:12:56 2011
@@ -77,8 +77,6 @@
TCHAR strLegacyName[MAX_TEMPLATENAMELENTGH];
} THEME_PRESET;
-extern const TCHAR g_RegColorNames[NUM_COLORS][MAX_COLORNAMELENGTH];
-extern const INT g_SizeMetric[NUM_SIZES];
extern THEME_PRESET g_ThemeTemplates[MAX_TEMPLATES];
/* prototypes for theme.c */