22 #ifndef COMMON_SYSTEM_H 23 #define COMMON_SYSTEM_H 25 #include "common/scummsys.h" 26 #include "common/noncopyable.h" 27 #include "common/array.h" 28 #include "common/list.h" 29 #include "common/ustr.h" 30 #include "common/str-array.h" 31 #include "common/hash-str.h" 32 #include "common/path.h" 33 #include "common/log.h" 34 #include "graphics/pixelformat.h" 35 #include "graphics/mode.h" 36 #include "graphics/opengl/context.h" 48 class OptionsContainerWidget;
59 class SaveFileManager;
62 #if defined(USE_TASKBAR) 65 #if defined(USE_UPDATES) 68 class TextToSpeechManager;
69 #if defined(USE_SYSDIALOGS) 73 class SeekableReadStream;
75 class HardwareInputSet;
77 class KeymapperDefaultBindings;
79 typedef Array<Keymap *> KeymapArray;
137 #if defined(USE_IMGUI) 138 typedef struct ImGuiCallbacks {
139 void (*init)() =
nullptr;
140 void (*render)() =
nullptr;
141 void (*cleanup)() =
nullptr;
220 #if defined(USE_TASKBAR) 226 Common::TaskbarManager *_taskbarManager;
229 #if defined(USE_UPDATES) 235 Common::UpdateManager *_updateManager;
245 #if defined(USE_SYSDIALOGS) 285 bool _backendInitialized;
309 virtual void initBackend();
764 static const GraphicsMode noGraphicsModes[] = {{
"NONE",
"Normal", 0}, {
nullptr,
nullptr, 0 }};
765 return noGraphicsModes;
780 kGfxModeRender3d = (1 << 0)
796 virtual bool setGraphicsMode(
int mode, uint flags = kGfxModeNoFlags) {
return (mode == 0); }
811 bool setGraphicsMode(
const char *name);
891 return OpenGL::kContextNone;
894 #if defined(USE_OPENGL) && defined(USE_GLAD) 906 virtual void *getOpenGLProcAddress(
const char *name)
const {
return nullptr; }
909 #if defined(USE_IMGUI) 917 virtual void setImGuiCallbacks(
const ImGuiCallbacks &callbacks) {}
927 virtual void *getImGuiTexture(
const Graphics::Surface &image,
const byte *palette =
nullptr,
int palCount = 0) {
return nullptr; }
933 virtual void freeImGuiTexture(
void *texture) {}
957 static const GraphicsMode noStretchModes[] = {{
"NONE",
"Normal", 0}, {
nullptr,
nullptr, 0 }};
958 return noStretchModes;
997 bool setStretchMode(
const char *name);
1038 virtual bool setScaler(uint mode,
int factor) {
return false; }
1051 virtual bool setScaler(
const char *name,
int factor) {
return false; }
1156 kTransactionSuccess = 0,
1157 kTransactionAspectRatioFailed = (1 << 0),
1158 kTransactionFullscreenFailed = (1 << 1),
1159 kTransactionModeSwitchFailed = (1 << 2),
1160 kTransactionSizeChangeFailed = (1 << 3),
1161 kTransactionFormatNotSupported = (1 << 4),
1162 kTransactionFilteringFailed = (1 << 5),
1163 kTransactionStretchModeSwitchFailed = (1 << 6),
1164 kTransactionShaderChangeFailed = (1 << 7),
1165 kTransactionVSyncFailed = (1 << 8),
1185 virtual int16 getHeight() = 0;
1194 virtual int16 getWidth() = 0;
1236 virtual void copyRectToScreen(
const void *buf,
int pitch,
int x,
int y,
int w,
int h) = 0;
1262 virtual void unlockScreen() = 0;
1267 virtual void fillScreen(uint32 col) = 0;
1272 virtual void fillScreen(
const Common::Rect &r, uint32 col) = 0;
1283 virtual void updateScreen() = 0;
1304 virtual void setShakePos(
int shakeXOffset,
int shakeYOffset) = 0;
1367 virtual void showOverlay(
bool inGUI =
true) = 0;
1370 virtual void hideOverlay() = 0;
1373 virtual bool isOverlayVisible()
const = 0;
1392 virtual void clearOverlay() = 0;
1417 virtual void copyRectToOverlay(
const void *buf,
int pitch,
int x,
int y,
int w,
int h) = 0;
1424 virtual int16 getOverlayHeight() = 0;
1431 virtual int16 getOverlayWidth() = 0;
1459 virtual bool showMouse(
bool visible) = 0;
1474 virtual void warpMouse(
int x,
int y) = 0;
1493 virtual void setMouseCursor(
const void *buf, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor,
bool dontScale =
false,
const Graphics::PixelFormat *format =
nullptr,
const byte *mask =
nullptr) = 0;
1532 virtual uint32 getMillis(
bool skipRecord =
false) = 0;
1535 virtual void delayMillis(uint msecs) = 0;
1543 virtual void getTimeAndDate(
TimeDate &td,
bool skipRecord =
false)
const = 0;
1558 return _eventManager;
1650 return _audiocdManager;
1663 virtual void quit() = 0;
1670 virtual void fatalError();
1731 #if defined(USE_TASKBAR) 1738 virtual Common::TaskbarManager *getTaskbarManager() {
1739 return _taskbarManager;
1743 #if defined(USE_UPDATES) 1750 virtual Common::UpdateManager *getUpdateManager() {
1751 return _updateManager;
1761 return _textToSpeechManager;
1764 #if defined(USE_SYSDIALOGS) 1771 return _dialogManager;
2004 virtual bool isConnectionLimited();
virtual Common::KeymapArray getGlobalKeymaps()
Definition: system.h:1579
CursorMaskValue
Definition: system.h:119
virtual void messageBox(LogMessageType::Type type, const char *message)
Definition: system.h:1904
GfxModeFlags
Definition: system.h:778
virtual void taskFinished(Task)
Definition: system.h:361
int tm_hour
Definition: system.h:109
virtual const char *const * buildHelpDialogData()
Definition: system.h:1875
virtual Common::HardwareInputSet * getHardwareInputSet()
Definition: system.h:1568
int id
Definition: system.h:750
virtual bool lockMouse(bool lock)
Definition: system.h:1465
int tm_mday
Definition: system.h:110
virtual bool setScaler(const char *name, int factor)
Definition: system.h:1051
virtual void setFocusRectangle(const Common::Rect &rect)
Definition: system.h:1320
Definition: fs-factory.h:31
virtual bool setShader(const Common::Path &fileName)
Definition: system.h:945
virtual void saveScreenshot()
Definition: system.h:1337
virtual Common::Array< uint > getSupportedAntiAliasingLevels() const
Definition: system.h:876
virtual int getGraphicsMode() const
Definition: system.h:818
const char * name
Definition: system.h:737
int tm_min
Definition: system.h:108
virtual void setWindowCaption(const Common::U32String &caption)
Definition: system.h:1678
virtual const GraphicsMode * getSupportedStretchModes() const
Definition: system.h:956
Feature
Definition: system.h:403
virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority=0)
Definition: system.h:1806
Common::TimerManager * _timerManager
Definition: system.h:211
Common::TextToSpeechManager * _textToSpeechManager
Definition: system.h:243
virtual TransactionError endGFXTransaction()
Definition: system.h:1176
virtual void engineInit()
Definition: system.h:324
virtual int getDefaultGraphicsMode() const
Definition: system.h:776
Task
Definition: system.h:336
virtual Common::DialogManager * getDialogManager()
Definition: system.h:1770
virtual void initSizeHint(const Graphics::ModeList &modes)
Definition: system.h:1108
int tm_wday
Definition: system.h:113
Definition: noncopyable.h:39
Common::DialogManager * _dialogManager
Definition: system.h:251
Common::U32String _clipboard
Definition: system.h:274
AudioCDManager * getAudioCDManager()
Definition: system.h:1649
virtual void setCursorPalette(const byte *colors, uint start, uint num)
Definition: system.h:1506
virtual void engineDone()
Definition: system.h:331
virtual GUI::OptionsContainerWidget * buildBackendOptionsWidget(GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const
Definition: system.h:1863
virtual bool setScaler(uint mode, int factor)
Definition: system.h:1038
virtual uint getDefaultScaleFactor() const
Definition: system.h:1026
virtual void applyBackendSettings()
Definition: system.h:1882
virtual bool openUrl(const Common::String &url)
Definition: system.h:1978
virtual bool hasTextInClipboard()
Definition: system.h:1942
virtual bool setTextInClipboard(const Common::U32String &text)
Definition: system.h:1964
TransactionError
Definition: system.h:1155
virtual OpenGL::ContextType getOpenGLType() const
Definition: system.h:890
Definition: archive.h:312
virtual bool setGraphicsMode(int mode, uint flags=kGfxModeNoFlags)
Definition: system.h:796
int tm_sec
Definition: system.h:107
virtual bool setStretchMode(int mode)
Definition: system.h:981
virtual void taskStarted(Task)
Definition: system.h:356
Definition: algorithm.h:29
Definition: formatinfo.h:28
virtual bool hasFeature(Feature f)
Definition: system.h:641
const char * description
Definition: system.h:743
virtual Common::KeymapperDefaultBindings * getKeymapperDefaultBindings()
Definition: system.h:1588
Common::SaveFileManager * _savefileManager
Definition: system.h:218
virtual int getScreenChangeID() const
Definition: system.h:1124
Definition: keymapper-defaults.h:32
virtual bool displayLogFile()
Definition: system.h:1931
virtual Common::Path getDefaultLogFileName()
Definition: system.h:1840
DLC::Store * _dlcStore
Definition: system.h:268
int tm_year
Definition: system.h:112
virtual void init()
Definition: system.h:299
Common::EventManager * getEventManager()
Definition: system.h:1557
Definition: text-to-speech.h:145
Common::EventManager * _eventManager
Definition: system.h:204
virtual void registerDefaultSettings(const Common::String &target) const
Definition: system.h:1848
int tm_mon
Definition: system.h:111
virtual uint getScaleFactor() const
Definition: system.h:1065
virtual uint getScaler() const
Definition: system.h:1058
virtual int getStretchMode() const
Definition: system.h:1004
virtual void beginGFXTransaction()
Definition: system.h:1144
virtual Common::TextToSpeechManager * getTextToSpeechManager()
Definition: system.h:1760
Definition: savefile.h:142
virtual Common::U32String getTextFromClipboard()
Definition: system.h:1953
bool backendInitialized() const
Definition: system.h:317
virtual void clearFocusRectangle()
Definition: system.h:1330
virtual uint32 getDoubleClickTime() const
Definition: system.h:1514
virtual float getHiDPIScreenFactor() const
Definition: system.h:1207
virtual uint getDefaultScaler() const
Definition: system.h:1015
virtual const GraphicsMode * getSupportedGraphicsModes() const
Definition: system.h:763
virtual void setFeatureState(Feature f, bool enable)
Definition: system.h:649
void push_back(const t_T &element)
Definition: list.h:140
FilesystemFactory * _fsFactory
Definition: system.h:263
AudioCDManager * _audiocdManager
Definition: system.h:195
Definition: paletteman.h:47
bool _dummyUnused
Definition: system.h:279
virtual int getDefaultStretchMode() const
Definition: system.h:970
virtual DLC::Store * getDLCStore()
Definition: system.h:1780
virtual bool getFeatureState(Feature f)
Definition: system.h:656