-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: rxvt-unicode-sixel
action: commit
revision:
path_from:
revision_from: 12740b40e18b19a1bbe2171bba9ad29aba3654c1:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

git://git.thebackupbox.net/rxvt-unicode-sixel

commit 12740b40e18b19a1bbe2171bba9ad29aba3654c1
Author: Marc Lehmann <schmorp@schmorp.de>
Date:   Sat Jul 7 07:00:17 2012 +0000

    *** empty log message ***

diff --git a/src/rxvtimg.C b/src/rxvtimg.C

index 2b3a29c7b61f64a413ec3bb70d132903b8d4de61..

index ..2b51e5bff112fdec2b6f898c58f6265aab83da4f 100644

--- a/src/rxvtimg.C
+++ b/src/rxvtimg.C
@@ -767,8 +767,6 @@ rxvt_img::reify ()
   if (x == 0 && y == 0 && w == ref->w && h == ref->h)
     return clone ();

-  Display *dpy = s->dpy;
-
   // add an alpha channel if...
   bool alpha = !format->direct.alphaMask // pixmap has none yet
                && (x || y)               // we need one because of non-zero offset
@@ -777,7 +775,7 @@ rxvt_img::reify ()
   composer cc (this, new rxvt_img (s, alpha ? find_alpha_format_for (s->dpy, format) : format,
                                    0, 0, w, h, repeat));

