Flutter Engine
The Flutter Engine
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.
25};
26
27typedef enum WmFieldExtended {
31
32typedef enum WmFieldContext {
36
37typedef enum WmFieldPrevState {
38 kWasUp = 0,
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
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
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);
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);
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);
161
162// WM_DEADCHAR messages.
163//
164// See https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-deadchar.
165typedef struct WmDeadCharInfo {
166 uint32_t char_code;
167
168 uint8_t scan_code;
169
171
173
175
177
178 uint16_t repeat_count = 1;
179
180 Win32Message Build(LRESULT expected_result = kWmResultDontCheck);
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
struct flutter::testing::WmKeyDownInfo WmKeyDownInfo
struct flutter::testing::WmSysKeyUpInfo WmSysKeyUpInfo
struct flutter::testing::WmKeyUpInfo WmKeyUpInfo
constexpr LRESULT kWmResultDefault
Definition: wm_builders.h:15
constexpr LRESULT kWmResultDontCheck
Definition: wm_builders.h:16
struct flutter::testing::WmCharInfo WmCharInfo
struct flutter::testing::WmSysKeyDownInfo WmSysKeyDownInfo
struct flutter::testing::WmDeadCharInfo WmDeadCharInfo
Win32Message Build(LRESULT expected_result=kWmResultDontCheck)
Definition: wm_builders.cc:33
WmFieldTransitionState transition
Definition: wm_builders.h:106
WmFieldPrevState prev_state
Definition: wm_builders.h:104
Win32Message Build(LRESULT expected_result=kWmResultDontCheck)
Definition: wm_builders.cc:69
WmFieldTransitionState transition
Definition: wm_builders.h:174
Win32Message Build(LRESULT expected_result=kWmResultDontCheck)
Definition: wm_builders.cc:10
Win32Message Build(LRESULT expected_result=kWmResultDontCheck)
Definition: wm_builders.cc:21
Win32Message Build(LRESULT expected_result=kWmResultDontCheck)
Definition: wm_builders.cc:45
Win32Message Build(LRESULT expected_result=kWmResultDontCheck)
Definition: wm_builders.cc:57
LONG_PTR LRESULT
Definition: windows_types.h:61
unsigned int UINT
Definition: windows_types.h:32
LONG_PTR LPARAM
Definition: windows_types.h:60
UINT_PTR WPARAM
Definition: windows_types.h:59