xref: /aoo41x/main/slideshow/qa/tools/mkeffects.pl (revision cdf0e10c)
1:
2eval 'exec perl -wS $0 ${1+"$@"}'
3    if 0;
4
5
6use	IO::File;
7use	Cwd;
8use File::Spec;
9use File::Spec::Functions;
10use File::Temp;
11use File::Path;
12
13$TempDir = "";
14
15
16# all the XML package generation is a blatant rip from AF's
17# write-calc-doc.pl
18
19
20###############################################################################
21#	Open a file with the given name.
22#	First it is checked if the temporary directory, in which all files for
23#	the document are gathered, is already present and create it if it is not.
24#	Then create the path to the file inside the temporary directory.
25#	Finally open the file and return a file handle to it.
26#
27sub	open_file
28{
29	my	$filename = pop @_;
30
31	#	Create base directory of temporary directory tree if not alreay
32	#	present.
33	if ($TempDir eq "")
34	{
35		$TempDir = File::Temp::tempdir (CLEANUP => 1);
36	}
37
38	#	Create the path to the file.
39	my $fullname = File::Spec->catfile ($TempDir, $filename);
40	my ($volume,$directories,$file) = File::Spec->splitpath ($fullname);
41	mkpath (File::Spec->catpath ($volume,$directories,""));
42
43	#	Open the file and return a file handle to it.
44	return new IO::File ($fullname, "w");
45}
46
47
48###############################################################################
49#	Zip the files in the directory tree into the given file.
50#
51sub	zip_dirtree
52{
53	my	$filename = pop @_;
54
55	my	$cwd = getcwd;
56	my	$zip_name = $filename;
57
58	#	We are about to change the directory.
59	#	Therefore create an absolute pathname for the zip archive.
60
61	#	First transfer the drive from $cwd to $zip_name.  This is a
62	#	workaround for a bug in file_name_is_absolute which thinks
63	#	the the path \bla is an absolute path under DOS.
64	my ($volume,$directories,$file) = File::Spec->splitpath ($zip_name);
65	my ($volume_cwd,$directories_cwd,$file_cwd) = File::Spec->splitpath ($cwd);
66	$volume = $volume_cwd if ($volume eq "");
67	$zip_name = File::Spec->catpath ($volume,$directories,$file);
68
69	#	Add the current working directory to a relative path.
70	if ( ! file_name_is_absolute ($zip_name))
71	{
72		$zip_name = File::Spec->catfile ($cwd, $zip_name);
73
74		#	Try everything to clean up the name.
75		$zip_name = File::Spec->rel2abs ($filename);
76		$zip_name = File::Spec->canonpath ($zip_name);
77
78		#	Remove .. directories from the middle of the path.
79		while ($zip_name =~ /\/[^\/][^\.\/][^\/]*\/\.\.\//)
80		{
81			$zip_name = $` . "/" . $';
82		}
83	}
84
85	#	Just in case the zip program gets confused by an existing file with the
86	#	same name as the one to be written that file is removed first.
87	if ( -e $filename)
88	{
89		if (unlink ($filename) == 0)
90		{
91			print "Existing file $filename could not be deleted.\n";
92			print "Please close the application that uses it, then try again.\n";
93			return;
94		}
95	}
96
97	#	Finally create the zip file.  First change into the temporary directory
98	#	so that the resulting zip file contains only paths relative to it.
99	print "zipping [$ZipCmd $ZipFlags $zip_name *]\n";
100	chdir ($TempDir);
101	system ("$ZipCmd $ZipFlags $zip_name *");
102	chdir ($cwd);
103}
104
105
106sub writeHeader
107{
108	print $OUT qq~<?xml version="1.0" encoding="UTF-8"?>
109
110<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" office:version="1.0">
111 <office:scripts/>
112 <office:automatic-styles>
113  <style:style style:name="dp1" style:family="drawing-page">
114   <style:drawing-page-properties presentation:background-visible="true" presentation:background-objects-visible="true" presentation:display-footer="true" presentation:display-page-number="false" presentation:display-date-time="true"/>
115  </style:style>
116  <style:style style:name="gr1" style:family="graphic" style:parent-style-name="standard">
117   <style:graphic-properties draw:textarea-horizontal-align="center" draw:textarea-vertical-align="middle"/>
118  </style:style>
119  <style:style style:name="pr1" style:family="presentation" style:parent-style-name="Default-title">
120   <style:graphic-properties draw:fill-color="#ffffff" draw:auto-grow-height="true" fo:min-height="3.508cm"/>
121  </style:style>
122  <style:style style:name="pr2" style:family="presentation" style:parent-style-name="Default-notes">
123   <style:graphic-properties draw:fill-color="#ffffff" draw:auto-grow-height="true" fo:min-height="13.367cm"/>
124  </style:style>
125  <style:style style:name="P1" style:family="paragraph">
126   <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm"/>
127  </style:style>
128  <style:style style:name="P2" style:family="paragraph">
129   <style:paragraph-properties fo:margin-left="0.6cm" fo:margin-right="0cm" fo:text-indent="-0.6cm"/>
130  </style:style>
131  <text:list-style style:name="L1">
132   <text:list-level-style-bullet text:level="1" text:bullet-char="●">
133    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
134   </text:list-level-style-bullet>
135   <text:list-level-style-bullet text:level="2" text:bullet-char="●">
136    <style:list-level-properties text:space-before="0.6cm" text:min-label-width="0.6cm"/>
137    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
138   </text:list-level-style-bullet>
139   <text:list-level-style-bullet text:level="3" text:bullet-char="●">
140    <style:list-level-properties text:space-before="1.2cm" text:min-label-width="0.6cm"/>
141    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
142   </text:list-level-style-bullet>
143   <text:list-level-style-bullet text:level="4" text:bullet-char="●">
144    <style:list-level-properties text:space-before="1.8cm" text:min-label-width="0.6cm"/>
145    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
146   </text:list-level-style-bullet>
147   <text:list-level-style-bullet text:level="5" text:bullet-char="●">
148    <style:list-level-properties text:space-before="2.4cm" text:min-label-width="0.6cm"/>
149    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
150   </text:list-level-style-bullet>
151   <text:list-level-style-bullet text:level="6" text:bullet-char="●">
152    <style:list-level-properties text:space-before="3cm" text:min-label-width="0.6cm"/>
153    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
154   </text:list-level-style-bullet>
155   <text:list-level-style-bullet text:level="7" text:bullet-char="●">
156    <style:list-level-properties text:space-before="3.6cm" text:min-label-width="0.6cm"/>
157    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
158   </text:list-level-style-bullet>
159   <text:list-level-style-bullet text:level="8" text:bullet-char="●">
160    <style:list-level-properties text:space-before="4.2cm" text:min-label-width="0.6cm"/>
161    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
162   </text:list-level-style-bullet>
163   <text:list-level-style-bullet text:level="9" text:bullet-char="●">
164    <style:list-level-properties text:space-before="4.8cm" text:min-label-width="0.6cm"/>
165    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
166   </text:list-level-style-bullet>
167  </text:list-style>
168 </office:automatic-styles>
169 <office:body>
170  <office:presentation>
171~;
172
173}
174
175sub writeSlideHeader
176{
177	my $titleText = pop @_;
178	my $slideNum = pop @_;
179
180	print $OUT "      <draw:page draw:name=\"page1\" draw:style-name=\"dp1\" draw:master-page-name=\"Default\">\n";
181	print $OUT "       <office:forms form:automatic-focus=\"false\" form:apply-design-mode=\"false\"/>\n";
182	print $OUT "       <draw:rect draw:style-name=\"gr1\" draw:text-style-name=\"P1\" draw:id=\"id$slideNum\" draw:layer=\"layout\" svg:width=\"17.5cm\" svg:height=\"13cm\" svg:x=\"5cm\" svg:y=\"4cm\">\n";
183	print $OUT "        <text:p text:style-name=\"P2\">Slide: $slideNum</text:p>\n";
184	print $OUT "        <text:p text:style-name=\"P2\">Topic: $titleText</text:p>\n";
185	print $OUT "        <text:p text:id=\"textid$slideNum\" text:style-name=\"P2\">Some text to show text effects</text:p>\n";
186	print $OUT "       </draw:rect>\n";
187	print $OUT "      <anim:par presentation:node-type=\"timing-root\">\n";
188	print $OUT "        <anim:seq presentation:node-type=\"main-sequence\">\n";
189}
190
191
192sub writeSlideFooter
193{
194	print $OUT "       </anim:seq>\n";
195	print $OUT "      </anim:par>\n";
196	print $OUT "    <presentation:notes draw:style-name=\"dp1\">\n";
197	print $OUT "     <draw:page-thumbnail draw:style-name=\"gr1\" draw:layer=\"layout\" svg:width=\"14.851cm\" svg:height=\"11.138cm\" svg:x=\"3.068cm\" svg:y=\"2.257cm\" draw:page-number=\"1\" presentation:class=\"page\"/>\n";
198	print $OUT "     <draw:frame presentation:style-name=\"pr3\" draw:layer=\"layout\" svg:width=\"16.79cm\" svg:height=\"13.116cm\" svg:x=\"2.098cm\" svg:y=\"14.109cm\" presentation:class=\"notes\" presentation:placeholder=\"true\">\n";
199	print $OUT "      <draw:text-box/>\n";
200	print $OUT "     </draw:frame>\n";
201	print $OUT "    </presentation:notes>\n";
202	print $OUT "   </draw:page>\n";
203}
204
205sub writeFooter
206{
207	print $OUT qq~   <presentation:settings presentation:full-screen="false"/>
208  </office:presentation>
209 </office:body>
210</office:document-content>
211~;
212
213}
214
215sub writeTransitionAnimation
216{
217	my $transitionSubtype = pop @_;
218	my $transitionType = pop @_;
219	my $slideNum = pop @_;
220
221	print $OUT "          <anim:par smil:begin=\"0s\" smil:fill=\"remove\">\n";
222	print $OUT "            <anim:set smil:begin=\"0s\" smil:dur=\"0.001s\" smil:fill=\"hold\" smil:targetElement=\"textid$slideNum\" smil:attributeName=\"visibility\" smil:to=\"visible\"/>\n";
223    print $OUT "            <anim:transitionFilter smil:dur=\"1s\" smil:targetElement=\"textid$slideNum\" smil:type=\"$transitionType\" smil:subtype=\"$transitionSubtype\"/>\n";
224	print $OUT "            <anim:set smil:begin=\"0.3s\" smil:dur=\"0.001s\" smil:fill=\"hold\" smil:targetElement=\"id$slideNum\" smil:attributeName=\"visibility\" smil:to=\"visible\"/>\n";
225    print $OUT "            <anim:transitionFilter smil:begin=\"0.3s\" smil:dur=\"1s\" smil:targetElement=\"id$slideNum\" smil:type=\"$transitionType\" smil:subtype=\"$transitionSubtype\"/>\n";
226    print $OUT "          </anim:par>\n";
227}
228
229sub writePropertyAnimation
230{
231	my $propertyEnd = pop @_;
232	my $propertyStart = pop @_;
233	my $propertyName = pop @_;
234	my $slideNum = pop @_;
235
236	print $OUT "          <anim:par smil:begin=\"0s\" smil:dur=\"3s\" smil:fill=\"remove\">\n";
237	print $OUT "            <anim:set smil:begin=\"0s\" smil:dur=\"0.001s\" smil:fill=\"hold\" smil:targetElement=\"id$slideNum\" smil:attributeName=\"visibility\" smil:to=\"visible\"/>\n";
238    print $OUT "            <anim:animate smil:begin=\"0s\" smil:dur=\"1s\" smil:fill=\"hold\" smil:targetElement=\"id$slideNum\" smil:attributeName=\"$propertyName\" smil:values=\"$propertyStart;$propertyEnd\" smil:keyTimes=\"0;1\" presentation:additive=\"base\"/>\n";
239	print $OUT "            <anim:set smil:begin=\"0.6s\" smil:dur=\"0.001s\" smil:fill=\"hold\" smil:targetElement=\"textid$slideNum\" smil:attributeName=\"visibility\" smil:to=\"visible\"/>\n";
240    print $OUT "            <anim:animate smil:begin=\"0.6s\" smil:dur=\"1s\" smil:fill=\"hold\" smil:targetElement=\"textid$slideNum\" smil:attributeName=\"$propertyName\" smil:values=\"$propertyStart;$propertyEnd\" smil:keyTimes=\"0;1\" presentation:additive=\"base\"/>\n";
241    print $OUT "          </anim:par>\n";
242}
243
244sub writeTransformAnimation
245{
246	my $propertyBy = pop @_;
247	my $propertyName = pop @_;
248	my $slideNum = pop @_;
249
250	print $OUT "          <anim:par smil:begin=\"0s\" smil:dur=\"3s\" smil:fill=\"remove\">\n";
251	print $OUT "            <anim:set smil:begin=\"0s\" smil:dur=\"0.001s\" smil:fill=\"hold\" smil:targetElement=\"id$slideNum\" smil:attributeName=\"visibility\" smil:to=\"visible\"/>\n";
252    print $OUT "            <anim:animateTransform smil:begin=\"0s\" smil:dur=\"1s\" smil:targetElement=\"id$slideNum\" smil:fill=\"hold\" smil:by=\"$propertyBy\" presentation:additive=\"base\" svg:type=\"$propertyName\"/>\n";
253	print $OUT "            <anim:set smil:begin=\"0.6s\" smil:dur=\"0.001s\" smil:fill=\"hold\" smil:targetElement=\"textid$slideNum\" smil:attributeName=\"visibility\" smil:to=\"visible\"/>\n";
254    print $OUT "            <anim:animateTransform smil:begin=\"0.6s\" smil:dur=\"1s\" smil:targetElement=\"textid$slideNum\" smil:fill=\"hold\" smil:by=\"$propertyBy\" presentation:additive=\"base\" svg:type=\"$propertyName\"/>\n";
255    print $OUT "          </anim:par>\n";
256}
257
258sub writePathMotionAnimation
259{
260	my $slideNum = pop @_;
261
262	print $OUT "          <anim:par smil:begin=\"0s\" smil:dur=\"10s\" smil:fill=\"remove\">\n";
263	print $OUT "            <anim:set smil:begin=\"0s\" smil:dur=\"0.001s\" smil:fill=\"hold\" smil:targetElement=\"id$slideNum\" smil:attributeName=\"visibility\" smil:to=\"visible\"/>\n";
264    print $OUT "            <anim:animateMotion smil:dur=\"5s\" smil:fill=\"hold\" smil:targetElement=\"id$slideNum\" presentation:additive=\"base\" svg:path=\"m0.0 0.07658c0.0098-0.00493 0.00197-0.00985 0.00295-0.01478 0.00191 0.00 0.00383 0.00 0.00574 0.00-0.00005 0.00033-0.00011 0.00065-0.00016 0.00098-0.00034 0.00276-0.00060 0.00446-0.00077 0.00512-0.00021 0.00086-0.00031 0.00143-0.00031 0.00170 0.00 0.00200 0.00150 0.00369 0.00452 0.00507 0.00301 0.00138 0.00671 0.00206 0.01108 0.00206 0.00438 0.00 0.00816-0.00164 0.01134-0.00493 0.00319-0.00329 0.00478-0.00719 0.00478-0.01170 0.00-0.00514-0.00311-0.01022-0.00935-0.01525-0.00162-0.00129-0.00324-0.00258-0.00486-0.00387-0.00806-0.00651-0.01209-0.01290-0.01209-0.01917s0.0251-0.01148 0.00752-0.01561 0.01131-0.00620 0.01889-0.00620c0.0585 0.00 0.01276 0.00126 0.02072 0.00377-0.00102 0.00512-0.00203 0.01023-0.00305 0.01535-0.00191 0.00-0.00383 0.00-0.00574 0.00 0.00009-0.00052 0.00017-0.00103 0.00026-0.00155 0.00019-0.00195 0.00038-0.00389 0.00057-0.00584 0.00009-0.00062 0.00017-0.00124 0.00026-0.00186-0.00014-0.00183-0.00155-0.00337-0.00424-0.00462-0.00269-0.00126-0.00589-0.00189-0.00961-0.00189-0.00424 0.00-0.00782 0.00144-0.01075 0.00431-0.00293 0.00288-0.00439 0.00640-0.00439 0.01057 0.00 0.00510 0.00334 0.01035 0.01002 0.01576 0.00172 0.00138 0.00345 0.00275 0.00517 0.00413 0.00782 0.00631 0.01173 0.01277 0.01173 0.01938 0.00 0.00675-0.00272 0.01224-0.00816 0.01646-0.00545 0.00422-0.01256 0.00633-0.02134 0.00633-0.00538 0.00-0.01165-0.00105-0.01881-0.00315-0.00064-0.00019-0.00128-0.00038-0.00192-0.00057z\"/>\n";
265	print $OUT "            <anim:set smil:begin=\"3.6s\" smil:dur=\"0.001s\" smil:fill=\"hold\" smil:targetElement=\"textid$slideNum\" smil:attributeName=\"visibility\" smil:to=\"visible\"/>\n";
266    print $OUT "            <anim:animateMotion smil:begin=\"3.6s\" smil:dur=\"5s\" smil:fill=\"hold\" smil:targetElement=\"textid$slideNum\" presentation:additive=\"base\" svg:path=\"m0.0 0.07658c0.0098-0.00493 0.00197-0.00985 0.00295-0.01478 0.00191 0.00 0.00383 0.00 0.00574 0.00-0.00005 0.00033-0.00011 0.00065-0.00016 0.00098-0.00034 0.00276-0.00060 0.00446-0.00077 0.00512-0.00021 0.00086-0.00031 0.00143-0.00031 0.00170 0.00 0.00200 0.00150 0.00369 0.00452 0.00507 0.00301 0.00138 0.00671 0.00206 0.01108 0.00206 0.00438 0.00 0.00816-0.00164 0.01134-0.00493 0.00319-0.00329 0.00478-0.00719 0.00478-0.01170 0.00-0.00514-0.00311-0.01022-0.00935-0.01525-0.00162-0.00129-0.00324-0.00258-0.00486-0.00387-0.00806-0.00651-0.01209-0.01290-0.01209-0.01917s0.0251-0.01148 0.00752-0.01561 0.01131-0.00620 0.01889-0.00620c0.0585 0.00 0.01276 0.00126 0.02072 0.00377-0.00102 0.00512-0.00203 0.01023-0.00305 0.01535-0.00191 0.00-0.00383 0.00-0.00574 0.00 0.00009-0.00052 0.00017-0.00103 0.00026-0.00155 0.00019-0.00195 0.00038-0.00389 0.00057-0.00584 0.00009-0.00062 0.00017-0.00124 0.00026-0.00186-0.00014-0.00183-0.00155-0.00337-0.00424-0.00462-0.00269-0.00126-0.00589-0.00189-0.00961-0.00189-0.00424 0.00-0.00782 0.00144-0.01075 0.00431-0.00293 0.00288-0.00439 0.00640-0.00439 0.01057 0.00 0.00510 0.00334 0.01035 0.01002 0.01576 0.00172 0.00138 0.00345 0.00275 0.00517 0.00413 0.00782 0.00631 0.01173 0.01277 0.01173 0.01938 0.00 0.00675-0.00272 0.01224-0.00816 0.01646-0.00545 0.00422-0.01256 0.00633-0.02134 0.00633-0.00538 0.00-0.01165-0.00105-0.01881-0.00315-0.00064-0.00019-0.00128-0.00038-0.00192-0.00057z\"/>\n";
267    print $OUT "          </anim:par>\n";
268}
269
270sub writeManifest
271{
272	my $outFile = open_file("META-INF/manifest.xml");
273
274	print $outFile qq~<?xml version="1.0" encoding="UTF-8"?>
275<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">
276<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0">
277 <manifest:file-entry manifest:media-type="application/vnd.oasis.opendocument.presentation" manifest:full-path="/"/>
278 <manifest:file-entry manifest:media-type="text/xml" manifest:full-path="content.xml"/>
279</manifest:manifest>
280~;
281
282	$outFile->close;
283}
284
285
286###############################################################################
287#	Print usage information.
288#
289sub	usage	()
290{
291	print <<END_OF_USAGE;
292usage: $0 <option>* [<output-file-name>]
293
294output-file-name defaults to alltransitions.odp.
295
296options: -a    Generate _all_ combinations of type, subtype,
297               direction, and mode
298         -h    Print this usage information.
299END_OF_USAGE
300}
301
302###############################################################################
303#	Process the command line.
304#
305sub	process_command_line
306{
307	foreach (@ARGV)
308	{
309		if (/^-h/)
310		{
311			usage;
312			exit 0;
313		}
314	}
315
316	$global_gen_all=0;
317	$global_output_name = "alltransitions.odp";
318
319	my	$j = 0;
320	for (my $i=0; $i<=$#ARGV; $i++)
321	{
322		if ($ARGV[$i] eq "-a")
323		{
324			$global_gen_all=1;
325		}
326		elsif ($ARGV[$i] =~ /^-/)
327		{
328		    print "Unknown option $ARGV[$i]\n";
329			usage;
330			exit 1;
331		}
332		elsif ($#ARGV == $i )
333		{
334			$global_output_name = $ARGV[$i];
335		}
336	}
337
338	print "output to $global_output_name\n";
339}
340
341$transitionsRef = [
342
343				["barWipe",
344				 ["leftToRight",
345				  "topToBottom"]],
346
347				["blindsWipe",
348				 ["vertical",
349				  "horizontal"]],
350
351				["boxWipe",
352				 ["topLeft",
353				  "topRight",
354				  "bottomRight",
355				  "bottomLeft",
356				  "topCenter",
357				  "rightCenter",
358				  "bottomCenter",
359				  "leftCenter"]],
360
361				["fourBoxWipe",
362				 ["cornersIn",
363				  "cornersOut"]],
364
365				["barnDoorWipe",
366				 ["vertical",
367				  "horizontal",
368				  "diagonalBottomLeft",
369				  "diagonalTopLeft"]],
370
371				["bowTieWipe",
372				 ["vertical",
373				  "horizontal"]],
374
375				["miscDiagonalWipe",
376				 ["doubleBarnDoor",
377				  "doubleDiamond"]],
378
379				["veeWipe",
380				 ["down",
381				  "left",
382				  "up",
383				  "right"]],
384
385				["barnVeeWipe",
386				 ["top",
387				  "left",
388				  "up",
389				  "right"]],
390
391				["zigZagWipe",
392				 ["leftToRight",
393				  "topToBottom"]],
394
395				["barnZigZagWipe",
396				 ["vertical",
397				  "horizontal"]],
398
399				["irisWipe",
400				 ["rectangle",
401				  "diamond"]],
402
403				["triangleWipe",
404				 ["up",
405				  "right",
406				  "down",
407				  "left"]],
408
409				["arrowHeadWipe",
410				 ["up",
411				  "right",
412				  "down",
413				  "left"]],
414
415				["pentagonWipe",
416				 ["up",
417				  "down"]],
418
419				["hexagonWipe",
420				 ["horizontal",
421				  "vertical"]],
422
423				["ellipseWipe",
424				 ["circle",
425				  "horizontal",
426				  "vertical"]],
427
428				["eyeWipe",
429				 ["vertical",
430				  "horizontal"]],
431
432				["roundRectWipe",
433				 ["horizontal",
434				  "vertical"]],
435
436				["starWipe",
437				 ["fourPoint",
438				  "fivePoint",
439				  "sixPoint"]],
440
441				["miscShapeWipe",
442				 ["heart",
443				  "keyhole"]],
444
445				["clockWipe",
446				 ["clockwiseTwelve",
447				  "clockwiseThree",
448				  "clockwiseSix",
449				  "clockwiseNine"]],
450
451				["pinWheelWipe",
452				 ["oneBlade",
453				  "twoBladeVertical",
454				  "twoBladeHorizontal",
455				  "threeBlade",
456				  "fourBlade",
457				  "eightBlade"]],
458
459				["singleSweepWipe",
460				 ["clockwiseTop",
461				  "clockwiseRight",
462				  "clockwiseBottom",
463				  "clockwiseLeft",
464				  "clockwiseTopLeft",
465				  "counterClockwiseBottomLeft",
466				  "clockwiseBottomRight",
467				  "counterClockwiseTopRight"]],
468
469				["fanWipe",
470				 ["centerTop",
471				  "centerRight",
472				  "top",
473				  "right",
474				  "bottom",
475				  "left"]],
476
477				["doubleFanWipe",
478				 ["fanOutVertical",
479				  "fanOutHorizontal",
480				  "fanInVertical",
481				  "fanInHorizontal"]],
482
483				["doubleSweepWipe",
484				 ["parallelVertical",
485				  "parallelDiagonal",
486				  "oppositeVertical",
487				  "oppositeHorizontal",
488				  "parallelDiagonalTopLeft",
489				  "parallelDiagonalBottomLeft"]],
490
491				["saloonDoorWipe",
492				 ["top",
493				  "left",
494				  "bottom",
495				  "right"]],
496
497				["windshieldWipe",
498				 ["right",
499				  "up",
500				  "vertical",
501				  "horizontal"]],
502
503				["snakeWipe",
504				 ["topLeftHorizontal",
505				  "topLeftVertical",
506				  "topLeftDiagonal",
507				  "topRightDiagonal",
508				  "bottomRightDiagonal",
509				  "bottomLeftDiagonal"]],
510
511				["spiralWipe",
512				 ["topLeftClockwise",
513				  "topRightClockwise",
514				  "bottomRightClockwise",
515				  "bottomLeftClockwise",
516				  "topLeftCounterClockwise",
517				  "topRightCounterClockwise",
518				  "bottomRightCounterClockwise",
519				  "bottomLeftCounterClockwise"]],
520
521				["parallelSnakesWipe",
522				 ["verticalTopSame",
523				  "verticalBottomSame",
524				  "verticalTopLeftOpposite",
525				  "verticalBottomLeftOpposite",
526				  "horizontalLeftSame",
527				  "horizontalRightSame",
528				  "horizontalTopLeftOpposite",
529				  "horizontalTopRightOpposite",
530				  "diagonalBottomLeftOpposite",
531				  "diagonalTopLeftOpposite"]],
532
533				["boxSnakesWipe",
534				 ["twoBoxTop",
535				  "twoBoxLeft",
536				  "twoBoxRight",
537				  "fourBoxVertical",
538				  "fourBoxHorizontal"]],
539
540				["waterfallWipe",
541				 ["verticalLeft",
542				  "verticalRight",
543				  "horizontalLeft",
544				  "horizontalRight"]],
545
546			   ["pushWipe",
547				 ["fromLeft",
548				  "fromTop",
549				  "fromRight",
550				  "fromBottom",
551				  "fromBottomRight",
552				  "fromBottomLeft",
553				  "fromTopRight",
554				  "fromTopLeft",
555				  "combHorizontal",
556				  "combVertical"]],
557
558				["slideWipe",
559				 ["fromLeft",
560				  "fromTop",
561				  "fromRight",
562				  "fromBottom"]],
563
564				["fade",
565				 ["crossfade",
566				  "fadeToColor",
567				  "fadeFromColor",
568				  "fadeOverColor"]],
569
570				["randomBarWipe",
571				 ["vertical",
572				  "horizontal"]],
573
574				["checkerBoardWipe",
575				 ["down",
576				  "across"]],
577
578				["dissolve",
579				 ["default"]]
580];
581
582$propertiesRef = [
583                    [ "value", "color", "#000000", "#FF0000" ],
584
585                    [ "string", "font-family",  "Helvetica",  "Times New Roman" ],
586
587                    [ "value", "font-size", "1pt", "1.5pt" ],
588
589                    [ "string", "font-style", "normal", "italic" ],
590
591                    [ "string", "text-underline", "none", "solid" ],
592
593                    [ "string", "font-weight", "normal", "bold" ],
594
595                    [ "value", "fill-color", "#000000", "#00FF00" ],
596
597                    [ "string", "fill", "none", "solid" ],
598
599                    [ "value", "height", "0.5*height", "height" ],
600
601                    [ "value", "stroke-color", "#000000", "#0000FF" ],
602
603                    [ "string", "stroke", "none", "solid" ],
604
605                    [ "value", "opacity", "0.0", "0.9" ],
606
607                    [ "value", "rotate", "0", "90" ],
608
609                    [ "value", "skewX", "0", "-1" ],
610
611                    [ "value", "skewY", "0", "-1" ],
612
613                    [ "string", "visibility", "hidden", "visible" ],
614
615                    [ "value", "width", "0.5*width", "width" ],
616
617                    [ "value", "x", "x-0.1", "x+0.1" ],
618
619                    [ "value", "y", "y-0.1", "y+0.1" ]
620    ];
621
622$transformsRef = [
623    ["translate", "0.5*width,0.5*height"],
624    ["scale", "0.5*width,0.5*height"],
625    ["rotate", "270"],
626    ["skewX", "-1"],
627    ["skewY", "1"]
628];
629
630
631###############################################################################
632#	Main
633###############################################################################
634
635$ZipCmd = $ENV{LOG_FILE_ZIP_CMD};
636$ZipFlags = $ENV{LOG_FILE_ZIP_FLAGS};
637#	Provide default values for the zip command and it's flags.
638if ( ! defined $ZipCmd)
639{
640	$ZipCmd = "zip" unless defined $ZipCmd;
641	$ZipFlags = "-r -q" unless defined $ZipFlags;
642}
643
644process_command_line();
645
646writeManifest();
647
648$OUT = open_file( "content.xml" );
649
650writeHeader();
651
652$transitionNum=0;
653writeSlideHeader($transitionNum, "Transition effects");
654
655foreach $transitionRef (@$transitionsRef)
656{
657	$transitionType = @$transitionRef[0];
658
659	foreach $subtype (@{$transitionRef->[1]})
660	{
661        writeTransitionAnimation($transitionNum,
662                                 $transitionType,
663                                 $subtype);
664    }
665}
666
667writeSlideFooter();
668
669writeSlideHeader(++$transitionNum, "Property effects");
670
671foreach $propertyRef (@$propertiesRef)
672{
673	$propertyType = @$propertyRef[0];
674
675    if( $propertyType eq "value" )
676    {
677        writePropertyAnimation( $transitionNum, @$propertyRef[1], @$propertyRef[2], @$propertyRef[3] );
678    }
679    elsif( $propertyType eq "string" )
680    {
681    }
682    else
683    {
684        die "Unexpected case";
685    }
686}
687
688writeSlideFooter();
689
690writeSlideHeader(++$transitionNum, "Transformation effects");
691
692foreach $transformRef (@$transformsRef)
693{
694    writeTransformAnimation( $transitionNum, @$transformRef[0], @$transformRef[1] );
695}
696
697writeSlideFooter();
698
699writeSlideHeader(++$transitionNum, "Path motion effects");
700writePathMotionAnimation($transitionNum);
701writeSlideFooter();
702
703	print $OUT qq~
704    <draw:page draw:name="page1" draw:style-name="dp1" draw:master-page-name="Default">
705       <office:forms form:automatic-focus="false" form:apply-design-mode="false"/>
706       <draw:rect draw:style-name="gr1" draw:text-style-name="P1" draw:id="id10000" draw:layer="layout" svg:width="17.5cm" svg:height="13cm" svg:x="5cm" svg:y="4cm">
707        <text:p text:style-name="P2">Slide: 4</text:p>
708        <text:p text:style-name="P2">Topic: Misc effects</text:p>
709        <text:p text:id="textid10001" text:style-name="P2">Some text to show accelerate effects</text:p>
710        <text:p text:id="textid10002" text:style-name="P2">Some text to show decelerate effects</text:p>
711        <text:p text:id="textid10003" text:style-name="P2">Some text to show additive effects</text:p>
712        <text:p text:id="textid10004" text:style-name="P2">Some text to show autoreverse effects</text:p>
713        <text:p text:id="textid10005" text:style-name="P2">Some text to show key value effects</text:p>
714        <text:p text:id="textid10006" text:style-name="P2">Some text to show discrete key value effects</text:p>
715        <text:p text:id="textid10007" text:style-name="P2">Some text to show formula effects</text:p>
716       </draw:rect>
717      <anim:par presentation:node-type="timing-root">
718        <anim:seq presentation:node-type="main-sequence">
719
720          <anim:par smil:begin="0s" smil:fill="remove">
721            <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:targetElement="textid10001" smil:attributeName="visibility" smil:to="visible"/>
722            <anim:animate smil:begin="0s" smil:dur="10s" smil:fill="hold" smil:targetElement="textid10001" smil:accelerate="0.5" smil:attributeName="x" smil:by="0.3" presentation:additive="base"/>
723          </anim:par>
724
725          <anim:par smil:begin="0s" smil:fill="remove">
726            <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:targetElement="textid10002" smil:attributeName="visibility" smil:to="visible"/>
727            <anim:animate smil:begin="0s" smil:dur="10s" smil:fill="hold" smil:targetElement="textid10002" smil:decelerate="0.5" smil:attributeName="x" smil:by="0.3" presentation:additive="base"/>
728          </anim:par>
729
730          <anim:par smil:begin="0s" smil:fill="remove">
731            <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:targetElement="textid10003" smil:attributeName="visibility" smil:to="visible"/>
732            <anim:animate smil:begin="0s" smil:dur="3s" smil:fill="hold" smil:targetElement="textid10003" smil:attributeName="x" smil:to="0.3" presentation:additive="sum"/>
733            <anim:animate smil:begin="0s" smil:dur="6s" smil:fill="hold" smil:targetElement="textid10003" smil:attributeName="x" smil:to="0.3" presentation:additive="sum"/>
734          </anim:par>
735
736          <anim:par smil:begin="0s" smil:fill="remove">
737            <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:targetElement="textid10004" smil:attributeName="visibility" smil:to="visible"/>
738            <anim:animate smil:begin="0s" smil:dur="5s" smil:fill="hold" smil:targetElement="textid10004" smil:attributeName="y" smil:from="0.3" smil:to="0.8" smil:autoReverse="true" presentation:additive="base"/>
739          </anim:par>
740
741          <anim:par smil:begin="0s" smil:fill="remove">
742            <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:targetElement="textid10005" smil:attributeName="visibility" smil:to="visible"/>
743            <anim:animateTransform smil:begin="0s" smil:dur="10s" smil:fill="hold" smil:targetElement="textid10005" smil:values="0.5,0.5;0.8,0.5;0.8,0.8;0.5,0.5" smil:keyTimes="0;0.3;0.6;1" presentation:additive="base" svg:type="translate"/>
744          </anim:par>
745
746          <anim:par smil:begin="0s" smil:fill="remove">
747            <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:targetElement="textid10006" smil:attributeName="visibility" smil:to="visible"/>
748            <anim:animateTransform smil:begin="0s" smil:dur="10s" smil:fill="hold" smil:targetElement="textid10006" smil:values="0.5,0.5;0.8,0.5;0.8,0.8;0.5,0.5" smil:keyTimes="0;0.3;0.6;1" smil:calcMode="discrete" presentation:additive="base" svg:type="translate"/>
749          </anim:par>
750
751          <anim:par smil:begin="0s" smil:fill="remove">
752            <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:targetElement="textid10007" smil:attributeName="visibility" smil:to="visible"/>
753            <anim:animate smil:begin="0s" smil:dur="3s" smil:fill="hold" smil:targetElement="textid10007" smil:attributeName="y" smil:values="0;1" smil:keyTimes="0;1" anim:formula="y+0.3*height*sin(5*pi*\$)" presentation:additive="base"/>
754          </anim:par>
755~;
756
757writeSlideFooter();
758
759# iterate, single paragraphs, word, lines, sentences, characters
760
761	print $OUT qq~
762    <draw:page draw:name="page1" draw:style-name="dp1" draw:master-page-name="Default">
763       <office:forms form:automatic-focus="false" form:apply-design-mode="false"/>
764       <draw:rect draw:style-name="gr1" draw:text-style-name="P1" draw:id="id20000" draw:layer="layout" svg:width="17.5cm" svg:height="13cm" svg:x="5cm" svg:y="4cm">
765        <text:p text:style-name="P2">Slide: 5</text:p>
766        <text:p text:style-name="P2">Topic: Text effects</text:p>
767        <text:p text:id="textid20001" text:style-name="P2">Some text to show iterated single paragraph</text:p>
768        <text:p text:id="textid20002" text:style-name="P2">Some text to show iterated word-by-word effects</text:p>
769        <text:p text:id="textid20003" text:style-name="P2">Some text to show iterated letter-by-letter effects</text:p>
770        <text:p text:id="textid20004" text:style-name="P2">Some more text</text:p>
771        <text:p text:id="textid20005" text:style-name="P2">Some more text</text:p>
772        <text:p text:id="textid20006" text:style-name="P2">Some more text</text:p>
773        <text:p text:id="textid20007" text:style-name="P2">Some more text</text:p>
774        <text:p text:id="textid20008" text:style-name="P2">Some more text</text:p>
775       </draw:rect>
776      <anim:par presentation:node-type="timing-root">
777        <anim:seq presentation:node-type="main-sequence">
778
779          <anim:par smil:begin="0s" smil:fill="remove">
780            <anim:iterate smil:begin="0s" smil:fill="hold" smil:targetElement="id20000" anim:iterate-type="by-paragraph" anim:iterate-interval="0.2s">
781               <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible"/>
782               <anim:animate smil:begin="0s" smil:dur="2s" smil:fill="hold" smil:decelerate="0.5" smil:attributeName="x" smil:from="1.0" smil:to="x" presentation:additive="base"/>
783            </anim:iterate>
784          </anim:par>
785
786          <anim:par smil:begin="0s" smil:fill="remove">
787            <anim:set smil:begin="0s" smil:dur="0.001s" smil:targetElement="id20000" smil:fill="hold" smil:attributeName="visibility" smil:to="visible"/>
788            <anim:iterate smil:begin="0s" smil:fill="hold" smil:targetElement="textid20002" anim:iterate-type="by-word" anim:iterate-interval="0.2s">
789               <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible"/>
790               <anim:animate smil:begin="0s" smil:dur="2s" smil:fill="hold" smil:decelerate="0.5" smil:attributeName="x" smil:from="1.0" smil:to="x" presentation:additive="base"/>
791            </anim:iterate>
792          </anim:par>
793
794          <anim:par smil:begin="0s" smil:fill="remove">
795            <anim:set smil:begin="0s" smil:dur="0.001s" smil:targetElement="id20000" smil:fill="hold" smil:attributeName="visibility" smil:to="visible"/>
796            <anim:iterate smil:begin="0s" smil:fill="hold" smil:targetElement="textid20003" anim:iterate-type="by-letter" anim:iterate-interval="0.2s">
797               <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible"/>
798               <anim:animate smil:begin="0s" smil:dur="2s" smil:fill="hold" smil:decelerate="0.5" smil:attributeName="x" smil:from="1.0" smil:to="x" presentation:additive="base"/>
799            </anim:iterate>
800          </anim:par>
801~;
802
803writeSlideFooter();
804
805writeFooter();
806
807$OUT->close;
808
809zip_dirtree ($global_output_name);
810
811