Duncan McIntyre / SimpleGUITouchScreen

Dependents:   TouchScreenGUIDemo

Revision:
5:e3084e17e8e6
Parent:
4:0be0d6a61e90
--- a/TouchScreenEventSource.cpp	Tue May 17 16:28:53 2016 +0000
+++ b/TouchScreenEventSource.cpp	Sat May 28 14:50:49 2016 +0000
@@ -6,8 +6,8 @@
 * tap and double-tap events
 **/
 
-TouchScreenEventSource::TouchScreenEventSource(TouchScreen* touchScreen, GUI* gui) 
-: EventSource(gui), _touchScreen(touchScreen), _state(Idle)
+TouchScreenEventSource::TouchScreenEventSource(TouchScreen* touchScreen, EventDispatcher* dispatcher) 
+: EventSource(dispatcher), _touchScreen(touchScreen), _state(Idle)
 {
     _touchScreen->setTouchStartHandler(this, &TouchScreenEventSource::touchStartHandler);
     _touchScreen->setTouchEndHandler(this, &TouchScreenEventSource::touchEndHandler);
@@ -26,7 +26,7 @@
     e.screenX = p.screenX;
     e.screenY = p.screenY;
     e.type = TOUCH_START;
-    _gui->queueEvent(e);
+    _eventDispatcher->queueEvent(e);
 }
 
 void TouchScreenEventSource::touchMoveHandler(TouchPosition p)
@@ -36,7 +36,7 @@
     e.screenX = p.screenX;
     e.screenY = p.screenY;
     e.type = TOUCH_MOVE;
-    _gui->queueEvent(e);
+    _eventDispatcher->queueEvent(e);
 }
 
 void TouchScreenEventSource::touchEndHandler(TouchPosition p)
@@ -71,10 +71,10 @@
         tapped = true;
     }
         
-    _gui->queueEvent(endEvent);
+    _eventDispatcher->queueEvent(endEvent);
     
     if(tapped) {
-        _gui->queueEvent(tapEvent);
+        _eventDispatcher->queueEvent(tapEvent);
     }
 }