ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/urxvt.pm
(Generate patch)

Comparing rxvt-unicode/src/urxvt.pm (file contents):
Revision 1.146 by root, Thu Aug 17 21:56:11 2006 UTC vs.
Revision 1.153 by root, Sat Jun 2 05:23:11 2007 UTC

240 URxvt.tabbed.tab-bg: <colour-index, default 1> 240 URxvt.tabbed.tab-bg: <colour-index, default 1>
241 241
242See I<COLOR AND GRAPHICS> in the @@RXVT_NAME@@(1) manpage for valid 242See I<COLOR AND GRAPHICS> in the @@RXVT_NAME@@(1) manpage for valid
243indices. 243indices.
244 244
245=item mark-urls 245=item matcher
246 246
247Uses per-line display filtering (C<on_line_update>) to underline urls and 247Uses per-line display filtering (C<on_line_update>) to underline text
248make them clickable. When middle-clicked, the program specified in the 248matching a certain pattern and make it clickable. When clicked with the
249resource C<urlLauncher> (default C<x-www-browser>) will be started with 249mouse button specified in the C<matcher.button> resource (default 2, or
250the URL as first argument. 250middle), the program specified in the C<matcher.launcher> resource
251(default, the C<urlLauncher> resource, C<sensible-browser>) will be started
252with the matched text as first argument. The default configuration is
253suitable for matching URLs and launching a web browser, like the
254former "mark-urls" extension.
255
256The default pattern to match URLs can be overridden with the
257C<matcher.pattern.0> resource, and additional patterns can be specified
258with numbered patterns, in a manner similar to the "selection" extension.
259The launcher can also be overridden on a per-pattern basis.
260
261Example configuration:
262
263 URxvt.perl-ext: default,matcher
264 URxvt.urlLauncher: sensible-browser
265 URxvt.keysym.C-Delete: perl:matcher
266 URxvt.matcher.button: 1
267 URxvt.matcher.pattern.1: \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-]
268 URxvt.matcher.pattern.2: \\B(/\\S+?):(\\d+)(?=:|$)
269 URxvt.matcher.launcher.2: gvim +$2 $1
251 270
252=item xim-onthespot 271=item xim-onthespot
253 272
254This (experimental) perl extension implements OnTheSpot editing. It does 273This (experimental) perl extension implements OnTheSpot editing. It does
255not work perfectly, and some input methods don't seem to work well with 274not work perfectly, and some input methods don't seem to work well with
286background pixmap offset to the window position, in effect creating the 305background pixmap offset to the window position, in effect creating the
287same effect as pseudo transparency with a custom pixmap. No scaling is 306same effect as pseudo transparency with a custom pixmap. No scaling is
288supported in this mode. Example: 307supported in this mode. Example:
289 308
290 @@RXVT_NAME@@ -pixmap background.xpm -pe automove-background 309 @@RXVT_NAME@@ -pixmap background.xpm -pe automove-background
310
311L<http://wiki.archlinux.org/index.php/Perl_Background_Rotation/Extensions>
312shows how this extension can be used to implement an automatically blurred
313transparent background.
291 314
292=item block-graphics-to-ascii 315=item block-graphics-to-ascii
293 316
294A not very useful example of filtering all text output to the terminal 317A not very useful example of filtering all text output to the terminal
295by replacing all line-drawing characters (U+2500 .. U+259F) by a 318by replacing all line-drawing characters (U+2500 .. U+259F) by a
972 995
973sub SET_COLOR($$$) { 996sub SET_COLOR($$$) {
974 SET_BGCOLOR (SET_FGCOLOR ($_[0], $_[1]), $_[2]) 997 SET_BGCOLOR (SET_FGCOLOR ($_[0], $_[1]), $_[2])
975} 998}
976 999
1000sub rend2mask {
1001 no strict 'refs';
1002 my ($str, $mask) = (@_, 0);
1003 my %color = ( fg => undef, bg => undef );
1004 my @failed;
1005 for my $spec ( split /\s+/, $str ) {
1006 if ( $spec =~ /^([fb]g)[_:-]?(\d+)/i ) {
1007 $color{lc($1)} = $2;
1008 } else {
1009 my $neg = $spec =~ s/^[-^]//;
1010 unless ( exists &{"RS_$spec"} ) {
1011 push @failed, $spec;
1012 next;
1013 }
1014 my $cur = &{"RS_$spec"};
1015 if ( $neg ) {
1016 $mask &= ~$cur;
1017 } else {
1018 $mask |= $cur;
1019 }
1020 }
1021 }
1022 ($mask, @color{qw(fg bg)}, \@failed)
1023}
1024
977# urxvt::term::extension 1025# urxvt::term::extension
978 1026
979package urxvt::term::extension; 1027package urxvt::term::extension;
980 1028
981sub enable { 1029sub enable {
1092sub DESTROY { 1140sub DESTROY {
1093 $_[0][1]->stop; 1141 $_[0][1]->stop;
1094} 1142}
1095 1143
1096sub condvar { 1144sub condvar {
1097 bless \my $flag, urxvt::anyevent::condvar:: 1145 bless \my $flag, urxvt::anyevent::
1098} 1146}
1099 1147
1100sub urxvt::anyevent::condvar::broadcast { 1148sub broadcast {
1101 ${$_[0]}++; 1149 ${$_[0]}++;
1102} 1150}
1103 1151
1104sub urxvt::anyevent::condvar::wait { 1152sub wait {
1105 unless (${$_[0]}) { 1153 unless (${$_[0]}) {
1106 Carp::croak "AnyEvent->condvar blocking wait unsupported in urxvt, use a non-blocking API"; 1154 Carp::croak "AnyEvent->condvar blocking wait unsupported in urxvt, use a non-blocking API";
1107 } 1155 }
1156}
1157
1158sub one_event {
1159 Carp::croak "AnyEvent->one_event blocking wait unsupported in urxvt, use a non-blocking API";
1108} 1160}
1109 1161
1110package urxvt::term; 1162package urxvt::term;
1111 1163
1112=head2 The C<urxvt::term> Class 1164=head2 The C<urxvt::term> Class
1932 1984
1933=cut 1985=cut
1934 1986
1935package urxvt::watcher; 1987package urxvt::watcher;
1936 1988
1937@urxvt::timer::ISA = __PACKAGE__;
1938@urxvt::iow::ISA = __PACKAGE__;
1939@urxvt::pw::ISA = __PACKAGE__;
1940@urxvt::iw::ISA = __PACKAGE__;
1941
1942=head2 The C<urxvt::timer> Class 1989=head2 The C<urxvt::timer> Class
1943 1990
1944This class implements timer watchers/events. Time is represented as a 1991This class implements timer watchers/events. Time is represented as a
1945fractional number of seconds since the epoch. Example: 1992fractional number of seconds since the epoch. Example:
1946 1993
2131 http://software.schmorp.de/pkg/rxvt-unicode 2178 http://software.schmorp.de/pkg/rxvt-unicode
2132 2179
2133=cut 2180=cut
2134 2181
21351 21821
2183
2184# vim: sw=3:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines