ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2014
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
14 participants
233 discussions
Start a n
N
ew thread
[jimtabor] 62535: [Usp10] - Sync to Wine 1.7.14.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Mar 20 02:07:55 2014 New Revision: 62535 URL:
http://svn.reactos.org/svn/reactos?rev=62535&view=rev
Log: [Usp10] - Sync to Wine 1.7.14. Modified: trunk/reactos/dll/win32/usp10/bidi.c trunk/reactos/dll/win32/usp10/indicsyllable.c trunk/reactos/dll/win32/usp10/linebreak.c trunk/reactos/dll/win32/usp10/shaping.c trunk/reactos/dll/win32/usp10/usp10.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/usp10/bidi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/usp10/bidi.c?rev…
============================================================================== --- trunk/reactos/dll/win32/usp10/bidi.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/usp10/bidi.c [iso-8859-1] Thu Mar 20 02:07:55 2014 @@ -41,12 +41,16 @@ * has been modified. */ +#include <windef.h> + +#include <wine/list.h> + #include "usp10_internal.h" WINE_DEFAULT_DEBUG_CHANNEL(bidi); #define ASSERT(x) do { if (!(x)) FIXME("assert failed: %s\n", #x); } while(0) -#define MAX_LEVEL 61 +#define MAX_DEPTH 125 /* HELPER FUNCTIONS AND DECLARATIONS */ @@ -64,7 +68,7 @@ enum directions { /* input types */ - /* ON MUST be zero, code relies on ON = N = 0 */ + /* ON MUST be zero, code relies on ON = NI = 0 */ ON = 0, /* Other Neutral */ L, /* Left Letter */ R, /* Right Letter */ @@ -91,11 +95,52 @@ LRE, PDF, + LRI, /* Isolate formatting characters new with 6.3 */ + RLI, + FSI, + PDI, + /* resolved types, also resolved directions */ - N = ON, /* alias, where ON, WS and S are treated the same */ + NI = ON, /* alias, where ON, WS, S and Isolates are treated the same */ }; +static const char debug_type[][4] = +{ + "ON", /* Other Neutral */ + "L", /* Left Letter */ + "R", /* Right Letter */ + "AN", /* Arabic Number */ + "EN", /* European Number */ + "AL", /* Arabic Letter (Right-to-left) */ + "NSM", /* Non-spacing Mark */ + "CS", /* Common Separator */ + "ES", /* European Separator */ + "ET", /* European Terminator (post/prefix e.g. $ and %) */ + "BN", /* Boundary neutral (type of RLE etc after explicit levels) */ + "S", /* Segment Separator (TAB) // used only in L1 */ + "WS", /* White space // used only in L1 */ + "B", /* Paragraph Separator (aka as PS) */ + "RLO", /* these are used only in X1-X9 */ + "RLE", + "LRO", + "LRE", + "PDF", + "LRI", /* Isolate formatting characters new with 6.3 */ + "RLI", + "FSI", + "PDI", +}; + /* HELPER FUNCTIONS */ + +static inline void dump_types(const char* header, WORD *types, int start, int end) +{ + int i; + TRACE("%s:",header); + for (i = start; i< end; i++) + TRACE(" %s",debug_type[types[i]]); + TRACE("\n"); +} /* Convert the libwine information to the direction enum */ static void classify(LPCWSTR lpString, WORD *chartype, DWORD uCount, const SCRIPT_CONTROL *c) @@ -132,7 +177,7 @@ switch (lpString[i]) { case '-': - case '+': chartype[i] = N; break; + case '+': chartype[i] = NI; break; case '/': chartype[i] = CS; break; } break; @@ -144,20 +189,13 @@ case 0x202C: chartype[i] = PDF; break; case 0x202D: chartype[i] = LRO; break; case 0x202E: chartype[i] = RLO; break; + case 0x2066: chartype[i] = LRI; break; + case 0x2067: chartype[i] = RLI; break; + case 0x2068: chartype[i] = FSI; break; + case 0x2069: chartype[i] = PDI; break; } break; } - } -} - -/* Set a run of cval values at locations all prior to, but not including */ -/* iStart, to the new value nval. */ -static void SetDeferredRun(WORD *pval, int cval, int iStart, int nval) -{ - int i = iStart - 1; - for (; i >= iStart - cval; i--) - { - pval[i] = nval; } } @@ -197,233 +235,269 @@ the outermost call. The nesting counter counts the recursion depth and not the embedding level. ------------------------------------------------------------------------*/ - -static int resolveExplicit(int level, int dir, WORD *pcls, WORD *plevel, int cch, int nNest) -{ - /* always called with a valid nesting level - nesting levels are != embedding levels */ - int nLastValid = nNest; - int ich = 0; - - /* check input values */ - ASSERT(nNest >= 0 && level >= 0 && level <= MAX_LEVEL); - - /* process the text */ - for (; ich < cch; ich++) - { - WORD cls = pcls[ich]; - switch (cls) - { - case LRO: - case LRE: - nNest++; - if (GreaterEven(level) <= MAX_LEVEL - (cls == LRO ? 2 : 0)) - { - plevel[ich] = GreaterEven(level); - pcls[ich] = BN; - ich += resolveExplicit(plevel[ich], (cls == LRE ? N : L), - &pcls[ich+1], &plevel[ich+1], - cch - (ich+1), nNest); - nNest--; - continue; - } - cls = pcls[ich] = BN; - break; - - case RLO: - case RLE: - nNest++; - if (GreaterOdd(level) <= MAX_LEVEL - (cls == RLO ? 2 : 0)) - { - plevel[ich] = GreaterOdd(level); - pcls[ich] = BN; - ich += resolveExplicit(plevel[ich], (cls == RLE ? N : R), - &pcls[ich+1], &plevel[ich+1], - cch - (ich+1), nNest); - nNest--; - continue; - } - cls = pcls[ich] = BN; - break; - - case PDF: - cls = pcls[ich] = BN; - if (nNest) - { - if (nLastValid < nNest) - { - nNest--; +typedef struct tagStackItem { + int level; + int override; + BOOL isolate; +} StackItem; + +#define push_stack(l,o,i) \ + do { stack_top--; \ + stack[stack_top].level = l; \ + stack[stack_top].override = o; \ + stack[stack_top].isolate = i;} while(0) + +#define pop_stack() do { stack_top++; } while(0) + +#define valid_level(x) (x <= MAX_DEPTH && overflow_isolate_count == 0 && overflow_embedding_count == 0) + +static void resolveExplicit(int level, WORD *pclass, WORD *poutLevel, int count) +{ + /* X1 */ + int overflow_isolate_count = 0; + int overflow_embedding_count = 0; + int valid_isolate_count = 0; + int i; + + StackItem stack[MAX_DEPTH+2]; + int stack_top = MAX_DEPTH+1; + + stack[stack_top].level = level; + stack[stack_top].override = NI; + stack[stack_top].isolate = FALSE; + + for (i = 0; i < count; i++) + { + /* X2 */ + if (pclass[i] == RLE) + { + int least_odd = GreaterOdd(stack[stack_top].level); + poutLevel[i] = stack[stack_top].level; + if (valid_level(least_odd)) + push_stack(least_odd, NI, FALSE); + else if (overflow_isolate_count == 0) + overflow_embedding_count++; + } + /* X3 */ + else if (pclass[i] == LRE) + { + int least_even = GreaterEven(stack[stack_top].level); + poutLevel[i] = stack[stack_top].level; + if (valid_level(least_even)) + push_stack(least_even, NI, FALSE); + else if (overflow_isolate_count == 0) + overflow_embedding_count++; + } + /* X4 */ + else if (pclass[i] == RLO) + { + int least_odd = GreaterOdd(stack[stack_top].level); + poutLevel[i] = stack[stack_top].level; + if (valid_level(least_odd)) + push_stack(least_odd, R, FALSE); + else if (overflow_isolate_count == 0) + overflow_embedding_count++; + } + /* X5 */ + else if (pclass[i] == LRO) + { + int least_even = GreaterEven(stack[stack_top].level); + poutLevel[i] = stack[stack_top].level; + if (valid_level(least_even)) + push_stack(least_even, L, FALSE); + else if (overflow_isolate_count == 0) + overflow_embedding_count++; + } + /* X5a */ + else if (pclass[i] == RLI) + { + int least_odd = GreaterOdd(stack[stack_top].level); + poutLevel[i] = stack[stack_top].level; + if (valid_level(least_odd)) + { + valid_isolate_count++; + push_stack(least_odd, NI, TRUE); + } + else + overflow_isolate_count++; + } + /* X5b */ + else if (pclass[i] == LRI) + { + int least_even = GreaterEven(stack[stack_top].level); + poutLevel[i] = stack[stack_top].level; + if (valid_level(least_even)) + { + valid_isolate_count++; + push_stack(least_even, NI, TRUE); + } + else + overflow_isolate_count++; + } + /* X5c */ + else if (pclass[i] == FSI) + { + int j; + int new_level = 0; + int skipping = 0; + poutLevel[i] = stack[stack_top].level; + for (j = i+1; j < count; j++) + { + if (pclass[j] == LRI || pclass[j] == RLI || pclass[j] == FSI) + { + skipping++; + continue; + } + else if (pclass[j] == PDI) + { + if (skipping) + skipping --; + else + break; + continue; + } + + if (skipping) continue; + + if (pclass[j] == L) + { + new_level = 0; + break; + } + else if (pclass[j] == R || pclass[j] == AL) + { + new_level = 1; + break; + } + } + if (odd(new_level)) + { + int least_odd = GreaterOdd(stack[stack_top].level); + if (valid_level(least_odd)) + { + valid_isolate_count++; + push_stack(least_odd, NI, TRUE); } else - { - cch = ich; /* break the loop, but complete body */ - } - } - } - - /* Apply the override */ - if (dir != N) - { - cls = dir; - } - plevel[ich] = level; - if (pcls[ich] != BN) - pcls[ich] = cls; - } - - return ich; -} - -/* RESOLVE WEAK TYPES */ - -enum states /* possible states */ -{ - xa, /* Arabic letter */ - xr, /* right letter */ - xl, /* left letter */ - - ao, /* Arabic lett. foll by ON */ - ro, /* right lett. foll by ON */ - lo, /* left lett. foll by ON */ - - rt, /* ET following R */ - lt, /* ET following L */ - - cn, /* EN, AN following AL */ - ra, /* Arabic number foll R */ - re, /* European number foll R */ - la, /* Arabic number foll L */ - le, /* European number foll L */ - - ac, /* CS following cn */ - rc, /* CS following ra */ - rs, /* CS,ES following re */ - lc, /* CS following la */ - ls, /* CS,ES following le */ - - ret, /* ET following re */ - let, /* ET following le */ -} ; - -static const int stateWeak[][10] = -{ - /* N, L, R, AN, EN, AL,NSM, CS, ES, ET */ -/*xa*/ { ao, xl, xr, cn, cn, xa, xa, ao, ao, ao }, /* Arabic letter */ -/*xr*/ { ro, xl, xr, ra, re, xa, xr, ro, ro, rt }, /* right letter */ -/*xl*/ { lo, xl, xr, la, le, xa, xl, lo, lo, lt }, /* left letter */ - -/*ao*/ { ao, xl, xr, cn, cn, xa, ao, ao, ao, ao }, /* Arabic lett. foll by ON*/ -/*ro*/ { ro, xl, xr, ra, re, xa, ro, ro, ro, rt }, /* right lett. foll by ON */ -/*lo*/ { lo, xl, xr, la, le, xa, lo, lo, lo, lt }, /* left lett. foll by ON */ - -/*rt*/ { ro, xl, xr, ra, re, xa, rt, ro, ro, rt }, /* ET following R */ -/*lt*/ { lo, xl, xr, la, le, xa, lt, lo, lo, lt }, /* ET following L */ - -/*cn*/ { ao, xl, xr, cn, cn, xa, cn, ac, ao, ao }, /* EN, AN following AL */ -/*ra*/ { ro, xl, xr, ra, re, xa, ra, rc, ro, rt }, /* Arabic number foll R */ -/*re*/ { ro, xl, xr, ra, re, xa, re, rs, rs,ret }, /* European number foll R */ -/*la*/ { lo, xl, xr, la, le, xa, la, lc, lo, lt }, /* Arabic number foll L */ -/*le*/ { lo, xl, xr, la, le, xa, le, ls, ls,let }, /* European number foll L */ - -/*ac*/ { ao, xl, xr, cn, cn, xa, ao, ao, ao, ao }, /* CS following cn */ -/*rc*/ { ro, xl, xr, ra, re, xa, ro, ro, ro, rt }, /* CS following ra */ -/*rs*/ { ro, xl, xr, ra, re, xa, ro, ro, ro, rt }, /* CS,ES following re */ -/*lc*/ { lo, xl, xr, la, le, xa, lo, lo, lo, lt }, /* CS following la */ -/*ls*/ { lo, xl, xr, la, le, xa, lo, lo, lo, lt }, /* CS,ES following le */ - -/*ret*/{ ro, xl, xr, ra, re, xa,ret, ro, ro,ret }, /* ET following re */ -/*let*/{ lo, xl, xr, la, le, xa,let, lo, lo,let }, /* ET following le */ -}; - -enum actions /* possible actions */ -{ - /* primitives */ - IX = 0x100, /* increment */ - XX = 0xF, /* no-op */ - - /* actions */ - xxx = (XX << 4) + XX, /* no-op */ - xIx = IX + xxx, /* increment run */ - xxN = (XX << 4) + ON, /* set current to N */ - xxE = (XX << 4) + EN, /* set current to EN */ - xxA = (XX << 4) + AN, /* set current to AN */ - xxR = (XX << 4) + R, /* set current to R */ - xxL = (XX << 4) + L, /* set current to L */ - Nxx = (ON << 4) + 0xF, /* set run to neutral */ - Axx = (AN << 4) + 0xF, /* set run to AN */ - ExE = (EN << 4) + EN, /* set run to EN, set current to EN */ - NIx = (ON << 4) + 0xF + IX, /* set run to N, increment */ - NxN = (ON << 4) + ON, /* set run to N, set current to N */ - NxR = (ON << 4) + R, /* set run to N, set current to R */ - NxE = (ON << 4) + EN, /* set run to N, set current to EN */ - - AxA = (AN << 4) + AN, /* set run to AN, set current to AN */ - NxL = (ON << 4) + L, /* set run to N, set current to L */ - LxL = (L << 4) + L, /* set run to L, set current to L */ -} ; - -static const int actionWeak[][10] = -{ - /* N, L, R, AN, EN, AL, NSM, CS, ES, ET */ -/*xa*/ { xxx, xxx, xxx, xxx, xxA, xxR, xxR, xxN, xxN, xxN }, /* Arabic letter */ -/*xr*/ { xxx, xxx, xxx, xxx, xxE, xxR, xxR, xxN, xxN, xIx }, /* right letter */ -/*xl*/ { xxx, xxx, xxx, xxx, xxL, xxR, xxL, xxN, xxN, xIx }, /* left letter */ - -/*ao*/ { xxx, xxx, xxx, xxx, xxA, xxR, xxN, xxN, xxN, xxN }, /* Arabic lett. foll by ON */ -/*ro*/ { xxx, xxx, xxx, xxx, xxE, xxR, xxN, xxN, xxN, xIx }, /* right lett. foll by ON */ -/*lo*/ { xxx, xxx, xxx, xxx, xxL, xxR, xxN, xxN, xxN, xIx }, /* left lett. foll by ON */ - -/*rt*/ { Nxx, Nxx, Nxx, Nxx, ExE, NxR, xIx, NxN, NxN, xIx }, /* ET following R */ -/*lt*/ { Nxx, Nxx, Nxx, Nxx, LxL, NxR, xIx, NxN, NxN, xIx }, /* ET following L */ - -/*cn*/ { xxx, xxx, xxx, xxx, xxA, xxR, xxA, xIx, xxN, xxN }, /* EN, AN following AL */ -/*ra*/ { xxx, xxx, xxx, xxx, xxE, xxR, xxA, xIx, xxN, xIx }, /* Arabic number foll R */ -/*re*/ { xxx, xxx, xxx, xxx, xxE, xxR, xxE, xIx, xIx, xxE }, /* European number foll R */ -/*la*/ { xxx, xxx, xxx, xxx, xxL, xxR, xxA, xIx, xxN, xIx }, /* Arabic number foll L */ -/*le*/ { xxx, xxx, xxx, xxx, xxL, xxR, xxL, xIx, xIx, xxL }, /* European number foll L */ - -/*ac*/ { Nxx, Nxx, Nxx, Axx, AxA, NxR, NxN, NxN, NxN, NxN }, /* CS following cn */ -/*rc*/ { Nxx, Nxx, Nxx, Axx, NxE, NxR, NxN, NxN, NxN, NIx }, /* CS following ra */ -/*rs*/ { Nxx, Nxx, Nxx, Nxx, ExE, NxR, NxN, NxN, NxN, NIx }, /* CS,ES following re */ -/*lc*/ { Nxx, Nxx, Nxx, Axx, NxL, NxR, NxN, NxN, NxN, NIx }, /* CS following la */ -/*ls*/ { Nxx, Nxx, Nxx, Nxx, LxL, NxR, NxN, NxN, NxN, NIx }, /* CS,ES following le */ - -/*ret*/{ xxx, xxx, xxx, xxx, xxE, xxR, xxE, xxN, xxN, xxE }, /* ET following re */ -/*let*/{ xxx, xxx, xxx, xxx, xxL, xxR, xxL, xxN, xxN, xxL }, /* ET following le */ -}; - -static int GetDeferredType(int action) -{ - return (action >> 4) & 0xF; -} - -static int GetResolvedType(int action) -{ - return action & 0xF; -} - -/* Note on action table: - - States can be of two kinds: - - Immediate Resolution State, where each input token - is resolved as soon as it is seen. These states have - only single action codes (xxN) or the no-op (xxx) - for static input tokens. - - Deferred Resolution State, where input tokens either - either extend the run (xIx) or resolve its Type (e.g. Nxx). - - Input classes are of three kinds - - Static Input Token, where the class of the token remains - unchanged on output (AN, L, N, R) - - Replaced Input Token, where the class of the token is - always replaced on output (AL, BN, NSM, CS, ES, ET) - - Conditional Input Token, where the class of the token is - changed on output in some, but not all, cases (EN) - - Where tokens are subject to change, a double action - (e.g. NxA, or NxN) is _required_ after deferred states, - resolving both the deferred state and changing the current token. -*/ + overflow_isolate_count++; + } + else + { + int least_even = GreaterEven(stack[stack_top].level); + if (valid_level(least_even)) + { + valid_isolate_count++; + push_stack(least_even, NI, TRUE); + } + else + overflow_isolate_count++; + } + } + /* X6 */ + else if (pclass[i] != B && pclass[i] != BN && pclass[i] != PDI && pclass[i] != PDF) + { + poutLevel[i] = stack[stack_top].level; + if (stack[stack_top].override != NI) + pclass[i] = stack[stack_top].override; + } + /* X6a */ + else if (pclass[i] == PDI) + { + if (overflow_isolate_count) overflow_isolate_count--; + else if (!valid_isolate_count) {/* do nothing */} + else + { + overflow_embedding_count = 0; + while (!stack[stack_top].isolate) pop_stack(); + pop_stack(); + valid_isolate_count --; + } + poutLevel[i] = stack[stack_top].level; + } + /* X7 */ + else if (pclass[i] == PDF) + { + poutLevel[i] = stack[stack_top].level; + if (overflow_isolate_count) {/* do nothing */} + else if (overflow_embedding_count) overflow_embedding_count--; + else if (!stack[stack_top].isolate && stack_top < (MAX_DEPTH+1)) + pop_stack(); + } + /* X8: Nothing */ + } + /* X9: Based on 5.2 Retaining Explicit Formatting Characters */ + for (i = 0; i < count ; i++) + if (pclass[i] == RLE || pclass[i] == LRE || pclass[i] == RLO || pclass[i] == LRO || pclass[i] == PDF) + pclass[i] = BN; +} + +static inline int previousValidChar(const WORD *pcls, int index, int back_fence) +{ + if (index == -1 || index == back_fence) return index; + index --; + while (index > back_fence && pcls[index] == BN) index --; + return index; +} + +static inline int nextValidChar(const WORD *pcls, int index, int front_fence) +{ + if (index == front_fence) return index; + index ++; + while (index < front_fence && pcls[index] == BN) index ++; + return index; +} + +typedef struct tagRun +{ + int start; + int end; + WORD e; +} Run; + +typedef struct tagIsolatedRun +{ + struct list entry; + int length; + WORD sos; + WORD eos; + WORD e; + + WORD *ppcls[1]; +} IsolatedRun; + +static inline int iso_nextValidChar(IsolatedRun *iso_run, int index) +{ + if (index >= (iso_run->length-1)) return -1; + index ++; + while (index < iso_run->length && *iso_run->ppcls[index] == BN) index++; + if (index == iso_run->length) return -1; + return index; +} + +static inline int iso_previousValidChar(IsolatedRun *iso_run, int index) +{ + + if (index <= 0) return -1; + index --; + while (index > -1 && *iso_run->ppcls[index] == BN) index--; + return index; +} + +static inline int iso_previousChar(IsolatedRun *iso_run, int index) +{ + if (index <= 0) return -1; + return index --; +} + +static inline void iso_dump_types(const char* header, IsolatedRun *iso_run) +{ + int i; + TRACE("%s:",header); + TRACE("[ "); + for (i = 0; i < iso_run->length; i++) + TRACE(" %s",debug_type[*iso_run->ppcls[i]]); + TRACE(" ]\n"); +} /*------------------------------------------------------------------------ Function: resolveWeak @@ -440,178 +514,142 @@ Note: On input only these directional classes are expected AL, HL, R, L, ON, BN, NSM, AN, EN, ES, ET, CS, ------------------------------------------------------------------------*/ -static void resolveWeak(int baselevel, WORD *pcls, WORD *plevel, int cch) -{ - int state = odd(baselevel) ? xr : xl; - int cls; - - int level = baselevel; - int action, clsRun, clsNew; - int cchRun = 0; - int ich = 0; - - for (; ich < cch; ich++) - { - /* ignore boundary neutrals */ - if (pcls[ich] == BN) - { - /* must flatten levels unless at a level change; */ - plevel[ich] = level; - - /* lookahead for level changes */ - if (ich + 1 == cch && level != baselevel) - { - /* have to fixup last BN before end of the loop, since - * its fix-upped value will be needed below the assert */ - pcls[ich] = EmbeddingDirection(level); - } - else if (ich + 1 < cch && level != plevel[ich+1] && pcls[ich+1] != BN) - { - /* fixup LAST BN in front / after a level run to make - * it act like the SOR/EOR in rule X10 */ - int newlevel = plevel[ich+1]; - if (level > newlevel) { - newlevel = level; - } - plevel[ich] = newlevel; - - /* must match assigned level */ - pcls[ich] = EmbeddingDirection(newlevel); - level = plevel[ich+1]; - } + +static void resolveWeak(IsolatedRun * iso_run) +{ + int i; + + /* W1 */ + for (i=0; i < iso_run->length; i++) + { + if (*iso_run->ppcls[i] == NSM) + { + int j = iso_previousValidChar(iso_run, i); + if (j == -1) + *iso_run->ppcls[i] = iso_run->sos; + else if (*iso_run->ppcls[j] >= LRI) + *iso_run->ppcls[i] = ON; else - { - /* don't interrupt runs */ - if (cchRun) - { - cchRun++; - } - continue; - } - } - - ASSERT(pcls[ich] <= BN); - cls = pcls[ich]; - - action = actionWeak[state][cls]; - - /* resolve the directionality for deferred runs */ - clsRun = GetDeferredType(action); - if (clsRun != XX) - { - SetDeferredRun(pcls, cchRun, ich, clsRun); - cchRun = 0; - } - - /* resolve the directionality class at the current location */ - clsNew = GetResolvedType(action); - if (clsNew != XX) - pcls[ich] = clsNew; - - /* increment a deferred run */ - if (IX & action) - cchRun++; - - state = stateWeak[state][cls]; - } - - /* resolve any deferred runs - * use the direction of the current level to emulate PDF */ - cls = EmbeddingDirection(level); - - /* resolve the directionality for deferred runs */ - clsRun = GetDeferredType(actionWeak[state][cls]); - if (clsRun != XX) - SetDeferredRun(pcls, cchRun, ich, clsRun); -} - -/* RESOLVE NEUTRAL TYPES */ - -/* action values */ -enum neutralactions -{ - /* action to resolve previous input */ - nL = L, /* resolve EN to L */ - En = 3 << 4, /* resolve neutrals run to embedding level direction */ - Rn = R << 4, /* resolve neutrals run to strong right */ - Ln = L << 4, /* resolved neutrals run to strong left */ - In = (1<<8), /* increment count of deferred neutrals */ - LnL = (1<<4)+L, /* set run and EN to L */ -}; - -static int GetDeferredNeutrals(int action, int level) -{ - action = (action >> 4) & 0xF; - if (action == (En >> 4)) - return EmbeddingDirection(level); - else - return action; -} - -static int GetResolvedNeutrals(int action) -{ - action = action & 0xF; - if (action == In) - return 0; - else - return action; -} - -/* state values */ -enum resolvestates -{ - /* new temporary class */ - r, /* R and characters resolved to R */ - l, /* L and characters resolved to L */ - rn, /* N preceded by right */ - ln, /* N preceded by left */ - a, /* AN preceded by left (the abbreviation 'la' is used up above) */ - na, /* N preceded by a */ -} ; - - -/*------------------------------------------------------------------------ - Notes: - - By rule W7, whenever a EN is 'dominated' by an L (including start of - run with embedding direction = L) it is resolved to, and further treated - as L. - - This leads to the need for 'a' and 'na' states. -------------------------------------------------------------------------*/ - -static const int actionNeutrals[][5] = -{ -/* N, L, R, AN, EN = cls */ - { In, 0, 0, 0, 0 }, /* r right */ - { In, 0, 0, 0, L }, /* l left */ - - { In, En, Rn, Rn, Rn }, /* rn N preceded by right */ - { In, Ln, En, En, LnL}, /* ln N preceded by left */ - - { In, 0, 0, 0, L }, /* a AN preceded by left */ - { In, En, Rn, Rn, En }, /* na N preceded by a */ -} ; - -static const int stateNeutrals[][5] = -{ -/* N, L, R, AN, EN */ - { rn, l, r, r, r }, /* r right */ - { ln, l, r, a, l }, /* l left */ - - { rn, l, r, r, r }, /* rn N preceded by right */ - { ln, l, r, a, l }, /* ln N preceded by left */ - - { na, l, r, a, l }, /* a AN preceded by left */ - { na, l, r, a, l }, /* na N preceded by la */ -} ; + *iso_run->ppcls[i] = *iso_run->ppcls[j]; + } + } + + /* W2 */ + for (i = 0; i < iso_run->length; i++) + { + if (*iso_run->ppcls[i] == EN) + { + int j = iso_previousValidChar(iso_run, i); + while (j > -1) + { + if (*iso_run->ppcls[j] == R || *iso_run->ppcls[j] == L || *iso_run->ppcls[j] == AL) + { + if (*iso_run->ppcls[j] == AL) + *iso_run->ppcls[i] = AN; + break; + } + j = iso_previousValidChar(iso_run, j); + } + } + } + + /* W3 */ + for (i = 0; i < iso_run->length; i++) + { + if (*iso_run->ppcls[i] == AL) + *iso_run->ppcls[i] = R; + } + + /* W4 */ + for (i = 0; i < iso_run->length; i++) + { + if (*iso_run->ppcls[i] == ES) + { + int b = iso_previousValidChar(iso_run, i); + int f = iso_nextValidChar(iso_run, i); + + if (b > -1 && f > -1 && *iso_run->ppcls[b] == EN && *iso_run->ppcls[f] == EN) + *iso_run->ppcls[i] = EN; + } + else if (*iso_run->ppcls[i] == CS) + { + int b = iso_previousValidChar(iso_run, i); + int f = iso_nextValidChar(iso_run, i); + + if (b > -1 && f > -1 && *iso_run->ppcls[b] == EN && *iso_run->ppcls[f] == EN) + *iso_run->ppcls[i] = EN; + else if (b > -1 && f > -1 && *iso_run->ppcls[b] == AN && *iso_run->ppcls[f] == AN) + *iso_run->ppcls[i] = AN; + } + } + + /* W5 */ + for (i = 0; i < iso_run->length; i++) + { + if (*iso_run->ppcls[i] == ET) + { + int j; + for (j = i-1 ; j > -1; j--) + { + if (*iso_run->ppcls[j] == BN) continue; + if (*iso_run->ppcls[j] == ET) continue; + else if (*iso_run->ppcls[j] == EN) *iso_run->ppcls[i] = EN; + else break; + } + if (*iso_run->ppcls[i] == ET) + { + for (j = i+1; j < iso_run->length; j++) + { + if (*iso_run->ppcls[j] == BN) continue; + if (*iso_run->ppcls[j] == ET) continue; + else if (*iso_run->ppcls[j] == EN) *iso_run->ppcls[i] = EN; + else break; + } + } + } + } + + /* W6 */ + for (i = 0; i < iso_run->length; i++) + { + if (*iso_run->ppcls[i] == ET || *iso_run->ppcls[i] == ES || *iso_run->ppcls[i] == CS || *iso_run->ppcls[i] == ON) + { + int b = i-1; + int f = i+1; + if (b > -1 && *iso_run->ppcls[b] == BN) + *iso_run->ppcls[b] = ON; + if (f < iso_run->length && *iso_run->ppcls[f] == BN) + *iso_run->ppcls[f] = ON; + + *iso_run->ppcls[i] = ON; + } + } + + /* W7 */ + for (i = 0; i < iso_run->length; i++) + { + if (*iso_run->ppcls[i] == EN) + { + int j; + for (j = iso_previousValidChar(iso_run, i); j > -1; j = iso_previousValidChar(iso_run, j)) + if (*iso_run->ppcls[j] == R || *iso_run->ppcls[j] == L) + { + if (*iso_run->ppcls[j] == L) + *iso_run->ppcls[i] = L; + break; + } + if (iso_run->sos == L && j == -1) + *iso_run->ppcls[i] = L; + } + } +} /*------------------------------------------------------------------------ Function: resolveNeutrals Resolves the directionality of neutral character types. - Implements rules W7, N1 and N2 of the Unicode Bidi Algorithm. + Implements rules N1 and N2 of the Unicode Bidi Algorithm. Input: Array of embedding levels Character count @@ -620,69 +658,94 @@ In/Out: Array of directional classes Note: On input only these directional classes are expected - R, L, N, AN, EN and BN + R, L, NI, AN, EN and BN W8 resolves a number of ENs to L ------------------------------------------------------------------------*/ -static void resolveNeutrals(int baselevel, WORD *pcls, const WORD *plevel, int cch) -{ - /* the state at the start of text depends on the base level */ - int state = odd(baselevel) ? r : l; - int cls; - - int cchRun = 0; - int level = baselevel; - - int action, clsRun, clsNew; - int ich = 0; - for (; ich < cch; ich++) - { - /* ignore boundary neutrals */ - if (pcls[ich] == BN) - { - /* include in the count for a deferred run */ - if (cchRun) - cchRun++; - - /* skip any further processing */ - continue; - } - - ASSERT(pcls[ich] < 5); /* "Only N, L, R, AN, EN are allowed" */ - cls = pcls[ich]; - - action = actionNeutrals[state][cls]; - - /* resolve the directionality for deferred runs */ - clsRun = GetDeferredNeutrals(action, level); - if (clsRun != N) - { - SetDeferredRun(pcls, cchRun, ich, clsRun); - cchRun = 0; - } - - /* resolve the directionality class at the current location */ - clsNew = GetResolvedNeutrals(action); - if (clsNew != N) - pcls[ich] = clsNew; - - if (In & action) - cchRun++; - - state = stateNeutrals[state][cls]; - level = plevel[ich]; - } - - /* resolve any deferred runs */ - cls = EmbeddingDirection(level); /* eor has type of current level */ - - /* resolve the directionality for deferred runs */ - clsRun = GetDeferredNeutrals(actionNeutrals[state][cls], level); - if (clsRun != N) - SetDeferredRun(pcls, cchRun, ich, clsRun); -} - -/* RESOLVE IMPLICIT */ +static void resolveNeutrals(IsolatedRun *iso_run) +{ + int i; + + /* Translate isolates into NI */ + for (i = 0; i < iso_run->length; i++) + { + if (*iso_run->ppcls[i] >= LRI) + *iso_run->ppcls[i] = NI; + + switch(*iso_run->ppcls[i]) + { + case B: + case S: + case WS: *iso_run->ppcls[i] = NI; + } + + ASSERT(*iso_run->ppcls[i] < 5 || *iso_run->ppcls[i] == BN); /* "Only NI, L, R, AN, EN and BN are allowed" */ + } + + /* N0: Skipping bracketed pairs for now */ + + /* N1 */ + for (i = 0; i < iso_run->length; i++) + { + WORD l,r; + + if (*iso_run->ppcls[i] == NI) + { + int j; + int b = iso_previousValidChar(iso_run, i); + + if (b == -1) + { + l = iso_run->sos; + b = 0; + } + else + { + if (*iso_run->ppcls[b] == R || *iso_run->ppcls[b] == AN || *iso_run->ppcls[b] == EN) + l = R; + else if (*iso_run->ppcls[b] == L) + l = L; + else /* No string type */ + continue; + } + j = iso_nextValidChar(iso_run, i); + while (j > -1 && *iso_run->ppcls[j] == NI) j = iso_nextValidChar(iso_run, j); + + if (j == -1) + { + r = iso_run->eos; + j = iso_run->length; + } + else if (*iso_run->ppcls[j] == R || *iso_run->ppcls[j] == AN || *iso_run->ppcls[j] == EN) + r = R; + else if (*iso_run->ppcls[j] == L) + r = L; + else /* No string type */ + continue; + + if (r == l) + { + for (b = i; b < j && b < iso_run->length; b++) + *iso_run->ppcls[b] = r; + } + } + } + + /* N2 */ + for (i = 0; i < iso_run->length; i++) + { + if (*iso_run->ppcls[i] == NI) + { + int b = i-1; + int f = i+1; + *iso_run->ppcls[i] = EmbeddingDirection(iso_run->e); + if (b > -1 && *iso_run->ppcls[b] == BN) + *iso_run->ppcls[b] = EmbeddingDirection(iso_run->e); + if (f < iso_run->length && *iso_run->ppcls[f] == BN) + *iso_run->ppcls[f] = EmbeddingDirection(iso_run->e); + } + } +} /*------------------------------------------------------------------------ Function: resolveImplicit @@ -700,29 +763,178 @@ Accepted subset of direction classes R, L, AN, EN ------------------------------------------------------------------------*/ -static const WORD addLevel[][4] = -{ - /* L, R, AN, EN */ -/* even */ { 0, 1, 2, 2, }, -/* odd */ { 1, 0, 1, 1, } - -}; - -static void resolveImplicit(const WORD * pcls, WORD *plevel, int cch) -{ - int ich = 0; - for (; ich < cch; ich++) - { - /* cannot resolve bn here, since some bn were resolved to strong - * types in resolveWeak. To remove these we need the original - * types, which are available again in resolveWhiteSpace */ - if (pcls[ich] == BN) - { +static void resolveImplicit(const WORD * pcls, WORD *plevel, int sos, int eos) +{ + int i; + + /* I1/2 */ + for (i = sos; i <= eos; i++) + { + if (pcls[i] == BN) continue; - } - ASSERT(pcls[ich] > 0); /* "No Neutrals allowed to survive here." */ - ASSERT(pcls[ich] < 5); /* "Out of range." */ - plevel[ich] += addLevel[odd(plevel[ich])][pcls[ich] - 1]; + + ASSERT(pcls[i] > 0); /* "No Neutrals allowed to survive here." */ + ASSERT(pcls[i] < 5); /* "Out of range." */ + + if (odd(plevel[i]) && (pcls[i] == L || pcls[i] == EN || pcls [i] == AN)) + plevel[i]++; + else if (!odd(plevel[i]) && pcls[i] == R) + plevel[i]++; + else if (!odd(plevel[i]) && (pcls[i] == EN || pcls [i] == AN)) + plevel[i]+=2; + } +} + +static void resolveResolved(unsigned baselevel, const WORD * pcls, WORD *plevel, int sos, int eos) +{ + int i; + + /* L1 */ + for (i = sos; i <= eos; i++) + { + if (pcls[i] == B || pcls[i] == S) + { + int j = i -1; + while (i > sos && j >= sos && + (pcls[j] == WS || pcls[j] == FSI || pcls[j] == LRI || pcls[j] == RLI || + pcls[j] == PDI || pcls[j] == LRE || pcls[j] == RLE || pcls[j] == LRO || + pcls[j] == RLO || pcls[j] == PDF || pcls[j] == BN)) + plevel[j--] = baselevel; + plevel[i] = baselevel; + } + if (i == eos && + (pcls[i] == WS || pcls[i] == FSI || pcls[i] == LRI || pcls[i] == RLI || + pcls[i] == PDI || pcls[i] == LRE || pcls[i] == RLE || pcls[i] == LRO || + pcls[i] == RLO || pcls[i] == PDF || pcls[i] == BN )) + { + int j = i; + while (j >= sos && (pcls[j] == WS || pcls[j] == FSI || pcls[j] == LRI || pcls[j] == RLI || + pcls[j] == PDI || pcls[j] == LRE || pcls[j] == RLE || pcls[j] == LRO || + pcls[j] == RLO || pcls[j] == PDF || pcls[j] == BN)) + plevel[j--] = baselevel; + } + } +} + +static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, WORD *pLevel, int uCount, struct list *set) +{ + int run_start, run_end, i; + Run runs[uCount]; + int run_count = 0; + IsolatedRun *current_isolated; + + list_init(set); + + /* Build Runs */ + run_start = 0; + while (run_start < uCount) + { + run_end = nextValidChar(pcls, run_start, uCount); + while (run_end < uCount && pLevel[run_end] == pLevel[run_start]) run_end = nextValidChar(pcls, run_end, uCount); + run_end --; + runs[run_count].start = run_start; + runs[run_count].end = run_end; + runs[run_count].e = pLevel[run_start]; + run_start = nextValidChar(pcls, run_end, uCount); + run_count++; + } + + /* Build Isolating Runs */ + i = 0; + while (i < run_count) + { + int k = i; + if (runs[k].start >= 0) + { + int type_fence, real_end; + int j; + current_isolated = HeapAlloc(GetProcessHeap(), 0, sizeof(IsolatedRun) + sizeof(WORD*)*uCount); + + run_start = runs[k].start; + current_isolated->e = runs[k].e; + current_isolated->length = (runs[k].end - runs[k].start)+1; + + for (j = 0; j < current_isolated->length; j++) + current_isolated->ppcls[j] = &pcls[runs[k].start+j]; + + run_end = runs[k].end; + + TRACE("{ [%i -- %i]",run_start, run_end); + + if (pcls[run_end] == BN) + run_end = previousValidChar(pcls, run_end, runs[k].start); + + while (run_end < uCount && (pcls[run_end] == RLI || pcls[run_end] == LRI || pcls[run_end] == FSI)) + { + j = k+1; +search: + while (j < run_count && pcls[runs[j].start] != PDI) j++; + if (j < run_count && runs[i].e != runs[j].e) + { + j++; + goto search; + } + + if (j != run_count) + { + int m; + int l = current_isolated->length; + + current_isolated->length += (runs[j].end - runs[j].start)+1; + for (m = 0; l < current_isolated->length; l++, m++) + current_isolated->ppcls[l] = &pcls[runs[j].start+m]; + + TRACE("[%i -- %i]",runs[j].start, runs[j].end); + + run_end = runs[j].end; + if (pcls[run_end] == BN) + run_end = previousValidChar(pcls, run_end, runs[i].start); + runs[j].start = -1; + k = j; + } + else + { + run_end = uCount; + break; + } + } + + type_fence = previousValidChar(pcls, run_start, -1); + + if (type_fence == -1) + current_isolated->sos = (baselevel > pLevel[run_start])?baselevel:pLevel[run_start]; + else + current_isolated->sos = (pLevel[type_fence] > pLevel[run_start])?pLevel[type_fence]:pLevel[run_start]; + + current_isolated->sos = EmbeddingDirection(current_isolated->sos); + + if (run_end == uCount) + current_isolated->eos = current_isolated->sos; + else + { + /* eos could be an BN */ + if ( pcls[run_end] == BN ) + { + real_end = previousValidChar(pcls, run_end, run_start-1); + if (real_end < run_start) + real_end = run_start; + } + else + real_end = run_end; + + type_fence = nextValidChar(pcls, run_end, uCount); + if (type_fence == uCount) + current_isolated->eos = (baselevel > pLevel[real_end])?baselevel:pLevel[real_end]; + else + current_isolated->eos = (pLevel[type_fence] > pLevel[real_end])?pLevel[type_fence]:pLevel[real_end]; + + current_isolated->eos = EmbeddingDirection(current_isolated->eos); + } + + list_add_tail(set, ¤t_isolated->entry); + TRACE(" } level %i {%s <--> %s}\n",current_isolated->e, debug_type[current_isolated->sos], debug_type[current_isolated->eos]); + } + i++; } } @@ -739,7 +951,9 @@ { WORD *chartype; unsigned baselevel = 0; - INT j; + struct list IsolatingRuns; + IsolatedRun *iso_run, *next; + TRACE("%s, %d\n", debugstr_wn(lpString, uCount), uCount); chartype = HeapAlloc(GetProcessHeap(), 0, uCount * sizeof(WORD)); @@ -752,28 +966,38 @@ baselevel = s->uBidiLevel; classify(lpString, chartype, uCount, c); - - for (j = 0; j < uCount; ++j) - switch(chartype[j]) - { - case B: - case S: - case WS: - case ON: chartype[j] = N; - default: continue; - } + if (TRACE_ON(bidi)) dump_types("Start ", chartype, 0, uCount); /* resolve explicit */ - resolveExplicit(baselevel, N, chartype, lpOutLevels, uCount, 0); - - /* resolve weak */ - resolveWeak(baselevel, chartype, lpOutLevels, uCount); - - /* resolve neutrals */ - resolveNeutrals(baselevel, chartype, lpOutLevels, uCount); - + resolveExplicit(baselevel, chartype, lpOutLevels, uCount); + if (TRACE_ON(bidi)) dump_types("After Explicit", chartype, 0, uCount); + + /* X10/BD13: Computer Isolating runs */ + computeIsolatingRunsSet(baselevel, chartype, lpOutLevels, uCount, &IsolatingRuns); + + LIST_FOR_EACH_ENTRY_SAFE(iso_run, next, &IsolatingRuns, IsolatedRun, entry) + { + if (TRACE_ON(bidi)) iso_dump_types("Run", iso_run); + + /* resolve weak */ + resolveWeak(iso_run); + if (TRACE_ON(bidi)) iso_dump_types("After Weak", iso_run); + + /* resolve neutrals */ + resolveNeutrals(iso_run); + if (TRACE_ON(bidi)) iso_dump_types("After Neutrals", iso_run); + + list_remove(&iso_run->entry); + HeapFree(GetProcessHeap(),0,iso_run); + } + + if (TRACE_ON(bidi)) dump_types("Before Implicit", chartype, 0, uCount); /* resolveImplicit */ - resolveImplicit(chartype, lpOutLevels, uCount); + resolveImplicit(chartype, lpOutLevels, 0, uCount-1); + + /* resolveResolvedLevels*/ + classify(lpString, chartype, uCount, c); + resolveResolved(baselevel, chartype, lpOutLevels, 0, uCount-1); HeapFree(GetProcessHeap(), 0, chartype); return TRUE; Modified: trunk/reactos/dll/win32/usp10/indicsyllable.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/usp10/indicsylla…
============================================================================== --- trunk/reactos/dll/win32/usp10/indicsyllable.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/usp10/indicsyllable.c [iso-8859-1] Thu Mar 20 02:07:55 2014 @@ -1,6 +1,6 @@ /* Unicode Indic Syllabic Category */ -/* generated from
http://www.unicode.org/Public/6.2.0/ucd/IndicSyllabicCategory.txt
*/ -/* and from
http://www.unicode.org/Public/6.2.0/ucd/IndicMatraCategory.txt
*/ +/* generated from
http://www.unicode.org/Public/6.3.0/ucd/IndicSyllabicCategory.txt
*/ +/* and from
http://www.unicode.org/Public/6.3.0/ucd/IndicMatraCategory.txt
*/ /* DO NOT EDIT!! */ //#include "wine/unicode.h" Modified: trunk/reactos/dll/win32/usp10/linebreak.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/usp10/linebreak.…
============================================================================== --- trunk/reactos/dll/win32/usp10/linebreak.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/usp10/linebreak.c [iso-8859-1] Thu Mar 20 02:07:55 2014 @@ -1,10 +1,10 @@ /* Unicode Line Break Properties */ -/* generated from
http://www.unicode.org/Public/6.2.0/ucd/LineBreak.txt
*/ +/* generated from
http://www.unicode.org/Public/6.3.0/ucd/LineBreak.txt
*/ /* DO NOT EDIT!! */ //#include "wine/unicode.h" -const unsigned short wine_linebreak_table[7056] = +const unsigned short wine_linebreak_table[7072] = { /* level 1 offsets */ 0x0100, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, 0x0170, @@ -101,87 +101,87 @@ 0x05b0, 0x10d0, 0x05b0, 0x05b0, 0x10d0, 0x10e0, 0x05b0, 0x10f0, 0x05b0, 0x05b0, 0x05b0, 0x1100, 0x1100, 0x1110, 0x05b0, 0x1120, 0x1130, 0x1140, 0x1150, 0x1160, 0x1170, 0x1180, 0x1190, 0x11a0, - 0x11b0, 0x0ce0, 0x11c0, 0x11d0, 0x0870, 0x0580, 0x0580, 0x11e0, - 0x11f0, 0x1200, 0x1210, 0x05b0, 0x05b0, 0x1220, 0x1230, 0x1240, - 0x1250, 0x1240, 0x05b0, 0x05b0, 0x05b0, 0x1260, 0x05b0, 0x05b0, - 0x1270, 0x1280, 0x1290, 0x12a0, 0x12b0, 0x12c0, 0x12d0, 0x05b0, - 0x12e0, 0x12f0, 0x1300, 0x1310, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x05b0, 0x1320, 0x1330, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1340, - 0x05b0, 0x05b0, 0x1350, 0x0870, 0x1360, 0x0870, 0x1370, 0x1370, - 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, 0x1380, - 0x1370, 0x1370, 0x1370, 0x1370, 0x1230, 0x1370, 0x1370, 0x1390, - 0x1370, 0x13a0, 0x13b0, 0x13c0, 0x13d0, 0x13e0, 0x13f0, 0x05b0, - 0x1400, 0x1410, 0x05b0, 0x1420, 0x1430, 0x05b0, 0x1440, 0x1450, - 0x05b0, 0x1460, 0x05b0, 0x1470, 0x1480, 0x1490, 0x14a0, 0x14b0, - 0x14c0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x14d0, 0x14e0, 0x14f0, - 0x1370, 0x1500, 0x05b0, 0x05b0, 0x1510, 0x05b0, 0x1520, 0x05b0, + 0x11b0, 0x0ce0, 0x11c0, 0x11d0, 0x11e0, 0x0580, 0x0580, 0x11f0, + 0x1200, 0x1210, 0x1220, 0x05b0, 0x05b0, 0x1230, 0x1240, 0x1250, + 0x1260, 0x1250, 0x05b0, 0x05b0, 0x05b0, 0x1270, 0x05b0, 0x05b0, + 0x1280, 0x1290, 0x12a0, 0x12b0, 0x12c0, 0x12d0, 0x12e0, 0x05b0, + 0x12f0, 0x1300, 0x1310, 0x1320, 0x05b0, 0x05b0, 0x05b0, 0x05b0, + 0x05b0, 0x1330, 0x1340, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1350, + 0x05b0, 0x05b0, 0x1360, 0x0870, 0x1370, 0x0870, 0x1380, 0x1380, + 0x1380, 0x1380, 0x1380, 0x1380, 0x1380, 0x1380, 0x1380, 0x1390, + 0x1380, 0x1380, 0x1380, 0x1380, 0x1240, 0x1380, 0x1380, 0x13a0, + 0x1380, 0x13b0, 0x13c0, 0x13d0, 0x13e0, 0x13f0, 0x1400, 0x05b0, + 0x1410, 0x1420, 0x05b0, 0x1430, 0x1440, 0x05b0, 0x1450, 0x1460, + 0x05b0, 0x1470, 0x05b0, 0x1480, 0x1490, 0x14a0, 0x14b0, 0x14c0, + 0x14d0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x14e0, 0x14f0, 0x1500, + 0x1380, 0x1510, 0x05b0, 0x05b0, 0x1520, 0x05b0, 0x1530, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x1530, 0x1540, 0x05b0, 0x05b0, 0x05b0, 0x1550, 0x05b0, 0x1560, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0ce0, 0x1570, 0x0870, 0x0870, + 0x1540, 0x1550, 0x05b0, 0x05b0, 0x05b0, 0x1560, 0x05b0, 0x1570, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0ce0, 0x1580, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x05b0, 0x05b0, 0x0850, 0x05b0, 0x05b0, 0x0850, 0x05b0, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1580, 0x1590, - 0x05b0, 0x05b0, 0x0d70, 0x05b0, 0x05b0, 0x05b0, 0x15a0, 0x15b0, - 0x05b0, 0x1350, 0x15c0, 0x15c0, 0x15c0, 0x15c0, 0x0580, 0x0580, - 0x15d0, 0x15e0, 0x15f0, 0x1600, 0x0870, 0x0870, 0x0870, 0x0870, - 0x1610, 0x1620, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1340, - 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, - 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1630, 0x0870, 0x1640, - 0x1650, 0x1660, 0x1670, 0x1680, 0x1690, 0x1610, 0x16a0, 0x1610, - 0x16b0, 0x16c0, 0x16d0, 0x1610, 0x16a0, 0x1610, 0x16b0, 0x16e0, - 0x16f0, 0x1610, 0x1700, 0x1710, 0x1610, 0x1610, 0x1610, 0x1610, - 0x1720, 0x1610, 0x1610, 0x1730, 0x1610, 0x1610, 0x1340, 0x1740, - 0x1610, 0x1720, 0x1610, 0x1610, 0x1750, 0x1610, 0x1610, 0x1610, - 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1720, - 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, - 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, - 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, - 0x1610, 0x1610, 0x1610, 0x1610, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x1610, 0x1760, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, - 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, - 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, - 0x1770, 0x1610, 0x1610, 0x1610, 0x1780, 0x05b0, 0x05b0, 0x1070, - 0x1790, 0x05b0, 0x17a0, 0x0870, 0x05b0, 0x05b0, 0x1580, 0x17b0, - 0x05b0, 0x17c0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x17d0, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1590, 0x15a0, + 0x05b0, 0x05b0, 0x0d70, 0x05b0, 0x05b0, 0x05b0, 0x15b0, 0x15c0, + 0x05b0, 0x1360, 0x15d0, 0x15d0, 0x15d0, 0x15d0, 0x0580, 0x0580, + 0x15e0, 0x15f0, 0x1600, 0x1610, 0x0870, 0x0870, 0x0870, 0x0870, + 0x1620, 0x1630, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1350, + 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, + 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1640, 0x0870, 0x1650, + 0x1660, 0x1670, 0x1680, 0x1690, 0x16a0, 0x1620, 0x16b0, 0x1620, + 0x16c0, 0x16d0, 0x16e0, 0x1620, 0x16b0, 0x1620, 0x16c0, 0x16f0, + 0x1700, 0x1620, 0x1710, 0x1720, 0x1620, 0x1620, 0x1620, 0x1620, + 0x1730, 0x1620, 0x1620, 0x1740, 0x1620, 0x1620, 0x1350, 0x1750, + 0x1620, 0x1730, 0x1620, 0x1620, 0x1760, 0x1620, 0x1620, 0x1620, + 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1730, + 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, + 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, + 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, + 0x1620, 0x1620, 0x1620, 0x1620, 0x05b0, 0x05b0, 0x05b0, 0x05b0, + 0x1620, 0x1770, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, + 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, + 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, + 0x1780, 0x1620, 0x1620, 0x1620, 0x1790, 0x05b0, 0x05b0, 0x1070, + 0x17a0, 0x05b0, 0x17b0, 0x0870, 0x05b0, 0x05b0, 0x1590, 0x17c0, + 0x05b0, 0x17d0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x17e0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x0850, 0x17e0, 0x1360, 0x0870, 0x0870, 0x0870, 0x0870, 0x0b10, - 0x17f0, 0x05b0, 0x1800, 0x1810, 0x05b0, 0x05b0, 0x05b0, 0x1820, - 0x1830, 0x05b0, 0x05b0, 0x0fd0, 0x1840, 0x0ee0, 0x0580, 0x1850, - 0x07c0, 0x05b0, 0x1860, 0x05b0, 0x1870, 0x1880, 0x0d80, 0x1890, - 0x08b0, 0x05b0, 0x05b0, 0x18a0, 0x18b0, 0x18c0, 0x0870, 0x0870, - 0x05b0, 0x05b0, 0x18d0, 0x10b0, 0x18e0, 0x18f0, 0x0c10, 0x0f60, - 0x0c10, 0x0c10, 0x0c10, 0x0c10, 0x1900, 0x1910, 0x0770, 0x1920, - 0x1930, 0x1940, 0x15c0, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, - 0x0870, 0x0870, 0x0870, 0x0870, 0x05b0, 0x05b0, 0x1950, 0x0ee0, - 0x1960, 0x1970, 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, - 0x1970, 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, - 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, - 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, 0x1990, - 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, 0x1990, 0x1980, - 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, 0x1990, 0x1980, 0x19a0, - 0x1980, 0x1960, 0x1970, 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, - 0x1960, 0x1970, 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, - 0x1970, 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, - 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, - 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, 0x1990, - 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, 0x1990, 0x1980, - 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, 0x1990, 0x1980, 0x19a0, - 0x1980, 0x1960, 0x1970, 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, - 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, - 0x1990, 0x1980, 0x19b0, 0x0d90, 0x19c0, 0x0db0, 0x0db0, 0x19d0, - 0x19e0, 0x19e0, 0x19e0, 0x19e0, 0x19e0, 0x19e0, 0x19e0, 0x19e0, - 0x19e0, 0x19e0, 0x19e0, 0x19e0, 0x19e0, 0x19e0, 0x19e0, 0x19e0, + 0x0850, 0x17f0, 0x1370, 0x0870, 0x0870, 0x0870, 0x0870, 0x0b10, + 0x1800, 0x05b0, 0x1810, 0x1820, 0x05b0, 0x05b0, 0x05b0, 0x1830, + 0x1840, 0x05b0, 0x05b0, 0x0fd0, 0x1850, 0x0ee0, 0x0580, 0x1860, + 0x07c0, 0x05b0, 0x1870, 0x05b0, 0x1880, 0x1890, 0x0d80, 0x18a0, + 0x08b0, 0x05b0, 0x05b0, 0x18b0, 0x18c0, 0x18d0, 0x0870, 0x0870, + 0x05b0, 0x05b0, 0x18e0, 0x10b0, 0x18f0, 0x1900, 0x0c10, 0x0f60, + 0x0c10, 0x0c10, 0x0c10, 0x0c10, 0x1910, 0x1920, 0x0770, 0x1930, + 0x1940, 0x1950, 0x15d0, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, + 0x0870, 0x0870, 0x0870, 0x0870, 0x05b0, 0x05b0, 0x1960, 0x0ee0, + 0x1970, 0x1980, 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, + 0x1980, 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, + 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, + 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, 0x19a0, + 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, 0x19a0, 0x1990, + 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, 0x19a0, 0x1990, 0x19b0, + 0x1990, 0x1970, 0x1980, 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, + 0x1970, 0x1980, 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, + 0x1980, 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, + 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, + 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, 0x19a0, + 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, 0x19a0, 0x1990, + 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, 0x19a0, 0x1990, 0x19b0, + 0x1990, 0x1970, 0x1980, 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, + 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, + 0x19a0, 0x1990, 0x19c0, 0x0d90, 0x19d0, 0x0db0, 0x0db0, 0x19e0, + 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x19f0, + 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, - 0x1350, 0x19f0, 0x1a00, 0x1a10, 0x1a20, 0x05b0, 0x05b0, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1a30, 0x1a40, 0x05b0, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x1a50, 0x0870, 0x05b0, 0x05b0, 0x05b0, - 0x05b0, 0x1a60, 0x05b0, 0x05b0, 0x06b0, 0x0870, 0x0870, 0x1a70, - 0x0580, 0x1a80, 0x10b0, 0x1a90, 0x1aa0, 0x1ab0, 0x1ac0, 0x1100, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1ad0, - 0x1ae0, 0x1af0, 0x1610, 0x1b00, 0x1610, 0x1b10, 0x1b20, 0x1b30, - 0x05b0, 0x1b40, 0x05b0, 0x0850, 0x1b50, 0x1b60, 0x1b70, 0x1b80, + 0x1360, 0x1a00, 0x1a10, 0x1a20, 0x1a30, 0x05b0, 0x05b0, 0x05b0, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1a40, 0x1a50, 0x05b0, 0x05b0, + 0x05b0, 0x05b0, 0x05b0, 0x1a60, 0x0870, 0x05b0, 0x05b0, 0x05b0, + 0x05b0, 0x1a70, 0x05b0, 0x05b0, 0x06b0, 0x0870, 0x0870, 0x1a80, + 0x0580, 0x1a90, 0x10b0, 0x1aa0, 0x1ab0, 0x1ac0, 0x1ad0, 0x1100, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1ae0, + 0x1af0, 0x1b00, 0x1620, 0x1b10, 0x1620, 0x1b20, 0x1b30, 0x1b40, + 0x05b0, 0x1b50, 0x05b0, 0x0850, 0x1b60, 0x1b70, 0x1b80, 0x1b90, /* values */ 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0022, 0x0003, 0x0001, 0x0001, 0x0002, 0x0004, 0x0004, @@ -246,7 +246,7 @@ 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x001d, 0x001d, 0x001d, 0x001b, 0x001b, 0x001b, 0x0019, 0x0019, 0x001d, 0x001d, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, - 0x0004, 0x0004, 0x0004, 0x0017, 0x0011, 0x0011, 0x0017, 0x0017, + 0x0004, 0x0004, 0x0004, 0x0017, 0x0004, 0x0011, 0x0017, 0x0017, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, @@ -571,8 +571,8 @@ 0x0016, 0x0016, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0022, 0x001d, 0x0022, 0x0022, 0x0022, 0x0022, 0x001d, 0x0022, 0x0022, 0x0022, - 0x000b, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, - 0x0011, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x000b, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x001d, 0x001d, 0x0011, 0x0011, 0x0024, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0012, 0x0013, 0x0024, 0x001d, 0x0024, 0x0024, 0x0024, 0x0024, 0x001d, 0x001d, 0x001d, @@ -580,7 +580,9 @@ 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001b, 0x001a, - 0x001a, 0x001a, 0x001a, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, + 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, + 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x0004, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001b, 0x001d, 0x0024, 0x001d, 0x001d, @@ -723,13 +725,13 @@ 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0011, 0x0011, 0x0011, 0x0011, - 0x001e, 0x0013, 0x0013, 0x001e, 0x001e, 0x0016, 0x001e, 0x001e, + 0x0022, 0x0013, 0x0013, 0x001e, 0x001e, 0x0016, 0x001e, 0x001e, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x001e, 0x001e, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0016, 0x0012, 0x0013, 0x0013, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, + 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0004, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0016, 0x0016, 0x001e, 0x001e, 0x001e, 0x0011, 0x0027, 0x001e, 0x0027, 0x001e, 0x0027, 0x001e, 0x0027, 0x001e, 0x0027, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, Modified: trunk/reactos/dll/win32/usp10/shaping.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/usp10/shaping.c?…
============================================================================== --- trunk/reactos/dll/win32/usp10/shaping.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/usp10/shaping.c [iso-8859-1] Thu Mar 20 02:07:55 2014 @@ -1,10 +1,10 @@ /* Unicode Arabic shaping */ -/* generated from
http://www.unicode.org/Public/6.2.0/ucd/ArabicShaping.txt
*/ +/* generated from
http://www.unicode.org/Public/6.3.0/ucd/ArabicShaping.txt
*/ /* DO NOT EDIT!! */ //#include "wine/unicode.h" -const unsigned short wine_shaping_table[2752] = +const unsigned short wine_shaping_table[2800] = { /* level 1 offsets */ 0x0100, 0x0110, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, @@ -76,42 +76,42 @@ 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0820, 0x0340, 0x0820, 0x0340, 0x0610, 0x0340, 0x0610, 0x0340, 0x0340, 0x0340, 0x0830, 0x0840, 0x0850, 0x0340, 0x0340, - 0x0860, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0870, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0880, 0x0890, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x08a0, 0x0340, 0x0340, 0x0340, 0x08b0, 0x08c0, 0x08d0, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x08e0, 0x0340, 0x0340, 0x08f0, 0x06b0, 0x0340, 0x0900, 0x08e0, - 0x0910, 0x0340, 0x0920, 0x0340, 0x0340, 0x0340, 0x0930, 0x0910, - 0x0340, 0x0340, 0x0940, 0x0950, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0960, 0x0970, 0x0980, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0360, 0x0360, 0x0990, 0x0940, - 0x09a0, 0x0340, 0x09b0, 0x0340, 0x0340, 0x0340, 0x09c0, 0x0340, + 0x0860, 0x0340, 0x0530, 0x0530, 0x0530, 0x0530, 0x0530, 0x0870, + 0x0880, 0x0530, 0x0890, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0340, 0x08a0, 0x08b0, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x08c0, 0x0340, 0x0340, 0x0340, 0x08d0, 0x08e0, 0x08f0, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0900, 0x0340, 0x0340, 0x0910, 0x06b0, 0x0340, 0x0920, 0x0900, + 0x0930, 0x0340, 0x0940, 0x0340, 0x0340, 0x0340, 0x0950, 0x0930, + 0x0340, 0x0340, 0x0960, 0x0970, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0980, 0x0990, 0x09a0, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0360, 0x0360, 0x09b0, 0x0960, + 0x09c0, 0x0340, 0x09d0, 0x0340, 0x0340, 0x0340, 0x09e0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0360, 0x0360, 0x0510, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0490, 0x0910, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0490, 0x0930, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0490, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0360, 0x0360, - 0x0340, 0x0340, 0x09d0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x09e0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0490, 0x09f0, - 0x0340, 0x0490, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0910, - 0x0a00, 0x0340, 0x06f0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0980, 0x0340, 0x0360, 0x0910, - 0x0340, 0x0340, 0x0a10, 0x0340, 0x0a20, 0x0910, 0x0340, 0x0340, - 0x05d0, 0x0340, 0x0340, 0x0a30, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0a40, 0x0a50, 0x0a60, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0a70, 0x0620, 0x0340, 0x0a80, 0x06a0, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0a90, 0x0340, - 0x0340, 0x0aa0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0360, 0x0340, 0x0990, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0340, 0x09f0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0a00, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0490, 0x0a10, + 0x0340, 0x0490, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0930, + 0x0a20, 0x0340, 0x06f0, 0x0340, 0x0530, 0x0530, 0x0530, 0x0a30, + 0x0340, 0x0340, 0x0340, 0x0340, 0x09a0, 0x0340, 0x0360, 0x0930, + 0x0340, 0x0340, 0x0a40, 0x0340, 0x0a50, 0x0930, 0x0340, 0x0340, + 0x05d0, 0x0340, 0x0340, 0x0a60, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0340, 0x0a70, 0x0a80, 0x0a90, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0340, 0x0340, 0x0aa0, 0x0620, 0x0340, 0x0ab0, 0x06a0, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0ac0, 0x0340, + 0x0340, 0x0ad0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0360, 0x0340, 0x09b0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0490, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0ab0, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0ae0, /* values */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -128,7 +128,7 @@ 0x0000, 0x0001, 0x0001, 0x0000, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, - 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0104, 0x0000, 0x0202, 0x0202, 0x0302, 0x0202, 0x0104, 0x0202, 0x0404, 0x0502, 0x0404, 0x0404, 0x0604, 0x0604, 0x0604, 0x0702, 0x0702, 0x0802, 0x0802, 0x0904, 0x0904, 0x0a04, 0x0a04, 0x0b04, @@ -277,16 +277,20 @@ 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, + 0x0000, 0x0000, 0x0005, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0001, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, - 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, @@ -331,6 +335,8 @@ 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0004, 0x0004, 0x0003, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, Modified: trunk/reactos/dll/win32/usp10/usp10.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/usp10/usp10.c?re…
============================================================================== --- trunk/reactos/dll/win32/usp10/usp10.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/usp10/usp10.c [iso-8859-1] Thu Mar 20 02:07:55 2014 @@ -1381,7 +1381,7 @@ else { BOOL inNumber = FALSE; - static WCHAR math_punc[] = {'#','$','%','+',',','-','.','/',':',0x2212, 0x2044, 0x00a0,0}; + static const WCHAR math_punc[] = {'#','$','%','+',',','-','.','/',':',0x2212, 0x2044, 0x00a0,0}; strength = heap_alloc_zero(cInChars * sizeof(WORD)); if (!strength) Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Thu Mar 20 02:07:55 2014 @@ -195,7 +195,7 @@ reactos/dll/win32/updspapi # Synced to Wine-1.7.1 reactos/dll/win32/url # Synced to Wine-1.7.1 reactos/dll/win32/urlmon # Synced to Wine-1.7.1 -reactos/dll/win32/usp10 # Synced to Wine-1.7.1 +reactos/dll/win32/usp10 # Synced to Wine-1.7.14 reactos/dll/win32/uxtheme # Forked reactos/dll/win32/vbscript # Synced to Wine-1.7.1 reactos/dll/win32/version # Synced to Wine-1.7.1
10 years, 9 months
1
0
0
0
[dquintana] 62534: [RSHELL] * Implement WH_MSGFILTER hooking to handle the popup menus from the horizontal menubar. Switching between menu items wby moving the mouse now works, but at the moment, t...
by dquintana@svn.reactos.org
Author: dquintana Date: Wed Mar 19 15:33:41 2014 New Revision: 62534 URL:
http://svn.reactos.org/svn/reactos?rev=62534&view=rev
Log: [RSHELL] * Implement WH_MSGFILTER hooking to handle the popup menus from the horizontal menubar. Switching between menu items wby moving the mouse now works, but at the moment, the non-menu popups (including the start menu) are somewhat glitchy. CORE-7586 Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp branches/shell-experiments/base/shell/rshell/CMenuFocusManager.h branches/shell-experiments/base/shell/rshell/CMenuSite.cpp branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp branches/shell-experiments/base/shell/rshell/CMenuToolbars.h branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Wed Mar 19 15:33:41 2014 @@ -348,22 +348,6 @@ return hr; } - CComPtr<IServiceProvider> sp; - CComPtr<IUnknown> unk0; - CComPtr<IDeskBar> db0, db, db1; - if (SUCCEEDED(IUnknown_GetSite(m_subMenuParent, IID_PPV_ARG(IServiceProvider, &sp))) && - SUCCEEDED(sp->QueryInterface(IID_PPV_ARG(IDeskBar, &db0))) && - SUCCEEDED(db0->GetClient(&unk0)) && - SUCCEEDED(IUnknown_QueryService(unk0, SID_SMenuBandChild, IID_PPV_ARG(IDeskBar, &db))) && - SUCCEEDED(IUnknown_QueryService(m_site, SID_SMenuBandParent, IID_PPV_ARG(IDeskBar, &db1)))) - { - if (fShow) - db->SetClient(db1); - else - db->SetClient(NULL); - } - - if (m_dwFlags & SMINIT_VERTICAL) { if (fShow) hr = m_focusManager->PushMenu(this); @@ -513,14 +497,13 @@ if (m_subMenuChild) m_subMenuChild = NULL; if (!punkClient) + { + if (m_staticToolbar) m_staticToolbar->OnPopupItemChanged(NULL, -1); + if (m_SFToolbar) m_SFToolbar->OnPopupItemChanged(NULL, -1); return S_OK; + } HRESULT hr = punkClient->QueryInterface(IID_PPV_ARG(IMenuPopup, &m_subMenuChild)); m_trackingPopup = m_subMenuChild != NULL; - if (!m_trackingPopup) - { - if (m_staticToolbar) m_staticToolbar->OnPopupItemChanged(NULL, -1); - if (m_SFToolbar) m_SFToolbar->OnPopupItemChanged(NULL, -1); - } return hr; } Modified: branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] Wed Mar 19 15:33:41 2014 @@ -133,6 +133,17 @@ { return this->QueryInterface(riid, ppvObject); } + + if (IsEqualGUID(guidService, SID_SMenuBandBottom) || + IsEqualGUID(guidService, SID_SMenuBandBottomSelected) || + IsEqualGUID(guidService, SID_SMenuBandChild)) + { + if (m_Client == NULL) + return E_NOINTERFACE; + + return IUnknown_QueryService(m_Client, guidService, riid, ppvObject); + } + if (m_Site == NULL) return E_NOINTERFACE; @@ -643,7 +654,7 @@ LRESULT CMenuDeskBar::_OnAppActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) { - if (wParam == 0) + if (wParam == 0 && m_Shown) { OnSelect(MPOS_FULLCANCEL); } Modified: branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] Wed Mar 19 15:33:41 2014 @@ -23,6 +23,7 @@ #include <shlwapi_undoc.h> #include "CMenuFocusManager.h" +#include "CMenuToolbars.h" #include "CMenuBand.h" WINE_DEFAULT_DEBUG_CHANNEL(CMenuFocus); @@ -65,6 +66,11 @@ } } +LRESULT CALLBACK CMenuFocusManager::s_MsgFilterHook(INT nCode, WPARAM wParam, LPARAM lParam) +{ + return GetManager()->MsgFilterHook(nCode, wParam, lParam); +} + LRESULT CALLBACK CMenuFocusManager::s_GetMsgHook(INT nCode, WPARAM wParam, LPARAM lParam) { return GetManager()->GetMsgHook(nCode, wParam, lParam); @@ -85,7 +91,7 @@ *pItem = NULL; if (m_bandCount <= 0) - return E_FAIL; + return S_FALSE; m_bandCount--; @@ -115,6 +121,10 @@ CMenuFocusManager::CMenuFocusManager() : m_currentBand(NULL), m_currentFocus(NULL), + m_currentMenu(NULL), + m_parentToolbar(NULL), + m_hMsgFilterHook(NULL), + m_hGetMsgHook(NULL), m_mouseTrackDisabled(FALSE), m_lastMoveFlags(0), m_lastMovePos(0), @@ -167,10 +177,7 @@ HRESULT CMenuFocusManager::IsTrackedWindow(HWND hWnd) { - if (hWnd == m_currentFocus) - return S_OK; - - int i = m_bandCount - 1; + int i = m_bandCount; while (--i >= 0) { CMenuBand * band = m_bandStack[i]; @@ -187,14 +194,17 @@ return S_FALSE; } -LRESULT CMenuFocusManager::GetMsgHook(INT nCode, WPARAM wParam, LPARAM lParam) -{ +LRESULT CMenuFocusManager::MsgFilterHook(INT nCode, WPARAM wParam, LPARAM lParam) +{ + HWND parent; + HWND child; + POINT pt; + int iHitTestResult; + if (nCode < 0) - return CallNextHookEx(m_hHook, nCode, wParam, lParam); - - LPARAM pos = (LPARAM) GetMessagePos(); - - if (nCode == HC_ACTION) + return CallNextHookEx(m_hMsgFilterHook, nCode, wParam, lParam); + + if (nCode == MSGF_MENU) { BOOL callNext = TRUE; MSG* msg = reinterpret_cast<MSG*>(lParam); @@ -203,15 +213,74 @@ switch (msg->message) { - case WM_ACTIVATE: // does not trigger - ActivationChange(msg->hwnd); + case WM_MOUSEMOVE: + + pt = msg->pt; + + parent = WindowFromPoint(pt); + + ScreenToClient(parent, &pt); + + child = ChildWindowFromPoint(parent, pt); + + if (child != m_parentToolbar) + break; + + ScreenToClient(m_parentToolbar, &msg->pt); + + /* Don't do anything if the mouse has not been moved */ + if (msg->pt.x == m_ptPrev.x && msg->pt.y == m_ptPrev.y) + return TRUE; + + m_ptPrev = msg->pt; + + iHitTestResult = SendMessageW(m_parentToolbar, TB_HITTEST, 0, (LPARAM) &msg->pt); + + /* Make sure that iHitTestResult is one of the menu items and that it is not the current menu item */ + if (iHitTestResult >= 0) + { + if (SendMessage(m_parentToolbar, WM_USER_ISTRACKEDITEM, iHitTestResult, 0)) + { + SendMessage(m_currentFocus, WM_CANCELMODE, 0, 0); + PostMessage(m_parentToolbar, WM_USER_CHANGETRACKEDITEM, iHitTestResult, iHitTestResult); + return TRUE; + } + } + break; + } + + if (!callNext) + return 0; + } + + return CallNextHookEx(m_hMsgFilterHook, nCode, wParam, lParam); +} + +LRESULT CMenuFocusManager::GetMsgHook(INT nCode, WPARAM wParam, LPARAM lParam) +{ + if (nCode < 0) + return CallNextHookEx(m_hGetMsgHook, nCode, wParam, lParam); + + LPARAM pos = (LPARAM) GetMessagePos(); + + if (nCode == HC_ACTION) + { + BOOL callNext = TRUE; + MSG* msg = reinterpret_cast<MSG*>(lParam); + + // Do whatever is necessary here + + switch (msg->message) + { case WM_CLOSE: break; + + case WM_NCLBUTTONDOWN: case WM_LBUTTONDOWN: { POINT pt = { GET_X_LPARAM(pos), GET_Y_LPARAM(pos) }; - HWND window = WindowFromPoint(pt); + HWND window = GetAncestor(WindowFromPoint(pt), GA_ROOT); if (IsTrackedWindow(window) != S_OK) { @@ -274,88 +343,72 @@ return 0; } - return CallNextHookEx(m_hHook, nCode, wParam, lParam); -} - -HRESULT CMenuFocusManager::PlaceHooks(HWND window) + return CallNextHookEx(m_hGetMsgHook, nCode, wParam, lParam); +} + +HRESULT CMenuFocusManager::PlaceHooks() { //SetCapture(window); - m_hHook = SetWindowsHookEx(WH_GETMESSAGE, s_GetMsgHook, NULL, m_threadId); - return S_OK; -} - -HRESULT CMenuFocusManager::RemoveHooks(HWND window) -{ - UnhookWindowsHookEx(m_hHook); - //ReleaseCapture(); - return S_OK; -} - -HRESULT CMenuFocusManager::ActivationChange(HWND newHwnd) + if (m_currentMenu) + { + m_hMsgFilterHook = SetWindowsHookEx(WH_MSGFILTER, s_MsgFilterHook, NULL, m_threadId); + } + else + { + m_hGetMsgHook = SetWindowsHookEx(WH_GETMESSAGE, s_GetMsgHook, NULL, m_threadId); + } + return S_OK; +} + +HRESULT CMenuFocusManager::RemoveHooks() +{ + if (m_hMsgFilterHook) + UnhookWindowsHookEx(m_hMsgFilterHook); + if (m_hGetMsgHook) + UnhookWindowsHookEx(m_hGetMsgHook); + m_hMsgFilterHook = NULL; + m_hGetMsgHook = NULL; + return S_OK; +} + +HRESULT CMenuFocusManager::UpdateFocus(CMenuBand * newBand, HMENU popupToTrack) { HRESULT hr; - CMenuBand * newBand = NULL; - - CMenuBand * band; - PeekArray(&band); - - while (m_bandCount >= 0) - { - HWND hwnd; - hr = band->_GetTopLevelWindow(&hwnd); + HWND newFocus = NULL; + HWND oldFocus = m_currentFocus; + HMENU oldMenu = m_currentMenu; + + if (newBand) + { + hr = newBand->_GetTopLevelWindow(&newFocus); if (FAILED_UNEXPECTEDLY(hr)) return hr; - - if (hwnd == newHwnd) - { - newBand = band; - break; - } - else - { - PopFromArray(NULL); - PeekArray(&band); - } - } - - return UpdateFocus(newBand); -} - -HRESULT CMenuFocusManager::UpdateFocus(CMenuBand * newBand, HMENU popupToTrack) -{ - HRESULT hr; - HWND newFocus; - - if (newBand == NULL) - { - DisableMouseTrack(NULL, FALSE); - - hr = RemoveHooks(m_currentFocus); - m_currentFocus = NULL; - m_currentBand = NULL; - m_currentMenu = NULL; - return S_OK; - } - - hr = newBand->_GetTopLevelWindow(&newFocus); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; - - if (!m_currentBand) - { - hr = PlaceHooks(newFocus); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; - } - - CHAR title[1024]; - GetWindowTextA(newFocus, title, 1024); - - DbgPrint("Focus is now at %08p, hwnd=%08x, title='%s'. m_bandCount=%d\n", newBand, newFocus, title, m_bandCount); - - m_currentFocus = newFocus; + } + m_currentBand = newBand; m_currentMenu = popupToTrack; + m_currentFocus = newFocus; + if (m_currentMenu) + { + m_currentBand->GetWindow(&m_parentToolbar); + } + + if (oldFocus && (!newFocus || (oldMenu != popupToTrack))) + { + DisableMouseTrack(NULL, FALSE); + + hr = RemoveHooks(); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + } + + if (newFocus && (!oldFocus || (oldMenu != popupToTrack))) + { + hr = PlaceHooks(); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + } + return S_OK; } @@ -364,9 +417,16 @@ { HRESULT hr; + CMenuBand * mbParent = m_currentBand; + hr = PushToArray(mb); if (FAILED_UNEXPECTEDLY(hr)) return hr; + + if (mbParent) + { + mbParent->SetClient(static_cast<IMenuPopup*>(mb)); + } return UpdateFocus(mb); } @@ -387,11 +447,14 @@ hr = PopFromArray(&mbc); if (FAILED_UNEXPECTEDLY(hr)) { - mbc = NULL; + UpdateFocus(NULL); return hr; } } while (mbc && mb != mbc); + + if (!mbc) + return E_FAIL; hr = PeekArray(&mb); if (FAILED_UNEXPECTEDLY(hr)) @@ -401,24 +464,61 @@ if (FAILED_UNEXPECTEDLY(hr)) return hr; + if (mb) + { + mb->SetClient(NULL); + } + + return S_OK; +} + +HRESULT CMenuFocusManager::PushTrackedPopup(CMenuBand * mb, HMENU popup) +{ + HRESULT hr; + + hr = PushToArray(mb); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + return UpdateFocus(mb, popup); +} + +HRESULT CMenuFocusManager::PopTrackedPopup(CMenuBand * mb, HMENU popup) +{ + CMenuBand * mbc; + HRESULT hr; + + HWND newFocus; + hr = mb->_GetTopLevelWindow(&newFocus); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + DbgPrint("Trying to pop %08p, hwnd=%08x\n", mb, newFocus); + + do { + hr = PopFromArray(&mbc); + if (FAILED_UNEXPECTEDLY(hr)) + { + UpdateFocus(NULL); + return hr; + } + } while (mbc && mb != mbc); + if (!mbc) return E_FAIL; - return S_OK; -} - -HRESULT CMenuFocusManager::PushTrackedPopup(CMenuBand * mb, HMENU popup) -{ - HRESULT hr; - - hr = PushToArray(mb); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; - - return UpdateFocus(mb, popup); -} - -HRESULT CMenuFocusManager::PopTrackedPopup(CMenuBand * mb, HMENU popup) -{ - return PopMenu(mb); + hr = PeekArray(&mb); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + hr = UpdateFocus(mb); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + if (mb) + { + mb->SetClient(NULL); + } + + return S_OK; } Modified: branches/shell-experiments/base/shell/rshell/CMenuFocusManager.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuFocusManager.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuFocusManager.h [iso-8859-1] Wed Mar 19 15:33:41 2014 @@ -36,17 +36,21 @@ static void ReleaseManager(CMenuFocusManager * obj); private: + static LRESULT CALLBACK s_MsgFilterHook(INT nCode, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK s_GetMsgHook(INT nCode, WPARAM wParam, LPARAM lParam); private: CMenuBand * m_currentBand; HWND m_currentFocus; HMENU m_currentMenu; - HHOOK m_hHook; + HWND m_parentToolbar; + HHOOK m_hGetMsgHook; + HHOOK m_hMsgFilterHook; DWORD m_threadId; BOOL m_mouseTrackDisabled; WPARAM m_lastMoveFlags; LPARAM m_lastMovePos; + POINT m_ptPrev; // TODO: make dynamic #define MAX_RECURSE 20 @@ -70,12 +74,13 @@ private: LRESULT GetMsgHook(INT nCode, WPARAM wParam, LPARAM lParam); - HRESULT PlaceHooks(HWND window); - HRESULT RemoveHooks(HWND window); + LRESULT MsgFilterHook(INT nCode, WPARAM wParam, LPARAM lParam); + HRESULT PlaceHooks(); + HRESULT RemoveHooks(); HRESULT UpdateFocus(CMenuBand * newBand, HMENU popupToTrack = NULL); - HRESULT ActivationChange(HWND newHwnd); + HRESULT IsTrackedWindow(HWND hWnd); + void DisableMouseTrack(HWND enableTo, BOOL disableThis); - HRESULT IsTrackedWindow(HWND hWnd); public: HRESULT PushMenu(CMenuBand * mb); Modified: branches/shell-experiments/base/shell/rshell/CMenuSite.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuSite.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuSite.cpp [iso-8859-1] Wed Mar 19 15:33:41 2014 @@ -252,13 +252,13 @@ IsEqualGUID(guidService, SID_SMenuBandChild)) { if (m_BandObject == NULL) - return E_FAIL; + return E_NOINTERFACE; return IUnknown_QueryService(m_BandObject, guidService, riid, ppvObject); } if (!m_DeskBarSite) - return E_FAIL; + return E_NOINTERFACE; return IUnknown_QueryService(m_DeskBarSite, guidService, riid, ppvObject); } Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Wed Mar 19 15:33:41 2014 @@ -197,7 +197,8 @@ m_hasIdealSize(FALSE), m_usePager(usePager), m_hotItem(-1), - m_popupItem(-1) + m_popupItem(-1), + m_isTracking(FALSE) { m_marlett = CreateFont( 0, 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET, @@ -401,6 +402,14 @@ switch (uMsg) { + case WM_USER_ISTRACKEDITEM: + m_SubclassOld(hWnd, uMsg, wParam, lParam); + return IsTrackedItem(wParam); + case WM_USER_CHANGETRACKEDITEM: + m_isTracking = TRUE; + m_SubclassOld(hWnd, uMsg, wParam, lParam); + return ChangeTrackedItem(wParam); + case WM_COMMAND: OnWinEvent(hWnd, uMsg, wParam, lParam, &lr); break; @@ -461,6 +470,18 @@ m_hotItem = hot->idNew; m_menuBand->_OnHotItemChanged(this, m_hotItem); m_menuBand->_MenuItemHotTrack(MPOS_CHILDTRACKING); + + if (m_isTracking && !(m_toolbarFlags & SMINIT_VERTICAL)) + { + KillTimer(m_hwndToolbar, TIMERID_HOTTRACK); + + m_menuBand->_OnPopupSubMenu(NULL, NULL, NULL, NULL, -1); + + if (HasSubMenu(m_hotItem) == S_OK) + { + PopupItem(m_hotItem); + } + } return S_OK; } return S_OK; @@ -491,11 +512,38 @@ { if (toolbar == NULL && m_popupBar == this) { - SendMessage(m_hwndToolbar, TB_CHECKBUTTON, item, FALSE); + SendMessage(m_hwndToolbar, TB_CHECKBUTTON, m_popupItem, FALSE); + m_isTracking = FALSE; } m_popupBar = toolbar; m_popupItem = item; InvalidateDraw(); + return S_OK; +} + +HRESULT CMenuToolbarBase::IsTrackedItem(INT index) +{ + TBBUTTON btn; + + if (m_hotBar != this) + return S_FALSE; + + SendMessage(m_hwndToolbar, TB_GETBUTTON, index, reinterpret_cast<LPARAM>(&btn)); + + if (m_hotItem == btn.idCommand) + return S_OK; + return S_FALSE; +} + +HRESULT CMenuToolbarBase::ChangeTrackedItem(INT index) +{ + TBBUTTON btn; + SendMessage(m_hwndToolbar, TB_GETBUTTON, index, reinterpret_cast<LPARAM>(&btn)); + + if (m_hotItem != btn.idCommand) + { + SendMessage(m_hwndToolbar, TB_SETHOTITEM, index, 0); + } return S_OK; } @@ -577,7 +625,8 @@ if (FAILED_UNEXPECTEDLY(hr)) return hr; - m_menuBand->_OnPopupSubMenu(popup, &pt, &rcl, this, m_popupItem); + m_isTracking = TRUE; + m_menuBand->_OnPopupSubMenu(popup, &pt, &rcl, this, uItem); return S_OK; } @@ -613,9 +662,11 @@ HMENU popup = GetSubMenu(menu, index); + m_isTracking = TRUE; m_menuBand->_TrackSubMenuUsingTrackPopupMenu(popup, pt.x, pt.y, rcl); SendMessage(m_hwndToolbar, TB_CHECKBUTTON, uItem, FALSE); + m_isTracking = FALSE; return S_OK; } @@ -841,6 +892,12 @@ INT index; DWORD_PTR dwData; + if (!(m_toolbarFlags & SMINIT_VERTICAL)) + { + SendMessage(m_hwndToolbar, TB_SETHOTITEM, uItem, 0); + SendMessage(m_hwndToolbar, TB_CHECKBUTTON, uItem, TRUE); + } + GetDataFromId(uItem, &index, &dwData); return InternalPopupItem(uItem, index, dwData); Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] Wed Mar 19 15:33:41 2014 @@ -22,6 +22,10 @@ class CMenuBand; class CMenuFocusManager; +#define WM_USER_ISTRACKEDITEM (WM_USER+41) +#define WM_USER_CHANGETRACKEDITEM (WM_USER+42) + + class CMenuToolbarBase { private: @@ -44,6 +48,7 @@ INT m_popupItem; DWORD m_toolbarFlags; + BOOL m_isTracking; private: static LRESULT CALLBACK s_SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); @@ -69,6 +74,9 @@ HRESULT ChangeHotItem(DWORD changeType); HRESULT OnHotItemChange(const NMTBHOTITEM * hot, LRESULT * theResult); + + HRESULT IsTrackedItem(INT index); + HRESULT ChangeTrackedItem(INT index); HRESULT GetIdealSize(SIZE& size); HRESULT SetPosSize(int x, int y, int cx, int cy); Modified: branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
============================================================================== --- branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] Wed Mar 19 15:33:41 2014 @@ -325,15 +325,10 @@ HRESULT STDMETHODCALLTYPE CDockSite::QueryService(REFGUID guidService, REFIID riid, void **ppvObject) { - CComPtr<IServiceProvider> serviceProvider; - HRESULT hResult; - if (IsEqualIID(guidService, SID_SMenuBandParent)) return this->QueryInterface(riid, ppvObject); - hResult = fToolbar->QueryInterface(IID_IServiceProvider, reinterpret_cast<void **>(&serviceProvider)); - if (FAILED(hResult)) - return hResult; - return serviceProvider->QueryService(guidService, riid, ppvObject); + + return fToolbar->QueryService(guidService, riid, ppvObject); } CMenuCallback::CMenuCallback() @@ -1173,10 +1168,7 @@ } return fBandProxy->QueryInterface(riid, ppvObject); } - hResult = fSite->QueryInterface(IID_IServiceProvider, reinterpret_cast<void **>(&serviceProvider)); - if (FAILED(hResult)) - return hResult; - return serviceProvider->QueryService(guidService, riid, ppvObject); + return IUnknown_QueryService(fSite, guidService, riid, ppvObject); } HRESULT STDMETHODCALLTYPE CInternetToolbar::OnWinEvent(
10 years, 9 months
1
0
0
0
[jimtabor] 62533: [NtUser|User32] - Fix HiliteMenuItem tests, see CORE-7967.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Mar 18 21:54:59 2014 New Revision: 62533 URL:
http://svn.reactos.org/svn/reactos?rev=62533&view=rev
Log: [NtUser|User32] - Fix HiliteMenuItem tests, see CORE-7967. Modified: trunk/reactos/win32ss/user/ntuser/menu.c trunk/reactos/win32ss/user/user32/user32.spec trunk/reactos/win32ss/user/user32/windows/menu.c Modified: trunk/reactos/win32ss/user/ntuser/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/menu.c…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/menu.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/menu.c [iso-8859-1] Tue Mar 18 21:54:59 2014 @@ -485,8 +485,11 @@ int FASTCALL -IntGetMenuItemByFlag(PMENU_OBJECT Menu, UINT uSearchBy, UINT fFlag, - PMENU_OBJECT *SubMenu, PMENU_ITEM *MenuItem, +IntGetMenuItemByFlag(PMENU_OBJECT Menu, + UINT uSearchBy, + UINT fFlag, + PMENU_OBJECT *SubMenu, + PMENU_ITEM *MenuItem, PMENU_ITEM *PrevMenuItem) { PMENU_ITEM PrevItem = NULL; @@ -1039,17 +1042,22 @@ } BOOL FASTCALL -IntHiliteMenuItem(PWND WindowObject, PMENU_OBJECT MenuObject, - UINT uItemHilite, UINT uHilite) +IntHiliteMenuItem(PWND WindowObject, + PMENU_OBJECT MenuObject, + UINT uItemHilite, + UINT uHilite) { PMENU_ITEM MenuItem; - BOOL res = IntGetMenuItemByFlag(MenuObject, uItemHilite, uHilite, NULL, &MenuItem, NULL); - if(!MenuItem || !res) + int Pos; + + Pos = IntGetMenuItemByFlag(MenuObject, uItemHilite, uHilite, NULL, &MenuItem, NULL); + + if (!MenuItem || (uHilite & MF_BYPOSITION && Pos == -1)) { return FALSE; } - if(uHilite & MF_HILITE) + if (uHilite & MF_HILITE) { MenuItem->fState |= MF_HILITE; } @@ -2058,12 +2066,7 @@ RETURN(FALSE); } - if(Window->IDMenu == (UINT)(UINT_PTR)hMenu) - { - RETURN( IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite)); - } - - RETURN(FALSE); + RETURN( IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite)); CLEANUP: TRACE("Leave NtUserHiliteMenuItem, ret=%u\n",_ret_); @@ -2224,7 +2227,7 @@ EngSetLastError(ERROR_INVALID_PARAMETER); // This will crash menu (line 80) correct_behavior test! // "NT4 and below can't handle a bigger MENUITEMINFO struct" - //EngSetLastError(ERROR_MENU_ITEM_NOT_FOUND); +// EngSetLastError(ERROR_MENU_ITEM_NOT_FOUND); return( FALSE); } Modified: trunk/reactos/win32ss/user/user32/user32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/user32…
============================================================================== --- trunk/reactos/win32ss/user/user32/user32.spec [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/user32.spec [iso-8859-1] Tue Mar 18 21:54:59 2014 @@ -387,7 +387,7 @@ @ stdcall GrayStringA(long long ptr long long long long long long) @ stdcall GrayStringW(long long ptr long long long long long long) @ stdcall HideCaret(long) NtUserHideCaret -@ stdcall HiliteMenuItem(long long long long) NtUserHiliteMenuItem +@ stdcall HiliteMenuItem(long long long long) ; Use both ReactOS and wine NtUserHiliteMenuItem @ stdcall IMPGetIMEA(long ptr) @ stdcall IMPGetIMEW(long ptr) @ stdcall IMPQueryIMEA(ptr) Modified: trunk/reactos/win32ss/user/user32/windows/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
============================================================================== --- trunk/reactos/win32ss/user/user32/windows/menu.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/menu.c [iso-8859-1] Tue Mar 18 21:54:59 2014 @@ -4181,20 +4181,17 @@ return TRUE; } -// So this one maybe one day it will be a callback! BOOL WINAPI HiliteMenuItem( HWND hWnd, HMENU hMenu, UINT wItemID, UINT wHilite ) { ROSMENUINFO MenuInfo; - ROSMENUITEMINFO mii; TRACE("(%p, %p, %04x, %04x);\n", hWnd, hMenu, wItemID, wHilite); - if (!hWnd) - { - SetLastError(ERROR_INVALID_WINDOW_HANDLE); - return FALSE; - } - if (!NtUserMenuItemInfo(hMenu, wItemID, wHilite, &mii, FALSE)) return FALSE; - if (!NtUserMenuInfo(hMenu, &MenuInfo, FALSE)) return FALSE; + // Force bits to be set call server side.... + // This alone works and passes all the menu test_menu_hilitemenuitem tests. + if (!NtUserHiliteMenuItem(hWnd, hMenu, wItemID, wHilite)) return FALSE; + // Without the above call we fail 3 out of the wine failed todo tests, see CORE-7967 + // Now redraw menu. + if (!MenuGetRosMenuInfo(&MenuInfo, hMenu)) return FALSE; if (MenuInfo.FocusedItem == wItemID) return TRUE; MenuHideSubPopups( hWnd, &MenuInfo, FALSE, 0 ); MenuSelectItem( hWnd, &MenuInfo, wItemID, TRUE, 0 );
10 years, 9 months
1
0
0
0
[tkreuzer] 62532: [NTOSKRNL] Fix KiCallbackReturnHandler
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Mar 18 20:41:26 2014 New Revision: 62532 URL:
http://svn.reactos.org/svn/reactos?rev=62532&view=rev
Log: [NTOSKRNL] Fix KiCallbackReturnHandler Modified: branches/kernel-fun/reactos/ntoskrnl/ke/i386/traphdlr.c Modified: branches/kernel-fun/reactos/ntoskrnl/ke/i386/traphdlr.c URL:
http://svn.reactos.org/svn/reactos/branches/kernel-fun/reactos/ntoskrnl/ke/…
============================================================================== --- branches/kernel-fun/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] (original) +++ branches/kernel-fun/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] Tue Mar 18 20:41:26 2014 @@ -1455,7 +1455,17 @@ FASTCALL KiCallbackReturnHandler(IN PKTRAP_FRAME TrapFrame) { + PKTHREAD Thread; NTSTATUS Status; + + /* Save the SEH chain, NtCallbackReturn will restore this */ + TrapFrame->ExceptionList = KeGetPcr()->NtTib.ExceptionList; + + /* Set thread fields */ + Thread = KeGetCurrentThread(); + Thread->TrapFrame = TrapFrame; + Thread->PreviousMode = KiUserTrap(TrapFrame); + NT_ASSERT(Thread->PreviousMode != KernelMode); /* Pass the register parameters to NtCallbackReturn. Result pointer is in ecx, result length in edx, status in eax */
10 years, 9 months
1
0
0
0
[tkreuzer] 62531: [NTOSKRNL] Fix an ASSERT in ExfReleasePushLockExclusive
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Mar 18 20:40:51 2014 New Revision: 62531 URL:
http://svn.reactos.org/svn/reactos?rev=62531&view=rev
Log: [NTOSKRNL] Fix an ASSERT in ExfReleasePushLockExclusive Modified: branches/kernel-fun/reactos/ntoskrnl/ex/pushlock.c Modified: branches/kernel-fun/reactos/ntoskrnl/ex/pushlock.c URL:
http://svn.reactos.org/svn/reactos/branches/kernel-fun/reactos/ntoskrnl/ex/…
============================================================================== --- branches/kernel-fun/reactos/ntoskrnl/ex/pushlock.c [iso-8859-1] (original) +++ branches/kernel-fun/reactos/ntoskrnl/ex/pushlock.c [iso-8859-1] Tue Mar 18 20:40:51 2014 @@ -1130,7 +1130,7 @@ NewValue.Value = OldValue.Value &~ EX_PUSH_LOCK_LOCK; /* Sanity check */ - ASSERT(NewValue.Waking && !NewValue.Waiting); + ASSERT(NewValue.Waking || !NewValue.Waiting); /* Write the New Value */ NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr,
10 years, 9 months
1
0
0
0
[dquintana] 62530: Sync with trunk r62529.
by dquintana@svn.reactos.org
Author: dquintana Date: Tue Mar 18 14:39:04 2014 New Revision: 62530 URL:
http://svn.reactos.org/svn/reactos?rev=62530&view=rev
Log: Sync with trunk r62529. Added: branches/shell-experiments/base/applications/cmdutils/mode/ - copied from r62529, trunk/reactos/base/applications/cmdutils/mode/ Modified: branches/shell-experiments/ (props changed) branches/shell-experiments/base/applications/cmdutils/CMakeLists.txt branches/shell-experiments/base/applications/cmdutils/doskey/doskey.rc branches/shell-experiments/base/applications/cmdutils/find/find.rc branches/shell-experiments/base/applications/cmdutils/more/CMakeLists.txt branches/shell-experiments/base/applications/cmdutils/more/more.rc branches/shell-experiments/base/applications/cmdutils/xcopy/rsrc.rc branches/shell-experiments/base/shell/cmd/lang/es-ES.rc branches/shell-experiments/base/shell/cmd/lang/fr-FR.rc branches/shell-experiments/base/shell/cmd/lang/hu-HU.rc branches/shell-experiments/base/shell/cmd/lang/id-ID.rc branches/shell-experiments/base/shell/cmd/lang/it-IT.rc branches/shell-experiments/base/shell/cmd/lang/no-NO.rc branches/shell-experiments/base/shell/cmd/lang/pl-PL.rc branches/shell-experiments/base/shell/cmd/lang/ru-RU.rc branches/shell-experiments/base/shell/cmd/lang/sv-SE.rc branches/shell-experiments/cmake/msvc.cmake branches/shell-experiments/dll/win32/msv1_0/msv1_0.c branches/shell-experiments/drivers/input/i8042prt/pnp.c branches/shell-experiments/drivers/usb/usbd/usbd.c branches/shell-experiments/ntoskrnl/io/pnpmgr/pnpmgr.c branches/shell-experiments/win32ss/user/ntuser/menu.c branches/shell-experiments/win32ss/user/ntuser/window.c branches/shell-experiments/win32ss/user/user32/windows/menu.c branches/shell-experiments/win32ss/user/winsrv/consrv/condrv/graphics.c branches/shell-experiments/win32ss/user/winsrv/consrv/condrv/text.c branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/graphics.c branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/text.c branches/shell-experiments/win32ss/user/winsrv/consrv/settings.c Propchange: branches/shell-experiments/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Mar 18 14:39:04 2014 @@ -16,4 +16,4 @@ /branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859 /branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567 /branches/wlan-bringup:54809-54998 -/trunk/reactos:61927-62502 +/trunk/reactos:61927-62529 Modified: branches/shell-experiments/base/applications/cmdutils/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicat…
============================================================================== --- branches/shell-experiments/base/applications/cmdutils/CMakeLists.txt [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/cmdutils/CMakeLists.txt [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -4,6 +4,7 @@ add_subdirectory(help) add_subdirectory(hostname) add_subdirectory(lodctr) +add_subdirectory(mode) add_subdirectory(more) add_subdirectory(reg) add_subdirectory(taskkill) Modified: branches/shell-experiments/base/applications/cmdutils/doskey/doskey.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicat…
============================================================================== --- branches/shell-experiments/base/applications/cmdutils/doskey/doskey.rc [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/cmdutils/doskey/doskey.rc [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -2,7 +2,7 @@ #include "doskey.h" -#define REACTOS_STR_FILE_DESCRIPTION "W32 doskey command" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Doskey Command" #define REACTOS_STR_INTERNAL_NAME "doskey" #define REACTOS_STR_ORIGINAL_FILENAME "doskey.exe" #include <reactos/version.rc> Modified: branches/shell-experiments/base/applications/cmdutils/find/find.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicat…
============================================================================== --- branches/shell-experiments/base/applications/cmdutils/find/find.rc [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/cmdutils/find/find.rc [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -2,7 +2,7 @@ #include "resource.h" -#define REACTOS_STR_FILE_DESCRIPTION "W32 find command" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Find Command" #define REACTOS_STR_INTERNAL_NAME "find" #define REACTOS_STR_ORIGINAL_FILENAME "find.exe" #include <reactos/version.rc> Modified: branches/shell-experiments/base/applications/cmdutils/more/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicat…
============================================================================== --- branches/shell-experiments/base/applications/cmdutils/more/CMakeLists.txt [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/cmdutils/more/CMakeLists.txt [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -1,5 +1,7 @@ add_executable(more more.c more.rc) set_module_type(more win32cui) +set_target_properties(more PROPERTIES SUFFIX ".com") + add_importlibs(more user32 msvcrt kernel32) add_cd_file(TARGET more DESTINATION reactos/system32 FOR all) Modified: branches/shell-experiments/base/applications/cmdutils/more/more.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicat…
============================================================================== --- branches/shell-experiments/base/applications/cmdutils/more/more.rc [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/cmdutils/more/more.rc [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -2,9 +2,9 @@ #include "resource.h" -#define REACTOS_STR_FILE_DESCRIPTION "W32 more command" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS More Command" #define REACTOS_STR_INTERNAL_NAME "more" -#define REACTOS_STR_ORIGINAL_FILENAME "more.exe" +#define REACTOS_STR_ORIGINAL_FILENAME "
more.com
" #include <reactos/version.rc> /* UTF-8 */ Modified: branches/shell-experiments/base/applications/cmdutils/xcopy/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicat…
============================================================================== --- branches/shell-experiments/base/applications/cmdutils/xcopy/rsrc.rc [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/cmdutils/xcopy/rsrc.rc [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -20,7 +20,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#define REACTOS_STR_FILE_DESCRIPTION "xcopy command" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Xcopy Command" #define REACTOS_STR_INTERNAL_NAME "xcopy" #define REACTOS_STR_ORIGINAL_FILENAME "xcopy.exe" #include <reactos/version.rc> Modified: branches/shell-experiments/base/shell/cmd/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/cm…
============================================================================== --- branches/shell-experiments/base/shell/cmd/lang/es-ES.rc [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/cmd/lang/es-ES.rc [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -182,7 +182,7 @@ STRING_DIR_HELP3 " El volumen en la unidad %c no tiene etiqueta.\n" STRING_DIR_HELP4 " El volumen Serial Number is %04X-%04X\n" STRING_DIR_HELP5 "\n Total de archivos mostrados:\n%16i archivo(s)% 14s bytes\n" - STRING_DIR_HELP6 "%16i Directorio(s)% 15s bytes\n" + STRING_DIR_HELP6 "%16i Directorio(s)% 15s bytes libres\n" STRING_DIR_HELP7 "\n Directorio %s\n\n" STRING_DIR_HELP8 "%16i archivo(s)% 14s bytes\n" STRING_DIRSTACK_HELP1 "Almacena el directorio actual para usarlo por el comando, \n\ Modified: branches/shell-experiments/base/shell/cmd/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/cm…
============================================================================== --- branches/shell-experiments/base/shell/cmd/lang/fr-FR.rc [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/cmd/lang/fr-FR.rc [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -192,7 +192,7 @@ STRING_DIR_HELP3 " Le lecteur %c n'a pas de nom de volume\n" STRING_DIR_HELP4 " Le numéro de série du volume est %04X-%04X\n" STRING_DIR_HELP5 "\n Total de fichiers listés :\n%16i Fichier(s)% 14s octets\n" - STRING_DIR_HELP6 "%16i Rep(s)% 15s octets\n" + STRING_DIR_HELP6 "%16i Rep(s)% 15s octets libres\n" STRING_DIR_HELP7 "\n Répertoire de %s\n\n" STRING_DIR_HELP8 "%16i Fichier(s)% 14s octets\n" STRING_DIRSTACK_HELP1 "Stocke le répertoire courant pour utilisation avec la commande POPD,\n\ Modified: branches/shell-experiments/base/shell/cmd/lang/hu-HU.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/cm…
============================================================================== --- branches/shell-experiments/base/shell/cmd/lang/hu-HU.rc [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/cmd/lang/hu-HU.rc [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -170,7 +170,7 @@ STRING_DIR_HELP3 " A (%c) meghajtóban található kötetnek nincs cÃmkéje.\n" STRING_DIR_HELP4 " A kötet sorozatszáma: %04X-%04X\n" STRING_DIR_HELP5 "\n Ãsszes állomány:\n%16i Ãllomány(ok)% 14s bájt\n" - STRING_DIR_HELP6 "%16i Mappa %15s bájt" + STRING_DIR_HELP6 "%16i Mappa %15s bájt szabad" STRING_DIR_HELP7 "\n %s tartalma\n\n" STRING_DIR_HELP8 "%16i Ãllomány %14s bájt\n" STRING_DIRSTACK_HELP1 "Megjegyzi az aktuális mappát, majd átvált egy máasikra.\n\n\ Modified: branches/shell-experiments/base/shell/cmd/lang/id-ID.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/cm…
============================================================================== --- branches/shell-experiments/base/shell/cmd/lang/id-ID.rc [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/cmd/lang/id-ID.rc [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -181,7 +181,7 @@ STRING_DIR_HELP3 " Volume di drive %c tidak berlabel.\n" STRING_DIR_HELP4 " Nomor Seri Volume adalah %04X-%04X\n" STRING_DIR_HELP5 "\n Total File Didaftar:\n%16i File% 14s byte\n" - STRING_DIR_HELP6 "%16i Dir% 15s byte\n" + STRING_DIR_HELP6 "%16i Dir% 15s byte tersisa\n" STRING_DIR_HELP7 "\n Direktori %s\n\n" STRING_DIR_HELP8 "%16i File% 14s byte\n" STRING_DIRSTACK_HELP1 "Menyimpan direktori sekarang untuk digunakan oleh perintah POPD, lalu\n\ Modified: branches/shell-experiments/base/shell/cmd/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/cm…
============================================================================== --- branches/shell-experiments/base/shell/cmd/lang/it-IT.rc [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/cmd/lang/it-IT.rc [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -178,7 +178,7 @@ STRING_DIR_HELP3 " Il Volume nel disco %c non ha etichetta.\n" STRING_DIR_HELP4 " Il numero di serie del Volume è %04X-%04X\n" STRING_DIR_HELP5 "\n Numero dei file elencati:\n%16i % 14s byte\n" - STRING_DIR_HELP6 "%16i Cartelle% 15s byte\n" + STRING_DIR_HELP6 "%16i Cartelle% 15s byte liberi\n" STRING_DIR_HELP7 "\n Cartelle di %s\n\n" STRING_DIR_HELP8 "%16i File% 14s byte\n" STRING_DIRSTACK_HELP1 "Salva la cartella corrente per l'uso con il comando POPD, poi\n\ Modified: branches/shell-experiments/base/shell/cmd/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/cm…
============================================================================== --- branches/shell-experiments/base/shell/cmd/lang/no-NO.rc [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/cmd/lang/no-NO.rc [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -179,7 +179,7 @@ STRING_DIR_HELP3 " Volumet i stasjon %c er uten navn.\n" STRING_DIR_HELP4 " Volumserienummeret er %04X-%04X\n" STRING_DIR_HELP5 "\n Totalt filer listet:\n%16i fil(er)% 14s byte\n" - STRING_DIR_HELP6 "%16i mappe(r)% 15s byte\n" + STRING_DIR_HELP6 "%16i mappe(r)% 15s byte ledig\n" STRING_DIR_HELP7 "\n mappe av %s\n\n" STRING_DIR_HELP8 "%16i fil(er)% 14s byte\n" STRING_DIRSTACK_HELP1 "Lagrer gjeldende mappe for bruk av POPD kommando, og\n\ Modified: branches/shell-experiments/base/shell/cmd/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/cm…
============================================================================== --- branches/shell-experiments/base/shell/cmd/lang/pl-PL.rc [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/cmd/lang/pl-PL.rc [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -187,7 +187,7 @@ STRING_DIR_HELP3 " Wolumin w napÄdzie %c nie posiada etykiety.\n" STRING_DIR_HELP4 " Numer seryjny woluminu to: %04X-%04X\n" STRING_DIR_HELP5 "\n OgóÅem wyÅwietonych:\n%16i plik(ów)% 14s bajtów\n" - STRING_DIR_HELP6 "%16i katalog(ów)% 15s bajtów\n" + STRING_DIR_HELP6 "%16i katalog(ów)% 15s bajtów wolne\n" STRING_DIR_HELP7 "\n katalog %s\n\n" STRING_DIR_HELP8 "%16i plik(ów)% 14s bajtów\n" STRING_DIRSTACK_HELP1 "Przechowuje obecny katalog dla potrzeb komendy POPD, nastÄpnie\n\ Modified: branches/shell-experiments/base/shell/cmd/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/cm…
============================================================================== --- branches/shell-experiments/base/shell/cmd/lang/ru-RU.rc [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/cmd/lang/ru-RU.rc [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -180,7 +180,7 @@ STRING_DIR_HELP3 " Том в ÑÑÑÑойÑÑве %c не Ð¸Ð¼ÐµÐµÑ Ð¼ÐµÑки.\n" STRING_DIR_HELP4 " СеÑийнÑй Ð½Ð¾Ð¼ÐµÑ Ñома: %04X-%04X\n" STRING_DIR_HELP5 "\n ÐÑего:\n%16i Файл(ов)% 14s байÑ\n" - STRING_DIR_HELP6 "%16i Dir(s)% 15s байÑ\n" + STRING_DIR_HELP6 "%16i Dir(s)% 15s Ð±Ð°Ð¹Ñ Ñвободно\n" STRING_DIR_HELP7 "\n ÐаÑалог of %s\n\n" STRING_DIR_HELP8 "%16i Ñайл(ов)% 14s байÑ\n" STRING_DIRSTACK_HELP1 "Ð¡Ð¾Ñ ÑанÑÐµÑ ÑекÑÑÑÑ Ð´Ð¸ÑекÑоÑÐ¸Ñ Ð´Ð»Ñ Ð¸ÑполÑÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¾Ð¹ POPD, заÑем\n\ Modified: branches/shell-experiments/base/shell/cmd/lang/sv-SE.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/cm…
============================================================================== --- branches/shell-experiments/base/shell/cmd/lang/sv-SE.rc [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/cmd/lang/sv-SE.rc [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -179,7 +179,7 @@ STRING_DIR_HELP3 " Volumet i enhet %c är utan namn.\n" STRING_DIR_HELP4 " Volymens serienummer är %04X-%04X\n" STRING_DIR_HELP5 "\n Totalt filer listet:\n%16i fil(är)% 14s byte\n" - STRING_DIR_HELP6 "%16i mapp(ar)% 15s byte\n" + STRING_DIR_HELP6 "%16i mapp(ar)% 15s byte ledigt\n" STRING_DIR_HELP7 "\n mapp av %s\n\n" STRING_DIR_HELP8 "%16i fil(er)% 14s byte\n" STRING_DIRSTACK_HELP1 "Sparar aktuell mapp for användning av POPD kommandot, och\n\ Modified: branches/shell-experiments/cmake/msvc.cmake URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/cmake/msvc.cm…
============================================================================== --- branches/shell-experiments/cmake/msvc.cmake [iso-8859-1] (original) +++ branches/shell-experiments/cmake/msvc.cmake [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -302,7 +302,7 @@ endfunction() macro(macro_mc FLAG FILE) - set(COMMAND_MC ${CMAKE_MC_COMPILER} ${FLAG} -r ${REACTOS_BINARY_DIR}/include/reactos -h ${REACTOS_BINARY_DIR}/include/reactos ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc) + set(COMMAND_MC ${CMAKE_MC_COMPILER} ${FLAG} -b ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc -r ${REACTOS_BINARY_DIR}/include/reactos -h ${REACTOS_BINARY_DIR}/include/reactos) endmacro() #pseh workaround Modified: branches/shell-experiments/dll/win32/msv1_0/msv1_0.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/msv…
============================================================================== --- branches/shell-experiments/dll/win32/msv1_0/msv1_0.c [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/msv1_0/msv1_0.c [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -966,6 +966,10 @@ PSAMPR_USER_INFO_BUFFER UserInfo = NULL; UNICODE_STRING LogonServer; BOOLEAN SessionCreated = FALSE; + LARGE_INTEGER LogonTime; +// LARGE_INTEGER AccountExpires; + LARGE_INTEGER PasswordMustChange; + LARGE_INTEGER PasswordLastSet; NTSTATUS Status; TRACE("()\n"); @@ -1005,6 +1009,10 @@ return STATUS_NOT_IMPLEMENTED; } + /* Get the logon time */ + NtQuerySystemTime(&LogonTime); + + /* Get the domain SID */ Status = GetDomainSid(&AccountDomainSid); if (!NT_SUCCESS(Status)) { @@ -1080,8 +1088,19 @@ goto done; } - TRACE("UserName: %S\n", UserInfo->All.UserName.Buffer); + + /* Check the password */ + if ((UserInfo->All.UserAccountControl & USER_PASSWORD_NOT_REQUIRED) == 0) + { + Status = MsvpCheckPassword(&(LogonInfo->Password), + UserInfo); + if (!NT_SUCCESS(Status)) + { + TRACE("MsvpCheckPassword failed (Status %08lx)\n", Status); + goto done; + } + } /* Check account restrictions for non-administrator accounts */ if (RelativeIds.Element[0] != DOMAIN_USER_RID_ADMIN) @@ -1098,29 +1117,48 @@ /* Check if the account has been locked */ if (UserInfo->All.UserAccountControl & USER_ACCOUNT_AUTO_LOCKED) { - ERR("Account disabled!\n"); + ERR("Account locked!\n"); *SubStatus = STATUS_ACCOUNT_LOCKED_OUT; Status = STATUS_ACCOUNT_RESTRICTION; goto done; } +#if 0 + /* Check if the account expired */ + AccountExpires.LowPart = UserInfo->All.AccountExpires.LowPart; + AccountExpires.HighPart = UserInfo->All.AccountExpires.HighPart; + + if (AccountExpires.QuadPart != 0 && + LogonTime.QuadPart >= AccountExpires.QuadPart) + { + ERR("Account expired!\n"); + *SubStatus = STATUS_ACCOUNT_EXPIRED; + Status = STATUS_ACCOUNT_RESTRICTION; + goto done; + } +#endif + + /* Check if the password expired */ + PasswordMustChange.LowPart = UserInfo->All.PasswordMustChange.LowPart; + PasswordMustChange.HighPart = UserInfo->All.PasswordMustChange.HighPart; + PasswordLastSet.LowPart = UserInfo->All.PasswordLastSet.LowPart; + PasswordLastSet.HighPart = UserInfo->All.PasswordLastSet.HighPart; + + if (LogonTime.QuadPart >= PasswordMustChange.QuadPart) + { + ERR("Password expired!\n"); + if (PasswordLastSet.QuadPart == 0) + *SubStatus = STATUS_PASSWORD_MUST_CHANGE; + else + *SubStatus = STATUS_PASSWORD_EXPIRED; + + Status = STATUS_ACCOUNT_RESTRICTION; + goto done; + } + /* FIXME: more checks */ -// *SubStatus = STATUS_PASSWORD_EXPIRED; -// *SubStatus = STATUS_INVALID_LOGON_HOURS; -// *SubStatus = STATUS_INVALID_WORKSTATION; - - } - - /* Check the password */ - if ((UserInfo->All.UserAccountControl & USER_PASSWORD_NOT_REQUIRED) == 0) - { - Status = MsvpCheckPassword(&(LogonInfo->Password), - UserInfo); - if (!NT_SUCCESS(Status)) - { - TRACE("MsvpCheckPassword failed (Status %08lx)\n", Status); - goto done; - } + // STATUS_INVALID_LOGON_HOURS; + // STATUS_INVALID_WORKSTATION; } /* Return logon information */ @@ -1220,7 +1258,7 @@ Status = STATUS_LOGON_FAILURE; } - TRACE("LsaApLogonUser done (Status %08lx)\n", Status); + TRACE("LsaApLogonUser done (Status 0x%08lx SubStatus 0x%08lx)\n", Status, *SubStatus); return Status; } Modified: branches/shell-experiments/drivers/input/i8042prt/pnp.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/drivers/input…
============================================================================== --- branches/shell-experiments/drivers/input/i8042prt/pnp.c [iso-8859-1] (original) +++ branches/shell-experiments/drivers/input/i8042prt/pnp.c [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -437,6 +437,7 @@ Status = EnableInterrupts(DeviceExtension, FlagsToDisable, FlagsToEnable); if (!NT_SUCCESS(Status)) { + WARN_(I8042PRT, "EnableInterrupts failed: %lx\n", Status); DeviceExtension->Flags &= ~(KEYBOARD_PRESENT | MOUSE_PRESENT); return Status; } @@ -454,6 +455,10 @@ { DeviceExtension->Flags |= KEYBOARD_INITIALIZED; } + else + { + WARN_(I8042PRT, "i8042ConnectKeyboardInterrupt failed: %lx\n", Status); + } } if (DeviceExtension->Flags & MOUSE_PRESENT && @@ -467,7 +472,11 @@ { DeviceExtension->Flags |= MOUSE_INITIALIZED; } - + else + { + WARN_(I8042PRT, "i8042ConnectMouseInterrupt failed: %lx\n", Status); + } + /* Start the mouse */ Irql = KeAcquireInterruptSpinLock(DeviceExtension->HighestDIRQLInterrupt); i8042IsrWritePort(DeviceExtension, MOU_CMD_RESET, CTRL_WRITE_MOUSE); @@ -533,7 +542,7 @@ { if (ResourceDescriptor->u.Port.Length == 1) { - /* We assume that the first ressource will + /* We assume that the first resource will * be the control port and the second one * will be the data port... */ @@ -551,8 +560,8 @@ } else { - WARN_(I8042PRT, "Too much I/O ranges provided: 0x%lx\n", ResourceDescriptor->u.Port.Length); - return STATUS_INVALID_PARAMETER; + /* FIXME: implement PS/2 Active Multiplexing */ + ERR_(I8042PRT, "Unhandled I/O ranges provided: 0x%lx\n", ResourceDescriptor->u.Port.Length); } } else Modified: branches/shell-experiments/drivers/usb/usbd/usbd.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/drivers/usb/u…
============================================================================== --- branches/shell-experiments/drivers/usb/usbd/usbd.c [iso-8859-1] (original) +++ branches/shell-experiments/drivers/usb/usbd/usbd.c [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -17,7 +17,7 @@ * Notes: * This driver was obsoleted in Windows XP and most functions * became pure stubs. But some of them were retained for backward - * compatibilty with existing drivers. + * compatibility with existing drivers. * * Preserved functions: * Modified: branches/shell-experiments/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/ntoskrnl/io/p…
============================================================================== --- branches/shell-experiments/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original) +++ branches/shell-experiments/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -648,7 +648,7 @@ ASSERT(!(DeviceNode->Flags & DNF_DISABLED)); - /* Build the I/O stack locaiton */ + /* Build the I/O stack location */ RtlZeroMemory(&Stack, sizeof(IO_STACK_LOCATION)); Stack.MajorFunction = IRP_MJ_PNP; Stack.MinorFunction = IRP_MN_START_DEVICE; Modified: branches/shell-experiments/win32ss/user/ntuser/menu.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
============================================================================== --- branches/shell-experiments/win32ss/user/ntuser/menu.c [iso-8859-1] (original) +++ branches/shell-experiments/win32ss/user/ntuser/menu.c [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -271,7 +271,7 @@ Menu->MenuInfo.dwMenuData = 0; /* Default */ Menu->MenuInfo.Self = *Handle; Menu->MenuInfo.FocusedItem = NO_SELECTED_ITEM; - Menu->MenuInfo.Flags = (IsMenuBar ? 0 : MF_POPUP); + Menu->MenuInfo.Flags = (IsMenuBar ? 0 : MNF_POPUP); Menu->MenuInfo.Wnd = NULL; Menu->MenuInfo.WndOwner = NULL; Menu->MenuInfo.Height = 0; @@ -454,7 +454,17 @@ Menu->MenuInfo.dwStyle = lpmi->dwStyle; if(lpmi->fMask & MIM_APPLYTOSUBMENUS) { - /* FIXME */ + int i; + PMENU_ITEM item = Menu->MenuItemList; + for ( i = Menu->MenuInfo.MenuItemCount; i; i--, item = item->Next) + { + if ( item->hSubMenu ) + { + PMENU_OBJECT SubMenu; + if (!(SubMenu = UserGetMenuObject(item->hSubMenu))) continue; + IntSetMenuInfo( SubMenu, lpmi); + } + } } if (sizeof(MENUINFO) < lpmi->cbSize) { @@ -741,7 +751,7 @@ SubMenuObject = UserGetMenuObject(MenuItem->hSubMenu); if (SubMenuObject != NULL) { - SubMenuObject->MenuInfo.Flags |= MF_POPUP; + SubMenuObject->MenuInfo.Flags |= MNF_POPUP; } } } @@ -775,7 +785,7 @@ } else { - if (0 == (MenuObject->MenuInfo.Flags & MF_SYSMENU)) + if (0 == (MenuObject->MenuInfo.Flags & MNF_SYSDESKMN)) { MenuItem->fType |= MF_SEPARATOR; } @@ -1724,6 +1734,50 @@ END_CLEANUP; } +BOOL FASTCALL +IntGetMenuItemRect( + PWND pWnd, + PMENU_OBJECT Menu, + UINT uItem, + PRECTL Rect) +{ + LONG XMove, YMove; + PMENU_ITEM MenuItem; + int p = 0; + + if (!pWnd) + { + HWND hWnd = Menu->MenuInfo.Wnd; + if (!(pWnd = UserGetWindowObject(hWnd))) return FALSE; + } + + if ((p = IntGetMenuItemByFlag(Menu, uItem, MF_BYPOSITION, NULL, &MenuItem, NULL)) > -1) + *Rect = MenuItem->Rect; + else + { + ERR("Failed Item Lookup! %d\n", p); + return FALSE; + } + + if (Menu->MenuInfo.Flags & MNF_POPUP) + { + XMove = pWnd->rcClient.left; + YMove = pWnd->rcClient.top; + } + else + { + XMove = pWnd->rcWindow.left; + YMove = pWnd->rcWindow.top; + } + + Rect->left += XMove; + Rect->top += YMove; + Rect->right += XMove; + Rect->bottom += YMove; + + return TRUE; +} + /* * @implemented */ @@ -1734,219 +1788,126 @@ LONG idItem, PMENUBARINFO pmbi) { - BOOL Res = TRUE; - PMENU_OBJECT MenuObject; - PMENU_ITEM mi; - PWND WindowObject; + PWND pWnd; HMENU hMenu; - POINT Offset; - RECTL Rect; MENUBARINFO kmbi; + BOOL Ret; + NTSTATUS Status = STATUS_SUCCESS; + PMENU_OBJECT Menu = NULL; DECLARE_RETURN(BOOL); TRACE("Enter NtUserGetMenuBarInfo\n"); UserEnterShared(); - if (!(WindowObject = UserGetWindowObject(hwnd))) - { + if (!(pWnd = UserGetWindowObject(hwnd))) + { EngSetLastError(ERROR_INVALID_WINDOW_HANDLE); RETURN(FALSE); - } - - hMenu = (HMENU)(DWORD_PTR)WindowObject->IDMenu; - - if (!(MenuObject = UserGetMenuObject(hMenu))) - { - EngSetLastError(ERROR_INVALID_MENU_HANDLE); - RETURN(FALSE); - } - - if (pmbi->cbSize != sizeof(MENUBARINFO)) - { + } + + switch (idObject) + { + case OBJID_CLIENT: + if (!pWnd->pcls->fnid) + RETURN(FALSE); + if (pWnd->pcls->fnid != FNID_MENU) + { + WARN("called on invalid window: %d\n", pWnd->pcls->fnid); + EngSetLastError(ERROR_INVALID_MENU_HANDLE); + RETURN(FALSE); + } + // Windows does this! Wine checks for Atom and uses GetWindowLongPtrW. + hMenu = (HMENU)co_IntSendMessage(hwnd, MN_GETHMENU, 0, 0); + break; + case OBJID_MENU: + hMenu = UlongToHandle(pWnd->IDMenu); + break; + case OBJID_SYSMENU: + if (!(pWnd->style & WS_SYSMENU)) RETURN(FALSE); + Menu = IntGetSystemMenu(pWnd, FALSE, FALSE); + hMenu = Menu->MenuInfo.Self; + break; + default: + RETURN(FALSE); + } + + if (!hMenu) + RETURN(FALSE); + + _SEH2_TRY + { + kmbi.cbSize = pmbi->cbSize; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + kmbi.cbSize = 0; + } + _SEH2_END + + if (kmbi.cbSize != sizeof(MENUBARINFO)) + { EngSetLastError(ERROR_INVALID_PARAMETER); RETURN(FALSE); - } - - kmbi.cbSize = sizeof(MENUBARINFO); - kmbi.fBarFocused = FALSE; - kmbi.fFocused = FALSE; + } + + if (!Menu) Menu = UserGetMenuObject(hMenu); + if (!Menu) + RETURN(FALSE); + + if (idItem < 0 || idItem > Menu->MenuInfo.MenuItemCount) + RETURN(FALSE); + + RECTL_vSetEmptyRect(&kmbi.rcBar); + + if (idItem == 0) + { + Ret = IntGetMenuItemRect(pWnd, Menu, -1, &kmbi.rcBar); + kmbi.rcBar.right = kmbi.rcBar.left + Menu->MenuInfo.Width; + kmbi.rcBar.bottom = kmbi.rcBar.top + Menu->MenuInfo.Height; + ERR("idItem 0 %d\n",Ret); + } + else + { + Ret = IntGetMenuItemRect(pWnd, Menu, idItem-1, &kmbi.rcBar); + ERR("idItem X %d\n", Ret); + } + + kmbi.hMenu = hMenu; kmbi.hwndMenu = NULL; - - switch (idObject) - { - case OBJID_MENU: - { - PMENU_OBJECT SubMenuObject; - kmbi.hMenu = hMenu; - if (idItem) /* Non-Zero-Based. */ - { - if (IntGetMenuItemByFlag(MenuObject, idItem-1, MF_BYPOSITION, NULL, &mi, NULL) > -1) - kmbi.rcBar = mi->Rect; - else - { - Res = FALSE; - break; - } - } - else - { - /* If items is zero we assume info for the menu itself. */ - if (!(IntGetClientOrigin(WindowObject, &Offset))) - { - Res = FALSE; - break; - } - Rect.left = Offset.x; - Rect.right = Offset.x + MenuObject->MenuInfo.Width; - Rect.bottom = Offset.y; - Rect.top = Offset.y - MenuObject->MenuInfo.Height; - kmbi.rcBar = Rect; - TRACE("Rect top = %d bottom = %d left = %d right = %d \n", - Rect.top, Rect.bottom, Rect.left, Rect.right); - } - if (idItem) - { - if (idItem-1 == MenuObject->MenuInfo.FocusedItem) - kmbi.fFocused = TRUE; - } - if (MenuObject->MenuInfo.FocusedItem != NO_SELECTED_ITEM) - kmbi.fBarFocused = TRUE; - - if (MenuObject->MenuItemList) - { - SubMenuObject = UserGetMenuObject(MenuObject->MenuItemList->hSubMenu); - if(SubMenuObject) kmbi.hwndMenu = SubMenuObject->MenuInfo.Wnd; - } - TRACE("OBJID_MENU, idItem = %d\n",idItem); - break; - } - case OBJID_CLIENT: - { - PMENU_OBJECT SubMenuObject, XSubMenuObject; - HMENU hMenuChk; - // Windows does this! Wine checks for Atom and uses GetWindowLongPtrW. - hMenuChk = (HMENU)co_IntSendMessage(hwnd, MN_GETHMENU, 0, 0); - - if (!(MenuObject = UserGetMenuObject(hMenuChk))) - { - ERR("Window does not have a Popup Menu!\n"); - EngSetLastError(ERROR_INVALID_MENU_HANDLE); - RETURN(FALSE); - } - - SubMenuObject = UserGetMenuObject(MenuObject->MenuItemList->hSubMenu); - if(SubMenuObject) kmbi.hMenu = SubMenuObject->MenuInfo.Self; - else - { - Res = FALSE; - ERR("OBJID_CLIENT, No SubMenu!\n"); - break; - } - if (idItem) - { - if (IntGetMenuItemByFlag(SubMenuObject, idItem-1, MF_BYPOSITION, NULL, &mi, NULL) > -1) - kmbi.rcBar = mi->Rect; - else - { - Res = FALSE; - break; - } - } - else - { - PWND SubWinObj; - if (!(SubWinObj = UserGetWindowObject(SubMenuObject->MenuInfo.Wnd))) - { - Res = FALSE; - break; - } - if (!(IntGetClientOrigin(SubWinObj, &Offset))) - { - Res = FALSE; - break; - } - Rect.left = Offset.x; - Rect.right = Offset.x + SubMenuObject->MenuInfo.Width; - Rect.top = Offset.y; - Rect.bottom = Offset.y + SubMenuObject->MenuInfo.Height; - kmbi.rcBar = Rect; - } - if (idItem) - { - if (idItem-1 == SubMenuObject->MenuInfo.FocusedItem) - kmbi.fFocused = TRUE; - } - if (SubMenuObject->MenuInfo.FocusedItem != NO_SELECTED_ITEM) - kmbi.fBarFocused = TRUE; - XSubMenuObject = UserGetMenuObject(SubMenuObject->MenuItemList->hSubMenu); - if (XSubMenuObject) kmbi.hwndMenu = XSubMenuObject->MenuInfo.Wnd; - TRACE("OBJID_CLIENT, idItem = %d\n",idItem); - break; - } - case OBJID_SYSMENU: - { - PMENU_OBJECT SysMenuObject, SubMenuObject; - if(!(SysMenuObject = IntGetSystemMenu(WindowObject, FALSE, FALSE))) - { - Res = FALSE; - break; - } - kmbi.hMenu = SysMenuObject->MenuInfo.Self; - if (idItem) - { - if (IntGetMenuItemByFlag(SysMenuObject, idItem-1, MF_BYPOSITION, NULL, &mi, NULL) > -1) - kmbi.rcBar = mi->Rect; - else - { - Res = FALSE; - break; - } - } - else - { - PWND SysWinObj; - if (!(SysWinObj = UserGetWindowObject(SysMenuObject->MenuInfo.Wnd))) - { - Res = FALSE; - break; - } - if (!(IntGetClientOrigin(SysWinObj, &Offset))) - { - Res = FALSE; - break; - } - Rect.left = Offset.x; - Rect.right = Offset.x + SysMenuObject->MenuInfo.Width; - Rect.top = Offset.y; - Rect.bottom = Offset.y + SysMenuObject->MenuInfo.Height; - kmbi.rcBar = Rect; - } - if (idItem) - { - if (idItem-1 == SysMenuObject->MenuInfo.FocusedItem) - kmbi.fFocused = TRUE; - } - if (SysMenuObject->MenuInfo.FocusedItem != NO_SELECTED_ITEM) - kmbi.fBarFocused = TRUE; - SubMenuObject = UserGetMenuObject(SysMenuObject->MenuItemList->hSubMenu); - if(SubMenuObject) kmbi.hwndMenu = SubMenuObject->MenuInfo.Wnd; - TRACE("OBJID_SYSMENU, idItem = %d\n",idItem); - break; - } - default: - Res = FALSE; - ERR("Unknown idObject = %d, idItem = %d\n",idObject,idItem); - } - if (Res) - { - NTSTATUS Status = MmCopyToCaller(pmbi, &kmbi, sizeof(MENUBARINFO)); - if (! NT_SUCCESS(Status)) - { - SetLastNtError(Status); - RETURN(FALSE); - } - } - RETURN(Res); + //kmbi.fBarFocused = top_popup_hmenu == hMenu; + if (idItem) + { + PMENU_OBJECT SubMenuObject; + kmbi.fFocused = Menu->MenuInfo.FocusedItem == idItem-1; + + if ( kmbi.fFocused && Menu->MenuItemList->hSubMenu ) + { + SubMenuObject = UserGetMenuObject(Menu->MenuItemList->hSubMenu); + if (SubMenuObject) kmbi.hwndMenu = SubMenuObject->MenuInfo.Wnd; + } + } +/* else + { + kmbi.fFocused = kmbi.fBarFocused; + } +*/ + _SEH2_TRY + { + RtlCopyMemory(pmbi, &kmbi, sizeof(MENUBARINFO)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END + + if (!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + RETURN(FALSE); + } + + RETURN(TRUE); CLEANUP: TRACE("Leave NtUserGetMenuBarInfo, ret=%i\n",_ret_); @@ -2002,9 +1963,9 @@ PWND ReferenceWnd; LONG XMove, YMove; RECTL Rect; - NTSTATUS Status; PMENU_OBJECT Menu; PMENU_ITEM MenuItem; + NTSTATUS Status = STATUS_SUCCESS; DECLARE_RETURN(BOOL); TRACE("Enter NtUserGetMenuItemRect\n"); @@ -2029,7 +1990,7 @@ if (!(ReferenceWnd = UserGetWindowObject(hWnd))) RETURN( FALSE); - if(MenuItem->hSubMenu) + if (Menu->MenuInfo.Flags & MNF_POPUP) { XMove = ReferenceWnd->rcClient.left; YMove = ReferenceWnd->rcClient.top; @@ -2045,13 +2006,22 @@ Rect.right += XMove; Rect.bottom += YMove; - Status = MmCopyToCaller(lprcItem, &Rect, sizeof(RECT)); - if (! NT_SUCCESS(Status)) + _SEH2_TRY + { + RtlCopyMemory(lprcItem, &Rect, sizeof(RECTL)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END + + if (!NT_SUCCESS(Status)) { SetLastNtError(Status); - RETURN( FALSE); - } - RETURN( TRUE); + RETURN(FALSE); + } + RETURN(TRUE); CLEANUP: TRACE("Leave NtUserGetMenuItemRect, ret=%i\n",_ret_); Modified: branches/shell-experiments/win32ss/user/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
============================================================================== --- branches/shell-experiments/win32ss/user/ntuser/window.c [iso-8859-1] (original) +++ branches/shell-experiments/win32ss/user/ntuser/window.c [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -931,7 +931,7 @@ if(NewMenu) { Window->SystemMenu = NewMenu->MenuInfo.Self; - NewMenu->MenuInfo.Flags |= MF_SYSMENU; + NewMenu->MenuInfo.Flags |= MNF_SYSDESKMN; NewMenu->MenuInfo.Wnd = Window->head.h; ret = NewMenu; //IntReleaseMenuObject(NewMenu); @@ -950,7 +950,7 @@ UserDestroyMenu(hSysMenu); return NULL; } - SysMenu->MenuInfo.Flags |= MF_SYSMENU; + SysMenu->MenuInfo.Flags |= MNF_SYSDESKMN; SysMenu->MenuInfo.Wnd = Window->head.h; hNewMenu = co_IntLoadSysMenuTemplate(); if(!hNewMenu) @@ -970,7 +970,8 @@ NewMenu = IntCloneMenu(Menu); if(NewMenu) { - NewMenu->MenuInfo.Flags |= MF_SYSMENU | MF_POPUP; + NewMenu->MenuInfo.Flags |= MNF_SYSDESKMN | MNF_POPUP; + NewMenu->MenuInfo.dwStyle = MNS_CHECKORBMP; IntReleaseMenuObject(NewMenu); UserSetMenuDefaultItem(NewMenu, SC_CLOSE, FALSE); @@ -1426,7 +1427,7 @@ OldMenu = IntGetMenuObject(Window->SystemMenu); if(OldMenu) { - OldMenu->MenuInfo.Flags &= ~ MF_SYSMENU; + OldMenu->MenuInfo.Flags &= ~ MNF_SYSDESKMN; IntReleaseMenuObject(OldMenu); } } @@ -1435,7 +1436,7 @@ { /* FIXME: Check window style, propably return FALSE? */ Window->SystemMenu = Menu->MenuInfo.Self; - Menu->MenuInfo.Flags |= MF_SYSMENU; + Menu->MenuInfo.Flags |= MNF_SYSDESKMN; } else Window->SystemMenu = (HMENU)0; Modified: branches/shell-experiments/win32ss/user/user32/windows/menu.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
============================================================================== --- branches/shell-experiments/win32ss/user/user32/windows/menu.c [iso-8859-1] (original) +++ branches/shell-experiments/win32ss/user/user32/windows/menu.c [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -36,6 +36,9 @@ #define TPM_BUTTONDOWN 0x40000000 /* menu was clicked before tracking */ #define TPM_POPUPMENU 0x20000000 /* menu is a popup menu */ +/* top and bottom margins for popup menus */ +#define MENU_TOP_MARGIN 3 +#define MENU_BOTTOM_MARGIN 2 #define MENU_TYPE_MASK (MF_STRING | MF_BITMAP | MF_OWNERDRAW | MF_SEPARATOR) @@ -46,10 +49,10 @@ #define IS_MAGIC_BITMAP(id) ((id) && ((INT_PTR)(id) < 12) && ((INT_PTR)(id) >= -1)) #define IS_SYSTEM_MENU(MenuInfo) \ - (0 == ((MenuInfo)->Flags & MF_POPUP) && 0 != ((MenuInfo)->Flags & MF_SYSMENU)) + (0 == ((MenuInfo)->Flags & MNF_POPUP) && 0 != ((MenuInfo)->Flags & MNF_SYSDESKMN)) #define IS_SYSTEM_POPUP(MenuInfo) \ - (0 != ((MenuInfo)->Flags & MF_POPUP) && 0 != ((MenuInfo)->Flags & MF_SYSMENU)) + (0 != ((MenuInfo)->Flags & MNF_POPUP) && 0 != ((MenuInfo)->Flags & MNF_SYSDESKMN)) #define IS_BITMAP_ITEM(flags) (MF_BITMAP == MENU_ITEM_TYPE(flags)) @@ -507,6 +510,7 @@ PROSMENUITEMINFO Items, ItemInfo; LRESULT MenuChar; UINT i; + WORD Flags = 0; TRACE("\tlooking for '%c' (0x%02x) in [%p]\n", (char) Key, Key, MenuInfo); @@ -546,8 +550,11 @@ } } + Flags |= MenuInfo->Flags & MNF_POPUP ? MF_POPUP : 0; + Flags |= MenuInfo->Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0; + MenuChar = SendMessageW(WndOwner, WM_MENUCHAR, - MAKEWPARAM(Key, MenuInfo->Flags), (LPARAM) MenuInfo->Self); + MAKEWPARAM(Key, Flags), (LPARAM) MenuInfo->Self); if (HIWORD(MenuChar) == MNC_EXECUTE) return LOWORD(MenuChar); if (HIWORD(MenuChar) == MNC_CLOSE) return (UINT)(-2); } @@ -1299,7 +1306,7 @@ HBITMAP bm; INT y = rect.top + rect.bottom; RECT rc = rect; - int checked = FALSE; + BOOL checked = FALSE; UINT check_bitmap_width = GetSystemMetrics( SM_CXMENUCHECK ); UINT check_bitmap_height = GetSystemMetrics( SM_CYMENUCHECK ); /* Draw the check mark @@ -1547,6 +1554,7 @@ POINT pt; HMONITOR monitor; MONITORINFO info; + DWORD ex_style = 0; TRACE("owner=%p hmenu=%p id=0x%04x x=0x%04x y=0x%04x xa=0x%04x ya=0x%04x\n", hwndOwner, hmenu, id, x, y, xanchor, yanchor); @@ -1588,6 +1596,11 @@ info.cbSize = sizeof(info); GetMonitorInfoW( monitor, &info ); + if (flags & TPM_LAYOUTRTL) + { + ex_style = WS_EX_LAYOUTRTL; + flags ^= TPM_RIGHTALIGN; + } if( flags & TPM_RIGHTALIGN ) x -= width; if( flags & TPM_CENTERALIGN ) x -= width / 2; @@ -1615,7 +1628,7 @@ if( y < info.rcMonitor.top ) y = info.rcMonitor.top; /* NOTE: In Windows, top menu popup is not owned. */ - MenuInfo.Wnd = CreateWindowExW( 0, WC_MENU, NULL, + MenuInfo.Wnd = CreateWindowExW( ex_style, WC_MENU, NULL, WS_POPUP, x, y, width, height, hwndOwner, 0, (HINSTANCE) GetWindowLongPtrW(hwndOwner, GWLP_HINSTANCE), (LPVOID) MenuInfo.Self); @@ -1650,7 +1663,7 @@ if (!hmenu || !hmenu->MenuItemCount || !hmenu->Wnd) return; if (hmenu->FocusedItem == wIndex) return; - if (hmenu->Flags & MF_POPUP) hdc = GetDC(hmenu->Wnd); + if (hmenu->Flags & MNF_POPUP) hdc = GetDC(hmenu->Wnd); else hdc = GetDCEx(hmenu->Wnd, 0, DCX_CACHE | DCX_WINDOW); if (!top_popup) { top_popup = hmenu->Wnd; @@ -1671,7 +1684,7 @@ MenuSetRosMenuItemInfo(hmenu->Self, hmenu->FocusedItem, &ItemInfo); } MenuDrawMenuItem(hmenu->Wnd, hmenu, hwndOwner, hdc, &ItemInfo, - hmenu->Height, ! (hmenu->Flags & MF_POPUP), + hmenu->Height, !(hmenu->Flags & MNF_POPUP), ODA_SELECT); } @@ -1688,20 +1701,24 @@ ItemInfo.fState |= MF_HILITE; MenuSetRosMenuItemInfo(hmenu->Self, hmenu->FocusedItem, &ItemInfo); MenuDrawMenuItem(hmenu->Wnd, hmenu, hwndOwner, hdc, - &ItemInfo, hmenu->Height, ! (hmenu->Flags & MF_POPUP), + &ItemInfo, hmenu->Height, !(hmenu->Flags & MNF_POPUP), ODA_SELECT); } if (sendMenuSelect) { - SendMessageW(hwndOwner, WM_MENUSELECT, - MAKELONG(ItemInfo.hSubMenu ? wIndex : ItemInfo.wID, - ItemInfo.fType | ItemInfo.fState | MF_MOUSESELECT | - (hmenu->Flags & (MF_SYSMENU|MF_POPUP))), (LPARAM) hmenu->Self); + WPARAM wParam = MAKEWPARAM( ItemInfo.hSubMenu ? wIndex : ItemInfo.wID, + ItemInfo.fType | ItemInfo.fState | + (ItemInfo.hSubMenu ? MF_POPUP : 0) | + (hmenu->Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); + + SendMessageW(hwndOwner, WM_MENUSELECT, wParam, (LPARAM) hmenu->Self); } } } - else if (sendMenuSelect) { - if(topmenu) { + else if (sendMenuSelect) + { + if(topmenu) + { int pos; pos = MenuFindSubMenu(&topmenu, hmenu->Self); if (pos != NO_SELECTED_ITEM) @@ -1709,11 +1726,11 @@ if (MenuGetRosMenuInfo(&TopMenuInfo, topmenu) && MenuGetRosMenuItemInfo(topmenu, pos, &ItemInfo)) { - SendMessageW(hwndOwner, WM_MENUSELECT, - MAKELONG(Pos, ItemInfo.fType | ItemInfo.fState - | MF_MOUSESELECT - | (TopMenuInfo.Flags & MF_SYSMENU)), - (LPARAM) topmenu); + WPARAM wParam = MAKEWPARAM( Pos, ItemInfo.fType | ItemInfo.fState | + (ItemInfo.hSubMenu ? MF_POPUP : 0) | + (TopMenuInfo.Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); + + SendMessageW(hwndOwner, WM_MENUSELECT, wParam, (LPARAM) topmenu); } } } @@ -1995,11 +2012,11 @@ * * NOTE: flags is equivalent to the mtOption field */ -static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu, BOOL unicode ) +static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu) { WORD flags, id = 0; HMENU hSubMenu; - LPCSTR str; + LPCWSTR str; BOOL end = FALSE; do @@ -2016,46 +2033,19 @@ id = GET_WORD(res); res += sizeof(WORD); } - str = res; - if(!unicode) - res += strlen(str) + 1; - else - res += (strlenW((LPCWSTR)str) + 1) * sizeof(WCHAR); + str = (LPCWSTR)res; + res += (strlenW(str) + 1) * sizeof(WCHAR); + if (flags & MF_POPUP) { hSubMenu = CreatePopupMenu(); if(!hSubMenu) return NULL; - if(!(res = MENU_ParseResource(res, hSubMenu, unicode))) - return NULL; - if(!unicode) - AppendMenuA(hMenu, flags, (UINT)hSubMenu, str); - else - AppendMenuW(hMenu, flags, (UINT)hSubMenu, (LPCWSTR)str); + if(!(res = MENU_ParseResource(res, hSubMenu))) return NULL; + AppendMenuW(hMenu, flags, (UINT_PTR)hSubMenu, (LPCWSTR)str); } else /* Not a popup */ { - if(!unicode) - { - if (*str == 0) - flags = MF_SEPARATOR; - } - else - { - if (*(LPCWSTR)str == 0) - flags = MF_SEPARATOR; - } - - if (flags & MF_SEPARATOR) - { - if (!(flags & (MF_GRAYED | MF_DISABLED))) - flags |= MF_GRAYED | MF_DISABLED; - } - - if(!unicode) - AppendMenuA(hMenu, flags, id, *str ? str : NULL); - else - AppendMenuW(hMenu, flags, id, - *(LPCWSTR)str ? (LPCWSTR)str : NULL); + AppendMenuW(hMenu, flags, id, *(LPCWSTR)str ? (LPCWSTR)str : NULL); } } while(!end); return res; @@ -2071,10 +2061,10 @@ static LPCSTR MENUEX_ParseResource(LPCSTR res, HMENU hMenu) { WORD resinfo; - MENUITEMINFOW mii; - do { + MENUITEMINFOW mii; + mii.cbSize = sizeof(mii); mii.fMask = MIIM_STATE | MIIM_ID | MIIM_TYPE; mii.fType = GET_DWORD(res); @@ -2114,13 +2104,12 @@ return NULL; } mii.fMask |= MIIM_SUBMENU; - /*mii.wID = (UINT)mii.hSubMenu;*/ - } - else if (!mii.dwTypeData[0]) + } + else if (!mii.dwTypeData[0] && !(mii.fType & MF_SEPARATOR)) + { mii.fType |= MF_SEPARATOR; - - if (!InsertMenuItemW(hMenu, -1, MF_BYPOSITION, &mii)) - ERR("InsertMenuItemW failed\n"); + } + InsertMenuItemW(hMenu, -1, MF_BYPOSITION, &mii); } while (!(resinfo & MF_END)); return res; } @@ -2327,7 +2316,7 @@ if (0 == (Flags & TPM_NONOTIFY)) { SendMessageW(WndOwner, WM_INITMENUPOPUP, (WPARAM) ItemInfo.hSubMenu, - MAKELONG(MenuInfo->FocusedItem, IS_SYSTEM_MENU(MenuInfo))); + MAKELPARAM(MenuInfo->FocusedItem, IS_SYSTEM_MENU(MenuInfo))); } if (! MenuGetRosMenuItemInfo(MenuInfo->Self, MenuInfo->FocusedItem, &ItemInfo)) @@ -2340,7 +2329,7 @@ /* correct item if modified as a reaction to WM_INITMENUPOPUP message */ if (0 == (ItemInfo.fState & MF_HILITE)) { - if (0 != (MenuInfo->Flags & MF_POPUP)) + if (0 != (MenuInfo->Flags & MNF_POPUP)) { Dc = GetDC(MenuInfo->Wnd); } @@ -2354,7 +2343,7 @@ ItemInfo.fState |= MF_HILITE; MenuSetRosMenuItemInfo(MenuInfo->Self, MenuInfo->FocusedItem, &ItemInfo); MenuDrawMenuItem(MenuInfo->Wnd, MenuInfo, WndOwner, Dc, &ItemInfo, MenuInfo->Height, - ! (MenuInfo->Flags & MF_POPUP), ODA_DRAWENTIRE); + ! (MenuInfo->Flags & MNF_POPUP), ODA_DRAWENTIRE); ReleaseDC(MenuInfo->Wnd, Dc); } @@ -2372,38 +2361,47 @@ { MenuInitSysMenuPopup(ItemInfo.hSubMenu, GetWindowLongPtrW(MenuInfo->Wnd, GWL_STYLE), GetClassLongPtrW(MenuInfo->Wnd, GCL_STYLE), HTSYSMENU); - + if (Flags & TPM_LAYOUTRTL) Rect.left; NcGetSysPopupPos(MenuInfo->Wnd, &Rect); Rect.top = Rect.bottom; Rect.right = GetSystemMetrics(SM_CXSIZE); Rect.bottom = GetSystemMetrics(SM_CYSIZE); } else - { + { GetWindowRect(MenuInfo->Wnd, &Rect); - if (0 != (MenuInfo->Flags & MF_POPUP)) - { - Rect.left += ItemInfo.Rect.right - GetSystemMetrics(SM_CXBORDER); - Rect.top += ItemInfo.Rect.top - 3; + if (0 != (MenuInfo->Flags & MNF_POPUP)) + { + if(Flags & TPM_LAYOUTRTL) + Rect.left += GetSystemMetrics(SM_CXBORDER); + else + Rect.left += ItemInfo.Rect.right- GetSystemMetrics(SM_CXBORDER); + Rect.top += ItemInfo.Rect.top - MENU_TOP_MARGIN;//3; Rect.right = ItemInfo.Rect.left - ItemInfo.Rect.right + GetSystemMetrics(SM_CXBORDER); - Rect.bottom = ItemInfo.Rect.top - ItemInfo.Rect.bottom - 3 - 2 - - GetSystemMetrics(SM_CYBORDER); - } + Rect.bottom = ItemInfo.Rect.top - ItemInfo.Rect.bottom - MENU_TOP_MARGIN - MENU_BOTTOM_MARGIN/*2*/ + - GetSystemMetrics(SM_CYBORDER); + } else - { - Rect.left += ItemInfo.Rect.left; + { + if(Flags & TPM_LAYOUTRTL) + Rect.left += Rect.right - ItemInfo.Rect.left; + else + Rect.left += ItemInfo.Rect.left; Rect.top += ItemInfo.Rect.bottom; Rect.right = ItemInfo.Rect.right - ItemInfo.Rect.left; Rect.bottom = ItemInfo.Rect.bottom - ItemInfo.Rect.top; - } - } + } + } + + /* use default alignment for submenus */ + Flags &= ~(TPM_CENTERALIGN | TPM_RIGHTALIGN | TPM_VCENTERALIGN | TPM_BOTTOMALIGN); MenuShowPopup(WndOwner, ItemInfo.hSubMenu, MenuInfo->FocusedItem, Flags, Rect.left, Rect.top, Rect.right, Rect.bottom ); if (SelectFirst && MenuGetRosMenuInfo(&SubMenuInfo, ItemInfo.hSubMenu)) - { + { MenuMoveSelection(WndOwner, &SubMenuInfo, ITEM_NEXT); - } + } Ret = ItemInfo.hSubMenu; MenuCleanupRosMenuItemInfo(&ItemInfo); @@ -2484,7 +2482,7 @@ if (MenuGetRosMenuInfo(&TopMenuInfo, Mt->TopMenu) && Mt->TopMenu != PtMenuInfo->Self && - 0 == ((PtMenuInfo->Flags | TopMenuInfo.Flags) & MF_POPUP)) + 0 == ((PtMenuInfo->Flags | TopMenuInfo.Flags) & MNF_POPUP)) { /* both are top level menus (system and menu-bar) */ MenuHideSubPopups(Mt->OwnerWnd, &TopMenuInfo, FALSE, wFlags); @@ -2540,17 +2538,20 @@ do not send a message to the owner */ if (0 == (Flags & TPM_RETURNCMD)) { - if (0 != (MenuInfo->Flags & MF_SYSMENU)) + if (0 != (MenuInfo->Flags & MNF_SYSDESKMN)) { PostMessageW(Mt->OwnerWnd, WM_SYSCOMMAND, ItemInfo.wID, MAKELPARAM((SHORT) Mt->Pt.x, (SHORT) Mt->Pt.y)); } else { - if (MenuInfo->dwStyle & MNS_NOTIFYBYPOS) - PostMessageW(Mt->OwnerWnd, WM_MENUCOMMAND, - MenuInfo->FocusedItem, - (LPARAM)MenuInfo->Self); + BOOL ret; + ROSMENUINFO topmenuI; + ret = MenuGetRosMenuInfo(&topmenuI, Mt->TopMenu); + DWORD dwStyle = MenuInfo->dwStyle | (ret ? topmenuI.dwStyle : 0); + + if (dwStyle & MNS_NOTIFYBYPOS) + PostMessageW(Mt->OwnerWnd, WM_MENUCOMMAND, MenuInfo->FocusedItem, (LPARAM)MenuInfo->Self); else PostMessageW(Mt->OwnerWnd, WM_COMMAND, ItemInfo.wID, 0); } @@ -2726,7 +2727,7 @@ /* check the current window (avoiding WM_HITTEST) */ Ht = DefWndNCHitTest(MenuInfo.Wnd, Pt); - if (0 != (MenuInfo.Flags & MF_POPUP)) + if (0 != (MenuInfo.Flags & MNF_POPUP)) { if (HTNOWHERE != Ht && HTERROR != Ht) { @@ -2977,20 +2978,20 @@ switch( uMsg ) { - case WM_KEYDOWN: - PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_NOREMOVE); - if( msg.message == WM_KEYUP || msg.message == WM_PAINT ) - { - PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_REMOVE); - PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_NOREMOVE); - if( msg.message == WM_KEYDOWN && - (msg.wParam == VK_LEFT || msg.wParam == VK_RIGHT)) - { - Mt->TrackFlags |= TF_SUSPENDPOPUP; - return TRUE; - } - } - break; + case WM_KEYDOWN: + PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_NOREMOVE); + if( msg.message == WM_KEYUP || msg.message == WM_PAINT ) + { + PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_REMOVE); + PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_NOREMOVE); + if( msg.message == WM_KEYDOWN && + (msg.wParam == VK_LEFT || msg.wParam == VK_RIGHT)) + { + Mt->TrackFlags |= TF_SUSPENDPOPUP; + return TRUE; + } + } + break; } /* failures go through this */ Mt->TrackFlags &= ~TF_SUSPENDPOPUP; @@ -3012,7 +3013,7 @@ if (Mt->CurrentMenu != Mt->TopMenu) { if (MenuGetRosMenuInfo(&MenuInfo, Mt->CurrentMenu) - && 0 != (MenuInfo.Flags & MF_POPUP)) + && 0 != (MenuInfo.Flags & MNF_POPUP)) { MenuPrev = MenuTmp = Mt->TopMenu; @@ -3084,7 +3085,7 @@ { return; } - if ((MenuPrev == Mt->TopMenu) && !(TopMenuInfo.Flags & MF_POPUP)) + if ((MenuPrev == Mt->TopMenu) && !(TopMenuInfo.Flags & MNF_POPUP)) { /* move menu bar selection if no more popups are left */ @@ -3124,7 +3125,7 @@ Mt->CurrentMenu, Mt->TopMenu); if (! MenuGetRosMenuInfo(&MenuInfo, Mt->TopMenu)) return; - if ((MenuInfo.Flags & MF_POPUP) || (Mt->CurrentMenu != Mt->TopMenu)) + if ((MenuInfo.Flags & MNF_POPUP) || (Mt->CurrentMenu != Mt->TopMenu)) { /* If already displaying a popup, try to display sub-popup */ @@ -3154,7 +3155,7 @@ return; } - if (!(MenuInfo.Flags & MF_POPUP)) /* menu bar tracking */ + if (!(MenuInfo.Flags & MNF_POPUP)) /* menu bar tracking */ { if (Mt->CurrentMenu != Mt->TopMenu) { @@ -3265,7 +3266,7 @@ } if (!enterIdleSent) { - HWND win = MenuInfo.Flags & MF_POPUP ? MenuInfo.Wnd : NULL; + HWND win = MenuInfo.Flags & MNF_POPUP ? MenuInfo.Wnd : NULL; enterIdleSent = TRUE; SendMessageW( mt.OwnerWnd, WM_ENTERIDLE, MSGF_MENU, (LPARAM) win); } @@ -3384,7 +3385,7 @@ case VK_DOWN: /* If on menu bar, pull-down the menu */ if (MenuGetRosMenuInfo(&MenuInfo, mt.CurrentMenu)) { - if (!(MenuInfo.Flags & MF_POPUP)) + if (!(MenuInfo.Flags & MNF_POPUP)) { if (MenuGetRosMenuInfo(&MenuInfo, mt.TopMenu)) mt.CurrentMenu = MenuShowSubPopup(mt.OwnerWnd, &MenuInfo, TRUE, wFlags); @@ -3507,16 +3508,15 @@ { MenuHideSubPopups(mt.OwnerWnd, &MenuInfo, FALSE, wFlags); - if (MenuInfo.Flags & MF_POPUP) + if (MenuInfo.Flags & MNF_POPUP) { IntNotifyWinEvent(EVENT_SYSTEM_MENUPOPUPEND, MenuInfo.Wnd, OBJID_CLIENT, CHILDID_SELF, 0); DestroyWindow(MenuInfo.Wnd); MenuInfo.Wnd = NULL; - if (!(MenuInfo.Flags & TPM_NONOTIFY)) + if (!(wFlags & TPM_NONOTIFY)) SendMessageW( mt.OwnerWnd, WM_UNINITMENUPOPUP, (WPARAM)mt.TopMenu, MAKELPARAM(0, IS_SYSTEM_MENU(&MenuInfo)) ); - } MenuSelectItem( mt.OwnerWnd, &MenuInfo, NO_SELECTED_ITEM, FALSE, 0 ); } @@ -3584,7 +3584,7 @@ IntNotifyWinEvent( EVENT_SYSTEM_MENUSTART, hWnd, - MenuInfo.Flags & MF_SYSMENU ? OBJID_SYSMENU : OBJID_MENU, + MenuInfo.Flags & MNF_SYSDESKMN ? OBJID_SYSMENU : OBJID_MENU, CHILDID_SELF, 0); return TRUE; } @@ -3615,6 +3615,7 @@ TRACE("wnd=%p ht=0x%04x (%ld,%ld)\n", hWnd, ht, pt.x, pt.y); + if (GetWindowLongW( hWnd, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) wFlags |= TPM_LAYOUTRTL; if (IsMenu(hMenu)) { /* map point to parent client coordinates */ @@ -3716,6 +3717,7 @@ /* ReactOS Check */ if (!ValidateHwnd(Wnd)) { + /* invalid window see wine menu.c test_menu_trackpopupmenu line 3146 */ return FALSE; } @@ -4815,7 +4817,7 @@ offset = GET_WORD(p); p += sizeof(WORD) + offset; if (!(hMenu = CreateMenu())) return 0; - if (!MENU_ParseResource(p, hMenu, TRUE)) + if (!MENU_ParseResource(p, hMenu)) { DestroyMenu(hMenu); return 0; @@ -4897,7 +4899,7 @@ if(!MenuGetRosMenuItemInfo( hMnu, uPosition, &rmii)) return FALSE; - if ((rmii.hSubMenu) && (uFlags & MF_POPUP) && (rmii.hSubMenu != (HMENU)uIDNewItem)) + if (rmii.hSubMenu && (uFlags & MF_POPUP) && (rmii.hSubMenu != (HMENU)uIDNewItem)) NtUserDestroyMenu( rmii.hSubMenu ); /* ModifyMenu() spec */ MenuCleanupRosMenuItemInfo( &rmii ); @@ -4944,7 +4946,7 @@ if(!MenuGetRosMenuItemInfo( hMnu, uPosition, &rmii)) return FALSE; - if ((rmii.hSubMenu) && (uFlags & MF_POPUP) && (rmii.hSubMenu != (HMENU)uIDNewItem)) + if (rmii.hSubMenu && (uFlags & MF_POPUP) && (rmii.hSubMenu != (HMENU)uIDNewItem)) NtUserDestroyMenu( rmii.hSubMenu ); /* ModifyMenu() spec */ MenuCleanupRosMenuItemInfo( &rmii ); Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/condrv/graphics.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
============================================================================== --- branches/shell-experiments/win32ss/user/winsrv/consrv/condrv/graphics.c [iso-8859-1] (original) +++ branches/shell-experiments/win32ss/user/winsrv/consrv/condrv/graphics.c [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -88,7 +88,8 @@ /* We do not use anything else than uncompressed bitmaps */ if (GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biCompression != BI_RGB) { - DPRINT1("biCompression == %d != BI_RGB, correct that!\n", GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biCompression); + DPRINT1("biCompression == %d != BI_RGB, fix that!\n", + GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biCompression); GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biCompression = BI_RGB; } Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/condrv/text.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
============================================================================== --- branches/shell-experiments/win32ss/user/winsrv/consrv/condrv/text.c [iso-8859-1] (original) +++ branches/shell-experiments/win32ss/user/winsrv/consrv/condrv/text.c [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -585,6 +585,78 @@ return STATUS_SUCCESS; } +NTSTATUS NTAPI +ConDrvChangeScreenBufferAttributes(IN PCONSOLE Console, + IN PTEXTMODE_SCREEN_BUFFER Buffer, + IN USHORT NewScreenAttrib, + IN USHORT NewPopupAttrib) +{ + DWORD X, Y, Length; + PCHAR_INFO Ptr; + + COORD TopLeft = {0}; + ULONG NumCodesToWrite = Buffer->ScreenBufferSize.X * Buffer->ScreenBufferSize.Y; + USHORT OldScreenAttrib = Buffer->ScreenDefaultAttrib; + + if (Console == NULL || Buffer == NULL) + { + return STATUS_INVALID_PARAMETER; + } + + /* Validity check */ + ASSERT(Console == Buffer->Header.Console); + + X = TopLeft.X; + Y = (TopLeft.Y + Buffer->VirtualY) % Buffer->ScreenBufferSize.Y; + Length = NumCodesToWrite; + // Ptr = ConioCoordToPointer(Buffer, X, Y); // Doesn't work + // Ptr = &Buffer->Buffer[X + Y * Buffer->ScreenBufferSize.X]; // May work + + while (Length--) + { + // Ptr = ConioCoordToPointer(Buffer, X, Y); // Doesn't work either + Ptr = &Buffer->Buffer[X + Y * Buffer->ScreenBufferSize.X]; + + /* + * Change the current colors only if they are the old ones. + */ + + /* Foreground color */ + if ((Ptr->Attributes & 0x0F) == (OldScreenAttrib & 0x0F)) + Ptr->Attributes = (Ptr->Attributes & 0xFFF0) | (NewScreenAttrib & 0x0F); + + /* Background color */ + if ((Ptr->Attributes & 0xF0) == (OldScreenAttrib & 0xF0)) + Ptr->Attributes = (Ptr->Attributes & 0xFF0F) | (NewScreenAttrib & 0xF0); + + // ++Ptr; + + if (++X == Buffer->ScreenBufferSize.X) + { + X = 0; + + if (++Y == Buffer->ScreenBufferSize.Y) + { + Y = 0; + } + } + } + + /* Save foreground and background colors for both screen and popup */ + Buffer->ScreenDefaultAttrib = (NewScreenAttrib & 0x00FF); + Buffer->PopupDefaultAttrib = (NewPopupAttrib & 0x00FF); + + /* Refresh the display if needed */ + if ((PCONSOLE_SCREEN_BUFFER)Buffer == Console->ActiveBuffer) + { + SMALL_RECT UpdateRect; + ConioComputeUpdateRect(Buffer, &UpdateRect, &TopLeft, NumCodesToWrite); + TermDrawRegion(Console, &UpdateRect); + } + + return STATUS_SUCCESS; +} + /* PUBLIC DRIVER APIS *********************************************************/ @@ -947,7 +1019,6 @@ PWCHAR tmpString = NULL; DWORD X, Y, Length; // , Written = 0; ULONG CodeSize; - SMALL_RECT UpdateRect; PCHAR_INFO Ptr; if (Console == NULL || Buffer == NULL || @@ -1046,6 +1117,7 @@ if ((PCONSOLE_SCREEN_BUFFER)Buffer == Console->ActiveBuffer) { + SMALL_RECT UpdateRect; ConioComputeUpdateRect(Buffer, &UpdateRect, WriteCoord, NumCodesToWrite); TermDrawRegion(Console, &UpdateRect); } @@ -1071,7 +1143,6 @@ { DWORD X, Y, Length; // , Written = 0; PCHAR_INFO Ptr; - SMALL_RECT UpdateRect; if (Console == NULL || Buffer == NULL || Code == NULL || WriteCoord == NULL /* || CodesWritten == NULL */) @@ -1144,6 +1215,7 @@ if ((PCONSOLE_SCREEN_BUFFER)Buffer == Console->ActiveBuffer) { + SMALL_RECT UpdateRect; ConioComputeUpdateRect(Buffer, &UpdateRect, WriteCoord, NumCodesToWrite); TermDrawRegion(Console, &UpdateRect); } Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/graphics.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
============================================================================== --- branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/graphics.c [iso-8859-1] (original) +++ branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/graphics.c [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -16,19 +16,100 @@ /* FUNCTIONS ******************************************************************/ VOID -GuiCopyFromGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer) +GuiCopyFromGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData) { /* * This function supposes that the system clipboard was opened. */ - // PCONSOLE Console = Buffer->Header.Console; + PCONSOLE Console = Buffer->Header.Console; - UNIMPLEMENTED; + HDC hMemDC; + HBITMAP hBitmapTarget, hBitmapOld; + HPALETTE hPalette, hPaletteOld; + ULONG selWidth, selHeight; + + if (Buffer->BitMap == NULL) return; + + selWidth = Console->Selection.srSelection.Right - Console->Selection.srSelection.Left + 1; + selHeight = Console->Selection.srSelection.Bottom - Console->Selection.srSelection.Top + 1; + DPRINT1("Selection is (%d|%d) to (%d|%d)\n", + Console->Selection.srSelection.Left, + Console->Selection.srSelection.Top, + Console->Selection.srSelection.Right, + Console->Selection.srSelection.Bottom); + + hMemDC = CreateCompatibleDC(GuiData->hMemDC); + if (hMemDC == NULL) return; + + /* Allocate a bitmap to be given to the clipboard, so it will not be freed here */ + hBitmapTarget = CreateCompatibleBitmap(GuiData->hMemDC, selWidth, selHeight); + if (hBitmapTarget == NULL) + { + DeleteDC(hMemDC); + return; + } + + /* Select the new bitmap */ + hBitmapOld = SelectObject(hMemDC, hBitmapTarget); + + /* Change the palette in hMemDC if the current palette does exist */ + if (Buffer->PaletteHandle == NULL) + hPalette = GuiData->hSysPalette; + else + hPalette = Buffer->PaletteHandle; + + if (hPalette) hPaletteOld = SelectPalette(hMemDC, hPalette, FALSE); + + /* Grab the mutex */ + NtWaitForSingleObject(Buffer->Mutex, FALSE, NULL); + + // The equivalent of a SetDIBitsToDevice call... + // It seems to be broken: it does not copy the tail of the bitmap. + //
http://wiki.allegro.cc/index.php?title=StretchDIBits
+#if 0 + StretchDIBits(hMemDC, + 0, 0, + selWidth, selHeight, + Console->Selection.srSelection.Left, + Console->Selection.srSelection.Top, + selWidth, selHeight, + Buffer->BitMap, + Buffer->BitMapInfo, + Buffer->BitMapUsage, + SRCCOPY); +#else + SetDIBitsToDevice(hMemDC, + /* Coordinates / size of the repainted rectangle, in the framebuffer's frame */ + 0, 0, + selWidth, selHeight, + /* Coordinates / size of the corresponding image portion, in the graphics screen-buffer's frame */ + Console->Selection.srSelection.Left, + Console->Selection.srSelection.Top, + 0, + Buffer->ScreenBufferSize.Y, // == Buffer->BitMapInfo->bmiHeader.biHeight + Buffer->BitMap, + Buffer->BitMapInfo, + Buffer->BitMapUsage); +#endif + + /* Release the mutex */ + NtReleaseMutant(Buffer->Mutex, NULL); + + /* Restore the palette and the old bitmap */ + if (hPalette) SelectPalette(hMemDC, hPaletteOld, FALSE); + SelectObject(hMemDC, hBitmapOld); + + EmptyClipboard(); + SetClipboardData(CF_BITMAP, hBitmapTarget); + + DeleteDC(hMemDC); } VOID -GuiPasteToGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer) +GuiPasteToGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData) { /* * This function supposes that the system clipboard was opened. Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
============================================================================== --- branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h [iso-8859-1] (original) +++ branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -52,7 +52,7 @@ HWND hWindow; /* Handle to the console's window */ HDC hMemDC; /* Memory DC holding the console framebuffer */ - HBITMAP hBitmap; /* Console framebuffer */ + HBITMAP hBitmap; /* Console framebuffer */ HPALETTE hSysPalette; /* Handle to the original system palette */ HICON hIcon; /* Handle to the console's icon (big) */ Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
============================================================================== --- branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [iso-8859-1] (original) +++ branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -1333,8 +1333,12 @@ return 0; } -VOID GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer); -VOID GuiCopyFromGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer); +VOID +GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData); +VOID +GuiCopyFromGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData); static VOID GuiConsoleCopy(PGUI_CONSOLE_DATA GuiData) @@ -1346,11 +1350,11 @@ if (GetType(Buffer) == TEXTMODE_BUFFER) { - GuiCopyFromTextModeBuffer((PTEXTMODE_SCREEN_BUFFER)Buffer); + GuiCopyFromTextModeBuffer((PTEXTMODE_SCREEN_BUFFER)Buffer, GuiData); } else /* if (GetType(Buffer) == GRAPHICS_BUFFER) */ { - GuiCopyFromGraphicsBuffer((PGRAPHICS_SCREEN_BUFFER)Buffer); + GuiCopyFromGraphicsBuffer((PGRAPHICS_SCREEN_BUFFER)Buffer, GuiData); } CloseClipboard(); @@ -1361,8 +1365,12 @@ } } -VOID GuiPasteToTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer); -VOID GuiPasteToGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer); +VOID +GuiPasteToTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData); +VOID +GuiPasteToGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData); static VOID GuiConsolePaste(PGUI_CONSOLE_DATA GuiData) @@ -1373,11 +1381,11 @@ if (GetType(Buffer) == TEXTMODE_BUFFER) { - GuiPasteToTextModeBuffer((PTEXTMODE_SCREEN_BUFFER)Buffer); + GuiPasteToTextModeBuffer((PTEXTMODE_SCREEN_BUFFER)Buffer, GuiData); } else /* if (GetType(Buffer) == GRAPHICS_BUFFER) */ { - GuiPasteToGraphicsBuffer((PGRAPHICS_SCREEN_BUFFER)Buffer); + GuiPasteToGraphicsBuffer((PGRAPHICS_SCREEN_BUFFER)Buffer, GuiData); } CloseClipboard(); @@ -1909,6 +1917,8 @@ EnableMenuItem(hMenu, ID_SYSTEM_EDIT_COPY , MF_BYCOMMAND | ((Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) && (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) ? MF_ENABLED : MF_GRAYED)); + // FIXME: Following whether the active screen buffer is text-mode + // or graphics-mode, search for CF_UNICODETEXT or CF_BITMAP formats. EnableMenuItem(hMenu, ID_SYSTEM_EDIT_PASTE, MF_BYCOMMAND | (!(Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) && IsClipboardFormatAvailable(CF_UNICODETEXT) ? MF_ENABLED : MF_GRAYED)); Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/text.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
============================================================================== --- branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/text.c [iso-8859-1] (original) +++ branches/shell-experiments/win32ss/user/winsrv/consrv/frontends/gui/text.c [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -30,7 +30,8 @@ } VOID -GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer) +GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData) { /* * This function supposes that the system clipboard was opened. @@ -72,12 +73,16 @@ size += 1; /* Null-termination */ size *= sizeof(WCHAR); - /* Allocate memory, it will be passed to the system and may not be freed here */ + /* Allocate some memory area to be given to the clipboard, so it will not be freed here */ hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, size); if (hData == NULL) return; data = GlobalLock(hData); - if (data == NULL) return; + if (data == NULL) + { + GlobalFree(hData); + return; + } DPRINT("Copying %dx%d selection\n", selWidth, selHeight); dstPos = data; @@ -121,7 +126,8 @@ } VOID -GuiPasteToTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer) +GuiPasteToTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData) { /* * This function supposes that the system clipboard was opened. Modified: branches/shell-experiments/win32ss/user/winsrv/consrv/settings.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
============================================================================== --- branches/shell-experiments/win32ss/user/winsrv/consrv/settings.c [iso-8859-1] (original) +++ branches/shell-experiments/win32ss/user/winsrv/consrv/settings.c [iso-8859-1] Tue Mar 18 14:39:04 2014 @@ -436,7 +436,11 @@ } } - +NTSTATUS NTAPI +ConDrvChangeScreenBufferAttributes(IN PCONSOLE Console, + IN PTEXTMODE_SCREEN_BUFFER Buffer, + IN USHORT NewScreenAttrib, + IN USHORT NewPopupAttrib); /* * NOTE: This function explicitely references Console->ActiveBuffer. * It is possible that it should go into some frontend... @@ -455,25 +459,9 @@ Console->QuickEdit = ConsoleInfo->QuickEdit; Console->InsertMode = ConsoleInfo->InsertMode; - /* - * Apply foreground and background colors for both screen and popup - * and copy the new palette. - */ - if (GetType(ActiveBuffer) == TEXTMODE_BUFFER) - { - PTEXTMODE_SCREEN_BUFFER Buffer = (PTEXTMODE_SCREEN_BUFFER)ActiveBuffer; - - Buffer->ScreenDefaultAttrib = ConsoleInfo->ScreenAttrib; - Buffer->PopupDefaultAttrib = ConsoleInfo->PopupAttrib; - } - else // if (Console->ActiveBuffer->Header.Type == GRAPHICS_BUFFER) - { - } - + /* Copy the new console palette */ // FIXME: Possible buffer overflow if s_colors is bigger than pConInfo->Colors. memcpy(Console->Colors, ConsoleInfo->Colors, sizeof(s_Colors)); - - // TODO: Really update the screen attributes as FillConsoleOutputAttribute does. /* Apply cursor size */ ActiveBuffer->CursorInfo.bVisible = (ConsoleInfo->CursorSize != 0); @@ -537,6 +525,12 @@ if (SizeChanged) TermResizeTerminal(Console); } + + /* Apply foreground and background colors for both screen and popup */ + ConDrvChangeScreenBufferAttributes(Console, + Buffer, + ConsoleInfo->ScreenAttrib, + ConsoleInfo->PopupAttrib); } else // if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) {
10 years, 9 months
1
0
0
0
[jimtabor] 62529: [Win32k] - Patch by David Quintana : Menu info fType and wID have wrong values if the menu has a submenu. See CORE-7966.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Mar 18 13:45:38 2014 New Revision: 62529 URL:
http://svn.reactos.org/svn/reactos?rev=62529&view=rev
Log: [Win32k] - Patch by David Quintana : Menu info fType and wID have wrong values if the menu has a submenu. See CORE-7966. Modified: trunk/reactos/win32ss/user/ntuser/menu.c trunk/reactos/win32ss/user/ntuser/window.c trunk/reactos/win32ss/user/user32/windows/menu.c Modified: trunk/reactos/win32ss/user/ntuser/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/menu.c…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/menu.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/menu.c [iso-8859-1] Tue Mar 18 13:45:38 2014 @@ -458,7 +458,7 @@ PMENU_ITEM item = Menu->MenuItemList; for ( i = Menu->MenuInfo.MenuItemCount; i; i--, item = item->Next) { - if ( item->fType & MF_POPUP ) // item->hSubMenu ) + if ( item->hSubMenu ) { PMENU_OBJECT SubMenu; if (!(SubMenu = UserGetMenuObject(item->hSubMenu))) continue; @@ -539,7 +539,7 @@ } else { - if(CurItem->fType & MF_POPUP) + if(CurItem->hSubMenu) { PMENU_OBJECT NewMenu = UserGetMenuObject(CurItem->hSubMenu); if(NewMenu) @@ -664,7 +664,7 @@ IntSetMenuItemInfo(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem, PROSMENUITEMINFO lpmii) { PMENU_OBJECT SubMenuObject; - UINT fTypeMask = (MFT_BITMAP | MFT_MENUBARBREAK | MFT_MENUBREAK | MFT_OWNERDRAW | MFT_RADIOCHECK | MFT_RIGHTJUSTIFY | MFT_SEPARATOR | MF_POPUP); + UINT fTypeMask = (MFT_BITMAP | MFT_MENUBARBREAK | MFT_MENUBREAK | MFT_OWNERDRAW | MFT_RADIOCHECK | MFT_RIGHTJUSTIFY | MFT_SEPARATOR); if(!MenuItem || !MenuObject || !lpmii) { @@ -752,16 +752,7 @@ if (SubMenuObject != NULL) { SubMenuObject->MenuInfo.Flags |= MNF_POPUP; - MenuItem->fType |= MF_POPUP; } - else - { - MenuItem->fType &= ~MF_POPUP; - } - } - else - { - MenuItem->fType &= ~MF_POPUP; } } @@ -1479,7 +1470,7 @@ return NO_SELECTED_ITEM; } - if (!(mi->fType & MF_POPUP)) continue; + if (!(mi->hSubMenu)) continue; if (mi->hSubMenu == hSubTarget) { Modified: trunk/reactos/win32ss/user/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/window…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] Tue Mar 18 13:45:38 2014 @@ -977,7 +977,7 @@ ItemInfo.cbSize = sizeof(MENUITEMINFOW); ItemInfo.fMask = MIIM_FTYPE | MIIM_STRING | MIIM_STATE | MIIM_SUBMENU; - ItemInfo.fType = MF_POPUP; + ItemInfo.fType = 0; ItemInfo.fState = MFS_ENABLED; ItemInfo.dwTypeData = NULL; ItemInfo.cch = 0; Modified: trunk/reactos/win32ss/user/user32/windows/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
============================================================================== --- trunk/reactos/win32ss/user/user32/windows/menu.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/menu.c [iso-8859-1] Tue Mar 18 13:45:38 2014 @@ -399,7 +399,7 @@ MenuCleanupRosMenuItemInfo(&item); return NO_SELECTED_ITEM; } - if (!(item.fType & MF_POPUP)) continue; + if (!(item.hSubMenu)) continue; if (item.hSubMenu == hSubTarget) { MenuCleanupRosMenuItemInfo(&item); return i; @@ -1214,7 +1214,7 @@ dis.rcItem.bottom); SendMessageW(WndOwner, WM_DRAWITEM, 0, (LPARAM) &dis); /* Draw the popup-menu arrow */ - if (lpitem->fType & MF_POPUP) + if (lpitem->hSubMenu) { RECT rectTemp; CopyRect(&rectTemp, &rect); @@ -1352,7 +1352,7 @@ } } /* Draw the popup-menu arrow */ - if (lpitem->fType & MF_POPUP) + if (lpitem->hSubMenu) { RECT rectTemp; CopyRect(&rectTemp, &rect); @@ -1706,16 +1706,19 @@ } if (sendMenuSelect) { - WPARAM wParam = MAKEWPARAM( ItemInfo.fType & MF_POPUP ? wIndex : ItemInfo.wID, + WPARAM wParam = MAKEWPARAM( ItemInfo.hSubMenu ? wIndex : ItemInfo.wID, ItemInfo.fType | ItemInfo.fState | - (hmenu->Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); + (ItemInfo.hSubMenu ? MF_POPUP : 0) | + (hmenu->Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); SendMessageW(hwndOwner, WM_MENUSELECT, wParam, (LPARAM) hmenu->Self); } } } - else if (sendMenuSelect) { - if(topmenu) { + else if (sendMenuSelect) + { + if(topmenu) + { int pos; pos = MenuFindSubMenu(&topmenu, hmenu->Self); if (pos != NO_SELECTED_ITEM) @@ -1724,6 +1727,7 @@ && MenuGetRosMenuItemInfo(topmenu, pos, &ItemInfo)) { WPARAM wParam = MAKEWPARAM( Pos, ItemInfo.fType | ItemInfo.fState | + (ItemInfo.hSubMenu ? MF_POPUP : 0) | (TopMenuInfo.Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); SendMessageW(hwndOwner, WM_MENUSELECT, wParam, (LPARAM) topmenu); @@ -2100,7 +2104,6 @@ return NULL; } mii.fMask |= MIIM_SUBMENU; - mii.fType |= MF_POPUP; } else if (!mii.dwTypeData[0] && !(mii.fType & MF_SEPARATOR)) { @@ -2300,7 +2303,7 @@ MenuCleanupRosMenuItemInfo(&ItemInfo); return MenuInfo->Self; } - if (0 == (ItemInfo.fType & MF_POPUP) || 0 != (ItemInfo.fState & (MF_GRAYED | MF_DISABLED))) + if (0 == (ItemInfo.hSubMenu) || 0 != (ItemInfo.fState & (MF_GRAYED | MF_DISABLED))) { MenuCleanupRosMenuItemInfo(&ItemInfo); return MenuInfo->Self; @@ -2441,7 +2444,7 @@ MenuInitRosMenuItemInfo(&ItemInfo); ItemInfo.fMask |= MIIM_FTYPE | MIIM_STATE; if (! MenuGetRosMenuItemInfo(MenuInfo->Self, MenuInfo->FocusedItem, &ItemInfo) - || 0 == (ItemInfo.fType & MF_POPUP) + || 0 == (ItemInfo.hSubMenu) || 0 == (ItemInfo.fState & MF_MOUSESELECT)) { MenuCleanupRosMenuItemInfo(&ItemInfo); @@ -2526,7 +2529,7 @@ TRACE("%p %08x %p\n", MenuInfo, ItemInfo.wID, ItemInfo.hSubMenu); - if (0 == (ItemInfo.fType & MF_POPUP)) + if (0 == (ItemInfo.hSubMenu)) { if (0 == (ItemInfo.fState & (MF_GRAYED | MF_DISABLED)) && 0 == (ItemInfo.fType & MF_SEPARATOR)) @@ -2660,7 +2663,7 @@ if (0 <= Id && MenuGetRosMenuItemInfo(MenuInfo.Self, Id, &ItemInfo) && MenuInfo.FocusedItem == Id) { - if (0 == (ItemInfo.fType & MF_POPUP)) + if (0 == (ItemInfo.hSubMenu)) { INT ExecutedMenuId = MenuExecFocusedItem(Mt, &MenuInfo, Flags); MenuCleanupRosMenuItemInfo(&ItemInfo); @@ -2709,7 +2712,7 @@ { MenuInitRosMenuItemInfo(&ItemInfo); if (MenuGetRosMenuItemInfo(MenuInfo.Self, MenuInfo.FocusedItem, &ItemInfo) && - 0 != (ItemInfo.fType & MF_POPUP) && + 0 != (ItemInfo.hSubMenu) && 0 != (ItemInfo.fState & MF_MOUSESELECT)) { Ret = MenuPtMenu(ItemInfo.hSubMenu, Pt); @@ -2823,7 +2826,7 @@ MenuCleanupRosMenuItemInfo(&ItemInfo); return NULL; } - if (0 != (ItemInfo.fType & MF_POPUP) && 0 != (ItemInfo.fState & MF_MOUSESELECT)) + if (0 != (ItemInfo.hSubMenu) && 0 != (ItemInfo.fState & MF_MOUSESELECT)) { MenuCleanupRosMenuItemInfo(&ItemInfo); return ItemInfo.hSubMenu; @@ -3883,7 +3886,6 @@ if(Flags & MF_POPUP) { - mii->fType |= MF_POPUP; mii->fMask |= MIIM_SUBMENU; mii->hSubMenu = (HMENU)IDNewItem; } @@ -3993,7 +3995,7 @@ if (0 != (Items[i].fType & MF_MENUBARBREAK)) continue; if (0 != (Items[i].fType & MF_SEPARATOR)) continue; - if ((Items[i].fType & MF_POPUP) && (uFlags == MF_BYCOMMAND)) + if ((Items[i].hSubMenu) && (uFlags == MF_BYCOMMAND)) { MenuCheckMenuRadioItem(Items[i].hSubMenu, idFirst, idLast, idCheck, uFlags, bCheck, pChecked, pUnchecked, pMenuChanged); continue; @@ -4897,7 +4899,7 @@ if(!MenuGetRosMenuItemInfo( hMnu, uPosition, &rmii)) return FALSE; - if ((rmii.fType & MF_POPUP) && (uFlags & MF_POPUP) && (rmii.hSubMenu != (HMENU)uIDNewItem)) + if (rmii.hSubMenu && (uFlags & MF_POPUP) && (rmii.hSubMenu != (HMENU)uIDNewItem)) NtUserDestroyMenu( rmii.hSubMenu ); /* ModifyMenu() spec */ MenuCleanupRosMenuItemInfo( &rmii ); @@ -4944,7 +4946,7 @@ if(!MenuGetRosMenuItemInfo( hMnu, uPosition, &rmii)) return FALSE; - if ((rmii.fType & MF_POPUP) && (uFlags & MF_POPUP) && (rmii.hSubMenu != (HMENU)uIDNewItem)) + if (rmii.hSubMenu && (uFlags & MF_POPUP) && (rmii.hSubMenu != (HMENU)uIDNewItem)) NtUserDestroyMenu( rmii.hSubMenu ); /* ModifyMenu() spec */ MenuCleanupRosMenuItemInfo( &rmii );
10 years, 9 months
1
0
0
0
[jimtabor] 62528: [User32] - Patch by Victor Martinez Calvo : Several menu.c fixes. See CORE-7967. - Sync port from wine with modifications
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Mar 18 04:11:30 2014 New Revision: 62528 URL:
http://svn.reactos.org/svn/reactos?rev=62528&view=rev
Log: [User32] - Patch by Victor Martinez Calvo : Several menu.c fixes. See CORE-7967. - Sync port from wine with modifications Modified: trunk/reactos/win32ss/user/user32/windows/menu.c Modified: trunk/reactos/win32ss/user/user32/windows/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
============================================================================== --- trunk/reactos/win32ss/user/user32/windows/menu.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/menu.c [iso-8859-1] Tue Mar 18 04:11:30 2014 @@ -36,6 +36,9 @@ #define TPM_BUTTONDOWN 0x40000000 /* menu was clicked before tracking */ #define TPM_POPUPMENU 0x20000000 /* menu is a popup menu */ +/* top and bottom margins for popup menus */ +#define MENU_TOP_MARGIN 3 +#define MENU_BOTTOM_MARGIN 2 #define MENU_TYPE_MASK (MF_STRING | MF_BITMAP | MF_OWNERDRAW | MF_SEPARATOR) @@ -1303,7 +1306,7 @@ HBITMAP bm; INT y = rect.top + rect.bottom; RECT rc = rect; - int checked = FALSE; + BOOL checked = FALSE; UINT check_bitmap_width = GetSystemMetrics( SM_CXMENUCHECK ); UINT check_bitmap_height = GetSystemMetrics( SM_CYMENUCHECK ); /* Draw the check mark @@ -1551,6 +1554,7 @@ POINT pt; HMONITOR monitor; MONITORINFO info; + DWORD ex_style = 0; TRACE("owner=%p hmenu=%p id=0x%04x x=0x%04x y=0x%04x xa=0x%04x ya=0x%04x\n", hwndOwner, hmenu, id, x, y, xanchor, yanchor); @@ -1592,6 +1596,11 @@ info.cbSize = sizeof(info); GetMonitorInfoW( monitor, &info ); + if (flags & TPM_LAYOUTRTL) + { + ex_style = WS_EX_LAYOUTRTL; + flags ^= TPM_RIGHTALIGN; + } if( flags & TPM_RIGHTALIGN ) x -= width; if( flags & TPM_CENTERALIGN ) x -= width / 2; @@ -1619,7 +1628,7 @@ if( y < info.rcMonitor.top ) y = info.rcMonitor.top; /* NOTE: In Windows, top menu popup is not owned. */ - MenuInfo.Wnd = CreateWindowExW( 0, WC_MENU, NULL, + MenuInfo.Wnd = CreateWindowExW( ex_style, WC_MENU, NULL, WS_POPUP, x, y, width, height, hwndOwner, 0, (HINSTANCE) GetWindowLongPtrW(hwndOwner, GWLP_HINSTANCE), (LPVOID) MenuInfo.Self); @@ -1697,9 +1706,9 @@ } if (sendMenuSelect) { - WPARAM wParam = MAKELONG( ItemInfo.fType & MF_POPUP ? wIndex : ItemInfo.wID, - ItemInfo.fType | ItemInfo.fState | - (hmenu->Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); + WPARAM wParam = MAKEWPARAM( ItemInfo.fType & MF_POPUP ? wIndex : ItemInfo.wID, + ItemInfo.fType | ItemInfo.fState | + (hmenu->Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); SendMessageW(hwndOwner, WM_MENUSELECT, wParam, (LPARAM) hmenu->Self); } @@ -1714,8 +1723,8 @@ if (MenuGetRosMenuInfo(&TopMenuInfo, topmenu) && MenuGetRosMenuItemInfo(topmenu, pos, &ItemInfo)) { - WPARAM wParam = MAKELONG( Pos, ItemInfo.fType | ItemInfo.fState | - (TopMenuInfo.Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); + WPARAM wParam = MAKEWPARAM( Pos, ItemInfo.fType | ItemInfo.fState | + (TopMenuInfo.Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); SendMessageW(hwndOwner, WM_MENUSELECT, wParam, (LPARAM) topmenu); } @@ -1999,11 +2008,11 @@ * * NOTE: flags is equivalent to the mtOption field */ -static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu, BOOL unicode ) +static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu) { WORD flags, id = 0; HMENU hSubMenu; - LPCSTR str; + LPCWSTR str; BOOL end = FALSE; do @@ -2020,46 +2029,19 @@ id = GET_WORD(res); res += sizeof(WORD); } - str = res; - if(!unicode) - res += strlen(str) + 1; - else - res += (strlenW((LPCWSTR)str) + 1) * sizeof(WCHAR); + str = (LPCWSTR)res; + res += (strlenW(str) + 1) * sizeof(WCHAR); + if (flags & MF_POPUP) { hSubMenu = CreatePopupMenu(); if(!hSubMenu) return NULL; - if(!(res = MENU_ParseResource(res, hSubMenu, unicode))) - return NULL; - if(!unicode) - AppendMenuA(hMenu, flags, (UINT)hSubMenu, str); - else - AppendMenuW(hMenu, flags, (UINT)hSubMenu, (LPCWSTR)str); + if(!(res = MENU_ParseResource(res, hSubMenu))) return NULL; + AppendMenuW(hMenu, flags, (UINT_PTR)hSubMenu, (LPCWSTR)str); } else /* Not a popup */ { - if(!unicode) - { - if (*str == 0) - flags = MF_SEPARATOR; - } - else - { - if (*(LPCWSTR)str == 0) - flags = MF_SEPARATOR; - } - - if (flags & MF_SEPARATOR) - { - if (!(flags & (MF_GRAYED | MF_DISABLED))) - flags |= MF_GRAYED | MF_DISABLED; - } - - if(!unicode) - AppendMenuA(hMenu, flags, id, *str ? str : NULL); - else - AppendMenuW(hMenu, flags, id, - *(LPCWSTR)str ? (LPCWSTR)str : NULL); + AppendMenuW(hMenu, flags, id, *(LPCWSTR)str ? (LPCWSTR)str : NULL); } } while(!end); return res; @@ -2075,10 +2057,10 @@ static LPCSTR MENUEX_ParseResource(LPCSTR res, HMENU hMenu) { WORD resinfo; - MENUITEMINFOW mii; - do { + MENUITEMINFOW mii; + mii.cbSize = sizeof(mii); mii.fMask = MIIM_STATE | MIIM_ID | MIIM_TYPE; mii.fType = GET_DWORD(res); @@ -2119,13 +2101,12 @@ } mii.fMask |= MIIM_SUBMENU; mii.fType |= MF_POPUP; - mii.wID = (UINT)mii.hSubMenu; - } - else if (!mii.dwTypeData[0]) + } + else if (!mii.dwTypeData[0] && !(mii.fType & MF_SEPARATOR)) + { mii.fType |= MF_SEPARATOR; - - if (!InsertMenuItemW(hMenu, -1, MF_BYPOSITION, &mii)) - ERR("InsertMenuItemW failed\n"); + } + InsertMenuItemW(hMenu, -1, MF_BYPOSITION, &mii); } while (!(resinfo & MF_END)); return res; } @@ -2332,7 +2313,7 @@ if (0 == (Flags & TPM_NONOTIFY)) { SendMessageW(WndOwner, WM_INITMENUPOPUP, (WPARAM) ItemInfo.hSubMenu, - MAKELONG(MenuInfo->FocusedItem, IS_SYSTEM_MENU(MenuInfo))); + MAKELPARAM(MenuInfo->FocusedItem, IS_SYSTEM_MENU(MenuInfo))); } if (! MenuGetRosMenuItemInfo(MenuInfo->Self, MenuInfo->FocusedItem, &ItemInfo)) @@ -2377,38 +2358,47 @@ { MenuInitSysMenuPopup(ItemInfo.hSubMenu, GetWindowLongPtrW(MenuInfo->Wnd, GWL_STYLE), GetClassLongPtrW(MenuInfo->Wnd, GCL_STYLE), HTSYSMENU); - + if (Flags & TPM_LAYOUTRTL) Rect.left; NcGetSysPopupPos(MenuInfo->Wnd, &Rect); Rect.top = Rect.bottom; Rect.right = GetSystemMetrics(SM_CXSIZE); Rect.bottom = GetSystemMetrics(SM_CYSIZE); } else - { + { GetWindowRect(MenuInfo->Wnd, &Rect); if (0 != (MenuInfo->Flags & MNF_POPUP)) - { - Rect.left += ItemInfo.Rect.right - GetSystemMetrics(SM_CXBORDER); - Rect.top += ItemInfo.Rect.top - 3; + { + if(Flags & TPM_LAYOUTRTL) + Rect.left += GetSystemMetrics(SM_CXBORDER); + else + Rect.left += ItemInfo.Rect.right- GetSystemMetrics(SM_CXBORDER); + Rect.top += ItemInfo.Rect.top - MENU_TOP_MARGIN;//3; Rect.right = ItemInfo.Rect.left - ItemInfo.Rect.right + GetSystemMetrics(SM_CXBORDER); - Rect.bottom = ItemInfo.Rect.top - ItemInfo.Rect.bottom - 3 - 2 - - GetSystemMetrics(SM_CYBORDER); - } + Rect.bottom = ItemInfo.Rect.top - ItemInfo.Rect.bottom - MENU_TOP_MARGIN - MENU_BOTTOM_MARGIN/*2*/ + - GetSystemMetrics(SM_CYBORDER); + } else - { - Rect.left += ItemInfo.Rect.left; + { + if(Flags & TPM_LAYOUTRTL) + Rect.left += Rect.right - ItemInfo.Rect.left; + else + Rect.left += ItemInfo.Rect.left; Rect.top += ItemInfo.Rect.bottom; Rect.right = ItemInfo.Rect.right - ItemInfo.Rect.left; Rect.bottom = ItemInfo.Rect.bottom - ItemInfo.Rect.top; - } - } + } + } + + /* use default alignment for submenus */ + Flags &= ~(TPM_CENTERALIGN | TPM_RIGHTALIGN | TPM_VCENTERALIGN | TPM_BOTTOMALIGN); MenuShowPopup(WndOwner, ItemInfo.hSubMenu, MenuInfo->FocusedItem, Flags, Rect.left, Rect.top, Rect.right, Rect.bottom ); if (SelectFirst && MenuGetRosMenuInfo(&SubMenuInfo, ItemInfo.hSubMenu)) - { + { MenuMoveSelection(WndOwner, &SubMenuInfo, ITEM_NEXT); - } + } Ret = ItemInfo.hSubMenu; MenuCleanupRosMenuItemInfo(&ItemInfo); @@ -2985,20 +2975,20 @@ switch( uMsg ) { - case WM_KEYDOWN: - PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_NOREMOVE); - if( msg.message == WM_KEYUP || msg.message == WM_PAINT ) - { - PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_REMOVE); - PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_NOREMOVE); - if( msg.message == WM_KEYDOWN && - (msg.wParam == VK_LEFT || msg.wParam == VK_RIGHT)) - { - Mt->TrackFlags |= TF_SUSPENDPOPUP; - return TRUE; - } - } - break; + case WM_KEYDOWN: + PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_NOREMOVE); + if( msg.message == WM_KEYUP || msg.message == WM_PAINT ) + { + PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_REMOVE); + PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_NOREMOVE); + if( msg.message == WM_KEYDOWN && + (msg.wParam == VK_LEFT || msg.wParam == VK_RIGHT)) + { + Mt->TrackFlags |= TF_SUSPENDPOPUP; + return TRUE; + } + } + break; } /* failures go through this */ Mt->TrackFlags &= ~TF_SUSPENDPOPUP; @@ -3622,6 +3612,7 @@ TRACE("wnd=%p ht=0x%04x (%ld,%ld)\n", hWnd, ht, pt.x, pt.y); + if (GetWindowLongW( hWnd, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) wFlags |= TPM_LAYOUTRTL; if (IsMenu(hMenu)) { /* map point to parent client coordinates */ @@ -3723,6 +3714,7 @@ /* ReactOS Check */ if (!ValidateHwnd(Wnd)) { + /* invalid window see wine menu.c test_menu_trackpopupmenu line 3146 */ return FALSE; } @@ -4823,7 +4815,7 @@ offset = GET_WORD(p); p += sizeof(WORD) + offset; if (!(hMenu = CreateMenu())) return 0; - if (!MENU_ParseResource(p, hMenu, TRUE)) + if (!MENU_ParseResource(p, hMenu)) { DestroyMenu(hMenu); return 0;
10 years, 9 months
1
0
0
0
[jimtabor] 62527: [Win32k] - Fix more menu tests, missed flags and fix MIM_APPLYTOSUBMENUS.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Mar 18 02:56:48 2014 New Revision: 62527 URL:
http://svn.reactos.org/svn/reactos?rev=62527&view=rev
Log: [Win32k] - Fix more menu tests, missed flags and fix MIM_APPLYTOSUBMENUS. Modified: trunk/reactos/win32ss/user/ntuser/menu.c trunk/reactos/win32ss/user/ntuser/window.c Modified: trunk/reactos/win32ss/user/ntuser/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/menu.c…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/menu.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/menu.c [iso-8859-1] Tue Mar 18 02:56:48 2014 @@ -454,7 +454,17 @@ Menu->MenuInfo.dwStyle = lpmi->dwStyle; if(lpmi->fMask & MIM_APPLYTOSUBMENUS) { - /* FIXME */ + int i; + PMENU_ITEM item = Menu->MenuItemList; + for ( i = Menu->MenuInfo.MenuItemCount; i; i--, item = item->Next) + { + if ( item->fType & MF_POPUP ) // item->hSubMenu ) + { + PMENU_OBJECT SubMenu; + if (!(SubMenu = UserGetMenuObject(item->hSubMenu))) continue; + IntSetMenuInfo( SubMenu, lpmi); + } + } } if (sizeof(MENUINFO) < lpmi->cbSize) { Modified: trunk/reactos/win32ss/user/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/window…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] Tue Mar 18 02:56:48 2014 @@ -931,7 +931,7 @@ if(NewMenu) { Window->SystemMenu = NewMenu->MenuInfo.Self; - NewMenu->MenuInfo.Flags |= MF_SYSMENU; + NewMenu->MenuInfo.Flags |= MNF_SYSDESKMN; NewMenu->MenuInfo.Wnd = Window->head.h; ret = NewMenu; //IntReleaseMenuObject(NewMenu); @@ -950,7 +950,7 @@ UserDestroyMenu(hSysMenu); return NULL; } - SysMenu->MenuInfo.Flags |= MF_SYSMENU; + SysMenu->MenuInfo.Flags |= MNF_SYSDESKMN; SysMenu->MenuInfo.Wnd = Window->head.h; hNewMenu = co_IntLoadSysMenuTemplate(); if(!hNewMenu) @@ -970,7 +970,8 @@ NewMenu = IntCloneMenu(Menu); if(NewMenu) { - NewMenu->MenuInfo.Flags |= MF_SYSMENU | MF_POPUP; + NewMenu->MenuInfo.Flags |= MNF_SYSDESKMN | MNF_POPUP; + NewMenu->MenuInfo.dwStyle = MNS_CHECKORBMP; IntReleaseMenuObject(NewMenu); UserSetMenuDefaultItem(NewMenu, SC_CLOSE, FALSE); @@ -1426,7 +1427,7 @@ OldMenu = IntGetMenuObject(Window->SystemMenu); if(OldMenu) { - OldMenu->MenuInfo.Flags &= ~ MF_SYSMENU; + OldMenu->MenuInfo.Flags &= ~ MNF_SYSDESKMN; IntReleaseMenuObject(OldMenu); } } @@ -1435,7 +1436,7 @@ { /* FIXME: Check window style, propably return FALSE? */ Window->SystemMenu = Menu->MenuInfo.Self; - Menu->MenuInfo.Flags |= MF_SYSMENU; + Menu->MenuInfo.Flags |= MNF_SYSDESKMN; } else Window->SystemMenu = (HMENU)0;
10 years, 9 months
1
0
0
0
[jimtabor] 62526: [NtUser|User32] - Use new menu flags. - Fix msg test_menu_messages tests. Patch from CORE-7966 breaks it. - Fix edit tests with GetMenuBarInfo. - Fix menu test_getmenubarinfo test...
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Mar 18 01:15:08 2014 New Revision: 62526 URL:
http://svn.reactos.org/svn/reactos?rev=62526&view=rev
Log: [NtUser|User32] - Use new menu flags. - Fix msg test_menu_messages tests. Patch from CORE-7966 breaks it. - Fix edit tests with GetMenuBarInfo. - Fix menu test_getmenubarinfo tests but the todo on line 375. Modified: trunk/reactos/win32ss/user/ntuser/menu.c trunk/reactos/win32ss/user/user32/windows/menu.c Modified: trunk/reactos/win32ss/user/ntuser/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/menu.c…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/menu.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/menu.c [iso-8859-1] Tue Mar 18 01:15:08 2014 @@ -271,7 +271,7 @@ Menu->MenuInfo.dwMenuData = 0; /* Default */ Menu->MenuInfo.Self = *Handle; Menu->MenuInfo.FocusedItem = NO_SELECTED_ITEM; - Menu->MenuInfo.Flags = (IsMenuBar ? 0 : MF_POPUP); + Menu->MenuInfo.Flags = (IsMenuBar ? 0 : MNF_POPUP); Menu->MenuInfo.Wnd = NULL; Menu->MenuInfo.WndOwner = NULL; Menu->MenuInfo.Height = 0; @@ -741,7 +741,7 @@ SubMenuObject = UserGetMenuObject(MenuItem->hSubMenu); if (SubMenuObject != NULL) { - SubMenuObject->MenuInfo.Flags |= MF_POPUP; + SubMenuObject->MenuInfo.Flags |= MNF_POPUP; MenuItem->fType |= MF_POPUP; } else @@ -784,7 +784,7 @@ } else { - if (0 == (MenuObject->MenuInfo.Flags & MF_SYSMENU)) + if (0 == (MenuObject->MenuInfo.Flags & MNF_SYSDESKMN)) { MenuItem->fType |= MF_SEPARATOR; } @@ -1733,6 +1733,50 @@ END_CLEANUP; } +BOOL FASTCALL +IntGetMenuItemRect( + PWND pWnd, + PMENU_OBJECT Menu, + UINT uItem, + PRECTL Rect) +{ + LONG XMove, YMove; + PMENU_ITEM MenuItem; + int p = 0; + + if (!pWnd) + { + HWND hWnd = Menu->MenuInfo.Wnd; + if (!(pWnd = UserGetWindowObject(hWnd))) return FALSE; + } + + if ((p = IntGetMenuItemByFlag(Menu, uItem, MF_BYPOSITION, NULL, &MenuItem, NULL)) > -1) + *Rect = MenuItem->Rect; + else + { + ERR("Failed Item Lookup! %d\n", p); + return FALSE; + } + + if (Menu->MenuInfo.Flags & MNF_POPUP) + { + XMove = pWnd->rcClient.left; + YMove = pWnd->rcClient.top; + } + else + { + XMove = pWnd->rcWindow.left; + YMove = pWnd->rcWindow.top; + } + + Rect->left += XMove; + Rect->top += YMove; + Rect->right += XMove; + Rect->bottom += YMove; + + return TRUE; +} + /* * @implemented */ @@ -1743,219 +1787,126 @@ LONG idItem, PMENUBARINFO pmbi) { - BOOL Res = TRUE; - PMENU_OBJECT MenuObject; - PMENU_ITEM mi; - PWND WindowObject; + PWND pWnd; HMENU hMenu; - POINT Offset; - RECTL Rect; MENUBARINFO kmbi; + BOOL Ret; + NTSTATUS Status = STATUS_SUCCESS; + PMENU_OBJECT Menu = NULL; DECLARE_RETURN(BOOL); TRACE("Enter NtUserGetMenuBarInfo\n"); UserEnterShared(); - if (!(WindowObject = UserGetWindowObject(hwnd))) - { + if (!(pWnd = UserGetWindowObject(hwnd))) + { EngSetLastError(ERROR_INVALID_WINDOW_HANDLE); RETURN(FALSE); - } - - hMenu = (HMENU)(DWORD_PTR)WindowObject->IDMenu; - - if (!(MenuObject = UserGetMenuObject(hMenu))) - { - EngSetLastError(ERROR_INVALID_MENU_HANDLE); - RETURN(FALSE); - } - - if (pmbi->cbSize != sizeof(MENUBARINFO)) - { + } + + switch (idObject) + { + case OBJID_CLIENT: + if (!pWnd->pcls->fnid) + RETURN(FALSE); + if (pWnd->pcls->fnid != FNID_MENU) + { + WARN("called on invalid window: %d\n", pWnd->pcls->fnid); + EngSetLastError(ERROR_INVALID_MENU_HANDLE); + RETURN(FALSE); + } + // Windows does this! Wine checks for Atom and uses GetWindowLongPtrW. + hMenu = (HMENU)co_IntSendMessage(hwnd, MN_GETHMENU, 0, 0); + break; + case OBJID_MENU: + hMenu = UlongToHandle(pWnd->IDMenu); + break; + case OBJID_SYSMENU: + if (!(pWnd->style & WS_SYSMENU)) RETURN(FALSE); + Menu = IntGetSystemMenu(pWnd, FALSE, FALSE); + hMenu = Menu->MenuInfo.Self; + break; + default: + RETURN(FALSE); + } + + if (!hMenu) + RETURN(FALSE); + + _SEH2_TRY + { + kmbi.cbSize = pmbi->cbSize; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + kmbi.cbSize = 0; + } + _SEH2_END + + if (kmbi.cbSize != sizeof(MENUBARINFO)) + { EngSetLastError(ERROR_INVALID_PARAMETER); RETURN(FALSE); - } - - kmbi.cbSize = sizeof(MENUBARINFO); - kmbi.fBarFocused = FALSE; - kmbi.fFocused = FALSE; + } + + if (!Menu) Menu = UserGetMenuObject(hMenu); + if (!Menu) + RETURN(FALSE); + + if (idItem < 0 || idItem > Menu->MenuInfo.MenuItemCount) + RETURN(FALSE); + + RECTL_vSetEmptyRect(&kmbi.rcBar); + + if (idItem == 0) + { + Ret = IntGetMenuItemRect(pWnd, Menu, -1, &kmbi.rcBar); + kmbi.rcBar.right = kmbi.rcBar.left + Menu->MenuInfo.Width; + kmbi.rcBar.bottom = kmbi.rcBar.top + Menu->MenuInfo.Height; + ERR("idItem 0 %d\n",Ret); + } + else + { + Ret = IntGetMenuItemRect(pWnd, Menu, idItem-1, &kmbi.rcBar); + ERR("idItem X %d\n", Ret); + } + + kmbi.hMenu = hMenu; kmbi.hwndMenu = NULL; - - switch (idObject) - { - case OBJID_MENU: - { - PMENU_OBJECT SubMenuObject; - kmbi.hMenu = hMenu; - if (idItem) /* Non-Zero-Based. */ - { - if (IntGetMenuItemByFlag(MenuObject, idItem-1, MF_BYPOSITION, NULL, &mi, NULL) > -1) - kmbi.rcBar = mi->Rect; - else - { - Res = FALSE; - break; - } - } - else - { - /* If items is zero we assume info for the menu itself. */ - if (!(IntGetClientOrigin(WindowObject, &Offset))) - { - Res = FALSE; - break; - } - Rect.left = Offset.x; - Rect.right = Offset.x + MenuObject->MenuInfo.Width; - Rect.bottom = Offset.y; - Rect.top = Offset.y - MenuObject->MenuInfo.Height; - kmbi.rcBar = Rect; - TRACE("Rect top = %d bottom = %d left = %d right = %d \n", - Rect.top, Rect.bottom, Rect.left, Rect.right); - } - if (idItem) - { - if (idItem-1 == MenuObject->MenuInfo.FocusedItem) - kmbi.fFocused = TRUE; - } - if (MenuObject->MenuInfo.FocusedItem != NO_SELECTED_ITEM) - kmbi.fBarFocused = TRUE; - - if (MenuObject->MenuItemList) - { - SubMenuObject = UserGetMenuObject(MenuObject->MenuItemList->hSubMenu); - if(SubMenuObject) kmbi.hwndMenu = SubMenuObject->MenuInfo.Wnd; - } - TRACE("OBJID_MENU, idItem = %d\n",idItem); - break; - } - case OBJID_CLIENT: - { - PMENU_OBJECT SubMenuObject, XSubMenuObject; - HMENU hMenuChk; - // Windows does this! Wine checks for Atom and uses GetWindowLongPtrW. - hMenuChk = (HMENU)co_IntSendMessage(hwnd, MN_GETHMENU, 0, 0); - - if (!(MenuObject = UserGetMenuObject(hMenuChk))) - { - ERR("Window does not have a Popup Menu!\n"); - EngSetLastError(ERROR_INVALID_MENU_HANDLE); - RETURN(FALSE); - } - - SubMenuObject = UserGetMenuObject(MenuObject->MenuItemList->hSubMenu); - if(SubMenuObject) kmbi.hMenu = SubMenuObject->MenuInfo.Self; - else - { - Res = FALSE; - ERR("OBJID_CLIENT, No SubMenu!\n"); - break; - } - if (idItem) - { - if (IntGetMenuItemByFlag(SubMenuObject, idItem-1, MF_BYPOSITION, NULL, &mi, NULL) > -1) - kmbi.rcBar = mi->Rect; - else - { - Res = FALSE; - break; - } - } - else - { - PWND SubWinObj; - if (!(SubWinObj = UserGetWindowObject(SubMenuObject->MenuInfo.Wnd))) - { - Res = FALSE; - break; - } - if (!(IntGetClientOrigin(SubWinObj, &Offset))) - { - Res = FALSE; - break; - } - Rect.left = Offset.x; - Rect.right = Offset.x + SubMenuObject->MenuInfo.Width; - Rect.top = Offset.y; - Rect.bottom = Offset.y + SubMenuObject->MenuInfo.Height; - kmbi.rcBar = Rect; - } - if (idItem) - { - if (idItem-1 == SubMenuObject->MenuInfo.FocusedItem) - kmbi.fFocused = TRUE; - } - if (SubMenuObject->MenuInfo.FocusedItem != NO_SELECTED_ITEM) - kmbi.fBarFocused = TRUE; - XSubMenuObject = UserGetMenuObject(SubMenuObject->MenuItemList->hSubMenu); - if (XSubMenuObject) kmbi.hwndMenu = XSubMenuObject->MenuInfo.Wnd; - TRACE("OBJID_CLIENT, idItem = %d\n",idItem); - break; - } - case OBJID_SYSMENU: - { - PMENU_OBJECT SysMenuObject, SubMenuObject; - if(!(SysMenuObject = IntGetSystemMenu(WindowObject, FALSE, FALSE))) - { - Res = FALSE; - break; - } - kmbi.hMenu = SysMenuObject->MenuInfo.Self; - if (idItem) - { - if (IntGetMenuItemByFlag(SysMenuObject, idItem-1, MF_BYPOSITION, NULL, &mi, NULL) > -1) - kmbi.rcBar = mi->Rect; - else - { - Res = FALSE; - break; - } - } - else - { - PWND SysWinObj; - if (!(SysWinObj = UserGetWindowObject(SysMenuObject->MenuInfo.Wnd))) - { - Res = FALSE; - break; - } - if (!(IntGetClientOrigin(SysWinObj, &Offset))) - { - Res = FALSE; - break; - } - Rect.left = Offset.x; - Rect.right = Offset.x + SysMenuObject->MenuInfo.Width; - Rect.top = Offset.y; - Rect.bottom = Offset.y + SysMenuObject->MenuInfo.Height; - kmbi.rcBar = Rect; - } - if (idItem) - { - if (idItem-1 == SysMenuObject->MenuInfo.FocusedItem) - kmbi.fFocused = TRUE; - } - if (SysMenuObject->MenuInfo.FocusedItem != NO_SELECTED_ITEM) - kmbi.fBarFocused = TRUE; - SubMenuObject = UserGetMenuObject(SysMenuObject->MenuItemList->hSubMenu); - if(SubMenuObject) kmbi.hwndMenu = SubMenuObject->MenuInfo.Wnd; - TRACE("OBJID_SYSMENU, idItem = %d\n",idItem); - break; - } - default: - Res = FALSE; - ERR("Unknown idObject = %d, idItem = %d\n",idObject,idItem); - } - if (Res) - { - NTSTATUS Status = MmCopyToCaller(pmbi, &kmbi, sizeof(MENUBARINFO)); - if (! NT_SUCCESS(Status)) - { - SetLastNtError(Status); - RETURN(FALSE); - } - } - RETURN(Res); + //kmbi.fBarFocused = top_popup_hmenu == hMenu; + if (idItem) + { + PMENU_OBJECT SubMenuObject; + kmbi.fFocused = Menu->MenuInfo.FocusedItem == idItem-1; + + if ( kmbi.fFocused && Menu->MenuItemList->hSubMenu ) + { + SubMenuObject = UserGetMenuObject(Menu->MenuItemList->hSubMenu); + if (SubMenuObject) kmbi.hwndMenu = SubMenuObject->MenuInfo.Wnd; + } + } +/* else + { + kmbi.fFocused = kmbi.fBarFocused; + } +*/ + _SEH2_TRY + { + RtlCopyMemory(pmbi, &kmbi, sizeof(MENUBARINFO)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END + + if (!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + RETURN(FALSE); + } + + RETURN(TRUE); CLEANUP: TRACE("Leave NtUserGetMenuBarInfo, ret=%i\n",_ret_); @@ -2011,9 +1962,9 @@ PWND ReferenceWnd; LONG XMove, YMove; RECTL Rect; - NTSTATUS Status; PMENU_OBJECT Menu; PMENU_ITEM MenuItem; + NTSTATUS Status = STATUS_SUCCESS; DECLARE_RETURN(BOOL); TRACE("Enter NtUserGetMenuItemRect\n"); @@ -2038,7 +1989,7 @@ if (!(ReferenceWnd = UserGetWindowObject(hWnd))) RETURN( FALSE); - if(MenuItem->fType & MF_POPUP) + if (Menu->MenuInfo.Flags & MNF_POPUP) { XMove = ReferenceWnd->rcClient.left; YMove = ReferenceWnd->rcClient.top; @@ -2054,13 +2005,22 @@ Rect.right += XMove; Rect.bottom += YMove; - Status = MmCopyToCaller(lprcItem, &Rect, sizeof(RECT)); - if (! NT_SUCCESS(Status)) + _SEH2_TRY + { + RtlCopyMemory(lprcItem, &Rect, sizeof(RECTL)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END + + if (!NT_SUCCESS(Status)) { SetLastNtError(Status); - RETURN( FALSE); - } - RETURN( TRUE); + RETURN(FALSE); + } + RETURN(TRUE); CLEANUP: TRACE("Leave NtUserGetMenuItemRect, ret=%i\n",_ret_); Modified: trunk/reactos/win32ss/user/user32/windows/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
============================================================================== --- trunk/reactos/win32ss/user/user32/windows/menu.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/menu.c [iso-8859-1] Tue Mar 18 01:15:08 2014 @@ -46,10 +46,10 @@ #define IS_MAGIC_BITMAP(id) ((id) && ((INT_PTR)(id) < 12) && ((INT_PTR)(id) >= -1)) #define IS_SYSTEM_MENU(MenuInfo) \ - (0 == ((MenuInfo)->Flags & MF_POPUP) && 0 != ((MenuInfo)->Flags & MF_SYSMENU)) + (0 == ((MenuInfo)->Flags & MNF_POPUP) && 0 != ((MenuInfo)->Flags & MNF_SYSDESKMN)) #define IS_SYSTEM_POPUP(MenuInfo) \ - (0 != ((MenuInfo)->Flags & MF_POPUP) && 0 != ((MenuInfo)->Flags & MF_SYSMENU)) + (0 != ((MenuInfo)->Flags & MNF_POPUP) && 0 != ((MenuInfo)->Flags & MNF_SYSDESKMN)) #define IS_BITMAP_ITEM(flags) (MF_BITMAP == MENU_ITEM_TYPE(flags)) @@ -507,6 +507,7 @@ PROSMENUITEMINFO Items, ItemInfo; LRESULT MenuChar; UINT i; + WORD Flags = 0; TRACE("\tlooking for '%c' (0x%02x) in [%p]\n", (char) Key, Key, MenuInfo); @@ -546,8 +547,11 @@ } } + Flags |= MenuInfo->Flags & MNF_POPUP ? MF_POPUP : 0; + Flags |= MenuInfo->Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0; + MenuChar = SendMessageW(WndOwner, WM_MENUCHAR, - MAKEWPARAM(Key, MenuInfo->Flags), (LPARAM) MenuInfo->Self); + MAKEWPARAM(Key, Flags), (LPARAM) MenuInfo->Self); if (HIWORD(MenuChar) == MNC_EXECUTE) return LOWORD(MenuChar); if (HIWORD(MenuChar) == MNC_CLOSE) return (UINT)(-2); } @@ -1650,7 +1654,7 @@ if (!hmenu || !hmenu->MenuItemCount || !hmenu->Wnd) return; if (hmenu->FocusedItem == wIndex) return; - if (hmenu->Flags & MF_POPUP) hdc = GetDC(hmenu->Wnd); + if (hmenu->Flags & MNF_POPUP) hdc = GetDC(hmenu->Wnd); else hdc = GetDCEx(hmenu->Wnd, 0, DCX_CACHE | DCX_WINDOW); if (!top_popup) { top_popup = hmenu->Wnd; @@ -1671,7 +1675,7 @@ MenuSetRosMenuItemInfo(hmenu->Self, hmenu->FocusedItem, &ItemInfo); } MenuDrawMenuItem(hmenu->Wnd, hmenu, hwndOwner, hdc, &ItemInfo, - hmenu->Height, ! (hmenu->Flags & MF_POPUP), + hmenu->Height, !(hmenu->Flags & MNF_POPUP), ODA_SELECT); } @@ -1688,15 +1692,16 @@ ItemInfo.fState |= MF_HILITE; MenuSetRosMenuItemInfo(hmenu->Self, hmenu->FocusedItem, &ItemInfo); MenuDrawMenuItem(hmenu->Wnd, hmenu, hwndOwner, hdc, - &ItemInfo, hmenu->Height, ! (hmenu->Flags & MF_POPUP), + &ItemInfo, hmenu->Height, !(hmenu->Flags & MNF_POPUP), ODA_SELECT); } if (sendMenuSelect) { - SendMessageW(hwndOwner, WM_MENUSELECT, - MAKELONG(ItemInfo.fType & MF_POPUP ? wIndex : ItemInfo.wID, - ItemInfo.fType | ItemInfo.fState | MF_MOUSESELECT | - (hmenu->Flags & MF_SYSMENU)), (LPARAM) hmenu->Self); + WPARAM wParam = MAKELONG( ItemInfo.fType & MF_POPUP ? wIndex : ItemInfo.wID, + ItemInfo.fType | ItemInfo.fState | + (hmenu->Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); + + SendMessageW(hwndOwner, WM_MENUSELECT, wParam, (LPARAM) hmenu->Self); } } } @@ -1709,11 +1714,10 @@ if (MenuGetRosMenuInfo(&TopMenuInfo, topmenu) && MenuGetRosMenuItemInfo(topmenu, pos, &ItemInfo)) { - SendMessageW(hwndOwner, WM_MENUSELECT, - MAKELONG(Pos, ItemInfo.fType | ItemInfo.fState - | MF_MOUSESELECT - | (TopMenuInfo.Flags & MF_SYSMENU)), - (LPARAM) topmenu); + WPARAM wParam = MAKELONG( Pos, ItemInfo.fType | ItemInfo.fState | + (TopMenuInfo.Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); + + SendMessageW(hwndOwner, WM_MENUSELECT, wParam, (LPARAM) topmenu); } } } @@ -2341,7 +2345,7 @@ /* correct item if modified as a reaction to WM_INITMENUPOPUP message */ if (0 == (ItemInfo.fState & MF_HILITE)) { - if (0 != (MenuInfo->Flags & MF_POPUP)) + if (0 != (MenuInfo->Flags & MNF_POPUP)) { Dc = GetDC(MenuInfo->Wnd); } @@ -2355,7 +2359,7 @@ ItemInfo.fState |= MF_HILITE; MenuSetRosMenuItemInfo(MenuInfo->Self, MenuInfo->FocusedItem, &ItemInfo); MenuDrawMenuItem(MenuInfo->Wnd, MenuInfo, WndOwner, Dc, &ItemInfo, MenuInfo->Height, - ! (MenuInfo->Flags & MF_POPUP), ODA_DRAWENTIRE); + ! (MenuInfo->Flags & MNF_POPUP), ODA_DRAWENTIRE); ReleaseDC(MenuInfo->Wnd, Dc); } @@ -2382,7 +2386,7 @@ else { GetWindowRect(MenuInfo->Wnd, &Rect); - if (0 != (MenuInfo->Flags & MF_POPUP)) + if (0 != (MenuInfo->Flags & MNF_POPUP)) { Rect.left += ItemInfo.Rect.right - GetSystemMetrics(SM_CXBORDER); Rect.top += ItemInfo.Rect.top - 3; @@ -2485,7 +2489,7 @@ if (MenuGetRosMenuInfo(&TopMenuInfo, Mt->TopMenu) && Mt->TopMenu != PtMenuInfo->Self && - 0 == ((PtMenuInfo->Flags | TopMenuInfo.Flags) & MF_POPUP)) + 0 == ((PtMenuInfo->Flags | TopMenuInfo.Flags) & MNF_POPUP)) { /* both are top level menus (system and menu-bar) */ MenuHideSubPopups(Mt->OwnerWnd, &TopMenuInfo, FALSE, wFlags); @@ -2541,17 +2545,20 @@ do not send a message to the owner */ if (0 == (Flags & TPM_RETURNCMD)) { - if (0 != (MenuInfo->Flags & MF_SYSMENU)) + if (0 != (MenuInfo->Flags & MNF_SYSDESKMN)) { PostMessageW(Mt->OwnerWnd, WM_SYSCOMMAND, ItemInfo.wID, MAKELPARAM((SHORT) Mt->Pt.x, (SHORT) Mt->Pt.y)); } else { - if (MenuInfo->dwStyle & MNS_NOTIFYBYPOS) - PostMessageW(Mt->OwnerWnd, WM_MENUCOMMAND, - MenuInfo->FocusedItem, - (LPARAM)MenuInfo->Self); + BOOL ret; + ROSMENUINFO topmenuI; + ret = MenuGetRosMenuInfo(&topmenuI, Mt->TopMenu); + DWORD dwStyle = MenuInfo->dwStyle | (ret ? topmenuI.dwStyle : 0); + + if (dwStyle & MNS_NOTIFYBYPOS) + PostMessageW(Mt->OwnerWnd, WM_MENUCOMMAND, MenuInfo->FocusedItem, (LPARAM)MenuInfo->Self); else PostMessageW(Mt->OwnerWnd, WM_COMMAND, ItemInfo.wID, 0); } @@ -2727,7 +2734,7 @@ /* check the current window (avoiding WM_HITTEST) */ Ht = DefWndNCHitTest(MenuInfo.Wnd, Pt); - if (0 != (MenuInfo.Flags & MF_POPUP)) + if (0 != (MenuInfo.Flags & MNF_POPUP)) { if (HTNOWHERE != Ht && HTERROR != Ht) { @@ -3013,7 +3020,7 @@ if (Mt->CurrentMenu != Mt->TopMenu) { if (MenuGetRosMenuInfo(&MenuInfo, Mt->CurrentMenu) - && 0 != (MenuInfo.Flags & MF_POPUP)) + && 0 != (MenuInfo.Flags & MNF_POPUP)) { MenuPrev = MenuTmp = Mt->TopMenu; @@ -3085,7 +3092,7 @@ { return; } - if ((MenuPrev == Mt->TopMenu) && !(TopMenuInfo.Flags & MF_POPUP)) + if ((MenuPrev == Mt->TopMenu) && !(TopMenuInfo.Flags & MNF_POPUP)) { /* move menu bar selection if no more popups are left */ @@ -3125,7 +3132,7 @@ Mt->CurrentMenu, Mt->TopMenu); if (! MenuGetRosMenuInfo(&MenuInfo, Mt->TopMenu)) return; - if ((MenuInfo.Flags & MF_POPUP) || (Mt->CurrentMenu != Mt->TopMenu)) + if ((MenuInfo.Flags & MNF_POPUP) || (Mt->CurrentMenu != Mt->TopMenu)) { /* If already displaying a popup, try to display sub-popup */ @@ -3155,7 +3162,7 @@ return; } - if (!(MenuInfo.Flags & MF_POPUP)) /* menu bar tracking */ + if (!(MenuInfo.Flags & MNF_POPUP)) /* menu bar tracking */ { if (Mt->CurrentMenu != Mt->TopMenu) { @@ -3266,7 +3273,7 @@ } if (!enterIdleSent) { - HWND win = MenuInfo.Flags & MF_POPUP ? MenuInfo.Wnd : NULL; + HWND win = MenuInfo.Flags & MNF_POPUP ? MenuInfo.Wnd : NULL; enterIdleSent = TRUE; SendMessageW( mt.OwnerWnd, WM_ENTERIDLE, MSGF_MENU, (LPARAM) win); } @@ -3385,7 +3392,7 @@ case VK_DOWN: /* If on menu bar, pull-down the menu */ if (MenuGetRosMenuInfo(&MenuInfo, mt.CurrentMenu)) { - if (!(MenuInfo.Flags & MF_POPUP)) + if (!(MenuInfo.Flags & MNF_POPUP)) { if (MenuGetRosMenuInfo(&MenuInfo, mt.TopMenu)) mt.CurrentMenu = MenuShowSubPopup(mt.OwnerWnd, &MenuInfo, TRUE, wFlags); @@ -3508,16 +3515,15 @@ { MenuHideSubPopups(mt.OwnerWnd, &MenuInfo, FALSE, wFlags); - if (MenuInfo.Flags & MF_POPUP) + if (MenuInfo.Flags & MNF_POPUP) { IntNotifyWinEvent(EVENT_SYSTEM_MENUPOPUPEND, MenuInfo.Wnd, OBJID_CLIENT, CHILDID_SELF, 0); DestroyWindow(MenuInfo.Wnd); MenuInfo.Wnd = NULL; - if (!(MenuInfo.Flags & TPM_NONOTIFY)) + if (!(wFlags & TPM_NONOTIFY)) SendMessageW( mt.OwnerWnd, WM_UNINITMENUPOPUP, (WPARAM)mt.TopMenu, MAKELPARAM(0, IS_SYSTEM_MENU(&MenuInfo)) ); - } MenuSelectItem( mt.OwnerWnd, &MenuInfo, NO_SELECTED_ITEM, FALSE, 0 ); } @@ -3585,7 +3591,7 @@ IntNotifyWinEvent( EVENT_SYSTEM_MENUSTART, hWnd, - MenuInfo.Flags & MF_SYSMENU ? OBJID_SYSMENU : OBJID_MENU, + MenuInfo.Flags & MNF_SYSDESKMN ? OBJID_SYSMENU : OBJID_MENU, CHILDID_SELF, 0); return TRUE; }
10 years, 9 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
24
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
Results per page:
10
25
50
100
200