… | |
… | |
29 | # include <X11/Xft/Xft.h> |
29 | # include <X11/Xft/Xft.h> |
30 | #endif |
30 | #endif |
31 | |
31 | |
32 | #include "ev_cpp.h" |
32 | #include "ev_cpp.h" |
33 | |
33 | |
34 | #include "rxvtlib.h" |
|
|
35 | #include "rxvtutil.h" |
34 | #include "rxvtutil.h" |
36 | |
35 | |
37 | #include "callback.h" |
36 | #include "callback.h" |
38 | |
37 | |
39 | // see rxvttoolkit.C:xa_names, which must be kept in sync |
38 | // see rxvttoolkit.C:xa_names, which must be kept in sync |
… | |
… | |
60 | #if ENABLE_EWMH |
59 | #if ENABLE_EWMH |
61 | XA_NET_WM_PID, |
60 | XA_NET_WM_PID, |
62 | XA_NET_WM_NAME, |
61 | XA_NET_WM_NAME, |
63 | XA_NET_WM_ICON_NAME, |
62 | XA_NET_WM_ICON_NAME, |
64 | XA_NET_WM_PING, |
63 | XA_NET_WM_PING, |
|
|
64 | XA_NET_WM_ICON, |
65 | #endif |
65 | #endif |
66 | #if USE_XIM |
66 | #if USE_XIM |
67 | XA_WM_LOCALE_NAME, |
67 | XA_WM_LOCALE_NAME, |
68 | XA_XIM_SERVERS, |
68 | XA_XIM_SERVERS, |
69 | #endif |
69 | #endif |
… | |
… | |
74 | #if ENABLE_XEMBED |
74 | #if ENABLE_XEMBED |
75 | XA_XEMBED, |
75 | XA_XEMBED, |
76 | XA_XEMBED_INFO, |
76 | XA_XEMBED_INFO, |
77 | #endif |
77 | #endif |
78 | #if !ENABLE_MINIMAL |
78 | #if !ENABLE_MINIMAL |
79 | // these are usually allocated by other subsystens, but we do it |
79 | // these are usually allocated by other subsystems, but we do it |
80 | // here to avoid a server roundtrip. |
80 | // here to avoid a server roundtrip. |
81 | XA_SCREEN_RESOURCES, |
81 | XA_SCREEN_RESOURCES, |
82 | XA_XDCCC_LINEAR_RGB_CORRECTION, |
82 | XA_XDCCC_LINEAR_RGB_CORRECTION, |
83 | XA_XDCCC_LINEAR_RGB_MATRICES, |
83 | XA_XDCCC_LINEAR_RGB_MATRICES, |
84 | XA_WM_COLORMAP_WINDOWS, |
84 | XA_WM_COLORMAP_WINDOWS, |
… | |
… | |
235 | //public |
235 | //public |
236 | Display *dpy; |
236 | Display *dpy; |
237 | int screen; |
237 | int screen; |
238 | Window root; |
238 | Window root; |
239 | rxvt_term *selection_owner; |
239 | rxvt_term *selection_owner; |
|
|
240 | rxvt_term *clipboard_owner; |
240 | Atom xa[NUM_XA]; |
241 | Atom xa[NUM_XA]; |
241 | bool is_local; |
242 | bool is_local; |
242 | #ifdef POINTER_BLANK |
243 | #ifdef POINTER_BLANK |
243 | Cursor blank_cursor; |
244 | Cursor blank_cursor; |
244 | #endif |
245 | #endif |
… | |
… | |
247 | XrmDatabase get_resources (bool refresh); |
248 | XrmDatabase get_resources (bool refresh); |
248 | bool ref_init (); |
249 | bool ref_init (); |
249 | void ref_next (); |
250 | void ref_next (); |
250 | ~rxvt_display (); |
251 | ~rxvt_display (); |
251 | |
252 | |
252 | void flush (); |
253 | void flush () |
|
|
254 | { |
|
|
255 | flush_ev.start (); |
|
|
256 | } |
|
|
257 | |
253 | Atom atom (const char *name); |
258 | Atom atom (const char *name); |
254 | void set_selection_owner (rxvt_term *owner); |
259 | void set_selection_owner (rxvt_term *owner, bool clipboard); |
255 | |
260 | |
256 | void reg (xevent_watcher *w); |
261 | void reg (xevent_watcher *w); |
257 | void unreg (xevent_watcher *w); |
262 | void unreg (xevent_watcher *w); |
258 | |
263 | |
259 | #ifdef USE_XIM |
264 | #ifdef USE_XIM |
… | |
… | |
264 | void put_xim (rxvt_xim *xim); |
269 | void put_xim (rxvt_xim *xim); |
265 | #endif |
270 | #endif |
266 | }; |
271 | }; |
267 | |
272 | |
268 | #ifdef USE_XIM |
273 | #ifdef USE_XIM |
269 | struct im_watcher : rxvt_watcher, callback<void (void)> { |
274 | struct im_watcher : rxvt_watcher, callback<void (void)> |
|
|
275 | { |
270 | void start (rxvt_display *display) |
276 | void start (rxvt_display *display) |
271 | { |
277 | { |
272 | display->reg (this); |
278 | display->reg (this); |
273 | } |
279 | } |
274 | |
280 | |
… | |
… | |
326 | operator Pixel () const { return c.pixel; } |
332 | operator Pixel () const { return c.pixel; } |
327 | |
333 | |
328 | bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); } |
334 | bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); } |
329 | bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); } |
335 | bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); } |
330 | |
336 | |
|
|
337 | bool is_opaque () const |
|
|
338 | { |
|
|
339 | #if XFT |
|
|
340 | return c.color.alpha == rgba::MAX_CC; |
|
|
341 | #else |
|
|
342 | return 1; |
|
|
343 | #endif |
|
|
344 | } |
|
|
345 | |
331 | bool alloc (rxvt_screen *screen, const rgba &color); |
346 | bool alloc (rxvt_screen *screen, const rgba &color); |
332 | void free (rxvt_screen *screen); |
347 | void free (rxvt_screen *screen); |
333 | |
348 | |
334 | void get (rgba &color); |
349 | void get (rgba &color); |
335 | void get (XColor &color); |
350 | void get (XColor &color); |