Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qbsdfbintegration.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// Copyright (C) 2015-2016 Oleksandr Tymoshenko <gonzo@bluezbox.com>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#include "qbsdfbintegration.h"
6#include "qbsdfbscreen.h"
7
8#include <QtGui/private/qgenericunixfontdatabase_p.h>
9#include <QtGui/private/qgenericunixservices_p.h>
10#include <QtGui/private/qgenericunixeventdispatcher_p.h>
11
12#include <QtFbSupport/private/qfbvthandler_p.h>
13#include <QtFbSupport/private/qfbbackingstore_p.h>
14#include <QtFbSupport/private/qfbwindow_p.h>
15#include <QtFbSupport/private/qfbcursor_p.h>
16
17#include <QtGui/private/qguiapplication_p.h>
18#include <qpa/qplatforminputcontext.h>
19#include <qpa/qplatforminputcontextfactory_p.h>
20#include <qpa/qwindowsysteminterface.h>
21
22#if QT_CONFIG(tslib)
23#include <QtInputSupport/private/qtslib_p.h>
24#endif
25
27
28using namespace Qt::StringLiterals;
29
31{
32 m_fontDb.reset(new QGenericUnixFontDatabase);
33 m_services.reset(new QGenericUnixServices);
34 m_primaryScreen.reset(new QBsdFbScreen(paramList));
35}
36
41
43{
44 if (m_primaryScreen->initialize())
46 else
47 qWarning("bsdfb: Failed to initialize screen");
48
50 m_nativeInterface.reset(new QPlatformNativeInterface);
51 m_vtHandler.reset(new QFbVtHandler);
52
53 if (!qEnvironmentVariableIntValue("QT_QPA_FB_DISABLE_INPUT"))
54 createInputHandlers();
55}
56
58{
59 switch (cap) {
60 case ThreadedPixmaps:
61 return true;
63 return false;
65 return false;
66 default:
68 }
69}
70
75
80
82{
83 return createUnixEventDispatcher();
84}
85
86QList<QPlatformScreen *> QBsdFbIntegration::screens() const
87{
88 QList<QPlatformScreen *> list;
89 list.append(m_primaryScreen.data());
90 return list;
91}
92
94{
95 return m_fontDb.data();
96}
97
99{
100 return m_services.data();
101}
102
103void QBsdFbIntegration::createInputHandlers()
104{
105#if QT_CONFIG(tslib)
106 const bool useTslib = qEnvironmentVariableIntValue("QT_QPA_FB_TSLIB");
107 if (useTslib)
108 new QTsLibMouseHandler("TsLib"_L1, QString());
109#endif
110}
111
113{
114 return m_nativeInterface.data();
115}
116
QPlatformBackingStore * createPlatformBackingStore(QWindow *window) const override
Factory function for QPlatformBackingStore.
void initialize() override
Performs initialization steps that depend on having an event dispatcher available.
QPlatformWindow * createPlatformWindow(QWindow *window) const override
Factory function for QPlatformWindow.
QPlatformServices * services() const override
QList< QPlatformScreen * > screens() const
QBsdFbIntegration(const QStringList &paramList)
QAbstractEventDispatcher * createEventDispatcher() const override
Factory function for the GUI event dispatcher.
bool hasCapability(QPlatformIntegration::Capability cap) const override
QPlatformNativeInterface * nativeInterface() const override
QPlatformFontDatabase * fontDatabase() const override
Accessor for the platform integration's fontdatabase.
bool initialize() override
void append(parameter_type t)
Definition qlist.h:458
The QPlatformBackingStore class provides the drawing area for top-level windows.
The QPlatformFontDatabase class makes it possible to customize how fonts are discovered and how they ...
static QPlatformInputContext * create()
virtual bool hasCapability(Capability cap) const
Capability
Capabilities are used to determine specific features of a platform integration.
The QPlatformNativeInterface class provides an abstraction for retrieving native resource handles.
The QPlatformServices provides the backend for desktop-related functionality.
The QPlatformWindow class provides an abstraction for top-level windows.
T * data() const noexcept
Returns the value of the pointer referenced by this object.
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
static void handleScreenAdded(QPlatformScreen *screen, bool isPrimary=false)
Should be called by the implementation whenever a new screen is added.
static void handleScreenRemoved(QPlatformScreen *screen)
Should be called by the implementation whenever a screen is removed.
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
#define qWarning
Definition qlogging.h:166
GLenum cap
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
QList< int > list
[14]
aWidget window() -> setWindowTitle("New Window Title")
[2]