\documentclass[xcolor={table,dvipsnames},11pt]{beamer}

\usepackage[T1]{fontenc}
\usepackage[UKenglish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{ifthen}
\usepackage{tikz}
\usepackage{ulem}
\usepackage{listings}
%\usepackage[scaled]{luximono}
\usepackage[scaled=]{inconsolata}
\usepackage{multicol}

\usetikzlibrary{backgrounds,fit,shapes,shapes.arrows,arrows}

\lstset{
  language=C,
  basicstyle=\small\ttfamily\color{black!100},
  identifierstyle=\ttfamily\color{black!100}\bfseries,
  commentstyle=\color{black!100},
}

\newcommand{\code}[2][literate={-}{}{0\discretionary{-}{}{-}}]{{\lstinline[#1,basicstyle=\small\ttfamily]|#2|}}
%\newcommand{\code}[2][literate={-}{}{0\discretionary{-}{}{-}}]{{\texttt{#2}}}

%\usepackage[utopia]{mathdesign}
%\renewcommand*{\familydefault}{\rmdefault}

%\usepackage{charter}
%\renewcommand*{\familydefault}{\rmdefault}

%\usepackage{arev}
%\renewcommand*{\familydefault}{\sfdefault}

%\usepackage{iwona}
%\renewcommand*{\familydefault}{\rmdefault}

\usepackage[scaled]{futura}
\renewcommand*{\familydefault}{\sfdefault}

%\usepackage[T1]{fontenc}
%\usepackage[scaled]{berasans}
%\renewcommand*{\familydefault}{\sfdefault}

\renewcommand{\baselinestretch}{1.1}

%\lstset{
%  language=C,
%  basicstyle=\small\footnotesize\ttfamily\color{black!80},
%  identifierstyle=\ttfamily\color{black!80}\bfseries,
%  commentstyle=\color{Gray},
%}

\usetheme{Szeged}
\usecolortheme[named=NavyBlue]{structure}
\setbeamercolor{section in head/foot}{bg=NavyBlue!80!white,fg=white}

\setbeamertemplate{itemize items}[triangle]

%\setbeamertemplate{frametitle}{\vbox to 0cm{}\insertframetitle\vshrink}

\setbeamertemplate{navigation symbols}
{
  \ifthenelse{\equal{\insertframenumber}{1}}{}{
%    \pgfimage[width=1.8cm]{images/xfce-logo.pdf}
%    \vspace{2ex}
%    \hspace{1ex}
  }
}

\setbeamertemplate{headline}
{
  \vbox{
    %\begin{beamercolorbox}[ht=3.5ex,dp=1.3ex,leftskip=1.29cm,rightskip=1.29cm]{section in head/foot}
    %\begin{beamercolorbox}[ht=3.5ex,dp=1.3ex,leftskip=1cm]{section in head/foot}
    \begin{beamercolorbox}[ht=3.5ex,dp=1.3ex,leftskip=1cm]{section in head/foot}
    %  \beamerline{\footnotesize{\insertsectionnavigationhorizontal{2cm}{}{}}}
      %\beamerline{\footnotesize{\insertsection}} % \footnotesize{Ersetzen des virtuellen Dateisystems im Dateimanager Thunar durch GIO}}
    \end{beamercolorbox}
  }
  \vfill
}

\setbeamertemplate{footline}
{
  \vbox{
    \begin{beamercolorbox}[ht=2.6ex,dp=1ex,leftskip=1.29cm,rightskip=1.1cm]{section in head/foot}
      \hfill \beamerline{\insertframenumber\ of\ \inserttotalframenumber}
    \end{beamercolorbox}
  }
}

\setbeamertemplate{background}
{
}

\setbeamertemplate{bibliography item}[triangle]
%\setbeamertemplate{bibliography item}[text]

\bibliographystyle{plain}

\begin{document}

\begin{frame}[plain]
    \begin{beamercolorbox}{structure}
      \vskip 0.5cm
        \Huge{Tumbler}
        \vskip 0.5cm
        \Large{A Modern D-Bus Thumbnail Service}
    \end{beamercolorbox}
    \vskip 1cm
    \footnotesize{Jannis Pohlmann}
    \par
    FOSDEM 2012
\end{frame}

\section{Introduction}

\begin{frame}
  \begin{block}{Thumbnails are needed everywhere}
    \begin{itemize}
      \item Apps:
        \begin{itemize}
          \item File managers
          \item Image viewers
          \item Music and media players
          \item Search tools / dashboards / indexers
        \end{itemize}
      \item Devices:
        \begin{itemize}
          \item Desktop PCs
          \item Phones
          \item Tablets
        \end{itemize}
    \end{itemize}
  \end{block}
\end{frame}

\begin{frame}
  \begin{block}{Thumbnailing is difficult}
    \begin{itemize}
      \item Variety of file types need to be supported
      \item Same for URI schemes
      \item Costly process in terms of CPU and memory
    \end{itemize}
  \end{block}
\end{frame}

\begin{frame}
  \begin{block}{Problems with the current state}
    \begin{itemize}
      \item Desktops, apps reimplement the same (complex) functionality
        \begin{itemize}
          \item MIME types
          \item URI schemes
          \item libraries, plugins, script
        \end{itemize}
      \item Thumbnails are usually created in-process
        \begin{itemize}
          \item Different apps compete for CPU time
          \item (May crash apps if buggy)
        \end{itemize}
    \end{itemize}
  \end{block}
\end{frame}

\section{Tumbler}

\begin{frame}
  \begin{beamercolorbox}{frametitle}
      Say hello to

      \Huge{\insertsection}
  \end{beamercolorbox}
\end{frame}

\begin{frame}
  \begin{block}{Tumbler is...}
    \begin{itemize}
      \item an attempt to centralize thumbnail functionality
      \item a collection of D-Bus services for creating thumbnails
      \item an implementation of the \par {\it Thumbnail Management D-Bus Specification}
      \item written in C using GIO
      \item used in Xfce, Tracker, MeeGo and on the N9
      \item something I'd love to see being used in other places
    \end{itemize}
  \end{block}
\end{frame}

\begin{frame}
  \begin{block}{Service Overview}
    \vskip0.3cm
    \begin{tikzpicture}[every path/.style={rounded corners=.2em},every node/.style={rounded corners=.2em,transform shape,font=\large,scale=.60}]
      \node[fill=NavyBlue!40,draw=NavyBlue!50,minimum height=1.5cm,minimum width=5cm] (thumbnailer) at (0,4) { Thumbnailer1 };
      \node[fill=NavyBlue!30,draw=NavyBlue!40,minimum height=1.5cm,minimum width=5cm] (manager) at (3.35,4) { Manager1 };
      \node[fill=NavyBlue!20,draw=NavyBlue!30,minimum height=1.5cm,minimum width=5cm] (cache) at (6.72,4) { Cache1 };

      \node[fill=red!30,draw=red!40,minimum height=2cm,minimum width=16.75cm] at (3.35,-0.15) { Application / Client };

      \draw[<->,>=latex,thick] (-1.0,0.5) to node [xshift=.1cm,right,text badly ragged,text width=4cm] { Thumbnail requests. Query capabilities. Status update signals. } (-1.0,3.5);
      \draw[<->,>=latex,thick] (2.35,0.5) to node [xshift=.1cm,right,text badly ragged,text width=4cm] { Register specialised D-Bus thumbnailers at runtime. } (2.35,3.5);
      \draw[<->,>=latex,thick] (5.72,0.5) to node [xshift=.1cm,right,text badly ragged,text width=4cm] { Copy, move, clean up thumbnails in {\tt \$HOME/.thumbnails}. } (5.72,3.5);

      \begin{pgfonlayer}{background}
        \node[fill=NavyBlue!10,draw=NavyBlue!10,fit=(thumbnailer) (manager) (cache),minimum height=3cm,minimum width=16.75cm,inner sep=.5cm,text height=-.35cm,yshift=.5cm] { Service APIs: {\tt org.freedesktop.thumbnails.} };
      \end{pgfonlayer}
    \end{tikzpicture}
  \end{block}
\end{frame}

\begin{frame}
  \begin{block}{Benefits \& features}
    \begin{itemize}
      \item central scheduling: {\it foreground}, {\it background}
      \item natural API: async requests, signals for status updates etc.
      \item extensible set of flavors: {\it normal}, {\it large}
      \item plugin interface for flexible URI/MIME types support
      \item state of plugins: \par
            GdkPixbuf, JPEG, ODF, Poppler, OpenRAW, FreeType, GStreamer
    \end{itemize}
  \end{block}
\end{frame}

\begin{frame}
  \begin{beamercolorbox}{frametitle}
    Let's see it!

    \Huge{Demonstration}
  \end{beamercolorbox}
\end{frame}

\section{Outlook}

\begin{frame}
  \begin{beamercolorbox}{frametitle}
    What's next?

    \Huge{\insertsection}
  \end{beamercolorbox}
\end{frame}

\begin{frame}
  \begin{block}{Limitations \& future work}
    \begin{itemize}
      \item Make flavors more flexible
      \item Add a plugin for thumbnail scripts
      \item Handle conflicting plugins in better ways
      \item Add support for pausing/resuming requests (improve LIFO)
    \end{itemize}
  \end{block}
\end{frame}

\begin{frame}
  \begin{block}{Wrapping up}
    \begin{itemize}
      \item Thanks for your interest!
      \item Source code: \code{http://git.xfce.org/xfce/tumbler}
      \item Releases: \code{http://archive.xfce.org/src/xfce/tumbler}
      \item Specification: \code{http://live.gnome.org/ThumbnailerSpec}
      \item Slides: \code{http://wiki.xfce.org/events/2012/fosdem}
    \end{itemize}
    \vskip0.8cm
    \begin{center}
      \Huge{Questions?}
    \end{center}
  \end{block}
\end{frame}

\definecolor{codethinkgreen}{HTML}{A7D239}

\setbeamercolor{section in head/foot}{bg=codethinkgreen,fg=white}
\setbeamercolor{normal text}{bg=codethinkgreen,fg=white}
\usebeamercolor[fg]{normal text}

\begin{frame}[plain]

  \vfill
  \pgfimage[width=6cm]{images/codethink-logo}
  \par
  \huge{We're hiring!}
  \vskip1.5cm
  {\tt\large{http://codethink.co.uk}}

\end{frame}

\end{document}
