… | |
… | |
391 | #endif |
391 | #endif |
392 | { |
392 | { |
393 | ASImage *scaled_im = scale_asimage (asv, original_asim, w, h, ASA_XImage, 0, ASIMAGE_QUALITY_DEFAULT); |
393 | ASImage *scaled_im = scale_asimage (asv, original_asim, w, h, ASA_XImage, 0, ASIMAGE_QUALITY_DEFAULT); |
394 | if (scaled_im) |
394 | if (scaled_im) |
395 | { |
395 | { |
396 | pixmap = AFTERIMAGE_DPY_OP (asimage2pixmap(asv, display->root, scaled_im, gc, True)); |
396 | pixmap = asimage2pixmap(asv, display->root, scaled_im, gc, True); |
397 | destroy_asimage (&scaled_im); |
397 | destroy_asimage (&scaled_im); |
398 | } |
398 | } |
399 | } |
399 | } |
400 | #else /* HAVE_AFTERIMAGE */ |
400 | #else /* HAVE_AFTERIMAGE */ |
401 | { |
401 | { |
… | |
… | |
491 | original_asim = get_asimage( asimman, f, 0xFFFFFFFF, 100 ); |
491 | original_asim = get_asimage( asimman, f, 0xFFFFFFFF, 100 ); |
492 | free( f ); |
492 | free( f ); |
493 | } |
493 | } |
494 | if (original_asim) |
494 | if (original_asim) |
495 | { |
495 | { |
496 | bgPixmap.pixmap = AFTERIMAGE_DPY_OP (asimage2pixmap (asv, display->root, original_asim, NULL, True)); |
496 | bgPixmap.pixmap = asimage2pixmap (asv, display->root, original_asim, NULL, True); |
497 | xpmAttr.width = original_asim->width ; |
497 | xpmAttr.width = original_asim->width ; |
498 | xpmAttr.height = original_asim->height ; |
498 | xpmAttr.height = original_asim->height ; |
499 | } |
499 | } |
500 | #else /* HAVE_AFTERIMAGE */ |
500 | #else /* HAVE_AFTERIMAGE */ |
501 | xpmAttr.closeness = 30000; |
501 | xpmAttr.closeness = 30000; |
… | |
… | |
863 | Pixmap tmp_pmap = None ; |
863 | Pixmap tmp_pmap = None ; |
864 | ShadingInfo shade; |
864 | ShadingInfo shade; |
865 | ARGB32 tint ; |
865 | ARGB32 tint ; |
866 | unsigned int pmap_w = 0, pmap_h = 0; |
866 | unsigned int pmap_w = 0, pmap_h = 0; |
867 | |
867 | |
868 | if (get_drawable_size( rootpixmap, &pmap_w, &pmap_h )) |
868 | if (get_dpy_drawable_size( dpy, rootpixmap, &pmap_w, &pmap_h )) |
869 | { |
869 | { |
870 | int root_x = 0, root_y = 0; |
870 | int root_x = 0, root_y = 0; |
871 | |
871 | |
872 | shade.shading = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100; |
872 | shade.shading = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100; |
873 | if (ISSET_PIXCOLOR (Color_tint)) |
873 | if (ISSET_PIXCOLOR (Color_tint)) |
… | |
… | |
880 | } |
880 | } |
881 | else |
881 | else |
882 | shade.tintColor.red = shade.tintColor.green = shade.tintColor.blue = 0xFFFF; |
882 | shade.tintColor.red = shade.tintColor.green = shade.tintColor.blue = 0xFFFF; |
883 | tint = shading2tint32( &shade ); |
883 | tint = shading2tint32( &shade ); |
884 | gc = XCreateGC (dpy, vt, 0UL, &gcvalue); |
884 | gc = XCreateGC (dpy, vt, 0UL, &gcvalue); |
885 | if (GetWinPosition (parent[0], &root_x, &root_y) ) |
885 | if (get_dpy_window_position(dpy, display->root, parent[0], NULL, NULL, &root_x, &root_y)) |
886 | { |
886 | { |
887 | ASImageLayer *layers = create_image_layers( 2 ); |
887 | ASImageLayer *layers = create_image_layers( 2 ); |
888 | ASImage *merged_im = NULL; |
888 | ASImage *merged_im = NULL; |
889 | int back_x, back_y, back_w, back_h; |
889 | int back_x, back_y, back_w, back_h; |
890 | /* merge_layers does good job at tiling background appropriately, |
890 | /* merge_layers does good job at tiling background appropriately, |
… | |
… | |
901 | }}while(0) |
901 | }}while(0) |
902 | |
902 | |
903 | MAKE_ROOTPMAP_GEOM(x,w,width); |
903 | MAKE_ROOTPMAP_GEOM(x,w,width); |
904 | MAKE_ROOTPMAP_GEOM(y,h,height); |
904 | MAKE_ROOTPMAP_GEOM(y,h,height); |
905 | |
905 | |
906 | layers[0].im = AFTERIMAGE_DPY_OP (pixmap2asimage (asv, rootpixmap, back_x, back_y, back_w, back_h, AllPlanes, ASA_ASImage, 100)); |
906 | layers[0].im = pixmap2asimage (asv, rootpixmap, back_x, back_y, back_w, back_h, AllPlanes, ASA_ASImage, 100); |
907 | layers[0].clip_x = (back_w == pmap_w)?root_x:0; |
907 | layers[0].clip_x = (back_w == pmap_w)?root_x:0; |
908 | layers[0].clip_y = (back_h == pmap_h)?root_y:0; |
908 | layers[0].clip_y = (back_h == pmap_h)?root_y:0; |
909 | layers[0].clip_width = szHint.width; |
909 | layers[0].clip_width = szHint.width; |
910 | layers[0].clip_height = szHint.height; |
910 | layers[0].clip_height = szHint.height; |
911 | layers[0].tint = tint; |
911 | layers[0].tint = tint; |
… | |
… | |
959 | if (layers[1].im != original_asim) |
959 | if (layers[1].im != original_asim) |
960 | destroy_asimage( &(layers[1].im) ); |
960 | destroy_asimage( &(layers[1].im) ); |
961 | destroy_asimage( &(layers[0].im) ); |
961 | destroy_asimage( &(layers[0].im) ); |
962 | if (merged_im != NULL) |
962 | if (merged_im != NULL) |
963 | { |
963 | { |
964 | tmp_pmap = AFTERIMAGE_DPY_OP (asimage2pixmap (asv, DefaultRootWindow(dpy), merged_im, gc, True)); |
964 | tmp_pmap = asimage2pixmap (asv, DefaultRootWindow(dpy), merged_im, gc, True); |
965 | destroy_asimage( &merged_im ); |
965 | destroy_asimage( &merged_im ); |
966 | } |
966 | } |
967 | free( layers ); |
967 | free( layers ); |
968 | } |
968 | } |
969 | } |
969 | } |