QNitpickerIntegration::QNitpickerIntegration()
    : _nitpicker_screen(new QNitpickerScreen()),
      _event_dispatcher(createUnixEventDispatcher())
{
    QGuiApplicationPrivate::instance()->setEventDispatcher(_event_dispatcher);
    screenAdded(_nitpicker_screen);
}
QEglFSIntegration::QEglFSIntegration()
    : mHwc(NULL)
    , mEventDispatcher(createUnixEventDispatcher())
    , mFontDb(new QGenericUnixFontDatabase())
{
#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0)
    QGuiApplicationPrivate::instance()->setEventDispatcher(mEventDispatcher);
#endif

    mHwc = new HwComposerContext();

    EGLint major, minor;

    if (!eglBindAPI(EGL_OPENGL_ES_API)) {
        qWarning("Could not bind GL_ES API\n");
        qFatal("EGL error");
    }

    mDisplay = eglGetDisplay(mHwc->platformDisplay());
    if (mDisplay == EGL_NO_DISPLAY) {
        qWarning("Could not open egl display\n");
        qFatal("EGL error");
    }

    if (!eglInitialize(mDisplay, &major, &minor)) {
        qWarning("Could not initialize egl display\n");
        qFatal("EGL error");
    }

    mScreen = new QEglFSScreen(mHwc, mDisplay);
    screenAdded(mScreen);

    mInputContext = QPlatformInputContextFactory::create();
}
QEglFSIntegration::QEglFSIntegration()
    : mSfc(NULL)
    , mEventDispatcher(createUnixEventDispatcher())
    , mFontDb(new QGenericUnixFontDatabase())
{

    mSfc = new SurfaceFlingerContext();

    EGLint major, minor;

    if (!eglBindAPI(EGL_OPENGL_ES_API)) {
        qWarning("Could not bind GL_ES API\n");
        qFatal("EGL error");
    }

    mDisplay = eglGetDisplay(mSfc->platformDisplay());
    if (mDisplay == EGL_NO_DISPLAY) {
        qWarning("Could not open egl display\n");
        qFatal("EGL error");
    }

    if (!eglInitialize(mDisplay, &major, &minor)) {
        qWarning("Could not initialize egl display\n");
        qFatal("EGL error");
    }

    mScreen = new QEglFSScreen(mSfc, mDisplay);
    screenAdded(mScreen);

    mInputContext = QPlatformInputContextFactory::create();
}
Beispiel #4
0
QAbstractEventDispatcher *QXcbIntegration::createEventDispatcher() const
{
    QAbstractEventDispatcher *dispatcher = createUnixEventDispatcher();
    for (int i = 0; i < m_connections.size(); i++)
        m_connections[i]->eventReader()->registerEventDispatcher(dispatcher);
    return dispatcher;
}
QAbstractEventDispatcher *HeadlessIntegration::createEventDispatcher() const
{
#ifdef __APPLE__
    return new QEventDispatcherUNIX();
#else
    return createUnixEventDispatcher();
#endif
}
QAbstractEventDispatcher *QMinimal_i2cIntegration::createEventDispatcher() const {
#ifdef Q_OS_WIN
#ifndef Q_OS_WINRT
    return new QEventDispatcherWin32;
#else // !Q_OS_WINRT
    return new QEventDispatcherWinRT;
#endif // Q_OS_WINRT
#else
    return createUnixEventDispatcher();
#endif
}
QAbstractEventDispatcher *QOffscreenIntegration::createEventDispatcher() const
{
#if defined(Q_OS_UNIX)
    return createUnixEventDispatcher();
#elif defined(Q_OS_WIN)
#ifndef Q_OS_WINRT
    return new QOffscreenEventDispatcher<QEventDispatcherWin32>();
#else // !Q_OS_WINRT
    return new QOffscreenEventDispatcher<QEventDispatcherWinRT>();
#endif // Q_OS_WINRT
#else
    return 0;
#endif
}
Beispiel #8
0
QT_BEGIN_NAMESPACE

QEglFSIntegration::QEglFSIntegration()
    : mEventDispatcher(createUnixEventDispatcher()), mFontDb(new QGenericUnixFontDatabase())
{
    QGuiApplicationPrivate::instance()->setEventDispatcher(mEventDispatcher);

#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
    new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString() /* spec */, this);
    new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString() /* spec */, this);
    new QEvdevTouchScreenHandlerThread(QString() /* spec */, this);
