diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-09 21:17:44 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-09 21:17:44 +0000 |
commit | 938d54ac33044905429ca7f0f55eb7fe2d459321 (patch) | |
tree | ef28224eb9b066b102862c314738873fc081920b /base | |
parent | 9343914ea1812ea24afd00724f6a38bf60b2f67c (diff) | |
download | chromium_src-938d54ac33044905429ca7f0f55eb7fe2d459321.zip chromium_src-938d54ac33044905429ca7f0f55eb7fe2d459321.tar.gz chromium_src-938d54ac33044905429ca7f0f55eb7fe2d459321.tar.bz2 |
Use gfx::Point instead of GET_X/Y_LPARAM to reduce a dependency on ATL.
BUG=5027
TEST=none
Review URL: http://codereview.chromium.org/195035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25788 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/gfx/point.cc | 6 | ||||
-rw-r--r-- | base/gfx/point.h | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/base/gfx/point.cc b/base/gfx/point.cc index 4fc031d..05b7596 100644 --- a/base/gfx/point.cc +++ b/base/gfx/point.cc @@ -19,6 +19,12 @@ Point::Point(int x, int y) : x_(x), y_(y) { } #if defined(OS_WIN) +Point::Point(DWORD point) { + POINTS points = MAKEPOINTS(point); + x_ = points.x; + y_ = points.y; +} + Point::Point(const POINT& point) : x_(point.x), y_(point.y) { } diff --git a/base/gfx/point.h b/base/gfx/point.h index 7f95096..513d555 100644 --- a/base/gfx/point.h +++ b/base/gfx/point.h @@ -10,6 +10,7 @@ #include <iosfwd> #if defined(OS_WIN) +typedef unsigned long DWORD; typedef struct tagPOINT POINT; #elif defined(OS_MACOSX) #include <ApplicationServices/ApplicationServices.h> @@ -25,6 +26,10 @@ class Point { Point(); Point(int x, int y); #if defined(OS_WIN) + // |point| is a DWORD value that contains a coordinate. The x-coordinate is + // the low-order short and the y-coordinate is the high-order short. This + // value is commonly acquired from GetMessagePos/GetCursorPos. + explicit Point(DWORD point); explicit Point(const POINT& point); Point& operator=(const POINT& point); #elif defined(OS_MACOSX) @@ -72,4 +77,4 @@ class Point { std::ostream& operator<<(std::ostream& out, const gfx::Point& p); -#endif // BASE_GFX_POINT_H__ +#endif // BASE_GFX_POINT_H__ |