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
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
August 2011
----- 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
18 participants
498 discussions
Start a n
N
ew thread
[jgardou] 53271: [RPCRT4] - do not wait for other threads in DLL_PROCESS_DETACH - fix handle leak - remove debug code
by jgardou@svn.reactos.org
Author: jgardou Date: Tue Aug 16 20:00:18 2011 New Revision: 53271 URL:
http://svn.reactos.org/svn/reactos?rev=53271&view=rev
Log: [RPCRT4] - do not wait for other threads in DLL_PROCESS_DETACH - fix handle leak - remove debug code Modified: trunk/reactos/dll/win32/rpcrt4/rpc_server.c trunk/reactos/dll/win32/rpcrt4/rpc_transport.c Modified: trunk/reactos/dll/win32/rpcrt4/rpc_server.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_serve…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_server.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_server.c [iso-8859-1] Tue Aug 16 20:00:18 2011 @@ -1071,8 +1071,6 @@ EnterCriticalSection(&server_cs); LIST_FOR_EACH_ENTRY_SAFE(cps, cursor2, &protseqs, RpcServerProtseq, entry) { - if (listen_count != 0) - RPCRT4_sync_with_server_thread(cps); destroy_serverprotoseq(cps); } LeaveCriticalSection(&server_cs); Modified: trunk/reactos/dll/win32/rpcrt4/rpc_transport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_trans…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_transport.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_transport.c [iso-8859-1] Tue Aug 16 20:00:18 2011 @@ -103,9 +103,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(rpc); -#undef ERR -#define ERR FIXME - static RPC_STATUS RPCRT4_SpawnConnection(RpcConnection** Connection, RpcConnection* OldConnection); /**** ncacn_np support ****/ @@ -225,21 +222,13 @@ if (pipe != INVALID_HANDLE_VALUE) break; err = GetLastError(); if (err == ERROR_PIPE_BUSY) { - ERR("connection to %s failed, error=%x\n", pname, err); + TRACE("connection failed, error=%x\n", err); return RPC_S_SERVER_TOO_BUSY; } - if(wait) ERR("Waiting for pipe instance"); - if(wait) - { - if (!WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) { - err = GetLastError(); - ERR("connection to %s failed, error=%x, wait %x\n", pname, err, wait); - return RPC_S_SERVER_UNAVAILABLE; - } - else - { - ERR("Pipe Instance Ready!!!!!!!!!!!!!!!!!!\n"); - } + if (!wait || !WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) { + err = GetLastError(); + WARN("connection failed, error=%x\n", err); + return RPC_S_SERVER_UNAVAILABLE; } } @@ -469,6 +458,7 @@ bytes_left -= bytes_written; buf += bytes_written; } + CloseHandle(ovl.hEvent); return ret ? count : -1; }
13 years, 3 months
1
0
0
0
[ekohl] 53270: [ADVAPI32] Fix QueryServiceStatusEx.
by ekohl@svn.reactos.org
Author: ekohl Date: Tue Aug 16 19:16:16 2011 New Revision: 53270 URL:
http://svn.reactos.org/svn/reactos?rev=53270&view=rev
Log: [ADVAPI32] Fix QueryServiceStatusEx. Modified: trunk/reactos/dll/win32/advapi32/service/scm.c Modified: trunk/reactos/dll/win32/advapi32/service/scm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
============================================================================== --- trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] Tue Aug 16 19:16:16 2011 @@ -2526,6 +2526,13 @@ return FALSE; } + if (cbBufSize < sizeof(SERVICE_STATUS_PROCESS)) + { + *pcbBytesNeeded = sizeof(SERVICE_STATUS_PROCESS); + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return FALSE; + } + RpcTryExcept { /* Call to services.exe using RPC */
13 years, 3 months
1
0
0
0
[akhaldi] 53269: [LWIP] * Add missing dependency on bugcodes.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Aug 16 18:16:23 2011 New Revision: 53269 URL:
http://svn.reactos.org/svn/reactos?rev=53269&view=rev
Log: [LWIP] * Add missing dependency on bugcodes. Modified: trunk/reactos/lib/drivers/lwip/CMakeLists.txt Modified: trunk/reactos/lib/drivers/lwip/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/lwip/CMakeList…
============================================================================== --- trunk/reactos/lib/drivers/lwip/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/lwip/CMakeLists.txt [iso-8859-1] Tue Aug 16 18:16:23 2011 @@ -1,6 +1,6 @@ include_directories( BEFORE include - ${REACTOS_SOURCE_DIR}/drivers/network/tcpip/include + ${REACTOS_SOURCE_DIR}/drivers/network/tcpip/include ${REACTOS_SOURCE_DIR}/lib/drivers/lwip/src/include ${REACTOS_SOURCE_DIR}/lib/drivers/lwip/src/include/ipv4) @@ -57,4 +57,4 @@ src/core/snmp/msg_out.c) add_library(lwip ${SOURCE}) - +add_dependencies(lwip bugcodes)
13 years, 3 months
1
0
0
0
[jgardou] 53268: [RPCRT4] - reduce difference with WINE : use their implementation of RpcMgmtStopServerListening
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Aug 15 21:45:12 2011 New Revision: 53268 URL:
http://svn.reactos.org/svn/reactos?rev=53268&view=rev
Log: [RPCRT4] - reduce difference with WINE : use their implementation of RpcMgmtStopServerListening Modified: trunk/reactos/dll/win32/rpcrt4/rpc_server.c Modified: trunk/reactos/dll/win32/rpcrt4/rpc_server.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_serve…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_server.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_server.c [iso-8859-1] Mon Aug 15 21:45:12 2011 @@ -1475,7 +1475,7 @@ */ RPC_STATUS WINAPI RpcMgmtWaitServerListen( void ) { - RpcServerProtseq *cps; + HANDLE event; TRACE("()\n"); @@ -1485,15 +1485,20 @@ LeaveCriticalSection(&listen_cs); return RPC_S_NOT_LISTENING; } - do { - LeaveCriticalSection(&listen_cs); - LIST_FOR_EACH_ENTRY(cps, &protseqs, RpcServerProtseq, entry) - WaitForSingleObject(cps->server_ready_event, INFINITE); - - EnterCriticalSection(&listen_cs); - } while (!std_listen); + if (listen_done_event) { + LeaveCriticalSection(&listen_cs); + return RPC_S_ALREADY_LISTENING; + } + event = CreateEventW( NULL, TRUE, FALSE, NULL ); + listen_done_event = event; LeaveCriticalSection(&listen_cs); + + TRACE( "waiting for server calls to finish\n" ); + WaitForSingleObject( event, INFINITE ); + TRACE( "done waiting\n" ); + + CloseHandle( event ); return RPC_S_OK; }
13 years, 3 months
1
0
0
0
[jgardou] 53267: [EVENTLOG] - Stop listening to RPC messages when receiving SERVICE_CONTROL_STOP
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Aug 15 20:55:07 2011 New Revision: 53267 URL:
http://svn.reactos.org/svn/reactos?rev=53267&view=rev
Log: [EVENTLOG] - Stop listening to RPC messages when receiving SERVICE_CONTROL_STOP Modified: trunk/reactos/base/services/eventlog/eventlog.c trunk/reactos/base/services/umpnpmgr/umpnpmgr.c Modified: trunk/reactos/base/services/eventlog/eventlog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/eve…
============================================================================== --- trunk/reactos/base/services/eventlog/eventlog.c [iso-8859-1] (original) +++ trunk/reactos/base/services/eventlog/eventlog.c [iso-8859-1] Mon Aug 15 20:55:07 2011 @@ -63,6 +63,8 @@ { case SERVICE_CONTROL_STOP: DPRINT(" SERVICE_CONTROL_STOP received\n"); + /* Stop listening to incoming RPC messages */ + RpcMgmtStopServerListening(NULL); UpdateServiceStatus(SERVICE_STOPPED); return ERROR_SUCCESS; Modified: trunk/reactos/base/services/umpnpmgr/umpnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/umpnpmgr/ump…
============================================================================== --- trunk/reactos/base/services/umpnpmgr/umpnpmgr.c [iso-8859-1] (original) +++ trunk/reactos/base/services/umpnpmgr/umpnpmgr.c [iso-8859-1] Mon Aug 15 20:55:07 2011 @@ -3043,6 +3043,8 @@ { case SERVICE_CONTROL_STOP: DPRINT1(" SERVICE_CONTROL_STOP received\n"); + /* Stop listening to RPC Messages */ + RpcMgmtStopServerListening(NULL); UpdateServiceStatus(SERVICE_STOPPED); return ERROR_SUCCESS;
13 years, 3 months
1
0
0
0
[tkreuzer] 53266: [GDI FONT DRIVER] - Fix a bug in kerning pair initialization - Remove unused function - Improve calculation of windows family - Fix the glyphset enumeration, adding a second glyph...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Aug 15 20:27:26 2011 New Revision: 53266 URL:
http://svn.reactos.org/svn/reactos?rev=53266&view=rev
Log: [GDI FONT DRIVER] - Fix a bug in kerning pair initialization - Remove unused function - Improve calculation of windows family - Fix the glyphset enumeration, adding a second glyphset when we have symbol encoding. Fixes startmenu arrows. Modified: branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/font.c branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/tttables.c Modified: branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/font.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/drivers…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/font.c [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/font.c [iso-8859-1] Mon Aug 15 20:27:26 2011 @@ -227,9 +227,12 @@ pifi->jWinPitchAndFamily = FF_SCRIPT; else if (pifi->panose.bFamilyType == PAN_FAMILY_DECORATIVE) pifi->jWinPitchAndFamily = FF_DECORATIVE; - else if (pifi->panose.bProportion == PAN_PROP_MODERN) + else if ((pifi->panose.bProportion == PAN_PROP_MODERN) || + (pifi->panose.bProportion == PAN_PROP_MONOSPACED)) pifi->jWinPitchAndFamily = FF_MODERN; - else if (pifi->panose.bSerifStyle <= PAN_SERIF_ROUNDED) + else if ((pifi->panose.bSerifStyle == PAN_SERIF_NORMAL_SANS) || + (pifi->panose.bSerifStyle == PAN_SERIF_OBTUSE_SANS) || + (pifi->panose.bSerifStyle == PAN_SERIF_PERP_SANS)) pifi->jWinPitchAndFamily = FF_SWISS; else pifi->jWinPitchAndFamily = FF_ROMAN; @@ -291,7 +294,36 @@ TRACE("FtfdInitGlyphSet()\n"); - /* Allocate an array of WCHARs */ + /* Set char bias, FIXME: use lCharBias? other encodings? */ + // if (pface->ulEncoding == FT_ENCODING_MS_SYMBOL) return FtfdInitSymbolGlyphSet(pface); + + /* Start with 0 runs and 0 mappings */ + pface->cMappings = 0; + pface->cRuns = 0; + + /* Loop through all character mappings */ + wcPrev = wcCurrent = (WCHAR)FT_Get_First_Char(ftface, &index); + pface->ifiex.ifi.wcFirstChar = wcCurrent - pface->wcCharBias;; + while (index) + { + /* Count the mapping */ + pface->cMappings++; + + /* If character is not subsequent, count a new run */ + if (wcCurrent != wcPrev + 1) pface->cRuns++; + wcPrev = wcCurrent; + + /* Get the next charcode and index */ + wcCurrent = (WCHAR)FT_Get_Next_Char(ftface, wcCurrent, &index); + } + + /* If we have symbol encoding, duplicate the glyphset */ + if (pface->ulEncoding == FT_ENCODING_MS_SYMBOL) pface->cRuns *= 2; + + /* Save the last character */ + pface->ifiex.ifi.wcLastChar = wcPrev;; + + /* Allocate an array for HGLYPH to WCHAR mapping */ cjSize = pface->cGlyphs * sizeof(WCHAR); pwcReverseTable = EngAllocMem(0, cjSize, 'dftF'); if (!pwcReverseTable) @@ -353,9 +385,27 @@ wcCurrent = (WCHAR)FT_Get_Next_Char(ftface, wcCurrent, &index); } + /* Check if we have symbol encoding */ + if (pface->ulEncoding == FT_ENCODING_MS_SYMBOL) + { + /* Loop all previous runs again */ + for (i = 0; i < cRuns; i++) + { + /* Copy the run */ + pGlyphSet->awcrun[cRuns + i] = pGlyphSet->awcrun[i]; + + /* Use the original unoffsetted value */ + pGlyphSet->awcrun[cRuns + i].wcLow += pface->wcCharBias; + } + + /* We have twice as much now */ + pGlyphSet->cGlyphsSupported *= 2; + } + TRACE("Done with font tree, %d runs\n", pGlyphSet->cRuns); pface->pGlyphSet = pGlyphSet; pface->pwcReverseTable = pwcReverseTable; + return pGlyphSet; } @@ -409,8 +459,6 @@ PFTFD_FACE pface; FT_Error fterror; ULONG ulEncoding, ulAccumCharWidth = 0; - WCHAR wcCurrent, wcPrev; - FT_UInt index; /* Try to load a unicode charmap */ ulEncoding = FT_ENCODING_UNICODE; @@ -451,39 +499,16 @@ pface->ulEncoding = ulEncoding; /* Set char bias, FIXME: use lCharBias? other encodings? */ - pface->wcCharBias = ulEncoding == FT_ENCODING_MS_SYMBOL ? 0xf000 : 0; + pface->wcCharBias = (ulEncoding == FT_ENCODING_MS_SYMBOL) ? 0xf000 : 0; /* Get the font format */ pface->ulFontFormat = FtfdGetFontFormat(ftface); - /* Start with 0 runs and 0 mappings */ - pface->cMappings = 0; - pface->cRuns = 0; - - /* Loop through all character mappings */ - wcPrev = wcCurrent = (WCHAR)FT_Get_First_Char(ftface, &index); - pface->ifiex.ifi.wcFirstChar = wcCurrent - pface->wcCharBias;; - while (index) - { - /* Count the mapping */ - pface->cMappings++; - - /* If character is not subsequent, count a new run */ - if (wcCurrent != wcPrev + 1) pface->cRuns++; - wcPrev = wcCurrent; - - /* Get the next charcode and index */ - wcCurrent = (WCHAR)FT_Get_Next_Char(ftface, wcCurrent, &index); - } - - /* Save the last character */ - pface->ifiex.ifi.wcLastChar = wcPrev - pface->wcCharBias;; + /* Initialize glyphset */ + FtfdInitGlyphSet(pface); /* Initialize IFIMETRICS */ FtfdInitIfiMetrics(pface); - - /* Initialize glyphset */ - FtfdInitGlyphSet(pface); /* Initialize kerning pairs */ FtfdInitKerningPairs(pface); Modified: branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/tttables.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/drivers…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/tttables.c [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/tttables.c [iso-8859-1] Mon Aug 15 20:27:26 2011 @@ -9,12 +9,6 @@ #include "ftfd.h" #include "tttables.h" - -ULONG test_GETD(PVOID pv) -{ - PUSHORT pus = pv; - return (ULONG)_byteswap_ushort(pus[0]) << 16 | _byteswap_ushort(pus[1]); -} static ULONG @@ -385,7 +379,7 @@ /* Windows wants WCHARs, convert them */ pKernPair->wcFirst = pface->pwcReverseTable[hgLeft]; - pKernPair->wcSecond = pface->pwcReverseTable[hgLeft]; + pKernPair->wcSecond = pface->pwcReverseTable[hgRight]; pKernPair->fwdKern = GETW(&pSubTable->format0.akernpair[j].fwdValue); pKernPair++; }
13 years, 3 months
1
0
0
0
[akhaldi] 53265: * Include NDK headers on-demand.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Aug 15 17:12:19 2011 New Revision: 53265 URL:
http://svn.reactos.org/svn/reactos?rev=53265&view=rev
Log: * Include NDK headers on-demand. Modified: trunk/reactos/dll/win32/hid/precomp.h trunk/reactos/dll/win32/powrprof/powrprof.c trunk/reactos/drivers/base/nmidebug/nmidebug.c Modified: trunk/reactos/dll/win32/hid/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hid/precomp.h?re…
============================================================================== --- trunk/reactos/dll/win32/hid/precomp.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/hid/precomp.h [iso-8859-1] Mon Aug 15 17:12:19 2011 @@ -1,6 +1,8 @@ #define WIN32_NO_STATUS #include <windows.h> #include <debug.h> +#define NTOS_MODE_USER +#include <ndk/umtypes.h> #define _HIDPI_ #define _HIDPI_NO_FUNCTION_MACROS_ @@ -10,7 +12,7 @@ typedef VOID (WINAPI *PINTERFACE_DEREFERENCE)( PVOID Context); -#include <ntndk.h> + #include <hidusage.h> #include <hidclass.h> #include <hidpi.h> Modified: trunk/reactos/dll/win32/powrprof/powrprof.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/powrprof/powrpro…
============================================================================== --- trunk/reactos/dll/win32/powrprof/powrprof.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/powrprof/powrprof.c [iso-8859-1] Mon Aug 15 17:12:19 2011 @@ -20,10 +20,12 @@ #include <stdarg.h> -#include <ntstatus.h> #define WIN32_NO_STATUS #include <windows.h> -#include <ntndk.h> +#define NTOS_MODE_USER +#include <ndk/pofuncs.h> +#include <ndk/rtlfuncs.h> +#include <ndk/setypes.h> #include <powrprof.h> #include <wchar.h> #include <stdio.h> Modified: trunk/reactos/drivers/base/nmidebug/nmidebug.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/nmidebug/nmid…
============================================================================== --- trunk/reactos/drivers/base/nmidebug/nmidebug.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/nmidebug/nmidebug.c [iso-8859-1] Mon Aug 15 17:12:19 2011 @@ -9,7 +9,7 @@ /* INCLUDES *******************************************************************/ #include <ntifs.h> -#include <ntndk.h> +#include <ndk/ketypes.h> /* FUNCTIONS ******************************************************************/
13 years, 3 months
1
0
0
0
[akhaldi] 53264: [HALACPI] * Add to build. Dedicated to Cameron. [SPEC2DEF] * Add an option to set the name of the output def file.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Aug 15 15:36:25 2011 New Revision: 53264 URL:
http://svn.reactos.org/svn/reactos?rev=53264&view=rev
Log: [HALACPI] * Add to build. Dedicated to Cameron. [SPEC2DEF] * Add an option to set the name of the output def file. Modified: trunk/reactos/cmake/gcc.cmake trunk/reactos/cmake/msvc.cmake trunk/reactos/hal/halx86/CMakeLists.txt Modified: trunk/reactos/cmake/gcc.cmake URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/gcc.cmake?rev=53264&…
============================================================================== --- trunk/reactos/cmake/gcc.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/gcc.cmake [iso-8859-1] Mon Aug 15 15:36:25 2011 @@ -268,7 +268,13 @@ endfunction() function(spec2def _dllname _spec_file) - get_filename_component(_file ${_spec_file} NAME_WE) + + if(${ARGC} GREATER 2) + set(_file ${ARGV2}) + else() + get_filename_component(_file ${_spec_file} NAME_WE) + endif() + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def ${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c COMMAND native-spec2def -n=${_dllname} --kill-at -a=${ARCH2} -d=${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -s=${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} Modified: trunk/reactos/cmake/msvc.cmake URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/msvc.cmake?rev=53264…
============================================================================== --- trunk/reactos/cmake/msvc.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/msvc.cmake [iso-8859-1] Mon Aug 15 15:36:25 2011 @@ -186,7 +186,11 @@ endmacro() function(spec2def _dllname _spec_file) - get_filename_component(_file ${_spec_file} NAME_WE) + if(${ARGC} GREATER 2) + set(_file ${ARGV2}) + else() + get_filename_component(_file ${_spec_file} NAME_WE) + endif() add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def ${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c COMMAND native-spec2def --ms --kill-at -a=${SPEC2DEF_ARCH} -n=${_dllname} -d=${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -s=${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} Modified: trunk/reactos/hal/halx86/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/CMakeLists.txt?…
============================================================================== --- trunk/reactos/hal/halx86/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/CMakeLists.txt [iso-8859-1] Mon Aug 15 15:36:25 2011 @@ -47,6 +47,8 @@ generic/legacy/bus/pcibus.c) if(ARCH MATCHES i386) + list(APPEND HAL_GENERIC_ACPI_SOURCE + generic/halinit.c) list(APPEND HAL_GENERIC_UP_SOURCE generic/spinlock.c @@ -102,6 +104,24 @@ add_cd_file(TARGET hal DESTINATION reactos/system32 NO_CAB FOR all) + # hal acpi + spec2def(halacpi.dll ../hal.spec halacpi) + add_library(halacpi SHARED + ${HAL_GENERIC_SOURCE} + ${HAL_GENERIC_ACPI_SOURCE} + ${HAL_GENERIC_UP_SOURCE} + up/halinit_up.c + up/halup.rc + ${CMAKE_CURRENT_BINARY_DIR}/halacpi.def) + add_dependencies(halacpi psdk bugcodes) + set_entrypoint(halacpi HalInitSystem@8) + set_subsystem(halacpi native) + set_image_base(halacpi 0x00010000) + add_importlibs(halacpi ntoskrnl) + target_link_libraries(halacpi libcntpr) + set_property(TARGET halacpi PROPERTY COMPILE_DEFINITIONS CONFIG_ACPI) + add_cd_file(TARGET halacpi DESTINATION reactos/system32 NO_CAB FOR all) + # mini_hal add_library(mini_hal ${MINI_HAL_SOURCE}) set_property(TARGET mini_hal PROPERTY COMPILE_DEFINITIONS "_BLDR_;_MINIHAL_")
13 years, 3 months
1
0
0
0
[gadamopoulos] 53263: [desk] - Rename themes to color schemes
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Mon Aug 15 13:02:06 2011 New Revision: 53263 URL:
http://svn.reactos.org/svn/reactos?rev=53263&view=rev
Log: [desk] - Rename themes to color schemes Modified: branches/GSoC_2011/ThemesSupport/dll/cpl/desk/advappdlg.c branches/GSoC_2011/ThemesSupport/dll/cpl/desk/appearance.c branches/GSoC_2011/ThemesSupport/dll/cpl/desk/appearance.h branches/GSoC_2011/ThemesSupport/dll/cpl/desk/draw.c branches/GSoC_2011/ThemesSupport/dll/cpl/desk/draw.h branches/GSoC_2011/ThemesSupport/dll/cpl/desk/effappdlg.c branches/GSoC_2011/ThemesSupport/dll/cpl/desk/preview.c branches/GSoC_2011/ThemesSupport/dll/cpl/desk/theme.c branches/GSoC_2011/ThemesSupport/dll/cpl/desk/theme.h Modified: branches/GSoC_2011/ThemesSupport/dll/cpl/desk/advappdlg.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/cpl…
============================================================================== --- branches/GSoC_2011/ThemesSupport/dll/cpl/desk/advappdlg.c [iso-8859-1] (original) +++ branches/GSoC_2011/ThemesSupport/dll/cpl/desk/advappdlg.c [iso-8859-1] Mon Aug 15 13:02:06 2011 @@ -81,7 +81,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); @@ -111,7 +111,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}}; @@ -133,7 +133,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); @@ -142,12 +142,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); @@ -155,7 +155,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); @@ -163,8 +163,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); @@ -235,20 +235,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 { @@ -270,15 +270,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); @@ -314,7 +314,7 @@ break; } - crColor = g->ThemeAdv.crColor[ColorIndex]; + crColor = g->SchemeAdv.crColor[ColorIndex]; /* Prepare cc structure */ cc.lStructSize = sizeof(CHOOSECOLOR); @@ -330,11 +330,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; } } @@ -356,9 +356,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 */ @@ -383,7 +383,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); @@ -550,7 +550,7 @@ break; case IDCANCEL: - g->ThemeAdv = g->Theme; + g->SchemeAdv = g->Scheme; EndDialog(hwndDlg, IDCANCEL); break; @@ -608,20 +608,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; } } @@ -638,23 +638,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; } @@ -670,23 +670,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; } @@ -704,24 +704,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; } } @@ -737,23 +737,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: branches/GSoC_2011/ThemesSupport/dll/cpl/desk/appearance.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/cpl…
============================================================================== --- branches/GSoC_2011/ThemesSupport/dll/cpl/desk/appearance.c [iso-8859-1] (original) +++ branches/GSoC_2011/ThemesSupport/dll/cpl/desk/appearance.c [iso-8859-1] Mon Aug 15 13:02:06 2011 @@ -29,25 +29,25 @@ SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)g); - LoadCurrentTheme(&g->Theme); - g->ThemeAdv = g->Theme; + LoadCurrentScheme(&g->Scheme); + g->SchemeAdv = g->Scheme; g->bHasChanged = FALSE; g->hBoldFont = g->hItalicFont = NULL; g->hbmpColor[0] = g->hbmpColor[1] = g->hbmpColor[2] = NULL; g->bInitializing = FALSE; - TemplateCount = LoadThemePresetEntries(strSelectedStyle); + TemplateCount = LoadSchemePresetEntries(strSelectedStyle); hwndCombo = GetDlgItem(hwndDlg, IDC_APPEARANCE_COLORSCHEME); - g->ThemeId = -1; + g->SchemeId = -1; g->bInitializing = TRUE; for(i = 0; i < TemplateCount; i++) { - iListIndex = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)g_ThemeTemplates[i].strLegacyName); + iListIndex = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)g_ColorSchemes[i].strLegacyName); SendMessage(hwndCombo, CB_SETITEMDATA, iListIndex, i); - if (lstrcmp(g_ThemeTemplates[i].strKeyName, strSelectedStyle) == 0) + if (lstrcmp(g_ColorSchemes[i].strKeyName, strSelectedStyle) == 0) { - g->ThemeId = i; + g->SchemeId = i; SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM)iListIndex, 0); } } @@ -100,13 +100,13 @@ hwndDlg, EffAppearanceDlgProc, (LPARAM)g) == IDOK) { PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - g->Theme = g->ThemeAdv; + g->Scheme = g->SchemeAdv; g->bHasChanged = TRUE; // Effects dialog doesn't change the color scheme, therefore the following lines are commented out, until fixed finally - //g->ThemeId = -1; /* Customized */ + //g->SchemeId = -1; /* Customized */ //SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_COLORSCHEME, CB_SETCURSEL, (WPARAM)-1, 0); //SetDlgItemText(hwndDlg, IDC_APPEARANCE_COLORSCHEME, TEXT("")); - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Theme); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Scheme); } break; @@ -116,30 +116,30 @@ { PropSheet_Changed(GetParent(hwndDlg), hwndDlg); g->bHasChanged = TRUE; - g->Theme = g->ThemeAdv; - g->ThemeId = -1; /* Customized */ - g_GlobalData.desktop_color = g->Theme.crColor[COLOR_DESKTOP]; + g->Scheme = g->SchemeAdv; + g->SchemeId = -1; /* Customized */ + g_GlobalData.desktop_color = g->Scheme.crColor[COLOR_DESKTOP]; SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_COLORSCHEME, CB_SETCURSEL, (WPARAM)-1, 0); SetDlgItemText(hwndDlg, IDC_APPEARANCE_COLORSCHEME, TEXT("")); - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Theme); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Scheme); } break; case IDC_APPEARANCE_COLORSCHEME: if (HIWORD(wParam) == CBN_SELCHANGE && !g->bInitializing) { - THEME Theme; - INT ThemeId = GetSelectedThemeId(hwndDlg); + COLOR_SCHEME Scheme; + INT SchemeId = GetSelectedThemeId(hwndDlg); PropSheet_Changed(GetParent(hwndDlg), hwndDlg); g->bHasChanged = TRUE; - if (ThemeId != -1 && LoadThemeFromReg(&Theme, ThemeId)) + if (SchemeId != -1 && LoadSchemeFromReg(&Scheme, SchemeId)) { - g->Theme = Theme; - g->ThemeId = ThemeId; - g_GlobalData.desktop_color = g->Theme.crColor[COLOR_DESKTOP]; - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&Theme); + g->Scheme = Scheme; + g->SchemeId = SchemeId; + g_GlobalData.desktop_color = g->Scheme.crColor[COLOR_DESKTOP]; + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&Scheme); } } break; @@ -153,10 +153,10 @@ case PSN_APPLY: if (g->bHasChanged) { - INT ThemeId = GetSelectedThemeId(hwndDlg); - ApplyTheme(&g->Theme, ThemeId); - g->ThemeId = ThemeId; - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Theme); + INT SchemeId = GetSelectedThemeId(hwndDlg); + ApplyScheme(&g->Scheme, SchemeId); + g->SchemeId = SchemeId; + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Scheme); g->bHasChanged = FALSE; } SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, (LONG_PTR)PSNRET_NOERROR); @@ -167,10 +167,10 @@ return TRUE; case PSN_SETACTIVE: - if (g->Theme.crColor[COLOR_DESKTOP] != g_GlobalData.desktop_color) + if (g->Scheme.crColor[COLOR_DESKTOP] != g_GlobalData.desktop_color) { - g->Theme.crColor[COLOR_DESKTOP] = g_GlobalData.desktop_color; - SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Theme); + g->Scheme.crColor[COLOR_DESKTOP] = g_GlobalData.desktop_color; + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Scheme); } break; } Modified: branches/GSoC_2011/ThemesSupport/dll/cpl/desk/appearance.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/cpl…
============================================================================== --- branches/GSoC_2011/ThemesSupport/dll/cpl/desk/appearance.h [iso-8859-1] (original) +++ branches/GSoC_2011/ThemesSupport/dll/cpl/desk/appearance.h [iso-8859-1] Mon Aug 15 13:02:06 2011 @@ -5,9 +5,9 @@ or by passing hwnd and getting the pointer by GetWindowLongPtr */ typedef struct tagGLOBALS { - INT ThemeId; /* Theme is customized if ThemeId == -1 */ - THEME Theme; - THEME ThemeAdv; + INT SchemeId; /* Theme is customized if SchemeId == -1 */ + COLOR_SCHEME Scheme; + COLOR_SCHEME SchemeAdv; BOOL bHasChanged; HBITMAP hbmpColor[3]; INT CurrentElement; Modified: branches/GSoC_2011/ThemesSupport/dll/cpl/desk/draw.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/cpl…
============================================================================== --- branches/GSoC_2011/ThemesSupport/dll/cpl/desk/draw.c [iso-8859-1] (original) +++ branches/GSoC_2011/ThemesSupport/dll/cpl/desk/draw.c [iso-8859-1] Mon Aug 15 13:02:06 2011 @@ -58,7 +58,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; @@ -100,7 +100,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); } @@ -108,7 +108,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); @@ -120,7 +120,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); @@ -134,7 +134,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); @@ -146,7 +146,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); @@ -183,14 +183,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 @@ -218,7 +218,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; @@ -244,7 +244,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; @@ -268,10 +268,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 */ @@ -285,7 +285,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; @@ -312,7 +312,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; @@ -336,10 +336,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 */ @@ -351,28 +351,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; @@ -383,7 +383,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) { @@ -392,19 +392,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; @@ -428,8 +428,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); } @@ -437,7 +437,7 @@ /******************************************************************************/ BOOL -MyDrawCaptionTemp(HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont, HICON hIcon, LPCWSTR str, UINT uFlags, THEME *theme) +MyDrawCaptionTemp(HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont, HICON hIcon, LPCWSTR str, UINT uFlags, COLOR_SCHEME *scheme) { ULONG Height; UINT VCenter, Padding; @@ -446,11 +446,11 @@ HGDIOBJ hFontOld; RECT rc; - Height = theme->Size[SIZE_CAPTION_Y] - 1; + Height = scheme->Size[SIZE_CAPTION_Y] - 1; VCenter = (rect->bottom - rect->top) / 2; Padding = VCenter - (Height / 2); - ButtonWidth = theme->Size[SIZE_SIZE_X] - 2; + ButtonWidth = scheme->Size[SIZE_SIZE_X] - 2; if (uFlags & DC_GRADIENT) { @@ -458,9 +458,9 @@ TRIVERTEX vert[2]; COLORREF Colors[2]; - Colors[0] = theme->crColor[((uFlags & DC_ACTIVE) ? + Colors[0] = scheme->crColor[((uFlags & DC_ACTIVE) ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION)]; - Colors[1] = theme->crColor[((uFlags & DC_ACTIVE) ? + Colors[1] = scheme->crColor[((uFlags & DC_ACTIVE) ? COLOR_GRADIENTACTIVECAPTION : COLOR_GRADIENTINACTIVECAPTION)]; vert[0].x = rect->left; @@ -482,9 +482,9 @@ else { if (uFlags & DC_ACTIVE) - hbr = CreateSolidBrush(theme->crColor[COLOR_ACTIVECAPTION]); + hbr = CreateSolidBrush(scheme->crColor[COLOR_ACTIVECAPTION]); else - hbr = CreateSolidBrush(theme->crColor[COLOR_INACTIVECAPTION]); + hbr = CreateSolidBrush(scheme->crColor[COLOR_INACTIVECAPTION]); FillRect(hdc, rect, hbr); DeleteObject(hbr); } @@ -492,9 +492,9 @@ hFontOld = SelectObject(hdc, hFont); SetBkMode(hdc, TRANSPARENT); if (uFlags & DC_ACTIVE) - SetTextColor(hdc, theme->crColor[COLOR_CAPTIONTEXT]); + SetTextColor(hdc, scheme->crColor[COLOR_CAPTIONTEXT]); else - SetTextColor(hdc, theme->crColor[COLOR_INACTIVECAPTIONTEXT]); + SetTextColor(hdc, scheme->crColor[COLOR_INACTIVECAPTIONTEXT]); rc.left = rect->left + 2; rc.top = rect->top; rc.right = rect->right; @@ -507,7 +507,7 @@ /******************************************************************************/ DWORD -MyDrawMenuBarTemp(HWND Wnd, HDC DC, LPRECT Rect, HMENU Menu, HFONT Font, THEME *theme) +MyDrawMenuBarTemp(HWND Wnd, HDC DC, LPRECT Rect, HMENU Menu, HFONT Font, COLOR_SCHEME *scheme) { HBRUSH hbr; HPEN hPen; @@ -518,16 +518,16 @@ WCHAR Text[128]; UINT uFormat = DT_CENTER | DT_VCENTER | DT_SINGLELINE; - flat_menu = theme->bFlatMenus; + flat_menu = scheme->bFlatMenus; if (flat_menu) - hbr = CreateSolidBrush(theme->crColor[COLOR_MENUBAR]); + hbr = CreateSolidBrush(scheme->crColor[COLOR_MENUBAR]); else - hbr = CreateSolidBrush(theme->crColor[COLOR_MENU]); + hbr = CreateSolidBrush(scheme->crColor[COLOR_MENU]); FillRect(DC, Rect, hbr); DeleteObject(hbr); - hPen = CreatePen(PS_SOLID, 0, theme->crColor[COLOR_3DFACE]); + hPen = CreatePen(PS_SOLID, 0, scheme->crColor[COLOR_3DFACE]); hPenOld = SelectObject(DC, hPen); MoveToEx(DC, Rect->left, Rect->bottom - 1, NULL); LineTo(DC, Rect->right, Rect->bottom - 1); @@ -553,35 +553,35 @@ { 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: branches/GSoC_2011/ThemesSupport/dll/cpl/desk/draw.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/cpl…
============================================================================== --- branches/GSoC_2011/ThemesSupport/dll/cpl/desk/draw.h [iso-8859-1] (original) +++ branches/GSoC_2011/ThemesSupport/dll/cpl/desk/draw.h [iso-8859-1] Mon Aug 15 13:02:06 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: branches/GSoC_2011/ThemesSupport/dll/cpl/desk/effappdlg.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/cpl…
============================================================================== --- branches/GSoC_2011/ThemesSupport/dll/cpl/desk/effappdlg.c [iso-8859-1] (original) +++ branches/GSoC_2011/ThemesSupport/dll/cpl/desk/effappdlg.c [iso-8859-1] Mon Aug 15 13:02:06 2011 @@ -18,16 +18,16 @@ { WPARAM state; state = SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_ANIMATION, BM_GETCHECK, 0, 0); - g->ThemeAdv.Effects.bMenuAnimation = (state == BST_CHECKED) ? TRUE : FALSE; - EnableWindow(GetDlgItem(hwndDlg, IDC_EFFAPPEARANCE_ANIMATIONTYPE), g->ThemeAdv.Effects.bMenuAnimation); + g->SchemeAdv.Effects.bMenuAnimation = (state == BST_CHECKED) ? TRUE : FALSE; + EnableWindow(GetDlgItem(hwndDlg, IDC_EFFAPPEARANCE_ANIMATIONTYPE), g->SchemeAdv.Effects.bMenuAnimation); //A boolean as an index for a 2-value list: - SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_ANIMATIONTYPE, CB_SETCURSEL, (WPARAM)g->ThemeAdv.Effects.bMenuFade, 0); + SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_ANIMATIONTYPE, CB_SETCURSEL, (WPARAM)g->SchemeAdv.Effects.bMenuFade, 0); state = SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_KEYBOARDCUES, BM_GETCHECK, 0, 0); - g->ThemeAdv.Effects.bKeyboardCues = (state == BST_CHECKED) ? TRUE : FALSE; + g->SchemeAdv.Effects.bKeyboardCues = (state == BST_CHECKED) ? TRUE : FALSE; state = SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_DRAGFULLWINDOWS, BM_GETCHECK, 0, 0); - g->ThemeAdv.Effects.bDragFullWindows = (state == BST_CHECKED) ? TRUE : FALSE; + g->SchemeAdv.Effects.bDragFullWindows = (state == BST_CHECKED) ? TRUE : FALSE; g->bHasChanged = TRUE; } @@ -58,17 +58,17 @@ WPARAM state; /* Copy the current theme values */ - g->ThemeAdv = g->Theme; + g->SchemeAdv = g->Scheme; AddToCombo(hwndDlg, IDS_SLIDEEFFECT, IDS_FADEEFFECT, IDC_EFFAPPEARANCE_ANIMATIONTYPE); - state = g->ThemeAdv.Effects.bMenuAnimation ? BST_CHECKED : BST_UNCHECKED; + state = g->SchemeAdv.Effects.bMenuAnimation ? BST_CHECKED : BST_UNCHECKED; SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_ANIMATION, BM_SETCHECK, state, 0); - state = g->ThemeAdv.Effects.bKeyboardCues ? BST_CHECKED : BST_UNCHECKED; + state = g->SchemeAdv.Effects.bKeyboardCues ? BST_CHECKED : BST_UNCHECKED; SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_KEYBOARDCUES, BM_SETCHECK, state, 0); - state = g->ThemeAdv.Effects.bDragFullWindows ? BST_CHECKED : BST_UNCHECKED; + state = g->SchemeAdv.Effects.bDragFullWindows ? BST_CHECKED : BST_UNCHECKED; SendDlgItemMessage(hwndDlg, IDC_EFFAPPEARANCE_DRAGFULLWINDOWS, BM_SETCHECK, state, 0); /* Update the controls */ @@ -109,7 +109,7 @@ break; case IDCANCEL: - g->ThemeAdv = g->Theme; + g->SchemeAdv = g->Scheme; EndDialog(hwndDlg, IDCANCEL); break; @@ -126,7 +126,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: branches/GSoC_2011/ThemesSupport/dll/cpl/desk/preview.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/cpl…
============================================================================== --- branches/GSoC_2011/ThemesSupport/dll/cpl/desk/preview.c [iso-8859-1] (original) +++ branches/GSoC_2011/ThemesSupport/dll/cpl/desk/preview.c [iso-8859-1] Mon Aug 15 13:02:06 2011 @@ -17,7 +17,7 @@ { HWND hwndParent; - THEME Theme; + COLOR_SCHEME Scheme; HBRUSH hbrScrollbar; HBRUSH hbrDesktop; @@ -70,49 +70,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); @@ -133,10 +133,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); } @@ -255,9 +255,9 @@ HFONT hOldFont; HDC hdc; RECT rc; - THEME *theme; - - theme = &pPreviewData->Theme; + COLOR_SCHEME *scheme; + + scheme = &pPreviewData->Scheme; hdc = BeginPaint(hwnd, &ps); @@ -265,61 +265,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); @@ -497,7 +497,7 @@ break; case PVM_UPDATETHEME: - UpdatePreviewTheme(hwnd, pPreviewData, (THEME *)lParam); + UpdatePreviewTheme(hwnd, pPreviewData, (COLOR_SCHEME *)lParam); break; default: Modified: branches/GSoC_2011/ThemesSupport/dll/cpl/desk/theme.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/cpl…
============================================================================== --- branches/GSoC_2011/ThemesSupport/dll/cpl/desk/theme.c [iso-8859-1] (original) +++ branches/GSoC_2011/ThemesSupport/dll/cpl/desk/theme.c [iso-8859-1] Mon Aug 15 13:02:06 2011 @@ -21,7 +21,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 */ const TCHAR g_RegColorNames[NUM_COLORS][MAX_COLORNAMELENGTH] = @@ -85,7 +85,7 @@ /******************************************************************************/ -VOID LoadCurrentTheme(THEME* theme) +VOID LoadCurrentScheme(COLOR_SCHEME* scheme) { INT i; NONCLIENTMETRICS NonClientMetrics; @@ -94,43 +94,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 */ @@ -191,11 +191,11 @@ { wsprintf(strValueName, TEXT("Size #%d"), i); dwLength = sizeof(UINT64); - if (RegQueryValueEx(hkSize, strValueName, NULL, &dwType, (LPBYTE)&theme->Size[i], &dwLength) != ERROR_SUCCESS || + if (RegQueryValueEx(hkSize, strValueName, NULL, &dwType, (LPBYTE)&scheme->Size[i], &dwLength) != ERROR_SUCCESS || dwType != REG_QWORD || dwLength != sizeof(UINT64)) { /* Failed to read registry value, initialize with current setting for now */ - theme->Size[i] = GetSystemMetrics(g_SizeMetric[i]); + scheme->Size[i] = GetSystemMetrics(g_SizeMetric[i]); } } RegCloseKey(hkScheme); @@ -215,7 +215,7 @@ } #define UPDATE_USERPREF(NAME,pbFlag) _UpdateUserPref(SPI_GET ## NAME, SPI_SET ## NAME, pbFlag) -VOID ApplyTheme(THEME* theme, INT ThemeId) +VOID ApplyScheme(COLOR_SCHEME* scheme, INT SchemeId) { INT i, Result; HKEY hKey; @@ -225,7 +225,7 @@ ICONMETRICS IconMetrics; /* Apply Colors from global variable */ - SetSysColors(NUM_COLORS, g_ColorList, theme->crColor); + SetSysColors(NUM_COLORS, g_ColorList, scheme->crColor); /* Save colors to registry */ Result = RegOpenKeyEx(HKEY_CURRENT_USER, g_CPColors, 0, KEY_ALL_ACCESS, &hKey); @@ -239,9 +239,9 @@ { for (i = 0; i < NUM_COLORS; i++) { - DWORD red = GetRValue(theme->crColor[i]); - DWORD green = GetGValue(theme->crColor[i]); - DWORD blue = GetBValue(theme->crColor[i]); + DWORD red = GetRValue(scheme->crColor[i]); + DWORD green = GetGValue(scheme->crColor[i]); + DWORD blue = GetBValue(scheme->crColor[i]); wsprintf(clText, TEXT("%d %d %d"), red, green, blue); RegSetValueEx(hKey, g_RegColorNames[i], 0, REG_SZ, (BYTE *)clText, (lstrlen(clText) + 1) * sizeof(TCHAR)); } @@ -251,20 +251,20 @@ /* Apply non client metrics */ NonClientMetrics.cbSize = sizeof(NONCLIENTMETRICS); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &NonClientMetrics, 0); - NonClientMetrics.lfCaptionFont = theme->lfFont[FONT_CAPTION]; - NonClientMetrics.lfSmCaptionFont = theme->lfFont[FONT_SMCAPTION]; - NonClientMetrics.lfMenuFont = theme->lfFont[FONT_MENU]; - NonClientMetrics.lfStatusFont = theme->lfFont[FONT_INFO]; - NonClientMetrics.lfMessageFont = theme->lfFont[FONT_DIALOG]; - NonClientMetrics.iBorderWidth = theme->Size[SIZE_BORDER_X]; - NonClientMetrics.iScrollWidth = theme->Size[SIZE_SCROLL_X]; - NonClientMetrics.iScrollHeight = theme->Size[SIZE_SCROLL_Y]; - NonClientMetrics.iCaptionWidth = theme->Size[SIZE_CAPTION_Y]; - NonClientMetrics.iCaptionHeight = theme->Size[SIZE_CAPTION_Y]; - NonClientMetrics.iSmCaptionWidth = theme->Size[SIZE_SMCAPTION_Y]; - NonClientMetrics.iSmCaptionHeight = theme->Size[SIZE_SMCAPTION_Y]; - NonClientMetrics.iMenuWidth = theme->Size[SIZE_MENU_SIZE_X]; - NonClientMetrics.iMenuHeight = theme->Size[SIZE_MENU_Y]; + NonClientMetrics.lfCaptionFont = scheme->lfFont[FONT_CAPTION]; + NonClientMetrics.lfSmCaptionFont = scheme->lfFont[FONT_SMCAPTION]; + NonClientMetrics.lfMenuFont = scheme->lfFont[FONT_MENU]; + NonClientMetrics.lfStatusFont = scheme->lfFont[FONT_INFO]; + NonClientMetrics.lfMessageFont = scheme->lfFont[FONT_DIALOG]; + NonClientMetrics.iBorderWidth = scheme->Size[SIZE_BORDER_X]; + NonClientMetrics.iScrollWidth = scheme->Size[SIZE_SCROLL_X]; + NonClientMetrics.iScrollHeight = scheme->Size[SIZE_SCROLL_Y]; + NonClientMetrics.iCaptionWidth = scheme->Size[SIZE_CAPTION_Y]; + NonClientMetrics.iCaptionHeight = scheme->Size[SIZE_CAPTION_Y]; + NonClientMetrics.iSmCaptionWidth = scheme->Size[SIZE_SMCAPTION_Y]; + NonClientMetrics.iSmCaptionHeight = scheme->Size[SIZE_SMCAPTION_Y]; + NonClientMetrics.iMenuWidth = scheme->Size[SIZE_MENU_SIZE_X]; + NonClientMetrics.iMenuHeight = scheme->Size[SIZE_MENU_Y]; SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &NonClientMetrics, @@ -273,9 +273,9 @@ /* Apply icon metrics */ IconMetrics.cbSize = sizeof(ICONMETRICS); SystemParametersInfo(SPI_GETICONMETRICS, sizeof(ICONMETRICS), &IconMetrics, 0); - IconMetrics.iHorzSpacing = theme->Size[SIZE_ICON_SPC_X]; - IconMetrics.iVertSpacing = theme->Size[SIZE_ICON_SPC_Y]; - IconMetrics.lfFont = theme->lfFont[FONT_ICON]; + IconMetrics.iHorzSpacing = scheme->Size[SIZE_ICON_SPC_X]; + IconMetrics.iVertSpacing = scheme->Size[SIZE_ICON_SPC_Y]; + IconMetrics.lfFont = scheme->lfFont[FONT_ICON]; SystemParametersInfo(SPI_SETICONMETRICS, sizeof(ICONMETRICS), &IconMetrics, @@ -285,44 +285,44 @@ /* FIXME: XP seems to use grayed checkboxes to reflect differences between menu and tooltips settings * Just keep them in sync for now. */ - theme->Effects.bTooltipAnimation = theme->Effects.bMenuAnimation; - theme->Effects.bTooltipFade = theme->Effects.bMenuFade; - SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, theme->Effects.bDragFullWindows, (PVOID)&theme->Effects.bDragFullWindows, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); - SystemParametersInfo(SPI_SETKEYBOARDCUES, 0, IntToPtr(theme->Effects.bKeyboardCues), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); - //UPDATE_USERPREF(ACTIVEWINDOWTRACKING, &theme->Effects.bActiveWindowTracking); - //UPDATE_USERPREF(MENUANIMATION, &theme->Effects.bMenuAnimation); - //UPDATE_USERPREF(COMBOBOXANIMATION, &theme->Effects.bComboBoxAnimation); - //UPDATE_USERPREF(LISTBOXSMOOTHSCROLLING, &theme->Effects.bListBoxSmoothScrolling); - //UPDATE_USERPREF(GRADIENTCAPTIONS, &theme->Effects.bGradientCaptions); - //UPDATE_USERPREF(ACTIVEWNDTRKZORDER, &theme->Effects.bActiveWndTrkZorder); - //UPDATE_USERPREF(HOTTRACKING, &theme->Effects.bHotTracking); - UPDATE_USERPREF(MENUFADE, &theme->Effects.bMenuFade); - //UPDATE_USERPREF(SELECTIONFADE, &theme->Effects.bSelectionFade); - UPDATE_USERPREF(TOOLTIPANIMATION, &theme->Effects.bTooltipAnimation); - UPDATE_USERPREF(TOOLTIPFADE, &theme->Effects.bTooltipFade); - //UPDATE_USERPREF(CURSORSHADOW, &theme->Effects.bCursorShadow); - //UPDATE_USERPREF(UIEFFECTS, &theme->Effects.bUiEffects); - - /* 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); + //UPDATE_USERPREF(ACTIVEWINDOWTRACKING, &scheme->Effects.bActiveWindowTracking); + //UPDATE_USERPREF(MENUANIMATION, &scheme->Effects.bMenuAnimation); + //UPDATE_USERPREF(COMBOBOXANIMATION, &scheme->Effects.bComboBoxAnimation); + //UPDATE_USERPREF(LISTBOXSMOOTHSCROLLING, &scheme->Effects.bListBoxSmoothScrolling); + //UPDATE_USERPREF(GRADIENTCAPTIONS, &scheme->Effects.bGradientCaptions); + //UPDATE_USERPREF(ACTIVEWNDTRKZORDER, &scheme->Effects.bActiveWndTrkZorder); + //UPDATE_USERPREF(HOTTRACKING, &scheme->Effects.bHotTracking); + UPDATE_USERPREF(MENUFADE, &scheme->Effects.bMenuFade); + //UPDATE_USERPREF(SELECTIONFADE, &scheme->Effects.bSelectionFade); + UPDATE_USERPREF(TOOLTIPANIMATION, &scheme->Effects.bTooltipAnimation); + UPDATE_USERPREF(TOOLTIPFADE, &scheme->Effects.bTooltipFade); + //UPDATE_USERPREF(CURSORSHADOW, &scheme->Effects.bCursorShadow); + //UPDATE_USERPREF(UIEFFECTS, &scheme->Effects.bUiEffects); + + /* Save SchemeId */ Result = RegOpenKeyEx(HKEY_CURRENT_USER, g_CPANewSchemes, 0, KEY_ALL_ACCESS, &hKey); if (Result == ERROR_SUCCESS) { - if (ThemeId == -1) + if (SchemeId == -1) clText[0] = TEXT('\0'); else - lstrcpy(clText, g_ThemeTemplates[ThemeId].strKeyName); + lstrcpy(clText, g_ColorSchemes[SchemeId].strKeyName); RegSetValueEx(hKey, g_SelectedStyle, 0, REG_SZ, (BYTE *)clText, (lstrlen(clText) + 1) * sizeof(TCHAR)); RegCloseKey(hKey); } } -BOOL SaveTheme(THEME* theme, LPCTSTR strLegacyName) +BOOL SaveScheme(COLOR_SCHEME* scheme, LPCTSTR strLegacyName) { /* FIXME: implement */ return FALSE; } -INT LoadThemePresetEntries(LPTSTR pszSelectedStyle) +INT LoadSchemePresetEntries(LPTSTR pszSelectedStyle) { HKEY hkNewSchemes, hkScheme, hkSizes, hkSize; FILETIME ftLastWriteTime; @@ -350,27 +350,27 @@ 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++; Modified: branches/GSoC_2011/ThemesSupport/dll/cpl/desk/theme.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/cpl…
============================================================================== --- branches/GSoC_2011/ThemesSupport/dll/cpl/desk/theme.h [iso-8859-1] (original) +++ branches/GSoC_2011/ThemesSupport/dll/cpl/desk/theme.h [iso-8859-1] Mon Aug 15 13:02:06 2011 @@ -67,7 +67,7 @@ INT Size[NUM_SIZES]; BOOL bFlatMenus; EFFECTS Effects; -} THEME; +} COLOR_SCHEME; typedef struct { @@ -75,15 +75,15 @@ TCHAR strSizeName[4]; TCHAR strDisplayName[MAX_TEMPLATENAMELENTGH]; TCHAR strLegacyName[MAX_TEMPLATENAMELENTGH]; -} THEME_PRESET; +} SCHEME_PRESET; extern const TCHAR g_RegColorNames[NUM_COLORS][MAX_COLORNAMELENGTH]; extern const INT g_SizeMetric[NUM_SIZES]; -extern THEME_PRESET g_ThemeTemplates[MAX_TEMPLATES]; +extern SCHEME_PRESET g_ColorSchemes[MAX_TEMPLATES]; /* prototypes for theme.c */ -VOID LoadCurrentTheme(THEME* theme); -BOOL LoadThemeFromReg(THEME* theme, INT ThemeId); -VOID ApplyTheme(THEME* theme, INT ThemeId); -BOOL SaveTheme(THEME* theme, LPCTSTR strLegacyName); -INT LoadThemePresetEntries(LPTSTR pszSelectedStyle); +VOID LoadCurrentScheme(COLOR_SCHEME* scheme); +BOOL LoadSchemeFromReg(COLOR_SCHEME* scheme, INT SchemeId); +VOID ApplyScheme(COLOR_SCHEME* scheme, INT SchemeId); +BOOL SaveScheme(COLOR_SCHEME* scheme, LPCTSTR strLegacyName); +INT LoadSchemePresetEntries(LPTSTR pszSelectedStyle);
13 years, 3 months
1
0
0
0
[gadamopoulos] 53262: [uxtheme] - Properly disable themes when theme hooks are removed - Add WND_CONTEXT a per window struct that will hold several theme specific information. For now it contains o...
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Mon Aug 15 10:22:23 2011 New Revision: 53262 URL:
http://svn.reactos.org/svn/reactos?rev=53262&view=rev
Log: [uxtheme] - Properly disable themes when theme hooks are removed - Add WND_CONTEXT a per window struct that will hold several theme specific information. For now it contains only theme region related info. It will be stored as a window property - Implement destroying WND_CONTEXT for every window when theme hooks are removed or when the window is destroyed - Hook the messages that are sent to dialogs, like they are hooked for normal windows - Hook SetWindowRgn call from user32. When an application calls it, uxtheme will stop setting window region on its own region - Implement setting a custom window region for windows after receiving WM_WINDOWPOSCHANGED message using GetThemeBackgroundRegion Modified: branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/ncthm.h branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/system.c branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/themehooks.c branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/uxthemedll.h Modified: branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/ncthm.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/win…
============================================================================== --- branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/ncthm.h [iso-8859-1] (original) +++ branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/ncthm.h [iso-8859-1] Mon Aug 15 10:22:23 2011 @@ -1,3 +1,10 @@ + +typedef struct _WND_CONTEXT +{ + BOOL HasAppDefinedRgn; + BOOL HasThemeRgn; + BOOL UpdatingRgn; +} WND_CONTEXT, *PWND_CONTEXT; typedef struct _DRAW_CONTEXT { @@ -91,5 +98,9 @@ void ThemeCleanupDrawContext(PDRAW_CONTEXT pcontext); +PWND_CONTEXT +ThemeGetWndContext(HWND hWnd); extern ATOM atWindowTheme; +extern ATOM atWndContrext; + Modified: branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/system.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/win…
============================================================================== --- branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/system.c [iso-8859-1] (original) +++ branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/system.c [iso-8859-1] Mon Aug 15 10:22:23 2011 @@ -34,6 +34,7 @@ #include "uxthemedll.h" #include "msstyles.h" +#include "ncthm.h" #include "wine/debug.h" @@ -64,6 +65,7 @@ ATOM atWindowTheme; static ATOM atSubAppName; static ATOM atSubIdList; +ATOM atWndContrext; static BOOL bThemeActive = FALSE; static WCHAR szCurrentTheme[MAX_PATH]; @@ -148,7 +150,7 @@ * * Set the current active theme from the registry */ -void UXTHEME_LoadTheme(void) +void UXTHEME_LoadTheme(BOOL bLoad) { HKEY hKey; DWORD buffsize; @@ -156,29 +158,36 @@ WCHAR tmp[10]; PTHEME_FILE pt; - /* Get current theme configuration */ - if(!RegOpenKeyW(HKEY_CURRENT_USER, szThemeManager, &hKey)) { - TRACE("Loading theme config\n"); - buffsize = sizeof(tmp)/sizeof(tmp[0]); - if(!RegQueryValueExW(hKey, szThemeActive, NULL, NULL, (LPBYTE)tmp, &buffsize)) { - bThemeActive = (tmp[0] != '0'); + if(bLoad == TRUE) + { + /* Get current theme configuration */ + if(!RegOpenKeyW(HKEY_CURRENT_USER, szThemeManager, &hKey)) { + TRACE("Loading theme config\n"); + buffsize = sizeof(tmp)/sizeof(tmp[0]); + if(!RegQueryValueExW(hKey, szThemeActive, NULL, NULL, (LPBYTE)tmp, &buffsize)) { + bThemeActive = (tmp[0] != '0'); + } + else { + bThemeActive = FALSE; + TRACE("Failed to get ThemeActive: %d\n", GetLastError()); + } + buffsize = sizeof(szCurrentColor)/sizeof(szCurrentColor[0]); + if(RegQueryValueExW(hKey, szColorName, NULL, NULL, (LPBYTE)szCurrentColor, &buffsize)) + szCurrentColor[0] = '\0'; + buffsize = sizeof(szCurrentSize)/sizeof(szCurrentSize[0]); + if(RegQueryValueExW(hKey, szSizeName, NULL, NULL, (LPBYTE)szCurrentSize, &buffsize)) + szCurrentSize[0] = '\0'; + if (query_reg_path (hKey, szDllName, szCurrentTheme)) + szCurrentTheme[0] = '\0'; + RegCloseKey(hKey); } - else { - bThemeActive = FALSE; - TRACE("Failed to get ThemeActive: %d\n", GetLastError()); - } - buffsize = sizeof(szCurrentColor)/sizeof(szCurrentColor[0]); - if(RegQueryValueExW(hKey, szColorName, NULL, NULL, (LPBYTE)szCurrentColor, &buffsize)) - szCurrentColor[0] = '\0'; - buffsize = sizeof(szCurrentSize)/sizeof(szCurrentSize[0]); - if(RegQueryValueExW(hKey, szSizeName, NULL, NULL, (LPBYTE)szCurrentSize, &buffsize)) - szCurrentSize[0] = '\0'; - if (query_reg_path (hKey, szDllName, szCurrentTheme)) - szCurrentTheme[0] = '\0'; - RegCloseKey(hKey); + else + TRACE("Failed to open theme registry key\n"); } else - TRACE("Failed to open theme registry key\n"); + { + bThemeActive = FALSE; + } if(bThemeActive) { /* Make sure the theme requested is actually valid */ @@ -542,6 +551,7 @@ atSubAppName = GlobalAddAtomW(szSubAppName); atSubIdList = GlobalAddAtomW(szSubIdList); atDialogThemeEnabled = GlobalAddAtomW(szDialogThemeEnabled); + atWndContrext = GlobalAddAtomW(L"ux_WndContext"); } /*********************************************************************** Modified: branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/themehooks.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/win…
============================================================================== --- branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/themehooks.c [iso-8859-1] (original) +++ branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/themehooks.c [iso-8859-1] Mon Aug 15 10:22:23 2011 @@ -12,6 +12,9 @@ #include "vfwmsgs.h" #include "uxtheme.h" #include "uxthemedll.h" +#include "ncthm.h" +#include "tmschema.h" + #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(uxtheme); @@ -25,6 +28,163 @@ USERAPIHOOK user32ApiHook; BYTE gabDWPmessages[UAHOWP_MAX_SIZE]; BYTE gabMSGPmessages[UAHOWP_MAX_SIZE]; + + +PWND_CONTEXT ThemeGetWndContext(HWND hWnd) +{ + PWND_CONTEXT pcontext; + + pcontext = (PWND_CONTEXT)GetPropW(hWnd, (LPCWSTR)MAKEINTATOM(atWndContrext)); + if(pcontext == NULL) + { + pcontext = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(WND_CONTEXT)); + if(pcontext == NULL) + { + return NULL; + } + + SetPropW( hWnd, (LPCWSTR)MAKEINTATOM(atWndContrext), pcontext); + } + + return pcontext; +} + +void ThemeDetroyWndContext(HWND hWnd) +{ + PWND_CONTEXT pContext; + DWORD ProcessId; + + /*Do not destroy WND_CONTEXT of a window that belong to another process */ + GetWindowThreadProcessId(hWnd, &ProcessId); + if(ProcessId != GetCurrentProcessId()) + { + return; + } + + pContext = (PWND_CONTEXT)GetPropW(hWnd, (LPCWSTR)MAKEINTATOM(atWndContrext)); + if(pContext == NULL) + { + return; + } + + if(pContext->HasThemeRgn) + { + user32ApiHook.SetWindowRgn(hWnd, 0, TRUE); + } + + HeapFree(GetProcessHeap(), 0, pContext); + + SetPropW( hWnd, (LPCWSTR)MAKEINTATOM(atWndContrext), NULL); +} + +static BOOL CALLBACK ThemeCleanupChildWndContext (HWND hWnd, LPARAM msg) +{ + ThemeDetroyWndContext(hWnd); + return TRUE; +} + +static BOOL CALLBACK ThemeCleanupWndContext(HWND hWnd, LPARAM msg) +{ + if (hWnd == NULL) + { + EnumWindows (ThemeCleanupWndContext, 0); + } + else + { + ThemeDetroyWndContext(hWnd); + EnumChildWindows (hWnd, ThemeCleanupChildWndContext, 0); + } + + return TRUE; +} + +void SetThemeRegion(HWND hWnd, PWND_CONTEXT pcontext) +{ + HTHEME hTheme; + RECT rcWindow; + HRGN hrgn, hrgn1; + int CaptionHeight, iPart; + WINDOWINFO wi; + + if(!IsAppThemed()) + { + if(pcontext->HasThemeRgn) + { + pcontext->HasThemeRgn = FALSE; + user32ApiHook.SetWindowRgn(hWnd, 0, TRUE); + } + return; + } + + wi.cbSize = sizeof(wi); + + GetWindowInfo(hWnd, &wi); + + if((wi.dwStyle & WS_CAPTION)!=WS_CAPTION) + { + return; + } + + /* Get the caption part id */ + if (wi.dwExStyle & WS_EX_TOOLWINDOW) + iPart = WP_SMALLCAPTION; + else if (wi.dwStyle & WS_MAXIMIZE) + iPart = WP_MAXCAPTION; + else + iPart = WP_CAPTION; + + pcontext->HasThemeRgn = TRUE; + + CaptionHeight = wi.cyWindowBorders; + CaptionHeight += GetSystemMetrics(wi.dwExStyle & WS_EX_TOOLWINDOW ? SM_CYSMCAPTION : SM_CYCAPTION ); + + GetWindowRect(hWnd, &rcWindow); + rcWindow.right -= rcWindow.left; + rcWindow.bottom = CaptionHeight; + rcWindow.top = 0; + rcWindow.left = 0; + + hTheme = OpenThemeData (hWnd, L"WINDOW"); + + GetThemeBackgroundRegion(hTheme, 0, iPart, FS_ACTIVE, &rcWindow, &hrgn); + + CloseThemeData(hTheme); + + GetWindowRect(hWnd, &rcWindow); + rcWindow.right -= rcWindow.left; + rcWindow.bottom -= rcWindow.top; + rcWindow.top = CaptionHeight; + rcWindow.left = 0; + hrgn1 = CreateRectRgnIndirect(&rcWindow); + + CombineRgn(hrgn, hrgn, hrgn1, RGN_OR ); + + DeleteObject(hrgn1); + + user32ApiHook.SetWindowRgn(hWnd, hrgn, TRUE); +} + +int OnPostWinPosChanged(HWND hWnd) +{ + PWND_CONTEXT pcontext = ThemeGetWndContext(hWnd); + + if(pcontext && + pcontext->HasAppDefinedRgn == FALSE && + pcontext->UpdatingRgn == FALSE) + { + pcontext->UpdatingRgn = TRUE; + SetThemeRegion(hWnd, pcontext); + pcontext = ThemeGetWndContext(hWnd); + pcontext->UpdatingRgn = FALSE; + } + return 0; +} + +/********************************************************************** + * Hook Functions + */ static LRESULT CALLBACK ThemeDefWindowProcW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) @@ -75,12 +235,50 @@ return 0; } + +static LRESULT CALLBACK +ThemePostWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ret,PDWORD unknown) +{ + switch(Msg) + { + case WM_WINDOWPOSCHANGED: + { + return OnPostWinPosChanged(hWnd); + } + case WM_DESTROY: + { + ThemeDetroyWndContext(hWnd); + return 0; + } + } + + return 0; +} + +int WINAPI ThemeSetWindowRgn(HWND hWnd, HRGN hRgn, BOOL bRedraw) +{ + PWND_CONTEXT pcontext = ThemeGetWndContext(hWnd); + if(pcontext) + { + pcontext->HasAppDefinedRgn = TRUE; + pcontext->HasThemeRgn = FALSE; + } + + return user32ApiHook.SetWindowRgn(hWnd, hRgn, bRedraw); +} + +/********************************************************************** + * Exports + */ + BOOL CALLBACK ThemeInitApiHook(UAPIHK State, PUSERAPIHOOK puah) { /* Sanity checks for the caller */ if (!puah || State != uahLoadInit) { + UXTHEME_LoadTheme(FALSE); + ThemeCleanupWndContext(NULL, 0); return TRUE; } @@ -90,10 +288,17 @@ puah->DefWindowProcA = ThemeDefWindowProcA; puah->DefWindowProcW = ThemeDefWindowProcW; puah->PreWndProc = ThemePreWindowProc; + puah->PostWndProc = ThemePostWindowProc; + puah->PreDefDlgProc = ThemePreWindowProc; + puah->PostDefDlgProc = ThemePostWindowProc; puah->DefWndProcArray.MsgBitArray = gabDWPmessages; puah->DefWndProcArray.Size = UAHOWP_MAX_SIZE; puah->WndProcArray.MsgBitArray = gabMSGPmessages; puah->WndProcArray.Size = UAHOWP_MAX_SIZE; + puah->DlgProcArray.MsgBitArray = gabMSGPmessages; + puah->DlgProcArray.Size = UAHOWP_MAX_SIZE; + + puah->SetWindowRgn = ThemeSetWindowRgn; UAH_HOOK_MESSAGE(puah->DefWndProcArray, WM_NCPAINT); UAH_HOOK_MESSAGE(puah->DefWndProcArray, WM_NCACTIVATE); @@ -130,7 +335,7 @@ UAH_HOOK_MESSAGE(puah->WndProcArray, WM_THEMECHANGED); UAH_HOOK_MESSAGE(puah->WndProcArray, WM_UAHINIT); - UXTHEME_LoadTheme(); + UXTHEME_LoadTheme(TRUE); return TRUE; } @@ -187,8 +392,7 @@ ret = UnregisterUserApiHook(); - if(IsThemeActive()) - UXTHEME_broadcast_msg (NULL, WM_THEMECHANGED); + UXTHEME_broadcast_msg (NULL, WM_THEMECHANGED); return ret; } Modified: branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/uxthemedll.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/win…
============================================================================== --- branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/uxthemedll.h [iso-8859-1] (original) +++ branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/uxthemedll.h [iso-8859-1] Mon Aug 15 10:22:23 2011 @@ -95,7 +95,7 @@ ParseThemeIniFileProc callback, LPVOID lpData); extern void UXTHEME_InitSystem(HINSTANCE hInst); -extern void UXTHEME_LoadTheme(void); +extern void UXTHEME_LoadTheme(BOOL bLoad); extern BOOL CALLBACK UXTHEME_broadcast_msg (HWND hWnd, LPARAM msg); /* No alpha blending */
13 years, 3 months
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
50
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
41
42
43
44
45
46
47
48
49
50
Results per page:
10
25
50
100
200