Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
wm_builders.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_WM_BUILDERS_H_
6#define FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_WM_BUILDERS_H_
7
8#include <stdint.h>
9#include <windows.h>
10
11namespace flutter {
12namespace testing {
13
14constexpr LRESULT kWmResultZero = 0;
15constexpr LRESULT kWmResultDefault = 0xDEADC0DE;
16constexpr LRESULT kWmResultDontCheck = 0xFFFF1234;
17
18// A struct to hold simulated events that will be delivered after the framework
19// response is handled.
26
31
36
41
46
47// WM_KEYDOWN messages.
48//
49// See https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-keydown.
50typedef struct WmKeyDownInfo {
51 uint32_t key;
52
53 uint8_t scan_code;
54
56
58
59 // WmFieldTransitionState transition; // Always 0.
60
61 // WmFieldContext context; // Always 0.
62
63 uint16_t repeat_count = 1;
64
66} WmKeyDownInfo;
67
68// WM_KEYUP messages.
69//
70// See https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-keyup.
71typedef struct WmKeyUpInfo {
72 uint32_t key;
73
74 uint8_t scan_code;
75
77
78 // WmFieldPrevState prev_state; // Always 1.
79
80 // WmFieldTransitionState transition; // Always 1.
81
82 // WmFieldContext context; // Always 0.
83
84 // uint16_t repeat_count; // Always 1.
85
86 // Set this flag to enforce prev_state to be 0.
87 //
88 // This occurs in rare cases when the message is synthesized.
90
92} WmKeyUpInfo;
93
94// WM_CHAR messages.
95//
96// See https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-char.
97typedef struct WmCharInfo {
98 uint32_t char_code;
99
100 uint8_t scan_code;
101
103
105
107
109
110 uint16_t repeat_count = 1;
111
112 // The 25th bit of the LParam.
113 //
114 // Some messages are sent with bit25 set. Its meaning is yet unknown.
115 bool bit25 = 0;
116
117 Win32Message Build(LRESULT expected_result = kWmResultDontCheck);
118} WmCharInfo;
119
120// WM_SYSKEYDOWN messages.
121//
122// See https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-syskeydown.
123typedef struct WmSysKeyDownInfo {
124 uint32_t key;
125
126 uint8_t scan_code;
127
129
131
132 // WmFieldTransitionState transition; // Always 0.
133
135
136 uint16_t repeat_count = 1;
137
138 Win32Message Build(LRESULT expected_result = kWmResultDontCheck);
139} WmSysKeyDownInfo;
140
141// WM_SYSKEYUP messages.
142//
143// See https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-syskeyup.
144typedef struct WmSysKeyUpInfo {
145 uint32_t key;
146
147 uint8_t scan_code;
148
150
151 // WmFieldPrevState prev_state; // Always 1.
152
153 // WmFieldTransitionState transition; // Always 1.
154
156
157 // uint16_t repeat_count; // Always 1.
158
159 Win32Message Build(LRESULT expected_result = kWmResultDontCheck);
160} WmSysKeyUpInfo;
161
162// WM_DEADCHAR messages.
163//
164// See https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-deadchar.
182
183} // namespace testing
184} // namespace flutter
185
186#endif // FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_WM_BUILDERS_H_
constexpr LRESULT kWmResultZero
Definition wm_builders.h:14
constexpr LRESULT kWmResultDefault
Definition wm_builders.h:15
constexpr LRESULT kWmResultDontCheck
Definition wm_builders.h:16
Win32Message Build(LRESULT expected_result=kWmResultDontCheck)
WmFieldTransitionState transition
WmFieldPrevState prev_state
Win32Message Build(LRESULT expected_result=kWmResultDontCheck)
WmFieldTransitionState transition
Win32Message Build(LRESULT expected_result=kWmResultDontCheck)
Win32Message Build(LRESULT expected_result=kWmResultDontCheck)
Win32Message Build(LRESULT expected_result=kWmResultDontCheck)
Win32Message Build(LRESULT expected_result=kWmResultDontCheck)
LONG_PTR LRESULT
unsigned int UINT
LONG_PTR LPARAM
UINT_PTR WPARAM