You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.3 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * Turbo Vision - Version 2.0
  3. *
  4. * Copyright (c) 1994 by Borland International
  5. * All Rights Reserved.
  6. *
  7. Modified by Robert H�hne to be used for RHIDE.
  8. *
  9. *
  10. */
  11. #if defined( Uses_TPoint ) && !defined( __TPoint )
  12. #define __TPoint
  13. class TPoint
  14. {
  15. public:
  16. TPoint& operator+=( const TPoint& adder );
  17. TPoint& operator-=( const TPoint& subber );
  18. friend TPoint operator - ( const TPoint& one, const TPoint& two);
  19. friend TPoint operator + ( const TPoint& one, const TPoint& two);
  20. friend int operator == ( const TPoint& one, const TPoint& two);
  21. friend int operator != ( const TPoint& one, const TPoint& two);
  22. int x,y;
  23. };
  24. inline TPoint& TPoint::operator += ( const TPoint& adder )
  25. {
  26. x += adder.x;
  27. y += adder.y;
  28. return *this;
  29. }
  30. inline TPoint& TPoint::operator -= ( const TPoint& subber )
  31. {
  32. x -= subber.x;
  33. y -= subber.y;
  34. return *this;
  35. }
  36. inline ipstream& operator >> ( ipstream& is, TPoint& p )
  37. { return is >> p.x >> p.y; }
  38. inline ipstream& operator >> ( ipstream& is, TPoint*& p )
  39. { return is >> p->x >> p->y; }
  40. inline opstream& operator << ( opstream& os, TPoint& p )
  41. { return os << p.x << p.y; }
  42. inline opstream& operator << ( opstream& os, TPoint* p )
  43. { return os << p->x << p->y; }
  44. #endif // Uses_TPoint