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)
43typedef void (*SoundProc)(
void *param,
byte *buf,
int len);
44typedef 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;
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; }
129 static void mixCallback(
void *sys,
byte *samples,
int len);
130 virtual void setupMixer(
void);
131 virtual void setTimerCallback(TimerProc callback,
int interval);
141 void startSoundsystem();
142 void stopSoundsystem();
158 void virtualController(
bool connect);
159 bool isiOSAppOnMac()
const;
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: mixer_intern.h:58
Definition: base-backend.h:31
Definition: archive.h:330
Definition: modular-backend.h:48
Definition: ios7_osys_main.h:53
bool pollEvent(Common::Event &event) override
bool getFeatureState(Feature f) override
void taskFinished(Task) override
Audio::Mixer * getMixer() override
const char *const * buildHelpDialogData() override
void applyBackendSettings() override
Common::HardwareInputSet * getHardwareInputSet() override
bool openUrl(const Common::String &url) override
void delayMillis(uint msecs) override
void engineDone() override
void fatalError() override
bool isConnectionLimited() override
void getTimeAndDate(TimeDate &td, bool skipRecord=false) const override
void initBackend() override
bool setTextInClipboard(const Common::U32String &text) override
Common::MutexInternal * createMutex() override
void updateStartSettings(const Common::String &executable, Common::String &command, Common::StringMap &settings, Common::StringArray &additionalArgs) override
Common::U32String getTextFromClipboard() override
void registerDefaultSettings(const Common::String &target) const override
void logMessage(LogMessageType::Type type, const char *message) override
uint32 getMillis(bool skipRecord=false) override
void addSysArchivesToSearchSet(Common::SearchSet &s, int priority=0) override
Common::String getSystemLanguage() const override
void engineInit() override
Common::Path getDefaultLogFileName() override
Definition: ios7_osys_main.h:161
bool hasTextInClipboard() override
Common::Path getDefaultConfigFileName() override
void taskStarted(Task) override
GUI::OptionsContainerWidget * buildBackendOptionsWidget(GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const override
void setFeatureState(Feature f, bool enable) override
bool hasFeature(Feature f) override
Task
Definition: system.h:348
Feature
Definition: system.h:415
virtual OpenGL::ContextType getOpenGLType() const
Definition: system.h:901
virtual Common::Array< uint > getSupportedAntiAliasingLevels() const
Definition: system.h:887
Definition: ios7_osys_main.h:46