%% 
%% This is file `IWIslides.cls' v 1.00 beta
%%
%% Authors Michael H.F. Wilkinson and Michel A. Westenberg
%%   April 27, 2006
%%    
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%                 ONLY for pdflatex use!!!! 
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% version 0.4a, 2006/04/27 : optional parameter added to \questionslide 
%%
%% version 0.3a, 2005/06/10 : \questionslide added, also uses 
%%                            \rightheader
%% version 0.2a, 2005/04/07 : transparent logo file for 
%%                            color option added, of Erik Urbach
%% version 0.1a, 2005/03/30 : first test
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ProvidesClass{IWIslides}[2007/07/11 v 1.0 IWI slides class (MHFW, MAW)]
\NeedsTeXFormat{LaTeX2e}[1995/06/01]

\RequirePackage{ifthen}
\RequirePackage[absolute]{textpos}

\newboolean{showpagenumbers@IWI}
\newboolean{pastQuestions@IWI}
\setboolean{pastQuestions@IWI}{false}
\newcommand{\pagenumsep@IWI}{ of }

\newboolean{iwilogo@IWI}
\newboolean{ruglogo@IWI}
\newboolean{rugcolor@IWI}
\setboolean{rugcolor@IWI}{true}%

\newboolean{rugbalk@IWI}
%\setboolean{rugbalk@IWI}{true}



\DeclareOption{color}{%
\setboolean{iwilogo@IWI}{false}%
\setboolean{ruglogo@IWI}{false}%
\setboolean{rugcolor@IWI}{true}%
}

\DeclareOption{bw}{%
\setboolean{iwilogo@IWI}{false}%
\setboolean{ruglogo@IWI}{true}%
\setboolean{rugcolor@IWI}{false}%
}

\DeclareOption{iwilogo}{%
\setboolean{iwilogo@IWI}{true}%
\setboolean{ruglogo@IWI}{false}%
\setboolean{rugcolor@IWI}{false}%
}

\DeclareOption{norugbalk}{%
\setboolean{rugbalk@IWI}{false}
}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{rugfoils}}


\PassOptionsToPackage{display,whitebackground}{texpower}
\PassOptionsToPackage{bookmarks}{hyperref}

\ProcessOptions\relax

\LoadClass{rugfoils}
%\RequirePackage{times}
\RequirePackage{texpower}
\RequirePackage{graphics}
\RequirePackage{pifont}
\RequirePackage{color}
\RequirePackage{soul}
\RequirePackage{hyperref}
\RequirePackage{fixseminar}
\RequirePackage{lastpage}
\RequirePackage{wallpaper}
%\RequirePackage{fancybullets}

\InputIfFileExists{iwilogopath.cfg}{}{\newcommand{\iwilogopath}{}}

\newcommand{\bulletpath}{\iwilogopath}

\ifthenelse{\boolean{display}}{% else replace all colors by black
  \definecolor{pagecolor@whitebg}{rgb}{1,1,1}%
  \definecolor{textcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{emcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{altemcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{mathcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{codecolor@whitebg}{rgb}{0,0,0}%
  \definecolor{underlcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{conceptcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{inactivecolor@whitebg}{rgb}{0,0,0}%
  \definecolor{presentcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{highlightcolor@whitebg}{rgb}{0,0,0}%
  %
  \definecolor{dtextcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{demcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{daltemcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{dmathcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{dcodecolor@whitebg}{rgb}{0,0,0}%
  \definecolor{dunderlcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{dconceptcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{dinactivecolor@whitebg}{rgb}{0,0,0}%
  \definecolor{dpresentcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{dhighlightcolor@whitebg}{rgb}{0,0,0}%
  %
  \definecolor{etextcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{eemcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{ealtemcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{emathcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{ecodecolor@whitebg}{rgb}{0,0,0}%
  \definecolor{eunderlcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{econceptcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{einactivecolor@whitebg}{rgb}{0,0,0}%
  \definecolor{epresentcolor@whitebg}{rgb}{0,0,0}%
  \definecolor{ehighlightcolor@whitebg}{rgb}{0,0,0}%
  \whitebackground
}{}

\def\hrulefill{\leavevmode\leaders\hrule\@height-1pt\@depth5pt\hfill\kern\z@}
\definecolor{RUGred}{rgb}{0.797,0,0}
\definecolor{RUGgray}{gray}{0.925}

\setlength{\wpYoffset}{-2cm}
\setlength{\wpXoffset}{1.54cm}
\addtolength{\wpXoffset}{-\hoffset}

\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}

\renewcommand{\@maketitle}{
  %\resizebox{!}{2cm}{\includegraphics{\LogoFile}}
  \ThisCenterWallPaper{1.01}{\iwilogopath RUGtitleslideENG.pdf}

  \begin{textblock}{25}(3.42,6.52)
    \colorbox{RUGred}{
      \parbox{0.9\textwidth}{
        \raggedright
        \color{white}
        {\Large \@title}
      }
    }
  \end{textblock}
  \begin{textblock}{20}(5.54,13)
    \raggedright  
    \@author
  
  \end{textblock}  \strut\\[12.5cm]

   
}
 
\newcommand{\slidelink}[2]{\hfill \hyperlink{#1}{\small #2 \normalsize$\Rightarrow$}}
\newcommand{\slbacklink}[1]{\hfill \hyperlink{#1}{\normalsize$\Leftarrow$ \small Back}}
 
\CenterWallPaper{1.0}{\iwilogopath RUGslideENG2.pdf}


\addtolength{\textheight}{-0.6cm}
\addtolength{\footskip}{1.45cm}
\parindent 0pt % do not indent paragraphs
\rightskip 0pt plus 1fil % allow ragged right

\addtolength{\hoffset}{-1truein}
\addtolength{\hoffset}{1truecm}
\addtolength{\voffset}{-1truein}
\addtolength{\voffset}{1truecm}
\addtolength{\textwidth}{-2truecm}
\addtolength{\textheight}{-2.5truecm}
\pagestyle{foilheadings}

\newcommand{\myslidectr}{%
\addtocounter{slidectr}{-1}
\theslidectr
\addtocounter{slidectr}{1}
}

\newcommand{\showpagenumbers}[2][{ of }]{%
\rightfooter{\color{black}\myslidectr{#1}\ref*{#2}}
\setboolean{showpagenumbers@IWI}{true}
\renewcommand{\pagenumsep@IWI}{#1}
}
\newcommand{\noshowpagenumbers}{%
\rightfooter{}
\setboolean{showpagenumbers@IWI}{false}
}

\newcounter{slidectr}
\newenvironment{slide}[1]{%
  \refstepcounter{slidectr}
  \Slide{#1}
}{%
\ifthenelse{\boolean{pastQuestions@IWI}}{\noshowpagenumbers}{}
}
\newcommand{\Slide}[1]{\foilhead{\color{RUGred}#1\color{RUGgray}}\pdfbookmark[0]{#1}{slidemark\arabic{slidectr}}}


\def\mystep{\step{%
    \ifthenelse{\boolean{firstactivation}}
    {\color{conceptcolor}}% 
    {\color{inactivecolor}}}%
}%


\newcommand{\questionslide}[1][Questions]{%
\begin{slide}{#1}
%  \ThisCenterWallPaper{1.01}{\iwilogopath RUGtitleslideENG.pdf}
  \vspace*{-0.7cm}

  \hspace*{-1.3in}
  \colorbox{RUGred}{
    \parbox{1.1\paperwidth}{
      \color{white}
      \centering
      \vspace*{1cm}
      \resizebox{!}{3in}{?}
      \normalsize
      \vspace*{1cm}
    }
  }
\label{QuestionSlide}
\end{slide}
\setboolean{pastQuestions@IWI}{true}
%\refstepcounter{slidectr}
}

\newenvironment{stepitemize}{%
  \begin{itemize}
  \let\origitem=\item
  \renewcommand{\item}{\mystep\origitem}%
}{\end{itemize}}


\newcommand{\highlighted}[1]{%
\liststepwise*[\let\hidestepcontents=\displaystepcontents]{#1}}

\AtEndDocument{\refstepcounter{slidectr}}

% Add colours to a dinglist. 'Good' items are green checkmarks and 'bad' items
% are red crosses.
\renewcommand{\Pisymbol}[2]{{%
    \ifnum #2=56{\textcolor{red}{\Pifont{#1}\char#2}}%
    \else {\ifnum #2=52{\textcolor{green}{\Pifont{#1}{\char#2}}}%
      \else {\Pifont{#1}{\char #2}}\fi}\fi}}

\ifthenelse{\boolean{ruglogo@IWI}}{\@useLogoFiletrue%
    \ifthenelse{\boolean{whitebackground@TP}}{\renewcommand{\LogoFile}{\iwilogopath RUGR_logoEN_rood_RGB.pdf}}{}
    \ifthenelse{\boolean{lightbackground@TP}}{\renewcommand{\LogoFile}{\iwilogopath RuGlogo_light.pdf}}{}
    \ifthenelse{\boolean{darkbackground@TP}}{\renewcommand{\LogoFile}{\iwilogopath RuGlogo_dark.pdf}}{}
}{}
\ifthenelse{\boolean{rugcolor@IWI}}{\@useLogoFiletrue%
  \renewcommand{\LogoFile}{\iwilogopath RUGR_logoEN_rood_RGB.pdf}}{}

\ifthenelse{\boolean{iwilogo@IWI}}{\@useLogoFiletrue%
  \renewcommand{\LogoFile}{\iwilogopath logoWenI.pdf}}{}

%\ifthenelse{\boolean{rugbalk@IWI}}{%
%\rightfooter{\makebox[3cm][l]{\includegraphics[width=3cm]{RuGbalkBl.png}}}
%}{}


\renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}{\color{RUGred}\textbf{#1}}}

\renewcommand{\labelitemi}{\includegraphics[height=1.5ex]{\bulletpath red-bullet-on-white}}
\renewcommand{\labelitemii}{\includegraphics[height=1.2ex]{\bulletpath red-bullet-on-white}}
\renewcommand{\labelitemiii}{\includegraphics[height=1.0ex]{\bulletpath red-bullet-on-white}}

\MyLogo{}
