… | |
… | |
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 | |
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. |
|
|
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 |
272 | that are being shown will be filtered, and, due to performance reasons, |
277 | that are being shown will be filtered, and, due to performance reasons, |
… | |
… | |
457 | our $VERSION = 1; |
462 | our $VERSION = 1; |
458 | our $TERM; |
463 | our $TERM; |
459 | our @HOOKNAME; |
464 | our @HOOKNAME; |
460 | our %HOOKTYPE = map +($HOOKNAME[$_] => $_), 0..$#HOOKNAME; |
465 | our %HOOKTYPE = map +($HOOKNAME[$_] => $_), 0..$#HOOKNAME; |
461 | our %OPTION; |
466 | our %OPTION; |
|
|
467 | |
462 | our $LIBDIR; |
468 | our $LIBDIR; |
|
|
469 | our $RESNAME; |
|
|
470 | our $RESCLASS; |
|
|
471 | our $RXVTNAME; |
463 | |
472 | |
464 | BEGIN { |
473 | BEGIN { |
465 | urxvt->bootstrap; |
474 | urxvt->bootstrap; |
466 | |
475 | |
467 | # overwrite perl's warn |
476 | # overwrite perl's warn |
… | |
… | |
501 | open my $fh, "<:raw", $path |
510 | open my $fh, "<:raw", $path |
502 | or die "$path: $!"; |
511 | or die "$path: $!"; |
503 | |
512 | |
504 | my $source = untaint |
513 | my $source = untaint |
505 | "package $pkg; use strict; use utf8;\n" |
514 | "package $pkg; use strict; use utf8;\n" |
506 | . "use base urxvt::term::proxy::;\n" |
515 | . "use base urxvt::term::extension::;\n" |
507 | . "#line 1 \"$path\"\n{\n" |
516 | . "#line 1 \"$path\"\n{\n" |
508 | . (do { local $/; <$fh> }) |
517 | . (do { local $/; <$fh> }) |
509 | . "\n};\n1"; |
518 | . "\n};\n1"; |
510 | |
519 | |
511 | eval $source |
520 | eval $source |
… | |
… | |
588 | } |
597 | } |
589 | |
598 | |
590 | $retval |
599 | $retval |
591 | } |
600 | } |
592 | |
601 | |
593 | # urxvt::term::proxy |
602 | # urxvt::term::extension |
594 | |
603 | |
595 | package urxvt::term::proxy; |
604 | package urxvt::term::extension; |
596 | |
605 | |
597 | sub enable { |
606 | sub enable { |
598 | my ($self, %hook) = @_; |
607 | my ($self, %hook) = @_; |
599 | my $pkg = $self->{_pkg}; |
608 | my $pkg = $self->{_pkg}; |
600 | |
609 | |
… | |
… | |
941 | |
950 | |
942 | =item $string = $term->locale_decode ($octets) |
951 | =item $string = $term->locale_decode ($octets) |
943 | |
952 | |
944 | Convert the given locale-encoded octets into a perl string. |
953 | Convert the given locale-encoded octets into a perl string. |
945 | |
954 | |
|
|
955 | =item $term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle]) |
|
|
956 | |
|
|
957 | XORs the rendition values in the given span with the provided value |
|
|
958 | (default: C<RS_RVid>). Useful in refresh hooks to provide effects similar |
|
|
959 | to the selection. |
|
|
960 | |
|
|
961 | =item $term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, $rstyle2]]) |
|
|
962 | |
|
|
963 | Similar to C<scr_xor_span>, but xors a rectangle instead. Trailing |
|
|
964 | whitespace will additionally be xored with the C<$rstyle2>, which defaults |
|
|
965 | to C<RS_RVid | RS_Uline>, which removes reverse video again and underlines |
|
|
966 | it instead. |
|
|
967 | |
946 | =item $term->scr_bell |
968 | =item $term->scr_bell |
947 | |
969 | |
948 | Ring the bell! |
970 | Ring the bell! |
949 | |
971 | |
950 | =item $term->scr_add_lines ($string) |
972 | =item $term->scr_add_lines ($string) |