From 01256d49770e75722461ab80d601b9b2a2c003c5 Mon Sep 17 00:00:00 2001 From: "Arcadie M. Cracan" Date: Wed, 2 Dec 2009 23:40:56 +0200 Subject: [PATCH] Add some more forgotten files --- src/connection-points.cpp | 37 +++++++++++++++++++++ src/connection-points.h | 70 +++++++++++++++++++++++++++++++++++++++ src/libavoid/.dirstamp | 0 3 files changed, 107 insertions(+) create mode 100644 src/connection-points.cpp create mode 100644 src/connection-points.h delete mode 100644 src/libavoid/.dirstamp 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< +//#include +#include + +#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 diff --git a/src/libavoid/.dirstamp b/src/libavoid/.dirstamp deleted file mode 100644 index e69de29bb..000000000 -- 2.30.2