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
April 2012
----- 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
718 discussions
Start a n
N
ew thread
Christian Costa : amstream: Add stubbed implementation of AudioStreamSample .
by Alexandre Julliard
26 Apr '12
26 Apr '12
Module: wine Branch: master Commit: 5c09a11e084aa90d10d3fc6da054775c7e73b3da URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5c09a11e084aa90d10d3fc6da…
Author: Christian Costa <titan.costa(a)gmail.com> Date: Thu Apr 26 07:58:14 2012 +0200 amstream: Add stubbed implementation of AudioStreamSample. --- dlls/amstream/mediastream.c | 150 +++++++++++++++++++++++++++++++++++++++- dlls/amstream/tests/amstream.c | 4 +- 2 files changed, 150 insertions(+), 4 deletions(-) diff --git a/dlls/amstream/mediastream.c b/dlls/amstream/mediastream.c index 896d316..2aeaaa4 100644 --- a/dlls/amstream/mediastream.c +++ b/dlls/amstream/mediastream.c @@ -33,6 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(amstream); static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectDrawStreamSample **ddraw_stream_sample); +static HRESULT audiostreamsample_create(IAudioMediaStream *parent, IAudioData *audio_data, IAudioStreamSample **audio_stream_sample); typedef struct { IDirectDrawMediaStream IDirectDrawMediaStream_iface; @@ -407,9 +408,12 @@ static HRESULT WINAPI IAudioMediaStreamImpl_CreateSample(IAudioMediaStream *ifac { IAudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); - FIXME("(%p/%p)->(%p,%u,%p) stub!\n", iface, This, audio_data, flags, sample); + TRACE("(%p/%p)->(%p,%u,%p)\n", iface, This, audio_data, flags, sample); - return E_NOTIMPL; + if (!audio_data) + return E_POINTER; + + return audiostreamsample_create(iface, audio_data, sample); } static const struct IAudioMediaStreamVtbl AudioMediaStream_Vtbl = @@ -605,3 +609,145 @@ static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectD return S_OK; } + +typedef struct { + IAudioStreamSample IAudioStreamSample_iface; + LONG ref; + IMediaStream *parent; + IAudioData *audio_data; +} IAudioStreamSampleImpl; + +static inline IAudioStreamSampleImpl *impl_from_IAudioStreamSample(IAudioStreamSample *iface) +{ + return CONTAINING_RECORD(iface, IAudioStreamSampleImpl, IAudioStreamSample_iface); +} + +/*** IUnknown methods ***/ +static HRESULT WINAPI IAudioStreamSampleImpl_QueryInterface(IAudioStreamSample *iface, + REFIID riid, void **ret_iface) +{ + TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid(riid), ret_iface); + + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IStreamSample) || + IsEqualGUID(riid, &IID_IAudioStreamSample)) + { + IAudioStreamSample_AddRef(iface); + *ret_iface = iface; + return S_OK; + } + + *ret_iface = NULL; + + ERR("(%p)->(%s,%p),not found\n", iface, debugstr_guid(riid), ret_iface); + return E_NOINTERFACE; +} + +static ULONG WINAPI IAudioStreamSampleImpl_AddRef(IAudioStreamSample *iface) +{ + IAudioStreamSampleImpl *This = impl_from_IAudioStreamSample(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p)->(): new ref = %u\n", iface, ref); + + return ref; +} + +static ULONG WINAPI IAudioStreamSampleImpl_Release(IAudioStreamSample *iface) +{ + IAudioStreamSampleImpl *This = impl_from_IAudioStreamSample(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(): new ref = %u\n", iface, ref); + + if (!ref) + HeapFree(GetProcessHeap(), 0, This); + + return ref; +} + +/*** IStreamSample methods ***/ +static HRESULT WINAPI IAudioStreamSampleImpl_GetMediaStream(IAudioStreamSample *iface, IMediaStream **media_stream) +{ + FIXME("(%p)->(%p): stub\n", iface, media_stream); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IAudioStreamSampleImpl_GetSampleTimes(IAudioStreamSample *iface, STREAM_TIME *start_time, + STREAM_TIME *end_time, STREAM_TIME *current_time) +{ + FIXME("(%p)->(%p,%p,%p): stub\n", iface, start_time, end_time, current_time); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IAudioStreamSampleImpl_SetSampleTimes(IAudioStreamSample *iface, const STREAM_TIME *start_time, + const STREAM_TIME *end_time) +{ + FIXME("(%p)->(%p,%p): stub\n", iface, start_time, end_time); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IAudioStreamSampleImpl_Update(IAudioStreamSample *iface, DWORD flags, HANDLE event, + PAPCFUNC func_APC, DWORD APC_data) +{ + FIXME("(%p)->(%x,%p,%p,%u): stub\n", iface, flags, event, func_APC, APC_data); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IAudioStreamSampleImpl_CompletionStatus(IAudioStreamSample *iface, DWORD flags, DWORD milliseconds) +{ + FIXME("(%p)->(%x,%u): stub\n", iface, flags, milliseconds); + + return E_NOTIMPL; +} + +/*** IAudioStreamSample methods ***/ +static HRESULT WINAPI IAudioStreamSampleImpl_GetAudioData(IAudioStreamSample *iface, IAudioData **audio_data) +{ + FIXME("(%p)->(%p): stub\n", iface, audio_data); + + return E_NOTIMPL; +} + +static const struct IAudioStreamSampleVtbl AudioStreamSample_Vtbl = +{ + /*** IUnknown methods ***/ + IAudioStreamSampleImpl_QueryInterface, + IAudioStreamSampleImpl_AddRef, + IAudioStreamSampleImpl_Release, + /*** IStreamSample methods ***/ + IAudioStreamSampleImpl_GetMediaStream, + IAudioStreamSampleImpl_GetSampleTimes, + IAudioStreamSampleImpl_SetSampleTimes, + IAudioStreamSampleImpl_Update, + IAudioStreamSampleImpl_CompletionStatus, + /*** IAudioStreamSample methods ***/ + IAudioStreamSampleImpl_GetAudioData +}; + +static HRESULT audiostreamsample_create(IAudioMediaStream *parent, IAudioData *audio_data, IAudioStreamSample **audio_stream_sample) +{ + IAudioStreamSampleImpl *object; + + TRACE("(%p)\n", audio_stream_sample); + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAudioStreamSampleImpl)); + if (!object) + { + ERR("Out of memory\n"); + return E_OUTOFMEMORY; + } + + object->IAudioStreamSample_iface.lpVtbl = &AudioStreamSample_Vtbl; + object->ref = 1; + object->parent = (IMediaStream*)parent; + object->audio_data = audio_data; + + *audio_stream_sample = (IAudioStreamSample*)&object->IAudioStreamSample_iface; + + return S_OK; +} diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 6d4b601..f613c8c 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -337,9 +337,9 @@ static void test_media_streams(void) ok(hr == S_OK, "CoCreateInstance returned: %x\n", hr); hr = IAudioMediaStream_CreateSample(audio_media_stream, NULL, 0, &audio_sample); - todo_wine ok(hr == E_POINTER, "IAudioMediaStream_CreateSample returned: %x\n", hr); + ok(hr == E_POINTER, "IAudioMediaStream_CreateSample returned: %x\n", hr); hr = IAudioMediaStream_CreateSample(audio_media_stream, audio_data, 0, &audio_sample); - todo_wine ok(hr == S_OK, "IAudioMediaStream_CreateSample returned: %x\n", hr); + ok(hr == S_OK, "IAudioMediaStream_CreateSample returned: %x\n", hr); if (audio_data) IAudioData_Release(audio_data);
1
0
0
0
Christian Costa : amstream: Add stubbed implementation of DirectDrawStreamSample.
by Alexandre Julliard
26 Apr '12
26 Apr '12
Module: wine Branch: master Commit: 60a8a27b2bf7f11bc9e03057abf2bff23d513248 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=60a8a27b2bf7f11bc9e03057a…
Author: Christian Costa <titan.costa(a)gmail.com> Date: Thu Apr 26 07:58:05 2012 +0200 amstream: Add stubbed implementation of DirectDrawStreamSample. --- dlls/amstream/mediastream.c | 155 +++++++++++++++++++++++++++++++++++++++- dlls/amstream/tests/amstream.c | 4 +- 2 files changed, 155 insertions(+), 4 deletions(-) diff --git a/dlls/amstream/mediastream.c b/dlls/amstream/mediastream.c index afebdcd..896d316 100644 --- a/dlls/amstream/mediastream.c +++ b/dlls/amstream/mediastream.c @@ -32,6 +32,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(amstream); +static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectDrawStreamSample **ddraw_stream_sample); + typedef struct { IDirectDrawMediaStream IDirectDrawMediaStream_iface; LONG ref; @@ -194,9 +196,9 @@ static HRESULT WINAPI IDirectDrawMediaStreamImpl_CreateSample(IDirectDrawMediaSt IDirectDrawSurface *pSurface, const RECT *pRect, DWORD dwFlags, IDirectDrawStreamSample **ppSample) { - FIXME("(%p)->(%p,%p,%x,%p) stub!\n", iface, pSurface, pRect, dwFlags, ppSample); + TRACE("(%p)->(%p,%p,%x,%p)\n", iface, pSurface, pRect, dwFlags, ppSample); - return E_NOTIMPL; + return ddrawstreamsample_create(iface, ppSample); } static HRESULT WINAPI IDirectDrawMediaStreamImpl_GetTimePerFrame(IDirectDrawMediaStream *iface, @@ -454,3 +456,152 @@ HRESULT audiomediastream_create(IMultiMediaStream *parent, const MSPID *purpose_ return S_OK; } + +typedef struct { + IDirectDrawStreamSample IDirectDrawStreamSample_iface; + LONG ref; + IMediaStream *parent; +} IDirectDrawStreamSampleImpl; + +static inline IDirectDrawStreamSampleImpl *impl_from_IDirectDrawStreamSample(IDirectDrawStreamSample *iface) +{ + return CONTAINING_RECORD(iface, IDirectDrawStreamSampleImpl, IDirectDrawStreamSample_iface); +} + +/*** IUnknown methods ***/ +static HRESULT WINAPI IDirectDrawStreamSampleImpl_QueryInterface(IDirectDrawStreamSample *iface, + REFIID riid, void **ret_iface) +{ + TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid(riid), ret_iface); + + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IStreamSample) || + IsEqualGUID(riid, &IID_IDirectDrawStreamSample)) + { + IDirectDrawStreamSample_AddRef(iface); + *ret_iface = iface; + return S_OK; + } + + *ret_iface = NULL; + + ERR("(%p)->(%s,%p),not found\n", iface, debugstr_guid(riid), ret_iface); + return E_NOINTERFACE; +} + +static ULONG WINAPI IDirectDrawStreamSampleImpl_AddRef(IDirectDrawStreamSample *iface) +{ + IDirectDrawStreamSampleImpl *This = impl_from_IDirectDrawStreamSample(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p)->(): new ref = %u\n", iface, ref); + + return ref; +} + +static ULONG WINAPI IDirectDrawStreamSampleImpl_Release(IDirectDrawStreamSample *iface) +{ + IDirectDrawStreamSampleImpl *This = impl_from_IDirectDrawStreamSample(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(): new ref = %u\n", iface, ref); + + if (!ref) + HeapFree(GetProcessHeap(), 0, This); + + return ref; +} + +/*** IStreamSample methods ***/ +static HRESULT WINAPI IDirectDrawStreamSampleImpl_GetMediaStream(IDirectDrawStreamSample *iface, IMediaStream **media_stream) +{ + FIXME("(%p)->(%p): stub\n", iface, media_stream); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IDirectDrawStreamSampleImpl_GetSampleTimes(IDirectDrawStreamSample *iface, STREAM_TIME *start_time, + STREAM_TIME *end_time, STREAM_TIME *current_time) +{ + FIXME("(%p)->(%p,%p,%p): stub\n", iface, start_time, end_time, current_time); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IDirectDrawStreamSampleImpl_SetSampleTimes(IDirectDrawStreamSample *iface, const STREAM_TIME *start_time, + const STREAM_TIME *end_time) +{ + FIXME("(%p)->(%p,%p): stub\n", iface, start_time, end_time); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IDirectDrawStreamSampleImpl_Update(IDirectDrawStreamSample *iface, DWORD flags, HANDLE event, + PAPCFUNC func_APC, DWORD APC_data) +{ + FIXME("(%p)->(%x,%p,%p,%u): stub\n", iface, flags, event, func_APC, APC_data); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IDirectDrawStreamSampleImpl_CompletionStatus(IDirectDrawStreamSample *iface, DWORD flags, DWORD milliseconds) +{ + FIXME("(%p)->(%x,%u): stub\n", iface, flags, milliseconds); + + return E_NOTIMPL; +} + +/*** IDirectDrawStreamSample methods ***/ +static HRESULT WINAPI IDirectDrawStreamSampleImpl_GetSurface(IDirectDrawStreamSample *iface, IDirectDrawSurface **ddraw_surface, + RECT *rect) +{ + FIXME("(%p)->(%p,%p): stub\n", iface, ddraw_surface, rect); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IDirectDrawStreamSampleImpl_SetRect(IDirectDrawStreamSample *iface, const RECT *rect) +{ + FIXME("(%p)->(%p): stub\n", iface, rect); + + return E_NOTIMPL; +} + +static const struct IDirectDrawStreamSampleVtbl DirectDrawStreamSample_Vtbl = +{ + /*** IUnknown methods ***/ + IDirectDrawStreamSampleImpl_QueryInterface, + IDirectDrawStreamSampleImpl_AddRef, + IDirectDrawStreamSampleImpl_Release, + /*** IStreamSample methods ***/ + IDirectDrawStreamSampleImpl_GetMediaStream, + IDirectDrawStreamSampleImpl_GetSampleTimes, + IDirectDrawStreamSampleImpl_SetSampleTimes, + IDirectDrawStreamSampleImpl_Update, + IDirectDrawStreamSampleImpl_CompletionStatus, + /*** IDirectDrawStreamSample methods ***/ + IDirectDrawStreamSampleImpl_GetSurface, + IDirectDrawStreamSampleImpl_SetRect +}; + +static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectDrawStreamSample **ddraw_stream_sample) +{ + IDirectDrawStreamSampleImpl *object; + + TRACE("(%p)\n", ddraw_stream_sample); + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawStreamSampleImpl)); + if (!object) + { + ERR("Out of memory\n"); + return E_OUTOFMEMORY; + } + + object->IDirectDrawStreamSample_iface.lpVtbl = &DirectDrawStreamSample_Vtbl; + object->ref = 1; + object->parent = (IMediaStream*)parent; + + *ddraw_stream_sample = (IDirectDrawStreamSample*)&object->IDirectDrawStreamSample_iface; + + return S_OK; +} diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 14c3e42..6d4b601 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -151,7 +151,7 @@ static void test_renderfile(void) if (FAILED(hr)) goto error; hr = IDirectDrawMediaStream_CreateSample(pddstream, NULL, NULL, 0, &pddsample); - todo_wine ok(hr==S_OK, "IDirectDrawMediaStream_CreateSample returned: %x\n", hr); + ok(hr == S_OK, "IDirectDrawMediaStream_CreateSample returned: %x\n", hr); error: if (pddsample) @@ -249,7 +249,7 @@ static void test_media_streams(void) if (SUCCEEDED(hr)) { hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, NULL, NULL, 0, &ddraw_sample); - todo_wine ok(hr==S_OK, "IDirectDrawMediaStream_CreateSample returned: %x\n", hr); + ok(hr == S_OK, "IDirectDrawMediaStream_CreateSample returned: %x\n", hr); } if (ddraw_sample)
1
0
0
0
Aric Stewart : strmbase: Track internal window styles in baseWindow. WindowStyles.
by Alexandre Julliard
26 Apr '12
26 Apr '12
Module: wine Branch: master Commit: f38318705c4d234de95c4676799e52c8757a93eb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f38318705c4d234de95c46767…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Thu Apr 26 11:29:09 2012 -0500 strmbase: Track internal window styles in baseWindow.WindowStyles. --- dlls/quartz/videorenderer.c | 5 ++--- dlls/strmbase/window.c | 12 +++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 96f9815..87f3ea9 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -72,7 +72,6 @@ typedef struct VideoRendererImpl IUnknown * pUnkOuter; BOOL bUnkOuterValid; BOOL bAggregatable; - LONG WindowStyle; } VideoRendererImpl; static inline VideoRendererImpl *impl_from_BaseWindow(BaseWindow *iface) @@ -982,7 +981,7 @@ static HRESULT WINAPI Videowindow_put_FullScreenMode(IVideoWindow *iface, FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, FullScreenMode); if (FullScreenMode) { - This->WindowStyle = GetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE); + This->baseControlWindow.baseWindow.WindowStyles = GetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE); ShowWindow(This->baseControlWindow.baseWindow.hWnd, SW_HIDE); SetParent(This->baseControlWindow.baseWindow.hWnd, 0); SetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE, WS_POPUP); @@ -992,7 +991,7 @@ static HRESULT WINAPI Videowindow_put_FullScreenMode(IVideoWindow *iface, } else { ShowWindow(This->baseControlWindow.baseWindow.hWnd, SW_HIDE); SetParent(This->baseControlWindow.baseWindow.hWnd, This->baseControlWindow.hwndOwner); - SetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE, This->WindowStyle); + SetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE, This->baseControlWindow.baseWindow.WindowStyles); GetClientRect(This->baseControlWindow.baseWindow.hWnd, &This->DestRect); SetWindowPos(This->baseControlWindow.baseWindow.hWnd,0,This->DestRect.left,This->DestRect.top,This->DestRect.right,This->DestRect.bottom,SWP_NOZORDER|SWP_SHOWWINDOW); This->WindowPos = This->DestRect; diff --git a/dlls/strmbase/window.c b/dlls/strmbase/window.c index ffb0425..cb448e3 100644 --- a/dlls/strmbase/window.c +++ b/dlls/strmbase/window.c @@ -300,6 +300,7 @@ HRESULT WINAPI BaseControlWindowImpl_put_WindowStyle(IVideoWindow *iface, LONG W SetWindowLongW(This->baseWindow.hWnd, GWL_STYLE, WindowStyle); SetWindowPos(This->baseWindow.hWnd,0,0,0,0,0,SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOZORDER); + This->baseWindow.WindowStyles = WindowStyle; return S_OK; } @@ -310,7 +311,7 @@ HRESULT WINAPI BaseControlWindowImpl_get_WindowStyle(IVideoWindow *iface, LONG * TRACE("(%p/%p)->(%p)\n", This, iface, WindowStyle); - *WindowStyle = GetWindowLongW(This->baseWindow.hWnd, GWL_STYLE); + *WindowStyle = This->baseWindow.WindowStyles; return S_OK; } @@ -534,6 +535,15 @@ HRESULT WINAPI BaseControlWindowImpl_put_Owner(IVideoWindow *iface, OAHWND Owner This->hwndOwner = (HWND)Owner; SetParent(This->baseWindow.hWnd, This->hwndOwner); + if (This->baseWindow.WindowStyles & WS_CHILD) + { + LONG old = GetWindowLongW(This->baseWindow.hWnd, GWL_STYLE); + if (old != This->baseWindow.WindowStyles) + { + SetWindowLongW(This->baseWindow.hWnd, GWL_STYLE, This->baseWindow.WindowStyles); + SetWindowPos(This->baseWindow.hWnd,0,0,0,0,0,SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOZORDER); + } + } return S_OK; }
1
0
0
0
Nikolay Sivov : msxml3: Support disabled escaping mode when writing attribute values.
by Alexandre Julliard
26 Apr '12
26 Apr '12
Module: wine Branch: master Commit: 3bc1bdaee79aaaf76d1ac9da217f03cfbb3b3f17 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3bc1bdaee79aaaf76d1ac9da2…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Apr 26 20:40:53 2012 +0400 msxml3: Support disabled escaping mode when writing attribute values. --- dlls/msxml3/mxwriter.c | 20 +++++++++++++------- dlls/msxml3/tests/saxreader.c | 35 +++++++++++++++++++++-------------- 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c index c512d5c..07ff1ff 100644 --- a/dlls/msxml3/mxwriter.c +++ b/dlls/msxml3/mxwriter.c @@ -1019,19 +1019,20 @@ static HRESULT WINAPI SAXContentHandler_startElement( if (attr) { + int length, i, escape; HRESULT hr; - INT length; - INT i; hr = ISAXAttributes_getLength(attr, &length); if (FAILED(hr)) return hr; + escape = This->props[MXWriter_DisableEscaping] == VARIANT_FALSE || + (This->class_version == MSXML4 || This->class_version == MSXML6); + for (i = 0; i < length; i++) { static const WCHAR eqW[] = {'='}; const WCHAR *str; - WCHAR *escaped; - INT len = 0; + int len = 0; hr = ISAXAttributes_getQName(attr, i, &str, &len); if (FAILED(hr)) return hr; @@ -1046,9 +1047,14 @@ static HRESULT WINAPI SAXContentHandler_startElement( hr = ISAXAttributes_getValue(attr, i, &str, &len); if (FAILED(hr)) return hr; - escaped = get_escaped_string(str, EscapeValue, &len); - write_output_buffer_quoted(This->buffer, escaped, len); - heap_free(escaped); + if (escape) + { + WCHAR *escaped = get_escaped_string(str, EscapeValue, &len); + write_output_buffer_quoted(This->buffer, escaped, len); + heap_free(escaped); + } + else + write_output_buffer_quoted(This->buffer, str, len); } } diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index 04a0648..ebb9d89 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -2832,9 +2832,10 @@ static void test_mxwriter_startenddocument(void) enum startendtype { - StartElement, - EndElement, - StartEndElement + StartElement = 0x001, + EndElement = 0x010, + StartEndElement = 0x011, + DisableEscaping = 0x100 }; struct writer_startendelement_t { @@ -2850,6 +2851,7 @@ struct writer_startendelement_t { static const char startelement_xml[] = "<uri:local a:attr1=\"a1\" attr2=\"a2\" attr3=\"<&">\">"; static const char startendelement_xml[] = "<uri:local a:attr1=\"a1\" attr2=\"a2\" attr3=\"<&">\"/>"; +static const char startendelement_noescape_xml[] = "<uri:local a:attr1=\"a1\" attr2=\"a2\" attr3=\"<&\">\"/>"; static const struct writer_startendelement_t writer_startendelement[] = { /* 0 */ @@ -2948,6 +2950,13 @@ static const struct writer_startendelement_t writer_startendelement[] = { { &CLSID_MXXMLWriter40, StartEndElement, "", "", "", "</>", S_OK }, /* 75 */ { &CLSID_MXXMLWriter60, StartEndElement, "", "", "", "</>", S_OK }, + + /* with disabled output escaping */ + { &CLSID_MXXMLWriter, StartEndElement | DisableEscaping, "uri", "local", "uri:local", startendelement_noescape_xml, S_OK, &saxattributes }, + { &CLSID_MXXMLWriter30, StartEndElement | DisableEscaping, "uri", "local", "uri:local", startendelement_noescape_xml, S_OK, &saxattributes }, + { &CLSID_MXXMLWriter40, StartEndElement | DisableEscaping, "uri", "local", "uri:local", startendelement_xml, S_OK, &saxattributes }, + { &CLSID_MXXMLWriter60, StartEndElement | DisableEscaping, "uri", "local", "uri:local", startendelement_xml, S_OK, &saxattributes }, + { NULL } }; @@ -2998,23 +3007,21 @@ static void test_mxwriter_startendelement_batch(const struct writer_startendelem hr = ISAXContentHandler_startDocument(content); EXPECT_HR(hr, S_OK); - if (table->type == StartElement) - { - hr = ISAXContentHandler_startElement(content, _bstr_(table->uri), lstrlen(table->uri), - _bstr_(table->local_name), lstrlen(table->local_name), _bstr_(table->qname), lstrlen(table->qname), table->attr); - ok(hr == table->hr, "test %d: got 0x%08x, expected 0x%08x\n", i, hr, table->hr); - } - else if (table->type == EndElement) + if (table->type & DisableEscaping) { - hr = ISAXContentHandler_endElement(content, _bstr_(table->uri), lstrlen(table->uri), - _bstr_(table->local_name), lstrlen(table->local_name), _bstr_(table->qname), lstrlen(table->qname)); - ok(hr == table->hr, "test %d: got 0x%08x, expected 0x%08x\n", i, hr, table->hr); + hr = IMXWriter_put_disableOutputEscaping(writer, VARIANT_TRUE); + EXPECT_HR(hr, S_OK); } - else + + if (table->type & StartElement) { hr = ISAXContentHandler_startElement(content, _bstr_(table->uri), lstrlen(table->uri), _bstr_(table->local_name), lstrlen(table->local_name), _bstr_(table->qname), lstrlen(table->qname), table->attr); ok(hr == table->hr, "test %d: got 0x%08x, expected 0x%08x\n", i, hr, table->hr); + } + + if (table->type & EndElement) + { hr = ISAXContentHandler_endElement(content, _bstr_(table->uri), lstrlen(table->uri), _bstr_(table->local_name), lstrlen(table->local_name), _bstr_(table->qname), lstrlen(table->qname)); ok(hr == table->hr, "test %d: got 0x%08x, expected 0x%08x\n", i, hr, table->hr);
1
0
0
0
Nikolay Sivov : msxml3: Support disabled escaping mode for characters() callback.
by Alexandre Julliard
26 Apr '12
26 Apr '12
Module: wine Branch: master Commit: 622c94acad8fdfeabf8dd2c1957fcfd59fe3f45e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=622c94acad8fdfeabf8dd2c19…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Apr 26 20:22:27 2012 +0400 msxml3: Support disabled escaping mode for characters() callback. --- dlls/msxml3/mxwriter.c | 2 +- dlls/msxml3/tests/saxreader.c | 31 ++++++++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c index 779ca7a..c512d5c 100644 --- a/dlls/msxml3/mxwriter.c +++ b/dlls/msxml3/mxwriter.c @@ -1109,7 +1109,7 @@ static HRESULT WINAPI SAXContentHandler_characters( if (nchars) { - if (This->cdata) + if (This->cdata || This->props[MXWriter_DisableEscaping] == VARIANT_TRUE) write_output_buffer(This->buffer, chars, nchars); else { diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index 340bdd0..04a0648 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -3248,6 +3248,7 @@ static void test_mxwriter_characters(void) { ISAXContentHandler *content; IMXWriter *writer; + VARIANT dest; HRESULT hr; if (!is_clsid_supported(table->clsid, mxwriter_support_data)) @@ -3276,17 +3277,41 @@ static void test_mxwriter_characters(void) /* test output */ if (hr == S_OK) { - VARIANT dest; - V_VT(&dest) = VT_EMPTY; hr = IMXWriter_get_output(writer, &dest); EXPECT_HR(hr, S_OK); ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); ok(!lstrcmpW(_bstr_(table->output), V_BSTR(&dest)), - "test %d: got wrong content %s, expected %s\n", i, wine_dbgstr_w(V_BSTR(&dest)), table->output); + "test %d: got wrong content %s, expected \"%s\"\n", i, wine_dbgstr_w(V_BSTR(&dest)), table->output); + VariantClear(&dest); + } + + /* with disabled escaping */ + V_VT(&dest) = VT_EMPTY; + hr = IMXWriter_put_output(writer, dest); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_put_disableOutputEscaping(writer, VARIANT_TRUE); + EXPECT_HR(hr, S_OK); + + hr = ISAXContentHandler_characters(content, _bstr_(table->data), strlen(table->data)); + EXPECT_HR(hr, S_OK); + + /* test output */ + if (hr == S_OK) + { + V_VT(&dest) = VT_EMPTY; + hr = IMXWriter_get_output(writer, &dest); + EXPECT_HR(hr, S_OK); + ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); + ok(!lstrcmpW(_bstr_(table->data), V_BSTR(&dest)), + "test %d: got wrong content %s, expected \"%s\"\n", i, wine_dbgstr_w(V_BSTR(&dest)), table->data); VariantClear(&dest); } + ISAXContentHandler_Release(content); + IMXWriter_Release(writer); + table++; i++; }
1
0
0
0
Jacek Caban : jscript: Get rid of parser function collecting hack by moving the logic to compiler .
by Alexandre Julliard
26 Apr '12
26 Apr '12
Module: wine Branch: master Commit: ca15adfde6a0c9acf3c45fa2aa9ce0825ff8cb99 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ca15adfde6a0c9acf3c45fa2a…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Apr 26 16:17:31 2012 +0200 jscript: Get rid of parser function collecting hack by moving the logic to compiler. --- dlls/jscript/compile.c | 12 +++++++++--- dlls/jscript/engine.h | 23 ++++------------------- dlls/jscript/parser.y | 46 +++------------------------------------------- 3 files changed, 16 insertions(+), 65 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index c903651..df3acb4 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -56,6 +56,9 @@ typedef struct { variable_declaration_t *var_head; variable_declaration_t *var_tail; + + function_expression_t *func_head; + function_expression_t *func_tail; } compiler_ctx_t; static const struct { @@ -815,6 +818,8 @@ static HRESULT compile_object_literal(compiler_ctx_t *ctx, property_value_expres static HRESULT compile_function_expression(compiler_ctx_t *ctx, function_expression_t *expr) { + ctx->func_tail = ctx->func_tail ? (ctx->func_tail->next = expr) : (ctx->func_head = expr); + /* FIXME: not exactly right */ if(expr->identifier) { ctx->func->func_cnt++; @@ -1787,13 +1792,14 @@ static HRESULT compile_function(compiler_ctx_t *ctx, source_elements_t *source, BOOL from_eval, function_code_t *func) { variable_declaration_t *var_iter; - function_declaration_t *iter; + function_expression_t *iter; unsigned off, i; HRESULT hres; TRACE("\n"); ctx->var_head = ctx->var_tail = NULL; + ctx->func_head = ctx->func_tail = NULL; off = ctx->code_off; ctx->func = func; @@ -1856,8 +1862,8 @@ static HRESULT compile_function(compiler_ctx_t *ctx, source_elements_t *source, return E_OUTOFMEMORY; memset(func->funcs, 0, func->func_cnt * sizeof(*func->funcs)); - for(iter = source->functions, i=0; iter; iter = iter->next, i++) { - hres = compile_function(ctx, iter->expr->source_elements, iter->expr, FALSE, func->funcs+i); + for(iter = ctx->func_head, i=0; iter; iter = iter->next, i++) { + hres = compile_function(ctx, iter->source_elements, iter, FALSE, func->funcs+i); if(FAILED(hres)) return hres; } diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 6a318c7..a842a35 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -17,23 +17,9 @@ */ typedef struct _source_elements_t source_elements_t; -typedef struct _function_expression_t function_expression_t; typedef struct _expression_t expression_t; typedef struct _statement_t statement_t; -typedef struct _function_declaration_t { - function_expression_t *expr; - - struct _function_declaration_t *next; -} function_declaration_t; - -typedef struct _func_stack { - function_declaration_t *func_head; - function_declaration_t *func_tail; - - struct _func_stack *next; -} func_stack_t; - typedef struct { const WCHAR *begin; const WCHAR *end; @@ -47,8 +33,6 @@ typedef struct { HRESULT hres; jsheap_t heap; - - func_stack_t *func_stack; } parser_ctx_t; #define OP_LIST \ @@ -497,17 +481,18 @@ typedef struct _parameter_t { struct _source_elements_t { statement_t *statement; statement_t *statement_tail; - function_declaration_t *functions; }; -struct _function_expression_t { +typedef struct _function_expression_t { expression_t expr; const WCHAR *identifier; parameter_t *parameter_list; source_elements_t *source_elements; const WCHAR *src_str; DWORD src_len; -}; + + struct _function_expression_t *next; /* for compiler */ +} function_expression_t; typedef struct { expression_t expr; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index c5984b2..d108ab0 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -29,7 +29,6 @@ static void set_error(parser_ctx_t*,UINT); static BOOL explicit_error(parser_ctx_t*,void*,WCHAR); static BOOL allow_auto_semicolon(parser_ctx_t*); static void program_parsed(parser_ctx_t*,source_elements_t*); -static source_elements_t *function_body_parsed(parser_ctx_t*,source_elements_t*); typedef struct _statement_list_t { statement_t *head; @@ -117,12 +116,6 @@ typedef struct _parameter_list_t { static parameter_list_t *new_parameter_list(parser_ctx_t*,const WCHAR*); static parameter_list_t *parameter_list_add(parser_ctx_t*,parameter_list_t*,const WCHAR*); -static void push_func(parser_ctx_t*); -static inline void pop_func(parser_ctx_t *ctx) -{ - ctx->func_stack = ctx->func_stack->next; -} - static void *new_expression(parser_ctx_t *ctx,expression_type_t,size_t); static expression_t *new_function_expression(parser_ctx_t*,const WCHAR*,parameter_list_t*, source_elements_t*,const WCHAR*,DWORD); @@ -271,11 +264,11 @@ FunctionExpression { $$ = new_function_expression(ctx, $2, $4, $7, $1, $8-$1+1); } KFunction - : kFUNCTION { push_func(ctx); $$ = $1; } + : kFUNCTION { $$ = $1; } /* ECMA-262 3rd Edition 13 */ FunctionBody - : SourceElements { $$ = function_body_parsed(ctx, $1); } + : SourceElements { $$ = $1; } /* ECMA-262 3rd Edition 13 */ FormalParameterList @@ -1307,23 +1300,13 @@ static expression_t *new_function_expression(parser_ctx_t *ctx, const WCHAR *ide parameter_list_t *parameter_list, source_elements_t *source_elements, const WCHAR *src_str, DWORD src_len) { function_expression_t *ret = new_expression(ctx, EXPR_FUNC, sizeof(*ret)); - function_declaration_t *decl; ret->identifier = identifier; ret->parameter_list = parameter_list ? parameter_list->head : NULL; ret->source_elements = source_elements; ret->src_str = src_str; ret->src_len = src_len; - - decl = parser_alloc(ctx, sizeof(function_declaration_t)); - - decl->expr = ret; - decl->next = NULL; - - if(ctx->func_stack->func_tail) - ctx->func_stack->func_tail = ctx->func_stack->func_tail->next = decl; - else - ctx->func_stack->func_head = ctx->func_stack->func_tail = decl; + ret->next = NULL; return &ret->expr; } @@ -1490,29 +1473,8 @@ static statement_list_t *statement_list_add(statement_list_t *list, statement_t return list; } -static void push_func(parser_ctx_t *ctx) -{ - func_stack_t *new_func = parser_alloc_tmp(ctx, sizeof(func_stack_t)); - - new_func->func_head = new_func->func_tail = NULL; - - new_func->next = ctx->func_stack; - ctx->func_stack = new_func; -} - -static source_elements_t *function_body_parsed(parser_ctx_t *ctx, source_elements_t *source) -{ - source->functions = ctx->func_stack->func_head; - pop_func(ctx); - - return source; -} - static void program_parsed(parser_ctx_t *ctx, source_elements_t *source) { - source->functions = ctx->func_stack->func_head; - pop_func(ctx); - ctx->source = source; if(!ctx->lexer_error) ctx->hres = S_OK; @@ -1550,8 +1512,6 @@ HRESULT script_parse(script_ctx_t *ctx, const WCHAR *code, const WCHAR *delimite mark = jsheap_mark(&ctx->tmp_heap); jsheap_init(&parser_ctx->heap); - push_func(parser_ctx); - parser_parse(parser_ctx); jsheap_clear(mark); hres = parser_ctx->hres;
1
0
0
0
Vincent Povirk : gdiplus: Implement GdipWidenPath for closed figures.
by Alexandre Julliard
26 Apr '12
26 Apr '12
Module: wine Branch: master Commit: 7b5af23604867e3b8f1a328424dbea08b3141934 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7b5af23604867e3b8f1a32842…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Apr 24 16:43:06 2012 -0500 gdiplus: Implement GdipWidenPath for closed figures. --- dlls/gdiplus/graphicspath.c | 44 ++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 43 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 8096507..d37512e 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -1739,6 +1739,48 @@ static void widen_open_figure(GpPath *path, GpPen *pen, int start, int end, (*last_point)->type |= PathPointTypeCloseSubpath; } +static void widen_closed_figure(GpPath *path, GpPen *pen, int start, int end, + path_list_node_t **last_point) +{ + int i; + path_list_node_t *prev_point; + + if (end <= start+1) + return; + + /* left outline */ + prev_point = *last_point; + + widen_joint(&path->pathdata.Points[end], &path->pathdata.Points[start], + &path->pathdata.Points[start+1], pen, last_point); + + for (i=start+1; i<end; i++) + widen_joint(&path->pathdata.Points[i-1], &path->pathdata.Points[i], + &path->pathdata.Points[i+1], pen, last_point); + + widen_joint(&path->pathdata.Points[end-1], &path->pathdata.Points[end], + &path->pathdata.Points[start], pen, last_point); + + prev_point->next->type = PathPointTypeStart; + (*last_point)->type |= PathPointTypeCloseSubpath; + + /* right outline */ + prev_point = *last_point; + + widen_joint(&path->pathdata.Points[start], &path->pathdata.Points[end], + &path->pathdata.Points[end-1], pen, last_point); + + for (i=end-1; i>start; i--) + widen_joint(&path->pathdata.Points[i+1], &path->pathdata.Points[i], + &path->pathdata.Points[i-1], pen, last_point); + + widen_joint(&path->pathdata.Points[start+1], &path->pathdata.Points[start], + &path->pathdata.Points[end], pen, last_point); + + prev_point->next->type = PathPointTypeStart; + (*last_point)->type |= PathPointTypeCloseSubpath; +} + GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix, REAL flatness) { @@ -1795,7 +1837,7 @@ GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix, if ((type&PathPointTypeCloseSubpath) == PathPointTypeCloseSubpath) { - FIXME("closed figures unimplemented\n"); + widen_closed_figure(flat_path, pen, subpath_start, i, &last_point); } else if (i == flat_path->pathdata.Count-1 || (flat_path->pathdata.Types[i+1]&PathPointTypePathTypeMask) == PathPointTypeStart)
1
0
0
0
Vincent Povirk : gdiplus: Add basic implementation of GdipWidenPath.
by Alexandre Julliard
26 Apr '12
26 Apr '12
Module: wine Branch: master Commit: 930cdab2e9d17be1d1cb1c38f2f28dc764d98b90 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=930cdab2e9d17be1d1cb1c38f…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Apr 24 16:32:50 2012 -0500 gdiplus: Add basic implementation of GdipWidenPath. --- dlls/gdiplus/graphicspath.c | 172 ++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 170 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index c41278c..8096507 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -1656,12 +1656,180 @@ GpStatus WINGDIPAPI GdipWarpPath(GpPath *path, GpMatrix* matrix, return NotImplemented; } +static void add_bevel_point(const GpPointF *endpoint, const GpPointF *nextpoint, + GpPen *pen, int right_side, path_list_node_t **last_point) +{ + REAL segment_dy = nextpoint->Y-endpoint->Y; + REAL segment_dx = nextpoint->X-endpoint->X; + REAL segment_length = sqrtf(segment_dy*segment_dy + segment_dx*segment_dx); + REAL distance = pen->width/2.0; + REAL bevel_dx, bevel_dy; + + if (right_side) + { + bevel_dx = -distance * segment_dy / segment_length; + bevel_dy = distance * segment_dx / segment_length; + } + else + { + bevel_dx = distance * segment_dy / segment_length; + bevel_dy = -distance * segment_dx / segment_length; + } + + *last_point = add_path_list_node(*last_point, endpoint->X + bevel_dx, + endpoint->Y + bevel_dy, PathPointTypeLine); +} + +static void widen_joint(const GpPointF *p1, const GpPointF *p2, const GpPointF *p3, + GpPen* pen, path_list_node_t **last_point) +{ + switch (pen->join) + { + default: + case LineJoinBevel: + add_bevel_point(p2, p1, pen, 1, last_point); + add_bevel_point(p2, p3, pen, 0, last_point); + break; + } +} + +static void widen_cap(const GpPointF *endpoint, const GpPointF *nextpoint, + GpPen *pen, GpLineCap cap, GpCustomLineCap *custom, int add_first_points, + int add_last_point, path_list_node_t **last_point) +{ + switch (cap) + { + default: + case LineCapFlat: + if (add_first_points) + add_bevel_point(endpoint, nextpoint, pen, 1, last_point); + if (add_last_point) + add_bevel_point(endpoint, nextpoint, pen, 0, last_point); + break; + } +} + +static void widen_open_figure(GpPath *path, GpPen *pen, int start, int end, + path_list_node_t **last_point) +{ + int i; + + if (end <= start) + return; + + widen_cap(&path->pathdata.Points[start], &path->pathdata.Points[start+1], + pen, pen->startcap, pen->customstart, FALSE, TRUE, last_point); + + (*last_point)->type = PathPointTypeStart; + + for (i=start+1; i<end; i++) + widen_joint(&path->pathdata.Points[i-1], &path->pathdata.Points[i], + &path->pathdata.Points[i+1], pen, last_point); + + widen_cap(&path->pathdata.Points[end], &path->pathdata.Points[end-1], + pen, pen->endcap, pen->customend, TRUE, TRUE, last_point); + + for (i=end-1; i>start; i--) + widen_joint(&path->pathdata.Points[i+1], &path->pathdata.Points[i], + &path->pathdata.Points[i-1], pen, last_point); + + widen_cap(&path->pathdata.Points[start], &path->pathdata.Points[start+1], + pen, pen->startcap, pen->customstart, TRUE, FALSE, last_point); + + (*last_point)->type |= PathPointTypeCloseSubpath; +} + GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix, REAL flatness) { - FIXME("(%p,%p,%p,%0.2f)\n", path, pen, matrix, flatness); + GpPath *flat_path=NULL; + GpStatus status; + path_list_node_t *points=NULL, *last_point=NULL; + int i, subpath_start=0, new_length; + BYTE type; - return NotImplemented; + TRACE("(%p,%p,%p,%0.2f)\n", path, pen, matrix, flatness); + + if (!path || !pen) + return InvalidParameter; + + if (path->pathdata.Count <= 1) + return OutOfMemory; + + status = GdipClonePath(path, &flat_path); + + if (status == Ok) + status = GdipFlattenPath(flat_path, matrix, flatness); + + if (status == Ok && !init_path_list(&points, 314.0, 22.0)) + status = OutOfMemory; + + if (status == Ok) + { + last_point = points; + + if (pen->endcap != LineCapFlat) + FIXME("unimplemented end cap %x\n", pen->endcap); + + if (pen->startcap != LineCapFlat) + FIXME("unimplemented start cap %x\n", pen->startcap); + + if (pen->dashcap != DashCapFlat) + FIXME("unimplemented dash cap %d\n", pen->dashcap); + + if (pen->join != LineJoinBevel) + FIXME("unimplemented line join %d\n", pen->join); + + if (pen->dash != DashStyleSolid) + FIXME("unimplemented dash style %d\n", pen->dash); + + if (pen->align != PenAlignmentCenter) + FIXME("unimplemented pen alignment %d\n", pen->align); + + for (i=0; i < flat_path->pathdata.Count; i++) + { + type = flat_path->pathdata.Types[i]; + + if ((type&PathPointTypePathTypeMask) == PathPointTypeStart) + subpath_start = i; + + if ((type&PathPointTypeCloseSubpath) == PathPointTypeCloseSubpath) + { + FIXME("closed figures unimplemented\n"); + } + else if (i == flat_path->pathdata.Count-1 || + (flat_path->pathdata.Types[i+1]&PathPointTypePathTypeMask) == PathPointTypeStart) + { + widen_open_figure(flat_path, pen, subpath_start, i, &last_point); + } + } + + new_length = path_list_count(points)-1; + + if (!lengthen_path(path, new_length)) + status = OutOfMemory; + } + + if (status == Ok) + { + path->pathdata.Count = new_length; + + last_point = points->next; + for (i = 0; i < new_length; i++) + { + path->pathdata.Points[i] = last_point->pt; + path->pathdata.Types[i] = last_point->type; + last_point = last_point->next; + } + + path->fill = FillModeWinding; + } + + free_path_list(points); + + GdipDeletePath(flat_path); + + return status; } GpStatus WINGDIPAPI GdipAddPathRectangle(GpPath *path, REAL x, REAL y,
1
0
0
0
Vincent Povirk : gdiplus: Return OutOfMemory when creating a path gradient from a NULL path.
by Alexandre Julliard
26 Apr '12
26 Apr '12
Module: wine Branch: master Commit: 3a3ca55ffa705c0266b27fdc2d89234a83359784 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3a3ca55ffa705c0266b27fdc2…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Apr 24 10:26:12 2012 -0500 gdiplus: Return OutOfMemory when creating a path gradient from a NULL path. --- dlls/gdiplus/brush.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 8dfa18d..184c8de 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -647,9 +647,12 @@ GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath* path, TRACE("(%p, %p)\n", path, grad); - if(!path || !grad) + if(!grad) return InvalidParameter; + if (!path) + return OutOfMemory; + stat = GdipClonePath((GpPath*)path, &new_path); if (stat == Ok)
1
0
0
0
Vincent Povirk : gdiplus: Return OutOfMemory when creating a path gradient with NULL points.
by Alexandre Julliard
26 Apr '12
26 Apr '12
Module: wine Branch: master Commit: ea3e26e32ddeeba6a2afe3f3ee60b4cd8d859414 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ea3e26e32ddeeba6a2afe3f3e…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Apr 24 10:22:58 2012 -0500 gdiplus: Return OutOfMemory when creating a path gradient with NULL points. --- dlls/gdiplus/brush.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index c11dea6..8dfa18d 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -578,10 +578,10 @@ GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF* points, TRACE("(%p, %d, %d, %p)\n", points, count, wrap, grad); - if(!points || !grad) + if(!grad) return InvalidParameter; - if(count <= 0) + if(!points || count <= 0) return OutOfMemory; stat = GdipCreatePath(FillModeAlternate, &path); @@ -611,10 +611,10 @@ GpStatus WINGDIPAPI GdipCreatePathGradientI(GDIPCONST GpPoint* points, TRACE("(%p, %d, %d, %p)\n", points, count, wrap, grad); - if(!points || !grad) + if(!grad) return InvalidParameter; - if(count <= 0) + if(!points || count <= 0) return OutOfMemory; stat = GdipCreatePath(FillModeAlternate, &path);
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
72
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
Results per page:
10
25
50
100
200