-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVidiotApplication.h
203 lines (190 loc) · 7.28 KB
/
VidiotApplication.h
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
/*
Vidiot id a VIDeo Input Output Transformer With a Touch of Functionality
Copyright (C) 2016 Delicode Ltd
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VIDIOTAPPLICATION_H
#define VIDIOTAPPLICATION_H
#include "predefines.h"
static QString eventToName(QEvent *ev)
{
switch(ev->type()) {
case 0: return "None";
case 114: return "ActionAdded";
case 113: return "ActionChanged";
case 115: return "ActionRemoved";
case 99: return "ActivationChange";
case 121: return "ApplicationActivate";
case 122: return "ApplicationDeactivate";
case 36: return "ApplicationFontChange";
case 37: return "ApplicationLayoutDirectionChange";
case 38: return "ApplicationPaletteChange";
case 214: return "ApplicationStateChange";
case 35: return "ApplicationWindowIconChange";
case 68: return "ChildAdded";
case 69: return "ChildPolished";
case 71: return "ChildRemoved";
case 40: return "Clipboard";
case 19: return "Close";
case 200: return "CloseSoftwareInputPanel";
case 178: return "ContentsRectChange";
case 82: return "ContextMenu";
case 183: return "CursorChange";
case 52: return "DeferredDelete";
case 60: return "DragEnter";
case 62: return "DragLeave";
case 61: return "DragMove";
case 63: return "Drop";
case 170: return "DynamicPropertyChange";
case 98: return "EnabledChange";
case 10: return "Enter";
case 124: return "EnterWhatsThisMode";
case 206: return "Expose";
case 116: return "FileOpen";
case 8: return "FocusIn";
case 9: return "FocusOut";
case 23: return "FocusAboutToChange";
case 97: return "FontChange";
case 198: return "Gesture";
case 202: return "GestureOverride";
case 188: return "GrabKeyboard";
case 186: return "GrabMouse";
case 159: return "GraphicsSceneContextMenu";
case 164: return "GraphicsSceneDragEnter";
case 166: return "GraphicsSceneDragLeave";
case 165: return "GraphicsSceneDragMove";
case 167: return "GraphicsSceneDrop";
case 163: return "GraphicsSceneHelp";
case 160: return "GraphicsSceneHoverEnter";
case 162: return "GraphicsSceneHoverLeave";
case 161: return "GraphicsSceneHoverMove";
case 158: return "GraphicsSceneMouseDoubleClick";
case 155: return "GraphicsSceneMouseMove";
case 156: return "GraphicsSceneMousePress";
case 157: return "GraphicsSceneMouseRelease";
case 182: return "GraphicsSceneMove";
case 181: return "GraphicsSceneResize";
case 168: return "GraphicsSceneWheel";
case 18: return "Hide";
case 27: return "HideToParent";
case 127: return "HoverEnter";
case 128: return "HoverLeave";
case 129: return "HoverMove";
case 96: return "IconDrag";
case 101: return "IconTextChange";
case 83: return "InputMethod";
case 207: return "InputMethodQuery";
case 169: return "KeyboardLayoutChange";
case 6: return "KeyPress";
case 7: return "KeyRelease";
case 89: return "LanguageChange";
case 90: return "LayoutDirectionChange";
case 76: return "LayoutRequest";
case 11: return "Leave";
case 125: return "LeaveWhatsThisMode";
case 88: return "LocaleChange";
case 176: return "NonClientAreaMouseButtonDblClick";
case 174: return "NonClientAreaMouseButtonPress";
case 175: return "NonClientAreaMouseButtonRelease";
case 173: return "NonClientAreaMouseMove";
case 177: return "MacSizeChange";
case 43: return "MetaCall";
case 102: return "ModifiedChange";
case 4: return "MouseButtonDblClick";
case 2: return "MouseButtonPress";
case 3: return "MouseButtonRelease";
case 5: return "MouseMove";
case 109: return "MouseTrackingChange";
case 13: return "Move";
case 197: return "NativeGesture";
case 208: return "OrientationChange";
case 12: return "Paint";
case 39: return "PaletteChange";
case 131: return "ParentAboutToChange";
case 21: return "ParentChange";
case 212: return "PlatformPanel";
case 75: return "Polish";
case 74: return "PolishRequest";
case 123: return "QueryWhatsThis";
case 106: return "ReadOnlyChange";
case 199: return "RequestSoftwareInputPanel";
case 14: return "Resize";
case 204: return "ScrollPrepare";
case 205: return "Scroll";
case 117: return "Shortcut";
case 51: return "ShortcutOverride";
case 17: return "Show";
case 26: return "ShowToParent";
case 50: return "SockAct";
case 192: return "StateMachineSignal";
case 193: return "StateMachineWrapped";
case 112: return "StatusTip";
case 100: return "StyleChange";
case 87: return "TabletMove";
case 92: return "TabletPress";
case 93: return "TabletRelease";
case 94: return "OkRequest";
case 171: return "TabletEnterProximity";
case 172: return "TabletLeaveProximity";
case 22: return "ThreadChange";
case 1: return "Timer";
case 120: return "ToolBarChange";
case 110: return "ToolTip";
case 184: return "ToolTipChange";
case 194: return "TouchBegin";
case 209: return "TouchCancel";
case 196: return "TouchEnd";
case 195: return "TouchUpdate";
case 189: return "UngrabKeyboard";
case 187: return "UngrabMouse";
case 78: return "UpdateLater";
case 77: return "UpdateRequest";
case 111: return "WhatsThis";
case 118: return "WhatsThisClicked";
case 31: return "Wheel";
case 132: return "WinEventAct";
case 24: return "WindowActivate";
case 103: return "WindowBlocked";
case 25: return "WindowDeactivate";
case 34: return "WindowIconChange";
case 105: return "WindowStateChange";
case 33: return "WindowTitleChange";
case 104: return "WindowUnblocked";
case 203: return "WinIdChange";
case 126: return "ZOrderChange";
default: return "unknown";
}
}
class VidiotApplication : public QApplication
{
Q_OBJECT
public:
VidiotApplication(int &argc, char** argv);
QHash<QString,QList<QString> > filterEvents;
QHash<QString,QList<QString> > interestingEvents;
// Uncomment to get massive loads of debug about events
#if 0
virtual bool notify(QObject *ob, QEvent *ev) {
QString classname = QString(ob->metaObject()->className());
QString eventname = eventToName(ev);
if (filterEvents.contains(classname) && filterEvents[classname].contains(eventname))
return QApplication::notify(ob, ev);
qDebug() << ob->metaObject()->className() << ", " << ob->objectName() << ", " << eventname;
if (interestingEvents.contains(classname) && interestingEvents[classname].contains(eventname))
{
qDebug() << "interesting event " << ob->objectName();
}
return QApplication::notify(ob, ev);
}
#endif
};
#endif // VIDIOTAPPLICATION_H