1 | // Copyright (C) 2017 The Qt Company Ltd. |
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_QUICK3DRENDER_SCENE2DMANAGER_P_H |
5 | #define QT3DRENDER_QUICK3DRENDER_SCENE2DMANAGER_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 for the convenience |
12 | // of other Qt classes. 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 <Qt3DQuickScene2D/qt3dquickscene2d_global.h> |
19 | #include <Qt3DQuickScene2D/qscene2d.h> |
20 | |
21 | #include <QtQml/QQmlEngine> |
22 | #include <QtQml/QQmlComponent> |
23 | #include <QtQuick/QQuickItem> |
24 | |
25 | #include <private/qnode_p.h> |
26 | |
27 | #include <QtCore/qobject.h> |
28 | |
29 | QT_BEGIN_NAMESPACE |
30 | |
31 | namespace Qt3DRender { |
32 | |
33 | namespace Quick { |
34 | |
35 | class QScene2DPrivate; |
36 | class Scene2DSharedObject; |
37 | |
38 | class Scene2DManager : public QObject |
39 | { |
40 | Q_OBJECT |
41 | public: |
42 | Scene2DManager(QScene2DPrivate *priv); |
43 | ~Scene2DManager(); |
44 | |
45 | QQuickItem *m_rootItem; |
46 | QQuickItem *m_item; |
47 | |
48 | QScene2DPrivate *m_priv; |
49 | QSharedPointer<Scene2DSharedObject> m_sharedObject; |
50 | |
51 | Qt3DCore::QNodeId m_id; |
52 | QScene2D::RenderPolicy m_renderPolicy; |
53 | |
54 | bool m_requested; |
55 | bool m_initialized; |
56 | bool m_renderSyncRequested; |
57 | bool m_backendInitialized; |
58 | bool m_mouseEnabled; |
59 | |
60 | void requestRender(); |
61 | void requestRenderSync(); |
62 | void doRenderSync(); |
63 | void startIfInitialized(); |
64 | void stopAndClean(); |
65 | void updateSizes(); |
66 | |
67 | void setItem(QQuickItem *item); |
68 | |
69 | bool event(QEvent *e) override; |
70 | |
71 | void cleanup(); |
72 | }; |
73 | |
74 | } // namespace Quick |
75 | } // namespace Qt3DRender |
76 | |
77 | QT_END_NAMESPACE |
78 | |
79 | #endif // QT3DRENDER_QUICK3DRENDER_SCENE2DMANAGER_P_H |
80 | |