line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#_{ Encoding and name |
2
|
|
|
|
|
|
|
=encoding utf8 |
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Grid::Layout::Area |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=cut |
8
|
|
|
|
|
|
|
#_} |
9
|
|
|
|
|
|
|
package Grid::Layout::Area; |
10
|
|
|
|
|
|
|
#_{ use … |
11
|
5
|
|
|
5
|
|
28
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
129
|
|
12
|
5
|
|
|
5
|
|
21
|
use strict; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
74
|
|
13
|
5
|
|
|
5
|
|
21
|
use utf8; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
17
|
|
14
|
|
|
|
|
|
|
|
15
|
5
|
|
|
5
|
|
82
|
use Carp; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
1934
|
|
16
|
|
|
|
|
|
|
#_} |
17
|
|
|
|
|
|
|
our $VERSION = 0.01; |
18
|
|
|
|
|
|
|
#_{ Synopsis |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SYNOPSIS |
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
#_} |
23
|
|
|
|
|
|
|
#_{ Description |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 DESCRIPTION |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
A C<< Grid::Layout::Area >> is bound by 2 different horizontal L<< Grid::Layout::Line >>s and |
28
|
|
|
|
|
|
|
2 different vertical L<< Grid::Layout::Line >>s. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Thus, it's I is at least one L<< Grid::Layout::Cell >> and an exact integer multiple |
31
|
|
|
|
|
|
|
of L<< Grid::Layout::Cell >>s. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=cut |
34
|
|
|
|
|
|
|
#_} |
35
|
|
|
|
|
|
|
#_{ Methods |
36
|
|
|
|
|
|
|
#_{ POD |
37
|
|
|
|
|
|
|
=head1 METHODS |
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
#_} |
40
|
|
|
|
|
|
|
sub new { #_{ |
41
|
|
|
|
|
|
|
#_{ POD |
42
|
|
|
|
|
|
|
=head2 new |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
46
|
|
|
|
|
|
|
#_} |
47
|
|
|
|
|
|
|
|
48
|
9
|
|
|
9
|
0
|
13
|
my $class = shift; |
49
|
9
|
|
|
|
|
11
|
my $track_v_from = shift; |
50
|
9
|
|
|
|
|
11
|
my $track_h_from = shift; |
51
|
9
|
|
|
|
|
12
|
my $track_v_to = shift; |
52
|
9
|
|
|
|
|
12
|
my $track_h_to = shift; |
53
|
|
|
|
|
|
|
|
54
|
9
|
50
|
|
|
|
26
|
croak 'track_v_from is not a Grid::Layout::Track' unless $track_v_from->isa('Grid::Layout::Track'); |
55
|
9
|
50
|
|
|
|
19
|
croak 'track_v_to is not a Grid::Layout::Track' unless $track_v_to ->isa('Grid::Layout::Track'); |
56
|
9
|
50
|
|
|
|
19
|
croak 'track_h_from is not a Grid::Layout::Track' unless $track_h_from->isa('Grid::Layout::Track'); |
57
|
9
|
50
|
|
|
|
18
|
croak 'track_h_to is not a Grid::Layout::Track' unless $track_h_to ->isa('Grid::Layout::Track'); |
58
|
|
|
|
|
|
|
|
59
|
9
|
50
|
|
|
|
25
|
croak 'track_v_from is not a vertical' unless $track_v_from->{V_or_H} eq 'V'; |
60
|
9
|
50
|
|
|
|
17
|
croak 'track_v_to is not a vertical' unless $track_v_to ->{V_or_H} eq 'V'; |
61
|
9
|
50
|
|
|
|
18
|
croak 'track_h_from is not a vertical' unless $track_h_from->{V_or_H} eq 'H'; |
62
|
9
|
50
|
|
|
|
15
|
croak 'track_h_to is not a vertical' unless $track_h_to ->{V_or_H} eq 'H'; |
63
|
|
|
|
|
|
|
|
64
|
9
|
|
|
|
|
19
|
my $self = {}; |
65
|
|
|
|
|
|
|
|
66
|
9
|
|
|
|
|
26
|
$self->{track}{'V'}{from} = $track_v_from; |
67
|
9
|
|
|
|
|
14
|
$self->{track}{'V'}{to } = $track_v_to ; |
68
|
9
|
|
|
|
|
14
|
$self->{track}{'H'}{from} = $track_h_from; |
69
|
9
|
|
|
|
|
11
|
$self->{track}{'H'}{to } = $track_h_to ; |
70
|
|
|
|
|
|
|
|
71
|
9
|
|
|
|
|
22
|
bless $self, $class; |
72
|
|
|
|
|
|
|
|
73
|
9
|
|
|
|
|
18
|
return $self; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
} #_} |
76
|
|
|
|
|
|
|
#_{ x/y_from/to |
77
|
|
|
|
|
|
|
sub x_from { #_{ |
78
|
|
|
|
|
|
|
#_{ POD |
79
|
|
|
|
|
|
|
=head2 x_from |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=cut |
82
|
|
|
|
|
|
|
#_} |
83
|
|
|
|
|
|
|
|
84
|
48
|
|
|
48
|
0
|
7063
|
my $self = shift; |
85
|
|
|
|
|
|
|
|
86
|
48
|
|
|
|
|
131
|
return $self->{track}{V}{from}->{position}; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
#_} |
89
|
|
|
|
|
|
|
sub x_to { #_{ |
90
|
|
|
|
|
|
|
#_{ POD |
91
|
|
|
|
|
|
|
=head2 x_to |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut |
94
|
|
|
|
|
|
|
#_} |
95
|
|
|
|
|
|
|
|
96
|
12
|
|
|
12
|
0
|
19
|
my $self = shift; |
97
|
|
|
|
|
|
|
|
98
|
12
|
|
|
|
|
29
|
return $self->{track}{V}{to}->{position}; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
#_} |
101
|
|
|
|
|
|
|
sub y_from { #_{ |
102
|
|
|
|
|
|
|
#_{ POD |
103
|
|
|
|
|
|
|
=head2 y_from |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=cut |
106
|
|
|
|
|
|
|
#_} |
107
|
|
|
|
|
|
|
|
108
|
31
|
|
|
31
|
0
|
66
|
my $self = shift; |
109
|
|
|
|
|
|
|
|
110
|
31
|
|
|
|
|
76
|
return $self->{track}{H}{from}->{position}; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
#_} |
113
|
|
|
|
|
|
|
sub y_to { #_{ |
114
|
|
|
|
|
|
|
#_{ POD |
115
|
|
|
|
|
|
|
=head2 y_to |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=cut |
118
|
|
|
|
|
|
|
#_} |
119
|
|
|
|
|
|
|
|
120
|
12
|
|
|
12
|
0
|
15
|
my $self = shift; |
121
|
|
|
|
|
|
|
|
122
|
12
|
|
|
|
|
32
|
return $self->{track}{H}{to}->{position}; |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
#_} |
125
|
|
|
|
|
|
|
#_} |
126
|
|
|
|
|
|
|
#_{ width/height |
127
|
|
|
|
|
|
|
sub width { #_{ |
128
|
|
|
|
|
|
|
#_{ POD |
129
|
|
|
|
|
|
|
=head2 width |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=cut |
132
|
|
|
|
|
|
|
#_} |
133
|
10
|
|
|
10
|
0
|
36
|
my $self = shift; |
134
|
10
|
|
|
|
|
18
|
return $self->x_to - $self->x_from+1; |
135
|
|
|
|
|
|
|
} #_} |
136
|
|
|
|
|
|
|
sub height { #_{ |
137
|
|
|
|
|
|
|
#_{ POD |
138
|
|
|
|
|
|
|
=head2 height |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=cut |
141
|
|
|
|
|
|
|
#_} |
142
|
10
|
|
|
10
|
0
|
27
|
my $self = shift; |
143
|
10
|
|
|
|
|
16
|
return $self->y_to - $self->y_from +1; |
144
|
|
|
|
|
|
|
} #_} |
145
|
|
|
|
|
|
|
#_} |
146
|
|
|
|
|
|
|
#_} |
147
|
|
|
|
|
|
|
#_{ POD: Copyright |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=head1 Copyright |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
Copyright © 2017 René Nyffenegger, Switzerland. All rights reserved. |
152
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
153
|
|
|
|
|
|
|
under the terms of the the Artistic License (2.0). You may obtain a |
154
|
|
|
|
|
|
|
copy of the full license at: L |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=cut |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
#_} |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
'tq84'; |