-- 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: c46fa4ffcefe760c86c4371806cc6cf39559425e:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

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

commit c46fa4ffcefe760c86c4371806cc6cf39559425e
Author: Marc Lehmann <schmorp@schmorp.de>
Date:   Tue Jan 3 01:15:00 2006 +0000

    *** empty log message ***

diff --git a/MANIFEST b/MANIFEST

index b62bd57c1d8640d888c4c0b4cd33d27cfd40be28..

index ..dccdba2bd080a51baa30e2afddd500a2953dd1c5 100644

--- a/MANIFEST
+++ b/MANIFEST
@@ -126,6 +126,8 @@ src/rxvtperl.h
 src/rxvtperl.C

 src/perl/simple-overlay-clock
+src/perl/digital-clock
+src/perl/selection

 src/gentables
 src/gencompose
diff --git a/src/perl/digital-clock b/src/perl/digital-clock
new file mode 100644
index 0000000000000000000000000000000000000000..71809db8c7c0730397d4382cf4c8b42c7ff7c322
--- /dev/null
+++ b/src/perl/digital-clock
@@ -0,0 +1,40 @@
+#! perl
+
+# this creates a simple digital clock by overwriting the refresh hooks
+
+sub on_init {
+   my ($self) = @_;
+
+   $self->{digital_clock_refresh} = urxvt::timer
+                    ->new
+                    ->start (urxvt::NOW)
+                    ->cb (sub {
+                       $self->{timer}->start ($self->{timer}->at + 1);
+                       $self->want_refresh;
+                    });
+
+   ()
+}
+
+sub on_refresh_begin {
+   my ($self) = @_;
+
+   my $time = sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2, 1, 0];
+   my $xpos = $self->ncol - length $time;
+
+   $self->{digital_clock_rend} = $self->ROW_r (0, [(0x00020000 + urxvt::DEFAULT_RSTYLE) x length $time], $xpos);
+   $self->{digital_clock_text} = $self->ROW_t (0, $time, $xpos);
+
+   ()
+}
+
+sub on_refresh_end {
+   my ($self) = @_;
+
+   $self->ROW_r (0, $self->{digital_clock_rend});
+   $self->ROW_t (0, $self->{digital_clock_text});
+
+   ()
+}
+
+
diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs

index b1afcd339b33d548886d9b3a220db5cf3b459bca..

index ..1fdab62de7025912aa3aff86d256a59f3133719e 100644

--- a/src/rxvtperl.xs
+++ b/src/rxvtperl.xs
@@ -316,6 +316,8 @@ BOOT:
   set_hookname (REFRESH_END);
   set_hookname (KEYBOARD_COMMAND);

+  newCONSTSUB (gv_stashpv ("urxvt", 1), "DEFAULT_RSTYLE", newSViv (DEFAULT_RSTYLE));
+
   sv_setpv (get_sv ("urxvt::LIBDIR", 1), LIBDIR);
 }

@@ -433,6 +435,11 @@ rxvt_term::ncol ()
         OUTPUT:
         RETVAL

+void
+rxvt_term::want_refresh ()
+	CODE:
+        THIS->want_refresh = 1;
+
 void
 rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0)
 	PPCODE:
@@ -474,9 +481,11 @@ rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0)

             for (int col = start_col; col < start_col + len; col++)
               {
-                l.t [col] = wstr [col];
+                l.t [col] = wstr [col - start_col];
                 l.r [col] = SET_FONT (l.r [col], THIS->fontset [GET_STYLE (l.r [col])]->find_font (l.t [col]));
               }
+
+            free (wstr);
           }
 }

@@ -513,7 +522,7 @@ rxvt_term::ROW_r (int row_number, SV *new_rend = 0, int start_col = 0)

             for (int col = start_col; col < start_col + len; col++)
               {
-                rend_t r = SvIV (*av_fetch (av, col, 1)) & ~RS_fontMask;
+                rend_t r = SvIV (*av_fetch (av, col - start_col, 1)) & ~RS_fontMask;

                 l.r [col] = SET_FONT (r, THIS->fontset [GET_STYLE (r)]->find_font (l.t [col]));
               }
diff --git a/src/urxvt.pm b/src/urxvt.pm

index c657bf43434b2c1215616cb87155a1774f2c34f5..

index ..5b46faf7cc9e42769cdaaf5d1e8d3e6d33f980f0 100644

--- a/src/urxvt.pm
+++ b/src/urxvt.pm
@@ -412,6 +412,14 @@ Returns the negative row number of the topmost line. Minimum value is
 C<0>, which displays the normal terminal contents. Larger values scroll
 this many lines into the scrollback buffer.

+=item $term->want_refresh
+
+Requests a screen refresh. At the next opportunity, rxvt-unicode will
+compare the on-screen display with its stored representation. If they
+differ, it redraws the differences.
+
+Used after changing terminal contents to display them.
+
 =item $text = $term->ROW_t ($row_number[, $new_text[, $start_col]])

 Returns the text of the entire row with number C<$row_number>. Row C<0>

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

-- Response ended

-- Page fetched on Sun Jun 2 09:15:45 2024