Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2412)

Unified Diff: monitor_reconfigure_main.h

Issue 6732013: Refactor monitor_reconfigure to stop using system("xrandr"). (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/monitor_reconfig.git@master
Patch Set: Fix comment Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | monitor_reconfigure_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | monitor_reconfigure_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698