… | |
… | |
331 | |
331 | |
332 | =item $time = urxvt::NOW |
332 | =item $time = urxvt::NOW |
333 | |
333 | |
334 | Returns the "current time" (as per the event loop). |
334 | Returns the "current time" (as per the event loop). |
335 | |
335 | |
|
|
336 | =item urxvt::CurrentTime |
|
|
337 | |
|
|
338 | =item urxvt::ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, |
|
|
339 | Mod3Mask, Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask, |
|
|
340 | Button4Mask, Button5Mask, AnyModifier |
|
|
341 | |
|
|
342 | Various constants for use in X events. |
|
|
343 | |
336 | =back |
344 | =back |
337 | |
345 | |
338 | =head2 RENDITION |
346 | =head2 RENDITION |
339 | |
347 | |
340 | Rendition bitsets contain information about colour, font, font styles and |
348 | Rendition bitsets contain information about colour, font, font styles and |
… | |
… | |
389 | |
397 | |
390 | =cut |
398 | =cut |
391 | |
399 | |
392 | package urxvt; |
400 | package urxvt; |
393 | |
401 | |
|
|
402 | use utf8; |
394 | use strict; |
403 | use strict; |
395 | use Scalar::Util (); |
404 | use Scalar::Util (); |
|
|
405 | use List::Util (); |
396 | |
406 | |
397 | our $TERM; |
407 | our $TERM; |
398 | our @HOOKNAME; |
408 | our @HOOKNAME; |
399 | our $LIBDIR; |
409 | our $LIBDIR; |
400 | |
410 | |
… | |
… | |
776 | |
786 | |
777 | =item $lines_in_scrollback = $term->nsaved |
787 | =item $lines_in_scrollback = $term->nsaved |
778 | |
788 | |
779 | Return various integers describing terminal characteristics. |
789 | Return various integers describing terminal characteristics. |
780 | |
790 | |
|
|
791 | =item $modifiermask = $term->ModLevel3Mask |
|
|
792 | |
|
|
793 | =item $modifiermask = $term->ModMetaMask |
|
|
794 | |
|
|
795 | =item $modifiermask = $term->ModNumLockMask |
|
|
796 | |
|
|
797 | Return the modifier masks corresponding to the "ISO Level 3 Shift" (often |
|
|
798 | AltGr), the meta key (often Alt) and the num lock key, if applicable. |
|
|
799 | |
781 | =item $view_start = $term->view_start ([$newvalue]) |
800 | =item $view_start = $term->view_start ([$newvalue]) |
782 | |
801 | |
783 | Returns the negative row number of the topmost line. Minimum value is |
802 | Returns the negative row number of the topmost line. Minimum value is |
784 | C<0>, which displays the normal terminal contents. Larger values scroll |
803 | C<0>, which displays the normal terminal contents. Larger values scroll |
785 | this many lines into the scrollback buffer. |
804 | this many lines into the scrollback buffer. |
… | |
… | |
983 | } |
1002 | } |
984 | |
1003 | |
985 | sub add_button { |
1004 | sub add_button { |
986 | my ($self, $text, $cb) = @_; |
1005 | my ($self, $text, $cb) = @_; |
987 | |
1006 | |
988 | $self->add_item ({ type => "button", text => "[ $text ]", activate => $cb }); |
1007 | $self->add_item ({ type => "button", text => "[ $text ]", activate => $cb, |
|
|
1008 | render => sub { $_[0]{text} }, |
|
|
1009 | }); |
|
|
1010 | } |
|
|
1011 | |
|
|
1012 | sub add_toggle { |
|
|
1013 | my ($self, $text, $cb, $value) = @_; |
|
|
1014 | |
|
|
1015 | $self->add_item ({ type => "button", text => " $text", value => $value, |
|
|
1016 | render => sub { ($_[0]{value} ? "✔" : " ") . substr $_[0]{text}, 1 }, |
|
|
1017 | activate => sub { $cb->($_[0]{value} = !$_[0]{value}); }, |
|
|
1018 | }); |
989 | } |
1019 | } |
990 | |
1020 | |
991 | sub show { |
1021 | sub show { |
992 | my ($self) = @_; |
1022 | my ($self) = @_; |
993 | |
1023 | |