… | |
… | |
332 | newline. The module also overwrites the C<warn> builtin with a function |
332 | newline. The module also overwrites the C<warn> builtin with a function |
333 | that calls this function. |
333 | that calls this function. |
334 | |
334 | |
335 | Using this function has the advantage that its output ends up in the |
335 | Using this function has the advantage that its output ends up in the |
336 | correct place, e.g. on stderr of the connecting urxvtc client. |
336 | correct place, e.g. on stderr of the connecting urxvtc client. |
|
|
337 | |
|
|
338 | =item $is_safe = urxvt::safe |
|
|
339 | |
|
|
340 | Returns true when it is safe to do potentially unsafe things, such as |
|
|
341 | evaluating perl code specified by the user. This is true when urxvt was |
|
|
342 | started setuid or setgid. |
337 | |
343 | |
338 | =item $time = urxvt::NOW |
344 | =item $time = urxvt::NOW |
339 | |
345 | |
340 | Returns the "current time" (as per the event loop). |
346 | Returns the "current time" (as per the event loop). |
341 | |
347 | |
… | |
… | |
911 | |
917 | |
912 | =item $lines_in_scrollback = $term->nsaved |
918 | =item $lines_in_scrollback = $term->nsaved |
913 | |
919 | |
914 | Return various integers describing terminal characteristics. |
920 | Return various integers describing terminal characteristics. |
915 | |
921 | |
|
|
922 | =item $lc_ctype = $term->locale |
|
|
923 | |
|
|
924 | Returns the LC_CTYPE category string used by this rxvt-unicode. |
|
|
925 | |
|
|
926 | =item $x_display = $term->display_id |
|
|
927 | |
|
|
928 | Return the DISPLAY used by rxvt-unicode. |
|
|
929 | |
916 | =item $modifiermask = $term->ModLevel3Mask |
930 | =item $modifiermask = $term->ModLevel3Mask |
917 | |
931 | |
918 | =item $modifiermask = $term->ModMetaMask |
932 | =item $modifiermask = $term->ModMetaMask |
919 | |
933 | |
920 | =item $modifiermask = $term->ModNumLockMask |
934 | =item $modifiermask = $term->ModNumLockMask |
… | |
… | |
1109 | Converts rxvt-unicodes text reprsentation into a perl string. See |
1123 | Converts rxvt-unicodes text reprsentation into a perl string. See |
1110 | C<< $term->ROW_t >> for details. |
1124 | C<< $term->ROW_t >> for details. |
1111 | |
1125 | |
1112 | =item $success = $term->grab_button ($button, $modifiermask) |
1126 | =item $success = $term->grab_button ($button, $modifiermask) |
1113 | |
1127 | |
1114 | Registers a synchronous button grab. See XGrabButton. |
1128 | Registers a synchronous button grab. See the XGrabButton manpage. |
1115 | |
1129 | |
1116 | =item $success = $term->grab ($eventtime[, $sync]) |
1130 | =item $success = $term->grab ($eventtime[, $sync]) |
1117 | |
1131 | |
1118 | Calls XGrabPointer and XGrabKeyboard in asynchronous (default) or |
1132 | Calls XGrabPointer and XGrabKeyboard in asynchronous (default) or |
1119 | synchronous (C<$sync> is true). Also remembers the grab timestampe. |
1133 | synchronous (C<$sync> is true). Also remembers the grab timestampe. |
… | |
… | |
1162 | } |
1176 | } |
1163 | |
1177 | |
1164 | sub add_separator { |
1178 | sub add_separator { |
1165 | my ($self, $sep) = @_; |
1179 | my ($self, $sep) = @_; |
1166 | |
1180 | |
1167 | $sep ||= "═"; |
1181 | $sep ||= "="; |
1168 | |
1182 | |
1169 | $self->add_item ({ |
1183 | $self->add_item ({ |
1170 | rend => { normal => "\x1b[0;30;47m", hover => "\x1b[0;30;47m", active => "\x1b[0;30;47m" }, |
1184 | rend => { normal => "\x1b[0;30;47m", hover => "\x1b[0;30;47m", active => "\x1b[0;30;47m" }, |
1171 | text => "", |
1185 | text => "", |
1172 | render => sub { $sep x $urxvt::TERM->ncol }, |
1186 | render => sub { $sep x $self->{term}->ncol }, |
1173 | activate => sub { }, |
1187 | activate => sub { }, |
1174 | }); |
1188 | }); |
1175 | } |
1189 | } |
1176 | |
1190 | |
1177 | sub add_title { |
1191 | sub add_title { |
… | |
… | |
1185 | } |
1199 | } |
1186 | |
1200 | |
1187 | sub add_button { |
1201 | sub add_button { |
1188 | my ($self, $text, $cb) = @_; |
1202 | my ($self, $text, $cb) = @_; |
1189 | |
1203 | |
1190 | $self->add_item ({ type => "button", text => "[ $text ]", activate => $cb}); |
1204 | $self->add_item ({ type => "button", text => $text, activate => $cb}); |
1191 | } |
1205 | } |
1192 | |
1206 | |
1193 | sub add_toggle { |
1207 | sub add_toggle { |
1194 | my ($self, $text, $cb, $value) = @_; |
1208 | my ($self, $text, $cb, $value) = @_; |
1195 | |
1209 | |
… | |
… | |
1207 | sub show { |
1221 | sub show { |
1208 | my ($self) = @_; |
1222 | my ($self) = @_; |
1209 | |
1223 | |
1210 | local $urxvt::popup::self = $self; |
1224 | local $urxvt::popup::self = $self; |
1211 | |
1225 | |
|
|
1226 | local $ENV{LC_ALL} = $self->{term}->locale; |
|
|
1227 | |
1212 | urxvt->new ("--perl-lib" => "", "--perl-ext-common" => "", "-pty-fd" => -1, "-sl" => 0, "-b" => 0, |
1228 | urxvt->new ("--perl-lib" => "", "--perl-ext-common" => "", "-pty-fd" => -1, "-sl" => 0, "-b" => 0, |
1213 | "--transient-for" => $self->{term}->parent, |
1229 | "--transient-for" => $self->{term}->parent, |
|
|
1230 | "-display" => $self->{term}->display_id, |
1214 | "-pe" => "urxvt-popup") |
1231 | "-pe" => "urxvt-popup") |
1215 | or die "unable to create popup window\n"; |
1232 | or die "unable to create popup window\n"; |
1216 | } |
1233 | } |
1217 | |
1234 | |
1218 | sub DESTROY { |
1235 | sub DESTROY { |