%% 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{beamerinnerthemeappseceu2018}
     [2018/05/15 v0.0  LaTeX presentation class mimicking the design of the OWASP AppSecEU 2018 PowerPoint template.]
\usepackage{transparent}
\usepackage{tikz}
\mode<presentation>

\newcommand{\vMaxPhantom}{\vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}}
\setbeamertemplate{sections/subsections in toc}[square]
\setbeamertemplate{items}[square] % [circle]

\setbeamertemplate{itemize item}{
  \tikz{
    \draw[fill=owaspHeading,draw=none] (0, 0) rectangle(0.1, 0.1);
    \draw[fill=owaspHeading,draw=none] (0.1, 0.1) rectangle(0.2, 0.2);
   \draw[fill=owaspHeading,draw=none] (0, 0.2) rectangle(0.1, 0.3);
  }
}
\setbeamertemplate{itemize subitem}{
  \tikz{
   \draw[fill=lhDarkGray,draw=none] (0, 0) rectangle(0.075, 0.075);
    \draw[fill=lhDarkGray,draw=none] (0.075, 0.075) rectangle(0.15, 0.15);
   \draw[fill=lhDarkGray,draw=none] (0, 0.15) rectangle(0.075, 0.225);
  }
}
\setbeamertemplate{itemize subsubitem}{
  \tikz{
    \draw[fill=lhLightGray,draw=none] (0, 0) rectangle(0.075, 0.075);
    \draw[fill=lhLightGray,draw=none] (0.075, 0.075) rectangle(0.15, 0.15);
    \draw[fill=lhLightGray,draw=none] (0, 0.15) rectangle(0.075, 0.225);
  }
}


\defbeamertemplate*{title page}{owasp}[1][]
{
  % <background image>
  \setbox\beamer@tempbox=\vbox to \paperheight {\vfil
    \hbox to \paperwidth{%
      \ifx\inserttitlegraphic\@empty%
      \else%
      \inserttitlegraphic\hyper@pagetransition\hyper@pageduration%
      \fi%
    }%
    \vfil}%
    \vbox{\hbox{\hskip-\Gm@lmargin\box\beamer@tempbox\box\@tempboxa}}%
    \vskip-\paperheight%
  % </background image>
  \@tempdima=\paperwidth%
  \advance\@tempdima by -36mm
  \@tempdimb=\paperheight
  \advance\@tempdimb by -51mm
  \@tempdimc=\paperwidth%
  \advance\@tempdimc by -6mm
  \advance\@tempdimc by 0mm
  % \begin{beamercolorbox}[ht=10mm,sep=.2cm,ignorebg,wd=\@tempdima]{titlerule}
  % \end{beamercolorbox}
  \mbox{}\vspace{-8mm}%
  {\mbox{\hspace{40mm}}%
  \begin{beamercolorbox}[ht=25mm,sep=.1cm,,wd=\@tempdima]{titleframe}
    {\usebeamercolor[fg]{title}\usebeamerfont{title}\inserttitle}%
    \ifx\insertsubtitle\@empty%
    \else%
      {\usebeamerfont{title}\usebeamercolor[fg]{title}: \insertsubtitle\vMaxPhantom\par}%
    \fi%
     \begin{beamercolorbox}[sep=4pt,,wd=1.1\@tempdima,#1]{author}
     \usebeamerfont{author}\usebeamercolor[fg]{author}\emphBox{\insertshortauthor}
     \end{beamercolorbox}
    \vbox{}
    \vfill
  \end{beamercolorbox}
  \vspace{2mm}}
  \begin{beamercolorbox}[ht=\@tempdimb,wd=\@tempdima,ignorebg]{lhWhite}
  \end{beamercolorbox}
    \vspace{1mm}
  \begin{beamercolorbox}[wd=\@tempdimc,ignorebg]{lhWhite}
      \raisebox{-\fboxsep}{{\setlength{\fboxsep}{0pt}
     \begin{picture}(0,0)
%        \put(-10,-4){\colorbox{lhWhite}{\quad\vbox to 10mm{\vfil\hbox to 44mm{\lhcomLogoLight[width=42mm]\enspace}\vfil}}}
        \put(-4,-56){\lhcomLogoDark[width=42mm]}
        \put(-4,118){\includegraphics[scale=.2]{visuals/appseceu2018-logo}}
     \end{picture}}}%
    \hfill%
    {\partnerLogo[height=4mm]}%
  \end{beamercolorbox}
  \begin{beamercolorbox}[ht=16mm,sep=.2cm,wd=\@tempdima,ignorebg]{titlerule}
  \end{beamercolorbox}
}

\mode<all>
