2#ifndef SEEN_SP_GRADIENT_H
3#define SEEN_SP_GRADIENT_H
20#include <glibmm/ustring.h>
21#include <sigc++/connection.h>
90 int tag()
const override {
return tag_of<
decltype(*this)>; }
226 void modified(
unsigned int flags)
override;
3x3 affine transformation matrix.
constexpr int tag_of
Convenience function to retrieve the tag (class id) of a given type.
3x3 matrix representing an affine transformation.
Axis-aligned rectangle that can be empty.
Axis aligned, non-empty rectangle.
Interface for refcounted XML nodes.
Typed SVG document implementation.
SPGradient const * getVector(bool force_private=false) const
SPGradient * getArray(bool force_private=false)
Returns private mesh of given gradient (the gradient at the end of the href chain which has patches),...
void setPinned(bool pinned=true)
unsigned int state
State in Inkscape gradient system.
void ensureArray()
Forces array (mesh) to be built, if not present (i.e.
void build(SPDocument *document, Inkscape::XML::Node *repr) override
Virtual build: set gradient attributes from its associated repr.
void set_gs2d_matrix(Geom::Affine const &ctm, Geom::Rect const &bbox, Geom::Affine const &gs2d)
SPGradientVector vector
Linear and Radial Gradients.
Inkscape::XML::Node * write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags) override
Write gradient attributes to repr.
void remove_child(Inkscape::XML::Node *child) override
Callback for remove_child event.
Geom::Affine gradientTransform
gradientTransform attribute
SPGradientUnits fetchUnits()
Returns the effective units of given gradient (climbing up the refs chain if needed).
sigc::connection modified_connection
SPGradientSpread getSpread() const
bool invalidateVector()
Return true if change made.
unsigned int has_stops
Gradient stops.
void release() override
Virtual release of SPGradient members before destruction.
void child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) override
Callback for child_added event.
static void gradientRefChanged(SPObject *old_ref, SPObject *ref, SPGradient *gr)
Gets called when the gradient is (re)attached to another gradient.
SPGradientSpread fetchSpread() const
Returns the effective spread of given gradient (climbing up the refs chain if needed).
void modified(unsigned int flags) override
Callback for modified event.
SPGradientReference * ref
Reference (href)
unsigned int gradientTransform_set
SPGradient * getVector(bool force_private=false)
Returns private vector of given gradient (the gradient at the end of the href chain which has stops),...
bool invalidateArray()
Return true if change made.
void rebuildVector() const
Creates normalized color vector.
void setSpread(SPGradientSpread spread)
Set spread property of gradient and emit modified.
cairo_pattern_t * create_preview_pattern(double width)
SPGradientUnits getUnits() const
SPGradientUnits units
gradientUnits attribute
void repr_clear_vector()
Clears the gradient's svg:stop children from its repr.
unsigned int has_patches
Gradient patches.
bool isEquivalent(SPGradient *b)
return true if this gradient is "equivalent" to that gradient.
void rebuildArray()
Creates normalized color mesh patch array.
SPMeshNodeArray array
Mesh Gradients.
bool _pinned
Pinned in swatches dialog.
Geom::OptRect getAllItemsBox() const
Return a visual bounding box that covers every item this gradient would paint added together.
bool isUnitsSet() const
All Gradients.
SPMeshNodeArray array_smoothed
bool isAligned(SPGradient *b)
return true if this gradient is "aligned" to that gradient.
void setUnits(SPGradientUnits units)
Set units property of gradient and emit modified.
Geom::Affine get_g2d_matrix(Geom::Affine const &ctm, Geom::Rect const &bbox) const
Transforms to/from gradient position space in given environment.
SPGradientSpread spread
spreadMethod attribute
static void gradientRefModified(SPObject *href, unsigned int flags, SPGradient *gradient)
SPGradientVector const & getGradientVector() const
void repr_write_vector()
Writes the gradient's internal vector (whether from its own stops, or inherited from refs) into the g...
Geom::Affine get_gs2d_matrix(Geom::Affine const &ctm, Geom::Rect const &bbox) const
void ensureVector()
Forces vector to be built, if not present (i.e.
void setSwatch(bool swatch=true)
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Inkscape::XML::Node * repr
_cairo_pattern cairo_pattern_t
Helper class to stream background task notifications as a series of messages.
std::vector< PaintTarget > const & allPaintTargets()
Convenience function to access a common vector of all enum values.
static cairo_user_data_key_t key
TODO: insert short description here.
TODO: insert short description here.
TODO: insert short description here.
@ SP_GRADIENT_STATE_VECTOR
@ SP_GRADIENT_STATE_UNKNOWN
@ SP_GRADIENT_STATE_PRIVATE
void sp_gradient_pattern_common_setup(cairo_pattern_t *cp, SPGradient *gr, Geom::OptRect const &bbox, double opacity)
@ SP_GRADIENT_TYPE_LINEAR
@ SP_GRADIENT_TYPE_UNKNOWN
@ SP_GRADIENT_TYPE_RADIAL
Interface for XML documents.
The effective gradient vector, after copying stops from the referenced gradient if necessary.