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.15 by root, Mon Jan 30 19:46:13 2006 UTC vs.
Revision 1.21 by root, Wed Feb 1 18:36:48 2006 UTC

222 222
223///////////////////////////////////////////////////////////////////////////// 223/////////////////////////////////////////////////////////////////////////////
224 224
225typedef unsigned long Pixel; 225typedef unsigned long Pixel;
226 226
227struct rxvt_rgba { 227struct rgba {
228 unsigned short r, g, b, a; 228 unsigned short r, g, b, a;
229 229
230 enum { MIN_CC = 0x0000, MAX_CC = 0xffff }; 230 enum { MIN_CC = 0x0000, MAX_CC = 0xffff };
231 231
232 rxvt_rgba () 232 rgba ()
233 { } 233 { }
234 234
235 rxvt_rgba (unsigned short r, unsigned short g, unsigned short b, unsigned short a = MAX_CC) 235 rgba (unsigned short r, unsigned short g, unsigned short b, unsigned short a = MAX_CC)
236 : r(r), g(g), b(b), a(a) 236 : r(r), g(g), b(b), a(a)
237 { } 237 { }
238}; 238};
239 239
240struct rxvt_color { 240struct rxvt_color {
241#if XFT 241#if XFT
242 XftColor c; 242 XftColor c;
243#else
244 XColor c;
245#endif
246
243 operator Pixel () const { return c.pixel; } 247 operator Pixel () const { return c.pixel; }
244#else
245 Pixel p;
246 operator Pixel () const { return p; }
247#endif
248 248
249 bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); } 249 bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); }
250 bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); } 250 bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); }
251 251
252 void get (rxvt_screen *screen, rxvt_rgba &rgba); 252 bool alloc (rxvt_screen *screen, const rgba &color);
253 void free (rxvt_screen *screen);
254
255 void get (rgba &color);
256 void get (XColor &color);
253 257
254 bool alloc (rxvt_screen *screen, rxvt_rgba rgba);
255
256 bool set (rxvt_screen *screen, const char *name); 258 bool set (rxvt_screen *screen, const char *name);
257 bool set (rxvt_screen *screen, rxvt_rgba rgba); 259 bool set (rxvt_screen *screen, const rgba &color);
258 260
259 rxvt_color fade (rxvt_screen *screen, int percent); // fades to black 261 void fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to = rgba (0, 0, 0));
260 rxvt_color fade (rxvt_screen *screen, int percent, rxvt_color &fadeto);
261
262 void free (rxvt_screen *screen);
263}; 262};
264 263
265#endif 264#endif
266 265

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines