Flutter Engine
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
 
FlutterViewControlleroperator= (FlutterViewController const &)=delete
 
FlutterEngineengine ()
 
FlutterViewview ()
 
std::optional< LRESULT > HandleTopLevelWindowProc (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
 

Detailed Description

Definition at line 27 of file flutter_view_controller.h.

Constructor & Destructor Documentation

◆ FlutterViewController() [1/2]

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

Definition at line 12 of file flutter_view_controller.cc.

References FlutterDesktopViewControllerCreate(), and FlutterDesktopViewControllerGetView().

14  {
15  engine_ = std::make_unique<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 }
FlutterDesktopViewControllerRef FlutterDesktopViewControllerCreate(int width, int height, FlutterDesktopEngineRef engine)
int32_t height
int32_t width
FlutterDesktopViewRef FlutterDesktopViewControllerGetView(FlutterDesktopViewControllerRef controller)

◆ ~FlutterViewController()

FlutterViewController::~FlutterViewController ( )
virtual

Definition at line 26 of file flutter_view_controller.cc.

References FlutterDesktopViewControllerDestroy().

26  {
27  if (controller_) {
29  }
30 }
void FlutterDesktopViewControllerDestroy(FlutterDesktopViewControllerRef controller)

◆ FlutterViewController() [2/2]

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

Member Function Documentation

◆ engine()

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

Definition at line 44 of file flutter_view_controller.h.

Referenced by flutter::TEST().

44 { return engine_.get(); }

◆ HandleTopLevelWindowProc()

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

Definition at line 32 of file flutter_view_controller.cc.

References FlutterDesktopViewControllerHandleTopLevelWindowProc().

Referenced by view().

36  {
37  LRESULT result;
39  controller_, hwnd, message, wparam, lparam, &result);
40  return handled ? result : std::optional<LRESULT>(std::nullopt);
41 }
bool FlutterDesktopViewControllerHandleTopLevelWindowProc(FlutterDesktopViewControllerRef controller, HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, LRESULT *result)

◆ operator=()

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

◆ view()

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

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