/usr/include/KF5/KScreen/kscreen/output.h is in libkf5screen-dev 4:5.5.5-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | /*************************************************************************************
* Copyright (C) 2012 by Alejandro Fiestas Olivares <afiestas@kde.org> *
* Copyright (C) 2014 by Daniel Vrátil <dvratil@redhat.com> *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
*************************************************************************************/
#ifndef OUTPUT_CONFIG_H
#define OUTPUT_CONFIG_H
#include "mode.h"
#include "types.h"
#include "kscreen_export.h"
#include <QObject>
#include <QSize>
#include <QPoint>
#include <QMetaType>
#include <QStringList>
#include <QDebug>
namespace KScreen {
class Edid;
class KSCREEN_EXPORT Output : public QObject
{
Q_OBJECT
public:
Q_ENUMS(Rotation)
Q_ENUMS(Type)
Q_PROPERTY(int id READ id CONSTANT)
Q_PROPERTY(QString name READ name WRITE setName NOTIFY outputChanged)
Q_PROPERTY(Type type READ type WRITE setType NOTIFY outputChanged)
Q_PROPERTY(QString icon READ icon WRITE setIcon NOTIFY outputChanged)
Q_PROPERTY(ModeList modes READ modes CONSTANT)
Q_PROPERTY(QPoint pos READ pos WRITE setPos NOTIFY posChanged)
Q_PROPERTY(QSize size READ size WRITE setSize NOTIFY sizeChanged)
Q_PROPERTY(Rotation rotation READ rotation WRITE setRotation NOTIFY rotationChanged)
Q_PROPERTY(QString currentModeId READ currentModeId WRITE setCurrentModeId NOTIFY currentModeIdChanged)
Q_PROPERTY(QString preferredModeId READ preferredModeId CONSTANT)
Q_PROPERTY(bool connected READ isConnected WRITE setConnected NOTIFY isConnectedChanged)
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY isEnabledChanged)
Q_PROPERTY(bool primary READ isPrimary WRITE setPrimary NOTIFY isPrimaryChanged)
Q_PROPERTY(QList<int> clones READ clones WRITE setClones NOTIFY clonesChanged)
Q_PROPERTY(KScreen::Edid* edid READ edid CONSTANT)
Q_PROPERTY(QSize sizeMm READ sizeMm CONSTANT)
enum Type {
Unknown,
VGA,
DVI,
DVII,
DVIA,
DVID,
HDMI,
Panel,
TV,
TVComposite,
TVSVideo,
TVComponent,
TVSCART,
TVC4,
DisplayPort
};
enum Rotation {
None = 1,
Left = 2,
Inverted = 4,
Right = 8
};
explicit Output();
virtual ~Output();
OutputPtr clone() const;
int id() const;
void setId(int id);
QString name() const;
void setName(const QString& name);
Type type() const;
void setType(Type type);
QString icon() const;
void setIcon(const QString& icon);
Q_INVOKABLE ModePtr mode(const QString &id) const;
ModeList modes() const;
void setModes(const ModeList &modes);
QString currentModeId() const;
void setCurrentModeId(const QString& mode);
Q_INVOKABLE ModePtr currentMode() const;
void setPreferredModes(const QStringList &modes);
QStringList preferredModes() const;
/**
* Returns the preferred mode with higer resolution and refresh
*/
Q_INVOKABLE QString preferredModeId() const;
/**
* Returns KScreen::Mode associated with preferredModeId()
*/
Q_INVOKABLE ModePtr preferredMode() const;
QPoint pos() const;
void setPos(const QPoint& pos);
/***
* Returns actual size being rendered in the output
*
* The returned valued is after transformations have been applied to
* the resolution of the current mode.
*
* For example if currentMode is 1280x800 but it is a vertical screen
* the returned size will be 800x1280.
*
* If that same resolution (1280x800) is transformed and scale x2, the
* value returned will be 2560x1600.
*
* This property reflects the currently active output configuration and
* is not affected by current mode or orientation change made by user
* until the config is applied.
*
* @since 5.4
*/
QSize size() const;
void setSize(const QSize& size);
Rotation rotation() const;
void setRotation(Rotation rotation);
/**
* A comfortable function that returns true when output is not rotated
* or is rotated upside down.
*/
Q_INVOKABLE inline bool isHorizontal() const {
return ((rotation() == Output::None) || (rotation() == Output::Inverted));
}
bool isConnected() const;
void setConnected(bool connected);
bool isEnabled() const;
void setEnabled(bool enabled);
bool isPrimary() const;
void setPrimary(bool primary);
QList<int> clones() const;
void setClones(QList<int> outputlist);
void setEdid(const QByteArray &rawData);
Edid* edid() const;
/**
* Returns the physical size of the screen in milimeters.
*
* @note Some broken GPUs or monitors return the size in centimeters instead
* of millimeters. KScreen at the moment is not sanitizing the values.
*/
QSize sizeMm() const;
void setSizeMm(const QSize &size);
/**
* Returns a rectangle containing the currently set output position and
* size.
*
* The geometry also reflects current orientation (i.e. if current mode
* is 1920x1080 and orientation is @p KScreen::Output::Left, then the
* size of the returned rectangle will be 1080x1920.
*
* This property contains the current settings stored in the particular
* Output object, so it is updated even when user changes current mode
* or orientation without applying the whole config/
*/
QRect geometry() const;
void apply(const OutputPtr &other);
Q_SIGNALS:
void outputChanged();
void posChanged();
void sizeChanged();
void currentModeIdChanged();
void rotationChanged();
void isConnectedChanged();
void isEnabledChanged();
void isPrimaryChanged();
void clonesChanged();
private:
Q_DISABLE_COPY(Output)
class Private;
Private * const d;
Output(Private *dd);
};
} //KScreen namespace
KSCREEN_EXPORT QDebug operator<<(QDebug dbg, const KScreen::OutputPtr &output);
Q_DECLARE_METATYPE(KScreen::OutputList)
Q_DECLARE_METATYPE(KScreen::Output::Rotation)
Q_DECLARE_METATYPE(KScreen::Output::Type)
#endif //OUTPUT_H
|