| 1 | package TUI::Views::View::Exposed; | ||||||||||||||||||||||||||||
| 2 | # ABSTRACT: TView exposed member functions. | ||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 94 | ▶ | use 5.010; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 94 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 94 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 94 | our $VERSION = '2.000002'; | |||||||||||||||||||||||||||
| 9 | 94 | $VERSION =~ tr/_//d; | |||||||||||||||||||||||||||
| 10 | 94 | our $AUTHORITY = 'cpan:BRICKPOOL'; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 94 | ▶ | use Scalar::Util qw( weaken ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 94 | ▶ | use TUI::toolkit::boolean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 94 | ▶ | use TUI::Views::Const qw( | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | sfExposed | ||||||||||||||||||||||||||||
| 17 | sfVisible | ||||||||||||||||||||||||||||
| 18 | 94 | ); | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 94 | my $eax = 0; | |||||||||||||||||||||||||||
| 21 | 94 | my $ebx = 0; | |||||||||||||||||||||||||||
| 22 | 94 | my $ecx = 0; | |||||||||||||||||||||||||||
| 23 | 94 | my $esi = 0; | |||||||||||||||||||||||||||
| 24 | 94 | my $target = undef; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 94 | ▶ | use subs qw( | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 27 | L0 | ||||||||||||||||||||||||||||
| 28 | L1 | ||||||||||||||||||||||||||||
| 29 | L10 | ||||||||||||||||||||||||||||
| 30 | L11 | ||||||||||||||||||||||||||||
| 31 | L12 | ||||||||||||||||||||||||||||
| 32 | L13 | ||||||||||||||||||||||||||||
| 33 | L20 | ||||||||||||||||||||||||||||
| 34 | L21 | ||||||||||||||||||||||||||||
| 35 | L22 | ||||||||||||||||||||||||||||
| 36 | L23 | ||||||||||||||||||||||||||||
| 37 | 94 | ); | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 0 | ▶ | sub L0 { # $bool ($dest) | ||||||||||||||||||||||||||
|
Subroutine
L0: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||
| 40 | 0 | my ( $dest ) = @_; | |||||||||||||||||||||||||||
| 41 | return false | ||||||||||||||||||||||||||||
| 42 | 0 | ▶ | unless $dest->{state} & sfExposed; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | return false | ||||||||||||||||||||||||||||
| 44 | 0 | ▶ | if 0 >= $dest->{size}{x} || 0 >= $dest->{size}{y}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
0 >= $dest->{"size"}{"x"} or 0 >= $dest->{"size"}{"y"}
MC/DC0%0/2
0 >= $dest->{"size"}{"x"} or 0 >= $dest->{"size"}{"y"}
0 >= $dest->{"size"}{"x"}
0 >= $dest->{"size"}{"y"}
Truth table0%0/3
A or B
A= 0 >= $dest->{"size"}{"x"}B= 0 >= $dest->{"size"}{"y"}
| |||||||||||||||||||||||||||||
| 45 | 0 | return L1( $dest ); | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 0 | ▶ | sub L1 { # $bool ($dest) | ||||||||||||||||||||||||||
|
Subroutine
L1: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 49 | 0 | my ( $dest ) = @_; | |||||||||||||||||||||||||||
| 50 | 0 | my $i = 0; | |||||||||||||||||||||||||||
| 51 | do { | ||||||||||||||||||||||||||||
| 52 | 0 | $eax = $i; | |||||||||||||||||||||||||||
| 53 | 0 | $ebx = 0; | |||||||||||||||||||||||||||
| 54 | 0 | $ecx = $dest->{size}{x}; | |||||||||||||||||||||||||||
| 55 | 0 | ▶ | return true | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 56 | unless L11( $dest ); | ||||||||||||||||||||||||||||
| 57 | 0 | $i++; | |||||||||||||||||||||||||||
| 58 | 0 | ▶ | } while ( $i < $dest->{size}{y} ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 59 | 0 | return false; | |||||||||||||||||||||||||||
| 60 | } #/ sub L1 | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 0 | ▶ | sub L10 { # $bool ($dest) | ||||||||||||||||||||||||||
|
Subroutine
L10: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 63 | 0 | my ( $dest ) = @_; | |||||||||||||||||||||||||||
| 64 | 0 | my $owner = $dest->owner(); | |||||||||||||||||||||||||||
| 65 | return false | ||||||||||||||||||||||||||||
| 66 | if $owner->{buffer} | ||||||||||||||||||||||||||||
| 67 | 0 | ▶ | || $owner->{lockFlag}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$owner->{"buffer"} or $owner->{"lockFlag"}
MC/DC0%0/2
$owner->{"buffer"} or $owner->{"lockFlag"}
$owner->{"buffer"}
$owner->{"lockFlag"}
Truth table0%0/3
A or B
A= $owner->{"buffer"}B= $owner->{"lockFlag"}
| |||||||||||||||||||||||||||||
| 68 | 0 | return L11( $owner ); | |||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | 0 | ▶ | sub L11 { # $bool ($dest) | ||||||||||||||||||||||||||
|
Subroutine
L11: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||
| 72 | 0 | my ( $dest ) = @_; | |||||||||||||||||||||||||||
| 73 | 0 | weaken( $target = $dest ); | |||||||||||||||||||||||||||
| 74 | 0 | $eax += $dest->{origin}{y}; | |||||||||||||||||||||||||||
| 75 | 0 | $ebx += $dest->{origin}{x}; | |||||||||||||||||||||||||||
| 76 | 0 | $ecx += $dest->{origin}{x}; | |||||||||||||||||||||||||||
| 77 | 0 | my $owner = $dest->owner(); | |||||||||||||||||||||||||||
| 78 | 0 | ▶ | return false | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 79 | unless $owner; | ||||||||||||||||||||||||||||
| 80 | return true | ||||||||||||||||||||||||||||
| 81 | 0 | ▶ | if $eax < $owner->{clip}{a}{y}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 82 | return true | ||||||||||||||||||||||||||||
| 83 | 0 | ▶ | if $eax >= $owner->{clip}{b}{y}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 84 | return L12( $owner ) | ||||||||||||||||||||||||||||
| 85 | 0 | ▶ | if $ebx >= $owner->{clip}{a}{x}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 86 | 0 | $ebx = $owner->{clip}{a}{x}; | |||||||||||||||||||||||||||
| 87 | 0 | return L12( $owner ); | |||||||||||||||||||||||||||
| 88 | } #/ sub L11 | ||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | 0 | ▶ | sub L12 { # $bool ($owner) | ||||||||||||||||||||||||||
|
Subroutine
L12: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 91 | 0 | my ( $owner ) = @_; | |||||||||||||||||||||||||||
| 92 | return L13( $owner ) | ||||||||||||||||||||||||||||
| 93 | 0 | ▶ | if $ecx <= $owner->{clip}{b}{x}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 94 | 0 | $ecx = $owner->{clip}{b}{x}; | |||||||||||||||||||||||||||
| 95 | 0 | return L13( $owner ); | |||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | 0 | ▶ | sub L13 { # $bool ($owner) | ||||||||||||||||||||||||||
|
Subroutine
L13: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 99 | 0 | my ( $owner ) = @_; | |||||||||||||||||||||||||||
| 100 | 0 | ▶ | return true | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 101 | if $ebx >= $ecx; | ||||||||||||||||||||||||||||
| 102 | 0 | return L20( $owner->last() ); | |||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | 0 | ▶ | sub L20 { # $bool ($dest) | ||||||||||||||||||||||||||
|
Subroutine
L20: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 106 | 0 | my ( $dest ) = @_; | |||||||||||||||||||||||||||
| 107 | 0 | my $next = $dest->next(); | |||||||||||||||||||||||||||
| 108 | 0 | ▶ | return L10( $next ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 109 | if $next == $target; | ||||||||||||||||||||||||||||
| 110 | 0 | return L21( $next ); | |||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||
| 113 | 0 | ▶ | sub L21 { # $bool ($next) | ||||||||||||||||||||||||||
|
Subroutine
L21: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||
| 114 | 0 | my ( $next ) = @_; | |||||||||||||||||||||||||||
| 115 | return L20( $next ) | ||||||||||||||||||||||||||||
| 116 | 0 | ▶ | unless $next->{state} & sfVisible; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 117 | 0 | $esi = $next->{origin}{y}; | |||||||||||||||||||||||||||
| 118 | 0 | ▶ | return L20( $next ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 119 | if $eax < $esi; | ||||||||||||||||||||||||||||
| 120 | 0 | $esi += $next->{size}{y}; | |||||||||||||||||||||||||||
| 121 | 0 | ▶ | return L20( $next ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 122 | if $eax >= $esi; | ||||||||||||||||||||||||||||
| 123 | 0 | $esi = $next->{origin}{x}; | |||||||||||||||||||||||||||
| 124 | 0 | ▶ | return L22( $next ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 125 | if $ebx < $esi; | ||||||||||||||||||||||||||||
| 126 | 0 | $esi += $next->{size}{x}; | |||||||||||||||||||||||||||
| 127 | 0 | ▶ | return L20( $next ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 128 | if $ebx >= $esi; | ||||||||||||||||||||||||||||
| 129 | 0 | $ebx = $esi; | |||||||||||||||||||||||||||
| 130 | 0 | ▶ | return L20( $next ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 131 | if $ebx < $ecx; | ||||||||||||||||||||||||||||
| 132 | 0 | return true; | |||||||||||||||||||||||||||
| 133 | } #/ sub L21 | ||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||
| 135 | 0 | ▶ | sub L22 { # $bool ($next) | ||||||||||||||||||||||||||
|
Subroutine
L22: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 136 | 0 | my ( $next ) = @_; | |||||||||||||||||||||||||||
| 137 | 0 | ▶ | return L20( $next ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 138 | if $ecx <= $esi; | ||||||||||||||||||||||||||||
| 139 | 0 | $esi += $next->{size}{x}; | |||||||||||||||||||||||||||
| 140 | 0 | ▶ | return L23( $next ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 141 | if $ecx > $esi; | ||||||||||||||||||||||||||||
| 142 | 0 | $ecx = $next->{origin}{x}; | |||||||||||||||||||||||||||
| 143 | 0 | return L20( $next ); | |||||||||||||||||||||||||||
| 144 | } #/ sub L22 | ||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||
| 146 | 0 | ▶ | sub L23 { # $bool ($next) | ||||||||||||||||||||||||||
|
Subroutine
L23: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 147 | 0 | my ( $next ) = @_; | |||||||||||||||||||||||||||
| 148 | 0 | my $_target = $target; | |||||||||||||||||||||||||||
| 149 | 0 | my $_esi = $esi; | |||||||||||||||||||||||||||
| 150 | 0 | my $_ecx = $ecx; | |||||||||||||||||||||||||||
| 151 | 0 | my $_eax = $eax; | |||||||||||||||||||||||||||
| 152 | 0 | $ecx = $next->{origin}{x}; | |||||||||||||||||||||||||||
| 153 | 0 | my $b = L20( $next ); | |||||||||||||||||||||||||||
| 154 | 0 | $eax = $_eax; | |||||||||||||||||||||||||||
| 155 | 0 | $ecx = $_ecx; | |||||||||||||||||||||||||||
| 156 | 0 | $ebx = $_esi; | |||||||||||||||||||||||||||
| 157 | 0 | weaken( $target = $_target ); | |||||||||||||||||||||||||||
| 158 | 0 | ▶ | return L20( $next ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 159 | if $b; | ||||||||||||||||||||||||||||
| 160 | 0 | return false; | |||||||||||||||||||||||||||
| 161 | } #/ sub L23 | ||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||
| 163 | 94 | 1 | |||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | __END__ | ||||||||||||||||||||||||||||