Reduce (indirect) dependencies on gui/eval.h (and thus common/assocarray.h) to a minimum
svn-id: r21426
This commit is contained in:
parent
832d795959
commit
08ad918af6
13 changed files with 59 additions and 13 deletions
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
#include "gui/about.h"
|
#include "gui/about.h"
|
||||||
#include "gui/chooser.h"
|
#include "gui/chooser.h"
|
||||||
|
#include "gui/eval.h"
|
||||||
#include "gui/newgui.h"
|
#include "gui/newgui.h"
|
||||||
#include "gui/ListWidget.h"
|
#include "gui/ListWidget.h"
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "gui/ListWidget.h"
|
#include "gui/ListWidget.h"
|
||||||
#include "gui/ScrollBarWidget.h"
|
#include "gui/ScrollBarWidget.h"
|
||||||
#include "gui/dialog.h"
|
#include "gui/dialog.h"
|
||||||
|
#include "gui/eval.h"
|
||||||
#include "gui/newgui.h"
|
#include "gui/newgui.h"
|
||||||
|
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "common/system.h"
|
#include "common/system.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "gui/about.h"
|
#include "gui/about.h"
|
||||||
|
#include "gui/eval.h"
|
||||||
#include "gui/newgui.h"
|
#include "gui/newgui.h"
|
||||||
#include "gui/widget.h"
|
#include "gui/widget.h"
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ Dialog::Dialog(int x, int y, int w, int h)
|
||||||
_drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
|
_drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
Dialog::Dialog(String name)
|
Dialog::Dialog(Common::String name)
|
||||||
: GuiObject(name),
|
: GuiObject(name),
|
||||||
_mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false), _drawingHints(0) {
|
_mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false), _drawingHints(0) {
|
||||||
_drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
|
_drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
|
||||||
|
|
|
@ -37,7 +37,8 @@ static bool isdelim(char c) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Eval::Eval() {
|
Eval::Eval()
|
||||||
|
: _aliases(Common::String::emptyString), _vars(0) {
|
||||||
loadConstants();
|
loadConstants();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#include "gui/about.h"
|
#include "gui/about.h"
|
||||||
#include "gui/browser.h"
|
#include "gui/browser.h"
|
||||||
#include "gui/chooser.h"
|
#include "gui/chooser.h"
|
||||||
|
#include "gui/eval.h"
|
||||||
#include "gui/launcher.h"
|
#include "gui/launcher.h"
|
||||||
#include "gui/message.h"
|
#include "gui/message.h"
|
||||||
#include "gui/newgui.h"
|
#include "gui/newgui.h"
|
||||||
|
|
|
@ -18,6 +18,7 @@ MODULE_OBJS := \
|
||||||
ScrollBarWidget.o \
|
ScrollBarWidget.o \
|
||||||
TabWidget.o \
|
TabWidget.o \
|
||||||
widget.o \
|
widget.o \
|
||||||
|
theme.o \
|
||||||
ThemeClassic.o \
|
ThemeClassic.o \
|
||||||
ThemeNew.o \
|
ThemeNew.o \
|
||||||
theme-config.o
|
theme-config.o
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "gui/newgui.h"
|
#include "gui/newgui.h"
|
||||||
#include "gui/dialog.h"
|
#include "gui/dialog.h"
|
||||||
|
#include "gui/eval.h"
|
||||||
|
|
||||||
#include "common/config-manager.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
|
} // End of namespace GUI
|
||||||
|
|
|
@ -78,9 +78,7 @@ public:
|
||||||
int getStringWidth(const Common::String &str) const { return _theme->getStringWidth(str); }
|
int getStringWidth(const Common::String &str) const { return _theme->getStringWidth(str); }
|
||||||
int getCharWidth(byte c) const { return _theme->getCharWidth(c); }
|
int getCharWidth(byte c) const { return _theme->getCharWidth(c); }
|
||||||
|
|
||||||
WidgetSize getWidgetSize() {
|
WidgetSize getWidgetSize();
|
||||||
return (WidgetSize)(_theme->_evaluator->getVar("widgetSize"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "common/stdafx.h"
|
#include "common/stdafx.h"
|
||||||
#include "gui/browser.h"
|
#include "gui/browser.h"
|
||||||
#include "gui/chooser.h"
|
#include "gui/chooser.h"
|
||||||
|
#include "gui/eval.h"
|
||||||
#include "gui/newgui.h"
|
#include "gui/newgui.h"
|
||||||
#include "gui/options.h"
|
#include "gui/options.h"
|
||||||
#include "gui/PopUpWidget.h"
|
#include "gui/PopUpWidget.h"
|
||||||
|
|
38
gui/theme.cpp
Normal file
38
gui/theme.cpp
Normal file
|
@ -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
|
12
gui/theme.h
12
gui/theme.h
|
@ -32,10 +32,11 @@
|
||||||
#include "graphics/fontman.h"
|
#include "graphics/fontman.h"
|
||||||
|
|
||||||
#include "gui/widget.h"
|
#include "gui/widget.h"
|
||||||
#include "gui/eval.h"
|
|
||||||
|
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
|
||||||
|
class Eval;
|
||||||
|
|
||||||
// Hints to the theme engine that the widget is used in a non-standard way.
|
// Hints to the theme engine that the widget is used in a non-standard way.
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -61,14 +62,9 @@ enum {
|
||||||
class Theme {
|
class Theme {
|
||||||
typedef Common::String String;
|
typedef Common::String String;
|
||||||
public:
|
public:
|
||||||
Theme() : _drawArea(), _configFile(), _loadedThemeX(0), _loadedThemeY(0) {
|
Theme();
|
||||||
Common::MemoryReadStream s((const byte *)_defaultConfigINI, strlen(_defaultConfigINI));
|
|
||||||
_defaultConfig.loadFromStream(s);
|
|
||||||
|
|
||||||
_evaluator = new Eval();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual ~Theme() { delete _evaluator;}
|
virtual ~Theme();
|
||||||
|
|
||||||
enum kTextAlign {
|
enum kTextAlign {
|
||||||
kTextAlignLeft,
|
kTextAlignLeft,
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "graphics/fontman.h"
|
#include "graphics/fontman.h"
|
||||||
#include "gui/widget.h"
|
#include "gui/widget.h"
|
||||||
#include "gui/dialog.h"
|
#include "gui/dialog.h"
|
||||||
|
#include "gui/eval.h"
|
||||||
#include "gui/newgui.h"
|
#include "gui/newgui.h"
|
||||||
|
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue