Extract platform policy catalog
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "log.h"
|
||||
#include "platform_api/network_tls_policy.h"
|
||||
#include "platform_api/platform_policy.h"
|
||||
#include "renderer_gl/opengl_capabilities.h"
|
||||
|
||||
#include <deque>
|
||||
@@ -368,7 +369,7 @@ public:
|
||||
|
||||
[[nodiscard]] bool deletes_recorded_files_on_clear() override
|
||||
{
|
||||
return false;
|
||||
return pp::platform::platform_deletes_recorded_files_on_clear(pp::platform::PlatformFamily::windows);
|
||||
}
|
||||
|
||||
void clear_recorded_files(std::string_view recording_path) override
|
||||
@@ -378,19 +379,28 @@ public:
|
||||
|
||||
void publish_exported_image(std::string_view path) override
|
||||
{
|
||||
if (!pp::platform::platform_publishes_exported_images(pp::platform::PlatformFamily::windows))
|
||||
{
|
||||
(void)path;
|
||||
return;
|
||||
}
|
||||
(void)path;
|
||||
}
|
||||
|
||||
void flush_persistent_storage() override
|
||||
{
|
||||
if (!pp::platform::platform_flushes_persistent_storage(pp::platform::PlatformFamily::windows))
|
||||
return;
|
||||
}
|
||||
|
||||
[[nodiscard]] std::vector<std::string> document_browse_roots(
|
||||
std::string_view work_path,
|
||||
std::string_view data_path) override
|
||||
{
|
||||
(void)data_path;
|
||||
return { std::string(work_path) };
|
||||
return pp::platform::platform_document_browse_roots(
|
||||
pp::platform::PlatformFamily::windows,
|
||||
work_path,
|
||||
data_path);
|
||||
}
|
||||
|
||||
void save_ui_state() override
|
||||
@@ -400,7 +410,7 @@ public:
|
||||
|
||||
[[nodiscard]] bool enables_live_asset_reloading() override
|
||||
{
|
||||
return true;
|
||||
return pp::platform::platform_enables_live_asset_reloading(pp::platform::PlatformFamily::windows);
|
||||
}
|
||||
|
||||
void update_platform_frame(float delta_time_seconds) override
|
||||
@@ -466,7 +476,7 @@ public:
|
||||
|
||||
[[nodiscard]] bool supports_working_directory_picker() override
|
||||
{
|
||||
return true;
|
||||
return pp::platform::platform_supports_working_directory_picker(pp::platform::PlatformFamily::windows);
|
||||
}
|
||||
|
||||
[[nodiscard]] std::string format_working_directory_path(std::string_view path) override
|
||||
@@ -484,12 +494,13 @@ public:
|
||||
|
||||
[[nodiscard]] bool uses_prepared_file_writes() override
|
||||
{
|
||||
return false;
|
||||
return pp::platform::platform_uses_prepared_file_writes(pp::platform::PlatformFamily::windows);
|
||||
}
|
||||
|
||||
[[nodiscard]] bool uses_work_directory_document_export_collections() override
|
||||
{
|
||||
return false;
|
||||
return pp::platform::platform_uses_work_directory_document_export_collections(
|
||||
pp::platform::PlatformFamily::windows);
|
||||
}
|
||||
|
||||
[[nodiscard]] bool disables_network_tls_verification() override
|
||||
@@ -499,12 +510,13 @@ public:
|
||||
|
||||
[[nodiscard]] bool uses_ppbr_export_data_directory_override() override
|
||||
{
|
||||
return false;
|
||||
return pp::platform::platform_uses_ppbr_export_data_directory_override(
|
||||
pp::platform::PlatformFamily::windows);
|
||||
}
|
||||
|
||||
[[nodiscard]] bool supports_sonarpen() override
|
||||
{
|
||||
return false;
|
||||
return pp::platform::platform_supports_sonarpen(pp::platform::PlatformFamily::windows);
|
||||
}
|
||||
|
||||
void start_sonarpen() override
|
||||
@@ -513,7 +525,7 @@ public:
|
||||
|
||||
[[nodiscard]] int default_canvas_resolution() override
|
||||
{
|
||||
return 1536;
|
||||
return pp::platform::platform_default_canvas_resolution(pp::platform::PlatformFamily::windows);
|
||||
}
|
||||
|
||||
[[nodiscard]] bool draws_canvas_tip_for_pointer(
|
||||
@@ -521,8 +533,11 @@ public:
|
||||
bool is_stylus,
|
||||
bool is_left_button_release) override
|
||||
{
|
||||
(void)is_left_button_release;
|
||||
return is_mouse || is_stylus;
|
||||
return pp::platform::platform_draws_canvas_tip_for_pointer(
|
||||
pp::platform::PlatformFamily::windows,
|
||||
is_mouse,
|
||||
is_stylus,
|
||||
is_left_button_release);
|
||||
}
|
||||
|
||||
[[nodiscard]] float adjust_canvas_input_pressure(float pressure) override
|
||||
@@ -539,11 +554,12 @@ public:
|
||||
std::string_view data_path,
|
||||
std::string_view temporary_path) override
|
||||
{
|
||||
(void)type;
|
||||
(void)default_name;
|
||||
(void)data_path;
|
||||
(void)temporary_path;
|
||||
return {};
|
||||
return pp::platform::plan_platform_writable_file(
|
||||
pp::platform::PlatformFamily::windows,
|
||||
type,
|
||||
default_name,
|
||||
data_path,
|
||||
temporary_path);
|
||||
}
|
||||
|
||||
void save_prepared_file(
|
||||
|
||||
Reference in New Issue
Block a user