… | |
… | |
262 | Called whenever text is about to be output, with the text as argument. You |
262 | Called whenever text is about to be output, with the text as argument. You |
263 | can filter/change and output the text yourself by returning a true value |
263 | can filter/change and output the text yourself by returning a true value |
264 | and calling C<< $term->scr_add_lines >> yourself. Please note that this |
264 | and calling C<< $term->scr_add_lines >> yourself. Please note that this |
265 | might be very slow, however, as your hook is called for B<all> text being |
265 | might be very slow, however, as your hook is called for B<all> text being |
266 | output. |
266 | output. |
|
|
267 | |
|
|
268 | =item on_tt_write $term, $octets |
|
|
269 | |
|
|
270 | Called whenever some data is written to the tty/pty and can be used to |
|
|
271 | suppress or filter tty input. |
267 | |
272 | |
268 | =item on_line_update $term, $row |
273 | =item on_line_update $term, $row |
269 | |
274 | |
270 | Called whenever a line was updated or changed. Can be used to filter |
275 | Called whenever a line was updated or changed. Can be used to filter |
271 | screen output (e.g. underline urls or other useless stuff). Only lines |
276 | screen output (e.g. underline urls or other useless stuff). Only lines |
… | |
… | |
501 | open my $fh, "<:raw", $path |
506 | open my $fh, "<:raw", $path |
502 | or die "$path: $!"; |
507 | or die "$path: $!"; |
503 | |
508 | |
504 | my $source = untaint |
509 | my $source = untaint |
505 | "package $pkg; use strict; use utf8;\n" |
510 | "package $pkg; use strict; use utf8;\n" |
506 | . "use base urxvt::term::proxy::;\n" |
511 | . "use base urxvt::term::extension::;\n" |
507 | . "#line 1 \"$path\"\n{\n" |
512 | . "#line 1 \"$path\"\n{\n" |
508 | . (do { local $/; <$fh> }) |
513 | . (do { local $/; <$fh> }) |
509 | . "\n};\n1"; |
514 | . "\n};\n1"; |
510 | |
515 | |
511 | eval $source |
516 | eval $source |
… | |
… | |
588 | } |
593 | } |
589 | |
594 | |
590 | $retval |
595 | $retval |
591 | } |
596 | } |
592 | |
597 | |
593 | # urxvt::term::proxy |
598 | # urxvt::term::extension |
594 | |
599 | |
595 | package urxvt::term::proxy; |
600 | package urxvt::term::extension; |
596 | |
601 | |
597 | sub enable { |
602 | sub enable { |
598 | my ($self, %hook) = @_; |
603 | my ($self, %hook) = @_; |
599 | my $pkg = $self->{_pkg}; |
604 | my $pkg = $self->{_pkg}; |
600 | |
605 | |
… | |
… | |
941 | |
946 | |
942 | =item $string = $term->locale_decode ($octets) |
947 | =item $string = $term->locale_decode ($octets) |
943 | |
948 | |
944 | Convert the given locale-encoded octets into a perl string. |
949 | Convert the given locale-encoded octets into a perl string. |
945 | |
950 | |
|
|
951 | =item $term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle]) |
|
|
952 | |
|
|
953 | XORs the rendition values in the given span with the provided value |
|
|
954 | (default: C<RS_RVid>). Useful in refresh hooks to provide effects similar |
|
|
955 | to the selection. |
|
|
956 | |
|
|
957 | =item $term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, $rstyle2]]) |
|
|
958 | |
|
|
959 | Similar to C<scr_xor_span>, but xors a rectangle instead. Trailing |
|
|
960 | whitespace will additionally be xored with the C<$rstyle2>, which defaults |
|
|
961 | to C<RS_RVid | RS_Uline>, which removes reverse video again and underlines |
|
|
962 | it instead. |
|
|
963 | |
946 | =item $term->scr_bell |
964 | =item $term->scr_bell |
947 | |
965 | |
948 | Ring the bell! |
966 | Ring the bell! |
949 | |
967 | |
950 | =item $term->scr_add_lines ($string) |
968 | =item $term->scr_add_lines ($string) |