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.33 by root, Thu Jan 5 01:04:10 2006 UTC vs.
Revision 1.34 by root, Fri Jan 6 01:16:58 2006 UTC

780 780
781 bless { 781 bless {
782 term => $self, 782 term => $self,
783 beg => $beg, 783 beg => $beg,
784 end => $end, 784 end => $end,
785 ncol => $self->ncol,
785 len => ($end - $beg) * $self->ncol + $self->ROW_l ($end), 786 len => ($end - $beg) * $self->ncol + $self->ROW_l ($end),
786 }, urxvt::line:: 787 }, urxvt::line::
787} 788}
788 789
789sub urxvt::line::t { 790sub urxvt::line::t {
790 my ($self) = @_; 791 my ($self) = @_;
791 792
793 if (@_ > 1)
794 {
795 $self->{term}->ROW_t ($_, $_[1], 0, ($_ - $self->{beg}) * $self->{ncol}, $self->{ncol})
796 for $self->{beg} .. $self->{end};
797 }
798
799 defined wantarray &&
792 substr +(join "", map $self->{term}->ROW_t ($_), $self->{beg} .. $self->{end}), 800 substr +(join "", map $self->{term}->ROW_t ($_), $self->{beg} .. $self->{end}),
793 0, $self->{len} 801 0, $self->{len}
794} 802}
795 803
796sub urxvt::line::r { 804sub urxvt::line::r {
797 my ($self) = @_; 805 my ($self) = @_;
798 806
807 if (@_ > 1)
808 {
809 $self->{term}->ROW_r ($_, $_[1], 0, ($_ - $self->{beg}) * $self->{ncol}, $self->{ncol})
810 for $self->{beg} .. $self->{end};
811 }
812
813 if (defined wantarray) {
799 my $rend = [ 814 my $rend = [
800 map @{ $self->{term}->ROW_r ($_) }, $self->{beg} .. $self->{end} 815 map @{ $self->{term}->ROW_r ($_) }, $self->{beg} .. $self->{end}
801 ]; 816 ];
802 $#$rend = $self->{len} - 1; 817 $#$rend = $self->{len} - 1;
803 $rend 818 return $rend;
819 }
820
821 ()
804} 822}
805 823
806sub urxvt::line::beg { $_[0]{beg} } 824sub urxvt::line::beg { $_[0]{beg} }
807sub urxvt::line::end { $_[0]{end} } 825sub urxvt::line::end { $_[0]{end} }
808sub urxvt::line::l { $_[0]{len} } 826sub urxvt::line::l { $_[0]{len} }
809 827
810sub urxvt::line::offset_of { 828sub urxvt::line::offset_of {
811 my ($self, $row, $col) = @_; 829 my ($self, $row, $col) = @_;
812 830
813 ($row - $self->{beg}) * $self->{term}->ncol + $col 831 ($row - $self->{beg}) * $self->{ncol} + $col
814} 832}
815 833
816sub urxvt::line::coord_of { 834sub urxvt::line::coord_of {
817 my ($self, $offset) = @_; 835 my ($self, $offset) = @_;
818 836
819 use integer; 837 use integer;
820 838
821 ( 839 (
822 $offset / $self->{term}->ncol + $self->{beg}, 840 $offset / $self->{ncol} + $self->{beg},
823 $offset % $self->{term}->ncol 841 $offset % $self->{ncol}
824 ) 842 )
825} 843}
826 844
827=item ($row, $col) = $line->coord_of ($offset) 845=item ($row, $col) = $line->coord_of ($offset)
828=item $text = $term->special_encode $string 846=item $text = $term->special_encode $string

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines