diff options
Diffstat (limited to 'src/FbTk/Color.hh')
-rw-r--r-- | src/FbTk/Color.hh | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/FbTk/Color.hh b/src/FbTk/Color.hh index 588fcc1..ed36463 100644 --- a/src/FbTk/Color.hh +++ b/src/FbTk/Color.hh | |||
@@ -25,6 +25,11 @@ | |||
25 | #ifndef FBTK_COLOR_HH | 25 | #ifndef FBTK_COLOR_HH |
26 | #define FBTK_COLOR_HH | 26 | #define FBTK_COLOR_HH |
27 | 27 | ||
28 | #include <config.h> | ||
29 | #if HAVE_XRENDER | ||
30 | #include <X11/Xft/Xft.h> | ||
31 | #endif | ||
32 | |||
28 | namespace FbTk { | 33 | namespace FbTk { |
29 | 34 | ||
30 | /// Allocates rgb color and pixel value | 35 | /// Allocates rgb color and pixel value |
@@ -34,6 +39,7 @@ public: | |||
34 | explicit Color(unsigned long pixel); | 39 | explicit Color(unsigned long pixel); |
35 | Color(const Color &col_copy); | 40 | Color(const Color &col_copy); |
36 | Color(unsigned short red, unsigned short green, unsigned short blue, int screen); | 41 | Color(unsigned short red, unsigned short green, unsigned short blue, int screen); |
42 | Color(unsigned short red, unsigned short green, unsigned short blue, unsigned short alpha, int screen); | ||
37 | /// parses and sets rgb and pixel value from a string | 43 | /// parses and sets rgb and pixel value from a string |
38 | Color(const char *color_string, int screen); | 44 | Color(const char *color_string, int screen); |
39 | ~Color(); | 45 | ~Color(); |
@@ -49,6 +55,7 @@ public: | |||
49 | unsigned short red() const { return m_red; } | 55 | unsigned short red() const { return m_red; } |
50 | unsigned short green() const { return m_green; } | 56 | unsigned short green() const { return m_green; } |
51 | unsigned short blue() const { return m_blue; } | 57 | unsigned short blue() const { return m_blue; } |
58 | unsigned short alpha() const { return m_alpha; } | ||
52 | unsigned long pixel() const { return m_pixel; } | 59 | unsigned long pixel() const { return m_pixel; } |
53 | 60 | ||
54 | /// @return true if the color name in color_string is resolved, else false | 61 | /// @return true if the color name in color_string is resolved, else false |
@@ -58,12 +65,17 @@ private: | |||
58 | void free(); | 65 | void free(); |
59 | void copy(const Color &col); | 66 | void copy(const Color &col); |
60 | void allocate(unsigned short red, unsigned short green, | 67 | void allocate(unsigned short red, unsigned short green, |
61 | unsigned short blue, int screen); | 68 | unsigned short blue, unsigned short alpha, |
69 | int screen); | ||
62 | void setAllocated(bool a) { m_allocated = a; } | 70 | void setAllocated(bool a) { m_allocated = a; } |
63 | void setRGB(unsigned short red, unsigned short green, unsigned short blue); | 71 | void setRGB(unsigned short red, unsigned short green, unsigned short blue, |
72 | unsigned short alpha = 0); | ||
64 | 73 | ||
65 | 74 | ||
66 | unsigned short m_red, m_green, m_blue; | 75 | unsigned short m_red, m_green, m_blue, m_alpha; |
76 | #if HAVE_XRENDER | ||
77 | XftColor m_xftcolor; | ||
78 | #endif | ||
67 | unsigned long m_pixel; | 79 | unsigned long m_pixel; |
68 | bool m_allocated; | 80 | bool m_allocated; |
69 | int m_screen; | 81 | int m_screen; |