File indexing completed on 2024-12-29 05:17:37

0001 /*
0002  * SPDX-License-Identifier: LicenseRef-KDE-Accepted-GPL
0003  * SPDX-FileCopyrightText: 2023 David Edmundson <kde@davidedmundson.co.uk>
0004  * SPDX-FileCopyrightText: 2023 Aleix Pol <aleixpol@kde.org>
0005  */
0006 
0007 #pragma once
0008 
0009 #include <QHash>
0010 #include <QObject>
0011 #include <QWindow>
0012 #include <xcb/record.h>
0013 
0014 class X11RecordingNotifier : public QObject
0015 {
0016     Q_OBJECT
0017 public:
0018     X11RecordingNotifier(WId window, QObject *parent);
0019     ~X11RecordingNotifier();
0020 
0021     bool isRedirected() const;
0022 Q_SIGNALS:
0023     void isRedirectedChanged();
0024 private:
0025     void handleNewRecord(xcb_record_enable_context_reply_t &reply);
0026 
0027     xcb_connection_t *m_connection = nullptr;
0028     xcb_record_context_t m_recordingContext = 0;
0029     WId m_windowId = 0; // my xterm
0030     QHash<uint32_t /**called XID*/, int /*count*/> m_redirectionCount;
0031 };