summaryrefslogtreecommitdiff
path: root/src/envmetrics.h
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-07-18 23:52:11 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-07-22 07:33:38 -0400
commitd8760ed8ad688c7e69d2a5be89a8574f4bf44f74 (patch)
tree20e4410c0c38addb87cc511aa1c242b34c728368 /src/envmetrics.h
parentb2a1e1391fdd6bdee1c5e8d337b273447c70a506 (diff)
refactored Metrics and Display, no change in functionality
Diffstat (limited to 'src/envmetrics.h')
-rw-r--r--src/envmetrics.h62
1 files changed, 53 insertions, 9 deletions
diff --git a/src/envmetrics.h b/src/envmetrics.h
index 62fc8c49..bede36fc 100644
--- a/src/envmetrics.h
+++ b/src/envmetrics.h
@@ -4,25 +4,69 @@
namespace env
{
-class Metrics
+// information about a monitor
+//
+class Display
{
public:
- struct Display
- {
- int resX=0, resY=0, dpi=0;
- bool primary=false;
- int refreshRate = 0;
- QString monitor, adapter;
+ 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();
+};
- QString toString() const;
- };
+// 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