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/gfx_export.h" | 10 #include "ui/gfx/gfx_export.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 // Touch support for the display. |
| 34 enum TouchSupport { |
| 35 TOUCH_SUPPORT_UNKNOWN, |
| 36 TOUCH_SUPPORT_AVAILABLE, |
| 37 TOUCH_SUPPORT_UNAVAILABLE, |
| 38 }; |
| 39 |
33 // Creates a display with kInvalidDisplayID as default. | 40 // Creates a display with kInvalidDisplayID as default. |
34 Display(); | 41 Display(); |
35 explicit Display(int64 id); | 42 explicit Display(int64 id); |
36 Display(int64 id, const Rect& bounds); | 43 Display(int64 id, const Rect& bounds); |
37 ~Display(); | 44 ~Display(); |
38 | 45 |
39 // Returns the forced device scale factor, which is given by | 46 // Returns the forced device scale factor, which is given by |
40 // "--force-device-scale-factor". | 47 // "--force-device-scale-factor". |
41 static float GetForcedDeviceScaleFactor(); | 48 static float GetForcedDeviceScaleFactor(); |
42 | 49 |
(...skipping 17 matching lines...) Expand all Loading... |
60 // Output device's pixel scale factor. This specifies how much the | 67 // Output device's pixel scale factor. This specifies how much the |
61 // UI should be scaled when the actual output has more pixels than | 68 // UI should be scaled when the actual output has more pixels than |
62 // standard displays (which is around 100~120dpi.) The potential return | 69 // standard displays (which is around 100~120dpi.) The potential return |
63 // values depend on each platforms. | 70 // values depend on each platforms. |
64 float device_scale_factor() const { return device_scale_factor_; } | 71 float device_scale_factor() const { return device_scale_factor_; } |
65 void set_device_scale_factor(float scale) { device_scale_factor_ = scale; } | 72 void set_device_scale_factor(float scale) { device_scale_factor_ = scale; } |
66 | 73 |
67 Rotation rotation() const { return rotation_; } | 74 Rotation rotation() const { return rotation_; } |
68 void set_rotation(Rotation rotation) { rotation_ = rotation; } | 75 void set_rotation(Rotation rotation) { rotation_ = rotation; } |
69 | 76 |
| 77 TouchSupport touch_support() const { return touch_support_; } |
| 78 void set_touch_support(TouchSupport support) { touch_support_ = support; } |
| 79 |
70 // Utility functions that just return the size of display and | 80 // Utility functions that just return the size of display and |
71 // work area. | 81 // work area. |
72 const Size& size() const { return bounds_.size(); } | 82 const Size& size() const { return bounds_.size(); } |
73 const Size& work_area_size() const { return work_area_.size(); } | 83 const Size& work_area_size() const { return work_area_.size(); } |
74 | 84 |
75 // Returns the work area insets. | 85 // Returns the work area insets. |
76 Insets GetWorkAreaInsets() const; | 86 Insets GetWorkAreaInsets() const; |
77 | 87 |
78 // Sets the device scale factor and display bounds in pixel. This | 88 // Sets the device scale factor and display bounds in pixel. This |
79 // updates the work are using the same insets between old bounds and | 89 // updates the work are using the same insets between old bounds and |
(...skipping 26 matching lines...) Expand all Loading... |
106 static void SetInternalDisplayId(int64 internal_display_id); | 116 static void SetInternalDisplayId(int64 internal_display_id); |
107 | 117 |
108 static const int64 kInvalidDisplayID; | 118 static const int64 kInvalidDisplayID; |
109 | 119 |
110 private: | 120 private: |
111 int64 id_; | 121 int64 id_; |
112 Rect bounds_; | 122 Rect bounds_; |
113 Rect work_area_; | 123 Rect work_area_; |
114 float device_scale_factor_; | 124 float device_scale_factor_; |
115 Rotation rotation_; | 125 Rotation rotation_; |
| 126 TouchSupport touch_support_; |
116 }; | 127 }; |
117 | 128 |
118 } // namespace gfx | 129 } // namespace gfx |
119 | 130 |
120 #endif // UI_GFX_DISPLAY_H_ | 131 #endif // UI_GFX_DISPLAY_H_ |
OLD | NEW |