diff options
author | Manuel Schneider | 2013-10-18 11:25:12 +0200 |
---|---|---|
committer | Manuel Schneider | 2013-10-18 11:25:12 +0200 |
commit | 9a9ffe7eebf14ea1828480c2e175e4fc39e26dac (patch) | |
tree | 86891f6237e419a35b74f465ec450ffbe9506d7d /src/output.h | |
download | beamergui-9a9ffe7eebf14ea1828480c2e175e4fc39e26dac.tar.gz beamergui-9a9ffe7eebf14ea1828480c2e175e4fc39e26dac.tar.xz beamergui-9a9ffe7eebf14ea1828480c2e175e4fc39e26dac.zip |
[Incomplete] Commit for EDID testsystem
Diffstat (limited to 'src/output.h')
-rw-r--r-- | src/output.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/output.h b/src/output.h new file mode 100644 index 0000000..553444d --- /dev/null +++ b/src/output.h @@ -0,0 +1,47 @@ +#ifndef OUTPUT_H +#define OUTPUT_H + +#include <QDebug> +#include <QSet> + +#include <X11/Xlib.h> +#include <X11/extensions/Xrandr.h> + +typedef struct _Resolution{ + unsigned int width; + unsigned int height; +}Resolution; + +inline bool operator==(const Resolution& lhs, const Resolution& rhs) { + return lhs.width == rhs.width && lhs.height == rhs.height; +} + +inline uint qHash(const Resolution &key) +{ + return qHash(key.width ^ key.height); +} + +class Output +{ +public: + + + Output(Display *dpy, XRRScreenResources *resources, RROutput output); + + bool hasEDID() const; + bool isProjector() const; + Resolution getCurrentMode() const; + Resolution getPreferredMode() const; + QSet<Resolution> getSupportedModes() const; + Resolution addMode(Resolution) const; + +private: + + Display *dpy; + XRRScreenResources *resources; + RROutput ID; + + Resolution getResolution(RRMode) const; +}; + +#endif // OUTPUT_H |