% Copyright 2011 by Michael Adam <obnox@samba.org>
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/licenses/LICENSE for more details.

\mode<presentation>

\setbeamercolor*{author in head/foot}{parent=palette primary,bg=}
\setbeamercolor*{title in head/foot}{parent=palette secondary}
\setbeamercolor*{date in head/foot}{parent=palette primary}

\setbeamercolor*{logo in head/foot}{parent=palette tertiary}
\setbeamercolor*{logo in head/foot}{parent=palette primary}

\pgfdeclareimage[width=\paperwidth,height=\paperheight]{draft-background}{draft-background}

\pgfdeclareimage[width=16mm,height=4mm]{Company-Logo-Transparent}{sernet-transparent}
\pgfdeclareimage[width=16mm,height=4mm]{Samba-Logo-Transparent}{Samba_Logo_4c-grey-bbbbbb-256}

\pgfdeclareimage[width=\paperwidth,height=3.5cm]{Title-Image}{SDC2014+-Title-Image}
\pgfdeclareimage[width=\paperwidth,height=1cm]{Top-Image}{SDC2014+-Top-Image}
\pgfdeclareimage[width=\paperwidth,height=0.5cm]{Sub-Image}{SDC2014+-Sub-Image}

\pgfdeclareimage[width=4cm]{Title-Text}{SDC2016-Title-Text}
\pgfdeclareimage[width=12mm]{Sub-Logo}{SDC2016-Sub-Logo}

\pgfdeclarelayer{Title-Image-Layer}
\pgfdeclarelayer{Title-Text-Layer}
\pgfsetlayers{main,Title-Image-Layer,Title-Text-Layer}

\defbeamertemplate*{footline}{MetzeSDC2016 theme}
{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.125\paperwidth,ht=5ex,dp=1ex,left,overlay]{xy}%
    \hspace*{1ex} \hbox{\pgfuseimage{Sub-Logo}} \
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.175\paperwidth,ht=5ex,dp=1ex,left,overlay]{xy}%
    \hbox{\pgfuseimage{Samba-Logo-Transparent}}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.2\paperwidth,ht=5ex,dp=1ex,center,overlay]{author in head/foot}%
    \usebeamerfont{author in head/foot}\scriptsize\insertshortauthor{}\hspace*{1ex}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.3\paperwidth,ht=5ex,dp=1ex,center,overlay]{author in head/foot}%
    \usebeamerfont{author in head/foot}\scriptsize%
     \insertshorttitle{}
     (\insertframenumber{}/\inserttotalframenumber)\hspace*{1ex}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.15\paperwidth,ht=5ex,dp=1ex,right,overlay]{xy}%
  \hbox{\pgfuseimage{Company-Logo-Transparent}}
    \hspace*{1ex}\end{beamercolorbox}}%
  \vskip0pt%
}

\defbeamertemplate*{background}{MetzeSDC2016 theme}
{
  \ifdraftmode
    \includegraphics[width=\paperwidth,height=\paperheight]{draft-background}
  \fi
}

\usepackage{textpos}

\addtobeamertemplate{frametitle}{
    \begin{textblock*}{\paperwidth}(-4mm,0pt)
        \pgfuseimage{Top-Image}
    \end{textblock*}
}

\addtobeamertemplate{footline}{
    \begin{textblock*}{\paperwidth}(0pt,0pt)
        \pgfuseimage{Sub-Image}
    \end{textblock*}
}

\setbeamersize{text margin left=1em,text margin right=1em}


% redefine the title page to contain the
% sdc logo:

\makeatletter
\setbeamertemplate{title page}
{
  \begin{textblock*}{\paperwidth}(-4mm,0pt)

    \begin{tikzpicture}
    % On main layer:
    \fill[white] (0,0) rectangle (\paperwidth,3.5cm);

    \begin{pgfonlayer}{Title-Image-Layer}
      \pgfputat{\pgfxy(0,0.3)}{\pgfuseimage{Title-Image}}
    \end{pgfonlayer}

    \begin{pgfonlayer}{Title-Text-Layer}
      \pgfputat{\pgfxy(0.2,1.1)}{\pgfuseimage{Title-Text}}
    \end{pgfonlayer}

    \end{tikzpicture}

  \end{textblock*}
  %\vskip0pt plus 1filll
  \vskip10em
  \begin{centering}
    \begin{beamercolorbox}[sep=8pt,center]{title}
      \usebeamerfont{title}\Huge\inserttitle\par%
      \ifx\insertsubtitle\@empty%
      \else%
        \vskip0.25em%
        {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
      \fi%
    \end{beamercolorbox}%
    \vskip1em\par
    \begin{beamercolorbox}[sep=6pt,center]{author}
      \usebeamerfont{author}\insertauthor { }{\footnotesize{\texttt{\protect\Verb+<\insertauthormail>+}}}
    \end{beamercolorbox}
    \begin{beamercolorbox}[sep=6pt,center]{institute}
      \usebeamerfont{institute}\insertinstitute
    \end{beamercolorbox}
    \begin{beamercolorbox}[sep=6pt,center]{date}
      \usebeamerfont{date}\insertdate
    \end{beamercolorbox}
    \vskip1em\par
    \scriptsize{\texttt{\protect\Verb+\insertsideurl+}}
    \vskip0.5em
    %%{\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
  \end{centering}
  \vfill
  \vskip0pt plus 1filll
}
\makeatother

\mode
<all>
