Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/edid.h
- This file was added.
1 | /******************************************************************** | ||||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | ||||
3 | This file is part of the KDE project. | ||||
4 | | ||||
5 | Copyright (C) 2019 Vlad Zagorodniy <vladzzag@gmail.com> | ||||
6 | | ||||
7 | This program is free software; you can redistribute it and/or modify | ||||
8 | it under the terms of the GNU General Public License as published by | ||||
9 | the Free Software Foundation; either version 2 of the License, or | ||||
10 | (at your option) any later version. | ||||
11 | | ||||
12 | This program is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
15 | GNU General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU General Public License | ||||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | *********************************************************************/ | ||||
20 | | ||||
21 | #pragma once | ||||
22 | | ||||
23 | #include <QByteArray> | ||||
24 | #include <QSize> | ||||
25 | | ||||
26 | namespace KWin | ||||
27 | { | ||||
28 | | ||||
29 | /** | ||||
30 | * Helper class that can be used for parsing EDID blobs. | ||||
31 | * | ||||
32 | * http://read.pudn.com/downloads110/ebook/456020/E-EDID%20Standard.pdf | ||||
33 | **/ | ||||
34 | class Edid | ||||
35 | { | ||||
36 | public: | ||||
37 | Edid(); | ||||
38 | Edid(const void *data, uint32_t size); | ||||
39 | | ||||
40 | /** | ||||
41 | * Whether this instance of EDID is valid. | ||||
42 | **/ | ||||
43 | bool isValid() const; | ||||
44 | | ||||
45 | /** | ||||
46 | * Returns physical dimensions of the monitor, in millimeters. | ||||
47 | **/ | ||||
48 | QSize physicalSize() const; | ||||
49 | | ||||
50 | /** | ||||
51 | * Returns EISA ID of the manufacturer of the monitor. | ||||
52 | **/ | ||||
53 | QByteArray eisaId() const; | ||||
54 | | ||||
55 | /** | ||||
56 | * Returns the product name of the monitor. | ||||
57 | **/ | ||||
58 | QByteArray monitorName() const; | ||||
59 | | ||||
60 | /** | ||||
61 | * Returns the serial number of the monitor. | ||||
62 | **/ | ||||
63 | QByteArray serialNumber() const; | ||||
64 | | ||||
65 | private: | ||||
66 | QSize m_physicalSize; | ||||
67 | QByteArray m_eisaId; | ||||
68 | QByteArray m_monitorName; | ||||
69 | QByteArray m_serialNumber; | ||||
70 | bool m_isValid = false; | ||||
71 | }; | ||||
72 | | ||||
73 | } // namespace KWin |