#include <resizable_shell.hpp>
Public Member Functions | |
| ResizableShell (ResizableShellConfig cfg={}) | |
| Construct with a config. | |
| Size | negotiate (Size requested) const |
| Intended size → clamped to [min, max] and (when aspect is locked) snapped to the nearest aspect-correct rectangle. | |
| Size | apply (Size requested) |
| Commit the new size. Returns the clamped size actually applied. | |
| Size | current () const |
| const ResizableShellConfig & | config () const |
| std::vector< uint8_t > | serialize () const |
| Serialize the saved size to 8 bytes (little-endian u32 w, h). | |
| bool | deserialize (std::span< const uint8_t > blob) |
| Restore from a blob produced by serialize(). | |
|
inlineexplicit |
Construct with a config.
current() is seeded by passing cfg.initial_size through negotiate(), so a misconfigured initial (outside min/max or violating aspect) reports the clamped size from the very first call — callers can never observe an invalid state. Fix per #206 review.
Commit the new size. Returns the clamped size actually applied.
|
inline |
|
inline |
| bool pulp::view::ResizableShell::deserialize | ( | std::span< const uint8_t > | blob | ) |
Restore from a blob produced by serialize().
Returns false on short buffer or malformed payload. On success the size is also renegotiated through the current config so out-of-range saves (e.g. exported from a wider min/max) are clamped cleanly.
Intended size → clamped to [min, max] and (when aspect is locked) snapped to the nearest aspect-correct rectangle.
| std::vector< uint8_t > pulp::view::ResizableShell::serialize | ( | ) | const |
Serialize the saved size to 8 bytes (little-endian u32 w, h).
Plugins concatenate this with their parameter blob so the host's state round-trip restores the window size too.