[SDK][INCLUDE] Improve Gdiplus::Graphics (#2211)
[reactos.git] / sdk / include / psdk / gdiplusgraphics.h
1 /*
2 * GdiPlusGraphics.h
3 *
4 * Windows GDI+
5 *
6 * This file is part of the w32api package.
7 *
8 * THIS SOFTWARE IS NOT COPYRIGHTED
9 *
10 * This source code is offered for use in the public domain. You may
11 * use, modify or distribute it freely.
12 *
13 * This code is distributed in the hope that it will be useful but
14 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
15 * DISCLAIMED. This includes but is not limited to warranties of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 */
18
19 #ifndef _GDIPLUSGRAPHICS_H
20 #define _GDIPLUSGRAPHICS_H
21
22 class Image;
23 class ImageAttributes;
24 class CachedBitmap;
25 class Region;
26 class Font;
27 class GraphicsPath;
28 class Metafile;
29
30 // get native
31 GpImage *&
32 getNat(const Image *image);
33
34 GpPen *&
35 getNat(const Pen *pen);
36
37 GpBrush *&
38 getNat(const Brush *brush);
39
40 GpCachedBitmap *&
41 getNat(const CachedBitmap *cb);
42
43 GpImageAttributes *&
44 getNat(const ImageAttributes *ia);
45
46 GpRegion *&
47 getNat(const Region *region);
48
49 GpMatrix *&
50 getNat(const Matrix *matrix);
51
52 GpPath *&
53 getNat(const GraphicsPath *path);
54
55 class Graphics : public GdiplusBase
56 {
57 friend class Region;
58 friend class Font;
59 friend class Bitmap;
60 friend class CachedBitmap;
61
62 public:
63 Graphics(Image *image)
64 {
65 GpGraphics *graphics = NULL;
66 if (image)
67 {
68 lastStatus = DllExports::GdipGetImageGraphicsContext(getNat(image), &graphics);
69 }
70 SetNativeGraphics(graphics);
71 }
72
73 Graphics(HDC hdc)
74 {
75 GpGraphics *graphics = NULL;
76 lastStatus = DllExports::GdipCreateFromHDC(hdc, &graphics);
77 SetNativeGraphics(graphics);
78 }
79
80 Graphics(HDC hdc, HANDLE hdevice)
81 {
82 GpGraphics *graphics = NULL;
83 lastStatus = DllExports::GdipCreateFromHDC2(hdc, hdevice, &graphics);
84 SetNativeGraphics(graphics);
85 }
86
87 Graphics(HWND hwnd, BOOL icm = FALSE)
88 {
89 GpGraphics *graphics = NULL;
90 if (icm)
91 {
92 lastStatus = DllExports::GdipCreateFromHWNDICM(hwnd, &graphics);
93 }
94 else
95 {
96 lastStatus = DllExports::GdipCreateFromHWND(hwnd, &graphics);
97 }
98 SetNativeGraphics(graphics);
99 }
100
101 ~Graphics()
102 {
103 DllExports::GdipDeleteGraphics(nativeGraphics);
104 }
105
106 Status
107 AddMetafileComment(const BYTE *data, UINT sizeData)
108 {
109 return SetStatus(DllExports::GdipComment(nativeGraphics, sizeData, data));
110 }
111
112 GraphicsContainer
113 BeginContainer()
114 {
115 return GraphicsContainer();
116 }
117
118 GraphicsContainer
119 BeginContainer(const RectF &dstrect, const RectF &srcrect, Unit unit)
120 {
121 return GraphicsContainer();
122 }
123
124 GraphicsContainer
125 BeginContainer(const Rect &dstrect, const Rect &srcrect, Unit unit)
126 {
127 return GraphicsContainer();
128 }
129
130 Status
131 Clear(const Color &color)
132 {
133 return SetStatus(DllExports::GdipGraphicsClear(nativeGraphics, color.GetValue()));
134 }
135
136 Status
137 DrawArc(const Pen *pen, const Rect &rect, REAL startAngle, REAL sweepAngle)
138 {
139 return SetStatus(DllExports::GdipDrawArcI(
140 nativeGraphics, pen ? getNat(pen) : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle));
141 }
142
143 Status
144 DrawArc(const Pen *pen, const RectF &rect, REAL startAngle, REAL sweepAngle)
145 {
146 return SetStatus(DllExports::GdipDrawArcI(
147 nativeGraphics, pen ? getNat(pen) : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle));
148 }
149
150 Status
151 DrawArc(const Pen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
152 {
153 return SetStatus(DllExports::GdipDrawArc(
154 nativeGraphics, pen ? getNat(pen) : NULL, x, y, width, height, startAngle, sweepAngle));
155 }
156
157 Status
158 DrawArc(const Pen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle)
159 {
160 return SetStatus(DllExports::GdipDrawArcI(
161 nativeGraphics, pen ? getNat(pen) : NULL, x, y, width, height, startAngle, sweepAngle));
162 }
163
164 Status
165 DrawBezier(const Pen *pen, const Point &pt1, const Point &pt2, const Point &pt3, const Point &pt4)
166 {
167 return SetStatus(DllExports::GdipDrawBezierI(
168 nativeGraphics, pen ? getNat(pen) : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y));
169 }
170
171 Status
172 DrawBezier(const Pen *pen, const PointF &pt1, const PointF &pt2, const PointF &pt3, const PointF &pt4)
173 {
174 return SetStatus(DllExports::GdipDrawBezier(
175 nativeGraphics, pen ? getNat(pen) : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y));
176 }
177
178 Status
179 DrawBezier(const Pen *pen, REAL x1, REAL y1, REAL x2, REAL y2, REAL x3, REAL y3, REAL x4, REAL y4)
180 {
181 return SetStatus(
182 DllExports::GdipDrawBezier(nativeGraphics, pen ? getNat(pen) : NULL, x1, y1, x2, y2, x3, y3, x4, y4));
183 }
184
185 Status
186 DrawBezier(const Pen *pen, INT x1, INT y1, INT x2, INT y2, INT x3, INT y3, INT x4, INT y4)
187 {
188 return SetStatus(
189 DllExports::GdipDrawBezierI(nativeGraphics, pen ? getNat(pen) : NULL, x1, y1, x2, y2, x3, y3, x4, y4));
190 }
191
192 Status
193 DrawBeziers(const Pen *pen, const Point *points, INT count)
194 {
195 return SetStatus(DllExports::GdipDrawBeziersI(nativeGraphics, pen ? getNat(pen) : NULL, points, count));
196 }
197
198 Status
199 DrawBeziers(const Pen *pen, const PointF *points, INT count)
200 {
201 return SetStatus(DllExports::GdipDrawBeziers(nativeGraphics, pen ? getNat(pen) : NULL, points, count));
202 }
203
204 Status
205 DrawCachedBitmap(CachedBitmap *cb, INT x, INT y)
206 {
207 return SetStatus(DllExports::GdipDrawCachedBitmap(nativeGraphics, getNat(cb), x, y));
208 }
209
210 Status
211 DrawClosedCurve(const Pen *pen, const Point *points, INT count)
212 {
213 return SetStatus(DllExports::GdipDrawClosedCurveI(nativeGraphics, pen ? getNat(pen) : NULL, points, count));
214 }
215
216 Status
217 DrawClosedCurve(const Pen *pen, const PointF *points, INT count)
218 {
219 return SetStatus(DllExports::GdipDrawClosedCurve(nativeGraphics, pen ? getNat(pen) : NULL, points, count));
220 }
221
222 Status
223 DrawClosedCurve(const Pen *pen, const PointF *points, INT count, REAL tension)
224 {
225 return SetStatus(
226 DllExports::GdipDrawClosedCurve2(nativeGraphics, pen ? getNat(pen) : NULL, points, count, tension));
227 }
228
229 Status
230 DrawClosedCurve(const Pen *pen, const Point *points, INT count, REAL tension)
231 {
232 return SetStatus(
233 DllExports::GdipDrawClosedCurve2I(nativeGraphics, pen ? getNat(pen) : NULL, points, count, tension));
234 }
235
236 Status
237 DrawCurve(const Pen *pen, const Point *points, INT count)
238 {
239 return SetStatus(DllExports::GdipDrawCurveI(nativeGraphics, pen ? getNat(pen) : NULL, points, count));
240 }
241
242 Status
243 DrawCurve(const Pen *pen, const PointF *points, INT count)
244 {
245 return SetStatus(DllExports::GdipDrawCurve(nativeGraphics, pen ? getNat(pen) : NULL, points, count));
246 }
247
248 Status
249 DrawCurve(const Pen *pen, const PointF *points, INT count, REAL tension)
250 {
251 return SetStatus(DllExports::GdipDrawCurve2(nativeGraphics, pen ? getNat(pen) : NULL, points, count, tension));
252 }
253
254 Status
255 DrawCurve(const Pen *pen, const Point *points, INT count, INT offset, INT numberOfSegments, REAL tension)
256 {
257 return SetStatus(DllExports::GdipDrawCurve3I(
258 nativeGraphics, pen ? getNat(pen) : NULL, points, count, offset, numberOfSegments, tension));
259 }
260
261 Status
262 DrawCurve(const Pen *pen, const PointF *points, INT count, INT offset, INT numberOfSegments, REAL tension)
263 {
264 return SetStatus(DllExports::GdipDrawCurve3(
265 nativeGraphics, pen ? getNat(pen) : NULL, points, count, offset, numberOfSegments, tension));
266 }
267
268 Status
269 DrawCurve(const Pen *pen, const Point *points, INT count, REAL tension)
270 {
271 return SetStatus(DllExports::GdipDrawCurve2I(nativeGraphics, pen ? getNat(pen) : NULL, points, count, tension));
272 }
273
274 Status
275 DrawDriverString(
276 const UINT16 *text,
277 INT length,
278 const Font *font,
279 const Brush *brush,
280 const PointF *positions,
281 INT flags,
282 const Matrix *matrix)
283 {
284 return NotImplemented;
285 }
286
287 Status
288 DrawEllipse(const Pen *pen, const Rect &rect)
289 {
290 return SetStatus(DllExports::GdipDrawEllipseI(
291 nativeGraphics, pen ? getNat(pen) : NULL, rect.X, rect.Y, rect.Width, rect.Height));
292 }
293
294 Status
295 DrawEllipse(const Pen *pen, REAL x, REAL y, REAL width, REAL height)
296 {
297 return SetStatus(DllExports::GdipDrawEllipse(nativeGraphics, pen ? getNat(pen) : NULL, x, y, width, height));
298 }
299
300 Status
301 DrawEllipse(const Pen *pen, const RectF &rect)
302 {
303 return SetStatus(DllExports::GdipDrawEllipse(
304 nativeGraphics, pen ? getNat(pen) : NULL, rect.X, rect.Y, rect.Width, rect.Height));
305 }
306
307 Status
308 DrawEllipse(const Pen *pen, INT x, INT y, INT width, INT height)
309 {
310 return SetStatus(DllExports::GdipDrawEllipseI(nativeGraphics, pen ? getNat(pen) : NULL, x, y, width, height));
311 }
312
313 Status
314 DrawImage(Image *image, const Point *destPoints, INT count)
315 {
316 if (count != 3 && count != 4)
317 return SetStatus(InvalidParameter);
318
319 return SetStatus(
320 DllExports::GdipDrawImagePointsI(nativeGraphics, image ? getNat(image) : NULL, destPoints, count));
321 }
322
323 Status
324 DrawImage(Image *image, INT x, INT y)
325 {
326 return SetStatus(DllExports::GdipDrawImageI(nativeGraphics, image ? getNat(image) : NULL, x, y));
327 }
328
329 Status
330 DrawImage(Image *image, const Point &point)
331 {
332 return DrawImage(image, point.X, point.Y);
333 }
334
335 Status
336 DrawImage(Image *image, REAL x, REAL y)
337 {
338 return SetStatus(DllExports::GdipDrawImage(nativeGraphics, image ? getNat(image) : NULL, x, y));
339 }
340
341 Status
342 DrawImage(Image *image, const PointF &point)
343 {
344 return DrawImage(image, point.X, point.Y);
345 }
346
347 Status
348 DrawImage(Image *image, const PointF *destPoints, INT count)
349 {
350 if (count != 3 && count != 4)
351 return SetStatus(InvalidParameter);
352
353 return SetStatus(
354 DllExports::GdipDrawImagePoints(nativeGraphics, image ? getNat(image) : NULL, destPoints, count));
355 }
356
357 Status
358 DrawImage(Image *image, REAL x, REAL y, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, Unit srcUnit)
359 {
360 return SetStatus(DllExports::GdipDrawImagePointRect(
361 nativeGraphics, image ? getNat(image) : NULL, x, y, srcx, srcy, srcwidth, srcheight, srcUnit));
362 }
363
364 Status
365 DrawImage(Image *image, const RectF &rect)
366 {
367 return DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height);
368 }
369
370 Status
371 DrawImage(Image *image, INT x, INT y, INT width, INT height)
372 {
373 return SetStatus(
374 DllExports::GdipDrawImageRectI(nativeGraphics, image ? getNat(image) : NULL, x, y, width, height));
375 }
376
377 Status
378 DrawImage(
379 Image *image,
380 const PointF *destPoints,
381 INT count,
382 REAL srcx,
383 REAL srcy,
384 REAL srcwidth,
385 REAL srcheight,
386 Unit srcUnit,
387 ImageAttributes *imageAttributes,
388 DrawImageAbort callback,
389 VOID *callbackData)
390 {
391 return SetStatus(DllExports::GdipDrawImagePointsRect(
392 nativeGraphics, image ? getNat(image) : NULL, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit,
393 imageAttributes ? getNat(imageAttributes) : NULL, callback, callbackData));
394 }
395
396 Status
397 DrawImage(
398 Image *image,
399 const Rect &destRect,
400 INT srcx,
401 INT srcy,
402 INT srcwidth,
403 INT srcheight,
404 Unit srcUnit,
405 const ImageAttributes *imageAttributes = NULL,
406 DrawImageAbort callback = NULL,
407 VOID *callbackData = NULL)
408 {
409 return SetStatus(DllExports::GdipDrawImageRectRectI(
410 nativeGraphics, image ? getNat(image) : NULL, destRect.X, destRect.Y, destRect.Width, destRect.Height, srcx,
411 srcy, srcwidth, srcheight, srcUnit, imageAttributes ? getNat(imageAttributes) : NULL, callback,
412 callbackData));
413 }
414
415 Status
416 DrawImage(
417 Image *image,
418 const Point *destPoints,
419 INT count,
420 INT srcx,
421 INT srcy,
422 INT srcwidth,
423 INT srcheight,
424 Unit srcUnit,
425 ImageAttributes *imageAttributes = NULL,
426 DrawImageAbort callback = NULL,
427 VOID *callbackData = NULL)
428 {
429 return SetStatus(DllExports::GdipDrawImagePointsRectI(
430 nativeGraphics, image ? getNat(image) : NULL, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit,
431 imageAttributes ? getNat(imageAttributes) : NULL, callback, callbackData));
432 }
433
434 Status
435 DrawImage(Image *image, REAL x, REAL y, REAL width, REAL height)
436 {
437 return SetStatus(
438 DllExports::GdipDrawImageRect(nativeGraphics, image ? getNat(image) : NULL, x, y, width, height));
439 }
440
441 Status
442 DrawImage(Image *image, const Rect &rect)
443 {
444 return DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height);
445 }
446
447 Status
448 DrawImage(Image *image, INT x, INT y, INT srcx, INT srcy, INT srcwidth, INT srcheight, Unit srcUnit)
449 {
450 return SetStatus(DllExports::GdipDrawImagePointRectI(
451 nativeGraphics, image ? getNat(image) : NULL, x, y, srcx, srcy, srcwidth, srcheight, srcUnit));
452 }
453
454 Status
455 DrawImage(
456 Image *image,
457 const RectF &destRect,
458 REAL srcx,
459 REAL srcy,
460 REAL srcwidth,
461 REAL srcheight,
462 Unit srcUnit,
463 ImageAttributes *imageAttributes = NULL,
464 DrawImageAbort callback = NULL,
465 VOID *callbackData = NULL)
466 {
467 return SetStatus(DllExports::GdipDrawImageRectRect(
468 nativeGraphics, image ? getNat(image) : NULL, destRect.X, destRect.Y, destRect.Width, destRect.Height, srcx,
469 srcy, srcwidth, srcheight, srcUnit, imageAttributes ? getNat(imageAttributes) : NULL, callback,
470 callbackData));
471 }
472
473 Status
474 DrawLine(const Pen *pen, const Point &pt1, const Point &pt2)
475 {
476 return SetStatus(
477 DllExports::GdipDrawLineI(nativeGraphics, pen ? getNat(pen) : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y));
478 }
479
480 Status
481 DrawLine(const Pen *pen, const PointF &pt1, const Point &pt2)
482 {
483 return SetStatus(
484 DllExports::GdipDrawLine(nativeGraphics, pen ? getNat(pen) : NULL, pt1.X, pt1.Y, pt2.X, pt2.Y));
485 }
486
487 Status
488 DrawLine(const Pen *pen, REAL x1, REAL y1, REAL x2, REAL y2)
489 {
490 return SetStatus(DllExports::GdipDrawLine(nativeGraphics, pen ? getNat(pen) : NULL, x1, y1, x2, y2));
491 }
492
493 Status
494 DrawLine(const Pen *pen, INT x1, INT y1, INT x2, INT y2)
495 {
496 return SetStatus(DllExports::GdipDrawLine(nativeGraphics, pen ? getNat(pen) : NULL, x1, y1, x2, y2));
497 }
498
499 Status
500 DrawLines(const Pen *pen, const Point *points, INT count)
501 {
502 return SetStatus(DllExports::GdipDrawLinesI(nativeGraphics, pen ? getNat(pen) : NULL, points, count));
503 }
504
505 Status
506 DrawLines(const Pen *pen, const PointF *points, INT count)
507 {
508 return SetStatus(DllExports::GdipDrawLines(nativeGraphics, pen ? getNat(pen) : NULL, points, count));
509 }
510
511 Status
512 DrawPath(const Pen *pen, const GraphicsPath *path)
513 {
514 return SetStatus(
515 DllExports::GdipDrawPath(nativeGraphics, pen ? getNat(pen) : NULL, path ? getNat(path) : NULL));
516 }
517
518 Status
519 DrawPie(const Pen *pen, const Rect &rect, REAL startAngle, REAL sweepAngle)
520 {
521 return SetStatus(DllExports::GdipDrawPieI(
522 nativeGraphics, pen ? getNat(pen) : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle));
523 }
524
525 Status
526 DrawPie(const Pen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle)
527 {
528 return SetStatus(DllExports::GdipDrawPieI(
529 nativeGraphics, pen ? getNat(pen) : NULL, x, y, width, height, startAngle, sweepAngle));
530 }
531
532 Status
533 DrawPie(const Pen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
534 {
535 return SetStatus(DllExports::GdipDrawPie(
536 nativeGraphics, pen ? getNat(pen) : NULL, x, y, width, height, startAngle, sweepAngle));
537 }
538
539 Status
540 DrawPie(const Pen *pen, const RectF &rect, REAL startAngle, REAL sweepAngle)
541 {
542 return SetStatus(DllExports::GdipDrawPie(
543 nativeGraphics, pen ? getNat(pen) : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle));
544 }
545
546 Status
547 DrawPolygon(const Pen *pen, const Point *points, INT count)
548 {
549 return SetStatus(DllExports::GdipDrawPolygonI(nativeGraphics, pen ? getNat(pen) : NULL, points, count));
550 }
551
552 Status
553 DrawPolygon(const Pen *pen, const PointF *points, INT count)
554 {
555 return SetStatus(DllExports::GdipDrawPolygon(nativeGraphics, pen ? getNat(pen) : NULL, points, count));
556 }
557
558 Status
559 DrawRectangle(const Pen *pen, const Rect &rect)
560 {
561 return SetStatus(DllExports::GdipDrawRectangleI(
562 nativeGraphics, pen ? getNat(pen) : NULL, rect.X, rect.Y, rect.Width, rect.Height));
563 }
564
565 Status
566 DrawRectangle(const Pen *pen, INT x, INT y, INT width, INT height)
567 {
568 return SetStatus(DllExports::GdipDrawRectangleI(nativeGraphics, pen ? getNat(pen) : NULL, x, y, width, height));
569 }
570
571 Status
572 DrawRectangle(const Pen *pen, REAL x, REAL y, REAL width, REAL height)
573 {
574 return SetStatus(DllExports::GdipDrawRectangle(nativeGraphics, pen ? getNat(pen) : NULL, x, y, width, height));
575 }
576
577 Status
578 DrawRectangle(const Pen *pen, const RectF &rect)
579 {
580 return SetStatus(DllExports::GdipDrawRectangleI(
581 nativeGraphics, pen ? getNat(pen) : NULL, rect.X, rect.Y, rect.Width, rect.Height));
582 }
583
584 Status
585 DrawRectangles(const Pen *pen, const Rect *rects, INT count)
586 {
587 return SetStatus(DllExports::GdipDrawRectanglesI(nativeGraphics, pen ? getNat(pen) : NULL, rects, count));
588 }
589
590 Status
591 DrawRectangles(const Pen *pen, const RectF *rects, INT count)
592 {
593 return SetStatus(DllExports::GdipDrawRectangles(nativeGraphics, pen ? getNat(pen) : NULL, rects, count));
594 }
595
596 Status
597 DrawString(
598 const WCHAR *string,
599 INT length,
600 const Font *font,
601 const RectF &layoutRect,
602 const StringFormat *stringFormat,
603 const Brush *brush)
604 {
605 return NotImplemented;
606 }
607
608 Status
609 DrawString(const WCHAR *string, INT length, const Font *font, const PointF &origin, const Brush *brush)
610 {
611 return NotImplemented;
612 }
613
614 Status
615 DrawString(
616 const WCHAR *string,
617 INT length,
618 const Font *font,
619 const PointF &origin,
620 const StringFormat *stringFormat,
621 const Brush *brush)
622 {
623 return NotImplemented;
624 }
625
626 Status
627 EndContainer(GraphicsContainer state)
628 {
629 return SetStatus(DllExports::GdipEndContainer(nativeGraphics, state));
630 }
631
632 Status
633 EnumerateMetafile(
634 const Metafile *metafile,
635 const Metafile &destPoint,
636 EnumerateMetafileProc callback,
637 VOID *callbackData = NULL,
638 ImageAttributes *imageAttributes = NULL)
639 {
640 return NotImplemented;
641 }
642
643 Status
644 EnumerateMetafile(
645 const Metafile *metafile,
646 const Point *destPoints,
647 INT count,
648 EnumerateMetafileProc callback,
649 VOID *callbackData,
650 ImageAttributes *imageAttributes)
651 {
652 return NotImplemented;
653 }
654
655 Status
656 EnumerateMetafile(
657 const Metafile *metafile,
658 const Point &destPoint,
659 const Rect &srcRect,
660 Unit srcUnit,
661 EnumerateMetafileProc callback,
662 VOID *callbackData,
663 ImageAttributes *imageAttributes)
664 {
665 return NotImplemented;
666 }
667
668 Status
669 EnumerateMetafile(
670 const Metafile *metafile,
671 const PointF *destPoints,
672 INT count,
673 EnumerateMetafileProc callback,
674 VOID *callbackData,
675 ImageAttributes *imageAttributes)
676 {
677 return NotImplemented;
678 }
679
680 Status
681 EnumerateMetafile(
682 const Metafile *metafile,
683 const Rect &destRect,
684 EnumerateMetafileProc callback,
685 VOID *callbackData,
686 ImageAttributes *imageAttributes)
687 {
688 return NotImplemented;
689 }
690
691 Status
692 EnumerateMetafile(
693 const Metafile *metafile,
694 const RectF &destRect,
695 const RectF &srcRect,
696 Unit srcUnit,
697 EnumerateMetafileProc callback,
698 VOID *callbackData,
699 ImageAttributes *imageAttributes)
700 {
701 return NotImplemented;
702 }
703
704 Status
705 EnumerateMetafile(
706 const Metafile *metafile,
707 const RectF &destRect,
708 EnumerateMetafileProc callback,
709 VOID *callbackData,
710 ImageAttributes *imageAttributes)
711 {
712 return NotImplemented;
713 }
714
715 Status
716 EnumerateMetafile(
717 const Metafile *metafile,
718 const PointF &destPoint,
719 const Rect &srcRect,
720 Unit srcUnit,
721 EnumerateMetafileProc callback,
722 VOID *callbackData,
723 ImageAttributes *imageAttributes)
724 {
725 return NotImplemented;
726 }
727
728 Status
729 EnumerateMetafile(
730 const Metafile *metafile,
731 const Point *destPoints,
732 INT count,
733 const Rect &srcRect,
734 Unit srcUnit,
735 EnumerateMetafileProc callback,
736 VOID *callbackData,
737 ImageAttributes *imageAttributes)
738 {
739 return NotImplemented;
740 }
741
742 Status
743 EnumerateMetafile(
744 const Metafile *metafile,
745 const Rect &destRect,
746 const Rect &srcRect,
747 Unit srcUnit,
748 EnumerateMetafileProc callback,
749 VOID *callbackData,
750 ImageAttributes *imageAttributes)
751 {
752 return NotImplemented;
753 }
754
755 Status
756 EnumerateMetafile(
757 const Metafile *metafile,
758 const Point *destPoints,
759 INT count,
760 const RectF &srcRect,
761 Unit srcUnit,
762 EnumerateMetafileProc callback,
763 VOID *callbackData,
764 ImageAttributes *imageAttributes)
765 {
766 return NotImplemented;
767 }
768
769 Status
770 EnumerateMetafile(
771 const Metafile *metafile,
772 const PointF &destPoint,
773 EnumerateMetafileProc callback,
774 VOID *callbackData,
775 ImageAttributes *imageAttributes)
776 {
777 return NotImplemented;
778 }
779
780 Status
781 ExcludeClip(const Rect &rect)
782 {
783 return SetStatus(
784 DllExports::GdipSetClipRectI(nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, CombineModeExclude));
785 }
786
787 Status
788 ExcludeClip(const RectF &rect)
789 {
790 return SetStatus(
791 DllExports::GdipSetClipRect(nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, CombineModeExclude));
792 }
793
794 Status
795 ExcludeClip(const Region *region)
796 {
797 return SetStatus(DllExports::GdipSetClipRegion(nativeGraphics, getNat(region), CombineModeExclude));
798 }
799
800 Status
801 FillClosedCurve(const Brush *brush, const Point *points, INT count)
802 {
803 return SetStatus(DllExports::GdipFillClosedCurveI(nativeGraphics, brush ? getNat(brush) : NULL, points, count));
804 }
805
806 Status
807 FillClosedCurve(const Brush *brush, const Point *points, INT count, FillMode fillMode, REAL tension)
808 {
809 return SetStatus(DllExports::GdipFillClosedCurve2I(
810 nativeGraphics, brush ? getNat(brush) : NULL, points, count, tension, fillMode));
811 }
812
813 Status
814 FillClosedCurve(const Brush *brush, const PointF *points, INT count)
815 {
816 return SetStatus(DllExports::GdipFillClosedCurve(nativeGraphics, brush ? getNat(brush) : NULL, points, count));
817 }
818
819 Status
820 FillClosedCurve(const Brush *brush, const PointF *points, INT count, FillMode fillMode, REAL tension)
821 {
822 return SetStatus(DllExports::GdipFillClosedCurve2(
823 nativeGraphics, brush ? getNat(brush) : NULL, points, count, tension, fillMode));
824 }
825
826 Status
827 FillEllipse(const Brush *brush, const Rect &rect)
828 {
829 return SetStatus(DllExports::GdipFillEllipseI(
830 nativeGraphics, brush ? getNat(brush) : NULL, rect.X, rect.Y, rect.Width, rect.Height));
831 }
832
833 Status
834 FillEllipse(const Brush *brush, REAL x, REAL y, REAL width, REAL height)
835 {
836 return SetStatus(
837 DllExports::GdipFillEllipse(nativeGraphics, brush ? getNat(brush) : NULL, x, y, width, height));
838 }
839
840 Status
841 FillEllipse(const Brush *brush, const RectF &rect)
842 {
843 return SetStatus(DllExports::GdipFillEllipse(
844 nativeGraphics, brush ? getNat(brush) : NULL, rect.X, rect.Y, rect.Width, rect.Height));
845 }
846
847 Status
848 FillEllipse(const Brush *brush, INT x, INT y, INT width, INT height)
849 {
850 return SetStatus(
851 DllExports::GdipFillEllipseI(nativeGraphics, brush ? getNat(brush) : NULL, x, y, width, height));
852 }
853
854 Status
855 FillPath(const Brush *brush, const GraphicsPath *path)
856 {
857 return SetStatus(DllExports::GdipFillPath(nativeGraphics, getNat(brush), getNat(path)));
858 }
859
860 Status
861 FillPie(const Brush *brush, const Rect &rect, REAL startAngle, REAL sweepAngle)
862 {
863 return SetStatus(DllExports::GdipFillPieI(
864 nativeGraphics, brush ? getNat(brush) : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle,
865 sweepAngle));
866 }
867
868 Status
869 FillPie(const Brush *brush, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle)
870 {
871 return SetStatus(DllExports::GdipFillPieI(
872 nativeGraphics, brush ? getNat(brush) : NULL, x, y, width, height, startAngle, sweepAngle));
873 }
874
875 Status
876 FillPie(const Brush *brush, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
877 {
878 return SetStatus(DllExports::GdipFillPie(
879 nativeGraphics, brush ? getNat(brush) : NULL, x, y, width, height, startAngle, sweepAngle));
880 }
881
882 Status
883 FillPie(const Brush *brush, RectF &rect, REAL startAngle, REAL sweepAngle)
884 {
885 return SetStatus(DllExports::GdipFillPie(
886 nativeGraphics, brush ? getNat(brush) : NULL, rect.X, rect.Y, rect.Width, rect.Height, startAngle,
887 sweepAngle));
888 }
889
890 Status
891 FillPolygon(const Brush *brush, const Point *points, INT count)
892 {
893 return SetStatus(DllExports::GdipFillPolygon2I(nativeGraphics, brush ? getNat(brush) : NULL, points, count));
894 }
895
896 Status
897 FillPolygon(const Brush *brush, const PointF *points, INT count)
898 {
899 return SetStatus(DllExports::GdipFillPolygon2(nativeGraphics, brush ? getNat(brush) : NULL, points, count));
900 }
901
902 Status
903 FillPolygon(const Brush *brush, const Point *points, INT count, FillMode fillMode)
904 {
905 return SetStatus(
906 DllExports::GdipFillPolygonI(nativeGraphics, brush ? getNat(brush) : NULL, points, count, fillMode));
907 }
908
909 Status
910 FillPolygon(const Brush *brush, const PointF *points, INT count, FillMode fillMode)
911 {
912 return SetStatus(
913 DllExports::GdipFillPolygon(nativeGraphics, brush ? getNat(brush) : NULL, points, count, fillMode));
914 }
915
916 Status
917 FillRectangle(const Brush *brush, const Rect &rect)
918 {
919 return SetStatus(DllExports::GdipFillRectangleI(
920 nativeGraphics, brush ? getNat(brush) : NULL, rect.X, rect.Y, rect.Width, rect.Height));
921 }
922
923 Status
924 FillRectangle(const Brush *brush, const RectF &rect)
925 {
926 return SetStatus(DllExports::GdipFillRectangle(
927 nativeGraphics, brush ? getNat(brush) : NULL, rect.X, rect.Y, rect.Width, rect.Height));
928 }
929
930 Status
931 FillRectangle(const Brush *brush, REAL x, REAL y, REAL width, REAL height)
932 {
933 return SetStatus(
934 DllExports::GdipFillRectangle(nativeGraphics, brush ? getNat(brush) : NULL, x, y, width, height));
935 }
936
937 Status
938 FillRectangle(const Brush *brush, INT x, INT y, INT width, INT height)
939 {
940 return SetStatus(
941 DllExports::GdipFillRectangleI(nativeGraphics, brush ? getNat(brush) : NULL, x, y, width, height));
942 }
943
944 Status
945 FillRectangles(const Brush *brush, const Rect *rects, INT count)
946 {
947 return SetStatus(DllExports::GdipFillRectanglesI(nativeGraphics, brush ? getNat(brush) : NULL, rects, count));
948 }
949
950 Status
951 FillRectangles(const Brush *brush, const RectF *rects, INT count)
952 {
953 return SetStatus(DllExports::GdipFillRectangles(nativeGraphics, brush ? getNat(brush) : NULL, rects, count));
954 }
955
956 Status
957 FillRegion(const Brush *brush, const Region *region)
958 {
959 return SetStatus(DllExports::GdipFillRegion(nativeGraphics, getNat(brush), getNat(region)));
960 }
961
962 VOID
963 Flush(FlushIntention intention)
964 {
965 DllExports::GdipFlush(nativeGraphics, intention);
966 }
967
968 static Graphics *
969 FromHDC(HDC hdc)
970 {
971 return new Graphics(hdc);
972 }
973
974 static Graphics *
975 FromHDC(HDC hdc, HANDLE hDevice)
976 {
977 return new Graphics(hdc, hDevice);
978 }
979
980 static Graphics *
981 FromHWND(HWND hWnd, BOOL icm)
982 {
983 return new Graphics(hWnd, icm);
984 }
985
986 static Graphics *
987 FromImage(Image *image)
988 {
989 return new Graphics(image);
990 }
991
992 Status
993 GetClip(Region *region) const
994 {
995 return SetStatus(DllExports::GdipGetClip(nativeGraphics, getNat(region)));
996 }
997
998 Status
999 GetClipBounds(Rect *rect) const
1000 {
1001 return SetStatus(DllExports::GdipGetClipBoundsI(nativeGraphics, rect));
1002 }
1003
1004 Status
1005 GetClipBounds(RectF *rect) const
1006 {
1007 return SetStatus(DllExports::GdipGetClipBounds(nativeGraphics, rect));
1008 }
1009
1010 CompositingMode
1011 GetCompositingMode() const
1012 {
1013 CompositingMode compositingMode;
1014 SetStatus(DllExports::GdipGetCompositingMode(nativeGraphics, &compositingMode));
1015 return compositingMode;
1016 }
1017
1018 CompositingQuality
1019 GetCompositingQuality() const
1020 {
1021 CompositingQuality compositingQuality;
1022 SetStatus(DllExports::GdipGetCompositingQuality(nativeGraphics, &compositingQuality));
1023 return compositingQuality;
1024 }
1025
1026 REAL
1027 GetDpiX() const
1028 {
1029 REAL dpi;
1030 SetStatus(DllExports::GdipGetDpiX(nativeGraphics, &dpi));
1031 return dpi;
1032 }
1033
1034 REAL
1035 GetDpiY() const
1036 {
1037 REAL dpi;
1038 SetStatus(DllExports::GdipGetDpiY(nativeGraphics, &dpi));
1039 return dpi;
1040 }
1041
1042 static HPALETTE
1043 GetHalftonePalette()
1044 {
1045 return NULL;
1046 }
1047
1048 HDC
1049 GetHDC()
1050 {
1051 HDC hdc = NULL;
1052 SetStatus(DllExports::GdipGetDC(nativeGraphics, &hdc));
1053 return hdc;
1054 }
1055
1056 InterpolationMode
1057 GetInterpolationMode() const
1058 {
1059 InterpolationMode interpolationMode;
1060 SetStatus(DllExports::GdipGetInterpolationMode(nativeGraphics, &interpolationMode));
1061 return interpolationMode;
1062 }
1063
1064 Status
1065 GetLastStatus() const
1066 {
1067 return lastStatus;
1068 }
1069
1070 Status
1071 GetNearestColor(Color *color) const
1072 {
1073 if (color == NULL)
1074 return SetStatus(InvalidParameter);
1075
1076 ARGB argb = color->GetValue();
1077 SetStatus(DllExports::GdipGetNearestColor(nativeGraphics, &argb));
1078
1079 color->SetValue(argb);
1080 return lastStatus;
1081 }
1082
1083 REAL
1084 GetPageScale() const
1085 {
1086 REAL scale;
1087 SetStatus(DllExports::GdipGetPageScale(nativeGraphics, &scale));
1088 return scale;
1089 }
1090
1091 Unit
1092 GetPageUnit() const
1093 {
1094 Unit unit;
1095 SetStatus(DllExports::GdipGetPageUnit(nativeGraphics, &unit));
1096 return unit;
1097 }
1098
1099 PixelOffsetMode
1100 GetPixelOffsetMode() const
1101 {
1102 PixelOffsetMode pixelOffsetMode;
1103 SetStatus(DllExports::GdipGetPixelOffsetMode(nativeGraphics, &pixelOffsetMode));
1104 return pixelOffsetMode;
1105 }
1106
1107 Status
1108 GetRenderingOrigin(INT *x, INT *y) const
1109 {
1110 #if 1
1111 return SetStatus(NotImplemented); // FIXME
1112 #else
1113 return SetStatus(DllExports::GdipGetRenderingOrigin(nativeGraphics, x, y));
1114 #endif
1115 }
1116
1117 SmoothingMode
1118 GetSmoothingMode() const
1119 {
1120 SmoothingMode smoothingMode;
1121 SetStatus(DllExports::GdipGetSmoothingMode(nativeGraphics, &smoothingMode));
1122 return smoothingMode;
1123 }
1124
1125 UINT
1126 GetTextContrast() const
1127 {
1128 UINT contrast;
1129 SetStatus(DllExports::GdipGetTextContrast(nativeGraphics, &contrast));
1130 return contrast;
1131 }
1132
1133 TextRenderingHint
1134 GetTextRenderingHint() const
1135 {
1136 TextRenderingHint mode;
1137 SetStatus(DllExports::GdipGetTextRenderingHint(nativeGraphics, &mode));
1138 return mode;
1139 }
1140
1141 UINT
1142 GetTextGammaValue() const
1143 {
1144 #if 1
1145 return SetStatus(NotImplemented); // FIXME
1146 #else
1147 UINT gammaValue;
1148 SetStatus(DllExports::GdipGetTextGammaValue(nativeGraphics, &gammaValue));
1149 return gammaValue;
1150 #endif
1151 }
1152
1153 Status
1154 GetTransform(Matrix *matrix) const
1155 {
1156 return SetStatus(DllExports::GdipGetWorldTransform(nativeGraphics, getNat(matrix)));
1157 }
1158
1159 Status
1160 GetVisibleClipBounds(Rect *rect) const
1161 {
1162 return SetStatus(DllExports::GdipGetVisibleClipBoundsI(nativeGraphics, rect));
1163 }
1164
1165 Status
1166 GetVisibleClipBounds(RectF *rect) const
1167 {
1168 return SetStatus(DllExports::GdipGetVisibleClipBounds(nativeGraphics, rect));
1169 }
1170
1171 Status
1172 IntersectClip(const Rect &rect)
1173 {
1174 return SetStatus(DllExports::GdipSetClipRectI(
1175 nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, CombineModeIntersect));
1176 }
1177
1178 Status
1179 IntersectClip(const Region *region)
1180 {
1181 return SetStatus(DllExports::GdipSetClipRegion(nativeGraphics, getNat(region), CombineModeIntersect));
1182 }
1183
1184 Status
1185 IntersectClip(const RectF &rect)
1186 {
1187 return SetStatus(
1188 DllExports::GdipSetClipRect(nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, CombineModeIntersect));
1189 }
1190
1191 BOOL
1192 IsClipEmpty() const
1193 {
1194 BOOL result;
1195 SetStatus(DllExports::GdipIsClipEmpty(nativeGraphics, &result));
1196 return result;
1197 }
1198
1199 BOOL
1200 IsVisible(const Point &point) const
1201 {
1202 BOOL result;
1203 SetStatus(DllExports::GdipIsVisiblePointI(nativeGraphics, point.X, point.Y, &result));
1204 return result;
1205 }
1206
1207 BOOL
1208 IsVisible(const Rect &rect) const
1209 {
1210 BOOL result;
1211 SetStatus(DllExports::GdipIsVisibleRectI(nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, &result));
1212 return result;
1213 }
1214
1215 BOOL
1216 IsVisible(REAL x, REAL y) const
1217 {
1218 BOOL result;
1219 SetStatus(DllExports::GdipIsVisiblePoint(nativeGraphics, x, y, &result));
1220 return result;
1221 }
1222
1223 BOOL
1224 IsVisible(const RectF &rect) const
1225 {
1226 BOOL result;
1227 SetStatus(DllExports::GdipIsVisibleRect(nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, &result));
1228 return result;
1229 }
1230
1231 BOOL
1232 IsVisible(INT x, INT y, INT width, INT height) const
1233 {
1234 BOOL result;
1235 SetStatus(DllExports::GdipIsVisibleRectI(nativeGraphics, x, y, width, height, &result));
1236 return result;
1237 }
1238
1239 BOOL
1240 IsVisible(INT x, INT y) const
1241 {
1242 BOOL result;
1243 SetStatus(DllExports::GdipIsVisiblePointI(nativeGraphics, x, y, &result));
1244 return result;
1245 }
1246
1247 BOOL
1248 IsVisible(const PointF &point) const
1249 {
1250 BOOL result;
1251 SetStatus(DllExports::GdipIsVisiblePoint(nativeGraphics, point.X, point.Y, &result));
1252 return result;
1253 }
1254
1255 BOOL
1256 IsVisible(REAL x, REAL y, REAL width, REAL height) const
1257 {
1258 BOOL result;
1259 SetStatus(DllExports::GdipIsVisibleRect(nativeGraphics, x, y, width, height, &result));
1260 return result;
1261 }
1262
1263 BOOL
1264 IsVisibleClipEmpty() const
1265 {
1266 #if 1
1267 return FALSE; // FIXME
1268 #else
1269 BOOL flag = FALSE;
1270 SetStatus(DllExports::GdipIsVisibleClipEmpty(nativeGraphics, &flag));
1271 return flag;
1272 #endif
1273 }
1274
1275 Status
1276 MeasureCharacterRanges(
1277 const WCHAR *string,
1278 INT length,
1279 const Font *font,
1280 const RectF &layoutRect,
1281 const StringFormat *stringFormat,
1282 INT regionCount,
1283 Region *regions) const
1284 {
1285 return NotImplemented;
1286 }
1287
1288 Status
1289 MeasureDriverString(
1290 const UINT16 *text,
1291 INT length,
1292 const Font *font,
1293 const PointF *positions,
1294 INT flags,
1295 const Matrix *matrix,
1296 RectF *boundingBox) const
1297 {
1298 return NotImplemented;
1299 }
1300
1301 Status
1302 MeasureString(const WCHAR *string, INT length, const Font *font, const RectF &layoutRect, RectF *boundingBox) const
1303 {
1304 return NotImplemented;
1305 }
1306
1307 Status
1308 MeasureString(
1309 const WCHAR *string,
1310 INT length,
1311 const Font *font,
1312 const PointF &origin,
1313 const StringFormat *stringFormat,
1314 RectF *boundingBox) const
1315 {
1316 return NotImplemented;
1317 }
1318
1319 Status
1320 MeasureString(
1321 const WCHAR *string,
1322 INT length,
1323 const Font *font,
1324 const RectF &layoutRect,
1325 const StringFormat *stringFormat,
1326 RectF *boundingBox,
1327 INT *codepointsFitted,
1328 INT *linesFilled) const
1329 {
1330 return NotImplemented;
1331 }
1332
1333 Status
1334 MeasureString(
1335 const WCHAR *string,
1336 INT length,
1337 const Font *font,
1338 const SizeF &layoutRectSize,
1339 const StringFormat *stringFormat,
1340 SizeF *size,
1341 INT *codepointsFitted,
1342 INT *linesFilled) const
1343 {
1344 return NotImplemented;
1345 }
1346
1347 Status
1348 MeasureString(const WCHAR *string, INT length, const Font *font, const PointF &origin, RectF *boundingBox) const
1349 {
1350 return NotImplemented;
1351 }
1352
1353 Status
1354 MultiplyTransform(Matrix *matrix, MatrixOrder order)
1355 {
1356 return SetStatus(DllExports::GdipMultiplyWorldTransform(nativeGraphics, getNat(matrix), order));
1357 }
1358
1359 VOID
1360 ReleaseHDC(HDC hdc)
1361 {
1362 SetStatus(DllExports::GdipReleaseDC(nativeGraphics, hdc));
1363 }
1364
1365 Status
1366 ResetClip()
1367 {
1368 return SetStatus(DllExports::GdipResetClip(nativeGraphics));
1369 }
1370
1371 Status
1372 ResetTransform()
1373 {
1374 return SetStatus(DllExports::GdipResetWorldTransform(nativeGraphics));
1375 }
1376
1377 Status
1378 Restore(GraphicsState gstate)
1379 {
1380 return NotImplemented;
1381 }
1382
1383 Status
1384 RotateTransform(REAL angle, MatrixOrder order = MatrixOrderPrepend)
1385 {
1386 return SetStatus(DllExports::GdipRotateWorldTransform(nativeGraphics, angle, order));
1387 }
1388
1389 GraphicsState
1390 Save()
1391 {
1392 return 0;
1393 }
1394
1395 Status
1396 ScaleTransform(REAL sx, REAL sy, MatrixOrder order = MatrixOrderPrepend)
1397 {
1398 return SetStatus(DllExports::GdipScaleWorldTransform(nativeGraphics, sx, sy, order));
1399 }
1400
1401 Status
1402 SetClip(const Graphics *g, CombineMode combineMode = CombineModeReplace)
1403 {
1404 return SetStatus(DllExports::GdipSetClipGraphics(nativeGraphics, g ? g->nativeGraphics : NULL, combineMode));
1405 }
1406
1407 Status
1408 SetClip(const GraphicsPath *path, CombineMode combineMode = CombineModeReplace)
1409 {
1410 return SetStatus(DllExports::GdipSetClipPath(nativeGraphics, getNat(path), combineMode));
1411 }
1412
1413 Status
1414 SetClip(const Region *region, CombineMode combineMode = CombineModeReplace)
1415 {
1416 return SetStatus(DllExports::GdipSetClipRegion(nativeGraphics, getNat(region), combineMode));
1417 }
1418
1419 Status
1420 SetClip(const Rect &rect, CombineMode combineMode = CombineModeReplace)
1421 {
1422 return SetStatus(
1423 DllExports::GdipSetClipRectI(nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, combineMode));
1424 }
1425
1426 Status
1427 SetClip(HRGN hRgn, CombineMode combineMode = CombineModeReplace)
1428 {
1429 return SetStatus(DllExports::GdipSetClipHrgn(nativeGraphics, hRgn, combineMode));
1430 }
1431
1432 Status
1433 SetClip(const RectF &rect, CombineMode combineMode = CombineModeReplace)
1434 {
1435 return SetStatus(
1436 DllExports::GdipSetClipRect(nativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, combineMode));
1437 }
1438
1439 Status
1440 SetCompositingMode(CompositingMode compositingMode)
1441 {
1442 return SetStatus(DllExports::GdipSetCompositingMode(nativeGraphics, compositingMode));
1443 }
1444
1445 Status
1446 SetCompositingQuality(CompositingQuality compositingQuality)
1447 {
1448 return SetStatus(DllExports::GdipSetCompositingQuality(nativeGraphics, compositingQuality));
1449 }
1450
1451 Status
1452 SetInterpolationMode(InterpolationMode interpolationMode)
1453 {
1454 return SetStatus(DllExports::GdipSetInterpolationMode(nativeGraphics, interpolationMode));
1455 }
1456
1457 Status
1458 SetPageScale(REAL scale)
1459 {
1460 return SetStatus(DllExports::GdipSetPageScale(nativeGraphics, scale));
1461 }
1462
1463 Status
1464 SetPageUnit(Unit unit)
1465 {
1466 return SetStatus(DllExports::GdipSetPageUnit(nativeGraphics, unit));
1467 }
1468
1469 Status
1470 SetPixelOffsetMode(PixelOffsetMode pixelOffsetMode)
1471 {
1472 return SetStatus(DllExports::GdipSetPixelOffsetMode(nativeGraphics, pixelOffsetMode));
1473 }
1474
1475 Status
1476 SetRenderingOrigin(INT x, INT y)
1477 {
1478 return SetStatus(DllExports::GdipSetRenderingOrigin(nativeGraphics, x, y));
1479 }
1480
1481 Status
1482 SetSmoothingMode(SmoothingMode smoothingMode)
1483 {
1484 return SetStatus(DllExports::GdipSetSmoothingMode(nativeGraphics, smoothingMode));
1485 }
1486
1487 Status
1488 SetTextContrast(UINT contrast)
1489 {
1490 return SetStatus(DllExports::GdipSetTextContrast(nativeGraphics, contrast));
1491 }
1492
1493 Status
1494 SetTextRenderingHint(TextRenderingHint newMode)
1495 {
1496 return SetStatus(DllExports::GdipSetTextRenderingHint(nativeGraphics, newMode));
1497 }
1498
1499 Status
1500 SetTransform(const Matrix *matrix)
1501 {
1502 return SetStatus(DllExports::GdipSetWorldTransform(nativeGraphics, getNat(matrix)));
1503 }
1504
1505 Status
1506 TransformPoints(CoordinateSpace destSpace, CoordinateSpace srcSpace, Point *pts, INT count)
1507 {
1508 return SetStatus(DllExports::GdipTransformPointsI(nativeGraphics, destSpace, srcSpace, pts, count));
1509 }
1510
1511 Status
1512 TransformPoints(CoordinateSpace destSpace, CoordinateSpace srcSpace, PointF *pts, INT count)
1513 {
1514 return SetStatus(DllExports::GdipTransformPoints(nativeGraphics, destSpace, srcSpace, pts, count));
1515 }
1516
1517 Status
1518 TranslateClip(INT dx, INT dy)
1519 {
1520 return SetStatus(DllExports::GdipTranslateClipI(nativeGraphics, dx, dy));
1521 }
1522
1523 Status
1524 TranslateClip(REAL dx, REAL dy)
1525 {
1526 return SetStatus(DllExports::GdipTranslateClip(nativeGraphics, dx, dy));
1527 }
1528
1529 Status
1530 TranslateTransform(REAL dx, REAL dy, MatrixOrder order = MatrixOrderPrepend)
1531 {
1532 return SetStatus(DllExports::GdipTranslateWorldTransform(nativeGraphics, dx, dy, order));
1533 }
1534
1535 private:
1536 Status
1537 SetStatus(Status status) const
1538 {
1539 if (status != Ok)
1540 lastStatus = status;
1541 return status;
1542 }
1543
1544 VOID
1545 SetNativeGraphics(GpGraphics *graphics)
1546 {
1547 nativeGraphics = graphics;
1548 }
1549
1550 protected:
1551 GpGraphics *nativeGraphics;
1552 mutable Status lastStatus;
1553
1554 // get native
1555 friend inline GpGraphics *&
1556 getNat(const Graphics *graph)
1557 {
1558 return const_cast<Graphics *>(graph)->nativeGraphics;
1559 }
1560 };
1561
1562 #endif /* _GDIPLUSGRAPHICS_H */