Hugh Bellamy : gdiplus: Define GpHatchStyle.

Alexandre Julliard julliard at winehq.org
Tue Jan 2 15:01:23 CST 2018


Module: wine
Branch: stable
Commit: a37ea9543dc90ed2090bfe3509f134df1607e31c
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a37ea9543dc90ed2090bfe3509f134df1607e31c

Author: Hugh Bellamy <hughbellars at gmail.com>
Date:   Fri Sep 15 16:39:59 2017 +0100

gdiplus: Define GpHatchStyle.

Signed-off-by: Hugh Bellamy <hughbellars at gmail.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit c022c46613c137ab53185b5e7752aff14a085c4b)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/gdiplus/brush.c           |  6 +++---
 dlls/gdiplus/gdiplus_private.h |  4 ++--
 dlls/gdiplus/tests/brush.c     | 22 ++++++++++++++++++++++
 include/gdiplusflat.h          |  4 ++--
 include/gdiplusgpstubs.h       |  1 +
 5 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c
index a184276..9265ea6 100644
--- a/dlls/gdiplus/brush.c
+++ b/dlls/gdiplus/brush.c
@@ -227,7 +227,7 @@ static const char HatchBrushes[][8] = {
     { 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff }, /* HatchStyleDarkHorizontal */
 };
 
-GpStatus get_hatch_data(HatchStyle hatchstyle, const char **result)
+GpStatus get_hatch_data(GpHatchStyle hatchstyle, const char **result)
 {
     if (hatchstyle < sizeof(HatchBrushes) / sizeof(HatchBrushes[0]))
     {
@@ -241,7 +241,7 @@ GpStatus get_hatch_data(HatchStyle hatchstyle, const char **result)
 /******************************************************************************
  * GdipCreateHatchBrush [GDIPLUS.@]
  */
-GpStatus WINGDIPAPI GdipCreateHatchBrush(HatchStyle hatchstyle, ARGB forecol, ARGB backcol, GpHatch **brush)
+GpStatus WINGDIPAPI GdipCreateHatchBrush(GpHatchStyle hatchstyle, ARGB forecol, ARGB backcol, GpHatch **brush)
 {
     TRACE("(%d, %d, %d, %p)\n", hatchstyle, forecol, backcol, brush);
 
@@ -892,7 +892,7 @@ GpStatus WINGDIPAPI GdipGetHatchForegroundColor(GpHatch *brush, ARGB *forecol)
     return Ok;
 }
 
-GpStatus WINGDIPAPI GdipGetHatchStyle(GpHatch *brush, HatchStyle *hatchstyle)
+GpStatus WINGDIPAPI GdipGetHatchStyle(GpHatch *brush, GpHatchStyle *hatchstyle)
 {
     TRACE("(%p, %p)\n", brush, hatchstyle);
 
diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h
index 340e9bd..58689a7 100644
--- a/dlls/gdiplus/gdiplus_private.h
+++ b/dlls/gdiplus/gdiplus_private.h
@@ -123,7 +123,7 @@ extern GpStatus trace_path(GpGraphics *graphics, GpPath *path) DECLSPEC_HIDDEN;
 typedef struct region_element region_element;
 extern void delete_element(region_element *element) DECLSPEC_HIDDEN;
 
-extern GpStatus get_hatch_data(HatchStyle hatchstyle, const char **result) DECLSPEC_HIDDEN;
+extern GpStatus get_hatch_data(GpHatchStyle hatchstyle, const char **result) DECLSPEC_HIDDEN;
 
 static inline INT gdip_round(REAL x)
 {
@@ -258,7 +258,7 @@ struct GpBrush{
 
 struct GpHatch{
     GpBrush brush;
-    HatchStyle hatchstyle;
+    GpHatchStyle hatchstyle;
     ARGB forecol;
     ARGB backcol;
 };
diff --git a/dlls/gdiplus/tests/brush.c b/dlls/gdiplus/tests/brush.c
index 0942e88..ca324c2 100644
--- a/dlls/gdiplus/tests/brush.c
+++ b/dlls/gdiplus/tests/brush.c
@@ -1269,6 +1269,27 @@ static void test_pathgradientblend(void)
     expect(Ok, status);
 }
 
+static void test_getHatchStyle(void)
+{
+    GpStatus status;
+    GpHatch *brush;
+    GpHatchStyle hatchStyle;
+
+    GdipCreateHatchBrush(HatchStyleHorizontal, 11, 12, &brush);
+
+    status = GdipGetHatchStyle(NULL, &hatchStyle);
+    expect(InvalidParameter, status);
+
+    status = GdipGetHatchStyle(brush, NULL);
+    expect(InvalidParameter, status);
+
+    status = GdipGetHatchStyle(brush, &hatchStyle);
+    expect(Ok, status);
+    expect(HatchStyleHorizontal, hatchStyle);
+
+    GdipDeleteBrush((GpBrush *)brush);
+}
+
 START_TEST(brush)
 {
     struct GdiplusStartupInput gdiplusStartupInput;
@@ -1297,6 +1318,7 @@ START_TEST(brush)
     test_pathgradientcenterpoint();
     test_pathgradientpresetblend();
     test_pathgradientblend();
+    test_getHatchStyle();
 
     GdiplusShutdown(gdiplusToken);
 }
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 101d73d..5cfdc59 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -385,10 +385,10 @@ GpStatus WINGDIPAPI GdipWarpPath(GpPath*,GpMatrix*,GDIPCONST GpPointF*,INT,REAL,
 GpStatus WINGDIPAPI GdipWidenPath(GpPath*,GpPen*,GpMatrix*,REAL);
 
 /* HatchBrush */
-GpStatus WINGDIPAPI GdipCreateHatchBrush(HatchStyle,ARGB,ARGB,GpHatch**);
+GpStatus WINGDIPAPI GdipCreateHatchBrush(GpHatchStyle,ARGB,ARGB,GpHatch**);
 GpStatus WINGDIPAPI GdipGetHatchBackgroundColor(GpHatch*,ARGB*);
 GpStatus WINGDIPAPI GdipGetHatchForegroundColor(GpHatch*,ARGB*);
-GpStatus WINGDIPAPI GdipGetHatchStyle(GpHatch*,HatchStyle*);
+GpStatus WINGDIPAPI GdipGetHatchStyle(GpHatch*,GpHatchStyle*);
 
 /* Image */
 GpStatus WINGDIPAPI GdipCloneImage(GpImage*, GpImage**);
diff --git a/include/gdiplusgpstubs.h b/include/gdiplusgpstubs.h
index 5a65cd8..67b6ac1 100644
--- a/include/gdiplusgpstubs.h
+++ b/include/gdiplusgpstubs.h
@@ -95,5 +95,6 @@ typedef FlushIntention GpFlushIntention;
 typedef CoordinateSpace GpCoordinateSpace;
 typedef PenAlignment GpPenAlignment;
 typedef PenType GpPenType;
+typedef HatchStyle GpHatchStyle;
 
 #endif




More information about the wine-cvs mailing list