Chromium Code Reviews| Index: monitor_reconfigure_main.h |
| diff --git a/monitor_reconfigure_main.h b/monitor_reconfigure_main.h |
| index d639fb157acd7258e41af543165162a5a51ab322..6a52c8009ab30764b90fae5a7888aa4e2b8ddd9f 100644 |
| --- a/monitor_reconfigure_main.h |
| +++ b/monitor_reconfigure_main.h |
| @@ -18,43 +18,55 @@ namespace monitor_reconfig { |
| // MonitorReconfigureMain is the class responsible for setting the external |
| // monitor to the max resolution based on the modes supported by the native |
| -// monitor and the external monitor |
| +// monitor and the external monitor. |
| class MonitorReconfigureMain { |
| public: |
| - MonitorReconfigureMain(Display* display, XRRScreenResources* screen_info); |
| - virtual ~MonitorReconfigureMain() {} |
| - |
| - // Main entry point |
| + MonitorReconfigureMain(Display* display, |
| + Window window, |
|
Daniel Erat
2011/03/25 03:39:02
can you add a comment about what the 'window' para
marcheu
2011/03/25 17:39:42
Done.
|
| + XRRScreenResources* screen_info); |
| + virtual ~MonitorReconfigureMain() { |
|
Daniel Erat
2011/03/25 03:39:02
not your fault, but mind removing the 'virtual' he
marcheu
2011/03/25 17:39:42
Done.
|
| + XRRFreeOutputInfo(lcd_output_info_); |
|
Daniel Erat
2011/03/25 03:39:02
do you need to check for NULL here first, or is XR
marcheu
2011/03/25 17:39:42
It's just a free() so NULL is a valid parameter.
|
| + XRRFreeOutputInfo(external_output_info_); |
| + } |
| + |
| + // Main entry point. |
| void Run(); |
| private: |
| // Initializes the |lcd_output_| and |external_output_| members. |
| void DetermineOutputs(); |
| - // Returns whether an external monitor is connected |
| + // Returns whether an external monitor is connected. |
| bool IsExternalMonitorConnected(); |
| // Sorts |output_info|'s modes by decreasing number of pixels, storing the |
| // results in |modes_out|. |
| - void SortModesByResolution(const XRROutputInfo& output_info, |
| + void SortModesByResolution(RROutput output, |
| std::vector<ResolutionSelector::Mode>* modes_out); |
| // Set the resolution for a particular device or for the screen. |
| - bool SetDeviceResolution(const std::string& device_name, |
| - const std::string& resolution); |
| - bool SetScreenResolution(const std::string& resolution); |
| + bool SetDeviceResolution(RROutput output, |
| + const XRROutputInfo* output_info, |
| + const ResolutionSelector::Mode& resolution); |
| + bool SetScreenResolution(const ResolutionSelector::Mode& resolution); |
| // Disable output to a device. |
| - bool DisableDevice(const std::string& device_name); |
| + bool DisableDevice(RROutput output, |
| + const XRROutputInfo* output_info); |
| // Mapping between mode XIDs and mode information structures. |
| std::map<int, XRRModeInfo*> mode_map_; |
| - // X Resources needed between functions |
| + // X Resources needed between functions. |
| Display* display_; |
| + Window window_; |
| XRRScreenResources* screen_info_; |
| - XRROutputInfo* lcd_output_; |
| - XRROutputInfo* external_output_; |
| + |
| + RROutput lcd_output_; |
| + XRROutputInfo* lcd_output_info_; |
| + |
| + RROutput external_output_; |
| + XRROutputInfo* external_output_info_; |
| }; |
| } // namespace monitor_reconfig |