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
|
|
19
|
use strict; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
117
|
|
8
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
94
|
|
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
20
|
use base qw( Circle::Widget ); |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
795
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new |
13
|
|
|
|
|
|
|
{ |
14
|
4
|
|
|
4
|
0
|
130
|
my $class = shift; |
15
|
4
|
|
|
|
|
19
|
my %args = @_; |
16
|
|
|
|
|
|
|
|
17
|
4
|
|
|
|
|
32
|
my $self = $class->SUPER::new( @_ ); |
18
|
|
|
|
|
|
|
|
19
|
4
|
|
|
|
|
13
|
$self->{scrollback} = $args{scrollback}; |
20
|
|
|
|
|
|
|
|
21
|
4
|
|
|
|
|
19
|
return $self; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub push_event |
25
|
|
|
|
|
|
|
{ |
26
|
8
|
|
|
8
|
0
|
21
|
my $self = shift; |
27
|
8
|
|
|
|
|
19
|
my ( $event, $time, $args ) = @_; |
28
|
|
|
|
|
|
|
|
29
|
8
|
|
|
|
|
50
|
my $eventqueue = $self->get_prop_displayevents; |
30
|
|
|
|
|
|
|
|
31
|
8
|
|
|
|
|
79
|
my $overcount = @$eventqueue + 1 - $self->{scrollback}; |
32
|
|
|
|
|
|
|
|
33
|
8
|
50
|
|
|
|
31
|
$self->shift_prop_displayevents( $overcount ) if $overcount > 0; |
34
|
|
|
|
|
|
|
|
35
|
8
|
|
|
|
|
43
|
$self->push_prop_displayevents( [ $event, $time, $args ] ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
0x55AA; |