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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 class GFX_EXPORT Display { | 23 class GFX_EXPORT Display { |
24 public: | 24 public: |
25 // Screen Rotation in clock-wise degrees. | 25 // Screen Rotation in clock-wise degrees. |
26 enum Rotation { | 26 enum Rotation { |
27 ROTATE_0 = 0, | 27 ROTATE_0 = 0, |
28 ROTATE_90, | 28 ROTATE_90, |
29 ROTATE_180, | 29 ROTATE_180, |
30 ROTATE_270, | 30 ROTATE_270, |
31 }; | 31 }; |
32 | 32 |
| 33 // The display rotation can have multiple causes for change. A user can set a |
| 34 // preference. On devices with accelerometers, they can change the rotation. |
| 35 // RotationSource allows for the tracking of a Rotation per source of the |
| 36 // change. ROTATION_SOURCE_ACTIVE is the current rotation of the display. |
| 37 // Rotation changes not due to an accelerometer, nor the user, are to use this |
| 38 // source directly. |
| 39 enum RotationSource { |
| 40 ROTATION_SOURCE_ACCELEROMETER = 0, |
| 41 ROTATION_SOURCE_ACTIVE, |
| 42 ROTATION_SOURCE_USER, |
| 43 }; |
| 44 |
33 // Touch support for the display. | 45 // Touch support for the display. |
34 enum TouchSupport { | 46 enum TouchSupport { |
35 TOUCH_SUPPORT_UNKNOWN, | 47 TOUCH_SUPPORT_UNKNOWN, |
36 TOUCH_SUPPORT_AVAILABLE, | 48 TOUCH_SUPPORT_AVAILABLE, |
37 TOUCH_SUPPORT_UNAVAILABLE, | 49 TOUCH_SUPPORT_UNAVAILABLE, |
38 }; | 50 }; |
39 | 51 |
40 // Creates a display with kInvalidDisplayID as default. | 52 // Creates a display with kInvalidDisplayID as default. |
41 Display(); | 53 Display(); |
42 explicit Display(int64 id); | 54 explicit Display(int64 id); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 Rect bounds_; | 141 Rect bounds_; |
130 Rect work_area_; | 142 Rect work_area_; |
131 float device_scale_factor_; | 143 float device_scale_factor_; |
132 Rotation rotation_; | 144 Rotation rotation_; |
133 TouchSupport touch_support_; | 145 TouchSupport touch_support_; |
134 }; | 146 }; |
135 | 147 |
136 } // namespace gfx | 148 } // namespace gfx |
137 | 149 |
138 #endif // UI_GFX_DISPLAY_H_ | 150 #endif // UI_GFX_DISPLAY_H_ |
OLD | NEW |