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 TouchMode getCurrentTouchMode()
const {
return _currentTouchMode; };
100 void setCurrentTouchMode(TouchMode mode) { _currentTouchMode = mode; };
103 void applyOrientationSettings();
104 void setSupportedScreenOrientation(ScreenOrientation screenOrientation);
106 void applyTouchSettings(
bool _3dMode,
bool overlayShown);
108 uint createOpenGLContext();
109 void destroyOpenGLContext();
110 void refreshScreen()
const;
111 int getScreenWidth()
const;
112 int getScreenHeight()
const;
113 float getSystemHiDPIScreenFactor()
const;
115 #if defined(USE_OPENGL) && defined(USE_GLAD) 116 void *getOpenGLProcAddress(
const char *name)
const override;
118 #if defined(USE_OPENGL_GAME) || defined(USE_OPENGL_SHADERS) 119 OpenGL::ContextType getOpenGLType()
const override {
return OpenGL::kContextGLES2; }
125 uint32 getMillis(
bool skipRecord =
false)
override;
126 void delayMillis(uint msecs)
override;
129 static void mixCallback(
void *sys, byte *samples,
int len);
130 virtual void setupMixer(
void);
131 virtual void setTimerCallback(TimerProc callback,
int interval);
132 void quit()
override;
135 void getTimeAndDate(
TimeDate &td,
bool skipRecord =
false)
const override;
141 void startSoundsystem();
142 void stopSoundsystem();
147 void fatalError()
override;
149 bool hasTextInClipboard()
override;
154 const char *
const *buildHelpDialogData()
override;
157 bool isConnectionLimited()
override;
158 void virtualController(
bool connect);
159 bool isiOSAppOnMac()
const;
164 virtual void applyBackendSettings()
override;
165 virtual void registerDefaultSettings(
const Common::String &target)
const override;
168 void updateOutputSurface();
169 void updateTouchMode();
170 void setShowKeyboard(
bool);
171 bool isKeyboardShown()
const;
177 static void AQBufferCallback(
void *in, AudioQueueRef inQ, AudioQueueBufferRef outQB);
178 static int timerHandler(
int t);
180 bool handleEvent_swipe(
Common::Event &event,
int direction,
int touches);
181 bool handleEvent_tap(
Common::Event &event, UIViewTapDescription type,
int touches);
182 bool handleEvent_longPress(
Common::Event &event, UIViewLongPressDescription type,
int touches);
183 void handleEvent_keyPressed(
Common::Event &event,
int keyPressed,
int modifierFlags);
184 void handleEvent_orientationChanged(
int orientation);
185 void handleEvent_touchModeChanged();
186 void handleEvent_applicationSuspended();
187 void handleEvent_applicationResumed();
188 void handleEvent_applicationSaveState();
189 void handleEvent_applicationRestoreState();
190 void handleEvent_applicationClearState();
192 bool handleEvent_touchBegan(
Common::Event &event,
int x,
int y);
193 bool handleEvent_touchMoved(
Common::Event &event,
int x,
int y);
195 void handleEvent_mouseLeftButtonDown(
Common::Event &event,
int x,
int y);
196 void handleEvent_mouseLeftButtonUp(
Common::Event &event,
int x,
int y);
197 void handleEvent_mouseRightButtonDown(
Common::Event &event,
int x,
int y);
198 void handleEvent_mouseRightButtonUp(
Common::Event &event,
int x,
int y);
199 void handleEvent_mouseDelta(
Common::Event &event,
int deltaX,
int deltaY);
200 void handleEvent_mouseEvent(
Common::Event &event,
int relX,
int relY);
202 void rebuildSurface();
203 float getMouseSpeed();
Definition: modular-backend.h:48
Feature
Definition: system.h:405
Task
Definition: system.h:338
Definition: ios7_osys_main.h:53
Definition: mixer_intern.h:58
Definition: archive.h:330
Definition: ios7_osys_main.h:46
Definition: base-backend.h:44
virtual Common::Path getDefaultLogFileName() override
Definition: ios7_osys_main.h:161