#ifndef UI_DISPLAY_WIN_DISPLAY_INFO_H_
#define UI_DISPLAY_WIN_DISPLAY_INFO_H_
#include <windows.h>
#include <stdint.h>
#include <optional>
#include "ui/display/display.h"
#include "ui/display/display_export.h"
namespace display::win::internal {
class DISPLAY_EXPORT DisplayInfo final {
public:
DisplayInfo(std::optional<HMONITOR> hmonitor,
const MONITORINFOEX& monitor_info,
float device_scale_factor,
float sdr_white_level,
Display::Rotation rotation,
float display_frequency,
const gfx::Vector2dF& pixels_per_inch,
DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY output_technology,
const std::string& label);
DisplayInfo(int64_t id,
const MONITORINFOEX& monitor_info,
float device_scale_factor,
float sdr_white_level,
Display::Rotation rotation,
float display_frequency,
const gfx::Vector2dF& pixels_per_inch,
DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY output_technology,
const std::string& label);
DisplayInfo(const DisplayInfo& other);
~DisplayInfo();
static int64_t DisplayIdFromMonitorInfo(const MONITORINFOEX& monitor);
int64_t id() const { return id_; }
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_; }
float sdr_white_level() const { return sdr_white_level_; }
Display::Rotation rotation() const { return rotation_; }
float display_frequency() const { return display_frequency_; }
const gfx::Vector2dF& pixels_per_inch() const { return pixels_per_inch_; }
DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY output_technology() const {
return output_technology_;
}
const std::string& label() const { return label_; }
const std::wstring& device_name() const { return device_name_; }
const std::optional<HMONITOR>& hmonitor() const { return hmonitor_; }
bool operator==(const DisplayInfo& rhs) const;
private:
int64_t id_;
gfx::Rect screen_rect_;
gfx::Rect screen_work_rect_;
float device_scale_factor_;
float sdr_white_level_;
Display::Rotation rotation_;
float display_frequency_;
gfx::Vector2dF pixels_per_inch_;
DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY output_technology_;
std::string label_;
std::wstring device_name_;
std::optional<HMONITOR> hmonitor_;
};
}
#endif