|
Krita Source Code Documentation
|
Contains data used for loading svg. More...
#include <SvgLoadingContext.h>
Inheritance diagram for SvgLoadingContext:Public Types | |
| typedef std::function< QByteArray(const QString &) | FileFetcherFunc) |
Public Member Functions | |
| QString | absoluteFilePath (const QString &href) |
| Constructs an absolute file path from the given href and current xml base directory. | |
| void | addDefinition (const QDomElement &element) |
| Adds a definition for later use. | |
| void | addStyleSheet (const QDomElement &styleSheet) |
| Adds a css style sheet. | |
| SvgGraphicsContext * | currentGC () const |
| Returns the current graphics context. | |
| QDomElement | definition (const QString &id) const |
| Returns the definition with the specified id. | |
| QByteArray | fetchExternalFile (const QString &url) |
| bool | hasDefinition (const QString &id) const |
| Checks if a definition with the specified id exists. | |
| bool | isRootContext () const |
| QStringList | matchingCssStyles (const QDomElement &element) const |
| Returns list of css styles matching to the specified element. | |
| int | nextZIndex () |
| Returns the next z-index. | |
| void | parseProfile (const QDomElement &element) |
| parses 'color-profile' tag and saves it in the context | |
| void | popGraphicsContext () |
| Pops the current graphics context from the stack. | |
| Private () | |
| QHash< QString, const KoColorProfile * > | profiles () |
| Return the profiles in the context. | |
| SvgGraphicsContext * | pushGraphicsContext (const QDomElement &element=QDomElement(), bool inherit=true) |
| Pushes a new graphics context to the stack. | |
| void | registerShape (const QString &id, KoShape *shape) |
| Registers a shape so it can be referenced later. | |
| QString | relativeFilePath (const QString &href) |
| KoSvgTextProperties | resolvedProperties () const |
| These are the text properties, completely resolved, ensuring that everything is inherited and the sizes are converted to pt. | |
| void | setFileFetcher (FileFetcherFunc func) |
| void | setInitialXmlBaseDir (const QString &baseDir) |
| Sets the initial xml base dir, i.e. the directory the svg file is read from. | |
| KoShape * | shapeById (const QString &id) |
| Returns shape with specified id. | |
| SvgStyleParser & | styleParser () |
| Returns a style parser to parse styles. | |
| SvgLoadingContext (KoDocumentResourceManager *documentResourceManager) | |
| QString | xmlBaseDir () const |
| Returns the current xml base dir. | |
| ~Private () | |
| ~SvgLoadingContext () | |
Public Attributes | |
| SvgCssHelper | cssStyles |
| QHash< QString, QDomElement > | definitions |
| KoDocumentResourceManager * | documentResourceManager |
| FileFetcherFunc | fileFetcher |
| QStack< SvgGraphicsContext * > | gcStack |
| QString | initialXmlBaseDir |
| QHash< QString, KoShape * > | loadedShapes |
| QHash< QString, const KoColorProfile * > | profiles |
| SvgStyleParser * | styleParser |
| int | zIndex |
Private Attributes | |
| QScopedPointer< Private > | d |
Private Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Additional Inherited Members | |
Private Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Contains data used for loading svg.
Definition at line 27 of file SvgLoadingContext.cpp.
| typedef std::function<QByteArray(const QString&) SvgLoadingContext::FileFetcherFunc) |
Definition at line 89 of file SvgLoadingContext.h.
|
inline |
|
explicit |
Definition at line 60 of file SvgLoadingContext.cpp.
References d, and documentResourceManager.
| SvgLoadingContext::~SvgLoadingContext | ( | ) |
Definition at line 68 of file SvgLoadingContext.cpp.
| QString SvgLoadingContext::absoluteFilePath | ( | const QString & | href | ) |
Constructs an absolute file path from the given href and current xml base directory.
Definition at line 136 of file SvgLoadingContext.cpp.
References absoluteFilePath(), currentGC(), d, and SvgGraphicsContext::xmlBaseDir.
| void SvgLoadingContext::addDefinition | ( | const QDomElement & | element | ) |
Adds a definition for later use.
Definition at line 200 of file SvgLoadingContext.cpp.
References d.
| void SvgLoadingContext::addStyleSheet | ( | const QDomElement & | styleSheet | ) |
| SvgGraphicsContext * SvgLoadingContext::currentGC | ( | ) | const |
Returns the current graphics context.
Definition at line 72 of file SvgLoadingContext.cpp.
References d.
| QDomElement SvgLoadingContext::definition | ( | const QString & | id | ) | const |
Returns the definition with the specified id.
Definition at line 208 of file SvgLoadingContext.cpp.
References d.
| QByteArray SvgLoadingContext::fetchExternalFile | ( | const QString & | url | ) |
Definition at line 308 of file SvgLoadingContext.cpp.
References d.
| bool SvgLoadingContext::hasDefinition | ( | const QString & | id | ) | const |
Checks if a definition with the specified id exists.
Definition at line 213 of file SvgLoadingContext.cpp.
References d.
| bool SvgLoadingContext::isRootContext | ( | ) | const |
| QStringList SvgLoadingContext::matchingCssStyles | ( | const QDomElement & | element | ) | const |
Returns list of css styles matching to the specified element.
Definition at line 223 of file SvgLoadingContext.cpp.
References d.
| int SvgLoadingContext::nextZIndex | ( | ) |
| void SvgLoadingContext::parseProfile | ( | const QDomElement & | element | ) |
parses 'color-profile' tag and saves it in the context
Definition at line 233 of file SvgLoadingContext.cpp.
References KoColorSpaceEngine::addProfile(), d, debugFlake, KoGenericRegistry< T >::get(), KoColorSpaceEngineRegistry::instance(), KoColorSpaceRegistry::instance(), KIS_ASSERT, ppVar, KoColorSpaceRegistry::profileByUniqueId(), relativeFilePath(), KoColorProfile::uniqueId(), and warnFlake.
| void SvgLoadingContext::popGraphicsContext | ( | ) |
Pops the current graphics context from the stack.
Definition at line 120 of file SvgLoadingContext.cpp.
References d.
|
inline |
Definition at line 30 of file SvgLoadingContext.cpp.
| QHash< QString, const KoColorProfile * > SvgLoadingContext::profiles | ( | ) |
Return the profiles in the context.
| SvgGraphicsContext * SvgLoadingContext::pushGraphicsContext | ( | const QDomElement & | element = QDomElement(), |
| bool | inherit = true ) |
Pushes a new graphics context to the stack.
Definition at line 82 of file SvgLoadingContext.cpp.
References SvgGraphicsContext::clipMaskId, SvgGraphicsContext::clipPathId, d, SvgGraphicsContext::display, SvgGraphicsContext::filterId, SvgGraphicsContext::matrix, SvgGraphicsContext::opacity, p, SvgGraphicsContext::paintOrder, SvgGraphicsContext::preserveWhitespace, SvgGraphicsContext::textProperties, and SvgGraphicsContext::xmlBaseDir.
Registers a shape so it can be referenced later.
Definition at line 189 of file SvgLoadingContext.cpp.
References d.
| QString SvgLoadingContext::relativeFilePath | ( | const QString & | href | ) |
Definition at line 163 of file SvgLoadingContext.cpp.
References currentGC(), d, and SvgGraphicsContext::xmlBaseDir.
| KoSvgTextProperties SvgLoadingContext::resolvedProperties | ( | ) | const |
These are the text properties, completely resolved, ensuring that everything is inherited and the sizes are converted to pt.
Definition at line 284 of file SvgLoadingContext.cpp.
References d, KoSvgTextProperties::inheritFrom(), KoSvgTextProperties::resetNonInheritableToDefault(), and SvgGraphicsContext::textProperties.
| void SvgLoadingContext::setFileFetcher | ( | SvgLoadingContext::FileFetcherFunc | func | ) |
Definition at line 303 of file SvgLoadingContext.cpp.
References d.
| void SvgLoadingContext::setInitialXmlBaseDir | ( | const QString & | baseDir | ) |
Sets the initial xml base dir, i.e. the directory the svg file is read from.
Definition at line 125 of file SvgLoadingContext.cpp.
References d.
| KoShape * SvgLoadingContext::shapeById | ( | const QString & | id | ) |
Returns shape with specified id.
Definition at line 195 of file SvgLoadingContext.cpp.
References d.
| SvgStyleParser & SvgLoadingContext::styleParser | ( | ) |
Returns a style parser to parse styles.
| QString SvgLoadingContext::xmlBaseDir | ( | ) | const |
Returns the current xml base dir.
Definition at line 130 of file SvgLoadingContext.cpp.
References currentGC(), d, and SvgGraphicsContext::xmlBaseDir.
| SvgCssHelper SvgLoadingContext::cssStyles |
Definition at line 55 of file SvgLoadingContext.cpp.
|
private |
Definition at line 96 of file SvgLoadingContext.h.
| QHash<QString, QDomElement> SvgLoadingContext::definitions |
Definition at line 53 of file SvgLoadingContext.cpp.
| KoDocumentResourceManager* SvgLoadingContext::documentResourceManager |
Definition at line 51 of file SvgLoadingContext.cpp.
| FileFetcherFunc SvgLoadingContext::fileFetcher |
Definition at line 57 of file SvgLoadingContext.cpp.
| QStack<SvgGraphicsContext*> SvgLoadingContext::gcStack |
Definition at line 48 of file SvgLoadingContext.cpp.
| QString SvgLoadingContext::initialXmlBaseDir |
Definition at line 49 of file SvgLoadingContext.cpp.
| QHash<QString, KoShape*> SvgLoadingContext::loadedShapes |
Definition at line 52 of file SvgLoadingContext.cpp.
| QHash< QString, const KoColorProfile * > SvgLoadingContext::profiles |
Definition at line 54 of file SvgLoadingContext.cpp.
| SvgStyleParser & SvgLoadingContext::styleParser |
Definition at line 56 of file SvgLoadingContext.cpp.
| int SvgLoadingContext::zIndex |
Definition at line 50 of file SvgLoadingContext.cpp.