Own grid workers and thin Apple platform bridge
This commit is contained in:
@@ -112,6 +112,23 @@ public:
|
||||
pp::platform::PlatformFamily::ios,
|
||||
[] {
|
||||
pp::platform::apple::AppleDocumentPickerBridge bridge;
|
||||
bridge.clipboard_text = [] {
|
||||
return [App::I->ios_view clipboard_get_string];
|
||||
};
|
||||
bridge.set_clipboard_text = [](std::string_view text) {
|
||||
const std::string value(text);
|
||||
return [App::I->ios_view clipboard_set_string:value];
|
||||
};
|
||||
bridge.display_file = [](std::string path) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[App::I->ios_view display_file:path];
|
||||
});
|
||||
};
|
||||
bridge.share_file = [](std::string path) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[App::I->ios_view share_file:[NSString stringWithUTF8String:path.c_str()]];
|
||||
});
|
||||
};
|
||||
bridge.pick_image = [](pp::platform::PickedPathCallback callback) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[App::I->ios_view pick_photo:callback];
|
||||
@@ -132,6 +149,24 @@ public:
|
||||
pp::platform::PlatformFamily::macos,
|
||||
[] {
|
||||
pp::platform::apple::AppleDocumentPickerBridge bridge;
|
||||
bridge.clipboard_text = [] {
|
||||
return [App::I->osx_view clipboard_get_string];
|
||||
};
|
||||
bridge.set_clipboard_text = [](std::string_view text) {
|
||||
const std::string value(text);
|
||||
return [App::I->osx_view clipboard_set_string:value];
|
||||
};
|
||||
bridge.share_file = [](std::string path) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[App::I->osx_view share_file:[NSString stringWithUTF8String:path.c_str()]];
|
||||
});
|
||||
};
|
||||
bridge.set_cursor_visible = [](bool visible) {
|
||||
[App::I->osx_view show_cursor:visible];
|
||||
};
|
||||
bridge.save_ui_state = [] {
|
||||
[App::I->osx_app save_ui_state];
|
||||
};
|
||||
bridge.pick_file = [](
|
||||
std::vector<std::string> file_types,
|
||||
pp::platform::PickedPathCallback callback) {
|
||||
|
||||
Reference in New Issue
Block a user