| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROMEOS_OUTPUT_CONFIGURATOR_H_ | 5 #ifndef UI_DISPLAY_CHROMEOS_OUTPUT_CONFIGURATOR_H_ |
| 6 #define UI_DISPLAY_CHROMEOS_OUTPUT_CONFIGURATOR_H_ | 6 #define UI_DISPLAY_CHROMEOS_OUTPUT_CONFIGURATOR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 CoordinateTransformation(); | 40 CoordinateTransformation(); |
| 41 | 41 |
| 42 float x_scale; | 42 float x_scale; |
| 43 float x_offset; | 43 float x_offset; |
| 44 float y_scale; | 44 float y_scale; |
| 45 float y_offset; | 45 float y_offset; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 struct DisplayState { | 48 struct DisplayState { |
| 49 DisplayState(); | 49 DisplayState(); |
| 50 ~DisplayState(); | |
| 51 | 50 |
| 52 DisplaySnapshot* display; // Not owned. | 51 DisplaySnapshot* display; // Not owned. |
| 53 | 52 |
| 54 // XInput device ID or 0 if this output isn't a touchscreen. | 53 // XInput device ID or 0 if this output isn't a touchscreen. |
| 55 int touch_device_id; | 54 int touch_device_id; |
| 56 | 55 |
| 57 CoordinateTransformation transform; | 56 CoordinateTransformation transform; |
| 58 | 57 |
| 59 // User-selected mode for the output. | 58 // User-selected mode for the output. |
| 60 const DisplayMode* selected_mode; | 59 const DisplayMode* selected_mode; |
| 61 | 60 |
| 62 // Mode used when displaying the same desktop on multiple outputs. | 61 // Mode used when displaying the same desktop on multiple outputs. |
| 63 const DisplayMode* mirror_mode; | 62 const DisplayMode* mirror_mode; |
| 64 | |
| 65 std::vector<ui::ColorCalibrationProfile> available_color_profiles; | |
| 66 }; | 63 }; |
| 67 | 64 |
| 68 typedef std::vector<DisplayState> DisplayStateList; | 65 typedef std::vector<DisplayState> DisplayStateList; |
| 69 | 66 |
| 70 class Observer { | 67 class Observer { |
| 71 public: | 68 public: |
| 72 virtual ~Observer() {} | 69 virtual ~Observer() {} |
| 73 | 70 |
| 74 // Called after the display mode has been changed. |output| contains the | 71 // Called after the display mode has been changed. |output| contains the |
| 75 // just-applied configuration. Note that the X server is no longer grabbed | 72 // just-applied configuration. Note that the X server is no longer grabbed |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 uint32_t* protection_mask); | 252 uint32_t* protection_mask); |
| 256 | 253 |
| 257 // Requests the desired protection methods. | 254 // Requests the desired protection methods. |
| 258 // |protection_mask| is the desired protection methods, which is a bitmask | 255 // |protection_mask| is the desired protection methods, which is a bitmask |
| 259 // of the OutputProtectionMethod values. | 256 // of the OutputProtectionMethod values. |
| 260 // Returns true when the protection request has been made. | 257 // Returns true when the protection request has been made. |
| 261 bool EnableOutputProtection(OutputProtectionClientId client_id, | 258 bool EnableOutputProtection(OutputProtectionClientId client_id, |
| 262 int64 display_id, | 259 int64 display_id, |
| 263 uint32_t desired_protection_mask); | 260 uint32_t desired_protection_mask); |
| 264 | 261 |
| 262 // Checks the available color profiles for |display_id| and fills the result |
| 263 // into |profiles|. |
| 264 void GetAvailableColorCalibrationProfiles( |
| 265 int64 display_id, |
| 266 std::vector<ui::ColorCalibrationProfile>* profiles); |
| 267 |
| 265 // Updates the color calibration to |new_profile|. | 268 // Updates the color calibration to |new_profile|. |
| 266 bool SetColorCalibrationProfile( | 269 bool SetColorCalibrationProfile( |
| 267 int64 display_id, | 270 int64 display_id, |
| 268 ui::ColorCalibrationProfile new_profile); | 271 ui::ColorCalibrationProfile new_profile); |
| 269 | 272 |
| 270 private: | 273 private: |
| 271 // Mapping a display_id to a protection request bitmask. | 274 // Mapping a display_id to a protection request bitmask. |
| 272 typedef std::map<int64, uint32_t> DisplayProtections; | 275 typedef std::map<int64, uint32_t> DisplayProtections; |
| 273 // Mapping a client to its protection request. | 276 // Mapping a client to its protection request. |
| 274 typedef std::map<OutputProtectionClientId, DisplayProtections> | 277 typedef std::map<OutputProtectionClientId, DisplayProtections> |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 391 |
| 389 // Output protection requests of each client. | 392 // Output protection requests of each client. |
| 390 ProtectionRequests client_protection_requests_; | 393 ProtectionRequests client_protection_requests_; |
| 391 | 394 |
| 392 DISALLOW_COPY_AND_ASSIGN(OutputConfigurator); | 395 DISALLOW_COPY_AND_ASSIGN(OutputConfigurator); |
| 393 }; | 396 }; |
| 394 | 397 |
| 395 } // namespace ui | 398 } // namespace ui |
| 396 | 399 |
| 397 #endif // UI_DISPLAY_CHROMEOS_OUTPUT_CONFIGURATOR_H_ | 400 #endif // UI_DISPLAY_CHROMEOS_OUTPUT_CONFIGURATOR_H_ |
| OLD | NEW |