… | |
… | |
230 | =item on_sel_extend $term |
230 | =item on_sel_extend $term |
231 | |
231 | |
232 | Called whenever the user tries to extend the selection (e.g. with a double |
232 | Called whenever the user tries to extend the selection (e.g. with a double |
233 | click) and is either supposed to return false (normal operation), or |
233 | click) and is either supposed to return false (normal operation), or |
234 | should extend the selection itelf and return true to suppress the built-in |
234 | should extend the selection itelf and return true to suppress the built-in |
235 | processing. |
235 | processing. This can happen multiple times, as long as the callback |
|
|
236 | returns true, it will be called on every further click by the user and is |
|
|
237 | supposed to enlarge the selection more and more, if possible. |
236 | |
238 | |
237 | See the F<selection> example extension. |
239 | See the F<selection> example extension. |
238 | |
240 | |
239 | =item on_view_change $term, $offset |
241 | =item on_view_change $term, $offset |
240 | |
242 | |
… | |
… | |
595 | if ($@) { |
597 | if ($@) { |
596 | $TERM->ungrab; # better to lose the grab than the session |
598 | $TERM->ungrab; # better to lose the grab than the session |
597 | warn $@; |
599 | warn $@; |
598 | } |
600 | } |
599 | } |
601 | } |
|
|
602 | |
|
|
603 | verbose 11, "$HOOKNAME[$htype] returning <$retval>" |
|
|
604 | if $verbosity >= 11; |
600 | } |
605 | } |
601 | |
606 | |
602 | if ($htype == 1) { # DESTROY |
607 | if ($htype == 1) { # DESTROY |
603 | if (my $hook = delete $TERM->{_hook}) { |
608 | if (my $hook = delete $TERM->{_hook}) { |
604 | for my $htype (0..$#$hook) { |
609 | for my $htype (0..$#$hook) { |
… | |
… | |
613 | # clear package |
618 | # clear package |
614 | %$TERM = (); |
619 | %$TERM = (); |
615 | } |
620 | } |
616 | |
621 | |
617 | $retval |
622 | $retval |
|
|
623 | } |
|
|
624 | |
|
|
625 | sub exec_async(@) { |
|
|
626 | my $pid = fork; |
|
|
627 | |
|
|
628 | return |
|
|
629 | if !defined $pid or $pid; |
|
|
630 | |
|
|
631 | %ENV = %{ $TERM->env }; |
|
|
632 | |
|
|
633 | exec @_; |
|
|
634 | _exit 255; |
618 | } |
635 | } |
619 | |
636 | |
620 | # urxvt::term::extension |
637 | # urxvt::term::extension |
621 | |
638 | |
622 | package urxvt::term::extension; |
639 | package urxvt::term::extension; |
… | |
… | |
898 | =item ($row, $col) = $term->selection_end ([$row, $col]) |
915 | =item ($row, $col) = $term->selection_end ([$row, $col]) |
899 | |
916 | |
900 | Return the current values of the selection mark, begin or end positions, |
917 | Return the current values of the selection mark, begin or end positions, |
901 | and optionally set them to new values. |
918 | and optionally set them to new values. |
902 | |
919 | |
|
|
920 | =item $term->selection_make ($eventtime[, $rectangular]) |
|
|
921 | |
|
|
922 | Tries to make a selection as set by C<selection_beg> and |
|
|
923 | C<selection_end>. If C<$rectangular> is true (default: false), a |
|
|
924 | rectangular selection will be made. This is the prefered function to make |
|
|
925 | a selection. |
|
|
926 | |
903 | =item $success = $term->selection_grab ($eventtime) |
927 | =item $success = $term->selection_grab ($eventtime) |
904 | |
928 | |
905 | Try to request the primary selection from the server (for example, as set |
929 | Try to request the primary selection text from the server (for example, as |
906 | by the next method). |
930 | set by the next method). No visual feedback will be given. This function |
|
|
931 | is mostly useful from within C<on_sel_grab> hooks. |
907 | |
932 | |
908 | =item $oldtext = $term->selection ([$newtext]) |
933 | =item $oldtext = $term->selection ([$newtext]) |
909 | |
934 | |
910 | Return the current selection text and optionally replace it by C<$newtext>. |
935 | Return the current selection text and optionally replace it by C<$newtext>. |
911 | |
936 | |
… | |
… | |
1004 | Convert the given locale-encoded octets into a perl string. |
1029 | Convert the given locale-encoded octets into a perl string. |
1005 | |
1030 | |
1006 | =item $term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle]) |
1031 | =item $term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle]) |
1007 | |
1032 | |
1008 | XORs the rendition values in the given span with the provided value |
1033 | XORs the rendition values in the given span with the provided value |
1009 | (default: C<RS_RVid>). Useful in refresh hooks to provide effects similar |
1034 | (default: C<RS_RVid>), which I<MUST NOT> contain font styles. Useful in |
1010 | to the selection. |
1035 | refresh hooks to provide effects similar to the selection. |
1011 | |
1036 | |
1012 | =item $term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, $rstyle2]]) |
1037 | =item $term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, $rstyle2]]) |
1013 | |
1038 | |
1014 | Similar to C<scr_xor_span>, but xors a rectangle instead. Trailing |
1039 | Similar to C<scr_xor_span>, but xors a rectangle instead. Trailing |
1015 | whitespace will additionally be xored with the C<$rstyle2>, which defaults |
1040 | whitespace will additionally be xored with the C<$rstyle2>, which defaults |
1016 | to C<RS_RVid | RS_Uline>, which removes reverse video again and underlines |
1041 | to C<RS_RVid | RS_Uline>, which removes reverse video again and underlines |
1017 | it instead. |
1042 | it instead. Both styles I<MUST NOT> contain font styles. |
1018 | |
1043 | |
1019 | =item $term->scr_bell |
1044 | =item $term->scr_bell |
1020 | |
1045 | |
1021 | Ring the bell! |
1046 | Ring the bell! |
1022 | |
1047 | |
… | |
… | |
1206 | Return the row number of the first/last row of the line, respectively. |
1231 | Return the row number of the first/last row of the line, respectively. |
1207 | |
1232 | |
1208 | =item $offset = $line->offset_of ($row, $col) |
1233 | =item $offset = $line->offset_of ($row, $col) |
1209 | |
1234 | |
1210 | Returns the character offset of the given row|col pair within the logical |
1235 | Returns the character offset of the given row|col pair within the logical |
1211 | line. |
1236 | line. Works for rows outside the line, too, and returns corresponding |
|
|
1237 | offsets outside the string. |
1212 | |
1238 | |
1213 | =item ($row, $col) = $line->coord_of ($offset) |
1239 | =item ($row, $col) = $line->coord_of ($offset) |
1214 | |
1240 | |
1215 | Translates a string offset into terminal coordinates again. |
1241 | Translates a string offset into terminal coordinates again. |
1216 | |
1242 | |
… | |
… | |
1571 | |
1597 | |
1572 | =item == 0 - fatal messages |
1598 | =item == 0 - fatal messages |
1573 | |
1599 | |
1574 | =item >= 3 - script loading and management |
1600 | =item >= 3 - script loading and management |
1575 | |
1601 | |
1576 | =item >=10 - all events received |
1602 | =item >=10 - all called hooks |
|
|
1603 | |
|
|
1604 | =item >=11 - hook reutrn values |
1577 | |
1605 | |
1578 | =back |
1606 | =back |
1579 | |
1607 | |
1580 | =head1 AUTHOR |
1608 | =head1 AUTHOR |
1581 | |
1609 | |