Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
snap-enums.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef SNAPENUMS_H_
3#define SNAPENUMS_H_
4/*
5 * Authors:
6 * Diederik van Lierop <mail@diedenrezi.nl>
7 *
8 * Copyright (C) 2010 - 2012 Authors
9 *
10 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
11 */
12
13namespace Inkscape {
14
18enum SnapSourceType { // When adding source types here, then also update Inkscape::SnapPreferences::source2target!
20 //-------------------------------------------------------------------
21 // Bbox points can be located at the edge of the stroke (for visual bboxes); they will therefore not snap
22 // to nodes because these are always located at the center of the stroke
23 SNAPSOURCE_BBOX_CATEGORY = 16, // will be used as a flag and must therefore be a power of two. Also,
24 // must be larger than the largest number of targets in a single group
28
29 // Allow PAGES to be moved as BBOX (enabled alignment snapping)
32
33 //-------------------------------------------------------------------
34 // For the same reason, nodes will not snap to bbox points
35 SNAPSOURCE_NODE_CATEGORY = 32, // will be used as a flag and must therefore be a power of two
36 SNAPSOURCE_NODE_SMOOTH, // Symmetrical nodes are also considered to be smooth; there's no dedicated type for symm. nodes
40 SNAPSOURCE_RECT_CORNER, // of a rectangle, so at the center of the stroke
43 SNAPSOURCE_NODE_HANDLE, // eg. nodes in the path editor, handles of stars or rectangles, etc. (tied to a stroke)
44 //-------------------------------------------------------------------
45 // Other points (e.g. guides) will snap to both bounding boxes and nodes
46 SNAPSOURCE_DATUMS_CATEGORY = 64, // will be used as a flag and must therefore be a power of two
49 //-------------------------------------------------------------------
50 // Other points (e.g. gradient knots, image corners) will snap to both bounding boxes and nodes
51 SNAPSOURCE_OTHERS_CATEGORY = 128, // will be used as a flag and must therefore be a power of two
53 SNAPSOURCE_OBJECT_MIDPOINT, // midpoint of rectangles, ellipses, polygon, etc.
56 SNAPSOURCE_OTHER_HANDLE, // eg. the handle of a gradient or of a connector (ie not being tied to a stroke)
57 SNAPSOURCE_GRID_PITCH, // eg. when pasting or alt-dragging in the selector tool; not really a snap source
58
59 //-------------------------------------------------------------------
60 // Alignment snapping
68};
69
72 //-------------------------------------------------------------------
73 SNAPTARGET_BBOX_CATEGORY = 16, // will be used as a flag and must therefore be a power of two. Also,
74 // must be larger than the largest number of targets in a single group
75 // i.e > 15 because that's the number of targets in the "others" group
80 //-------------------------------------------------------------------
81 SNAPTARGET_NODE_CATEGORY = 32, // will be used as a flag and must therefore be a power of two
85 SNAPTARGET_PATH, // If path targets are added here, then also add them to the list in findBestSnap()
92 SNAPTARGET_ELLIPSE_QUADRANT_POINT, // this corner is at the center of the stroke
93 SNAPTARGET_RECT_CORNER, // of a rectangle, so this corner is at the center of the stroke
94 //-------------------------------------------------------------------
95 SNAPTARGET_DATUMS_CATEGORY = 64, // will be used as a flag and must therefore be a power of two
113 //-------------------------------------------------------------------
114 SNAPTARGET_OTHERS_CATEGORY = 128, // will be used as a flag and must therefore be a power of two
122
123 //-------------------------------------------------------------------
124 // Alignment snapping
125 SNAPTARGET_ALIGNMENT_CATEGORY = 256, // will be used as a flag and must therefore be a power of two
136
137 //-------------------------------------------------------------------
138 // Distribution snapping
139 SNAPTARGET_DISTRIBUTION_CATEGORY = 512, // will be used as a flag and must therefore be a power of two
147
148 //-------------------------------------------------------------------
151
152// simple snapping UI hides variety of choices behind a few categories
153enum class SimpleSnap {
154 BBox = 0, // bounding box category
155 Nodes, // nodes, paths
156 Alignment, // alignment and distribution snaps
157 Rest, // all the rest
159};
160
161}
162#endif /* SNAPENUMS_H_ */
Helper class to stream background task notifications as a series of messages.
SnapSourceType
enumerations of snap source types and snap target types.
Definition snap-enums.h:18
@ SNAPSOURCE_OTHERS_CATEGORY
Definition snap-enums.h:51
@ SNAPSOURCE_ALIGNMENT_BBOX_MIDPOINT
Definition snap-enums.h:63
@ SNAPSOURCE_NODE_CUSP
Definition snap-enums.h:37
@ SNAPSOURCE_BBOX_MIDPOINT
Definition snap-enums.h:26
@ SNAPSOURCE_GUIDE
Definition snap-enums.h:47
@ SNAPSOURCE_PATH_INTERSECTION
Definition snap-enums.h:39
@ SNAPSOURCE_UNDEFINED
Definition snap-enums.h:19
@ SNAPSOURCE_OTHER_HANDLE
Definition snap-enums.h:56
@ SNAPSOURCE_BBOX_CORNER
Definition snap-enums.h:25
@ SNAPSOURCE_ALIGNMENT_HANDLE
Definition snap-enums.h:67
@ SNAPSOURCE_TEXT_ANCHOR
Definition snap-enums.h:55
@ SNAPSOURCE_NODE_SMOOTH
Definition snap-enums.h:36
@ SNAPSOURCE_RECT_CORNER
Definition snap-enums.h:40
@ SNAPSOURCE_DATUMS_CATEGORY
Definition snap-enums.h:46
@ SNAPSOURCE_GUIDE_ORIGIN
Definition snap-enums.h:48
@ SNAPSOURCE_CONVEX_HULL_CORNER
Definition snap-enums.h:41
@ SNAPSOURCE_PAGE_CORNER
Definition snap-enums.h:31
@ SNAPSOURCE_ALIGNMENT_PAGE_CORNER
Definition snap-enums.h:66
@ SNAPSOURCE_ALIGNMENT_PAGE_CENTER
Definition snap-enums.h:65
@ SNAPSOURCE_ALIGNMENT_BBOX_CORNER
Definition snap-enums.h:62
@ SNAPSOURCE_GRID_PITCH
Definition snap-enums.h:57
@ SNAPSOURCE_NODE_CATEGORY
Definition snap-enums.h:35
@ SNAPSOURCE_OBJECT_MIDPOINT
Definition snap-enums.h:53
@ SNAPSOURCE_IMG_CORNER
Definition snap-enums.h:54
@ SNAPSOURCE_NODE_HANDLE
Definition snap-enums.h:43
@ SNAPSOURCE_LINE_MIDPOINT
Definition snap-enums.h:38
@ SNAPSOURCE_BBOX_EDGE_MIDPOINT
Definition snap-enums.h:27
@ SNAPSOURCE_PAGE_CENTER
Definition snap-enums.h:30
@ SNAPSOURCE_ELLIPSE_QUADRANT_POINT
Definition snap-enums.h:42
@ SNAPSOURCE_ALIGNMENT_CATEGORY
Definition snap-enums.h:61
@ SNAPSOURCE_ROTATION_CENTER
Definition snap-enums.h:52
@ SNAPSOURCE_BBOX_CATEGORY
Definition snap-enums.h:23
@ SNAPSOURCE_ALIGNMENT_BBOX_EDGE_MIDPOINT
Definition snap-enums.h:64
@ SNAPTARGET_ALIGNMENT_BBOX_MIDPOINT
Definition snap-enums.h:127
@ SNAPTARGET_GUIDE_ORIGIN
Definition snap-enums.h:102
@ SNAPTARGET_DATUMS_CATEGORY
Definition snap-enums.h:95
@ SNAPTARGET_BBOX_EDGE_MIDPOINT
Definition snap-enums.h:78
@ SNAPTARGET_UNDEFINED
Definition snap-enums.h:71
@ SNAPTARGET_ALIGNMENT_PAGE_MARGIN_CORNER
Definition snap-enums.h:132
@ SNAPTARGET_PATH_GUIDE_INTERSECTION
Definition snap-enums.h:89
@ SNAPTARGET_RECT_CORNER
Definition snap-enums.h:93
@ SNAPTARGET_CONSTRAINT
Definition snap-enums.h:121
@ SNAPTARGET_PAGE_MARGIN_BORDER
Definition snap-enums.h:108
@ SNAPTARGET_PATH
Definition snap-enums.h:85
@ SNAPTARGET_ALIGNMENT_PAGE_BLEED_CORNER
Definition snap-enums.h:133
@ SNAPTARGET_NODE_CUSP
Definition snap-enums.h:83
@ SNAPTARGET_DISTRIBUTION_XY
Definition snap-enums.h:146
@ SNAPTARGET_PAGE_MARGIN_CENTER
Definition snap-enums.h:109
@ SNAPTARGET_DISTRIBUTION_LEFT
Definition snap-enums.h:143
@ SNAPTARGET_TEXT_ANCHOR
Definition snap-enums.h:118
@ SNAPTARGET_DISTRIBUTION_DOWN
Definition snap-enums.h:145
@ SNAPTARGET_ROTATION_CENTER
Definition snap-enums.h:117
@ SNAPTARGET_LINE_MIDPOINT
Definition snap-enums.h:84
@ SNAPTARGET_GUIDE_PERPENDICULAR
Definition snap-enums.h:103
@ SNAPTARGET_ALIGNMENT_PAGE_EDGE_CENTER
Definition snap-enums.h:129
@ SNAPTARGET_OTHERS_CATEGORY
Definition snap-enums.h:114
@ SNAPTARGET_PAGE_BLEED_CORNER
Definition snap-enums.h:112
@ SNAPTARGET_BBOX_MIDPOINT
Definition snap-enums.h:79
@ SNAPTARGET_GRID_INTERSECTION
Definition snap-enums.h:98
@ SNAPTARGET_NODE_SMOOTH
Definition snap-enums.h:82
@ SNAPTARGET_ALIGNMENT_CATEGORY
Definition snap-enums.h:125
@ SNAPTARGET_ALIGNMENT_INTERSECTION
Definition snap-enums.h:135
@ SNAPTARGET_PATH_CLIP
Definition snap-enums.h:90
@ SNAPTARGET_PAGE_EDGE_CENTER
Definition snap-enums.h:106
@ SNAPTARGET_GUIDE
Definition snap-enums.h:100
@ SNAPTARGET_DISTRIBUTION_UP
Definition snap-enums.h:144
@ SNAPTARGET_ELLIPSE_QUADRANT_POINT
Definition snap-enums.h:92
@ SNAPTARGET_DISTRIBUTION_CATEGORY
Definition snap-enums.h:139
@ SNAPTARGET_PAGE_EDGE_CORNER
Definition snap-enums.h:107
@ SNAPTARGET_ALIGNMENT_BBOX_EDGE_MIDPOINT
Definition snap-enums.h:128
@ SNAPTARGET_NODE_CATEGORY
Definition snap-enums.h:81
@ SNAPTARGET_ALIGNMENT_PAGE_MARGIN_CENTER
Definition snap-enums.h:131
@ SNAPTARGET_PAGE_EDGE_BORDER
Definition snap-enums.h:105
@ SNAPTARGET_DISTRIBUTION_X
Definition snap-enums.h:140
@ SNAPTARGET_GRID
Definition snap-enums.h:96
@ SNAPTARGET_GRID_GUIDE_INTERSECTION
Definition snap-enums.h:104
@ SNAPTARGET_ALIGNMENT_HANDLE
Definition snap-enums.h:134
@ SNAPTARGET_TEXT_BASELINE
Definition snap-enums.h:119
@ SNAPTARGET_GRID_PERPENDICULAR
Definition snap-enums.h:99
@ SNAPTARGET_BBOX_EDGE
Definition snap-enums.h:77
@ SNAPTARGET_GUIDE_INTERSECTION
Definition snap-enums.h:101
@ SNAPTARGET_PATH_MASK
Definition snap-enums.h:91
@ SNAPTARGET_ALIGNMENT_PAGE_EDGE_CORNER
Definition snap-enums.h:130
@ SNAPTARGET_IMG_CORNER
Definition snap-enums.h:116
@ SNAPTARGET_ALIGNMENT_BBOX_CORNER
Definition snap-enums.h:126
@ SNAPTARGET_PAGE_MARGIN_CORNER
Definition snap-enums.h:110
@ SNAPTARGET_OBJECT_MIDPOINT
Definition snap-enums.h:115
@ SNAPTARGET_DISTRIBUTION_Y
Definition snap-enums.h:141
@ SNAPTARGET_BBOX_CORNER
Definition snap-enums.h:76
@ SNAPTARGET_GRID_LINE
Definition snap-enums.h:97
@ SNAPTARGET_PATH_TANGENTIAL
Definition snap-enums.h:87
@ SNAPTARGET_PATH_PERPENDICULAR
Definition snap-enums.h:86
@ SNAPTARGET_PATH_INTERSECTION
Definition snap-enums.h:88
@ SNAPTARGET_PAGE_BLEED_BORDER
Definition snap-enums.h:111
@ SNAPTARGET_DISTRIBUTION_RIGHT
Definition snap-enums.h:142
@ SNAPTARGET_BBOX_CATEGORY
Definition snap-enums.h:73
@ SNAPTARGET_MAX_ENUM_VALUE
Definition snap-enums.h:149
@ SNAPTARGET_CONSTRAINED_ANGLE
Definition snap-enums.h:120