Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
web_view.hpp File Reference
#include <string>
#include <functional>
#include <filesystem>
#include <memory>
#include <optional>
#include <vector>

Go to the source code of this file.

Classes

struct  pulp::view::WebViewOptions
struct  pulp::view::WebViewOptions::Resource
struct  pulp::view::WebViewMessage
struct  pulp::view::WebViewEmbeddedAsset
struct  pulp::view::detail::WebViewBackendProvider
 The answer behind detect_webview_backend() and webview_backend_available(). More...
class  pulp::view::WebViewPanel

Namespaces

namespace  pulp
namespace  pulp::view
 Hover-cursor tracking for platform window hosts.
namespace  pulp::view::detail

Functions

std::string pulp::view::encode_webview_message_json (const WebViewMessage &message)
 Encode a structured WebView message to canonical JSON.
bool pulp::view::decode_webview_message_json (const std::string &json, WebViewMessage &message)
 Decode a structured WebView message from JSON.
std::string pulp::view::make_webview_bridge_bootstrap_script ()
 JavaScript helper that installs a small window.pulp bridge on a page.
std::string pulp::view::make_webview_eval_script (const std::string &request_id, const std::string &js_source)
 JavaScript wrapper that evaluates user code asynchronously and reports the result back through the internal __pulpEvalResult bridge.
std::string pulp::view::guess_webview_mime_type (const std::string &path)
 Best-effort MIME type guess for an HTML-linked asset path.
std::string pulp::view::make_webview_data_uri (const std::string &mime_type, const std::vector< uint8_t > &bytes)
 Create a data: URI for an embedded WebView asset.
std::string pulp::view::load_webview_embedded_text (const std::string &embedded_name)
 Load a UTF-8 text asset previously registered with AssetManager.
std::string pulp::view::make_webview_offline_html (const std::string &html, const std::vector< WebViewEmbeddedAsset > &assets)
 Rewrite simple src/href references in HTML to offline data: URIs backed by embedded assets.
std::string pulp::view::make_webview_offline_html_from_embedded (const std::string &html_embedded_name, const std::vector< WebViewEmbeddedAsset > &assets)
 Load embedded HTML and rewrite its referenced assets for offline use.
std::optional< WebViewOptions::Resource > pulp::view::fetch_webview_embedded_resource (const std::string &path, const std::string &html_embedded_name, const std::vector< WebViewEmbeddedAsset > &assets)
 Fetch a single embedded resource for a WebView custom resource server.
WebViewOptions::FetchResource pulp::view::make_webview_embedded_resource_fetcher (std::string html_embedded_name, std::vector< WebViewEmbeddedAsset > assets)
 Create a resource callback that serves embedded HTML/assets through CHOC's fetchResource/customSchemeURI path.
std::optional< WebViewOptions::Resource > pulp::view::fetch_webview_directory_resource (const std::string &path, const std::filesystem::path &root_directory, std::string index_filename="index.html")
 Fetch a single file-system resource for a WebView custom resource server.
WebViewOptions::FetchResource pulp::view::make_webview_directory_resource_fetcher (std::filesystem::path root_directory, std::string index_filename="index.html")
 Create a resource callback that serves files from a directory through CHOC's fetchResource/customSchemeURI path.
std::string pulp::view::detect_webview_backend ()
 Identifies the live WebView backend on this platform / build.
bool pulp::view::webview_backend_available ()
 Returns true if the host process has a usable WebView backend.
const WebViewBackendProvider * pulp::view::detail::set_webview_backend_provider (const WebViewBackendProvider *provider)
 Install an override provider (for tests), or with nullptr remove it so the linked provider answers again; returns the override it replaced.