1 | /*--------------------------------*-C-*---------------------------------* |
1 | /*----------------------------------------------------------------------* |
2 | * File: rxvttoolkit.h - provide toolkit-functionality for rxvt. |
2 | * File: rxvttoolkit.h - provide toolkit-functionality for rxvt. |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * |
4 | * |
5 | * All portions of code are copyright by their respective author/s. |
5 | * All portions of code are copyright by their respective author/s. |
6 | * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com> |
6 | * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com> |
… | |
… | |
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 |
70 | #if TRANSPARENT |
70 | #if ENABLE_TRANSPARENCY |
71 | XA_XROOTPMAP_ID, |
71 | XA_XROOTPMAP_ID, |
72 | XA_ESETROOT_PMAP_ID, |
72 | XA_ESETROOT_PMAP_ID, |
73 | #endif |
73 | #endif |
74 | #if ENABLE_XEMBED |
74 | #if ENABLE_XEMBED |
75 | XA_XEMBED, |
75 | XA_XEMBED, |
… | |
… | |
183 | |
183 | |
184 | rxvt_screen (); |
184 | rxvt_screen (); |
185 | #endif |
185 | #endif |
186 | |
186 | |
187 | void set (rxvt_display *disp); |
187 | void set (rxvt_display *disp); |
188 | void set (rxvt_display *disp, int bitdepth); |
188 | void select_visual (int bitdepth); |
189 | void clear (); |
189 | void clear (); |
190 | }; |
190 | }; |
|
|
191 | |
|
|
192 | #ifdef HAVE_AFTERIMAGE |
|
|
193 | struct ASVisual; |
|
|
194 | #endif |
191 | |
195 | |
192 | struct rxvt_display : refcounted { |
196 | struct rxvt_display : refcounted { |
193 | io_manager_vec<xevent_watcher> xw; |
197 | io_manager_vec<xevent_watcher> xw; |
194 | |
198 | |
195 | io_watcher x_ev; void x_cb (io_watcher &w, short revents); |
199 | io_watcher x_ev; void x_cb (io_watcher &w, short revents); |
… | |
… | |
204 | |
208 | |
205 | //public |
209 | //public |
206 | Display *dpy; |
210 | Display *dpy; |
207 | int screen; |
211 | int screen; |
208 | Window root; |
212 | Window root; |
|
|
213 | #ifdef HAVE_AFTERIMAGE |
|
|
214 | struct ASVisual *asv; |
|
|
215 | #endif |
209 | rxvt_term *selection_owner; |
216 | rxvt_term *selection_owner; |
210 | Atom xa[NUM_XA]; |
217 | Atom xa[NUM_XA]; |
211 | bool is_local; |
218 | bool is_local; |
212 | #ifdef POINTER_BLANK |
219 | #ifdef POINTER_BLANK |
213 | Cursor blank_cursor; |
220 | Cursor blank_cursor; |
… | |
… | |
234 | void put_xim (rxvt_xim *xim); |
241 | void put_xim (rxvt_xim *xim); |
235 | #endif |
242 | #endif |
236 | }; |
243 | }; |
237 | |
244 | |
238 | #ifdef USE_XIM |
245 | #ifdef USE_XIM |
239 | struct im_watcher : watcher, callback0<void> { |
246 | struct im_watcher : watcher, callback<void (void)> { |
240 | template<class O1, class O2> |
247 | template<class O, class M> |
241 | im_watcher (O1 *object, void (O2::*method) ()) |
248 | im_watcher (O object, M method) |
242 | : callback0<void> (object,method) |
249 | : callback<void (void)> (object, method) |
243 | { } |
250 | { } |
244 | |
251 | |
245 | void start (rxvt_display *display) |
252 | void start (rxvt_display *display) |
246 | { |
253 | { |
247 | display->reg (this); |
254 | display->reg (this); |
… | |
… | |
251 | display->unreg (this); |
258 | display->unreg (this); |
252 | } |
259 | } |
253 | }; |
260 | }; |
254 | #endif |
261 | #endif |
255 | |
262 | |
256 | struct xevent_watcher : watcher, callback1<void, XEvent &> { |
263 | struct xevent_watcher : watcher, callback<void (XEvent &)> { |
257 | Window window; |
264 | Window window; |
258 | |
265 | |
259 | template<class O1, class O2> |
266 | template<class O, class M> |
260 | xevent_watcher (O1 *object, void (O2::*method) (XEvent &)) |
267 | xevent_watcher (O object, M method) |
261 | : callback1<void, XEvent &> (object,method) |
268 | : callback<void (XEvent &)> (object, method) |
262 | { } |
269 | { } |
263 | |
270 | |
264 | void start (rxvt_display *display, Window window) |
271 | void start (rxvt_display *display, Window window) |
265 | { |
272 | { |
266 | this->window = window; |
273 | this->window = window; |