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

Comparing rxvt-unicode/src/rxvttoolkit.C (file contents):
Revision 1.135 by root, Tue Jun 5 13:39:26 2012 UTC vs.
Revision 1.141 by sf-exg, Tue Oct 1 13:30:04 2013 UTC

66#endif 66#endif
67#if USE_XIM 67#if USE_XIM
68 "WM_LOCALE_NAME", 68 "WM_LOCALE_NAME",
69 "XIM_SERVERS", 69 "XIM_SERVERS",
70#endif 70#endif
71#if ENABLE_TRANSPARENCY 71#if HAVE_IMG || ENABLE_PERL
72 "_XROOTPMAP_ID", 72 "_XROOTPMAP_ID",
73 "ESETROOT_PMAP_ID", 73 "ESETROOT_PMAP_ID",
74#endif 74#endif
75#if ENABLE_XEMBED 75#if ENABLE_XEMBED
76 "_XEMBED", 76 "_XEMBED",
260 depth = DefaultDepthOfScreen (screen); 260 depth = DefaultDepthOfScreen (screen);
261 visual = DefaultVisualOfScreen (screen); 261 visual = DefaultVisualOfScreen (screen);
262 cmap = DefaultColormapOfScreen (screen); 262 cmap = DefaultColormapOfScreen (screen);
263} 263}
264 264
265#if ENABLE_FRILLS
266
265void 267void
266rxvt_screen::select_visual (int bitdepth) 268rxvt_screen::select_visual (int id)
267{ 269{
268#if XFT
269 XVisualInfo vinfo; 270 XVisualInfo vinfo;
271 vinfo.visualid = id;
272 int n;
273
274 if (XVisualInfo *vi = XGetVisualInfo (dpy, VisualIDMask, &vinfo, &n))
275 {
276 depth = vi->depth;
277 visual = vi->visual;
278
279 XFree (vi);
280
281 cmap = XCreateColormap (dpy, display->root, visual, AllocNone);
282 }
283 else
284 rxvt_warn ("cannot requested visual id 0x%02x, using default visual.\n", id);
285}
286
287void
288rxvt_screen::select_depth (int bitdepth)
289{
290 XVisualInfo vinfo;
270 291
271 if (XMatchVisualInfo (dpy, display->screen, bitdepth, TrueColor, &vinfo)) 292 if (XMatchVisualInfo (dpy, display->screen, bitdepth, TrueColor, &vinfo))
272 {
273 depth = bitdepth;
274 visual = vinfo.visual; 293 select_visual (vinfo.visualid);
275 cmap = XCreateColormap (dpy, display->root, visual, AllocNone); 294 else
276 } 295 rxvt_warn ("no visual found for requested depth %d, using default visual.\n", bitdepth);
277#endif
278} 296}
297
298#endif
279 299
280void 300void
281rxvt_screen::clear () 301rxvt_screen::clear ()
282{ 302{
283#if XFT 303#if XFT
470 490
471 flags = 0; 491 flags = 0;
472#if XRENDER 492#if XRENDER
473 int major, minor; 493 int major, minor;
474 if (XRenderQueryVersion (dpy, &major, &minor)) 494 if (XRenderQueryVersion (dpy, &major, &minor))
475 {
476 flags |= DISPLAY_HAS_RENDER;
477
478 if (major > 0 || (major == 0 && minor >= 10)) 495 if (major > 0 || (major == 0 && minor >= 10))
496 {
479 flags |= DISPLAY_HAS_RENDER_10; 497 flags |= DISPLAY_HAS_RENDER;
480 498
499#if 0
481 if (major > 0 || (major == 0 && minor >= 11)) 500 if (major > 0 || (major == 0 && minor >= 11))
482 flags |= DISPLAY_HAS_RENDER_MUL; 501 flags |= DISPLAY_HAS_RENDER_MUL;
502#endif
483 503
484 XFilters *filters = XRenderQueryFilters (dpy, root); 504 if (XFilters *filters = XRenderQueryFilters (dpy, root))
485 if (filters)
486 { 505 {
487 for (int i = 0; i < filters->nfilter; i++) 506 for (int i = 0; i < filters->nfilter; i++)
488 if (!strcmp (filters->filter[i], FilterConvolution)) 507 if (!strcmp (filters->filter [i], FilterConvolution))
489 flags |= DISPLAY_HAS_RENDER_CONV; 508 flags |= DISPLAY_HAS_RENDER_CONV;
490 509
491 XFree (filters); 510 XFree (filters);
492 } 511 }
493 } 512 }
494#endif 513#endif
495 514
496 int fd = XConnectionNumber (dpy); 515 int fd = XConnectionNumber (dpy);
497 516
498 // try to detect whether we have a local connection. 517 // try to detect whether we have a local connection.
890 909
891 return got; 910 return got;
892} 911}
893 912
894void 913void
895rxvt_color::get (rgba &color) 914rxvt_color::get (rgba &color) const
896{ 915{
897#if XFT 916#if XFT
898 color.r = c.color.red; 917 color.r = c.color.red;
899 color.g = c.color.green; 918 color.g = c.color.green;
900 color.b = c.color.blue; 919 color.b = c.color.blue;
906 color.a = rgba::MAX_CC; 925 color.a = rgba::MAX_CC;
907#endif 926#endif
908} 927}
909 928
910void 929void
911rxvt_color::get (XColor &color) 930rxvt_color::get (XColor &color) const
912{ 931{
913 rgba c; 932 rgba c;
914 get (c); 933 get (c);
915 934
916 color.red = c.r; 935 color.red = c.r;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines