RetroArch/ui/drivers/cocoa/cocoa_common.h
Yoshi Sugawara a18512375b Support for tvOS
- add tvOS target
    - support code signing tvOS cores by adding an argument to the code signing cores script
    - use NSCachesDirectory for the documents directory
    - add some mfi controller handling logic to set non-game controllers to the last index to avoid interfering with operation
    - autodetect mfi controller for apple tv on startup - added autodetect to hid joypad
    - added a webserver to transfer files for tvOS
    - xcode: clean up project, remove unused folders
    - remove HAVE_MATERIALUI setting for tvos build, make it use XMB as default
    - added retroarch app icon courtesy of @MrJs
    - added auto-detect of mfi controller for apple tv
2019-01-29 10:13:46 -10:00

119 lines
3.1 KiB
Objective-C

/* RetroArch - A frontend for libretro.
* Copyright (C) 2013-2014 - Jason Fetters
* Copyright (C) 2011-2017 - Daniel De Matteis
*
* 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/>.
*/
#ifndef __COCOA_COMMON_METAL_H
#define __COCOA_COMMON_METAL_H
#include <Foundation/Foundation.h>
#ifdef HAVE_MENU
#include "../../menu/menu_setting.h"
#include "../../menu/menu_driver.h"
#endif
#ifdef HAVE_CORELOCATION
#include <CoreLocation/CoreLocation.h>
#endif
#if defined(HAVE_COCOATOUCH)
#include <UIKit/UIKit.h>
#if TARGET_OS_TV
#import <GameController/GameController.h>
#endif
#ifdef HAVE_AVFOUNDATION
#import <AVFoundation/AVCaptureOutput.h>
#endif
/*********************************************/
/* RAMenuBase */
/* A menu class that displays RAMenuItemBase */
/* objects. */
/*********************************************/
@interface RAMenuBase : UITableViewController
@property (nonatomic) NSMutableArray* sections;
@property (nonatomic) BOOL hidesHeaders;
@property (nonatomic) RAMenuBase* last_menu;
@property (nonatomic) UILabel *osdmessage;
- (id)initWithStyle:(UITableViewStyle)style;
- (id)itemForIndexPath:(NSIndexPath*)indexPath;
@end
typedef struct
{
char orientations[32];
unsigned orientation_flags;
char bluetooth_mode[64];
} apple_frontend_settings_t;
extern apple_frontend_settings_t apple_frontend_settings;
#if TARGET_OS_IOS
@interface CocoaView : UIViewController<CLLocationManagerDelegate,
AVCaptureAudioDataOutputSampleBufferDelegate>
#elif TARGET_OS_TV
@interface CocoaView : GCEventViewController
#endif
+ (CocoaView*)get;
@end
@interface RetroArch_iOS : UINavigationController<UIApplicationDelegate,
UINavigationControllerDelegate>
@property (nonatomic) UIWindow* window;
@property (nonatomic) NSString* documentsDirectory;
@property (nonatomic) RAMenuBase* mainmenu;
@property (nonatomic) int menu_count;
+ (RetroArch_iOS*)get;
- (void)showGameView;
- (void)toggleUI;
- (void)supportOtherAudioSessions;
- (void)refreshSystemConfig;
- (void)mainMenuPushPop: (bool)pushp;
- (void)mainMenuRefresh;
@end
void get_ios_version(int *major, int *minor);
#elif defined(HAVE_COCOA)
#include <AppKit/AppKit.h>
@interface CocoaView : NSView
#ifdef HAVE_CORELOCATION
<CLLocationManagerDelegate>
#endif
+ (CocoaView*)get;
#if !defined(HAVE_COCOA)
- (void)display;
#endif
@end
#endif
#define BOXSTRING(x) [NSString stringWithUTF8String:x]
#define BOXINT(x) [NSNumber numberWithInt:x]
#define BOXUINT(x) [NSNumber numberWithUnsignedInt:x]
#define BOXFLOAT(x) [NSNumber numberWithDouble:x]
#endif