~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/gdiplus/customlinecap.c

Version: ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  * Copyright (C) 2007 Google (Evan Stade)
  3  *
  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.
  8  *
  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.
 13  *
 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
 17  */
 18 
 19 #include <stdarg.h>
 20 
 21 #include "windef.h"
 22 #include "winbase.h"
 23 #include "wingdi.h"
 24 
 25 #include "objbase.h"
 26 
 27 #include "gdiplus.h"
 28 #include "gdiplus_private.h"
 29 #include "wine/debug.h"
 30 
 31 WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
 32 
 33 GpStatus WINGDIPAPI GdipCloneCustomLineCap(GpCustomLineCap* from,
 34     GpCustomLineCap** to)
 35 {
 36     TRACE("(%p, %p)\n", from, to);
 37 
 38     if(!from || !to)
 39         return InvalidParameter;
 40 
 41     *to = GdipAlloc(sizeof(GpCustomLineCap));
 42     if(!*to)   return OutOfMemory;
 43 
 44     memcpy(*to, from, sizeof(GpCustomLineCap));
 45 
 46     (*to)->pathdata.Points = GdipAlloc(from->pathdata.Count * sizeof(PointF));
 47     (*to)->pathdata.Types = GdipAlloc(from->pathdata.Count);
 48 
 49     if((!(*to)->pathdata.Types  || !(*to)->pathdata.Points) && (*to)->pathdata.Count){
 50         GdipFree((*to)->pathdata.Points);
 51         GdipFree((*to)->pathdata.Types);
 52         GdipFree(*to);
 53         return OutOfMemory;
 54     }
 55 
 56     memcpy((*to)->pathdata.Points, from->pathdata.Points, from->pathdata.Count
 57            * sizeof(PointF));
 58     memcpy((*to)->pathdata.Types, from->pathdata.Types, from->pathdata.Count);
 59 
 60     TRACE("<-- %p\n", *to);
 61 
 62     return Ok;
 63 }
 64 
 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)
 69 {
 70     GpPathData *pathdata;
 71 
 72     TRACE("%p %p %d %f %p\n", fillPath, strokePath, baseCap, baseInset, customCap);
 73 
 74     if(!customCap || !(fillPath || strokePath))
 75         return InvalidParameter;
 76 
 77     *customCap = GdipAlloc(sizeof(GpCustomLineCap));
 78     if(!*customCap)    return OutOfMemory;
 79 
 80     if(strokePath){
 81         (*customCap)->fill = FALSE;
 82         pathdata = &strokePath->pathdata;
 83     }
 84     else{
 85         (*customCap)->fill = TRUE;
 86         pathdata = &fillPath->pathdata;
 87     }
 88 
 89     (*customCap)->pathdata.Points = GdipAlloc(pathdata->Count * sizeof(PointF));
 90     (*customCap)->pathdata.Types = GdipAlloc(pathdata->Count);
 91 
 92     if((!(*customCap)->pathdata.Types || !(*customCap)->pathdata.Points) &&
 93         pathdata->Count){
 94         GdipFree((*customCap)->pathdata.Points);
 95         GdipFree((*customCap)->pathdata.Types);
 96         GdipFree(*customCap);
 97         return OutOfMemory;
 98     }
 99 
100     memcpy((*customCap)->pathdata.Points, pathdata->Points, pathdata->Count
101            * sizeof(PointF));
102     memcpy((*customCap)->pathdata.Types, pathdata->Types, pathdata->Count);
103     (*customCap)->pathdata.Count = pathdata->Count;
104 
105     (*customCap)->inset = baseInset;
106     (*customCap)->cap = baseCap;
107     (*customCap)->join = LineJoinMiter;
108     (*customCap)->scale = 1.0;
109 
110     TRACE("<-- %p\n", *customCap);
111 
112     return Ok;
113 }
114 
115 GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap *customCap)
116 {
117     TRACE("(%p)\n", customCap);
118 
119     if(!customCap)
120         return InvalidParameter;
121 
122     GdipFree(customCap->pathdata.Points);
123     GdipFree(customCap->pathdata.Types);
124     GdipFree(customCap);
125 
126     return Ok;
127 }
128 
129 GpStatus WINGDIPAPI GdipGetCustomLineCapStrokeJoin(GpCustomLineCap* customCap,
130     GpLineJoin* lineJoin)
131 {
132     TRACE("(%p, %p)\n", customCap, lineJoin);
133 
134     if(!customCap || !lineJoin)
135         return InvalidParameter;
136 
137     *lineJoin = customCap->join;
138 
139     return Ok;
140 }
141 
142 GpStatus WINGDIPAPI GdipGetCustomLineCapWidthScale(GpCustomLineCap* custom,
143     REAL* widthScale)
144 {
145     TRACE("(%p, %p)\n", custom, widthScale);
146 
147     if(!custom || !widthScale)
148         return InvalidParameter;
149 
150     *widthScale = custom->scale;
151 
152     return Ok;
153 }
154 
155 GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeCaps(GpCustomLineCap* custom,
156     GpLineCap start, GpLineCap end)
157 {
158     static int calls;
159 
160     TRACE("(%p,%u,%u)\n", custom, start, end);
161 
162     if(!custom)
163         return InvalidParameter;
164 
165     if(!(calls++))
166         FIXME("not implemented\n");
167 
168     return NotImplemented;
169 }
170 
171 GpStatus WINGDIPAPI GdipSetCustomLineCapBaseCap(GpCustomLineCap* custom,
172     GpLineCap base)
173 {
174     static int calls;
175 
176     TRACE("(%p,%u)\n", custom, base);
177 
178     if(!(calls++))
179         FIXME("not implemented\n");
180 
181     return NotImplemented;
182 }
183 
184 GpStatus WINGDIPAPI GdipGetCustomLineCapBaseInset(GpCustomLineCap* custom,
185     REAL* inset)
186 {
187     TRACE("(%p, %p)\n", custom, inset);
188 
189     if(!custom || !inset)
190         return InvalidParameter;
191 
192     *inset = custom->inset;
193 
194     return Ok;
195 }
196 
197 GpStatus WINGDIPAPI GdipSetCustomLineCapBaseInset(GpCustomLineCap* custom,
198     REAL inset)
199 {
200     static int calls;
201 
202     TRACE("(%p,%0.2f)\n", custom, inset);
203 
204     if(!(calls++))
205         FIXME("not implemented\n");
206 
207     return NotImplemented;
208 }
209 
210 /*FIXME: LineJoin completely ignored now */
211 GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeJoin(GpCustomLineCap* custom,
212     GpLineJoin join)
213 {
214     TRACE("(%p, %d)\n", custom, join);
215 
216     if(!custom)
217         return InvalidParameter;
218 
219     custom->join = join;
220 
221     return Ok;
222 }
223 
224 GpStatus WINGDIPAPI GdipSetCustomLineCapWidthScale(GpCustomLineCap* custom,
225     REAL width)
226 {
227     static int calls;
228 
229     TRACE("(%p,%0.2f)\n", custom, width);
230 
231     if(!(calls++))
232         FIXME("not implemented\n");
233 
234     return NotImplemented;
235 }
236 
237 GpStatus WINGDIPAPI GdipGetCustomLineCapBaseCap(GpCustomLineCap *customCap, GpLineCap *baseCap)
238 {
239     TRACE("(%p, %p)\n", customCap, baseCap);
240 
241     if(!customCap || !baseCap)
242         return InvalidParameter;
243 
244     *baseCap = customCap->cap;
245 
246     return Ok;
247 }
248 
249 GpStatus WINGDIPAPI GdipCreateAdjustableArrowCap(REAL height, REAL width, BOOL fill,
250     GpAdjustableArrowCap **cap)
251 {
252     static int calls;
253 
254     TRACE("(%0.2f,%0.2f,%i,%p)\n", height, width, fill, cap);
255 
256     if(!(calls++))
257         FIXME("not implemented\n");
258 
259     return NotImplemented;
260 }
261 
262 GpStatus WINGDIPAPI GdipGetAdjustableArrowCapFillState(GpAdjustableArrowCap* cap, BOOL* fill)
263 {
264     static int calls;
265 
266     TRACE("(%p,%p)\n", cap, fill);
267 
268     if(!(calls++))
269         FIXME("not implemented\n");
270 
271     return NotImplemented;
272 }
273 
274 GpStatus WINGDIPAPI GdipGetAdjustableArrowCapHeight(GpAdjustableArrowCap* cap, REAL* height)
275 {
276     static int calls;
277 
278     TRACE("(%p,%p)\n", cap, height);
279 
280     if(!(calls++))
281         FIXME("not implemented\n");
282 
283     return NotImplemented;
284 }
285 
286 GpStatus WINGDIPAPI GdipGetAdjustableArrowCapMiddleInset(GpAdjustableArrowCap* cap, REAL* middle)
287 {
288     static int calls;
289 
290     TRACE("(%p,%p)\n", cap, middle);
291 
292     if(!(calls++))
293         FIXME("not implemented\n");
294 
295     return NotImplemented;
296 }
297 
298 GpStatus WINGDIPAPI GdipGetAdjustableArrowCapWidth(GpAdjustableArrowCap* cap, REAL* width)
299 {
300     static int calls;
301 
302     TRACE("(%p,%p)\n", cap, width);
303 
304     if(!(calls++))
305         FIXME("not implemented\n");
306 
307     return NotImplemented;
308 }
309 
310 GpStatus WINGDIPAPI GdipSetAdjustableArrowCapFillState(GpAdjustableArrowCap* cap, BOOL fill)
311 {
312     static int calls;
313 
314     TRACE("(%p,%i)\n", cap, fill);
315 
316     if(!(calls++))
317         FIXME("not implemented\n");
318 
319     return NotImplemented;
320 }
321 
322 GpStatus WINGDIPAPI GdipSetAdjustableArrowCapHeight(GpAdjustableArrowCap* cap, REAL height)
323 {
324     static int calls;
325 
326     TRACE("(%p,%0.2f)\n", cap, height);
327 
328     if(!(calls++))
329         FIXME("not implemented\n");
330 
331     return NotImplemented;
332 }
333 
334 GpStatus WINGDIPAPI GdipSetAdjustableArrowCapMiddleInset(GpAdjustableArrowCap* cap, REAL middle)
335 {
336     static int calls;
337 
338     TRACE("(%p,%0.2f)\n", cap, middle);
339 
340     if(!(calls++))
341         FIXME("not implemented\n");
342 
343     return NotImplemented;
344 }
345 
346 GpStatus WINGDIPAPI GdipSetAdjustableArrowCapWidth(GpAdjustableArrowCap* cap, REAL width)
347 {
348     static int calls;
349 
350     TRACE("(%p,%0.2f)\n", cap, width);
351 
352     if(!(calls++))
353         FIXME("not implemented\n");
354 
355     return NotImplemented;
356 }
357 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.