… | |
… | |
96 | bool ref_init (); |
96 | bool ref_init (); |
97 | ~rxvt_xim (); |
97 | ~rxvt_xim (); |
98 | }; |
98 | }; |
99 | #endif |
99 | #endif |
100 | |
100 | |
|
|
101 | struct rxvt_screen { |
|
|
102 | rxvt_display *display; |
|
|
103 | Display *xdisp; |
|
|
104 | int depth; |
|
|
105 | Visual *visual; |
|
|
106 | Colormap cmap; |
|
|
107 | |
|
|
108 | void set (rxvt_display *disp); |
|
|
109 | void set (rxvt_display *disp, int bitdepth); |
|
|
110 | void clear (); |
|
|
111 | }; |
|
|
112 | |
101 | struct rxvt_display : refcounted { |
113 | struct rxvt_display : refcounted { |
102 | io_manager_vec<xevent_watcher> xw; |
114 | io_manager_vec<xevent_watcher> xw; |
103 | |
115 | |
104 | io_watcher x_ev; void x_cb (io_watcher &w, short revents); |
116 | io_watcher x_ev; void x_cb (io_watcher &w, short revents); |
105 | |
117 | |
… | |
… | |
111 | void im_change_check (); |
123 | void im_change_check (); |
112 | #endif |
124 | #endif |
113 | |
125 | |
114 | //public |
126 | //public |
115 | Display *display; |
127 | Display *display; |
116 | int depth; |
|
|
117 | int screen; |
128 | int screen; |
118 | Visual *visual; |
|
|
119 | Colormap cmap; |
|
|
120 | Window root; |
129 | Window root; |
121 | rxvt_term *selection_owner; |
130 | rxvt_term *selection_owner; |
122 | Atom xa[NUM_XA]; |
131 | Atom xa[NUM_XA]; |
123 | #ifndef NO_SLOW_LINK_SUPPORT |
132 | #ifndef NO_SLOW_LINK_SUPPORT |
124 | bool is_local; |
133 | bool is_local; |
… | |
… | |
189 | extern refcache<rxvt_display> displays; |
198 | extern refcache<rxvt_display> displays; |
190 | |
199 | |
191 | ///////////////////////////////////////////////////////////////////////////// |
200 | ///////////////////////////////////////////////////////////////////////////// |
192 | |
201 | |
193 | typedef unsigned long Pixel; |
202 | typedef unsigned long Pixel; |
|
|
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 | }; |
194 | |
216 | |
195 | struct rxvt_color { |
217 | struct rxvt_color { |
196 | #if XFT |
218 | #if XFT |
197 | XftColor c; |
219 | XftColor c; |
198 | operator Pixel () const { return c.pixel; } |
220 | operator Pixel () const { return c.pixel; } |
… | |
… | |
202 | #endif |
224 | #endif |
203 | |
225 | |
204 | 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); } |
205 | 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); } |
206 | |
228 | |
207 | void get (rxvt_display *display, unsigned short &cr, unsigned short &cg, unsigned short &cb); |
229 | void get (rxvt_screen *screen, rxvt_rgba &rgba); |
208 | |
230 | |
209 | bool set (rxvt_display *display, Pixel p); |
|
|
210 | bool set (rxvt_display *display, const char *name); |
231 | bool set (rxvt_screen *screen, const char *name); |
211 | bool set (rxvt_display *display, unsigned short cr, unsigned short cg, unsigned short cb); |
232 | bool set (rxvt_screen *screen, rxvt_rgba rgba); |
212 | |
233 | |
213 | rxvt_color fade (rxvt_display *, int percent); // fades to black |
234 | rxvt_color fade (rxvt_screen *screen, int percent); // fades to black |
214 | rxvt_color fade (rxvt_display *, int percent, rxvt_color &fadeto); |
235 | rxvt_color fade (rxvt_screen *screen, int percent, rxvt_color &fadeto); |
215 | |
236 | |
216 | void free (rxvt_display *display); |
237 | void free (rxvt_screen *screen); |
217 | }; |
238 | }; |
218 | |
239 | |
219 | #endif |
240 | #endif |
220 | |
241 | |