Mercurial > projects > dwt-mac
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwt/internal/cocoa/NSMovieView.d Sat Aug 09 17:00:02 2008 +0200 @@ -0,0 +1,226 @@ +/******************************************************************************* + * Copyright (c) 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * + * Port to the D Programming language: + * Jacob Carlborg <jacob.carlborg@gmail.com> + *******************************************************************************/ +module dwt.internal.cocoa.NSMovieView; + +import dwt.internal.cocoa.CGFloat; +import dwt.internal.cocoa.id; +import dwt.internal.cocoa.NSInteger; +import dwt.internal.cocoa.NSMovie; +import dwt.internal.cocoa.NSRect; +import dwt.internal.cocoa.NSSize; +import dwt.internal.cocoa.NSView; +import dwt.internal.cocoa.OS; +import objc = dwt.internal.objc.runtime; + +alias NSUInteger NSQTMovieLoopMode; + +public class NSMovieView : NSView +{ + + public this () + { + super(); + } + + public this (objc.id id) + { + super(id); + } + + public void clear (id sender) + { + OS.objc_msgSend(this.id, OS.sel_clear_1, sender !is null ? sender.id : null); + } + + public void copy (id sender) + { + OS.objc_msgSend(this.id, OS.sel_copy_1, sender !is null ? sender.id : null); + } + + public void cut (id sender) + { + OS.objc_msgSend(this.id, OS.sel_cut_1, sender !is null ? sender.id : null); + } + + public void deletee (id sender) + { + OS.objc_msgSend(this.id, OS.sel_delete_1, sender !is null ? sender.id : null); + } + + public void gotoBeginning (id sender) + { + OS.objc_msgSend(this.id, OS.sel_gotoBeginning_1, sender !is null ? sender.id : null); + } + + public void gotoEnd (id sender) + { + OS.objc_msgSend(this.id, OS.sel_gotoEnd_1, sender !is null ? sender.id : null); + } + + public void gotoPosterFrame (id sender) + { + OS.objc_msgSend(this.id, OS.sel_gotoPosterFrame_1, sender !is null ? sender.id : null); + } + + public bool isControllerVisible () + { + return OS.objc_msgSend(this.id, OS.sel_isControllerVisible) !is null; + } + + public bool isEditable () + { + return OS.objc_msgSend(this.id, OS.sel_isEditable) !is null; + } + + public bool isMuted () + { + return OS.objc_msgSend(this.id, OS.sel_isMuted) !is null; + } + + public bool isPlaying () + { + return OS.objc_msgSend(this.id, OS.sel_isPlaying) !is null; + } + + public NSQTMovieLoopMode loopMode () + { + return OS.objc_msgSend(this.id, OS.sel_loopMode); + } + + public NSMovie movie () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_movie); + return result !is null ? new NSMovie(result) : null; + } + + public void* movieController () + { + return OS.objc_msgSend(this.id, OS.sel_movieController); + } + + public NSRect movieRect () + { + NSRect result; + OS.objc_msgSend_stret(result, this.id, OS.sel_movieRect); + return result; + } + + public void paste (id sender) + { + OS.objc_msgSend(this.id, OS.sel_paste_1, sender !is null ? sender.id : null); + } + + public bool playsEveryFrame () + { + return OS.objc_msgSend(this.id, OS.sel_playsEveryFrame) !is null; + } + + public bool playsSelectionOnly () + { + return OS.objc_msgSend(this.id, OS.sel_playsSelectionOnly) !is null; + } + + public float rate () + { + return cast(float) OS.objc_msgSend_fpret(this.id, OS.sel_rate); + } + + public void resizeWithMagnification (CGFloat magnification) + { + OS.objc_msgSend(this.id, OS.sel_resizeWithMagnification_1, magnification); + } + + public void selectAll (id sender) + { + OS.objc_msgSend(this.id, OS.sel_selectAll_1, sender !is null ? sender.id : null); + } + + public void setEditable (bool editable) + { + OS.objc_msgSend(this.id, OS.sel_setEditable_1, editable); + } + + public void setLoopMode (NSQTMovieLoopMode mode) + { + OS.objc_msgSend(this.id, OS.sel_setLoopMode_1, mode); + } + + public void setMovie (NSMovie movie) + { + OS.objc_msgSend(this.id, OS.sel_setMovie_1, movie !is null ? movie.id : null); + } + + public void setMuted (bool mute) + { + OS.objc_msgSend(this.id, OS.sel_setMuted_1, mute); + } + + public void setPlaysEveryFrame (bool flag) + { + OS.objc_msgSend(this.id, OS.sel_setPlaysEveryFrame_1, flag); + } + + public void setPlaysSelectionOnly (bool flag) + { + OS.objc_msgSend(this.id, OS.sel_setPlaysSelectionOnly_1, flag); + } + + public void setRate (float rate) + { + OS.objc_msgSend(this.id, OS.sel_setRate_1, rate); + } + + public void setVolume (float volume) + { + OS.objc_msgSend(this.id, OS.sel_setVolume_1, volume); + } + + public void showController (bool show, bool adjustSize) + { + OS.objc_msgSend(this.id, OS.sel_showController_1adjustingSize_1, show, adjustSize); + } + + public NSSize sizeForMagnification (CGFloat magnification) + { + NSSize result; + OS.objc_msgSend_stret(result, this.id, OS.sel_sizeForMagnification_1, magnification); + return result; + } + + public void start (id sender) + { + OS.objc_msgSend(this.id, OS.sel_start_1, sender !is null ? sender.id : null); + } + + public void stepBack (id sender) + { + OS.objc_msgSend(this.id, OS.sel_stepBack_1, sender !is null ? sender.id : null); + } + + public void stepForward (id sender) + { + OS.objc_msgSend(this.id, OS.sel_stepForward_1, sender !is null ? sender.id : null); + } + + public void stop (id sender) + { + OS.objc_msgSend(this.id, OS.sel_stop_1, sender !is null ? sender.id : null); + } + + public float volume () + { + return cast(float) OS.objc_msgSend_fpret(this.id, OS.sel_volume); + } + +}