-- 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: 7a675ef6084a50d8bb0452db9b31fae1a005857b: path_to: revision_to:
commit 7a675ef6084a50d8bb0452db9b31fae1a005857b Author: Marc Lehmann <schmorp@schmorp.de> Date: Mon Jan 9 23:00:07 2006 +0000 *** empty log message *** diff --git a/Changes b/Changes
--- a/Changes +++ b/Changes @@ -11,10 +11,10 @@ WISH: support tex fonts - added sections for DISTRIBUTION MAINTAINERS and about SETUID/SETGID to the FAQ. + - selection, searchable-scrollback, selection-popup and + option-popup extensions enabled by default. - increased xft drawing speed for problematic fonts. The effect will likely be small as 99% of the xft slowness is server-related. - - selection, selection-popup and option-popup extensions - enabled by default. - perl: much increased functionality, better overlays, popup support and much much more. - perl: urxvt::line now can set via ->t and ->r. @@ -26,6 +26,7 @@ WISH: support tex fonts - free the resource database: this plugs a massive memory leak. As a side effect, it also gets rid of XGetDefault calls. - free one of the cursors, fixes a small memory leak. + - built-in (as opposed to terminfos) visual bell was broken/too fast. 6.3 Wed Jan 4 22:37:10 CET 2006 - SECURITY FIX: on systems using openpty, permissions were diff --git a/MANIFEST b/MANIFEST
--- a/MANIFEST +++ b/MANIFEST @@ -171,12 +171,13 @@ src/typemap src/rxvtperl.h src/rxvtperl.xs +src/perl/urxvt-popup +src/perl/selection +src/perl/option-popup +src/perl/selection-popup +src/perl/searchable-scrollback src/perl/example-refresh-hooks src/perl/block-graphics-to-ascii src/perl/digital-clock -src/perl/option-popup -src/perl/selection-popup -src/perl/urxvt-popup -src/perl/selection src/perl/mark-urls diff --git a/autoconf/configure.in b/autoconf/configure.in
--- a/autoconf/configure.in +++ b/autoconf/configure.in @@ -1428,6 +1428,10 @@ AC_SUBST(PERL) AC_SUBST(IF_PERL) AC_SUBST(PERL_O) +if text x$support_perl = xyes; then + support_frills=yes +fi + dnl> AC_CHECK_FUNCS(gettimeofday putenv select socket) CFLAGS=${CFLAGS--O} diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod
--- a/doc/rxvt.1.pod +++ b/doc/rxvt.1.pod @@ -1090,11 +1090,17 @@ Comma-separated list(s) of perl extension scripts (default: C<default>) to use in this terminal instance; option B<-pe>. Extension names can be prefixed with a C<-> sign to prohibit using -it. This can be useful to selectively disable some extensions loaded +them. This can be useful to selectively disable some extensions loaded by default, or specified via the C<perl-ext-common> resource. For example, C<default,-selection> will use all the default extension except C<selection>. +Extension names can also be followed by an argument in angle brackets +(e.g. C<< searchable-scrollback<M-s> >>, which binds the hotkey for +searchable scorllback to Alt/Meta-s). Mentioning the same extension +multiple times with different arguments will pass multiple arguments to +the extension. + Each extension is looked up in the library directories, loaded if necessary, and bound to the current terminal instance. diff --git a/src/perl/searchable-scrollback b/src/perl/searchable-scrollback
--- a/src/perl/searchable-scrollback +++ b/src/perl/searchable-scrollback @@ -39,12 +39,9 @@ sub enter { $self->{view_start} = $self->view_start; $self->enable ( - refresh_begin => sub { - warn "beg(@_)\n"; - }, - refresh_end => sub { - warn "end(@_)\n"; - }, + key_press => \&key_press, + refresh_begin => \&refresh, + refresh_end => \&refresh, ); $self->idle; @@ -55,7 +52,7 @@ sub leave { delete $self->{overlay}; - $self->disable ("refresh_begin", "refresh_end"); + $self->disable ("key_press", "refresh_begin", "refresh_end"); $self->pty_ev_events ($self->{pty_ev_events}); $self->want_refresh; @@ -86,7 +83,7 @@ sub search { my $text = $line->t; if ($text =~ /$re/g) { do { - push @{ $self->{found} }, [$line->coord_of ($-[0]), $line->coord_of ($+[1])]; + push @{ $self->{found} }, [$line->coord_of ($-[0]), $line->coord_of ($+[0])]; } while $text =~ /$re/g; $self->view_start (-$row + ($self->nrow >> 1)); @@ -101,24 +98,35 @@ sub search { $self->scr_bell unless $self->{found}; } -sub on_key_press { - my ($self, $event, $keysym, $string) = @_; +sub refresh { + my ($self) = @_; + + return unless $self->{found}; + + $self->scr_xor_span (@$_) + for @{ $self->{found} }; + + () +} - $self->{overlay} - or return; +sub key_press { + my ($self, $event, $keysym, $string) = @_; if (exists $self->{in_search}) { if ($keysym == 0xff0d || $keysym == 0xff8d) { - delete $self->{in_search}; + $self->idle; } elsif ($keysym == 0xff1b) { - $self->view_start (delete $self->{in_search}); + $self->view_start ($self->{in_search}); + $self->idle; } elsif ($keysym == 0xff08) { substr $self->{search}, -1, 1, ""; + + $self->search; } elsif ($string ne "") { $self->{search} .= $string; - } - $self->search; + $self->search; + } } else { if ($keysym == 0xff0d || $keysym == 0xff8d) { # OK @@ -134,6 +142,7 @@ sub on_key_press { $self->{in_search} = $self->view_start; $self->search; } elsif ($string eq "n") { + $self->search; } elsif ($string eq "p") { } elsif ($string ne "") { $self->scr_bell; diff --git a/src/rxvt.h b/src/rxvt.h
--- a/src/rxvt.h +++ b/src/rxvt.h @@ -1516,6 +1516,8 @@ struct rxvt_term : zero_initialized, rxvt_vars { int scr_changeview (unsigned int oldviewstart); void scr_bell (); void scr_printscreen (int fullhist); + void scr_xor_rect (int beg_row, int beg_col, int end_row, int end_col, rend_t rstyle1, rend_t rstyle2); + void scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, rend_t rstyle); void scr_reverse_selection (); void scr_dump (int fd); void selection_check (int check_more); diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs
--- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -1338,6 +1338,12 @@ rxvt_term::selection (SV *newtext = 0) } } +void +rxvt_term::scr_xor_rect (int beg_row, int beg_col, int end_row, int end_col, U32 rstyle1 = RS_RVid, U32 rstyle2 = RS_RVid | RS_Uline) + +void +rxvt_term::scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, U32 rstyle = RS_RVid) + void rxvt_term::scr_bell () diff --git a/src/screen.C b/src/screen.C
--- a/src/screen.C +++ b/src/screen.C @@ -2459,6 +2459,54 @@ rxvt_term::scr_clear (bool really) XClearWindow (display->display, vt); } +void +rxvt_term::scr_xor_rect (int beg_row, int beg_col, int end_row, int end_col, rend_t rstyle1, rend_t rstyle2) +{ + int view_end = -view_start + nrow; + int row, col; + + for (row = max (beg_row, -view_start); row <= min (end_row, view_end); row++) + { + text_t *stp = ROW(row).t; + rend_t *srp = ROW(row).r; + + for (col = beg_col; col < end_col; col++) + srp[col] ^= rstyle1; + + while (col-- > beg_col && (stp[col] == NOCHAR || unicode::is_space (stp[col]))) + srp[col] ^= rstyle2; + + if (++col < end_col) + srp[col] ^= rstyle2; + } +} + +void +rxvt_term::scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, rend_t rstyle) +{ + int view_end = -view_start + nrow; + int row, col; + + if (beg_row >= -view_start) + { + col = beg_col; + row = beg_row; + } + else + { + col = 0; + row = -view_start; + } + + for (; row < min (end_row, view_end); row++, col = 0) + for (rend_t *srp = ROW(row).r; col < ncol; col++) + srp[col] ^= RS_RVid; + + if (row == end_row) + for (rend_t *srp = ROW(row).r; col < end_col; col++) + srp[col] ^= RS_RVid; +} + /* ------------------------------------------------------------------------- */ void rxvt_term::scr_reverse_selection () @@ -2467,49 +2515,16 @@ rxvt_term::scr_reverse_selection () && current_screen == selection.screen && selection.end.row >= -view_start) { - int view_end = -view_start + nrow; - int row, col; - #if ENABLE_FRILLS if (selection.rect) - { - for (row = max (selection.beg.row, -view_start); row <= min (selection.end.row, view_end); row++) - { - text_t *stp = ROW(row).t; - rend_t *srp = ROW(row).r; - - for (col = selection.beg.col; col < selection.end.col; col++) - srp[col] ^= RS_RVid; - - while (col-- > selection.beg.col && (stp[col] == NOCHAR || unicode::is_space (stp[col]))) - srp[col] ^= RS_RVid | RS_Uline; - - if (++col < selection.end.col) - srp[col] ^= RS_RVid | RS_Uline; - } - } + scr_xor_rect (selection.beg.row, selection.beg.col, + selection.end.row, selection.end.col, + RS_RVid, RS_RVid | RS_Uline); else #endif - { - if (selection.beg.row >= -view_start) - { - col = selection.beg.col; - row = selection.beg.row; - } - else - { - col = 0; - row = -view_start; - } - - for (; row < min (selection.end.row, view_end); row++, col = 0) - for (rend_t *srp = ROW(row).r; col < ncol; col++) - srp[col] ^= RS_RVid; - - if (row == selection.end.row) - for (rend_t *srp = ROW(row).r; col < selection.end.col; col++) - srp[col] ^= RS_RVid; - } + scr_xor_span (selection.beg.row, selection.beg.col, + selection.end.row, selection.end.col, + RS_RVid); } } diff --git a/src/urxvt.pm b/src/urxvt.pm
--- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -943,6 +943,19 @@ Convert the given text string into the corresponding locale encoding. Convert the given locale-encoded octets into a perl string. +=item $term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle]) + +XORs the rendition values in the given span with the provided value +(default: C<RS_RVid>). Useful in refresh hooks to provide effects similar +to the selection. + +=item $term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, $rstyle2]]) + +Similar to C<scr_xor_span>, but xors a rectangle instead. Trailing +whitespace will additionally be xored with the C<$rstyle2>, which defaults +to C<RS_RVid | RS_Uline>, which removes reverse video again and underlines +it instead. + =item $term->scr_bell Ring the bell!
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 11:55:47 2024