… | |
… | |
22 | struct refcounted { |
22 | struct refcounted { |
23 | int referenced; |
23 | int referenced; |
24 | char *id; |
24 | char *id; |
25 | |
25 | |
26 | refcounted (const char *id); |
26 | refcounted (const char *id); |
27 | bool init () { } |
27 | bool init () { return false; } |
28 | ~refcounted (); |
28 | ~refcounted (); |
29 | }; |
29 | }; |
30 | |
30 | |
31 | template<class T> |
31 | template<class T> |
32 | struct refcache : vector<T *> { |
32 | struct refcache : vector<T *> { |
… | |
… | |
88 | void put_xim (rxvt_xim *xim); |
88 | void put_xim (rxvt_xim *xim); |
89 | }; |
89 | }; |
90 | |
90 | |
91 | struct im_watcher : watcher, callback0<void> { |
91 | struct im_watcher : watcher, callback0<void> { |
92 | template<class O1, class O2> |
92 | template<class O1, class O2> |
93 | im_watcher (O1 *object, void (O2::*method)()) |
93 | im_watcher (O1 *object, void (O2::*method) ()) |
94 | : callback0<void>(object,method) |
94 | : callback0<void> (object,method) |
95 | { } |
95 | { } |
96 | |
96 | |
97 | void start (rxvt_display *display) |
97 | void start (rxvt_display *display) |
98 | { |
98 | { |
99 | display->reg (this); |
99 | display->reg (this); |
… | |
… | |
106 | |
106 | |
107 | struct xevent_watcher : watcher, callback1<void, XEvent &> { |
107 | struct xevent_watcher : watcher, callback1<void, XEvent &> { |
108 | Window window; |
108 | Window window; |
109 | |
109 | |
110 | template<class O1, class O2> |
110 | template<class O1, class O2> |
111 | xevent_watcher (O1 *object, void (O2::*method)(XEvent &)) |
111 | xevent_watcher (O1 *object, void (O2::*method) (XEvent &)) |
112 | : callback1<void, XEvent &>(object,method) |
112 | : callback1<void, XEvent &> (object,method) |
113 | { } |
113 | { } |
114 | |
114 | |
115 | void start (rxvt_display *display, Window window) |
115 | void start (rxvt_display *display, Window window) |
116 | { |
116 | { |
117 | this->window = window; |
117 | this->window = window; |
… | |
… | |
130 | typedef unsigned long Pixel; |
130 | typedef unsigned long Pixel; |
131 | |
131 | |
132 | struct rxvt_color { |
132 | struct rxvt_color { |
133 | #if XFT |
133 | #if XFT |
134 | XftColor c; |
134 | XftColor c; |
135 | operator Pixel() const { return c.pixel; } |
135 | operator Pixel () const { return c.pixel; } |
136 | #else |
136 | #else |
137 | Pixel p; |
137 | Pixel p; |
138 | operator Pixel() const { return p; } |
138 | operator Pixel () const { return p; } |
139 | #endif |
139 | #endif |
140 | |
140 | |
141 | bool operator == (const rxvt_color &b) const { return Pixel(*this) == Pixel(b); } |
141 | bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); } |
142 | bool operator != (const rxvt_color &b) const { return Pixel(*this) != Pixel(b); } |
142 | bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); } |
143 | |
143 | |
144 | void get (rxvt_display *display, unsigned short &cr, unsigned short &cg, unsigned short &cb); |
144 | void get (rxvt_display *display, unsigned short &cr, unsigned short &cg, unsigned short &cb); |
145 | |
145 | |
146 | bool set (rxvt_display *display, Pixel p); |
146 | bool set (rxvt_display *display, Pixel p); |
147 | bool set (rxvt_display *display, const char *name); |
147 | bool set (rxvt_display *display, const char *name); |