diff options
Diffstat (limited to 'engines/wintermute/ui')
-rw-r--r-- | engines/wintermute/ui/ui_button.cpp | 12 | ||||
-rw-r--r-- | engines/wintermute/ui/ui_button.h | 2 | ||||
-rw-r--r-- | engines/wintermute/ui/ui_edit.cpp | 18 | ||||
-rw-r--r-- | engines/wintermute/ui/ui_edit.h | 2 | ||||
-rw-r--r-- | engines/wintermute/ui/ui_entity.cpp | 6 | ||||
-rw-r--r-- | engines/wintermute/ui/ui_entity.h | 2 | ||||
-rw-r--r-- | engines/wintermute/ui/ui_object.cpp | 24 | ||||
-rw-r--r-- | engines/wintermute/ui/ui_object.h | 2 | ||||
-rw-r--r-- | engines/wintermute/ui/ui_text.cpp | 8 | ||||
-rw-r--r-- | engines/wintermute/ui/ui_text.h | 2 | ||||
-rw-r--r-- | engines/wintermute/ui/ui_window.cpp | 22 | ||||
-rw-r--r-- | engines/wintermute/ui/ui_window.h | 2 |
12 files changed, 51 insertions, 51 deletions
diff --git a/engines/wintermute/ui/ui_button.cpp b/engines/wintermute/ui/ui_button.cpp index d4acd3019f..7967d566f9 100644 --- a/engines/wintermute/ui/ui_button.cpp +++ b/engines/wintermute/ui/ui_button.cpp @@ -1082,13 +1082,13 @@ bool UIButton::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack ////////////////////////////////////////////////////////////////////////// -ScValue *UIButton::scGetProperty(const char *name) { +ScValue *UIButton::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Type ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Type") == 0) { + if (name == "Type") { _scValue->setString("button"); return _scValue; } @@ -1096,7 +1096,7 @@ ScValue *UIButton::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // TextAlign ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "TextAlign") == 0) { + else if (name == "TextAlign") { _scValue->setInt(_align); return _scValue; } @@ -1104,21 +1104,21 @@ ScValue *UIButton::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Focusable ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Focusable") == 0) { + else if (name == "Focusable") { _scValue->setBool(_canFocus); return _scValue; } ////////////////////////////////////////////////////////////////////////// // Pressed ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Pressed") == 0) { + else if (name == "Pressed") { _scValue->setBool(_stayPressed); return _scValue; } ////////////////////////////////////////////////////////////////////////// // PixelPerfect ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "PixelPerfect") == 0) { + else if (name == "PixelPerfect") { _scValue->setBool(_pixelPerfect); return _scValue; } else { diff --git a/engines/wintermute/ui/ui_button.h b/engines/wintermute/ui/ui_button.h index 9342f766cc..93333a2534 100644 --- a/engines/wintermute/ui/ui_button.h +++ b/engines/wintermute/ui/ui_button.h @@ -69,7 +69,7 @@ public: virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent); // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); diff --git a/engines/wintermute/ui/ui_edit.cpp b/engines/wintermute/ui/ui_edit.cpp index 1352a0d942..a3283d5a01 100644 --- a/engines/wintermute/ui/ui_edit.cpp +++ b/engines/wintermute/ui/ui_edit.cpp @@ -398,13 +398,13 @@ bool UIEdit::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, ////////////////////////////////////////////////////////////////////////// -ScValue *UIEdit::scGetProperty(const char *name) { +ScValue *UIEdit::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Type ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Type") == 0) { + if (name == "Type") { _scValue->setString("editor"); return _scValue; } @@ -412,7 +412,7 @@ ScValue *UIEdit::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // SelStart ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "SelStart") == 0) { + else if (name == "SelStart") { _scValue->setInt(_selStart); return _scValue; } @@ -420,7 +420,7 @@ ScValue *UIEdit::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // SelEnd ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "SelEnd") == 0) { + else if (name == "SelEnd") { _scValue->setInt(_selEnd); return _scValue; } @@ -428,7 +428,7 @@ ScValue *UIEdit::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // CursorBlinkRate ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "CursorBlinkRate") == 0) { + else if (name == "CursorBlinkRate") { _scValue->setInt(_cursorBlinkRate); return _scValue; } @@ -436,7 +436,7 @@ ScValue *UIEdit::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // CursorChar ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "CursorChar") == 0) { + else if (name == "CursorChar") { _scValue->setString(_cursorChar); return _scValue; } @@ -444,7 +444,7 @@ ScValue *UIEdit::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // FrameWidth ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "FrameWidth") == 0) { + else if (name == "FrameWidth") { _scValue->setInt(_frameWidth); return _scValue; } @@ -452,7 +452,7 @@ ScValue *UIEdit::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // MaxLength ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "MaxLength") == 0) { + else if (name == "MaxLength") { _scValue->setInt(_maxLength); return _scValue; } @@ -460,7 +460,7 @@ ScValue *UIEdit::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Text ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Text") == 0) { + else if (name == "Text") { if (_gameRef->_textEncoding == TEXT_UTF8) { WideString wstr = StringUtil::ansiToWide(_text); _scValue->setString(StringUtil::wideToUtf8(wstr).c_str()); diff --git a/engines/wintermute/ui/ui_edit.h b/engines/wintermute/ui/ui_edit.h index 610629afb3..5bb31422b6 100644 --- a/engines/wintermute/ui/ui_edit.h +++ b/engines/wintermute/ui/ui_edit.h @@ -61,7 +61,7 @@ public: virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent); // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); diff --git a/engines/wintermute/ui/ui_entity.cpp b/engines/wintermute/ui/ui_entity.cpp index c49cb5a240..1cb4e0926b 100644 --- a/engines/wintermute/ui/ui_entity.cpp +++ b/engines/wintermute/ui/ui_entity.cpp @@ -305,13 +305,13 @@ bool UIEntity::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack ////////////////////////////////////////////////////////////////////////// -ScValue *UIEntity::scGetProperty(const char *name) { +ScValue *UIEntity::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Type ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Type") == 0) { + if (name == "Type") { _scValue->setString("entity container"); return _scValue; } @@ -319,7 +319,7 @@ ScValue *UIEntity::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Freezable ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Freezable") == 0) { + else if (name == "Freezable") { if (_entity) { _scValue->setBool(_entity->_freezable); } else { diff --git a/engines/wintermute/ui/ui_entity.h b/engines/wintermute/ui/ui_entity.h index 3bf8068fd5..b5f4450071 100644 --- a/engines/wintermute/ui/ui_entity.h +++ b/engines/wintermute/ui/ui_entity.h @@ -48,7 +48,7 @@ public: bool setEntity(const char *filename); // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); diff --git a/engines/wintermute/ui/ui_object.cpp b/engines/wintermute/ui/ui_object.cpp index 772561247d..8e5bae993c 100644 --- a/engines/wintermute/ui/ui_object.cpp +++ b/engines/wintermute/ui/ui_object.cpp @@ -360,13 +360,13 @@ bool UIObject::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack ////////////////////////////////////////////////////////////////////////// -ScValue *UIObject::scGetProperty(const char *name) { +ScValue *UIObject::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Type ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Type") == 0) { + if (name == "Type") { _scValue->setString("ui_object"); return _scValue; } @@ -374,7 +374,7 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Name ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Name") == 0) { + else if (name == "Name") { _scValue->setString(getName()); return _scValue; } @@ -382,7 +382,7 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Parent (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Parent") == 0) { + else if (name == "Parent") { _scValue->setNative(_parent, true); return _scValue; } @@ -390,7 +390,7 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // ParentNotify ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "ParentNotify") == 0) { + else if (name == "ParentNotify") { _scValue->setBool(_parentNotify); return _scValue; } @@ -398,7 +398,7 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Width ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Width") == 0) { + else if (name == "Width") { _scValue->setInt(_width); return _scValue; } @@ -406,7 +406,7 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Height ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Height") == 0) { + else if (name == "Height") { _scValue->setInt(_height); return _scValue; } @@ -414,7 +414,7 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Visible ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Visible") == 0) { + else if (name == "Visible") { _scValue->setBool(_visible); return _scValue; } @@ -422,7 +422,7 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Disabled ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Disabled") == 0) { + else if (name == "Disabled") { _scValue->setBool(_disable); return _scValue; } @@ -430,7 +430,7 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Text ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Text") == 0) { + else if (name == "Text") { _scValue->setString(_text); return _scValue; } @@ -438,13 +438,13 @@ ScValue *UIObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // NextSibling (RO) / PrevSibling (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "NextSibling") == 0 || strcmp(name, "PrevSibling") == 0) { + else if (name == "NextSibling" || name == "PrevSibling") { _scValue->setNULL(); if (_parent && _parent->_type == UI_WINDOW) { UIWindow *win = (UIWindow *)_parent; for (uint32 i = 0; i < win->_widgets.size(); i++) { if (win->_widgets[i] == this) { - if (strcmp(name, "NextSibling") == 0) { + if (name == "NextSibling") { if (i < win->_widgets.size() - 1) { _scValue->setNative(win->_widgets[i + 1], true); } diff --git a/engines/wintermute/ui/ui_object.h b/engines/wintermute/ui/ui_object.h index 81c025d33b..ec2ea33de1 100644 --- a/engines/wintermute/ui/ui_object.h +++ b/engines/wintermute/ui/ui_object.h @@ -74,7 +74,7 @@ public: virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent); // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); diff --git a/engines/wintermute/ui/ui_text.cpp b/engines/wintermute/ui/ui_text.cpp index 1844b640d0..2c10f176c7 100644 --- a/engines/wintermute/ui/ui_text.cpp +++ b/engines/wintermute/ui/ui_text.cpp @@ -431,13 +431,13 @@ bool UIText::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, ////////////////////////////////////////////////////////////////////////// -ScValue *UIText::scGetProperty(const char *name) { +ScValue *UIText::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Type ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Type") == 0) { + if (name == "Type") { _scValue->setString("static"); return _scValue; } @@ -445,7 +445,7 @@ ScValue *UIText::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // TextAlign ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "TextAlign") == 0) { + else if (name == "TextAlign") { _scValue->setInt(_textAlign); return _scValue; } @@ -453,7 +453,7 @@ ScValue *UIText::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // VerticalAlign ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "VerticalAlign") == 0) { + else if (name == "VerticalAlign") { _scValue->setInt(_verticalAlign); return _scValue; } else { diff --git a/engines/wintermute/ui/ui_text.h b/engines/wintermute/ui/ui_text.h index d2f116b44b..da4d113500 100644 --- a/engines/wintermute/ui/ui_text.h +++ b/engines/wintermute/ui/ui_text.h @@ -49,7 +49,7 @@ public: virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent); // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); diff --git a/engines/wintermute/ui/ui_window.cpp b/engines/wintermute/ui/ui_window.cpp index 1f652bf64d..9606486efb 100644 --- a/engines/wintermute/ui/ui_window.cpp +++ b/engines/wintermute/ui/ui_window.cpp @@ -1014,13 +1014,13 @@ bool UIWindow::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack ////////////////////////////////////////////////////////////////////////// -ScValue *UIWindow::scGetProperty(const char *name) { +ScValue *UIWindow::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Type ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Type") == 0) { + if (name == "Type") { _scValue->setString("window"); return _scValue; } @@ -1028,7 +1028,7 @@ ScValue *UIWindow::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // NumWidgets / NumControls (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "NumWidgets") == 0 || strcmp(name, "NumControls") == 0) { + else if (name == "NumWidgets" || name == "NumControls") { _scValue->setInt(_widgets.size()); return _scValue; } @@ -1036,7 +1036,7 @@ ScValue *UIWindow::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Exclusive ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Exclusive") == 0) { + else if (name == "Exclusive") { _scValue->setBool(_mode == WINDOW_EXCLUSIVE); return _scValue; } @@ -1044,7 +1044,7 @@ ScValue *UIWindow::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // SystemExclusive ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "SystemExclusive") == 0) { + else if (name == "SystemExclusive") { _scValue->setBool(_mode == WINDOW_SYSTEM_EXCLUSIVE); return _scValue; } @@ -1052,7 +1052,7 @@ ScValue *UIWindow::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Menu ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Menu") == 0) { + else if (name == "Menu") { _scValue->setBool(_isMenu); return _scValue; } @@ -1060,7 +1060,7 @@ ScValue *UIWindow::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // InGame ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "InGame") == 0) { + else if (name == "InGame") { _scValue->setBool(_inGame); return _scValue; } @@ -1068,7 +1068,7 @@ ScValue *UIWindow::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // PauseMusic ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "PauseMusic") == 0) { + else if (name == "PauseMusic") { _scValue->setBool(_pauseMusic); return _scValue; } @@ -1076,7 +1076,7 @@ ScValue *UIWindow::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // ClipContents ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "ClipContents") == 0) { + else if (name == "ClipContents") { _scValue->setBool(_clipContents); return _scValue; } @@ -1084,7 +1084,7 @@ ScValue *UIWindow::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Transparent ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Transparent") == 0) { + else if (name == "Transparent") { _scValue->setBool(_transparent); return _scValue; } @@ -1092,7 +1092,7 @@ ScValue *UIWindow::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // FadeColor ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "FadeColor") == 0) { + else if (name == "FadeColor") { _scValue->setInt((int)_fadeColor); return _scValue; } else { diff --git a/engines/wintermute/ui/ui_window.h b/engines/wintermute/ui/ui_window.h index cbd417a7d9..ae035c65c7 100644 --- a/engines/wintermute/ui/ui_window.h +++ b/engines/wintermute/ui/ui_window.h @@ -83,7 +83,7 @@ public: virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent); // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); |