*** empty log message ***
authorroot <root>
Sat, 7 Jan 2006 04:19:43 +0000 (04:19 +0000)
committerroot <root>
Sat, 7 Jan 2006 04:19:43 +0000 (04:19 +0000)
13 files changed:
README.configure
doc/rxvt.1.html
doc/rxvt.1.man.in
doc/rxvt.1.txt
doc/rxvt.7.html
doc/rxvt.7.man.in
doc/rxvt.7.pod
doc/rxvt.7.txt
doc/rxvtperl.3.html
doc/rxvtperl.3.man.in
doc/rxvtperl.3.txt
src/rxvtperl.xs
src/urxvt.pm

index 13e7f368b0dcc30a29a89dfcd6ce6f797eb68a1e..d80cb0cb9067580b13685b4fab5939b193530fea 100644 (file)
@@ -106,10 +106,10 @@ CONFIGURE OPTIONS
         at start of rxvt execution. This option requires --enable-utmp to
         also be specified.
 
-    --enable-xpm-background (default: off)
+    --enable-xpm-background (default: on)
         Add support for XPM background pixmaps.
 
-    --enable-transparency (default: off)
+    --enable-transparency (default: on)
         Add support for inheriting parent backgrounds thus giving a fake
         transparency to the term.
 
@@ -121,9 +121,10 @@ CONFIGURE OPTIONS
         Add support for tinting of transparent backgrounds (requires
         "--enable-transparency").
 
-    --enable-menubar (default: off)
+    --enable-menubar (default: off) [DEPRECATED]
         Add support for our menu bar system (this interacts badly with
-        dynamic locale switching currently).
+        dynamic locale switching currently). This option is DEPRECATED and
+        will be removed in the future.
 
     --enable-rxvt-scroll (default: on)
         Add support for the original rxvt scrollbar.
index 919903880f937610930e5bce7ab2999eabc3a315..6b5eafd6efb958acbb68dba85611cb068cbcb616 100644 (file)
@@ -602,7 +602,7 @@ used (a longer example is in <em>doc/embed</em>):</p>
    });</pre>
 </dd>
 <p></p>
-<dt><strong><a name="item__2dpty_2dfd_fileno"><strong>-pty-fd</strong> <em>fileno</em></a></strong><br />
+<dt><strong><a name="item__2dpty_2dfd_file_descriptor"><strong>-pty-fd</strong> <em>file descriptor</em></a></strong><br />
 </dt>
 <dd>
 Tells rxvt NOT to execute any commands or create a new pty/tty
@@ -616,6 +616,10 @@ entries and will not tinker with pty/tty permissions - you have to do that
 yourself if you want that.</p>
 </dd>
 <dd>
+<p>As an extremely special case, specifying <code>-1</code> will completely suppress
+pty/tty operations.</p>
+</dd>
+<dd>
 <p>Here is a example in perl that illustrates how this option can be used (a
 longer example is in <em>doc/pty-fd</em>):</p>
 </dd>
@@ -641,7 +645,7 @@ longer example is in <em>doc/pty-fd</em>):</p>
 <dt><strong><a name="item__2dpe_string"><strong>-pe</strong> <em>string</em></a></strong><br />
 </dt>
 <dd>
-Colon-separated list of perl extension scripts to use in this terminal
+Comma-separated list of perl extension scripts to use in this terminal
 instance. See resource <strong>perl-ext</strong>.
 </dd>
 <p></p></dl>
@@ -1451,7 +1455,7 @@ info):</p>
 <dt><strong><a name="item_perl_2dext_3a_string"><strong>perl-ext</strong>: <em>string</em></a></strong><br />
 </dt>
 <dd>
-Colon-separated <code>list(s)</code> of perl extension scripts to use in this terminal
+Comma-separated <code>list(s)</code> of perl extension scripts to use in this terminal
 instance. Each extension is looked up in the library directories, loaded
 if necessary, and bound to the current terminal instance. If this
 resource is empty or missing, then the perl interpreter will not be
index 5ddf4b112dc77054e4ab8d58ab3538e4bc5dc58d..7de2bce3f3e7c83f7b6d4d1e2c225141487fd96c 100644 (file)
 .\" ========================================================================
 .\"
 .IX Title "rxvt 1"
-.TH rxvt 1 "2006-01-04" "6.3" "RXVT-UNICODE"
+.TH rxvt 1 "2006-01-07" "6.3" "RXVT-UNICODE"
 .SH "NAME"
 rxvt\-unicode (ouR XVT, unicode) \- (a VT102 emulator for the X window system)
 .SH "SYNOPSIS"
@@ -510,8 +510,8 @@ used (a longer example is in \fIdoc/embed\fR):
 \&      system "@@RXVT_NAME@@ -embed $xid &";
 \&   });
 .Ve
-.IP "\fB\-pty\-fd\fR \fIfileno\fR" 4
-.IX Item "-pty-fd fileno"
+.IP "\fB\-pty\-fd\fR \fIfile descriptor\fR" 4
+.IX Item "-pty-fd file descriptor"
 Tells @@RXVT_NAME@@ \s-1NOT\s0 to execute any commands or create a new pty/tty
 pair but instead use the given filehandle as the tty master. This is
 useful if you want to drive @@RXVT_NAME@@ as a generic terminal emulator
@@ -521,6 +521,9 @@ If this switch is given, @@RXVT_NAME@@ will not create any utmp/wtmp
 entries and will not tinker with pty/tty permissions \- you have to do that
 yourself if you want that.
 .Sp
