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.45 by root, Sat Jan 7 20:23:52 2006 UTC vs.
Revision 1.48 by root, Sat Jan 7 21:43:17 2006 UTC

331 331
332=item $time = urxvt::NOW 332=item $time = urxvt::NOW
333 333
334Returns the "current time" (as per the event loop). 334Returns the "current time" (as per the event loop).
335 335
336=item urxvt::CurrentTime
337
338=item urxvt::ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask,
339Mod3Mask, Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask,
340Button4Mask, Button5Mask, AnyModifier
341
342Various constants for use in X events.
343
336=back 344=back
337 345
338=head2 RENDITION 346=head2 RENDITION
339 347
340Rendition bitsets contain information about colour, font, font styles and 348Rendition bitsets contain information about colour, font, font styles and
389 397
390=cut 398=cut
391 399
392package urxvt; 400package urxvt;
393 401
402use utf8;
394use strict; 403use strict;
395use Scalar::Util (); 404use Scalar::Util ();
405use List::Util ();
396 406
397our $TERM; 407our $TERM;
398our @HOOKNAME; 408our @HOOKNAME;
399our $LIBDIR; 409our $LIBDIR;
400 410
776 786
777=item $lines_in_scrollback = $term->nsaved 787=item $lines_in_scrollback = $term->nsaved
778 788
779Return various integers describing terminal characteristics. 789Return 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
797Return the modifier masks corresponding to the "ISO Level 3 Shift" (often
798AltGr), 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
783Returns the negative row number of the topmost line. Minimum value is 802Returns the negative row number of the topmost line. Minimum value is
784C<0>, which displays the normal terminal contents. Larger values scroll 803C<0>, which displays the normal terminal contents. Larger values scroll
785this many lines into the scrollback buffer. 804this many lines into the scrollback buffer.
983} 1002}
984 1003
985sub add_button { 1004sub 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
1012sub 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
991sub show { 1021sub show {
992 my ($self) = @_; 1022 my ($self) = @_;
993 1023
994 local $urxvt::popup::self = $self; 1024 local $urxvt::popup::self = $self;
995 1025
996 urxvt->new ("--perl-lib" => "", "--perl-ext-common" => "", "-pty-fd" => -1, "-sl" => 0, "-b" => 0, 1026 urxvt->new ("--perl-lib" => "", "--perl-ext-common" => "", "-pty-fd" => -1, "-sl" => 0, "-b" => 0,
997 "--transient-for" => $self->{term}->parent, 1027 "--transient-for" => $self->{term}->parent,
998 "-pe" => "urxvt_popup") 1028 "-pe" => "urxvt-popup")
999 or die "unable to create popup window\n"; 1029 or die "unable to create popup window\n";
1000} 1030}
1001 1031
1002sub DESTROY { 1032sub DESTROY {
1003 my ($self) = @_; 1033 my ($self) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines