| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 "remoting/host/desktop_resizer.h" | 5 #include "remoting/host/desktop_resizer.h" |
| 6 #include "remoting/host/linux/x11_util.h" | 6 #include "remoting/host/linux/x11_util.h" |
| 7 | 7 |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 #include <X11/extensions/Xrandr.h> | 9 #include <X11/extensions/Xrandr.h> |
| 10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 XRRScreenResources* get() { return resources_; } | 117 XRRScreenResources* get() { return resources_; } |
| 118 | 118 |
| 119 private: | 119 private: |
| 120 XRRScreenResources* resources_; | 120 XRRScreenResources* resources_; |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 | 123 |
| 124 class DesktopResizerLinux : public DesktopResizer { | 124 class DesktopResizerLinux : public DesktopResizer { |
| 125 public: | 125 public: |
| 126 DesktopResizerLinux(); | 126 DesktopResizerLinux(); |
| 127 virtual ~DesktopResizerLinux(); | 127 ~DesktopResizerLinux() override; |
| 128 | 128 |
| 129 // DesktopResizer interface | 129 // DesktopResizer interface |
| 130 virtual ScreenResolution GetCurrentResolution() override; | 130 ScreenResolution GetCurrentResolution() override; |
| 131 virtual std::list<ScreenResolution> GetSupportedResolutions( | 131 std::list<ScreenResolution> GetSupportedResolutions( |
| 132 const ScreenResolution& preferred) override; | 132 const ScreenResolution& preferred) override; |
| 133 virtual void SetResolution(const ScreenResolution& resolution) override; | 133 void SetResolution(const ScreenResolution& resolution) override; |
| 134 virtual void RestoreResolution(const ScreenResolution& original) override; | 134 void RestoreResolution(const ScreenResolution& original) override; |
| 135 | 135 |
| 136 private: | 136 private: |
| 137 // Create a mode, and attach it to the primary output. If the mode already | 137 // Create a mode, and attach it to the primary output. If the mode already |
| 138 // exists, it is left unchanged. | 138 // exists, it is left unchanged. |
| 139 void CreateMode(const char* name, int width, int height); | 139 void CreateMode(const char* name, int width, int height); |
| 140 | 140 |
| 141 // Remove the specified mode from the primary output, and delete it. If the | 141 // Remove the specified mode from the primary output, and delete it. If the |
| 142 // mode is in use, it is not deleted. | 142 // mode is in use, it is not deleted. |
| 143 void DeleteMode(const char* name); | 143 void DeleteMode(const char* name); |
| 144 | 144 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 } | 321 } |
| 322 XRRSetCrtcConfig(display_, resources_.get(), resources_.GetCrtc(), | 322 XRRSetCrtcConfig(display_, resources_.get(), resources_.GetCrtc(), |
| 323 CurrentTime, 0, 0, mode_id, 1, outputs, number_of_outputs); | 323 CurrentTime, 0, 0, mode_id, 1, outputs, number_of_outputs); |
| 324 } | 324 } |
| 325 | 325 |
| 326 scoped_ptr<DesktopResizer> DesktopResizer::Create() { | 326 scoped_ptr<DesktopResizer> DesktopResizer::Create() { |
| 327 return make_scoped_ptr(new DesktopResizerLinux); | 327 return make_scoped_ptr(new DesktopResizerLinux); |
| 328 } | 328 } |
| 329 | 329 |
| 330 } // namespace remoting | 330 } // namespace remoting |
| OLD | NEW |