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_SIZE_H_ | 5 #ifndef UI_GFX_SIZE_H_ |
6 #define UI_GFX_SIZE_H_ | 6 #define UI_GFX_SIZE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <iosfwd> |
| 10 |
9 #include "build/build_config.h" | 11 #include "build/build_config.h" |
10 | 12 #include "ui/ui_api.h" |
11 #include <iosfwd> | |
12 | 13 |
13 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
14 typedef struct tagSIZE SIZE; | 15 typedef struct tagSIZE SIZE; |
15 #elif defined(OS_MACOSX) | 16 #elif defined(OS_MACOSX) |
16 #include <ApplicationServices/ApplicationServices.h> | 17 #include <ApplicationServices/ApplicationServices.h> |
17 #endif | 18 #endif |
18 | 19 |
19 namespace gfx { | 20 namespace gfx { |
20 | 21 |
21 // A size has width and height values. | 22 // A size has width and height values. |
22 class Size { | 23 class UI_API Size { |
23 public: | 24 public: |
24 Size() : width_(0), height_(0) {} | 25 Size() : width_(0), height_(0) {} |
25 Size(int width, int height); | 26 Size(int width, int height); |
26 #if defined(OS_MACOSX) | 27 #if defined(OS_MACOSX) |
27 explicit Size(const CGSize& s); | 28 explicit Size(const CGSize& s); |
28 #endif | 29 #endif |
29 | 30 |
30 ~Size() {} | 31 ~Size() {} |
31 | 32 |
32 #if defined(OS_MACOSX) | 33 #if defined(OS_MACOSX) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 SIZE ToSIZE() const; | 69 SIZE ToSIZE() const; |
69 #elif defined(OS_MACOSX) | 70 #elif defined(OS_MACOSX) |
70 CGSize ToCGSize() const; | 71 CGSize ToCGSize() const; |
71 #endif | 72 #endif |
72 | 73 |
73 private: | 74 private: |
74 int width_; | 75 int width_; |
75 int height_; | 76 int height_; |
76 }; | 77 }; |
77 | 78 |
78 std::ostream& operator<<(std::ostream& out, const gfx::Size& s); | 79 UI_API std::ostream& operator<<(std::ostream& out, const gfx::Size& s); |
79 | 80 |
80 } // namespace gfx | 81 } // namespace gfx |
81 | 82 |
82 #endif // UI_GFX_SIZE_H_ | 83 #endif // UI_GFX_SIZE_H_ |
OLD | NEW |