Documentation
¶
Overview ¶
Package bindings wraps the FerrumGUI C ABI for use by the public Go API.
This package is internal and must not be imported by application code.
Index ¶
- Constants
- func AllocRadioGroupID(app uint64) (uint64, error)
- func AppDispatch(app uint64, fn func()) error
- func AppLoadFontFile(app uint64, path string) error
- func AppQueryScaleFactor(app uint64) float64
- func AppQuerySystemAppearance(app uint64) uint32
- func AppSetReducedMotion(app uint64, enabled bool) error
- func AppSetTheme(app uint64, mode uint32) error
- func AppSetThemePalette(app uint64, p ThemePalette) error
- func CanvasClear(app, node uint64) error
- func CanvasFillRect(app, node uint64, x, y, w, h float32, color RGBA) error
- func CanvasStrokeRect(app, node uint64, x, y, w, h, width float32, color RGBA) error
- func CheckboxGetChecked(app, node uint64) (bool, error)
- func CheckboxSetChecked(app, node uint64, checked bool) error
- func CreateAccordion(app uint64, titles []string, children []uint64) (uint64, error)
- func CreateApp() (uint64, error)
- func CreateAvatar(app uint64, initials string) (uint64, error)
- func CreateBadge(app uint64, text string) (uint64, error)
- func CreateButton(app uint64, text string) (uint64, error)
- func CreateCanvas(app uint64) (uint64, error)
- func CreateCard(app, child uint64) (uint64, error)
- func CreateCheckbox(app uint64, text string, checked bool) (uint64, error)
- func CreateDialog(app uint64, title string, body uint64) (uint64, error)
- func CreateGrid(app uint64, children []uint64, columns int) (uint64, error)
- func CreateGroupBox(app uint64, title string, child uint64) (uint64, error)
- func CreateHBox(app uint64, children []uint64) (uint64, error)
- func CreateIcon(app uint64, glyph string) (uint64, error)
- func CreateImage(app uint64, alt string) (uint64, error)
- func CreateLabel(app uint64, text string) (uint64, error)
- func CreateLink(app uint64, text string) (uint64, error)
- func CreateListView(app uint64, items []string) (uint64, error)
- func CreateNumberInput(app uint64, value, min, max, step float64) (uint64, error)
- func CreateOverlay(app, base uint64, layers []uint64) (uint64, error)
- func CreateProgress(app uint64, value float32) (uint64, error)
- func CreateRadio(app uint64, text string, groupID uint64, selected bool) (uint64, error)
- func CreateRadioGroup(app uint64, groupID uint64, children []uint64) (uint64, error)
- func CreateRangeSlider(app uint64, low, high, min, max float32) (uint64, error)
- func CreateScrollView(app, child uint64) (uint64, error)
- func CreateSelect(app uint64, options []string, selected int) (uint64, error)
- func CreateSeparator(app uint64, horizontal bool) (uint64, error)
- func CreateSlider(app uint64, value, min, max float32) (uint64, error)
- func CreateSpacer(app uint64) (uint64, error)
- func CreateSpinner(app uint64) (uint64, error)
- func CreateSplitView(app, first, second uint64, ratio float32, horizontal bool) (uint64, error)
- func CreateStack(app uint64, children []uint64) (uint64, error)
- func CreateStubWidget(app uint64, label string) (uint64, error)
- func CreateSwitch(app uint64, text string, on bool) (uint64, error)
- func CreateTable(app uint64, columns []string, rowCount uint32, rowHeight float32) (uint64, error)
- func CreateTabs(app uint64, titles []string, children []uint64) (uint64, error)
- func CreateTextArea(app uint64, text string) (uint64, error)
- func CreateTextInput(app uint64, text string) (uint64, error)
- func CreateToast(app uint64, message string) (uint64, error)
- func CreateTooltip(app uint64, text string) (uint64, error)
- func CreateVBox(app uint64, children []uint64) (uint64, error)
- func CreateVirtualList(app uint64, rowCount uint32, rowHeight float32) (uint64, error)
- func CreateWindow(app uint64, title string, width, height int) (uint64, error)
- func DestroyApp(app uint64) error
- func DestroyWindow(window uint64) error
- func DialogGetOpen(app, node uint64) (bool, error)
- func DialogSetOpen(app, node uint64, open bool) error
- func EnsureABI() error
- func NodeGetState(app, node uint64) (uint32, error)
- func NodeGetText(app, node uint64) (string, error)
- func NodeSetLayout(app, node uint64, layout Layout) error
- func NodeSetState(app, node uint64, flags uint32) error
- func NodeSetStyle(app, node uint64, style Style) error
- func NodeSetText(app, node uint64, text string) error
- func NumberInputGetValue(app, node uint64) (float64, error)
- func PlatformDnDSupported() bool
- func PlatformOpenURL(url string) error
- func PlatformPickDirectory() (string, error)
- func PlatformPickOpenFile() (string, error)
- func PlatformPickSaveFile() (string, error)
- func ProgressGetValue(app, node uint64) (float32, error)
- func ProgressSetValue(app, node uint64, value float32) error
- func RadioGetSelected(app, node uint64) (bool, error)
- func ReleaseCallback(h CallbackHandle)
- func RunApp(app uint64) error
- func SelectGetSelected(app, node uint64) (int, error)
- func SliderGetValue(app, node uint64) (float32, error)
- func SliderSetValue(app, node uint64, value float32) error
- func SwitchGetOn(app, node uint64) (bool, error)
- func SwitchSetOn(app, node uint64, on bool) error
- func TableSetWindowCells(app, node uint64, cells []string) error
- func TabsGetSelected(app, node uint64) (int, error)
- func TabsSetSelected(app, node uint64, selected int) error
- func TextInputSetPassword(app, node uint64, password bool) error
- func ToastSetVisible(app, node uint64, visible bool) error
- func VirtualListSetRowCount(app, node uint64, rowCount uint32) error
- func VirtualListSetWindowLabels(app, node uint64, labels []string) error
- func WindowConfirmClose(window uint64) error
- func WindowGetScaleFactor(window uint64) (float64, error)
- func WindowSetFullscreen(window uint64, fullscreen bool) error
- func WindowSetMaxSize(window uint64, width, height int) error
- func WindowSetMinSize(window uint64, width, height int) error
- func WindowSetOnClose(window uint64, fn func()) error
- func WindowSetResizable(window uint64, resizable bool) error
- func WindowSetRoot(window, root uint64) error
- func WindowSetSize(window uint64, width, height int) error
- func WindowSetTitle(window uint64, title string) error
- type CallbackHandle
- func ButtonSetOnClick(app, node uint64, fn func()) (CallbackHandle, error)
- func CheckboxSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
- func DialogSetOnClose(app, node uint64, fn func()) (CallbackHandle, error)
- func LinkSetOnClick(app, node uint64, fn func()) (CallbackHandle, error)
- func NumberInputSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
- func RadioSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
- func RangeSliderSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
- func SelectSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
- func SliderSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
- func SwitchSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
- func TabsSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
- func TextInputSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
- type Dim
- type FgDim
- type FgLayout
- type FgRGBA
- type FgStyle
- type FgThemePalette
- type Layout
- type RGBA
- type StatusError
- type Style
- type ThemePalette
Constants ¶
const ( DimUnset = 0 DimAuto = 1 DimLength = 2 DimPercent = 3 )
Dimension kind constants matching FG_DIM_*.
const ( AlignUnset = 0 AlignStart = 1 AlignCenter = 2 AlignEnd = 3 AlignStretch = 4 )
Align items constants matching FG_ALIGN_*.
const ( JustifyUnset = 0 JustifyStart = 1 JustifyCenter = 2 JustifyEnd = 3 JustifySpaceBetween = 4 JustifySpaceAround = 5 JustifySpaceEvenly = 6 )
Justify content constants matching FG_JUSTIFY_*.
const ( PosUnset = 0 PosRelative = 1 PosAbsolute = 2 )
Position mode constants matching FG_POS_*.
const ( OverflowUnset = 0 OverflowVisible = 1 OverflowHidden = 2 )
Overflow mode constants matching FG_OVERFLOW_*.
const ( StatusOK = 0 StatusErr = -1 StatusInvalidArg = -2 StatusBufferTooSmall = -3 StatusInvalidHandle = -4 StatusClosed = -5 StatusNotImplemented = -6 StatusGPU = -7 StatusWrongThread = -8 )
Native status codes from include/ferrumgui.h.
const ( ThemeLight = 0 ThemeDark = 1 ThemeCustom = 2 )
Theme mode constants matching FG_THEME_*.
const ExpectedABI = 1
ExpectedABI is the ABI major version required by this Go module. Keep in sync with ferrumgui.ABIVersion and ferrumgui_core::ABI_VERSION.
Variables ¶
This section is empty.
Functions ¶
func AllocRadioGroupID ¶
func AppDispatch ¶
AppDispatch queues fn on the UI thread. The handle is deleted after the callback runs.
func AppLoadFontFile ¶
func AppQueryScaleFactor ¶
func AppSetReducedMotion ¶
func AppSetTheme ¶
func AppSetThemePalette ¶
func AppSetThemePalette(app uint64, p ThemePalette) error
func CanvasClear ¶
func CanvasStrokeRect ¶
func CheckboxGetChecked ¶
func CheckboxSetChecked ¶
func CreateAccordion ¶
func CreateCanvas ¶
func CreateCard ¶
func CreateNumberInput ¶
func CreateRadio ¶
func CreateRadioGroup ¶
func CreateRangeSlider ¶
func CreateScrollView ¶
func CreateSpacer ¶
func CreateSpinner ¶
func CreateSplitView ¶
func CreateTable ¶
func CreateVirtualList ¶
func DestroyApp ¶
func DestroyWindow ¶
func DialogGetOpen ¶
func DialogSetOpen ¶
func EnsureABI ¶
func EnsureABI() error
EnsureABI checks that the loaded native library matches ExpectedABI.
func NodeGetState ¶
func NodeGetText ¶
func NodeSetLayout ¶
func NodeSetState ¶
func NodeSetStyle ¶
func NodeSetText ¶
func NumberInputGetValue ¶
func PlatformDnDSupported ¶
func PlatformDnDSupported() bool
func PlatformOpenURL ¶
func PlatformPickDirectory ¶
func PlatformPickOpenFile ¶
func PlatformPickSaveFile ¶
func ProgressGetValue ¶
func ProgressSetValue ¶
func RadioGetSelected ¶
func ReleaseCallback ¶
func ReleaseCallback(h CallbackHandle)
ReleaseCallback marks the callback released and unpins when no invocation is in flight. Safe to call from within the callback itself (self-removal); Unpin is deferred until return. Double-release is a no-op.
func SelectGetSelected ¶
func SliderGetValue ¶
func SliderSetValue ¶
func SwitchGetOn ¶
func SwitchSetOn ¶
func TableSetWindowCells ¶
func TabsGetSelected ¶
func TabsSetSelected ¶
func TextInputSetPassword ¶
func ToastSetVisible ¶
func VirtualListSetRowCount ¶
func WindowConfirmClose ¶
func WindowGetScaleFactor ¶
func WindowSetFullscreen ¶
func WindowSetMaxSize ¶
func WindowSetMinSize ¶
func WindowSetOnClose ¶
func WindowSetResizable ¶
func WindowSetRoot ¶
func WindowSetSize ¶
func WindowSetTitle ¶
Types ¶
type CallbackHandle ¶
type CallbackHandle uintptr
CallbackHandle is an opaque callback registration token. It must not be coerced to unsafe.Pointer for the C ABI; pass the userdata pointer returned by newCallback instead.
func ButtonSetOnClick ¶
func ButtonSetOnClick(app, node uint64, fn func()) (CallbackHandle, error)
ButtonSetOnClick registers a Go callback for button clicks. The returned handle must be deleted when the button is discarded.
func CheckboxSetOnChange ¶
func CheckboxSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
func DialogSetOnClose ¶
func DialogSetOnClose(app, node uint64, fn func()) (CallbackHandle, error)
func LinkSetOnClick ¶
func LinkSetOnClick(app, node uint64, fn func()) (CallbackHandle, error)
func NumberInputSetOnChange ¶
func NumberInputSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
func RadioSetOnChange ¶
func RadioSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
func RangeSliderSetOnChange ¶
func RangeSliderSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
func SelectSetOnChange ¶
func SelectSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
func SliderSetOnChange ¶
func SliderSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
func SwitchSetOnChange ¶
func SwitchSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
func TabsSetOnChange ¶
func TabsSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
func TextInputSetOnChange ¶
func TextInputSetOnChange(app, node uint64, fn func()) (CallbackHandle, error)
type FgLayout ¶
type FgLayout struct {
HasFlexGrow uint8
HasFlexShrink uint8
HasGap uint8
HasPadding uint8
FlexGrow float32
FlexShrink float32
Gap float32
Padding float32
Width FgDim
Height FgDim
MinWidth FgDim
MinHeight FgDim
MaxWidth FgDim
MaxHeight FgDim
AlignItems uint8
JustifyContent uint8
Position uint8
Overflow uint8
Left FgDim
Top FgDim
Right FgDim
Bottom FgDim
}
type FgRGBA ¶
type FgRGBA struct{ R, G, B, A float32 }
ABI struct mirrors used by Purego RegisterLibFunc (layout must match C).
type FgStyle ¶
type FgStyle struct {
HasBackground uint8
Background FgRGBA
HasForeground uint8
Foreground FgRGBA
HasBorderColor uint8
BorderColor FgRGBA
HasBorderWidth uint8
HasCornerRadius uint8
HasPadding uint8
HasMargin uint8
HasOpacity uint8
HasFontSize uint8
HasShadowBlur uint8
HasFontFamily uint8
BorderWidth float32
CornerRadius float32
Padding float32
Margin float32
Opacity float32
FontSize float32
ShadowBlur float32
FontFamily uint8
HasFontWeight uint8
FontItalic uint8
HasTextWrap uint8
FontWeight uint16
TextWrap uint8
HasTextOverflow uint8
TextOverflow uint8
// contains filtered or unexported fields
}
type FgThemePalette ¶
type Layout ¶
type Layout struct {
HasFlexGrow bool
HasFlexShrink bool
HasGap bool
HasPadding bool
FlexGrow float32
FlexShrink float32
Gap float32
Padding float32
Width Dim
Height Dim
MinWidth Dim
MinHeight Dim
MaxWidth Dim
MaxHeight Dim
AlignItems uint8
JustifyContent uint8
Position uint8
Overflow uint8
Left Dim
Top Dim
Right Dim
Bottom Dim
}
Layout mirrors fg_layout.
type StatusError ¶
StatusError is a native ABI error with an optional engine message.
func (*StatusError) Error ¶
func (e *StatusError) Error() string
type Style ¶
type Style struct {
HasBackground bool
Background RGBA
HasForeground bool
Foreground RGBA
HasBorderColor bool
BorderColor RGBA
HasBorderWidth bool
BorderWidth float32
HasCornerRadius bool
CornerRadius float32
HasPadding bool
Padding float32
HasMargin bool
Margin float32
HasOpacity bool
Opacity float32
HasFontSize bool
FontSize float32
HasShadowBlur bool
ShadowBlur float32
HasFontFamily bool
FontFamily uint8
HasFontWeight bool
FontWeight uint16
FontItalic bool
HasTextWrap bool
TextWrap uint8
HasTextOverflow bool
TextOverflow uint8
}
Style mirrors fg_style.