// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gtk import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) type BoxLayoutClass struct { _ structs.HostLayout ParentClass LayoutManagerClass } func (x *BoxLayoutClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Arranges children in a single row or column. // // Whether it is a row or column depends on the value of its // [property@Gtk.Orientable:orientation] property. Within the other dimension // all children all allocated the same size. The `GtkBoxLayout` will respect // the [property@Gtk.Widget:halign] and [property@Gtk.Widget:valign] // properties of each child widget. // // If you want all children to be assigned the same size, you can use // the [property@Gtk.BoxLayout:homogeneous] property. // // If you want to specify the amount of space placed between each child, // you can use the [property@Gtk.BoxLayout:spacing] property. type BoxLayout struct { LayoutManager } var xBoxLayoutGLibType func() types.GType func BoxLayoutGLibType() types.GType { return xBoxLayoutGLibType() } func BoxLayoutNewFromInternalPtr(ptr uintptr) *BoxLayout { cls := &BoxLayout{} cls.Ptr = ptr return cls } var xNewBoxLayout func(Orientation) uintptr // Creates a new `GtkBoxLayout`. func NewBoxLayout(OrientationVar Orientation) *BoxLayout { var cls *BoxLayout cret := xNewBoxLayout(OrientationVar) if cret == 0 { return nil } cls = &BoxLayout{} cls.Ptr = cret return cls } var xBoxLayoutGetBaselineChild func(uintptr) int // Gets the value set by gtk_box_layout_set_baseline_child(). func (x *BoxLayout) GetBaselineChild() int { cret := xBoxLayoutGetBaselineChild(x.GoPointer()) return cret } var xBoxLayoutGetBaselinePosition func(uintptr) BaselinePosition // Gets the value set by gtk_box_layout_set_baseline_position(). func (x *BoxLayout) GetBaselinePosition() BaselinePosition { cret := xBoxLayoutGetBaselinePosition(x.GoPointer()) return cret } var xBoxLayoutGetHomogeneous func(uintptr) bool // Returns whether the layout is set to be homogeneous. func (x *BoxLayout) GetHomogeneous() bool { cret := xBoxLayoutGetHomogeneous(x.GoPointer()) return cret } var xBoxLayoutGetSpacing func(uintptr) uint // Returns the space that @box_layout puts between children. func (x *BoxLayout) GetSpacing() uint { cret := xBoxLayoutGetSpacing(x.GoPointer()) return cret } var xBoxLayoutSetBaselineChild func(uintptr, int) // Sets the index of the child that determines the baseline // in vertical layout. func (x *BoxLayout) SetBaselineChild(ChildVar int) { xBoxLayoutSetBaselineChild(x.GoPointer(), ChildVar) } var xBoxLayoutSetBaselinePosition func(uintptr, BaselinePosition) // Sets the baseline position of a box layout. // // The baseline position affects only horizontal boxes with at least one // baseline aligned child. If there is more vertical space available than // requested, and the baseline is not allocated by the parent then the // given @position is used to allocate the baseline within the extra // space available. func (x *BoxLayout) SetBaselinePosition(PositionVar BaselinePosition) { xBoxLayoutSetBaselinePosition(x.GoPointer(), PositionVar) } var xBoxLayoutSetHomogeneous func(uintptr, bool) // Sets whether the box layout will allocate the same // size to all children. func (x *BoxLayout) SetHomogeneous(HomogeneousVar bool) { xBoxLayoutSetHomogeneous(x.GoPointer(), HomogeneousVar) } var xBoxLayoutSetSpacing func(uintptr, uint) // Sets how much spacing to put between children. func (x *BoxLayout) SetSpacing(SpacingVar uint) { xBoxLayoutSetSpacing(x.GoPointer(), SpacingVar) } func (c *BoxLayout) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *BoxLayout) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyBaselineChild sets the "baseline-child" property. // The child that determines the baseline of the box // in vertical layout. // // If the child does baseline positioning, then its baseline // is lined up with the baseline of the box. If it doesn't, then // the bottom edge of the child is used. func (x *BoxLayout) SetPropertyBaselineChild(value int) { var v gobject.Value v.Init(gobject.TypeIntVal) v.SetInt(value) x.SetProperty("baseline-child", &v) } // GetPropertyBaselineChild gets the "baseline-child" property. // The child that determines the baseline of the box // in vertical layout. // // If the child does baseline positioning, then its baseline // is lined up with the baseline of the box. If it doesn't, then // the bottom edge of the child is used. func (x *BoxLayout) GetPropertyBaselineChild() int { var v gobject.Value x.GetProperty("baseline-child", &v) return v.GetInt() } // SetPropertyHomogeneous sets the "homogeneous" property. // Whether the box layout should distribute the available space // equally among the children. func (x *BoxLayout) SetPropertyHomogeneous(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("homogeneous", &v) } // GetPropertyHomogeneous gets the "homogeneous" property. // Whether the box layout should distribute the available space // equally among the children. func (x *BoxLayout) GetPropertyHomogeneous() bool { var v gobject.Value x.GetProperty("homogeneous", &v) return v.GetBoolean() } // SetPropertySpacing sets the "spacing" property. // The space to put between the children. func (x *BoxLayout) SetPropertySpacing(value int) { var v gobject.Value v.Init(gobject.TypeIntVal) v.SetInt(value) x.SetProperty("spacing", &v) } // GetPropertySpacing gets the "spacing" property. // The space to put between the children. func (x *BoxLayout) GetPropertySpacing() int { var v gobject.Value x.GetProperty("spacing", &v) return v.GetInt() } // Retrieves the orientation of the @orientable. func (x *BoxLayout) GetOrientation() Orientation { cret := XGtkOrientableGetOrientation(x.GoPointer()) return cret } // Sets the orientation of the @orientable. func (x *BoxLayout) SetOrientation(OrientationVar Orientation) { XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar) } func init() { core.SetPackageName("GTK", "gtk4") core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"}) var libs []uintptr for _, libPath := range core.GetPaths("GTK") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xBoxLayoutGLibType, libs, "gtk_box_layout_get_type") core.PuregoSafeRegister(&xNewBoxLayout, libs, "gtk_box_layout_new") core.PuregoSafeRegister(&xBoxLayoutGetBaselineChild, libs, "gtk_box_layout_get_baseline_child") core.PuregoSafeRegister(&xBoxLayoutGetBaselinePosition, libs, "gtk_box_layout_get_baseline_position") core.PuregoSafeRegister(&xBoxLayoutGetHomogeneous, libs, "gtk_box_layout_get_homogeneous") core.PuregoSafeRegister(&xBoxLayoutGetSpacing, libs, "gtk_box_layout_get_spacing") core.PuregoSafeRegister(&xBoxLayoutSetBaselineChild, libs, "gtk_box_layout_set_baseline_child") core.PuregoSafeRegister(&xBoxLayoutSetBaselinePosition, libs, "gtk_box_layout_set_baseline_position") core.PuregoSafeRegister(&xBoxLayoutSetHomogeneous, libs, "gtk_box_layout_set_homogeneous") core.PuregoSafeRegister(&xBoxLayoutSetSpacing, libs, "gtk_box_layout_set_spacing") }