aboutsummaryrefslogtreecommitdiff
path: root/gui/ThemeEngine.h
diff options
context:
space:
mode:
authorNorbert Lange2009-08-11 22:35:56 +0000
committerNorbert Lange2009-08-11 22:35:56 +0000
commit0836cf6d9b9222255273a9c6f9d91203b13c3bd9 (patch)
tree714c59161aaf7dbc36d7cb6b4e8fcaa9c467e8f9 /gui/ThemeEngine.h
parent8cb42dd6896925106282abd23ce23812d6031989 (diff)
parent65e9ae163ff757ca15af78da4a753a7ee1d25a16 (diff)
downloadscummvm-rg350-0836cf6d9b9222255273a9c6f9d91203b13c3bd9.tar.gz
scummvm-rg350-0836cf6d9b9222255273a9c6f9d91203b13c3bd9.tar.bz2
scummvm-rg350-0836cf6d9b9222255273a9c6f9d91203b13c3bd9.zip
merged from trunk (Amiga LoK supposedly completeable!)
fixed a bug I introduced in one of the last cleanups svn-id: r43291
Diffstat (limited to 'gui/ThemeEngine.h')
-rw-r--r--gui/ThemeEngine.h54
1 files changed, 42 insertions, 12 deletions
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index c2b6db7119..cab5f9fd41 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -32,7 +32,7 @@
#include "graphics/surface.h"
#include "graphics/fontman.h"
-#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.6"
+#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.7"
namespace Graphics {
struct DrawStep;
@@ -45,6 +45,7 @@ struct WidgetDrawData;
struct DrawDataInfo;
struct TextDataInfo;
struct TextDrawData;
+struct TextColorData;
class Dialog;
class GuiObject;
class ThemeEval;
@@ -105,15 +106,26 @@ enum DrawData {
enum TextData {
kTextDataNone = -1,
kTextDataDefault = 0,
- kTextDataHover,
- kTextDataDisabled,
- kTextDataInverted,
kTextDataButton,
- kTextDataButtonHover,
kTextDataNormalFont,
kTextDataMAX
};
+enum TextColor {
+ kTextColorNormal = 0,
+ kTextColorNormalInverted,
+ kTextColorNormalHover,
+ kTextColorNormalDisabled,
+ kTextColorAlternative,
+ kTextColorAlternativeInverted,
+ kTextColorAlternativeHover,
+ kTextColorAlternativeDisabled,
+ kTextColorButton,
+ kTextColorButtonHover,
+ kTextColorButtonDisabled,
+ kTextColorMAX
+};
+
class ThemeEngine {
protected:
typedef Common::HashMap<Common::String, Graphics::Surface*> ImagesMap;
@@ -183,6 +195,13 @@ public:
kFontStyleMax
};
+ //! Font color selector
+ enum FontColor {
+ kFontColorNormal = 0, //!< The default color of the theme
+ kFontColorAlternate = 1, //!< Alternative font color
+ kFontColorMax
+ };
+
//! Function used to process areas other than the current dialog
enum ShadingStyle {
kShadingNone, //!< No special post processing
@@ -310,9 +329,9 @@ public:
void drawDialogBackground(const Common::Rect &r, DialogBackground type, WidgetStateInfo state = kStateEnabled);
- void drawText(const Common::Rect &r, const Common::String &str, WidgetStateInfo state = kStateEnabled, Graphics::TextAlign align = Graphics::kTextAlignCenter, TextInversionState inverted = kTextInversionNone, int deltax = 0, bool useEllipsis = true, FontStyle font = kFontStyleBold);
+ void drawText(const Common::Rect &r, const Common::String &str, WidgetStateInfo state = kStateEnabled, Graphics::TextAlign align = Graphics::kTextAlignCenter, TextInversionState inverted = kTextInversionNone, int deltax = 0, bool useEllipsis = true, FontStyle font = kFontStyleBold, FontColor color = kFontColorNormal);
- void drawChar(const Common::Rect &r, byte ch, const Graphics::Font *font, WidgetStateInfo state = kStateEnabled);
+ void drawChar(const Common::Rect &r, byte ch, const Graphics::Font *font, WidgetStateInfo state = kStateEnabled, FontColor color = kFontColorNormal);
//@}
@@ -340,6 +359,7 @@ public:
DrawData parseDrawDataId(const Common::String &name) const;
TextData getTextData(DrawData ddId) const;
+ TextColor getTextColor(DrawData ddId) const;
/**
@@ -354,7 +374,7 @@ public:
void addDrawStep(const Common::String &drawDataId, const Graphics::DrawStep &step);
/**
- * Interfacefor the ThemeParser class: Parsed DrawData sets are added via this function.
+ * Interface for the ThemeParser class: Parsed DrawData sets are added via this function.
* The goal of the function is to initialize each DrawData set before their DrawSteps can
* be added, hence this must be called for each DD set before addDrawStep() can be called
* for that given set.
@@ -371,9 +391,16 @@ public:
*
* @param fontName Identifier name for the font.
* @param file Name of the font file.
- * @param r, g, b Color of the font.
*/
- bool addFont(TextData textId, const Common::String &file, int r, int g, int b);
+ bool addFont(TextData textId, const Common::String &file);
+
+ /**
+ * Interface for the ThemeParser class: adds a text color value.
+ *
+ * @param colorId Identifier for the color type.
+ * @param r, g, b Color of the font.
+ */
+ bool addTextColor(TextColor colorId, int r, int g, int b);
/**
@@ -388,7 +415,7 @@ public:
* Adds a new TextStep from the ThemeParser. This will be deprecated/removed once the
* new Font API is in place. FIXME: Is that so ???
*/
- bool addTextData(const Common::String &drawDataId, TextData textId, Graphics::TextAlign alignH, TextAlignVertical alignV);
+ bool addTextData(const Common::String &drawDataId, TextData textId, TextColor id, Graphics::TextAlign alignH, TextAlignVertical alignV);
protected:
/**
@@ -511,7 +538,7 @@ protected:
* This function is called from all the Widget Drawing methods.
*/
void queueDD(DrawData type, const Common::Rect &r, uint32 dynamic = 0, bool restore = false);
- void queueDDText(TextData type, const Common::Rect &r, const Common::String &text, bool restoreBg,
+ void queueDDText(TextData type, TextColor color, const Common::Rect &r, const Common::String &text, bool restoreBg,
bool elipsis, Graphics::TextAlign alignH = Graphics::kTextAlignLeft, TextAlignVertical alignV = kTextAlignVTop, int deltax = 0);
void queueBitmap(const Graphics::Surface *bitmap, const Common::Rect &r, bool alpha);
@@ -580,6 +607,9 @@ protected:
/** Array of all the text fonts that can be drawn. */
TextDrawData *_texts[kTextDataMAX];
+ /** Array of all font colors available. */
+ TextColorData *_textColors[kTextColorMAX];
+
ImagesMap _bitmaps;
Graphics::PixelFormat _overlayFormat;