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_OUTPUTS_H
22
#define KEPHAL_OUTPUTS_H
36
* An Output is the actual connector and a
37
* possibly connected monitor, such as
39
* This is most important for changing any
40
* settings of the current setup.
42
class Output : public QObject {
45
Output(QObject * parent);
48
* Returns the id of the Output.
50
* In case of XRandR 1.2 these will
51
* be the names such as: VGA, LVDS,
54
virtual QString id() const = 0;
57
* Returns the actual size in pixels
58
* if the Output is active.
60
virtual QSize size() const = 0;
63
* Returns the actual position in
64
* pixels if the Output is active.
66
virtual QPoint position() const = 0;
69
* Returns whether this Output is
70
* currently connected to a
73
virtual bool isConnected() const = 0;
76
* Returns whether this Output is
77
* currently activated and part
80
virtual bool isActivated() const = 0;
83
* Returns a list of sizes, which
84
* are supported by this Output.
85
* This depends on the connected
88
virtual QList<QSize> availableSizes() const = 0;
91
* Returns the vendor-code as
92
* it is part of the EDID-block.
94
virtual QString vendor() const = 0;
97
* Returns the product-id as
98
* it is part of the EDID-block.
100
virtual int productId() const = 0;
103
* Returns the serial-number as
104
* it is part of the EDID-block.
106
virtual unsigned int serialNumber() const = 0;
109
* Returns the preferred size of
110
* this Output. This depends on
111
* the connected monitor.
113
virtual QSize preferredSize() const = 0;
116
* Returns the current rotation of
119
virtual Rotation rotation() const = 0;
122
* Returns whether this Output is
123
* currently reflected over the
126
virtual bool reflectX() const = 0;
129
* Returns whether this Output is
130
* currently reflected over the
133
virtual bool reflectY() const = 0;
136
* Returns the current refresh-rate
139
virtual float rate() const = 0;
142
* Returns all possible refresh-rates
144
* This depends on the connected
147
virtual QList<float> availableRates() const = 0;
150
* This is just a convenience
151
* method for looking up the
152
* Screen this Output belongs to.
153
* Returns 0 if not active.
154
* WILL Outputs should not know about Screens
156
Screen * screen() const;
159
* This convenience method
160
* returns size and position of
161
* this Output if active.
166
* Returns all available
167
* positions for this Output.
168
* This depends on the
169
* Configuration used and
170
* the positions of the other
173
QList<QPoint> availablePositions();
175
virtual void resize(const QSize & size) = 0;
177
virtual void rotate(Rotation rotation) = 0;
179
virtual void setReflectX(bool reflect) = 0;
181
virtual void setReflectY(bool reflect) = 0;
183
virtual void changeRate(double rate) = 0;
189
* Outputs is the entrance-point to all Output
190
* related operations.
191
* Use: Outputs::self() to obtain the currently
194
class Outputs : public QObject {
198
* Returns the currently active
201
static Outputs * self();
203
Outputs(QObject * parent);
207
* Returns a list of all known Outputs,
208
* even if they are inactive or
211
virtual QList<Output *> outputs() = 0;
214
* Find an Output by its id.
215
* Returns 0 if the id is not known.
217
virtual Output * output(const QString & id);
221
* This signal is emitted when an Output
224
void outputConnected(Kephal::Output * o);
227
* This signal is emitted when an Output
230
void outputDisconnected(Kephal::Output * o);
233
* This signal is emitted when an Output
236
void outputActivated(Kephal::Output * o);
239
* This signal is emitted when an Output
242
void outputDeactivated(Kephal::Output * o);
245
* This signal is emitted when an Output
246
* is resized from oldSize to newSize.
248
void outputResized(Kephal::Output * o, QSize oldSize, QSize newSize);
251
* This signal is emitted when an Output
252
* is moved on the framebuffer from
253
* oldPosition to newPosition.
255
void outputMoved(Kephal::Output * o, QPoint oldPosition, QPoint newPosition);
258
* This signal is emitted when the refresh-rate
259
* of Output o changes.
261
void outputRateChanged(Kephal::Output * o, float oldRate, float newRate);
264
* This signal is emitted when the rotation of
267
void outputRotated(Kephal::Output * o, Kephal::Rotation oldRotation, Kephal::Rotation newRotation);
270
* This signal is emitted when the reflection
271
* state of Output o is changed.
273
void outputReflected(Kephal::Output * o, bool oldX, bool oldY, bool newX, bool newY);
276
static Outputs * s_instance;
282
#endif // KEPHAL_OUTPUTS_H