mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
(Cocoa) Create common shared header file
This commit is contained in:
parent
acf71fc46c
commit
ef8d1ad406
@ -31,29 +31,7 @@
|
|||||||
#import <GameController/GameController.h>
|
#import <GameController/GameController.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********************************************/
|
#include "cocoa_common_shared.h"
|
||||||
/* 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
|
#if TARGET_OS_IOS
|
||||||
@interface CocoaView : UIViewController<CLLocationManagerDelegate,
|
@interface CocoaView : UIViewController<CLLocationManagerDelegate,
|
||||||
@ -85,23 +63,7 @@ UINavigationControllerDelegate>
|
|||||||
|
|
||||||
void get_ios_version(int *major, int *minor);
|
void get_ios_version(int *major, int *minor);
|
||||||
|
|
||||||
#elif defined(HAVE_COCOA)
|
|
||||||
#include <AppKit/AppKit.h>
|
|
||||||
|
|
||||||
@interface CocoaView : NSView
|
|
||||||
|
|
||||||
+ (CocoaView*)get;
|
|
||||||
#if !defined(HAVE_COCOA)
|
|
||||||
- (void)display;
|
|
||||||
#endif
|
#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
|
#endif
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
#include "../../menu/menu_driver.h"
|
#include "../../menu/menu_driver.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "cocoa_common_shared.h"
|
||||||
|
|
||||||
typedef enum apple_view_type {
|
typedef enum apple_view_type {
|
||||||
APPLE_VIEW_TYPE_NONE,
|
APPLE_VIEW_TYPE_NONE,
|
||||||
APPLE_VIEW_TYPE_OPENGL_ES,
|
APPLE_VIEW_TYPE_OPENGL_ES,
|
||||||
@ -67,30 +69,6 @@ extern id<ApplePlatform> apple_platform;
|
|||||||
#if defined(HAVE_COCOATOUCH)
|
#if defined(HAVE_COCOATOUCH)
|
||||||
#include <UIKit/UIKit.h>
|
#include <UIKit/UIKit.h>
|
||||||
|
|
||||||
/*********************************************/
|
|
||||||
/* 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;
|
|
||||||
|
|
||||||
@interface CocoaView : UIViewController<CLLocationManagerDelegate,
|
@interface CocoaView : UIViewController<CLLocationManagerDelegate,
|
||||||
AVCaptureAudioDataOutputSampleBufferDelegate>
|
AVCaptureAudioDataOutputSampleBufferDelegate>
|
||||||
+ (CocoaView*)get;
|
+ (CocoaView*)get;
|
||||||
@ -117,34 +95,6 @@ UINavigationControllerDelegate, ApplePlatform>
|
|||||||
|
|
||||||
void get_ios_version(int *major, int *minor);
|
void get_ios_version(int *major, int *minor);
|
||||||
|
|
||||||
#elif defined(HAVE_COCOA_METAL)
|
|
||||||
#include <AppKit/AppKit.h>
|
|
||||||
|
|
||||||
@interface CocoaView : NSView
|
|
||||||
|
|
||||||
+ (CocoaView*)get;
|
|
||||||
#if !defined(HAVE_COCOA_METAL)
|
|
||||||
- (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]
|
|
||||||
|
|
||||||
#if __has_feature(objc_arc)
|
|
||||||
#define RELEASE(x) x = nil
|
|
||||||
#define BRIDGE __bridge
|
|
||||||
#define UNSAFE_UNRETAINED __unsafe_unretained
|
|
||||||
#else
|
|
||||||
#define RELEASE(x) [x release]; \
|
|
||||||
x = nil
|
|
||||||
#define BRIDGE
|
|
||||||
#define UNSAFE_UNRETAINED
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
74
ui/drivers/cocoa/cocoa_common_shared.h
Normal file
74
ui/drivers/cocoa/cocoa_common_shared.h
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
/* 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_SHARED_H
|
||||||
|
#define __COCOA_COMMON_SHARED_H
|
||||||
|
|
||||||
|
/*********************************************/
|
||||||
|
/* 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 defined(HAVE_COCOA) || defined(HAVE_COCOA_METAL)
|
||||||
|
#include <AppKit/AppKit.h>
|
||||||
|
|
||||||
|
@interface CocoaView : NSView
|
||||||
|
|
||||||
|
+ (CocoaView*)get;
|
||||||
|
#if !defined(HAVE_COCOA) && !defined(HAVE_COCOA_METAL)
|
||||||
|
- (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]
|
||||||
|
|
||||||
|
#if __has_feature(objc_arc)
|
||||||
|
#define RELEASE(x) x = nil
|
||||||
|
#define BRIDGE __bridge
|
||||||
|
#define UNSAFE_UNRETAINED __unsafe_unretained
|
||||||
|
#else
|
||||||
|
#define RELEASE(x) [x release]; \
|
||||||
|
x = nil
|
||||||
|
#define BRIDGE
|
||||||
|
#define UNSAFE_UNRETAINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
Loading…
x
Reference in New Issue
Block a user