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

Comparing rxvt-unicode/src/xpm.C (file contents):
Revision 1.40 by ayin, Wed Jun 20 13:46:25 2007 UTC vs.
Revision 1.43 by ayin, Sat Jun 30 23:31:29 2007 UTC

191 191
192 if (bgPixmap.pixmap == None) 192 if (bgPixmap.pixmap == None)
193 { /* So be it: I'm not using pixmaps */ 193 { /* So be it: I'm not using pixmaps */
194 pixmap = None; 194 pixmap = None;
195 195
196#ifdef TRANSPARENT 196#ifdef ENABLE_TRANSPARENCY
197 if (!option (Opt_transparent) || !am_transparent) 197 if (!option (Opt_transparent) || !am_transparent)
198#endif 198#endif
199 XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); 199 XSetWindowBackground (dpy, vt, pix_colors[Color_bg]);
200 200
201 return; 201 return;
235 XCopyArea (dpy, bgPixmap.pixmap, pixmap, gc, 0, y, x, xpmh - y, xpmw - x, 0); 235 XCopyArea (dpy, bgPixmap.pixmap, pixmap, gc, 0, y, x, xpmh - y, xpmw - x, 0);
236 XCopyArea (dpy, bgPixmap.pixmap, pixmap, gc, 0, 0, x, y, xpmw - x, xpmh - y); 236 XCopyArea (dpy, bgPixmap.pixmap, pixmap, gc, 0, 0, x, y, xpmw - x, xpmh - y);
237 } 237 }
238 else 238 else
239#ifdef HAVE_AFTERIMAGE 239#ifdef HAVE_AFTERIMAGE
240#ifdef TRANSPARENT 240#ifdef ENABLE_TRANSPARENCY
241 if (!option(Opt_transparent) || !am_transparent) 241 if (!option(Opt_transparent) || !am_transparent)
242 /* will do that in check_our_parents otherwise */ 242 /* will do that in check_our_parents otherwise */
243#endif 243#endif
244 { 244 {
245 ASImage *scaled_im = scale_asimage( display->asv, original_asim, w, h, ASA_XImage, 0, ASIMAGE_QUALITY_DEFAULT ); 245 ASImage *scaled_im = scale_asimage( display->asv, original_asim, w, h, ASA_XImage, 0, ASIMAGE_QUALITY_DEFAULT );
298 } 298 }
299 299
300 XSetWindowBackgroundPixmap (dpy, vt, pixmap); 300 XSetWindowBackgroundPixmap (dpy, vt, pixmap);
301 301
302 XFreeGC (dpy, gc); 302 XFreeGC (dpy, gc);
303#ifdef TRANSPARENT 303#ifdef ENABLE_TRANSPARENCY
304 am_transparent = 0; 304 am_transparent = 0;
305#endif 305#endif
306} 306}
307 307
308/* 308/*
410 asimman = create_generic_imageman(rs[Rs_path]); 410 asimman = create_generic_imageman(rs[Rs_path]);
411 if ((f = strchr (file, ';')) == NULL) 411 if ((f = strchr (file, ';')) == NULL)
412 original_asim = get_asimage( asimman, file, 0xFFFFFFFF, 100 ); 412 original_asim = get_asimage( asimman, file, 0xFFFFFFFF, 100 );
413 else 413 else
414 { 414 {
415 f = strndup( file, f - file ); 415 size_t len = f - file;
416 f = (char *)malloc (len + 1);
417 strncpy (f, file, len);
418 f[len] = '\0';
416 original_asim = get_asimage( asimman, f, 0xFFFFFFFF, 100 ); 419 original_asim = get_asimage( asimman, f, 0xFFFFFFFF, 100 );
417 free( f ); 420 free( f );
418 } 421 }
419 if (original_asim) 422 if (original_asim)
420 { 423 {
453 return bgPixmap.pixmap; 456 return bgPixmap.pixmap;
454} 457}
455 458
456#endif /* XPM_BACKGROUND */ 459#endif /* XPM_BACKGROUND */
457 460
458#ifdef TRANSPARENT 461#ifdef ENABLE_TRANSPARENCY
459#if TINTING && !defined(HAVE_AFTERIMAGE) 462#if TINTING && !defined(HAVE_AFTERIMAGE)
460/* taken from aterm-0.4.2 */ 463/* taken from aterm-0.4.2 */
461 464
462typedef uint32_t RUINT32T; 465typedef uint32_t RUINT32T;
463 466
467static void
464void ShadeXImage(rxvt_term *term, XImage* srcImage, int shade, int rm, int gm, int bm) 468ShadeXImage(rxvt_term *term, XImage* srcImage, int shade, int rm, int gm, int bm)
465{ 469{
466 int sh_r, sh_g, sh_b; 470 int sh_r, sh_g, sh_b;
467 RUINT32T mask_r, mask_g, mask_b; 471 RUINT32T mask_r, mask_g, mask_b;
468 RUINT32T *lookup, *lookup_r, *lookup_g, *lookup_b; 472 RUINT32T *lookup, *lookup_r, *lookup_g, *lookup_b;
469 unsigned int lower_lim_r, lower_lim_g, lower_lim_b; 473 unsigned int lower_lim_r, lower_lim_g, lower_lim_b;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines