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
);
60 TRACE("<-- %p\n", *to
);
65 /* FIXME: Sometimes when fillPath is non-null and stroke path is null, the native
66 * version of this function returns NotImplemented. I cannot figure out why. */
67 GpStatus WINGDIPAPI
GdipCreateCustomLineCap(GpPath
* fillPath
, GpPath
* strokePath
,
68 GpLineCap baseCap
, REAL baseInset
, GpCustomLineCap
**customCap
)
72 TRACE("%p %p %d %f %p\n", fillPath
, strokePath
, baseCap
, baseInset
, customCap
);
74 if(!customCap
|| !(fillPath
|| strokePath
))
75 return InvalidParameter
;
77 *customCap
= GdipAlloc(sizeof(GpCustomLineCap
));
78 if(!*customCap
) return OutOfMemory
;
81 (*customCap
)->fill
= FALSE
;
82 pathdata
= &strokePath
->pathdata
;
85 (*customCap
)->fill
= TRUE
;
86 pathdata
= &fillPath
->pathdata
;
89 (*customCap
)->pathdata
.Points
= GdipAlloc(pathdata
->Count
* sizeof(PointF
));
90 (*customCap
)->pathdata
.Types
= GdipAlloc(pathdata
->Count
);
92 if((!(*customCap
)->pathdata
.Types
|| !(*customCap
)->pathdata
.Points
) &&
94 GdipFree((*customCap
)->pathdata
.Points
);
95 GdipFree((*customCap
)->pathdata
.Types
);
100 memcpy((*customCap
)->pathdata
.Points
, pathdata
->Points
, pathdata
->Count
102 memcpy((*customCap
)->pathdata
.Types
, pathdata
->Types
, pathdata
->Count
);
103 (*customCap
)->pathdata
.Count
= pathdata
->Count
;
105 (*customCap
)->inset
= baseInset
;
106 (*customCap
)->cap
= baseCap
;
107 (*customCap
)->join
= LineJoinMiter
;
108 (*customCap
)->scale
= 1.0;
110 TRACE("<-- %p\n", *customCap
);
115 GpStatus WINGDIPAPI
GdipDeleteCustomLineCap(GpCustomLineCap
*customCap
)
117 TRACE("(%p)\n", customCap
);
120 return InvalidParameter
;
122 GdipFree(customCap
->pathdata
.Points
);
123 GdipFree(customCap
->pathdata
.Types
);
129 GpStatus WINGDIPAPI
GdipGetCustomLineCapStrokeJoin(GpCustomLineCap
* customCap
,
130 GpLineJoin
* lineJoin
)
132 TRACE("(%p, %p)\n", customCap
, lineJoin
);
134 if(!customCap
|| !lineJoin
)
135 return InvalidParameter
;
137 *lineJoin
= customCap
->join
;
142 GpStatus WINGDIPAPI
GdipGetCustomLineCapWidthScale(GpCustomLineCap
* custom
,
145 TRACE("(%p, %p)\n", custom
, widthScale
);
147 if(!custom
|| !widthScale
)
148 return InvalidParameter
;
150 *widthScale
= custom
->scale
;
155 GpStatus WINGDIPAPI
GdipSetCustomLineCapStrokeCaps(GpCustomLineCap
* custom
,
156 GpLineCap start
, GpLineCap end
)
160 TRACE("(%p,%u,%u)\n", custom
, start
, end
);
163 return InvalidParameter
;
166 FIXME("not implemented\n");
168 return NotImplemented
;
171 GpStatus WINGDIPAPI
GdipSetCustomLineCapBaseCap(GpCustomLineCap
* custom
,
176 TRACE("(%p,%u)\n", custom
, base
);
179 FIXME("not implemented\n");
181 return NotImplemented
;
184 GpStatus WINGDIPAPI
GdipGetCustomLineCapBaseInset(GpCustomLineCap
* custom
,
187 TRACE("(%p, %p)\n", custom
, inset
);
189 if(!custom
|| !inset
)
190 return InvalidParameter
;
192 *inset
= custom
->inset
;
197 GpStatus WINGDIPAPI
GdipSetCustomLineCapBaseInset(GpCustomLineCap
* custom
,
202 TRACE("(%p,%0.2f)\n", custom
, inset
);
205 FIXME("not implemented\n");
207 return NotImplemented
;
210 /*FIXME: LineJoin completely ignored now */
211 GpStatus WINGDIPAPI
GdipSetCustomLineCapStrokeJoin(GpCustomLineCap
* custom
,
214 TRACE("(%p, %d)\n", custom
, join
);
217 return InvalidParameter
;
224 GpStatus WINGDIPAPI
GdipSetCustomLineCapWidthScale(GpCustomLineCap
* custom
, REAL width
)
226 TRACE("(%p,%0.2f)\n", custom
, width
);
229 return InvalidParameter
;
231 custom
->scale
= width
;
236 GpStatus WINGDIPAPI
GdipGetCustomLineCapBaseCap(GpCustomLineCap
*customCap
, GpLineCap
*baseCap
)
238 TRACE("(%p, %p)\n", customCap
, baseCap
);
240 if(!customCap
|| !baseCap
)
241 return InvalidParameter
;
243 *baseCap
= customCap
->cap
;
248 GpStatus WINGDIPAPI
GdipCreateAdjustableArrowCap(REAL height
, REAL width
, BOOL fill
,
249 GpAdjustableArrowCap
**cap
)
253 TRACE("(%0.2f,%0.2f,%i,%p)\n", height
, width
, fill
, cap
);
256 FIXME("not implemented\n");
258 return NotImplemented
;
261 GpStatus WINGDIPAPI
GdipGetAdjustableArrowCapFillState(GpAdjustableArrowCap
* cap
, BOOL
* fill
)
265 TRACE("(%p,%p)\n", cap
, fill
);
268 FIXME("not implemented\n");
270 return NotImplemented
;
273 GpStatus WINGDIPAPI
GdipGetAdjustableArrowCapHeight(GpAdjustableArrowCap
* cap
, REAL
* height
)
277 TRACE("(%p,%p)\n", cap
, height
);
280 FIXME("not implemented\n");
282 return NotImplemented
;
285 GpStatus WINGDIPAPI
GdipGetAdjustableArrowCapMiddleInset(GpAdjustableArrowCap
* cap
, REAL
* middle
)
289 TRACE("(%p,%p)\n", cap
, middle
);
292 FIXME("not implemented\n");
294 return NotImplemented
;
297 GpStatus WINGDIPAPI
GdipGetAdjustableArrowCapWidth(GpAdjustableArrowCap
* cap
, REAL
* width
)
301 TRACE("(%p,%p)\n", cap
, width
);
304 FIXME("not implemented\n");
306 return NotImplemented
;
309 GpStatus WINGDIPAPI
GdipSetAdjustableArrowCapFillState(GpAdjustableArrowCap
* cap
, BOOL fill
)
313 TRACE("(%p,%i)\n", cap
, fill
);
316 FIXME("not implemented\n");
318 return NotImplemented
;
321 GpStatus WINGDIPAPI
GdipSetAdjustableArrowCapHeight(GpAdjustableArrowCap
* cap
, REAL height
)
325 TRACE("(%p,%0.2f)\n", cap
, height
);
328 FIXME("not implemented\n");
330 return NotImplemented
;
333 GpStatus WINGDIPAPI
GdipSetAdjustableArrowCapMiddleInset(GpAdjustableArrowCap
* cap
, REAL middle
)
337 TRACE("(%p,%0.2f)\n", cap
, middle
);
340 FIXME("not implemented\n");
342 return NotImplemented
;
345 GpStatus WINGDIPAPI
GdipSetAdjustableArrowCapWidth(GpAdjustableArrowCap
* cap
, REAL width
)
349 TRACE("(%p,%0.2f)\n", cap
, width
);
352 FIXME("not implemented\n");
354 return NotImplemented
;