diff options
| author | Jeremy Rimpo <jrim@rimpo.org> | 2019-08-02 01:49:33 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-02 01:49:33 -0500 |
| commit | cff526415d781cb8a7761961ae2bd1fb6775c376 (patch) | |
| tree | cf5ff4f0d7bdd3767155a8a3e251201861284f89 /src/envmetrics.h | |
| parent | bdf45aea69ab7df0b01eb87cc80a2641ea4261d0 (diff) | |
| parent | e4cf2c314d6397c5d73bcf567d4420171238bd29 (diff) | |
Merge pull request #807 from isanae/logging-rework
Logging rework
Diffstat (limited to 'src/envmetrics.h')
| -rw-r--r-- | src/envmetrics.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/envmetrics.h b/src/envmetrics.h new file mode 100644 index 00000000..bede36fc --- /dev/null +++ b/src/envmetrics.h @@ -0,0 +1,72 @@ +#include <QString> +#include <vector> + +namespace env +{ + +// information about a monitor +// +class Display +{ +public: + Display(QString adapter, QString monitorDevice, bool primary); + + // display name of the adapter running the monitor + // + const QString& adapter() const; + + // internal device name of the monitor, this is not a display name + // + const QString& monitorDevice() const; + + // whether this monitor is the primary + // + bool primary(); + + // resolution + // + int resX() const; + int resY() const; + + // dpi + // + int dpi(); + + // refresh rate in hz + // + int refreshRate() const; + + // string representation + // + QString toString() const; + +private: + QString m_adapter; + QString m_monitorDevice; + bool m_primary; + int m_resX, m_resY; + int m_dpi; + int m_refreshRate; + + void getSettings(); +}; + + +// holds various information about Windows metrics +// +class Metrics +{ +public: + Metrics(); + + // list of displays on the system + // + const std::vector<Display>& displays() const; + +private: + std::vector<Display> m_displays; + + void getDisplays(); +}; + +} // namespace |
