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" | 8 #include "ui/gfx/point.h" |
9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 UI_EXPORT void EnableHighDPISupport(); | 23 UI_EXPORT void EnableHighDPISupport(); |
24 | 24 |
25 // TODO(kevers|girard): Move above methods into win namespace. | 25 // TODO(kevers|girard): Move above methods into win namespace. |
26 | 26 |
27 namespace win { | 27 namespace win { |
28 | 28 |
29 UI_EXPORT float GetDeviceScaleFactor(); | 29 UI_EXPORT float GetDeviceScaleFactor(); |
30 | 30 |
31 UI_EXPORT gfx::Point ScreenToDIPPoint(const gfx::Point& pixel_point); | 31 UI_EXPORT gfx::Point ScreenToDIPPoint(const gfx::Point& pixel_point); |
32 | 32 |
| 33 UI_EXPORT gfx::Point DIPToScreenPoint(const gfx::Point& dip_point); |
| 34 |
33 UI_EXPORT gfx::Rect ScreenToDIPRect(const gfx::Rect& pixel_bounds); | 35 UI_EXPORT gfx::Rect ScreenToDIPRect(const gfx::Rect& pixel_bounds); |
34 | 36 |
35 UI_EXPORT gfx::Rect DIPToScreenRect(const gfx::Rect& dip_bounds); | 37 UI_EXPORT gfx::Rect DIPToScreenRect(const gfx::Rect& dip_bounds); |
36 | 38 |
37 UI_EXPORT gfx::Size ScreenToDIPSize(const gfx::Size& size_in_pixels); | 39 UI_EXPORT gfx::Size ScreenToDIPSize(const gfx::Size& size_in_pixels); |
38 | 40 |
39 UI_EXPORT gfx::Size DIPToScreenSize(const gfx::Size& dip_size); | 41 UI_EXPORT gfx::Size DIPToScreenSize(const gfx::Size& dip_size); |
40 | 42 |
41 // Win32's GetSystemMetrics uses pixel measures. This function calls | 43 // Win32's GetSystemMetrics uses pixel measures. This function calls |
42 // GetSystemMetrics for the given |metric|, then converts the result to DIP. | 44 // GetSystemMetrics for the given |metric|, then converts the result to DIP. |
43 UI_EXPORT int GetSystemMetricsInDIP(int metric); | 45 UI_EXPORT int GetSystemMetricsInDIP(int metric); |
44 | 46 |
45 // The OS secretly scales apps that are not DPIAware. This is not visible | 47 // The OS secretly scales apps that are not DPIAware. This is not visible |
46 // through standard OS calls like GetWindowPos(), or through GetDPIScale(). | 48 // through standard OS calls like GetWindowPos(), or through GetDPIScale(). |
47 // Returns the scale factor of the display, where 96 DPI is 1.0. | 49 // Returns the scale factor of the display, where 96 DPI is 1.0. |
48 // (Avoid this function... use GetDPIScale() instead.) | 50 // (Avoid this function... use GetDPIScale() instead.) |
49 // TODO(girard): Remove this once DPIAware is enabled - http://crbug.com/149881 | 51 // TODO(girard): Remove this once DPIAware is enabled - http://crbug.com/149881 |
50 UI_EXPORT double GetUndocumentedDPIScale(); | 52 UI_EXPORT double GetUndocumentedDPIScale(); |
51 | 53 |
52 } // namespace win | 54 } // namespace win |
53 | 55 |
54 } // namespace ui | 56 } // namespace ui |
55 | 57 |
56 #endif // UI_BASE_WIN_DPI_H_ | 58 #endif // UI_BASE_WIN_DPI_H_ |
OLD | NEW |