Module: wine Branch: master Commit: 2b438a0220f31e8f1778012f62ba7eff758abfa9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=2b438a0220f31e8f1778012f62...
Author: Evan Stade estade@gmail.com Date: Tue Aug 7 18:42:29 2007 -0700
gdiplus: Added GdipCreateLineBrush.
---
dlls/gdiplus/brush.c | 29 +++++++++++++++++++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/gdiplus_private.h | 9 +++++++++ include/gdiplusflat.h | 2 ++ include/gdiplusgpstubs.h | 2 ++ 5 files changed, 43 insertions(+), 1 deletions(-)
diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 33b48ad..35e1659 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -77,6 +77,35 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone) return Ok; }
+GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF* startpoint, + GDIPCONST GpPointF* endpoint, ARGB startcolor, ARGB endcolor, + GpWrapMode wrap, GpLineGradient **line) +{ + COLORREF col = ARGB2COLORREF(startcolor); + + if(!line || !startpoint || !endpoint) + return InvalidParameter; + + *line = GdipAlloc(sizeof(GpLineGradient)); + if(!*line) return OutOfMemory; + + (*line)->brush.lb.lbStyle = BS_SOLID; + (*line)->brush.lb.lbColor = col; + (*line)->brush.lb.lbHatch = 0; + (*line)->brush.gdibrush = CreateSolidBrush(col); + (*line)->brush.bt = BrushTypeLinearGradient; + + (*line)->startpoint.X = startpoint->X; + (*line)->startpoint.Y = startpoint->Y; + (*line)->endpoint.X = endpoint->X; + (*line)->endpoint.Y = endpoint->Y; + (*line)->startcolor = startcolor; + (*line)->endcolor = endcolor; + (*line)->wrap = wrap; + + return Ok; +} + GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF* points, INT count, GpWrapMode wrap, GpPathGradient **grad) { diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index b188170..6811926 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -98,7 +98,7 @@ @ stub GdipCreateHalftonePalette @ stub GdipCreateHatchBrush @ stdcall GdipCreateImageAttributes(ptr) -@ stub GdipCreateLineBrush +@ stdcall GdipCreateLineBrush(ptr ptr long long long ptr) @ stub GdipCreateLineBrushFromRect @ stub GdipCreateLineBrushFromRectI @ stub GdipCreateLineBrushFromRectWithAngle diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 7f56ea7..1eacd46 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -104,6 +104,15 @@ struct GpPathGradient{ GpPointF focus; };
+struct GpLineGradient{ + GpBrush brush; + GpPointF startpoint; + GpPointF endpoint; + ARGB startcolor; + ARGB endcolor; + GpWrapMode wrap; +}; + struct GpPath{ GpFillMode fill; GpPathData pathdata; diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 08f0696..963e8e4 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -49,6 +49,8 @@ GpStatus WINGDIPAPI GdipSetPenWidth(GpPen*,REAL);
GpStatus WINGDIPAPI GdipCreateFromHDC(HDC,GpGraphics**); GpStatus WINGDIPAPI GdipCreateFromHWND(HWND,GpGraphics**); +GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF*,GDIPCONST GpPointF*, + ARGB,ARGB,GpWrapMode,GpLineGradient**); GpStatus WINGDIPAPI GdipCreateMetafileFromEmf(HENHMETAFILE,BOOL,GpMetafile**); GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE,BOOL, GDIPCONST WmfPlaceableFileHeader*,GpMetafile**); diff --git a/include/gdiplusgpstubs.h b/include/gdiplusgpstubs.h index 423cd9e..6628dbc 100644 --- a/include/gdiplusgpstubs.h +++ b/include/gdiplusgpstubs.h @@ -34,6 +34,7 @@ class GpMetafile : public GpImage {}; class GpImageAttributes {}; class GpBitmap : public GpImage {}; class GpPathGradient : public GpBrush {}; +class GpLineGradient : public GpBrush {};
#else /* end of c++ declarations */
@@ -50,6 +51,7 @@ typedef struct GpMetafile GpMetafile; typedef struct GpImageAttributes GpImageAttributes; typedef struct GpBitmap GpBitmap; typedef struct GpPathGradient GpPathGradient; +typedef struct GpLineGradient GpLineGradient;
#endif /* end of c declarations */