aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2006-03-24 14:15:45 +0000
committerMax Horn2006-03-24 14:15:45 +0000
commit08ad918af6f5e35d959177b82236965a3048eab9 (patch)
tree4e00326aef54988f12955464d117eceaf31c044f
parent832d795959351acd976605a89817769b5b534998 (diff)
downloadscummvm-rg350-08ad918af6f5e35d959177b82236965a3048eab9.tar.gz
scummvm-rg350-08ad918af6f5e35d959177b82236965a3048eab9.tar.bz2
scummvm-rg350-08ad918af6f5e35d959177b82236965a3048eab9.zip
Reduce (indirect) dependencies on gui/eval.h (and thus common/assocarray.h) to a minimum
svn-id: r21426
-rw-r--r--engines/scumm/dialogs.cpp1
-rw-r--r--gui/ListWidget.cpp1
-rw-r--r--gui/about.cpp1
-rw-r--r--gui/dialog.cpp2
-rw-r--r--gui/eval.cpp3
-rw-r--r--gui/launcher.cpp1
-rw-r--r--gui/module.mk1
-rw-r--r--gui/newgui.cpp6
-rw-r--r--gui/newgui.h4
-rw-r--r--gui/options.cpp1
-rw-r--r--gui/theme.cpp38
-rw-r--r--gui/theme.h12
-rw-r--r--gui/widget.cpp1
13 files changed, 59 insertions, 13 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 09f383cec3..d29b56fa9e 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -29,6 +29,7 @@
#include "gui/about.h"
#include "gui/chooser.h"
+#include "gui/eval.h"
#include "gui/newgui.h"
#include "gui/ListWidget.h"
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index 1eb0c45864..04c9e8d049 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -24,6 +24,7 @@
#include "gui/ListWidget.h"
#include "gui/ScrollBarWidget.h"
#include "gui/dialog.h"
+#include "gui/eval.h"
#include "gui/newgui.h"
namespace GUI {
diff --git a/gui/about.cpp b/gui/about.cpp
index 83eb4fd652..2e7113ced4 100644
--- a/gui/about.cpp
+++ b/gui/about.cpp
@@ -25,6 +25,7 @@
#include "common/system.h"
#include "common/util.h"
#include "gui/about.h"
+#include "gui/eval.h"
#include "gui/newgui.h"
#include "gui/widget.h"
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index 46943a1aad..6514442c37 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -45,7 +45,7 @@ Dialog::Dialog(int x, int y, int w, int h)
_drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
}
-Dialog::Dialog(String name)
+Dialog::Dialog(Common::String name)
: GuiObject(name),
_mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false), _drawingHints(0) {
_drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
diff --git a/gui/eval.cpp b/gui/eval.cpp
index 5dcfdfe124..a2cea2b914 100644
--- a/gui/eval.cpp
+++ b/gui/eval.cpp
@@ -37,7 +37,8 @@ static bool isdelim(char c) {
return false;
}
-Eval::Eval() {
+Eval::Eval()
+ : _aliases(Common::String::emptyString), _vars(0) {
loadConstants();
}
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 201c1d9bce..88ec899adf 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -35,6 +35,7 @@
#include "gui/about.h"
#include "gui/browser.h"
#include "gui/chooser.h"
+#include "gui/eval.h"
#include "gui/launcher.h"
#include "gui/message.h"
#include "gui/newgui.h"
diff --git a/gui/module.mk b/gui/module.mk
index ebb5de18c4..b0cb408505 100644
--- a/gui/module.mk
+++ b/gui/module.mk
@@ -18,6 +18,7 @@ MODULE_OBJS := \
ScrollBarWidget.o \
TabWidget.o \
widget.o \
+ theme.o \
ThemeClassic.o \
ThemeNew.o \
theme-config.o
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index d1000a20d5..f3ba58bab7 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -24,6 +24,7 @@
#include "common/util.h"
#include "gui/newgui.h"
#include "gui/dialog.h"
+#include "gui/eval.h"
#include "common/config-manager.h"
@@ -309,4 +310,9 @@ void NewGui::animateCursor() {
}
}
+WidgetSize NewGui::getWidgetSize() {
+ return (WidgetSize)(_theme->_evaluator->getVar("widgetSize"));
+}
+
+
} // End of namespace GUI
diff --git a/gui/newgui.h b/gui/newgui.h
index 21719041ce..8b8babe27c 100644
--- a/gui/newgui.h
+++ b/gui/newgui.h
@@ -78,9 +78,7 @@ public:
int getStringWidth(const Common::String &str) const { return _theme->getStringWidth(str); }
int getCharWidth(byte c) const { return _theme->getCharWidth(c); }
- WidgetSize getWidgetSize() {
- return (WidgetSize)(_theme->_evaluator->getVar("widgetSize"));
- }
+ WidgetSize getWidgetSize();
protected:
diff --git a/gui/options.cpp b/gui/options.cpp
index 67add1a27f..504281e5f7 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -22,6 +22,7 @@
#include "common/stdafx.h"
#include "gui/browser.h"
#include "gui/chooser.h"
+#include "gui/eval.h"
#include "gui/newgui.h"
#include "gui/options.h"
#include "gui/PopUpWidget.h"
diff --git a/gui/theme.cpp b/gui/theme.cpp
new file mode 100644
index 0000000000..0c35293d2f
--- /dev/null
+++ b/gui/theme.cpp
@@ -0,0 +1,38 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2006 The ScummVM project
+ *
+ * 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: theme.h 21268 2006-03-14 02:19:38Z sev $
+ */
+
+#include "gui/theme.h"
+#include "gui/eval.h"
+
+namespace GUI {
+
+Theme::Theme() : _drawArea(), _configFile(), _loadedThemeX(0), _loadedThemeY(0) {
+ Common::MemoryReadStream s((const byte *)_defaultConfigINI, strlen(_defaultConfigINI));
+ _defaultConfig.loadFromStream(s);
+
+ _evaluator = new Eval();
+}
+
+Theme::~Theme() {
+ delete _evaluator;
+}
+
+} // End of namespace GUI
diff --git a/gui/theme.h b/gui/theme.h
index 287f07019c..253a476ade 100644
--- a/gui/theme.h
+++ b/gui/theme.h
@@ -32,10 +32,11 @@
#include "graphics/fontman.h"
#include "gui/widget.h"
-#include "gui/eval.h"
namespace GUI {
+class Eval;
+
// Hints to the theme engine that the widget is used in a non-standard way.
enum {
@@ -61,14 +62,9 @@ enum {
class Theme {
typedef Common::String String;
public:
- Theme() : _drawArea(), _configFile(), _loadedThemeX(0), _loadedThemeY(0) {
- Common::MemoryReadStream s((const byte *)_defaultConfigINI, strlen(_defaultConfigINI));
- _defaultConfig.loadFromStream(s);
-
- _evaluator = new Eval();
- }
+ Theme();
- virtual ~Theme() { delete _evaluator;}
+ virtual ~Theme();
enum kTextAlign {
kTextAlignLeft,
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 51fbec3456..a48b87d398 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -24,6 +24,7 @@
#include "graphics/fontman.h"
#include "gui/widget.h"
#include "gui/dialog.h"
+#include "gui/eval.h"
#include "gui/newgui.h"
namespace GUI {