RetroArch
cocoa_common.h
Go to the documentation of this file.
1 /* RetroArch - A frontend for libretro.
2  * Copyright (C) 2013-2014 - Jason Fetters
3  * Copyright (C) 2011-2017 - Daniel De Matteis
4  *
5  * RetroArch is free software: you can redistribute it and/or modify it under the terms
6  * of the GNU General Public License as published by the Free Software Found-
7  * ation, either version 3 of the License, or (at your option) any later version.
8  *
9  * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  * PURPOSE. See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along with RetroArch.
14  * If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef __COCOA_COMMON_METAL_H
18 #define __COCOA_COMMON_METAL_H
19 
20 #include <Foundation/Foundation.h>
21 
22 #ifdef HAVE_MENU
23 #include "../../menu/menu_setting.h"
24 #include "../../menu/menu_driver.h"
25 #endif
26 
27 #ifdef HAVE_CORELOCATION
28 #include <CoreLocation/CoreLocation.h>
29 #endif
30 
31 #if defined(HAVE_COCOATOUCH)
32 #include <UIKit/UIKit.h>
33 
34 #ifdef HAVE_AVFOUNDATION
35 #import <AVFoundation/AVCaptureOutput.h>
36 #endif
37 
38 
39 /*********************************************/
40 /* RAMenuBase */
41 /* A menu class that displays RAMenuItemBase */
42 /* objects. */
43 /*********************************************/
44 @interface RAMenuBase : UITableViewController
45 @property (nonatomic) NSMutableArray* sections;
46 @property (nonatomic) BOOL hidesHeaders;
47 @property (nonatomic) RAMenuBase* last_menu;
48 @property (nonatomic) UILabel *osdmessage;
49 
50 - (id)initWithStyle:(UITableViewStyle)style;
51 - (id)itemForIndexPath:(NSIndexPath*)indexPath;
52 
53 @end
54 
55 typedef struct
56 {
57  char orientations[32];
58  unsigned orientation_flags;
59  char bluetooth_mode[64];
60 } apple_frontend_settings_t;
61 extern apple_frontend_settings_t apple_frontend_settings;
62 
63 @interface CocoaView : UIViewController<CLLocationManagerDelegate,
64 AVCaptureAudioDataOutputSampleBufferDelegate>
65 + (CocoaView*)get;
66 @end
67 
68 @interface RetroArch_iOS : UINavigationController<UIApplicationDelegate,
69 UINavigationControllerDelegate>
70 
71 @property (nonatomic) UIWindow* window;
72 @property (nonatomic) NSString* documentsDirectory;
73 @property (nonatomic) RAMenuBase* mainmenu;
74 @property (nonatomic) int menu_count;
75 
76 + (RetroArch_iOS*)get;
77 
78 - (void)showGameView;
79 - (void)toggleUI;
80 - (void)supportOtherAudioSessions;
81 
82 - (void)refreshSystemConfig;
83 - (void)mainMenuPushPop: (bool)pushp;
84 - (void)mainMenuRefresh;
85 @end
86 
87 void get_ios_version(int *major, int *minor);
88 
89 #elif defined(HAVE_COCOA)
90 #include <AppKit/AppKit.h>
91 
92 @interface CocoaView : NSView
93 #ifdef HAVE_CORELOCATION
94 <CLLocationManagerDelegate>
95 #endif
96 
97 + (CocoaView*)get;
98 #if !defined(HAVE_COCOA)
99 - (void)display;
100 #endif
101 
102 @end
103 
104 #endif
105 
106 #define BOXSTRING(x) [NSString stringWithUTF8String:x]
107 #define BOXINT(x) [NSNumber numberWithInt:x]
108 #define BOXUINT(x) [NSNumber numberWithUnsignedInt:x]
109 #define BOXFLOAT(x) [NSNumber numberWithDouble:x]
110 
111 #endif
Definition: cocoa_common.m:59
apple_frontend_settings_t apple_frontend_settings
Definition: ui_cocoatouch.m:106
GLenum GLuint id
Definition: glext.h:6233
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
Definition: cocoatouch_menu.m:582
CocoaView * get()
Definition: cocoa_common.m:70
Definition: nk_menu.h:45
Definition: ui_cocoatouch.m:328
unsigned int BOOL
Definition: gctypes.h:51
void get_ios_version(int *major, int *minor)
Definition: ui_cocoatouch.m:108