diff options
author | Bastien Bouclet | 2016-09-18 13:05:16 +0200 |
---|---|---|
committer | Bastien Bouclet | 2016-09-18 17:54:12 +0200 |
commit | 1a1a5b5f692ac74e25b03ba2bdc09e0af3606a4a (patch) | |
tree | 462f5a2740370259327a51959a0923da4f28ed0d /backends/networking/curl/cloudicon.h | |
parent | 361d84ca74b82151509378e1a5bb868b52049502 (diff) | |
download | scummvm-rg350-1a1a5b5f692ac74e25b03ba2bdc09e0af3606a4a.tar.gz scummvm-rg350-1a1a5b5f692ac74e25b03ba2bdc09e0af3606a4a.tar.bz2 scummvm-rg350-1a1a5b5f692ac74e25b03ba2bdc09e0af3606a4a.zip |
CLOUD: Change the cloud icon to be updated by the main thread
The cloud manager registers itself as an event source as a mean to be polled
periodically by the GUI or engine code. The periodical polling is used to
update the OSD icon indicating background sync activity.
Also move the cloud icon from ConnectionManager to CloudManager,
allowing to decouple icon handling from network connections updates.
Diffstat (limited to 'backends/networking/curl/cloudicon.h')
-rw-r--r-- | backends/networking/curl/cloudicon.h | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/backends/networking/curl/cloudicon.h b/backends/networking/curl/cloudicon.h deleted file mode 100644 index d6ea60bd51..0000000000 --- a/backends/networking/curl/cloudicon.h +++ /dev/null @@ -1,70 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef BACKENDS_NETWORKING_CURL_CLOUDICON_H -#define BACKENDS_NETWORKING_CURL_CLOUDICON_H - -#include "graphics/surface.h" - -namespace Networking { - -class CloudIcon { - static const float ALPHA_STEP, ALPHA_MAX, ALPHA_MIN; - - bool _wasVisible, _iconsInited, _showingDisabled; - Graphics::Surface _icon, _disabledIcon, _alphaIcon; - float _currentAlpha; - bool _alphaRising; - int _disabledFrames; - - void initIcons(); - void loadIcon(Graphics::Surface &icon, byte *data, uint32 size); - void makeAlphaIcon(Graphics::Surface &icon, float alpha); - -public: - CloudIcon(); - ~CloudIcon(); - - /** - * This method is called from ConnectionManager every time - * its own timer calls the handle() method. The primary - * responsibility of this draw() method is to draw cloud icon - * on ScummVM's OSD when current cloud Storage is working. - * - * As we don't want ConnectionManager to work when no - * Requests are running, we'd like to stop the timer. But then - * this icon wouldn't have time to disappear smoothly. So, - * in order to do that, ConnectionManager stop its timer - * only when this draw() method returns true, indicating that - * the CloudIcon has disappeared and the timer could be stopped. - * - * @return true if ConnMan's timer could be stopped. - */ - bool draw(); - - /** Draw a "cloud disabled" icon instead of "cloud syncing" one. */ - void showDisabled(); -}; - -} // End of namespace Networking - -#endif |