Move WindowListener around

This commit is contained in:
Jean-André Santoni 2019-11-19 12:00:24 +07:00
parent c7ce2c7053
commit 947e15f34f
No known key found for this signature in database
GPG Key ID: 9D694E373914CC36
2 changed files with 34 additions and 31 deletions

View File

@ -1,15 +1,41 @@
#ifndef COCOA_APPLE_PLATFORM_H
#define COCOA_APPLE_PLATFORM_H
#if defined(HAVE_COCOA_METAL)
#import <Metal/Metal.h>
#import <MetalKit/MetalKit.h>
@interface WindowListener : NSResponder <NSWindowDelegate>
@end
@implementation WindowListener
/* Similarly to SDL, we'll respond to key events by doing nothing so we don't beep.
*/
- (void)flagsChanged:(NSEvent *)event
{
}
- (void)keyDown:(NSEvent *)event
{
}
- (void)keyUp:(NSEvent *)event
{
}
@end
#endif
#if defined(HAVE_COCOA_METAL)
id<ApplePlatform> apple_platform;
@interface RetroArch_OSX : NSObject <ApplePlatform, NSApplicationDelegate>
{
NSWindow* _window;
apple_view_type_t _vt;
NSView* _renderView;
id _sleepActivity;
WindowListener *_listener;
NSWindow *_window;
apple_view_type_t _vt;
NSView *_renderView;
id _sleepActivity;
WindowListener *_listener;
}
#elif defined(HAVE_COCOA)
id apple_platform;
@ -19,11 +45,11 @@ id apple_platform;
@interface RetroArch_OSX : NSObject <NSApplicationDelegate>
#endif
{
NSWindow* _window;
NSWindow *_window;
}
#endif
@property (nonatomic, retain) NSWindow IBOutlet* window;
@property(nonatomic, retain) NSWindow IBOutlet *window;
@end

View File

@ -40,29 +40,6 @@
#include "../../tasks/tasks_internal.h"
#include ".././verbosity.h"
#if defined(HAVE_COCOA_METAL)
#import <Metal/Metal.h>
#import <MetalKit/MetalKit.h>
@interface WindowListener : NSResponder<NSWindowDelegate>
@end
@implementation WindowListener
/* Similarly to SDL, we'll respond to key events by doing nothing so we don't beep.
*/
- (void)flagsChanged:(NSEvent *)event
{}
- (void)keyDown:(NSEvent *)event
{}
- (void)keyUp:(NSEvent *)event
{}
@end
#endif
#include "cocoa/apple_platform.h"
static void app_terminate(void)
@ -151,7 +128,7 @@ static void app_terminate(void)
apple = (cocoa_input_data_t*)input_driver_get_data();
if (!apple)
return;
pos.x = 0;
pos.y = 0;