File indexing completed on 2024-11-10 04:56:36

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 2019 Roman Gilg <subdiff@gmail.com>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 #pragma once
0010 
0011 #include "core/output.h"
0012 #include <kwin_export.h>
0013 
0014 #include <QObject>
0015 #include <QRect>
0016 
0017 #include <xcb/randr.h>
0018 
0019 namespace KWin
0020 {
0021 
0022 class X11StandaloneBackend;
0023 
0024 /**
0025  * X11 output representation
0026  */
0027 class KWIN_EXPORT X11Output : public Output
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     explicit X11Output(X11StandaloneBackend *backend, QObject *parent = nullptr);
0033 
0034     void updateEnabled(bool enabled);
0035 
0036     RenderLoop *renderLoop() const override;
0037     void setRenderLoop(RenderLoop *loop);
0038 
0039     int xineramaNumber() const;
0040     void setXineramaNumber(int number);
0041 
0042     bool setChannelFactors(const QVector3D &rgb) override;
0043 
0044 private:
0045     void setCrtc(xcb_randr_crtc_t crtc);
0046     void setGammaRampSize(int size);
0047 
0048     X11StandaloneBackend *m_backend;
0049     RenderLoop *m_loop = nullptr;
0050     xcb_randr_crtc_t m_crtc = XCB_NONE;
0051     int m_gammaRampSize;
0052     int m_xineramaNumber = 0;
0053 
0054     friend class X11StandaloneBackend;
0055 };
0056 
0057 }