// Package adw was automatically generated by github.com/bnema/puregotk DO NOT EDIT package adw 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" "github.com/bnema/puregotk/v4/gtk" ) type WrapLayoutClass struct { _ structs.HostLayout ParentClass gtk.LayoutManagerClass } func (x *WrapLayoutClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Describes line justify behaviors in a [class@WrapLayout] or [class@WrapBox]. // // See [property@WrapLayout:justify] and [property@WrapBox:justify]. type JustifyMode int var xJustifyModeGLibType func() types.GType func JustifyModeGLibType() types.GType { return xJustifyModeGLibType() } const ( // Don't justify children within a line. JustifyNoneValue JustifyMode = 0 // Stretch each child within the line, keeping consistent // spacing, so that the line fills the entire length. JustifyFillValue JustifyMode = 1 // Increase spacing between children, moving the children // so that the first and last child are aligned with the beginning and end // of the line. If the line only contains a single widget, it will be // stretched regardless. JustifySpreadValue JustifyMode = 2 ) // Describes child packing behavior in a [class@WrapLayout] or [class@WrapBox]. // // See [property@WrapLayout:pack-direction] and // [property@WrapBox:pack-direction]. type PackDirection int var xPackDirectionGLibType func() types.GType func PackDirectionGLibType() types.GType { return xPackDirectionGLibType() } const ( // Pack children from left to right for LTR languages, // or top to bottom vertically. PackStartToEndValue PackDirection = 0 // Pack children from right to left for LTR languages, // or bottom to top vertically. PackEndToStartValue PackDirection = 1 ) // Describes line wrapping behavior in a [class@WrapLayout] or [class@WrapBox]. // // See [property@WrapLayout:wrap-policy] and [property@WrapBox:wrap-policy]. type WrapPolicy int var xWrapPolicyGLibType func() types.GType func WrapPolicyGLibType() types.GType { return xWrapPolicyGLibType() } const ( // Fit as many children into each line as possible, shrinking // them down to their minimum size before wrapping to the next line. WrapMinimumValue WrapPolicy = 0 // Wrap to the next line as soon as the previous line cannot // fit any more children without shrinking them past their natural size. WrapNaturalValue WrapPolicy = 1 ) // A box-like layout that can wrap into multiple lines. // // <picture> // // <source srcset="wrap-box-dark.png" media="(prefers-color-scheme: dark)"> // <img src="wrap-box.png" alt="wrap-box"> // // </picture> // // `AdwWrapLayout` is similar to [class@Gtk.BoxLayout], but can wrap lines when // the widgets cannot fit otherwise. Unlike [class@Gtk.FlowBox], the children // aren't arranged into a grid and behave more like words in a wrapping label. // // Like `GtkBoxLayout`, `AdwWrapLayout` is orientable and has spacing: // // - [property@WrapLayout:child-spacing] between children in the same line; // - [property@WrapLayout:line-spacing] between lines. // // ::: note // // Unlike `GtkBoxLayout`, `AdwWrapLayout` cannot follow the CSS // `border-spacing` property. // // Use the [property@WrapLayout:natural-line-length] property to determine the // layout's natural size, e.g. when using it in a [class@Gtk.Popover]. // // Normally, a horizontal `AdwWrapLayout` wraps left to right and top to bottom // for left-to-right languages. Both of these directions can be reversed, using // the [property@WrapLayout:pack-direction] and // [property@WrapLayout:wrap-reverse] properties. Additionally, the alignment // of each line can be controlled with the [property@WrapLayout:align] property. // // Lines can be justified using the [property@WrapLayout:justify] property, // filling the entire line by either increasing child size or spacing depending // on the value. Set [property@WrapLayout:justify-last-line] to justify the last // line as well. // // By default, `AdwWrapLayout` wraps as soon as the previous line cannot fit // any more children without shrinking them past their natural size. Set // [property@WrapLayout:wrap-policy] to [enum@Adw.WrapPolicy.MINIMUM] to only // wrap once all the children in the previous line have been shrunk to their // minimum size. // // To make each line take the same amount of space, set // [property@WrapLayout:line-homogeneous] to `TRUE`. // // Spacing and natural line length can scale with the text scale factor, use the // [property@WrapLayout:child-spacing-unit], // [property@WrapLayout:line-spacing-unit] and/or // [property@WrapLayout:natural-line-length-unit] properties to enable that // behavior. // // See [class@WrapBox]. type WrapLayout struct { gtk.LayoutManager } var xWrapLayoutGLibType func() types.GType func WrapLayoutGLibType() types.GType { return xWrapLayoutGLibType() } func WrapLayoutNewFromInternalPtr(ptr uintptr) *WrapLayout { cls := &WrapLayout{} cls.Ptr = ptr return cls } var xNewWrapLayout func() uintptr // Creates a new `AdwWrapLayout`. func NewWrapLayout() *WrapLayout { var cls *WrapLayout cret := xNewWrapLayout() if cret == 0 { return nil } cls = &WrapLayout{} cls.Ptr = cret return cls } var xWrapLayoutGetAlign func(uintptr) float32 // Gets the alignment of the children within each line. func (x *WrapLayout) GetAlign() float32 { cret := xWrapLayoutGetAlign(x.GoPointer()) return cret } var xWrapLayoutGetChildSpacing func(uintptr) int // Gets spacing between widgets on the same line. func (x *WrapLayout) GetChildSpacing() int { cret := xWrapLayoutGetChildSpacing(x.GoPointer()) return cret } var xWrapLayoutGetChildSpacingUnit func(uintptr) LengthUnit // Gets the length unit for child spacing. func (x *WrapLayout) GetChildSpacingUnit() LengthUnit { cret := xWrapLayoutGetChildSpacingUnit(x.GoPointer()) return cret } var xWrapLayoutGetJustify func(uintptr) JustifyMode // Gets whether and how each complete line is stretched to fill the entire widget. func (x *WrapLayout) GetJustify() JustifyMode { cret := xWrapLayoutGetJustify(x.GoPointer()) return cret } var xWrapLayoutGetJustifyLastLine func(uintptr) bool // Gets whether the last line should be stretched to fill the entire widget. func (x *WrapLayout) GetJustifyLastLine() bool { cret := xWrapLayoutGetJustifyLastLine(x.GoPointer()) return cret } var xWrapLayoutGetLineHomogeneous func(uintptr) bool // Gets whether all lines should take the same amount of space. func (x *WrapLayout) GetLineHomogeneous() bool { cret := xWrapLayoutGetLineHomogeneous(x.GoPointer()) return cret } var xWrapLayoutGetLineSpacing func(uintptr) int // Gets the spacing between lines. func (x *WrapLayout) GetLineSpacing() int { cret := xWrapLayoutGetLineSpacing(x.GoPointer()) return cret } var xWrapLayoutGetLineSpacingUnit func(uintptr) LengthUnit // Gets the length unit for line spacing. func (x *WrapLayout) GetLineSpacingUnit() LengthUnit { cret := xWrapLayoutGetLineSpacingUnit(x.GoPointer()) return cret } var xWrapLayoutGetNaturalLineLength func(uintptr) int // Gets the natural size for each line. func (x *WrapLayout) GetNaturalLineLength() int { cret := xWrapLayoutGetNaturalLineLength(x.GoPointer()) return cret } var xWrapLayoutGetNaturalLineLengthUnit func(uintptr) LengthUnit // Gets the length unit for line spacing. func (x *WrapLayout) GetNaturalLineLengthUnit() LengthUnit { cret := xWrapLayoutGetNaturalLineLengthUnit(x.GoPointer()) return cret } var xWrapLayoutGetPackDirection func(uintptr) PackDirection // Gets the direction children are packed in each line. func (x *WrapLayout) GetPackDirection() PackDirection { cret := xWrapLayoutGetPackDirection(x.GoPointer()) return cret } var xWrapLayoutGetWrapPolicy func(uintptr) WrapPolicy // Gets the policy for line wrapping. func (x *WrapLayout) GetWrapPolicy() WrapPolicy { cret := xWrapLayoutGetWrapPolicy(x.GoPointer()) return cret } var xWrapLayoutGetWrapReverse func(uintptr) bool // Gets whether wrap direction is reversed. func (x *WrapLayout) GetWrapReverse() bool { cret := xWrapLayoutGetWrapReverse(x.GoPointer()) return cret } var xWrapLayoutSetAlign func(uintptr, float32) // Sets the alignment of the children within each line. // // 0 means the children are placed at the start of the line, 1 means they are // placed at the end of the line. 0.5 means they are placed in the middle of the // line. // // Alignment is only used when [property@WrapLayout:justify] is set to // `ADW_JUSTIFY_NONE`, or on the last line when the // [property@WrapLayout:justify-last-line] is `FALSE`. func (x *WrapLayout) SetAlign(AlignVar float32) { xWrapLayoutSetAlign(x.GoPointer(), AlignVar) } var xWrapLayoutSetChildSpacing func(uintptr, int) // Sets the spacing between widgets on the same line. // // See [property@WrapLayout:child-spacing-unit]. func (x *WrapLayout) SetChildSpacing(ChildSpacingVar int) { xWrapLayoutSetChildSpacing(x.GoPointer(), ChildSpacingVar) } var xWrapLayoutSetChildSpacingUnit func(uintptr, LengthUnit) // Sets the length unit for child spacing. // // Allows the spacing to vary depending on the text scale factor. // // See [property@WrapLayout:child-spacing]. func (x *WrapLayout) SetChildSpacingUnit(UnitVar LengthUnit) { xWrapLayoutSetChildSpacingUnit(x.GoPointer(), UnitVar) } var xWrapLayoutSetJustify func(uintptr, JustifyMode) // Sets whether and how each complete line should be stretched to fill the // entire widget. // // If set to `ADW_JUSTIFY_FILL`, each widget in the line will be stretched, // keeping consistent spacing, so that the line fills the entire widget. // // If set to `ADW_JUSTIFY_SPREAD`, the spacing between widgets will be // increased, keeping widget sizes intact. The first and last widget will be // aligned with the beginning and end of the line. If the line only contains a // single widget, it will be stretched regardless. // // If set to `ADW_JUSTIFY_NONE`, the line will not be stretched and the children // will be placed together within the line, according to // [property@WrapLayout:align]. // // By default this doesn't affect the last line, as it will be incomplete. Use // [property@WrapLayout:justify-last-line] to justify it as well. func (x *WrapLayout) SetJustify(JustifyVar JustifyMode) { xWrapLayoutSetJustify(x.GoPointer(), JustifyVar) } var xWrapLayoutSetJustifyLastLine func(uintptr, bool) // Sets whether the last line should be stretched to fill the entire widget. // // See [property@WrapLayout:justify]. func (x *WrapLayout) SetJustifyLastLine(JustifyLastLineVar bool) { xWrapLayoutSetJustifyLastLine(x.GoPointer(), JustifyLastLineVar) } var xWrapLayoutSetLineHomogeneous func(uintptr, bool) // Sets whether all lines should take the same amount of space. func (x *WrapLayout) SetLineHomogeneous(HomogeneousVar bool) { xWrapLayoutSetLineHomogeneous(x.GoPointer(), HomogeneousVar) } var xWrapLayoutSetLineSpacing func(uintptr, int) // Sets the spacing between lines. // // See [property@WrapLayout:line-spacing-unit]. func (x *WrapLayout) SetLineSpacing(LineSpacingVar int) { xWrapLayoutSetLineSpacing(x.GoPointer(), LineSpacingVar) } var xWrapLayoutSetLineSpacingUnit func(uintptr, LengthUnit) // Sets the length unit for line spacing. // // Allows the spacing to vary depending on the text scale factor. // // See [property@WrapLayout:line-spacing]. func (x *WrapLayout) SetLineSpacingUnit(UnitVar LengthUnit) { xWrapLayoutSetLineSpacingUnit(x.GoPointer(), UnitVar) } var xWrapLayoutSetNaturalLineLength func(uintptr, int) // Sets the natural size for each line. // // It should be used to limit the line lengths, for example when used in // popovers. // // See [property@WrapLayout:natural-line-length-unit]. func (x *WrapLayout) SetNaturalLineLength(NaturalLineLengthVar int) { xWrapLayoutSetNaturalLineLength(x.GoPointer(), NaturalLineLengthVar) } var xWrapLayoutSetNaturalLineLengthUnit func(uintptr, LengthUnit) // Sets the length unit for natural line length. // // Allows the length to vary depending on the text scale factor. // // See [property@WrapLayout:natural-line-length]. func (x *WrapLayout) SetNaturalLineLengthUnit(UnitVar LengthUnit) { xWrapLayoutSetNaturalLineLengthUnit(x.GoPointer(), UnitVar) } var xWrapLayoutSetPackDirection func(uintptr, PackDirection) // Sets the direction children are packed in each line. func (x *WrapLayout) SetPackDirection(PackDirectionVar PackDirection) { xWrapLayoutSetPackDirection(x.GoPointer(), PackDirectionVar) } var xWrapLayoutSetWrapPolicy func(uintptr, WrapPolicy) // Sets the policy for line wrapping. // // If set to `ADW_WRAP_NATURAL`, the box will wrap to the next line as soon as // the previous line cannot fit any more children without shrinking them past // their natural size. // // If set to `ADW_WRAP_MINIMUM`, the box will try to fit as many children into // each line as possible, shrinking them down to their minimum size before // wrapping to the next line. func (x *WrapLayout) SetWrapPolicy(WrapPolicyVar WrapPolicy) { xWrapLayoutSetWrapPolicy(x.GoPointer(), WrapPolicyVar) } var xWrapLayoutSetWrapReverse func(uintptr, bool) // Sets whether wrap direction should be reversed. // // By default, lines wrap downwards in a horizontal box, and towards the end // in a vertical box. If set to `TRUE`, they wrap upwards or towards the start // respectively. func (x *WrapLayout) SetWrapReverse(WrapReverseVar bool) { xWrapLayoutSetWrapReverse(x.GoPointer(), WrapReverseVar) } func (c *WrapLayout) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *WrapLayout) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyAlign sets the "align" property. // The alignment of the children within each line. // // 0 means the children are placed at the start of the line, 1 means they are // placed at the end of the line. 0.5 means they are placed in the middle of // the line. // // Alignment is only used when [property@WrapLayout:justify] is set to // `ADW_JUSTIFY_NONE`, or on the last line when the // [property@WrapLayout:justify-last-line] is `FALSE`. func (x *WrapLayout) SetPropertyAlign(value float32) { var v gobject.Value v.Init(gobject.TypeFloatVal) v.SetFloat(value) x.SetProperty("align", &v) } // GetPropertyAlign gets the "align" property. // The alignment of the children within each line. // // 0 means the children are placed at the start of the line, 1 means they are // placed at the end of the line. 0.5 means they are placed in the middle of // the line. // // Alignment is only used when [property@WrapLayout:justify] is set to // `ADW_JUSTIFY_NONE`, or on the last line when the // [property@WrapLayout:justify-last-line] is `FALSE`. func (x *WrapLayout) GetPropertyAlign() float32 { var v gobject.Value x.GetProperty("align", &v) return v.GetFloat() } // SetPropertyChildSpacing sets the "child-spacing" property. // The spacing between widgets on the same line. // // See [property@WrapLayout:child-spacing-unit]. func (x *WrapLayout) SetPropertyChildSpacing(value int) { var v gobject.Value v.Init(gobject.TypeIntVal) v.SetInt(value) x.SetProperty("child-spacing", &v) } // GetPropertyChildSpacing gets the "child-spacing" property. // The spacing between widgets on the same line. // // See [property@WrapLayout:child-spacing-unit]. func (x *WrapLayout) GetPropertyChildSpacing() int { var v gobject.Value x.GetProperty("child-spacing", &v) return v.GetInt() } // SetPropertyJustifyLastLine sets the "justify-last-line" property. // Whether the last line should be stretched to fill the entire widget. // // See [property@WrapLayout:justify]. func (x *WrapLayout) SetPropertyJustifyLastLine(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("justify-last-line", &v) } // GetPropertyJustifyLastLine gets the "justify-last-line" property. // Whether the last line should be stretched to fill the entire widget. // // See [property@WrapLayout:justify]. func (x *WrapLayout) GetPropertyJustifyLastLine() bool { var v gobject.Value x.GetProperty("justify-last-line", &v) return v.GetBoolean() } // SetPropertyLineHomogeneous sets the "line-homogeneous" property. // Whether all lines should take the same amount of space. func (x *WrapLayout) SetPropertyLineHomogeneous(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("line-homogeneous", &v) } // GetPropertyLineHomogeneous gets the "line-homogeneous" property. // Whether all lines should take the same amount of space. func (x *WrapLayout) GetPropertyLineHomogeneous() bool { var v gobject.Value x.GetProperty("line-homogeneous", &v) return v.GetBoolean() } // SetPropertyLineSpacing sets the "line-spacing" property. // The spacing between lines. // // See [property@WrapLayout:line-spacing-unit]. func (x *WrapLayout) SetPropertyLineSpacing(value int) { var v gobject.Value v.Init(gobject.TypeIntVal) v.SetInt(value) x.SetProperty("line-spacing", &v) } // GetPropertyLineSpacing gets the "line-spacing" property. // The spacing between lines. // // See [property@WrapLayout:line-spacing-unit]. func (x *WrapLayout) GetPropertyLineSpacing() int { var v gobject.Value x.GetProperty("line-spacing", &v) return v.GetInt() } // SetPropertyNaturalLineLength sets the "natural-line-length" property. // Determines the natural size for each line. // // It should be used to limit the line lengths, for example when used in // popovers. // // See [property@WrapLayout:natural-line-length-unit]. func (x *WrapLayout) SetPropertyNaturalLineLength(value int) { var v gobject.Value v.Init(gobject.TypeIntVal) v.SetInt(value) x.SetProperty("natural-line-length", &v) } // GetPropertyNaturalLineLength gets the "natural-line-length" property. // Determines the natural size for each line. // // It should be used to limit the line lengths, for example when used in // popovers. // // See [property@WrapLayout:natural-line-length-unit]. func (x *WrapLayout) GetPropertyNaturalLineLength() int { var v gobject.Value x.GetProperty("natural-line-length", &v) return v.GetInt() } // SetPropertyWrapReverse sets the "wrap-reverse" property. // Whether wrap direction should be reversed. // // By default, lines wrap downwards in a horizontal box, and towards the end // in a vertical box. If set to `TRUE`, they wrap upwards or towards the start // respectively. func (x *WrapLayout) SetPropertyWrapReverse(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("wrap-reverse", &v) } // GetPropertyWrapReverse gets the "wrap-reverse" property. // Whether wrap direction should be reversed. // // By default, lines wrap downwards in a horizontal box, and towards the end // in a vertical box. If set to `TRUE`, they wrap upwards or towards the start // respectively. func (x *WrapLayout) GetPropertyWrapReverse() bool { var v gobject.Value x.GetProperty("wrap-reverse", &v) return v.GetBoolean() } // Retrieves the orientation of the @orientable. func (x *WrapLayout) GetOrientation() gtk.Orientation { cret := gtk.XGtkOrientableGetOrientation(x.GoPointer()) return cret } // Sets the orientation of the @orientable. func (x *WrapLayout) SetOrientation(OrientationVar gtk.Orientation) { gtk.XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar) } func init() { core.SetPackageName("ADW", "libadwaita-1") core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("ADW") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xJustifyModeGLibType, libs, "adw_justify_mode_get_type") core.PuregoSafeRegister(&xPackDirectionGLibType, libs, "adw_pack_direction_get_type") core.PuregoSafeRegister(&xWrapPolicyGLibType, libs, "adw_wrap_policy_get_type") core.PuregoSafeRegister(&xWrapLayoutGLibType, libs, "adw_wrap_layout_get_type") core.PuregoSafeRegister(&xNewWrapLayout, libs, "adw_wrap_layout_new") core.PuregoSafeRegister(&xWrapLayoutGetAlign, libs, "adw_wrap_layout_get_align") core.PuregoSafeRegister(&xWrapLayoutGetChildSpacing, libs, "adw_wrap_layout_get_child_spacing") core.PuregoSafeRegister(&xWrapLayoutGetChildSpacingUnit, libs, "adw_wrap_layout_get_child_spacing_unit") core.PuregoSafeRegister(&xWrapLayoutGetJustify, libs, "adw_wrap_layout_get_justify") core.PuregoSafeRegister(&xWrapLayoutGetJustifyLastLine, libs, "adw_wrap_layout_get_justify_last_line") core.PuregoSafeRegister(&xWrapLayoutGetLineHomogeneous, libs, "adw_wrap_layout_get_line_homogeneous") core.PuregoSafeRegister(&xWrapLayoutGetLineSpacing, libs, "adw_wrap_layout_get_line_spacing") core.PuregoSafeRegister(&xWrapLayoutGetLineSpacingUnit, libs, "adw_wrap_layout_get_line_spacing_unit") core.PuregoSafeRegister(&xWrapLayoutGetNaturalLineLength, libs, "adw_wrap_layout_get_natural_line_length") core.PuregoSafeRegister(&xWrapLayoutGetNaturalLineLengthUnit, libs, "adw_wrap_layout_get_natural_line_length_unit") core.PuregoSafeRegister(&xWrapLayoutGetPackDirection, libs, "adw_wrap_layout_get_pack_direction") core.PuregoSafeRegister(&xWrapLayoutGetWrapPolicy, libs, "adw_wrap_layout_get_wrap_policy") core.PuregoSafeRegister(&xWrapLayoutGetWrapReverse, libs, "adw_wrap_layout_get_wrap_reverse") core.PuregoSafeRegister(&xWrapLayoutSetAlign, libs, "adw_wrap_layout_set_align") core.PuregoSafeRegister(&xWrapLayoutSetChildSpacing, libs, "adw_wrap_layout_set_child_spacing") core.PuregoSafeRegister(&xWrapLayoutSetChildSpacingUnit, libs, "adw_wrap_layout_set_child_spacing_unit") core.PuregoSafeRegister(&xWrapLayoutSetJustify, libs, "adw_wrap_layout_set_justify") core.PuregoSafeRegister(&xWrapLayoutSetJustifyLastLine, libs, "adw_wrap_layout_set_justify_last_line") core.PuregoSafeRegister(&xWrapLayoutSetLineHomogeneous, libs, "adw_wrap_layout_set_line_homogeneous") core.PuregoSafeRegister(&xWrapLayoutSetLineSpacing, libs, "adw_wrap_layout_set_line_spacing") core.PuregoSafeRegister(&xWrapLayoutSetLineSpacingUnit, libs, "adw_wrap_layout_set_line_spacing_unit") core.PuregoSafeRegister(&xWrapLayoutSetNaturalLineLength, libs, "adw_wrap_layout_set_natural_line_length") core.PuregoSafeRegister(&xWrapLayoutSetNaturalLineLengthUnit, libs, "adw_wrap_layout_set_natural_line_length_unit") core.PuregoSafeRegister(&xWrapLayoutSetPackDirection, libs, "adw_wrap_layout_set_pack_direction") core.PuregoSafeRegister(&xWrapLayoutSetWrapPolicy, libs, "adw_wrap_layout_set_wrap_policy") core.PuregoSafeRegister(&xWrapLayoutSetWrapReverse, libs, "adw_wrap_layout_set_wrap_reverse") }