From 71e457783eb830982aa5f89a3f72ea741f32ffef Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 26 Apr 2011 12:47:03 -0400 Subject: BACKENDS: Add generic TaskbarManager class to handle taskbar integration --- backends/platform/sdl/sdl.cpp | 17 +++++++++++++++++ backends/platform/sdl/sdl.h | 6 ++++-- 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'backends/platform/sdl') 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(); -- cgit v1.2.3