2 * Copyright (C) 2007 Google (Evan Stade)
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #include "gdiplus_private.h"
26 #include "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
30 GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
33 return InvalidParameter;
36 case BrushTypeSolidColor:
37 *clone = GdipAlloc(sizeof(GpSolidFill));
38 if (!*clone) return OutOfMemory;
40 memcpy(*clone, brush, sizeof(GpSolidFill));
42 (*clone)->gdibrush = CreateBrushIndirect(&(*clone)->lb);
45 return NotImplemented;
51 /* FIXME: path gradient brushes not truly supported (drawn as solid brushes) */
52 GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath* path,
53 GpPathGradient **grad)
55 COLORREF col = ARGB2COLORREF(0xffffffff);
58 return InvalidParameter;
60 *grad = GdipAlloc(sizeof(GpPathGradient));
61 if (!*grad) return OutOfMemory;
63 (*grad)->brush.lb.lbStyle = BS_SOLID;
64 (*grad)->brush.lb.lbColor = col;
65 (*grad)->brush.lb.lbHatch = 0;
67 (*grad)->brush.gdibrush = CreateSolidBrush(col);
68 (*grad)->brush.bt = BrushTypeSolidColor;
69 (*grad)->centercolor = 0xffffffff;
70 (*grad)->wrap = WrapModeClamp;
75 GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf)
77 COLORREF col = ARGB2COLORREF(color);
79 if(!sf) return InvalidParameter;
81 *sf = GdipAlloc(sizeof(GpSolidFill));
82 if (!*sf) return OutOfMemory;
84 (*sf)->brush.lb.lbStyle = BS_SOLID;
85 (*sf)->brush.lb.lbColor = col;
86 (*sf)->brush.lb.lbHatch = 0;
88 (*sf)->brush.gdibrush = CreateSolidBrush(col);
89 (*sf)->brush.bt = BrushTypeSolidColor;
95 GpStatus WINGDIPAPI GdipGetBrushType(GpBrush *brush, GpBrushType *type)
97 if(!brush || !type) return InvalidParameter;
104 GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
106 if(!brush) return InvalidParameter;
108 DeleteObject(brush->gdibrush);
114 GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill *sf, ARGB *argb)
117 return InvalidParameter;
124 GpStatus WINGDIPAPI GdipSetPathGradientCenterColor(GpPathGradient *grad,
128 return InvalidParameter;
130 grad->centercolor = argb;
131 grad->brush.lb.lbColor = ARGB2COLORREF(argb);
133 DeleteObject(grad->brush.gdibrush);
134 grad->brush.gdibrush = CreateSolidBrush(grad->brush.lb.lbColor);
139 GpStatus WINGDIPAPI GdipSetPathGradientWrapMode(GpPathGradient *grad,
143 return InvalidParameter;
150 GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill *sf, ARGB argb)
153 return InvalidParameter;
156 sf->brush.lb.lbColor = ARGB2COLORREF(argb);
158 DeleteObject(sf->brush.gdibrush);
159 sf->brush.gdibrush = CreateSolidBrush(sf->brush.lb.lbColor);