22 #ifndef BACKENDS_PLATFORM_IOS7_IOS7_OSYS_MAIN_H 23 #define BACKENDS_PLATFORM_IOS7_IOS7_OSYS_MAIN_H 25 #include "graphics/surface.h" 26 #include "backends/platform/ios7/ios7_common.h" 27 #include "backends/modular-backend.h" 28 #include "backends/keymapper/hardware-input.h" 29 #include "common/events.h" 30 #include "common/str.h" 31 #include "common/ustr.h" 32 #include "audio/mixer_intern.h" 33 #include "backends/fs/posix/posix-fs-factory.h" 34 #include "graphics/palette.h" 36 #include <AudioToolbox/AudioQueue.h> 38 #define AUDIO_BUFFERS 3 39 #define WAVE_BUFFER_SIZE 2048 40 #define AUDIO_SAMPLE_RATE 44100 41 #define MAX_IOS7_SCUMMVM_LOG_FILESIZE_IN_BYTES (100*1024) 43 typedef void (*SoundProc)(
void *param, byte *buf,
int len);
44 typedef int (*TimerProc)(
int interval);
49 AudioQueueBufferRef buffers[AUDIO_BUFFERS];
50 AudioStreamBasicDescription dataFormat;
56 static SoundProc s_soundCallback;
57 static void *s_soundParam;
61 CFTimeInterval _startTime;
66 long _queuedEventTime;
68 TouchMode _currentTouchMode;
72 ScreenOrientation _screenOrientation;
85 void initBackend()
override;
87 void engineInit()
override;
88 void engineDone()
override;
90 void taskStarted(
Task)
override;
91 void taskFinished(
Task)
override;
95 bool hasFeature(
Feature f)
override;
96 void setFeatureState(
Feature f,
bool enable)
override;
97 bool getFeatureState(
Feature f)
override;
99 bool setGraphicsMode(
int mode, uint flags)
override;
101 TouchMode getCurrentTouchMode()
const {
return _currentTouchMode; };
102 void setCurrentTouchMode(TouchMode mode) { _currentTouchMode = mode; };
105 void applyOrientationSettings();
106 void setSupportedScreenOrientation(ScreenOrientation screenOrientation);
108 void applyTouchSettings(
bool _3dMode,
bool overlayShown);
110 uint createOpenGLContext();
111 void destroyOpenGLContext();
112 void refreshScreen()
const;
113 int getScreenWidth()
const;
114 int getScreenHeight()
const;
115 float getSystemHiDPIScreenFactor()
const;
117 #if defined(USE_OPENGL) && defined(USE_GLAD) 118 void *getOpenGLProcAddress(
const char *name)
const override;
120 #if defined(USE_OPENGL_GAME) || defined(USE_OPENGL_SHADERS) 121 OpenGL::ContextType getOpenGLType()
const override {
return OpenGL::kContextGLES2; }
126 uint32 getMillis(
bool skipRecord =
false)
override;
127 void delayMillis(uint msecs)
override;
130 static void mixCallback(
void *sys, byte *samples,
int len);
131 virtual void setupMixer(
void);
132 virtual void setTimerCallback(TimerProc callback,
int interval);
133 void quit()
override;
136 void getTimeAndDate(
TimeDate &td,
bool skipRecord =
false)
const override;
142 void startSoundsystem();
143 void stopSoundsystem();
148 void fatalError()
override;
150 bool hasTextInClipboard()
override;
155 const char *
const *buildHelpDialogData()
override;
158 bool isConnectionLimited()
override;
159 void virtualController(
bool connect);
160 bool isiOSAppOnMac()
const;
165 virtual void applyBackendSettings()
override;
166 virtual void registerDefaultSettings(
const Common::String &target)
const override;
169 void updateOutputSurface();
170 void updateTouchMode();
171 void setShowKeyboard(
bool);
172 bool isKeyboardShown()
const;
178 static void AQBufferCallback(
void *in, AudioQueueRef inQ, AudioQueueBufferRef outQB);
179 static int timerHandler(
int t);
181 bool handleEvent_swipe(
Common::Event &event,
int direction,
int touches);
182 bool handleEvent_tap(
Common::Event &event, UIViewTapDescription type,
int touches);
183 bool handleEvent_longPress(
Common::Event &event, UIViewLongPressDescription type,
int touches);
184 void handleEvent_keyPressed(
Common::Event &event,
int keyPressed,
int modifierFlags);
185 void handleEvent_orientationChanged(
int orientation);
186 void handleEvent_touchModeChanged();
187 void handleEvent_applicationSuspended();
188 void handleEvent_applicationResumed();
189 void handleEvent_applicationSaveState();
190 void handleEvent_applicationRestoreState();
191 void handleEvent_applicationClearState();
193 bool handleEvent_touchBegan(
Common::Event &event,
int x,
int y);
194 bool handleEvent_touchMoved(
Common::Event &event,
int x,
int y);
196 void handleEvent_mouseLeftButtonDown(
Common::Event &event,
int x,
int y);
197 void handleEvent_mouseLeftButtonUp(
Common::Event &event,
int x,
int y);
198 void handleEvent_mouseRightButtonDown(
Common::Event &event,
int x,
int y);
199 void handleEvent_mouseRightButtonUp(
Common::Event &event,
int x,
int y);
200 void handleEvent_mouseDelta(
Common::Event &event,
int deltaX,
int deltaY);
201 void handleEvent_mouseEvent(
Common::Event &event,
int relX,
int relY);
203 void rebuildSurface();
204 float getMouseSpeed();
Definition: modular-backend.h:48
Feature
Definition: system.h:403
Task
Definition: system.h:336
Definition: ios7_osys_main.h:53
Definition: mixer_intern.h:58
Definition: archive.h:312
Definition: ios7_osys_main.h:46
Definition: base-backend.h:44
virtual Common::Path getDefaultLogFileName() override
Definition: ios7_osys_main.h:162