Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qintegrityfbintegration.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
7
8#include <QtGui/private/qgenericunixfontdatabase_p.h>
9#include <QtGui/private/qgenericunixeventdispatcher_p.h>
10
11#include <QtFbSupport/private/qfbbackingstore_p.h>
12#include <QtFbSupport/private/qfbwindow_p.h>
13#include <QtFbSupport/private/qfbcursor_p.h>
14
15#include <QtGui/private/qguiapplication_p.h>
16#include <qpa/qplatforminputcontextfactory_p.h>
17#include <qpa/qwindowsysteminterface.h>
18#include <qpa/qplatformservices.h>
19
21
22QIntegrityFbIntegration::QIntegrityFbIntegration(const QStringList &paramList)
23 : m_fontDb(new QGenericUnixFontDatabase)
24{
25 m_primaryScreen = new QIntegrityFbScreen(paramList);
26}
27
29{
30 QWindowSystemInterface::handleScreenRemoved(m_primaryScreen);
31}
32
34{
35 if (m_primaryScreen->initialize())
36 QWindowSystemInterface::handleScreenAdded(m_primaryScreen);
37 else
38 qWarning("integrityfb: Failed to initialize screen");
39
40 m_inputContext = QPlatformInputContextFactory::create();
41
42 m_nativeInterface.reset(new QPlatformNativeInterface);
43
44 if (!qEnvironmentVariableIntValue("QT_QPA_FB_DISABLE_INPUT"))
45 createInputHandlers();
46}
47
48bool QIntegrityFbIntegration::hasCapability(QPlatformIntegration::Capability cap) const
49{
50 switch (cap) {
51 case ThreadedPixmaps: return true;
52 case WindowManagement: return false;
53 default: return QPlatformIntegration::hasCapability(cap);
54 }
55}
56
58{
59 return new QFbBackingStore(window);
60}
61
63{
64 return new QFbWindow(window);
65}
66
67QAbstractEventDispatcher *QIntegrityFbIntegration::createEventDispatcher() const
68{
69 return createUnixEventDispatcher();
70}
71
73{
74 QList<QPlatformScreen *> list;
75 list.append(m_primaryScreen);
76 return list;
77}
78
80{
81 return m_fontDb.data();
82}
83
85{
86 if (m_services.isNull())
87 m_services.reset(new QPlatformServices);
88
89 return m_services.data();
90}
91
92void QIntegrityFbIntegration::createInputHandlers()
93{
94 new QIntegrityHIDManager("HID", "", this);
95}
96
98{
99 return m_nativeInterface.data();
100}
101
102QT_END_NAMESPACE
QPlatformFontDatabase * fontDatabase() const override
Accessor for the platform integration's fontdatabase.
QPlatformWindow * createPlatformWindow(QWindow *window) const override
Factory function for QPlatformWindow.
QList< QPlatformScreen * > screens() const
QPlatformServices * services() const override
bool hasCapability(QPlatformIntegration::Capability cap) const override
QPlatformBackingStore * createPlatformBackingStore(QWindow *window) const override
Factory function for QPlatformBackingStore.
void initialize() override
Performs initialization steps that depend on having an event dispatcher available.
QAbstractEventDispatcher * createEventDispatcher() const override
Factory function for the GUI event dispatcher.
QPlatformNativeInterface * nativeInterface() const override