line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Video::CPL::MXML; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
942
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
390
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Video::CPL::MXML - The great new Video::CPL::MXML! |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Version 0.09 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '0.09'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Quick summary of what the module does. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Perhaps a little code snippet. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
use Video::CPL::MXML; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $foo = Video::CPL::MXML->new(); |
28
|
|
|
|
|
|
|
... |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
my @FIELDS = qw(pauseOnOverlay xmlns:mx width height); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 new(%parms) |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub new { |
41
|
|
|
|
|
|
|
#given hash with parameters. |
42
|
|
|
|
|
|
|
#fieldList is either an array of MXMLField objects or a single one. |
43
|
0
|
|
|
0
|
1
|
|
my $pkg = shift; |
44
|
0
|
|
|
|
|
|
my %parms = @_; |
45
|
0
|
|
|
|
|
|
my $ret = {}; |
46
|
0
|
|
|
|
|
|
bless $ret,$pkg; |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
foreach my $x (@FIELDS){ |
49
|
0
|
0
|
|
|
|
|
$ret->{$x} = $parms{$x} if defined $parms{$x}; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
#if (defined $x->{fieldList}){ |
52
|
|
|
|
|
|
|
# if (isa($x->{fieldList},'ARRAY')){ |
53
|
|
|
|
|
|
|
# } else { |
54
|
|
|
|
|
|
|
# } |
55
|
|
|
|
|
|
|
# } |
56
|
0
|
|
|
|
|
|
foreach my $x (keys %parms){ |
57
|
0
|
0
|
|
|
|
|
confess("Parameter ('$x') given to Video::CPL::MXML::new, but not understood\n") if !defined $ret->{$x}; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
return $ret; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub fromxml { |
64
|
0
|
|
|
0
|
0
|
|
my $parent = shift; |
65
|
0
|
|
|
|
|
|
my $name = shift; |
66
|
0
|
|
|
|
|
|
my $s = shift; |
67
|
0
|
|
|
|
|
|
my %s = %{$s}; |
|
0
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
my %p; |
69
|
0
|
|
|
|
|
|
foreach my $k (@FIELDS){ |
70
|
0
|
0
|
|
|
|
|
$p{$k} = $s{$k} if defined($s{$k}); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
#don't fully understand how this will show up in XML |
73
|
|
|
|
|
|
|
#foreach (mxfields){ |
74
|
|
|
|
|
|
|
# $f = Video::CPL::MXMLField::fromxml(); |
75
|
|
|
|
|
|
|
# push @f; |
76
|
|
|
|
|
|
|
#} |
77
|
|
|
|
|
|
|
#$p{fieldList} = \@f; |
78
|
0
|
|
|
|
|
|
return new Video::CPL::MXML(%p); |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
# |
82
|
|
|
|
|
|
|
# |
83
|
|
|
|
|
|
|
# |
84
|
|
|
|
|
|
|
sub xmlo { |
85
|
0
|
|
|
0
|
0
|
|
my $obj = shift; |
86
|
0
|
|
|
|
|
|
my $xo = shift; |
87
|
0
|
|
|
|
|
|
my %p; |
88
|
0
|
0
|
|
|
|
|
$p{pauseOnOverlay} = $obj->{pauseOnOverlay} if defined $obj->{pauseOnOverlay}; |
89
|
0
|
|
|
|
|
|
$xo->startTag("mxmlInCPL",%p); |
90
|
0
|
|
|
|
|
|
%p = undef; |
91
|
0
|
0
|
|
|
|
|
$p{"xmlns:mx"} = $obj->{"xmlns:mx"} if defined $obj->{"xmlns:mx"}; |
92
|
0
|
|
|
|
|
|
$xo->startTag("mx:MXML",%p); |
93
|
0
|
|
|
|
|
|
%p = undef; |
94
|
0
|
0
|
|
|
|
|
$p{width} = $obj->{width} if defined $obj->{width}; |
95
|
0
|
0
|
|
|
|
|
$p{height} = $obj->{height} if defined $obj->{height}; |
96
|
0
|
0
|
|
|
|
|
if ($obj->{fieldList}){ |
97
|
0
|
|
|
|
|
|
foreach my $c (@{$obj->{fieldList}}){ |
|
0
|
|
|
|
|
|
|
98
|
0
|
|
|
|
|
|
$c->xmlo($xo); |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
} |
101
|
0
|
|
|
|
|
|
$xo->startTag("mx:Canvas",%p); |
102
|
0
|
|
|
|
|
|
$xo->endTag("mx:Canvas"); |
103
|
0
|
|
|
|
|
|
$xo->endTag("mx:MXML"); |
104
|
0
|
|
|
|
|
|
$xo->endTag("mxmlInCPL"); |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub xml { |
108
|
0
|
|
|
0
|
0
|
|
my $obj = shift; |
109
|
0
|
|
|
|
|
|
my $a = ""; |
110
|
0
|
|
|
|
|
|
my $xo = new XML::Writer(OUTPUT=>\$a); |
111
|
0
|
|
|
|
|
|
$obj->xmlo($xo); |
112
|
0
|
|
|
|
|
|
$xo->end; |
113
|
0
|
|
|
|
|
|
return $a; |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
#can only have |
117
|
|
|
|
|
|
|
# Canvas,Image,Text,TextInput,Radiobutton fields. |
118
|
|
|
|
|
|
|
# in linear non-nested order. Suggest they simply be routines within here. |
119
|
|
|
|
|
|
|
=head1 AUTHOR |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
Carl Rosenberg, C<< >> |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head1 BUGS |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
126
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
127
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head1 SUPPORT |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
perldoc Video::CPL::MXML |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
You can also look for information at: |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=over 4 |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
L |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
L |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=item * CPAN Ratings |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
L |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=item * Search CPAN |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
L |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=back |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
Copyright 2010 Coincident TV |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License"); |
167
|
|
|
|
|
|
|
you may not use this file except in compliance with the License. |
168
|
|
|
|
|
|
|
You may obtain a copy of the License at |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0 |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software |
173
|
|
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS, |
174
|
|
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
175
|
|
|
|
|
|
|
See the License for the specific language governing permissions and |
176
|
|
|
|
|
|
|
limitations under the License. |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=cut |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
1; |