5 #ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_CLIENT_WRAPPER_INCLUDE_FLUTTER_PLUGIN_REGISTRAR_WINDOWS_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_CLIENT_WRAPPER_INCLUDE_FLUTTER_PLUGIN_REGISTRAR_WINDOWS_H_
24 LRESULT>(HWND hwnd, UINT
message, WPARAM wparam, LPARAM lparam)>;
35 view_ = std::make_unique<FlutterView>(
66 if (window_proc_delegates_.empty()) {
68 registrar(), PluginRegistrarWindows::OnTopLevelWindowProc,
this);
71 window_proc_delegates_.emplace(
delegate_id, std::move(delegate));
77 window_proc_delegates_.erase(proc_id);
78 if (window_proc_delegates_.empty()) {
80 registrar(), PluginRegistrarWindows::OnTopLevelWindowProc);
87 static bool OnTopLevelWindowProc(HWND hwnd,
94 std::optional optional_result =
registrar->CallTopLevelWindowProcDelegates(
96 if (optional_result) {
97 *result = *optional_result;
99 return optional_result.has_value();
102 std::optional<LRESULT> CallTopLevelWindowProcDelegates(HWND hwnd,
105 LPARAM lparam)
const {
106 std::optional<LRESULT> result;
107 for (
const auto& pair : window_proc_delegates_) {
108 result = pair.second(hwnd,
message, wparam, lparam);
118 std::unique_ptr<FlutterView> view_;
121 int next_window_proc_delegate_id_ = 1;
123 std::map<int, WindowProcDelegate> window_proc_delegates_;
128 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_CLIENT_WRAPPER_INCLUDE_FLUTTER_PLUGIN_REGISTRAR_WINDOWS_H_