OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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. |
11 | 11 |
12 #ifndef UI_GFX_RECT_H_ | 12 #ifndef UI_GFX_GEOMETRY_RECT_H_ |
13 #define UI_GFX_RECT_H_ | 13 #define UI_GFX_GEOMETRY_RECT_H_ |
14 | 14 |
15 #include <cmath> | 15 #include <cmath> |
16 #include <string> | 16 #include <string> |
17 | 17 |
18 #include "ui/gfx/point.h" | 18 #include "ui/gfx/geometry/point.h" |
19 #include "ui/gfx/rect_base.h" | 19 #include "ui/gfx/geometry/rect_base.h" |
20 #include "ui/gfx/rect_f.h" | 20 #include "ui/gfx/geometry/rect_f.h" |
21 #include "ui/gfx/size.h" | 21 #include "ui/gfx/geometry/size.h" |
22 #include "ui/gfx/vector2d.h" | 22 #include "ui/gfx/geometry/vector2d.h" |
23 | 23 |
24 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
25 typedef struct tagRECT RECT; | 25 typedef struct tagRECT RECT; |
26 #elif defined(TOOLKIT_GTK) | 26 #elif defined(TOOLKIT_GTK) |
27 typedef struct _GdkRectangle GdkRectangle; | 27 typedef struct _GdkRectangle GdkRectangle; |
28 #elif defined(OS_IOS) | 28 #elif defined(OS_IOS) |
29 #include <CoreGraphics/CoreGraphics.h> | 29 #include <CoreGraphics/CoreGraphics.h> |
30 #elif defined(OS_MACOSX) | 30 #elif defined(OS_MACOSX) |
31 #include <ApplicationServices/ApplicationServices.h> | 31 #include <ApplicationServices/ApplicationServices.h> |
32 #endif | 32 #endif |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 inline Rect ScaleToEnclosedRect(const Rect& rect, float scale) { | 135 inline Rect ScaleToEnclosedRect(const Rect& rect, float scale) { |
136 return ScaleToEnclosedRect(rect, scale, scale); | 136 return ScaleToEnclosedRect(rect, scale, scale); |
137 } | 137 } |
138 | 138 |
139 #if !defined(COMPILER_MSVC) | 139 #if !defined(COMPILER_MSVC) |
140 extern template class RectBase<Rect, Point, Size, Insets, Vector2d, int>; | 140 extern template class RectBase<Rect, Point, Size, Insets, Vector2d, int>; |
141 #endif | 141 #endif |
142 | 142 |
143 } // namespace gfx | 143 } // namespace gfx |
144 | 144 |
145 #endif // UI_GFX_RECT_H_ | 145 #endif // UI_GFX_GEOMETRY_RECT_H_ |
OLD | NEW |