8#include "qlinuxfbdrmscreen.h"
11#include <QtGui/private/qgenericunixfontdatabase_p.h>
12#include <QtGui/private/qgenericunixeventdispatcher_p.h>
13#include <qpa/qplatformservices.h>
15#include <QtFbSupport/private/qfbvthandler_p.h>
16#include <QtFbSupport/private/qfbbackingstore_p.h>
17#include <QtFbSupport/private/qfbwindow_p.h>
18#include <QtFbSupport/private/qfbcursor_p.h>
20#include <QtGui/private/qguiapplication_p.h>
21#include <qpa/qplatforminputcontextfactory_p.h>
22#include <qpa/qwindowsysteminterface.h>
24#if QT_CONFIG(libinput)
25#include <QtInputSupport/private/qlibinputhandler_p.h>
29#include <QtInputSupport/private/qevdevmousemanager_p.h>
30#include <QtInputSupport/private/qevdevkeyboardmanager_p.h>
31#include <QtInputSupport/private/qevdevtouchmanager_p.h>
35#include <QtInputSupport/private/qtslib_p.h>
40using namespace Qt::StringLiterals;
43 : m_primaryScreen(
nullptr),
44 m_fontDb(
new QGenericUnixFontDatabase)
47 if (qEnvironmentVariableIntValue(
"QT_QPA_FB_DRM") != 0)
48 m_primaryScreen =
new QLinuxFbDrmScreen(paramList);
51 m_primaryScreen =
new QLinuxFbScreen(paramList);
54QLinuxFbIntegration::~QLinuxFbIntegration()
56 QWindowSystemInterface::handleScreenRemoved(m_primaryScreen);
59void QLinuxFbIntegration::initialize()
61 if (m_primaryScreen->initialize())
62 QWindowSystemInterface::handleScreenAdded(m_primaryScreen);
64 qWarning(
"linuxfb: Failed to initialize screen");
66 m_inputContext = QPlatformInputContextFactory::create();
68 m_vtHandler.reset(
new QFbVtHandler);
70 if (!qEnvironmentVariableIntValue(
"QT_QPA_FB_DISABLE_INPUT"))
71 createInputHandlers();
74bool QLinuxFbIntegration::hasCapability(QPlatformIntegration::Capability cap)
const
77 case ThreadedPixmaps:
return true;
78 case WindowManagement:
return false;
79 case RhiBasedRendering:
return false;
80 default:
return QPlatformIntegration::hasCapability(cap);
84QPlatformBackingStore *QLinuxFbIntegration::createPlatformBackingStore(QWindow *window)
const
86 return new QFbBackingStore(window);
89QPlatformWindow *QLinuxFbIntegration::createPlatformWindow(QWindow *window)
const
91 return new QFbWindow(window);
94QAbstractEventDispatcher *QLinuxFbIntegration::createEventDispatcher()
const
96 return createUnixEventDispatcher();
99QList<QPlatformScreen *> QLinuxFbIntegration::screens()
const
101 QList<QPlatformScreen *> list;
102 list.append(m_primaryScreen);
106QPlatformFontDatabase *QLinuxFbIntegration::fontDatabase()
const
108 return m_fontDb.data();
111QPlatformServices *QLinuxFbIntegration::services()
const
113 if (m_services.isNull())
114 m_services.reset(
new QPlatformServices);
116 return m_services.data();
119void QLinuxFbIntegration::createInputHandlers()
121#if QT_CONFIG(libinput)
122 if (!qEnvironmentVariableIntValue(
"QT_QPA_FB_NO_LIBINPUT")) {
123 new QLibInputHandler(
"libinput"_L1, QString());
129 bool useTslib = qEnvironmentVariableIntValue(
"QT_QPA_FB_TSLIB");
131 new QTsLibMouseHandler(
"TsLib"_L1, QString());
135 m_kbdMgr =
new QEvdevKeyboardManager(
"EvdevKeyboard"_L1, QString(),
this);
136 new QEvdevMouseManager(
"EvdevMouse"_L1, QString(),
this);
140 new QEvdevTouchManager(
"EvdevTouch"_L1, QString() ,
this);
144QPlatformNativeInterface *QLinuxFbIntegration::nativeInterface()
const
146 return const_cast<QLinuxFbIntegration *>(
this);
149QFunctionPointer QLinuxFbIntegration::platformFunction(
const QByteArray &function)
const
156void QLinuxFbIntegration::loadKeymap(
const QString &filename)
159 m_kbdMgr->loadKeymap(filename);
161 qWarning(
"QLinuxFbIntegration: Cannot load keymap, no keyboard handler found");
164void QLinuxFbIntegration::switchLang()
167 m_kbdMgr->switchLang();
169 qWarning(
"QLinuxFbIntegration: Cannot switch language, no keyboard handler found");
QLinuxFbIntegration(const QStringList ¶mList)
Combined button and popup list for selecting options.