diff options
author | Littleboy | 2011-04-26 12:47:03 -0400 |
---|---|---|
committer | Julien | 2011-06-16 10:26:51 -0400 |
commit | 71e457783eb830982aa5f89a3f72ea741f32ffef (patch) | |
tree | 07637ff4537e330775d1ea238715b25eefff5042 /backends/platform/sdl | |
parent | d8d16e0231272e73f72630c5a1966db6f1e29809 (diff) | |
download | scummvm-rg350-71e457783eb830982aa5f89a3f72ea741f32ffef.tar.gz scummvm-rg350-71e457783eb830982aa5f89a3f72ea741f32ffef.tar.bz2 scummvm-rg350-71e457783eb830982aa5f89a3f72ea741f32ffef.zip |
BACKENDS: Add generic TaskbarManager class to handle taskbar integration
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 17 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.h | 6 |
2 files changed, 21 insertions, 2 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index fd27c82797..4520b74861 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -31,6 +31,7 @@ #include "backends/platform/sdl/sdl.h" #include "common/config-manager.h" #include "common/EventRecorder.h" +#include "common/taskbar.h" #include "common/textconsole.h" #include "backends/saves/default/default-saves.h" @@ -125,6 +126,9 @@ void OSystem_SDL::init() { if (_timerManager == 0) _timerManager = new SdlTimerManager(); + if (_taskbarManager == 0) + _taskbarManager = new Common::TaskbarManager(); + #ifdef USE_OPENGL // Setup a list with both SDL and OpenGL graphics modes setupGraphicsModes(); @@ -209,6 +213,19 @@ void OSystem_SDL::initBackend() { ModularBackend::initBackend(); } +void OSystem_SDL::engineInit() { + // Add the started engine to the list of recent tasks + _taskbarManager->addRecent(ConfMan.getActiveDomainName(), ConfMan.get("description")); + + // Set the overlay icon the current running engine + _taskbarManager->setOverlayIcon(ConfMan.getActiveDomainName(), ConfMan.get("description")); +} + +void OSystem_SDL::engineDone() { + // Remove overlay icon + _taskbarManager->setOverlayIcon("", ""); +} + void OSystem_SDL::initSDL() { // Check if SDL has not been initialized if (!_initedSDL) { diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 9c08752054..19f913ef45 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -30,7 +30,7 @@ #include "backends/events/sdl/sdl-events.h" #include "backends/log/log.h" -/** +/** * Base OSystem class for all SDL ports. */ class OSystem_SDL : public ModularBackend { @@ -38,7 +38,7 @@ public: OSystem_SDL(); virtual ~OSystem_SDL(); - /** + /** * Pre-initialize backend. It should be called after * instantiating the backend. Early needed managers are * created here. @@ -54,6 +54,8 @@ public: // Override functions from ModularBackend and OSystem virtual void initBackend(); + virtual void engineInit(); + virtual void engineDone(); virtual Common::HardwareKeySet *getHardwareKeySet(); virtual void quit(); virtual void fatalError(); |