Mercurial > projects > dstep
comparison dstep/appkit/NSClipView.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.NSClipView; | |
8 | |
9 import dstep.appkit.NSColor; | |
10 import dstep.appkit.NSCursor; | |
11 import dstep.appkit.NSEvent; | |
12 import dstep.appkit.NSView; | |
13 import dstep.foundation.NSGeometry; | |
14 import dstep.foundation.NSNotification; | |
15 import dstep.objc.bridge.Bridge; | |
16 import dstep.objc.objc; | |
17 | |
18 class NSClipView : NSView | |
19 { | |
20 mixin (ObjcWrap); | |
21 | |
22 void setBackgroundColor (NSColor color) | |
23 { | |
24 return invokeObjcSelf!(void, "setBackgroundColor:", NSColor)(color); | |
25 } | |
26 | |
27 NSColor backgroundColor () | |
28 { | |
29 return invokeObjcSelf!(NSColor, "backgroundColor"); | |
30 } | |
31 | |
32 void setDrawsBackground (bool flag) | |
33 { | |
34 return invokeObjcSelf!(void, "setDrawsBackground:", bool)(flag); | |
35 } | |
36 | |
37 bool drawsBackground () | |
38 { | |
39 return invokeObjcSelf!(bool, "drawsBackground"); | |
40 } | |
41 | |
42 void setDocumentView (NSView aView) | |
43 { | |
44 return invokeObjcSelf!(void, "setDocumentView:", NSView)(aView); | |
45 } | |
46 | |
47 Object documentView () | |
48 { | |
49 return invokeObjcSelf!(Object, "documentView"); | |
50 } | |
51 | |
52 NSRect documentRect () | |
53 { | |
54 return invokeObjcSelf!(NSRect, "documentRect"); | |
55 } | |
56 | |
57 void setDocumentCursor (NSCursor anObj) | |
58 { | |
59 return invokeObjcSelf!(void, "setDocumentCursor:", NSCursor)(anObj); | |
60 } | |
61 | |
62 NSCursor documentCursor () | |
63 { | |
64 return invokeObjcSelf!(NSCursor, "documentCursor"); | |
65 } | |
66 | |
67 NSRect documentVisibleRect () | |
68 { | |
69 return invokeObjcSelf!(NSRect, "documentVisibleRect"); | |
70 } | |
71 | |
72 void viewFrameChanged (NSNotification notification) | |
73 { | |
74 return invokeObjcSelf!(void, "viewFrameChanged:", NSNotification)(notification); | |
75 } | |
76 | |
77 void viewBoundsChanged (NSNotification notification) | |
78 { | |
79 return invokeObjcSelf!(void, "viewBoundsChanged:", NSNotification)(notification); | |
80 } | |
81 | |
82 void setCopiesOnScroll (bool flag) | |
83 { | |
84 return invokeObjcSelf!(void, "setCopiesOnScroll:", bool)(flag); | |
85 } | |
86 | |
87 bool copiesOnScroll () | |
88 { | |
89 return invokeObjcSelf!(bool, "copiesOnScroll"); | |
90 } | |
91 | |
92 bool autoscroll (NSEvent theEvent) | |
93 { | |
94 return invokeObjcSelf!(bool, "autoscroll:", NSEvent)(theEvent); | |
95 } | |
96 | |
97 NSPoint constrainScrollPoint (NSPoint newOrigin) | |
98 { | |
99 return invokeObjcSelf!(NSPoint, "constrainScrollPoint:", NSPoint)(newOrigin); | |
100 } | |
101 | |
102 void scrollToPoint (NSPoint newOrigin) | |
103 { | |
104 return invokeObjcSelf!(void, "scrollToPoint:", NSPoint)(newOrigin); | |
105 } | |
106 } | |
107 | |
108 const TNSClipViewSuperview = ` | |
109 | |
110 void reflectScrolledClipView (NSClipView aClipView) | |
111 { | |
112 return invokeObjcSelf!(void, "reflectScrolledClipView:", NSClipView)(aClipView); | |
113 } | |
114 | |
115 void scrollClipView (NSClipView aClipView, NSPoint aPoint) | |
116 { | |
117 return invokeObjcSelf!(void, "scrollClipView:toPoint:", NSClipView, NSPoint)(aClipView, aPoint); | |
118 } | |
119 | |
120 //mixin ObjcBindMethod!(reflectScrolledClipView, "reflectScrolledClipView:"); | |
121 //mixin ObjcBindMethod!(scrollClipView, "scrollClipView:toPoint:"); | |
122 | |
123 `; | |
124 |