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.1 by root, Mon Jan 2 15:59:25 2006 UTC vs.
Revision 1.3 by root, Mon Jan 2 19:36:07 2006 UTC

15 <li><a href="#name">NAME</a></li> 15 <li><a href="#name">NAME</a></li>
16 <li><a href="#synopsis">SYNOPSIS</a></li> 16 <li><a href="#synopsis">SYNOPSIS</a></li>
17 <li><a href="#description">DESCRIPTION</a></li> 17 <li><a href="#description">DESCRIPTION</a></li>
18 <ul> 18 <ul>
19 19
20 <li><a href="#general_api_considerations">General API Considerations</a></li>
20 <li><a href="#hooks">Hooks</a></li> 21 <li><a href="#hooks">Hooks</a></li>
21 <li><a href="#functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></li> 22 <li><a href="#functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></li>
22 <li><a href="#the_urxvt__term_class">The <code>urxvt::term</code> Class</a></li> 23 <li><a href="#the_urxvt__term_class">The <code>urxvt::term</code> Class</a></li>
23 <li><a href="#the_urxvt__timer_class">The <code>urxvt::timer</code> Class</a></li> 24 <li><a href="#the_urxvt__timer_class">The <code>urxvt::timer</code> Class</a></li>
24 <li><a href="#the_urxvt__iow_class">The <code>urxvt::iow</code> Class</a></li> 25 <li><a href="#the_urxvt__iow_class">The <code>urxvt::iow</code> Class</a></li>
25 </ul> 26 </ul>
26 27
28 <li><a href="#environment">ENVIRONMENT</a></li>
29 <ul>
30
31 <li><a href="#urxvt_perl_verbosity">URXVT_PERL_VERBOSITY</a></li>
32 </ul>
33
27 <li><a href="#author">AUTHOR</a></li> 34 <li><a href="#author">AUTHOR</a></li>
28</ul> 35</ul>
29<!-- INDEX END --> 36<!-- INDEX END -->
30 37
31<hr /> 38<hr />
36<p> 43<p>
37</p> 44</p>
38<hr /> 45<hr />
39<h1><a name="synopsis">SYNOPSIS</a></h1> 46<h1><a name="synopsis">SYNOPSIS</a></h1>
40<p>* Put your scripts into <em>/opt/rxvt/lib/urxvt/perl-ext/</em>, they will be loaded automatically.</p> 47<p>* Put your scripts into <em>/opt/rxvt/lib/urxvt/perl-ext/</em>, they will be loaded automatically.</p>
41<p>* Each script will only be loaded once, even in urxvtd, and will be valid
42globally.</p>
43<p>* Scripts are evaluated in a 'use strict' and 'use utf8' environment, and 48<p>* Scripts are evaluated in a 'use strict' and 'use utf8' environment, and
44thus must be encoded as UTF-8.</p> 49thus must be encoded as UTF-8.</p>
45<pre> 50<pre>
46 sub on_sel_grab { 51 sub on_sel_grab {
47 warn &quot;you selected &quot;, $_[0]-&gt;selection; 52 warn &quot;you selected &quot;, $_[0]-&gt;selection;
51 1</pre> 56 1</pre>
52<p> 57<p>
53</p> 58</p>
54<hr /> 59<hr />
55<h1><a name="description">DESCRIPTION</a></h1> 60<h1><a name="description">DESCRIPTION</a></h1>
61<p>On startup, rxvt will scan <em>/opt/rxvt/lib/urxvt/perl-ext/</em>
62for files and will load them. Everytime a terminal object gets created,
63the directory specified by the <code>perl-lib</code> resource will be additionally
64scanned.</p>
65<p>Each script will only ever be loaded once, even in rxvtd, where
66scripts will be shared for all terminals.</p>
67<p>Hooks in scripts specified by <code>perl-lib</code> will only be called for the
68terminals created with that specific option value.</p>
69<p>
70</p>
71<h2><a name="general_api_considerations">General API Considerations</a></h2>
72<p>All objects (such as terminals, time watchers etc.) are typical
73reference-to-hash objects. The hash can be used to store anything you
74like. All members starting with an underscore (such as <code>_ptr</code> or
75<code>_hook</code>) are reserved for internal uses and must not be accessed or
76modified).</p>
77<p>When objects are destroyed on the C++ side, the perl object hashes are
78emptied, so its best to store related objects such as time watchers and
79the like inside the terminal object so they get destroyed as soon as the
80terminal is destroyed.</p>
56<p> 81<p>
57</p> 82</p>
58<h2><a name="hooks">Hooks</a></h2> 83<h2><a name="hooks">Hooks</a></h2>
59<p>The following subroutines can be declared in loaded scripts, and will be called 84<p>The following subroutines can be declared in loaded scripts, and will be called
60whenever the relevant event happens.</p> 85whenever the relevant event happens.</p>
177</dd> 202</dd>
178<p></p> 203<p></p>
179<dt><strong><a name="item_urxvt_3a_3awarn__24string">urxvt::warn $string</a></strong><br /> 204<dt><strong><a name="item_urxvt_3a_3awarn__24string">urxvt::warn $string</a></strong><br />
180</dt> 205</dt>
181<dd> 206<dd>
182Calls <code>rxvt_warn</code> witht eh given string which should not include a 207Calls <code>rxvt_warn</code> with the given string which should not include a
183newline. The module also overwrites the <code>warn</code> builtin with a function 208newline. The module also overwrites the <code>warn</code> builtin with a function
184that calls this function. 209that calls this function.
185</dd> 210</dd>
186<dd> 211<dd>
187<p>Using this function has the advantage that its output ends up in the 212<p>Using this function has the advantage that its output ends up in the
188correct place, e.g. on stderr of the connecting urxvtc client.</p> 213correct place, e.g. on stderr of the connecting urxvtc client.</p>
189</dd> 214</dd>
190<p></p> 215<p></p>
191<dt><strong><a name="item__24cellwidth__3d_urxvt_3a_3awcswidth__24string">$cellwidth = urxvt::wcswidth $string</a></strong><br />
192</dt>
193<dd>
194Returns the number of screen-cells this string would need. Correctly
195accounts for wide and combining characters.
196</dd>
197<p></p>
198<dt><strong><a name="item__24time__3d_urxvt_3a_3anow">$time = urxvt::NOW</a></strong><br /> 216<dt><strong><a name="item__24time__3d_urxvt_3a_3anow">$time = urxvt::NOW</a></strong><br />
199</dt> 217</dt>
200<dd> 218<dd>
201Returns the ``current time'' (as per the event loop). 219Returns the ``current time'' (as per the event loop).
202</dd> 220</dd>
203<p></p></dl> 221<p></p></dl>
204<p> 222<p>
205</p> 223</p>
206<h2><a name="the_urxvt__term_class">The <code>urxvt::term</code> Class</a></h2> 224<h2><a name="the_urxvt__term_class">The <code>urxvt::term</code> Class</a></h2>
207<dl> 225<dl>
226<dt><strong><a name="item_resource">$value = $term-&gt;resource ($name[, $newval])</a></strong><br />
227</dt>
228<dd>
229Returns the current resource value associated with a given name and
230optionally sets a new value. Setting values is most useful in the <code>init</code>
231hook. Unset resources are returned and accepted as <code>undef</code>.
232</dd>
233<dd>
234<p>The new value must be properly encoded to a suitable character encoding
235before passing it to this method. Similarly, the returned value may need
236to be converted from the used encoding to text.</p>
237</dd>
238<dd>
239<p>Resource names are as defined in <em>src/rsinc.h</em>. Colours can be specified
240as resource names of the form <code>color+&lt;index&gt;</code>, e.g. <code>color+5</code>. (will
241likely change).</p>
242</dd>
243<dd>
244<p>Please note that resource strings will currently only be freed when the
245terminal is destroyed, so changing options frequently will eat memory.</p>
246</dd>
247<dd>
248<p>Here is a a likely non-exhaustive list of resource names, not all of which
249are supported in every build, please see the source to see the actual
250list:</p>
251</dd>
252<dd>
253<pre>
254 answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont
255 borderLess color cursorBlink cursorUnderline cutchars delete_key
256 display_name embed ext_bwidth fade font geometry hold iconName
257 imFont imLocale inputMethod insecure int_bwidth intensityStyles
258 italicFont jumpScroll lineSpace loginShell mapAlert menu meta8
259 modifier mouseWheelScrollPage name pastableTabs path perl perl_eval
260 perl_lib pointerBlank pointerBlankDelay preeditType print_pipe pty_fd
261 reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating
262 scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput
263 scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle
264 shade term_name title transparent transparent_all tripleclickwords
265 utmpInhibit visualBell</pre>
266</dd>
267<p></p>
208<dt><strong><a name="item_selection_mark">($row, $col) = $term-&gt;selection_mark ([$row, $col])</a></strong><br /> 268<dt><strong><a name="item_selection_mark">($row, $col) = $term-&gt;selection_mark ([$row, $col])</a></strong><br />
209</dt> 269</dt>
210<dt><strong><a name="item_selection_beg">($row, $col) = $term-&gt;selection_beg ([$row, $col])</a></strong><br /> 270<dt><strong><a name="item_selection_beg">($row, $col) = $term-&gt;selection_beg ([$row, $col])</a></strong><br />
211</dt> 271</dt>
212<dt><strong><a name="item_selection_end">($row, $col) = $term-&gt;selection_end ([$row, $col])</a></strong><br /> 272<dt><strong><a name="item_selection_end">($row, $col) = $term-&gt;selection_end ([$row, $col])</a></strong><br />
259<p></p> 319<p></p>
260<dt><strong><a name="item_scr_overlay_set">$term-&gt;scr_overlay_set ($x, $y, $text)</a></strong><br /> 320<dt><strong><a name="item_scr_overlay_set">$term-&gt;scr_overlay_set ($x, $y, $text)</a></strong><br />
261</dt> 321</dt>
262<dd> 322<dd>
263Write a string at the given position into the overlay. 323Write a string at the given position into the overlay.
324</dd>
325<p></p>
326<dt><strong><a name="item_strwidth">$cellwidth = $term-&gt;strwidth $string</a></strong><br />
327</dt>
328<dd>
329Returns the number of screen-cells this string would need. Correctly
330accounts for wide and combining characters.
331</dd>
332<p></p>
333<dt><strong><a name="item_locale_encode">$octets = $term-&gt;locale_encode $string</a></strong><br />
334</dt>
335<dd>
336Convert the given text string into the corresponding locale encoding.
337</dd>
338<p></p>
339<dt><strong><a name="item_locale_decode">$string = $term-&gt;locale_decode $octets</a></strong><br />
340</dt>
341<dd>
342Convert the given locale-encoded octets into a perl string.
343</dd>
344<p></p>
345<dt><strong><a name="item_tt_write">$term-&gt;tt_write ($octets)</a></strong><br />
346</dt>
347<dd>
348Write the octets given in <code>$data</code> to the tty (i.e. as program input). To
349pass characters instead of octets, you should convetr you strings first to
350the locale-specific encoding using <a href="#item_locale_encode"><code>$term-&gt;locale_encode</code></a>.
264</dd> 351</dd>
265<p></p></dl> 352<p></p></dl>
266<p> 353<p>
267</p> 354</p>
268<h2><a name="the_urxvt__timer_class">The <code>urxvt::timer</code> Class</a></h2> 355<h2><a name="the_urxvt__timer_class">The <code>urxvt::timer</code> Class</a></h2>
380</dd> 467</dd>
381<p></p></dl> 468<p></p></dl>
382<p> 469<p>
383</p> 470</p>
384<hr /> 471<hr />
472<h1><a name="environment">ENVIRONMENT</a></h1>
473<p>
474</p>
475<h2><a name="urxvt_perl_verbosity">URXVT_PERL_VERBOSITY</a></h2>
476<p>This variable controls the verbosity level of the perl extension. Higher
477numbers indicate more verbose output.</p>
478<ol>
479<li><strong><a name="item__2d_only_fatal_messages">- only fatal messages</a></strong><br />
480</li>
481<li><strong><a name="item__2d_script_loading_and_management">- script loading and management</a></strong><br />
482</li>
483<li><strong><a name="item__2d_all_events_received">- all events received</a></strong><br />
484</li>
485</ol>
486<p>
487</p>
488<hr />
385<h1><a name="author">AUTHOR</a></h1> 489<h1><a name="author">AUTHOR</a></h1>
386<pre> 490<pre>
387 Marc Lehmann &lt;pcg@goof.com&gt; 491 Marc Lehmann &lt;pcg@goof.com&gt;
388 <a href="http://software.schmorp.de/pkg/rxvt-unicode">http://software.schmorp.de/pkg/rxvt-unicode</a></pre> 492 <a href="http://software.schmorp.de/pkg/rxvt-unicode">http://software.schmorp.de/pkg/rxvt-unicode</a></pre>
389 493

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines