Mercurial > projects > dstep
view dstep/foundation/NSTimer.d @ 27:57371c29ef73 default tip
ObjcWrap is now automatically mixed in. Added support for building as a dylib with DMD.
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Fri, 09 Apr 2010 23:00:22 +0200 |
parents | b9de51448c6b |
children |
line wrap: on
line source
/** * Copyright: Copyright (c) 2009 Jacob Carlborg. * Authors: Jacob Carlborg * Version: Initial created: Aug 3, 2009 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) */ module dstep.foundation.NSTimer; import dstep.foundation.NSDate; import dstep.foundation.NSInvocation; import dstep.foundation.NSObject; import dstep.objc.bridge.Bridge; import dstep.objc.objc; class NSTimer : NSObject { mixin ObjcWrap; this (id object) { super(object); } this () { super(typeof(this).alloc.init.objcObject); } typeof(this) init () { return invokeObjcSelf!(typeof(this), "init"); } static NSTimer timerWithTimeInterval (double ti, NSInvocation invocation, bool yesOrNo) { return invokeObjcSuperClass!(NSTimer, "timerWithTimeInterval:invocation:repeats:", double, NSInvocation, bool)(ti, invocation, yesOrNo); } static NSTimer scheduledTimerWithTimeInterval (double ti, NSInvocation invocation, bool yesOrNo) { return invokeObjcSuperClass!(NSTimer, "scheduledTimerWithTimeInterval:invocation:repeats:", double, NSInvocation, bool)(ti, invocation, yesOrNo); } static NSTimer timerWithTimeInterval (double ti, Object aTarget, SEL aSelector, Object userInfo, bool yesOrNo) { return invokeObjcSuperClass!(NSTimer, "timerWithTimeInterval:target:selector:userInfo:repeats:", double, Object, SEL, Object, bool)(ti, aTarget, aSelector, userInfo, yesOrNo); } static NSTimer scheduledTimerWithTimeInterval (double ti, Object aTarget, SEL aSelector, Object userInfo, bool yesOrNo) { return invokeObjcSuperClass!(NSTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", double, Object, SEL, Object, bool)(ti, aTarget, aSelector, userInfo, yesOrNo); } Object initWithFireDate (NSDate date, double ti, Object t, SEL s, Object ui, bool rep) { return invokeObjcSelf!(Object, "initWithFireDate:interval:target:selector:userInfo:repeats:", NSDate, double, Object, SEL, Object, bool)(date, ti, t, s, ui, rep); } this (NSDate date, double ti, Object t, SEL s, Object ui, bool rep) { typeof(this).alloc.initWithFireDate(date, ti, t, s, ui, rep); } void fire () { return invokeObjcSelf!(void, "fire"); } NSDate fireDate () { return invokeObjcSelf!(NSDate, "fireDate"); } void setFireDate (NSDate date) { return invokeObjcSelf!(void, "setFireDate:", NSDate)(date); } double timeInterval () { return invokeObjcSelf!(double, "timeInterval"); } void invalidate () { return invokeObjcSelf!(void, "invalidate"); } bool isValid () { return invokeObjcSelf!(bool, "isValid"); } Object userInfo () { return invokeObjcSelf!(Object, "userInfo"); } }