… | |
… | |
302 | y = x; |
302 | y = x; |
303 | geom_flags |= YValue; |
303 | geom_flags |= YValue; |
304 | } |
304 | } |
305 | |
305 | |
306 | if (flags & geometrySet) |
306 | if (flags & geometrySet) |
|
|
307 | { |
307 | {/* new geometry is an adjustment to the old one ! */ |
308 | /* new geometry is an adjustment to the old one ! */ |
308 | if ((geom_flags & WidthValue) && (geom_flags & HeightValue)) |
309 | if ((geom_flags & WidthValue) && (geom_flags & HeightValue)) |
309 | { |
310 | { |
310 | if (w == 0 && h != 0) |
311 | if (w == 0 && h != 0) |
311 | { |
312 | { |
312 | w = h_scale; |
313 | w = h_scale; |
… | |
… | |
328 | } |
329 | } |
329 | } |
330 | } |
330 | else /* setting up geometry from scratch */ |
331 | else /* setting up geometry from scratch */ |
331 | { |
332 | { |
332 | if (!(geom_flags & XValue)) |
333 | if (!(geom_flags & XValue)) |
|
|
334 | { |
333 | {/* use default geometry - centered */ |
335 | /* use default geometry - centered */ |
334 | x = y = defaultAlign; |
336 | x = y = defaultAlign; |
335 | } |
337 | } |
336 | else if (!(geom_flags & YValue)) |
338 | else if (!(geom_flags & YValue)) |
337 | y = x; |
339 | y = x; |
338 | |
340 | |
339 | if ((geom_flags & (WidthValue|HeightValue)) == 0) |
341 | if ((geom_flags & (WidthValue|HeightValue)) == 0) |
|
|
342 | { |
340 | {/* use default geometry - scaled */ |
343 | /* use default geometry - scaled */ |
341 | w = h = defaultScale; |
344 | w = h = defaultScale; |
342 | } |
345 | } |
343 | else if (geom_flags & WidthValue) |
346 | else if (geom_flags & WidthValue) |
344 | { |
347 | { |
345 | if (!(geom_flags & HeightValue)) |
348 | if (!(geom_flags & HeightValue)) |
… | |
… | |
505 | h > 0 ? h : original_asim->height, |
508 | h > 0 ? h : original_asim->height, |
506 | background ? ASA_ASImage : ASA_XImage, |
509 | background ? ASA_ASImage : ASA_XImage, |
507 | 100, ASIMAGE_QUALITY_DEFAULT); |
510 | 100, ASIMAGE_QUALITY_DEFAULT); |
508 | } |
511 | } |
509 | if (background == NULL) |
512 | if (background == NULL) |
|
|
513 | { |
510 | {/* if tiling - pixmap has to be sized exactly as the image, |
514 | /* if tiling - pixmap has to be sized exactly as the image, |
511 | but there is no need to make it bigger then the window! */ |
515 | but there is no need to make it bigger then the window! */ |
512 | if (h_scale == 0) |
516 | if (h_scale == 0) |
513 | new_pmap_width = min (result->width, target_width); |
517 | new_pmap_width = min (result->width, target_width); |
514 | if (v_scale == 0) |
518 | if (v_scale == 0) |
515 | new_pmap_height = min (result->height, target_height); |
519 | new_pmap_height = min (result->height, target_height); |
516 | /* we also need to tile our image in one or both directions */ |
520 | /* we also need to tile our image in one or both directions */ |
… | |
… | |
530 | result = tmp; |
534 | result = tmp; |
531 | } |
535 | } |
532 | } |
536 | } |
533 | } |
537 | } |
534 | else |
538 | else |
|
|
539 | { |
535 | {/* if blending background and image - pixmap has to be sized same as target window */ |
540 | /* if blending background and image - pixmap has to be sized same as target window */ |
536 | ASImageLayer *layers = create_image_layers (2); |
541 | ASImageLayer *layers = create_image_layers (2); |
537 | ASImage *merged_im = NULL; |
542 | ASImage *merged_im = NULL; |
538 | |
543 | |
539 | layers[0].im = background; |
544 | layers[0].im = background; |
540 | layers[0].clip_width = target_width; |
545 | layers[0].clip_width = target_width; |
541 | layers[0].clip_height = target_height; |
546 | layers[0].clip_height = target_height; |
542 | layers[0].tint = background_tint; |
547 | layers[0].tint = background_tint; |
543 | layers[1].im = result; |
548 | layers[1].im = result; |
544 | if (w <= 0) |
549 | if (w <= 0) |
|
|
550 | { |
545 | {/* tile horizontally */ |
551 | /* tile horizontally */ |
546 | while (x > 0) x -= (int)result->width; |
552 | while (x > 0) x -= (int)result->width; |
547 | layers[1].dst_x = x; |
553 | layers[1].dst_x = x; |
548 | layers[1].clip_width = result->width+target_width; |
554 | layers[1].clip_width = result->width+target_width; |
549 | } |
555 | } |
550 | else |
556 | else |
|
|
557 | { |
551 | {/* clip horizontally */ |
558 | /* clip horizontally */ |
552 | layers[1].dst_x = x; |
559 | layers[1].dst_x = x; |
553 | layers[1].clip_width = result->width; |
560 | layers[1].clip_width = result->width; |
554 | } |
561 | } |
555 | if (h <= 0) |
562 | if (h <= 0) |
556 | { |
563 | { |
… | |
… | |
843 | if (sx + window_width <= 0 || sy + window_height <= 0 |
850 | if (sx + window_width <= 0 || sy + window_height <= 0 |
844 | || sx >= root_width || sy >= root_height) |
851 | || sx >= root_width || sy >= root_height) |
845 | return 0; |
852 | return 0; |
846 | |
853 | |
847 | if (root_pixmap != None) |
854 | if (root_pixmap != None) |
|
|
855 | { |
848 | {/* we want to validate the pixmap and get it's size at the same time : */ |
856 | /* we want to validate the pixmap and get it's size at the same time : */ |
849 | int junk; |
857 | int junk; |
850 | unsigned int ujunk; |
858 | unsigned int ujunk; |
851 | /* root pixmap may be bad - allow a error */ |
859 | /* root pixmap may be bad - allow a error */ |
852 | target->allowedxerror = -1; |
860 | target->allowedxerror = -1; |
853 | |
861 | |
… | |
… | |
916 | } |
924 | } |
917 | else |
925 | else |
918 | result |= transpPmapTiled; |
926 | result |= transpPmapTiled; |
919 | } |
927 | } |
920 | else |
928 | else |
|
|
929 | { |
921 | {/* strightforward pixmap copy */ |
930 | /* strightforward pixmap copy */ |
922 | gcv.tile = root_pixmap; |
931 | gcv.tile = root_pixmap; |
923 | gcv.fill_style = FillTiled; |
932 | gcv.fill_style = FillTiled; |
924 | |
933 | |
925 | while (sx < 0) sx += (int)root_width; |
934 | while (sx < 0) sx += (int)root_width; |
926 | while (sy < 0) sy += (int)root_height; |
935 | while (sy < 0) sy += (int)root_height; |