Flutter Engine
The 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
10namespace flutter {
11
13 int height,
14 const DartProject& project) {
15 engine_ = std::make_shared<FlutterEngine>(project);
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
34
35 return static_cast<FlutterViewId>(view_id);
36}
37
40}
41
43 HWND hwnd,
45 WPARAM wparam,
46 LPARAM lparam) {
49 controller_, hwnd, message, wparam, lparam, &result);
50 return handled ? result : std::optional<LRESULT>(std::nullopt);
51}
52
53} // namespace flutter
std::optional< LRESULT > HandleTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
FlutterViewController(int width, int height, const DartProject &project)
GAsyncResult * result
Win32Message message
int64_t FlutterViewId
Definition: flutter_view.h:13
int32_t height
int32_t width
void FlutterDesktopViewControllerDestroy(FlutterDesktopViewControllerRef controller)
FlutterDesktopViewId FlutterDesktopViewControllerGetViewId(FlutterDesktopViewControllerRef controller)
FlutterDesktopViewControllerRef FlutterDesktopViewControllerCreate(int width, int height, FlutterDesktopEngineRef engine)
bool FlutterDesktopViewControllerHandleTopLevelWindowProc(FlutterDesktopViewControllerRef controller, HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, LRESULT *result)
FlutterDesktopViewRef FlutterDesktopViewControllerGetView(FlutterDesktopViewControllerRef controller)
void FlutterDesktopViewControllerForceRedraw(FlutterDesktopViewControllerRef controller)
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