#endif

    QEglFSHooks::hooks()->platformInit();

    EGLint major, minor;

    if (!eglBindAPI(EGL_OPENGL_ES_API)) {
        qWarning("Could not bind GL_ES API\n");
        qFatal("EGL error");
    }

    mDisplay = eglGetDisplay(QEglFSHooks::hooks() ? QEglFSHooks::hooks()->platformDisplay() : EGL_DEFAULT_DISPLAY);
    if (mDisplay == EGL_NO_DISPLAY) {
        qWarning("Could not open egl display\n");
        qFatal("EGL error");
    }

    if (!eglInitialize(mDisplay, &major, &minor)) {
        qWarning("Could not initialize egl display\n");
        qFatal("EGL error");
    }

    int swapInterval = 1;
    QByteArray swapIntervalString = qgetenv("QT_QPA_EGLFS_SWAPINTERVAL");
    if (!swapIntervalString.isEmpty()) {
        bool ok;
        swapInterval = swapIntervalString.toInt(&ok);
        if (!ok)
            swapInterval = 1;
    }
    eglSwapInterval(mDisplay, swapInterval);

    mScreen = new QEglFSScreen(mDisplay);
    screenAdded(mScreen);

    mInputContext = QPlatformInputContextFactory::create();
}
QT_BEGIN_NAMESPACE


QFreeRdpIntegration::QFreeRdpIntegration(const QStringList& paramList)
    : mFontDb(new QGenericUnixFontDatabase())
    , mEventDispatcher(createUnixEventDispatcher())
{
	QGuiApplicationPrivate::instance()->setEventDispatcher(mEventDispatcher);

	//Disable desktop settings for now (or themes crash)
	QGuiApplicationPrivate::obey_desktop_settings = false;

	mPlatform = new QFreeRdpPlatform(paramList, mEventDispatcher);
	screenAdded(mPlatform->getScreen());
    mFontDb = new QGenericUnixFontDatabase();
}
Beispiel #10
0
QOpenWFDIntegration::QOpenWFDIntegration()
    : QPlatformIntegration()
    , mPrinterSupport(new QGenericUnixPrinterSupport)
    , mEventDispatcher(createUnixEventDispatcher())
{
    QGuiApplicationPrivate::instance()->setEventDispatcher(mEventDispatcher);
    int numberOfDevices = wfdEnumerateDevices(0,0,0);

    WFDint devices[numberOfDevices];
    int actualNumberOfDevices = wfdEnumerateDevices(devices,numberOfDevices,0);
    Q_ASSERT(actualNumberOfDevices == numberOfDevices);

    for (int i = 0; i < actualNumberOfDevices; i++) {
        mDevices.append(new QOpenWFDDevice(this,devices[i]));
    }

    mFontDatabase = new QGenericUnixFontDatabase();
    mNativeInterface = new QOpenWFDNativeInterface;
}
QOffscreenIntegration::QOffscreenIntegration()
{
#if defined(Q_OS_UNIX)
    m_eventDispatcher = createUnixEventDispatcher();
#if defined(Q_OS_MAC)
    m_fontDatabase.reset(new QPlatformFontDatabase());
#else
    m_fontDatabase.reset(new QGenericUnixFontDatabase());
#endif
#elif defined(Q_OS_WIN)
    m_eventDispatcher = new QOffscreenEventDispatcher<QEventDispatcherWin32>();
    m_fontDatabase.reset(new QBasicFontDatabase());
#endif

#ifndef QT_NO_DRAGANDDROP
    m_drag.reset(new QOffscreenDrag);
#endif
    m_services.reset(new QPlatformServices);

    QGuiApplicationPrivate::instance()->setEventDispatcher(m_eventDispatcher);
    screenAdded(new QOffscreenScreen);
}
QT_USE_NAMESPACE

QWaylandIntegration::QWaylandIntegration()
    : mFontDb(new QGenericUnixFontDatabase())
    , mEventDispatcher(createUnixEventDispatcher())
    , mNativeInterface(new QWaylandNativeInterface(this))
#ifndef QT_NO_ACCESSIBILITY
    , mAccessibility(new QPlatformAccessibility())
#else
    , mAccessibility(0)
#endif
{
    QGuiApplicationPrivate::instance()->setEventDispatcher(mEventDispatcher);
    QGuiApplication::setDesktopSettingsAware(false);
    mDisplay = new QWaylandDisplay();
    mClipboard = new QWaylandClipboard(mDisplay);
    mDrag = new QWaylandDrag(mDisplay);

    foreach (QPlatformScreen *screen, mDisplay->screens())
        screenAdded(screen);

    mInputContext = QPlatformInputContextFactory::create();
}
QAbstractEventDispatcher *QMinimalEglIntegration::createEventDispatcher() const
{
    return createUnixEventDispatcher();
}
Beispiel #14
0
QAbstractEventDispatcher *QXcbIntegration::createEventDispatcher() const
{
    return createUnixEventDispatcher();
}
Beispiel #15
0
QQnxIntegration::QQnxIntegration()
    : QPlatformIntegration()
    , m_screenEventThread(0)
    , m_navigatorEventHandler(new QQnxNavigatorEventHandler())
    , m_virtualKeyboard(0)
#if defined(QQNX_PPS)
    , m_navigatorEventNotifier(0)
    , m_inputContext(0)
    , m_buttonsNotifier(new QQnxButtonEventNotifier())
#endif
    , m_services(0)
    , m_fontDatabase(new QGenericUnixFontDatabase())
