5#include "include/flutter/flutter_engine.h"
17 const std::string& assets_path,
18 const std::vector<std::string>& arguments,
19 const std::string& aot_library_path) {
21 std::cerr <<
"Cannot run an already running engine. Create a new instance "
22 "or call ShutDown first."
28 c_engine_properties.
assets_path = assets_path.c_str();
31 std::vector<const char*> engine_switches;
33 arguments.begin(), arguments.end(), std::back_inserter(engine_switches),
34 [](
const std::string& arg) ->
const char* { return arg.c_str(); });
35 if (!engine_switches.empty()) {
36 c_engine_properties.
switches = &engine_switches[0];
43 std::cerr <<
"Failed to start engine." << std::endl;
54 const std::string& plugin_name) {
56 std::cerr <<
"Cannot get plugin registrar on an engine that isn't running; "
66 std::cerr <<
"Cannot run event loop without a running engine; call "
71 uint32_t timeout_milliseconds;
74 timeout_milliseconds = 0;
75 }
else if (
timeout.count() > UINT32_MAX) {
76 timeout_milliseconds = UINT32_MAX;
78 timeout_milliseconds =
static_cast<uint32_t
>(
timeout.count());
81 timeout_milliseconds);
bool Start(const std::string &icu_data_path, const std::string &assets_path, const std::vector< std::string > &arguments, const std::string &aot_library_path="")
void RunEventLoopWithTimeout(std::chrono::milliseconds timeout=std::chrono::milliseconds::max())
FlutterDesktopPluginRegistrarRef GetRegistrarForPlugin(const std::string &plugin_name) override
static float max(float r, float g, float b)
def timeout(deadline, cmd)
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
const char * aot_library_path
const char * icu_data_path
void FlutterDesktopRunEngineEventLoopWithTimeout(FlutterDesktopEngineRef engine, uint32_t timeout_milliseconds)
bool FlutterDesktopShutDownEngine(FlutterDesktopEngineRef engine_ref)
FlutterDesktopEngineRef FlutterDesktopRunEngine(const FlutterDesktopEngineProperties &properties)
FlutterDesktopPluginRegistrarRef FlutterDesktopGetPluginRegistrar(FlutterDesktopEngineRef engine, const char *plugin_name)