%D \module
%D   [      file=simpleslides-s-Shaded,
%D        version=2009.03.30
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Module --- Shaded style,
%D         author=Aditya Mahajan and Thomas A. Schmitz,
%D           date=\currentdate,
%D      copyright={Aditya Mahajan and Thomas A. Schmitz}]
%C
%C Copyright 2007 Aditya Mahajan and Thomas A. Schmitz
%C This file may be distributed under the GNU General Public License v. 2.0.

%D This file provides the \quotation{Shaded} style for the presentation
%D module. It is loaded at runtime. 

\writestatus{simpleslides}{loading Shaded style}

\startmodule[simpleslides-s-Shaded]

\unprotect

%D The page layout:

\setuplayout [simpleslides:layout:horizontal]
             [width=fit,
              margin=1.5cm,
              leftmargindistance=0pt,
              rightmargindistance=0pt,
              height=fit, 
              header=0pt, 
              footer=0pt, 
              topspace=.8cm, 
              backspace=1.5cm,
              bottomspace=1cm,
              bottom=1cm,
              location=singlesided]

\setuplayout [simpleslides:layout:title]
             [bottomspace=0pt]

%D These macros are used for placing figures/pictures:

\define\NormalHeight        {.88\textheight}
\define\NormalWidth         {.476\textwidth}
\define\PictureFrameHeight  {.88\textheight}
\define\PictureFrameWidth   {.476\textwidth}

%D This module has three color schemes, blue, green and bluered.

\startsetups simpleslides:setups:bluered
\definecolor [simpleslides:textcolor]         [white]
\definecolor [simpleslides:interactioncolor]  [b=.2]
\definecolor [simpleslides:contrastcolor]     [b=.8]
\definecolor [simpleslides:itemize:color]     [s=1]
\definecolor [simpleslides:backgroundcolor]    [r=0.5,g=0,b=0]
\definecolor [simpleslides:variantcolor]       [r=0,g=0,b=0.5]
\stopsetups

\startsetups simpleslides:setups:blue
\definecolor [simpleslides:textcolor]         [white]
\definecolor [simpleslides:interactioncolor]  [b=.2]
\definecolor [simpleslides:contrastcolor]     [r=.72,g=.77,b=.94]
\definecolor [simpleslides:itemize:color]     [s=1]
\definecolor [simpleslides:backgroundcolor]    [r=0,g=0,b=1]
\definecolor [simpleslides:variantcolor]       [r=0,g=0,b=0.05]
\stopsetups

\startsetups simpleslides:setups:green
\definecolor [simpleslides:textcolor]         [white]
\definecolor [simpleslides:interactioncolor]  [s=.2]
\definecolor [simpleslides:contrastcolor]     [s=.5]
\definecolor [simpleslides:itemize:color]     [s=1]
\definecolor [simpleslides:backgroundcolor]    [r=0,g=.8,b=0]
\definecolor [simpleslides:variantcolor]       [r=0,g=0.05,b=0]
\stopsetups

%D Now we choose the scheme that the user asked for

\setups{simpleslides:setups:blue}
\setups{simpleslides:setups:\moduleparameter{simpleslides}{color}}

\setupcolors[textcolor={simpleslides:textcolor}]

\definevisualcounter
  [simpleslides:shadedcounter]
  [markers]
  [counter=userpage,
%   distance=0.5cm,
   distance={(\the\dimexpr\visualcounterparameter{maxwidth})/m + width},
   path=unitcircle,
   maxwidth=\textwidth,
   width=0.3cm]

\definepalet[visualcounter:markers]
            [active=blue, %simpleslides:interactioncolor, % not enough contrast
	     future=simpleslides:contrastcolor,
	       past=simpleslides:variantcolor]

\setupbottomtexts[\usevisualcounter{simpleslides:shadedcounter}]

\setupTitle[color=white]

%D This module shades the background in a gradient. We use \METAPOST\ to draw
%D the background.


\startuseMPgraphic{simpleslides:MP:ornament}
StartPage ;
linear_shade(Page, 6,
              \MPcolor{simpleslides:backgroundcolor},
              \MPcolor{simpleslides:variantcolor}) ;
StopPage ;
\stopuseMPgraphic

%D We define these backgrounds as overlays:

\defineoverlay
  [simpleslides:background:ornament]
  [\useMPgraphic{simpleslides:MP:ornament}]

\defineoverlay 
  [simpleslides:background:title] 
  [\useMPgraphic{simpleslides:MP:ornament}] 

%D The symbol for the first level of itemizations. 

\definesymbol[1][\useMPgraphic{simpleslides:itemize:square}]
\setupitemize[1][color={simpleslides:itemize:color}]
 
% %D The \quotation{Shaded} style uses \CONTEXT's interactionbar:
% 
% \setupsubpagenumber[way=bytext,state=start]
% 
% \setupinteraction
%   [page=yes,
%    color=simpleslides:interactioncolor,
%    contrastcolor=simpleslides:contrastcolor,
%    menu=on,
%    state=start]
% 
% %\setupinteractionbar
% %\startinteractionmenu[bottom]
% \setupbottomtexts[XXX{\interactionbar[state=start,alternative=e,width=8cm,height=0.2cm,step=small,frame=on]}YYY]
% %\stopinteractionmenu

%\setupbottomtexts[\useMPgraphic{shaded:counter}]

\protect
\stopmodule

\endinput

