aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/EditTextWidget.cpp2
-rw-r--r--gui/EditTextWidget.h2
-rw-r--r--gui/ListWidget.cpp2
-rw-r--r--gui/ListWidget.h2
-rw-r--r--gui/PopUpWidget.cpp6
-rw-r--r--gui/PopUpWidget.h2
-rw-r--r--gui/TabWidget.cpp2
-rw-r--r--gui/TabWidget.h2
-rw-r--r--gui/ThemeNew.cpp8
-rw-r--r--gui/dialog.cpp2
-rw-r--r--gui/dialog.h2
-rw-r--r--gui/editable.cpp2
-rw-r--r--gui/editable.h2
-rw-r--r--gui/eval.cpp4
-rw-r--r--gui/eval.h12
-rw-r--r--gui/launcher.cpp14
-rw-r--r--gui/newgui.cpp4
-rw-r--r--gui/object.h2
-rw-r--r--gui/options.cpp18
-rw-r--r--gui/options.h12
-rw-r--r--gui/theme-config.cpp17
-rw-r--r--gui/theme.h10
-rw-r--r--gui/widget.cpp14
-rw-r--r--gui/widget.h14
24 files changed, 77 insertions, 80 deletions
diff --git a/gui/EditTextWidget.cpp b/gui/EditTextWidget.cpp
index 9bd6dd89fd..fafcfb955e 100644
--- a/gui/EditTextWidget.cpp
+++ b/gui/EditTextWidget.cpp
@@ -36,7 +36,7 @@ EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, cons
setEditString(text);
}
-EditTextWidget::EditTextWidget(GuiObject *boss, String name, const String &text)
+EditTextWidget::EditTextWidget(GuiObject *boss, const String &name, const String &text)
: EditableWidget(boss, name) {
_flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE;
_type = kEditTextWidget;
diff --git a/gui/EditTextWidget.h b/gui/EditTextWidget.h
index 756cdc9498..faee7cfd43 100644
--- a/gui/EditTextWidget.h
+++ b/gui/EditTextWidget.h
@@ -39,7 +39,7 @@ protected:
public:
EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text);
- EditTextWidget(GuiObject *boss, String name, const String &text);
+ EditTextWidget(GuiObject *boss, const String &name, const String &text);
void setEditString(const String &str);
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index 624a38f325..fc0539182e 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -29,7 +29,7 @@
namespace GUI {
-ListWidget::ListWidget(GuiObject *boss, String name)
+ListWidget::ListWidget(GuiObject *boss, const String &name)
: EditableWidget(boss, name), CommandSender(boss) {
_leftPadding = g_gui.evaluator()->getVar("ListWidget.leftPadding", 0);
diff --git a/gui/ListWidget.h b/gui/ListWidget.h
index b74e90d32b..de3518f2ed 100644
--- a/gui/ListWidget.h
+++ b/gui/ListWidget.h
@@ -70,7 +70,7 @@ protected:
int _scrollBarWidth;
public:
- ListWidget(GuiObject *boss, String name);
+ ListWidget(GuiObject *boss, const String &name);
virtual ~ListWidget();
virtual Widget *findWidget(int x, int y);
diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp
index 99732a5307..81ef30bee1 100644
--- a/gui/PopUpWidget.cpp
+++ b/gui/PopUpWidget.cpp
@@ -324,7 +324,7 @@ void PopUpDialog::drawMenuEntry(int entry, bool hilite) {
w = _w - 2;
}
- Common::String &name = _popUpBoss->_entries[entry].name;
+ Common::String &name(_popUpBoss->_entries[entry].name);
if (name.size() == 0) {
// Draw a separator
@@ -342,7 +342,7 @@ void PopUpDialog::drawMenuEntry(int entry, bool hilite) {
// PopUpWidget
//
-PopUpWidget::PopUpWidget(GuiObject *boss, String name, const String &label, uint labelWidth)
+PopUpWidget::PopUpWidget(GuiObject *boss, const String &name, const String &label, uint labelWidth)
: Widget(boss, name), CommandSender(boss), _label(label), _labelWidth(labelWidth) {
handleScreenChanged();
@@ -419,7 +419,7 @@ void PopUpWidget::drawWidget(bool hilite) {
g_gui.theme()->drawText(Common::Rect(_x+2,_y+3,_x+2+_labelWidth, _y+3+g_gui.theme()->getFontHeight()), _label,
isEnabled() ? Theme::kStateEnabled : Theme::kStateDisabled, Theme::kTextAlignRight);
- Common::String sel = "";
+ Common::String sel;
if (_selectedItem >= 0)
sel = _entries[_selectedItem].name;
g_gui.theme()->drawPopUpWidget(Common::Rect(x, _y, x+w, _y+_h), sel, _leftPadding, isEnabled() ? (hilite ? Theme::kStateHighlight : Theme::kStateEnabled) : Theme::kStateDisabled, g_gui.theme()->convertAligment(kTextAlignLeft));
diff --git a/gui/PopUpWidget.h b/gui/PopUpWidget.h
index 532c7e4d48..c94a64fd9b 100644
--- a/gui/PopUpWidget.h
+++ b/gui/PopUpWidget.h
@@ -60,7 +60,7 @@ protected:
int _labelSpacing;
public:
- PopUpWidget(GuiObject *boss, String name, const String &label, uint labelWidth = 0);
+ PopUpWidget(GuiObject *boss, const String &name, const String &label, uint labelWidth = 0);
void changeLabelWidth(uint newWidth) { _labelWidth = newWidth; }
diff --git a/gui/TabWidget.cpp b/gui/TabWidget.cpp
index 1b73fa3fb7..a4276e840c 100644
--- a/gui/TabWidget.cpp
+++ b/gui/TabWidget.cpp
@@ -41,7 +41,7 @@ TabWidget::TabWidget(GuiObject *boss, int x, int y, int w, int h)
init();
}
-TabWidget::TabWidget(GuiObject *boss, String name)
+TabWidget::TabWidget(GuiObject *boss, const String &name)
: Widget(boss, name) {
init();
}
diff --git a/gui/TabWidget.h b/gui/TabWidget.h
index 9eb1abc063..f05672c546 100644
--- a/gui/TabWidget.h
+++ b/gui/TabWidget.h
@@ -43,7 +43,7 @@ protected:
public:
TabWidget(GuiObject *boss, int x, int y, int w, int h);
- TabWidget(GuiObject *boss, String name);
+ TabWidget(GuiObject *boss, const String &name);
~TabWidget();
void init();
diff --git a/gui/ThemeNew.cpp b/gui/ThemeNew.cpp
index 5d533035aa..1403672925 100644
--- a/gui/ThemeNew.cpp
+++ b/gui/ThemeNew.cpp
@@ -98,7 +98,7 @@ OverlayColor calcGradient(OverlayColor start, OverlayColor end, int pos, int max
#pragma mark -
-ThemeNew::ThemeNew(OSystem *system, Common::String stylefile) : Theme(), _system(system), _screen(), _initOk(false),
+ThemeNew::ThemeNew(OSystem *system, const Common::String &stylefile) : Theme(), _system(system), _screen(), _initOk(false),
_lastUsedBitMask(0), _forceRedraw(false), _fonts(), _imageHandles(0), _images(0), _colors(), _cursor(0), _gradientFactors() {
_stylefile = stylefile;
_initOk = false;
@@ -155,7 +155,7 @@ _lastUsedBitMask(0), _forceRedraw(false), _fonts(), _imageHandles(0), _images(0)
#endif
}
- Common::String temp = "";
+ Common::String temp;
_configFile.getKey("version", "theme", temp);
if (atoi(temp.c_str()) != THEME_VERSION) {
// TODO: improve this detection and handle it nicer
@@ -1407,7 +1407,7 @@ void ThemeNew::setupColors() {
#define FONT_NAME_FIXED_BOLD "newgui_fixed_bold"
#define FONT_NAME_FIXED_ITALIC "newgui_fixed_italic"
-void ThemeNew::setupFont(String key, String name, kFontStyle style) {
+void ThemeNew::setupFont(const String &key, const String &name, kFontStyle style) {
if (_configFile.hasKey(key, "extra")) {
_fonts[style] = FontMan.getFontByName(name);
@@ -1534,7 +1534,7 @@ const Graphics::Font *ThemeNew::loadFont(const char *filename) {
}
Common::String ThemeNew::genCacheFilename(const char *filename) {
- Common::String cacheName = filename;
+ Common::String cacheName(filename);
for (int i = cacheName.size() - 1; i >= 0; --i) {
if (cacheName[i] == '.') {
while ((uint)i < cacheName.size() - 1) {
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index b1e00c2123..043777fdb2 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -46,7 +46,7 @@ Dialog::Dialog(int x, int y, int w, int h, bool dimsInactive_)
_drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
}
-Dialog::Dialog(Common::String name, bool dimsInactive_)
+Dialog::Dialog(const Common::String &name, bool dimsInactive_)
: GuiObject(name),
_mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false), _drawingHints(0),
_dimsInactive(dimsInactive_) {
diff --git a/gui/dialog.h b/gui/dialog.h
index f14bc06015..4371cd3d4e 100644
--- a/gui/dialog.h
+++ b/gui/dialog.h
@@ -53,7 +53,7 @@ private:
public:
Dialog(int x, int y, int w, int h, bool dimsInactive = true);
- Dialog(Common::String name, bool dimsInactive = true);
+ Dialog(const Common::String &name, bool dimsInactive = true);
virtual ~Dialog();
virtual int runModal();
diff --git a/gui/editable.cpp b/gui/editable.cpp
index 2b81547c2f..6e845802b3 100644
--- a/gui/editable.cpp
+++ b/gui/editable.cpp
@@ -30,7 +30,7 @@ EditableWidget::EditableWidget(GuiObject *boss, int x, int y, int w, int h)
init();
}
-EditableWidget::EditableWidget(GuiObject *boss, String name)
+EditableWidget::EditableWidget(GuiObject *boss, const String &name)
: Widget(boss, name) {
init();
}
diff --git a/gui/editable.h b/gui/editable.h
index 986c226a10..de9a56bed1 100644
--- a/gui/editable.h
+++ b/gui/editable.h
@@ -51,7 +51,7 @@ protected:
public:
EditableWidget(GuiObject *boss, int x, int y, int w, int h);
- EditableWidget(GuiObject *boss, String name);
+ EditableWidget(GuiObject *boss, const String &name);
virtual ~EditableWidget();
void init();
diff --git a/gui/eval.cpp b/gui/eval.cpp
index 0075796d83..5b1428ffc1 100644
--- a/gui/eval.cpp
+++ b/gui/eval.cpp
@@ -302,11 +302,11 @@ int Eval::getVar_(const char *s, bool includeAliases) {
return EVAL_UNDEF_VAR;
}
-void Eval::setAlias(const String &section, const char *name, const String value) {
+void Eval::setAlias(const String &section, const char *name, const String &value) {
_aliases[name + 4] = value;
}
-void Eval::setVar(const String &section, const char *name, const String value) {
+void Eval::setVar(const String &section, const char *name, const String &value) {
_vars[name + 4] = eval(value, section, name, 0);
}
diff --git a/gui/eval.h b/gui/eval.h
index c3da115c6d..89853adbe7 100644
--- a/gui/eval.h
+++ b/gui/eval.h
@@ -55,16 +55,16 @@ public:
~Eval();
int eval(const String &input, const String &section, const String &name, int startpos);
- void setAlias(const String &section, const char *name, const String value);
- void setVar(const String &section, const char *name, const String value);
+ void setAlias(const String &section, const char *name, const String &value);
+ void setVar(const String &section, const char *name, const String &value);
- void setParent(const String name);
+ void setParent(const String &name);
void setVar(const char *name, int val) { _vars[name] = val; }
- void setAlias(const char *name, const String val) { _aliases[name] = val; }
+ void setAlias(const char *name, const String &val) { _aliases[name] = val; }
- int getVar(String s) { return getVar_(s.c_str()); }
- int getVar(String s, int def) {
+ int getVar(const String &s) { return getVar_(s.c_str()); }
+ int getVar(const String &s, int def) {
int val = getVar_(s.c_str());
return (val == EVAL_UNDEF_VAR) ? def : val;
};
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index dbf165de29..94a0b770be 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -81,7 +81,7 @@ enum {
*/
class DomainEditTextWidget : public EditTextWidget {
public:
- DomainEditTextWidget(GuiObject *boss, String name, const String &text)
+ DomainEditTextWidget(GuiObject *boss, const String &name, const String &text)
: EditTextWidget(boss, name, text) {
}
@@ -323,15 +323,15 @@ void EditGameDialog::close() {
else
ConfMan.set("language", Common::getLanguageCode(lang), _domain);
- String gamePath = _gamePathWidget->getLabel();
+ String gamePath(_gamePathWidget->getLabel());
if (!gamePath.empty())
ConfMan.set("path", gamePath, _domain);
- String extraPath = _extraPathWidget->getLabel();
+ String extraPath(_extraPathWidget->getLabel());
if (!extraPath.empty() && (extraPath != "None"))
ConfMan.set("extrapath", extraPath, _domain);
- String savePath = _savePathWidget->getLabel();
+ String savePath(_savePathWidget->getLabel());
if (!savePath.empty() && (savePath != "Default"))
ConfMan.set("savepath", savePath, _domain);
@@ -491,7 +491,7 @@ LauncherDialog::LauncherDialog()
updateListing();
// Restore last selection
- String last = ConfMan.get(String("lastselectedgame"), ConfigManager::kApplicationDomain);
+ String last(ConfMan.get("lastselectedgame", ConfigManager::kApplicationDomain));
selectGame(last);
// En-/disable the buttons depending on the list selection
@@ -522,9 +522,9 @@ void LauncherDialog::close() {
// Save last selection
const int sel = _list->getSelected();
if (sel >= 0)
- ConfMan.set(String("lastselectedgame"), _domains[sel], ConfigManager::kApplicationDomain);
+ ConfMan.set("lastselectedgame", _domains[sel], ConfigManager::kApplicationDomain);
else
- ConfMan.removeKey(String("lastselectedgame"), ConfigManager::kApplicationDomain);
+ ConfMan.removeKey("lastselectedgame", ConfigManager::kApplicationDomain);
ConfMan.flushToDisk();
Dialog::close();
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index f72e56fc29..5c54973b7d 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -60,7 +60,7 @@ enum {
#endif
// HACK. FIXME. This doesn't belong here. But otherwise it creates compulation problems
-GuiObject::GuiObject(Common::String name) : _firstWidget(0) {
+GuiObject::GuiObject(const Common::String &name) : _firstWidget(0) {
_name = name;
handleScreenChanged();
}
@@ -103,7 +103,7 @@ NewGui::NewGui() : _needRedraw(false),
#ifndef DISABLE_FANCY_THEMES
ConfMan.registerDefault("gui_theme", "default");
- Common::String style = ConfMan.get("gui_theme");
+ Common::String style(ConfMan.get("gui_theme"));
// The default theme for now is the 'modern' theme.
if (scumm_stricmp(style.c_str(), "default") == 0)
style = "modern";
diff --git a/gui/object.h b/gui/object.h
index cb553fa1a7..60e51e3b94 100644
--- a/gui/object.h
+++ b/gui/object.h
@@ -65,7 +65,7 @@ protected:
public:
GuiObject(int x, int y, int w, int h) : _x(x), _y(y), _w(w), _h(h), _firstWidget(0), _name("") { }
- GuiObject(Common::String name);
+ GuiObject(const Common::String &name);
virtual int16 getAbsX() const { return _x; }
virtual int16 getAbsY() const { return _y; }
diff --git a/gui/options.cpp b/gui/options.cpp
index 8e7e29e4d3..51fe437b42 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -80,7 +80,7 @@ OptionsDialog::OptionsDialog(const String &domain, int x, int y, int w, int h)
init();
}
-OptionsDialog::OptionsDialog(const String &domain, String name)
+OptionsDialog::OptionsDialog(const String &domain, const String &name)
: Dialog(name), _domain(domain) {
init();
}
@@ -132,7 +132,7 @@ void OptionsDialog::open() {
if (ConfMan.hasKey("gfx_mode", _domain)) {
const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes();
- String gfxMode = ConfMan.get("gfx_mode", _domain);
+ String gfxMode(ConfMan.get("gfx_mode", _domain));
int gfxCount = 1;
while (gm->name) {
gfxCount++;
@@ -304,7 +304,7 @@ void OptionsDialog::close() {
ConfMan.setBool("native_mt32", _mt32Checkbox->getState(), _domain);
ConfMan.setBool("enable_gs", _enableGSCheckbox->getState(), _domain);
- String soundFont = _soundFont->getLabel();
+ String soundFont(_soundFont->getLabel());
if (!soundFont.empty() && (soundFont != "None"))
ConfMan.set("soundfont", soundFont, _domain);
} else {
@@ -448,7 +448,7 @@ void OptionsDialog::setSubtitleSettingsState(bool enabled) {
_subSpeedLabel->setEnabled(enabled);
}
-void OptionsDialog::addGraphicControls(GuiObject *boss, String prefix) {
+void OptionsDialog::addGraphicControls(GuiObject *boss, const String &prefix) {
const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes();
int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");
@@ -487,7 +487,7 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, String prefix) {
_enableGraphicSettings = true;
}
-void OptionsDialog::addAudioControls(GuiObject *boss, String prefix) {
+void OptionsDialog::addAudioControls(GuiObject *boss, const String &prefix) {
int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");
// The MIDI mode popup & a label
@@ -503,7 +503,7 @@ void OptionsDialog::addAudioControls(GuiObject *boss, String prefix) {
_enableAudioSettings = true;
}
-void OptionsDialog::addMIDIControls(GuiObject *boss, String prefix) {
+void OptionsDialog::addMIDIControls(GuiObject *boss, const String &prefix) {
// SoundFont
_soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", "SoundFont:", kChooseSoundFontCmd, 0);
_soundFont = new StaticTextWidget(boss, prefix + "mcFontPath", "None");
@@ -522,7 +522,7 @@ void OptionsDialog::addMIDIControls(GuiObject *boss, String prefix) {
// The function has an extra slider range parameter, since both the launcher and SCUMM engine
// make use of the widgets. The launcher range is 0-255. SCUMM's 0-9
-void OptionsDialog::addSubtitleControls(GuiObject *boss, String prefix, int maxSliderVal) {
+void OptionsDialog::addSubtitleControls(GuiObject *boss, const String &prefix, int maxSliderVal) {
_subToggleDesc = new StaticTextWidget(boss, prefix + "subToggleDesc", "Text and Speech:");
_subToggleButton = new ButtonWidget(boss, prefix + "subToggleButton", "", kSubtitleToggle, 0);
@@ -537,7 +537,7 @@ void OptionsDialog::addSubtitleControls(GuiObject *boss, String prefix, int maxS
_enableSubtitleSettings = true;
}
-void OptionsDialog::addVolumeControls(GuiObject *boss, String prefix) {
+void OptionsDialog::addVolumeControls(GuiObject *boss, const String &prefix) {
// Volume controllers
_musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", "Music volume:");
@@ -703,7 +703,7 @@ void GlobalOptionsDialog::close() {
// Savepath
ConfMan.set("savepath", _savePath->getLabel(), _domain);
- String extraPath = _extraPath->getLabel();
+ String extraPath(_extraPath->getLabel());
if (!extraPath.empty() && (extraPath != "None"))
ConfMan.set("extrapath", extraPath, _domain);
}
diff --git a/gui/options.h b/gui/options.h
index aca2f39a47..2fe38b2ba0 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -41,7 +41,7 @@ class OptionsDialog : public Dialog {
typedef Common::String String;
public:
OptionsDialog(const String &domain, int x, int y, int w, int h);
- OptionsDialog(const String &domain, String name);
+ OptionsDialog(const String &domain, const String &name);
void init();
@@ -62,13 +62,13 @@ protected:
ButtonWidget *_soundFontButton;
StaticTextWidget *_soundFont;
- void addGraphicControls(GuiObject *boss, String prefix);
- void addAudioControls(GuiObject *boss, String prefix);
- void addMIDIControls(GuiObject *boss, String prefix);
- void addVolumeControls(GuiObject *boss, String prefix);
+ void addGraphicControls(GuiObject *boss, const String &prefix);
+ void addAudioControls(GuiObject *boss, const String &prefix);
+ void addMIDIControls(GuiObject *boss, const String &prefix);
+ void addVolumeControls(GuiObject *boss, const String &prefix);
// The default value is the launcher's non-scaled talkspeed value. When SCUMM uses the widget,
// it uses its own scale
- void addSubtitleControls(GuiObject *boss, String prefix, int maxSliderVal = 255);
+ void addSubtitleControls(GuiObject *boss, const String &prefix, int maxSliderVal = 255);
void setGraphicSettingsState(bool enabled);
void setAudioSettingsState(bool enabled);
diff --git a/gui/theme-config.cpp b/gui/theme-config.cpp
index fbc0575f89..2e69d6da1b 100644
--- a/gui/theme-config.cpp
+++ b/gui/theme-config.cpp
@@ -407,7 +407,7 @@ const char *Theme::_defaultConfigINI =
using Common::String;
-void Theme::processSingleLine(const String &section, const String prefix, const String name, const String str) {
+void Theme::processSingleLine(const String &section, const String &prefix, const String &name, const String &str) {
int level = 0;
int start = 0;
uint i;
@@ -470,7 +470,7 @@ void Theme::processSingleLine(const String &section, const String prefix, const
}
-void Theme::processResSection(Common::ConfigFile &config, String name, bool skipDefs, const String prefix) {
+void Theme::processResSection(Common::ConfigFile &config, const String &name, bool skipDefs, const String &prefix) {
debug(3, "Reading section: [%s]", name.c_str());
const Common::ConfigFile::SectionKeyList &keys = config.getKeys(name);
@@ -509,13 +509,12 @@ void Theme::processResSection(Common::ConfigFile &config, String name, bool skip
if (iterk->key == "useWithPrefix") {
const char *temp = iterk->value.c_str();
const char *pos = strrchr(temp, ' ');
- String n, pref;
if (pos == NULL)
error("2 arguments required for useWithPrefix keyword");
- n = String(temp, strchr(temp, ' ') - temp);
- pref = String(pos + 1);
+ String n(temp, strchr(temp, ' ') - temp);
+ String pref(pos + 1);
if (n == name)
error("Theme section [%s]: cannot use itself", n.c_str());
@@ -528,15 +527,13 @@ void Theme::processResSection(Common::ConfigFile &config, String name, bool skip
}
}
-void Theme::setSpecialAlias(const String alias, const String &name) {
+void Theme::setSpecialAlias(const String &alias, const String &name) {
const char *postfixes[] = {".x", ".y", ".w", ".h", ".x2", ".y2"};
int i;
for (i = 0; i < ARRAYSIZE(postfixes); i++) {
- String from, to;
-
- from = alias + postfixes[i];
- to = name + postfixes[i];
+ String from(alias + postfixes[i]);
+ String to(name + postfixes[i]);
_evaluator->setAlias(from.c_str(), to);
}
diff --git a/gui/theme.h b/gui/theme.h
index fd59fdef2a..5b4d0c6234 100644
--- a/gui/theme.h
+++ b/gui/theme.h
@@ -186,9 +186,9 @@ public:
return kTextAlignCenter;
}
- void processResSection(Common::ConfigFile &config, String name, bool skipDefs = false, const String prefix = "");
- void processSingleLine(const String &section, const String prefix, const String name, const String str);
- void setSpecialAlias(const String alias, const String &name);
+ void processResSection(Common::ConfigFile &config, const String &name, bool skipDefs = false, const String &prefix = "");
+ void processSingleLine(const String &section, const String &prefix, const String &name, const String &str);
+ void setSpecialAlias(const String &alias, const String &name);
bool isThemeLoadingRequired();
bool sectionIsSkipped(Common::ConfigFile &config, const char *name, int w, int h);
@@ -288,7 +288,7 @@ private:
class ThemeNew : public Theme {
typedef Common::String String;
public:
- ThemeNew(OSystem *system, String stylefile);
+ ThemeNew(OSystem *system, const String &stylefile);
virtual ~ThemeNew();
bool init();
@@ -390,7 +390,7 @@ private:
const Graphics::Font *_fonts[kFontStyleMax];
private:
- void setupFont(String key, String name, kFontStyle style);
+ void setupFont(const String &key, const String &name, kFontStyle style);
public:
enum kImageHandles {
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 7a03be033e..38e8cfb322 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -35,7 +35,7 @@ Widget::Widget(GuiObject *boss, int x, int y, int w, int h)
init();
}
-Widget::Widget(GuiObject *boss, String name)
+Widget::Widget(GuiObject *boss, const String &name)
: GuiObject(name), _type(0), _boss(boss),
_id(0), _flags(0), _hints(THEME_HINT_FIRST_DRAW), _hasFocus(false) {
init();
@@ -148,7 +148,7 @@ StaticTextWidget::StaticTextWidget(GuiObject *boss, int x, int y, int w, int h,
_label = text;
}
-StaticTextWidget::StaticTextWidget(GuiObject *boss, String name, const String &text)
+StaticTextWidget::StaticTextWidget(GuiObject *boss, const String &name, const String &text)
: Widget(boss, name) {
_flags = WIDGET_ENABLED;
_type = kStaticTextWidget;
@@ -197,7 +197,7 @@ ButtonWidget::ButtonWidget(GuiObject *boss, int x, int y, int w, int h, const St
_type = kButtonWidget;
}
-ButtonWidget::ButtonWidget(GuiObject *boss, String name, const String &label, uint32 cmd, uint8 hotkey)
+ButtonWidget::ButtonWidget(GuiObject *boss, const String &name, const String &label, uint32 cmd, uint8 hotkey)
: StaticTextWidget(boss, name, label), CommandSender(boss),
_cmd(cmd), _hotkey(hotkey) {
_flags = WIDGET_ENABLED/* | WIDGET_BORDER*/ | WIDGET_CLEARBG;
@@ -221,7 +221,7 @@ CheckboxWidget::CheckboxWidget(GuiObject *boss, int x, int y, int w, int h, cons
_type = kCheckboxWidget;
}
-CheckboxWidget::CheckboxWidget(GuiObject *boss, String name, const String &label, uint32 cmd, uint8 hotkey)
+CheckboxWidget::CheckboxWidget(GuiObject *boss, const String &name, const String &label, uint32 cmd, uint8 hotkey)
: ButtonWidget(boss, name, label, cmd, hotkey), _state(false) {
_flags = WIDGET_ENABLED;
_type = kCheckboxWidget;
@@ -256,7 +256,7 @@ SliderWidget::SliderWidget(GuiObject *boss, int x, int y, int w, int h, uint32 c
_type = kSliderWidget;
}
-SliderWidget::SliderWidget(GuiObject *boss, String name, uint32 cmd)
+SliderWidget::SliderWidget(GuiObject *boss, const String &name, uint32 cmd)
: Widget(boss, name), CommandSender(boss),
_cmd(cmd), _value(0), _oldValue(0), _valueMin(0), _valueMax(100), _isDragging(false) {
_flags = WIDGET_ENABLED | WIDGET_TRACK_MOUSE | WIDGET_CLEARBG;
@@ -318,7 +318,7 @@ GraphicsWidget::GraphicsWidget(GuiObject *boss, int x, int y, int w, int h)
_hints &= ~THEME_HINT_SAVE_BACKGROUND;
}
-GraphicsWidget::GraphicsWidget(GuiObject *boss, String name)
+GraphicsWidget::GraphicsWidget(GuiObject *boss, const String &name)
: Widget(boss, name), _gfx(), _alpha(256), _transparency(false) {
_flags = WIDGET_ENABLED | WIDGET_CLEARBG;
_type = kGraphicsWidget;
@@ -375,7 +375,7 @@ ContainerWidget::ContainerWidget(GuiObject *boss, int x, int y, int w, int h) :
_type = kContainerWidget;
}
-ContainerWidget::ContainerWidget(GuiObject *boss, String name) : Widget(boss, name) {
+ContainerWidget::ContainerWidget(GuiObject *boss, const String &name) : Widget(boss, name) {
_flags = WIDGET_ENABLED | WIDGET_CLEARBG;
_type = kContainerWidget;
}
diff --git a/gui/widget.h b/gui/widget.h
index 0023bca9d5..436098bf42 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -103,7 +103,7 @@ public:
public:
Widget(GuiObject *boss, int x, int y, int w, int h);
- Widget(GuiObject *boss, Common::String name);
+ Widget(GuiObject *boss, const Common::String &name);
virtual ~Widget();
void init();
@@ -171,7 +171,7 @@ protected:
TextAlignment _align;
public:
StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, TextAlignment align);
- StaticTextWidget(GuiObject *boss, String name, const String &text);
+ StaticTextWidget(GuiObject *boss, const String &name, const String &text);
void setValue(int value);
void setLabel(const String &label);
const String &getLabel() const { return _label; }
@@ -190,7 +190,7 @@ protected:
uint8 _hotkey;
public:
ButtonWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint32 cmd = 0, uint8 hotkey = 0);
- ButtonWidget(GuiObject *boss, String name, const String &label, uint32 cmd = 0, uint8 hotkey = 0);
+ ButtonWidget(GuiObject *boss, const String &name, const String &label, uint32 cmd = 0, uint8 hotkey = 0);
void setCmd(uint32 cmd) { _cmd = cmd; }
uint32 getCmd() const { return _cmd; }
@@ -209,7 +209,7 @@ protected:
bool _state;
public:
CheckboxWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint32 cmd = 0, uint8 hotkey = 0);
- CheckboxWidget(GuiObject *boss, String name, const String &label, uint32 cmd = 0, uint8 hotkey = 0);
+ CheckboxWidget(GuiObject *boss, const String &name, const String &label, uint32 cmd = 0, uint8 hotkey = 0);
void handleMouseUp(int x, int y, int button, int clickCount);
virtual void handleMouseEntered(int button) { setFlags(WIDGET_HILITED); draw(); }
@@ -233,7 +233,7 @@ protected:
uint _labelWidth;
public:
SliderWidget(GuiObject *boss, int x, int y, int w, int h, uint32 cmd = 0);
- SliderWidget(GuiObject *boss, Common::String name, uint32 cmd = 0);
+ SliderWidget(GuiObject *boss, const Common::String &name, uint32 cmd = 0);
void setCmd(uint32 cmd) { _cmd = cmd; }
uint32 getCmd() const { return _cmd; }
@@ -263,7 +263,7 @@ protected:
class GraphicsWidget : public Widget {
public:
GraphicsWidget(GuiObject *boss, int x, int y, int w, int h);
- GraphicsWidget(GuiObject *boss, Common::String name);
+ GraphicsWidget(GuiObject *boss, const Common::String &name);
~GraphicsWidget();
void setGfx(const Graphics::Surface *gfx);
@@ -284,7 +284,7 @@ protected:
class ContainerWidget : public Widget {
public:
ContainerWidget(GuiObject *boss, int x, int y, int w, int h);
- ContainerWidget(GuiObject *boss, Common::String name);
+ ContainerWidget(GuiObject *boss, const Common::String &name);
protected:
void drawWidget(bool hilite);