2013-02-07 08:58:36 -05:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 01:50:59 +01:00
|
|
|
* Copyright (C) 2013-2014 - Jason Fetters
|
|
|
|
* Copyright (C) 2011-2014 - Daniel De Matteis
|
2013-02-07 08:58:36 -05:00
|
|
|
*
|
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2013-07-06 18:24:25 -04:00
|
|
|
#import "RetroArch_Apple.h"
|
2013-02-14 22:09:18 -05:00
|
|
|
#include "rarch_wrapper.h"
|
2013-07-06 20:43:04 -04:00
|
|
|
|
2013-11-22 15:30:02 +01:00
|
|
|
#include "../../general.h"
|
2013-09-08 19:39:28 -04:00
|
|
|
#include "gfx/gfx_common.h"
|
2013-09-13 16:22:04 -04:00
|
|
|
#include "gfx/gfx_context.h"
|
2013-07-06 23:54:47 -04:00
|
|
|
|
2013-12-15 18:11:21 +01:00
|
|
|
#include <CoreLocation/CoreLocation.h>
|
|
|
|
|
|
|
|
static CLLocationManager *locationManager;
|
2013-12-19 15:47:47 +01:00
|
|
|
static bool locationChanged;
|
2013-12-15 19:26:04 +01:00
|
|
|
static CLLocationDegrees currentLatitude;
|
|
|
|
static CLLocationDegrees currentLongitude;
|
2013-12-19 17:39:04 +01:00
|
|
|
static CLLocationAccuracy currentHorizontalAccuracy;
|
|
|
|
static CLLocationAccuracy currentVerticalAccuracy;
|
2013-12-15 18:11:21 +01:00
|
|
|
|
2013-09-13 16:22:04 -04:00
|
|
|
// Define compatibility symbols and categories
|
2013-07-06 20:43:04 -04:00
|
|
|
#ifdef IOS
|
2013-12-01 19:31:00 +01:00
|
|
|
#include <AVFoundation/AVCaptureSession.h>
|
|
|
|
#include <AVFoundation/AVCaptureDevice.h>
|
|
|
|
#include <AVFoundation/AVCaptureOutput.h>
|
|
|
|
#include <AVFoundation/AVCaptureInput.h>
|
|
|
|
#include <AVFoundation/AVMediaFormat.h>
|
|
|
|
#include <CoreVideo/CVOpenGLESTextureCache.h>
|
2013-12-14 20:35:47 -05:00
|
|
|
#define APP_HAS_FOCUS ([[UIApplication sharedApplication] applicationState] == UIApplicationStateActive)
|
2013-02-07 08:58:36 -05:00
|
|
|
|
2013-09-13 16:22:04 -04:00
|
|
|
#define GLContextClass EAGLContext
|
|
|
|
#define GLAPIType GFX_CTX_OPENGL_ES_API
|
|
|
|
#define GLFrameworkID CFSTR("com.apple.opengles")
|
|
|
|
#define RAScreen UIScreen
|
|
|
|
|
|
|
|
@interface EAGLContext (OSXCompat) @end
|
|
|
|
@implementation EAGLContext (OSXCompat)
|
2013-12-14 20:35:47 -05:00
|
|
|
+ (void)clearCurrentContext { [EAGLContext setCurrentContext:nil]; }
|
|
|
|
- (void)makeCurrentContext { [EAGLContext setCurrentContext:self]; }
|
2013-09-13 16:22:04 -04:00
|
|
|
@end
|
|
|
|
|
|
|
|
#elif defined(OSX)
|
|
|
|
#define APP_HAS_FOCUS ([NSApp isActive])
|
|
|
|
|
|
|
|
#define GLContextClass NSOpenGLContext
|
|
|
|
#define GLAPIType GFX_CTX_OPENGL_API
|
|
|
|
#define GLFrameworkID CFSTR("com.apple.opengl")
|
|
|
|
#define RAScreen NSScreen
|
|
|
|
|
|
|
|
#define g_view g_instance // < RAGameView is a container on iOS; on OSX these are both the same object
|
|
|
|
|
|
|
|
@interface NSScreen (IOSCompat) @end
|
|
|
|
@implementation NSScreen (IOSCompat)
|
2013-11-09 00:10:00 +01:00
|
|
|
- (CGRect)bounds
|
|
|
|
{
|
2013-12-14 20:35:47 -05:00
|
|
|
CGRect cgrect = NSRectToCGRect([self frame]);
|
2013-11-09 00:24:34 +01:00
|
|
|
return CGRectMake(0, 0, CGRectGetWidth(cgrect), CGRectGetHeight(cgrect));
|
2013-11-09 00:10:00 +01:00
|
|
|
}
|
2013-09-13 16:22:04 -04:00
|
|
|
- (float) scale { return 1.0f; }
|
|
|
|
@end
|
2013-06-14 00:45:35 -04:00
|
|
|
|
2013-09-13 16:22:04 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef IOS
|
|
|
|
|
2013-11-22 15:30:02 +01:00
|
|
|
#include <GLKit/GLKit.h>
|
2013-09-13 16:22:04 -04:00
|
|
|
#import "views.h"
|
2013-03-05 00:14:26 -05:00
|
|
|
static const float ALMOST_INVISIBLE = .021f;
|
2013-03-20 20:54:38 -04:00
|
|
|
static GLKView* g_view;
|
|
|
|
static UIView* g_pause_indicator_view;
|
2013-02-07 08:58:36 -05:00
|
|
|
|
2013-12-01 19:31:00 +01:00
|
|
|
// Camera
|
|
|
|
static AVCaptureSession *_session;
|
|
|
|
static NSString *_sessionPreset;
|
|
|
|
CVOpenGLESTextureCacheRef textureCache;
|
2013-12-01 22:07:25 +01:00
|
|
|
GLuint outputTexture;
|
2013-12-01 20:39:06 +01:00
|
|
|
static bool newFrame = false;
|
2013-12-01 19:31:00 +01:00
|
|
|
|
2013-07-06 23:54:47 -04:00
|
|
|
#elif defined(OSX)
|
|
|
|
|
2013-08-11 00:20:15 -04:00
|
|
|
#include "apple_input.h"
|
|
|
|
|
2013-09-05 14:38:40 -04:00
|
|
|
static bool g_has_went_fullscreen;
|
2013-08-15 19:28:51 -04:00
|
|
|
static NSOpenGLPixelFormat* g_format;
|
2013-07-06 23:54:47 -04:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2013-09-13 16:22:04 -04:00
|
|
|
static bool g_initialized;
|
|
|
|
static RAGameView* g_instance;
|
|
|
|
static GLContextClass* g_context;
|
|
|
|
|
2013-07-06 23:54:47 -04:00
|
|
|
static int g_fast_forward_skips;
|
|
|
|
static bool g_is_syncing = true;
|
2013-09-13 16:22:04 -04:00
|
|
|
|
2013-07-06 23:54:47 -04:00
|
|
|
|
2013-02-13 18:18:55 -05:00
|
|
|
@implementation RAGameView
|
2013-03-05 00:14:26 -05:00
|
|
|
+ (RAGameView*)get
|
|
|
|
{
|
|
|
|
if (!g_instance)
|
|
|
|
g_instance = [RAGameView new];
|
|
|
|
|
|
|
|
return g_instance;
|
2013-02-07 12:05:46 -05:00
|
|
|
}
|
|
|
|
|
2013-07-06 23:54:47 -04:00
|
|
|
#ifdef OSX
|
|
|
|
|
|
|
|
- (id)init
|
|
|
|
{
|
2013-08-15 19:28:51 -04:00
|
|
|
self = [super init];
|
2013-12-14 20:35:47 -05:00
|
|
|
[self setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
2013-07-06 23:54:47 -04:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2013-08-15 19:28:51 -04:00
|
|
|
- (void)setFrame:(NSRect)frameRect
|
|
|
|
{
|
|
|
|
[super setFrame:frameRect];
|
|
|
|
|
|
|
|
if (g_view && g_context)
|
|
|
|
[g_context update];
|
|
|
|
}
|
|
|
|
|
2013-07-06 23:54:47 -04:00
|
|
|
- (void)display
|
|
|
|
{
|
2013-08-15 19:28:51 -04:00
|
|
|
[g_context flushBuffer];
|
2013-07-06 23:54:47 -04:00
|
|
|
}
|
|
|
|
|
2013-07-07 16:01:58 -04:00
|
|
|
// Stop the annoying sound when pressing a key
|
|
|
|
- (BOOL)acceptsFirstResponder
|
|
|
|
{
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
2013-08-11 00:20:15 -04:00
|
|
|
- (BOOL)isFlipped
|
|
|
|
{
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
2013-07-07 16:01:58 -04:00
|
|
|
- (void)keyDown:(NSEvent*)theEvent
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-12-01 17:06:44 +01:00
|
|
|
#elif defined(IOS)
|
|
|
|
// < iOS Pause menu and lifecycle
|
2013-02-14 21:35:24 -05:00
|
|
|
- (id)init
|
2013-02-07 12:05:46 -05:00
|
|
|
{
|
2013-02-13 13:22:47 -05:00
|
|
|
self = [super init];
|
2013-03-05 00:14:26 -05:00
|
|
|
|
2013-11-22 15:30:02 +01:00
|
|
|
UINib *xib = [UINib nibWithNibName:@"PauseIndicatorView" bundle:nil];
|
2013-03-20 20:54:38 -04:00
|
|
|
g_pause_indicator_view = [[xib instantiateWithOwner:[RetroArch_iOS get] options:nil] lastObject];
|
2013-03-05 00:14:26 -05:00
|
|
|
|
2013-03-20 20:54:38 -04:00
|
|
|
g_view = [GLKView new];
|
|
|
|
g_view.multipleTouchEnabled = YES;
|
|
|
|
g_view.enableSetNeedsDisplay = NO;
|
|
|
|
[g_view addSubview:g_pause_indicator_view];
|
2013-02-16 19:51:55 -05:00
|
|
|
|
2013-03-20 20:54:38 -04:00
|
|
|
self.view = g_view;
|
2013-02-13 13:22:47 -05:00
|
|
|
return self;
|
2013-02-07 19:03:57 -05:00
|
|
|
}
|
|
|
|
|
2013-03-05 00:14:26 -05:00
|
|
|
// Pause Menus
|
|
|
|
- (void)viewWillLayoutSubviews
|
|
|
|
{
|
|
|
|
UIInterfaceOrientation orientation = self.interfaceOrientation;
|
|
|
|
CGRect screenSize = [[UIScreen mainScreen] bounds];
|
2013-02-14 21:35:24 -05:00
|
|
|
|
2013-03-05 00:14:26 -05:00
|
|
|
const float width = ((int)orientation < 3) ? CGRectGetWidth(screenSize) : CGRectGetHeight(screenSize);
|
|
|
|
const float height = ((int)orientation < 3) ? CGRectGetHeight(screenSize) : CGRectGetWidth(screenSize);
|
|
|
|
|
|
|
|
float tenpctw = width / 10.0f;
|
|
|
|
float tenpcth = height / 10.0f;
|
|
|
|
|
2013-03-20 20:54:38 -04:00
|
|
|
g_pause_indicator_view.frame = CGRectMake(tenpctw * 4.0f, 0.0f, tenpctw * 2.0f, tenpcth);
|
2013-05-27 13:04:00 -04:00
|
|
|
[g_pause_indicator_view viewWithTag:1].frame = CGRectMake(0, 0, tenpctw * 2.0f, tenpcth);
|
2013-03-05 00:14:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)hidePauseButton
|
|
|
|
{
|
|
|
|
[UIView animateWithDuration:0.2
|
2013-06-21 23:39:01 -04:00
|
|
|
animations:^{ g_pause_indicator_view.alpha = ALMOST_INVISIBLE; }
|
|
|
|
completion:^(BOOL finished) { }
|
|
|
|
];
|
2013-03-05 00:14:26 -05:00
|
|
|
}
|
|
|
|
|
2013-12-20 19:20:01 -05:00
|
|
|
// NOTE: This version only runs on iOS6
|
|
|
|
- (NSUInteger)supportedInterfaceOrientations
|
|
|
|
{
|
|
|
|
return apple_frontend_settings.orientation_flags;
|
|
|
|
}
|
|
|
|
|
|
|
|
// NOTE: This version runs on iOS2-iOS5, but not iOS6
|
|
|
|
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
|
|
|
{
|
|
|
|
switch (interfaceOrientation)
|
|
|
|
{
|
|
|
|
case UIInterfaceOrientationPortrait:
|
|
|
|
return (apple_frontend_settings.orientation_flags & UIInterfaceOrientationMaskPortrait);
|
|
|
|
case UIInterfaceOrientationPortraitUpsideDown:
|
|
|
|
return (apple_frontend_settings.orientation_flags & UIInterfaceOrientationMaskPortraitUpsideDown);
|
|
|
|
case UIInterfaceOrientationLandscapeLeft:
|
|
|
|
return (apple_frontend_settings.orientation_flags & UIInterfaceOrientationMaskLandscapeLeft);
|
|
|
|
case UIInterfaceOrientationLandscapeRight:
|
|
|
|
return (apple_frontend_settings.orientation_flags & UIInterfaceOrientationMaskLandscapeRight);
|
|
|
|
}
|
|
|
|
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
2013-12-05 13:04:17 +01:00
|
|
|
void event_process_camera_frame(void* pixelBufferPtr)
|
2013-12-01 19:31:00 +01:00
|
|
|
{
|
2013-12-05 13:04:17 +01:00
|
|
|
CVPixelBufferRef pixelBuffer = (CVPixelBufferRef)pixelBufferPtr;
|
|
|
|
|
2013-12-01 19:31:00 +01:00
|
|
|
int width, height;
|
|
|
|
CVReturn ret;
|
|
|
|
|
2013-12-01 22:07:25 +01:00
|
|
|
width = CVPixelBufferGetWidth(pixelBuffer);
|
|
|
|
height = CVPixelBufferGetHeight(pixelBuffer);
|
|
|
|
|
|
|
|
CVPixelBufferLockBaseAddress(pixelBuffer, 0);
|
|
|
|
CVOpenGLESTextureRef renderTexture;
|
2013-12-01 19:31:00 +01:00
|
|
|
|
|
|
|
//TODO - rewrite all this
|
|
|
|
// create a texture from our render target.
|
|
|
|
// textureCache will be what you previously made with CVOpenGLESTextureCacheCreate
|
|
|
|
ret = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault,
|
|
|
|
textureCache, pixelBuffer, NULL, GL_TEXTURE_2D,
|
|
|
|
GL_RGBA, width, height, GL_BGRA, GL_UNSIGNED_BYTE, 0, &renderTexture);
|
2013-12-01 22:07:25 +01:00
|
|
|
if (!renderTexture || ret)
|
2013-12-01 19:31:00 +01:00
|
|
|
{
|
|
|
|
RARCH_ERR("ioscamera: CVOpenGLESTextureCacheCreateTextureFromImage failed.\n");
|
2013-12-01 22:07:25 +01:00
|
|
|
return;
|
2013-12-01 19:31:00 +01:00
|
|
|
}
|
2013-12-01 22:07:25 +01:00
|
|
|
|
|
|
|
outputTexture = CVOpenGLESTextureGetName(renderTexture);
|
|
|
|
glBindTexture(GL_TEXTURE_2D, outputTexture);
|
|
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
|
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
|
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
|
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
|
|
|
|
|
|
|
CVPixelBufferUnlockBaseAddress(pixelBuffer, 0);
|
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"NewCameraTextureReady" object:nil];
|
2013-12-01 20:39:06 +01:00
|
|
|
newFrame = true;
|
2013-12-01 22:07:25 +01:00
|
|
|
|
2013-12-01 23:19:59 +01:00
|
|
|
glBindTexture(GL_TEXTURE_2D, 0);
|
|
|
|
|
2013-12-01 22:07:25 +01:00
|
|
|
CVOpenGLESTextureCacheFlush(textureCache, 0);
|
|
|
|
CFRelease(renderTexture);
|
2013-12-05 13:04:17 +01:00
|
|
|
|
|
|
|
CFRelease(pixelBuffer);
|
|
|
|
pixelBuffer = 0;
|
2013-12-01 22:07:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)captureOutput:(AVCaptureOutput *)captureOutput
|
|
|
|
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
|
|
|
fromConnection:(AVCaptureConnection *)connection
|
|
|
|
{
|
2013-12-05 13:04:17 +01:00
|
|
|
// TODO: Don't post if event queue is full
|
|
|
|
CVPixelBufferRef pixelBuffer = CVPixelBufferRetain(CMSampleBufferGetImageBuffer(sampleBuffer));
|
2013-12-21 19:42:10 -05:00
|
|
|
event_process_camera_frame(pixelBuffer);
|
|
|
|
}
|
2013-12-01 19:31:00 +01:00
|
|
|
|
|
|
|
- (void) onCameraInit
|
|
|
|
{
|
|
|
|
CVReturn ret;
|
|
|
|
int width, height;
|
|
|
|
|
|
|
|
//FIXME - dehardcode this
|
|
|
|
width = 640;
|
|
|
|
height = 480;
|
|
|
|
|
|
|
|
#if COREVIDEO_USE_EAGLCONTEXT_CLASS_IN_API
|
|
|
|
ret = CVOpenGLESTextureCacheCreate(kCFAllocatorDefault, NULL, g_context, NULL, &textureCache);
|
|
|
|
|
|
|
|
#else
|
|
|
|
ret = CVOpenGLESTextureCacheCreate(kCFAllocatorDefault, NULL, (__bridge void *)g_context, NULL, &textureCache);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//-- Setup Capture Session.
|
|
|
|
_session = [[AVCaptureSession alloc] init];
|
|
|
|
[_session beginConfiguration];
|
|
|
|
|
|
|
|
// TODO: dehardcode this based on device capabilities
|
|
|
|
_sessionPreset = AVCaptureSessionPreset640x480;
|
|
|
|
|
|
|
|
//-- Set preset session size.
|
|
|
|
[_session setSessionPreset:_sessionPreset];
|
|
|
|
|
|
|
|
//-- Creata a video device and input from that Device. Add the input to the capture session.
|
|
|
|
AVCaptureDevice * videoDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
|
|
|
|
if(videoDevice == nil)
|
|
|
|
assert(0);
|
|
|
|
|
|
|
|
//-- Add the device to the session.
|
|
|
|
NSError *error;
|
|
|
|
AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:videoDevice error:&error];
|
|
|
|
if(error)
|
2013-12-01 22:07:25 +01:00
|
|
|
{
|
|
|
|
RARCH_ERR("video device input %s\n", error.localizedDescription.UTF8String);
|
2013-12-01 19:31:00 +01:00
|
|
|
assert(0);
|
2013-12-01 22:07:25 +01:00
|
|
|
}
|
2013-12-01 19:31:00 +01:00
|
|
|
|
|
|
|
[_session addInput:input];
|
|
|
|
|
|
|
|
//-- Create the output for the capture session.
|
|
|
|
AVCaptureVideoDataOutput * dataOutput = [[AVCaptureVideoDataOutput alloc] init];
|
2013-12-01 22:07:25 +01:00
|
|
|
[dataOutput setAlwaysDiscardsLateVideoFrames:NO]; // Probably want to set this to NO when recording
|
2013-12-01 19:31:00 +01:00
|
|
|
|
2013-12-01 22:07:25 +01:00
|
|
|
[dataOutput setVideoSettings:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_32BGRA] forKey:(id)kCVPixelBufferPixelFormatTypeKey]];
|
2013-12-01 19:31:00 +01:00
|
|
|
|
|
|
|
// Set dispatch to be on the main thread so OpenGL can do things with the data
|
|
|
|
[dataOutput setSampleBufferDelegate:self queue:dispatch_get_main_queue()];
|
|
|
|
|
|
|
|
[_session addOutput:dataOutput];
|
|
|
|
[_session commitConfiguration];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) onCameraStart
|
|
|
|
{
|
|
|
|
[_session startRunning];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) onCameraStop
|
|
|
|
{
|
|
|
|
[_session stopRunning];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) onCameraFree
|
|
|
|
{
|
|
|
|
CVOpenGLESTextureCacheFlush(textureCache, 0);
|
|
|
|
CFRelease(textureCache);
|
|
|
|
}
|
2013-07-06 23:54:47 -04:00
|
|
|
#endif
|
2013-04-03 11:48:24 -04:00
|
|
|
|
2013-12-19 15:47:47 +01:00
|
|
|
- (bool)onLocationHasChanged
|
|
|
|
{
|
2013-12-21 19:01:10 +01:00
|
|
|
bool hasChanged = locationChanged;
|
|
|
|
|
|
|
|
if (hasChanged)
|
2013-12-19 15:47:47 +01:00
|
|
|
locationChanged = false;
|
2013-12-21 19:01:10 +01:00
|
|
|
|
|
|
|
return hasChanged;
|
2013-12-19 15:47:47 +01:00
|
|
|
}
|
|
|
|
|
2013-12-15 19:01:47 +01:00
|
|
|
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
|
|
|
|
{
|
2013-12-19 15:47:47 +01:00
|
|
|
locationChanged = true;
|
2013-12-15 19:26:04 +01:00
|
|
|
currentLatitude = newLocation.coordinate.latitude;
|
|
|
|
currentLongitude = newLocation.coordinate.longitude;
|
2013-12-19 17:36:27 +01:00
|
|
|
currentHorizontalAccuracy = newLocation.horizontalAccuracy;
|
|
|
|
currentVerticalAccuracy = newLocation.verticalAccuracy;
|
2013-12-15 19:26:04 +01:00
|
|
|
RARCH_LOG("didUpdateToLocation - latitude %f, longitude %f\n", (float)currentLatitude, (float)currentLongitude);
|
2013-12-15 19:01:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
|
|
|
|
{
|
2013-12-19 15:47:47 +01:00
|
|
|
locationChanged = true;
|
2013-12-26 13:27:49 -05:00
|
|
|
CLLocation *location = [locations objectAtIndex:([locations count] - 1)];
|
2013-12-19 17:36:27 +01:00
|
|
|
currentLatitude = [location coordinate].latitude;
|
|
|
|
currentLongitude = [location coordinate].longitude;
|
|
|
|
currentHorizontalAccuracy = [location horizontalAccuracy];
|
|
|
|
currentVerticalAccuracy = [location verticalAccuracy];
|
2013-12-15 19:26:04 +01:00
|
|
|
RARCH_LOG("didUpdateLocations - latitude %f, longitude %f\n", (float)currentLatitude, (float)currentLongitude);
|
2013-12-15 19:01:47 +01:00
|
|
|
}
|
|
|
|
|
2013-12-26 13:27:49 -05:00
|
|
|
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
|
|
|
|
{
|
|
|
|
RARCH_LOG("didFailWithError - %s\n", [[error localizedDescription] UTF8String]);
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)locationManagerDidPauseLocationUpdates:(CLLocationManager *)manager
|
|
|
|
{
|
|
|
|
RARCH_LOG("didPauseLocationUpdates\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)locationManagerDidResumeLocationUpdates:(CLLocationManager *)manager
|
|
|
|
{
|
|
|
|
RARCH_LOG("didResumeLocationUpdates\n");
|
|
|
|
}
|
|
|
|
|
2013-12-25 05:04:18 +01:00
|
|
|
- (void)onLocationInit
|
|
|
|
{
|
|
|
|
// Create the location manager if this object does not
|
|
|
|
// already have one.
|
|
|
|
|
|
|
|
if (locationManager == nil)
|
|
|
|
locationManager = [[CLLocationManager alloc] init];
|
|
|
|
locationManager.delegate = self;
|
|
|
|
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
|
|
|
|
locationManager.distanceFilter = kCLDistanceFilterNone;
|
|
|
|
[locationManager startUpdatingLocation];
|
|
|
|
}
|
|
|
|
|
2013-03-05 00:14:26 -05:00
|
|
|
@end
|
|
|
|
|
2013-09-13 16:22:04 -04:00
|
|
|
static RAScreen* get_chosen_screen()
|
2013-12-21 19:42:10 -05:00
|
|
|
{
|
2013-11-08 23:57:57 +01:00
|
|
|
if (g_settings.video.monitor_index >= RAScreen.screens.count)
|
2013-09-13 16:22:04 -04:00
|
|
|
{
|
2013-11-08 23:57:57 +01:00
|
|
|
RARCH_WARN("video_monitor_index is greater than the number of connected monitors; using main screen instead.\n");
|
2013-12-14 20:35:47 -05:00
|
|
|
return [RAScreen mainScreen];
|
2013-09-13 16:22:04 -04:00
|
|
|
}
|
2013-11-08 23:57:57 +01:00
|
|
|
|
|
|
|
NSArray *screens = [RAScreen screens];
|
2013-12-21 19:42:10 -05:00
|
|
|
return (RAScreen*)[screens objectAtIndex:g_settings.video.monitor_index];
|
2013-09-13 16:22:04 -04:00
|
|
|
}
|
2013-03-20 20:54:38 -04:00
|
|
|
|
2013-11-22 15:30:02 +01:00
|
|
|
bool apple_gfx_ctx_init(void)
|
2013-09-13 16:22:04 -04:00
|
|
|
{
|
2013-12-21 19:42:10 -05:00
|
|
|
// Make sure the view was created
|
|
|
|
[RAGameView get];
|
|
|
|
|
2013-09-13 16:22:04 -04:00
|
|
|
#ifdef IOS // Show pause button for a few seconds, so people know it's there
|
2013-12-21 19:42:10 -05:00
|
|
|
g_pause_indicator_view.alpha = 1.0f;
|
|
|
|
[NSObject cancelPreviousPerformRequestsWithTarget:g_instance];
|
|
|
|
[g_instance performSelector:@selector(hidePauseButton) withObject:g_instance afterDelay:3.0f];
|
2013-09-13 16:22:04 -04:00
|
|
|
#endif
|
2013-04-02 20:39:51 -04:00
|
|
|
|
2013-09-13 16:22:04 -04:00
|
|
|
g_initialized = true;
|
|
|
|
|
2013-02-14 21:35:24 -05:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-11-22 15:30:02 +01:00
|
|
|
void apple_gfx_ctx_destroy(void)
|
2013-02-14 21:35:24 -05:00
|
|
|
{
|
2013-09-13 16:22:04 -04:00
|
|
|
g_initialized = false;
|
|
|
|
|
|
|
|
[GLContextClass clearCurrentContext];
|
|
|
|
|
2013-07-07 14:46:16 -04:00
|
|
|
#ifdef IOS
|
2013-12-21 19:42:10 -05:00
|
|
|
g_view.context = nil;
|
2013-07-07 14:46:16 -04:00
|
|
|
#endif
|
2013-12-21 19:42:10 -05:00
|
|
|
[GLContextClass clearCurrentContext];
|
|
|
|
g_context = nil;
|
2013-02-14 21:35:24 -05:00
|
|
|
}
|
2013-02-07 08:58:36 -05:00
|
|
|
|
2013-09-13 16:22:04 -04:00
|
|
|
bool apple_gfx_ctx_bind_api(enum gfx_ctx_api api, unsigned major, unsigned minor)
|
2013-08-15 19:28:51 -04:00
|
|
|
{
|
2013-09-13 16:22:04 -04:00
|
|
|
if (api != GLAPIType)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
[GLContextClass clearCurrentContext];
|
|
|
|
|
|
|
|
#ifdef OSX
|
2013-12-21 19:42:10 -05:00
|
|
|
[g_context clearDrawable];
|
|
|
|
[g_context release], g_context = nil;
|
|
|
|
[g_format release], g_format = nil;
|
|
|
|
|
|
|
|
NSOpenGLPixelFormatAttribute attributes [] = {
|
|
|
|
NSOpenGLPFADoubleBuffer, // double buffered
|
|
|
|
NSOpenGLPFADepthSize,
|
|
|
|
(NSOpenGLPixelFormatAttribute)16, // 16 bit depth buffer
|
2013-11-09 00:41:00 +01:00
|
|
|
#ifdef MAC_OS_X_VERSION_10_7
|
2013-12-21 19:42:10 -05:00
|
|
|
(major || minor) ? NSOpenGLPFAOpenGLProfile : 0,
|
|
|
|
(major << 12) | (minor << 8),
|
2013-11-09 00:41:00 +01:00
|
|
|
#endif
|
2013-12-21 19:42:10 -05:00
|
|
|
(NSOpenGLPixelFormatAttribute)nil
|
|
|
|
};
|
2013-08-15 19:28:51 -04:00
|
|
|
|
2013-12-21 19:42:10 -05:00
|
|
|
[g_format release];
|
|
|
|
[g_context release];
|
2013-12-13 19:23:22 -05:00
|
|
|
|
2013-12-21 19:42:10 -05:00
|
|
|
g_format = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];
|
|
|
|
g_context = [[NSOpenGLContext alloc] initWithFormat:g_format shareContext:nil];
|
|
|
|
[g_context setView:g_view];
|
2013-09-13 16:22:04 -04:00
|
|
|
#else
|
2013-12-21 19:42:10 -05:00
|
|
|
g_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
|
|
|
|
g_view.context = g_context;
|
2013-09-13 16:22:04 -04:00
|
|
|
#endif
|
|
|
|
|
2013-08-15 19:28:51 -04:00
|
|
|
[g_context makeCurrentContext];
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-09-13 16:22:04 -04:00
|
|
|
void apple_gfx_ctx_swap_interval(unsigned interval)
|
2013-02-08 20:35:19 -05:00
|
|
|
{
|
2013-07-06 23:54:47 -04:00
|
|
|
#ifdef IOS // < No way to disable Vsync on iOS?
|
2013-09-13 16:22:04 -04:00
|
|
|
// Just skip presents so fast forward still works.
|
2013-04-07 21:36:21 -04:00
|
|
|
g_is_syncing = interval ? true : false;
|
|
|
|
g_fast_forward_skips = interval ? 0 : 3;
|
2013-07-06 23:54:47 -04:00
|
|
|
#elif defined(OSX)
|
2013-07-07 20:59:30 -04:00
|
|
|
GLint value = interval ? 1 : 0;
|
2013-08-15 19:28:51 -04:00
|
|
|
[g_context setValues:&value forParameter:NSOpenGLCPSwapInterval];
|
2013-07-06 23:54:47 -04:00
|
|
|
#endif
|
2013-02-08 20:35:19 -05:00
|
|
|
}
|
|
|
|
|
2013-09-13 16:22:04 -04:00
|
|
|
bool apple_gfx_ctx_set_video_mode(unsigned width, unsigned height, bool fullscreen)
|
2013-02-07 08:58:36 -05:00
|
|
|
{
|
2013-09-13 16:22:04 -04:00
|
|
|
#ifdef OSX
|
2013-12-21 19:42:10 -05:00
|
|
|
// TODO: Sceen mode support
|
|
|
|
|
|
|
|
if (fullscreen && !g_has_went_fullscreen)
|
|
|
|
{
|
|
|
|
[g_view enterFullScreenMode:get_chosen_screen() withOptions:nil];
|
|
|
|
[NSCursor hide];
|
|
|
|
}
|
|
|
|
else if (!fullscreen && g_has_went_fullscreen)
|
|
|
|
{
|
|
|
|
[g_view exitFullScreenModeWithOptions:nil];
|
|
|
|
[[g_view window] makeFirstResponder:g_view];
|
|
|
|
[NSCursor unhide];
|
|
|
|
}
|
|
|
|
|
|
|
|
g_has_went_fullscreen = fullscreen;
|
|
|
|
if (!g_has_went_fullscreen)
|
|
|
|
[[g_view window] setContentSize:NSMakeSize(width, height)];
|
2013-09-13 16:22:04 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// TODO: Maybe iOS users should be apple to show/hide the status bar here?
|
|
|
|
|
|
|
|
return true;
|
2013-02-07 08:58:36 -05:00
|
|
|
}
|
2013-02-08 15:50:55 -05:00
|
|
|
|
2013-09-13 16:22:04 -04:00
|
|
|
void apple_gfx_ctx_get_video_size(unsigned* width, unsigned* height)
|
2013-08-11 14:10:10 +02:00
|
|
|
{
|
2013-09-13 16:22:04 -04:00
|
|
|
RAScreen* screen = get_chosen_screen();
|
2013-11-22 16:38:19 +01:00
|
|
|
CGRect size;
|
|
|
|
|
|
|
|
if (g_initialized)
|
|
|
|
{
|
|
|
|
#if defined(OSX) && !defined(MAC_OS_X_VERSION_10_7)
|
2013-12-14 20:35:47 -05:00
|
|
|
CGRect cgrect = NSRectToCGRect([g_view frame]);
|
2013-11-22 16:38:19 +01:00
|
|
|
size = CGRectMake(0, 0, CGRectGetWidth(cgrect), CGRectGetHeight(cgrect));
|
|
|
|
#else
|
2013-12-14 20:35:47 -05:00
|
|
|
size = [g_view bounds];
|
2013-11-22 16:38:19 +01:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
else
|
2013-12-14 20:35:47 -05:00
|
|
|
size = [screen bounds];
|
2013-11-22 16:38:19 +01:00
|
|
|
|
2013-09-13 16:22:04 -04:00
|
|
|
|
2013-12-14 20:35:47 -05:00
|
|
|
*width = CGRectGetWidth(size) * [screen scale];
|
|
|
|
*height = CGRectGetHeight(size) * [screen scale];
|
2013-08-11 14:10:10 +02:00
|
|
|
}
|
|
|
|
|
2013-09-13 16:22:04 -04:00
|
|
|
void apple_gfx_ctx_update_window_title(void)
|
2013-09-05 14:38:40 -04:00
|
|
|
{
|
2013-10-07 20:17:07 +02:00
|
|
|
static char buf[128], buf_fps[128];
|
2013-10-11 01:19:54 +02:00
|
|
|
bool fps_draw = g_settings.fps_show;
|
2013-10-08 22:45:08 +02:00
|
|
|
bool got_text = gfx_get_fps(buf, sizeof(buf), fps_draw ? buf_fps : NULL, sizeof(buf_fps));
|
2013-09-05 14:38:40 -04:00
|
|
|
static const char* const text = buf; // < Can't access buf directly in the block
|
2013-11-22 01:28:54 +01:00
|
|
|
(void)got_text;
|
|
|
|
(void)text;
|
2013-10-11 01:19:54 +02:00
|
|
|
#ifdef OSX
|
2013-09-05 14:38:40 -04:00
|
|
|
if (got_text)
|
2013-12-30 17:17:35 +01:00
|
|
|
[[g_view window] setTitle:[NSString stringWithCString:text encoding:NSUTF8StringEncoding]];
|
2013-10-11 01:19:54 +02:00
|
|
|
#endif
|
2013-10-08 22:45:08 +02:00
|
|
|
if (fps_draw)
|
|
|
|
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
|
2013-09-05 14:38:40 -04:00
|
|
|
}
|
|
|
|
|
2013-09-13 16:22:04 -04:00
|
|
|
bool apple_gfx_ctx_has_focus(void)
|
2013-09-05 14:38:40 -04:00
|
|
|
{
|
2013-09-13 16:22:04 -04:00
|
|
|
return APP_HAS_FOCUS;
|
2013-09-05 14:38:40 -04:00
|
|
|
}
|
|
|
|
|
2013-09-13 16:22:04 -04:00
|
|
|
void apple_gfx_ctx_swap_buffers()
|
2013-08-27 11:37:21 -04:00
|
|
|
{
|
2013-12-30 17:17:35 +01:00
|
|
|
bool swap = --g_fast_forward_skips < 0;
|
|
|
|
|
|
|
|
if (!swap)
|
|
|
|
return;
|
|
|
|
|
|
|
|
[g_view display];
|
|
|
|
g_fast_forward_skips = g_is_syncing ? 0 : 3;
|
2013-09-13 16:22:04 -04:00
|
|
|
}
|
2013-08-27 11:37:21 -04:00
|
|
|
|
2013-09-13 16:22:04 -04:00
|
|
|
gfx_ctx_proc_t apple_gfx_ctx_get_proc_address(const char *symbol_name)
|
|
|
|
{
|
2013-11-09 07:07:35 +01:00
|
|
|
#ifdef MAC_OS_X_VERSION_10_7
|
2013-09-13 16:22:04 -04:00
|
|
|
return (gfx_ctx_proc_t)CFBundleGetFunctionPointerForName(CFBundleGetBundleWithIdentifier(GLFrameworkID),
|
2013-12-12 14:49:18 -05:00
|
|
|
(__bridge CFStringRef)BOXSTRING(symbol_name));
|
2013-11-09 07:07:35 +01:00
|
|
|
#else
|
|
|
|
return (gfx_ctx_proc_t)CFBundleGetFunctionPointerForName(CFBundleGetBundleWithIdentifier(GLFrameworkID),
|
2013-12-23 04:23:46 +01:00
|
|
|
(CFStringRef)BOXSTRING(symbol_name));
|
2013-11-09 07:07:35 +01:00
|
|
|
#endif
|
2013-08-27 11:37:21 -04:00
|
|
|
}
|
|
|
|
|
2013-07-07 13:05:05 -04:00
|
|
|
#ifdef IOS
|
2013-07-05 04:10:05 +02:00
|
|
|
void apple_bind_game_view_fbo(void)
|
2013-02-08 15:50:55 -05:00
|
|
|
{
|
2013-12-21 19:42:10 -05:00
|
|
|
if (g_context)
|
|
|
|
[g_view bindDrawable];
|
2013-02-08 15:50:55 -05:00
|
|
|
}
|
2013-12-01 20:39:06 +01:00
|
|
|
|
|
|
|
typedef struct ios_camera
|
|
|
|
{
|
|
|
|
void *empty;
|
|
|
|
} ioscamera_t;
|
|
|
|
|
|
|
|
static void *ios_camera_init(const char *device, uint64_t caps, unsigned width, unsigned height)
|
|
|
|
{
|
|
|
|
if ((caps & (1ULL << RETRO_CAMERA_BUFFER_OPENGL_TEXTURE)) == 0)
|
|
|
|
{
|
|
|
|
RARCH_ERR("ioscamera returns OpenGL texture.\n");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
ioscamera_t *ioscamera = (ioscamera_t*)calloc(1, sizeof(ioscamera_t));
|
|
|
|
if (!ioscamera)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
[[RAGameView get] onCameraInit];
|
|
|
|
|
|
|
|
return ioscamera;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ios_camera_free(void *data)
|
|
|
|
{
|
|
|
|
ioscamera_t *ioscamera = (ioscamera_t*)data;
|
|
|
|
|
|
|
|
[[RAGameView get] onCameraFree];
|
|
|
|
|
|
|
|
if (ioscamera)
|
|
|
|
free(ioscamera);
|
|
|
|
ioscamera = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool ios_camera_start(void *data)
|
|
|
|
{
|
|
|
|
(void)data;
|
|
|
|
|
|
|
|
[[RAGameView get] onCameraStart];
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ios_camera_stop(void *data)
|
|
|
|
{
|
|
|
|
[[RAGameView get] onCameraStop];
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool ios_camera_poll(void *data, retro_camera_frame_raw_framebuffer_t frame_raw_cb,
|
|
|
|
retro_camera_frame_opengl_texture_t frame_gl_cb)
|
|
|
|
{
|
|
|
|
|
|
|
|
(void)data;
|
|
|
|
(void)frame_raw_cb;
|
|
|
|
|
|
|
|
if (frame_gl_cb && newFrame)
|
|
|
|
{
|
|
|
|
// FIXME: Identity for now. Use proper texture matrix as returned by iOS Camera (if at all?).
|
|
|
|
static const float affine[] = {
|
|
|
|
1.0f, 0.0f, 0.0f,
|
|
|
|
0.0f, 1.0f, 0.0f,
|
|
|
|
0.0f, 0.0f, 1.0f
|
|
|
|
};
|
|
|
|
|
2013-12-01 22:07:25 +01:00
|
|
|
frame_gl_cb(outputTexture, GL_TEXTURE_2D, affine);
|
2013-12-01 20:39:06 +01:00
|
|
|
newFrame = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
const camera_driver_t camera_ios = {
|
|
|
|
ios_camera_init,
|
|
|
|
ios_camera_free,
|
|
|
|
ios_camera_start,
|
|
|
|
ios_camera_stop,
|
|
|
|
ios_camera_poll,
|
|
|
|
"ios",
|
|
|
|
};
|
2013-07-07 23:17:38 +02:00
|
|
|
#endif
|
2013-12-19 02:39:06 +01:00
|
|
|
|
|
|
|
#ifdef HAVE_LOCATION
|
|
|
|
typedef struct apple_location
|
|
|
|
{
|
|
|
|
void *empty;
|
|
|
|
} applelocation_t;
|
|
|
|
|
2013-12-19 15:58:15 +01:00
|
|
|
static void *apple_location_init()
|
2013-12-19 02:39:06 +01:00
|
|
|
{
|
|
|
|
applelocation_t *applelocation = (applelocation_t*)calloc(1, sizeof(applelocation_t));
|
|
|
|
if (!applelocation)
|
|
|
|
return NULL;
|
2013-12-25 05:04:18 +01:00
|
|
|
|
|
|
|
[[RAGameView get] onLocationInit];
|
2013-12-19 02:39:06 +01:00
|
|
|
|
|
|
|
return applelocation;
|
|
|
|
}
|
|
|
|
|
2013-12-19 15:47:47 +01:00
|
|
|
static void apple_location_set_interval(void *data, unsigned interval_update_ms, unsigned interval_distance)
|
2013-12-19 03:37:26 +01:00
|
|
|
{
|
|
|
|
(void)data;
|
|
|
|
|
2013-12-21 19:42:10 -05:00
|
|
|
locationManager.distanceFilter = interval_distance ? interval_distance : kCLDistanceFilterNone;
|
2013-12-19 03:37:26 +01:00
|
|
|
}
|
|
|
|
|
2013-12-19 02:39:06 +01:00
|
|
|
static void apple_location_free(void *data)
|
|
|
|
{
|
|
|
|
applelocation_t *applelocation = (applelocation_t*)data;
|
|
|
|
|
2013-12-21 18:48:13 -05:00
|
|
|
/* TODO - free location manager? */
|
2013-12-19 02:39:06 +01:00
|
|
|
|
|
|
|
if (applelocation)
|
|
|
|
free(applelocation);
|
|
|
|
applelocation = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool apple_location_start(void *data)
|
|
|
|
{
|
|
|
|
(void)data;
|
|
|
|
|
2013-12-21 19:42:10 -05:00
|
|
|
[locationManager startUpdatingLocation];
|
2013-12-19 02:39:06 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void apple_location_stop(void *data)
|
|
|
|
{
|
|
|
|
(void)data;
|
|
|
|
|
2013-12-21 19:42:10 -05:00
|
|
|
[locationManager stopUpdatingLocation];
|
2013-12-19 02:39:06 +01:00
|
|
|
}
|
|
|
|
|
2013-12-19 17:36:27 +01:00
|
|
|
static bool apple_location_get_position(void *data, double *lat, double *lon, double *horiz_accuracy,
|
|
|
|
double *vert_accuracy)
|
2013-12-19 02:39:06 +01:00
|
|
|
{
|
|
|
|
(void)data;
|
|
|
|
|
2013-12-19 15:47:47 +01:00
|
|
|
bool ret = [[RAGameView get] onLocationHasChanged];
|
|
|
|
|
|
|
|
if (!ret)
|
|
|
|
goto fail;
|
2013-12-19 02:39:06 +01:00
|
|
|
|
2013-12-21 18:48:13 -05:00
|
|
|
*lat = currentLatitude;
|
|
|
|
*lon = currentLongitude;
|
|
|
|
*horiz_accuracy = currentHorizontalAccuracy;
|
|
|
|
*vert_accuracy = currentVerticalAccuracy;
|
2013-12-19 15:47:47 +01:00
|
|
|
return true;
|
|
|
|
|
|
|
|
fail:
|
2013-12-19 17:36:27 +01:00
|
|
|
*lat = 0.0;
|
|
|
|
*lon = 0.0;
|
|
|
|
*horiz_accuracy = 0.0;
|
|
|
|
*vert_accuracy = 0.0;
|
2013-12-19 15:47:47 +01:00
|
|
|
return false;
|
2013-12-19 02:39:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const location_driver_t location_apple = {
|
|
|
|
apple_location_init,
|
|
|
|
apple_location_free,
|
|
|
|
apple_location_start,
|
|
|
|
apple_location_stop,
|
2013-12-19 15:47:47 +01:00
|
|
|
apple_location_get_position,
|
2013-12-19 03:41:28 +01:00
|
|
|
apple_location_set_interval,
|
2013-12-19 02:39:06 +01:00
|
|
|
"apple",
|
|
|
|
};
|
2013-12-19 03:37:26 +01:00
|
|
|
#endif
|