19
19
********************************************************************
22
22
$Author: cohen@irascible.com $:
23
$Date: 2011-07-01 02:37:01 +0200 (Fri, 01 Jul 2011) $
23
$Date: 2011-07-30 21:09:56 +0200 (Sat, 30 Jul 2011) $
25
25
********************************************************************/
59
59
bool splitString(QString & contents, const QString & elementID);
60
60
const QByteArray & byteArray();
61
61
const QDomDocument & domDocument();
62
bool normalize(qreal dpi, const QString & elementID, bool blackOnly);
63
QString shift(qreal x, qreal y, const QString & elementID, bool shiftTransforms);
62
bool normalize(double dpi, const QString & elementID, bool blackOnly);
63
QString shift(double x, double y, const QString & elementID, bool shiftTransforms);
64
64
QString elementString(const QString & elementID);
65
65
virtual bool parsePath(const QString & data, const char * slot, PathUserData &, QObject * slotTarget, bool convertHV);
66
66
QVector<QVariant> simpleParsePath(const QString & data);
67
QPainterPath painterPath(qreal dpi, const QString & elementID); // note: only partially implemented
68
void shiftChild(QDomElement & element, qreal x, qreal y, bool shiftTransforms);
67
QPainterPath painterPath(double dpi, const QString & elementID); // note: only partially implemented
68
void shiftChild(QDomElement & element, double x, double y, bool shiftTransforms);
69
69
bool load(const QString * filename);
70
70
bool load(QFile *);
71
71
bool load(const QString string);
72
72
QString toString();
73
73
void gWrap(const QHash<QString, QString> & attributes);
74
void gReplace(const QString & id);
76
77
static bool getSvgSizeAttributes(const QString & svg, QString & width, QString & height, QString & viewBox);
77
static bool changeStrokeWidth(const QString & svg, qreal delta, bool absolute, QByteArray &);
78
static bool changeStrokeWidth(const QString & svg, double delta, bool absolute, QByteArray &);
78
79
static bool changeColors(const QString & svg, QString & toColor, QStringList & exceptions, QByteArray &);
79
80
static void changeColors(QDomElement & element, QString & toColor, QStringList & exceptions);
80
81
static void fixStyleAttributeRecurse(QDomElement & element);
85
86
void normalizeChild(QDomElement & childElement,
86
qreal sNewWidth, qreal sNewHeight,
87
qreal vbWidth, qreal vbHeight, bool blackOnly);
88
bool normalizeAttribute(QDomElement & element, const char * attributeName, qreal num, qreal denom);
87
double sNewWidth, double sNewHeight,
88
double vbWidth, double vbHeight, bool blackOnly);
89
bool normalizeAttribute(QDomElement & element, const char * attributeName, double num, double denom);
89
90
void painterPathChild(QDomElement & element, QPainterPath & ppath); // note: only partially implemented
90
91
void normalizeTranslation(QDomElement & element,
91
qreal sNewWidth, qreal sNewHeight,
92
qreal vbWidth, qreal vbHeight);
93
bool shiftTranslation(QDomElement & element, qreal x, qreal y);
92
double sNewWidth, double sNewHeight,
93
double vbWidth, double vbHeight);
94
bool shiftTranslation(QDomElement & element, double x, double y);
94
95
void standardArgs(bool relative, bool starting, QList<double> & args, PathUserData * pathUserData);
97
static void changeStrokeWidth(QDomElement & element, qreal delta, bool absolute);
98
static void changeStrokeWidth(QDomElement & element, double delta, bool absolute);
98
99
static void fixStyleAttribute(QDomElement & element);
99
static bool shiftAttribute(QDomElement & element, const char * attributeName, qreal d);
100
static void setStrokeOrFill(QDomElement & element, bool doIt, const QString & color);
100
static bool shiftAttribute(QDomElement & element, const char * attributeName, double d);
101
static void setStrokeOrFill(QDomElement & element, bool doIt, const QString & color, bool force);
103
104
void normalizeCommandSlot(QChar command, bool relative, QList<double> & args, void * userData);