blob: af8a8d386eae32c72e9fe02d4a4afb095d42c537 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QSVGVISITORIMPL_P_H
#define QSVGVISITORIMPL_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtSvg/private/qsvgvisitor_p.h>
#include "qquickgenerator_p.h"
QT_BEGIN_NAMESPACE
class QTextStream;
class QSvgTinyDocument;
class QString;
class QQuickItem;
class QSvgVisitorImpl : public QSvgVisitor
{
public:
QSvgVisitorImpl(const QString svgFileName, QQuickGenerator *generator);
void traverse();
protected:
void visitNode(const QSvgNode *node) override;
void visitImageNode(const QSvgImage *node) override;
void visitRectNode(const QSvgRect *node) override;
void visitEllipseNode(const QSvgEllipse *node) override;
void visitPathNode(const QSvgPath *node) override;
void visitLineNode(const QSvgLine *node) override;
void visitPolygonNode(const QSvgPolygon *node) override;
void visitPolylineNode(const QSvgPolyline *node) override;
void visitTextNode(const QSvgText *node) override;
void visitUseNode(const QSvgUse *node) override;
bool visitDefsNodeStart(const QSvgDefs *node) override;
bool visitStructureNodeStart(const QSvgStructureNode *node) override;
void visitStructureNodeEnd(const QSvgStructureNode *node) override;
bool visitDocumentNodeStart(const QSvgTinyDocument *node) override;
void visitDocumentNodeEnd(const QSvgTinyDocument *node) override;
private:
void fillCommonNodeInfo(const QSvgNode *node, NodeInfo &info);
void handleBaseNodeSetup(const QSvgNode *node);
void handleBaseNode(const QSvgNode *node);
void handleBaseNodeEnd(const QSvgNode *node);
void handlePathNode(const QSvgNode *node, const QPainterPath &path);
void outputShapePath(QPainterPath pathCopy, const PathNodeInfo &info);
static QString gradientCssDescription(const QGradient *gradient);
static QString colorCssDescription(QColor color);
private:
QString m_svgFileName;
QQuickGenerator *m_generator;
};
QT_END_NAMESPACE
#endif // QSVGVISITORIMPL_P_H
|