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