Commit 9f25eb35 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdiplus: Added GdipGetPenFillType.

parent 74acbf9c
...@@ -360,7 +360,7 @@ ...@@ -360,7 +360,7 @@
@ stdcall GdipGetPenDashOffset(ptr ptr) @ stdcall GdipGetPenDashOffset(ptr ptr)
@ stdcall GdipGetPenDashStyle(ptr ptr) @ stdcall GdipGetPenDashStyle(ptr ptr)
@ stdcall GdipGetPenEndCap(ptr ptr) @ stdcall GdipGetPenEndCap(ptr ptr)
@ stub GdipGetPenFillType @ stdcall GdipGetPenFillType(ptr ptr)
@ stdcall GdipGetPenLineJoin(ptr ptr) @ stdcall GdipGetPenLineJoin(ptr ptr)
@ stdcall GdipGetPenMiterLimit(ptr ptr) @ stdcall GdipGetPenMiterLimit(ptr ptr)
@ stdcall GdipGetPenMode(ptr ptr) @ stdcall GdipGetPenMode(ptr ptr)
......
...@@ -67,6 +67,24 @@ static DWORD gdip_to_gdi_join(GpLineJoin join) ...@@ -67,6 +67,24 @@ static DWORD gdip_to_gdi_join(GpLineJoin join)
} }
} }
static GpPenType bt_to_pt(GpBrushType bt)
{
switch(bt){
case BrushTypeSolidColor:
return PenTypeSolidColor;
case BrushTypeHatchFill:
return PenTypeHatchFill;
case BrushTypeTextureFill:
return PenTypeTextureFill;
case BrushTypePathGradient:
return PenTypePathGradient;
case BrushTypeLinearGradient:
return PenTypeLinearGradient;
default:
return PenTypeUnknown;
}
}
GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen) GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen)
{ {
TRACE("(%p, %p)\n", pen, clonepen); TRACE("(%p, %p)\n", pen, clonepen);
...@@ -283,6 +301,18 @@ GpStatus WINGDIPAPI GdipGetPenEndCap(GpPen *pen, GpLineCap *endCap) ...@@ -283,6 +301,18 @@ GpStatus WINGDIPAPI GdipGetPenEndCap(GpPen *pen, GpLineCap *endCap)
return Ok; return Ok;
} }
GpStatus WINGDIPAPI GdipGetPenFillType(GpPen *pen, GpPenType* type)
{
TRACE("(%p, %p)\n", pen, type);
if(!pen || !type)
return InvalidParameter;
*type = bt_to_pt(pen->brush->bt);
return Ok;
}
GpStatus WINGDIPAPI GdipGetPenLineJoin(GpPen *pen, GpLineJoin *lineJoin) GpStatus WINGDIPAPI GdipGetPenLineJoin(GpPen *pen, GpLineJoin *lineJoin)
{ {
TRACE("(%p, %p)\n", pen, lineJoin); TRACE("(%p, %p)\n", pen, lineJoin);
......
...@@ -275,6 +275,56 @@ static void test_customcap(void) ...@@ -275,6 +275,56 @@ static void test_customcap(void)
GdipDeletePen(pen); GdipDeletePen(pen);
} }
static void test_penfilltype(void)
{
GpPen *pen;
GpSolidFill *solid;
GpLineGradient *line;
GpPointF a, b;
GpStatus status;
GpPenType type;
/* NULL */
status = GdipGetPenFillType(NULL, NULL);
expect(InvalidParameter, status);
status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
expect(Ok, status);
status = GdipGetPenFillType(pen, NULL);
expect(InvalidParameter, status);
/* created with GdipCreatePen1() */
status = GdipGetPenFillType(pen, &type);
expect(Ok, status);
expect(PenTypeSolidColor, type);
GdipDeletePen(pen);
/* based on SolidBrush */
status = GdipCreateSolidFill((ARGB)0xffff00ff, &solid);
expect(Ok, status);
status = GdipCreatePen2((GpBrush*)solid, 10.0f, UnitPixel, &pen);
expect(Ok, status);
status = GdipGetPenFillType(pen, &type);
expect(Ok, status);
expect(PenTypeSolidColor, type);
GdipDeletePen(pen);
GdipDeleteBrush((GpBrush*)solid);
/* based on LinearGradientBrush */
a.X = a.Y = 0.0;
b.X = b.Y = 10.0;
status = GdipCreateLineBrush(&a, &b, (ARGB)0xffff00ff, (ARGB)0xffff0000,
WrapModeTile, &line);
expect(Ok, status);
status = GdipCreatePen2((GpBrush*)line, 10.0f, UnitPixel, &pen);
expect(Ok, status);
status = GdipGetPenFillType(pen, &type);
expect(Ok, status);
expect(PenTypeLinearGradient, type);
GdipDeletePen(pen);
GdipDeleteBrush((GpBrush*)line);
}
START_TEST(pen) START_TEST(pen)
{ {
struct GdiplusStartupInput gdiplusStartupInput; struct GdiplusStartupInput gdiplusStartupInput;
...@@ -294,6 +344,7 @@ START_TEST(pen) ...@@ -294,6 +344,7 @@ START_TEST(pen)
test_brushfill(); test_brushfill();
test_dasharray(); test_dasharray();
test_customcap(); test_customcap();
test_penfilltype();
GdiplusShutdown(gdiplusToken); GdiplusShutdown(gdiplusToken);
} }
...@@ -76,6 +76,16 @@ enum PathPointType{ ...@@ -76,6 +76,16 @@ enum PathPointType{
PathPointTypeBezier3 = 3 PathPointTypeBezier3 = 3
}; };
enum PenType
{
PenTypeSolidColor = BrushTypeSolidColor,
PenTypeHatchFill = BrushTypeHatchFill,
PenTypeTextureFill = BrushTypeTextureFill,
PenTypePathGradient = BrushTypePathGradient,
PenTypeLinearGradient = BrushTypeLinearGradient,
PenTypeUnknown = -1
};
enum LineJoin enum LineJoin
{ {
LineJoinMiter = 0, LineJoinMiter = 0,
...@@ -384,6 +394,7 @@ typedef enum FlushIntention FlushIntention; ...@@ -384,6 +394,7 @@ typedef enum FlushIntention FlushIntention;
typedef enum CoordinateSpace CoordinateSpace; typedef enum CoordinateSpace CoordinateSpace;
typedef enum GpTestControlEnum GpTestControlEnum; typedef enum GpTestControlEnum GpTestControlEnum;
typedef enum MetafileFrameUnit MetafileFrameUnit; typedef enum MetafileFrameUnit MetafileFrameUnit;
typedef enum PenType PenType;
#endif /* end of c typedefs */ #endif /* end of c typedefs */
......
...@@ -487,6 +487,7 @@ GpStatus WINGDIPAPI GdipSetPenDashCap197819(GpPen*,GpDashCap); ...@@ -487,6 +487,7 @@ GpStatus WINGDIPAPI GdipSetPenDashCap197819(GpPen*,GpDashCap);
GpStatus WINGDIPAPI GdipSetPenDashOffset(GpPen*,REAL); GpStatus WINGDIPAPI GdipSetPenDashOffset(GpPen*,REAL);
GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen*,GpDashStyle); GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen*,GpDashStyle);
GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen*,GpLineCap); GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen*,GpLineCap);
GpStatus WINGDIPAPI GdipGetPenFillType(GpPen*,GpPenType*);
GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen*,GpLineCap,GpLineCap,GpDashCap); GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen*,GpLineCap,GpLineCap,GpDashCap);
GpStatus WINGDIPAPI GdipSetPenLineJoin(GpPen*,GpLineJoin); GpStatus WINGDIPAPI GdipSetPenLineJoin(GpPen*,GpLineJoin);
GpStatus WINGDIPAPI GdipSetPenMode(GpPen*,GpPenAlignment); GpStatus WINGDIPAPI GdipSetPenMode(GpPen*,GpPenAlignment);
......
...@@ -90,5 +90,6 @@ typedef WrapMode GpWrapMode; ...@@ -90,5 +90,6 @@ typedef WrapMode GpWrapMode;
typedef Color GpColor; typedef Color GpColor;
typedef FlushIntention GpFlushIntention; typedef FlushIntention GpFlushIntention;
typedef CoordinateSpace GpCoordinateSpace; typedef CoordinateSpace GpCoordinateSpace;
typedef PenType GpPenType;
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment