| 1 | package TUI::Views::Scroller; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # ABSTRACT: Base class for scrollable views | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 12 | ▶ | use 5.010; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 12 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 12 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 12 | our $VERSION = '2.000002'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 12 | $VERSION =~ tr/_//d; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 12 | our $AUTHORITY = 'cpan:BRICKPOOL'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 12 | ▶ | use Exporter 'import'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 12 | our @EXPORT = qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | TScroller | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | new_TScroller | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 12 | ▶ | use TUI::toolkit; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 12 | ▶ | use TUI::toolkit::Types qw( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | Maybe | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | :is | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | :types | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 12 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 12 | ▶ | use TUI::Drivers::Const qw( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | evBroadcast | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 12 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 12 | ▶ | use TUI::Objects::Point; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 12 | ▶ | use TUI::Views::Const qw( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | cmScrollBarChanged | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | cpScroller | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | ofSelectable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | sfActive | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | sfDragging | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | sfSelected | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 12 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 12 | ▶ | use TUI::Views::Palette; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 12 | ▶ | use TUI::Views::View; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | sub TScroller() { __PACKAGE__ } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | sub name() { 'TScroller' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | ▶ | sub new_TScroller { __PACKAGE__->from(@_) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new_TScroller: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 12 | extends TView; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | # public attributes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | ▶ | has delta => ( is => 'rw', default => sub { TPoint->new } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | # protected attributes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 12 | has drawLock => ( is => 'ro', default => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 12 | has drawFlag => ( is => 'ro', default => false ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 0 | ▶ | has hScrollBar => ( is => 'ro', default => sub { die 'required' } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | ▶ | has vScrollBar => ( is => 'ro', default => sub { die 'required' } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 0 | ▶ | has limit => ( is => 'ro', default => sub { TPoint->new } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | # predeclare private methods | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | my ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 12 | $showSBar, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | ▶ | sub BUILDARGS { # \%args (%args) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BUILDARGS: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | method => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | named => [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | bounds => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | hScrollBar => Maybe[Object], { alias => 'aHScrollBar' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | vScrollBar => Maybe[Object], { alias => 'aVScrollBar' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | caller_level => +1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | my ( $class, $args ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | return { %$args }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 0 | ▶ | sub BUILD { # void (\%args) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BUILD: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | my ( $self, $args ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 0 | ▶ | assert ( @_ == 2 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | ▶ | assert ( is_Object $self ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | $self->{delta}{x} = $self->{delta}{y} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | $self->{limit}{x} = $self->{limit}{y} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | $self->{options} |= ofSelectable; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | $self->{eventMask} |= evBroadcast; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | ▶ | sub from { # $obj ($bounds, $aHScrollBar|undef, $aVScrollBar|undef) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
from: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | method => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | pos => [Object, Maybe[Object], Maybe[Object]], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | my ( $class, @args ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | return $class->new( bounds => $args[0], hScrollBar => $args[1], | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | vScrollBar => $args[2] ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | ▶ | sub changeBounds { # void ($bounds) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
changeBounds: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | pos => [Object], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | my ( $self, $bounds ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | $self->setBounds( $bounds ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | $self->{drawLock}++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | $self->setLimit( $self->{limit}{x}, $self->{limit}{y} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | $self->{drawLock}--; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | $self->{drawFlag} = false; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | $self->drawView(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | ▶ | sub getPalette { # $palette () | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getPalette: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | pos => [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | my ( $self ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | state $palette = TPalette->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | data => cpScroller, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | size => length( cpScroller ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | return $palette->clone(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | ▶ | sub handleEvent { # void ($event) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handleEvent: not called CC=5 SCAR=30.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 12 | ▶ | no warnings 'uninitialized'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | pos => [Object], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | my ( $self, $event ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | $self->SUPER::handleEvent( $event ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | if ( $event->{what} == evBroadcast | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
$event->{"what"} == 512 and $event->{"message"}{"command"} == 53 and $event->{"message"}{"infoPtr"} == $self->{"hScrollBar"} || $event->{"message"}{"infoPtr"} == $self->{"vScrollBar"}
$event->{"what"} == 512 and $event->{"message"}{"command"} == 53
$event->{"message"}{"infoPtr"} == $self->{"hScrollBar"} or $event->{"message"}{"infoPtr"} == $self->{"vScrollBar"}
MC/DC0%0/4
$event->{"what"} == 512 and $event->{"message"}{"command"} == 53 and $event->{"message"}{"infoPtr"} == $self->{"hScrollBar"} || $event->{"message"}{"infoPtr"} == $self->{"vScrollBar"}
$event->{"what"} == 512
$event->{"message"}{"command"} == 53
$event->{"message"}{"infoPtr"} == $self->{"hScrollBar"}
$event->{"message"}{"infoPtr"} == $self->{"vScrollBar"}
Truth table0%0/5
A and B and C or D
A= $event->{"what"} == 512B= $event->{"message"}{"command"} == 53C= $event->{"message"}{"infoPtr"} == $self->{"hScrollBar"}D= $event->{"message"}{"infoPtr"} == $self->{"vScrollBar"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | && $event->{message}{command} == cmScrollBarChanged | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | && ( $event->{message}{infoPtr} == $self->{hScrollBar} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | || $event->{message}{infoPtr} == $self->{vScrollBar} ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | $self->scrollDraw(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | } #/ sub handleEvent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | sub scrollDraw { # void () | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
scrollDraw: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | pos => [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | my ( $self ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 0 | my $d = TPoint->new(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | ▶ | if ( $self->{hScrollBar} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | $d->{x} = $self->{hScrollBar}{value}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | $d->{x} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | ▶ | if ( $self->{vScrollBar} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | $d->{y} = $self->{vScrollBar}{value}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | $d->{y} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | ▶ | if ( $d->{x} != $self->{delta}{x} || $d->{y} != $self->{delta}{y} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$d->{"x"} != $self->{"delta"}{"x"} or $d->{"y"} != $self->{"delta"}{"y"}
MC/DC0%0/2
$d->{"x"} != $self->{"delta"}{"x"} or $d->{"y"} != $self->{"delta"}{"y"}
$d->{"x"} != $self->{"delta"}{"x"}
$d->{"y"} != $self->{"delta"}{"y"}
Truth table0%0/3
A or B
A= $d->{"x"} != $self->{"delta"}{"x"}B= $d->{"y"} != $self->{"delta"}{"y"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | $self->setCursor( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | $self->{cursor}{x} + $self->{delta}{x} - $d->{x}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | $self->{cursor}{y} + $self->{delta}{y} - $d->{y} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | $self->{delta} = $d; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | ▶ | if ( $self->{drawLock} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | $self->{drawFlag} = true; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 0 | $self->drawView(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | } #/ if ( $d->{x} != $self->...) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | ▶ | sub scrollTo { # void ($x, $y) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
scrollTo: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | pos => [Int, Int], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | my ( $self, $x, $y ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | $self->{drawLock}++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | $self->{hScrollBar}->setValue( $x ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | ▶ | if $self->{hScrollBar}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | $self->{vScrollBar}->setValue( $y ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | ▶ | if $self->{vScrollBar}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 0 | $self->{drawLock}--; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | $self->checkDraw(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | ▶ | sub setLimit { # void ($x, $y) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
setLimit: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | pos => [Int, Int], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | my ( $self, $x, $y ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | $self->{limit}{x} = $x; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | $self->{limit}{y} = $y; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | $self->{drawLock}++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | $self->{hScrollBar}->setParams( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | $self->{hScrollBar}{value}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | $x - $self->{size}{x}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | $self->{size}{x} - 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | $self->{hScrollBar}{arStep} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | ▶ | ) if $self->{hScrollBar}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | $self->{vScrollBar}->setParams( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | $self->{vScrollBar}{value}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | $y - $self->{size}{y}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | $self->{size}{y} - 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | $self->{vScrollBar}{arStep} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | ) if $self->{vScrollBar}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | $self->{drawLock}--; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | $self->checkDraw(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | ▶ | sub setState { # void ($aState, $enable) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
setState: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | pos => [PositiveOrZeroInt, Bool], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | my ( $self, $aState, $enable ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | $self->SUPER::setState( $aState, $enable ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | ▶ | $self->drawView() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | if $aState & ( sfActive | sfDragging ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | } #/ sub setState | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | ▶ | sub checkDraw { # void () | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
checkDraw: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | pos => [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | my ( $self ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | ▶ | if ( $self->{drawLock} == 0 && $self->{drawFlag} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{"drawLock"} == 0 and $self->{"drawFlag"}
MC/DC0%0/2
$self->{"drawLock"} == 0 and $self->{"drawFlag"}
$self->{"drawLock"} == 0
$self->{"drawFlag"}
Truth table0%0/3
A and B
A= $self->{"drawLock"} == 0B= $self->{"drawFlag"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | $self->{drawFlag} = false; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | $self->drawView(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | } #/ sub checkDraw | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | ▶ | sub shutDown { # void () | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
shutDown: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | pos => [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | my ( $self ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | 0 | $self->{hScrollBar} = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 0 | $self->{vScrollBar} = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 0 | $self->SUPER::shutDown(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 0 | ▶ | $showSBar = sub { # void ($sBar|undef) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | 0 | my ( $self, $sBar ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 0 | ▶ | assert ( @_ == 2 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 0 | ▶ | assert ( is_Object $self ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 0 | ▶ | assert ( !defined $sBar or is_Object $sBar ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not defined $sBar or &is_Object($sBar)
MC/DC0%0/2
not defined $sBar or &is_Object($sBar)
not defined $sBar
&is_Object($sBar)
Truth table0%0/3
not(A) or B
A= not defined $sBarB= &is_Object($sBar)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | ▶ | if ( $sBar ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | ▶ | ( $self->getState( sfActive | sfSelected ) ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | ? $sBar->show() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | : $sBar->hide(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 12 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 12 | 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||