1 | /* |
1 | /*----------------------------------------------------------------------* |
2 | * rxvttoolkit.h - provide toolkit-functionality for rxvt. |
2 | * File: rxvttoolkit.h - provide toolkit-functionality for rxvt. |
|
|
3 | *----------------------------------------------------------------------* |
3 | */ |
4 | * |
|
|
5 | * All portions of code are copyright by their respective author/s. |
|
|
6 | * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com> |
|
|
7 | * |
|
|
8 | * This program is free software; you can redistribute it and/or modify |
|
|
9 | * it under the terms of the GNU General Public License as published by |
|
|
10 | * the Free Software Foundation; either version 2 of the License, or |
|
|
11 | * (at your option) any later version. |
|
|
12 | * |
|
|
13 | * This program is distributed in the hope that it will be useful, |
|
|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
16 | * GNU General Public License for more details. |
|
|
17 | * |
|
|
18 | * You should have received a copy of the GNU General Public License |
|
|
19 | * along with this program; if not, write to the Free Software |
|
|
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|
|
21 | *----------------------------------------------------------------------*/ |
|
|
22 | |
4 | #ifndef RXVT_TOOLKIT_H |
23 | #ifndef RXVT_TOOLKIT_H |
5 | #define RXVT_TOOLKIT_H |
24 | #define RXVT_TOOLKIT_H |
6 | |
25 | |
7 | #include <X11/Xlib.h> |
26 | #include <X11/Xlib.h> |
8 | |
27 | |
… | |
… | |
215 | void put_xim (rxvt_xim *xim); |
234 | void put_xim (rxvt_xim *xim); |
216 | #endif |
235 | #endif |
217 | }; |
236 | }; |
218 | |
237 | |
219 | #ifdef USE_XIM |
238 | #ifdef USE_XIM |
220 | struct im_watcher : watcher, callback0<void> { |
239 | struct im_watcher : watcher, callback<void (void)> { |
221 | template<class O1, class O2> |
240 | template<class O, class M> |
222 | im_watcher (O1 *object, void (O2::*method) ()) |
241 | im_watcher (O object, M method) |
223 | : callback0<void> (object,method) |
242 | : callback<void (void)> (object, method) |
224 | { } |
243 | { } |
225 | |
244 | |
226 | void start (rxvt_display *display) |
245 | void start (rxvt_display *display) |
227 | { |
246 | { |
228 | display->reg (this); |
247 | display->reg (this); |
… | |
… | |
232 | display->unreg (this); |
251 | display->unreg (this); |
233 | } |
252 | } |
234 | }; |
253 | }; |
235 | #endif |
254 | #endif |
236 | |
255 | |
237 | struct xevent_watcher : watcher, callback1<void, XEvent &> { |
256 | struct xevent_watcher : watcher, callback<void (XEvent &)> { |
238 | Window window; |
257 | Window window; |
239 | |
258 | |
240 | template<class O1, class O2> |
259 | template<class O, class M> |
241 | xevent_watcher (O1 *object, void (O2::*method) (XEvent &)) |
260 | xevent_watcher (O object, M method) |
242 | : callback1<void, XEvent &> (object,method) |
261 | : callback<void (XEvent &)> (object, method) |
243 | { } |
262 | { } |
244 | |
263 | |
245 | void start (rxvt_display *display, Window window) |
264 | void start (rxvt_display *display, Window window) |
246 | { |
265 | { |
247 | this->window = window; |
266 | this->window = window; |