From: root Date: Sun, 8 Jan 2006 00:20:12 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=a320a73e37a9d58e12745f0b680cc77c6f51300b;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/Changes b/Changes index 9ad43bef..78229dba 100644 --- a/Changes +++ b/Changes @@ -13,6 +13,8 @@ TODO: document transient_for, vt - perl: implement additional hook: line_update, add_lines. - perl: urxvt::line now can set via ->t and ->r. + - perl: changed interpretation of --perl-ext-common and -pe. + - perl: much increased functionality, better overlays, popup support. 6.3 Wed Jan 4 22:37:10 CET 2006 - SECURITY FIX: on systems using openpty, permissions were diff --git a/doc/rxvt.1.html b/doc/rxvt.1.html index 6b5eafd6..503dea3d 100644 --- a/doc/rxvt.1.html +++ b/doc/rxvt.1.html @@ -645,8 +645,8 @@ longer example is in doc/pty-fd):

-pe string
-Comma-separated list of perl extension scripts to use in this terminal -instance. See resource perl-ext. +Comma-separated list of perl extension scripts to use (or not to use) in +this terminal instance. See resource perl-ext for details.

@@ -1455,13 +1455,25 @@ info):

perl-ext: string
-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 -initialized. The idea behind two options is that perl-ext-common will -be used for extensions that should be available to all instances, while -perl-ext is used for specific instances; option -pe. +Comma-separated list(s) of perl extension scripts (default: default) to +use in this terminal instance; option -pe. +
+
+

Extension names can be prefixed with a - sign to prohibit using +it. This can be useful to selectively disable some extensions loaded +by default, or specified via the perl-ext-common resource. For +example, default,-selection will use all the default extension except +selection.

+
+
+

Each extension is looked up in the library directories, loaded if +necessary, and bound to the current terminal instance.

+
+
+

If both of these resources are the empty string, then the perl +interpreter will not be initialized. The idea behind two options is that +perl-ext-common will be used for extensions that should be available to +all instances, while perl-ext is used for specific instances.

