Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
design_ir_io.hpp
Go to the documentation of this file.
1#pragma once
2
8
10
11#include <cstddef>
12#include <stdexcept>
13#include <string>
14#include <vector>
15
16namespace pulp::view {
17
20
25
31std::vector<IRBoxShadow> parse_css_box_shadow(const std::string& css);
32
36std::string box_shadow_to_css(const std::vector<IRBoxShadow>& shadows);
37
41std::string serialize_design_ir(const DesignIR& ir, const DesignIrJsonOptions& options = {});
42
48struct DesignIrParseError : std::runtime_error {
49 DesignIrParseError(const std::string& message, std::size_t byte_offset)
50 : std::runtime_error(message), offset(byte_offset) {}
51 std::size_t offset;
52};
53
57inline constexpr std::size_t kMaxDesignIrJsonDepth = 512;
58
64DesignIR parse_design_ir_json(const std::string& json);
65
75 const DesignIrAssetOptions& options = {});
76
80
81} // namespace pulp::view
Normalized intermediate representation (IR) for imported designs: the IR value model (style,...
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
std::string box_shadow_to_css(const std::vector< IRBoxShadow > &shadows)
Serialize ordered box-shadow layers back to a CSS box-shadow string, preferring each layer's raw text...
std::vector< IRBoxShadow > parse_css_box_shadow(const std::string &css)
Parse a CSS box-shadow value into ordered layers.
std::string serialize_design_ir(const DesignIR &ir, const DesignIrJsonOptions &options={})
Serialize a DesignIR as a deterministic, versioned canonical JSON envelope.
IRAssetManifest collect_design_ir_assets(const DesignIR &ir, const DesignIrAssetOptions &options={})
Collect all external resources referenced by the IR into a manifest.
std::size_t promote_interactive_frames(IRNode &root)
Promote parsed frame nodes carrying click/ARIA/cursor signals to button.
WidgetPromotionSignal classify_interactive_signal(const IRNode &node)
Inspect one IR node for interactive-frame promotion signals.
void refresh_design_ir_asset_manifest(DesignIR &ir, const DesignIrAssetOptions &options={})
Refresh ir.asset_manifest from the current tree while preserving embedded manifest entries whose stab...
DesignIR parse_design_ir_json(const std::string &json)
Parse either the v1 canonical envelope or a legacy bare-node IR JSON document.
constexpr std::size_t kMaxDesignIrJsonDepth
Deepest object/array nesting parse_design_ir_json accepts.
Definition design_ir_io.hpp:57
WidgetPromotionSignal
Heuristic signals that a parsed frame is interactive enough to promote from a static frame to a butto...
Definition design_ir.hpp:339
STL namespace.
Complete design IR document.
Definition design_ir.hpp:791
Definition design_ir.hpp:815
Definition design_ir.hpp:808
std::size_t offset
Definition design_ir_io.hpp:51
DesignIrParseError(const std::string &message, std::size_t byte_offset)
Definition design_ir_io.hpp:49
Definition design_ir.hpp:739
Definition design_ir.hpp:614