view dwt/internal/cocoa/NSMovieView.d @ 13:f565d3a95c0a

Ported dwt.internal
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Fri, 22 Aug 2008 16:46:34 +0200
parents 8b48be5454ce
children
line wrap: on
line source

/*******************************************************************************
 * 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 cast(NSQTMovieLoopMode) 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);
    }

}