repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 5361f2b6294c8c01a75da57d10fbf186e145f062: path_to: revision_to:
commit 5361f2b6294c8c01a75da57d10fbf186e145f062 Author: Marc LehmannDate: Thu Jun 7 13:12:08 2012 +0000 *** empty log message *** diff --git a/src/perl/background b/src/perl/background
--- a/src/perl/background
+++ b/src/perl/background
@@ -6,7 +6,7 @@
our $EXPR;
#$EXPR = 'move W * 0.1, -H * 0.1, resize W * 0.5, H * 0.5, repeat_none load "opensource.png"';
-$EXPR = 'border; move -X, -Y, load "argb.png"';
+$EXPR = 'move -X, -Y, load "argb.png"';
#$EXPR = '
# rotate W, H, 50, 50, counter 1/59.95, repeat_mirror,
# clip X, Y, W, H, repeat_mirror,
@@ -19,9 +19,8 @@ $EXPR = 'border; move -X, -Y, load "argb.png"';
use Safe;
-our $border;
our ($bgdsl_self, $old, $new);
-our ($l, $t, $w, $h);
+our ($x, $y, $w, $h);
# enforce at least this interval between updates
our $MIN_INTERVAL = 1/100;
@@ -29,17 +28,17 @@ our $MIN_INTERVAL = 1/100;
{
package urxvt::bgdsl; # background language
-# *repeat_empty = \&urxvt::RepeatNone;
-# *repeat_tile = \&urxvt::RepeatNormal;
-# *repeat_pad = \&urxvt::RepeatPad;
-# *repeat_mirror = \&urxvt::RepeatReflect;
-
=head2 PROVIDERS/GENERATORS
=over 4
=item load $path
+Loads the image at the given C<$path>. The image is set to plane tiling
+mode.
+
+
+
=cut
sub load($) {
@@ -67,8 +66,8 @@ our $MIN_INTERVAL = 1/100;
=cut
- sub X() { $new->{position_sensitive} = 1; $l }
- sub Y() { $new->{position_sensitive} = 1; $t }
+ sub X() { $new->{position_sensitive} = 1; $x }
+ sub Y() { $new->{position_sensitive} = 1; $y }
sub W() { $new->{size_sensitive} = 1; $w }
sub H() { $new->{size_sensitive} = 1; $h }
@@ -283,27 +282,6 @@ Resizes the image to exactly C<$width> times C<$height> pixels.
=back
-=head2 SETTINGS
-
-=over 4
-
-=item border $respect_border=1
-
-Sets whether the image should respect the terminal border (argument true
-or missing), or whether it should fill the whole window (the default).
-
-By default, the image will cover the whole toplevel window. If C
-is enabled, then it will only fill the character area and leave a normal
-border in the background colour around it and behind the scrollbar.
-
-=cut
-
- sub border {
- $border = @_ ? $_[0] : 1;
- }
-
-=back
-
=cut
}
@@ -340,15 +318,14 @@ sub recalculate {
# set environment to evaluate user expression
local $bgdsl_self = $self;
- local $border;
local $old = $self->{state};
local $new = my $state = $self->{state} = {};
- ($l, $t, $w, $h) =
- $self->get_geometry;
+ my $border = 0; #d#
- warn "$l,$t,$w,$h\n";#d#
+ ($x, $y, $w, $h) =
+ $self->background_geometry ($border);
# evaluate user expression
diff --git a/src/rxvtimg.C b/src/rxvtimg.C
--- a/src/rxvtimg.C
+++ b/src/rxvtimg.C
@@ -414,7 +414,7 @@ rxvt_img::reify ()
if (alpha)
{
XRenderColor rc = { 0, 0, 0, 0 };
- XRenderFillRectangle (dpy, PictOpSrc, dst, &rc, 0, 0, w, h);
+ XRenderFillRectangle (dpy, PictOpSrc, dst, &rc, 0, 0, w, h);//TODO: split into four fillrectangles
XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, -x, -y, ref->w, ref->h);
}
else
@@ -463,8 +463,10 @@ rxvt_img::transform (int new_width, int new_height, double matrix[9])
for (int j = 0; j < 3; ++j)
xfrm.matrix [i][j] = XDoubleToFixed (matrix [i * 3 + j]);
- xfrm.matrix [0][2] += XDoubleToFixed (x);//TODO
- xfrm.matrix [0][3] += XDoubleToFixed (y);
+#if 0
+ xfrm.matrix [0][2] -= XDoubleToFixed (x);//TODO
+ xfrm.matrix [1][2] -= XDoubleToFixed (y);
+#endif
XRenderSetPictureFilter (dpy, src, "good", 0, 0);
XRenderSetPictureTransform (dpy, src, &xfrm);
@@ -523,8 +525,6 @@ rxvt_img::convert_to (XRenderPictFormat *new_format, const rxvt_color &bg)
rxvt_img *img = new rxvt_img (s, new_format, 0, 0, w, h, repeat);
img->alloc ();
- printf ("convert %d to %d\n", format->direct.alphaMask, new_format->direct.alphaMask);//D
-
Display *dpy = s->display->dpy;
Picture src = src_picture ();
Picture dst = XRenderCreatePicture (dpy, img->pm, new_format, 0, 0);
diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs
--- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -2034,13 +2034,13 @@ rxvt_term::XTranslateCoordinates (Window src, Window dst, int x, int y) # TODO: ugly void -rxvt_term::get_geometry () +rxvt_term::background_geometry (bool border = false) PPCODE: EXTEND (SP, 4); - PUSHs (sv_2mortal (newSViv (THIS->parent_x))); - PUSHs (sv_2mortal (newSViv (THIS->parent_y))); - PUSHs (sv_2mortal (newSViv (THIS->szHint.width))); - PUSHs (sv_2mortal (newSViv (THIS->szHint.height))); + PUSHs (sv_2mortal (newSViv (THIS->parent_x + (border ? THIS->window_vt_x : 0)))); + PUSHs (sv_2mortal (newSViv (THIS->parent_y + (border ? THIS->window_vt_y : 0)))); + PUSHs (sv_2mortal (newSViv (border ? THIS->vt_width : THIS->szHint.width ))); + PUSHs (sv_2mortal (newSViv (border ? THIS->vt_height : THIS->szHint.height))); #if HAVE_IMG
-----END OF PAGE-----