diff options
-rw-r--r-- | common/xmlparser.h | 7 | ||||
-rw-r--r-- | graphics/VectorRenderer.h | 2 | ||||
-rw-r--r-- | gui/ThemeDefaultXML.cpp | 494 | ||||
-rw-r--r-- | gui/ThemeRenderer.cpp | 34 | ||||
-rw-r--r-- | gui/ThemeRenderer.h | 2 | ||||
-rw-r--r-- | gui/module.mk | 1 | ||||
-rw-r--r-- | gui/themes/default.inc | 1 | ||||
-rw-r--r-- | gui/themes/makedeftheme.py | 23 | ||||
-rw-r--r-- | gui/themes/modern.stx | 483 |
9 files changed, 542 insertions, 505 deletions
diff --git a/common/xmlparser.h b/common/xmlparser.h index 9308524388..031ee2be14 100644 --- a/common/xmlparser.h +++ b/common/xmlparser.h @@ -471,13 +471,6 @@ protected: return true; } - if (_text[_pos] == '/' && _text[_pos + 1] == '/') { - _pos += 2; - while (_text[_pos] && _text[_pos] != '\n' && _text[_pos] != '\r') - _pos++; - return true; - } - return false; } diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h index 60ab8797ef..fa986e2f08 100644 --- a/graphics/VectorRenderer.h +++ b/graphics/VectorRenderer.h @@ -432,7 +432,9 @@ public: virtual void areaConvolution(const Common::Rect &area, const int filter[3][3], int filterDiv, int offset) = 0; virtual void applyConvolutionMatrix(const ConvolutionData id, const Common::Rect &area) { +#ifdef ENABLE_CONVOLUTIONS areaConvolution(area, _convolutionData[id].matrix, _convolutionData[id].divisor, _convolutionData[id].offset); +#endif } protected: diff --git a/gui/ThemeDefaultXML.cpp b/gui/ThemeDefaultXML.cpp deleted file mode 100644 index 42a6efa7c3..0000000000 --- a/gui/ThemeDefaultXML.cpp +++ /dev/null @@ -1,494 +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/ThemeRenderer.h" - -namespace GUI { - -bool ThemeRenderer::loadDefaultXML() { - const char *defaultXML = -/** - * Default theme description file. Work in progress. - * Newlines are not necessary, parser ignores them. - * You may use single quotes (') instead of scaped double quotes. - * Remember to indent properly the XML so it's easier to read and - * to maintain! - * Also remember to scape the end of each line. :p - */ -"<render_info> \ - <palette> \ - <color name = 'darkred' \ - rgb = '168, 42, 12' \ - /> \ - <color name = 'brightred' \ - rgb = '200, 124, 104' \ - /> \ - <color name = 'xtrabrightred' \ - rgb = '251, 241, 206' \ - /> \ - <color name = 'blandyellow' \ - rgb = '247, 228, 166' \ - /> \ - <color name = 'bgreen' \ - rgb = '96, 160, 8' \ - /> \ - <color name = 'blue' \ - rgb = '0, 255, 255' \ - /> \ - <color name = 'black' \ - rgb = '0, 0, 0' \ - /> \ - <color name = 'white' \ - rgb = '255, 255, 255' \ - /> \ - </palette> \ - \ - <fonts> \ - <font id = 'text_default' \ - type = 'default' \ - color = 'black' \ - /> \ - <font id = 'text_hover' \ - type = 'default' \ - color = 'bgreen' \ - /> \ - <font id = 'text_disabled' \ - type = 'default' \ - color = '128, 128, 128' \ - /> \ - <font id = 'text_inverted' \ - type = 'default' \ - color = '0, 0, 0' \ - /> \ - <font id = 'text_button' \ - type = 'default' \ - color = 'white' \ - /> \ - <font id = 'text_button_hover' \ - type = 'default' \ - color = 'blandyellow' \ - /> \ - </fonts> \ - \ - <defaults fill = 'gradient' fg_color = 'white' /> \ - \ - <drawdata id = 'text_selection' cache = false> \ - <drawstep func = 'square' \ - fill = 'foreground' \ - fg_color = 'bgreen' \ - /> \ - </drawdata> \ - \ - <drawdata id = 'mainmenu_bg' cache = false> \ - <drawstep func = 'fill' \ - fill = 'gradient' \ - gradient_start = '208, 112, 8' \ - gradient_end = '232, 192, 16' \ - /> \ - </drawdata> \ - \ - <drawdata id = 'separator' cache = false> \ - <drawstep func = 'square' \ - fill = 'foreground' \ - height = '1' \ - ypos = 'center' \ - fg_color = 'black' \ - /> \ - </drawdata> \ - \ - <drawdata id = 'scrollbar_base' cache = false> \ - <drawstep func = 'roundedsq' \ - stroke = 1 \ - radius = 6 \ - fill = 'background' \ - fg_color = '176, 164, 160' \ - bg_color = '240, 228, 160' \ - /> \ - </drawdata> \ - \ - <drawdata id = 'scrollbar_handle_hover' cache = false> \ - <drawstep func = 'roundedsq' \ - stroke = 1 \ - radius = 6 \ - fill = 'gradient' \ - fg_color = 'blandyellow' \ - gradient_start = 'xtrabrightred' \ - gradient_end = 'darkred' \ - /> \ - </drawdata> \ - \ - <drawdata id = 'scrollbar_handle_idle' cache = false> \ - <drawstep func = 'roundedsq' \ - stroke = 1 \ - radius = 6 \ - fill = 'gradient' \ - fg_color = 'blandyellow' \ - gradient_start = 'brightred' \ - gradient_end = 'darkred' \ - /> \ - </drawdata> \ - \ - <drawdata id = 'scrollbar_button_idle' cache = false> \ - <drawstep func = 'roundedsq' \ - radius = '4' \ - fill = 'none' \ - fg_color = '176, 164, 160' \ - stroke = 1 \ - /> \ - <drawstep func = 'triangle' \ - fg_color = '0, 0, 0' \ - fill = 'foreground' \ - width = 'auto' \ - height = 'auto' \ - xpos = 'center' \ - ypos = 'center' \ - orientation = 'top' \ - /> \ - </drawdata> \ - \ - <drawdata id = 'scrollbar_button_hover' cache = false> \ - <drawstep func = 'roundedsq' \ - radius = '4' \ - fill = 'background' \ - fg_color = '120, 120, 120' \ - bg_color = '206, 121, 99' \ - stroke = 1 \ - /> \ - <drawstep func = 'triangle' \ - fg_color = '0, 0, 0' \ - fill = 'foreground' \ - width = 'auto' \ - height = 'auto' \ - xpos = 'center' \ - ypos = 'center' \ - orientation = 'top' \ - /> \ - </drawdata> \ - \ - <drawdata id = 'tab_active' cache = false> \ - <text font = 'text_default' \ - vertical_align = 'center' \ - horizontal_align = 'center' \ - /> \ - <drawstep func = 'tab' \ - radius = '4' \ - stroke = '0' \ - fill = 'gradient' \ - gradient_end = 'xtrabrightred' \ - gradient_start = 'blandyellow' \ - shadow = 3 \ - /> \ - </drawdata> \ - \ - <drawdata id = 'tab_inactive' cache = false> \ - <text font = 'text_default' \ - vertical_align = 'center' \ - horizontal_align = 'center' \ - /> \ - <drawstep func = 'tab' \ - radius = '4' \ - stroke = '0' \ - fill = 'foreground' \ - fg_color = '240, 205, 118' \ - shadow = 3 \ - /> \ - </drawdata> \ - \ - <drawdata id = 'tab_background' cache = false> \ - <drawstep func = 'tab' \ - radius = '12' \ - stroke = '0' \ - fill = 'foreground' \ - fg_color = '232, 180, 81' \ - shadow = 3 \ - /> \ - </drawdata> \ - \ - <drawdata id = 'widget_slider' cache = false> \ - <drawstep func = 'roundedsq' \ - stroke = 1 \ - radius = 8 \ - fill = 'none' \ - fg_color = '0, 0, 0' \ - /> \ - </drawdata> \ - \ - <drawdata id = 'slider_full' cache = false> \ - <drawstep func = 'roundedsq' \ - stroke = 1 \ - radius = 8 \ - fill = 'gradient' \ - fg_color = '0, 0, 0' \ - gradient_start = '214, 113, 8' \ - gradient_end = '240, 200, 25' \ - /> \ - </drawdata> \ - \ - <drawdata id = 'popup_idle' cache = false> \ - <drawstep func = 'roundedsq' \ - stroke = 0 \ - radius = 4 \ - fill = 'foreground' \ - fg_color = '250, 237, 190' \ - shadow = 2 \ - /> \ - <drawstep func = 'triangle' \ - fg_color = '63, 60, 52' \ - fill = 'foreground' \ - width = 'height' \ - height = 'auto' \ - xpos = 'right' \ - ypos = 'center' \ - orientation = 'bottom' \ - /> \ - <text font = 'text_default' \ - vertical_align = 'center' \ - horizontal_align = 'right' \ - /> \ - </drawdata> \ - \ - \ - <drawdata id = 'popup_hover' cache = false> \ - <drawstep func = 'roundedsq' \ - stroke = 0 \ - radius = 4 \ - fill = 'gradient' \ - gradient_start = 'blandyellow' \ - gradient_end = '250, 237, 190' \ - shadow = 0 \ - /> \ - <drawstep func = 'triangle' \ - fg_color = '63, 60, 52' \ - fill = 'foreground' \ - width = 'height' \ - height = 'auto' \ - xpos = 'right' \ - ypos = 'center' \ - orientation = 'bottom' \ - /> \ - <text font = 'text_hover' \ - vertical_align = 'center' \ - horizontal_align = 'right' \ - /> \ - </drawdata> \ - \ - <drawdata id = 'default_bg' cache = false> \ - <drawstep func = 'roundedsq' \ - radius = 12 \ - stroke = 0 \ - fg_color = 'xtrabrightred' \ - fill = 'foreground' \ - shadow = 3 \ - /> \ - </drawdata> \ - \ - <drawdata id = 'button_idle' cache = false> \ - <text font = 'text_button' \ - vertical_align = 'center' \ - horizontal_align = 'center' \ - /> \ - <drawstep func = 'roundedsq' \ - radius = '6' \ - stroke = 1 \ - fill = 'gradient' \ - shadow = 2 \ - fg_color = 'blandyellow' \ - gradient_start = 'brightred' \ - gradient_end = 'darkred' \ - /> \ - </drawdata> \ - \ - <drawdata id = 'button_hover' cache = false> \ - <text font = 'text_button_hover' \ - vertical_align = 'center' \ - horizontal_align = 'center' \ - /> \ - <drawstep func = 'roundedsq' \ - radius = '6' \ - gradient_factor = 1 \ - stroke = 1 fill = 'gradient' \ - shadow = 0 \ - fg_color = 'blandyellow' \ - gradient_start = 'xtrabrightred' \ - gradient_end = 'darkred' \ - /> \ - </drawdata> \ - \ - <drawdata id = 'button_disabled' cache = false> \ - <text font = 'text_disabled' \ - vertical_align = 'center' \ - horizontal_align = 'center' \ - /> \ - <drawstep func = 'roundedsq' \ - radius = '8' \ - stroke = 0 \ - fill = 'foreground' \ - fg_color = '200, 200, 200' \ - shadow = 3 \ - /> \ - </drawdata> \ - \ - <drawdata id = 'checkbox_disabled' cache = false> \ - <text font = 'text_disabled' \ - vertical_align = 'top' \ - horizontal_align = 'left' \ - /> \ - <drawstep func = 'roundedsq' \ - fill = 'none' \ - radius = 8 \ - fg_color = 'black' \ - shadow = 0 \ - /> \ - </drawdata> \ - \ - <drawdata id = 'checkbox_selected' cache = false> \ - <text font = 'text_default' \ - vertical_align = 'top' \ - horizontal_align = 'left' \ - /> \ - <drawstep func = 'square' \ - fill = 'gradient' \ - gradient_start = '206, 121, 99' \ - gradient_end = '173, 40, 8' \ - shadow = 0 \ - /> \ - <drawstep func = 'circle' \ - radius = '4' \ - fill = 'foreground' \ - /> \ - </drawdata> \ - \ - <drawdata id = 'checkbox_default' cache = false> \ - <text font = 'text_default' \ - vertical_align = 'top' \ - horizontal_align = 'left' \ - /> \ - <drawstep func = 'square' \ - fill = 'gradient' \ - gradient_start = '206, 121, 99' \ - gradient_end = '173, 40, 8' \ - shadow = 0 \ - /> \ - </drawdata> \ - \ - <drawdata id = 'widget_default' cache = false> \ - <drawstep func = 'roundedsq' \ - gradient_factor = 6 \ - radius = '8' \ - fill = 'gradient' \ - gradient_start = '240, 224, 136' \ - gradient_end = 'xtrabrightred' \ - shadow = 3 \ - /> \ - </drawdata> \ -</render_info> \ - \ -<layout_info> \ - <globals> \ - <def var = 'Widget.Size' value = '30' /> \ - <def var = 'Line.Height' value = '16' /> \ - <def var = 'Font.Height' value = '16' /> \ - \ - <widget name = 'Inset' \ - pos = '23, 94' \ - size = '666, 666' \ - /> \ - <widget name = 'Button' \ - size = '120, 25' \ - /> \ - <widget name = 'Slider' \ - size = '666, 666' \ - /> \ - <widget name = 'ListWidget' \ - padding = '7, 5, 5, 5' \ - /> \ - <widget name = 'PopUpWidget' \ - padding = '7, 5, 0, 0' \ - /> \ - <widget name = 'EditTextWidget' \ - padding = '7, 5, 0, 0' \ - /> \ - <widget name = 'Console' \ - padding = '7, 5, 5, 5' \ - /> \ - \ - <widget name = 'TabWidget'> \ - <child name = 'Tab' \ - size = '75, 27' \ - padding = '0, 0, 8, 0' \ - /> \ - <child name = 'NavButton' \ - size = '15, 18' \ - padding = '0, 3, 4, 0' \ - /> \ - </widget> \ - </globals> \ - \ - <dialog name = 'Launcher'> \ - <widget name = 'Version' \ - pos = 'center, 21' \ - size = '247, Globals.Line.Height' \ - /> \ - <widget name = 'Logo' \ - pos = 'center, 5' \ - size = '283, 80' \ - /> \ - <widget name = 'GameList' \ - pos = 'Globals.Inset.X, Globals.Inset.Y' \ - size = 'Globals.Inset.Width, Globals.Inset.Height' \ - /> \ - \ - <widget name = 'StartButton' \ - size = 'Globals.Button.Width, Globals.Button.Height' \ - /> \ - <widget name = 'AddGameButton' \ - size = 'Globals.Button.Width, Globals.Button.Height' \ - /> \ - <widget name = 'EditGameButton' \ - size = 'Globals.Button.Width, Globals.Button.Height' \ - /> \ - <widget name = 'RemoveGameButton' \ - size = 'Globals.Button.Width, Globals.Button.Height' \ - /> \ - <widget name = 'OptionsButton' \ - size = 'Globals.Button.Width, Globals.Button.Height' \ - /> \ - <widget name = 'AboutButton' \ - size = 'Globals.Button.Width, Globals.Button.Height' \ - /> \ - <widget name = 'QuittButton' \ - size = 'Globals.Button.Width, Globals.Button.Height' \ - /> \ - </dialog> \ -</layout_info>"; - - if (!parser()->loadBuffer((const byte*)defaultXML, strlen(defaultXML), false)) - return false; - - return parser()->parse(); -} - -} diff --git a/gui/ThemeRenderer.cpp b/gui/ThemeRenderer.cpp index a81f46cf8e..b4d68df4be 100644 --- a/gui/ThemeRenderer.cpp +++ b/gui/ThemeRenderer.cpp @@ -57,6 +57,8 @@ const ThemeRenderer::DrawDataInfo ThemeRenderer::kDrawDataDefaults[] = { {kDDButtonDisabled, "button_disabled", true, kDDNone}, {kDDSliderFull, "slider_full", false, kDDNone}, + {kDDSliderHover, "slider_hover", false, kDDNone}, + {kDDSliderDisabled, "slider_disabled", true, kDDNone}, {kDDCheckboxDefault, "checkbox_default", true, kDDNone}, {kDDCheckboxDisabled, "checkbox_disabled", true, kDDNone}, @@ -110,7 +112,7 @@ ThemeRenderer::ThemeRenderer(Common::String themeName, GraphicsMode mode) : _graphicsMode = mode; setGraphicsMode(_graphicsMode); - loadConfigFile("classic"); + loadConfigFile("modern"); if (_screen->w >= 400 && _screen->h >= 300) { _font = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont); @@ -297,6 +299,22 @@ bool ThemeRenderer::loadTheme(Common::String themeName) { return true; } +bool ThemeRenderer::loadDefaultXML() { + + // The default XML theme is included on runtime from a pregenerated + // file inside the themes directory. + // Use the Python script "makedeftheme.py" to convert a normal XML theme + // into the "default.inc" file, which is ready to be included in the code. + const char *defaultXML = +#include "themes/default.inc" + ; + + if (!parser()->loadBuffer((const byte*)defaultXML, strlen(defaultXML), false)) + return false; + + return parser()->parse(); +} + bool ThemeRenderer::loadThemeXML(Common::String themeName) { assert(_parser); @@ -475,12 +493,22 @@ void ThemeRenderer::drawCheckbox(const Common::Rect &r, const Common::String &st void ThemeRenderer::drawSlider(const Common::Rect &r, int width, WidgetStateInfo state) { if (!ready()) return; + + DrawData dd = kDDSliderFull; + + if (state == kStateHighlight) + dd = kDDSliderHover; + else if (state == kStateDisabled) + dd = kDDSliderDisabled; Common::Rect r2 = r; r2.setWidth(MIN((int16)width, r.width())); + r2.top++; r2.bottom--; r2.left++; r2.right--; drawWidgetBackground(r, 0, kWidgetBackgroundSlider, kStateEnabled); - queueDD(kDDSliderFull, r2); + + if (width > r.width() * 5 / 100) + queueDD(dd, r2); } void ThemeRenderer::drawScrollbar(const Common::Rect &r, int sliderY, int sliderHeight, ScrollbarState scrollState, WidgetStateInfo state) { @@ -576,7 +604,7 @@ void ThemeRenderer::drawTab(const Common::Rect &r, int tabHeight, int tabWidth, if (!ready()) return; - const int tabOffset = 3; + const int tabOffset = 1; queueDD(kDDTabBackground, Common::Rect(r.left, r.top, r.right, r.top + tabHeight)); diff --git a/gui/ThemeRenderer.h b/gui/ThemeRenderer.h index 2a0f059d41..240bf28e10 100644 --- a/gui/ThemeRenderer.h +++ b/gui/ThemeRenderer.h @@ -118,6 +118,8 @@ protected: kDDButtonDisabled, kDDSliderFull, + kDDSliderHover, + kDDSliderDisabled, kDDCheckboxDefault, kDDCheckboxDisabled, diff --git a/gui/module.mk b/gui/module.mk index 6ff74641b8..4afe11201a 100644 --- a/gui/module.mk +++ b/gui/module.mk @@ -25,7 +25,6 @@ MODULE_OBJS := \ widget.o \ theme.o \ ThemeClassic.o \ - ThemeDefaultXML.o \ ThemeModern.o \ ThemeParser.o \ theme-config.o diff --git a/gui/themes/default.inc b/gui/themes/default.inc new file mode 100644 index 0000000000..ef3120df44 --- /dev/null +++ b/gui/themes/default.inc @@ -0,0 +1 @@ +" <render_info> <palette> <color name = 'darkred' rgb = '168, 42, 12' /> <color name = 'brightred' rgb = '200, 124, 104' /> <color name = 'xtrabrightred' rgb = '251, 241, 206' /> <color name = 'blandyellow' rgb = '247, 228, 166' /> <color name = 'bgreen' rgb = '96, 160, 8' /> <color name = 'blue' rgb = '0, 255, 255' /> <color name = 'black' rgb = '0, 0, 0' /> <color name = 'white' rgb = '255, 255, 255' /> </palette> <fonts> <font id = 'text_default' type = 'default' color = 'black' /> <font id = 'text_hover' type = 'default' color = 'bgreen' /> <font id = 'text_disabled' type = 'default' color = '128, 128, 128' /> <font id = 'text_inverted' type = 'default' color = '0, 0, 0' /> <font id = 'text_button' type = 'default' color = 'white' /> <font id = 'text_button_hover' type = 'default' color = 'blandyellow' /> </fonts> <defaults fill = 'gradient' fg_color = 'white' /> <drawdata id = 'text_selection' cache = false> <drawstep func = 'square' fill = 'foreground' fg_color = 'bgreen' /> </drawdata> <drawdata id = 'mainmenu_bg' cache = false> <drawstep func = 'fill' fill = 'gradient' gradient_start = '208, 112, 8' gradient_end = '232, 192, 16' /> </drawdata> <drawdata id = 'separator' cache = false> <drawstep func = 'square' fill = 'foreground' height = '1' ypos = 'center' fg_color = 'black' /> </drawdata> <drawdata id = 'scrollbar_base' cache = false> <drawstep func = 'roundedsq' stroke = 1 radius = 6 fill = 'background' fg_color = '176, 164, 160' bg_color = '240, 228, 160' /> </drawdata> <drawdata id = 'scrollbar_handle_hover' cache = false> <drawstep func = 'roundedsq' stroke = 1 radius = 6 fill = 'gradient' fg_color = 'blandyellow' gradient_start = 'xtrabrightred' gradient_end = 'darkred' /> </drawdata> <drawdata id = 'scrollbar_handle_idle' cache = false> <drawstep func = 'roundedsq' stroke = 1 radius = 6 fill = 'gradient' fg_color = 'blandyellow' gradient_start = 'brightred' gradient_end = 'darkred' /> </drawdata> <drawdata id = 'scrollbar_button_idle' cache = false> <drawstep func = 'roundedsq' radius = '4' fill = 'none' fg_color = '176, 164, 160' stroke = 1 /> <drawstep func = 'triangle' fg_color = '0, 0, 0' fill = 'foreground' width = 'auto' height = 'auto' xpos = 'center' ypos = 'center' orientation = 'top' /> </drawdata> <drawdata id = 'scrollbar_button_hover' cache = false> <drawstep func = 'roundedsq' radius = '4' fill = 'background' fg_color = '120, 120, 120' bg_color = '206, 121, 99' stroke = 1 /> <drawstep func = 'triangle' fg_color = '0, 0, 0' fill = 'foreground' width = 'auto' height = 'auto' xpos = 'center' ypos = 'center' orientation = 'top' /> </drawdata> <drawdata id = 'tab_active' cache = false> <text font = 'text_default' vertical_align = 'center' horizontal_align = 'center' /> <drawstep func = 'tab' radius = '4' stroke = '0' fill = 'gradient' gradient_end = 'xtrabrightred' gradient_start = 'blandyellow' shadow = 3 /> </drawdata> <drawdata id = 'tab_inactive' cache = false> <text font = 'text_default' vertical_align = 'center' horizontal_align = 'center' /> <drawstep func = 'tab' radius = '4' stroke = '0' fill = 'foreground' fg_color = '240, 205, 118' shadow = 3 /> </drawdata> <drawdata id = 'tab_background' cache = false> <drawstep func = 'tab' radius = '12' stroke = '0' fill = 'foreground' fg_color = '232, 180, 81' shadow = 3 /> </drawdata> <drawdata id = 'widget_slider' cache = false> <drawstep func = 'roundedsq' stroke = 1 radius = 8 fill = 'none' fg_color = '0, 0, 0' /> </drawdata> <drawdata id = 'slider_full' cache = false> <drawstep func = 'roundedsq' stroke = 0 radius = 4 fill = 'gradient' gradient_start = 'brightred' gradient_end = 'darkred' /> </drawdata> <drawdata id = 'slider_hover' cache = false> <drawstep func = 'roundedsq' stroke = 0 radius = 4 fill = 'gradient' gradient_start = 'xtrabrightred' gradient_end = 'darkred' /> </drawdata> <drawdata id = 'popup_idle' cache = false> <drawstep func = 'roundedsq' stroke = 0 radius = 4 fill = 'foreground' fg_color = '250, 237, 190' shadow = 2 /> <drawstep func = 'triangle' fg_color = '63, 60, 52' fill = 'foreground' width = 'height' height = 'auto' xpos = 'right' ypos = 'center' orientation = 'bottom' /> <text font = 'text_default' vertical_align = 'center' horizontal_align = 'right' /> </drawdata> <drawdata id = 'popup_hover' cache = false> <drawstep func = 'roundedsq' stroke = 0 radius = 4 fill = 'gradient' gradient_start = 'blandyellow' gradient_end = '250, 237, 190' shadow = 0 /> <drawstep func = 'triangle' fg_color = '63, 60, 52' fill = 'foreground' width = 'height' height = 'auto' xpos = 'right' ypos = 'center' orientation = 'bottom' /> <text font = 'text_hover' vertical_align = 'center' horizontal_align = 'right' /> </drawdata> <drawdata id = 'default_bg' cache = false> <drawstep func = 'roundedsq' radius = 12 stroke = 0 fg_color = 'xtrabrightred' fill = 'foreground' shadow = 3 /> </drawdata> <drawdata id = 'button_idle' cache = false> <text font = 'text_button' vertical_align = 'center' horizontal_align = 'center' /> <drawstep func = 'roundedsq' radius = '6' stroke = 1 fill = 'gradient' shadow = 2 fg_color = 'blandyellow' gradient_start = 'brightred' gradient_end = 'darkred' /> </drawdata> <drawdata id = 'button_hover' cache = false> <text font = 'text_button_hover' vertical_align = 'center' horizontal_align = 'center' /> <drawstep func = 'roundedsq' radius = '6' gradient_factor = 1 stroke = 1 fill = 'gradient' shadow = 0 fg_color = 'blandyellow' gradient_start = 'xtrabrightred' gradient_end = 'darkred' /> </drawdata> <drawdata id = 'button_disabled' cache = false> <text font = 'text_disabled' vertical_align = 'center' horizontal_align = 'center' /> <drawstep func = 'roundedsq' radius = '8' stroke = 0 fill = 'foreground' fg_color = '200, 200, 200' shadow = 3 /> </drawdata> <drawdata id = 'checkbox_disabled' cache = false> <text font = 'text_disabled' vertical_align = 'top' horizontal_align = 'left' /> <drawstep func = 'roundedsq' fill = 'none' radius = 8 fg_color = 'black' shadow = 0 /> </drawdata> <drawdata id = 'checkbox_selected' cache = false> <text font = 'text_default' vertical_align = 'top' horizontal_align = 'left' /> <drawstep func = 'square' fill = 'gradient' gradient_start = '206, 121, 99' gradient_end = '173, 40, 8' shadow = 0 /> <drawstep func = 'circle' radius = '4' fill = 'foreground' /> </drawdata> <drawdata id = 'checkbox_default' cache = false> <text font = 'text_default' vertical_align = 'top' horizontal_align = 'left' /> <drawstep func = 'square' fill = 'gradient' gradient_start = '206, 121, 99' gradient_end = '173, 40, 8' shadow = 0 /> </drawdata> <drawdata id = 'widget_default' cache = false> <drawstep func = 'roundedsq' gradient_factor = 6 radius = '8' fill = 'gradient' gradient_start = '240, 224, 136' gradient_end = 'xtrabrightred' shadow = 3 /> </drawdata> </render_info> <layout_info> <globals> <def var = 'Widget.Size' value = '30' /> <def var = 'Line.Height' value = '16' /> <def var = 'Font.Height' value = '16' /> <widget name = 'Inset' pos = '23, 94' size = '666, 666' /> <widget name = 'Button' size = '120, 25' /> <widget name = 'Slider' size = '666, 666' /> <widget name = 'ListWidget' padding = '7, 5, 5, 5' /> <widget name = 'PopUpWidget' padding = '7, 5, 0, 0' /> <widget name = 'EditTextWidget' padding = '7, 5, 0, 0' /> <widget name = 'Console' padding = '7, 5, 5, 5' /> <widget name = 'TabWidget'> <child name = 'Tab' size = '75, 27' padding = '0, 0, 8, 0' /> <child name = 'NavButton' size = '15, 18' padding = '0, 3, 4, 0' /> </widget> </globals> <dialog name = 'Launcher'> <widget name = 'Version' pos = 'center, 21' size = '247, Globals.Line.Height' /> <widget name = 'Logo' pos = 'center, 5' size = '283, 80' /> <widget name = 'GameList' pos = 'Globals.Inset.X, Globals.Inset.Y' size = 'Globals.Inset.Width, Globals.Inset.Height' /> <widget name = 'StartButton' size = 'Globals.Button.Width, Globals.Button.Height' /> <widget name = 'AddGameButton' size = 'Globals.Button.Width, Globals.Button.Height' /> <widget name = 'EditGameButton' size = 'Globals.Button.Width, Globals.Button.Height' /> <widget name = 'RemoveGameButton' size = 'Globals.Button.Width, Globals.Button.Height' /> <widget name = 'OptionsButton' size = 'Globals.Button.Width, Globals.Button.Height' /> <widget name = 'AboutButton' size = 'Globals.Button.Width, Globals.Button.Height' /> <widget name = 'QuittButton' size = 'Globals.Button.Width, Globals.Button.Height' /> </dialog> </layout_info> " diff --git a/gui/themes/makedeftheme.py b/gui/themes/makedeftheme.py new file mode 100644 index 0000000000..fc09e6b1f0 --- /dev/null +++ b/gui/themes/makedeftheme.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +# encoding: utf-8 +import sys +import re + +def main(): + theme_file = open(sys.argv[1], "r") + def_file = open("default.inc", "w") + comment = re.compile("\/\*(.*)\*\/") + + try: + output = "\"" + for line in theme_file: + output += (line.rstrip("\n\r ").lstrip() + " ") + + output = re.sub("\/\*(.*)\*\/", "", output) + def_file.write(output + "\"\n") + finally: + theme_file.close() + def_file.close() + +if __name__ == "__main__": + sys.exit(main()) diff --git a/gui/themes/modern.stx b/gui/themes/modern.stx new file mode 100644 index 0000000000..978db1e44f --- /dev/null +++ b/gui/themes/modern.stx @@ -0,0 +1,483 @@ +/* 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$ + * + */ + +/* ScummVM Theme XML file */ +/* Modern Theme */ + +<render_info> + <palette> + <color name = 'darkred' + rgb = '168, 42, 12' + /> + <color name = 'brightred' + rgb = '200, 124, 104' + /> + <color name = 'xtrabrightred' + rgb = '251, 241, 206' + /> + <color name = 'blandyellow' + rgb = '247, 228, 166' + /> + <color name = 'bgreen' + rgb = '96, 160, 8' + /> + <color name = 'blue' + rgb = '0, 255, 255' + /> + <color name = 'black' + rgb = '0, 0, 0' + /> + <color name = 'white' + rgb = '255, 255, 255' + /> + </palette> + + <fonts> + <font id = 'text_default' + type = 'default' + color = 'black' + /> + <font id = 'text_hover' + type = 'default' + color = 'bgreen' + /> + <font id = 'text_disabled' + type = 'default' + color = '128, 128, 128' + /> + <font id = 'text_inverted' + type = 'default' + color = '0, 0, 0' + /> + <font id = 'text_button' + type = 'default' + color = 'white' + /> + <font id = 'text_button_hover' + type = 'default' + color = 'blandyellow' + /> + </fonts> + + <defaults fill = 'gradient' fg_color = 'white' /> + + <drawdata id = 'text_selection' cache = false> + <drawstep func = 'square' + fill = 'foreground' + fg_color = 'bgreen' + /> + </drawdata> + + <drawdata id = 'mainmenu_bg' cache = false> + <drawstep func = 'fill' + fill = 'gradient' + gradient_start = '208, 112, 8' + gradient_end = '232, 192, 16' + /> + </drawdata> + + <drawdata id = 'separator' cache = false> + <drawstep func = 'square' + fill = 'foreground' + height = '1' + ypos = 'center' + fg_color = 'black' + /> + </drawdata> + + <drawdata id = 'scrollbar_base' cache = false> + <drawstep func = 'roundedsq' + stroke = 1 + radius = 6 + fill = 'background' + fg_color = '176, 164, 160' + bg_color = '240, 228, 160' + /> + </drawdata> + + <drawdata id = 'scrollbar_handle_hover' cache = false> + <drawstep func = 'roundedsq' + stroke = 1 + radius = 6 + fill = 'gradient' + fg_color = 'blandyellow' + gradient_start = 'xtrabrightred' + gradient_end = 'darkred' + /> + </drawdata> + + <drawdata id = 'scrollbar_handle_idle' cache = false> + <drawstep func = 'roundedsq' + stroke = 1 + radius = 6 + fill = 'gradient' + fg_color = 'blandyellow' + gradient_start = 'brightred' + gradient_end = 'darkred' + /> + </drawdata> + + <drawdata id = 'scrollbar_button_idle' cache = false> + <drawstep func = 'roundedsq' + radius = '4' + fill = 'none' + fg_color = '176, 164, 160' + stroke = 1 + /> + <drawstep func = 'triangle' + fg_color = '0, 0, 0' + fill = 'foreground' + width = 'auto' + height = 'auto' + xpos = 'center' + ypos = 'center' + orientation = 'top' + /> + </drawdata> + + <drawdata id = 'scrollbar_button_hover' cache = false> + <drawstep func = 'roundedsq' + radius = '4' + fill = 'background' + fg_color = '120, 120, 120' + bg_color = '206, 121, 99' + stroke = 1 + /> + <drawstep func = 'triangle' + fg_color = '0, 0, 0' + fill = 'foreground' + width = 'auto' + height = 'auto' + xpos = 'center' + ypos = 'center' + orientation = 'top' + /> + </drawdata> + + <drawdata id = 'tab_active' cache = false> + <text font = 'text_default' + vertical_align = 'center' + horizontal_align = 'center' + /> + <drawstep func = 'tab' + radius = '4' + stroke = '0' + fill = 'gradient' + gradient_end = 'xtrabrightred' + gradient_start = 'blandyellow' + shadow = 3 + /> + </drawdata> + + <drawdata id = 'tab_inactive' cache = false> + <text font = 'text_default' + vertical_align = 'center' + horizontal_align = 'center' + /> + <drawstep func = 'tab' + radius = '4' + stroke = '0' + fill = 'foreground' + fg_color = '240, 205, 118' + shadow = 3 + /> + </drawdata> + + <drawdata id = 'tab_background' cache = false> + <drawstep func = 'tab' + radius = '12' + stroke = '0' + fill = 'foreground' + fg_color = '232, 180, 81' + shadow = 3 + /> + </drawdata> + + <drawdata id = 'widget_slider' cache = false> + <drawstep func = 'roundedsq' + stroke = 1 + radius = 8 + fill = 'none' + fg_color = '0, 0, 0' + /> + </drawdata> + + <drawdata id = 'slider_full' cache = false> + <drawstep func = 'roundedsq' + stroke = 0 + radius = 4 + fill = 'gradient' + gradient_start = 'brightred' + gradient_end = 'darkred' + /> + </drawdata> + + <drawdata id = 'slider_hover' cache = false> + <drawstep func = 'roundedsq' + stroke = 0 + radius = 4 + fill = 'gradient' + gradient_start = 'xtrabrightred' + gradient_end = 'darkred' + /> + </drawdata> + + <drawdata id = 'popup_idle' cache = false> + <drawstep func = 'roundedsq' + stroke = 0 + radius = 4 + fill = 'foreground' + fg_color = '250, 237, 190' + shadow = 2 + /> + <drawstep func = 'triangle' + fg_color = '63, 60, 52' + fill = 'foreground' + width = 'height' + height = 'auto' + xpos = 'right' + ypos = 'center' + orientation = 'bottom' + /> + <text font = 'text_default' + vertical_align = 'center' + horizontal_align = 'right' + /> + </drawdata> + + + <drawdata id = 'popup_hover' cache = false> + <drawstep func = 'roundedsq' + stroke = 0 + radius = 4 + fill = 'gradient' + gradient_start = 'blandyellow' + gradient_end = '250, 237, 190' + shadow = 0 + /> + <drawstep func = 'triangle' + fg_color = '63, 60, 52' + fill = 'foreground' + width = 'height' + height = 'auto' + xpos = 'right' + ypos = 'center' + orientation = 'bottom' + /> + <text font = 'text_hover' + vertical_align = 'center' + horizontal_align = 'right' + /> + </drawdata> + + <drawdata id = 'default_bg' cache = false> + <drawstep func = 'roundedsq' + radius = 12 + stroke = 0 + fg_color = 'xtrabrightred' + fill = 'foreground' + shadow = 3 + /> + </drawdata> + + <drawdata id = 'button_idle' cache = false> + <text font = 'text_button' + vertical_align = 'center' + horizontal_align = 'center' + /> + <drawstep func = 'roundedsq' + radius = '6' + stroke = 1 + fill = 'gradient' + shadow = 2 + fg_color = 'blandyellow' + gradient_start = 'brightred' + gradient_end = 'darkred' + /> + </drawdata> + + <drawdata id = 'button_hover' cache = false> + <text font = 'text_button_hover' + vertical_align = 'center' + horizontal_align = 'center' + /> + <drawstep func = 'roundedsq' + radius = '6' + gradient_factor = 1 + stroke = 1 fill = 'gradient' + shadow = 0 + fg_color = 'blandyellow' + gradient_start = 'xtrabrightred' + gradient_end = 'darkred' + /> + </drawdata> + + <drawdata id = 'button_disabled' cache = false> + <text font = 'text_disabled' + vertical_align = 'center' + horizontal_align = 'center' + /> + <drawstep func = 'roundedsq' + radius = '8' + stroke = 0 + fill = 'foreground' + fg_color = '200, 200, 200' + shadow = 3 + /> + </drawdata> + + <drawdata id = 'checkbox_disabled' cache = false> + <text font = 'text_disabled' + vertical_align = 'top' + horizontal_align = 'left' + /> + <drawstep func = 'roundedsq' + fill = 'none' + radius = 8 + fg_color = 'black' + shadow = 0 + /> + </drawdata> + + <drawdata id = 'checkbox_selected' cache = false> + <text font = 'text_default' + vertical_align = 'top' + horizontal_align = 'left' + /> + <drawstep func = 'square' + fill = 'gradient' + gradient_start = '206, 121, 99' + gradient_end = '173, 40, 8' + shadow = 0 + /> + <drawstep func = 'circle' + radius = '4' + fill = 'foreground' + /> + </drawdata> + + <drawdata id = 'checkbox_default' cache = false> + <text font = 'text_default' + vertical_align = 'top' + horizontal_align = 'left' + /> + <drawstep func = 'square' + fill = 'gradient' + gradient_start = '206, 121, 99' + gradient_end = '173, 40, 8' + shadow = 0 + /> + </drawdata> + + <drawdata id = 'widget_default' cache = false> + <drawstep func = 'roundedsq' + gradient_factor = 6 + radius = '8' + fill = 'gradient' + gradient_start = '240, 224, 136' + gradient_end = 'xtrabrightred' + shadow = 3 + /> + </drawdata> +</render_info> + +<layout_info> + <globals> + <def var = 'Widget.Size' value = '30' /> + <def var = 'Line.Height' value = '16' /> + <def var = 'Font.Height' value = '16' /> + + <widget name = 'Inset' + pos = '23, 94' + size = '666, 666' + /> + <widget name = 'Button' + size = '120, 25' + /> + <widget name = 'Slider' + size = '666, 666' + /> + <widget name = 'ListWidget' + padding = '7, 5, 5, 5' + /> + <widget name = 'PopUpWidget' + padding = '7, 5, 0, 0' + /> + <widget name = 'EditTextWidget' + padding = '7, 5, 0, 0' + /> + <widget name = 'Console' + padding = '7, 5, 5, 5' + /> + + <widget name = 'TabWidget'> + <child name = 'Tab' + size = '75, 27' + padding = '0, 0, 8, 0' + /> + <child name = 'NavButton' + size = '15, 18' + padding = '0, 3, 4, 0' + /> + </widget> + </globals> + + <dialog name = 'Launcher'> + <widget name = 'Version' + pos = 'center, 21' + size = '247, Globals.Line.Height' + /> + <widget name = 'Logo' + pos = 'center, 5' + size = '283, 80' + /> + <widget name = 'GameList' + pos = 'Globals.Inset.X, Globals.Inset.Y' + size = 'Globals.Inset.Width, Globals.Inset.Height' + /> + + <widget name = 'StartButton' + size = 'Globals.Button.Width, Globals.Button.Height' + /> + <widget name = 'AddGameButton' + size = 'Globals.Button.Width, Globals.Button.Height' + /> + <widget name = 'EditGameButton' + size = 'Globals.Button.Width, Globals.Button.Height' + /> + <widget name = 'RemoveGameButton' + size = 'Globals.Button.Width, Globals.Button.Height' + /> + <widget name = 'OptionsButton' + size = 'Globals.Button.Width, Globals.Button.Height' + /> + <widget name = 'AboutButton' + size = 'Globals.Button.Width, Globals.Button.Height' + /> + <widget name = 'QuittButton' + size = 'Globals.Button.Width, Globals.Button.Height' + /> + </dialog> +</layout_info>
\ No newline at end of file |