// Shared declarations for the macOS-API shims used by the retargeted Factorio binary. #pragma once #include #include #define FX_DISPLAY_ID 1u #define FX_EXPORT __attribute__((visibility("default"))) #ifdef __cplusplus extern "C" { #endif FX_EXPORT void fx_log(const char *format, ...) __attribute__((format(printf, 1, 2))); FX_EXPORT CGSize fx_screen_points(void); FX_EXPORT double fx_screen_scale(void); FX_EXPORT double fx_render_divisor(void); FX_EXPORT double fx_game_per_uikit(void); #ifdef __OBJC__ FX_EXPORT void fx_main_sync(void (^block)(void)); #endif #ifdef __cplusplus } #endif #ifdef __OBJC__ #import // Selectors sent to Factorio's own SDL classes (declared so ARC accepts the sends). @protocol FXAppKitCallbacks @optional - (void)mouseDown:(id)e; - (void)mouseUp:(id)e; - (void)mouseDragged:(id)e; - (void)mouseMoved:(id)e; - (void)rightMouseDown:(id)e; - (void)rightMouseUp:(id)e; - (void)rightMouseDragged:(id)e; - (void)otherMouseDown:(id)e; - (void)otherMouseUp:(id)e; - (void)otherMouseDragged:(id)e; - (void)scrollWheel:(id)e; - (void)keyDown:(id)e; - (void)keyUp:(id)e; - (void)flagsChanged:(id)e; - (void)mouseEntered:(id)e; - (void)mouseExited:(id)e; - (void)touchesBeganWithEvent:(id)e; - (void)touchesMovedWithEvent:(id)e; - (void)touchesEndedWithEvent:(id)e; - (void)touchesCancelledWithEvent:(id)e; - (void)windowDidBecomeKey:(NSNotification *)n; - (void)windowDidResignKey:(NSNotification *)n; - (void)applicationDidFinishLaunching:(NSNotification *)n; - (NSInteger)tag; - (void)insertText:(id)text replacementRange:(NSRange)range; @end @interface NSObject (FXAppKitCallbacks) @end #endif