OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" | 13 #include "ui/base/ui_export.h" |
14 | 14 |
15 #if defined(OS_WIN) | 15 #if defined(OS_WIN) |
16 typedef unsigned long DWORD; | 16 typedef unsigned long DWORD; |
17 typedef struct tagPOINT POINT; | 17 typedef struct tagPOINT POINT; |
18 #elif defined(OS_MACOSX) | 18 #elif defined(OS_MACOSX) |
19 #include <ApplicationServices/ApplicationServices.h> | 19 #include <ApplicationServices/ApplicationServices.h> |
20 #endif | 20 #endif |
21 | 21 |
22 namespace gfx { | 22 namespace gfx { |
23 | 23 |
24 // A point has an x and y coordinate. | 24 // A point has an x and y coordinate. |
25 class UI_API Point { | 25 class UI_EXPORT Point { |
26 public: | 26 public: |
27 Point(); | 27 Point(); |
28 Point(int x, int y); | 28 Point(int x, int y); |
29 #if defined(OS_WIN) | 29 #if defined(OS_WIN) |
30 // |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 |
31 // 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 |
32 // value is commonly acquired from GetMessagePos/GetCursorPos. | 32 // value is commonly acquired from GetMessagePos/GetCursorPos. |
33 explicit Point(DWORD point); | 33 explicit Point(DWORD point); |
34 explicit Point(const POINT& point); | 34 explicit Point(const POINT& point); |
35 Point& operator=(const POINT& point); | 35 Point& operator=(const POINT& point); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 POINT ToPOINT() const; | 89 POINT ToPOINT() const; |
90 #elif defined(OS_MACOSX) | 90 #elif defined(OS_MACOSX) |
91 CGPoint ToCGPoint() const; | 91 CGPoint ToCGPoint() const; |
92 #endif | 92 #endif |
93 | 93 |
94 private: | 94 private: |
95 int x_; | 95 int x_; |
96 int y_; | 96 int y_; |
97 }; | 97 }; |
98 | 98 |
99 UI_API std::ostream& operator<<(std::ostream& out, const gfx::Point& p); | 99 UI_EXPORT std::ostream& operator<<(std::ostream& out, const gfx::Point& p); |
100 | 100 |
101 } // namespace gfx | 101 } // namespace gfx |
102 | 102 |
103 #endif // UI_GFX_POINT_H_ | 103 #endif // UI_GFX_POINT_H_ |
OLD | NEW |