(Cocoa) Create common shared header file

This commit is contained in:
twinaphex 2019-02-09 04:21:01 +01:00
parent acf71fc46c
commit ef8d1ad406
3 changed files with 77 additions and 91 deletions

View File

@ -31,29 +31,7 @@
#import <GameController/GameController.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;
#include "cocoa_common_shared.h"
#if TARGET_OS_IOS
@interface CocoaView : UIViewController<CLLocationManagerDelegate,
@ -85,23 +63,7 @@ UINavigationControllerDelegate>
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
@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

View File

@ -24,6 +24,8 @@
#include "../../menu/menu_driver.h"
#endif
#include "cocoa_common_shared.h"
typedef enum apple_view_type {
APPLE_VIEW_TYPE_NONE,
APPLE_VIEW_TYPE_OPENGL_ES,
@ -67,30 +69,6 @@ extern id<ApplePlatform> apple_platform;
#if defined(HAVE_COCOATOUCH)
#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,
AVCaptureAudioDataOutputSampleBufferDelegate>
+ (CocoaView*)get;
@ -117,34 +95,6 @@ UINavigationControllerDelegate, ApplePlatform>
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

View 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