Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
layout_snapshot.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <pulp/view/view.hpp>
4
5#include <string>
6#include <string_view>
7#include <vector>
8
9namespace pulp::view {
10
12 std::string surface = "view";
13 std::string fixture;
14 float viewport_width = 0.0f;
15 float viewport_height = 0.0f;
16};
17
19 float numeric_bounds_px = 0.0f;
20 float text_box_px = 0.5f;
21};
22
24 std::vector<std::string> messages;
25
26 bool empty() const { return messages.empty(); }
27};
28
34std::string dump_layout_tree(
35 const View& root,
36 const LayoutTreeSnapshotOptions& options = {});
37
45 std::string_view actual_json,
46 std::string_view expected_json,
47 const LayoutTreeTolerance& tolerance = {},
48 LayoutTreeDiff* diff = nullptr);
49
50} // namespace pulp::view
Definition view.hpp:73
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
bool layout_tree_snapshots_equivalent(std::string_view actual_json, std::string_view expected_json, const LayoutTreeTolerance &tolerance={}, LayoutTreeDiff *diff=nullptr)
Compare two dump_layout_tree() JSON strings with the layout oracle rules: node kind/id/visibility/z-o...
std::string dump_layout_tree(const View &root, const LayoutTreeSnapshotOptions &options={})
Dump the current, already-laid-out View tree as deterministic JSON.
Definition layout_snapshot.hpp:23
std::vector< std::string > messages
Definition layout_snapshot.hpp:24
bool empty() const
Definition layout_snapshot.hpp:26
Definition layout_snapshot.hpp:11
float viewport_width
Definition layout_snapshot.hpp:14
float viewport_height
Definition layout_snapshot.hpp:15
std::string fixture
Definition layout_snapshot.hpp:13
std::string surface
Definition layout_snapshot.hpp:12
Definition layout_snapshot.hpp:18
float text_box_px
Definition layout_snapshot.hpp:20
float numeric_bounds_px
Definition layout_snapshot.hpp:19