% \iffalse meta-comment
%%% File: bit-logos.sty
%% Copyright (C) 2005 Michael N\"usken.
% 
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3a
% of this license or (at your option) any later version.
% The latest version of this license is in
%    http://www.latex-project.org/lppl.txt
% and version 1.2 or later is part of all distributions of LaTeX 
% version 1999/12/01 or later.
%
% -----------------------------------------------------------
%
%<*chartab>
%\fi
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
% \iffalse meta-comment
%</chartab>
% \fi
%
\ProvidesPackage{bit-logos-plain}[2005/06/06 v1.00 bit-logos MNuesken]

\RequirePackage{pstricks}
\RequirePackage{pst-text}

\definecolor{uniblau}{cmyk}{1,.65,0,0}%
%%% \definecolor{uniblau}{rgb}{0,0.2588235,0.56862745}% RGB 0,66,145
%% Die Farbe aus Logo_UBo_h24_4c.eps:
%%% \definecolor{uniblau}{rgb}{0,0.4078431,0.6941176}% 0,104,177
%% Die Farbe aus Logo_UBo_h24_RGB.tif
%%% \definecolor{uniblau}{rgb}{0,0.37647,0.68235}% 0,96,174

% Nach Definition sind folgende Schmuckfarben zugelassen
% HKS 4 ("Uni-Gelb" RGB 255,194,14) 
\definecolor{unigelb}{cmyk}{0,.2,1,0}%
% sowie HKS 95 ("Uni-Grau" RBG 139,138,125)
\definecolor{unigrau}{cmyk}{0,0,.15,.55}%

\def\coseclogorm{\rm\fontfamily{ptm}\selectfont}
\def\bitlogosf{\sf\fontfamily{phv}\selectfont}
\def\bitlogobxsf{\sf\fontfamily{phv}\fontseries{bx}\selectfont}

\def\bitlogotxt{%
  \vbox{\bitlogosf%
    \hbox{%
    \textbf{%
      \psscalebox{1.2 1.0}{b}%
      \psscalebox{0.8 1.0}{-}%
    }%
    %\kern-.05ex
    \psscalebox{1.2 1.0}{i}%
    \psscalebox{1.0 1.0}{t}%
  }}%
}
\def\@bitlogo#1#2{%
}
\def\bitlogoH#1{{%
    \psset{fillcolor=uniblau,fillstyle=solid,%
      linecolor=uniblau,linewidth=0.0pt,framesep=1pt}%
    \dimen@=#1\relax
    \begin{pspicture}(1.6\dimen@,\dimen@)
      \rput[lb](0,0){%
        \psscaleboxto(1.6\dimen@,\dimen@){\psframebox*{\white\bitlogotxt}}%
      }%
    \end{pspicture}%
  }}
\def\bitlogoW#1{{%
    \psset{fillcolor=uniblau,fillstyle=solid,%
      linecolor=uniblau,linewidth=0.0pt,framesep=1pt}%
    \dimen@=#1\relax
    \begin{pspicture}(\dimen@,0.625\dimen@)
      \rput[lb](0,0){%
        \psscaleboxto(\dimen@,0.625\dimen@){\psframebox*{\white\bitlogotxt}}%
      }%
    \end{pspicture}%
  }}
\def\bwbitlogoH#1{{%
    \psset{fillcolor=white,fillstyle=none,%
      linecolor=white,linewidth=0.0pt,framesep=1pt}%
    \dimen@=#1\relax
    \begin{pspicture}(1.6\dimen@,\dimen@)
      \rput[lb](0,0){%
        \psscaleboxto(1.6\dimen@,\dimen@){\psframebox*{\black\bitlogotxt}}%
      }%
    \end{pspicture}
  }}
\def\bwbitlogoW#1{{%
    \psset{fillcolor=white,fillstyle=none,%
      linecolor=white,linewidth=0.0pt,framesep=1pt}%
    \dimen@=#1\relax
    \begin{pspicture}(\dimen@,0.625\dimen@)
      \rput[lb](0,0){%
        \psscaleboxto(\dimen@,0.625\dimen@){\psframebox*{\black\bitlogotxt}}%
      }%
    \end{pspicture}
  }}

\def\longbitlogo{{%
    \psset{unit=1mm}%
    \psset{fillcolor=uniblau,fillstyle=solid,%
      linecolor=uniblau,linewidth=0.0pt,framesep=1pt}%
    \begin{pspicture}(80,20)
      \psframe(0,0)(80,20)
%%%       {\psset{unit=10mm}\psgrid(8,2)}%
      \rput[lb](0,0){\bitlogoH{20\psyunit}}
      \rput[lb](34,1){\psscaleboxto(46,13)
        {%
          {\bitlogobxsf\white
            \begin{tabular}{@{}l@{}}
              Bonn-Aachen\\
              International Center for\\
              Information Technology
            \end{tabular}
          }}}%
    \end{pspicture}%
  }}
\def\longbitlogoH#1{{%
    \dimen@=#1\relax
    \psscaleboxto(4.2\dimen@,\dimen@){\longbitlogo}}}
\def\longbitlogoW#1{{%
    \dimen@=#1\relax
    \multiply\dimen@ 20
    \divide\dimen@ 84
    \psscaleboxto(4.2\dimen@,\dimen@){\longbitlogo}}}

\def\coseclogoH#1{{%
    \dimen@=#1\relax
    \psscaleboxto(2.32258\dimen@,\dimen@){\coseclogo}}}
\def\coseclogoW#1{{%
    \dimen@=#1\relax
    \psscaleboxto(\dimen@,0.4305555555\dimen@){\coseclogo}}}
