From 435c8ba5ee4fc058dd99501602c6633893672750 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 10 Feb 2017 13:01:52 -0500 Subject: Large update to the new LuminaRandR class. Still not quite ready, but getting there. Also commit a simple "test" app which can be modified/used to test out individual library classes as needed. --- src-qt5/core/libLumina/LuminaRandR.cpp | 1 - src-qt5/core/libLumina/LuminaRandR.h | 37 ++++++++++++++++++++++++++-------- src-qt5/core/libLumina/test/main.cpp | 12 +++++++++++ src-qt5/core/libLumina/test/test.pro | 7 +++++++ 4 files changed, 48 insertions(+), 9 deletions(-) delete mode 100644 src-qt5/core/libLumina/LuminaRandR.cpp create mode 100644 src-qt5/core/libLumina/test/main.cpp create mode 100644 src-qt5/core/libLumina/test/test.pro (limited to 'src-qt5') diff --git a/src-qt5/core/libLumina/LuminaRandR.cpp b/src-qt5/core/libLumina/LuminaRandR.cpp deleted file mode 100644 index eefc5aa8..00000000 --- a/src-qt5/core/libLumina/LuminaRandR.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "LuminaRandR.h" diff --git a/src-qt5/core/libLumina/LuminaRandR.h b/src-qt5/core/libLumina/LuminaRandR.h index 3cdff651..bf2ba51a 100644 --- a/src-qt5/core/libLumina/LuminaRandR.h +++ b/src-qt5/core/libLumina/LuminaRandR.h @@ -1,35 +1,56 @@ //=========================================== // Lumina-DE source code -// Copyright (c) 2016, Ken Moore +// Copyright (c) 2017, Ken Moore // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== // This class governs all the xcb/randr interactions // and provides simpler Qt-based functions for use elsewhere //=========================================== +#ifndef _LUMINA_LIBRARY_RANDR_MONITORS_H +#define _LUMINA_LIBRARY_RANDR_MONITORS_H //Qt includes #include +#include +#include +#include +#include -#include "xcb/randr.h" -class outputDevice{ +class OutputDevice{ public: QString id; //output ID bool enabled; + bool isPrimary; //Monitor Geometry QPoint geom; //geometry of monitor within session //Monitor Resolution QSize cRes; //current resolution of the monitor (could be different from geom.size() if panning is enabled) QList availRes; //available resolutions supported by the monitor //Refresh Rate - int cHz; //current refresh rate - QList availHz; //available refresh rates + //int cHz; //current refresh rate + //QList availHz; //available refresh rates //Expand this later to include: // panning (current/possible) // rotation (current/possible) - //FUNCTIONS - - //Modification + //Global Listing of Devices + static QList availableMonitors(); + + //FUNCTIONS (do not use directly - use the static list function instead) + OutputDevice(); + ~OutputDevice(); + + //Modification + void setAsPrimary(); + void setEnabled(bool, QRect geom = QRect()); + void setResolution(QSize); + + //Now define a simple public_objects class so that each implementation + // has a storage container for placing private objects as needed + class p_objects; + p_objects* p_obj; }; + +#endif diff --git a/src-qt5/core/libLumina/test/main.cpp b/src-qt5/core/libLumina/test/main.cpp new file mode 100644 index 00000000..39c229e2 --- /dev/null +++ b/src-qt5/core/libLumina/test/main.cpp @@ -0,0 +1,12 @@ + +#include "../LuminaRandR.h" +#include +#include + +int main(int argc, char** argv){ + QApplication A(argc, argv); + qDebug() << "Starting monitor scan..."; + QList outputs = OutputDevice::availableMonitors(); + qDebug() << "Finished monitor Scan"; + return 0; +} diff --git a/src-qt5/core/libLumina/test/test.pro b/src-qt5/core/libLumina/test/test.pro new file mode 100644 index 00000000..9674801b --- /dev/null +++ b/src-qt5/core/libLumina/test/test.pro @@ -0,0 +1,7 @@ +QT = core gui widgets + +TARGET = test + +SOURCES += main.cpp + +include(../LuminaRandR.pri) -- cgit