summaryrefslogtreecommitdiffstats
path: root/src/connection-points.h
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-01-14 08:13:09 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-01-14 08:13:09 +0000
commit7f7da4643d6909af5cd58b2f24846774e3af509b (patch)
tree1fec13b3616ecc90fb251bb9e643aefc43c80c43 /src/connection-points.h
parentSome additional docs (diff)
parentInitial cut of disabling floating windows on window managers with problems. (diff)
downloadinkscape-7f7da4643d6909af5cd58b2f24846774e3af509b.tar.gz
inkscape-7f7da4643d6909af5cd58b2f24846774e3af509b.zip
* Merge from trunk
* Update to new snapping API * Modify the join action slightly (bzr r8846.2.11)
Diffstat (limited to 'src/connection-points.h')
-rw-r--r--src/connection-points.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/connection-points.h b/src/connection-points.h
new file mode 100644
index 000000000..c1ddeb481
--- /dev/null
+++ b/src/connection-points.h
@@ -0,0 +1,70 @@
+#ifndef INKSCAPE_CONNECTION_POINT_H
+#define INKSCAPE_CONNECTION_POINT_H
+
+#include <2geom/point.h>
+//#include <libavoid/vertices.h>
+#include <libavoid/connector.h>
+
+#include "svg/stringstream.h"
+
+
+enum ConnPointType {
+ ConnPointDefault = 0,
+ ConnPointUserDefined = 1
+};
+enum ConnPointDefaultPos{
+ ConnPointPosTL, // Top Left
+ ConnPointPosTC, // Top Centre
+ ConnPointPosTR, // Top Right
+ ConnPointPosCL, // Centre Left
+ ConnPointPosCC, // Centre Centre
+ ConnPointPosCR, // Centre Right
+ ConnPointPosBL, // Bottom Left
+ ConnPointPosBC, // Bottom Centre
+ ConnPointPosBR, // Bottom Right
+};
+
+
+struct ConnectionPoint
+{
+ ConnectionPoint():
+ type(ConnPointDefault), // default to a default connection point
+ id(ConnPointPosCC), // default to the centre point
+ pos(),
+ dir(Avoid::ConnDirAll) // allow any direction
+ {
+ }
+ // type of the connection point
+ // default or user-defined
+ int type;
+
+ /* id of the connection point
+ in the case of default
+ connection points it specifies
+ which of the 9 types the
+ connection point is.
+ */
+ int id;
+
+ /* position related to parent item
+ in the case of default connection
+ points, these positions should be
+ computed by the item's avoidRef
+ */
+ Geom::Point pos;
+
+ // directions from which connections can occur
+ Avoid::ConnDirFlags dir;
+
+ bool operator!=(ConnectionPoint&);
+ bool operator==(ConnectionPoint&);
+};
+
+namespace Inkscape{
+
+SVGIStringStream& operator>>(SVGIStringStream& istr, ConnectionPoint& cp);
+SVGOStringStream& operator<<(SVGOStringStream& ostr, const ConnectionPoint& cp);
+
+}
+
+#endif \ No newline at end of file