ReactOS.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
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
List overview
Download
Ros-diffs
December 2019
----- 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
ros-diffs@reactos.org
18 participants
225 discussions
Start a n
N
ew thread
[reactos] 01/01: [SDK][INCLUDE] Rename Gdiplus::Region::region as nativeRegion (#2212)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a385451380524012ec8be…
commit a385451380524012ec8be678706f1befb380d3a8 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Dec 31 23:14:52 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Dec 31 23:14:52 2019 +0900 [SDK][INCLUDE] Rename Gdiplus::Region::region as nativeRegion (#2212) CORE-16585 --- sdk/include/psdk/gdiplusheaders.h | 125 ++++++++++++++++++++------------------ 1 file changed, 66 insertions(+), 59 deletions(-) diff --git a/sdk/include/psdk/gdiplusheaders.h b/sdk/include/psdk/gdiplusheaders.h index d5ce75d866f..2cd2a35657f 100644 --- a/sdk/include/psdk/gdiplusheaders.h +++ b/sdk/include/psdk/gdiplusheaders.h @@ -1012,39 +1012,40 @@ class Region : public GdiplusBase Region(const Rect &rect) { - status = DllExports::GdipCreateRegionRectI(&rect, ®ion); + lastStatus = DllExports::GdipCreateRegionRectI(&rect, &nativeRegion); } Region() { - status = DllExports::GdipCreateRegion(®ion); + lastStatus = DllExports::GdipCreateRegion(&nativeRegion); } Region(const BYTE *regionData, INT size) { - status = DllExports::GdipCreateRegionRgnData(regionData, size, ®ion); + lastStatus = DllExports::GdipCreateRegionRgnData(regionData, size, &nativeRegion); } Region(const GraphicsPath *path) { - status = DllExports::GdipCreateRegionPath(path->nativePath, ®ion); + lastStatus = DllExports::GdipCreateRegionPath(path->nativePath, &nativeRegion); } Region(HRGN hRgn) { - status = DllExports::GdipCreateRegionHrgn(hRgn, ®ion); + lastStatus = DllExports::GdipCreateRegionHrgn(hRgn, &nativeRegion); } Region(const RectF &rect) { - status = DllExports::GdipCreateRegionRect(&rect, ®ion); + lastStatus = DllExports::GdipCreateRegionRect(&rect, &nativeRegion); } Region * Clone() { Region *cloneRegion = new Region(); - cloneRegion->status = DllExports::GdipCloneRegion(region, cloneRegion ? &cloneRegion->region : NULL); + cloneRegion->lastStatus = + DllExports::GdipCloneRegion(nativeRegion, cloneRegion ? &cloneRegion->nativeRegion : NULL); return cloneRegion; } @@ -1052,26 +1053,26 @@ class Region : public GdiplusBase Complement(const GraphicsPath *path) { GpPath *thePath = path ? path->nativePath : NULL; - return SetStatus(DllExports::GdipCombineRegionPath(region, thePath, CombineModeComplement)); + return SetStatus(DllExports::GdipCombineRegionPath(nativeRegion, thePath, CombineModeComplement)); } Status Complement(const Region *region) { - GpRegion *theRegion = region ? region->region : NULL; - return SetStatus(DllExports::GdipCombineRegionRegion(this->region, theRegion, CombineModeComplement)); + GpRegion *theRegion = region ? getNat(region) : NULL; + return SetStatus(DllExports::GdipCombineRegionRegion(nativeRegion, theRegion, CombineModeComplement)); } Status Complement(const Rect &rect) { - return SetStatus(DllExports::GdipCombineRegionRectI(region, &rect, CombineModeComplement)); + return SetStatus(DllExports::GdipCombineRegionRectI(nativeRegion, &rect, CombineModeComplement)); } Status Complement(const RectF &rect) { - return SetStatus(DllExports::GdipCombineRegionRect(region, &rect, CombineModeComplement)); + return SetStatus(DllExports::GdipCombineRegionRect(nativeRegion, &rect, CombineModeComplement)); } BOOL @@ -1079,33 +1080,34 @@ class Region : public GdiplusBase { BOOL result; SetStatus( - DllExports::GdipIsEqualRegion(this->region, region ? region->region : NULL, g ? getNat(g) : NULL, &result)); + DllExports::GdipIsEqualRegion(nativeRegion, region ? getNat(region) : NULL, g ? getNat(g) : NULL, &result)); return result; } Status Exclude(const GraphicsPath *path) { - return SetStatus(DllExports::GdipCombineRegionPath(region, path ? path->nativePath : NULL, CombineModeExclude)); + return SetStatus( + DllExports::GdipCombineRegionPath(nativeRegion, path ? path->nativePath : NULL, CombineModeExclude)); } Status Exclude(const RectF &rect) { - return SetStatus(DllExports::GdipCombineRegionRect(region, &rect, CombineModeExclude)); + return SetStatus(DllExports::GdipCombineRegionRect(nativeRegion, &rect, CombineModeExclude)); } Status Exclude(const Rect &rect) { - return SetStatus(DllExports::GdipCombineRegionRectI(region, &rect, CombineModeExclude)); + return SetStatus(DllExports::GdipCombineRegionRectI(nativeRegion, &rect, CombineModeExclude)); } Status Exclude(const Region *region) { return SetStatus( - DllExports::GdipCombineRegionRegion(this->region, region ? region->region : NULL, CombineModeExclude)); + DllExports::GdipCombineRegionRegion(nativeRegion, region ? getNat(region) : NULL, CombineModeExclude)); } static Region * @@ -1117,26 +1119,26 @@ class Region : public GdiplusBase Status GetBounds(Rect *rect, const Graphics *g) const { - return SetStatus(DllExports::GdipGetRegionBoundsI(region, g ? getNat(g) : NULL, rect)); + return SetStatus(DllExports::GdipGetRegionBoundsI(nativeRegion, g ? getNat(g) : NULL, rect)); } Status GetBounds(RectF *rect, const Graphics *g) const { - return SetStatus(DllExports::GdipGetRegionBounds(region, g ? getNat(g) : NULL, rect)); + return SetStatus(DllExports::GdipGetRegionBounds(nativeRegion, g ? getNat(g) : NULL, rect)); } Status GetData(BYTE *buffer, UINT bufferSize, UINT *sizeFilled) const { - return SetStatus(DllExports::GdipGetRegionData(region, buffer, bufferSize, sizeFilled)); + return SetStatus(DllExports::GdipGetRegionData(nativeRegion, buffer, bufferSize, sizeFilled)); } UINT GetDataSize() const { UINT bufferSize; - SetStatus(DllExports::GdipGetRegionDataSize(region, &bufferSize)); + SetStatus(DllExports::GdipGetRegionDataSize(nativeRegion, &bufferSize)); return bufferSize; } @@ -1144,67 +1146,69 @@ class Region : public GdiplusBase GetHRGN(const Graphics *g) const { HRGN hRgn; - SetStatus(DllExports::GdipGetRegionHRgn(region, g ? getNat(g) : NULL, &hRgn)); + SetStatus(DllExports::GdipGetRegionHRgn(nativeRegion, g ? getNat(g) : NULL, &hRgn)); return hRgn; } Status GetLastStatus() { - return status; + return lastStatus; } Status GetRegionScans(const Matrix *matrix, Rect *rects, INT *count) const { - return SetStatus(DllExports::GdipGetRegionScansI(region, rects, count, matrix ? matrix->nativeMatrix : NULL)); + return SetStatus( + DllExports::GdipGetRegionScansI(nativeRegion, rects, count, matrix ? matrix->nativeMatrix : NULL)); } Status GetRegionScans(const Matrix *matrix, RectF *rects, INT *count) const { - return SetStatus(DllExports::GdipGetRegionScans(region, rects, count, matrix ? matrix->nativeMatrix : NULL)); + return SetStatus( + DllExports::GdipGetRegionScans(nativeRegion, rects, count, matrix ? matrix->nativeMatrix : NULL)); } UINT GetRegionScansCount(const Matrix *matrix) const { UINT count; - SetStatus(DllExports::GdipGetRegionScansCount(region, &count, matrix ? matrix->nativeMatrix : NULL)); + SetStatus(DllExports::GdipGetRegionScansCount(nativeRegion, &count, matrix ? matrix->nativeMatrix : NULL)); return count; } Status Intersect(const Rect &rect) { - return SetStatus(DllExports::GdipCombineRegionRectI(region, &rect, CombineModeIntersect)); + return SetStatus(DllExports::GdipCombineRegionRectI(nativeRegion, &rect, CombineModeIntersect)); } Status Intersect(const GraphicsPath *path) { GpPath *thePath = path ? path->nativePath : NULL; - return SetStatus(DllExports::GdipCombineRegionPath(region, thePath, CombineModeIntersect)); + return SetStatus(DllExports::GdipCombineRegionPath(nativeRegion, thePath, CombineModeIntersect)); } Status Intersect(const RectF &rect) { - return SetStatus(DllExports::GdipCombineRegionRect(region, &rect, CombineModeIntersect)); + return SetStatus(DllExports::GdipCombineRegionRect(nativeRegion, &rect, CombineModeIntersect)); } Status Intersect(const Region *region) { return SetStatus( - DllExports::GdipCombineRegionRegion(this->region, region ? region->region : NULL, CombineModeIntersect)); + DllExports::GdipCombineRegionRegion(nativeRegion, region ? getNat(region) : NULL, CombineModeIntersect)); } BOOL IsEmpty(const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsEmptyRegion(region, g ? getNat(g) : NULL, &result)); + SetStatus(DllExports::GdipIsEmptyRegion(nativeRegion, g ? getNat(g) : NULL, &result)); return result; } @@ -1212,7 +1216,7 @@ class Region : public GdiplusBase IsInfinite(const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsInfiniteRegion(region, g ? getNat(g) : NULL, &result)); + SetStatus(DllExports::GdipIsInfiniteRegion(nativeRegion, g ? getNat(g) : NULL, &result)); return result; } @@ -1220,7 +1224,7 @@ class Region : public GdiplusBase IsVisible(const PointF &point, const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsVisibleRegionPoint(region, point.X, point.Y, g ? getNat(g) : NULL, &result)); + SetStatus(DllExports::GdipIsVisibleRegionPoint(nativeRegion, point.X, point.Y, g ? getNat(g) : NULL, &result)); return result; } @@ -1229,7 +1233,7 @@ class Region : public GdiplusBase { BOOL result; SetStatus(DllExports::GdipIsVisibleRegionRect( - region, rect.X, rect.Y, rect.Width, rect.Height, g ? getNat(g) : NULL, &result)); + nativeRegion, rect.X, rect.Y, rect.Width, rect.Height, g ? getNat(g) : NULL, &result)); return result; } @@ -1238,7 +1242,7 @@ class Region : public GdiplusBase { BOOL result; SetStatus(DllExports::GdipIsVisibleRegionRectI( - region, rect.X, rect.Y, rect.Width, rect.Height, g ? getNat(g) : NULL, &result)); + nativeRegion, rect.X, rect.Y, rect.Width, rect.Height, g ? getNat(g) : NULL, &result)); return result; } @@ -1246,7 +1250,7 @@ class Region : public GdiplusBase IsVisible(INT x, INT y, const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsVisibleRegionPointI(region, x, y, g ? getNat(g) : NULL, &result)); + SetStatus(DllExports::GdipIsVisibleRegionPointI(nativeRegion, x, y, g ? getNat(g) : NULL, &result)); return result; } @@ -1254,7 +1258,7 @@ class Region : public GdiplusBase IsVisible(REAL x, REAL y, const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsVisibleRegionPoint(region, x, y, g ? getNat(g) : NULL, &result)); + SetStatus(DllExports::GdipIsVisibleRegionPoint(nativeRegion, x, y, g ? getNat(g) : NULL, &result)); return result; } @@ -1262,7 +1266,8 @@ class Region : public GdiplusBase IsVisible(INT x, INT y, INT width, INT height, const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsVisibleRegionRectI(region, x, y, width, height, g ? getNat(g) : NULL, &result)); + SetStatus( + DllExports::GdipIsVisibleRegionRectI(nativeRegion, x, y, width, height, g ? getNat(g) : NULL, &result)); return result; } @@ -1270,7 +1275,7 @@ class Region : public GdiplusBase IsVisible(const Point &point, const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsVisibleRegionPointI(region, point.X, point.Y, g ? getNat(g) : NULL, &result)); + SetStatus(DllExports::GdipIsVisibleRegionPointI(nativeRegion, point.X, point.Y, g ? getNat(g) : NULL, &result)); return result; } @@ -1278,100 +1283,102 @@ class Region : public GdiplusBase IsVisible(REAL x, REAL y, REAL width, REAL height, const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsVisibleRegionRect(region, x, y, width, height, g ? getNat(g) : NULL, &result)); + SetStatus( + DllExports::GdipIsVisibleRegionRect(nativeRegion, x, y, width, height, g ? getNat(g) : NULL, &result)); return result; } Status MakeEmpty() { - return SetStatus(DllExports::GdipSetEmpty(region)); + return SetStatus(DllExports::GdipSetEmpty(nativeRegion)); } Status MakeInfinite() { - return SetStatus(DllExports::GdipSetInfinite(region)); + return SetStatus(DllExports::GdipSetInfinite(nativeRegion)); } Status Transform(const Matrix *matrix) { - return SetStatus(DllExports::GdipTransformRegion(region, matrix ? matrix->nativeMatrix : NULL)); + return SetStatus(DllExports::GdipTransformRegion(nativeRegion, matrix ? matrix->nativeMatrix : NULL)); } Status Translate(REAL dx, REAL dy) { - return SetStatus(DllExports::GdipTranslateRegion(region, dx, dy)); + return SetStatus(DllExports::GdipTranslateRegion(nativeRegion, dx, dy)); } Status Translate(INT dx, INT dy) { - return SetStatus(DllExports::GdipTranslateRegionI(region, dx, dy)); + return SetStatus(DllExports::GdipTranslateRegionI(nativeRegion, dx, dy)); } Status Union(const Rect &rect) { - return SetStatus(DllExports::GdipCombineRegionRectI(region, &rect, CombineModeUnion)); + return SetStatus(DllExports::GdipCombineRegionRectI(nativeRegion, &rect, CombineModeUnion)); } Status Union(const Region *region) { return SetStatus( - DllExports::GdipCombineRegionRegion(this->region, region ? region->region : NULL, CombineModeUnion)); + DllExports::GdipCombineRegionRegion(nativeRegion, region ? getNat(region) : NULL, CombineModeUnion)); } Status Union(const RectF &rect) { - return SetStatus(DllExports::GdipCombineRegionRect(region, &rect, CombineModeUnion)); + return SetStatus(DllExports::GdipCombineRegionRect(nativeRegion, &rect, CombineModeUnion)); } Status Union(const GraphicsPath *path) { - return SetStatus(DllExports::GdipCombineRegionPath(region, path ? path->nativePath : NULL, CombineModeUnion)); + return SetStatus( + DllExports::GdipCombineRegionPath(nativeRegion, path ? path->nativePath : NULL, CombineModeUnion)); } Status Xor(const GraphicsPath *path) { - return SetStatus(DllExports::GdipCombineRegionPath(region, path ? path->nativePath : NULL, CombineModeXor)); + return SetStatus( + DllExports::GdipCombineRegionPath(nativeRegion, path ? path->nativePath : NULL, CombineModeXor)); } Status Xor(const RectF &rect) { - return SetStatus(DllExports::GdipCombineRegionRect(region, &rect, CombineModeXor)); + return SetStatus(DllExports::GdipCombineRegionRect(nativeRegion, &rect, CombineModeXor)); } Status Xor(const Rect &rect) { - return SetStatus(DllExports::GdipCombineRegionRectI(region, &rect, CombineModeXor)); + return SetStatus(DllExports::GdipCombineRegionRectI(nativeRegion, &rect, CombineModeXor)); } Status Xor(const Region *region) { return SetStatus( - DllExports::GdipCombineRegionRegion(this->region, region ? region->region : NULL, CombineModeXor)); + DllExports::GdipCombineRegionRegion(nativeRegion, region ? getNat(region) : NULL, CombineModeXor)); } private: - mutable Status status; - GpRegion *region; + GpRegion *nativeRegion; + mutable Status lastStatus; Status SetStatus(Status status) const { - if (status == Ok) - return status; - this->status = status; + if (status != Ok) + lastStatus = status; return status; } @@ -1379,7 +1386,7 @@ class Region : public GdiplusBase friend inline GpRegion *& getNat(const Region *region) { - return const_cast<Region *>(region)->region; + return const_cast<Region *>(region)->nativeRegion; } };
4 years, 11 months
1
0
0
0
[reactos] 01/01: [SDK][INCLUDE] Improve Gdiplus::Graphics (#2211)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8968b142355e3e84cb26f…
commit 8968b142355e3e84cb26f241f550fc232dee1d1b Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Dec 31 20:40:16 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Dec 31 20:40:16 2019 +0900 [SDK][INCLUDE] Improve Gdiplus::Graphics (#2211) CORE-16585 --- sdk/include/psdk/gdiplusbrush.h | 7 + sdk/include/psdk/gdiplusgraphics.h | 463 +++++++++++++++++++----------- sdk/include/psdk/gdiplusheaders.h | 14 + sdk/include/psdk/gdiplusimageattributes.h | 7 + sdk/include/psdk/gdiplusmatrix.h | 7 + sdk/include/psdk/gdipluspath.h | 8 + sdk/include/psdk/gdipluspen.h | 7 + 7 files changed, 339 insertions(+), 174 deletions(-) diff --git a/sdk/include/psdk/gdiplusbrush.h b/sdk/include/psdk/gdiplusbrush.h index 3ee939bb30e..2416135294e 100644 --- a/sdk/include/psdk/gdiplusbrush.h +++ b/sdk/include/psdk/gdiplusbrush.h @@ -93,6 +93,13 @@ class Brush : public GdiplusBase Brush(const Brush &); Brush & operator=(const Brush &); + + // get native + friend inline GpBrush *& + getNat(const Brush *brush) + { + return const_cast<Brush *>(brush)->nativeBrush; + } }; class HatchBrush : public Brush diff --git a/sdk/include/psdk/gdiplusgraphics.h b/sdk/include/psdk/gdiplusgraphics.h index a573577f5d3..f34c1093cc5 100644 --- a/sdk/include/psdk/gdiplusgraphics.h +++ b/sdk/include/psdk/gdiplusgraphics.h @@ -27,6 +27,31 @@ class Font; class GraphicsPath; class Metafile; +// get native +GpImage *& +getNat(const Image *image); + +GpPen *& +getNat(const Pen *pen); + +GpBrush *& +getNat(const Brush *brush); + +GpCachedBitmap *& +getNat(const CachedBitmap *cb); + +GpImageAttributes *& +getNat(const ImageAttributes *ia); + +GpRegion *& +getNat(const Region *region); + +GpMatrix *& +getNat(const Matrix *matrix); + +GpPath *& +getNat(const GraphicsPath *path); + class Graphics : public GdiplusBase { friend class Region; @@ -37,21 +62,45 @@ class Graphics : public GdiplusBase public: Graphics(Image *image) { + GpGraphics *graphics = NULL; + if (image) + { + lastStatus = DllExports::GdipGetImageGraphicsContext(getNat(image), &graphics); + } + SetNativeGraphics(graphics); } Graphics(HDC hdc) { GpGraphics *graphics = NULL; - status = DllExports::GdipCreateFromHDC(hdc, &graphics); - SetGraphics(graphics); + lastStatus = DllExports::GdipCreateFromHDC(hdc, &graphics); + SetNativeGraphics(graphics); } Graphics(HDC hdc, HANDLE hdevice) { + GpGraphics *graphics = NULL; + lastStatus = DllExports::GdipCreateFromHDC2(hdc, hdevice, &graphics); + SetNativeGraphics(graphics); + } + + Graphics(HWND hwnd, BOOL icm = FALSE) + { + GpGraphics *graphics = NULL; + if (icm) + { + lastStatus = DllExports::GdipCreateFromHWNDICM(hwnd, &graphics); + } + else + { + lastStatus = DllExports::GdipCreateFromHWND(hwnd, &graphics); + } + SetNativeGraphics(graphics); } - Graphics(HWND hwnd, BOOL icm) + ~Graphics() { + DllExports::GdipDeleteGraphics(nativeGraphics); } Status @@ -60,7 +109,8 @@ class Graphics : public GdiplusBase return SetStatus(DllExports::GdipComment(nativeGraphics, sizeData, data)); } - GraphicsContainer BeginContainer(VOID) + GraphicsContainer + BeginContainer() { return GraphicsContainer(); } @@ -87,142 +137,138 @@ class Graphics : public GdiplusBase DrawArc(const Pen *pen, const Rect &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawArcI( - nativeGraphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, - sweepAngle)); + nativeGraphics, pen ? getNat(pen) : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); } Status DrawArc(const Pen *pen, const RectF &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawArcI( - nativeGraphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, - sweepAngle)); + nativeGraphics, pen ? getNat(pen) : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); } Status DrawArc(const Pen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawArc( - nativeGraphics, pen ? pen->nativePen : NULL, x, y, width, height, startAngle, sweepAngle)); + nativeGraphics, pen ? getNat(pen) : NULL, x, y, width, height, startAngle, sweepAngle)); } Status DrawArc(const Pen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawArcI( - nativeGraphics, pen ? pen->nativePen : NULL, x, y, width, height, startAngle, sweepAngle)); + nativeGraphics, pen ? getNat(pen) : NULL, x, y, width, height, startAngle, sweepAngle)); } Status DrawBezier(const Pen *pen, const Point &pt1, const Point &pt2, const Point &pt3, const Point &pt4) { return SetStatus(DllExports::GdipDrawBezierI( - nativeGraphics, pen ? pen->nativePen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)); + nativeGraphics, pen ? getNat(pen) : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)); } Status DrawBezier(const Pen *pen, const PointF &pt1, const PointF &pt2, const PointF &pt3, const PointF &pt4) { return SetStatus(DllExports::GdipDrawBezier( - nativeGraphics, pen ? pen->nativePen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)); + nativeGraphics, pen ? getNat(pen) : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)); } Status DrawBezier(const Pen *pen, REAL x1, REAL y1, REAL x2, REAL y2, REAL x3, REAL y3, REAL x4, REAL y4) { return SetStatus( - DllExports::GdipDrawBezier(nativeGraphics, pen ? pen->nativePen : NULL, x1, y1, x2, y2, x3, y3, x4, y4)); + DllExports::GdipDrawBezier(nativeGraphics, pen ? getNat(pen) : NULL, x1, y1, x2, y2, x3, y3, x4, y4)); } Status DrawBezier(const Pen *pen, INT x1, INT y1, INT x2, INT y2, INT x3, INT y3, INT x4, INT y4) { return SetStatus( - DllExports::GdipDrawBezierI(nativeGraphics, pen ? pen->nativePen : NULL, x1, y1, x2, y2, x3, y3, x4, y4)); + DllExports::GdipDrawBezierI(nativeGraphics, pen ? getNat(pen) : NULL, x1, y1, x2, y2, x3, y3, x4, y4)); } Status DrawBeziers(const Pen *pen, const Point *points, INT count) { - return SetStatus(DllExports::GdipDrawBeziersI(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawBeziersI(nativeGraphics, pen ? getNat(pen) : NULL, points, count)); } Status DrawBeziers(const Pen *pen, const PointF *points, INT count) { - return SetStatus(DllExports::GdipDrawBeziers(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawBeziers(nativeGraphics, pen ? getNat(pen) : NULL, points, count)); } Status DrawCachedBitmap(CachedBitmap *cb, INT x, INT y) { - return NotImplemented; + return SetStatus(DllExports::GdipDrawCachedBitmap(nativeGraphics, getNat(cb), x, y)); } Status DrawClosedCurve(const Pen *pen, const Point *points, INT count) { - return SetStatus(DllExports::GdipDrawClosedCurveI(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawClosedCurveI(nativeGraphics, pen ? getNat(pen) : NULL, points, count)); } Status DrawClosedCurve(const Pen *pen, const PointF *points, INT count) { - return SetStatus(DllExports::GdipDrawClosedCurve(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawClosedCurve(nativeGraphics, pen ? getNat(pen) : NULL, points, count)); } Status DrawClosedCurve(const Pen *pen, const PointF *points, INT count, REAL tension) { return SetStatus( - DllExports::GdipDrawClosedCurve2(nativeGraphics, pen ? pen->nativePen : NULL, points, count, tension)); + DllExports::GdipDrawClosedCurve2(nativeGraphics, pen ? getNat(pen) : NULL, points, count, tension)); } Status DrawClosedCurve(const Pen *pen, const Point *points, INT count, REAL tension) { return SetStatus( - DllExports::GdipDrawClosedCurve2I(nativeGraphics, pen ? pen->nativePen : NULL, points, count, tension)); + DllExports::GdipDrawClosedCurve2I(nativeGraphics, pen ? getNat(pen) : NULL, points, count, tension)); } Status DrawCurve(const Pen *pen, const Point *points, INT count) { - return SetStatus(DllExports::GdipDrawCurveI(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawCurveI(nativeGraphics, pen ? getNat(pen) : NULL, points, count)); } Status DrawCurve(const Pen *pen, const PointF *points, INT count) { - return SetStatus(DllExports::GdipDrawCurve(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawCurve(nativeGraphics, pen ? getNat(pen) : NULL, points, count)); } Status DrawCurve(const Pen *pen, const PointF *points, INT count, REAL tension) { - return SetStatus( - DllExports::GdipDrawCurve2(nativeGraphics, pen ? pen->nativePen : NULL, points, count, tension)); + return SetStatus(DllExports::GdipDrawCurve2(nativeGraphics, pen ? getNat(pen) : NULL, points, count, tension)); } Status DrawCurve(const Pen *pen, const Point *points, INT count, INT offset, INT numberOfSegments, REAL tension) { return SetStatus(DllExports::GdipDrawCurve3I( - nativeGraphics, pen ? pen->nativePen : NULL, points, count, offset, numberOfSegments, tension)); + nativeGraphics, pen ? getNat(pen) : NULL, points, count, offset, numberOfSegments, tension)); } Status DrawCurve(const Pen *pen, const PointF *points, INT count, INT offset, INT numberOfSegments, REAL tension) { return SetStatus(DllExports::GdipDrawCurve3( - nativeGraphics, pen ? pen->nativePen : NULL, points, count, offset, numberOfSegments, tension)); + nativeGraphics, pen ? getNat(pen) : NULL, points, count, offset, numberOfSegments, tension)); } Status DrawCurve(const Pen *pen, const Point *points, INT count, REAL tension) { - return SetStatus( - DllExports::GdipDrawCurve2I(nativeGraphics, pen ? pen->nativePen : NULL, points, count, tension)); + return SetStatus(DllExports::GdipDrawCurve2I(nativeGraphics, pen ? getNat(pen) : NULL, points, count, tension)); } Status @@ -242,81 +288,90 @@ class Graphics : public GdiplusBase DrawEllipse(const Pen *pen, const Rect &rect) { return SetStatus(DllExports::GdipDrawEllipseI( - nativeGraphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + nativeGraphics, pen ? getNat(pen) : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status DrawEllipse(const Pen *pen, REAL x, REAL y, REAL width, REAL height) { - return SetStatus(DllExports::GdipDrawEllipse(nativeGraphics, pen ? pen->nativePen : NULL, x, y, width, height)); + return SetStatus(DllExports::GdipDrawEllipse(nativeGraphics, pen ? getNat(pen) : NULL, x, y, width, height)); } Status DrawEllipse(const Pen *pen, const RectF &rect) { return SetStatus(DllExports::GdipDrawEllipse( - nativeGraphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + nativeGraphics, pen ? getNat(pen) : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status DrawEllipse(const Pen *pen, INT x, INT y, INT width, INT height) { - return SetStatus( - DllExports::GdipDrawEllipseI(nativeGraphics, pen ? pen->nativePen : NULL, x, y, width, height)); + return SetStatus(DllExports::GdipDrawEllipseI(nativeGraphics, pen ? getNat(pen) : NULL, x, y, width, height)); } Status DrawImage(Image *image, const Point *destPoints, INT count) { - return NotImplemented; + if (count != 3 && count != 4) + return SetStatus(InvalidParameter); + + return SetStatus( + DllExports::GdipDrawImagePointsI(nativeGraphics, image ? getNat(image) : NULL, destPoints, count)); } Status DrawImage(Image *image, INT x, INT y) { - return NotImplemented; + return SetStatus(DllExports::GdipDrawImageI(nativeGraphics, image ? getNat(image) : NULL, x, y)); } Status DrawImage(Image *image, const Point &point) { - return NotImplemented; + return DrawImage(image, point.X, point.Y); } Status DrawImage(Image *image, REAL x, REAL y) { - return NotImplemented; + return SetStatus(DllExports::GdipDrawImage(nativeGraphics, image ? getNat(image) : NULL, x, y)); } Status DrawImage(Image *image, const PointF &point) { - return NotImplemented; + return DrawImage(image, point.X, point.Y); } Status DrawImage(Image *image, const PointF *destPoints, INT count) { - return NotImplemented; + if (count != 3 && count != 4) + return SetStatus(InvalidParameter); + + return SetStatus( + DllExports::GdipDrawImagePoints(nativeGraphics, image ? getNat(image) : NULL, destPoints, count)); } Status DrawImage(Image *image, REAL x, REAL y, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, Unit srcUnit) { - return NotImplemented; + return SetStatus(DllExports::GdipDrawImagePointRect( + nativeGraphics, image ? getNat(image) : NULL, x, y, srcx, srcy, srcwidth, srcheight, srcUnit)); } Status DrawImage(Image *image, const RectF &rect) { - return NotImplemented; + return DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height); } Status DrawImage(Image *image, INT x, INT y, INT width, INT height) { - return NotImplemented; + return SetStatus( + DllExports::GdipDrawImageRectI(nativeGraphics, image ? getNat(image) : NULL, x, y, width, height)); } Status @@ -333,7 +388,9 @@ class Graphics : public GdiplusBase DrawImageAbort callback, VOID *callbackData) { - return NotImplemented; + return SetStatus(DllExports::GdipDrawImagePointsRect( + nativeGraphics, image ? getNat(image) : NULL, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, + imageAttributes ? getNat(imageAttributes) : NULL, callback, callbackData)); } Status @@ -345,11 +402,14 @@ class Graphics : public GdiplusBase INT srcwidth, INT srcheight, Unit srcUnit, - ImageAttributes *imageAttributes, - DrawImageAbort callback, - VOID *callbackData) + const ImageAttributes *imageAttributes = NULL, + DrawImageAbort callback = NULL, + VOID *callbackData = NULL) { - return NotImplemented; + return SetStatus(DllExports::GdipDrawImageRectRectI( + nativeGraphics, image ? getNat(image) : NULL, destRect.X, destRect.Y, destRect.Width, destRect.Height, srcx, + srcy, srcwidth, srcheight, srcUnit, imageAttributes ? getNat(imageAttributes) : NULL, callback, + callbackData)); } Status @@ -362,29 +422,33 @@ class Graphics : public GdiplusBase INT srcwidth, INT srcheight, Unit srcUnit, - ImageAttributes *imageAttributes, - DrawImageAbort callback, - VOID *callbackData) + ImageAttributes *imageAttributes = NULL, + DrawImageAbort callback = NULL, + VOID *callbackData = NULL) { - return NotImplemented; + return SetStatus(DllExports::GdipDrawImagePointsRectI( + nativeGraphics, image ? getNat(image) : NULL, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, + imageAttributes ? getNat(imageAttributes) : NULL, callback, callbackData)); } Status DrawImage(Image *image, REAL x, REAL y, REAL width, REAL height) { - return NotImplemented; + return SetStatus( + DllExports::GdipDrawImageRect(nativeGraphics, image ? getNat(image) : NULL, x, y, width, height)); } Status DrawImage(Image *image, const Rect &rect) { - return NotImplemented; + return DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height); } Status DrawImage(Image *image, INT x, INT y, INT srcx, INT srcy, INT srcwidth, INT srcheight, Unit srcUnit) { - return NotImplemented; + return SetStatus(DllExports::GdipDrawImagePointRectI( + nativeGraphics, image ? getNat(image) : NULL, x, y, srcx, srcy, srcwidth, srcheight, srcUnit)); } Status @@ -396,137 +460,137 @@ class Graphics : public GdiplusBase REAL srcwidth, REAL srcheight, Unit srcUnit, - ImageAttributes *imageAttributes, - DrawImageAbort callback, - VOID *callbackData) + ImageAttributes *imageAttributes = NULL, + DrawImageAbort callback = NULL, + VOID *callbackData = NULL) { - return NotImplemented; + return SetStatus(DllExports::GdipDrawImageRectRect( + nativeGraphics, image ? getNat(image) : NULL, destRect.X, destRect.Y, destRect.Width, destRect.Height, srcx, + srcy, srcwidth, srcheight, srcUnit, imageAttributes ? getNat(imageAttributes) : NULL, callback, + callbackData)); } Status DrawLine(const Pen *pen, const Point &pt1, const Point &pt2) { return SetStatus( - DllExports::GdipDrawLineI(nativeGraphics, pen ? pen->nativePen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y)); + DllExports::GdipDrawLineI(nativeGraphics, pen ? getNat(pen) : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y)); } Status DrawLine(const Pen *pen, const PointF &pt1, const Point &pt2) { return SetStatus( - DllExports::GdipDrawLine(nativeGraphics, pen ? pen->nativePen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y)); + DllExports::GdipDrawLine(nativeGraphics, pen ? getNat(pen) : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y)); } Status DrawLine(const Pen *pen, REAL x1, REAL y1, REAL x2, REAL y2) { - return SetStatus(DllExports::GdipDrawLine(nativeGraphics, pen ? pen->nativePen : NULL, x1, y1, x2, y2)); + return SetStatus(DllExports::GdipDrawLine(nativeGraphics, pen ? getNat(pen) : NULL, x1, y1, x2, y2)); } Status DrawLine(const Pen *pen, INT x1, INT y1, INT x2, INT y2) { - return SetStatus(DllExports::GdipDrawLine(nativeGraphics, pen ? pen->nativePen : NULL, x1, y1, x2, y2)); + return SetStatus(DllExports::GdipDrawLine(nativeGraphics, pen ? getNat(pen) : NULL, x1, y1, x2, y2)); } Status DrawLines(const Pen *pen, const Point *points, INT count) { - return SetStatus(DllExports::GdipDrawLinesI(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawLinesI(nativeGraphics, pen ? getNat(pen) : NULL, points, count)); } Status DrawLines(const Pen *pen, const PointF *points, INT count) { - return SetStatus(DllExports::GdipDrawLines(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawLines(nativeGraphics, pen ? getNat(pen) : NULL, points, count)); } Status DrawPath(const Pen *pen, const GraphicsPath *path) { - return NotImplemented; + return SetStatus( + DllExports::GdipDrawPath(nativeGraphics, pen ? getNat(pen) : NULL, path ? getNat(path) : NULL)); } Status DrawPie(const Pen *pen, const Rect &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawPieI( - nativeGraphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, - sweepAngle)); + nativeGraphics, pen ? getNat(pen) : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); } Status DrawPie(const Pen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawPieI( - nativeGraphics, pen ? pen->nativePen : NULL, x, y, width, height, startAngle, sweepAngle)); + nativeGraphics, pen ? getNat(pen) : NULL, x, y, width, height, startAngle, sweepAngle)); } Status DrawPie(const Pen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawPie( - nativeGraphics, pen ? pen->nativePen : NULL, x, y, width, height, startAngle, sweepAngle)); + nativeGraphics, pen ? getNat(pen) : NULL, x, y, width, height, startAngle, sweepAngle)); } Status DrawPie(const Pen *pen, const RectF &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawPie( - nativeGraphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, - sweepAngle)); + nativeGraphics, pen ? getNat(pen) : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); } Status DrawPolygon(const Pen *pen, const Point *points, INT count) { - return SetStatus(DllExports::GdipDrawPolygonI(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawPolygonI(nativeGraphics, pen ? getNat(pen) : NULL, points, count)); } Status DrawPolygon(const Pen *pen, const PointF *points, INT count) { - return SetStatus(DllExports::GdipDrawPolygon(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawPolygon(nativeGraphics, pen ? getNat(pen) : NULL, points, count)); } Status DrawRectangle(const Pen *pen, const Rect &rect) { return SetStatus(DllExports::GdipDrawRectangleI( - nativeGraphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + nativeGraphics, pen ? getNat(pen) : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status DrawRectangle(const Pen *pen, INT x, INT y, INT width, INT height) { - return SetStatus( - DllExports::GdipDrawRectangleI(nativeGraphics, pen ? pen->nativePen : NULL, x, y, width, height)); + return SetStatus(DllExports::GdipDrawRectangleI(nativeGraphics, pen ? getNat(pen) : NULL, x, y, width, height)); } Status DrawRectangle(const Pen *pen, REAL x, REAL y, REAL width, REAL height) { - return SetStatus( - DllExports::GdipDrawRectangle(nativeGraphics, pen ? pen->nativePen : NULL, x, y, width, height)); + return SetStatus(DllExports::GdipDrawRectangle(nativeGraphics, pen ? getNat(pen) : NULL, x, y, width, height)); } Status DrawRectangle(const Pen *pen, const RectF &rect) { return SetStatus(DllExports::GdipDrawRectangleI( - nativeGraphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + nativeGraphics, pen ? getNat(pen) : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status DrawRectangles(const Pen *pen, const Rect *rects, INT count) { - return SetStatus(DllExports::GdipDrawRectanglesI(nativeGraphics, pen ? pen->nativePen : NULL, rects, count)); + return SetStatus(DllExports::GdipDrawRectanglesI(nativeGraphics, pen ? getNat(pen) : NULL, rects, count)); } Status DrawRectangles(const Pen *pen, const RectF *rects, INT count) { - return SetStatus(DllExports::GdipDrawRectangles(nativeGraphics, pen ? pen->nativePen : NULL, rects, count)); + return SetStatus(DllExports::GdipDrawRectangles(nativeGraphics, pen ? getNat(pen) : NULL, rects, count)); } Status @@ -570,8 +634,8 @@ class Graphics : public GdiplusBase const Metafile *metafile, const Metafile &destPoint, EnumerateMetafileProc callback, - VOID *callbackData, - ImageAttributes *imageAttributes) + VOID *callbackData = NULL, + ImageAttributes *imageAttributes = NULL) { return NotImplemented; } @@ -716,88 +780,88 @@ class Graphics : public GdiplusBase Status ExcludeClip(const Rect &rect) { - return NotImplemented; + return SetStatus( + DllExports::GdipSetClipRectI(nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, CombineModeExclude)); } Status ExcludeClip(const RectF &rect) { - return NotImplemented; + return SetStatus( + DllExports::GdipSetClipRect(nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, CombineModeExclude)); } Status ExcludeClip(const Region *region) { - return NotImplemented; + return SetStatus(DllExports::GdipSetClipRegion(nativeGraphics, getNat(region), CombineModeExclude)); } Status FillClosedCurve(const Brush *brush, const Point *points, INT count) { - return SetStatus( - DllExports::GdipFillClosedCurveI(nativeGraphics, brush ? brush->nativeBrush : NULL, points, count)); + return SetStatus(DllExports::GdipFillClosedCurveI(nativeGraphics, brush ? getNat(brush) : NULL, points, count)); } Status FillClosedCurve(const Brush *brush, const Point *points, INT count, FillMode fillMode, REAL tension) { return SetStatus(DllExports::GdipFillClosedCurve2I( - nativeGraphics, brush ? brush->nativeBrush : NULL, points, count, tension, fillMode)); + nativeGraphics, brush ? getNat(brush) : NULL, points, count, tension, fillMode)); } Status FillClosedCurve(const Brush *brush, const PointF *points, INT count) { - return SetStatus( - DllExports::GdipFillClosedCurve(nativeGraphics, brush ? brush->nativeBrush : NULL, points, count)); + return SetStatus(DllExports::GdipFillClosedCurve(nativeGraphics, brush ? getNat(brush) : NULL, points, count)); } Status FillClosedCurve(const Brush *brush, const PointF *points, INT count, FillMode fillMode, REAL tension) { return SetStatus(DllExports::GdipFillClosedCurve2( - nativeGraphics, brush ? brush->nativeBrush : NULL, points, count, tension, fillMode)); + nativeGraphics, brush ? getNat(brush) : NULL, points, count, tension, fillMode)); } Status FillEllipse(const Brush *brush, const Rect &rect) { return SetStatus(DllExports::GdipFillEllipseI( - nativeGraphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + nativeGraphics, brush ? getNat(brush) : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status FillEllipse(const Brush *brush, REAL x, REAL y, REAL width, REAL height) { return SetStatus( - DllExports::GdipFillEllipse(nativeGraphics, brush ? brush->nativeBrush : NULL, x, y, width, height)); + DllExports::GdipFillEllipse(nativeGraphics, brush ? getNat(brush) : NULL, x, y, width, height)); } Status FillEllipse(const Brush *brush, const RectF &rect) { return SetStatus(DllExports::GdipFillEllipse( - nativeGraphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + nativeGraphics, brush ? getNat(brush) : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status FillEllipse(const Brush *brush, INT x, INT y, INT width, INT height) { return SetStatus( - DllExports::GdipFillEllipseI(nativeGraphics, brush ? brush->nativeBrush : NULL, x, y, width, height)); + DllExports::GdipFillEllipseI(nativeGraphics, brush ? getNat(brush) : NULL, x, y, width, height)); } Status FillPath(const Brush *brush, const GraphicsPath *path) { - return NotImplemented; + return SetStatus(DllExports::GdipFillPath(nativeGraphics, getNat(brush), getNat(path))); } Status FillPie(const Brush *brush, const Rect &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipFillPieI( - nativeGraphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, + nativeGraphics, brush ? getNat(brush) : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); } @@ -805,133 +869,130 @@ class Graphics : public GdiplusBase FillPie(const Brush *brush, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipFillPieI( - nativeGraphics, brush ? brush->nativeBrush : NULL, x, y, width, height, startAngle, sweepAngle)); + nativeGraphics, brush ? getNat(brush) : NULL, x, y, width, height, startAngle, sweepAngle)); } Status FillPie(const Brush *brush, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipFillPie( - nativeGraphics, brush ? brush->nativeBrush : NULL, x, y, width, height, startAngle, sweepAngle)); + nativeGraphics, brush ? getNat(brush) : NULL, x, y, width, height, startAngle, sweepAngle)); } Status FillPie(const Brush *brush, RectF &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipFillPie( - nativeGraphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, + nativeGraphics, brush ? getNat(brush) : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); } Status FillPolygon(const Brush *brush, const Point *points, INT count) { - return SetStatus( - DllExports::GdipFillPolygon2I(nativeGraphics, brush ? brush->nativeBrush : NULL, points, count)); + return SetStatus(DllExports::GdipFillPolygon2I(nativeGraphics, brush ? getNat(brush) : NULL, points, count)); } Status FillPolygon(const Brush *brush, const PointF *points, INT count) { - return SetStatus( - DllExports::GdipFillPolygon2(nativeGraphics, brush ? brush->nativeBrush : NULL, points, count)); + return SetStatus(DllExports::GdipFillPolygon2(nativeGraphics, brush ? getNat(brush) : NULL, points, count)); } Status FillPolygon(const Brush *brush, const Point *points, INT count, FillMode fillMode) { return SetStatus( - DllExports::GdipFillPolygonI(nativeGraphics, brush ? brush->nativeBrush : NULL, points, count, fillMode)); + DllExports::GdipFillPolygonI(nativeGraphics, brush ? getNat(brush) : NULL, points, count, fillMode)); } Status FillPolygon(const Brush *brush, const PointF *points, INT count, FillMode fillMode) { return SetStatus( - DllExports::GdipFillPolygon(nativeGraphics, brush ? brush->nativeBrush : NULL, points, count, fillMode)); + DllExports::GdipFillPolygon(nativeGraphics, brush ? getNat(brush) : NULL, points, count, fillMode)); } Status FillRectangle(const Brush *brush, const Rect &rect) { return SetStatus(DllExports::GdipFillRectangleI( - nativeGraphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + nativeGraphics, brush ? getNat(brush) : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status FillRectangle(const Brush *brush, const RectF &rect) { return SetStatus(DllExports::GdipFillRectangle( - nativeGraphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + nativeGraphics, brush ? getNat(brush) : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status FillRectangle(const Brush *brush, REAL x, REAL y, REAL width, REAL height) { return SetStatus( - DllExports::GdipFillRectangle(nativeGraphics, brush ? brush->nativeBrush : NULL, x, y, width, height)); + DllExports::GdipFillRectangle(nativeGraphics, brush ? getNat(brush) : NULL, x, y, width, height)); } Status FillRectangle(const Brush *brush, INT x, INT y, INT width, INT height) { return SetStatus( - DllExports::GdipFillRectangleI(nativeGraphics, brush ? brush->nativeBrush : NULL, x, y, width, height)); + DllExports::GdipFillRectangleI(nativeGraphics, brush ? getNat(brush) : NULL, x, y, width, height)); } Status FillRectangles(const Brush *brush, const Rect *rects, INT count) { - return SetStatus( - DllExports::GdipFillRectanglesI(nativeGraphics, brush ? brush->nativeBrush : NULL, rects, count)); + return SetStatus(DllExports::GdipFillRectanglesI(nativeGraphics, brush ? getNat(brush) : NULL, rects, count)); } Status FillRectangles(const Brush *brush, const RectF *rects, INT count) { - return SetStatus( - DllExports::GdipFillRectangles(nativeGraphics, brush ? brush->nativeBrush : NULL, rects, count)); + return SetStatus(DllExports::GdipFillRectangles(nativeGraphics, brush ? getNat(brush) : NULL, rects, count)); } Status FillRegion(const Brush *brush, const Region *region) { - return NotImplemented; + return SetStatus(DllExports::GdipFillRegion(nativeGraphics, getNat(brush), getNat(region))); } VOID Flush(FlushIntention intention) { + DllExports::GdipFlush(nativeGraphics, intention); } static Graphics * FromHDC(HDC hdc) { - return NULL; + return new Graphics(hdc); } static Graphics * FromHDC(HDC hdc, HANDLE hDevice) { - return NULL; + return new Graphics(hdc, hDevice); } static Graphics * FromHWND(HWND hWnd, BOOL icm) { - return NULL; + return new Graphics(hWnd, icm); } static Graphics * FromImage(Image *image) { - return NULL; + return new Graphics(image); } Status GetClip(Region *region) const { - return NotImplemented; + return SetStatus(DllExports::GdipGetClip(nativeGraphics, getNat(region))); } Status @@ -946,77 +1007,97 @@ class Graphics : public GdiplusBase return SetStatus(DllExports::GdipGetClipBounds(nativeGraphics, rect)); } - CompositingMode GetCompositingMode(VOID) + CompositingMode + GetCompositingMode() const { CompositingMode compositingMode; SetStatus(DllExports::GdipGetCompositingMode(nativeGraphics, &compositingMode)); return compositingMode; } - CompositingQuality GetCompositingQuality(VOID) + CompositingQuality + GetCompositingQuality() const { CompositingQuality compositingQuality; SetStatus(DllExports::GdipGetCompositingQuality(nativeGraphics, &compositingQuality)); return compositingQuality; } - REAL GetDpiX(VOID) + REAL + GetDpiX() const { REAL dpi; SetStatus(DllExports::GdipGetDpiX(nativeGraphics, &dpi)); return dpi; } - REAL GetDpiY(VOID) + REAL + GetDpiY() const { REAL dpi; SetStatus(DllExports::GdipGetDpiY(nativeGraphics, &dpi)); return dpi; } - static HPALETTE GetHalftonePalette(VOID) + static HPALETTE + GetHalftonePalette() { return NULL; } - HDC GetHDC(VOID) + HDC + GetHDC() { - return NULL; + HDC hdc = NULL; + SetStatus(DllExports::GdipGetDC(nativeGraphics, &hdc)); + return hdc; } - InterpolationMode GetInterpolationMode(VOID) + InterpolationMode + GetInterpolationMode() const { InterpolationMode interpolationMode; SetStatus(DllExports::GdipGetInterpolationMode(nativeGraphics, &interpolationMode)); return interpolationMode; } - Status GetLastStatus(VOID) + Status + GetLastStatus() const { - return status; + return lastStatus; } Status GetNearestColor(Color *color) const { - return NotImplemented; + if (color == NULL) + return SetStatus(InvalidParameter); + + ARGB argb = color->GetValue(); + SetStatus(DllExports::GdipGetNearestColor(nativeGraphics, &argb)); + + color->SetValue(argb); + return lastStatus; } - REAL GetPageScale(VOID) + REAL + GetPageScale() const { REAL scale; SetStatus(DllExports::GdipGetPageScale(nativeGraphics, &scale)); return scale; } - Unit GetPageUnit(VOID) + Unit + GetPageUnit() const { Unit unit; SetStatus(DllExports::GdipGetPageUnit(nativeGraphics, &unit)); return unit; } - PixelOffsetMode GetPixelOffsetMode(VOID) + PixelOffsetMode + GetPixelOffsetMode() const { PixelOffsetMode pixelOffsetMode; SetStatus(DllExports::GdipGetPixelOffsetMode(nativeGraphics, &pixelOffsetMode)); @@ -1024,37 +1105,55 @@ class Graphics : public GdiplusBase } Status - GetRenderingOrigin(INT *x, INT *y) + GetRenderingOrigin(INT *x, INT *y) const { - return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipGetRenderingOrigin(nativeGraphics, x, - // y)); +#if 1 + return SetStatus(NotImplemented); // FIXME +#else + return SetStatus(DllExports::GdipGetRenderingOrigin(nativeGraphics, x, y)); +#endif } - SmoothingMode GetSmoothingMode(VOID) const + SmoothingMode + GetSmoothingMode() const { SmoothingMode smoothingMode; SetStatus(DllExports::GdipGetSmoothingMode(nativeGraphics, &smoothingMode)); return smoothingMode; } - UINT GetTextContrast(VOID) const + UINT + GetTextContrast() const { UINT contrast; SetStatus(DllExports::GdipGetTextContrast(nativeGraphics, &contrast)); return contrast; } - TextRenderingHint GetTextRenderingHint(VOID) const + TextRenderingHint + GetTextRenderingHint() const { TextRenderingHint mode; SetStatus(DllExports::GdipGetTextRenderingHint(nativeGraphics, &mode)); return mode; } + UINT + GetTextGammaValue() const + { +#if 1 + return SetStatus(NotImplemented); // FIXME +#else + UINT gammaValue; + SetStatus(DllExports::GdipGetTextGammaValue(nativeGraphics, &gammaValue)); + return gammaValue; +#endif + } + Status - GetTransform(Matrix *matrix) + GetTransform(Matrix *matrix) const { - return NotImplemented; + return SetStatus(DllExports::GdipGetWorldTransform(nativeGraphics, getNat(matrix))); } Status @@ -1072,22 +1171,25 @@ class Graphics : public GdiplusBase Status IntersectClip(const Rect &rect) { - return NotImplemented; + return SetStatus(DllExports::GdipSetClipRectI( + nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, CombineModeIntersect)); } Status IntersectClip(const Region *region) { - return NotImplemented; + return SetStatus(DllExports::GdipSetClipRegion(nativeGraphics, getNat(region), CombineModeIntersect)); } Status IntersectClip(const RectF &rect) { - return NotImplemented; + return SetStatus( + DllExports::GdipSetClipRect(nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, CombineModeIntersect)); } - BOOL IsClipEmpty(VOID) const + BOOL + IsClipEmpty() const { BOOL result; SetStatus(DllExports::GdipIsClipEmpty(nativeGraphics, &result)); @@ -1158,12 +1260,16 @@ class Graphics : public GdiplusBase return result; } - BOOL IsVisibleClipEmpty(VOID) const + BOOL + IsVisibleClipEmpty() const { - return FALSE; /* FIXME: not available: - BOOL result; - SetStatus(DllExports::GdipIsVisibleClipEmpty(nativeGraphics, &result)); - return result;*/ +#if 1 + return FALSE; // FIXME +#else + BOOL flag = FALSE; + SetStatus(DllExports::GdipIsVisibleClipEmpty(nativeGraphics, &flag)); + return flag; +#endif } Status @@ -1247,20 +1353,23 @@ class Graphics : public GdiplusBase Status MultiplyTransform(Matrix *matrix, MatrixOrder order) { - return NotImplemented; + return SetStatus(DllExports::GdipMultiplyWorldTransform(nativeGraphics, getNat(matrix), order)); } VOID ReleaseHDC(HDC hdc) { + SetStatus(DllExports::GdipReleaseDC(nativeGraphics, hdc)); } - Status ResetClip(VOID) + Status + ResetClip() { return SetStatus(DllExports::GdipResetClip(nativeGraphics)); } - Status ResetTransform(VOID) + Status + ResetTransform() { return SetStatus(DllExports::GdipResetWorldTransform(nativeGraphics)); } @@ -1272,55 +1381,56 @@ class Graphics : public GdiplusBase } Status - RotateTransform(REAL angle, MatrixOrder order) + RotateTransform(REAL angle, MatrixOrder order = MatrixOrderPrepend) { return SetStatus(DllExports::GdipRotateWorldTransform(nativeGraphics, angle, order)); } - GraphicsState Save(VOID) + GraphicsState + Save() { return 0; } Status - ScaleTransform(REAL sx, REAL sy, MatrixOrder order) + ScaleTransform(REAL sx, REAL sy, MatrixOrder order = MatrixOrderPrepend) { return SetStatus(DllExports::GdipScaleWorldTransform(nativeGraphics, sx, sy, order)); } Status - SetClip(const Graphics *g, CombineMode combineMode) + SetClip(const Graphics *g, CombineMode combineMode = CombineModeReplace) { return SetStatus(DllExports::GdipSetClipGraphics(nativeGraphics, g ? g->nativeGraphics : NULL, combineMode)); } Status - SetClip(const GraphicsPath *path, CombineMode combineMode) + SetClip(const GraphicsPath *path, CombineMode combineMode = CombineModeReplace) { - return NotImplemented; + return SetStatus(DllExports::GdipSetClipPath(nativeGraphics, getNat(path), combineMode)); } Status - SetClip(const Region *region, CombineMode combineMode) + SetClip(const Region *region, CombineMode combineMode = CombineModeReplace) { - return NotImplemented; + return SetStatus(DllExports::GdipSetClipRegion(nativeGraphics, getNat(region), combineMode)); } Status - SetClip(const Rect &rect, CombineMode combineMode) + SetClip(const Rect &rect, CombineMode combineMode = CombineModeReplace) { return SetStatus( DllExports::GdipSetClipRectI(nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, combineMode)); } Status - SetClip(HRGN hRgn, CombineMode combineMode) + SetClip(HRGN hRgn, CombineMode combineMode = CombineModeReplace) { return SetStatus(DllExports::GdipSetClipHrgn(nativeGraphics, hRgn, combineMode)); } Status - SetClip(const RectF &rect, CombineMode combineMode) + SetClip(const RectF &rect, CombineMode combineMode = CombineModeReplace) { return SetStatus( DllExports::GdipSetClipRect(nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, combineMode)); @@ -1389,7 +1499,7 @@ class Graphics : public GdiplusBase Status SetTransform(const Matrix *matrix) { - return NotImplemented; + return SetStatus(DllExports::GdipSetWorldTransform(nativeGraphics, getNat(matrix))); } Status @@ -1398,6 +1508,12 @@ class Graphics : public GdiplusBase return SetStatus(DllExports::GdipTransformPointsI(nativeGraphics, destSpace, srcSpace, pts, count)); } + Status + TransformPoints(CoordinateSpace destSpace, CoordinateSpace srcSpace, PointF *pts, INT count) + { + return SetStatus(DllExports::GdipTransformPoints(nativeGraphics, destSpace, srcSpace, pts, count)); + } + Status TranslateClip(INT dx, INT dy) { @@ -1411,7 +1527,7 @@ class Graphics : public GdiplusBase } Status - TranslateTransform(REAL dx, REAL dy, MatrixOrder order) + TranslateTransform(REAL dx, REAL dy, MatrixOrder order = MatrixOrderPrepend) { return SetStatus(DllExports::GdipTranslateWorldTransform(nativeGraphics, dx, dy, order)); } @@ -1420,21 +1536,20 @@ class Graphics : public GdiplusBase Status SetStatus(Status status) const { - if (status == Ok) - return status; - this->status = status; + if (status != Ok) + lastStatus = status; return status; } VOID - SetGraphics(GpGraphics *graphics) + SetNativeGraphics(GpGraphics *graphics) { nativeGraphics = graphics; } protected: GpGraphics *nativeGraphics; - mutable Status status; + mutable Status lastStatus; // get native friend inline GpGraphics *& diff --git a/sdk/include/psdk/gdiplusheaders.h b/sdk/include/psdk/gdiplusheaders.h index 5c0b338eaba..d5ce75d866f 100644 --- a/sdk/include/psdk/gdiplusheaders.h +++ b/sdk/include/psdk/gdiplusheaders.h @@ -655,6 +655,13 @@ class CachedBitmap : public GdiplusBase CachedBitmap(const CachedBitmap &); CachedBitmap & operator=(const CachedBitmap &); + + // get native + friend inline GpCachedBitmap *& + getNat(const CachedBitmap *cb) + { + return const_cast<CachedBitmap *>(cb)->nativeCachedBitmap; + } }; class FontCollection : public GdiplusBase @@ -1367,6 +1374,13 @@ class Region : public GdiplusBase this->status = status; return status; } + + // get native + friend inline GpRegion *& + getNat(const Region *region) + { + return const_cast<Region *>(region)->region; + } }; class CustomLineCap : public GdiplusBase diff --git a/sdk/include/psdk/gdiplusimageattributes.h b/sdk/include/psdk/gdiplusimageattributes.h index 4cda385608b..ad14edb79d9 100644 --- a/sdk/include/psdk/gdiplusimageattributes.h +++ b/sdk/include/psdk/gdiplusimageattributes.h @@ -243,6 +243,13 @@ class ImageAttributes : public GdiplusBase ImageAttributes(const ImageAttributes &); ImageAttributes & operator=(const ImageAttributes &); + + // get native + friend inline GpImageAttributes *& + getNat(const ImageAttributes *ia) + { + return const_cast<ImageAttributes *>(ia)->nativeImageAttr; + } }; #endif /* _GDIPLUSIMAGEATTRIBUTES_H */ diff --git a/sdk/include/psdk/gdiplusmatrix.h b/sdk/include/psdk/gdiplusmatrix.h index 72981f72190..c822be2cd4d 100644 --- a/sdk/include/psdk/gdiplusmatrix.h +++ b/sdk/include/psdk/gdiplusmatrix.h @@ -204,6 +204,13 @@ class Matrix : public GdiplusBase lastStatus = status; return status; } + + // get native + friend inline GpMatrix *& + getNat(const Matrix *matrix) + { + return const_cast<Matrix *>(matrix)->nativeMatrix; + } }; #endif /* _GDIPLUSMATRIX_H */ diff --git a/sdk/include/psdk/gdipluspath.h b/sdk/include/psdk/gdipluspath.h index 73774dfa01a..a937784628c 100644 --- a/sdk/include/psdk/gdipluspath.h +++ b/sdk/include/psdk/gdipluspath.h @@ -26,6 +26,7 @@ class GraphicsPath : public GdiplusBase { friend class Region; friend class CustomLineCap; + friend class Graphics; public: GraphicsPath(const Point *points, const BYTE *types, INT count, FillMode fillMode) : nativePath(NULL) @@ -598,6 +599,13 @@ class GraphicsPath : public GdiplusBase GraphicsPath(const GraphicsPath &); GraphicsPath & operator=(const GraphicsPath &); + + // get native + friend inline GpPath *& + getNat(const GraphicsPath *path) + { + return const_cast<GraphicsPath *>(path)->nativePath; + } }; class GraphicsPathIterator : public GdiplusBase diff --git a/sdk/include/psdk/gdipluspen.h b/sdk/include/psdk/gdipluspen.h index 477c71f9fe3..76291aea017 100644 --- a/sdk/include/psdk/gdipluspen.h +++ b/sdk/include/psdk/gdipluspen.h @@ -396,6 +396,13 @@ class Pen : public GdiplusBase Pen(const Pen &); Pen & operator=(const Pen &); + + // get native + friend inline GpPen *& + getNat(const Pen *pen) + { + return const_cast<Pen *>(pen)->nativePen; + } }; #endif /* _GDIPLUSPEN_H */
4 years, 11 months
1
0
0
0
[reactos] 01/01: [SDK][INCLUDE] Rename Gdiplus::Graphics::graphics as nativeGraphics (#2210)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8ecbb44463ed0ce167521…
commit 8ecbb44463ed0ce167521e9a7af256f8d2021dbb Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Dec 31 19:24:59 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Dec 31 19:24:59 2019 +0900 [SDK][INCLUDE] Rename Gdiplus::Graphics::graphics as nativeGraphics (#2210) Make it w32api-compatible. CORE-16585 --- sdk/include/psdk/gdiplusgraphics.h | 264 ++++++++++++++++++++----------------- sdk/include/psdk/gdiplusheaders.h | 44 ++++--- 2 files changed, 170 insertions(+), 138 deletions(-) diff --git a/sdk/include/psdk/gdiplusgraphics.h b/sdk/include/psdk/gdiplusgraphics.h index 2d1988bae66..a573577f5d3 100644 --- a/sdk/include/psdk/gdiplusgraphics.h +++ b/sdk/include/psdk/gdiplusgraphics.h @@ -57,7 +57,7 @@ class Graphics : public GdiplusBase Status AddMetafileComment(const BYTE *data, UINT sizeData) { - return SetStatus(DllExports::GdipComment(graphics, sizeData, data)); + return SetStatus(DllExports::GdipComment(nativeGraphics, sizeData, data)); } GraphicsContainer BeginContainer(VOID) @@ -80,75 +80,77 @@ class Graphics : public GdiplusBase Status Clear(const Color &color) { - return SetStatus(DllExports::GdipGraphicsClear(graphics, color.GetValue())); + return SetStatus(DllExports::GdipGraphicsClear(nativeGraphics, color.GetValue())); } Status DrawArc(const Pen *pen, const Rect &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawArcI( - graphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); + nativeGraphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, + sweepAngle)); } Status DrawArc(const Pen *pen, const RectF &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawArcI( - graphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); + nativeGraphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, + sweepAngle)); } Status DrawArc(const Pen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawArc( - graphics, pen ? pen->nativePen : NULL, x, y, width, height, startAngle, sweepAngle)); + nativeGraphics, pen ? pen->nativePen : NULL, x, y, width, height, startAngle, sweepAngle)); } Status DrawArc(const Pen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawArcI( - graphics, pen ? pen->nativePen : NULL, x, y, width, height, startAngle, sweepAngle)); + nativeGraphics, pen ? pen->nativePen : NULL, x, y, width, height, startAngle, sweepAngle)); } Status DrawBezier(const Pen *pen, const Point &pt1, const Point &pt2, const Point &pt3, const Point &pt4) { return SetStatus(DllExports::GdipDrawBezierI( - graphics, pen ? pen->nativePen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)); + nativeGraphics, pen ? pen->nativePen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)); } Status DrawBezier(const Pen *pen, const PointF &pt1, const PointF &pt2, const PointF &pt3, const PointF &pt4) { return SetStatus(DllExports::GdipDrawBezier( - graphics, pen ? pen->nativePen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)); + nativeGraphics, pen ? pen->nativePen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)); } Status DrawBezier(const Pen *pen, REAL x1, REAL y1, REAL x2, REAL y2, REAL x3, REAL y3, REAL x4, REAL y4) { return SetStatus( - DllExports::GdipDrawBezier(graphics, pen ? pen->nativePen : NULL, x1, y1, x2, y2, x3, y3, x4, y4)); + DllExports::GdipDrawBezier(nativeGraphics, pen ? pen->nativePen : NULL, x1, y1, x2, y2, x3, y3, x4, y4)); } Status DrawBezier(const Pen *pen, INT x1, INT y1, INT x2, INT y2, INT x3, INT y3, INT x4, INT y4) { return SetStatus( - DllExports::GdipDrawBezierI(graphics, pen ? pen->nativePen : NULL, x1, y1, x2, y2, x3, y3, x4, y4)); + DllExports::GdipDrawBezierI(nativeGraphics, pen ? pen->nativePen : NULL, x1, y1, x2, y2, x3, y3, x4, y4)); } Status DrawBeziers(const Pen *pen, const Point *points, INT count) { - return SetStatus(DllExports::GdipDrawBeziersI(graphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawBeziersI(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); } Status DrawBeziers(const Pen *pen, const PointF *points, INT count) { - return SetStatus(DllExports::GdipDrawBeziers(graphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawBeziers(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); } Status @@ -160,65 +162,67 @@ class Graphics : public GdiplusBase Status DrawClosedCurve(const Pen *pen, const Point *points, INT count) { - return SetStatus(DllExports::GdipDrawClosedCurveI(graphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawClosedCurveI(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); } Status DrawClosedCurve(const Pen *pen, const PointF *points, INT count) { - return SetStatus(DllExports::GdipDrawClosedCurve(graphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawClosedCurve(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); } Status DrawClosedCurve(const Pen *pen, const PointF *points, INT count, REAL tension) { return SetStatus( - DllExports::GdipDrawClosedCurve2(graphics, pen ? pen->nativePen : NULL, points, count, tension)); + DllExports::GdipDrawClosedCurve2(nativeGraphics, pen ? pen->nativePen : NULL, points, count, tension)); } Status DrawClosedCurve(const Pen *pen, const Point *points, INT count, REAL tension) { return SetStatus( - DllExports::GdipDrawClosedCurve2I(graphics, pen ? pen->nativePen : NULL, points, count, tension)); + DllExports::GdipDrawClosedCurve2I(nativeGraphics, pen ? pen->nativePen : NULL, points, count, tension)); } Status DrawCurve(const Pen *pen, const Point *points, INT count) { - return SetStatus(DllExports::GdipDrawCurveI(graphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawCurveI(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); } Status DrawCurve(const Pen *pen, const PointF *points, INT count) { - return SetStatus(DllExports::GdipDrawCurve(graphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawCurve(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); } Status DrawCurve(const Pen *pen, const PointF *points, INT count, REAL tension) { - return SetStatus(DllExports::GdipDrawCurve2(graphics, pen ? pen->nativePen : NULL, points, count, tension)); + return SetStatus( + DllExports::GdipDrawCurve2(nativeGraphics, pen ? pen->nativePen : NULL, points, count, tension)); } Status DrawCurve(const Pen *pen, const Point *points, INT count, INT offset, INT numberOfSegments, REAL tension) { return SetStatus(DllExports::GdipDrawCurve3I( - graphics, pen ? pen->nativePen : NULL, points, count, offset, numberOfSegments, tension)); + nativeGraphics, pen ? pen->nativePen : NULL, points, count, offset, numberOfSegments, tension)); } Status DrawCurve(const Pen *pen, const PointF *points, INT count, INT offset, INT numberOfSegments, REAL tension) { return SetStatus(DllExports::GdipDrawCurve3( - graphics, pen ? pen->nativePen : NULL, points, count, offset, numberOfSegments, tension)); + nativeGraphics, pen ? pen->nativePen : NULL, points, count, offset, numberOfSegments, tension)); } Status DrawCurve(const Pen *pen, const Point *points, INT count, REAL tension) { - return SetStatus(DllExports::GdipDrawCurve2I(graphics, pen ? pen->nativePen : NULL, points, count, tension)); + return SetStatus( + DllExports::GdipDrawCurve2I(nativeGraphics, pen ? pen->nativePen : NULL, points, count, tension)); } Status @@ -238,26 +242,27 @@ class Graphics : public GdiplusBase DrawEllipse(const Pen *pen, const Rect &rect) { return SetStatus(DllExports::GdipDrawEllipseI( - graphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + nativeGraphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status DrawEllipse(const Pen *pen, REAL x, REAL y, REAL width, REAL height) { - return SetStatus(DllExports::GdipDrawEllipse(graphics, pen ? pen->nativePen : NULL, x, y, width, height)); + return SetStatus(DllExports::GdipDrawEllipse(nativeGraphics, pen ? pen->nativePen : NULL, x, y, width, height)); } Status DrawEllipse(const Pen *pen, const RectF &rect) { return SetStatus(DllExports::GdipDrawEllipse( - graphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + nativeGraphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status DrawEllipse(const Pen *pen, INT x, INT y, INT width, INT height) { - return SetStatus(DllExports::GdipDrawEllipseI(graphics, pen ? pen->nativePen : NULL, x, y, width, height)); + return SetStatus( + DllExports::GdipDrawEllipseI(nativeGraphics, pen ? pen->nativePen : NULL, x, y, width, height)); } Status @@ -401,37 +406,39 @@ class Graphics : public GdiplusBase Status DrawLine(const Pen *pen, const Point &pt1, const Point &pt2) { - return SetStatus(DllExports::GdipDrawLineI(graphics, pen ? pen->nativePen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y)); + return SetStatus( + DllExports::GdipDrawLineI(nativeGraphics, pen ? pen->nativePen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y)); } Status DrawLine(const Pen *pen, const PointF &pt1, const Point &pt2) { - return SetStatus(DllExports::GdipDrawLine(graphics, pen ? pen->nativePen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y)); + return SetStatus( + DllExports::GdipDrawLine(nativeGraphics, pen ? pen->nativePen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y)); } Status DrawLine(const Pen *pen, REAL x1, REAL y1, REAL x2, REAL y2) { - return SetStatus(DllExports::GdipDrawLine(graphics, pen ? pen->nativePen : NULL, x1, y1, x2, y2)); + return SetStatus(DllExports::GdipDrawLine(nativeGraphics, pen ? pen->nativePen : NULL, x1, y1, x2, y2)); } Status DrawLine(const Pen *pen, INT x1, INT y1, INT x2, INT y2) { - return SetStatus(DllExports::GdipDrawLine(graphics, pen ? pen->nativePen : NULL, x1, y1, x2, y2)); + return SetStatus(DllExports::GdipDrawLine(nativeGraphics, pen ? pen->nativePen : NULL, x1, y1, x2, y2)); } Status DrawLines(const Pen *pen, const Point *points, INT count) { - return SetStatus(DllExports::GdipDrawLinesI(graphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawLinesI(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); } Status DrawLines(const Pen *pen, const PointF *points, INT count) { - return SetStatus(DllExports::GdipDrawLines(graphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawLines(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); } Status @@ -444,78 +451,82 @@ class Graphics : public GdiplusBase DrawPie(const Pen *pen, const Rect &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawPieI( - graphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); + nativeGraphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, + sweepAngle)); } Status DrawPie(const Pen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawPieI( - graphics, pen ? pen->nativePen : NULL, x, y, width, height, startAngle, sweepAngle)); + nativeGraphics, pen ? pen->nativePen : NULL, x, y, width, height, startAngle, sweepAngle)); } Status DrawPie(const Pen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawPie( - graphics, pen ? pen->nativePen : NULL, x, y, width, height, startAngle, sweepAngle)); + nativeGraphics, pen ? pen->nativePen : NULL, x, y, width, height, startAngle, sweepAngle)); } Status DrawPie(const Pen *pen, const RectF &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawPie( - graphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); + nativeGraphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, + sweepAngle)); } Status DrawPolygon(const Pen *pen, const Point *points, INT count) { - return SetStatus(DllExports::GdipDrawPolygonI(graphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawPolygonI(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); } Status DrawPolygon(const Pen *pen, const PointF *points, INT count) { - return SetStatus(DllExports::GdipDrawPolygon(graphics, pen ? pen->nativePen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawPolygon(nativeGraphics, pen ? pen->nativePen : NULL, points, count)); } Status DrawRectangle(const Pen *pen, const Rect &rect) { return SetStatus(DllExports::GdipDrawRectangleI( - graphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + nativeGraphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status DrawRectangle(const Pen *pen, INT x, INT y, INT width, INT height) { - return SetStatus(DllExports::GdipDrawRectangleI(graphics, pen ? pen->nativePen : NULL, x, y, width, height)); + return SetStatus( + DllExports::GdipDrawRectangleI(nativeGraphics, pen ? pen->nativePen : NULL, x, y, width, height)); } Status DrawRectangle(const Pen *pen, REAL x, REAL y, REAL width, REAL height) { - return SetStatus(DllExports::GdipDrawRectangle(graphics, pen ? pen->nativePen : NULL, x, y, width, height)); + return SetStatus( + DllExports::GdipDrawRectangle(nativeGraphics, pen ? pen->nativePen : NULL, x, y, width, height)); } Status DrawRectangle(const Pen *pen, const RectF &rect) { return SetStatus(DllExports::GdipDrawRectangleI( - graphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + nativeGraphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status DrawRectangles(const Pen *pen, const Rect *rects, INT count) { - return SetStatus(DllExports::GdipDrawRectanglesI(graphics, pen ? pen->nativePen : NULL, rects, count)); + return SetStatus(DllExports::GdipDrawRectanglesI(nativeGraphics, pen ? pen->nativePen : NULL, rects, count)); } Status DrawRectangles(const Pen *pen, const RectF *rects, INT count) { - return SetStatus(DllExports::GdipDrawRectangles(graphics, pen ? pen->nativePen : NULL, rects, count)); + return SetStatus(DllExports::GdipDrawRectangles(nativeGraphics, pen ? pen->nativePen : NULL, rects, count)); } Status @@ -551,7 +562,7 @@ class Graphics : public GdiplusBase Status EndContainer(GraphicsContainer state) { - return SetStatus(DllExports::GdipEndContainer(graphics, state)); + return SetStatus(DllExports::GdipEndContainer(nativeGraphics, state)); } Status @@ -723,54 +734,57 @@ class Graphics : public GdiplusBase Status FillClosedCurve(const Brush *brush, const Point *points, INT count) { - return SetStatus(DllExports::GdipFillClosedCurveI(graphics, brush ? brush->nativeBrush : NULL, points, count)); + return SetStatus( + DllExports::GdipFillClosedCurveI(nativeGraphics, brush ? brush->nativeBrush : NULL, points, count)); } Status FillClosedCurve(const Brush *brush, const Point *points, INT count, FillMode fillMode, REAL tension) { return SetStatus(DllExports::GdipFillClosedCurve2I( - graphics, brush ? brush->nativeBrush : NULL, points, count, tension, fillMode)); + nativeGraphics, brush ? brush->nativeBrush : NULL, points, count, tension, fillMode)); } Status FillClosedCurve(const Brush *brush, const PointF *points, INT count) { - return SetStatus(DllExports::GdipFillClosedCurve(graphics, brush ? brush->nativeBrush : NULL, points, count)); + return SetStatus( + DllExports::GdipFillClosedCurve(nativeGraphics, brush ? brush->nativeBrush : NULL, points, count)); } Status FillClosedCurve(const Brush *brush, const PointF *points, INT count, FillMode fillMode, REAL tension) { return SetStatus(DllExports::GdipFillClosedCurve2( - graphics, brush ? brush->nativeBrush : NULL, points, count, tension, fillMode)); + nativeGraphics, brush ? brush->nativeBrush : NULL, points, count, tension, fillMode)); } Status FillEllipse(const Brush *brush, const Rect &rect) { return SetStatus(DllExports::GdipFillEllipseI( - graphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + nativeGraphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status FillEllipse(const Brush *brush, REAL x, REAL y, REAL width, REAL height) { - return SetStatus(DllExports::GdipFillEllipse(graphics, brush ? brush->nativeBrush : NULL, x, y, width, height)); + return SetStatus( + DllExports::GdipFillEllipse(nativeGraphics, brush ? brush->nativeBrush : NULL, x, y, width, height)); } Status FillEllipse(const Brush *brush, const RectF &rect) { return SetStatus(DllExports::GdipFillEllipse( - graphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + nativeGraphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status FillEllipse(const Brush *brush, INT x, INT y, INT width, INT height) { return SetStatus( - DllExports::GdipFillEllipseI(graphics, brush ? brush->nativeBrush : NULL, x, y, width, height)); + DllExports::GdipFillEllipseI(nativeGraphics, brush ? brush->nativeBrush : NULL, x, y, width, height)); } Status @@ -783,7 +797,7 @@ class Graphics : public GdiplusBase FillPie(const Brush *brush, const Rect &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipFillPieI( - graphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, + nativeGraphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); } @@ -791,88 +805,92 @@ class Graphics : public GdiplusBase FillPie(const Brush *brush, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipFillPieI( - graphics, brush ? brush->nativeBrush : NULL, x, y, width, height, startAngle, sweepAngle)); + nativeGraphics, brush ? brush->nativeBrush : NULL, x, y, width, height, startAngle, sweepAngle)); } Status FillPie(const Brush *brush, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipFillPie( - graphics, brush ? brush->nativeBrush : NULL, x, y, width, height, startAngle, sweepAngle)); + nativeGraphics, brush ? brush->nativeBrush : NULL, x, y, width, height, startAngle, sweepAngle)); } Status FillPie(const Brush *brush, RectF &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipFillPie( - graphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, + nativeGraphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); } Status FillPolygon(const Brush *brush, const Point *points, INT count) { - return SetStatus(DllExports::GdipFillPolygon2I(graphics, brush ? brush->nativeBrush : NULL, points, count)); + return SetStatus( + DllExports::GdipFillPolygon2I(nativeGraphics, brush ? brush->nativeBrush : NULL, points, count)); } Status FillPolygon(const Brush *brush, const PointF *points, INT count) { - return SetStatus(DllExports::GdipFillPolygon2(graphics, brush ? brush->nativeBrush : NULL, points, count)); + return SetStatus( + DllExports::GdipFillPolygon2(nativeGraphics, brush ? brush->nativeBrush : NULL, points, count)); } Status FillPolygon(const Brush *brush, const Point *points, INT count, FillMode fillMode) { return SetStatus( - DllExports::GdipFillPolygonI(graphics, brush ? brush->nativeBrush : NULL, points, count, fillMode)); + DllExports::GdipFillPolygonI(nativeGraphics, brush ? brush->nativeBrush : NULL, points, count, fillMode)); } Status FillPolygon(const Brush *brush, const PointF *points, INT count, FillMode fillMode) { return SetStatus( - DllExports::GdipFillPolygon(graphics, brush ? brush->nativeBrush : NULL, points, count, fillMode)); + DllExports::GdipFillPolygon(nativeGraphics, brush ? brush->nativeBrush : NULL, points, count, fillMode)); } Status FillRectangle(const Brush *brush, const Rect &rect) { return SetStatus(DllExports::GdipFillRectangleI( - graphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + nativeGraphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status FillRectangle(const Brush *brush, const RectF &rect) { return SetStatus(DllExports::GdipFillRectangle( - graphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + nativeGraphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status FillRectangle(const Brush *brush, REAL x, REAL y, REAL width, REAL height) { return SetStatus( - DllExports::GdipFillRectangle(graphics, brush ? brush->nativeBrush : NULL, x, y, width, height)); + DllExports::GdipFillRectangle(nativeGraphics, brush ? brush->nativeBrush : NULL, x, y, width, height)); } Status FillRectangle(const Brush *brush, INT x, INT y, INT width, INT height) { return SetStatus( - DllExports::GdipFillRectangleI(graphics, brush ? brush->nativeBrush : NULL, x, y, width, height)); + DllExports::GdipFillRectangleI(nativeGraphics, brush ? brush->nativeBrush : NULL, x, y, width, height)); } Status FillRectangles(const Brush *brush, const Rect *rects, INT count) { - return SetStatus(DllExports::GdipFillRectanglesI(graphics, brush ? brush->nativeBrush : NULL, rects, count)); + return SetStatus( + DllExports::GdipFillRectanglesI(nativeGraphics, brush ? brush->nativeBrush : NULL, rects, count)); } Status FillRectangles(const Brush *brush, const RectF *rects, INT count) { - return SetStatus(DllExports::GdipFillRectangles(graphics, brush ? brush->nativeBrush : NULL, rects, count)); + return SetStatus( + DllExports::GdipFillRectangles(nativeGraphics, brush ? brush->nativeBrush : NULL, rects, count)); } Status @@ -919,40 +937,40 @@ class Graphics : public GdiplusBase Status GetClipBounds(Rect *rect) const { - return SetStatus(DllExports::GdipGetClipBoundsI(graphics, rect)); + return SetStatus(DllExports::GdipGetClipBoundsI(nativeGraphics, rect)); } Status GetClipBounds(RectF *rect) const { - return SetStatus(DllExports::GdipGetClipBounds(graphics, rect)); + return SetStatus(DllExports::GdipGetClipBounds(nativeGraphics, rect)); } CompositingMode GetCompositingMode(VOID) { CompositingMode compositingMode; - SetStatus(DllExports::GdipGetCompositingMode(graphics, &compositingMode)); + SetStatus(DllExports::GdipGetCompositingMode(nativeGraphics, &compositingMode)); return compositingMode; } CompositingQuality GetCompositingQuality(VOID) { CompositingQuality compositingQuality; - SetStatus(DllExports::GdipGetCompositingQuality(graphics, &compositingQuality)); + SetStatus(DllExports::GdipGetCompositingQuality(nativeGraphics, &compositingQuality)); return compositingQuality; } REAL GetDpiX(VOID) { REAL dpi; - SetStatus(DllExports::GdipGetDpiX(graphics, &dpi)); + SetStatus(DllExports::GdipGetDpiX(nativeGraphics, &dpi)); return dpi; } REAL GetDpiY(VOID) { REAL dpi; - SetStatus(DllExports::GdipGetDpiY(graphics, &dpi)); + SetStatus(DllExports::GdipGetDpiY(nativeGraphics, &dpi)); return dpi; } @@ -969,7 +987,7 @@ class Graphics : public GdiplusBase InterpolationMode GetInterpolationMode(VOID) { InterpolationMode interpolationMode; - SetStatus(DllExports::GdipGetInterpolationMode(graphics, &interpolationMode)); + SetStatus(DllExports::GdipGetInterpolationMode(nativeGraphics, &interpolationMode)); return interpolationMode; } @@ -987,48 +1005,49 @@ class Graphics : public GdiplusBase REAL GetPageScale(VOID) { REAL scale; - SetStatus(DllExports::GdipGetPageScale(graphics, &scale)); + SetStatus(DllExports::GdipGetPageScale(nativeGraphics, &scale)); return scale; } Unit GetPageUnit(VOID) { Unit unit; - SetStatus(DllExports::GdipGetPageUnit(graphics, &unit)); + SetStatus(DllExports::GdipGetPageUnit(nativeGraphics, &unit)); return unit; } PixelOffsetMode GetPixelOffsetMode(VOID) { PixelOffsetMode pixelOffsetMode; - SetStatus(DllExports::GdipGetPixelOffsetMode(graphics, &pixelOffsetMode)); + SetStatus(DllExports::GdipGetPixelOffsetMode(nativeGraphics, &pixelOffsetMode)); return pixelOffsetMode; } Status GetRenderingOrigin(INT *x, INT *y) { - return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipGetRenderingOrigin(graphics, x, y)); + return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipGetRenderingOrigin(nativeGraphics, x, + // y)); } SmoothingMode GetSmoothingMode(VOID) const { SmoothingMode smoothingMode; - SetStatus(DllExports::GdipGetSmoothingMode(graphics, &smoothingMode)); + SetStatus(DllExports::GdipGetSmoothingMode(nativeGraphics, &smoothingMode)); return smoothingMode; } UINT GetTextContrast(VOID) const { UINT contrast; - SetStatus(DllExports::GdipGetTextContrast(graphics, &contrast)); + SetStatus(DllExports::GdipGetTextContrast(nativeGraphics, &contrast)); return contrast; } TextRenderingHint GetTextRenderingHint(VOID) const { TextRenderingHint mode; - SetStatus(DllExports::GdipGetTextRenderingHint(graphics, &mode)); + SetStatus(DllExports::GdipGetTextRenderingHint(nativeGraphics, &mode)); return mode; } @@ -1041,13 +1060,13 @@ class Graphics : public GdiplusBase Status GetVisibleClipBounds(Rect *rect) const { - return SetStatus(DllExports::GdipGetVisibleClipBoundsI(graphics, rect)); + return SetStatus(DllExports::GdipGetVisibleClipBoundsI(nativeGraphics, rect)); } Status GetVisibleClipBounds(RectF *rect) const { - return SetStatus(DllExports::GdipGetVisibleClipBounds(graphics, rect)); + return SetStatus(DllExports::GdipGetVisibleClipBounds(nativeGraphics, rect)); } Status @@ -1071,7 +1090,7 @@ class Graphics : public GdiplusBase BOOL IsClipEmpty(VOID) const { BOOL result; - SetStatus(DllExports::GdipIsClipEmpty(graphics, &result)); + SetStatus(DllExports::GdipIsClipEmpty(nativeGraphics, &result)); return result; } @@ -1079,7 +1098,7 @@ class Graphics : public GdiplusBase IsVisible(const Point &point) const { BOOL result; - SetStatus(DllExports::GdipIsVisiblePointI(graphics, point.X, point.Y, &result)); + SetStatus(DllExports::GdipIsVisiblePointI(nativeGraphics, point.X, point.Y, &result)); return result; } @@ -1087,7 +1106,7 @@ class Graphics : public GdiplusBase IsVisible(const Rect &rect) const { BOOL result; - SetStatus(DllExports::GdipIsVisibleRectI(graphics, rect.X, rect.Y, rect.Width, rect.Height, &result)); + SetStatus(DllExports::GdipIsVisibleRectI(nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, &result)); return result; } @@ -1095,7 +1114,7 @@ class Graphics : public GdiplusBase IsVisible(REAL x, REAL y) const { BOOL result; - SetStatus(DllExports::GdipIsVisiblePoint(graphics, x, y, &result)); + SetStatus(DllExports::GdipIsVisiblePoint(nativeGraphics, x, y, &result)); return result; } @@ -1103,7 +1122,7 @@ class Graphics : public GdiplusBase IsVisible(const RectF &rect) const { BOOL result; - SetStatus(DllExports::GdipIsVisibleRect(graphics, rect.X, rect.Y, rect.Width, rect.Height, &result)); + SetStatus(DllExports::GdipIsVisibleRect(nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, &result)); return result; } @@ -1111,7 +1130,7 @@ class Graphics : public GdiplusBase IsVisible(INT x, INT y, INT width, INT height) const { BOOL result; - SetStatus(DllExports::GdipIsVisibleRectI(graphics, x, y, width, height, &result)); + SetStatus(DllExports::GdipIsVisibleRectI(nativeGraphics, x, y, width, height, &result)); return result; } @@ -1119,7 +1138,7 @@ class Graphics : public GdiplusBase IsVisible(INT x, INT y) const { BOOL result; - SetStatus(DllExports::GdipIsVisiblePointI(graphics, x, y, &result)); + SetStatus(DllExports::GdipIsVisiblePointI(nativeGraphics, x, y, &result)); return result; } @@ -1127,7 +1146,7 @@ class Graphics : public GdiplusBase IsVisible(const PointF &point) const { BOOL result; - SetStatus(DllExports::GdipIsVisiblePoint(graphics, point.X, point.Y, &result)); + SetStatus(DllExports::GdipIsVisiblePoint(nativeGraphics, point.X, point.Y, &result)); return result; } @@ -1135,7 +1154,7 @@ class Graphics : public GdiplusBase IsVisible(REAL x, REAL y, REAL width, REAL height) const { BOOL result; - SetStatus(DllExports::GdipIsVisibleRect(graphics, x, y, width, height, &result)); + SetStatus(DllExports::GdipIsVisibleRect(nativeGraphics, x, y, width, height, &result)); return result; } @@ -1143,7 +1162,7 @@ class Graphics : public GdiplusBase { return FALSE; /* FIXME: not available: BOOL result; - SetStatus(DllExports::GdipIsVisibleClipEmpty(graphics, &result)); + SetStatus(DllExports::GdipIsVisibleClipEmpty(nativeGraphics, &result)); return result;*/ } @@ -1238,12 +1257,12 @@ class Graphics : public GdiplusBase Status ResetClip(VOID) { - return SetStatus(DllExports::GdipResetClip(graphics)); + return SetStatus(DllExports::GdipResetClip(nativeGraphics)); } Status ResetTransform(VOID) { - return SetStatus(DllExports::GdipResetWorldTransform(graphics)); + return SetStatus(DllExports::GdipResetWorldTransform(nativeGraphics)); } Status @@ -1255,7 +1274,7 @@ class Graphics : public GdiplusBase Status RotateTransform(REAL angle, MatrixOrder order) { - return SetStatus(DllExports::GdipRotateWorldTransform(graphics, angle, order)); + return SetStatus(DllExports::GdipRotateWorldTransform(nativeGraphics, angle, order)); } GraphicsState Save(VOID) @@ -1266,13 +1285,13 @@ class Graphics : public GdiplusBase Status ScaleTransform(REAL sx, REAL sy, MatrixOrder order) { - return SetStatus(DllExports::GdipScaleWorldTransform(graphics, sx, sy, order)); + return SetStatus(DllExports::GdipScaleWorldTransform(nativeGraphics, sx, sy, order)); } Status SetClip(const Graphics *g, CombineMode combineMode) { - return SetStatus(DllExports::GdipSetClipGraphics(graphics, g ? g->graphics : NULL, combineMode)); + return SetStatus(DllExports::GdipSetClipGraphics(nativeGraphics, g ? g->nativeGraphics : NULL, combineMode)); } Status @@ -1290,79 +1309,81 @@ class Graphics : public GdiplusBase Status SetClip(const Rect &rect, CombineMode combineMode) { - return SetStatus(DllExports::GdipSetClipRectI(graphics, rect.X, rect.Y, rect.Width, rect.Height, combineMode)); + return SetStatus( + DllExports::GdipSetClipRectI(nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, combineMode)); } Status SetClip(HRGN hRgn, CombineMode combineMode) { - return SetStatus(DllExports::GdipSetClipHrgn(graphics, hRgn, combineMode)); + return SetStatus(DllExports::GdipSetClipHrgn(nativeGraphics, hRgn, combineMode)); } Status SetClip(const RectF &rect, CombineMode combineMode) { - return SetStatus(DllExports::GdipSetClipRect(graphics, rect.X, rect.Y, rect.Width, rect.Height, combineMode)); + return SetStatus( + DllExports::GdipSetClipRect(nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, combineMode)); } Status SetCompositingMode(CompositingMode compositingMode) { - return SetStatus(DllExports::GdipSetCompositingMode(graphics, compositingMode)); + return SetStatus(DllExports::GdipSetCompositingMode(nativeGraphics, compositingMode)); } Status SetCompositingQuality(CompositingQuality compositingQuality) { - return SetStatus(DllExports::GdipSetCompositingQuality(graphics, compositingQuality)); + return SetStatus(DllExports::GdipSetCompositingQuality(nativeGraphics, compositingQuality)); } Status SetInterpolationMode(InterpolationMode interpolationMode) { - return SetStatus(DllExports::GdipSetInterpolationMode(graphics, interpolationMode)); + return SetStatus(DllExports::GdipSetInterpolationMode(nativeGraphics, interpolationMode)); } Status SetPageScale(REAL scale) { - return SetStatus(DllExports::GdipSetPageScale(graphics, scale)); + return SetStatus(DllExports::GdipSetPageScale(nativeGraphics, scale)); } Status SetPageUnit(Unit unit) { - return SetStatus(DllExports::GdipSetPageUnit(graphics, unit)); + return SetStatus(DllExports::GdipSetPageUnit(nativeGraphics, unit)); } Status SetPixelOffsetMode(PixelOffsetMode pixelOffsetMode) { - return SetStatus(DllExports::GdipSetPixelOffsetMode(graphics, pixelOffsetMode)); + return SetStatus(DllExports::GdipSetPixelOffsetMode(nativeGraphics, pixelOffsetMode)); } Status SetRenderingOrigin(INT x, INT y) { - return SetStatus(DllExports::GdipSetRenderingOrigin(graphics, x, y)); + return SetStatus(DllExports::GdipSetRenderingOrigin(nativeGraphics, x, y)); } Status SetSmoothingMode(SmoothingMode smoothingMode) { - return SetStatus(DllExports::GdipSetSmoothingMode(graphics, smoothingMode)); + return SetStatus(DllExports::GdipSetSmoothingMode(nativeGraphics, smoothingMode)); } Status SetTextContrast(UINT contrast) { - return SetStatus(DllExports::GdipSetTextContrast(graphics, contrast)); + return SetStatus(DllExports::GdipSetTextContrast(nativeGraphics, contrast)); } Status SetTextRenderingHint(TextRenderingHint newMode) { - return SetStatus(DllExports::GdipSetTextRenderingHint(graphics, newMode)); + return SetStatus(DllExports::GdipSetTextRenderingHint(nativeGraphics, newMode)); } Status @@ -1374,25 +1395,25 @@ class Graphics : public GdiplusBase Status TransformPoints(CoordinateSpace destSpace, CoordinateSpace srcSpace, Point *pts, INT count) { - return SetStatus(DllExports::GdipTransformPointsI(graphics, destSpace, srcSpace, pts, count)); + return SetStatus(DllExports::GdipTransformPointsI(nativeGraphics, destSpace, srcSpace, pts, count)); } Status TranslateClip(INT dx, INT dy) { - return SetStatus(DllExports::GdipTranslateClipI(graphics, dx, dy)); + return SetStatus(DllExports::GdipTranslateClipI(nativeGraphics, dx, dy)); } Status TranslateClip(REAL dx, REAL dy) { - return SetStatus(DllExports::GdipTranslateClip(graphics, dx, dy)); + return SetStatus(DllExports::GdipTranslateClip(nativeGraphics, dx, dy)); } Status TranslateTransform(REAL dx, REAL dy, MatrixOrder order) { - return SetStatus(DllExports::GdipTranslateWorldTransform(graphics, dx, dy, order)); + return SetStatus(DllExports::GdipTranslateWorldTransform(nativeGraphics, dx, dy, order)); } private: @@ -1408,12 +1429,19 @@ class Graphics : public GdiplusBase VOID SetGraphics(GpGraphics *graphics) { - this->graphics = graphics; + nativeGraphics = graphics; } - private: + protected: + GpGraphics *nativeGraphics; mutable Status status; - GpGraphics *graphics; + + // get native + friend inline GpGraphics *& + getNat(const Graphics *graph) + { + return const_cast<Graphics *>(graph)->nativeGraphics; + } }; #endif /* _GDIPLUSGRAPHICS_H */ diff --git a/sdk/include/psdk/gdiplusheaders.h b/sdk/include/psdk/gdiplusheaders.h index c28e78fd5a1..5c0b338eaba 100644 --- a/sdk/include/psdk/gdiplusheaders.h +++ b/sdk/include/psdk/gdiplusheaders.h @@ -386,6 +386,10 @@ class Image : public GdiplusBase } }; +// get native +GpGraphics *& +getNat(const Graphics *graph); + class Bitmap : public Image { friend class CachedBitmap; @@ -399,7 +403,7 @@ class Bitmap : public Image Bitmap(INT width, INT height, Graphics *target) { GpBitmap *bitmap = NULL; - lastStatus = DllExports::GdipCreateBitmapFromGraphics(width, height, target ? target->graphics : NULL, &bitmap); + lastStatus = DllExports::GdipCreateBitmapFromGraphics(width, height, target ? getNat(target) : NULL, &bitmap); SetNativeImage(bitmap); } @@ -628,7 +632,7 @@ class CachedBitmap : public GdiplusBase { nativeCachedBitmap = NULL; lastStatus = DllExports::GdipCreateCachedBitmap( - bitmap->GetNativeBitmap(), graphics ? graphics->graphics : NULL, &nativeCachedBitmap); + bitmap->GetNativeBitmap(), graphics ? getNat(graphics) : NULL, &nativeCachedBitmap); } ~CachedBitmap() @@ -913,7 +917,7 @@ class Font : public GdiplusBase GetHeight(const Graphics *graphics) const { REAL height; - SetStatus(DllExports::GdipGetFontHeight(font, graphics ? graphics->graphics : NULL, &height)); + SetStatus(DllExports::GdipGetFontHeight(font, graphics ? getNat(graphics) : NULL, &height)); return height; } @@ -934,13 +938,13 @@ class Font : public GdiplusBase Status GetLogFontA(const Graphics *g, LOGFONTA *logfontA) const { - return SetStatus(DllExports::GdipGetLogFontA(font, g ? g->graphics : NULL, logfontA)); + return SetStatus(DllExports::GdipGetLogFontA(font, g ? getNat(g) : NULL, logfontA)); } Status GetLogFontW(const Graphics *g, LOGFONTW *logfontW) const { - return SetStatus(DllExports::GdipGetLogFontW(font, g ? g->graphics : NULL, logfontW)); + return SetStatus(DllExports::GdipGetLogFontW(font, g ? getNat(g) : NULL, logfontW)); } REAL @@ -1067,8 +1071,8 @@ class Region : public GdiplusBase Equals(const Region *region, const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsEqualRegion( - this->region, region ? region->region : NULL, g ? g->graphics : NULL, &result)); + SetStatus( + DllExports::GdipIsEqualRegion(this->region, region ? region->region : NULL, g ? getNat(g) : NULL, &result)); return result; } @@ -1106,13 +1110,13 @@ class Region : public GdiplusBase Status GetBounds(Rect *rect, const Graphics *g) const { - return SetStatus(DllExports::GdipGetRegionBoundsI(region, g ? g->graphics : NULL, rect)); + return SetStatus(DllExports::GdipGetRegionBoundsI(region, g ? getNat(g) : NULL, rect)); } Status GetBounds(RectF *rect, const Graphics *g) const { - return SetStatus(DllExports::GdipGetRegionBounds(region, g ? g->graphics : NULL, rect)); + return SetStatus(DllExports::GdipGetRegionBounds(region, g ? getNat(g) : NULL, rect)); } Status @@ -1133,7 +1137,7 @@ class Region : public GdiplusBase GetHRGN(const Graphics *g) const { HRGN hRgn; - SetStatus(DllExports::GdipGetRegionHRgn(region, g ? g->graphics : NULL, &hRgn)); + SetStatus(DllExports::GdipGetRegionHRgn(region, g ? getNat(g) : NULL, &hRgn)); return hRgn; } @@ -1193,7 +1197,7 @@ class Region : public GdiplusBase IsEmpty(const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsEmptyRegion(region, g ? g->graphics : NULL, &result)); + SetStatus(DllExports::GdipIsEmptyRegion(region, g ? getNat(g) : NULL, &result)); return result; } @@ -1201,7 +1205,7 @@ class Region : public GdiplusBase IsInfinite(const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsInfiniteRegion(region, g ? g->graphics : NULL, &result)); + SetStatus(DllExports::GdipIsInfiniteRegion(region, g ? getNat(g) : NULL, &result)); return result; } @@ -1209,7 +1213,7 @@ class Region : public GdiplusBase IsVisible(const PointF &point, const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsVisibleRegionPoint(region, point.X, point.Y, g ? g->graphics : NULL, &result)); + SetStatus(DllExports::GdipIsVisibleRegionPoint(region, point.X, point.Y, g ? getNat(g) : NULL, &result)); return result; } @@ -1218,7 +1222,7 @@ class Region : public GdiplusBase { BOOL result; SetStatus(DllExports::GdipIsVisibleRegionRect( - region, rect.X, rect.Y, rect.Width, rect.Height, g ? g->graphics : NULL, &result)); + region, rect.X, rect.Y, rect.Width, rect.Height, g ? getNat(g) : NULL, &result)); return result; } @@ -1227,7 +1231,7 @@ class Region : public GdiplusBase { BOOL result; SetStatus(DllExports::GdipIsVisibleRegionRectI( - region, rect.X, rect.Y, rect.Width, rect.Height, g ? g->graphics : NULL, &result)); + region, rect.X, rect.Y, rect.Width, rect.Height, g ? getNat(g) : NULL, &result)); return result; } @@ -1235,7 +1239,7 @@ class Region : public GdiplusBase IsVisible(INT x, INT y, const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsVisibleRegionPointI(region, x, y, g ? g->graphics : NULL, &result)); + SetStatus(DllExports::GdipIsVisibleRegionPointI(region, x, y, g ? getNat(g) : NULL, &result)); return result; } @@ -1243,7 +1247,7 @@ class Region : public GdiplusBase IsVisible(REAL x, REAL y, const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsVisibleRegionPoint(region, x, y, g ? g->graphics : NULL, &result)); + SetStatus(DllExports::GdipIsVisibleRegionPoint(region, x, y, g ? getNat(g) : NULL, &result)); return result; } @@ -1251,7 +1255,7 @@ class Region : public GdiplusBase IsVisible(INT x, INT y, INT width, INT height, const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsVisibleRegionRectI(region, x, y, width, height, g ? g->graphics : NULL, &result)); + SetStatus(DllExports::GdipIsVisibleRegionRectI(region, x, y, width, height, g ? getNat(g) : NULL, &result)); return result; } @@ -1259,7 +1263,7 @@ class Region : public GdiplusBase IsVisible(const Point &point, const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsVisibleRegionPointI(region, point.X, point.Y, g ? g->graphics : NULL, &result)); + SetStatus(DllExports::GdipIsVisibleRegionPointI(region, point.X, point.Y, g ? getNat(g) : NULL, &result)); return result; } @@ -1267,7 +1271,7 @@ class Region : public GdiplusBase IsVisible(REAL x, REAL y, REAL width, REAL height, const Graphics *g) const { BOOL result; - SetStatus(DllExports::GdipIsVisibleRegionRect(region, x, y, width, height, g ? g->graphics : NULL, &result)); + SetStatus(DllExports::GdipIsVisibleRegionRect(region, x, y, width, height, g ? getNat(g) : NULL, &result)); return result; }
4 years, 11 months
1
0
0
0
[reactos] 01/01: [SDK][INCLUDE] Move Gdiplus::TextureBrush codes (#2208)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1a3c77dc2fde6cae32f9a…
commit 1a3c77dc2fde6cae32f9ad38f1515cc0feababb0 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Dec 31 17:53:35 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Dec 31 17:53:35 2019 +0900 [SDK][INCLUDE] Move Gdiplus::TextureBrush codes (#2208) Move the code into the place it should be in. CORE-16585 --- sdk/include/psdk/gdiplusbrush.h | 68 ++++++++++++++++++++++++++++++++++----- sdk/include/psdk/gdiplusheaders.h | 64 ++++-------------------------------- 2 files changed, 67 insertions(+), 65 deletions(-) diff --git a/sdk/include/psdk/gdiplusbrush.h b/sdk/include/psdk/gdiplusbrush.h index afee9fb94bb..3ee939bb30e 100644 --- a/sdk/include/psdk/gdiplusbrush.h +++ b/sdk/include/psdk/gdiplusbrush.h @@ -495,18 +495,70 @@ class SolidBrush : Brush } }; +// get native +GpImage *& +getNat(const Image *image); + class TextureBrush : Brush { public: - // Defined in "gdiplusheaders.h": - TextureBrush(Image *image, WrapMode wrapMode, const RectF &dstRect); - TextureBrush(Image *image, Rect &dstRect, ImageAttributes *imageAttributes); - TextureBrush(Image *image, WrapMode wrapMode, INT dstX, INT dstY, INT dstWidth, INT dstHeight); - TextureBrush(Image *image, WrapMode wrapMode, REAL dstX, REAL dstY, REAL dstWidth, REAL dstHeight); - TextureBrush(Image *image, RectF &dstRect, ImageAttributes *imageAttributes); - TextureBrush(Image *image, WrapMode wrapMode); - TextureBrush(Image *image, WrapMode wrapMode, const Rect &dstRect); + TextureBrush(Image *image, WrapMode wrapMode, const RectF &dstRect) + { + GpTexture *texture = NULL; + lastStatus = DllExports::GdipCreateTexture2( + getNat(image), wrapMode, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture); + SetNativeBrush(texture); + } + + TextureBrush(Image *image, Rect &dstRect, ImageAttributes *imageAttributes) + { + GpTexture *texture = NULL; + GpImageAttributes *attrs = imageAttributes ? imageAttributes->nativeImageAttr : NULL; + lastStatus = DllExports::GdipCreateTextureIA( + getNat(image), attrs, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture); + SetNativeBrush(texture); + } + + TextureBrush(Image *image, WrapMode wrapMode, INT dstX, INT dstY, INT dstWidth, INT dstHeight) + { + GpTexture *texture = NULL; + lastStatus = + DllExports::GdipCreateTexture2I(getNat(image), wrapMode, dstX, dstY, dstWidth, dstHeight, &texture); + SetNativeBrush(texture); + } + TextureBrush(Image *image, WrapMode wrapMode, REAL dstX, REAL dstY, REAL dstWidth, REAL dstHeight) + { + GpTexture *texture = NULL; + lastStatus = DllExports::GdipCreateTexture2(getNat(image), wrapMode, dstX, dstY, dstWidth, dstHeight, &texture); + SetNativeBrush(texture); + } + + TextureBrush(Image *image, RectF &dstRect, ImageAttributes *imageAttributes) + { + GpTexture *texture = NULL; + GpImageAttributes *attrs = imageAttributes ? imageAttributes->nativeImageAttr : NULL; + lastStatus = DllExports::GdipCreateTextureIA( + getNat(image), attrs, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture); + SetNativeBrush(texture); + } + + TextureBrush(Image *image, WrapMode wrapMode) + { + GpTexture *texture = NULL; + lastStatus = DllExports::GdipCreateTexture(getNat(image), wrapMode, &texture); + SetNativeBrush(texture); + } + + TextureBrush(Image *image, WrapMode wrapMode, const Rect &dstRect) + { + GpTexture *texture = NULL; + lastStatus = DllExports::GdipCreateTexture2I( + getNat(image), wrapMode, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture); + SetNativeBrush(texture); + } + + // Defined in "gdiplusheaders.h": Image * GetImage() const; diff --git a/sdk/include/psdk/gdiplusheaders.h b/sdk/include/psdk/gdiplusheaders.h index 4c464d5669c..c28e78fd5a1 100644 --- a/sdk/include/psdk/gdiplusheaders.h +++ b/sdk/include/psdk/gdiplusheaders.h @@ -377,6 +377,13 @@ class Image : public GdiplusBase Image(const Image &); Image & operator=(const Image &); + + // get native + friend inline GpImage *& + getNat(const Image *image) + { + return const_cast<Image *>(image)->nativeImage; + } }; class Bitmap : public Image @@ -1446,63 +1453,6 @@ class CustomLineCap : public GdiplusBase } }; -inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, const RectF &dstRect) -{ - GpTexture *texture = NULL; - lastStatus = DllExports::GdipCreateTexture2( - image->nativeImage, wrapMode, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture); - SetNativeBrush(texture); -} - -inline TextureBrush::TextureBrush(Image *image, Rect &dstRect, ImageAttributes *imageAttributes) -{ - GpTexture *texture = NULL; - GpImageAttributes *attrs = imageAttributes ? imageAttributes->nativeImageAttr : NULL; - lastStatus = DllExports::GdipCreateTextureIA( - image->nativeImage, attrs, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture); - SetNativeBrush(texture); -} - -inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, INT dstX, INT dstY, INT dstWidth, INT dstHeight) -{ - GpTexture *texture = NULL; - lastStatus = - DllExports::GdipCreateTexture2I(image->nativeImage, wrapMode, dstX, dstY, dstWidth, dstHeight, &texture); - SetNativeBrush(texture); -} - -inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, REAL dstX, REAL dstY, REAL dstWidth, REAL dstHeight) -{ - GpTexture *texture = NULL; - lastStatus = - DllExports::GdipCreateTexture2(image->nativeImage, wrapMode, dstX, dstY, dstWidth, dstHeight, &texture); - SetNativeBrush(texture); -} - -inline TextureBrush::TextureBrush(Image *image, RectF &dstRect, ImageAttributes *imageAttributes) -{ - GpTexture *texture = NULL; - GpImageAttributes *attrs = imageAttributes ? imageAttributes->nativeImageAttr : NULL; - lastStatus = DllExports::GdipCreateTextureIA( - image->nativeImage, attrs, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture); - SetNativeBrush(texture); -} - -inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode) -{ - GpTexture *texture = NULL; - lastStatus = DllExports::GdipCreateTexture(image->nativeImage, wrapMode, &texture); - SetNativeBrush(texture); -} - -inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, const Rect &dstRect) -{ - GpTexture *texture = NULL; - lastStatus = DllExports::GdipCreateTexture2I( - image->nativeImage, wrapMode, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture); - SetNativeBrush(texture); -} - inline Image * TextureBrush::GetImage() const {
4 years, 11 months
1
0
0
0
[reactos] 01/01: [NTOS] In KeWaitFor*Object(s) assert that the current IRQL is SYNCH_LEVEL. not DISPATCH_LEVEL, since acquiring the dispatcher lock raises to SYNCH_LEVEL, which is != DISPATCH_LEVEL on x64 and SMP builds.
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f944f3a6cdae3a09c21d1…
commit f944f3a6cdae3a09c21d18a7924eb3beb4ee584f Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Thu May 30 15:44:56 2019 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Tue Dec 31 09:43:14 2019 +0100 [NTOS] In KeWaitFor*Object(s) assert that the current IRQL is SYNCH_LEVEL. not DISPATCH_LEVEL, since acquiring the dispatcher lock raises to SYNCH_LEVEL, which is != DISPATCH_LEVEL on x64 and SMP builds. --- ntoskrnl/ke/wait.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ntoskrnl/ke/wait.c b/ntoskrnl/ke/wait.c index ed81484ab3e..bae1e8fcd60 100644 --- a/ntoskrnl/ke/wait.c +++ b/ntoskrnl/ke/wait.c @@ -431,7 +431,7 @@ KeWaitForSingleObject(IN PVOID Object, ULONG Hand = 0; if (Thread->WaitNext) - ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL); + ASSERT(KeGetCurrentIrql() == SYNCH_LEVEL); else ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL || (KeGetCurrentIrql() == DISPATCH_LEVEL && @@ -604,7 +604,7 @@ KeWaitForMultipleObjects(IN ULONG Count, ULONG Index, Hand = 0; if (Thread->WaitNext) - ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL); + ASSERT(KeGetCurrentIrql() == SYNCH_LEVEL); else if (KeGetCurrentIrql() == DISPATCH_LEVEL && (!Timeout || Timeout->QuadPart != 0)) {
4 years, 11 months
1
0
0
0
[reactos] 01/01: [SDK][INCLUDE] Implement Gdiplus::Pen (#2207)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ad2c15524dbf6bcd102ba…
commit ad2c15524dbf6bcd102ba128fd72c9a88d992b94 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Dec 31 17:11:38 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Dec 31 17:11:38 2019 +0900 [SDK][INCLUDE] Implement Gdiplus::Pen (#2207) CORE-16585 --- sdk/include/psdk/gdiplusheaders.h | 7 ++ sdk/include/psdk/gdipluspen.h | 184 +++++++++++++++++++++++++++----------- 2 files changed, 138 insertions(+), 53 deletions(-) diff --git a/sdk/include/psdk/gdiplusheaders.h b/sdk/include/psdk/gdiplusheaders.h index eb139741bab..4c464d5669c 100644 --- a/sdk/include/psdk/gdiplusheaders.h +++ b/sdk/include/psdk/gdiplusheaders.h @@ -1437,6 +1437,13 @@ class CustomLineCap : public GdiplusBase CustomLineCap(const CustomLineCap &); CustomLineCap & operator=(const CustomLineCap &); + + // get native + friend inline GpCustomLineCap *& + getNat(const CustomLineCap *cap) + { + return const_cast<CustomLineCap *>(cap)->nativeCap; + } }; inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, const RectF &dstRect) diff --git a/sdk/include/psdk/gdipluspen.h b/sdk/include/psdk/gdipluspen.h index beb0e405b55..477c71f9fe3 100644 --- a/sdk/include/psdk/gdipluspen.h +++ b/sdk/include/psdk/gdipluspen.h @@ -21,59 +21,87 @@ class CustomLineCap; +// get native +GpCustomLineCap *& +getNat(const CustomLineCap *cap); + class Pen : public GdiplusBase { + public: friend class Graphics; + friend class GraphicsPath; - public: - Pen(const Brush *brush, REAL width = 1.0f) + Pen(const Brush *brush, REAL width = 1.0f) : nativePen(NULL) { + lastStatus = DllExports::GdipCreatePen2(brush->nativeBrush, width, UnitWorld, &nativePen); } - Pen(const Color &color, REAL width = 1.0f) + Pen(const Color &color, REAL width = 1.0f) : nativePen(NULL) { - Unit unit = UnitWorld; - nativePen = NULL; - status = DllExports::GdipCreatePen1(color.GetValue(), width, unit, &nativePen); + lastStatus = DllExports::GdipCreatePen1(color.GetValue(), width, UnitWorld, &nativePen); } - Pen *Clone(VOID) + ~Pen() { - return NULL; + DllExports::GdipDeletePen(nativePen); } - PenAlignment GetAlignment(VOID) + Pen * + Clone() + { + GpPen *clonePen = NULL; + SetStatus(DllExports::GdipClonePen(nativePen, &clonePen)); + if (lastStatus != Ok) + return NULL; + Pen *newPen = new Pen(clonePen, lastStatus); + if (!newPen) + DllExports::GdipDeletePen(clonePen); + return newPen; + } + + PenAlignment + GetAlignment() { PenAlignment penAlignment; SetStatus(DllExports::GdipGetPenMode(nativePen, &penAlignment)); return penAlignment; } - Brush *GetBrush(VOID) + Brush * + GetBrush() { + // FIXME return NULL; } Status GetColor(Color *color) { + if (!color) + return SetStatus(InvalidParameter); + ARGB argb; - Status status = SetStatus(DllExports::GdipGetPenColor(nativePen, &argb)); - if (color) - color->SetValue(argb); - return status; + SetStatus(DllExports::GdipGetPenColor(nativePen, &argb)); + color->SetValue(argb); + return lastStatus; } Status GetCompoundArray(REAL *compoundArray, INT count) { - return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipGetPenCompoundArray(nativePen, - // count)); + if (!compoundArray || count <= 0) + return SetStatus(InvalidParameter); +#if 1 + return SetStatus(NotImplemented); +#else + return SetStatus(DllExports::GdipGetPenCompoundArray(nativePen, compoundArray, count)); +#endif } - INT GetCompoundArrayCount(VOID) + INT + GetCompoundArrayCount() { - INT count; + INT count = 0; SetStatus(DllExports::GdipGetPenCompoundCount(nativePen, &count)); return count; } @@ -81,23 +109,35 @@ class Pen : public GdiplusBase Status GetCustomEndCap(CustomLineCap *customCap) { - return NotImplemented; + if (!customCap) + return SetStatus(InvalidParameter); + +#if 1 + return SetStatus(NotImplemented); +#else + return SetStatus(DllExports::GdipGetPenCustomEndCap(nativePen, &getNat(customCap))); +#endif } Status GetCustomStartCap(CustomLineCap *customCap) { - return NotImplemented; + if (!customCap) + return SetStatus(InvalidParameter); + + return SetStatus(DllExports::GdipGetPenCustomStartCap(nativePen, &getNat(customCap))); } - DashCap GetDashCap(VOID) + DashCap + GetDashCap() { DashCap dashCap; SetStatus(DllExports::GdipGetPenDashCap197819(nativePen, &dashCap)); return dashCap; } - REAL GetDashOffset(VOID) + REAL + GetDashOffset() { REAL offset; SetStatus(DllExports::GdipGetPenDashOffset(nativePen, &offset)); @@ -107,57 +147,68 @@ class Pen : public GdiplusBase Status GetDashPattern(REAL *dashArray, INT count) { + if (dashArray == NULL || count <= 0) + return SetStatus(InvalidParameter); + return SetStatus(DllExports::GdipGetPenDashArray(nativePen, dashArray, count)); } - INT GetDashPatternCount(VOID) + INT + GetDashPatternCount() { - INT count; + INT count = 0; SetStatus(DllExports::GdipGetPenDashCount(nativePen, &count)); return count; } - DashStyle GetDashStyle(VOID) + DashStyle + GetDashStyle() { DashStyle dashStyle; SetStatus(DllExports::GdipGetPenDashStyle(nativePen, &dashStyle)); return dashStyle; } - LineCap GetEndCap(VOID) + LineCap + GetEndCap() { LineCap endCap; SetStatus(DllExports::GdipGetPenEndCap(nativePen, &endCap)); return endCap; } - Status GetLastStatus(VOID) + Status + GetLastStatus() const { - return status; + return lastStatus; } - LineJoin GetLineJoin(VOID) + LineJoin + GetLineJoin() { LineJoin lineJoin; SetStatus(DllExports::GdipGetPenLineJoin(nativePen, &lineJoin)); return lineJoin; } - REAL GetMiterLimit(VOID) + REAL + GetMiterLimit() { REAL miterLimit; SetStatus(DllExports::GdipGetPenMiterLimit(nativePen, &miterLimit)); return miterLimit; } - PenType GetPenType(VOID) + PenType + GetPenType() { PenType type; SetStatus(DllExports::GdipGetPenFillType(nativePen, &type)); return type; } - LineCap GetStartCap(VOID) + LineCap + GetStartCap() { LineCap startCap; SetStatus(DllExports::GdipGetPenStartCap(nativePen, &startCap)); @@ -167,10 +218,11 @@ class Pen : public GdiplusBase Status GetTransform(Matrix *matrix) { - return NotImplemented; + return SetStatus(DllExports::GdipGetPenTransform(nativePen, matrix->nativeMatrix)); } - REAL GetWidth(VOID) + REAL + GetWidth() { REAL width; SetStatus(DllExports::GdipGetPenWidth(nativePen, &width)); @@ -178,26 +230,29 @@ class Pen : public GdiplusBase } Status - MultiplyTransform(Matrix *matrix, MatrixOrder order) + MultiplyTransform(Matrix *matrix, MatrixOrder order = MatrixOrderPrepend) { - return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipMultiplyPenTransform(nativePen, matrix - // ? matrix->nativeMatrix : NULL, order)); +#if 1 + return SetStatus(NotImplemented); +#else + return SetStatus(DllExports::GdipMultiplyPenTransform(nativePen, matrix->nativeMatrix, order)); +#endif } - Status ResetTransform(VOID) + Status + ResetTransform() { return SetStatus(DllExports::GdipResetPenTransform(nativePen)); } Status - RotateTransform(REAL angle, MatrixOrder order) + RotateTransform(REAL angle, MatrixOrder order = MatrixOrderPrepend) { - return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipRotatePenTransform(nativePen, angle, - // order)); + return SetStatus(DllExports::GdipRotatePenTransform(nativePen, angle, order)); } Status - ScaleTransform(REAL sx, REAL sy, MatrixOrder order) + ScaleTransform(REAL sx, REAL sy, MatrixOrder order = MatrixOrderPrepend) { return SetStatus(DllExports::GdipScalePenTransform(nativePen, sx, sy, order)); } @@ -211,7 +266,8 @@ class Pen : public GdiplusBase Status SetBrush(const Brush *brush) { - return SetStatus(DllExports::GdipSetPenBrushFill(nativePen, brush ? brush->nativeBrush : NULL)); + GpBrush *theBrush = brush ? brush->nativeBrush : NULL; + return SetStatus(DllExports::GdipSetPenBrushFill(nativePen, theBrush)); } Status @@ -229,13 +285,15 @@ class Pen : public GdiplusBase Status SetCustomEndCap(const CustomLineCap *customCap) { - return NotImplemented; + GpCustomLineCap *cap = customCap ? getNat(customCap) : NULL; + return SetStatus(DllExports::GdipSetPenCustomEndCap(nativePen, cap)); } Status SetCustomStartCap(const CustomLineCap *customCap) { - return NotImplemented; + GpCustomLineCap *cap = customCap ? getNat(customCap) : NULL; + return SetStatus(DllExports::GdipSetPenCustomStartCap(nativePen, cap)); } Status @@ -295,7 +353,8 @@ class Pen : public GdiplusBase Status SetTransform(const Matrix *matrix) { - return SetStatus(DllExports::GdipSetPenTransform(nativePen, matrix ? matrix->nativeMatrix : NULL)); + GpMatrix *mat = matrix ? matrix->nativeMatrix : NULL; + return SetStatus(DllExports::GdipSetPenTransform(nativePen, mat)); } Status @@ -304,20 +363,39 @@ class Pen : public GdiplusBase return SetStatus(DllExports::GdipSetPenWidth(nativePen, width)); } - private: - GpPen *nativePen; + Status + TranslateTransform(REAL dx, REAL dy, MatrixOrder order = MatrixOrderPrepend) + { + return SetStatus(DllExports::GdipTranslatePenTransform(nativePen, dx, dy, order)); + } - private: - mutable Status status; + protected: + GpPen *nativePen; + mutable Status lastStatus; Status SetStatus(Status status) const { - if (status == Ok) - return status; - this->status = status; + if (status != Ok) + lastStatus = status; return status; } + + Pen(GpPen *pen, Status status) : nativePen(pen), lastStatus(status) + { + } + + VOID + SetNativePen(GpPen *pen) + { + nativePen = pen; + } + + private: + // Pen is not copyable + Pen(const Pen &); + Pen & + operator=(const Pen &); }; #endif /* _GDIPLUSPEN_H */
4 years, 11 months
1
0
0
0
[reactos] 01/01: [SDK][INCLUDE] Rename Gdiplus::Pen::pen as nativePen (#2206)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e797499dee0df590b46f1…
commit e797499dee0df590b46f1b209e42a2b04fd8aa61 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Dec 31 15:45:57 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Dec 31 15:45:57 2019 +0900 [SDK][INCLUDE] Rename Gdiplus::Pen::pen as nativePen (#2206) CORE-16585 --- sdk/include/psdk/gdiplusgraphics.h | 104 +++++++++++++++++++------------------ sdk/include/psdk/gdipluspen.h | 77 +++++++++++++-------------- 2 files changed, 93 insertions(+), 88 deletions(-) diff --git a/sdk/include/psdk/gdiplusgraphics.h b/sdk/include/psdk/gdiplusgraphics.h index 5b2ace1c496..2d1988bae66 100644 --- a/sdk/include/psdk/gdiplusgraphics.h +++ b/sdk/include/psdk/gdiplusgraphics.h @@ -87,66 +87,68 @@ class Graphics : public GdiplusBase DrawArc(const Pen *pen, const Rect &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawArcI( - graphics, pen ? pen->pen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); + graphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); } Status DrawArc(const Pen *pen, const RectF &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawArcI( - graphics, pen ? pen->pen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); + graphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); } Status DrawArc(const Pen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { - return SetStatus( - DllExports::GdipDrawArc(graphics, pen ? pen->pen : NULL, x, y, width, height, startAngle, sweepAngle)); + return SetStatus(DllExports::GdipDrawArc( + graphics, pen ? pen->nativePen : NULL, x, y, width, height, startAngle, sweepAngle)); } Status DrawArc(const Pen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle) { - return SetStatus( - DllExports::GdipDrawArcI(graphics, pen ? pen->pen : NULL, x, y, width, height, startAngle, sweepAngle)); + return SetStatus(DllExports::GdipDrawArcI( + graphics, pen ? pen->nativePen : NULL, x, y, width, height, startAngle, sweepAngle)); } Status DrawBezier(const Pen *pen, const Point &pt1, const Point &pt2, const Point &pt3, const Point &pt4) { return SetStatus(DllExports::GdipDrawBezierI( - graphics, pen ? pen->pen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)); + graphics, pen ? pen->nativePen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)); } Status DrawBezier(const Pen *pen, const PointF &pt1, const PointF &pt2, const PointF &pt3, const PointF &pt4) { return SetStatus(DllExports::GdipDrawBezier( - graphics, pen ? pen->pen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)); + graphics, pen ? pen->nativePen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)); } Status DrawBezier(const Pen *pen, REAL x1, REAL y1, REAL x2, REAL y2, REAL x3, REAL y3, REAL x4, REAL y4) { - return SetStatus(DllExports::GdipDrawBezier(graphics, pen ? pen->pen : NULL, x1, y1, x2, y2, x3, y3, x4, y4)); + return SetStatus( + DllExports::GdipDrawBezier(graphics, pen ? pen->nativePen : NULL, x1, y1, x2, y2, x3, y3, x4, y4)); } Status DrawBezier(const Pen *pen, INT x1, INT y1, INT x2, INT y2, INT x3, INT y3, INT x4, INT y4) { - return SetStatus(DllExports::GdipDrawBezierI(graphics, pen ? pen->pen : NULL, x1, y1, x2, y2, x3, y3, x4, y4)); + return SetStatus( + DllExports::GdipDrawBezierI(graphics, pen ? pen->nativePen : NULL, x1, y1, x2, y2, x3, y3, x4, y4)); } Status DrawBeziers(const Pen *pen, const Point *points, INT count) { - return SetStatus(DllExports::GdipDrawBeziersI(graphics, pen ? pen->pen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawBeziersI(graphics, pen ? pen->nativePen : NULL, points, count)); } Status DrawBeziers(const Pen *pen, const PointF *points, INT count) { - return SetStatus(DllExports::GdipDrawBeziers(graphics, pen ? pen->pen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawBeziers(graphics, pen ? pen->nativePen : NULL, points, count)); } Status @@ -158,63 +160,65 @@ class Graphics : public GdiplusBase Status DrawClosedCurve(const Pen *pen, const Point *points, INT count) { - return SetStatus(DllExports::GdipDrawClosedCurveI(graphics, pen ? pen->pen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawClosedCurveI(graphics, pen ? pen->nativePen : NULL, points, count)); } Status DrawClosedCurve(const Pen *pen, const PointF *points, INT count) { - return SetStatus(DllExports::GdipDrawClosedCurve(graphics, pen ? pen->pen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawClosedCurve(graphics, pen ? pen->nativePen : NULL, points, count)); } Status DrawClosedCurve(const Pen *pen, const PointF *points, INT count, REAL tension) { - return SetStatus(DllExports::GdipDrawClosedCurve2(graphics, pen ? pen->pen : NULL, points, count, tension)); + return SetStatus( + DllExports::GdipDrawClosedCurve2(graphics, pen ? pen->nativePen : NULL, points, count, tension)); } Status DrawClosedCurve(const Pen *pen, const Point *points, INT count, REAL tension) { - return SetStatus(DllExports::GdipDrawClosedCurve2I(graphics, pen ? pen->pen : NULL, points, count, tension)); + return SetStatus( + DllExports::GdipDrawClosedCurve2I(graphics, pen ? pen->nativePen : NULL, points, count, tension)); } Status DrawCurve(const Pen *pen, const Point *points, INT count) { - return SetStatus(DllExports::GdipDrawCurveI(graphics, pen ? pen->pen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawCurveI(graphics, pen ? pen->nativePen : NULL, points, count)); } Status DrawCurve(const Pen *pen, const PointF *points, INT count) { - return SetStatus(DllExports::GdipDrawCurve(graphics, pen ? pen->pen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawCurve(graphics, pen ? pen->nativePen : NULL, points, count)); } Status DrawCurve(const Pen *pen, const PointF *points, INT count, REAL tension) { - return SetStatus(DllExports::GdipDrawCurve2(graphics, pen ? pen->pen : NULL, points, count, tension)); + return SetStatus(DllExports::GdipDrawCurve2(graphics, pen ? pen->nativePen : NULL, points, count, tension)); } Status DrawCurve(const Pen *pen, const Point *points, INT count, INT offset, INT numberOfSegments, REAL tension) { return SetStatus(DllExports::GdipDrawCurve3I( - graphics, pen ? pen->pen : NULL, points, count, offset, numberOfSegments, tension)); + graphics, pen ? pen->nativePen : NULL, points, count, offset, numberOfSegments, tension)); } Status DrawCurve(const Pen *pen, const PointF *points, INT count, INT offset, INT numberOfSegments, REAL tension) { return SetStatus(DllExports::GdipDrawCurve3( - graphics, pen ? pen->pen : NULL, points, count, offset, numberOfSegments, tension)); + graphics, pen ? pen->nativePen : NULL, points, count, offset, numberOfSegments, tension)); } Status DrawCurve(const Pen *pen, const Point *points, INT count, REAL tension) { - return SetStatus(DllExports::GdipDrawCurve2I(graphics, pen ? pen->pen : NULL, points, count, tension)); + return SetStatus(DllExports::GdipDrawCurve2I(graphics, pen ? pen->nativePen : NULL, points, count, tension)); } Status @@ -233,27 +237,27 @@ class Graphics : public GdiplusBase Status DrawEllipse(const Pen *pen, const Rect &rect) { - return SetStatus( - DllExports::GdipDrawEllipseI(graphics, pen ? pen->pen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + return SetStatus(DllExports::GdipDrawEllipseI( + graphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status DrawEllipse(const Pen *pen, REAL x, REAL y, REAL width, REAL height) { - return SetStatus(DllExports::GdipDrawEllipse(graphics, pen ? pen->pen : NULL, x, y, width, height)); + return SetStatus(DllExports::GdipDrawEllipse(graphics, pen ? pen->nativePen : NULL, x, y, width, height)); } Status DrawEllipse(const Pen *pen, const RectF &rect) { - return SetStatus( - DllExports::GdipDrawEllipse(graphics, pen ? pen->pen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + return SetStatus(DllExports::GdipDrawEllipse( + graphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status DrawEllipse(const Pen *pen, INT x, INT y, INT width, INT height) { - return SetStatus(DllExports::GdipDrawEllipseI(graphics, pen ? pen->pen : NULL, x, y, width, height)); + return SetStatus(DllExports::GdipDrawEllipseI(graphics, pen ? pen->nativePen : NULL, x, y, width, height)); } Status @@ -397,37 +401,37 @@ class Graphics : public GdiplusBase Status DrawLine(const Pen *pen, const Point &pt1, const Point &pt2) { - return SetStatus(DllExports::GdipDrawLineI(graphics, pen ? pen->pen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y)); + return SetStatus(DllExports::GdipDrawLineI(graphics, pen ? pen->nativePen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y)); } Status DrawLine(const Pen *pen, const PointF &pt1, const Point &pt2) { - return SetStatus(DllExports::GdipDrawLine(graphics, pen ? pen->pen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y)); + return SetStatus(DllExports::GdipDrawLine(graphics, pen ? pen->nativePen : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y)); } Status DrawLine(const Pen *pen, REAL x1, REAL y1, REAL x2, REAL y2) { - return SetStatus(DllExports::GdipDrawLine(graphics, pen ? pen->pen : NULL, x1, y1, x2, y2)); + return SetStatus(DllExports::GdipDrawLine(graphics, pen ? pen->nativePen : NULL, x1, y1, x2, y2)); } Status DrawLine(const Pen *pen, INT x1, INT y1, INT x2, INT y2) { - return SetStatus(DllExports::GdipDrawLine(graphics, pen ? pen->pen : NULL, x1, y1, x2, y2)); + return SetStatus(DllExports::GdipDrawLine(graphics, pen ? pen->nativePen : NULL, x1, y1, x2, y2)); } Status DrawLines(const Pen *pen, const Point *points, INT count) { - return SetStatus(DllExports::GdipDrawLinesI(graphics, pen ? pen->pen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawLinesI(graphics, pen ? pen->nativePen : NULL, points, count)); } Status DrawLines(const Pen *pen, const PointF *points, INT count) { - return SetStatus(DllExports::GdipDrawLines(graphics, pen ? pen->pen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawLines(graphics, pen ? pen->nativePen : NULL, points, count)); } Status @@ -440,78 +444,78 @@ class Graphics : public GdiplusBase DrawPie(const Pen *pen, const Rect &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawPieI( - graphics, pen ? pen->pen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); + graphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); } Status DrawPie(const Pen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle) { - return SetStatus( - DllExports::GdipDrawPieI(graphics, pen ? pen->pen : NULL, x, y, width, height, startAngle, sweepAngle)); + return SetStatus(DllExports::GdipDrawPieI( + graphics, pen ? pen->nativePen : NULL, x, y, width, height, startAngle, sweepAngle)); } Status DrawPie(const Pen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { - return SetStatus( - DllExports::GdipDrawPie(graphics, pen ? pen->pen : NULL, x, y, width, height, startAngle, sweepAngle)); + return SetStatus(DllExports::GdipDrawPie( + graphics, pen ? pen->nativePen : NULL, x, y, width, height, startAngle, sweepAngle)); } Status DrawPie(const Pen *pen, const RectF &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipDrawPie( - graphics, pen ? pen->pen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); + graphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); } Status DrawPolygon(const Pen *pen, const Point *points, INT count) { - return SetStatus(DllExports::GdipDrawPolygonI(graphics, pen ? pen->pen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawPolygonI(graphics, pen ? pen->nativePen : NULL, points, count)); } Status DrawPolygon(const Pen *pen, const PointF *points, INT count) { - return SetStatus(DllExports::GdipDrawPolygon(graphics, pen ? pen->pen : NULL, points, count)); + return SetStatus(DllExports::GdipDrawPolygon(graphics, pen ? pen->nativePen : NULL, points, count)); } Status DrawRectangle(const Pen *pen, const Rect &rect) { - return SetStatus( - DllExports::GdipDrawRectangleI(graphics, pen ? pen->pen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + return SetStatus(DllExports::GdipDrawRectangleI( + graphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status DrawRectangle(const Pen *pen, INT x, INT y, INT width, INT height) { - return SetStatus(DllExports::GdipDrawRectangleI(graphics, pen ? pen->pen : NULL, x, y, width, height)); + return SetStatus(DllExports::GdipDrawRectangleI(graphics, pen ? pen->nativePen : NULL, x, y, width, height)); } Status DrawRectangle(const Pen *pen, REAL x, REAL y, REAL width, REAL height) { - return SetStatus(DllExports::GdipDrawRectangle(graphics, pen ? pen->pen : NULL, x, y, width, height)); + return SetStatus(DllExports::GdipDrawRectangle(graphics, pen ? pen->nativePen : NULL, x, y, width, height)); } Status DrawRectangle(const Pen *pen, const RectF &rect) { - return SetStatus( - DllExports::GdipDrawRectangleI(graphics, pen ? pen->pen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + return SetStatus(DllExports::GdipDrawRectangleI( + graphics, pen ? pen->nativePen : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status DrawRectangles(const Pen *pen, const Rect *rects, INT count) { - return SetStatus(DllExports::GdipDrawRectanglesI(graphics, pen ? pen->pen : NULL, rects, count)); + return SetStatus(DllExports::GdipDrawRectanglesI(graphics, pen ? pen->nativePen : NULL, rects, count)); } Status DrawRectangles(const Pen *pen, const RectF *rects, INT count) { - return SetStatus(DllExports::GdipDrawRectangles(graphics, pen ? pen->pen : NULL, rects, count)); + return SetStatus(DllExports::GdipDrawRectangles(graphics, pen ? pen->nativePen : NULL, rects, count)); } Status diff --git a/sdk/include/psdk/gdipluspen.h b/sdk/include/psdk/gdipluspen.h index 82b2cfdf6b2..beb0e405b55 100644 --- a/sdk/include/psdk/gdipluspen.h +++ b/sdk/include/psdk/gdipluspen.h @@ -33,8 +33,8 @@ class Pen : public GdiplusBase Pen(const Color &color, REAL width = 1.0f) { Unit unit = UnitWorld; - pen = NULL; - status = DllExports::GdipCreatePen1(color.GetValue(), width, unit, &pen); + nativePen = NULL; + status = DllExports::GdipCreatePen1(color.GetValue(), width, unit, &nativePen); } Pen *Clone(VOID) @@ -45,7 +45,7 @@ class Pen : public GdiplusBase PenAlignment GetAlignment(VOID) { PenAlignment penAlignment; - SetStatus(DllExports::GdipGetPenMode(pen, &penAlignment)); + SetStatus(DllExports::GdipGetPenMode(nativePen, &penAlignment)); return penAlignment; } @@ -58,7 +58,7 @@ class Pen : public GdiplusBase GetColor(Color *color) { ARGB argb; - Status status = SetStatus(DllExports::GdipGetPenColor(pen, &argb)); + Status status = SetStatus(DllExports::GdipGetPenColor(nativePen, &argb)); if (color) color->SetValue(argb); return status; @@ -67,13 +67,14 @@ class Pen : public GdiplusBase Status GetCompoundArray(REAL *compoundArray, INT count) { - return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipGetPenCompoundArray(pen, count)); + return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipGetPenCompoundArray(nativePen, + // count)); } INT GetCompoundArrayCount(VOID) { INT count; - SetStatus(DllExports::GdipGetPenCompoundCount(pen, &count)); + SetStatus(DllExports::GdipGetPenCompoundCount(nativePen, &count)); return count; } @@ -92,41 +93,41 @@ class Pen : public GdiplusBase DashCap GetDashCap(VOID) { DashCap dashCap; - SetStatus(DllExports::GdipGetPenDashCap197819(pen, &dashCap)); + SetStatus(DllExports::GdipGetPenDashCap197819(nativePen, &dashCap)); return dashCap; } REAL GetDashOffset(VOID) { REAL offset; - SetStatus(DllExports::GdipGetPenDashOffset(pen, &offset)); + SetStatus(DllExports::GdipGetPenDashOffset(nativePen, &offset)); return offset; } Status GetDashPattern(REAL *dashArray, INT count) { - return SetStatus(DllExports::GdipGetPenDashArray(pen, dashArray, count)); + return SetStatus(DllExports::GdipGetPenDashArray(nativePen, dashArray, count)); } INT GetDashPatternCount(VOID) { INT count; - SetStatus(DllExports::GdipGetPenDashCount(pen, &count)); + SetStatus(DllExports::GdipGetPenDashCount(nativePen, &count)); return count; } DashStyle GetDashStyle(VOID) { DashStyle dashStyle; - SetStatus(DllExports::GdipGetPenDashStyle(pen, &dashStyle)); + SetStatus(DllExports::GdipGetPenDashStyle(nativePen, &dashStyle)); return dashStyle; } LineCap GetEndCap(VOID) { LineCap endCap; - SetStatus(DllExports::GdipGetPenEndCap(pen, &endCap)); + SetStatus(DllExports::GdipGetPenEndCap(nativePen, &endCap)); return endCap; } @@ -138,28 +139,28 @@ class Pen : public GdiplusBase LineJoin GetLineJoin(VOID) { LineJoin lineJoin; - SetStatus(DllExports::GdipGetPenLineJoin(pen, &lineJoin)); + SetStatus(DllExports::GdipGetPenLineJoin(nativePen, &lineJoin)); return lineJoin; } REAL GetMiterLimit(VOID) { REAL miterLimit; - SetStatus(DllExports::GdipGetPenMiterLimit(pen, &miterLimit)); + SetStatus(DllExports::GdipGetPenMiterLimit(nativePen, &miterLimit)); return miterLimit; } PenType GetPenType(VOID) { PenType type; - SetStatus(DllExports::GdipGetPenFillType(pen, &type)); + SetStatus(DllExports::GdipGetPenFillType(nativePen, &type)); return type; } LineCap GetStartCap(VOID) { LineCap startCap; - SetStatus(DllExports::GdipGetPenStartCap(pen, &startCap)); + SetStatus(DllExports::GdipGetPenStartCap(nativePen, &startCap)); return startCap; } @@ -172,57 +173,57 @@ class Pen : public GdiplusBase REAL GetWidth(VOID) { REAL width; - SetStatus(DllExports::GdipGetPenWidth(pen, &width)); + SetStatus(DllExports::GdipGetPenWidth(nativePen, &width)); return width; } Status MultiplyTransform(Matrix *matrix, MatrixOrder order) { - return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipMultiplyPenTransform(pen, matrix ? - // matrix->nativeMatrix : NULL, order)); + return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipMultiplyPenTransform(nativePen, matrix + // ? matrix->nativeMatrix : NULL, order)); } Status ResetTransform(VOID) { - return SetStatus(DllExports::GdipResetPenTransform(pen)); + return SetStatus(DllExports::GdipResetPenTransform(nativePen)); } Status RotateTransform(REAL angle, MatrixOrder order) { - return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipRotatePenTransform(pen, angle, + return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipRotatePenTransform(nativePen, angle, // order)); } Status ScaleTransform(REAL sx, REAL sy, MatrixOrder order) { - return SetStatus(DllExports::GdipScalePenTransform(pen, sx, sy, order)); + return SetStatus(DllExports::GdipScalePenTransform(nativePen, sx, sy, order)); } Status SetAlignment(PenAlignment penAlignment) { - return SetStatus(DllExports::GdipSetPenMode(pen, penAlignment)); + return SetStatus(DllExports::GdipSetPenMode(nativePen, penAlignment)); } Status SetBrush(const Brush *brush) { - return SetStatus(DllExports::GdipSetPenBrushFill(pen, brush ? brush->nativeBrush : NULL)); + return SetStatus(DllExports::GdipSetPenBrushFill(nativePen, brush ? brush->nativeBrush : NULL)); } Status SetColor(const Color &color) { - return SetStatus(DllExports::GdipSetPenColor(pen, color.GetValue())); + return SetStatus(DllExports::GdipSetPenColor(nativePen, color.GetValue())); } Status SetCompoundArray(const REAL *compoundArray, INT count) { - return SetStatus(DllExports::GdipSetPenCompoundArray(pen, compoundArray, count)); + return SetStatus(DllExports::GdipSetPenCompoundArray(nativePen, compoundArray, count)); } Status @@ -240,71 +241,71 @@ class Pen : public GdiplusBase Status SetDashCap(DashCap dashCap) { - return SetStatus(DllExports::GdipSetPenDashCap197819(pen, dashCap)); + return SetStatus(DllExports::GdipSetPenDashCap197819(nativePen, dashCap)); } Status SetDashOffset(REAL dashOffset) { - return SetStatus(DllExports::GdipSetPenDashOffset(pen, dashOffset)); + return SetStatus(DllExports::GdipSetPenDashOffset(nativePen, dashOffset)); } Status SetDashPattern(const REAL *dashArray, INT count) { - return SetStatus(DllExports::GdipSetPenDashArray(pen, dashArray, count)); + return SetStatus(DllExports::GdipSetPenDashArray(nativePen, dashArray, count)); } Status SetDashStyle(DashStyle dashStyle) { - return SetStatus(DllExports::GdipSetPenDashStyle(pen, dashStyle)); + return SetStatus(DllExports::GdipSetPenDashStyle(nativePen, dashStyle)); } Status SetEndCap(LineCap endCap) { - return SetStatus(DllExports::GdipSetPenEndCap(pen, endCap)); + return SetStatus(DllExports::GdipSetPenEndCap(nativePen, endCap)); } Status SetLineCap(LineCap startCap, LineCap endCap, DashCap dashCap) { - return SetStatus(DllExports::GdipSetPenLineCap197819(pen, startCap, endCap, dashCap)); + return SetStatus(DllExports::GdipSetPenLineCap197819(nativePen, startCap, endCap, dashCap)); } Status SetLineJoin(LineJoin lineJoin) { - return SetStatus(DllExports::GdipSetPenLineJoin(pen, lineJoin)); + return SetStatus(DllExports::GdipSetPenLineJoin(nativePen, lineJoin)); } Status SetMiterLimit(REAL miterLimit) { - return SetStatus(DllExports::GdipSetPenMiterLimit(pen, miterLimit)); + return SetStatus(DllExports::GdipSetPenMiterLimit(nativePen, miterLimit)); } Status SetStartCap(LineCap startCap) { - return SetStatus(DllExports::GdipSetPenStartCap(pen, startCap)); + return SetStatus(DllExports::GdipSetPenStartCap(nativePen, startCap)); } Status SetTransform(const Matrix *matrix) { - return SetStatus(DllExports::GdipSetPenTransform(pen, matrix ? matrix->nativeMatrix : NULL)); + return SetStatus(DllExports::GdipSetPenTransform(nativePen, matrix ? matrix->nativeMatrix : NULL)); } Status SetWidth(REAL width) { - return SetStatus(DllExports::GdipSetPenWidth(pen, width)); + return SetStatus(DllExports::GdipSetPenWidth(nativePen, width)); } private: - GpPen *pen; + GpPen *nativePen; private: mutable Status status;
4 years, 11 months
1
0
0
0
[reactos] 01/01: [SDK][INCLUDE] Implement Gdiplus::Brush (#2205)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9f4d733d1fb784ebb1521…
commit 9f4d733d1fb784ebb1521c02cf8483597f4134f8 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Dec 31 14:54:41 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Dec 31 14:54:41 2019 +0900 [SDK][INCLUDE] Implement Gdiplus::Brush (#2205) CORE-16585 --- sdk/include/psdk/gdiplusbrush.h | 400 +++++++++++++++++++++++------- sdk/include/psdk/gdiplusheaders.h | 77 ++++++ sdk/include/psdk/gdiplusimageattributes.h | 2 + sdk/include/psdk/gdiplusmatrix.h | 3 + 4 files changed, 399 insertions(+), 83 deletions(-) diff --git a/sdk/include/psdk/gdiplusbrush.h b/sdk/include/psdk/gdiplusbrush.h index 581f88d16f1..afee9fb94bb 100644 --- a/sdk/include/psdk/gdiplusbrush.h +++ b/sdk/include/psdk/gdiplusbrush.h @@ -27,329 +27,563 @@ class Brush : public GdiplusBase friend class Graphics; friend class Pen; - Brush *Clone(VOID) const + virtual ~Brush() { - return NULL; + DllExports::GdipDeleteBrush(nativeBrush); } - Status GetLastStatus(VOID) + Brush * + Clone() const { - return status; + GpBrush *brush = NULL; + SetStatus(DllExports::GdipCloneBrush(nativeBrush, &brush)); + if (lastStatus != Ok) + return NULL; + + Brush *newBrush = new Brush(brush, lastStatus); + if (newBrush == NULL) + { + DllExports::GdipDeleteBrush(brush); + } + return newBrush; + } + + Status + GetLastStatus() const + { + return lastStatus; } - BrushType GetType(VOID) + BrushType + GetType() const { BrushType type; SetStatus(DllExports::GdipGetBrushType(nativeBrush, &type)); return type; } - private: - mutable Status status; + protected: GpBrush *nativeBrush; + mutable Status lastStatus; + + Brush() + { + } + + Brush(GpBrush *brush, Status status) : nativeBrush(brush), lastStatus(status) + { + } Status SetStatus(Status status) const { - if (status == Ok) - return status; - this->status = status; + if (status != Ok) + lastStatus = status; return status; } + + void + SetNativeBrush(GpBrush *brush) + { + nativeBrush = brush; + } + + private: + // Brush is not copyable + Brush(const Brush &); + Brush & + operator=(const Brush &); }; class HatchBrush : public Brush { public: + friend class Pen; + HatchBrush(HatchStyle hatchStyle, const Color &foreColor, const Color &backColor) { + GpHatch *brush = NULL; + lastStatus = DllExports::GdipCreateHatchBrush(hatchStyle, foreColor.GetValue(), backColor.GetValue(), &brush); + SetNativeBrush(brush); } Status GetBackgroundColor(Color *color) const { - return NotImplemented; + if (!color) + return SetStatus(InvalidParameter); + + ARGB argb; + GpHatch *hatch = GetNativeHatch(); + SetStatus(DllExports::GdipGetHatchBackgroundColor(hatch, &argb)); + + color->SetValue(argb); + return lastStatus; } Status GetForegroundColor(Color *color) const { - return NotImplemented; + if (!color) + return SetStatus(InvalidParameter); + + ARGB argb; + GpHatch *hatch = GetNativeHatch(); + SetStatus(DllExports::GdipGetHatchForegroundColor(hatch, &argb)); + + color->SetValue(argb); + return lastStatus; + } + + HatchStyle + GetHatchStyle() const + { + HatchStyle hatchStyle; + GpHatch *hatch = GetNativeHatch(); + SetStatus(DllExports::GdipGetHatchStyle(hatch, &hatchStyle)); + return hatchStyle; + } + + protected: + HatchBrush() + { } - HatchStyle GetHatchStyle(VOID) const + GpHatch * + GetNativeHatch() const { - return HatchStyleHorizontal; + return static_cast<GpHatch *>(nativeBrush); } }; class LinearGradientBrush : public Brush { public: + friend class Pen; + LinearGradientBrush(const PointF &point1, const PointF &point2, const Color &color1, const Color &color2) { + GpLineGradient *brush = NULL; + lastStatus = DllExports::GdipCreateLineBrush( + &point1, &point2, color1.GetValue(), color2.GetValue(), WrapModeTile, &brush); + SetNativeBrush(brush); } - LinearGradientBrush(const Rect &rect, const Color &color1, const Color &color2, REAL angle, BOOL isAngleScalable) + LinearGradientBrush( + const Rect &rect, + const Color &color1, + const Color &color2, + REAL angle, + BOOL isAngleScalable = FALSE) { + GpLineGradient *brush = NULL; + lastStatus = DllExports::GdipCreateLineBrushFromRectWithAngleI( + &rect, color1.GetValue(), color2.GetValue(), angle, isAngleScalable, WrapModeTile, &brush); + SetNativeBrush(brush); } LinearGradientBrush(const Rect &rect, const Color &color1, const Color &color2, LinearGradientMode mode) { + GpLineGradient *brush = NULL; + lastStatus = DllExports::GdipCreateLineBrushFromRectI( + &rect, color1.GetValue(), color2.GetValue(), mode, WrapModeTile, &brush); + SetNativeBrush(brush); } LinearGradientBrush(const Point &point1, const Point &point2, const Color &color1, const Color &color2) { + GpLineGradient *brush = NULL; + lastStatus = DllExports::GdipCreateLineBrushI( + &point1, &point2, color1.GetValue(), color2.GetValue(), WrapModeTile, &brush); + SetNativeBrush(brush); } - LinearGradientBrush(const RectF &rect, const Color &color1, const Color &color2, REAL angle, BOOL isAngleScalable) + LinearGradientBrush( + const RectF &rect, + const Color &color1, + const Color &color2, + REAL angle, + BOOL isAngleScalable = FALSE) { + GpLineGradient *brush = NULL; + lastStatus = DllExports::GdipCreateLineBrushFromRectWithAngle( + &rect, color1.GetValue(), color2.GetValue(), angle, isAngleScalable, WrapModeTile, &brush); + SetNativeBrush(brush); } LinearGradientBrush(const RectF &rect, const Color &color1, const Color &color2, LinearGradientMode mode) { + GpLineGradient *brush = NULL; + lastStatus = DllExports::GdipCreateLineBrushFromRect( + &rect, color1.GetValue(), color2.GetValue(), mode, WrapModeTile, &brush); + SetNativeBrush(brush); } Status GetBlend(REAL *blendFactors, REAL *blendPositions, INT count) { - return NotImplemented; + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipGetLineBlend(gradient, blendFactors, blendPositions, count)); } - INT GetBlendCount(VOID) const + INT + GetBlendCount() const { - return 0; + INT count = 0; + GpLineGradient *gradient = GetNativeGradient(); + SetStatus(DllExports::GdipGetLineBlendCount(gradient, &count)); + return count; } - BOOL GetGammaCorrection(VOID) const + BOOL + GetGammaCorrection() const { - return FALSE; + BOOL useGammaCorrection; + GpLineGradient *gradient = GetNativeGradient(); + SetStatus(DllExports::GdipGetLineGammaCorrection(gradient, &useGammaCorrection)); + return useGammaCorrection; } - INT GetInterpolationColorCount(VOID) const + INT + GetInterpolationColorCount() const { - return 0; + INT count = 0; + GpLineGradient *gradient = GetNativeGradient(); + SetStatus(DllExports::GdipGetLinePresetBlendCount(gradient, &count)); + return count; } Status GetInterpolationColors(Color *presetColors, REAL *blendPositions, INT count) const { - return NotImplemented; + return SetStatus(NotImplemented); } Status GetLinearColors(Color *colors) const { - return NotImplemented; + if (!colors) + return SetStatus(InvalidParameter); + + GpLineGradient *gradient = GetNativeGradient(); + + ARGB argb[2]; + SetStatus(DllExports::GdipGetLineColors(gradient, argb)); + if (lastStatus == Ok) + { + colors[0] = Color(argb[0]); + colors[1] = Color(argb[1]); + } + return lastStatus; } Status GetRectangle(Rect *rect) const { - return NotImplemented; + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipGetLineRectI(gradient, rect)); } Status GetRectangle(RectF *rect) const { - return NotImplemented; + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipGetLineRect(gradient, rect)); } Status GetTransform(Matrix *matrix) const { - return NotImplemented; + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipGetLineTransform(gradient, matrix->nativeMatrix)); } - WrapMode GetWrapMode(VOID) const + WrapMode + GetWrapMode() const { - return WrapModeTile; + + WrapMode wrapMode; + GpLineGradient *gradient = GetNativeGradient(); + SetStatus(DllExports::GdipGetLineWrapMode(gradient, &wrapMode)); + return wrapMode; } Status MultiplyTransform(const Matrix *matrix, MatrixOrder order) { - return NotImplemented; + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipMultiplyLineTransform(gradient, matrix->nativeMatrix, order)); } - Status ResetTransform(VOID) + Status + ResetTransform() { - return NotImplemented; + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipResetLineTransform(gradient)); } Status RotateTransform(REAL angle, MatrixOrder order) { - return NotImplemented; + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipRotateLineTransform(gradient, angle, order)); } Status - ScaleTransform(REAL sx, REAL sy, MatrixOrder order) + ScaleTransform(REAL sx, REAL sy, MatrixOrder order = MatrixOrderPrepend) { - return NotImplemented; + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipScaleLineTransform(gradient, sx, sy, order)); } Status SetBlend(const REAL *blendFactors, const REAL *blendPositions, INT count) { - return NotImplemented; + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipSetLineBlend(gradient, blendFactors, blendPositions, count)); } Status SetBlendBellShape(REAL focus, REAL scale) { - return NotImplemented; + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipSetLineSigmaBlend(gradient, focus, scale)); } Status - SetBlendTriangularShape(REAL focus, REAL scale) + SetBlendTriangularShape(REAL focus, REAL scale = 1.0f) { - return NotImplemented; + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipSetLineLinearBlend(gradient, focus, scale)); } Status SetGammaCorrection(BOOL useGammaCorrection) { - return NotImplemented; + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipSetLineGammaCorrection(gradient, useGammaCorrection)); } Status SetInterpolationColors(const Color *presetColors, const REAL *blendPositions, INT count) { - return NotImplemented; + return SetStatus(NotImplemented); } Status SetLinearColors(const Color &color1, const Color &color2) { - return NotImplemented; + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipSetLineColors(gradient, color1.GetValue(), color2.GetValue())); } Status SetTransform(const Matrix *matrix) { - return NotImplemented; + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipSetLineTransform(gradient, matrix->nativeMatrix)); } Status SetWrapMode(WrapMode wrapMode) { - return NotImplemented; + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipSetLineWrapMode(gradient, wrapMode)); } Status - TranslateTransform(REAL dx, REAL dy, MatrixOrder order) + TranslateTransform(REAL dx, REAL dy, MatrixOrder order = MatrixOrderPrepend) { - return NotImplemented; + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipTranslateLineTransform(gradient, dx, dy, order)); } -}; -class SolidBrush : Brush -{ - public: - SolidBrush(const Color &color) + Status + SetLinearPoints(const PointF &point1, const PointF &point2) { +#if 1 + return SetStatus(NotImplemented); +#else + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipSetLinePoints(gradient, &point1, &point2)); +#endif } Status - GetColor(Color *color) const + GetLinearPoints(PointF *points) const { - return NotImplemented; +#if 1 + return SetStatus(NotImplemented); +#else + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipGetLinePoints(gradient, points)); +#endif } Status - SetColor(const Color &color) + SetLinearPoints(const Point &point1, const Point &point2) { - return NotImplemented; +#if 1 + return SetStatus(NotImplemented); +#else + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipSetLinePointsI(gradient, &point1, &point2)); +#endif } -}; -class TextureBrush : Brush -{ - public: - TextureBrush(Image *image, WrapMode wrapMode, const RectF &dstRect) + Status + GetLinearPoints(Point *points) const { +#if 1 + return SetStatus(NotImplemented); +#else + GpLineGradient *gradient = GetNativeGradient(); + return SetStatus(DllExports::GdipGetLinePointsI(gradient, points)); +#endif } - TextureBrush(Image *image, Rect &dstRect, ImageAttributes *imageAttributes) + protected: + GpLineGradient * + GetNativeGradient() const { + return static_cast<GpLineGradient *>(nativeBrush); } +}; - TextureBrush(Image *image, WrapMode wrapMode, INT dstX, INT dstY, INT dstWidth, INT dstHeight) - { - } +class SolidBrush : Brush +{ + public: + friend class Pen; - TextureBrush(Image *image, WrapMode wrapMode, REAL dstX, REAL dstY, REAL dstWidth, REAL dstHeight) + SolidBrush(const Color &color) { + GpSolidFill *brush = NULL; + lastStatus = DllExports::GdipCreateSolidFill(color.GetValue(), &brush); + SetNativeBrush(brush); } - TextureBrush(Image *image, RectF &dstRect, ImageAttributes *imageAttributes) + Status + GetColor(Color *color) const { + if (!color) + return SetStatus(InvalidParameter); + + ARGB argb; + GpSolidFill *fill = GetNativeFill(); + SetStatus(DllExports::GdipGetSolidFillColor(fill, &argb)); + + *color = Color(argb); + return lastStatus; } - TextureBrush(Image *image, WrapMode wrapMode) + Status + SetColor(const Color &color) { + GpSolidFill *fill = GetNativeFill(); + return SetStatus(DllExports::GdipSetSolidFillColor(fill, color.GetValue())); } - TextureBrush(Image *image, WrapMode wrapMode, const Rect &dstRect) + protected: + SolidBrush() { } - Image *GetImage(VOID) const + GpSolidFill * + GetNativeFill() const { - return NULL; + return static_cast<GpSolidFill *>(nativeBrush); } +}; + +class TextureBrush : Brush +{ + public: + // Defined in "gdiplusheaders.h": + TextureBrush(Image *image, WrapMode wrapMode, const RectF &dstRect); + TextureBrush(Image *image, Rect &dstRect, ImageAttributes *imageAttributes); + TextureBrush(Image *image, WrapMode wrapMode, INT dstX, INT dstY, INT dstWidth, INT dstHeight); + TextureBrush(Image *image, WrapMode wrapMode, REAL dstX, REAL dstY, REAL dstWidth, REAL dstHeight); + TextureBrush(Image *image, RectF &dstRect, ImageAttributes *imageAttributes); + TextureBrush(Image *image, WrapMode wrapMode); + TextureBrush(Image *image, WrapMode wrapMode, const Rect &dstRect); + + Image * + GetImage() const; Status GetTransform(Matrix *matrix) const { - return NotImplemented; + GpTexture *texture = GetNativeTexture(); + return SetStatus(DllExports::GdipGetTextureTransform(texture, matrix->nativeMatrix)); } - WrapMode GetWrapMode(VOID) const + WrapMode + GetWrapMode() const { - return WrapModeTile; + WrapMode wrapMode; + GpTexture *texture = GetNativeTexture(); + SetStatus(DllExports::GdipGetTextureWrapMode(texture, &wrapMode)); + return wrapMode; } Status - MultiplyTransform(Matrix *matrix, MatrixOrder order) + MultiplyTransform(Matrix *matrix, MatrixOrder order = MatrixOrderPrepend) { - return NotImplemented; + GpTexture *texture = GetNativeTexture(); + return SetStatus(DllExports::GdipMultiplyTextureTransform(texture, matrix->nativeMatrix, order)); } - Status ResetTransform(VOID) + Status + ResetTransform() { - return NotImplemented; + GpTexture *texture = GetNativeTexture(); + return SetStatus(DllExports::GdipResetTextureTransform(texture)); } Status RotateTransform(REAL angle, MatrixOrder order) { - return NotImplemented; + GpTexture *texture = GetNativeTexture(); + return SetStatus(DllExports::GdipRotateTextureTransform(texture, angle, order)); } Status ScaleTransform(REAL sx, REAL sy, MatrixOrder order) { - return NotImplemented; + GpTexture *texture = GetNativeTexture(); + return SetStatus(DllExports::GdipScaleTextureTransform(texture, sx, sy, order)); } Status SetTransform(const Matrix *matrix) { - return NotImplemented; + GpTexture *texture = GetNativeTexture(); + return SetStatus(DllExports::GdipSetTextureTransform(texture, matrix->nativeMatrix)); } Status SetWrapMode(WrapMode wrapMode) { - return NotImplemented; + GpTexture *texture = GetNativeTexture(); + return SetStatus(DllExports::GdipSetTextureWrapMode(texture, wrapMode)); } Status TranslateTransform(REAL dx, REAL dy, MatrixOrder order) { - return NotImplemented; + GpTexture *texture = GetNativeTexture(); + return SetStatus(DllExports::GdipTranslateTextureTransform(texture, dx, dy, order)); + } + + protected: + GpTexture * + GetNativeTexture() const + { + return static_cast<GpTexture *>(nativeBrush); + } + + TextureBrush() + { } }; diff --git a/sdk/include/psdk/gdiplusheaders.h b/sdk/include/psdk/gdiplusheaders.h index dccaa2e1460..eb139741bab 100644 --- a/sdk/include/psdk/gdiplusheaders.h +++ b/sdk/include/psdk/gdiplusheaders.h @@ -23,6 +23,7 @@ class Image : public GdiplusBase { public: friend class Graphics; + friend class TextureBrush; Image(IStream *stream, BOOL useEmbeddedColorManagement = FALSE) : nativeImage(NULL) { @@ -1438,4 +1439,80 @@ class CustomLineCap : public GdiplusBase operator=(const CustomLineCap &); }; +inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, const RectF &dstRect) +{ + GpTexture *texture = NULL; + lastStatus = DllExports::GdipCreateTexture2( + image->nativeImage, wrapMode, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture); + SetNativeBrush(texture); +} + +inline TextureBrush::TextureBrush(Image *image, Rect &dstRect, ImageAttributes *imageAttributes) +{ + GpTexture *texture = NULL; + GpImageAttributes *attrs = imageAttributes ? imageAttributes->nativeImageAttr : NULL; + lastStatus = DllExports::GdipCreateTextureIA( + image->nativeImage, attrs, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture); + SetNativeBrush(texture); +} + +inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, INT dstX, INT dstY, INT dstWidth, INT dstHeight) +{ + GpTexture *texture = NULL; + lastStatus = + DllExports::GdipCreateTexture2I(image->nativeImage, wrapMode, dstX, dstY, dstWidth, dstHeight, &texture); + SetNativeBrush(texture); +} + +inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, REAL dstX, REAL dstY, REAL dstWidth, REAL dstHeight) +{ + GpTexture *texture = NULL; + lastStatus = + DllExports::GdipCreateTexture2(image->nativeImage, wrapMode, dstX, dstY, dstWidth, dstHeight, &texture); + SetNativeBrush(texture); +} + +inline TextureBrush::TextureBrush(Image *image, RectF &dstRect, ImageAttributes *imageAttributes) +{ + GpTexture *texture = NULL; + GpImageAttributes *attrs = imageAttributes ? imageAttributes->nativeImageAttr : NULL; + lastStatus = DllExports::GdipCreateTextureIA( + image->nativeImage, attrs, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture); + SetNativeBrush(texture); +} + +inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode) +{ + GpTexture *texture = NULL; + lastStatus = DllExports::GdipCreateTexture(image->nativeImage, wrapMode, &texture); + SetNativeBrush(texture); +} + +inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, const Rect &dstRect) +{ + GpTexture *texture = NULL; + lastStatus = DllExports::GdipCreateTexture2I( + image->nativeImage, wrapMode, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture); + SetNativeBrush(texture); +} + +inline Image * +TextureBrush::GetImage() const +{ +#if 1 + return NULL; // FIXME +#else + GpImage *image = NULL; + GpTexture *texture = GetNativeTexture(); + SetStatus(DllExports::GdipGetTextureImage(texture, &image)); + if (lastStatus != Ok) + return NULL; + + Image *newImage = new Image(image, lastStatus); + if (!newImage) + DllExports::GdipDisposeImage(image); + return newImage; +#endif +} + #endif /* _GDIPLUSHEADERS_H */ diff --git a/sdk/include/psdk/gdiplusimageattributes.h b/sdk/include/psdk/gdiplusimageattributes.h index e68e1908558..4cda385608b 100644 --- a/sdk/include/psdk/gdiplusimageattributes.h +++ b/sdk/include/psdk/gdiplusimageattributes.h @@ -22,6 +22,8 @@ class ImageAttributes : public GdiplusBase { public: + friend class TextureBrush; + ImageAttributes() : nativeImageAttr(NULL) { lastStatus = DllExports::GdipCreateImageAttributes(&nativeImageAttr); diff --git a/sdk/include/psdk/gdiplusmatrix.h b/sdk/include/psdk/gdiplusmatrix.h index c2425c3ff1c..72981f72190 100644 --- a/sdk/include/psdk/gdiplusmatrix.h +++ b/sdk/include/psdk/gdiplusmatrix.h @@ -24,6 +24,9 @@ class Matrix : public GdiplusBase friend class Pen; friend class Region; friend class GraphicsPath; + friend class Brush; + friend class LinearGradientBrush; + friend class TextureBrush; public: Matrix(const RectF &rect, const PointF *dstplg)
4 years, 11 months
1
0
0
0
[reactos] 01/01: [SDK][INCLUDE] Rename Gdiplus::Brush::brush as nativeBrush (#2204)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dcc512a2455689ad615ef…
commit dcc512a2455689ad615ef02335e3916a71d987ee Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Dec 31 12:36:08 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Dec 31 12:36:08 2019 +0900 [SDK][INCLUDE] Rename Gdiplus::Brush::brush as nativeBrush (#2204) Make it w32api-compatible. CORE-16585 --- sdk/include/psdk/gdiplusbrush.h | 4 +-- sdk/include/psdk/gdiplusgraphics.h | 55 +++++++++++++++++++++----------------- sdk/include/psdk/gdipluspen.h | 2 +- 3 files changed, 34 insertions(+), 27 deletions(-) diff --git a/sdk/include/psdk/gdiplusbrush.h b/sdk/include/psdk/gdiplusbrush.h index e5b8b2f52fe..581f88d16f1 100644 --- a/sdk/include/psdk/gdiplusbrush.h +++ b/sdk/include/psdk/gdiplusbrush.h @@ -40,13 +40,13 @@ class Brush : public GdiplusBase BrushType GetType(VOID) { BrushType type; - SetStatus(DllExports::GdipGetBrushType(brush, &type)); + SetStatus(DllExports::GdipGetBrushType(nativeBrush, &type)); return type; } private: mutable Status status; - GpBrush *brush; + GpBrush *nativeBrush; Status SetStatus(Status status) const diff --git a/sdk/include/psdk/gdiplusgraphics.h b/sdk/include/psdk/gdiplusgraphics.h index 679afe5763b..5b2ace1c496 100644 --- a/sdk/include/psdk/gdiplusgraphics.h +++ b/sdk/include/psdk/gdiplusgraphics.h @@ -719,53 +719,54 @@ class Graphics : public GdiplusBase Status FillClosedCurve(const Brush *brush, const Point *points, INT count) { - return SetStatus(DllExports::GdipFillClosedCurveI(graphics, brush ? brush->brush : NULL, points, count)); + return SetStatus(DllExports::GdipFillClosedCurveI(graphics, brush ? brush->nativeBrush : NULL, points, count)); } Status FillClosedCurve(const Brush *brush, const Point *points, INT count, FillMode fillMode, REAL tension) { - return SetStatus( - DllExports::GdipFillClosedCurve2I(graphics, brush ? brush->brush : NULL, points, count, tension, fillMode)); + return SetStatus(DllExports::GdipFillClosedCurve2I( + graphics, brush ? brush->nativeBrush : NULL, points, count, tension, fillMode)); } Status FillClosedCurve(const Brush *brush, const PointF *points, INT count) { - return SetStatus(DllExports::GdipFillClosedCurve(graphics, brush ? brush->brush : NULL, points, count)); + return SetStatus(DllExports::GdipFillClosedCurve(graphics, brush ? brush->nativeBrush : NULL, points, count)); } Status FillClosedCurve(const Brush *brush, const PointF *points, INT count, FillMode fillMode, REAL tension) { - return SetStatus( - DllExports::GdipFillClosedCurve2(graphics, brush ? brush->brush : NULL, points, count, tension, fillMode)); + return SetStatus(DllExports::GdipFillClosedCurve2( + graphics, brush ? brush->nativeBrush : NULL, points, count, tension, fillMode)); } Status FillEllipse(const Brush *brush, const Rect &rect) { return SetStatus(DllExports::GdipFillEllipseI( - graphics, brush ? brush->brush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + graphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status FillEllipse(const Brush *brush, REAL x, REAL y, REAL width, REAL height) { - return SetStatus(DllExports::GdipFillEllipse(graphics, brush ? brush->brush : NULL, x, y, width, height)); + return SetStatus(DllExports::GdipFillEllipse(graphics, brush ? brush->nativeBrush : NULL, x, y, width, height)); } Status FillEllipse(const Brush *brush, const RectF &rect) { return SetStatus(DllExports::GdipFillEllipse( - graphics, brush ? brush->brush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + graphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status FillEllipse(const Brush *brush, INT x, INT y, INT width, INT height) { - return SetStatus(DllExports::GdipFillEllipseI(graphics, brush ? brush->brush : NULL, x, y, width, height)); + return SetStatus( + DllExports::GdipFillEllipseI(graphics, brush ? brush->nativeBrush : NULL, x, y, width, height)); } Status @@ -778,90 +779,96 @@ class Graphics : public GdiplusBase FillPie(const Brush *brush, const Rect &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipFillPieI( - graphics, brush ? brush->brush : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); + graphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, + sweepAngle)); } Status FillPie(const Brush *brush, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipFillPieI( - graphics, brush ? brush->brush : NULL, x, y, width, height, startAngle, sweepAngle)); + graphics, brush ? brush->nativeBrush : NULL, x, y, width, height, startAngle, sweepAngle)); } Status FillPie(const Brush *brush, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipFillPie( - graphics, brush ? brush->brush : NULL, x, y, width, height, startAngle, sweepAngle)); + graphics, brush ? brush->nativeBrush : NULL, x, y, width, height, startAngle, sweepAngle)); } Status FillPie(const Brush *brush, RectF &rect, REAL startAngle, REAL sweepAngle) { return SetStatus(DllExports::GdipFillPie( - graphics, brush ? brush->brush : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); + graphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, + sweepAngle)); } Status FillPolygon(const Brush *brush, const Point *points, INT count) { - return SetStatus(DllExports::GdipFillPolygon2I(graphics, brush ? brush->brush : NULL, points, count)); + return SetStatus(DllExports::GdipFillPolygon2I(graphics, brush ? brush->nativeBrush : NULL, points, count)); } Status FillPolygon(const Brush *brush, const PointF *points, INT count) { - return SetStatus(DllExports::GdipFillPolygon2(graphics, brush ? brush->brush : NULL, points, count)); + return SetStatus(DllExports::GdipFillPolygon2(graphics, brush ? brush->nativeBrush : NULL, points, count)); } Status FillPolygon(const Brush *brush, const Point *points, INT count, FillMode fillMode) { - return SetStatus(DllExports::GdipFillPolygonI(graphics, brush ? brush->brush : NULL, points, count, fillMode)); + return SetStatus( + DllExports::GdipFillPolygonI(graphics, brush ? brush->nativeBrush : NULL, points, count, fillMode)); } Status FillPolygon(const Brush *brush, const PointF *points, INT count, FillMode fillMode) { - return SetStatus(DllExports::GdipFillPolygon(graphics, brush ? brush->brush : NULL, points, count, fillMode)); + return SetStatus( + DllExports::GdipFillPolygon(graphics, brush ? brush->nativeBrush : NULL, points, count, fillMode)); } Status FillRectangle(const Brush *brush, const Rect &rect) { return SetStatus(DllExports::GdipFillRectangleI( - graphics, brush ? brush->brush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + graphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status FillRectangle(const Brush *brush, const RectF &rect) { return SetStatus(DllExports::GdipFillRectangle( - graphics, brush ? brush->brush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); + graphics, brush ? brush->nativeBrush : NULL, rect.X, rect.Y, rect.Width, rect.Height)); } Status FillRectangle(const Brush *brush, REAL x, REAL y, REAL width, REAL height) { - return SetStatus(DllExports::GdipFillRectangle(graphics, brush ? brush->brush : NULL, x, y, width, height)); + return SetStatus( + DllExports::GdipFillRectangle(graphics, brush ? brush->nativeBrush : NULL, x, y, width, height)); } Status FillRectangle(const Brush *brush, INT x, INT y, INT width, INT height) { - return SetStatus(DllExports::GdipFillRectangleI(graphics, brush ? brush->brush : NULL, x, y, width, height)); + return SetStatus( + DllExports::GdipFillRectangleI(graphics, brush ? brush->nativeBrush : NULL, x, y, width, height)); } Status FillRectangles(const Brush *brush, const Rect *rects, INT count) { - return SetStatus(DllExports::GdipFillRectanglesI(graphics, brush ? brush->brush : NULL, rects, count)); + return SetStatus(DllExports::GdipFillRectanglesI(graphics, brush ? brush->nativeBrush : NULL, rects, count)); } Status FillRectangles(const Brush *brush, const RectF *rects, INT count) { - return SetStatus(DllExports::GdipFillRectangles(graphics, brush ? brush->brush : NULL, rects, count)); + return SetStatus(DllExports::GdipFillRectangles(graphics, brush ? brush->nativeBrush : NULL, rects, count)); } Status diff --git a/sdk/include/psdk/gdipluspen.h b/sdk/include/psdk/gdipluspen.h index 18f73636d88..82b2cfdf6b2 100644 --- a/sdk/include/psdk/gdipluspen.h +++ b/sdk/include/psdk/gdipluspen.h @@ -210,7 +210,7 @@ class Pen : public GdiplusBase Status SetBrush(const Brush *brush) { - return SetStatus(DllExports::GdipSetPenBrushFill(pen, brush ? brush->brush : NULL)); + return SetStatus(DllExports::GdipSetPenBrushFill(pen, brush ? brush->nativeBrush : NULL)); } Status
4 years, 11 months
1
0
0
0
[reactos] 01/01: [SDK][INCLUDE] Improve Gdiplus::FontCollection (#2203)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=39eceedd899eefb399b45…
commit 39eceedd899eefb399b451eee10d76b55da146d4 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Dec 31 11:37:46 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Dec 31 11:37:46 2019 +0900 [SDK][INCLUDE] Improve Gdiplus::FontCollection (#2203) CORE-16585 --- sdk/include/psdk/gdiplusheaders.h | 48 +++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/sdk/include/psdk/gdiplusheaders.h b/sdk/include/psdk/gdiplusheaders.h index 915c1cf8f50..dccaa2e1460 100644 --- a/sdk/include/psdk/gdiplusheaders.h +++ b/sdk/include/psdk/gdiplusheaders.h @@ -650,30 +650,51 @@ class FontCollection : public GdiplusBase friend class FontFamily; public: - FontCollection() + FontCollection() : nativeFontCollection(NULL), lastStatus(Ok) + { + } + + virtual ~FontCollection() { } Status GetFamilies(INT numSought, FontFamily *gpfamilies, INT *numFound) const { - return NotImplemented; + return SetStatus(NotImplemented); } INT GetFamilyCount() const { - return 0; + INT numFound = 0; + lastStatus = DllExports::GdipGetFontCollectionFamilyCount(nativeFontCollection, &numFound); + return numFound; } Status - GetLastStatus() + GetLastStatus() const { - return NotImplemented; + return lastStatus; + } + + protected: + GpFontCollection *nativeFontCollection; + mutable Status lastStatus; + + Status + SetStatus(Status status) const + { + if (status != Ok) + lastStatus = status; + return status; } private: - GpFontCollection *fontCollection; + // FontCollection is not copyable + FontCollection(const FontCollection &); + FontCollection & + operator=(const FontCollection &); }; class FontFamily : public GdiplusBase @@ -687,8 +708,8 @@ class FontFamily : public GdiplusBase FontFamily(const WCHAR *name, const FontCollection *fontCollection) { - status = DllExports::GdipCreateFontFamilyFromName( - name, fontCollection ? fontCollection->fontCollection : NULL, &fontFamily); + GpFontCollection *theCollection = fontCollection ? fontCollection->nativeFontCollection : NULL; + status = DllExports::GdipCreateFontFamilyFromName(name, theCollection, &fontFamily); } FontFamily * @@ -809,18 +830,25 @@ class PrivateFontCollection : public FontCollection public: PrivateFontCollection() { + nativeFontCollection = NULL; + lastStatus = DllExports::GdipNewPrivateFontCollection(&nativeFontCollection); + } + + virtual ~PrivateFontCollection() + { + DllExports::GdipDeletePrivateFontCollection(&nativeFontCollection); } Status AddFontFile(const WCHAR *filename) { - return NotImplemented; + return SetStatus(DllExports::GdipPrivateAddFontFile(nativeFontCollection, filename)); } Status AddMemoryFont(const VOID *memory, INT length) { - return NotImplemented; + return SetStatus(DllExports::GdipPrivateAddMemoryFont(nativeFontCollection, memory, length)); } };
4 years, 11 months
1
0
0
0
← Newer
1
2
3
4
5
...
23
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
Results per page:
10
25
50
100
200