line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# You may distribute under the terms of the GNU General Public License |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# (C) Paul Evans, 2008-2014 -- leonerd@leonerd.org.uk |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Circle::Widget::Scroller; |
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
14
|
use strict; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
105
|
|
8
|
4
|
|
|
4
|
|
17
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
113
|
|
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
17
|
use base qw( Circle::Widget ); |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
793
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new |
13
|
|
|
|
|
|
|
{ |
14
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
15
|
0
|
|
|
|
|
|
my %args = @_; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new( @_ ); |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
$self->{scrollback} = $args{scrollback}; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
return $self; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub push_event |
25
|
|
|
|
|
|
|
{ |
26
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
27
|
0
|
|
|
|
|
|
my ( $event, $time, $args ) = @_; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
my $eventqueue = $self->get_prop_displayevents; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
my $overcount = @$eventqueue + 1 - $self->{scrollback}; |
32
|
|
|
|
|
|
|
|
33
|
0
|
0
|
|
|
|
|
$self->shift_prop_displayevents( $overcount ) if $overcount > 0; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
$self->push_prop_displayevents( [ $event, $time, $args ] ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
0x55AA; |