Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSMovieView.d @ 0:380af2bdd8e5
Upload of whole dwt tree
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sat, 09 Aug 2008 17:00:02 +0200 |
parents | |
children | 8b48be5454ce |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:380af2bdd8e5 |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2007 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * | |
11 * Port to the D Programming language: | |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | |
13 *******************************************************************************/ | |
14 module dwt.internal.cocoa.NSMovieView; | |
15 | |
16 import dwt.internal.cocoa.CGFloat; | |
17 import dwt.internal.cocoa.id; | |
18 import dwt.internal.cocoa.NSInteger; | |
19 import dwt.internal.cocoa.NSMovie; | |
20 import dwt.internal.cocoa.NSRect; | |
21 import dwt.internal.cocoa.NSSize; | |
22 import dwt.internal.cocoa.NSView; | |
23 import dwt.internal.cocoa.OS; | |
24 import objc = dwt.internal.objc.runtime; | |
25 | |
26 alias NSUInteger NSQTMovieLoopMode; | |
27 | |
28 public class NSMovieView : NSView | |
29 { | |
30 | |
31 public this () | |
32 { | |
33 super(); | |
34 } | |
35 | |
36 public this (objc.id id) | |
37 { | |
38 super(id); | |
39 } | |
40 | |
41 public void clear (id sender) | |
42 { | |
43 OS.objc_msgSend(this.id, OS.sel_clear_1, sender !is null ? sender.id : null); | |
44 } | |
45 | |
46 public void copy (id sender) | |
47 { | |
48 OS.objc_msgSend(this.id, OS.sel_copy_1, sender !is null ? sender.id : null); | |
49 } | |
50 | |
51 public void cut (id sender) | |
52 { | |
53 OS.objc_msgSend(this.id, OS.sel_cut_1, sender !is null ? sender.id : null); | |
54 } | |
55 | |
56 public void deletee (id sender) | |
57 { | |
58 OS.objc_msgSend(this.id, OS.sel_delete_1, sender !is null ? sender.id : null); | |
59 } | |
60 | |
61 public void gotoBeginning (id sender) | |
62 { | |
63 OS.objc_msgSend(this.id, OS.sel_gotoBeginning_1, sender !is null ? sender.id : null); | |
64 } | |
65 | |
66 public void gotoEnd (id sender) | |
67 { | |
68 OS.objc_msgSend(this.id, OS.sel_gotoEnd_1, sender !is null ? sender.id : null); | |
69 } | |
70 | |
71 public void gotoPosterFrame (id sender) | |
72 { | |
73 OS.objc_msgSend(this.id, OS.sel_gotoPosterFrame_1, sender !is null ? sender.id : null); | |
74 } | |
75 | |
76 public bool isControllerVisible () | |
77 { | |
78 return OS.objc_msgSend(this.id, OS.sel_isControllerVisible) !is null; | |
79 } | |
80 | |
81 public bool isEditable () | |
82 { | |
83 return OS.objc_msgSend(this.id, OS.sel_isEditable) !is null; | |
84 } | |
85 | |
86 public bool isMuted () | |
87 { | |
88 return OS.objc_msgSend(this.id, OS.sel_isMuted) !is null; | |
89 } | |
90 | |
91 public bool isPlaying () | |
92 { | |
93 return OS.objc_msgSend(this.id, OS.sel_isPlaying) !is null; | |
94 } | |
95 | |
96 public NSQTMovieLoopMode loopMode () | |
97 { | |
98 return OS.objc_msgSend(this.id, OS.sel_loopMode); | |
99 } | |
100 | |
101 public NSMovie movie () | |
102 { | |
103 objc.id result = OS.objc_msgSend(this.id, OS.sel_movie); | |
104 return result !is null ? new NSMovie(result) : null; | |
105 } | |
106 | |
107 public void* movieController () | |
108 { | |
109 return OS.objc_msgSend(this.id, OS.sel_movieController); | |
110 } | |
111 | |
112 public NSRect movieRect () | |
113 { | |
114 NSRect result; | |
115 OS.objc_msgSend_stret(result, this.id, OS.sel_movieRect); | |
116 return result; | |
117 } | |
118 | |
119 public void paste (id sender) | |
120 { | |
121 OS.objc_msgSend(this.id, OS.sel_paste_1, sender !is null ? sender.id : null); | |
122 } | |
123 | |
124 public bool playsEveryFrame () | |
125 { | |
126 return OS.objc_msgSend(this.id, OS.sel_playsEveryFrame) !is null; | |
127 } | |
128 | |
129 public bool playsSelectionOnly () | |
130 { | |
131 return OS.objc_msgSend(this.id, OS.sel_playsSelectionOnly) !is null; | |
132 } | |
133 | |
134 public float rate () | |
135 { | |
136 return cast(float) OS.objc_msgSend_fpret(this.id, OS.sel_rate); | |
137 } | |
138 | |
139 public void resizeWithMagnification (CGFloat magnification) | |
140 { | |
141 OS.objc_msgSend(this.id, OS.sel_resizeWithMagnification_1, magnification); | |
142 } | |
143 | |
144 public void selectAll (id sender) | |
145 { | |
146 OS.objc_msgSend(this.id, OS.sel_selectAll_1, sender !is null ? sender.id : null); | |
147 } | |
148 | |
149 public void setEditable (bool editable) | |
150 { | |
151 OS.objc_msgSend(this.id, OS.sel_setEditable_1, editable); | |
152 } | |
153 | |
154 public void setLoopMode (NSQTMovieLoopMode mode) | |
155 { | |
156 OS.objc_msgSend(this.id, OS.sel_setLoopMode_1, mode); | |
157 } | |
158 | |
159 public void setMovie (NSMovie movie) | |
160 { | |
161 OS.objc_msgSend(this.id, OS.sel_setMovie_1, movie !is null ? movie.id : null); | |
162 } | |
163 | |
164 public void setMuted (bool mute) | |
165 { | |
166 OS.objc_msgSend(this.id, OS.sel_setMuted_1, mute); | |
167 } | |
168 | |
169 public void setPlaysEveryFrame (bool flag) | |
170 { | |
171 OS.objc_msgSend(this.id, OS.sel_setPlaysEveryFrame_1, flag); | |
172 } | |
173 | |
174 public void setPlaysSelectionOnly (bool flag) | |
175 { | |
176 OS.objc_msgSend(this.id, OS.sel_setPlaysSelectionOnly_1, flag); | |
177 } | |
178 | |
179 public void setRate (float rate) | |
180 { | |
181 OS.objc_msgSend(this.id, OS.sel_setRate_1, rate); | |
182 } | |
183 | |
184 public void setVolume (float volume) | |
185 { | |
186 OS.objc_msgSend(this.id, OS.sel_setVolume_1, volume); | |
187 } | |
188 | |
189 public void showController (bool show, bool adjustSize) | |
190 { | |
191 OS.objc_msgSend(this.id, OS.sel_showController_1adjustingSize_1, show, adjustSize); | |
192 } | |
193 | |
194 public NSSize sizeForMagnification (CGFloat magnification) | |
195 { | |
196 NSSize result; | |
197 OS.objc_msgSend_stret(result, this.id, OS.sel_sizeForMagnification_1, magnification); | |
198 return result; | |
199 } | |
200 | |
201 public void start (id sender) | |
202 { | |
203 OS.objc_msgSend(this.id, OS.sel_start_1, sender !is null ? sender.id : null); | |
204 } | |
205 | |
206 public void stepBack (id sender) | |
207 { | |
208 OS.objc_msgSend(this.id, OS.sel_stepBack_1, sender !is null ? sender.id : null); | |
209 } | |
210 | |
211 public void stepForward (id sender) | |
212 { | |
213 OS.objc_msgSend(this.id, OS.sel_stepForward_1, sender !is null ? sender.id : null); | |
214 } | |
215 | |
216 public void stop (id sender) | |
217 { | |
218 OS.objc_msgSend(this.id, OS.sel_stop_1, sender !is null ? sender.id : null); | |
219 } | |
220 | |
221 public float volume () | |
222 { | |
223 return cast(float) OS.objc_msgSend_fpret(this.id, OS.sel_volume); | |
224 } | |
225 | |
226 } |