diff options
Diffstat (limited to 'kxkb/pixmap.h')
-rw-r--r-- | kxkb/pixmap.h | 52 |
1 files changed, 23 insertions, 29 deletions
diff --git a/kxkb/pixmap.h b/kxkb/pixmap.h index a17f48d89..bbf292689 100644 --- a/kxkb/pixmap.h +++ b/kxkb/pixmap.h @@ -8,41 +8,35 @@ #include "kxkbconfig.h" -enum PixmapStyle { - PIXMAP_STYLE_NORMAL = 0, - PIXMAP_STYLE_INDICATOR = 1, - PIXMAP_STYLE_CONTEXTMENU = 2 -}; - -class LayoutIcon { +#define ERROR_CODE "error" +#define ERROR_LABEL "!" -private: - static LayoutIcon* instance; - static const TQString flagTemplate; +#define FLAG_MAX_DIM 24 - KxkbConfig m_kxkbConfig; - bool m_showFlag; - bool m_showLabel; - TQColor m_bgColor; - bool m_bgTransparent; - TQColor m_fgColor; - TQFont m_labelFont; - bool m_labelShadow; - TQColor m_shColor; - bool m_fitToBox; +enum PixmapStyle { + PIXMAP_STYLE_NORMAL = 0, + PIXMAP_STYLE_INDICATOR = 1, + PIXMAP_STYLE_CONTEXTMENU = 2 +}; - TQDict<TQPixmap> m_pixmapCache; +class LayoutIconManager { + public: + LayoutIconManager(KxkbConfig *kxkbConfig); + const TQPixmap& find(const TQString& code, int pixmapStyle, const TQString& displayName = TQString::null); - LayoutIcon(); - TQPixmap* createErrorPixmap(); - void dimPixmap(TQPixmap& pixmap); - TQString getCountryFromLayoutName(const TQString& layoutName); + private: + TQPixmap* createErrorPixmap(); + void dimPixmap(TQPixmap& pixmap); + TQString getCountryFromLayoutName(const TQString& layoutName); -public: - static const TQString& ERROR_CODE; + private: + KxkbConfig *m_kxkbConfig; + static const TQString flagTemplate; + bool m_showFlag, m_showLabel, m_bgTransparent, m_labelShadow, m_fitToBox; + TQColor m_bgColor, m_fgColor, m_shColor; + TQFont m_labelFont; - static LayoutIcon& getInstance(); - const TQPixmap& findPixmap(const TQString& code, int pixmapStyle, const TQString& displayName=""); + TQDict<TQPixmap> m_pixmapCache; }; #endif |