[Scummvm-cvs-logs] SF.net SVN: scummvm:[48282] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Mar 18 16:09:24 CET 2010


Revision: 48282
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48282&view=rev
Author:   fingolfin
Date:     2010-03-18 15:09:24 +0000 (Thu, 18 Mar 2010)

Log Message:
-----------
COMMON: Move typedef StringList from str.h to new header str-array.h

This removes the dependency on array.h from str.h.
Also, begun migration from the confusing type name "StringList" to
the more appropriate StringArray.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/sdl/graphics.cpp
    scummvm/trunk/base/plugins.h
    scummvm/trunk/common/config-manager.cpp
    scummvm/trunk/common/config-manager.h
    scummvm/trunk/common/savefile.h
    scummvm/trunk/common/str.h
    scummvm/trunk/engines/agi/predictive.cpp
    scummvm/trunk/engines/agi/sound.cpp
    scummvm/trunk/engines/cine/msg.cpp
    scummvm/trunk/engines/cine/msg.h
    scummvm/trunk/engines/groovie/cursor.h
    scummvm/trunk/engines/m4/mads_anim.h
    scummvm/trunk/engines/made/sound.h
    scummvm/trunk/engines/mohawk/riven_scripts.cpp
    scummvm/trunk/engines/mohawk/riven_scripts.h
    scummvm/trunk/engines/mohawk/video/qdm2.h
    scummvm/trunk/engines/queen/credits.h
    scummvm/trunk/engines/queen/logic.h
    scummvm/trunk/engines/queen/resource.h
    scummvm/trunk/engines/sci/engine/kernel.h
    scummvm/trunk/engines/sci/engine/state.h
    scummvm/trunk/engines/sky/control.h
    scummvm/trunk/engines/sword1/control.h
    scummvm/trunk/engines/teenagent/music.h
    scummvm/trunk/engines/teenagent/scene.h
    scummvm/trunk/graphics/font.cpp
    scummvm/trunk/graphics/font.h
    scummvm/trunk/gui/KeysDialog.cpp
    scummvm/trunk/gui/ListWidget.cpp
    scummvm/trunk/gui/ListWidget.h
    scummvm/trunk/gui/about.cpp
    scummvm/trunk/gui/about.h
    scummvm/trunk/gui/browser.cpp
    scummvm/trunk/gui/chooser.cpp
    scummvm/trunk/gui/chooser.h
    scummvm/trunk/gui/debugger.cpp
    scummvm/trunk/gui/launcher.cpp
    scummvm/trunk/gui/launcher.h
    scummvm/trunk/gui/massadd.cpp
    scummvm/trunk/gui/massadd.h
    scummvm/trunk/gui/message.cpp
    scummvm/trunk/gui/saveload.cpp
    scummvm/trunk/gui/saveload.h
    scummvm/trunk/gui/themebrowser.cpp
    scummvm/trunk/test/common/array.h

Added Paths:
-----------
    scummvm/trunk/common/str-array.h

Modified: scummvm/trunk/backends/platform/sdl/graphics.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/graphics.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/backends/platform/sdl/graphics.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -1857,7 +1857,7 @@
 	SDL_FillRect(_osdSurface, 0, kOSDColorKey);
 
 	// Split the message into separate lines.
