Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSClipView.d @ 1:8b48be5454ce
The internal cocoa classes compile now
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Tue, 19 Aug 2008 17:35:17 +0200 |
parents | 380af2bdd8e5 |
children | f565d3a95c0a |
comparison
equal
deleted
inserted
replaced
0:380af2bdd8e5 | 1:8b48be5454ce |
---|---|
11 * Port to the D Programming language: | 11 * Port to the D Programming language: |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | 12 * Jacob Carlborg <jacob.carlborg@gmail.com> |
13 *******************************************************************************/ | 13 *******************************************************************************/ |
14 module dwt.internal.cocoa.NSClipView; | 14 module dwt.internal.cocoa.NSClipView; |
15 | 15 |
16 import dwt.internal.cocoa.id; | |
16 import dwt.internal.cocoa.NSColor; | 17 import dwt.internal.cocoa.NSColor; |
17 import dwt.internal.cocoa.NSCursor; | 18 import dwt.internal.cocoa.NSCursor; |
18 import dwt.internal.cocoa.NSEvent; | 19 import dwt.internal.cocoa.NSEvent; |
19 import dwt.internal.cocoa.NSNotification; | 20 import dwt.internal.cocoa.NSNotification; |
20 import dwt.internal.cocoa.NSPoint; | 21 import dwt.internal.cocoa.NSPoint; |
36 super(id); | 37 super(id); |
37 } | 38 } |
38 | 39 |
39 public bool autoscroll (NSEvent theEvent) | 40 public bool autoscroll (NSEvent theEvent) |
40 { | 41 { |
41 return OS.objc_msgSend(this.id, OS.sel_autoscroll_1, theEvent !is null ? theEvent.id : null) !is null; | 42 return OS.objc_msgSend(this.id_, OS.sel_autoscroll_1, theEvent !is null ? theEvent.id_ : null) !is null; |
42 } | 43 } |
43 | 44 |
44 public NSColor backgroundColor () | 45 public NSColor backgroundColor () |
45 { | 46 { |
46 objc.id result = OS.objc_msgSend(this.id, OS.sel_backgroundColor); | 47 objc.id result = OS.objc_msgSend(this.id_, OS.sel_backgroundColor); |
47 return result !is null ? new NSColor(result) : null; | 48 return result !is null ? new NSColor(result) : null; |
48 } | 49 } |
49 | 50 |
50 public NSPoint constrainScrollPoint (NSPoint newOrigin) | 51 public NSPoint constrainScrollPoint (NSPoint newOrigin) |
51 { | 52 { |
52 NSPoint result; | 53 NSPoint result; |
53 OS.objc_msgSend_stret(result, this.id, OS.sel_constrainScrollPoint_1, newOrigin); | 54 OS.objc_msgSend_stret(&result, this.id_, OS.sel_constrainScrollPoint_1, newOrigin); |
54 return result; | 55 return result; |
55 } | 56 } |
56 | 57 |
57 public bool copiesOnScroll () | 58 public bool copiesOnScroll () |
58 { | 59 { |
59 return OS.objc_msgSend(this.id, OS.sel_copiesOnScroll) !is null; | 60 return OS.objc_msgSend(this.id_, OS.sel_copiesOnScroll) !is null; |
60 } | 61 } |
61 | 62 |
62 public NSCursor documentCursor () | 63 public NSCursor documentCursor () |
63 { | 64 { |
64 objc.id result = OS.objc_msgSend(this.id, OS.sel_documentCursor); | 65 objc.id result = OS.objc_msgSend(this.id_, OS.sel_documentCursor); |
65 return result !is null ? new NSCursor(result) : null; | 66 return result !is null ? new NSCursor(result) : null; |
66 } | 67 } |
67 | 68 |
68 public NSRect documentRect () | 69 public NSRect documentRect () |
69 { | 70 { |
70 NSRect result; | 71 NSRect result; |
71 OS.objc_msgSend_stret(result, this.id, OS.sel_documentRect); | 72 OS.objc_msgSend_stret(&result, this.id_, OS.sel_documentRect); |
72 return result; | 73 return result; |
73 } | 74 } |
74 | 75 |
75 public id documentView () | 76 public id documentView () |
76 { | 77 { |
77 objc.id result = OS.objc_msgSend(this.id, OS.sel_documentView); | 78 objc.id result = OS.objc_msgSend(this.id_, OS.sel_documentView); |
78 return result !is null ? new id(result) : null; | 79 return result !is null ? new id(result) : null; |
79 } | 80 } |
80 | 81 |
81 public NSRect documentVisibleRect () | 82 public NSRect documentVisibleRect () |
82 { | 83 { |
83 NSRect result; | 84 NSRect result; |
84 OS.objc_msgSend_stret(result, this.id, OS.sel_documentVisibleRect); | 85 OS.objc_msgSend_stret(&result, this.id_, OS.sel_documentVisibleRect); |
85 return result; | 86 return result; |
86 } | 87 } |
87 | 88 |
88 public bool drawsBackground () | 89 public bool drawsBackground () |
89 { | 90 { |
90 return OS.objc_msgSend(this.id, OS.sel_drawsBackground) !is null; | 91 return OS.objc_msgSend(this.id_, OS.sel_drawsBackground) !is null; |
91 } | 92 } |
92 | 93 |
93 public void scrollToPoint (NSPoint newOrigin) | 94 public void scrollToPoint (NSPoint newOrigin) |
94 { | 95 { |
95 OS.objc_msgSend(this.id, OS.sel_scrollToPoint_1, newOrigin); | 96 OS.objc_msgSend(this.id_, OS.sel_scrollToPoint_1, newOrigin); |
96 } | 97 } |
97 | 98 |
98 public void setBackgroundColor (NSColor color) | 99 public void setBackgroundColor (NSColor color) |
99 { | 100 { |
100 OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color !is null ? color.id : null); | 101 OS.objc_msgSend(this.id_, OS.sel_setBackgroundColor_1, color !is null ? color.id_ : null); |
101 } | 102 } |
102 | 103 |
103 public void setCopiesOnScroll (bool flag) | 104 public void setCopiesOnScroll (bool flag) |
104 { | 105 { |
105 OS.objc_msgSend(this.id, OS.sel_setCopiesOnScroll_1, flag); | 106 OS.objc_msgSend(this.id_, OS.sel_setCopiesOnScroll_1, flag); |
106 } | 107 } |
107 | 108 |
108 public void setDocumentCursor (NSCursor anObj) | 109 public void setDocumentCursor (NSCursor anObj) |
109 { | 110 { |
110 OS.objc_msgSend(this.id, OS.sel_setDocumentCursor_1, anObj !is null ? anObj.id : null); | 111 OS.objc_msgSend(this.id_, OS.sel_setDocumentCursor_1, anObj !is null ? anObj.id_ : null); |
111 } | 112 } |
112 | 113 |
113 public void setDocumentView (NSView aView) | 114 public void setDocumentView (NSView aView) |
114 { | 115 { |
115 OS.objc_msgSend(this.id, OS.sel_setDocumentView_1, aView !is null ? aView.id : null); | 116 OS.objc_msgSend(this.id_, OS.sel_setDocumentView_1, aView !is null ? aView.id_ : null); |
116 } | 117 } |
117 | 118 |
118 public void setDrawsBackground (bool flag) | 119 public void setDrawsBackground (bool flag) |
119 { | 120 { |
120 OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag); | 121 OS.objc_msgSend(this.id_, OS.sel_setDrawsBackground_1, flag); |
121 } | 122 } |
122 | 123 |
123 public void viewBoundsChanged (NSNotification notification) | 124 public void viewBoundsChanged (NSNotification notification) |
124 { | 125 { |
125 OS.objc_msgSend(this.id, OS.sel_viewBoundsChanged_1, notification !is null ? notification.id : null); | 126 OS.objc_msgSend(this.id_, OS.sel_viewBoundsChanged_1, notification !is null ? notification.id_ : null); |
126 } | 127 } |
127 | 128 |
128 public void viewFrameChanged (NSNotification notification) | 129 public void viewFrameChanged (NSNotification notification) |
129 { | 130 { |
130 OS.objc_msgSend(this.id, OS.sel_viewFrameChanged_1, notification !is null ? notification.id : null); | 131 OS.objc_msgSend(this.id_, OS.sel_viewFrameChanged_1, notification !is null ? notification.id_ : null); |
131 } | 132 } |
132 | 133 |
133 } | 134 } |