mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 12:44:02 +00:00
Finished legacy API cleanup. Removed all legacy code.
Possible regressions. svn-id: r33833
This commit is contained in:
parent
1d9f98d121
commit
2b52383534
@ -248,19 +248,19 @@ enum {
|
||||
|
||||
|
||||
SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel, Parallaction_ns *engine)
|
||||
: Dialog("scummsaveload"), _list(0), _chooseButton(0), _gfxWidget(0), _vm(engine) {
|
||||
: Dialog("ScummSaveLoad"), _list(0), _chooseButton(0), _gfxWidget(0), _vm(engine) {
|
||||
|
||||
// _drawingHints |= GUI::THEME_HINT_SPECIAL_COLOR;
|
||||
_backgroundType = GUI::Theme::kDialogBackgroundSpecial;
|
||||
|
||||
new GUI::StaticTextWidget(this, "scummsaveload_title", title);
|
||||
new GUI::StaticTextWidget(this, "ScummSaveLoad.Title", title);
|
||||
|
||||
// Add choice list
|
||||
_list = new GUI::ListWidget(this, "scummsaveload_list");
|
||||
_list = new GUI::ListWidget(this, "ScummSaveLoad.List");
|
||||
_list->setEditable(true);
|
||||
_list->setNumberingMode(GUI::kListNumberingOne);
|
||||
|
||||
_container = new GUI::ContainerWidget(this, 0, 0, 10, 10);
|
||||
_container->setHints(GUI::THEME_HINT_USE_SHADOW);
|
||||
|
||||
_gfxWidget = new GUI::GraphicsWidget(this, 0, 0, 10, 10);
|
||||
|
||||
@ -269,8 +269,8 @@ SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel,
|
||||
_playtime = new GUI::StaticTextWidget(this, 0, 0, 10, 10, "No playtime saved", GUI::kTextAlignCenter);
|
||||
|
||||
// Buttons
|
||||
new GUI::ButtonWidget(this, "scummsaveload_cancel", "Cancel", GUI::kCloseCmd, 0);
|
||||
_chooseButton = new GUI::ButtonWidget(this, "scummsaveload_choose", buttonLabel, kChooseCmd, 0);
|
||||
new GUI::ButtonWidget(this, "ScummSaveLoad.Cancel", "Cancel", GUI::kCloseCmd, 0);
|
||||
_chooseButton = new GUI::ButtonWidget(this, "ScummSaveLoad.Choose", buttonLabel, kChooseCmd, 0);
|
||||
_chooseButton->setEnabled(false);
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
#endif
|
||||
|
||||
#include "gui/about.h"
|
||||
#include "gui/eval.h"
|
||||
#include "gui/theme.h"
|
||||
#include "gui/newgui.h"
|
||||
#include "gui/ListWidget.h"
|
||||
#include "gui/ThemeEval.h"
|
||||
@ -213,9 +213,8 @@ static const ResString string_map_table_v345[] = {
|
||||
|
||||
#pragma mark -
|
||||
|
||||
ScummDialog::ScummDialog(String name)
|
||||
: GUI::Dialog(name) {
|
||||
_drawingHints |= GUI::THEME_HINT_SPECIAL_COLOR;
|
||||
ScummDialog::ScummDialog(String name) : GUI::Dialog(name) {
|
||||
_backgroundType = GUI::Theme::kDialogBackgroundSpecial;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
@ -235,8 +234,8 @@ enum {
|
||||
|
||||
SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel, bool saveMode, ScummEngine *engine)
|
||||
: Dialog("ScummSaveLoad"), _saveMode(saveMode), _list(0), _chooseButton(0), _gfxWidget(0), _vm(engine) {
|
||||
|
||||
_drawingHints |= GUI::THEME_HINT_SPECIAL_COLOR;
|
||||
|
||||
_backgroundType = GUI::Theme::kDialogBackgroundSpecial;
|
||||
|
||||
new StaticTextWidget(this, "ScummSaveLoad.Title", title);
|
||||
|
||||
@ -246,8 +245,6 @@ SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel,
|
||||
_list->setNumberingMode(saveMode ? GUI::kListNumberingOne : GUI::kListNumberingZero);
|
||||
|
||||
_container = new GUI::ContainerWidget(this, 0, 0, 10, 10);
|
||||
_container->setHints(GUI::THEME_HINT_USE_SHADOW);
|
||||
|
||||
_gfxWidget = new GUI::GraphicsWidget(this, 0, 0, 10, 10);
|
||||
|
||||
_date = new StaticTextWidget(this, 0, 0, 10, 10, "No date saved", kTextAlignCenter);
|
||||
@ -667,8 +664,6 @@ HelpDialog::HelpDialog(const GameSettings &game)
|
||||
void HelpDialog::reflowLayout() {
|
||||
ScummDialog::reflowLayout();
|
||||
|
||||
_drawingHints &= ~GUI::THEME_HINT_SPECIAL_COLOR;
|
||||
|
||||
int lineHeight = g_gui.getFontHeight();
|
||||
int16 x, y;
|
||||
uint16 w, h;
|
||||
@ -853,7 +848,7 @@ void ConfirmDialog::handleKeyDown(Common::KeyState state) {
|
||||
|
||||
ValueDisplayDialog::ValueDisplayDialog(const Common::String& label, int minVal, int maxVal,
|
||||
int val, uint16 incKey, uint16 decKey)
|
||||
: GUI::Dialog("scummDummyDialog", false),
|
||||
: GUI::Dialog("scummDummyDialog"),
|
||||
_label(label), _min(minVal), _max(maxVal),
|
||||
_value(val), _incKey(incKey), _decKey(decKey) {
|
||||
assert(_min <= _value && _value <= _max);
|
||||
@ -861,8 +856,7 @@ ValueDisplayDialog::ValueDisplayDialog(const Common::String& label, int minVal,
|
||||
|
||||
void ValueDisplayDialog::drawDialog() {
|
||||
const int labelWidth = _w - 8 - _percentBarWidth;
|
||||
g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x+_w, _y+_h),
|
||||
GUI::THEME_HINT_SAVE_BACKGROUND | GUI::THEME_HINT_FIRST_DRAW);
|
||||
g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x+_w, _y+_h), GUI::Theme::kDialogBackgroundDefault);
|
||||
g_gui.theme()->drawText(Common::Rect(_x+4, _y+4, _x+labelWidth+4,
|
||||
_y+g_gui.theme()->getFontHeight()+4), _label);
|
||||
g_gui.theme()->drawSlider(Common::Rect(_x+4+labelWidth, _y+4, _x+_w-4, _y+_h-4),
|
||||
|
@ -24,7 +24,6 @@
|
||||
|
||||
#include "gui/EditTextWidget.h"
|
||||
#include "gui/dialog.h"
|
||||
#include "gui/eval.h"
|
||||
#include "gui/newgui.h"
|
||||
|
||||
#include "gui/ThemeEval.h"
|
||||
@ -43,7 +42,6 @@ EditTextWidget::EditTextWidget(GuiObject *boss, const String &name, const String
|
||||
: EditableWidget(boss, name) {
|
||||
setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE);
|
||||
_type = kEditTextWidget;
|
||||
_hints |= THEME_HINT_USE_SHADOW;
|
||||
|
||||
setEditString(text);
|
||||
}
|
||||
@ -84,7 +82,7 @@ void EditTextWidget::handleMouseDown(int x, int y, int button, int clickCount) {
|
||||
|
||||
|
||||
void EditTextWidget::drawWidget() {
|
||||
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x+_w, _y+_h), _hints, Theme::kWidgetBackgroundEditText);
|
||||
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x+_w, _y+_h), 0, Theme::kWidgetBackgroundEditText);
|
||||
|
||||
// Draw the text
|
||||
adjustOffset();
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "gui/ListWidget.h"
|
||||
#include "gui/ScrollBarWidget.h"
|
||||
#include "gui/dialog.h"
|
||||
#include "gui/eval.h"
|
||||
#include "gui/newgui.h"
|
||||
|
||||
#include "gui/ThemeEval.h"
|
||||
@ -47,7 +46,6 @@ ListWidget::ListWidget(GuiObject *boss, const String &name)
|
||||
_scrollBar->setTarget(this);
|
||||
|
||||
setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE);
|
||||
setHints(THEME_HINT_SAVE_BACKGROUND | THEME_HINT_USE_SHADOW);
|
||||
_type = kListWidget;
|
||||
_editMode = false;
|
||||
_numberingMode = kListNumberingOne;
|
||||
@ -77,7 +75,6 @@ ListWidget::ListWidget(GuiObject *boss, int x, int y, int w, int h)
|
||||
_scrollBar->setTarget(this);
|
||||
|
||||
setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE);
|
||||
setHints(THEME_HINT_SAVE_BACKGROUND | THEME_HINT_USE_SHADOW);
|
||||
_type = kListWidget;
|
||||
_editMode = false;
|
||||
_numberingMode = kListNumberingOne;
|
||||
@ -363,7 +360,7 @@ void ListWidget::drawWidget() {
|
||||
Common::String buffer;
|
||||
|
||||
// Draw a thin frame around the list.
|
||||
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), _hints, Theme::kWidgetBackgroundBorder);
|
||||
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), 0, Theme::kWidgetBackgroundBorder);
|
||||
const int scrollbarW = (_scrollBar && _scrollBar->isVisible()) ? _scrollBarWidth : 0;
|
||||
|
||||
// Draw the list items
|
||||
@ -378,7 +375,7 @@ void ListWidget::drawWidget() {
|
||||
inverted = true;
|
||||
else
|
||||
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, y - 1, _x + _w - 1, y + fontHeight - 1),
|
||||
_hints, Theme::kWidgetBackgroundBorderSmall);
|
||||
0, Theme::kWidgetBackgroundBorderSmall);
|
||||
}
|
||||
|
||||
Common::Rect r(getEditRect());
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "common/system.h"
|
||||
#include "common/events.h"
|
||||
#include "gui/dialog.h"
|
||||
#include "gui/eval.h"
|
||||
#include "gui/newgui.h"
|
||||
#include "gui/PopUpWidget.h"
|
||||
#include "engines/engine.h"
|
||||
@ -73,7 +72,7 @@ protected:
|
||||
};
|
||||
|
||||
PopUpDialog::PopUpDialog(PopUpWidget *boss, int clickX, int clickY)
|
||||
: Dialog(0, 0, 16, 16, false),
|
||||
: Dialog(0, 0, 16, 16),
|
||||
_popUpBoss(boss) {
|
||||
|
||||
// Copy the selection index
|
||||
@ -153,7 +152,7 @@ PopUpDialog::PopUpDialog(PopUpWidget *boss, int clickX, int clickY)
|
||||
|
||||
void PopUpDialog::drawDialog() {
|
||||
// Draw the menu border
|
||||
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x+_w, _y+_h), THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND | THEME_HINT_USE_SHADOW);
|
||||
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x+_w, _y+_h), 0);
|
||||
|
||||
/*if (_twoColumns)
|
||||
g_gui.vLine(_x + _w / 2, _y, _y + _h - 2, g_gui._color);*/
|
||||
@ -360,7 +359,6 @@ void PopUpDialog::drawMenuEntry(int entry, bool hilite) {
|
||||
PopUpWidget::PopUpWidget(GuiObject *boss, const String &name, const String &label, uint labelWidth)
|
||||
: Widget(boss, name), CommandSender(boss), _label(label), _labelWidth(labelWidth) {
|
||||
setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS);
|
||||
setHints(THEME_HINT_SAVE_BACKGROUND);
|
||||
_type = kPopUpWidget;
|
||||
|
||||
_selectedItem = -1;
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "gui/TabWidget.h"
|
||||
#include "gui/dialog.h"
|
||||
#include "gui/newgui.h"
|
||||
#include "gui/eval.h"
|
||||
|
||||
#include "gui/ThemeEval.h"
|
||||
|
||||
@ -69,9 +68,7 @@ void TabWidget::init() {
|
||||
int x = _w - _butRP - _butW * 2 - 2;
|
||||
int y = _butTP - _tabHeight;
|
||||
_navLeft = new ButtonWidget(this, x, y, _butW, _butH, "<", kCmdLeft, 0);
|
||||
_navLeft->setHints(THEME_HINT_NO_BACKGROUND_RESTORE);
|
||||
_navRight = new ButtonWidget(this, x + _butW + 2, y, _butW, _butH, ">", kCmdRight, 0);
|
||||
_navRight->setHints(THEME_HINT_NO_BACKGROUND_RESTORE);
|
||||
}
|
||||
|
||||
TabWidget::~TabWidget() {
|
||||
@ -256,7 +253,7 @@ void TabWidget::drawWidget() {
|
||||
for (int i = _firstVisibleTab; i < (int)_tabs.size(); ++i) {
|
||||
tabs.push_back(_tabs[i].title);
|
||||
}
|
||||
g_gui.theme()->drawTab(Common::Rect(_x, _y, _x+_w, _y+_h), _tabHeight, _tabWidth, tabs, _activeTab - _firstVisibleTab, _hints, _titleVPad);
|
||||
g_gui.theme()->drawTab(Common::Rect(_x, _y, _x+_w, _y+_h), _tabHeight, _tabWidth, tabs, _activeTab - _firstVisibleTab, 0, _titleVPad);
|
||||
}
|
||||
|
||||
void TabWidget::draw() {
|
||||
|
@ -1,710 +0,0 @@
|
||||
/* 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$
|
||||
*/
|
||||
|
||||
#include "gui/ThemeClassic.h"
|
||||
#include "gui/eval.h"
|
||||
|
||||
namespace GUI {
|
||||
ThemeClassic::ThemeClassic(OSystem *system, const Common::String &config, const Common::ConfigFile *cfg) : Theme() {
|
||||
_enableBlending = true;
|
||||
_stylefile = config;
|
||||
_system = system;
|
||||
_initOk = false;
|
||||
_enabled = false;
|
||||
_font = 0;
|
||||
_fontName.clear();
|
||||
memset(&_screen, 0, sizeof(_screen));
|
||||
#ifndef CT_NO_TRANSPARENCY
|
||||
memset(&_dialog, 0, sizeof(_dialog));
|
||||
#endif
|
||||
_font = 0;
|
||||
|
||||
// 'classic' is always the built in one, we force it and
|
||||
// ignore all 'classic' named config files
|
||||
if (config.compareToIgnoreCase("classic (builtin)") != 0) {
|
||||
if (cfg)
|
||||
_configFile = *cfg;
|
||||
else
|
||||
loadConfigFile(_stylefile);
|
||||
}
|
||||
|
||||
if (_configFile.hasKey("name", "theme"))
|
||||
_configFile.getKey("name", "theme", _stylename);
|
||||
else
|
||||
_stylename = _stylefile;
|
||||
}
|
||||
|
||||
ThemeClassic::~ThemeClassic() {
|
||||
deinit();
|
||||
}
|
||||
|
||||
bool ThemeClassic::init() {
|
||||
deinit();
|
||||
_screen.create(_system->getOverlayWidth(), _system->getOverlayHeight(), sizeof(OverlayColor));
|
||||
if (_screen.pixels) {
|
||||
_initOk = true;
|
||||
clearAll();
|
||||
resetDrawArea();
|
||||
}
|
||||
|
||||
if (isThemeLoadingRequired()) {
|
||||
loadTheme(_defaultConfig);
|
||||
loadTheme(_configFile, false, true);
|
||||
|
||||
setupConfig();
|
||||
}
|
||||
|
||||
_bgcolor = _system->RGBToColor(_colors[kBGColor][0], _colors[kBGColor][1], _colors[kBGColor][2]);
|
||||
_color = _system->RGBToColor(_colors[kColor][0], _colors[kColor][1], _colors[kColor][2]);
|
||||
_shadowcolor = _system->RGBToColor(_colors[kShadowColor][0], _colors[kShadowColor][1], _colors[kShadowColor][2]);
|
||||
_textcolor = _system->RGBToColor(_colors[kTextColor][0], _colors[kTextColor][1], _colors[kTextColor][2]);
|
||||
_textcolorhi = _system->RGBToColor(_colors[kTextColorHi][0], _colors[kTextColorHi][1], _colors[kTextColorHi][2]);
|
||||
if (_fontName.empty()) {
|
||||
if (_screen.w >= 400 && _screen.h >= 300) {
|
||||
_font = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
|
||||
} else {
|
||||
_font = FontMan.getFontByUsage(Graphics::FontManager::kGUIFont);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ThemeClassic::deinit() {
|
||||
if (_initOk) {
|
||||
_system->hideOverlay();
|
||||
_screen.free();
|
||||
_initOk = false;
|
||||
}
|
||||
}
|
||||
|
||||
void ThemeClassic::refresh() {
|
||||
init();
|
||||
if (_enabled)
|
||||
_system->showOverlay();
|
||||
}
|
||||
|
||||
void ThemeClassic::enable() {
|
||||
init();
|
||||
resetDrawArea();
|
||||
_system->showOverlay();
|
||||
clearAll();
|
||||
_enabled = true;
|
||||
}
|
||||
|
||||
void ThemeClassic::disable() {
|
||||
_system->hideOverlay();
|
||||
_enabled = false;
|
||||
}
|
||||
|
||||
void ThemeClassic::openDialog(bool topDialog, ShadingStyle shading) {
|
||||
#ifndef CT_NO_TRANSPARENCY
|
||||
if (!_dialog) {
|
||||
_dialog = new DialogState;
|
||||
assert(_dialog);
|
||||
// first dialog
|
||||
_dialog->screen.create(_screen.w, _screen.h, sizeof(OverlayColor));
|
||||
}
|
||||
memcpy(_dialog->screen.pixels, _screen.pixels, _screen.pitch*_screen.h);
|
||||
if (!_enableBlending)
|
||||
_dialog->screen.fillRect(Common::Rect(0, 0, _screen.w, _screen.h), _bgcolor);
|
||||
else
|
||||
blendScreenToDialog();
|
||||
#endif
|
||||
}
|
||||
|
||||
void ThemeClassic::closeAllDialogs() {
|
||||
#ifndef CT_NO_TRANSPARENCY
|
||||
if (_dialog) {
|
||||
_dialog->screen.free();
|
||||
delete _dialog;
|
||||
_dialog = 0;
|
||||
}
|
||||
_forceRedraw = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
void ThemeClassic::clearAll() {
|
||||
if (!_initOk)
|
||||
return;
|
||||
_system->clearOverlay();
|
||||
// FIXME: problem with the 'pitch'
|
||||
_system->grabOverlay((OverlayColor*)_screen.pixels, _screen.w);
|
||||
}
|
||||
|
||||
void ThemeClassic::updateScreen() {
|
||||
_forceRedraw = false;
|
||||
}
|
||||
|
||||
void ThemeClassic::resetDrawArea() {
|
||||
if (_initOk) {
|
||||
_drawArea = Common::Rect(0, 0, _screen.w, _screen.h);
|
||||
}
|
||||
}
|
||||
|
||||
int ThemeClassic::getTabSpacing() const {
|
||||
return 2;
|
||||
}
|
||||
int ThemeClassic::getTabPadding() const {
|
||||
return 3;
|
||||
}
|
||||
|
||||
void ThemeClassic::drawDialogBackground(const Common::Rect &r, uint16 hints, WidgetStateInfo state) {
|
||||
if (!_initOk)
|
||||
return;
|
||||
|
||||
restoreBackground(r);
|
||||
|
||||
#ifndef CT_NO_TRANSPARENCY
|
||||
if ((hints & THEME_HINT_SAVE_BACKGROUND) && !(hints & THEME_HINT_FIRST_DRAW) && !_forceRedraw) {
|
||||
addDirtyRect(r);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
box(r.left, r.top, r.width(), r.height(), _color, _shadowcolor);
|
||||
addDirtyRect(r, (hints & THEME_HINT_SAVE_BACKGROUND) != 0);
|
||||
}
|
||||
|
||||
void ThemeClassic::drawText(const Common::Rect &r, const Common::String &str, WidgetStateInfo state, TextAlign align, bool inverted, int deltax, bool useEllipsis, FontStyle font) {
|
||||
if (!_initOk)
|
||||
return;
|
||||
|
||||
if (!inverted) {
|
||||
restoreBackground(r);
|
||||
_font->drawString(&_screen, str, r.left, r.top, r.width(), getColor(state), convertAligment(align), deltax, useEllipsis);
|
||||
} else {
|
||||
_screen.fillRect(r, getColor(state));
|
||||
_font->drawString(&_screen, str, r.left, r.top, r.width(), _bgcolor, convertAligment(align), deltax, useEllipsis);
|
||||
}
|
||||
|
||||
addDirtyRect(r);
|
||||
}
|
||||
|
||||
void ThemeClassic::drawChar(const Common::Rect &r, byte ch, const Graphics::Font *font, WidgetStateInfo state) {
|
||||
if (!_initOk)
|
||||
return;
|
||||
restoreBackground(r);
|
||||
font->drawChar(&_screen, ch, r.left, r.top, getColor(state));
|
||||
addDirtyRect(r);
|
||||
}
|
||||
|
||||
void ThemeClassic::drawWidgetBackground(const Common::Rect &r, uint16 hints, WidgetBackground background, WidgetStateInfo state) {
|
||||
if (!_initOk || background == kWidgetBackgroundNo)
|
||||
return;
|
||||
|
||||
restoreBackground(r);
|
||||
|
||||
#ifndef CT_NO_TRANSPARENCY
|
||||
if ((hints & THEME_HINT_SAVE_BACKGROUND) && !(hints & THEME_HINT_FIRST_DRAW) && !_forceRedraw) {
|
||||
addDirtyRect(r);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (background) {
|
||||
case kWidgetBackgroundBorder:
|
||||
box(r.left, r.top, r.width(), r.height(), _color, _shadowcolor);
|
||||
break;
|
||||
|
||||
//case kWidgetBackgroundPlain:
|
||||
//case kWidgetBackgroundBorderSmall:
|
||||
default:
|
||||
box(r.left, r.top, r.width(), r.height());
|
||||
break;
|
||||
};
|
||||
|
||||
addDirtyRect(r, (hints & THEME_HINT_SAVE_BACKGROUND) != 0);
|
||||
}
|
||||
|
||||
void ThemeClassic::drawButton(const Common::Rect &r, const Common::String &str, WidgetStateInfo state, uint16 hints) {
|
||||
if (!_initOk)
|
||||
return;
|
||||
restoreBackground(r);
|
||||
|
||||
drawWidgetBackground(r, 0, kWidgetBackgroundBorder, state);
|
||||
|
||||
const int off = (r.height() - _font->getFontHeight()) / 2;
|
||||
_font->drawString(&_screen, str, r.left, r.top+off, r.width(), getColor(state), Graphics::kTextAlignCenter, 0, false);
|
||||
|
||||
addDirtyRect(r);
|
||||
}
|
||||
|
||||
void ThemeClassic::drawSurface(const Common::Rect &r, const Graphics::Surface &surface, WidgetStateInfo state, int alpha, bool themeTrans) {
|
||||
if (!_initOk)
|
||||
return;
|
||||
|
||||
Common::Rect rect(r.left, r.top, r.left + surface.w, r.top + surface.h);
|
||||
rect.clip(_screen.w, _screen.h);
|
||||
|
||||
if (!rect.isValidRect())
|
||||
return;
|
||||
|
||||
assert(surface.bytesPerPixel == sizeof(OverlayColor));
|
||||
|
||||
OverlayColor *src = (OverlayColor *)surface.pixels;
|
||||
OverlayColor *dst = (OverlayColor *)_screen.getBasePtr(rect.left, rect.top);
|
||||
|
||||
int w = rect.width();
|
||||
int h = rect.height();
|
||||
|
||||
while (h--) {
|
||||
memcpy(dst, src, surface.pitch);
|
||||
src += w;
|
||||
// FIXME: this should be pitch
|
||||
dst += _screen.w;
|
||||
}
|
||||
addDirtyRect(r);
|
||||
}
|
||||
|
||||
void ThemeClassic::drawSlider(const Common::Rect &r, int width, WidgetStateInfo state) {
|
||||
if (!_initOk)
|
||||
return;
|
||||
Common::Rect r2 = r;
|
||||
|
||||
restoreBackground(r);
|
||||
|
||||
box(r.left, r.top, r.width(), r.height(), _color, _shadowcolor);
|
||||
r2.left = r.left + 2;
|
||||
r2.top = r.top + 2;
|
||||
r2.bottom = r.bottom - 2;
|
||||
r2.right = r2.left + width;
|
||||
if (r2.right > r.right - 2) {
|
||||
r2.right = r.right - 2;
|
||||
}
|
||||
|
||||
_screen.fillRect(r2, getColor(state));
|
||||
|
||||
addDirtyRect(r);
|
||||
}
|
||||
|
||||
void ThemeClassic::drawPopUpWidget(const Common::Rect &r, const Common::String &sel, int deltax, WidgetStateInfo state, TextAlign align) {
|
||||
if (!_initOk)
|
||||
return;
|
||||
|
||||
restoreBackground(r);
|
||||
|
||||
box(r.left, r.top, r.width(), r.height());
|
||||
|
||||
Common::Point p0, p1;
|
||||
|
||||
p0 = Common::Point(r.right + 1 - r.height() / 2, r.top + 4);
|
||||
p1 = Common::Point(r.right + 1 - r.height() / 2, r.bottom - 4);
|
||||
|
||||
OverlayColor color = getColor(state);
|
||||
|
||||
// Evil HACK to draw filled triangles
|
||||
// FIXME: The "big" version is pretty ugly.
|
||||
for (; p1.y - p0.y > 1; p0.y++, p0.x--, p1.y--, p1.x++) {
|
||||
_screen.drawLine(p0.x, p0.y, p1.x, p0.y, color);
|
||||
_screen.drawLine(p0.x, p1.y, p1.x, p1.y, color);
|
||||
}
|
||||
|
||||
if (!sel.empty()) {
|
||||
Common::Rect text(r.left + 2, r.top + 3, r.right - 4, r.top + 3 + _font->getFontHeight());
|
||||
_font->drawString(&_screen, sel, text.left, text.top, text.width(), color, convertAligment(align), deltax, false);
|
||||
}
|
||||
|
||||
addDirtyRect(r);
|
||||
}
|
||||
|
||||
void ThemeClassic::drawCheckbox(const Common::Rect &r, const Common::String &str, bool checked, WidgetStateInfo state) {
|
||||
if (!_initOk)
|
||||
return;
|
||||
|
||||
Common::Rect r2 = r;
|
||||
int checkBoxSize = getFontHeight();
|
||||
if (checkBoxSize > r.height()) {
|
||||
checkBoxSize = r.height();
|
||||
}
|
||||
r2.bottom = r2.top + checkBoxSize;
|
||||
|
||||
restoreBackground(r2);
|
||||
|
||||
box(r.left, r.top, checkBoxSize, checkBoxSize, _color, _shadowcolor);
|
||||
|
||||
if (checked) {
|
||||
r2.top += 3;
|
||||
r2.bottom = r.top + checkBoxSize - 4;
|
||||
r2.left += 3;
|
||||
r2.right = r.left + checkBoxSize - 4;
|
||||
|
||||
OverlayColor c = getColor(state);
|
||||
|
||||
// Draw a cross
|
||||
_screen.drawLine(r2.left, r2.top, r2.right, r2.bottom, c);
|
||||
_screen.drawLine(r2.left, r2.bottom, r2.right, r2.top, c);
|
||||
|
||||
if (r2.height() > 5) {
|
||||
// Thicken the lines
|
||||
_screen.drawLine(r2.left, r2.top + 1, r2.right - 1, r2.bottom, c);
|
||||
_screen.drawLine(r2.left + 1, r2.top, r2.right, r2.bottom - 1, c);
|
||||
_screen.drawLine(r2.left, r2.bottom - 1, r2.right - 1, r2.top, c);
|
||||
_screen.drawLine(r2.left + 1, r2.bottom, r2.right, r2.top + 1, c);
|
||||
}
|
||||
|
||||
r2 = r;
|
||||
}
|
||||
|
||||
r2.left += checkBoxSize + 10;
|
||||
_font->drawString(&_screen, str, r2.left, r2.top, r2.width(), getColor(state), Graphics::kTextAlignLeft, 0, true);
|
||||
|
||||
addDirtyRect(r);
|
||||
}
|
||||
|
||||
void ThemeClassic::drawTab(const Common::Rect &r, int tabHeight, int tabWidth, const Common::Array<Common::String> &tabs, int active, uint16 hints, int titleVPad, WidgetStateInfo state) {
|
||||
if (!_initOk)
|
||||
return;
|
||||
restoreBackground(r);
|
||||
|
||||
for (int i = 0; i < (int)tabs.size(); ++i) {
|
||||
if (i == active)
|
||||
continue;
|
||||
box(r.left + i * tabWidth, r.top+2, tabWidth, tabHeight-2, _color, _shadowcolor);
|
||||
_font->drawString(&_screen, tabs[i], r.left + i * tabWidth, r.top+4, tabWidth, getColor(state), Graphics::kTextAlignCenter, 0, true);
|
||||
}
|
||||
|
||||
if (active >= 0) {
|
||||
box(r.left + active * tabWidth, r.top, tabWidth, tabHeight, _color, _shadowcolor, true);
|
||||
_font->drawString(&_screen, tabs[active], r.left + active * tabWidth, r.top+titleVPad, tabWidth, getColor(kStateHighlight), Graphics::kTextAlignCenter, 0, true);
|
||||
|
||||
_screen.hLine(r.left, r.top + tabHeight, r.left + active * tabWidth + 1, _color);
|
||||
_screen.hLine(r.left + active * tabWidth + tabWidth - 2, r.top + tabHeight, r.right, _color);
|
||||
_screen.hLine(r.left, r.bottom - 1, r.right - 1, _shadowcolor);
|
||||
_screen.vLine(r.left, r.top + tabHeight, r.bottom - 1, _color);
|
||||
_screen.vLine(r.right - 1, r.top + tabHeight, r.bottom - 1, _shadowcolor);
|
||||
}
|
||||
|
||||
addDirtyRect(r);
|
||||
}
|
||||
|
||||
void ThemeClassic::drawScrollbar(const Common::Rect &r, int sliderY, int sliderHeight, ScrollbarState scroll, WidgetStateInfo state) {
|
||||
if (!_initOk)
|
||||
return;
|
||||
restoreBackground(r);
|
||||
Common::Rect r2 = r;
|
||||
box(r.left, r.top, r.width(), r.height(), _color, _shadowcolor);
|
||||
|
||||
const int UP_DOWN_BOX_HEIGHT = r.width() + 1;
|
||||
const int B = 3;
|
||||
const int arrowSize = (r.width() / 2 - B + 1);
|
||||
|
||||
OverlayColor color = 0;
|
||||
if (scroll == kScrollbarStateSinglePage) {
|
||||
color = _color;
|
||||
} else if (scroll == kScrollbarStateUp && state == kStateHighlight) {
|
||||
color = _textcolorhi;
|
||||
} else {
|
||||
color = _textcolor;
|
||||
}
|
||||
|
||||
// draws the 'up' button
|
||||
box(r.left, r.top, r.width(), UP_DOWN_BOX_HEIGHT, _color, _shadowcolor);
|
||||
Common::Point p0 = Common::Point(r.left + r.width() / 2, r.top + (UP_DOWN_BOX_HEIGHT - arrowSize - 1) / 2);
|
||||
Common::Point p1 = Common::Point(p0.x - arrowSize, p0.y + arrowSize);
|
||||
Common::Point p2 = Common::Point(p0.x + arrowSize, p0.y + arrowSize);
|
||||
for (; p1.x <= p2.x; ++p1.x)
|
||||
_screen.drawLine(p0.x, p0.y, p1.x, p1.y, color);
|
||||
|
||||
if (scroll != kScrollbarStateSinglePage) {
|
||||
r2.top += sliderY;
|
||||
r2.left += 2;
|
||||
r2.right -= 2;
|
||||
r2.bottom = r2.top + sliderHeight;
|
||||
_screen.fillRect(r2, (state == kStateHighlight && scroll == kScrollbarStateSlider) ? _textcolorhi : _textcolor);
|
||||
box(r2.left, r2.top, r2.width(), r2.height());
|
||||
int y = r2.top + sliderHeight / 2;
|
||||
color = (state == kStateHighlight && scroll == kScrollbarStateSlider) ? _color : _bgcolor;
|
||||
_screen.hLine(r2.left + 1, y - 2, r2.right - 2, color);
|
||||
_screen.hLine(r2.left + 1, y, r2.right - 2, color);
|
||||
_screen.hLine(r2.left + 1, y + 2, r2.right - 2, color);
|
||||
r2 = r;
|
||||
}
|
||||
|
||||
r2.top = r2.bottom - UP_DOWN_BOX_HEIGHT;
|
||||
if (scroll == kScrollbarStateSinglePage) {
|
||||
color = _color;
|
||||
} else if (scroll == kScrollbarStateDown && state == kStateHighlight) {
|
||||
color = _textcolorhi;
|
||||
} else {
|
||||
color = _textcolor;
|
||||
}
|
||||
|
||||
// draws the 'down' button
|
||||
box(r2.left, r2.top, r2.width(), UP_DOWN_BOX_HEIGHT, _color, _shadowcolor);
|
||||
p0 = Common::Point(r2.left + r2.width() / 2, r2.top + (UP_DOWN_BOX_HEIGHT + arrowSize + 1) / 2);
|
||||
p1 = Common::Point(p0.x - arrowSize, p0.y - arrowSize);
|
||||
p2 = Common::Point(p0.x + arrowSize, p0.y - arrowSize);
|
||||
for (; p1.x <= p2.x; ++p1.x)
|
||||
_screen.drawLine(p0.x, p0.y, p1.x, p1.y, color);
|
||||
|
||||
addDirtyRect(r);
|
||||
}
|
||||
|
||||
void ThemeClassic::drawCaret(const Common::Rect &r, bool erase, WidgetStateInfo state) {
|
||||
if (!_initOk)
|
||||
return;
|
||||
|
||||
OverlayColor color = 0;
|
||||
if (erase) {
|
||||
color = _bgcolor;
|
||||
} else {
|
||||
color = getColor(state);
|
||||
}
|
||||
|
||||
_screen.vLine(r.left, r.top, r.bottom - 2, color);
|
||||
addDirtyRect(r);
|
||||
}
|
||||
|
||||
void ThemeClassic::drawLineSeparator(const Common::Rect &r, WidgetStateInfo state) {
|
||||
if (!_initOk)
|
||||
return;
|
||||
_screen.hLine(r.left - 1, r.top + r.height() / 2, r.right, _shadowcolor);
|
||||
_screen.hLine(r.left, r.top + 1 + r.height() / 2, r.right, _color);
|
||||
addDirtyRect(r);
|
||||
}
|
||||
|
||||
// intern drawing
|
||||
|
||||
void ThemeClassic::restoreBackground(Common::Rect r, bool special) {
|
||||
r.clip(_screen.w, _screen.h);
|
||||
r.clip(_drawArea);
|
||||
#ifdef CT_NO_TRANSPARENCY
|
||||
_screen.fillRect(r, _bgcolor);
|
||||
#else
|
||||
if (_dialog) {
|
||||
if (!_dialog->screen.pixels) {
|
||||
_screen.fillRect(r, _bgcolor);
|
||||
return;
|
||||
}
|
||||
const OverlayColor *src = (const OverlayColor*)_dialog->screen.getBasePtr(r.left, r.top);
|
||||
OverlayColor *dst = (OverlayColor*)_screen.getBasePtr(r.left, r.top);
|
||||
|
||||
int h = r.height();
|
||||
int w = r.width();
|
||||
while (h--) {
|
||||
memcpy(dst, src, w*sizeof(OverlayColor));
|
||||
src += _dialog->screen.w;
|
||||
dst += _screen.w;
|
||||
}
|
||||
} else {
|
||||
_screen.fillRect(r, _bgcolor);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool ThemeClassic::addDirtyRect(Common::Rect r, bool save, bool special) {
|
||||
// TODO: implement proper dirty rect handling
|
||||
// FIXME: problem with the 'pitch'
|
||||
r.clip(_screen.w, _screen.h);
|
||||
r.clip(_drawArea);
|
||||
_system->copyRectToOverlay((OverlayColor*)_screen.getBasePtr(r.left, r.top), _screen.w, r.left, r.top, r.width(), r.height());
|
||||
#ifndef CT_NO_TRANSPARENCY
|
||||
if (_dialog && save) {
|
||||
if (_dialog->screen.pixels) {
|
||||
OverlayColor *dst = (OverlayColor*)_dialog->screen.getBasePtr(r.left, r.top);
|
||||
const OverlayColor *src = (const OverlayColor*)_screen.getBasePtr(r.left, r.top);
|
||||
int h = r.height();
|
||||
while (h--) {
|
||||
memcpy(dst, src, r.width()*sizeof(OverlayColor));
|
||||
dst += _dialog->screen.w;
|
||||
src += _screen.w;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
void ThemeClassic::box(int x, int y, int width, int height, OverlayColor colorA, OverlayColor colorB, bool skipLastRow) {
|
||||
if (y >= 0) {
|
||||
_screen.hLine(x + 1, y, x + width - 2, colorA);
|
||||
_screen.hLine(x, y + 1, x + width - 1, colorA);
|
||||
}
|
||||
int drawY = y;
|
||||
if (drawY < 0) {
|
||||
height += drawY;
|
||||
drawY = 0;
|
||||
}
|
||||
_screen.vLine(x, drawY + 1, drawY + height - 2, colorA);
|
||||
_screen.vLine(x + 1, drawY, drawY + height - 1, colorA);
|
||||
_screen.vLine(x + width - 1, drawY + 1, drawY + height - 2, colorB);
|
||||
_screen.vLine(x + width - 2, drawY + 1, drawY + height - 1, colorB);
|
||||
|
||||
if (y + height >= 0 && !skipLastRow) {
|
||||
_screen.hLine(x + 1, drawY + height - 2, x + width - 1, colorB);
|
||||
_screen.hLine(x + 1, drawY + height - 1, x + width - 2, colorB);
|
||||
}
|
||||
}
|
||||
|
||||
void ThemeClassic::box(int x, int y, int w, int h) {
|
||||
_screen.hLine(x, y, x + w - 1, _color);
|
||||
_screen.hLine(x, y + h - 1, x +w - 1, _shadowcolor);
|
||||
_screen.vLine(x, y, y + h - 1, _color);
|
||||
_screen.vLine(x + w - 1, y, y + h - 1, _shadowcolor);
|
||||
}
|
||||
|
||||
OverlayColor ThemeClassic::getColor(State state) {
|
||||
OverlayColor usedColor = _color;
|
||||
switch (state) {
|
||||
case kStateEnabled:
|
||||
usedColor = _textcolor;
|
||||
break;
|
||||
|
||||
case kStateHighlight:
|
||||
usedColor = _textcolorhi;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return usedColor;
|
||||
}
|
||||
|
||||
#ifndef CT_NO_TRANSPARENCY
|
||||
void ThemeClassic::blendScreenToDialog() {
|
||||
Common::Rect rect(0, 0, _screen.w, _screen.h);
|
||||
|
||||
if (!rect.isValidRect())
|
||||
return;
|
||||
|
||||
if (_system->hasFeature(OSystem::kFeatureOverlaySupportsAlpha)) {
|
||||
int a, r, g, b;
|
||||
uint8 aa, ar, ag, ab;
|
||||
_system->colorToARGB(_bgcolor, aa, ar, ag, ab);
|
||||
a = aa*3/(3+1);
|
||||
if (a < 1)
|
||||
return;
|
||||
r = ar * a;
|
||||
g = ag * a;
|
||||
b = ab * a;
|
||||
|
||||
OverlayColor *ptr = (OverlayColor*)_dialog->screen.getBasePtr(rect.left, rect.top);
|
||||
|
||||
int h = rect.height();
|
||||
int w = rect.width();
|
||||
while (h--) {
|
||||
for (int i = 0; i < w; i++) {
|
||||
_system->colorToARGB(ptr[i], aa, ar, ag, ab);
|
||||
int a2 = aa + a - (a*aa)/255;
|
||||
ptr[i] = _system->ARGBToColor(a2,
|
||||
((255-a)*aa*ar/255+r)/a2,
|
||||
((255-a)*aa*ag/255+g)/a2,
|
||||
((255-a)*aa*ab/255+b)/a2);
|
||||
}
|
||||
ptr += _screen.w;
|
||||
}
|
||||
} else {
|
||||
int r, g, b;
|
||||
uint8 ar, ag, ab;
|
||||
_system->colorToRGB(_bgcolor, ar, ag, ab);
|
||||
r = ar * 3;
|
||||
g = ag * 3;
|
||||
b = ab * 3;
|
||||
|
||||
OverlayColor *ptr = (OverlayColor*)_dialog->screen.getBasePtr(rect.left, rect.top);
|
||||
|
||||
int h = rect.height();
|
||||
int w = rect.width();
|
||||
|
||||
while (h--) {
|
||||
for (int i = 0; i < w; i++) {
|
||||
_system->colorToRGB(ptr[i], ar, ag, ab);
|
||||
ptr[i] = _system->RGBToColor((ar + r) / (3+1),
|
||||
(ag + g) / (3+1),
|
||||
(ab + b) / (3+1));
|
||||
}
|
||||
ptr += _screen.w;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void ThemeClassic::setupConfig() {
|
||||
if (_configFile.hasSection("theme")) {
|
||||
if (loadConfig())
|
||||
return;
|
||||
}
|
||||
|
||||
static const uint8 colors[][3] = {
|
||||
{ 104, 104, 104 },
|
||||
{ 64, 64, 64 },
|
||||
{ 0, 0, 0, },
|
||||
{ 32, 160, 32 },
|
||||
{ 0, 255, 0 }
|
||||
};
|
||||
|
||||
memcpy(_colors, colors, sizeof(colors));
|
||||
}
|
||||
|
||||
bool ThemeClassic::loadConfig() {
|
||||
Common::String temp;
|
||||
_configFile.getKey("version", "theme", temp);
|
||||
if (atoi(temp.c_str()) != THEME_VERSION) {
|
||||
// TODO: improve this detection and handle it nicer
|
||||
warning("Theme config uses a different version (you have: '%s', needed is: '%d')", temp.c_str(), THEME_VERSION);
|
||||
_configFile.clear();
|
||||
|
||||
// force a theme reload here
|
||||
loadTheme(_defaultConfig);
|
||||
return false;
|
||||
}
|
||||
|
||||
temp.clear();
|
||||
_configFile.getKey("type", "theme", temp);
|
||||
if (0 != temp.compareToIgnoreCase("classic")) {
|
||||
warning("Theme config is not for the classic style theme");
|
||||
_configFile.clear();
|
||||
|
||||
// force a theme reload here
|
||||
loadTheme(_defaultConfig);
|
||||
return false;
|
||||
}
|
||||
|
||||
getColorFromConfig("color", _colors[kColor][0], _colors[kColor][1], _colors[kColor][2]);
|
||||
getColorFromConfig("shadowcolor", _colors[kShadowColor][0], _colors[kShadowColor][1], _colors[kShadowColor][2]);
|
||||
getColorFromConfig("bgcolor", _colors[kBGColor][0], _colors[kBGColor][1], _colors[kBGColor][2]);
|
||||
getColorFromConfig("textcolor", _colors[kTextColor][0], _colors[kTextColor][1], _colors[kTextColor][2]);
|
||||
getColorFromConfig("textcolorhi", _colors[kTextColorHi][0], _colors[kTextColorHi][1], _colors[kTextColorHi][2]);
|
||||
|
||||
temp.clear();
|
||||
temp = _evaluator->getStringVar("font");
|
||||
if (temp.empty() || 0 == temp.compareToIgnoreCase("builtin")) {
|
||||
if (!_fontName.empty())
|
||||
delete _font;
|
||||
_fontName.clear();
|
||||
} else if (temp != _fontName) {
|
||||
if (!_fontName.empty())
|
||||
delete _font;
|
||||
_font = loadFont(temp.c_str());
|
||||
_fontName = temp;
|
||||
}
|
||||
|
||||
_enableBlending = (_evaluator->getVar("blending") != 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // end of namespace GUI
|
||||
|
@ -1,127 +0,0 @@
|
||||
/* 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 GUI_THEMECLASSIC_H
|
||||
#define GUI_THEMECLASSIC_H
|
||||
|
||||
#include "gui/theme.h"
|
||||
|
||||
namespace GUI {
|
||||
|
||||
// enable this to disable transparency support for the classic theme
|
||||
//#define CT_NO_TRANSPARENCY
|
||||
|
||||
class ThemeClassic : public Theme {
|
||||
public:
|
||||
ThemeClassic(OSystem *system, const Common::String &config = "classic", const Common::ConfigFile *cfg = 0);
|
||||
virtual ~ThemeClassic();
|
||||
|
||||
bool init();
|
||||
void deinit();
|
||||
|
||||
void refresh();
|
||||
|
||||
void enable();
|
||||
void disable();
|
||||
|
||||
void openDialog(bool topDialog, ShadingStyle = kShadingNone);
|
||||
void closeAllDialogs();
|
||||
|
||||
void clearAll();
|
||||
void updateScreen();
|
||||
|
||||
void resetDrawArea();
|
||||
|
||||
const Graphics::Font *getFont(FontStyle font) const { return _font; }
|
||||
int getFontHeight(FontStyle font = kFontStyleBold) const { if (_initOk) return _font->getFontHeight(); return 0; }
|
||||
int getStringWidth(const Common::String &str, FontStyle font) const { if (_initOk) return _font->getStringWidth(str); return 0; }
|
||||
int getCharWidth(byte c, FontStyle font) const { if (_initOk) return _font->getCharWidth(c); return 0; }
|
||||
|
||||
void drawDialogBackground(const Common::Rect &r, uint16 hints, WidgetStateInfo state);
|
||||
void drawText(const Common::Rect &r, const Common::String &str, 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);
|
||||
|
||||
void drawWidgetBackground(const Common::Rect &r, uint16 hints, WidgetBackground background, WidgetStateInfo state);
|
||||
void drawButton(const Common::Rect &r, const Common::String &str, WidgetStateInfo state, uint16 hints);
|
||||
void drawSurface(const Common::Rect &r, const Graphics::Surface &surface, WidgetStateInfo state, int alpha, bool themeTrans);
|
||||
void drawSlider(const Common::Rect &r, int width, WidgetStateInfo state);
|
||||
void drawCheckbox(const Common::Rect &r, const Common::String &str, bool checked, WidgetStateInfo state);
|
||||
void drawTab(const Common::Rect &r, int tabHeight, int tabWidth, const Common::Array<Common::String> &tabs, int active, uint16 hints, int titleVPad, WidgetStateInfo state);
|
||||
void drawScrollbar(const Common::Rect &r, int sliderY, int sliderHeight, ScrollbarState, WidgetStateInfo state);
|
||||
void drawPopUpWidget(const Common::Rect &r, const Common::String &sel, int deltax, WidgetStateInfo state, TextAlign align);
|
||||
void drawCaret(const Common::Rect &r, bool erase, WidgetStateInfo state);
|
||||
void drawLineSeparator(const Common::Rect &r, WidgetStateInfo state);
|
||||
void restoreBackground(Common::Rect r, bool special = false);
|
||||
bool addDirtyRect(Common::Rect r, bool save = false, bool special = false);
|
||||
|
||||
int getTabSpacing() const;
|
||||
int getTabPadding() const;
|
||||
|
||||
private:
|
||||
void box(int x, int y, int width, int height, OverlayColor colorA, OverlayColor colorB, bool skipLastRow = false);
|
||||
void box(int x, int y, int width, int height);
|
||||
|
||||
OverlayColor getColor(State state);
|
||||
|
||||
OSystem *_system;
|
||||
Graphics::Surface _screen;
|
||||
|
||||
#ifndef CT_NO_TRANSPARENCY
|
||||
struct DialogState {
|
||||
Graphics::Surface screen;
|
||||
} *_dialog;
|
||||
|
||||
void blendScreenToDialog();
|
||||
#endif
|
||||
bool _enableBlending;
|
||||
|
||||
bool _forceRedraw;
|
||||
bool _initOk;
|
||||
bool _enabled;
|
||||
|
||||
Common::String _fontName;
|
||||
const Graphics::Font *_font;
|
||||
OverlayColor _color, _shadowcolor;
|
||||
OverlayColor _bgcolor;
|
||||
OverlayColor _textcolor;
|
||||
OverlayColor _textcolorhi;
|
||||
|
||||
enum {
|
||||
kColor = 0,
|
||||
kShadowColor = 1,
|
||||
kBGColor = 2,
|
||||
kTextColor = 3,
|
||||
kTextColorHi = 4,
|
||||
kMaxColors = 5
|
||||
};
|
||||
uint8 _colors[kMaxColors][3];
|
||||
|
||||
void setupConfig();
|
||||
bool loadConfig();
|
||||
};
|
||||
|
||||
} // end of namespace GUI
|
||||
|
||||
#endif
|
||||
|
1586
gui/ThemeModern.cpp
1586
gui/ThemeModern.cpp
File diff suppressed because it is too large
Load Diff
@ -1,340 +0,0 @@
|
||||
/* 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 GUI_THEMEMODERN_H
|
||||
#define GUI_THEMEMODERN_H
|
||||
|
||||
#ifndef DISABLE_FANCY_THEMES
|
||||
|
||||
#include "gui/theme.h"
|
||||
|
||||
namespace GUI {
|
||||
|
||||
class ThemeModern : public Theme {
|
||||
public:
|
||||
ThemeModern(OSystem *system, const Common::String &stylefile, const Common::ConfigFile *cfg = 0);
|
||||
virtual ~ThemeModern();
|
||||
|
||||
bool init();
|
||||
void deinit();
|
||||
|
||||
void refresh();
|
||||
|
||||
bool ownCursor() const { return _useCursor; }
|
||||
|
||||
void enable();
|
||||
void disable();
|
||||
|
||||
void openDialog(bool topDialog, ShadingStyle = kShadingNone);
|
||||
void closeAllDialogs();
|
||||
|
||||
void clearAll();
|
||||
void updateScreen();
|
||||
|
||||
void setDrawArea(const Common::Rect &r);
|
||||
void resetDrawArea();
|
||||
|
||||
const Graphics::Font *getFont(FontStyle font = kFontStyleBold) const { return _fonts[font]; }
|
||||
int getFontHeight(FontStyle font = kFontStyleBold) const { if (_fonts[font]) return _fonts[font]->getFontHeight(); return 0; }
|
||||
int getStringWidth(const Common::String &str, FontStyle font = kFontStyleBold) const { if (_fonts[font]) return _fonts[font]->getStringWidth(str); return 0; }
|
||||
int getCharWidth(byte c, FontStyle font = kFontStyleBold) const { if (_fonts[font]) return _fonts[font]->getCharWidth(c); return 0; }
|
||||
|
||||
void drawDialogBackground(const Common::Rect &r, uint16 hints, WidgetStateInfo state);
|
||||
void drawText(const Common::Rect &r, const Common::String &str, 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);
|
||||
|
||||
void drawWidgetBackground(const Common::Rect &r, uint16 hints, WidgetBackground background, WidgetStateInfo state);
|
||||
void drawButton(const Common::Rect &r, const Common::String &str, WidgetStateInfo state, uint16 hints);
|
||||
void drawSurface(const Common::Rect &r, const Graphics::Surface &surface, WidgetStateInfo state, int alpha, bool themeTrans);
|
||||
void drawSlider(const Common::Rect &r, int width, WidgetStateInfo state);
|
||||
void drawCheckbox(const Common::Rect &r, const Common::String &str, bool checked, WidgetStateInfo state);
|
||||
void drawTab(const Common::Rect &r, int tabHeight, int tabWidth, const Common::Array<Common::String> &tabs, int active, uint16 hints, int titleVPad, WidgetStateInfo state);
|
||||
void drawScrollbar(const Common::Rect &r, int sliderY, int sliderHeight, ScrollbarState, WidgetStateInfo state);
|
||||
void drawPopUpWidget(const Common::Rect &r, const Common::String &sel, int deltax, WidgetStateInfo state, TextAlign align);
|
||||
void drawCaret(const Common::Rect &r, bool erase, WidgetStateInfo state);
|
||||
void drawLineSeparator(const Common::Rect &r, WidgetStateInfo state);
|
||||
|
||||
void restoreBackground(Common::Rect r, bool special = false);
|
||||
bool addDirtyRect(Common::Rect r, bool backup = false, bool special = false);
|
||||
|
||||
int getTabSpacing() const;
|
||||
int getTabPadding() const;
|
||||
|
||||
bool supportsImages() const { return true; }
|
||||
const Graphics::Surface *getImageSurface(const kThemeImages n) const { return n == kImageLogo ? _images[kThemeLogo] : 0; }
|
||||
private:
|
||||
void colorFade(const Common::Rect &r, OverlayColor start, OverlayColor end, uint factor = 1);
|
||||
void drawRect(const Common::Rect &r, const Graphics::Surface *corner, const Graphics::Surface *top,
|
||||
const Graphics::Surface *left, const Graphics::Surface *fill, int alpha, bool skipLastRow = false);
|
||||
void drawRectMasked(const Common::Rect &r, const Graphics::Surface *corner, const Graphics::Surface *top,
|
||||
const Graphics::Surface *left, const Graphics::Surface *fill, int alpha,
|
||||
OverlayColor start, OverlayColor end, uint factor = 1, bool skipLastRow = false, bool skipTopRow = false);
|
||||
void drawSurface(const Common::Rect &r, const Graphics::Surface *surf, bool upDown, bool leftRight, int alpha);
|
||||
void drawSurfaceMasked(const Common::Rect &r, const Graphics::Surface *surf, bool upDown, bool leftRight, int alpha,
|
||||
OverlayColor start, OverlayColor end, uint factor = 1);
|
||||
|
||||
enum ShadowStyles {
|
||||
kShadowFull = 0,
|
||||
kShadowSmall = 1,
|
||||
kShadowButton = 2,
|
||||
kShadowEmboss = 3,
|
||||
kShadowPopUp = 4
|
||||
};
|
||||
|
||||
Common::Rect shadowRect(const Common::Rect &r, uint32 shadowStyle);
|
||||
void drawShadow(const Common::Rect &r, const Graphics::Surface *corner, const Graphics::Surface *top,
|
||||
const Graphics::Surface *left, const Graphics::Surface *fill, uint32 shadowStyle, bool skipLastRow = false,
|
||||
bool skipTopRow = false);
|
||||
void drawShadowRect(const Common::Rect &r, const Common::Rect &area, const Graphics::Surface *corner,
|
||||
const Graphics::Surface *top, const Graphics::Surface *left, const Graphics::Surface *fill,
|
||||
int alpha, bool skipLastRow = false, bool skipTopRow = false);
|
||||
|
||||
int _shadowLeftWidth, _shadowRightWidth;
|
||||
int _shadowTopHeight, _shadowBottomHeight;
|
||||
|
||||
OSystem *_system;
|
||||
Graphics::Surface _screen;
|
||||
Common::Rect _shadowDrawArea;
|
||||
|
||||
bool _initOk;
|
||||
bool _forceRedraw;
|
||||
bool _enabled;
|
||||
|
||||
int _lastUsedBitMask;
|
||||
void resetupGuiRenderer();
|
||||
void setupColors();
|
||||
|
||||
OverlayColor getColor(State state);
|
||||
|
||||
struct DialogState {
|
||||
Graphics::Surface screen;
|
||||
} *_dialog;
|
||||
|
||||
void setupFonts();
|
||||
void deleteFonts();
|
||||
|
||||
void setupFont(const Common::String &key, const Common::String &name, FontStyle style);
|
||||
|
||||
const Graphics::Font *_fonts[kFontStyleMax];
|
||||
|
||||
private:
|
||||
void processExtraValues();
|
||||
|
||||
enum ImageHandles {
|
||||
kDialogBkgdCorner = 0,
|
||||
kDialogBkgdTop = 1,
|
||||
kDialogBkgdLeft = 2,
|
||||
kDialogBkgd = 3,
|
||||
|
||||
kWidgetBkgdCorner = 4,
|
||||
kWidgetBkgdTop = 5,
|
||||
kWidgetBkgdLeft = 6,
|
||||
kWidgetBkgd = 7,
|
||||
|
||||
kCheckboxEmpty = 8,
|
||||
kCheckboxChecked = 9,
|
||||
|
||||
kWidgetArrow = 10,
|
||||
|
||||
kTabBkgdCorner = 11,
|
||||
kTabBkgdTop = 12,
|
||||
kTabBkgdLeft = 13,
|
||||
kTabBkgd = 14,
|
||||
|
||||
kSliderBkgdCorner = 15,
|
||||
kSliderBkgdTop = 16,
|
||||
kSliderBkgdLeft = 17,
|
||||
kSliderBkgd = 18,
|
||||
|
||||
kSliderCorner = 19,
|
||||
kSliderTop = 20,
|
||||
kSliderLeft = 21,
|
||||
kSlider = 22,
|
||||
|
||||
kScrollbarBkgdCorner = 23,
|
||||
kScrollbarBkgdTop = 24,
|
||||
kScrollbarBkgdLeft = 25,
|
||||
kScrollbarBkgd = 26,
|
||||
|
||||
kScrollbarCorner = 27,
|
||||
kScrollbarTop = 28,
|
||||
kScrollbarLeft = 29,
|
||||
kScrollbar = 30,
|
||||
|
||||
kButtonBkgdCorner = 31,
|
||||
kButtonBkgdTop = 32,
|
||||
kButtonBkgdLeft = 33,
|
||||
kButtonBkgd = 34,
|
||||
|
||||
kWidgetSmallBkgdCorner = 35,
|
||||
kWidgetSmallBkgdTop = 36,
|
||||
kWidgetSmallBkgdLeft = 37,
|
||||
kWidgetSmallBkgd = 38,
|
||||
|
||||
kThemeLogo = 39,
|
||||
|
||||
kPopUpWidgetBkgdCorner = 40,
|
||||
kPopUpWidgetBkgdTop = 41,
|
||||
kPopUpWidgetBkgdLeft = 42,
|
||||
kPopUpWidgetBkgd = 43,
|
||||
|
||||
kEditTextBkgdCorner = 44,
|
||||
kEditTextBkgdTop = 45,
|
||||
kEditTextBkgdLeft = 46,
|
||||
kEditTextBkgd = 47,
|
||||
|
||||
kGUICursor = 48,
|
||||
|
||||
kImageHandlesMax
|
||||
};
|
||||
|
||||
private:
|
||||
int _dimPercentValue;
|
||||
typedef OverlayColor (ThemeModern::*InactiveDialogCallback)(OverlayColor col);
|
||||
InactiveDialogCallback _dialogShadingCallback;
|
||||
|
||||
OverlayColor calcLuminance(OverlayColor col);
|
||||
OverlayColor calcDimColor(OverlayColor col);
|
||||
|
||||
bool _useCursor;
|
||||
void setUpCursor();
|
||||
void createCursor();
|
||||
int _cursorHotspotX, _cursorHotspotY;
|
||||
int _cursorTargetScale;
|
||||
#define MAX_CURS_COLORS 255
|
||||
byte *_cursor;
|
||||
bool _needPaletteUpdates;
|
||||
uint _cursorWidth, _cursorHeight;
|
||||
byte _cursorPal[4*MAX_CURS_COLORS];
|
||||
|
||||
private:
|
||||
Common::String _imageHandles[kImageHandlesMax];
|
||||
const Graphics::Surface **_images;
|
||||
|
||||
enum ColorHandles {
|
||||
kMainDialogStart = 0,
|
||||
kMainDialogEnd = 1,
|
||||
|
||||
kDialogStart = 2,
|
||||
kDialogEnd = 3,
|
||||
|
||||
kColorStateDisabled = 4,
|
||||
kColorStateHighlight = 5,
|
||||
kColorStateEnabled = 6,
|
||||
kColorTransparency = 7,
|
||||
|
||||
kTextInvertedBackground = 8,
|
||||
kTextInvertedColor = 9,
|
||||
|
||||
kWidgetBackgroundStart = 10,
|
||||
kWidgetBackgroundEnd = 11,
|
||||
kWidgetBackgroundSmallStart = 12,
|
||||
kWidgetBackgroundSmallEnd = 13,
|
||||
|
||||
kButtonBackgroundStart = 14,
|
||||
kButtonBackgroundEnd = 15,
|
||||
kButtonTextEnabled = 16,
|
||||
kButtonTextDisabled = 17,
|
||||
kButtonTextHighlight = 18,
|
||||
|
||||
kSliderBackgroundStart = 19,
|
||||
kSliderBackgroundEnd = 20,
|
||||
kSliderStart = 21,
|
||||
kSliderEnd = 22,
|
||||
|
||||
kTabBackgroundStart = 23,
|
||||
kTabBackgroundEnd = 24,
|
||||
|
||||
kScrollbarBackgroundStart = 25,
|
||||
kScrollbarBackgroundEnd = 26,
|
||||
kScrollbarButtonStart = 27,
|
||||
kScrollbarButtonEnd = 28,
|
||||
kScrollbarSliderStart = 29,
|
||||
kScrollbarSliderEnd = 30,
|
||||
|
||||
kCaretColor = 31,
|
||||
|
||||
kSliderHighStart = 32,
|
||||
kSliderHighEnd = 33,
|
||||
|
||||
kButtonBackgroundHighlightStart = 34,
|
||||
kButtonBackgroundHighlightEnd = 35,
|
||||
|
||||
kScrollbarButtonHighlightStart = 36,
|
||||
kScrollbarButtonHighlightEnd = 37,
|
||||
kScrollbarSliderHighlightStart = 38,
|
||||
kScrollbarSliderHighlightEnd = 39,
|
||||
|
||||
kPopUpWidgetStart = 40,
|
||||
kPopUpWidgetEnd = 41,
|
||||
kPopUpWidgetHighlightStart = 42,
|
||||
kPopUpWidgetHighlightEnd = 43,
|
||||
|
||||
kEditTextBackgroundStart = 44,
|
||||
kEditTextBackgroundEnd = 45,
|
||||
|
||||
kTabActiveStart = 46,
|
||||
kTabActiveEnd = 47,
|
||||
kTabInactiveStart = 48,
|
||||
kTabInactiveEnd = 49,
|
||||
|
||||
kColorHandlesMax
|
||||
};
|
||||
|
||||
OverlayColor _colors[kColorHandlesMax];
|
||||
|
||||
enum GradientFactors {
|
||||
kMainDialogFactor = 0,
|
||||
kDialogFactor = 1,
|
||||
kDialogSpecialFactor = 2,
|
||||
|
||||
kWidgetSmallFactor = 3,
|
||||
kWidgetFactor = 4,
|
||||
|
||||
kButtonFactor = 5,
|
||||
|
||||
kSliderFactor = 6,
|
||||
kSliderBackground = 7,
|
||||
|
||||
kTabFactor = 7,
|
||||
|
||||
kScrollbarFactor = 8,
|
||||
kScrollbarBkgdFactor = 9,
|
||||
|
||||
kPopUpWidgetFactor = 10,
|
||||
|
||||
kEditTextFactor = 11,
|
||||
|
||||
kMaxGradientFactors
|
||||
};
|
||||
|
||||
uint _gradientFactors[kMaxGradientFactors];
|
||||
};
|
||||
|
||||
} // end of namespace GUI
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -683,18 +683,26 @@ void ThemeRenderer::drawScrollbar(const Common::Rect &r, int sliderY, int slider
|
||||
queueDD(scrollState == kScrollbarStateSlider ? kDDScrollbarHandleHover : kDDScrollbarHandleIdle, r2);
|
||||
}
|
||||
|
||||
void ThemeRenderer::drawDialogBackground(const Common::Rect &r, uint16 hints, WidgetStateInfo state) {
|
||||
void ThemeRenderer::drawDialogBackground(const Common::Rect &r, DialogBackground bgtype, WidgetStateInfo state) {
|
||||
if (!ready())
|
||||
return;
|
||||
|
||||
if (hints & THEME_HINT_MAIN_DIALOG) {
|
||||
queueDD(kDDMainDialogBackground, r);
|
||||
} else if (hints & THEME_HINT_SPECIAL_COLOR) {
|
||||
queueDD(kDDSpecialColorBackground, r);
|
||||
} else if (hints & THEME_HINT_PLAIN_COLOR) {
|
||||
queueDD(kDDPlainColorBackground, r);
|
||||
} else {
|
||||
queueDD(kDDDefaultBackground, r);
|
||||
switch (bgtype) {
|
||||
case kDialogBackgroundMain:
|
||||
queueDD(kDDMainDialogBackground, r);
|
||||
break;
|
||||
|
||||
case kDialogBackgroundSpecial:
|
||||
queueDD(kDDSpecialColorBackground, r);
|
||||
break;
|
||||
|
||||
case kDialogBackgroundPlain:
|
||||
queueDD(kDDPlainColorBackground, r);
|
||||
break;
|
||||
|
||||
case kDialogBackgroundDefault:
|
||||
queueDD(kDDDefaultBackground, r);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -328,7 +328,7 @@ public:
|
||||
|
||||
void drawLineSeparator(const Common::Rect &r, WidgetStateInfo state = kStateEnabled);
|
||||
|
||||
void drawDialogBackground(const Common::Rect &r, uint16 hints, WidgetStateInfo state);
|
||||
void drawDialogBackground(const Common::Rect &r, DialogBackground type, WidgetStateInfo state);
|
||||
|
||||
void drawText(const Common::Rect &r, const Common::String &str,
|
||||
WidgetStateInfo state, TextAlign align, bool inverted, int deltax, bool useEllipsis, FontStyle font);
|
||||
|
@ -24,7 +24,6 @@
|
||||
|
||||
#include "gui/console.h"
|
||||
#include "gui/ScrollBarWidget.h"
|
||||
#include "gui/eval.h"
|
||||
#include "gui/ThemeEval.h"
|
||||
|
||||
#include "engines/engine.h"
|
||||
@ -120,8 +119,6 @@ void ConsoleDialog::init() {
|
||||
scrollBarWidth = kNormalScrollBarWidth;
|
||||
_scrollBar->resize(_w - scrollBarWidth - 1, 0, scrollBarWidth, _h);
|
||||
|
||||
_drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
|
||||
|
||||
_pageWidth = (_w - scrollBarWidth - 2 - _leftPadding - _topPadding - scrollBarWidth) / kConsoleCharWidth;
|
||||
_linesPerPage = (_h - 2 - _topPadding - _bottomPadding) / kConsoleLineHeight;
|
||||
_linesInBuffer = kBufferSize / kCharsPerLine;
|
||||
@ -152,8 +149,6 @@ void ConsoleDialog::open() {
|
||||
if (_w != w || _h != h)
|
||||
init();
|
||||
|
||||
_drawingHints |= THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
|
||||
|
||||
_y = -_h;
|
||||
_slideTime = g_system->getMillis();
|
||||
_slideMode = kDownSlideMode;
|
||||
@ -170,7 +165,7 @@ void ConsoleDialog::close() {
|
||||
}
|
||||
|
||||
void ConsoleDialog::drawDialog() {
|
||||
g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x+_w, _y+_h), _drawingHints);
|
||||
g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x+_w, _y+_h), _backgroundType);
|
||||
// FIXME: for the old theme the frame around the console vanishes
|
||||
// when any action is processed if we enable this
|
||||
// _drawingHints &= ~THEME_HINT_FIRST_DRAW;
|
||||
@ -229,7 +224,6 @@ void ConsoleDialog::handleTickle() {
|
||||
|
||||
// Perform the "slide animation".
|
||||
if (_slideMode != kNoSlideMode) {
|
||||
_drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
|
||||
const float tmp = (float)(g_system->getMillis() - _slideTime) / kConsoleSlideDownDuration;
|
||||
if (_slideMode == kUpSlideMode) {
|
||||
_y = (int)(_h * (0.0 - tmp));
|
||||
|
@ -42,18 +42,15 @@ namespace GUI {
|
||||
* ...
|
||||
*/
|
||||
|
||||
Dialog::Dialog(int x, int y, int w, int h, bool dimsInactive_)
|
||||
Dialog::Dialog(int x, int y, int w, int h)
|
||||
: GuiObject(x, y, w, h),
|
||||
_mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false), _drawingHints(0),
|
||||
_dimsInactive(dimsInactive_) {
|
||||
_drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
|
||||
}
|
||||
_mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false),
|
||||
_backgroundType(GUI::Theme::kDialogBackgroundDefault) {}
|
||||
|
||||
Dialog::Dialog(const Common::String &name, bool dimsInactive_)
|
||||
Dialog::Dialog(const Common::String &name)
|
||||
: GuiObject(name),
|
||||
_mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false), _drawingHints(0),
|
||||
_dimsInactive(dimsInactive_) {
|
||||
_drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
|
||||
_mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false),
|
||||
_backgroundType(GUI::Theme::kDialogBackgroundDefault) {
|
||||
|
||||
// It may happen that we have 3x scaler in launcher (960xY) and then 640x480
|
||||
// game will be forced to 1x. At this stage GUI will not be aware of
|
||||
@ -113,11 +110,9 @@ void Dialog::reflowLayout() {
|
||||
// changed, so any cached image may be invalid. The subsequent redraw
|
||||
// should be treated as the very first draw.
|
||||
|
||||
_drawingHints |= THEME_HINT_FIRST_DRAW;
|
||||
Widget *w = _firstWidget;
|
||||
while (w) {
|
||||
w->reflowLayout();
|
||||
w->setHints(THEME_HINT_FIRST_DRAW);
|
||||
w = w->_next;
|
||||
}
|
||||
|
||||
@ -144,8 +139,7 @@ void Dialog::drawDialog() {
|
||||
if (!isVisible())
|
||||
return;
|
||||
|
||||
g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x+_w, _y+_h), _drawingHints);
|
||||
_drawingHints &= ~THEME_HINT_FIRST_DRAW;
|
||||
g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x+_w, _y+_h), _backgroundType);
|
||||
|
||||
// Draw all children
|
||||
Widget *w = _firstWidget;
|
||||
|
11
gui/dialog.h
11
gui/dialog.h
@ -49,15 +49,15 @@ protected:
|
||||
Widget *_focusedWidget;
|
||||
Widget *_dragWidget;
|
||||
bool _visible;
|
||||
uint16 _drawingHints;
|
||||
|
||||
Theme::DialogBackground _backgroundType;
|
||||
|
||||
private:
|
||||
int _result;
|
||||
bool _dimsInactive;
|
||||
|
||||
public:
|
||||
Dialog(int x, int y, int w, int h, bool dimsInactive = true);
|
||||
Dialog(const Common::String &name, bool dimsInactive = true);
|
||||
Dialog(int x, int y, int w, int h);
|
||||
Dialog(const Common::String &name);
|
||||
|
||||
virtual int runModal();
|
||||
|
||||
@ -91,9 +91,6 @@ protected:
|
||||
|
||||
void setResult(int result) { _result = result; }
|
||||
int getResult() const { return _result; }
|
||||
|
||||
// Whether dialog dims all underneath dialogs or not when active
|
||||
bool dimsInactive() { return _dimsInactive; }
|
||||
};
|
||||
|
||||
} // End of namespace GUI
|
||||
|
333
gui/eval.cpp
333
gui/eval.cpp
@ -1,333 +0,0 @@
|
||||
/* 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$
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common/system.h"
|
||||
#include "gui/eval.h"
|
||||
#include "gui/widget.h"
|
||||
#include "gui/newgui.h"
|
||||
|
||||
#include "graphics/scaler.h"
|
||||
|
||||
namespace GUI {
|
||||
|
||||
static bool isdelim(char c) {
|
||||
return strchr(" ;,+-<>/*%^=()", c) != 0 || c == 9 || c == '\n' || !c;
|
||||
}
|
||||
|
||||
Eval::Eval() {
|
||||
loadConstants();
|
||||
}
|
||||
|
||||
Eval::~Eval() {
|
||||
_vars.clear();
|
||||
_aliases.clear();
|
||||
}
|
||||
|
||||
int Eval::eval(const String &input, const String §ion, const String &name, int startpos) {
|
||||
int result;
|
||||
|
||||
debug(5, "%s=%s", name.c_str(), input.c_str());
|
||||
|
||||
strncpy(_input, input.c_str(), 256);
|
||||
_section = section;
|
||||
_name = name;
|
||||
_startpos = startpos;
|
||||
|
||||
_pos = 0;
|
||||
|
||||
getToken();
|
||||
|
||||
if (_tokenType == tString)
|
||||
return EVAL_STRING_VAR;
|
||||
|
||||
if (!*_token)
|
||||
exprError(eBadExpr);
|
||||
|
||||
level2(&result);
|
||||
|
||||
debug(5, "Result: %d", result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void Eval::level2(int *result) {
|
||||
char op;
|
||||
int hold;
|
||||
|
||||
level3(result);
|
||||
|
||||
while ((op = *_token) == '+' || op == '-') {
|
||||
getToken();
|
||||
level3(&hold);
|
||||
arith(op, result, &hold);
|
||||
}
|
||||
}
|
||||
|
||||
void Eval::level3(int *result) {
|
||||
char op;
|
||||
int hold;
|
||||
|
||||
level4(result);
|
||||
|
||||
while ((op = *_token) == '*' || op == '/' || op == '%') {
|
||||
getToken();
|
||||
level4(&hold);
|
||||
arith(op, result, &hold);
|
||||
}
|
||||
}
|
||||
|
||||
void Eval::level4(int *result) {
|
||||
char op;
|
||||
|
||||
op = 0;
|
||||
if ((_tokenType == tDelimiter) && (*_token == '+' || *_token == '-')) {
|
||||
op = *_token;
|
||||
getToken();
|
||||
}
|
||||
|
||||
level5(result);
|
||||
|
||||
if (op)
|
||||
unary(op, result);
|
||||
}
|
||||
|
||||
void Eval::level5(int *result) {
|
||||
if ((*_token == '(') && (_tokenType == tDelimiter)) {
|
||||
getToken();
|
||||
|
||||
level2(result);
|
||||
|
||||
if (*_token != ')')
|
||||
exprError(eUnclosedBracket);
|
||||
getToken();
|
||||
} else {
|
||||
primitive(result);
|
||||
}
|
||||
}
|
||||
|
||||
void Eval::primitive(int *result) {
|
||||
if (*_token == ')')
|
||||
exprError(eExtraBracket);
|
||||
|
||||
switch (_tokenType) {
|
||||
case tVariable:
|
||||
*result = getVar_(_token);
|
||||
if (*result == EVAL_UNDEF_VAR)
|
||||
exprError(eUndefVar);
|
||||
getToken();
|
||||
return;
|
||||
case tNumber:
|
||||
*result = atoi(_token);
|
||||
getToken();
|
||||
return;
|
||||
default:
|
||||
exprError(eSyntaxError);
|
||||
}
|
||||
}
|
||||
|
||||
void Eval::arith(char op, int *r, int *h) {
|
||||
switch (op) {
|
||||
case '-':
|
||||
*r = *r - *h;
|
||||
break;
|
||||
case '+':
|
||||
*r = *r + *h;
|
||||
break;
|
||||
case '*':
|
||||
*r = *r * *h;
|
||||
break;
|
||||
case '/':
|
||||
*r = (*r) / (*h);
|
||||
break;
|
||||
case '%':
|
||||
*r = (*r) % (*h);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Eval::unary(char op, int *r) {
|
||||
if (op == '-')
|
||||
*r = -(*r);
|
||||
}
|
||||
|
||||
void Eval::getToken() {
|
||||
char *temp;
|
||||
|
||||
_tokenType = tNone;
|
||||
temp = _token;
|
||||
|
||||
if (_input[_pos] == 0) {
|
||||
*_token = 0;
|
||||
_tokenType = tDelimiter;
|
||||
return;
|
||||
}
|
||||
while (isspace(_input[_pos]))
|
||||
_pos++;
|
||||
|
||||
if (_input[_pos] == '"') {
|
||||
_pos++;
|
||||
while (_input[_pos] != '"' && _input[_pos] != '\n')
|
||||
*temp++ = _input[_pos++];
|
||||
|
||||
if (_input[_pos] == '\n')
|
||||
exprError(eMissingQuote);
|
||||
|
||||
_pos++;
|
||||
*temp = 0;
|
||||
|
||||
_tokenType = tString;
|
||||
return;
|
||||
}
|
||||
|
||||
if (isdigit(_input[_pos])) {
|
||||
while (!isdelim(_input[_pos]))
|
||||
*temp++ = _input[_pos++];
|
||||
*temp = 0;
|
||||
|
||||
_tokenType = tNumber;
|
||||
return;
|
||||
}
|
||||
|
||||
if (isalpha(_input[_pos])) {
|
||||
while (!isdelim(_input[_pos]))
|
||||
*temp++ = _input[_pos++];
|
||||
*temp = 0;
|
||||
_tokenType = tVariable;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_tokenType && isdelim(_input[_pos])) {
|
||||
*temp++ = _input[_pos++];
|
||||
*temp = 0;
|
||||
_tokenType = tDelimiter;
|
||||
}
|
||||
}
|
||||
|
||||
void Eval::exprError(EvalErrors err) {
|
||||
static const char *errors[] = {
|
||||
"Syntax error",
|
||||
"Extra ')'",
|
||||
"Missing ')'",
|
||||
"Bad expression",
|
||||
"Undefined variable",
|
||||
"Missing '\"'"
|
||||
};
|
||||
|
||||
error("%s in section [%s] expression: \"%s\" start is at: %d near token '%s'",
|
||||
errors[err], _section.c_str(), _name.c_str(), _pos + _startpos, _token);
|
||||
}
|
||||
|
||||
struct BuiltinConsts {
|
||||
const char *name;
|
||||
int value;
|
||||
};
|
||||
|
||||
static const BuiltinConsts builtinConsts[] = {
|
||||
{"kButtonWidth", GUI::kButtonWidth},
|
||||
{"kButtonHeight", GUI::kButtonHeight},
|
||||
{"kSliderWidth", GUI::kSliderWidth},
|
||||
{"kSliderHeight", GUI::kSliderHeight},
|
||||
|
||||
{"kBigButtonWidth", GUI::kBigButtonWidth},
|
||||
{"kBigButtonHeight", GUI::kBigButtonHeight},
|
||||
{"kBigSliderWidth", GUI::kBigSliderWidth},
|
||||
{"kBigSliderHeight", GUI::kBigSliderHeight},
|
||||
|
||||
{"kNormalWidgetSize", GUI::kNormalWidgetSize},
|
||||
{"kBigWidgetSize", GUI::kBigWidgetSize},
|
||||
|
||||
{"kThumbnailWidth", kThumbnailWidth},
|
||||
|
||||
{"kTextAlignLeft", kTextAlignLeft},
|
||||
{"kTextAlignRight", kTextAlignRight},
|
||||
{"kTextAlignCenter", kTextAlignCenter},
|
||||
|
||||
{"kFontStyleBold", Theme::kFontStyleBold},
|
||||
{"kFontStyleNormal", Theme::kFontStyleNormal},
|
||||
{"kFontStyleItalic", Theme::kFontStyleItalic},
|
||||
|
||||
{"kFontStyleFixedBold", Theme::kFontStyleFixedBold},
|
||||
{"kFontStyleFixedNormal", Theme::kFontStyleFixedNormal},
|
||||
{"kFontStyleFixedItalic", Theme::kFontStyleFixedItalic},
|
||||
|
||||
{"kShadingNone", Theme::kShadingNone},
|
||||
{"kShadingDim", Theme::kShadingDim},
|
||||
{"kShadingLuminance", Theme::kShadingLuminance},
|
||||
|
||||
{"false", 0},
|
||||
{"true", 1},
|
||||
{NULL, 0}
|
||||
};
|
||||
|
||||
void Eval::loadConstants() {
|
||||
int i;
|
||||
|
||||
for (i = 0; builtinConsts[i].name; i++)
|
||||
_vars[builtinConsts[i].name] = builtinConsts[i].value;
|
||||
}
|
||||
|
||||
int Eval::getBuiltinVar(const char *s) {
|
||||
if (!strcmp(s, "w"))
|
||||
return g_system->getOverlayWidth();
|
||||
|
||||
if (!strcmp(s, "h"))
|
||||
return g_system->getOverlayHeight();
|
||||
|
||||
return EVAL_UNDEF_VAR;
|
||||
}
|
||||
|
||||
int Eval::getVar_(const Common::String &s, bool includeAliases) {
|
||||
int val;
|
||||
|
||||
val = getBuiltinVar(s.c_str());
|
||||
|
||||
if (val != EVAL_UNDEF_VAR)
|
||||
return val;
|
||||
|
||||
const Common::String *var = &s;
|
||||
if (includeAliases) {
|
||||
AliasesMap::const_iterator itera = _aliases.find(s);
|
||||
if (itera != _aliases.end())
|
||||
var = &(itera->_value);
|
||||
}
|
||||
|
||||
VariablesMap::const_iterator iterv = _vars.find(*var);
|
||||
if (iterv != _vars.end())
|
||||
return iterv->_value;
|
||||
|
||||
return EVAL_UNDEF_VAR;
|
||||
}
|
||||
|
||||
void Eval::setVar(const String §ion, const String &name, const String &value) {
|
||||
_vars[name.c_str() + 4] = eval(value, section, name, 0);
|
||||
}
|
||||
|
||||
void Eval::reset() {
|
||||
_vars.clear();
|
||||
_aliases.clear();
|
||||
loadConstants();
|
||||
}
|
||||
|
||||
} // end of namespace GUI
|
130
gui/eval.h
130
gui/eval.h
@ -1,130 +0,0 @@
|
||||
/* 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 GUI_EVAL_H
|
||||
#define GUI_EVAL_H
|
||||
|
||||
#include "common/str.h"
|
||||
#include "common/hashmap.h"
|
||||
#include "common/hash-str.h"
|
||||
|
||||
namespace GUI {
|
||||
|
||||
using Common::String;
|
||||
using Common::HashMap;
|
||||
|
||||
enum {
|
||||
EVAL_UNDEF_VAR = -13375,
|
||||
EVAL_STRING_VAR = -13376
|
||||
};
|
||||
|
||||
class Eval {
|
||||
public:
|
||||
Eval();
|
||||
~Eval();
|
||||
|
||||
int eval(const String &input, const String §ion, const String &name, int startpos);
|
||||
void setVar(const String §ion, const String &name, const String &value);
|
||||
|
||||
void setParent(const String &name);
|
||||
|
||||
void setVar(const String &name, int val) { _vars[name] = val; }
|
||||
void setStringVar(const String &name, const String &val) { _strings[name] = val; }
|
||||
void setAlias(const Common::String &name, const String &val) { _aliases[name] = val; }
|
||||
|
||||
int getVar(const Common::String &s) {
|
||||
warning("Old evaluator access: '%s'", s.c_str());
|
||||
return getVar_(s);
|
||||
}
|
||||
|
||||
int getVar(const Common::String &s, int def) {
|
||||
warning("Old evaluator access: '%s'", s.c_str());
|
||||
int val = getVar_(s);
|
||||
return (val == EVAL_UNDEF_VAR) ? def : val;
|
||||
}
|
||||
|
||||
const String &getStringVar(const Common::String &name) { return _strings[name]; }
|
||||
|
||||
uint getNumVars() { return _vars.size(); }
|
||||
|
||||
void reset();
|
||||
|
||||
char *lastToken() { return _token; }
|
||||
|
||||
typedef HashMap<String, int> VariablesMap;
|
||||
typedef HashMap<String, String> AliasesMap;
|
||||
typedef HashMap<String, String> StringsMap;
|
||||
|
||||
private:
|
||||
enum TokenTypes {
|
||||
tNone,
|
||||
tDelimiter,
|
||||
tVariable,
|
||||
tNumber,
|
||||
tString
|
||||
};
|
||||
|
||||
enum EvalErrors {
|
||||
eSyntaxError,
|
||||
eExtraBracket,
|
||||
eUnclosedBracket,
|
||||
eBadExpr,
|
||||
eUndefVar,
|
||||
eMissingQuote
|
||||
};
|
||||
|
||||
|
||||
void getToken();
|
||||
void level2(int *);
|
||||
void level3(int *);
|
||||
void level4(int *);
|
||||
void level5(int *);
|
||||
void primitive(int *);
|
||||
void arith(char op, int *r, int *h);
|
||||
void unary(char op, int *r);
|
||||
void exprError(EvalErrors error);
|
||||
int getVar_(const Common::String &s, bool includeAliases = true);
|
||||
int getBuiltinVar(const char *s);
|
||||
void loadConstants();
|
||||
|
||||
char _input[256];
|
||||
String _section;
|
||||
String _name;
|
||||
|
||||
int _startpos;
|
||||
|
||||
TokenTypes _tokenType;
|
||||
int _pos;
|
||||
|
||||
char _token[256];
|
||||
|
||||
AliasesMap _aliases;
|
||||
VariablesMap _vars;
|
||||
StringsMap _strings;
|
||||
};
|
||||
|
||||
} // end of namespace GUI
|
||||
|
||||
#endif
|
@ -34,7 +34,6 @@
|
||||
#include "gui/about.h"
|
||||
#include "gui/browser.h"
|
||||
#include "gui/chooser.h"
|
||||
#include "gui/eval.h"
|
||||
#include "gui/launcher.h"
|
||||
#include "gui/massadd.h"
|
||||
#include "gui/message.h"
|
||||
@ -161,7 +160,6 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
|
||||
|
||||
// GUI: Add tab widget
|
||||
TabWidget *tab = new TabWidget(this, "GameOptions.TabWidget");
|
||||
tab->setHints(THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND);
|
||||
|
||||
//
|
||||
// 1) The game tab
|
||||
@ -471,7 +469,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
|
||||
|
||||
LauncherDialog::LauncherDialog()
|
||||
: Dialog(0, 0, 320, 200) {
|
||||
_drawingHints |= THEME_HINT_MAIN_DIALOG;
|
||||
_backgroundType = GUI::Theme::kDialogBackgroundMain;
|
||||
|
||||
const int screenW = g_system->getOverlayWidth();
|
||||
const int screenH = g_system->getOverlayHeight();
|
||||
|
@ -9,7 +9,6 @@ MODULE_OBJS := \
|
||||
dialog.o \
|
||||
editable.o \
|
||||
EditTextWidget.o \
|
||||
eval.o \
|
||||
ThemeRenderer.o \
|
||||
launcher.o \
|
||||
ListWidget.o \
|
||||
|
@ -28,9 +28,6 @@
|
||||
#include "graphics/cursorman.h"
|
||||
#include "gui/newgui.h"
|
||||
#include "gui/dialog.h"
|
||||
#include "gui/eval.h"
|
||||
#include "gui/ThemeModern.h"
|
||||
#include "gui/ThemeClassic.h"
|
||||
#include "gui/ThemeRenderer.h"
|
||||
|
||||
#include "common/config-manager.h"
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "gui/browser.h"
|
||||
#include "gui/themebrowser.h"
|
||||
#include "gui/chooser.h"
|
||||
#include "gui/eval.h"
|
||||
#include "gui/message.h"
|
||||
#include "gui/newgui.h"
|
||||
#include "gui/ThemeEval.h"
|
||||
@ -664,7 +663,6 @@ GlobalOptionsDialog::GlobalOptionsDialog()
|
||||
|
||||
// The tab widget
|
||||
TabWidget *tab = new TabWidget(this, "GlobalOptions.TabWidget");
|
||||
tab->setHints(THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND);
|
||||
|
||||
//
|
||||
// 1) The graphics tab
|
||||
|
@ -1,772 +0,0 @@
|
||||
/* 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$
|
||||
*/
|
||||
|
||||
#include "gui/theme.h"
|
||||
#include "gui/eval.h"
|
||||
|
||||
namespace GUI {
|
||||
|
||||
const char *Theme::_defaultConfigINI =
|
||||
"# Define our classic greenish theme here\n"
|
||||
"[320xY]\n"
|
||||
"def_widgetSize=kNormalWidgetSize\n"
|
||||
"def_buttonWidth=kButtonWidth\n"
|
||||
"def_buttonHeight=kButtonHeight\n"
|
||||
"def_sliderWidth=kSliderWidth\n"
|
||||
"def_sliderHeight=kSliderHeight\n"
|
||||
"def_kLineHeight=12\n"
|
||||
"def_kFontHeight=10\n"
|
||||
"def_insetX=10\n"
|
||||
"def_insetY=10\n"
|
||||
"def_insetW=(w - 2 * 10)\n"
|
||||
"def_insetH=(h - 30)\n"
|
||||
"def_gameOptionsLabelWidth=60\n"
|
||||
"def_tabPopupsLabelW=100\n"
|
||||
"def_aboutXOff=3\n"
|
||||
"def_aboutYOff=2\n"
|
||||
"def_aboutOuterBorder=10\n"
|
||||
"def_scummmainHOffset=8\n"
|
||||
"def_scummmainVSpace=5\n"
|
||||
"def_scummmainVAddOff=2\n"
|
||||
"def_scummmainButtonWidth=90\n"
|
||||
"def_scummmainButtonHeight=16\n"
|
||||
"def_scummhelpX=5\n"
|
||||
"def_scummhelpW=(w - 2 * 5)\n"
|
||||
"def_midiControlsSpacing=1\n"
|
||||
"def_vcAudioTabIndent=0\n"
|
||||
"def_vcAudioTabSpacing=2\n"
|
||||
"use=XxY\n"
|
||||
"\n"
|
||||
"# Override audio tab\n"
|
||||
"set_parent=gameoptions\n"
|
||||
"vBorder=5\n"
|
||||
"\n"
|
||||
"# audio tab\n"
|
||||
"opYoffset=vBorder\n"
|
||||
"useWithPrefix=audioControls globaloptions_\n"
|
||||
"useWithPrefix=subtitleControls globaloptions_\n"
|
||||
"\n"
|
||||
"# volume tab\n"
|
||||
"opYoffset=vBorder\n"
|
||||
"useWithPrefix=volumeControls globaloptions_\n"
|
||||
"\n"
|
||||
"# audio tab\n"
|
||||
"opYoffset=vBorder\n"
|
||||
"gameoptions_audioCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight\n"
|
||||
"opYoffset=(opYoffset + buttonHeight + 6)\n"
|
||||
"useWithPrefix=audioControls gameoptions_\n"
|
||||
"useWithPrefix=subtitleControls gameoptions_\n"
|
||||
"\n"
|
||||
"# volume tab\n"
|
||||
"opYoffset=vBorder\n"
|
||||
"gameoptions_volumeCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight\n"
|
||||
"opYoffset=(opYoffset + buttonHeight + 6)\n"
|
||||
"useWithPrefix=volumeControls gameoptions_\n"
|
||||
"\n"
|
||||
"TabWidget.tabWidth=0\n"
|
||||
"TabWidget.tabHeight=16\n"
|
||||
"TabWidget.titleVPad=2\n"
|
||||
"# Scumm Saveload dialog\n"
|
||||
"scummsaveload=8 8 (w - 2 * 8) (h - 16)\n"
|
||||
"set_parent=scummsaveload\n"
|
||||
"scummsaveload_title=10 2 (parent.w - 2 * 10) kLineHeight\n"
|
||||
"scummsaveload_list=10 18 prev.w (parent.h - 17 - buttonHeight - 8 - self.y)\n"
|
||||
"scummsaveload_thumbnail=(parent.w - (kThumbnailWidth + 22)) 18\n"
|
||||
"scummsaveload_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight\n"
|
||||
"scummsaveload_choose=(prev.x2 + 10) prev.y prev.w prev.h\n"
|
||||
"scummsaveload_extinfo.visible=false\n"
|
||||
"\n"
|
||||
"# MM NES resolution\n"
|
||||
"[256x240]\n"
|
||||
"useAsIs=320xY\n"
|
||||
"\n"
|
||||
"[XxY]\n"
|
||||
"def_widgetSize=kBigWidgetSize\n"
|
||||
"def_buttonWidth=kBigButtonWidth\n"
|
||||
"def_buttonHeight=kBigButtonHeight\n"
|
||||
"def_sliderWidth=kBigSliderWidth\n"
|
||||
"def_sliderHeight=kBigSliderHeight\n"
|
||||
"def_kLineHeight=16\n"
|
||||
"def_kFontHeight=14\n"
|
||||
"def_insetX=10\n"
|
||||
"def_insetY=20\n"
|
||||
"def_insetW=(w - 2 * 10)\n"
|
||||
"def_insetH=(h - 2 * 40)\n"
|
||||
"def_gameOptionsLabelWidth=90\n"
|
||||
"def_tabPopupsLabelW=150\n"
|
||||
"def_aboutXOff=8\n"
|
||||
"def_aboutYOff=5\n"
|
||||
"def_aboutOuterBorder=80\n"
|
||||
"def_scummmainHOffset=12\n"
|
||||
"def_scummmainVSpace=7\n"
|
||||
"def_scummmainVAddOff=3\n"
|
||||
"def_scummmainButtonWidth=160\n"
|
||||
"def_scummmainButtonHeight=28\n"
|
||||
"def_scummhelpW=370\n"
|
||||
"def_scummhelpX=((w - scummhelpW) / 2)\n"
|
||||
"def_midiControlsSpacing=2\n"
|
||||
"def_vcAudioTabIndent=10\n"
|
||||
"def_vcAudioTabSpacing=4\n"
|
||||
"##### Widgets config\n"
|
||||
"ListWidget.leftPadding=4\n"
|
||||
"ListWidget.rightPadding=0\n"
|
||||
"ListWidget.topPadding=2\n"
|
||||
"ListWidget.bottomPadding=2\n"
|
||||
"ListWidget.hlLeftPadding=2\n"
|
||||
"ListWidget.hlRightPadding=1\n"
|
||||
"PopUpWidget.leftPadding=4\n"
|
||||
"PopUpWidget.rightPadding=0\n"
|
||||
"TabWidget.tabWidth=70\n"
|
||||
"TabWidget.tabHeight=22\n"
|
||||
"TabWidget.titleVPad=2\n"
|
||||
"\n"
|
||||
"###### chooser\n"
|
||||
"opHeight=(h * 7 / 10)\n"
|
||||
"useWithPrefix=chooser defaultChooser_\n"
|
||||
"\n"
|
||||
"##### browser\n"
|
||||
"brW=((w * 7) / 8)\n"
|
||||
"brH=((h * 9) / 10)\n"
|
||||
"browser=((w - brW) / 2) ((h - brH) / 2) brW brH\n"
|
||||
"set_parent=browser\n"
|
||||
"browser_headline=10 kLineHeight (parent.w - 2 * 10) kLineHeight\n"
|
||||
"browser_headline.align=kTextAlignCenter\n"
|
||||
"browser_path=10 prev.y2 prev.w prev.h\n"
|
||||
"browser_list=10 prev.y2 prev.w (parent.h - 3 * kLineHeight - buttonHeight - 14)\n"
|
||||
"browser_up=10 (parent.h - buttonHeight - 8) buttonWidth buttonHeight\n"
|
||||
"browser_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight\n"
|
||||
"browser_choose=(prev.x2 + 10) prev.y prev.w prev.h\n"
|
||||
"\n"
|
||||
"##### launcher\n"
|
||||
"hBorder=10\n"
|
||||
"launcher_version=hBorder 8 (w - 2 * hBorder) kLineHeight\n"
|
||||
"launcher_version.align=kTextAlignCenter\n"
|
||||
"top=(h - 8 - buttonHeight)\n"
|
||||
"numButtons=4\n"
|
||||
"space=8\n"
|
||||
"butWidth=((w - 2 * hBorder - space * (numButtons - 1)) / numButtons)\n"
|
||||
"launcher_quit_button=hBorder top butWidth buttonHeight\n"
|
||||
"launcher_about_button=(prev.x2 + space) prev.y prev.w prev.h\n"
|
||||
"launcher_options_button=(prev.x2 + space) prev.y prev.w prev.h\n"
|
||||
"launcher_start_button=(prev.x2 + space) prev.y prev.w prev.h\n"
|
||||
"top=(top - buttonHeight * 2)\n"
|
||||
"numButtons=3\n"
|
||||
"space=10\n"
|
||||
"butWidth=((w - 2 * hBorder - space * (numButtons - 1)) / numButtons)\n"
|
||||
"launcher_addGame_button=hBorder top butWidth buttonHeight\n"
|
||||
"launcher_editGame_button=(prev.x2 + space) prev.y prev.w prev.h\n"
|
||||
"launcher_removeGame_button=(prev.x2 + space) prev.y prev.w prev.h\n"
|
||||
"launcher_list=hBorder (kLineHeight + 16) (w - 2 * hBorder) (top - kLineHeight - 20)\n"
|
||||
"\n"
|
||||
"### global options\n"
|
||||
"globaloptions=insetX insetY insetW insetH\n"
|
||||
"set_parent=globaloptions\n"
|
||||
"vBorder=5\n"
|
||||
"globaloptions_tabwidget=0 0 parent.w (parent.h - buttonHeight - 8 - 2 * vBorder)\n"
|
||||
"\n"
|
||||
"# graphics tab\n"
|
||||
"opYoffset=vBorder\n"
|
||||
"opXoffset=0\n"
|
||||
"useWithPrefix=graphicsControls globaloptions_\n"
|
||||
"\n"
|
||||
"# audio tab\n"
|
||||
"opYoffset=vBorder\n"
|
||||
"useWithPrefix=audioControls globaloptions_\n"
|
||||
"useWithPrefix=subtitleControls globaloptions_\n"
|
||||
"\n"
|
||||
"# volume tab\n"
|
||||
"opYoffset=vBorder\n"
|
||||
"useWithPrefix=volumeControls globaloptions_\n"
|
||||
"\n"
|
||||
"# MIDI tab\n"
|
||||
"opYoffset=vBorder\n"
|
||||
"useWithPrefix=midiControls globaloptions_\n"
|
||||
"\n"
|
||||
"# paths tab\n"
|
||||
"yoffset=vBorder\n"
|
||||
"glOff=((buttonHeight - kLineHeight) / 2 + 2)\n"
|
||||
"globaloptions_savebutton=10 yoffset (buttonWidth + 5) buttonHeight\n"
|
||||
"globaloptions_savepath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight\n"
|
||||
"yoffset=(yoffset + buttonHeight + 4)\n"
|
||||
"globaloptions_extrabutton=10 yoffset (buttonWidth + 5) buttonHeight\n"
|
||||
"globaloptions_extrapath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight\n"
|
||||
"yoffset=(yoffset + buttonHeight + 4)\n"
|
||||
"globaloptions_themebutton=10 yoffset (buttonWidth + 5) buttonHeight\n"
|
||||
"globaloptions_themepath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight\n"
|
||||
"yoffset=(yoffset + buttonHeight + 4)\n"
|
||||
"globaloptions_pluginsbutton=10 yoffset (buttonWidth + 5) buttonHeight\n"
|
||||
"globaloptions_pluginspath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight\n"
|
||||
"yoffset=(yoffset + buttonHeight + 4)\n"
|
||||
"globaloptions_keysbutton=10 yoffset (buttonWidth + 5) buttonHeight\n"
|
||||
"\n"
|
||||
"# Misc options\n"
|
||||
"yoffset=vBorder\n"
|
||||
"glOff=((buttonHeight - kLineHeight) / 2 + 2)\n"
|
||||
"globaloptions_themebutton2=10 yoffset buttonWidth buttonHeight\n"
|
||||
"globaloptions_curtheme=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 10) kLineHeight\n"
|
||||
"yoffset=(yoffset + buttonHeight + 4)\n"
|
||||
"globaloptions_autosaveperiod=10 yoffset (parent.w - 10 - 25) (kLineHeight + 2)\n"
|
||||
"\n"
|
||||
"globaloptions_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight\n"
|
||||
"globaloptions_ok=(prev.x2 + 10) prev.y prev.w prev.h\n"
|
||||
"\n"
|
||||
"### game options\n"
|
||||
"gameoptions=insetX insetY insetW insetH\n"
|
||||
"set_parent=gameoptions\n"
|
||||
"vBorder=5\n"
|
||||
"gox=5\n"
|
||||
"gow=(parent.w - 15)\n"
|
||||
"\n"
|
||||
"gameoptions_tabwidget=0 vBorder parent.w (parent.h - buttonHeight - 8 - 2 * vBorder)\n"
|
||||
"\n"
|
||||
"# game tab\n"
|
||||
"opYoffset=vBorder\n"
|
||||
"gameoptions_id=gox (opYoffset + 2) gameOptionsLabelWidth kLineHeight\n"
|
||||
"gameoptions_id.align=kTextAlignRight\n"
|
||||
"gameoptions_domain=prev.x2 (prev.y - 1) (parent.w - gameOptionsLabelWidth - 10 - gox) (prev.h + 2)\n"
|
||||
"opYoffset=(opYoffset + prev.h + 5)\n"
|
||||
"gameoptions_name=gox (opYoffset + 2) gameOptionsLabelWidth kLineHeight\n"
|
||||
"gameoptions_name.align=kTextAlignRight\n"
|
||||
"gameoptions_desc=prev.x2 (prev.y - 1) (parent.w - gameOptionsLabelWidth - 10 - gox) (prev.h + 2)\n"
|
||||
"opYoffset=(opYoffset + prev.h + 7)\n"
|
||||
"gameoptions_lang=gox (opYoffset - 1) gow (kLineHeight + 2)\n"
|
||||
"opYoffset=(opYoffset + prev.h + 5)\n"
|
||||
"gameoptions_platform=prev.x opYoffset prev.w prev.h\n"
|
||||
"opYoffset=(opYoffset + prev.h + 5)\n"
|
||||
"\n"
|
||||
"# paths tab\n"
|
||||
"opYoffset=vBorder\n"
|
||||
"goOff=((buttonHeight - kLineHeight) / 2 + 2)\n"
|
||||
"gameoptions_savepath=gox opYoffset (buttonWidth + 5) buttonHeight\n"
|
||||
"gameoptions_savepathText=(prev.x2 + 20) (opYoffset + goOff) (parent.w - self.x - 10) kLineHeight\n"
|
||||
"opYoffset=(opYoffset + buttonHeight + 4)\n"
|
||||
"gameoptions_extrapath=gox opYoffset (buttonWidth + 5) buttonHeight\n"
|
||||
"gameoptions_extrapathText=(prev.x2 + 20) (opYoffset + goOff) (parent.w - self.x - 10) kLineHeight\n"
|
||||
"opYoffset=(opYoffset + buttonHeight + 4)\n"
|
||||
"gameoptions_gamepath=gox opYoffset (buttonWidth + 5) buttonHeight\n"
|
||||
"gameoptions_gamepathText=(prev.x2 + 20) (opYoffset + goOff) (parent.w - self.x - 10) kLineHeight\n"
|
||||
"opYoffset=(opYoffset + buttonHeight + 4)\n"
|
||||
"\n"
|
||||
"# graphics tab\n"
|
||||
"opYoffset=vBorder\n"
|
||||
"opXoffset=gox\n"
|
||||
"gameoptions_graphicsCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight\n"
|
||||
"opYoffset=(opYoffset + buttonHeight)\n"
|
||||
"useWithPrefix=graphicsControls gameoptions_\n"
|
||||
"\n"
|
||||
"# audio tab\n"
|
||||
"opYoffset=vBorder\n"
|
||||
"gameoptions_audioCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight\n"
|
||||
"opYoffset=(opYoffset + buttonHeight)\n"
|
||||
"useWithPrefix=audioControls gameoptions_\n"
|
||||
"useWithPrefix=subtitleControls gameoptions_\n"
|
||||
"\n"
|
||||
"# volume tab\n"
|
||||
"opYoffset=vBorder\n"
|
||||
"gameoptions_volumeCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight\n"
|
||||
"opYoffset=(opYoffset + buttonHeight)\n"
|
||||
"useWithPrefix=volumeControls gameoptions_\n"
|
||||
"\n"
|
||||
"# midi tab\n"
|
||||
"opYoffset=vBorder\n"
|
||||
"gameoptions_midiCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight\n"
|
||||
"opYoffset=(opYoffset + buttonHeight)\n"
|
||||
"useWithPrefix=midiControls gameoptions_\n"
|
||||
"\n"
|
||||
"gameoptions_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight\n"
|
||||
"gameoptions_ok=(prev.x2 + 10) prev.y prev.w prev.h\n"
|
||||
"\n"
|
||||
"### keys dialog\n"
|
||||
"keysdialog=(w / 20) (h / 10) (w - w / 10) (h - h / 4)\n"
|
||||
"set_parent=keysdialog\n"
|
||||
"keysdialog_map=(parent.w - buttonWidth - 10) (10 + 2 * kLineHeight) buttonWidth buttonHeight\n"
|
||||
"keysdialog_ok=prev.x (prev.y2 + 4) prev.w prev.h\n"
|
||||
"keysdialog_cancel=prev.x (prev.y2 + 4) prev.w prev.h\n"
|
||||
"keysdialog_action=10 10 (parent.w - 20) kLineHeight\n"
|
||||
"keysdialog_action.align=kTextAlignCenter\n"
|
||||
"keysdialog_list=prev.x (prev.y + 2 * kLineHeight) (parent.w - buttonWidth - 30) (parent.h - kLineHeight * 6)\n"
|
||||
"keysdialog_mapping=prev.x (prev.y + prev.h + kLineHeight) (parent.w - buttonWidth - 20) kLineHeight\n"
|
||||
"\n"
|
||||
"### mass add dialog\n"
|
||||
"massadddialog=10 20 300 174\n"
|
||||
"set_parent=massadddialog\n"
|
||||
"massadddialog_caption=10 (10 + 1 * kLineHeight) (parent.w - 2*10) kLineHeight\n"
|
||||
"massadddialog_caption.align=kTextAlignCenter\n"
|
||||
"massadddialog_dirprogress=10 (10 + 3 * kLineHeight) (parent.w - 2*10) kLineHeight\n"
|
||||
"massadddialog_dirprogress.align=kTextAlignCenter\n"
|
||||
"massadddialog_gameprogress=10 (10 + 4 * kLineHeight) (parent.w - 2*10) kLineHeight\n"
|
||||
"massadddialog_gameprogress.align=kTextAlignCenter\n"
|
||||
"massadddialog_ok=((parent.w - (buttonWidth * 2)) / 2) (parent.h - buttonHeight - 8) buttonWidth buttonHeight\n"
|
||||
"massadddialog_cancel=(prev.x2 + 10) prev.y prev.w prev.h\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"##### SCUMM dialogs\n"
|
||||
"scummDummyDialog=0 80 0 16\n"
|
||||
"\n"
|
||||
"use=scummmain\n"
|
||||
"## Engine config\n"
|
||||
"# note that scummconfig size depends on overall height\n"
|
||||
"# hence it is on the end of the list\n"
|
||||
"opYoffset=8\n"
|
||||
"useWithPrefix=volumeControls scummconfig_\n"
|
||||
"useWithPrefix=subtitleControls scummconfig_\n"
|
||||
"opYoffset=(opYoffset + buttonHeight)\n"
|
||||
"opYoffset=(opYoffset + buttonHeight + 4)\n"
|
||||
"soWidth=(39 + 3 * buttonWidth)\n"
|
||||
"scummconfig_keys=(soWidth - 3 * (buttonWidth + 4) + 6) opYoffset (buttonWidth - 10) buttonHeight\n"
|
||||
"scummconfig_cancel=(prev.x2 + 4) prev.y (prev.w + 10) prev.h\n"
|
||||
"scummconfig_ok=(prev.x2 + 4) prev.y prev.w prev.h\n"
|
||||
"opYoffset=(opYoffset + buttonHeight)\n"
|
||||
"scummconfig=((w - soWidth) / 2) ((h - opYoffset) / 2) soWidth (opYoffset + 8)\n"
|
||||
"\n"
|
||||
"## Help\n"
|
||||
"scummHelpNumLines=15\n"
|
||||
"shH=(5 + (2 + scummHelpNumLines) * kFontHeight + buttonHeight + 7)\n"
|
||||
"scummhelp=scummhelpX ((h - shH) / 2) scummhelpW shH\n"
|
||||
"scummhelp_title=10 5 scummhelpW kFontHeight\n"
|
||||
"scummhelp_key.x=10\n"
|
||||
"scummhelp_key.yoffset=5\n"
|
||||
"scummhelp_key.w=80\n"
|
||||
"scummhelp_key.h=kFontHeight\n"
|
||||
"scummhelp_dsc.x=90\n"
|
||||
"scummhelp_dsc.yoffset=5\n"
|
||||
"scummhelp_dsc.w=(scummhelpW - 10 - 90)\n"
|
||||
"scummhelp_dsc.h=kFontHeight\n"
|
||||
"scummhelp_prev=10 (5 + kFontHeight * (scummHelpNumLines + 2) + 2) buttonWidth buttonHeight\n"
|
||||
"scummhelp_next=(prev.x2 + 8) prev.y prev.w prev.h\n"
|
||||
"scummhelp_close=(scummhelpW - 8 - buttonWidth) prev.y prev.w prev.h\n"
|
||||
"\n"
|
||||
"# Saveload dialog\n"
|
||||
"scummsaveload=8 8 (w - 2 * 8) (h - 16)\n"
|
||||
"set_parent=scummsaveload\n"
|
||||
"scummsaveload_title=10 2 (parent.w - 2 * 10 - 180) kLineHeight\n"
|
||||
"scummsaveload_title.align=kTextAlignCenter\n"
|
||||
"scummsaveload_list=10 18 prev.w (parent.h - 17 - buttonHeight - 8 - self.y)\n"
|
||||
"scummsaveload_thumbnail=(parent.w - (kThumbnailWidth + 18)) 22\n"
|
||||
"scummsaveload_thumbnail.hPad=4\n"
|
||||
"scummsaveload_thumbnail.vPad=4\n"
|
||||
"scummsaveload_thumbnail.fillR=0\n"
|
||||
"scummsaveload_thumbnail.fillG=0\n"
|
||||
"scummsaveload_thumbnail.fillB=0\n"
|
||||
"scummsaveload_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight\n"
|
||||
"scummsaveload_choose=(prev.x2 + 10) prev.y prev.w prev.h\n"
|
||||
"scummsaveload_extinfo.visible=true\n"
|
||||
"\n"
|
||||
"############################################\n"
|
||||
"[chooser]\n"
|
||||
"chooserW=(w - 2 * 8)\n"
|
||||
"chooser=((w - chooserW) / 2) ((h - opHeight) / 2) chooserW opHeight\n"
|
||||
"chooser_headline=10 6 (chooserW - 2 * 10) (kLineHeight)\n"
|
||||
"chooser_headline.align=kTextAlignCenter\n"
|
||||
"chooser_list=10 (6 + kLineHeight + 2) prev.w (opHeight - self.y - buttonHeight - 12)\n"
|
||||
"chooser_cancel=(chooserW - 2 * (buttonWidth + 10)) (opHeight - buttonHeight - 8) buttonWidth buttonHeight\n"
|
||||
"chooser_ok=(prev.x2 + 10) prev.y prev.w prev.h\n"
|
||||
"\n"
|
||||
"[graphicsControls]\n"
|
||||
"gcx=10\n"
|
||||
"gcw=(parent.w - 2 * 10)\n"
|
||||
"grModePopup=(gcx - 5) (opYoffset - 1) (gcw + 5) (kLineHeight + 2)\n"
|
||||
"opYoffset=(opYoffset + kLineHeight + 4)\n"
|
||||
"grRenderPopup=prev.x (opYoffset - 1) prev.w prev.h\n"
|
||||
"opYoffset=(opYoffset + kLineHeight + 4)\n"
|
||||
"grFullscreenCheckbox=gcx opYoffset (parent.w - gcx - 5) buttonHeight\n"
|
||||
"opYoffset=(opYoffset + buttonHeight)\n"
|
||||
"grAspectCheckbox=prev.x opYoffset prev.w prev.h\n"
|
||||
"opYoffset=(opYoffset + buttonHeight)\n"
|
||||
"\n"
|
||||
"[audioControls]\n"
|
||||
"aux=10\n"
|
||||
"auw=(parent.w - 2 * 10)\n"
|
||||
"auMidiPopup=(aux - 5) (opYoffset - 1) (auw + 5) (kLineHeight + 2)\n"
|
||||
"opYoffset=(opYoffset + buttonHeight + 4)\n"
|
||||
"auSampleRatePopup=(aux - 5) (opYoffset - 1) (auw + 5) (kLineHeight + 2)\n"
|
||||
"opYoffset=(opYoffset + buttonHeight + 4)\n"
|
||||
"\n"
|
||||
"[volumeControls]\n"
|
||||
"vctextw=(95 + vcAudioTabIndent)\n"
|
||||
"vcxoff=(opXoffset + vctextw + 15)\n"
|
||||
"vcx=(opXoffset + 10)\n"
|
||||
"vcMusicText=vcx (opYoffset + 2) vctextw kLineHeight\n"
|
||||
"vcMusicText.align=kTextAlignRight\n"
|
||||
"vcMusicSlider=vcxoff opYoffset sliderWidth sliderHeight\n"
|
||||
"vcMusicLabel=(vcxoff + prev.w + 10) (opYoffset + 2) 24 kLineHeight\n"
|
||||
"opYoffset=(opYoffset + sliderHeight + vcAudioTabSpacing)\n"
|
||||
"vcSfxText=vcx (opYoffset + 2) vctextw kLineHeight\n"
|
||||
"vcSfxText.align=kTextAlignRight\n"
|
||||
"vcSfxSlider=vcxoff opYoffset sliderWidth sliderHeight\n"
|
||||
"vcSfxLabel=(vcxoff + prev.w + 10) (opYoffset + 2) 24 kLineHeight\n"
|
||||
"opYoffset=(opYoffset + sliderHeight + vcAudioTabSpacing)\n"
|
||||
"vcSpeechText=vcx (opYoffset + 2) vctextw kLineHeight\n"
|
||||
"vcSpeechText.align=kTextAlignRight\n"
|
||||
"vcSpeechSlider=vcxoff opYoffset sliderWidth sliderHeight\n"
|
||||
"vcSpeechLabel=(vcxoff + prev.w + 10) (opYoffset + 2) 24 kLineHeight\n"
|
||||
"opYoffset=(opYoffset + sliderHeight + vcAudioTabSpacing)\n"
|
||||
"\n"
|
||||
"[midiControls]\n"
|
||||
"mcx=10\n"
|
||||
"mcFontButton=mcx opYoffset buttonWidth buttonHeight\n"
|
||||
"mcFontPath=(prev.x2 + 20) (opYoffset + 3) (parent.w - (buttonWidth + 20) - 15 - kLineHeight - 10) kLineHeight\n"
|
||||
"mcFontClearButton=(prev.x2 + 10) (opYoffset + 2) kLineHeight kLineHeight\n"
|
||||
"opYoffset=(opYoffset + buttonHeight + 2 * midiControlsSpacing)\n"
|
||||
"mcMixedCheckbox=mcx opYoffset (parent.w - mcx - 5) buttonHeight\n"
|
||||
"opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)\n"
|
||||
"mcMt32Checkbox=mcx opYoffset prev.w buttonHeight\n"
|
||||
"opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)\n"
|
||||
"mcGSCheckbox=mcx opYoffset prev.w buttonHeight\n"
|
||||
"opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)\n"
|
||||
"mcMidiGainText=mcx (opYoffset + 2) 95 kLineHeight\n"
|
||||
"mcMidiGainText.align=kTextAlignRight\n"
|
||||
"mcMidiGainSlider=(prev.x2 + 10) opYoffset sliderWidth sliderHeight\n"
|
||||
"mcMidiGainLabel=(prev.x2 + 10) (opYoffset + 2) 40 kLineHeight\n"
|
||||
"opYoffset=(opYoffset + sliderHeight + midiControlsSpacing)\n"
|
||||
"\n"
|
||||
"[subtitleControls]\n"
|
||||
"sbx=(opXoffset + 10)\n"
|
||||
"sbYoff=(buttonHeight / 8)\n"
|
||||
"sbOff=((sliderHeight - kLineHeight) / 2 + 2)\n"
|
||||
"sbtextw=(100 + vcAudioTabIndent)\n"
|
||||
"opYoffset=(opYoffset + sbYoff)\n"
|
||||
"subToggleDesc=sbx (opYoffset + sbYoff) sbtextw buttonHeight\n"
|
||||
"subToggleDesc.align=kTextAlignRight\n"
|
||||
"subToggleButton=prev.x2 (opYoffset - sbYoff) (buttonWidth + 54) buttonHeight\n"
|
||||
"opYoffset=(opYoffset + buttonHeight + 6)\n"
|
||||
"subSubtitleSpeedDesc=sbx (opYoffset + sbOff) sbtextw kLineHeight\n"
|
||||
"subSubtitleSpeedDesc.align=kTextAlignRight\n"
|
||||
"subSubtitleSpeedSlider=prev.x2 opYoffset sliderWidth sliderHeight\n"
|
||||
"subSubtitleSpeedLabel=(prev.x2 + 10) (opYoffset + sbOff) 24 kLineHeight\n"
|
||||
"opYoffset=(opYoffset + sliderHeight + 8)\n"
|
||||
"\n"
|
||||
"[scummmain]\n"
|
||||
"## Main dialog\n"
|
||||
"# note that scummmain size depends on overall height\n"
|
||||
"smY=(scummmainVSpace + scummmainVAddOff)\n"
|
||||
"scummmain_resume=scummmainHOffset smY scummmainButtonWidth scummmainButtonHeight\n"
|
||||
"smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n"
|
||||
"smY=(smY + scummmainVSpace)\n"
|
||||
"scummmain_load=prev.x smY prev.w prev.h\n"
|
||||
"smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n"
|
||||
"scummmain_save=prev.x smY prev.w prev.h\n"
|
||||
"smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n"
|
||||
"smY=(smY + scummmainVSpace)\n"
|
||||
"scummmain_options=prev.x smY prev.w prev.h\n"
|
||||
"smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n"
|
||||
"scummmain_about=prev.x smY prev.w prev.h\n"
|
||||
"smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n"
|
||||
"scummmain_help=prev.x smY prev.w prev.h\n"
|
||||
"smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n"
|
||||
"smY=(smY + scummmainVSpace)\n"
|
||||
"scummmain_quit=prev.x smY prev.w prev.h\n"
|
||||
"smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n"
|
||||
"smW=(scummmainButtonWidth + 2 * scummmainHOffset)\n"
|
||||
"smH=(smY + scummmainVSpace)\n"
|
||||
"scummmain=((w - smW) / 2) ((h - smH) / 2) smW smH\n"
|
||||
"\n"
|
||||
"# PSP GUI\n"
|
||||
"[480x272]\n"
|
||||
"def_buttonWidth=100\n"
|
||||
"def_buttonHeight=23\n"
|
||||
"def_insetX=20\n"
|
||||
"def_insetY=10\n"
|
||||
"def_insetW=(w - 2 * insetX)\n"
|
||||
"def_insetH=(h - 13 - insetY)\n"
|
||||
"def_launcherVersionX=50\n"
|
||||
"def_launcherVersionY=5\n"
|
||||
"def_midiControlsSpacing=2\n"
|
||||
"def_gameOptionsOverrideVPad=10\n"
|
||||
"def_aboutXOff=3\n"
|
||||
"def_aboutYOff=2\n"
|
||||
"def_aboutOuterBorder=10\n"
|
||||
"\n"
|
||||
"use=XxY\n"
|
||||
"";
|
||||
|
||||
using Common::String;
|
||||
|
||||
void Theme::processSingleLine(const String §ion, const String &prefix, const String &name, const String &str) {
|
||||
int level = 0;
|
||||
int start = 0;
|
||||
uint i;
|
||||
int value;
|
||||
const char *selfpostfixes[] = {"self.x", "self.y", "self.w", "self.h"};
|
||||
const char *postfixesXYWH[] = {".x", ".y", ".w", ".h"};
|
||||
const char *postfixesRGB[] = {".r", ".g", ".b"};
|
||||
int npostfix = 0;
|
||||
const String prefixedname(prefix + name);
|
||||
|
||||
// Make self.BLAH work, but not self.ANYTHING.BLAH
|
||||
if (!strchr(prefixedname.c_str(), '.')) {
|
||||
for (i = 0; i < ARRAYSIZE(postfixesXYWH); i++) {
|
||||
String to(prefixedname);
|
||||
|
||||
to += postfixesXYWH[i];
|
||||
|
||||
_evaluator->setAlias(selfpostfixes[i], to);
|
||||
_evaluator->setVar(to, EVAL_UNDEF_VAR);
|
||||
}
|
||||
}
|
||||
|
||||
// Count the number of parameters, so that we know if they're meant to
|
||||
// be XY[WH] or RGB.
|
||||
|
||||
int ntmppostfix = 0;
|
||||
|
||||
for (i = 0; i < str.size(); i++) {
|
||||
if (isspace(str[i]) && level == 0) {
|
||||
ntmppostfix++;
|
||||
}
|
||||
|
||||
if (str[i] == '(')
|
||||
level++;
|
||||
else if (str[i] == ')') {
|
||||
if (level == 0) {
|
||||
error("Extra ')' in section: [%s] expression: \"%s\" start is at: %d",
|
||||
section.c_str(), name.c_str(), start);
|
||||
}
|
||||
level--;
|
||||
}
|
||||
}
|
||||
|
||||
if (level > 0)
|
||||
error("Missing ')' in section: [%s] expression: \"%s\" start is at: %d",
|
||||
section.c_str(), name.c_str(), start);
|
||||
|
||||
const char **postfixes = (ntmppostfix == 2) ? postfixesRGB : postfixesXYWH;
|
||||
|
||||
// Now do it for real, only this time we already know the parentheses
|
||||
// are balanced.
|
||||
|
||||
for (i = 0; i < str.size(); i++) {
|
||||
if (isspace(str[i]) && level == 0) {
|
||||
value = _evaluator->eval(String(&(str.c_str()[start]), i - start), section, name + postfixes[npostfix], start);
|
||||
_evaluator->setVar(prefixedname + postfixes[npostfix++], value);
|
||||
start = i + 1;
|
||||
}
|
||||
if (str[i] == '(')
|
||||
level++;
|
||||
else if (str[i] == ')')
|
||||
level--;
|
||||
}
|
||||
|
||||
value = _evaluator->eval(String(&(str.c_str()[start]), i - start), section, name + postfixes[npostfix], start);
|
||||
|
||||
if (value == EVAL_STRING_VAR)
|
||||
_evaluator->setStringVar(prefixedname, _evaluator->lastToken());
|
||||
|
||||
// process VAR=VALUE construct
|
||||
if (npostfix == 0) {
|
||||
_evaluator->setVar(name, value);
|
||||
|
||||
// Fix bug #1742561: "GUI: Missaligned text"
|
||||
// "blah.align=foo" should be prefixed too
|
||||
_evaluator->setVar(prefixedname, value);
|
||||
} else {
|
||||
_evaluator->setVar(prefixedname + postfixes[npostfix], value);
|
||||
}
|
||||
|
||||
// If we have all 4 parameters, set .x2 and .y2
|
||||
if (npostfix == 3) {
|
||||
_evaluator->setVar(prefixedname + ".x2",
|
||||
_evaluator->getVar(prefixedname + ".x") + _evaluator->getVar(prefixedname + ".w"));
|
||||
_evaluator->setVar(prefixedname + ".y2",
|
||||
_evaluator->getVar(prefixedname + ".y") + _evaluator->getVar(prefixedname + ".h"));
|
||||
}
|
||||
|
||||
if (npostfix != 0)
|
||||
setSpecialAlias("prev", prefixedname);
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
|
||||
Common::ConfigFile::SectionKeyList::const_iterator iterk;
|
||||
for (iterk = keys.begin(); iterk != keys.end(); ++iterk) {
|
||||
if (iterk->key == "set_parent") {
|
||||
setSpecialAlias("parent", prefix + iterk->value);
|
||||
continue;
|
||||
}
|
||||
if (iterk->key.hasPrefix("set_")) {
|
||||
_evaluator->setAlias(iterk->key.c_str() + 4, prefix + iterk->value);
|
||||
continue;
|
||||
}
|
||||
if (iterk->key.hasPrefix("def_")) {
|
||||
if (!skipDefs)
|
||||
_evaluator->setVar(name, prefix + iterk->key, iterk->value);
|
||||
continue;
|
||||
}
|
||||
if (iterk->key == "use") {
|
||||
if (iterk->value == name)
|
||||
error("Theme section [%s]: cannot use itself", name.c_str());
|
||||
if (!config.hasSection(iterk->value))
|
||||
error("Undefined use of section [%s]", iterk->value.c_str());
|
||||
processResSection(config, iterk->value, true);
|
||||
continue;
|
||||
}
|
||||
if (iterk->key == "useAsIs") {
|
||||
if (iterk->value == name)
|
||||
error("Theme section [%s]: cannot use itself", name.c_str());
|
||||
if (!config.hasSection(iterk->value))
|
||||
error("Undefined use of section [%s]", iterk->value.c_str());
|
||||
processResSection(config, iterk->value);
|
||||
continue;
|
||||
}
|
||||
if (iterk->key == "useWithPrefix") {
|
||||
const char *temp = iterk->value.c_str();
|
||||
const char *pos = strrchr(temp, ' ');
|
||||
|
||||
if (pos == NULL)
|
||||
error("2 arguments required for useWithPrefix keyword");
|
||||
|
||||
String n(temp, strchr(temp, ' ') - temp);
|
||||
String pref(pos + 1);
|
||||
|
||||
if (n == name)
|
||||
error("Theme section [%s]: cannot use itself", n.c_str());
|
||||
if (!config.hasSection(n))
|
||||
error("Undefined use of section [%s]", n.c_str());
|
||||
processResSection(config, n, true, pref);
|
||||
continue;
|
||||
}
|
||||
processSingleLine(name, prefix, iterk->key, iterk->value);
|
||||
}
|
||||
}
|
||||
|
||||
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(alias + postfixes[i]);
|
||||
String to(name + postfixes[i]);
|
||||
|
||||
_evaluator->setAlias(from.c_str(), to);
|
||||
}
|
||||
}
|
||||
|
||||
bool Theme::sectionIsSkipped(Common::ConfigFile &config, const char *name, int w, int h) {
|
||||
if (!config.hasKey("skipFor", name))
|
||||
return false;
|
||||
|
||||
String res;
|
||||
|
||||
config.getKey("skipFor", name, res);
|
||||
|
||||
int x, y;
|
||||
int phase = 0;
|
||||
const char *ptr = res.c_str();
|
||||
|
||||
x = y = 0;
|
||||
|
||||
while (phase != 3) {
|
||||
switch (phase) {
|
||||
case 0:
|
||||
if (*ptr >= '0' && *ptr <= '9') {
|
||||
x = x * 10 + *ptr - '0';
|
||||
} else if (*ptr == 'X') {
|
||||
phase = 1;
|
||||
} else if (*ptr == 'x') {
|
||||
phase = 1;
|
||||
} else {
|
||||
error("Syntax error. Wrong resolution in skipFor in section %s", name);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (*ptr >= '0' && *ptr <= '9') {
|
||||
y = y * 10 + *ptr - '0';
|
||||
} else if (*ptr == 'Y' || !*ptr || *ptr == ',') {
|
||||
phase = 2;
|
||||
|
||||
if ((x == w || x == 0) && (y == h || y == 0))
|
||||
return true;
|
||||
if (!*ptr)
|
||||
return false;
|
||||
if (*ptr == ',') {
|
||||
phase = x = y = 0;
|
||||
}
|
||||
} else {
|
||||
error("Syntax error. Wrong resolution in skipFor in section %s", name);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (*ptr == ',') {
|
||||
phase = x = y = 0;
|
||||
} else if (!*ptr) {
|
||||
if ((x == w || x == 0) && (y == h || y == 0))
|
||||
return true;
|
||||
return false;
|
||||
} else {
|
||||
error ("Syntax error. Wrong resolution in skipFor in section %s", name);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ptr++;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Theme::loadTheme(Common::ConfigFile &config, bool reset) {
|
||||
char name[80];
|
||||
int x = g_system->getOverlayWidth(), y = g_system->getOverlayHeight();
|
||||
|
||||
if (reset)
|
||||
_evaluator->reset();
|
||||
|
||||
strcpy(name, "XxY");
|
||||
if (config.hasSection(name) && !sectionIsSkipped(config, "XxY", x, y))
|
||||
processResSection(config, name);
|
||||
|
||||
sprintf(name, "%dxY", x);
|
||||
if (config.hasSection(name) && !sectionIsSkipped(config, name, x, y))
|
||||
processResSection(config, name);
|
||||
|
||||
sprintf(name, "Xx%d", y);
|
||||
if (config.hasSection(name) && !sectionIsSkipped(config, name, x, y))
|
||||
processResSection(config, name);
|
||||
|
||||
sprintf(name, "%dx%d", x, y);
|
||||
if (config.hasSection(name) && !sectionIsSkipped(config, name, x, y))
|
||||
processResSection(config, name);
|
||||
|
||||
debug(3, "Number of variables: %d", _evaluator->getNumVars());
|
||||
}
|
||||
|
||||
void Theme::loadTheme(Common::ConfigFile &config, bool reset, bool doBackendSpecificPostProcessing) {
|
||||
loadTheme(config, reset);
|
||||
|
||||
if (doBackendSpecificPostProcessing && !g_system->getExtraThemeConfig().empty()) {
|
||||
Common::ConfigFile myConfig;
|
||||
Common::String myConfigINI = g_system->getExtraThemeConfig();
|
||||
Common::MemoryReadStream s((const byte *)myConfigINI.c_str(), myConfigINI.size());
|
||||
myConfig.loadFromStream(s);
|
||||
loadTheme(myConfig, false);
|
||||
}
|
||||
}
|
||||
|
||||
} // End of namespace GUI
|
@ -23,8 +23,6 @@
|
||||
*/
|
||||
|
||||
#include "gui/theme.h"
|
||||
#include "gui/eval.h"
|
||||
|
||||
#include "common/unzip.h"
|
||||
|
||||
namespace GUI {
|
||||
|
43
gui/theme.h
43
gui/theme.h
@ -40,39 +40,6 @@ namespace GUI {
|
||||
|
||||
class ThemeEval;
|
||||
|
||||
//! Hint to the theme engine that the widget is used in a non-standard way.
|
||||
enum ThemeHint {
|
||||
//! Indicates that this is the first time the widget is drawn.
|
||||
THEME_HINT_FIRST_DRAW = 1 << 0,
|
||||
|
||||
/**
|
||||
* Indicates that the widget will be redrawn often, e.g. list widgets.
|
||||
* It may therefore be a good idea to save the background so that it
|
||||
* can be redrawn quickly.
|
||||
*/
|
||||
THEME_HINT_SAVE_BACKGROUND = 1 << 1,
|
||||
|
||||
//! Indicates that this is the launcher dialog (maybe delete this in the future)
|
||||
THEME_HINT_MAIN_DIALOG = 1 << 2,
|
||||
|
||||
//! Indicates special colorfade
|
||||
THEME_HINT_SPECIAL_COLOR = 1 << 3,
|
||||
|
||||
//! Indicates no colorfade
|
||||
THEME_HINT_PLAIN_COLOR = 1 << 4,
|
||||
|
||||
//! Indictaes that a shadows should be drawn around the background
|
||||
THEME_HINT_USE_SHADOW = 1 << 5,
|
||||
|
||||
/**
|
||||
* Indicates that no background should be restored when drawing the widget
|
||||
* (note that this can be silently ignored if for example the theme does
|
||||
* alpha blending and would blend over an already drawn widget)
|
||||
* TODO: currently only ThemeModern::drawButton supports this
|
||||
*/
|
||||
THEME_HINT_NO_BACKGROUND_RESTORE = 1 << 6
|
||||
};
|
||||
|
||||
/**
|
||||
* Our theme renderer class.
|
||||
*
|
||||
@ -109,6 +76,14 @@ public:
|
||||
kWidgetBackgroundEditText, //! Background used for edit text fields
|
||||
kWidgetBackgroundSlider //! Background used for sliders
|
||||
};
|
||||
|
||||
//! Dialog background type
|
||||
enum DialogBackground {
|
||||
kDialogBackgroundMain,
|
||||
kDialogBackgroundSpecial,
|
||||
kDialogBackgroundPlain,
|
||||
kDialogBackgroundDefault
|
||||
};
|
||||
|
||||
//! State of the widget to be drawn
|
||||
enum State {
|
||||
@ -271,7 +246,7 @@ public:
|
||||
virtual int getStringWidth(const Common::String &str, FontStyle font = kFontStyleBold) const = 0;
|
||||
virtual int getCharWidth(byte c, FontStyle font = kFontStyleBold) const = 0;
|
||||
|
||||
virtual void drawDialogBackground(const Common::Rect &r, uint16 hints, WidgetStateInfo state = kStateEnabled) = 0;
|
||||
virtual void drawDialogBackground(const Common::Rect &r, DialogBackground type, WidgetStateInfo state = kStateEnabled) = 0;
|
||||
virtual void drawText(const Common::Rect &r, const Common::String &str, WidgetStateInfo state = kStateEnabled, TextAlign align = kTextAlignCenter, bool inverted = false, int deltax = 0, bool useEllipsis = true, FontStyle font = kFontStyleBold) = 0;
|
||||
// this should ONLY be used by the debugger until we get a nicer solution
|
||||
virtual void drawChar(const Common::Rect &r, byte ch, const Graphics::Font *font, WidgetStateInfo state = kStateEnabled) = 0;
|
||||
|
@ -53,7 +53,7 @@ ThemeBrowser::ThemeBrowser() : Dialog("Browser") {
|
||||
_fileList->setNumberingMode(kListNumberingOff);
|
||||
_fileList->setEditable(false);
|
||||
|
||||
_fileList->setHints(THEME_HINT_PLAIN_COLOR);
|
||||
_backgroundType = GUI::Theme::kDialogBackgroundPlain;
|
||||
|
||||
// Buttons
|
||||
new ButtonWidget(this, "Browser.Cancel", "Cancel", kCloseCmd, 0);
|
||||
|
@ -1,466 +0,0 @@
|
||||
# $URL$
|
||||
# $Id$
|
||||
[theme]
|
||||
version=23
|
||||
type=classic
|
||||
name=Classic (ScummVM 0.8.0)
|
||||
|
||||
[colors]
|
||||
color=104 104 104
|
||||
shadowcolor=64 64 64
|
||||
bgcolor=0 0 0
|
||||
textcolor=32 160 32
|
||||
textcolorhi=0 255 0
|
||||
|
||||
[extra]
|
||||
font="builtin"
|
||||
blending=true
|
||||
|
||||
[XxY]
|
||||
def_widgetSize=kBigWidgetSize
|
||||
def_buttonWidth=kBigButtonWidth
|
||||
def_buttonHeight=kBigButtonHeight
|
||||
def_sliderWidth=kBigSliderWidth
|
||||
def_sliderHeight=kBigSliderHeight
|
||||
def_kLineHeight=16
|
||||
def_kFontHeight=14
|
||||
def_insetX=10
|
||||
def_insetY=20
|
||||
def_insetW=(w - 2 * 10)
|
||||
def_insetH=(h - 2 * 40)
|
||||
def_gameOptionsLabelWidth=90
|
||||
def_tabPopupsLabelW=150
|
||||
def_aboutXOff=8
|
||||
def_aboutYOff=5
|
||||
def_aboutOuterBorder=80
|
||||
def_scummmainHOffset=12
|
||||
def_scummmainVSpace=7
|
||||
def_scummmainVAddOff=3
|
||||
def_scummmainButtonWidth=160
|
||||
def_scummmainButtonHeight=28
|
||||
def_scummhelpW=370
|
||||
def_scummhelpX=((w - scummhelpW) / 2)
|
||||
def_midiControlsSpacing=2
|
||||
def_vcAudioTabIndent=10
|
||||
def_vcAudioTabSpacing=4
|
||||
|
||||
use=colors
|
||||
use=extra
|
||||
|
||||
##### Widgets config
|
||||
ListWidget.leftPadding=4
|
||||
ListWidget.rightPadding=0
|
||||
ListWidget.topPadding=2
|
||||
ListWidget.bottomPadding=2
|
||||
ListWidget.hlLeftPadding=2
|
||||
ListWidget.hlRightPadding=1
|
||||
PopUpWidget.leftPadding=4
|
||||
PopUpWidget.rightPadding=0
|
||||
TabWidget.tabWidth=70
|
||||
TabWidget.tabHeight=21
|
||||
TabWidget.titleVPad=2
|
||||
|
||||
###### chooser
|
||||
opHeight=(h * 7 / 10)
|
||||
useWithPrefix=chooser defaultChooser_
|
||||
|
||||
##### browser
|
||||
brW=((w * 7) / 8)
|
||||
brH=((h * 9) / 10)
|
||||
browser=((w - brW) / 2) ((h - brH) / 2) brW brH
|
||||
set_parent=browser
|
||||
browser_headline=10 kLineHeight (parent.w - 2 * 10) kLineHeight
|
||||
browser_headline.align=kTextAlignCenter
|
||||
browser_path=10 prev.y2 prev.w prev.h
|
||||
browser_list=10 prev.y2 prev.w (parent.h - 3 * kLineHeight - buttonHeight - 14)
|
||||
browser_up=10 (parent.h - buttonHeight - 8) buttonWidth buttonHeight
|
||||
browser_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
|
||||
browser_choose=(prev.x2 + 10) prev.y prev.w prev.h
|
||||
|
||||
##### launcher
|
||||
hBorder=10
|
||||
launcher_version=hBorder 8 (w - 2 * hBorder) kLineHeight
|
||||
launcher_version.align=kTextAlignCenter
|
||||
top=(h - 8 - buttonHeight)
|
||||
numButtons=4
|
||||
space=8
|
||||
butWidth=((w - 2 * hBorder - space * (numButtons - 1)) / numButtons)
|
||||
launcher_quit_button=hBorder top butWidth buttonHeight
|
||||
launcher_about_button=(prev.x2 + space) prev.y prev.w prev.h
|
||||
launcher_options_button=(prev.x2 + space) prev.y prev.w prev.h
|
||||
launcher_start_button=(prev.x2 + space) prev.y prev.w prev.h
|
||||
top=(top - buttonHeight * 2)
|
||||
numButtons=3
|
||||
space=10
|
||||
butWidth=((w - 2 * hBorder - space * (numButtons - 1)) / numButtons)
|
||||
launcher_addGame_button=hBorder top butWidth buttonHeight
|
||||
launcher_editGame_button=(prev.x2 + space) prev.y prev.w prev.h
|
||||
launcher_removeGame_button=(prev.x2 + space) prev.y prev.w prev.h
|
||||
launcher_list=hBorder (kLineHeight + 16) (w - 2 * hBorder) (top - kLineHeight - 20)
|
||||
|
||||
### global options
|
||||
globaloptions=insetX insetY insetW insetH
|
||||
set_parent=globaloptions
|
||||
vBorder=5
|
||||
globaloptions_tabwidget=0 vBorder parent.w (parent.h - buttonHeight - 8 - 2 * vBorder)
|
||||
|
||||
# graphics tab
|
||||
opYoffset=vBorder
|
||||
opXoffset=0
|
||||
useWithPrefix=graphicsControls globaloptions_
|
||||
|
||||
# audio tab
|
||||
opYoffset=vBorder
|
||||
useWithPrefix=audioControls globaloptions_
|
||||
useWithPrefix=subtitleControls globaloptions_
|
||||
|
||||
# volume tab
|
||||
opYoffset=vBorder
|
||||
useWithPrefix=volumeControls globaloptions_
|
||||
|
||||
# MIDI tab
|
||||
opYoffset=vBorder
|
||||
useWithPrefix=midiControls globaloptions_
|
||||
|
||||
# paths tab
|
||||
yoffset=vBorder
|
||||
glOff=((buttonHeight - kLineHeight) / 2 + 2)
|
||||
globaloptions_savebutton=10 yoffset (buttonWidth + 5) buttonHeight
|
||||
globaloptions_savepath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight
|
||||
yoffset=(yoffset + buttonHeight + 4)
|
||||
globaloptions_extrabutton=10 yoffset (buttonWidth + 5) buttonHeight
|
||||
globaloptions_extrapath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight
|
||||
yoffset=(yoffset + buttonHeight + 4)
|
||||
globaloptions_themebutton=10 yoffset (buttonWidth + 5) buttonHeight
|
||||
globaloptions_themepath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight
|
||||
yoffset=(yoffset + buttonHeight + 4)
|
||||
globaloptions_pluginsbutton=10 yoffset (buttonWidth + 5) buttonHeight
|
||||
globaloptions_pluginspath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight
|
||||
yoffset=(yoffset + buttonHeight + 4)
|
||||
globaloptions_keysbutton=10 yoffset (buttonWidth + 5) buttonHeight
|
||||
|
||||
# Misc options
|
||||
yoffset=vBorder
|
||||
glOff=((buttonHeight - kLineHeight) / 2 + 2)
|
||||
globaloptions_themebutton2=10 yoffset buttonWidth buttonHeight
|
||||
globaloptions_curtheme=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 10) kLineHeight
|
||||
yoffset=(yoffset + buttonHeight + 12)
|
||||
globaloptions_autosaveperiod=10 yoffset (parent.w - 10 - 25) (kLineHeight + 2)
|
||||
|
||||
globaloptions_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
|
||||
globaloptions_ok=(prev.x2 + 10) prev.y prev.w prev.h
|
||||
|
||||
### game options
|
||||
gameoptions=insetX insetY insetW insetH
|
||||
set_parent=gameoptions
|
||||
vBorder=5
|
||||
gox=5
|
||||
gow=(parent.w - 15)
|
||||
|
||||
gameoptions_tabwidget=0 vBorder parent.w (parent.h - buttonHeight - 8 - 2 * vBorder)
|
||||
|
||||
# game tab
|
||||
opYoffset=vBorder
|
||||
gameoptions_id=gox (opYoffset + 2) gameOptionsLabelWidth kLineHeight
|
||||
gameoptions_id.align=kTextAlignRight
|
||||
gameoptions_domain=prev.x2 (prev.y - 1) (parent.w - gameOptionsLabelWidth - 10 - gox) (prev.h + 2)
|
||||
opYoffset=(opYoffset + prev.h + 5)
|
||||
gameoptions_name=gox (opYoffset + 2) gameOptionsLabelWidth kLineHeight
|
||||
gameoptions_name.align=kTextAlignRight
|
||||
gameoptions_desc=prev.x2 (prev.y - 1) (parent.w - gameOptionsLabelWidth - 10 - gox) (prev.h + 2)
|
||||
opYoffset=(opYoffset + prev.h + 7)
|
||||
gameoptions_lang=gox (opYoffset - 1) gow (kLineHeight + 2)
|
||||
opYoffset=(opYoffset + prev.h + 5)
|
||||
gameoptions_platform=prev.x opYoffset prev.w prev.h
|
||||
opYoffset=(opYoffset + prev.h + 5)
|
||||
|
||||
# paths tab
|
||||
opYoffset=vBorder
|
||||
goOff=((buttonHeight - kLineHeight) / 2 + 2)
|
||||
gameoptions_savepath=gox opYoffset (buttonWidth + 5) buttonHeight
|
||||
gameoptions_savepathText=(prev.x2 + 20) (opYoffset + goOff) (parent.w - self.x - 10) kLineHeight
|
||||
opYoffset=(opYoffset + buttonHeight + 4)
|
||||
gameoptions_extrapath=gox opYoffset (buttonWidth + 5) buttonHeight
|
||||
gameoptions_extrapathText=(prev.x2 + 20) (opYoffset + goOff) (parent.w - self.x - 10) kLineHeight
|
||||
opYoffset=(opYoffset + buttonHeight + 4)
|
||||
gameoptions_gamepath=gox opYoffset (buttonWidth + 5) buttonHeight
|
||||
gameoptions_gamepathText=(prev.x2 + 20) (opYoffset + goOff) (parent.w - self.x - 10) kLineHeight
|
||||
opYoffset=(opYoffset + buttonHeight + 4)
|
||||
|
||||
# graphics tab
|
||||
opYoffset=vBorder
|
||||
opXoffset=gox
|
||||
gameoptions_graphicsCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight
|
||||
opYoffset=(opYoffset + buttonHeight)
|
||||
useWithPrefix=graphicsControls gameoptions_
|
||||
|
||||
# audio tab
|
||||
opYoffset=vBorder
|
||||
gameoptions_audioCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight
|
||||
opYoffset=(opYoffset + buttonHeight)
|
||||
useWithPrefix=audioControls gameoptions_
|
||||
useWithPrefix=subtitleControls gameoptions_
|
||||
|
||||
# volume tab
|
||||
opYoffset=vBorder
|
||||
gameoptions_volumeCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight
|
||||
opYoffset=(opYoffset + buttonHeight)
|
||||
useWithPrefix=volumeControls gameoptions_
|
||||
|
||||
# midi tab
|
||||
opYoffset=vBorder
|
||||
gameoptions_midiCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight
|
||||
opYoffset=(opYoffset + buttonHeight)
|
||||
useWithPrefix=midiControls gameoptions_
|
||||
|
||||
gameoptions_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
|
||||
gameoptions_ok=(prev.x2 + 10) prev.y prev.w prev.h
|
||||
|
||||
### keys dialog
|
||||
keysdialog=(w / 20) (h / 10) (w - w / 10) (h - h / 5)
|
||||
set_parent=keysdialog
|
||||
keysdialog_map=(parent.w - buttonWidth - 10) 20 buttonWidth buttonHeight
|
||||
keysdialog_ok=prev.x (prev.y2 + 4) prev.w prev.h
|
||||
keysdialog_cancel=prev.x (prev.y2 + 4) prev.w prev.h
|
||||
keysdialog_list=10 10 (prev.x - 20) (parent.h - kLineHeight * 4 - self.y)
|
||||
keysdialog_action=prev.x (parent.h - kLineHeight * 3) (parent.w - self.x * 2) kLineHeight
|
||||
keysdialog_mapping=prev.x (prev.y + kLineHeight) prev.w prev.h
|
||||
|
||||
### mass add dialog
|
||||
massadddialog=10 20 300 174
|
||||
set_parent=massadddialog
|
||||
massadddialog_caption=10 (10 + 1 * kLineHeight) (parent.w - 2*10) kLineHeight
|
||||
massadddialog_caption.align=kTextAlignCenter
|
||||
massadddialog_dirprogress=10 (10 + 3 * kLineHeight) prev.w prev.h
|
||||
massadddialog_dirprogress.align=kTextAlignCenter
|
||||
massadddialog_gameprogress=10 (10 + 4 * kLineHeight) prev.w prev.h
|
||||
massadddialog_gameprogress.align=kTextAlignCenter
|
||||
massadddialog_ok=((parent.w - (buttonWidth * 2)) / 2) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
|
||||
massadddialog_cancel=(prev.x2 + 10) prev.y prev.w prev.h
|
||||
|
||||
|
||||
##### SCUMM dialogs
|
||||
scummDummyDialog=0 80 0 16
|
||||
|
||||
use=scummmain
|
||||
## Engine config
|
||||
# note that scummconfig size depends on overall height
|
||||
# hence it is on the end of the list
|
||||
opYoffset=8
|
||||
useWithPrefix=volumeControls scummconfig_
|
||||
useWithPrefix=subtitleControls scummconfig_
|
||||
opYoffset=(opYoffset + buttonHeight)
|
||||
opYoffset=(opYoffset + buttonHeight + 4)
|
||||
soWidth=(39 + 3 * buttonWidth)
|
||||
scummconfig_keys=(soWidth - 3 * (buttonWidth + 4) + 6) opYoffset (buttonWidth - 10) buttonHeight
|
||||
scummconfig_cancel=(prev.x2 + 4) prev.y (prev.w + 10) prev.h
|
||||
scummconfig_ok=(prev.x2 + 4) prev.y prev.w prev.h
|
||||
opYoffset=(opYoffset + buttonHeight)
|
||||
scummconfig=((w - soWidth) / 2) ((h - opYoffset) / 2) soWidth (opYoffset + 8)
|
||||
|
||||
## Help
|
||||
scummHelpNumLines=15
|
||||
shH=(5 + (2 + scummHelpNumLines) * kFontHeight + buttonHeight + 7)
|
||||
scummhelp=scummhelpX ((h - shH) / 2) scummhelpW shH
|
||||
scummhelp_title=10 5 scummhelpW kFontHeight
|
||||
scummhelp_key.x=10
|
||||
scummhelp_key.yoffset=5
|
||||
scummhelp_key.w=80
|
||||
scummhelp_key.h=kFontHeight
|
||||
scummhelp_dsc.x=90
|
||||
scummhelp_dsc.yoffset=5
|
||||
scummhelp_dsc.w=(scummhelpW - 10 - 90)
|
||||
scummhelp_dsc.h=kFontHeight
|
||||
scummhelp_prev=10 (5 + kFontHeight * (scummHelpNumLines + 2) + 2) buttonWidth buttonHeight
|
||||
scummhelp_next=(prev.x2 + 8) prev.y prev.w prev.h
|
||||
scummhelp_close=(scummhelpW - 8 - buttonWidth) prev.y prev.w prev.h
|
||||
|
||||
# Saveload dialog
|
||||
scummsaveload=8 8 (w - 2 * 8) (h - 16)
|
||||
set_parent=scummsaveload
|
||||
scummsaveload_title=10 2 (parent.w - 2 * 10 - 180) kLineHeight
|
||||
scummsaveload_title.align=kTextAlignCenter
|
||||
scummsaveload_list=10 18 prev.w (parent.h - 17 - buttonHeight - 8 - self.y)
|
||||
scummsaveload_thumbnail=(parent.w - (kThumbnailWidth + 18)) 22
|
||||
scummsaveload_thumbnail.hPad=4
|
||||
scummsaveload_thumbnail.vPad=4
|
||||
scummsaveload_thumbnail.fillR=0
|
||||
scummsaveload_thumbnail.fillG=0
|
||||
scummsaveload_thumbnail.fillB=0
|
||||
scummsaveload_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
|
||||
scummsaveload_choose=(prev.x2 + 10) prev.y prev.w prev.h
|
||||
scummsaveload_extinfo.visible=true
|
||||
|
||||
############################################
|
||||
[chooser]
|
||||
chooserW=(w - 2 * 8)
|
||||
chooser=((w - chooserW) / 2) ((h - opHeight) / 2) chooserW opHeight
|
||||
chooser_headline=10 6 (chooserW - 2 * 10) (kLineHeight)
|
||||
chooser_headline.align=kTextAlignCenter
|
||||
chooser_list=10 (6 + kLineHeight + 2) prev.w (opHeight - self.y - buttonHeight - 12)
|
||||
chooser_cancel=(chooserW - 2 * (buttonWidth + 10)) (opHeight - buttonHeight - 8) buttonWidth buttonHeight
|
||||
chooser_ok=(prev.x2 + 10) prev.y prev.w prev.h
|
||||
|
||||
[graphicsControls]
|
||||
gcx=10
|
||||
gcw=(parent.w - 2 * 10)
|
||||
grModePopup=(gcx - 5) (opYoffset - 1) (gcw + 5) (kLineHeight + 2)
|
||||
opYoffset=(opYoffset + kLineHeight + 4)
|
||||
grRenderPopup=prev.x (opYoffset - 1) prev.w prev.h
|
||||
opYoffset=(opYoffset + kLineHeight + 4)
|
||||
grFullscreenCheckbox=gcx opYoffset (parent.w - gcx - 5) buttonHeight
|
||||
opYoffset=(opYoffset + buttonHeight)
|
||||
grAspectCheckbox=prev.x opYoffset prev.w prev.h
|
||||
opYoffset=(opYoffset + buttonHeight)
|
||||
|
||||
[audioControls]
|
||||
aux=10
|
||||
auw=(parent.w - 2 * 10)
|
||||
auMidiPopup=(aux - 5) (opYoffset - 1) (auw + 5) (kLineHeight + 2)
|
||||
opYoffset=(opYoffset + buttonHeight + 4)
|
||||
auSampleRatePopup=(aux - 5) (opYoffset - 1) (auw + 5) (kLineHeight + 2)
|
||||
opYoffset=(opYoffset + buttonHeight + 4)
|
||||
|
||||
[volumeControls]
|
||||
vctextw=(95 + vcAudioTabIndent)
|
||||
vcxoff=(opXoffset + vctextw + 15)
|
||||
vcx=(opXoffset + 10)
|
||||
vcMusicText=vcx (opYoffset + 2) vctextw kLineHeight
|
||||
vcMusicText.align=kTextAlignRight
|
||||
vcMusicSlider=vcxoff opYoffset sliderWidth sliderHeight
|
||||
vcMusicLabel=(vcxoff + prev.w + 10) (opYoffset + 2) 24 kLineHeight
|
||||
opYoffset=(opYoffset + sliderHeight + vcAudioTabSpacing)
|
||||
vcSfxText=vcx (opYoffset + 2) vctextw kLineHeight
|
||||
vcSfxText.align=kTextAlignRight
|
||||
vcSfxSlider=vcxoff opYoffset sliderWidth sliderHeight
|
||||
vcSfxLabel=(vcxoff + prev.w + 10) (opYoffset + 2) 24 kLineHeight
|
||||
opYoffset=(opYoffset + sliderHeight + vcAudioTabSpacing)
|
||||
vcSpeechText=vcx (opYoffset + 2) vctextw kLineHeight
|
||||
vcSpeechText.align=kTextAlignRight
|
||||
vcSpeechSlider=vcxoff opYoffset sliderWidth sliderHeight
|
||||
vcSpeechLabel=(vcxoff + prev.w + 10) (opYoffset + 2) 24 kLineHeight
|
||||
opYoffset=(opYoffset + sliderHeight + vcAudioTabSpacing)
|
||||
|
||||
[midiControls]
|
||||
mcx=10
|
||||
mcFontButton=mcx opYoffset buttonWidth buttonHeight
|
||||
mcFontPath=(prev.x2 + 20) (opYoffset + 3) (parent.w - (buttonWidth + 20) - mcx - kLineHeight - 20) kLineHeight
|
||||
mcFontClearButton=(prev.x2 + 10) (opYoffset + 3) kLineHeight kLineHeight
|
||||
opYoffset=(opYoffset + buttonHeight + 2 * midiControlsSpacing)
|
||||
mcMixedCheckbox=mcx opYoffset (parent.w - mcx - 5) buttonHeight
|
||||
opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)
|
||||
mcMt32Checkbox=mcx opYoffset prev.w buttonHeight
|
||||
opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)
|
||||
mcGSCheckbox=mcx opYoffset prev.w buttonHeight
|
||||
opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)
|
||||
mcMidiGainText=mcx (opYoffset + 2) 95 kLineHeight
|
||||
mcMidiGainText.align=kTextAlignRight
|
||||
mcMidiGainSlider=(prev.x2 + 10) opYoffset sliderWidth sliderHeight
|
||||
mcMidiGainLabel=(prev.x2 + 10) (opYoffset + 2) 40 kLineHeight
|
||||
opYoffset=(opYoffset + sliderHeight + midiControlsSpacing)
|
||||
|
||||
[subtitleControls]
|
||||
sbx=(opXoffset + 10)
|
||||
sbYoff=(buttonHeight / 8)
|
||||
sbOff=((sliderHeight - kLineHeight) / 2 + 2)
|
||||
sbtextw=(100 + vcAudioTabIndent)
|
||||
opYoffset=(opYoffset + sbYoff)
|
||||
subToggleDesc=sbx (opYoffset + sbYoff) sbtextw buttonHeight
|
||||
subToggleDesc.align=kTextAlignRight
|
||||
subToggleButton=prev.x2 (opYoffset - sbYoff) (buttonWidth + 54) buttonHeight
|
||||
opYoffset=(opYoffset + buttonHeight + 6)
|
||||
subSubtitleSpeedDesc=sbx (opYoffset + sbOff) sbtextw kLineHeight
|
||||
subSubtitleSpeedDesc.align=kTextAlignRight
|
||||
subSubtitleSpeedSlider=prev.x2 opYoffset sliderWidth sliderHeight
|
||||
subSubtitleSpeedLabel=(prev.x2 + 10) (opYoffset + sbOff) 24 kLineHeight
|
||||
opYoffset=(opYoffset + sliderHeight + 8)
|
||||
|
||||
[scummmain]
|
||||
## Main dialog
|
||||
# note that scummmain size depends on overall height
|
||||
smY=(scummmainVSpace + scummmainVAddOff)
|
||||
scummmain_resume=scummmainHOffset smY scummmainButtonWidth scummmainButtonHeight
|
||||
smY=(smY + scummmainButtonHeight + scummmainVAddOff)
|
||||
smY=(smY + scummmainVSpace)
|
||||
scummmain_load=prev.x smY prev.w prev.h
|
||||
smY=(smY + scummmainButtonHeight + scummmainVAddOff)
|
||||
scummmain_save=prev.x smY prev.w prev.h
|
||||
smY=(smY + scummmainButtonHeight + scummmainVAddOff)
|
||||
smY=(smY + scummmainVSpace)
|
||||
scummmain_options=prev.x smY prev.w prev.h
|
||||
smY=(smY + scummmainButtonHeight + scummmainVAddOff)
|
||||
scummmain_about=prev.x smY prev.w prev.h
|
||||
smY=(smY + scummmainButtonHeight + scummmainVAddOff)
|
||||
scummmain_help=prev.x smY prev.w prev.h
|
||||
smY=(smY + scummmainButtonHeight + scummmainVAddOff)
|
||||
smY=(smY + scummmainVSpace)
|
||||
scummmain_quit=prev.x smY prev.w prev.h
|
||||
smY=(smY + scummmainButtonHeight + scummmainVAddOff)
|
||||
smW=(scummmainButtonWidth + 2 * scummmainHOffset)
|
||||
smH=(smY + scummmainVSpace)
|
||||
scummmain=((w - smW) / 2) ((h - smH) / 2) smW smH
|
||||
|
||||
# Define our classic greenish theme here
|
||||
[320xY]
|
||||
def_widgetSize=kNormalWidgetSize
|
||||
def_buttonWidth=kButtonWidth
|
||||
def_buttonHeight=kButtonHeight
|
||||
def_sliderWidth=kSliderWidth
|
||||
def_sliderHeight=kSliderHeight
|
||||
def_kLineHeight=12
|
||||
def_kFontHeight=10
|
||||
def_insetX=10
|
||||
def_insetY=10
|
||||
def_insetW=(w - 2 * 10)
|
||||
def_insetH=(h - 30)
|
||||
def_gameOptionsLabelWidth=60
|
||||
def_tabPopupsLabelW=100
|
||||
def_aboutXOff=3
|
||||
def_aboutYOff=2
|
||||
def_aboutOuterBorder=10
|
||||
def_scummmainHOffset=8
|
||||
def_scummmainVSpace=5
|
||||
def_scummmainVAddOff=2
|
||||
def_scummmainButtonWidth=90
|
||||
def_scummmainButtonHeight=16
|
||||
def_scummhelpX=5
|
||||
def_scummhelpW=(w - 2 * 5)
|
||||
def_midiControlsSpacing=1
|
||||
def_vcAudioTabIndent=0
|
||||
def_vcAudioTabSpacing=2
|
||||
use=XxY
|
||||
|
||||
TabWidget.tabWidth=0
|
||||
TabWidget.tabHeight=16
|
||||
TabWidget.titleVPad=2
|
||||
# Scumm Saveload dialog
|
||||
scummsaveload=8 8 (w - 2 * 8) (h - 16)
|
||||
set_parent=scummsaveload
|
||||
scummsaveload_title=10 2 (parent.w - 2 * 10) kLineHeight
|
||||
scummsaveload_list=10 18 prev.w (parent.h - 17 - buttonHeight - 8 - self.y)
|
||||
scummsaveload_thumbnail=(parent.w - (kThumbnailWidth + 22)) 18
|
||||
scummsaveload_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
|
||||
scummsaveload_choose=(prev.x2 + 10) prev.y prev.w prev.h
|
||||
scummsaveload_extinfo.visible=false
|
||||
|
||||
# MM NES resolution
|
||||
[256x240]
|
||||
useAsIs=320xY
|
||||
|
||||
# PSP GUI
|
||||
[480x272]
|
||||
def_buttonWidth=100
|
||||
def_buttonHeight=23
|
||||
def_insetX=20
|
||||
def_insetY=10
|
||||
def_insetW=(w - 2 * insetX)
|
||||
def_insetH=(h - 13 - insetY)
|
||||
def_launcherVersionX=50
|
||||
def_launcherVersionY=5
|
||||
def_midiControlsSpacing=2
|
||||
def_gameOptionsOverrideVPad=10
|
||||
def_aboutXOff=3
|
||||
def_aboutYOff=2
|
||||
def_aboutOuterBorder=10
|
||||
|
||||
use=XxY
|
@ -1,622 +0,0 @@
|
||||
# $URL$
|
||||
# $Id$
|
||||
[theme]
|
||||
version=23
|
||||
type=modern
|
||||
name=Modern Style
|
||||
|
||||
[pixmaps]
|
||||
pix_dialog_corner="dialog_bkgd_corner.bmp"
|
||||
pix_dialog_top="dialog_bkgd_top.bmp"
|
||||
pix_dialog_left="dialog_bkgd_left.bmp"
|
||||
pix_dialog_bkgd="dialog_bkgd.bmp"
|
||||
|
||||
pix_widget_corner="widget_bkgd_corner.bmp"
|
||||
pix_widget_top="widget_bkgd_top.bmp"
|
||||
pix_widget_left="widget_bkgd_left.bmp"
|
||||
pix_widget_bkgd="widget_bkgd.bmp"
|
||||
|
||||
pix_widget_small_corner="widget_small_bkgd_corner.bmp"
|
||||
pix_widget_small_top="widget_small_bkgd_top.bmp"
|
||||
pix_widget_small_left="widget_small_bkgd_left.bmp"
|
||||
pix_widget_small_bkgd="widget_small_bkgd.bmp"
|
||||
|
||||
pix_checkbox_empty="checkbox_empty.bmp"
|
||||
pix_checkbox_checked="checkbox_checked.bmp"
|
||||
|
||||
pix_widget_arrow="widget_arrow.bmp"
|
||||
|
||||
pix_tab_corner="button_bkgd_corner.bmp"
|
||||
pix_tab_top="widget_bkgd_top.bmp"
|
||||
pix_tab_left="widget_bkgd_left.bmp"
|
||||
pix_tab_bkgd="widget_bkgd.bmp"
|
||||
|
||||
pix_slider_bkgd_corner="button_bkgd_corner.bmp"
|
||||
pix_slider_bkgd_top="button_bkgd_top.bmp"
|
||||
pix_slider_bkgd_left="button_bkgd_left.bmp"
|
||||
pix_slider_bkgd_bkgd="button_bkgd.bmp"
|
||||
|
||||
pix_slider_corner="button_bkgd_corner.bmp"
|
||||
pix_slider_top="button_bkgd_top.bmp"
|
||||
pix_slider_left="button_bkgd_left.bmp"
|
||||
pix_slider_bkgd="button_bkgd.bmp"
|
||||
|
||||
pix_scrollbar_bkgd_corner="widget_small_bkgd_corner.bmp"
|
||||
pix_scrollbar_bkgd_top="widget_small_bkgd_top.bmp"
|
||||
pix_scrollbar_bkgd_left="widget_small_bkgd_left.bmp"
|
||||
pix_scrollbar_bkgd_bkgd="widget_small_bkgd.bmp"
|
||||
|
||||
pix_scrollbar_corner="widget_bkgd_corner.bmp"
|
||||
pix_scrollbar_top="widget_bkgd_top.bmp"
|
||||
pix_scrollbar_left="widget_bkgd_left.bmp"
|
||||
pix_scrollbar_bkgd="widget_bkgd.bmp"
|
||||
|
||||
pix_button_corner="button_bkgd_corner.bmp"
|
||||
pix_button_top="button_bkgd_top.bmp"
|
||||
pix_button_left="button_bkgd_left.bmp"
|
||||
pix_button_bkgd="button_bkgd.bmp"
|
||||
|
||||
pix_popupwidget_corner="button_bkgd_corner.bmp"
|
||||
pix_popupwidget_top="button_bkgd_top.bmp"
|
||||
pix_popupwidget_left="button_bkgd_left.bmp"
|
||||
pix_popupwidget_bkgd="button_bkgd.bmp"
|
||||
|
||||
pix_edittext_bkgd_corner="button_bkgd_corner.bmp"
|
||||
pix_edittext_bkgd_top="button_bkgd_top.bmp"
|
||||
pix_edittext_bkgd_left="button_bkgd_left.bmp"
|
||||
pix_edittext_bkgd_bkgd="button_bkgd.bmp"
|
||||
|
||||
pix_theme_logo="logo.bmp"
|
||||
|
||||
pix_cursor_image="cursor.bmp"
|
||||
|
||||
[colors]
|
||||
main_dialog_start=210 114 10
|
||||
main_dialog_end=239 196 24
|
||||
|
||||
dialog_start=246 224 139
|
||||
dialog_end=251 241 206
|
||||
|
||||
color_state_disabled=192 192 192
|
||||
color_state_highlight=100 162 8
|
||||
color_state_enabled=0 0 0
|
||||
|
||||
color_transparency=255 0 255
|
||||
|
||||
text_inverted_background=100 162 8
|
||||
text_inverted_color=0 0 0
|
||||
|
||||
widget_bkgd_start=246 224 139
|
||||
widget_bkgd_end=251 241 206
|
||||
widget_bkgd_small_start=246 224 139
|
||||
widget_bkgd_small_end=251 241 206
|
||||
|
||||
button_bkgd_start=203 126 107
|
||||
button_bkgd_end=169 42 12
|
||||
button_bkgd_highlight_start=255 210 200
|
||||
button_bkgd_highlight_end=200 70 50
|
||||
button_text_enabled=255 255 255
|
||||
button_text_disabled=192 192 192
|
||||
button_text_highlight=255 214 84
|
||||
|
||||
slider_background_start=247 228 166
|
||||
slider_background_end=247 228 166
|
||||
slider_start=203 126 107
|
||||
slider_end=169 42 12
|
||||
slider_highlight_start=255 210 200
|
||||
slider_highlight_end=200 70 50
|
||||
|
||||
tab_background_start=232 180 80
|
||||
tab_background_end=232 180 80
|
||||
|
||||
tab_active_start=246 224 139
|
||||
tab_active_end=251 241 206
|
||||
tab_inactive_start=239 202 109
|
||||
tab_inactive_end=239 202 109
|
||||
|
||||
scrollbar_background_start=247 228 166
|
||||
scrollbar_background_end=247 228 166
|
||||
scrollbar_button_start=247 228 166
|
||||
scrollbar_button_end=247 228 166
|
||||
scrollbar_slider_start=203 126 107
|
||||
scrollbar_slider_end=169 42 12
|
||||
scrollbar_button_highlight_start=255 210 200
|
||||
scrollbar_button_highlight_end=200 70 50
|
||||
scrollbar_slider_highlight_start=255 210 200
|
||||
scrollbar_slider_highlight_end=200 70 50
|
||||
|
||||
popupwidget_start=251 241 206
|
||||
popupwidget_end=251 241 206
|
||||
popupwidget_highlight_start=246 224 139
|
||||
popupwidget_highlight_end=251 241 206
|
||||
|
||||
edittext_background_start=247 228 166
|
||||
edittext_background_end=247 228 166
|
||||
|
||||
caret_color=0 0 0
|
||||
|
||||
[gradients]
|
||||
gradient_dialog_main=1
|
||||
gradient_dialog=4
|
||||
gradient_dialog_special=4
|
||||
|
||||
gradient_widget_small=9
|
||||
gradient_widget=9
|
||||
|
||||
gradient_button=1
|
||||
|
||||
gradient_slider=1
|
||||
gradient_slider_bkgd=1
|
||||
|
||||
gradient_tab=4
|
||||
|
||||
gradient_scrollbar=1
|
||||
gradient_scrollbar_background=1
|
||||
|
||||
gradient_popupwidget=1
|
||||
|
||||
gradient_edittext=1
|
||||
|
||||
[extra]
|
||||
shadow_left_width=2
|
||||
shadow_right_width=4
|
||||
shadow_top_height=2
|
||||
shadow_bottom_height=4
|
||||
inactive_dialog_shading=kShadingDim
|
||||
shading_dim_percent=50
|
||||
fontfile_normal="helvr12-l1.bdf"
|
||||
fontfile_fixed_normal="courr12-l1.bdf"
|
||||
cursor_hotspot_x=0
|
||||
cursor_hotspot_y=0
|
||||
cursor_targetScale=3
|
||||
|
||||
[XxY]
|
||||
skipFor=320xY,256x240
|
||||
def_widgetSize=kBigWidgetSize
|
||||
def_buttonWidth=120
|
||||
def_buttonHeight=25
|
||||
def_sliderWidth=kBigSliderWidth
|
||||
def_sliderHeight=kBigSliderHeight
|
||||
def_kLineHeight=16
|
||||
def_kFontHeight=14
|
||||
def_kPopUpHeight=(kLineHeight + 3)
|
||||
def_insetX=23
|
||||
def_insetY=94
|
||||
def_insetW=(w - buttonWidth - 17 * 2 - insetX)
|
||||
def_insetH=(h - 23 - insetY)
|
||||
def_optionsVPad=20
|
||||
def_optionsLabelWidth=110
|
||||
def_gameOptionsOverrideVPad=20
|
||||
def_tabPopupsLabelW=optionsLabelWidth
|
||||
def_aboutXOff=8
|
||||
def_aboutYOff=5
|
||||
def_aboutOuterBorder=80
|
||||
def_scummmainHOffset=12
|
||||
def_scummmainVSpace=15
|
||||
def_scummmainVAddOff=5
|
||||
def_scummhelpW=370
|
||||
def_scummhelpX=((w - scummhelpW) / 2)
|
||||
def_launcherVersionX=(w / 2 - 283 / 2 - 90)
|
||||
def_launcherVersionY=21
|
||||
|
||||
def_xSeparation=10
|
||||
def_ySeparation=10
|
||||
def_xBorder=15
|
||||
|
||||
use=pixmaps
|
||||
use=colors
|
||||
use=gradients
|
||||
use=extra
|
||||
|
||||
##### Widgets config
|
||||
ListWidget.leftPadding=7
|
||||
ListWidget.rightPadding=5
|
||||
ListWidget.topPadding=5
|
||||
ListWidget.bottomPadding=5
|
||||
ListWidget.hlLeftPadding=0
|
||||
ListWidget.hlRightPadding=0
|
||||
PopUpWidget.leftPadding=7
|
||||
PopUpWidget.rightPadding=5
|
||||
PopUpWidget.labelSpacing=xSeparation
|
||||
EditTextWidget.font=kFontStyleNormal
|
||||
EditTextWidget.leftPadding=7
|
||||
EditTextWidget.rightPadding=5
|
||||
Console.font=kFontStyleFixedNormal
|
||||
Console.leftPadding=7
|
||||
Console.rightPadding=5
|
||||
Console.topPadding=5
|
||||
Console.bottomPadding=5
|
||||
TabWidget.tabWidth=75
|
||||
TabWidget.tabHeight=27
|
||||
TabWidget.titleVPad=8
|
||||
TabWidget.navButtonRightPad=3
|
||||
TabWidget.navButtonTopPad=4
|
||||
TabWidget.navButtonW=15
|
||||
TabWidget.navButtonH=18
|
||||
|
||||
###### chooser
|
||||
opHeight=insetH
|
||||
useWithPrefix=chooser defaultChooser_
|
||||
|
||||
##### browser
|
||||
use=browser
|
||||
|
||||
##### launcher
|
||||
launcher_version=launcherVersionX launcherVersionY 247 kLineHeight
|
||||
launcher_version.align=kTextAlignRight
|
||||
launcher_logo=(w / 2 - 283 / 2) 5 283 80
|
||||
launcher_logo.visible=true
|
||||
space1=20
|
||||
space2=5
|
||||
launcher_list=insetX insetY insetW insetH
|
||||
launcher_start_button=(prev.x2 + 17) prev.y buttonWidth buttonHeight
|
||||
launcher_addGame_button=prev.x (prev.y2 + space1) prev.w prev.h
|
||||
launcher_editGame_button=prev.x (prev.y2 + space2) prev.w prev.h
|
||||
launcher_removeGame_button=prev.x (prev.y2 + space2) prev.w prev.h
|
||||
launcher_options_button=prev.x (prev.y2 + space1) prev.w prev.h
|
||||
launcher_about_button=prev.x (prev.y2 + space2) prev.w prev.h
|
||||
launcher_quit_button=prev.x (prev.y2 + space1) prev.w prev.h
|
||||
|
||||
use=scummmain
|
||||
|
||||
### global options
|
||||
globaloptions=insetX insetY insetW insetH
|
||||
set_parent=globaloptions
|
||||
vBorder=optionsVPad
|
||||
globaloptions_tabwidget=0 0 parent.w (parent.h - buttonHeight - 8 - ySeparation)
|
||||
|
||||
# graphics tab
|
||||
opYoffset=vBorder
|
||||
opXoffset=0
|
||||
useWithPrefix=graphicsControls globaloptions_
|
||||
|
||||
# audio tab
|
||||
opYoffset=vBorder
|
||||
useWithPrefix=audioControls globaloptions_
|
||||
useWithPrefix=subtitleControls globaloptions_
|
||||
|
||||
# volume tab
|
||||
opYoffset=vBorder
|
||||
useWithPrefix=volumeControls globaloptions_
|
||||
|
||||
# MIDI tab
|
||||
opYoffset=vBorder
|
||||
useWithPrefix=midiControls globaloptions_
|
||||
|
||||
# paths tab
|
||||
yoffset=vBorder
|
||||
glOff=((buttonHeight - kLineHeight) / 2 + 2)
|
||||
globaloptions_savebutton=xBorder yoffset buttonWidth buttonHeight
|
||||
globaloptions_savepath=(prev.x2 + xSeparation) (yoffset + glOff) (parent.w - self.x - xBorder) kLineHeight
|
||||
yoffset=(yoffset + buttonHeight + ySeparation)
|
||||
globaloptions_extrabutton=xBorder yoffset buttonWidth buttonHeight
|
||||
globaloptions_extrapath=(prev.x2 + xSeparation) (yoffset + glOff) (parent.w - self.x - xBorder) kLineHeight
|
||||
yoffset=(yoffset + buttonHeight + ySeparation)
|
||||
globaloptions_themebutton=xBorder yoffset buttonWidth buttonHeight
|
||||
globaloptions_themepath=(prev.x2 + xSeparation) (yoffset + glOff) (parent.w - self.x - xBorder) kLineHeight
|
||||
yoffset=(yoffset + buttonHeight + ySeparation)
|
||||
globaloptions_pluginsbutton=xBorder yoffset buttonWidth buttonHeight
|
||||
globaloptions_pluginspath=(prev.x2 + xSeparation) (yoffset + glOff) (parent.w - self.x - xBorder) kLineHeight
|
||||
yoffset=(yoffset + buttonHeight + ySeparation)
|
||||
globaloptions_keysbutton=xBorder yoffset buttonWidth buttonHeight
|
||||
|
||||
# Misc options
|
||||
yoffset=vBorder
|
||||
glOff=((buttonHeight - kLineHeight) / 2 + 2)
|
||||
globaloptions_themebutton2=xBorder yoffset buttonWidth buttonHeight
|
||||
globaloptions_curtheme=(prev.x2 + xSeparation) (yoffset + glOff) (parent.w - self.x - xBorder) kLineHeight
|
||||
yoffset=(yoffset + buttonHeight + ySeparation)
|
||||
globaloptions_autosaveperiod=xBorder yoffset (parent.w - self.x - xBorder) kPopUpHeight
|
||||
|
||||
globaloptions_cancel=(parent.w - 2 * buttonWidth - xSeparation - xBorder) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
|
||||
globaloptions_ok=(prev.x2 + xSeparation) prev.y prev.w prev.h
|
||||
|
||||
### game options
|
||||
gameoptions=insetX insetY insetW insetH
|
||||
set_parent=gameoptions
|
||||
vBorder=gameOptionsOverrideVPad
|
||||
gox=xBorder
|
||||
gow=(parent.w - gox - xBorder)
|
||||
|
||||
gameoptions_tabwidget=0 0 parent.w (parent.h - buttonHeight - 8 - ySeparation)
|
||||
|
||||
# game tab
|
||||
opYoffset=optionsVPad
|
||||
glOff=((kPopUpHeight - kLineHeight) / 2 + 2)
|
||||
gameoptions_id=gox (opYoffset + glOff) optionsLabelWidth kLineHeight
|
||||
gameoptions_id.align=kTextAlignRight
|
||||
gameoptions_domain=(prev.x2 + xSeparation) opYoffset (parent.w - self.x - xBorder) kPopUpHeight
|
||||
opYoffset=(opYoffset + prev.h + ySeparation)
|
||||
gameoptions_name=gox (opYoffset + glOff) optionsLabelWidth kLineHeight
|
||||
gameoptions_name.align=kTextAlignRight
|
||||
gameoptions_desc=(prev.x2 + xSeparation) opYoffset (parent.w - self.x - xBorder) kPopUpHeight
|
||||
opYoffset=(opYoffset + prev.h + ySeparation)
|
||||
gameoptions_lang=gox opYoffset (parent.w - self.x - xBorder) kPopUpHeight
|
||||
opYoffset=(opYoffset + prev.h + ySeparation)
|
||||
gameoptions_platform=prev.x opYoffset prev.w prev.h
|
||||
opYoffset=(opYoffset + prev.h + ySeparation)
|
||||
|
||||
# paths tab
|
||||
opYoffset=optionsVPad
|
||||
goOff=((buttonHeight - kLineHeight) / 2 + 2)
|
||||
gameoptions_savepath=gox opYoffset buttonWidth buttonHeight
|
||||
gameoptions_savepathText=(prev.x2 + xSeparation) (opYoffset + goOff) (parent.w - self.x - xBorder) kLineHeight
|
||||
opYoffset=(opYoffset + buttonHeight + ySeparation)
|
||||
gameoptions_extrapath=gox opYoffset buttonWidth buttonHeight
|
||||
gameoptions_extrapathText=(prev.x2 + xSeparation) (opYoffset + goOff) (parent.w - self.x - xBorder) kLineHeight
|
||||
opYoffset=(opYoffset + buttonHeight + ySeparation)
|
||||
gameoptions_gamepath=gox opYoffset buttonWidth buttonHeight
|
||||
gameoptions_gamepathText=(prev.x2 + xSeparation) (opYoffset + goOff) (parent.w - self.x - xBorder) kLineHeight
|
||||
opYoffset=(opYoffset + buttonHeight + ySeparation)
|
||||
|
||||
# graphics tab
|
||||
opYoffset=vBorder
|
||||
opXoffset=gox
|
||||
gameoptions_graphicsCheckbox=gox opYoffset (parent.w - gox - xBorder) buttonHeight
|
||||
opYoffset=(prev.y2 + ySeparation)
|
||||
useWithPrefix=graphicsControls gameoptions_
|
||||
|
||||
# audio tab
|
||||
opYoffset=vBorder
|
||||
gameoptions_audioCheckbox=gox opYoffset (parent.w - gox - xBorder) buttonHeight
|
||||
opYoffset=(prev.y2 + ySeparation)
|
||||
useWithPrefix=audioControls gameoptions_
|
||||
useWithPrefix=subtitleControls gameoptions_
|
||||
|
||||
# volume tab
|
||||
opYoffset=vBorder
|
||||
gameoptions_volumeCheckbox=gox opYoffset (parent.w - gox - xBorder) buttonHeight
|
||||
opYoffset=(prev.y2 + ySeparation)
|
||||
useWithPrefix=volumeControls gameoptions_
|
||||
|
||||
# midi tab
|
||||
opYoffset=vBorder
|
||||
gameoptions_midiCheckbox=gox opYoffset (parent.w - gox - xBorder) buttonHeight
|
||||
opYoffset=(prev.y2 + ySeparation)
|
||||
useWithPrefix=midiControls gameoptions_
|
||||
|
||||
gameoptions_cancel=(parent.w - 2 * buttonWidth - xSeparation - xBorder) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
|
||||
gameoptions_ok=(prev.x2 + xSeparation) prev.y prev.w prev.h
|
||||
|
||||
### keys dialog
|
||||
keysdialog=(w / 20) (h / 10) (w - w / 10) (h - h / 5)
|
||||
set_parent=keysdialog
|
||||
keysdialog_map=(parent.w - buttonWidth - 10) 20 buttonWidth buttonHeight
|
||||
keysdialog_ok=prev.x (prev.y2 + 4) prev.w prev.h
|
||||
keysdialog_cancel=prev.x (prev.y2 + 4) prev.w prev.h
|
||||
keysdialog_list=10 10 (prev.x - 20) (parent.h - kLineHeight * 4 - self.y)
|
||||
keysdialog_action=prev.x (parent.h - kLineHeight * 3) (parent.w - self.x * 2) kLineHeight
|
||||
keysdialog_action.align=kTextAlignCenter
|
||||
keysdialog_mapping=prev.x (prev.y + kLineHeight) prev.w prev.h
|
||||
keysdialog_mapping.align=kTextAlignCenter
|
||||
|
||||
### mass add dialog
|
||||
massadddialog=10 20 300 174
|
||||
set_parent=massadddialog
|
||||
massadddialog_caption=xBorder (10 + 1 * kLineHeight) (parent.w - 2 * xBorder) kLineHeight
|
||||
massadddialog_caption.align=kTextAlignCenter
|
||||
massadddialog_dirprogress=xBorder (10 + 3 * kLineHeight) prev.w prev.h
|
||||
massadddialog_dirprogress.align=kTextAlignCenter
|
||||
massadddialog_gameprogress=xBorder (10 + 4 * kLineHeight) prev.w prev.h
|
||||
massadddialog_gameprogress.align=kTextAlignCenter
|
||||
massadddialog_ok=((parent.w - (buttonWidth * 2) - xSeparation) / 2) (parent.h - buttonHeight - ySeparation) buttonWidth buttonHeight
|
||||
massadddialog_cancel=(prev.x2 + xSeparation) prev.y prev.w prev.h
|
||||
|
||||
|
||||
##### SCUMM dialogs
|
||||
scummDummyDialog=0 80 0 16
|
||||
|
||||
use=scummmain
|
||||
## Engine config
|
||||
# note that scummconfig size depends on overall height
|
||||
# hence it is on the end of the list
|
||||
opYoffset=8
|
||||
useWithPrefix=volumeControls scummconfig_
|
||||
opYoffset=(opYoffset + 2)
|
||||
useWithPrefix=subtitleControls scummconfig_
|
||||
opYoffset=(opYoffset + buttonHeight)
|
||||
opYoffset=(opYoffset + buttonHeight + 4)
|
||||
soWidth=(8 + 3 * buttonWidth + 4)
|
||||
scummconfig_keys=(soWidth - 3 * (buttonWidth + 4) + 6) opYoffset (buttonWidth - 10) buttonHeight
|
||||
scummconfig_cancel=(prev.x2 + 4) prev.y (prev.w + 10) prev.h
|
||||
scummconfig_ok=(prev.x2 + 4) prev.y prev.w prev.h
|
||||
opYoffset=(opYoffset + buttonHeight)
|
||||
scummconfig=((w - soWidth) / 2) ((h - opYoffset) / 2) soWidth (opYoffset + 8)
|
||||
|
||||
## Help
|
||||
scummHelpNumLines=15
|
||||
shH=(5 + (2 + scummHelpNumLines) * kFontHeight + buttonHeight + 7)
|
||||
shButtonWidth=(buttonWidth - 20)
|
||||
scummhelp=scummhelpX ((h - shH) / 2) scummhelpW shH
|
||||
scummhelp_title=10 5 scummhelpW kFontHeight
|
||||
scummhelp_title.align=kTextAlignCenter
|
||||
scummhelp_key.x=10
|
||||
scummhelp_key.yoffset=5
|
||||
scummhelp_key.w=80
|
||||
scummhelp_key.h=kFontHeight
|
||||
scummhelp_dsc.x=90
|
||||
scummhelp_dsc.yoffset=5
|
||||
scummhelp_dsc.w=(scummhelpW - 10 - 90)
|
||||
scummhelp_dsc.h=kFontHeight
|
||||
scummhelp_prev=10 (5 + kFontHeight * (scummHelpNumLines + 2) + 2) shButtonWidth buttonHeight
|
||||
scummhelp_next=(prev.x2 + 8) prev.y prev.w prev.h
|
||||
scummhelp_close=(scummhelpW - 8 - shButtonWidth) prev.y prev.w prev.h
|
||||
|
||||
# Saveload dialog
|
||||
scummsaveload=8 8 (w - 2 * 8) (h - 16)
|
||||
set_parent=scummsaveload
|
||||
scummsaveload_title=10 2 (parent.w - 2 * 10 - 180-20) kLineHeight
|
||||
scummsaveload_title.align=kTextAlignCenter
|
||||
scummsaveload_list=10 18 prev.w (parent.h - 17 - buttonHeight - 8 - self.y)
|
||||
scummsaveload_thumbnail=(parent.w - (kThumbnailWidth + 22)) 18
|
||||
scummsaveload_thumbnail.hPad=10
|
||||
scummsaveload_thumbnail.vPad=10
|
||||
scummsaveload_thumbnail.fillR=0
|
||||
scummsaveload_thumbnail.fillG=0
|
||||
scummsaveload_thumbnail.fillB=0
|
||||
scummsaveload_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
|
||||
scummsaveload_choose=(prev.x2 + 10) prev.y prev.w prev.h
|
||||
scummsaveload_extinfo.visible=true
|
||||
|
||||
############################################
|
||||
[chooser]
|
||||
chooserW=insetW
|
||||
chooser=insetX insetY chooserW opHeight
|
||||
chooser_headline=xBorder 6 (chooserW - 2 * xBorder) kLineHeight
|
||||
chooser_list=prev.x (prev.y2 + 2) prev.w (opHeight - self.y - buttonHeight - 12)
|
||||
#JVPRAT: next Y doesn't seem right
|
||||
chooser_cancel=(chooserW - 2 * buttonWidth - xSeparation - xBorder) (opHeight - buttonHeight - 8) buttonWidth buttonHeight
|
||||
chooser_ok=(prev.x2 + xSeparation) prev.y prev.w prev.h
|
||||
|
||||
[browser]
|
||||
browser=insetX insetY insetW insetH
|
||||
set_parent=browser
|
||||
browser_headline=xBorder 5 (parent.w - 2 * xBorder) kLineHeight
|
||||
browser_headline.align=kTextAlignCenter
|
||||
browser_path=prev.x (prev.y2 + 5) prev.w prev.h
|
||||
browser_list=prev.x prev.y2 prev.w (parent.h - 3 * kLineHeight - buttonHeight - 14)
|
||||
browser_up=prev.x (parent.h - buttonHeight - 8) buttonWidth buttonHeight
|
||||
#JVPRAT: doesn't it lack insetx?:
|
||||
browser_cancel=(parent.w - 2 * buttonWidth - xSeparation - xBorder) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
|
||||
browser_choose=(prev.x2 + xSeparation) prev.y prev.w prev.h
|
||||
|
||||
[graphicsControls]
|
||||
gcx=(opXoffset + xBorder)
|
||||
grModePopup=gcx opYoffset (parent.w - self.x - xBorder) kPopUpHeight
|
||||
opYoffset=(prev.y2 + ySeparation)
|
||||
grRenderPopup=prev.x (opYoffset - 1) prev.w prev.h
|
||||
opYoffset=(prev.y2 + ySeparation)
|
||||
grFullscreenCheckbox=gcx opYoffset (parent.w - gcx - xBorder) kLineHeight
|
||||
opYoffset=(prev.y2 + ySeparation)
|
||||
grAspectCheckbox=prev.x opYoffset prev.w prev.h
|
||||
opYoffset=(prev.y2 + ySeparation)
|
||||
|
||||
[audioControls]
|
||||
aux=(opXoffset + xBorder)
|
||||
auMidiPopup=aux opYoffset (parent.w - self.x - xBorder) kPopUpHeight
|
||||
opYoffset=(opYoffset + prev.h + ySeparation)
|
||||
auSampleRatePopup=aux (opYoffset - 1) prev.w kPopUpHeight
|
||||
opYoffset=(opYoffset + prev.h + ySeparation)
|
||||
|
||||
[volumeControls]
|
||||
vcx=(opXoffset + xBorder)
|
||||
vcOff=((sliderHeight - kLineHeight) / 2 + 2)
|
||||
vcMusicText=vcx (opYoffset + vcOff) optionsLabelWidth kLineHeight
|
||||
vcMusicText.align=kTextAlignRight
|
||||
vcMusicSlider=(prev.x2 + xSeparation) opYoffset sliderWidth sliderHeight
|
||||
vcMusicLabel=(prev.x2 + xSeparation) (opYoffset + vcOff) 24 kLineHeight
|
||||
opYoffset=(opYoffset + sliderHeight + ySeparation)
|
||||
vcSfxText=vcx (opYoffset + vcOff) optionsLabelWidth kLineHeight
|
||||
vcSfxText.align=kTextAlignRight
|
||||
vcSfxSlider=(prev.x2 + xSeparation) opYoffset sliderWidth sliderHeight
|
||||
vcSfxLabel=(prev.x2 + xSeparation) (opYoffset + vcOff) 24 kLineHeight
|
||||
opYoffset=(opYoffset + sliderHeight + ySeparation)
|
||||
vcSpeechText=vcx (opYoffset + vcOff) optionsLabelWidth kLineHeight
|
||||
vcSpeechText.align=kTextAlignRight
|
||||
vcSpeechSlider=(prev.x2 + xSeparation) opYoffset sliderWidth sliderHeight
|
||||
vcSpeechLabel=(prev.x2 + xSeparation) (opYoffset + vcOff) 24 kLineHeight
|
||||
opYoffset=(opYoffset + sliderHeight + ySeparation)
|
||||
|
||||
[midiControls]
|
||||
mcx=(opXoffset + xBorder)
|
||||
mcOff=((buttonHeight - kLineHeight) / 2 + 2)
|
||||
mcFontButton=mcx opYoffset buttonWidth buttonHeight
|
||||
mcFontPath=(prev.x2 + xSeparation) (opYoffset + mcOff) (parent.w - self.x - xSeparation - kLineHeight - xBorder) kLineHeight
|
||||
mcFontClearButton=(prev.x2 + xSeparation) prev.y kLineHeight kLineHeight
|
||||
opYoffset=(opYoffset + buttonHeight + ySeparation)
|
||||
mcMixedCheckbox=mcx opYoffset (parent.w - self.x - xBorder) kLineHeight
|
||||
opYoffset=(opYoffset + prev.h + ySeparation)
|
||||
mcMt32Checkbox=mcx opYoffset prev.w kLineHeight
|
||||
opYoffset=(opYoffset + prev.h + ySeparation)
|
||||
mcGSCheckbox=mcx opYoffset prev.w kLineHeight
|
||||
opYoffset=(opYoffset + prev.h + ySeparation)
|
||||
mcOff=((sliderHeight - kLineHeight) / 2 + 2)
|
||||
mcMidiGainText=mcx (opYoffset + mcOff) optionsLabelWidth kLineHeight
|
||||
mcMidiGainText.align=kTextAlignRight
|
||||
mcMidiGainSlider=(prev.x2 + xSeparation) opYoffset sliderWidth sliderHeight
|
||||
mcMidiGainLabel=(prev.x2 + xSeparation) (opYoffset + mcOff) 40 kLineHeight
|
||||
opYoffset=(opYoffset + sliderHeight + ySeparation)
|
||||
|
||||
[subtitleControls]
|
||||
sbx=(opXoffset + xBorder)
|
||||
sbOff=((sliderHeight - kLineHeight) / 2 + 2)
|
||||
subToggleDesc=sbx (opYoffset + sbOff) optionsLabelWidth kLineHeight
|
||||
subToggleDesc.align=kTextAlignRight
|
||||
subToggleButton=(prev.x2 + xSeparation) opYoffset (buttonWidth + 34) sliderHeight
|
||||
opYoffset=(prev.y2 + ySeparation)
|
||||
subSubtitleSpeedDesc=sbx (opYoffset + sbOff) optionsLabelWidth kLineHeight
|
||||
subSubtitleSpeedDesc.align=kTextAlignRight
|
||||
subSubtitleSpeedSlider=(prev.x2 + xSeparation) opYoffset sliderWidth sliderHeight
|
||||
subSubtitleSpeedLabel=(prev.x2 + xSeparation) (opYoffset + sbOff) 24 kLineHeight
|
||||
opYoffset=(opYoffset + sliderHeight + ySeparation)
|
||||
|
||||
[scummmain]
|
||||
## Main dialog
|
||||
# note that scummmain size depends on overall height
|
||||
smY=scummmainHOffset
|
||||
scummmain_resume=scummmainHOffset smY buttonWidth buttonHeight
|
||||
smY=(smY + buttonHeight + scummmainVAddOff)
|
||||
smY=(smY + scummmainVSpace)
|
||||
scummmain_load=prev.x smY prev.w prev.h
|
||||
smY=(smY + buttonHeight + scummmainVAddOff)
|
||||
scummmain_save=prev.x smY prev.w prev.h
|
||||
smY=(smY + buttonHeight + scummmainVAddOff)
|
||||
smY=(smY + scummmainVSpace)
|
||||
scummmain_options=prev.x smY prev.w prev.h
|
||||
smY=(smY + buttonHeight + scummmainVAddOff)
|
||||
scummmain_about=prev.x smY prev.w prev.h
|
||||
smY=(smY + buttonHeight + scummmainVAddOff)
|
||||
scummmain_help=prev.x smY prev.w prev.h
|
||||
smY=(smY + buttonHeight + scummmainVAddOff)
|
||||
smY=(smY + scummmainVSpace)
|
||||
scummmain_quit=prev.x smY prev.w prev.h
|
||||
smH=(smY + buttonHeight + scummmainHOffset)
|
||||
smW=(buttonWidth + 2 * scummmainHOffset)
|
||||
scummmain=((w - smW) / 2) ((h - smH) / 2) smW smH
|
||||
|
||||
[320xY]
|
||||
use=pixmaps
|
||||
use=colors
|
||||
use=gradients
|
||||
use=extra
|
||||
shadow_right_width=1
|
||||
pix_checkbox_empty="checkbox_empty320.bmp"
|
||||
pix_checkbox_checked="checkbox_checked320.bmp"
|
||||
pix_cursor_image="cursor320.bmp"
|
||||
|
||||
# NES resoltuion
|
||||
[256x240]
|
||||
use=320xY
|
||||
|
||||
# PSP GUI
|
||||
[480x272]
|
||||
def_buttonWidth=100
|
||||
def_buttonHeight=23
|
||||
def_insetX=20
|
||||
def_insetY=10
|
||||
def_insetW=(w - buttonWidth - 17 * 2 - insetX)
|
||||
def_insetH=(h - 13 - insetY)
|
||||
def_launcherVersionX=50
|
||||
def_launcherVersionY=5
|
||||
def_gameOptionsOverrideVPad=10
|
||||
def_aboutXOff=3
|
||||
def_aboutYOff=2
|
||||
def_aboutOuterBorder=10
|
||||
|
||||
use=XxY
|
||||
|
||||
TabWidget.tabWidth=75
|
||||
|
||||
# Override launcher
|
||||
launcher_list=insetX 103 (w - buttonWidth - 17 * 2 - self.x) (h - 15 - self.y)
|
||||
launcher_version=50 80 247 kLineHeight
|
||||
launcher_version.align=kTextAlignCenter
|
||||
launcher_logo=40 2 283 80
|
||||
launcher_logo.visible=true
|
||||
|
||||
# Override extras
|
||||
inactive_dialog_shading=kShadingNone
|
||||
|
||||
# Override browser
|
||||
def_buttonWidth=90
|
||||
use=browser
|
Binary file not shown.
Binary file not shown.
@ -26,7 +26,6 @@
|
||||
#include "graphics/fontman.h"
|
||||
#include "gui/widget.h"
|
||||
#include "gui/dialog.h"
|
||||
#include "gui/eval.h"
|
||||
#include "gui/newgui.h"
|
||||
|
||||
#include "gui/ThemeEval.h"
|
||||
@ -35,15 +34,13 @@ namespace GUI {
|
||||
|
||||
Widget::Widget(GuiObject *boss, int x, int y, int w, int h)
|
||||
: GuiObject(x, y, w, h), _type(0), _boss(boss),
|
||||
_id(0), _flags(0), _hints(THEME_HINT_FIRST_DRAW),
|
||||
_hasFocus(false), _state(Theme::kStateEnabled) {
|
||||
_id(0), _flags(0), _hasFocus(false), _state(Theme::kStateEnabled) {
|
||||
init();
|
||||
}
|
||||
|
||||
Widget::Widget(GuiObject *boss, const Common::String &name)
|
||||
: GuiObject(name), _type(0), _boss(boss),
|
||||
_id(0), _flags(0), _hints(THEME_HINT_FIRST_DRAW),
|
||||
_hasFocus(false), _state(Theme::kStateDisabled) {
|
||||
_id(0), _flags(0), _hasFocus(false), _state(Theme::kStateDisabled) {
|
||||
init();
|
||||
}
|
||||
|
||||
@ -51,8 +48,6 @@ void Widget::init() {
|
||||
// Insert into the widget list of the boss
|
||||
_next = _boss->_firstWidget;
|
||||
_boss->_firstWidget = this;
|
||||
// HACK: we enable background saving for all widgets by default for now
|
||||
_hints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
|
||||
}
|
||||
|
||||
Widget::~Widget() {
|
||||
@ -101,7 +96,7 @@ void Widget::draw() {
|
||||
|
||||
// Draw border
|
||||
if (_flags & WIDGET_BORDER) {
|
||||
gui->theme()->drawWidgetBackground(Common::Rect(_x, _y, _x+_w, _y+_h), _hints, Theme::kWidgetBackgroundBorder);
|
||||
gui->theme()->drawWidgetBackground(Common::Rect(_x, _y, _x+_w, _y+_h), 0, Theme::kWidgetBackgroundBorder);
|
||||
_x += 4;
|
||||
_y += 4;
|
||||
_w -= 8;
|
||||
@ -128,8 +123,6 @@ void Widget::draw() {
|
||||
w->draw();
|
||||
w = w->_next;
|
||||
}
|
||||
|
||||
clearHints(THEME_HINT_FIRST_DRAW);
|
||||
}
|
||||
|
||||
Widget *Widget::findWidgetInChain(Widget *w, int x, int y) {
|
||||
@ -225,7 +218,6 @@ ButtonWidget::ButtonWidget(GuiObject *boss, const Common::String &name, const Co
|
||||
: StaticTextWidget(boss, name, label), CommandSender(boss),
|
||||
_cmd(cmd), _hotkey(hotkey) {
|
||||
setFlags(WIDGET_ENABLED/* | WIDGET_BORDER*/ | WIDGET_CLEARBG);
|
||||
_hints = THEME_HINT_USE_SHADOW;
|
||||
_type = kButtonWidget;
|
||||
}
|
||||
|
||||
@ -235,7 +227,7 @@ void ButtonWidget::handleMouseUp(int x, int y, int button, int clickCount) {
|
||||
}
|
||||
|
||||
void ButtonWidget::drawWidget() {
|
||||
g_gui.theme()->drawButton(Common::Rect(_x, _y, _x+_w, _y+_h), _label, _state, _hints);
|
||||
g_gui.theme()->drawButton(Common::Rect(_x, _y, _x+_w, _y+_h), _label, _state, 0);
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
@ -335,20 +327,12 @@ GraphicsWidget::GraphicsWidget(GuiObject *boss, int x, int y, int w, int h)
|
||||
: Widget(boss, x, y, w, h), _gfx(), _alpha(256), _transparency(false) {
|
||||
setFlags(WIDGET_ENABLED | WIDGET_CLEARBG);
|
||||
_type = kGraphicsWidget;
|
||||
// HACK: Don't save the background. We want to be sure that redrawing
|
||||
// the widget updates the screen, even when there isn't any image
|
||||
// to draw.
|
||||
_hints &= ~THEME_HINT_SAVE_BACKGROUND;
|
||||
}
|
||||
|
||||
GraphicsWidget::GraphicsWidget(GuiObject *boss, const Common::String &name)
|
||||
: Widget(boss, name), _gfx(), _alpha(256), _transparency(false) {
|
||||
setFlags(WIDGET_ENABLED | WIDGET_CLEARBG);
|
||||
_type = kGraphicsWidget;
|
||||
// HACK: Don't save the background. We want to be sure that redrawing
|
||||
// the widget updates the screen, even when there isn't any image
|
||||
// to draw.
|
||||
_hints &= ~THEME_HINT_SAVE_BACKGROUND;
|
||||
}
|
||||
|
||||
GraphicsWidget::~GraphicsWidget() {
|
||||
@ -403,7 +387,7 @@ ContainerWidget::ContainerWidget(GuiObject *boss, const Common::String &name) :
|
||||
}
|
||||
|
||||
void ContainerWidget::drawWidget() {
|
||||
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), _hints, Theme::kWidgetBackgroundBorder);
|
||||
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), 0, Theme::kWidgetBackgroundBorder);
|
||||
}
|
||||
|
||||
} // End of namespace GUI
|
||||
|
@ -93,7 +93,6 @@ protected:
|
||||
GuiObject *_boss;
|
||||
Widget *_next;
|
||||
uint16 _id;
|
||||
uint16 _hints;
|
||||
bool _hasFocus;
|
||||
Theme::WidgetStateInfo _state;
|
||||
|
||||
@ -142,10 +141,6 @@ public:
|
||||
void clearFlags(int flags);
|
||||
int getFlags() const { return _flags; }
|
||||
|
||||
void setHints(int hints) { _hints |= hints; }
|
||||
void clearHints(int hints) { _hints &= ~hints; }
|
||||
int getHints() const { return _hints; }
|
||||
|
||||
void setEnabled(bool e) { if (e) setFlags(WIDGET_ENABLED); else clearFlags(WIDGET_ENABLED); }
|
||||
bool isEnabled() const;
|
||||
bool isVisible() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user