… | |
… | |
46 | ~refcache (); |
46 | ~refcache (); |
47 | }; |
47 | }; |
48 | |
48 | |
49 | ///////////////////////////////////////////////////////////////////////////// |
49 | ///////////////////////////////////////////////////////////////////////////// |
50 | |
50 | |
|
|
51 | #ifdef USE_XIM |
51 | struct rxvt_xim : refcounted { |
52 | struct rxvt_xim : refcounted { |
52 | void destroy (); |
53 | void destroy (); |
53 | rxvt_display *display; |
54 | rxvt_display *display; |
54 | |
55 | |
55 | //public |
56 | //public |
… | |
… | |
57 | |
58 | |
58 | rxvt_xim (const char *id) : refcounted (id) { } |
59 | rxvt_xim (const char *id) : refcounted (id) { } |
59 | bool init (); |
60 | bool init (); |
60 | ~rxvt_xim (); |
61 | ~rxvt_xim (); |
61 | }; |
62 | }; |
|
|
63 | #endif |
62 | |
64 | |
63 | struct rxvt_display : refcounted { |
65 | struct rxvt_display : refcounted { |
64 | Atom xa_xim_servers; |
66 | Atom xa_xim_servers; |
65 | |
67 | |
66 | io_manager_vec<xevent_watcher> xw; |
68 | io_manager_vec<xevent_watcher> xw; |
67 | |
69 | |
68 | io_watcher x_ev; void x_cb (io_watcher &w, short revents); |
70 | io_watcher x_ev; void x_cb (io_watcher &w, short revents); |
69 | |
71 | |
|
|
72 | #ifdef USE_XIM |
70 | refcache<rxvt_xim> xims; |
73 | refcache<rxvt_xim> xims; |
71 | vector<im_watcher *> imw; |
74 | vector<im_watcher *> imw; |
72 | |
75 | |
73 | void im_change_cb (); |
76 | void im_change_cb (); |
|
|
77 | #endif |
74 | |
78 | |
75 | //public |
79 | //public |
76 | Display *display; |
80 | Display *display; |
77 | int depth; |
81 | int depth; |
78 | int screen; |
82 | int screen; |
… | |
… | |
85 | bool init (); |
89 | bool init (); |
86 | ~rxvt_display (); |
90 | ~rxvt_display (); |
87 | |
91 | |
88 | void flush (); |
92 | void flush (); |
89 | |
93 | |
|
|
94 | void set_selection_owner (rxvt_term *owner); |
|
|
95 | |
90 | void reg (xevent_watcher *w); |
96 | void reg (xevent_watcher *w); |
91 | void unreg (xevent_watcher *w); |
97 | void unreg (xevent_watcher *w); |
|
|
98 | |
|
|
99 | #ifdef USE_XIM |
92 | void reg (im_watcher *w); |
100 | void reg (im_watcher *w); |
93 | void unreg (im_watcher *w); |
101 | void unreg (im_watcher *w); |
94 | |
102 | |
95 | void set_selection_owner (rxvt_term *owner); |
|
|
96 | |
|
|
97 | rxvt_xim *get_xim (const char *locale, const char *modifiers); |
103 | rxvt_xim *get_xim (const char *locale, const char *modifiers); |
98 | void put_xim (rxvt_xim *xim); |
104 | void put_xim (rxvt_xim *xim); |
|
|
105 | #endif |
99 | |
106 | |
100 | Atom atom (const char *name); |
107 | Atom atom (const char *name); |
101 | }; |
108 | }; |
102 | |
109 | |
|
|
110 | #ifdef USE_XIM |
103 | struct im_watcher : watcher, callback0<void> { |
111 | struct im_watcher : watcher, callback0<void> { |
104 | template<class O1, class O2> |
112 | template<class O1, class O2> |
105 | im_watcher (O1 *object, void (O2::*method) ()) |
113 | im_watcher (O1 *object, void (O2::*method) ()) |
106 | : callback0<void> (object,method) |
114 | : callback0<void> (object,method) |
107 | { } |
115 | { } |
… | |
… | |
113 | void stop (rxvt_display *display) |
121 | void stop (rxvt_display *display) |
114 | { |
122 | { |
115 | display->unreg (this); |
123 | display->unreg (this); |
116 | } |
124 | } |
117 | }; |
125 | }; |
|
|
126 | #endif |
118 | |
127 | |
119 | struct xevent_watcher : watcher, callback1<void, XEvent &> { |
128 | struct xevent_watcher : watcher, callback1<void, XEvent &> { |
120 | Window window; |
129 | Window window; |
121 | |
130 | |
122 | template<class O1, class O2> |
131 | template<class O1, class O2> |