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

Comparing rxvt-unicode/src/rxvtcolor.C (file contents):
Revision 1.1 by pcg, Mon Nov 24 17:28:08 2003 UTC vs.
Revision 1.2 by pcg, Mon Jan 19 17:26:43 2004 UTC

8{ 8{
9#if XFT 9#if XFT
10 XColor xc; 10 XColor xc;
11 11
12 xc.pixel = p; 12 xc.pixel = p;
13 if (!XQueryColor (R->Xdisplay, XCMAP, &xc)) 13 if (!XQueryColor (R->Xdisplay, R->Xcmap, &xc))
14 return false; 14 return false;
15 15
16 XRenderColor d; 16 XRenderColor d;
17 17
18 d.red = xc.red; 18 d.red = xc.red;
20 d.blue = xc.blue; 20 d.blue = xc.blue;
21 d.alpha = 0xffff; 21 d.alpha = 0xffff;
22 22
23 return 23 return
24 XftColorAllocValue (R->Xdisplay, 24 XftColorAllocValue (R->Xdisplay,
25 XVISUAL, 25 R->Xvisual,
26 XCMAP, 26 R->Xcmap,
27 &d, 27 &d,
28 &c); 28 &c);
29#else 29#else
30 this->p = p; 30 this->p = p;
31#endif 31#endif
36bool 36bool
37rxvt_color::set (pR_ const char *name) 37rxvt_color::set (pR_ const char *name)
38{ 38{
39 XColor xc; 39 XColor xc;
40 40
41 if (XParseColor (R->Xdisplay, XCMAP, name, &xc)) 41 if (XParseColor (R->Xdisplay, R->Xcmap, name, &xc))
42 return set (aR_ xc.red, xc.green, xc.blue); 42 return set (aR_ xc.red, xc.green, xc.blue);
43 43
44 return false; 44 return false;
45} 45}
46 46
52 xc.red = cr; 52 xc.red = cr;
53 xc.green = cg; 53 xc.green = cg;
54 xc.blue = cb; 54 xc.blue = cb;
55 xc.flags = DoRed | DoGreen | DoBlue; 55 xc.flags = DoRed | DoGreen | DoBlue;
56 56
57 if (XAllocColor (R->Xdisplay, XCMAP, &xc)) 57 if (XAllocColor (R->Xdisplay, R->Xcmap, &xc))
58 return set (aR_ xc.pixel); 58 return set (aR_ xc.pixel);
59 59
60 return false; 60 return false;
61} 61}
62 62
69 cb = c.color.blue; 69 cb = c.color.blue;
70#else 70#else
71 XColor c; 71 XColor c;
72 72
73 c.pixel = p; 73 c.pixel = p;
74 XQueryColor (R->Xdisplay, XCMAP, &c); 74 XQueryColor (R->Xdisplay, R->Xcmap, &c);
75 75
76 cr = c.red; 76 cr = c.red;
77 cg = c.green; 77 cg = c.green;
78 cb = c.blue; 78 cb = c.blue;
79#endif 79#endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines