File indexing completed on 2024-11-10 04:57:04

0001 /*
0002     SPDX-FileCopyrightText: 2022 David Redondo <kde@david-redondo.de>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #pragma once
0008 
0009 #include "effect/effect.h"
0010 
0011 #include <QTimer>
0012 
0013 #include <unordered_map>
0014 
0015 namespace KWin
0016 {
0017 class OffscreenQuickScene;
0018 
0019 class OutputLocatorEffect : public KWin::Effect
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     explicit OutputLocatorEffect(QObject *parent = nullptr);
0025     void paintScreen(const RenderTarget &renderTarget, const RenderViewport &viewport, int mask, const QRegion &region, KWin::Output *screen) override;
0026     bool isActive() const override;
0027 
0028 public Q_SLOTS:
0029     void show();
0030     void hide();
0031 
0032 private:
0033     QUrl m_qmlUrl;
0034     QTimer m_showTimer;
0035     std::unordered_map<Output *, std::unique_ptr<OffscreenQuickScene>> m_scenesByScreens;
0036 };
0037 }