From: root Date: Mon, 9 Jan 2006 23:00:07 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=bcadd9e3feb37fe8ac2621f330473d09c29d24c7;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/Changes b/Changes index b71129d7..94c71410 100644 --- 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 index 77101a23..fddf319c 100644 --- 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 index 847d9134..c845b523 100644 --- 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 index b3d1bb9f..250d8736 100644 --- a/doc/rxvt.1.pod +++ b/doc/rxvt.1.pod @@ -1090,11 +1090,17 @@ Comma-separated list(s) of perl extension scripts (default: C) 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 resource. For example, C will use all the default extension except C. +Extension names can also be followed by an argument in angle brackets +(e.g. C<< searchable-scrollback >>, 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 index 283c86ca..e84caf56 100644 --- a/src/perl/searchable-scrollback +++ b/src/perl/searchable-scrollback @@ -61,7 +61,7 @@ sub leave { sub idle { my ($self) = @_; - $self->msg ("scrollback search, escape=exit, enter=accept, /=start search, n=next, p=previous"); + $self->msg ("scrollback search, escape=exit, enter=accept, /=start search, n=next, p=previous, G=bottom"); delete $self->{in_search}; } @@ -94,7 +94,7 @@ sub search { } $self->msg ("enter/type/backspace: /$self->{search}_" - . ($self->{found} ? " (not found)" : "")); + . ($self->{found} ? "" : " (not found)")); $self->scr_bell unless $self->{found}; } @@ -141,9 +141,12 @@ sub key_press { } elsif ($string eq "/") { $self->{in_search} = $self->view_start; $self->search; + } elsif ($string eq "G") { + $self->view_start (0); } elsif ($string eq "n") { $self->search; } elsif ($string eq "p") { + # TODO } elsif ($string ne "") { $self->scr_bell; } diff --git a/src/rxvt.h b/src/rxvt.h index 6afae97f..a66c39ed 100644 --- 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 index 7de61ed7..88e775f8 100644 --- 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 index 6ac89a62..cd1105ce 100644 --- 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 index c8db59d0..1aeb017a 100644 --- 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). 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, but xors a rectangle instead. Trailing +whitespace will additionally be xored with the C<$rstyle2>, which defaults +to C, which removes reverse video again and underlines +it instead. + =item $term->scr_bell Ring the bell!