17 #ifndef _geventqueue_h 18 #define _geventqueue_h 23 #include <QReadWriteLock> 44 class GEventQueue :
public QObject {
53 static GEventQueue* instance();
59 int getEventMask()
const;
65 GEvent getNextEvent(
int mask = ANY_EVENT);
71 bool isAcceptingEvent(
const GEvent& event)
const;
72 bool isAcceptingEvent(
int type)
const;
79 void setEventMask(
int mask);
87 GEvent waitForEvent(
int mask = ANY_EVENT);
96 Q_DISABLE_COPY(GEventQueue)
104 void enqueueEvent(
const GEvent& event);
105 bool isEmpty()
const;
107 void runOnQtGuiThreadAsync(GThunk thunk);
108 void runOnQtGuiThreadSync(GThunk thunk);
110 static GEventQueue* _instance;
111 std::queue<GThunk> _functionQueue;
112 std::queue<GEvent> _eventQueue;
113 QReadWriteLock _eventQueueMutex;
114 QReadWriteLock _functionQueueMutex;
122 #endif // _geventqueue_h A GEvent represents a user action that has occurred on a graphical interactor.
Definition: gevent.h:153
A GObservable object is one that is able to send out events.
Definition: gobservable.h:36
The GThread class is a utility class containing static methods that allow you to run code on various ...
Definition: gthread.h:111