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)>;
38 implicit_view_ = std::make_unique<FlutterView>(implicit_view);
46 implicit_view_.reset();
72 return std::make_shared<FlutterView>(view);
89 if (window_proc_delegates_.empty()) {
91 registrar(), PluginRegistrarWindows::OnTopLevelWindowProc,
this);
94 window_proc_delegates_.emplace(
delegate_id, std::move(delegate));
100 window_proc_delegates_.erase(proc_id);
101 if (window_proc_delegates_.empty()) {
103 registrar(), PluginRegistrarWindows::OnTopLevelWindowProc);
110 static bool OnTopLevelWindowProc(HWND hwnd,
117 std::optional optional_result =
registrar->CallTopLevelWindowProcDelegates(
118 hwnd,
message, wparam, lparam);
119 if (optional_result) {
120 *result = *optional_result;
122 return optional_result.has_value();
125 std::optional<LRESULT> CallTopLevelWindowProcDelegates(HWND hwnd,
128 LPARAM lparam)
const {
129 std::optional<LRESULT> result;
130 for (
const auto& pair : window_proc_delegates_) {
131 result = pair.second(hwnd,
message, wparam, lparam);
141 std::unique_ptr<FlutterView> implicit_view_;
144 int next_window_proc_delegate_id_ = 1;
146 std::map<int, WindowProcDelegate> window_proc_delegates_;
151 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_CLIENT_WRAPPER_INCLUDE_FLUTTER_PLUGIN_REGISTRAR_WINDOWS_H_