+As an extremely special case, specifying \f(CW\*(C`\-1\*(C'\fR will completely suppress
+pty/tty operations.
+.Sp
 Here is a example in perl that illustrates how this option can be used (a
 longer example is in \fIdoc/pty\-fd\fR):
 .Sp
@@ -543,7 +546,7 @@ longer example is in \fIdoc/pty\-fd\fR):
 .Ve
 .IP "\fB\-pe\fR \fIstring\fR" 4
 .IX Item "-pe string"
-Colon-separated list of perl extension scripts to use in this terminal
+Comma-separated list of perl extension scripts to use in this terminal
 instance. See resource \fBperl-ext\fR.
 .SH "RESOURCES (available also as long\-options)"
 .IX Header "RESOURCES (available also as long-options)"
@@ -1109,7 +1112,7 @@ info):
 .IP "\fBperl-ext\fR: \fIstring\fR" 4
 .IX Item "perl-ext: string"
 .PD
-Colon-separated list(s) of perl extension scripts to use in this terminal
+Comma-separated list(s) of perl extension scripts to use in this terminal
 instance. Each extension is looked up in the library directories, loaded
 if necessary, and bound to the current terminal instance. If this
 resource is empty or missing, then the perl interpreter will not be
index 3ad294b02a75cb9ffe98b5a5e94c7b0fb6e9a9a0..a57b0407770be0a34e74f06c8f5ab54061285045 100644 (file)
@@ -373,7 +373,7 @@ OPTIONS
               system "rxvt -embed $xid &";
            });
 
-    -pty-fd *fileno*
+    -pty-fd *file descriptor*
         Tells rxvt NOT to execute any commands or create a new pty/tty pair
         but instead use the given filehandle as the tty master. This is
         useful if you want to drive rxvt as a generic terminal emulator
@@ -383,6 +383,9 @@ OPTIONS
         and will not tinker with pty/tty permissions - you have to do that
         yourself if you want that.
 
+        As an extremely special case, specifying -1 will completely suppress
+        pty/tty operations.
+
         Here is a example in perl that illustrates how this option can be
         used (a longer example is in doc/pty-fd):
 
@@ -399,7 +402,7 @@ OPTIONS
            while (<$slave>) { print $slave "got <$_>\n" }
 
     -pe *string*
-        Colon-separated list of perl extension scripts to use in this
+        Comma-separated list of perl extension scripts to use in this
         terminal instance. See resource perl-ext.
 
 RESOURCES (available also as long-options)
@@ -940,7 +943,7 @@ RESOURCES (available also as long-options)
 
     perl-ext-common: *string*
     perl-ext: *string*
-        Colon-separated list(s) of perl extension scripts to use in this
+        Comma-separated list(s) of perl extension scripts to use in this
         terminal instance. Each extension is looked up in the library
         directories, loaded if necessary, and bound to the current terminal
         instance. If this resource is empty or missing, then the perl
index e129922dc51582408568606f424847c126adc810..ba44483f946a8da61f70468b1ea36f621d078e77 100644 (file)
@@ -2799,13 +2799,13 @@ Write user and tty to lastlog file (used by programs like
 --enable-utmp to also be specified.
 </dd>
 <p></p>
-<dt><strong><a name="item_background">--enable-xpm-background (default: off)</a></strong><br />
+<dt><strong><a name="item_background">--enable-xpm-background (default: on)</a></strong><br />
 </dt>
 <dd>
 Add support for XPM background pixmaps.
 </dd>
 <p></p>
-<dt><strong><a name="item_transparency">--enable-transparency (default: off)</a></strong><br />
+<dt><strong><a name="item_transparency">--enable-transparency (default: on)</a></strong><br />
 </dt>
 <dd>
 Add support for inheriting parent backgrounds thus giving a fake
@@ -2824,11 +2824,12 @@ Add support for fading the text when focus is lost (requires <code>--enable-tran
 Add support for tinting of transparent backgrounds (requires <code>--enable-transparency</code>).
 </dd>
 <p></p>
-<dt><strong><a name="item_menubar">--enable-menubar (default: off)</a></strong><br />
+<dt><strong><a name="item_menubar">--enable-menubar (default: off) [DEPRECATED]</a></strong><br />
 </dt>
 <dd>
-Add support for our menu bar system (this interacts badly with
-dynamic locale switching currently).
+Add support for our menu bar system (this interacts badly with dynamic
+locale switching currently). This option is DEPRECATED and will be removed
+in the future.
 </dd>
 <p></p>
 <dt><strong><a name="item_scroll">--enable-rxvt-scroll (default: on)</a></strong><br />
index abb0be4325fd967ffc016071b254a0e90c463640..506685925d1a6dad7833f012dcb289c0dd7d076c 100644 (file)
 .\" ========================================================================
 .\"
 .IX Title "rxvt 7"
-.TH rxvt 7 "2006-01-04" "6.3" "RXVT-UNICODE"
+.TH rxvt 7 "2006-01-07" "6.3" "RXVT-UNICODE"
 .SH "NAME"
 RXVT REFERENCE \- FAQ, command sequences and other background information
 .SH "SYNOPSIS"
@@ -2402,11 +2402,11 @@ option requires \-\-enable\-utmp to also be specified.
 Write user and tty to lastlog file (used by programs like
 \&\fIlastlogin\fR) at start of rxvt execution.  This option requires
 \&\-\-enable\-utmp to also be specified.
-.IP "\-\-enable\-xpm\-background (default: off)" 4
-.IX Item "--enable-xpm-background (default: off)"
+.IP "\-\-enable\-xpm\-background (default: on)" 4
+.IX Item "--enable-xpm-background (default: on)"
 Add support for \s-1XPM\s0 background pixmaps.
-.IP "\-\-enable\-transparency (default: off)" 4
-.IX Item "--enable-transparency (default: off)"
+.IP "\-\-enable\-transparency (default: on)" 4
+.IX Item "--enable-transparency (default: on)"
 Add support for inheriting parent backgrounds thus giving a fake
 transparency to the term.
 .IP "\-\-enable\-fading (default: on)" 4
@@ -2415,10 +2415,11 @@ Add support for fading the text when focus is lost (requires \f(CW\*(C`\-\-enabl
 .IP "\-\-enable\-tinting (default: on)" 4
 .IX Item "--enable-tinting (default: on)"
 Add support for tinting of transparent backgrounds (requires \f(CW\*(C`\-\-enable\-transparency\*(C'\fR).
-.IP "\-\-enable\-menubar (default: off)" 4
-.IX Item "--enable-menubar (default: off)"
-Add support for our menu bar system (this interacts badly with
-dynamic locale switching currently).
+.IP "\-\-enable\-menubar (default: off) [\s-1DEPRECATED\s0]" 4
+.IX Item "--enable-menubar (default: off) [DEPRECATED]"
+Add support for our menu bar system (this interacts badly with dynamic
+locale switching currently). This option is \s-1DEPRECATED\s0 and will be removed
+in the future.
 .IP "\-\-enable\-rxvt\-scroll (default: on)" 4
 .IX Item "--enable-rxvt-scroll (default: on)"
 Add support for the original rxvt scrollbar.
index 204778c4d532263796336cde594ad2e657b0764f..3dfeb4fcfa2a91b2b98a2a9f6f7ca773cadfce8c 100644 (file)
@@ -2408,11 +2408,11 @@ Write user and tty to lastlog file (used by programs like
 F<lastlogin>) at start of rxvt execution.  This option requires
 --enable-utmp to also be specified.
 
-=item --enable-xpm-background (default: off)
+=item --enable-xpm-background (default: on)
 
 Add support for XPM background pixmaps.
 
-=item --enable-transparency (default: off)
+=item --enable-transparency (default: on)
 
 Add support for inheriting parent backgrounds thus giving a fake
 transparency to the term.
@@ -2425,10 +2425,11 @@ Add support for fading the text when focus is lost (requires C<--enable-transpar
 
 Add support for tinting of transparent backgrounds (requires C<--enable-transparency>).
 
-=item --enable-menubar (default: off)
+=item --enable-menubar (default: off) [DEPRECATED]
 
-Add support for our menu bar system (this interacts badly with
-dynamic locale switching currently).
+Add support for our menu bar system (this interacts badly with dynamic
+locale switching currently). This option is DEPRECATED and will be removed
+in the future.
 
 =item --enable-rxvt-scroll (default: on)
 
index 0a0f8461e93df8deb6f94cb71015a9da134ec89e..e43b336813e92e73ebb2a4ab6a0ec3dbe27b613e 100644 (file)
@@ -1867,10 +1867,10 @@ CONFIGURE OPTIONS
         at start of rxvt execution. This option requires --enable-utmp to
         also be specified.
 
-    --enable-xpm-background (default: off)
+    --enable-xpm-background (default: on)
         Add support for XPM background pixmaps.
 
-    --enable-transparency (default: off)
+    --enable-transparency (default: on)
         Add support for inheriting parent backgrounds thus giving a fake
         transparency to the term.
 
@@ -1882,9 +1882,10 @@ CONFIGURE OPTIONS
         Add support for tinting of transparent backgrounds (requires
         "--enable-transparency").
 
-    --enable-menubar (default: off)
+    --enable-menubar (default: off) [DEPRECATED]
         Add support for our menu bar system (this interacts badly with
-        dynamic locale switching currently).
+        dynamic locale switching currently). This option is DEPRECATED and
+        will be removed in the future.
 
     --enable-rxvt-scroll (default: on)
         Add support for the original rxvt scrollbar.
index 63a29d3cc1f5a44692150b76e87a788e7dca2dc6..19cb30e04d9ecb626d97019c49e7200c4a6a739e 100644 (file)
@@ -106,6 +106,20 @@ Rot-13 the selection when activated. Used via keyboard trigger:
 Displays a digital clock using the built-in overlay.
 </dd>
 <p></p>
+<dt><strong><a name="item_mark_2durls">mark-urls</a></strong><br />
+</dt>
+<dd>
+Uses per-line display filtering (<code>on_line_update</code>) to underline urls.
+</dd>
+<p></p>
+<dt><strong><a name="item_block_2dgraphics_2dto_2dascii">block-graphics-to-ascii</a></strong><br />
+</dt>
+<dd>
+A not very useful example of filtering all text output to the terminal,
+by replacing all line-drawing characters (U+2500 .. U+259F) by a
+similar-looking ascii character.
+</dd>
+<p></p>
 <dt><strong><a name="item_example_2drefresh_2dhooks">example-refresh-hooks</a></strong><br />
 </dt>
 <dd>
@@ -126,10 +140,35 @@ modified).</p>
 emptied, so its best to store related objects such as time watchers and
 the like inside the terminal object so they get destroyed as soon as the
 terminal is destroyed.</p>
+<p>Argument names also often indicate the type of a parameter. Here are some
+hints on what they mean:</p>
+<dl>
+<dt><strong><a name="item__24text">$text</a></strong><br />
+</dt>
+<dd>
+Rxvt-unicodes special way of encoding text, where one ``unicode'' character
+always represents one screen cell. See <em>row_t</em> for a discussion of this format.
+</dd>
+<p></p>
+<dt><strong><a name="item__24string">$string</a></strong><br />
+</dt>
+<dd>
+A perl text string, with an emphasis on <em>text</em>. It can store all unicode
+characters and is to be distinguished with text encoded in a specific
+encoding (often locale-specific) and binary data.
+</dd>
+<p></p>
+<dt><strong><a name="item__24octets">$octets</a></strong><br />
+</dt>
+<dd>
+Either binary data or - more common - a text string encoded in a
+locale-specific way.
+</dd>
+<p></p></dl>
 <p>
 </p>
 <h2><a name="hooks">Hooks</a></h2>
-<p>The following subroutines can be declared in loaded scripts, and will be
+<p>The following subroutines can be declared in extension files, and will be
 called whenever the relevant event happens.</p>
 <p>The first argument passed to them is an object private to each terminal
 and extension package.  You can call all <code>urxvt::term</code> methods on it, but
@@ -145,7 +184,10 @@ and the relevant action might not be carried out by the C++ code.</p>
 </dt>
 <dd>
 Called after a new terminal object has been initialized, but before
-windows are created or the command gets run.
+windows are created or the command gets run. Most methods are unsafe to
+call or deliver senseless data, as terminal size and other characteristics
+have not yet been determined. You can safely query and change resources,
+though.
 </dd>
 <p></p>
 <dt><strong><a name="item_on_reset__24term">on_reset $term</a></strong><br />
@@ -255,6 +297,34 @@ as its source can not easily be controleld (e-mail content, messages from
 other users on the same system etc.).</p>
 </dd>
 <p></p>
+<dt><strong><a name="item_on_add_lines__24term_2c__24string">on_add_lines $term, $string</a></strong><br />
+</dt>
+<dd>
+Called whenever text is about to be output, with the text as argument. You
+can filter/change and output the text yourself by returning a true value
+and calling <a href="#item_scr_add_lines"><code>$term-&gt;scr_add_lines</code></a> yourself. Please note that this
+might be very slow, however, as your hook is called for <strong>all</strong> text being
+output.
+</dd>
+<p></p>
+<dt><strong><a name="item_on_line_update__24term_2c__24row">on_line_update $term, $row</a></strong><br />
+</dt>
+<dd>
+Called whenever a line was updated or changed. Can be used to filter
+screen output (e.g. underline urls or other useless stuff). Only lines
+that are being shown will be filtered, and, due to performance reasons,
+not always immediately.
+</dd>
+<dd>
+<p>The row number is always the topmost row of the line if the line spans
+multiple rows.</p>
+</dd>
+<dd>
+<p>Please note that, if you change the line, then the hook might get called
+later with the already-modified line (e.g. if unrelated parts change), so
+you cannot just toggle rendition bits, but only set them.</p>
+</dd>
+<p></p>
 <dt><strong><a name="item_on_refresh_begin__24term">on_refresh_begin $term</a></strong><br />
 </dt>
 <dd>
@@ -277,6 +347,33 @@ Called whenever the user presses a key combination that has a
 <code>perl:string</code> action bound to it (see description of the <strong>keysym</strong>
 resource in the <code>rxvt(1)</code> manpage).
 </dd>
+<p></p>
+<dt><strong><a name="item_on_key_press__24term_2c__24event_2c__24octets">on_key_press $term, $event, $octets</a></strong><br />
+</dt>
+<dt><strong><a name="item_on_key_release__24term_2c__24event">on_key_release $term, $event</a></strong><br />
+</dt>
+<dt><strong><a name="item_on_button_press__24term_2c__24event">on_button_press $term, $event</a></strong><br />
+</dt>
+<dt><strong><a name="item_on_button_release__24term_2c__24event">on_button_release $term, $event</a></strong><br />
+</dt>
+<dt><strong><a name="item_on_motion_notify__24term_2c__24event">on_motion_notify $term, $event</a></strong><br />
+</dt>
+<dd>
+Called whenever the corresponding X event is received for the terminal If
+the hook returns true, then the even will be ignored by rxvt-unicode.
+</dd>
+<dd>
+<p>The event is a hash with most values as named by Xlib (see the XEvent
+manpage), with the additional members <code>row</code> and <code>col</code>, which are the row
+and column under the mouse cursor.</p>
+</dd>
+<dd>
+<p><code>on_key_press</code> additionally receives the string rxvt-unicode would
+output, if any, in locale-specific encoding.</p>
+</dd>
+<dd>
+<p>subwindow.</p>
+</dd>
 <p></p></dl>
 <p>
 </p>
@@ -285,14 +382,24 @@ resource in the <code>rxvt(1)</code> manpage).
 <dt><strong><a name="item__24urxvt_3a_3aterm">$urxvt::TERM</a></strong><br />
 </dt>
 <dd>
-The current terminal. Whenever a callback/Hook is bein executed, this
-variable stores the current <code>urxvt::term</code> object.
+The current terminal. This variable stores the current <code>urxvt::term</code>
+object, whenever a callback/hook is executing.
 </dd>
 <p></p></dl>
 <p>
 </p>
 <h2><a name="functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></h2>
 <dl>
+<dt><strong><a name="item__24term__3d_new_urxvt__5barg_2e_2e_2e_5d">$term = new urxvt [arg...]</a></strong><br />
+</dt>
+<dd>
+Creates a new terminal, very similar as if you had started it with
+<code>system $binfile, arg...</code>. Croaks (and probably outputs an error message)
+if the new instance couldn't be created.  Returns <code>undef</code> if the new
+instance didn't initialise perl, and the terminal object otherwise. The
+<code>init</code> and <a href="#item_start"><code>start</code></a> hooks will be called during the call.
+</dd>
+<p></p>
 <dt><strong><a name="item_urxvt_3a_3afatal__24errormessage">urxvt::fatal $errormessage</a></strong><br />
 </dt>
 <dd>
@@ -385,6 +492,12 @@ Change the custom value.
 </p>
 <h2><a name="the_urxvt__term_class">The <code>urxvt::term</code> Class</a></h2>
 <dl>
+<dt><strong><a name="item_destroy">$term-&gt;destroy</a></strong><br />
+</dt>
+<dd>
+Destroy the terminal object (close the window, free resources etc.).
+</dd>
+<p></p>
 <dt><strong><a name="item_resource">$value = $term-&gt;resource ($name[, $newval])</a></strong><br />
 </dt>
 <dd>
@@ -427,11 +540,11 @@ list:</p>
   utmpInhibit visualBell</pre>
 </dd>
 <p></p>
-<dt><strong><a name="item_screen_rstyle">$rend = $term-&gt;screen_rstyle ([$new_rstyle])</a></strong><br />
+<dt><strong><a name="item_rstyle">$rend = $term-&gt;rstyle ([$new_rstyle])</a></strong><br />
 </dt>
 <dd>
-Return and optionally change the current rendition. Text thta is output by
-the temrianl application will use this style.
+Return and optionally change the current rendition. Text that is output by
+the terminal application will use this style.
 </dd>
 <p></p>
 <dt><strong><a name="item_screen_cur">($row, $col) = $term-&gt;screen_cur ([$row, $col])</a></strong><br />
@@ -469,29 +582,21 @@ Return the current selection text and optionally replace it by <code>$newtext</c
 #
 #Create a simple multi-line overlay box. See the next method for details.
 #
-#=cut</p>
-</dd>
-<dd>
-<p>sub urxvt::term::scr_overlay {
-die;
-   my ($self, $x, $y, $text) = @_;</p>
-</dd>
-<dd>
-<pre>
-   my @lines = split /\n/, $text;</pre>
-</dd>
-<dd>
-<pre>
-   my $w = 0;
-   for (map $self-&gt;strwidth ($_), @lines) {
-      $w = $_ if $w &lt; $_;
-   }</pre>
-</dd>
-<dd>
-<pre>
-   $self-&gt;scr_overlay_new ($x, $y, $w, scalar @lines);
-   $self-&gt;scr_overlay_set (0, $_, $lines[$_]) for 0.. $#lines;
-}</pre>
+#=cut
+#
+#sub urxvt::term::scr_overlay {
+#   my ($self, $x, $y, $text) = @_;
+#
+#   my @lines = split /\n/, $text;
+#
+#   my $w = 0;
+#   for (map $self-&gt;strwidth ($_), @lines) {
+#      $w = $_ if $w &lt; $_;
+#   }
+#
+#   $self-&gt;scr_overlay_new ($x, $y, $w, scalar @lines);
+#   $self-&gt;scr_overlay_set (0, $_, $lines[$_]) for 0.. $#lines;
+#}</p>
 </dd>
 <p></p>
 <dt><strong><a name="item_overlay">$term-&gt;overlay ($x, $y, $width, $height[, $rstyle[, $border]])</a></strong><br />
@@ -537,25 +642,47 @@ If visible, hide the overlay, but do not destroy it.
 If hidden, display the overlay again.
 </dd>
 <p></p></dl>
-<dt><strong><a name="item_strwidth">$cellwidth = $term-&gt;strwidth $string</a></strong><br />
+<dt><strong><a name="item_strwidth">$cellwidth = $term-&gt;strwidth ($string)</a></strong><br />
 </dt>
 <dd>
 Returns the number of screen-cells this string would need. Correctly
 accounts for wide and combining characters.
 </dd>
 <p></p>
-<dt><strong><a name="item_locale_encode">$octets = $term-&gt;locale_encode $string</a></strong><br />
+<dt><strong><a name="item_locale_encode">$octets = $term-&gt;locale_encode ($string)</a></strong><br />
 </dt>
 <dd>
 Convert the given text string into the corresponding locale encoding.
 </dd>
 <p></p>
-<dt><strong><a name="item_locale_decode">$string = $term-&gt;locale_decode $octets</a></strong><br />
+<dt><strong><a name="item_locale_decode">$string = $term-&gt;locale_decode ($octets)</a></strong><br />
 </dt>
 <dd>
 Convert the given locale-encoded octets into a perl string.
 </dd>
 <p></p>
+<dt><strong><a name="item_scr_add_lines">$term-&gt;scr_add_lines ($string)</a></strong><br />
+</dt>
+<dd>
+Write the given text string to the screen, as if output by the application
+running inside the terminal. It may not contain command sequences (escape
+codes), but is free to use line feeds, carriage returns and tabs. The
+string is a normal text string, not in locale-dependent encoding.
+</dd>
+<dd>
+<p>Normally its not a good idea to use this function, as programs might be
+confused by changes in cursor position or scrolling. Its useful inside a
+<code>on_add_lines</code> hook, though.</p>
+</dd>
+<p></p>
+<dt><strong><a name="item_cmd_parse">$term-&gt;cmd_parse ($octets)</a></strong><br />
+</dt>
+<dd>
+Similar to <a href="#item_scr_add_lines"><code>scr_add_lines</code></a>, but the argument must be in the
+locale-specific encoding of the terminal and can contain command sequences
+(escape codes) that will be interpreted.
+</dd>
+<p></p>
 <dt><strong><a name="item_tt_write">$term-&gt;tt_write ($octets)</a></strong><br />
 </dt>
 <dd>
@@ -564,6 +691,18 @@ pass characters instead of octets, you should convert your strings first
 to the locale-specific encoding using <a href="#item_locale_encode"><code>$term-&gt;locale_encode</code></a>.
 </dd>
 <p></p>
+<dt><strong><a name="item_parent">$windowid = $term-&gt;parent</a></strong><br />
+</dt>
+<dd>
+Return the window id of the toplevel window.
+</dd>
+<p></p>
+<dt><strong><a name="item_vt">$windowid = $term-&gt;vt</a></strong><br />
+</dt>
+<dd>
+Return the window id of the terminal window.
+</dd>
+<p></p>
 <dt><strong><a name="item_width">$window_width = $term-&gt;width</a></strong><br />
 </dt>
 <dt><strong><a name="item_height">$window_height = $term-&gt;height</a></strong><br />
@@ -627,7 +766,7 @@ to replace only parts of a line. The font index in the rendition will
 automatically be updated.</p>
 </dd>
 <dd>
-<p><code>$text</code> is in a special encoding: tabs and wide characters that use more
+<p><a href="#item__24text"><code>$text</code></a> is in a special encoding: tabs and wide characters that use more
 than one cell when displayed are padded with urxvt::NOCHAR characters
 (<code>chr 65535</code>). Characters with combining characters and other characters
 that do not fit into the normal tetx encoding will be replaced with
@@ -682,16 +821,16 @@ about the logical line that row <code>$row_number</code> is part of. It supports
 following methods:
 </dd>
 <dl>
-<dt><strong><a name="item_t">$text = $line-&gt;t</a></strong><br />
+<dt><strong><a name="item_t">$text = $line-&gt;t ([$new_text])</a></strong><br />
 </dt>
 <dd>
-Returns the full text of the line, similar to <a href="#item_row_t"><code>ROW_t</code></a>
+Returns or replaces the full text of the line, similar to <a href="#item_row_t"><code>ROW_t</code></a>
 </dd>
 <p></p>
-<dt><strong><a name="item_r">$rend = $line-&gt;r</a></strong><br />
+<dt><strong><a name="item_r">$rend = $line-&gt;r ([$new_rend])</a></strong><br />
 </dt>
 <dd>
-Returns the full rendition array of the line, similar to <a href="#item_row_r"><code>ROW_r</code></a>
+Returns or replaces the full rendition array of the line, similar to <a href="#item_row_r"><code>ROW_r</code></a>
 </dd>
 <p></p>
 <dt><strong><a name="item_l">$length = $line-&gt;l</a></strong><br />
index 4b27e9cd5f45d3656d97b83d57f13cd972e6ebe9..68dfea117bae5e935996e18e66572f955c6a738d 100644 (file)
 .\" ========================================================================
 .\"
 .IX Title "rxvt 3"
-.TH rxvt 3 "2006-01-04" "6.3" "RXVT-UNICODE"
+.TH rxvt 3 "2006-01-07" "6.3" "RXVT-UNICODE"
 .SH "NAME"
 @@RXVT_NAME@@perl \- rxvt\-unicode's embedded perl interpreter
 .SH "SYNOPSIS"
@@ -194,6 +194,14 @@ Rot\-13 the selection when activated. Used via keyboard trigger:
 .IP "digital-clock" 4
 .IX Item "digital-clock"
 Displays a digital clock using the built-in overlay.
+.IP "mark-urls" 4
+.IX Item "mark-urls"
+Uses per-line display filtering (\f(CW\*(C`on_line_update\*(C'\fR) to underline urls.
+.IP "block-graphics-to-ascii" 4
+.IX Item "block-graphics-to-ascii"
+A not very useful example of filtering all text output to the terminal,
+by replacing all line-drawing characters (U+2500 .. U+259F) by a
+similar-looking ascii character.
 .IP "example-refresh-hooks" 4
 .IX Item "example-refresh-hooks"
 Displays a very simple digital clock in the upper right corner of the
@@ -211,9 +219,25 @@ When objects are destroyed on the \*(C+ side, the perl object hashes are
 emptied, so its best to store related objects such as time watchers and
 the like inside the terminal object so they get destroyed as soon as the
 terminal is destroyed.
+.PP
+Argument names also often indicate the type of a parameter. Here are some
+hints on what they mean:
+.IP "$text" 4
+.IX Item "$text"
+Rxvt-unicodes special way of encoding text, where one \*(L"unicode\*(R" character
+always represents one screen cell. See row_t for a discussion of this format.
+.IP "$string" 4
+.IX Item "$string"
+A perl text string, with an emphasis on \fItext\fR. It can store all unicode
+characters and is to be distinguished with text encoded in a specific
+encoding (often locale\-specific) and binary data.
+.IP "$octets" 4
+.IX Item "$octets"
+Either binary data or \- more common \- a text string encoded in a
+locale-specific way.
 .Sh "Hooks"
 .IX Subsection "Hooks"
-The following subroutines can be declared in loaded scripts, and will be
+The following subroutines can be declared in extension files, and will be
 called whenever the relevant event happens.
 .PP
 The first argument passed to them is an object private to each terminal
@@ -231,7 +255,10 @@ When in doubt, return a false value (preferably \f(CW\*(C`()\*(C'\fR).
 .el .IP "on_init \f(CW$term\fR" 4
 .IX Item "on_init $term"
 Called after a new terminal object has been initialized, but before
-windows are created or the command gets run.
+windows are created or the command gets run. Most methods are unsafe to
+call or deliver senseless data, as terminal size and other characteristics
+have not yet been determined. You can safely query and change resources,
+though.
 .ie n .IP "on_reset $term" 4
 .el .IP "on_reset \f(CW$term\fR" 4
 .IX Item "on_reset $term"
@@ -312,6 +339,28 @@ future.
 Be careful not ever to trust (in a security sense) the data you receive,
 as its source can not easily be controleld (e\-mail content, messages from
 other users on the same system etc.).
+.ie n .IP "on_add_lines $term\fR, \f(CW$string" 4
+.el .IP "on_add_lines \f(CW$term\fR, \f(CW$string\fR" 4
+.IX Item "on_add_lines $term, $string"
+Called whenever text is about to be output, with the text as argument. You
+can filter/change and output the text yourself by returning a true value
+and calling \f(CW\*(C`$term\->scr_add_lines\*(C'\fR yourself. Please note that this
+might be very slow, however, as your hook is called for \fBall\fR text being
+output.
+.ie n .IP "on_line_update $term\fR, \f(CW$row" 4
+.el .IP "on_line_update \f(CW$term\fR, \f(CW$row\fR" 4
+.IX Item "on_line_update $term, $row"
+Called whenever a line was updated or changed. Can be used to filter
+screen output (e.g. underline urls or other useless stuff). Only lines
+that are being shown will be filtered, and, due to performance reasons,
+not always immediately.
+.Sp
+The row number is always the topmost row of the line if the line spans
+multiple rows.
+.Sp
+Please note that, if you change the line, then the hook might get called
+later with the already-modified line (e.g. if unrelated parts change), so
+you cannot just toggle rendition bits, but only set them.
 .ie n .IP "on_refresh_begin $term" 4
 .el .IP "on_refresh_begin \f(CW$term\fR" 4
 .IX Item "on_refresh_begin $term"
@@ -329,16 +378,51 @@ Called just after the screen gets redrawn. See \f(CW\*(C`on_refresh_begin\*(C'\f
 Called whenever the user presses a key combination that has a
 \&\f(CW\*(C`perl:string\*(C'\fR action bound to it (see description of the \fBkeysym\fR
 resource in the @@RXVT_NAME@@(1) manpage).
+.ie n .IP "on_key_press $term\fR, \f(CW$event\fR, \f(CW$octets" 4
+.el .IP "on_key_press \f(CW$term\fR, \f(CW$event\fR, \f(CW$octets\fR" 4
+.IX Item "on_key_press $term, $event, $octets"
+.PD 0
+.ie n .IP "on_key_release $term\fR, \f(CW$event" 4
+.el .IP "on_key_release \f(CW$term\fR, \f(CW$event\fR" 4
+.IX Item "on_key_release $term, $event"
+.ie n .IP "on_button_press $term\fR, \f(CW$event" 4
+.el .IP "on_button_press \f(CW$term\fR, \f(CW$event\fR" 4
+.IX Item "on_button_press $term, $event"
+.ie n .IP "on_button_release $term\fR, \f(CW$event" 4
+.el .IP "on_button_release \f(CW$term\fR, \f(CW$event\fR" 4
+.IX Item "on_button_release $term, $event"
+.ie n .IP "on_motion_notify $term\fR, \f(CW$event" 4
+.el .IP "on_motion_notify \f(CW$term\fR, \f(CW$event\fR" 4
+.IX Item "on_motion_notify $term, $event"
+.PD
+Called whenever the corresponding X event is received for the terminal If
+the hook returns true, then the even will be ignored by rxvt\-unicode.
+.Sp
+The event is a hash with most values as named by Xlib (see the XEvent
+manpage), with the additional members \f(CW\*(C`row\*(C'\fR and \f(CW\*(C`col\*(C'\fR, which are the row
+and column under the mouse cursor.
+.Sp
+\&\f(CW\*(C`on_key_press\*(C'\fR additionally receives the string rxvt-unicode would
+output, if any, in locale-specific encoding.
+.Sp
+subwindow.
 .ie n .Sh "Variables in the ""urxvt"" Package"
 .el .Sh "Variables in the \f(CWurxvt\fP Package"
 .IX Subsection "Variables in the urxvt Package"
 .IP "$urxvt::TERM" 4
 .IX Item "$urxvt::TERM"
-The current terminal. Whenever a callback/Hook is bein executed, this
-variable stores the current \f(CW\*(C`urxvt::term\*(C'\fR object.
+The current terminal. This variable stores the current \f(CW\*(C`urxvt::term\*(C'\fR
+object, whenever a callback/hook is executing.
 .ie n .Sh "Functions in the ""urxvt"" Package"
 .el .Sh "Functions in the \f(CWurxvt\fP Package"
 .IX Subsection "Functions in the urxvt Package"
+.IP "$term = new urxvt [arg...]" 4
+.IX Item "$term = new urxvt [arg...]"
+Creates a new terminal, very similar as if you had started it with
+\&\f(CW\*(C`system $binfile, arg...\*(C'\fR. Croaks (and probably outputs an error message)
+if the new instance couldn't be created.  Returns \f(CW\*(C`undef\*(C'\fR if the new
+instance didn't initialise perl, and the terminal object otherwise. The
+\&\f(CW\*(C`init\*(C'\fR and \f(CW\*(C`start\*(C'\fR hooks will be called during the call.
 .ie n .IP "urxvt::fatal $errormessage" 4
 .el .IP "urxvt::fatal \f(CW$errormessage\fR" 4
 .IX Item "urxvt::fatal $errormessage"
@@ -409,6 +493,9 @@ Change the custom value.
 .ie n .Sh "The ""urxvt::term"" Class"
 .el .Sh "The \f(CWurxvt::term\fP Class"
 .IX Subsection "The urxvt::term Class"
+.IP "$term\->destroy" 4
+.IX Item "$term->destroy"
+Destroy the terminal object (close the window, free resources etc.).
 .ie n .IP "$value = $term\fR\->resource ($name[, \f(CW$newval])" 4
 .el .IP "$value = \f(CW$term\fR\->resource ($name[, \f(CW$newval\fR])" 4
 .IX Item "$value = $term->resource ($name[, $newval])"
@@ -445,11 +532,11 @@ list:
 \&  shade term_name title transparent transparent_all tripleclickwords
 \&  utmpInhibit visualBell
 .Ve
-.ie n .IP "$rend = $term\->screen_rstyle ([$new_rstyle])" 4
-.el .IP "$rend = \f(CW$term\fR\->screen_rstyle ([$new_rstyle])" 4
-.IX Item "$rend = $term->screen_rstyle ([$new_rstyle])"
-Return and optionally change the current rendition. Text thta is output by
-the temrianl application will use this style.
+.ie n .IP "$rend = $term\->rstyle ([$new_rstyle])" 4
+.el .IP "$rend = \f(CW$term\fR\->rstyle ([$new_rstyle])" 4
+.IX Item "$rend = $term->rstyle ([$new_rstyle])"
+Return and optionally change the current rendition. Text that is output by
+the terminal application will use this style.
 .ie n .IP "($row, $col\fR) = \f(CW$term\fR\->screen_cur ([$row, \f(CW$col])" 4
 .el .IP "($row, \f(CW$col\fR) = \f(CW$term\fR\->screen_cur ([$row, \f(CW$col\fR])" 4
 .IX Item "($row, $col) = $term->screen_cur ([$row, $col])"
@@ -483,27 +570,20 @@ Return the current selection text and optionally replace it by \f(CW$newtext\fR.
 #Create a simple multi-line overlay box. See the next method for details.
 #
 #=cut
-.Sp
-sub urxvt::term::scr_overlay {
-die;
-   my ($self, \f(CW$x\fR, \f(CW$y\fR, \f(CW$text\fR) = \f(CW@_\fR;
-.Sp
-.Vb 1
-\&   my @lines = split /\en/, $text;
-.Ve
-.Sp
-.Vb 4
-\&   my $w = 0;
-\&   for (map $self->strwidth ($_), @lines) {
-\&      $w = $_ if $w < $_;
-\&   }
-.Ve
-.Sp
-.Vb 3
-\&   $self->scr_overlay_new ($x, $y, $w, scalar @lines);
-\&   $self->scr_overlay_set (0, $_, $lines[$_]) for 0.. $#lines;
-\&}
-.Ve
+#
+#sub urxvt::term::scr_overlay {
+#   my ($self, \f(CW$x\fR, \f(CW$y\fR, \f(CW$text\fR) = \f(CW@_\fR;
+#
+#   my \f(CW@lines\fR = split /\en/, \f(CW$text\fR;
+#
+#   my \f(CW$w\fR = 0;
+#   for (map \f(CW$self\fR\->strwidth ($_), \f(CW@lines\fR) {
+#      \f(CW$w\fR = \f(CW$_\fR if \f(CW$w\fR < \f(CW$_\fR;
+#   }
+#
+#   \f(CW$self\fR\->scr_overlay_new ($x, \f(CW$y\fR, \f(CW$w\fR, scalar \f(CW@lines\fR);
+#   \f(CW$self\fR\->scr_overlay_set (0, \f(CW$_\fR, \f(CW$lines\fR[$_]) for 0.. $#lines;
+#}
 .ie n .IP "$term\->overlay ($x, $y\fR, \f(CW$width\fR, \f(CW$height\fR[, \f(CW$rstyle\fR[, \f(CW$border]])" 4
 .el .IP "$term\->overlay ($x, \f(CW$y\fR, \f(CW$width\fR, \f(CW$height\fR[, \f(CW$rstyle\fR[, \f(CW$border\fR]])" 4
 .IX Item "$term->overlay ($x, $y, $width, $height[, $rstyle[, $border]])"
@@ -537,24 +617,47 @@ If hidden, display the overlay again.
 .RE
 .RS 4
 .RE
-.ie n .IP "$cellwidth = $term\fR\->strwidth \f(CW$string" 4
-.el .IP "$cellwidth = \f(CW$term\fR\->strwidth \f(CW$string\fR" 4
-.IX Item "$cellwidth = $term->strwidth $string"
+.ie n .IP "$cellwidth = $term\->strwidth ($string)" 4
+.el .IP "$cellwidth = \f(CW$term\fR\->strwidth ($string)" 4
+.IX Item "$cellwidth = $term->strwidth ($string)"
 Returns the number of screen-cells this string would need. Correctly
 accounts for wide and combining characters.
-.ie n .IP "$octets = $term\fR\->locale_encode \f(CW$string" 4
-.el .IP "$octets = \f(CW$term\fR\->locale_encode \f(CW$string\fR" 4
-.IX Item "$octets = $term->locale_encode $string"
+.ie n .IP "$octets = $term\->locale_encode ($string)" 4
+.el .IP "$octets = \f(CW$term\fR\->locale_encode ($string)" 4
+.IX Item "$octets = $term->locale_encode ($string)"
 Convert the given text string into the corresponding locale encoding.
-.ie n .IP "$string = $term\fR\->locale_decode \f(CW$octets" 4
-.el .IP "$string = \f(CW$term\fR\->locale_decode \f(CW$octets\fR" 4
-.IX Item "$string = $term->locale_decode $octets"
+.ie n .IP "$string = $term\->locale_decode ($octets)" 4
+.el .IP "$string = \f(CW$term\fR\->locale_decode ($octets)" 4
+.IX Item "$string = $term->locale_decode ($octets)"
 Convert the given locale-encoded octets into a perl string.
+.IP "$term\->scr_add_lines ($string)" 4
+.IX Item "$term->scr_add_lines ($string)"
+Write the given text string to the screen, as if output by the application
+running inside the terminal. It may not contain command sequences (escape
+codes), but is free to use line feeds, carriage returns and tabs. The
+string is a normal text string, not in locale-dependent encoding.
+.Sp
+Normally its not a good idea to use this function, as programs might be
+confused by changes in cursor position or scrolling. Its useful inside a
+\&\f(CW\*(C`on_add_lines\*(C'\fR hook, though.
+.IP "$term\->cmd_parse ($octets)" 4
+.IX Item "$term->cmd_parse ($octets)"
+Similar to \f(CW\*(C`scr_add_lines\*(C'\fR, but the argument must be in the
+locale-specific encoding of the terminal and can contain command sequences
+(escape codes) that will be interpreted.
 .IP "$term\->tt_write ($octets)" 4
 .IX Item "$term->tt_write ($octets)"
 Write the octets given in \f(CW$data\fR to the tty (i.e. as program input). To
 pass characters instead of octets, you should convert your strings first
 to the locale-specific encoding using \f(CW\*(C`$term\->locale_encode\*(C'\fR.
+.ie n .IP "$windowid = $term\->parent" 4
+.el .IP "$windowid = \f(CW$term\fR\->parent" 4
+.IX Item "$windowid = $term->parent"
+Return the window id of the toplevel window.
+.ie n .IP "$windowid = $term\->vt" 4
+.el .IP "$windowid = \f(CW$term\fR\->vt" 4
+.IX Item "$windowid = $term->vt"
+Return the window id of the terminal window.
 .ie n .IP "$window_width = $term\->width" 4
 .el .IP "$window_width = \f(CW$term\fR\->width" 4
 .IX Item "$window_width = $term->width"
@@ -663,14 +766,14 @@ Create and return a new \f(CW\*(C`urxvt::line\*(C'\fR object that stores informa
 about the logical line that row \f(CW$row_number\fR is part of. It supports the
 following methods:
 .RS 4
-.ie n .IP "$text = $line\->t" 4
-.el .IP "$text = \f(CW$line\fR\->t" 4
-.IX Item "$text = $line->t"
-Returns the full text of the line, similar to \f(CW\*(C`ROW_t\*(C'\fR
-.ie n .IP "$rend = $line\->r" 4
-.el .IP "$rend = \f(CW$line\fR\->r" 4
-.IX Item "$rend = $line->r"
-Returns the full rendition array of the line, similar to \f(CW\*(C`ROW_r\*(C'\fR
+.ie n .IP "$text = $line\->t ([$new_text])" 4
+.el .IP "$text = \f(CW$line\fR\->t ([$new_text])" 4
+.IX Item "$text = $line->t ([$new_text])"
+Returns or replaces the full text of the line, similar to \f(CW\*(C`ROW_t\*(C'\fR
+.ie n .IP "$rend = $line\->r ([$new_rend])" 4
+.el .IP "$rend = \f(CW$line\fR\->r ([$new_rend])" 4
+.IX Item "$rend = $line->r ([$new_rend])"
+Returns or replaces the full rendition array of the line, similar to \f(CW\*(C`ROW_r\*(C'\fR
 .ie n .IP "$length = $line\->l" 4
 .el .IP "$length = \f(CW$line\fR\->l" 4
 .IX Item "$length = $line->l"
index a228b5bd2602059e02d8b2fefb68609aed64f979..5e5c137238eb59d006b18f1b0b088992c0b842ed 100644 (file)
@@ -47,6 +47,15 @@ DESCRIPTION
     digital-clock
         Displays a digital clock using the built-in overlay.
 
+    mark-urls
+        Uses per-line display filtering ("on_line_update") to underline
+        urls.
+
+    block-graphics-to-ascii
+        A not very useful example of filtering all text output to the
+        terminal, by replacing all line-drawing characters (U+2500 ..
+        U+259F) by a similar-looking ascii character.
+
     example-refresh-hooks
         Displays a very simple digital clock in the upper right corner of
         the window. Illustrates overwriting the refresh callbacks to create
@@ -64,9 +73,26 @@ DESCRIPTION
     the like inside the terminal object so they get destroyed as soon as the
     terminal is destroyed.
 
+    Argument names also often indicate the type of a parameter. Here are
+    some hints on what they mean:
+
+    $text
+        Rxvt-unicodes special way of encoding text, where one "unicode"
+        character always represents one screen cell. See row_t for a
+        discussion of this format.
+
+    $string
+        A perl text string, with an emphasis on *text*. It can store all
+        unicode characters and is to be distinguished with text encoded in a
+        specific encoding (often locale-specific) and binary data.
+
+    $octets
+        Either binary data or - more common - a text string encoded in a
+        locale-specific way.
+
   Hooks
-    The following subroutines can be declared in loaded scripts, and will be
-    called whenever the relevant event happens.
+    The following subroutines can be declared in extension files, and will
+    be called whenever the relevant event happens.
 
     The first argument passed to them is an object private to each terminal
     and extension package. You can call all "urxvt::term" methods on it, but
@@ -83,7 +109,10 @@ DESCRIPTION
 
     on_init $term
         Called after a new terminal object has been initialized, but before
-        windows are created or the command gets run.
+        windows are created or the command gets run. Most methods are unsafe
+        to call or deliver senseless data, as terminal size and other
+        characteristics have not yet been determined. You can safely query
+        and change resources, though.
 
     on_reset $term
         Called after the screen is "reset" for any reason, such as resizing
@@ -157,6 +186,27 @@ DESCRIPTION
         receive, as its source can not easily be controleld (e-mail content,
         messages from other users on the same system etc.).
 
+    on_add_lines $term, $string
+        Called whenever text is about to be output, with the text as
+        argument. You can filter/change and output the text yourself by
+        returning a true value and calling "$term->scr_add_lines" yourself.
+        Please note that this might be very slow, however, as your hook is
+        called for all text being output.
+
+    on_line_update $term, $row
+        Called whenever a line was updated or changed. Can be used to filter
+        screen output (e.g. underline urls or other useless stuff). Only
+        lines that are being shown will be filtered, and, due to performance
+        reasons, not always immediately.
+
+        The row number is always the topmost row of the line if the line
+        spans multiple rows.
+
+        Please note that, if you change the line, then the hook might get
+        called later with the already-modified line (e.g. if unrelated parts
+        change), so you cannot just toggle rendition bits, but only set
+        them.
+
     on_refresh_begin $term
         Called just before the screen gets redrawn. Can be used for overlay
         or similar effects by modify terminal contents in refresh_begin, and
@@ -171,12 +221,38 @@ DESCRIPTION
         "perl:string" action bound to it (see description of the keysym
         resource in the rxvt(1) manpage).
 
+    on_key_press $term, $event, $octets
+    on_key_release $term, $event
+    on_button_press $term, $event
+    on_button_release $term, $event
+    on_motion_notify $term, $event
+        Called whenever the corresponding X event is received for the
+        terminal If the hook returns true, then the even will be ignored by
+        rxvt-unicode.
+
+        The event is a hash with most values as named by Xlib (see the
+        XEvent manpage), with the additional members "row" and "col", which
+        are the row and column under the mouse cursor.
+
+        "on_key_press" additionally receives the string rxvt-unicode would
+        output, if any, in locale-specific encoding.
+
+        subwindow.
+
   Variables in the "urxvt" Package
     $urxvt::TERM
-        The current terminal. Whenever a callback/Hook is bein executed,
-        this variable stores the current "urxvt::term" object.
+        The current terminal. This variable stores the current "urxvt::term"
+        object, whenever a callback/hook is executing.
 
   Functions in the "urxvt" Package
+    $term = new urxvt [arg...]
+        Creates a new terminal, very similar as if you had started it with
+        "system $binfile, arg...". Croaks (and probably outputs an error
+        message) if the new instance couldn't be created. Returns "undef" if
+        the new instance didn't initialise perl, and the terminal object
+        otherwise. The "init" and "start" hooks will be called during the
+        call.
+
     urxvt::fatal $errormessage
         Fatally aborts execution with the given error message. Avoid at all
         costs! The only time this is acceptable is when the terminal process
@@ -233,6 +309,9 @@ DESCRIPTION
         Change the custom value.
 
   The "urxvt::term" Class
+    $term->destroy
+        Destroy the terminal object (close the window, free resources etc.).
+
     $value = $term->resource ($name[, $newval])
         Returns the current resource value associated with a given name and
         optionally sets a new value. Setting values is most useful in the
@@ -267,9 +346,9 @@ DESCRIPTION
           shade term_name title transparent transparent_all tripleclickwords
           utmpInhibit visualBell
 
-    $rend = $term->screen_rstyle ([$new_rstyle])
-        Return and optionally change the current rendition. Text thta is
-        output by the temrianl application will use this style.
+    $rend = $term->rstyle ([$new_rstyle])
+        Return and optionally change the current rendition. Text that is
+        output by the terminal application will use this style.
 
     ($row, $col) = $term->screen_cur ([$row, $col])
         Return the current coordinates of the text cursor position and
@@ -291,20 +370,12 @@ DESCRIPTION
         $newtext.
 
         #=item $term->overlay ($x, $y, $text) # #Create a simple multi-line
-        overlay box. See the next method for details. # #=cut
-
-        sub urxvt::term::scr_overlay { die; my ($self, $x, $y, $text) = @_;
-
-           my @lines = split /\n/, $text;
-
-           my $w = 0;
-           for (map $self->strwidth ($_), @lines) {
-              $w = $_ if $w < $_;
-           }
-
-           $self->scr_overlay_new ($x, $y, $w, scalar @lines);
-           $self->scr_overlay_set (0, $_, $lines[$_]) for 0.. $#lines;
-        }
+        overlay box. See the next method for details. # #=cut # #sub
+        urxvt::term::scr_overlay { # my ($self, $x, $y, $text) = @_; # # my
+        @lines = split /\n/, $text; # # my $w = 0; # for (map
+        $self->strwidth ($_), @lines) { # $w = $_ if $w < $_; # } # #
+        $self->scr_overlay_new ($x, $y, $w, scalar @lines); #
+        $self->scr_overlay_set (0, $_, $lines[$_]) for 0.. $#lines; #}
 
     $term->overlay ($x, $y, $width, $height[, $rstyle[, $border]])
         Create a new (empty) overlay at the given position with the given
@@ -333,23 +404,45 @@ DESCRIPTION
         $overlay->show
             If hidden, display the overlay again.
 
-    $cellwidth = $term->strwidth $string
+    $cellwidth = $term->strwidth ($string)
         Returns the number of screen-cells this string would need. Correctly
         accounts for wide and combining characters.
 
-    $octets = $term->locale_encode $string
+    $octets = $term->locale_encode ($string)
         Convert the given text string into the corresponding locale
         encoding.
 
-    $string = $term->locale_decode $octets
+    $string = $term->locale_decode ($octets)
         Convert the given locale-encoded octets into a perl string.
 
+    $term->scr_add_lines ($string)
+        Write the given text string to the screen, as if output by the
+        application running inside the terminal. It may not contain command
+        sequences (escape codes), but is free to use line feeds, carriage
+        returns and tabs. The string is a normal text string, not in
+        locale-dependent encoding.
+
+        Normally its not a good idea to use this function, as programs might
+        be confused by changes in cursor position or scrolling. Its useful
+        inside a "on_add_lines" hook, though.
+
+    $term->cmd_parse ($octets)
+        Similar to "scr_add_lines", but the argument must be in the
+        locale-specific encoding of the terminal and can contain command
+        sequences (escape codes) that will be interpreted.
+
     $term->tt_write ($octets)
         Write the octets given in $data to the tty (i.e. as program input).
         To pass characters instead of octets, you should convert your
         strings first to the locale-specific encoding using
         "$term->locale_encode".
 
+    $windowid = $term->parent
+        Return the window id of the toplevel window.
+
+    $windowid = $term->vt
+        Return the window id of the terminal window.
+
     $window_width = $term->width
     $window_height = $term->height
     $font_width = $term->fwidth
@@ -426,11 +519,13 @@ DESCRIPTION
         about the logical line that row $row_number is part of. It supports
         the following methods:
 
-        $text = $line->t
-            Returns the full text of the line, similar to "ROW_t"
+        $text = $line->t ([$new_text])
+            Returns or replaces the full text of the line, similar to
+            "ROW_t"
 
-        $rend = $line->r
-            Returns the full rendition array of the line, similar to "ROW_r"
+        $rend = $line->r ([$new_rend])
+            Returns or replaces the full rendition array of the line,
+            similar to "ROW_r"
 
         $length = $line->l
             Returns the length of the line in cells, similar to "ROW_l".
index ea90adbe8a3f393ff29c241e70b3042aae10d1fc..85a45274cbcb0ee6e72a179a654b7e0baaf42575 100644 (file)
@@ -707,6 +707,17 @@ MODULE = urxvt             PACKAGE = urxvt::term
 void
 rxvt_term::destroy ()
 
+void
+rxvt_term::grab (int eventtime)
+       CODE:
+{
+return;
+        XGrabPointer (THIS->display->display, THIS->vt, 0,
+                      ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask,
+                      GrabModeAsync, GrabModeAsync, None, None, eventtime);
+        XGrabKeyboard (THIS->display->display, THIS->vt, 0, GrabModeAsync, GrabModeAsync, eventtime);
+}
+
 int
 rxvt_term::strwidth (SV *str)
        CODE:
@@ -1148,7 +1159,9 @@ rxvt_term::cmd_parse (SV *octets)
         THIS->cmdbuf_ptr  = str;
         THIS->cmdbuf_endp = str + len;
 
+       rxvt_push_locale (THIS->locale);
         THIS->cmd_parse ();
+       rxvt_pop_locale ();
 
         THIS->cmdbuf_ptr  = old_cmdbuf_ptr;
         THIS->cmdbuf_endp = old_cmdbuf_endp;
index 7f8cbfad0e0a85fc4f9f234bdd26d5776997ffd5..8624a51e8bbbc7771aa8e59874fbe3c99e345546 100644 (file)
@@ -118,7 +118,7 @@ locale-specific way.
 
 =head2 Hooks
 
-The following subroutines can be declared in loaded scripts, and will be
+The following subroutines can be declared in extension files, and will be
 called whenever the relevant event happens.
 
 The first argument passed to them is an object private to each terminal
@@ -292,8 +292,8 @@ subwindow.
 
 =item $urxvt::TERM
 
-The current terminal. Whenever a callback/Hook is bein executed, this
-variable stores the current C<urxvt::term> object.
+The current terminal. This variable stores the current C<urxvt::term>
+object, whenever a callback/hook is executing.
 
 =back