Index: monitor_reconfigure_main.h |
diff --git a/monitor_reconfigure_main.h b/monitor_reconfigure_main.h |
index d639fb157acd7258e41af543165162a5a51ab322..8a45fe2989bd590ebd6d6fcd77fcfad74fd1a7df 100644 |
--- a/monitor_reconfigure_main.h |
+++ b/monitor_reconfigure_main.h |
@@ -18,43 +18,56 @@ 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 |
+ // |window| is the root window. |
+ MonitorReconfigureMain(Display* display, |
+ Window window, |
+ XRRScreenResources* screen_info); |
+ ~MonitorReconfigureMain() { |
+ XRRFreeOutputInfo(lcd_output_info_); |
+ 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 |