8#if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 201703L
9#error "OpenPine C++ wrapper headers require C++17."
30 InputFloat(
const ffi::InputFloat& data,
const ffi::Input* input =
nullptr)
31 : data_(data), input_(input) {}
33 int64_t
id()
const {
return data_.id; }
37 std::optional<std::string_view>
title()
const {
41 std::optional<std::string_view>
tooltip()
const {
49 std::optional<std::string_view>
group()
const {
53 uint64_t
display()
const {
return data_.display; }
55 bool active()
const {
return data_.active; }
62 return data_.has_min_value ? std::optional(data_.min_value) : std::nullopt;
66 return data_.has_max_value ? std::optional(data_.max_value) : std::nullopt;
69 std::optional<double>
step()
const {
70 return data_.has_step ? std::optional(data_.step) : std::nullopt;
73 bool confirm()
const {
return data_.confirm; }
80 std::optional<double>
optionAt(uintptr_t index)
const {
81 if (!input_)
return std::nullopt;
83 if (ffi::inputFloatOptionAt(input_, index, &out))
return out;
88 ffi::InputFloat data_;
89 const ffi::Input* input_ =
nullptr;
std::optional< std::string_view > optRefToView(bool has_field, const ffi::PineStringRef &ref)
Returns optional string_view when has_field is true, otherwise std::nullopt.
Shared helpers for converting C ABI string refs to std::string_view.
Re-exports FFI types into the openpine namespace.