-	Common::StringList lines;
+	Common::Array<Common::String> lines;
 	const char *ptr;
 	for (ptr = msg; *ptr; ++ptr) {
 		if (*ptr == '\n') {

Modified: scummvm/trunk/base/plugins.h
===================================================================
--- scummvm/trunk/base/plugins.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/base/plugins.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -26,6 +26,7 @@
 #ifndef BASE_PLUGINS_H
 #define BASE_PLUGINS_H
 
+#include "common/array.h"
 #include "common/error.h"
 #include "common/singleton.h"
 #include "common/util.h"

Modified: scummvm/trunk/common/config-manager.cpp
===================================================================
--- scummvm/trunk/common/config-manager.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/common/config-manager.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -217,7 +217,7 @@
 	// First write the domains in _domainSaveOrder, in that order.
 	// Note: It's possible for _domainSaveOrder to list domains which
 	// are not present anymore.
-	StringList::const_iterator i;
+	Array<String>::const_iterator i;
 	for (i = _domainSaveOrder.begin(); i != _domainSaveOrder.end(); ++i) {
 		if (kApplicationDomain == *i) {
 			writeDomain(*stream, *i, _appDomain);

Modified: scummvm/trunk/common/config-manager.h
===================================================================
--- scummvm/trunk/common/config-manager.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/common/config-manager.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -159,7 +159,7 @@
 	Domain			_keymapperDomain;
 #endif
 
-	StringList		_domainSaveOrder;
+	Array<String>	_domainSaveOrder;
 
 	String			_activeDomainName;
 	Domain *		_activeDomain;

Modified: scummvm/trunk/common/savefile.h
===================================================================
--- scummvm/trunk/common/savefile.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/common/savefile.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -29,11 +29,12 @@
 #include "common/noncopyable.h"
 #include "common/scummsys.h"
 #include "common/stream.h"
-#include "common/str.h"
+#include "common/str-array.h"
 #include "common/error.h"
 
 namespace Common {
 
+
 /**
  * A class which allows game engines to load game state data.
  * That typically means "save games", but also includes things like the
@@ -142,7 +143,7 @@
 	 * @return list of strings for all present file names.
 	 * @see Common::matchString()
 	 */
-	virtual StringList listSavefiles(const String &pattern) = 0;
+	virtual StringArray listSavefiles(const String &pattern) = 0;
 };
 
 } // End of namespace Common

Copied: scummvm/trunk/common/str-array.h (from rev 48281, scummvm/trunk/engines/cine/msg.h)
===================================================================
--- scummvm/trunk/common/str-array.h	                        (rev 0)
+++ scummvm/trunk/common/str-array.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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$
+ *
+ */
+
+#ifndef COMMON_STRING_ARRAY_H
+#define COMMON_STRING_ARRAY_H
+
+#include "common/array.h"
+#include "common/str.h"
+
+namespace Common {
+
+/**
+ * An array of of strings.
+ */
+typedef Array<String> StringArray;
+
+
+/**
+ * Alias for type StringArray. For backwards compatibility only.
+ * @deprecated		Use StringArray instead!
+ */
+typedef StringArray StringList;
+
+
+} // End of namespace Common
+
+#endif

Modified: scummvm/trunk/common/str.h
===================================================================
--- scummvm/trunk/common/str.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/common/str.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -26,7 +26,6 @@
 #define COMMON_STRING_H
 
 #include "common/scummsys.h"
-#include "common/array.h"
 
 namespace Common {
 
@@ -320,13 +319,6 @@
 
 
 /**
- * A 'list' of strings. Actually, this is nowadays an array, and hence misnamed.
- */
-typedef Array<String> StringList;
-
-
-
-/**
  * Take a 32 bit value and turn it into a four character string, where each of
  * the four bytes is turned into one character. Most significant byte is printed
  * first.

Modified: scummvm/trunk/engines/agi/predictive.cpp
===================================================================
--- scummvm/trunk/engines/agi/predictive.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/agi/predictive.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -67,7 +67,7 @@
 	// This function reorders the words on the given pred.dic line
 	// by moving the word at position 'wordnum' to the front (that is, right behind
 	// right behind the numerical code word at the start of the line).
-	Common::StringList words;
+	Common::Array<Common::String> words;
 	char buf[MAXLINELEN];
 
 	if (!str)

Modified: scummvm/trunk/engines/agi/sound.cpp
===================================================================
--- scummvm/trunk/engines/agi/sound.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/agi/sound.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -26,6 +26,7 @@
 #include "common/md5.h"
 #include "common/config-manager.h"
 #include "common/random.h"
+#include "common/str-array.h"
 
 #include "agi/agi.h"
 

Modified: scummvm/trunk/engines/cine/msg.cpp
===================================================================
--- scummvm/trunk/engines/cine/msg.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/cine/msg.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -31,6 +31,8 @@
 
 namespace Cine {
 
+// FIXME: Global C++ objects affect portability negatively.
+// Turn this into a class member instead.
 Common::StringList messageTable;
 
 void loadMsg(char *pMsgName) {

Modified: scummvm/trunk/engines/cine/msg.h
===================================================================
--- scummvm/trunk/engines/cine/msg.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/cine/msg.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -26,13 +26,13 @@
 #ifndef CINE_MSG_H
 #define CINE_MSG_H
 
-#include "common/str.h"
+#include "common/str-array.h"
 
 namespace Cine {
 
 #define NUM_MAX_MESSAGE 255
 
-extern Common::StringList messageTable;
+extern Common::StringArray messageTable;
 
 void loadMsg(char *pMsgName);
 

Modified: scummvm/trunk/engines/groovie/cursor.h
===================================================================
--- scummvm/trunk/engines/groovie/cursor.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/groovie/cursor.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -27,6 +27,7 @@
 #define GROOVIE_CURSOR_H
 
 #include "common/system.h"
+#include "common/array.h"
 #include "common/file.h"
 
 namespace Groovie {

Modified: scummvm/trunk/engines/m4/mads_anim.h
===================================================================
--- scummvm/trunk/engines/m4/mads_anim.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/m4/mads_anim.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -29,6 +29,8 @@
 #include "m4/viewmgr.h"
 #include "m4/compression.h"
 
+#include "common/str-array.h"
+
 namespace M4 {
 
 enum SceneTransition {
@@ -97,7 +99,7 @@
 	uint8 flags;
 	uint16 roomNumber;
 	uint16 frameTicks;
-	Common::StringList filenames;
+	Common::StringArray filenames;
 	Common::String lbmFilename;
 	Common::String spritesFilename;
 	Common::String soundName;

Modified: scummvm/trunk/engines/made/sound.h
===================================================================
--- scummvm/trunk/engines/made/sound.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/made/sound.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -26,9 +26,9 @@
 #ifndef MADE_SOUND_H
 #define MADE_SOUND_H
 
+#include "common/array.h"
 #include "common/util.h"
 #include "common/file.h"
-#include "common/list.h"
 #include "common/stream.h"
 
 namespace Made {

Modified: scummvm/trunk/engines/mohawk/riven_scripts.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/riven_scripts.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/mohawk/riven_scripts.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -172,7 +172,7 @@
 		printf ("\t");
 }
 
-void RivenScript::dumpScript(Common::StringList varNames, Common::StringList xNames, byte tabs) {
+void RivenScript::dumpScript(Common::StringArray varNames, Common::StringArray xNames, byte tabs) {
 	if (_stream->pos() != 0)
 		_stream->seek(0);
 
@@ -180,7 +180,7 @@
 	dumpCommands(varNames, xNames, tabs + 1);
 }
 
-void RivenScript::dumpCommands(Common::StringList varNames, Common::StringList xNames, byte tabs) {
+void RivenScript::dumpCommands(Common::StringArray varNames, Common::StringArray xNames, byte tabs) {
 	uint16 commandCount = _stream->readUint16BE();
 
 	for (uint16 i = 0; i < commandCount; i++) {

Modified: scummvm/trunk/engines/mohawk/riven_scripts.h
===================================================================
--- scummvm/trunk/engines/mohawk/riven_scripts.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/mohawk/riven_scripts.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -26,6 +26,8 @@
 #ifndef RIVEN_SCRIPTS_H
 #define RIVEN_SCRIPTS_H
 
+#include "common/str-array.h"
+
 class MohawkEngine_Riven;
 
 #define DECLARE_OPCODE(x) void x(uint16 op, uint16 argc, uint16 *argv)
@@ -55,7 +57,7 @@
 	~RivenScript();
 
 	void runScript();
-	void dumpScript(Common::StringList varNames, Common::StringList xNames, byte tabs);
+	void dumpScript(Common::StringArray varNames, Common::StringArray xNames, byte tabs);
 	uint16 getScriptType() { return _scriptType; }
 
 	// Read in an array of script objects from a stream
@@ -74,7 +76,7 @@
 	Common::SeekableReadStream *_stream;
 	uint16 _scriptType;
 
-	void dumpCommands(Common::StringList varNames, Common::StringList xNames, byte tabs);
+	void dumpCommands(Common::StringArray varNames, Common::StringArray xNames, byte tabs);
 	void processCommands(bool runCommands);
 
 	static uint32 calculateCommandSize(Common::SeekableReadStream* script);

Modified: scummvm/trunk/engines/mohawk/video/qdm2.h
===================================================================
--- scummvm/trunk/engines/mohawk/video/qdm2.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/mohawk/video/qdm2.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -27,6 +27,7 @@
 #define MOHAWK_VIDEO_QDM2_H
 
 #include "sound/audiostream.h"
+#include "common/array.h"
 #include "common/stream.h"
 
 namespace Mohawk {

Modified: scummvm/trunk/engines/queen/credits.h
===================================================================
--- scummvm/trunk/engines/queen/credits.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/queen/credits.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -26,7 +26,7 @@
 #ifndef QUEEN_CREDITS_H
 #define QUEEN_CREDITS_H
 
-#include "common/util.h"
+#include "common/str-array.h"
 #include "queen/defs.h"
 
 namespace Queen {
@@ -82,7 +82,7 @@
 	uint _lineNum;
 
 	//! contains the credits description
-	Common::StringList _credits;
+	Common::StringArray _credits;
 
 	QueenEngine *_vm;
 };

Modified: scummvm/trunk/engines/queen/logic.h
===================================================================
--- scummvm/trunk/engines/queen/logic.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/queen/logic.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -26,7 +26,7 @@
 #ifndef QUEEN_LOGIC_H
 #define QUEEN_LOGIC_H
 
-#include "common/str.h"
+#include "common/str-array.h"
 #include "common/util.h"
 #include "queen/structs.h"
 
@@ -337,7 +337,7 @@
 	//! actor initial position in room is _walkOffData[_entryObj]
 	int16 _entryObj;
 
-	Common::StringList _jasStringList;
+	Common::StringArray _jasStringList;
 	int _jasStringOffset[JSO_COUNT];
 
 	uint16 _numDescriptions;

Modified: scummvm/trunk/engines/queen/resource.h
===================================================================
--- scummvm/trunk/engines/queen/resource.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/queen/resource.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -27,6 +27,7 @@
 #define QUEEN_RESOURCE_H
 
 #include "common/file.h"
+#include "common/str-array.h"
 #include "common/util.h"
 #include "queen/defs.h"
 
@@ -74,7 +75,7 @@
 	uint8 *loadFile(const char *filename, uint32 skipBytes = 0, uint32 *size = NULL);
 
 	//! loads a text file
-	void loadTextFile(const char *filename, Common::StringList &stringList);
+	void loadTextFile(const char *filename, Common::StringArray &stringList);
 
 	//! returns true if the file is present in the resource
 	bool fileExists(const char *filename) const { return resourceEntry(filename) != NULL; }

Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/sci/engine/kernel.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -29,6 +29,7 @@
 #include "common/scummsys.h"
 #include "common/debug.h"
 #include "common/rect.h"
+#include "common/str-array.h"
 
 #include "sci/sci.h"	// for USE_OLD_MUSIC_FUNCTIONS
 #include "sci/engine/vm_types.h"	// for reg_t
@@ -175,7 +176,7 @@
 	 * Check for any hardcoded selector table we might have that can be used
 	 * if a game is missing the selector names.
 	 */
-	Common::StringList checkStaticSelectorNames();
+	Common::StringArray checkStaticSelectorNames();
 
 	/**
 	 * Maps special selectors
@@ -191,8 +192,8 @@
 	uint32 features;
 
 	// Kernel-related lists
-	Common::StringList _selectorNames;
-	Common::StringList _kernelNames;
+	Common::StringArray _selectorNames;
+	Common::StringArray _kernelNames;
 };
 
 /******************** Text functionality ********************/

Modified: scummvm/trunk/engines/sci/engine/state.h
===================================================================
--- scummvm/trunk/engines/sci/engine/state.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/sci/engine/state.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -29,6 +29,7 @@
 #include "common/scummsys.h"
 #include "common/array.h"
 #include "common/serializer.h"
+#include "common/str-array.h"
 
 namespace Common {
 	class SeekableReadStream;
@@ -54,8 +55,8 @@
 class DirSeeker {
 protected:
 	reg_t _outbuffer;
-	Common::StringList _savefiles;
-	Common::StringList::const_iterator _iter;
+	Common::StringArray _savefiles;
+	Common::StringArray::const_iterator _iter;
 
 public:
 	DirSeeker() {

Modified: scummvm/trunk/engines/sky/control.h
===================================================================
--- scummvm/trunk/engines/sky/control.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/sky/control.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -29,6 +29,7 @@
 
 #include "common/events.h"
 #include "common/scummsys.h"
+#include "common/str-array.h"
 
 class OSystem;
 namespace Common {
@@ -194,8 +195,8 @@
 	uint16 _selectedGame;
 	uint16 saveGameToFile();
 
-	void loadDescriptions(Common::StringList &list);
-	void saveDescriptions(const Common::StringList &list);
+	void loadDescriptions(Common::StringArray &list);
+	void saveDescriptions(const Common::StringArray &list);
 
 private:
 	int displayMessage(const char *altButton, const char *message, ...) GCC_PRINTF(3, 4);
@@ -222,7 +223,7 @@
 	void drawCross(uint16 x, uint16 y);
 
 	uint16 saveRestorePanel(bool allowSave);
-	void setUpGameSprites(const Common::StringList &saveGameNames, DataFileHeader **nameSprites, uint16 firstNum, uint16 selectedGame);
+	void setUpGameSprites(const Common::StringArray &saveGameNames, DataFileHeader **nameSprites, uint16 firstNum, uint16 selectedGame);
 	void showSprites(DataFileHeader **nameSprites, bool allowSave);
 	void handleKeyPress(Common::KeyState kbd, Common::String &textBuf);
 

Modified: scummvm/trunk/engines/sword1/control.h
===================================================================
--- scummvm/trunk/engines/sword1/control.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/sword1/control.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -28,6 +28,7 @@
 
 #include "common/scummsys.h"
 #include "common/events.h"
+#include "common/str-array.h"
 #include "sword1/sworddefs.h"
 
 class OSystem;
@@ -111,7 +112,7 @@
 	uint8 _numSaves;
 	uint8 _saveScrollPos;
 	uint8 _selectedSavegame;
-	Common::StringList _saveNames;
+	Common::StringArray _saveNames;
 	Common::String _oldName;
 	uint8 _cursorTick;
 	bool _cursorVisible;

Modified: scummvm/trunk/engines/teenagent/music.h
===================================================================
--- scummvm/trunk/engines/teenagent/music.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/teenagent/music.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -27,6 +27,7 @@
 #define TEEN_MUSIC_H
 
 #include "sound/mods/paula.h"
+#include "common/array.h"
 
 namespace TeenAgent {
 

Modified: scummvm/trunk/engines/teenagent/scene.h
===================================================================
--- scummvm/trunk/engines/teenagent/scene.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/engines/teenagent/scene.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -27,12 +27,14 @@
 
 #include "teenagent/surface.h"
 #include "teenagent/actor.h"
-#include "common/system.h"
-#include "common/list.h"
 #include "teenagent/objects.h"
 #include "teenagent/surface.h"
 #include "teenagent/surface_list.h"
 
+#include "common/system.h"
+#include "common/array.h"
+#include "common/list.h"
+
 namespace TeenAgent {
 
 class TeenAgentEngine;

Modified: scummvm/trunk/graphics/font.cpp
===================================================================
--- scummvm/trunk/graphics/font.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/graphics/font.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -864,10 +864,10 @@
 
 
 struct WordWrapper {
-	Common::StringList &lines;
+	Common::Array<Common::String> &lines;
 	int actualMaxLineWidth;
 
-	WordWrapper(Common::StringList &l) : lines(l), actualMaxLineWidth(0) {
+	WordWrapper(Common::Array<Common::String> &l) : lines(l), actualMaxLineWidth(0) {
 	}
 
 	void add(Common::String &line, int &w) {
@@ -881,7 +881,7 @@
 	}
 };
 
-int Font::wordWrapText(const Common::String &str, int maxWidth, Common::StringList &lines) const {
+int Font::wordWrapText(const Common::String &str, int maxWidth, Common::Array<Common::String> &lines) const {
 	WordWrapper wrapper(lines);
 	Common::String line;
 	Common::String tmpStr;

Modified: scummvm/trunk/graphics/font.h
===================================================================
--- scummvm/trunk/graphics/font.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/graphics/font.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -26,6 +26,7 @@
 #define GRAPHICS_FONT_H
 
 #include "common/str.h"
+#include "common/array.h"
 #include "graphics/surface.h"
 
 namespace Common {
@@ -78,7 +79,7 @@
 	 * @param lines	the string list to which the text lines from str are appended
 	 * @return the maximal width of any of the lines added to lines
 	 */
-	int wordWrapText(const Common::String &str, int maxWidth, Common::StringList &lines) const;
+	int wordWrapText(const Common::String &str, int maxWidth, Common::Array<Common::String> &lines) const;
 };
 
 

Modified: scummvm/trunk/gui/KeysDialog.cpp
===================================================================
--- scummvm/trunk/gui/KeysDialog.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/KeysDialog.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -55,7 +55,7 @@
 	_keyMapping->setFlags(WIDGET_CLEARBG);
 
 	// Get actions names
-	Common::StringList l;
+	ListWidget::StringArray l;
 
 	for (int i = 0; i < Actions::Instance()->size(); i++)
 		l.push_back(Actions::Instance()->actionName((ActionType)i));

Modified: scummvm/trunk/gui/ListWidget.cpp
===================================================================
--- scummvm/trunk/gui/ListWidget.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/ListWidget.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -152,7 +152,7 @@
 		return _listColors[_listIndex[_selectedItem]];
 }
 
-void ListWidget::setList(const StringList &list, const ColorList *colors) {
+void ListWidget::setList(const StringArray &list, const ColorList *colors) {
 	if (_editMode && _caretVisible)
 		drawCaret(true);
 
@@ -306,7 +306,7 @@
 			int newSelectedItem = 0;
 			int bestMatch = 0;
 			bool stop;
-			for (StringList::const_iterator i = _list.begin(); i != _list.end(); ++i) {
+			for (StringArray::const_iterator i = _list.begin(); i != _list.end(); ++i) {
 				const int match = matchingCharsIgnoringCase(i->c_str(), _quickSelectStr.c_str(), stop);
 				if (match > bestMatch || stop) {
 					_selectedItem = newSelectedItem;
@@ -692,7 +692,7 @@
 		_list.clear();
 		_listIndex.clear();
 
-		for (StringList::iterator i = _dataList.begin(); i != _dataList.end(); ++i, ++n) {
+		for (StringArray::iterator i = _dataList.begin(); i != _dataList.end(); ++i, ++n) {
 			tmp = *i;
 			tmp.toLowercase();
 			bool matches = true;

Modified: scummvm/trunk/gui/ListWidget.h
===================================================================
--- scummvm/trunk/gui/ListWidget.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/ListWidget.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -52,11 +52,11 @@
 class ListWidget : public EditableWidget {
 public:
 	typedef Common::String String;
-	typedef Common::StringList StringList;
+	typedef Common::Array<Common::String> StringArray;
 	typedef Common::Array<ThemeEngine::FontColor> ColorList;
 protected:
-	StringList		_list;
-	StringList		_dataList;
+	StringArray		_list;
+	StringArray		_dataList;
 	ColorList		_listColors;
 	Common::Array<int>		_listIndex;
 	bool			_editable;
@@ -93,8 +93,8 @@
 
 	virtual Widget *findWidget(int x, int y);
 
-	void setList(const StringList &list, const ColorList *colors = 0);
-	const StringList &getList()	const			{ return _dataList; }
+	void setList(const StringArray &list, const ColorList *colors = 0);
+	const StringArray &getList()	const			{ return _dataList; }
 
 	void append(const String &s, ThemeEngine::FontColor color = ThemeEngine::kFontColorNormal);
 

Modified: scummvm/trunk/gui/about.cpp
===================================================================
--- scummvm/trunk/gui/about.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/about.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -164,10 +164,10 @@
 		Common::String format(str, 2);
 		str += 2;
 
-		Common::StringList wrappedLines;
+		StringArray wrappedLines;
 		g_gui.getFont().wordWrapText(str, _w - 2 * _xOff, wrappedLines);
 
-		for (Common::StringList::const_iterator i = wrappedLines.begin(); i != wrappedLines.end(); ++i) {
+		for (StringArray::const_iterator i = wrappedLines.begin(); i != wrappedLines.end(); ++i) {
 			_lines.push_back(format + *i);
 		}
 	}

Modified: scummvm/trunk/gui/about.h
===================================================================
--- scummvm/trunk/gui/about.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/about.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -32,11 +32,11 @@
 namespace GUI {
 
 class AboutDialog : public Dialog {
-	typedef Common::StringList StringList;
+	typedef Common::Array<Common::String> StringArray;
 protected:
 	int			_scrollPos;
 	uint32		_scrollTime;
-	StringList	_lines;
+	StringArray	_lines;
 	uint32		_lineHeight;
 	bool		_willClose;
 

Modified: scummvm/trunk/gui/browser.cpp
===================================================================
--- scummvm/trunk/gui/browser.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/browser.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -150,7 +150,7 @@
 		Common::sort(_nodeContent.begin(), _nodeContent.end());
 
 	// Populate the ListWidget
-	Common::StringList list;
+	ListWidget::StringArray list;
 	ListWidget::ColorList colors;
 	for (Common::FSList::iterator i = _nodeContent.begin(); i != _nodeContent.end(); ++i) {
 		if (i->isDirectory())

Modified: scummvm/trunk/gui/chooser.cpp
===================================================================
--- scummvm/trunk/gui/chooser.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/chooser.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -50,7 +50,7 @@
 	_chooseButton->setEnabled(false);
 }
 
-void ChooserDialog::setList(const StringList& list) {
+void ChooserDialog::setList(const StringArray& list) {
 	_list->setList(list);
 }
 

Modified: scummvm/trunk/gui/chooser.h
===================================================================
--- scummvm/trunk/gui/chooser.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/chooser.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -39,7 +39,7 @@
 
 class ChooserDialog : public Dialog {
 	typedef Common::String String;
-	typedef Common::StringList StringList;
+	typedef Common::Array<Common::String> StringArray;
 protected:
 	ListWidget		*_list;
 	ButtonWidget	*_chooseButton;
@@ -47,7 +47,7 @@
 public:
 	ChooserDialog(const String &title, String dialogId = "Browser");
 
-	void setList(const StringList& list);
+	void setList(const StringArray& list);
 
 	virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
 };

Modified: scummvm/trunk/gui/debugger.cpp
===================================================================
--- scummvm/trunk/gui/debugger.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/debugger.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -427,7 +427,7 @@
 	DebugPrintf("Commands are:\n");
 
 	// Obtain a list of sorted command names
-	Common::StringList cmds;
+	Common::Array<Common::String> cmds;
 	CommandsMap::const_iterator iter, e = _cmds.end();
 	for (iter = _cmds.begin(); iter != e; ++iter) {
 		cmds.push_back(iter->_key);

Modified: scummvm/trunk/gui/launcher.cpp
===================================================================
--- scummvm/trunk/gui/launcher.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/launcher.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -119,7 +119,7 @@
 
 class EditGameDialog : public OptionsDialog {
 	typedef Common::String String;
-	typedef Common::StringList StringList;
+	typedef Common::Array<Common::String> StringArray;
 public:
 	EditGameDialog(const String &domain, const String &desc);
 
@@ -553,7 +553,7 @@
 void LauncherDialog::selectTarget(const String &target) {
 	if (!target.empty()) {
 		int itemToSelect = 0;
-		StringList::const_iterator iter;
+		StringArray::const_iterator iter;
 		for (iter = _domains.begin(); iter != _domains.end(); ++iter, ++itemToSelect) {
 			if (target == *iter) {
 				_list->setSelected(itemToSelect);
@@ -593,7 +593,7 @@
 }
 
 void LauncherDialog::updateListing() {
-	Common::StringList l;
+	StringArray l;
 
 	// Retrieve a list of all games defined in the config file
 	_domains.clear();
@@ -722,7 +722,7 @@
 				idx = 0;
 			} else {
 				// Display the candidates to the user and let her/him pick one
-				StringList list;
+				StringArray list;
 				for (idx = 0; idx < (int)candidates.size(); idx++)
 					list.push_back(candidates[idx].description());
 

Modified: scummvm/trunk/gui/launcher.h
===================================================================
--- scummvm/trunk/gui/launcher.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/launcher.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -40,7 +40,7 @@
 
 class LauncherDialog : public Dialog {
 	typedef Common::String String;
-	typedef Common::StringList StringList;
+	typedef Common::Array<Common::String> StringArray;
 public:
 	LauncherDialog();
 	~LauncherDialog();
@@ -64,7 +64,7 @@
 #endif
 	StaticTextWidget	*_searchDesc;
 	ButtonWidget	*_searchClearButton;
-	StringList		_domains;
+	StringArray		_domains;
 	BrowserDialog	*_browser;
 	SaveLoadChooser	*_loadDialog;
 

Modified: scummvm/trunk/gui/massadd.cpp
===================================================================
--- scummvm/trunk/gui/massadd.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/massadd.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -66,7 +66,7 @@
 	_dirProgressText(0),
 	_gameProgressText(0) {
 
-	Common::StringList l;
+	StringArray l;
 
 	// The dir we start our scan at
 	_scanStack.push(startDir);
@@ -199,8 +199,8 @@
 			// Check for existing config entries for this path/gameid/lang/platform combination
 			if (_pathToTargets.contains(path)) {
 				bool duplicate = false;
-				const Common::StringList &targets = _pathToTargets[path];
-				for (Common::StringList::const_iterator iter = targets.begin(); iter != targets.end(); ++iter) {
+				const StringArray &targets = _pathToTargets[path];
+				for (StringArray::const_iterator iter = targets.begin(); iter != targets.end(); ++iter) {
 					// If the gameid, platform and language match -> skip it
 					Common::ConfigManager::Domain *dom = ConfMan.getDomain(*iter);
 					assert(dom);

Modified: scummvm/trunk/gui/massadd.h
===================================================================
--- scummvm/trunk/gui/massadd.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/massadd.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -37,6 +37,7 @@
 class StaticTextWidget;
 
 class MassAddDialog : public Dialog {
+	typedef Common::Array<Common::String> StringArray;
 public:
 	MassAddDialog(const Common::FSNode &startDir);
 
@@ -59,7 +60,7 @@
 	 * Used to detect whether a potential new target is already present in the
 	 * config manager.
 	 */
-	Common::HashMap<Common::String, Common::StringList>	_pathToTargets;
+	Common::HashMap<Common::String, StringArray>	_pathToTargets;
 
 	int _dirsScanned;
 

Modified: scummvm/trunk/gui/message.cpp
===================================================================
--- scummvm/trunk/gui/message.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/message.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -53,7 +53,7 @@
 	// down the string into lines, and taking the maximum of their widths.
 	// Using this, and accounting for the space the button(s) need, we can set
 	// the real size of the dialog
-	Common::StringList lines;
+	Common::Array<Common::String> lines;
 	int lineCount, okButtonPos, cancelButtonPos;
 	int maxlineWidth = g_gui.getFont().wordWrapText(message, screenW - 2 * 20, lines);
 

Modified: scummvm/trunk/gui/saveload.cpp
===================================================================
--- scummvm/trunk/gui/saveload.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/saveload.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -313,7 +313,7 @@
 	_plugin = 0;
 	_target.clear();
 	_saveList.clear();
-	_list->setList(StringList());
+	_list->setList(StringArray());
 
 	Dialog::close();
 }
@@ -323,7 +323,7 @@
 
 	int curSlot = 0;
 	int saveSlot = 0;
-	StringList saveNames;
+	StringArray saveNames;
 	ListWidget::ColorList colors;
 	for (SaveStateList::const_iterator x = _saveList.begin(); x != _saveList.end(); ++x) {
 		// Handle gaps in the list of save games

Modified: scummvm/trunk/gui/saveload.h
===================================================================
--- scummvm/trunk/gui/saveload.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/saveload.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -35,7 +35,7 @@
 
 class SaveLoadChooser : public GUI::Dialog {
 	typedef Common::String String;
-	typedef Common::StringList StringList;
+	typedef Common::Array<Common::String> StringArray;
 protected:
 	GUI::ListWidget		*_list;
 	GUI::ButtonWidget	*_chooseButton;
@@ -65,7 +65,7 @@
 	~SaveLoadChooser();
 
 	virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
-	void setList(const StringList& list);
+	void setList(const StringArray& list);
 	int runModal(const EnginePlugin *plugin, const String &target);
 	void open();
 

Modified: scummvm/trunk/gui/themebrowser.cpp
===================================================================
--- scummvm/trunk/gui/themebrowser.cpp	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/gui/themebrowser.cpp	2010-03-18 15:09:24 UTC (rev 48282)
@@ -100,7 +100,7 @@
 	const Common::String currentThemeId = g_gui.theme()->getThemeId();
 	int currentThemeIndex = 0, index = 0;
 
-	Common::StringList list;
+	ListWidget::StringArray list;
 	for (ThemeDescList::const_iterator i = _themes.begin(); i != _themes.end(); ++i, ++index) {
 		list.push_back(i->name);
 

Modified: scummvm/trunk/test/common/array.h
===================================================================
--- scummvm/trunk/test/common/array.h	2010-03-18 15:07:48 UTC (rev 48281)
+++ scummvm/trunk/test/common/array.h	2010-03-18 15:09:24 UTC (rev 48282)
@@ -196,7 +196,7 @@
 	void test_array_constructor_str() {
 		const char *array1[] = { "a", "b", "c" };
 
-		Common::StringList array2(array1, 3);
+		Common::Array<Common::String> array2(array1, 3);
 
 		TS_ASSERT_EQUALS(array2[0], "a");
 		TS_ASSERT_EQUALS(array2[1], "b");


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