Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TouchScreenGUIDemo
Diff: TouchScreenEventSource.cpp
- Revision:
- 5:e3084e17e8e6
- Parent:
- 4:0be0d6a61e90
diff -r 0be0d6a61e90 -r e3084e17e8e6 TouchScreenEventSource.cpp
--- 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);
}
}