-  if (alpha)
+  if (repeat == RepeatNone)
     {
       XRenderColor rc = { 0, 0, 0, 0 };
       XRenderFillRectangle (cc.dpy, PictOpSrc, cc.dst, &rc, 0, 0, w, h);//TODO: split into four fillrectangles
diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs

index be4aaa7da72d5e1cf51cba25500d1de9689ebda7..

index ..4d8709e8ba32b0a4ac90e6780a918bf3af878d83 100644

--- a/src/rxvtperl.xs
+++ b/src/rxvtperl.xs
@@ -2216,10 +2216,10 @@ rxvt_term::set_background (rxvt_img *img, bool border = false)
             img = img->clone (); // own the img

             if (img->repeat != RepeatNormal) // X11 only supports RepeatNormal as bg pixmap
-                img->sub_rect (0, 0,
-                               border ? THIS->vt_width  : THIS->szHint.width,
-                               border ? THIS->vt_height : THIS->szHint.height)
-                   ->replace (img);
+              img->sub_rect (0, 0,
+                             border ? THIS->vt_width  : THIS->szHint.width,
+                             border ? THIS->vt_height : THIS->szHint.height)
+                 ->replace (img);

             // just in case, should usually be a nop
             img->reify ()
diff --git a/src/urxvt.pm b/src/urxvt.pm

index 9f7c3a6c2943e18d0789b7229a4340ba73c2ae23..

index ..8b5c62f644fd735d615bf7b2d40f1b62c40c2d2e 100644

--- a/src/urxvt.pm
+++ b/src/urxvt.pm
@@ -105,37 +105,8 @@ internal use.
 Although it isn't a C<urxvt::term> object, you can call all methods of the
 C<urxvt::term> class on this object.

-It has the following methods and data members:
-
-=over 4
-
-=item $urxvt_term = $self->{term}
-
-Returns the C<urxvt::term> object associated with this instance of the
-extension. This member I<must not> be changed in any way.
-
-=item $self->enable ($hook_name => $cb[, $hook_name => $cb..])
-
-Dynamically enable the given hooks (named without the C<on_> prefix) for
-this extension, replacing any previous hook. This is useful when you want
-to overwrite time-critical hooks only temporarily.
-
-To install additional callbacks for the same hook, you can use the C<on>
-method of the C<urxvt::term> class.
-
-=item $self->disable ($hook_name[, $hook_name..])
-
-Dynamically disable the given hooks.
-
-=item $self->x_resource ($pattern)
-
-=item $self->x_resource_boolean ($pattern)
-
-These methods support an additional C<%> prefix when called on an
-extension object - see the description of these methods in the
-C<urxvt::term> class for details.
-
-=back
+Additional methods only supported for extension objects are described in
+the C<urxvt::extension> section below.

 =head2 Hooks

@@ -803,6 +774,73 @@ sub rend2mask {

 package urxvt::term::extension;

+=head2 The C<urxvt::term::extension> class
+
+Each extension attached to a terminal object is represented by
+a C<urxvt::term::extension> object.
+
+You can use these objects, which are passed to all callbacks to store any
+state related to the terminal and extension instance.
+
+The methods (And data members) documented below can be called on extension
+objects, in addition to call methods documented for the <urxvt::term>
+class.
+
+=over 4
+
+=item $urxvt_term = $self->{term}
+
+Returns the C<urxvt::term> object associated with this instance of the
+extension. This member I<must not> be changed in any way.
+
+=cut
+
+our $AUTOLOAD;
+
+sub AUTOLOAD {
+   $AUTOLOAD =~ /:([^:]+)$/
+      or die "FATAL: \$AUTOLOAD '$AUTOLOAD' unparsable";
+
+   eval qq{
+      sub $AUTOLOAD {
+         my \$proxy = shift;
+         \$proxy->{term}->$1 (\@_)
+      }
+      1
+   } or die "FATAL: unable to compile method forwarder: $@";
+
+   goto &$AUTOLOAD;
+}
+
+sub DESTROY {
+   # nop
+}
+
+# urxvt::destroy_hook (basically a cheap Guard:: implementation)
+
+sub urxvt::destroy_hook::DESTROY {
+   ${$_[0]}->();
+}
+
+sub urxvt::destroy_hook(&) {
+   bless \shift, urxvt::destroy_hook::
+}
+
+=item $self->enable ($hook_name => $cb[, $hook_name => $cb..])
+
+Dynamically enable the given hooks (named without the C<on_> prefix) for
+this extension, replacing any previous hook. This is useful when you want
+to overwrite time-critical hooks only temporarily.
+
+To install additional callbacks for the same hook, you can use the C<on>
+method of the C<urxvt::term> class.
+
+=item $self->disable ($hook_name[, $hook_name..])
+
+Dynamically disable the given hooks.
+
+=cut
+
 sub enable {
    my ($self, %hook) = @_;
    my $pkg = $self->{_pkg};
@@ -833,37 +871,56 @@ sub disable {
    }
 }

-our $AUTOLOAD;
+=item $guard = $self->on ($hook_name => $cb[, $hook_name => $cb..])

-sub AUTOLOAD {
-   $AUTOLOAD =~ /:([^:]+)$/
-      or die "FATAL: \$AUTOLOAD '$AUTOLOAD' unparsable";
+Similar to the C<enable> enable, but installs additional callbacks for
+the given hook(s) (that is, it doesn't replace existing callbacks), and
+returns a guard object. When the guard object is destroyed the callbacks
+are disabled again.

-   eval qq{
-      sub $AUTOLOAD {
-         my \$proxy = shift;
-         \$proxy->{term}->$1 (\@_)
-      }
-      1
-   } or die "FATAL: unable to compile method forwarder: $@";
+=cut

-   goto &$AUTOLOAD;
-}
+sub urxvt::extension::on_disable::DESTROY {
+   my $disable = shift;

-sub DESTROY {
-   # nop
+   my $self = delete $disable->{""};
+
+   while (my ($htype, $id) = each %$disable) {
+      delete $self->{_hook}[$htype]{$id};
+      $self->set_should_invoke ($htype, -1);
+   }
 }

-# urxvt::destroy_hook
+sub on {
+   my ($self, %hook) = @_;
+
+   my %disable = ( "" => $self );

-sub urxvt::destroy_hook::DESTROY {
-   ${$_[0]}->();
-}
+   while (my ($name, $cb) = each %hook) {
+      my $htype = $HOOKTYPE{uc $name};
+      defined $htype
+         or Carp::croak "unsupported hook type '$name'";

-sub urxvt::destroy_hook(&) {
-   bless \shift, urxvt::destroy_hook::
+      my $id = $cb+0;
+
+      $self->set_should_invoke ($htype, +1);
+      $disable{$htype} = $id;
+      $self->{_hook}[$htype]{$id} = sub { shift; $cb->($self, @_) }; # very ugly indeed
+   }
+
+   bless \%disable, "urxvt::extension::on_disable"
 }

+=item $self->x_resource ($pattern)
+
+=item $self->x_resource_boolean ($pattern)
+
+These methods support an additional C<%> prefix when called on an
+extension object - see the description of these methods in the
+C<urxvt::term> class for details.
+
+=cut
+
 sub x_resource {
    my ($self, $name) = @_;
    $name =~ s/^%(\.|$)/$_[0]{_name}$1/;
@@ -876,6 +933,10 @@ sub x_resource_boolean {
    $self->{term}->x_resource_boolean ($name)
 }

+=back
+
+=cut
+
 package urxvt::anyevent;

 =head2 The C<urxvt::anyevent> Class
@@ -1071,49 +1132,6 @@ Destroy the terminal object (close the window, free resources
 etc.). Please note that @@RXVT_NAME@@ will not exit as long as any event
 watchers (timers, io watchers) are still active.

-=item $guard = $self->on ($hook_name => $cb[, $hook_name => $cb..])
-
-Similar to the extension method C<enable>, but installs additional
-callbacks for the given hook(s) (existing ones are not replaced), and
-returns a guard object. When the guard object is destroyed the callbacks
-are disabled again.
-
-Note that these callbacks receive the normal parameters, but the first
-argument (normally the extension) is currently undefined.
-
-=cut
-
-sub urxvt::term::on_disable::DESTROY {
-   my $disable = shift;
-
-   my $self = delete $disable->{""};
-
-   while (my ($htype, $id) = each %$disable) {
-      delete $self->{_hook}[$htype]{$id};
-      $self->set_should_invoke ($htype, -1);
-   }
-}
-
-sub on {
-   my ($self, %hook) = @_;
-
-   my %disable = ( "" => $self );
-
-   while (my ($name, $cb) = each %hook) {
-      my $htype = $HOOKTYPE{uc $name};
-      defined $htype
-         or Carp::croak "unsupported hook type '$name'";
-
-      my $id = $cb+0;
-
-      $self->set_should_invoke ($htype, +1);
-      $disable{$htype} = $id;
-      $self->{_hook}[$htype]{$id} = $cb;
-   }
-
-   bless \%disable, "urxvt::term::on_disable"
-}
-
 =item $term->exec_async ($cmd[, @args])

 Works like the combination of the C<fork>/C<exec> builtins, which executes

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 09:33:28 2024