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.14 by root, Mon Jan 30 02:21:21 2006 UTC vs.
Revision 1.24 by root, Sat Feb 18 14:14:43 2006 UTC

62 XA_SCREEN_RESOURCES, 62 XA_SCREEN_RESOURCES,
63 XA_XDCCC_LINEAR_RGB_CORRECTION, 63 XA_XDCCC_LINEAR_RGB_CORRECTION,
64 XA_XDCCC_LINEAR_RGB_MATRICES, 64 XA_XDCCC_LINEAR_RGB_MATRICES,
65 XA_WM_COLORMAP_WINDOWS, 65 XA_WM_COLORMAP_WINDOWS,
66 XA_WM_STATE, 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
67#endif 76#endif
68 NUM_XA 77 NUM_XA
69}; 78};
70 79
71struct rxvt_term; 80struct rxvt_term;
96 } 105 }
97}; 106};
98 107
99///////////////////////////////////////////////////////////////////////////// 108/////////////////////////////////////////////////////////////////////////////
100 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
101#ifdef USE_XIM 137#ifdef USE_XIM
102struct rxvt_xim : refcounted { 138struct rxvt_xim : refcounted {
103 void destroy (); 139 void destroy ();
104 rxvt_display *display; 140 rxvt_display *display;
105 141
112}; 148};
113#endif 149#endif
114 150
115struct rxvt_screen { 151struct rxvt_screen {
116 rxvt_display *display; 152 rxvt_display *display;
117 Display *xdisp; 153 Display *dpy;
118 int depth; 154 int depth;
119 Visual *visual; 155 Visual *visual;
120 Colormap cmap; 156 Colormap cmap;
121 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
122 void set (rxvt_display *disp); 168 void set (rxvt_display *disp);
123 void set (rxvt_display *disp, int bitdepth); 169 void set (rxvt_display *disp, int bitdepth);
124 void clear (); 170 void clear ();
125}; 171};
126 172
136 void im_change_cb (); 182 void im_change_cb ();
137 void im_change_check (); 183 void im_change_check ();
138#endif 184#endif
139 185
140//public 186//public
141 Display *display; 187 Display *dpy;
142 int screen; 188 int screen;
143 Window root; 189 Window root;
144 rxvt_term *selection_owner; 190 rxvt_term *selection_owner;
145 Atom xa[NUM_XA]; 191 Atom xa[NUM_XA];
146#ifndef NO_SLOW_LINK_SUPPORT 192#ifndef NO_SLOW_LINK_SUPPORT
149#ifdef POINTER_BLANK 195#ifdef POINTER_BLANK
150 Cursor blank_cursor; 196 Cursor blank_cursor;
151#endif 197#endif
152 198
153 rxvt_display (const char *id); 199 rxvt_display (const char *id);
154 XrmDatabase get_resources (); 200 XrmDatabase get_resources (bool refresh);
155 bool ref_init (); 201 bool ref_init ();
156 void ref_next (); 202 void ref_next ();
157 ~rxvt_display (); 203 ~rxvt_display ();
158 204
159 void flush (); 205 void flush ();
213 259
214///////////////////////////////////////////////////////////////////////////// 260/////////////////////////////////////////////////////////////////////////////
215 261
216typedef unsigned long Pixel; 262typedef unsigned long Pixel;
217 263
218struct rxvt_rgba { 264struct rgba {
219 unsigned short r, g, b, a; 265 unsigned short r, g, b, a;
220 266
221 enum { MIN_CC = 0x0000, MAX_CC = 0xffff }; 267 enum { MIN_CC = 0x0000, MAX_CC = 0xffff };
222 268
223 rxvt_rgba () 269 rgba ()
224 { } 270 { }
225 271
226 rxvt_rgba (unsigned short r, unsigned short g, unsigned short b, unsigned short a = MAX_CC) 272 rgba (unsigned short r, unsigned short g, unsigned short b, unsigned short a = MAX_CC)
227 : r(r), g(g), b(b), a(a) 273 : r(r), g(g), b(b), a(a)
228 { } 274 { }
229}; 275};
230 276
231struct rxvt_color { 277struct rxvt_color {
232#if XFT 278#if XFT
233 XftColor c; 279 XftColor c;
280#else
281 XColor c;
282#endif
283
234 operator Pixel () const { return c.pixel; } 284 operator Pixel () const { return c.pixel; }
235#else
236 Pixel p;
237 operator Pixel () const { return p; }
238#endif
239 285
240 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); }
241 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); }
242 288
243 void get (rxvt_screen *screen, rxvt_rgba &rgba); 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);
244 294
245 bool set (rxvt_screen *screen, const char *name); 295 bool set (rxvt_screen *screen, const char *name);
246 bool set (rxvt_screen *screen, rxvt_rgba rgba); 296 bool set (rxvt_screen *screen, const rgba &color);
247 297
248 rxvt_color fade (rxvt_screen *screen, int percent); // fades to black 298 void fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to = rgba (0, 0, 0));
249 rxvt_color fade (rxvt_screen *screen, int percent, rxvt_color &fadeto);
250
251 void free (rxvt_screen *screen);
252}; 299};
253 300
254#endif 301#endif
255 302

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines