1 #ifndef COCOA_APPLE_PLATFORM_H 2 #define COCOA_APPLE_PLATFORM_H 3 4 #ifdef HAVE_METAL 5 #import <Metal/Metal.h> 6 #import <MetalKit/MetalKit.h> 7 #endif 8 9 #if defined(HAVE_COCOA_METAL) && !defined(HAVE_COCOATOUCH) 10 @interface WindowListener : NSResponder<NSWindowDelegate> 11 @end 12 #endif 13 14 #if defined(HAVE_COCOA_METAL) || defined(HAVE_COCOATOUCH) 15 @protocol ApplePlatform 16 17 /*! @brief renderView returns the current render view based on the viewType */ 18 @property(readonly) id renderView; 19 /*! @brief isActive returns true if the application has focus */ 20 @property(readonly) bool hasFocus; 21 @property(readwrite) apple_view_type_t viewType; 22 23 /*! @brief setVideoMode adjusts the video display to the specified mode */ 24 - (void)setVideoMode:(gfx_ctx_mode_t)mode; 25 /*! @brief setCursorVisible specifies whether the cursor is visible */ 26 - (void)setCursorVisible:(bool)v; 27 /*! @brief controls whether the screen saver should be disabled and 28 * the displays should not sleep. 29 */ 30 - (bool)setDisableDisplaySleep:(bool)disable; 31 @end 32 33 #endif 34 35 #if defined(HAVE_COCOA_METAL) || defined(HAVE_COCOATOUCH) 36 extern id<ApplePlatform> apple_platform; 37 38 id<ApplePlatform> apple_platform; 39 #else 40 id apple_platform; 41 #endif 42 43 #if defined(HAVE_COCOATOUCH) 44 @interface RetroArch_iOS : UINavigationController<ApplePlatform, UIApplicationDelegate, 45 UINavigationControllerDelegate> { 46 UIView *_renderView; 47 apple_view_type_t _vt; 48 } 49 50 @property (nonatomic) UIWindow* window; 51 @property (nonatomic) NSString* documentsDirectory; 52 @property (nonatomic) int menu_count; 53 54 + (RetroArch_iOS*)get; 55 56 - (void)showGameView; 57 - (void)supportOtherAudioSessions; 58 59 - (void)refreshSystemConfig; 60 @end 61 #else 62 #if defined(HAVE_COCOA_METAL) 63 @interface RetroArch_OSX : NSObject<ApplePlatform, NSApplicationDelegate> { 64 #elif (defined(__MACH__) && (defined(__ppc__) || defined(__ppc64__))) 65 @interface RetroArch_OSX : NSObject { 66 #else 67 @interface RetroArch_OSX : NSObject<NSApplicationDelegate> { 68 #endif 69 NSWindow *_window; 70 apple_view_type_t _vt; 71 NSView *_renderView; 72 id _sleepActivity; 73 #if defined(HAVE_COCOA_METAL) 74 WindowListener *_listener; 75 #endif 76 } 77 78 @property(nonatomic, retain) NSWindow IBOutlet *window; 79 80 @end 81 #endif 82 83 #endif 84