m_events << event;
}
-QList<xcb_generic_event_t *> *QXcbEventReader::lock()
+QXcbEventArray *QXcbEventReader::lock()
{
m_mutex.lock();
#ifndef XCB_POLL_FOR_QUEUED_EVENT
void QXcbConnection::processXcbEvents()
{
- QList<xcb_generic_event_t *> *eventqueue = m_reader->lock();
+ QXcbEventArray *eventqueue = m_reader->lock();
for(int i = 0; i < eventqueue->size(); ++i) {
xcb_generic_event_t *event = eventqueue->at(i);
xcb_generic_event_t *QXcbConnection::checkEvent(int type)
{
- QList<xcb_generic_event_t *> *eventqueue = m_reader->lock();
+ QXcbEventArray *eventqueue = m_reader->lock();
for (int i = 0; i < eventqueue->size(); ++i) {
xcb_generic_event_t *event = eventqueue->at(i);
#include <QObject>
#include <QThread>
#include <QVector>
+#include <QVarLengthArray>
#ifdef XCB_USE_XINPUT2_MAEMO
struct XInput2Data;
};
}
+typedef QVarLengthArray<xcb_generic_event_t *, 64> QXcbEventArray;
+
class QXcbConnection;
class QXcbEventReader : public QThread
{
void run();
#endif
- QList<xcb_generic_event_t *> *lock();
+ QXcbEventArray *lock();
void unlock();
signals:
void addEvent(xcb_generic_event_t *event);
QMutex m_mutex;
- QList<xcb_generic_event_t *> m_events;
+ QXcbEventArray m_events;
QXcbConnection *m_connection;
};
template<typename T>
xcb_generic_event_t *QXcbConnection::checkEvent(const T &checker)
{
- QList<xcb_generic_event_t *> *eventqueue = m_reader->lock();
+ QXcbEventArray *eventqueue = m_reader->lock();
for (int i = 0; i < eventqueue->size(); ++i) {
xcb_generic_event_t *event = eventqueue->at(i);