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
28 #include "gdiplus_private.h"
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(gdiplus
);
33 GpStatus WINGDIPAPI
GdipCloneCustomLineCap(GpCustomLineCap
* from
,
36 TRACE("(%p, %p)\n", from
, to
);
39 return InvalidParameter
;
41 *to
= GdipAlloc(sizeof(GpCustomLineCap
));
42 if(!*to
) return OutOfMemory
;
44 memcpy(*to
, from
, sizeof(GpCustomLineCap
));
46 (*to
)->pathdata
.Points
= GdipAlloc(from
->pathdata
.Count
* sizeof(PointF
));
47 (*to
)->pathdata
.Types
= GdipAlloc(from
->pathdata
.Count
);
49 if((!(*to
)->pathdata
.Types
|| !(*to
)->pathdata
.Points
) && (*to
)->pathdata
.Count
){
50 GdipFree((*to
)->pathdata
.Points
);
51 GdipFree((*to
)->pathdata
.Types
);
56 memcpy((*to
)->pathdata
.Points
, from
->pathdata
.Points
, from
->pathdata
.Count
58 memcpy((*to
)->pathdata
.Types
, from
->pathdata
.Types
, from
->pathdata
.Count
);
63 /* FIXME: Sometimes when fillPath is non-null and stroke path is null, the native
64 * version of this function returns NotImplemented. I cannot figure out why. */
65 GpStatus WINGDIPAPI
GdipCreateCustomLineCap(GpPath
* fillPath
, GpPath
* strokePath
,
66 GpLineCap baseCap
, REAL baseInset
, GpCustomLineCap
**customCap
)
70 TRACE("%p %p %d %f %p\n", fillPath
, strokePath
, baseCap
, baseInset
, customCap
);
72 if(!customCap
|| !(fillPath
|| strokePath
))
73 return InvalidParameter
;
75 *customCap
= GdipAlloc(sizeof(GpCustomLineCap
));
76 if(!*customCap
) return OutOfMemory
;
79 (*customCap
)->fill
= FALSE
;
80 pathdata
= &strokePath
->pathdata
;
83 (*customCap
)->fill
= TRUE
;
84 pathdata
= &fillPath
->pathdata
;
87 (*customCap
)->pathdata
.Points
= GdipAlloc(pathdata
->Count
* sizeof(PointF
));
88 (*customCap
)->pathdata
.Types
= GdipAlloc(pathdata
->Count
);
90 if((!(*customCap
)->pathdata
.Types
|| !(*customCap
)->pathdata
.Points
) &&
92 GdipFree((*customCap
)->pathdata
.Points
);
93 GdipFree((*customCap
)->pathdata
.Types
);
98 memcpy((*customCap
)->pathdata
.Points
, pathdata
->Points
, pathdata
->Count
100 memcpy((*customCap
)->pathdata
.Types
, pathdata
->Types
, pathdata
->Count
);
101 (*customCap
)->pathdata
.Count
= pathdata
->Count
;
103 (*customCap
)->inset
= baseInset
;
104 (*customCap
)->cap
= baseCap
;
105 (*customCap
)->join
= LineJoinMiter
;
106 (*customCap
)->scale
= 1.0;
111 GpStatus WINGDIPAPI
GdipDeleteCustomLineCap(GpCustomLineCap
*customCap
)
113 TRACE("(%p)\n", customCap
);
116 return InvalidParameter
;
118 GdipFree(customCap
->pathdata
.Points
);
119 GdipFree(customCap
->pathdata
.Types
);
125 GpStatus WINGDIPAPI
GdipGetCustomLineCapStrokeJoin(GpCustomLineCap
* customCap
,
126 GpLineJoin
* lineJoin
)
128 TRACE("(%p, %p)\n", customCap
, lineJoin
);
130 if(!customCap
|| !lineJoin
)
131 return InvalidParameter
;
133 *lineJoin
= customCap
->join
;
138 GpStatus WINGDIPAPI
GdipGetCustomLineCapWidthScale(GpCustomLineCap
* custom
,
141 TRACE("(%p, %p)\n", custom
, widthScale
);
143 if(!custom
|| !widthScale
)
144 return InvalidParameter
;
146 *widthScale
= custom
->scale
;
151 GpStatus WINGDIPAPI
GdipSetCustomLineCapStrokeCaps(GpCustomLineCap
* custom
,
152 GpLineCap start
, GpLineCap end
)
157 return InvalidParameter
;
160 FIXME("not implemented\n");
162 return NotImplemented
;
165 GpStatus WINGDIPAPI
GdipSetCustomLineCapBaseCap(GpCustomLineCap
* custom
,
171 FIXME("not implemented\n");
173 return NotImplemented
;
176 GpStatus WINGDIPAPI
GdipGetCustomLineCapBaseInset(GpCustomLineCap
* custom
,
179 TRACE("(%p, %p)\n", custom
, inset
);
181 if(!custom
|| !inset
)
182 return InvalidParameter
;
184 *inset
= custom
->inset
;
189 GpStatus WINGDIPAPI
GdipSetCustomLineCapBaseInset(GpCustomLineCap
* custom
,
195 FIXME("not implemented\n");
197 return NotImplemented
;
200 /*FIXME: LineJoin completely ignored now */
201 GpStatus WINGDIPAPI
GdipSetCustomLineCapStrokeJoin(GpCustomLineCap
* custom
,
204 TRACE("(%p, %d)\n", custom
, join
);
207 return InvalidParameter
;
214 GpStatus WINGDIPAPI
GdipSetCustomLineCapWidthScale(GpCustomLineCap
* custom
,
220 FIXME("not implemented\n");
222 return NotImplemented
;
225 GpStatus WINGDIPAPI
GdipGetCustomLineCapBaseCap(GpCustomLineCap
*customCap
, GpLineCap
*baseCap
)
227 TRACE("(%p, %p)\n", customCap
, baseCap
);
229 if(!customCap
|| !baseCap
)
230 return InvalidParameter
;
232 *baseCap
= customCap
->cap
;
237 GpStatus WINGDIPAPI
GdipCreateAdjustableArrowCap(REAL height
, REAL width
, BOOL fill
,
238 GpAdjustableArrowCap
**cap
)
243 FIXME("not implemented\n");
245 return NotImplemented
;
248 GpStatus WINGDIPAPI
GdipGetAdjustableArrowCapFillState(GpAdjustableArrowCap
* cap
, BOOL
* fill
)
253 FIXME("not implemented\n");
255 return NotImplemented
;
258 GpStatus WINGDIPAPI
GdipGetAdjustableArrowCapHeight(GpAdjustableArrowCap
* cap
, REAL
* height
)
263 FIXME("not implemented\n");
265 return NotImplemented
;
268 GpStatus WINGDIPAPI
GdipGetAdjustableArrowCapMiddleInset(GpAdjustableArrowCap
* cap
, REAL
* middle
)
273 FIXME("not implemented\n");
275 return NotImplemented
;
278 GpStatus WINGDIPAPI
GdipGetAdjustableArrowCapWidth(GpAdjustableArrowCap
* cap
, REAL
* width
)
283 FIXME("not implemented\n");
285 return NotImplemented
;
288 GpStatus WINGDIPAPI
GdipSetAdjustableArrowCapFillState(GpAdjustableArrowCap
* cap
, BOOL fill
)
293 FIXME("not implemented\n");
295 return NotImplemented
;
298 GpStatus WINGDIPAPI
GdipSetAdjustableArrowCapHeight(GpAdjustableArrowCap
* cap
, REAL height
)
303 FIXME("not implemented\n");
305 return NotImplemented
;
308 GpStatus WINGDIPAPI
GdipSetAdjustableArrowCapMiddleInset(GpAdjustableArrowCap
* cap
, REAL middle
)
313 FIXME("not implemented\n");
315 return NotImplemented
;
318 GpStatus WINGDIPAPI
GdipSetAdjustableArrowCapWidth(GpAdjustableArrowCap
* cap
, REAL width
)
323 FIXME("not implemented\n");
325 return NotImplemented
;