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
February 2009
----- 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
965 discussions
Start a n
N
ew thread
Aric Stewart : msctf: Only 1 ITfThreadMgr is created per thread.
by Alexandre Julliard
03 Feb '09
03 Feb '09
Module: wine Branch: master Commit: 8b34370d7cf870015d003ef8307d833f3f0c9600 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8b34370d7cf870015d003ef83…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Feb 2 10:24:47 2009 -0600 msctf: Only 1 ITfThreadMgr is created per thread. --- dlls/msctf/msctf.c | 7 ++++++- dlls/msctf/msctf_internal.h | 1 + dlls/msctf/threadmgr.c | 11 +++++++++++ 3 files changed, 18 insertions(+), 1 deletions(-) diff --git a/dlls/msctf/msctf.c b/dlls/msctf/msctf.c index 254444b..7dc1bcd 100644 --- a/dlls/msctf/msctf.c +++ b/dlls/msctf/msctf.c @@ -43,6 +43,8 @@ static LONG MSCTF_refCount; static HINSTANCE MSCTF_hinstance; +DWORD tlsIndex = 0; + typedef HRESULT (*LPFNCONSTRUCTOR)(IUnknown *pUnkOuter, IUnknown **ppvOut); static const struct { @@ -159,8 +161,11 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID fImpLoad) case DLL_WINE_PREATTACH: return FALSE; /* prefer native version */ case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hinst); MSCTF_hinstance = hinst; + tlsIndex = TlsAlloc(); + break; + case DLL_PROCESS_DETACH: + TlsFree(tlsIndex); break; } return TRUE; diff --git a/dlls/msctf/msctf_internal.h b/dlls/msctf/msctf_internal.h index ee87a50..fa4a6ef 100644 --- a/dlls/msctf/msctf_internal.h +++ b/dlls/msctf/msctf_internal.h @@ -20,6 +20,7 @@ #ifndef __WINE_MSCTF_I_H #define __WINE_MSCTF_I_H +extern DWORD tlsIndex; extern HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut); extern HRESULT DocumentMgr_Constructor(ITfDocumentMgr **ppOut); diff --git a/dlls/msctf/threadmgr.c b/dlls/msctf/threadmgr.c index b16f7ec..7385f0b 100644 --- a/dlls/msctf/threadmgr.c +++ b/dlls/msctf/threadmgr.c @@ -49,6 +49,7 @@ typedef struct tagACLMulti { static void ThreadMgr_Destructor(ThreadMgr *This) { + TlsSetValue(tlsIndex,NULL); TRACE("destroying %p\n", This); if (This->focus) ITfDocumentMgr_Release(This->focus); @@ -227,12 +228,22 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) if (pUnkOuter) return CLASS_E_NOAGGREGATION; + /* Only 1 ThreadMgr is created per thread */ + This = TlsGetValue(tlsIndex); + if (This) + { + ThreadMgr_AddRef((ITfThreadMgr*)This); + *ppOut = (IUnknown*)This; + return S_OK; + } + This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ThreadMgr)); if (This == NULL) return E_OUTOFMEMORY; This->ThreadMgrVtbl= &ThreadMgr_ThreadMgrVtbl; This->refCount = 1; + TlsSetValue(tlsIndex,This); TRACE("returning %p\n", This); *ppOut = (IUnknown *)This;
1
0
0
0
Aric Stewart : msctf: Implement SetFocus and GetFocus.
by Alexandre Julliard
03 Feb '09
03 Feb '09
Module: wine Branch: master Commit: 9105cd88c44ab2b3a64625118df1225cde9853e8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9105cd88c44ab2b3a64625118…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Feb 2 10:24:41 2009 -0600 msctf: Implement SetFocus and GetFocus. --- dlls/msctf/threadmgr.c | 35 +++++++++++++++++++++++++++++++---- 1 files changed, 31 insertions(+), 4 deletions(-) diff --git a/dlls/msctf/threadmgr.c b/dlls/msctf/threadmgr.c index 7589052..b16f7ec 100644 --- a/dlls/msctf/threadmgr.c +++ b/dlls/msctf/threadmgr.c @@ -43,11 +43,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(msctf); typedef struct tagACLMulti { const ITfThreadMgrVtbl *ThreadMgrVtbl; LONG refCount; + + ITfDocumentMgr *focus; } ThreadMgr; static void ThreadMgr_Destructor(ThreadMgr *This) { TRACE("destroying %p\n", This); + if (This->focus) + ITfDocumentMgr_Release(This->focus); HeapFree(GetProcessHeap(),0,This); } @@ -125,15 +129,38 @@ static HRESULT WINAPI ThreadMgr_GetFocus( ITfThreadMgr* iface, ITfDocumentMgr **ppdimFocus) { ThreadMgr *This = (ThreadMgr *)iface; - FIXME("STUB:(%p)\n",This); - return E_NOTIMPL; + TRACE("(%p)\n",This); + + if (!ppdimFocus) + return E_INVALIDARG; + + *ppdimFocus = This->focus; + + TRACE("->%p\n",This->focus); + + if (This->focus == NULL) + return S_FALSE; + + ITfDocumentMgr_AddRef(This->focus); + + return S_OK; } static HRESULT WINAPI ThreadMgr_SetFocus( ITfThreadMgr* iface, ITfDocumentMgr *pdimFocus) { + ITfDocumentMgr *check; ThreadMgr *This = (ThreadMgr *)iface; - FIXME("STUB:(%p)\n",This); - return E_NOTIMPL; + + TRACE("(%p) %p\n",This,pdimFocus); + + if (!pdimFocus || FAILED(IUnknown_QueryInterface(pdimFocus,&IID_ITfDocumentMgr,(LPVOID*) &check))) + return E_INVALIDARG; + + if (This->focus) + ITfDocumentMgr_Release(This->focus); + + This->focus = check; + return S_OK; } static HRESULT WINAPI ThreadMgr_AssociateFocus( ITfThreadMgr* iface, HWND hwnd,
1
0
0
0
Nikolay Sivov : gdiplus: Add testing for ObjectBusy in some Graphics methods.
by Alexandre Julliard
03 Feb '09
03 Feb '09
Module: wine Branch: master Commit: 8c096167d7ce26d794e09c70a86963b901596d2f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8c096167d7ce26d794e09c70a…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Mon Feb 2 23:48:01 2009 +0300 gdiplus: Add testing for ObjectBusy in some Graphics methods. --- dlls/gdiplus/graphics.c | 12 ++++++++++++ dlls/gdiplus/tests/graphics.c | 14 +++++++++++++- include/gdiplusflat.h | 5 +++++ 3 files changed, 30 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 1c88453..04beb0b 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2415,6 +2415,9 @@ GpStatus WINGDIPAPI GdipGetClipBounds(GpGraphics *graphics, GpRectF *rect) if(!graphics) return InvalidParameter; + if(graphics->busy) + return ObjectBusy; + return GdipGetRegionBounds(graphics->clip, graphics, rect); } @@ -2428,6 +2431,9 @@ GpStatus WINGDIPAPI GdipGetClipBoundsI(GpGraphics *graphics, GpRect *rect) if(!graphics) return InvalidParameter; + if(graphics->busy) + return ObjectBusy; + return GdipGetRegionBoundsI(graphics->clip, graphics, rect); } @@ -3378,6 +3384,9 @@ GpStatus WINGDIPAPI GdipTranslateClip(GpGraphics *graphics, REAL dx, REAL dy) if(!graphics) return InvalidParameter; + if(graphics->busy) + return ObjectBusy; + return GdipTranslateRegion(graphics->clip, dx, dy); } @@ -3391,5 +3400,8 @@ GpStatus WINGDIPAPI GdipTranslateClipI(GpGraphics *graphics, INT dx, INT dy) if(!graphics) return InvalidParameter; + if(graphics->busy) + return ObjectBusy; + return GdipTranslateRegion(graphics->clip, (REAL)dx, (REAL)dy); } diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index fb98a38..8091a9a 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -486,6 +486,7 @@ static void test_Get_Release_DC(void) INT i; BOOL res; ARGB color = 0x00000000; + HRGN hrgn = CreateRectRgn(0, 0, 10, 10); pt[0].X = 10; pt[0].Y = 10; @@ -653,6 +654,10 @@ static void test_Get_Release_DC(void) expect(ObjectBusy, status); status = Ok; status = GdipFlush(graphics, FlushIntentionFlush); expect(ObjectBusy, status); status = Ok; + status = GdipGetClipBounds(graphics, rectf); + expect(ObjectBusy, status); status = Ok; + status = GdipGetClipBoundsI(graphics, rect); + expect(ObjectBusy, status); status = Ok; status = GdipGetCompositingMode(graphics, &compmode); expect(ObjectBusy, status); status = Ok; status = GdipGetCompositingQuality(graphics, &quality); @@ -711,6 +716,8 @@ static void test_Get_Release_DC(void) expect(ObjectBusy, status); status = Ok; status = GdipTranslateWorldTransform(graphics, 0.0, 0.0, MatrixOrderPrepend); expect(ObjectBusy, status); status = Ok; + status = GdipSetClipHrgn(graphics, hrgn, CombineModeReplace); + expect(ObjectBusy, status); status = Ok; status = GdipSetClipPath(graphics, path, CombineModeReplace); expect(ObjectBusy, status); status = Ok; status = GdipSetClipRect(graphics, 0.0, 0.0, 10.0, 10.0, CombineModeReplace); @@ -718,7 +725,11 @@ static void test_Get_Release_DC(void) status = GdipSetClipRectI(graphics, 0, 0, 10, 10, CombineModeReplace); expect(ObjectBusy, status); status = Ok; status = GdipSetClipRegion(graphics, clip, CombineModeReplace); - expect(ObjectBusy, status); + expect(ObjectBusy, status); status = Ok; + status = GdipTranslateClip(graphics, 0.0, 0.0); + expect(ObjectBusy, status); status = Ok; + status = GdipTranslateClipI(graphics, 0, 0); + expect(ObjectBusy, status); status = Ok; status = GdipDrawPolygon(graphics, pen, ptf, 5); expect(ObjectBusy, status); status = Ok; status = GdipDrawPolygonI(graphics, pen, pt, 5); @@ -746,6 +757,7 @@ static void test_Get_Release_DC(void) GdipDeleteBrush((GpBrush*)brush); GdipDeleteRegion(region); GdipDeleteMatrix(m); + DeleteObject(hrgn); ReleaseDC(0, hdc); } diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index dd01d1b..56540cd 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -190,6 +190,8 @@ GpStatus WINGDIPAPI GdipFillRectangles(GpGraphics*,GpBrush*,GDIPCONST GpRectF*,I GpStatus WINGDIPAPI GdipFillRectanglesI(GpGraphics*,GpBrush*,GDIPCONST GpRect*,INT); GpStatus WINGDIPAPI GdipFillRegion(GpGraphics*,GpBrush*,GpRegion*); GpStatus WINGDIPAPI GdipGetClip(GpGraphics*,GpRegion*); +GpStatus WINGDIPAPI GdipGetClipBounds(GpGraphics*,GpRectF*); +GpStatus WINGDIPAPI GdipGetClipBoundsI(GpGraphics*,GpRect*); GpStatus WINGDIPAPI GdipGetCompositingMode(GpGraphics*,CompositingMode*); GpStatus WINGDIPAPI GdipGetCompositingQuality(GpGraphics*,CompositingQuality*); GpStatus WINGDIPAPI GdipGetDC(GpGraphics*,HDC*); @@ -222,6 +224,7 @@ GpStatus WINGDIPAPI GdipRestoreGraphics(GpGraphics*,GraphicsState); GpStatus WINGDIPAPI GdipRotateWorldTransform(GpGraphics*,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipSaveGraphics(GpGraphics*,GraphicsState*); GpStatus WINGDIPAPI GdipScaleWorldTransform(GpGraphics*,REAL,REAL,GpMatrixOrder); +GpStatus WINGDIPAPI GdipSetClipHrgn(GpGraphics*,HRGN,CombineMode); GpStatus WINGDIPAPI GdipSetClipPath(GpGraphics*,GpPath*,CombineMode); GpStatus WINGDIPAPI GdipSetClipRect(GpGraphics*,REAL,REAL,REAL,REAL,CombineMode); GpStatus WINGDIPAPI GdipSetClipRectI(GpGraphics*,INT,INT,INT,INT,CombineMode); @@ -240,6 +243,8 @@ GpStatus WINGDIPAPI GdipTransformPoints(GpGraphics*, GpCoordinateSpace, GpCoordi GpPointF *, INT); GpStatus WINGDIPAPI GdipTransformPointsI(GpGraphics*, GpCoordinateSpace, GpCoordinateSpace, GpPoint *, INT); +GpStatus WINGDIPAPI GdipTranslateClip(GpGraphics*,REAL,REAL); +GpStatus WINGDIPAPI GdipTranslateClipI(GpGraphics*,INT,INT); GpStatus WINGDIPAPI GdipTranslateWorldTransform(GpGraphics*,REAL,REAL,GpMatrixOrder); /* GraphicsPath */
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipSetClipHrgn.
by Alexandre Julliard
03 Feb '09
03 Feb '09
Module: wine Branch: master Commit: f8edb068e71f4865ac23db051d62b541bd28a10b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f8edb068e71f4865ac23db051…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Mon Feb 2 23:33:41 2009 +0300 gdiplus: Implemented GdipSetClipHrgn. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphics.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 450c596..ba2b5ab 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -507,7 +507,7 @@ @ stdcall GdipSetAdjustableArrowCapMiddleInset(ptr long) @ stdcall GdipSetAdjustableArrowCapWidth(ptr long) @ stdcall GdipSetClipGraphics(ptr ptr long) -@ stub GdipSetClipHrgn +@ stdcall GdipSetClipHrgn(ptr long long) @ stdcall GdipSetClipPath(ptr ptr long) @ stdcall GdipSetClipRect(ptr long long long long long) @ stdcall GdipSetClipRectI(ptr long long long long long) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 547f9f6..1c88453 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -3083,6 +3083,29 @@ GpStatus WINGDIPAPI GdipTranslateWorldTransform(GpGraphics *graphics, REAL dx, return GdipTranslateMatrix(graphics->worldtrans, dx, dy, order); } +/***************************************************************************** + * GdipSetClipHrgn [GDIPLUS.@] + */ +GpStatus WINGDIPAPI GdipSetClipHrgn(GpGraphics *graphics, HRGN hrgn, CombineMode mode) +{ + GpRegion *region; + GpStatus status; + + TRACE("(%p, %p, %d)\n", graphics, hrgn, mode); + + if(!graphics) + return InvalidParameter; + + status = GdipCreateRegionHrgn(hrgn, ®ion); + if(status != Ok) + return status; + + status = GdipSetClipRegion(graphics, region, mode); + + GdipDeleteRegion(region); + return status; +} + GpStatus WINGDIPAPI GdipSetClipPath(GpGraphics *graphics, GpPath *path, CombineMode mode) { TRACE("(%p, %p, %d)\n", graphics, path, mode);
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipGetClipBounds/GdipGetClipBoundsI.
by Alexandre Julliard
03 Feb '09
03 Feb '09
Module: wine Branch: master Commit: bcfe4e7e46d2199e04ae4793538dcb0fcdbdc719 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bcfe4e7e46d2199e04ae47935…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Mon Feb 2 22:58:27 2009 +0300 gdiplus: Implemented GdipGetClipBounds/GdipGetClipBoundsI. --- dlls/gdiplus/gdiplus.spec | 4 ++-- dlls/gdiplus/graphics.c | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index f9d47d9..450c596 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -245,8 +245,8 @@ @ stdcall GdipGetCellAscent(ptr long ptr) @ stdcall GdipGetCellDescent(ptr long ptr) @ stdcall GdipGetClip(ptr ptr) -@ stub GdipGetClipBounds -@ stub GdipGetClipBoundsI +@ stdcall GdipGetClipBounds(ptr ptr) +@ stdcall GdipGetClipBoundsI(ptr ptr) @ stdcall GdipGetCompositingMode(ptr ptr) @ stdcall GdipGetCompositingQuality(ptr ptr) @ stdcall GdipGetCustomLineCapBaseCap(ptr ptr) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 039739b..547f9f6 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2405,6 +2405,32 @@ GpStatus WINGDIPAPI GdipFlush(GpGraphics *graphics, GpFlushIntention intention) return NotImplemented; } +/***************************************************************************** + * GdipGetClipBounds [GDIPLUS.@] + */ +GpStatus WINGDIPAPI GdipGetClipBounds(GpGraphics *graphics, GpRectF *rect) +{ + TRACE("(%p, %p)\n", graphics, rect); + + if(!graphics) + return InvalidParameter; + + return GdipGetRegionBounds(graphics->clip, graphics, rect); +} + +/***************************************************************************** + * GdipGetClipBoundsI [GDIPLUS.@] + */ +GpStatus WINGDIPAPI GdipGetClipBoundsI(GpGraphics *graphics, GpRect *rect) +{ + TRACE("(%p, %p)\n", graphics, rect); + + if(!graphics) + return InvalidParameter; + + return GdipGetRegionBoundsI(graphics->clip, graphics, rect); +} + /* FIXME: Compositing mode is not used anywhere except the getter/setter. */ GpStatus WINGDIPAPI GdipGetCompositingMode(GpGraphics *graphics, CompositingMode *mode)
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipCreateBitmapFromHICON (with tests) .
by Alexandre Julliard
03 Feb '09
03 Feb '09
Module: wine Branch: master Commit: 5bc54ed97ecd281a2ef4d07473d72f1e50cd9ad5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5bc54ed97ecd281a2ef4d0747…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Mon Feb 2 19:15:53 2009 +0300 gdiplus: Implemented GdipCreateBitmapFromHICON (with tests). --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/image.c | 46 ++++++++++++++++ dlls/gdiplus/tests/Makefile.in | 2 +- dlls/gdiplus/tests/image.c | 111 +++++++++++++++++++++++++++++++++++++++- include/gdiplusflat.h | 1 + 5 files changed, 158 insertions(+), 4 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 7e7bfbf..f9d47d9 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -76,7 +76,7 @@ @ stdcall GdipCreateBitmapFromGdiDib(ptr ptr ptr) @ stdcall GdipCreateBitmapFromGraphics(long long ptr ptr) @ stdcall GdipCreateBitmapFromHBITMAP(long long ptr) -@ stub GdipCreateBitmapFromHICON +@ stdcall GdipCreateBitmapFromHICON(long ptr) @ stdcall GdipCreateBitmapFromResource(long wstr ptr) @ stdcall GdipCreateBitmapFromScan0(long long long long ptr ptr) @ stdcall GdipCreateBitmapFromStream(ptr ptr) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 02f8f5a..9944322 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -18,6 +18,8 @@ #include <stdarg.h> +#define NONAMELESSUNION + #include "windef.h" #include "winbase.h" #include "winuser.h" @@ -429,6 +431,50 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics(INT width, INT height, return ret; } +GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON hicon, GpBitmap** bitmap) +{ + HICON icon_copy; + ICONINFO iinfo; + PICTDESC desc; + + TRACE("%p, %p\n", hicon, bitmap); + + if(!bitmap || !GetIconInfo(hicon, &iinfo)) + return InvalidParameter; + + *bitmap = GdipAlloc(sizeof(GpBitmap)); + if(!*bitmap) return OutOfMemory; + + icon_copy = CreateIconIndirect(&iinfo); + + if(!icon_copy){ + GdipFree(*bitmap); + return InvalidParameter; + } + + desc.cbSizeofstruct = sizeof(PICTDESC); + desc.picType = PICTYPE_ICON; + desc.u.icon.hicon = icon_copy; + + if(OleCreatePictureIndirect(&desc, &IID_IPicture, TRUE, + (LPVOID*) &((*bitmap)->image.picture)) != S_OK){ + DestroyIcon(icon_copy); + GdipFree(*bitmap); + return GenericError; + } + + (*bitmap)->format = PixelFormat32bppARGB; + (*bitmap)->image.type = ImageTypeBitmap; + (*bitmap)->image.flags = ImageFlagsNone; + (*bitmap)->width = ipicture_pixel_width((*bitmap)->image.picture); + (*bitmap)->height = ipicture_pixel_height((*bitmap)->image.picture); + + DeleteObject(iinfo.hbmColor); + DeleteObject(iinfo.hbmMask); + + return Ok; +} + GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, PixelFormat format, BYTE* scan0, GpBitmap** bitmap) { diff --git a/dlls/gdiplus/tests/Makefile.in b/dlls/gdiplus/tests/Makefile.in index 7dba3da..ac5589d 100644 --- a/dlls/gdiplus/tests/Makefile.in +++ b/dlls/gdiplus/tests/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../../.. SRCDIR = @srcdir@ VPATH = @srcdir@ TESTDLL = gdiplus.dll -IMPORTS = gdiplus user32 gdi32 kernel32 +IMPORTS = gdiplus ole32 user32 gdi32 kernel32 CTESTS = \ brush.c \ diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 19f0500..6619759 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -18,11 +18,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <math.h> + +#include "initguid.h" #include "windows.h" #include "gdiplus.h" #include "wine/test.h" -#include <math.h> -#include "wingdi.h" #define expect(expected, got) ok(((UINT)got) == ((UINT)expected), "Expected %.8x, got %.8x\n", (UINT)expected, (UINT)got) @@ -530,6 +531,111 @@ static void test_testcontrol(void) ok(param != 0, "Build number expected, got %u\n", param); } +static void test_fromhicon(void) +{ + static const BYTE bmp_bits[1024]; + HBITMAP hbmMask, hbmColor; + ICONINFO info; + HICON hIcon; + GpStatus stat; + GpBitmap *bitmap = NULL; + UINT dim; + ImageType type; + PixelFormat format; + GUID raw; + WCHAR bufferW[39]; + char buffer[39]; + char buffer2[39]; + + /* NULL */ + stat = GdipCreateBitmapFromHICON(NULL, NULL); + expect(InvalidParameter, stat); + stat = GdipCreateBitmapFromHICON(NULL, &bitmap); + expect(InvalidParameter, stat); + + /* color icon 1 bit */ + hbmMask = CreateBitmap(16, 16, 1, 1, bmp_bits); + ok(hbmMask != 0, "CreateBitmap failed\n"); + hbmColor = CreateBitmap(16, 16, 1, 1, bmp_bits); + ok(hbmColor != 0, "CreateBitmap failed\n"); + info.fIcon = TRUE; + info.xHotspot = 8; + info.yHotspot = 8; + info.hbmMask = hbmMask; + info.hbmColor = hbmColor; + hIcon = CreateIconIndirect(&info); + ok(hIcon != 0, "CreateIconIndirect failed\n"); + DeleteObject(hbmMask); + DeleteObject(hbmColor); + + stat = GdipCreateBitmapFromHICON(hIcon, &bitmap); + expect(Ok, stat); + if(stat == Ok){ + /* check attributes */ + stat = GdipGetImageHeight((GpImage*)bitmap, &dim); + expect(Ok, stat); + expect(16, dim); + stat = GdipGetImageWidth((GpImage*)bitmap, &dim); + expect(Ok, stat); + expect(16, dim); + stat = GdipGetImageType((GpImage*)bitmap, &type); + expect(Ok, stat); + expect(ImageTypeBitmap, type); + stat = GdipGetImagePixelFormat((GpImage*)bitmap, &format); + expect(PixelFormat32bppARGB, format); + /* raw format */ + stat = GdipGetImageRawFormat((GpImage*)bitmap, &raw); + StringFromGUID2(&raw, bufferW, sizeof(bufferW)/sizeof(bufferW[0])); + WideCharToMultiByte(CP_ACP, 0, bufferW, sizeof(bufferW)/sizeof(bufferW[0]), buffer, sizeof(buffer), NULL, NULL); + StringFromGUID2(&ImageFormatMemoryBMP, bufferW, sizeof(bufferW)/sizeof(bufferW[0])); + WideCharToMultiByte(CP_ACP, 0, bufferW, sizeof(bufferW)/sizeof(bufferW[0]), buffer2, sizeof(buffer2), NULL, NULL); + todo_wine ok(IsEqualGUID(&raw, &ImageFormatMemoryBMP), "Expected format %s, got %s\n", buffer2, buffer); + GdipDisposeImage((GpImage*)bitmap); + } + DestroyIcon(hIcon); + + /* color icon 8 bpp */ + hbmMask = CreateBitmap(16, 16, 1, 8, bmp_bits); + ok(hbmMask != 0, "CreateBitmap failed\n"); + hbmColor = CreateBitmap(16, 16, 1, 8, bmp_bits); + ok(hbmColor != 0, "CreateBitmap failed\n"); + info.fIcon = TRUE; + info.xHotspot = 8; + info.yHotspot = 8; + info.hbmMask = hbmMask; + info.hbmColor = hbmColor; + hIcon = CreateIconIndirect(&info); + ok(hIcon != 0, "CreateIconIndirect failed\n"); + DeleteObject(hbmMask); + DeleteObject(hbmColor); + + stat = GdipCreateBitmapFromHICON(hIcon, &bitmap); + expect(Ok, stat); + if(stat == Ok){ + /* check attributes */ + stat = GdipGetImageHeight((GpImage*)bitmap, &dim); + expect(Ok, stat); + expect(16, dim); + stat = GdipGetImageWidth((GpImage*)bitmap, &dim); + expect(Ok, stat); + expect(16, dim); + stat = GdipGetImageType((GpImage*)bitmap, &type); + expect(Ok, stat); + expect(ImageTypeBitmap, type); + stat = GdipGetImagePixelFormat((GpImage*)bitmap, &format); + expect(PixelFormat32bppARGB, format); + /* raw format */ + stat = GdipGetImageRawFormat((GpImage*)bitmap, &raw); + StringFromGUID2(&raw, bufferW, sizeof(bufferW)/sizeof(bufferW[0])); + WideCharToMultiByte(CP_ACP, 0, bufferW, sizeof(bufferW)/sizeof(bufferW[0]), buffer, sizeof(buffer), NULL, NULL); + StringFromGUID2(&ImageFormatMemoryBMP, bufferW, sizeof(bufferW)/sizeof(bufferW[0])); + WideCharToMultiByte(CP_ACP, 0, bufferW, sizeof(bufferW)/sizeof(bufferW[0]), buffer2, sizeof(buffer2), NULL, NULL); + todo_wine ok(IsEqualGUID(&raw, &ImageFormatMemoryBMP), "Expected format %s, got %s\n", buffer2, buffer); + GdipDisposeImage((GpImage*)bitmap); + } + DestroyIcon(hIcon); +} + START_TEST(image) { struct GdiplusStartupInput gdiplusStartupInput; @@ -553,6 +659,7 @@ START_TEST(image) test_GdipGetImageFlags(); test_GdipCloneImage(); test_testcontrol(); + test_fromhicon(); GdiplusShutdown(gdiplusToken); } diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index cb53ea4..dd01d1b 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -49,6 +49,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromFileICM(GDIPCONST WCHAR*,GpBitmap**); GpStatus WINGDIPAPI GdipCreateBitmapFromGdiDib(GDIPCONST BITMAPINFO*,VOID*,GpBitmap**); GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics(INT,INT,GpGraphics*,GpBitmap**); GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP, HPALETTE, GpBitmap**); +GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON, GpBitmap**); GpStatus WINGDIPAPI GdipCreateBitmapFromResource(HINSTANCE,GDIPCONST WCHAR*,GpBitmap**); GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT,INT,INT,PixelFormat,BYTE*, GpBitmap**);
1
0
0
0
Alistair Leslie-Hughes : mshtml: Add missing coclass's.
by Alexandre Julliard
03 Feb '09
03 Feb '09
Module: wine Branch: master Commit: 8b9ce14fa27e0e15e631e58c120fb35d286361e0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8b9ce14fa27e0e15e631e58c1…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Tue Feb 3 20:57:09 2009 +1100 mshtml: Add missing coclass's. --- dlls/mshtml/mshtml_private.h | 4 +- include/mshtml.idl | 54 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index d884ca3..e4c98a7 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -199,14 +199,14 @@ struct ConnectionPoint { ConnectionPoint *next; }; -typedef struct { +struct HTMLLocation { DispatchEx dispex; const IHTMLLocationVtbl *lpHTMLLocationVtbl; LONG ref; HTMLDocument *doc; -} HTMLLocation; +}; typedef struct { const IHTMLOptionElementFactoryVtbl *lpHTMLOptionElementFactoryVtbl; diff --git a/include/mshtml.idl b/include/mshtml.idl index dd71879..acbdde2 100644 --- a/include/mshtml.idl +++ b/include/mshtml.idl @@ -12782,6 +12782,15 @@ interface IOmHistory : IDispatch HRESULT go([optional, in] VARIANT *pvargdistance); } +[ + noncreatable, + uuid(FECEAAA3-8405-11cf-8BA1-00AA00476DA6) +] +coclass HTMLHistory +{ + [default] interface IOmHistory; +} + /***************************************************************************** * IHTMLMimeTypesCollection interface */ @@ -12797,6 +12806,15 @@ interface IHTMLMimeTypesCollection : IDispatch HRESULT length([retval, out] long *p); } +[ + noncreatable, + uuid(3050f3fe-98b5-11cf-bb82-00aa00bdce0b) +] +coclass CMimeTypes +{ + [default] interface IHTMLMimeTypesCollection; +} + /***************************************************************************** * IHTMLPluginsCollection interface */ @@ -12815,6 +12833,15 @@ interface IHTMLPluginsCollection : IDispatch HRESULT refresh([defaultvalue(0), in] VARIANT_BOOL reload); } +[ + noncreatable, + uuid(3050f3ff-98b5-11cf-bb82-00aa00bdce0b) +] +coclass CPlugins +{ + [default] interface IHTMLPluginsCollection; +} + /***************************************************************************** * IHTMLOpsProfile interface */ @@ -12878,6 +12905,15 @@ interface IHTMLOpsProfile : IDispatch HRESULT doWriteRequest([retval, out] VARIANT_BOOL *success); } +[ + noncreatable, + uuid(3050f402-98b5-11cf-bb82-00aa00bdce0b) +] +coclass COpsProfile +{ + [default] interface IHTMLOpsProfile; +} + /***************************************************************************** * IOmNavigator interface */ @@ -12950,6 +12986,15 @@ interface IOmNavigator : IDispatch HRESULT userProfile([retval, out] IHTMLOpsProfile **p); } +[ + noncreatable, + uuid(FECEAAA6-8405-11cf-8BA1-00AA00476DA6) +] +coclass HTMLNavigator +{ + [default] interface IOmNavigator; +} + /***************************************************************************** * IHTMLLocation interface */ @@ -13023,6 +13068,15 @@ interface IHTMLLocation : IDispatch } [ + noncreatable, + uuid(163BB1E1-6E00-11cf-837A-48DC04C10000) +] +coclass HTMLLocation +{ + [default] interface IHTMLLocation; +} + +[ odl, oleautomation, dual,
1
0
0
0
Dmitry Timoshkov : gdi32: Add a test for the MAT2 parameter of GetGlyphOutline, make it pass under Wine.
by Alexandre Julliard
03 Feb '09
03 Feb '09
Module: wine Branch: master Commit: 24937a4f0f331df48d346a3bb4d60c21249d4728 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=24937a4f0f331df48d346a3bb…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Tue Feb 3 17:55:19 2009 +0800 gdi32: Add a test for the MAT2 parameter of GetGlyphOutline, make it pass under Wine. --- dlls/gdi32/font.c | 7 +++++- dlls/gdi32/freetype.c | 23 +++++++++++------- dlls/gdi32/tests/font.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 10 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 4e271ea..205224b 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -2336,6 +2336,8 @@ DWORD WINAPI GetGlyphOutlineA( HDC hdc, UINT uChar, UINT fuFormat, DWORD ret; UINT c; + if (!lpmat2) return GDI_ERROR; + if(!(fuFormat & GGO_GLYPH_INDEX)) { int len; char mbchs[2]; @@ -2364,12 +2366,15 @@ DWORD WINAPI GetGlyphOutlineW( HDC hdc, UINT uChar, UINT fuFormat, LPGLYPHMETRICS lpgm, DWORD cbBuffer, LPVOID lpBuffer, const MAT2 *lpmat2 ) { - DC *dc = get_dc_ptr(hdc); + DC *dc; DWORD ret; TRACE("(%p, %04x, %04x, %p, %d, %p, %p)\n", hdc, uChar, fuFormat, lpgm, cbBuffer, lpBuffer, lpmat2 ); + if (!lpmat2) return GDI_ERROR; + + dc = get_dc_ptr(hdc); if(!dc) return GDI_ERROR; if(dc->gdiFont) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 5c7b51b..bad2705 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -4417,7 +4417,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, font->gmsize * sizeof(GM*)); } else { if (format == GGO_METRICS && font->gm[original_index / GM_BLOCK_SIZE] != NULL && - FONT_GM(font,original_index)->init && (!lpmat || is_identity_MAT2(lpmat))) + FONT_GM(font,original_index)->init && is_identity_MAT2(lpmat)) { *lpgm = FONT_GM(font,original_index)->gm; TRACE("cached: %u,%u,%s,%d,%d\n", lpgm->gmBlackBoxX, lpgm->gmBlackBoxY, @@ -4499,7 +4499,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, } /* Extra transformation specified by caller */ - if (lpmat && !is_identity_MAT2(lpmat)) + if (!is_identity_MAT2(lpmat)) { FT_Matrix extraMat; extraMat.xx = FT_FixedFromFIXED(lpmat->eM11); @@ -4588,7 +4588,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, lpgm->gmCellIncX, lpgm->gmCellIncY); if ((format == GGO_METRICS || format == GGO_BITMAP || format == WINE_GGO_GRAY16_BITMAP) && - (!lpmat || is_identity_MAT2(lpmat))) /* don't cache custom transforms */ + is_identity_MAT2(lpmat)) /* don't cache custom transforms */ { FONT_GM(font,original_index)->gm = *lpgm; FONT_GM(font,original_index)->adv = adv; @@ -5600,6 +5600,7 @@ static BOOL get_glyph_index_linked(GdiFont *font, UINT c, GdiFont **linked_font, BOOL WineEngGetCharWidth(GdiFont *font, UINT firstChar, UINT lastChar, LPINT buffer) { + static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} }; UINT c; GLYPHMETRICS gm; FT_UInt glyph_index; @@ -5612,7 +5613,7 @@ BOOL WineEngGetCharWidth(GdiFont *font, UINT firstChar, UINT lastChar, for(c = firstChar; c <= lastChar; c++) { get_glyph_index_linked(font, c, &linked_font, &glyph_index); WineEngGetGlyphOutline(linked_font, glyph_index, GGO_METRICS | GGO_GLYPH_INDEX, - &gm, 0, NULL, NULL); + &gm, 0, NULL, &identity); buffer[c - firstChar] = FONT_GM(linked_font,glyph_index)->adv; } LeaveCriticalSection( &freetype_cs ); @@ -5626,6 +5627,7 @@ BOOL WineEngGetCharWidth(GdiFont *font, UINT firstChar, UINT lastChar, BOOL WineEngGetCharABCWidths(GdiFont *font, UINT firstChar, UINT lastChar, LPABC buffer) { + static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} }; UINT c; GLYPHMETRICS gm; FT_UInt glyph_index; @@ -5642,7 +5644,7 @@ BOOL WineEngGetCharABCWidths(GdiFont *font, UINT firstChar, UINT lastChar, for(c = firstChar; c <= lastChar; c++) { get_glyph_index_linked(font, c, &linked_font, &glyph_index); WineEngGetGlyphOutline(linked_font, glyph_index, GGO_METRICS | GGO_GLYPH_INDEX, - &gm, 0, NULL, NULL); + &gm, 0, NULL, &identity); buffer[c - firstChar].abcA = FONT_GM(linked_font,glyph_index)->lsb; buffer[c - firstChar].abcB = FONT_GM(linked_font,glyph_index)->bbx; buffer[c - firstChar].abcC = FONT_GM(linked_font,glyph_index)->adv - FONT_GM(linked_font,glyph_index)->lsb - @@ -5659,6 +5661,7 @@ BOOL WineEngGetCharABCWidths(GdiFont *font, UINT firstChar, UINT lastChar, BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar, UINT count, LPWORD pgi, LPABC buffer) { + static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} }; UINT c; GLYPHMETRICS gm; FT_UInt glyph_index; @@ -5674,7 +5677,7 @@ BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar, UINT count, LPWORD if (!pgi) for(c = firstChar; c < firstChar+count; c++) { WineEngGetGlyphOutline(linked_font, c, GGO_METRICS | GGO_GLYPH_INDEX, - &gm, 0, NULL, NULL); + &gm, 0, NULL, &identity); buffer[c - firstChar].abcA = FONT_GM(linked_font,c)->lsb; buffer[c - firstChar].abcB = FONT_GM(linked_font,c)->bbx; buffer[c - firstChar].abcC = FONT_GM(linked_font,c)->adv - FONT_GM(linked_font,c)->lsb @@ -5683,7 +5686,7 @@ BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar, UINT count, LPWORD else for(c = 0; c < count; c++) { WineEngGetGlyphOutline(linked_font, pgi[c], GGO_METRICS | GGO_GLYPH_INDEX, - &gm, 0, NULL, NULL); + &gm, 0, NULL, &identity); buffer[c].abcA = FONT_GM(linked_font,pgi[c])->lsb; buffer[c].abcB = FONT_GM(linked_font,pgi[c])->bbx; buffer[c].abcC = FONT_GM(linked_font,pgi[c])->adv @@ -5701,6 +5704,7 @@ BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar, UINT count, LPWORD BOOL WineEngGetTextExtentExPoint(GdiFont *font, LPCWSTR wstr, INT count, INT max_ext, LPINT pnfit, LPINT dxs, LPSIZE size) { + static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} }; INT idx; INT nfit = 0, ext; GLYPHMETRICS gm; @@ -5721,7 +5725,7 @@ BOOL WineEngGetTextExtentExPoint(GdiFont *font, LPCWSTR wstr, INT count, for(idx = 0; idx < count; idx++) { get_glyph_index_linked(font, wstr[idx], &linked_font, &glyph_index); WineEngGetGlyphOutline(linked_font, glyph_index, GGO_METRICS | GGO_GLYPH_INDEX, - &gm, 0, NULL, NULL); + &gm, 0, NULL, &identity); size->cx += FONT_GM(linked_font,glyph_index)->adv; ext = size->cx; if (! pnfit || ext <= max_ext) { @@ -5746,6 +5750,7 @@ BOOL WineEngGetTextExtentExPoint(GdiFont *font, LPCWSTR wstr, INT count, BOOL WineEngGetTextExtentExPointI(GdiFont *font, const WORD *indices, INT count, INT max_ext, LPINT pnfit, LPINT dxs, LPSIZE size) { + static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} }; INT idx; INT nfit = 0, ext; GLYPHMETRICS gm; @@ -5763,7 +5768,7 @@ BOOL WineEngGetTextExtentExPointI(GdiFont *font, const WORD *indices, INT count, for(idx = 0; idx < count; idx++) { WineEngGetGlyphOutline(font, indices[idx], GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, - NULL); + &identity); size->cx += FONT_GM(font,indices[idx])->adv; ext = size->cx; if (! pnfit || ext <= max_ext) { diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 0aa9af6..38339ea 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -2477,6 +2477,61 @@ static void test_orientation(void) DeleteDC(hdc); } +static void test_GetGlyphOutline(void) +{ + MAT2 mat = { {0,1}, {0,0}, {0,0}, {0,1} }; + HDC hdc; + GLYPHMETRICS gm; + LOGFONTA lf; + HFONT hfont, old_hfont; + INT ret; + + if (!is_truetype_font_installed("Tahoma")) + { + skip("Tahoma is not installed\n"); + return; + } + + hdc = CreateCompatibleDC(0); + memset(&lf, 0, sizeof(lf)); + lf.lfHeight = 72; + lstrcpyA(lf.lfFaceName, "Tahoma"); + SetLastError(0xdeadbeef); + hfont = CreateFontIndirectA(&lf); + ok(hfont != 0, "CreateFontIndirectA error %u\n", GetLastError()); + old_hfont = SelectObject(hdc, hfont); + + memset(&gm, 0, sizeof(gm)); + SetLastError(0xdeadbeef); + ret = GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat); + ok(ret != GDI_ERROR, "GetGlyphOutlineA error %u\n", GetLastError()); + + memset(&gm, 0, sizeof(gm)); + SetLastError(0xdeadbeef); + ret = GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, NULL); + ok(ret == GDI_ERROR, "GetGlyphOutlineA should fail\n"); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", GetLastError()); + + memset(&gm, 0, sizeof(gm)); + SetLastError(0xdeadbeef); + ret = GetGlyphOutlineW(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat); + if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) + ok(ret != GDI_ERROR, "GetGlyphOutlineW error %u\n", GetLastError()); + + memset(&gm, 0, sizeof(gm)); + SetLastError(0xdeadbeef); + ret = GetGlyphOutlineW(hdc, 'A', GGO_METRICS, &gm, 0, NULL, NULL); + if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) + { + ok(ret == GDI_ERROR, "GetGlyphOutlineW should fail\n"); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", GetLastError()); + } + + SelectObject(hdc, old_hfont); + DeleteObject(hfont); + DeleteDC(hdc); +} + START_TEST(font) { init(); @@ -2514,4 +2569,5 @@ START_TEST(font) test_GetTextMetrics(); test_GdiRealizationInfo(); test_GetTextFace(); + test_GetGlyphOutline(); }
1
0
0
0
Dmitry Timoshkov : gdi32: The MAT2 parameter of GetGlyphOutline is mandatory.
by Alexandre Julliard
03 Feb '09
03 Feb '09
Module: wine Branch: master Commit: 44589c6f8fdf511f4131da4d488204f1aef41c4f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=44589c6f8fdf511f4131da4d4…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Tue Feb 3 17:55:05 2009 +0800 gdi32: The MAT2 parameter of GetGlyphOutline is mandatory. --- dlls/gdi32/gdi16.c | 15 +++++++++------ dlls/gdi32/path.c | 5 +++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/dlls/gdi32/gdi16.c b/dlls/gdi32/gdi16.c index b70b44e..1d0344b 100644 --- a/dlls/gdi32/gdi16.c +++ b/dlls/gdi32/gdi16.c @@ -1983,12 +1983,15 @@ DWORD WINAPI GetGlyphOutline16( HDC16 hdc, UINT16 uChar, UINT16 fuFormat, GLYPHMETRICS gm32; ret = GetGlyphOutlineA( HDC_32(hdc), uChar, fuFormat, &gm32, cbBuffer, lpBuffer, lpmat2); - lpgm->gmBlackBoxX = gm32.gmBlackBoxX; - lpgm->gmBlackBoxY = gm32.gmBlackBoxY; - lpgm->gmptGlyphOrigin.x = gm32.gmptGlyphOrigin.x; - lpgm->gmptGlyphOrigin.y = gm32.gmptGlyphOrigin.y; - lpgm->gmCellIncX = gm32.gmCellIncX; - lpgm->gmCellIncY = gm32.gmCellIncY; + if (ret && ret != GDI_ERROR) + { + lpgm->gmBlackBoxX = gm32.gmBlackBoxX; + lpgm->gmBlackBoxY = gm32.gmBlackBoxY; + lpgm->gmptGlyphOrigin.x = gm32.gmptGlyphOrigin.x; + lpgm->gmptGlyphOrigin.y = gm32.gmptGlyphOrigin.y; + lpgm->gmCellIncX = gm32.gmCellIncX; + lpgm->gmCellIncY = gm32.gmCellIncY; + } return ret; } diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c index 8df8a1b..3ad551e 100644 --- a/dlls/gdi32/path.c +++ b/dlls/gdi32/path.c @@ -1454,17 +1454,18 @@ BOOL PATH_ExtTextOut(DC *dc, INT x, INT y, UINT flags, const RECT *lprc, for (idx = 0; idx < count; idx++) { + static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} }; GLYPHMETRICS gm; DWORD dwSize; void *outline; - dwSize = GetGlyphOutlineW(hdc, str[idx], GGO_GLYPH_INDEX | GGO_NATIVE, &gm, 0, NULL, NULL); + dwSize = GetGlyphOutlineW(hdc, str[idx], GGO_GLYPH_INDEX | GGO_NATIVE, &gm, 0, NULL, &identity); if (!dwSize) return FALSE; outline = HeapAlloc(GetProcessHeap(), 0, dwSize); if (!outline) return FALSE; - GetGlyphOutlineW(hdc, str[idx], GGO_GLYPH_INDEX | GGO_NATIVE, &gm, dwSize, outline, NULL); + GetGlyphOutlineW(hdc, str[idx], GGO_GLYPH_INDEX | GGO_NATIVE, &gm, dwSize, outline, &identity); PATH_add_outline(dc, org.x + x + xoff, org.x + y + yoff, outline, dwSize);
1
0
0
0
Dmitry Timoshkov : wineps.drv: The MAT2 parameter of GetGlyphOutline is mandatory.
by Alexandre Julliard
03 Feb '09
03 Feb '09
Module: wine Branch: master Commit: ba660a47ce3c64412f44172c58b466e345d3fec3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ba660a47ce3c64412f44172c5…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Tue Feb 3 17:54:56 2009 +0800 wineps.drv: The MAT2 parameter of GetGlyphOutline is mandatory. --- dlls/wineps.drv/type1.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/wineps.drv/type1.c b/dlls/wineps.drv/type1.c index fe8c8ba..f82fc08 100644 --- a/dlls/wineps.drv/type1.c +++ b/dlls/wineps.drv/type1.c @@ -192,7 +192,7 @@ BOOL T1_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index, TTPOLYCURVE *ppc; LOGFONTW lf; RECT rc; - + static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} }; static const char glyph_def_begin[] = "/%s findfont dup\n" "/Private get begin\n" @@ -226,11 +226,11 @@ BOOL T1_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index, unscaled_font = CreateFontIndirectW(&lf); old_font = SelectObject(physDev->hdc, unscaled_font); len = GetGlyphOutlineW(physDev->hdc, index, GGO_GLYPH_INDEX | GGO_BEZIER, - &gm, 0, NULL, NULL); + &gm, 0, NULL, &identity); if(len == GDI_ERROR) return FALSE; glyph_buf = HeapAlloc(GetProcessHeap(), 0, len); GetGlyphOutlineW(physDev->hdc, index, GGO_GLYPH_INDEX | GGO_BEZIER, - &gm, len, glyph_buf, NULL); + &gm, len, glyph_buf, &identity); SelectObject(physDev->hdc, old_font); DeleteObject(unscaled_font);
1
0
0
0
← Newer
1
...
86
87
88
89
90
91
92
...
97
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
Results per page:
10
25
50
100
200