#if defined(Q_OS_BLACKBERRY)
    , m_eventDispatcher(new QQnxEventDispatcherBlackberry())
    , m_bpsEventFilter(0)
#else
    , m_eventDispatcher(createUnixEventDispatcher())
#endif
    , m_nativeInterface(new QQnxNativeInterface())
    , m_screenEventHandler(new QQnxScreenEventHandler(this))
#if !defined(QT_NO_CLIPBOARD)
    , m_clipboard(0)
#endif
    , m_navigator(0)
#if !defined(QT_NO_DRAGANDDROP)
    , m_drag(new QSimpleDrag())
#endif
{
    qIntegrationDebug() << Q_FUNC_INFO;
    // Open connection to QNX composition manager
    errno = 0;
    int result = screen_create_context(&m_screenContext, SCREEN_APPLICATION_CONTEXT);
    if (result != 0) {
        qFatal("QQnx: failed to connect to composition manager, errno=%d", errno);
    }

    // Not on BlackBerry, it has specialized event dispatcher which also handles navigator events
#if !defined(Q_OS_BLACKBERRY) && defined(QQNX_PPS)
    // Create/start navigator event notifier
    m_navigatorEventNotifier = new QQnxNavigatorEventNotifier(m_navigatorEventHandler);

    // delay invocation of start() to the time the event loop is up and running
    // needed to have the QThread internals of the main thread properly initialized
    QMetaObject::invokeMethod(m_navigatorEventNotifier, "start", Qt::QueuedConnection);
#endif

#if !defined(QT_NO_OPENGL)
    // Initialize global OpenGL resources
    QQnxGLContext::initialize();
#endif

    // Create/start event thread
#if defined(QQNX_SCREENEVENTTHREAD)
    m_screenEventThread = new QQnxScreenEventThread(m_screenContext, m_screenEventHandler);
    m_screenEventThread->start();
#endif

    // Not on BlackBerry, it has specialized event dispatcher which also handles virtual keyboard events
#if !defined(Q_OS_BLACKBERRY) && defined(QQNX_PPS)
    // Create/start the keyboard class.
    m_virtualKeyboard = new QQnxVirtualKeyboardPps();

    // delay invocation of start() to the time the event loop is up and running
    // needed to have the QThread internals of the main thread properly initialized
    QMetaObject::invokeMethod(m_virtualKeyboard, "start", Qt::QueuedConnection);
#endif

#if defined(Q_OS_BLACKBERRY)
    m_navigator = new QQnxNavigatorBps();
#elif defined(QQNX_PPS)
    m_navigator = new QQnxNavigatorPps();
#endif

    // Create services handling class
    if (m_navigator)
        m_services = new QQnxServices(m_navigator);

#if defined(Q_OS_BLACKBERRY)
    QQnxVirtualKeyboardBps* virtualKeyboardBps = new QQnxVirtualKeyboardBps;
    m_bpsEventFilter = new QQnxBpsEventFilter(m_navigatorEventHandler,
            (m_screenEventThread ? 0 : m_screenEventHandler), virtualKeyboardBps);
    m_bpsEventFilter->installOnEventDispatcher(m_eventDispatcher);

    m_virtualKeyboard = virtualKeyboardBps;
#endif

    // Create displays for all possible screens (which may not be attached). We have to do this
    // *after* the call to m_bpsEventFilter->installOnEventDispatcher(m_eventDispatcher). The
    // reason for this is that we have to be registered for NAVIGATOR events before we create the
    // QQnxScreen objects, and hence the QQnxRootWindow's. It is when the NAVIGATOR service sees
    // the window creation that it starts sending us messages which results in a race if we
    // create the displays first.
    createDisplays();

#if !defined(QQNX_SCREENEVENTTHREAD) && defined(Q_OS_BLACKBERRY)
    // Register for screen domain events with bps
    Q_FOREACH (QQnxScreen *screen, m_screens)
        m_bpsEventFilter->registerForScreenEvents(screen);
#endif

    if (m_virtualKeyboard) {
        // TODO check if we need to do this for all screens or only the primary one
        QObject::connect(m_virtualKeyboard, SIGNAL(heightChanged(int)),
                         primaryDisplay(), SLOT(keyboardHeightChanged(int)));

#if defined(QQNX_PPS)
        // Set up the input context
        m_inputContext = new QQnxInputContext(this, *m_virtualKeyboard);
#endif
    }

#if defined(QQNX_PPS)
    // delay invocation of start() to the time the event loop is up and running
    // needed to have the QThread internals of the main thread properly initialized
    QMetaObject::invokeMethod(m_buttonsNotifier, "start", Qt::QueuedConnection);
#endif
}
QAbstractEventDispatcher *QEGLPlatformIntegration::createEventDispatcher() const
{
    return createUnixEventDispatcher();
}
QAbstractEventDispatcher *QMirClientClientIntegration::createEventDispatcher() const
{
    return createUnixEventDispatcher();
}