aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2007-10-28 12:04:38 +0000
committerEugene Sandulenko2007-10-28 12:04:38 +0000
commit61c96353cf0cc5b418ad64af2c607309221409d4 (patch)
treef469afa1d819b20ef6fbb66157e146f5f867901b
parent4073e7f8f8b3a9af6e302c062362c5004ba8bcba (diff)
downloadscummvm-rg350-61c96353cf0cc5b418ad64af2c607309221409d4.tar.gz
scummvm-rg350-61c96353cf0cc5b418ad64af2c607309221409d4.tar.bz2
scummvm-rg350-61c96353cf0cc5b418ad64af2c607309221409d4.zip
Patch v5.2 from #1752243: "backends lib patches"
svn-id: r29283
-rw-r--r--common/system.h11
-rw-r--r--gui/ThemeClassic.cpp2
-rw-r--r--gui/ThemeModern.cpp2
-rw-r--r--gui/theme-config.cpp11
-rw-r--r--gui/theme.h2
5 files changed, 25 insertions, 3 deletions
diff --git a/common/system.h b/common/system.h
index 600b2ed76e..f19f6efc2c 100644
--- a/common/system.h
+++ b/common/system.h
@@ -886,6 +886,17 @@ public:
*/
virtual Common::SaveFileManager *getSavefileManager() = 0;
+
+ /**
+ * Return String which is used for backend-specific addition to theme
+ * config.
+ *
+ * Typical usage is to disable unneeded GUI widgets or defining
+ * theme-specific tab.
+ */
+ virtual Common::String getExtraThemeConfig() {
+ return "";
+ }
//@}
};
diff --git a/gui/ThemeClassic.cpp b/gui/ThemeClassic.cpp
index c46965c191..558acafb24 100644
--- a/gui/ThemeClassic.cpp
+++ b/gui/ThemeClassic.cpp
@@ -70,7 +70,7 @@ bool ThemeClassic::init() {
if (isThemeLoadingRequired()) {
loadTheme(_defaultConfig);
- loadTheme(_configFile, false);
+ loadTheme(_configFile, false, true);
setupConfig();
}
diff --git a/gui/ThemeModern.cpp b/gui/ThemeModern.cpp
index a5b6e682cb..cdafd587ca 100644
--- a/gui/ThemeModern.cpp
+++ b/gui/ThemeModern.cpp
@@ -135,7 +135,7 @@ bool ThemeModern::init() {
if (isThemeLoadingRequired()) {
loadTheme(_defaultConfig);
- loadTheme(_configFile, false); // Don't reset
+ loadTheme(_configFile, false, true); // Don't reset
processExtraValues();
}
diff --git a/gui/theme-config.cpp b/gui/theme-config.cpp
index 8da2be99e1..0428e60027 100644
--- a/gui/theme-config.cpp
+++ b/gui/theme-config.cpp
@@ -765,5 +765,16 @@ void Theme::loadTheme(Common::ConfigFile &config, bool reset) {
debug(3, "Number of variables: %d", _evaluator->getNumVars());
}
+void Theme::loadTheme(Common::ConfigFile &config, bool reset, bool doBackendSpecificPostProcessing) {
+ loadTheme(config, reset);
+
+ if (doBackendSpecificPostProcessing && !g_system->getExtraThemeConfig().empty()) {
+ Common::ConfigFile myConfig;
+ Common::String myConfigINI = g_system->getExtraThemeConfig();
+ Common::MemoryReadStream s((const byte *)myConfigINI.c_str(), strlen(myConfigINI.c_str()));
+ myConfig.loadFromStream(s);
+ loadTheme(myConfig, false);
+ }
+}
} // End of namespace GUI
diff --git a/gui/theme.h b/gui/theme.h
index 8fd560603c..b5b8d037f0 100644
--- a/gui/theme.h
+++ b/gui/theme.h
@@ -210,7 +210,7 @@ public:
bool isThemeLoadingRequired();
bool sectionIsSkipped(Common::ConfigFile &config, const char *name, int w, int h);
void loadTheme(Common::ConfigFile &config, bool reset = true);
-
+ void loadTheme(Common::ConfigFile &config, bool reset, bool doBackendSpecificPostProcessing);
Eval *_evaluator;
static bool themeConfigUseable(const Common::String &file, const Common::String &style="", Common::String *cStyle=0, Common::ConfigFile *cfg=0);