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
July
June
May
April
March
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 2016
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 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
430 discussions
Start a n
N
ew thread
Józef Kucia : d3d11: Sanitize buffer view flags.
by Alexandre Julliard
19 Sep '16
19 Sep '16
Module: wine Branch: master Commit: 9c0212267fc587979d5e289667635b5e8a07043f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9c0212267fc587979d5e28966…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Sun Sep 18 16:18:13 2016 +0200 d3d11: Sanitize buffer view flags. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/view.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/dlls/d3d11/view.c b/dlls/d3d11/view.c index 205513d..d670cb2 100644 --- a/dlls/d3d11/view.c +++ b/dlls/d3d11/view.c @@ -2061,6 +2061,16 @@ static const struct ID3D10ShaderResourceView1Vtbl d3d10_shader_resource_view_vtb d3d10_shader_resource_view_GetDesc1, }; +static unsigned int wined3d_view_flags_from_d3d11_bufferex_flags(unsigned int d3d11_flags) +{ + unsigned int wined3d_flags = d3d11_flags & WINED3D_VIEW_BUFFER_RAW; + + if (d3d11_flags != wined3d_flags) + FIXME("Unhandled flags %#x.\n", d3d11_flags & ~wined3d_flags); + + return wined3d_flags; +} + static HRESULT wined3d_shader_resource_view_desc_from_d3d11(struct wined3d_shader_resource_view_desc *wined3d_desc, const D3D11_SHADER_RESOURCE_VIEW_DESC *desc) { @@ -2143,7 +2153,7 @@ static HRESULT wined3d_shader_resource_view_desc_from_d3d11(struct wined3d_shade break; case D3D11_SRV_DIMENSION_BUFFEREX: - wined3d_desc->flags = desc->u.BufferEx.Flags; + wined3d_desc->flags = wined3d_view_flags_from_d3d11_bufferex_flags(desc->u.BufferEx.Flags); wined3d_desc->u.buffer.start_idx = desc->u.BufferEx.FirstElement; wined3d_desc->u.buffer.count = desc->u.BufferEx.NumElements; break; @@ -2381,6 +2391,17 @@ static const struct ID3D11UnorderedAccessViewVtbl d3d11_unordered_access_view_vt d3d11_unordered_access_view_GetDesc, }; +static unsigned int wined3d_view_flags_from_d3d11_buffer_uav_flags(unsigned int d3d11_flags) +{ + unsigned int wined3d_flags = d3d11_flags & (WINED3D_VIEW_BUFFER_RAW + | WINED3D_VIEW_BUFFER_APPEND | WINED3D_VIEW_BUFFER_COUNTER); + + if (d3d11_flags != wined3d_flags) + FIXME("Unhandled flags %#x.\n", d3d11_flags & ~wined3d_flags); + + return wined3d_flags; +} + static HRESULT wined3d_unordered_access_view_desc_from_d3d11(struct wined3d_unordered_access_view_desc *wined3d_desc, const D3D11_UNORDERED_ACCESS_VIEW_DESC *desc) { @@ -2390,7 +2411,7 @@ static HRESULT wined3d_unordered_access_view_desc_from_d3d11(struct wined3d_unor switch (desc->ViewDimension) { case D3D11_UAV_DIMENSION_BUFFER: - wined3d_desc->flags = desc->u.Buffer.Flags; + wined3d_desc->flags = wined3d_view_flags_from_d3d11_buffer_uav_flags(desc->u.Buffer.Flags); wined3d_desc->u.buffer.start_idx = desc->u.Buffer.FirstElement; wined3d_desc->u.buffer.count = desc->u.Buffer.NumElements; break;
1
0
0
0
Michael Stefaniuc : jscript: Use CONTAINING_RECORD() to get from a field to a struct.
by Alexandre Julliard
19 Sep '16
19 Sep '16
Module: wine Branch: master Commit: fc1ae4fc9eb545ab353b6c16529f87b3661820b7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fc1ae4fc9eb545ab353b6c165…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Sep 19 10:14:47 2016 +0200 jscript: Use CONTAINING_RECORD() to get from a field to a struct. Signed-off-by: Michael Stefaniuc <mstefani(a)redhat.de> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/vbarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/jscript/vbarray.c b/dlls/jscript/vbarray.c index 7b9993b..f374fb0 100644 --- a/dlls/jscript/vbarray.c +++ b/dlls/jscript/vbarray.c @@ -36,7 +36,7 @@ static const WCHAR uboundW[] = {'u','b','o','u','n','d',0}; static inline VBArrayInstance *vbarray_from_vdisp(vdisp_t *vdisp) { - return (VBArrayInstance*)vdisp->u.jsdisp; + return CONTAINING_RECORD(vdisp->u.jsdisp, VBArrayInstance, dispex); } static inline VBArrayInstance *vbarray_this(vdisp_t *jsthis)
1
0
0
0
Michael Stefaniuc : mshtml: Avoid casts from COM objects to interfaces.
by Alexandre Julliard
19 Sep '16
19 Sep '16
Module: wine Branch: master Commit: a14674aa36f86804f757168e55b3d25c562527d2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a14674aa36f86804f757168e5…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Sep 16 14:16:46 2016 +0200 mshtml: Avoid casts from COM objects to interfaces. Signed-off-by: Michael Stefaniuc <mstefani(a)redhat.de> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlelemcol.c | 2 +- dlls/mshtml/htmlevent.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlelemcol.c b/dlls/mshtml/htmlelemcol.c index 125819d..8407e02 100644 --- a/dlls/mshtml/htmlelemcol.c +++ b/dlls/mshtml/htmlelemcol.c @@ -400,7 +400,7 @@ static BOOL is_elem_name(HTMLElement *elem, LPCWSTR name) static HRESULT get_item_idx(HTMLElementCollection *This, UINT idx, IDispatch **ret) { if(idx < This->len) { - *ret = (IDispatch*)This->elems[idx]; + *ret = (IDispatch*)&This->elems[idx]->node.event_target.dispex.IDispatchEx_iface; IDispatch_AddRef(*ret); } diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index c2eeb7d..fc5277b 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -1024,7 +1024,7 @@ void call_event_handlers(HTMLDocumentNode *doc, HTMLEventObj *event_obj, EventTa int i; V_VT(&arg) = VT_DISPATCH; - V_DISPATCH(&arg) = (IDispatch*)event_obj; + V_DISPATCH(&arg) = (IDispatch*)&event_obj->dispex.IDispatchEx_iface; i = data->event_table[eid]->handler_cnt; while(i--) {
1
0
0
0
Aric Stewart : ntoskrnl.exe: Send PnP and Power IRPs to plug and play devices.
by Alexandre Julliard
19 Sep '16
19 Sep '16
Module: wine Branch: master Commit: d39d1464f3df755729e30c1883267812bc33adaa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d39d1464f3df755729e30c188…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Thu Sep 15 06:58:21 2016 -0500 ntoskrnl.exe: Send PnP and Power IRPs to plug and play devices. Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/ntoskrnl.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index aebb3de..bc7ac86 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -2927,6 +2927,44 @@ static BOOL get_driver_for_id( const WCHAR *id, WCHAR *driver ) } +static NTSTATUS send_pnp_irp( DEVICE_OBJECT *device, UCHAR minor ) +{ + IO_STACK_LOCATION *irpsp; + IO_STATUS_BLOCK irp_status; + IRP *irp; + + if (!(irp = IoBuildSynchronousFsdRequest( IRP_MJ_PNP, device, NULL, 0, NULL, NULL, &irp_status ))) + return STATUS_NO_MEMORY; + + irpsp = IoGetNextIrpStackLocation( irp ); + irpsp->MinorFunction = minor; + + irpsp->Parameters.StartDevice.AllocatedResources = NULL; + irpsp->Parameters.StartDevice.AllocatedResourcesTranslated = NULL; + + return send_device_irp( device, irp, NULL ); +} + + +static NTSTATUS send_power_irp( DEVICE_OBJECT *device, DEVICE_POWER_STATE power ) +{ + IO_STATUS_BLOCK irp_status; + IO_STACK_LOCATION *irpsp; + IRP *irp; + + if (!(irp = IoBuildSynchronousFsdRequest( IRP_MJ_POWER, device, NULL, 0, NULL, NULL, &irp_status ))) + return STATUS_NO_MEMORY; + + irpsp = IoGetNextIrpStackLocation( irp ); + irpsp->MinorFunction = IRP_MN_SET_POWER; + + irpsp->Parameters.Power.Type = DevicePowerState; + irpsp->Parameters.Power.State.DeviceState = power; + + return send_device_irp( device, irp, NULL ); +} + + static void handle_bus_relations( DEVICE_OBJECT *device ) { static const WCHAR driverW[] = {'\\','D','r','i','v','e','r','\\',0}; @@ -2990,7 +3028,13 @@ static void handle_bus_relations( DEVICE_OBJECT *device ) ObDereferenceObject( driver_obj ); if (status != STATUS_SUCCESS) + { ERR_(plugplay)( "AddDevice failed for driver %s\n", debugstr_w(driver) ); + return; + } + + send_pnp_irp( device, IRP_MN_START_DEVICE ); + send_power_irp( device, PowerDeviceD0 ); }
1
0
0
0
Alexandre Julliard : winex11: Add a debug helper to trace atom names.
by Alexandre Julliard
19 Sep '16
19 Sep '16
Module: wine Branch: master Commit: 49a65a3bd7d05b1102a34c51009fed9d1cd2a46e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=49a65a3bd7d05b1102a34c510…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 19 23:07:04 2016 +0900 winex11: Add a debug helper to trace atom names. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/clipboard.c | 66 +++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 37 deletions(-) diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index aedcd69..ae49f4b 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -296,6 +296,18 @@ static const char *debugstr_format( UINT id ) } } +static const char *debugstr_xatom( Atom atom ) +{ + const char *ret; + char *name; + + if (!atom) return "(None)"; + name = XGetAtomName( thread_display(), atom ); + ret = debugstr_a( name ); + XFree( name ); + return ret; +} + /************************************************************************** * X11DRV_InitClipboard */ @@ -1967,8 +1979,8 @@ static VOID X11DRV_CLIPBOARD_InsertSelectionProperties(Display *display, Atom* p */ while (lpFormat) { - TRACE( "atom #%d property(%ld) -> format %s\n", - i, lpFormat->atom, debugstr_format(lpFormat->id) ); + TRACE( "property %s -> format %s\n", + debugstr_xatom( lpFormat->atom ), debugstr_format( lpFormat->id )); X11DRV_CLIPBOARD_InsertClipboardData( lpFormat->id, 0, lpFormat, FALSE ); lpFormat = X11DRV_CLIPBOARD_LookupProperty(lpFormat, properties[i]); } @@ -2010,8 +2022,8 @@ static VOID X11DRV_CLIPBOARD_InsertSelectionProperties(Display *display, Atom* p ERR("Failed to register %s property. Type will not be cached.\n", names[i]); continue; } - TRACE( "atom #%d property(%ld) -> format %s\n", - i, lpFormat->atom, debugstr_format(lpFormat->id) ); + TRACE( "property %s -> format %s\n", + debugstr_xatom( lpFormat->atom ), debugstr_format( lpFormat->id )); X11DRV_CLIPBOARD_InsertClipboardData( lpFormat->id, 0, lpFormat, FALSE ); } for (i = 0; i < nb_atoms; i++) XFree( names[i] ); @@ -2094,8 +2106,8 @@ static int X11DRV_CLIPBOARD_QueryAvailableData(Display *display) 0, 0x3FFF, True, AnyPropertyType/*XA_ATOM*/, &atype, &aformat, &cSelectionTargets, &remain, (unsigned char**)&targetList)) { - TRACE("Type %lx,Format %d,nItems %ld, Remain %ld\n", - atype, aformat, cSelectionTargets, remain); + TRACE( "type %s format %d count %ld remain %ld\n", + debugstr_xatom( atype ), aformat, cSelectionTargets, remain); /* * The TARGETS property should have returned us a list of atoms * corresponding to each selection target format supported. @@ -2159,8 +2171,8 @@ static BOOL X11DRV_CLIPBOARD_ReadSelectionData(Display *display, LPWINE_CLIPDATA return FALSE; } - TRACE("Requesting conversion of %s property (%ld) from selection type %08x\n", - debugstr_format(lpData->lpFormat->id), lpData->lpFormat->atom, + TRACE("Requesting conversion of %s property %s from selection type %08x\n", + debugstr_format( lpData->lpFormat->id ), debugstr_xatom( lpData->lpFormat->atom ), (UINT)selectionCacheSrc); XConvertSelection(display, selectionCacheSrc, lpData->lpFormat->atom, @@ -2222,7 +2234,7 @@ static BOOL X11DRV_CLIPBOARD_GetProperty(Display *display, Window w, Atom prop, unsigned long pos = 0, nitems, remain, count; unsigned char *val = NULL, *buffer; - TRACE("Reading property %lu from X window %lx\n", prop, w); + TRACE( "Reading property %s from X window %lx\n", debugstr_xatom( prop ), w ); for (;;) { @@ -2763,18 +2775,11 @@ static Atom X11DRV_SelectionRequest_TARGETS( Display *display, Window requestor, LIST_FOR_EACH_ENTRY( format, &format_list, WINE_CLIPFORMAT, entry ) if ((format->id == lpData->wFormatID) && format->lpDrvExportFunc && format->atom) + { + TRACE( "%d: %s -> %s\n", i, debugstr_format( format->id ), + debugstr_xatom( format->atom )); targets[i++] = format->atom; - - if (TRACE_ON(clipboard)) - { - unsigned int i; - for ( i = 0; i < cTargets; i++) - { - char *itemFmtName = XGetAtomName(display, targets[i]); - TRACE("\tAtom# %d: Property %ld Type %s\n", i, targets[i], itemFmtName); - XFree(itemFmtName); - } - } + } /* We may want to consider setting the type to xaTargets instead, * in case some apps expect this instead of XA_ATOM */ @@ -2826,13 +2831,8 @@ static Atom X11DRV_SelectionRequest_MULTIPLE( HWND hWnd, XSelectionRequestEvent &cTargetPropList, &remain, (unsigned char**)&targetPropList)) { - if (TRACE_ON(clipboard)) - { - char * const typeName = XGetAtomName(display, atype); - TRACE("\tType %s,Format %d,nItems %ld, Remain %ld\n", - typeName, aformat, cTargetPropList, remain); - XFree(typeName); - } + TRACE( "type %s format %d count %ld remain %ld\n", + debugstr_xatom( atype ), aformat, cTargetPropList, remain ); /* * Make sure we got what we expect. @@ -2853,16 +2853,8 @@ static Atom X11DRV_SelectionRequest_MULTIPLE( HWND hWnd, XSelectionRequestEvent { XSelectionRequestEvent event; - if (TRACE_ON(clipboard)) - { - char *targetName, *propName; - targetName = XGetAtomName(display, targetPropList[i]); - propName = XGetAtomName(display, targetPropList[i+1]); - TRACE("MULTIPLE(%d): Target='%s' Prop='%s'\n", - i/2, targetName, propName); - XFree(targetName); - XFree(propName); - } + TRACE( "MULTIPLE(%d): target %s property %s\n", + i/2, debugstr_xatom( targetPropList[i] ), debugstr_xatom( targetPropList[i + 1] )); /* We must have a non "None" property to service a MULTIPLE target atom */ if ( !targetPropList[i+1] )
1
0
0
0
Alexandre Julliard : winex11: Use the correct data type for property atoms.
by Alexandre Julliard
19 Sep '16
19 Sep '16
Module: wine Branch: master Commit: 13ff291905941444cc0b3cffd0b57bca9981dff0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=13ff291905941444cc0b3cffd…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 19 22:55:56 2016 +0900 winex11: Use the correct data type for property atoms. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/clipboard.c | 72 ++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index ed304ac..aedcd69 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -108,8 +108,8 @@ typedef HANDLE (*DRVIMPORTFUNC)(Display *d, Window w, Atom prop); typedef struct clipboard_format { struct list entry; - UINT wFormatID; - UINT drvData; + UINT id; + Atom atom; DRVIMPORTFUNC lpDrvImportFunc; DRVEXPORTFUNC lpDrvExportFunc; } WINE_CLIPFORMAT, *LPWINE_CLIPFORMAT; @@ -310,11 +310,11 @@ void X11DRV_InitClipboard(void) for (i = 0; i < count; i++) { if (builtin_formats[i].name) - formats[i].wFormatID = RegisterClipboardFormatW( builtin_formats[i].name ); + formats[i].id = RegisterClipboardFormatW( builtin_formats[i].name ); else - formats[i].wFormatID = builtin_formats[i].id; + formats[i].id = builtin_formats[i].id; - formats[i].drvData = GET_ATOM(builtin_formats[i].data); + formats[i].atom = GET_ATOM(builtin_formats[i].data); formats[i].lpDrvImportFunc = builtin_formats[i].import; formats[i].lpDrvExportFunc = builtin_formats[i].export; list_add_tail( &format_list, &formats[i].entry ); @@ -338,7 +338,7 @@ static void intern_atoms(void) count = 0; LIST_FOR_EACH_ENTRY( format, &format_list, WINE_CLIPFORMAT, entry ) - if (!format->drvData) count++; + if (!format->atom) count++; if (!count) return; display = thread_init_display(); @@ -348,8 +348,8 @@ static void intern_atoms(void) i = 0; LIST_FOR_EACH_ENTRY( format, &format_list, WINE_CLIPFORMAT, entry ) - if (!format->drvData) { - if (GetClipboardFormatNameW(format->wFormatID, buffer, 256) > 0) + if (!format->atom) { + if (GetClipboardFormatNameW( format->id, buffer, 256 ) > 0) { /* use defined format name */ len = WideCharToMultiByte(CP_UNIXCP, 0, buffer, -1, NULL, 0, NULL, NULL); @@ -360,7 +360,7 @@ static void intern_atoms(void) * which is normally used by GetClipboardFormatNameW */ static const WCHAR fmt[] = {'#','%','u',0}; - len = sprintfW(buffer, fmt, format->wFormatID) + 1; + len = sprintfW(buffer, fmt, format->id) + 1; } names[i] = HeapAlloc(GetProcessHeap(), 0, len); WideCharToMultiByte(CP_UNIXCP, 0, buffer, -1, names[i++], len, NULL, NULL); @@ -370,9 +370,9 @@ static void intern_atoms(void) i = 0; LIST_FOR_EACH_ENTRY( format, &format_list, WINE_CLIPFORMAT, entry ) - if (!format->drvData) { + if (!format->atom) { HeapFree(GetProcessHeap(), 0, names[i]); - format->drvData = atoms[i++]; + format->atom = atoms[i++]; } HeapFree( GetProcessHeap(), 0, names ); @@ -391,16 +391,16 @@ static struct clipboard_format *register_format( UINT id, Atom prop ) /* walk format chain to see if it's already registered */ LIST_FOR_EACH_ENTRY( format, &format_list, struct clipboard_format, entry ) - if (format->wFormatID == id) return format; + if (format->id == id) return format; if (!(format = HeapAlloc( GetProcessHeap(), 0, sizeof(*format) ))) return NULL; - format->wFormatID = id; - format->drvData = prop; + format->id = id; + format->atom = prop; format->lpDrvImportFunc = import_data; format->lpDrvExportFunc = export_data; list_add_tail( &format_list, &format->entry ); - TRACE( "Registering format %s atom %lx\n", debugstr_format(id), prop ); + TRACE( "Registering format %s atom %ld\n", debugstr_format(id), prop ); return format; } @@ -408,7 +408,7 @@ static struct clipboard_format *register_format( UINT id, Atom prop ) /************************************************************************** * X11DRV_CLIPBOARD_LookupProperty */ -static LPWINE_CLIPFORMAT X11DRV_CLIPBOARD_LookupProperty(LPWINE_CLIPFORMAT current, UINT drvData) +static struct clipboard_format *X11DRV_CLIPBOARD_LookupProperty( struct clipboard_format *current, Atom prop ) { for (;;) { @@ -417,9 +417,9 @@ static LPWINE_CLIPFORMAT X11DRV_CLIPBOARD_LookupProperty(LPWINE_CLIPFORMAT curre while ((ptr = list_next( &format_list, ptr ))) { - LPWINE_CLIPFORMAT lpFormat = LIST_ENTRY( ptr, WINE_CLIPFORMAT, entry ); - if (lpFormat->drvData == drvData) return lpFormat; - if (!lpFormat->drvData) need_intern = TRUE; + struct clipboard_format *format = LIST_ENTRY( ptr, struct clipboard_format, entry ); + if (format->atom == prop) return format; + if (!format->atom) need_intern = TRUE; } if (!need_intern) return NULL; intern_atoms(); @@ -1319,7 +1319,7 @@ HANDLE X11DRV_CLIPBOARD_ImportSelection(Display *d, Atom target, Window w, Atom clipFormat = X11DRV_CLIPBOARD_LookupProperty(NULL, target); if (clipFormat) { - *windowsFormat = clipFormat->wFormatID; + *windowsFormat = clipFormat->id; return clipFormat->lpDrvImportFunc(d, w, prop); } return NULL; @@ -1967,9 +1967,9 @@ static VOID X11DRV_CLIPBOARD_InsertSelectionProperties(Display *display, Atom* p */ while (lpFormat) { - TRACE("Atom#%d Property(%d): --> Format %s\n", - i, lpFormat->drvData, debugstr_format(lpFormat->wFormatID)); - X11DRV_CLIPBOARD_InsertClipboardData(lpFormat->wFormatID, 0, lpFormat, FALSE); + TRACE( "atom #%d property(%ld) -> format %s\n", + i, lpFormat->atom, debugstr_format(lpFormat->id) ); + X11DRV_CLIPBOARD_InsertClipboardData( lpFormat->id, 0, lpFormat, FALSE ); lpFormat = X11DRV_CLIPBOARD_LookupProperty(lpFormat, properties[i]); } } @@ -2010,9 +2010,9 @@ static VOID X11DRV_CLIPBOARD_InsertSelectionProperties(Display *display, Atom* p ERR("Failed to register %s property. Type will not be cached.\n", names[i]); continue; } - TRACE("Atom#%d Property(%d): --> Format %s\n", - i, lpFormat->drvData, debugstr_format(lpFormat->wFormatID)); - X11DRV_CLIPBOARD_InsertClipboardData(lpFormat->wFormatID, 0, lpFormat, FALSE); + TRACE( "atom #%d property(%ld) -> format %s\n", + i, lpFormat->atom, debugstr_format(lpFormat->id) ); + X11DRV_CLIPBOARD_InsertClipboardData( lpFormat->id, 0, lpFormat, FALSE ); } for (i = 0; i < nb_atoms; i++) XFree( names[i] ); HeapFree( GetProcessHeap(), 0, names ); @@ -2159,11 +2159,11 @@ static BOOL X11DRV_CLIPBOARD_ReadSelectionData(Display *display, LPWINE_CLIPDATA return FALSE; } - TRACE("Requesting conversion of %s property (%d) from selection type %08x\n", - debugstr_format(lpData->lpFormat->wFormatID), lpData->lpFormat->drvData, + TRACE("Requesting conversion of %s property (%ld) from selection type %08x\n", + debugstr_format(lpData->lpFormat->id), lpData->lpFormat->atom, (UINT)selectionCacheSrc); - XConvertSelection(display, selectionCacheSrc, lpData->lpFormat->drvData, + XConvertSelection(display, selectionCacheSrc, lpData->lpFormat->atom, x11drv_atom(SELECTION_DATA), w, CurrentTime); /* wait until SelectionNotify is received */ @@ -2745,8 +2745,8 @@ static Atom X11DRV_SelectionRequest_TARGETS( Display *display, Window requestor, LIST_FOR_EACH_ENTRY( lpData, &data_list, WINE_CLIPDATA, entry ) LIST_FOR_EACH_ENTRY( format, &format_list, WINE_CLIPFORMAT, entry ) - if ((format->wFormatID == lpData->wFormatID) && - format->lpDrvExportFunc && format->drvData) + if ((format->id == lpData->wFormatID) && + format->lpDrvExportFunc && format->atom) cTargets++; TRACE(" found %d formats\n", cTargets); @@ -2761,9 +2761,9 @@ static Atom X11DRV_SelectionRequest_TARGETS( Display *display, Window requestor, LIST_FOR_EACH_ENTRY( lpData, &data_list, WINE_CLIPDATA, entry ) LIST_FOR_EACH_ENTRY( format, &format_list, WINE_CLIPFORMAT, entry ) - if ((format->wFormatID == lpData->wFormatID) && - format->lpDrvExportFunc && format->drvData) - targets[i++] = format->drvData; + if ((format->id == lpData->wFormatID) && + format->lpDrvExportFunc && format->atom) + targets[i++] = format->atom; if (TRACE_ON(clipboard)) { @@ -2947,7 +2947,7 @@ static void X11DRV_HandleSelectionRequest( HWND hWnd, XSelectionRequestEvent *ev if (lpFormat && lpFormat->lpDrvExportFunc) { - LPWINE_CLIPDATA lpData = X11DRV_CLIPBOARD_LookupData(lpFormat->wFormatID); + LPWINE_CLIPDATA lpData = X11DRV_CLIPBOARD_LookupData(lpFormat->id); if (lpData) { @@ -2961,7 +2961,7 @@ static void X11DRV_HandleSelectionRequest( HWND hWnd, XSelectionRequestEvent *ev int mode = PropModeReplace; TRACE("\tUpdating property %s, %d bytes\n", - debugstr_format(lpFormat->wFormatID), cBytes); + debugstr_format(lpFormat->id), cBytes); do { int nelements = min(cBytes, 65536);
1
0
0
0
Alexandre Julliard : winex11: Add separate export functions for the various string types.
by Alexandre Julliard
19 Sep '16
19 Sep '16
Module: wine Branch: master Commit: 63201471abd732cc7461d11e954cf6eae87a0b05 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=63201471abd732cc7461d11e9…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Sep 17 11:10:31 2016 +0900 winex11: Add separate export functions for the various string types. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/clipboard.c | 60 ++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 39 deletions(-) diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 190935c..ed304ac 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -140,6 +140,10 @@ static HANDLE export_data(Display *display, Window requestor, Atom aTarget, Atom rprop, LPWINE_CLIPDATA lpData, LPDWORD lpBytes); static HANDLE export_string(Display *display, Window requestor, Atom aTarget, Atom rprop, LPWINE_CLIPDATA lpData, LPDWORD lpBytes); +static HANDLE export_utf8_string(Display *display, Window requestor, Atom aTarget, + Atom rprop, LPWINE_CLIPDATA lpData, LPDWORD lpBytes); +static HANDLE export_compound_text(Display *display, Window requestor, Atom aTarget, + Atom rprop, LPWINE_CLIPDATA lpData, LPDWORD lpBytes); static HANDLE export_pixmap(Display *display, Window requestor, Atom aTarget, Atom rprop, LPWINE_CLIPDATA lpdata, LPDWORD lpBytes); static HANDLE export_image_bmp(Display *display, Window requestor, Atom aTarget, @@ -192,8 +196,8 @@ static const struct { 0, CF_PENDATA, XATOM_WCF_PENDATA, import_data, export_data }, { 0, CF_RIFF, XATOM_WCF_RIFF, import_data, export_data }, { 0, CF_WAVE, XATOM_WCF_WAVE, import_data, export_data }, - { 0, CF_UNICODETEXT, XATOM_UTF8_STRING, import_utf8_string, export_string }, - { 0, CF_UNICODETEXT, XATOM_COMPOUND_TEXT, import_compound_text, export_string }, + { 0, CF_UNICODETEXT, XATOM_UTF8_STRING, import_utf8_string, export_utf8_string }, + { 0, CF_UNICODETEXT, XATOM_COMPOUND_TEXT, import_compound_text, export_compound_text }, { 0, CF_ENHMETAFILE, XATOM_WCF_ENHMETAFILE, import_enhmetafile, export_enhmetafile }, { 0, CF_HDROP, XATOM_text_uri_list, import_text_uri_list, export_hdrop }, { 0, CF_LOCALE, XATOM_WCF_LOCALE, import_data, export_data }, @@ -1365,17 +1369,19 @@ static HANDLE export_data(Display *display, Window requestor, Atom aTarget, /************************************************************************** - * X11DRV_CLIPBOARD_ExportXAString + * export_string * * Export CF_TEXT converting the string to XA_STRING. - * Helper function for export_string. */ -static HANDLE X11DRV_CLIPBOARD_ExportXAString(LPWINE_CLIPDATA lpData, LPDWORD lpBytes) +static HANDLE export_string(Display *display, Window requestor, Atom aTarget, Atom rprop, + LPWINE_CLIPDATA lpData, LPDWORD lpBytes) { UINT i, j; UINT size; LPSTR text, lpstr = NULL; + if (!X11DRV_CLIPBOARD_RenderFormat(display, lpData)) return 0; + *lpBytes = 0; /* Assume return has zero bytes */ text = GlobalLock(lpData->hData); @@ -1404,18 +1410,20 @@ done: /************************************************************************** - * X11DRV_CLIPBOARD_ExportUTF8String + * export_utf8_string * * Export CF_UNICODE converting the string to UTF8. - * Helper function for export_string. */ -static HANDLE X11DRV_CLIPBOARD_ExportUTF8String(LPWINE_CLIPDATA lpData, LPDWORD lpBytes) +static HANDLE export_utf8_string(Display *display, Window requestor, Atom aTarget, Atom rprop, + LPWINE_CLIPDATA lpData, LPDWORD lpBytes) { UINT i, j; UINT size; LPWSTR uni_text; LPSTR text, lpstr = NULL; + if (!X11DRV_CLIPBOARD_RenderFormat(display, lpData)) return 0; + *lpBytes = 0; /* Assume return has zero bytes */ uni_text = GlobalLock(lpData->hData); @@ -1452,13 +1460,12 @@ done: /************************************************************************** - * X11DRV_CLIPBOARD_ExportCompoundText + * export_compound_text * * Export CF_UNICODE to COMPOUND_TEXT - * Helper function for export_string. */ -static HANDLE X11DRV_CLIPBOARD_ExportCompoundText(Display *display, Window requestor, Atom aTarget, Atom rprop, - LPWINE_CLIPDATA lpData, LPDWORD lpBytes) +static HANDLE export_compound_text(Display *display, Window requestor, Atom aTarget, Atom rprop, + LPWINE_CLIPDATA lpData, LPDWORD lpBytes) { char* lpstr = 0; XTextProperty prop; @@ -1467,6 +1474,8 @@ static HANDLE X11DRV_CLIPBOARD_ExportCompoundText(Display *display, Window reque UINT size; LPWSTR uni_text; + if (!X11DRV_CLIPBOARD_RenderFormat(display, lpData)) return 0; + uni_text = GlobalLock(lpData->hData); size = WideCharToMultiByte(CP_UNIXCP, 0, uni_text, -1, NULL, 0, NULL, NULL); @@ -1504,33 +1513,6 @@ static HANDLE X11DRV_CLIPBOARD_ExportCompoundText(Display *display, Window reque return 0; } -/************************************************************************** - * export_string - * - * Export string - */ -static HANDLE export_string(Display *display, Window requestor, Atom aTarget, Atom rprop, - LPWINE_CLIPDATA lpData, LPDWORD lpBytes) -{ - if (X11DRV_CLIPBOARD_RenderFormat(display, lpData)) - { - if (aTarget == XA_STRING) - return X11DRV_CLIPBOARD_ExportXAString(lpData, lpBytes); - else if (aTarget == x11drv_atom(COMPOUND_TEXT) || aTarget == x11drv_atom(TEXT)) - return X11DRV_CLIPBOARD_ExportCompoundText(display, requestor, aTarget, - rprop, lpData, lpBytes); - else - { - TRACE("Exporting target %ld to default UTF8_STRING\n", aTarget); - return X11DRV_CLIPBOARD_ExportUTF8String(lpData, lpBytes); - } - } - else - ERR("Failed to render %04x format\n", lpData->wFormatID); - - return 0; -} - /************************************************************************** * export_pixmap
1
0
0
0
Vincent Povirk : gdiplus/tests: Check record types in playback tests.
by Alexandre Julliard
19 Sep '16
19 Sep '16
Module: wine Branch: master Commit: 8b7520ce6d7cae18c2c24920992e0d199e933660 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8b7520ce6d7cae18c2c249209…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Fri Sep 16 14:37:30 2016 -0500 gdiplus/tests: Check record types in playback tests. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/tests/metafile.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/tests/metafile.c b/dlls/gdiplus/tests/metafile.c index 60890d9..7251ff3 100644 --- a/dlls/gdiplus/tests/metafile.c +++ b/dlls/gdiplus/tests/metafile.c @@ -211,12 +211,16 @@ static BOOL CALLBACK play_metafile_proc(EmfPlusRecordType record_type, unsigned { todo_wine_if (state->expected[state->count].playback_todo) ok(stat == Ok, "%s.%i: GdipPlayMetafileRecord failed with stat %i\n", state->desc, state->count, stat); + todo_wine_if (state->expected[state->count].todo) + ok(state->expected[state->count].record_type == record_type, + "%s.%i: expected record type 0x%x, got 0x%x\n", state->desc, state->count, + state->expected[state->count].record_type, record_type); state->count++; } else { todo_wine_if (state->expected[state->count].playback_todo) - ok(0, "%s: too many records\n", state->desc); + ok(0, "%s: unexpected record 0x%x\n", state->desc, record_type); return FALSE; }
1
0
0
0
Vincent Povirk : gdiplus: Implement BeginContainer metafile record.
by Alexandre Julliard
19 Sep '16
19 Sep '16
Module: wine Branch: master Commit: 410163a9f2b03fcc16e8e65975647492ac5b938e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=410163a9f2b03fcc16e8e6597…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Fri Sep 16 14:37:29 2016 -0500 gdiplus: Implement BeginContainer metafile record. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/gdiplus_private.h | 2 + dlls/gdiplus/graphics.c | 2 +- dlls/gdiplus/metafile.c | 89 ++++++++++++++++++++++++++++++++++++++++++ dlls/gdiplus/tests/metafile.c | 44 +++++++++++++++++++++ 4 files changed, 136 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 216dd4a..86a29a0 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -101,6 +101,8 @@ extern GpStatus METAFILE_MultiplyWorldTransform(GpMetafile* metafile, GDIPCONST extern GpStatus METAFILE_RotateWorldTransform(GpMetafile* metafile, REAL angle, MatrixOrder order) DECLSPEC_HIDDEN; extern GpStatus METAFILE_TranslateWorldTransform(GpMetafile* metafile, REAL dx, REAL dy, MatrixOrder order) DECLSPEC_HIDDEN; extern GpStatus METAFILE_ResetWorldTransform(GpMetafile* metafile) DECLSPEC_HIDDEN; +extern GpStatus METAFILE_BeginContainer(GpMetafile* metafile, GDIPCONST GpRectF *dstrect, + GDIPCONST GpRectF *srcrect, GpUnit unit, DWORD StackIndex) DECLSPEC_HIDDEN; extern GpStatus METAFILE_BeginContainerNoParams(GpMetafile* metafile, DWORD StackIndex) DECLSPEC_HIDDEN; extern GpStatus METAFILE_EndContainer(GpMetafile* metafile, DWORD StackIndex) DECLSPEC_HIDDEN; extern GpStatus METAFILE_SaveGraphics(GpMetafile* metafile, DWORD StackIndex) DECLSPEC_HIDDEN; diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 06a0c95..4ae1f48 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -5236,7 +5236,7 @@ GpStatus WINGDIPAPI GdipBeginContainer(GpGraphics *graphics, GDIPCONST GpRectF * GdipMultiplyMatrix(&graphics->worldtrans, &transform, MatrixOrderPrepend); if (graphics->image && graphics->image->type == ImageTypeMetafile) { - FIXME("Write to metafile\n"); + METAFILE_BeginContainer((GpMetafile*)graphics->image, dstrect, srcrect, unit, container->contid); } return Ok; diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c index c0e799c..9de584c 100644 --- a/dlls/gdiplus/metafile.c +++ b/dlls/gdiplus/metafile.c @@ -122,6 +122,14 @@ typedef struct EmfPlusTranslateWorldTransform REAL dy; } EmfPlusTranslateWorldTransform; +typedef struct EmfPlusBeginContainer +{ + EmfPlusRecordHeader Header; + GpRectF DestRect; + GpRectF SrcRect; + DWORD StackIndex; +} EmfPlusBeginContainer; + typedef struct EmfPlusContainerRecord { EmfPlusRecordHeader Header; @@ -782,6 +790,30 @@ GpStatus METAFILE_ResetWorldTransform(GpMetafile* metafile) return Ok; } +GpStatus METAFILE_BeginContainer(GpMetafile* metafile, GDIPCONST GpRectF *dstrect, + GDIPCONST GpRectF *srcrect, GpUnit unit, DWORD StackIndex) +{ + if (metafile->metafile_type == MetafileTypeEmfPlusOnly || metafile->metafile_type == MetafileTypeEmfPlusDual) + { + EmfPlusBeginContainer *record; + GpStatus stat; + + stat = METAFILE_AllocateRecord(metafile, sizeof(*record), (void**)&record); + if (stat != Ok) + return stat; + + record->Header.Type = EmfPlusRecordTypeBeginContainer; + record->Header.Flags = unit & 0xff; + record->DestRect = *dstrect; + record->SrcRect = *srcrect; + record->StackIndex = StackIndex; + + METAFILE_WriteRecords(metafile); + } + + return Ok; +} + GpStatus METAFILE_BeginContainerNoParams(GpMetafile* metafile, DWORD StackIndex) { if (metafile->metafile_type == MetafileTypeEmfPlusOnly || metafile->metafile_type == MetafileTypeEmfPlusDual) @@ -1309,6 +1341,63 @@ GpStatus WINGDIPAPI GdipPlayMetafileRecord(GDIPCONST GpMetafile *metafile, return METAFILE_PlaybackUpdateWorldTransform(real_metafile); } + case EmfPlusRecordTypeBeginContainer: + { + EmfPlusBeginContainer *record = (EmfPlusBeginContainer*)header; + container* cont; + GpUnit unit; + REAL scale_x, scale_y; + GpRectF scaled_srcrect; + GpMatrix transform; + + cont = heap_alloc_zero(sizeof(*cont)); + if (!cont) + return OutOfMemory; + + stat = GdipCloneRegion(metafile->clip, &cont->clip); + if (stat != Ok) + { + heap_free(cont); + return stat; + } + + GdipBeginContainer2(metafile->playback_graphics, &cont->state); + + if (stat != Ok) + { + GdipDeleteRegion(cont->clip); + heap_free(cont); + return stat; + } + + cont->id = record->StackIndex; + cont->type = BEGIN_CONTAINER; + cont->world_transform = *metafile->world_transform; + cont->page_unit = metafile->page_unit; + cont->page_scale = metafile->page_scale; + list_add_head(&real_metafile->containers, &cont->entry); + + unit = record->Header.Flags & 0xff; + + scale_x = units_to_pixels(1.0, unit, metafile->image.xres); + scale_y = units_to_pixels(1.0, unit, metafile->image.yres); + + scaled_srcrect.X = scale_x * record->SrcRect.X; + scaled_srcrect.Y = scale_y * record->SrcRect.Y; + scaled_srcrect.Width = scale_x * record->SrcRect.Width; + scaled_srcrect.Height = scale_y * record->SrcRect.Height; + + transform.matrix[0] = record->DestRect.Width / scaled_srcrect.Width; + transform.matrix[1] = 0.0; + transform.matrix[2] = 0.0; + transform.matrix[3] = record->DestRect.Height / scaled_srcrect.Height; + transform.matrix[4] = record->DestRect.X - scaled_srcrect.X; + transform.matrix[5] = record->DestRect.Y - scaled_srcrect.Y; + + GdipMultiplyMatrix(real_metafile->world_transform, &transform, MatrixOrderPrepend); + + return METAFILE_PlaybackUpdateWorldTransform(real_metafile); + } case EmfPlusRecordTypeBeginContainerNoParams: case EmfPlusRecordTypeSave: { diff --git a/dlls/gdiplus/tests/metafile.c b/dlls/gdiplus/tests/metafile.c index 6a21afa..60890d9 100644 --- a/dlls/gdiplus/tests/metafile.c +++ b/dlls/gdiplus/tests/metafile.c @@ -1846,6 +1846,9 @@ static const emfplus_record container_records[] = { {0, EmfPlusRecordTypeBeginContainerNoParams}, {0, EmfPlusRecordTypeEndContainer}, {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeBeginContainer}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeEndContainer}, {0, EmfPlusRecordTypeBeginContainerNoParams}, {0, EmfPlusRecordTypeEndOfFile}, {0, EMR_EOF}, @@ -1865,6 +1868,8 @@ static void test_containers(void) static const GpPointF dst_points[3] = {{0.0,0.0},{100.0,0.0},{0.0,100.0}}; static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; GraphicsContainer state1, state2; + GpRectF srcrect, dstrect; + REAL dpix, dpiy; hdc = CreateCompatibleDC(0); @@ -1938,6 +1943,41 @@ static void test_containers(void) stat = GdipFillRectangle(graphics, brush, 20.0, 20.0, 5.0, 5.0); expect(Ok, stat); + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + /* With transform applied */ + stat = GdipGetDpiX(graphics, &dpix); + expect(Ok, stat); + + stat = GdipGetDpiY(graphics, &dpiy); + expect(Ok, stat); + + srcrect.X = 0.0; + srcrect.Y = 0.0; + srcrect.Width = 1.0; + srcrect.Height = 1.0; + + dstrect.X = 25.0; + dstrect.Y = 0.0; + dstrect.Width = 5.0; + dstrect.Height = 5.0; + + stat = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitInch, &state1); + expect(Ok, stat); + + stat = GdipCreateSolidFill((ARGB)0xff00ffff, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangle(graphics, brush, 0.0, 0.0, dpix, dpiy); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + stat = GdipEndContainer(graphics, state1); + expect(Ok, stat); + /* Restoring an invalid state seems to break the graphics object? */ if (0) { stat = GdipEndContainer(graphics, state1); @@ -1979,6 +2019,10 @@ static void test_containers(void) expect(Ok, stat); expect(0xff00ff00, color); + stat = GdipBitmapGetPixel(bitmap, 55, 5, &color); + expect(Ok, stat); + expect(0xff00ffff, color); + stat = GdipDeleteGraphics(graphics); expect(Ok, stat);
1
0
0
0
Vincent Povirk : gdiplus/tests: Add tests for GdipBeginContainer.
by Alexandre Julliard
19 Sep '16
19 Sep '16
Module: wine Branch: master Commit: 18964c9665164c958b7f63012408f519f7010a8d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=18964c9665164c958b7f63012…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Fri Sep 16 14:37:28 2016 -0500 gdiplus/tests: Add tests for GdipBeginContainer. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/tests/graphics.c | 173 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index f747a2d..d86f49d 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -5897,6 +5897,178 @@ static void test_GdipGetVisibleClipBounds_memoryDC(void) ReleaseDC(hwnd, dc); } +static void test_container_rects(void) +{ + GpStatus status; + GpGraphics *graphics; + HDC hdc = GetDC( hwnd ); + GpRectF dstrect, srcrect; + GraphicsContainer state; + static const GpPointF test_points[3] = {{0.0,0.0}, {1.0,0.0}, {0.0,1.0}}; + GpPointF points[3]; + REAL dpix, dpiy; + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + + dstrect.X = 0.0; + dstrect.Y = 0.0; + dstrect.Width = 1.0; + dstrect.Height = 1.0; + srcrect = dstrect; + + status = GdipGetDpiX(graphics, &dpix); + expect(Ok, status); + + status = GdipGetDpiY(graphics, &dpiy); + expect(Ok, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitWorld, &state); + expect(InvalidParameter, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitDisplay, &state); + expect(InvalidParameter, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitMillimeter+1, &state); + expect(InvalidParameter, status); + + status = GdipBeginContainer(NULL, &dstrect, &srcrect, UnitPixel, &state); + expect(InvalidParameter, status); + + status = GdipBeginContainer(graphics, NULL, &srcrect, UnitPixel, &state); + expect(InvalidParameter, status); + + status = GdipBeginContainer(graphics, &dstrect, NULL, UnitPixel, &state); + expect(InvalidParameter, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, -1, &state); + expect(InvalidParameter, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitPixel, NULL); + expect(InvalidParameter, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitPixel, &state); + expect(Ok, status); + + memcpy(points, test_points, sizeof(points)); + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, points, 3); + expect(Ok, status); + expectf(0.0, points[0].X); + expectf(0.0, points[0].Y); + expectf(1.0, points[1].X); + expectf(0.0, points[1].Y); + expectf(0.0, points[2].X); + expectf(1.0, points[2].Y); + + status = GdipEndContainer(graphics, state); + expect(Ok, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitInch, &state); + expect(Ok, status); + + memcpy(points, test_points, sizeof(points)); + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, points, 3); + expect(Ok, status); + expectf(0.0, points[0].X); + expectf(0.0, points[0].Y); + expectf(1.0/dpix, points[1].X); + expectf(0.0, points[1].Y); + expectf(0.0, points[2].X); + expectf(1.0/dpiy, points[2].Y); + + status = GdipEndContainer(graphics, state); + expect(Ok, status); + + status = GdipScaleWorldTransform(graphics, 2.0, 2.0, MatrixOrderPrepend); + expect(Ok, status); + + dstrect.X = 1.0; + dstrect.Height = 3.0; + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitPixel, &state); + expect(Ok, status); + + memcpy(points, test_points, sizeof(points)); + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, points, 3); + expect(Ok, status); + expectf(2.0, points[0].X); + expectf(0.0, points[0].Y); + expectf(4.0, points[1].X); + expectf(0.0, points[1].Y); + expectf(2.0, points[2].X); + expectf(6.0, points[2].Y); + + status = GdipEndContainer(graphics, state); + expect(Ok, status); + + memcpy(points, test_points, sizeof(points)); + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, points, 3); + expect(Ok, status); + expectf(0.0, points[0].X); + expectf(0.0, points[0].Y); + expectf(2.0, points[1].X); + expectf(0.0, points[1].Y); + expectf(0.0, points[2].X); + expectf(2.0, points[2].Y); + + status = GdipResetWorldTransform(graphics); + expect(Ok, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitInch, &state); + expect(Ok, status); + + memcpy(points, test_points, sizeof(points)); + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, points, 3); + expect(Ok, status); + expectf(1.0, points[0].X); + expectf(0.0, points[0].Y); + expectf((dpix+1.0)/dpix, points[1].X); + expectf(0.0, points[1].Y); + expectf(1.0, points[2].X); + expectf(3.0/dpiy, points[2].Y); + + status = GdipEndContainer(graphics, state); + expect(Ok, status); + + status = GdipSetPageUnit(graphics, UnitInch); + expect(Ok, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitPixel, &state); + expect(Ok, status); + + memcpy(points, test_points, sizeof(points)); + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, points, 3); + expect(Ok, status); + expectf(dpix, points[0].X); + expectf(0.0, points[0].Y); + expectf(dpix*2, points[1].X); + expectf(0.0, points[1].Y); + expectf(dpix, points[2].X); + expectf(dpiy*3, points[2].Y); + + status = GdipEndContainer(graphics, state); + expect(Ok, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitInch, &state); + expect(Ok, status); + + memcpy(points, test_points, sizeof(points)); + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, points, 3); + expect(Ok, status); + expectf(dpix, points[0].X); + expectf(0.0, points[0].Y); + expectf(dpix+1.0, points[1].X); + expectf(0.0, points[1].Y); + expectf(dpix, points[2].X); + expectf(3.0, points[2].Y); + + status = GdipEndContainer(graphics, state); + expect(Ok, status); + + GdipDeleteGraphics(graphics); + + ReleaseDC(hwnd, hdc); +} + START_TEST(graphics) { struct GdiplusStartupInput gdiplusStartupInput; @@ -5970,6 +6142,7 @@ START_TEST(graphics) test_bitmapfromgraphics(); test_GdipFillRectangles(); test_GdipGetVisibleClipBounds_memoryDC(); + test_container_rects(); GdiplusShutdown(gdiplusToken); DestroyWindow( hwnd );
1
0
0
0
← Newer
1
...
14
15
16
17
18
19
20
...
43
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
Results per page:
10
25
50
100
200