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.11 by root, Wed Jan 25 02:42:06 2006 UTC vs.
Revision 1.24 by root, Sat Feb 18 14:14:43 2006 UTC

28 XA_VT_SELECTION, 28 XA_VT_SELECTION,
29 XA_INCR, 29 XA_INCR,
30 XA_WM_PROTOCOLS, 30 XA_WM_PROTOCOLS,
31 XA_WM_DELETE_WINDOW, 31 XA_WM_DELETE_WINDOW,
32 XA_CLIPBOARD, 32 XA_CLIPBOARD,
33 XA_AVERAGE_WIDTH,
34 XA_WEIGHT_NAME,
35 XA_SLANT,
36 XA_CHARSET_REGISTRY,
37 XA_CHARSET_ENCODING,
33#if ENABLE_FRILLS 38#if ENABLE_FRILLS
34 XA_MOTIF_WM_HINTS, 39 XA_MOTIF_WM_HINTS,
35#endif 40#endif
36#if ENABLE_EWMH 41#if ENABLE_EWMH
37 XA_NET_WM_PID, 42 XA_NET_WM_PID,
49#endif 54#endif
50#if ENABLE_XEMBED 55#if ENABLE_XEMBED
51 XA_XEMBED, 56 XA_XEMBED,
52 XA_XEMBED_INFO, 57 XA_XEMBED_INFO,
53#endif 58#endif
59#if !ENABLE_MINIMAL
60 // these are usually allocated by other subsystens, but we do it
61 // here to avoid a server roundtrip.
62 XA_SCREEN_RESOURCES,
63 XA_XDCCC_LINEAR_RGB_CORRECTION,
64 XA_XDCCC_LINEAR_RGB_MATRICES,
65 XA_WM_COLORMAP_WINDOWS,
66 XA_WM_STATE,
67 XA_cursor,
68# if USE_XIM
69 // various selection targets used by XIM
70 XA_TRANSPORT,
71 XA_LOCALES,
72 XA__XIM_PROTOCOL,
73 XA__XIM_XCONNECT,
74 XA__XIM_MOREDATA,
75# endif
76#endif
54 NUM_XA 77 NUM_XA
55}; 78};
56 79
57struct rxvt_term; 80struct rxvt_term;
58struct rxvt_display; 81struct rxvt_display;
82 } 105 }
83}; 106};
84 107
85///////////////////////////////////////////////////////////////////////////// 108/////////////////////////////////////////////////////////////////////////////
86 109
110struct rxvt_screen;
111
112struct rxvt_drawable {
113 rxvt_screen *screen;
114 Drawable drawable;
115 operator Drawable() { return drawable; }
116
117#if XFT
118 XftDraw *xftdrawable;
119 operator XftDraw *();
120#endif
121
122 rxvt_drawable (rxvt_screen *screen, Drawable drawable)
123 : screen(screen),
124#if XFT
125 xftdrawable(0),
126#endif
127 drawable(drawable)
128 { }
129
130#if XFT
131 ~rxvt_drawable ();
132#endif
133};
134
135/////////////////////////////////////////////////////////////////////////////
136
87#ifdef USE_XIM 137#ifdef USE_XIM
88struct rxvt_xim : refcounted { 138struct rxvt_xim : refcounted {
89 void destroy (); 139 void destroy ();
90 rxvt_display *display; 140 rxvt_display *display;
91 141
96 bool ref_init (); 146 bool ref_init ();
97 ~rxvt_xim (); 147 ~rxvt_xim ();
98}; 148};
99#endif 149#endif
100 150
151struct rxvt_screen {
152 rxvt_display *display;
153 Display *dpy;
154 int depth;
155 Visual *visual;
156 Colormap cmap;
157
158#if XFT
159 // scratch pixmap
160 rxvt_drawable *scratch_area;
161 int scratch_w, scratch_h;
162
163 rxvt_drawable &scratch_drawable (int w, int h);
164
165 rxvt_screen ();
166#endif
167
168 void set (rxvt_display *disp);
169 void set (rxvt_display *disp, int bitdepth);
170 void clear ();
171};
172
101struct rxvt_display : refcounted { 173struct rxvt_display : refcounted {
102 io_manager_vec<xevent_watcher> xw; 174 io_manager_vec<xevent_watcher> xw;
103 175
104 io_watcher x_ev; void x_cb (io_watcher &w, short revents); 176 io_watcher x_ev; void x_cb (io_watcher &w, short revents);
105 177
110 void im_change_cb (); 182 void im_change_cb ();
111 void im_change_check (); 183 void im_change_check ();
112#endif 184#endif
113 185
114//public 186//public
115 Display *display; 187 Display *dpy;
116 int depth;
117 int screen; 188 int screen;
118 Visual *visual;
119 Colormap cmap;
120 Window root; 189 Window root;
121 rxvt_term *selection_owner; 190 rxvt_term *selection_owner;
122 Atom xa[NUM_XA]; 191 Atom xa[NUM_XA];
123#ifndef NO_SLOW_LINK_SUPPORT 192#ifndef NO_SLOW_LINK_SUPPORT
124 bool is_local; 193 bool is_local;
126#ifdef POINTER_BLANK 195#ifdef POINTER_BLANK
127 Cursor blank_cursor; 196 Cursor blank_cursor;
128#endif 197#endif
129 198
130 rxvt_display (const char *id); 199 rxvt_display (const char *id);
131 XrmDatabase get_resources (); 200 XrmDatabase get_resources (bool refresh);
132 bool ref_init (); 201 bool ref_init ();
133 void ref_next (); 202 void ref_next ();
134 ~rxvt_display (); 203 ~rxvt_display ();
135 204
136 void flush (); 205 void flush ();
190 259
191///////////////////////////////////////////////////////////////////////////// 260/////////////////////////////////////////////////////////////////////////////
192 261
193typedef unsigned long Pixel; 262typedef unsigned long Pixel;
194 263
264struct rgba {
265 unsigned short r, g, b, a;
266
267 enum { MIN_CC = 0x0000, MAX_CC = 0xffff };
268
269 rgba ()
270 { }
271
272 rgba (unsigned short r, unsigned short g, unsigned short b, unsigned short a = MAX_CC)
273 : r(r), g(g), b(b), a(a)
274 { }
275};
276
195struct rxvt_color { 277struct rxvt_color {
196#if XFT 278#if XFT
197 XftColor c; 279 XftColor c;
280#else
281 XColor c;
282#endif
283
198 operator Pixel () const { return c.pixel; } 284 operator Pixel () const { return c.pixel; }
199#else
200 Pixel p;
201 operator Pixel () const { return p; }
202#endif
203 285
204 bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); } 286 bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); }
205 bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); } 287 bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); }
206 288
207 void get (rxvt_display *display, unsigned short &cr, unsigned short &cg, unsigned short &cb); 289 bool alloc (rxvt_screen *screen, const rgba &color);
290 void free (rxvt_screen *screen);
291
292 void get (rgba &color);
293 void get (XColor &color);
208 294
209 bool set (rxvt_display *display, Pixel p);
210 bool set (rxvt_display *display, const char *name); 295 bool set (rxvt_screen *screen, const char *name);
211 bool set (rxvt_display *display, unsigned short cr, unsigned short cg, unsigned short cb); 296 bool set (rxvt_screen *screen, const rgba &color);
212 297
213 rxvt_color fade (rxvt_display *, int percent); // fades to black 298 void fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to = rgba (0, 0, 0));
214 rxvt_color fade (rxvt_display *, int percent, rxvt_color &fadeto);
215
216 void free (rxvt_display *display);
217}; 299};
218 300
219#endif 301#endif
220 302

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines