bindings

package
v0.0.0-...-3f3fba7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const (
	DimUnset   = 0
	DimAuto    = 1
	DimLength  = 2
	DimPercent = 3
)

Dimension kind constants matching FG_DIM_*.

View Source
const (
	AlignUnset   = 0
	AlignStart   = 1
	AlignCenter  = 2
	AlignEnd     = 3
	AlignStretch = 4
)

Align items constants matching FG_ALIGN_*.

View Source
const (
	JustifyUnset        = 0
	JustifyStart        = 1
	JustifyCenter       = 2
	JustifyEnd          = 3
	JustifySpaceBetween = 4
	JustifySpaceAround  = 5
	JustifySpaceEvenly  = 6
)

Justify content constants matching FG_JUSTIFY_*.

View Source
const (
	PosUnset    = 0
	PosRelative = 1
	PosAbsolute = 2
)

Position mode constants matching FG_POS_*.

View Source
const (
	OverflowUnset   = 0
	OverflowVisible = 1
	OverflowHidden  = 2
)

Overflow mode constants matching FG_OVERFLOW_*.

View Source
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.

View Source
const (
	ThemeLight  = 0
	ThemeDark   = 1
	ThemeCustom = 2
)

Theme mode constants matching FG_THEME_*.

View Source
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 AllocRadioGroupID(app uint64) (uint64, error)

func AppDispatch

func AppDispatch(app uint64, fn func()) error

AppDispatch queues fn on the UI thread. The handle is deleted after the callback runs.

func AppLoadFontFile

func AppLoadFontFile(app uint64, path string) error

func AppQueryScaleFactor

func AppQueryScaleFactor(app uint64) float64

func AppQuerySystemAppearance

func AppQuerySystemAppearance(app uint64) uint32

func AppSetReducedMotion

func AppSetReducedMotion(app uint64, enabled bool) error

func AppSetTheme

func AppSetTheme(app uint64, mode uint32) error

func AppSetThemePalette

func AppSetThemePalette(app uint64, p ThemePalette) error

func CanvasClear

func CanvasClear(app, node uint64) error

func CanvasFillRect

func CanvasFillRect(app, node uint64, x, y, w, h float32, color RGBA) error

func CanvasStrokeRect

func CanvasStrokeRect(app, node uint64, x, y, w, h, width float32, color RGBA) error

func CheckboxGetChecked

func CheckboxGetChecked(app, node uint64) (bool, error)

func CheckboxSetChecked

func CheckboxSetChecked(app, node uint64, checked bool) error

func CreateAccordion

func CreateAccordion(app uint64, titles []string, children []uint64) (uint64, error)

func CreateApp

func CreateApp() (uint64, error)

func CreateAvatar

func CreateAvatar(app uint64, initials string) (uint64, error)

func CreateBadge

func CreateBadge(app uint64, text string) (uint64, error)

func CreateButton

func CreateButton(app uint64, text string) (uint64, error)

func CreateCanvas

func CreateCanvas(app uint64) (uint64, error)

func CreateCard

func CreateCard(app, child uint64) (uint64, error)

func CreateCheckbox

func CreateCheckbox(app uint64, text string, checked bool) (uint64, error)

func CreateDialog

func CreateDialog(app uint64, title string, body uint64) (uint64, error)

func CreateGrid

func CreateGrid(app uint64, children []uint64, columns int) (uint64, error)

func CreateGroupBox

func CreateGroupBox(app uint64, title string, child uint64) (uint64, error)

func CreateHBox

func CreateHBox(app uint64, children []uint64) (uint64, error)

func CreateIcon

func CreateIcon(app uint64, glyph string) (uint64, error)

func CreateImage

func CreateImage(app uint64, alt string) (uint64, error)

func CreateLabel

func CreateLabel(app uint64, text string) (uint64, error)
func CreateLink(app uint64, text string) (uint64, error)

func CreateListView

func CreateListView(app uint64, items []string) (uint64, error)

func CreateNumberInput

func CreateNumberInput(app uint64, value, min, max, step float64) (uint64, error)

func CreateOverlay

func CreateOverlay(app, base uint64, layers []uint64) (uint64, error)

func CreateProgress

func CreateProgress(app uint64, value float32) (uint64, error)

func CreateRadio

func CreateRadio(app uint64, text string, groupID uint64, selected bool) (uint64, error)

func CreateRadioGroup

func CreateRadioGroup(app uint64, groupID uint64, children []uint64) (uint64, error)

func CreateRangeSlider

func CreateRangeSlider(app uint64, low, high, min, max float32) (uint64, error)

func CreateScrollView

func CreateScrollView(app, child uint64) (uint64, error)

func CreateSelect

func CreateSelect(app uint64, options []string, selected int) (uint64, error)

func CreateSeparator

func CreateSeparator(app uint64, horizontal bool) (uint64, error)

func CreateSlider

func CreateSlider(app uint64, value, min, max float32) (uint64, error)

func CreateSpacer

func CreateSpacer(app uint64) (uint64, error)

func CreateSpinner

func CreateSpinner(app uint64) (uint64, error)

func CreateSplitView

func CreateSplitView(app, first, second uint64, ratio float32, horizontal bool) (uint64, error)

func CreateStack

func CreateStack(app uint64, children []uint64) (uint64, error)

func CreateStubWidget

func CreateStubWidget(app uint64, label string) (uint64, error)

func CreateSwitch

