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_QSHADERGRAPHLOADER_P_H
5#define QT3DRENDER_QSHADERGRAPHLOADER_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;
25namespace Qt3DRender
26{
27
28class QShaderGraphLoader
29{
30public:
31 enum Status : char {
32 Null,
33 Waiting,
34 Ready,
35 Error
36 };
37
38 Q_3DRENDERSHARED_PRIVATE_EXPORT QShaderGraphLoader() noexcept;
39
40 Q_3DRENDERSHARED_PRIVATE_EXPORT Status status() const noexcept;
41 Q_3DRENDERSHARED_PRIVATE_EXPORT QShaderGraph graph() 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 QHash<QString, QShaderNode> prototypes() const noexcept;
47 Q_3DRENDERSHARED_PRIVATE_EXPORT void setPrototypes(const QHash<QString, QShaderNode> &prototypes) noexcept;
48
49 Q_3DRENDERSHARED_PRIVATE_EXPORT void load();
50
51private:
52 Status m_status;
53 QIODevice *m_device;
54 QHash<QString, QShaderNode> m_prototypes;
55 QShaderGraph m_graph;
56};
57
58
59}
60Q_DECLARE_TYPEINFO(Qt3DRender::QShaderGraphLoader, Q_RELOCATABLE_TYPE);
61QT_END_NAMESPACE
62
63Q_DECLARE_METATYPE(Qt3DRender::QShaderGraphLoader)
64Q_DECLARE_METATYPE(Qt3DRender::QShaderGraphLoader::Status)
65
66#endif // QT3DRENDER_QSHADERGRAPHLOADER_P_H
67

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