Flutter Engine
flutter_view_controller.cc
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 
6 
7 #include <algorithm>
8 #include <iostream>
9 
10 namespace flutter {
11 
13  int height,
14  const DartProject& project) {
15  engine_ = std::make_unique<FlutterEngine>(project);
16  controller_ = FlutterDesktopViewControllerCreate(width, height,
17  engine_->RelinquishEngine());
18  if (!controller_) {
19  std::cerr << "Failed to create view controller." << std::endl;
20  return;
21  }
22  view_ = std::make_unique<FlutterView>(
24 }
25 
27  if (controller_) {
29  }
30 }
31 
33  HWND hwnd,
34  UINT message,
35  WPARAM wparam,
36  LPARAM lparam) {
37  LRESULT result;
39  controller_, hwnd, message, wparam, lparam, &result);
40  return handled ? result : std::optional<LRESULT>(std::nullopt);
41 }
42 
43 } // namespace flutter
FlutterDesktopViewControllerRef FlutterDesktopViewControllerCreate(int width, int height, FlutterDesktopEngineRef engine)
void FlutterDesktopViewControllerDestroy(FlutterDesktopViewControllerRef controller)
FlutterViewController(int width, int height, const DartProject &project)
std::optional< LRESULT > HandleTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
int32_t height
int32_t width
FlutterDesktopViewRef FlutterDesktopViewControllerGetView(FlutterDesktopViewControllerRef controller)
bool FlutterDesktopViewControllerHandleTopLevelWindowProc(FlutterDesktopViewControllerRef controller, HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, LRESULT *result)