Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::UI::Tools Namespace Reference

Namespaces

namespace  MT
 

Classes

class  ArcTool
 
class  Box3dTool
 
class  CalligraphicTool
 
class  CCToolLayerNodeObserver
 
class  CCToolShapeNodeObserver
 
class  ConnectorTool
 
class  DelayedSnapEvent
 
class  DropperTool
 
class  DynamicBase
 
class  EraserTool
 
struct  EraseTarget
 Represents an item to erase. More...
 
class  FloodTool
 
class  FreehandBase
 
class  GradientTool
 
class  InteractiveBooleansTool
 
class  LpeTool
 
class  MarkerTool
 
class  MeasureTool
 
class  MeshTool
 
class  NodeTool
 
class  ObjectPickerTool
 
class  PagesTool
 
class  PencilTool
 PencilTool: a context for pencil tool events. More...
 
class  PenTool
 PenTool: a context for pen tool events. More...
 
class  RectTool
 
class  SelectTool
 
class  SpiralTool
 
class  SprayTool
 
class  StarTool
 
class  TextTool
 
class  ToolBase
 Base class for Event processors. More...
 
class  TweakTool
 
class  ZoomTool
 

Enumerations

enum  PickMode { PICK_VISIBLE , PICK_ACTUAL }
 
enum class  EraserToolMode { DELETE , CUT , CLIP }
 
enum class  ScanlineCheckResult { OK , ABORTED , BOUNDARY }
 The possible return states of perform_bitmap_scanline_check(). More...
 
enum  PaintBucketChannels {
  FLOOD_CHANNELS_RGB , FLOOD_CHANNELS_R , FLOOD_CHANNELS_G , FLOOD_CHANNELS_B ,
  FLOOD_CHANNELS_H , FLOOD_CHANNELS_S , FLOOD_CHANNELS_L , FLOOD_CHANNELS_ALPHA
}
 
enum  ShapeType {
  NONE , TRIANGLE_IN , TRIANGLE_OUT , ELLIPSE ,
  CLIPBOARD , BEND_CLIPBOARD , LAST_APPLIED
}
 
enum  PencilState { SP_PENCIL_CONTEXT_IDLE , SP_PENCIL_CONTEXT_ADDLINE , SP_PENCIL_CONTEXT_FREEHAND , SP_PENCIL_CONTEXT_SKETCH }
 
enum  {
  PICK_COLOR , PICK_OPACITY , PICK_R , PICK_G ,
  PICK_B , PICK_H , PICK_S , PICK_L
}
 
enum  {
  SPRAY_MODE_COPY , SPRAY_MODE_CLONE , SPRAY_MODE_SINGLE_PATH , SPRAY_MODE_ERASER ,
  SPRAY_OPTION
}
 
enum  {
  TWEAK_MODE_MOVE , TWEAK_MODE_MOVE_IN_OUT , TWEAK_MODE_MOVE_JITTER , TWEAK_MODE_SCALE ,
  TWEAK_MODE_ROTATE , TWEAK_MODE_MORELESS , TWEAK_MODE_PUSH , TWEAK_MODE_SHRINK_GROW ,
  TWEAK_MODE_ATTRACT_REPEL , TWEAK_MODE_ROUGHEN , TWEAK_MODE_COLORPAINT , TWEAK_MODE_COLORJITTER ,
  TWEAK_MODE_BLUR
}
 

Functions

static void ensure_persp_in_defs (SPDocument *document)
 
static Geom::Point unsnapped_polar (double angle)
 
static void add_cap (SPCurve &curve, Geom::Point const &from, Geom::Point const &to, double rounding)
 
static void cc_clear_active_knots (SPKnotList k)
 
static void cc_select_handle (SPKnot *knot)
 
static void cc_deselect_handle (SPKnot *knot)
 
static bool cc_item_is_shape (SPItem *item)
 
static bool cc_generic_knot_handler (CanvasEvent const &event, SPKnot *knot)
 
static bool endpt_handler (CanvasEvent const &event, ConnectorTool *cc)
 
void cc_create_connection_point (ConnectorTool *cc)
 
bool cc_item_is_connector (SPItem *item)
 
void cc_selection_set_avoid (SPDesktop *desktop, bool const set_avoid)
 
void cc_remove_connection_point (ConnectorTool *cc)
 
double square (double const x)
 
static uint32_t compose_onto (uint32_t px, uint32_t bg)
 
uint32_t get_pixel (unsigned char *px, int x, int y, int stride)
 Get the pointer to a pixel in a pixel buffer.
 
unsigned char * get_trace_pixel (unsigned char *trace_px, int x, int y, int width)
 
static bool compare_uint32 (uint32_t a, uint32_t b, uint32_t d)
 Check whether two unsigned integers are close to each other.
 
static bool compare_pixels (uint32_t check, uint32_t orig, uint32_t merged_orig_pixel, uint32_t dtc, int threshold, PaintBucketChannels method)
 Compare a pixel in a pixel buffer with another pixel to determine if a point should be included in the fill operation.
 
static bool is_pixel_checked (unsigned char *t)
 
static bool is_pixel_queued (unsigned char *t)
 
static bool is_pixel_paintability_checked (unsigned char *t)
 
static bool is_pixel_paintable (unsigned char *t)
 
static bool is_pixel_colored (unsigned char *t)
 
static void mark_pixel_checked (unsigned char *t)
 
static void mark_pixel_queued (unsigned char *t)
 
static void mark_pixel_paintable (unsigned char *t)
 
static void mark_pixel_not_paintable (unsigned char *t)
 
static void mark_pixel_colored (unsigned char *t)
 
static void clear_pixel_paintability (unsigned char *t)
 
static bool check_if_pixel_is_paintable (unsigned char *px, unsigned char *trace_t, int x, int y, uint32_t orig_color, BitmapCoordsInfo const &bci)
 Check if a pixel can be included in the fill.
 
static void do_trace (BitmapCoordsInfo const &bci, unsigned char *trace_px, SPDesktop *desktop, Geom::Affine const &transform, unsigned min_x, unsigned max_x, unsigned min_y, unsigned max_y, bool union_with_selection)
 Perform the bitmap-to-vector tracing and place the traced path onto the document.
 
static bool coords_in_range (unsigned x, unsigned y, BitmapCoordsInfo const &bci)
 Determine if the provided coordinates are within the pixel buffer limits.
 
static unsigned paint_pixel (unsigned char *px, unsigned char *trace_px, uint32_t orig_color, BitmapCoordsInfo const &bci, unsigned char *original_point_trace_t)
 Paint a pixel or a square (if autogap is enabled) on the trace pixel buffer.
 
static void push_point_onto_queue (std::deque< Geom::Point > &fill_queue, unsigned max_queue_size, unsigned char *trace_t, unsigned x, unsigned y)
 Push a point to be checked onto the bottom of the rendered pixel buffer check queue.
 
static void shift_point_onto_queue (std::deque< Geom::Point > &fill_queue, unsigned max_queue_size, unsigned char *trace_t, unsigned x, unsigned y)
 Shift a point to be checked onto the top of the rendered pixel buffer check queue.
 
static ScanlineCheckResult perform_bitmap_scanline_check (std::deque< Geom::Point > &fill_queue, unsigned char *px, unsigned char *trace_px, uint32_t orig_color, BitmapCoordsInfo bci, unsigned *min_x, unsigned *max_x)
 Scan a row in the rendered pixel buffer and add points to the fill queue as necessary.
 
static bool sort_fill_queue_vertical (Geom::Point const &a, Geom::Point const &b)
 Sort the rendered pixel buffer check queue vertically.
 
static bool sort_fill_queue_horizontal (Geom::Point const &a, Geom::Point const &b)
 Sort the rendered pixel buffer check queue horizontally.
 
static void sp_flood_do_flood_fill (SPDesktop *desktop, Geom::Point const &cursor_pos, bool union_with_selection, bool is_point_fill, bool is_touch_fill)
 Perform a flood fill operation.
 
static void spdc_flush_white (FreehandBase *dc, std::shared_ptr< SPCurve > gc)
 Flushes white curve(s) and additional curve into object.
 
static void spdc_free_colors (FreehandBase *dc)
 
static void spdc_paste_curve_as_freehand_shape (Geom::PathVector const &newpath, FreehandBase *dc, SPItem *item)
 
void spdc_apply_style (SPObject *obj)
 
static void spdc_apply_powerstroke_shape (std::vector< Geom::Point > const &points, FreehandBase *dc, SPItem *item)
 
static void spdc_apply_bend_shape (gchar const *svgd, FreehandBase *dc, SPItem *item)
 
static void spdc_apply_simplify (double threshold, FreehandBase *dc, SPItem *item)
 
static void spdc_check_for_and_apply_waiting_LPE (FreehandBase *dc, SPItem *item, SPCurve const *curve, bool is_bend)
 
void spdc_endpoint_snap_rotation (ToolBase *tool, Geom::Point &p, Geom::Point const &o, unsigned state)
 Snaps node or handle to PI/rotationsnapsperpi degree increments.
 
void spdc_endpoint_snap_free (ToolBase *tool, Geom::Point &p, std::optional< Geom::Point > &start_of_line)
 
void spdc_concat_colors_and_flush (FreehandBase *dc, bool forceclosed)
 Concats red, blue and green.
 
