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
July 2023
----- 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
1 participants
865 discussions
Start a n
N
ew thread
Fabian Maurer : gdiplus: Make flatten_bezier_add iterative.
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: wine Branch: master Commit: 7da5dff88ce6d1cb77e855bf91697252f703c12f URL:
https://gitlab.winehq.org/wine/wine/-/commit/7da5dff88ce6d1cb77e855bf916972…
Author: Fabian Maurer <dark.shadow4(a)web.de> Date: Mon Jul 24 16:47:55 2023 +0200 gdiplus: Make flatten_bezier_add iterative. --- dlls/gdiplus/graphicspath.c | 139 ++++++++++++++++++++++++++++++-------------- 1 file changed, 94 insertions(+), 45 deletions(-) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 6cdc2a58059..06e17d4b98a 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -103,6 +103,28 @@ static INT path_list_count(path_list_node_t *node) return count; } +struct flatten_bezier_job +{ + path_list_node_t *start; + REAL x2; + REAL y2; + REAL x3; + REAL y3; + path_list_node_t *end; + struct list entry; +}; + +static BOOL flatten_bezier_add(struct list *jobs, path_list_node_t *start, REAL x2, REAL y2, REAL x3, REAL y3, path_list_node_t *end) +{ + struct flatten_bezier_job *job = malloc(sizeof(struct flatten_bezier_job)); + struct flatten_bezier_job temp = { start, x2, y2, x3, y3, end }; + if (!job) + return FALSE; + *job = temp; + list_add_after(jobs, &job->entry); + return TRUE; +} + /* GdipFlattenPath helper */ /* * Used to recursively flatten single Bezier curve @@ -128,55 +150,82 @@ static BOOL flatten_bezier(path_list_node_t *start, REAL x2, REAL y2, REAL x3, R GpPointF pt, pt_st; path_list_node_t *node; REAL area_triangle, distance_start_end; + BOOL ret = TRUE; + struct list jobs; + struct flatten_bezier_job *current, *next; + + list_init( &jobs ); + flatten_bezier_add(&jobs, start, x2, y2, x3, y3, end); + LIST_FOR_EACH_ENTRY( current, &jobs, struct flatten_bezier_job, entry ) + { + start = current->start; + x2 = current->x2; + y2 = current->y2; + x3 = current->x3; + y3 = current->y3; + end = current->end; + + /* middle point between control points */ + pt.X = (x2 + x3) / 2.0; + pt.Y = (y2 + y3) / 2.0; + + /* calculate bezier curve middle points == new control points */ + mp[0].X = (start->pt.X + x2) / 2.0; + mp[0].Y = (start->pt.Y + y2) / 2.0; + mp[1].X = (mp[0].X + pt.X) / 2.0; + mp[1].Y = (mp[0].Y + pt.Y) / 2.0; + mp[4].X = (end->pt.X + x3) / 2.0; + mp[4].Y = (end->pt.Y + y3) / 2.0; + mp[3].X = (mp[4].X + pt.X) / 2.0; + mp[3].Y = (mp[4].Y + pt.Y) / 2.0; + + /* middle point between new control points */ + mp[2].X = (mp[1].X + mp[3].X) / 2.0; + mp[2].Y = (mp[1].Y + mp[3].Y) / 2.0; + + /* Is one pair of the new control points equal to the old control points? */ + if ((x2 == mp[0].X && y2 == mp[0].Y && x3 == mp[1].X && y3 == mp[1].Y) || + (x2 == mp[3].X && y2 == mp[3].Y && x3 == mp[4].X && y3 == mp[4].Y)) + continue; + + pt = end->pt; + pt_st = start->pt; + + /* check flatness as a half of distance between middle point and a linearized path + * formula for distance point from line for point (x0, y0) and line (x1, y1) (x2, y2) + * is defined as (area_triangle / distance_start_end): + * | (x2 - x1) * (y1 - y0) - (x1 - x0) * (y2 - y1) / sqrt( (x2 - x1)^2 + (y2 - y1)^2 ) | + * Here rearranged to avoid division and simplified: + * x0(y2 - y1) + y0(x1 - x2) + (x2*y1 - x1*y2) + */ + area_triangle = (pt.Y - pt_st.Y)*mp[2].X + (pt_st.X - pt.X)*mp[2].Y + (pt_st.Y*pt.X - pt_st.X*pt.Y); + distance_start_end = sqrtf(powf(pt.Y - pt_st.Y, 2.0) + powf(pt_st.X - pt.X, 2.0)); + if(fabs(area_triangle) <= (0.5 * flatness * distance_start_end)){ + continue; + } + else + /* add a middle point */ + if(!(node = add_path_list_node(start, mp[2].X, mp[2].Y, PathPointTypeLine))) + { + ret = FALSE; + break; + }; - /* middle point between control points */ - pt.X = (x2 + x3) / 2.0; - pt.Y = (y2 + y3) / 2.0; - - /* calculate bezier curve middle points == new control points */ - mp[0].X = (start->pt.X + x2) / 2.0; - mp[0].Y = (start->pt.Y + y2) / 2.0; - mp[1].X = (mp[0].X + pt.X) / 2.0; - mp[1].Y = (mp[0].Y + pt.Y) / 2.0; - mp[4].X = (end->pt.X + x3) / 2.0; - mp[4].Y = (end->pt.Y + y3) / 2.0; - mp[3].X = (mp[4].X + pt.X) / 2.0; - mp[3].Y = (mp[4].Y + pt.Y) / 2.0; - - /* middle point between new control points */ - mp[2].X = (mp[1].X + mp[3].X) / 2.0; - mp[2].Y = (mp[1].Y + mp[3].Y) / 2.0; - - /* Is one pair of the new control points equal to the old control points? */ - if ((x2 == mp[0].X && y2 == mp[0].Y && x3 == mp[1].X && y3 == mp[1].Y) || - (x2 == mp[3].X && y2 == mp[3].Y && x3 == mp[4].X && y3 == mp[4].Y)) - return TRUE; - - pt = end->pt; - pt_st = start->pt; - - /* check flatness as a half of distance between middle point and a linearized path - * formula for distance point from line for point (x0, y0) and line (x1, y1) (x2, y2) - * is defined as (area_triangle / distance_start_end): - * | (x2 - x1) * (y1 - y0) - (x1 - x0) * (y2 - y1) / sqrt( (x2 - x1)^2 + (y2 - y1)^2 ) | - * Here rearranged to avoid division and simplified: - * x0(y2 - y1) + y0(x1 - x2) + (x2*y1 - x1*y2) - */ - area_triangle = (pt.Y - pt_st.Y)*mp[2].X + (pt_st.X - pt.X)*mp[2].Y + (pt_st.Y*pt.X - pt_st.X*pt.Y); - distance_start_end = sqrtf(powf(pt.Y - pt_st.Y, 2.0) + powf(pt_st.X - pt.X, 2.0)); - if(fabs(area_triangle) <= (0.5 * flatness * distance_start_end)){ - return TRUE; + /* do the same with halves */ + if (!flatten_bezier_add(¤t->entry, node, mp[3].X, mp[3].Y, mp[4].X, mp[4].Y, end)) + break; + if (!flatten_bezier_add(¤t->entry, start, mp[0].X, mp[0].Y, mp[1].X, mp[1].Y, node)) + break; } - else - /* add a middle point */ - if(!(node = add_path_list_node(start, mp[2].X, mp[2].Y, PathPointTypeLine))) - return FALSE; - /* do the same with halves */ - flatten_bezier(start, mp[0].X, mp[0].Y, mp[1].X, mp[1].Y, node, flatness); - flatten_bezier(node, mp[3].X, mp[3].Y, mp[4].X, mp[4].Y, end, flatness); + /* Cleanup */ + LIST_FOR_EACH_ENTRY_SAFE( current, next, &jobs, struct flatten_bezier_job, entry ) + { + list_remove(¤t->entry); + free(current); + } - return TRUE; + return ret; } /* GdipAddPath* helper
1
0
0
0
Connor McAdams : uiautomationcore: Implement IUIAutomation::{Add/Remove}FocusChangedEventHandler.
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: wine Branch: master Commit: a8697c43a73883ce795028f9aa2d90f8d1c970ec URL:
https://gitlab.winehq.org/wine/wine/-/commit/a8697c43a73883ce795028f9aa2d90…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Thu Jul 20 10:51:11 2023 -0400 uiautomationcore: Implement IUIAutomation::{Add/Remove}FocusChangedEventHandler. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 14 +-- dlls/uiautomationcore/uia_com_client.c | 175 +++++++++++++++++++++-------- 2 files changed, 137 insertions(+), 52 deletions(-)
1
0
0
0
Connor McAdams : uiautomationcore/tests: Add IUIAutomationFocusChangedEventHandler tests.
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: wine Branch: master Commit: 63330c61683d195c309144f690f253c51762385e URL:
https://gitlab.winehq.org/wine/wine/-/commit/63330c61683d195c309144f690f253…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Thu Jun 29 10:52:34 2023 -0400 uiautomationcore/tests: Add IUIAutomationFocusChangedEventHandler tests. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 145 +++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index 74bcd5c0e16..59ae9535892 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -13116,6 +13116,71 @@ static struct AutomationEventHandler AutomationEventHandler = 1, }; +/* + * IUIAutomationFocusChangedEventHandler. + */ +static struct FocusChangedHandler +{ + IUIAutomationFocusChangedEventHandler IUIAutomationFocusChangedEventHandler_iface; + LONG ref; + + BOOL event_handler_added; +} FocusChangedHandler; + +static inline struct FocusChangedHandler *impl_from_FocusChangedHandler(IUIAutomationFocusChangedEventHandler *iface) +{ + return CONTAINING_RECORD(iface, struct FocusChangedHandler, IUIAutomationFocusChangedEventHandler_iface); +} + +static HRESULT WINAPI FocusChangedHandler_QueryInterface(IUIAutomationFocusChangedEventHandler *iface, + REFIID riid, void **ppv) +{ + *ppv = NULL; + if (IsEqualIID(riid, &IID_IUIAutomationFocusChangedEventHandler) || IsEqualIID(riid, &IID_IUnknown)) + *ppv = iface; + else + return E_NOINTERFACE; + + IUIAutomationFocusChangedEventHandler_AddRef(iface); + return S_OK; +} + +static ULONG WINAPI FocusChangedHandler_AddRef(IUIAutomationFocusChangedEventHandler* iface) +{ + struct FocusChangedHandler *handler = impl_from_FocusChangedHandler(iface); + return InterlockedIncrement(&handler->ref); +} + +static ULONG WINAPI FocusChangedHandler_Release(IUIAutomationFocusChangedEventHandler* iface) +{ + struct FocusChangedHandler *handler = impl_from_FocusChangedHandler(iface); + return InterlockedDecrement(&handler->ref); +} + +static HRESULT WINAPI FocusChangedHandler_HandleFocusChangedEvent(IUIAutomationFocusChangedEventHandler *iface, + IUIAutomationElement *sender) +{ + struct FocusChangedHandler *handler = impl_from_FocusChangedHandler(iface); + + if (handler->event_handler_added) + test_com_event_data(sender); + + return S_OK; +} + +static const IUIAutomationFocusChangedEventHandlerVtbl FocusChangedHandlerVtbl = { + FocusChangedHandler_QueryInterface, + FocusChangedHandler_AddRef, + FocusChangedHandler_Release, + FocusChangedHandler_HandleFocusChangedEvent, +}; + +static struct FocusChangedHandler FocusChangedHandler = +{ + { &FocusChangedHandlerVtbl }, + 1, +}; + static DWORD WINAPI uia_com_event_handler_test_thread(LPVOID param) { struct node_provider_desc exp_node_desc; @@ -13302,6 +13367,85 @@ static void test_IUIAutomationEventHandler(IUIAutomation *uia_iface, IUIAutomati IUIAutomationElement_Release(elem2); } +static void test_IUIAutomationFocusChangedEventHandler(IUIAutomation *uia_iface) +{ + struct node_provider_desc exp_node_desc; + IUIAutomationElement *elem; + HRESULT hr; + + SetFocus(ComEventData.event_hwnd); + + /* + * FocusChangedEventHandlers are always registered on the desktop node + * with a scope of the entire desktop. + * + * All versions of Windows query the currently focused HWND when adding a + * new focus changed event handler, but behavior differs between versions: + * + * Win7-Win10v1507 queries for the focused provider and raises an event + * while also advising of events. + * + * Win10v1809+ will query the focused HWND, but doesn't advise of events + * or raise a focus event. Windows 11 will advise the provider of the + * focused HWND of events, but not any clientside providers. + */ + set_uia_hwnd_expects(6, 6, 6, 3, 0); + hr = IUIAutomation_AddFocusChangedEventHandler(uia_iface, NULL, + &FocusChangedHandler.IUIAutomationFocusChangedEventHandler_iface); + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine ok(FocusChangedHandler.ref > 1, "Unexpected refcnt %ld\n", FocusChangedHandler.ref); + check_uia_hwnd_expects_at_most(6, 6, 6, 3, 0); + FocusChangedHandler.event_handler_added = TRUE; + + /* + * Focus changed event handlers are registered on the desktop with a scope + * of all elements, so all elements match regardless of runtime ID. + */ + initialize_provider(&Provider2, ProviderOptions_ServerSideProvider, NULL, TRUE); + init_node_provider_desc(&exp_node_desc, GetCurrentProcessId(), NULL); + add_provider_desc(&exp_node_desc, L"Main", L"Provider2", TRUE); + set_com_event_data(&exp_node_desc); + hr = UiaRaiseAutomationEvent(&Provider2.IRawElementProviderSimple_iface, UIA_AutomationFocusChangedEventId); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine CHECK_CALLED(uia_com_event_callback); + + /* + * Removing the focus changed event handler creates a desktop node - + * presumably to use to get a runtime ID for removal. + */ + set_uia_hwnd_expects(1, 1, 1, 0, 0); + hr = IUIAutomation_RemoveFocusChangedEventHandler(uia_iface, + &FocusChangedHandler.IUIAutomationFocusChangedEventHandler_iface); + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(FocusChangedHandler.ref == 1, "Unexpected refcnt %ld\n", FocusChangedHandler.ref); + FocusChangedHandler.event_handler_added = FALSE; + check_uia_hwnd_expects(1, TRUE, 1, TRUE, 1, TRUE, 0, FALSE, 0, FALSE); + + /* + * The focus changed event handler can also be removed by called + * RemoveAutomationEventHandler, which isn't documented. + */ + set_uia_hwnd_expects(6, 6, 6, 3, 0); + hr = IUIAutomation_AddFocusChangedEventHandler(uia_iface, NULL, + &FocusChangedHandler.IUIAutomationFocusChangedEventHandler_iface); + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine ok(FocusChangedHandler.ref > 1, "Unexpected refcnt %ld\n", FocusChangedHandler.ref); + check_uia_hwnd_expects_at_most(6, 6, 6, 3, 0); + FocusChangedHandler.event_handler_added = TRUE; + + set_uia_hwnd_expects(1, 1, 1, 0, 0); + hr = IUIAutomation_GetRootElement(uia_iface, &elem); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_uia_hwnd_expects(1, FALSE, 1, FALSE, 1, FALSE, 0, FALSE, 0, FALSE); + + hr = IUIAutomation_RemoveAutomationEventHandler(uia_iface, UIA_AutomationFocusChangedEventId, elem, + (IUIAutomationEventHandler *)&FocusChangedHandler.IUIAutomationFocusChangedEventHandler_iface); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(FocusChangedHandler.ref == 1, "Unexpected refcnt %ld\n", FocusChangedHandler.ref); + + IUIAutomationElement_Release(elem); +} + static void test_CUIAutomation_event_handlers(IUIAutomation *uia_iface) { IUIAutomationElement *elem; @@ -13334,6 +13478,7 @@ static void test_CUIAutomation_event_handlers(IUIAutomation *uia_iface) check_uia_hwnd_expects(1, TRUE, 1, FALSE, 1, FALSE, 1, FALSE, 0, FALSE); test_IUIAutomationEventHandler(uia_iface, elem); + test_IUIAutomationFocusChangedEventHandler(uia_iface); IUIAutomationElement_Release(elem); UiaRegisterProviderCallback(NULL);
1
0
0
0
Connor McAdams : uiautomationcore: Add support for calling COM event handlers.
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: wine Branch: master Commit: 53376c5568c49f738645fbb0e4705709ea1b899d URL:
https://gitlab.winehq.org/wine/wine/-/commit/53376c5568c49f738645fbb0e47057…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Thu Jul 20 10:26:58 2023 -0400 uiautomationcore: Add support for calling COM event handlers. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 8 +- dlls/uiautomationcore/uia_com_client.c | 113 +++++++++++++++++++++++------ dlls/uiautomationcore/uia_event.c | 2 +- dlls/uiautomationcore/uia_private.h | 3 + 4 files changed, 99 insertions(+), 27 deletions(-)
1
0
0
0
Connor McAdams : uiautomationcore: Introduce custom clientside event callback function.
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: wine Branch: master Commit: 9ab915a7fb60c0a6ac8a8d9f7ac22a99d8355f40 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9ab915a7fb60c0a6ac8a8d9f7ac22a…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Tue Jun 27 09:12:17 2023 -0400 uiautomationcore: Introduce custom clientside event callback function. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/uia_event.c | 93 +++++++++++++++++++++++-------------- dlls/uiautomationcore/uia_private.h | 11 ++++- 2 files changed, 69 insertions(+), 35 deletions(-) diff --git a/dlls/uiautomationcore/uia_event.c b/dlls/uiautomationcore/uia_event.c index 801ccf4a705..84120ae90fc 100644 --- a/dlls/uiautomationcore/uia_event.c +++ b/dlls/uiautomationcore/uia_event.c @@ -217,12 +217,6 @@ static void uia_event_map_entry_release(struct uia_event_map_entry *entry) * as they're raised on a background thread after the event raising * function has returned. */ -struct uia_event_args -{ - struct UiaEventArgs simple_args; - LONG ref; -}; - static struct uia_event_args *create_uia_event_args(const struct uia_event_info *event_info) { struct uia_event_args *args = heap_alloc_zero(sizeof(*args)); @@ -733,8 +727,8 @@ static HRESULT create_uia_event(struct uia_event **out_event, LONG event_cookie, return S_OK; } -static HRESULT create_clientside_uia_event(struct uia_event **out_event, int event_id, int scope, UiaEventCallback *cback, - SAFEARRAY *runtime_id) +static HRESULT create_clientside_uia_event(struct uia_event **out_event, int event_id, int scope, + UiaWineEventCallback *cback, void *cback_data, SAFEARRAY *runtime_id) { struct uia_event *event = NULL; static LONG next_event_cookie; @@ -748,7 +742,8 @@ static HRESULT create_clientside_uia_event(struct uia_event **out_event, int eve event->runtime_id = runtime_id; event->event_id = event_id; event->scope = scope; - event->u.clientside.cback = cback; + event->u.clientside.event_callback = cback; + event->u.clientside.callback_data = cback_data; *out_event = event; return S_OK; @@ -1135,38 +1130,29 @@ exit: return hr; } -/*********************************************************************** - * UiaAddEvent (uiautomationcore.@) - */ -HRESULT WINAPI UiaAddEvent(HUIANODE huianode, EVENTID event_id, UiaEventCallback *callback, enum TreeScope scope, - PROPERTYID *prop_ids, int prop_ids_count, struct UiaCacheRequest *cache_req, HUIAEVENT *huiaevent) +static HRESULT uia_clientside_event_callback(struct uia_event *event, struct uia_event_args *args, + SAFEARRAY *cache_req, BSTR tree_struct) { - const struct uia_event_info *event_info = uia_event_info_from_id(event_id); - struct uia_event *event; - SAFEARRAY *sa; - HRESULT hr; + UiaEventCallback *event_callback = (UiaEventCallback *)event->u.clientside.callback_data; - TRACE("(%p, %d, %p, %#x, %p, %d, %p, %p)\n", huianode, event_id, callback, scope, prop_ids, prop_ids_count, - cache_req, huiaevent); - - if (!huianode || !callback || !cache_req || !huiaevent) - return E_INVALIDARG; + event_callback(&args->simple_args, cache_req, tree_struct); - if (!event_info) - WARN("No event information for event ID %d\n", event_id); + return S_OK; +} - *huiaevent = NULL; - if (event_info && (event_info->event_arg_type == EventArgsType_PropertyChanged)) - { - FIXME("Property changed event registration currently unimplemented\n"); - return E_NOTIMPL; - } +static HRESULT uia_add_clientside_event(HUIANODE huianode, EVENTID event_id, enum TreeScope scope, PROPERTYID *prop_ids, + int prop_ids_count, struct UiaCacheRequest *cache_req, SAFEARRAY *rt_id, UiaWineEventCallback *cback, + void *cback_data, HUIAEVENT *huiaevent) +{ + struct uia_event *event; + SAFEARRAY *sa; + HRESULT hr; - hr = UiaGetRuntimeId(huianode, &sa); + hr = SafeArrayCopy(rt_id, &sa); if (FAILED(hr)) return hr; - hr = create_clientside_uia_event(&event, event_id, scope, callback, sa); + hr = create_clientside_uia_event(&event, event_id, scope, cback, cback_data, sa); if (FAILED(hr)) { SafeArrayDestroy(sa); @@ -1198,6 +1184,43 @@ exit: return hr; } +/*********************************************************************** + * UiaAddEvent (uiautomationcore.@) + */ +HRESULT WINAPI UiaAddEvent(HUIANODE huianode, EVENTID event_id, UiaEventCallback *callback, enum TreeScope scope, + PROPERTYID *prop_ids, int prop_ids_count, struct UiaCacheRequest *cache_req, HUIAEVENT *huiaevent) +{ + const struct uia_event_info *event_info = uia_event_info_from_id(event_id); + SAFEARRAY *sa; + HRESULT hr; + + TRACE("(%p, %d, %p, %#x, %p, %d, %p, %p)\n", huianode, event_id, callback, scope, prop_ids, prop_ids_count, + cache_req, huiaevent); + + if (!huianode || !callback || !cache_req || !huiaevent) + return E_INVALIDARG; + + if (!event_info) + WARN("No event information for event ID %d\n", event_id); + + *huiaevent = NULL; + if (event_info && (event_info->event_arg_type == EventArgsType_PropertyChanged)) + { + FIXME("Property changed event registration currently unimplemented\n"); + return E_NOTIMPL; + } + + hr = UiaGetRuntimeId(huianode, &sa); + if (FAILED(hr)) + return hr; + + hr = uia_add_clientside_event(huianode, event_id, scope, prop_ids, prop_ids_count, cache_req, sa, + uia_clientside_event_callback, (void *)callback, huiaevent); + SafeArrayDestroy(sa); + + return hr; +} + /*********************************************************************** * UiaRemoveEvent (uiautomationcore.@) */ @@ -1245,7 +1268,9 @@ static HRESULT uia_event_invoke(HUIANODE node, HUIANODE nav_start_node, struct u &tree_struct); if (SUCCEEDED(hr)) { - event->u.clientside.cback(&args->simple_args, out_req, tree_struct); + hr = event->u.clientside.event_callback(event, args, out_req, tree_struct); + if (FAILED(hr)) + WARN("Event callback failed with hr %#lx\n", hr); SafeArrayDestroy(out_req); SysFreeString(tree_struct); } diff --git a/dlls/uiautomationcore/uia_private.h b/dlls/uiautomationcore/uia_private.h index 11cab86651c..928b36fbae6 100644 --- a/dlls/uiautomationcore/uia_private.h +++ b/dlls/uiautomationcore/uia_private.h @@ -95,6 +95,12 @@ static inline struct uia_provider *impl_from_IWineUiaProvider(IWineUiaProvider * return CONTAINING_RECORD(iface, struct uia_provider, IWineUiaProvider_iface); } +struct uia_event_args +{ + struct UiaEventArgs simple_args; + LONG ref; +}; + enum uia_event_type { EVENT_TYPE_CLIENTSIDE, EVENT_TYPE_SERVERSIDE, @@ -124,7 +130,8 @@ struct uia_event { struct { struct UiaCacheRequest cache_req; - UiaEventCallback *cback; + HRESULT (*event_callback)(struct uia_event *, struct uia_event_args *, SAFEARRAY *, BSTR); + void *callback_data; DWORD git_cookie; } clientside; @@ -137,6 +144,8 @@ struct uia_event } u; }; +typedef HRESULT UiaWineEventCallback(struct uia_event *, struct uia_event_args *, SAFEARRAY *, BSTR); + static inline void variant_init_bool(VARIANT *v, BOOL val) { V_VT(v) = VT_BOOL;
1
0
0
0
Connor McAdams : uiautomationcore: Use the free threaded marshaler to marshal IUIAutomationElement interfaces.
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: wine Branch: master Commit: 7844a544afc349bc53416b43a301baa564ddc638 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7844a544afc349bc53416b43a301ba…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Wed May 24 10:57:02 2023 -0400 uiautomationcore: Use the free threaded marshaler to marshal IUIAutomationElement interfaces. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 79 ++++++++++++++++++++++++++++++ dlls/uiautomationcore/uia_com_client.c | 13 +++++ 2 files changed, 92 insertions(+) diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index 0dd75ce862f..5bd8e52fddb 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -10620,6 +10620,79 @@ static void test_UiaFind(void) CoUninitialize(); } +struct marshal_thread_data { + IUnknown *iface; + const GUID *iface_iid; + BOOL expect_proxy; + const char *file; + int line; + + IStream *marshal_stream; +}; + +static DWORD WINAPI interface_marshal_proxy_thread(LPVOID param) +{ + struct marshal_thread_data *data = (struct marshal_thread_data *)param; + IUnknown *proxy_iface, *unk, *unk2; + HRESULT hr; + + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + + proxy_iface = unk = unk2 = NULL; + hr = CoGetInterfaceAndReleaseStream(data->marshal_stream, data->iface_iid, (void **)&proxy_iface); + ok_(data->file, data->line)(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IUnknown_QueryInterface(data->iface, &IID_IUnknown, (void **)&unk); + ok_(data->file, data->line)(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok_(data->file, data->line)(!!unk, "unk == NULL\n"); + + hr = IUnknown_QueryInterface(proxy_iface, &IID_IUnknown, (void **)&unk2); + ok_(data->file, data->line)(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok_(data->file, data->line)(!!unk2, "unk2 == NULL\n"); + + if (data->expect_proxy) + ok_(data->file, data->line)(unk != unk2, "unk == unk2\n"); + else + ok_(data->file, data->line)(unk == unk2, "unk != unk2\n"); + + IUnknown_Release(proxy_iface); + IUnknown_Release(unk); + IUnknown_Release(unk2); + + CoUninitialize(); + return 0; +} + +#define check_interface_marshal_proxy_creation( iface, iid, expect_proxy ) \ + check_interface_marshal_proxy_creation_( (iface), (iid), (expect_proxy), __FILE__, __LINE__) +static void check_interface_marshal_proxy_creation_(IUnknown *iface, REFIID iid, BOOL expect_proxy, const char *file, + int line) +{ + struct marshal_thread_data data = { NULL, iid, expect_proxy, file, line }; + HANDLE thread; + HRESULT hr; + + hr = IUnknown_QueryInterface(iface, data.iface_iid, (void **)&data.iface); + ok_(file, line)(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = CoMarshalInterThreadInterfaceInStream(data.iface_iid, data.iface, &data.marshal_stream); + ok_(file, line)(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + thread = CreateThread(NULL, 0, interface_marshal_proxy_thread, (void *)&data, 0, NULL); + while (MsgWaitForMultipleObjects(1, &thread, FALSE, INFINITE, QS_ALLINPUT) != WAIT_OBJECT_0) + { + MSG msg; + while(PeekMessageW(&msg, 0, 0, 0, PM_REMOVE)) + { + TranslateMessage(&msg); + DispatchMessageW(&msg); + } + } + CloseHandle(thread); + + IUnknown_Release(data.iface); +} + static HWND create_test_hwnd(const char *class_name) { WNDCLASSA cls = { 0 }; @@ -10717,6 +10790,12 @@ static void test_ElementFromHandle(IUIAutomation *uia_iface, BOOL is_cui8) else ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr); + /* + * The IUIAutomationElement interface uses the free threaded marshaler, so + * no actual proxy interface will be created. + */ + check_interface_marshal_proxy_creation((IUnknown *)element, &IID_IUIAutomationElement, FALSE); + IUIAutomationElement_Release(element); ok(Provider.ref == 1, "Unexpected refcnt %ld\n", Provider.ref); diff --git a/dlls/uiautomationcore/uia_com_client.c b/dlls/uiautomationcore/uia_com_client.c index 75c722771c3..66326ad9574 100644 --- a/dlls/uiautomationcore/uia_com_client.c +++ b/dlls/uiautomationcore/uia_com_client.c @@ -1186,6 +1186,8 @@ struct uia_element { struct uia_cache_property *cached_props; int cached_props_count; + + IUnknown *marshal; }; static inline struct uia_element *impl_from_IUIAutomationElement9(IUIAutomationElement9 *iface) @@ -1203,6 +1205,8 @@ static HRESULT WINAPI uia_element_QueryInterface(IUIAutomationElement9 *iface, R IsEqualIID(riid, &IID_IUIAutomationElement6) || IsEqualIID(riid, &IID_IUIAutomationElement7) || IsEqualIID(riid, &IID_IUIAutomationElement8) || IsEqualIID(riid, &IID_IUIAutomationElement9)))) *ppv = iface; + else if (IsEqualIID(riid, &IID_IMarshal)) + return IUnknown_QueryInterface(element->marshal, riid, ppv); else return E_NOINTERFACE; @@ -1235,6 +1239,7 @@ static ULONG WINAPI uia_element_Release(IUIAutomationElement9 *iface) VariantClear(&element->cached_props[i].prop_val); } + IUnknown_Release(element->marshal); heap_free(element->cached_props); UiaNodeRelease(element->node); heap_free(element); @@ -2484,6 +2489,7 @@ static const IUIAutomationElement9Vtbl uia_element_vtbl = { static HRESULT create_uia_element(IUIAutomationElement **iface, BOOL from_cui8, HUIANODE node) { struct uia_element *element = heap_alloc_zero(sizeof(*element)); + HRESULT hr; *iface = NULL; if (!element) @@ -2494,6 +2500,13 @@ static HRESULT create_uia_element(IUIAutomationElement **iface, BOOL from_cui8, element->from_cui8 = from_cui8; element->node = node; + hr = CoCreateFreeThreadedMarshaler((IUnknown *)&element->IUIAutomationElement9_iface, &element->marshal); + if (FAILED(hr)) + { + heap_free(element); + return hr; + } + *iface = (IUIAutomationElement *)&element->IUIAutomationElement9_iface; return S_OK; }
1
0
0
0
David Kahurani : gdiplus/font: Fix GdipGetLogFontW/A with gdi_transform.
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: wine Branch: master Commit: cfc50b28870ca026c002cbd41780530c9af15753 URL:
https://gitlab.winehq.org/wine/wine/-/commit/cfc50b28870ca026c002cbd4178053…
Author: David Kahurani <k.kahurani(a)gmail.com> Date: Sun Jul 23 10:11:48 2023 +0300 gdiplus/font: Fix GdipGetLogFontW/A with gdi_transform. Signed-off-by: David Kahurani <k.kahurani(a)gmail.com> --- dlls/gdiplus/font.c | 2 ++ dlls/gdiplus/tests/font.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index 8b85f567aab..024d27c1ce7 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -485,6 +485,8 @@ GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics, LOGFONTW pt[1].Y = 0.0; pt[2].X = 0.0; pt[2].Y = 1.0; + + GdipMultiplyMatrix(&matrix, &graphics->gdi_transform, MatrixOrderAppend); GdipTransformMatrixPoints(&matrix, pt, 3); angle = -gdiplus_atan2((pt[1].Y - pt[0].Y), (pt[1].X - pt[0].X)); rel_height = sqrt((pt[2].Y - pt[0].Y) * (pt[2].Y - pt[0].Y)+ diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c index a2aea904bb1..30cf159e140 100644 --- a/dlls/gdiplus/tests/font.c +++ b/dlls/gdiplus/tests/font.c @@ -1239,6 +1239,20 @@ static void test_font_transform(void) todo_wine expectf_(1532.984985, bounds.Height, 0.05); + GdipDeleteGraphics(graphics); + + SetMapMode( hdc, MM_ISOTROPIC); + SetWindowExtEx(hdc, 200, 200, NULL); + SetViewportExtEx(hdc, 100, 100, NULL); + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + status = GdipGetLogFontA(font, graphics, &lf); + expect(Ok, status); + expect(-50, lf.lfHeight); + expect(0, lf.lfWidth); + expect(0, lf.lfEscapement); + expect(0, lf.lfOrientation); + GdipDeleteMatrix(matrix); GdipDeleteFont(font); GdipDeleteGraphics(graphics);
1
0
0
0
Jinoh Kang : xmllite: Eliminate DECLSPEC_HIDDEN.
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: wine Branch: master Commit: 062ef22c45af6e7c27caa26c0f92d7e6366e0be3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/062ef22c45af6e7c27caa26c0f92d7…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Sat Jul 1 16:02:49 2023 +0900 xmllite: Eliminate DECLSPEC_HIDDEN. --- dlls/xmllite/xmllite_private.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/xmllite/xmllite_private.h b/dlls/xmllite/xmllite_private.h index f4e2d92fe26..fc3e6d264e1 100644 --- a/dlls/xmllite/xmllite_private.h +++ b/dlls/xmllite/xmllite_private.h @@ -53,15 +53,15 @@ typedef enum XmlEncoding_Unknown } xml_encoding; -xml_encoding parse_encoding_name(const WCHAR*,int) DECLSPEC_HIDDEN; -HRESULT get_code_page(xml_encoding,UINT*) DECLSPEC_HIDDEN; -const WCHAR *get_encoding_name(xml_encoding) DECLSPEC_HIDDEN; -xml_encoding get_encoding_from_codepage(UINT) DECLSPEC_HIDDEN; +xml_encoding parse_encoding_name(const WCHAR*,int); +HRESULT get_code_page(xml_encoding,UINT*); +const WCHAR *get_encoding_name(xml_encoding); +xml_encoding get_encoding_from_codepage(UINT); -BOOL is_ncnamechar(WCHAR ch) DECLSPEC_HIDDEN; -BOOL is_pubchar(WCHAR ch) DECLSPEC_HIDDEN; -BOOL is_namestartchar(WCHAR ch) DECLSPEC_HIDDEN; -BOOL is_namechar(WCHAR ch) DECLSPEC_HIDDEN; +BOOL is_ncnamechar(WCHAR ch); +BOOL is_pubchar(WCHAR ch); +BOOL is_namestartchar(WCHAR ch); +BOOL is_namechar(WCHAR ch); /* [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] */ static inline BOOL is_char(WCHAR ch)
1
0
0
0
Rémi Bernon : mf/tests: Add missing line end in test message.
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: wine Branch: master Commit: f18516123512be7949e5b7a39f6da8a01ccd120a URL:
https://gitlab.winehq.org/wine/wine/-/commit/f18516123512be7949e5b7a39f6da8…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Jul 5 23:03:10 2023 +0200 mf/tests: Add missing line end in test message. --- dlls/mf/tests/mf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 72170b6be5f..743946f7fba 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -2939,7 +2939,7 @@ static HRESULT WINAPI test_grabber_callback_OnProcessSample(IMFSampleGrabberSink SetEvent(grabber->ready_event); res = WaitForSingleObject(grabber->done_event, 1000); - ok(!res, "WaitForSingleObject returned %#lx", res); + ok(!res, "WaitForSingleObject returned %#lx\n", res); return S_OK; }
1
0
0
0
Rémi Bernon : mf/tests: Shutdown MF if MP4 source isn't supported.
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: wine Branch: master Commit: 495cf276d0788e487ce6f6e069f40068dd0ea409 URL:
https://gitlab.winehq.org/wine/wine/-/commit/495cf276d0788e487ce6f6e069f400…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Jun 28 14:49:34 2023 +0200 mf/tests: Shutdown MF if MP4 source isn't supported. --- dlls/mf/tests/mf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index fa538e8ad9f..72170b6be5f 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -4951,7 +4951,7 @@ static void test_sample_grabber_orientation(GUID subtype) if (!(source = create_media_source(L"test.mp4", L"video/mp4"))) { win_skip("MP4 media source is not supported, skipping tests.\n"); - return; + goto done; } callback = create_test_callback(TRUE); @@ -5064,10 +5064,11 @@ static void test_sample_grabber_orientation(GUID subtype) IMFMediaSession_Release(session); IMFMediaSource_Release(source); + IMFSampleGrabberSinkCallback_Release(&grabber_callback->IMFSampleGrabberSinkCallback_iface); + +done: hr = MFShutdown(); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - - IMFSampleGrabberSinkCallback_Release(&grabber_callback->IMFSampleGrabberSinkCallback_iface); } static void test_quality_manager(void)
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
87
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Results per page:
10
25
50
100
200