Own runtime threads and thin platform/canvas seams
This commit is contained in:
@@ -61,6 +61,16 @@ bool AppleDocumentPlatformServices::set_clipboard_text(std::string_view text) co
|
||||
return false;
|
||||
}
|
||||
|
||||
void AppleDocumentPlatformServices::set_virtual_keyboard_visible(bool visible) const
|
||||
{
|
||||
#if defined(__IOS__)
|
||||
if (bridge_.set_virtual_keyboard_visible)
|
||||
bridge_.set_virtual_keyboard_visible(visible);
|
||||
#else
|
||||
(void)visible;
|
||||
#endif
|
||||
}
|
||||
|
||||
void AppleDocumentPlatformServices::pick_image(PickedPathCallback callback) const
|
||||
{
|
||||
if (family_ == PlatformFamily::ios)
|
||||
@@ -173,6 +183,26 @@ void AppleDocumentPlatformServices::set_cursor_visible(bool visible) const
|
||||
#endif
|
||||
}
|
||||
|
||||
void AppleDocumentPlatformServices::save_prepared_file(
|
||||
std::string_view path,
|
||||
std::string_view suggested_name,
|
||||
PreparedFileCallback callback) const
|
||||
{
|
||||
#if defined(__IOS__)
|
||||
if (bridge_.save_prepared_file)
|
||||
{
|
||||
bridge_.save_prepared_file(
|
||||
std::string(path),
|
||||
std::string(suggested_name),
|
||||
std::move(callback));
|
||||
}
|
||||
#else
|
||||
(void)path;
|
||||
(void)suggested_name;
|
||||
(void)callback;
|
||||
#endif
|
||||
}
|
||||
|
||||
void AppleDocumentPlatformServices::save_ui_state() const
|
||||
{
|
||||
#if defined(__OSX__)
|
||||
|
||||
@@ -18,9 +18,11 @@ struct AppleDocumentPickerBridge {
|
||||
std::function<std::string(std::string_view path)> format_working_directory_path;
|
||||
std::function<std::string()> clipboard_text;
|
||||
std::function<bool(std::string_view text)> set_clipboard_text;
|
||||
std::function<void(bool visible)> set_virtual_keyboard_visible;
|
||||
std::function<void(std::string path)> display_file;
|
||||
std::function<void(std::string path)> share_file;
|
||||
std::function<void(bool visible)> set_cursor_visible;
|
||||
std::function<void(std::string path, std::string suggested_name, PreparedFileCallback callback)> save_prepared_file;
|
||||
std::function<void()> save_ui_state;
|
||||
};
|
||||
|
||||
@@ -43,9 +45,14 @@ public:
|
||||
[[nodiscard]] std::string format_working_directory_path(std::string_view path) const;
|
||||
[[nodiscard]] std::string clipboard_text() const;
|
||||
[[nodiscard]] bool set_clipboard_text(std::string_view text) const;
|
||||
void set_virtual_keyboard_visible(bool visible) const;
|
||||
void display_file(std::string_view path) const;
|
||||
void share_file(std::string_view path) const;
|
||||
void set_cursor_visible(bool visible) const;
|
||||
void save_prepared_file(
|
||||
std::string_view path,
|
||||
std::string_view suggested_name,
|
||||
PreparedFileCallback callback) const;
|
||||
void save_ui_state() const;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user