diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-01-22 21:05:06 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-23 11:02:18 +0100 |
commit | e309e7a3e8227647f64b8c1e5eb3fa893c4a4b61 (patch) | |
tree | 13740827e890181ca5f10e898790567c8c43574a /src/plugins/platforms/xcb/qxcbnativeinterface.h | |
parent | ccb059b0e20ee9c6a073b712b712105c534deae4 (diff) |
XCB: Introduce enumeration for event filter types.
Remove QByteArray-construction and hash lookup in the event
handling; use an enumeration indexing an array instead.
Change-Id: I4d272b32a5ff71c8da58197cf3a0b38c1e61d489
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbnativeinterface.h')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbnativeinterface.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h index 1bb83fd031..521528670b 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.h +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h @@ -61,11 +61,18 @@ public: EglContext }; + enum EventFilterType { + GenericEventFilter, + EventFilterCount + }; + + QXcbNativeInterface(); + void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context); void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window); EventFilter setEventFilter(const QByteArray &eventType, EventFilter filter); - EventFilter eventFilterForEventType(const QByteArray& eventType) const; + EventFilter eventFilter(EventFilterType type) const { return m_eventFilters[type]; } void *displayForWindow(QWindow *window); void *eglDisplayForWindow(QWindow *window); @@ -76,7 +83,7 @@ public: void *eglContextForContext(QOpenGLContext *context); private: - QHash<QByteArray, EventFilter> m_eventFilters; + EventFilter m_eventFilters[EventFilterCount]; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); }; |