|
Krita Source Code Documentation
|
#include <KisSeExprScript.h>
Inheritance diagram for KisSeExprScript:Classes | |
| struct | Private |
Public Member Functions | |
| KoResourceSP | clone () const override |
| QString | defaultFileExtension () const override |
| KisSeExprScript (const KisSeExprScript &rhs) | |
| KisSeExprScript (const QImage &image, const QString &script, const QString &name, const QString &folderName) | |
| KisSeExprScript (const QString &filename) | |
| KisSeExprScript (KisSeExprScript *rhs) | |
| bool | loadFromDevice (QIODevice *dev, KisResourcesInterfaceSP resourcesInterface) override |
| QString | name () const override |
| QPair< QString, QString > | resourceType () const override |
| bool | saveToDevice (QIODevice *dev) const override |
| QString | script () const |
| script the actual script | |
| void | setScript (const QString &script) |
| set SeExpr expression script | |
| ~KisSeExprScript () | |
Public Member Functions inherited from KoResource | |
| bool | active () const |
| void | addMetaData (QString key, QVariant value) |
| store the given key, value pair in the resource | |
| virtual void | clearSideLoadedResources () |
| virtual QList< KoResourceLoadResult > | embeddedResources (KisResourcesInterfaceSP globalResourcesInterface) const |
| QString | filename () const |
| QImage | image () const |
| bool | isDirty () const |
| virtual bool | isEphemeral () const |
| virtual bool | isSerializable () const |
| KoResource () | |
| KoResource (const KoResource &rhs) | |
| KoResource (const QString &filename) | |
| virtual QList< KoResourceLoadResult > | linkedResources (KisResourcesInterfaceSP globalResourcesInterface) const |
| bool | load (KisResourcesInterfaceSP resourcesInterface) |
| QString | md5Sum (bool generateIfEmpty=true) const |
| QMap< QString, QVariant > | metadata () const |
| get a map with all the metadata | |
| KoResource & | operator= (const KoResource &rhs)=delete |
| bool | permanent () const |
| virtual QList< int > | requiredCanvasResources () const |
| QList< KoResourceLoadResult > | requiredResources (KisResourcesInterfaceSP globalResourcesInterface) const |
| int | resourceId () const |
| bool | save () |
| void | setActive (bool active) |
| void | setDirty (bool value) |
| Mark the preset as modified but not saved. | |
| void | setFilename (const QString &filename) |
| void | setImage (const QImage &image) |
| void | setMD5Sum (const QString &md5sum) |
| Set the md5sum of this resource. It must be in hex-encoded string format. | |
| void | setName (const QString &name) |
| void | setPermanent (bool permanent) |
| void | setResourceId (int id) |
| void | setStorageLocation (const QString &location) |
| void | setValid (bool valid) |
| void | setVersion (int version) |
| virtual QList< KoResourceLoadResult > | sideLoadedResources (KisResourcesInterfaceSP globalResourcesInterface) const |
| KoResourceSignature | signature () const |
| QString | storageLocation () const |
| QList< KoResourceLoadResult > | takeSideLoadedResources (KisResourcesInterfaceSP globalResourcesInterface) |
| virtual QImage | thumbnail () const |
| thumbnail the thumbnail image to use in resource selectors | |
| virtual QString | thumbnailPath () const |
| thumbnailPath returns the path to a separate thumbnail image, outside the actual resource file itself. If the path is relative, it is supposed start in the same location as the resource itself. If it's absolute, that is, it starts with "/", it is from the root of the storage. | |
| virtual void | updateThumbnail () |
| updateThumbnail updates the thumbnail for this resource. Reimplement if your thumbnail is something else than the image set with setImage. | |
| bool | valid () const |
| int | version () const |
| Get the version of the resource. | |
| virtual | ~KoResource () |
Public Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Private Attributes | |
| Private *const | d |
Additional Inherited Members | |
Public Attributes inherited from KoResource | |
| bool | active {true} |
| QString | filename |
| QImage | image |
| QString | md5sum |
| QMap< QString, QVariant > | metadata |
| bool | modified {false} |
| QString | name |
| bool | permanent {false} |
| int | resourceId {-1} |
| QString | storageLocation |
| bool | valid {false} |
| int | version {-1} |
Public Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
KoResource container for SeExpr scripts.
Definition at line 22 of file KisSeExprScript.h.
| KisSeExprScript::KisSeExprScript | ( | const QString & | filename | ) |
Creates a new KisSeExprScript object using filename. No file is opened in the constructor, you have to call load.
| filename | the file name to save and load from. |
Definition at line 25 of file KisSeExprScript.cpp.
References defaultFileExtension(), name(), and KoResource::setName().
| KisSeExprScript::KisSeExprScript | ( | const QImage & | image, |
| const QString & | script, | ||
| const QString & | name, | ||
| const QString & | folderName ) |
Creates a new SeExpr script resource with the given image thumbnail, script, name, and folder name.
| image | the thumbnail of the texture this script will render |
| script | the actual script's contents |
| name | the name of the script |
| folderName | the folder name |
Definition at line 36 of file KisSeExprScript.cpp.
References defaultFileExtension(), KoResource::image, name(), script(), KoResource::setFilename(), KoResource::setImage(), KoResource::setName(), and setScript().
| KisSeExprScript::KisSeExprScript | ( | KisSeExprScript * | rhs | ) |
Clones the given SeExpr script into a new instance.
| rhs | the original SeExpr script to be copied onto this object |
Definition at line 55 of file KisSeExprScript.cpp.
| KisSeExprScript::KisSeExprScript | ( | const KisSeExprScript & | rhs | ) |
Definition at line 60 of file KisSeExprScript.cpp.
References KoResource::isDirty(), KIS_SAFE_ASSERT_RECOVER_NOOP, script(), setScript(), KoResource::setValid(), and KoResource::valid.
| KisSeExprScript::~KisSeExprScript | ( | ) |
|
overridevirtual |
Implements KoResource.
Definition at line 192 of file KisSeExprScript.cpp.
References KisSeExprScript().
|
overridevirtual |
Reimplemented from KoResource.
Definition at line 177 of file KisSeExprScript.cpp.
|
overridevirtual |
Load this resource.
Implements KoResource.
Definition at line 75 of file KisSeExprScript.cpp.
References KoStore::createStore(), d, KisSeExprScript::Private::data, KoResource::filename, KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, name(), KoStoreDevice::open(), KoStore::Read, KisSeExprScript::Private::script, KoResource::setDirty(), KoResource::setImage(), KoResource::setValid(), void(), warnFlake, and KoStore::Zip.
|
overridevirtual |
Reimplemented from KoResource.
Definition at line 197 of file KisSeExprScript.cpp.
References KoResource::name.
|
overridevirtual |
Implements KoResource.
Definition at line 172 of file KisSeExprScript.cpp.
References ResourceType::SeExprScripts.
|
overridevirtual |
Save this resource.
Reimplemented from KoResource.
Definition at line 138 of file KisSeExprScript.cpp.
References KoStore::bad(), KoStore::close(), KoStore::createStore(), d, KoStore::finalize(), KoResource::image, KoStore::open(), KoStoreDevice::open(), KisSeExprScript::Private::script, KoStore::Write, and KoStore::Zip.
| QString KisSeExprScript::script | ( | ) | const |
script the actual script
Definition at line 182 of file KisSeExprScript.cpp.
References d, and KisSeExprScript::Private::script.
| void KisSeExprScript::setScript | ( | const QString & | script | ) |
set SeExpr expression script
Definition at line 187 of file KisSeExprScript.cpp.
References d, KisSeExprScript::Private::script, and script().
|
private |
Definition at line 88 of file KisSeExprScript.h.