ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2011
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
20 participants
399 discussions
Start a n
N
ew thread
[tkreuzer] 53760: [NTDLL] Fix CsrProbeForRead and CsrProbeForWrite to actually access the memory, by using volatile. The compiler optimized the access away previously.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Sep 19 16:24:18 2011 New Revision: 53760 URL:
http://svn.reactos.org/svn/reactos?rev=53760&view=rev
Log: [NTDLL] Fix CsrProbeForRead and CsrProbeForWrite to actually access the memory, by using volatile. The compiler optimized the access away previously. Modified: trunk/reactos/dll/ntdll/csr/capture.c Modified: trunk/reactos/dll/ntdll/csr/capture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/csr/capture.c?re…
============================================================================== --- trunk/reactos/dll/ntdll/csr/capture.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/csr/capture.c [iso-8859-1] Mon Sep 19 16:24:18 2011 @@ -26,7 +26,7 @@ IN ULONG Length, IN ULONG Alignment) { - PUCHAR Pointer; + volatile UCHAR *Pointer; UCHAR Data; /* Validate length */ @@ -39,10 +39,12 @@ RtlRaiseStatus(STATUS_DATATYPE_MISALIGNMENT); } - /* Do the probe */ - Pointer = (PUCHAR)Address; + /* Probe first byte */ + Pointer = Address; Data = *Pointer; - Pointer = (PUCHAR)((ULONG)Address + Length -1); + + /* Probe last byte */ + Pointer = (PUCHAR)Address + Length - 1; Data = *Pointer; (void)Data; } @@ -56,8 +58,7 @@ IN ULONG Length, IN ULONG Alignment) { - PUCHAR Pointer; - UCHAR Data; + volatile UCHAR *Pointer; /* Validate length */ if (Length == 0) return; @@ -69,13 +70,13 @@ RtlRaiseStatus(STATUS_DATATYPE_MISALIGNMENT); } - /* Do the probe */ - Pointer = (PUCHAR)Address; - Data = *Pointer; - *Pointer = Data; - Pointer = (PUCHAR)((ULONG)Address + Length -1); - Data = *Pointer; - *Pointer = Data; + /* Probe first byte */ + Pointer = Address; + *Pointer = *Pointer; + + /* Probe last byte */ + Pointer = (PUCHAR)Address + Length - 1; + *Pointer = *Pointer; } /* @@ -217,7 +218,7 @@ if (!String) { CapturedString->Length = 0; - CapturedString->MaximumLength = MaximumLength; + CapturedString->MaximumLength = (USHORT)MaximumLength; /* Allocate a pointer for it */ CsrAllocateMessagePointer(CaptureBuffer, @@ -227,13 +228,13 @@ } /* Initialize this string */ - CapturedString->Length = StringLength; - + CapturedString->Length = (USHORT)StringLength; + /* Allocate a buffer and get its size */ ReturnedLength = CsrAllocateMessagePointer(CaptureBuffer, MaximumLength, (PVOID*)&CapturedString->Buffer); - CapturedString->MaximumLength = ReturnedLength; + CapturedString->MaximumLength = (USHORT)ReturnedLength; /* If the string had data */ if (StringLength)
13 years, 3 months
1
0
0
0
[dgorbachev] 53759: Fix more unused-but-set warnings.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Mon Sep 19 14:41:04 2011 New Revision: 53759 URL:
http://svn.reactos.org/svn/reactos?rev=53759&view=rev
Log: Fix more unused-but-set warnings. Modified: trunk/reactos/base/applications/mstsc/connectdialog.c trunk/reactos/base/applications/mstsc/orders.c trunk/reactos/base/setup/vmwinst/vmwinst.c trunk/reactos/dll/ntdll/csr/capture.c trunk/reactos/dll/win32/browseui/CMakeLists.txt trunk/reactos/dll/win32/shell32/CMakeLists.txt trunk/reactos/dll/win32/wdmaud.drv/mmixer.c trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_dmus.cpp trunk/reactos/include/reactos/libs/sound/mmebuddy.h trunk/reactos/lib/pseh/framebased.c Modified: trunk/reactos/base/applications/mstsc/connectdialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/co…
============================================================================== --- trunk/reactos/base/applications/mstsc/connectdialog.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mstsc/connectdialog.c [iso-8859-1] Mon Sep 19 14:41:04 2011 @@ -1089,9 +1089,9 @@ case WM_NOTIFY: { - INT idctrl; + //INT idctrl; LPNMHDR pnmh; - idctrl = (int)wParam; + //idctrl = (int)wParam; pnmh = (LPNMHDR)lParam; if (//(pnmh->hwndFrom == pInfo->hSelf) && (pnmh->idFrom == IDC_TAB) && Modified: trunk/reactos/base/applications/mstsc/orders.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/or…
============================================================================== --- trunk/reactos/base/applications/mstsc/orders.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mstsc/orders.c [iso-8859-1] Mon Sep 19 14:41:04 2011 @@ -943,6 +943,7 @@ in_uint8p(s, data, size); DEBUG(("BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d,bpp=%d,size=%d,pad1=%d,bufsize=%d,pad2=%d,rs=%d,fs=%d)\n", width, height, cache_id, cache_idx, bpp, size, pad1, bufsize, pad2, row_size, final_size)); + (void)pad1; (void)pad2; bmpdata = (uint8 *) xmalloc(width * height * Bpp); Modified: trunk/reactos/base/setup/vmwinst/vmwinst.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/vmwinst/vmwinst…
============================================================================== --- trunk/reactos/base/setup/vmwinst/vmwinst.c [iso-8859-1] (original) +++ trunk/reactos/base/setup/vmwinst/vmwinst.c [iso-8859-1] Mon Sep 19 14:41:04 2011 @@ -169,14 +169,16 @@ static BOOL IsVMwareCDInDrive(WCHAR *Drv) { +#if CHECKDRIVETYPE static WCHAR Drive[4] = L"X:\\"; +#endif WCHAR Current; *Drv = L'\0'; for(Current = 'C'; Current <= 'Z'; Current++) { +#if CHECKDRIVETYPE Drive[0] = Current; -#if CHECKDRIVETYPE if(GetDriveType(Drive) == DRIVE_CDROM) { #endif Modified: trunk/reactos/dll/ntdll/csr/capture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/csr/capture.c?re…
============================================================================== --- trunk/reactos/dll/ntdll/csr/capture.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/csr/capture.c [iso-8859-1] Mon Sep 19 14:41:04 2011 @@ -44,6 +44,7 @@ Data = *Pointer; Pointer = (PUCHAR)((ULONG)Address + Length -1); Data = *Pointer; + (void)Data; } /* Modified: trunk/reactos/dll/win32/browseui/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/CMakeLi…
============================================================================== --- trunk/reactos/dll/win32/browseui/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/CMakeLists.txt [iso-8859-1] Mon Sep 19 14:41:04 2011 @@ -45,6 +45,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/browseui.def) add_library(browseui SHARED ${SOURCE}) +allow_warnings(browseui) set_module_type(browseui win32dll UNICODE) target_link_libraries(browseui Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] Mon Sep 19 14:41:04 2011 @@ -74,7 +74,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/shell32.def) add_library(shell32 SHARED ${SOURCE}) - +allow_warnings(shell32) set_module_type(shell32 win32dll UNICODE) target_link_libraries(shell32 Modified: trunk/reactos/dll/win32/wdmaud.drv/mmixer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/mmixe…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/mmixer.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wdmaud.drv/mmixer.c [iso-8859-1] Mon Sep 19 14:41:04 2011 @@ -783,10 +783,10 @@ LPVOID lpParameter) { DWORD Length; - MMRESULT Result; + //MMRESULT Result; LPIO_PACKET Packet = (LPIO_PACKET)lpParameter; - Result = SyncOverlappedDeviceIoControl(Packet->hDevice, + /*Result = */ SyncOverlappedDeviceIoControl(Packet->hDevice, Packet->IoCtl, NULL, 0, Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_dmus.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_dmus.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_dmus.cpp [iso-8859-1] Mon Sep 19 14:41:04 2011 @@ -878,13 +878,13 @@ ASSERT(context->BytesRead); PUCHAR pChar = PUCHAR(context->BufferAddress); - NTSTATUS ntStatus,readStatus; + NTSTATUS ntStatus; // , readStatus ntStatus = STATUS_SUCCESS; // // while we're not there yet, and // while we don't have to wait on an aligned byte (including 0) // (we never wait on a byte. Better to come back later) - readStatus = DMusMPUInterruptServiceRoutine(InterruptSync,PVOID(context->Miniport)); + /*readStatus = */ DMusMPUInterruptServiceRoutine(InterruptSync,PVOID(context->Miniport)); while ( (*(context->BytesRead) < context->Length) && ( TryMPU(context->PortBase) || (*(context->BytesRead)%3) @@ -903,7 +903,7 @@ break; } } - readStatus = DMusMPUInterruptServiceRoutine(InterruptSync,PVOID(context->Miniport)); + /*readStatus = */ DMusMPUInterruptServiceRoutine(InterruptSync,PVOID(context->Miniport)); return ntStatus; } Modified: trunk/reactos/include/reactos/libs/sound/mmebuddy.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/sound…
============================================================================== --- trunk/reactos/include/reactos/libs/sound/mmebuddy.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/libs/sound/mmebuddy.h [iso-8859-1] Mon Sep 19 14:41:04 2011 @@ -79,7 +79,7 @@ #define SND_ERR(...) do {} while ( 0 ) #define SND_WARN(...) do {} while ( 0 ) #define SND_TRACE(...) do {} while ( 0 ) - #define SND_ASSERT(condition) do {} while ( 0 ) + #define SND_ASSERT(condition) do {(void)(condition);} while ( 0 ) #define DUMP_WAVEHDR_QUEUE(condition) do {} while ( 0 ) #endif Modified: trunk/reactos/lib/pseh/framebased.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/pseh/framebased.c?rev=…
============================================================================== --- trunk/reactos/lib/pseh/framebased.c [iso-8859-1] (original) +++ trunk/reactos/lib/pseh/framebased.c [iso-8859-1] Mon Sep 19 14:41:04 2011 @@ -470,6 +470,23 @@ void _SEH_FASTCALL _SEHLeaveFrame_f(void) { + /* _SEHPortableFrame_t * frame; + + frame = _SEH_CONTAINING_RECORD + ( + _SEHCurrentRegistration(), + _SEHPortableFrame_t, + SPF_Registration + ); */ + + /* ASSERT(frame); */ + /* ASSERT(frame->SPF_TopTryLevel == NULL) */ + + _SEHUnregisterFrame(); +} + +void _SEH_FASTCALL _SEHReturn_f(void) +{ _SEHPortableFrame_t * frame; frame = _SEH_CONTAINING_RECORD @@ -479,23 +496,6 @@ SPF_Registration ); - /* ASSERT(frame); */ - /* ASSERT(frame->SPF_TopTryLevel == NULL) */ - - _SEHUnregisterFrame(); -} - -void _SEH_FASTCALL _SEHReturn_f(void) -{ - _SEHPortableFrame_t * frame; - - frame = _SEH_CONTAINING_RECORD - ( - _SEHCurrentRegistration(), - _SEHPortableFrame_t, - SPF_Registration - ); - _SEHLocalUnwind(frame, NULL); _SEHUnregisterFrame(); }
13 years, 3 months
1
0
0
0
[gadamopoulos] 53758: add the themes service to boot cd
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Mon Sep 19 14:05:44 2011 New Revision: 53758 URL:
http://svn.reactos.org/svn/reactos?rev=53758&view=rev
Log: add the themes service to boot cd Modified: trunk/reactos/boot/bootdata/hivesys_i386.inf trunk/reactos/boot/bootdata/packages/reactos.dff Modified: trunk/reactos/boot/bootdata/hivesys_i386.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys_i386…
============================================================================== --- trunk/reactos/boot/bootdata/hivesys_i386.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivesys_i386.inf [iso-8859-1] Mon Sep 19 14:05:44 2011 @@ -1097,6 +1097,7 @@ "TDI", \ "PlugPlay", \ "SpoolerGroup", \ + "UIGroup", \ "Extended Base" ; Set the timeout for directx/ReactX graphic surface lock see _EDD_DIRECTDRAW_GLOBAL struct for more info @@ -1661,6 +1662,16 @@ HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","Start",0x00010001,0x00000003 HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","Type",0x00010001,0x00000020 +; Themes service +HKLM,"SYSTEM\CurrentControlSet\Services\Themes","DisplayName",0x00000000,"Themes" +HKLM,"SYSTEM\CurrentControlSet\Services\Themes","Description",0x00000000,"Themes support" +HKLM,"SYSTEM\CurrentControlSet\Services\Themes","ErrorControl",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Themes","Group",0x00000000,"UIGroup" +HKLM,"SYSTEM\CurrentControlSet\Services\Themes","ImagePath",0x00020000,"%SystemRoot%\system32\thmsvc.exe" +HKLM,"SYSTEM\CurrentControlSet\Services\Themes","ObjectName",0x00000000,"LocalSystem" +HKLM,"SYSTEM\CurrentControlSet\Services\Themes","Start",0x00010001,0x00000003 +HKLM,"SYSTEM\CurrentControlSet\Services\Themes","Type",0x00010001,0x00000020 + ; Sound Blaster (NT4) ;HKLM,"SYSTEM\CurrentControlSet\Services\sndblst","Description",0x00000000,"Sound Blaster (NT4)" ;HKLM,"SYSTEM\CurrentControlSet\Services\sndblst","ErrorControl",0x00010001,0x00000001 Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] Mon Sep 19 14:05:44 2011 @@ -101,6 +101,7 @@ base\services\tcpsvcs\tcpsvcs.exe 1 base\services\tcpsvcs\quotes 5 base\services\telnetd\telnetd.exe 1 +base\services\thmsvc\thmsvc.exe 1 base\services\umpnpmgr\umpnpmgr.exe 1 base\services\wlansvc\wlansvc.exe 1
13 years, 3 months
1
0
0
0
[gadamopoulos] 53757: [thmsvc] - Attempt to fix cmake build
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Mon Sep 19 13:45:22 2011 New Revision: 53757 URL:
http://svn.reactos.org/svn/reactos?rev=53757&view=rev
Log: [thmsvc] - Attempt to fix cmake build Modified: trunk/reactos/base/services/thmsvc/CMakeLists.txt Modified: trunk/reactos/base/services/thmsvc/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/thmsvc/CMake…
============================================================================== --- trunk/reactos/base/services/thmsvc/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/base/services/thmsvc/CMakeLists.txt [iso-8859-1] Mon Sep 19 13:45:22 2011 @@ -1,10 +1,8 @@ - -set_unicode() add_executable(thmsvc thmsvc.c thmsvc.rc) target_link_libraries(thmsvc wine) -set_module_type(thmsvc win32cui) +set_module_type(thmsvc win32cui UNICODE) add_importlibs(thmsvc uxtheme advapi32 msvcrt kernel32 ntdll) add_cd_file(TARGET thmsvc DESTINATION reactos/system32 FOR all)
13 years, 3 months
1
0
0
0
[gadamopoulos] 53756: [desk.cpl] - try to fix cmake build
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Mon Sep 19 13:39:05 2011 New Revision: 53756 URL:
http://svn.reactos.org/svn/reactos?rev=53756&view=rev
Log: [desk.cpl] - try to fix cmake build Modified: trunk/reactos/dll/cpl/desk/CMakeLists.txt Modified: trunk/reactos/dll/cpl/desk/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/CMakeLists.tx…
============================================================================== --- trunk/reactos/dll/cpl/desk/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/CMakeLists.txt [iso-8859-1] Mon Sep 19 13:39:05 2011 @@ -40,6 +40,7 @@ ole32 setupapi shell32 + uxtheme kernel32 ntdll)
13 years, 3 months
1
0
0
0
[gadamopoulos] 53755: [thmsvc] - Add the themes service from the themes branch
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Mon Sep 19 13:31:39 2011 New Revision: 53755 URL:
http://svn.reactos.org/svn/reactos?rev=53755&view=rev
Log: [thmsvc] - Add the themes service from the themes branch Added: trunk/reactos/base/services/thmsvc/ (with props) trunk/reactos/base/services/thmsvc/CMakeLists.txt (with props) trunk/reactos/base/services/thmsvc/thmsvc.c (with props) trunk/reactos/base/services/thmsvc/thmsvc.rbuild (with props) trunk/reactos/base/services/thmsvc/thmsvc.rc (with props) Modified: trunk/reactos/base/services/CMakeLists.txt trunk/reactos/base/services/services.rbuild Modified: trunk/reactos/base/services/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/CMakeLists.t…
============================================================================== --- trunk/reactos/base/services/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/base/services/CMakeLists.txt [iso-8859-1] Mon Sep 19 13:31:39 2011 @@ -7,5 +7,6 @@ add_subdirectory(tcpsvcs) add_subdirectory(telnetd) #add_subdirectory(tftpd) +add_subdirectory(thmsvc) add_subdirectory(umpnpmgr) add_subdirectory(wlansvc) Modified: trunk/reactos/base/services/services.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/services.rbu…
============================================================================== --- trunk/reactos/base/services/services.rbuild [iso-8859-1] (original) +++ trunk/reactos/base/services/services.rbuild [iso-8859-1] Mon Sep 19 13:31:39 2011 @@ -25,6 +25,9 @@ <directory name="tftpd"> <xi:include href="tftpd/tftpd.rbuild" /> </directory> + <directory name="thmsvc"> + <xi:include href="thmsvc/thmsvc.rbuild" /> + </directory> <directory name="umpnpmgr"> <xi:include href="umpnpmgr/umpnpmgr.rbuild" /> </directory> Propchange: trunk/reactos/base/services/thmsvc/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Mon Sep 19 13:31:39 2011 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/base/services/thmsvc/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/base/services/thmsvc/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/base/services/thmsvc/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Propchange: trunk/reactos/base/services/thmsvc/ ------------------------------------------------------------------------------ --- tsvn:logrevregex (added) +++ tsvn:logrevregex Mon Sep 19 13:31:39 2011 @@ -1,0 +1,1 @@ +\b(r\d+)|\b(revisions?(\(s\))?\s#?\d+([, ]+(and\s?)?\d+)*)|\b(revs?\.?\s?\d+([, ]+(and\s?)?\d+)*) Added: trunk/reactos/base/services/thmsvc/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/thmsvc/CMake…
============================================================================== --- trunk/reactos/base/services/thmsvc/CMakeLists.txt (added) +++ trunk/reactos/base/services/thmsvc/CMakeLists.txt [iso-8859-1] Mon Sep 19 13:31:39 2011 @@ -1,0 +1,10 @@ + +set_unicode() + +add_executable(thmsvc thmsvc.c thmsvc.rc) + +target_link_libraries(thmsvc wine) + +set_module_type(thmsvc win32cui) +add_importlibs(thmsvc uxtheme advapi32 msvcrt kernel32 ntdll) +add_cd_file(TARGET thmsvc DESTINATION reactos/system32 FOR all) Propchange: trunk/reactos/base/services/thmsvc/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/base/services/thmsvc/thmsvc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/thmsvc/thmsv…
============================================================================== --- trunk/reactos/base/services/thmsvc/thmsvc.c (added) +++ trunk/reactos/base/services/thmsvc/thmsvc.c [iso-8859-1] Mon Sep 19 13:31:39 2011 @@ -1,0 +1,146 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: services/thmsvc/thmsvc.c + * PURPOSE: Themes service + * PROGRAMMER: Giannis Adamopoulos + */ + +/* INCLUDES *****************************************************************/ + +#define WIN32_NO_STATUS +#include <windows.h> +#include <uxundoc.h> + +#include "wine/debug.h" +WINE_DEFAULT_DEBUG_CHANNEL(thmsvc); + + +/* GLOBALS ******************************************************************/ + +static VOID CALLBACK ServiceMain(DWORD argc, LPWSTR *argv); +static WCHAR ServiceName[] = L"Themes"; +static SERVICE_TABLE_ENTRYW ServiceTable[] = +{ + {ServiceName, ServiceMain}, + {NULL, NULL} +}; + +SERVICE_STATUS_HANDLE ServiceStatusHandle; +SERVICE_STATUS ServiceStatus; + + +/* FUNCTIONS *****************************************************************/ + +static VOID +UpdateServiceStatus(DWORD dwState) +{ + ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; + ServiceStatus.dwCurrentState = dwState; + + if (dwState == SERVICE_RUNNING) + ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_PAUSE_CONTINUE | SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; + else if (dwState == SERVICE_PAUSED) + ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_PAUSE_CONTINUE; + else + ServiceStatus.dwControlsAccepted = 0; + + ServiceStatus.dwWin32ExitCode = 0; + ServiceStatus.dwServiceSpecificExitCode = 0; + ServiceStatus.dwCheckPoint = 0; + + if (dwState == SERVICE_START_PENDING || + dwState == SERVICE_STOP_PENDING || + dwState == SERVICE_PAUSE_PENDING || + dwState == SERVICE_CONTINUE_PENDING) + ServiceStatus.dwWaitHint = 10000; + else + ServiceStatus.dwWaitHint = 0; + + SetServiceStatus(ServiceStatusHandle, + &ServiceStatus); +} + + +static DWORD WINAPI +ServiceControlHandler(DWORD dwControl, + DWORD dwEventType, + LPVOID lpEventData, + LPVOID lpContext) +{ + TRACE("ServiceControlHandler() called\n"); + + switch (dwControl) + { + case SERVICE_CONTROL_STOP: + TRACE(" SERVICE_CONTROL_STOP received\n"); + UpdateServiceStatus(SERVICE_STOPPED); + ThemeHooksRemove(); + return ERROR_SUCCESS; + + case SERVICE_CONTROL_PAUSE: + TRACE(" SERVICE_CONTROL_PAUSE received\n"); + UpdateServiceStatus(SERVICE_PAUSED); + return ERROR_SUCCESS; + + case SERVICE_CONTROL_CONTINUE: + TRACE(" SERVICE_CONTROL_CONTINUE received\n"); + UpdateServiceStatus(SERVICE_RUNNING); + return ERROR_SUCCESS; + + case SERVICE_CONTROL_INTERROGATE: + TRACE(" SERVICE_CONTROL_INTERROGATE received\n"); + SetServiceStatus(ServiceStatusHandle, + &ServiceStatus); + return ERROR_SUCCESS; + + case SERVICE_CONTROL_SHUTDOWN: + TRACE(" SERVICE_CONTROL_SHUTDOWN received\n"); + UpdateServiceStatus(SERVICE_STOPPED); + return ERROR_SUCCESS; + + default : + TRACE(" Control %lu received\n"); + return ERROR_CALL_NOT_IMPLEMENTED; + } +} + + +static VOID CALLBACK +ServiceMain(DWORD argc, LPWSTR *argv) +{ + UNREFERENCED_PARAMETER(argc); + UNREFERENCED_PARAMETER(argv); + + TRACE("ServiceMain() called\n"); + + ServiceStatusHandle = RegisterServiceCtrlHandlerExW(ServiceName, + ServiceControlHandler, + NULL); + + TRACE("Calling SetServiceStatus()\n"); + UpdateServiceStatus(SERVICE_RUNNING); + TRACE("SetServiceStatus() called\n"); + + ThemeHooksInstall(); + + TRACE("ServiceMain() done\n"); +} + + +int +wmain(int argc, WCHAR *argv[]) +{ + UNREFERENCED_PARAMETER(argc); + UNREFERENCED_PARAMETER(argv); + + TRACE("thmsvc: main() started\n"); + + StartServiceCtrlDispatcher(ServiceTable); + + TRACE("thmsvc: main() done\n"); + + return 0; +} + +/* EOF */ Propchange: trunk/reactos/base/services/thmsvc/thmsvc.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/base/services/thmsvc/thmsvc.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/thmsvc/thmsv…
============================================================================== --- trunk/reactos/base/services/thmsvc/thmsvc.rbuild (added) +++ trunk/reactos/base/services/thmsvc/thmsvc.rbuild [iso-8859-1] Mon Sep 19 13:31:39 2011 @@ -1,0 +1,11 @@ +<?xml version="1.0"?> +<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> +<module name="thmsvc" type="win32cui" installbase="system32" installname="thmsvc.exe" unicode="yes"> + <include base="thmsvc">.</include> + <library>uxtheme</library> + <library>wine</library> + <library>ntdll</library> + <library>advapi32</library> + <file>thmsvc.c</file> + <file>thmsvc.rc</file> +</module> Propchange: trunk/reactos/base/services/thmsvc/thmsvc.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/base/services/thmsvc/thmsvc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/thmsvc/thmsv…
============================================================================== --- trunk/reactos/base/services/thmsvc/thmsvc.rc (added) +++ trunk/reactos/base/services/thmsvc/thmsvc.rc [iso-8859-1] Mon Sep 19 13:31:39 2011 @@ -1,0 +1,4 @@ +#define REACTOS_STR_FILE_DESCRIPTION "Themes-Service\0" +#define REACTOS_STR_INTERNAL_NAME "thmsvc\0" +#define REACTOS_STR_ORIGINAL_FILENAME "thmsvc.exe\0" +#include <reactos/version.rc> Propchange: trunk/reactos/base/services/thmsvc/thmsvc.rc ------------------------------------------------------------------------------ svn:eol-style = native
13 years, 3 months
1
0
0
0
[gadamopoulos] 53754: [uxundoc.h] - Add a couple of definitions that I forgot to add
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Mon Sep 19 13:29:10 2011 New Revision: 53754 URL:
http://svn.reactos.org/svn/reactos?rev=53754&view=rev
Log: [uxundoc.h] - Add a couple of definitions that I forgot to add Modified: trunk/reactos/include/reactos/uxundoc.h Modified: trunk/reactos/include/reactos/uxundoc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/uxundoc.h?…
============================================================================== --- trunk/reactos/include/reactos/uxundoc.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/uxundoc.h [iso-8859-1] Mon Sep 19 13:29:10 2011 @@ -72,3 +72,7 @@ DWORD dwSizeNum, PTHEMENAMES pszColorNames); HRESULT WINAPI ParseThemeIniFile(LPCWSTR pszIniFileName, LPWSTR pszUnknown, PARSETHEMEINIFILEPROC callback, LPVOID lpData); + +BOOL WINAPI ThemeHooksInstall(); +BOOL WINAPI ThemeHooksRemove(); +
13 years, 3 months
1
0
0
0
[gadamopoulos] 53753: [desk.cpl] - revert unintended change
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Mon Sep 19 13:24:48 2011 New Revision: 53753 URL:
http://svn.reactos.org/svn/reactos?rev=53753&view=rev
Log: [desk.cpl] - revert unintended change Modified: trunk/reactos/dll/cpl/desk/CMakeLists.txt Modified: trunk/reactos/dll/cpl/desk/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/CMakeLists.tx…
============================================================================== --- trunk/reactos/dll/cpl/desk/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/CMakeLists.txt [iso-8859-1] Mon Sep 19 13:24:48 2011 @@ -1,7 +1,6 @@ add_definitions(-D_WIN32) -set_unicode() set_rc_compiler() spec2def(desk.cpl desk.spec) @@ -27,7 +26,7 @@ theme.c ${CMAKE_CURRENT_BINARY_DIR}/desk.def) -set_module_type(desk cpl) +set_module_type(desk cpl UNICODE) target_link_libraries(desk uuid)
13 years, 3 months
1
0
0
0
[gadamopoulos] 53752: [desk.cpl] - Merge from themes branch
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Mon Sep 19 13:18:33 2011 New Revision: 53752 URL:
http://svn.reactos.org/svn/reactos?rev=53752&view=rev
Log: [desk.cpl] - Merge from themes branch Removed: trunk/reactos/dll/cpl/desk/theme.h Modified: trunk/reactos/dll/cpl/desk/CMakeLists.txt trunk/reactos/dll/cpl/desk/advappdlg.c trunk/reactos/dll/cpl/desk/advmon.c trunk/reactos/dll/cpl/desk/appearance.c trunk/reactos/dll/cpl/desk/appearance.h trunk/reactos/dll/cpl/desk/background.c trunk/reactos/dll/cpl/desk/desk.h trunk/reactos/dll/cpl/desk/desk.rbuild trunk/reactos/dll/cpl/desk/devsett.c trunk/reactos/dll/cpl/desk/draw.c trunk/reactos/dll/cpl/desk/draw.h trunk/reactos/dll/cpl/desk/effappdlg.c trunk/reactos/dll/cpl/desk/lang/en-US.rc trunk/reactos/dll/cpl/desk/monslctl.c trunk/reactos/dll/cpl/desk/preview.c trunk/reactos/dll/cpl/desk/resource.h trunk/reactos/dll/cpl/desk/theme.c Modified: trunk/reactos/dll/cpl/desk/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/CMakeLists.tx…
============================================================================== --- trunk/reactos/dll/cpl/desk/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/CMakeLists.txt [iso-8859-1] Mon Sep 19 13:18:33 2011 @@ -1,6 +1,7 @@ add_definitions(-D_WIN32) +set_unicode() set_rc_compiler() spec2def(desk.cpl desk.spec) @@ -26,7 +27,7 @@ theme.c ${CMAKE_CURRENT_BINARY_DIR}/desk.def) -set_module_type(desk cpl UNICODE) +set_module_type(desk cpl) target_link_libraries(desk uuid) @@ -40,7 +41,6 @@ ole32 setupapi shell32 - msimg32 kernel32 ntdll) Modified: trunk/reactos/dll/cpl/desk/advappdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/advappdlg.c?r…
============================================================================== --- trunk/reactos/dll/cpl/desk/advappdlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/advappdlg.c [iso-8859-1] Mon Sep 19 13:18:33 2011 @@ -78,7 +78,7 @@ 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); @@ -108,7 +108,7 @@ 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}}; @@ -130,7 +130,7 @@ 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); @@ -139,12 +139,12 @@ 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); @@ -152,7 +152,7 @@ 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); @@ -160,8 +160,8 @@ 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); @@ -232,20 +232,20 @@ 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 { @@ -267,15 +267,15 @@ 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); @@ -311,7 +311,7 @@ break; } - crColor = g->ThemeAdv.crColor[ColorIndex]; + crColor = g->SchemeAdv.crColor[ColorIndex]; /* Prepare cc structure */ cc.lStructSize = sizeof(CHOOSECOLOR); @@ -327,11 +327,11 @@ /* 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; } } @@ -353,9 +353,9 @@ TCHAR Size[4]; /* Copy the current theme values */ - g->ThemeAdv = g->Theme; - - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->ThemeAdv); + g->SchemeAdv = g->Scheme; + + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv); /* Add the elements to the combo */ @@ -380,7 +380,7 @@ 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); @@ -547,7 +547,7 @@ break; case IDCANCEL: - g->ThemeAdv = g->Theme; + g->SchemeAdv = g->Scheme; EndDialog(hwndDlg, IDCANCEL); break; @@ -605,20 +605,20 @@ 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; } } @@ -635,23 +635,23 @@ 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; } @@ -667,23 +667,23 @@ 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; } @@ -701,24 +701,24 @@ 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; } } @@ -734,23 +734,23 @@ 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; } } Modified: trunk/reactos/dll/cpl/desk/advmon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/advmon.c?rev=…
============================================================================== --- trunk/reactos/dll/cpl/desk/advmon.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/advmon.c [iso-8859-1] Mon Sep 19 13:18:33 2011 @@ -88,8 +88,11 @@ IDataObject *pdo; #ifdef _MSC_VER HMODULE hShell32 = NULL; +#endif CPSEAE msvc_SHCreatePropSheetExtArrayEx; -#endif + + /* silence gcc warning */ + msvc_SHCreatePropSheetExtArrayEx = NULL; /* FIXME: Build the "%s and %s" caption string for the monitor and adapter name */ szCaption[0] = _T('\0'); Modified: trunk/reactos/dll/cpl/desk/appearance.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/appearance.c?…
============================================================================== --- trunk/reactos/dll/cpl/desk/appearance.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/appearance.c [iso-8859-1] Mon Sep 19 13:18:33 2011 @@ -12,12 +12,49 @@ /******************************************************************************/ +static void +AppearancePage_ShowColorScemes(GLOBALS *g, HWND hwndColor, INT ThemeId) +{ + int i, iListIndex; + + SendMessage(hwndColor, CB_RESETCONTENT , 0, 0); + + if(g->bThemeActive == FALSE) + { + for(i = 0; i < g_TemplateCount; i++) + { + iListIndex = SendMessage(hwndColor, CB_ADDSTRING, 0, (LPARAM)g_ColorSchemes[i].strLegacyName); + SendMessage(hwndColor, CB_SETITEMDATA, iListIndex, i); + if (lstrcmp(g_ColorSchemes[i].strKeyName, g->strSelectedStyle) == 0) + { + g->SchemeId = i; + SendMessage(hwndColor, CB_SETCURSEL, (WPARAM)iListIndex, 0); + } + } + } + else + { + PTHEME pTheme = (PTHEME)DSA_GetItemPtr(g->Themes, ThemeId); + for(i = 0; i < pTheme->ColorsCount; i++) + { + PTHEME_STYLE pStyleName; + pStyleName = (PTHEME_STYLE)DSA_GetItemPtr(pTheme->Colors, i); + iListIndex = SendMessage(hwndColor, CB_ADDSTRING, 0, (LPARAM)pStyleName->DisplayName); + SendMessage(hwndColor, CB_SETITEMDATA, iListIndex, i); + if(i == 0 || (g->pszColorName && wcscmp(pStyleName->StlyeName, g->pszColorName) == 0)) + { + g->SchemeId = i; + SendMessage(hwndColor, CB_SETCURSEL, (WPARAM)iListIndex, 0); + } + } + } +} + static INT_PTR AppearancePage_OnInit(HWND hwndDlg) { - TCHAR strSelectedStyle[4]; INT i, TemplateCount, iListIndex; - HWND hwndCombo; + HWND hwndColor, hwndTheme; GLOBALS *g; g = (GLOBALS*)LocalAlloc(LPTR, sizeof(GLOBALS)); @@ -26,28 +63,40 @@ SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)g); - LoadCurrentTheme(&g->Theme); - g->ThemeAdv = g->Theme; - g->bHasChanged = FALSE; + LoadCurrentScheme(&g->Scheme); + g->SchemeAdv = g->Scheme; + g->bThemeChanged = FALSE; + g->bSchemeChanged = FALSE; g->hBoldFont = g->hItalicFont = NULL; g->hbmpColor[0] = g->hbmpColor[1] = g->hbmpColor[2] = NULL; g->bInitializing = FALSE; - - TemplateCount = LoadThemePresetEntries(strSelectedStyle); - - hwndCombo = GetDlgItem(hwndDlg, IDC_APPEARANCE_COLORSCHEME); - g->ThemeId = -1; + g->bThemeActive = FALSE; + + LoadThemes(g); + + TemplateCount = LoadSchemePresetEntries(g->strSelectedStyle); + + hwndColor = GetDlgItem(hwndDlg, IDC_APPEARANCE_COLORSCHEME); + g->SchemeId = -1; g->bInitializing = TRUE; - for(i = 0; i < TemplateCount; i++) - { - iListIndex = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)g_ThemeTemplates[i].strLegacyName); - SendMessage(hwndCombo, CB_SETITEMDATA, iListIndex, i); - if (lstrcmp(g_ThemeTemplates[i].strKeyName, strSelectedStyle) == 0) + + hwndTheme = GetDlgItem(hwndDlg, IDC_APPEARANCE_VISUAL_STYLE); + for(i = 0; i < g->ThemesCount; i++) + { + PTHEME pTheme = (PTHEME)DSA_GetItemPtr(g->Themes, i); + iListIndex = SendMessage(hwndTheme, CB_ADDSTRING, 0, (LPARAM)pTheme->displayName); + SendMessage(hwndTheme, CB_SETITEMDATA, iListIndex, i); + if((!pTheme->themeFileName && !IsThemeActive()) || + (pTheme->themeFileName && g->pszThemeFileName && wcscmp(pTheme->themeFileName, g->pszThemeFileName) == 0 )) { g->ThemeId = i; - SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM)iListIndex, 0); + g->bThemeActive = (pTheme->themeFileName != NULL); + SendMessage(hwndTheme, CB_SETCURSEL, (WPARAM)iListIndex, 0); + AppearancePage_ShowColorScemes(g, hwndColor, i); } - } + + } + g->bInitializing = FALSE; return FALSE; @@ -60,12 +109,12 @@ } static INT -GetSelectedThemeId(HWND hwndDlg) +GetSelectedId(HWND hwndDlg, int nIDDlgItem) { HWND hwndCombo; INT sel; - hwndCombo = GetDlgItem(hwndDlg, IDC_APPEARANCE_COLORSCHEME); + hwndCombo = GetDlgItem(hwndDlg, nIDDlgItem); sel = SendMessage(hwndCombo, CB_GETCURSEL, 0, 0); if (sel == CB_ERR) return -1; @@ -97,13 +146,13 @@ hwndDlg, EffAppearanceDlgProc, (LPARAM)g) == IDOK) { PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - g->Theme = g->ThemeAdv; - g->bHasChanged = TRUE; + g->Scheme = g->SchemeAdv; + g->bSchemeChanged = 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; @@ -112,32 +161,54 @@ hwndDlg, AdvAppearanceDlgProc, (LPARAM)g) == IDOK) { 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->bSchemeChanged = TRUE; + 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); - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - g->bHasChanged = TRUE; - if (ThemeId != -1 && LoadThemeFromReg(&Theme, ThemeId)) + INT SchemeId = GetSelectedId(hwndDlg, IDC_APPEARANCE_COLORSCHEME); + + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + + if(g->bThemeActive == FALSE) { - 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); + COLOR_SCHEME Scheme; + + g->bSchemeChanged = TRUE; + if (SchemeId != -1 && LoadSchemeFromReg(&Scheme, SchemeId)) + { + g->Scheme = Scheme; + g_GlobalData.desktop_color = g->Scheme.crColor[COLOR_DESKTOP]; + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&Scheme); + } } + else + { + g->bThemeChanged = TRUE; + } + } + break; + case IDC_APPEARANCE_VISUAL_STYLE: + if (HIWORD(wParam) == CBN_SELCHANGE && !g->bInitializing) + { + INT ThemeId = GetSelectedId(hwndDlg, IDC_APPEARANCE_VISUAL_STYLE); + HWND hwndColor = GetDlgItem(hwndDlg, IDC_APPEARANCE_COLORSCHEME); + + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + + g->bThemeActive = (ThemeId!=0); + g->bThemeChanged = TRUE; + AppearancePage_ShowColorScemes(g, hwndColor, ThemeId); } break; } @@ -148,14 +219,24 @@ switch (lpnm->code) { 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); - g->bHasChanged = FALSE; - } + + g->ThemeId = GetSelectedId(hwndDlg, IDC_APPEARANCE_VISUAL_STYLE); + g->SchemeId = GetSelectedId(hwndDlg, IDC_APPEARANCE_COLORSCHEME); + + if(g->bSchemeChanged) + { + ApplyScheme(&g->Scheme, g->SchemeId); + } + + if(g->bThemeChanged) + { + PTHEME pTheme = (PTHEME)DSA_GetItemPtr(g->Themes, g->ThemeId); + ActivateTheme(pTheme, g->SchemeId, 0); + } + + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Scheme); + g->bThemeChanged = FALSE; + g->bSchemeChanged = FALSE; SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, (LONG_PTR)PSNRET_NOERROR); return TRUE; @@ -164,10 +245,10 @@ return TRUE; case PSN_SETACTIVE: - if (g->Theme.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); + if (g->Scheme.crColor[COLOR_DESKTOP] != g_GlobalData.desktop_color) + { + g->Scheme.crColor[COLOR_DESKTOP] = g_GlobalData.desktop_color; + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Scheme); } break; } Modified: trunk/reactos/dll/cpl/desk/appearance.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/appearance.h?…
============================================================================== --- trunk/reactos/dll/cpl/desk/appearance.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/appearance.h [iso-8859-1] Mon Sep 19 13:18:33 2011 @@ -1,20 +1,140 @@ -/* Some typedefs for appearance */ +/* Some definitions for theme */ +#define SIZE_BORDER_X 0 +#define SIZE_BORDER_Y 1 +#define SIZE_CAPTION_Y 2 +#define SIZE_ICON_X 3 +#define SIZE_ICON_Y 4 +#define SIZE_ICON_SPC_X 5 +#define SIZE_ICON_SPC_Y 6 +#define SIZE_MENU_SIZE_X 7 +#define SIZE_MENU_Y 8 +#define SIZE_SCROLL_X 9 +#define SIZE_SCROLL_Y 10 +#define SIZE_SMCAPTION_Y 11 +#define SIZE_EDGE_X 12 +#define SIZE_EDGE_Y 13 +#define SIZE_FRAME_Y 14 +#define SIZE_MENU_CHECK_X 15 +#define SIZE_MENU_CHECK_Y 16 +#define SIZE_MENU_SIZE_Y 17 +#define SIZE_SIZE_X 18 +#define SIZE_SIZE_Y 19 + +#define FONT_CAPTION 0 +#define FONT_SMCAPTION 1 +#define FONT_HILIGHT 2 +#define FONT_MENU 2 +#define FONT_ICON 3 +#define FONT_INFO 4 +#define FONT_DIALOG 5 + +#define NUM_ELEMENTS 22 +#define NUM_FONTS 6 +#define NUM_SIZES 20 +#define NUM_COLORS 31 +#define MAX_TEMPLATES 50 +#define MAX_TEMPLATENAMELENTGH 80 + +/* Some typedefs for theme */ + +/* Most (but not all) fields below correspond to HKCU\Control Panel\Desktop\UserPreferencesMask */ +typedef struct +{ + BOOL bActiveWindowTracking; + BOOL bMenuAnimation; + BOOL bComboBoxAnimation; + BOOL bListBoxSmoothScrolling; + BOOL bGradientCaptions; + BOOL bKeyboardCues; + BOOL bActiveWndTrkZorder; + BOOL bHotTracking; + BOOL bMenuFade; + BOOL bSelectionFade; + BOOL bTooltipAnimation; + BOOL bTooltipFade; + BOOL bCursorShadow; + BOOL bUiEffects; + BOOL bFontSmoothing; + BOOL bDragFullWindows; + UINT uiFontSmoothingType; +} EFFECTS; + +typedef struct +{ + COLORREF crColor[NUM_COLORS]; + LOGFONT lfFont[NUM_FONTS]; + INT Size[NUM_SIZES]; + BOOL bFlatMenus; + EFFECTS Effects; +} COLOR_SCHEME; + +typedef struct +{ + TCHAR strKeyName[4]; + TCHAR strSizeName[4]; + TCHAR strDisplayName[MAX_TEMPLATENAMELENTGH]; + TCHAR strLegacyName[MAX_TEMPLATENAMELENTGH]; +} SCHEME_PRESET; + +/* struct for holding theme colors and sizes */ +typedef struct _THEME_STYLE +{ + WCHAR* StlyeName; + WCHAR* DisplayName; +} THEME_STYLE, *PTHEME_STYLE; + +typedef struct _THEME +{ + WCHAR* themeFileName; + WCHAR* displayName; + HDSA Colors; + int ColorsCount; + HDSA Sizes; + int SizesCount; + +} THEME, *PTHEME; /* This is the global structure used to store the current values. A pointer of this get's passed to the functions either directly 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; - BOOL bHasChanged; + HDSA Themes; + int ThemesCount; + BOOL bThemeActive; + + INT ThemeId; + INT SchemeId; /* Theme is customized if SchemeId == -1 */ + INT SizeID; + TCHAR strSelectedStyle[4]; + + LPWSTR pszThemeFileName; + LPWSTR pszColorName; + LPWSTR pszSizeName; + + COLOR_SCHEME Scheme; + COLOR_SCHEME SchemeAdv; + BOOL bThemeChanged; + BOOL bSchemeChanged; HBITMAP hbmpColor[3]; INT CurrentElement; HFONT hBoldFont; HFONT hItalicFont; BOOL bInitializing; } GLOBALS; + +extern SCHEME_PRESET g_ColorSchemes[MAX_TEMPLATES]; +extern INT g_TemplateCount; + +/* prototypes for theme.c */ +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); +VOID LoadThemes(GLOBALS *g); +HRESULT ActivateTheme(PTHEME pTheme, int iColor, int iSize); +void CleanupThemes(GLOBALS *g); /* prototypes for appearance.c */ INT_PTR CALLBACK AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); Modified: trunk/reactos/dll/cpl/desk/background.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/background.c?…
============================================================================== --- trunk/reactos/dll/cpl/desk/background.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/background.c [iso-8859-1] Mon Sep 19 13:18:33 2011 @@ -649,14 +649,14 @@ } } - TransparentBlt(draw->hDC, - draw->rcItem.left, draw->rcItem.top, - draw->rcItem.right-draw->rcItem.left+1, - draw->rcItem.bottom-draw->rcItem.top+1, - hDC, - 0, 0, - pData->cxSource, pData->cySource, - 0xFF00FF); + GdiTransparentBlt(draw->hDC, + draw->rcItem.left, draw->rcItem.top, + draw->rcItem.right-draw->rcItem.left+1, + draw->rcItem.bottom-draw->rcItem.top+1, + hDC, + 0, 0, + pData->cxSource, pData->cySource, + 0xFF00FF); SelectObject(hDC, hOldObj); DeleteDC(hDC); Modified: trunk/reactos/dll/cpl/desk/desk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/desk.h?rev=53…
============================================================================== --- trunk/reactos/dll/cpl/desk/desk.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/desk.h [iso-8859-1] Mon Sep 19 13:18:33 2011 @@ -11,8 +11,9 @@ #include <cplext.h> #include <dll/desk/deskcplx.h> #include <cfgmgr32.h> +#include <uxtheme.h> +#include <uxundoc.h> -#include "theme.h" #include "appearance.h" #include "preview.h" #include "draw.h" Modified: trunk/reactos/dll/cpl/desk/desk.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/desk.rbuild?r…
============================================================================== --- trunk/reactos/dll/cpl/desk/desk.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/desk.rbuild [iso-8859-1] Mon Sep 19 13:18:33 2011 @@ -13,8 +13,8 @@ <library>setupapi</library> <library>shell32</library> <library>ntdll</library> - <library>msimg32</library> <library>uuid</library> + <library>uxtheme</library> <file>advmon.c</file> <file>appearance.c</file> <file>background.c</file> Modified: trunk/reactos/dll/cpl/desk/devsett.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/devsett.c?rev…
============================================================================== --- trunk/reactos/dll/cpl/desk/devsett.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/devsett.c [iso-8859-1] Mon Sep 19 13:18:33 2011 @@ -181,19 +181,19 @@ CM_LOCATE_DEVNODE_NORMAL); if (cr == CR_SUCCESS) { - DbgPrint("Success1\n"); + DPRINT1("Success1\n"); cr = CM_Get_Device_ID_Size(&BufLen, DevInst, 0); if (cr == CR_SUCCESS) { - DbgPrint("Success2\n"); + DPRINT1("Success2\n"); lpDevInstId = LocalAlloc(LMEM_FIXED, (BufLen + 1) * sizeof(WCHAR)); if (lpDevInstId != NULL) { - DbgPrint("Success3\n"); + DPRINT1("Success3\n"); cr = CM_Get_Device_IDW(DevInst, lpDevInstId, BufLen, @@ -204,7 +204,7 @@ LocalFree((HLOCAL)lpDevInstId); lpDevInstId = NULL; } - DbgPrint("instance id: %ws\n", lpDevInstId); + DPRINT1("instance id: %ws\n", lpDevInstId); } } } Modified: trunk/reactos/dll/cpl/desk/draw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/draw.c?rev=53…
============================================================================== --- trunk/reactos/dll/cpl/desk/draw.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/draw.c [iso-8859-1] Mon Sep 19 13:18:33 2011 @@ -56,7 +56,7 @@ }; 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; @@ -98,7 +98,7 @@ RBOuterPen = GetStockObject(DC_PEN); { HBRUSH hbr; - hbr = CreateSolidBrush(theme->crColor[COLOR_BTNFACE]); + hbr = CreateSolidBrush(scheme->crColor[COLOR_BTNFACE]); FillRect(hdc, &InnerRect, hbr); DeleteObject(hbr); } @@ -106,7 +106,7 @@ /* 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); @@ -118,7 +118,7 @@ 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); @@ -132,7 +132,7 @@ /* 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); @@ -144,7 +144,7 @@ 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); @@ -181,14 +181,14 @@ } 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 @@ -216,7 +216,7 @@ } 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; @@ -242,7 +242,7 @@ 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; @@ -266,10 +266,10 @@ 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 */ @@ -283,7 +283,7 @@ /******************************************************************************/ 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; @@ -310,7 +310,7 @@ 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; @@ -334,10 +334,10 @@ 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 */ @@ -349,28 +349,28 @@ } 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) -{ - return MyIntDrawRectEdge(hDC, rc, edge, flags, theme); +MyDrawEdge(HDC hDC, LPRECT rc, UINT edge, UINT flags, COLOR_SCHEME *scheme) +{ + 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; @@ -381,7 +381,7 @@ 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) { @@ -390,19 +390,19 @@ 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; @@ -426,8 +426,8 @@ 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); } @@ -435,21 +435,30 @@ /******************************************************************************/ 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; + LONG ButtonWidth; HBRUSH hbr; HGDIOBJ hFontOld; RECT rc; + Height = scheme->Size[SIZE_CAPTION_Y] - 1; + VCenter = (rect->bottom - rect->top) / 2; + Padding = VCenter - (Height / 2); + + ButtonWidth = scheme->Size[SIZE_SIZE_X] - 2; + if (uFlags & DC_GRADIENT) { GRADIENT_RECT gcap = {0, 1}; 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; @@ -466,14 +475,14 @@ vert[1].Blue = (WORD)(Colors[1]>>8) & 0xFF00; vert[1].Alpha = 0; - GradientFill(hdc, vert, 2, &gcap, 1, GRADIENT_FILL_RECT_H); + GdiGradientFill(hdc, vert, 2, &gcap, 1, GRADIENT_FILL_RECT_H); } 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); } @@ -481,9 +490,9 @@ 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; @@ -496,7 +505,7 @@ /******************************************************************************/ 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; @@ -507,16 +516,16 @@ 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); @@ -542,35 +551,35 @@ { 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]); - - SetBkColor(DC, theme->crColor[bkgnd]); - hbr = CreateSolidBrush(theme->crColor[bkgnd]); + SetTextColor(DC, scheme->crColor[COLOR_MENUTEXT]); + + SetBkColor(DC, scheme->crColor[bkgnd]); + hbr = CreateSolidBrush(scheme->crColor[bkgnd]); FillRect(DC, &rect, hbr); DeleteObject(hbr); } Modified: trunk/reactos/dll/cpl/desk/draw.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/draw.h?rev=53…
============================================================================== --- trunk/reactos/dll/cpl/desk/draw.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/draw.h [iso-8859-1] Mon Sep 19 13:18:33 2011 @@ -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); Modified: trunk/reactos/dll/cpl/desk/effappdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/effappdlg.c?r…
============================================================================== --- trunk/reactos/dll/cpl/desk/effappdlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/effappdlg.c [iso-8859-1] Mon Sep 19 13:18:33 2011 @@ -16,17 +16,17 @@ { 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->bHasChanged = TRUE; + g->SchemeAdv.Effects.bDragFullWindows = (state == BST_CHECKED) ? TRUE : FALSE; + g->bSchemeChanged = TRUE; } @@ -56,17 +56,17 @@ 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 */ @@ -107,7 +107,7 @@ break; case IDCANCEL: - g->ThemeAdv = g->Theme; + g->SchemeAdv = g->Scheme; EndDialog(hwndDlg, IDCANCEL); break; @@ -124,7 +124,7 @@ 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; Modified: trunk/reactos/dll/cpl/desk/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/en-US.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/en-US.rc [iso-8859-1] Mon Sep 19 13:18:33 2011 @@ -51,8 +51,10 @@ BEGIN CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass", WS_VISIBLE | WS_BORDER, 7, 7, 232, 120 - LTEXT "Colorscheme", IDC_STATIC, 7, 140, 64, 7 - COMBOBOX IDC_APPEARANCE_COLORSCHEME, 7, 150, 134, 90, CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "Visual Style", IDC_STATIC, 7, 130, 64, 7 + COMBOBOX IDC_APPEARANCE_VISUAL_STYLE, 7, 140, 134, 90, CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "Colorscheme", IDC_STATIC, 7, 160, 64, 7 + COMBOBOX IDC_APPEARANCE_COLORSCHEME, 7, 170, 134, 90, CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_SORT | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Effects...", IDC_APPEARANCE_EFFECTS, 182, 150, 56, 15 PUSHBUTTON "Ad&vanced...", IDC_APPEARANCE_ADVANCED, 182, 170, 56, 15 END Modified: trunk/reactos/dll/cpl/desk/monslctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/monslctl.c?re…
============================================================================== --- trunk/reactos/dll/cpl/desk/monslctl.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/monslctl.c [iso-8859-1] Mon Sep 19 13:18:33 2011 @@ -684,6 +684,7 @@ SIZE rcsize; LOGFONT lf; HFONT hPrevFont, hFont; + INT len; hFont = infoPtr->Monitors[Index].hFont; if (hFont == NULL && @@ -696,6 +697,8 @@ rcsize.cy = infoPtr->Monitors[Index].rc.bottom - infoPtr->Monitors[Index].rc.top - (2 * infoPtr->SelectionFrame.cy) - 2; rcsize.cy = (rcsize.cy * 60) / 100; + + len = _tcslen(infoPtr->Monitors[Index].szCaption); hPrevFont = SelectObject(hDC, infoPtr->hFont); Modified: trunk/reactos/dll/cpl/desk/preview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/preview.c?rev…
============================================================================== --- trunk/reactos/dll/cpl/desk/preview.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/preview.c [iso-8859-1] Mon Sep 19 13:18:33 2011 @@ -14,7 +14,7 @@ { HWND hwndParent; - THEME Theme; + COLOR_SCHEME Scheme; HBRUSH hbrScrollbar; HBRUSH hbrDesktop; @@ -67,49 +67,49 @@ } 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->cxEdge = theme->Size[SIZE_EDGE_X] - 2; /* SM_CXEDGE */ - pPreviewData->cyEdge = theme->Size[SIZE_EDGE_Y] - 2; /* SM_CYEDGE */ - - pPreviewData->cySizeFrame = theme->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->hbrWindow = CreateSolidBrush(scheme->crColor[COLOR_WINDOW]); + + pPreviewData->cxEdge = scheme->Size[SIZE_EDGE_X] - 2; /* SM_CXEDGE */ + pPreviewData->cyEdge = scheme->Size[SIZE_EDGE_Y] - 2; /* SM_CYEDGE */ + + pPreviewData->cySizeFrame = scheme->Size[SIZE_FRAME_Y] - 1; /* SM_CYSIZEFRAME */ + + 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->Theme = *theme; + pPreviewData->hMessageFont = CreateFontIndirect(&scheme->lfFont[FONT_DIALOG]); + + 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); @@ -130,10 +130,10 @@ AllocAndLoadString(&pPreviewData->lpMessText, hApplet, IDS_MESSTEXT); AllocAndLoadString(&pPreviewData->lpButText, hApplet, IDS_BUTTEXT); - theme = &pPreviewData->Theme; - LoadCurrentTheme(theme); - - UpdatePreviewTheme(hwnd, pPreviewData, theme); + scheme = &pPreviewData->Scheme; + LoadCurrentScheme(scheme); + + UpdatePreviewTheme(hwnd, pPreviewData, scheme); } @@ -252,9 +252,9 @@ HFONT hOldFont; HDC hdc; RECT rc; - THEME *theme; - - theme = &pPreviewData->Theme; + COLOR_SCHEME *scheme; + + scheme = &pPreviewData->Scheme; hdc = BeginPaint(hwnd, &ps); @@ -262,61 +262,61 @@ 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); @@ -494,7 +494,7 @@ break; case PVM_UPDATETHEME: - UpdatePreviewTheme(hwnd, pPreviewData, (THEME *)lParam); + UpdatePreviewTheme(hwnd, pPreviewData, (COLOR_SCHEME *)lParam); break; default: Modified: trunk/reactos/dll/cpl/desk/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/resource.h?re…
============================================================================== --- trunk/reactos/dll/cpl/desk/resource.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/resource.h [iso-8859-1] Mon Sep 19 13:18:33 2011 @@ -96,6 +96,7 @@ #define IDC_APPEARANCE_FONTSIZE 1502 #define IDC_APPEARANCE_EFFECTS 1503 #define IDC_APPEARANCE_ADVANCED 1504 +#define IDC_APPEARANCE_VISUAL_STYLE 1505 #define IDS_INACTWIN 1510 #define IDS_ACTWIN 1511 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] Mon Sep 19 13:18:33 2011 @@ -10,7 +10,7 @@ #include "desk.h" static BOOL g_PresetLoaded = FALSE; -static INT g_TemplateCount = 0; +INT g_TemplateCount = 0; static INT g_ColorList[NUM_COLORS]; @@ -20,7 +20,7 @@ /******************************************************************************/ -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 */ static const TCHAR *g_RegColorNames[NUM_COLORS] = @@ -84,7 +84,7 @@ /******************************************************************************/ -VOID LoadCurrentTheme(THEME* theme) +VOID LoadCurrentScheme(COLOR_SCHEME* scheme) { INT i; NONCLIENTMETRICS NonClientMetrics; @@ -93,43 +93,43 @@ 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); -} - -BOOL LoadThemeFromReg(THEME* theme, INT ThemeId) + SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &scheme->Effects.bKeyboardCues, 0); +} + +BOOL LoadSchemeFromReg(COLOR_SCHEME* scheme, INT SchemeId) { INT i; TCHAR strSelectedStyle[4]; @@ -141,37 +141,37 @@ BOOL Ret = FALSE; if (!g_PresetLoaded) - LoadThemePresetEntries(strSelectedStyle); - - if (ThemeId == -1) + LoadSchemePresetEntries(strSelectedStyle); + + 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 @@ { 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 */ @@ -195,12 +195,12 @@ 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]); } else - theme->Size[i] = (INT)iSize; + scheme->Size[i] = (INT)iSize; } - RegCloseKey(hkScheme); + RegCloseKey(hkSize); } RegCloseKey(hkScheme); } @@ -210,7 +210,7 @@ return Ret; } -VOID ApplyTheme(THEME* theme, INT ThemeId) +VOID ApplyScheme(COLOR_SCHEME* scheme, INT SchemeId) { INT i, Result; HKEY hKey; @@ -219,7 +219,7 @@ 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 = RegCreateKeyEx(HKEY_CURRENT_USER, g_CPColors, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey, NULL); @@ -227,9 +227,9 @@ { 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)); } @@ -239,20 +239,20 @@ /* 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, @@ -261,9 +261,9 @@ /* 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, @@ -273,44 +273,44 @@ /* 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); - //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 */ + 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); + //SystemParametersInfo(SPI_SETACTIVEWINDOWTRACKING, 0, (PVOID)&scheme->Effects.bActiveWindowTracking, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE); + //SystemParametersInfo(SPI_SETMENUANIMATION, 0, (PVOID)&scheme->Effects.bMenuAnimation, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE); + //SystemParametersInfo(SPI_SETCOMBOBOXANIMATION, 0, (PVOID)&scheme->Effects.bComboBoxAnimation, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE); + //SystemParametersInfo(SPI_SETLISTBOXSMOOTHSCROLLING, 0, (PVOID)&scheme->Effects.bListBoxSmoothScrolling, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE); + //SystemParametersInfo(SPI_SETGRADIENTCAPTIONS, 0, (PVOID)&scheme->Effects.bGradientCaptions, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE); + //SystemParametersInfo(SPI_SETACTIVEWNDTRKZORDER, 0, (PVOID)&scheme->Effects.bActiveWndTrkZorder, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE); + //SystemParametersInfo(SPI_SETHOTTRACKING, 0, (PVOID)&scheme->Effects.bHotTracking, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE); + SystemParametersInfo(SPI_SETMENUFADE, 0, (PVOID)&scheme->Effects.bMenuFade, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE); + //SystemParametersInfo(SPI_SETSELECTIONFADE, 0, (PVOID)&scheme->Effects.bSelectionFade, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE); + SystemParametersInfo(SPI_SETTOOLTIPANIMATION, 0, (PVOID)&scheme->Effects.bTooltipAnimation, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE); + SystemParametersInfo(SPI_SETTOOLTIPFADE, 0, (PVOID)&scheme->Effects.bTooltipFade, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE); + //SystemParametersInfo(SPI_SETCURSORSHADOW, 0, (PVOID)&scheme->Effects.bCursorShadow, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE); + //SystemParametersInfo(SPI_SETUIEFFECTS, 0, (PVOID)&scheme->Effects.bUiEffects, SPIF_UPDATEINIFILE|SPIF_SENDCHANGE); + + /* 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; @@ -338,27 +338,27 @@ 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++; @@ -379,3 +379,160 @@ } return iTemplateIndex; } + +typedef HRESULT (WINAPI * ENUMTHEMESTYLE) (LPCWSTR, LPWSTR, DWORD, PTHEMENAMES); + +BOOL AddThemeStyles(LPCWSTR pszThemeFileName, HDSA* Styles, int* count, ENUMTHEMESTYLE enumTheme) +{ + DWORD index = 0; + THEMENAMES names; + THEME_STYLE StyleName; + + *Styles = DSA_Create(sizeof(THEMENAMES),1); + *count = 0; + + while (SUCCEEDED (enumTheme (pszThemeFileName, NULL, index++, &names))) + { + StyleName.StlyeName = _wcsdup(names.szName); + StyleName.DisplayName = _wcsdup(names.szDisplayName); + (*count)++; + DSA_InsertItem(*Styles, *count, &StyleName); + } + + return TRUE; +} + +BOOL CALLBACK EnumThemeProc(LPVOID lpReserved, + LPCWSTR pszThemeFileName, + LPCWSTR pszThemeName, + LPCWSTR pszToolTip, LPVOID lpReserved2, + LPVOID lpData) +{ + THEME theme; + GLOBALS *g = (GLOBALS *) lpData; + + theme.themeFileName = _wcsdup(pszThemeFileName); + theme.displayName = _wcsdup(pszThemeName); + AddThemeStyles( pszThemeFileName, &theme.Sizes, &theme.SizesCount, (ENUMTHEMESTYLE)EnumThemeSizes); + AddThemeStyles( pszThemeFileName, &theme.Colors, &theme.ColorsCount, (ENUMTHEMESTYLE)EnumThemeColors); + + DSA_InsertItem(g->Themes, DSA_APPEND , &theme); + g->ThemesCount++; + + return TRUE; +} + +void LoadThemes(GLOBALS *g) +{ + WCHAR themesPath[MAX_PATH]; + HRESULT hret; + THEME ClassicTheme; + WCHAR szThemeFileName[MAX_PATH]; + WCHAR szColorBuff[MAX_PATH]; + WCHAR szSizeBuff[MAX_PATH]; + + /* Initialize themes dsa */ + g->Themes = DSA_Create(sizeof(THEME),5); + + /* Insert the classic theme */ + memset(&ClassicTheme, 0, sizeof(THEME)); + ClassicTheme.displayName = _wcsdup(L"Classic Theme"); + DSA_InsertItem(g->Themes, 0, &ClassicTheme); + g->ThemesCount = 1; + + /* Retrieve the name of the current theme */ + hret = GetCurrentThemeName(szThemeFileName, + MAX_PATH, + szColorBuff, + MAX_PATH, + szSizeBuff, + MAX_PATH); + + if (FAILED (hret)) + { + g->pszThemeFileName = NULL; + g->pszColorName = NULL; + g->pszSizeName = NULL; + } + else + { + /* Cache the name of the active theme */ + g->pszThemeFileName = _wcsdup(szThemeFileName); + g->pszColorName = _wcsdup(szColorBuff); + g->pszSizeName = _wcsdup(szSizeBuff); + } + /* Get path to themes folder */ + hret = SHGetFolderPathW (NULL, CSIDL_RESOURCES, NULL, SHGFP_TYPE_CURRENT, themesPath); + if (FAILED (hret)) + return; + lstrcatW (themesPath, L"\\Themes"); + + /* Enumerate themes */ + hret = EnumThemes(themesPath, EnumThemeProc, g); +} + +HRESULT ActivateTheme(PTHEME pTheme, int iColor, int iSize) +{ + PTHEME_STYLE pThemeColor; + PTHEME_STYLE pThemeSize; + HTHEMEFILE hThemeFile = 0; + HRESULT hret; + + if(pTheme->themeFileName) + { + pThemeColor = (PTHEME_STYLE)DSA_GetItemPtr(pTheme->Colors, iColor); + pThemeSize = (PTHEME_STYLE)DSA_GetItemPtr(pTheme->Sizes, iSize); + + hret = OpenThemeFile(pTheme->themeFileName, + pThemeColor->StlyeName, + pThemeSize->StlyeName, + &hThemeFile, + 0); + + if(!SUCCEEDED(hret)) + { + return hret; + } + + } + + hret = ApplyTheme(hThemeFile, "", 0); + + if(pTheme->themeFileName) + { + hret = CloseThemeFile(hThemeFile); + } + + return hret; +} + +int CALLBACK CleanUpThemeStlyeCallback(void *p, void *pData) +{ + PTHEME_STYLE pStyle = (PTHEME_STYLE)p; + + free(pStyle->DisplayName); + free(pStyle->StlyeName); + + return TRUE; +} + +int CALLBACK CleanUpThemeCallback(void *p, void *pData) +{ + PTHEME pTheme = (PTHEME)p; + + free(pTheme->displayName); + free(pTheme->themeFileName); + DSA_DestroyCallback(pTheme->Colors, CleanUpThemeStlyeCallback, NULL); + DSA_DestroyCallback(pTheme->Sizes, CleanUpThemeStlyeCallback, NULL); + + return TRUE; +} + +void CleanupThemes(GLOBALS *g) +{ + free(g->pszThemeFileName); + free(g->pszColorName); + free(g->pszSizeName); + + DSA_DestroyCallback(g->Themes, CleanUpThemeCallback, NULL); +} Removed: 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 (removed) @@ -1,86 +1,0 @@ -/* Some definitions for theme */ -#define SIZE_BORDER_X 0 -#define SIZE_BORDER_Y 1 -#define SIZE_CAPTION_Y 2 -#define SIZE_ICON_X 3 -#define SIZE_ICON_Y 4 -#define SIZE_ICON_SPC_X 5 -#define SIZE_ICON_SPC_Y 6 -#define SIZE_MENU_SIZE_X 7 -#define SIZE_MENU_Y 8 -#define SIZE_SCROLL_X 9 -#define SIZE_SCROLL_Y 10 -#define SIZE_SMCAPTION_Y 11 -#define SIZE_EDGE_X 12 -#define SIZE_EDGE_Y 13 -#define SIZE_FRAME_Y 14 -#define SIZE_MENU_CHECK_X 15 -#define SIZE_MENU_CHECK_Y 16 -#define SIZE_MENU_SIZE_Y 17 -#define SIZE_SIZE_X 18 -#define SIZE_SIZE_Y 19 - -#define FONT_CAPTION 0 -#define FONT_SMCAPTION 1 -#define FONT_HILIGHT 2 -#define FONT_MENU 2 -#define FONT_ICON 3 -#define FONT_INFO 4 -#define FONT_DIALOG 5 - -#define NUM_ELEMENTS 22 -#define NUM_FONTS 6 -#define NUM_SIZES 20 -#define NUM_COLORS 31 -#define MAX_TEMPLATES 50 -#define MAX_TEMPLATENAMELENTGH 80 - -/* Some typedefs for theme */ - -/* Most (but not all) fields below correspond to HKCU\Control Panel\Desktop\UserPreferencesMask */ -typedef struct -{ - BOOL bActiveWindowTracking; - BOOL bMenuAnimation; - BOOL bComboBoxAnimation; - BOOL bListBoxSmoothScrolling; - BOOL bGradientCaptions; - BOOL bKeyboardCues; - BOOL bActiveWndTrkZorder; - BOOL bHotTracking; - BOOL bMenuFade; - BOOL bSelectionFade; - BOOL bTooltipAnimation; - BOOL bTooltipFade; - BOOL bCursorShadow; - BOOL bUiEffects; - BOOL bFontSmoothing; - BOOL bDragFullWindows; - UINT uiFontSmoothingType; -} EFFECTS; - -typedef struct -{ - COLORREF crColor[NUM_COLORS]; - LOGFONT lfFont[NUM_FONTS]; - INT Size[NUM_SIZES]; - BOOL bFlatMenus; - EFFECTS Effects; -} THEME; - -typedef struct -{ - TCHAR strKeyName[4]; - TCHAR strSizeName[4]; - TCHAR strDisplayName[MAX_TEMPLATENAMELENTGH]; - TCHAR strLegacyName[MAX_TEMPLATENAMELENTGH]; -} THEME_PRESET; - -extern THEME_PRESET g_ThemeTemplates[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);
13 years, 3 months
1
0
0
0
[gadamopoulos] 53751: [comctl32] - Merge from the themes branch - Partly sync themed button handling with wine
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Mon Sep 19 13:11:35 2011 New Revision: 53751 URL:
http://svn.reactos.org/svn/reactos?rev=53751&view=rev
Log: [comctl32] - Merge from the themes branch - Partly sync themed button handling with wine Modified: trunk/reactos/dll/win32/comctl32/theme_button.c trunk/reactos/dll/win32/comctl32/theming.c Modified: trunk/reactos/dll/win32/comctl32/theme_button.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/theme_b…
============================================================================== --- trunk/reactos/dll/win32/comctl32/theme_button.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/theme_button.c [iso-8859-1] Mon Sep 19 13:11:35 2011 @@ -246,18 +246,26 @@ DWORD dwStyle = GetWindowLongW(hwnd, GWL_STYLE); DWORD dwStyleEx = GetWindowLongW(hwnd, GWL_EXSTYLE); UINT dtFlags = get_drawtext_flags(dwStyle, dwStyleEx); - ButtonState drawState = IsWindowEnabled(hwnd) ? STATE_NORMAL : STATE_DISABLED; + int state = (int)SendMessageW(hwnd, BM_GETSTATE, 0, 0); + ButtonState drawState; pfThemedPaint paint = btnThemedPaintFunc[ dwStyle & BUTTON_TYPE ]; - if (paint) - { - hDC = hParamDC ? hParamDC : BeginPaint(hwnd, &ps); - paint(theme, hwnd, hDC, drawState, dtFlags); - if (!hParamDC) EndPaint(hwnd, &ps); - return TRUE; - } - - return FALSE; /* Delegate drawing to the non-themed code. */ + if(!paint) + return FALSE; + + if(IsWindowEnabled(hwnd)) + { + if(state & BST_PUSHED) drawState = STATE_PRESSED; + else if(state & BST_HOT) drawState = STATE_HOT; + else if(state & BST_FOCUS) drawState = STATE_DEFAULTED; + else drawState = STATE_NORMAL; + } + else drawState = STATE_DISABLED; + + hDC = hParamDC ? hParamDC : BeginPaint(hwnd, &ps); + paint(theme, hwnd, hDC, drawState, dtFlags); + if (!hParamDC) EndPaint(hwnd, &ps); + return TRUE; } /********************************************************************** @@ -309,6 +317,37 @@ RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW); return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam); + case WM_MOUSEMOVE: + { + TRACKMOUSEEVENT mouse_event; + mouse_event.cbSize = sizeof(TRACKMOUSEEVENT); + mouse_event.dwFlags = TME_QUERY; + if(!TrackMouseEvent(&mouse_event) || !(mouse_event.dwFlags&(TME_HOVER|TME_LEAVE))) + { + mouse_event.dwFlags = TME_HOVER|TME_LEAVE; + mouse_event.hwndTrack = hwnd; + mouse_event.dwHoverTime = 1; + TrackMouseEvent(&mouse_event); + } + break; + } + + case WM_MOUSEHOVER: + { + int state = (int)SendMessageW(hwnd, BM_GETSTATE, 0, 0); + SetWindowLongW(hwnd, 0, state|BST_HOT); + InvalidateRect(hwnd, NULL, FALSE); + break; + } + + case WM_MOUSELEAVE: + { + int state = (int)SendMessageW(hwnd, BM_GETSTATE, 0, 0); + SetWindowLongW(hwnd, 0, state&(~BST_HOT)); + InvalidateRect(hwnd, NULL, FALSE); + break; + } + default: /* Call old proc */ return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam); Modified: trunk/reactos/dll/win32/comctl32/theming.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/theming…
============================================================================== --- trunk/reactos/dll/win32/comctl32/theming.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/theming.c [iso-8859-1] Mon Sep 19 13:11:35 2011 @@ -35,15 +35,15 @@ ULONG_PTR); extern LRESULT CALLBACK THEMING_ButtonSubclassProc (HWND, UINT, WPARAM, LPARAM, - ULONG_PTR); + ULONG_PTR) DECLSPEC_HIDDEN; extern LRESULT CALLBACK THEMING_ComboSubclassProc (HWND, UINT, WPARAM, LPARAM, - ULONG_PTR); + ULONG_PTR) DECLSPEC_HIDDEN; extern LRESULT CALLBACK THEMING_DialogSubclassProc (HWND, UINT, WPARAM, LPARAM, - ULONG_PTR); + ULONG_PTR) DECLSPEC_HIDDEN; extern LRESULT CALLBACK THEMING_EditSubclassProc (HWND, UINT, WPARAM, LPARAM, - ULONG_PTR); + ULONG_PTR) DECLSPEC_HIDDEN; extern LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND, UINT, WPARAM, LPARAM, - ULONG_PTR); + ULONG_PTR) DECLSPEC_HIDDEN; static const WCHAR dialogClass[] = {'#','3','2','7','7','0',0}; static const WCHAR comboLboxClass[] = {'C','o','m','b','o','L','b','o','x',0}; @@ -118,9 +118,7 @@ { 'C','C','3','2','T','h','e','m','i','n','g','S','u','b','C','l',0 }; static const WCHAR refDataPropName[] = { 'C','C','3','2','T','h','e','m','i','n','g','D','a','t','a',0 }; - - if (!IsThemeActive()) return; - + atSubclassProp = GlobalAddAtomW (subclassPropName); atRefDataProp = GlobalAddAtomW (refDataPropName); @@ -133,6 +131,8 @@ GetClassInfoExW (NULL, subclasses[i].className, &class); originalProcs[i] = class.lpfnWndProc; class.lpfnWndProc = subclassProcs[i]; + class.style |= CS_GLOBALCLASS; + class.hInstance = COMCTL32_hModule; if (!class.lpfnWndProc) {
13 years, 3 months
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
40
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Results per page:
10
25
50
100
200