SPDrawAnchorspdc_test_inside (FreehandBase *dc, Geom::Point const &p)
 Returns FIRST active anchor (the activated one).
 
void spdc_create_single_dot (ToolBase *tool, Geom::Point const &pt, char const *path, unsigned event_state)
 Create a single dot represented by a circle.
 
void spdc_check_for_and_apply_waiting_LPE (FreehandBase *dc, SPItem *item)
 If we have an item and a waiting LPE, apply the effect to the item (spiro spline mode is treated separately).
 
static auto get_stop_intervals (GrDrag *drag)
 
int lpetool_mode_to_index (LivePathEffect::EffectType const type)
 
int lpetool_item_has_construction (SPItem *item)
 
bool lpetool_try_construction (SPDesktop *desktop, LivePathEffect::EffectType const type)
 
std::pair< Geom::Point, Geom::Pointlpetool_get_limiting_bbox_corners (SPDocument const *document)
 
static void set_pos_and_anchor (CanvasItemText *canvas_text, Geom::Piecewise< Geom::D2< Geom::SBasis > > const &pwd2, double t, double length)
 
static char const * endpoint_to_pref (bool is_start)
 
static void calculate_intersections (SPDesktop *desktop, SPItem *item, Geom::PathVector const &lineseg, SPCurve curve, std::vector< double > &intersections)
 
static bool has_mesh (SPItem *item)
 
Inkscape::CanvasItemGroupcreate_control_group (SPDesktop *desktop)
 
void sp_update_helperpath (SPDesktop *desktop)
 
static void gather_items (NodeTool *nt, SPItem *base, SPObject *obj, Inkscape::UI::ShapeRole role, std::set< Inkscape::UI::ShapeRecord > &s)
 Recursively collect ShapeRecords.
 
SPObjectget_item_at (SPDesktop *desktop, const Geom::Point &point)
 
static bool in_svg_plane (Geom::Point const &p)
 
static bool key_is_a_modifier (guint key)
 
static void sp_select_context_up_one_layer (SPDesktop *desktop)
 
double NormalDistribution (double mu, double sigma)
 This function returns pseudo-random numbers from a normal distribution.
 
static Geom::Affine transform_around_point (Geom::Point center, Geom::Affine const &affine)
 Transform the affine around the point.
 
static void transform_keep_center (SPItem *item, Geom::Affine const &affine, Geom::Point const &center)
 
static void get_paths (SPItem *item, Geom::PathVector &res, bool root=true)
 
static void sp_spray_extinput (SprayTool *tc, ExtendedInput const &ext)
 
static double get_width (SprayTool *tc)
 
static double get_dilate_radius (SprayTool *tc)
 
static double get_path_mean (SprayTool *tc)
 
static double get_path_standard_deviation (SprayTool *tc)
 
static double get_population (SprayTool *tc)
 
static double get_pressure (SprayTool *tc)
 
static double get_move_mean (SprayTool *tc)
 
static double get_move_standard_deviation (SprayTool *tc)
 
static void random_position (double &radius, double &angle, double &a, double &s, int)
 Method to handle the distribution of the items.
 
static void sp_spray_transform_path (SPItem *item, Geom::Path &path, Geom::Affine affine, Geom::Point center)
 
double randomize01 (double val, double rand)
 Randomizes val by rand, with 0 < val < 1 and all values (including 0, 1) having the same probability of being displaced.
 
static guint32 getPickerData (Geom::IntRect area, SPDesktop *desktop)
 
static void showHidden (std::vector< SPItem * > items_down)
 
static bool fit_item (SPDesktop *desktop, Inkscape::ObjectSet *set, SPItem *item, Geom::OptRect bbox, Geom::Point &move, Geom::Point center, gint mode, double angle, double &_scale, double scale, bool picker, bool pick_center, bool pick_inverse_value, bool pick_fill, bool pick_stroke, bool pick_no_overlap, bool over_no_transparent, bool over_transparent, bool no_overlap, double offset, SPCSSAttr *css, bool trace_scale, int pick, bool do_trace, bool single_click, bool pick_to_size, bool pick_to_presence, bool pick_to_color, bool pick_to_opacity, bool invert_picked, double gamma_picked, double rand_picked)
 
static bool sp_spray_recursive (SPDesktop *desktop, Inkscape::ObjectSet *set, SPItem *item, SPItem *&single_path_output, Geom::Point p, Geom::Point, gint mode, double radius, double population, double &scale, double scale_variation, bool, double mean, double standard_deviation, double ratio, double tilt, double rotation_variation, gint _distrib, bool no_overlap, bool picker, bool pick_center, bool pick_inverse_value, bool pick_fill, bool pick_stroke, bool pick_no_overlap, bool over_no_transparent, bool over_transparent, double offset, bool usepressurescale, double pressure, int pick, bool do_trace, bool single_click, double single_angle, double single_scale, bool pick_to_size, bool pick_to_presence, bool pick_to_color, bool pick_to_opacity, bool invert_picked, double gamma_picked, double rand_picked)
 
static bool sp_spray_dilate (SprayTool *tc, Geom::Point p, Geom::Point vector, bool reverse, bool force=false)
 
static void sp_spray_update_area (SprayTool *tc)
 
static void sp_spray_switch_mode (SprayTool *tc, gint mode, bool with_shift)
 
static void hex_to_printable_utf8_buf (char const *const ehex, char *utf8)
 
Glib::ustring get_selected_text (TextTool const &tool)
 Gets the raw characters that comprise the currently selected text, converting line breaks into lf characters.
 
SPCSSAttrget_style_at_cursor (TextTool const &tool)
 
Text::Layout::iterator const * get_cursor_position (TextTool const &tool, SPObject const *other_text)
 
static void set_event_location (SPDesktop *desktop, CanvasEvent const &event)
 Shows coordinates on status bar.
 
static void sp_toggle_selector (SPDesktop *dt)
 Toggles current tool between active tool and selector tool.
 
void sp_toggle_dropper (SPDesktop *dt)
 Toggles current tool between active tool and dropper tool.
 
static double accelerate_scroll (KeyEvent const &event, double acceleration)
 Calculates and keeps track of scroll acceleration.
 
void sp_event_context_read (ToolBase *tool, char const *key)
 Calls virtual set() function of ToolBase.
 
void sp_event_show_modifier_tip (MessageContext *message_context, KeyEvent const &event, char const *ctrl_tip, char const *shift_tip, char const *alt_tip)
 Show tool context specific modifier tip.
 
static void update_latin_keys_group ()
 Try to determine the keys group of Latin layout.
 
void init_latin_keys_group ()
 Initialize Latin keys group handling.
 
unsigned get_latin_keyval_impl (unsigned const event_keyval, unsigned const event_keycode, GdkModifierType const event_state, unsigned const event_group, unsigned *consumed_modifiers)
 
unsigned get_latin_keyval (GtkEventControllerKey const *const controller, unsigned const keyval, unsigned const keycode, GdkModifierType const state, unsigned *consumed_modifiers)
 Return the keyval corresponding to the event controller key in Latin group.
 
unsigned get_latin_keyval (Gtk::EventControllerKey const &controller, unsigned keyval, unsigned keycode, Gdk::ModifierType state, unsigned *consumed_modifiers)
 
unsigned get_latin_keyval (KeyEvent const &event, unsigned *consumed_modifiers)
 
SPItemsp_event_context_find_item (SPDesktop *desktop, Geom::Point const &p, bool select_under, bool into_groups)
 Returns item at point p in desktop.
 
SPItemsp_event_context_over_item (SPDesktop *desktop, SPItem *item, Geom::Point const &p)
 Returns item if it is under point p in desktop, at any depth; otherwise returns NULL.
 
ShapeEditorsp_event_context_get_shape_editor (ToolBase *tool)
 
int gobble_key_events (unsigned keyval, unsigned mask)
 
void gobble_motion_events (unsigned mask)
 
static bool is_transform_mode (gint mode)
 
static bool is_color_mode (gint mode)
 
static void sp_tweak_extinput (TweakTool *tc, ExtendedInput const &ext)
 
static double get_dilate_radius (TweakTool *tc)
 
static double get_path_force (TweakTool *tc)
 
static double get_move_force (TweakTool *tc)
 
static bool sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::Point p, Geom::Point vector, gint mode, double radius, double force, double fidelity, bool reverse)
 
static Color tweak_color (guint mode, Color const &color, Color const &goal, double force, bool do_h, bool do_s, bool do_l)
 
static void tweak_stop_color (guint mode, SPStop *stop, Color const &goal, double force, bool do_h, bool do_s, bool do_l)
 
static void tweak_opacity (guint mode, SPIScale24 *style_opacity, double opacity_goal, double force)
 
static double tweak_profile (double dist, double radius)
 
static void tweak_colors_in_gradient (SPItem *item, Inkscape::PaintTarget fill_or_stroke, Color const &goal, Geom::Point p_w, double radius, double force, guint mode, bool do_h, bool do_s, bool do_l, bool)
 
static bool sp_tweak_color_recursive (guint mode, SPItem *item, SPItem *item_at_point, std::optional< Color > &fill_goal, std::optional< Color > &stroke_goal, float opacity_goal, bool do_opacity, bool do_blur, bool reverse, Geom::Point p, double radius, double force, bool do_h, bool do_s, bool do_l, bool do_o)
 
