Own runtime threads and thin platform/canvas seams

This commit is contained in:
2026-06-16 07:34:59 +02:00
parent 17b603536b
commit 6f4bd4b26f
10 changed files with 354 additions and 200 deletions

View File

@@ -135,6 +135,14 @@ public:
const std::string value(text);
return [ios_view clipboard_set_string:value];
};
bridge.set_virtual_keyboard_visible = [ios_view](bool visible) {
dispatch_async(dispatch_get_main_queue(), ^{
if (visible)
[ios_view show_keyboard];
else
[ios_view hide_keyboard];
});
};
bridge.display_file = [ios_view](std::string path) {
dispatch_async(dispatch_get_main_queue(), ^{
[ios_view display_file:path];
@@ -157,6 +165,16 @@ public:
[ios_view pick_file:apple_file_types_array(file_types) then:callback];
});
};
bridge.save_prepared_file = [ios_view](
std::string path,
std::string suggested_name,
pp::platform::PreparedFileCallback callback) {
(void)suggested_name;
dispatch_async(dispatch_get_main_queue(), ^{
[ios_view pick_file_save:path];
});
callback(path, true);
};
return bridge;
}());
return services;
@@ -330,12 +348,7 @@ public:
void set_virtual_keyboard_visible(bool visible) override
{
#ifdef __IOS__
dispatch_async(dispatch_get_main_queue(), ^{
if (visible)
[App::I->ios_view show_keyboard];
else
[App::I->ios_view hide_keyboard];
});
active_apple_document_platform_services().set_virtual_keyboard_visible(visible);
#elif __ANDROID__
displayKeyboard(visible);
#else
@@ -734,11 +747,10 @@ public:
const std::string value(path);
const std::string name(suggested_name);
#ifdef __IOS__
(void)name;
dispatch_async(dispatch_get_main_queue(), ^{
[App::I->ios_view pick_file_save:value];
});
callback(value, true);
active_apple_document_platform_services().save_prepared_file(
value,
name,
std::move(callback));
#else
(void)name;
callback(value, false);