summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/animate
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-03-11 23:39:41 +0000
committerKarl Berry <karl@freefriends.org>2016-03-11 23:39:41 +0000
commit58417e588769a2a532f99b57b67bc76e2e24901a (patch)
treebc72a75bea748ec57de337083f519b66264b21f4 /Master/texmf-dist/tex/latex/animate
parentdbdc8b0e5fb32248da5a3b954f01c7df5c240ffb (diff)
animate (11mar16)
git-svn-id: svn://tug.org/texlive/trunk@40001 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/animate')
-rw-r--r--Master/texmf-dist/tex/latex/animate/animate.sty552
1 files changed, 121 insertions, 431 deletions
diff --git a/Master/texmf-dist/tex/latex/animate/animate.sty b/Master/texmf-dist/tex/latex/animate/animate.sty
index ab5eaecabdd..bd1018ba2fd 100644
--- a/Master/texmf-dist/tex/latex/animate/animate.sty
+++ b/Master/texmf-dist/tex/latex/animate/animate.sty
@@ -37,10 +37,6 @@
\RequirePackage{animfp}
\RequirePackage{graphics}
-\newboolean{@anim@powerdot} %to cope with some powerdot oddity
-\setboolean{@anim@powerdot}{false}
-\@ifclassloaded{powerdot}{\setboolean{@anim@powerdot}{true}}{}%
-
%driver options (the only package options we process immediately)
\newboolean{@anim@dvips}
\setboolean{@anim@dvips}{false}
@@ -75,7 +71,52 @@
\DeclareOption*{}\ProcessOptions*\relax %allow anything as an option
%(remaining package options will be processed near end of this file)
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\RequirePackage{pdfbase}%low level PDF operations
+\@ifpackagelater{pdfbase}{2016/03/11}{}{
+ \PackageError{animate}{%
+ Support package `pdfbase.sty' too old.%
+ }{%
+ Please install an up to date version of `pdfbase.sty'.\MessageBreak%
+ Aborting.%
+ }%
+}
+\ExplSyntaxOn
+ \def\@anim@dictobj#1{
+ \pbs_pdfobj:nnn{}{dict}{#1}
+ \xdef\@anim@lastobj{\pbs_pdflastobj:}
+ }
+ \def\@anim@arrayobj#1{
+ \pbs_pdfobj:nnn{}{array}{#1}
+ \xdef\@anim@lastobj{\pbs_pdflastobj:}
+ }
+ \def\@anim@streamobj#1#2{
+ \pbs_pdfobj:nnn{}{stream}{{#1}{#2}}
+ \xdef\@anim@lastobj{\pbs_pdflastobj:}
+ }
+
+ \def\@anim@xform#1#2#3{
+ \pbs_pdfxform:nnn{#1}{#2}{#3}
+ \xdef\@anim@lastxform{\pbs_pdflastxform:}
+ }
+
+ \let\@anim@refxform\pbs_pdfrefxform:n
+
+ \def\@anim@pdfannot#1#2#3#4{
+ \pbs_pdfannot:nnnn{#1}{#2}{#3}{#4}
+ %since all annots are Widgets
+ \pbs_appendtofields:n{\pbs_pdflastann:}
+ }
+
+ \let\@anim@pdfcatalog\pbs_pdfcatalog:n
+\ExplSyntaxOff
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
\RequirePackage{ocgbase} %OCG generating and configuration macros
+\def\@anim@newocg#1#2{%#1:@anim@num, #2:@anim@curframe@zb
+ \ocgbase@new@ocg{#1.#2}{}{1}%
+ \xdef\@anim@curocg{\ocgbase@last@ocg}%
+}
\ifpdf
%test for correct pdfTeX version
@@ -127,53 +168,9 @@
}%
\fi%
}
- \AtEndDvi{\special{ps:\@anim@gsoldwarning}}%
\fi
\fi
-\begingroup
-\catcode`\_=13 \let_\space
-\xdef\@anim@dpiwarning{%
- {Resolution 1200 gt VResolution 1200 gt or product (Ghostscript)
- search {pop pop pop true}{pop false}ifelse and {%
- (\string\n%
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\string\n%
- @@____Warning:_DVI_resolution_greater_than_1200_dpi!_____@@\string\n%
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\string\n%
- @@_______________________________________________________@@\string\n%
- @@_Animation_frames_may_be_poorly_scaled,_clipped_or_____@@\string\n%
- @@_invisible.____________________________________________@@\string\n%
- @@_______________________________________________________@@\string\n%
- @@_Dvips_should_be_called_either_without_option_`-Ppdf':_@@\string\n%
- @@_______________________________________________________@@\string\n%
- @@___dvips_\jobname\string\n
- @@_______________________________________________________@@\string\n%
- @@_or_with_a_different_resolution_setting:_______________@@\string\n%
- @@_______________________________________________________@@\string\n%
- @@___dvips_-Ppdf_-D1200_\jobname\string\n
- @@_______________________________________________________@@\string\n%
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\string\n)
- print} if} ?pdfmark
-}
-\xdef\@anim@gsoldwarning{%
- {product (Ghostscript) search {pop pop pop true}{pop false}ifelse
- revision 915 lt and {%
- (\string\n%
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\string\n%
- @@____________Warning:_Ghostscript_too_old!______________@@\string\n%
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\string\n%
- @@_______________________________________________________@@\string\n%
- @@_Ghostscript_version_>=_9.15_required._________________@@\string\n%
- @@_Otherwise,_animations_will_not_work.__________________@@\string\n%
- @@_______________________________________________________@@\string\n%
- @@_Get_current_version_from______________________________@@\string\n%
- @@_http://www.ghostscript.com/download___________________@@\string\n%
- @@_______________________________________________________@@\string\n%
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\string\n)
- print} if} ?pdfmark
-}
-\endgroup
-
%\pdfmdfivesum is used for hashing object references of embedded files based
%on their MD5 digest (in order to avoid multiple inclusion); if it is not
%available, hashing will be based on the file name
@@ -240,91 +237,36 @@
\newboolean{@anim@grxloaded}
\setboolean{@anim@grxloaded}{false}
-\newboolean{@anim@pgfloaded}
-\setboolean{@anim@pgfloaded}{false}
\AtBeginDocument{%
- \@ifpackageloaded{graphicx}{%
- \setboolean{@anim@grxloaded}{true}%
- }{}%
- \@ifpackageloaded{pgf}{%
- \setboolean{@anim@pgfloaded}{true}%
- }{}%
+ \@ifpackageloaded{graphicx}{\setboolean{@anim@grxloaded}{true}}{}%
}
-%macros for adding Appearances name tree / AcroForm dicts to PDF Catalog
+%insert Appearances name tree into /Names dict of the PDF Catalog
\def\@anim@appearances{}
-\ifdefined\@anim@fields\else\def\@anim@fields{}\fi %takes Field object refs
\ifpdf
- %Appearance name tree
\AtEndDvi{%
\ifx\empty\@anim@appearances\empty\else%
- \immediate\pdfobj{[\@anim@appearances]}%
- \pdfnames{%
- /AP <</Names \the\pdflastobj\space 0 R>>%
- }%
+ \@anim@arrayobj{\@anim@appearances}%
+ \pdfnames{/AP<</Names \@anim@lastobj>>}%
\fi%
}%
- %AcroForm dict
- \ifdefined\Acro@Form@added\else%
- \AtEndDvi{%
- \ifx\empty\@anim@fields\empty\else%
- \immediate\pdfobj{[\@anim@fields]}%
- \pdfcatalog{%
- /AcroForm <</Fields \the\pdflastobj\space 0 R /NeedAppearances false>>%
- }%
- \fi%
- }%
- \gdef\Acro@Form@added{}%
- \fi%
\else
- %counts inserted widget annots
- \newcount\@anim@fieldnum\@anim@fieldnum=\z@
\if@anim@dvipdfmx
\AtEndDvi{%
\ifx\empty\@anim@appearances\empty\else%
- \special{pdf:obj @anim@appearances []}%
- \special{pdf:put @anim@appearances \@anim@appearances}%
- \special{pdf:put @names <</AP <</Names @anim@appearances>>>>}%
+ \@anim@arrayobj{\@anim@appearances}%
+ \special{pdf:put @names <</AP<</Names \@anim@lastobj>>>>}%
\fi%
}%
- \ifdefined\Acro@Form@added\else%
- \AtEndDvi{%
- \ifx\empty\@anim@fields\empty\else%
- %array which takes refs to all widget annotations
- \special{pdf:obj @anim@fields []}%
- \special{pdf:put @anim@fields \@anim@fields}%
- \special{pdf:put @catalog <<%
- /AcroForm <</Fields @anim@fields /NeedAppearances false>>>>}%
- \fi%
- }%
- \gdef\Acro@Form@added{}%
- \fi%
\else
\AtEndDvi{%
\ifx\empty\@anim@appearances\empty\else%
- \special{ps:
- mark /_objdef {@anim@appearances} /type/array /OBJ pdfmark
- mark {@anim@appearances} 0 [\@anim@appearances] /PUTINTERVAL pdfmark
- mark {Catalog} <<%
- /Names <</AP <</Names {@anim@appearances}>> >>
- >> /PUT pdfmark
- }%
+ \@anim@arrayobj{\@anim@appearances}%
+ \PackageWarningNoLine{animate}{\@anim@icondvipswarning}%
+ %this deletes hyperref-inserted Dests!
+ \@anim@pdfcatalog{/Names<</AP<</Names \@anim@lastobj>>>>}%
\fi%
}%
- \ifdefined\Acro@Form@added\else%
- \AtEndDvi{%
- \ifx\empty\@anim@fields\empty\else%
- \special{ps:
- mark /_objdef {@anim@fields} /type/array /OBJ pdfmark
- mark {@anim@fields} 0 [\@anim@fields] /PUTINTERVAL pdfmark
- mark {Catalog} <<%
- /AcroForm <</Fields {@anim@fields} /NeedAppearances false>>
- >> /PUT pdfmark
- }%
- \fi%
- }%
- \gdef\Acro@Form@added{}%
- \fi%
\fi
\fi
@@ -353,13 +295,13 @@
}
%retrieve nat. dimensions from XObjects
\def\@anim@xobjnatwd#1{% #1 Form XObj ID
- \@anim@getkeyval{natwidth:#1}\p@%
+ \@anim@getkeyval{natwidth:#1}%
}
\def\@anim@xobjnatht#1{% #1 Form XObj ID
- \@anim@getkeyval{natheight:#1}\p@%
+ \@anim@getkeyval{natheight:#1}%
}
\def\@anim@xobjnatdp#1{% #1 Form XObj ID
- \@anim@getkeyval{natdepth:#1}\p@%
+ \@anim@getkeyval{natdepth:#1}%
}
\def\@anim@xobjnatdims#1#2#3#4{% Form XObj ID, wd, ht, dp
\@anim@newkey{natwidth:#1}{#2}%
@@ -440,256 +382,11 @@
}%
}
-%low level operations (driver level)
-\ifpdf
- \def\@anim@dictobj#1{%
- \immediate\pdfobj{<<#1>>}%
- \xdef\@anim@lastobj{\the\pdflastobj\space 0 R}%
- }
-
- \def\@anim@streamobj#1#2{% #1: attrs, #2 content
- \immediate\pdfobj stream attr {#1}{#2}%
- \xdef\@anim@lastobj{\the\pdflastobj\space 0 R}%
- }
-
- \def\@anim@refobj#1{#1 0 R}
-
- \def\@anim@xform#1#2#3{%#1: not used, #2: not used, #3 boxnum
- \immediate\pdfxform resources {\the\pdfpageresources}#3%
- \xdef\@anim@lastxform{\the\pdflastxform}%
- }
-
- \def\@anim@refxform#1{% #1: xform obj ID
- \rlap{\vbox to \z@{\vss\pdfrefxform#1}}%
- }
-
- \def\@anim@pdfannot#1#2#3#4{%width, height, depth, dict
- \pdfannot width #1\p@ height #2\p@ depth #3\p@ {%
- #4%
- }%
- %since all annots are Widgets
- \xdef\@anim@fields{\@anim@fields\the\pdflastannot\space 0 R\space}%
- }
-
-\else
-
- \newcount\@anim@objnum
- \if@anim@dvipdfmx
- \def\@anim@dictobj#1{%
- \special{pdf:obj @anm@obj\the\@anim@objnum <<#1>>}%
- \xdef\@anim@lastobj{@anm@obj\the\@anim@objnum}%
- \global\advance\@anim@objnum by \@ne%
- }
-
- \def\@anim@streamobj#1#2{% #1 attrs, #2 content
- \special{pdf:stream @anm@obj\the\@anim@objnum\space (#2) <<#1>>}%
- \xdef\@anim@lastobj{@anm@obj\the\@anim@objnum}%
- \global\advance\@anim@objnum by \@ne%
- }
-
- \def\@anim@refobj#1{#1}
-
- \def\@anim@xform#1#2#3{%#1 add. pgf resources ? 1:0, #2 not used, #3 boxnum
- \special{pdf:bxobj @anm@obj\the\@anim@objnum\space
- width \the\wd#3
- height \the\ht#3 depth \the\dp#3}%
- \begin{picture}(0,0)\put(0,0){\box#3}\end{picture}%
- \ifx1#1%
- \ifthenelse{\boolean{@anim@pgfloaded}}{%
- \def\@anim@resources{}%
- \ifthenelse{\boolean{pgf@sys@pdf@extgs@exists}}{%
- \def\@anim@resources{/ExtGState @pgfextgs}}{}%
- \ifthenelse{\boolean{pgf@sys@pdf@patterns@exists}}{%
- \edef\@anim@resources{\@anim@resources/Pattern @pgfpatterns}}{}%
- \ifthenelse{\boolean{pgf@sys@pdf@colorspaces@exists}}{%
- \edef\@anim@resources{%
- \@anim@resources/ColorSpace @pgfcolorspaces}}{}%
- \ifthenelse{%
- \boolean{pgf@sys@pdf@extgs@exists}%
- \OR\boolean{pgf@sys@pdf@patterns@exists}%
- \OR\boolean{pgf@sys@pdf@colorspaces@exists}%
- }{%
- \special{pdf:put @resources <<\@anim@resources>>}%
- }{}%
- }{}%
- \fi%
- \special{pdf:exobj}%
- \xdef\@anim@lastxform{@anm@obj\the\@anim@objnum}%
- \global\advance\@anim@objnum by \@ne%
- }
- \def\@anim@refxform#1{\special{pdf:uxobj #1}}% #1: xform obj ID
-
- \def\@anim@pdfannot#1#2#3#4{%width, height, depth, dict
- \special{pdf:annot @anm@obj\the\@anim@objnum\space
- width #1pt height #2pt
- depth #3pt <<%
- #4%
- >>}%
- \xdef\@anim@fields{\@anim@fields @anm@obj\the\@anim@objnum\space}%
- \global\advance\@anim@objnum by \@ne%
- }
-
- \else % dvips
- \def\@anim@dictobj#1{%
- \special{ps:
- mark /_objdef {@anm@obj\the\@anim@objnum} /type/dict /OBJ pdfmark
- mark {@anm@obj\the\@anim@objnum} <<#1>> /PUT pdfmark
- }%
- \xdef\@anim@lastobj{{@anm@obj\the\@anim@objnum}}%
- \global\advance\@anim@objnum by \@ne%
- }
-
- \def\@anim@streamobj#1#2{%
- \special{ps::[nobreak] %don't break long (strings) at embedded spaces
- mark /_objdef {@anm@obj\the\@anim@objnum} /type/stream /OBJ pdfmark
- mark {@anm@obj\the\@anim@objnum} (#2) /PUT pdfmark
- mark {@anm@obj\the\@anim@objnum} <<#1>> /PUT pdfmark
- }%
- \xdef\@anim@lastobj{{@anm@obj\the\@anim@objnum}}%
- \global\advance\@anim@objnum by \@ne%
- }
-
- \def\@anim@refobj#1{#1}
-
- \def\@anim@xform#1#2#3{%#1 not used, #2 used as appearance ? 1:0, #3 boxnum
- \ifnum\@anim@method=\z@\relax% icon based && dvips kill links in document
- \ifdefined\hypersetup%
- \ifdefined\@anim@icondvipswarned\else%
- \AtEndDocument{%
- \PackageWarningNoLine{animate}{\@anim@icondvipswarning}%
- }%
- \gdef\@anim@icondvipswarned{}%
- \fi%
- \fi%
- \fi%
- \ifnum\@anim@method<\tw@\relax% icon based && widget based
- \ifdefined\@anim@@dpiwarning\else%
- %determine DVI resolution and output warning message if too high
- \AtEndDvi{\special{ps:\@anim@dpiwarning}}%
- \gdef\@anim@@dpiwarning{}%
- \fi%
- \fi%
- \begingroup%
- \setlength{\unitlength}{1pt}%
- \begin{picture}(0,0)%
- %mark BBox of the graphics
- \put(0,-\strip@pt\dp#3){%
- \special{ps:
- currentpoint /frame@lly exch def /frame@llx exch def
- }%
- }%
- \put(\strip@pt\wd#3,\strip@pt\ht#3){%
- \special{ps:
- currentpoint /frame@ury exch def /frame@urx exch def
- }%
- }%
- %define some length values in current PS coordinate units
- \put(0,0){%
- \special{ps:
- currentpoint /origin@y exch def /origin@x exch def
- }%
- }%
- \put(72.27,72.27){%
- \special{ps:
- currentpoint origin@y exch sub /one@inch@y exch def
- origin@x sub /one@inch@x exch def
- }%
- }%
- \end{picture}%
- \endgroup%
- \@anim@newkey{origin:{@anm@obj\the\@anim@objnum}}{origin@\the\@anim@objnum}%
- \special{ps:
- gsave
- %keep a record of lower left corner coordinates
- true setglobal globaldict
- /origin@\the\@anim@objnum [currentpoint] cvx put false setglobal
- %translate graphics to upper left page corner
- \if@anim@powerdot\else%
- {%
- frame@llx neg frame@ury neg translate
- one@inch@x DVImag div neg one@inch@y DVImag div neg translate
- }?pdfmark
- \fi%
- %distill graphics into XObject
- mark
- /_objdef {@anm@obj\the\@anim@objnum}
- /BBox [frame@llx frame@lly frame@urx frame@ury]
- /BP pdfmark
- \ifx1#2% operations needed if used as annotation appearance
- {%
- isls{%landscape mode (powerdot, geometry /w landscape option)
- /frame@dxdy {%
- frame@urx frame@llx sub abs
- frame@ury frame@lly sub abs div%
- } bind def
- /frame@dydx {1 frame@dxdy div} bind def
- /frame@cx {frame@urx frame@llx add 2 div} bind def
- /frame@cy {frame@ury frame@lly add 2 div} bind def
- % graphics needs to be rescaled for some reason ...
- [frame@dxdy 0 0 frame@dydx 1 frame@dxdy sub frame@cx mul
- 1 frame@dydx sub frame@cy mul] concat
- %... rotated by 270 degrees ...
- [0 -1 1 0 frame@cx frame@cy sub frame@cx frame@cy add] concat
- %... and flipped around vertical axis
- [-1 0 0 1 frame@llx frame@urx add 0] concat%
- }{% flip around horizontal axis in portrait mode
- [1 0 0 -1 0 frame@lly frame@ury add] concat%
- }ifelse
- }?pdfmark
- \fi%
- }%
- \begin{picture}(0,0)\put(0,0){\box#3}\end{picture}%
- \special{ps:
- mark /EP pdfmark
- grestore%
- }%
- \xdef\@anim@lastxform{{@anm@obj\the\@anim@objnum}}%
- \global\advance\@anim@objnum by \@ne%
- }
- \def\@anim@refxform#1{% #1: xform obj ID
- \special{ps:
- gsave
- currentpoint pop \@anim@getkeyval{origin:#1} pop sub
- currentpoint exch pop \@anim@getkeyval{origin:#1} exch pop sub translate
- mark #1 /SP pdfmark
- grestore
- }%
- }
-
- \def\@anim@pdfannot#1#2#3#4{%width, height, depth, dict
- \begingroup%
- \setlength{\unitlength}{1pt}%
- \begin{picture}(0,0)% mark annotation rectangle
- \put(0,-#3){%
- \special{ps:
- currentpoint /wid@lly exch def /wid@llx exch def
- }%
- }%
- \put(#1,#2){%
- \special{ps:
- currentpoint /wid@ury exch def /wid@urx exch def
- }%
- }%
- \end{picture}%
- \endgroup%
- \special{ps:
- mark
- /_objdef {@anm@obj\the\@anim@objnum}%
- /Rect [wid@llx wid@lly wid@urx wid@ury]%
- #4%
- /ANN pdfmark
- }%
- \xdef\@anim@fields{\@anim@fields{@anm@obj\the\@anim@objnum}\space}%
- \global\advance\@anim@objnum by \@ne%
- }
- \fi
-\fi
-
%creates Form XObject from box contents
\def\@anim@xinline#1#2#3#4{%
- \edef\@anim@curwd{\strip@pt\wd#3}%
- \edef\@anim@curht{\strip@pt\ht#3}%
- \edef\@anim@curdp{\strip@pt\dp#3}%
+ \edef\@anim@curwd{\the\wd#3}%
+ \edef\@anim@curht{\the\ht#3}%
+ \edef\@anim@curdp{\the\dp#3}%
\ifnum#2=\z@\relax%
%nat. dims of zeroth frame
\xdef\@anim@zframewd{\@anim@curwd}%
@@ -701,9 +398,9 @@
\@anim@scale{\@anim@measbox}%
\else%
\def\@anim@needresize{0}%
- \ifdim\wd#3=\@anim@zframewd\p@\else\def\@anim@needresize{1}\fi%
- \ifdim\ht#3=\@anim@zframeht\p@\else\def\@anim@needresize{1}\fi%
- \ifdim\dp#3=\@anim@zframedp\p@\else\def\@anim@needresize{1}\fi%
+ \ifdim\wd#3=\@anim@zframewd\else\def\@anim@needresize{1}\fi%
+ \ifdim\ht#3=\@anim@zframeht\else\def\@anim@needresize{1}\fi%
+ \ifdim\dp#3=\@anim@zframedp\else\def\@anim@needresize{1}\fi%
\fi%
%create form xobject from box argument
\ifthenelse{\equal{#4}{!}}{% %%%% new graphics %%%%
@@ -718,15 +415,15 @@
\ifnum#2>\z@\relax%
%adjust size of current frame to zeroth frame's dims, if necessary
\ifnum\@anim@needresize>\z@\relax%
- \global\setbox#3=\hbox to \@anim@curwd\p@{%
- \vrule width \z@ height \@anim@curht\p@ depth \@anim@curdp\p@%
+ \global\setbox#3=\hbox to \@anim@curwd{%
+ \vrule width \z@ height \@anim@curht depth \@anim@curdp%
\@anim@refxform{\@anim@lastxform}%
\hss%
}%
\global\setbox#3=\hbox{%
- \raisebox{-\@anim@zframedp\p@}{%
- \resizebox*{\@anim@zframewd\p@}{%
- \dimexpr\@anim@zframeht\p@+\@anim@zframedp\p@\relax%
+ \raisebox{-\@anim@zframedp}{%
+ \resizebox*{\@anim@zframewd}{%
+ \dimexpr\@anim@zframeht+\@anim@zframedp\relax%
}{\raisebox{\depth}{\box#3}}%
}%
}%
@@ -743,12 +440,6 @@
\fi%
}
-%creates OCG (ocgbase.sty)
-\def\@anim@newocg#1#2{%#1:@anim@num, #2:@anim@curframe@zb
- \ocgbase@new@ocg{#1.#2}{}{1}%
- \xdef\@anim@curocg{\ocgbase@last@ocg}%
-}
-
%inserts one animation frame into the output acc. to
% \ifcase\@anim@method as
% 0: Form XObject (not referenced in the page content stream)
@@ -757,8 +448,8 @@
% animation
\def\@anim@makeframe#1#2{%
%container box
- \global\setbox\@anim@box=\hbox to \@anim@zframewd\p@{%
- \vrule width \z@ height \@anim@zframeht\p@ depth \@anim@zframedp\p@%
+ \global\setbox\@anim@box=\hbox to \@anim@zframewd{%
+ \vrule width \z@ height \@anim@zframeht depth \@anim@zframedp%
\@anim@getkeyval{frmcontent@#2}%
\hss%
}%
@@ -777,8 +468,7 @@
%build appearance name tree
\xdef\@anim@appearances{%
\@anim@appearances
- (\@anim@pad{1234}{#1}.\@anim@pad{1234}{#2})
- \@anim@refobj{\@anim@lastxform}%
+ (\@anim@pad{1234}{#1}.\@anim@pad{1234}{#2}) \@anim@lastxform%
}%
\or% widget based
%initial visibility
@@ -804,8 +494,8 @@
\@anim@annotflag%
/FT/Btn/Ff 65537%
/BS <</W 0>>%
- /AP <</N \@anim@refobj{\@anim@lastxform}>>%
- /MK <</TP 1/I \@anim@refobj{\@anim@lastxform}/IF<</S/A/FB true>>>>%
+ /AP <</N \@anim@lastxform>>%
+ /MK <</TP 1/I \@anim@lastxform/IF<</S/A/FB true>>>>%
/T (#1.#2)%
\ifdefined\ocgxii@insert@OC\ocgxii@insert@OC\fi%
}%
@@ -825,17 +515,17 @@
\fi%
\fi%
\def\@anim@needresize{0}%
- \ifdim\@anim@animwidth\p@=\@anim@zframewd\p@\else%
+ \ifdim\@anim@animwidth=\@anim@zframewd\else%
\def\@anim@needresize{1}\fi%
- \ifdim\@anim@animheight\p@=\@anim@zframeht\p@\else%
+ \ifdim\@anim@animheight=\@anim@zframeht\else%
\def\@anim@needresize{1}\fi%
- \ifdim\@anim@animdepth\p@=\@anim@zframedp\p@\else%
+ \ifdim\@anim@animdepth=\@anim@zframedp\else%
\def\@anim@needresize{1}\fi%
\ifnum\@anim@needresize>\z@\relax%
\global\setbox\@anim@box=\hbox{%
- \raisebox{-\@anim@animdepth\p@}{%
- \resizebox*{\@anim@animwidth\p@}{%
- \dimexpr\@anim@animheight\p@+\@anim@animdepth\p@\relax%
+ \raisebox{-\@anim@animdepth}{%
+ \resizebox*{\@anim@animwidth}{%
+ \dimexpr\@anim@animheight+\@anim@animdepth\relax%
}{\raisebox{\depth}{\box\@anim@box}}%
}%
}%
@@ -1059,6 +749,7 @@
\@anim@xbutton{StepLeft}{[-1 0 0 1 15 0] concat \@anim@btnstep}{#1}%
\@anim@xbutton{StepRight}{\@anim@btnstep}{#1}%
}
+ \newcount\@anim@objnum
\def\@anim@xbutton#1#2#3{% #1: name; #2: stroking commands, #3 @anim@num
\special{ps:
gsave [1 0 0 1 0 0] setmatrix
@@ -1076,9 +767,8 @@
}?pdfmark mark /EP pdfmark
grestore
}%
- \xdef\@anim@lastobj{{@anm@obj\the\@anim@objnum}}%
+ \@anim@newkey{btn#1:#3}{{@anm@obj\the\@anim@objnum}}%
\global\advance\@anim@objnum by \@ne%
- \@anim@newkey{btn#1:#3}{\@anim@lastobj}%
}
\else %pdftex/dvipdfmx/xetex
%stroking commands
@@ -1458,7 +1148,7 @@
\vtop{% draw boxes
\offinterlineskip%
\hbox{%
- \raisebox{-\@anim@animdepth\p@}{%
+ \raisebox{-\@anim@animdepth}{%
\begin{picture}(\@anim@animwidth,\@anim@animtotalheight)%
\put(0,0){\framebox(\@anim@animwidth,\@anim@animtotalheight){}}%
\end{picture}%
@@ -1467,7 +1157,7 @@
\if@anim@controls%
\setlength{\@anim@tmpdima}{\@anim@btnsize}%
\vskip 0.1\@anim@tmpdima%
- \hbox to \@anim@animwidth\p@ {%
+ \hbox to \@anim@animwidth {%
\hss%
\setlength{\@anim@tmpdimb}{2\@anim@tmpdima}%
\begin{picture}(\strip@pt\@anim@tmpdimb,\strip@pt\@anim@tmpdima)%
@@ -1769,7 +1459,7 @@
\if@anim@controls%
\setlength{\@anim@tmpdima}{\@anim@btnsize}%
\vskip 0.1\@anim@tmpdima%
- \hbox to \@anim@animwidth\p@ {%
+ \hbox to \@anim@animwidth {%
\hss%
\def\@anim@tooltip{}%
\@anim@buttonwidget{#1}{EndLeft}{EndLeft:#2}%
@@ -1811,9 +1501,9 @@
\let\totalheight\@anim@tmpdimb%
\setlength{\totalheight}{\dimexpr\height+\depth\relax}%
%evaluate resizing options
- \xdef\@anim@animwidth{\strip@pt\dimexpr\@anim@widtharg\relax}%
- \xdef\@anim@animheight{\strip@pt\dimexpr\@anim@heightarg\relax}%
- \xdef\@anim@animtotalheight{\strip@pt\dimexpr\@anim@totheightarg\relax}%
+ \xdef\@anim@animwidth{\the\dimexpr\@anim@widtharg\relax}%
+ \xdef\@anim@animheight{\the\dimexpr\@anim@heightarg\relax}%
+ \xdef\@anim@animtotalheight{\the\dimexpr\@anim@totheightarg\relax}%
\endgroup%
%correct wrong option combination; totalheight overrides height
\ifnum\@anim@resizeflags=3\relax% height+totalheight->totalheight
@@ -1825,42 +1515,42 @@
%now resize
\ifcase\@anim@resizeflags% bit 2^2=width, 2^1=height, 2^0=totalhight given
\or% 1
- \global\setbox#1=\hbox{\resizebox*{!}{\@anim@animtotalheight\p@}{\box#1}}%
+ \global\setbox#1=\hbox{\resizebox*{!}{\@anim@animtotalheight}{\box#1}}%
\or% 2
- \global\setbox#1=\hbox{\resizebox{!}{\@anim@animheight\p@}{\box#1}}%
+ \global\setbox#1=\hbox{\resizebox{!}{\@anim@animheight}{\box#1}}%
\or\or% 4
- \global\setbox#1=\hbox{\resizebox{\@anim@animwidth\p@}{!}{\box#1}}%
+ \global\setbox#1=\hbox{\resizebox{\@anim@animwidth}{!}{\box#1}}%
\or% 5
\if@anim@iso%
\setlength{\@anim@tmpdima}{%
- \totalheightof{\usebox#1}*\ratio{\@anim@animwidth\p@}{\wd#1}}%
+ \totalheightof{\usebox#1}*\ratio{\@anim@animwidth}{\wd#1}}%
\ifdim\@anim@tmpdima<\z@\@anim@tmpdima=-\@anim@tmpdima\fi%
- \setlength{\@anim@tmpdimb}{\@anim@animtotalheight\p@}%
+ \setlength{\@anim@tmpdimb}{\@anim@animtotalheight}%
\ifdim\@anim@tmpdimb<\z@\@anim@tmpdimb=-\@anim@tmpdimb\fi%
\ifdim\@anim@tmpdima<\@anim@tmpdimb%
- \global\setbox#1=\hbox{\resizebox*{\@anim@animwidth\p@}{!}{\box#1}}%
+ \global\setbox#1=\hbox{\resizebox*{\@anim@animwidth}{!}{\box#1}}%
\else%
\global\setbox#1=\hbox{%
- \resizebox*{!}{\@anim@animtotalheight\p@}{\box#1}}%
+ \resizebox*{!}{\@anim@animtotalheight}{\box#1}}%
\fi%
\else%
\global\setbox#1=\hbox{%
- \resizebox*{\@anim@animwidth\p@}{\@anim@totheightarg}{\box#1}}%
+ \resizebox*{\@anim@animwidth}{\@anim@totheightarg}{\box#1}}%
\fi%
\or% 6
\if@anim@iso%
- \setlength{\@anim@tmpdima}{\ht#1*\ratio{\@anim@animwidth\p@}{\wd#1}}%
+ \setlength{\@anim@tmpdima}{\ht#1*\ratio{\@anim@animwidth}{\wd#1}}%
\ifdim\@anim@tmpdima<\z@\@anim@tmpdima=-\@anim@tmpdima\fi%
- \setlength{\@anim@tmpdimb}{\@anim@animheight\p@}%
+ \setlength{\@anim@tmpdimb}{\@anim@animheight}%
\ifdim\@anim@tmpdimb<\z@\@anim@tmpdimb=-\@anim@tmpdimb\fi%
\ifdim\@anim@tmpdima<\@anim@tmpdimb%
- \global\setbox#1=\hbox{\resizebox{\@anim@animwidth\p@}{!}{\box#1}}%
+ \global\setbox#1=\hbox{\resizebox{\@anim@animwidth}{!}{\box#1}}%
\else%
- \global\setbox#1=\hbox{\resizebox{!}{\@anim@animheight\p@}{\box#1}}%
+ \global\setbox#1=\hbox{\resizebox{!}{\@anim@animheight}{\box#1}}%
\fi%
\else%
\global\setbox#1=\hbox{%
- \resizebox{\@anim@animwidth\p@}{\@anim@animheight\p@}{\box#1}}%
+ \resizebox{\@anim@animwidth}{\@anim@animheight}{\box#1}}%
\fi%
\fi%
%apply scale
@@ -1868,10 +1558,10 @@
\global\setbox#1=\hbox{\scalebox{\@anim@boxscale}{\box#1}}%
\fi%
%dimensions after resizing
- \xdef\@anim@animwidth{\strip@pt\wd#1}%
- \xdef\@anim@animheight{\strip@pt\ht#1}%
- \xdef\@anim@animdepth{\strip@pt\dp#1}%
- \xdef\@anim@animtotalheight{\strip@pt\dimexpr\ht#1+\dp#1\relax}%
+ \xdef\@anim@animwidth{\the\wd#1}%
+ \xdef\@anim@animheight{\the\ht#1}%
+ \xdef\@anim@animdepth{\the\dp#1}%
+ \xdef\@anim@animtotalheight{\the\dimexpr\ht#1+\dp#1\relax}%
}
%interactive Widget annotation serving as animation frame container / that is
@@ -1897,14 +1587,13 @@
\@anim@xform{0}{0}{\@anim@box}%
\xdef\@anim@apdummy{\@anim@lastxform}%
\xdef\@anim@appearances{%
- (0000)
- \@anim@refobj{\@anim@lastxform}
+ (0000) \@anim@lastxform
\@anim@appearances%
}%
\fi%
- \def\@anim@apmk{\@anim@refobj{\@anim@apdummy}}%
+ \def\@anim@apmk{\@anim@apdummy}%
\else%
- \def\@anim@apmk{\@anim@refobj{\@anim@posterap}}%
+ \def\@anim@apmk{\@anim@posterap}%
\fi%
\else%
\ifdefined\@anim@apdummy\else% empty appearance dummy
@@ -1912,7 +1601,7 @@
\@anim@xform{0}{0}{\@anim@box}%
\xdef\@anim@apdummy{\@anim@lastxform}%
\fi%
- \def\@anim@apmk{\@anim@refobj{\@anim@apdummy}}%
+ \def\@anim@apmk{\@anim@apdummy}%
\fi%
%With icon and ocg method, we put one dummy widget below; this seems to be
%necessary for the OCG visibility referenced by the /OC entry to work as
@@ -1945,8 +1634,8 @@
/MK <</TP 1/I \@anim@apmk/IF<</S/A/FB true>>>>%
\ifdefined\ocgxii@insert@OC\ocgxii@insert@OC\fi%
}%
- \hbox to \@anim@animwidth\p@ {%
- \vrule width 0pt height \@anim@animheight\p@ depth \@anim@animdepth\p@%
+ \hbox to \@anim@animwidth {%
+ \vrule width 0pt height \@anim@animheight depth \@anim@animdepth%
\hss%
}%
}
@@ -1980,12 +1669,12 @@
\setlength{\@anim@tmpdima}{\@anim@btnsize}%
\ifdefined\ocgxii@insert@OC% put dummy widget below (for ocgx2 compatibility)
\ifthenelse{\equal{\ocgxii@insert@OC}{}}{}{%
- \@anim@pdfannot{\strip@pt\@anim@tmpdima}{\strip@pt\@anim@tmpdima}{0}{%
+ \@anim@pdfannot{\@anim@tmpdima}{\@anim@tmpdima}{\z@}{%
/Subtype/Widget/F 2%
}%
}%
\fi%
- \@anim@pdfannot{\strip@pt\@anim@tmpdima}{\strip@pt\@anim@tmpdima}{0}{%
+ \@anim@pdfannot{\@anim@tmpdima}{\@anim@tmpdima}{\z@}{%
/Subtype/Widget%
\@anim@annotflag%
/FT/Btn/Ff \if@anim@js 65536\else 65537\fi%
@@ -1995,8 +1684,8 @@
/AP <</N \@anim@getkeyval{btn#3}>>%
/MK <</TP 1/I \@anim@getkeyval{btn#3}/IF<</S/A/FB true>>>>%
\else%
- /AP <</N \@anim@refobj{\@anim@apdummy}>>%
- /MK <</TP 1/I \@anim@refobj{\@anim@apdummy}/IF<</S/A/FB true>>>>%
+ /AP <</N \@anim@apdummy>>%
+ /MK <</TP 1/I \@anim@apdummy/IF<</S/A/FB true>>>>%
\fi%
/T (#1.#2)%
\@anim@tooltip%
@@ -2364,12 +2053,12 @@
\begingroup\catcode`\_=13\let_\space
\xdef\@anim@nusewarning{%
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak%
- @_There_were_unused_animation_transparencies._______@\MessageBreak%
- @_See_the_transcript_file___________________________@\MessageBreak%
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak%
+ @_There_were_unused_animation_transparencies._____@\MessageBreak%
+ @_See_the_transcript_file_________________________@\MessageBreak%
@___``\jobname.log''\MessageBreak%
- @_for_additional_information!_______________________@\MessageBreak%
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%
+ @_for_additional_information!_____________________@\MessageBreak%
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%
}
\xdef\@anim@icondvipswarning{%
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak%
@@ -3767,6 +3456,7 @@
)>>%
}%
}
+
%actions for control buttons
\def\@anim@upjscript#1#2{%
\def\@anim@action{#2}%