gdiplus: Define GpHatchStyle.

Signed-off-by: Hugh Bellamy <hughbellars@gmail.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Hugh Bellamy 2017-09-15 16:39:59 +01:00 committed by Alexandre Julliard
parent e0601829e1
commit c022c46613
5 changed files with 30 additions and 7 deletions

View File

@ -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);

View File

@ -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;
};

View File

@ -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);

View File

@ -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**);

View File

@ -95,5 +95,6 @@ typedef FlushIntention GpFlushIntention;
typedef CoordinateSpace GpCoordinateSpace;
typedef PenAlignment GpPenAlignment;
typedef PenType GpPenType;
typedef HatchStyle GpHatchStyle;
#endif