line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Video::CPL::Layout; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
13
|
|
5
|
1
|
|
|
1
|
|
2
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
44
|
|
6
|
1
|
|
|
1
|
|
4
|
use XML::Writer; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
19
|
|
7
|
1
|
|
|
1
|
|
4
|
use Data::Dumper; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
742
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Video::CPL::Layout - Manage layouts. |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 VERSION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Version 0.09 |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=cut |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $VERSION = '0.09'; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 SYNOPSIS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Quick summary of what the module does. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Perhaps a little code snippet. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
use Video::CPL::Layout; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=cut |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
our @FIELDS = qw(videoHeight videoVCenter videoTop videoBottom videoWidth videoHCenter videoLeft videoRight webHeight webVCenter webTop webBottom webWidth webHCenter webLeft webRight name); |
36
|
|
|
|
|
|
|
|
37
|
2
|
50
|
|
2
|
0
|
3
|
sub videoHeight { my $obj = shift; $obj->{videoHeight} = shift if @_; return $obj->{videoHeight};}; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
8
|
|
38
|
2
|
50
|
|
2
|
0
|
3
|
sub videoVCenter { my $obj = shift; $obj->{videoVCenter} = shift if @_; return $obj->{videoVCenter};}; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
7
|
|
39
|
2
|
50
|
|
2
|
0
|
3
|
sub videoTop { my $obj = shift; $obj->{videoTop} = shift if @_; return $obj->{videoTop};}; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
7
|
|
40
|
2
|
50
|
|
2
|
0
|
2
|
sub videoBottom { my $obj = shift; $obj->{videoBottom} = shift if @_; return $obj->{videoBottom};}; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
8
|
|
41
|
2
|
50
|
|
2
|
0
|
2
|
sub videoWidth { my $obj = shift; $obj->{videoWidth} = shift if @_; return $obj->{videoWidth};}; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
7
|
|
42
|
2
|
50
|
|
2
|
0
|
2
|
sub videoHCenter { my $obj = shift; $obj->{videoHCenter} = shift if @_; return $obj->{videoHCenter};}; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
7
|
|
43
|
2
|
50
|
|
2
|
0
|
3
|
sub videoLeft { my $obj = shift; $obj->{videoLeft} = shift if @_; return $obj->{videoLeft};}; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
8
|
|
44
|
2
|
50
|
|
2
|
0
|
3
|
sub videoRight { my $obj = shift; $obj->{videoRight} = shift if @_; return $obj->{videoRight};}; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
8
|
|
45
|
2
|
50
|
|
2
|
0
|
2
|
sub webHeight { my $obj = shift; $obj->{webHeight} = shift if @_; return $obj->{webHeight};}; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
8
|
|
46
|
2
|
50
|
|
2
|
0
|
8
|
sub webVCenter { my $obj = shift; $obj->{webVCenter} = shift if @_; return $obj->{webVCenter};}; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
8
|
|
47
|
2
|
50
|
|
2
|
0
|
3
|
sub webTop { my $obj = shift; $obj->{webTop} = shift if @_; return $obj->{webTop};}; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
8
|
|
48
|
2
|
50
|
|
2
|
0
|
2
|
sub webBottom { my $obj = shift; $obj->{webBottom} = shift if @_; return $obj->{webBottom};}; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
6
|
|
49
|
2
|
50
|
|
2
|
0
|
3
|
sub webWidth { my $obj = shift; $obj->{webWidth} = shift if @_; return $obj->{webWidth};}; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
6
|
|
50
|
2
|
50
|
|
2
|
0
|
3
|
sub webHCenter { my $obj = shift; $obj->{webHCenter} = shift if @_; return $obj->{webHCenter};}; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
7
|
|
51
|
2
|
50
|
|
2
|
0
|
3
|
sub webLeft { my $obj = shift; $obj->{webLeft} = shift if @_; return $obj->{webLeft};}; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
6
|
|
52
|
2
|
50
|
|
2
|
0
|
3
|
sub webRight { my $obj = shift; $obj->{webRight} = shift if @_; return $obj->{webRight};}; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
6
|
|
53
|
64
|
50
|
|
64
|
0
|
39
|
sub name { my $obj = shift; $obj->{name} = shift if @_; return $obj->{name};}; |
|
64
|
|
|
|
|
86
|
|
|
64
|
|
|
|
|
256
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 new() |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Create a new Layout object. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub new { |
62
|
4
|
|
|
4
|
1
|
5
|
my $pkg = shift; |
63
|
4
|
|
|
|
|
18
|
my %parms = @_; |
64
|
4
|
|
|
|
|
4
|
my $ret = {}; |
65
|
4
|
|
|
|
|
6
|
bless $ret,$pkg; |
66
|
|
|
|
|
|
|
|
67
|
4
|
|
|
|
|
7
|
foreach my $x (@FIELDS){ |
68
|
68
|
100
|
|
|
|
104
|
$ret->{$x} = $parms{$x} if defined $parms{$x}; |
69
|
|
|
|
|
|
|
} |
70
|
4
|
|
|
|
|
11
|
foreach my $x (keys %parms){ |
71
|
36
|
50
|
|
|
|
43
|
confess("Parameter ('$x') given to Video::CPL::Layout::new, but not understood\n") if !defined $ret->{$x}; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
4
|
|
|
|
|
16
|
return $ret; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head2 xmlo |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Given an XML::Writer object, add the xml information for this Layout. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=cut |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub xmlo { |
84
|
2
|
|
|
2
|
1
|
2
|
my $obj = shift; |
85
|
2
|
|
|
|
|
2
|
my $xo = shift; |
86
|
2
|
|
|
|
|
2
|
my %p; |
87
|
2
|
|
|
|
|
3
|
foreach my $x (@FIELDS){ |
88
|
34
|
100
|
|
|
|
62
|
$p{$x} = $obj->{$x} if defined $obj->{$x}; |
89
|
|
|
|
|
|
|
} |
90
|
2
|
|
|
|
|
7
|
$xo->emptyTag("layout",%p); |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head2 xml() |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Return the xml format of a Layout object. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub xml { |
100
|
0
|
|
|
0
|
1
|
0
|
my $obj = shift; |
101
|
0
|
|
|
|
|
0
|
my $a; |
102
|
0
|
|
|
|
|
0
|
my $xo = new XML::Writer(OUTPUT=>\$a); |
103
|
0
|
|
|
|
|
0
|
$obj->xmlo($xo); |
104
|
0
|
|
|
|
|
0
|
$xo->end(); |
105
|
0
|
|
|
|
|
0
|
return $a; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub fromxml { |
109
|
2
|
|
|
2
|
0
|
2
|
my $s = shift; |
110
|
2
|
|
|
|
|
2
|
my %s = %{$s}; |
|
2
|
|
|
|
|
24
|
|
111
|
2
|
|
|
|
|
5
|
my %p; |
112
|
2
|
|
|
|
|
3
|
foreach my $q (@FIELDS){ |
113
|
34
|
100
|
|
|
|
54
|
$p{$q} = $s{$q} if defined($s{$q}); |
114
|
|
|
|
|
|
|
} |
115
|
2
|
|
|
|
|
9
|
return new Video::CPL::Layout(%p); |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 AUTHOR |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Carl Rosenberg, C<< >> |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 BUGS |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Please report any bugs or feature requests to Coincident TV. |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 SUPPORT |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
perldoc Video::CPL::Layout |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Copyright 2010 Coincident TV |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License"); |
137
|
|
|
|
|
|
|
you may not use this file except in compliance with the License. |
138
|
|
|
|
|
|
|
You may obtain a copy of the License at |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0 |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software |
143
|
|
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS, |
144
|
|
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
145
|
|
|
|
|
|
|
See the License for the specific language governing permissions and |
146
|
|
|
|
|
|
|
limitations under the License. |
147
|
|
|
|
|
|
|
=cut |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
1; # End of Video::CPL::Layout |