ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvttoolkit.h
(Generate patch)

Comparing rxvt-unicode/src/rxvttoolkit.h (file contents):
Revision 1.4 by root, Sat Dec 11 23:01:36 2004 UTC vs.
Revision 1.11 by root, Wed Jan 25 02:42:06 2006 UTC

15#include "rxvtlib.h" 15#include "rxvtlib.h"
16#include "rxvtutil.h" 16#include "rxvtutil.h"
17 17
18#include "callback.h" 18#include "callback.h"
19 19
20// see rxvttoolkit.C:xa_names, which must be kept in sync
21enum {
22 XA_TEXT,
23 XA_COMPOUND_TEXT,
24 XA_UTF8_STRING,
25 XA_MULTIPLE,
26 XA_TARGETS,
27 XA_TIMESTAMP,
28 XA_VT_SELECTION,
29 XA_INCR,
30 XA_WM_PROTOCOLS,
31 XA_WM_DELETE_WINDOW,
32 XA_CLIPBOARD,
33#if ENABLE_FRILLS
34 XA_MOTIF_WM_HINTS,
35#endif
36#if ENABLE_EWMH
37 XA_NET_WM_PID,
38 XA_NET_WM_NAME,
39 XA_NET_WM_ICON_NAME,
40 XA_NET_WM_PING,
41#endif
42#if USE_XIM
43 XA_WM_LOCALE_NAME,
44 XA_XIM_SERVERS,
45#endif
46#if TRANSPARENT
47 XA_XROOTPMAP_ID,
48 XA_ESETROOT_PMAP_ID,
49#endif
50#if ENABLE_XEMBED
51 XA_XEMBED,
52 XA_XEMBED_INFO,
53#endif
54 NUM_XA
55};
56
20struct rxvt_term; 57struct rxvt_term;
21struct rxvt_display; 58struct rxvt_display;
22 59
23struct im_watcher; 60struct im_watcher;
24struct xevent_watcher; 61struct xevent_watcher;
26struct refcounted { 63struct refcounted {
27 int referenced; 64 int referenced;
28 char *id; 65 char *id;
29 66
30 refcounted (const char *id); 67 refcounted (const char *id);
31 bool init () { return false; } 68 bool ref_init () { return false; }
69 void ref_next () { }
32 ~refcounted (); 70 ~refcounted ();
33}; 71};
34 72
35template<class T> 73template<class T>
36struct refcache : vector<T *> { 74struct refcache : vector<T *> {
37 T *get (const char *id); 75 T *get (const char *id);
38 void put (T *obj); 76 void put (T *obj);
77 void clear ();
78
39 ~refcache (); 79 ~refcache ()
80 {
81 clear ();
82 }
40}; 83};
41 84
42///////////////////////////////////////////////////////////////////////////// 85/////////////////////////////////////////////////////////////////////////////
43 86
44#ifdef USE_XIM 87#ifdef USE_XIM
48 91
49//public 92//public
50 XIM xim; 93 XIM xim;
51 94
52 rxvt_xim (const char *id) : refcounted (id) { } 95 rxvt_xim (const char *id) : refcounted (id) { }
53 bool init (); 96 bool ref_init ();
54 ~rxvt_xim (); 97 ~rxvt_xim ();
55}; 98};
56#endif 99#endif
57 100
58struct rxvt_display : refcounted { 101struct rxvt_display : refcounted {
59 Atom xa_xim_servers;
60
61 io_manager_vec<xevent_watcher> xw; 102 io_manager_vec<xevent_watcher> xw;
62 103
63 io_watcher x_ev; void x_cb (io_watcher &w, short revents); 104 io_watcher x_ev; void x_cb (io_watcher &w, short revents);
64 105
65#ifdef USE_XIM 106#ifdef USE_XIM
69 void im_change_cb (); 110 void im_change_cb ();
70 void im_change_check (); 111 void im_change_check ();
71#endif 112#endif
72 113
73//public 114//public
74 Display *display; 115 Display *display;
75 int depth; 116 int depth;
76 int screen; 117 int screen;
77 Visual *visual; 118 Visual *visual;
78 Colormap cmap; 119 Colormap cmap;
79 Window root; 120 Window root;
80 rxvt_term *selection_owner; 121 rxvt_term *selection_owner;
122 Atom xa[NUM_XA];
81#ifndef NO_SLOW_LINK_SUPPORT 123#ifndef NO_SLOW_LINK_SUPPORT
82 bool is_local; 124 bool is_local;
125#endif
126#ifdef POINTER_BLANK
127 Cursor blank_cursor;
83#endif 128#endif
84 129
85 rxvt_display (const char *id); 130 rxvt_display (const char *id);
131 XrmDatabase get_resources ();
86 bool init (); 132 bool ref_init ();
133 void ref_next ();
87 ~rxvt_display (); 134 ~rxvt_display ();
88 135
89 operator Display *() const { return display; }
90
91 void flush (); 136 void flush ();
92 137 Atom atom (const char *name);
93 void set_selection_owner (rxvt_term *owner); 138 void set_selection_owner (rxvt_term *owner);
94 139
95 void reg (xevent_watcher *w); 140 void reg (xevent_watcher *w);
96 void unreg (xevent_watcher *w); 141 void unreg (xevent_watcher *w);
97 142
100 void unreg (im_watcher *w); 145 void unreg (im_watcher *w);
101 146
102 rxvt_xim *get_xim (const char *locale, const char *modifiers); 147 rxvt_xim *get_xim (const char *locale, const char *modifiers);
103 void put_xim (rxvt_xim *xim); 148 void put_xim (rxvt_xim *xim);
104#endif 149#endif
105
106 Atom atom (const char *name);
107}; 150};
108 151
109#ifdef USE_XIM 152#ifdef USE_XIM
110struct im_watcher : watcher, callback0<void> { 153struct im_watcher : watcher, callback0<void> {
111 template<class O1, class O2> 154 template<class O1, class O2>
165 208
166 bool set (rxvt_display *display, Pixel p); 209 bool set (rxvt_display *display, Pixel p);
167 bool set (rxvt_display *display, const char *name); 210 bool set (rxvt_display *display, const char *name);
168 bool set (rxvt_display *display, unsigned short cr, unsigned short cg, unsigned short cb); 211 bool set (rxvt_display *display, unsigned short cr, unsigned short cg, unsigned short cb);
169 212
170 rxvt_color fade (rxvt_display *, int percent); 213 rxvt_color fade (rxvt_display *, int percent); // fades to black
214 rxvt_color fade (rxvt_display *, int percent, rxvt_color &fadeto);
171 215
172 void free (rxvt_display *display); 216 void free (rxvt_display *display);
173}; 217};
174 218
175#endif 219#endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines