Code

Fix snap bug as reported by Arcadie Cracan on the developers mailing list, dating...
[inkscape.git] / src / snap-enums.h
1 #ifndef SNAPENUMS_H_
2 #define SNAPENUMS_H_
4 /**
5  * \file snap-enums.h
6  * \brief enumerations of snap source types and snap target types
7  *
8  * Authors:
9  *   Diederik van Lierop <mail@diedenrezi.nl>
10  *
11  * Copyright (C) 2010 Authors
12  *
13  * Released under GNU GPL, read the file 'COPYING' for more information
14  */
16 namespace Inkscape {
18 enum SnapTargetType {
19     SNAPTARGET_UNDEFINED = 0,
20     SNAPTARGET_GRID,
21     SNAPTARGET_GRID_INTERSECTION,
22     SNAPTARGET_GUIDE,
23     SNAPTARGET_GUIDE_INTERSECTION,
24     SNAPTARGET_GUIDE_ORIGIN,
25     SNAPTARGET_GRID_GUIDE_INTERSECTION,
26     SNAPTARGET_NODE_SMOOTH,
27     SNAPTARGET_NODE_CUSP,
28     SNAPTARGET_LINE_MIDPOINT,
29     SNAPTARGET_OBJECT_MIDPOINT,
30     SNAPTARGET_ROTATION_CENTER,
31     SNAPTARGET_HANDLE,
32     SNAPTARGET_PATH,
33     SNAPTARGET_PATH_INTERSECTION,
34     SNAPTARGET_BBOX_CORNER,
35     SNAPTARGET_BBOX_EDGE,
36     SNAPTARGET_BBOX_EDGE_MIDPOINT,
37     SNAPTARGET_BBOX_MIDPOINT,
38     SNAPTARGET_PAGE_BORDER,
39     SNAPTARGET_PAGE_CORNER,
40     SNAPTARGET_CONVEX_HULL_CORNER,
41     SNAPTARGET_ELLIPSE_QUADRANT_POINT,
42     SNAPTARGET_CENTER, // of ellipse
43     SNAPTARGET_CORNER, // of image or of rectangle
44     SNAPTARGET_TEXT_BASELINE,
45     SNAPTARGET_CONSTRAINED_ANGLE
46 };
48 enum SnapSourceType {
49     SNAPSOURCE_UNDEFINED = 0,
50     //-------------------------------------------------------------------
51     // Bbox points can be located at the edge of the stroke (for visual bboxes); they will therefore not snap
52     // to nodes because these are always located at the center of the stroke
53     SNAPSOURCE_BBOX_CATEGORY = 256, // will be used as a flag and must therefore be a power of two
54     SNAPSOURCE_BBOX_CORNER,
55     SNAPSOURCE_BBOX_MIDPOINT,
56     SNAPSOURCE_BBOX_EDGE_MIDPOINT,
57     //-------------------------------------------------------------------
58     // For the same reason, nodes will not snap to bbox points
59     SNAPSOURCE_NODE_CATEGORY = 512, // will be used as a flag and must therefore be a power of two
60     SNAPSOURCE_NODE_SMOOTH,
61     SNAPSOURCE_NODE_CUSP,
62     SNAPSOURCE_LINE_MIDPOINT,
63     SNAPSOURCE_PATH_INTERSECTION,
64     SNAPSOURCE_CORNER, // of image or of rectangle
65     SNAPSOURCE_CONVEX_HULL_CORNER,
66     SNAPSOURCE_ELLIPSE_QUADRANT_POINT,
67     SNAPSOURCE_NODE_HANDLE, // eg. nodes in the path editor, handles of stars or rectangles, etc. (tied to a stroke)
68     //-------------------------------------------------------------------
69     // Other points (e.g. guides, gradient knots) will snap to both bounding boxes and nodes
70     SNAPSOURCE_OTHER_CATEGORY = 1024, // will be used as a flag and must therefore be a power of two
71     SNAPSOURCE_OBJECT_MIDPOINT,
72     SNAPSOURCE_ROTATION_CENTER,
73     SNAPSOURCE_CENTER, // of ellipse
74     SNAPSOURCE_GUIDE,
75     SNAPSOURCE_GUIDE_ORIGIN,
76     SNAPSOURCE_TEXT_BASELINE,
77     SNAPSOURCE_OTHER_HANDLE // eg. the handle of a gradient of a connector (ie not being tied to a stroke)
78 };
80 }
81 #endif /* SNAPENUMS_H_ */