Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
inspector.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <pulp/view/view.hpp>
6#include <string>
7#include <vector>
8
9namespace pulp::view {
10
11// Introspects a View tree and produces a JSON representation
12// Used by the component inspector and for debugging
14public:
15 // Serialize the entire view tree to formatted JSON
16 static std::string to_json(const View& root);
17
18 // Find a view by ID in the tree
19 static View* find_by_id(View& root, const std::string& id);
20
21 // Find a view by its design-import anchor id. Returns nullptr for an
22 // empty anchor or when no view in the tree carries it. Used by the
23 // inspector's source-jump resolver to map an anchor back to a live View*.
24 static View* find_by_anchor(View& root, const std::string& anchor);
25
26 // Count total views in the tree
27 static size_t count_views(const View& root);
28
29 // Get the type name of a view (e.g., "Knob", "Fader", "View")
30 static std::string type_name(const View& view);
31
32 // ── Inspector window helpers ────────────────────────────────────────
33
36 static void populate_tree(TreeNode& parent, const View& root);
37
40 static std::vector<PropertyList::Property> view_properties(const View& view);
41
43 static Rect absolute_bounds(const View& view);
44};
45
46} // namespace pulp::view
Definition inspector.hpp:13
static size_t count_views(const View &root)
static View * find_by_id(View &root, const std::string &id)
static std::vector< PropertyList::Property > view_properties(const View &view)
Build a list of properties for display in a PropertyList.
static Rect absolute_bounds(const View &view)
Compute absolute bounds by walking the parent chain.
static void populate_tree(TreeNode &parent, const View &root)
Recursively populate a TreeNode hierarchy from a View tree.
static std::string to_json(const View &root)
static std::string type_name(const View &view)
static View * find_by_anchor(View &root, const std::string &anchor)
Definition view.hpp:73
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
Axis-aligned rectangle in continuous (float) coordinates.
Definition geometry.hpp:52
A node in the tree hierarchy.
Definition tree_view.hpp:18
Hierarchical tree display widget for file browsers, plugin lists, etc.