5#include "include/flutter/flutter_engine.h"
16 c_engine_properties.
assets_path = project.assets_path().c_str();
17 c_engine_properties.
icu_data_path = project.icu_data_path().c_str();
21 const std::vector<std::string>& entrypoint_args =
23 std::vector<const char*> entrypoint_argv;
25 entrypoint_args.begin(), entrypoint_args.end(),
26 std::back_inserter(entrypoint_argv),
27 [](
const std::string& arg) ->
const char* { return arg.c_str(); });
30 static_cast<int>(entrypoint_argv.size());
32 entrypoint_argv.empty() ? nullptr : entrypoint_argv.data();
37 messenger_ = std::make_unique<BinaryMessengerImpl>(core_messenger);
50 std::cerr <<
"Cannot run an engine that failed creation." << std::endl;
54 std::cerr <<
"Cannot run an engine more than once." << std::endl;
59 std::cerr <<
"Failed to start engine." << std::endl;
61 run_succeeded_ =
true;
66 if (engine_ && owns_engine_) {
81 const std::string& plugin_name) {
83 std::cerr <<
"Cannot get plugin registrar on an engine that isn't running; "
92 next_frame_callback_ = std::move(
callback);
97 self->next_frame_callback_();
98 self->next_frame_callback_ =
nullptr;
117 owns_engine_ =
false;
const std::vector< std::string > & dart_entrypoint_arguments() const
const std::string & dart_entrypoint() const
std::chrono::nanoseconds ProcessMessages()
std::optional< LRESULT > ProcessExternalWindowMessage(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
void SetNextFrameCallback(std::function< void()> callback)
FlutterDesktopPluginRegistrarRef GetRegistrarForPlugin(const std::string &plugin_name) override
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
Dart_NativeFunction function
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
const char * dart_entrypoint
const char * aot_library_path
const char * icu_data_path
const char ** dart_entrypoint_argv
FlutterDesktopEngineRef FlutterDesktopEngineCreate(const FlutterDesktopEngineProperties *engine_properties)
void FlutterDesktopEngineReloadSystemFonts(FlutterDesktopEngineRef engine)
bool FlutterDesktopEngineProcessExternalWindowMessage(FlutterDesktopEngineRef engine, HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, LRESULT *result)
FlutterDesktopPluginRegistrarRef FlutterDesktopEngineGetPluginRegistrar(FlutterDesktopEngineRef engine, const char *plugin_name)
bool FlutterDesktopEngineDestroy(FlutterDesktopEngineRef engine_ref)
uint64_t FlutterDesktopEngineProcessMessages(FlutterDesktopEngineRef engine)
FlutterDesktopMessengerRef FlutterDesktopEngineGetMessenger(FlutterDesktopEngineRef engine)
void FlutterDesktopEngineSetNextFrameCallback(FlutterDesktopEngineRef engine, VoidCallback callback, void *user_data)
bool FlutterDesktopEngineRun(FlutterDesktopEngineRef engine, const char *entry_point)