1// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QT3DRENDER_QSHADERNODESLOADER_P_H
5#define QT3DRENDER_QSHADERNODESLOADER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <Qt3DRender/private/qt3drender_global_p.h>
19
20#include <Qt3DRender/private/qshadergraph_p.h>
21
22QT_BEGIN_NAMESPACE
23
24class QIODevice;
25
26namespace Qt3DRender
27{
28class QShaderNodesLoader
29{
30public:
31 enum Status : char {
32 Null,
33 Waiting,
34 Ready,
35 Error
36 };
37
38 Q_3DRENDERSHARED_PRIVATE_EXPORT QShaderNodesLoader() noexcept;
39
40 Q_3DRENDERSHARED_PRIVATE_EXPORT Status status() const noexcept;
41 Q_3DRENDERSHARED_PRIVATE_EXPORT QHash<QString, QShaderNode> nodes() const noexcept;
42
43 Q_3DRENDERSHARED_PRIVATE_EXPORT QIODevice *device() const noexcept;
44 Q_3DRENDERSHARED_PRIVATE_EXPORT void setDevice(QIODevice *device) noexcept;
45
46 Q_3DRENDERSHARED_PRIVATE_EXPORT void load();
47 Q_3DRENDERSHARED_PRIVATE_EXPORT void load(const QJsonObject &prototypesObject);
48
49private:
50 Status m_status;
51 QIODevice *m_device;
52 QHash<QString, QShaderNode> m_nodes;
53};
54
55
56}
57Q_DECLARE_TYPEINFO(Qt3DRender::QShaderNodesLoader, Q_RELOCATABLE_TYPE);
58QT_END_NAMESPACE
59
60Q_DECLARE_METATYPE(Qt3DRender::QShaderNodesLoader)
61Q_DECLARE_METATYPE(Qt3DRender::QShaderNodesLoader::Status)
62
63#endif // QT3DRENDER_QSHADERNODESLOADER_P_H
64

source code of qt3d/src/render/shadergraph/qshadernodesloader_p.h