1: 2eval 'exec perl -wS $0 ${1+"$@"}' 3 if 0; 4# ************************************************************* 5# 6# Licensed to the Apache Software Foundation (ASF) under one 7# or more contributor license agreements. See the NOTICE file 8# distributed with this work for additional information 9# regarding copyright ownership. The ASF licenses this file 10# to you under the Apache License, Version 2.0 (the 11# "License"); you may not use this file except in compliance 12# with the License. You may obtain a copy of the License at 13# 14# http://www.apache.org/licenses/LICENSE-2.0 15# 16# Unless required by applicable law or agreed to in writing, 17# software distributed under the License is distributed on an 18# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 19# KIND, either express or implied. See the License for the 20# specific language governing permissions and limitations 21# under the License. 22# 23# ************************************************************* 24 25 26use IO::File; 27use Cwd; 28use File::Spec; 29use File::Spec::Functions; 30use File::Temp; 31use File::Path; 32 33$TempDir = ""; 34my $FirstTransitionIndex = 0; 35my $LastTransitionIndex = -1; 36 37 38# all the XML package generation is a blatant rip from AF's 39# write-calc-doc.pl 40 41 42############################################################################### 43# Open a file with the given name. 44# First it is checked if the temporary directory, in which all files for 45# the document are gathered, is already present and create it if it is not. 46# Then create the path to the file inside the temporary directory. 47# Finally open the file and return a file handle to it. 48# 49sub open_file 50{ 51 my $filename = pop @_; 52 53 # Create base directory of temporary directory tree if not alreay 54 # present. 55 if ($TempDir eq "") 56 { 57 $TempDir = File::Temp::tempdir (CLEANUP => 1); 58 } 59 60 # Create the path to the file. 61 my $fullname = File::Spec->catfile ($TempDir, $filename); 62 my ($volume,$directories,$file) = File::Spec->splitpath ($fullname); 63 mkpath (File::Spec->catpath ($volume,$directories,"")); 64 65 # Open the file and return a file handle to it. 66 return new IO::File ($fullname, "w"); 67} 68 69 70############################################################################### 71# Zip the files in the directory tree into the given file. 72# 73sub zip_dirtree 74{ 75 my $filename = pop @_; 76 77 my $cwd = getcwd; 78 my $zip_name = $filename; 79 80 # We are about to change the directory. 81 # Therefore create an absolute pathname for the zip archive. 82 83 # First transfer the drive from $cwd to $zip_name. This is a 84 # workaround for a bug in file_name_is_absolute which thinks 85 # the path \bla is an absolute path under DOS. 86 my ($volume,$directories,$file) = File::Spec->splitpath ($zip_name); 87 my ($volume_cwd,$directories_cwd,$file_cwd) = File::Spec->splitpath ($cwd); 88 $volume = $volume_cwd if ($volume eq ""); 89 $zip_name = File::Spec->catpath ($volume,$directories,$file); 90 91 # Add the current working directory to a relative path. 92 if ( ! file_name_is_absolute ($zip_name)) 93 { 94 $zip_name = File::Spec->catfile ($cwd, $zip_name); 95 96 # Try everything to clean up the name. 97 $zip_name = File::Spec->rel2abs ($filename); 98 $zip_name = File::Spec->canonpath ($zip_name); 99 100 # Remove .. directories from the middle of the path. 101 while ($zip_name =~ /\/[^\/][^\.\/][^\/]*\/\.\.\//) 102 { 103 $zip_name = $` . "/" . $'; # $' 104 } 105 } 106 107 # Just in case the zip program gets confused by an existing file with the 108 # same name as the one to be written that file is removed first. 109 if ( -e $filename) 110 { 111 if (unlink ($filename) == 0) 112 { 113 print "Existing file $filename could not be deleted.\n"; 114 print "Please close the application that uses it, then try again.\n"; 115 return; 116 } 117 } 118 119 # Finally create the zip file. First change into the temporary directory 120 # so that the resulting zip file contains only paths relative to it. 121 print "zipping [$ZipCmd $ZipFlags $zip_name *]\n"; 122 chdir ($TempDir); 123 system ("$ZipCmd $ZipFlags $zip_name *"); 124 chdir ($cwd); 125 126} 127 128 129sub writeHeader 130{ 131 print $OUT qq~<?xml version="1.0" encoding="UTF-8"?> 132 133<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"> 134 <office:scripts/> 135 <office:automatic-styles> 136~; 137 138} 139 140sub writeSlideStyles 141{ 142 my $mode = pop @_; 143 my $direction = pop @_; 144 my $transitionSubType = pop @_; 145 my $transitionType = pop @_; 146 my $slideNum = pop @_; 147 148 return if $slideNum<$FirstTransitionIndex || ($LastTransitionIndex>=0 && $slideNum>$LastTransitionIndex); 149 150 print $OUT " <style:style style:name=\"dp",$slideNum,"\" style:family=\"drawing-page\">\n"; 151 print $OUT " <style:drawing-page-properties presentation:transition-type=\"automatic\" presentation:duration=\"PT00H00M01S\" presentation:background-visible=\"true\" presentation:background-objects-visible=\"true\" draw:fill=\"solid\" draw:fill-color=\"#ff",$slideNum % 2 ? "ff99" : "cc99","\" smil:type=\"",$transitionType,"\" smil:subtype=\"",$transitionSubType,"\" ",$direction == 0 ? "" : "smil:direction=\"reverse\" ",$mode == 0 ? "" : "smil:mode=\"out\"","/>\n"; 152 print $OUT " </style:style>\n"; 153} 154 155sub writeIntermediate 156{ 157 print $OUT qq~ <style:style style:name="gr1" style:family="graphic"> 158 <style:graphic-properties style:protect="size"/> 159 </style:style> 160 <style:style style:name="pr1" style:family="presentation" style:parent-style-name="Default-title"> 161 <style:graphic-properties draw:fill-color="#ffffff" draw:auto-grow-height="true" fo:min-height="3.508cm"/> 162 </style:style> 163 <style:style style:name="pr2" style:family="presentation" style:parent-style-name="Default-notes"> 164 <style:graphic-properties draw:fill-color="#ffffff" draw:auto-grow-height="true" fo:min-height="13.367cm"/> 165 </style:style> 166 <style:style style:name="P1" style:family="paragraph"> 167 <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm"/> 168 </style:style> 169 <style:style style:name="P2" style:family="paragraph"> 170 <style:paragraph-properties fo:margin-left="0.6cm" fo:margin-right="0cm" fo:text-indent="-0.6cm"/> 171 </style:style> 172 <text:list-style style:name="L1"> 173 <text:list-level-style-bullet text:level="1" text:bullet-char="●"> 174 <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/> 175 </text:list-level-style-bullet> 176 <text:list-level-style-bullet text:level="2" text:bullet-char="●"> 177 <style:list-level-properties text:space-before="0.6cm" text:min-label-width="0.6cm"/> 178 <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/> 179 </text:list-level-style-bullet> 180 <text:list-level-style-bullet text:level="3" text:bullet-char="●"> 181 <style:list-level-properties text:space-before="1.2cm" text:min-label-width="0.6cm"/> 182 <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/> 183 </text:list-level-style-bullet> 184 <text:list-level-style-bullet text:level="4" text:bullet-char="●"> 185 <style:list-level-properties text:space-before="1.8cm" text:min-label-width="0.6cm"/> 186 <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/> 187 </text:list-level-style-bullet> 188 <text:list-level-style-bullet text:level="5" text:bullet-char="●"> 189 <style:list-level-properties text:space-before="2.4cm" text:min-label-width="0.6cm"/> 190 <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/> 191 </text:list-level-style-bullet> 192 <text:list-level-style-bullet text:level="6" text:bullet-char="●"> 193 <style:list-level-properties text:space-before="3cm" text:min-label-width="0.6cm"/> 194 <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/> 195 </text:list-level-style-bullet> 196 <text:list-level-style-bullet text:level="7" text:bullet-char="●"> 197 <style:list-level-properties text:space-before="3.6cm" text:min-label-width="0.6cm"/> 198 <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/> 199 </text:list-level-style-bullet> 200 <text:list-level-style-bullet text:level="8" text:bullet-char="●"> 201 <style:list-level-properties text:space-before="4.2cm" text:min-label-width="0.6cm"/> 202 <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/> 203 </text:list-level-style-bullet> 204 <text:list-level-style-bullet text:level="9" text:bullet-char="●"> 205 <style:list-level-properties text:space-before="4.8cm" text:min-label-width="0.6cm"/> 206 <style:text-properties fo:font-family="StarSymbol" style:use-window-font-color="true" fo:font-size="45%"/> 207 </text:list-level-style-bullet> 208 </text:list-style> 209 </office:automatic-styles> 210 <office:body> 211 <office:presentation> 212~; 213 214} 215 216sub writeSlide 217{ 218 my $mode = pop @_; 219 my $direction = pop @_; 220 my $transitionSubtype = pop @_; 221 my $transitionType = pop @_; 222 my $slideNum = pop @_; 223 224 return if $slideNum<$FirstTransitionIndex || ($LastTransitionIndex>=0 && $slideNum>$LastTransitionIndex); 225 226 print $OUT " <draw:page draw:name=\"page",$slideNum,"\" draw:style-name=\"dp",$slideNum,"\" draw:master-page-name=\"Default\" presentation:presentation-page-layout-name=\"AL1T19\">"; 227 228 print $OUT " <draw:frame presentation:style-name=\"pr1\" draw:layer=\"layout\" svg:width=\"25.199cm\" svg:height=\"3.256cm\" svg:x=\"1.4cm\" svg:y=\"0.962cm\" presentation:class=\"title\">\n"; 229 print $OUT " <draw:text-box>\n"; 230 print $OUT " <text:p text:style-name=\"P1\">Transition “",$slideNum-1,"”</text:p>\n"; 231 print $OUT " </draw:text-box>\n"; 232 print $OUT " </draw:frame>\n"; 233 print $OUT " <draw:frame presentation:style-name=\"pr2\" draw:layer=\"layout\" svg:width=\"25.199cm\" svg:height=\"13.609cm\" svg:x=\"1.4cm\" svg:y=\"4.914cm\" presentation:class=\"outline\">\n"; 234 print $OUT " <draw:text-box>\n"; 235 print $OUT " <text:list text:style-name=\"L2\">\n"; 236 print $OUT " <text:list-item>\n"; 237 print $OUT " <text:p text:style-name=\"P2\">Transition: ",$transitionType,"</text:p>\n"; 238 print $OUT " </text:list-item>\n"; 239 print $OUT " </text:list>\n"; 240 print $OUT " <text:list text:style-name=\"L2\">\n"; 241 print $OUT " <text:list-item>\n"; 242 print $OUT " <text:list>\n"; 243 print $OUT " <text:list-item>\n"; 244 print $OUT " <text:p text:style-name=\"P3\">Subtype: ",$transitionSubtype,"</text:p>\n"; 245 print $OUT " </text:list-item>\n"; 246 print $OUT " </text:list>\n"; 247 print $OUT " </text:list-item>\n"; 248 print $OUT " </text:list>\n"; 249 print $OUT " <text:list text:style-name=\"L2\">\n"; 250 print $OUT " <text:list-item>\n"; 251 print $OUT " <text:list>\n"; 252 print $OUT " <text:list-item>\n"; 253 print $OUT " <text:p text:style-name=\"P3\">Direction: ",$direction == 0 ? "forward" : "reverse","</text:p>\n"; 254 print $OUT " </text:list-item>\n"; 255 print $OUT " </text:list>\n"; 256 print $OUT " </text:list-item>\n"; 257 print $OUT " </text:list>\n"; 258 print $OUT " <text:list text:style-name=\"L2\">\n"; 259 print $OUT " <text:list-item>\n"; 260 print $OUT " <text:list>\n"; 261 print $OUT " <text:list-item>\n"; 262 print $OUT " <text:p text:style-name=\"P3\">Mode: ",$mode == 0 ? "in" : "out","</text:p>\n"; 263 print $OUT " </text:list-item>\n"; 264 print $OUT " </text:list>\n"; 265 print $OUT " </text:list-item>\n"; 266 print $OUT " </text:list>\n"; 267 print $OUT " </draw:text-box>\n"; 268 print $OUT " </draw:frame>\n"; 269 print $OUT " <presentation:notes draw:style-name=\"dp2\">\n"; 270 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"; 271 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"; 272 print $OUT " <draw:text-box/>\n"; 273 print $OUT " </draw:frame>\n"; 274 print $OUT " </presentation:notes>\n"; 275 print $OUT " </draw:page>\n"; 276 277} 278 279sub writeFooter 280{ 281 print $OUT qq~ <presentation:settings presentation:full-screen="false"/> 282 </office:presentation> 283 </office:body> 284</office:document-content> 285~; 286 287} 288 289sub writeManifest 290{ 291 my $outFile = open_file("META-INF/manifest.xml"); 292 293 print $outFile qq~<?xml version="1.0" encoding="UTF-8"?> 294<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd"> 295<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"> 296 <manifest:file-entry manifest:media-type="application/vnd.oasis.opendocument.presentation" manifest:full-path="/"/> 297 <manifest:file-entry manifest:media-type="text/xml" manifest:full-path="content.xml"/> 298</manifest:manifest> 299~; 300 301 $outFile->close; 302} 303 304 305$transitionsRef = [ 306 307 ["barWipe", 308 ["leftToRight", 309 "topToBottom"]], 310 311 ["blindsWipe", 312 ["vertical", 313 "horizontal"]], 314 315 ["boxWipe", 316 ["topLeft", 317 "topRight", 318 "bottomRight", 319 "bottomLeft", 320 "topCenter", 321 "rightCenter", 322 "bottomCenter", 323 "leftCenter"]], 324 325 ["fourBoxWipe", 326 ["cornersIn", 327 "cornersOut"]], 328 329 ["barnDoorWipe", 330 ["vertical", 331 "horizontal", 332 "diagonalBottomLeft", 333 "diagonalTopLeft"]], 334 335 ["bowTieWipe", 336 ["vertical", 337 "horizontal"]], 338 339 ["miscDiagonalWipe", 340 ["doubleBarnDoor", 341 "doubleDiamond"]], 342 343 ["veeWipe", 344 ["down", 345 "left", 346 "up", 347 "right"]], 348 349 ["barnVeeWipe", 350 ["top", 351 "left", 352 "up", 353 "right"]], 354 355 ["zigZagWipe", 356 ["leftToRight", 357 "topToBottom"]], 358 359 ["barnZigZagWipe", 360 ["vertical", 361 "horizontal"]], 362 363 ["irisWipe", 364 ["rectangle", 365 "diamond"]], 366 367 ["triangleWipe", 368 ["up", 369 "right", 370 "down", 371 "left"]], 372 373 ["arrowHeadWipe", 374 ["up", 375 "right", 376 "down", 377 "left"]], 378 379 ["pentagonWipe", 380 ["up", 381 "down"]], 382 383 ["hexagonWipe", 384 ["horizontal", 385 "vertical"]], 386 387 ["ellipseWipe", 388 ["circle", 389 "horizontal", 390 "vertical"]], 391 392 ["eyeWipe", 393 ["vertical", 394 "horizontal"]], 395 396 ["roundRectWipe", 397 ["horizontal", 398 "vertical"]], 399 400 ["starWipe", 401 ["fourPoint", 402 "fivePoint", 403 "sixPoint"]], 404 405 ["miscShapeWipe", 406 ["heart", 407 "keyhole"]], 408 409 ["clockWipe", 410 ["clockwiseTwelve", 411 "clockwiseThree", 412 "clockwiseSix", 413 "clockwiseNine"]], 414 415 ["pinWheelWipe", 416 ["oneBlade", 417 "twoBladeVertical", 418 "twoBladeHorizontal", 419 "threeBlade", 420 "fourBlade", 421 "eightBlade"]], 422 423 ["singleSweepWipe", 424 ["clockwiseTop", 425 "clockwiseRight", 426 "clockwiseBottom", 427 "clockwiseLeft", 428 "clockwiseTopLeft", 429 "counterClockwiseBottomLeft", 430 "clockwiseBottomRight", 431 "counterClockwiseTopRight"]], 432 433 ["fanWipe", 434 ["centerTop", 435 "centerRight", 436 "top", 437 "right", 438 "bottom", 439 "left"]], 440 441 ["doubleFanWipe", 442 ["fanOutVertical", 443 "fanOutHorizontal", 444 "fanInVertical", 445 "fanInHorizontal"]], 446 447 ["doubleSweepWipe", 448 ["parallelVertical", 449 "parallelDiagonal", 450 "oppositeVertical", 451 "oppositeHorizontal", 452 "parallelDiagonalTopLeft", 453 "parallelDiagonalBottomLeft"]], 454 455 ["saloonDoorWipe", 456 ["top", 457 "left", 458 "bottom", 459 "right"]], 460 461 ["windshieldWipe", 462 ["right", 463 "up", 464 "vertical", 465 "horizontal"]], 466 467 ["snakeWipe", 468 ["topLeftHorizontal", 469 "topLeftVertical", 470 "topLeftDiagonal", 471 "topRightDiagonal", 472 "bottomRightDiagonal", 473 "bottomLeftDiagonal"]], 474 475 ["spiralWipe", 476 ["topLeftClockwise", 477 "topRightClockwise", 478 "bottomRightClockwise", 479 "bottomLeftClockwise", 480 "topLeftCounterClockwise", 481 "topRightCounterClockwise", 482 "bottomRightCounterClockwise", 483 "bottomLeftCounterClockwise"]], 484 485 ["parallelSnakesWipe", 486 ["verticalTopSame", 487 "verticalBottomSame", 488 "verticalTopLeftOpposite", 489 "verticalBottomLeftOpposite", 490 "horizontalLeftSame", 491 "horizontalRightSame", 492 "horizontalTopLeftOpposite", 493 "horizontalTopRightOpposite", 494 "diagonalBottomLeftOpposite", 495 "diagonalTopLeftOpposite"]], 496 497 ["boxSnakesWipe", 498 ["twoBoxTop", 499 "twoBoxLeft", 500 "twoBoxRight", 501 "fourBoxVertical", 502 "fourBoxHorizontal"]], 503 504 ["waterfallWipe", 505 ["verticalLeft", 506 "verticalRight", 507 "horizontalLeft", 508 "horizontalRight"]], 509 510 ["pushWipe", 511 ["fromLeft", 512 "fromTop", 513 "fromRight", 514 "fromBottom", 515 "fromBottomRight", 516 "fromBottomLeft", 517 "fromTopRight", 518 "fromTopLeft", 519 "combHorizontal", 520 "combVertical"]], 521 522 ["slideWipe", 523 ["fromLeft", 524 "fromTop", 525 "fromRight", 526 "fromBottom", 527 "fromBottomRight", 528 "fromBottomLeft", 529 "fromTopRight", 530 "fromTopLeft"]], 531 532 ["fade", 533 ["crossfade", 534 "fadeToColor", 535 "fadeFromColor", 536 "fadeOverColor"]], 537 538 ["randomBarWipe", 539 ["vertical", 540 "horizontal"]], 541 542 ["checkerBoardWipe", 543 ["down", 544 "across"]], 545 546 ["dissolve", 547 ["default"]] 548]; 549 550 551############################################################################### 552# Print usage information. 553# 554sub usage () 555{ 556 print <<END_OF_USAGE; 557usage: $0 <option>* [<output-file-name>] 558 559output-file-name defaults to alltransitions.odp. 560 561options: -a Generate _all_ combinations of type, subtype, 562 direction, and mode 563 -h Print this usage information. 564 -f First transition to include, defaults to 0 565 -l Last transition to include 566END_OF_USAGE 567} 568 569############################################################################### 570# Process the command line. 571# 572sub process_command_line 573{ 574 foreach (@ARGV) 575 { 576 if (/^-h/) 577 { 578 usage; 579 exit 0; 580 } 581 } 582 583 $global_gen_all=0; 584 $global_output_name = "alltransitions.odp"; 585 586 my $j = 0; 587 for (my $i=0; $i<=$#ARGV; $i++) 588 { 589 if ($ARGV[$i] eq "-a") 590 { 591 $global_gen_all=1; 592 } 593 elsif ($ARGV[$i] eq "-f") 594 { 595 $FirstTransitionIndex = $ARGV[++$i]; 596 } 597 elsif ($ARGV[$i] eq "-l") 598 { 599 $LastTransitionIndex = $ARGV[++$i]; 600 } 601 elsif ($ARGV[$i] =~ /^-/) 602 { 603 print "Unknown option $ARGV[$i]\n"; 604 usage; 605 exit 1; 606 } 607 elsif ($#ARGV == $i ) 608 { 609 $global_output_name = $ARGV[$i]; 610 } 611 } 612 613 print "output to $global_output_name\n"; 614} 615 616 617############################################################################### 618# Main 619############################################################################### 620 621$ZipCmd = $ENV{LOG_FILE_ZIP_CMD}; 622$ZipFlags = $ENV{LOG_FILE_ZIP_FLAGS}; 623# Provide default values for the zip command and it's flags. 624if ( ! defined $ZipCmd) 625{ 626 $ZipCmd = "zip" unless defined $ZipCmd; 627 $ZipFlags = "-r -q" unless defined $ZipFlags; 628} 629 630process_command_line(); 631 632writeManifest(); 633 634$OUT = open_file( "content.xml" ); 635 636writeHeader(); 637 638$slideNum=1; 639foreach $transitionRef (@$transitionsRef) 640{ 641 $transitionType = @$transitionRef[0]; 642 643 foreach $subtype (@{$transitionRef->[1]}) 644 { 645 if( $global_gen_all != 0 ) 646 { 647 writeSlideStyles($slideNum++, 648 $transitionType, 649 $subtype, 650 0, 0); 651 writeSlideStyles($slideNum++, 652 $transitionType, 653 $subtype, 654 1, 0); 655 writeSlideStyles($slideNum++, 656 $transitionType, 657 $subtype, 658 0, 1); 659 writeSlideStyles($slideNum++, 660 $transitionType, 661 $subtype, 662 1, 1); 663 } 664 else 665 { 666 writeSlideStyles($slideNum++, 667 $transitionType, 668 $subtype, 669 0, 0); 670 } 671 } 672} 673 674writeIntermediate(); 675 676$slideNum=1; 677foreach $transitionRef (@$transitionsRef) 678{ 679 $transitionType = @$transitionRef[0]; 680 681 foreach $subtype (@{$transitionRef->[1]}) 682 { 683 if( $global_gen_all != 0 ) 684 { 685 writeSlide($slideNum++, 686 $transitionType, 687 $subtype, 688 0, 0); 689 writeSlide($slideNum++, 690 $transitionType, 691 $subtype, 692 1, 0); 693 writeSlide($slideNum++, 694 $transitionType, 695 $subtype, 696 0, 1); 697 writeSlide($slideNum++, 698 $transitionType, 699 $subtype, 700 1, 1); 701 } 702 else 703 { 704 writeSlide($slideNum++, 705 $transitionType, 706 $subtype, 707 0, 0); 708 } 709 } 710} 711 712writeFooter(); 713 714$OUT->close; 715 716zip_dirtree ($global_output_name); 717 718