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.255 by sf-exg, Mon Dec 31 12:05:34 2012 UTC vs.
Revision 1.256 by sf-exg, Mon Dec 31 12:05:46 2012 UTC

251 flags &= ~IM_IS_SIZE_SENSITIVE; 251 flags &= ~IM_IS_SIZE_SENSITIVE;
252 252
253 return changed; 253 return changed;
254} 254}
255 255
256bool 256void
257rxvt_term::render_image (rxvt_image &image) 257rxvt_term::render_image (rxvt_image &image)
258{ 258{
259 int image_width = image.img->w; 259 int image_width = image.img->w;
260 int image_height = image.img->h; 260 int image_height = image.img->h;
261 int parent_width = szHint.width; 261 int parent_width = szHint.width;
296 if (!(image.flags & IM_ROOT_ALIGN) 296 if (!(image.flags & IM_ROOT_ALIGN)
297 && (x >= parent_width 297 && (x >= parent_width
298 || y >= parent_height 298 || y >= parent_height
299 || x + w <= 0 299 || x + w <= 0
300 || y + h <= 0)) 300 || y + h <= 0))
301 return false; 301 return;
302 302
303 rxvt_img *img = image.img->scale (w, h); 303 rxvt_img *img = image.img->scale (w, h);
304 304
305 if (image.flags & IM_TILE) 305 if (image.flags & IM_TILE)
306 img->repeat_mode (RepeatNormal); 306 img->repeat_mode (RepeatNormal);
314 XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); 314 XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual);
315 img->convert_format (format, pix_colors [Color_bg])->replace (img); 315 img->convert_format (format, pix_colors [Color_bg])->replace (img);
316 316
317 delete bg_img; 317 delete bg_img;
318 bg_img = img; 318 bg_img = img;
319
320 return true;
321} 319}
322 320
323rxvt_image::rxvt_image () 321rxvt_image::rxvt_image ()
324{ 322{
325 alpha = 0xffff; 323 alpha = 0xffff;
431/* 429/*
432 * Builds a pixmap of the same size as the terminal window that contains 430 * Builds a pixmap of the same size as the terminal window that contains
433 * the tiled portion of the root pixmap that is supposed to be covered by 431 * the tiled portion of the root pixmap that is supposed to be covered by
434 * our window. 432 * our window.
435 */ 433 */
436bool 434void
437rxvt_term::render_root_image () 435rxvt_term::render_root_image ()
438{ 436{
439 /* root dimensions may change from call to call - but Display structure should 437 /* root dimensions may change from call to call - but Display structure should
440 * be always up-to-date, so let's use it : 438 * be always up-to-date, so let's use it :
441 */ 439 */
450 sy = parent_y; 448 sy = parent_y;
451 449
452 /* check if we are outside of the visible part of the virtual screen : */ 450 /* check if we are outside of the visible part of the virtual screen : */
453 if (sx + parent_width <= 0 || sy + parent_height <= 0 451 if (sx + parent_width <= 0 || sy + parent_height <= 0
454 || sx >= root_width || sy >= root_height) 452 || sx >= root_width || sy >= root_height)
455 return 0; 453 return;
456 454
457 while (sx < 0) sx += root_img->w; 455 while (sx < 0) sx += root_img->w;
458 while (sy < 0) sy += root_img->h; 456 while (sy < 0) sy += root_img->h;
459 457
460 rxvt_img *img = root_img->sub_rect (sx, sy, parent_width, parent_height); 458 rxvt_img *img = root_img->sub_rect (sx, sy, parent_width, parent_height);
468 XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); 466 XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual);
469 img->convert_format (format, pix_colors [Color_bg])->replace (img); 467 img->convert_format (format, pix_colors [Color_bg])->replace (img);
470 468
471 delete bg_img; 469 delete bg_img;
472 bg_img = img; 470 bg_img = img;
473
474 return true;
475} 471}
476# endif /* BG_IMAGE_FROM_ROOT */ 472# endif /* BG_IMAGE_FROM_ROOT */
477 473
478void 474void
479rxvt_term::bg_render () 475rxvt_term::bg_render ()
488 if (!mapped) 484 if (!mapped)
489 return; 485 return;
490 486
491# if BG_IMAGE_FROM_ROOT 487# if BG_IMAGE_FROM_ROOT
492 if (root_img) 488 if (root_img)
489 {
493 if (render_root_image ()) 490 render_root_image ();
494 bg_flags |= BG_IS_TRANSPARENT; 491 bg_flags |= BG_IS_TRANSPARENT;
492 }
495# endif 493# endif
496 494
497# if BG_IMAGE_FROM_FILE 495# if BG_IMAGE_FROM_FILE
498 if (fimage.img) 496 if (fimage.img)
499 render_image (fimage); 497 render_image (fimage);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines