| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "monitor_reconfig/monitor_reconfigure_main.h" | 5 #include "monitor_reconfig/monitor_reconfigure_main.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cstdio> | 8 #include <cstdio> |
| 9 #include <cstdlib> | 9 #include <cstdlib> |
| 10 | 10 |
| 11 #include "base/command_line.h" |
| 11 #include "base/logging.h" | 12 #include "base/logging.h" |
| 12 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 13 | 14 |
| 14 using std::map; | 15 using std::map; |
| 15 using std::sort; | 16 using std::sort; |
| 16 using std::string; | 17 using std::string; |
| 17 using std::vector; | 18 using std::vector; |
| 18 | 19 |
| 19 namespace monitor_reconfig { | 20 namespace monitor_reconfig { |
| 20 | 21 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 bool MonitorReconfigureMain::SetScreenResolution( | 118 bool MonitorReconfigureMain::SetScreenResolution( |
| 118 const std::string& resolution) { | 119 const std::string& resolution) { |
| 119 string command = StringPrintf("xrandr --fb %s", resolution.c_str()); | 120 string command = StringPrintf("xrandr --fb %s", resolution.c_str()); |
| 120 LOG(INFO) << "Running " << command.c_str(); | 121 LOG(INFO) << "Running " << command.c_str(); |
| 121 return system(command.c_str()) == 0; | 122 return system(command.c_str()) == 0; |
| 122 } | 123 } |
| 123 | 124 |
| 124 } // end namespace monitor_reconfig | 125 } // end namespace monitor_reconfig |
| 125 | 126 |
| 126 int main(int argc, char** argv) { | 127 int main(int argc, char** argv) { |
| 128 CommandLine::Init(argc, argv); |
| 127 logging::InitLogging(NULL, | 129 logging::InitLogging(NULL, |
| 128 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, | 130 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, |
| 129 logging::DONT_LOCK_LOG_FILE, | 131 logging::DONT_LOCK_LOG_FILE, |
| 130 logging::APPEND_TO_OLD_LOG_FILE); | 132 logging::APPEND_TO_OLD_LOG_FILE); |
| 131 Display* display = XOpenDisplay(NULL); | 133 Display* display = XOpenDisplay(NULL); |
| 132 CHECK(display) << "Could not open display"; | 134 CHECK(display) << "Could not open display"; |
| 133 | 135 |
| 134 Window window = RootWindow(display, DefaultScreen(display)); | 136 Window window = RootWindow(display, DefaultScreen(display)); |
| 135 XRRScreenResources* screen_info = XRRGetScreenResources(display, window); | 137 XRRScreenResources* screen_info = XRRGetScreenResources(display, window); |
| 136 monitor_reconfig::MonitorReconfigureMain main_app(display, screen_info); | 138 monitor_reconfig::MonitorReconfigureMain main_app(display, screen_info); |
| 137 main_app.Run(); | 139 main_app.Run(); |
| 138 return 0; | 140 return 0; |
| 139 } | 141 } |
| OLD | NEW |