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.56 by root, Sun Jan 8 05:52:42 2006 UTC vs.
Revision 1.58 by root, Sun Jan 8 22:58:13 2006 UTC

470 my $source = "package $pkg; use strict; use utf8;\n" 470 my $source = "package $pkg; use strict; use utf8;\n"
471 . "use base urxvt::term::proxy::;\n" 471 . "use base urxvt::term::proxy::;\n"
472 . "#line 1 \"$path\"\n{\n" 472 . "#line 1 \"$path\"\n{\n"
473 . (do { local $/; <$fh> }) 473 . (do { local $/; <$fh> })
474 . "\n};\n1"; 474 . "\n};\n1";
475
476 $source =~ /(.*)/s and $source = $1; # untaint
475 477
476 eval $source or die "$path: $@"; 478 eval $source or die "$path: $@";
477 479
478 $pkg 480 $pkg
479 } 481 }
532 $proxy 534 $proxy
533 }, 535 },
534 @_, 536 @_,
535 ) and last; 537 ) and last;
536 }; 538 };
537 warn $@ if $@;#d# 539 if ($@) {
540 $TERM->ungrab; # better to lose the grab than the session
541 warn $@;
542 }
538 } 543 }
539 } 544 }
540 545
541 if ($htype == 1) { # DESTROY 546 if ($htype == 1) { # DESTROY
542 # remove hooks if unused 547 # remove hooks if unused
570 } 575 }
571 1 576 1
572 } or die "FATAL: unable to compile method forwarder: $@"; 577 } or die "FATAL: unable to compile method forwarder: $@";
573 578
574 goto &$urxvt::term::proxy::AUTOLOAD; 579 goto &$urxvt::term::proxy::AUTOLOAD;
580}
581
582sub urxvt::term::proxy::DESTROY {
583 # nop
575} 584}
576 585
577# urxvt::destroy_hook 586# urxvt::destroy_hook
578 587
579sub urxvt::destroy_hook::DESTROY { 588sub urxvt::destroy_hook::DESTROY {
1155 1164
1156 my $item; $item = { 1165 my $item; $item = {
1157 type => "button", 1166 type => "button",
1158 text => " $text", 1167 text => " $text",
1159 value => $value, 1168 value => $value,
1160 render => sub { ($item->{value} ? "* " : " ") . $text }, 1169 render => sub { ($_[0]{value} ? "* " : " ") . $text },
1161 activate => sub { $cb->($item->{value} = !$item->{value}); }, 1170 activate => sub { $cb->($_[0]{value} = !$_[0]{value}); },
1162 }; 1171 };
1163 1172
1164 $self->add_item ($item); 1173 $self->add_item ($item);
1165} 1174}
1166 1175
1176} 1185}
1177 1186
1178sub DESTROY { 1187sub DESTROY {
1179 my ($self) = @_; 1188 my ($self) = @_;
1180 1189
1190 delete $self->{term}{_destroy}{$self};
1181 $self->{term}->ungrab; 1191 $self->{term}->ungrab;
1182} 1192}
1183 1193
1184=head2 The C<urxvt::timer> Class 1194=head2 The C<urxvt::timer> Class
1185 1195
1289This variable controls the verbosity level of the perl extension. Higher 1299This variable controls the verbosity level of the perl extension. Higher
1290numbers indicate more verbose output. 1300numbers indicate more verbose output.
1291 1301
1292=over 4 1302=over 4
1293 1303
1294=item =0 - only fatal messages 1304=item == 0 - fatal messages
1295 1305
1296=item =3 - script loading and management 1306=item >= 3 - script loading and management
1297 1307
1298=item =10 - all events received 1308=item >=10 - all events received
1299 1309
1300=back 1310=back
1301 1311
1302=head1 AUTHOR 1312=head1 AUTHOR
1303 1313

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines