[Scummvm-cvs-logs] SF.net SVN: scummvm:[33704] scummvm/branches/gsoc2008-gui

Tanoku at users.sourceforge.net Tanoku at users.sourceforge.net
Fri Aug 8 20:30:19 CEST 2008


Revision: 33704
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33704&view=rev
Author:   Tanoku
Date:     2008-08-08 18:30:16 +0000 (Fri, 08 Aug 2008)

Log Message:
-----------
Resolution-dependence in XML files.
G1X scaler GUI now loads. Added layout for the launcher menu.
MILESTONE: All core GUI dialogs/widgets working on G2x/G3x
MILESTONE: Completely removed old Evaluator/Parser.
Improved layout expanding again.
Improved XML parser.
Several bugfixes.

Modified Paths:
--------------
    scummvm/branches/gsoc2008-gui/common/xmlparser.cpp
    scummvm/branches/gsoc2008-gui/common/xmlparser.h
    scummvm/branches/gsoc2008-gui/gui/ThemeEval.cpp
    scummvm/branches/gsoc2008-gui/gui/ThemeEval.h
    scummvm/branches/gsoc2008-gui/gui/ThemeParser.cpp
    scummvm/branches/gsoc2008-gui/gui/ThemeParser.h
    scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp
    scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.h
    scummvm/branches/gsoc2008-gui/gui/console.cpp
    scummvm/branches/gsoc2008-gui/gui/launcher.cpp
    scummvm/branches/gsoc2008-gui/gui/newgui.cpp
    scummvm/branches/gsoc2008-gui/gui/options.cpp
    scummvm/branches/gsoc2008-gui/gui/themes/default.inc
    scummvm/branches/gsoc2008-gui/gui/themes/modern.stx
    scummvm/branches/gsoc2008-gui/gui/widget.cpp

Modified: scummvm/branches/gsoc2008-gui/common/xmlparser.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/common/xmlparser.cpp	2008-08-08 18:28:13 UTC (rev 33703)
+++ scummvm/branches/gsoc2008-gui/common/xmlparser.cpp	2008-08-08 18:30:16 UTC (rev 33704)
@@ -110,9 +110,10 @@
 				return parserError("Missing required property '%s' inside key '%s'", i->name.c_str(), key->name.c_str());
 		}
 	
-		if (key->layout->anyProps == false && localMap.empty() == false)
+		if (localMap.empty() == false)
 			return parserError("Unhandled property inside key '%s': '%s'", key->name.c_str(), localMap.begin()->_key.c_str());
-	} else if (layout->anyKeys == false) {
+			
+	} else {
 		return parserError("Unexpected key in the active scope: '%s'.", key->name.c_str());
 	}
 

Modified: scummvm/branches/gsoc2008-gui/common/xmlparser.h
===================================================================
--- scummvm/branches/gsoc2008-gui/common/xmlparser.h	2008-08-08 18:28:13 UTC (rev 33703)
+++ scummvm/branches/gsoc2008-gui/common/xmlparser.h	2008-08-08 18:30:16 UTC (rev 33704)
@@ -182,12 +182,12 @@
 	
 #define XML_KEY(keyName) {\
 		lay = new XMLKeyLayout; \
-		lay->anyProps = false; \
-		lay->anyKeys = false; \
 		lay->custom = new kLocalParserName::CustomParserCallback; \
 		((kLocalParserName::CustomParserCallback*)(lay->custom))->callback = (&kLocalParserName::parserCallback_##keyName); \
 		layout.top()->children[#keyName] = lay; \
-		layout.push(lay);
+		layout.push(lay); \
+		for (Common::List<XMLKeyLayout::XMLKeyProperty>::const_iterator p = globalProps.begin(); p != globalProps.end(); ++p){\
+			layout.top()->properties.push_back(*p);}
 		
 #define XML_KEY_RECURSIVE(keyName) {\
 			layout.top()->children[#keyName] = layout.top();\
@@ -199,13 +199,13 @@
 #define XML_PROP(propName, req) {\
 		prop.name = #propName; \
 		prop.required = req; \
-		layout.top()->properties.push_back(prop); }\
+		layout.top()->properties.push_back(prop); }
 		
-#define XML_PROP_ANY() {\
-		layout.top()->anyProps = true; }
-
-#define XML_KEY_ANY() {\
-		layout.top()->anyKeys = true; }
+#define XML_GLOBAL_PROP(propName, req) {\
+		prop.name = #propName; \
+		prop.required = req;\
+		globalProps.push_back(prop); }
+		
 	
 #define CUSTOM_XML_PARSER(parserName) \
 	protected: \
