Taddeus Kroes 13 роки тому
батько
коміт
3cced0221c
1 змінених файлів з 33 додано та 4 видалено
  1. 33 4
      docs/report.tex

+ 33 - 4
docs/report.tex

@@ -458,10 +458,39 @@ events.
 
     \section{Example usage}
 
-    % TODO
-    % vertellen hoe je tracker aanmaakt, binnen een window
-
-    %\section{Network protocol}
+    This section describes an example that illustrates the communication
+    between different components. The example application listens to tap events
+    in a GUI window.
+
+    \begin{verbatim}
+    # Create a gesture server that will be started later
+    server = new GestureServer object
+
+    # Add a new window to the server, representing the GUI
+    window = new Window object
+    set window position and size to that of GUIO window
+    add window to server
+
+    # Define a handler that must be triggered when a tap gesture is detected
+    begin function handler(gesture)
+        # Do something
+    end function
+
+    # Create a tracker that detects tap gestures
+    tracker = new TapTracker object  # Where TapTracker is an implementation of
+                                     # abstract Tracker
+    add tracker tot window
+    bind handler to tracker.tap
+
+    # If the GUI toolkit allows it, bind window movement and resize handlers
+    # that alter the position size and sieze of the window object
+
+    # Start the gesture server (which in turn starts a driver-specific event
+    # server)
+    start server
+    \end{verbatim}
+
+    \section{Network protocol}
 
     % TODO
     % ZeroMQ gebruiken voor communicatie tussen meerdere processen (in