… | |
… | |
15 | #include "rxvtlib.h" |
15 | #include "rxvtlib.h" |
16 | #include "rxvtutil.h" |
16 | #include "rxvtutil.h" |
17 | |
17 | |
18 | #include "callback.h" |
18 | #include "callback.h" |
19 | |
19 | |
|
|
20 | // see rxvttoolkit.C:xa_names, which must be kept in sync |
|
|
21 | enum { |
|
|
22 | XA_TEXT, |
|
|
23 | XA_COMPOUND_TEXT, |
|
|
24 | XA_UTF8_STRING, |
|
|
25 | XA_MULTIPLE, |
|
|
26 | XA_TARGETS, |
|
|
27 | XA_TIMESTAMP, |
|
|
28 | XA_VT_SELECTION, |
|
|
29 | XA_INCR, |
|
|
30 | XA_WM_PROTOCOLS, |
|
|
31 | XA_WM_DELETE_WINDOW, |
|
|
32 | XA_CLIPBOARD, |
|
|
33 | #if ENABLE_FRILLS |
|
|
34 | XA_MOTIF_WM_HINTS, |
|
|
35 | #endif |
|
|
36 | #if ENABLE_EWMH |
|
|
37 | XA_NET_WM_PID, |
|
|
38 | XA_NET_WM_NAME, |
|
|
39 | XA_NET_WM_ICON_NAME, |
|
|
40 | XA_NET_WM_PING, |
|
|
41 | #endif |
|
|
42 | #if USE_XIM |
|
|
43 | XA_WM_LOCALE_NAME, |
|
|
44 | XA_XIM_SERVERS, |
|
|
45 | #endif |
|
|
46 | #if TRANSPARENT |
|
|
47 | XA_XROOTPMAP_ID, |
|
|
48 | XA_ESETROOT_PMAP_ID, |
|
|
49 | #endif |
|
|
50 | #if ENABLE_XEMBED |
|
|
51 | XA_XEMBED, |
|
|
52 | XA_XEMBED_INFO, |
|
|
53 | #endif |
|
|
54 | NUM_XA |
|
|
55 | }; |
|
|
56 | |
20 | struct rxvt_term; |
57 | struct rxvt_term; |
21 | struct rxvt_display; |
58 | struct rxvt_display; |
22 | |
59 | |
23 | struct im_watcher; |
60 | struct im_watcher; |
24 | struct xevent_watcher; |
61 | struct xevent_watcher; |
… | |
… | |
26 | struct refcounted { |
63 | struct refcounted { |
27 | int referenced; |
64 | int referenced; |
28 | char *id; |
65 | char *id; |
29 | |
66 | |
30 | refcounted (const char *id); |
67 | refcounted (const char *id); |
31 | bool init () { return false; } |
68 | bool ref_init () { return false; } |
|
|
69 | void ref_next () { } |
32 | ~refcounted (); |
70 | ~refcounted (); |
33 | }; |
71 | }; |
34 | |
72 | |
35 | template<class T> |
73 | template<class T> |
36 | struct refcache : vector<T *> { |
74 | struct refcache : vector<T *> { |
… | |
… | |
53 | |
91 | |
54 | //public |
92 | //public |
55 | XIM xim; |
93 | XIM xim; |
56 | |
94 | |
57 | rxvt_xim (const char *id) : refcounted (id) { } |
95 | rxvt_xim (const char *id) : refcounted (id) { } |
58 | bool init (); |
96 | bool ref_init (); |
59 | ~rxvt_xim (); |
97 | ~rxvt_xim (); |
60 | }; |
98 | }; |
61 | #endif |
99 | #endif |
62 | |
100 | |
63 | struct rxvt_display : refcounted { |
101 | struct rxvt_display : refcounted { |
64 | Atom xa_xim_servers; |
|
|
65 | |
|
|
66 | io_manager_vec<xevent_watcher> xw; |
102 | io_manager_vec<xevent_watcher> xw; |
67 | |
103 | |
68 | io_watcher x_ev; void x_cb (io_watcher &w, short revents); |
104 | io_watcher x_ev; void x_cb (io_watcher &w, short revents); |
69 | |
105 | |
70 | #ifdef USE_XIM |
106 | #ifdef USE_XIM |
… | |
… | |
81 | int screen; |
117 | int screen; |
82 | Visual *visual; |
118 | Visual *visual; |
83 | Colormap cmap; |
119 | Colormap cmap; |
84 | Window root; |
120 | Window root; |
85 | rxvt_term *selection_owner; |
121 | rxvt_term *selection_owner; |
|
|
122 | Atom xa[NUM_XA]; |
86 | #ifndef NO_SLOW_LINK_SUPPORT |
123 | #ifndef NO_SLOW_LINK_SUPPORT |
87 | bool is_local; |
124 | bool is_local; |
88 | #endif |
125 | #endif |
89 | #ifdef POINTER_BLANK |
126 | #ifdef POINTER_BLANK |
90 | Cursor blank_cursor; |
127 | Cursor blank_cursor; |
91 | #endif |
128 | #endif |
92 | |
129 | |
93 | rxvt_display (const char *id); |
130 | rxvt_display (const char *id); |
|
|
131 | XrmDatabase get_resources (); |
94 | bool init (); |
132 | bool ref_init (); |
|
|
133 | void ref_next (); |
95 | ~rxvt_display (); |
134 | ~rxvt_display (); |
96 | |
|
|
97 | operator Display *() const { return display; } |
|
|
98 | |
135 | |
99 | void flush (); |
136 | void flush (); |
100 | Atom atom (const char *name); |
137 | Atom atom (const char *name); |
101 | void set_selection_owner (rxvt_term *owner); |
138 | void set_selection_owner (rxvt_term *owner); |
102 | |
139 | |
… | |
… | |
171 | |
208 | |
172 | bool set (rxvt_display *display, Pixel p); |
209 | bool set (rxvt_display *display, Pixel p); |
173 | bool set (rxvt_display *display, const char *name); |
210 | bool set (rxvt_display *display, const char *name); |
174 | bool set (rxvt_display *display, unsigned short cr, unsigned short cg, unsigned short cb); |
211 | bool set (rxvt_display *display, unsigned short cr, unsigned short cg, unsigned short cb); |
175 | |
212 | |
176 | rxvt_color fade (rxvt_display *, int percent); |
213 | rxvt_color fade (rxvt_display *, int percent); // fades to black |
|
|
214 | rxvt_color fade (rxvt_display *, int percent, rxvt_color &fadeto); |
177 | |
215 | |
178 | void free (rxvt_display *display); |
216 | void free (rxvt_display *display); |
179 | }; |
217 | }; |
180 | |
218 | |
181 | #endif |
219 | #endif |