87 lines
2.6 KiB
C++
87 lines
2.6 KiB
C++
/* 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.
|
|
*
|
|
* $URL$
|
|
* $Id$
|
|
*
|
|
*/
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
#if defined(UNIX) && defined(USE_TASKBAR)
|
|
|
|
#include "backends/taskbar/unity/unity-taskbar.h"
|
|
|
|
#include "common/textconsole.h"
|
|
|
|
UnityTaskbarManager::UnityTaskbarManager() {
|
|
g_type_init();
|
|
|
|
_launcher = unity_launcher_entry_get_for_desktop_id("scummvm.desktop");
|
|
}
|
|
|
|
UnityTaskbarManager::~UnityTaskbarManager() {
|
|
}
|
|
|
|
void UnityTaskbarManager::setOverlayIcon(const Common::String &name, const Common::String &description) {
|
|
if (_launcher == NULL)
|
|
return;
|
|
|
|
warning("[UnityTaskbarManager::setOverlayIcon] Not implemented");
|
|
}
|
|
|
|
void UnityTaskbarManager::setProgressValue(int completed, int total) {
|
|
if (_launcher == NULL)
|
|
return;
|
|
|
|
double percentage = (double)completed / (double)total;
|
|
unity_launcher_entry_set_progress(_launcher, percentage);
|
|
unity_launcher_entry_set_progress_visible(_launcher, TRUE);
|
|
}
|
|
|
|
void UnityTaskbarManager::setProgressState(TaskbarProgressState state) {
|
|
if (_launcher == NULL)
|
|
return;
|
|
|
|
switch (state) {
|
|
default:
|
|
warning("[UnityTaskbarManager::setProgressState] Unknown state / Not implemented (%d)", state);
|
|
// fallback to noprogress state
|
|
|
|
case kTaskbarNoProgress:
|
|
unity_launcher_entry_set_progress_visible(_launcher, FALSE);
|
|
break;
|
|
|
|
// Unity only support two progress states as of 3.0: visible or not visible
|
|
// We show progress in all of those states
|
|
case kTaskbarIndeterminate:
|
|
case kTaskbarNormal:
|
|
case kTaskbarError:
|
|
case kTaskbarPaused:
|
|
unity_launcher_entry_set_progress_visible(_launcher, TRUE);
|
|
break;
|
|
}
|
|
}
|
|
|
|
void UnityTaskbarManager::addRecent(const Common::String &name, const Common::String &description) {
|
|
warning("[UnityTaskbarManager::addRecent] Not implemented");
|
|
}
|
|
|
|
#endif
|