summaryrefslogtreecommitdiffstats
path: root/src/snap-preferences.h
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2011-10-27 04:55:51 +0000
committerJon A. Cruz <jon@joncruz.org>2011-10-27 04:55:51 +0000
commit2633767789e4264b13ef91a684accf734fb4e94f (patch)
tree0f6bc8d758b8e4bcf01d2dd393166907906c156e /src/snap-preferences.h
parentCleanup pass on documentation that was dumping garbage into doxygen output. (diff)
downloadinkscape-2633767789e4264b13ef91a684accf734fb4e94f.tar.gz
inkscape-2633767789e4264b13ef91a684accf734fb4e94f.zip
Fixing more broken and split doc comments.
(bzr r10697)
Diffstat (limited to '')
-rw-r--r--src/snap-preferences.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/snap-preferences.h b/src/snap-preferences.h
index 8044d0aa7..0db135f5d 100644
--- a/src/snap-preferences.h
+++ b/src/snap-preferences.h
@@ -46,7 +46,17 @@ public:
void setSnapPostponedGlobally(bool postponed) {_snap_postponed_globally = postponed;}
bool getSnapPostponedGlobally() const {return _snap_postponed_globally;}
+ /**
+ * Turn on/off snapping of specific point types.
+ * @param t Point type.
+ * @param s true to snap to this point type, otherwise false.
+ */
void setSnapFrom(Inkscape::SnapSourceType t, bool s);
+
+ /**
+ * @param t Point type.
+ * @return true if snapper will snap this type of point, otherwise false.
+ */
bool getSnapFrom(Inkscape::SnapSourceType t) const;
bool getStrictSnapping() const {return _strict_snapping;}
@@ -60,7 +70,25 @@ public:
void setObjectTolerance(gdouble val) {_object_tolerance = val;}
private:
+
+ /**
+ * Map snap target to array index.
+ *
+ * The status of each snap toggle (in the snap toolbar) is stored as a boolean value in an array. This method returns the position
+ * of relevant boolean in that array, for any given type of snap target. For most snap targets, the enumerated value of that targets
+ * matches the position in the array (primary snap targets). This however does not hold for snap targets which don't have their own
+ * toggle button (secondary snap targets).
+ *
+ * PS:
+ * - For snap sources, just pass the corresponding snap target instead (each snap source should have a twin snap target, but not vice versa)
+ * - All parameters are passed by reference, and will be overwritten
+ *
+ * @param target Stores the enumerated snap target, which can be modified to correspond to the array index of this snap target.
+ * @param always_on If true, then this snap target is always active and cannot be toggled.
+ * @param group_on If true, then this snap target is in a snap group that has been enabled (e.g. bbox group, nodes/paths group, or "others" group.
+ */
void _mapTargetToArrayIndex(Inkscape::SnapTargetType &target, bool &always_on, bool &group_on) const;
+
int _active_snap_targets[Inkscape::SNAPTARGET_MAX_ENUM_VALUE];
bool _snap_enabled_globally; // Toggles ALL snapping