diff options
| author | Chris Bessent <lost.dragonist@gmail.com> | 2020-01-06 05:17:01 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-06 05:17:01 -0700 |
| commit | dfa600996c49c1b23dca884c963dc917bd9cfc0a (patch) | |
| tree | c6def4277cc962822d0dcde71fa9148e050f693f /src/envmetrics.h | |
| parent | e69078e2399a88bda7bb9ffae7a3d57db9a4e9cf (diff) | |
| parent | d1a788dfad341b32235abc25c2ba1645f8be1ace (diff) | |
Merge pull request #954 from ModOrganizer2/Develop
Stage for release 2.2.2
Diffstat (limited to 'src/envmetrics.h')
| -rw-r--r-- | src/envmetrics.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/envmetrics.h b/src/envmetrics.h new file mode 100644 index 00000000..8dfdb087 --- /dev/null +++ b/src/envmetrics.h @@ -0,0 +1,81 @@ +#ifndef ENV_METRICS_H +#define ENV_METRICS_H + +#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; + + // full resolution + // + QRect desktopGeometry() const; + +private: + std::vector<Display> m_displays; + + void getDisplays(); +}; + +} // namespace + +#endif // ENV_METRICS_H |
