Foundation classes for a basic GUI implementing simple widgets and events
Dependents: TouchScreenGUIDemo
Diff: Events/EventDispatcher.h
- Revision:
- 18:d849f3ada858
- Parent:
- 12:63db16fea709
--- a/Events/EventDispatcher.h Sun May 22 16:35:23 2016 +0000 +++ b/Events/EventDispatcher.h Sat May 28 14:50:14 2016 +0000 @@ -1,6 +1,8 @@ #ifndef SIMPLEGUI_EVENT_DISPATCHER_H #define SIMPLEGUI_EVENT_DISPATCHER_H +#include "rtos.h" + #include "EventListener.h" #include "LinkedList.h" @@ -15,10 +17,21 @@ void attachListener(EventListener* l); void detachListener(EventListener* l); void dispatchEvent(Event e); + + /** + * Normally called from a separate thread to queue an event for later processing by the main thread + **/ + void queueEvent(const Event e); + + /** + * Should be called on the main thread + **/ + void pumpEvents(); private: LinkedList<EventListener> _listeners; + Mail<Event, 64> _mailbox; };