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 #ifndef UI_GFX_POINT_H_ | 5 #ifndef UI_GFX_POINT_H_ |
6 #define UI_GFX_POINT_H_ | 6 #define UI_GFX_POINT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
11 #include <iosfwd> | 11 #include <iosfwd> |
12 | 12 |
| 13 #include "ui/ui_api.h" |
| 14 |
13 #if defined(OS_WIN) | 15 #if defined(OS_WIN) |
14 typedef unsigned long DWORD; | 16 typedef unsigned long DWORD; |
15 typedef struct tagPOINT POINT; | 17 typedef struct tagPOINT POINT; |
16 #elif defined(OS_MACOSX) | 18 #elif defined(OS_MACOSX) |
17 #include <ApplicationServices/ApplicationServices.h> | 19 #include <ApplicationServices/ApplicationServices.h> |
18 #endif | 20 #endif |
19 | 21 |
20 namespace gfx { | 22 namespace gfx { |
21 | 23 |
22 // A point has an x and y coordinate. | 24 // A point has an x and y coordinate. |
23 class Point { | 25 class UI_API Point { |
24 public: | 26 public: |
25 Point(); | 27 Point(); |
26 Point(int x, int y); | 28 Point(int x, int y); |
27 #if defined(OS_WIN) | 29 #if defined(OS_WIN) |
28 // |point| is a DWORD value that contains a coordinate. The x-coordinate is | 30 // |point| is a DWORD value that contains a coordinate. The x-coordinate is |
29 // the low-order short and the y-coordinate is the high-order short. This | 31 // the low-order short and the y-coordinate is the high-order short. This |
30 // value is commonly acquired from GetMessagePos/GetCursorPos. | 32 // value is commonly acquired from GetMessagePos/GetCursorPos. |
31 explicit Point(DWORD point); | 33 explicit Point(DWORD point); |
32 explicit Point(const POINT& point); | 34 explicit Point(const POINT& point); |
33 Point& operator=(const POINT& point); | 35 Point& operator=(const POINT& point); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 POINT ToPOINT() const; | 89 POINT ToPOINT() const; |
88 #elif defined(OS_MACOSX) | 90 #elif defined(OS_MACOSX) |
89 CGPoint ToCGPoint() const; | 91 CGPoint ToCGPoint() const; |
90 #endif | 92 #endif |
91 | 93 |
92 private: | 94 private: |
93 int x_; | 95 int x_; |
94 int y_; | 96 int y_; |
95 }; | 97 }; |
96 | 98 |
97 std::ostream& operator<<(std::ostream& out, const gfx::Point& p); | 99 UI_API std::ostream& operator<<(std::ostream& out, const gfx::Point& p); |
98 | 100 |
99 } // namespace gfx | 101 } // namespace gfx |
100 | 102 |
101 #endif // UI_GFX_POINT_H_ | 103 #endif // UI_GFX_POINT_H_ |
OLD | NEW |