@@ -217,9 +217,8 @@
 		Common::Stack<XMLKeyLayout*> layout; \
 		XMLKeyLayout *lay = 0; \
 		XMLKeyLayout::XMLKeyProperty prop; \
+		Common::List<XMLKeyLayout::XMLKeyProperty> globalProps; \
 		_XMLkeys = new XMLKeyLayout; \
-		_XMLkeys->anyProps = false; \
-		_XMLkeys->anyKeys = false; \
 		layout.push(_XMLkeys);
 	
 #define PARSER_END() layout.clear(); }
@@ -310,14 +309,11 @@
 		};
 		
 		Common::List<XMLKeyProperty> properties;
-		bool anyProps;
-		bool anyKeys;
 		ChildMap children;
 		
 		~XMLKeyLayout() {
 			properties.clear();
 			children.clear();
-//			delete custom;
 		}
 	} *_XMLkeys;
 

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeEval.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeEval.cpp	2008-08-08 18:28:13 UTC (rev 33703)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeEval.cpp	2008-08-08 18:30:16 UTC (rev 33704)
@@ -196,7 +196,10 @@
 	_builtin["kBigButtonHeight"] = GUI::kBigButtonHeight;
 	_builtin["kBigSliderWidth"] = GUI::kBigSliderWidth;
 	_builtin["kBigSliderWidth"] = GUI::kBigSliderWidth;
