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

Comparing rxvt-unicode/src/perl/background (file contents):
Revision 1.60 by root, Fri Jun 15 13:21:59 2012 UTC vs.
Revision 1.61 by root, Fri Jun 15 19:50:56 2012 UTC

306=item merge $img ... 306=item merge $img ...
307 307
308Takes any number of images and merges them together, creating a single 308Takes any number of images and merges them together, creating a single
309image containing them all. 309image containing them all.
310 310
311This function is called automatically when an expression returns multiple
312images.
313
311=cut 314=cut
312 315
313 sub merge(@) { 316 sub merge(@) {
317 return $_[0] unless $#_;
318
314 # rather annoyingly clumsy, but optimisation is for another time 319 # rather annoyingly clumsy, but optimisation is for another time
315 320
316 my $x0 = +1e9; 321 my $x0 = +1e9;
317 my $y0 = +1e9; 322 my $y0 = +1e9;
318 my $x1 = -1e9; 323 my $x1 = -1e9;
905 ($x, $y, $w, $h) = 910 ($x, $y, $w, $h) =
906 $self->background_geometry ($self->{border}); 911 $self->background_geometry ($self->{border});
907 912
908 # evaluate user expression 913 # evaluate user expression
909 914
910 my $img = eval { $self->{expr}->() }; 915 my $img = eval { urxvt::bgdsl::merge $self->{expr}->() };
911 warn $@ if $@;#d# 916 die $@ if $@;
912 die "background-expr did not return an image.\n" if !UNIVERSAL::isa $img, "urxvt::img"; 917 die "background-expr did not return an image.\n" if !UNIVERSAL::isa $img, "urxvt::img";
913 918
914 # if the expression is sensitive to external events, prepare reevaluation then 919 # if the expression is sensitive to external events, prepare reevaluation then
915 920
916 my $again = delete $state->{again}; 921 my $again = delete $state->{again};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines