Index: resolution_selector.h |
diff --git a/resolution_selector.h b/resolution_selector.h |
index e2920902020876da559aab372434809235ad867d..54e69bec715d2f681d58212ab2fda4729169d6cb 100644 |
--- a/resolution_selector.h |
+++ b/resolution_selector.h |
@@ -20,12 +20,19 @@ class ResolutionSelector { |
// A single mode supported by a device, equivalent to the XRRModeInfo |
// struct. |
struct Mode { |
- Mode(int width, int height, std::string name) |
+ Mode(int width, int height, std::string name, int id) |
: width(width), |
height(height), |
- name(name) { |
+ name(name), |
+ id(id) { |
} |
+ Mode() |
+ : width(0), |
+ height(0), |
+ name(""), |
+ id(0) { |
+ } |
// Mode's dimensions. |
int width; |
int height; |
@@ -33,6 +40,9 @@ class ResolutionSelector { |
// Mode's name from XRandR. This uniquely describes the mode and can |
// be used to set the devices's resolution later. |
std::string name; |
+ |
+ // The mode id, used for setting this mode. |
+ unsigned id; |
}; |
// Maximum screen size for the external output at which we assume that |
@@ -55,13 +65,13 @@ class ResolutionSelector { |
}; |
// Find the "best" resolutions for various outputs. |
- // The returned strings contain |name| values from the passed-in modes. |
+ // Returns the modes for both screens and the total screen resolution. |
bool FindBestResolutions( |
const std::vector<Mode>& lcd_modes, |
const std::vector<Mode>& external_modes, |
- std::string* lcd_resolution, |
- std::string* external_resolution, |
- std::string* screen_resolution); |
+ Mode* lcd_resolution, |
+ Mode* external_resolution, |
+ Mode* screen_resolution); |
private: |
// Find resolutions to use that are reasonably close together. |
@@ -73,9 +83,9 @@ class ResolutionSelector { |
bool FindNearestResolutions( |
const std::vector<Mode>& larger_device_modes, |
const std::vector<Mode>& smaller_device_modes, |
- std::string* larger_resolution, |
- std::string* smaller_resolution, |
- std::string* screen_resolution); |
+ Mode* larger_resolution, |
+ Mode* smaller_resolution, |
+ Mode* screen_resolution); |
DISALLOW_COPY_AND_ASSIGN(ResolutionSelector); |
}; |