iOS ViewController: Move external methods to a protocol

This commit is contained in:
Henrik Rydgård 2024-05-21 14:20:42 +02:00
parent 076194eb6f
commit 3166eee3f0
2 changed files with 15 additions and 9 deletions

View file

@ -9,17 +9,22 @@
#import "CameraHelper.h"
#import "LocationHelper.h"
@interface ViewController : GLKViewController <iCadeEventDelegate,
LocationHandlerDelegate, CameraFrameDelegate, UIGestureRecognizerDelegate, UIKeyInput>
- (void)shareText:(NSString *)text;
- (void)shutdown;
@protocol PPSSPPViewController<NSObject>
@optional
- (void)hideKeyboard;
- (void)showKeyboard;
- (void)shareText:(NSString *)text;
- (void)shutdown;
- (void)bindDefaultFBO;
@end
extern __unsafe_unretained ViewController* sharedViewController;
@interface ViewController : GLKViewController <
iCadeEventDelegate, LocationHandlerDelegate, CameraFrameDelegate,
UIGestureRecognizerDelegate, UIKeyInput, PPSSPPViewController>
@end
extern id <PPSSPPViewController> sharedViewController;
void setCameraSize(int width, int height);
void startVideo();
void stopVideo();

View file

@ -98,7 +98,7 @@ static bool threadEnabled = true;
static bool threadStopped = false;
static UITouch *g_touches[10];
__unsafe_unretained ViewController* sharedViewController;
id<PPSSPPViewController> sharedViewController;
static GraphicsContext *graphicsContext;
static CameraHelper *cameraHelper;
static LocationHelper *locationHelper;
@ -181,7 +181,6 @@ extern float g_safeInsetBottom;
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self hideKeyboard];
}
- (void)viewDidLoad {
@ -240,6 +239,8 @@ extern float g_safeInsetBottom;
locationHelper = [[LocationHelper alloc] init];
[locationHelper setDelegate:self];
[self hideKeyboard];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
NativeInitGraphics(graphicsContext);