static bool sp_tweak_dilate (TweakTool *tc, Geom::Point event_p, Geom::Point p, Geom::Point vector, bool reverse)
 
static void sp_tweak_update_area (TweakTool *tc)
 
static void sp_tweak_switch_mode (TweakTool *tc, gint mode, bool with_shift)
 
static void sp_tweak_switch_mode_temporarily (TweakTool *tc, gint mode, bool with_shift)
 

Variables

static constexpr auto DEFAULT_ERASER_MODE = EraserToolMode::CUT
 
static constexpr unsigned char PIXEL_CHECKED = 1
 
static constexpr unsigned char PIXEL_QUEUED = 2
 
static constexpr unsigned char PIXEL_PAINTABLE = 4
 
static constexpr unsigned char PIXEL_NOT_PAINTABLE = 8
 
static constexpr unsigned char PIXEL_COLORED = 16
 
static constexpr int PAINT_DIRECTION_LEFT = 1
 
static constexpr int PAINT_DIRECTION_RIGHT = 2
 
static constexpr int PAINT_DIRECTION_UP = 4
 
static constexpr int PAINT_DIRECTION_DOWN = 8
 
static constexpr int PAINT_DIRECTION_ALL = 15
 
static ShapeType previous_shape_type = NONE
 
static char const * gr_handle_descr []
 
static std::optional< Geom::Pointexplicit_base_tmp
 
const gchar * ms_handle_descr []
 
static const auto fontsize = 12
 
static Geom::Point pen_drag_origin_w (0, 0)
 
static bool pen_within_tolerance = false
 
static Geom::Point pencil_drag_origin_w (0, 0)
 
static bool pencil_within_tolerance = false
 
static gint rb_escaped = 0
 
static gint drag_escaped = 0
 
static bool is_cycling = false
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PICK_COLOR 
PICK_OPACITY 
PICK_R 
PICK_G 
PICK_B 
PICK_H 
PICK_S 
PICK_L 

Definition at line 67 of file spray-tool.cpp.

◆ anonymous enum

anonymous enum
Enumerator
SPRAY_MODE_COPY 
SPRAY_MODE_CLONE 
SPRAY_MODE_SINGLE_PATH 
SPRAY_MODE_ERASER 
SPRAY_OPTION 

Definition at line 39 of file spray-tool.h.

◆ anonymous enum

anonymous enum
Enumerator
TWEAK_MODE_MOVE 
TWEAK_MODE_MOVE_IN_OUT 
TWEAK_MODE_MOVE_JITTER 
TWEAK_MODE_SCALE 
TWEAK_MODE_ROTATE 
TWEAK_MODE_MORELESS 
TWEAK_MODE_PUSH 
TWEAK_MODE_SHRINK_GROW 
TWEAK_MODE_ATTRACT_REPEL 
TWEAK_MODE_ROUGHEN 
TWEAK_MODE_COLORPAINT 
TWEAK_MODE_COLORJITTER 
TWEAK_MODE_BLUR 

Definition at line 29 of file tweak-tool.h.

◆ EraserToolMode

Enumerator
DELETE 
CUT 
CLIP 

Definition at line 37 of file eraser-tool.h.

◆ PaintBucketChannels

Enumerator
FLOOD_CHANNELS_RGB 
FLOOD_CHANNELS_R 
FLOOD_CHANNELS_G 
FLOOD_CHANNELS_B 
FLOOD_CHANNELS_H 
FLOOD_CHANNELS_S 
FLOOD_CHANNELS_L 
FLOOD_CHANNELS_ALPHA 

Definition at line 48 of file flood-tool.h.

◆ PencilState

Enumerator
SP_PENCIL_CONTEXT_IDLE 
SP_PENCIL_CONTEXT_ADDLINE 
SP_PENCIL_CONTEXT_FREEHAND 
SP_PENCIL_CONTEXT_SKETCH 

Definition at line 38 of file pencil-tool.h.

◆ PickMode

Enumerator
PICK_VISIBLE 
PICK_ACTUAL 

Definition at line 47 of file dropper-tool.cpp.

◆ ScanlineCheckResult

The possible return states of perform_bitmap_scanline_check().

Enumerator
OK 
ABORTED 
BOUNDARY 

Definition at line 448 of file flood-tool.cpp.

◆ ShapeType

Enumerator
NONE 
TRIANGLE_IN 
TRIANGLE_OUT 
ELLIPSE 
CLIPBOARD 
BEND_CLIPBOARD 
LAST_APPLIED 

Definition at line 38 of file freehand-base.h.

Function Documentation

◆ accelerate_scroll()

static double Inkscape::UI::Tools::accelerate_scroll ( KeyEvent const &  event,
double  acceleration 
)
static

Calculates and keeps track of scroll acceleration.

Subroutine of sp_event_context_private_root_handler().

Definition at line 255 of file tool-base.cpp.

References Inkscape::KeyEvent::keyval, scroll_event_time, scroll_keyval, and scroll_multiply.

◆ add_cap()

static void Inkscape::UI::Tools::add_cap ( SPCurve curve,
Geom::Point const &  from,
Geom::Point const &  to,
double  rounding 
)
static

◆ calculate_intersections()

static void Inkscape::UI::Tools::calculate_intersections ( SPDesktop desktop,
SPItem item,
Geom::PathVector const &  lineseg,
SPCurve  curve,
std::vector< double > &  intersections 
)
static

◆ cc_clear_active_knots()

static void Inkscape::UI::Tools::cc_clear_active_knots ( SPKnotList  k)
static

◆ cc_create_connection_point()

◆ cc_deselect_handle()

static void Inkscape::UI::Tools::cc_deselect_handle ( SPKnot knot)
static

◆ cc_generic_knot_handler()

◆ cc_item_is_connector()

◆ cc_item_is_shape()

static bool Inkscape::UI::Tools::cc_item_is_shape ( SPItem item)
static

◆ cc_remove_connection_point()

void Inkscape::UI::Tools::cc_remove_connection_point ( ConnectorTool cc)

◆ cc_select_handle()

static void Inkscape::UI::Tools::cc_select_handle ( SPKnot knot)
static

◆ cc_selection_set_avoid()

◆ check_if_pixel_is_paintable()

static bool Inkscape::UI::Tools::check_if_pixel_is_paintable ( unsigned char *  px,
unsigned char *  trace_t,
int  x,
int  y,
uint32_t  orig_color,
BitmapCoordsInfo const &  bci 
)
inlinestatic

Check if a pixel can be included in the fill.

Parameters
pxThe rendered pixel buffer to check.
trace_tThe pixel in the trace pixel buffer to check or mark.
xThe X coordinate.
yThe y coordinate.
orig_colorThe original selected pixel to use as the fill target color.
bciThe bitmap_coords_info structure.

Definition at line 313 of file flood-tool.cpp.

References compare_pixels(), get_pixel(), is_pixel_paintability_checked(), is_pixel_paintable(), mark_pixel_not_paintable(), and mark_pixel_paintable().

Referenced by paint_pixel(), perform_bitmap_scanline_check(), and sp_flood_do_flood_fill().

◆ clear_pixel_paintability()

static void Inkscape::UI::Tools::clear_pixel_paintability ( unsigned char *  t)
inlinestatic

Definition at line 282 of file flood-tool.cpp.

References PIXEL_NOT_PAINTABLE, and PIXEL_PAINTABLE.

Referenced by sp_flood_do_flood_fill().

◆ compare_pixels()

static bool Inkscape::UI::Tools::compare_pixels ( uint32_t  check,
uint32_t  orig,
uint32_t  merged_orig_pixel,
uint32_t  dtc,
int  threshold,
PaintBucketChannels  method 
)
static

Compare a pixel in a pixel buffer with another pixel to determine if a point should be included in the fill operation.

Parameters
checkThe pixel in the pixel buffer to check.
origThe original selected pixel to use as the fill target color.
merged_orig_pixelThe original pixel merged with the background.
dtcThe desktop background color.
thresholdThe fill threshold.
methodThe fill method to use as defined in PaintBucketChannels.

Definition at line 194 of file flood-tool.cpp.

References compare_uint32(), FLOOD_CHANNELS_ALPHA, FLOOD_CHANNELS_B, FLOOD_CHANNELS_G, FLOOD_CHANNELS_H, FLOOD_CHANNELS_L, FLOOD_CHANNELS_R, FLOOD_CHANNELS_RGB, FLOOD_CHANNELS_S, orig, rc, rd, Inkscape::Colors::Color::set(), and unpremul_alpha().

Referenced by check_if_pixel_is_paintable().

◆ compare_uint32()

static bool Inkscape::UI::Tools::compare_uint32 ( uint32_t  a,
uint32_t  b,
uint32_t  d 
)
static

Check whether two unsigned integers are close to each other.

Parameters
[in]aThe 1st unsigned int
[in]bThe 2nd unsigned int
[in]dThe threshold for comparison
Returns
true if |a-b| <= d; false otherwise

Definition at line 180 of file flood-tool.cpp.

Referenced by compare_pixels().

◆ compose_onto()

static uint32_t Inkscape::UI::Tools::compose_onto ( uint32_t  px,
uint32_t  bg 
)
inlinestatic

Definition at line 140 of file flood-tool.cpp.

Referenced by sp_flood_do_flood_fill().

◆ coords_in_range()

