aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/LuminaRandR.h
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-06-07 20:46:50 -0400
committerKen Moore <ken@ixsystems.com>2017-06-07 20:46:50 -0400
commit14341fdd69aa8034d194660c02a5ed55a8c3c838 (patch)
treedbadd7dc56f8d61a4428628639a3a2e2f5dcc157 /src-qt5/core/libLumina/LuminaRandR.h
parentSwitch the core-utilities (lumina-search) over to using the LUtils::openSetti... (diff)
downloadlumina-14341fdd69aa8034d194660c02a5ed55a8c3c838.tar.gz
lumina-14341fdd69aa8034d194660c02a5ed55a8c3c838.tar.bz2
lumina-14341fdd69aa8034d194660c02a5ed55a8c3c838.zip
Commit some more work-in-progress for the new LuminaRandR class (replacement for xrandr using the XCB libraries)
Diffstat (limited to 'src-qt5/core/libLumina/LuminaRandR.h')
-rw-r--r--src-qt5/core/libLumina/LuminaRandR.h60
1 files changed, 44 insertions, 16 deletions
diff --git a/src-qt5/core/libLumina/LuminaRandR.h b/src-qt5/core/libLumina/LuminaRandR.h
index 448c676d..86c713db 100644
--- a/src-qt5/core/libLumina/LuminaRandR.h
+++ b/src-qt5/core/libLumina/LuminaRandR.h
@@ -17,17 +17,34 @@
#include <QRect>
#include <QList>
+// XCB
+#include "xcb/randr.h"
+#include "xcb/xcb_atom.h"
+
+struct p_objects{
+//public:
+ xcb_atom_t monitor_atom; //This is the index used to identify particular monitors (unique ID)
+
+ //Cached Information
+ bool primary, automatic;
+ QRect geometry;
+ QList<QSize> resolutions;
+ QSize physicalSizeMM;
+ QString name;
+ QList<xcb_randr_output_t> outputs;
+
+ /*p_objects(){
+ // Set the defaults for non-default-constructed variables
+ primary = automatic = false;
+ monitor_atom = 0;
+ }*/
+
+};
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<QSize> availRes; //available resolutions supported by the monitor
+
+ // EXPANSIONS TO-DO
//Refresh Rate
//int cHz; //current refresh rate
//QList<int> availHz; //available refresh rates
@@ -39,19 +56,32 @@ public:
static QList<OutputDevice> availableMonitors();
//FUNCTIONS (do not use directly - use the static list function instead)
- OutputDevice();
+ OutputDevice(QString id);
~OutputDevice();
+ //Information
+ QString ID();
+
+ bool isEnabled();
+ bool isPrimary();
+ bool isAutomatic();
+ QList<QSize> availableResolutions();
+ QSize currentResolution(); //could be different from geometry.size() if things like panning/rotation are enabled
+ QRect currentGeometry();
+
//Modification
- bool setAsPrimary();
+ bool setAsPrimary(bool);
bool disable();
void enable(QRect geom = QRect()); //if no geom provided, will add as the right-most screen at optimal resolution
void changeResolution(QSize);
-
+ void changeGeometry(QRect); //move a currently-enabled screen to another place
+
+ void updateInfoCache(); //Run this after all modification functions to refresh the current info for this device
+
//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;
+ // has a storage container for placing semi-private objects as needed
+ //class p_objects; //forward declaration - defined in the .cpp file
+ p_objects p_obj;
};
class OutputDeviceList : public QList<OutputDevice>{
@@ -64,7 +94,5 @@ public:
void disableMonitor(QString id);
//void enableMonitor(QString id,
-private:
-
};
#endif
bgstack15