func CreateSwitch(app uint64, text string, on bool) (uint64, error)

func CreateTable

func CreateTable(app uint64, columns []string, rowCount uint32, rowHeight float32) (uint64, error)

func CreateTabs

func CreateTabs(app uint64, titles []string, children []uint64) (uint64, error)

func CreateTextArea

func CreateTextArea(app uint64, text string) (uint64, error)

func CreateTextInput

func CreateTextInput(app uint64, text string) (uint64, error)

func CreateToast

func CreateToast(app uint64, message string) (uint64, error)

func CreateTooltip

func CreateTooltip(app uint64, text string) (uint64, error)

func CreateVBox

func CreateVBox(app uint64, children []uint64) (uint64, error)

func CreateVirtualList

func CreateVirtualList(app uint64, rowCount uint32, rowHeight float32) (uint64, error)

func CreateWindow

func CreateWindow(app uint64, title string, width, height int) (uint64, error)

func DestroyApp

func DestroyApp(app uint64) error

func DestroyWindow

func DestroyWindow(window uint64) error

func DialogGetOpen

func DialogGetOpen(app, node uint64) (bool, error)

func DialogSetOpen

func DialogSetOpen(app, node uint64, open bool) error

func EnsureABI

func EnsureABI() error

EnsureABI checks that the loaded native library matches ExpectedABI.

func NodeGetState

func NodeGetState(app, node uint64) (uint32, error)

func NodeGetText

func NodeGetText(app, node uint64) (string, error)

func NodeSetLayout

func NodeSetLayout(app, node uint64, layout Layout) error

func NodeSetState

func NodeSetState(app, node uint64, flags uint32) error

func NodeSetStyle

func NodeSetStyle(app, node uint64, style Style) error

func NodeSetText

func NodeSetText(app, node uint64, text string) error

func NumberInputGetValue

func NumberInputGetValue(app, node uint64) (float64, error)

func PlatformDnDSupported

func PlatformDnDSupported() bool

func PlatformOpenURL

func PlatformOpenURL(url string) error

func PlatformPickDirectory

func PlatformPickDirectory() (string, error)

func PlatformPickOpenFile

func PlatformPickOpenFile() (string, error)

func PlatformPickSaveFile

func PlatformPickSaveFile() (string, error)

func ProgressGetValue

func ProgressGetValue(app, node uint64) (float32, error)

func ProgressSetValue

func ProgressSetValue(app, node uint64, value float32) error

func RadioGetSelected

func RadioGetSelected(app, node uint64) (bool, error)

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 RunApp

func RunApp(app uint64) error

func SelectGetSelected

func SelectGetSelected(app, node uint64) (int, error)

func SliderGetValue

func SliderGetValue(app, node uint64) (float32, error)

func SliderSetValue

func SliderSetValue(app, node uint64, value float32) error

func SwitchGetOn

func SwitchGetOn(app, node uint64) (bool, error)

func SwitchSetOn

func SwitchSetOn(app, node uint64, on bool) error

func TableSetWindowCells

func TableSetWindowCells(app, node uint64, cells []string) error

func TabsGetSelected

func TabsGetSelected(app, node uint64) (int, error)

func TabsSetSelected

func TabsSetSelected(app, node uint64, selected int) error

func TextInputSetPassword

func TextInputSetPassword(app, node uint64, password bool) error

func ToastSetVisible

func ToastSetVisible(app, node uint64, visible bool) error

func VirtualListSetRowCount

func VirtualListSetRowCount(app, node uint64, rowCount uint32) error

func VirtualListSetWindowLabels

func VirtualListSetWindowLabels(app, node uint64, labels []string) error

func WindowConfirmClose

func WindowConfirmClose(window uint64) error

func WindowGetScaleFactor

func WindowGetScaleFactor(window uint64) (float64, error)

func WindowSetFullscreen

func WindowSetFullscreen(window uint64, fullscreen bool) error

func WindowSetMaxSize

func WindowSetMaxSize(window uint64, width, height int) error

func WindowSetMinSize

func WindowSetMinSize(window uint64, width, height int) error

func WindowSetOnClose

func WindowSetOnClose(window uint64, fn func()) error

func WindowSetResizable

func WindowSetResizable(window uint64, resizable bool) error

func WindowSetRoot

func WindowSetRoot(window, root uint64) error

func WindowSetSize

func WindowSetSize(window uint64, width, height int) error

func WindowSetTitle

func WindowSetTitle(window uint64, title string) error

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 Dim

type Dim struct {
	Kind  uint8
	Value float32
}

Dim mirrors fg_dim.

type FgDim

type FgDim struct {
	Kind uint8

	Value float32
	// contains filtered or unexported fields
}

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 FgThemePalette struct {
	Mode uint32

	Background, Foreground, Primary, OnPrimary, Surface, Border, Danger, Success FgRGBA
	// contains filtered or unexported fields
}

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 RGBA

type RGBA struct {
	R, G, B, A float32
}

RGBA mirrors fg_rgba.

type StatusError

type StatusError struct {
	Code    int32
	Message string
}

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.

type ThemePalette

type ThemePalette struct {
	Mode       uint32
	Background RGBA
	Foreground RGBA
	Primary    RGBA
	OnPrimary  RGBA
	Surface    RGBA
	Border     RGBA
	Danger     RGBA
	Success    RGBA
}

ThemePalette is the C ABI theme color pack.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL