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