summaryrefslogtreecommitdiffstats
path: root/src/connection-points.cpp
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.cpp
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.cpp')
-rw-r--r--src/connection-points.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/connection-points.cpp b/src/connection-points.cpp
new file mode 100644
index 000000000..9ed98d211
--- /dev/null
+++ b/src/connection-points.cpp
@@ -0,0 +1,37 @@
+#include "connection-points.h"
+
+
+bool ConnectionPoint::operator!=(ConnectionPoint& cp)
+{
+ return (id!=cp.id || type!=cp.type || dir!=cp.dir || pos!=cp.pos);
+}
+
+bool ConnectionPoint::operator==(ConnectionPoint& cp)
+{
+ return (id==cp.id && type==cp.type && dir==cp.dir && pos==cp.pos);
+}
+
+
+namespace Inkscape{
+
+SVGIStringStream&
+operator>>(SVGIStringStream& istr, ConnectionPoint& cp)
+{
+ istr>>cp.id>>cp.dir>>cp.pos[Geom::X]>>cp.pos[Geom::Y];
+
+ return istr;
+}
+
+SVGOStringStream&
+operator<<(SVGOStringStream& ostr, const ConnectionPoint& cp)
+{
+ ostr<<cp.id<<' '<<cp.dir<<' ';
+ ::operator<<( ostr, cp.pos[Geom::X] );
+ ostr<<' ';
+ ::operator<<( ostr, cp.pos[Geom::Y] );
+
+ return ostr;
+}
+
+
+}