705150bae9b0c8ded5ff2ff8530f1fdd7327dcb0
[mono.git] / mcs / class / System.Drawing / System.Drawing / impl / wine / Graphics.cs
1 //
2 // System.Drawing.Bitmap.cs
3 //
4 // (C) 2003 Ximian, Inc.  http://www.ximian.com
5 //
6 // Authors:
7 //      Gonzalo Paniagua Javier (gonzalo@ximian.com) (stubbed out)
8 //  Alexandre Pigolkine (pigolkine@gmx.de)
9 //
10 using System;
11 using System.Drawing;
12 using System.Drawing.Drawing2D;
13 using System.Drawing.Imaging;
14 using System.Drawing.Text;
15 using System.Runtime.InteropServices;
16
17 namespace System.Drawing
18 {
19         namespace Win32Impl     {
20
21                 internal class GraphicsFactory : IGraphicsFactory {
22
23                         public System.Drawing.IGraphics Graphics(IntPtr nativeGraphics) {
24                                 return new Graphics(nativeGraphics);
25                         }
26
27                         public System.Drawing.IGraphics FromImage(System.Drawing.Image image) {
28                                 return Win32Impl.Graphics.FromImage(image);
29                         }
30
31                         public System.Drawing.IGraphics FromHwnd( IntPtr hwnd) {
32                                 return Win32Impl.Graphics.FromHwnd(hwnd);
33                         }
34                 }
35
36
37                 [ComVisible(false)]
38                 internal sealed class Graphics : MarshalByRefObject, IGraphics
39                 {
40                         public delegate bool EnumerateMetafileProc (EmfPlusRecordType recordType,
41                                 int flags,
42                                 int dataSize,
43                                 IntPtr data,
44                                 PlayRecordCallback callbackData);
45
46                         public delegate bool DrawImageAbort (IntPtr callbackData);
47
48                         internal enum GraphicsType {
49                                 fromHdc, fromHwnd, fromImage
50                         };
51
52                         internal GraphicsType type_;
53                         internal IntPtr hdc_ = IntPtr.Zero;
54                         internal IntPtr initialBitmap_ = IntPtr.Zero;
55                         internal IntPtr initialHwnd_ = IntPtr.Zero;
56                         internal System.Drawing.Win32Impl.Image initializedFromImage_ = null;
57
58                         internal Graphics (IntPtr nativeGraphics)
59                         {
60                                 hdc_ = nativeGraphics;
61                         }
62
63                         #region Converters
64                         internal static Pen ConvertPen( System.Drawing.Pen pen) 
65                         {
66                                 return pen.implementation_ as Pen;
67                         }
68
69                         internal static Brush ConvertBrush( System.Drawing.Brush brush) 
70                         {
71                                 return brush.implementation_ as Brush;
72                         }
73
74                         internal static Image ConvertImage( System.Drawing.Image image) 
75                         {
76                                 return image.implementation_ as Image;
77                         }
78                         #endregion
79
80                         [MonoTODO]
81                         void IGraphics.AddMetafileComment (byte [] data)
82                         {
83                                 throw new NotImplementedException ();
84                         }
85
86                         [MonoTODO]
87                         GraphicsContainer IGraphics.BeginContainer ()
88                         {
89                                 throw new NotImplementedException ();
90                         }
91
92                         [MonoTODO]
93                         GraphicsContainer IGraphics.BeginContainer (Rectangle dstrect, Rectangle srcrect, GraphicsUnit unit)
94                         {
95                                 throw new NotImplementedException ();
96                         }
97
98                         [MonoTODO]
99                         GraphicsContainer IGraphics.BeginContainer (RectangleF dstrect, RectangleF srcrect, GraphicsUnit unit)
100                         {
101                                 throw new NotImplementedException ();
102                         }
103
104                         [MonoTODO]
105                         void IGraphics.Clear (Color color)
106                         {
107                                 throw new NotImplementedException ();
108                         }
109
110                         [MonoTODO]
111                         void IDisposable.Dispose ()
112                         {
113                                 switch(type_) {
114                                         case GraphicsType.fromHwnd:
115                                                 Win32.ReleaseDC(initialHwnd_, hdc_);
116                                                 break;
117                                         case GraphicsType.fromHdc:
118                                                 break;
119                                         case GraphicsType.fromImage:
120                                                 Win32.SelectObject(hdc_, initialBitmap_);
121                                                 initializedFromImage_.selectedIntoGraphics_ = null;
122                                                 break;
123                                 }
124                         }
125
126                         [MonoTODO]
127                         void IGraphics.DrawArc (System.Drawing.Pen pen, Rectangle rect, float startAngle, float sweepAngle)
128                         {
129                                 throw new NotImplementedException ();
130                         }
131
132                         [MonoTODO]
133                         void IGraphics.DrawArc (System.Drawing.Pen pen, RectangleF rect, float startAngle, float sweepAngle)
134                         {
135                                 throw new NotImplementedException ();
136                         }
137
138                         [MonoTODO]
139                         void IGraphics.DrawArc (System.Drawing.Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
140                         {
141                                 throw new NotImplementedException ();
142                         }
143
144                         [MonoTODO]
145                         void IGraphics.DrawArc (System.Drawing.Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
146                         {
147                                 throw new NotImplementedException ();
148                         }
149
150                         [MonoTODO]
151                         void IGraphics.DrawBezier (System.Drawing.Pen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4)
152                         {
153                                 throw new NotImplementedException ();
154                         }
155
156                         [MonoTODO]
157                         void IGraphics.DrawBezier (System.Drawing.Pen pen, Point pt1, Point pt2, Point pt3, Point pt4)
158                         {
159                                 throw new NotImplementedException ();
160                         }
161
162                         [MonoTODO]
163                         void IGraphics.DrawBezier (System.Drawing.Pen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
164                         {
165                                 throw new NotImplementedException ();
166                         }
167
168                         [MonoTODO]
169                         void IGraphics.DrawBeziers (System.Drawing.Pen pen, Point [] points)
170                         {
171                                 throw new NotImplementedException ();
172                         }
173
174                         [MonoTODO]
175                         void IGraphics.DrawBeziers (System.Drawing.Pen pen, PointF [] points)
176                         {
177                                 throw new NotImplementedException ();
178                         }
179
180                         [MonoTODO]
181                         void IGraphics.DrawClosedCurve (System.Drawing.Pen pen, PointF [] points)
182                         {
183                                 throw new NotImplementedException ();
184                         }
185
186                         [MonoTODO]
187                         void IGraphics.DrawClosedCurve (System.Drawing.Pen pen, Point [] points)
188                         {
189                                 throw new NotImplementedException ();
190                         }
191
192                         [MonoTODO]
193                         void IGraphics.DrawClosedCurve (System.Drawing.Pen pen, Point [] points, float tension, FillMode fillmode)
194                         {
195                                 throw new NotImplementedException ();
196                         }
197
198                         [MonoTODO]
199                         void IGraphics.DrawClosedCurve (System.Drawing.Pen pen, PointF [] points, float tension, FillMode fillmode)
200                         {
201                                 throw new NotImplementedException ();
202                         }
203
204                         [MonoTODO]
205                         void IGraphics.DrawCurve (System.Drawing.Pen pen, Point [] points)
206                         {
207                                 throw new NotImplementedException ();
208                         }
209
210                         [MonoTODO]
211                         void IGraphics.DrawCurve (System.Drawing.Pen pen, PointF [] points)
212                         {
213                                 throw new NotImplementedException ();
214                         }
215
216                         [MonoTODO]
217                         void IGraphics.DrawCurve (System.Drawing.Pen pen, PointF [] points, float tension)
218                         {
219                                 throw new NotImplementedException ();
220                         }
221
222                         [MonoTODO]
223                         void IGraphics.DrawCurve (System.Drawing.Pen pen, Point [] points, float tension)
224                         {
225                                 throw new NotImplementedException ();
226                         }
227
228                         [MonoTODO]
229                         void IGraphics.DrawCurve (System.Drawing.Pen pen, PointF [] points, int offset, int numberOfSegments)
230                         {
231                                 throw new NotImplementedException ();
232                         }
233
234                         [MonoTODO]
235                         void IGraphics.DrawCurve (System.Drawing.Pen pen, Point [] points, int offset, int numberOfSegments, float tension)
236                         {
237                                 throw new NotImplementedException ();
238                         }
239
240                         [MonoTODO]
241                         void IGraphics.DrawCurve (System.Drawing.Pen pen, PointF [] points, int offset, int numberOfSegments, float tension)
242                         {
243                                 throw new NotImplementedException ();
244                         }
245
246                         [MonoTODO]
247                         void IGraphics.DrawEllipse (System.Drawing.Pen pen, Rectangle rect)
248                         {
249                                 throw new NotImplementedException ();
250                         }
251
252                         [MonoTODO]
253                         void IGraphics.DrawEllipse (System.Drawing.Pen pen, RectangleF rect)
254                         {
255                                 throw new NotImplementedException ();
256                         }
257
258                         [MonoTODO]
259                         void IGraphics.DrawEllipse (System.Drawing.Pen pen, int x, int y, int width, int height)
260                         {
261                                 throw new NotImplementedException ();
262                         }
263
264                         [MonoTODO]
265                         void IGraphics.DrawEllipse (System.Drawing.Pen pen, float x, float y, float width, float height)
266                         {
267                                 throw new NotImplementedException ();
268                         }
269
270                         [MonoTODO]
271                         void IGraphics.DrawIcon (System.Drawing.Icon icon, Rectangle targetRect)
272                         {
273                                 throw new NotImplementedException ();
274                         }
275
276                         [MonoTODO]
277                         void IGraphics.DrawIcon (System.Drawing.Icon icon, int x, int y)
278                         {
279                                 throw new NotImplementedException ();
280                         }
281
282                         [MonoTODO]
283                         void IGraphics.DrawIconUnstretched (System.Drawing.Icon icon, Rectangle targetRect)
284                         {
285                                 throw new NotImplementedException ();
286                         }
287
288                         [MonoTODO]
289                         void IGraphics.DrawImage (System.Drawing.Image image, RectangleF rect)
290                         {
291                                 throw new NotImplementedException ();
292                         }
293
294                         [MonoTODO]
295                         void IGraphics.DrawImage (System.Drawing.Image image, PointF point)
296                         {
297                                 throw new NotImplementedException ();
298                         }
299
300                         [MonoTODO]
301                         void IGraphics.DrawImage (System.Drawing.Image image, Point [] destPoints)
302                         {
303                                 throw new NotImplementedException ();
304                         }
305
306                         [MonoTODO]
307                         void IGraphics.DrawImage (System.Drawing.Image image, Point point)
308                         {
309                                 throw new NotImplementedException ();
310                         }
311
312                         [MonoTODO]
313                         void IGraphics.DrawImage (System.Drawing.Image image, Rectangle rect)
314                         {
315                                 throw new NotImplementedException ();
316                         }
317
318                         [MonoTODO]
319                         void IGraphics.DrawImage (System.Drawing.Image image, PointF [] destPoints)
320                         {
321                                 throw new NotImplementedException ();
322                         }
323
324                         [MonoTODO]
325                         void IGraphics.DrawImage (System.Drawing.Image image, int x, int y)
326                         {
327                                 throw new NotImplementedException ();
328                         }
329
330                         [MonoTODO]
331                         void IGraphics.DrawImage (System.Drawing.Image image, float x, float y)
332                         {
333                                 throw new NotImplementedException ();
334                         }
335
336                         [MonoTODO]
337                         void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit)
338                         {
339                                 throw new NotImplementedException ();
340                         }
341
342                         [MonoTODO]
343                         void IGraphics.DrawImage (System.Drawing.Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit)
344                         {
345                                 throw new NotImplementedException ();
346                         }
347
348                         [MonoTODO]
349                         void IGraphics.DrawImage (System.Drawing.Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit)
350                         {
351                                 throw new NotImplementedException ();
352                         }
353
354                         [MonoTODO]
355                         void IGraphics.DrawImage (System.Drawing.Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit)
356                         {
357                                 throw new NotImplementedException ();
358                         }
359
360                         [MonoTODO]
361                         void IGraphics.DrawImage (System.Drawing.Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr)
362                         {
363                                 throw new NotImplementedException ();
364                         }
365
366                         [MonoTODO]
367                         void IGraphics.DrawImage (System.Drawing.Image image, float x, float y, float width, float height)
368                         {
369                                 throw new NotImplementedException ();
370                         }
371
372                         [MonoTODO]
373                         void IGraphics.DrawImage (System.Drawing.Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr)
374                         {
375                                 throw new NotImplementedException ();
376                         }
377
378                         [MonoTODO]
379                         void IGraphics.DrawImage (System.Drawing.Image image, int x, int y, Rectangle srcRect, GraphicsUnit srcUnit)
380                         {
381                                 throw new NotImplementedException ();
382                         }
383
384                         [MonoTODO]
385                         void IGraphics.DrawImage (System.Drawing.Image image, int x, int y, int width, int height)
386                         {
387                                 System.Drawing.Win32Impl.Image wineImage = image.implementation_ as System.Drawing.Win32Impl.Image;
388                                 Graphics imageGraphics = wineImage.selectedIntoGraphics_;
389                                 if( imageGraphics == null) {
390                                         IntPtr tempDC = Win32.CreateCompatibleDC (hdc_);
391                                         IntPtr oldBmp = Win32.SelectObject (tempDC, wineImage.nativeObject_);
392                                         Win32.BitBlt(hdc_, x, y, width, height, tempDC, 0, 0, PatBltTypes.SRCCOPY);
393                                         Win32.SelectObject (tempDC, oldBmp);
394                                         Win32.DeleteDC (tempDC);
395                                 }
396                                 else {
397                                         Win32.BitBlt(hdc_, x, y, width, height, imageGraphics.hdc_, 0, 0, PatBltTypes.SRCCOPY);
398                                 }
399                         }
400
401                         [MonoTODO]
402                         void IGraphics.DrawImage (System.Drawing.Image image, float x, float y, RectangleF srcRect, GraphicsUnit srcUnit)
403                         {
404                                 throw new NotImplementedException ();
405                         }
406
407                         [MonoTODO]
408                         void IGraphics.DrawImage (System.Drawing.Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, System.Drawing.Graphics.DrawImageAbort callback)
409                         {
410                                 throw new NotImplementedException ();
411                         }
412
413                         [MonoTODO]
414                         void IGraphics.DrawImage (System.Drawing.Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, System.Drawing.Graphics.DrawImageAbort callback)
415                         {
416                                 throw new NotImplementedException ();
417                         }
418
419                         [MonoTODO]
420                         void IGraphics.DrawImage (System.Drawing.Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, System.Drawing.Graphics.DrawImageAbort callback, int callbackData)
421                         {
422                                 throw new NotImplementedException ();
423                         }
424
425                         [MonoTODO]
426                         void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit)
427                         {
428                                 throw new NotImplementedException ();
429                         }
430
431                         [MonoTODO]
432                         void IGraphics.DrawImage (System.Drawing.Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, System.Drawing.Graphics.DrawImageAbort callback, int callbackData)
433                         {
434                                 throw new NotImplementedException ();
435                         }
436
437                         [MonoTODO]
438                         void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit)
439                         {
440                                 throw new NotImplementedException ();
441                         }
442
443                         [MonoTODO]
444                         void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs)
445                         {
446                                 throw new NotImplementedException ();
447                         }
448
449                         [MonoTODO]
450                         void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr)
451                         {
452                                 throw new NotImplementedException ();
453                         }
454
455                         [MonoTODO]
456                         void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, System.Drawing.Graphics.DrawImageAbort callback)
457                         {
458                                 throw new NotImplementedException ();
459                         }
460
461                         [MonoTODO]
462                         void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, System.Drawing.Graphics.DrawImageAbort callback)
463                         {
464                                 throw new NotImplementedException ();
465                         }
466
467                         [MonoTODO]
468                         void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, System.Drawing.Graphics.DrawImageAbort callback, IntPtr callbackData)
469                         {
470                                 throw new NotImplementedException ();
471                         }
472
473                         [MonoTODO]
474                         void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, System.Drawing.Graphics.DrawImageAbort callback, IntPtr callbackData)
475                         {
476                                 throw new NotImplementedException ();
477                         }
478
479                         [MonoTODO]
480                         void IGraphics.DrawImageUnscaled (System.Drawing.Image image, Point point)
481                         {
482                                 throw new NotImplementedException ();
483                         }
484
485                         [MonoTODO]
486                         void IGraphics.DrawImageUnscaled (System.Drawing.Image image, Rectangle rect)
487                         {
488                                 throw new NotImplementedException ();
489                         }
490
491                         [MonoTODO]
492                         void IGraphics.DrawImageUnscaled (System.Drawing.Image image, int x, int y)
493                         {
494                                 throw new NotImplementedException ();
495                         }
496
497                         [MonoTODO]
498                         void IGraphics.DrawImageUnscaled (System.Drawing.Image image, int x, int y, int width, int height)
499                         {
500                                 throw new NotImplementedException ();
501                         }
502
503                         [MonoTODO]
504                         void IGraphics.DrawLine (System.Drawing.Pen pen, PointF pt1, PointF pt2)
505                         {
506                                 throw new NotImplementedException ();
507                         }
508
509                         [MonoTODO]
510                         void IGraphics.DrawLine (System.Drawing.Pen pen, Point pt1, Point pt2)
511                         {
512                                 throw new NotImplementedException ();
513                         }
514
515                         [MonoTODO]
516                         void IGraphics.DrawLine (System.Drawing.Pen pen, int x1, int y1, int x2, int y2)
517                         {
518                                 throw new NotImplementedException ();
519                         }
520
521                         [MonoTODO]
522                         void IGraphics.DrawLine (System.Drawing.Pen pen, float x1, float y1, float x2, float y2)
523                         {
524                                 throw new NotImplementedException ();
525                         }
526
527                         [MonoTODO]
528                         void IGraphics.DrawLines (System.Drawing.Pen pen, PointF [] points)
529                         {
530                                 throw new NotImplementedException ();
531                         }
532
533                         [MonoTODO]
534                         void IGraphics.DrawLines (System.Drawing.Pen pen, Point [] points)
535                         {
536                                 throw new NotImplementedException ();
537                         }
538
539                         [MonoTODO]
540                         void IGraphics.DrawPath (System.Drawing.Pen pen, GraphicsPath path)
541                         {
542                                 throw new NotImplementedException ();
543                         }
544
545                         [MonoTODO]
546                         void IGraphics.DrawPie (System.Drawing.Pen pen, Rectangle rect, float startAngle, float sweepAngle)
547                         {
548                                 throw new NotImplementedException ();
549                         }
550
551                         [MonoTODO]
552                         void IGraphics.DrawPie (System.Drawing.Pen pen, RectangleF rect, float startAngle, float sweepAngle)
553                         {
554                                 throw new NotImplementedException ();
555                         }
556
557                         [MonoTODO]
558                         void IGraphics.DrawPie (System.Drawing.Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
559                         {
560                                 throw new NotImplementedException ();
561                         }
562
563                         [MonoTODO]
564                         void IGraphics.DrawPie (System.Drawing.Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
565                         {
566                                 throw new NotImplementedException ();
567                         }
568
569                         [MonoTODO]
570                         void IGraphics.DrawPolygon (System.Drawing.Pen pen, Point [] points)
571                         {
572                                 throw new NotImplementedException ();
573                         }
574
575                         [MonoTODO]
576                         void IGraphics.DrawPolygon (System.Drawing.Pen pen, PointF [] points)
577                         {
578                                 throw new NotImplementedException ();
579                         }
580
581                         [MonoTODO]
582                         void IGraphics.DrawRectangle (System.Drawing.Pen pen, Rectangle rect)
583                         {
584                                 DrawRectangle(ConvertPen(pen), rect.Left, rect.Top, rect.Width, rect.Height);
585                         }
586
587                         [MonoTODO]
588                         void IGraphics.DrawRectangle (System.Drawing.Pen pen, float x, float y, float width, float height)
589                         {
590                                 DrawRectangle(ConvertPen(pen), (int)x, (int)y, (int)width, (int)height);
591                         }
592
593                         void DrawRectangle (Pen winePen, int x, int y, int width, int height)
594                         {
595                                 POINT[] pts = new POINT[5];
596                                 pts[0].x = x;
597                                 pts[0].y = y;
598                                 pts[1].x = x;
599                                 pts[1].y = y + height;
600                                 pts[2].x = x + width;
601                                 pts[2].y = y + height;
602                                 pts[3].x = x + width;
603                                 pts[3].y = y;
604                                 pts[4].x = x;
605                                 pts[4].y = y;
606                                 IntPtr oldPen = Win32.SelectObject(hdc_, winePen.hpen_);
607                                 Win32.Polyline( hdc_, pts, 5);
608                                 Win32.SelectObject(hdc_, oldPen);
609                         }
610
611                         [MonoTODO]
612                         void IGraphics.DrawRectangle (System.Drawing.Pen pen, int x, int y, int width, int height)
613                         {
614                                 DrawRectangle(ConvertPen(pen), x, y, width, height);
615                         }
616
617                         [MonoTODO]
618                         void IGraphics.DrawRectangles (System.Drawing.Pen pen, RectangleF [] rects)
619                         {
620                                 foreach( RectangleF rc in rects) 
621                                 {
622                                         DrawRectangle(ConvertPen(pen), (int)rc.Left, (int)rc.Top, (int)rc.Width, (int)rc.Height);
623                                 }
624                         }
625
626                         [MonoTODO]
627                         void IGraphics.DrawRectangles (System.Drawing.Pen pen, Rectangle [] rects)
628                         {
629                                 foreach( RectangleF rc in rects) 
630                                 {
631                                         DrawRectangle(ConvertPen(pen), (int)rc.Left, (int)rc.Top, (int)rc.Width, (int)rc.Height);
632                                 }
633                         }
634
635                         [MonoTODO]
636                         void IGraphics.DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, RectangleF layoutRectangle)
637                         {
638                                 //throw new NotImplementedException ();
639                         }
640
641                         [MonoTODO]
642                         void IGraphics.DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, PointF point)
643                         {
644                                 //throw new NotImplementedException ();
645                         }
646
647                         [MonoTODO]
648                         void IGraphics.DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, PointF point, StringFormat format)
649                         {
650                                 //throw new NotImplementedException ();
651                         }
652
653                         [MonoTODO]
654                         void IGraphics.DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, RectangleF layoutRectangle, StringFormat format)
655                         {
656                                 //throw new NotImplementedException ();
657                                 RECT rc = new RECT();
658                                 rc.left = (int)layoutRectangle.Left;
659                                 rc.top = (int)layoutRectangle.Top;
660                                 rc.right = (int)layoutRectangle.Right;
661                                 rc.bottom = (int)layoutRectangle.Bottom;
662                                 IntPtr prevFont = Win32.SelectObject(hdc_, font.ToHfont());
663                                 Win32.SetTextColor(hdc_, Win32.RGB(((IBrush)ConvertBrush(brush)).TextColor));
664                                 Win32.SetBkMode(hdc_, BackgroundMode.TRANSPARENT);
665                                 Win32.ExtTextOut(hdc_, (int)layoutRectangle.Left, (int)layoutRectangle.Top, 0, ref rc, 
666                                         s, s.Length, IntPtr.Zero);
667                                 Win32.SelectObject(hdc_, prevFont);
668                         }
669
670                         [MonoTODO]
671                         void IGraphics.DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, float x, float y)
672                         {
673                                 IntPtr prevFont = Win32.SelectObject(hdc_, font.ToHfont());
674                                 Win32.SetTextColor(hdc_, Win32.RGB(((IBrush)ConvertBrush(brush)).TextColor));
675                                 Win32.SetBkMode(hdc_, BackgroundMode.TRANSPARENT);
676                                 Win32.ExtTextOut(hdc_, (int)x, (int)y, 0, IntPtr.Zero, 
677                                         s, s.Length, IntPtr.Zero);
678                                 Win32.SelectObject(hdc_, prevFont);
679                         }
680
681                         [MonoTODO]
682                         void IGraphics.DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, float x, float y, StringFormat format)
683                         {
684                                 //throw new NotImplementedException ();
685                         }
686
687                         [MonoTODO]
688                         void IGraphics.EndContainer (GraphicsContainer container)
689                         {
690                                 throw new NotImplementedException ();
691                         }
692
693                         [MonoTODO]
694                         void IGraphics.EnumerateMetafile (Metafile metafile, Point [] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback)
695                         {
696                                 throw new NotImplementedException ();
697                         }
698
699                         [MonoTODO]
700                         void IGraphics.EnumerateMetafile (Metafile metafile, RectangleF destRect, System.Drawing.Graphics.EnumerateMetafileProc callback)
701                         {
702                                 throw new NotImplementedException ();
703                         }
704
705                         [MonoTODO]
706                         void IGraphics.EnumerateMetafile (Metafile metafile, PointF [] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback)
707                         {
708                                 throw new NotImplementedException ();
709                         }
710
711                         [MonoTODO]
712                         void IGraphics.EnumerateMetafile (Metafile metafile, Rectangle destRect, System.Drawing.Graphics.EnumerateMetafileProc callback)
713                         {
714                                 throw new NotImplementedException ();
715                         }
716
717                         [MonoTODO]
718                         void IGraphics.EnumerateMetafile (Metafile metafile, Point destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback)
719                         {
720                                 throw new NotImplementedException ();
721                         }
722
723                         [MonoTODO]
724                         void IGraphics.EnumerateMetafile (Metafile metafile, PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback)
725                         {
726                                 throw new NotImplementedException ();
727                         }
728
729                         [MonoTODO]
730                         void IGraphics.EnumerateMetafile (Metafile metafile, PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
731                         {
732                                 throw new NotImplementedException ();
733                         }
734
735                         [MonoTODO]
736                         void IGraphics.EnumerateMetafile (Metafile metafile, Rectangle destRect, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
737                         {
738                                 throw new NotImplementedException ();
739                         }
740
741                         [MonoTODO]
742                         void IGraphics.EnumerateMetafile (Metafile metafile, PointF [] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
743                         {
744                                 throw new NotImplementedException ();
745                         }
746
747                         [MonoTODO]
748                         void IGraphics.EnumerateMetafile (Metafile metafile, Point destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
749                         {
750                                 throw new NotImplementedException ();
751                         }
752
753                         [MonoTODO]
754                         void IGraphics.EnumerateMetafile (Metafile metafile, Point [] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
755                         {
756                                 throw new NotImplementedException ();
757                         }
758
759                         [MonoTODO]
760                         void IGraphics.EnumerateMetafile (Metafile metafile, RectangleF destRect, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
761                         {
762                                 throw new NotImplementedException ();
763                         }
764
765                         [MonoTODO]
766                         void IGraphics.EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback)
767                         {
768                                 throw new NotImplementedException ();
769                         }
770
771                         [MonoTODO]
772                         void IGraphics.EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback)
773                         {
774                                 throw new NotImplementedException ();
775                         }
776
777                         [MonoTODO]
778                         void IGraphics.EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback)
779                         {
780                                 throw new NotImplementedException ();
781                         }
782
783                         [MonoTODO]
784                         void IGraphics.EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback)
785                         {
786                                 throw new NotImplementedException ();
787                         }
788
789                         [MonoTODO]
790                         void IGraphics.EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback)
791                         {
792                                 throw new NotImplementedException ();
793                         }
794
795                         [MonoTODO]
796                         void IGraphics.EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback)
797                         {
798                                 throw new NotImplementedException ();
799                         }
800
801                         [MonoTODO]
802                         void IGraphics.EnumerateMetafile (Metafile metafile, RectangleF destRect, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
803                         {
804                                 throw new NotImplementedException ();
805                         }
806
807                         [MonoTODO]
808                         void IGraphics.EnumerateMetafile (Metafile metafile, Point destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
809                         {
810                                 throw new NotImplementedException ();
811                         }
812
813                         [MonoTODO]
814                         void IGraphics.EnumerateMetafile (Metafile metafile, PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
815                         {
816                                 throw new NotImplementedException ();
817                         }
818
819                         [MonoTODO]
820                         void IGraphics.EnumerateMetafile (Metafile metafile, Point [] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
821                         {
822                                 throw new NotImplementedException ();
823                         }
824
825                         [MonoTODO]
826                         void IGraphics.EnumerateMetafile (Metafile metafile, PointF [] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
827                         {
828                                 throw new NotImplementedException ();
829                         }
830
831                         [MonoTODO]
832                         void IGraphics.EnumerateMetafile (Metafile metafile, Rectangle destRect, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
833                         {
834                                 throw new NotImplementedException ();
835                         }
836
837                         [MonoTODO]
838                         void IGraphics.EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
839                         {
840                                 throw new NotImplementedException ();
841                         }
842
843                         [MonoTODO]
844                         void IGraphics.EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
845                         {
846                                 throw new NotImplementedException ();
847                         }
848
849                         [MonoTODO]
850                         void IGraphics.EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
851                         {
852                                 throw new NotImplementedException ();
853                         }
854
855                         [MonoTODO]
856                         void IGraphics.EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
857                         {
858                                 throw new NotImplementedException ();
859                         }
860
861                         [MonoTODO]
862                         void IGraphics.EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
863                         {
864                                 throw new NotImplementedException ();
865                         }
866
867                         [MonoTODO]
868                         void IGraphics.EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
869                         {
870                                 throw new NotImplementedException ();
871                         }
872
873                         [MonoTODO]
874                         void IGraphics.EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
875                         {
876                                 throw new NotImplementedException ();
877                         }
878
879                         [MonoTODO]
880                         void IGraphics.EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
881                         {
882                                 throw new NotImplementedException ();
883                         }
884
885                         [MonoTODO]
886                         void IGraphics.EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
887                         {
888                                 throw new NotImplementedException ();
889                         }
890
891                         [MonoTODO]
892                         void IGraphics.EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
893                         {
894                                 throw new NotImplementedException ();
895                         }
896
897                         [MonoTODO]
898                         void IGraphics.EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
899                         {
900                                 throw new NotImplementedException ();
901                         }
902
903                         [MonoTODO]
904                         void IGraphics.EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
905                         {
906                                 throw new NotImplementedException ();
907                         }
908
909                         [MonoTODO]
910                         void IGraphics.ExcludeClip (Rectangle rect)
911                         {
912                                 throw new NotImplementedException ();
913                         }
914
915                         [MonoTODO]
916                         void IGraphics.ExcludeClip (System.Drawing.Region region)
917                         {
918                                 throw new NotImplementedException ();
919                         }
920
921                         [MonoTODO]
922                         void IGraphics.FillClosedCurve (System.Drawing.Brush brush, PointF [] points)
923                         {
924                                 throw new NotImplementedException ();
925                         }
926
927                         [MonoTODO]
928                         void IGraphics.FillClosedCurve (System.Drawing.Brush brush, Point [] points)
929                         {
930                                 throw new NotImplementedException ();
931                         }
932
933                         [MonoTODO]
934                         void IGraphics.FillClosedCurve (System.Drawing.Brush brush, PointF [] points, FillMode fillmode)
935                         {
936                                 throw new NotImplementedException ();
937                         }
938
939                         [MonoTODO]
940                         void IGraphics.FillClosedCurve (System.Drawing.Brush brush, Point [] points, FillMode fillmode)
941                         {
942                                 throw new NotImplementedException ();
943                         }
944
945                         [MonoTODO]
946                         void IGraphics.FillClosedCurve (System.Drawing.Brush brush, PointF [] points, FillMode fillmode, float tension)
947                         {
948                                 throw new NotImplementedException ();
949                         }
950
951                         [MonoTODO]
952                         void IGraphics.FillClosedCurve (System.Drawing.Brush brush, Point [] points, FillMode fillmode, float tension)
953                         {
954                                 throw new NotImplementedException ();
955                         }
956
957                         [MonoTODO]
958                         void IGraphics.FillEllipse (System.Drawing.Brush brush, Rectangle rect)
959                         {
960                                 throw new NotImplementedException ();
961                         }
962
963                         [MonoTODO]
964                         void IGraphics.FillEllipse (System.Drawing.Brush brush, RectangleF rect)
965                         {
966                                 throw new NotImplementedException ();
967                         }
968
969                         [MonoTODO]
970                         void IGraphics.FillEllipse (System.Drawing.Brush brush, float x, float y, float width, float height)
971                         {
972                                 throw new NotImplementedException ();
973                         }
974
975                         [MonoTODO]
976                         void IGraphics.FillEllipse (System.Drawing.Brush brush, int x, int y, int width, int height)
977                         {
978                                 throw new NotImplementedException ();
979                         }
980
981                         [MonoTODO]
982                         void IGraphics.FillPath (System.Drawing.Brush brush, GraphicsPath path)
983                         {
984                                 throw new NotImplementedException ();
985                         }
986
987                         [MonoTODO]
988                         void IGraphics.FillPie (System.Drawing.Brush brush, Rectangle rect, float startAngle, float sweepAngle)
989                         {
990                                 throw new NotImplementedException ();
991                         }
992
993                         [MonoTODO]
994                         void IGraphics.FillPie (System.Drawing.Brush brush, int x, int y, int width, int height, int startAngle, int sweepAngle)
995                         {
996                                 throw new NotImplementedException ();
997                         }
998
999                         [MonoTODO]
1000                         void IGraphics.FillPie (System.Drawing.Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)
1001                         {
1002                                 throw new NotImplementedException ();
1003                         }
1004
1005                         [MonoTODO]
1006                         void IGraphics.FillPolygon (System.Drawing.Brush brush, PointF [] points)
1007                         {
1008                                 throw new NotImplementedException ();
1009                         }
1010
1011                         [MonoTODO]
1012                         void IGraphics.FillPolygon (System.Drawing.Brush brush, Point [] points)
1013                         {
1014                                 throw new NotImplementedException ();
1015                         }
1016
1017                         [MonoTODO]
1018                         void IGraphics.FillPolygon (System.Drawing.Brush brush, Point [] points, FillMode fillMode)
1019                         {
1020                                 throw new NotImplementedException ();
1021                         }
1022
1023                         [MonoTODO]
1024                         void IGraphics.FillPolygon (System.Drawing.Brush brush, PointF [] points, FillMode fillMode)
1025                         {
1026                                 throw new NotImplementedException ();
1027                         }
1028
1029                         [MonoTODO]
1030                         void IGraphics.FillRectangle (System.Drawing.Brush brush, RectangleF rect)
1031                         {
1032                                 FillRectangle( ConvertBrush(brush), (int)rect.Left, (int)rect.Top, (int)rect.Width, (int)rect.Height);
1033                         }
1034
1035                         [MonoTODO]
1036                         void IGraphics.FillRectangle (System.Drawing.Brush brush, Rectangle rect)
1037                         {
1038                                 FillRectangle( ConvertBrush(brush), rect.Left, rect.Top, rect.Width, rect.Height);
1039                         }
1040
1041                         void FillRectangle (Brush wineBrush, RectangleF rect)
1042                         {
1043                                 FillRectangle( wineBrush, (int)rect.Left, (int)rect.Top, (int)rect.Width, (int)rect.Height);
1044                         }
1045
1046                         void FillRectangle (Brush wineBrush, Rectangle rect)
1047                         {
1048                                 FillRectangle( wineBrush, rect.Left, rect.Top, rect.Width, rect.Height);
1049                         }
1050
1051                         void FillRectangle (Brush wineBrush, int x, int y, int width, int height)
1052                         {
1053                                 RECT rc = new RECT();
1054                                 rc.left = x;
1055                                 rc.top = y;
1056                                 rc.right = rc.left + width /*+ 1*/;
1057                                 rc.bottom = rc.top + height /*+ 1*/;
1058                                 Win32.FillRect( hdc_, ref rc, wineBrush.hbrush_);
1059                         }
1060
1061                         [MonoTODO]
1062                         void IGraphics.FillRectangle (System.Drawing.Brush brush, int x, int y, int width, int height)
1063                         {
1064                                 System.Drawing.Win32Impl.Brush wineBrush = ConvertBrush(brush);
1065                                 // Do the job
1066                                 if( wineBrush is SolidBrush) 
1067                                 {
1068                                         FillRectangle(wineBrush, x, y, width, height);
1069                                 }
1070                                 else if( brush is LinearGradientBrush) 
1071                                 {
1072                                         // FIXME: just to indicate 2 colours
1073                                         LinearGradientBrush br = brush as LinearGradientBrush;
1074                                         Color[] colors = br.LinearColors;
1075                                         SolidBrush      sb1 = new SolidBrush(colors[0]);
1076                                         SolidBrush      sb2 = new SolidBrush(colors[1]);
1077                                         // FIXME: find a way to call those
1078                                         FillRectangle(sb1, x, y, width / 2, height);
1079                                         FillRectangle(sb2, x + width / 2, y, width , height);
1080                                         sb1.Dispose();
1081                                         sb2.Dispose();
1082                                 }
1083                         }
1084
1085                         [MonoTODO]
1086                         void IGraphics.FillRectangle (System.Drawing.Brush brush, float x, float y, float width, float height)
1087                         {
1088                                 FillRectangle( ConvertBrush(brush), (int)x, (int)y, (int)width, (int)height);
1089                         }
1090
1091                         [MonoTODO]
1092                         void IGraphics.FillRectangles (System.Drawing.Brush brush, Rectangle [] rects)
1093                         {
1094                                 if(rects != null) 
1095                                 {
1096                                         foreach( Rectangle rc in rects) 
1097                                         {
1098                                                 FillRectangle(ConvertBrush(brush), rc);
1099                                         }
1100                                 }
1101                         }
1102
1103                         [MonoTODO]
1104                         void IGraphics.FillRectangles (System.Drawing.Brush brush, RectangleF [] rects)
1105                         {
1106                                 if(rects != null) 
1107                                 {
1108                                         foreach( RectangleF rc in rects) 
1109                                         {
1110                                                 FillRectangle(ConvertBrush(brush), rc);
1111                                         }
1112                                 }
1113                         }
1114
1115                         [MonoTODO]
1116                         void IGraphics.FillRegion (System.Drawing.Brush brush, System.Drawing.Region region)
1117                         {
1118                                 throw new NotImplementedException ();
1119                         }
1120
1121                         [MonoTODO]
1122                         void IGraphics.Flush ()
1123                         {
1124                                 ((IGraphics)this).Flush(FlushIntention.Flush);
1125                         }
1126
1127                         [MonoTODO]
1128                         void IGraphics.Flush (FlushIntention intention)
1129                         {
1130                                 Win32.GdiFlush ();
1131                         }
1132
1133                         [MonoTODO]
1134                         public static Graphics FromHdc (IntPtr hdc)
1135                         {
1136                                 Graphics result = new Graphics(hdc);
1137                                 result.type_ = GraphicsType.fromHdc;
1138                                 return result;
1139                         }
1140
1141                         [MonoTODO]
1142                         public static Graphics FromHdc (IntPtr hdc, IntPtr hdevice)
1143                         {
1144                                 throw new NotImplementedException ();
1145                         }
1146
1147                         [MonoTODO]
1148                         public static Graphics FromHdcInternal (IntPtr hdc)
1149                         {
1150                                 throw new NotImplementedException ();
1151                         }
1152
1153                         [MonoTODO]
1154                         public static Graphics FromHwnd (IntPtr hwnd)
1155                         {
1156                                 IntPtr hdc = Win32.GetDC(hwnd);
1157                                 Graphics result = new Graphics(hdc);
1158                                 result.type_ = GraphicsType.fromHwnd;
1159                                 return result;
1160                         }
1161
1162                         [MonoTODO]
1163                         public static Graphics FromHwndInternal (IntPtr hwnd)
1164                         {
1165                                 throw new NotImplementedException ();
1166                         }
1167
1168                         [MonoTODO]
1169                         public static Graphics FromImage (System.Drawing.Image image)
1170                         {
1171                                 System.Drawing.Win32Impl.Image  wineImage = ConvertImage(image);
1172                                 IntPtr display = Win32.CreateDC("DISPLAY", "", "", IntPtr.Zero);
1173                                 IntPtr hdc = Win32.CreateCompatibleDC(display);
1174                                 Graphics result = new Graphics( hdc);
1175                                 result.initialBitmap_ = Win32.SelectObject(hdc, wineImage.nativeObject_);
1176                                 wineImage.selectedIntoGraphics_ = result;
1177                                 result.initializedFromImage_ = wineImage;
1178                                 Win32.DeleteDC(display);
1179                                 result.type_ = GraphicsType.fromImage;
1180                                 return result;
1181                         }
1182
1183                         [MonoTODO]
1184                         public static IntPtr GetHalftonePalette ()
1185                         {
1186                                 throw new NotImplementedException ();
1187                         }
1188
1189                         [MonoTODO]
1190                         public IntPtr GetHdc ()
1191                         {
1192                                 return hdc_;
1193                         }
1194
1195                         [MonoTODO]
1196                         public Color GetNearestColor (Color color)
1197                         {
1198                                 throw new NotImplementedException ();
1199                         }
1200
1201                         [MonoTODO]
1202                         void IGraphics.IntersectClip (System.Drawing.Region region)
1203                         {
1204                                 throw new NotImplementedException ();
1205                         }
1206
1207                         [MonoTODO]
1208                         void IGraphics.IntersectClip (RectangleF rect)
1209                         {
1210                                 throw new NotImplementedException ();
1211                         }
1212
1213                         [MonoTODO]
1214                         void IGraphics.IntersectClip (Rectangle rect)
1215                         {
1216                                 throw new NotImplementedException ();
1217                         }
1218
1219                         [MonoTODO]
1220                         public bool IsVisible (Point point)
1221                         {
1222                                 throw new NotImplementedException ();
1223                         }
1224
1225                         [MonoTODO]
1226                         public bool IsVisible (RectangleF rect)
1227                         {
1228                                 throw new NotImplementedException ();
1229                         }
1230
1231                         [MonoTODO]
1232                         public bool IsVisible (PointF point)
1233                         {
1234                                 throw new NotImplementedException ();
1235                         }
1236
1237                         [MonoTODO]
1238                         public bool IsVisible (Rectangle rect)
1239                         {
1240                                 throw new NotImplementedException ();
1241                         }
1242
1243                         [MonoTODO]
1244                         public bool IsVisible (float x, float y)
1245                         {
1246                                 throw new NotImplementedException ();
1247                         }
1248
1249                         [MonoTODO]
1250                         public bool IsVisible (int x, int y)
1251                         {
1252                                 throw new NotImplementedException ();
1253                         }
1254
1255                         [MonoTODO]
1256                         public bool IsVisible (float x, float y, float width, float height)
1257                         {
1258                                 throw new NotImplementedException ();
1259                         }
1260
1261                         [MonoTODO]
1262                         public bool IsVisible (int x, int y, int width, int height)
1263                         {
1264                                 throw new NotImplementedException ();
1265                         }
1266
1267                         [MonoTODO]
1268                         public System.Drawing.Region [] MeasureCharacterRanges (string text, System.Drawing.Font font, RectangleF layoutRect, StringFormat stringFormat)
1269                         {
1270                                 throw new NotImplementedException ();
1271                         }
1272
1273                         [MonoTODO]
1274                         public SizeF MeasureString (string text, System.Drawing.Font font)
1275                         {
1276                                 SIZE sz = new SIZE();
1277                                 IntPtr prevFont = Win32.SelectObject(hdc_, font.ToHfont());
1278                                 Win32.GetTextExtentPoint32(hdc_, text, text.Length, ref sz);
1279                                 Win32.SelectObject(hdc_, prevFont);
1280                                 return new SizeF((float)sz.cx, (float)sz.cy);
1281                         }
1282
1283                         [MonoTODO]
1284                         public SizeF MeasureString (string text, System.Drawing.Font font, SizeF layoutArea)
1285                         {
1286                                 throw new NotImplementedException ();
1287                         }
1288
1289                         [MonoTODO]
1290                         public SizeF MeasureString (string text, System.Drawing.Font font, int width)
1291                         {
1292                                 throw new NotImplementedException ();
1293                         }
1294
1295                         [MonoTODO]
1296                         public SizeF MeasureString (string text, System.Drawing.Font font, SizeF layoutArea, StringFormat stringFormat)
1297                         {
1298                                 throw new NotImplementedException ();
1299                         }
1300
1301                         [MonoTODO]
1302                         public SizeF MeasureString (string text, System.Drawing.Font font, int width, StringFormat format)
1303                         {
1304                                 throw new NotImplementedException ();
1305                         }
1306
1307                         [MonoTODO]
1308                         public SizeF MeasureString (string text, System.Drawing.Font font, PointF origin, StringFormat stringFormat)
1309                         {
1310                                 throw new NotImplementedException ();
1311                         }
1312
1313                         [MonoTODO]
1314                         public SizeF MeasureString (string text, System.Drawing.Font font, SizeF layoutArea, StringFormat stringFormat, ref int charactersFitted, ref int linesFilled)
1315                         {
1316                                 throw new NotImplementedException ();
1317                         }
1318
1319                         [MonoTODO]
1320                         void IGraphics.MultiplyTransform (Matrix matrix)
1321                         {
1322                                 throw new NotImplementedException ();
1323                         }
1324
1325                         [MonoTODO]
1326                         void IGraphics.MultiplyTransform (Matrix matrix, MatrixOrder order)
1327                         {
1328                                 throw new NotImplementedException ();
1329                         }
1330
1331                         [MonoTODO]
1332                         internal void ReleaseHdc (IntPtr hdc)
1333                         {
1334                         }
1335
1336                         [MonoTODO]
1337                         void IGraphics.ReleaseHdc (IntPtr hdc)
1338                         {
1339                         }
1340
1341                         [MonoTODO]
1342                         void IGraphics.ReleaseHdcInternal (IntPtr hdc)
1343                         {
1344                                 throw new NotImplementedException ();
1345                         }
1346
1347                         [MonoTODO]
1348                         void IGraphics.ResetClip ()
1349                         {
1350                                 throw new NotImplementedException ();
1351                         }
1352
1353                         [MonoTODO]
1354                         void IGraphics.ResetTransform ()
1355                         {
1356                                 throw new NotImplementedException ();
1357                         }
1358
1359                         [MonoTODO]
1360                         void IGraphics.Restore (GraphicsState gstate)
1361                         {
1362                                 throw new NotImplementedException ();
1363                         }
1364
1365                         [MonoTODO]
1366                         void IGraphics.RotateTransform (float angle)
1367                         {
1368                                 throw new NotImplementedException ();
1369                         }
1370
1371                         [MonoTODO]
1372                         void IGraphics.RotateTransform (float angle, MatrixOrder order)
1373                         {
1374                                 throw new NotImplementedException ();
1375                         }
1376
1377                         [MonoTODO]
1378                         public GraphicsState Save ()
1379                         {
1380                                 throw new NotImplementedException ();
1381                         }
1382
1383                         [MonoTODO]
1384                         void IGraphics.ScaleTransform (float sx, float sy)
1385                         {
1386                                 throw new NotImplementedException ();
1387                         }
1388
1389                         [MonoTODO]
1390                         void IGraphics.ScaleTransform (float sx, float sy, MatrixOrder order)
1391                         {
1392                                 throw new NotImplementedException ();
1393                         }
1394
1395                         [MonoTODO]
1396                         void IGraphics.SetClip (RectangleF rect)
1397                         {
1398                                 throw new NotImplementedException ();
1399                         }
1400
1401                         [MonoTODO]
1402                         void IGraphics.SetClip (GraphicsPath path)
1403                         {
1404                                 throw new NotImplementedException ();
1405                         }
1406
1407                         [MonoTODO]
1408                         void IGraphics.SetClip (Rectangle rect)
1409                         {
1410                                 throw new NotImplementedException ();
1411                         }
1412
1413                         [MonoTODO]
1414                         void IGraphics.SetClip (System.Drawing.Graphics g)
1415                         {
1416                                 throw new NotImplementedException ();
1417                         }
1418
1419                         [MonoTODO]
1420                         void IGraphics.SetClip (System.Drawing.Graphics g, CombineMode combineMode)
1421                         {
1422                                 throw new NotImplementedException ();
1423                         }
1424
1425                         [MonoTODO]
1426                         void IGraphics.SetClip (Rectangle rect, CombineMode combineMode)
1427                         {
1428                                 throw new NotImplementedException ();
1429                         }
1430
1431                         [MonoTODO]
1432                         void IGraphics.SetClip (RectangleF rect, CombineMode combineMode)
1433                         {
1434                                 throw new NotImplementedException ();
1435                         }
1436
1437                         [MonoTODO]
1438                         void IGraphics.SetClip (System.Drawing.Region region, CombineMode combineMode)
1439                         {
1440                                 throw new NotImplementedException ();
1441                         }
1442
1443                         [MonoTODO]
1444                         void IGraphics.SetClip (GraphicsPath path, CombineMode combineMode)
1445                         {
1446                                 throw new NotImplementedException ();
1447                         }
1448
1449                         [MonoTODO]
1450                         void IGraphics.TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, PointF [] pts)
1451                         {
1452                                 throw new NotImplementedException ();
1453                         }
1454
1455                         [MonoTODO]
1456                         void IGraphics.TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, Point [] pts)
1457                         {
1458                                 throw new NotImplementedException ();
1459                         }
1460
1461                         [MonoTODO]
1462                         void IGraphics.TranslateClip (int dx, int dy)
1463                         {
1464                                 throw new NotImplementedException ();
1465                         }
1466
1467                         [MonoTODO]
1468                         void IGraphics.TranslateClip (float dx, float dy)
1469                         {
1470                                 throw new NotImplementedException ();
1471                         }
1472
1473                         [MonoTODO]
1474                         void IGraphics.TranslateTransform (float dx, float dy)
1475                         {
1476                                 throw new NotImplementedException ();
1477                         }
1478
1479                         [MonoTODO]
1480                         void IGraphics.TranslateTransform (float dx, float dy, MatrixOrder order)
1481                         {
1482                                 throw new NotImplementedException ();
1483                         }
1484
1485                         System.Drawing.Region System.Drawing.IGraphics.Clip
1486                         {
1487                                 get 
1488                                 {
1489                                         throw new NotImplementedException ();
1490                                 }
1491                                 set 
1492                                 {
1493                                         //throw new NotImplementedException ();
1494                                 }
1495                         }
1496
1497                         RectangleF IGraphics.ClipBounds
1498                         {
1499                                 get 
1500                                 {
1501                                         throw new NotImplementedException ();
1502                                 }
1503                         }
1504
1505                         CompositingMode IGraphics.CompositingMode
1506                         {
1507                                 get 
1508                                 {
1509                                         throw new NotImplementedException ();
1510                                 }
1511                                 set 
1512                                 {
1513                                         throw new NotImplementedException ();
1514                                 }
1515
1516                         }
1517                         CompositingQuality IGraphics.CompositingQuality
1518                         {
1519                                 get 
1520                                 {
1521                                         throw new NotImplementedException ();
1522                                 }
1523                                 set 
1524                                 {
1525                                         throw new NotImplementedException ();
1526                                 }
1527                         }
1528
1529                         float IGraphics.DpiX
1530                         {
1531                                 get 
1532                                 {
1533                                         throw new NotImplementedException ();
1534                                 }
1535                         }
1536
1537                         float IGraphics.DpiY
1538                         {
1539                                 get 
1540                                 {
1541                                         throw new NotImplementedException ();
1542                                 }
1543                         }
1544
1545                         InterpolationMode IGraphics.InterpolationMode
1546                         {
1547                                 get 
1548                                 {
1549                                         throw new NotImplementedException ();
1550                                 }
1551                                 set 
1552                                 {
1553                                         throw new NotImplementedException ();
1554                                 }
1555                         }
1556
1557                         bool IGraphics.IsClipEmpty
1558                         {
1559                                 get 
1560                                 {
1561                                         throw new NotImplementedException ();
1562                                 }
1563                         }
1564
1565                         bool IGraphics.IsVisibleClipEmpty
1566                         {
1567                                 get 
1568                                 {
1569                                         throw new NotImplementedException ();
1570                                 }
1571                         }
1572
1573                         float IGraphics.PageScale
1574                         {
1575                                 get 
1576                                 {
1577                                         throw new NotImplementedException ();
1578                                 }
1579                                 set 
1580                                 {
1581                                         throw new NotImplementedException ();
1582                                 }
1583                         }
1584
1585                         GraphicsUnit IGraphics.PageUnit
1586                         {
1587                                 get 
1588                                 {
1589                                         throw new NotImplementedException ();
1590                                 }
1591                                 set 
1592                                 {
1593                                         throw new NotImplementedException ();
1594                                 }
1595                         }
1596
1597                         PixelOffsetMode IGraphics.PixelOffsetMode
1598                         {
1599                                 get 
1600                                 {
1601                                         throw new NotImplementedException ();
1602                                 }
1603                                 set 
1604                                 {
1605                                         throw new NotImplementedException ();
1606                                 }
1607                         }
1608
1609                         Point IGraphics.RenderingOrigin
1610                         {
1611                                 get 
1612                                 {
1613                                         throw new NotImplementedException ();
1614                                 }
1615                                 set 
1616                                 {
1617                                         throw new NotImplementedException ();
1618                                 }
1619                         }
1620
1621                         SmoothingMode IGraphics.SmoothingMode
1622                         {
1623                                 get 
1624                                 {
1625                                         throw new NotImplementedException ();
1626                                 }
1627                                 set 
1628                                 {
1629                                         throw new NotImplementedException ();
1630                                 }
1631                         }
1632
1633                         int IGraphics.TextContrast
1634                         {
1635                                 get 
1636                                 {
1637                                         throw new NotImplementedException ();
1638                                 }
1639                                 set 
1640                                 {
1641                                         throw new NotImplementedException ();
1642                                 }
1643                         }
1644
1645                         TextRenderingHint IGraphics.TextRenderingHint
1646                         {
1647                                 get 
1648                                 {
1649                                         throw new NotImplementedException ();
1650                                 }
1651                                 set 
1652                                 {
1653                                         throw new NotImplementedException ();
1654                                 }
1655                         }
1656
1657                         Matrix IGraphics.Transform
1658                         {
1659                                 get 
1660                                 {
1661                                         throw new NotImplementedException ();
1662                                 }
1663                                 set 
1664                                 {
1665                                         throw new NotImplementedException ();
1666                                 }
1667                         }
1668
1669                         RectangleF IGraphics.VisibleClipBounds
1670                         {
1671                                 get 
1672                                 {
1673                                         throw new NotImplementedException ();
1674                                 }
1675                         }
1676                 }
1677         }
1678 }
1679