%% xymovie.tex from $Id: xymovie.doc,v 3.5 1997/05/28 13:05:01 krisrose Exp $
%%
%% Xy-pic ``Movie Storyboard extension'' option.
%% Copyright (c) 1996-1997 Kristoffer H. Rose <krisrose@brics.dk>
%%
%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
%% See the companion README and INSTALL files for further information.
%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
%%
%% The Xy-pic package is free software; you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published by the
%% Free Software Foundation; either version 2 of the License, or (at your
%% option) any later version.
%%
%% The Xy-pic package is distributed in the hope that it will be useful, but
%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
%% for more details.
%%
%% You should have received a copy of the GNU General Public License along
%% with this package; if not, write to the Free Software Foundation, Inc.,
%% 675 Mass Ave, Cambridge, MA 02139, USA.
%%
\ifx\xyloaded\undefined \input xy \fi
\xyprovide{movie}{Movie Storyboard extension}{\stripRCS$Revision: 3.5 $}%
 {Kristoffer H.~Rose}{krisrose@brics.dk}%
 {BRICS/Computer Science, University of Aarhus, Ny Munkegade, building 540,
 DK--8000 Aarhus~C}
\xynew@{dimen}\m@height
\xynew@{dimen}\m@width
\xydef@\extractparameterm@#1#2#3{%
 \DN@##1,#1=##2,##3@{\csname m@#1\endcsname=##2\relax}%
 \next@,#2,#3,@}
\xydef@\MovieSetup#1{%
 \extractparameterm@{height}{#1}{height=2in}%
 \extractparameterm@{width}{#1}{width=2in}%
}
\xydef@\theScene{0}
\xydef@\theF{0}
\xydef@\theFr{1}
\xydef@\F#1{#1(0)}
\xydef@\Fr#1{#1(1)}
\xynew@{if}\iflastframe@
\xynew@{count}\m@scene
\xydef@\scene{\advance\m@scene\@ne
 \DN@{\ifx*\next \lastframe@true \DN@*{\xyFN@\scene@}%
 \else \let\next@=\scene@ \fi \next@}%
 \xyFN@\next@}
\xydef@\scene@{%
 \ifx[\next \DN@[##1]{\scene@i}\else \let\next@=\scene@i \fi \next@}
\long\def\scene@i#1{{%
 \def\caption##1{\gdef\m@caption{Scene \the\m@scene. ##1}}%
 \edef\theScene{\the\m@scene}%
 \def\theF{0}\def\theFr{1}%
 \def\F##1{##1(0)}\def\Fr##1{##1(1)}%
 \scene@frame{#1}%
 \iflastframe@
 \def\caption##1{}%
 \gdef\m@caption{The End.}%
 \def\theF{1}\def\theFr{0}%
 \def\F##1{##1(1)}\def\Fr##1{##1(0)}%
 \scene@frame{#1}%
 \fi
 }\ignorespaces}
\def\scene@frame#1{\vbox{\null
 \dimen@=\m@width \advance\dimen@2\xydashw@
 \hrule width\dimen@
 \hbox to\dimen@{\vrule width\xydashw@ \hss
 \vbox to\m@height{\hsize=\m@width \null\vfil{#1}\vfil\null}%
 \hss \vrule width\xydashw@}%
 \hrule width\dimen@
 \setbox0=\hbox{%
 \setbox0=\hbox to\m@width{\hss\strut \m@caption\hss}%
 \dimen0=\dp0 \ht0=0pt \dp0=0pt \raise\dimen0\box0}%
 \ht0=0pt \dp0=0pt \box0\relax
 \null}}
\xyendinput
