%% Copyright (C) 2016-2018 Achim D. Brucker, https://www.brucker.ch
%%
%% License:
%%   This program can be 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.3c of the License, or (at your opinion) any later version.
%%   OR
%%   The 2-clause BSD-style license.
%%
%%   SPDX-License-Identifier: LPPL-1.3c+ OR BSD-2-Clause
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{beamerouterthemeappseceu2018}
     [2018/05/15 v0.0  LaTeX presentation class mimicking the design
     of the OWASP AppSecEU 2018 PowerPoint template.]

\newcommand{\emphBox}[1]{\tikz[baseline={(a.base)}]\node[draw=owaspHighlight,%
  rounded corners=0.5ex,fill=owaspHighlight,inner sep=1pt]
   (a){\textcolor{lhWhite}{#1}};}

\mode<presentation>

\def\insertpresentationendframe{\inserttotalframenumber}
\g@addto@macro{\appendix}{\immediate\write\@auxout{\string\@writefile{nav}{\noexpand\headcommand{\noexpand\def\noexpand\insertpresentationendframe{\the\c@framenumber}}}}}


  \defbeamertemplate*{navigation symbols}{owasp}{}

  % Section and subsections in head/foot
  \defbeamertemplate*{section in head/foot}{owasp}{\insertsectionhead}
  \defbeamertemplate*{section in head/foot shaded}{owasp}[1][50]
                     {\color{fg!#1!bg}\usebeamertemplate{section in head/foot}}

  \defbeamertemplate*{subsection in head/foot}{owasp}{\insertsubsectionhead}

  \defbeamertemplate*{subsection in head/foot shaded}{owasp}[1][50]
                     {\color{fg!#1!bg}\usebeamertemplate{subsection in head/foot}}

  \defbeamertemplate*{subsubsection in head/foot}{owasp}
                     {\insertsubsubsectionhead}

  \defbeamertemplate*{subsubsection in head/foot shaded}{owasp}[1][50]
                     {\color{fg!#1!bg}\usebeamertemplate{subsubsection in head/foot}}


  % Headline and footline
  \defbeamertemplate*{headline}{owasp}{%
  \includegraphics[width=\paperwidth]{visuals/appseceu2018-running-head}
  \begin{picture}(0,0)
    \put(120,35){\Huge\textcolor{lhWhite}
     {\inserttitle%
       \ifx\insertsubtitle\empty\relax%
       \else%
         : \insertsubtitle%
      \fi%
    }};
    \put(118,20){\emphBox{\large\insertshortauthor}}
  \end{picture}
}

  \defbeamertemplate*{footline}{owasp}{}

  \newdimen\beamer@headheight
  \beamer@headheight=3.2\baselineskip
  \defbeamertemplate*{frametitle}{owasp}[1][left]{
    \@tempdima=\textwidth%
    \usebeamerfont{frametitle}%
    \usebeamercolor[fg]{frametitle}%
    \vbox to \beamer@headheight{%
      \vskip.6em%
      \vfil%
      % 
      \if@tempswa\else\csname beamer@fte#1\endcsname\fi%
      \strut\insertframetitle\strut\par%
     {%
       \ifx\insertframesubtitle\@empty%
       \else%
         {\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}%
           \insertframesubtitle\strut\par}%
       \fi
     }%
    }%
  }


  \def\beamer@fteright{\vskip0.35cm\advance\leftskip by 1.7cm\advance\rightskip by1.7cm}
  % Frame title continuations, default
  \defbeamertemplate*{frametitle continuation}{owasp}{\insertcontinuationcountroman}

\mode
<all>
