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
| #ifndef WIN32WINDOWCONTEXT_P_H
| #define WIN32WINDOWCONTEXT_P_H
|
| #include <QWKCore/qwindowkit_windows.h>
| #include <QWKCore/private/abstractwindowcontext_p.h>
|
| namespace QWK {
|
| class QWK_CORE_EXPORT Win32WindowContext : public AbstractWindowContext {
| Q_OBJECT
| public:
| Win32WindowContext(QWindow *window, WindowItemDelegate *delegate);
| ~Win32WindowContext() override;
|
| enum WindowPart {
| Outside,
| ClientArea,
| ChromeButton,
| ResizeBorder,
| FixedBorder,
| TitleBar,
| };
|
| public:
| bool setup() override;
|
| bool windowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result);
| bool snapLayoutHandler(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam,
| LRESULT *result);
|
| protected:
| WId windowId = 0;
|
| // Store the last hit test result, it's helpful to handle WM_MOUSEMOVE and WM_NCMOUSELEAVE.
| WindowPart lastHitTestResult = WindowPart::Outside;
|
| // True if we blocked a WM_MOUSELEAVE when mouse moves on chrome button, false when a
| // WM_MOUSELEAVE comes or we manually call TrackMouseEvent().
| bool mouseLeaveBlocked = false;
| };
|
| }
|
| #endif // WIN32WINDOWCONTEXT_P_H
|
|