From c022c46613c137ab53185b5e7752aff14a085c4b Mon Sep 17 00:00:00 2001 From: Hugh Bellamy Date: Fri, 15 Sep 2017 16:39:59 +0100 Subject: [PATCH] gdiplus: Define GpHatchStyle. Signed-off-by: Hugh Bellamy Signed-off-by: Vincent Povirk Signed-off-by: Alexandre Julliard --- 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 6db4ada66aa..d5cd94a3836 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -230,7 +230,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])) { @@ -244,7 +244,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); @@ -941,7 +941,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 6bb7f88d507..33f6ceb1433 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -139,7 +139,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) { @@ -276,7 +276,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 e002a6f883e..45b2710ce0e 100644 --- a/dlls/gdiplus/tests/brush.c +++ b/dlls/gdiplus/tests/brush.c @@ -1556,6 +1556,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; @@ -1606,6 +1627,7 @@ START_TEST(brush) test_pathgradientcenterpoint(); test_pathgradientpresetblend(); test_pathgradientblend(); + test_getHatchStyle(); GdiplusShutdown(gdiplusToken); DestroyWindow(hwnd); diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index f2ac91e83dd..8bfe8b8db93 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -387,10 +387,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 5a65cd83e96..67b6ac1e34e 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