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 CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ | 5 #ifndef CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ |
6 #define CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ | 6 #define CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/event_types.h" | 9 #include "base/event_types.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 STATE_DUAL_PRIMARY_ONLY, | 33 STATE_DUAL_PRIMARY_ONLY, |
34 STATE_DUAL_SECONDARY_ONLY, | 34 STATE_DUAL_SECONDARY_ONLY, |
35 }; | 35 }; |
36 | 36 |
37 // This class interacts directly with the underlying Xrandr API to manipulate | 37 // This class interacts directly with the underlying Xrandr API to manipulate |
38 // CTRCs and Outputs. It will likely grow more state, over time, or expose | 38 // CTRCs and Outputs. It will likely grow more state, over time, or expose |
39 // Output info in other ways as more of the Chrome display code grows up around | 39 // Output info in other ways as more of the Chrome display code grows up around |
40 // it. | 40 // it. |
41 class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher { | 41 class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher { |
42 public: | 42 public: |
43 OutputConfigurator(); | 43 explicit OutputConfigurator(bool is_extended_display_enabled); |
44 virtual ~OutputConfigurator(); | 44 virtual ~OutputConfigurator(); |
45 | 45 |
46 OutputState output_state() const { return output_state_; } | 46 OutputState output_state() const { return output_state_; } |
47 | 47 |
48 // Called when the user hits ctrl-F4 to request a display mode change. | 48 // Called when the user hits ctrl-F4 to request a display mode change. |
49 // This method should only return false if it was called in a single-head or | 49 // This method should only return false if it was called in a single-head or |
50 // headless mode. | 50 // headless mode. |
51 bool CycleDisplayMode(bool extended_desktop_enabled); | 51 bool CycleDisplayMode(); |
52 | 52 |
53 // Called when powerd notifies us that some set of displays should be turned | 53 // Called when powerd notifies us that some set of displays should be turned |
54 // on or off. This requires enabling or disabling the CRTC associated with | 54 // on or off. This requires enabling or disabling the CRTC associated with |
55 // the display(s) in question so that the low power state is engaged. | 55 // the display(s) in question so that the low power state is engaged. |
56 bool ScreenPowerSet(bool power_on, bool all_displays); | 56 bool ScreenPowerSet(bool power_on, bool all_displays); |
57 | 57 |
58 // Force switching the display mode to |new_state|. This method is used when | 58 // Force switching the display mode to |new_state|. This method is used when |
59 // the user explicitly changes the display mode in the options UI. Returns | 59 // the user explicitly changes the display mode in the options UI. Returns |
60 // false if it was called in a single-head or headless mode. | 60 // false if it was called in a single-head or headless mode. |
61 bool SetDisplayMode(OutputState new_state); | 61 bool SetDisplayMode(OutputState new_state); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 // with the result. | 124 // with the result. |
125 void CheckIsProjectingAndNotify(); | 125 void CheckIsProjectingAndNotify(); |
126 | 126 |
127 // This is detected by the constructor to determine whether or not we should | 127 // This is detected by the constructor to determine whether or not we should |
128 // be enabled. If we aren't running on ChromeOS, we can't assume that the | 128 // be enabled. If we aren't running on ChromeOS, we can't assume that the |
129 // Xrandr X11 extension is supported. | 129 // Xrandr X11 extension is supported. |
130 // If this flag is set to false, any attempts to change the output | 130 // If this flag is set to false, any attempts to change the output |
131 // configuration to immediately fail without changing the state. | 131 // configuration to immediately fail without changing the state. |
132 bool is_running_on_chrome_os_; | 132 bool is_running_on_chrome_os_; |
133 | 133 |
134 // Set to true if the extended display flag is enabled. | |
135 bool is_extended_display_enabled_; | |
sky
2012/07/31 23:42:19
const
| |
136 | |
134 // The number of outputs in the output_cache_ array. | 137 // The number of outputs in the output_cache_ array. |
135 int output_count_; | 138 int output_count_; |
136 | 139 |
137 // The list of cached output descriptions (|output_count_| elements long). | 140 // The list of cached output descriptions (|output_count_| elements long). |
138 scoped_array<CachedOutputDescription> output_cache_; | 141 scoped_array<CachedOutputDescription> output_cache_; |
139 | 142 |
140 // True if |output_cache_| describes a permutation of outputs which support a | 143 // True if |output_cache_| describes a permutation of outputs which support a |
141 // mirrored device mode. | 144 // mirrored device mode. |
142 bool mirror_supported_; | 145 bool mirror_supported_; |
143 | 146 |
(...skipping 13 matching lines...) Expand all Loading... | |
157 // The display state as derived from the outputs observed in |output_cache_|. | 160 // The display state as derived from the outputs observed in |output_cache_|. |
158 // This is used for rotating display modes. | 161 // This is used for rotating display modes. |
159 OutputState output_state_; | 162 OutputState output_state_; |
160 | 163 |
161 DISALLOW_COPY_AND_ASSIGN(OutputConfigurator); | 164 DISALLOW_COPY_AND_ASSIGN(OutputConfigurator); |
162 }; | 165 }; |
163 | 166 |
164 } // namespace chromeos | 167 } // namespace chromeos |
165 | 168 |
166 #endif // CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ | 169 #endif // CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ |
OLD | NEW |