Krita Source Code Documentation
Loading...
Searching...
No Matches
SvgStyleWriter.cpp File Reference
#include "SvgStyleWriter.h"
#include "SvgSavingContext.h"
#include "SvgUtil.h"
#include <KoShape.h>
#include <KoPathShape.h>
#include <KoPathSegment.h>
#include <KoColorBackground.h>
#include <KoGradientBackground.h>
#include <KoMeshGradientBackground.h>
#include <KoPatternBackground.h>
#include <KoVectorPatternBackground.h>
#include <KoShapeStroke.h>
#include <KoClipPath.h>
#include <KoClipMask.h>
#include <KoMarker.h>
#include <KoXmlWriter.h>
#include <QBuffer>
#include <QGradient>
#include <QLinearGradient>
#include <QRadialGradient>
#include <KisMimeDatabase.h>
#include "kis_dom_utils.h"
#include "kis_algebra_2d.h"
#include <SvgWriter.h>
#include <KoFlakeCoordinateSystem.h>

Go to the source code of this file.

Functions

QString convertGradientMode (QGradient::CoordinateMode mode)
 
void embedShapes (const QList< KoShape * > &shapes, KoXmlWriter &outWriter)
 

Function Documentation

◆ convertGradientMode()

QString convertGradientMode ( QGradient::CoordinateMode mode)
inline

Definition at line 355 of file SvgStyleWriter.cpp.

355 {
356 KIS_ASSERT_RECOVER_NOOP(mode != QGradient::StretchToDeviceMode);
357
358 return
359 mode == QGradient::ObjectBoundingMode ?
360 "objectBoundingBox" :
361 "userSpaceOnUse";
362
363}
#define KIS_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:97

References KIS_ASSERT_RECOVER_NOOP.

◆ embedShapes()

void embedShapes ( const QList< KoShape * > & shapes,
KoXmlWriter & outWriter )

Definition at line 195 of file SvgStyleWriter.cpp.

196{
197 QBuffer buffer;
198 buffer.open(QIODevice::WriteOnly);
199 {
200 SvgWriter shapesWriter(shapes);
201 shapesWriter.saveDetached(buffer);
202 }
203 buffer.close();
204 outWriter.addCompleteElement(&buffer);
205}
void addCompleteElement(QIODevice *dev)
Implements exporting shapes to SVG.
Definition SvgWriter.h:33

References KoXmlWriter::addCompleteElement(), and SvgWriter::saveDetached().