18#include <system_error>
31 return [processor = &processor, owner = std::move(owner_alive)](
43 std::unique_ptr<view::View>
root;
60 return std::filesystem::path{assets.
theme_path};
65 std::vector<std::filesystem::path> roots;
69 while (!raw.empty()) {
70 const auto split = raw.find(
'|');
71 const auto item = raw.substr(0, split);
72 if (!item.empty()) roots.emplace_back(std::string(item));
73 if (split == std::string_view::npos)
break;
74 raw.remove_prefix(split + 1);
95inline std::vector<view::WidgetBridge::EmbeddedAsset>
97 std::vector<view::WidgetBridge::EmbeddedAsset> files;
98 if (assets.
files ==
nullptr)
101 for (std::size_t i = 0; i < assets.
file_count; ++i) {
103 if (
file.name ==
nullptr ||
file.name[0] ==
'\0' ||
file.data ==
nullptr ||
file.size == 0)
143 const bool dev_file_present = [&] {
144 if (!dev_script_path)
147 return std::filesystem::is_regular_file(*dev_script_path, ec) && !ec;
173 bool enable_hot_reload, std::string*
error,
175 std::string_view storage_identity);
184 static std::atomic<ScriptedEditorBuilder> builder{
nullptr};
199 std::string_view storage_identity = {}) {
204 auto instance = builder(assets, std::move(source), store, enable_hot_reload,
error,
205 std::move(value_channel_access), storage_identity);
209 const std::string missing =
210 "this binary declares a scripted editor but does not link the script runtime; "
211 "declare UI_SCRIPT on the plug-in target or call "
212 "pulp::format::install_scripted_editor_builder()";
221 if (!root &&
error) {
222 *
error =
"AutoUi::build() returned nullptr";
224 return {std::move(root),
nullptr,
false};
233 std::move(value_channel_access));
239 bool enable_hot_reload,
240 std::string*
error =
nullptr,
243 if (value_channels !=
nullptr) {
245 visitor(value_channels);
249 store, enable_hot_reload,
error, std::move(access));
A processor's declared channels.
Definition value_channel_set.hpp:61
std::shared_ptr< State > Handle
Definition alive_token.hpp:53
static bool is_alive(const Handle &handle) noexcept
Definition alive_token.hpp:143
Centralized parameter storage with lock-free value access.
Definition store.hpp:164
static std::unique_ptr< View > build(state::StateStore &store)
Portable try/catch macros for source that must also compile with C++ exceptions disabled (-fno-except...
#define PULP_TRY
Definition exceptions.hpp:42
#define PULP_CATCH_ALL
Definition exceptions.hpp:43
std::function< void(ValueChannelSet *)> ValueChannelVisitor
Runs a value-channel operation while the hosting processor guarantees that the exposed set and all of...
Definition value_channel_set.hpp:52
std::function< void(const ValueChannelVisitor &)> ValueChannelAccess
Definition value_channel_set.hpp:53
void log_error(std::format_string< Args... > fmt, Args &&... args)
Definition log.hpp:195
Source-compatible spelling of <pulp/dataplane/value_channel_set.hpp>.