\def\coseclogo{{%
  \coseclogorm
  \psset{unit=1cm,fillcolor=uniblau,fillstyle=solid,
    linecolor=uniblau,linewidth=0.1pt,shadow=false}%
  \begin{pspicture}(7.2,3.1)
    \def\scc{{\setbox0\hbox{c}\psscaleboxto(\wd0,\ht0){C}}}%
    \pscustom[fillstyle=solid,fillcolor=uniblau]{%
      \psellipse(1,1.5)(1,1.5)%
      % Make sure that the next ellipse is drawn backwards.
      \psellipse(1,1.5)(0.3,-0.9)%
    }%
    \pspolygon(1.8,1)(6,1)(7.2,1)(7.2,3.1)(6.8,3.1)(6.8,2.9)
      (6.4,2.9)(6.4,3.0)(6,3.0)(6,2)(1.8,2)(1.8,1)\relax
    \rput(0.9,1.5){%
      \psscaleboxto(1.6,2.35){\white \textbf{C}}}
    \rput[l](1.8,1.5){%
      \psscaleboxto(4,0.8){\white \textbf{ose\scc}}}
    \rput[lb](6.1,1.1){\psscaleboxto(1.0,1.6){\rotateleft{\white\bitlogotxt}}}
    \rput[lb](2.1,2.2){\psscaleboxto(3,0.5){\textcolor{uniblau}{\scc{}omputer}}}
    \rput[rb](7.2,0.3){\psscaleboxto(3,0.5){\textcolor{uniblau}{\setbox0\hbox{s}\psscaleboxto(\wd0,\ht0){S}e\scc{}urity}}}
  \end{pspicture}}}

\def\IPECstampH#1#2{{%
    \dimen@=#1\relax
    \psscaleboxto(1.0\dimen@,\dimen@){\IPECstamp{#2}}}}
\def\IPECstampW#1#2{{%
    \dimen@=#1\relax
    \psscaleboxto(\dimen@,1.0\dimen@){\IPECstamp{#2}}}}
\def\IPECstampangle{-30}
\def\IPECstamp#1{%
  {%
    \color{uniblau}%
    \psset{unit=15mm}%
    \begin{pspicture}(-1.1,-1.1)(1.1,1.1)
      \bf\fontsize{10}{12pt}\fontfamily{ptm}\selectfont
      \rput{\IPECstampangle}(0,0){#1}%
      \psset{linestyle=none}%
      \psset{linecolor=red}%
      \pstextpath[c]{%
        \rput{\IPECstampangle}{\pscurve
          (-1, 0)
          (-0.98079, 0.19509)
          (-0.92388, 0.38268)
          (-0.83147, 0.55557)
          (-0.70711, 0.70711)
          (-0.55557, 0.83147)
          (-0.38268, 0.92388)
          (-0.19509, 0.98079)
          (0, 1.0)
          (0.19509, 0.98079)
          (0.38268, 0.92388)
          (0.55557, 0.83147)
          (0.70711, 0.70711)
          (0.83147, 0.55557)
          (0.92388, 0.38268)
          (0.98079, 0.19509)
          (1.0, 0)}%
      }%
      {\color{uniblau}International Programme}%
      \psset{linecolor=green}%
      \pstextpath[c]{%
        \rput{\IPECstampangle}{\pscurve
          (-1, 0)
          (-0.98079, -0.19509)
          (-0.92388, -0.38268)
          (-0.83147, -0.55557)
          (-0.70711, -0.70711)
          (-0.55557, -0.83147)
          (-0.38268, -0.92388)
          (-0.19509, -0.98079)
          (0, -1.0)
          (0.19509, -0.98079)
          (0.38268, -0.92388)
          (0.55557, -0.83147)
          (0.70711, -0.70711)
          (0.83147, -0.55557)
          (0.92388, -0.38268)
          (0.98079, -0.19509)
          (1.0, 0)}%
      }%
      {\color{uniblau}of Excellence (IPEC)}%
    \end{pspicture}%
  }%
}


\let\orig@pagestyle\pagestyle
\def\pagestyle#1{\orig@pagestyle{#1}\activate@watermark}
\let\orig@thispagestyle\thispagestyle
\def\thispagestyle#1{%
  \expandafter\gdef\csname ps@#1-watermark\endcsname{\csname
    ps@#1\endcsname\activate@watermark
  }\orig@thispagestyle{#1-watermark}}
\let\@watermark\relax%
\def\activate@watermark{%
  \expandafter\def\expandafter\@oddhead\expandafter{%
    \expandafter\@watermark\@oddhead}%
  \expandafter\def\expandafter\@evenhead\expandafter{%
    \expandafter\@watermark\@evenhead}%
}
\newcommand{\watermarkuniblau}{%
  %\definecolor{uniblau}{cmyk}{.25,.1625,0,0}% 25%
  %\definecolor{uniblau}{cmyk}{.2,.13,0,0}% 20%
  %\definecolor{uniblau}{cmyk}{.15,.0975,0,0}% 15%
  \definecolor{uniblau}{cmyk}{.1,.065,0,0}% 10%
}
\newcommand{\watermark}[1]{%
  \gdef\@watermark{{%
      \watermarkuniblau
      \rput[c]{60}(.5\textwidth,-.6\textheight){#1}%
    }}%
  \activate@watermark}
\newcommand{\cosecwatermark}{\watermark{\coseclogoW{20cm}}}
\newcommand{\bitwatermark}{\watermark{\bitlogoW{15cm}}}
\newcommand{\longbitwatermark}{\watermark{\longbitlogoW{20cm}}}