static bool Inkscape::UI::Tools::coords_in_range ( unsigned  x,
unsigned  y,
BitmapCoordsInfo const &  bci 
)
inlinestatic

Determine if the provided coordinates are within the pixel buffer limits.

Parameters
xThe X coordinate.
yThe Y coordinate.
bciThe bitmap_coords_info structure.

Definition at line 461 of file flood-tool.cpp.

Referenced by paint_pixel().

◆ create_control_group()

Inkscape::CanvasItemGroup * Inkscape::UI::Tools::create_control_group ( SPDesktop desktop)

Definition at line 109 of file node-tool.cpp.

References desktop, and SPDesktop::getCanvasControls().

Referenced by Inkscape::UI::Tools::NodeTool::NodeTool().

◆ do_trace()

static void Inkscape::UI::Tools::do_trace ( BitmapCoordsInfo const &  bci,
unsigned char *  trace_px,
SPDesktop desktop,
Geom::Affine const &  transform,
unsigned  min_x,
unsigned  max_x,
unsigned  min_y,
unsigned  max_y,
bool  union_with_selection 
)
static

Perform the bitmap-to-vector tracing and place the traced path onto the document.

Parameters
pxThe trace pixel buffer to trace to SVG.
desktopThe desktop on which to place the final SVG path.
transformThe transform to apply to the final SVG path.
union_with_selectionIf true, merge the final SVG path with the current selection.

Definition at line 336 of file flood-tool.cpp.

References Inkscape::Selection::add(), SPObject::addChild(), Inkscape::XML::Node::attribute(), Inkscape::Trace::GrayMap::BLACK, Path::ConvertEvenLines(), Shape::ConvertToForme(), Shape::ConvertToShape(), Path::ConvertWithBackData(), Inkscape::XML::Document::createElement(), SPDesktop::current_zoom(), Inkscape::LayerManager::currentLayer(), desktop, SPDesktop::doc(), Path::Fill(), fill_nonZero, fill_positive, Inkscape::MessageStack::flash(), Inkscape::MessageStack::flashF(), Inkscape::Preferences::get(), get_trace_pixel(), SPDesktop::getDocument(), Inkscape::Preferences::getDouble(), SPDocument::getObjectByRepr(), SPDocument::getReprDoc(), SPDesktop::getSelection(), Geom::identity(), Geom::Affine::inverse(), is_pixel_colored(), Geom::Affine::isIdentity(), join_round, SPDesktop::layerManager(), Path::LoadPathVector(), Shape::MakeOffset(), SPDesktop::messageStack(), offset, Inkscape::ObjectSet::pathUnion(), Inkscape::GC::release(), result, Inkscape::Selection::set(), Inkscape::XML::Node::setAttribute(), Inkscape::XML::Node::setAttributeOrRemoveIfEmpty(), Inkscape::XML::Node::setPosition(), Path::Simplify(), sp_desktop_apply_style_tool(), sp_svg_transform_read(), sp_svg_transform_write(), Path::svg_dump_path(), Inkscape::Trace::Potrace::PotraceTracingEngine::traceGrayMap(), Inkscape::WARNING_MESSAGE, and Inkscape::Trace::GrayMap::WHITE.

Referenced by fit_item(), sp_flood_do_flood_fill(), and sp_spray_recursive().

◆ endpoint_to_pref()

static char const * Inkscape::UI::Tools::endpoint_to_pref ( bool  is_start)
static

◆ endpt_handler()

◆ ensure_persp_in_defs()

static void Inkscape::UI::Tools::ensure_persp_in_defs ( SPDocument document)
static

◆ fit_item()

static bool Inkscape::UI::Tools::fit_item ( SPDesktop desktop,
Inkscape::ObjectSet set,
SPItem item,
Geom::OptRect  bbox,
Geom::Point move,
Geom::Point  center,
gint  mode,
double  angle,
double &  _scale,
double  scale,
bool  picker,
bool  pick_center,
bool  pick_inverse_value,
bool  pick_fill,
bool  pick_stroke,
bool  pick_no_overlap,
bool  over_no_transparent,
bool  over_transparent,
bool  no_overlap,
double  offset,
SPCSSAttr css,
bool  trace_scale,
int  pick,
bool  do_trace,
bool  single_click,
bool  pick_to_size,
bool  pick_to_presence,
bool  pick_to_color,
bool  pick_to_opacity,
bool  invert_picked,
double  gamma_picked,
double  rand_picked 
)
static

◆ gather_items()

◆ get_cursor_position()

Text::Layout::iterator const * Inkscape::UI::Tools::get_cursor_position ( TextTool const &  tool,
SPObject const *  other_text 
)

◆ get_dilate_radius() [1/2]

◆ get_dilate_radius() [2/2]

static double Inkscape::UI::Tools::get_dilate_radius ( TweakTool tc)
static

◆ get_item_at()

SPObject * Inkscape::UI::Tools::get_item_at ( SPDesktop desktop,
const Geom::Point point 
)

◆ get_latin_keyval() [1/3]

unsigned Inkscape::UI::Tools::get_latin_keyval ( Gtk::EventControllerKey const &  controller,
unsigned  keyval,
unsigned  keycode,
Gdk::ModifierType  state,
unsigned *  consumed_modifiers 
)

Definition at line 1372 of file tool-base.cpp.

References get_latin_keyval(), and get_latin_keyval_impl().

◆ get_latin_keyval() [2/3]

unsigned Inkscape::UI::Tools::get_latin_keyval ( GtkEventControllerKey const *const  controller,
unsigned const  keyval,
unsigned const  keycode,
GdkModifierType const  state,
unsigned *  consumed_modifiers 
)

Return the keyval corresponding to the event controller key in Latin group.

Use this instead of simply a signal's keyval, so that your keyboard shortcuts work regardless of layouts (e.g., in Cyrillic).

Definition at line 1364 of file tool-base.cpp.

References get_latin_keyval(), and get_latin_keyval_impl().

Referenced by Inkscape::UI::Tools::PenTool::_handleKeyPress(), Inkscape::UI::Tools::PencilTool::_handleKeyPress(), Inkscape::UI::Tools::EraserTool::_handleKeypress(), Inkscape::UI::Tools::PencilTool::_handleKeyRelease(), SPDesktop::drawing_handler(), Inkscape::UI::Tools::InteractiveBooleansTool::event_key_press_handler(), SPKnot::eventHandler(), get_latin_keyval(), get_latin_keyval(), get_latin_keyval(), GrDrag::key_press_handler(), Inkscape::UI::Dialog::DialogBase::on_key_pressed(), Inkscape::UI::Dialog::LayerPropertiesDialog::on_key_pressed(), Inkscape::UI::Widget::FontCollectionSelector::on_key_pressed(), Inkscape::UI::Widget::SpinButton::on_key_pressed(), Inkscape::UI::Tools::ArcTool::root_handler(), Inkscape::UI::Tools::Box3dTool::root_handler(), Inkscape::UI::Tools::ConnectorTool::root_handler(), Inkscape::UI::Tools::DropperTool::root_handler(), Inkscape::UI::Tools::FreehandBase::root_handler(), Inkscape::UI::Tools::NodeTool::root_handler(), Inkscape::UI::Tools::RectTool::root_handler(), Inkscape::UI::Tools::SpiralTool::root_handler(), Inkscape::UI::Tools::SprayTool::root_handler(), Inkscape::UI::Tools::StarTool::root_handler(), Inkscape::UI::Tools::TextTool::root_handler(), Inkscape::UI::Tools::TweakTool::root_handler(), Inkscape::UI::Tools::ZoomTool::root_handler(), sp_event_show_modifier_tip(), and sp_sel_trans_handle_event().

◆ get_latin_keyval() [3/3]

unsigned Inkscape::UI::Tools::get_latin_keyval ( KeyEvent const &  event,
unsigned *  consumed_modifiers 
)

◆ get_latin_keyval_impl()

unsigned Inkscape::UI::Tools::get_latin_keyval_impl ( unsigned const  event_keyval,
unsigned const  event_keycode,
GdkModifierType const  event_state,
unsigned const  event_group,
unsigned *  consumed_modifiers 
)

◆ get_move_force()

static double Inkscape::UI::Tools::get_move_force ( TweakTool tc)
static

◆ get_move_mean()

static double Inkscape::UI::Tools::get_move_mean ( SprayTool tc)
static

Definition at line 329 of file spray-tool.cpp.

References Inkscape::UI::Tools::SprayTool::mean.

Referenced by sp_spray_dilate().

◆ get_move_standard_deviation()

static double Inkscape::UI::Tools::get_move_standard_deviation ( SprayTool tc)
static

Definition at line 334 of file spray-tool.cpp.

References Inkscape::UI::Tools::SprayTool::standard_deviation.

Referenced by sp_spray_dilate().

◆ get_path_force()

◆ get_path_mean()

static double Inkscape::UI::Tools::get_path_mean ( SprayTool tc)
static

Definition at line 307 of file spray-tool.cpp.

References Inkscape::UI::Tools::SprayTool::mean.

Referenced by sp_spray_dilate().

◆ get_path_standard_deviation()

static double Inkscape::UI::Tools::get_path_standard_deviation ( SprayTool tc)
static

Definition at line 312 of file spray-tool.cpp.

References Inkscape::UI::Tools::SprayTool::standard_deviation.

