31 {
32 if (!init_succeeded_) {
33 std::cerr << "Could not create window; FlutterDesktopInit failed."
34 << std::endl;
35 return false;
36 }
37
38 if (controller_) {
39 std::cerr << "Only one Flutter window can exist at a time." << std::endl;
40 return false;
41 }
42
44 c_window_properties.
title = window_properties.title.c_str();
45 c_window_properties.
width = window_properties.width;
46 c_window_properties.
height = window_properties.height;
47 c_window_properties.
prevent_resize = window_properties.prevent_resize;
48
50 c_engine_properties.
assets_path = assets_path.c_str();
53 std::vector<const char*> engine_switches;
55 arguments.begin(), arguments.end(), std::back_inserter(engine_switches),
56 [](const std::string& arg) -> const char* { return arg.c_str(); });
57 if (!engine_switches.empty()) {
58 c_engine_properties.
switches = &engine_switches[0];
60 }
61
62 controller_ =
64 if (!controller_) {
65 std::cerr << "Failed to create window." << std::endl;
66 return false;
67 }
68 window_ =
70 return true;
71}
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
const char * aot_library_path
const char * icu_data_path
FlutterDesktopWindowControllerRef FlutterDesktopCreateWindow(const FlutterDesktopWindowProperties &window_properties, const FlutterDesktopEngineProperties &engine_properties)
FlutterDesktopWindowRef FlutterDesktopGetWindow(FlutterDesktopWindowControllerRef controller)