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

Comparing rxvt-unicode/doc/rxvtperl.3.html (file contents):
Revision 1.8 by root, Tue Jan 3 04:20:37 2006 UTC vs.
Revision 1.10 by root, Tue Jan 3 23:41:37 2006 UTC

18 <ul> 18 <ul>
19 19
20 <li><a href="#prepackaged_extensions">Prepackaged Extensions</a></li> 20 <li><a href="#prepackaged_extensions">Prepackaged Extensions</a></li>
21 <li><a href="#general_api_considerations">General API Considerations</a></li> 21 <li><a href="#general_api_considerations">General API Considerations</a></li>
22 <li><a href="#hooks">Hooks</a></li> 22 <li><a href="#hooks">Hooks</a></li>
23 <li><a href="#variables_in_the_urxvt_package">Variables in the <code>urxvt</code> Package</a></li>
23 <li><a href="#functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></li> 24 <li><a href="#functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></li>
24 <li><a href="#rendition">RENDITION</a></li> 25 <li><a href="#rendition">RENDITION</a></li>
25 <li><a href="#the_urxvt__term_class">The <code>urxvt::term</code> Class</a></li> 26 <li><a href="#the_urxvt__term_class">The <code>urxvt::term</code> Class</a></li>
26 <li><a href="#the_urxvt__timer_class">The <code>urxvt::timer</code> Class</a></li> 27 <li><a href="#the_urxvt__timer_class">The <code>urxvt::timer</code> Class</a></li>
27 <li><a href="#the_urxvt__iow_class">The <code>urxvt::iow</code> Class</a></li> 28 <li><a href="#the_urxvt__iow_class">The <code>urxvt::iow</code> Class</a></li>
78 rxvt -pe &lt;extensionname&gt;</pre> 79 rxvt -pe &lt;extensionname&gt;</pre>
79<dl> 80<dl>
80<dt><strong><a name="item_selection">selection</a></strong><br /> 81<dt><strong><a name="item_selection">selection</a></strong><br />
81</dt> 82</dt>
82<dd> 83<dd>
83Miscellaneous selection modifications. 84Intelligent selection. This extension tries to be more intelligent when
85the user extends selections (double-click). Right now, it tries to select
86urls and complete shell-quoted arguments, which is very convenient, too,
87if your <em>ls</em> supports <code>--quoting-style=shell</code>.
88</dd>
89<dd>
90<p>It also offers the following bindable event:</p>
84</dd> 91</dd>
85<dl> 92<dl>
86<dt><strong><a name="item_rot13">rot13</a></strong><br /> 93<dt><strong><a name="item_rot13">rot13</a></strong><br />
87</dt> 94</dt>
88<dd> 95<dd>
111</p> 118</p>
112<h2><a name="general_api_considerations">General API Considerations</a></h2> 119<h2><a name="general_api_considerations">General API Considerations</a></h2>
113<p>All objects (such as terminals, time watchers etc.) are typical 120<p>All objects (such as terminals, time watchers etc.) are typical
114reference-to-hash objects. The hash can be used to store anything you 121reference-to-hash objects. The hash can be used to store anything you
115like. All members starting with an underscore (such as <code>_ptr</code> or 122like. All members starting with an underscore (such as <code>_ptr</code> or
116<code>_hook</code>) are reserved for internal uses and must not be accessed or 123<code>_hook</code>) are reserved for internal uses and <strong>MUST NOT</strong> be accessed or
117modified).</p> 124modified).</p>
118<p>When objects are destroyed on the C++ side, the perl object hashes are 125<p>When objects are destroyed on the C++ side, the perl object hashes are
119emptied, so its best to store related objects such as time watchers and 126emptied, so its best to store related objects such as time watchers and
120the like inside the terminal object so they get destroyed as soon as the 127the like inside the terminal object so they get destroyed as soon as the
121terminal is destroyed.</p> 128terminal is destroyed.</p>
122<p> 129<p>
123</p> 130</p>
124<h2><a name="hooks">Hooks</a></h2> 131<h2><a name="hooks">Hooks</a></h2>
125<p>The following subroutines can be declared in loaded scripts, and will be called 132<p>The following subroutines can be declared in loaded scripts, and will be
126whenever the relevant event happens.</p> 133called whenever the relevant event happens.</p>
134<p>The first argument passed to them is an object private to each terminal
135and extension package. You can call all <code>urxvt::term</code> methods on it, but
136its not a real <code>urxvt::term</code> object. Instead, the real <code>urxvt::term</code>
137object that is shared between all packages is stored in the <code>term</code>
138member.</p>
127<p>All of them must return a boolean value. If it is true, then the event 139<p>All of them must return a boolean value. If it is true, then the event
128counts as being <em>consumed</em>, and the invocation of other hooks is skipped, 140counts as being <em>consumed</em>, and the invocation of other hooks is skipped,
129and the relevant action might not be carried out by the C++ code.</p> 141and the relevant action might not be carried out by the C++ code.</p>
130<p>When in doubt, return a false value (preferably <code>()</code>).</p> 142<p>When in doubt, return a false value (preferably <code>()</code>).</p>
131<dl> 143<dl>
172</dd> 184</dd>
173<dd> 185<dd>
174<p>Returning a true value aborts selection grabbing. It will still be hilighted.</p> 186<p>Returning a true value aborts selection grabbing. It will still be hilighted.</p>
175</dd> 187</dd>
176<p></p> 188<p></p>
189<dt><strong><a name="item_on_sel_extend__24term">on_sel_extend $term</a></strong><br />
190</dt>
191<dd>
192Called whenever the user tries to extend the selection (e.g. with a double
193click) and is either supposed to return false (normal operation), or
194should extend the selection itelf and return true to suppress the built-in
195processing.
196</dd>
197<dd>
198<p>See the <em>selection</em> example extension.</p>
199</dd>
200<p></p>
177<dt><strong><a name="item_on_focus_in__24term">on_focus_in $term</a></strong><br /> 201<dt><strong><a name="item_on_focus_in__24term">on_focus_in $term</a></strong><br />
178</dt> 202</dt>
179<dd> 203<dd>
180Called whenever the window gets the keyboard focus, before urxvt does 204Called whenever the window gets the keyboard focus, before urxvt does
181focus in processing. 205focus in processing.
234</dt> 258</dt>
235<dd> 259<dd>
236Called whenever the user presses a key combination that has a 260Called whenever the user presses a key combination that has a
237<code>perl:string</code> action bound to it (see description of the <strong>keysym</strong> 261<code>perl:string</code> action bound to it (see description of the <strong>keysym</strong>
238resource in the <code>rxvt(1)</code> manpage). 262resource in the <code>rxvt(1)</code> manpage).
263</dd>
264<p></p></dl>
265<p>
266</p>
267<h2><a name="variables_in_the_urxvt_package">Variables in the <code>urxvt</code> Package</a></h2>
268<dl>
269<dt><strong><a name="item__24urxvt_3a_3aterm">$urxvt::TERM</a></strong><br />
270</dt>
271<dd>
272The current terminal. Whenever a callback/Hook is bein executed, this
273variable stores the current <code>urxvt::term</code> object.
239</dd> 274</dd>
240<p></p></dl> 275<p></p></dl>
241<p> 276<p>
242</p> 277</p>
243<h2><a name="functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></h2> 278<h2><a name="functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></h2>
447<dd> 482<dd>
448<p>This method returns an urxvt::overlay object. The overlay will be visible 483<p>This method returns an urxvt::overlay object. The overlay will be visible
449as long as the perl object is referenced.</p> 484as long as the perl object is referenced.</p>
450</dd> 485</dd>
451<dd> 486<dd>
452<p>Currently, the only method on the <code>urxvt::overlay</code> object is <a href="#item_set"><code>set</code></a>:</p> 487<p>The methods currently supported on <code>urxvt::overlay</code> objects are:</p>
453</dd> 488</dd>
454<p></p> 489<dl>
455<dt><strong><a name="item_set">$overlay-&gt;set ($x, $y, $text, $rend)</a></strong><br /> 490<dt><strong><a name="item_set">$overlay-&gt;set ($x, $y, $text, $rend)</a></strong><br />
456</dt> 491</dt>
457<dd> 492<dd>
458Similar to <a href="#item_row_t"><code>$term-&gt;ROW_t</code></a> and <a href="#item_row_r"><code>$term-&gt;ROW_r</code></a> in that it puts 493Similar to <a href="#item_row_t"><code>$term-&gt;ROW_t</code></a> and <a href="#item_row_r"><code>$term-&gt;ROW_r</code></a> in that it puts
459text in rxvt-unicode's special encoding and an array of rendition values 494text in rxvt-unicode's special encoding and an array of rendition values
460at a specific position inside the overlay. 495at a specific position inside the overlay.
461</dd> 496</dd>
462<p></p> 497<p></p>
498<dt><strong><a name="item_hide">$overlay-&gt;hide</a></strong><br />
499</dt>
500<dd>
501If visible, hide the overlay, but do not destroy it.
502</dd>
503<p></p>
504<dt><strong><a name="item_show">$overlay-&gt;show</a></strong><br />
505</dt>
506<dd>
507If hidden, display the overlay again.
508</dd>
509<p></p></dl>
463<dt><strong><a name="item_strwidth">$cellwidth = $term-&gt;strwidth $string</a></strong><br /> 510<dt><strong><a name="item_strwidth">$cellwidth = $term-&gt;strwidth $string</a></strong><br />
464</dt> 511</dt>
465<dd> 512<dd>
466Returns the number of screen-cells this string would need. Correctly 513Returns the number of screen-cells this string would need. Correctly
467accounts for wide and combining characters. 514accounts for wide and combining characters.
525</dt> 572</dt>
526<dd> 573<dd>
527Returns the text of the entire row with number <code>$row_number</code>. Row <code>0</code> 574Returns the text of the entire row with number <code>$row_number</code>. Row <code>0</code>
528is the topmost terminal line, row <code>$term-&gt;$ncol-1</code> is the bottommost 575is the topmost terminal line, row <code>$term-&gt;$ncol-1</code> is the bottommost
529terminal line. The scrollback buffer starts at line <code>-1</code> and extends to 576terminal line. The scrollback buffer starts at line <code>-1</code> and extends to
530line <a href="#item_nsaved"><code>-$term-&gt;nsaved</code></a>. 577line <a href="#item_nsaved"><code>-$term-&gt;nsaved</code></a>. Nothing will be returned if a nonexistent line
578is requested.
531</dd> 579</dd>
532<dd> 580<dd>
533<p>If <code>$new_text</code> is specified, it will replace characters in the current 581<p>If <code>$new_text</code> is specified, it will replace characters in the current
534line, starting at column <code>$start_col</code> (default <code>0</code>), which is useful 582line, starting at column <code>$start_col</code> (default <code>0</code>), which is useful
535to replace only parts of a line. The font index in the rendition will 583to replace only parts of a line. The font index in the rendition will
546<p>You have to obey this encoding when changing text. The advantage is 594<p>You have to obey this encoding when changing text. The advantage is
547that <code>substr</code> and similar functions work on screen cells and not on 595that <code>substr</code> and similar functions work on screen cells and not on
548characters.</p> 596characters.</p>
549</dd> 597</dd>
550<dd> 598<dd>
551<p>The methods <a href="#item_special_encode"><code>$term-&gt;special_encode</code></a> and <a href="#item_special_decode"><code>$term-&gt;special_decode</code></a> 599<p>The methods <code>$term-&gt;special_encode</code> and <a href="#item_special_decode"><code>$term-&gt;special_decode</code></a>
552can be used to convert normal strings into this encoding and vice versa.</p> 600can be used to convert normal strings into this encoding and vice versa.</p>
553</dd> 601</dd>
554<p></p> 602<p></p>
555<dt><strong><a name="item_row_r">$rend = $term-&gt;ROW_r ($row_number[, $new_rend[, $start_col]])</a></strong><br /> 603<dt><strong><a name="item_row_r">$rend = $term-&gt;ROW_r ($row_number[, $new_rend[, $start_col]])</a></strong><br />
556</dt> 604</dt>
567</dd> 615</dd>
568<p></p> 616<p></p>
569<dt><strong><a name="item_row_l">$length = $term-&gt;ROW_l ($row_number[, $new_length])</a></strong><br /> 617<dt><strong><a name="item_row_l">$length = $term-&gt;ROW_l ($row_number[, $new_length])</a></strong><br />
570</dt> 618</dt>
571<dd> 619<dd>
572Returns the number of screen cells that are in use (``the line length''). If 620Returns the number of screen cells that are in use (``the line
573it is <code>-1</code>, then the line is part of a multiple-row logical ``line'', which 621length''). Unlike the urxvt core, this returns <a href="#item_ncol"><code>$term-&gt;ncol</code></a> if the
574means all characters are in use and it is continued on the next row. 622line is joined with the following one.
623</dd>
624<p></p>
625<dt><strong><a name="item_is_longer">$bool = $term-&gt;is_longer ($row_number)</a></strong><br />
626</dt>
575</dd> 627<dd>
628Returns true if the row is part of a multiple-row logical ``line'' (i.e.
629joined with the following row), which means all characters are in use
630and it is continued on the next row (and possibly a continuation of the
631previous row(s)).
632</dd>
576<p></p> 633<p></p>
634<dt><strong><a name="item_line">$line = $term-&gt;line ($row_number)</a></strong><br />
635</dt>
636<dd>
637Create and return a new <code>urxvt::line</code> object that stores information
638about the logical line that row <code>$row_number</code> is part of. It supports the
639following methods:
640</dd>
641<dl>
577<dt><strong><a name="item_special_encode">$text = $term-&gt;special_encode $string</a></strong><br /> 642<dt><strong><a name="item_t">$text = $line-&gt;t</a></strong><br />
643</dt>
644<dd>
645Returns the full text of the line, similar to <a href="#item_row_t"><code>ROW_t</code></a>
646</dd>
647<p></p>
648<dt><strong><a name="item_r">$rend = $line-&gt;r</a></strong><br />
649</dt>
650<dd>
651Returns the full rendition array of the line, similar to <a href="#item_row_r"><code>ROW_r</code></a>
652</dd>
653<p></p>
654<dt><strong><a name="item_l">$length = $line-&gt;l</a></strong><br />
655</dt>
656<dd>
657Returns the length of the line in cells, similar to <a href="#item_row_l"><code>ROW_l</code></a>.
658</dd>
659<p></p>
660<dt><strong><a name="item_beg">$rownum = $line-&gt;beg</a></strong><br />
661</dt>
662<dt><strong><a name="item_end">$rownum = $line-&gt;end</a></strong><br />
663</dt>
664<dd>
665Return the row number of the first/last row of the line, respectively.
666</dd>
667<p></p>
668<dt><strong><a name="item_offset_of">$offset = $line-&gt;offset_of ($row, $col)</a></strong><br />
669</dt>
670<dd>
671Returns the character offset of the given row|col pair within the logical
672line.
673</dd>
674<p></p>
675<dt><strong><a name="item_coord_of">($row, $col) = $line-&gt;coord_of ($offset)</a></strong><br />
676</dt>
677<dd>
678Translates a string offset into terminal coordinates again.
679</dd>
680<p></p></dl>
681<dt><strong>($row, $col) = $line-&gt;coord_of ($offset)
682=item $text = $term-&gt;special_encode $string</strong><br />
578</dt> 683</dt>
579<dd> 684<dd>
580Converts a perl string into the special encoding used by rxvt-unicode, 685Converts a perl string into the special encoding used by rxvt-unicode,
581where one character corresponds to one screen cell. See 686where one character corresponds to one screen cell. See
582<a href="#item_row_t"><code>$term-&gt;ROW_t</code></a> for details. 687<a href="#item_row_t"><code>$term-&gt;ROW_t</code></a> for details.
718<p> 823<p>
719</p> 824</p>
720<h2><a name="urxvt_perl_verbosity">URXVT_PERL_VERBOSITY</a></h2> 825<h2><a name="urxvt_perl_verbosity">URXVT_PERL_VERBOSITY</a></h2>
721<p>This variable controls the verbosity level of the perl extension. Higher 826<p>This variable controls the verbosity level of the perl extension. Higher
722numbers indicate more verbose output.</p> 827numbers indicate more verbose output.</p>
723<ol> 828<dl>
724<li><strong><a name="item__2d_only_fatal_messages">- only fatal messages</a></strong><br /> 829<dt><strong><a name="item__3d0__2d_only_fatal_messages">=0 - only fatal messages</a></strong><br />
725</li> 830</dt>
726<li><strong><a name="item__2d_script_loading_and_management">- script loading and management</a></strong><br /> 831<dt><strong><a name="item__3d3__2d_script_loading_and_management">=3 - script loading and management</a></strong><br />
727</li> 832</dt>
728<li><strong><a name="item__2d_all_events_received">- all events received</a></strong><br /> 833<dt><strong><a name="item__3d10__2d_all_events_received">=10 - all events received</a></strong><br />
834</dt>
729</li> 835</dl>
730</ol>
731<p> 836<p>
732</p> 837</p>
733<hr /> 838<hr />
734<h1><a name="author">AUTHOR</a></h1> 839<h1><a name="author">AUTHOR</a></h1>
735<pre> 840<pre>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines