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_DISPLAY_H_ | 5 #ifndef UI_GFX_DISPLAY_H_ |
6 #define UI_GFX_DISPLAY_H_ | 6 #define UI_GFX_DISPLAY_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 // Returns a string representation of the display; | 129 // Returns a string representation of the display; |
130 std::string ToString() const; | 130 std::string ToString() const; |
131 | 131 |
132 // True if the display contains valid display id. | 132 // True if the display contains valid display id. |
133 bool is_valid() const { return id_ != kInvalidDisplayID; } | 133 bool is_valid() const { return id_ != kInvalidDisplayID; } |
134 | 134 |
135 // True if the display corresponds to internal panel. | 135 // True if the display corresponds to internal panel. |
136 bool IsInternal() const; | 136 bool IsInternal() const; |
137 | 137 |
| 138 // Outputs the physical dimensions of the display in millimeters. Returns true |
| 139 // if successful, false if a monitor isn't found or if the size information |
| 140 // isn't available. |
| 141 bool GetPhysicalSize(int* width_mm, int* height_mm) const; |
| 142 |
138 // Gets/Sets an id of display corresponding to internal panel. | 143 // Gets/Sets an id of display corresponding to internal panel. |
139 static int64_t InternalDisplayId(); | 144 static int64_t InternalDisplayId(); |
140 static void SetInternalDisplayId(int64_t internal_display_id); | 145 static void SetInternalDisplayId(int64_t internal_display_id); |
141 | 146 |
142 // Test if the |id| is for the internal display if any. | 147 // Test if the |id| is for the internal display if any. |
143 static bool IsInternalDisplayId(int64_t id); | 148 static bool IsInternalDisplayId(int64_t id); |
144 | 149 |
145 // True if there is an internal display. | 150 // True if there is an internal display. |
146 static bool HasInternalDisplay(); | 151 static bool HasInternalDisplay(); |
147 | 152 |
148 private: | 153 private: |
149 int64_t id_; | 154 int64_t id_; |
150 Rect bounds_; | 155 Rect bounds_; |
151 Rect work_area_; | 156 Rect work_area_; |
152 float device_scale_factor_; | 157 float device_scale_factor_; |
153 Rotation rotation_; | 158 Rotation rotation_; |
154 TouchSupport touch_support_; | 159 TouchSupport touch_support_; |
155 }; | 160 }; |
156 | 161 |
157 } // namespace gfx | 162 } // namespace gfx |
158 | 163 |
159 #endif // UI_GFX_DISPLAY_H_ | 164 #endif // UI_GFX_DISPLAY_H_ |
OLD | NEW |