xref: /aoo41x/main/basegfx/qa/mkpolygons.pl (revision cdf0e10c)
1*cdf0e10cSrcweir:
2*cdf0e10cSrcweireval 'exec perl -wS $0 ${1+"$@"}'
3*cdf0e10cSrcweir    if 0;
4*cdf0e10cSrcweir
5*cdf0e10cSrcweir#
6*cdf0e10cSrcweir# 2009 Copyright Novell, Inc. & Sun Microsystems, Inc.
7*cdf0e10cSrcweir#
8*cdf0e10cSrcweir# OpenOffice.org is free software: you can redistribute it and/or modify
9*cdf0e10cSrcweir# it under the terms of the GNU Lesser General Public License version 3
10*cdf0e10cSrcweir# only, as published by the Free Software Foundation.
11*cdf0e10cSrcweir#
12*cdf0e10cSrcweir
13*cdf0e10cSrcweiruse	IO::File;
14*cdf0e10cSrcweiruse	Cwd;
15*cdf0e10cSrcweiruse File::Spec;
16*cdf0e10cSrcweiruse File::Spec::Functions;
17*cdf0e10cSrcweiruse File::Temp;
18*cdf0e10cSrcweiruse File::Path;
19*cdf0e10cSrcweir
20*cdf0e10cSrcweir$TempDir = "";
21*cdf0e10cSrcweir
22*cdf0e10cSrcweir
23*cdf0e10cSrcweir# all the XML package generation is a blatant rip from AF's
24*cdf0e10cSrcweir# write-calc-doc.pl
25*cdf0e10cSrcweir
26*cdf0e10cSrcweir
27*cdf0e10cSrcweir###############################################################################
28*cdf0e10cSrcweir#	Open a file with the given name.
29*cdf0e10cSrcweir#	First it is checked if the temporary directory, in which all files for
30*cdf0e10cSrcweir#	the document are gathered, is already present and create it if it is not.
31*cdf0e10cSrcweir#	Then create the path to the file inside the temporary directory.
32*cdf0e10cSrcweir#	Finally open the file and return a file handle to it.
33*cdf0e10cSrcweir#
34*cdf0e10cSrcweirsub	open_file
35*cdf0e10cSrcweir{
36*cdf0e10cSrcweir    my	$filename = pop @_;
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir    #	Create base directory of temporary directory tree if not alreay
39*cdf0e10cSrcweir    #	present.
40*cdf0e10cSrcweir    if ($TempDir eq "")
41*cdf0e10cSrcweir    {
42*cdf0e10cSrcweir        $TempDir = File::Temp::tempdir (CLEANUP => 1);
43*cdf0e10cSrcweir    }
44*cdf0e10cSrcweir
45*cdf0e10cSrcweir    #	Create the path to the file.
46*cdf0e10cSrcweir    my $fullname = File::Spec->catfile ($TempDir, $filename);
47*cdf0e10cSrcweir    my ($volume,$directories,$file) = File::Spec->splitpath ($fullname);
48*cdf0e10cSrcweir    mkpath (File::Spec->catpath ($volume,$directories,""));
49*cdf0e10cSrcweir
50*cdf0e10cSrcweir    #	Open the file and return a file handle to it.
51*cdf0e10cSrcweir    return new IO::File ($fullname, "w");
52*cdf0e10cSrcweir}
53*cdf0e10cSrcweir
54*cdf0e10cSrcweir
55*cdf0e10cSrcweir###############################################################################
56*cdf0e10cSrcweir#	Zip the files in the directory tree into the given file.
57*cdf0e10cSrcweir#
58*cdf0e10cSrcweirsub	zip_dirtree
59*cdf0e10cSrcweir{
60*cdf0e10cSrcweir    my	$filename = pop @_;
61*cdf0e10cSrcweir
62*cdf0e10cSrcweir    my	$cwd = getcwd;
63*cdf0e10cSrcweir    my	$zip_name = $filename;
64*cdf0e10cSrcweir
65*cdf0e10cSrcweir    #	We are about to change the directory.
66*cdf0e10cSrcweir    #	Therefore create an absolute pathname for the zip archive.
67*cdf0e10cSrcweir
68*cdf0e10cSrcweir    #	First transfer the drive from $cwd to $zip_name.  This is a
69*cdf0e10cSrcweir    #	workaround for a bug in file_name_is_absolute which thinks
70*cdf0e10cSrcweir    #	the the path \bla is an absolute path under DOS.
71*cdf0e10cSrcweir    my ($volume,$directories,$file) = File::Spec->splitpath ($zip_name);
72*cdf0e10cSrcweir    my ($volume_cwd,$directories_cwd,$file_cwd) = File::Spec->splitpath ($cwd);
73*cdf0e10cSrcweir    $volume = $volume_cwd if ($volume eq "");
74*cdf0e10cSrcweir    $zip_name = File::Spec->catpath ($volume,$directories,$file);
75*cdf0e10cSrcweir
76*cdf0e10cSrcweir    #	Add the current working directory to a relative path.
77*cdf0e10cSrcweir    if ( ! file_name_is_absolute ($zip_name))
78*cdf0e10cSrcweir    {
79*cdf0e10cSrcweir        $zip_name = File::Spec->catfile ($cwd, $zip_name);
80*cdf0e10cSrcweir
81*cdf0e10cSrcweir        #	Try everything to clean up the name.
82*cdf0e10cSrcweir        $zip_name = File::Spec->rel2abs ($filename);
83*cdf0e10cSrcweir        $zip_name = File::Spec->canonpath ($zip_name);
84*cdf0e10cSrcweir
85*cdf0e10cSrcweir        #	Remove .. directories from the middle of the path.
86*cdf0e10cSrcweir        while ($zip_name =~ /\/[^\/][^\.\/][^\/]*\/\.\.\//)
87*cdf0e10cSrcweir        {
88*cdf0e10cSrcweir            $zip_name = $` . "/" . $';
89*cdf0e10cSrcweir        }
90*cdf0e10cSrcweir    }
91*cdf0e10cSrcweir
92*cdf0e10cSrcweir    #	Just in case the zip program gets confused by an existing file with the
93*cdf0e10cSrcweir    #	same name as the one to be written that file is removed first.
94*cdf0e10cSrcweir    if ( -e $filename)
95*cdf0e10cSrcweir    {
96*cdf0e10cSrcweir        if (unlink ($filename) == 0)
97*cdf0e10cSrcweir        {
98*cdf0e10cSrcweir            print "Existing file $filename could not be deleted.\n";
99*cdf0e10cSrcweir            print "Please close the application that uses it, then try again.\n";
100*cdf0e10cSrcweir            return;
101*cdf0e10cSrcweir        }
102*cdf0e10cSrcweir    }
103*cdf0e10cSrcweir
104*cdf0e10cSrcweir    #	Finally create the zip file.  First change into the temporary directory
105*cdf0e10cSrcweir    #	so that the resulting zip file contains only paths relative to it.
106*cdf0e10cSrcweir    print "zipping [$ZipCmd $ZipFlags $zip_name *]\n";
107*cdf0e10cSrcweir    chdir ($TempDir);
108*cdf0e10cSrcweir    system ("$ZipCmd $ZipFlags $zip_name *");
109*cdf0e10cSrcweir    chdir ($cwd);
110*cdf0e10cSrcweir}
111*cdf0e10cSrcweir
112*cdf0e10cSrcweir
113*cdf0e10cSrcweirsub writeHeader
114*cdf0e10cSrcweir{
115*cdf0e10cSrcweir    print $OUT qq~<?xml version="1.0" encoding="UTF-8"?>
116*cdf0e10cSrcweir
117*cdf0e10cSrcweir<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">
118*cdf0e10cSrcweir <office:scripts/>
119*cdf0e10cSrcweir <office:automatic-styles>
120*cdf0e10cSrcweir  <style:style style:name="dp1" style:family="drawing-page">
121*cdf0e10cSrcweir   <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"/>
122*cdf0e10cSrcweir  </style:style>
123*cdf0e10cSrcweir  <style:style style:name="gr1" style:family="graphic" style:parent-style-name="standard">
124*cdf0e10cSrcweir   <style:graphic-properties draw:textarea-horizontal-align="center" draw:fill="none" draw:stroke="none" draw:textarea-vertical-align="middle"/>
125*cdf0e10cSrcweir  </style:style>
126*cdf0e10cSrcweir  <style:style style:name="gr2" style:family="graphic" style:parent-style-name="standard">
127*cdf0e10cSrcweir   <style:graphic-properties draw:textarea-horizontal-align="center" draw:textarea-vertical-align="middle"/>
128*cdf0e10cSrcweir  </style:style>
129*cdf0e10cSrcweir  <style:style style:name="pr1" style:family="presentation" style:parent-style-name="Default-title">
130*cdf0e10cSrcweir   <style:graphic-properties draw:fill-color="#ffffff" draw:auto-grow-height="true" fo:min-height="3.508cm"/>
131*cdf0e10cSrcweir  </style:style>
132*cdf0e10cSrcweir  <style:style style:name="pr2" style:family="presentation" style:parent-style-name="Default-notes">
133*cdf0e10cSrcweir   <style:graphic-properties draw:fill-color="#ffffff" draw:auto-grow-height="true" fo:min-height="13.367cm"/>
134*cdf0e10cSrcweir  </style:style>
135*cdf0e10cSrcweir  <style:style style:name="P1" style:family="paragraph">
136*cdf0e10cSrcweir   <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm"/>
137*cdf0e10cSrcweir  </style:style>
138*cdf0e10cSrcweir  <style:style style:name="P2" style:family="paragraph">
139*cdf0e10cSrcweir   <style:paragraph-properties fo:margin-left="0.6cm" fo:margin-right="0cm" fo:text-indent="-0.6cm"/>
140*cdf0e10cSrcweir  </style:style>
141*cdf0e10cSrcweir  <text:list-style style:name="L1">
142*cdf0e10cSrcweir   <text:list-level-style-bullet text:level="1" text:bullet-char="●">
143*cdf0e10cSrcweir    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
144*cdf0e10cSrcweir   </text:list-level-style-bullet>
145*cdf0e10cSrcweir   <text:list-level-style-bullet text:level="2" text:bullet-char="●">
146*cdf0e10cSrcweir    <style:list-level-properties text:space-before="0.6cm" text:min-label-width="0.6cm"/>
147*cdf0e10cSrcweir    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
148*cdf0e10cSrcweir   </text:list-level-style-bullet>
149*cdf0e10cSrcweir   <text:list-level-style-bullet text:level="3" text:bullet-char="●">
150*cdf0e10cSrcweir    <style:list-level-properties text:space-before="1.2cm" text:min-label-width="0.6cm"/>
151*cdf0e10cSrcweir    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
152*cdf0e10cSrcweir   </text:list-level-style-bullet>
153*cdf0e10cSrcweir   <text:list-level-style-bullet text:level="4" text:bullet-char="●">
154*cdf0e10cSrcweir    <style:list-level-properties text:space-before="1.8cm" text:min-label-width="0.6cm"/>
155*cdf0e10cSrcweir    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
156*cdf0e10cSrcweir   </text:list-level-style-bullet>
157*cdf0e10cSrcweir   <text:list-level-style-bullet text:level="5" text:bullet-char="●">
158*cdf0e10cSrcweir    <style:list-level-properties text:space-before="2.4cm" text:min-label-width="0.6cm"/>
159*cdf0e10cSrcweir    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
160*cdf0e10cSrcweir   </text:list-level-style-bullet>
161*cdf0e10cSrcweir   <text:list-level-style-bullet text:level="6" text:bullet-char="●">
162*cdf0e10cSrcweir    <style:list-level-properties text:space-before="3cm" text:min-label-width="0.6cm"/>
163*cdf0e10cSrcweir    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
164*cdf0e10cSrcweir   </text:list-level-style-bullet>
165*cdf0e10cSrcweir   <text:list-level-style-bullet text:level="7" text:bullet-char="●">
166*cdf0e10cSrcweir    <style:list-level-properties text:space-before="3.6cm" text:min-label-width="0.6cm"/>
167*cdf0e10cSrcweir    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
168*cdf0e10cSrcweir   </text:list-level-style-bullet>
169*cdf0e10cSrcweir   <text:list-level-style-bullet text:level="8" text:bullet-char="●">
170*cdf0e10cSrcweir    <style:list-level-properties text:space-before="4.2cm" text:min-label-width="0.6cm"/>
171*cdf0e10cSrcweir    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
172*cdf0e10cSrcweir   </text:list-level-style-bullet>
173*cdf0e10cSrcweir   <text:list-level-style-bullet text:level="9" text:bullet-char="●">
174*cdf0e10cSrcweir    <style:list-level-properties text:space-before="4.8cm" text:min-label-width="0.6cm"/>
175*cdf0e10cSrcweir    <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/>
176*cdf0e10cSrcweir   </text:list-level-style-bullet>
177*cdf0e10cSrcweir  </text:list-style>
178*cdf0e10cSrcweir </office:automatic-styles>
179*cdf0e10cSrcweir <office:body>
180*cdf0e10cSrcweir  <office:presentation>
181*cdf0e10cSrcweir~;
182*cdf0e10cSrcweir
183*cdf0e10cSrcweir}
184*cdf0e10cSrcweir
185*cdf0e10cSrcweirsub writeSlideHeader
186*cdf0e10cSrcweir{
187*cdf0e10cSrcweir    my $titleText = pop @_;
188*cdf0e10cSrcweir    my $slideNum = pop @_;
189*cdf0e10cSrcweir
190*cdf0e10cSrcweir    print $OUT "    <draw:page draw:name=\"page1\" draw:style-name=\"dp1\" draw:master-page-name=\"Default\">\n";
191*cdf0e10cSrcweir    print $OUT "     <office:forms form:automatic-focus=\"false\" form:apply-design-mode=\"false\"/>\n";
192*cdf0e10cSrcweir    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=\"6cm\" svg:x=\"5cm\" svg:y=\"4cm\">\n";
193*cdf0e10cSrcweir    print $OUT "      <text:p text:style-name=\"P2\">Slide: $slideNum</text:p>\n";
194*cdf0e10cSrcweir    print $OUT "      <text:p text:style-name=\"P2\">Path: $titleText</text:p>\n";
195*cdf0e10cSrcweir    print $OUT "     </draw:rect>\n";
196*cdf0e10cSrcweir}
197*cdf0e10cSrcweir
198*cdf0e10cSrcweir
199*cdf0e10cSrcweirsub writeSlideFooter
200*cdf0e10cSrcweir{
201*cdf0e10cSrcweir    print $OUT "    <presentation:notes draw:style-name=\"dp1\">\n";
202*cdf0e10cSrcweir    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";
203*cdf0e10cSrcweir    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";
204*cdf0e10cSrcweir    print $OUT "      <draw:text-box/>\n";
205*cdf0e10cSrcweir    print $OUT "     </draw:frame>\n";
206*cdf0e10cSrcweir    print $OUT "    </presentation:notes>\n";
207*cdf0e10cSrcweir    print $OUT "   </draw:page>\n";
208*cdf0e10cSrcweir}
209*cdf0e10cSrcweir
210*cdf0e10cSrcweirsub writeFooter
211*cdf0e10cSrcweir{
212*cdf0e10cSrcweir    print $OUT qq~   <presentation:settings presentation:full-screen="false"/>
213*cdf0e10cSrcweir  </office:presentation>
214*cdf0e10cSrcweir </office:body>
215*cdf0e10cSrcweir</office:document-content>
216*cdf0e10cSrcweir~;
217*cdf0e10cSrcweir
218*cdf0e10cSrcweir}
219*cdf0e10cSrcweir
220*cdf0e10cSrcweirsub writePath
221*cdf0e10cSrcweir{
222*cdf0e10cSrcweir    my $pathAry = pop @_;
223*cdf0e10cSrcweir    my $path = $pathAry->[1];
224*cdf0e10cSrcweir    my $viewBox = $pathAry->[0];
225*cdf0e10cSrcweir
226*cdf0e10cSrcweir    print $OUT "       <draw:path draw:style-name=\"gr2\" draw:text-style-name=\"P1\" draw:layer=\"layout\" svg:width=\"10cm\" svg:height=\"10cm\" svg:x=\"5cm\" svg:y=\"5cm\" svg:viewBox=\"";
227*cdf0e10cSrcweir    print $OUT $viewBox;
228*cdf0e10cSrcweir    print $OUT "\" svg:d=\"";
229*cdf0e10cSrcweir    print $OUT $path;
230*cdf0e10cSrcweir    print $OUT "\">\n";
231*cdf0e10cSrcweir    print $OUT "         <text:p/>\n";
232*cdf0e10cSrcweir    print $OUT "       </draw:path>\n";
233*cdf0e10cSrcweir}
234*cdf0e10cSrcweir
235*cdf0e10cSrcweirsub writeManifest
236*cdf0e10cSrcweir{
237*cdf0e10cSrcweir    my $outFile = open_file("META-INF/manifest.xml");
238*cdf0e10cSrcweir
239*cdf0e10cSrcweir    print $outFile qq~<?xml version="1.0" encoding="UTF-8"?>
240*cdf0e10cSrcweir<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">
241*cdf0e10cSrcweir<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0">
242*cdf0e10cSrcweir <manifest:file-entry manifest:media-type="application/vnd.oasis.opendocument.presentation" manifest:full-path="/"/>
243*cdf0e10cSrcweir <manifest:file-entry manifest:media-type="text/xml" manifest:full-path="content.xml"/>
244*cdf0e10cSrcweir</manifest:manifest>
245*cdf0e10cSrcweir~;
246*cdf0e10cSrcweir
247*cdf0e10cSrcweir    $outFile->close;
248*cdf0e10cSrcweir}
249*cdf0e10cSrcweir
250*cdf0e10cSrcweir
251*cdf0e10cSrcweir###############################################################################
252*cdf0e10cSrcweir#	Print usage information.
253*cdf0e10cSrcweir#
254*cdf0e10cSrcweirsub	usage	()
255*cdf0e10cSrcweir{
256*cdf0e10cSrcweir    print <<END_OF_USAGE;
257*cdf0e10cSrcweirusage: $0 <option>* [<SvgD-values>]
258*cdf0e10cSrcweir
259*cdf0e10cSrcweiroutput-file-name defaults to polygons.odp.
260*cdf0e10cSrcweir
261*cdf0e10cSrcweir         -h    Print this usage information.
262*cdf0e10cSrcweir         -o    output-file-name
263*cdf0e10cSrcweirEND_OF_USAGE
264*cdf0e10cSrcweir}
265*cdf0e10cSrcweir
266*cdf0e10cSrcweir###############################################################################
267*cdf0e10cSrcweir#	Process the command line.
268*cdf0e10cSrcweir#
269*cdf0e10cSrcweirsub	process_command_line
270*cdf0e10cSrcweir{
271*cdf0e10cSrcweir    foreach (@ARGV)
272*cdf0e10cSrcweir    {
273*cdf0e10cSrcweir        if (/^-h/)
274*cdf0e10cSrcweir        {
275*cdf0e10cSrcweir            usage;
276*cdf0e10cSrcweir            exit 0;
277*cdf0e10cSrcweir        }
278*cdf0e10cSrcweir    }
279*cdf0e10cSrcweir
280*cdf0e10cSrcweir    $global_output_name = "polygons.odp";
281*cdf0e10cSrcweir    my	$j = 0, $noMoreOptions = 0;
282*cdf0e10cSrcweir    for (my $i=0; $i<$#ARGV; $i++)
283*cdf0e10cSrcweir    {
284*cdf0e10cSrcweir        if ( !$noMoreOptions and $ARGV[$i] eq "-o")
285*cdf0e10cSrcweir        {
286*cdf0e10cSrcweir			$i++;
287*cdf0e10cSrcweir			$global_output_name = $ARGV[$i];
288*cdf0e10cSrcweir        }
289*cdf0e10cSrcweir        elsif ( !$noMoreOptions and $ARGV[$i] eq "--")
290*cdf0e10cSrcweir        {
291*cdf0e10cSrcweir			$noMoreOptions = 1;
292*cdf0e10cSrcweir        }
293*cdf0e10cSrcweir        elsif ( !$noMoreOptions and $ARGV[$i] =~ /^-/)
294*cdf0e10cSrcweir        {
295*cdf0e10cSrcweir            print "Unknown option $ARGV[$i]\n";
296*cdf0e10cSrcweir            usage;
297*cdf0e10cSrcweir            exit 1;
298*cdf0e10cSrcweir        }
299*cdf0e10cSrcweir        else
300*cdf0e10cSrcweir        {
301*cdf0e10cSrcweir            push(@paths, [$ARGV[$i],$ARGV[$i+1]]);
302*cdf0e10cSrcweir			$i++;
303*cdf0e10cSrcweir        }
304*cdf0e10cSrcweir    }
305*cdf0e10cSrcweir
306*cdf0e10cSrcweir    print "output to $global_output_name\n";
307*cdf0e10cSrcweir}
308*cdf0e10cSrcweir
309*cdf0e10cSrcweir###############################################################################
310*cdf0e10cSrcweir#	Main
311*cdf0e10cSrcweir###############################################################################
312*cdf0e10cSrcweir
313*cdf0e10cSrcweir$ZipCmd = $ENV{LOG_FILE_ZIP_CMD};
314*cdf0e10cSrcweir$ZipFlags = $ENV{LOG_FILE_ZIP_FLAGS};
315*cdf0e10cSrcweir#	Provide default values for the zip command and it's flags.
316*cdf0e10cSrcweirif ( ! defined $ZipCmd)
317*cdf0e10cSrcweir{
318*cdf0e10cSrcweir    $ZipCmd = "zip" unless defined $ZipCmd;
319*cdf0e10cSrcweir    $ZipFlags = "-r -q" unless defined $ZipFlags;
320*cdf0e10cSrcweir}
321*cdf0e10cSrcweir
322*cdf0e10cSrcweirprocess_command_line();
323*cdf0e10cSrcweir
324*cdf0e10cSrcweirwriteManifest();
325*cdf0e10cSrcweir
326*cdf0e10cSrcweir$OUT = open_file( "content.xml" );
327*cdf0e10cSrcweir
328*cdf0e10cSrcweirwriteHeader();
329*cdf0e10cSrcweir
330*cdf0e10cSrcweir$pathNum=0;
331*cdf0e10cSrcweirforeach $path (@paths)
332*cdf0e10cSrcweir{
333*cdf0e10cSrcweir	writeSlideHeader($pathNum, $path->[1]);
334*cdf0e10cSrcweir	writePath($path);
335*cdf0e10cSrcweir	writeSlideFooter();
336*cdf0e10cSrcweir	$pathNum++;
337*cdf0e10cSrcweir}
338*cdf0e10cSrcweir
339*cdf0e10cSrcweirwriteFooter();
340*cdf0e10cSrcweir
341*cdf0e10cSrcweir$OUT->close;
342*cdf0e10cSrcweir
343*cdf0e10cSrcweirzip_dirtree ($global_output_name);
344*cdf0e10cSrcweir
345