8#if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 201703L
10 "OpenPine C++ wrapper headers require C++17 (std::optional, std::string_view)."
32 Box(
const ffi::Box* p) : p_(p) {}
37 int64_t
left()
const {
return ffi::boxLeft(p_); }
42 double top()
const {
return ffi::boxTop(p_); }
47 int64_t
right()
const {
return ffi::boxRight(p_); }
52 double bottom()
const {
return ffi::boxBottom(p_); }
59 if (ffi::boxBorderColor(p_, &v)) {
69 int32_t
borderWidth()
const {
return ffi::boxBorderWidth(p_); }
74 LineStyle
borderStyle()
const {
return ffi::boxBorderStyle(p_); }
79 Extend
extend()
const {
return ffi::boxExtend(p_); }
84 XLocation
xloc()
const {
return ffi::boxXloc(p_); }
91 if (ffi::boxBackgroundColor(p_, &v)) {
101 std::string_view
text()
const {
102 ffi::PineStringRef ref;
103 ffi::boxText(p_, &ref);
110 uint32_t
textSize()
const {
return ffi::boxTextSize(p_); }
117 if (ffi::boxTextColor(p_, &v)) {
127 HorizontalAlign
textHalign()
const {
return ffi::boxTextHalign(p_); }
132 VerticalAlign
textValign()
const {
return ffi::boxTextValign(p_); }
137 TextWrap
textWrap()
const {
return ffi::boxTextWrap(p_); }
TextWrap textWrap() const
Gets the text wrapping mode.
std::optional< uint32_t > borderColor() const
Gets the optional border color.
VerticalAlign textValign() const
Gets the text vertical alignment.
bool forceOverlay() const
Gets whether the box is forced to render as overlay.
int32_t borderWidth() const
Gets the border width.
uint32_t textSize() const
Gets the text size.
std::optional< uint32_t > textColor() const
Gets the optional text color.
int64_t left() const
Gets the left x-coordinate.
int64_t right() const
Gets the right x-coordinate.
std::string_view text() const
Gets the text inside the box.
XLocation xloc() const
Gets the X-axis coordinate system used by left()/right().
HorizontalAlign textHalign() const
Gets the text horizontal alignment.
std::optional< uint32_t > backgroundColor() const
Gets the optional background fill color.
Extend extend() const
Gets the extend mode.
double bottom() const
Gets the bottom y-coordinate.
TextFormatting textFormatting() const
Gets the text formatting (bold/italic).
FontFamily textFontFamily() const
Gets the font family.
LineStyle borderStyle() const
Gets the border style.
double top() const
Gets the top y-coordinate.
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.