ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/doc/rxvtperl.3.txt
(Generate patch)

Comparing rxvt-unicode/doc/rxvtperl.3.txt (file contents):
Revision 1.6 by root, Tue Jan 3 04:20:37 2006 UTC vs.
Revision 1.7 by root, Tue Jan 3 21:15:22 2006 UTC

30 You can activate them like this: 30 You can activate them like this:
31 31
32 rxvt -pe <extensionname> 32 rxvt -pe <extensionname>
33 33
34 selection 34 selection
35 Miscellaneous selection modifications. 35 Intelligent selection. This etxension tries to be more intelligent
36 when the user extends selections (double-click).
37
38 It also offers the following bindable event:
36 39
37 rot13 40 rot13
38 Rot-13 the selection when activated. Used via keyboard trigger: 41 Rot-13 the selection when activated. Used via keyboard trigger:
39 42
40 URxvt.keysym.C-M-r: perl:selection:rot13 43 URxvt.keysym.C-M-r: perl:selection:rot13
49 52
50 General API Considerations 53 General API Considerations
51 All objects (such as terminals, time watchers etc.) are typical 54 All objects (such as terminals, time watchers etc.) are typical
52 reference-to-hash objects. The hash can be used to store anything you 55 reference-to-hash objects. The hash can be used to store anything you
53 like. All members starting with an underscore (such as "_ptr" or 56 like. All members starting with an underscore (such as "_ptr" or
54 "_hook") are reserved for internal uses and must not be accessed or 57 "_hook") are reserved for internal uses and MUST NOT be accessed or
55 modified). 58 modified).
56 59
57 When objects are destroyed on the C++ side, the perl object hashes are 60 When objects are destroyed on the C++ side, the perl object hashes are
58 emptied, so its best to store related objects such as time watchers and 61 emptied, so its best to store related objects such as time watchers and
59 the like inside the terminal object so they get destroyed as soon as the 62 the like inside the terminal object so they get destroyed as soon as the
61 64
62 Hooks 65 Hooks
63 The following subroutines can be declared in loaded scripts, and will be 66 The following subroutines can be declared in loaded scripts, and will be
64 called whenever the relevant event happens. 67 called whenever the relevant event happens.
65 68
69 The first argument passed to them is an object private to each terminal
70 and extension package. You can call all "urxvt::term" methods on it, but
71 its not a real "urxvt::term" object. Instead, the real "urxvt::term"
72 object that is shared between all packages is stored in the "term"
73 member.
74
66 All of them must return a boolean value. If it is true, then the event 75 All of them must return a boolean value. If it is true, then the event
67 counts as being *consumed*, and the invocation of other hooks is 76 counts as being *consumed*, and the invocation of other hooks is
68 skipped, and the relevant action might not be carried out by the C++ 77 skipped, and the relevant action might not be carried out by the C++
69 code. 78 code.
70 79
97 selection is requested from the server. The selection text can be 106 selection is requested from the server. The selection text can be
98 queried and changed by calling "$term->selection". 107 queried and changed by calling "$term->selection".
99 108
100 Returning a true value aborts selection grabbing. It will still be 109 Returning a true value aborts selection grabbing. It will still be
101 hilighted. 110 hilighted.
111
112 on_sel_extend $term
113 Called whenever the user tries to extend the selection (e.g. with a
114 double click) and is either supposed to return false (normal
115 operation), or should extend the selection itelf and return true to
116 suppress the built-in processing.
117
118 See the selection example extension.
102 119
103 on_focus_in $term 120 on_focus_in $term
104 Called whenever the window gets the keyboard focus, before urxvt 121 Called whenever the window gets the keyboard focus, before urxvt
105 does focus in processing. 122 does focus in processing.
106 123
137 154
138 on_keyboard_command $term, $string 155 on_keyboard_command $term, $string
139 Called whenever the user presses a key combination that has a 156 Called whenever the user presses a key combination that has a
140 "perl:string" action bound to it (see description of the keysym 157 "perl:string" action bound to it (see description of the keysym
141 resource in the rxvt(1) manpage). 158 resource in the rxvt(1) manpage).
159
160 Variables in the "urxvt" Package
161 $urxvt::TERM
162 The current terminal. Whenever a callback/Hook is bein executed,
163 this variable stores the current "urxvt::term" object.
142 164
143 Functions in the "urxvt" Package 165 Functions in the "urxvt" Package
144 urxvt::fatal $errormessage 166 urxvt::fatal $errormessage
145 Fatally aborts execution with the given error message. Avoid at all 167 Fatally aborts execution with the given error message. Avoid at all
146 costs! The only time this is acceptable is when the terminal process 168 costs! The only time this is acceptable is when the terminal process
273 right/bottom side, respectively. 295 right/bottom side, respectively.
274 296
275 This method returns an urxvt::overlay object. The overlay will be 297 This method returns an urxvt::overlay object. The overlay will be
276 visible as long as the perl object is referenced. 298 visible as long as the perl object is referenced.
277 299
278 Currently, the only method on the "urxvt::overlay" object is "set": 300 The methods currently supported on "urxvt::overlay" objects are:
279 301
280 $overlay->set ($x, $y, $text, $rend) 302 $overlay->set ($x, $y, $text, $rend)
281 Similar to "$term->ROW_t" and "$term->ROW_r" in that it puts text in 303 Similar to "$term->ROW_t" and "$term->ROW_r" in that it puts
282 rxvt-unicode's special encoding and an array of rendition values at 304 text in rxvt-unicode's special encoding and an array of
283 a specific position inside the overlay. 305 rendition values at a specific position inside the overlay.
306
307 $overlay->hide
308 If visible, hide the overlay, but do not destroy it.
309
310 $overlay->show
311 If hidden, display the overlay again.
284 312
285 $cellwidth = $term->strwidth $string 313 $cellwidth = $term->strwidth $string
286 Returns the number of screen-cells this string would need. Correctly 314 Returns the number of screen-cells this string would need. Correctly
287 accounts for wide and combining characters. 315 accounts for wide and combining characters.
288 316
321 349
322 $text = $term->ROW_t ($row_number[, $new_text[, $start_col]]) 350 $text = $term->ROW_t ($row_number[, $new_text[, $start_col]])
323 Returns the text of the entire row with number $row_number. Row 0 is 351 Returns the text of the entire row with number $row_number. Row 0 is
324 the topmost terminal line, row "$term->$ncol-1" is the bottommost 352 the topmost terminal line, row "$term->$ncol-1" is the bottommost
325 terminal line. The scrollback buffer starts at line -1 and extends 353 terminal line. The scrollback buffer starts at line -1 and extends
326 to line "-$term->nsaved". 354 to line "-$term->nsaved". Nothing will be returned if a nonexistent
355 line is requested.
327 356
328 If $new_text is specified, it will replace characters in the current 357 If $new_text is specified, it will replace characters in the current
329 line, starting at column $start_col (default 0), which is useful to 358 line, starting at column $start_col (default 0), which is useful to
330 replace only parts of a line. The font index in the rendition will 359 replace only parts of a line. The font index in the rendition will
331 automatically be updated. 360 automatically be updated.
352 381
353 See the section on RENDITION, above. 382 See the section on RENDITION, above.
354 383
355 $length = $term->ROW_l ($row_number[, $new_length]) 384 $length = $term->ROW_l ($row_number[, $new_length])
356 Returns the number of screen cells that are in use ("the line 385 Returns the number of screen cells that are in use ("the line
357 length"). If it is -1, then the line is part of a multiple-row 386 length"). Unlike the urxvt core, this returns "$term->ncol" if the
358 logical "line", which means all characters are in use and it is 387 line is joined with the following one.
359 continued on the next row.
360 388
389 $bool = $term->is_longer ($row_number)
390 Returns true if the row is part of a multiple-row logical "line"
391 (i.e. joined with the following row), which means all characters are
392 in use and it is continued on the next row (and possibly a
393 continuation of the previous row(s)).
394
395 $line = $term->line ($row_number)
396 Create and return a new "urxvt::line" object that stores information
397 about the logical line that row $row_number is part of. It supports
398 the following methods:
399
400 $text = $line->t
401 Returns the full text of the line, similar to "ROW_t"
402
403 $rend = $line->r
404 Returns the full rendition array of the line, similar to "ROW_r"
405
406 $length = $line->l
407 Returns the length of the line in cells, similar to "ROW_l".
408
409 $rownum = $line->beg
410 $rownum = $line->end
411 Return the row number of the first/last row of the line,
412 respectively.
413
414 $offset = $line->offset_of ($row, $col)
415 Returns the character offset of the given row|col pair within
416 the logical line.
417
418 ($row, $col) = $line->coord_of ($offset)
419 Translates a string offset into terminal coordinates again.
420
421 ($row, $col) = $line->coord_of ($offset) =item $text =
361 $text = $term->special_encode $string 422 $term->special_encode $string
362 Converts a perl string into the special encoding used by 423 Converts a perl string into the special encoding used by
363 rxvt-unicode, where one character corresponds to one screen cell. 424 rxvt-unicode, where one character corresponds to one screen cell.
364 See "$term->ROW_t" for details. 425 See "$term->ROW_t" for details.
365 426
366 $string = $term->special_decode $text 427 $string = $term->special_decode $text

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines