File indexing completed on 2024-05-19 05:32:29

0001 /*
0002     SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "effect/globals.h"
0010 
0011 #include <QObject>
0012 
0013 #include <chrono>
0014 
0015 namespace KWin
0016 {
0017 
0018 /**
0019  * The VsyncMonitor class provides a convenient way to monitor vblank events.
0020  */
0021 class KWIN_EXPORT VsyncMonitor : public QObject
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     explicit VsyncMonitor();
0027 
0028 public Q_SLOTS:
0029     virtual void arm() = 0;
0030 
0031 Q_SIGNALS:
0032     void errorOccurred();
0033     void vblankOccurred(std::chrono::nanoseconds timestamp);
0034 };
0035 
0036 } // namespace KWin