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 "simpleoutput.h"
26 SimpleOutput::SimpleOutput(QObject
* parent
, QString id
, QSize size
, QPoint position
, bool connected
, bool activated
)
31 m_position
= position
;
32 m_connected
= connected
;
33 m_activated
= activated
;
36 SimpleOutput::SimpleOutput(QObject
* parent
)
46 SimpleOutput::SimpleOutput(QObject
* parent
, Output
* output
)
50 m_size
= output
->size();
51 m_position
= output
->position();
52 m_connected
= output
->isConnected();
53 m_activated
= output
->isActivated();
57 QString
SimpleOutput::id()
62 QSize
SimpleOutput::size() {
66 QList
<QSize
> SimpleOutput::availableSizes() {
67 if (m_availableSizes
.empty()) {
69 result
.append(size());
72 return m_availableSizes
;
75 QPoint
SimpleOutput::position() {
79 void SimpleOutput::_setId(const QString
& id
) {
83 void SimpleOutput::_setSize(const QSize
& size
) {
87 void SimpleOutput::_setAvailableSizes(const QList
<QSize
> & sizes
) {
88 m_availableSizes
= sizes
;
91 void SimpleOutput::_setPosition(const QPoint
& position
) {
92 m_position
= position
;
95 void SimpleOutput::_setConnected(bool connected
) {
96 m_connected
= connected
;
99 void SimpleOutput::_setActivated(bool activated
) {
100 m_activated
= activated
;
103 bool SimpleOutput::isConnected() {
107 bool SimpleOutput::isActivated() {
108 return m_connected
&& m_activated
;
111 void SimpleOutput::_setVendor(const QString
& vendor
) {
115 QString
SimpleOutput::vendor() {
119 void SimpleOutput::_setProductId(int productId
) {
120 m_productId
= productId
;
123 int SimpleOutput::productId() {
127 void SimpleOutput::_setSerialNumber(unsigned int serialNumber
) {
128 m_serialNumber
= serialNumber
;
131 unsigned int SimpleOutput::serialNumber() {
132 return m_serialNumber
;
135 QSize
SimpleOutput::preferredSize() {
136 return m_preferredSize
;
139 void SimpleOutput::_setPreferredSize(const QSize
& size
) {
140 m_preferredSize
= size
;
143 void SimpleOutput::_setRotation(Rotation rotation
) {
144 m_rotation
= rotation
;
147 void SimpleOutput::_setReflectX(bool reflect
) {
148 m_reflectX
= reflect
;
151 void SimpleOutput::_setReflectY(bool reflect
) {
152 m_reflectY
= reflect
;
155 void SimpleOutput::_setRate(float rate
) {
159 void SimpleOutput::_setAvailableRates(const QList
<float> & rates
) {
163 Rotation
SimpleOutput::rotation() {
167 bool SimpleOutput::reflectX() {
171 bool SimpleOutput::reflectY() {
175 float SimpleOutput::rate() {
179 QList
<float> SimpleOutput::availableRates() {