Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygencustomlinecap.c
Go to the documentation of this file.
00001 /* 00002 * Copyright (C) 2007 Google (Evan Stade) 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00017 */ 00018 00019 #include <stdarg.h> 00020 00021 #include "windef.h" 00022 #include "winbase.h" 00023 #include "wingdi.h" 00024 00025 #include "objbase.h" 00026 00027 #include "gdiplus.h" 00028 #include "gdiplus_private.h" 00029 #include "wine/debug.h" 00030 00031 WINE_DEFAULT_DEBUG_CHANNEL(gdiplus); 00032 00033 GpStatus WINGDIPAPI GdipCloneCustomLineCap(GpCustomLineCap* from, 00034 GpCustomLineCap** to) 00035 { 00036 TRACE("(%p, %p)\n", from, to); 00037 00038 if(!from || !to) 00039 return InvalidParameter; 00040 00041 *to = GdipAlloc(sizeof(GpCustomLineCap)); 00042 if(!*to) return OutOfMemory; 00043 00044 memcpy(*to, from, sizeof(GpCustomLineCap)); 00045 00046 (*to)->pathdata.Points = GdipAlloc(from->pathdata.Count * sizeof(PointF)); 00047 (*to)->pathdata.Types = GdipAlloc(from->pathdata.Count); 00048 00049 if((!(*to)->pathdata.Types || !(*to)->pathdata.Points) && (*to)->pathdata.Count){ 00050 GdipFree((*to)->pathdata.Points); 00051 GdipFree((*to)->pathdata.Types); 00052 GdipFree(*to); 00053 return OutOfMemory; 00054 } 00055 00056 memcpy((*to)->pathdata.Points, from->pathdata.Points, from->pathdata.Count 00057 * sizeof(PointF)); 00058 memcpy((*to)->pathdata.Types, from->pathdata.Types, from->pathdata.Count); 00059 00060 TRACE("<-- %p\n", *to); 00061 00062 return Ok; 00063 } 00064 00065 /* FIXME: Sometimes when fillPath is non-null and stroke path is null, the native 00066 * version of this function returns NotImplemented. I cannot figure out why. */ 00067 GpStatus WINGDIPAPI GdipCreateCustomLineCap(GpPath* fillPath, GpPath* strokePath, 00068 GpLineCap baseCap, REAL baseInset, GpCustomLineCap **customCap) 00069 { 00070 GpPathData *pathdata; 00071 00072 TRACE("%p %p %d %f %p\n", fillPath, strokePath, baseCap, baseInset, customCap); 00073 00074 if(!customCap || !(fillPath || strokePath)) 00075 return InvalidParameter; 00076 00077 *customCap = GdipAlloc(sizeof(GpCustomLineCap)); 00078 if(!*customCap) return OutOfMemory; 00079 00080 if(strokePath){ 00081 (*customCap)->fill = FALSE; 00082 pathdata = &strokePath->pathdata; 00083 } 00084 else{ 00085 (*customCap)->fill = TRUE; 00086 pathdata = &fillPath->pathdata; 00087 } 00088 00089 (*customCap)->pathdata.Points = GdipAlloc(pathdata->Count * sizeof(PointF)); 00090 (*customCap)->pathdata.Types = GdipAlloc(pathdata->Count); 00091 00092 if((!(*customCap)->pathdata.Types || !(*customCap)->pathdata.Points) && 00093 pathdata->Count){ 00094 GdipFree((*customCap)->pathdata.Points); 00095 GdipFree((*customCap)->pathdata.Types); 00096 GdipFree(*customCap); 00097 return OutOfMemory; 00098 } 00099 00100 memcpy((*customCap)->pathdata.Points, pathdata->Points, pathdata->Count 00101 * sizeof(PointF)); 00102 memcpy((*customCap)->pathdata.Types, pathdata->Types, pathdata->Count); 00103 (*customCap)->pathdata.Count = pathdata->Count; 00104 00105 (*customCap)->inset = baseInset; 00106 (*customCap)->cap = baseCap; 00107 (*customCap)->join = LineJoinMiter; 00108 (*customCap)->scale = 1.0; 00109 00110 TRACE("<-- %p\n", *customCap); 00111 00112 return Ok; 00113 } 00114 00115 GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap *customCap) 00116 { 00117 TRACE("(%p)\n", customCap); 00118 00119 if(!customCap) 00120 return InvalidParameter; 00121 00122 GdipFree(customCap->pathdata.Points); 00123 GdipFree(customCap->pathdata.Types); 00124 GdipFree(customCap); 00125 00126 return Ok; 00127 } 00128 00129 GpStatus WINGDIPAPI GdipGetCustomLineCapStrokeJoin(GpCustomLineCap* customCap, 00130 GpLineJoin* lineJoin) 00131 { 00132 TRACE("(%p, %p)\n", customCap, lineJoin); 00133 00134 if(!customCap || !lineJoin) 00135 return InvalidParameter; 00136 00137 *lineJoin = customCap->join; 00138 00139 return Ok; 00140 } 00141 00142 GpStatus WINGDIPAPI GdipGetCustomLineCapWidthScale(GpCustomLineCap* custom, 00143 REAL* widthScale) 00144 { 00145 TRACE("(%p, %p)\n", custom, widthScale); 00146 00147 if(!custom || !widthScale) 00148 return InvalidParameter; 00149 00150 *widthScale = custom->scale; 00151 00152 return Ok; 00153 } 00154 00155 GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeCaps(GpCustomLineCap* custom, 00156 GpLineCap start, GpLineCap end) 00157 { 00158 static int calls; 00159 00160 TRACE("(%p,%u,%u)\n", custom, start, end); 00161 00162 if(!custom) 00163 return InvalidParameter; 00164 00165 if(!(calls++)) 00166 FIXME("not implemented\n"); 00167 00168 return NotImplemented; 00169 } 00170 00171 GpStatus WINGDIPAPI GdipSetCustomLineCapBaseCap(GpCustomLineCap* custom, 00172 GpLineCap base) 00173 { 00174 static int calls; 00175 00176 TRACE("(%p,%u)\n", custom, base); 00177 00178 if(!(calls++)) 00179 FIXME("not implemented\n"); 00180 00181 return NotImplemented; 00182 } 00183 00184 GpStatus WINGDIPAPI GdipGetCustomLineCapBaseInset(GpCustomLineCap* custom, 00185 REAL* inset) 00186 { 00187 TRACE("(%p, %p)\n", custom, inset); 00188 00189 if(!custom || !inset) 00190 return InvalidParameter; 00191 00192 *inset = custom->inset; 00193 00194 return Ok; 00195 } 00196 00197 GpStatus WINGDIPAPI GdipSetCustomLineCapBaseInset(GpCustomLineCap* custom, 00198 REAL inset) 00199 { 00200 static int calls; 00201 00202 TRACE("(%p,%0.2f)\n", custom, inset); 00203 00204 if(!(calls++)) 00205 FIXME("not implemented\n"); 00206 00207 return NotImplemented; 00208 } 00209 00210 /*FIXME: LineJoin completely ignored now */ 00211 GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeJoin(GpCustomLineCap* custom, 00212 GpLineJoin join) 00213 { 00214 TRACE("(%p, %d)\n", custom, join); 00215 00216 if(!custom) 00217 return InvalidParameter; 00218 00219 custom->join = join; 00220 00221 return Ok; 00222 } 00223 00224 GpStatus WINGDIPAPI GdipSetCustomLineCapWidthScale(GpCustomLineCap* custom, 00225 REAL width) 00226 { 00227 static int calls; 00228 00229 TRACE("(%p,%0.2f)\n", custom, width); 00230 00231 if(!(calls++)) 00232 FIXME("not implemented\n"); 00233 00234 return NotImplemented; 00235 } 00236 00237 GpStatus WINGDIPAPI GdipGetCustomLineCapBaseCap(GpCustomLineCap *customCap, GpLineCap *baseCap) 00238 { 00239 TRACE("(%p, %p)\n", customCap, baseCap); 00240 00241 if(!customCap || !baseCap) 00242 return InvalidParameter; 00243 00244 *baseCap = customCap->cap; 00245 00246 return Ok; 00247 } 00248 00249 GpStatus WINGDIPAPI GdipCreateAdjustableArrowCap(REAL height, REAL width, BOOL fill, 00250 GpAdjustableArrowCap **cap) 00251 { 00252 static int calls; 00253 00254 TRACE("(%0.2f,%0.2f,%i,%p)\n", height, width, fill, cap); 00255 00256 if(!(calls++)) 00257 FIXME("not implemented\n"); 00258 00259 return NotImplemented; 00260 } 00261 00262 GpStatus WINGDIPAPI GdipGetAdjustableArrowCapFillState(GpAdjustableArrowCap* cap, BOOL* fill) 00263 { 00264 static int calls; 00265 00266 TRACE("(%p,%p)\n", cap, fill); 00267 00268 if(!(calls++)) 00269 FIXME("not implemented\n"); 00270 00271 return NotImplemented; 00272 } 00273 00274 GpStatus WINGDIPAPI GdipGetAdjustableArrowCapHeight(GpAdjustableArrowCap* cap, REAL* height) 00275 { 00276 static int calls; 00277 00278 TRACE("(%p,%p)\n", cap, height); 00279 00280 if(!(calls++)) 00281 FIXME("not implemented\n"); 00282 00283 return NotImplemented; 00284 } 00285 00286 GpStatus WINGDIPAPI GdipGetAdjustableArrowCapMiddleInset(GpAdjustableArrowCap* cap, REAL* middle) 00287 { 00288 static int calls; 00289 00290 TRACE("(%p,%p)\n", cap, middle); 00291 00292 if(!(calls++)) 00293 FIXME("not implemented\n"); 00294 00295 return NotImplemented; 00296 } 00297 00298 GpStatus WINGDIPAPI GdipGetAdjustableArrowCapWidth(GpAdjustableArrowCap* cap, REAL* width) 00299 { 00300 static int calls; 00301 00302 TRACE("(%p,%p)\n", cap, width); 00303 00304 if(!(calls++)) 00305 FIXME("not implemented\n"); 00306 00307 return NotImplemented; 00308 } 00309 00310 GpStatus WINGDIPAPI GdipSetAdjustableArrowCapFillState(GpAdjustableArrowCap* cap, BOOL fill) 00311 { 00312 static int calls; 00313 00314 TRACE("(%p,%i)\n", cap, fill); 00315 00316 if(!(calls++)) 00317 FIXME("not implemented\n"); 00318 00319 return NotImplemented; 00320 } 00321 00322 GpStatus WINGDIPAPI GdipSetAdjustableArrowCapHeight(GpAdjustableArrowCap* cap, REAL height) 00323 { 00324 static int calls; 00325 00326 TRACE("(%p,%0.2f)\n", cap, height); 00327 00328 if(!(calls++)) 00329 FIXME("not implemented\n"); 00330 00331 return NotImplemented; 00332 } 00333 00334 GpStatus WINGDIPAPI GdipSetAdjustableArrowCapMiddleInset(GpAdjustableArrowCap* cap, REAL middle) 00335 { 00336 static int calls; 00337 00338 TRACE("(%p,%0.2f)\n", cap, middle); 00339 00340 if(!(calls++)) 00341 FIXME("not implemented\n"); 00342 00343 return NotImplemented; 00344 } 00345 00346 GpStatus WINGDIPAPI GdipSetAdjustableArrowCapWidth(GpAdjustableArrowCap* cap, REAL width) 00347 { 00348 static int calls; 00349 00350 TRACE("(%p,%0.2f)\n", cap, width); 00351 00352 if(!(calls++)) 00353 FIXME("not implemented\n"); 00354 00355 return NotImplemented; 00356 } Generated on Mon May 28 2012 04:23:14 for ReactOS by
1.7.6.1
|