X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fgdi%2Fepoint.h;h=d7cdf399876dbda8bceb3ffcc67d20ef33ed7271;hb=6bffe6f0ce6b00d792787c91cd609b72748287ae;hp=fc5f983670e253c850f7d25e0b4469137889f4d2;hpb=d63d2c3c6cbbd574dda4f8b00ebe6c661735edd5;p=vuplus_dvbapp diff --git a/lib/gdi/epoint.h b/lib/gdi/epoint.h index fc5f983..d7cdf39 100644 --- a/lib/gdi/epoint.h +++ b/lib/gdi/epoint.h @@ -1,8 +1,6 @@ #ifndef EPOINT_H #define EPOINT_H -#include - #ifndef ABS #define ABS(x) ( x>0 ? x : -x ) #endif @@ -35,7 +33,9 @@ public: friend inline bool operator==( const ePoint &, const ePoint & ); friend inline bool operator!=( const ePoint &, const ePoint & ); friend inline ePoint operator+( const ePoint &, const ePoint & ); + friend inline ePoint operator+( const ePoint &, const eSize & ); friend inline ePoint operator-( const ePoint &, const ePoint & ); + friend inline ePoint operator-( const ePoint &, const eSize & ); friend inline ePoint operator*( const ePoint &, int ); friend inline ePoint operator*( int, const ePoint & ); friend inline ePoint operator*( const ePoint &, double ); @@ -56,25 +56,6 @@ inline int ePoint::manhattanLength() const /***************************************************************************** - ePoint stream functions - *****************************************************************************/ -namespace std -{ - inline ostream &operator<<( ostream & s, const ePoint & p ) - { - s << p.x() << p.y(); - return s; - } - - inline istream &operator>>( istream & s, ePoint & p ) - { - s >> p.rx() >> p.ry(); - return s; - } -} - - -/***************************************************************************** ePoint inline functions *****************************************************************************/ @@ -129,6 +110,12 @@ inline ePoint operator+( const ePoint &p1, const ePoint &p2 ) inline ePoint operator-( const ePoint &p1, const ePoint &p2 ) { return ePoint(p1.xp-p2.xp, p1.yp-p2.yp); } +inline ePoint operator+( const ePoint &p1, const eSize &p2 ) +{ return ePoint(p1.xp+p2.width(), p1.yp+p2.height()); } + +inline ePoint operator-( const ePoint &p1, const eSize &p2 ) +{ return ePoint(p1.xp-p2.width(), p1.yp-p2.height()); } + inline ePoint operator*( const ePoint &p, int c ) { return ePoint(p.xp*c, p.yp*c); }