ScummVM API documentation
Miscellaneous

Description

Functions

virtual void OSystem::quit ()=0
 
virtual void OSystem::fatalError ()
 
virtual void OSystem::setWindowCaption (const Common::U32String &caption)
 
virtual void OSystem::displayMessageOnOSD (const Common::U32String &msg)=0
 
virtual void OSystem::displayActivityIconOnOSD (const Graphics::Surface *icon)=0
 
virtual void OSystem::addSysArchivesToSearchSet (Common::SearchSet &s, int priority=0)
 
virtual Common::SeekableReadStreamOSystem::createConfigReadStream ()
 
virtual Common::WriteStreamOSystem::createConfigWriteStream ()
 
virtual Common::Path OSystem::getDefaultConfigFileName ()
 
virtual Common::Path OSystem::getDefaultLogFileName ()
 
virtual void OSystem::registerDefaultSettings (const Common::String &target) const
 
virtual GUI::OptionsContainerWidgetOSystem::buildBackendOptionsWidget (GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const
 
virtual const char *const * OSystem::buildHelpDialogData ()
 
virtual void OSystem::applyBackendSettings ()
 
virtual void OSystem::logMessage (LogMessageType::Type type, const char *message)=0
 
virtual void OSystem::messageBox (LogMessageType::Type type, const char *message)
 
virtual bool OSystem::displayLogFile ()
 
virtual bool OSystem::hasTextInClipboard ()
 
virtual Common::U32String OSystem::getTextFromClipboard ()
 
virtual bool OSystem::setTextInClipboard (const Common::U32String &text)
 
virtual bool OSystem::openUrl (const Common::String &url)
 
virtual Common::String OSystem::getSystemLanguage () const
 
virtual bool OSystem::isConnectionLimited ()
 

Function Documentation

◆ quit()

virtual void OSystem::quit ( )
pure virtual

◆ fatalError()

virtual void OSystem::fatalError ( )
virtual

Signal that a fatal error inside the client code has occurred.

This should quit the application.

Reimplemented in OSystem_iOS7, N3DS::OSystem_3DS, and OSystem_SDL.

◆ setWindowCaption()

virtual void OSystem::setWindowCaption ( const Common::U32String caption)
inlinevirtual

Set a window caption or any other comparable status display to the given value.

Parameters
captionThe window caption to use.

Reimplemented in OSystem_Dreamcast, and OSystem_SDL.

◆ displayMessageOnOSD()

virtual void OSystem::displayMessageOnOSD ( const Common::U32String msg)
pure virtual

Display a message in an 'on-screen display'.

Displays a message in such a way that it is visible on or near the screen, for example in a transparent rectangle over the regular screen content, or in a message box beneath it.

The message is expected to be provided in the current TranslationManager charset.

Note
There is a default implementation in BaseBackend that uses a TimedMessageDialog to display the message. Hence, implementing this is optional.
Parameters
msgThe message to display on the screen.

Implemented in N3DS::OSystem_3DS, ModularGraphicsBackend, and BaseBackend.

◆ displayActivityIconOnOSD()

virtual void OSystem::displayActivityIconOnOSD ( const Graphics::Surface icon)
pure virtual

Display an icon that indicates background activity.

The icon is displayed in an 'on-screen display'. It is visible above the regular screen content or near it.

The caller keeps ownership of the icon. It is acceptable to free the surface just after the call.

There is no preferred pixel format for the icon. The backend should convert its copy of the icon to an appropriate format.

The caller must call this method again with a null pointer as a parameter to indicate the icon should no longer be displayed.

Parameters
iconThe icon to display on the screen.

Implemented in N3DS::OSystem_3DS, ModularGraphicsBackend, and BaseBackend.

◆ addSysArchivesToSearchSet()

virtual void OSystem::addSysArchivesToSearchSet ( Common::SearchSet s,
int  priority = 0 
)
inlinevirtual

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 in OSystem_iOS7, OSystem_DS, N3DS::OSystem_3DS, OSystem_libretro, OSystem_SDL, OSystem_Atari, OSystem_MacOSX, OSystem_Win32, OSystem_KolibriOS, and OSystem_POSIX.

◆ createConfigReadStream()

virtual Common::SeekableReadStream* OSystem::createConfigReadStream ( )
virtual

Open the default config file for reading by returning a suitable ReadStream instance.

It is the caller's responsiblity to delete the stream after use.

◆ createConfigWriteStream()

virtual Common::WriteStream* OSystem::createConfigWriteStream ( )
virtual

Open the default config file for writing by returning a suitable WriteStream instance.

It is the callers responsiblity to delete the stream after use.

May return 0 to indicate that writing to the config file is not possible.

◆ getDefaultConfigFileName()

virtual Common::Path OSystem::getDefaultConfigFileName ( )
virtual

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 in OSystem_iOS7, OSystem_PSP, N3DS::OSystem_3DS, OSystem_libretro, OSystem_MacOSX, OSystem_Win32, OSystem_Atari, OSystem_POSIX, OSystem_Emscripten, OSystem_KolibriOS, OSystem_PSP2, OSystem_RISCOS, OSystem_SDL_Miyoo, OSystem_SDL_Opendingux, and OSystem_PS3.

◆ getDefaultLogFileName()

virtual Common::Path OSystem::getDefaultLogFileName ( )
inlinevirtual

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

Note that not all ports can use this.

Reimplemented in OSystem_iOS7, OSystem_MacOSX, OSystem_Win32, OSystem_POSIX, OSystem_Emscripten, OSystem_KolibriOS, OSystem_PSP2, OSystem_RISCOS, OSystem_SDL_Miyoo, OSystem_SDL_Opendingux, OSystem_Switch, and OSystem_PS3.

◆ registerDefaultSettings()

virtual void OSystem::registerDefaultSettings ( const Common::String target) const
inlinevirtual

Register the default values for the settings the backend uses into the configuration manager.

Parameters
targetname of a config manager target

Reimplemented in OSystem_iOS7.

◆ buildBackendOptionsWidget()

virtual GUI::OptionsContainerWidget* OSystem::buildBackendOptionsWidget ( GUI::GuiObject boss,
const Common::String name,
const Common::String target 
) const
inlinevirtual

Return a GUI widget container for configuring the specified target options.

The returned widget is shown in the Backend tab in the options dialog. Backends can build custom options dialogs.

Backends that don't want to have a Backend tab in the options dialog can return nullptr.

Parameters
bossthe widget / dialog the returned widget is a child of
namethe name the returned widget must use
targetname of a config manager target

Reimplemented in OSystem_iOS7, and OSystem_libretro.

◆ buildHelpDialogData()

virtual const char* const* OSystem::buildHelpDialogData ( )
inlinevirtual

Return list of strings used for building help dialog

The strings represented in triplets:

  • Name of a tab (will be translated)
  • ZIP pack name with images (optional)
  • Text of the tab with Markdown formatting (also be translated)

The string list is null-terminated.

Reimplemented in OSystem_SDL, OSystem_iOS7, and OSystem_libretro.

◆ applyBackendSettings()

virtual void OSystem::applyBackendSettings ( )
inlinevirtual

Notify the backend that the settings editable from the game tab in the options dialog may have changed and that they need to be applied if necessary.

Reimplemented in OSystem_iOS7, and OSystem_libretro.

◆ logMessage()

virtual void OSystem::logMessage ( LogMessageType::Type  type,
const char *  message 
)
pure virtual

Log the given message.

It is up to the backend where to log the different messages. The backend should aim at using a non-buffered output for it, so that no log data is lost in case of a crash.

The default implementation outputs them on stdout/stderr.

Parameters
typeType of the message.
messageThe message itself.

Implemented in OSystem_Wii, OSystem_N64, OSystem_DS, OSystem_iOS7, OSystem_PSP, N3DS::OSystem_3DS, OSystem_libretro, OSystem_SDL, OSystem_Win32, OSystem_Atari, OSystem_PSP2, OSystem_RISCOS, OSystem_Switch, and OSystem_MorphOS.

◆ messageBox()

virtual void OSystem::messageBox ( LogMessageType::Type  type,
const char *  message 
)
inlinevirtual

Display a dialog box containing the given message.

Parameters
typeType of the message.
messageThe message itself.

Reimplemented in OSystem_DS, and OSystem_RISCOS.

◆ displayLogFile()

virtual bool OSystem::displayLogFile ( )
inlinevirtual

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 in OSystem_Win32, OSystem_MacOSX, OSystem_Emscripten, and OSystem_POSIX.

◆ hasTextInClipboard()

virtual bool OSystem::hasTextInClipboard ( )
inlinevirtual

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 in OSystem_iOS7, and OSystem_MacOSX.

◆ getTextFromClipboard()

virtual Common::U32String OSystem::getTextFromClipboard ( )
inlinevirtual

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 in OSystem_iOS7, and OSystem_MacOSX.

◆ setTextInClipboard()

virtual bool OSystem::setTextInClipboard ( const Common::U32String text)
inlinevirtual

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 in OSystem_iOS7, and OSystem_MacOSX.

◆ openUrl()

virtual bool OSystem::openUrl ( const Common::String url)
inlinevirtual

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 in OSystem_iOS7, OSystem_Win32, OSystem_MacOSX, and OSystem_RISCOS.

◆ getSystemLanguage()

virtual Common::String OSystem::getSystemLanguage ( ) const
virtual

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 in OSystem_Wii, OSystem_iOS7, OSystem_DS, N3DS::OSystem_3DS, OSystem_SDL, OSystem_Win32, OSystem_MacOSX, and OSystem_Switch.

◆ isConnectionLimited()

virtual bool OSystem::isConnectionLimited ( )
virtual

Return whether the connection is limited (if available on the target system).

Returns
True if the connection is limited.

Reimplemented in OSystem_iOS7.