Index: resolution_selector.h |
diff --git a/resolution_selector.h b/resolution_selector.h |
index e2920902020876da559aab372434809235ad867d..436a433f11c3b25a9fb597c367f73d8fa5a23472 100644 |
--- a/resolution_selector.h |
+++ b/resolution_selector.h |
@@ -20,10 +20,11 @@ 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 = 0, int height = 0, std::string name = "", int id = 0) |
Daniel Erat
2011/03/24 23:02:11
the style guide doesn't allow default arguments: h
|
: width(width), |
height(height), |
- name(name) { |
+ name(name), |
+ id(id) { |
} |
// Mode's dimensions. |
@@ -33,6 +34,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 |
@@ -59,9 +63,9 @@ class ResolutionSelector { |
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 +77,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); |
}; |