summaryrefslogtreecommitdiffstats
path: root/src/xx.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/xx.h')
-rw-r--r--src/xx.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/xx.h b/src/xx.h
index 2e2e3f2..de52db3 100644
--- a/src/xx.h
+++ b/src/xx.h
@@ -8,6 +8,7 @@
struct ScreenInfo;
class XPrivate;
class QSocketNotifier;
+class BackupInternal;
typedef QVector<QSize> ResolutionVector;
@@ -39,6 +40,23 @@ enum class ConnectionEvent
Unknown,
};
+class ConfigBackup
+{
+ friend class ScreenSetup;
+protected:
+ explicit ConfigBackup(XPrivate*);
+ explicit ConfigBackup();
+private:
+ bool _ok;
+ BackupInternal* a;
+ ConfigBackup& operator=(const ConfigBackup &other);
+public:
+ ConfigBackup(const ConfigBackup &other);
+ ~ConfigBackup();
+ bool ok() const { return _ok; }
+ void revert();
+};
+
class ScreenSetup : public QObject
{
Q_OBJECT
@@ -46,12 +64,11 @@ public:
void updateScreenResources();
void initModes();
ScreenMode getCurrentMode();
- ScreenMode setDefaultMode(bool dryRun = false);
- bool createMode(unsigned int resX, unsigned int resY, float refresh, QString name);
- void revertChanges();
- bool setCenteredClone();
- bool setClone(const QSize &resolution);
- bool setCustom(const QList<QPair<QSize, QList<QString>>> &list);
+ ConfigBackup setDefaultMode(bool dryRun, ScreenMode &mode);
+ bool createMode(unsigned int resX, unsigned int resY, float refresh, QString name);
+ ConfigBackup setCenteredClone();
+ ConfigBackup setClone(const QSize &resolution);
+ ConfigBackup setCustom(const QList<QPair<QSize, QList<QString>>> &list);
ResolutionVector getCommonModes() const;
int getOutputCount() const;
int queryCurrentOutputCount() const;
@@ -67,6 +84,7 @@ public:
private:
ScreenSetup();
~ScreenSetup();
+ ConfigBackup createCrtcBackup();
static ScreenSetup * _instance;
XPrivate *a;