pen.c 17 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*
 * Copyright (C) 2007 Google (Evan Stade)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

#include <stdarg.h>

#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
24 25 26

#include "objbase.h"

27 28 29 30 31 32
#include "gdiplus.h"
#include "gdiplus_private.h"
#include "wine/debug.h"

WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);

33 34 35 36 37 38 39 40 41 42 43 44 45 46
static DWORD gdip_to_gdi_dash(GpDashStyle dash)
{
    switch(dash){
        case DashStyleSolid:
            return PS_SOLID;
        case DashStyleDash:
            return PS_DASH;
        case DashStyleDot:
            return PS_DOT;
        case DashStyleDashDot:
            return PS_DASHDOT;
        case DashStyleDashDotDot:
            return PS_DASHDOTDOT;
        case DashStyleCustom:
47
            return PS_USERSTYLE;
48 49 50 51 52 53
        default:
            ERR("Not a member of GpDashStyle enumeration\n");
            return 0;
    }
}

54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
static DWORD gdip_to_gdi_join(GpLineJoin join)
{
    switch(join){
        case LineJoinRound:
            return PS_JOIN_ROUND;
        case LineJoinBevel:
            return PS_JOIN_BEVEL;
        case LineJoinMiter:
        case LineJoinMiterClipped:
            return PS_JOIN_MITER;
        default:
            ERR("Not a member of GpLineJoin enumeration\n");
            return 0;
    }
}

70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
static GpPenType bt_to_pt(GpBrushType bt)
{
    switch(bt){
        case BrushTypeSolidColor:
            return PenTypeSolidColor;
        case BrushTypeHatchFill:
            return PenTypeHatchFill;
        case BrushTypeTextureFill:
            return PenTypeTextureFill;
        case BrushTypePathGradient:
            return PenTypePathGradient;
        case BrushTypeLinearGradient:
            return PenTypeLinearGradient;
        default:
            return PenTypeUnknown;
    }
}

88 89
GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen)
{
90 91
    GpStatus stat;

92 93
    TRACE("(%p, %p)\n", pen, clonepen);

94 95 96
    if(!pen || !clonepen)
        return InvalidParameter;

97
    *clonepen = heap_alloc_zero(sizeof(GpPen));
98 99
    if(!*clonepen)  return OutOfMemory;

100
    **clonepen = *pen;
101

102 103 104
    (*clonepen)->customstart = NULL;
    (*clonepen)->customend = NULL;
    (*clonepen)->brush = NULL;
105
    (*clonepen)->dashes = NULL;
106 107 108 109 110 111 112 113 114

    stat = GdipCloneBrush(pen->brush, &(*clonepen)->brush);

    if (stat == Ok && pen->customstart)
        stat = GdipCloneCustomLineCap(pen->customstart, &(*clonepen)->customstart);

    if (stat == Ok && pen->customend)
        stat = GdipCloneCustomLineCap(pen->customend, &(*clonepen)->customend);

115 116
    if (stat == Ok && pen->dashes)
    {
117
        (*clonepen)->dashes = heap_alloc_zero(pen->numdashes * sizeof(REAL));
118 119 120 121 122 123
        if ((*clonepen)->dashes)
            memcpy((*clonepen)->dashes, pen->dashes, pen->numdashes * sizeof(REAL));
        else
            stat = OutOfMemory;
    }

124 125 126 127 128 129
    if (stat != Ok)
    {
        GdipDeletePen(*clonepen);
        *clonepen = NULL;
        return stat;
    }
130

131 132
    TRACE("<-- %p\n", *clonepen);

133 134 135
    return Ok;
}

136
GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit,
137
    GpPen **pen)
138 139
{
    GpBrush *brush;
140 141
    GpStatus status;

142 143
    TRACE("(%x, %.2f, %d, %p)\n", color, width, unit, pen);

144
    GdipCreateSolidFill(color, (GpSolidFill **)(&brush));
145 146 147
    status = GdipCreatePen2(brush, width, unit, pen);
    GdipDeleteBrush(brush);
    return status;
148 149 150 151
}

GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit,
    GpPen **pen)
152 153
{
    GpPen *gp_pen;
154
    GpBrush *clone_brush;
155

156
    TRACE("(%p, %.2f, %d, %p)\n", brush, width, unit, pen);
157

158
    if(!pen || !brush)
159 160
        return InvalidParameter;

161
    gp_pen = heap_alloc_zero(sizeof(GpPen));
162
    if(!gp_pen)    return OutOfMemory;
163 164 165 166

    gp_pen->style = GP_DEFAULT_PENSTYLE;
    gp_pen->width = width;
    gp_pen->unit = unit;
167
    gp_pen->endcap = LineCapFlat;
168 169
    gp_pen->join = LineJoinMiter;
    gp_pen->miterlimit = 10.0;
170
    gp_pen->dash = DashStyleSolid;
171
    gp_pen->offset = 0.0;
172 173
    gp_pen->customstart = NULL;
    gp_pen->customend = NULL;
174

175
    if(!((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel))) {
176
        FIXME("UnitWorld, UnitPixel only supported units\n");
177
        heap_free(gp_pen);
178 179 180
        return NotImplemented;
    }

181 182 183
    GdipCloneBrush(brush, &clone_brush);
    gp_pen->brush = clone_brush;

184 185
    *pen = gp_pen;

186 187
    TRACE("<-- %p\n", *pen);

188 189 190 191 192
    return Ok;
}

GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen)
{
193 194
    TRACE("(%p)\n", pen);

195
    if(!pen)    return InvalidParameter;
196

197
    GdipDeleteBrush(pen->brush);
198 199
    GdipDeleteCustomLineCap(pen->customstart);
    GdipDeleteCustomLineCap(pen->customend);
200 201
    heap_free(pen->dashes);
    heap_free(pen);
202 203 204

    return Ok;
}
205

206 207
GpStatus WINGDIPAPI GdipGetPenBrushFill(GpPen *pen, GpBrush **brush)
{
208 209
    TRACE("(%p, %p)\n", pen, brush);

210 211 212 213 214 215
    if(!pen || !brush)
        return InvalidParameter;

    return GdipCloneBrush(pen->brush, brush);
}

216 217
GpStatus WINGDIPAPI GdipGetPenColor(GpPen *pen, ARGB *argb)
{
218 219
    TRACE("(%p, %p)\n", pen, argb);

220 221 222
    if(!pen || !argb)
        return InvalidParameter;

223 224 225 226
    if(pen->brush->bt != BrushTypeSolidColor)
        return NotImplemented;

    return GdipGetSolidFillColor(((GpSolidFill*)pen->brush), argb);
227 228
}

229 230
GpStatus WINGDIPAPI GdipGetPenCustomEndCap(GpPen *pen, GpCustomLineCap** customCap)
{
231 232
    TRACE("(%p, %p)\n", pen, customCap);

233 234 235 236 237 238 239 240 241 242 243 244 245
    if(!pen || !customCap)
        return InvalidParameter;

    if(!pen->customend){
        *customCap = NULL;
        return Ok;
    }

    return GdipCloneCustomLineCap(pen->customend, customCap);
}

GpStatus WINGDIPAPI GdipGetPenCustomStartCap(GpPen *pen, GpCustomLineCap** customCap)
{
246 247
    TRACE("(%p, %p)\n", pen, customCap);

248 249 250 251 252 253 254 255 256 257 258
    if(!pen || !customCap)
        return InvalidParameter;

    if(!pen->customstart){
        *customCap = NULL;
        return Ok;
    }

    return GdipCloneCustomLineCap(pen->customstart, customCap);
}

259 260
GpStatus WINGDIPAPI GdipGetPenDashArray(GpPen *pen, REAL *dash, INT count)
{
261 262
    TRACE("(%p, %p, %d)\n", pen, dash, count);

263 264 265 266 267 268 269 270 271 272 273 274
    if(!pen || !dash || count > pen->numdashes)
        return InvalidParameter;

    /* note: if you pass a negative value for count, it crashes native gdiplus. */
    if(count < 0)
        return GenericError;

    memcpy(dash, pen->dashes, count * sizeof(REAL));

    return Ok;
}

275 276
GpStatus WINGDIPAPI GdipGetPenDashCap197819(GpPen *pen, GpDashCap *dashCap)
{
277 278
    TRACE("(%p, %p)\n", pen, dashCap);

279 280 281 282 283 284 285 286
    if(!pen || !dashCap)
        return InvalidParameter;

    *dashCap = pen->dashcap;

    return Ok;
}

287 288
GpStatus WINGDIPAPI GdipGetPenDashCount(GpPen *pen, INT *count)
{
289 290
    TRACE("(%p, %p)\n", pen, count);

291 292 293 294 295 296 297 298
    if(!pen || !count)
        return InvalidParameter;

    *count = pen->numdashes;

    return Ok;
}

299 300
GpStatus WINGDIPAPI GdipGetPenDashOffset(GpPen *pen, REAL *offset)
{
301 302
    TRACE("(%p, %p)\n", pen, offset);

303 304 305 306 307 308 309 310
    if(!pen || !offset)
        return InvalidParameter;

    *offset = pen->offset;

    return Ok;
}

311 312
GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen *pen, GpDashStyle *dash)
{
313 314
    TRACE("(%p, %p)\n", pen, dash);

315 316 317 318 319 320 321 322
    if(!pen || !dash)
        return InvalidParameter;

    *dash = pen->dash;

    return Ok;
}

323 324
GpStatus WINGDIPAPI GdipGetPenEndCap(GpPen *pen, GpLineCap *endCap)
{
325 326
    TRACE("(%p, %p)\n", pen, endCap);

327 328 329 330 331 332 333 334
    if(!pen || !endCap)
        return InvalidParameter;

    *endCap = pen->endcap;

    return Ok;
}

335 336 337 338 339 340 341 342 343 344 345 346
GpStatus WINGDIPAPI GdipGetPenFillType(GpPen *pen, GpPenType* type)
{
    TRACE("(%p, %p)\n", pen, type);

    if(!pen || !type)
        return InvalidParameter;

    *type = bt_to_pt(pen->brush->bt);

    return Ok;
}

347 348
GpStatus WINGDIPAPI GdipGetPenLineJoin(GpPen *pen, GpLineJoin *lineJoin)
{
349 350
    TRACE("(%p, %p)\n", pen, lineJoin);

351 352 353 354 355 356 357 358
    if(!pen || !lineJoin)
        return InvalidParameter;

    *lineJoin = pen->join;

    return Ok;
}

359 360
GpStatus WINGDIPAPI GdipGetPenMode(GpPen *pen, GpPenAlignment *mode)
{
361 362
    TRACE("(%p, %p)\n", pen, mode);

363 364 365 366 367 368 369 370
    if(!pen || !mode)
        return InvalidParameter;

    *mode = pen->align;

    return Ok;
}

371 372
GpStatus WINGDIPAPI GdipGetPenMiterLimit(GpPen *pen, REAL *miterLimit)
{
373 374
    TRACE("(%p, %p)\n", pen, miterLimit);

375 376 377 378 379 380 381 382
    if(!pen || !miterLimit)
        return InvalidParameter;

    *miterLimit = pen->miterlimit;

    return Ok;
}

383 384
GpStatus WINGDIPAPI GdipGetPenStartCap(GpPen *pen, GpLineCap *startCap)
{
385 386
    TRACE("(%p, %p)\n", pen, startCap);

387 388 389 390 391 392 393 394
    if(!pen || !startCap)
        return InvalidParameter;

    *startCap = pen->startcap;

    return Ok;
}

395 396
GpStatus WINGDIPAPI GdipGetPenUnit(GpPen *pen, GpUnit *unit)
{
397 398
    TRACE("(%p, %p)\n", pen, unit);

399 400 401 402 403 404 405 406
    if(!pen || !unit)
        return InvalidParameter;

    *unit = pen->unit;

    return Ok;
}

