| Flutter Windows Embedder |

Public Member Functions | List of all members
flutter::FlutterViewController Class Reference

`#include <flutter_view_controller.h>`

## Public Member Functions
| FlutterViewController (int width, int height, const DartProject &project)
virtual | ~FlutterViewController ()
| FlutterViewController (FlutterViewController const &)=delete
FlutterViewController & | operator= (FlutterViewController const &)=delete
FlutterEngine * | engine ()
FlutterView * | view ()
void | ForceRedraw ()
std::optional< LRESULT > | HandleTopLevelWindowProc (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)

## Detailed Description

Definition at line 25 of file flutter_view_controller.h.

## Constructor & Destructor Documentation

## ◆ FlutterViewController() [1/2]

flutter::FlutterViewController::FlutterViewController | ( | int | width,
|  | int | height,
|  | const DartProject & | project
| ) |  |
| explicit

Definition at line 12 of file flutter_view_controller.cc.

14 {
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>(
23 FlutterDesktopViewControllerGetView(controller_));
24 }

References FlutterDesktopViewControllerCreate(), and FlutterDesktopViewControllerGetView().

## ◆ ~FlutterViewController()

flutter::FlutterViewController::~FlutterViewController | ( |  | ) |
| virtual

Definition at line 26 of file flutter_view_controller.cc.

26 {
27 if (controller_) {
28 FlutterDesktopViewControllerDestroy(controller_);
29 }
30 }

References FlutterDesktopViewControllerDestroy().

## ◆ FlutterViewController() [2/2]

flutter::FlutterViewController::FlutterViewController | ( | FlutterViewController const & |  | ) |
| delete

## Member Function Documentation

## ◆ engine()

FlutterEngine* flutter::FlutterViewController::engine | ( |  | ) |
| inline

Definition at line 42 of file flutter_view_controller.h.

42 { return engine_.get(); }

Referenced by flutter::TEST().

## ◆ ForceRedraw()

void flutter::FlutterViewController::ForceRedraw | ( |  | ) |

Definition at line 32 of file flutter_view_controller.cc.

32 {
33 FlutterDesktopViewControllerForceRedraw(controller_);
34 }

References FlutterDesktopViewControllerForceRedraw().

Referenced by flutter::TEST().

## ◆ HandleTopLevelWindowProc()

std::optional< LRESULT > flutter::FlutterViewController::HandleTopLevelWindowProc | ( | HWND | hwnd,
|  | UINT | message,
|  | WPARAM | wparam,
|  | LPARAM | lparam
| ) |  |

Definition at line 36 of file flutter_view_controller.cc.

40 {
41 LRESULT result;
42 bool handled = FlutterDesktopViewControllerHandleTopLevelWindowProc(
43 controller_, hwnd, message, wparam, lparam, &result);
44 return handled ? result : std::optional<LRESULT>(std::nullopt);
45 }

References FlutterDesktopViewControllerHandleTopLevelWindowProc(), and message.

## ◆ operator=()

FlutterViewController& flutter::FlutterViewController::operator= | ( | FlutterViewController const & |  | ) |
| delete

## ◆ view()

FlutterView* flutter::FlutterViewController::view | ( |  | ) |
| inline

Definition at line 45 of file flutter_view_controller.h.

45 { return view_.get(); }

Referenced by flutter::TEST().

The documentation for this class was generated from the following files:

- shell/platform/windows/client_wrapper/include/flutter/flutter_view_controller.h
- shell/platform/windows/client_wrapper/flutter_view_controller.cc

FlutterDesktopViewControllerHandleTopLevelWindowProc
bool FlutterDesktopViewControllerHandleTopLevelWindowProc(FlutterDesktopViewControllerRef ref, HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, LRESULT *result)
Definition: flutter_windows.cc:132
FlutterDesktopViewControllerGetView
FlutterDesktopViewRef FlutterDesktopViewControllerGetView(FlutterDesktopViewControllerRef ref)
Definition: flutter_windows.cc:120
FlutterDesktopViewControllerForceRedraw
void FlutterDesktopViewControllerForceRedraw(FlutterDesktopViewControllerRef ref)
Definition: flutter_windows.cc:126
message
Win32Message message
Definition: keyboard_unittests.cc:137
FlutterDesktopViewControllerDestroy
void FlutterDesktopViewControllerDestroy(FlutterDesktopViewControllerRef ref)
Definition: flutter_windows.cc:109
FlutterDesktopViewControllerCreate
FlutterDesktopViewControllerRef FlutterDesktopViewControllerCreate(int width, int height, FlutterDesktopEngineRef engine_ref)
Definition: flutter_windows.cc:75