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

Comparing rxvt-unicode/src/background.C (file contents):
Revision 1.244 by root, Sun Jun 17 21:58:18 2012 UTC vs.
Revision 1.247 by sf-exg, Sat Dec 29 18:12:53 2012 UTC

28#ifdef HAVE_BG_PIXMAP 28#ifdef HAVE_BG_PIXMAP
29 29
30void 30void
31rxvt_term::bg_destroy () 31rxvt_term::bg_destroy ()
32{ 32{
33# if ENABLE_TRANSPARENCY 33# if BG_IMAGE_FROM_ROOT
34 delete root_img; 34 delete root_img;
35 root_img = 0; 35 root_img = 0;
36# endif 36# endif
37 37
38# if BG_IMAGE_FROM_FILE 38# if BG_IMAGE_FROM_FILE
44} 44}
45 45
46bool 46bool
47rxvt_term::bg_window_size_sensitive () 47rxvt_term::bg_window_size_sensitive ()
48{ 48{
49# if ENABLE_TRANSPARENCY 49# if BG_IMAGE_FROM_ROOT
50 if (bg_flags & BG_IS_TRANSPARENT) 50 if (option (Opt_transparent))
51 return true; 51 return true;
52# endif 52# endif
53 53
54# if BG_IMAGE_FROM_FILE 54# if BG_IMAGE_FROM_FILE
55 if (fimage.img) 55 if (fimage.img)
65} 65}
66 66
67bool 67bool
68rxvt_term::bg_window_position_sensitive () 68rxvt_term::bg_window_position_sensitive ()
69{ 69{
70# if ENABLE_TRANSPARENCY 70# if BG_IMAGE_FROM_ROOT
71 if (bg_flags & BG_IS_TRANSPARENT) 71 if (option (Opt_transparent))
72 return true; 72 return true;
73# endif 73# endif
74 74
75# if BG_IMAGE_FROM_FILE 75# if BG_IMAGE_FROM_FILE
76 if (fimage.img) 76 if (fimage.img)
319 else 319 else
320 img->repeat_mode (RepeatNone); 320 img->repeat_mode (RepeatNone);
321 img->sub_rect (-x, -y, parent_width, parent_height)->replace (img); 321 img->sub_rect (-x, -y, parent_width, parent_height)->replace (img);
322 322
323 if (bg_flags & BG_IS_VALID) 323 if (bg_flags & BG_IS_VALID)
324 bg_img->draw (img, PictOpOver, image.alpha * 1. / 0xffff); 324 img->draw (bg_img, PictOpOver, image.alpha * 1. / 0xffff);
325 325
326 XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); 326 XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual);
327 img->convert_format (format, pix_colors [Color_bg])->replace (img); 327 img->convert_format (format, pix_colors [Color_bg])->replace (img);
328 328
329 delete bg_img; 329 delete bg_img;
437 } 437 }
438 438
439 return false; 439 return false;
440} 440}
441 441
442# if ENABLE_TRANSPARENCY 442# if BG_IMAGE_FROM_ROOT
443/* 443/*
444 * Builds a pixmap of the same size as the terminal window that contains 444 * Builds a pixmap of the same size as the terminal window that contains
445 * the tiled portion of the root pixmap that is supposed to be covered by 445 * the tiled portion of the root pixmap that is supposed to be covered by
446 * our window. 446 * our window.
447 */ 447 */
493rxvt_term::bg_set_root_pixmap () 493rxvt_term::bg_set_root_pixmap ()
494{ 494{
495 delete root_img; 495 delete root_img;
496 root_img = rxvt_img::new_from_root (this); 496 root_img = rxvt_img::new_from_root (this);
497} 497}
498# endif /* ENABLE_TRANSPARENCY */ 498# endif /* BG_IMAGE_FROM_ROOT */
499 499
500void 500void
501rxvt_term::bg_render () 501rxvt_term::bg_render ()
502{ 502{
503 if (bg_flags & BG_INHIBIT_RENDER) 503 if (bg_flags & BG_INHIBIT_RENDER)
504 return; 504 return;
505 505
506 bg_invalidate (); 506 bg_invalidate ();
507# if ENABLE_TRANSPARENCY 507# if BG_IMAGE_FROM_ROOT
508 if (bg_flags & BG_IS_TRANSPARENT) 508 if (option (Opt_transparent))
509 { 509 {
510 /* we need to re-generate transparency pixmap in that case ! */ 510 /* we need to re-generate transparency pixmap in that case ! */
511 if (render_root_image ()) 511 if (render_root_image ())
512 bg_flags |= BG_IS_VALID; 512 bg_flags |= BG_IS_VALID | BG_IS_TRANSPARENT;
513 } 513 }
514# endif 514# endif
515 515
516# if BG_IMAGE_FROM_FILE 516# if BG_IMAGE_FROM_FILE
517 if (fimage.img) 517 if (fimage.img)
534} 534}
535 535
536void 536void
537rxvt_term::bg_init () 537rxvt_term::bg_init ()
538{ 538{
539#if ENABLE_TRANSPARENCY 539#if BG_IMAGE_FROM_ROOT
540 if (option (Opt_transparent)) 540 if (option (Opt_transparent))
541 { 541 {
542 bg_set_transparent ();
543
544 if (rs [Rs_blurradius]) 542 if (rs [Rs_blurradius])
545 root_effects.set_blur (rs [Rs_blurradius]); 543 root_effects.set_blur (rs [Rs_blurradius]);
546 544
547 if (ISSET_PIXCOLOR (Color_tint)) 545 if (ISSET_PIXCOLOR (Color_tint))
548 root_effects.set_tint (pix_colors_focused [Color_tint]); 546 root_effects.set_tint (pix_colors_focused [Color_tint]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines