mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
(UI Cocoa) Cleanups
This commit is contained in:
parent
809b96e221
commit
a7bb200a1c
@ -41,6 +41,10 @@
|
|||||||
#include "../../tasks/tasks_internal.h"
|
#include "../../tasks/tasks_internal.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
|
|
||||||
|
/* TODO/FIXME - static global variables */
|
||||||
|
static int waiting_argc;
|
||||||
|
static char **waiting_argv;
|
||||||
|
|
||||||
#if defined(HAVE_COCOA_METAL)
|
#if defined(HAVE_COCOA_METAL)
|
||||||
@interface RAWindow : NSWindow
|
@interface RAWindow : NSWindow
|
||||||
@end
|
@end
|
||||||
@ -53,6 +57,11 @@
|
|||||||
@implementation RApplication
|
@implementation RApplication
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_COCOA_METAL
|
||||||
|
#define CONVERT_POINT() [apple_platform.renderView convertPoint:[event locationInWindow] fromView:nil]
|
||||||
|
#else
|
||||||
|
#define CONVERT_POINT() [[CocoaView get] convertPoint:[event locationInWindow] fromView:nil]
|
||||||
|
#endif
|
||||||
|
|
||||||
- (void)sendEvent:(NSEvent *)event {
|
- (void)sendEvent:(NSEvent *)event {
|
||||||
NSEventType event_type = event.type;
|
NSEventType event_type = event.type;
|
||||||
@ -117,13 +126,7 @@
|
|||||||
{
|
{
|
||||||
CGFloat delta_x = event.deltaX;
|
CGFloat delta_x = event.deltaX;
|
||||||
CGFloat delta_y = event.deltaY;
|
CGFloat delta_y = event.deltaY;
|
||||||
#if defined(HAVE_COCOA_METAL)
|
CGPoint pos = CONVERT_POINT();
|
||||||
CGPoint pos = [apple_platform.renderView
|
|
||||||
convertPoint:[event locationInWindow] fromView:nil];
|
|
||||||
#elif defined(HAVE_COCOA)
|
|
||||||
CGPoint pos = [[CocoaView get]
|
|
||||||
convertPoint:[event locationInWindow] fromView:nil];
|
|
||||||
#endif
|
|
||||||
cocoa_input_data_t
|
cocoa_input_data_t
|
||||||
*apple = (cocoa_input_data_t*)
|
*apple = (cocoa_input_data_t*)
|
||||||
input_driver_get_data();
|
input_driver_get_data();
|
||||||
@ -152,11 +155,7 @@
|
|||||||
case NSEventTypeOtherMouseDown:
|
case NSEventTypeOtherMouseDown:
|
||||||
{
|
{
|
||||||
NSInteger number = event.buttonNumber;
|
NSInteger number = event.buttonNumber;
|
||||||
#ifdef HAVE_COCOA_METAL
|
CGPoint pos = CONVERT_POINT();
|
||||||
CGPoint pos = [apple_platform.renderView convertPoint:[event locationInWindow] fromView:nil];
|
|
||||||
#else
|
|
||||||
CGPoint pos = [[CocoaView get] convertPoint:[event locationInWindow] fromView:nil];
|
|
||||||
#endif
|
|
||||||
cocoa_input_data_t
|
cocoa_input_data_t
|
||||||
*apple = (cocoa_input_data_t*)
|
*apple = (cocoa_input_data_t*)
|
||||||
input_driver_get_data();
|
input_driver_get_data();
|
||||||
@ -171,12 +170,8 @@
|
|||||||
case NSEventTypeOtherMouseUp:
|
case NSEventTypeOtherMouseUp:
|
||||||
{
|
{
|
||||||
NSInteger number = event.buttonNumber;
|
NSInteger number = event.buttonNumber;
|
||||||
#ifdef HAVE_COCOA_METAL
|
CGPoint pos = CONVERT_POINT();
|
||||||
CGPoint pos = [apple_platform.renderView convertPoint:[event locationInWindow] fromView:nil];
|
cocoa_input_data_t
|
||||||
#else
|
|
||||||
CGPoint pos = [[CocoaView get] convertPoint:[event locationInWindow] fromView:nil];
|
|
||||||
#endif
|
|
||||||
cocoa_input_data_t
|
|
||||||
*apple = (cocoa_input_data_t*)
|
*apple = (cocoa_input_data_t*)
|
||||||
input_driver_get_data();
|
input_driver_get_data();
|
||||||
if (!apple || pos.y < 0)
|
if (!apple || pos.y < 0)
|
||||||
@ -192,10 +187,6 @@
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
/* TODO/FIXME - static global variables */
|
|
||||||
static int waiting_argc;
|
|
||||||
static char **waiting_argv;
|
|
||||||
|
|
||||||
@implementation RetroArch_OSX
|
@implementation RetroArch_OSX
|
||||||
|
|
||||||
@synthesize window = _window;
|
@synthesize window = _window;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user