… | |
… | |
404 | use Scalar::Util (); |
404 | use Scalar::Util (); |
405 | use List::Util (); |
405 | use List::Util (); |
406 | |
406 | |
407 | our $TERM; |
407 | our $TERM; |
408 | our @HOOKNAME; |
408 | our @HOOKNAME; |
|
|
409 | our %OPTION; |
409 | our $LIBDIR; |
410 | our $LIBDIR; |
410 | |
411 | |
411 | BEGIN { |
412 | BEGIN { |
412 | urxvt->bootstrap; |
413 | urxvt->bootstrap; |
413 | |
414 | |
… | |
… | |
479 | local $TERM = shift; |
480 | local $TERM = shift; |
480 | my $htype = shift; |
481 | my $htype = shift; |
481 | |
482 | |
482 | if ($htype == 0) { # INIT |
483 | if ($htype == 0) { # INIT |
483 | my @dirs = ((split /:/, $TERM->resource ("perl_lib")), "$LIBDIR/perl"); |
484 | my @dirs = ((split /:/, $TERM->resource ("perl_lib")), "$LIBDIR/perl"); |
484 | |
485 | |
485 | for my $ext (map { split /,/, $TERM->resource ("perl_ext_$_") } 1, 2) { |
486 | my @ext = (map { split /,/, $TERM->resource ("perl_ext_$_") } 1, 2); |
486 | my @files = grep -f $_, map "$_/$ext", @dirs; |
|
|
487 | |
487 | |
488 | if (@files) { |
488 | while (@ext) { |
489 | register_package extension_package $files[0]; |
489 | my $ext = shift @ext; |
|
|
490 | if ($ext eq "default") { |
|
|
491 | unshift @ext, qw(selection); |
490 | } else { |
492 | } else { |
|
|
493 | my @files = grep -f $_, map "$_/$ext", @dirs; |
|
|
494 | |
|
|
495 | if (@files) { |
|
|
496 | register_package extension_package $files[0]; |
|
|
497 | } else { |
491 | warn "perl extension '$ext' not found in perl library search path\n"; |
498 | warn "perl extension '$ext' not found in perl library search path\n"; |
|
|
499 | } |
492 | } |
500 | } |
493 | } |
501 | } |
494 | } |
502 | } |
495 | |
503 | |
496 | $retval = undef; |
504 | $retval = undef; |
… | |
… | |
564 | |
572 | |
565 | =item $term->destroy |
573 | =item $term->destroy |
566 | |
574 | |
567 | Destroy the terminal object (close the window, free resources etc.). |
575 | Destroy the terminal object (close the window, free resources etc.). |
568 | |
576 | |
|
|
577 | =item $isset = $term->option ($optval[, $set]) |
|
|
578 | |
|
|
579 | Returns true if the option specified by C<$optval> is enabled, and |
|
|
580 | optionally change it. All option values are stored by name in the hash |
|
|
581 | C<%urxvt::OPTION>. Options not enabled in this binary are not in the hash. |
|
|
582 | |
|
|
583 | Here is a a likely non-exhaustive list of option names, please see the |
|
|
584 | source file F</src/optinc.h> to see the actual list: |
|
|
585 | |
|
|
586 | borderLess console cursorBlink cursorUnderline hold iconic insecure |
|
|
587 | intensityStyles jumpScroll loginShell mapAlert meta8 mouseWheelScrollPage |
|
|
588 | pastableTabs pointerBlank reverseVideo scrollBar scrollBar_floating |
|
|
589 | scrollBar_right scrollTtyKeypress scrollTtyOutput scrollWithBuffer |
|
|
590 | secondaryScreen secondaryScroll skipBuiltinGlyphs transparent |
|
|
591 | tripleclickwords utmpInhibit visualBell |
|
|
592 | |
569 | =item $value = $term->resource ($name[, $newval]) |
593 | =item $value = $term->resource ($name[, $newval]) |
570 | |
594 | |
571 | Returns the current resource value associated with a given name and |
595 | Returns the current resource value associated with a given name and |
572 | optionally sets a new value. Setting values is most useful in the C<init> |
596 | optionally sets a new value. Setting values is most useful in the C<init> |
573 | hook. Unset resources are returned and accepted as C<undef>. |
597 | hook. Unset resources are returned and accepted as C<undef>. |
… | |
… | |
582 | |
606 | |
583 | Please note that resource strings will currently only be freed when the |
607 | Please note that resource strings will currently only be freed when the |
584 | terminal is destroyed, so changing options frequently will eat memory. |
608 | terminal is destroyed, so changing options frequently will eat memory. |
585 | |
609 | |
586 | Here is a a likely non-exhaustive list of resource names, not all of which |
610 | Here is a a likely non-exhaustive list of resource names, not all of which |
587 | are supported in every build, please see the source to see the actual |
611 | are supported in every build, please see the source file F</src/rsinc.h> |
588 | list: |
612 | to see the actual list: |
589 | |
613 | |
590 | answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont |
614 | answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont |
591 | borderLess color cursorBlink cursorUnderline cutchars delete_key |
615 | borderLess color cursorBlink cursorUnderline cutchars delete_key |
592 | display_name embed ext_bwidth fade font geometry hold iconName |
616 | display_name embed ext_bwidth fade font geometry hold iconName |
593 | imFont imLocale inputMethod insecure int_bwidth intensityStyles |
617 | imFont imLocale inputMethod insecure int_bwidth intensityStyles |
… | |
… | |
1010 | } |
1034 | } |
1011 | |
1035 | |
1012 | sub add_toggle { |
1036 | sub add_toggle { |
1013 | my ($self, $text, $cb, $value) = @_; |
1037 | my ($self, $text, $cb, $value) = @_; |
1014 | |
1038 | |
1015 | $self->add_item ({ type => "button", text => " $text", value => $value, |
1039 | my $item; $item = { |
|
|
1040 | type => "button", |
|
|
1041 | text => " $text", |
|
|
1042 | value => $value, |
1016 | render => sub { ($_[0]{value} ? "✔" : " ") . substr $_[0]{text}, 1 }, |
1043 | render => sub { ($item->{value} ? "✔" : " ") . $text }, |
1017 | activate => sub { $cb->($_[0]{value} = !$_[0]{value}); }, |
1044 | activate => sub { $cb->($item->{value} = !$item->{value}); }, |
1018 | }); |
1045 | }; |
|
|
1046 | |
|
|
1047 | $self->add_item ($item); |
1019 | } |
1048 | } |
1020 | |
1049 | |
1021 | sub show { |
1050 | sub show { |
1022 | my ($self) = @_; |
1051 | my ($self) = @_; |
1023 | |
1052 | |