1 |
#ifndef RXVT_COLOR_H |
2 |
#define RXVT_COLOR_H |
3 |
|
4 |
#include <X11/Xlib.h> |
5 |
|
6 |
#if XFT |
7 |
# include <X11/Xft/Xft.h> |
8 |
#endif |
9 |
|
10 |
#include "rxvtlib.h" |
11 |
|
12 |
struct rxvt_vars; |
13 |
|
14 |
typedef unsigned long Pixel; |
15 |
|
16 |
struct rxvt_color { |
17 |
#if XFT |
18 |
XftColor c; |
19 |
operator Pixel() const { return c.pixel; } |
20 |
#else |
21 |
Pixel p; |
22 |
operator Pixel() const { return p; } |
23 |
#endif |
24 |
|
25 |
bool operator == (const rxvt_color &b) const { return Pixel(*this) == Pixel(b); } |
26 |
bool operator != (const rxvt_color &b) const { return Pixel(*this) != Pixel(b); } |
27 |
|
28 |
void get (pR_ unsigned short &cr, unsigned short &cg, unsigned short &cb); |
29 |
|
30 |
bool set (pR_ Pixel p); |
31 |
bool set (pR_ const char *name); |
32 |
bool set (pR_ unsigned short cr, unsigned short cg, unsigned short cb); |
33 |
}; |
34 |
|
35 |
#endif |
36 |
|