| 1 | // Copyright (C) 2018 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #include "qwlhardwarelayerintegrationfactory_p.h" |
| 5 | #include "qwlhardwarelayerintegrationplugin_p.h" |
| 6 | #include "qwlhardwarelayerintegration_p.h" |
| 7 | |
| 8 | #include <QtCore/private/qfactoryloader_p.h> |
| 9 | #include <QtCore/QCoreApplication> |
| 10 | #include <QtCore/QDir> |
| 11 | |
| 12 | QT_BEGIN_NAMESPACE |
| 13 | |
| 14 | namespace QtWayland { |
| 15 | |
| 16 | Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, qwhlifLoader, |
| 17 | (QtWaylandHardwareLayerIntegrationFactoryInterface_iid, QLatin1String("/wayland-hardware-layer-integration"), Qt::CaseInsensitive)) |
| 18 | |
| 19 | QStringList HardwareLayerIntegrationFactory::keys() |
| 20 | { |
| 21 | return qwhlifLoader->keyMap().values(); |
| 22 | } |
| 23 | |
| 24 | HardwareLayerIntegration *HardwareLayerIntegrationFactory::create(const QString &name, const QStringList &args) |
| 25 | { |
| 26 | return qLoadPlugin<HardwareLayerIntegration, HardwareLayerIntegrationPlugin>(loader: qwhlifLoader(), key: name, args); |
| 27 | } |
| 28 | |
| 29 | } |
| 30 | |
| 31 | QT_END_NAMESPACE |
| 32 |
