%D \module
%D   [      file=simpleslides-s-HorizontalStripes,
%D        version=2009.03.30
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Module HorizontalStripes,
%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 \filename{HorizontalStripes} style for the
%D presentation module. It is loaded at runtime. The look of this style was
%D inspired by the \quotation{Copenhagen} theme of the \LaTeX\ {\tt beamer}
%D package.

\writestatus{simpleslides}{loading HorizontalStripes style}

\startmodule[simpleslides-s-HorizontalStripes]

\unprotect

%D The page layout:

\setuplayout [width=fit,
              margin=0cm,
              height=fit,
              header=2.73cm, 
              footer=0.9cm, 
              topspace=0cm, 
              backspace=1cm,
              location=singlesided]

\setuplayout [simpleslides:layout:horizontal][header=2.73cm]
\setuplayout [simpleslides:layout:vertical]  [header=0.75cm]
\setuplayout [simpleslides:layout:title]     [header=0cm]

%D In this style, we don't want the ornament background for vertical slides:

\startsetups simpleslides:background:vertical
  \setuplayout[simpleslides:layout:vertical]
  \setupbackgrounds[\v!page]
        [background={simpleslides:background:vertical}]
\stopsetups



%D We also specify the position of the slidetitle.

\setuplayer[simpleslides:layer:slidetitle]
    [width=\paperwidth,
    height=\paperheight,
    x=10mm]

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

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

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

\startsetups simpleslides:setups:blue
\definecolor [simpleslides:backgroundcolor]  [s=.95]
\definecolor [simpleslides:framecolor]       [r=.58,g=.58,b=.82]
\definecolor [simpleslides:contrastcolor]    [r=.2,g=.2,b=.73]
\definecolor [simpleslides:itemize:color]    [simpleslides:contrastcolor]
\stopsetups

\startsetups simpleslides:setups:red
\definecolor [simpleslides:backgroundcolor]  [s=.95]
\definecolor [simpleslides:framecolor]       [r=.82,g=.58,b=.58]
\definecolor [simpleslides:contrastcolor]    [r=.73,g=.2,b=.2]
\definecolor [simpleslides:itemize:color]    [simpleslides:contrastcolor]
\stopsetups

\startsetups simpleslides:setups:green
\definecolor [simpleslides:backgroundcolor]  [s=.95]
\definecolor [simpleslides:framecolor]       [r=.58,g=.82,b=.58]
\definecolor [simpleslides:contrastcolor]    [r=.2,g=.73,b=.2]
\definecolor [simpleslides:itemize:color]    [simpleslides:contrastcolor]
\stopsetups

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

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

%D We let Metapost calculate the background:

\startuseMPgraphic{simpleslides:MP:common} 
save a ; numeric a ; 
a = 1.5mm ;

save p; path p[] ;

fill Page withcolor \MPcolor{simpleslides:backgroundcolor} ;

z1 = ulcorner Page shifted (0,-a) ;
z2 = urcorner Page shifted (0,-a) ;
z3 = llcorner Page shifted (0,a) ;
z4 = lrcorner Page shifted (0,a) ;

p[1] = ulcorner Page -- z1 -- z2 -- urcorner Page -- cycle ;
p[3] = llcorner Page -- z3 -- z4 -- lrcorner Page -- cycle ;
p[4] = p[3] shifted (0,.75cm) ;

fill p[1] withcolor \MPcolor{simpleslides:framecolor} ;
fill p[3] withcolor \MPcolor{simpleslides:framecolor} ;
fill p[4] withcolor \MPcolor{simpleslides:framecolor} ;
\stopuseMPgraphic 

\startuniqueMPgraphic{simpleslides:MP:vertical}
StartPage ;
\includeMPgraphic{simpleslides:MP:common} ;
StopPage ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{simpleslides:MP:horizontal}
StartPage ;
\includeMPgraphic{simpleslides:MP:common} ;

p[2] = p[1] shifted (0,-2cm) ;
fill p[2] withcolor \MPcolor{simpleslides:framecolor} ;
StopPage ;
\stopuniqueMPgraphic

%D We define these backgrounds as overlays:

\defineoverlay 
   [simpleslides:background:horizontal] 
   [\useMPgraphic{simpleslides:MP:horizontal}] 
 
\defineoverlay 
  [simpleslides:background:vertical] 
  [\useMPgraphic{simpleslides:MP:vertical}] 

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

%D We define the footer

\setupfooter[\c!color=simpleslides:contrastcolor,
             \c!style={\switchtobodyfont[10pt]},
             \c!strut=\v!yes]

\setupfootertexts[{\framed[\c!frame=\v!off,
                           \c!height=0.65cm,
                           \c!width=\textwidth]
                           {\simpleslidestitleparameter{title}
                            \hfill \pagenumber\ of \lastpage}}]


%D this sets up the title page:

\setupTitle
  [\c!title\c!color={simpleslides:contrastcolor},
   \c!author\c!color={simpleslides:contrastcolor},
   \c!date\c!color={simpleslides:contrastcolor}]

%D The slide title is typeset in a layer

\setupSlideTitle
  [\c!color={simpleslides:contrastcolor},
   \c!alternative=layer,
   \c!align=\v!center,
   \c!width=\textwidth,
   \c!height=2.2cm,
   \c!after=]

%D The symbol for the first level of itemizations. 

\definesymbol[1][\useMPgraphic{simpleslides:itemize:square}]
\setupitemize[1][color={simpleslides:itemize:color}]

\protect
\stopmodule

\endinput

