OSDN Git Service

remove non-raster graphics systems support leftovers
authorIvailo Monev <xakepa10@gmail.com>
Sat, 9 Jan 2021 09:46:10 +0000 (11:46 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Sat, 9 Jan 2021 09:46:10 +0000 (11:46 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/CMakeLists.txt
src/gui/image/qpixmapdata.cpp
src/gui/kernel/qapplication.cpp
src/gui/kernel/qapplication_x11.cpp
src/gui/painting/qgraphicssystemfactory.cpp [deleted file]
src/gui/painting/qgraphicssystemfactory_p.h [deleted file]
src/gui/painting/qgraphicssystemplugin.cpp [deleted file]
src/gui/painting/qgraphicssystemplugin_p.h [deleted file]

index 34e3ecd..3bdd090 100644 (file)
@@ -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
index b86248f..65f60b1 100644 (file)
@@ -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<QPixmapData::PixelType>(type));
-    else
-        data = QGraphicsSystem::createDefaultPixmapData(static_cast<QPixmapData::PixelType>(type));
+    Q_ASSERT(QApplicationPrivate::graphics_system);
+    QPixmapData *data = QApplicationPrivate::graphics_system->createPixmapData(type);
     data->resize(w, h);
     return data;
 }
index 9db0885..4cda74f 100644 (file)
@@ -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
index bceac19..6bb4ab9 100644 (file)
@@ -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 (file)
index abe98e2..0000000
+++ /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<QGraphicsSystemFactoryInterface*>(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 (file)
index 6446641..0000000
+++ /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 <QtCore/qstringlist.h>
-
-
-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 (file)
index e78527e..0000000
+++ /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 (file)
index db47924..0000000
+++ /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 <QtCore/qplugin.h>
-#include <QtCore/qfactoryinterface.h>
-
-
-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