2013-03-15 13:11:33 +00:00
|
|
|
@interface CocoaTimer : NSObject {
|
|
|
|
@public
|
2013-05-02 11:25:45 +00:00
|
|
|
phoenix::Timer* timer;
|
|
|
|
NSTimer* instance;
|
2013-03-15 13:11:33 +00:00
|
|
|
}
|
2013-03-21 12:59:01 +00:00
|
|
|
-(id) initWith:(phoenix::Timer&)timer;
|
2013-03-15 13:11:33 +00:00
|
|
|
-(NSTimer*) instance;
|
|
|
|
-(void) update;
|
2013-03-21 12:59:01 +00:00
|
|
|
-(void) run:(NSTimer*)instance;
|
2013-03-15 13:11:33 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
namespace phoenix {
|
|
|
|
|
|
|
|
struct pTimer : public pObject {
|
2013-05-02 11:25:45 +00:00
|
|
|
Timer& timer;
|
|
|
|
CocoaTimer* cocoaTimer = nullptr;
|
2013-03-15 13:11:33 +00:00
|
|
|
|
|
|
|
void setEnabled(bool enabled);
|
2013-11-28 10:29:01 +00:00
|
|
|
void setInterval(unsigned interval);
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
pTimer(Timer& timer) : pObject(timer), timer(timer) {}
|
2013-03-15 13:11:33 +00:00
|
|
|
void constructor();
|
|
|
|
void destructor();
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|