Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
gradient-chemistry.cpp File Reference

Go to the source code of this file.

Namespaces

namespace  Inkscape
 Helper class to stream background task notifications as a series of messages.
 

Functions

std::vector< PaintTarget > const & Inkscape::allPaintTargets ()
 Convenience function to access a common vector of all enum values.
 
static void sp_gradient_repr_set_link (Inkscape::XML::Node *repr, SPGradient *gr)
 
SPGradientsp_gradient_ensure_vector_normalized (SPGradient *gr)
 Either normalizes given gradient to vector, or returns fresh normalized vector - in latter case, original gradient is flattened and stops cleared.
 
static SPGradientsp_gradient_get_private_normalized (SPDocument *document, SPGradient *shared, SPGradientType type)
 Creates new private gradient for the given shared gradient.
 
static guint count_gradient_hrefs (SPObject *o, SPGradient *gr)
 Count how many times gr is used by the styles of o and its descendants.
 
static SPGradientsp_gradient_fork_private_if_necessary (SPGradient *gr, SPGradient *shared, SPGradientType type, SPObject *o)
 If gr has other users, create a new shared; also check if gr links to shared, relink if not.
 
SPGradientsp_gradient_fork_vector_if_necessary (SPGradient *gr)
 
SPGradientsp_gradient_get_forked_vector_if_necessary (SPGradient *gradient, bool force_vector)
 Obtain the vector from the gradient.
 
SPGradientsp_gradient_reset_to_userspace (SPGradient *gr, SPItem *item)
 Convert an item's gradient to userspace without preserving coords, setting them to defaults instead.
 
SPGradientsp_gradient_convert_to_userspace (SPGradient *gr, SPItem *item, gchar const *property)
 Convert an item's gradient to userspace if necessary, also fork it if necessary.
 
void sp_gradient_transform_multiply (SPGradient *gradient, Geom::Affine postmul, bool set)
 
SPGradientgetGradient (SPItem *item, Inkscape::PaintTarget fill_or_stroke)
 Fetches either the fill or the stroke gradient from the given item.
 
SPStopsp_last_stop (SPGradient *gradient)
 
std::pair< SPStop *, SPStop * > sp_get_before_after_stops (SPStop *stop)
 
static std::pair< SPStop *, SPStop * > get_before_after_stops (SPGradient *gradient, double offset)
 
guint sp_number_of_stops_before_stop (SPGradient *gradient, SPStop *target)
 
SPStopsp_get_nth_stop (SPGradient *gradient, guint index)
 
SPStopsp_get_stop_i (SPGradient *gradient, guint stop_i)
 
void sp_repr_set_css_double (Inkscape::XML::Node *node, const char *key, double value)
 
SPStopsp_vector_add_stop (SPGradient *vector, SPStop *prev_stop, SPStop *next_stop, gfloat offset)
 
void sp_gradient_delete_stop (SPGradient *gradient, SPStop *stop)
 
static bool verify_grad (SPGradient *gradient)
 
SPStopsp_gradient_add_stop (SPGradient *gradient, SPStop *current)
 
SPStopsp_gradient_add_stop_at (SPGradient *gradient, double offset)
 
void sp_set_gradient_stop_color (SPDocument *document, SPStop *stop, Color const &color)
 
SPStopsp_item_gradient_get_stop (SPItem *item, GrPointType point_type, guint point_i, Inkscape::PaintTarget fill_or_stroke)
 
Color sp_item_gradient_stop_query_style (SPItem *item, GrPointType point_type, guint point_i, Inkscape::PaintTarget fill_or_stroke)
 
void sp_item_gradient_stop_set_style (SPItem *item, GrPointType point_type, guint point_i, Inkscape::PaintTarget fill_or_stroke, SPCSSAttr *stop)
 
void sp_item_gradient_reverse_vector (SPItem *item, Inkscape::PaintTarget fill_or_stroke)
 
void sp_gradient_reverse_vector (SPGradient *gradient)
 
void sp_item_gradient_invert_vector_color (SPItem *item, Inkscape::PaintTarget fill_or_stroke)
 
double midpoint_offset_hack (double offset)
 
void sp_item_gradient_set_coords (SPItem *item, GrPointType point_type, guint point_i, Geom::Point p_w, Inkscape::PaintTarget fill_or_stroke, bool write_repr, bool scale)
 Set the position of point point_type of the gradient applied to item (either fill_or_stroke) to p_w (in desktop coordinates).
 
SPGradientsp_item_gradient_get_vector (SPItem *item, Inkscape::PaintTarget fill_or_stroke)
 
SPGradientSpread sp_item_gradient_get_spread (SPItem *item, Inkscape::PaintTarget fill_or_stroke)
 
Geom::Point getGradientCoords (SPItem *item, GrPointType point_type, guint point_i, Inkscape::PaintTarget fill_or_stroke)
 Returns the position of point point_type of the gradient applied to item (either fill_or_stroke), in desktop coordinates.
 
SPGradientsp_item_set_gradient (SPItem *item, SPGradient *gr, SPGradientType type, Inkscape::PaintTarget fill_or_stroke)
 Sets item fill or stroke to the gradient of the specified type with given vector, creating new private gradient, if needed.
 
static void addStop (Inkscape::XML::Node *parent, Color const &color, double opacity, gchar const *offset)
 
SPGradientsp_document_default_gradient_vector (SPDocument *document, Color const &color, double opacity, bool singleStop)
 
