Author: mjansen
Date: Thu Aug 4 19:15:21 2016
New Revision: 72110
URL: http://svn.reactos.org/svn/reactos?rev=72110&view=rev
Log:
[ATL][ATL_APITEST] Add implementation + tests for most functions from CPoint,
CSize, CRect. CORE-11747 #resolve
Not all functions are implemented, the ones that are not implemented are left
in a comment in the header.
Added:
trunk/reactos/sdk/lib/atl/atltypes.h (with props)
trunk/rostests/apitests/atl/atltypes.cpp (with props)
Modified:
trunk/rostests/apitests/atl/CMakeLists.txt
trunk/rostests/apitests/atl/testlist.c
Added: trunk/reactos/sdk/lib/atl/atltypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/atl/atltypes.h?rev=72110
==
--- trunk/reactos/sdk/lib/atl/atltypes.h(added)
+++ trunk/reactos/sdk/lib/atl/atltypes.h[iso-8859-1] Thu Aug 4
19:15:21 2016
@@ -0,0 +1,566 @@
+/*
+ * ReactOS ATL
+ *
+ * Copyright 2016 Mark Jansen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+ */
+
+#pragma once
+
+
+class CSize;
+class CRect;
+
+
+class CPoint : public tagPOINT
+{
+public:
+
+CPoint() throw()
+{
+x = y = 0;
+}
+
+CPoint(int initX, int initY) throw()
+{
+x = initX;
+y = initY;
+}
+
+CPoint(POINT initPt) throw()
+{
+*((POINT*)this) = initPt;
+}
+
+CPoint(SIZE initSize) throw()
+{
+*((SIZE*)this) = initSize;
+}
+
+CPoint(LPARAM dwPoint) throw()
+{
+x = LOWORD(dwPoint);
+y = HIWORD(dwPoint);
+}
+
+void Offset(int xOffset, int yOffset) throw()
+{
+x += xOffset;
+y += yOffset;
+}
+
+void Offset(POINT point) throw()
+{
+Offset(point.x, point.y);
+}
+
+void Offset(SIZE size) throw()
+{
+Offset(size.cx, size.cy);
+}
+
+BOOL operator==(POINT point) const throw()
+{
+return (x == point.x && y == point.y);
+}
+
+BOOL operator!=(POINT point) const throw()
+{
+return !(*this == point);
+}
+
+void operator+=(SIZE size) throw()
+{
+Offset(size);
+}
+
+void operator+=(POINT point) throw()
+{
+Offset(point);
+}
+
+void operator-=(SIZE size) throw()
+{
+Offset(-size.cx, -size.cy);
+}
+
+void operator-=(POINT point) throw()
+{
+Offset(-point.x, -point.y);
+}
+
+CPoint operator+(SIZE size) const throw()
+{
+return CPoint(x + size.cx, y + size.cy);
+}
+
+CPoint operator+(POINT point) const throw()
+{
+return CPoint(x + point.x, y + point.y);
+}
+
+CRect operator+(const RECT* lpRect) const throw();
+
+CSize operator-(POINT point) const throw();
+
+CPoint operator-(SIZE size) const throw()
+{
+return CPoint(x - size.cx, y - size.cy);
+}
+
+CRect operator-(const RECT* lpRect) const throw();
+
+CPoint operator-() const throw()
+{
+return CPoint(-x, -y);
+}
+};
+
+class CSize : public tagSIZE
+{
+public:
+CSize() throw()
+{
+cx = cy = 0;
+}
+
+CSize(int initCX, int initCY) throw()
+{
+cx = initCX;
+cy = initCY;
+}
+
+CSize(SIZE initSize) throw()
+{
+*((SIZE*)this) = initSize;
+}
+
+CSize(POINT initPt) throw()
+{
+*((POINT*)this) = initPt;
+}
+
+CSize(DWORD dwSize) throw()
+{
+cx = LOWORD(dwSize);
+cy = HIWORD(dwSize);
+}
+
+BOOL operator==(SIZE size) const throw()
+{
+return (size.cx == cx && size.cy == cy);
+}
+
+BOOL operator!=(SIZE size) const throw()
+{
+return !(*this == size);
+}
+
+void operator+=(SIZE size) throw()
+{
+cx += size.cx;
+cy += size.cy;
+}
+
+void operator-=(SIZE size) throw()
+{
+cx -= size.cx;
+cy -= size.cy;
+}
+
+CSize operator+(SIZE size) const throw()
+{
+return CSize(cx + size.cx, cy + size.cy);
+}
+
+CPoint operator+(POINT point) const throw()
+{
+return CPoint(cx + point.x, cy + point.y);
+}
+
+CRect operator+(const RECT* lpRect) const throw();
+
+CSize operator-(SIZE size) const throw()
+{
+