From 17a91ce6b0e9c682b79c6dab41a547f0bde9baa3 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 9 Jan 2021 11:46:10 +0200 Subject: [PATCH] remove non-raster graphics systems support leftovers Signed-off-by: Ivailo Monev --- src/gui/CMakeLists.txt | 6 -- src/gui/image/qpixmapdata.cpp | 8 +-- src/gui/kernel/qapplication.cpp | 7 -- src/gui/kernel/qapplication_x11.cpp | 4 +- src/gui/painting/qgraphicssystemfactory.cpp | 106 ---------------------------- src/gui/painting/qgraphicssystemfactory_p.h | 67 ------------------ src/gui/painting/qgraphicssystemplugin.cpp | 51 ------------- src/gui/painting/qgraphicssystemplugin_p.h | 83 ---------------------- 8 files changed, 4 insertions(+), 328 deletions(-) delete mode 100644 src/gui/painting/qgraphicssystemfactory.cpp delete mode 100644 src/gui/painting/qgraphicssystemfactory_p.h delete mode 100644 src/gui/painting/qgraphicssystemplugin.cpp delete mode 100644 src/gui/painting/qgraphicssystemplugin_p.h diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 34e3ecd0d..3bdd09032 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -465,8 +465,6 @@ set(GUI_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/painting/qpen_p.h ${CMAKE_CURRENT_SOURCE_DIR}/painting/qfixed_p.h ${CMAKE_CURRENT_SOURCE_DIR}/painting/qgraphicssystem_raster_p.h - ${CMAKE_CURRENT_SOURCE_DIR}/painting/qgraphicssystemfactory_p.h - ${CMAKE_CURRENT_SOURCE_DIR}/painting/qgraphicssystemplugin_p.h ${CMAKE_CURRENT_SOURCE_DIR}/painting/qwindowsurface_raster_p.h ${CMAKE_CURRENT_SOURCE_DIR}/painting/qrgb.h ${CMAKE_CURRENT_SOURCE_DIR}/painting/qprinterinfo_unix_p.h @@ -811,8 +809,6 @@ set(GUI_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/painting/qdrawhelper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/painting/qbackingstore.cpp ${CMAKE_CURRENT_SOURCE_DIR}/painting/qgraphicssystem_raster.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/painting/qgraphicssystemfactory.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/painting/qgraphicssystemplugin.cpp ${CMAKE_CURRENT_SOURCE_DIR}/painting/qwindowsurface_raster.cpp ${CMAKE_CURRENT_SOURCE_DIR}/painting/qprinterinfo_unix.cpp ${CMAKE_CURRENT_SOURCE_DIR}/painting/qgrayraster.c @@ -1035,8 +1031,6 @@ katie_unity_exclude( ${CMAKE_CURRENT_SOURCE_DIR}/painting/qcolormap_x11.cpp ${CMAKE_CURRENT_SOURCE_DIR}/painting/qgraphicssystem.cpp ${CMAKE_CURRENT_SOURCE_DIR}/painting/qgraphicssystem_raster.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/painting/qgraphicssystemfactory.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/painting/qgraphicssystemplugin.cpp ${CMAKE_CURRENT_SOURCE_DIR}/painting/qpaintengine_x11.cpp ${CMAKE_CURRENT_SOURCE_DIR}/painting/qregion_x11.cpp ${CMAKE_CURRENT_SOURCE_DIR}/painting/qwindowsurface_raster.cpp diff --git a/src/gui/image/qpixmapdata.cpp b/src/gui/image/qpixmapdata.cpp index b86248f44..65f60b15a 100644 --- a/src/gui/image/qpixmapdata.cpp +++ b/src/gui/image/qpixmapdata.cpp @@ -43,12 +43,8 @@ QT_BEGIN_NAMESPACE QPixmapData *QPixmapData::create(int w, int h, PixelType type) { - QPixmapData *data; - QGraphicsSystem* gs = QApplicationPrivate::graphics_system; - if (gs) - data = gs->createPixmapData(static_cast(type)); - else - data = QGraphicsSystem::createDefaultPixmapData(static_cast(type)); + Q_ASSERT(QApplicationPrivate::graphics_system); + QPixmapData *data = QApplicationPrivate::graphics_system->createPixmapData(type); data->resize(w, h); return data; } diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 9db0885ba..4cda74f03 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -56,7 +56,6 @@ #include "qdnd_p.h" #include "qcolormap.h" #include "qdebug.h" -#include "qgraphicssystemfactory_p.h" #include "qgraphicssystem_p.h" #include "qstylesheetstyle_p.h" #include "qstyle_p.h" @@ -602,12 +601,6 @@ void QApplicationPrivate::construct( QWidgetPrivate::mapper = new QWidgetMapper; QWidgetPrivate::allWidgets = new QWidgetSet; -#if !defined(Q_WS_X11) - // initialize the graphics system - on X11 this is initialized inside - // qt_init() in qapplication_x11.cpp because of several reasons. - graphics_system = QGraphicsSystemFactory::create(graphics_system_name); -#endif - if (qt_appType != QApplication::Tty) (void) QApplication::style(); // trigger creation of application style // trigger registering of QVariant's GUI types diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index bceac1960..6bb4ab9c6 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -64,7 +64,7 @@ #include "qmetaobject.h" #include "qtimer.h" #include "qlibrary.h" -#include "qgraphicssystemfactory_p.h" +#include "qgraphicssystem_raster_p.h" #include "qguiplatformplugin.h" #include "qthread_p.h" #include "qeventdispatcher_x11_p.h" @@ -1224,7 +1224,7 @@ void qt_init(QApplicationPrivate *priv, int, // initialize the graphics system - order is imporant here - it must be done before // the QColormap::initialize() call - QApplicationPrivate::graphics_system = QGraphicsSystemFactory::create(QApplicationPrivate::graphics_system_name); + QApplicationPrivate::graphics_system = new QRasterGraphicsSystem(); QColormap::initialize(); // Support protocols diff --git a/src/gui/painting/qgraphicssystemfactory.cpp b/src/gui/painting/qgraphicssystemfactory.cpp deleted file mode 100644 index abe98e27a..000000000 --- a/src/gui/painting/qgraphicssystemfactory.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Copyright (C) 2016-2021 Ivailo Monev -** -** This file is part of the QtGui module of the Katie Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qgraphicssystemfactory_p.h" -#include "qgraphicssystemplugin_p.h" -#include "qfactoryloader_p.h" -#include "qmutex.h" - -#include "qapplication.h" -#include "qgraphicssystem_raster_p.h" -#include "qdebug.h" - -QT_BEGIN_NAMESPACE - -#ifndef QT_NO_LIBRARY -Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, graphicsloader, - (QGraphicsSystemFactoryInterface_iid, QLatin1String("/graphicssystems"), Qt::CaseInsensitive)) -#endif - -QGraphicsSystem *QGraphicsSystemFactory::create(const QString& key) -{ - QGraphicsSystem *ret = Q_NULLPTR; - QString system = key.toLower(); - -#if defined (QT_GRAPHICSSYSTEM_RASTER) || defined(Q_WS_X11) - if (system.isEmpty()) { - system = QLatin1String("raster"); - } -#endif - - if (system == QLatin1String("raster")) { - return new QRasterGraphicsSystem; - } else if (system == QLatin1String("native")) { - qWarning() << "Attempt to load native graphicssystem"; - return new QRasterGraphicsSystem; - } else if (system.isEmpty()) { - return 0; - } - -#ifndef QT_NO_LIBRARY - if (!ret) { - if (QGraphicsSystemFactoryInterface *factory = qobject_cast(graphicsloader()->instance(system))) - ret = factory->create(system); - } -#endif - - if (!ret) - qWarning() << "Unable to load graphicssystem" << system; - - return ret; -} - -/*! - Returns the list of valid keys, i.e. the keys this factory can - create styles for. - - \sa create() -*/ -QStringList QGraphicsSystemFactory::keys() -{ -#ifndef QT_NO_LIBRARY - QStringList list = graphicsloader()->keys(); - if (!list.contains(QLatin1String("raster"))) - list << QLatin1String("raster"); -#else - static QStringList list = QStringList() << QLatin1String("raster"); -#endif - return list; -} - -QT_END_NAMESPACE - - - - - diff --git a/src/gui/painting/qgraphicssystemfactory_p.h b/src/gui/painting/qgraphicssystemfactory_p.h deleted file mode 100644 index 64466419b..000000000 --- a/src/gui/painting/qgraphicssystemfactory_p.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Copyright (C) 2016-2021 Ivailo Monev -** -** This file is part of the QtGui module of the Katie Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QGRAPHICSSYSTEMFACTORY_H -#define QGRAPHICSSYSTEMFACTORY_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Katie API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - - -QT_BEGIN_NAMESPACE - - -class QGraphicsSystem; - -class QGraphicsSystemFactory -{ -public: - static QStringList keys(); - static QGraphicsSystem *create(const QString&); -}; - -QT_END_NAMESPACE - - -#endif // QGRAPHICSSYSTEMFACTORY_H - diff --git a/src/gui/painting/qgraphicssystemplugin.cpp b/src/gui/painting/qgraphicssystemplugin.cpp deleted file mode 100644 index e78527ec4..000000000 --- a/src/gui/painting/qgraphicssystemplugin.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Copyright (C) 2016-2021 Ivailo Monev -** -** This file is part of the QtGui module of the Katie Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qgraphicssystemplugin_p.h" -#include "qgraphicssystem_p.h" - -QT_BEGIN_NAMESPACE - -QGraphicsSystemPlugin::QGraphicsSystemPlugin(QObject *parent) - : QObject(parent) -{ -} - -QGraphicsSystemPlugin::~QGraphicsSystemPlugin() -{ -} - -QT_END_NAMESPACE - - -#include "moc_qgraphicssystemplugin_p.h" diff --git a/src/gui/painting/qgraphicssystemplugin_p.h b/src/gui/painting/qgraphicssystemplugin_p.h deleted file mode 100644 index db47924d5..000000000 --- a/src/gui/painting/qgraphicssystemplugin_p.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Copyright (C) 2016-2021 Ivailo Monev -** -** This file is part of the QtGui module of the Katie Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QGRAPHICSSYSTEMPLUGIN_H -#define QGRAPHICSSYSTEMPLUGIN_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Katie API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - - -QT_BEGIN_NAMESPACE - -class QGraphicsSystem; - -struct QGraphicsSystemFactoryInterface : public QFactoryInterface -{ - virtual QGraphicsSystem *create(const QString &key) = 0; -}; - -QT_END_NAMESPACE - -#define QGraphicsSystemFactoryInterface_iid "Katie.QGraphicsSystemFactoryInterface" -Q_DECLARE_INTERFACE(QGraphicsSystemFactoryInterface, QGraphicsSystemFactoryInterface_iid) - -QT_BEGIN_NAMESPACE - -class Q_GUI_EXPORT QGraphicsSystemPlugin : public QObject, public QGraphicsSystemFactoryInterface -{ - Q_OBJECT - Q_INTERFACES(QGraphicsSystemFactoryInterface:QFactoryInterface) -public: - explicit QGraphicsSystemPlugin(QObject *parent = Q_NULLPTR); - ~QGraphicsSystemPlugin(); - - virtual QStringList keys() const = 0; - virtual QGraphicsSystem *create(const QString &key) = 0; -}; - -QT_END_NAMESPACE - - -#endif // QGRAPHICSSYSTEMEPLUGIN_H -- 2.11.0