| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Video::CPL::MXMLField; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
564
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
26
|
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
14
|
|
|
5
|
1
|
|
|
1
|
|
3
|
use XML::Writer; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
13
|
|
|
6
|
1
|
|
|
1
|
|
3
|
use Carp; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
450
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Video::CPL::MXMLField - Video::CPL::MXMLField object. |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 VERSION |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Version 0.09 |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=cut |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = '0.09'; |
|
19
|
|
|
|
|
|
|
my @FIELDS = qw(click color data dataProfider editable fontSize fontWidth height horizontalCenter horizontalScrollPolicy id item label leading scaleContent source source text verticalCenter verticalScrollPolicy width x y); |
|
20
|
|
|
|
|
|
|
my @KINDS = qw(mx:CheckBox mx:ComboBox mx:RadioButton mx:Button mx:Image mx:Label mx:TextInput mx:Text); |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
This is mostly an internal package for CPL.pm. You can use it directly, but it is recommended to use the cue point creation routines in CPL.pm. |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
use Video::CPL::MXMLField; |
|
27
|
|
|
|
|
|
|
my $foo = Video::CPL::MXMLField->new(); |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 METHODS/METHODS |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 new($kind,%parms) |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Create a new Video::CPL::MXMLField object. |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub new { |
|
40
|
0
|
|
|
0
|
1
|
|
my $pkg = shift; |
|
41
|
0
|
|
|
|
|
|
my $kind = shift; |
|
42
|
0
|
|
|
|
|
|
my %parms = @_; |
|
43
|
0
|
|
|
|
|
|
my $ret = {}; |
|
44
|
0
|
|
|
|
|
|
bless $ret,$pkg; |
|
45
|
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
$ret->{kind} = $kind; |
|
47
|
0
|
|
|
|
|
|
foreach my $x (@FIELDS){ |
|
48
|
0
|
0
|
|
|
|
|
if (defined($parms{$x})){ |
|
49
|
0
|
|
|
|
|
|
$ret->{$x} = $parms{$x}; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
#check |
|
53
|
0
|
|
|
|
|
|
foreach my $x (keys %parms){ |
|
54
|
0
|
0
|
0
|
|
|
|
confess("Parameter ('$x') value ($parms{$x}) given to Video::CPL::MXMLField::new, but not understood\n") if defined($parms{$x}) && !defined($ret->{$x}); |
|
55
|
|
|
|
|
|
|
} |
|
56
|
0
|
|
|
|
|
|
return $ret; |
|
57
|
|
|
|
|
|
|
} |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 xmlo |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Given an XML::Writer object, add the xml information for this Layout. |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub xmlo { |
|
66
|
0
|
|
|
0
|
1
|
|
my $obj = shift; |
|
67
|
0
|
|
|
|
|
|
my $xo = shift; |
|
68
|
0
|
|
|
|
|
|
my $kind = $obj->{kind}; |
|
69
|
0
|
|
|
|
|
|
my %p; |
|
70
|
0
|
|
|
|
|
|
foreach my $x (@FIELDS){ |
|
71
|
0
|
0
|
|
|
|
|
$p{$x} = $obj->{$x} if defined $obj->{$x}; |
|
72
|
|
|
|
|
|
|
} |
|
73
|
0
|
|
|
|
|
|
$xo->emptyTag($kind,%p); |
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head2 xml() |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Return the xml format of a Video::CPL::MXMLField object. |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=cut |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub xml { |
|
83
|
0
|
|
|
0
|
1
|
|
my $obj = shift; |
|
84
|
0
|
|
|
|
|
|
my $a; |
|
85
|
0
|
|
|
|
|
|
my $xo = new XML::Writer(OUTPUT=>\$a); |
|
86
|
0
|
|
|
|
|
|
$obj->xmlo($xo); |
|
87
|
0
|
|
|
|
|
|
$xo->end(); |
|
88
|
0
|
|
|
|
|
|
return $a; |
|
89
|
|
|
|
|
|
|
} |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head2 fromxml(\%hash) |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Return a Video::CPL::MXMLField object given that part of the parse tree from XML::Simple::XMLin. |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=cut |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
sub fromxml { |
|
98
|
0
|
|
|
0
|
1
|
|
my $s = shift; |
|
99
|
0
|
|
|
|
|
|
my %s = %{$s}; |
|
|
0
|
|
|
|
|
|
|
|
100
|
0
|
|
|
|
|
|
my %parms; |
|
101
|
0
|
|
|
|
|
|
foreach my $q (@FIELDS){ |
|
102
|
0
|
0
|
|
|
|
|
$parms{$q} = $s{$q} if defined($s{$q}); |
|
103
|
|
|
|
|
|
|
} |
|
104
|
|
|
|
|
|
|
#how do we get our "kind"? |
|
105
|
0
|
|
|
|
|
|
return new Video::CPL::MXMLField(%parms); |
|
106
|
|
|
|
|
|
|
} |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 AUTHOR |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Carl Rosenberg, C<< >> |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 BUGS |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Please report any bugs or feature requests to Coincident TV. |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head1 SUPPORT |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
perldoc Video::CPL::MXMLField |
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Copyright 2010 Coincident TV |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License"); |
|
128
|
|
|
|
|
|
|
you may not use this file except in compliance with the License. |
|
129
|
|
|
|
|
|
|
You may obtain a copy of the License at |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0 |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software |
|
134
|
|
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS, |
|
135
|
|
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
136
|
|
|
|
|
|
|
See the License for the specific language governing permissions and |
|
137
|
|
|
|
|
|
|
limitations under the License. |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=cut |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
1; # End of Video::CPL::MXMLField |