| 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_BASE_WIN_DPI_H_ | 5 #ifndef UI_BASE_WIN_DPI_H_ |
| 6 #define UI_BASE_WIN_DPI_H_ | 6 #define UI_BASE_WIN_DPI_H_ |
| 7 | 7 |
| 8 #include "ui/gfx/point.h" |
| 9 #include "ui/gfx/rect.h" |
| 8 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
| 9 #include "ui/base/ui_export.h" | 11 #include "ui/base/ui_export.h" |
| 10 | 12 |
| 11 namespace ui { | 13 namespace ui { |
| 12 | 14 |
| 13 UI_EXPORT gfx::Size GetDPI(); | 15 UI_EXPORT gfx::Size GetDPI(); |
| 14 | 16 |
| 15 // Gets the scale factor of the display. For example, if the display DPI is | 17 // Gets the scale factor of the display. For example, if the display DPI is |
| 16 // 96 then the scale factor is 1.0. | 18 // 96 then the scale factor is 1.0. |
| 17 UI_EXPORT float GetDPIScale(); | 19 UI_EXPORT float GetDPIScale(); |
| 18 | 20 |
| 19 UI_EXPORT bool IsInHighDPIMode(); | 21 UI_EXPORT bool IsInHighDPIMode(); |
| 20 | 22 |
| 21 UI_EXPORT void EnableHighDPISupport(); | 23 UI_EXPORT void EnableHighDPISupport(); |
| 22 | 24 |
| 25 // TODO(kevers,girard): Should above methods be inside a win namespace since |
| 26 // they are also Windows specific. |
| 27 |
| 28 namespace win { |
| 29 |
| 30 UI_EXPORT gfx::Point ScreenToDIPPoint(const gfx::Point& pixel_point); |
| 31 |
| 32 UI_EXPORT gfx::Rect ScreenToDIPRect(const gfx::Rect& pixel_bounds); |
| 33 |
| 34 UI_EXPORT gfx::Rect DIPToScreenRect(const gfx::Rect& dip_bounds); |
| 35 |
| 36 UI_EXPORT gfx::Size ScreenToDIPSize(const gfx::Size& size_in_pixels); |
| 37 |
| 38 UI_EXPORT gfx::Size DIPToScreenSize(const gfx::Size& dip_size); |
| 39 |
| 40 } // namespace win |
| 41 |
| 23 } // namespace ui | 42 } // namespace ui |
| 24 | 43 |
| 25 #endif // UI_BASE_WIN_DPI_H_ | 44 #endif // UI_BASE_WIN_DPI_H_ |
| OLD | NEW |