(Cocoa) Rename RAGameView to CocoaView

This commit is contained in:
twinaphex 2015-04-20 20:39:39 +02:00
parent 63d7cc19a4
commit e8a8b378d5
6 changed files with 27 additions and 33 deletions

View File

@ -12,16 +12,10 @@ SRC_DIR := ../..
APPLICATION_NAME = RetroArch
${APPLICATION_NAME}_FRAMEWORKS = Foundation UIKit CoreGraphics AudioToolbox GLKit OpenGLES CoreText CoreLocation CoreAudio AVFoundation CoreMedia CoreVideo GameController
${APPLICATION_NAME}_FILES = $(SRC_DIR)/griffin/griffin.c \
$(SRC_DIR)/griffin/griffin_objc.m \
$(SRC_DIR)/audio/audio_utils_neon.S \
$(SRC_DIR)/audio/drivers_resampler/sinc_neon.S \
$(SRC_DIR)/audio/drivers_resampler/cc_resampler_neon.S \
$(SRC_DIR)/apple/iOS/browser.m \
$(SRC_DIR)/apple/iOS/menu.m \
$(SRC_DIR)/apple/iOS/platform.m \
$(SRC_DIR)/apple/common/apple_gamecontroller.m \
$(SRC_DIR)/apple/common/CFExtensions.m \
$(SRC_DIR)/apple/common/RAGameView.m \
$(SRC_DIR)/apple/common/utility.m \
$(SRC_DIR)/audio/drivers_resampler/cc_resampler_neon.S
COMMON_FLAGS := -DIOS -DHAVE_GRIFFIN -DHAVE_CORELOCATION -DHAVE_NETPLAY -DHAVE_RGUI -DHAVE_MENU -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_GLSL -DINLINE=inline -DLSB_FIRST -DHAVE_THREADS -D__LIBRETRO__ -DRARCH_MOBILE -std=gnu99 -DHAVE_COREAUDIO -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_ZLIB -DWANT_ZLIB -DSINC_LOWER_QUALITY -DRARCH_INTERNAL -DHAVE_FILTERS_BUILTIN -DHAVE_XMB -D_LZMA_UINT32_IS_ULONG -DHAVE_STRL
COMMON_FLAGS += -DHAVE_AVFOUNDATION

View File

