| 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 #ifndef UI_GFX_SIZE_H_ | 5 #ifndef UI_GFX_SIZE_H_ |
| 6 #define UI_GFX_SIZE_H_ | 6 #define UI_GFX_SIZE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "ui/base/ui_export.h" | 11 #include "ui/base/ui_export.h" |
| 12 #include "ui/gfx/size_base.h" | 12 #include "ui/gfx/size_base.h" |
| 13 #include "ui/gfx/size_f.h" |
| 13 | 14 |
| 14 #if defined(OS_WIN) | 15 #if defined(OS_WIN) |
| 15 typedef struct tagSIZE SIZE; | 16 typedef struct tagSIZE SIZE; |
| 16 #elif defined(OS_IOS) | 17 #elif defined(OS_IOS) |
| 17 #include <CoreGraphics/CoreGraphics.h> | 18 #include <CoreGraphics/CoreGraphics.h> |
| 18 #elif defined(OS_MACOSX) | 19 #elif defined(OS_MACOSX) |
| 19 #include <ApplicationServices/ApplicationServices.h> | 20 #include <ApplicationServices/ApplicationServices.h> |
| 20 #endif | 21 #endif |
| 21 | 22 |
| 22 namespace gfx { | 23 namespace gfx { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 35 #if defined(OS_MACOSX) | 36 #if defined(OS_MACOSX) |
| 36 Size& operator=(const CGSize& s); | 37 Size& operator=(const CGSize& s); |
| 37 #endif | 38 #endif |
| 38 | 39 |
| 39 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
| 40 SIZE ToSIZE() const; | 41 SIZE ToSIZE() const; |
| 41 #elif defined(OS_MACOSX) | 42 #elif defined(OS_MACOSX) |
| 42 CGSize ToCGSize() const; | 43 CGSize ToCGSize() const; |
| 43 #endif | 44 #endif |
| 44 | 45 |
| 46 SizeF ToSizeF() const { |
| 47 return SizeF(width(), height()); |
| 48 } |
| 49 |
| 45 std::string ToString() const; | 50 std::string ToString() const; |
| 46 }; | 51 }; |
| 47 | 52 |
| 48 #if !defined(COMPILER_MSVC) | 53 #if !defined(COMPILER_MSVC) |
| 49 extern template class SizeBase<Size, int>; | 54 extern template class SizeBase<Size, int>; |
| 50 #endif | 55 #endif |
| 51 | 56 |
| 52 } // namespace gfx | 57 } // namespace gfx |
| 53 | 58 |
| 54 #endif // UI_GFX_SIZE_H_ | 59 #endif // UI_GFX_SIZE_H_ |
| OLD | NEW |