mktransitions.pl (bb113e63) | mktransitions.pl (42dadaea) |
---|---|
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 --- 17 unchanged lines hidden (view full) --- 26use IO::File; 27use Cwd; 28use File::Spec; 29use File::Spec::Functions; 30use File::Temp; 31use File::Path; 32 33$TempDir = ""; | 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 --- 17 unchanged lines hidden (view full) --- 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; |
|
34 35 36# all the XML package generation is a blatant rip from AF's 37# write-calc-doc.pl 38 39 40############################################################################### 41# Open a file with the given name. --- 51 unchanged lines hidden (view full) --- 93 94 # Try everything to clean up the name. 95 $zip_name = File::Spec->rel2abs ($filename); 96 $zip_name = File::Spec->canonpath ($zip_name); 97 98 # Remove .. directories from the middle of the path. 99 while ($zip_name =~ /\/[^\/][^\.\/][^\/]*\/\.\.\//) 100 { | 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. --- 51 unchanged lines hidden (view full) --- 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 { |
101 $zip_name = $` . "/" . $'; | 103 $zip_name = $` . "/" . $'; # $' |
102 } 103 } 104 105 # Just in case the zip program gets confused by an existing file with the 106 # same name as the one to be written that file is removed first. 107 if ( -e $filename) 108 { 109 if (unlink ($filename) == 0) --- 28 unchanged lines hidden (view full) --- 138sub writeSlideStyles 139{ 140 my $mode = pop @_; 141 my $direction = pop @_; 142 my $transitionSubType = pop @_; 143 my $transitionType = pop @_; 144 my $slideNum = pop @_; 145 | 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) --- 28 unchanged lines hidden (view full) --- 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 |
|
146 print $OUT " <style:style style:name=\"dp",$slideNum,"\" style:family=\"drawing-page\">\n"; 147 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"; 148 print $OUT " </style:style>\n"; 149} 150 151sub writeIntermediate 152{ 153 print $OUT qq~ <style:style style:name="gr1" style:family="graphic"> --- 58 unchanged lines hidden (view full) --- 212sub writeSlide 213{ 214 my $mode = pop @_; 215 my $direction = pop @_; 216 my $transitionSubtype = pop @_; 217 my $transitionType = pop @_; 218 my $slideNum = pop @_; 219 | 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"> --- 58 unchanged lines hidden (view full) --- 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 |
|
220 print $OUT " <draw:page draw:name=\"page",$slideNum,"\" draw:style-name=\"dp",$slideNum,"\" draw:master-page-name=\"Default\" presentation:presentation-page-layout-name=\"AL1T19\">"; 221 222 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"; 223 print $OUT " <draw:text-box>\n"; 224 print $OUT " <text:p text:style-name=\"P1\">Transition “",$slideNum-1,"”</text:p>\n"; 225 print $OUT " </draw:text-box>\n"; 226 print $OUT " </draw:frame>\n"; 227 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"; --- 322 unchanged lines hidden (view full) --- 550 print <<END_OF_USAGE; 551usage: $0 <option>* [<output-file-name>] 552 553output-file-name defaults to alltransitions.odp. 554 555options: -a Generate _all_ combinations of type, subtype, 556 direction, and mode 557 -h Print this usage information. | 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"; --- 322 unchanged lines hidden (view full) --- 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 |
|
558END_OF_USAGE 559} 560 561############################################################################### 562# Process the command line. 563# 564sub process_command_line 565{ --- 11 unchanged lines hidden (view full) --- 577 578 my $j = 0; 579 for (my $i=0; $i<=$#ARGV; $i++) 580 { 581 if ($ARGV[$i] eq "-a") 582 { 583 $global_gen_all=1; 584 } | 566END_OF_USAGE 567} 568 569############################################################################### 570# Process the command line. 571# 572sub process_command_line 573{ --- 11 unchanged lines hidden (view full) --- 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 } |
|
585 elsif ($ARGV[$i] =~ /^-/) 586 { 587 print "Unknown option $ARGV[$i]\n"; 588 usage; 589 exit 1; 590 } 591 elsif ($#ARGV == $i ) 592 { --- 109 unchanged lines hidden --- | 601 elsif ($ARGV[$i] =~ /^-/) 602 { 603 print "Unknown option $ARGV[$i]\n"; 604 usage; 605 exit 1; 606 } 607 elsif ($#ARGV == $i ) 608 { --- 109 unchanged lines hidden --- |