From 521ba2cb8ac6cbe4240ad4da7ad44d13449e3943 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Tue, 13 Sep 2016 20:25:13 +0200 Subject: OSYSTEM: Introduce a method allowing to draw a background activity icon --- backends/graphics/graphics.h | 1 + backends/modular-backend.cpp | 4 ++++ backends/modular-backend.h | 1 + common/system.h | 19 +++++++++++++++++++ 4 files changed, 25 insertions(+) diff --git a/backends/graphics/graphics.h b/backends/graphics/graphics.h index 921dfca61c..271a482032 100644 --- a/backends/graphics/graphics.h +++ b/backends/graphics/graphics.h @@ -87,6 +87,7 @@ public: virtual void copyRectToOSD(const void *buf, int pitch, int x, int y, int w, int h) {} virtual void clearOSD() {} virtual Graphics::PixelFormat getOSDFormat() { return Graphics::PixelFormat(); } + virtual void displayActivityIconOnOSD(const Graphics::Surface *icon) {} // Graphics::PaletteManager interface diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp index e1bdf15571..13db277a75 100644 --- a/backends/modular-backend.cpp +++ b/backends/modular-backend.cpp @@ -253,6 +253,10 @@ Graphics::PixelFormat ModularBackend::getOSDFormat() { return _graphicsManager->getOSDFormat(); } +void ModularBackend::displayActivityIconOnOSD(const Graphics::Surface *icon) { + _graphicsManager->displayActivityIconOnOSD(icon); +} + void ModularBackend::quit() { exit(0); } diff --git a/backends/modular-backend.h b/backends/modular-backend.h index 9cde27915f..886f91c320 100644 --- a/backends/modular-backend.h +++ b/backends/modular-backend.h @@ -130,6 +130,7 @@ public: virtual void copyRectToOSD(const void *buf, int pitch, int x, int y, int w, int h); virtual void clearOSD(); virtual Graphics::PixelFormat getOSDFormat(); + virtual void displayActivityIconOnOSD(const Graphics::Surface *icon); //@} diff --git a/common/system.h b/common/system.h index eb9a39bbdf..b07a5ffd1e 100644 --- a/common/system.h +++ b/common/system.h @@ -1101,6 +1101,25 @@ public: */ virtual void displayMessageOnOSD(const char *msg) = 0; + /** + * Display an icon indicating 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. + * + * @param icon the icon to display on screen + */ + virtual void displayActivityIconOnOSD(const Graphics::Surface *icon) = 0; + /** * Blit a bitmap to the 'on screen display'. * -- cgit v1.2.3