Referenced by sp_spray_dilate().

◆ get_paths()

◆ get_pixel()

uint32_t Inkscape::UI::Tools::get_pixel ( unsigned char *  px,
int  x,
int  y,
int  stride 
)
inline

Get the pointer to a pixel in a pixel buffer.

Parameters
pxThe pixel buffer.
xThe X coordinate.
yThe Y coordinate.
strideThe rowstride of the pixel buffer.

Definition at line 161 of file flood-tool.cpp.

References stride.

Referenced by check_if_pixel_is_paintable(), and sp_flood_do_flood_fill().

◆ get_population()

static double Inkscape::UI::Tools::get_population ( SprayTool tc)
static

◆ get_pressure()

static double Inkscape::UI::Tools::get_pressure ( SprayTool tc)
static

Definition at line 323 of file spray-tool.cpp.

References Inkscape::UI::Tools::SprayTool::pressure.

Referenced by sp_spray_dilate().

◆ get_selected_text()

Glib::ustring Inkscape::UI::Tools::get_selected_text ( TextTool const &  tool)

Gets the raw characters that comprise the currently selected text, converting line breaks into lf characters.

Definition at line 1299 of file text-tool.cpp.

References sp_te_get_string_multiline(), Inkscape::UI::Tools::TextTool::text_sel_end, Inkscape::UI::Tools::TextTool::text_sel_start, and Inkscape::UI::Tools::TextTool::textItem().

◆ get_stop_intervals()

◆ get_style_at_cursor()

SPCSSAttr * Inkscape::UI::Tools::get_style_at_cursor ( TextTool const &  tool)

◆ get_trace_pixel()

unsigned char * Inkscape::UI::Tools::get_trace_pixel ( unsigned char *  trace_px,
int  x,
int  y,
int  width 
)
inline

Definition at line 166 of file flood-tool.cpp.

References width.

Referenced by do_trace(), paint_pixel(), perform_bitmap_scanline_check(), and sp_flood_do_flood_fill().

◆ get_width()

static double Inkscape::UI::Tools::get_width ( SprayTool tc)
static

◆ getPickerData()

static guint32 Inkscape::UI::Tools::getPickerData ( Geom::IntRect  area,
SPDesktop desktop 
)
static

◆ gobble_key_events()

int Inkscape::UI::Tools::gobble_key_events ( unsigned  keyval,
unsigned  mask 
)
inline

◆ gobble_motion_events()

◆ has_mesh()

static bool Inkscape::UI::Tools::has_mesh ( SPItem item)
static

◆ hex_to_printable_utf8_buf()

static void Inkscape::UI::Tools::hex_to_printable_utf8_buf ( char const *const  ehex,
char *  utf8 
)
static

Definition at line 330 of file text-tool.cpp.

References len.

Referenced by Inkscape::UI::Tools::TextTool::_showCurrUnichar().

◆ in_svg_plane()

◆ init_latin_keys_group()

void Inkscape::UI::Tools::init_latin_keys_group ( )

Initialize Latin keys group handling.

Definition at line 1315 of file tool-base.cpp.

References init_latin_keys_group(), and update_latin_keys_group().

Referenced by Inkscape::Application::Application(), and init_latin_keys_group().

◆ is_color_mode()

static bool Inkscape::UI::Tools::is_color_mode ( gint  mode)
static

◆ is_pixel_checked()

static bool Inkscape::UI::Tools::is_pixel_checked ( unsigned char *  t)
inlinestatic

Definition at line 268 of file flood-tool.cpp.

References PIXEL_CHECKED.

Referenced by sp_flood_do_flood_fill().

◆ is_pixel_colored()

static bool Inkscape::UI::Tools::is_pixel_colored ( unsigned char *  t)
inlinestatic

Definition at line 274 of file flood-tool.cpp.

References PIXEL_COLORED.

Referenced by do_trace(), paint_pixel(), and sp_flood_do_flood_fill().

◆ is_pixel_paintability_checked()

static bool Inkscape::UI::Tools::is_pixel_paintability_checked ( unsigned char *  t)
inlinestatic

Definition at line 270 of file flood-tool.cpp.

References PIXEL_NOT_PAINTABLE, and PIXEL_PAINTABLE.

Referenced by check_if_pixel_is_paintable().

◆ is_pixel_paintable()

static bool Inkscape::UI::Tools::is_pixel_paintable ( unsigned char *  t)
inlinestatic

Definition at line 273 of file flood-tool.cpp.

References PIXEL_PAINTABLE.

Referenced by check_if_pixel_is_paintable().

◆ is_pixel_queued()

static bool Inkscape::UI::Tools::is_pixel_queued ( unsigned char *  t)
inlinestatic

◆ is_transform_mode()

static bool Inkscape::UI::Tools::is_transform_mode ( gint  mode)
static

◆ key_is_a_modifier()

static bool Inkscape::UI::Tools::key_is_a_modifier ( guint  key)
static

Definition at line 165 of file select-tool.cpp.

References key.

◆ lpetool_get_limiting_bbox_corners()

◆ lpetool_item_has_construction()

int Inkscape::UI::Tools::lpetool_item_has_construction ( SPItem item)

◆ lpetool_mode_to_index()

int Inkscape::UI::Tools::lpetool_mode_to_index ( LivePathEffect::EffectType const  type)

◆ lpetool_try_construction()

◆ mark_pixel_checked()

static void Inkscape::UI::Tools::mark_pixel_checked ( unsigned char *  t)
inlinestatic

Definition at line 276 of file flood-tool.cpp.

References PIXEL_CHECKED.

Referenced by perform_bitmap_scanline_check(), and sp_flood_do_flood_fill().

◆ mark_pixel_colored()

static void Inkscape::UI::Tools::mark_pixel_colored ( unsigned char *  t)
inlinestatic

Definition at line 280 of file flood-tool.cpp.

References PIXEL_COLORED.

Referenced by paint_pixel().

◆ mark_pixel_not_paintable()

static void Inkscape::UI::Tools::mark_pixel_not_paintable ( unsigned char *  t)
inlinestatic

Definition at line 279 of file flood-tool.cpp.

References PIXEL_NOT_PAINTABLE, and PIXEL_PAINTABLE.

Referenced by check_if_pixel_is_paintable().

◆ mark_pixel_paintable()

static void Inkscape::UI::Tools::mark_pixel_paintable ( unsigned char *  t)
inlinestatic

Definition at line 278 of file flood-tool.cpp.

References PIXEL_NOT_PAINTABLE, and PIXEL_PAINTABLE.

Referenced by check_if_pixel_is_paintable().

◆ mark_pixel_queued()

static void Inkscape::UI::Tools::mark_pixel_queued ( unsigned char *  t)
inlinestatic

Definition at line 277 of file flood-tool.cpp.

References PIXEL_QUEUED.

Referenced by push_point_onto_queue(), and shift_point_onto_queue().

◆ NormalDistribution()

double Inkscape::UI::Tools::NormalDistribution ( double  mu,
double  sigma 
)
inline

This function returns pseudo-random numbers from a normal distribution.

Parameters
mu: mean
sigma: standard deviation ( > 0 )

Definition at line 83 of file spray-tool.cpp.

References log().

Referenced by random_position().

◆ paint_pixel()

static unsigned Inkscape::UI::Tools::paint_pixel ( unsigned char *  px,
unsigned char *  trace_px,
uint32_t  orig_color,
BitmapCoordsInfo const &  bci,
unsigned char *  original_point_trace_t 
)
inlinestatic

Paint a pixel or a square (if autogap is enabled) on the trace pixel buffer.

Parameters
pxThe rendered pixel buffer to check.
trace_pxThe trace pixel buffer.
orig_colorThe original selected pixel to use as the fill target color.
bciThe bitmap_coords_info structure.
original_point_trace_tThe original pixel in the trace pixel buffer to check.

Definition at line 480 of file flood-tool.cpp.

References check_if_pixel_is_paintable(), coords_in_range(), get_trace_pixel(), is_pixel_colored(), mark_pixel_colored(), PAINT_DIRECTION_ALL, PAINT_DIRECTION_DOWN, PAINT_DIRECTION_LEFT, PAINT_DIRECTION_RIGHT, and PAINT_DIRECTION_UP.

Referenced by perform_bitmap_scanline_check().

◆ perform_bitmap_scanline_check()

static ScanlineCheckResult Inkscape::UI::Tools::perform_bitmap_scanline_check ( std::deque< Geom::Point > &  fill_queue,
unsigned char *  px,
unsigned char *  trace_px,
uint32_t  orig_color,
BitmapCoordsInfo  bci,
unsigned *  min_x,
unsigned *  max_x 
)
static

Scan a row in the rendered pixel buffer and add points to the fill queue as necessary.

Parameters
fill_queueThe fill queue to add the point to.
pxThe rendered pixel buffer.
trace_pxThe trace pixel buffer.
orig_colorThe original selected pixel to use as the fill target color.
bciThe bitmap_coords_info structure.

Definition at line 561 of file flood-tool.cpp.

References ABORTED, BOUNDARY, check_if_pixel_is_paintable(), get_trace_pixel(), is_pixel_queued(), mark_pixel_checked(), OK, PAINT_DIRECTION_DOWN, PAINT_DIRECTION_LEFT, PAINT_DIRECTION_RIGHT, PAINT_DIRECTION_UP, paint_pixel(), push_point_onto_queue(), and Geom::X.

