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.149 by root, Sun Dec 3 23:03:52 2006 UTC vs.
Revision 1.152 by tpope, Tue Jan 9 16:18:56 2007 UTC

260 260
261Example configuration: 261Example configuration:
262 262
263 URxvt.perl-ext: default,matcher 263 URxvt.perl-ext: default,matcher
264 URxvt.urlLauncher: sensible-browser 264 URxvt.urlLauncher: sensible-browser
265 URxvt.keysym.C-Delete: perl:matcher
265 URxvt.matcher.button: 1 266 URxvt.matcher.button: 1
266 URxvt.matcher.pattern.1: \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-] 267 URxvt.matcher.pattern.1: \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-]
267 URxvt.matcher.pattern.2: \\B(/\\S+?):(\\d+)(?=:|$) 268 URxvt.matcher.pattern.2: \\B(/\\S+?):(\\d+)(?=:|$)
268 URxvt.matcher.launcher.2: gvim +$2 $1 269 URxvt.matcher.launcher.2: gvim +$2 $1
269 270
990 991
991sub SET_COLOR($$$) { 992sub SET_COLOR($$$) {
992 SET_BGCOLOR (SET_FGCOLOR ($_[0], $_[1]), $_[2]) 993 SET_BGCOLOR (SET_FGCOLOR ($_[0], $_[1]), $_[2])
993} 994}
994 995
996sub rend2mask {
997 no strict 'refs';
998 my ($str, $mask) = (@_, 0);
999 my %color = ( fg => undef, bg => undef );
1000 my @failed;
1001 for my $spec ( split /\s+/, $str ) {
1002 if ( $spec =~ /^([fb]g)[_:-]?(\d+)/i ) {
1003 $color{lc($1)} = $2;
1004 } else {
1005 my $neg = $spec =~ s/^[-^]//;
1006 unless ( exists &{"RS_$spec"} ) {
1007 push @failed, $spec;
1008 next;
1009 }
1010 my $cur = &{"RS_$spec"};
1011 if ( $neg ) {
1012 $mask &= ~$cur;
1013 } else {
1014 $mask |= $cur;
1015 }
1016 }
1017 }
1018 ($mask, @color{qw(fg bg)}, \@failed)
1019}
1020
995# urxvt::term::extension 1021# urxvt::term::extension
996 1022
997package urxvt::term::extension; 1023package urxvt::term::extension;
998 1024
999sub enable { 1025sub enable {
1110sub DESTROY { 1136sub DESTROY {
1111 $_[0][1]->stop; 1137 $_[0][1]->stop;
1112} 1138}
1113 1139
1114sub condvar { 1140sub condvar {
1115 bless \my $flag, urxvt::anyevent::condvar:: 1141 bless \my $flag, urxvt::anyevent::
1116} 1142}
1117 1143
1118sub urxvt::anyevent::condvar::broadcast { 1144sub broadcast {
1119 ${$_[0]}++; 1145 ${$_[0]}++;
1120} 1146}
1121 1147
1122sub urxvt::anyevent::condvar::wait { 1148sub wait {
1123 unless (${$_[0]}) { 1149 unless (${$_[0]}) {
1124 Carp::croak "AnyEvent->condvar blocking wait unsupported in urxvt, use a non-blocking API"; 1150 Carp::croak "AnyEvent->condvar blocking wait unsupported in urxvt, use a non-blocking API";
1125 } 1151 }
1126} 1152}
1127 1153
1128sub urxvt::anyevent::one_event { 1154sub one_event {
1129 Carp::croak "AnyEvent->one_event blocking wait unsupported in urxvt, use a non-blocking API"; 1155 Carp::croak "AnyEvent->one_event blocking wait unsupported in urxvt, use a non-blocking API";
1130} 1156}
1131 1157
1132package urxvt::term; 1158package urxvt::term;
1133 1159
1954 1980
1955=cut 1981=cut
1956 1982
1957package urxvt::watcher; 1983package urxvt::watcher;
1958 1984
1959@urxvt::timer::ISA = __PACKAGE__;
1960@urxvt::iow::ISA = __PACKAGE__;
1961@urxvt::pw::ISA = __PACKAGE__;
1962@urxvt::iw::ISA = __PACKAGE__;
1963
1964=head2 The C<urxvt::timer> Class 1985=head2 The C<urxvt::timer> Class
1965 1986
1966This class implements timer watchers/events. Time is represented as a 1987This class implements timer watchers/events. Time is represented as a
1967fractional number of seconds since the epoch. Example: 1988fractional number of seconds since the epoch. Example:
1968 1989
2153 http://software.schmorp.de/pkg/rxvt-unicode 2174 http://software.schmorp.de/pkg/rxvt-unicode
2154 2175
2155=cut 2176=cut
2156 2177
21571 21781
2179
2180# vim: sw=3:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines