summaryrefslogtreecommitdiff
path: root/chromium/ui/display/manager/chromeos/x11/display_snapshot_x11.h
blob: 58d464405c7b08f472098ab739939b88d6911aaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_DISPLAY_MANAGER_CHROMEOS_X11_DISPLAY_SNAPSHOT_X11_H_
#define UI_DISPLAY_MANAGER_CHROMEOS_X11_DISPLAY_SNAPSHOT_X11_H_

#include <stdint.h>

#include "base/macros.h"
#include "ui/display/manager/display_manager_export.h"
#include "ui/display/types/display_snapshot.h"

// Forward declare from Xlib and Xrandr.
typedef unsigned long XID;
typedef XID RROutput;
typedef XID RRCrtc;

namespace display {

class DISPLAY_MANAGER_EXPORT DisplaySnapshotX11 : public DisplaySnapshot {
 public:
  DisplaySnapshotX11(int64_t display_id,
                     const gfx::Point& origin,
                     const gfx::Size& physical_size,
                     DisplayConnectionType type,
                     bool is_aspect_preserving_scaling,
                     bool has_overscan,
                     std::string display_name,
                     std::vector<std::unique_ptr<const DisplayMode>> modes,
                     const std::vector<uint8_t>& edid,
                     const DisplayMode* current_mode,
                     const DisplayMode* native_mode,
                     RROutput output,
                     RRCrtc crtc,
                     int index);
  ~DisplaySnapshotX11() override;

  RROutput output() const { return output_; }
  RRCrtc crtc() const { return crtc_; }
  int index() const { return index_; }

  // DisplaySnapshot overrides:
  std::string ToString() const override;

 private:
  RROutput output_;

  // CRTC that should be used for this output. Not necessarily the CRTC
  // that XRandR reports is currently being used.
  RRCrtc crtc_;

  // This output's index in the array returned by XRandR. Stable even as
  // outputs are connected or disconnected.
  int index_;

  DISALLOW_COPY_AND_ASSIGN(DisplaySnapshotX11);
};

}  // namespace display

#endif  // UI_DISPLAY_MANAGER_CHROMEOS_X11_DISPLAY_SNAPSHOT_X11_H_