407 408
GpStatus WINGDIPAPI GdipGetPenWidth(GpPen *pen, REAL *width)
{
409 410
    TRACE("(%p, %p)\n", pen, width);

411 412 413 414 415 416 417 418
    if(!pen || !width)
        return InvalidParameter;

    *width = pen->width;

    return Ok;
}

419 420 421 422
GpStatus WINGDIPAPI GdipResetPenTransform(GpPen *pen)
{
    static int calls;

423 424
    TRACE("(%p)\n", pen);

425 426 427 428 429 430 431 432 433
    if(!pen)
        return InvalidParameter;

    if(!(calls++))
        FIXME("(%p) stub\n", pen);

    return NotImplemented;
}

434 435 436 437 438 439 440 441 442 443 444 445 446 447 448
GpStatus WINGDIPAPI GdipSetPenTransform(GpPen *pen, GpMatrix *matrix)
{
    static int calls;

    TRACE("(%p,%p)\n", pen, matrix);

    if(!pen || !matrix)
        return InvalidParameter;

    if(!(calls++))
        FIXME("not implemented\n");

    return NotImplemented;
}

449 450 451 452 453 454 455 456 457 458 459 460 461 462 463
GpStatus WINGDIPAPI GdipGetPenTransform(GpPen *pen, GpMatrix *matrix)
{
    static int calls;

    TRACE("(%p,%p)\n", pen, matrix);

    if(!pen || !matrix)
        return InvalidParameter;

    if(!(calls++))
        FIXME("not implemented\n");

    return NotImplemented;
}

464 465 466 467 468 469 470 471 472 473 474 475 476 477 478
GpStatus WINGDIPAPI GdipTranslatePenTransform(GpPen *pen, REAL dx, REAL dy, GpMatrixOrder order)
{
    static int calls;

    TRACE("(%p,%0.2f,%0.2f,%u)\n", pen, dx, dy, order);

    if(!pen)
        return InvalidParameter;

    if(!(calls++))
        FIXME("not implemented\n");

    return NotImplemented;
}

479 480 481 482
GpStatus WINGDIPAPI GdipScalePenTransform(GpPen *pen, REAL sx, REAL sy, GpMatrixOrder order)
{
    static int calls;

483 484
    TRACE("(%p,%0.2f,%0.2f,%u)\n", pen, sx, sy, order);

485 486 487 488 489 490 491 492 493
    if(!pen)
        return InvalidParameter;

    if(!(calls++))
        FIXME("(%p, %.2f, %.2f, %d) stub\n", pen, sx, sy, order);

    return NotImplemented;
}

494 495 496 497 498 499 500 501 502 503 504 505 506 507 508
GpStatus WINGDIPAPI GdipRotatePenTransform(GpPen *pen, REAL angle, GpMatrixOrder order)
{
    static int calls;

    TRACE("(%p,%0.2f,%u)\n", pen, angle, order);

    if(!pen)
        return InvalidParameter;

    if(!(calls++))
        FIXME("not implemented\n");

    return NotImplemented;
}

509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524
GpStatus WINGDIPAPI GdipMultiplyPenTransform(GpPen *pen, GDIPCONST GpMatrix *matrix,
    GpMatrixOrder order)
{
    static int calls;

    TRACE("(%p,%p,%u)\n", pen, matrix, order);

    if(!pen)
        return InvalidParameter;

    if(!(calls++))
        FIXME("not implemented\n");

    return NotImplemented;
}

525 526
GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen *pen, GpBrush *brush)
{
527 528
    TRACE("(%p, %p)\n", pen, brush);

529 530 531 532
    if(!pen || !brush)
        return InvalidParameter;

    GdipDeleteBrush(pen->brush);
533
    return GdipCloneBrush(brush, &pen->brush);
534 535
}

536 537
GpStatus WINGDIPAPI GdipSetPenColor(GpPen *pen, ARGB argb)
{
538 539
    TRACE("(%p, %x)\n", pen, argb);

540 541 542 543 544 545 546 547 548
    if(!pen)
        return InvalidParameter;

    if(pen->brush->bt != BrushTypeSolidColor)
        return NotImplemented;

    return GdipSetSolidFillColor(((GpSolidFill*)pen->brush), argb);
}

