AdaptiveBrightness/AdaptiveBrightness/monitor.hpp

50 lines
856 B
C++

#pragma once
#ifdef _MSC_VER
#include <string>
#include <vector>
#include <physicalmonitorenumerationapi.h>
#include <windows.h>
namespace detail {
extern BOOL enumMonitorsCallback(HMONITOR, HDC, LPRECT, LPARAM);
} // namespace detail
class Monitor {
public:
Monitor() = delete;
~Monitor();
private:
struct PhysicalMonitor {
PhysicalMonitor(HANDLE handle, const WCHAR* name) : handle(handle), name(name) {}
HANDLE handle;
std::wstring name;
};
friend BOOL detail::enumMonitorsCallback(HMONITOR, HDC, LPRECT, LPARAM);
Monitor(HMONITOR hMonitor, PHYSICAL_MONITOR physicalMonitor);
const HMONITOR m_hMonitor;
const PhysicalMonitor m_physicalMonitor;
};
#endif
#if defined(__clang__) || defined(__GNUC__)
class Monitor {
public:
Monitor();
private:
};
#endif