… | |
… | |
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; |
… | |
… | |
96 | } |
105 | } |
97 | }; |
106 | }; |
98 | |
107 | |
99 | ///////////////////////////////////////////////////////////////////////////// |
108 | ///////////////////////////////////////////////////////////////////////////// |
100 | |
109 | |
|
|
110 | struct rxvt_screen; |
|
|
111 | |
|
|
112 | struct rxvt_drawable { |
|
|
113 | rxvt_screen *screen; |
|
|
114 | Drawable drawable; |
|
|
115 | operator Drawable() { return drawable; } |
|
|
116 | |
|
|
117 | #if XFT |
|
|
118 | XftDraw *xftdrawable; |
|
|
119 | operator XftDraw *(); |
|
|
120 | #endif |
|
|
121 | |
|
|
122 | rxvt_drawable (rxvt_screen *screen, Drawable drawable) |
|
|
123 | : screen(screen), |
|
|
124 | #if XFT |
|
|
125 | xftdrawable(0), |
|
|
126 | #endif |
|
|
127 | drawable(drawable) |
|
|
128 | { } |
|
|
129 | |
|
|
130 | #if XFT |
|
|
131 | ~rxvt_drawable (); |
|
|
132 | #endif |
|
|
133 | }; |
|
|
134 | |
|
|
135 | ///////////////////////////////////////////////////////////////////////////// |
|
|
136 | |
101 | #ifdef USE_XIM |
137 | #ifdef USE_XIM |
102 | struct rxvt_xim : refcounted { |
138 | struct rxvt_xim : refcounted { |
103 | void destroy (); |
139 | void destroy (); |
104 | rxvt_display *display; |
140 | rxvt_display *display; |
105 | |
141 | |
… | |
… | |
112 | }; |
148 | }; |
113 | #endif |
149 | #endif |
114 | |
150 | |
115 | struct rxvt_screen { |
151 | struct rxvt_screen { |
116 | rxvt_display *display; |
152 | rxvt_display *display; |
117 | Display *xdisp; |
153 | Display *dpy; |
118 | int depth; |
154 | int depth; |
119 | Visual *visual; |
155 | Visual *visual; |
120 | Colormap cmap; |
156 | Colormap cmap; |
121 | |
157 | |
|
|
158 | #if XFT |
|
|
159 | // scratch pixmap |
|
|
160 | rxvt_drawable *scratch_area; |
|
|
161 | int scratch_w, scratch_h; |
|
|
162 | |
|
|
163 | rxvt_drawable &scratch_drawable (int w, int h); |
|
|
164 | |
|
|
165 | rxvt_screen (); |
|
|
166 | #endif |
|
|
167 | |
122 | void set (rxvt_display *disp); |
168 | void set (rxvt_display *disp); |
123 | void set (rxvt_display *disp, int bitdepth); |
169 | void set (rxvt_display *disp, int bitdepth); |
124 | void clear (); |
170 | void clear (); |
125 | }; |
171 | }; |
126 | |
172 | |
… | |
… | |
136 | void im_change_cb (); |
182 | void im_change_cb (); |
137 | void im_change_check (); |
183 | void im_change_check (); |
138 | #endif |
184 | #endif |
139 | |
185 | |
140 | //public |
186 | //public |
141 | Display *display; |
187 | Display *dpy; |
142 | int screen; |
188 | int screen; |
143 | Window root; |
189 | Window root; |
144 | rxvt_term *selection_owner; |
190 | rxvt_term *selection_owner; |
145 | Atom xa[NUM_XA]; |
191 | Atom xa[NUM_XA]; |
146 | #ifndef NO_SLOW_LINK_SUPPORT |
|
|
147 | bool is_local; |
192 | bool is_local; |
148 | #endif |
|
|
149 | #ifdef POINTER_BLANK |
193 | #ifdef POINTER_BLANK |
150 | Cursor blank_cursor; |
194 | Cursor blank_cursor; |
151 | #endif |
195 | #endif |
152 | |
196 | |
153 | rxvt_display (const char *id); |
197 | rxvt_display (const char *id); |
154 | XrmDatabase get_resources (); |
198 | XrmDatabase get_resources (bool refresh); |
155 | bool ref_init (); |
199 | bool ref_init (); |
156 | void ref_next (); |
200 | void ref_next (); |
157 | ~rxvt_display (); |
201 | ~rxvt_display (); |
158 | |
202 | |
159 | void flush (); |
203 | void flush (); |
… | |
… | |
213 | |
257 | |
214 | ///////////////////////////////////////////////////////////////////////////// |
258 | ///////////////////////////////////////////////////////////////////////////// |
215 | |
259 | |
216 | typedef unsigned long Pixel; |
260 | typedef unsigned long Pixel; |
217 | |
261 | |
218 | struct rxvt_rgba { |
262 | struct rgba { |
219 | unsigned short r, g, b, a; |
263 | unsigned short r, g, b, a; |
220 | |
264 | |
221 | enum { MIN_CC = 0x0000, MAX_CC = 0xffff }; |
265 | enum { MIN_CC = 0x0000, MAX_CC = 0xffff }; |
222 | |
266 | |
223 | rxvt_rgba () |
267 | rgba () |
224 | { } |
268 | { } |
225 | |
269 | |
226 | rxvt_rgba (unsigned short r, unsigned short g, unsigned short b, unsigned short a = MAX_CC) |
270 | rgba (unsigned short r, unsigned short g, unsigned short b, unsigned short a = MAX_CC) |
227 | : r(r), g(g), b(b), a(a) |
271 | : r(r), g(g), b(b), a(a) |
228 | { } |
272 | { } |
229 | }; |
273 | }; |
230 | |
274 | |
231 | struct rxvt_color { |
275 | struct rxvt_color { |
232 | #if XFT |
276 | #if XFT |
233 | XftColor c; |
277 | XftColor c; |
|
|
278 | #else |
|
|
279 | XColor c; |
|
|
280 | #endif |
|
|
281 | |
234 | operator Pixel () const { return c.pixel; } |
282 | operator Pixel () const { return c.pixel; } |
235 | #else |
|
|
236 | Pixel p; |
|
|
237 | operator Pixel () const { return p; } |
|
|
238 | #endif |
|
|
239 | |
283 | |
240 | bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); } |
284 | 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); } |
285 | bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); } |
242 | |
286 | |
243 | void get (rxvt_screen *screen, rxvt_rgba &rgba); |
287 | bool alloc (rxvt_screen *screen, const rgba &color); |
|
|
288 | void free (rxvt_screen *screen); |
|
|
289 | |
|
|
290 | void get (rgba &color); |
|
|
291 | void get (XColor &color); |
244 | |
292 | |
245 | bool set (rxvt_screen *screen, const char *name); |
293 | bool set (rxvt_screen *screen, const char *name); |
246 | bool set (rxvt_screen *screen, rxvt_rgba rgba); |
294 | bool set (rxvt_screen *screen, const rgba &color); |
247 | |
295 | |
248 | rxvt_color fade (rxvt_screen *screen, int percent); // fades to black |
296 | 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 | }; |
297 | }; |
253 | |
298 | |
254 | #endif |
299 | #endif |
255 | |
300 | |