-	_builtin["kBigSliderHeight"] = GUI::kBigSliderHeight;	
+	_builtin["kBigSliderHeight"] = GUI::kBigSliderHeight;
+	
+	_builtin["kNormalWidgetSize"] = GUI::kNormalWidgetSize;
+	_builtin["kBigWidgetSize"] = GUI::kBigWidgetSize;
 }
 
 

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeEval.h
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeEval.h	2008-08-08 18:28:13 UTC (rev 33703)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeEval.h	2008-08-08 18:30:16 UTC (rev 33704)
@@ -375,7 +375,7 @@
 	}
 
 	void debugDraw(Graphics::Surface *screen, const Graphics::Font *font) {
-		_layouts["Dialog.Browser"]->debugDraw(screen, font);
+		_layouts["Dialog.Launcher"]->debugDraw(screen, font);
 //		_layouts["Dialog.GameOptions_Graphics"]->debugDraw(screen, font);
 	}
 	

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeParser.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeParser.cpp	2008-08-08 18:28:13 UTC (rev 33703)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeParser.cpp	2008-08-08 18:30:16 UTC (rev 33704)
@@ -129,6 +129,11 @@
 
 bool ThemeParser::parserCallback_font(ParserNode *node) {		
 	int red, green, blue;
+	
+	if (resolutionCheck(node->values["resolution"])) {
+		node->ignore = true;
+		return true;
+	}
 
 	if (_palette.contains(node->values["color"]))
 		getPaletteColor(node->values["color"], red, green, blue);
@@ -226,6 +231,11 @@
 
 bool ThemeParser::parserCallback_drawdata(ParserNode *node) {
 	bool cached = false;
+	
+	if (resolutionCheck(node->values["resolution"])) {
+		node->ignore = true;
+		return true;
+	}
 
 	if (node->values.contains("cache")) {
 		if (node->values["cache"] == "true") 
@@ -235,16 +245,6 @@
 		else return parserError("'Parsed' value must be either true or false.");
 	}
 
-	// Both Max and Johannes suggest using a non-platform specfic approach based on available
-	// resources and active resolution. getHostPlatformString() has been removed, so fix this.
-
-/*	if (drawdataNode->values.contains("platform")) {
-		if (drawdataNode->values["platform"].compareToIgnoreCase(Common::getHostPlatformString()) != 0) {
-			drawdataNode->ignore = true;
-			return true;
-		}
-	}*/
-
 	if (_theme->addDrawData(node->values["id"], cached) == false)
 		return parserError("Error when adding Draw Data set: Invalid DrawData name.");
 
@@ -437,10 +437,18 @@
 }
 
 bool ThemeParser::parserCallback_def(ParserNode *node) {
+	if (resolutionCheck(node->values["resolution"])) {
+		node->ignore = true;
+		return true;
+	}
+	
 	Common::String var = "Globals." + node->values["var"];
 	int value;
 	
-	if (!parseIntegerKey(node->values["value"].c_str(), 1, &value))
+	if (_theme->themeEval()->hasVar(node->values["value"]) == true)
+		value = _theme->themeEval()->getVar(node->values["value"]);
+	
+	else if (!parseIntegerKey(node->values["value"].c_str(), 1, &value))
 		return parserError("Invalid definition for '%s'.", var.c_str());
 		
 	_theme->themeEval()->setVar(var, value);
@@ -451,9 +459,16 @@
 	Common::String var;
 	
 	if (getParentNode(node)->name == "globals") {
+		
+		if (resolutionCheck(node->values["resolution"])) {
+			node->ignore = true;
+			return true;
+		}
+		
 		var = "Globals." + node->values["name"] + ".";
 		if (!parseCommonLayoutProps(node, var))
 			return parserError("Error when parsing Layout properties of '%s'.", var.c_str());
+
 	} else {
 		var = node->values["name"];
 		int width = -1;
@@ -502,6 +517,11 @@
 	Common::String var = "Dialog." + node->values["name"];
 	bool enabled = true;
 	
+	if (resolutionCheck(node->values["resolution"])) {
+		node->ignore = true;
+		return true;
+	}
+	
 	if (node->values.contains("enabled")) {
 		if (node->values["enabled"] == "false")
 			enabled = false;
@@ -703,4 +723,16 @@
 	return true;
 }
 
+bool ThemeParser::resolutionCheck(const Common::String &resolution) {
+	if (resolution.empty())
+		return false;
+		
+	Common::StringTokenizer tokenizer(resolution, "x");
+	Common::String w = tokenizer.nextToken();
+	Common::String h = tokenizer.nextToken();
+	
+	return  ((w == "X" || atoi(w.c_str()) == g_system->getOverlayWidth()) && 
+			(h == "Y" || atoi(h.c_str()) == g_system->getOverlayHeight())) == false;
 }
+
+}

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeParser.h
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeParser.h	2008-08-08 18:28:13 UTC (rev 33703)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeParser.h	2008-08-08 18:30:16 UTC (rev 33704)
@@ -331,7 +331,6 @@
 	ThemeRenderer *_theme;
 	
 	CUSTOM_XML_PARSER(ThemeParser) {
-		
 		XML_KEY(render_info)
 			XML_KEY(palette)
 				XML_KEY(color)
@@ -345,6 +344,7 @@
 					XML_PROP(id, true)
 					XML_PROP(file, true)
 					XML_PROP(color, true)
+					XML_PROP(resolution, false)
 				KEY_END()
 			KEY_END()
 
@@ -365,6 +365,7 @@
 			XML_KEY(drawdata)
 				XML_PROP(id, true)
 				XML_PROP(cache, false)
+				XML_PROP(resolution, false)
 
 				XML_KEY(defaults)
 					XML_PROP(stroke, false)
@@ -417,6 +418,7 @@
 				XML_KEY(def)
 					XML_PROP(var, true)
 					XML_PROP(value, true)
+					XML_PROP(resolution, false)
 				KEY_END()
 				
 				XML_KEY(widget)
@@ -424,6 +426,7 @@
 					XML_PROP(size, false)
 					XML_PROP(pos, false)
 					XML_PROP(padding, false)
+					XML_PROP(resolution, false)
 					
 					XML_KEY(child)
 						XML_PROP(name, true)
@@ -438,6 +441,7 @@
 				XML_PROP(overlays, true)
 				XML_PROP(shading, false)
 				XML_PROP(enabled, false)
+				XML_PROP(resolution, false)
 				XML_KEY(layout)
 					XML_PROP(type, true)
 					XML_PROP(center, false)
@@ -492,6 +496,8 @@
 	
 	bool closedKeyCallback(ParserNode *node);
 	
+	bool resolutionCheck(const Common::String &resolution);
+	
 	void cleanup();
 
 	Graphics::DrawStep *newDrawStep();

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp	2008-08-08 18:28:13 UTC (rev 33703)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp	2008-08-08 18:30:16 UTC (rev 33704)
@@ -113,8 +113,6 @@
 	_graphicsMode = mode;
 	setGraphicsMode(_graphicsMode);
 
-	loadConfigFile("modern");
-
 	if (_screen->w >= 400 && _screen->h >= 300) {
 		_font = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
 	} else {
@@ -138,9 +136,6 @@
 
 	if (isThemeLoadingRequired() || !_themeOk) {
 		loadTheme(_themeName);
-
-		Theme::loadTheme(_defaultConfig);
-		Theme::loadTheme(_configFile, false, true);
 	}
 
 	return true;
@@ -240,12 +235,10 @@
 		return false;
 		
 	if (_texts[textId] != 0)
-		return false;
+		delete _texts[textId];
 		
 	_texts[textId] = new TextDrawData;
 	
-//	_texts[textId]->_fontPtr = _font;
-	
 	if (file == "default") {
 		_texts[textId]->_fontPtr = _font;
 	} else {
@@ -271,8 +264,11 @@
 bool ThemeRenderer::addDrawData(const Common::String &data, bool cached) {
 	DrawData data_id = getDrawDataId(data);
 
-	if (data_id == -1 || _widgets[data_id] != 0)
+	if (data_id == -1)
 		return false;
+		
+	if (_widgets[data_id] != 0)
+		delete _widgets[data_id];
 
 	_widgets[data_id] = new WidgetDrawData;
 	_widgets[data_id]->_cached = cached;
@@ -684,6 +680,15 @@
 	}
 }
 
+void ThemeRenderer::drawChar(const Common::Rect &r, byte ch, const Graphics::Font *font, WidgetStateInfo state) {
+	if (!ready())
+		return;
+		
+	restoreBackground(r);
+	font->drawChar(_screen, ch, r.left, r.top, 0);
+	addDirtyRect(r);
+}
+
 void ThemeRenderer::debugWidgetPosition(const char *name, const Common::Rect &r) {
 	_font->drawString(_screen, name, r.left, r.top, r.width(), 0xFFFF, Graphics::kTextAlignRight, 0, true);
 	_screen->hLine(r.left, r.top, r.right, 0xFFFF);

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.h
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.h	2008-08-08 18:28:13 UTC (rev 33703)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.h	2008-08-08 18:30:16 UTC (rev 33704)
@@ -330,7 +330,7 @@
 		WidgetStateInfo state, TextAlign align, bool inverted, int deltax, bool useEllipsis, FontStyle font);
 	
 	void drawChar(const Common::Rect &r, byte ch, 
-		const Graphics::Font *font, WidgetStateInfo state) {}
+		const Graphics::Font *font, WidgetStateInfo state);
 	
 	/**
 	 *	Actual implementation of a Dirty Rect drawing routine.
@@ -435,6 +435,7 @@
 	}
 	
 	void *evaluator() { return _themeEval; }
+	bool supportsImages() const { return true; }
 
 protected:
 	

Modified: scummvm/branches/gsoc2008-gui/gui/console.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/console.cpp	2008-08-08 18:28:13 UTC (rev 33703)
+++ scummvm/branches/gsoc2008-gui/gui/console.cpp	2008-08-08 18:30:16 UTC (rev 33704)
@@ -25,6 +25,7 @@
 #include "gui/console.h"
 #include "gui/ScrollBarWidget.h"
 #include "gui/eval.h"
+#include "gui/ThemeEval.h"
 
 #include "engines/engine.h"
 #include "base/version.h"
@@ -97,17 +98,14 @@
 void ConsoleDialog::init() {
 	const int screenW = g_system->getOverlayWidth();
 	const int screenH = g_system->getOverlayHeight();
-	int f = g_gui.evaluator()->getVar("Console.font");
 
-	if (f == EVAL_UNDEF_VAR)
-		_font = FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont);
-	else
-		_font = g_gui.theme()->getFont((Theme::FontStyle)f);
+	_font = FontMan.getFontByUsage((Graphics::FontManager::FontUsage)
+		g_gui.xmlEval()->getVar("Console.Font", Graphics::FontManager::kConsoleFont));
 
-	_leftPadding = g_gui.evaluator()->getVar("Console.leftPadding", 0);
-	_rightPadding = g_gui.evaluator()->getVar("Console.rightPadding", 0);
-	_topPadding = g_gui.evaluator()->getVar("Console.topPadding", 0);
-	_bottomPadding = g_gui.evaluator()->getVar("Console.bottomPadding", 0);
+	_leftPadding = g_gui.xmlEval()->getVar("Globals.Console.Padding.Left", 0);
+	_rightPadding = g_gui.xmlEval()->getVar("Globals.Console.Padding.Right", 0);
+	_topPadding = g_gui.xmlEval()->getVar("Globals.Console.Padding.Top", 0);
+	_bottomPadding = g_gui.xmlEval()->getVar("Globals.Console.Padding.Bottom", 0);
 
 	// Calculate the real width/height (rounded to char/line multiples)
 	_w = (uint16)(_widthPercent * screenW);

Modified: scummvm/branches/gsoc2008-gui/gui/launcher.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/launcher.cpp	2008-08-08 18:28:13 UTC (rev 33703)
+++ scummvm/branches/gsoc2008-gui/gui/launcher.cpp	2008-08-08 18:30:16 UTC (rev 33704)
@@ -48,6 +48,7 @@
 
 #include "sound/mididrv.h"
 
+#include "gui/ThemeEval.h"
 
 
 using Common::ConfigManager;
@@ -145,7 +146,7 @@
 EditGameDialog::EditGameDialog(const String &domain, const String &desc)
 	: OptionsDialog(domain, "GameOptions") {
 
-	int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");
+	int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth");
 
 	// GAME: Path to game data (r/o), extra data (r/o), and save data (r/w)
 	String gamePath(ConfMan.get("path", _domain));
@@ -267,7 +268,7 @@
 void EditGameDialog::reflowLayout() {
 	OptionsDialog::reflowLayout();
 
-	int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");
+	int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth");
 
 	if (_langPopUp)
 		_langPopUp->changeLabelWidth(labelWidth);
@@ -480,7 +481,7 @@
 
 #ifndef DISABLE_FANCY_THEMES
 	_logo = 0;
-	if (g_gui.evaluator()->getVar("launcher_logo.visible") == 1 && g_gui.theme()->supportsImages()) {
+	if (g_gui.xmlEval()->getVar("Globals.ShowLauncherLogo") == 1 && g_gui.theme()->supportsImages()) {
 		_logo = new GraphicsWidget(this, "Launcher.Logo");
 		_logo->useThemeTransparency(true);
 		_logo->setGfx(g_gui.theme()->getImageSurface(Theme::kImageLogo));
@@ -878,21 +879,21 @@
 
 void LauncherDialog::reflowLayout() {
 #ifndef DISABLE_FANCY_THEMES
-	if (g_gui.evaluator()->getVar("launcher_logo.visible") == 1 && g_gui.theme()->supportsImages()) {
-		StaticTextWidget *ver = (StaticTextWidget*)findWidget("launcher_version");
+	if (g_gui.xmlEval()->getVar("Globals.ShowLauncherLogo") == 1 && g_gui.theme()->supportsImages()) {
+		StaticTextWidget *ver = (StaticTextWidget*)findWidget("lLauncher.Version");
 		if (ver) {
-			ver->setAlign((Graphics::TextAlignment)g_gui.evaluator()->getVar("launcher_version.align"));
+			ver->setAlign((Graphics::TextAlignment)g_gui.xmlEval()->getVar("Launcher.Version.Align", Graphics::kTextAlignCenter));
 			ver->setLabel(gScummVMVersionDate);
 		}
 
 		if (!_logo)
-			_logo = new GraphicsWidget(this, "launcher_logo");
+			_logo = new GraphicsWidget(this, "Launcher.Logo");
 		_logo->useThemeTransparency(true);
 		_logo->setGfx(g_gui.theme()->getImageSurface(Theme::kImageLogo));
 	} else {
-		StaticTextWidget *ver = (StaticTextWidget*)findWidget("launcher_version");
+		StaticTextWidget *ver = (StaticTextWidget*)findWidget("Launcher.Version");
 		if (ver) {
-			ver->setAlign((Graphics::TextAlignment)g_gui.evaluator()->getVar("launcher_version.align"));
+			ver->setAlign((Graphics::TextAlignment)g_gui.xmlEval()->getVar("Launcher.Version.Align", Graphics::kTextAlignCenter));
 			ver->setLabel(gScummVMFullVersion);
 		}
 

Modified: scummvm/branches/gsoc2008-gui/gui/newgui.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/newgui.cpp	2008-08-08 18:28:13 UTC (rev 33703)
+++ scummvm/branches/gsoc2008-gui/gui/newgui.cpp	2008-08-08 18:30:16 UTC (rev 33704)
@@ -61,6 +61,8 @@
 		if (!g_gui.xmlEval()->getWidgetData(_name, _x, _y, _w, _h)) {
 			warning("Could not load widget position for '%s'", _name.c_str());
 		}
+		
+		return;
 
 		if (_x < 0)
 			error("Widget <%s> has x < 0: %d", _name.c_str(), _x);
@@ -442,7 +444,7 @@
 }
 
 WidgetSize NewGui::getWidgetSize() {
-	return (WidgetSize)(_theme->_evaluator->getVar("widgetSize"));
+	return (WidgetSize)(g_gui.xmlEval()->getVar("Globals.WidgetSize"));
 }
 
 void NewGui::clearDragWidget() {

Modified: scummvm/branches/gsoc2008-gui/gui/options.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/options.cpp	2008-08-08 18:28:13 UTC (rev 33703)
+++ scummvm/branches/gsoc2008-gui/gui/options.cpp	2008-08-08 18:30:16 UTC (rev 33704)
@@ -28,6 +28,7 @@
 #include "gui/eval.h"
 #include "gui/message.h"
 #include "gui/newgui.h"
+#include "gui/ThemeEval.h"
 #include "gui/options.h"
 #include "gui/PopUpWidget.h"
 #include "gui/TabWidget.h"
@@ -500,7 +501,7 @@
 void OptionsDialog::addGraphicControls(GuiObject *boss, const String &prefix) {
 	const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes();
 
-	int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");
+	int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth");
 
 	// The GFX mode popup
 	_gfxPopUp = new PopUpWidget(boss, prefix + "grModePopup", "Graphics mode:", labelWidth);
@@ -537,7 +538,7 @@
 }
 
 void OptionsDialog::addAudioControls(GuiObject *boss, const String &prefix) {
-	int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");
+	int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth");
 
 	// The MIDI mode popup & a label
 	_midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup", "Music driver:", labelWidth);
@@ -643,7 +644,7 @@
 void OptionsDialog::reflowLayout() {
 	Dialog::reflowLayout();
 
-	int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");
+	int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth");
 
 	if (_midiPopUp)
 		_midiPopUp->changeLabelWidth(labelWidth);
@@ -723,7 +724,7 @@
 	new ButtonWidget(tab, "GlobalOptions_Misc.ThemeButton", "Theme:", kChooseThemeCmd, 0);
 	_curTheme = new StaticTextWidget(tab, "GlobalOptions_Misc.CurTheme", g_gui.theme()->getThemeName());
 
-	int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");
+	int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth");
 
 	_autosavePeriodPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.AutosavePeriod", "Autosave:", labelWidth);
 

Modified: scummvm/branches/gsoc2008-gui/gui/themes/default.inc
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/themes/default.inc	2008-08-08 18:28:13 UTC (rev 33703)
+++ scummvm/branches/gsoc2008-gui/gui/themes/default.inc	2008-08-08 18:30:16 UTC (rev 33704)
@@ -397,6 +397,9 @@
 "<def var = 'Widget.Size' value = '32' /> "
 "<def var = 'Line.Height' value = '16' /> "
 "<def var = 'Font.Height' value = '16' /> "
+"<def var = 'TabLabelWidth' value = '110' /> "
+"<def var = 'WidgetSize' value = 'kBigWidgetSize' /> "
+"<def resolution = '320xY' var = 'WidgetSize' value = 'kNormalWidgetSize' /> "
 "<def var = 'Padding.Bottom' value = '16' /> "
 "<def var = 'Padding.Left' value = '16' /> "
 "<def var = 'Padding.Right' value = '16' /> "
@@ -404,6 +407,8 @@
 "<def var = 'ListWidget.hlLeftPadding' value = '0'/> "
 "<def var = 'ListWidget.hlRightPadding' value = '16'/> "
 "<def var = 'PopUpWidget.labelSpacing' value = '10' /> "
+"<def var = 'ShowLauncherLogo' value = '1'/> "
+"<def resolution = '320xY' var = 'ShowLauncherLogo' value = '0'/> "
 "<widget name = 'OptionsLabel' "
 "size = '110, Globals.Line.Height' "
 "/> "
@@ -411,8 +416,12 @@
 "size = '24, Globals.Line.Height' "
 "/> "
 "<widget name = 'Button' "
-"size = '108, 24' "
+"size = 'kBigButtonWidth, kBigButtonHeight' "
 "/> "
+"<widget resolution = '320xY' "
+"name = 'Button' "
+"size = 'kButtonWidth, kButtonHeight' "
+"/> "
 "<widget name = 'Slider' "
 "size = '128, 18' "
 "/> "
@@ -487,6 +496,42 @@
 "</layout> "
 "</layout> "
 "</dialog> "
+"<dialog resolution = '320xY' name = 'Launcher' overlays = 'screen'> "
+"<layout type = 'vertical' center = 'true' padding = '8, 8, 8, 8'> "
+"<widget name = 'Version' "
+"height = 'Globals.Line.Height' "
+"/> "
+"<widget name = 'GameList' width = '304' height = '120'/> "
+"<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6'> "
+"<widget name = 'AddGameButton' "
+"width = '95' "
+"height = 'Globals.Button.Height' "
+"/> "
+"<widget name = 'EditGameButton' "
+"width = '95' "
+"height = 'Globals.Button.Height' "
+"/> "
+"<widget name = 'RemoveGameButton' "
+"width = '95' "
+"height = 'Globals.Button.Height' "
+"/> "
+"</layout> "
+"<layout type = 'horizontal' padding = '0, 0, 0, 0'> "
+"<widget name = 'QuitButton' "
+"type = 'Button' "
+"/> "
+"<widget name = 'AboutButton' "
+"type = 'Button' "
+"/> "
+"<widget name = 'OptionsButton' "
+"type = 'Button' "
+"/> "
+"<widget name = 'StartButton' "
+"type = 'Button' "
+"/> "
+"</layout> "
+"</layout> "
+"</dialog> "
 "<dialog name = 'Browser' overlays = 'Dialog.Launcher.GameList' shading = 'dim'> "
 "<layout type = 'vertical' padding = '8, 8, 8, 8' direction = 'bottom2top'> "
 "<layout type = 'horizontal' padding = '0, 0, 16, 0' direction = 'right2left'> "

Modified: scummvm/branches/gsoc2008-gui/gui/themes/modern.stx
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/themes/modern.stx	2008-08-08 18:28:13 UTC (rev 33703)
+++ scummvm/branches/gsoc2008-gui/gui/themes/modern.stx	2008-08-08 18:30:16 UTC (rev 33704)
@@ -456,7 +456,12 @@
 		<def var = 'Widget.Size' value = '32' />
 		<def var = 'Line.Height' value = '16' />
 		<def var = 'Font.Height' value = '16' />
+		<def var = 'TabLabelWidth' value = '110' />
 		
+		<def var = 'WidgetSize' value = 'kBigWidgetSize' />
+		
+		<def resolution = '320xY' var = 'WidgetSize' value = 'kNormalWidgetSize' />
+		
 		<def var = 'Padding.Bottom' value = '16' />
 		<def var = 'Padding.Left' value = '16' />
 		<def var = 'Padding.Right' value = '16' />
@@ -465,6 +470,9 @@
 		<def var = 'ListWidget.hlLeftPadding' value = '0'/>
 		<def var = 'ListWidget.hlRightPadding' value = '16'/>
 		<def var = 'PopUpWidget.labelSpacing' value = '10' />
+		
+		<def var = 'ShowLauncherLogo' value = '1'/>
+		<def resolution = '320xY' var = 'ShowLauncherLogo' value = '0'/>
 
 		<widget name = 'OptionsLabel'
 				size = '110, Globals.Line.Height'
@@ -472,9 +480,16 @@
 		<widget name = 'SmallLabel'
 				size = '24, Globals.Line.Height'
 		/>
+		
 		<widget name = 'Button'
-				size = '108, 24'
+				size = 'kBigButtonWidth, kBigButtonHeight'
 		/>
+		<widget resolution = '320xY'
+				name = 'Button'
+				size = 'kButtonWidth, kButtonHeight'
+		/>
+		
+		
 		<widget name = 'Slider'
 				size = '128, 18'
 		/>
@@ -552,6 +567,43 @@
 		</layout>
 	</dialog>
 	
+	<dialog resolution = '320xY' name = 'Launcher' overlays = 'screen'>
+		<layout type = 'vertical' center = 'true' padding = '8, 8, 8, 8'>
+			<widget name = 'Version'
+					height = 'Globals.Line.Height'
+			/>
+			<widget name = 'GameList' width = '304' height = '120'/>
+			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6'>
+				<widget name = 'AddGameButton' 
+						width = '95'
+						height = 'Globals.Button.Height' 
+				/>
+				<widget name = 'EditGameButton' 
+						width = '95'
+						height = 'Globals.Button.Height'
+				/>
+				<widget name = 'RemoveGameButton' 
+						width = '95'
+						height = 'Globals.Button.Height'
+				/>
+			</layout>
+			<layout type = 'horizontal' padding = '0, 0, 0, 0'>
+				<widget name = 'QuitButton' 
+						type = 'Button' 
+				/>
+				<widget name = 'AboutButton' 
+						type = 'Button' 
+				/>
+				<widget name = 'OptionsButton' 
+						type = 'Button' 
+				/>
+				<widget name = 'StartButton' 
+						type = 'Button'
+				/>
+			</layout>
+		</layout>
+	</dialog>
+	
 	<dialog name = 'Browser' overlays = 'Dialog.Launcher.GameList' shading = 'dim'>
 		<layout type = 'vertical' padding = '8, 8, 8, 8' direction = 'bottom2top'>
 			<layout type = 'horizontal' padding = '0, 0, 16, 0' direction = 'right2left'>
@@ -574,8 +626,7 @@
 					height = 'Globals.Line.Height'
 			/>
 		</layout>
-	</dialog>
-			
+	</dialog>	
 	
 	<dialog name = 'GlobalOptions' overlays = 'Dialog.Launcher.GameList' shading = 'dim'>
 		<layout type = 'vertical' padding = '0, 0, 0, 0' direction = 'bottom2top'>
@@ -592,6 +643,8 @@
 		</layout>
 	</dialog>
 	
+	
+	
 	<dialog name = 'GlobalOptions_Graphics' overlays = 'Dialog.GlobalOptions.TabWidget'>
 		<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
 			<widget name = 'grModePopup'

Modified: scummvm/branches/gsoc2008-gui/gui/widget.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/widget.cpp	2008-08-08 18:28:13 UTC (rev 33703)
+++ scummvm/branches/gsoc2008-gui/gui/widget.cpp	2008-08-08 18:30:16 UTC (rev 33704)
@@ -183,10 +183,7 @@
 	_type = kStaticTextWidget;
 	_label = text;
 
-	_align = (Graphics::TextAlignment)g_gui.evaluator()->getVar(name + ".align");
-
-	if (_align == (int)EVAL_UNDEF_VAR)
-		_align = kTextAlignLeft;
+	_align = (Graphics::TextAlignment)g_gui.xmlEval()->getVar(name + ".Align", kTextAlignLeft);
 }
 
 void StaticTextWidget::setValue(int value) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list