Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
widget_gallery.hpp
Go to the documentation of this file.
1#pragma once
2
3// Widget gallery — a single themed view tree laying out a representative board
4// of Pulp's UI primitives (buttons, knobs, faders, meters, inputs, an XY pad,
5// a dropdown, segmented controls, a channel strip, a MIDI keyboard, status and
6// feedback surfaces, …). Not an exhaustive catalog — a legible cross-section.
7// It is three things at once (Design-System-Import-Plan §9):
8// * living documentation of what Pulp's UI supports,
9// * the reskin preview surface (swap the theme, everything restyles),
10// * the visual-regression corpus for themed render diffs.
11//
12// Returned root is sized to GALLERY_WIDTH × the height it computes; render it
13// headlessly with render_to_png / render_to_file, or mount it in a window.
14
15#include <pulp/view/view.hpp>
16#include <pulp/view/theme.hpp>
17#include <memory>
18
19namespace pulp::view {
20
21constexpr float GALLERY_WIDTH = 940.0f;
22
23// Build the gallery board with `theme` applied to the root (descendants resolve
24// their colors up the parent chain). The root's bounds height is set to fit.
25std::unique_ptr<View> build_widget_gallery(const Theme& theme);
26
27// Wrap build_widget_gallery in a ScrollView sized to a `viewport_w × viewport_h`
28// window, scrollable in both axes so a host smaller than the full board can
29// still reach every widget. `content_size` is the full board's size; the board
30// is the ScrollView's single child. Use this for a live/mounted surface (e.g. a
31// plugin editor); use build_widget_gallery directly for a full-content headless
32// capture.
33std::unique_ptr<View> build_scrolling_widget_gallery(const Theme& theme,
34 float viewport_w,
35 float viewport_h);
36
37} // namespace pulp::view
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
std::unique_ptr< View > build_widget_gallery(const Theme &theme)
constexpr float GALLERY_WIDTH
Definition widget_gallery.hpp:21
std::unique_ptr< View > build_scrolling_widget_gallery(const Theme &theme, float viewport_w, float viewport_h)
Definition theme.hpp:32