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.19 by root, Wed Jun 6 20:55:37 2012 UTC vs.
Revision 1.20 by root, Wed Jun 6 22:01:45 2012 UTC

24our $MIN_INTERVAL = 1/100; 24our $MIN_INTERVAL = 1/100;
25 25
26{ 26{
27 package urxvt::bgdsl; # background language 27 package urxvt::bgdsl; # background language
28 28
29 *repeat_empty = \&urxvt::RepeatNone; 29# *repeat_empty = \&urxvt::RepeatNone;
30 *repeat_tile = \&urxvt::RepeatNormal; 30# *repeat_tile = \&urxvt::RepeatNormal;
31 *repeat_pad = \&urxvt::RepeatPad; 31# *repeat_pad = \&urxvt::RepeatPad;
32 *repeat_mirror = \&urxvt::RepeatReflect; 32# *repeat_mirror = \&urxvt::RepeatReflect;
33 33
34=head2 PROVIDERS/GENERATORS 34=head2 PROVIDERS/GENERATORS
35 35
36=over 4 36=over 4
37 37
56 $img 56 $img
57 } 57 }
58 58
59=back 59=back
60 60
61=head2 VARIABLES
62
63=over 4
64
65=cut
66
67 sub X() { $new->{position_sensitive} = 1; $l }
68 sub Y() { $new->{position_sensitive} = 1; $t }
69 sub W() { $new->{size_sensitive} = 1; $w }
70 sub H() { $new->{size_sensitive} = 1; $h }
71
72 sub now() { urxvt::NOW }
73
74 sub again($) {
75 $new->{again} = $_[0];
76 }
77
78 sub counter($) {
79 $new->{again} = $_[0];
80 $bgdsl_self->{counter} + 0
81 }
82
83=back
84
61=head2 OPERATORS 85=head2 OPERATORS
62 86
63=over 4 87=over 4
64 88
65=cut 89=cut
66 90
67# sub clone($) { 91# sub clone($) {
68# $_[0]->clone 92# $_[0]->clone
69# } 93# }
70 94
71 sub clip($$$$$;$) { 95 sub clip($;$$;$$) {
72 my $img = pop; 96 my $img = pop;
73 $img->sub_rect ($_[0], $_[1], $_[2], $_[3], $_[4]) 97 $img->sub_rect ($_[0], $_[1], $_[2] || W, $_[3] || H)
74 } 98 }
75 99
76 sub resize($$$) { 100 sub resize($$$) {
77 my $img = pop; 101 my $img = pop;
78 $img->scale ($_[0], $_[1]) 102 $img->scale ($_[0], $_[1])
79 } 103 }
80 104
81 # TODO: ugly 105 # TODO: ugly
82 sub move($$;$) { 106 sub move($$;$) {
107 my $img = pop->clone;
108 $img->move ($_[0], $_[1]);
109 $img
83 my $img = pop; 110# my $img = pop;
84 $img->sub_rect ( 111# $img->sub_rect (
85 $_[0], $_[1], 112# $_[0], $_[1],
86 $img->w, $img->h, 113# $img->w, $img->h,
87 $_[2], 114# $_[2],
88 ) 115# )
89 } 116 }
90 117
91 sub rotate($$$$$$;$) { 118 sub rotate($$$$$$) {
92 my $img = pop; 119 my $img = pop;
93 $img->rotate ( 120 $img->rotate (
94 $_[0], 121 $_[0],
95 $_[1], 122 $_[1],
96 $_[2] * $img->w * .01, 123 $_[2] * $img->w * .01,
97 $_[3] * $img->h * .01, 124 $_[3] * $img->h * .01,
98 $_[4] * (3.14159265 / 180), 125 $_[4] * (3.14159265 / 180),
99 $_[5],
100 ) 126 )
101 } 127 }
102 128
103 sub blur($$$) { 129 sub blur($$$) {
104 my ($rh, $rv, $img) = @_; 130 my ($rh, $rv, $img) = @_;
126 $a = 1 if @_ < 5; 152 $a = 1 if @_ < 5;
127 153
128 $img = $img->clone; 154 $img = $img->clone;
129 $img->brightness ($r, $g, $b, $a); 155 $img->brightness ($r, $g, $b, $a);
130 $img 156 $img
131 }
132
133 sub X() { $new->{position_sensitive} = 1; $l }
134 sub Y() { $new->{position_sensitive} = 1; $t }
135 sub W() { $new->{size_sensitive} = 1; $w }
136 sub H() { $new->{size_sensitive} = 1; $h }
137
138 sub now() { urxvt::NOW }
139
140 sub again($) {
141 $new->{again} = $_[0];
142 }
143
144 sub counter($) {
145 $new->{again} = $_[0];
146 $bgdsl_self->{counter} + 0
147 } 157 }
148 158
149=back 159=back
150 160
151=cut 161=cut

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines