8#if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 201703L
10 "OpenPine C++ wrapper headers require C++17 (std::optional, std::string_view)."
32 Label(
const ffi::Label* p) : p_(p) {}
37 int64_t
x()
const {
return ffi::labelX(p_); }
42 double y()
const {
return ffi::labelY(p_); }
47 std::string_view
text()
const {
48 ffi::PineStringRef ref;
49 ffi::labelText(p_, &ref);
56 XLocation
xloc()
const {
return ffi::labelXloc(p_); }
61 YLocation
yloc()
const {
return ffi::labelYloc(p_); }
66 std::optional<uint32_t>
color()
const {
68 if (ffi::labelColor(p_, &v)) {
78 LabelStyle
style()
const {
return ffi::labelStyle(p_); }
85 if (ffi::labelTextColor(p_, &v)) {
95 uint32_t
size()
const {
return ffi::labelSize(p_); }
100 HorizontalAlign
textAlign()
const {
return ffi::labelTextAlign(p_); }
105 std::optional<std::string_view>
tooltip()
const {
106 ffi::PineStringRef ref;
107 if (ffi::labelTooltip(p_, &ref)) {
FontFamily textFontFamily() const
Gets the font family.
bool forceOverlay() const
Gets whether the label is forced to render as overlay.
uint32_t size() const
Gets the label text size.
std::optional< std::string_view > tooltip() const
Gets the optional tooltip.
TextFormatting textFormatting() const
Gets the text formatting (bold/italic).
XLocation xloc() const
Gets the X-axis coordinate system used by x().
std::optional< uint32_t > color() const
Gets the optional label background color.
std::optional< uint32_t > textColor() const
Gets the optional label text color.
HorizontalAlign textAlign() const
Gets the horizontal text alignment.
std::string_view text() const
Gets the label text.
LabelStyle style() const
Gets the label shape/style.
int64_t x() const
Gets the label X position.
Label(const ffi::Label *p)
double y() const
Gets the label Y position.
YLocation yloc() const
Gets the Y-axis coordinate system used by y().
std::string_view refToView(const ffi::PineStringRef &ref)
Shared helpers for converting C ABI string refs to std::string_view.
Re-exports FFI types into the openpine namespace.