8#if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 201703L
10 "OpenPine C++ wrapper headers require C++17 (std::optional, std::string_view)."
29 const ffi::PlotShape* p_;
38 std::optional<std::string_view>
title()
const {
39 ffi::PineStringRef ref;
40 if (ffi::plotShapeTitle(p_, &ref)) {
50 std::optional<double>
value(uintptr_t idx)
const {
52 if (ffi::plotShapeValue(p_, idx, &v)) {
62 std::optional<bool>
boolValue(uintptr_t idx)
const {
64 if (ffi::plotShapeBoolValue(p_, idx, &v)) {
74 ffi::Shape
style()
const {
return ffi::plotShapeStyle(p_); }
79 ffi::Location
location()
const {
return ffi::plotShapeLocation(p_); }
84 std::optional<uint32_t>
color(uintptr_t idx)
const {
86 if (ffi::plotShapeColor(p_, idx, &col)) {
96 int32_t
offset()
const {
return ffi::plotShapeOffset(p_); }
101 std::optional<std::string_view>
text()
const {
102 ffi::PineStringRef ref;
103 if (ffi::plotShapeText(p_, &ref)) {
113 std::optional<uint32_t>
textColor(uintptr_t idx)
const {
115 if (ffi::plotShapeTextColor(p_, idx, &col)) {
125 bool editable()
const {
return ffi::plotShapeEditable(p_); }
130 ffi::Size
size()
const {
return ffi::plotShapeSize(p_); }
137 if (ffi::plotShapeShowLast(p_, &v)) {
152 std::optional<std::string_view>
format()
const {
153 ffi::PineStringRef ref;
154 if (ffi::plotShapeFormat(p_, &ref)) {
166 if (ffi::plotShapePrecision(p_, &v)) {
A type-safe display bitmask.
bool editable() const
Returns whether the plot-shape is editable.
std::optional< std::string_view > format() const
Gets the optional formatting hint.
ffi::Shape style() const
Gets the shape style.
std::optional< int32_t > precision() const
Gets the optional decimal precision.
std::optional< bool > boolValue(uintptr_t idx) const
Gets the series value at the specified index interpreted as boolean.
Display display() const
Gets the display bitmask.
int32_t offset() const
Gets the bar index offset.
std::optional< std::string_view > text() const
Gets the optional text string.
std::optional< std::string_view > title() const
Gets the title.
std::optional< uint32_t > color(uintptr_t idx) const
Gets the per-bar color.
std::optional< double > value(uintptr_t idx) const
Gets the series numeric value at the specified index.
std::optional< uint32_t > textColor(uintptr_t idx) const
Gets the per-bar text color.
bool forceOverlay() const
Gets whether the plot-shape is forced to render as overlay.
ffi::Size size() const
Gets the shape size.
std::optional< uintptr_t > showLast() const
Gets the show_last value, if set.
ffi::Location location() const
Gets the placement location.
PlotShape(const ffi::PlotShape *p)
Type-safe wrappers for display bitmasks used by visuals.
std::string_view refToView(const ffi::PineStringRef &ref)
Shared helpers for converting C ABI string refs to std::string_view.