Mercurial > projects > dstep
comparison dstep/qtkit/QTMovieView.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 28, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.qtkit.QTMovieView; | |
8 | |
9 import dstep.cocoa.Cocoa; | |
10 import dstep.appkit.NSUserInterfaceValidation; | |
11 import dstep.foundation.NSCoder; | |
12 import dstep.objc.bridge.Bridge; | |
13 import dstep.objc.objc; | |
14 import dstep.qtkit.QTKitDefines; | |
15 import dstep.qtkit.QTMovie; | |
16 | |
17 import bindings = dstep.qtkit.QTMovieView_bindings; | |
18 | |
19 private | |
20 { | |
21 NSString QTMovieViewMovieBinding_; | |
22 NSString QTMovieViewControllerVisibleBinding_; | |
23 NSString QTMovieViewPreservesAspectRatioBinding_; | |
24 NSString QTMovieViewFillColorBinding_; | |
25 } | |
26 | |
27 NSString QTMovieViewMovieBinding () | |
28 { | |
29 if (QTMovieViewMovieBinding_) | |
30 return QTMovieViewMovieBinding_; | |
31 | |
32 return QTMovieViewMovieBinding_ = new NSString(bindings.QTMovieViewMovieBinding); | |
33 } | |
34 | |
35 NSString QTMovieViewControllerVisibleBinding () | |
36 { | |
37 if (QTMovieViewControllerVisibleBinding_) | |
38 return QTMovieViewControllerVisibleBinding_; | |
39 | |
40 return QTMovieViewControllerVisibleBinding_ = new NSString(bindings.QTMovieViewControllerVisibleBinding); | |
41 } | |
42 | |
43 NSString QTMovieViewPreservesAspectRatioBinding () | |
44 { | |
45 if (QTMovieViewPreservesAspectRatioBinding_) | |
46 return QTMovieViewPreservesAspectRatioBinding_; | |
47 | |
48 return QTMovieViewPreservesAspectRatioBinding_ = new NSString(bindings.QTMovieViewPreservesAspectRatioBinding); | |
49 } | |
50 | |
51 NSString QTMovieViewFillColorBinding () | |
52 { | |
53 if (QTMovieViewFillColorBinding_) | |
54 return QTMovieViewFillColorBinding_; | |
55 | |
56 return QTMovieViewFillColorBinding_ = new NSString(bindings.QTMovieViewFillColorBinding); | |
57 } | |
58 | |
59 const TQTMovieViewDelegate = ` | |
60 | |
61 CIImage view (QTMovieView view, CIImage image) | |
62 { | |
63 return invokeObjcSelf!(CIImage, "view:willDisplayImage:", QTMovieView, CIImage)(view, image); | |
64 } | |
65 | |
66 //mixin ObjcBindMethod!(view, "view:willDisplayImage:"); | |
67 | |
68 `; | |
69 | |
70 class QTMovieView : NSView, INSCoding, INSUserInterfaceValidations | |
71 { | |
72 mixin (ObjcWrap); | |
73 | |
74 bool validateUserInterfaceItem (INSValidatedUserInterfaceItem anItem) | |
75 { | |
76 return invokeObjcSelf!(bool, "validateUserInterfaceItem:", INSValidatedUserInterfaceItem)(anItem); | |
77 } | |
78 | |
79 this (NSCoder aDecoder) | |
80 { | |
81 super(typeof(this).alloc.initWithCoder(aDecoder).objcObject); | |
82 } | |
83 | |
84 void encodeWithCoder (NSCoder aCoder) | |
85 { | |
86 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder); | |
87 } | |
88 | |
89 typeof(this) initWithCoder (NSCoder aDecoder) | |
90 { | |
91 return invokeObjcSelf!(typeof(this), "initWithCoder:", NSCoder)(aDecoder); | |
92 } | |
93 | |
94 QTMovieView initWithFrame (NSRect frame) | |
95 { | |
96 id result = invokeObjcSelf!(id, "initWithFrame:", NSRect)(frame); | |
97 return result is this.objcObject ? this : (result !is null ? new QTMovieView(result) : null); | |
98 } | |
99 | |
100 this (NSRect frame) | |
101 { | |
102 super(QTMovieView.alloc.initWithFrame(frame).objcObject); | |
103 } | |
104 | |
105 QTMovie movie () | |
106 { | |
107 return invokeObjcSelf!(QTMovie, "movie"); | |
108 } | |
109 | |
110 bool isControllerVisible () | |
111 { | |
112 return invokeObjcSelf!(bool, "isControllerVisible"); | |
113 } | |
114 | |
115 bool isEditable () | |
116 { | |
117 return invokeObjcSelf!(bool, "isEditable"); | |
118 } | |
119 | |
120 float controllerBarHeight () | |
121 { | |
122 return invokeObjcSelf!(float, "controllerBarHeight"); | |
123 } | |
124 | |
125 bool preservesAspectRatio () | |
126 { | |
127 return invokeObjcSelf!(bool, "preservesAspectRatio"); | |
128 } | |
129 | |
130 NSColor fillColor () | |
131 { | |
132 return invokeObjcSelf!(NSColor, "fillColor"); | |
133 } | |
134 | |
135 NSRect movieBounds () | |
136 { | |
137 return invokeObjcSelf!(NSRect, "movieBounds"); | |
138 } | |
139 | |
140 NSRect movieControllerBounds () | |
141 { | |
142 return invokeObjcSelf!(NSRect, "movieControllerBounds"); | |
143 } | |
144 | |
145 void setMovie (QTMovie movie) | |
146 { | |
147 return invokeObjcSelf!(void, "setMovie:", QTMovie)(movie); | |
148 } | |
149 | |
150 void setControllerVisible (bool controllerVisible) | |
151 { | |
152 return invokeObjcSelf!(void, "setControllerVisible:", bool)(controllerVisible); | |
153 } | |
154 | |
155 void setPreservesAspectRatio (bool preservesAspectRatio) | |
156 { | |
157 return invokeObjcSelf!(void, "setPreservesAspectRatio:", bool)(preservesAspectRatio); | |
158 } | |
159 | |
160 void setFillColor (NSColor fillColor) | |
161 { | |
162 return invokeObjcSelf!(void, "setFillColor:", NSColor)(fillColor); | |
163 } | |
164 | |
165 void setEditable (bool editable) | |
166 { | |
167 return invokeObjcSelf!(void, "setEditable:", bool)(editable); | |
168 } | |
169 | |
170 void setShowsResizeIndicator (bool show) | |
171 { | |
172 return invokeObjcSelf!(void, "setShowsResizeIndicator:", bool)(show); | |
173 } | |
174 | |
175 void play (Object sender) | |
176 { | |
177 return invokeObjcSelf!(void, "play:", Object)(sender); | |
178 } | |
179 | |
180 void pause (Object sender) | |
181 { | |
182 return invokeObjcSelf!(void, "pause:", Object)(sender); | |
183 } | |
184 | |
185 void gotoBeginning (Object sender) | |
186 { | |
187 return invokeObjcSelf!(void, "gotoBeginning:", Object)(sender); | |
188 } | |
189 | |
190 void gotoEnd (Object sender) | |
191 { | |
192 return invokeObjcSelf!(void, "gotoEnd:", Object)(sender); | |
193 } | |
194 | |
195 void gotoNextSelectionPoint (Object sender) | |
196 { | |
197 return invokeObjcSelf!(void, "gotoNextSelectionPoint:", Object)(sender); | |
198 } | |
199 | |
200 void gotoPreviousSelectionPoint (Object sender) | |
201 { | |
202 return invokeObjcSelf!(void, "gotoPreviousSelectionPoint:", Object)(sender); | |
203 } | |
204 | |
205 void gotoPosterFrame (Object sender) | |
206 { | |
207 return invokeObjcSelf!(void, "gotoPosterFrame:", Object)(sender); | |
208 } | |
209 | |
210 void stepForward (Object sender) | |
211 { | |
212 return invokeObjcSelf!(void, "stepForward:", Object)(sender); | |
213 } | |
214 | |
215 void stepBackward (Object sender) | |
216 { | |
217 return invokeObjcSelf!(void, "stepBackward:", Object)(sender); | |
218 } | |
219 | |
220 void cut (Object sender) | |
221 { | |
222 return invokeObjcSelf!(void, "cut:", Object)(sender); | |
223 } | |
224 | |
225 void copy (Object sender) | |
226 { | |
227 return invokeObjcSelf!(void, "copy:", Object)(sender); | |
228 } | |
229 | |
230 void paste (Object sender) | |
231 { | |
232 return invokeObjcSelf!(void, "paste:", Object)(sender); | |
233 } | |
234 | |
235 void selectAll (Object sender) | |
236 { | |
237 return invokeObjcSelf!(void, "selectAll:", Object)(sender); | |
238 } | |
239 | |
240 void selectNone (Object sender) | |
241 { | |
242 return invokeObjcSelf!(void, "selectNone:", Object)(sender); | |
243 } | |
244 | |
245 void delete_ (Object sender) | |
246 { | |
247 return invokeObjcSelf!(void, "delete:", Object)(sender); | |
248 } | |
249 | |
250 void add (Object sender) | |
251 { | |
252 return invokeObjcSelf!(void, "add:", Object)(sender); | |
253 } | |
254 | |
255 void addScaled (Object sender) | |
256 { | |
257 return invokeObjcSelf!(void, "addScaled:", Object)(sender); | |
258 } | |
259 | |
260 void replace (Object sender) | |
261 { | |
262 return invokeObjcSelf!(void, "replace:", Object)(sender); | |
263 } | |
264 | |
265 void trim (Object sender) | |
266 { | |
267 return invokeObjcSelf!(void, "trim:", Object)(sender); | |
268 } | |
269 | |
270 void setBackButtonVisible (bool state) | |
271 { | |
272 return invokeObjcSelf!(void, "setBackButtonVisible:", bool)(state); | |
273 } | |
274 | |
275 void setCustomButtonVisible (bool state) | |
276 { | |
277 return invokeObjcSelf!(void, "setCustomButtonVisible:", bool)(state); | |
278 } | |
279 | |
280 void setHotSpotButtonVisible (bool state) | |
281 { | |
282 return invokeObjcSelf!(void, "setHotSpotButtonVisible:", bool)(state); | |
283 } | |
284 | |
285 void setStepButtonsVisible (bool state) | |
286 { | |
287 return invokeObjcSelf!(void, "setStepButtonsVisible:", bool)(state); | |
288 } | |
289 | |
290 void setTranslateButtonVisible (bool state) | |
291 { | |
292 return invokeObjcSelf!(void, "setTranslateButtonVisible:", bool)(state); | |
293 } | |
294 | |
295 void setVolumeButtonVisible (bool state) | |
296 { | |
297 return invokeObjcSelf!(void, "setVolumeButtonVisible:", bool)(state); | |
298 } | |
299 | |
300 void setZoomButtonsVisible (bool state) | |
301 { | |
302 return invokeObjcSelf!(void, "setZoomButtonsVisible:", bool)(state); | |
303 } | |
304 | |
305 bool isBackButtonVisible () | |
306 { | |
307 return invokeObjcSelf!(bool, "isBackButtonVisible"); | |
308 } | |
309 | |
310 bool isCustomButtonVisible () | |
311 { | |
312 return invokeObjcSelf!(bool, "isCustomButtonVisible"); | |
313 } | |
314 | |
315 bool isHotSpotButtonVisible () | |
316 { | |
317 return invokeObjcSelf!(bool, "isHotSpotButtonVisible"); | |
318 } | |
319 | |
320 bool areStepButtonsVisible () | |
321 { | |
322 return invokeObjcSelf!(bool, "areStepButtonsVisible"); | |
323 } | |
324 | |
325 bool isTranslateButtonVisible () | |
326 { | |
327 return invokeObjcSelf!(bool, "isTranslateButtonVisible"); | |
328 } | |
329 | |
330 bool isVolumeButtonVisible () | |
331 { | |
332 return invokeObjcSelf!(bool, "isVolumeButtonVisible"); | |
333 } | |
334 | |
335 bool areZoomButtonsVisible () | |
336 { | |
337 return invokeObjcSelf!(bool, "areZoomButtonsVisible"); | |
338 } | |
339 | |
340 Object delegate_ () | |
341 { | |
342 return invokeObjcSelf!(Object, "delegate"); | |
343 } | |
344 | |
345 void setDelegate (Object delegate_) | |
346 { | |
347 return invokeObjcSelf!(void, "setDelegate:", Object)(delegate_); | |
348 } | |
349 } | |
350 |