SPGradientsp_gradient_vector_for_object (SPDocument *const doc, SPDesktop *const desktop, SPObject *const o, Inkscape::PaintTarget const fill_or_stroke, bool singleStop)
 Return the preferred vector for o, made from (in order of preference) its current vector, current fill or stroke color, or from desktop style if o is NULL or doesn't have style.
 
void sp_gradient_invert_selected_gradients (SPDesktop *desktop, Inkscape::PaintTarget fill_or_stroke)
 
void sp_gradient_reverse_selected_gradients (SPDesktop *desktop)
 
void sp_gradient_unset_swatch (SPDesktop *desktop, std::string const &id)
 
SPGradientsp_item_get_gradient (SPItem *item, bool fillorstroke)
 
static void get_all_doc_items (std::vector< SPItem * > &list, SPObject *from)
 
std::vector< SPItem * > sp_get_all_document_items (SPDocument *document)
 
int sp_get_gradient_refcount (SPDocument *document, SPGradient *gradient)
 

Function Documentation

◆ addStop()

static void addStop ( Inkscape::XML::Node parent,
Color const &  color,
double  opacity,
gchar const *  offset 
)
static

◆ count_gradient_hrefs()

static guint count_gradient_hrefs ( SPObject o,
SPGradient gr 
)
static

Count how many times gr is used by the styles of o and its descendants.

Definition at line 186 of file gradient-chemistry.cpp.

References child, SPObject::children, count_gradient_hrefs(), SPStyle::fill, SPStyle::stroke, and SPObject::style.

Referenced by count_gradient_hrefs(), sp_gradient_fork_private_if_necessary(), and sp_item_set_gradient().

◆ get_all_doc_items()

static void get_all_doc_items ( std::vector< SPItem * > &  list,
SPObject from 
)
static

◆ get_before_after_stops()

static std::pair< SPStop *, SPStop * > get_before_after_stops ( SPGradient gradient,
double  offset 
)
static

◆ getGradient()

◆ getGradientCoords()

◆ midpoint_offset_hack()

double midpoint_offset_hack ( double  offset)

Definition at line 1187 of file gradient-chemistry.cpp.

References offset.

Referenced by sp_item_gradient_set_coords().

◆ sp_document_default_gradient_vector()

◆ sp_get_all_document_items()

std::vector< SPItem * > sp_get_all_document_items ( SPDocument document)

◆ sp_get_before_after_stops()

std::pair< SPStop *, SPStop * > sp_get_before_after_stops ( SPStop stop)

◆ sp_get_gradient_refcount()

int sp_get_gradient_refcount ( SPDocument document,
SPGradient gradient 
)

◆ sp_get_nth_stop()

◆ sp_get_stop_i()

◆ sp_gradient_add_stop()

◆ sp_gradient_add_stop_at()

◆ sp_gradient_convert_to_userspace()

◆ sp_gradient_delete_stop()

◆ sp_gradient_ensure_vector_normalized()

SPGradient * sp_gradient_ensure_vector_normalized ( SPGradient gradient)

◆ sp_gradient_fork_private_if_necessary()

◆ sp_gradient_fork_vector_if_necessary()

◆ sp_gradient_get_forked_vector_if_necessary()

◆ sp_gradient_get_private_normalized()

◆ sp_gradient_invert_selected_gradients()

◆ sp_gradient_repr_set_link()

◆ sp_gradient_reset_to_userspace()

SPGradient * sp_gradient_reset_to_userspace ( SPGradient gr,
SPItem item 
)

◆ sp_gradient_reverse_selected_gradients()

◆ sp_gradient_reverse_vector()

◆ sp_gradient_transform_multiply()

void sp_gradient_transform_multiply ( SPGradient gradient,
Geom::Affine  postmul,
bool  set 
)

◆ sp_gradient_unset_swatch()

void sp_gradient_unset_swatch ( SPDesktop desktop,
std::string const &  id 
)

◆ sp_gradient_vector_for_object()

SPGradient * sp_gradient_vector_for_object ( SPDocument *const  doc,
SPDesktop *const  desktop,
SPObject *const  o,
Inkscape::PaintTarget const  fill_or_stroke,
bool  singleStop 
)

◆ sp_item_get_gradient()

◆ sp_item_gradient_get_spread()

SPGradientSpread sp_item_gradient_get_spread ( SPItem item,
Inkscape::PaintTarget  fill_or_stroke 
)

◆ sp_item_gradient_get_stop()

◆ sp_item_gradient_get_vector()

SPGradient * sp_item_gradient_get_vector ( SPItem item,
Inkscape::PaintTarget  fill_or_stroke 
)

Definition at line 1462 of file gradient-chemistry.cpp.

References getGradient(), SPGradient::getVector(), and item.

◆ sp_item_gradient_invert_vector_color()

◆ sp_item_gradient_reverse_vector()

void sp_item_gradient_reverse_vector ( SPItem item,
Inkscape::PaintTarget  fill_or_stroke 
)

◆ sp_item_gradient_set_coords()

◆ sp_item_gradient_stop_query_style()

◆ sp_item_gradient_stop_set_style()

◆ sp_item_set_gradient()

◆ sp_last_stop()

◆ sp_number_of_stops_before_stop()

guint sp_number_of_stops_before_stop ( SPGradient gradient,
SPStop target 
)

◆ sp_repr_set_css_double()

void sp_repr_set_css_double ( Inkscape::XML::Node node,
const char *  key,
double  value 
)

◆ sp_set_gradient_stop_color()

void sp_set_gradient_stop_color ( SPDocument document,
SPStop stop,
Color const &  color 
)

◆ sp_vector_add_stop()

◆ verify_grad()