summaryrefslogtreecommitdiffstats
path: root/base/gfx/rect.h
diff options
context:
space:
mode:
authoravi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-05 18:04:07 +0000
committeravi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-05 18:04:07 +0000
commit66d3a8e27c79e8d8cf6f3db37f2c20226b71c7d8 (patch)
treedd1744434e0bf229fdf63fd46c220d742cf19a60 /base/gfx/rect.h
parent4d562a7e2538a1396a4dbeae66aea33f4f4afcd3 (diff)
downloadchromium_src-66d3a8e27c79e8d8cf6f3db37f2c20226b71c7d8.zip
chromium_src-66d3a8e27c79e8d8cf6f3db37f2c20226b71c7d8.tar.gz
chromium_src-66d3a8e27c79e8d8cf6f3db37f2c20226b71c7d8.tar.bz2
Fix basic geometric types.
Review URL: http://chrome-reviews.prom.corp.google.com/1106 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@381 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/gfx/rect.h')
-rw-r--r--base/gfx/rect.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/base/gfx/rect.h b/base/gfx/rect.h
index 486f799..d19bf7e 100644
--- a/base/gfx/rect.h
+++ b/base/gfx/rect.h
@@ -40,7 +40,9 @@
#include "base/gfx/size.h"
#include "base/gfx/point.h"
+#if defined(OS_WIN)
typedef struct tagRECT RECT;
+#endif
namespace gfx {
@@ -49,12 +51,20 @@ class Rect {
Rect();
Rect(int width, int height);
Rect(int x, int y, int width, int height);
+#if defined(OS_WIN)
explicit Rect(const RECT& r);
+#elif defined(OS_MACOSX)
+ explicit Rect(const CGRect& r);
+#endif
Rect(const gfx::Point& origin, const gfx::Size& size);
~Rect() {}
+#if defined(OS_WIN)
Rect& operator=(const RECT& r);
+#elif defined(OS_MACOSX)
+ Rect& operator=(const CGRect& r);
+#endif
int x() const { return origin_.x(); }
void set_x(int x) { origin_.set_x(x); }
@@ -93,8 +103,13 @@ class Rect {
return !(*this == other);
}
+#if defined(OS_WIN)
// Construct an equivalent Win32 RECT object.
RECT ToRECT() const;
+#elif defined(OS_MACOSX)
+ // Construct an equivalent CoreGraphics object.
+ CGRect ToCGRect() const;
+#endif
// Returns true if the point identified by point_x and point_y falls inside
// this rectangle. The point (x, y) is inside the rectangle, but the