Referenced by sp_flood_do_flood_fill().

◆ push_point_onto_queue()

static void Inkscape::UI::Tools::push_point_onto_queue ( std::deque< Geom::Point > &  fill_queue,
unsigned  max_queue_size,
unsigned char *  trace_t,
unsigned  x,
unsigned  y 
)
static

Push a point to be checked onto the bottom of the rendered pixel buffer check queue.

Parameters
fill_queueThe fill queue to add the point to.
max_queue_sizeThe maximum size of the fill queue.
trace_tThe trace pixel buffer pixel.
xThe X coordinate.
yThe Y coordinate.

Definition at line 529 of file flood-tool.cpp.

References is_pixel_queued(), and mark_pixel_queued().

Referenced by perform_bitmap_scanline_check(), and sp_flood_do_flood_fill().

◆ random_position()

static void Inkscape::UI::Tools::random_position ( double &  radius,
double &  angle,
double &  a,
double &  s,
int   
)
static

Method to handle the distribution of the items.

Parameters
[out]radius: radius of the position of the sprayed object
[out]angle: angle of the position of the sprayed object
[in]a: mean
[in]s: standard deviation
[in]choice:

Definition at line 348 of file spray-tool.cpp.

References NormalDistribution().

Referenced by sp_spray_recursive().

◆ randomize01()

double Inkscape::UI::Tools::randomize01 ( double  val,
double  rand 
)

Randomizes val by rand, with 0 < val < 1 and all values (including 0, 1) having the same probability of being displaced.

Definition at line 385 of file spray-tool.cpp.

References MIN.

Referenced by fit_item().

◆ set_event_location()

static void Inkscape::UI::Tools::set_event_location ( SPDesktop desktop,
CanvasEvent const &  event 
)
static

◆ set_pos_and_anchor()

static void Inkscape::UI::Tools::set_pos_and_anchor ( CanvasItemText canvas_text,
Geom::Piecewise< Geom::D2< Geom::SBasis > > const &  pwd2,
double  t,
double  length 
)
static

◆ shift_point_onto_queue()

static void Inkscape::UI::Tools::shift_point_onto_queue ( std::deque< Geom::Point > &  fill_queue,
unsigned  max_queue_size,
unsigned char *  trace_t,
unsigned  x,
unsigned  y 
)
static

Shift a point to be checked onto the top of the rendered pixel buffer check queue.

Parameters
fill_queueThe fill queue to add the point to.
max_queue_sizeThe maximum size of the fill queue.
trace_tThe trace pixel buffer pixel.
xThe X coordinate.
yThe Y coordinate.

Definition at line 545 of file flood-tool.cpp.

References is_pixel_queued(), and mark_pixel_queued().

Referenced by sp_flood_do_flood_fill().

◆ showHidden()

static void Inkscape::UI::Tools::showHidden ( std::vector< SPItem * >  items_down)
static

Definition at line 413 of file spray-tool.cpp.

Referenced by fit_item().

◆ sort_fill_queue_horizontal()

static bool Inkscape::UI::Tools::sort_fill_queue_horizontal ( Geom::Point const &  a,
Geom::Point const &  b 
)
static

Sort the rendered pixel buffer check queue horizontally.

Definition at line 683 of file flood-tool.cpp.

References Geom::Point::x().

Referenced by sp_flood_do_flood_fill().

◆ sort_fill_queue_vertical()

static bool Inkscape::UI::Tools::sort_fill_queue_vertical ( Geom::Point const &  a,
Geom::Point const &  b 
)
static

Sort the rendered pixel buffer check queue vertically.

Definition at line 675 of file flood-tool.cpp.

References Geom::Point::y().

Referenced by sp_flood_do_flood_fill().

◆ sp_event_context_find_item()

◆ sp_event_context_get_shape_editor()

ShapeEditor * Inkscape::UI::Tools::sp_event_context_get_shape_editor ( ToolBase tool)

◆ sp_event_context_over_item()

SPItem * Inkscape::UI::Tools::sp_event_context_over_item ( SPDesktop desktop,
SPItem item,
Geom::Point const &  p 
)

Returns item if it is under point p in desktop, at any depth; otherwise returns NULL.

Honors into_groups.

Definition at line 1418 of file tool-base.cpp.

References desktop, SPDesktop::getItemFromListAtPointBottom(), item, and sp_event_context_over_item().

Referenced by sp_event_context_over_item().

◆ sp_event_context_read()

◆ sp_event_show_modifier_tip()

◆ sp_flood_do_flood_fill()

static void Inkscape::UI::Tools::sp_flood_do_flood_fill ( SPDesktop desktop,
Geom::Point const &  cursor_pos,
bool  union_with_selection,
bool  is_point_fill,
bool  is_touch_fill 
)
static

Perform a flood fill operation.

Parameters
desktopThe desktop of this tool's event context.
cursor_posThe location of the mouse cursor.
union_with_selectionIf true, union the new fill with the current selection.
is_point_fillIf false, use the Rubberband "touch selection" to get the initial points for the fill.
is_touch_fillIf true, use only the initial contact point in the Rubberband "touch selection" as the fill target color.

Definition at line 696 of file flood-tool.cpp.

References ABORTED, BOUNDARY, check_if_pixel_is_paintable(), clear_pixel_paintability(), compose_onto(), current, SPDesktop::d2w(), desktop, Geom::GenericRect< C >::dimensions(), SPItem::display_key_new(), do_trace(), SPDesktop::doc2dt(), Inkscape::DocumentUndo::done(), SPDocument::ensureUpToDate(), Inkscape::MessageStack::flash(), FLOOD_CHANNELS_ALPHA, FLOOD_CHANNELS_B, FLOOD_CHANNELS_G, FLOOD_CHANNELS_R, FLOOD_CHANNELS_RGB, Geom::GenericRect< C >::from_xywh(), Geom::GenericRect< Coord >::from_xywh(), Inkscape::Preferences::get(), Inkscape::Rubberband::get(), Inkscape::UI::Widget::Canvas::get_area_world(), get_pixel(), get_trace_pixel(), SPDesktop::getCanvas(), SPDesktop::getDocument(), Inkscape::Rubberband::getPoints(), height, Geom::Affine::inverse(), is_pixel_checked(), is_pixel_colored(), is_pixel_queued(), mark_pixel_checked(), Geom::GenericRect< C >::max(), MAX, SPDesktop::messageStack(), Geom::GenericRect< C >::min(), MIN, perform_bitmap_scanline_check(), push_point_onto_queue(), Inkscape::Drawing::render(), result, root, Inkscape::Drawing::setRoot(), shift_point_onto_queue(), sort_fill_queue_horizontal(), sort_fill_queue_vertical(), stride, Inkscape::Drawing::update(), SPDesktop::w2d(), Inkscape::WARNING_MESSAGE, width, Geom::X, Geom::IntPoint::x(), Geom::Y, and Geom::IntPoint::y().

◆ sp_select_context_up_one_layer()

static void Inkscape::UI::Tools::sp_select_context_up_one_layer ( SPDesktop desktop)
static

◆ sp_spray_dilate()

static bool Inkscape::UI::Tools::sp_spray_dilate ( SprayTool tc,
Geom::Point  p,
Geom::Point  vector,
bool  reverse,
bool  force = false 
)
static

Definition at line 1012 of file spray-tool.cpp.

References desktop, Inkscape::UI::Tools::SprayTool::distrib, Inkscape::UI::Tools::SprayTool::do_trace, Inkscape::UI::Tools::SprayTool::gamma_picked, get_dilate_radius(), get_move_mean(), get_move_standard_deviation(), get_path_mean(), get_path_standard_deviation(), get_population(), get_pressure(), Inkscape::UI::Tools::ToolBase::getDesktop(), Inkscape::UI::Tools::SprayTool::invert_picked, item, Inkscape::UI::Tools::SprayTool::items, Inkscape::UI::Tools::SprayTool::mode, Inkscape::UI::Tools::SprayTool::no_overlap, Inkscape::UI::Tools::SprayTool::objectSet(), Inkscape::UI::Tools::SprayTool::offset, Inkscape::UI::Tools::SprayTool::over_no_transparent, Inkscape::UI::Tools::SprayTool::over_transparent, Inkscape::UI::Tools::SprayTool::pick, Inkscape::UI::Tools::SprayTool::pick_center, Inkscape::UI::Tools::SprayTool::pick_fill, Inkscape::UI::Tools::SprayTool::pick_inverse_value, Inkscape::UI::Tools::SprayTool::pick_no_overlap, Inkscape::UI::Tools::SprayTool::pick_stroke, Inkscape::UI::Tools::SprayTool::pick_to_color, Inkscape::UI::Tools::SprayTool::pick_to_opacity, Inkscape::UI::Tools::SprayTool::pick_to_presence, Inkscape::UI::Tools::SprayTool::pick_to_size, Inkscape::UI::Tools::SprayTool::picker, Inkscape::UI::Tools::SprayTool::rand_picked, Inkscape::UI::Tools::SprayTool::ratio, Inkscape::UI::Tools::SprayTool::rotation_variation, Inkscape::UI::Tools::SprayTool::scale, Inkscape::UI::Tools::SprayTool::scale_variation, set, Inkscape::UI::Tools::SprayTool::single_angle, Inkscape::UI::Tools::SprayTool::single_click, Inkscape::UI::Tools::SprayTool::single_path_output, Inkscape::UI::Tools::SprayTool::single_scale, sp_object_ref(), sp_object_unref(), sp_spray_recursive(), Inkscape::UI::Tools::SprayTool::tilt, and Inkscape::UI::Tools::SprayTool::usepressurescale.

