Inkscape
Vector Graphics Editor
|
This is the root class of the gradient dragging machinery. More...
#include <gradient-drag.h>
Classes | |
struct | ItemCurve |
Public Member Functions | |
GrDrag (SPDesktop *desktop) | |
virtual | ~GrDrag () |
bool | isNonEmpty () |
bool | hasSelection () |
guint | numSelected () |
guint | numDraggers () |
guint | singleSelectedDraggerNumDraggables () |
guint | singleSelectedDraggerSingleDraggableType () |
void | setSelected (GrDragger *dragger, bool add_to_selection=false, bool override=true) |
Select a dragger. | |
void | setDeselected (GrDragger *dragger) |
Deselect a dragger. | |
void | deselectAll () |
Deselect all stops/draggers (public; emits signal). | |
void | selectAll () |
Select all stops/draggers. | |
void | selectByCoords (std::vector< Geom::Point > coords) |
Select all stops/draggers that match the coords. | |
void | selectByStop (SPStop *stop, bool add_to_selection=true, bool override=true) |
Select draggers by stop. | |
void | selectRect (Geom::Rect const &r) |
Select all stops/draggers that fall within the rect. | |
void | addColorToDragger (GrDragger &dragger, const char *color) |
void | dropColorOnCorrespondingRegion (const char *color, Geom::Point p) |
bool | dropColor (SPItem *item, gchar const *c, Geom::Point p) |
SPStop * | addStopNearPoint (SPItem *item, Geom::Point mouse_p, double tolerance) |
void | deleteSelected (bool just_one=false) |
Inkscape::Colors::Color | getColor () |
GrDragger * | getDraggerFor (GrDraggable *d) |
Select the dragger which has the given draggable. | |
GrDragger * | getDraggerFor (SPItem *item, GrPointType point_type, gint point_i, Inkscape::PaintTarget fill_or_stroke) |
Select the dragger which has the given draggable. | |
void | grabKnot (GrDragger *dragger, gint x, gint y, guint32 etime) |
Artificially grab the knot of this dragger; used by the gradient context. | |
void | grabKnot (SPItem *item, GrPointType point_type, gint point_i, Inkscape::PaintTarget fill_or_stroke, gint x, gint y, guint32 etime) |
Artificially grab the knot of the dragger with this draggable; used by the gradient context. | |
void | updateDraggers () |
Regenerates the draggers list from the current selection; is called when selection is changed or modified, also when a radial dragger needs to update positions of other draggers in the gradient. | |
void | refreshDraggers () |
Refresh draggers, moving and toggling visibility as necessary. | |
void | updateLines () |
Regenerates the lines list from the current selection; is called on each move of a dragger, so that lines are always in sync with the actual gradient. | |
void | updateLevels () |
Regenerates the levels list from the current selection. | |
bool | mouseOver () |
Returns true if at least one of the draggers' knots has the mouse hovering above it. | |
void | selected_move_nowrite (double x, double y, bool scale_radial) |
void | selected_move (double x, double y, bool write_repr=true, bool scale_radial=false) |
void | selected_move_screen (double x, double y) |
bool | key_press_handler (Inkscape::KeyPressEvent const &event) |
Handle arrow key events. | |
GrDragger * | select_next () |
Select the knot next to the last selected one and deselect all other selected. | |
GrDragger * | select_prev () |
Select the knot previous from the last selected one and deselect all other selected. | |
void | selected_reverse_vector () |
Public Attributes | |
std::set< GrDragger * > | selected |
bool | keep_selection |
bool | local_change |
SPDesktop * | desktop |
std::vector< double > | hor_levels |
std::vector< double > | vert_levels |
std::vector< GrDragger * > | draggers |
std::vector< ItemCurve > | item_curves |
Private Member Functions | |
void | deselect_all () |
Deselect all stops/draggers (private). | |
void | addLine (SPItem *item, Geom::Point p1, Geom::Point p2, Inkscape::PaintTarget fill_or_stroke) |
Create a line from p1 to p2 and add it to the curves list. | |
void | addCurve (SPItem *item, Geom::Point p0, Geom::Point p1, Geom::Point p2, Geom::Point p3, int corner0, int corner1, int handle0, int handle1, Inkscape::PaintTarget fill_or_stroke) |
Create a curve from p0 to p3 and add it to the curves list. | |
GrDragger * | addDragger (GrDraggable *draggable) |
If there already exists a dragger within MERGE_DIST of p, add the draggable to it; otherwise create new dragger and add it to draggers list. | |
void | addDraggersRadial (SPRadialGradient *rg, SPItem *item, Inkscape::PaintTarget fill_or_stroke) |
Add draggers for the radial gradient rg on item. | |
void | addDraggersLinear (SPLinearGradient *lg, SPItem *item, Inkscape::PaintTarget fill_or_stroke) |
Add draggers for the linear gradient lg on item. | |
void | addDraggersMesh (SPMeshGradient *mg, SPItem *item, Inkscape::PaintTarget fill_or_stroke) |
Add draggers for the mesh gradient mg on item. | |
void | refreshDraggersMesh (SPMeshGradient *mg, SPItem *item, Inkscape::PaintTarget fill_or_stroke) |
Refresh draggers, moving and toggling visibility as necessary. | |
bool | styleSet (const SPCSSAttr *css, bool switch_style) |
Glib::ustring | makeStopSafeColor (gchar const *str, bool &isNull) |
Private Attributes | |
Inkscape::Selection * | selection |
sigc::connection | sel_changed_connection |
sigc::connection | sel_modified_connection |
sigc::connection | style_set_connection |
sigc::connection | style_query_connection |
This is the root class of the gradient dragging machinery.
It holds lists of GrDraggers and of lines (simple canvas items). It also remembers one of the draggers as selected.
Definition at line 148 of file gradient-drag.h.
GrDrag::GrDrag | ( | SPDesktop * | desktop | ) |
Definition at line 665 of file gradient-drag.cpp.
References Inkscape::Selection::connectChangedFirst(), Inkscape::Selection::connectModifiedFirst(), SPDesktop::connectQueryStyle(), SPDesktop::connectSetStyle(), desktop, getDraggerFor(), gr_drag_sel_changed(), gr_drag_sel_modified(), gr_drag_style_query(), SPDesktop::gr_fill_or_stroke, SPDesktop::gr_item, SPDesktop::gr_point_i, SPDesktop::gr_point_type, sel_changed_connection, sel_modified_connection, selection, setSelected(), style_query_connection, style_set_connection, styleSet(), updateDraggers(), updateLevels(), and updateLines().
|
virtual |
Definition at line 710 of file gradient-drag.cpp.
References deselect_all(), desktop, draggers, GrDraggable::fill_or_stroke, Inkscape::FOR_FILL, SPDesktop::gr_fill_or_stroke, SPDesktop::gr_item, SPDesktop::gr_point_i, SPDesktop::gr_point_type, GrDraggable::item, item_curves, GrDraggable::point_i, POINT_LG_BEGIN, GrDraggable::point_type, sel_changed_connection, sel_modified_connection, selected, style_query_connection, and style_set_connection.
void GrDrag::addColorToDragger | ( | GrDragger & | dragger, |
const char * | color | ||
) |
Definition at line 544 of file gradient-drag.cpp.
References GrDragger::draggables, local_change, sp_item_gradient_stop_set_style(), sp_repr_css_attr_new(), sp_repr_css_attr_unref(), and sp_repr_css_set_property().
Referenced by dropColor(), and dropColorOnCorrespondingRegion().
|
private |
Create a curve from p0 to p3 and add it to the curves list.
Used for mesh sides.
Definition at line 2101 of file gradient-drag.cpp.
References Inkscape::CANVAS_ITEM_PRIMARY, Inkscape::CANVAS_ITEM_SECONDARY, desktop, SPKnot::flags, Inkscape::FOR_FILL, SPDesktop::getCanvasControls(), getDraggerFor(), item, item_curves, GrDragger::knot, POINT_MG_CORNER, POINT_MG_HANDLE, and SP_KNOT_MOUSEOVER.
Referenced by updateLines().
|
private |
If there already exists a dragger within MERGE_DIST of p, add the draggable to it; otherwise create new dragger and add it to draggers list.
Definition at line 2137 of file gradient-drag.cpp.
References draggers, GrDraggable::fill_or_stroke, getGradientCoords(), GrDraggable::item, Geom::L2(), GrDraggable::point_i, and GrDraggable::point_type.
Referenced by addDraggersLinear(), addDraggersMesh(), and addDraggersRadial().
|
private |
Add draggers for the linear gradient lg on item.
Definition at line 2182 of file gradient-drag.cpp.
References addDragger(), SPGradient::ensureVector(), item, num, POINT_LG_BEGIN, POINT_LG_END, POINT_LG_MID, SPGradientVector::stops, and SPGradient::vector.
Referenced by updateDraggers().
|
private |
Add draggers for the mesh gradient mg on item.
Definition at line 2198 of file gradient-drag.cpp.
References addDragger(), SPGradient::array, SPGradient::ensureArray(), Inkscape::FOR_FILL, Inkscape::FOR_STROKE, Inkscape::Preferences::get(), Inkscape::Preferences::getBool(), SPKnot::hide(), item, GrDragger::knot, MG_NODE_TYPE_CORNER, MG_NODE_TYPE_HANDLE, MG_NODE_TYPE_TENSOR, node, SPMeshNodeArray::nodes, SPMeshNodeArray::patch_columns(), SPMeshNodeArray::patch_rows(), POINT_MG_CORNER, POINT_MG_HANDLE, and POINT_MG_TENSOR.
Referenced by updateDraggers().
|
private |
Add draggers for the radial gradient rg on item.
Definition at line 2159 of file gradient-drag.cpp.
References addDragger(), SPGradient::ensureVector(), item, num, POINT_RG_CENTER, POINT_RG_FOCUS, POINT_RG_MID1, POINT_RG_MID2, POINT_RG_R1, POINT_RG_R2, SPGradientVector::stops, and SPGradient::vector.
Referenced by updateDraggers().
|
private |
Create a line from p1 to p2 and add it to the curves list.
Used for linear and radial gradients.
Definition at line 2083 of file gradient-drag.cpp.
References Inkscape::CANVAS_ITEM_PRIMARY, Inkscape::CANVAS_ITEM_SECONDARY, desktop, Inkscape::FOR_FILL, SPDesktop::getCanvasControls(), item, and item_curves.
Referenced by updateLines().
SPStop * GrDrag::addStopNearPoint | ( | SPItem * | item, |
Geom::Point | mouse_p, | ||
double | tolerance | ||
) |
Definition at line 318 of file gradient-drag.cpp.
References desktop, Geom::distance(), distance(), end, SPGradient::ensureVector(), SPDesktop::getDocument(), SPGradient::getFirstStop(), getGradient(), getGradientCoords(), SPStop::getNextStop(), SPMeshPatchI::getPoint(), SPGradient::getStopCount(), SPItem::i2dt_affine(), item, Geom::L2(), local_change, Geom::BezierCurveN< degree >::nearestTime(), SPStop::offset, offset, POINT_LG_BEGIN, POINT_LG_END, POINT_RG_CENTER, POINT_RG_R1, POINT_RG_R2, Geom::BezierCurve::pointAt(), selectByStop(), sp_gradient_add_stop_at(), sp_gradient_get_forked_vector_if_necessary(), sp_vector_add_stop(), and updateDraggers().
Referenced by Inkscape::UI::Tools::GradientTool::add_stop_near_point(), dropColor(), and Inkscape::UI::Tools::MeshTool::split_near_point().
void GrDrag::deleteSelected | ( | bool | just_one = false | ) |
Definition at line 2905 of file gradient-drag.cpp.
References child, css, GrDragger::draggables, end, Inkscape::XML::Node::firstChild(), Inkscape::FOR_FILL, SPGradient::getFirstStop(), getGradient(), SPStop::getNextStop(), SPObject::getRepr(), len, Inkscape::XML::Node::next(), SPStop::offset, offset, parent, Inkscape::XML::Node::parent(), POINT_LG_BEGIN, POINT_LG_END, POINT_LG_MID, POINT_RG_CENTER, POINT_RG_MID1, POINT_RG_MID2, POINT_RG_R1, POINT_RG_R2, Inkscape::XML::Node::removeChild(), selected, Inkscape::XML::Node::setAttributeCssDouble(), Inkscape::XML::Node::setAttributeSvgDouble(), sp_get_stop_i(), sp_gradient_get_forked_vector_if_necessary(), sp_last_stop(), sp_repr_css_attr(), sp_repr_css_attr_new(), sp_repr_css_attr_unref(), sp_repr_css_change(), sp_repr_css_property(), sp_repr_css_set_property(), sp_repr_css_unset_property(), Geom::X, and Geom::Y.
Referenced by Inkscape::UI::Toolbar::GradientToolbar::remove_stop().
|
private |
Deselect all stops/draggers (private).
Definition at line 1949 of file gradient-drag.cpp.
References selected.
Referenced by deselectAll(), setSelected(), and ~GrDrag().
void GrDrag::deselectAll | ( | ) |
Deselect all stops/draggers (public; emits signal).
Definition at line 1959 of file gradient-drag.cpp.
References deselect_all(), desktop, and SPDesktop::emit_gradient_stop_selected().
Referenced by Inkscape::UI::Tools::MeshTool::root_handler().
bool GrDrag::dropColor | ( | SPItem * | item, |
gchar const * | c, | ||
Geom::Point | p | ||
) |
Definition at line 602 of file gradient-drag.cpp.
References addColorToDragger(), addStopNearPoint(), c, css, SPDesktop::current_zoom(), SPDesktop::d2w(), desktop, Geom::distance(), GrDragger::draggables, draggers, dropColorOnCorrespondingRegion(), getGradient(), Geom::infinity(), item_curves, makeStopSafeColor(), selected, sp_repr_css_attr_new(), sp_repr_css_attr_unref(), sp_repr_css_change(), and sp_repr_css_set_property().
void GrDrag::dropColorOnCorrespondingRegion | ( | const char * | color, |
Geom::Point | p | ||
) |
Definition at line 557 of file gradient-drag.cpp.
References addColorToDragger(), Geom::distance(), and draggers.
Referenced by dropColor().
Inkscape::Colors::Color GrDrag::getColor | ( | ) |
Definition at line 301 of file gradient-drag.cpp.
References Inkscape::Colors::ColorSet::getAverage(), selected, Inkscape::Colors::ColorSet::set(), and sp_item_gradient_stop_query_style().
GrDragger * GrDrag::getDraggerFor | ( | GrDraggable * | d | ) |
Select the dragger which has the given draggable.
Definition at line 1741 of file gradient-drag.cpp.
References draggers.
Referenced by addCurve(), Inkscape::UI::Tools::get_stop_intervals(), GrDragger::getMgCorner(), gr_midpoint_limits(), grabKnot(), GrDrag(), GrDragger::highlightNode(), GrDragger::moveMeshHandles(), GrDragger::moveOtherToDraggable(), refreshDraggersMesh(), and Inkscape::UI::Tools::MeshTool::root_handler().
GrDragger * GrDrag::getDraggerFor | ( | SPItem * | item, |
GrPointType | point_type, | ||
gint | point_i, | ||
Inkscape::PaintTarget | fill_or_stroke | ||
) |
Select the dragger which has the given draggable.
Definition at line 1755 of file gradient-drag.cpp.
References draggers, GrDraggable::fill_or_stroke, item, GrDraggable::item, GrDraggable::point_i, and GrDraggable::point_type.
Artificially grab the knot of this dragger; used by the gradient context.
Not used at the moment.
Definition at line 2357 of file gradient-drag.cpp.
References GrDragger::knot, GrDragger::point, and SPKnot::startDragging().
void GrDrag::grabKnot | ( | SPItem * | item, |
GrPointType | point_type, | ||
gint | point_i, | ||
Inkscape::PaintTarget | fill_or_stroke, | ||
gint | x, | ||
gint | y, | ||
guint32 | etime | ||
) |
Artificially grab the knot of the dragger with this draggable; used by the gradient context.
This allows setting the final point from the end of the drag when creating a new gradient.
Definition at line 2368 of file gradient-drag.cpp.
References getDraggerFor(), item, GrDragger::knot, GrDragger::point, and SPKnot::startDragging().
|
inline |
Definition at line 155 of file gradient-drag.h.
References selected.
Referenced by Inkscape::UI::Tools::GradientTool::add_stops_between_selected_stops().
|
inline |
Definition at line 154 of file gradient-drag.h.
References draggers.
Referenced by Inkscape::UI::Tools::GradientTool::selection_changed(), and Inkscape::UI::Tools::MeshTool::selection_changed().
bool GrDrag::key_press_handler | ( | Inkscape::KeyPressEvent const & | event | ) |
Handle arrow key events.
event | Event with type GDK_KEY_PRESS |
Definition at line 2809 of file gradient-drag.cpp.
References desktop, Inkscape::Preferences::get(), Inkscape::UI::Tools::get_latin_keyval(), Inkscape::UI::Tools::gobble_key_events(), selected_move(), selected_move_screen(), and SPDesktop::yaxisdir().
|
private |
Definition at line 175 of file gradient-drag.cpp.
References desktop, SPDesktop::doc(), SPStop::getColor(), SPGradient::getFirstStop(), SPDocument::getResourceList(), SPGradient::getVector(), and Inkscape::Colors::Color::toString().
Referenced by dropColor(), and styleSet().
bool GrDrag::mouseOver | ( | ) |
Returns true if at least one of the draggers' knots has the mouse hovering above it.
Definition at line 2466 of file gradient-drag.cpp.
References draggers, SP_KNOT_MOUSEOVER, and updateLines().
|
inline |
Definition at line 157 of file gradient-drag.h.
References draggers.
Referenced by Inkscape::UI::Tools::GradientTool::selection_changed(), and Inkscape::UI::Tools::MeshTool::selection_changed().
|
inline |
Definition at line 156 of file gradient-drag.h.
References selected.
Referenced by Inkscape::UI::Tools::GradientTool::add_stops_between_selected_stops(), Inkscape::UI::Tools::GradientTool::selection_changed(), and Inkscape::UI::Tools::MeshTool::selection_changed().
void GrDrag::refreshDraggers | ( | ) |
Refresh draggers, moving and toggling visibility as necessary.
Does not regenerate draggers (as does updateDraggers()). Only applies to mesh gradients.
Definition at line 2433 of file gradient-drag.cpp.
References SPStyle::fill, Inkscape::FOR_FILL, Inkscape::FOR_STROKE, SPStyle::getFillPaintServer(), SPStyle::getStrokePaintServer(), item, Inkscape::ObjectSet::items(), refreshDraggersMesh(), selection, SPStyle::stroke, and SPObject::style.
Referenced by gr_drag_sel_modified().
|
private |
Refresh draggers, moving and toggling visibility as necessary.
Does not regenerate draggers (as does updateDraggersMesh()).
Definition at line 2278 of file gradient-drag.cpp.
References SPGradient::array, SPGradient::ensureArray(), Inkscape::Preferences::get(), Inkscape::Preferences::getBool(), getDraggerFor(), getGradientCoords(), SPKnot::hide(), item, GrDragger::knot, MG_NODE_TYPE_CORNER, MG_NODE_TYPE_HANDLE, MG_NODE_TYPE_TENSOR, SPKnot::moveto(), node, SPMeshNodeArray::nodes, SPMeshNodeArray::patch_columns(), SPMeshNodeArray::patch_rows(), POINT_MG_HANDLE, POINT_MG_TENSOR, and SPKnot::show().
Referenced by refreshDraggers().
GrDragger * GrDrag::select_next | ( | ) |
Select the knot next to the last selected one and deselect all other selected.
Definition at line 2872 of file gradient-drag.cpp.
References draggers, selected, and setSelected().
Referenced by Inkscape::UI::Tools::GradientTool::select_next(), and Inkscape::UI::Tools::MeshTool::select_next().
GrDragger * GrDrag::select_prev | ( | ) |
Select the knot previous from the last selected one and deselect all other selected.
Definition at line 2889 of file gradient-drag.cpp.
References draggers, selected, and setSelected().
Referenced by Inkscape::UI::Tools::GradientTool::select_prev(), and Inkscape::UI::Tools::MeshTool::select_prev().
void GrDrag::selectAll | ( | ) |
Select all stops/draggers.
Definition at line 1968 of file gradient-drag.cpp.
References draggers, and setSelected().
void GrDrag::selectByCoords | ( | std::vector< Geom::Point > | coords | ) |
Select all stops/draggers that match the coords.
Definition at line 1978 of file gradient-drag.cpp.
References draggers, Geom::L2(), and setSelected().
void GrDrag::selectByStop | ( | SPStop * | stop, |
bool | add_to_selection = true , |
||
bool | override = true |
||
) |
Select draggers by stop.
Definition at line 1992 of file gradient-drag.cpp.
References draggers, GrDraggable::fill_or_stroke, getGradient(), SPGradient::getVector(), GrDraggable::item, GrDraggable::point_i, setSelected(), and sp_get_stop_i().
Referenced by Inkscape::UI::Tools::GradientTool::add_stop_near_point(), Inkscape::UI::Tools::GradientTool::add_stops_between_selected_stops(), addStopNearPoint(), Inkscape::UI::Tools::GradientTool::GradientTool(), and Inkscape::UI::Toolbar::GradientToolbar::select_dragger_by_stop().
void GrDrag::selected_move | ( | double | x, |
double | y, | ||
bool | write_repr = true , |
||
bool | scale_radial = false |
||
) |
Definition at line 2706 of file gradient-drag.cpp.
References SPDesktop::current_rotation(), delta, desktop, GrDragger::draggables, end, Inkscape::Preferences::get(), SPDesktop::getDocument(), GrDraggable::getServer(), gr_midpoint_limits(), Geom::Rotate::inverse(), MG_NODE_NO_SCALE, SPKnot::moveto(), Geom::BezierCurveN< degree >::nearestTime(), GrDragger::point, POINT_LG_MID, POINT_RG_CENTER, POINT_RG_FOCUS, POINT_RG_MID1, POINT_RG_MID2, POINT_RG_R1, POINT_RG_R2, Geom::BezierCurve::pointAt(), and selected.
Referenced by key_press_handler(), selected_move_nowrite(), and selected_move_screen().
void GrDrag::selected_move_nowrite | ( | double | x, |
double | y, | ||
bool | scale_radial | ||
) |
Definition at line 2701 of file gradient-drag.cpp.
References selected_move().
Referenced by gr_knot_moved_handler().
void GrDrag::selected_move_screen | ( | double | x, |
double | y | ||
) |
Definition at line 2795 of file gradient-drag.cpp.
References SPDesktop::current_zoom(), desktop, and selected_move().
Referenced by key_press_handler().
void GrDrag::selected_reverse_vector | ( | ) |
Definition at line 2691 of file gradient-drag.cpp.
References selected, and sp_item_gradient_reverse_vector().
Referenced by sp_gradient_reverse_selected_gradients().
void GrDrag::selectRect | ( | Geom::Rect const & | r | ) |
Select all stops/draggers that fall within the rect.
Definition at line 2012 of file gradient-drag.cpp.
References Geom::GenericRect< C >::contains(), draggers, and setSelected().
void GrDrag::setDeselected | ( | GrDragger * | dragger | ) |
Deselect a dragger.
dragger | The dragger to deselect. |
Definition at line 2071 of file gradient-drag.cpp.
References GrDragger::deselect(), desktop, SPDesktop::emit_gradient_stop_selected(), and selected.
void GrDrag::setSelected | ( | GrDragger * | dragger, |
bool | add_to_selection = false , |
||
bool | override = true |
||
) |
Select a dragger.
dragger | The dragger to select. |
add_to_selection | If true, add to selection, otherwise deselect others. |
override | If true, always select this node, otherwise toggle selected status. |
Definition at line 2027 of file gradient-drag.cpp.
References GrDragger::deselect(), deselect_all(), desktop, SPDesktop::emit_gradient_stop_selected(), GrDragger::isA(), POINT_MG_HANDLE, POINT_MG_TENSOR, GrDragger::select(), and selected.
Referenced by gr_knot_clicked_handler(), gr_knot_moved_handler(), gr_knot_ungrabbed_handler(), GrDrag(), Inkscape::UI::Tools::MeshTool::root_handler(), select_next(), select_prev(), selectAll(), selectByCoords(), selectByStop(), and selectRect().
|
inline |
Definition at line 159 of file gradient-drag.h.
References selected.
Referenced by Inkscape::UI::Tools::GradientTool::selection_changed(), and Inkscape::UI::Tools::MeshTool::selection_changed().
|
inline |
Definition at line 163 of file gradient-drag.h.
References selected.
Referenced by Inkscape::UI::Tools::GradientTool::selection_changed(), and Inkscape::UI::Tools::MeshTool::selection_changed().
|
private |
Definition at line 207 of file gradient-drag.cpp.
References Inkscape::XML::Node::attribute(), Inkscape::XML::Node::attributeList(), css, getGradient(), local_change, makeStopSafeColor(), selected, sp_item_gradient_stop_set_style(), sp_repr_css_attr_new(), sp_repr_css_attr_unref(), sp_repr_css_property(), sp_repr_css_property_is_unset(), sp_repr_css_set_property(), sp_svg_read_percentage(), and Inkscape::CSSOStringStream::str().
Referenced by GrDrag().
void GrDrag::updateDraggers | ( | ) |
Regenerates the draggers list from the current selection; is called when selection is changed or modified, also when a radial dragger needs to update positions of other draggers in the gradient.
Definition at line 2380 of file gradient-drag.cpp.
References addDraggersLinear(), addDraggersMesh(), addDraggersRadial(), draggers, SPStyle::fill, Inkscape::FOR_FILL, Inkscape::FOR_STROKE, SPStyle::getFillPaintServer(), SPStyle::getStrokePaintServer(), item, Inkscape::ObjectSet::items(), selected, selection, SPStyle::stroke, and SPObject::style.
Referenced by Inkscape::UI::Tools::GradientTool::add_stop_near_point(), Inkscape::UI::Tools::GradientTool::add_stops_between_selected_stops(), addStopNearPoint(), gr_drag_sel_changed(), gr_drag_sel_modified(), GrDrag(), and Inkscape::UI::Tools::MeshTool::split_near_point().
void GrDrag::updateLevels | ( | ) |
Regenerates the levels list from the current selection.
Levels correspond to bounding box edges and midpoints.
Definition at line 2668 of file gradient-drag.cpp.
References SPItem::desktopVisualBounds(), hor_levels, item, Inkscape::ObjectSet::items(), selection, vert_levels, Geom::X, and Geom::Y.
Referenced by gr_drag_sel_changed(), gr_drag_sel_modified(), and GrDrag().
void GrDrag::updateLines | ( | ) |
Regenerates the lines list from the current selection; is called on each move of a dragger, so that lines are always in sync with the actual gradient.
Definition at line 2488 of file gradient-drag.cpp.
References addCurve(), addLine(), SPStyle::fill, Inkscape::FOR_FILL, Inkscape::FOR_STROKE, Inkscape::Preferences::get(), Inkscape::Preferences::getBool(), SPStyle::getFillPaintServer(), getGradientCoords(), SPMeshPatchI::getPointsForSide(), SPStyle::getStrokePaintServer(), SPItem::i2dt_affine(), item, item_curves, Inkscape::ObjectSet::items(), POINT_LG_BEGIN, POINT_LG_END, POINT_RG_CENTER, POINT_RG_R1, POINT_RG_R2, selection, SPStyle::stroke, and SPObject::style.
Referenced by gr_drag_sel_changed(), gr_drag_sel_modified(), gr_knot_moved_handler(), GrDrag(), and mouseOver().
SPDesktop* GrDrag::desktop |
Definition at line 197 of file gradient-drag.h.
Referenced by addCurve(), addLine(), addStopNearPoint(), deselectAll(), dropColor(), gr_knot_moved_handler(), gr_knot_moved_midpoint_handler(), gr_knot_ungrabbed_handler(), GrDrag(), GrDragger::GrDragger(), key_press_handler(), makeStopSafeColor(), selected_move(), selected_move_screen(), setDeselected(), setSelected(), and ~GrDrag().
std::vector<GrDragger *> GrDrag::draggers |
Definition at line 203 of file gradient-drag.h.
Referenced by addDragger(), dropColor(), dropColorOnCorrespondingRegion(), getDraggerFor(), getDraggerFor(), gr_knot_mousedown_handler(), gr_knot_moved_handler(), isNonEmpty(), mouseOver(), numDraggers(), select_next(), select_prev(), selectAll(), selectByCoords(), selectByStop(), selectRect(), updateDraggers(), and ~GrDrag().
std::vector<double> GrDrag::hor_levels |
Definition at line 200 of file gradient-drag.h.
Referenced by updateLevels().
std::vector<ItemCurve> GrDrag::item_curves |
Definition at line 213 of file gradient-drag.h.
Referenced by addCurve(), addLine(), dropColor(), Inkscape::UI::Tools::GradientTool::is_over_curve(), Inkscape::UI::Tools::MeshTool::over_curve(), updateLines(), and ~GrDrag().
bool GrDrag::keep_selection |
Definition at line 187 of file gradient-drag.h.
Referenced by gr_knot_moved_handler(), gr_knot_moved_midpoint_handler(), and gr_knot_ungrabbed_handler().
bool GrDrag::local_change |
Definition at line 195 of file gradient-drag.h.
Referenced by Inkscape::UI::Tools::GradientTool::add_stop_near_point(), Inkscape::UI::Tools::GradientTool::add_stops_between_selected_stops(), addColorToDragger(), addStopNearPoint(), Inkscape::UI::Tools::MeshTool::corner_operation(), GrDragger::fireDraggables(), gr_drag_sel_modified(), and styleSet().
|
private |
Definition at line 252 of file gradient-drag.h.
|
private |
Definition at line 253 of file gradient-drag.h.
std::set<GrDragger *> GrDrag::selected |
Definition at line 168 of file gradient-drag.h.
Referenced by Inkscape::UI::Toolbar::GradientToolbar::_update(), Inkscape::UI::Tools::GradientTool::add_stops_between_selected_stops(), Inkscape::UI::Tools::MeshTool::corner_operation(), deleteSelected(), deselect_all(), dropColor(), Inkscape::UI::Tools::get_stop_intervals(), getColor(), gr_drag_style_query(), gr_knot_moved_handler(), gr_knot_ungrabbed_handler(), gr_midpoint_limits(), hasSelection(), GrDragger::isSelected(), GrDragger::moveMeshHandles(), numSelected(), select_next(), select_prev(), Inkscape::UI::Toolbar::GradientToolbar::select_stop_by_draggers(), selected_move(), selected_reverse_vector(), setDeselected(), setSelected(), singleSelectedDraggerNumDraggables(), singleSelectedDraggerSingleDraggableType(), sp_gradient_reverse_selected_gradients(), styleSet(), updateDraggers(), and ~GrDrag().
|
private |
Definition at line 251 of file gradient-drag.h.
Referenced by GrDrag(), refreshDraggers(), updateDraggers(), updateLevels(), and updateLines().
|
private |
Definition at line 256 of file gradient-drag.h.
|
private |
Definition at line 255 of file gradient-drag.h.
std::vector<double> GrDrag::vert_levels |
Definition at line 201 of file gradient-drag.h.
Referenced by updateLevels().