%
%
% present-transitions.tex
%
% Author: Matthias Meister (tex@flamma-mentis.eu)
% Version 1.0, April 2012
%
% This file is part of a work distributed under the LaTeX Project Public License.
% The macros in this file are a supplement to the macros in present.tex.
%
\catcode`\@=11
\let\simplelink=\link
\let\simplelinkarea=\linkarea
\let\simplepagelink=\pagelink

\def\Tr@ns{Push}
\def\D@r{2}

\def\tl@nk#1#2{%
\pdfstartlink attr {/Border [0 0 0]} user {/Subtype /Link /A <</S /GoTo /D /#1 /Next <</S /Trans /Trans << /S /\Tr@ns /D \D@r >> >> >>}#2%
\pdfendlink}

\def\tl@nkarea#1#2#3#4{%
\pdfannot{%
/Subtype /Link
/Rect [#2]
/Border [0 0 #3]
/C [#4]
/A << /S /GoTo /D (#1) /Next << /S /Trans /Trans << /S /\Tr@ns /D \D@r >> >> >>}}

\def\tpagel@nk#1#2{%
\pdfstartlink    
attr {/Border [0 0 0]} user {/Subtype /Link /A <</S /Named /N /#1 /Next << /S /Trans /Trans << /S /\Tr@ns /D \D@r>> >> >>}%
#2%
\pdfendlink}

\def\NoTrans{%
\global\let\link=\simplelink
\global\let\pagelink=\simplepagelink
\global\let\linkarea=\simplelinkarea
}

\def\UseTrans{%
\global\let\link=\tl@nk
\global\let\pagelink=\tpagel@nk
\global\let\linkarea=\tl@nkarea
}

\def\SetDuration#1{\gdef\D@r{#1}}
\def\SetTrans#1{\gdef\Tr@ns{#1}}

\NoTrans
\catcode`\@=12