Referenced by Inkscape::UI::Tools::SprayTool::root_handler().

◆ sp_spray_extinput()

static void Inkscape::UI::Tools::sp_spray_extinput ( SprayTool tc,
ExtendedInput const &  ext 
)
static

◆ sp_spray_recursive()

static bool Inkscape::UI::Tools::sp_spray_recursive ( SPDesktop desktop,
Inkscape::ObjectSet set,
SPItem item,
SPItem *&  single_path_output,
Geom::Point  p,
Geom::Point  ,
gint  mode,
double  radius,
double  population,
double &  scale,
double  scale_variation,
bool  ,
double  mean,
double  standard_deviation,
double  ratio,
double  tilt,
double  rotation_variation,
gint  _distrib,
bool  no_overlap,
bool  picker,
bool  pick_center,
bool  pick_inverse_value,
bool  pick_fill,
bool  pick_stroke,
bool  pick_no_overlap,
bool  over_no_transparent,
bool  over_transparent,
double  offset,
bool  usepressurescale,
double  pressure,
int  pick,
bool  do_trace,
bool  single_click,
double  single_angle,
double  single_scale,
bool  pick_to_size,
bool  pick_to_presence,
bool  pick_to_color,
bool  pick_to_opacity,
bool  invert_picked,
double  gamma_picked,
double  rand_picked 
)
static

◆ sp_spray_switch_mode()

◆ sp_spray_transform_path()

static void Inkscape::UI::Tools::sp_spray_transform_path ( SPItem item,
Geom::Path path,
Geom::Affine  affine,
Geom::Point  center 
)
static

◆ sp_spray_update_area()

◆ sp_toggle_dropper()

void Inkscape::UI::Tools::sp_toggle_dropper ( SPDesktop dt)

Toggles current tool between active tool and dropper tool.

Subroutine of sp_event_context_private_root_handler().

Definition at line 233 of file tool-base.cpp.

References dropper_toggled, get_active_tool(), SPDesktop::getTool(), set_active_tool(), and switch_dropper_to.

Referenced by Inkscape::UI::Widget::ColorNotebook::_onPickerClicked(), and Inkscape::UI::Tools::DropperTool::root_handler().

◆ sp_toggle_selector()

static void Inkscape::UI::Tools::sp_toggle_selector ( SPDesktop dt)
static

Toggles current tool between active tool and selector tool.

Subroutine of sp_event_context_private_root_handler().

Definition at line 211 of file tool-base.cpp.

References get_active_tool(), SPDesktop::getTool(), selector_toggled, set_active_tool(), and switch_selector_to.

◆ sp_tweak_color_recursive()

static bool Inkscape::UI::Tools::sp_tweak_color_recursive ( guint  mode,
SPItem item,
SPItem item_at_point,
std::optional< Color > &  fill_goal,
std::optional< Color > &  stroke_goal,
float  opacity_goal,
bool  do_opacity,
bool  do_blur,
bool  reverse,
Geom::Point  p,
double  radius,
double  force,
bool  do_h,
bool  do_s,
bool  do_l,
bool  do_o 
)
static

◆ sp_tweak_dilate()

◆ sp_tweak_dilate_recursive()

static bool Inkscape::UI::Tools::sp_tweak_dilate_recursive ( Inkscape::Selection selection,
SPItem item,
Geom::Point  p,
Geom::Point  vector,
gint  mode,
double  radius,
double  force,
double  fidelity,
bool  reverse 
)
static

Definition at line 293 of file tweak-tool.cpp.

References Inkscape::Selection::add(), Inkscape::XML::Node::appendChild(), Inkscape::XML::Node::attribute(), child, SPObject::children, Geom::GenericOptRect< C >::contains(), Path::ConvertEvenLines(), Shape::ConvertToForme(), Shape::ConvertToShape(), css, SPDesktop::current_zoom(), SPObject::deleteObject(), Path::descr_cmd, Geom::Affine::descrim(), Inkscape::ObjectSet::desktop(), SPDesktop::doc2dt(), SPObject::document, SPItem::documentVisualBounds(), Inkscape::XML::Node::duplicate(), fill_nonZero, fill_oddEven, fill_positive, SPDocument::getObjectByRepr(), SPObject::getRepr(), SPDocument::getReprDoc(), SPItem::i2doc_affine(), Inkscape::Selection::includes(), is_color_mode(), is_transform_mode(), item, items, join_straight, Geom::L2(), Shape::MakeTweak(), MAX, mode, SPItem::move_rel(), orig, parent, Inkscape::XML::Node::parent(), Path_for_item(), Inkscape::XML::Node::position(), Inkscape::GC::release(), Inkscape::Selection::remove(), Path::Reset(), SPItem::rotate_rel(), scale, SPItem::scale_rel(), SPObject::setAttribute(), Inkscape::XML::Node::setAttribute(), Path::SetBackData(), Path::Simplify(), sp_item_list_to_curves(), sp_repr_css_attr(), sp_repr_css_property(), sp_selected_item_to_curved_repr(), sp_tweak_dilate_recursive(), Path::svg_dump_path(), TWEAK_MODE_ATTRACT_REPEL, tweak_mode_grow, TWEAK_MODE_MORELESS, TWEAK_MODE_MOVE, TWEAK_MODE_MOVE_IN_OUT, TWEAK_MODE_MOVE_JITTER, tweak_mode_push, TWEAK_MODE_PUSH, tweak_mode_repel, TWEAK_MODE_ROTATE, tweak_mode_roughen, TWEAK_MODE_ROUGHEN, TWEAK_MODE_SCALE, TWEAK_MODE_SHRINK_GROW, Geom::Affine::withoutTranslation(), and SPDesktop::yaxisdir().

Referenced by sp_tweak_dilate(), and sp_tweak_dilate_recursive().

◆ sp_tweak_extinput()

static void Inkscape::UI::Tools::sp_tweak_extinput ( TweakTool tc,
ExtendedInput const &  ext 
)
static

◆ sp_tweak_switch_mode()

◆ sp_tweak_switch_mode_temporarily()

◆ sp_tweak_update_area()

static void Inkscape::UI::Tools::sp_tweak_update_area ( TweakTool tc)
static

◆ sp_update_helperpath()

◆ spdc_apply_bend_shape()

static void Inkscape::UI::Tools::spdc_apply_bend_shape ( gchar const *  svgd,
FreehandBase dc,
SPItem item 
)
static

◆ spdc_apply_powerstroke_shape()

◆ spdc_apply_simplify()

◆ spdc_apply_style()

◆ spdc_check_for_and_apply_waiting_LPE() [1/2]

void Inkscape::UI::Tools::spdc_check_for_and_apply_waiting_LPE ( FreehandBase dc,
SPItem item 
)

If we have an item and a waiting LPE, apply the effect to the item (spiro spline mode is treated separately).

◆ spdc_check_for_and_apply_waiting_LPE() [2/2]

static void Inkscape::UI::Tools::spdc_check_for_and_apply_waiting_LPE ( FreehandBase dc,
SPItem item,
SPCurve const *  curve,
bool  is_bend 
)
static

Definition at line 291 of file freehand-base.cpp.

References Inkscape::Selection::add(), Inkscape::XML::Node::attribute(), BEND_CLIPBOARD, c, Inkscape::ObjectSet::clear(), CLIPBOARD, css, desktop, Inkscape::ObjectSet::duplicate(), ELLIPSE, Geom::Affine::expansionX(), Geom::Affine::expansionY(), Inkscape::Preferences::get(), Inkscape::UI::ClipboardManager::get(), Inkscape::UI::Tools::ToolBase::getDesktop(), SPDesktop::getDocument(), SPDocument::getDocumentScale(), Inkscape::Preferences::getDouble(), Inkscape::Preferences::getDoubleLimited(), Inkscape::Preferences::getInt(), Inkscape::UI::Tools::ToolBase::getPrefsPath(), SPObject::getRepr(), SPDesktop::getSelection(), Inkscape::ObjectSet::isEmpty(), item, LAST_APPLIED, mode, SPCurve::moveto(), SPItem::moveTo(), NONE, Inkscape::UI::ClipboardManager::paste(), previous_shape_type, Inkscape::Selection::remove(), Inkscape::UI::Tools::FreehandBase::selection, Geom::Affine::setExpansionX(), Geom::Affine::setExpansionY(), Geom::Affine::setTranslation(), Inkscape::ObjectSet::singleItem(), Geom::PathVector::size(), sp_css_attr_from_object(), sp_desktop_apply_css_recursive(), sp_lpe_item_update_patheffect(), SP_LPETOOL_CONTEXT(), sp_repr_css_attr_new(), sp_repr_css_attr_unref(), sp_repr_css_property(), sp_repr_css_set_property(), sp_repr_lookup_name(), SP_STYLE_FLAG_ALWAYS(), sp_svg_number_read_d(), sp_svg_read_pathv(), spdc_apply_bend_shape(), spdc_apply_powerstroke_shape(), spdc_apply_simplify(), spdc_paste_curve_as_freehand_shape(), Inkscape::UI::Tools::FreehandBase::tablet_enabled, Inkscape::ObjectSet::toCurves(), SPItem::transform, TRIANGLE_IN, TRIANGLE_OUT, Inkscape::UI::Tools::FreehandBase::waiting_LPE_type, and Inkscape::UI::Tools::FreehandBase::white_item.

