ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

pen.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 static DWORD gdip_to_gdi_dash(GpDashStyle dash)
00034 {
00035     switch(dash){
00036         case DashStyleSolid:
00037             return PS_SOLID;
00038         case DashStyleDash:
00039             return PS_DASH;
00040         case DashStyleDot:
00041             return PS_DOT;
00042         case DashStyleDashDot:
00043             return PS_DASHDOT;
00044         case DashStyleDashDotDot:
00045             return PS_DASHDOTDOT;
00046         case DashStyleCustom:
00047             return PS_USERSTYLE;
00048         default:
00049             ERR("Not a member of GpDashStyle enumeration\n");
00050             return 0;
00051     }
00052 }
00053 
00054 static DWORD gdip_to_gdi_join(GpLineJoin join)
00055 {
00056     switch(join){
00057         case LineJoinRound:
00058             return PS_JOIN_ROUND;
00059         case LineJoinBevel:
00060             return PS_JOIN_BEVEL;
00061         case LineJoinMiter:
00062         case LineJoinMiterClipped:
00063             return PS_JOIN_MITER;
00064         default:
00065             ERR("Not a member of GpLineJoin enumeration\n");
00066             return 0;
00067     }
00068 }
00069 
00070 static GpPenType bt_to_pt(GpBrushType bt)
00071 {
00072     switch(bt){
00073         case BrushTypeSolidColor:
00074             return PenTypeSolidColor;
00075         case BrushTypeHatchFill:
00076             return PenTypeHatchFill;
00077         case BrushTypeTextureFill:
00078             return PenTypeTextureFill;
00079         case BrushTypePathGradient:
00080             return PenTypePathGradient;
00081         case BrushTypeLinearGradient:
00082             return PenTypeLinearGradient;
00083         default:
00084             return PenTypeUnknown;
00085     }
00086 }
00087 
00088 GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen)
00089 {
00090     TRACE("(%p, %p)\n", pen, clonepen);
00091 
00092     if(!pen || !clonepen)
00093         return InvalidParameter;
00094 
00095     *clonepen = GdipAlloc(sizeof(GpPen));
00096     if(!*clonepen)  return OutOfMemory;
00097 
00098     **clonepen = *pen;
00099 
00100     GdipCloneCustomLineCap(pen->customstart, &(*clonepen)->customstart);
00101     GdipCloneCustomLineCap(pen->customend, &(*clonepen)->customend);
00102     GdipCloneBrush(pen->brush, &(*clonepen)->brush);
00103 
00104     TRACE("<-- %p\n", *clonepen);
00105 
00106     return Ok;
00107 }
00108 
00109 GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit,
00110     GpPen **pen)
00111 {
00112     GpBrush *brush;
00113     GpStatus status;
00114 
00115     TRACE("(%x, %.2f, %d, %p)\n", color, width, unit, pen);
00116 
00117     GdipCreateSolidFill(color, (GpSolidFill **)(&brush));
00118     status = GdipCreatePen2(brush, width, unit, pen);
00119     GdipDeleteBrush(brush);
00120     return status;
00121 }
00122 
00123 GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit,
00124     GpPen **pen)
00125 {
00126     GpPen *gp_pen;
00127     GpBrush *clone_brush;
00128 
00129     TRACE("(%p, %.2f, %d, %p)\n", brush, width, unit, pen);
00130 
00131     if(!pen || !brush)
00132         return InvalidParameter;
00133 
00134     gp_pen = GdipAlloc(sizeof(GpPen));
00135     if(!gp_pen)    return OutOfMemory;
00136 
00137     gp_pen->style = GP_DEFAULT_PENSTYLE;
00138     gp_pen->width = width;
00139     gp_pen->unit = unit;
00140     gp_pen->endcap = LineCapFlat;
00141     gp_pen->join = LineJoinMiter;
00142     gp_pen->miterlimit = 10.0;
00143     gp_pen->dash = DashStyleSolid;
00144     gp_pen->offset = 0.0;
00145     gp_pen->customstart = NULL;
00146     gp_pen->customend = NULL;
00147 
00148     if(!((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel))) {
00149         FIXME("UnitWorld, UnitPixel only supported units\n");
00150         GdipFree(gp_pen);
00151         return NotImplemented;
00152     }
00153 
00154     GdipCloneBrush(brush, &clone_brush);
00155     gp_pen->brush = clone_brush;
00156 
00157     *pen = gp_pen;
00158 
00159     TRACE("<-- %p\n", *pen);
00160 
00161     return Ok;
00162 }
00163 
00164 GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen)
00165 {
00166     TRACE("(%p)\n", pen);
00167 
00168     if(!pen)    return InvalidParameter;
00169 
00170     GdipDeleteBrush(pen->brush);
00171     GdipDeleteCustomLineCap(pen->customstart);
00172     GdipDeleteCustomLineCap(pen->customend);
00173     GdipFree(pen->dashes);
00174     GdipFree(pen);
00175 
00176     return Ok;
00177 }
00178 
00179 GpStatus WINGDIPAPI GdipGetPenBrushFill(GpPen *pen, GpBrush **brush)
00180 {
00181     TRACE("(%p, %p)\n", pen, brush);
00182 
00183     if(!pen || !brush)
00184         return InvalidParameter;
00185 
00186     return GdipCloneBrush(pen->brush, brush);
00187 }
00188 
00189 GpStatus WINGDIPAPI GdipGetPenColor(GpPen *pen, ARGB *argb)
00190 {
00191     TRACE("(%p, %p)\n", pen, argb);
00192 
00193     if(!pen || !argb)
00194         return InvalidParameter;
00195 
00196     if(pen->brush->bt != BrushTypeSolidColor)
00197         return NotImplemented;
00198 
00199     return GdipGetSolidFillColor(((GpSolidFill*)pen->brush), argb);
00200 }
00201 
00202 GpStatus WINGDIPAPI GdipGetPenCustomEndCap(GpPen *pen, GpCustomLineCap** customCap)
00203 {
00204     TRACE("(%p, %p)\n", pen, customCap);
00205 
00206     if(!pen || !customCap)
00207         return InvalidParameter;
00208 
00209     if(!pen->customend){
00210         *customCap = NULL;
00211         return Ok;
00212     }
00213 
00214     return GdipCloneCustomLineCap(pen->customend, customCap);
00215 }
00216 
00217 GpStatus WINGDIPAPI GdipGetPenCustomStartCap(GpPen *pen, GpCustomLineCap** customCap)
00218 {
00219     TRACE("(%p, %p)\n", pen, customCap);
00220 
00221     if(!pen || !customCap)
00222         return InvalidParameter;
00223 
00224     if(!pen->customstart){
00225         *customCap = NULL;
00226         return Ok;
00227     }
00228 
00229     return GdipCloneCustomLineCap(pen->customstart, customCap);
00230 }
00231 
00232 GpStatus WINGDIPAPI GdipGetPenDashArray(GpPen *pen, REAL *dash, INT count)
00233 {
00234     TRACE("(%p, %p, %d)\n", pen, dash, count);
00235 
00236     if(!pen || !dash || count > pen->numdashes)
00237         return InvalidParameter;
00238 
00239     /* note: if you pass a negative value for count, it crashes native gdiplus. */
00240     if(count < 0)
00241         return GenericError;
00242 
00243     memcpy(dash, pen->dashes, count * sizeof(REAL));
00244 
00245     return Ok;
00246 }
00247 
00248 GpStatus WINGDIPAPI GdipGetPenDashCap197819(GpPen *pen, GpDashCap *dashCap)
00249 {
00250     TRACE("(%p, %p)\n", pen, dashCap);
00251 
00252     if(!pen || !dashCap)
00253         return InvalidParameter;
00254 
00255     *dashCap = pen->dashcap;
00256 
00257     return Ok;
00258 }
00259 
00260 GpStatus WINGDIPAPI GdipGetPenDashCount(GpPen *pen, INT *count)
00261 {
00262     TRACE("(%p, %p)\n", pen, count);
00263 
00264     if(!pen || !count)
00265         return InvalidParameter;
00266 
00267     *count = pen->numdashes;
00268 
00269     return Ok;
00270 }
00271 
00272 GpStatus WINGDIPAPI GdipGetPenDashOffset(GpPen *pen, REAL *offset)
00273 {
00274     TRACE("(%p, %p)\n", pen, offset);
00275 
00276     if(!pen || !offset)
00277         return InvalidParameter;
00278 
00279     *offset = pen->offset;
00280 
00281     return Ok;
00282 }
00283 
00284 GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen *pen, GpDashStyle *dash)
00285 {
00286     TRACE("(%p, %p)\n", pen, dash);
00287 
00288     if(!pen || !dash)
00289         return InvalidParameter;
00290 
00291     *dash = pen->dash;
00292 
00293     return Ok;
00294 }
00295 
00296 GpStatus WINGDIPAPI GdipGetPenEndCap(GpPen *pen, GpLineCap *endCap)
00297 {
00298     TRACE("(%p, %p)\n", pen, endCap);
00299 
00300     if(!pen || !endCap)
00301         return InvalidParameter;
00302 
00303     *endCap = pen->endcap;
00304 
00305     return Ok;
00306 }
00307 
00308 GpStatus WINGDIPAPI GdipGetPenFillType(GpPen *pen, GpPenType* type)
00309 {
00310     TRACE("(%p, %p)\n", pen, type);
00311 
00312     if(!pen || !type)
00313         return InvalidParameter;
00314 
00315     *type = bt_to_pt(pen->brush->bt);
00316 
00317     return Ok;
00318 }
00319 
00320 GpStatus WINGDIPAPI GdipGetPenLineJoin(GpPen *pen, GpLineJoin *lineJoin)
00321 {
00322     TRACE("(%p, %p)\n", pen, lineJoin);
00323 
00324     if(!pen || !lineJoin)
00325         return InvalidParameter;
00326 
00327     *lineJoin = pen->join;
00328 
00329     return Ok;
00330 }
00331 
00332 GpStatus WINGDIPAPI GdipGetPenMode(GpPen *pen, GpPenAlignment *mode)
00333 {
00334     TRACE("(%p, %p)\n", pen, mode);
00335 
00336     if(!pen || !mode)
00337         return InvalidParameter;
00338 
00339     *mode = pen->align;
00340 
00341     return Ok;
00342 }
00343 
00344 GpStatus WINGDIPAPI GdipGetPenMiterLimit(GpPen *pen, REAL *miterLimit)
00345 {
00346     TRACE("(%p, %p)\n", pen, miterLimit);
00347 
00348     if(!pen || !miterLimit)
00349         return InvalidParameter;
00350 
00351     *miterLimit = pen->miterlimit;
00352 
00353     return Ok;
00354 }
00355 
00356 GpStatus WINGDIPAPI GdipGetPenStartCap(GpPen *pen, GpLineCap *startCap)
00357 {
00358     TRACE("(%p, %p)\n", pen, startCap);
00359 
00360     if(!pen || !startCap)
00361         return InvalidParameter;
00362 
00363     *startCap = pen->startcap;
00364 
00365     return Ok;
00366 }
00367 
00368 GpStatus WINGDIPAPI GdipGetPenUnit(GpPen *pen, GpUnit *unit)
00369 {
00370     TRACE("(%p, %p)\n", pen, unit);
00371 
00372     if(!pen || !unit)
00373         return InvalidParameter;
00374 
00375     *unit = pen->unit;
00376 
00377     return Ok;
00378 }
00379 
00380 GpStatus WINGDIPAPI GdipGetPenWidth(GpPen *pen, REAL *width)
00381 {
00382     TRACE("(%p, %p)\n", pen, width);
00383 
00384     if(!pen || !width)
00385         return InvalidParameter;
00386 
00387     *width = pen->width;
00388 
00389     return Ok;
00390 }
00391 
00392 GpStatus WINGDIPAPI GdipResetPenTransform(GpPen *pen)
00393 {
00394     static int calls;
00395 
00396     TRACE("(%p)\n", pen);
00397 
00398     if(!pen)
00399         return InvalidParameter;
00400 
00401     if(!(calls++))
00402         FIXME("(%p) stub\n", pen);
00403 
00404     return NotImplemented;
00405 }
00406 
00407 GpStatus WINGDIPAPI GdipSetPenTransform(GpPen *pen, GpMatrix *matrix)
00408 {
00409     static int calls;
00410 
00411     TRACE("(%p,%p)\n", pen, matrix);
00412 
00413     if(!pen || !matrix)
00414         return InvalidParameter;
00415 
00416     if(!(calls++))
00417         FIXME("not implemented\n");
00418 
00419     return NotImplemented;
00420 }
00421 
00422 GpStatus WINGDIPAPI GdipGetPenTransform(GpPen *pen, GpMatrix *matrix)
00423 {
00424     static int calls;
00425 
00426     TRACE("(%p,%p)\n", pen, matrix);
00427 
00428     if(!pen || !matrix)
00429         return InvalidParameter;
00430 
00431     if(!(calls++))
00432         FIXME("not implemented\n");
00433 
00434     return NotImplemented;
00435 }
00436 
00437 GpStatus WINGDIPAPI GdipTranslatePenTransform(GpPen *pen, REAL dx, REAL dy, GpMatrixOrder order)
00438 {
00439     static int calls;
00440 
00441     TRACE("(%p,%0.2f,%0.2f,%u)\n", pen, dx, dy, order);
00442 
00443     if(!pen)
00444         return InvalidParameter;
00445 
00446     if(!(calls++))
00447         FIXME("not implemented\n");
00448 
00449     return NotImplemented;
00450 }
00451 
00452 GpStatus WINGDIPAPI GdipScalePenTransform(GpPen *pen, REAL sx, REAL sy, GpMatrixOrder order)
00453 {
00454     static int calls;
00455 
00456     TRACE("(%p,%0.2f,%0.2f,%u)\n", pen, sx, sy, order);
00457 
00458     if(!pen)
00459         return InvalidParameter;
00460 
00461     if(!(calls++))
00462         FIXME("(%p, %.2f, %.2f, %d) stub\n", pen, sx, sy, order);
00463 
00464     return NotImplemented;
00465 }
00466 
00467 GpStatus WINGDIPAPI GdipRotatePenTransform(GpPen *pen, REAL angle, GpMatrixOrder order)
00468 {
00469     static int calls;
00470 
00471     TRACE("(%p,%0.2f,%u)\n", pen, angle, order);
00472 
00473     if(!pen)
00474         return InvalidParameter;
00475 
00476     if(!(calls++))
00477         FIXME("not implemented\n");
00478 
00479     return NotImplemented;
00480 }
00481 
00482 GpStatus WINGDIPAPI GdipMultiplyPenTransform(GpPen *pen, GDIPCONST GpMatrix *matrix,
00483     GpMatrixOrder order)
00484 {
00485     static int calls;
00486 
00487     TRACE("(%p,%p,%u)\n", pen, matrix, order);
00488 
00489     if(!pen)
00490         return InvalidParameter;
00491 
00492     if(!(calls++))
00493         FIXME("not implemented\n");
00494 
00495     return NotImplemented;
00496 }
00497 
00498 GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen *pen, GpBrush *brush)
00499 {
00500     TRACE("(%p, %p)\n", pen, brush);
00501 
00502     if(!pen || !brush)
00503         return InvalidParameter;
00504 
00505     GdipDeleteBrush(pen->brush);
00506     return GdipCloneBrush(brush, &pen->brush);
00507 }
00508 
00509 GpStatus WINGDIPAPI GdipSetPenColor(GpPen *pen, ARGB argb)
00510 {
00511     TRACE("(%p, %x)\n", pen, argb);
00512 
00513     if(!pen)
00514         return InvalidParameter;
00515 
00516     if(pen->brush->bt != BrushTypeSolidColor)
00517         return NotImplemented;
00518 
00519     return GdipSetSolidFillColor(((GpSolidFill*)pen->brush), argb);
00520 }
00521 
00522 GpStatus WINGDIPAPI GdipGetPenCompoundCount(GpPen *pen, INT *count)
00523 {
00524     FIXME("(%p, %p): stub\n", pen, count);
00525 
00526     if (!pen || !count)
00527         return InvalidParameter;
00528 
00529     return NotImplemented;
00530 }
00531 
00532 GpStatus WINGDIPAPI GdipSetPenCompoundArray(GpPen *pen, GDIPCONST REAL *dash,
00533     INT count)
00534 {
00535     FIXME("(%p, %p, %i): stub\n", pen, dash, count);
00536 
00537     if (!pen || !dash || count < 2 || count%2 == 1)
00538         return InvalidParameter;
00539 
00540     return NotImplemented;
00541 }
00542 
00543 GpStatus WINGDIPAPI GdipSetPenCustomEndCap(GpPen *pen, GpCustomLineCap* customCap)
00544 {
00545     GpCustomLineCap * cap;
00546     GpStatus ret;
00547 
00548     TRACE("(%p, %p)\n", pen, customCap);
00549 
00550     /* native crashes on pen == NULL, customCap != NULL */
00551     if(!customCap) return InvalidParameter;
00552 
00553     if((ret = GdipCloneCustomLineCap(customCap, &cap)) == Ok){
00554         GdipDeleteCustomLineCap(pen->customend);
00555         pen->endcap = LineCapCustom;
00556         pen->customend = cap;
00557     }
00558 
00559     return ret;
00560 }
00561 
00562 GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen *pen, GpCustomLineCap* customCap)
00563 {
00564     GpCustomLineCap * cap;
00565     GpStatus ret;
00566 
00567     TRACE("(%p, %p)\n", pen, customCap);
00568 
00569     /* native crashes on pen == NULL, customCap != NULL */
00570     if(!customCap) return InvalidParameter;
00571 
00572     if((ret = GdipCloneCustomLineCap(customCap, &cap)) == Ok){
00573         GdipDeleteCustomLineCap(pen->customstart);
00574         pen->startcap = LineCapCustom;
00575         pen->customstart = cap;
00576     }
00577 
00578     return ret;
00579 }
00580 
00581 GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen *pen, GDIPCONST REAL *dash,
00582     INT count)
00583 {
00584     INT i;
00585     REAL sum = 0;
00586 
00587     TRACE("(%p, %p, %d)\n", pen, dash, count);
00588 
00589     if(!pen || !dash)
00590         return InvalidParameter;
00591 
00592     if(count <= 0)
00593         return OutOfMemory;
00594 
00595     for(i = 0; i < count; i++){
00596         sum += dash[i];
00597         if(dash[i] < 0.0)
00598             return InvalidParameter;
00599     }
00600 
00601     if(sum == 0.0 && count)
00602         return InvalidParameter;
00603 
00604     GdipFree(pen->dashes);
00605     pen->dashes = NULL;
00606 
00607     if(count > 0)
00608         pen->dashes = GdipAlloc(count * sizeof(REAL));
00609     if(!pen->dashes){
00610         pen->numdashes = 0;
00611         return OutOfMemory;
00612     }
00613 
00614     GdipSetPenDashStyle(pen, DashStyleCustom);
00615     memcpy(pen->dashes, dash, count * sizeof(REAL));
00616     pen->numdashes = count;
00617 
00618     return Ok;
00619 }
00620 
00621 GpStatus WINGDIPAPI GdipSetPenDashCap197819(GpPen *pen, GpDashCap dashCap)
00622 {
00623     TRACE("(%p, %d)\n", pen, dashCap);
00624 
00625     if(!pen)
00626         return InvalidParameter;
00627 
00628     pen->dashcap = dashCap;
00629 
00630     return Ok;
00631 }
00632 
00633 /* FIXME: dash offset not used */
00634 GpStatus WINGDIPAPI GdipSetPenDashOffset(GpPen *pen, REAL offset)
00635 {
00636     TRACE("(%p, %.2f)\n", pen, offset);
00637 
00638     if(!pen)
00639         return InvalidParameter;
00640 
00641     pen->offset = offset;
00642 
00643     return Ok;
00644 }
00645 
00646 GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash)
00647 {
00648     TRACE("(%p, %d)\n", pen, dash);
00649 
00650     if(!pen)
00651         return InvalidParameter;
00652 
00653     if(dash != DashStyleCustom){
00654         GdipFree(pen->dashes);
00655         pen->dashes = NULL;
00656         pen->numdashes = 0;
00657     }
00658 
00659     pen->dash = dash;
00660     pen->style &= ~(PS_ALTERNATE | PS_SOLID | PS_DASH | PS_DOT | PS_DASHDOT |
00661                     PS_DASHDOTDOT | PS_NULL | PS_USERSTYLE | PS_INSIDEFRAME);
00662     pen->style |= gdip_to_gdi_dash(dash);
00663 
00664     return Ok;
00665 }
00666 
00667 GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen *pen, GpLineCap cap)
00668 {
00669     TRACE("(%p, %d)\n", pen, cap);
00670 
00671     if(!pen)    return InvalidParameter;
00672 
00673     /* The old custom cap gets deleted even if the new style is LineCapCustom. */
00674     GdipDeleteCustomLineCap(pen->customend);
00675     pen->customend = NULL;
00676     pen->endcap = cap;
00677 
00678     return Ok;
00679 }
00680 
00681 /* FIXME: startcap, dashcap not used. */
00682 GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen *pen, GpLineCap start,
00683     GpLineCap end, GpDashCap dash)
00684 {
00685     TRACE("%p, %d, %d, %d)\n", pen, start, end, dash);
00686 
00687     if(!pen)
00688         return InvalidParameter;
00689 
00690     GdipDeleteCustomLineCap(pen->customend);
00691     GdipDeleteCustomLineCap(pen->customstart);
00692     pen->customend = NULL;
00693     pen->customstart = NULL;
00694 
00695     pen->startcap = start;
00696     pen->endcap = end;
00697     pen->dashcap = dash;
00698 
00699     return Ok;
00700 }
00701 
00702 /* FIXME: Miter line joins behave a bit differently than they do in windows.
00703  * Both kinds of miter joins clip if the angle is less than 11 degrees. */
00704 GpStatus WINGDIPAPI GdipSetPenLineJoin(GpPen *pen, GpLineJoin join)
00705 {
00706     TRACE("(%p, %d)\n", pen, join);
00707 
00708     if(!pen)    return InvalidParameter;
00709 
00710     pen->join = join;
00711     pen->style &= ~(PS_JOIN_ROUND | PS_JOIN_BEVEL | PS_JOIN_MITER);
00712     pen->style |= gdip_to_gdi_join(join);
00713 
00714     return Ok;
00715 }
00716 
00717 GpStatus WINGDIPAPI GdipSetPenMiterLimit(GpPen *pen, REAL limit)
00718 {
00719     TRACE("(%p, %.2f)\n", pen, limit);
00720 
00721     if(!pen)
00722         return InvalidParameter;
00723 
00724     pen->miterlimit = limit;
00725 
00726     return Ok;
00727 }
00728 
00729 GpStatus WINGDIPAPI GdipSetPenStartCap(GpPen *pen, GpLineCap cap)
00730 {
00731     TRACE("(%p, %d)\n", pen, cap);
00732 
00733     if(!pen)    return InvalidParameter;
00734 
00735     GdipDeleteCustomLineCap(pen->customstart);
00736     pen->customstart = NULL;
00737     pen->startcap = cap;
00738 
00739     return Ok;
00740 }
00741 
00742 GpStatus WINGDIPAPI GdipSetPenWidth(GpPen *pen, REAL width)
00743 {
00744     TRACE("(%p, %.2f)\n", pen, width);
00745 
00746     if(!pen)    return InvalidParameter;
00747 
00748     pen->width = width;
00749 
00750     return Ok;
00751 }
00752 
00753 GpStatus WINGDIPAPI GdipSetPenMode(GpPen *pen, GpPenAlignment mode)
00754 {
00755     TRACE("(%p, %d)\n", pen, mode);
00756 
00757     if(!pen)    return InvalidParameter;
00758 
00759     pen->align = mode;
00760 
00761     return Ok;
00762 }

Generated on Thu May 24 2012 04:24:00 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.