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_DISPLAY_DISPLAY_H_ | 5 #ifndef UI_DISPLAY_DISPLAY_H_ |
6 #define UI_DISPLAY_DISPLAY_H_ | 6 #define UI_DISPLAY_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" |
11 #include "ui/display/display_export.h" | 11 #include "ui/display/display_export.h" |
12 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
13 #include "ui/gfx/icc_profile.h" | |
14 | 13 |
15 #if !defined(OS_IOS) | 14 #if !defined(OS_IOS) |
16 #include "mojo/public/cpp/bindings/struct_traits.h" // nogncheck | 15 #include "mojo/public/cpp/bindings/struct_traits.h" // nogncheck |
17 #endif | 16 #endif |
18 | 17 |
19 namespace display { | 18 namespace display { |
20 | 19 |
21 #if !defined(OS_IOS) | 20 #if !defined(OS_IOS) |
22 namespace mojom { | 21 namespace mojom { |
23 class DisplayDataView; | 22 class DisplayDataView; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 157 |
159 // True if there is an internal display. | 158 // True if there is an internal display. |
160 static bool HasInternalDisplay(); | 159 static bool HasInternalDisplay(); |
161 | 160 |
162 // Maximum cursor size in native pixels. | 161 // Maximum cursor size in native pixels. |
163 const gfx::Size& maximum_cursor_size() const { return maximum_cursor_size_; } | 162 const gfx::Size& maximum_cursor_size() const { return maximum_cursor_size_; } |
164 void set_maximum_cursor_size(const gfx::Size& size) { | 163 void set_maximum_cursor_size(const gfx::Size& size) { |
165 maximum_cursor_size_ = size; | 164 maximum_cursor_size_ = size; |
166 } | 165 } |
167 | 166 |
168 // The full ICC profile of the display. | |
169 gfx::ICCProfile icc_profile() const { return icc_profile_; } | |
170 void set_icc_profile(const gfx::ICCProfile& icc_profile) { | |
171 icc_profile_ = icc_profile; | |
172 } | |
173 | |
174 // The number of bits per pixel. Used by media query APIs. | |
175 int color_depth() const { return color_depth_; } | 167 int color_depth() const { return color_depth_; } |
176 void set_color_depth(int color_depth) { | 168 void set_color_depth(int color_depth) { |
177 color_depth_ = color_depth; | 169 color_depth_ = color_depth; |
178 } | 170 } |
179 | 171 |
180 // The number of bits per color component (all color components are assumed to | |
181 // have the same number of bits). Used by media query APIs. | |
182 int depth_per_component() const { return depth_per_component_; } | 172 int depth_per_component() const { return depth_per_component_; } |
183 void set_depth_per_component(int depth_per_component) { | 173 void set_depth_per_component(int depth_per_component) { |
184 depth_per_component_ = depth_per_component; | 174 depth_per_component_ = depth_per_component; |
185 } | 175 } |
186 | 176 |
187 // True if this is a monochrome display (e.g, for accessiblity). Used by media | |
188 // query APIs. | |
189 bool is_monochrome() const { return is_monochrome_; } | |
190 void set_is_monochrome(bool is_monochrome) { | |
191 is_monochrome_ = is_monochrome; | |
192 } | |
193 | |
194 private: | 177 private: |
195 int64_t id_; | 178 int64_t id_; |
196 gfx::Rect bounds_; | 179 gfx::Rect bounds_; |
197 gfx::Rect work_area_; | 180 gfx::Rect work_area_; |
198 float device_scale_factor_; | 181 float device_scale_factor_; |
199 Rotation rotation_; | 182 Rotation rotation_; |
200 TouchSupport touch_support_; | 183 TouchSupport touch_support_; |
201 gfx::Size maximum_cursor_size_; | 184 gfx::Size maximum_cursor_size_; |
202 gfx::ICCProfile icc_profile_; | |
203 int color_depth_; | 185 int color_depth_; |
204 int depth_per_component_; | 186 int depth_per_component_; |
205 bool is_monochrome_; | |
206 | 187 |
207 #if !defined(OS_IOS) | 188 #if !defined(OS_IOS) |
208 friend struct mojo::StructTraits<display::mojom::DisplayDataView, | 189 friend struct mojo::StructTraits<display::mojom::DisplayDataView, |
209 display::Display>; | 190 display::Display>; |
210 #endif | 191 #endif |
211 }; | 192 }; |
212 | 193 |
213 } // namespace display | 194 } // namespace display |
214 | 195 |
215 #endif // UI_DISPLAY_DISPLAY_H_ | 196 #endif // UI_DISPLAY_DISPLAY_H_ |
OLD | NEW |