Referenced by spdc_flush_white().

◆ spdc_concat_colors_and_flush()

◆ spdc_create_single_dot()

◆ spdc_endpoint_snap_free()

◆ spdc_endpoint_snap_rotation()

◆ spdc_flush_white()

◆ spdc_free_colors()

◆ spdc_paste_curve_as_freehand_shape()

◆ spdc_test_inside()

◆ square()

◆ transform_around_point()

static Geom::Affine Inkscape::UI::Tools::transform_around_point ( Geom::Point  center,
Geom::Affine const &  affine 
)
static

Transform the affine around the point.

For example if it's a rotation, scale and/or skew it will be applied relative to the center point.

Definition at line 92 of file spray-tool.cpp.

Referenced by sp_spray_recursive().

◆ transform_keep_center()

static void Inkscape::UI::Tools::transform_keep_center ( SPItem item,
Geom::Affine const &  affine,
Geom::Point const &  center 
)
static

◆ tweak_color()

static Color Inkscape::UI::Tools::tweak_color ( guint  mode,
Color const &  color,
Color const &  goal,
double  force,
bool  do_h,
bool  do_s,
bool  do_l 
)
static

◆ tweak_colors_in_gradient()

static void Inkscape::UI::Tools::tweak_colors_in_gradient ( SPItem item,
Inkscape::PaintTarget  fill_or_stroke,
Color const &  goal,
Geom::Point  p_w,
double  radius,
double  force,
guint  mode,
bool  do_h,
bool  do_s,
bool  do_l,
bool   
)
static

◆ tweak_opacity()

static void Inkscape::UI::Tools::tweak_opacity ( guint  mode,
SPIScale24 style_opacity,
double  opacity_goal,
double  force 
)
static

◆ tweak_profile()

static double Inkscape::UI::Tools::tweak_profile ( double  dist,
double  radius 
)
static

Definition at line 627 of file tweak-tool.cpp.

Referenced by sp_tweak_color_recursive(), and tweak_colors_in_gradient().

◆ tweak_stop_color()

static void Inkscape::UI::Tools::tweak_stop_color ( guint  mode,
SPStop stop,
Color const &  goal,
double  force,
bool  do_h,
bool  do_s,
bool  do_l 
)
static

Definition at line 603 of file tweak-tool.cpp.

References SPStop::getColor(), mode, SPStop::setColor(), and tweak_color().

Referenced by tweak_colors_in_gradient().

◆ unsnapped_polar()

static Geom::Point Inkscape::UI::Tools::unsnapped_polar ( double  angle)
static

Definition at line 176 of file calligraphic-tool.cpp.

References Geom::sincos().

Referenced by Inkscape::UI::Tools::CalligraphicTool::apply().

◆ update_latin_keys_group()

static void Inkscape::UI::Tools::update_latin_keys_group ( )
static

Try to determine the keys group of Latin layout.

Check available keymap entries for Latin 'a' key and find the minimal integer value.

Definition at line 1291 of file tool-base.cpp.

References latin_keys_group, latin_keys_group_valid, latin_keys_groups, and update_latin_keys_group().

Referenced by init_latin_keys_group(), and update_latin_keys_group().

Variable Documentation

◆ DEFAULT_ERASER_MODE

constexpr auto Inkscape::UI::Tools::DEFAULT_ERASER_MODE = EraserToolMode::CUT
inlinestaticconstexpr

◆ drag_escaped

gint Inkscape::UI::Tools::drag_escaped = 0
static

◆ explicit_base_tmp

std::optional<Geom::Point> Inkscape::UI::Tools::explicit_base_tmp
static

◆ fontsize

◆ gr_handle_descr

char const* Inkscape::UI::Tools::gr_handle_descr[]
static
Initial value:
= {
N_("Linear gradient <b>start</b>"),
N_("Linear gradient <b>end</b>"),
N_("Linear gradient <b>mid stop</b>"),
N_("Radial gradient <b>center</b>"),
N_("Radial gradient <b>radius</b>"),
N_("Radial gradient <b>radius</b>"),
N_("Radial gradient <b>focus</b>"),
N_("Radial gradient <b>mid stop</b>"),
N_("Radial gradient <b>mid stop</b>"),
N_("Mesh gradient <b>corner</b>"),
N_("Mesh gradient <b>handle</b>"),
N_("Mesh gradient <b>tensor</b>")
}

Definition at line 80 of file gradient-tool.cpp.

Referenced by Inkscape::UI::Tools::GradientTool::selection_changed().

◆ is_cycling

bool Inkscape::UI::Tools::is_cycling = false
static

Definition at line 62 of file select-tool.cpp.

◆ ms_handle_descr

const gchar* Inkscape::UI::Tools::ms_handle_descr[]
Initial value:
= {
N_("Linear gradient <b>start</b>"),
N_("Linear gradient <b>end</b>"),
N_("Linear gradient <b>mid stop</b>"),
N_("Radial gradient <b>center</b>"),
N_("Radial gradient <b>radius</b>"),
N_("Radial gradient <b>radius</b>"),
N_("Radial gradient <b>focus</b>"),
N_("Radial gradient <b>mid stop</b>"),
N_("Radial gradient <b>mid stop</b>"),
N_("Mesh gradient <b>corner</b>"),
N_("Mesh gradient <b>handle</b>"),
N_("Mesh gradient <b>tensor</b>")
}

Definition at line 99 of file mesh-tool.cpp.

Referenced by Inkscape::UI::Tools::MeshTool::selection_changed().

◆ PAINT_DIRECTION_ALL

constexpr int Inkscape::UI::Tools::PAINT_DIRECTION_ALL = 15
staticconstexpr

Definition at line 470 of file flood-tool.cpp.

Referenced by paint_pixel().

◆ PAINT_DIRECTION_DOWN

constexpr int Inkscape::UI::Tools::PAINT_DIRECTION_DOWN = 8
staticconstexpr

Definition at line 469 of file flood-tool.cpp.

Referenced by paint_pixel(), and perform_bitmap_scanline_check().

◆ PAINT_DIRECTION_LEFT

constexpr int Inkscape::UI::Tools::PAINT_DIRECTION_LEFT = 1
staticconstexpr

Definition at line 466 of file flood-tool.cpp.

Referenced by paint_pixel(), and perform_bitmap_scanline_check().

◆ PAINT_DIRECTION_RIGHT

constexpr int Inkscape::UI::Tools::PAINT_DIRECTION_RIGHT = 2
staticconstexpr

Definition at line 467 of file flood-tool.cpp.

Referenced by paint_pixel(), and perform_bitmap_scanline_check().

◆ PAINT_DIRECTION_UP

constexpr int Inkscape::UI::Tools::PAINT_DIRECTION_UP = 4
staticconstexpr

Definition at line 468 of file flood-tool.cpp.

Referenced by paint_pixel(), and perform_bitmap_scanline_check().

◆ pen_drag_origin_w

Geom::Point Inkscape::UI::Tools::pen_drag_origin_w(0, 0) ( ,
 
)
static

◆ pen_within_tolerance

bool Inkscape::UI::Tools::pen_within_tolerance = false
static

◆ pencil_drag_origin_w

Geom::Point Inkscape::UI::Tools::pencil_drag_origin_w(0, 0) ( ,
 
)
static

◆ pencil_within_tolerance

bool Inkscape::UI::Tools::pencil_within_tolerance = false
static

◆ PIXEL_CHECKED

constexpr unsigned char Inkscape::UI::Tools::PIXEL_CHECKED = 1
staticconstexpr

Definition at line 262 of file flood-tool.cpp.

Referenced by is_pixel_checked(), and mark_pixel_checked().

◆ PIXEL_COLORED

constexpr unsigned char Inkscape::UI::Tools::PIXEL_COLORED = 16
staticconstexpr

Definition at line 266 of file flood-tool.cpp.

Referenced by is_pixel_colored(), and mark_pixel_colored().

◆ PIXEL_NOT_PAINTABLE

constexpr unsigned char Inkscape::UI::Tools::PIXEL_NOT_PAINTABLE = 8
staticconstexpr

◆ PIXEL_PAINTABLE

constexpr unsigned char Inkscape::UI::Tools::PIXEL_PAINTABLE = 4
staticconstexpr

◆ PIXEL_QUEUED

constexpr unsigned char Inkscape::UI::Tools::PIXEL_QUEUED = 2
staticconstexpr

Definition at line 263 of file flood-tool.cpp.

Referenced by is_pixel_queued(), and mark_pixel_queued().

◆ previous_shape_type

ShapeType Inkscape::UI::Tools::previous_shape_type = NONE
static

Definition at line 289 of file freehand-base.cpp.

Referenced by spdc_check_for_and_apply_waiting_LPE(), and spdc_flush_white().

◆ rb_escaped

gint Inkscape::UI::Tools::rb_escaped = 0
static