Commit 919f9984 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Added section about network protocol and moved a large figure to an appendix.

parent 057a330f
......@@ -154,8 +154,8 @@
\end{figure}
}
\newcommand{\examplediagram}[1]{
\begin{figure}[h]
\newcommand{\examplediagram}{
\begin{figure}[h!]
\center
\architecture{
\node[block, below of=driver] (eventdriver) {Event driver}
......@@ -163,24 +163,38 @@
\node[block, below of=eventdriver] (rootarea) {Root area}
edge[linefrom] (eventdriver);
\node[block, below of=rootarea] (subarea) {Button area}
edge[linefrom] (rootarea)
edge[lineto, bend right=45] node[right=3] {event propagation} (rootarea);
\node[block, right of=rootarea, xshift=5em] {\emph{pinch} tracker}
\node[block, right of=rootarea, xshift=4em] {\emph{pinch} tracker}
edge[lineto, dotted, bend left=10] (rootarea)
edge[linefrom, bend right=10] (rootarea);
\node[block, right of=subarea, xshift=5em] (tracker) {\emph{tap} tracker}
\node[block, below of=rootarea, xshift=-5em] (circlearea) {Circular area}
edge[linefrom] (rootarea)
edge[lineto, bend left=25] (rootarea);
\node[block, left of=circlearea, xshift=-4em] (dragtracker) {\emph{drag} tracker}
edge[lineto, dotted, bend right=10] (circlearea)
edge[linefrom, bend left=10] (circlearea);
\node[block, below of=rootarea, xshift=5em] (subarea) {Button area}
edge[linefrom] (rootarea)
edge[lineto, bend right=25] (rootarea);
\node[block, right of=subarea, xshift=4em] (tracker) {\emph{tap} tracker}
edge[lineto, dotted, bend left=10] (subarea)
edge[linefrom, bend right=10] (subarea);
\node[block, below of=subarea, yshift=-.5em] {Application}
edge[linefrom, dotted, bend left=60] (rootarea)
\node[block, below of=rootarea, yshift=-5em] {Application}
edge[linefrom, dotted] (circlearea)
edge[linefrom, dotted] (rootarea)
edge[linefrom, dotted] (subarea);
\group{subarea}{eventdriver}{tracker}{subarea}{Architecture}
\group{dragtracker}{eventdriver}{tracker}{subarea}{Architecture}
}
\caption{#1}
\caption{Diagram representation of an extended example, showing the
flow of events and gestures in the architecture. The root area represents
an application windows that can be resized using \emph{pinch} gestures.
The window contains a draggable circle, and a button that listens to
\emph{tap} gestures. Dotted arrows represent a flow of gestures, regular
arrows represent events (unless labeled otherwise).}
\label{fig:examplediagram}
\end{figure}
}
......
......@@ -2,7 +2,7 @@
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{hyperref,graphicx,tikz,subfigure,float}
\usepackage{hyperref,graphicx,tikz,subfigure,float,lipsum}
% Link colors
\hypersetup{colorlinks=true,linkcolor=black,urlcolor=blue,citecolor=DarkGreen}
......@@ -437,56 +437,63 @@ goal is to test the effectiveness of the design and detect its shortcomings.
propagation}. To reserve an event for a particular gesture, a gesture
tracker can stop its propagation. When propagation of an event is stopped,
it will not be passed on the ancestor areas, thus reserving the event.
Figure \ref{fig:eventpropagation} illustrates the use of event propagation,
applied to the example of the white and gray squares.
\eventpropagationfigure
The diagram in appendix \ref{app:eventpropagation} illustrates the use of
event propagation, applied to the example of the white and gray squares.
\section{Serving multiple applications}
\label{sec:multiple-applications}
% TODO
\emph{TODO}
The design of the architecture is essentially complete with the components
specified in this chapter. However, one specification has not yet been
discussed: the ability address the architecture using a method of
communication independent of the application programming language.
If an application must start the architecture instance in a thread within
the application itself, the architecture is required to be compatible with
the programming language used to write the application. To overcome the
language barrier, an instance of the architecture would have to run in a
separate process.
A common and efficient way of communication between two separate processes
is through the use of a network protocol. In this particular case, the
architecture can run as a daemon\footnote{``daemon'' is a name Unix uses to
indicate that a process runs as a background process.} process, listening
to driver messages and triggering gestures in registered applications.
An advantage of a daemon setup is that is can serve multiple applications
at the same time. Alternatively, each application that uses gesture
interaction would start its own instance of the architecture in a separate
process, which would be less efficient.
\section{Example usage}
\label{sec:example}
This section describes an example that illustrates the API of the
architecture. The example application listens to tap events on a button.
The button is located inside an application window, which can be resized
using pinch gestures.
% TODO: comments weg, in pseudocode opschrijven, uitbreiden met draggable
% circle en illustrerende figuur
\begin{verbatim}
initialize GUI, creating a window
This section describes an extended example to illustrate the data flow of
the architecture. The example application listens to tap events on a button
within an application window. The window also contains a draggable circle.
The application window can be resized using \emph{pinch} gestures. Figure
\ref{fig:examplediagram} shows the architecture created by the pseudo code
below.
create a root area with the position and size of the application window
create an area with the position and size of the button
\begin{verbatim}
initialize GUI framework, creating a window and nessecary GUI widgets
create a new event server
set 'rootwidget' as root widget for 'server'
create a root area that synchronizes position and size with the application window
define 'rotation' gesture handler and bind it to the root area
# Define handlers and bind them to corresponding widgets
begin function resize_handler(gesture)
resize GUI window
update position and size of root wigdet
end function
create an area with the position and radius of the circle
define 'drag' gesture handler and bind it to the circle area
begin function tap_handler_handler(gesture)
# Perform some action that the button is meant to do
end function
create an area with the position and size of the button
define 'tap' gesture handler and bind it to the button area
bind ('pinch', resize_handler) to rootwidget
bind ('tap', tap_handler) to buttonwidget
create a new event server and assign the created root area to it
# Start event server (which in turn starts a driver-specific event server)
start server
\end{verbatim}
start the event server in a new thread
start the GUI main loop in the current thread
\end{verbatim}
\examplediagram{Diagram representation of the example above. Dotted arrows
represent gestures, normal arrows represent events (unless labeled
otherwise).}
\examplediagram
\chapter{Test applications}
......@@ -496,6 +503,7 @@ goal is to test the effectiveness of the design and detect its shortcomings.
% TODO
% alleen window.contains op point down, niet move/up
% een paar simpele windows en trackers
% Geen netwerk protocol
To test multi-touch interaction properly, a multi-touch device is required. The
University of Amsterdam (UvA) has provided access to a multi-touch table from
......@@ -643,4 +651,9 @@ algorithms based on its test program.
Also, the different detection algorithms are all implemented in the same file,
making it complex to read or debug, and difficult to extend.
\chapter{Diagram demonstrating event propagation}
\label{app:eventpropagation}
\eventpropagationfigure
\end{document}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment