aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/src-cpp/NativeEventFilter.h
blob: a3be3ef1c643fbf4bc18a321b84abd61d1f1f9c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//===========================================
//  Lumina-DE source code
//  Copyright (c) 2012-2017, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
// This class provides the XCB event handling/registrations that are needed
//===========================================
#ifndef _LUMINA_DESKTOP_NATIVE_EVENT_FILTER_H
#define _LUMINA_DESKTOP_NATIVE_EVENT_FILTER_H

#include <QAbstractNativeEventFilter>
#include <QObject>
#include <QByteArray>

#include "NativeWindow.h"


class NativeEventFilter : public QObject{
	Q_OBJECT
private:
	QAbstractNativeEventFilter* EF;
	WId WMFlag; //used to flag a running WM process

public:
	NativeEventFilter();
	~NativeEventFilter(){}

	void start();
	void stop();

signals:
	//Window Signals
	void WindowCreated(WId);
	void WindowDestroyed(WId);
	void WindowPropertyChanged(WId, NativeWindow::Property);
	void WindowPropertiesChanged(WId, QList<NativeWindow::Property>);
	void WindowPropertyChanged(WId, NativeWindow::Property, QVariant);
	void WindowPropertiesChanged(WId, QList<NativeWindow::Property>, QList<QVariant>);
	void RequestWindowPropertyChange(WId, NativeWindow::Property, QVariant);
	void RequestWindowPropertiesChange(WId, QList<NativeWindow::Property>, QList<QVariant>);

	//System Tray Signals
	void TrayWindowCreated(WId);
	void TrayWindowDestroyed(WId);

	//Miscellaneos Signals
	void PossibleDamageEvent(WId);

	//Input Event Signals
	void KeyPressed(int, WId);
	void KeyReleased(int, WId);
	void MousePressed(int, WId);
	void MouseReleased(int, WId);
	void MouseMovement();
	void MouseEnterWindow(WId);
	void MouseLeaveWindow(WId);
};

class EventFilter : public QAbstractNativeEventFilter{
public:
	EventFilter(NativeEventFilter *parent);
	~EventFilter(){}

	virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *);

private:
	NativeEventFilter *obj;
};

#endif
bgstack15