Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSUndoManager.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.NSUndoManager; | 14 module dwt.internal.cocoa.NSUndoManager; |
15 | 15 |
16 import dwt.internal.cocoa.id; | |
16 import dwt.internal.cocoa.NSArray; | 17 import dwt.internal.cocoa.NSArray; |
17 import dwt.internal.cocoa.NSObject; | 18 import dwt.internal.cocoa.NSObject; |
18 import dwt.internal.cocoa.NSInteger; | 19 import dwt.internal.cocoa.NSInteger; |
19 import dwt.internal.cocoa.NSString; | 20 import dwt.internal.cocoa.NSString; |
20 import dwt.internal.cocoa.OS; | 21 import dwt.internal.cocoa.OS; |
33 super(id); | 34 super(id); |
34 } | 35 } |
35 | 36 |
36 public void beginUndoGrouping () | 37 public void beginUndoGrouping () |
37 { | 38 { |
38 OS.objc_msgSend(this.id, OS.sel_beginUndoGrouping); | 39 OS.objc_msgSend(this.id_, OS.sel_beginUndoGrouping); |
39 } | 40 } |
40 | 41 |
41 public bool canRedo () | 42 public bool canRedo () |
42 { | 43 { |
43 return OS.objc_msgSend(this.id, OS.sel_canRedo) !is null; | 44 return OS.objc_msgSend(this.id_, OS.sel_canRedo) !is null; |
44 } | 45 } |
45 | 46 |
46 public bool canUndo () | 47 public bool canUndo () |
47 { | 48 { |
48 return OS.objc_msgSend(this.id, OS.sel_canUndo) !is null; | 49 return OS.objc_msgSend(this.id_, OS.sel_canUndo) !is null; |
49 } | 50 } |
50 | 51 |
51 public void disableUndoRegistration () | 52 public void disableUndoRegistration () |
52 { | 53 { |
53 OS.objc_msgSend(this.id, OS.sel_disableUndoRegistration); | 54 OS.objc_msgSend(this.id_, OS.sel_disableUndoRegistration); |
54 } | 55 } |
55 | 56 |
56 public void enableUndoRegistration () | 57 public void enableUndoRegistration () |
57 { | 58 { |
58 OS.objc_msgSend(this.id, OS.sel_enableUndoRegistration); | 59 OS.objc_msgSend(this.id_, OS.sel_enableUndoRegistration); |
59 } | 60 } |
60 | 61 |
61 public void endUndoGrouping () | 62 public void endUndoGrouping () |
62 { | 63 { |
63 OS.objc_msgSend(this.id, OS.sel_endUndoGrouping); | 64 OS.objc_msgSend(this.id_, OS.sel_endUndoGrouping); |
64 } | 65 } |
65 | 66 |
66 public NSInteger groupingLevel () | 67 public NSInteger groupingLevel () |
67 { | 68 { |
68 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_groupingLevel); | 69 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_groupingLevel); |
69 } | 70 } |
70 | 71 |
71 public bool groupsByEvent () | 72 public bool groupsByEvent () |
72 { | 73 { |
73 return OS.objc_msgSend(this.id, OS.sel_groupsByEvent) !is null; | 74 return OS.objc_msgSend(this.id_, OS.sel_groupsByEvent) !is null; |
74 } | 75 } |
75 | 76 |
76 public bool isRedoing () | 77 public bool isRedoing () |
77 { | 78 { |
78 return OS.objc_msgSend(this.id, OS.sel_isRedoing) !is null; | 79 return OS.objc_msgSend(this.id_, OS.sel_isRedoing) !is null; |
79 } | 80 } |
80 | 81 |
81 public bool isUndoRegistrationEnabled () | 82 public bool isUndoRegistrationEnabled () |
82 { | 83 { |
83 return OS.objc_msgSend(this.id, OS.sel_isUndoRegistrationEnabled) !is null; | 84 return OS.objc_msgSend(this.id_, OS.sel_isUndoRegistrationEnabled) !is null; |
84 } | 85 } |
85 | 86 |
86 public bool isUndoing () | 87 public bool isUndoing () |
87 { | 88 { |
88 return OS.objc_msgSend(this.id, OS.sel_isUndoing) !is null; | 89 return OS.objc_msgSend(this.id_, OS.sel_isUndoing) !is null; |
89 } | 90 } |
90 | 91 |
91 public NSUInteger levelsOfUndo () | 92 public NSUInteger levelsOfUndo () |
92 { | 93 { |
93 return cast(NSUInteger) OS.objc_msgSend(this.id, OS.sel_levelsOfUndo); | 94 return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_levelsOfUndo); |
94 } | 95 } |
95 | 96 |
96 public id prepareWithInvocationTarget (id target) | 97 public id prepareWithInvocationTarget (id target) |
97 { | 98 { |
98 objc.id result = OS.objc_msgSend(this.id, OS.sel_prepareWithInvocationTarget_1, target !is null ? target.id : null); | 99 objc.id result = OS.objc_msgSend(this.id_, OS.sel_prepareWithInvocationTarget_1, target !is null ? target.id_ : null); |
99 return result !is null ? new id(result) : null; | 100 return result !is null ? new id(result) : null; |
100 } | 101 } |
101 | 102 |
102 public void redo () | 103 public void redo () |
103 { | 104 { |
104 OS.objc_msgSend(this.id, OS.sel_redo); | 105 OS.objc_msgSend(this.id_, OS.sel_redo); |
105 } | 106 } |
106 | 107 |
107 public NSString redoActionName () | 108 public NSString redoActionName () |
108 { | 109 { |
109 objc.id result = OS.objc_msgSend(this.id, OS.sel_redoActionName); | 110 objc.id result = OS.objc_msgSend(this.id_, OS.sel_redoActionName); |
110 return result !is null ? new NSString(result) : null; | 111 return result !is null ? new NSString(result) : null; |
111 } | 112 } |
112 | 113 |
113 public NSString redoMenuItemTitle () | 114 public NSString redoMenuItemTitle () |
114 { | 115 { |
115 objc.id result = OS.objc_msgSend(this.id, OS.sel_redoMenuItemTitle); | 116 objc.id result = OS.objc_msgSend(this.id_, OS.sel_redoMenuItemTitle); |
116 return result !is null ? new NSString(result) : null; | 117 return result !is null ? new NSString(result) : null; |
117 } | 118 } |
118 | 119 |
119 public NSString redoMenuTitleForUndoActionName (NSString actionName) | 120 public NSString redoMenuTitleForUndoActionName (NSString actionName) |
120 { | 121 { |
121 objc.id result = OS.objc_msgSend(this.id, OS.sel_redoMenuTitleForUndoActionName_1, actionName !is null ? actionName.id : null); | 122 objc.id result = OS.objc_msgSend(this.id_, OS.sel_redoMenuTitleForUndoActionName_1, actionName !is null ? actionName.id_ : null); |
122 return result !is null ? new NSString(result) : null; | 123 return result !is null ? new NSString(result) : null; |
123 } | 124 } |
124 | 125 |
125 public void registerUndoWithTarget (id target, objc.SEL selector, id anObject) | 126 public void registerUndoWithTarget (id target, objc.SEL selector, id anObject) |
126 { | 127 { |
127 OS.objc_msgSend(this.id, OS.sel_registerUndoWithTarget_1selector_1object_1, target !is null ? target.id : null, selector, | 128 OS.objc_msgSend(this.id_, OS.sel_registerUndoWithTarget_1selector_1object_1, target !is null ? target.id_ : null, selector, |
128 anObject !is null ? anObject.id : null); | 129 anObject !is null ? anObject.id_ : null); |
129 } | 130 } |
130 | 131 |
131 public void removeAllActions () | 132 public void removeAllActions () |
132 { | 133 { |
133 OS.objc_msgSend(this.id, OS.sel_removeAllActions); | 134 OS.objc_msgSend(this.id_, OS.sel_removeAllActions); |
134 } | 135 } |
135 | 136 |
136 public void removeAllActionsWithTarget (id target) | 137 public void removeAllActionsWithTarget (id target) |
137 { | 138 { |
138 OS.objc_msgSend(this.id, OS.sel_removeAllActionsWithTarget_1, target !is null ? target.id : null); | 139 OS.objc_msgSend(this.id_, OS.sel_removeAllActionsWithTarget_1, target !is null ? target.id_ : null); |
139 } | 140 } |
140 | 141 |
141 public NSArray runLoopModes () | 142 public NSArray runLoopModes () |
142 { | 143 { |
143 objc.id result = OS.objc_msgSend(this.id, OS.sel_runLoopModes); | 144 objc.id result = OS.objc_msgSend(this.id_, OS.sel_runLoopModes); |
144 return result !is null ? new NSArray(result) : null; | 145 return result !is null ? new NSArray(result) : null; |
145 } | 146 } |
146 | 147 |
147 public void setActionName (NSString actionName) | 148 public void setActionName (NSString actionName) |
148 { | 149 { |
149 OS.objc_msgSend(this.id, OS.sel_setActionName_1, actionName !is null ? actionName.id : null); | 150 OS.objc_msgSend(this.id_, OS.sel_setActionName_1, actionName !is null ? actionName.id_ : null); |
150 } | 151 } |
151 | 152 |
152 public void setGroupsByEvent (bool groupsByEvent) | 153 public void setGroupsByEvent (bool groupsByEvent) |
153 { | 154 { |
154 OS.objc_msgSend(this.id, OS.sel_setGroupsByEvent_1, groupsByEvent); | 155 OS.objc_msgSend(this.id_, OS.sel_setGroupsByEvent_1, groupsByEvent); |
155 } | 156 } |
156 | 157 |
157 public void setLevelsOfUndo (NSUInteger levels) | 158 public void setLevelsOfUndo (NSUInteger levels) |
158 { | 159 { |
159 OS.objc_msgSend(this.id, OS.sel_setLevelsOfUndo_1, levels); | 160 OS.objc_msgSend(this.id_, OS.sel_setLevelsOfUndo_1, levels); |
160 } | 161 } |
161 | 162 |
162 public void setRunLoopModes (NSArray runLoopModes) | 163 public void setRunLoopModes (NSArray runLoopModes) |
163 { | 164 { |
164 OS.objc_msgSend(this.id, OS.sel_setRunLoopModes_1, runLoopModes !is null ? runLoopModes.id : null); | 165 OS.objc_msgSend(this.id_, OS.sel_setRunLoopModes_1, runLoopModes !is null ? runLoopModes.id_ : null); |
165 } | 166 } |
166 | 167 |
167 public void undo () | 168 public void undo () |
168 { | 169 { |
169 OS.objc_msgSend(this.id, OS.sel_undo); | 170 OS.objc_msgSend(this.id_, OS.sel_undo); |
170 } | 171 } |
171 | 172 |
172 public NSString undoActionName () | 173 public NSString undoActionName () |
173 { | 174 { |
174 objc.id result = OS.objc_msgSend(this.id, OS.sel_undoActionName); | 175 objc.id result = OS.objc_msgSend(this.id_, OS.sel_undoActionName); |
175 return result !is null ? new NSString(result) : null; | 176 return result !is null ? new NSString(result) : null; |
176 } | 177 } |
177 | 178 |
178 public NSString undoMenuItemTitle () | 179 public NSString undoMenuItemTitle () |
179 { | 180 { |
180 objc.id result = OS.objc_msgSend(this.id, OS.sel_undoMenuItemTitle); | 181 objc.id result = OS.objc_msgSend(this.id_, OS.sel_undoMenuItemTitle); |
181 return result !is null ? new NSString(result) : null; | 182 return result !is null ? new NSString(result) : null; |
182 } | 183 } |
183 | 184 |
184 public NSString undoMenuTitleForUndoActionName (NSString actionName) | 185 public NSString undoMenuTitleForUndoActionName (NSString actionName) |
185 { | 186 { |
186 objc.id result = OS.objc_msgSend(this.id, OS.sel_undoMenuTitleForUndoActionName_1, actionName !is null ? actionName.id : null); | 187 objc.id result = OS.objc_msgSend(this.id_, OS.sel_undoMenuTitleForUndoActionName_1, actionName !is null ? actionName.id_ : null); |
187 return result !is null ? new NSString(result) : null; | 188 return result !is null ? new NSString(result) : null; |
188 } | 189 } |
189 | 190 |
190 public void undoNestedGroup () | 191 public void undoNestedGroup () |
191 { | 192 { |
192 OS.objc_msgSend(this.id, OS.sel_undoNestedGroup); | 193 OS.objc_msgSend(this.id_, OS.sel_undoNestedGroup); |
193 } | 194 } |
194 | 195 |
195 } | 196 } |