perl-eval: string
diff --git a/doc/rxvt.1.man.in b/doc/rxvt.1.man.in index 7de2bce3..6ca90217 100644 --- a/doc/rxvt.1.man.in +++ b/doc/rxvt.1.man.in @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "rxvt 1" -.TH rxvt 1 "2006-01-07" "6.3" "RXVT-UNICODE" +.TH rxvt 1 "2006-01-08" "6.3" "RXVT-UNICODE" .SH "NAME" rxvt\-unicode (ouR XVT, unicode) \- (a VT102 emulator for the X window system) .SH "SYNOPSIS" @@ -546,8 +546,8 @@ longer example is in \fIdoc/pty\-fd\fR): .Ve .IP "\fB\-pe\fR \fIstring\fR" 4 .IX Item "-pe string" -Comma-separated list of perl extension scripts to use in this terminal -instance. See resource \fBperl-ext\fR. +Comma-separated list of perl extension scripts to use (or not to use) in +this terminal instance. See resource \fBperl-ext\fR for details. .SH "RESOURCES (available also as long\-options)" .IX Header "RESOURCES (available also as long-options)" Note: `@@RXVT_NAME@@ \-\-help' gives a list of all resources (long @@ -1112,13 +1112,22 @@ info): .IP "\fBperl-ext\fR: \fIstring\fR" 4 .IX Item "perl-ext: string" .PD -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 -initialized. The idea behind two options is that \fBperl-ext-common\fR will -be used for extensions that should be available to all instances, while -\&\fBperl-ext\fR is used for specific instances; option \fB\-pe\fR. +Comma-separated list(s) of perl extension scripts (default: \f(CW\*(C`default\*(C'\fR) to +use in this terminal instance; option \fB\-pe\fR. +.Sp +Extension names can be prefixed with a \f(CW\*(C`\-\*(C'\fR sign to prohibit using +it. This can be useful to selectively disable some extensions loaded +by default, or specified via the \f(CW\*(C`perl\-ext\-common\*(C'\fR resource. For +example, \f(CW\*(C`default,\-selection\*(C'\fR will use all the default extension except +\&\f(CW\*(C`selection\*(C'\fR. +.Sp +Each extension is looked up in the library directories, loaded if +necessary, and bound to the current terminal instance. +.Sp +If both of these resources are the empty string, then the perl +interpreter will not be initialized. The idea behind two options is that +\&\fBperl-ext-common\fR will be used for extensions that should be available to +all instances, while \fBperl-ext\fR is used for specific instances. .IP "\fBperl-eval\fR: \fIstring\fR" 4 .IX Item "perl-eval: string" Perl code to be evaluated when all extensions have been registered. See the diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod index 56ebba25..9fd984ce 100644 --- a/doc/rxvt.1.pod +++ b/doc/rxvt.1.pod @@ -468,8 +468,8 @@ longer example is in F): =item B<-pe> I -Comma-separated list of perl extension scripts to use in this terminal -instance. See resource B. +Comma-separated list of perl extension scripts to use (or not to use) in +this terminal instance. See resource B for details. =back @@ -1086,13 +1086,22 @@ info): =item B: I -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 -initialized. The idea behind two options is that B will -be used for extensions that should be available to all instances, while -B is used for specific instances; option B<-pe>. +Comma-separated list(s) of perl extension scripts (default: C) to +use in this terminal instance; option B<-pe>. + +Extension names can be prefixed with a C<-> sign to prohibit using +it. This can be useful to selectively disable some extensions loaded +by default, or specified via the C resource. For +example, C will use all the default extension except +C. + +Each extension is looked up in the library directories, loaded if +necessary, and bound to the current terminal instance. + +If both of these resources are the empty string, then the perl +interpreter will not be initialized. The idea behind two options is that +B will be used for extensions that should be available to +all instances, while B is used for specific instances. =item B: I diff --git a/doc/rxvt.1.txt b/doc/rxvt.1.txt index a57b0407..f034ab62 100644 --- a/doc/rxvt.1.txt +++ b/doc/rxvt.1.txt @@ -402,8 +402,8 @@ OPTIONS while (<$slave>) { print $slave "got <$_>\n" } -pe *string* - Comma-separated list of perl extension scripts to use in this - terminal instance. See resource perl-ext. + Comma-separated list of perl extension scripts to use (or not to + use) in this terminal instance. See resource perl-ext for details. RESOURCES (available also as long-options) Note: `rxvt --help' gives a list of all resources (long options) @@ -943,14 +943,23 @@ RESOURCES (available also as long-options) perl-ext-common: *string* perl-ext: *string* - 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 + Comma-separated list(s) of perl extension scripts (default: + "default") to use in this terminal instance; option -pe. + + Extension names can be prefixed with a "-" sign to prohibit using + it. This can be useful to selectively disable some extensions loaded + by default, or specified via the "perl-ext-common" resource. For + example, "default,-selection" will use all the default extension + except "selection". + + Each extension is looked up in the library directories, loaded if + necessary, and bound to the current terminal instance. + + If both of these resources are the empty string, then the perl interpreter will not be initialized. The idea behind two options is that perl-ext-common will be used for extensions that should be available to all instances, while perl-ext is used for specific - instances; option -pe. + instances. perl-eval: *string* Perl code to be evaluated when all extensions have been registered. diff --git a/doc/rxvtperl.3.html b/doc/rxvtperl.3.html index 19cb30e0..3338aa9e 100644 --- a/doc/rxvtperl.3.html +++ b/doc/rxvtperl.3.html @@ -24,6 +24,7 @@
  • Functions in the urxvt Package
  • RENDITION
  • The urxvt::term Class
  • +
  • The urxvt::popup Class
  • The urxvt::timer Class
  • The urxvt::iow Class
  • @@ -63,8 +64,8 @@


    DESCRIPTION

    -

    Everytime a terminal object gets created, scripts specified via the -perl resource are loaded and associated with it.

    +

    Everytime a terminal object gets created, extension scripts specified via +the perl resource are loaded and associated with it.

    Scripts are compiled in a 'use strict' and 'use utf8' environment, and thus must be encoded as UTF-8.

    Each script will only ever be loaded once, even in rxvtd, where @@ -171,10 +172,11 @@ locale-specific way.

    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 +and extension package. You can call all urxvt::term methods on it, but its not a real urxvt::term object. Instead, the real urxvt::term object that is shared between all packages is stored in the term -member.

    +member. It is, however, blessed intot he package of the extension script, +so for all practical purposes you can treat an extension script as a class.

    All of them must return a boolean value. If it is true, then the event counts as being consumed, and the invocation of other hooks is skipped, and the relevant action might not be carried out by the C++ code.

    @@ -240,20 +242,6 @@ processing.

    See the selection example extension.

    -
    on_focus_in $term
    -
    -
    -Called whenever the window gets the keyboard focus, before urxvt does -focus in processing. -
    -

    -
    on_focus_out $term
    -
    -
    -Called wheneever the window loses keyboard focus, before urxvt does focus -out processing. -
    -

    on_view_change $term, $offset
    @@ -348,6 +336,20 @@ Called whenever the user presses a key combination that has a resource in the rxvt(1) manpage).

    +
    on_focus_in $term
    +
    +
    +Called whenever the window gets the keyboard focus, before rxvt-unicode +does focus in processing. +
    +

    +
    on_focus_out $term
    +
    +
    +Called wheneever the window loses keyboard focus, before rxvt-unicode does +focus out processing. +
    +

    on_key_press $term, $event, $octets
    on_key_release $term, $event
    @@ -358,6 +360,10 @@ resource in the rxvt(1) manpage).
    on_motion_notify $term, $event
    +
    on_map_notify $term, $event
    +
    +
    on_unmap_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. @@ -425,6 +431,16 @@ correct place, e.g. on stderr of the connecting urxvtc client.

    Returns the ``current time'' (as per the event loop).
    +

    +
    urxvt::CurrentTime
    +
    +
    urxvt::ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, +Mod3Mask, Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask, +Button4Mask, Button5Mask, AnyModifier
    +
    +
    +Various constants for use in X events. +

    @@ -498,6 +514,27 @@ Change the custom value. Destroy the terminal object (close the window, free resources etc.).

    +
    $isset = $term->option ($optval[, $set])
    +
    +
    +Returns true if the option specified by $optval is enabled, and +optionally change it. All option values are stored by name in the hash +%urxvt::OPTION. Options not enabled in this binary are not in the hash. +
    +
    +

    Here is a a likely non-exhaustive list of option names, please see the +source file /src/optinc.h to see the actual list:

    +
    +
    +
    + borderLess console cursorBlink cursorUnderline hold iconic insecure
    + intensityStyles jumpScroll loginShell mapAlert meta8 mouseWheelScrollPage
    + pastableTabs pointerBlank reverseVideo scrollBar scrollBar_floating
    + scrollBar_right scrollTtyKeypress scrollTtyOutput scrollWithBuffer
    + secondaryScreen secondaryScroll skipBuiltinGlyphs transparent
    + tripleclickwords utmpInhibit visualBell
    +
    +

    $value = $term->resource ($name[, $newval])
    @@ -521,8 +558,8 @@ terminal is destroyed, so changing options frequently will eat memory.

    Here is a a likely non-exhaustive list of resource names, not all of which -are supported in every build, please see the source to see the actual -list:

    +are supported in every build, please see the source file /src/rsinc.h +to see the actual list:

    @@ -642,6 +679,14 @@ If visible, hide the overlay, but do not destroy it.
     If hidden, display the overlay again.
     

    +
    $popup = $term->popup ($event)
    +
    +
    +Creates a new urxvt::popup object that implements a popup menu. The +$event must be the event causing the menu to pop up (a button event, +currently). +
    +

    $cellwidth = $term->strwidth ($string)
    @@ -731,6 +776,17 @@ Return the window id of the terminal window. Return various integers describing terminal characteristics.

    +
    $modifiermask = $term->ModLevel3Mask
    +
    +
    $modifiermask = $term->ModMetaMask
    +
    +
    $modifiermask = $term->ModNumLockMask
    +
    +
    +Return the modifier masks corresponding to the ``ISO Level 3 Shift'' (often +AltGr), the meta key (often Alt) and the num lock key, if applicable. +
    +

    $view_start = $term->view_start ([$newvalue])
    @@ -878,6 +934,9 @@ Converts rxvt-unicodes text reprsentation into a perl string. See

    +

    The urxvt::popup Class

    +

    +

    The urxvt::timer Class

    This class implements timer watchers/events. Time is represented as a fractional number of seconds since the epoch. Example:

    diff --git a/doc/rxvtperl.3.man.in b/doc/rxvtperl.3.man.in index 68dfea11..3371765a 100644 --- a/doc/rxvtperl.3.man.in +++ b/doc/rxvtperl.3.man.in @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "rxvt 3" -.TH rxvt 3 "2006-01-07" "6.3" "RXVT-UNICODE" +.TH rxvt 3 "2006-01-08" "6.3" "RXVT-UNICODE" .SH "NAME" @@RXVT_NAME@@perl \- rxvt\-unicode's embedded perl interpreter .SH "SYNOPSIS" @@ -154,8 +154,8 @@ .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" -Everytime a terminal object gets created, scripts specified via the -\&\f(CW\*(C`perl\*(C'\fR resource are loaded and associated with it. +Everytime a terminal object gets created, extension scripts specified via +the \f(CW\*(C`perl\*(C'\fR resource are loaded and associated with it. .PP Scripts are compiled in a 'use strict' and 'use utf8' environment, and thus must be encoded as \s-1UTF\-8\s0. @@ -241,10 +241,11 @@ 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 -and extension package. You can call all \f(CW\*(C`urxvt::term\*(C'\fR methods on it, but +and extension package. You can call all \f(CW\*(C`urxvt::term\*(C'\fR methods on it, but its not a real \f(CW\*(C`urxvt::term\*(C'\fR object. Instead, the real \f(CW\*(C`urxvt::term\*(C'\fR object that is shared between all packages is stored in the \f(CW\*(C`term\*(C'\fR -member. +member. It is, however, blessed intot he package of the extension script, +so for all practical purposes you can treat an extension script as a class. .PP All of them must return a boolean value. If it is true, then the event counts as being \fIconsumed\fR, and the invocation of other hooks is skipped, @@ -296,16 +297,6 @@ should extend the selection itelf and return true to suppress the built-in processing. .Sp See the \fIselection\fR example extension. -.ie n .IP "on_focus_in $term" 4 -.el .IP "on_focus_in \f(CW$term\fR" 4 -.IX Item "on_focus_in $term" -Called whenever the window gets the keyboard focus, before urxvt does -focus in processing. -.ie n .IP "on_focus_out $term" 4 -.el .IP "on_focus_out \f(CW$term\fR" 4 -.IX Item "on_focus_out $term" -Called wheneever the window loses keyboard focus, before urxvt does focus -out processing. .ie n .IP "on_view_change $term\fR, \f(CW$offset" 4 .el .IP "on_view_change \f(CW$term\fR, \f(CW$offset\fR" 4 .IX Item "on_view_change $term, $offset" @@ -378,6 +369,16 @@ 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_focus_in $term" 4 +.el .IP "on_focus_in \f(CW$term\fR" 4 +.IX Item "on_focus_in $term" +Called whenever the window gets the keyboard focus, before rxvt-unicode +does focus in processing. +.ie n .IP "on_focus_out $term" 4 +.el .IP "on_focus_out \f(CW$term\fR" 4 +.IX Item "on_focus_out $term" +Called wheneever the window loses keyboard focus, before rxvt-unicode does +focus out processing. .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" @@ -394,6 +395,12 @@ resource in the @@RXVT_NAME@@(1) manpage). .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" +.ie n .IP "on_map_notify $term\fR, \f(CW$event" 4 +.el .IP "on_map_notify \f(CW$term\fR, \f(CW$event\fR" 4 +.IX Item "on_map_notify $term, $event" +.ie n .IP "on_unmap_notify $term\fR, \f(CW$event" 4 +.el .IP "on_unmap_notify \f(CW$term\fR, \f(CW$event\fR" 4 +.IX Item "on_unmap_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. @@ -441,6 +448,13 @@ correct place, e.g. on stderr of the connecting urxvtc client. .IP "$time = urxvt::NOW" 4 .IX Item "$time = urxvt::NOW" Returns the \*(L"current time\*(R" (as per the event loop). +.IP "urxvt::CurrentTime" 4 +.IX Item "urxvt::CurrentTime" +.PD 0 +.IP "urxvt::ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask, AnyModifier" 4 +.IX Item "urxvt::ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask, AnyModifier" +.PD +Various constants for use in X events. .Sh "\s-1RENDITION\s0" .IX Subsection "RENDITION" Rendition bitsets contain information about colour, font, font styles and @@ -496,6 +510,24 @@ Change the custom value. .IP "$term\->destroy" 4 .IX Item "$term->destroy" Destroy the terminal object (close the window, free resources etc.). +.ie n .IP "$isset = $term\fR\->option ($optval[, \f(CW$set])" 4 +.el .IP "$isset = \f(CW$term\fR\->option ($optval[, \f(CW$set\fR])" 4 +.IX Item "$isset = $term->option ($optval[, $set])" +Returns true if the option specified by \f(CW$optval\fR is enabled, and +optionally change it. All option values are stored by name in the hash +\&\f(CW%urxvt::OPTION\fR. Options not enabled in this binary are not in the hash. +.Sp +Here is a a likely non-exhaustive list of option names, please see the +source file \fI/src/optinc.h\fR to see the actual list: +.Sp +.Vb 6 +\& borderLess console cursorBlink cursorUnderline hold iconic insecure +\& intensityStyles jumpScroll loginShell mapAlert meta8 mouseWheelScrollPage +\& pastableTabs pointerBlank reverseVideo scrollBar scrollBar_floating +\& scrollBar_right scrollTtyKeypress scrollTtyOutput scrollWithBuffer +\& secondaryScreen secondaryScroll skipBuiltinGlyphs transparent +\& tripleclickwords utmpInhibit visualBell +.Ve .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])" @@ -515,8 +547,8 @@ Please note that resource strings will currently only be freed when the terminal is destroyed, so changing options frequently will eat memory. .Sp Here is a a likely non-exhaustive list of resource names, not all of which -are supported in every build, please see the source to see the actual -list: +are supported in every build, please see the source file \fI/src/rsinc.h\fR +to see the actual list: .Sp .Vb 12 \& answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont @@ -617,6 +649,12 @@ If hidden, display the overlay again. .RE .RS 4 .RE +.ie n .IP "$popup = $term\->popup ($event)" 4 +.el .IP "$popup = \f(CW$term\fR\->popup ($event)" 4 +.IX Item "$popup = $term->popup ($event)" +Creates a new \f(CW\*(C`urxvt::popup\*(C'\fR object that implements a popup menu. The +\&\f(CW$event\fR \fImust\fR be the event causing the menu to pop up (a button event, +currently). .ie n .IP "$cellwidth = $term\->strwidth ($string)" 4 .el .IP "$cellwidth = \f(CW$term\fR\->strwidth ($string)" 4 .IX Item "$cellwidth = $term->strwidth ($string)" @@ -697,6 +735,19 @@ Return the window id of the terminal window. .IX Item "$lines_in_scrollback = $term->nsaved" .PD Return various integers describing terminal characteristics. +.ie n .IP "$modifiermask = $term\->ModLevel3Mask" 4 +.el .IP "$modifiermask = \f(CW$term\fR\->ModLevel3Mask" 4 +.IX Item "$modifiermask = $term->ModLevel3Mask" +.PD 0 +.ie n .IP "$modifiermask = $term\->ModMetaMask" 4 +.el .IP "$modifiermask = \f(CW$term\fR\->ModMetaMask" 4 +.IX Item "$modifiermask = $term->ModMetaMask" +.ie n .IP "$modifiermask = $term\->ModNumLockMask" 4 +.el .IP "$modifiermask = \f(CW$term\fR\->ModNumLockMask" 4 +.IX Item "$modifiermask = $term->ModNumLockMask" +.PD +Return the modifier masks corresponding to the \*(L"\s-1ISO\s0 Level 3 Shift\*(R" (often +AltGr), the meta key (often Alt) and the num lock key, if applicable. .ie n .IP "$view_start = $term\->view_start ([$newvalue])" 4 .el .IP "$view_start = \f(CW$term\fR\->view_start ([$newvalue])" 4 .IX Item "$view_start = $term->view_start ([$newvalue])" @@ -810,12 +861,16 @@ where one character corresponds to one screen cell. See .IX Item "$string = $term->special_decode $text" Converts rxvt-unicodes text reprsentation into a perl string. See \&\f(CW\*(C`$term\->ROW_t\*(C'\fR for details. +.ie n .Sh "The ""urxvt::popup"" Class" +.el .Sh "The \f(CWurxvt::popup\fP Class" +.IX Subsection "The urxvt::popup Class" .ie n .Sh "The ""urxvt::timer"" Class" .el .Sh "The \f(CWurxvt::timer\fP Class" .IX Subsection "The urxvt::timer Class" +.RS 4 This class implements timer watchers/events. Time is represented as a fractional number of seconds since the epoch. Example: -.PP +.Sp .Vb 8 \& $term->{overlay} = $term->overlay (-1, 0, 8, 1, urxvt::OVERLAY_RSTYLE, 0); \& $term->{timer} = urxvt::timer @@ -860,11 +915,13 @@ Set the event trigger time to \f(CW$tstamp\fR and start the timer. .el .IP "$timer = \f(CW$timer\fR\->stop" 4 .IX Item "$timer = $timer->stop" Stop the timer. +.RE +.RS 4 .ie n .Sh "The ""urxvt::iow"" Class" .el .Sh "The \f(CWurxvt::iow\fP Class" .IX Subsection "The urxvt::iow Class" This class implements io watchers/events. Example: -.PP +.Sp .Vb 12 \& $term->{socket} = ... \& $term->{iow} = urxvt::iow @@ -904,6 +961,8 @@ Start watching for requested events on the given handle. .el .IP "$iow = \f(CW$iow\fR\->stop" 4 .IX Item "$iow = $iow->stop" Stop watching for events on the given filehandle. +.RE +.RS 4 .SH "ENVIRONMENT" .IX Header "ENVIRONMENT" .Sh "\s-1URXVT_PERL_VERBOSITY\s0" @@ -917,6 +976,8 @@ numbers indicate more verbose output. .IX Item "=3 - script loading and management" .IP "=10 \- all events received" 4 .IX Item "=10 - all events received" +.RE +.RS 4 .PD .SH "AUTHOR" .IX Header "AUTHOR" diff --git a/doc/rxvtperl.3.txt b/doc/rxvtperl.3.txt index 5e5c1372..d77a90d8 100644 --- a/doc/rxvtperl.3.txt +++ b/doc/rxvtperl.3.txt @@ -14,8 +14,8 @@ SYNOPSIS rxvt --perl-lib $HOME -pe grab_test DESCRIPTION - Everytime a terminal object gets created, scripts specified via the - "perl" resource are loaded and associated with it. + Everytime a terminal object gets created, extension scripts specified + via the "perl" resource are loaded and associated with it. Scripts are compiled in a 'use strict' and 'use utf8' environment, and thus must be encoded as UTF-8. @@ -98,7 +98,9 @@ DESCRIPTION and extension package. You can call all "urxvt::term" methods on it, but its not a real "urxvt::term" object. Instead, the real "urxvt::term" object that is shared between all packages is stored in the "term" - member. + member. It is, however, blessed intot he package of the extension + script, so for all practical purposes you can treat an extension script + as a class. All of them must return a boolean value. If it is true, then the event counts as being *consumed*, and the invocation of other hooks is @@ -148,14 +150,6 @@ DESCRIPTION See the selection example extension. - on_focus_in $term - Called whenever the window gets the keyboard focus, before urxvt - does focus in processing. - - on_focus_out $term - Called wheneever the window loses keyboard focus, before urxvt does - focus out processing. - on_view_change $term, $offset Called whenever the view offset changes, i..e the user or program scrolls. Offset 0 means display the normal terminal, positive values @@ -221,11 +215,21 @@ DESCRIPTION "perl:string" action bound to it (see description of the keysym resource in the rxvt(1) manpage). + on_focus_in $term + Called whenever the window gets the keyboard focus, before + rxvt-unicode does focus in processing. + + on_focus_out $term + Called wheneever the window loses keyboard focus, before + rxvt-unicode does focus out processing. + 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 + on_map_notify $term, $event + on_unmap_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. @@ -269,6 +273,12 @@ DESCRIPTION $time = urxvt::NOW Returns the "current time" (as per the event loop). + urxvt::CurrentTime + urxvt::ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, + Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask, Button4Mask, + Button5Mask, AnyModifier + Various constants for use in X events. + RENDITION Rendition bitsets contain information about colour, font, font styles and similar information for each screen cell. @@ -312,6 +322,22 @@ DESCRIPTION $term->destroy Destroy the terminal object (close the window, free resources etc.). + $isset = $term->option ($optval[, $set]) + Returns true if the option specified by $optval is enabled, and + optionally change it. All option values are stored by name in the + hash %urxvt::OPTION. Options not enabled in this binary are not in + the hash. + + Here is a a likely non-exhaustive list of option names, please see + the source file /src/optinc.h to see the actual list: + + borderLess console cursorBlink cursorUnderline hold iconic insecure + intensityStyles jumpScroll loginShell mapAlert meta8 mouseWheelScrollPage + pastableTabs pointerBlank reverseVideo scrollBar scrollBar_floating + scrollBar_right scrollTtyKeypress scrollTtyOutput scrollWithBuffer + secondaryScreen secondaryScroll skipBuiltinGlyphs transparent + tripleclickwords utmpInhibit visualBell + $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 @@ -330,8 +356,8 @@ DESCRIPTION memory. Here is a a likely non-exhaustive list of resource names, not all of - which are supported in every build, please see the source to see the - actual list: + which are supported in every build, please see the source file + /src/rsinc.h to see the actual list: answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont borderLess color cursorBlink cursorUnderline cutchars delete_key @@ -404,6 +430,11 @@ DESCRIPTION $overlay->show If hidden, display the overlay again. + $popup = $term->popup ($event) + Creates a new "urxvt::popup" object that implements a popup menu. + The $event *must* be the event causing the menu to pop up (a button + event, currently). + $cellwidth = $term->strwidth ($string) Returns the number of screen-cells this string would need. Correctly accounts for wide and combining characters. @@ -457,6 +488,13 @@ DESCRIPTION $lines_in_scrollback = $term->nsaved Return various integers describing terminal characteristics. + $modifiermask = $term->ModLevel3Mask + $modifiermask = $term->ModMetaMask + $modifiermask = $term->ModNumLockMask + Return the modifier masks corresponding to the "ISO Level 3 Shift" + (often AltGr), the meta key (often Alt) and the num lock key, if + applicable. + $view_start = $term->view_start ([$newvalue]) Returns the negative row number of the topmost line. Minimum value is 0, which displays the normal terminal contents. Larger values @@ -552,92 +590,93 @@ DESCRIPTION Converts rxvt-unicodes text reprsentation into a perl string. See "$term->ROW_t" for details. + The "urxvt::popup" Class The "urxvt::timer" Class - This class implements timer watchers/events. Time is represented as a - fractional number of seconds since the epoch. Example: + This class implements timer watchers/events. Time is represented as + a fractional number of seconds since the epoch. Example: - $term->{overlay} = $term->overlay (-1, 0, 8, 1, urxvt::OVERLAY_RSTYLE, 0); - $term->{timer} = urxvt::timer - ->new - ->interval (1) - ->cb (sub { - $term->{overlay}->set (0, 0, - sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2,1,0]); - }); + $term->{overlay} = $term->overlay (-1, 0, 8, 1, urxvt::OVERLAY_RSTYLE, 0); + $term->{timer} = urxvt::timer + ->new + ->interval (1) + ->cb (sub { + $term->{overlay}->set (0, 0, + sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2,1,0]); + }); - $timer = new urxvt::timer - Create a new timer object in started state. It is scheduled to fire - immediately. + $timer = new urxvt::timer + Create a new timer object in started state. It is scheduled to + fire immediately. - $timer = $timer->cb (sub { my ($timer) = @_; ... }) - Set the callback to be called when the timer triggers. + $timer = $timer->cb (sub { my ($timer) = @_; ... }) + Set the callback to be called when the timer triggers. - $tstamp = $timer->at - Return the time this watcher will fire next. + $tstamp = $timer->at + Return the time this watcher will fire next. - $timer = $timer->set ($tstamp) - Set the time the event is generated to $tstamp. + $timer = $timer->set ($tstamp) + Set the time the event is generated to $tstamp. - $timer = $timer->interval ($interval) - Normally (and when $interval is 0), the timer will automatically - stop after it has fired once. If $interval is non-zero, then the - timer is automatically rescheduled at the given intervals. + $timer = $timer->interval ($interval) + Normally (and when $interval is 0), the timer will automatically + stop after it has fired once. If $interval is non-zero, then the + timer is automatically rescheduled at the given intervals. - $timer = $timer->start - Start the timer. + $timer = $timer->start + Start the timer. - $timer = $timer->start ($tstamp) - Set the event trigger time to $tstamp and start the timer. + $timer = $timer->start ($tstamp) + Set the event trigger time to $tstamp and start the timer. - $timer = $timer->stop - Stop the timer. + $timer = $timer->stop + Stop the timer. The "urxvt::iow" Class - This class implements io watchers/events. Example: + This class implements io watchers/events. Example: - $term->{socket} = ... - $term->{iow} = urxvt::iow - ->new - ->fd (fileno $term->{socket}) - ->events (1) # wait for read data - ->start - ->cb (sub { - my ($iow, $revents) = @_; - # $revents must be 1 here, no need to check - sysread $term->{socket}, my $buf, 8192 - or end-of-file; - }); + $term->{socket} = ... + $term->{iow} = urxvt::iow + ->new + ->fd (fileno $term->{socket}) + ->events (1) # wait for read data + ->start + ->cb (sub { + my ($iow, $revents) = @_; + # $revents must be 1 here, no need to check + sysread $term->{socket}, my $buf, 8192 + or end-of-file; + }); - $iow = new urxvt::iow - Create a new io watcher object in stopped state. + $iow = new urxvt::iow + Create a new io watcher object in stopped state. - $iow = $iow->cb (sub { my ($iow, $reventmask) = @_; ... }) - Set the callback to be called when io events are triggered. - $reventmask is a bitset as described in the "events" method. + $iow = $iow->cb (sub { my ($iow, $reventmask) = @_; ... }) + Set the callback to be called when io events are triggered. + $reventmask is a bitset as described in the "events" method. - $iow = $iow->fd ($fd) - Set the filedescriptor (not handle) to watch. + $iow = $iow->fd ($fd) + Set the filedescriptor (not handle) to watch. - $iow = $iow->events ($eventmask) - Set the event mask to watch. Bit #0 (value 1) enables watching for - read data, Bit #1 (value 2) enables watching for write data. + $iow = $iow->events ($eventmask) + Set the event mask to watch. Bit #0 (value 1) enables watching + for read data, Bit #1 (value 2) enables watching for write data. - $iow = $iow->start - Start watching for requested events on the given handle. + $iow = $iow->start + Start watching for requested events on the given handle. - $iow = $iow->stop - Stop watching for events on the given filehandle. + $iow = $iow->stop + Stop watching for events on the given filehandle. ENVIRONMENT URXVT_PERL_VERBOSITY - This variable controls the verbosity level of the perl extension. Higher - numbers indicate more verbose output. + This variable controls the verbosity level of the perl extension. + Higher numbers indicate more verbose output. - =0 - only fatal messages - =3 - script loading and management - =10 - all events received + =0 - only fatal messages + =3 - script loading and management + =10 - all events received AUTHOR - Marc Lehmann - http://software.schmorp.de/pkg/rxvt-unicode + Marc Lehmann + http://software.schmorp.de/pkg/rxvt-unicode diff --git a/src/main.C b/src/main.C index edb60cbb..522e51a1 100644 --- a/src/main.C +++ b/src/main.C @@ -489,6 +489,9 @@ rxvt_term::init (int argc, const char *const *argv) #endif #if ENABLE_PERL + if (!rs[Rs_perl_ext_1]) + rs[Rs_perl_ext_1] = "default"; + if ((rs[Rs_perl_ext_1] && *rs[Rs_perl_ext_1]) || (rs[Rs_perl_ext_2] && *rs[Rs_perl_ext_2]) || (rs[Rs_perl_eval] && *rs[Rs_perl_eval]))