including cpp files tp svg2qvg to drop runtime dependencies

This commit is contained in:
Uwe Rathmann 2018-10-22 10:09:37 +02:00
parent 2b6d0bc90a
commit 7d39d8dbf6
3 changed files with 35 additions and 8 deletions

View File

@ -213,7 +213,11 @@ static inline void qskExecCommand(
}
}
namespace
/*
To avoid subobject-linkage warnings, when including the source code in
svg2qvg we don't use an anonymous namespace here
*/
namespace QskGraphicPrivate
{
class PathInfo
{
@ -364,7 +368,7 @@ class QskGraphic::PrivateData : public QSharedData
QSizeF defaultSize;
QVector< QskPainterCommand > commands;
QVector< PathInfo > pathInfos;
QVector< QskGraphicPrivate::PathInfo > pathInfos;
QRectF boundingRect;
QRectF pointRect;
@ -856,7 +860,7 @@ void QskGraphic::drawPath( const QPainterPath& path )
updateControlPointRect( pointRect );
updateBoundingRect( boundingRect );
m_data->pathInfos += PathInfo( pointRect,
m_data->pathInfos += QskGraphicPrivate::PathInfo( pointRect,
boundingRect, qskHasScalablePen( painter ) );
}
}

View File

@ -3,8 +3,18 @@
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
#if defined(QSK_STANDALONE)
#include <QskGraphic.cpp>
#include <QskRgbValue.cpp>
#include <QskColorFilter.cpp>
#include <QskPainterCommand.cpp>
#include <QskGraphicPaintEngine.cpp>
#include <QskGraphicIO.cpp>
#else
#include <QskGraphicIO.h>
#include <QskGraphic.h>
#endif
#include <QSvgRenderer>
#include <QPainter>
#include <QDebug>

View File

@ -7,6 +7,8 @@ TEMPLATE = app
QT += svg
CONFIG += standalone
QSK_DIRS = \
$${QSK_ROOT}/src/common \
$${QSK_ROOT}/src/graphic
@ -16,12 +18,23 @@ DEPENDPATH += $${QSK_DIRS}
DESTDIR = $${QSK_OUT_ROOT}/tools/bin
QMAKE_RPATHDIR *= $${QSK_OUT_ROOT}/lib
LIBS *= -L$${QSK_OUT_ROOT}/lib -lqskinny
standalone {
contains(QSK_CONFIG, QskDll) {
DEFINES += QSK_DLL
}
# We only need a very small subset of QSkinny and by including the
# necessary cpp files svg2qvg becomes independent from the library
DEFINES += QSK_STANDALONE
}
else {
QMAKE_RPATHDIR *= $${QSK_OUT_ROOT}/lib
LIBS *= -L$${QSK_OUT_ROOT}/lib -lqskinny
contains(QSK_CONFIG, QskDll) {
DEFINES += QSK_DLL
}
}
TARGET = svg2qvg