diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2011-06-22 10:01:14 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2011-06-27 14:31:15 +0200 |
commit | 80eb461360eb39657ac21ce8070c02f071884e9a (patch) | |
tree | 516338ddf364ac0337271db6d15c21eca689709f /src/plugins/platforms/xcb/qxcbintegration.cpp | |
parent | 0584424d5ccc7d1e3b9aa60da46ca1db244ce470 (diff) |
ibus IM support for the xcb backend
Test code to check input methods using the ibus backend
used on e.g. ubuntu. The IM code is not very sophisticated,
but enough to test that things are working.
Reviewed-by: Jørgen Lind
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbintegration.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbintegration.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 984c8afb9d..fcc17b28b2 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -71,6 +71,11 @@ #include <QtPlatformSupport/private/qeglplatformcontext_p.h> #endif +#define XCB_USE_IBUS +#if defined(XCB_USE_IBUS) +#include "QtPlatformSupport/qibusplatforminputcontext.h" +#endif + QXcbIntegration::QXcbIntegration() : m_connection(new QXcbConnection), m_printerSupport(new QGenericUnixPrinterSupport) { @@ -79,6 +84,8 @@ QXcbIntegration::QXcbIntegration() m_fontDatabase = new QGenericUnixFontDatabase(); m_nativeInterface = new QXcbNativeInterface; + + m_inputContext = 0; } QXcbIntegration::~QXcbIntegration() @@ -141,6 +148,11 @@ QAbstractEventDispatcher *QXcbIntegration::createEventDispatcher() const { QAbstractEventDispatcher *eventDispatcher = createUnixEventDispatcher(); m_connection->setEventDispatcher(eventDispatcher); +#ifdef XCB_USE_IBUS + // A bit hacky to do this here, but we need an eventloop before we can instantiate + // the input context. + const_cast<QXcbIntegration *>(this)->m_inputContext = new QIBusPlatformInputContext; +#endif return eventDispatcher; } @@ -318,3 +330,8 @@ QPlatformDrag *QXcbIntegration::drag() const { return m_connection->drag(); } + +QPlatformInputContext *QXcbIntegration::inputContext() const +{ + return m_inputContext; +} |