summaryrefslogtreecommitdiff
path: root/chromium/ui/display/win/display_info.h
blob: 3cc6046b205eb64214813ffdd9b96c2d0dfedbf9 (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
// Copyright 2016 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_WIN_DISPLAY_INFO_H_
#define UI_DISPLAY_WIN_DISPLAY_INFO_H_

#include <windows.h>
#include <stdint.h>

#include "ui/display/display.h"
#include "ui/display/display_export.h"

namespace display {
namespace win {

// Gathers the parameters necessary to create a win::ScreenWinDisplay.
class DISPLAY_EXPORT DisplayInfo final {
 public:
  DisplayInfo(const MONITORINFOEX& monitor_info, float device_scale_factor);
  DisplayInfo(const MONITORINFOEX& monitor_info,
              float device_scale_factor,
              Display::Rotation rotation);

  static int64_t DeviceIdFromDeviceName(const wchar_t* device_name);

  int64_t id() const { return id_; }
  Display::Rotation rotation() const { return rotation_; }
  const gfx::Rect& screen_rect() const { return screen_rect_; }
  const gfx::Rect& screen_work_rect() const { return screen_work_rect_; }
  float device_scale_factor() const { return device_scale_factor_; }

 private:
  int64_t id_;
  Display::Rotation rotation_;
  gfx::Rect screen_rect_;
  gfx::Rect screen_work_rect_;
  float device_scale_factor_;
};

}  // namespace win
}  // namespace display

#endif  // UI_DISPLAY_WIN_DISPLAY_INFO_H_