549 550 551 552 553 554 555 556 557 558
GpStatus WINGDIPAPI GdipGetPenCompoundCount(GpPen *pen, INT *count)
{
    FIXME("(%p, %p): stub\n", pen, count);

    if (!pen || !count)
        return InvalidParameter;

    return NotImplemented;
}

559 560 561
GpStatus WINGDIPAPI GdipSetPenCompoundArray(GpPen *pen, GDIPCONST REAL *dash,
    INT count)
{
562
    FIXME("(%p, %p, %i): stub\n", pen, dash, count);
563 564 565 566 567 568 569

    if (!pen || !dash || count < 2 || count%2 == 1)
        return InvalidParameter;

    return NotImplemented;
}

570 571 572 573 574
GpStatus WINGDIPAPI GdipSetPenCustomEndCap(GpPen *pen, GpCustomLineCap* customCap)
{
    GpCustomLineCap * cap;
    GpStatus ret;

575 576
    TRACE("(%p, %p)\n", pen, customCap);

577 578
    /* native crashes on pen == NULL, customCap != NULL */
    if(!customCap) return InvalidParameter;
579 580 581 582 583 584 585 586 587 588 589 590 591 592 593

    if((ret = GdipCloneCustomLineCap(customCap, &cap)) == Ok){
        GdipDeleteCustomLineCap(pen->customend);
        pen->endcap = LineCapCustom;
        pen->customend = cap;
    }

    return ret;
}

GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen *pen, GpCustomLineCap* customCap)
{
    GpCustomLineCap * cap;
    GpStatus ret;

594 595
    TRACE("(%p, %p)\n", pen, customCap);

596 597
    /* native crashes on pen == NULL, customCap != NULL */
    if(!customCap) return InvalidParameter;
598 599 600 601 602 603 604 605 606 607

    if((ret = GdipCloneCustomLineCap(customCap, &cap)) == Ok){
        GdipDeleteCustomLineCap(pen->customstart);
        pen->startcap = LineCapCustom;
        pen->customstart = cap;
    }

    return ret;
}

608 609 610
GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen *pen, GDIPCONST REAL *dash,
    INT count)
{
611 612 613
    INT i;
    REAL sum = 0;

614 615
    TRACE("(%p, %p, %d)\n", pen, dash, count);

616 617 618
    if(!pen || !dash)
        return InvalidParameter;

619 620 621
    if(count <= 0)
        return OutOfMemory;

622 623 624 625 626 627 628 629 630
    for(i = 0; i < count; i++){
        sum += dash[i];
        if(dash[i] < 0.0)
            return InvalidParameter;
    }

    if(sum == 0.0 && count)
        return InvalidParameter;

631
    heap_free(pen->dashes);
632 633 634
    pen->dashes = NULL;

    if(count > 0)
635
        pen->dashes = heap_alloc_zero(count * sizeof(REAL));
636 637 638 639 640
    if(!pen->dashes){
        pen->numdashes = 0;
        return OutOfMemory;
    }

641
    GdipSetPenDashStyle(pen, DashStyleCustom);
642 643 644 645 646 647
    memcpy(pen->dashes, dash, count * sizeof(REAL));
    pen->numdashes = count;

    return Ok;
}

648 649
GpStatus WINGDIPAPI GdipSetPenDashCap197819(GpPen *pen, GpDashCap dashCap)
{
650 651
    TRACE("(%p, %d)\n", pen, dashCap);

652 653 654 655 656 657 658 659
    if(!pen)
        return InvalidParameter;

    pen->dashcap = dashCap;

    return Ok;
}

660 661 662
/* FIXME: dash offset not used */
GpStatus WINGDIPAPI GdipSetPenDashOffset(GpPen *pen, REAL offset)
{
663 664
    TRACE("(%p, %.2f)\n", pen, offset);

665 666 667 668 669 670 671 672
    if(!pen)
        return InvalidParameter;

    pen->offset = offset;

    return Ok;
}