@ -149,7 +149,7 @@ static bool cocoagl_gfx_ctx_init(void *data)
(void)data;
#if defined(HAVE_COCOA)
RAGameView *g_view = (RAGameView*)nsview_get_ptr();
CocoaView *g_view = (CocoaView*)nsview_get_ptr();
NSOpenGLPixelFormatAttribute attributes [] = {
NSOpenGLPFAColorSize, 24,
NSOpenGLPFADoubleBuffer,
@ -188,7 +188,7 @@ static bool cocoagl_gfx_ctx_init(void *data)
[g_context makeCurrentContext];
// Make sure the view was created
[RAGameView get];
[CocoaView get];
return true;
}
@ -254,7 +254,7 @@ static void cocoagl_gfx_ctx_swap_interval(void *data, unsigned interval)
static bool cocoagl_gfx_ctx_set_video_mode(void *data, unsigned width, unsigned height, bool fullscreen)
{
#if defined(HAVE_COCOA)
RAGameView *g_view = (RAGameView*)nsview_get_ptr();
CocoaView *g_view = (CocoaView*)nsview_get_ptr();
/* TODO: Screen mode support. */
if (fullscreen && !g_has_went_fullscreen)
@ -316,7 +316,7 @@ static void cocoagl_gfx_ctx_get_video_size(void *data, unsigned* width, unsigned
float screenscale = cocoagl_gfx_ctx_get_native_scale();
#if defined(HAVE_COCOA)
RAGameView *g_view = (RAGameView*)nsview_get_ptr();
CocoaView *g_view = (CocoaView*)nsview_get_ptr();
CGRect cgrect = NSRectToCGRect([g_view frame]);
size = CGRectMake(0, 0, CGRectGetWidth(cgrect), CGRectGetHeight(cgrect));
#else
@ -337,7 +337,7 @@ static void cocoagl_gfx_ctx_update_window_title(void *data)
(void)got_text;
#if defined(HAVE_COCOA)
RAGameView *g_view = (RAGameView*)nsview_get_ptr();
CocoaView *g_view = (CocoaView*)nsview_get_ptr();
static const char* const text = buf; /* < Can't access buffer directly in the block */
if (got_text)
[[g_view window] setTitle:[NSString stringWithCString:text encoding:NSUTF8StringEncoding]];

View File

@ -160,8 +160,8 @@ typedef struct
} apple_frontend_settings_t;
extern apple_frontend_settings_t apple_frontend_settings;
@interface RAGameView : UIViewController<CLLocationManagerDelegate, AVCaptureAudioDataOutputSampleBufferDelegate>
+ (RAGameView*)get;
@interface CocoaView : UIViewController<CLLocationManagerDelegate, AVCaptureAudioDataOutputSampleBufferDelegate>
+ (CocoaView*)get;
@end
@interface RetroArch_iOS : UINavigationController<UIApplicationDelegate, UINavigationControllerDelegate, RetroArch_Platform>
@ -189,12 +189,12 @@ void get_ios_version(int *major, int *minor);
#endif
@interface RAGameView : NSView
@interface CocoaView : NSView
#ifdef HAVE_CORELOCATION
<CLLocationManagerDelegate>
#endif
+ (RAGameView*)get;
+ (CocoaView*)get;
#if !defined(HAVE_COCOA)
- (void)display;
#endif

View File

@ -82,7 +82,7 @@
#endif
#endif
static RAGameView* g_instance;
static CocoaView* g_instance;
#if defined(HAVE_COCOA)
void *nsview_get_ptr(void)
@ -95,11 +95,11 @@ void *nsview_get_ptr(void)
void cocoagl_gfx_ctx_update(void);
void *glkitview_init(void);
@implementation RAGameView
+ (RAGameView*)get
@implementation CocoaView
+ (CocoaView*)get
{
if (!g_instance)
g_instance = [RAGameView new];
g_instance = [CocoaView new];
return g_instance;
}
@ -469,7 +469,7 @@ static void *apple_camera_init(const char *device, uint64_t caps, unsigned width
if (!applecamera)
return NULL;
[[RAGameView get] onCameraInit];
[[CocoaView get] onCameraInit];
return applecamera;
}
@ -478,7 +478,7 @@ static void apple_camera_free(void *data)
{
applecamera_t *applecamera = (applecamera_t*)data;
[[RAGameView get] onCameraFree];
[[CocoaView get] onCameraFree];
if (applecamera)
free(applecamera);
@ -489,14 +489,14 @@ static bool apple_camera_start(void *data)
{
(void)data;
[[RAGameView get] onCameraStart];
[[CocoaView get] onCameraStart];
return true;
}
static void apple_camera_stop(void *data)
{
[[RAGameView get] onCameraStop];
[[CocoaView get] onCameraStop];
}
static bool apple_camera_poll(void *data, retro_camera_frame_raw_framebuffer_t frame_raw_cb,
@ -545,7 +545,7 @@ static void *apple_location_init(void)
if (!applelocation)
return NULL;
[[RAGameView get] onLocationInit];
[[CocoaView get] onLocationInit];
return applelocation;
}
@ -588,7 +588,7 @@ static bool apple_location_get_position(void *data, double *lat, double *lon, do
{
(void)data;
bool ret = [[RAGameView get] onLocationHasChanged];
bool ret = [[CocoaView get] onLocationHasChanged];
if (!ret)
goto fail;

View File

@ -111,7 +111,7 @@ void apple_rarch_exited(void)
apple->mouse_y = event.deltaY;
/* Absolute */
pos = [[RAGameView get] convertPoint:[event locationInWindow] fromView:nil];
pos = [[CocoaView get] convertPoint:[event locationInWindow] fromView:nil];
apple->touches[0].screen_x = pos.x;
apple->touches[0].screen_y = pos.y;
}
@ -166,10 +166,10 @@ static char** waiting_argv;
[self.window setAcceptsMouseMovedEvents: YES];
[[RAGameView get] setFrame: [[self.window contentView] bounds]];
[[CocoaView get] setFrame: [[self.window contentView] bounds]];
[[self.window contentView] setAutoresizesSubviews:YES];
[[self.window contentView] addSubview:[RAGameView get]];
[self.window makeFirstResponder:[RAGameView get]];
[[self.window contentView] addSubview:[CocoaView get]];
[self.window makeFirstResponder:[CocoaView get]];
self.settingsWindow = [[[NSWindowController alloc] initWithWindowNibName:BOXSTRING("Settings")] autorelease];

View File

@ -133,7 +133,7 @@ static void handle_touch_event(NSArray* touches)
CGPoint coord;
UITouch *touch = [touches objectAtIndex:i];
if (touch.view != [RAGameView get].view)
if (touch.view != [CocoaView get].view)
continue;
coord = [touch locationInView:[touch view]];
@ -378,7 +378,7 @@ enum
[self setToolbarHidden:true animated:NO];
[[UIApplication sharedApplication] setStatusBarHidden:true withAnimation:UIStatusBarAnimationNone];
[[UIApplication sharedApplication] setIdleTimerDisabled:true];
[self.window setRootViewController:[RAGameView get]];
[self.window setRootViewController:[CocoaView get]];
runloop->is_paused = false;
runloop->is_idle = false;