… | |
… | |
28 | XA_VT_SELECTION, |
28 | XA_VT_SELECTION, |
29 | XA_INCR, |
29 | XA_INCR, |
30 | XA_WM_PROTOCOLS, |
30 | XA_WM_PROTOCOLS, |
31 | XA_WM_DELETE_WINDOW, |
31 | XA_WM_DELETE_WINDOW, |
32 | XA_CLIPBOARD, |
32 | XA_CLIPBOARD, |
|
|
33 | XA_AVERAGE_WIDTH, |
|
|
34 | XA_WEIGHT_NAME, |
|
|
35 | XA_SLANT, |
|
|
36 | XA_CHARSET_REGISTRY, |
|
|
37 | XA_CHARSET_ENCODING, |
33 | #if ENABLE_FRILLS |
38 | #if ENABLE_FRILLS |
34 | XA_MOTIF_WM_HINTS, |
39 | XA_MOTIF_WM_HINTS, |
35 | #endif |
40 | #endif |
36 | #if ENABLE_EWMH |
41 | #if ENABLE_EWMH |
37 | XA_NET_WM_PID, |
42 | XA_NET_WM_PID, |
… | |
… | |
48 | XA_ESETROOT_PMAP_ID, |
53 | XA_ESETROOT_PMAP_ID, |
49 | #endif |
54 | #endif |
50 | #if ENABLE_XEMBED |
55 | #if ENABLE_XEMBED |
51 | XA_XEMBED, |
56 | XA_XEMBED, |
52 | XA_XEMBED_INFO, |
57 | XA_XEMBED_INFO, |
|
|
58 | #endif |
|
|
59 | #if !ENABLE_MINIMAL |
|
|
60 | // these are usually allocated by other subsystens, but we do it |
|
|
61 | // here to avoid a server roundtrip. |
|
|
62 | XA_SCREEN_RESOURCES, |
|
|
63 | XA_XDCCC_LINEAR_RGB_CORRECTION, |
|
|
64 | XA_XDCCC_LINEAR_RGB_MATRICES, |
|
|
65 | XA_WM_COLORMAP_WINDOWS, |
|
|
66 | XA_WM_STATE, |
53 | #endif |
67 | #endif |
54 | NUM_XA |
68 | NUM_XA |
55 | }; |
69 | }; |
56 | |
70 | |
57 | struct rxvt_term; |
71 | struct rxvt_term; |
… | |
… | |
104 | int depth; |
118 | int depth; |
105 | Visual *visual; |
119 | Visual *visual; |
106 | Colormap cmap; |
120 | Colormap cmap; |
107 | |
121 | |
108 | void set (rxvt_display *disp); |
122 | void set (rxvt_display *disp); |
109 | void set (rxvt_display *disp, int depth); |
123 | void set (rxvt_display *disp, int bitdepth); |
110 | void clear (); |
124 | void clear (); |
111 | }; |
125 | }; |
112 | |
126 | |
113 | struct rxvt_display : refcounted { |
127 | struct rxvt_display : refcounted { |
114 | io_manager_vec<xevent_watcher> xw; |
128 | io_manager_vec<xevent_watcher> xw; |
… | |
… | |
199 | |
213 | |
200 | ///////////////////////////////////////////////////////////////////////////// |
214 | ///////////////////////////////////////////////////////////////////////////// |
201 | |
215 | |
202 | typedef unsigned long Pixel; |
216 | typedef unsigned long Pixel; |
203 | |
217 | |
|
|
218 | struct rxvt_rgba { |
|
|
219 | unsigned short r, g, b, a; |
|
|
220 | |
|
|
221 | enum { MIN_CC = 0x0000, MAX_CC = 0xffff }; |
|
|
222 | |
|
|
223 | rxvt_rgba () |
|
|
224 | { } |
|
|
225 | |
|
|
226 | rxvt_rgba (unsigned short r, unsigned short g, unsigned short b, unsigned short a = MAX_CC) |
|
|
227 | : r(r), g(g), b(b), a(a) |
|
|
228 | { } |
|
|
229 | }; |
|
|
230 | |
204 | struct rxvt_color { |
231 | struct rxvt_color { |
205 | #if XFT |
232 | #if XFT |
206 | XftColor c; |
233 | XftColor c; |
207 | operator Pixel () const { return c.pixel; } |
234 | operator Pixel () const { return c.pixel; } |
208 | #else |
235 | #else |
… | |
… | |
211 | #endif |
238 | #endif |
212 | |
239 | |
213 | bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); } |
240 | bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); } |
214 | 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); } |
215 | |
242 | |
216 | void get (rxvt_screen *screen, unsigned short &cr, unsigned short &cg, unsigned short &cb); |
243 | void get (rxvt_screen *screen, rxvt_rgba &rgba); |
217 | |
244 | |
218 | bool set (rxvt_screen *screen, Pixel p); |
|
|
219 | bool set (rxvt_screen *screen, const char *name); |
245 | bool set (rxvt_screen *screen, const char *name); |
220 | bool set (rxvt_screen *screen, unsigned short cr, unsigned short cg, unsigned short cb); |
246 | bool set (rxvt_screen *screen, rxvt_rgba rgba); |
221 | |
247 | |
222 | rxvt_color fade (rxvt_screen *screen, int percent); // fades to black |
248 | rxvt_color fade (rxvt_screen *screen, int percent); // fades to black |
223 | rxvt_color fade (rxvt_screen *screen, int percent, rxvt_color &fadeto); |
249 | rxvt_color fade (rxvt_screen *screen, int percent, rxvt_color &fadeto); |
224 | |
250 | |
225 | void free (rxvt_screen *screen); |
251 | void free (rxvt_screen *screen); |