… | |
… | |
54 | |
54 | |
55 | rxvt_term *selection_owner; |
55 | rxvt_term *selection_owner; |
56 | |
56 | |
57 | io_manager_vec<xevent_watcher> xw; |
57 | io_manager_vec<xevent_watcher> xw; |
58 | |
58 | |
59 | io_watcher x_watcher; void x_event (io_watcher &w, short revents); |
59 | io_watcher x_ev; void x_cb (io_watcher &w, short revents); |
60 | |
60 | |
61 | refcache<rxvt_xim> xims; |
61 | refcache<rxvt_xim> xims; |
62 | vector<im_watcher *> imw; |
62 | vector<im_watcher *> imw; |
63 | |
63 | |
64 | void im_change_cb (); |
64 | void im_change_cb (); |
… | |
… | |
73 | |
73 | |
74 | rxvt_display (const char *id); |
74 | rxvt_display (const char *id); |
75 | bool init (); |
75 | bool init (); |
76 | ~rxvt_display (); |
76 | ~rxvt_display (); |
77 | |
77 | |
|
|
78 | void flush (); |
|
|
79 | |
78 | void reg (xevent_watcher *w); |
80 | void reg (xevent_watcher *w); |
79 | void unreg (xevent_watcher *w); |
81 | void unreg (xevent_watcher *w); |
80 | void reg (im_watcher *w); |
82 | void reg (im_watcher *w); |
81 | void unreg (im_watcher *w); |
83 | void unreg (im_watcher *w); |
82 | |
84 | |
… | |
… | |
86 | void put_xim (rxvt_xim *xim); |
88 | void put_xim (rxvt_xim *xim); |
87 | }; |
89 | }; |
88 | |
90 | |
89 | struct im_watcher : watcher, callback0<void> { |
91 | struct im_watcher : watcher, callback0<void> { |
90 | template<class O1, class O2> |
92 | template<class O1, class O2> |
91 | im_watcher (O1 *object, void (O2::*method)()) |
93 | im_watcher (O1 *object, void (O2::*method) ()) |
92 | : callback0<void>(object,method) |
94 | : callback0<void> (object,method) |
93 | { } |
95 | { } |
94 | |
96 | |
95 | void start (rxvt_display *display) |
97 | void start (rxvt_display *display) |
96 | { |
98 | { |
97 | display->reg (this); |
99 | display->reg (this); |
… | |
… | |
104 | |
106 | |
105 | struct xevent_watcher : watcher, callback1<void, XEvent &> { |
107 | struct xevent_watcher : watcher, callback1<void, XEvent &> { |
106 | Window window; |
108 | Window window; |
107 | |
109 | |
108 | template<class O1, class O2> |
110 | template<class O1, class O2> |
109 | xevent_watcher (O1 *object, void (O2::*method)(XEvent &)) |
111 | xevent_watcher (O1 *object, void (O2::*method) (XEvent &)) |
110 | : callback1<void, XEvent &>(object,method) |
112 | : callback1<void, XEvent &> (object,method) |
111 | { } |
113 | { } |
112 | |
114 | |
113 | void start (rxvt_display *display, Window window) |
115 | void start (rxvt_display *display, Window window) |
114 | { |
116 | { |
115 | this->window = window; |
117 | this->window = window; |
… | |
… | |
128 | typedef unsigned long Pixel; |
130 | typedef unsigned long Pixel; |
129 | |
131 | |
130 | struct rxvt_color { |
132 | struct rxvt_color { |
131 | #if XFT |
133 | #if XFT |
132 | XftColor c; |
134 | XftColor c; |
133 | operator Pixel() const { return c.pixel; } |
135 | operator Pixel () const { return c.pixel; } |
134 | #else |
136 | #else |
135 | Pixel p; |
137 | Pixel p; |
136 | operator Pixel() const { return p; } |
138 | operator Pixel () const { return p; } |
137 | #endif |
139 | #endif |
138 | |
140 | |
139 | 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); } |
140 | 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); } |
141 | |
143 | |
142 | 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); |
143 | |
145 | |
144 | bool set (rxvt_display *display, Pixel p); |
146 | bool set (rxvt_display *display, Pixel p); |
145 | bool set (rxvt_display *display, const char *name); |
147 | bool set (rxvt_display *display, const char *name); |