673 674
GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash)
{
675 676
    TRACE("(%p, %d)\n", pen, dash);

677 678 679
    if(!pen)
        return InvalidParameter;

680
    if(dash != DashStyleCustom){
681
        heap_free(pen->dashes);
682 683 684 685
        pen->dashes = NULL;
        pen->numdashes = 0;
    }

686 687 688 689 690 691 692 693
    pen->dash = dash;
    pen->style &= ~(PS_ALTERNATE | PS_SOLID | PS_DASH | PS_DOT | PS_DASHDOT |
                    PS_DASHDOTDOT | PS_NULL | PS_USERSTYLE | PS_INSIDEFRAME);
    pen->style |= gdip_to_gdi_dash(dash);

    return Ok;
}

694 695
GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen *pen, GpLineCap cap)
{
696 697
    TRACE("(%p, %d)\n", pen, cap);

698 699
    if(!pen)    return InvalidParameter;

700 701 702
    /* The old custom cap gets deleted even if the new style is LineCapCustom. */
    GdipDeleteCustomLineCap(pen->customend);
    pen->customend = NULL;
703 704 705 706
    pen->endcap = cap;

    return Ok;
}
707

708 709 710 711
/* FIXME: startcap, dashcap not used. */
GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen *pen, GpLineCap start,
    GpLineCap end, GpDashCap dash)
{
712 713
    TRACE("%p, %d, %d, %d)\n", pen, start, end, dash);

714 715 716
    if(!pen)
        return InvalidParameter;

717 718 719 720 721
    GdipDeleteCustomLineCap(pen->customend);
    GdipDeleteCustomLineCap(pen->customstart);
    pen->customend = NULL;
    pen->customstart = NULL;

722 723 724 725 726 727 728
    pen->startcap = start;
    pen->endcap = end;
    pen->dashcap = dash;

    return Ok;
}

729 730 731 732
/* FIXME: Miter line joins behave a bit differently than they do in windows.
 * Both kinds of miter joins clip if the angle is less than 11 degrees. */
GpStatus WINGDIPAPI GdipSetPenLineJoin(GpPen *pen, GpLineJoin join)
{
733 734
    TRACE("(%p, %d)\n", pen, join);

735 736 737 738 739 740 741 742
    if(!pen)    return InvalidParameter;

    pen->join = join;
    pen->style &= ~(PS_JOIN_ROUND | PS_JOIN_BEVEL | PS_JOIN_MITER);
    pen->style |= gdip_to_gdi_join(join);

    return Ok;
}
743 744 745

GpStatus WINGDIPAPI GdipSetPenMiterLimit(GpPen *pen, REAL limit)
{
746 747
    TRACE("(%p, %.2f)\n", pen, limit);

748 749 750 751 752 753 754
    if(!pen)
        return InvalidParameter;

    pen->miterlimit = limit;

    return Ok;
}
755 756 757

GpStatus WINGDIPAPI GdipSetPenStartCap(GpPen *pen, GpLineCap cap)
{
758 759
    TRACE("(%p, %d)\n", pen, cap);

760 761 762 763 764 765 766 767
    if(!pen)    return InvalidParameter;

    GdipDeleteCustomLineCap(pen->customstart);
    pen->customstart = NULL;
    pen->startcap = cap;

    return Ok;
}
768 769 770

GpStatus WINGDIPAPI GdipSetPenWidth(GpPen *pen, REAL width)
{
771 772
    TRACE("(%p, %.2f)\n", pen, width);

773 774 775 776 777 778
    if(!pen)    return InvalidParameter;

    pen->width = width;

    return Ok;
}
779

780
GpStatus WINGDIPAPI GdipSetPenMode(GpPen *pen, GpPenAlignment mode)
781
{
782 783
    TRACE("(%p, %d)\n", pen, mode);

784 785
    if(!pen)    return InvalidParameter;

786
    pen->align = mode;
787 788 789

    return Ok;
}