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
August 2008
----- 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
839 discussions
Start a n
N
ew thread
Adam Petaccia : gdiplus: Implement GdipCreateRegionRect.
by Alexandre Julliard
05 Aug '08
05 Aug '08
Module: wine Branch: master Commit: d215b4744ba09f49aa0d180e1a23782bcebfd871 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d215b4744ba09f49aa0d180e1…
Author: Adam Petaccia <adam(a)tpetaccia.com> Date: Mon Aug 4 13:56:37 2008 -0400 gdiplus: Implement GdipCreateRegionRect. --- dlls/gdiplus/region.c | 26 ++++++++++++++++++++++---- 1 files changed, 22 insertions(+), 4 deletions(-) diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index e2be5f5..64ac9a5 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -332,12 +332,30 @@ GpStatus WINGDIPAPI GdipCreateRegionPath(GpPath *path, GpRegion **region) return Ok; } -GpStatus WINGDIPAPI GdipCreateRegionRect(GDIPCONST GpRectF *rect, GpRegion **region) +GpStatus WINGDIPAPI GdipCreateRegionRect(GDIPCONST GpRectF *rect, + GpRegion **region) { - FIXME("(%p, %p): stub\n", rect, region); + GpStatus stat; - *region = NULL; - return NotImplemented; + TRACE("%p, %p\n", rect, region); + + if (!(rect && region)) + return InvalidParameter; + + *region = GdipAlloc(sizeof(GpRegion)); + stat = init_region(*region, RegionDataRect); + if(stat != Ok) + { + GdipDeleteRegion(*region); + return stat; + } + + (*region)->node.elementdata.rect.X = rect->X; + (*region)->node.elementdata.rect.Y = rect->Y; + (*region)->node.elementdata.rect.Width = rect->Width; + (*region)->node.elementdata.rect.Height = rect->Height; + + return Ok; } GpStatus WINGDIPAPI GdipCreateRegionRectI(GDIPCONST GpRect *rect, GpRegion **region)
1
0
0
0
Adam Petaccia : gdiplus: Implement GdipCreateRegionPath.
by Alexandre Julliard
05 Aug '08
05 Aug '08
Module: wine Branch: master Commit: af74f4d04274fa550de6fa86439995525c723b5a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=af74f4d04274fa550de6fa864…
Author: Adam Petaccia <adam(a)tpetaccia.com> Date: Mon Aug 4 13:56:33 2008 -0400 gdiplus: Implement GdipCreateRegionPath. --- dlls/gdiplus/region.c | 116 +++++++++++++++++++++++++++++++++++++++++- dlls/gdiplus/tests/region.c | 33 +++---------- 2 files changed, 120 insertions(+), 29 deletions(-) diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index 69d31f2..e2be5f5 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -214,12 +214,122 @@ GpStatus WINGDIPAPI GdipCreateRegion(GpRegion **region) return init_region(*region, RegionDataInfiniteRect); } +/***************************************************************************** + * GdipCreateRegionPath [GDIPLUS.@] + * + * Creates a GpRegion from a GpPath + * + * PARAMS + * path [I] path to base the region on + * region [O] pointer to the newly allocated region + * + * RETURNS + * SUCCESS: Ok + * FAILURE: InvalidParameter + * + * NOTES + * If a path has no floating point points, its points will be stored as shorts + * (INTPATH) + * + * If a path is empty, it is considered to be an INTPATH + */ GpStatus WINGDIPAPI GdipCreateRegionPath(GpPath *path, GpRegion **region) { - FIXME("(%p, %p): stub\n", path, region); + region_element* element; + GpPoint *pointsi; + GpPointF *pointsf; - *region = NULL; - return NotImplemented; + GpStatus stat; + DWORD flags = FLAGS_INTPATH; + INT count, i; + + TRACE("%p, %p\n", path, region); + + if (!(path && region)) + return InvalidParameter; + + *region = GdipAlloc(sizeof(GpRegion)); + if(!*region) + return OutOfMemory; + stat = init_region(*region, RegionDataPath); + if (stat != Ok) + { + GdipDeleteRegion(*region); + return stat; + } + element = &(*region)->node; + count = path->pathdata.Count; + + /* Test to see if the path is an Integer path */ + if (count) + { + pointsi = GdipAlloc(sizeof(GpPoint) * count); + pointsf = GdipAlloc(sizeof(GpPointF) * count); + if (!(pointsi && pointsf)) + { + GdipFree(pointsi); + GdipFree(pointsf); + GdipDeleteRegion(*region); + return OutOfMemory; + } + + stat = GdipGetPathPointsI(path, pointsi, count); + if (stat != Ok) + { + GdipDeleteRegion(*region); + return stat; + } + stat = GdipGetPathPoints(path, pointsf, count); + if (stat != Ok) + { + GdipDeleteRegion(*region); + return stat; + } + + for (i = 0; i < count; i++) + { + if (!(pointsi[i].X == pointsf[i].X && + pointsi[i].Y == pointsf[i].Y )) + { + flags = FLAGS_NOFLAGS; + break; + } + } + GdipFree(pointsi); + GdipFree(pointsf); + } + + stat = GdipClonePath(path, &element->elementdata.pathdata.path); + if (stat != Ok) + { + GdipDeleteRegion(*region); + return stat; + } + + /* 3 for headers, once again size doesn't count itself */ + element->elementdata.pathdata.pathheader.size = ((sizeof(DWORD) * 3)); + switch(flags) + { + /* Floats, sent out as floats */ + case FLAGS_NOFLAGS: + element->elementdata.pathdata.pathheader.size += + (sizeof(DWORD) * count * 2); + break; + /* INTs, sent out as packed shorts */ + case FLAGS_INTPATH: + element->elementdata.pathdata.pathheader.size += + (sizeof(DWORD) * count); + break; + default: + FIXME("Unhandled flags (%08x). Expect wrong results.\n", flags); + } + element->elementdata.pathdata.pathheader.size += get_pathtypes_size(path); + element->elementdata.pathdata.pathheader.magic = VERSION_MAGIC; + element->elementdata.pathdata.pathheader.count = count; + element->elementdata.pathdata.pathheader.flags = flags; + (*region)->header.size = sizeheader_size + get_element_size(element); + + return Ok; } GpStatus WINGDIPAPI GdipCreateRegionRect(GDIPCONST GpRectF *rect, GpRegion **region) diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c index 01991a2..17a4ba4 100644 --- a/dlls/gdiplus/tests/region.c +++ b/dlls/gdiplus/tests/region.c @@ -172,6 +172,7 @@ todo_wine rect.Width = 22; rect.Height = 55; status = GdipCombineRegionRectI(region, &rect, CombineModeExclude); +todo_wine ok(status == Ok, "status %08x\n", status); status = GdipGetRegionDataSize(region, &needed); @@ -233,8 +234,6 @@ todo_wine status = GdipCreatePath(FillModeAlternate, &path); ok(status == Ok, "status %08x\n", status); -todo_wine -{ GdipAddPathRectangle(path, 12.5, 13.0, 14.0, 15.0); status = GdipCreateRegionPath(path, ®ion); @@ -247,11 +246,8 @@ todo_wine expect(72, needed); expect_dword(buf, 64); trace("buf[1] = %08x\n", buf[1]); -} expect_magic((DWORD*)(buf + 2)); expect_dword(buf + 3, 0); -todo_wine -{ expect_dword(buf + 4, RGNDATA_PATH); expect_dword(buf + 5, 0x00000030); expect_magic((DWORD*)(buf + 6)); @@ -273,12 +269,16 @@ todo_wine rect.Width = 10; rect.Height = 20; status = GdipCombineRegionRectI(region, &rect, CombineModeIntersect); +todo_wine ok(status == Ok, "status %08x\n", status); status = GdipGetRegionDataSize(region, &needed); ok(status == Ok, "status %08x\n", status); +todo_wine expect(96, needed); status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); ok(status == Ok, "status %08x\n", status); +todo_wine +{ expect(96, needed); expect_dword(buf, 88); trace("buf[1] = %08x\n", buf[1]); @@ -307,18 +307,16 @@ todo_wine expect_float(buf + 21, 30.0); expect_float(buf + 22, 10.0); expect_float(buf + 23, 20.0); +} status = GdipDeleteRegion(region); ok(status == Ok, "status %08x\n", status); -} status = GdipDeletePath(path); ok(status == Ok, "status %08x\n", status); /* Test an empty path */ status = GdipCreatePath(FillModeAlternate, &path); expect(Ok, status); -todo_wine -{ status = GdipCreateRegionPath(path, ®ion); expect(Ok, status); status = GdipGetRegionDataSize(region, &needed); @@ -329,11 +327,8 @@ todo_wine expect(36, needed); expect_dword(buf, 28); trace("buf[1] = %08x\n", buf[1]); -} expect_magic((DWORD*)(buf + 2)); expect_dword(buf + 3, 0); -todo_wine -{ expect_dword(buf + 4, RGNDATA_PATH); /* Second signature for pathdata */ @@ -344,7 +339,6 @@ todo_wine status = GdipDeleteRegion(region); expect(Ok, status); -} /* Test a simple triangle of INTs */ status = GdipAddPathLine(path, 5, 6, 7, 8); @@ -353,8 +347,6 @@ todo_wine expect(Ok, status); status = GdipClosePathFigure(path); expect(Ok, status); -todo_wine -{ status = GdipCreateRegionPath(path, ®ion); expect(Ok, status); status = GdipGetRegionDataSize(region, &needed); @@ -364,12 +356,9 @@ todo_wine expect(Ok, status); expect(56, needed); expect_dword(buf, 48); -} trace("buf[1] = %08x\n", buf[1]); expect_magic((DWORD*)(buf + 2)); expect_dword(buf + 3 , 0); -todo_wine -{ expect_dword(buf + 4 , RGNDATA_PATH); expect_dword(buf + 5, 32); @@ -387,11 +376,10 @@ todo_wine expect(5, point[3].X); /* buf + 12 */ expect(6, point[3].Y); expect_dword(buf + 13, 0x81010100); /* 0x01010100 if we don't close the path */ -} + status = GdipDeletePath(path); expect(Ok, status); status = GdipDeleteRegion(region); -todo_wine expect(Ok, status); /* Test a floating-point triangle */ @@ -402,8 +390,6 @@ todo_wine status = GdipAddPathLine(path, 8.1, 1.6, 5.6, 6.2); expect(Ok, status); status = GdipCreateRegionPath(path, ®ion); -todo_wine -{ expect(Ok, status); status = GdipGetRegionDataSize(region, &needed); expect(Ok, status); @@ -413,11 +399,8 @@ todo_wine expect(72, needed); expect_dword(buf, 64); trace("buf[1] = %08x\n", buf[1]); -} expect_magic((DWORD*)(buf + 2)); expect_dword(buf + 3, 0); -todo_wine -{ expect_dword(buf + 4, RGNDATA_PATH); expect_dword(buf + 5, 48); @@ -432,12 +415,10 @@ todo_wine expect_float(buf + 14, 1.6); expect_float(buf + 15, 5.6); expect_float(buf + 16, 6.2); -} status = GdipDeletePath(path); expect(Ok, status); status = GdipDeleteRegion(region); -todo_wine expect(Ok, status); }
1
0
0
0
Adam Petaccia : gdiplus: Implement GdipGetRegionData.
by Alexandre Julliard
05 Aug '08
05 Aug '08
Module: wine Branch: master Commit: f52c211ac38eafe4369f23e15b1c82f64577d49f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f52c211ac38eafe4369f23e15…
Author: Adam Petaccia <adam(a)tpetaccia.com> Date: Mon Aug 4 13:56:25 2008 -0400 gdiplus: Implement GdipGetRegionData. --- dlls/gdiplus/region.c | 163 ++++++++++++++++++++++++++++++++++++++++++- dlls/gdiplus/tests/region.c | 39 ++++++----- 2 files changed, 182 insertions(+), 20 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=f52c211ac38eafe4369f2…
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipAddPathPie/ GdipAddPathPieI with test.
by Alexandre Julliard
05 Aug '08
05 Aug '08
Module: wine Branch: master Commit: aa0df2300e833a7037577036f6b4c3ba6dc1df66 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aa0df2300e833a7037577036f…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Mon Aug 4 21:45:16 2008 +0400 gdiplus: Implemented GdipAddPathPie/GdipAddPathPieI with test. --- dlls/gdiplus/gdiplus.spec | 4 +- dlls/gdiplus/graphicspath.c | 51 +++++++++++++++++++++++++++++++++++++ dlls/gdiplus/tests/graphicspath.c | 27 +++++++++++++++++++ include/gdiplusflat.h | 2 + 4 files changed, 82 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index add7b0e..57f9734 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -21,8 +21,8 @@ @ stdcall GdipAddPathLine(ptr long long long long) @ stdcall GdipAddPathLineI(ptr long long long long) @ stdcall GdipAddPathPath(ptr ptr long) -@ stub GdipAddPathPie -@ stub GdipAddPathPieI +@ stdcall GdipAddPathPie(ptr long long long long long long) +@ stdcall GdipAddPathPieI(ptr long long long long long long) @ stdcall GdipAddPathPolygon(ptr ptr long) @ stdcall GdipAddPathPolygonI(ptr ptr long) @ stdcall GdipAddPathRectangle(ptr long long long long) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index c5925b6..51407c7 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -546,6 +546,57 @@ GpStatus WINGDIPAPI GdipAddPathPath(GpPath *path, GDIPCONST GpPath* addingPath, return Ok; } +GpStatus WINGDIPAPI GdipAddPathPie(GpPath *path, REAL x, REAL y, REAL width, REAL height, + REAL startAngle, REAL sweepAngle) +{ + GpPointF *ptf; + GpStatus status; + INT i, count; + + if(!path) + return InvalidParameter; + + count = arc2polybezier(NULL, x, y, width, height, startAngle, sweepAngle); + + if(count == 0) + return Ok; + + ptf = GdipAlloc(sizeof(GpPointF)*count); + if(!ptf) + return OutOfMemory; + + arc2polybezier(ptf, x, y, width, height, startAngle, sweepAngle); + + status = GdipAddPathLine(path, (width - x)/2, (height - y)/2, ptf[0].X, ptf[0].Y); + if(status != Ok){ + GdipFree(ptf); + return status; + } + /* one spline is already added as a line endpoint */ + if(!lengthen_path(path, count - 1)){ + GdipFree(ptf); + return OutOfMemory; + } + + memcpy(&(path->pathdata.Points[path->pathdata.Count]), &(ptf[1]),sizeof(GpPointF)*(count-1)); + for(i = 0; i < count-1; i++) + path->pathdata.Types[path->pathdata.Count+i] = PathPointTypeBezier; + + path->pathdata.Count += count-1; + + GdipClosePathFigure(path); + + GdipFree(ptf); + + return status; +} + +GpStatus WINGDIPAPI GdipAddPathPieI(GpPath *path, INT x, INT y, INT width, INT height, + REAL startAngle, REAL sweepAngle) +{ + return GdipAddPathPieI(path, (REAL)x, (REAL)y, (REAL)width, (REAL)height, startAngle, sweepAngle); +} + GpStatus WINGDIPAPI GdipAddPathPolygon(GpPath *path, GDIPCONST GpPointF *points, INT count) { INT old_count; diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 97e92fa..d08b20b 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -856,6 +856,32 @@ static void test_reverse(void) GdipDeletePath(path); } +static path_test_t addpie_path[] = { + {50.0, 25.0, PathPointTypeStart, 0, 0}, /*0*/ + {97.2, 33.3, PathPointTypeLine, 0, 0}, /*1*/ + {91.8, 40.9, PathPointTypeBezier,0, 0}, /*2*/ + {79.4, 46.8, PathPointTypeBezier,0, 0}, /*3*/ + {63.9, 49.0, PathPointTypeBezier | PathPointTypeCloseSubpath, 0, 0} /*4*/ + }; + +static void test_addpie(void) +{ + GpStatus status; + GpPath *path; + + GdipCreatePath(FillModeAlternate, &path); + + /* NULL argument */ + status = GdipAddPathPie(NULL, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + expect(InvalidParameter, status); + + status = GdipAddPathPie(path, 0.0, 0.0, 100.0, 50.0, 10.0, 50.0); + expect(Ok, status); + ok_path(path, addpie_path, sizeof(addpie_path)/sizeof(path_test_t), FALSE); + + GdipDeletePath(path); +} + START_TEST(graphicspath) { struct GdiplusStartupInput gdiplusStartupInput; @@ -882,6 +908,7 @@ START_TEST(graphicspath) test_addcurve(); test_addclosedcurve(); test_reverse(); + test_addpie(); GdiplusShutdown(gdiplusToken); } diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 4203e16..ed88096 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -261,6 +261,8 @@ GpStatus WINGDIPAPI GdipAddPathLine2(GpPath*,GDIPCONST GpPointF*,INT); GpStatus WINGDIPAPI GdipAddPathLine2I(GpPath*,GDIPCONST GpPoint*,INT); GpStatus WINGDIPAPI GdipAddPathLineI(GpPath*,INT,INT,INT,INT); GpStatus WINGDIPAPI GdipAddPathPath(GpPath*,GDIPCONST GpPath*,BOOL); +GpStatus WINGDIPAPI GdipAddPathPie(GpPath*,REAL,REAL,REAL,REAL,REAL,REAL); +GpStatus WINGDIPAPI GdipAddPathPieI(GpPath*,INT,INT,INT,INT,REAL,REAL); GpStatus WINGDIPAPI GdipAddPathPolygon(GpPath*,GDIPCONST GpPointF*,INT); GpStatus WINGDIPAPI GdipAddPathPolygonI(GpPath*,GDIPCONST GpPoint*,INT); GpStatus WINGDIPAPI GdipAddPathRectangle(GpPath*,REAL,REAL,REAL,REAL);
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipReversePath with tests.
by Alexandre Julliard
05 Aug '08
05 Aug '08
Module: wine Branch: master Commit: 5887e661b7a3ead57e3eb7dd31b0068a9c3c8cd9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5887e661b7a3ead57e3eb7dd3…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Mon Aug 4 21:45:05 2008 +0400 gdiplus: Implemented GdipReversePath with tests. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphicspath.c | 54 +++++++++++++++++++++++++++++++++++++ dlls/gdiplus/tests/graphicspath.c | 44 ++++++++++++++++++++++++++++++ include/gdiplusflat.h | 1 + 4 files changed, 100 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 18e7eeb..add7b0e 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -484,7 +484,7 @@ @ stub GdipResetTextureTransform @ stub GdipResetWorldTransform @ stdcall GdipRestoreGraphics(ptr long) -@ stub GdipReversePath +@ stdcall GdipReversePath(ptr) @ stub GdipRotateLineTransform @ stdcall GdipRotateMatrix(ptr long long) @ stub GdipRotatePathGradientTransform diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 136afe7..c5925b6 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -927,6 +927,60 @@ GpStatus WINGDIPAPI GdipGetPointCount(GpPath *path, INT *count) return Ok; } +GpStatus WINGDIPAPI GdipReversePath(GpPath* path) +{ + INT i, count; + INT start = 0; /* position in reversed path */ + GpPathData revpath; + + if(!path) + return InvalidParameter; + + count = path->pathdata.Count; + + if(count == 0) return Ok; + + revpath.Points = GdipAlloc(sizeof(GpPointF)*count); + revpath.Types = GdipAlloc(sizeof(BYTE)*count); + revpath.Count = count; + if(!revpath.Points || !revpath.Types){ + GdipFree(revpath.Points); + GdipFree(revpath.Types); + return OutOfMemory; + } + + for(i = 0; i < count; i++){ + + /* find next start point */ + if(path->pathdata.Types[count-i-1] == PathPointTypeStart){ + INT j; + for(j = start; j <= i; j++){ + revpath.Points[j] = path->pathdata.Points[count-j-1]; + revpath.Types[j] = path->pathdata.Types[count-j-1]; + } + /* mark start point */ + revpath.Types[start] = PathPointTypeStart; + /* set 'figure' endpoint type */ + if(i-start > 1){ + revpath.Types[i] = path->pathdata.Types[count-start-1] & ~PathPointTypePathTypeMask; + revpath.Types[i] |= revpath.Types[i-1]; + } + else + revpath.Types[i] = path->pathdata.Types[start]; + + start = i+1; + } + } + + memcpy(path->pathdata.Points, revpath.Points, sizeof(GpPointF)*count); + memcpy(path->pathdata.Types, revpath.Types, sizeof(BYTE)*count); + + GdipFree(revpath.Points); + GdipFree(revpath.Types); + + return Ok; +} + GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPointI(GpPath* path, INT x, INT y, GpPen *pen, GpGraphics *graphics, BOOL *result) { diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index eb7e2de..97e92fa 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -813,6 +813,49 @@ static void test_addclosedcurve(void) GdipDeletePath(path); } +static path_test_t reverse_path[] = { + {0.0, 20.0, PathPointTypeStart, 0, 0}, /*0*/ + {25.0, 25.0, PathPointTypeLine, 0, 0}, /*1*/ + {0.0, 30.0, PathPointTypeLine, 0, 0}, /*2*/ + {15.0, 35.0, PathPointTypeStart, 0, 0}, /*3*/ + {0.0, 40.0, PathPointTypeLine, 0, 0}, /*4*/ + {5.0, 45.0, PathPointTypeLine, 0, 0}, /*5*/ + {0.0, 50.0, PathPointTypeLine | PathPointTypeCloseSubpath, 0, 0} /*6*/ + }; + +static void test_reverse(void) +{ + GpStatus status; + GpPath *path; + GpPointF pts[7]; + INT i; + + for(i = 0; i < 7; i++){ + pts[i].X = i * 5.0 * (REAL)(i % 2); + pts[i].Y = 50.0 - i * 5.0; + } + + GdipCreatePath(FillModeAlternate, &path); + + /* NULL argument */ + status = GdipReversePath(NULL); + expect(InvalidParameter, status); + + /* empty path */ + status = GdipReversePath(path); + expect(Ok, status); + + GdipAddPathLine2(path, pts, 4); + GdipClosePathFigure(path); + GdipAddPathLine2(path, &(pts[4]), 3); + + status = GdipReversePath(path); + expect(Ok, status); + ok_path(path, reverse_path, sizeof(reverse_path)/sizeof(path_test_t), FALSE); + + GdipDeletePath(path); +} + START_TEST(graphicspath) { struct GdiplusStartupInput gdiplusStartupInput; @@ -838,6 +881,7 @@ START_TEST(graphicspath) test_lastpoint(); test_addcurve(); test_addclosedcurve(); + test_reverse(); GdiplusShutdown(gdiplusToken); } diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index dc938ac..4203e16 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -291,6 +291,7 @@ GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPointI(GpPath*,INT,INT,GpPen*, GpStatus WINGDIPAPI GdipIsVisiblePathPoint(GpPath*,REAL,REAL,GpGraphics*,BOOL*); GpStatus WINGDIPAPI GdipIsVisiblePathPointI(GpPath*,INT,INT,GpGraphics*,BOOL*); GpStatus WINGDIPAPI GdipResetPath(GpPath*); +GpStatus WINGDIPAPI GdipReversePath(GpPath*); GpStatus WINGDIPAPI GdipSetPathFillMode(GpPath*,GpFillMode); GpStatus WINGDIPAPI GdipStartPathFigure(GpPath*); GpStatus WINGDIPAPI GdipTransformPath(GpPath*,GpMatrix*);
1
0
0
0
Juan Lang : crypt32: Use CryptSIPRetrieveSubjectGuid to determine how to read a message object from a file , rather than assuming the source file is always a PE executable.
by Alexandre Julliard
05 Aug '08
05 Aug '08
Module: wine Branch: master Commit: 10f23fa7f5a8319de556817f106f7bd227a8d42f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=10f23fa7f5a8319de556817f1…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Aug 4 22:04:10 2008 -0700 crypt32: Use CryptSIPRetrieveSubjectGuid to determine how to read a message object from a file, rather than assuming the source file is always a PE executable. --- dlls/crypt32/Makefile.in | 1 - dlls/crypt32/object.c | 62 +++++++++++++++++++++++++++++++++------------ 2 files changed, 45 insertions(+), 18 deletions(-) diff --git a/dlls/crypt32/Makefile.in b/dlls/crypt32/Makefile.in index 441efc4..16fbd5e 100644 --- a/dlls/crypt32/Makefile.in +++ b/dlls/crypt32/Makefile.in @@ -6,7 +6,6 @@ VPATH = @srcdir@ MODULE = crypt32.dll IMPORTLIB = crypt32 IMPORTS = user32 advapi32 kernel32 ntdll -DELAYIMPORTS = imagehlp C_SRCS = \ base64.c \ diff --git a/dlls/crypt32/object.c b/dlls/crypt32/object.c index 3eb8988..05a6c5f 100644 --- a/dlls/crypt32/object.c +++ b/dlls/crypt32/object.c @@ -21,7 +21,7 @@ #include "windef.h" #include "winbase.h" #include "wincrypt.h" -#include "imagehlp.h" +#include "mssip.h" #include "crypt32_private.h" #include "wine/debug.h" @@ -400,8 +400,11 @@ static BOOL CRYPT_QueryEmbeddedMessageObject(DWORD dwObjectType, HCERTSTORE *phCertStore, HCRYPTMSG *phMsg) { HANDLE file; + GUID subject; BOOL ret = FALSE; + TRACE("%s\n", debugstr_w((LPCWSTR)pvObject)); + if (dwObjectType != CERT_QUERY_OBJECT_FILE) { FIXME("don't know what to do for type %d embedded signed messages\n", @@ -413,28 +416,53 @@ static BOOL CRYPT_QueryEmbeddedMessageObject(DWORD dwObjectType, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (file != INVALID_HANDLE_VALUE) { - DWORD len = 0; - - ret = ImageGetCertificateData(file, 0, NULL, &len); - if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + ret = CryptSIPRetrieveSubjectGuid((LPCWSTR)pvObject, file, &subject); + if (ret) { - WIN_CERTIFICATE *winCert = HeapAlloc(GetProcessHeap(), 0, len); + SIP_DISPATCH_INFO sip; - if (winCert) + memset(&sip, 0, sizeof(sip)); + sip.cbSize = sizeof(sip); + ret = CryptSIPLoad(&subject, 0, &sip); + if (ret) { - ret = ImageGetCertificateData(file, 0, winCert, &len); + SIP_SUBJECTINFO subjectInfo; + CERT_BLOB blob; + DWORD encodingType; + + memset(&subjectInfo, 0, sizeof(subjectInfo)); + subjectInfo.cbSize = sizeof(subjectInfo); + subjectInfo.pgSubjectType = &subject; + subjectInfo.hFile = file; + subjectInfo.pwsFileName = (LPCWSTR)pvObject; + ret = sip.pfGet(&subjectInfo, &encodingType, 0, &blob.cbData, + NULL); if (ret) { - CERT_BLOB blob = { winCert->dwLength, - winCert->bCertificate }; - - ret = CRYPT_QueryMessageObject(CERT_QUERY_OBJECT_BLOB, - &blob, CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED, - pdwMsgAndCertEncodingType, NULL, phCertStore, phMsg); - if (ret && pdwContentType) - *pdwContentType = CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED; + blob.pbData = CryptMemAlloc(blob.cbData); + if (blob.pbData) + { + ret = sip.pfGet(&subjectInfo, &encodingType, 0, + &blob.cbData, blob.pbData); + if (ret) + { + ret = CRYPT_QueryMessageObject( + CERT_QUERY_OBJECT_BLOB, &blob, + CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED, + pdwMsgAndCertEncodingType, NULL, phCertStore, + phMsg); + if (ret && pdwContentType) + *pdwContentType = + CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED; + } + CryptMemFree(blob.pbData); + } + else + { + SetLastError(ERROR_OUTOFMEMORY); + ret = FALSE; + } } - HeapFree(GetProcessHeap(), 0, winCert); } } CloseHandle(file);
1
0
0
0
James Hawkins : advpack: Skip the TranslateInfEx tests in win9x.
by Alexandre Julliard
05 Aug '08
05 Aug '08
Module: wine Branch: master Commit: 0dcdbcd3cc087d82d140c3fcf054a701517c3b7b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0dcdbcd3cc087d82d140c3fcf…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Mon Aug 4 17:52:01 2008 -0500 advpack: Skip the TranslateInfEx tests in win9x. --- dlls/advpack/tests/advpack.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/dlls/advpack/tests/advpack.c b/dlls/advpack/tests/advpack.c index eeb35c6..58038f7 100644 --- a/dlls/advpack/tests/advpack.c +++ b/dlls/advpack/tests/advpack.c @@ -325,6 +325,13 @@ static void translateinfstringex_test(void) char buffer[MAX_PATH]; DWORD size = MAX_PATH; + hr = pOpenINFEngine(inf_file, NULL, 0, &hinf, NULL); + if (hr == E_UNEXPECTED) + { + skip("Skipping tests on win9x because of brokenness\n"); + return; + } + create_inf_file(); /* need to see if there are any flags */
1
0
0
0
Reece Dunn : shlwapi: Fixed the string tests on Vista.
by Alexandre Julliard
05 Aug '08
05 Aug '08
Module: wine Branch: master Commit: aa584f146a45b631d046154dd0bd060cd77f0415 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aa584f146a45b631d046154dd…
Author: Reece Dunn <msclrhd(a)googlemail.com> Date: Mon Aug 4 09:26:06 2008 +0100 shlwapi: Fixed the string tests on Vista. --- dlls/shlwapi/tests/string.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dlls/shlwapi/tests/string.c b/dlls/shlwapi/tests/string.c index 79a645c..0875221 100644 --- a/dlls/shlwapi/tests/string.c +++ b/dlls/shlwapi/tests/string.c @@ -35,6 +35,11 @@ ok(ret == val, "Unexpected value of '" #expr "': " #fmt " instead of " #val "\n", ret); \ } while (0); +#define expect_eq2(expr, val1, val2, type, fmt) do { \ + type ret = expr; \ + ok(ret == val1 || ret == val2, "Unexpected value of '" #expr "': " #fmt " instead of " #val1 " or " #val2 "\n", ret); \ +} while (0); + static BOOL (WINAPI *pIntlStrEqWorkerA)(BOOL,LPCSTR,LPCSTR,int); static BOOL (WINAPI *pIntlStrEqWorkerW)(BOOL,LPCWSTR,LPCWSTR,int); static DWORD (WINAPI *pSHAnsiToAnsi)(LPCSTR,LPSTR,int); @@ -850,7 +855,7 @@ static void test_StrXXX_overflows(void) memset(wbuf, 0xbf, sizeof(wbuf)); strret.uType = STRRET_WSTR; U(strret).pOleStr = StrDupW(wstr1); - expect_eq(pStrRetToBufW(&strret, NULL, wbuf, 10), S_OK, HRESULT, "%x"); + expect_eq2(pStrRetToBufW(&strret, NULL, wbuf, 10), S_OK, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) /* Vista */, HRESULT, "%x"); expect_eq(wbuf[9], 0, WCHAR, "%x"); expect_eq(wbuf[10], (WCHAR)0xbfbf, WCHAR, "%x"); } @@ -862,7 +867,7 @@ static void test_StrXXX_overflows(void) memset(buf, 0xbf, sizeof(buf)); strret.uType = STRRET_CSTR; StrCpyN(U(strret).cStr, str1, MAX_PATH); - expect_eq(pStrRetToBufA(&strret, NULL, buf, 10), S_OK, HRESULT, "%x"); + expect_eq2(pStrRetToBufA(&strret, NULL, buf, 10), S_OK, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) /* Vista */, HRESULT, "%x"); expect_eq(buf[9], 0, CHAR, "%x"); expect_eq(buf[10], (CHAR)0xbf, CHAR, "%x"); } @@ -873,7 +878,7 @@ static void test_StrXXX_overflows(void) { memset(buf, 0xbf, sizeof(buf)); ret = pwnsprintfA(buf, 10, "%s", str1); - todo_wine ok(ret == 9, "Unexpected wsnprintfA return %d, expected 9\n", ret); + ok(broken(ret == 9) || ret == -1 /* Vista */, "Unexpected wsnprintfA return %d, expected 9 or -1\n", ret); expect_eq(buf[9], 0, CHAR, "%x"); expect_eq(buf[10], (CHAR)0xbf, CHAR, "%x"); } @@ -884,7 +889,7 @@ static void test_StrXXX_overflows(void) { memset(wbuf, 0xbf, sizeof(wbuf)); ret = pwnsprintfW(wbuf, 10, fmt, wstr1); - todo_wine ok(ret == 9, "Unexpected wsnprintfW return %d, expected 9\n", ret); + ok(broken(ret == 9) || ret == -1 /* Vista */, "Unexpected wsnprintfW return %d, expected 9 or -1\n", ret); expect_eq(wbuf[9], 0, WCHAR, "%x"); expect_eq(wbuf[10], (WCHAR)0xbfbf, WCHAR, "%x"); }
1
0
0
0
Dan Kegel : shell32/tests: Test whether SHGetFileInfo should clear hIcon.
by Alexandre Julliard
05 Aug '08
05 Aug '08
Module: wine Branch: master Commit: f0864c55eb9713966e78df5297beb3f436261a82 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f0864c55eb9713966e78df529…
Author: Dan Kegel <dank(a)kegel.com> Date: Mon Aug 4 15:19:02 2008 -0700 shell32/tests: Test whether SHGetFileInfo should clear hIcon. --- dlls/shell32/tests/shlfileop.c | 75 ++++++++++++++++++++++++++++++++++++++-- 1 files changed, 72 insertions(+), 3 deletions(-) diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c index 9b5220a..1cedcfb 100644 --- a/dlls/shell32/tests/shlfileop.c +++ b/dlls/shell32/tests/shlfileop.c @@ -154,19 +154,45 @@ static void clean_after_shfo_tests(void) static void test_get_file_info(void) { DWORD rc, rc2; - SHFILEINFO shfi, shfi2; + SHFILEINFOA shfi, shfi2; + SHFILEINFOW shfiw; char notepad[MAX_PATH]; + /* Test whether fields of SHFILEINFOA are always cleared */ + memset(&shfi, 0xcf, sizeof(shfi)); + rc=SHGetFileInfoA("", 0, &shfi, sizeof(shfi), 0); + ok(rc, "SHGetFileInfoA('' | 0) should not fail\n"); + todo_wine ok(shfi.hIcon == 0, "SHGetFileInfoA('' | 0) did not clear hIcon\n"); + todo_wine ok(shfi.szDisplayName[0] == 0, "SHGetFileInfoA('' | 0) did not clear szDisplayName[0]\n"); + todo_wine ok(shfi.szTypeName[0] == 0, "SHGetFileInfoA('' | 0) did not clear szTypeName[0]\n"); + ok(shfi.iIcon == 0xcfcfcfcf, "SHGetFileInfoA('' | 0) should not clear iIcon\n"); + ok(shfi.dwAttributes == 0xcfcfcfcf, "SHGetFileInfoA('' | 0) should not clear dwAttributes\n"); + + /* Test whether fields of SHFILEINFOW are always cleared */ + memset(&shfiw, 0xcf, sizeof(shfiw)); + rc=SHGetFileInfoW(NULL, 0, &shfiw, sizeof(shfiw), 0); + todo_wine ok(!rc, "SHGetFileInfoW(NULL | 0) should fail\n"); + ok(shfiw.hIcon == (HANDLE) 0xcfcfcfcf, "SHGetFileInfoW(NULL | 0) should not clear hIcon\n"); + todo_wine ok(shfiw.szDisplayName[0] == 0xcfcf, "SHGetFileInfoW(NULL | 0) should not clear szDisplayName[0]\n"); + todo_wine ok(shfiw.szTypeName[0] == 0xcfcf, "SHGetFileInfoW(NULL | 0) should not clear szTypeName[0]\n"); + todo_wine ok(shfiw.iIcon == 0xcfcfcfcf, "SHGetFileInfoW(NULL | 0) should not clear iIcon\n"); + ok(shfiw.dwAttributes == 0xcfcfcfcf, "SHGetFileInfoW(NULL | 0) should not clear dwAttributes\n"); + + /* Test some flag combinations that MSDN claims are not allowed, * but which work anyway */ - shfi.dwAttributes=0xdeadbeef; + memset(&shfi, 0xcf, sizeof(shfi)); rc=SHGetFileInfoA("c:\\nonexistent", FILE_ATTRIBUTE_DIRECTORY, &shfi, sizeof(shfi), SHGFI_ATTRIBUTES | SHGFI_USEFILEATTRIBUTES); todo_wine ok(rc, "SHGetFileInfoA(c:\\nonexistent | SHGFI_ATTRIBUTES) failed\n"); if (rc) - ok(shfi.dwAttributes != 0xdeadbeef, "dwFileAttributes is not set\n"); + ok(shfi.dwAttributes != 0xcfcfcfcf, "dwFileAttributes is not set\n"); + todo_wine ok(shfi.hIcon == 0, "SHGetFileInfoA(c:\\nonexistent | SHGFI_ATTRIBUTES) did not clear hIcon\n"); + todo_wine ok(shfi.szDisplayName[0] == 0, "SHGetFileInfoA(c:\\nonexistent | SHGFI_ATTRIBUTES) did not clear szDisplayName[0]\n"); + todo_wine ok(shfi.szTypeName[0] == 0, "SHGetFileInfoA(c:\\nonexistent | SHGFI_ATTRIBUTES) did not clear szTypeName[0]\n"); + ok(shfi.iIcon == 0xcfcfcfcf, "SHGetFileInfoA(c:\\nonexistent | SHGFI_ATTRIBUTES) should not clear iIcon\n"); rc=SHGetFileInfoA("c:\\nonexistent", FILE_ATTRIBUTE_DIRECTORY, &shfi, sizeof(shfi), @@ -230,6 +256,48 @@ static void test_get_file_info(void) } } +static void test_get_file_info_iconlist(void) +{ + /* Test retrieving a handle to the system image list, and + * what that returns for hIcon + */ + HRESULT hr; + HIMAGELIST hSysImageList; + LPITEMIDLIST pidList; + SHFILEINFOA shInfoa; + SHFILEINFOW shInfow; + + hr = SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidList); + if (!SUCCEEDED(hr)) { + skip("can't get desktop pidl\n"); + return; + } + + memset(&shInfoa, 0xcf, sizeof(shInfoa)); + hSysImageList = (HIMAGELIST) SHGetFileInfoA((const char *)pidList, 0, + &shInfoa, sizeof(shInfoa), + SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_PIDL); + ok(hSysImageList != INVALID_HANDLE_VALUE, "Can't get handle for CSIDL_DESKTOP imagelist\n"); + todo_wine ok(shInfoa.hIcon == 0, "SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear hIcon\n"); + todo_wine ok(shInfoa.szTypeName[0] == 0, "SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear szTypeName[0]\n"); + ok(shInfoa.iIcon != 0xcfcfcfcf, "SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should set iIcon\n"); + ok(shInfoa.dwAttributes == 0xcfcfcfcf, "SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should not change dwAttributes\n"); + CloseHandle(hSysImageList); + + memset(&shInfow, 0xcf, sizeof(shInfow)); + hSysImageList = (HIMAGELIST) SHGetFileInfoW((const WCHAR *)pidList, 0, + &shInfow, sizeof(shInfow), + SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_PIDL); + ok(hSysImageList != INVALID_HANDLE_VALUE, "Can't get handle for CSIDL_DESKTOP imagelist\n"); + todo_wine ok(shInfow.hIcon == 0, "SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear hIcon\n"); + ok(shInfow.szTypeName[0] == 0, "SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear szTypeName[0]\n"); + ok(shInfow.iIcon != 0xcfcfcfcf, "SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should set iIcon\n"); + ok(shInfow.dwAttributes == 0xcfcfcfcf, "SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should not change dwAttributes\n"); + CloseHandle(hSysImageList); + + ILFree(pidList); +} + /* puts into the specified buffer file names with current directory. @@ -1447,6 +1515,7 @@ START_TEST(shlfileop) init_shfo_tests(); test_get_file_info(); + test_get_file_info_iconlist(); clean_after_shfo_tests(); init_shfo_tests();
1
0
0
0
Huw Davies : gdi32: Keep track of the number of unique fonts that are created and return this in the second DWORD of the GdiRealizationInfo structure .
by Alexandre Julliard
05 Aug '08
05 Aug '08
Module: wine Branch: master Commit: 29637c14415fc8913eccf7eef145c876421232e8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=29637c14415fc8913eccf7eef…
Author: Huw Davies <daviesh(a)huw-davies-computer.local> Date: Thu Jul 31 16:47:22 2008 +0100 gdi32: Keep track of the number of unique fonts that are created and return this in the second DWORD of the GdiRealizationInfo structure. --- dlls/gdi32/font.c | 22 ++++++---------------- dlls/gdi32/freetype.c | 28 ++++++++++++++++++++++++++-- dlls/gdi32/gdi_private.h | 12 ++++++++++++ 3 files changed, 44 insertions(+), 18 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 013cd2a..1e8cac3 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -3254,14 +3254,6 @@ BOOL WINAPI FontIsLinked(HDC hdc) return ret; } -typedef struct -{ - DWORD flags; /* 1 for bitmap fonts, 3 for scalable fonts */ - DWORD unknown1; /* keeps incrementing - num of fonts that have been created or selected into a dc ?? */ - DWORD unknown2; /* fixed for a given font - looks like it could be the order of the face in the font list or the order - in which the face was first rendered. */ -} realization_info_t; - /************************************************************* * GdiRealizationInfo (GDI32.@) * @@ -3269,14 +3261,12 @@ typedef struct */ BOOL WINAPI GdiRealizationInfo(HDC hdc, realization_info_t *info) { - UINT otm_size; - FIXME("(%p, %p): stub!\n", hdc, info); + DC *dc = get_dc_ptr(hdc); + BOOL ret = FALSE; - info->flags = 1; - otm_size = GetOutlineTextMetricsW(hdc, 0, NULL); - if(otm_size) info->flags |= 2; /* scalable */ + if (!dc) return FALSE; + if (dc->gdiFont) ret = WineEngRealizationInfo(dc->gdiFont, info); + release_dc_ptr(dc); - info->unknown1 = -1; - info->unknown2 = -1; - return TRUE; + return ret; } diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index a2110ab..bb3c7d3 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -335,6 +335,7 @@ struct tagGdiFont { FONTSIGNATURE fs; GdiFont *base_font; VOID *GSUB_Table; + DWORD cache_num; }; typedef struct { @@ -3113,7 +3114,14 @@ static GdiFont *find_in_cache(HFONT hfont, const LOGFONTW *plf, const FMAT2 *pma return NULL; } - +static void add_to_cache(GdiFont *font) +{ + static DWORD cache_num = 1; + + font->cache_num = cache_num++; + list_add_head(&gdi_font_list, &font->entry); +} + /************************************************************* * create_child_font_list */ @@ -3604,7 +3612,7 @@ found: TRACE("caching: gdiFont=%p hfont=%p\n", ret, hfont); - list_add_head(&gdi_font_list, &ret->entry); + add_to_cache(ret); LeaveCriticalSection( &freetype_cs ); return ret; } @@ -5748,6 +5756,22 @@ BOOL WINAPI GetRasterizerCaps( LPRASTERIZER_STATUS lprs, UINT cbNumBytes) return TRUE; } +/************************************************************* + * WineEngRealizationInfo + */ +BOOL WineEngRealizationInfo(GdiFont *font, realization_info_t *info) +{ + FIXME("(%p, %p): stub!\n", font, info); + + info->flags = 1; + if(FT_IS_SCALABLE(font->ft_face)) + info->flags |= 2; + + info->cache_num = font->cache_num; + info->unknown2 = -1; + return TRUE; +} + /************************************************************************* * Kerning support for TrueType fonts */ diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index aa38b95..325c708 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -420,6 +420,17 @@ extern BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size ) DE extern HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, BOOL on_disk ) DECLSPEC_HIDDEN; /* freetype.c */ + +/* Undocumented structure filled in by GdiRealizationInfo */ +typedef struct +{ + DWORD flags; /* 1 for bitmap fonts, 3 for scalable fonts */ + DWORD cache_num; /* keeps incrementing - num of fonts that have been created allowing for caching?? */ + DWORD unknown2; /* fixed for a given font - looks like it could be the order of the face in the font list or the order + in which the face was first rendered. */ +} realization_info_t; + + extern INT WineEngAddFontResourceEx(LPCWSTR, DWORD, PVOID) DECLSPEC_HIDDEN; extern HANDLE WineEngAddFontMemResourceEx(PVOID, DWORD, PVOID, LPDWORD) DECLSPEC_HIDDEN; extern GdiFont* WineEngCreateFontInstance(DC*, HFONT) DECLSPEC_HIDDEN; @@ -447,6 +458,7 @@ extern INT WineEngGetTextFace(GdiFont*, INT, LPWSTR) DECLSPEC_HIDDEN; extern BOOL WineEngGetTextMetrics(GdiFont*, LPTEXTMETRICW) DECLSPEC_HIDDEN; extern BOOL WineEngFontIsLinked(GdiFont*) DECLSPEC_HIDDEN; extern BOOL WineEngInit(void) DECLSPEC_HIDDEN; +extern BOOL WineEngRealizationInfo(GdiFont*, realization_info_t*) DECLSPEC_HIDDEN; extern BOOL WineEngRemoveFontResourceEx(LPCWSTR, DWORD, PVOID) DECLSPEC_HIDDEN; /* gdiobj.c */
1
0
0
0
← Newer
1
...
69
70
71
72
73
74
75
...
84
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
Results per page:
10
25
50
100
200