… | |
… | |
59 | #if ENABLE_EWMH |
59 | #if ENABLE_EWMH |
60 | XA_NET_WM_PID, |
60 | XA_NET_WM_PID, |
61 | XA_NET_WM_NAME, |
61 | XA_NET_WM_NAME, |
62 | XA_NET_WM_ICON_NAME, |
62 | XA_NET_WM_ICON_NAME, |
63 | XA_NET_WM_PING, |
63 | XA_NET_WM_PING, |
|
|
64 | XA_NET_WM_ICON, |
64 | #endif |
65 | #endif |
65 | #if USE_XIM |
66 | #if USE_XIM |
66 | XA_WM_LOCALE_NAME, |
67 | XA_WM_LOCALE_NAME, |
67 | XA_XIM_SERVERS, |
68 | XA_XIM_SERVERS, |
68 | #endif |
69 | #endif |
… | |
… | |
73 | #if ENABLE_XEMBED |
74 | #if ENABLE_XEMBED |
74 | XA_XEMBED, |
75 | XA_XEMBED, |
75 | XA_XEMBED_INFO, |
76 | XA_XEMBED_INFO, |
76 | #endif |
77 | #endif |
77 | #if !ENABLE_MINIMAL |
78 | #if !ENABLE_MINIMAL |
78 | // these are usually allocated by other subsystens, but we do it |
79 | // these are usually allocated by other subsystems, but we do it |
79 | // here to avoid a server roundtrip. |
80 | // here to avoid a server roundtrip. |
80 | XA_SCREEN_RESOURCES, |
81 | XA_SCREEN_RESOURCES, |
81 | XA_XDCCC_LINEAR_RGB_CORRECTION, |
82 | XA_XDCCC_LINEAR_RGB_CORRECTION, |
82 | XA_XDCCC_LINEAR_RGB_MATRICES, |
83 | XA_XDCCC_LINEAR_RGB_MATRICES, |
83 | XA_WM_COLORMAP_WINDOWS, |
84 | XA_WM_COLORMAP_WINDOWS, |
… | |
… | |
234 | //public |
235 | //public |
235 | Display *dpy; |
236 | Display *dpy; |
236 | int screen; |
237 | int screen; |
237 | Window root; |
238 | Window root; |
238 | rxvt_term *selection_owner; |
239 | rxvt_term *selection_owner; |
|
|
240 | rxvt_term *clipboard_owner; |
239 | Atom xa[NUM_XA]; |
241 | Atom xa[NUM_XA]; |
240 | bool is_local; |
242 | bool is_local; |
241 | #ifdef POINTER_BLANK |
243 | #ifdef POINTER_BLANK |
242 | Cursor blank_cursor; |
244 | Cursor blank_cursor; |
243 | #endif |
245 | #endif |
… | |
… | |
252 | { |
254 | { |
253 | flush_ev.start (); |
255 | flush_ev.start (); |
254 | } |
256 | } |
255 | |
257 | |
256 | Atom atom (const char *name); |
258 | Atom atom (const char *name); |
257 | void set_selection_owner (rxvt_term *owner); |
259 | void set_selection_owner (rxvt_term *owner, bool clipboard); |
258 | |
260 | |
259 | void reg (xevent_watcher *w); |
261 | void reg (xevent_watcher *w); |
260 | void unreg (xevent_watcher *w); |
262 | void unreg (xevent_watcher *w); |
261 | |
263 | |
262 | #ifdef USE_XIM |
264 | #ifdef USE_XIM |
… | |
… | |
267 | void put_xim (rxvt_xim *xim); |
269 | void put_xim (rxvt_xim *xim); |
268 | #endif |
270 | #endif |
269 | }; |
271 | }; |
270 | |
272 | |
271 | #ifdef USE_XIM |
273 | #ifdef USE_XIM |
272 | struct im_watcher : rxvt_watcher, callback<void (void)> { |
274 | struct im_watcher : rxvt_watcher, callback<void (void)> |
|
|
275 | { |
273 | void start (rxvt_display *display) |
276 | void start (rxvt_display *display) |
274 | { |
277 | { |
275 | display->reg (this); |
278 | display->reg (this); |
276 | } |
279 | } |
277 | |
280 | |
… | |
… | |
329 | operator Pixel () const { return c.pixel; } |
332 | operator Pixel () const { return c.pixel; } |
330 | |
333 | |
331 | 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); } |
332 | 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); } |
333 | |
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 | |
334 | bool alloc (rxvt_screen *screen, const rgba &color); |
346 | bool alloc (rxvt_screen *screen, const rgba &color); |
335 | void free (rxvt_screen *screen); |
347 | void free (rxvt_screen *screen); |
336 | |
348 | |
337 | void get (rgba &color); |
349 | void get (rgba &color); |
338 | void get (XColor &color); |
350 | void get (XColor &color); |
… | |
… | |
341 | bool set (rxvt_screen *screen, const rgba &color); |
353 | bool set (rxvt_screen *screen, const rgba &color); |
342 | |
354 | |
343 | void fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to = rgba (0, 0, 0)); |
355 | void fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to = rgba (0, 0, 0)); |
344 | }; |
356 | }; |
345 | |
357 | |
346 | #if TRACE_PIXMAPS |
|
|
347 | Pixmap trace_XCreatePixmap (const char *file, int line, Display *dpy, Window r, unsigned int w, unsigned int h, unsigned int d); |
|
|
348 | void trace_XFreePixmap (const char *file, int line, Display *dpy, Pixmap p); |
|
|
349 | |
|
|
350 | # define XCreatePixmap(dpy,r,w,h,d) trace_XCreatePixmap (__FILE__,__LINE__,dpy,r,w,h,d) |
|
|
351 | # define XFreePixmap(dpy,p) trace_XFreePixmap (__FILE__,__LINE__,dpy,p) |
|
|
352 | #endif |
358 | #endif |
353 | |
359 | |
354 | #endif |
|
|
355 | |
|
|