2016-05-28 11:01:13 +00:00
|
|
|
//
|
|
|
|
// EmulatorProtocol.h
|
|
|
|
// Mini vMac
|
|
|
|
//
|
|
|
|
// Created by Jesús A. Álvarez on 27/05/2016.
|
2018-04-28 10:12:43 +00:00
|
|
|
// Copyright © 2016-2018 namedfork. All rights reserved.
|
2016-05-28 11:01:13 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
@import Foundation;
|
|
|
|
@import CoreGraphics;
|
|
|
|
@import QuartzCore;
|
|
|
|
|
2024-02-10 13:33:11 +00:00
|
|
|
typedef NS_ENUM(NSInteger, EmulatorSpeed) {
|
2016-06-06 14:09:23 +00:00
|
|
|
EmulatorSpeedAllOut = -1,
|
|
|
|
EmulatorSpeed1x = 0,
|
|
|
|
EmulatorSpeed2x = 1,
|
|
|
|
EmulatorSpeed4x = 2,
|
|
|
|
EmulatorSpeed8x = 3,
|
|
|
|
EmulatorSpeed16x = 4,
|
|
|
|
EmulatorSpeed32x = 5
|
2024-02-10 13:33:11 +00:00
|
|
|
};
|
2016-06-06 14:09:23 +00:00
|
|
|
|
2016-05-28 11:01:13 +00:00
|
|
|
@protocol Emulator <NSObject>
|
|
|
|
|
|
|
|
@property (nonatomic, strong) NSString *dataPath;
|
|
|
|
@property (nonatomic, assign, getter=isRunning) BOOL running;
|
2016-06-06 14:09:23 +00:00
|
|
|
@property (nonatomic, assign) EmulatorSpeed speed;
|
|
|
|
@property (nonatomic, assign) BOOL autoSlow;
|
|
|
|
@property (nonatomic, readonly) BOOL initialAutoSlow;
|
|
|
|
@property (nonatomic, readonly) BOOL autoSlowSupported;
|
2016-05-28 11:01:13 +00:00
|
|
|
@property (nonatomic, weak) CALayer *screenLayer;
|
|
|
|
|
2016-05-28 20:20:55 +00:00
|
|
|
@property (nonatomic, readonly) NSBundle *bundle;
|
2016-05-28 11:01:13 +00:00
|
|
|
@property (nonatomic, readonly) CGSize screenSize;
|
2016-07-02 13:18:26 +00:00
|
|
|
@property (nonatomic, readonly) NSString *insertDiskNotification, *ejectDiskNotification, *shutdownNotification;
|
2016-05-28 11:01:13 +00:00
|
|
|
@property (nonatomic, readonly) NSInteger initialSpeed;
|
|
|
|
|
|
|
|
@property (nonatomic, readonly) BOOL anyDiskInserted;
|
2016-06-04 13:00:31 +00:00
|
|
|
@property (nonatomic, readonly) NSString *currentApplication;
|
2016-05-28 11:01:13 +00:00
|
|
|
|
2024-02-09 15:06:37 +00:00
|
|
|
@property (nonatomic, strong) void (^showAlert)(NSString *title, NSString *message);
|
|
|
|
@property (nonatomic, strong) UIViewController *rootViewController;
|
|
|
|
|
2016-05-28 11:01:13 +00:00
|
|
|
- (void)run;
|
|
|
|
- (void)reset;
|
|
|
|
- (void)interrupt;
|
2020-09-24 22:29:30 +00:00
|
|
|
- (void)shutdown;
|
2016-05-28 11:01:13 +00:00
|
|
|
|
|
|
|
- (void)keyDown:(int)scancode;
|
|
|
|
- (void)keyUp:(int)scancode;
|
|
|
|
|
|
|
|
- (void)setMouseX:(NSInteger)x Y:(NSInteger)y;
|
|
|
|
- (void)moveMouseX:(NSInteger)x Y:(NSInteger)y;
|
|
|
|
- (void)setMouseButton:(BOOL)down;
|
|
|
|
|
|
|
|
- (BOOL)insertDisk:(NSString*)path;
|
|
|
|
- (BOOL)isDiskInserted:(NSString*)path;
|
|
|
|
|
|
|
|
@end
|