aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorMatthew Hoops2011-05-11 00:30:02 -0400
committerMatthew Hoops2011-05-11 00:30:28 -0400
commita1d41da096c0bcf502a85919cb1cb1ee471719c5 (patch)
tree8c51419daa486f1d4833757db4715dadab6c3497 /gui
parentaccb0c2a5d0c9e7b353cda4b74f511a498ed8073 (diff)
parent33c3e19cea2a08fbf26ecbe940763e8ee1c37d28 (diff)
downloadscummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.tar.gz
scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.tar.bz2
scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.zip
Merge remote branch 'upstream/master' into t7g-ios
Conflicts: audio/decoders/qdm2.h common/util.cpp engines/groovie/music.cpp engines/groovie/resource.h video/qt_decoder.cpp video/qt_decoder.h
Diffstat (limited to 'gui')
-rw-r--r--gui/ThemeEngine.cpp63
-rw-r--r--gui/ThemeEngine.h16
-rw-r--r--gui/ThemeEval.cpp2
-rw-r--r--gui/ThemeEval.h2
-rw-r--r--gui/ThemeLayout.cpp6
-rw-r--r--gui/ThemeLayout.h5
-rw-r--r--gui/ThemeParser.cpp2
-rw-r--r--gui/Tooltip.cpp1
-rw-r--r--gui/Tooltip.h5
-rw-r--r--gui/about.cpp2
-rw-r--r--gui/about.h3
-rw-r--r--gui/browser.cpp1
-rw-r--r--gui/browser.h2
-rw-r--r--gui/chooser.cpp3
-rw-r--r--gui/chooser.h2
-rw-r--r--gui/console.cpp2
-rw-r--r--gui/credits.h8
-rw-r--r--gui/debugger.cpp1
-rw-r--r--gui/dialog.cpp5
-rw-r--r--gui/dialog.h6
-rw-r--r--gui/error.cpp4
-rw-r--r--gui/error.h2
-rw-r--r--gui/gui-manager.cpp4
-rw-r--r--gui/gui-manager.h7
-rw-r--r--gui/launcher.cpp4
-rw-r--r--gui/launcher.h5
-rw-r--r--gui/massadd.cpp14
-rw-r--r--gui/massadd.h2
-rw-r--r--gui/message.cpp1
-rw-r--r--gui/message.h2
-rw-r--r--gui/object.cpp3
-rw-r--r--gui/object.h4
-rw-r--r--gui/options.cpp16
-rw-r--r--gui/options.h14
-rw-r--r--gui/saveload.h4
-rw-r--r--gui/themebrowser.h2
-rw-r--r--gui/themes/scummmodern.zipbin198479 -> 198479 bytes
-rw-r--r--gui/themes/scummmodern/scummmodern_layout.stx2
-rw-r--r--gui/themes/translations.datbin189132 -> 201288 bytes
-rw-r--r--gui/widget.cpp17
-rw-r--r--gui/widget.h5
-rw-r--r--gui/widgets/editable.cpp4
-rw-r--r--gui/widgets/editable.h8
-rw-r--r--gui/widgets/edittext.cpp9
-rw-r--r--gui/widgets/edittext.h6
-rw-r--r--gui/widgets/list.cpp1
-rw-r--r--gui/widgets/popup.cpp2
-rw-r--r--gui/widgets/scrollbar.cpp7
-rw-r--r--gui/widgets/tab.cpp1
49 files changed, 170 insertions, 117 deletions
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 82104eb7ae..098cb8e0ac 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -24,7 +24,6 @@
*/
#include "common/system.h"
-#include "common/events.h"
#include "common/config-manager.h"
#include "common/file.h"
#include "common/fs.h"
@@ -32,14 +31,13 @@
#include "common/tokenizer.h"
#include "common/translation.h"
-#include "graphics/colormasks.h"
#include "graphics/cursorman.h"
#include "graphics/fontman.h"
#include "graphics/imagedec.h"
#include "graphics/surface.h"
#include "graphics/VectorRenderer.h"
-#include "gui/launcher.h"
+#include "gui/widget.h"
#include "gui/ThemeEngine.h"
#include "gui/ThemeEval.h"
#include "gui/ThemeParser.h"
@@ -373,8 +371,8 @@ const char *ThemeEngine::findModeConfigName(GraphicsMode mode) {
bool ThemeEngine::init() {
// reset everything and reload the graphics
_initOk = false;
- setGraphicsMode(_graphicsMode);
_overlayFormat = _system->getOverlayFormat();
+ setGraphicsMode(_graphicsMode);
if (_screen.pixels && _backBuffer.pixels) {
_initOk = true;
@@ -393,7 +391,7 @@ bool ThemeEngine::init() {
Common::FSNode node(_themeFile);
if (node.isDirectory()) {
_themeArchive = new Common::FSDirectory(node);
- } else if (_themeFile.hasSuffix(".zip")) {
+ } else if (_themeFile.matchString("*.zip", true)) {
// TODO: Also use "node" directly?
// Look for the zip file via SearchMan
Common::ArchiveMemberPtr member = SearchMan.getMember(_themeFile);
@@ -499,10 +497,10 @@ void ThemeEngine::setGraphicsMode(GraphicsMode mode) {
uint32 height = _system->getOverlayHeight();
_backBuffer.free();
- _backBuffer.create(width, height, _bytesPerPixel);
+ _backBuffer.create(width, height, _overlayFormat);
_screen.free();
- _screen.create(width, height, _bytesPerPixel);
+ _screen.create(width, height, _overlayFormat);
delete _vectorRenderer;
_vectorRenderer = Graphics::createRenderer(mode);
@@ -1477,20 +1475,23 @@ Common::String ThemeEngine::genLocalizedFontFilename(const Common::String &filen
#ifndef USE_TRANSLATION
return filename;
#else
- Common::String result;
- bool pointPassed = false;
-
- for (const char *p = filename.c_str(); *p != 0; p++) {
- if (!pointPassed && *p == '.') {
- result += "-";
- result += TransMan.getCurrentCharset();
- result += *p;
-
- pointPassed = true;
- } else {
- result += *p;
- }
- }
+ // We will transform the font filename in the following way:
+ // name.bdf
+ // will become:
+ // name-charset.bdf
+ // Note that name should not contain any dot here!
+
+ // In the first step we look for the dot. In case there is none we will
+ // return the normal filename.
+ Common::String::const_iterator dot = Common::find(filename.begin(), filename.end(), '.');
+ if (dot == filename.end())
+ return filename;
+
+ // Put the translated font filename string back together.
+ Common::String result(filename.begin(), dot);
+ result += '-';
+ result += TransMan.getCurrentCharset();
+ result += dot;
return result;
#endif
@@ -1502,6 +1503,12 @@ Common::String ThemeEngine::genLocalizedFontFilename(const Common::String &filen
*********************************************************/
bool ThemeEngine::themeConfigParseHeader(Common::String header, Common::String &themeName) {
+ // Check that header is not corrupted
+ if ((byte)header[0] > 127) {
+ warning("Corrupted theme header found");
+ return false;
+ }
+
header.trim();
if (header.empty())
@@ -1528,7 +1535,7 @@ bool ThemeEngine::themeConfigUsable(const Common::ArchiveMember &member, Common:
Common::File stream;
bool foundHeader = false;
- if (member.getName().hasSuffix(".zip")) {
+ if (member.getName().matchString("*.zip", true)) {
Common::Archive *zipArchive = Common::makeZipArchive(member.createReadStream());
if (zipArchive && zipArchive->hasFile("THEMERC")) {
@@ -1550,7 +1557,7 @@ bool ThemeEngine::themeConfigUsable(const Common::FSNode &node, Common::String &
Common::File stream;
bool foundHeader = false;
- if (node.getName().hasSuffix(".zip") && !node.isDirectory()) {
+ if (node.getName().matchString("*.zip", true) && !node.isDirectory()) {
Common::Archive *zipArchive = Common::makeZipArchive(node);
if (zipArchive && zipArchive->hasFile("THEMERC")) {
// Open THEMERC from the ZIP file.
@@ -1636,7 +1643,7 @@ void ThemeEngine::listUsableThemes(Common::Archive &archive, Common::List<ThemeD
// If the name of the node object also contains
// the ".zip" suffix, we will strip it.
- if (td.id.hasSuffix(".zip")) {
+ if (td.id.matchString("*.zip", true)) {
for (int j = 0; j < 4; ++j)
td.id.deleteLastChar();
}
@@ -1673,7 +1680,7 @@ void ThemeEngine::listUsableThemes(const Common::FSNode &node, Common::List<Them
for (Common::FSList::iterator i = fileList.begin(); i != fileList.end(); ++i) {
// We will only process zip files for now
- if (!i->getPath().hasSuffix(".zip"))
+ if (!i->getPath().matchString("*.zip", true))
continue;
td.name.clear();
@@ -1683,7 +1690,7 @@ void ThemeEngine::listUsableThemes(const Common::FSNode &node, Common::List<Them
// If the name of the node object also contains
// the ".zip" suffix, we will strip it.
- if (td.id.hasSuffix(".zip")) {
+ if (td.id.matchString("*.zip", true)) {
for (int j = 0; j < 4; ++j)
td.id.deleteLastChar();
}
@@ -1720,7 +1727,7 @@ Common::String ThemeEngine::getThemeFile(const Common::String &id) {
Common::FSNode node(id);
// If the given id is a full path we'll just use it
- if (node.exists() && (node.isDirectory() || node.getName().hasSuffix(".zip")))
+ if (node.exists() && (node.isDirectory() || node.getName().matchString("*.zip", true)))
return id;
// FIXME:
@@ -1751,7 +1758,7 @@ Common::String ThemeEngine::getThemeId(const Common::String &filename) {
if (!node.exists())
return "builtin";
- if (node.getName().hasSuffix(".zip")) {
+ if (node.getName().matchString("*.zip", true)) {
Common::String id = node.getName();
for (int i = 0; i < 4; ++i)
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 46065278d3..08560c8635 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -27,13 +27,25 @@
#define GUI_THEME_ENGINE_H
#include "common/scummsys.h"
-#include "common/system.h"
#include "common/fs.h"
+#include "common/hash-str.h"
+#include "common/hashmap.h"
+#include "common/list.h"
+#include "common/str.h"
+
#include "graphics/surface.h"
#include "graphics/font.h"
+#include "graphics/pixelformat.h"
+
#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.3"
+class OSystem;
+
+namespace Common {
+struct Rect;
+}
+
namespace Graphics {
struct DrawStep;
class VectorRenderer;
@@ -42,8 +54,6 @@ class VectorRenderer;
namespace GUI {
struct WidgetDrawData;
-struct DrawDataInfo;
-struct TextDataInfo;
struct TextDrawData;
struct TextColorData;
class Dialog;
diff --git a/gui/ThemeEval.cpp b/gui/ThemeEval.cpp
index 017d47fd29..64e18f93a3 100644
--- a/gui/ThemeEval.cpp
+++ b/gui/ThemeEval.cpp
@@ -24,10 +24,10 @@
*/
#include "gui/ThemeEval.h"
-#include "gui/widget.h"
#include "graphics/scaler.h"
+#include "common/system.h"
#include "common/tokenizer.h"
namespace GUI {
diff --git a/gui/ThemeEval.h b/gui/ThemeEval.h
index ac867512da..65bed3e271 100644
--- a/gui/ThemeEval.h
+++ b/gui/ThemeEval.h
@@ -30,6 +30,8 @@
#include "common/hashmap.h"
#include "common/hash-str.h"
#include "common/stack.h"
+#include "common/str.h"
+#include "common/textconsole.h"
#include "graphics/font.h"
#include "gui/ThemeLayout.h"
diff --git a/gui/ThemeLayout.cpp b/gui/ThemeLayout.cpp
index 3c930db73c..fbfc498bcb 100644
--- a/gui/ThemeLayout.cpp
+++ b/gui/ThemeLayout.cpp
@@ -25,14 +25,12 @@
#include "common/util.h"
#include "common/system.h"
-#include "common/events.h"
-#include "common/xmlparser.h"
-#include "gui/ThemeEval.h"
#include "gui/ThemeLayout.h"
-#ifdef LAYOUT_DEBUG_DIALOG
#include "graphics/font.h"
+
+#ifdef LAYOUT_DEBUG_DIALOG
#include "graphics/surface.h"
#endif
diff --git a/gui/ThemeLayout.h b/gui/ThemeLayout.h
index 3d367df147..76d3f7d380 100644
--- a/gui/ThemeLayout.h
+++ b/gui/ThemeLayout.h
@@ -26,12 +26,13 @@
#ifndef THEME_LAYOUT_H
#define THEME_LAYOUT_H
+#include "common/array.h"
#include "common/rect.h"
+#include "graphics/font.h"
#ifdef LAYOUT_DEBUG_DIALOG
namespace Graphics {
- class Font;
- class Surface;
+class Surface;
}
#endif
diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp
index e3523d11e8..230dad8cc5 100644
--- a/gui/ThemeParser.cpp
+++ b/gui/ThemeParser.cpp
@@ -26,10 +26,10 @@
#include "gui/ThemeEngine.h"
#include "gui/ThemeEval.h"
#include "gui/ThemeParser.h"
-#include "gui/gui-manager.h"
#include "graphics/VectorRenderer.h"
+#include "common/system.h"
#include "common/tokenizer.h"
namespace GUI {
diff --git a/gui/Tooltip.cpp b/gui/Tooltip.cpp
index 7dec12d522..a7cb0610e7 100644
--- a/gui/Tooltip.cpp
+++ b/gui/Tooltip.cpp
@@ -23,7 +23,6 @@
*/
#include "common/util.h"
-#include "graphics/fontman.h"
#include "gui/widget.h"
#include "gui/dialog.h"
#include "gui/gui-manager.h"
diff --git a/gui/Tooltip.h b/gui/Tooltip.h
index d228ca8a49..f5e2bb08a8 100644
--- a/gui/Tooltip.h
+++ b/gui/Tooltip.h
@@ -25,11 +25,14 @@
#ifndef GUI_TOOLTIP_H
#define GUI_TOOLTIP_H
+#include "common/keyboard.h"
+#include "common/str-array.h"
#include "gui/dialog.h"
-#include "gui/widget.h"
namespace GUI {
+class Widget;
+
class Tooltip : public Dialog {
public:
Tooltip();
diff --git a/gui/about.cpp b/gui/about.cpp
index c2d9a3f983..0389f4c8da 100644
--- a/gui/about.cpp
+++ b/gui/about.cpp
@@ -31,8 +31,6 @@
#include "common/util.h"
#include "gui/about.h"
#include "gui/gui-manager.h"
-#include "gui/widget.h"
-
#include "gui/ThemeEval.h"
namespace GUI {
diff --git a/gui/about.h b/gui/about.h
index fc216a78dc..b49365c5e5 100644
--- a/gui/about.h
+++ b/gui/about.h
@@ -27,7 +27,8 @@
#include "gui/dialog.h"
#include "common/str.h"
-#include "graphics/surface.h"
+#include "common/array.h"
+#include "common/keyboard.h"
namespace GUI {
diff --git a/gui/browser.cpp b/gui/browser.cpp
index 4ee6bafdde..2c7459623f 100644
--- a/gui/browser.cpp
+++ b/gui/browser.cpp
@@ -23,7 +23,6 @@
*/
#include "gui/browser.h"
-#include "gui/gui-manager.h"
#include "gui/widgets/list.h"
#include "common/config-manager.h"
diff --git a/gui/browser.h b/gui/browser.h
index 1fef041a5a..eb3498e654 100644
--- a/gui/browser.h
+++ b/gui/browser.h
@@ -26,13 +26,13 @@
#define BROWSER_DIALOG_H
#include "gui/dialog.h"
-#include "common/str.h"
#include "common/fs.h"
namespace GUI {
class ListWidget;
class StaticTextWidget;
+class CommandSender;
class BrowserDialog : public Dialog {
public:
diff --git a/gui/chooser.cpp b/gui/chooser.cpp
index f5e7d26a32..ecc8ebd894 100644
--- a/gui/chooser.cpp
+++ b/gui/chooser.cpp
@@ -22,10 +22,9 @@
* $Id$
*/
-#include "common/system.h"
#include "common/translation.h"
#include "gui/chooser.h"
-#include "gui/gui-manager.h"
+#include "gui/widget.h"
#include "gui/widgets/list.h"
namespace GUI {
diff --git a/gui/chooser.h b/gui/chooser.h
index ce67c008df..79a20383c5 100644
--- a/gui/chooser.h
+++ b/gui/chooser.h
@@ -25,12 +25,14 @@
#ifndef CHOOSER_DIALOG_H
#define CHOOSER_DIALOG_H
+#include "common/array.h"
#include "common/str.h"
#include "gui/dialog.h"
namespace GUI {
class ButtonWidget;
+class CommandSender;
class ListWidget;
/*
diff --git a/gui/console.cpp b/gui/console.cpp
index cb3319063d..cbab1b212e 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -27,10 +27,8 @@
#include "gui/ThemeEval.h"
#include "gui/gui-manager.h"
-#include "engines/engine.h"
#include "base/version.h"
-#include "common/events.h"
#include "common/system.h"
#include "graphics/fontman.h"
diff --git a/gui/credits.h b/gui/credits.h
index a6a8a4f483..7ad480032e 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -206,6 +206,10 @@ static const char *credits[] = {
"C1""Touch\351",
"C0""Gregory Montoir",
"",
+"C1""TsAGE",
+"C0""Paul Gilbert",
+"C0""Arnaud Boutonn\351",
+"",
"C1""Tucker",
"C0""Gregory Montoir",
"",
@@ -472,7 +476,7 @@ static const char *credits[] = {
"C0""Raina",
"C2""ScummVM forum buttons",
"C0""William Claydon",
-"C2""Skins for doxygen and wiki",
+"C2""Skins for doxygen, buildbot and wiki",
"",
"C1""Code contributions",
"C0""Ori Avtalion",
@@ -649,7 +653,7 @@ static const char *credits[] = {
"C0""",
"C0""Emilio de Paz Aragon from Alcachofa Soft for sharing the source code of Drascula: The Vampire Strikes Back with us and his generosity with freewaring the game.",
"C0""",
-"C0""David P. Gray from Gray Design Associate for sharing the source code of the Hugo trilogy.",
+"C0""David P. Gray from Gray Design Associates for sharing the source code of the Hugo trilogy.",
"C0""",
"C0""Broken Sword 2.5 team for providing sources of their engine and their great support.",
"C0""",
diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index f113206ea1..2282bc3a1c 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -26,7 +26,6 @@
// NB: This is really only necessary if USE_READLINE is defined
#define FORBIDDEN_SYMBOL_ALLOW_ALL
-#include "common/debug.h"
#include "common/debug-channels.h"
#include "common/system.h"
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index 2c2b0603d6..15e47141c8 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -22,14 +22,11 @@
* $Id$
*/
-#include "common/events.h"
+#include "common/rect.h"
#include "gui/gui-manager.h"
#include "gui/dialog.h"
#include "gui/widget.h"
-#include "gui/widgets/popup.h"
-
-#include "common/system.h"
namespace GUI {
diff --git a/gui/dialog.h b/gui/dialog.h
index 1845786044..c298ef107b 100644
--- a/gui/dialog.h
+++ b/gui/dialog.h
@@ -27,14 +27,14 @@
#include "common/scummsys.h"
#include "common/str.h"
+#include "common/keyboard.h"
#include "gui/object.h"
-#include "gui/widget.h"
+#include "gui/ThemeEngine.h"
namespace GUI {
-class GuiManager;
-class PopUpWidget;
+class Widget;
// Some "common" commands sent to handleCommand()
enum {
diff --git a/gui/error.cpp b/gui/error.cpp
index 3332eb533a..f6da795d40 100644
--- a/gui/error.cpp
+++ b/gui/error.cpp
@@ -36,10 +36,10 @@ void displayErrorDialog(const char *text) {
alert.runModal();
}
-void displayErrorDialog(Common::Error error, const char *extraText) {
+void displayErrorDialog(const Common::Error &error, const char *extraText) {
Common::String errorText(extraText);
errorText += " ";
- errorText += _(Common::errorToString(error));
+ errorText += _(error.getDesc());
GUI::MessageDialog alert(errorText);
alert.runModal();
}
diff --git a/gui/error.h b/gui/error.h
index a55f555bed..f048a0cd09 100644
--- a/gui/error.h
+++ b/gui/error.h
@@ -36,7 +36,7 @@ namespace GUI {
* @param error error code
* @param extraText extra text to be displayed in addition to default string description(optional)
*/
-void displayErrorDialog(Common::Error error, const char *extraText = "");
+void displayErrorDialog(const Common::Error &error, const char *extraText = "");
/**
* Displays an error dialog for a given message.
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index 0cb06458ef..19ca66b7b1 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -27,7 +27,8 @@
#include "common/util.h"
#include "common/config-manager.h"
#include "common/algorithm.h"
-#include "common/timer.h"
+#include "common/rect.h"
+#include "common/textconsole.h"
#include "common/translation.h"
#include "backends/keymapper/keymapper.h"
@@ -37,6 +38,7 @@
#include "gui/ThemeEngine.h"
#include "gui/ThemeEval.h"
#include "gui/Tooltip.h"
+#include "gui/widget.h"
#include "graphics/cursorman.h"
diff --git a/gui/gui-manager.h b/gui/gui-manager.h
index a6c90bfe8d..ac4118bb06 100644
--- a/gui/gui-manager.h
+++ b/gui/gui-manager.h
@@ -30,13 +30,14 @@
#include "common/stack.h"
#include "common/str.h"
-#include "graphics/font.h"
-
-#include "gui/widget.h"
#include "gui/ThemeEngine.h"
class OSystem;
+namespace Graphics {
+class Font;
+}
+
namespace GUI {
class Dialog;
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 1d209ce71a..aed57decd3 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -28,7 +28,6 @@
#include "common/events.h"
#include "common/fs.h"
#include "common/util.h"
-#include "common/savefile.h"
#include "common/system.h"
#include "common/translation.h"
@@ -49,9 +48,6 @@
#include "graphics/cursorman.h"
-#include "audio/mididrv.h"
-
-
using Common::ConfigManager;
namespace GUI {
diff --git a/gui/launcher.h b/gui/launcher.h
index df9a6fb639..274fc45bb4 100644
--- a/gui/launcher.h
+++ b/gui/launcher.h
@@ -31,10 +31,13 @@
namespace GUI {
class BrowserDialog;
+class CommandSender;
class ListWidget;
+class ButtonWidget;
class GraphicsWidget;
-class SaveLoadChooser;
+class StaticTextWidget;
class EditTextWidget;
+class SaveLoadChooser;
Common::String addGameToConf(const GameDescriptor &result);
diff --git a/gui/massadd.cpp b/gui/massadd.cpp
index 197caae675..80d580d2a0 100644
--- a/gui/massadd.cpp
+++ b/gui/massadd.cpp
@@ -24,14 +24,13 @@
#include "engines/metaengine.h"
#include "common/algorithm.h"
-#include "common/events.h"
-#include "common/func.h"
#include "common/config-manager.h"
+#include "common/debug.h"
+#include "common/system.h"
#include "common/translation.h"
#include "gui/launcher.h" // For addGameToConf()
#include "gui/massadd.h"
-#include "gui/gui-manager.h"
#include "gui/widget.h"
#include "gui/widgets/list.h"
@@ -63,6 +62,7 @@ enum {
MassAddDialog::MassAddDialog(const Common::FSNode &startDir)
: Dialog("MassAdd"),
_dirsScanned(0),
+ _oldGamesCount(0),
_okButton(0),
_dirProgressText(0),
_gameProgressText(0) {
@@ -213,8 +213,10 @@ void MassAddDialog::handleTickle() {
break;
}
}
- if (duplicate)
+ if (duplicate) {
+ _oldGamesCount++;
break; // Skip duplicates
+ }
}
result["path"] = path;
_games.push_back(result);
@@ -244,14 +246,14 @@ void MassAddDialog::handleTickle() {
snprintf(buf, sizeof(buf), "%s", _("Scan complete!"));
_dirProgressText->setLabel(buf);
- snprintf(buf, sizeof(buf), _("Discovered %d new games."), _games.size());
+ snprintf(buf, sizeof(buf), _("Discovered %d new games, ignored %d previously added games."), _games.size(), _oldGamesCount);
_gameProgressText->setLabel(buf);
} else {
snprintf(buf, sizeof(buf), _("Scanned %d directories ..."), _dirsScanned);
_dirProgressText->setLabel(buf);
- snprintf(buf, sizeof(buf), _("Discovered %d new games ..."), _games.size());
+ snprintf(buf, sizeof(buf), _("Discovered %d new games, ignored %d previously added games ..."), _games.size(), _oldGamesCount);
_gameProgressText->setLabel(buf);
}
diff --git a/gui/massadd.h b/gui/massadd.h
index 31a8821a26..6aad392b0d 100644
--- a/gui/massadd.h
+++ b/gui/massadd.h
@@ -30,7 +30,6 @@
#include "common/hashmap.h"
#include "common/stack.h"
#include "common/str.h"
-#include "common/hash-str.h"
namespace GUI {
@@ -63,6 +62,7 @@ private:
Common::HashMap<Common::String, StringArray> _pathToTargets;
int _dirsScanned;
+ int _oldGamesCount;
Widget *_okButton;
StaticTextWidget *_dirProgressText;
diff --git a/gui/message.cpp b/gui/message.cpp
index 2d097a75a9..5cb4cec3d3 100644
--- a/gui/message.cpp
+++ b/gui/message.cpp
@@ -22,7 +22,6 @@
* $Id$
*/
-#include "common/events.h"
#include "common/str.h"
#include "common/system.h"
#include "gui/message.h"
diff --git a/gui/message.h b/gui/message.h
index 912e3b0785..5c3308e425 100644
--- a/gui/message.h
+++ b/gui/message.h
@@ -30,6 +30,8 @@
namespace GUI {
+class CommandSender;
+
enum {
kMessageOK = 1,
kMessageCancel = 0
diff --git a/gui/object.cpp b/gui/object.cpp
index bf8e7a8642..6564fe2b68 100644
--- a/gui/object.cpp
+++ b/gui/object.cpp
@@ -22,7 +22,8 @@
* $Id$
*/
-#include "common/system.h"
+#include "common/textconsole.h"
+
#include "gui/object.h"
#include "gui/widget.h"
#include "gui/gui-manager.h"
diff --git a/gui/object.h b/gui/object.h
index fb5ff18290..3b181fd8a3 100644
--- a/gui/object.h
+++ b/gui/object.h
@@ -25,9 +25,11 @@
#ifndef GUI_OBJECT_H
#define GUI_OBJECT_H
+#include "common/scummsys.h"
+#include "common/str.h"
+
namespace GUI {
-class CommandReceiver;
class CommandSender;
class CommandReceiver {
diff --git a/gui/options.cpp b/gui/options.cpp
index a540fbb9d1..547ab0f3c6 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -24,10 +24,8 @@
#include "gui/browser.h"
#include "gui/themebrowser.h"
-#include "gui/chooser.h"
#include "gui/message.h"
#include "gui/gui-manager.h"
-#include "gui/ThemeEval.h"
#include "gui/options.h"
#include "gui/widgets/popup.h"
#include "gui/widgets/tab.h"
@@ -35,10 +33,9 @@
#include "common/fs.h"
#include "common/config-manager.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "common/translation.h"
-#include "graphics/scaler.h"
-
#include "audio/mididrv.h"
#include "audio/musicplugin.h"
#include "audio/mixer.h"
@@ -144,6 +141,7 @@ void OptionsDialog::init() {
_subSpeedDesc = 0;
_subSpeedSlider = 0;
_subSpeedLabel = 0;
+ _oldTheme = ConfMan.get("gui_theme");
// Retrieve game GUI options
_guioptions = 0;
@@ -509,6 +507,13 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
setResult(1);
close();
break;
+ case kCloseCmd:
+ if (g_gui.theme()->getThemeId() != _oldTheme) {
+ g_gui.loadNewTheme(_oldTheme);
+ ConfMan.set("gui_theme", _oldTheme);
+ }
+ close();
+ break;
default:
Dialog::handleCommand(sender, cmd, data);
}
@@ -1316,7 +1321,6 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
#ifdef USE_TRANSLATION
Common::String lang = TransMan.getCurrentLanguage();
#endif
- Common::String oldTheme = g_gui.theme()->getThemeId();
if (g_gui.loadNewTheme(theme)) {
#ifdef USE_TRANSLATION
// If the charset has changed, it means the font were not found for the
@@ -1324,7 +1328,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
// language without restarting, we let the user know about this.
if (lang != TransMan.getCurrentLanguage()) {
TransMan.setLanguage(lang.c_str());
- g_gui.loadNewTheme(oldTheme);
+ g_gui.loadNewTheme(_oldTheme);
MessageDialog error(_("The theme you selected does not support your current language. If you want to use this theme you need to switch to another language first."));
error.runModal();
} else {
diff --git a/gui/options.h b/gui/options.h
index eba1779b69..c097a3a9e9 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -27,7 +27,7 @@
#include "gui/dialog.h"
#include "common/str.h"
-#include "audio/musicplugin.h"
+#include "audio/mididrv.h"
#ifdef SMALL_SCREEN_DEVICE
#include "gui/KeysDialog.h"
@@ -35,13 +35,16 @@
namespace GUI {
-class BrowserDialog;
class CheckboxWidget;
class PopUpWidget;
class SliderWidget;
class StaticTextWidget;
-class ListWidget;
class TabWidget;
+class ButtonWidget;
+class CommandSender;
+class GuiObject;
+class RadiobuttonGroup;
+class RadiobuttonWidget;
class OptionsDialog : public Dialog {
public:
@@ -174,6 +177,11 @@ protected:
//
uint32 _guioptions;
Common::String _guioptionsString;
+
+ //
+ //Theme Options
+ //
+ Common::String _oldTheme;
};
diff --git a/gui/saveload.h b/gui/saveload.h
index b3622c1f13..06f1251e11 100644
--- a/gui/saveload.h
+++ b/gui/saveload.h
@@ -32,6 +32,10 @@ namespace GUI {
class ListWidget;
class GraphicsWidget;
+class ButtonWidget;
+class CommandSender;
+class ContainerWidget;
+class StaticTextWidget;
class SaveLoadChooser : GUI::Dialog {
typedef Common::String String;
diff --git a/gui/themebrowser.h b/gui/themebrowser.h
index aba519886d..bd6b11fb46 100644
--- a/gui/themebrowser.h
+++ b/gui/themebrowser.h
@@ -33,8 +33,8 @@
namespace GUI {
+class CommandSender;
class ListWidget;
-class StaticTextWidget;
class ThemeBrowser : public Dialog {
public:
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index 77951475e6..1e44442933 100644
--- a/gui/themes/scummmodern.zip
+++ b/gui/themes/scummmodern.zip
Binary files differ
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 32d6d19d1a..c0433ceb9a 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -128,7 +128,7 @@
/>
<space />
<widget name = 'Version'
- width = '247'
+ width = '310'
height = 'Globals.Line.Height'
textalign = 'center'
/>
diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat
index e488b45347..f025a05337 100644
--- a/gui/themes/translations.dat
+++ b/gui/themes/translations.dat
Binary files differ
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 61f4a0e249..d3c8d3402d 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -22,10 +22,12 @@
* $Id$
*/
-#include "common/util.h"
-#include "graphics/fontman.h"
+#include "common/scummsys.h"
+#include "common/system.h"
+#include "common/rect.h"
+#include "common/textconsole.h"
+#include "graphics/pixelformat.h"
#include "gui/widget.h"
-#include "gui/dialog.h"
#include "gui/gui-manager.h"
#include "gui/ThemeEval.h"
@@ -345,7 +347,7 @@ void PicButtonWidget::setGfx(const Graphics::Surface *gfx) {
void PicButtonWidget::drawWidget() {
g_gui.theme()->drawButton(Common::Rect(_x, _y, _x+_w, _y+_h), "", _state, getFlags());
- if (sizeof(OverlayColor) == _gfx.bytesPerPixel && _gfx.pixels) {
+ if (sizeof(OverlayColor) == _gfx.format.bytesPerPixel && _gfx.pixels) {
const int x = _x + (_w - _gfx.w) / 2;
const int y = _y + (_h - _gfx.h) / 2;
@@ -573,11 +575,12 @@ void GraphicsWidget::setGfx(int w, int h, int r, int g, int b) {
if (h == -1)
h = _h;
+ Graphics::PixelFormat overlayFormat = g_system->getOverlayFormat();
+
_gfx.free();
- _gfx.create(w, h, sizeof(OverlayColor));
+ _gfx.create(w, h, overlayFormat);
OverlayColor *dst = (OverlayColor *)_gfx.pixels;
- Graphics::PixelFormat overlayFormat = g_system->getOverlayFormat();
OverlayColor fillCol = overlayFormat.RGBToColor(r, g, b);
while (h--) {
for (int i = 0; i < w; ++i) {
@@ -587,7 +590,7 @@ void GraphicsWidget::setGfx(int w, int h, int r, int g, int b) {
}
void GraphicsWidget::drawWidget() {
- if (sizeof(OverlayColor) == _gfx.bytesPerPixel && _gfx.pixels) {
+ if (sizeof(OverlayColor) == _gfx.format.bytesPerPixel && _gfx.pixels) {
const int x = _x + (_w - _gfx.w) / 2;
const int y = _y + (_h - _gfx.h) / 2;
diff --git a/gui/widget.h b/gui/widget.h
index 1bb9823fdf..9acccd9684 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -26,17 +26,16 @@
#define GUI_WIDGET_H
#include "common/scummsys.h"
+#include "common/array.h"
#include "common/str.h"
-#include "common/str-array.h"
#include "common/keyboard.h"
+#include "graphics/font.h"
#include "graphics/surface.h"
#include "gui/object.h"
#include "gui/ThemeEngine.h"
namespace GUI {
-class Dialog;
-
enum {
WIDGET_ENABLED = 1 << 0,
WIDGET_INVISIBLE = 1 << 1,
diff --git a/gui/widgets/editable.cpp b/gui/widgets/editable.cpp
index 7d6e0fae01..2ee3575bc6 100644
--- a/gui/widgets/editable.cpp
+++ b/gui/widgets/editable.cpp
@@ -22,9 +22,11 @@
* $Id$
*/
-#include "common/events.h"
+#include "common/rect.h"
+#include "common/system.h"
#include "gui/widgets/editable.h"
#include "gui/gui-manager.h"
+#include "graphics/font.h"
namespace GUI {
diff --git a/gui/widgets/editable.h b/gui/widgets/editable.h
index b394e105d1..e0b6375919 100644
--- a/gui/widgets/editable.h
+++ b/gui/widgets/editable.h
@@ -25,9 +25,15 @@
#ifndef GUI_WIDGETS_EDITABLE_H
#define GUI_WIDGETS_EDITABLE_H
+#include "common/keyboard.h"
#include "common/str.h"
-#include "common/rect.h"
#include "gui/widget.h"
+#include "gui/ThemeEngine.h"
+#include "gui/object.h"
+
+namespace Common {
+struct Rect;
+}
namespace GUI {
diff --git a/gui/widgets/edittext.cpp b/gui/widgets/edittext.cpp
index 3ef813283e..106262bafe 100644
--- a/gui/widgets/edittext.cpp
+++ b/gui/widgets/edittext.cpp
@@ -23,25 +23,26 @@
*/
#include "gui/widgets/edittext.h"
-#include "gui/dialog.h"
#include "gui/gui-manager.h"
#include "gui/ThemeEval.h"
namespace GUI {
-EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip, uint32 cmd)
+ EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip, uint32 cmd, uint32 finishCmd)
: EditableWidget(boss, x, y - 1, w, h + 2, tooltip, cmd) {
setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE);
_type = kEditTextWidget;
+ _finishCmd = finishCmd;
setEditString(text);
}
-EditTextWidget::EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltip, uint32 cmd)
+EditTextWidget::EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltip, uint32 cmd, uint32 finishCmd)
: EditableWidget(boss, name, tooltip, cmd) {
setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE);
_type = kEditTextWidget;
+ _finishCmd = finishCmd;
setEditString(text);
}
@@ -107,6 +108,8 @@ void EditTextWidget::startEditMode() {
void EditTextWidget::endEditMode() {
releaseFocus();
+
+ sendCommand(_finishCmd, 0);
}
void EditTextWidget::abortEditMode() {
diff --git a/gui/widgets/edittext.h b/gui/widgets/edittext.h
index a2549882ca..b94e58780c 100644
--- a/gui/widgets/edittext.h
+++ b/gui/widgets/edittext.h
@@ -41,8 +41,8 @@ protected:
int _rightPadding;
public:
- EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip = 0, uint32 cmd = 0);
- EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltp = 0, uint32 cmd = 0);
+ EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip = 0, uint32 cmd = 0, uint32 finishCmd = 0);
+ EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltp = 0, uint32 cmd = 0, uint32 finishCmd = 0);
void setEditString(const String &str);
@@ -62,6 +62,8 @@ protected:
void abortEditMode();
Common::Rect getEditRect() const;
+
+ uint32 _finishCmd;
};
} // End of namespace GUI
diff --git a/gui/widgets/list.cpp b/gui/widgets/list.cpp
index 1e13226d61..1f7846c503 100644
--- a/gui/widgets/list.cpp
+++ b/gui/widgets/list.cpp
@@ -23,7 +23,6 @@
*/
#include "common/system.h"
-#include "common/events.h"
#include "common/frac.h"
#include "common/tokenizer.h"
diff --git a/gui/widgets/popup.cpp b/gui/widgets/popup.cpp
index 02cbd940b2..cab556065f 100644
--- a/gui/widgets/popup.cpp
+++ b/gui/widgets/popup.cpp
@@ -23,11 +23,9 @@
*/
#include "common/system.h"
-#include "common/events.h"
#include "gui/dialog.h"
#include "gui/gui-manager.h"
#include "gui/widgets/popup.h"
-#include "engines/engine.h"
#include "gui/ThemeEval.h"
diff --git a/gui/widgets/scrollbar.cpp b/gui/widgets/scrollbar.cpp
index 5e963e04fe..38383c0e55 100644
--- a/gui/widgets/scrollbar.cpp
+++ b/gui/widgets/scrollbar.cpp
@@ -22,11 +22,12 @@
* $Id$
*/
+#include "common/rect.h"
+#include "common/system.h"
+#include "common/timer.h"
#include "gui/widgets/scrollbar.h"
-#include "gui/dialog.h"
#include "gui/gui-manager.h"
-
-#include "common/timer.h"
+#include "gui/ThemeEngine.h"
namespace GUI {
diff --git a/gui/widgets/tab.cpp b/gui/widgets/tab.cpp
index 10baeac901..721fb88cf8 100644
--- a/gui/widgets/tab.cpp
+++ b/gui/widgets/tab.cpp
@@ -24,7 +24,6 @@
#include "common/util.h"
#include "gui/widgets/tab.h"
-#include "gui/dialog.h"
#include "gui/gui-manager.h"
#include "gui/ThemeEval.h"