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
26 #include "../backendoutputs.h"
27 #include "xrandr12/randrdisplay.h"
34 class XRandROutput
: public BackendOutput
{
37 XRandROutput(XRandROutputs
* parent
, RROutput rrId
);
42 QSize
preferredSize();
43 QList
<QSize
> availableSizes();
49 unsigned int serialNumber();
54 QList
<float> availableRates();
56 bool applyGeom(const QRect
& rect
, float rate
);
57 bool applyOrientation(Rotation rotation
, bool reflectX
, bool reflectY
);
65 void outputChanged(RROutput id
, int changes
);
68 void outputConnected(Kephal::Output
* o
);
69 void outputDisconnected(Kephal::Output
* o
);
70 void outputActivated(Kephal::Output
* o
);
71 void outputDeactivated(Kephal::Output
* o
);
72 void outputResized(Kephal::Output
* o
, QSize oldSize
, QSize newSize
);
73 void outputMoved(Kephal::Output
* o
, QPoint oldPosition
, QPoint newPosition
);
74 void outputRateChanged(Kephal::Output
* o
, float oldRate
, float newRate
);
75 void outputRotated(Kephal::Output
* o
, Kephal::Rotation oldRotation
, Kephal::Rotation newRotation
);
76 void outputReflected(Kephal::Output
* o
, bool oldX
, bool oldY
, bool newX
, bool newY
);
79 RandROutput
* output();
81 void saveAsPrevious();
83 XRandROutputs
* m_outputs
;
87 unsigned int m_serialNumber
;
89 bool m_previousConnected
;
90 bool m_previousActivated
;
91 Rotation m_previousRotation
;
93 bool m_previousReflectX
;
94 bool m_previousReflectY
;
98 class XRandROutputs
: public BackendOutputs
{
101 XRandROutputs(QObject
* parent
, RandRDisplay
* display
);
103 QList
<Output
*> outputs();
105 RandROutput
* output(RROutput rrId
);
106 using Outputs::output
;
107 RandRDisplay
* display();
112 RandRDisplay
* m_display
;
113 QMap
<QString
, XRandROutput
*> m_outputs
;
119 #endif // KEPHAL_XRANDROUTPUTS_H