… | |
… | |
26 | struct refcounted { |
26 | struct refcounted { |
27 | int referenced; |
27 | int referenced; |
28 | char *id; |
28 | char *id; |
29 | |
29 | |
30 | refcounted (const char *id); |
30 | refcounted (const char *id); |
31 | bool init () { return false; } |
31 | bool ref_init () { return false; } |
|
|
32 | void ref_next () { } |
32 | ~refcounted (); |
33 | ~refcounted (); |
33 | }; |
34 | }; |
34 | |
35 | |
35 | template<class T> |
36 | template<class T> |
36 | struct refcache : vector<T *> { |
37 | struct refcache : vector<T *> { |
37 | T *get (const char *id); |
38 | T *get (const char *id); |
38 | void put (T *obj); |
39 | void put (T *obj); |
|
|
40 | void clear (); |
|
|
41 | |
39 | ~refcache (); |
42 | ~refcache () |
|
|
43 | { |
|
|
44 | clear (); |
|
|
45 | } |
40 | }; |
46 | }; |
41 | |
47 | |
42 | ///////////////////////////////////////////////////////////////////////////// |
48 | ///////////////////////////////////////////////////////////////////////////// |
43 | |
49 | |
44 | #ifdef USE_XIM |
50 | #ifdef USE_XIM |
… | |
… | |
48 | |
54 | |
49 | //public |
55 | //public |
50 | XIM xim; |
56 | XIM xim; |
51 | |
57 | |
52 | rxvt_xim (const char *id) : refcounted (id) { } |
58 | rxvt_xim (const char *id) : refcounted (id) { } |
53 | bool init (); |
59 | bool ref_init (); |
54 | ~rxvt_xim (); |
60 | ~rxvt_xim (); |
55 | }; |
61 | }; |
56 | #endif |
62 | #endif |
57 | |
63 | |
58 | struct rxvt_display : refcounted { |
64 | struct rxvt_display : refcounted { |
… | |
… | |
69 | void im_change_cb (); |
75 | void im_change_cb (); |
70 | void im_change_check (); |
76 | void im_change_check (); |
71 | #endif |
77 | #endif |
72 | |
78 | |
73 | //public |
79 | //public |
74 | Display *display; |
80 | Display *display; |
75 | int depth; |
81 | int depth; |
76 | int screen; |
82 | int screen; |
77 | Visual *visual; |
83 | Visual *visual; |
78 | Colormap cmap; |
84 | Colormap cmap; |
79 | Window root; |
85 | Window root; |
80 | rxvt_term *selection_owner; |
86 | rxvt_term *selection_owner; |
81 | #ifndef NO_SLOW_LINK_SUPPORT |
87 | #ifndef NO_SLOW_LINK_SUPPORT |
82 | bool is_local; |
88 | bool is_local; |
|
|
89 | #endif |
|
|
90 | #ifdef POINTER_BLANK |
|
|
91 | Cursor blank_cursor; |
83 | #endif |
92 | #endif |
84 | |
93 | |
85 | rxvt_display (const char *id); |
94 | rxvt_display (const char *id); |
|
|
95 | XrmDatabase get_resources (); |
86 | bool init (); |
96 | bool ref_init (); |
|
|
97 | void ref_next (); |
87 | ~rxvt_display (); |
98 | ~rxvt_display (); |
88 | |
99 | |
89 | operator Display *() const { return display; } |
100 | operator Display *() const { return display; } |
90 | |
101 | |
91 | void flush (); |
102 | void flush (); |
92 | |
103 | Atom atom (const char *name); |
93 | void set_selection_owner (rxvt_term *owner); |
104 | void set_selection_owner (rxvt_term *owner); |
94 | |
105 | |
95 | void reg (xevent_watcher *w); |
106 | void reg (xevent_watcher *w); |
96 | void unreg (xevent_watcher *w); |
107 | void unreg (xevent_watcher *w); |
97 | |
108 | |
… | |
… | |
100 | void unreg (im_watcher *w); |
111 | void unreg (im_watcher *w); |
101 | |
112 | |
102 | rxvt_xim *get_xim (const char *locale, const char *modifiers); |
113 | rxvt_xim *get_xim (const char *locale, const char *modifiers); |
103 | void put_xim (rxvt_xim *xim); |
114 | void put_xim (rxvt_xim *xim); |
104 | #endif |
115 | #endif |
105 | |
|
|
106 | Atom atom (const char *name); |
|
|
107 | }; |
116 | }; |
108 | |
117 | |
109 | #ifdef USE_XIM |
118 | #ifdef USE_XIM |
110 | struct im_watcher : watcher, callback0<void> { |
119 | struct im_watcher : watcher, callback0<void> { |
111 | template<class O1, class O2> |
120 | template<class O1, class O2> |
… | |
… | |
165 | |
174 | |
166 | bool set (rxvt_display *display, Pixel p); |
175 | bool set (rxvt_display *display, Pixel p); |
167 | bool set (rxvt_display *display, const char *name); |
176 | bool set (rxvt_display *display, const char *name); |
168 | bool set (rxvt_display *display, unsigned short cr, unsigned short cg, unsigned short cb); |
177 | bool set (rxvt_display *display, unsigned short cr, unsigned short cg, unsigned short cb); |
169 | |
178 | |
170 | rxvt_color fade (rxvt_display *, int percent); |
179 | rxvt_color fade (rxvt_display *, int percent); // fades to black |
|
|
180 | rxvt_color fade (rxvt_display *, int percent, rxvt_color &fadeto); |
171 | |
181 | |
172 | void free (rxvt_display *display); |
182 | void free (rxvt_display *display); |
173 | }; |
183 | }; |
174 | |
184 | |
175 | #endif |
185 | #endif |