… | |
… | |
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, |
… | |
… | |
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, |
53 | #endif |
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, |
|
|
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 |
|
|
76 | #endif |
54 | NUM_XA |
77 | NUM_XA |
55 | }; |
78 | }; |
56 | |
79 | |
57 | struct rxvt_term; |
80 | struct rxvt_term; |
58 | struct rxvt_display; |
81 | struct rxvt_display; |
… | |
… | |
98 | }; |
121 | }; |
99 | #endif |
122 | #endif |
100 | |
123 | |
101 | struct rxvt_screen { |
124 | struct rxvt_screen { |
102 | rxvt_display *display; |
125 | rxvt_display *display; |
103 | Display *xdisp; |
126 | Display *dpy; |
104 | int depth; |
127 | int depth; |
105 | Visual *visual; |
128 | Visual *visual; |
106 | Colormap cmap; |
129 | Colormap cmap; |
107 | |
130 | |
108 | void set (rxvt_display *disp); |
131 | void set (rxvt_display *disp); |
… | |
… | |
122 | void im_change_cb (); |
145 | void im_change_cb (); |
123 | void im_change_check (); |
146 | void im_change_check (); |
124 | #endif |
147 | #endif |
125 | |
148 | |
126 | //public |
149 | //public |
127 | Display *display; |
150 | Display *dpy; |
128 | int screen; |
151 | int screen; |
129 | Window root; |
152 | Window root; |
130 | rxvt_term *selection_owner; |
153 | rxvt_term *selection_owner; |
131 | Atom xa[NUM_XA]; |
154 | Atom xa[NUM_XA]; |
132 | #ifndef NO_SLOW_LINK_SUPPORT |
155 | #ifndef NO_SLOW_LINK_SUPPORT |
… | |
… | |
135 | #ifdef POINTER_BLANK |
158 | #ifdef POINTER_BLANK |
136 | Cursor blank_cursor; |
159 | Cursor blank_cursor; |
137 | #endif |
160 | #endif |
138 | |
161 | |
139 | rxvt_display (const char *id); |
162 | rxvt_display (const char *id); |
140 | XrmDatabase get_resources (); |
163 | XrmDatabase get_resources (bool refresh); |
141 | bool ref_init (); |
164 | bool ref_init (); |
142 | void ref_next (); |
165 | void ref_next (); |
143 | ~rxvt_display (); |
166 | ~rxvt_display (); |
144 | |
167 | |
145 | void flush (); |
168 | void flush (); |
… | |
… | |
199 | |
222 | |
200 | ///////////////////////////////////////////////////////////////////////////// |
223 | ///////////////////////////////////////////////////////////////////////////// |
201 | |
224 | |
202 | typedef unsigned long Pixel; |
225 | typedef unsigned long Pixel; |
203 | |
226 | |
204 | struct rxvt_rgba { |
227 | struct rgba { |
205 | unsigned short r, g, b, a; |
228 | unsigned short r, g, b, a; |
206 | |
229 | |
207 | enum { MIN_CC = 0x0000, MAX_CC = 0xffff }; |
230 | enum { MIN_CC = 0x0000, MAX_CC = 0xffff }; |
208 | |
231 | |
209 | rxvt_rgba () |
232 | rgba () |
210 | { } |
233 | { } |
211 | |
234 | |
212 | 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) |
213 | : r(r), g(g), b(b), a(a) |
236 | : r(r), g(g), b(b), a(a) |
214 | { } |
237 | { } |
215 | }; |
238 | }; |
216 | |
239 | |
217 | struct rxvt_color { |
240 | struct rxvt_color { |
218 | #if XFT |
241 | #if XFT |
219 | XftColor c; |
242 | XftColor c; |
|
|
243 | #else |
|
|
244 | XColor c; |
|
|
245 | #endif |
|
|
246 | |
220 | operator Pixel () const { return c.pixel; } |
247 | operator Pixel () const { return c.pixel; } |
221 | #else |
|
|
222 | Pixel p; |
|
|
223 | operator Pixel () const { return p; } |
|
|
224 | #endif |
|
|
225 | |
248 | |
226 | 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); } |
227 | 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); } |
228 | |
251 | |
229 | 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); |
|
|
256 | void get (XColor &color); |
230 | |
257 | |
231 | bool set (rxvt_screen *screen, const char *name); |
258 | bool set (rxvt_screen *screen, const char *name); |
232 | bool set (rxvt_screen *screen, rxvt_rgba rgba); |
259 | bool set (rxvt_screen *screen, const rgba &color); |
233 | |
260 | |
234 | rxvt_color fade (rxvt_screen *screen, int percent); // fades to black |
261 | void fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to = rgba (0, 0, 0)); |
235 | rxvt_color fade (rxvt_screen *screen, int percent, rxvt_color &fadeto); |
|
|
236 | |
|
|
237 | void free (rxvt_screen *screen); |
|
|
238 | }; |
262 | }; |
239 | |
263 | |
240 | #endif |
264 | #endif |
241 | |
265 | |