| 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
FlutterViewId | view_id () const
FlutterEngine * | engine () const
FlutterView * | view () const
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
| ) |  |

Definition at line 12 of file flutter_view_controller.cc.

14 {
15 engine_ = std::make_shared<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 }
FlutterDesktopViewControllerCreate
FlutterDesktopViewControllerRef FlutterDesktopViewControllerCreate(int width, int height, FlutterDesktopEngineRef engine)
Definition: flutter_windows.cc:122
FlutterDesktopViewControllerGetView
FlutterDesktopViewRef FlutterDesktopViewControllerGetView(FlutterDesktopViewControllerRef ref)
Definition: flutter_windows.cc:154

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 }
FlutterDesktopViewControllerDestroy
void FlutterDesktopViewControllerDestroy(FlutterDesktopViewControllerRef ref)
Definition: flutter_windows.cc:136

References FlutterDesktopViewControllerDestroy().

## ◆ FlutterViewController() [2/2]

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

## Member Function Documentation

## ◆ engine()

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

Definition at line 45 of file flutter_view_controller.h.

45 { return engine_.get(); }

Referenced by flutter::TEST().

## ◆ ForceRedraw()

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

Definition at line 38 of file flutter_view_controller.cc.

38 {
39 FlutterDesktopViewControllerForceRedraw(controller_);
40 }
FlutterDesktopViewControllerForceRedraw
void FlutterDesktopViewControllerForceRedraw(FlutterDesktopViewControllerRef ref)
Definition: flutter_windows.cc:160

References FlutterDesktopViewControllerForceRedraw().

Referenced by flutter::TEST().

## ◆ HandleTopLevelWindowProc()

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

Definition at line 42 of file flutter_view_controller.cc.

46 {
47 LRESULT result;
48 bool handled = FlutterDesktopViewControllerHandleTopLevelWindowProc(
49 controller_, hwnd, message, wparam, lparam, &result);
50 return handled ? result : std::optional<LRESULT>(std::nullopt);
51 }
FlutterDesktopViewControllerHandleTopLevelWindowProc
bool FlutterDesktopViewControllerHandleTopLevelWindowProc(FlutterDesktopViewControllerRef ref, HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, LRESULT *result)
Definition: flutter_windows.cc:166
message
Win32Message message
Definition: keyboard_unittests.cc:137

References FlutterDesktopViewControllerHandleTopLevelWindowProc(), and message.

## ◆ operator=()

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

## ◆ view()

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

Definition at line 48 of file flutter_view_controller.h.

48 { return view_.get(); }

Referenced by flutter::TEST().

## ◆ view_id()

FlutterViewId flutter::FlutterViewController::view_id | ( |  | ) | const

Definition at line 32 of file flutter_view_controller.cc.

32 {
33 auto view_id = FlutterDesktopViewControllerGetViewId(controller_);
34
35 return static_cast<FlutterViewId>(view_id);
36 }
flutter::FlutterViewController::view_id
FlutterViewId view_id() const
Definition: flutter_view_controller.cc:32
FlutterDesktopViewControllerGetViewId
FlutterDesktopViewId FlutterDesktopViewControllerGetViewId(FlutterDesktopViewControllerRef ref)
Definition: flutter_windows.cc:142
flutter::FlutterViewId
int64_t FlutterViewId
Definition: flutter_view.h:13

References FlutterDesktopViewControllerGetViewId().

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