55 lines
2.0 KiB
C++
55 lines
2.0 KiB
C++
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include "platform_api/platform_policy.h"
|
|
#include "platform_api/platform_services.h"
|
|
|
|
#if __LINUX__ || __WEB__
|
|
struct GLFWwindow;
|
|
#endif
|
|
|
|
namespace pp::platform::legacy {
|
|
|
|
#if defined(__LINUX__) || defined(__WEB__)
|
|
struct RetainedLegacyGlfwWindowState final {
|
|
GLFWwindow* window = nullptr;
|
|
};
|
|
|
|
[[nodiscard]] RetainedLegacyGlfwWindowState& active_legacy_glfw_window_state();
|
|
void set_legacy_glfw_window(GLFWwindow* window);
|
|
void acquire_legacy_glfw_render_context();
|
|
void present_legacy_glfw_render_context();
|
|
void request_legacy_glfw_app_close();
|
|
#endif
|
|
|
|
[[nodiscard]] pp::platform::WebPlatformServices& active_legacy_web_platform_services();
|
|
[[nodiscard]] std::unique_ptr<pp::platform::WebPlatformServices> create_legacy_web_platform_services();
|
|
void set_legacy_web_platform_services(pp::platform::WebPlatformServices* services);
|
|
[[nodiscard]] bool handles_legacy_web_platform_family(pp::platform::PlatformFamily family) noexcept;
|
|
void publish_legacy_web_exported_image(std::string_view path);
|
|
[[nodiscard]] bool try_publish_legacy_web_exported_image(
|
|
pp::platform::PlatformFamily family,
|
|
std::string_view path);
|
|
void flush_legacy_web_persistent_storage();
|
|
[[nodiscard]] bool try_flush_legacy_web_persistent_storage(
|
|
pp::platform::PlatformFamily family);
|
|
[[nodiscard]] int default_legacy_web_canvas_resolution() noexcept;
|
|
[[nodiscard]] bool try_default_legacy_web_canvas_resolution(
|
|
pp::platform::PlatformFamily family,
|
|
int& resolution) noexcept;
|
|
void save_legacy_web_prepared_file(
|
|
std::string_view path,
|
|
std::string_view suggested_name,
|
|
pp::platform::PreparedFileCallback callback);
|
|
[[nodiscard]] bool try_save_legacy_web_prepared_file(
|
|
pp::platform::PlatformFamily family,
|
|
std::string_view path,
|
|
std::string_view suggested_name,
|
|
pp::platform::PreparedFileCallback callback);
|
|
|
|
[[nodiscard]] const pp::platform::PlatformStoragePaths& active_legacy_storage_paths();
|
|
void set_legacy_storage_paths(pp::platform::PlatformStoragePaths paths);
|
|
|
|
}
|