/* KWin - the KDE window manager This file is part of the KDE project. SPDX-FileCopyrightText: 2016 Roman Gilg SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef KWIN_DRM_OBJECT_CONNECTOR_H #define KWIN_DRM_OBJECT_CONNECTOR_H #include #include "drm_object.h" #include "edid.h" namespace KWin { class DrmConnector : public DrmObject { public: DrmConnector(DrmGpu *gpu, uint32_t connectorId); ~DrmConnector() override; bool init() override; enum class PropertyIndex : uint32_t { CrtcId = 0, NonDesktop = 1, Dpms = 2, Edid = 3, Count }; QVector encoders() { return m_encoders; } bool isConnected(); bool isNonDesktop() const { auto prop = m_props.at(static_cast(PropertyIndex::NonDesktop)); if (!prop) { return false; } return prop->value(); } Property *dpms() const { return m_props[static_cast(PropertyIndex::Dpms)]; } const Edid *edid() const { return &m_edid; } QString connectorName() const; QString modelName() const; bool isInternal() const; QSize physicalSize() const; private: DrmScopedPointer m_conn; QVector m_encoders; Edid m_edid; QSize m_physicalSize = QSize(-1, -1); }; } #endif