Foundation classes for a basic GUI implementing simple widgets and events. (Fork for custom changes.)
Fork of SimpleGUI by
Events/EventDispatcher.h
- Committer:
- elh
- Date:
- 2016-10-18
- Revision:
- 20:ef07d42ea062
- Parent:
- 18:d849f3ada858
File content as of revision 20:ef07d42ea062:
#ifndef SIMPLEGUI_EVENT_DISPATCHER_H #define SIMPLEGUI_EVENT_DISPATCHER_H #include "rtos.h" #include "EventListener.h" #include "LinkedList.h" class EventDispatcher { public: EventDispatcher(); 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; }; #endif