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 @@ ...@@ -154,8 +154,8 @@
\end{figure} \end{figure}
} }
\newcommand{\examplediagram}[1]{ \newcommand{\examplediagram}{
\begin{figure}[h] \begin{figure}[h!]
\center \center
\architecture{ \architecture{
\node[block, below of=driver] (eventdriver) {Event driver} \node[block, below of=driver] (eventdriver) {Event driver}
...@@ -163,24 +163,38 @@ ...@@ -163,24 +163,38 @@
\node[block, below of=eventdriver] (rootarea) {Root area} \node[block, below of=eventdriver] (rootarea) {Root area}
edge[linefrom] (eventdriver); edge[linefrom] (eventdriver);
\node[block, right of=rootarea, xshift=4em] {\emph{pinch} tracker}
\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}
edge[lineto, dotted, bend left=10] (rootarea) edge[lineto, dotted, bend left=10] (rootarea)
edge[linefrom, bend right=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[lineto, dotted, bend left=10] (subarea)
edge[linefrom, bend right=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); 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} \end{figure}
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
\usepackage[english]{babel} \usepackage[english]{babel}
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
\usepackage{hyperref,graphicx,tikz,subfigure,float} \usepackage{hyperref,graphicx,tikz,subfigure,float,lipsum}
% Link colors % Link colors
\hypersetup{colorlinks=true,linkcolor=black,urlcolor=blue,citecolor=DarkGreen} \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. ...@@ -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 propagation}. To reserve an event for a particular gesture, a gesture
tracker can stop its propagation. When propagation of an event is stopped, 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. it will not be passed on the ancestor areas, thus reserving the event.
Figure \ref{fig:eventpropagation} illustrates the use of event propagation, The diagram in appendix \ref{app:eventpropagation} illustrates the use of
applied to the example of the white and gray squares. event propagation, applied to the example of the white and gray squares.
\eventpropagationfigure
\section{Serving multiple applications} \section{Serving multiple applications}
\label{sec:multiple-applications} \label{sec:multiple-applications}
% TODO The design of the architecture is essentially complete with the components
\emph{TODO} 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} \section{Example usage}
\label{sec:example} \label{sec:example}
This section describes an example that illustrates the API of the This section describes an extended example to illustrate the data flow of
architecture. The example application listens to tap events on a button. the architecture. The example application listens to tap events on a button
The button is located inside an application window, which can be resized within an application window. The window also contains a draggable circle.
using pinch gestures. The application window can be resized using \emph{pinch} gestures. Figure
\ref{fig:examplediagram} shows the architecture created by the pseudo code
% TODO: comments weg, in pseudocode opschrijven, uitbreiden met draggable below.
% circle en illustrerende figuur
\begin{verbatim}
initialize GUI, creating a window
create a root area with the position and size of the application window \begin{verbatim}
create an area with the position and size of the button initialize GUI framework, creating a window and nessecary GUI widgets
create a new event server create a root area that synchronizes position and size with the application window
set 'rootwidget' as root widget for 'server' define 'rotation' gesture handler and bind it to the root area
# Define handlers and bind them to corresponding widgets create an area with the position and radius of the circle
begin function resize_handler(gesture) define 'drag' gesture handler and bind it to the circle area
resize GUI window
update position and size of root wigdet
end function
begin function tap_handler_handler(gesture) create an area with the position and size of the button
# Perform some action that the button is meant to do define 'tap' gesture handler and bind it to the button area
end function
bind ('pinch', resize_handler) to rootwidget create a new event server and assign the created root area to it
bind ('tap', tap_handler) to buttonwidget
# Start event server (which in turn starts a driver-specific event server) start the event server in a new thread
start server start the GUI main loop in the current thread
\end{verbatim} \end{verbatim}
\examplediagram{Diagram representation of the example above. Dotted arrows \examplediagram
represent gestures, normal arrows represent events (unless labeled
otherwise).}
\chapter{Test applications} \chapter{Test applications}
...@@ -496,6 +503,7 @@ goal is to test the effectiveness of the design and detect its shortcomings. ...@@ -496,6 +503,7 @@ goal is to test the effectiveness of the design and detect its shortcomings.
% TODO % TODO
% alleen window.contains op point down, niet move/up % alleen window.contains op point down, niet move/up
% een paar simpele windows en trackers % een paar simpele windows en trackers
% Geen netwerk protocol
To test multi-touch interaction properly, a multi-touch device is required. The 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 University of Amsterdam (UvA) has provided access to a multi-touch table from
...@@ -643,4 +651,9 @@ algorithms based on its test program. ...@@ -643,4 +651,9 @@ algorithms based on its test program.
Also, the different detection algorithms are all implemented in the same file, Also, the different detection algorithms are all implemented in the same file,
making it complex to read or debug, and difficult to extend. making it complex to read or debug, and difficult to extend.
\chapter{Diagram demonstrating event propagation}
\label{app:eventpropagation}
\eventpropagationfigure
\end{document} \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