Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::testing::FlutterWindowsEngineBuilder Class Reference

#include <flutter_windows_engine_builder.h>

Public Member Functions

 FlutterWindowsEngineBuilder (WindowsTestContext &context)
 
 ~FlutterWindowsEngineBuilder ()
 
void SetDartEntrypoint (std::string entrypoint)
 
void AddDartEntrypointArgument (std::string arg)
 
void SetCreateKeyboardHandlerCallbacks (KeyboardKeyEmbedderHandler::GetKeyStateHandler get_key_state, KeyboardKeyEmbedderHandler::MapVirtualKeyToScanCode map_vk_to_scan)
 
void SetSwitches (std::vector< std::string > switches)
 
void SetWindowsProcTable (std::shared_ptr< WindowsProcTable > windows_proc_table)
 
std::unique_ptr< FlutterWindowsEngineBuild ()
 

Detailed Description

Definition at line 19 of file flutter_windows_engine_builder.h.

Constructor & Destructor Documentation

◆ FlutterWindowsEngineBuilder()

flutter::testing::FlutterWindowsEngineBuilder::FlutterWindowsEngineBuilder ( WindowsTestContext context)
explicit

Definition at line 48 of file flutter_windows_engine_builder.cc.

50 : context_(context) {
51 properties_.assets_path = context.GetAssetsPath().c_str();
52 properties_.icu_data_path = context.GetIcuDataPath().c_str();
53 properties_.aot_library_path = context.GetAotLibraryPath().c_str();
54}

◆ ~FlutterWindowsEngineBuilder()

flutter::testing::FlutterWindowsEngineBuilder::~FlutterWindowsEngineBuilder ( )
default

Member Function Documentation

◆ AddDartEntrypointArgument()

void flutter::testing::FlutterWindowsEngineBuilder::AddDartEntrypointArgument ( std::string  arg)

Definition at line 63 of file flutter_windows_engine_builder.cc.

63 {
64 dart_entrypoint_arguments_.emplace_back(std::move(arg));
65}

◆ Build()

std::unique_ptr< FlutterWindowsEngine > flutter::testing::FlutterWindowsEngineBuilder::Build ( )

Definition at line 84 of file flutter_windows_engine_builder.cc.

84 {
85 std::vector<const char*> dart_args;
86 dart_args.reserve(dart_entrypoint_arguments_.size());
87
88 for (const auto& arg : dart_entrypoint_arguments_) {
89 dart_args.push_back(arg.c_str());
90 }
91
92 if (!dart_args.empty()) {
93 properties_.dart_entrypoint_argv = dart_args.data();
94 properties_.dart_entrypoint_argc = dart_args.size();
95 } else {
96 properties_.dart_entrypoint_argv = nullptr;
97 properties_.dart_entrypoint_argc = 0;
98 }
99
100 FlutterProjectBundle project(properties_);
101 project.SetSwitches(switches_);
102
103 return std::make_unique<TestFlutterWindowsEngine>(
104 project, get_key_state_, map_vk_to_scan_, std::move(windows_proc_table_));
105}

◆ SetCreateKeyboardHandlerCallbacks()

void flutter::testing::FlutterWindowsEngineBuilder::SetCreateKeyboardHandlerCallbacks ( KeyboardKeyEmbedderHandler::GetKeyStateHandler  get_key_state,
KeyboardKeyEmbedderHandler::MapVirtualKeyToScanCode  map_vk_to_scan 
)

Definition at line 72 of file flutter_windows_engine_builder.cc.

74 {
75 get_key_state_ = std::move(get_key_state);
76 map_vk_to_scan_ = std::move(map_vk_to_scan);
77}

◆ SetDartEntrypoint()

void flutter::testing::FlutterWindowsEngineBuilder::SetDartEntrypoint ( std::string  entrypoint)

Definition at line 58 of file flutter_windows_engine_builder.cc.

58 {
59 dart_entrypoint_ = std::move(entrypoint);
60 properties_.dart_entrypoint = dart_entrypoint_.c_str();
61}

◆ SetSwitches()

void flutter::testing::FlutterWindowsEngineBuilder::SetSwitches ( std::vector< std::string >  switches)

Definition at line 67 of file flutter_windows_engine_builder.cc.

68 {
69 switches_ = std::move(switches);
70}

◆ SetWindowsProcTable()

void flutter::testing::FlutterWindowsEngineBuilder::SetWindowsProcTable ( std::shared_ptr< WindowsProcTable windows_proc_table)

Definition at line 79 of file flutter_windows_engine_builder.cc.

80 {
81 windows_proc_table_ = std::move(windows_proc_table);
82}

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