2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2018 QNX Software Systems. All rights reserved.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
2018-05-04 18:23:51 +00:00
|
|
|
|
|
|
|
#ifndef COLLECTOR_H_
|
|
|
|
#define COLLECTOR_H_
|
|
|
|
|
|
|
|
#include <QAbstractNativeEventFilter>
|
2020-07-06 10:12:48 +00:00
|
|
|
#include <QList>
|
2018-05-04 18:23:51 +00:00
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
#include <screen/screen.h>
|
|
|
|
|
|
|
|
class Collector : public QWidget, public QAbstractNativeEventFilter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit Collector(QWidget *parent = nullptr);
|
|
|
|
~Collector() override;
|
|
|
|
|
2021-11-25 14:13:17 +00:00
|
|
|
bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override;
|
2018-05-04 18:23:51 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
struct Collectible
|
|
|
|
{
|
|
|
|
QWindow *window;
|
|
|
|
QWidget *widget;
|
|
|
|
};
|
2020-07-06 10:12:48 +00:00
|
|
|
QList<Collectible> m_collectibles;
|
2018-05-04 18:23:51 +00:00
|
|
|
|
|
|
|
bool filterQnxScreenEvent(screen_event_t event);
|
|
|
|
bool filterQnxScreenWindowEvent(screen_event_t event);
|
|
|
|
bool filterQnxScreenWindowCreateEvent(screen_window_t window, screen_event_t event);
|
|
|
|
bool filterQnxScreenWindowCloseEvent(screen_window_t window, screen_event_t event);
|
|
|
|
bool filterQnxScreenWindowManagerEvent(screen_window_t window, screen_event_t event);
|
|
|
|
bool filterQnxScreenWindowManagerNameEvent(screen_window_t window,
|
|
|
|
screen_event_t event);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* COLLECTOR_H_ */
|