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

« back to all changes in this revision

Viewing changes to external/monomac/src/AppKit/NSCell.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:
1
1
//
 
2
// Author:
 
3
//       Martin Baulig <martin.baulig@xamarin.com>
 
4
//
2
5
// Copyright 2010, Novell, Inc.
 
6
// Copyright (c) 2012 Xamarin Inc. (http://www.xamarin.com)
3
7
//
4
8
// Permission is hereby granted, free of charge, to any person obtaining
5
9
// a copy of this software and associated documentation files (the
20
24
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
25
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
26
//
23
 
namspace MonoMac.AppKit {
 
27
 
 
28
using System;
 
29
using System.Drawing;
 
30
using System.Runtime.InteropServices;
 
31
 
 
32
namespace MonoMac.AppKit {
24
33
        public partial class NSCell {
25
 
                //APPKIT_EXTERN void NSDrawThreePartImage(NSRect frame, NSImage *startCap, NSImage *centerFill, NSImage *endCap, BOOL vertical, NSCompositingOperation op, CGFloat alphaFraction, BOOL flipped);
26
34
 
27
 
                //APPKIT_EXTERN void NSDrawNinePartImage(NSRect frame, NSImage *topLeftCorner, NSImage *topEdgeFill, NSImage *topRightCorner, NSImage *leftEdgeFill, NSImage *centerFill, NSImage *rightEdgeFill, NSImage *bottomLeftCorner, NSImage *bottomEdgeFill, NSImage *bottomRightCorner, NSCompositingOperation op, CGFloat alphaFraction, BOOL flipped);
 
35
                [DllImport (Constants.AppKitLibrary)]
 
36
                extern static void NSDrawThreePartImage (RectangleF rect, IntPtr startCap, IntPtr centerFill, IntPtr endCap, bool vertial, int op, float alphaFraction, bool flipped);
28
37
                
 
38
                public void DrawThreePartImage (RectangleF frame, NSImage startCap, NSImage centerFill, NSImage endCap, bool vertical, NSCompositingOperation op, float alphaFraction, bool flipped)
 
39
                {
 
40
                        NSDrawThreePartImage (
 
41
                                frame, startCap != null ? startCap.Handle : IntPtr.Zero,
 
42
                                centerFill != null ? centerFill.Handle : IntPtr.Zero,
 
43
                                endCap != null ? endCap.Handle : IntPtr.Zero,
 
44
                                vertical, (int)op, alphaFraction, flipped);
 
45
                }
 
46
 
 
47
                [DllImport (Constants.AppKitLibrary)]
 
48
                extern static void NSDrawNinePartImage (RectangleF frame, IntPtr topLeftCorner, IntPtr topEdgeFill, IntPtr topRightCorner, IntPtr leftEdgeFill, IntPtr centerFill, IntPtr rightEdgeFill, IntPtr bottomLeftCorner, IntPtr bottomEdgeFill, IntPtr bottomRightCorner, int op, float alphaFraction, bool flipped);
 
49
 
 
50
                public void DrawNinePartImage (RectangleF frame, NSImage topLeftCorner, NSImage topEdgeFill, NSImage topRightCorner, NSImage leftEdgeFill, NSImage centerFill, NSImage rightEdgeFill, NSImage bottomLeftCorner, NSImage bottomEdgeFill, NSImage bottomRightCorner, NSCompositingOperation op, float alphaFraction, bool flipped)
 
51
                {
 
52
                        NSDrawNinePartImage (
 
53
                                frame, topLeftCorner != null ? topLeftCorner.Handle : IntPtr.Zero,
 
54
                                topEdgeFill != null ? topEdgeFill.Handle : IntPtr.Zero,
 
55
                                topRightCorner != null ? topRightCorner.Handle : IntPtr.Zero,
 
56
                                leftEdgeFill != null ? leftEdgeFill.Handle : IntPtr.Zero,
 
57
                                centerFill != null ? centerFill.Handle : IntPtr.Zero,
 
58
                                rightEdgeFill != null ? rightEdgeFill.Handle : IntPtr.Zero,
 
59
                                bottomLeftCorner != null ? bottomLeftCorner.Handle : IntPtr.Zero,
 
60
                                bottomEdgeFill != null ? bottomEdgeFill.Handle : IntPtr.Zero,
 
61
                                bottomRightCorner != null ? bottomRightCorner.Handle : IntPtr.Zero,
 
62
                                (int)op, alphaFraction, flipped);
 
63
                }
29
64
        }
30
65
}