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< LRESULTHandleTopLevelWindowProc (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
 

Detailed Description

Definition at line 32 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 28 of file flutter_view_controller.cc.

References FlutterDesktopViewControllerCreate(), and FlutterDesktopViewControllerGetView().

30  {
31  engine_ = std::make_unique<FlutterEngine>(project);
33  engine_->RelinquishEngine());
34  if (!controller_) {
35  std::cerr << "Failed to create view controller." << std::endl;
36  return;
37  }
38  view_ = std::make_unique<FlutterView>(
40 }
FlutterDesktopViewControllerRef FlutterDesktopViewControllerCreate(int width, int height, FlutterDesktopEngineRef engine)
WINUWP.
int32_t width
int32_t height
FlutterDesktopViewRef FlutterDesktopViewControllerGetView(FlutterDesktopViewControllerRef controller)

◆ ~FlutterViewController()

FlutterViewController::~FlutterViewController ( )
virtual

Definition at line 43 of file flutter_view_controller.cc.

References FlutterDesktopViewControllerDestroy().

43  {
44  if (controller_) {
46  }
47 }
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 63 of file flutter_view_controller.h.

Referenced by flutter::TEST().

63 { return engine_.get(); }

◆ HandleTopLevelWindowProc()

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

Definition at line 50 of file flutter_view_controller.cc.

References FlutterDesktopViewControllerHandleTopLevelWindowProc(), and result.

Referenced by view().

54  {
57  controller_, hwnd, message, wparam, lparam, &result);
58  return handled ? result : std::optional<LRESULT>(std::nullopt);
59 }
GAsyncResult * result
LONG_PTR LRESULT
Definition: windows_types.h:61
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: