diff options
Diffstat (limited to 'gui/ThemeEngine.h')
-rw-r--r-- | gui/ThemeEngine.h | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h index 2da1c3a014..73181b74a6 100644 --- a/gui/ThemeEngine.h +++ b/gui/ThemeEngine.h @@ -61,6 +61,7 @@ enum DrawData { kDDMainDialogBackground, kDDSpecialColorBackground, kDDPlainColorBackground, + kDDTooltipBackground, kDDDefaultBackground, kDDTextSelectionBackground, kDDTextSelectionFocusBackground, @@ -82,6 +83,10 @@ enum DrawData { kDDCheckboxDisabled, kDDCheckboxSelected, + kDDRadiobuttonDefault, + kDDRadiobuttonDisabled, + kDDRadiobuttonSelected, + kDDTabActive, kDDTabInactive, kDDTabBackground, @@ -108,6 +113,7 @@ enum TextData { kTextDataDefault = 0, kTextDataButton, kTextDataNormalFont, + kTextDataTooltip, kTextDataMAX }; @@ -157,6 +163,7 @@ public: kDialogBackgroundMain, kDialogBackgroundSpecial, kDialogBackgroundPlain, + kDialogBackgroundTooltip, kDialogBackgroundDefault }; @@ -173,7 +180,7 @@ public: enum TextInversionState { kTextInversionNone, ///< Indicates that the text should not be drawn inverted kTextInversion, ///< Indicates that the text should be drawn inverted, but not focused - kTextInversionFocus ///< Indicates thte the test should be drawn inverted, and focused + kTextInversionFocus ///< Indicates that the text should be drawn inverted, and focused }; enum ScrollbarState { @@ -192,6 +199,7 @@ public: kFontStyleFixedNormal = 3, ///< Fixed size font. kFontStyleFixedBold = 4, ///< Fixed size bold font. kFontStyleFixedItalic = 5, ///< Fixed size italic font. + kFontStyleTooltip = 6, ///< Tiny console font kFontStyleMax }; @@ -255,6 +263,17 @@ public: void enable(); void disable(); + struct StoredState { + Common::Rect r; + Graphics::Surface screen; + Graphics::Surface backBuffer; + + StoredState() {} + }; + + StoredState *storeState(const Common::Rect &r); + void restoreState(StoredState *state); + /** * Implementation of the GUI::Theme API. Called when a * new dialog is opened. Note that the boolean parameter @@ -280,6 +299,8 @@ public: TextData fontStyleToData(FontStyle font) const { if (font == kFontStyleNormal) return kTextDataNormalFont; + if (font == kFontStyleTooltip) + return kTextDataTooltip; return kTextDataDefault; } @@ -312,6 +333,9 @@ public: void drawCheckbox(const Common::Rect &r, const Common::String &str, bool checked, WidgetStateInfo state = kStateEnabled); + void drawRadiobutton(const Common::Rect &r, const Common::String &str, + bool checked, WidgetStateInfo state = kStateEnabled); + void drawTab(const Common::Rect &r, int tabHeight, int tabWidth, const Common::Array<Common::String> &tabs, int active, uint16 hints, int titleVPad, WidgetStateInfo state = kStateEnabled); @@ -329,7 +353,7 @@ 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, FontColor color = kFontColorNormal); + 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, bool restore = true); void drawChar(const Common::Rect &r, byte ch, const Graphics::Font *font, WidgetStateInfo state = kStateEnabled, FontColor color = kFontColorNormal); @@ -516,7 +540,9 @@ protected: const Graphics::Font *loadFont(const Common::String &filename); const Graphics::Font *loadFontFromArchive(const Common::String &filename); + const Graphics::Font *loadCachedFontFromArchive(const Common::String &filename); Common::String genCacheFilename(const char *filename); + Common::String genLocalizedFontFilename(const char *filename); /** * Actual Dirty Screen handling function. @@ -560,11 +586,13 @@ public: static void listUsableThemes(Common::List<ThemeDescriptor> &list); private: static bool themeConfigUsable(const Common::FSNode &node, Common::String &themeName); + static bool themeConfigUsable(const Common::ArchiveMember &member, Common::String &themeName); static bool themeConfigParseHeader(Common::String header, Common::String &themeName); static Common::String getThemeFile(const Common::String &id); static Common::String getThemeId(const Common::String &filename); static void listUsableThemes(const Common::FSNode &node, Common::List<ThemeDescriptor> &list, int depth = -1); + static void listUsableThemes(Common::Archive &archive, Common::List<ThemeDescriptor> &list); protected: OSystem *_system; /** Global system object. */ |