… | |
… | |
134 | rxvtperl \- rxvt\-unicode's embedded perl interpreter |
134 | rxvtperl \- rxvt\-unicode's embedded perl interpreter |
135 | .SH "SYNOPSIS" |
135 | .SH "SYNOPSIS" |
136 | .IX Header "SYNOPSIS" |
136 | .IX Header "SYNOPSIS" |
137 | * Put your scripts into \fI@@RXVT_LIBDIR@@/urxvt/perl\-ext/\fR, they will be loaded automatically. |
137 | * Put your scripts into \fI@@RXVT_LIBDIR@@/urxvt/perl\-ext/\fR, they will be loaded automatically. |
138 | .PP |
138 | .PP |
139 | * Each script will only be loaded once, even in urxvtd, and will be valid |
|
|
140 | globally. |
|
|
141 | .PP |
|
|
142 | * Scripts are evaluated in a 'use strict' and 'use utf8' environment, and |
139 | * Scripts are evaluated in a 'use strict' and 'use utf8' environment, and |
143 | thus must be encoded as \s-1UTF\-8\s0. |
140 | thus must be encoded as \s-1UTF\-8\s0. |
144 | .PP |
141 | .PP |
145 | .Vb 4 |
142 | .Vb 4 |
146 | \& sub on_sel_grab { |
143 | \& sub on_sel_grab { |
… | |
… | |
152 | .Vb 1 |
149 | .Vb 1 |
153 | \& 1 |
150 | \& 1 |
154 | .Ve |
151 | .Ve |
155 | .SH "DESCRIPTION" |
152 | .SH "DESCRIPTION" |
156 | .IX Header "DESCRIPTION" |
153 | .IX Header "DESCRIPTION" |
|
|
154 | On startup, @@RXVT_NAME@@ will scan \fI@@RXVT_LIBDIR@@/urxvt/perl\-ext/\fR |
|
|
155 | for files and will load them. Everytime a terminal object gets created, |
|
|
156 | the directory specified by the \f(CW\*(C`perl\-lib\*(C'\fR resource will be additionally |
|
|
157 | scanned. |
|
|
158 | .PP |
|
|
159 | Each script will only ever be loaded once, even in @@RXVT_NAME@@d, where |
|
|
160 | scripts will be shared for all terminals. |
|
|
161 | .PP |
|
|
162 | Hooks in scripts specified by \f(CW\*(C`perl\-lib\*(C'\fR will only be called for the |
|
|
163 | terminals created with that specific option value. |
|
|
164 | .Sh "General \s-1API\s0 Considerations" |
|
|
165 | .IX Subsection "General API Considerations" |
|
|
166 | All objects (such as terminals, time watchers etc.) are typical |
|
|
167 | reference-to-hash objects. The hash can be used to store anything you |
|
|
168 | like. All members starting with an underscore (such as \f(CW\*(C`_ptr\*(C'\fR or |
|
|
169 | \&\f(CW\*(C`_hook\*(C'\fR) are reserved for internal uses and must not be accessed or |
|
|
170 | modified). |
|
|
171 | .PP |
|
|
172 | When objects are destroyed on the \*(C+ side, the perl object hashes are |
|
|
173 | emptied, so its best to store related objects such as time watchers and |
|
|
174 | the like inside the terminal object so they get destroyed as soon as the |
|
|
175 | terminal is destroyed. |
157 | .Sh "Hooks" |
176 | .Sh "Hooks" |
158 | .IX Subsection "Hooks" |
177 | .IX Subsection "Hooks" |
159 | The following subroutines can be declared in loaded scripts, and will be called |
178 | The following subroutines can be declared in loaded scripts, and will be called |
160 | whenever the relevant event happens. |
179 | whenever the relevant event happens. |
161 | .PP |
180 | .PP |
… | |
… | |
248 | costs! The only time this is acceptable is when the terminal process |
267 | costs! The only time this is acceptable is when the terminal process |
249 | starts up. |
268 | starts up. |
250 | .ie n .IP "urxvt::warn $string" 4 |
269 | .ie n .IP "urxvt::warn $string" 4 |
251 | .el .IP "urxvt::warn \f(CW$string\fR" 4 |
270 | .el .IP "urxvt::warn \f(CW$string\fR" 4 |
252 | .IX Item "urxvt::warn $string" |
271 | .IX Item "urxvt::warn $string" |
253 | Calls \f(CW\*(C`rxvt_warn\*(C'\fR witht eh given string which should not include a |
272 | Calls \f(CW\*(C`rxvt_warn\*(C'\fR with the given string which should not include a |
254 | newline. The module also overwrites the \f(CW\*(C`warn\*(C'\fR builtin with a function |
273 | newline. The module also overwrites the \f(CW\*(C`warn\*(C'\fR builtin with a function |
255 | that calls this function. |
274 | that calls this function. |
256 | .Sp |
275 | .Sp |
257 | Using this function has the advantage that its output ends up in the |
276 | Using this function has the advantage that its output ends up in the |
258 | correct place, e.g. on stderr of the connecting urxvtc client. |
277 | correct place, e.g. on stderr of the connecting urxvtc client. |
259 | .ie n .IP "$cellwidth = urxvt::wcswidth $string" 4 |
|
|
260 | .el .IP "$cellwidth = urxvt::wcswidth \f(CW$string\fR" 4 |
|
|
261 | .IX Item "$cellwidth = urxvt::wcswidth $string" |
|
|
262 | Returns the number of screen-cells this string would need. Correctly |
|
|
263 | accounts for wide and combining characters. |
|
|
264 | .IP "$time = urxvt::NOW" 4 |
278 | .IP "$time = urxvt::NOW" 4 |
265 | .IX Item "$time = urxvt::NOW" |
279 | .IX Item "$time = urxvt::NOW" |
266 | Returns the \*(L"current time\*(R" (as per the event loop). |
280 | Returns the \*(L"current time\*(R" (as per the event loop). |
267 | .ie n .Sh "The ""urxvt::term"" Class" |
281 | .ie n .Sh "The ""urxvt::term"" Class" |
268 | .el .Sh "The \f(CWurxvt::term\fP Class" |
282 | .el .Sh "The \f(CWurxvt::term\fP Class" |
… | |
… | |
293 | \& answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont |
307 | \& answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont |
294 | \& borderLess color cursorBlink cursorUnderline cutchars delete_key |
308 | \& borderLess color cursorBlink cursorUnderline cutchars delete_key |
295 | \& display_name embed ext_bwidth fade font geometry hold iconName |
309 | \& display_name embed ext_bwidth fade font geometry hold iconName |
296 | \& imFont imLocale inputMethod insecure int_bwidth intensityStyles |
310 | \& imFont imLocale inputMethod insecure int_bwidth intensityStyles |
297 | \& italicFont jumpScroll lineSpace loginShell mapAlert menu meta8 |
311 | \& italicFont jumpScroll lineSpace loginShell mapAlert menu meta8 |
298 | \& modifier mouseWheelScrollPage name pastableTabs path pointerBlank |
312 | \& modifier mouseWheelScrollPage name pastableTabs path perl perl_eval |
299 | \& pointerBlankDelay preeditType print_pipe pty_fd reverseVideo saveLines |
313 | \& perl_lib pointerBlank pointerBlankDelay preeditType print_pipe pty_fd |
300 | \& scrollBar scrollBar_align scrollBar_floating scrollBar_right |
314 | \& reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating |
301 | \& scrollBar_thickness scrollTtyKeypress scrollTtyOutput scrollWithBuffer |
315 | \& scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput |
302 | \& scrollstyle secondaryScreen secondaryScroll selectstyle shade term_name |
316 | \& scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle |
303 | \& title transparent transparent_all tripleclickwords utmpInhibit |
317 | \& shade term_name title transparent transparent_all tripleclickwords |
304 | \& visualBell |
318 | \& utmpInhibit visualBell |
305 | .Ve |
319 | .Ve |
306 | .ie n .IP "($row, $col\fR) = \f(CW$term\fR\->selection_mark ([$row, \f(CW$col])" 4 |
320 | .ie n .IP "($row, $col\fR) = \f(CW$term\fR\->selection_mark ([$row, \f(CW$col])" 4 |
307 | .el .IP "($row, \f(CW$col\fR) = \f(CW$term\fR\->selection_mark ([$row, \f(CW$col\fR])" 4 |
321 | .el .IP "($row, \f(CW$col\fR) = \f(CW$term\fR\->selection_mark ([$row, \f(CW$col\fR])" 4 |
308 | .IX Item "($row, $col) = $term->selection_mark ([$row, $col])" |
322 | .IX Item "($row, $col) = $term->selection_mark ([$row, $col])" |
309 | .PD 0 |
323 | .PD 0 |
… | |
… | |
346 | position. |
360 | position. |
347 | .ie n .IP "$term\->scr_overlay_set ($x, $y\fR, \f(CW$text)" 4 |
361 | .ie n .IP "$term\->scr_overlay_set ($x, $y\fR, \f(CW$text)" 4 |
348 | .el .IP "$term\->scr_overlay_set ($x, \f(CW$y\fR, \f(CW$text\fR)" 4 |
362 | .el .IP "$term\->scr_overlay_set ($x, \f(CW$y\fR, \f(CW$text\fR)" 4 |
349 | .IX Item "$term->scr_overlay_set ($x, $y, $text)" |
363 | .IX Item "$term->scr_overlay_set ($x, $y, $text)" |
350 | Write a string at the given position into the overlay. |
364 | Write a string at the given position into the overlay. |
|
|
365 | .ie n .IP "$cellwidth = $term\fR\->strwidth \f(CW$string" 4 |
|
|
366 | .el .IP "$cellwidth = \f(CW$term\fR\->strwidth \f(CW$string\fR" 4 |
|
|
367 | .IX Item "$cellwidth = $term->strwidth $string" |
|
|
368 | Returns the number of screen-cells this string would need. Correctly |
|
|
369 | accounts for wide and combining characters. |
|
|
370 | .ie n .IP "$octets = $term\fR\->locale_encode \f(CW$string" 4 |
|
|
371 | .el .IP "$octets = \f(CW$term\fR\->locale_encode \f(CW$string\fR" 4 |
|
|
372 | .IX Item "$octets = $term->locale_encode $string" |
|
|
373 | Convert the given text string into the corresponding locale encoding. |
|
|
374 | .ie n .IP "$string = $term\fR\->locale_decode \f(CW$octets" 4 |
|
|
375 | .el .IP "$string = \f(CW$term\fR\->locale_decode \f(CW$octets\fR" 4 |
|
|
376 | .IX Item "$string = $term->locale_decode $octets" |
|
|
377 | Convert the given locale-encoded octets into a perl string. |
|
|
378 | .IP "$term\->tt_write ($octets)" 4 |
|
|
379 | .IX Item "$term->tt_write ($octets)" |
|
|
380 | Write the octets given in \f(CW$data\fR to the tty (i.e. as program input). To |
|
|
381 | pass characters instead of octets, you should convetr you strings first to |
|
|
382 | the locale-specific encoding using \f(CW\*(C`$term\->locale_encode\*(C'\fR. |
351 | .ie n .Sh "The ""urxvt::timer"" Class" |
383 | .ie n .Sh "The ""urxvt::timer"" Class" |
352 | .el .Sh "The \f(CWurxvt::timer\fP Class" |
384 | .el .Sh "The \f(CWurxvt::timer\fP Class" |
353 | .IX Subsection "The urxvt::timer Class" |
385 | .IX Subsection "The urxvt::timer Class" |
354 | This class implements timer watchers/events. Time is represented as a |
386 | This class implements timer watchers/events. Time is represented as a |
355 | fractional number of seconds since the epoch. Example: |
387 | fractional number of seconds since the epoch. Example: |