%%
%% This is file `fldigigal.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% fldigigal.dtx  (with options: `copyright,package')
%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% fldigigal.sty package,             2010-23-10        %%
%% Copyright (C) 2010  D. P. Story                      %%
%%   dpstory@uakron.edu                                 %%
%%                                                      %%
%% This program can redistributed and/or modified under %%
%% the terms of the LaTeX Project Public License        %%
%% Distributed from CTAN archives in directory          %%
%% macros/latex/base/lppl.txt; either version 1 of the  %%
%% License, or (at your option) any later version.      %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}[1997/12/01]
\ProvidesPackage{fldigigal}
 [2010/12/29 v0.5c fldigigal: Create a Flash Digital Gallery, Acrobat Distiller only (dps)]
\RequirePackage{xkeyval}
\RequirePackage{rmannot}[2010/12/22]
\newcommand{\fdgFolder}{C:/Users/Public/Documents/My TeX Files/%
    tex/latex/aeb/aebpro/fldigigal/swf}
\InputIfFileExists{fldigigal.cfg}{}{}
\def\fdg@namegdef#1{\expandafter\gdef\csname #1\endcsname}
\def\fdg@namexdef#1{\expandafter\xdef\csname #1\endcsname}
{\catcode`\#=12 \catcode`\&=12 \catcode`\!=6
    \gdef\fdg@iso!1{&#!1;}
}
\define@key{fdgxml}{path}[]{\def\fdg@pa@path{#1}}
\define@key{fdgxml}{caption}[]{\def\fdg@pa@caption{#1}}
\define@boolkey{fdgxml}{online}[true]{}
\setkeys{fdgxml}{path,caption,online=false}
\newcount\cntdigis
\def\fdg@cnt@images#1{\advance\cntdigis1 }
\def\fdg@image#1{\begingroup
    \let\Name\rma@resource\let\urlName\rma@urlresource
    \setkeys{fdgxml}{#1}%
    \global\advance\cntdigis1
    \edef\@digiImgName{Im\the\cntdigis(\fdg@CurrDigiName)}%
    \saveNamedPath{\@digiImgName}{\fdg@pa@path}%
    \edef\fdg@NamedExp{\expandafter\Name\expandafter{\@digiImgName}}%
    \ifx\fdg@pa@caption\@empty\def\fdg@pa@caption{\fdg@NamedExp}\fi
    \ifKV@fdgxml@online
        \edef\fdg@urlNamedExp{%
            \expandafter\urlName\expandafter{\@digiImgName}}%
        \fdg@IWVO{\space\space\space\space
        <image title='\fdg@pa@caption\fdg@cntOf{\the\cntdigis}'>%
            \fdg@urlNamedExp</image>
        }%
    \else
        \toks0=\expandafter{\fdg@embededResources}%
        \ifx\fdg@embededResources\@empty
            \xdef\fdg@embededResources{\@digiImgName}\else
            \xdef\fdg@embededResources{\the\toks0,\@digiImgName}\fi
        \fdg@IWVO{\space\space\space\space
        <image title='\fdg@pa@caption\fdg@cntOf{\the\cntdigis}'>%
            \fdg@NamedExp</image>
        }%
    \fi
\endgroup}
\def\fdg@IWVO{\immediate\write\verbatim@out}
\def\embededResources#1{\csname #1ERs\endcsname}
\def\xmlListiv#1{xmlList4#1}
\let\fdg@cntOf\@gobble
\newcommand{\fdgcntOf}[1]{\space(#1 of \fdg@numDigis)}
\define@boolkey{fdgXML}{showcount}[true]{%
    \ifKV@fdgXML@showcount\let\fdg@cntOf\fdgcntOf\else
    \let\fdg@cntOf\@gobble\fi
}
\define@boolkey{fdgXML}{nowrite}[true]{}
\setkeys{fdgXML}{showcount=false,nowrite=false}
\newcommand{\fdgXmlList}[3][]{%
\begingroup
    \setkeys{fdgXML}{#1}%
    \ifKV@fdgXML@nowrite\let\fdg@IWVO\@gobble\fi
    \cntdigis=0 \gdef\fdg@embededResources{}%
    \ifKV@fdgXML@nowrite\else
        \newwrite \fdg@writexmllist
        \immediate\openout \fdg@writexmllist=#2.xml
        \let\verbatim@out\fdg@writexmllist
    \fi
    \fdg@IWVO{<photos>}%
    \@ifundefined{#2@fdgdigis}{%
        \fdg@namegdef{#2@fdgdigis}{#2}%
        \def\fdg@CurrDigiName{#2}%
    }{\PackageError{fldigigal}{Name already chosen}}%
    \let\image\fdg@cnt@images#3%
    \edef\fdg@numDigis{\the\cntdigis}%
    \def\'{&apos;}\let\iso\fdg@iso
    \cntdigis=0 \let\image\fdg@image#3%
    \fdg@IWVO{</photos>}%
    \ifKV@fdgXML@nowrite\else
        \immediate\closeout \fdg@writexmllist
    \fi
\endgroup
    \saveNamedPath{xmlList4#2}{\pathToSource/#2.xml}%
    \fdg@namexdef{#2ERs}{\ifx\fdg@embededResources\@empty\else,\fi
        \fdg@embededResources}%
}
\@onlypreamble{\fdgXmlList}
\define@key{fgRmAnnot}{flashvars}[]{\def\fgRmAnnot@flashvars{&#1}}
\let\fgRmAnnot@flashvars\@empty
\define@key{fgRmAnnot}{galleryopts}[]{\def\fgRmAnnot@galleryopts{#1}}
\saveNamedPath{fdg_vt1}{\fdgFolder/fdg_vt1.swf}
\saveNamedPath{fdg_ht1}{\fdgFolder/fdg_ht1.swf}
\saveNamedPath{fdg_nt1}{\fdgFolder/fdg_nt1.swf}
\saveNamedPath{custom}{\fdgFolder/fdg_vt1.swf}
\define@choicekey+{fgGalleryOpts}{gallery}[\val\nr]%
    {vthumbs1,hthumbs1,nothumbs1,custom}[vthumbs1]{%
    \ifcase\nr\relax
        \def\fgGalleryOpts@gallery{fdg_vt1}\or
        \def\fgGalleryOpts@gallery{fdg_ht1}\or
        \def\fgGalleryOpts@gallery{fdg_nt1}\or
        \def\fgGalleryOpts@gallery{custom}\fi
}{}
\define@choicekey+{fgGalleryOpts}{trans}[\val\nr]%
    {Blinds,Fade,Fly,Iris,Photo,PixelDissolve,Rotate,%
    Squeeze,Wipe,Zoom,Random}[Random]{%
        \edef\fgGalleryOpts@trans{\val}%
}{}
\let\fgGalleryOpts@trans\@empty
\define@key{fgGalleryOpts}{delay}[6]{\def\fgGalleryOpts@delay{#1}}
\let\fgGalleryOpts@delay\@empty
\define@boolkey{fgGalleryOpts}{auto}[true]{%
    \edef\fgGalleryOpts@auto{\ifKV@fgGalleryOpts@auto
        true\else false\fi}}
\define@boolkey{fgGalleryOpts}{transOn}[true]{%
    \edef\fgGalleryOpts@transOn{\ifKV@fgGalleryOpts@transOn
        true\else false\fi}}
\define@choicekey+{fgGalleryOpts}{captionalign}[\val\nr]%
    {left,right,center}[left]{%
        \edef\fgGalleryOpts@captionalign{\val}%
}{}
\let\fgGalleryOpts@captionalign\@empty
\define@boolkey{fgGalleryOpts}{nocaptions}[true]{%
    \edef\fgGalleryOpts@nocaptions{\ifKV@fgGalleryOpts@nocaptions
        true\else false\fi}}
\define@key{fgGalleryOpts}{nocaptionstext}[]{%
    \def\fgGalleryOpts@nocaptionstext{#1}}
\setkeys{fgGalleryOpts}{gallery,transOn,auto=true,nocaptions=false,nocaptionstext}
\newcommand{\fgRmAnnot}[2][]{\begingroup
    \@ifundefined{#2@fdgdigis}%
    {\PackageError{fldigigal}{The name `#2' is not defined
    for\MessageBreak this \string\fgRmAnnot}{Gallery names
    are defined using \string\fdgXmlList}}%
    \setkeys*{fgRmAnnot}{#1}\edef\XKV@rm@saved{\XKV@rm}%
    \edef\tmp@setkeysEx{\noexpand\setkeys{fgGalleryOpts}%
        {\fgRmAnnot@galleryopts}}\tmp@setkeysEx
    \edef\merged@flashvars{\fgRmAnnot@flashvars%
        \ifKV@fgGalleryOpts@auto\else&%
        auto=\fgGalleryOpts@auto\fi
        \ifx\fgGalleryOpts@delay\@empty\else&%
        delay=\fgGalleryOpts@delay\fi
        \ifx\fgGalleryOpts@trans\@empty\else&%
        transitionType=\fgGalleryOpts@trans\fi
        \ifKV@fgGalleryOpts@transOn\else&%
        transitionOn=\fgGalleryOpts@transOn\fi
        \ifx\fgGalleryOpts@captionalign\@empty\else&%
        captionalign=\fgGalleryOpts@captionalign\fi
        \ifKV@fgGalleryOpts@nocaptions&%
        nocaptions=\fgGalleryOpts@nocaptions%
        \ifx\gGalleryOpts@nocaptionstext\@empty\else&%
        nocaptionstext=\fgGalleryOpts@nocaptionstext\fi\fi
    }%
    \rmAnnot[\XKV@rm@saved,
    flashvars={xmlPath=\Name{\xmlListiv{#2}}\merged@flashvars},%
    resources={\xmlListiv{#2}\embededResources{#2}}%
    ]{320bp}{240bp}{\fgGalleryOpts@gallery}%
    \endgroup
}
\endinput
%%
%% End of file `fldigigal.sty'.
