2
* Copyright 2008 Aike J Sommer <dev@aikesommer.name>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation; either version 2,
7
* or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details
14
* You should have received a copy of the GNU Library General Public
15
* License along with this program; if not, write to the
16
* Free Software Foundation, Inc.,
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
#ifndef KEPHAL_XRANDROUTPUTS_H
22
#define KEPHAL_XRANDROUTPUTS_H
24
#include "backendoutputs.h"
25
#include "xrandr12/randrdisplay.h"
33
* Maps RandROutput class to Kephal::Output
35
class XRandROutput : public BackendOutput {
38
XRandROutput(XRandROutputs * parent, RROutput rrId);
43
QSize preferredSize() const;
44
QList<QSize> availableSizes() const;
45
QPoint position() const;
46
bool isConnected() const;
47
bool isActivated() const;
48
QString vendor() const;
49
int productId() const;
50
unsigned int serialNumber() const;
51
Rotation rotation() const;
52
bool reflectX() const;
53
bool reflectY() const;
55
QList<float> availableRates() const;
57
bool applyGeom(const QRect & rect, float rate);
58
bool applyOrientation(Rotation rotation, bool reflectX, bool reflectY);
65
void resize(const QSize & size);
67
void rotate(Rotation rotation);
69
void setReflectX(bool reflect);
71
void setReflectY(bool reflect);
73
void changeRate(double rate);
76
void outputChanged(RROutput id, int changes);
79
void outputConnected(Kephal::Output * o);
80
void outputDisconnected(Kephal::Output * o);
81
void outputActivated(Kephal::Output * o);
82
void outputDeactivated(Kephal::Output * o);
83
void outputResized(Kephal::Output * o, QSize oldSize, QSize newSize);
84
void outputMoved(Kephal::Output * o, QPoint oldPosition, QPoint newPosition);
85
void outputRateChanged(Kephal::Output * o, float oldRate, float newRate);
86
void outputRotated(Kephal::Output * o, Kephal::Rotation oldRotation, Kephal::Rotation newRotation);
87
void outputReflected(Kephal::Output * o, bool oldX, bool oldY, bool newX, bool newY);
90
RandROutput * output() const;
92
void saveAsPrevious();
94
XRandROutputs * m_outputs;
98
unsigned int m_serialNumber;
100
bool m_previousConnected;
101
bool m_previousActivated;
102
Rotation m_previousRotation;
103
float m_previousRate;
104
bool m_previousReflectX;
105
bool m_previousReflectY;
110
* Maps RandRDisplay to Kephal::Outputs
112
class XRandROutputs : public BackendOutputs {
115
XRandROutputs(QObject * parent, RandRDisplay * display);
117
QList<Output *> outputs();
119
RandROutput * output(RROutput rrId);
120
using Outputs::output;
121
RandRDisplay * display();
126
RandRDisplay * m_display;
127
QMap<QString, XRandROutput *> m_outputs;
133
#endif // KEPHAL_XRANDROUTPUTS_H