OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Defines a simple integer rectangle class. The containment semantics | 5 // Defines a simple integer rectangle class. The containment semantics |
6 // are array-like; that is, the coordinate (x, y) is considered to be | 6 // are array-like; that is, the coordinate (x, y) is considered to be |
7 // contained by the rectangle, but the coordinate (x + width, y) is not. | 7 // contained by the rectangle, but the coordinate (x + width, y) is not. |
8 // The class will happily let you create malformed rectangles (that is, | 8 // The class will happily let you create malformed rectangles (that is, |
9 // rectangles with negative width and/or height), but there will be assertions | 9 // rectangles with negative width and/or height), but there will be assertions |
10 // in the operations (such as Contains()) to complain in this case. | 10 // in the operations (such as Contains()) to complain in this case. |
(...skipping 10 matching lines...) Expand all Loading... |
21 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
22 typedef struct tagRECT RECT; | 22 typedef struct tagRECT RECT; |
23 #elif defined(USE_X11) | 23 #elif defined(USE_X11) |
24 typedef struct _GdkRectangle GdkRectangle; | 24 typedef struct _GdkRectangle GdkRectangle; |
25 #endif | 25 #endif |
26 | 26 |
27 namespace gfx { | 27 namespace gfx { |
28 | 28 |
29 class Insets; | 29 class Insets; |
30 | 30 |
31 class Rect { | 31 class UI_API Rect { |
32 public: | 32 public: |
33 Rect(); | 33 Rect(); |
34 Rect(int width, int height); | 34 Rect(int width, int height); |
35 Rect(int x, int y, int width, int height); | 35 Rect(int x, int y, int width, int height); |
36 #if defined(OS_WIN) | 36 #if defined(OS_WIN) |
37 explicit Rect(const RECT& r); | 37 explicit Rect(const RECT& r); |
38 #elif defined(OS_MACOSX) | 38 #elif defined(OS_MACOSX) |
39 explicit Rect(const CGRect& r); | 39 explicit Rect(const CGRect& r); |
40 #elif defined(USE_X11) | 40 #elif defined(USE_X11) |
41 explicit Rect(const GdkRectangle& r); | 41 explicit Rect(const GdkRectangle& r); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 170 |
171 // Returns true if this rectangle shares an entire edge (i.e., same width or | 171 // Returns true if this rectangle shares an entire edge (i.e., same width or |
172 // same height) with the given rectangle, and the rectangles do not overlap. | 172 // same height) with the given rectangle, and the rectangles do not overlap. |
173 bool SharesEdgeWith(const gfx::Rect& rect) const; | 173 bool SharesEdgeWith(const gfx::Rect& rect) const; |
174 | 174 |
175 private: | 175 private: |
176 gfx::Point origin_; | 176 gfx::Point origin_; |
177 gfx::Size size_; | 177 gfx::Size size_; |
178 }; | 178 }; |
179 | 179 |
180 std::ostream& operator<<(std::ostream& out, const gfx::Rect& r); | 180 UI_API std::ostream& operator<<(std::ostream& out, const gfx::Rect& r); |
181 | 181 |
182 } // namespace gfx | 182 } // namespace gfx |
183 | 183 |
184 #endif // UI_GFX_RECT_H_ | 184 #endif // UI_GFX_RECT_H_ |
OLD | NEW |