winehq.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
2025
February
January
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
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
September 2018
----- 2025 -----
February 2025
January 2025
----- 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
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
670 discussions
Start a n
N
ew thread
Zhiyi Zhang : comctl32/button: Support BCM_GETIDEALSIZE message.
by Alexandre Julliard
05 Sep '18
05 Sep '18
Module: wine Branch: master Commit: 81f643748276010b76700a983b3c4283f23f0ead URL:
https://source.winehq.org/git/wine.git/?a=commit;h=81f643748276010b76700a98…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed Sep 5 22:59:34 2018 +0800 comctl32/button: Support BCM_GETIDEALSIZE message. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=24623
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 195 +++++++++++++++++++++++++++- dlls/comctl32/tests/button.c | 296 +++++++++++++++++++++++++++++++++++++++++++ include/commctrl.h | 2 + 3 files changed, 491 insertions(+), 2 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=81f643748276010b7670…
1
0
0
0
Zhiyi Zhang : comctl32/button: Support text margin rendering.
by Alexandre Julliard
05 Sep '18
05 Sep '18
Module: wine Branch: master Commit: eb79ebe50c123b68989209546d6109e182901aed URL:
https://source.winehq.org/git/wine.git/?a=commit;h=eb79ebe50c123b6898920954…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed Sep 5 22:59:13 2018 +0800 comctl32/button: Support text margin rendering. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 5fdfe7f..a9ca619 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -1027,6 +1027,17 @@ static SIZE BUTTON_GetImageSize(const BUTTON_INFO *infoPtr) return size; } +static const RECT *BUTTON_GetTextMargin(const BUTTON_INFO *infoPtr) +{ + static const RECT oneMargin = {1, 1, 1, 1}; + + /* Use text margin only when showing both image and text, and image is not imagelist */ + if (show_image_and_text(infoPtr) && !infoPtr->imagelist.himl) + return &infoPtr->text_margin; + else + return &oneMargin; +} + /********************************************************************** * BUTTON_CalcLayoutRects * @@ -1054,7 +1065,8 @@ static UINT BUTTON_CalcLayoutRects(const BUTTON_INFO *infoPtr, HDC hdc, RECT *la UINT dtStyle = BUTTON_BStoDT(style, ex_style); RECT labelRect, imageRect, imageRectWithMargin, textRect; LONG imageMarginWidth, imageMarginHeight; - RECT emptyMargin = {0}, oneMargin = {1, 1, 1, 1}; + const RECT *textMargin = BUTTON_GetTextMargin(infoPtr); + RECT emptyMargin = {0}; LONG maxTextWidth; /* Calculate label rectangle according to label type */ @@ -1118,7 +1130,7 @@ static UINT BUTTON_CalcLayoutRects(const BUTTON_INFO *infoPtr, HDC hdc, RECT *la BUTTON_PositionRect(split_style, &boundingImageRect, &imageRect, infoPtr->imagelist.himl ? &infoPtr->imagelist.margin : &emptyMargin); /* Text doesn't use imagelist align */ - BUTTON_PositionRect(style, &boundingTextRect, &textRect, &oneMargin); + BUTTON_PositionRect(style, &boundingTextRect, &textRect, textMargin); } else { @@ -1143,17 +1155,17 @@ static UINT BUTTON_CalcLayoutRects(const BUTTON_INFO *infoPtr, HDC hdc, RECT *la /* Get text rect */ SubtractRect(&boundingTextRect, &labelRect, &boundingImageRect); /* Text doesn't use imagelist align */ - BUTTON_PositionRect(style, &boundingTextRect, &textRect, &oneMargin); + BUTTON_PositionRect(style, &boundingTextRect, &textRect, textMargin); } } /* Show text only */ else { if (get_button_type(style) != BS_GROUPBOX) - BUTTON_PositionRect(style, labelRc, &textRect, &oneMargin); + BUTTON_PositionRect(style, labelRc, &textRect, textMargin); else /* GroupBox is always top aligned */ - BUTTON_PositionRect((style & ~BS_VCENTER) | BS_TOP, labelRc, &textRect, &oneMargin); + BUTTON_PositionRect((style & ~BS_VCENTER) | BS_TOP, labelRc, &textRect, textMargin); labelRect = textRect; SetRectEmpty(&imageRect); }
1
0
0
0
Zhiyi Zhang : comctl32/button: Support imagelist rendering.
by Alexandre Julliard
05 Sep '18
05 Sep '18
Module: wine Branch: master Commit: c9aa8dab8f0d86cf4fb06612f261c67327046789 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c9aa8dab8f0d86cf4fb06612…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed Sep 5 22:58:37 2018 +0800 comctl32/button: Support imagelist rendering. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=40445
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=40062
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=45246
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 162 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 118 insertions(+), 44 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=c9aa8dab8f0d86cf4fb0…
1
0
0
0
Zhiyi Zhang : comctl32/button: Avoid push button content covering frames.
by Alexandre Julliard
05 Sep '18
05 Sep '18
Module: wine Branch: master Commit: 790d13ee980eb083e108fb74d61eca13f5012340 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=790d13ee980eb083e108fb74…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed Sep 5 22:58:05 2018 +0800 comctl32/button: Avoid push button content covering frames. A focus frame may be covered by content in the push button. Shrink the label rectangle before layout calculation so that content can never cover the frame. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 653586a..2fa18f4 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -1250,6 +1250,8 @@ static void PB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) /* draw button label */ labelRect = rc; + /* Shrink label rect at all sides by 2 so that the content won't touch the surrounding frame */ + InflateRect(&labelRect, -2, -2); dtFlags = BUTTON_CalcLayoutRects(infoPtr, hDC, &labelRect, &imageRect, &textRect); if (dtFlags == (UINT)-1L)
1
0
0
0
Zhiyi Zhang : comctl32/button: Support displaying both image and text.
by Alexandre Julliard
05 Sep '18
05 Sep '18
Module: wine Branch: master Commit: 1f323f31d6311fe3c3a33f237583afe489325265 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1f323f31d6311fe3c3a33f23…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed Sep 5 22:57:39 2018 +0800 comctl32/button: Support displaying both image and text. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=45727
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 421 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 295 insertions(+), 126 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=1f323f31d6311fe3c3a3…
1
0
0
0
Zhiyi Zhang : comctl32/button: Use get_draw_state() helper.
by Alexandre Julliard
05 Sep '18
05 Sep '18
Module: wine Branch: master Commit: fa4183ef848fd53b492440f99a975e5e9ace86cd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fa4183ef848fd53b492440f9…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed Sep 5 22:57:18 2018 +0800 comctl32/button: Use get_draw_state() helper. Use a helper so that the get draw state routine can be shared by later code. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 118 +++++++++++++++++++++++++++++-------------------- 1 file changed, 71 insertions(+), 47 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 56968f9..6f9bc39 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -128,15 +128,16 @@ static const WORD maxCheckState[MAX_BTN_TYPE] = BST_UNCHECKED /* BS_DEFCOMMANDLINK */ }; -/* These are indices into a states array to determine the theme state for a given theme part. */ -typedef enum +/* Generic draw states, use get_draw_state() to get specific state for button type */ +enum draw_state { STATE_NORMAL, STATE_DISABLED, STATE_HOT, STATE_PRESSED, - STATE_DEFAULTED -} ButtonState; + STATE_DEFAULTED, + DRAW_STATE_COUNT +}; typedef void (*pfPaint)( const BUTTON_INFO *infoPtr, HDC hdc, UINT action ); @@ -160,11 +161,11 @@ static const pfPaint btnPaintFunc[MAX_BTN_TYPE] = PB_Paint /* BS_DEFCOMMANDLINK */ }; -typedef void (*pfThemedPaint)( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hdc, ButtonState drawState, UINT dtflags, BOOL focused); +typedef void (*pfThemedPaint)( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hdc, int drawState, UINT dtflags, BOOL focused); -static void PB_ThemedPaint( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hdc, ButtonState drawState, UINT dtflags, BOOL focused); -static void CB_ThemedPaint( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hdc, ButtonState drawState, UINT dtflags, BOOL focused); -static void GB_ThemedPaint( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hdc, ButtonState drawState, UINT dtflags, BOOL focused); +static void PB_ThemedPaint( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hdc, int drawState, UINT dtflags, BOOL focused); +static void CB_ThemedPaint( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hdc, int drawState, UINT dtflags, BOOL focused); +static void GB_ThemedPaint( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hdc, int drawState, UINT dtflags, BOOL focused); static const pfThemedPaint btnThemedPaintFunc[MAX_BTN_TYPE] = { @@ -286,6 +287,63 @@ static UINT BUTTON_BStoDT( DWORD style, DWORD ex_style ) return dtStyle; } +static int get_draw_state(const BUTTON_INFO *infoPtr) +{ + static const int pb_states[DRAW_STATE_COUNT] = { PBS_NORMAL, PBS_DISABLED, PBS_HOT, PBS_PRESSED, PBS_DEFAULTED }; + static const int cb_states[3][DRAW_STATE_COUNT] = + { + { CBS_UNCHECKEDNORMAL, CBS_UNCHECKEDDISABLED, CBS_UNCHECKEDHOT, CBS_UNCHECKEDPRESSED, CBS_UNCHECKEDNORMAL }, + { CBS_CHECKEDNORMAL, CBS_CHECKEDDISABLED, CBS_CHECKEDHOT, CBS_CHECKEDPRESSED, CBS_CHECKEDNORMAL }, + { CBS_MIXEDNORMAL, CBS_MIXEDDISABLED, CBS_MIXEDHOT, CBS_MIXEDPRESSED, CBS_MIXEDNORMAL } + }; + static const int rb_states[2][DRAW_STATE_COUNT] = + { + { RBS_UNCHECKEDNORMAL, RBS_UNCHECKEDDISABLED, RBS_UNCHECKEDHOT, RBS_UNCHECKEDPRESSED, RBS_UNCHECKEDNORMAL }, + { RBS_CHECKEDNORMAL, RBS_CHECKEDDISABLED, RBS_CHECKEDHOT, RBS_CHECKEDPRESSED, RBS_CHECKEDNORMAL } + }; + static const int gb_states[DRAW_STATE_COUNT] = { GBS_NORMAL, GBS_DISABLED, GBS_NORMAL, GBS_NORMAL, GBS_NORMAL }; + LONG style = GetWindowLongW(infoPtr->hwnd, GWL_STYLE); + UINT type = get_button_type(style); + int check_state = infoPtr->state & 3; + enum draw_state state; + + if (!IsWindowEnabled(infoPtr->hwnd)) + state = STATE_DISABLED; + else if (infoPtr->state & BST_PUSHED) + state = STATE_PRESSED; + else if (infoPtr->state & BST_HOT) + state = STATE_HOT; + else if (infoPtr->state & BST_FOCUS) + state = STATE_DEFAULTED; + else + state = STATE_NORMAL; + + switch (type) + { + case BS_PUSHBUTTON: + case BS_DEFPUSHBUTTON: + case BS_USERBUTTON: + case BS_SPLITBUTTON: + case BS_DEFSPLITBUTTON: + case BS_COMMANDLINK: + case BS_DEFCOMMANDLINK: + return pb_states[state]; + case BS_CHECKBOX: + case BS_AUTOCHECKBOX: + return cb_states[check_state][state]; + case BS_RADIOBUTTON: + case BS_3STATE: + case BS_AUTO3STATE: + case BS_AUTORADIOBUTTON: + return rb_states[check_state][state]; + case BS_GROUPBOX: + return gb_states[state]; + default: + WARN("Unsupported button type 0x%08x\n", type); + return PBS_NORMAL; + } +} + static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { BUTTON_INFO *infoPtr = (BUTTON_INFO *)GetWindowLongPtrW(hWnd, 0); @@ -402,20 +460,9 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L if (theme && btnThemedPaintFunc[btn_type]) { - ButtonState drawState; - UINT dtflags; + int drawState = get_draw_state(infoPtr); + UINT dtflags = BUTTON_BStoDT(style, GetWindowLongW(hWnd, GWL_EXSTYLE)); - if (IsWindowEnabled( hWnd )) - { - if (infoPtr->state & BST_PUSHED) drawState = STATE_PRESSED; - else if (infoPtr->state & BST_HOT) drawState = STATE_HOT; - else if (infoPtr->state & BST_FOCUS) drawState = STATE_DEFAULTED; - else drawState = STATE_NORMAL; - } - else - drawState = STATE_DISABLED; - - dtflags = BUTTON_BStoDT(style, GetWindowLongW(hWnd, GWL_EXSTYLE)); btnThemedPaintFunc[btn_type](theme, infoPtr, hdc, drawState, dtflags, infoPtr->state & BST_FOCUS); } else if (btnPaintFunc[btn_type]) @@ -1352,14 +1399,11 @@ static void OB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) if (hrgn) DeleteObject( hrgn ); } -static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused) +static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, int state, UINT dtFlags, BOOL focused) { - static const int states[] = { PBS_NORMAL, PBS_DISABLED, PBS_HOT, PBS_PRESSED, PBS_DEFAULTED }; - RECT bgRect, textRect; HFONT font = infoPtr->font; HFONT hPrevFont = font ? SelectObject(hDC, font) : NULL; - int state = states[ drawState ]; WCHAR *text = get_button_text(infoPtr); GetClientRect(infoPtr->hwnd, &bgRect); @@ -1392,31 +1436,14 @@ static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, Bu if (hPrevFont) SelectObject(hDC, hPrevFont); } -static void CB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused) +static void CB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, int state, UINT dtFlags, BOOL focused) { - static const int cb_states[3][5] = - { - { CBS_UNCHECKEDNORMAL, CBS_UNCHECKEDDISABLED, CBS_UNCHECKEDHOT, CBS_UNCHECKEDPRESSED, CBS_UNCHECKEDNORMAL }, - { CBS_CHECKEDNORMAL, CBS_CHECKEDDISABLED, CBS_CHECKEDHOT, CBS_CHECKEDPRESSED, CBS_CHECKEDNORMAL }, - { CBS_MIXEDNORMAL, CBS_MIXEDDISABLED, CBS_MIXEDHOT, CBS_MIXEDPRESSED, CBS_MIXEDNORMAL } - }; - - static const int rb_states[2][5] = - { - { RBS_UNCHECKEDNORMAL, RBS_UNCHECKEDDISABLED, RBS_UNCHECKEDHOT, RBS_UNCHECKEDPRESSED, RBS_UNCHECKEDNORMAL }, - { RBS_CHECKEDNORMAL, RBS_CHECKEDDISABLED, RBS_CHECKEDHOT, RBS_CHECKEDPRESSED, RBS_CHECKEDNORMAL } - }; - SIZE sz; RECT bgRect, textRect; HFONT font, hPrevFont = NULL; - int checkState = infoPtr->state & 3; DWORD dwStyle = GetWindowLongW(infoPtr->hwnd, GWL_STYLE); UINT btn_type = get_button_type( dwStyle ); int part = (btn_type == BS_RADIOBUTTON) || (btn_type == BS_AUTORADIOBUTTON) ? BP_RADIOBUTTON : BP_CHECKBOX; - int state = (part == BP_CHECKBOX) - ? cb_states[ checkState ][ drawState ] - : rb_states[ checkState ][ drawState ]; WCHAR *text = get_button_text(infoPtr); LOGFONTW lf; BOOL created_font = FALSE; @@ -1478,12 +1505,9 @@ static void CB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, Bu if (hPrevFont) SelectObject(hDC, hPrevFont); } -static void GB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused) +static void GB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, int state, UINT dtFlags, BOOL focused) { - static const int states[] = { GBS_NORMAL, GBS_DISABLED, GBS_NORMAL, GBS_NORMAL, GBS_NORMAL }; - RECT bgRect, textRect, contentRect; - int state = states[ drawState ]; WCHAR *text = get_button_text(infoPtr); LOGFONTW lf; HFONT font, hPrevFont = NULL;
1
0
0
0
Zhiyi Zhang : comctl32/tests: Add tests for button state.
by Alexandre Julliard
05 Sep '18
05 Sep '18
Module: wine Branch: master Commit: 396ebaa58821917cca0df89e6d7e471c7b32ee44 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=396ebaa58821917cca0df89e…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed Sep 5 22:56:57 2018 +0800 comctl32/tests: Add tests for button state. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/button.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/comctl32/tests/button.c b/dlls/comctl32/tests/button.c index b27ab84..1fd644b 100644 --- a/dlls/comctl32/tests/button.c +++ b/dlls/comctl32/tests/button.c @@ -1406,6 +1406,22 @@ static void test_get_set_textmargin(void) } } +static void test_state(void) +{ + HWND hwnd; + DWORD type; + LONG state; + + /* Initial button state */ + for (type = BS_PUSHBUTTON; type <= BS_DEFCOMMANDLINK; type++) + { + hwnd = create_button(type, NULL); + state = SendMessageA(hwnd, BM_GETSTATE, 0, 0); + ok(state == BST_UNCHECKED, "Expect state 0x%08x, got 0x%08x\n", BST_UNCHECKED, state); + DestroyWindow(hwnd); + } +} + START_TEST(button) { ULONG_PTR ctx_cookie; @@ -1426,6 +1442,7 @@ START_TEST(button) test_bm_get_set_image(); test_get_set_imagelist(); test_get_set_textmargin(); + test_state(); unload_v6_module(ctx_cookie, hCtx); }
1
0
0
0
Hans Leidekker : userenv: Fix setting the ALLUSERSPROFILE environment variable.
by Alexandre Julliard
05 Sep '18
05 Sep '18
Module: wine Branch: master Commit: fd044802b9de14416b4d5fa723d2596d39402c97 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fd044802b9de14416b4d5fa7…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Sep 5 12:38:50 2018 +0200 userenv: Fix setting the ALLUSERSPROFILE environment variable. Since 27edd4e35c1eb3827dfb20578733242d9ed3d460 ALLUSERSPROFILE is set to C:\\users\\C:\\users\\Public. This is because the expanded registry value of "Public" is appended to "ProfilesDirectory" and "Public" expands to a full path. AllUsersProfile, used before this commit, expanded to just "Public". Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/userenv/userenv_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/userenv/userenv_main.c b/dlls/userenv/userenv_main.c index 06c7653..11a4f75 100644 --- a/dlls/userenv/userenv_main.c +++ b/dlls/userenv/userenv_main.c @@ -244,7 +244,7 @@ BOOL WINAPI CreateEnvironmentBlock( LPVOID* lpEnvironment, static const WCHAR SystemRootW[] = {'S','y','s','t','e','m','R','o','o','t',0}; static const WCHAR SystemDriveW[] = {'S','y','s','t','e','m','D','r','i','v','e',0}; - static const WCHAR AllUsersProfileW[] = {'P','u','b','l','i','c',0}; + static const WCHAR PublicW[] = {'P','u','b','l','i','c',0}; static const WCHAR ALLUSERSPROFILEW[] = {'A','L','L','U','S','E','R','S','P','R','O','F','I','L','E',0}; static const WCHAR USERNAMEW[] = {'U','S','E','R','N','A','M','E',0}; static const WCHAR USERPROFILEW[] = {'U','S','E','R','P','R','O','F','I','L','E',0}; @@ -323,8 +323,7 @@ BOOL WINAPI CreateEnvironmentBlock( LPVOID* lpEnvironment, profiles_dir[len] = '\0'; } - memcpy(buf, profiles_dir, len*sizeof(WCHAR)); - if (get_reg_value(env, hkey, AllUsersProfileW, buf+len, UNICODE_STRING_MAX_CHARS-len)) + if (get_reg_value(env, hkey, PublicW, buf, UNICODE_STRING_MAX_CHARS)) { RtlInitUnicodeString(&us_name, ALLUSERSPROFILEW); RtlInitUnicodeString(&us_val, buf);
1
0
0
0
Nikolay Sivov : opcservices: Forward IOpcPartUri methods to urlmon implementation.
by Alexandre Julliard
05 Sep '18
05 Sep '18
Module: wine Branch: master Commit: a37d8a203d234a12b42554d2cf3a81767f4cda63 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a37d8a203d234a12b42554d2…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Sep 5 08:37:29 2018 +0300 opcservices: Forward IOpcPartUri methods to urlmon implementation. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/opcservices/Makefile.in | 2 +- dlls/opcservices/uri.c | 190 ++++++++++++++++++++++++++++++------------- 2 files changed, 135 insertions(+), 57 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=a37d8a203d234a12b425…
1
0
0
0
Nikolay Sivov : opcservices: Partially implement CreatePackageRootUri().
by Alexandre Julliard
05 Sep '18
05 Sep '18
Module: wine Branch: master Commit: d6c50ee2840f744f7e59407b51c7ef5dc2837f2f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d6c50ee2840f744f7e59407b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Sep 5 08:37:28 2018 +0300 opcservices: Partially implement CreatePackageRootUri(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/opcservices/factory.c | 6 ++++-- dlls/opcservices/opc_private.h | 1 + dlls/opcservices/tests/Makefile.in | 2 +- dlls/opcservices/tests/opcservices.c | 21 +++++++++++++++++++++ dlls/opcservices/uri.c | 23 ++++++++++++++++++++++- 5 files changed, 49 insertions(+), 4 deletions(-) diff --git a/dlls/opcservices/factory.c b/dlls/opcservices/factory.c index 7d72b39..0c16cc2 100644 --- a/dlls/opcservices/factory.c +++ b/dlls/opcservices/factory.c @@ -309,9 +309,11 @@ static ULONG WINAPI opc_factory_Release(IOpcFactory *iface) static HRESULT WINAPI opc_factory_CreatePackageRootUri(IOpcFactory *iface, IOpcUri **uri) { - FIXME("iface %p, uri %p stub!\n", iface, uri); + static const WCHAR rootW[] = {'/',0}; - return E_NOTIMPL; + TRACE("iface %p, uri %p.\n", iface, uri); + + return opc_uri_create(rootW, uri); } static HRESULT WINAPI opc_factory_CreatePartUri(IOpcFactory *iface, LPCWSTR uri, IOpcPartUri **part_uri) diff --git a/dlls/opcservices/opc_private.h b/dlls/opcservices/opc_private.h index 30bcb00..80b1e95 100644 --- a/dlls/opcservices/opc_private.h +++ b/dlls/opcservices/opc_private.h @@ -47,3 +47,4 @@ static inline BOOL opc_array_reserve(void **elements, size_t *capacity, size_t c extern HRESULT opc_package_create(IOpcPackage **package) DECLSPEC_HIDDEN; extern HRESULT opc_part_uri_create(const WCHAR *uri, IOpcPartUri **part_uri) DECLSPEC_HIDDEN; +extern HRESULT opc_uri_create(const WCHAR *uri, IOpcUri **opc_uri) DECLSPEC_HIDDEN; diff --git a/dlls/opcservices/tests/Makefile.in b/dlls/opcservices/tests/Makefile.in index 202bf87..4fa222e 100644 --- a/dlls/opcservices/tests/Makefile.in +++ b/dlls/opcservices/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = opcservices.dll -IMPORTS = ole32 urlmon +IMPORTS = ole32 urlmon oleaut32 C_SRCS = \ opcservices.c diff --git a/dlls/opcservices/tests/opcservices.c b/dlls/opcservices/tests/opcservices.c index 2850716..9af7aa4 100644 --- a/dlls/opcservices/tests/opcservices.c +++ b/dlls/opcservices/tests/opcservices.c @@ -210,14 +210,18 @@ static void test_relationship(void) static const WCHAR absoluteW[] = {'f','i','l','e',':','/','/','h','o','s','t','/','f','i','l','e','.','t','x','t',0}; static const WCHAR targetW[] = {'t','a','r','g','e','t',0}; static const WCHAR typeW[] = {'t','y','p','e',0}; + static const WCHAR rootW[] = {'/',0}; IUri *target_uri, *target_uri2, *uri; IOpcRelationshipSet *rels; IOpcRelationship *rel; IOpcFactory *factory; IOpcPackage *package; + IOpcUri *source_uri; + IUnknown *unk; DWORD mode; HRESULT hr; WCHAR *id; + BSTR str; factory = create_factory(); @@ -267,6 +271,23 @@ todo_wine ok(SUCCEEDED(hr), "Failed to get target mode, hr %#x.\n", hr); ok(mode == OPC_URI_TARGET_MODE_INTERNAL, "Unexpected mode %d.\n", mode); + /* Source uri */ + hr = IOpcRelationship_GetSourceUri(rel, &source_uri); +todo_wine + ok(SUCCEEDED(hr), "Failed to get source uri, hr %#x.\n", hr); + + hr = IOpcUri_QueryInterface(source_uri, &IID_IOpcPartUri, (void **)&unk); + ok(hr == E_NOINTERFACE, "Unexpected hr %#x.\n", hr); + + str = NULL; + hr = IOpcUri_GetRawUri(source_uri, &str); + ok(SUCCEEDED(hr), "Failed to get raw uri, hr %#x.\n", hr); +todo_wine + ok(!lstrcmpW(rootW, str), "Unexpected uri %s.\n", wine_dbgstr_w(str)); + SysFreeString(str); + + IOpcUri_Release(source_uri); + IOpcRelationship_Release(rel); IOpcRelationshipSet_Release(rels); diff --git a/dlls/opcservices/uri.c b/dlls/opcservices/uri.c index 60881e8..651c2e3 100644 --- a/dlls/opcservices/uri.c +++ b/dlls/opcservices/uri.c @@ -32,6 +32,7 @@ struct opc_uri { IOpcPartUri IOpcPartUri_iface; LONG refcount; + BOOL is_part_uri; }; static inline struct opc_uri *impl_from_IOpcPartUri(IOpcPartUri *iface) @@ -41,9 +42,13 @@ static inline struct opc_uri *impl_from_IOpcPartUri(IOpcPartUri *iface) static HRESULT WINAPI opc_uri_QueryInterface(IOpcPartUri *iface, REFIID iid, void **out) { + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); - if (IsEqualIID(iid, &IID_IOpcPartUri) || + if ((uri->is_part_uri && IsEqualIID(iid, &IID_IOpcPartUri)) || + IsEqualIID(iid, &IID_IOpcUri) || + IsEqualIID(iid, &IID_IUri) || IsEqualIID(iid, &IID_IUnknown)) { *out = iface; @@ -348,8 +353,24 @@ HRESULT opc_part_uri_create(const WCHAR *str, IOpcPartUri **out) uri->IOpcPartUri_iface.lpVtbl = &opc_part_uri_vtbl; uri->refcount = 1; + uri->is_part_uri = TRUE; *out = &uri->IOpcPartUri_iface; TRACE("Created part uri %p.\n", *out); return S_OK; } + +HRESULT opc_uri_create(const WCHAR *str, IOpcUri **out) +{ + struct opc_uri *uri; + + if (!(uri = heap_alloc_zero(sizeof(*uri)))) + return E_OUTOFMEMORY; + + uri->IOpcPartUri_iface.lpVtbl = &opc_part_uri_vtbl; + uri->refcount = 1; + + *out = (IOpcUri *)&uri->IOpcPartUri_iface; + TRACE("Created part uri %p.\n", *out); + return S_OK; +}
1
0
0
0
← Newer
1
...
60
61
62
63
64
65
66
67
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Results per page:
10
25
50
100
200