Index: monitor_reconfigure_main.h |
diff --git a/monitor_reconfigure_main.h b/monitor_reconfigure_main.h |
index 3aa17d0a1be923c8d80797c44904d28413ee0a3f..aeac10f90afad7094fd3ef082284b845d9f38db5 100644 |
--- a/monitor_reconfigure_main.h |
+++ b/monitor_reconfigure_main.h |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -12,6 +12,8 @@ |
#include <X11/Xlib.h> |
#include <X11/extensions/Xrandr.h> |
+#include "monitor_reconfig/resolution_selector.h" |
+ |
namespace monitor_reconfig { |
// MonitorReconfigureMain is the class responsible for setting the external |
@@ -32,38 +34,10 @@ class MonitorReconfigureMain { |
// Returns whether an external monitor is connected |
bool IsExternalMonitorConnected(); |
- // Comparator used by SortModeByResolution(). |
- // Returns true if |mode_a| has more pixels than |mode_b| and false otherwise. |
- class ModeResolutionComparator { |
- public: |
- bool operator()(XRRModeInfo* mode_a, XRRModeInfo* mode_b) const { |
- return mode_a->width * mode_a->height > mode_b->width * mode_b->height; |
- } |
- }; |
- |
// Sorts |output_info|'s modes by decreasing number of pixels, storing the |
// results in |modes_out|. |
void SortModesByResolution(const XRROutputInfo& output_info, |
- std::vector<XRRModeInfo*>* modes_out); |
- |
- // Find resolutions to use. |
- bool FindBestResolutions( |
- std::string* lcd_resolution, |
- std::string* external_resolution, |
- std::string* screen_resolution); |
- |
- // Find resolutions to use that are reasonably close together. |
- // |larger_device_modes| and |smaller_device_modes| should be sorted by |
- // descending resolution. We choose the highest resolution from |
- // |smaller_device_modes| and the lowest resolution from |larger_device_modes| |
- // that's at least as high as the resolution from the smaller device. |
- // |screen_resolution| gets set to |smaller_resolution| to avoid clipping. |
- bool FindNearestResolutions( |
- const std::vector<XRRModeInfo*>& larger_device_modes, |
- const std::vector<XRRModeInfo*>& smaller_device_modes, |
- std::string* larger_resolution, |
- std::string* smaller_resolution, |
- std::string* screen_resolution); |
+ std::vector<ResolutionSelector::Mode>* modes_out); |
// Set the resolution for a particular display or for the screen. |
bool SetDeviceResolution(const std::string& device_name, |