Inkscape
Vector Graphics Editor
|
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) |
SPGradient * | sp_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 SPGradient * | sp_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 SPGradient * | sp_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. | |
SPGradient * | sp_gradient_fork_vector_if_necessary (SPGradient *gr) |
SPGradient * | sp_gradient_get_forked_vector_if_necessary (SPGradient *gradient, bool force_vector) |
Obtain the vector from the gradient. | |
SPGradient * | sp_gradient_reset_to_userspace (SPGradient *gr, SPItem *item) |
Convert an item's gradient to userspace without preserving coords, setting them to defaults instead. | |
SPGradient * | sp_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) |
SPGradient * | getGradient (SPItem *item, Inkscape::PaintTarget fill_or_stroke) |
Fetches either the fill or the stroke gradient from the given item. | |
SPStop * | sp_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) |
SPStop * | sp_get_nth_stop (SPGradient *gradient, guint index) |
SPStop * | sp_get_stop_i (SPGradient *gradient, guint stop_i) |
void | sp_repr_set_css_double (Inkscape::XML::Node *node, const char *key, double value) |
SPStop * | sp_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) |
SPStop * | sp_gradient_add_stop (SPGradient *gradient, SPStop *current) |
SPStop * | sp_gradient_add_stop_at (SPGradient *gradient, double offset) |
void | sp_set_gradient_stop_color (SPDocument *document, SPStop *stop, Color const &color) |
SPStop * | sp_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). | |
SPGradient * | sp_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. | |
SPGradient * | sp_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) |
SPGradient * | sp_document_default_gradient_vector (SPDocument *document, Color const &color, double opacity, bool singleStop) |
SPGradient * | sp_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) |
SPGradient * | sp_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) |
|
static |
Definition at line 1695 of file gradient-chemistry.cpp.
References offset, parent, Inkscape::GC::release(), Inkscape::XML::Node::setAttribute(), and SPStop::setColorRepr().
Referenced by sp_document_default_gradient_vector().
|
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().
Definition at line 1860 of file gradient-chemistry.cpp.
References child, SPObject::children, and get_all_doc_items().
Referenced by get_all_doc_items(), and sp_get_all_document_items().
|
static |
Definition at line 643 of file gradient-chemistry.cpp.
References SPGradient::getFirstStop(), SPStop::getNextStop(), SPStop::offset, and offset.
Referenced by sp_gradient_add_stop_at().
SPGradient * getGradient | ( | SPItem * | item, |
Inkscape::PaintTarget | fill_or_stroke | ||
) |
Fetches either the fill or the stroke gradient from the given item.
fill_or_stroke | the gradient type (fill/stroke) to get. |
Definition at line 594 of file gradient-chemistry.cpp.
References SPStyle::fill, Inkscape::FOR_FILL, Inkscape::FOR_STROKE, SPStyle::getFillPaintServer(), SPStyle::getStrokePaintServer(), item, SPStyle::stroke, and SPObject::style.
Referenced by Inkscape::UI::Tools::GradientTool::add_stops_between_selected_stops(), GrDrag::addStopNearPoint(), Inkscape::UI::Tools::MeshTool::corner_operation(), GrDrag::deleteSelected(), GrDrag::dropColor(), Inkscape::UI::Tools::get_stop_intervals(), getGradientCoords(), GrDragger::getMgCorner(), gr_knot_clicked_handler(), gr_knot_doubleclicked_handler(), GrDragger::highlightCorner(), GrDragger::moveMeshHandles(), GrDrag::selectByStop(), sp_item_gradient_get_spread(), sp_item_gradient_get_stop(), sp_item_gradient_get_vector(), sp_item_gradient_invert_vector_color(), sp_item_gradient_reverse_vector(), sp_item_gradient_set_coords(), sp_item_gradient_stop_query_style(), sp_item_gradient_stop_set_style(), GrDrag::styleSet(), and Inkscape::UI::Tools::tweak_colors_in_gradient().
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.
Definition at line 1488 of file gradient-chemistry.cpp.
References SPObject::document, SPDocument::ensureUpToDate(), getGradient(), SPGradient::getUnits(), SPGradient::gradientTransform, SPItem::i2dt_affine(), item, offset, POINT_LG_BEGIN, POINT_LG_END, POINT_LG_MID, POINT_MG_CORNER, POINT_MG_HANDLE, POINT_MG_TENSOR, POINT_RG_CENTER, POINT_RG_FOCUS, POINT_RG_MID1, POINT_RG_MID2, POINT_RG_R1, POINT_RG_R2, SP_GRADIENT_UNITS_OBJECTBOUNDINGBOX, SPItem::visualBounds(), Geom::X, and Geom::Y.
Referenced by GrDrag::addDragger(), GrDrag::addStopNearPoint(), GrDragger::moveMeshHandles(), GrDragger::moveThisToDraggable(), GrDrag::refreshDraggersMesh(), and GrDrag::updateLines().
double midpoint_offset_hack | ( | double | offset | ) |
Definition at line 1187 of file gradient-chemistry.cpp.
References offset.
Referenced by sp_item_gradient_set_coords().
SPGradient * sp_document_default_gradient_vector | ( | SPDocument * | document, |
Color const & | color, | ||
double | opacity, | ||
bool | singleStop | ||
) |
Definition at line 1714 of file gradient-chemistry.cpp.
References Inkscape::XML::Node::addChild(), addStop(), Inkscape::XML::Document::createElement(), SPDocument::generate_unique_id(), Inkscape::Preferences::get(), Inkscape::Preferences::getBool(), SPDocument::getDefs(), SPDocument::getObjectByRepr(), SPObject::getRepr(), SPDocument::getReprDoc(), Inkscape::GC::release(), Inkscape::XML::Node::setAttribute(), SP_GRADIENT_STATE_VECTOR, and SPGradient::state.
Referenced by sp_gradient_vector_for_object(), and Inkscape::UI::Widget::FillNStroke::updateFromPaint().
std::vector< SPItem * > sp_get_all_document_items | ( | SPDocument * | document | ) |
Definition at line 1870 of file gradient-chemistry.cpp.
References get_all_doc_items(), SPDocument::getRoot(), and items.
Referenced by gr_get_usage_counts(), and sp_get_gradient_refcount().
Definition at line 631 of file gradient-chemistry.cpp.
References SPStop::getNextStop(), and SPStop::getPrevStop().
Referenced by Inkscape::UI::Widget::GradientEditor::stop_selected().
int sp_get_gradient_refcount | ( | SPDocument * | document, |
SPGradient * | gradient | ||
) |
Definition at line 1878 of file gradient-chemistry.cpp.
References fill, SPObject::getId(), item, sp_get_all_document_items(), sp_item_get_gradient(), and stroke.
Referenced by Inkscape::UI::Widget::GradientSelector::check_del_button().
SPStop * sp_get_nth_stop | ( | SPGradient * | gradient, |
guint | index | ||
) |
Definition at line 674 of file gradient-chemistry.cpp.
References SPGradient::getFirstStop(), SPStop::getNextStop(), and index.
Referenced by Inkscape::UI::Widget::GradientEditor::add_stop(), Inkscape::UI::Widget::GradientEditor::delete_stop(), Inkscape::UI::Widget::GradientEditor::get_nth_stop(), and Inkscape::UI::Widget::GradientEditor::set_stop_color().
SPStop * sp_get_stop_i | ( | SPGradient * | gradient, |
guint | stop_i | ||
) |
Definition at line 688 of file gradient-chemistry.cpp.
References SPGradient::getFirstStop(), SPStop::getNextStop(), and SPStop::offset.
Referenced by Inkscape::UI::Tools::GradientTool::add_stops_between_selected_stops(), GrDrag::deleteSelected(), Inkscape::UI::Tools::get_stop_intervals(), gr_knot_clicked_handler(), Inkscape::UI::Toolbar::GradientToolbar::select_stop_by_draggers(), GrDrag::selectByStop(), sp_item_gradient_get_stop(), sp_item_gradient_set_coords(), sp_item_gradient_stop_query_style(), and sp_item_gradient_stop_set_style().
SPStop * sp_gradient_add_stop | ( | SPGradient * | gradient, |
SPStop * | current | ||
) |
Definition at line 815 of file gradient-chemistry.cpp.
References Inkscape::XML::Node::addChild(), Inkscape::Colors::Color::averaged(), current, SPObject::document, Inkscape::XML::Node::document(), Inkscape::DocumentUndo::done(), Inkscape::XML::Node::duplicate(), SPStop::getColor(), SPStop::getNextStop(), SPDocument::getObjectByRepr(), SPStop::getPrevStop(), SPObject::getRepr(), SPStop::offset, Inkscape::GC::release(), SPStop::setColor(), sp_repr_set_css_double(), and verify_grad().
Referenced by Inkscape::UI::Widget::GradientEditor::add_stop(), Inkscape::UI::Tools::GradientTool::add_stops_between_selected_stops(), and gr_knot_doubleclicked_handler().
SPStop * sp_gradient_add_stop_at | ( | SPGradient * | gradient, |
double | offset | ||
) |
Definition at line 856 of file gradient-chemistry.cpp.
References SPObject::document, Inkscape::DocumentUndo::done(), get_before_after_stops(), offset, sp_vector_add_stop(), and verify_grad().
Referenced by GrDrag::addStopNearPoint(), and Inkscape::UI::Widget::GradientEditor::insert_stop_at().
SPGradient * sp_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.
Definition at line 452 of file gradient-chemistry.cpp.
References Geom::Affine::descrim(), SPObject::document, SPDocument::ensureUpToDate(), SPGradient::getArray(), SPObject::getRepr(), SPGradient::getUnits(), SPGradient::getVector(), SPGradient::gradientTransform, Geom::identity(), Geom::Affine::inverse(), SPGradient::isSolid(), item, Inkscape::XML::Node::setAttribute(), SPObject::setAttributeOrRemoveIfEmpty(), Inkscape::XML::Node::setAttributeSvgDouble(), sp_gradient_fork_private_if_necessary(), SP_GRADIENT_TYPE_LINEAR, SP_GRADIENT_TYPE_MESH, SP_GRADIENT_TYPE_RADIAL, SP_GRADIENT_UNITS_OBJECTBOUNDINGBOX, sp_style_set_property_url(), sp_svg_transform_write(), SPItem::visualBounds(), Geom::X, and Geom::Y.
Referenced by SPItem::adjust_gradient(), GrDragger::moveMeshHandles(), and sp_item_gradient_set_coords().
void sp_gradient_delete_stop | ( | SPGradient * | gradient, |
SPStop * | stop | ||
) |
Definition at line 758 of file gradient-chemistry.cpp.
References SPObject::document, Inkscape::DocumentUndo::done(), SPObject::getRepr(), SPGradient::getStopCount(), and Inkscape::XML::Node::removeChild().
Referenced by Inkscape::UI::Widget::GradientEditor::delete_stop().
SPGradient * sp_gradient_ensure_vector_normalized | ( | SPGradient * | gradient | ) |
Either normalizes given gradient to vector, or returns fresh normalized vector - in latter case, original gradient is flattened and stops cleared.
No transrefing - i.e. caller shouldn't hold reference to original and does not get one to new automatically (doc holds ref of every object anyways)
Definition at line 95 of file gradient-chemistry.cpp.
References SPGradientVector::built, SPGradient::ensureVector(), SPObject::getId(), SPGradientReference::getObject(), SPObject::getRepr(), SPGradient::hasStops(), SPGradient::ref, SPGradient::repr_write_vector(), sp_gradient_repr_set_link(), SP_GRADIENT_STATE_UNKNOWN, SP_GRADIENT_STATE_VECTOR, SPGradient::state, SPObject::updateRepr(), and SPGradient::vector.
Referenced by Inkscape::UI::Widget::SwatchSelector::_changedCb(), SPGradient::getVector(), Inkscape::UI::Toolbar::GradientToolbar::gradient_changed(), sp_gradient_fork_vector_if_necessary(), Inkscape::UI::Widget::FillNStroke::updateFromPaint(), and Inkscape::UI::Widget::GradientSelector::vector_set().
|
static |
If gr has other users, create a new shared; also check if gr links to shared, relink if not.
Definition at line 220 of file gradient-chemistry.cpp.
References Inkscape::XML::Node::appendChild(), Inkscape::XML::Node::attribute(), child, count_gradient_hrefs(), SPObject::document, SPDocument::ensureUpToDate(), Inkscape::XML::Node::firstChild(), SPDocument::getDefs(), SPGradientReference::getObject(), SPObject::getRepr(), SPDocument::getReprDoc(), SPGradient::hasPatches(), SPGradient::hasStops(), SPObject::hrefcount, SPPaintServer::isSwatch(), SPObject::parent, SPGradient::ref, Inkscape::GC::release(), SPObject::requestModified(), Inkscape::XML::Node::setAttribute(), sp_gradient_get_private_normalized(), sp_gradient_repr_set_link(), SP_GRADIENT_STATE_UNKNOWN, and SPGradient::state.
Referenced by sp_gradient_convert_to_userspace(), and sp_item_set_gradient().
SPGradient * sp_gradient_fork_vector_if_necessary | ( | SPGradient * | gr | ) |
Definition at line 311 of file gradient-chemistry.cpp.
References Inkscape::XML::Node::addChild(), SPObject::document, Inkscape::XML::Node::duplicate(), Inkscape::Preferences::get(), Inkscape::Preferences::getBool(), SPDocument::getDefs(), SPDocument::getObjectByRepr(), SPObject::getRepr(), SPDocument::getReprDoc(), SPObject::hrefcount, Inkscape::GC::release(), and sp_gradient_ensure_vector_normalized().
Referenced by sp_gradient_get_forked_vector_if_necessary(), sp_gradient_reverse_vector(), sp_item_gradient_invert_vector_color(), and sp_item_gradient_stop_set_style().
SPGradient * sp_gradient_get_forked_vector_if_necessary | ( | SPGradient * | gradient, |
bool | force_vector | ||
) |
Obtain the vector from the gradient.
A forked vector will be created and linked to this gradient if another gradient uses it.
Definition at line 338 of file gradient-chemistry.cpp.
References SPGradientReference::getObject(), SPObject::getRepr(), SPGradient::getVector(), SPGradient::ref, sp_gradient_fork_vector_if_necessary(), and sp_gradient_repr_set_link().
Referenced by Inkscape::UI::Tools::GradientTool::add_stops_between_selected_stops(), GrDrag::addStopNearPoint(), GrDrag::deleteSelected(), Inkscape::UI::Widget::GradientEditor::get_gradient_vector(), Inkscape::UI::Tools::get_stop_intervals(), gr_knot_doubleclicked_handler(), sp_item_gradient_set_coords(), and Inkscape::UI::Tools::tweak_colors_in_gradient().
|
static |
Creates new private gradient for the given shared gradient.
Definition at line 138 of file gradient-chemistry.cpp.
References Inkscape::XML::Node::appendChild(), Inkscape::XML::Document::createElement(), Inkscape::Preferences::get(), Inkscape::Preferences::getBool(), SPDocument::getDefs(), SPDocument::getObjectByRepr(), SPObject::getRepr(), SPDocument::getReprDoc(), SPGradient::hasPatches(), SPGradient::hasStops(), Inkscape::GC::release(), Inkscape::XML::Node::setAttribute(), sp_gradient_repr_set_link(), SP_GRADIENT_TYPE_LINEAR, and SP_GRADIENT_TYPE_RADIAL.
Referenced by sp_gradient_fork_private_if_necessary(), and sp_item_set_gradient().
void sp_gradient_invert_selected_gradients | ( | SPDesktop * | desktop, |
Inkscape::PaintTarget | fill_or_stroke | ||
) |
Definition at line 1784 of file gradient-chemistry.cpp.
References desktop, Inkscape::DocumentUndo::done(), SPDesktop::getDocument(), SPDesktop::getSelection(), Inkscape::ObjectSet::items(), and sp_item_gradient_invert_vector_color().
Referenced by Inkscape::UI::Widget::SelectedStyle::on_fill_invert(), and Inkscape::UI::Widget::SelectedStyle::on_stroke_invert().
|
static |
Definition at line 1677 of file gradient-chemistry.cpp.
References SPObject::getId(), ref, Inkscape::XML::Node::removeAttribute(), and Inkscape::setHrefAttribute().
Referenced by sp_gradient_ensure_vector_normalized(), sp_gradient_fork_private_if_necessary(), sp_gradient_get_forked_vector_if_necessary(), sp_gradient_get_private_normalized(), sp_gradient_reverse_vector(), sp_item_gradient_invert_vector_color(), sp_item_gradient_stop_set_style(), and sp_item_set_gradient().
SPGradient * sp_gradient_reset_to_userspace | ( | SPGradient * | gr, |
SPItem * | item | ||
) |
Convert an item's gradient to userspace without preserving coords, setting them to defaults instead.
No forking or reapplying is done because this is only called for newly created privates.
Definition at line 357 of file gradient-chemistry.cpp.
References Geom::Line::angle(), SPObject::document, SPDocument::ensureUpToDate(), Inkscape::Preferences::get(), Inkscape::Preferences::getDouble(), SPObject::getRepr(), SPGradient::gradientTransform, height, Geom::BezierCurveN< degree >::isDegenerate(), item, Geom::BezierCurve::pointAt(), Geom::Line::ray(), Inkscape::XML::Node::setAttribute(), SPObject::setAttributeOrRemoveIfEmpty(), Inkscape::XML::Node::setAttributeSvgDouble(), sp_svg_transform_write(), SPItem::visualBounds(), width, Geom::X, and Geom::Y.
Referenced by sp_item_set_gradient().
void sp_gradient_reverse_selected_gradients | ( | SPDesktop * | desktop | ) |
Definition at line 1797 of file gradient-chemistry.cpp.
References desktop, Inkscape::DocumentUndo::done(), Inkscape::FOR_FILL, Inkscape::FOR_STROKE, Inkscape::UI::Tools::ToolBase::get_drag(), SPDesktop::getDocument(), SPDesktop::getSelection(), SPDesktop::getTool(), Inkscape::ObjectSet::items(), GrDrag::selected, GrDrag::selected_reverse_vector(), and sp_item_gradient_reverse_vector().
Referenced by Inkscape::UI::Toolbar::GradientToolbar::reverse().
void sp_gradient_reverse_vector | ( | SPGradient * | gradient | ) |
Definition at line 1113 of file gradient-chemistry.cpp.
References SPObject::appendChildRepr(), child, SPObject::children, Inkscape::XML::Node::document(), SPGradientReference::getObject(), SPObject::getRepr(), SPGradient::getVector(), offset, SPGradient::ref, Inkscape::GC::release(), sp_gradient_fork_vector_if_necessary(), and sp_gradient_repr_set_link().
Referenced by Inkscape::UI::Widget::GradientEditor::reverse_gradient(), and sp_item_gradient_reverse_vector().
void sp_gradient_transform_multiply | ( | SPGradient * | gradient, |
Geom::Affine | postmul, | ||
bool | set | ||
) |
Definition at line 578 of file gradient-chemistry.cpp.
References c, SPGradient::gradientTransform, SPGradient::gradientTransform_set, set, SPObject::setAttributeOrRemoveIfEmpty(), and sp_svg_transform_write().
Referenced by SPItem::adjust_gradient().
void sp_gradient_unset_swatch | ( | SPDesktop * | desktop, |
std::string const & | id | ||
) |
Definition at line 1823 of file gradient-chemistry.cpp.
References desktop, SPDesktop::doc(), Inkscape::DocumentUndo::done(), and SPDocument::getResourceList().
Referenced by Inkscape::UI::Widget::GradientSelector::delete_vector_clicked().
SPGradient * sp_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.
Definition at line 1755 of file gradient-chemistry.cpp.
References desktop, SPStyle::fill_opacity, Inkscape::FOR_FILL, SPIPaint::getColor(), SPStyle::getFillOrStroke(), SPStyle::getFillPaintServer(), SPStyle::getStrokePaintServer(), SPIPaint::isColor(), SPIPaint::isPaintserver(), sp_desktop_get_color(), sp_document_default_gradient_vector(), SPStyle::stroke_opacity, and SPObject::style.
Referenced by Inkscape::UI::Tools::GradientTool::drag(), and Inkscape::UI::Widget::FillNStroke::updateFromPaint().
SPGradient * sp_item_get_gradient | ( | SPItem * | item, |
bool | fillorstroke | ||
) |
Definition at line 1843 of file gradient-chemistry.cpp.
References SPStyle::getFillOrStroke(), SPStyle::getFillPaintServer(), SPStyle::getStrokePaintServer(), SPIPaint::isPaintserver(), item, and SPObject::style.
Referenced by gr_get_usage_counts(), and sp_get_gradient_refcount().
SPGradientSpread sp_item_gradient_get_spread | ( | SPItem * | item, |
Inkscape::PaintTarget | fill_or_stroke | ||
) |
Definition at line 1472 of file gradient-chemistry.cpp.
References SPGradient::fetchSpread(), getGradient(), item, and SP_GRADIENT_SPREAD_PAD.
SPStop * sp_item_gradient_get_stop | ( | SPItem * | item, |
GrPointType | point_type, | ||
guint | point_i, | ||
Inkscape::PaintTarget | fill_or_stroke | ||
) |
Definition at line 883 of file gradient-chemistry.cpp.
References SPGradient::getFirstStop(), getGradient(), SPGradient::getVector(), item, POINT_LG_BEGIN, POINT_LG_END, POINT_LG_MID, POINT_RG_CENTER, POINT_RG_FOCUS, POINT_RG_MID1, POINT_RG_MID2, POINT_RG_R1, POINT_RG_R2, sp_get_stop_i(), and sp_last_stop().
Referenced by gr_drag_style_query().
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.
void sp_item_gradient_invert_vector_color | ( | SPItem * | item, |
Inkscape::PaintTarget | fill_or_stroke | ||
) |
Definition at line 1156 of file gradient-chemistry.cpp.
References child, SPObject::children, getGradient(), SPGradientReference::getObject(), SPObject::getRepr(), SPGradient::getVector(), item, SPGradient::ref, sp_gradient_fork_vector_if_necessary(), and sp_gradient_repr_set_link().
Referenced by sp_gradient_invert_selected_gradients().
void sp_item_gradient_reverse_vector | ( | SPItem * | item, |
Inkscape::PaintTarget | fill_or_stroke | ||
) |
Definition at line 1104 of file gradient-chemistry.cpp.
References getGradient(), item, and sp_gradient_reverse_vector().
Referenced by GrDrag::selected_reverse_vector(), and sp_gradient_reverse_selected_gradients().
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).
Write_repr if you want the change to become permanent.
Definition at line 1204 of file gradient-chemistry.cpp.
References Geom::atan2(), c, end, Inkscape::FOR_FILL, getGradient(), SPObject::getRepr(), SPGradient::gradientTransform, SPGradient::gradientTransform_set, SPItem::i2dt_affine(), Geom::Affine::inverse(), item, Geom::L2(), midpoint_offset_hack(), Geom::BezierCurveN< degree >::nearestTime(), offset, POINT_LG_BEGIN, POINT_LG_END, POINT_LG_MID, POINT_MG_CORNER, POINT_MG_HANDLE, POINT_MG_TENSOR, POINT_RG_CENTER, POINT_RG_FOCUS, POINT_RG_MID1, POINT_RG_MID2, POINT_RG_R1, POINT_RG_R2, SPObject::requestModified(), scale, SPObject::setAttributeOrRemoveIfEmpty(), Inkscape::XML::Node::setAttributeSvgDouble(), sp_get_stop_i(), sp_gradient_convert_to_userspace(), sp_gradient_get_forked_vector_if_necessary(), sp_svg_transform_write(), start, Geom::X, and Geom::Y.
Referenced by Inkscape::UI::Tools::GradientTool::drag(), GrDragger::fireDraggables(), and GrDragger::moveThisToDraggable().
Color sp_item_gradient_stop_query_style | ( | SPItem * | item, |
GrPointType | point_type, | ||
guint | point_i, | ||
Inkscape::PaintTarget | fill_or_stroke | ||
) |
Definition at line 921 of file gradient-chemistry.cpp.
References SPMeshNode::color, SPStop::getColor(), SPGradient::getFirstStop(), getGradient(), SPGradient::getVector(), item, POINT_LG_BEGIN, POINT_LG_END, POINT_LG_MID, POINT_MG_CORNER, POINT_MG_HANDLE, POINT_MG_TENSOR, POINT_RG_CENTER, POINT_RG_FOCUS, POINT_RG_MID1, POINT_RG_MID2, POINT_RG_R1, POINT_RG_R2, sp_get_stop_i(), and sp_last_stop().
Referenced by GrDrag::getColor(), and gr_drag_style_query().
void sp_item_gradient_stop_set_style | ( | SPItem * | item, |
GrPointType | point_type, | ||
guint | point_i, | ||
Inkscape::PaintTarget | fill_or_stroke, | ||
SPCSSAttr * | stop | ||
) |
Definition at line 1005 of file gradient-chemistry.cpp.
References SPGradient::getFirstStop(), getGradient(), SPGradientReference::getObject(), SPObject::getRepr(), SPGradient::getVector(), item, POINT_LG_BEGIN, POINT_LG_END, POINT_LG_MID, POINT_MG_CORNER, POINT_MG_HANDLE, POINT_MG_TENSOR, POINT_RG_CENTER, POINT_RG_FOCUS, POINT_RG_MID1, POINT_RG_MID2, POINT_RG_R1, POINT_RG_R2, SPGradient::ref, sp_get_stop_i(), sp_gradient_fork_vector_if_necessary(), sp_gradient_repr_set_link(), sp_last_stop(), sp_repr_css_change(), sp_repr_css_double_property(), and sp_repr_css_property().
Referenced by GrDrag::addColorToDragger(), and GrDrag::styleSet().
SPGradient * sp_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.
gr has to be a normalized vector.
Definition at line 1605 of file gradient-chemistry.cpp.
References count_gradient_hrefs(), current, SPObject::document, SPStyle::fill, Inkscape::FOR_FILL, SPGradient::getVector(), item, SPObject::requestDisplayUpdate(), sp_gradient_fork_private_if_necessary(), sp_gradient_get_private_normalized(), sp_gradient_repr_set_link(), sp_gradient_reset_to_userspace(), SP_GRADIENT_STATE_VECTOR, SP_GRADIENT_TYPE_LINEAR, SP_GRADIENT_TYPE_RADIAL, sp_style_set_property_url(), SPGradient::state, SPStyle::stroke, and SPObject::style.
Referenced by Inkscape::UI::Tools::GradientTool::drag(), and Inkscape::UI::Widget::FillNStroke::updateFromPaint().
SPStop * sp_last_stop | ( | SPGradient * | gradient | ) |
Definition at line 622 of file gradient-chemistry.cpp.
References SPGradient::getFirstStop().
Referenced by GrDrag::deleteSelected(), Inkscape::UI::Tools::get_stop_intervals(), gr_knot_clicked_handler(), Inkscape::UI::Toolbar::GradientToolbar::select_stop_by_draggers(), sp_item_gradient_get_stop(), sp_item_gradient_stop_query_style(), and sp_item_gradient_stop_set_style().
guint sp_number_of_stops_before_stop | ( | SPGradient * | gradient, |
SPStop * | target | ||
) |
Definition at line 660 of file gradient-chemistry.cpp.
References SPGradient::getFirstStop().
Referenced by Inkscape::UI::Widget::GradientEditor::add_stop(), and Inkscape::UI::Widget::GradientEditor::insert_stop_at().
void sp_repr_set_css_double | ( | Inkscape::XML::Node * | node, |
const char * | key, | ||
double | value | ||
) |
Definition at line 713 of file gradient-chemistry.cpp.
References key, node, and Inkscape::XML::Node::setAttributeCssDouble().
Referenced by sp_gradient_add_stop(), sp_set_gradient_stop_color(), and verify_grad().
void sp_set_gradient_stop_color | ( | SPDocument * | document, |
SPStop * | stop, | ||
Color const & | color | ||
) |
Definition at line 877 of file gradient-chemistry.cpp.
References SPObject::getRepr(), Inkscape::DocumentUndo::maybeDone(), SPStop::offset, SPStop::setColor(), and sp_repr_set_css_double().
Referenced by Inkscape::UI::Widget::GradientEditor::set_stop_color().
SPStop * sp_vector_add_stop | ( | SPGradient * | vector, |
SPStop * | prev_stop, | ||
SPStop * | next_stop, | ||
gfloat | offset | ||
) |
Definition at line 719 of file gradient-chemistry.cpp.
References Inkscape::XML::Node::addChild(), Inkscape::Colors::Color::averaged(), SPObject::document, Inkscape::XML::Node::document(), Inkscape::XML::Node::duplicate(), SPStop::getColor(), SPDocument::getObjectByRepr(), SPObject::getRepr(), SPStop::offset, offset, Inkscape::GC::release(), Inkscape::XML::Node::setAttributeCssDouble(), and SPStop::setColor().
Referenced by Inkscape::UI::Tools::GradientTool::add_stops_between_selected_stops(), GrDrag::addStopNearPoint(), and sp_gradient_add_stop_at().
|
static |
Definition at line 771 of file gradient-chemistry.cpp.
References Inkscape::XML::Node::addChild(), child, SPObject::children, Inkscape::XML::Document::createElement(), Inkscape::XML::Node::document(), Inkscape::XML::Node::duplicate(), SPObject::getRepr(), Inkscape::GC::release(), SPStop::setColorRepr(), and sp_repr_set_css_double().
Referenced by sp_gradient_add_stop(), and sp_gradient_add_stop_at().