// 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 CenterLayoutClass struct { _ structs.HostLayout ParentClass LayoutManagerClass } func (x *CenterLayoutClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Manages up to three children. // // The start widget is allocated at the start of the layout (left in // left-to-right locales and right in right-to-left ones), and the end // widget at the end. // // The center widget is centered regarding the full width of the layout's. type CenterLayout struct { LayoutManager } var xCenterLayoutGLibType func() types.GType func CenterLayoutGLibType() types.GType { return xCenterLayoutGLibType() } func CenterLayoutNewFromInternalPtr(ptr uintptr) *CenterLayout { cls := &CenterLayout{} cls.Ptr = ptr return cls } var xNewCenterLayout func() uintptr // Creates a new `GtkCenterLayout`. func NewCenterLayout() *CenterLayout { var cls *CenterLayout cret := xNewCenterLayout() if cret == 0 { return nil } cls = &CenterLayout{} cls.Ptr = cret return cls } var xCenterLayoutGetBaselinePosition func(uintptr) BaselinePosition // Returns the baseline position of the layout. func (x *CenterLayout) GetBaselinePosition() BaselinePosition { cret := xCenterLayoutGetBaselinePosition(x.GoPointer()) return cret } var xCenterLayoutGetCenterWidget func(uintptr) uintptr // Returns the center widget of the layout. func (x *CenterLayout) GetCenterWidget() *Widget { var cls *Widget cret := xCenterLayoutGetCenterWidget(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Widget{} cls.Ptr = cret return cls } var xCenterLayoutGetEndWidget func(uintptr) uintptr // Returns the end widget of the layout. func (x *CenterLayout) GetEndWidget() *Widget { var cls *Widget cret := xCenterLayoutGetEndWidget(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Widget{} cls.Ptr = cret return cls } var xCenterLayoutGetOrientation func(uintptr) Orientation // Gets the current orienration of the layout manager. func (x *CenterLayout) GetOrientation() Orientation { cret := xCenterLayoutGetOrientation(x.GoPointer()) return cret } var xCenterLayoutGetShrinkCenterLast func(uintptr) bool // Gets whether @self shrinks the center widget after other children. func (x *CenterLayout) GetShrinkCenterLast() bool { cret := xCenterLayoutGetShrinkCenterLast(x.GoPointer()) return cret } var xCenterLayoutGetStartWidget func(uintptr) uintptr // Returns the start widget of the layout. func (x *CenterLayout) GetStartWidget() *Widget { var cls *Widget cret := xCenterLayoutGetStartWidget(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Widget{} cls.Ptr = cret return cls } var xCenterLayoutSetBaselinePosition func(uintptr, BaselinePosition) // Sets the new baseline position of @self func (x *CenterLayout) SetBaselinePosition(BaselinePositionVar BaselinePosition) { xCenterLayoutSetBaselinePosition(x.GoPointer(), BaselinePositionVar) } var xCenterLayoutSetCenterWidget func(uintptr, uintptr) // Sets the new center widget of @self. // // To remove the existing center widget, pass %NULL. func (x *CenterLayout) SetCenterWidget(WidgetVar *Widget) { xCenterLayoutSetCenterWidget(x.GoPointer(), WidgetVar.GoPointer()) } var xCenterLayoutSetEndWidget func(uintptr, uintptr) // Sets the new end widget of @self. // // To remove the existing center widget, pass %NULL. func (x *CenterLayout) SetEndWidget(WidgetVar *Widget) { xCenterLayoutSetEndWidget(x.GoPointer(), WidgetVar.GoPointer()) } var xCenterLayoutSetOrientation func(uintptr, Orientation) // Sets the orientation of @self. func (x *CenterLayout) SetOrientation(OrientationVar Orientation) { xCenterLayoutSetOrientation(x.GoPointer(), OrientationVar) } var xCenterLayoutSetShrinkCenterLast func(uintptr, bool) // Sets whether to shrink the center widget after other children. // // By default, when there's no space to give all three children their // natural widths, the start and end widgets start shrinking and the // center child keeps natural width until they reach minimum width. // // If set to `FALSE`, start and end widgets keep natural width and the // center widget starts shrinking instead. func (x *CenterLayout) SetShrinkCenterLast(ShrinkCenterLastVar bool) { xCenterLayoutSetShrinkCenterLast(x.GoPointer(), ShrinkCenterLastVar) } var xCenterLayoutSetStartWidget func(uintptr, uintptr) // Sets the new start widget of @self. // // To remove the existing start widget, pass %NULL. func (x *CenterLayout) SetStartWidget(WidgetVar *Widget) { xCenterLayoutSetStartWidget(x.GoPointer(), WidgetVar.GoPointer()) } func (c *CenterLayout) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *CenterLayout) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyShrinkCenterLast sets the "shrink-center-last" property. // Whether to shrink the center widget after other children. // // By default, when there's no space to give all three children their // natural widths, the start and end widgets start shrinking and the // center child keeps natural width until they reach minimum width. // // If set to `FALSE`, start and end widgets keep natural width and the // center widget starts shrinking instead. func (x *CenterLayout) SetPropertyShrinkCenterLast(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("shrink-center-last", &v) } // GetPropertyShrinkCenterLast gets the "shrink-center-last" property. // Whether to shrink the center widget after other children. // // By default, when there's no space to give all three children their // natural widths, the start and end widgets start shrinking and the // center child keeps natural width until they reach minimum width. // // If set to `FALSE`, start and end widgets keep natural width and the // center widget starts shrinking instead. func (x *CenterLayout) GetPropertyShrinkCenterLast() bool { var v gobject.Value x.GetProperty("shrink-center-last", &v) return v.GetBoolean() } 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(&xCenterLayoutGLibType, libs, "gtk_center_layout_get_type") core.PuregoSafeRegister(&xNewCenterLayout, libs, "gtk_center_layout_new") core.PuregoSafeRegister(&xCenterLayoutGetBaselinePosition, libs, "gtk_center_layout_get_baseline_position") core.PuregoSafeRegister(&xCenterLayoutGetCenterWidget, libs, "gtk_center_layout_get_center_widget") core.PuregoSafeRegister(&xCenterLayoutGetEndWidget, libs, "gtk_center_layout_get_end_widget") core.PuregoSafeRegister(&xCenterLayoutGetOrientation, libs, "gtk_center_layout_get_orientation") core.PuregoSafeRegister(&xCenterLayoutGetShrinkCenterLast, libs, "gtk_center_layout_get_shrink_center_last") core.PuregoSafeRegister(&xCenterLayoutGetStartWidget, libs, "gtk_center_layout_get_start_widget") core.PuregoSafeRegister(&xCenterLayoutSetBaselinePosition, libs, "gtk_center_layout_set_baseline_position") core.PuregoSafeRegister(&xCenterLayoutSetCenterWidget, libs, "gtk_center_layout_set_center_widget") core.PuregoSafeRegister(&xCenterLayoutSetEndWidget, libs, "gtk_center_layout_set_end_widget") core.PuregoSafeRegister(&xCenterLayoutSetOrientation, libs, "gtk_center_layout_set_orientation") core.PuregoSafeRegister(&xCenterLayoutSetShrinkCenterLast, libs, "gtk_center_layout_set_shrink_center_last") core.PuregoSafeRegister(&xCenterLayoutSetStartWidget, libs, "gtk_center_layout_set_start_widget") }