ScummVM API documentation
OSystem_MacOSX Class Reference
Inheritance diagram for OSystem_MacOSX:
OSystem_POSIX OSystem_SDL ModularMixerBackend ModularGraphicsBackend BaseBackend BaseBackend OSystem OSystem Common::NonCopyable Common::NonCopyable

Public Member Functions

bool hasFeature (Feature f) override
 
bool displayLogFile () override
 
bool hasTextInClipboard () override
 
Common::U32String getTextFromClipboard () override
 
bool setTextInClipboard (const Common::U32String &text) override
 
bool openUrl (const Common::String &url) override
 
Common::String getSystemLanguage () const override
 
void init () override
 
void initBackend () override
 
void addSysArchivesToSearchSet (Common::SearchSet &s, int priority=0) override
 
void updateStartSettings (const Common::String &executable, Common::String &command, Common::StringMap &settings, Common::StringArray &additionalArgs) override
 
Common::Path getDefaultIconsPath () override
 
Common::Path getDefaultDLCsPath () override
 
Common::Path getScreenshotsPath () override
 
- Public Member Functions inherited from OSystem_POSIX
bool hasFeature (Feature f) override
 
bool displayLogFile () override
 
void init () override
 
void initBackend () override
 
void addSysArchivesToSearchSet (Common::SearchSet &s, int priority=0) override
 
Common::Path getDefaultIconsPath () override
 
Common::Path getDefaultDLCsPath () override
 
Common::Path getScreenshotsPath () override
 
- Public Member Functions inherited from OSystem_SDL
void init () override
 
bool hasFeature (Feature f) override
 
void setFeatureState (Feature f, bool enable) override
 
bool getFeatureState (Feature f) override
 
void initBackend () override
 
void engineInit () override
 
void engineDone () override
 
void quit () override
 
void fatalError () override
 
Common::KeymapArray getGlobalKeymaps () override
 
Common::HardwareInputSetgetHardwareInputSet () override
 
void logMessage (LogMessageType::Type type, const char *message) override
 
Common::String getSystemLanguage () const override
 
void setWindowCaption (const Common::U32String &caption) override
 
void addSysArchivesToSearchSet (Common::SearchSet &s, int priority=0) override
 
Common::MutexInternalcreateMutex () override
 
uint32 getMillis (bool skipRecord=false) override
 
void delayMillis (uint msecs) override
 
void getTimeAndDate (TimeDate &td, bool skipRecord=false) const override
 
MixerManagergetMixerManager () override
 
Common::TimerManagergetTimerManager () override
 
Common::SaveFileManagergetSavefileManager () override
 
uint32 getDoubleClickTime () const override
 
- Public Member Functions inherited from ModularMixerBackend
Audio::MixergetMixer () override final
 
- Public Member Functions inherited from BaseBackend
bool setScaler (const char *name, int factor) override final
 
- Public Member Functions inherited from OSystem
void destroy ()
 
bool backendInitialized () const
 
virtual void taskStarted (Task)
 
virtual void taskFinished (Task)
 
bool setGraphicsMode (const char *name)
 
Graphics::PixelFormat getScreenFormat () const
 
Common::List< Graphics::PixelFormatgetSupportedFormats () const
 
virtual Common::Array< uint > getSupportedAntiAliasingLevels () const
 
virtual OpenGL::ContextType getOpenGLType () const
 
bool setStretchMode (const char *name)
 
Common::EventManagergetEventManager ()
 
virtual Common::KeymapperDefaultBindingsgetKeymapperDefaultBindings ()
 
AudioCDManagergetAudioCDManager ()
 
virtual Common::TextToSpeechManagergetTextToSpeechManager ()
 
virtual Common::DialogManagergetDialogManager ()
 
virtual DLC::StoregetDLCStore ()
 
virtual FilesystemFactorygetFilesystemFactory ()
 
virtual Common::SeekableReadStreamcreateConfigReadStream ()
 
virtual Common::WriteStreamcreateConfigWriteStream ()
 
virtual void registerDefaultSettings (const Common::String &target) const
 
virtual GUI::OptionsContainerWidgetbuildBackendOptionsWidget (GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const
 
virtual void applyBackendSettings ()
 
virtual void messageBox (LogMessageType::Type type, const char *message)
 
virtual bool isConnectionLimited ()
 
- Public Member Functions inherited from ModularGraphicsBackend
GraphicsManagergetGraphicsManager ()
 
const GraphicsModegetSupportedGraphicsModes () const override
 
int getDefaultGraphicsMode () const override
 
bool setGraphicsMode (int mode, uint flags=kGfxModeNoFlags) override
 
int getGraphicsMode () const override
 
bool setShader (const Common::Path &name) override final
 
const GraphicsModegetSupportedStretchModes () const override final
 
int getDefaultStretchMode () const override final
 
bool setStretchMode (int mode) override final
 
int getStretchMode () const override final
 
uint getDefaultScaler () const override final
 
uint getDefaultScaleFactor () const override final
 
bool setScaler (uint mode, int factor) override final
 
uint getScaler () const override final
 
uint getScaleFactor () const override final
 
void initSize (uint width, uint height, const Graphics::PixelFormat *format=NULL) override final
 
void initSizeHint (const Graphics::ModeList &modes) override final
 
int getScreenChangeID () const override final
 
void beginGFXTransaction () override final
 
OSystem::TransactionError endGFXTransaction () override final
 
int16 getHeight () override final
 
int16 getWidth () override final
 
PaletteManagergetPaletteManager () override final
 
void copyRectToScreen (const void *buf, int pitch, int x, int y, int w, int h) override final
 
Graphics::SurfacelockScreen () override final
 
void unlockScreen () override final
 
void fillScreen (uint32 col) override final
 
void fillScreen (const Common::Rect &r, uint32 col) override final
 
void updateScreen () override final
 
void setShakePos (int shakeXOffset, int shakeYOffset) override final
 
void setFocusRectangle (const Common::Rect &rect) override final
 
void clearFocusRectangle () override final
 
void showOverlay (bool inGUI) override final
 
void hideOverlay () override final
 
bool isOverlayVisible () const override final
 
Graphics::PixelFormat getOverlayFormat () const override final
 
void clearOverlay () override final
 
void grabOverlay (Graphics::Surface &surface) override final
 
void copyRectToOverlay (const void *buf, int pitch, int x, int y, int w, int h) override final
 
int16 getOverlayHeight () override final
 
int16 getOverlayWidth () override final
 
float getHiDPIScreenFactor () const override final
 
bool showMouse (bool visible) override final
 
void warpMouse (int x, int y) override final
 
void setMouseCursor (const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale=false, const Graphics::PixelFormat *format=NULL, const byte *mask=NULL) override final
 
void setCursorPalette (const byte *colors, uint start, uint num) override final
 
bool lockMouse (bool lock) override final
 
void displayMessageOnOSD (const Common::U32String &msg) override final
 
void displayActivityIconOnOSD (const Graphics::Surface *icon) override final
 
void saveScreenshot () override final
 

Protected Member Functions

Common::Path getDefaultConfigFileName () override
 
Common::Path getDefaultLogFileName () override
 
AudioCDManagercreateAudioCDManager () override
 
- Protected Member Functions inherited from OSystem_POSIX
Common::Path getDefaultConfigFileName () override
 
Common::Path getDefaultLogFileName () override
 
Common::String getXdgUserDir (const char *name)
 
AudioCDManagercreateAudioCDManager () override
 
- Protected Member Functions inherited from OSystem_SDL
virtual void initSDL ()
 
virtual Common::WriteStreamcreateLogFile ()
 
virtual uint32 getOSDoubleClickTime () const
 
virtual const char *const * buildHelpDialogData () override
 

Additional Inherited Members

- Public Types inherited from OSystem
enum  Task { kLocalServer, kCloudDownload, kDataPackDownload }
 
enum  Feature {
  kFeatureFullscreenMode, kFeatureAspectRatioCorrection, kFeatureFilteringMode, kFeatureStretchMode,
  kFeatureVirtualKeyboard, kFeatureCursorPalette, kFeatureCursorAlpha, kFeatureCursorMask,
  kFeatureCursorMaskInvert, kFeatureCursorMaskPaletteXorColorXnor, kFeatureOverlaySupportsAlpha, kFeatureIconifyWindow,
  kFeatureOpenGLForGame, kFeatureShadersForGame, kFeatureVSync, kFeatureFullscreenToggleKeepsContext,
  kFeatureDisplayLogFile, kFeatureClipboardSupport, kFeatureOpenUrl, kFeatureTouchpadMode,
  kFeatureKbdMouseSpeed, kFeatureJoystickDeadzone, kFeatureScalers, kFeatureShaders,
  kFeatureDLC, kFeatureSystemBrowserDialog, kFeatureNoQuit, kFeatureTouchscreen,
  kFeatureCpuNEON, kFeatureCpuSSE2, kFeatureCpuSSE41, kFeatureCpuAVX2,
  kFeatureCpuAltivec, kFeatureRotationMode
}
 
enum  GfxModeFlags { kGfxModeNoFlags = 0, kGfxModeRender3d = (1 << 0) }
 
enum  TransactionError {
  kTransactionSuccess = 0, kTransactionAspectRatioFailed = (1 << 0), kTransactionFullscreenFailed = (1 << 1), kTransactionModeSwitchFailed = (1 << 2),
  kTransactionSizeChangeFailed = (1 << 3), kTransactionFormatNotSupported = (1 << 4), kTransactionFilteringFailed = (1 << 5), kTransactionStretchModeSwitchFailed = (1 << 6),
  kTransactionShaderChangeFailed = (1 << 7), kTransactionVSyncFailed = (1 << 8)
}
 
- Protected Attributes inherited from OSystem_SDL
bool _inited
 
bool _initedSDL
 
Common::Path _logFilePath
 
SdlEventSource_eventSource
 
Common::EventSource_eventSourceWrapper
 
SdlWindow_window
 
SdlGraphicsManager::State _gfxManagerState
 
Backends::Log::Log_logger
 
- Protected Attributes inherited from ModularMixerBackend
MixerManager_mixerManager
 
- Protected Attributes inherited from OSystem
AudioCDManager_audiocdManager
 
Common::EventManager_eventManager
 
Common::TimerManager_timerManager
 
Common::SaveFileManager_savefileManager
 
Common::TextToSpeechManager_textToSpeechManager
 
Common::DialogManager_dialogManager
 
FilesystemFactory_fsFactory
 
DLC::Store_dlcStore
 
Common::U32String _clipboard
 
bool _dummyUnused
 
- Protected Attributes inherited from ModularGraphicsBackend
GraphicsManager_graphicsManager
 

Member Function Documentation

◆ hasFeature()

bool OSystem_MacOSX::hasFeature ( Feature  f)
overridevirtual

Determine whether the backend supports the specified feature.

Reimplemented from ModularGraphicsBackend.

◆ displayLogFile()

bool OSystem_MacOSX::displayLogFile ( )
overridevirtual

Open the log file in a way that allows the user to review it, and possibly email it (or parts of it) to the ScummVM team, for example as part of a bug report.

On a desktop operating system, this would typically launch some kind of an (external) text editor / viewer. On a phone, it can also cause a context switch to another application. Finally, on some ports, it might not be supported at all, and do nothing.

The kFeatureDisplayLogFile feature flag can be used to test whether this call has been implemented by the active backend.

Returns
True on success, false if an error occurred.
Note
An error might mean that the log file did not exist, or that the editor could not launch. However, a return value of true does not guarantee that the user will actually see the log file.
It is up to the backend to ensure that the system is in a state that allows the user to actually see the displayed log files. This might for example require leaving fullscreen mode.

Reimplemented from OSystem.

◆ hasTextInClipboard()

bool OSystem_MacOSX::hasTextInClipboard ( )
overridevirtual

Check whether there is text available in the clipboard.

The kFeatureClipboardSupport feature flag can be used to test whether this call has been implemented by the active backend.

Returns
True if there is text in the clipboard, false otherwise.

Reimplemented from OSystem.

◆ getTextFromClipboard()

Common::U32String OSystem_MacOSX::getTextFromClipboard ( )
overridevirtual

Return clipboard contents as a string.

The kFeatureClipboardSupport feature flag can be used to test whether this call has been implemented by the active backend.

Returns
clipboard contents ("" if hasTextInClipboard() == false).

Reimplemented from OSystem.

◆ setTextInClipboard()

bool OSystem_MacOSX::setTextInClipboard ( const Common::U32String text)
overridevirtual

Set the content of the clipboard to the given string.

The kFeatureClipboardSupport feature flag can be used to test whether this call has been implemented by the active backend.

Returns
True if the text has been properly set in the clipboard, false otherwise.

Reimplemented from OSystem.

◆ openUrl()

bool OSystem_MacOSX::openUrl ( const Common::String url)
overridevirtual

Open the given URL in the default browser (if available on the target system).

Returns
True on success, false otherwise.
Note
It is up to the backend to ensure that the system is in a state that allows the user to actually see the web page. This might for example require leaving fullscreen mode.
Parameters
urlThe URL to open.

Reimplemented from OSystem.

◆ getSystemLanguage()

Common::String OSystem_MacOSX::getSystemLanguage ( ) const
overridevirtual

Return the language of the system.

This returns the currently set language of the system on which ScummVM is run.

The format is an ISO 639 language code, optionally followed by an ISO 3166-1 country code in the form language_country.

For information about POSIX locales, see the following link: https://en.wikipedia.org/wiki/ISO_639 https://en.wikipedia.org/wiki/ISO_3166-1

The default implementation returns "en_US".

Returns
Locale of the system.

Reimplemented from OSystem.

◆ init()

void OSystem_MacOSX::init ( )
overridevirtual

Call this method once, after g_system is created.

Reimplemented from OSystem.

◆ initBackend()

void OSystem_MacOSX::initBackend ( )
overridevirtual

The following method is called once, from main.cpp, after all config data (including command line params etc.) is fully loaded.

Note
Subclasses should always invoke the implementation of their parent class. They should do so near the end of their own implementation.

Reimplemented from BaseBackend.

◆ addSysArchivesToSearchSet()

void OSystem_MacOSX::addSysArchivesToSearchSet ( Common::SearchSet s,
int  priority = 0 
)
overridevirtual

Add system-specific Common::Archive objects to the given SearchSet. For example, on Unix, the directory corresponding to DATA_PATH (if set), or, on macOS, the 'Resource' dir in the app bundle.

Parameters
sSearchSet to which the system-specific dirs, if any, are added.
priorityPriority with which those dirs are added.

Reimplemented from OSystem.

◆ updateStartSettings()

void OSystem_MacOSX::updateStartSettings ( const Common::String executable,
Common::String command,
Common::StringMap startSettings,
Common::StringArray additionalArgs 
)
overridevirtual

Allow the backend to customize the start settings, such as for example starting automatically a game under certain circumstances.

This function is called after the command line parameters have been parsed, and thus the initial value of command and settings will reflect those.

The default implementation checks if the executable name is "scummvm-auto" or if a file named "scummvm-autorun" sits next to it to enable autorun mode.

Reimplemented from OSystem.

◆ getDefaultConfigFileName()

Common::Path OSystem_MacOSX::getDefaultConfigFileName ( )
overrideprotectedvirtual

Get the default file name (or even path) where the user configuration of ScummVM will be saved.

Note that not all ports can use this.

Reimplemented from OSystem.

◆ getDefaultLogFileName()

Common::Path OSystem_MacOSX::getDefaultLogFileName ( )
overrideprotectedvirtual

Get the default file name (or even path) where the scummvm.log will be saved.

Note that not all ports can use this.

Reimplemented from OSystem.

◆ createAudioCDManager()

AudioCDManager* OSystem_MacOSX::createAudioCDManager ( )
overrideprotectedvirtual

Create the audio CD manager

Reimplemented from OSystem_SDL.


The documentation for this class was generated from the following file: