… | |
… | |
60 | |
60 | |
61 | =item digital-clock |
61 | =item digital-clock |
62 | |
62 | |
63 | Displays a digital clock using the built-in overlay. |
63 | Displays a digital clock using the built-in overlay. |
64 | |
64 | |
|
|
65 | =item mark-urls |
|
|
66 | |
|
|
67 | Uses per-line filtering (C<on_line_update>) to underline urls. |
|
|
68 | |
65 | =item example-refresh-hooks |
69 | =item example-refresh-hooks |
66 | |
70 | |
67 | Displays a very simple digital clock in the upper right corner of the |
71 | Displays a very simple digital clock in the upper right corner of the |
68 | window. Illustrates overwriting the refresh callbacks to create your own |
72 | window. Illustrates overwriting the refresh callbacks to create your own |
69 | overlays or changes. |
73 | overlays or changes. |
70 | |
74 | |
71 | =item mark-urls |
75 | =item example-filter-input |
72 | |
76 | |
73 | A not very useful example of filtering all text output to the terminal, by |
77 | A not very useful example of filtering all text output to the terminal, by |
74 | underlining all urls that matches a certain regex (i.e. some urls :). It |
78 | underlining all urls that matches a certain regex (i.e. some urls :). It |
75 | is not very useful because urls that are output in multiple steps (e.g. |
79 | is not very useful because urls that are output in multiple steps (e.g. |
76 | when typing them) do not get marked. |
80 | when typing them) do not get marked. |
… | |
… | |
222 | Called whenever text is about to be output, with the text as argument. You |
226 | Called whenever text is about to be output, with the text as argument. You |
223 | can filter/change and output the text yourself by returning a true value |
227 | can filter/change and output the text yourself by returning a true value |
224 | and calling C<< $term->scr_add_lines >> yourself. Please note that this |
228 | and calling C<< $term->scr_add_lines >> yourself. Please note that this |
225 | might be very slow, however, as your hook is called for B<all> text being |
229 | might be very slow, however, as your hook is called for B<all> text being |
226 | output. |
230 | output. |
|
|
231 | |
|
|
232 | =item on_line_update $term, $row |
|
|
233 | |
|
|
234 | Called whenever a line was updated or changed. Can be used to filter |
|
|
235 | screen output (e.g. underline urls or other useless stuff). Only lines |
|
|
236 | that are being shown will be filtered, and, due to performance reasons, |
|
|
237 | not always immediately. |
|
|
238 | |
|
|
239 | The row number is always the topmost row of the line if the line spans |
|
|
240 | multiple rows. |
|
|
241 | |
|
|
242 | Please note that, if you change the line, then the hook might get called |
|
|
243 | later with the already-modified line (e.g. if unrelated parts change), so |
|
|
244 | you cannot just toggle rendition bits, but only set them. |
227 | |
245 | |
228 | =item on_refresh_begin $term |
246 | =item on_refresh_begin $term |
229 | |
247 | |
230 | Called just before the screen gets redrawn. Can be used for overlay |
248 | Called just before the screen gets redrawn. Can be used for overlay |
231 | or similar effects by modify terminal contents in refresh_begin, and |
249 | or similar effects by modify terminal contents in refresh_begin, and |
… | |
… | |
735 | about the logical line that row C<$row_number> is part of. It supports the |
753 | about the logical line that row C<$row_number> is part of. It supports the |
736 | following methods: |
754 | following methods: |
737 | |
755 | |
738 | =over 4 |
756 | =over 4 |
739 | |
757 | |
740 | =item $text = $line->t |
758 | =item $text = $line->t ([$new_text]) |
741 | |
759 | |
742 | Returns the full text of the line, similar to C<ROW_t> |
760 | Returns or replaces the full text of the line, similar to C<ROW_t> |
743 | |
761 | |
744 | =item $rend = $line->r |
762 | =item $rend = $line->r ([$new_rend]) |
745 | |
763 | |
746 | Returns the full rendition array of the line, similar to C<ROW_r> |
764 | Returns or replaces the full rendition array of the line, similar to C<ROW_r> |
747 | |
765 | |
748 | =item $length = $line->l |
766 | =item $length = $line->l |
749 | |
767 | |
750 | Returns the length of the line in cells, similar to C<ROW_l>. |
768 | Returns the length of the line in cells, similar to C<ROW_l>. |
751 | |
769 | |