… | |
… | |
104 | int depth; |
104 | int depth; |
105 | Visual *visual; |
105 | Visual *visual; |
106 | Colormap cmap; |
106 | Colormap cmap; |
107 | |
107 | |
108 | void set (rxvt_display *disp); |
108 | void set (rxvt_display *disp); |
109 | void set (rxvt_display *disp, int depth); |
109 | void set (rxvt_display *disp, int bitdepth); |
110 | void clear (); |
110 | void clear (); |
111 | }; |
111 | }; |
112 | |
112 | |
113 | struct rxvt_display : refcounted { |
113 | struct rxvt_display : refcounted { |
114 | io_manager_vec<xevent_watcher> xw; |
114 | io_manager_vec<xevent_watcher> xw; |
… | |
… | |
199 | |
199 | |
200 | ///////////////////////////////////////////////////////////////////////////// |
200 | ///////////////////////////////////////////////////////////////////////////// |
201 | |
201 | |
202 | typedef unsigned long Pixel; |
202 | typedef unsigned long Pixel; |
203 | |
203 | |
|
|
204 | struct rxvt_rgba { |
|
|
205 | unsigned short r, g, b, a; |
|
|
206 | |
|
|
207 | enum { MIN_CC = 0x0000, MAX_CC = 0xffff }; |
|
|
208 | |
|
|
209 | rxvt_rgba () |
|
|
210 | { } |
|
|
211 | |
|
|
212 | rxvt_rgba (unsigned short r, unsigned short g, unsigned short b, unsigned short a = MAX_CC) |
|
|
213 | : r(r), g(g), b(b), a(a) |
|
|
214 | { } |
|
|
215 | }; |
|
|
216 | |
204 | struct rxvt_color { |
217 | struct rxvt_color { |
205 | #if XFT |
218 | #if XFT |
206 | XftColor c; |
219 | XftColor c; |
207 | operator Pixel () const { return c.pixel; } |
220 | operator Pixel () const { return c.pixel; } |
208 | #else |
221 | #else |
… | |
… | |
211 | #endif |
224 | #endif |
212 | |
225 | |
213 | bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); } |
226 | 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); } |
227 | bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); } |
215 | |
228 | |
216 | void get (rxvt_screen *screen, unsigned short &cr, unsigned short &cg, unsigned short &cb); |
229 | void get (rxvt_screen *screen, rxvt_rgba &rgba); |
217 | |
230 | |
218 | bool set (rxvt_screen *screen, Pixel p); |
|
|
219 | bool set (rxvt_screen *screen, const char *name); |
231 | bool set (rxvt_screen *screen, const char *name); |
220 | bool set (rxvt_screen *screen, unsigned short cr, unsigned short cg, unsigned short cb); |
232 | bool set (rxvt_screen *screen, rxvt_rgba rgba); |
221 | |
233 | |
222 | rxvt_color fade (rxvt_screen *screen, int percent); // fades to black |
234 | rxvt_color fade (rxvt_screen *screen, int percent); // fades to black |
223 | rxvt_color fade (rxvt_screen *screen, int percent, rxvt_color &fadeto); |
235 | rxvt_color fade (rxvt_screen *screen, int percent, rxvt_color &fadeto); |
224 | |
236 | |
225 | void free (rxvt_screen *screen); |
237 | void free (rxvt_screen *screen); |