Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ui / display / chromeos / x11 / display_snapshot_x11.h
blob95d75e85debf7e5d40f4a3edc2667226a023743f
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_DISPLAY_CHROMEOS_X11_DISPLAY_SNAPSHOT_X11_H_
6 #define UI_DISPLAY_CHROMEOS_X11_DISPLAY_SNAPSHOT_X11_H_
8 #include "ui/display/display_export.h"
9 #include "ui/display/types/display_snapshot.h"
11 // Forward declare from Xlib and Xrandr.
12 typedef unsigned long XID;
13 typedef XID RROutput;
14 typedef XID RRCrtc;
16 namespace ui {
18 class DISPLAY_EXPORT DisplaySnapshotX11 : public DisplaySnapshot {
19 public:
20 DisplaySnapshotX11(int64_t display_id,
21 const gfx::Point& origin,
22 const gfx::Size& physical_size,
23 DisplayConnectionType type,
24 bool is_aspect_preserving_scaling,
25 bool has_overscan,
26 std::string display_name,
27 const std::vector<const DisplayMode*>& modes,
28 const DisplayMode* current_mode,
29 const DisplayMode* native_mode,
30 RROutput output,
31 RRCrtc crtc,
32 int index);
33 ~DisplaySnapshotX11() override;
35 RROutput output() const { return output_; }
36 RRCrtc crtc() const { return crtc_; }
37 int index() const { return index_; }
39 // DisplaySnapshot overrides:
40 std::string ToString() const override;
42 private:
43 RROutput output_;
45 // CRTC that should be used for this output. Not necessarily the CRTC
46 // that XRandR reports is currently being used.
47 RRCrtc crtc_;
49 // This output's index in the array returned by XRandR. Stable even as
50 // outputs are connected or disconnected.
51 int index_;
53 DISALLOW_COPY_AND_ASSIGN(DisplaySnapshotX11);
56 } // namespace ui
58 #endif // UI_DISPLAY_CHROMEOS_X11_DISPLAY_SNAPSHOT_X11_H_