… | |
… | |
62 | XA_SCREEN_RESOURCES, |
62 | XA_SCREEN_RESOURCES, |
63 | XA_XDCCC_LINEAR_RGB_CORRECTION, |
63 | XA_XDCCC_LINEAR_RGB_CORRECTION, |
64 | XA_XDCCC_LINEAR_RGB_MATRICES, |
64 | XA_XDCCC_LINEAR_RGB_MATRICES, |
65 | XA_WM_COLORMAP_WINDOWS, |
65 | XA_WM_COLORMAP_WINDOWS, |
66 | XA_WM_STATE, |
66 | XA_WM_STATE, |
|
|
67 | XA_cursor, |
|
|
68 | # if USE_XIM |
|
|
69 | // various selection targets used by XIM |
|
|
70 | XA_TRANSPORT, |
|
|
71 | XA_LOCALES, |
|
|
72 | XA__XIM_PROTOCOL, |
|
|
73 | XA__XIM_XCONNECT, |
|
|
74 | XA__XIM_MOREDATA, |
|
|
75 | # endif |
67 | #endif |
76 | #endif |
68 | NUM_XA |
77 | NUM_XA |
69 | }; |
78 | }; |
70 | |
79 | |
71 | struct rxvt_term; |
80 | struct rxvt_term; |
… | |
… | |
213 | |
222 | |
214 | ///////////////////////////////////////////////////////////////////////////// |
223 | ///////////////////////////////////////////////////////////////////////////// |
215 | |
224 | |
216 | typedef unsigned long Pixel; |
225 | typedef unsigned long Pixel; |
217 | |
226 | |
218 | struct rxvt_rgba { |
227 | struct rgba { |
219 | unsigned short r, g, b, a; |
228 | unsigned short r, g, b, a; |
220 | |
229 | |
221 | enum { MIN_CC = 0x0000, MAX_CC = 0xffff }; |
230 | enum { MIN_CC = 0x0000, MAX_CC = 0xffff }; |
222 | |
231 | |
223 | rxvt_rgba () |
232 | rgba () |
224 | { } |
233 | { } |
225 | |
234 | |
226 | rxvt_rgba (unsigned short r, unsigned short g, unsigned short b, unsigned short a = MAX_CC) |
235 | rgba (unsigned short r, unsigned short g, unsigned short b, unsigned short a = MAX_CC) |
227 | : r(r), g(g), b(b), a(a) |
236 | : r(r), g(g), b(b), a(a) |
228 | { } |
237 | { } |
229 | }; |
238 | }; |
230 | |
239 | |
231 | struct rxvt_color { |
240 | struct rxvt_color { |
232 | #if XFT |
241 | #if XFT |
233 | XftColor c; |
242 | XftColor c; |
|
|
243 | #else |
|
|
244 | XColor c; |
|
|
245 | #endif |
|
|
246 | |
234 | operator Pixel () const { return c.pixel; } |
247 | operator Pixel () const { return c.pixel; } |
235 | #else |
|
|
236 | Pixel p; |
|
|
237 | operator Pixel () const { return p; } |
|
|
238 | #endif |
|
|
239 | |
248 | |
240 | bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); } |
249 | bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); } |
241 | bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); } |
250 | bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); } |
242 | |
251 | |
243 | void get (rxvt_screen *screen, rxvt_rgba &rgba); |
252 | bool alloc (rxvt_screen *screen, const rgba &color); |
|
|
253 | void free (rxvt_screen *screen); |
|
|
254 | |
|
|
255 | void get (rgba &color); |
244 | |
256 | |
245 | bool set (rxvt_screen *screen, const char *name); |
257 | bool set (rxvt_screen *screen, const char *name); |
246 | bool set (rxvt_screen *screen, rxvt_rgba rgba); |
258 | bool set (rxvt_screen *screen, const rgba &color); |
247 | |
259 | |
248 | rxvt_color fade (rxvt_screen *screen, int percent); // fades to black |
260 | void fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to = rgba (0, 0, 0)); |
249 | rxvt_color fade (rxvt_screen *screen, int percent, rxvt_color &fadeto); |
|
|
250 | |
|
|
251 | void free (rxvt_screen *screen); |
|
|
252 | }; |
261 | }; |
253 | |
262 | |
254 | #endif |
263 | #endif |
255 | |
264 | |