~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/maccore/src/CoreGraphics/CGContext.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
// Authors: Mono Team
5
5
//     
6
6
// Copyright 2009 Novell, Inc
 
7
// Copyright 2011, 2012 Xamarin Inc
7
8
//
8
9
// Permission is hereby granted, free of charge, to any person obtaining
9
10
// a copy of this software and associated documentation files (the
245
246
                }
246
247
                
247
248
                [DllImport (Constants.CoreGraphicsLibrary)]
248
 
                extern static   void CGContextSetLineDash(IntPtr c, float phase, float [] lenghts, int count);
249
 
                public void SetLineDash (float phase, float [] lenghts)
 
249
                extern static   void CGContextSetLineDash(IntPtr c, float phase, float [] lengths, int count);
 
250
                public void SetLineDash (float phase, float [] lengths)
250
251
                {
251
 
                        if (lenghts == null)
252
 
                                throw new ArgumentNullException ("lenghts");
253
 
                        CGContextSetLineDash (handle, phase, lenghts, lenghts.Length);
 
252
                        if (lengths == null)
 
253
                                throw new ArgumentNullException ("lengths");
 
254
                        CGContextSetLineDash (handle, phase, lengths, lengths.Length);
254
255
                }
255
256
 
256
 
                public void SetLineDash (float phase, float [] lenghts, int n)
 
257
                public void SetLineDash (float phase, float [] lengths, int n)
257
258
                {
258
 
                        if (lenghts == null)
259
 
                                throw new ArgumentNullException ("lenghts");
260
 
                        if (n > lenghts.Length)
 
259
                        if (lengths == null)
 
260
                                throw new ArgumentNullException ("lengths");
 
261
                        if (n > lengths.Length)
261
262
                                throw new ArgumentNullException ("n");
262
 
                        CGContextSetLineDash (handle, phase, lenghts, n);
 
263
                        CGContextSetLineDash (handle, phase, lengths, n);
263
264
                }
264
265
                
265
266
                [DllImport (Constants.CoreGraphicsLibrary)]
550
551
                        CGContextSetFillColorWithColor (handle, color.handle);
551
552
                }
552
553
                
553
 
                [Obsolete ("Use SetFillColor() instead.")]
 
554
                [Advice ("Use SetFillColor() instead.")]
554
555
                public void SetFillColorWithColor (CGColor color)
555
556
                {
556
557
                        CGContextSetFillColorWithColor (handle, color.handle);
563
564
                        CGContextSetStrokeColorWithColor (handle, color.handle);
564
565
                }
565
566
                
566
 
                [Obsolete ("Use SetStrokeColor() instead.")]
 
567
                [Advice ("Use SetStrokeColor() instead.")]
567
568
                public void SetStrokeColorWithColor (CGColor color)
568
569
                {
569
570
                        CGContextSetStrokeColorWithColor (handle, color.handle);
633
634
                        CGContextSetGrayFillColor (handle, gray, alpha);
634
635
                }
635
636
                
636
 
                [Obsolete ("Use SetFillColor() instead.")]
 
637
                [Advice ("Use SetFillColor() instead.")]
637
638
                public void SetGrayFillColor (float gray, float alpha)
638
639
                {
639
640
                        CGContextSetGrayFillColor (handle, gray, alpha);
646
647
                        CGContextSetGrayStrokeColor (handle, gray, alpha);
647
648
                }
648
649
                
649
 
                [Obsolete ("Use SetStrokeColor() instead.")]
 
650
                [Advice ("Use SetStrokeColor() instead.")]
650
651
                public void SetGrayStrokeColor (float gray, float alpha)
651
652
                {
652
653
                        CGContextSetGrayStrokeColor (handle, gray, alpha);
659
660
                        CGContextSetRGBFillColor (handle, red, green, blue, alpha);
660
661
                }
661
662
                
662
 
                [Obsolete ("Use SetFillColor() instead.")]
 
663
                [Advice ("Use SetFillColor() instead.")]
663
664
                public void SetRGBFillColor (float red, float green, float blue, float alpha)
664
665
                {
665
666
                        CGContextSetRGBFillColor (handle, red, green, blue, alpha);
672
673
                        CGContextSetRGBStrokeColor (handle, red, green, blue, alpha);
673
674
                }
674
675
                
675
 
                [Obsolete ("Use SetStrokeColor() instead.")]
 
676
                [Advice ("Use SetStrokeColor() instead.")]
676
677
                public void SetRGBStrokeColor (float red, float green, float blue, float alpha)
677
678
                {
678
679
                        CGContextSetRGBStrokeColor (handle, red, green, blue, alpha);
685
686
                        CGContextSetCMYKFillColor (handle, cyan, magenta, yellow, black, alpha);
686
687
                }
687
688
                
688
 
                [Obsolete ("Use SetFillColor() instead.")]
 
689
                [Advice ("Use SetFillColor() instead.")]
689
690
                public void SetCMYKFillColor (float cyan, float magenta, float yellow, float black, float alpha)
690
691
                {
691
692
                        CGContextSetCMYKFillColor (handle, cyan, magenta, yellow, black, alpha);
698
699
                        CGContextSetCMYKStrokeColor (handle, cyan, magenta, yellow, black, alpha);
699
700
                }
700
701
                
701
 
                [Obsolete ("Use SetStrokeColor() instead.")]
 
702
                [Advice ("Use SetStrokeColor() instead.")]
702
703
                public void SetCMYKStrokeColor (float cyan, float magenta, float yellow, float black, float alpha)
703
704
                {
704
705
                        CGContextSetCMYKStrokeColor (handle, cyan, magenta, yellow, black, alpha);
769
770
                        CGContextDrawRadialGradient (handle, gradient.handle, startCenter, startRadius, endCenter, endRadius, options);
770
771
                }
771
772
                
772
 
 
773
 
                //[DllImport (Constants.CoreGraphicsLibrary)]
774
 
                //extern static void CGContextDrawShading(IntPtr context, IntPtr shading);
775
 
                //public void DrawShading (CGShading shading)
776
 
                //{
777
 
                //      CGContextDrawShading (handle, shading.handle);
778
 
                //}
779
 
                
 
773
#if !COREBUILD
 
774
                [DllImport (Constants.CoreGraphicsLibrary)]
 
775
                extern static void CGContextDrawShading(IntPtr context, IntPtr shading);
 
776
                public void DrawShading (CGShading shading)
 
777
                {
 
778
                        CGContextDrawShading (handle, shading.handle);
 
779
                }
 
780
#endif          
780
781
 
781
782
                [DllImport (Constants.CoreGraphicsLibrary)]
782
783
                extern static void CGContextSetCharacterSpacing(IntPtr context, float spacing);