… | |
… | |
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 | } |
… | |
… | |
582 | |
584 | |
583 | sub urxvt::destroy_hook(&) { |
585 | sub urxvt::destroy_hook(&) { |
584 | bless \shift, urxvt::destroy_hook:: |
586 | bless \shift, urxvt::destroy_hook:: |
585 | } |
587 | } |
586 | |
588 | |
587 | # urxvt::anyevent |
|
|
588 | |
|
|
589 | package urxvt::anyevent; |
589 | package urxvt::anyevent; |
|
|
590 | |
|
|
591 | =head2 The C<urxvt::anyevent> Class |
|
|
592 | |
|
|
593 | The sole purpose of this class is to deliver an interface to the |
|
|
594 | C<AnyEvent> module - any module using it will work inside urxvt without |
|
|
595 | further work. The only exception is that you cannot wait on condition |
|
|
596 | variables, but non-blocking condvar use is ok. What this means is that you |
|
|
597 | cannot use blocking APIs, but the non-blocking variant should work. |
|
|
598 | |
|
|
599 | =cut |
590 | |
600 | |
591 | our $VERSION = 1; |
601 | our $VERSION = 1; |
592 | |
602 | |
593 | $INC{"urxvt/anyevent.pm"} = 1; # mark us as there |
603 | $INC{"urxvt/anyevent.pm"} = 1; # mark us as there |
594 | push @AnyEvent::REGISTRY, [urxvt => urxvt::anyevent::]; |
604 | push @AnyEvent::REGISTRY, [urxvt => urxvt::anyevent::]; |