Changeset View
Changeset View
Standalone View
Standalone View
src/output.cpp
Show All 28 Lines | |||||
29 | #include <QRect> | 29 | #include <QRect> | ||
30 | 30 | | |||
31 | using namespace KScreen; | 31 | using namespace KScreen; | ||
32 | 32 | | |||
33 | class Q_DECL_HIDDEN Output::Private | 33 | class Q_DECL_HIDDEN Output::Private | ||
34 | { | 34 | { | ||
35 | public: | 35 | public: | ||
36 | Private(): | 36 | Private(): | ||
37 | edid(nullptr), | ||||
38 | scale(1.0), | ||||
37 | id(0), | 39 | id(0), | ||
38 | type(Unknown), | | |||
39 | rotation(None), | 40 | rotation(None), | ||
40 | scale(1.0), | 41 | type(Unknown), | ||
41 | connected(false), | 42 | connected(false), | ||
42 | enabled(false), | 43 | enabled(false), | ||
43 | primary(false), | 44 | primary(false) | ||
44 | edid(nullptr) | | |||
45 | {} | 45 | {} | ||
46 | 46 | | |||
47 | Private(const Private &other): | 47 | Private(const Private &other): | ||
48 | id(other.id), | | |||
49 | name(other.name), | 48 | name(other.name), | ||
50 | type(other.type), | | |||
51 | icon(other.icon), | 49 | icon(other.icon), | ||
52 | clones(other.clones), | 50 | clones(other.clones), | ||
53 | currentMode(other.currentMode), | 51 | currentMode(other.currentMode), | ||
54 | preferredMode(other.preferredMode), | 52 | preferredMode(other.preferredMode), | ||
55 | preferredModes(other.preferredModes), | 53 | preferredModes(other.preferredModes), | ||
56 | sizeMm(other.sizeMm), | 54 | sizeMm(other.sizeMm), | ||
57 | pos(other.pos), | 55 | pos(other.pos), | ||
58 | size(other.size), | 56 | size(other.size), | ||
59 | rotation(other.rotation), | | |||
60 | scale(other.scale), | 57 | scale(other.scale), | ||
58 | id(other.id), | ||||
59 | rotation(other.rotation), | ||||
60 | type(other.type), | ||||
61 | connected(other.connected), | 61 | connected(other.connected), | ||
62 | enabled(other.enabled), | 62 | enabled(other.enabled), | ||
63 | primary(other.primary) | 63 | primary(other.primary) | ||
64 | { | 64 | { | ||
65 | Q_FOREACH (const ModePtr &otherMode, other.modeList) { | 65 | Q_FOREACH (const ModePtr &otherMode, other.modeList) { | ||
66 | modeList.insert(otherMode->id(), otherMode->clone()); | 66 | modeList.insert(otherMode->id(), otherMode->clone()); | ||
67 | } | 67 | } | ||
68 | if (other.edid) { | 68 | if (other.edid) { | ||
69 | edid = other.edid->clone(); | 69 | edid = other.edid->clone(); | ||
70 | } | 70 | } | ||
71 | } | 71 | } | ||
72 | 72 | | |||
73 | QString biggestMode(const ModeList& modes) const; | 73 | QString biggestMode(const ModeList& modes) const; | ||
74 | bool compareModeList(const ModeList& before, const ModeList& after); | 74 | bool compareModeList(const ModeList& before, const ModeList& after); | ||
75 | 75 | | |||
76 | int id; | 76 | mutable QPointer<Edid> edid; | ||
77 | QString name; | 77 | QString name; | ||
78 | Type type; | | |||
79 | QString icon; | 78 | QString icon; | ||
80 | ModeList modeList; | 79 | ModeList modeList; | ||
81 | QList<int> clones; | 80 | QList<int> clones; | ||
82 | QString currentMode; | 81 | QString currentMode; | ||
83 | QString preferredMode; | 82 | QString preferredMode; | ||
84 | QStringList preferredModes; | 83 | QStringList preferredModes; | ||
85 | QSize sizeMm; | 84 | QSize sizeMm; | ||
86 | QPoint pos; | 85 | QPoint pos; | ||
87 | QSize size; | 86 | QSize size; | ||
88 | Rotation rotation; | | |||
89 | qreal scale; | 87 | qreal scale; | ||
88 | int id; | ||||
89 | Rotation rotation; | ||||
90 | Type type; | ||||
gladhorn: Actually scale should move up maybe, since it can be 64 bit if it's defined to be double. | |||||
90 | bool connected; | 91 | bool connected; | ||
91 | bool enabled; | 92 | bool enabled; | ||
92 | bool primary; | 93 | bool primary; | ||
93 | | ||||
94 | mutable QPointer<Edid> edid; | | |||
95 | }; | 94 | }; | ||
96 | 95 | | |||
97 | bool Output::Private::compareModeList(const ModeList& before, const ModeList &after) | 96 | bool Output::Private::compareModeList(const ModeList& before, const ModeList &after) | ||
98 | { | 97 | { | ||
99 | if (before.keys() != after.keys()) { | 98 | if (before.keys() != after.keys()) { | ||
100 | return false; | 99 | return false; | ||
101 | } | 100 | } | ||
102 | for (const QString &key : before.keys()) { | 101 | for (const QString &key : before.keys()) { | ||
▲ Show 20 Lines • Show All 494 Lines • Show Last 20 Lines |
Actually scale should move up maybe, since it can be 64 bit if it's defined to be double.