RetroArch/ui/drivers/cocoa/cocoa_common.h

112 lines
3.0 KiB
C
Raw Normal View History

/* RetroArch - A frontend for libretro.
2014-01-01 01:50:59 +01:00
* Copyright (C) 2013-2014 - Jason Fetters
2017-01-22 13:40:32 +01:00
* 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/>.
*/
2013-02-08 17:03:19 -05:00
2015-04-20 12:59:24 +02:00
#ifndef __COCOA_COMMON_H
#define __COCOA_COMMON_H
2013-07-06 20:43:04 -04:00
#include <Foundation/Foundation.h>
2015-12-06 18:18:50 +01:00
#ifdef HAVE_MENU
2015-09-16 09:21:29 +02:00
#include "../../menu/menu_setting.h"
2015-12-06 18:18:50 +01:00
#include "../../menu/menu_driver.h"
#endif
2015-09-16 09:21:29 +02:00
2015-08-14 02:36:19 +02:00
#ifdef HAVE_CORELOCATION
#include <CoreLocation/CoreLocation.h>
#endif
2015-04-20 00:38:55 +02:00
#if defined(HAVE_COCOATOUCH)
#include <UIKit/UIKit.h>
2015-04-19 19:50:29 +02:00
2015-08-14 02:36:19 +02:00
#ifdef HAVE_AVFOUNDATION
2015-04-19 19:50:29 +02:00
#import <AVFoundation/AVCaptureOutput.h>
2015-08-14 02:36:19 +02:00
#endif
2016-06-04 08:00:19 +02:00
/*********************************************/
/* RAMenuBase */
/* A menu class that displays RAMenuItemBase */
/* objects. */
/*********************************************/
@interface RAMenuBase : UITableViewController
@property (nonatomic) NSMutableArray* sections;
@property (nonatomic) BOOL hidesHeaders;
2015-09-21 16:52:28 -04:00
@property (nonatomic) RAMenuBase* last_menu;
2015-09-22 22:50:58 +02:00
@property (nonatomic) UILabel *osdmessage;
- (id)initWithStyle:(UITableViewStyle)style;
- (id)itemForIndexPath:(NSIndexPath*)indexPath;
@end
2015-04-19 19:50:29 +02:00
typedef struct
{
char orientations[32];
unsigned orientation_flags;
char bluetooth_mode[64];
} apple_frontend_settings_t;
extern apple_frontend_settings_t apple_frontend_settings;
2016-02-26 13:32:56 +01:00
@interface CocoaView : UIViewController<CLLocationManagerDelegate,
AVCaptureAudioDataOutputSampleBufferDelegate>
2015-04-20 20:39:39 +02:00
+ (CocoaView*)get;
2015-04-19 19:50:29 +02:00
@end
2016-02-26 13:32:56 +01:00
@interface RetroArch_iOS : UINavigationController<UIApplicationDelegate,
UINavigationControllerDelegate>
2015-04-19 19:50:29 +02:00
@property (nonatomic) UIWindow* window;
2015-04-20 12:09:56 +02:00
@property (nonatomic) NSString* documentsDirectory;
@property (nonatomic) RAMenuBase* mainmenu;
2015-09-21 16:52:28 -04:00
@property (nonatomic) int menu_count;
2015-04-19 19:50:29 +02:00
+ (RetroArch_iOS*)get;
- (void)showGameView;
- (void)toggleUI;
- (void)supportOtherAudioSessions;
2015-04-19 19:50:29 +02:00
- (void)refreshSystemConfig;
2015-09-21 16:52:28 -04:00
- (void)mainMenuPushPop: (bool)pushp;
- (void)mainMenuRefresh;
2015-04-19 19:50:29 +02:00
@end
void get_ios_version(int *major, int *minor);
2015-04-20 00:38:55 +02:00
#elif defined(HAVE_COCOA)
2015-04-19 19:50:29 +02:00
#include <AppKit/AppKit.h>
2015-04-20 20:39:39 +02:00
@interface CocoaView : NSView
#ifdef HAVE_CORELOCATION
2015-04-19 19:50:29 +02:00
<CLLocationManagerDelegate>
#endif
2015-04-20 20:39:39 +02:00
+ (CocoaView*)get;
#if !defined(HAVE_COCOA)
2015-04-19 19:50:29 +02:00
- (void)display;
#endif
@end
#endif
2013-07-06 20:43:04 -04:00
#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