| 1 | // Copyright (C) 2024 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 QQUICKRECTANGULARSHADOW_P_P_H |
| 5 | #define QQUICKRECTANGULARSHADOW_P_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 <private/qtquickglobal_p.h> |
| 19 | |
| 20 | QT_REQUIRE_CONFIG(quick_shadereffect); |
| 21 | |
| 22 | #include <private/qquickrectangularshadow_p.h> |
| 23 | #include <private/qquickitem_p.h> |
| 24 | |
| 25 | QT_BEGIN_NAMESPACE |
| 26 | |
| 27 | class QQuickShaderEffect; |
| 28 | |
| 29 | class QQuickRectangularShadowPrivate : public QQuickItemPrivate |
| 30 | { |
| 31 | Q_DECLARE_PUBLIC(QQuickRectangularShadow) |
| 32 | |
| 33 | public: |
| 34 | QQuickRectangularShadowPrivate(); |
| 35 | |
| 36 | private: |
| 37 | void initialize(); |
| 38 | void handleGeometryChange(const QRectF &newGeometry, const QRectF &oldGeometry); |
| 39 | void handleItemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &value); |
| 40 | qreal getPadding() const; |
| 41 | void updateColor(); |
| 42 | void updateShaderSource(); |
| 43 | void updateSizeProperties(); |
| 44 | void updateCached(); |
| 45 | qreal clampedRadius() const; |
| 46 | QQuickItem *currentMaterial() const; |
| 47 | |
| 48 | QQuickShaderEffect *m_defaultMaterial = nullptr; |
| 49 | QQuickItem *m_material = nullptr; |
| 50 | QColor m_color = { 0, 0, 0, 255 }; |
| 51 | QVector2D m_offset; |
| 52 | qreal m_blur = 10.0; |
| 53 | qreal m_radius = 0.0; |
| 54 | qreal m_spread = 0.0; |
| 55 | bool m_cached = false; |
| 56 | bool m_initialized = false; |
| 57 | }; |
| 58 | |
| 59 | QT_END_NAMESPACE |
| 60 | |
| 61 | #endif // QQUICKRECTANGULARSHADOW_P_P_H |
| 62 |
