From 46087564d4184b28740b0c45c1bac199ab1942ec Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 16 Mar 2014 14:14:29 +0300 Subject: Improve theme usage. Removed instance method. --- src/gui/theme.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/gui/theme.h') diff --git a/src/gui/theme.h b/src/gui/theme.h index 86543ea64..5f902e206 100644 --- a/src/gui/theme.h +++ b/src/gui/theme.h @@ -40,9 +40,12 @@ class DyePalette; class Image; class ImageSet; +class Theme; const int THEME_PALETTES = 5; +extern Theme *theme; + struct ThemeInfo final { ThemeInfo() : @@ -176,11 +179,11 @@ class Skin final class Theme final : public Palette, public ConfigListener { public: - A_DELETE_COPY(Theme) + Theme(); - static Theme *instance() A_WARN_UNUSED; + ~Theme(); - static void deleteInstance(); + A_DELETE_COPY(Theme) static void prepareThemePath(); @@ -453,15 +456,15 @@ class Theme final : public Palette, public ConfigListener inline static const Color &getThemeColor(const int type, const int alpha = 255) A_WARN_UNUSED - { return mInstance->getColor(type, alpha); } + { return theme->getColor(type, alpha); } static const Color &getThemeCharColor(const signed char c, bool &valid) A_WARN_UNUSED - { return mInstance->getCharColor(c, valid); } + { return theme->getCharColor(c, valid); } static int getThemeIdByChar(const signed char c, bool &valid) A_WARN_UNUSED - { return mInstance->getIdByChar(c, valid); } + { return theme->getIdByChar(c, valid); } static Color getProgressColor(const int type, const float progress) A_WARN_UNUSED; @@ -513,10 +516,6 @@ class Theme final : public Palette, public ConfigListener static ThemeInfo *loadInfo(const std::string &themeName) A_WARN_UNUSED; private: - Theme(); - - ~Theme(); - Skin *readSkin(const std::string &filename0, const bool full) A_WARN_UNUSED; @@ -529,7 +528,6 @@ class Theme final : public Palette, public ConfigListener static std::string mThemePath; static std::string mThemeName; static std::string mScreenDensity; - static Theme *mInstance; static bool tryThemePath(const std::string &themePath) A_WARN_UNUSED; -- cgit v1.2.3-60-g2f50