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.160 by ayin, Fri Nov 16 10:06:40 2007 UTC vs.
Revision 1.166 by root, Thu Jun 5 08:40:39 2008 UTC

165=item readline (enabled by default) 165=item readline (enabled by default)
166 166
167A support package that tries to make editing with readline easier. At 167A support package that tries to make editing with readline easier. At
168the moment, it reacts to clicking shift-left mouse button by trying to 168the moment, it reacts to clicking shift-left mouse button by trying to
169move the text cursor to this position. It does so by generating as many 169move the text cursor to this position. It does so by generating as many
170cursor-left or cursor-right keypresses as required (the this only works 170cursor-left or cursor-right keypresses as required (this only works
171for programs that correctly support wide characters). 171for programs that correctly support wide characters).
172 172
173To avoid too many false positives, this is only done when: 173To avoid too many false positives, this is only done when:
174 174
175=over 4 175=over 4
1091is that you cannot use blocking APIs, but the non-blocking variant should 1091is that you cannot use blocking APIs, but the non-blocking variant should
1092work. 1092work.
1093 1093
1094=cut 1094=cut
1095 1095
1096our $VERSION = 1; 1096our $VERSION = '3.4';
1097 1097
1098$INC{"urxvt/anyevent.pm"} = 1; # mark us as there 1098$INC{"urxvt/anyevent.pm"} = 1; # mark us as there
1099push @AnyEvent::REGISTRY, [urxvt => urxvt::anyevent::]; 1099push @AnyEvent::REGISTRY, [urxvt => urxvt::anyevent::];
1100 1100
1101sub timer { 1101sub timer {
1132 1132
1133sub DESTROY { 1133sub DESTROY {
1134 $_[0][1]->stop; 1134 $_[0][1]->stop;
1135} 1135}
1136 1136
1137sub condvar {
1138 bless \my $flag, urxvt::anyevent::
1139}
1140
1141sub broadcast {
1142 ${$_[0]}++;
1143}
1144
1145sub wait {
1146 unless (${$_[0]}) {
1147 Carp::croak "AnyEvent->condvar blocking wait unsupported in urxvt, use a non-blocking API";
1148 }
1149}
1150
1151sub one_event { 1137sub one_event {
1152 Carp::croak "AnyEvent->one_event blocking wait unsupported in urxvt, use a non-blocking API"; 1138 Carp::croak "AnyEvent->one_event blocking wait unsupported in urxvt, use a non-blocking API";
1153} 1139}
1154 1140
1155package urxvt::term; 1141package urxvt::term;
1285 mouseWheelScrollPage name override_redirect pastableTabs path perl_eval 1271 mouseWheelScrollPage name override_redirect pastableTabs path perl_eval
1286 perl_ext_1 perl_ext_2 perl_lib pointerBlank pointerBlankDelay 1272 perl_ext_1 perl_ext_2 perl_lib pointerBlank pointerBlankDelay
1287 preeditType print_pipe pty_fd reverseVideo saveLines scrollBar 1273 preeditType print_pipe pty_fd reverseVideo saveLines scrollBar
1288 scrollBar_align scrollBar_floating scrollBar_right scrollBar_thickness 1274 scrollBar_align scrollBar_floating scrollBar_right scrollBar_thickness
1289 scrollTtyKeypress scrollTtyOutput scrollWithBuffer scrollstyle 1275 scrollTtyKeypress scrollTtyOutput scrollWithBuffer scrollstyle
1290 secondaryScreen secondaryScroll selectstyle shade term_name title 1276 secondaryScreen secondaryScroll shade term_name title
1291 transient_for transparent transparent_all tripleclickwords utmpInhibit 1277 transient_for transparent transparent_all tripleclickwords utmpInhibit
1292 visualBell 1278 visualBell
1293 1279
1294=cut 1280=cut
1295 1281
1611 1597
1612Used after changing terminal contents to display them. 1598Used after changing terminal contents to display them.
1613 1599
1614=item $text = $term->ROW_t ($row_number[, $new_text[, $start_col]]) 1600=item $text = $term->ROW_t ($row_number[, $new_text[, $start_col]])
1615 1601
1616Returns the text of the entire row with number C<$row_number>. Row C<0> 1602Returns the text of the entire row with number C<$row_number>. Row C<< $term->top_row >>
1617is the topmost terminal line, row C<< $term->$ncol-1 >> is the bottommost 1603is the topmost terminal line, row C<< $term->nrow-1 >> is the bottommost
1618terminal line. The scrollback buffer starts at line C<-1> and extends to
1619line C<< -$term->nsaved >>. Nothing will be returned if a nonexistent line 1604terminal line. Nothing will be returned if a nonexistent line
1620is requested. 1605is requested.
1621 1606
1622If C<$new_text> is specified, it will replace characters in the current 1607If C<$new_text> is specified, it will replace characters in the current
1623line, starting at column C<$start_col> (default C<0>), which is useful 1608line, starting at column C<$start_col> (default C<0>), which is useful
1624to replace only parts of a line. The font index in the rendition will 1609to replace only parts of a line. The font index in the rendition will
1625automatically be updated. 1610automatically be updated.
1626 1611
1627C<$text> is in a special encoding: tabs and wide characters that use more 1612C<$text> is in a special encoding: tabs and wide characters that use more
1628than one cell when displayed are padded with C<$urxvt::NOCHAR> (chr 65535) 1613than one cell when displayed are padded with C<$urxvt::NOCHAR> (chr 65535)
1629characters. Characters with combining characters and other characters that 1614characters. Characters with combining characters and other characters that
1630do not fit into the normal tetx encoding will be replaced with characters 1615do not fit into the normal text encoding will be replaced with characters
1631in the private use area. 1616in the private use area.
1632 1617
1633You have to obey this encoding when changing text. The advantage is 1618You have to obey this encoding when changing text. The advantage is
1634that C<substr> and similar functions work on screen cells and not on 1619that C<substr> and similar functions work on screen cells and not on
1635characters. 1620characters.
1954 my $env = $self->{term}->env; 1939 my $env = $self->{term}->env;
1955 # we can't hope to reproduce the locale algorithm, so nuke LC_ALL and set LC_CTYPE. 1940 # we can't hope to reproduce the locale algorithm, so nuke LC_ALL and set LC_CTYPE.
1956 delete $env->{LC_ALL}; 1941 delete $env->{LC_ALL};
1957 $env->{LC_CTYPE} = $self->{term}->locale; 1942 $env->{LC_CTYPE} = $self->{term}->locale;
1958 1943
1959 urxvt::term->new ($env, "popup", 1944 my $term = urxvt::term->new (
1945 $env, "popup",
1960 "--perl-lib" => "", "--perl-ext-common" => "", 1946 "--perl-lib" => "", "--perl-ext-common" => "",
1961 "-pty-fd" => -1, "-sl" => 0, 1947 "-pty-fd" => -1, "-sl" => 0,
1962 "-b" => 1, "-bd" => "grey80", "-bl", "-override-redirect", 1948 "-b" => 1, "-bd" => "grey80", "-bl", "-override-redirect",
1963 "--transient-for" => $self->{term}->parent, 1949 "--transient-for" => $self->{term}->parent,
1964 "-display" => $self->{term}->display_id, 1950 "-display" => $self->{term}->display_id,
1965 "-pe" => "urxvt-popup") 1951 "-pe" => "urxvt-popup",
1966 or die "unable to create popup window\n"; 1952 ) or die "unable to create popup window\n";
1953
1954 unless (delete $term->{urxvt_popup_init_done}) {
1955 $term->ungrab;
1956 $term->destroy;
1957 die "unable to initialise popup window\n";
1958 }
1967} 1959}
1968 1960
1969sub DESTROY { 1961sub DESTROY {
1970 my ($self) = @_; 1962 my ($self) = @_;
1971 1963

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines