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 #include "backendoutputs.h"
28 BackendOutput::BackendOutput(QObject
* parent
)
33 void BackendOutput::mark() {
34 m_markedActive
= isActivated();
36 m_markedGeom
= geom();
37 m_markedRate
= rate();
38 m_markedRotation
= rotation();
39 m_markedReflectX
= reflectX();
40 m_markedReflectY
= reflectY();
44 void BackendOutput::revert() {
46 applyGeom(m_markedGeom
, m_markedRate
);
47 applyOrientation(m_markedRotation
, m_markedReflectX
, m_markedReflectY
);
55 BackendOutputs
* BackendOutputs::m_instance
= 0;
57 BackendOutputs
* BackendOutputs::self() {
61 BackendOutputs::BackendOutputs(QObject
* parent
)
67 BackendOutputs::~BackendOutputs()
72 QList
<BackendOutput
*> BackendOutputs::backendOutputs() {
73 QList
<BackendOutput
*> result
;
74 foreach (Output
* output
, outputs()) {
75 result
<< (BackendOutput
*) output
;
80 BackendOutput
* BackendOutputs::backendOutput(const QString
& id
) {
81 foreach (BackendOutput
* output
, backendOutputs()) {
82 if (output
->id() == id
) {
89 bool BackendOutputs::activateLayout(const QMap
<Output
*, QRect
> & layout
) {
90 qDebug() << "activate layout:" << layout
;
92 QList
<BackendOutput
*> outputs
= backendOutputs();
93 foreach (BackendOutput
* output
, outputs
) {
95 if (! layout
.contains(output
)) {
96 qDebug() << "deactivating output:" << output
->id();
101 for (QMap
<Output
*, QRect
>::const_iterator i
= layout
.constBegin(); i
!= layout
.constEnd(); ++i
) {
102 BackendOutput
* output
= (BackendOutput
*) i
.key();
103 qDebug() << "setting output" << output
->id() << "to" << i
.value();
105 if (! output
->applyGeom(i
.value(), 0)) {
106 qDebug() << "setting" << output
->id() << "to" << i
.value() << "failed!!";
117 #include "backendoutputs.moc"