add more spacing
[personal-kdebase.git] / workspace / libs / kephal / outputs / xrandr / xrandroutputs.h
blob6ef10b599831c1d6dc77a21c75322471caae8f77
1 /*
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 <QDebug>
26 #include "../backendoutputs.h"
27 #include "xrandr12/randrdisplay.h"
30 namespace Kephal {
32 class XRandROutputs;
34 class XRandROutput : public BackendOutput {
35 Q_OBJECT
36 public:
37 XRandROutput(XRandROutputs * parent, RROutput rrId);
39 QString id();
41 QSize size();
42 QSize preferredSize();
43 QList<QSize> availableSizes();
44 QPoint position();
45 bool isConnected();
46 bool isActivated();
47 QString vendor();
48 int productId();
49 unsigned int serialNumber();
50 Rotation rotation();
51 bool reflectX();
52 bool reflectY();
53 float rate();
54 QList<float> availableRates();
56 bool applyGeom(const QRect & rect, float rate);
57 bool applyOrientation(Rotation rotation, bool reflectX, bool reflectY);
59 //void _revert();
60 void deactivate();
61 //void _activate();
62 RROutput _id();
64 public Q_SLOTS:
65 void outputChanged(RROutput id, int changes);
67 Q_SIGNALS:
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);
78 private:
79 RandROutput * output();
80 void parseEdid();
81 void saveAsPrevious();
83 XRandROutputs * m_outputs;
84 RROutput m_rrId;
85 QString m_vendor;
86 int m_productId;
87 unsigned int m_serialNumber;
88 QRect m_previousGeom;
89 bool m_previousConnected;
90 bool m_previousActivated;
91 Rotation m_previousRotation;
92 float m_previousRate;
93 bool m_previousReflectX;
94 bool m_previousReflectY;
98 class XRandROutputs : public BackendOutputs {
99 Q_OBJECT
100 public:
101 XRandROutputs(QObject * parent, RandRDisplay * display);
103 QList<Output *> outputs();
105 RandROutput * output(RROutput rrId);
106 using Outputs::output;
107 RandRDisplay * display();
109 private:
110 void init();
112 RandRDisplay * m_display;
113 QMap<QString, XRandROutput *> m_outputs;
119 #endif // KEPHAL_XRANDROUTPUTS_H