summaryrefslogtreecommitdiffstats
path: root/kxkb/pixmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'kxkb/pixmap.h')
-rw-r--r--kxkb/pixmap.h48
1 files changed, 29 insertions, 19 deletions
diff --git a/kxkb/pixmap.h b/kxkb/pixmap.h
index 7070d91b2..08dee8a87 100644
--- a/kxkb/pixmap.h
+++ b/kxkb/pixmap.h
@@ -6,26 +6,36 @@
#include <tqdict.h>
#include <tqstring.h>
+#include "kxkbconfig.h"
-class LayoutIcon {
-
-private:
- static LayoutIcon* instance;
- static const TQString flagTemplate;
-
- TQDict<TQPixmap> m_pixmapCache;
- TQFont m_labelFont;
-
- LayoutIcon();
- TQPixmap* createErrorPixmap();
- void dimPixmap(TQPixmap& pixmap);
- TQString getCountryFromLayoutName(const TQString& layoutName);
-
- public:
- static const TQString& ERROR_CODE;
-
- static LayoutIcon& getInstance();
- const TQPixmap& findPixmap(const TQString& code, bool showFlag, const TQString& displayName="");
+#define ERROR_CODE "error"
+#define ERROR_LABEL "!"
+
+#define FLAG_MAX_DIM 24
+
+enum PixmapStyle {
+ PIXMAP_STYLE_NORMAL = 0,
+ PIXMAP_STYLE_INDICATOR = 1,
+ PIXMAP_STYLE_CONTEXTMENU = 2
+};
+
+class LayoutIconManager {
+ public:
+ LayoutIconManager(KxkbConfig *kxkbConfig);
+ const TQPixmap& find(const TQString& code, int pixmapStyle, const TQString& displayName = TQString::null);
+
+ private:
+ TQPixmap* createErrorPixmap();
+ TQString getCountryFromLayoutName(const TQString& layoutName);
+
+ private:
+ KxkbConfig *m_kxkbConfig;
+ static const TQString flagTemplate;
+ bool m_showFlag, m_showLabel, m_bgTransparent, m_labelShadow, m_fitToBox, m_dimFlag, m_bevel;
+ TQColor m_bgColor, m_fgColor, m_shColor;
+ TQFont m_labelFont;
+
+ TQDict<TQPixmap> m_pixmapCache;
};
#endif