3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 $shapes = loadShapes
();
14 generatePPTXs
($shapes);
22 foreach $shape (keys %$shapes)
24 generatePPTX
($shapes, $shape);
27 generatePPTX
($shapes);
37 system ("unzip -qq -o -d cshape cshape.pptx");
39 # custom shape(s) slide with preset definition
40 generateSlide
($shapes, $type, ">cshape/ppt/slides/slide1.xml", 0);
42 $pptx = "../pptx/cshape-" . (defined $type ?
$type : "all") . ".pptx";
43 system ("cd cshape\nrm -rf ". $pptx . "\nzip -q -r " . $pptx . " .\ncd ..");
45 # preset(s) slide, for testing
46 generateSlide
($shapes, $type, ">cshape/ppt/slides/slide1.xml", 1);
48 $pptx = "../pptx/preset-cshape-" . (defined $type ?
$type : "all") . ".pptx";
49 system ("cd cshape\nrm -rf ". $pptx . "\nzip -q -r " . $pptx . " .\ncd ..");
54 open (IN
, "<presetShapeDefinitions.xml");
71 s/^ <\/([^>]+)>.*/$1/;
73 $shapes{$_} = [ @definition ];
74 #print "added ", $_, "\n";
100 print OUT
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
101 <p:sld xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">
105 <p:cNvPr id=\"1\" name=\"\"/>
111 <a:off x=\"0\" y=\"0\"/>
112 <a:ext cx=\"0\" cy=\"0\"/>
113 <a:chOff x=\"0\" y=\"0\"/>
114 <a:chExt cx=\"0\" cy=\"0\"/>
123 foreach $shape (keys %$shapes)
126 if ($shape ne $type) { next; }
127 # <a:ext cx=\"1050925\" cy=\"457200\"/>
128 # <a:ext cx=\"1000000\" cy=\"1000000\"/>
141 <p:cNvPr id=\"", $id++, "\" name=\"", $shape, "\"/>
145 <p:spPr bwMode=\"auto\">
147 <a:off x=\"" . (350000 + $col++*$size) . "\" y=\"" . (450000 + $row*$size) . "\"/>
148 <a:ext cx=\"" . (4*$size/5) . "\" cy=\"" . (4*$size/5) . "\"/>
152 print OUT
" <a:prstGeom prst=\"" . $shape . "\"><a:avLst/></a:prstGeom>
155 print OUT
" <a:custGeom>
157 print OUT @
{$shapes->{$shape}};
158 print OUT
" </a:custGeom>
161 print OUT
" <a:solidFill>
162 <a:srgbClr val=\"FFFF7F\"/>
166 <a:srgbClr val=\"A0A060\"/>
168 <a:miter lim=\"800000\"/>
177 print OUT
" </p:spTree>
180 <a:masterClrMapping/>
185 <p:cTn id=\"1\" dur=\"indefinite\" restart=\"never\" nodeType=\"tmRoot\"/>