comparison dstep/appkit/NSTrackingArea.d @ 16:19885b43130e

Huge update, the bridge actually works now
author Jacob Carlborg <doob@me.com>
date Sun, 03 Jan 2010 22:06:11 +0100
parents
children b9de51448c6b
comparison
equal deleted inserted replaced
15:7ff919f595d5 16:19885b43130e
1 /**
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
3 * Authors: Jacob Carlborg
4 * Version: Initial created: Sep 24, 2009
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
6 */
7 module dstep.appkit.NSTrackingArea;
8
9 import dstep.foundation.NSCoder;
10 import dstep.foundation.NSDictionary;
11 import dstep.foundation.NSGeometry;
12 import dstep.foundation.NSObjCRuntime;
13 import dstep.foundation.NSObject;
14 import dstep.foundation.NSZone;
15 import dstep.objc.bridge.Bridge;
16 import dstep.objc.objc;
17
18 alias NSUInteger NSTrackingAreaOptions;
19
20 enum
21 {
22 NSTrackingMouseEnteredAndExited = 0x01,
23 NSTrackingMouseMoved = 0x02,
24 NSTrackingCursorUpdate = 0x04
25 }
26
27 enum
28 {
29 NSTrackingActiveWhenFirstResponder = 0x10,
30 NSTrackingActiveInKeyWindow = 0x20,
31 NSTrackingActiveInActiveApp = 0x40,
32 NSTrackingActiveAlways = 0x80
33 }
34
35 enum
36 {
37 NSTrackingAssumeInside = 0x100,
38 NSTrackingInVisibleRect = 0x200,
39 NSTrackingEnabledDuringMouseDrag = 0x400
40 }
41
42 class NSTrackingArea : NSObject, INSCopying, INSCoding
43 {
44 mixin (ObjcWrap);
45
46 this (NSCoder aDecoder)
47 {
48 super(typeof(this).alloc.initWithCoder(aDecoder).objcObject);
49 }
50
51 void encodeWithCoder (NSCoder aCoder)
52 {
53 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder);
54 }
55
56 typeof(this) initWithCoder (NSCoder aDecoder)
57 {
58 return invokeObjcSelf!(typeof(this), "initWithCoder:", NSCoder)(aDecoder);
59 }
60
61 typeof(this) copyWithZone (NSZone* zone)
62 {
63 return invokeObjcSelf!(typeof(this), "copyWithZone:", NSZone*)(zone);
64 }
65
66 NSTrackingArea initWithRect (NSRect rect, uint options, Object owner, NSDictionary userInfo)
67 {
68 id result = invokeObjcSelf!(id, "initWithRect:options:owner:userInfo:", NSRect, uint, Object, NSDictionary)(rect, options, owner, userInfo);
69 return result is this.objcObject ? this : (result !is null ? new NSTrackingArea(result) : null);
70 }
71
72 this (NSRect rect, uint options, Object owner, NSDictionary userInfo)
73 {
74 super(NSTrackingArea.alloc.initWithRect(rect, options, owner, userInfo).objcObject);
75 }
76
77 NSRect rect ()
78 {
79 return invokeObjcSelf!(NSRect, "rect");
80 }
81
82 uint options ()
83 {
84 return invokeObjcSelf!(uint, "options");
85 }
86
87 Object owner ()
88 {
89 return invokeObjcSelf!(Object, "owner");
90 }
91
92 NSDictionary userInfo ()
93 {
94 return invokeObjcSelf!(NSDictionary, "userInfo");
95 }
96
97 }
98