// 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 CenterBoxClass struct { _ structs.HostLayout } func (x *CenterBoxClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Arranges three children in a row, keeping the middle child // centered as well as possible. // // <picture> // // <source srcset="centerbox-dark.png" media="(prefers-color-scheme: dark)"> // <img alt="An example GtkCenterBox" src="centerbox.png"> // // </picture> // // To add children to `GtkCenterBox`, use [method@Gtk.CenterBox.set_start_widget], // [method@Gtk.CenterBox.set_center_widget] and // [method@Gtk.CenterBox.set_end_widget]. // // The sizing and positioning of children can be influenced with the // align and expand properties of the children. // // # GtkCenterBox as GtkBuildable // // The `GtkCenterBox` implementation of the `GtkBuildable` interface // supports placing children in the 3 positions by specifying “start”, “center” // or “end” as the “type” attribute of a `<child>` element. // // # CSS nodes // // `GtkCenterBox` uses a single CSS node with the name “box”, // // The first child of the `GtkCenterBox` will be allocated depending on the // text direction, i.e. in left-to-right layouts it will be allocated on the // left and in right-to-left layouts on the right. // // In vertical orientation, the nodes of the children are arranged from top to // bottom. // // # Accessibility // // Until GTK 4.10, `GtkCenterBox` used the [enum@Gtk.AccessibleRole.group] role. // // Starting from GTK 4.12, `GtkCenterBox` uses the [enum@Gtk.AccessibleRole.generic] // role. type CenterBox struct { Widget } var xCenterBoxGLibType func() types.GType func CenterBoxGLibType() types.GType { return xCenterBoxGLibType() } func CenterBoxNewFromInternalPtr(ptr uintptr) *CenterBox { cls := &CenterBox{} cls.Ptr = ptr return cls } var xNewCenterBox func() uintptr // Creates a new `GtkCenterBox`. func NewCenterBox() *CenterBox { var cls *CenterBox cret := xNewCenterBox() if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &CenterBox{} cls.Ptr = cret return cls } var xCenterBoxGetBaselinePosition func(uintptr) BaselinePosition // Gets the baseline position of the center box. // // See [method@Gtk.CenterBox.set_baseline_position]. func (x *CenterBox) GetBaselinePosition() BaselinePosition { cret := xCenterBoxGetBaselinePosition(x.GoPointer()) return cret } var xCenterBoxGetCenterWidget func(uintptr) uintptr // Gets the center widget. func (x *CenterBox) GetCenterWidget() *Widget { var cls *Widget cret := xCenterBoxGetCenterWidget(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Widget{} cls.Ptr = cret return cls } var xCenterBoxGetEndWidget func(uintptr) uintptr // Gets the end widget. func (x *CenterBox) GetEndWidget() *Widget { var cls *Widget cret := xCenterBoxGetEndWidget(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Widget{} cls.Ptr = cret return cls } var xCenterBoxGetShrinkCenterLast func(uintptr) bool // Gets whether the center widget shrinks after other children. func (x *CenterBox) GetShrinkCenterLast() bool { cret := xCenterBoxGetShrinkCenterLast(x.GoPointer()) return cret } var xCenterBoxGetStartWidget func(uintptr) uintptr // Gets the start widget. func (x *CenterBox) GetStartWidget() *Widget { var cls *Widget cret := xCenterBoxGetStartWidget(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Widget{} cls.Ptr = cret return cls } var xCenterBoxSetBaselinePosition func(uintptr, BaselinePosition) // Sets the baseline position of a center box. // // This 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 // @position is used to allocate the baseline with respect to the // extra space available. func (x *CenterBox) SetBaselinePosition(PositionVar BaselinePosition) { xCenterBoxSetBaselinePosition(x.GoPointer(), PositionVar) } var xCenterBoxSetCenterWidget func(uintptr, uintptr) // Sets the center widget. // // To remove the existing center widget, pass `NULL`. func (x *CenterBox) SetCenterWidget(ChildVar *Widget) { xCenterBoxSetCenterWidget(x.GoPointer(), ChildVar.GoPointer()) } var xCenterBoxSetEndWidget func(uintptr, uintptr) // Sets the end widget. // // To remove the existing end widget, pass `NULL`. func (x *CenterBox) SetEndWidget(ChildVar *Widget) { xCenterBoxSetEndWidget(x.GoPointer(), ChildVar.GoPointer()) } var xCenterBoxSetShrinkCenterLast 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 @shrink_center_last is false, start and end widgets keep natural // width and the center widget starts shrinking instead. func (x *CenterBox) SetShrinkCenterLast(ShrinkCenterLastVar bool) { xCenterBoxSetShrinkCenterLast(x.GoPointer(), ShrinkCenterLastVar) } var xCenterBoxSetStartWidget func(uintptr, uintptr) // Sets the start widget. // // To remove the existing start widget, pass `NULL`. func (x *CenterBox) SetStartWidget(ChildVar *Widget) { xCenterBoxSetStartWidget(x.GoPointer(), ChildVar.GoPointer()) } func (c *CenterBox) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *CenterBox) 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 false, start and end widgets keep natural width and the // center widget starts shrinking instead. func (x *CenterBox) 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 false, start and end widgets keep natural width and the // center widget starts shrinking instead. func (x *CenterBox) GetPropertyShrinkCenterLast() bool { var v gobject.Value x.GetProperty("shrink-center-last", &v) return v.GetBoolean() } // Requests the user's screen reader to announce the given message. // // This kind of notification is useful for messages that // either have only a visual representation or that are not // exposed visually at all, e.g. a notification about a // successful operation. // // Also, by using this API, you can ensure that the message // does not interrupts the user's current screen reader output. func (x *CenterBox) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) { XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) } // Retrieves the accessible parent for an accessible object. // // This function returns `NULL` for top level widgets. func (x *CenterBox) GetAccessibleParent() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetAccessibleParent(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Retrieves the accessible role of an accessible object. func (x *CenterBox) GetAccessibleRole() AccessibleRole { cret := XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *CenterBox) GetAtContext() *ATContext { var cls *ATContext cret := XGtkAccessibleGetAtContext(x.GoPointer()) if cret == 0 { return nil } cls = &ATContext{} cls.Ptr = cret return cls } // Queries the coordinates and dimensions of this accessible // // This functionality can be overridden by `GtkAccessible` // implementations, e.g. to get the bounds from an ignored // child widget. func (x *CenterBox) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool { cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) return cret } // Retrieves the first accessible child of an accessible object. func (x *CenterBox) GetFirstAccessibleChild() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Retrieves the next accessible sibling of an accessible object func (x *CenterBox) GetNextAccessibleSibling() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Queries a platform state, such as focus. // // This functionality can be overridden by `GtkAccessible` // implementations, e.g. to get platform state from an ignored // child widget, as is the case for `GtkText` wrappers. func (x *CenterBox) GetPlatformState(StateVar AccessiblePlatformState) bool { cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *CenterBox) ResetProperty(PropertyVar AccessibleProperty) { XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *CenterBox) ResetRelation(RelationVar AccessibleRelation) { XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *CenterBox) ResetState(StateVar AccessibleState) { XGtkAccessibleResetState(x.GoPointer(), StateVar) } // Sets the parent and sibling of an accessible object. // // This function is meant to be used by accessible implementations that are // not part of the widget hierarchy, and but act as a logical bridge between // widgets. For instance, if a widget creates an object that holds metadata // for each child, and you want that object to implement the `GtkAccessible` // interface, you will use this function to ensure that the parent of each // child widget is the metadata object, and the parent of each metadata // object is the container widget. func (x *CenterBox) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) { XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) } // Updates the next accessible sibling. // // That might be useful when a new child of a custom accessible // is created, and it needs to be linked to a previous child. func (x *CenterBox) UpdateNextAccessibleSibling(NewSiblingVar Accessible) { XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) } // Informs ATs that the platform state has changed. // // This function should be used by `GtkAccessible` implementations that // have a platform state but are not widgets. Widgets handle platform // states automatically. func (x *CenterBox) UpdatePlatformState(StateVar AccessiblePlatformState) { XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) } // Updates a list of accessible properties. // // See the [enum@Gtk.AccessibleProperty] documentation for the // value types of accessible properties. // // This function should be called by `GtkWidget` types whenever // an accessible property change must be communicated to assistive // technologies. // // Example: // ```c // value = gtk_adjustment_get_value (adjustment); // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), // // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, // -1); // // ``` func (x *CenterBox) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) { XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) } // Updates an array of accessible properties. // // This function should be called by `GtkWidget` types whenever an accessible // property change must be communicated to assistive technologies. // // This function is meant to be used by language bindings. func (x *CenterBox) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) { XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) } // Updates a list of accessible relations. // // This function should be called by `GtkWidget` types whenever an accessible // relation change must be communicated to assistive technologies. // // If the [enum@Gtk.AccessibleRelation] requires a list of references, // you should pass each reference individually, followed by `NULL`, e.g. // // ```c // gtk_accessible_update_relation (accessible, // // GTK_ACCESSIBLE_RELATION_CONTROLS, // ref1, NULL, // GTK_ACCESSIBLE_RELATION_LABELLED_BY, // ref1, ref2, ref3, NULL, // -1); // // ``` func (x *CenterBox) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) { XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) } // Updates an array of accessible relations. // // This function should be called by `GtkWidget` types whenever an accessible // relation change must be communicated to assistive technologies. // // This function is meant to be used by language bindings. func (x *CenterBox) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) { XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) } // Updates a list of accessible states. // // See the [enum@Gtk.AccessibleState] documentation for the // value types of accessible states. // // This function should be called by `GtkWidget` types whenever // an accessible state change must be communicated to assistive // technologies. // // Example: // // ```c // value = GTK_ACCESSIBLE_TRISTATE_MIXED; // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), // // GTK_ACCESSIBLE_STATE_CHECKED, value, // -1); // // ``` func (x *CenterBox) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) { XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) } // Updates an array of accessible states. // // This function should be called by `GtkWidget` types whenever an accessible // state change must be communicated to assistive technologies. // // This function is meant to be used by language bindings. func (x *CenterBox) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) { XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) } // Gets the ID of the @buildable object. // // `GtkBuilder` sets the name based on the ID attribute // of the `<object>` tag used to construct the @buildable. func (x *CenterBox) GetBuildableId() string { cret := XGtkBuildableGetBuildableId(x.GoPointer()) return cret } // Retrieves the orientation of the @orientable. func (x *CenterBox) GetOrientation() Orientation { cret := XGtkOrientableGetOrientation(x.GoPointer()) return cret } // Sets the orientation of the @orientable. func (x *CenterBox) 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(&xCenterBoxGLibType, libs, "gtk_center_box_get_type") core.PuregoSafeRegister(&xNewCenterBox, libs, "gtk_center_box_new") core.PuregoSafeRegister(&xCenterBoxGetBaselinePosition, libs, "gtk_center_box_get_baseline_position") core.PuregoSafeRegister(&xCenterBoxGetCenterWidget, libs, "gtk_center_box_get_center_widget") core.PuregoSafeRegister(&xCenterBoxGetEndWidget, libs, "gtk_center_box_get_end_widget") core.PuregoSafeRegister(&xCenterBoxGetShrinkCenterLast, libs, "gtk_center_box_get_shrink_center_last") core.PuregoSafeRegister(&xCenterBoxGetStartWidget, libs, "gtk_center_box_get_start_widget") core.PuregoSafeRegister(&xCenterBoxSetBaselinePosition, libs, "gtk_center_box_set_baseline_position") core.PuregoSafeRegister(&xCenterBoxSetCenterWidget, libs, "gtk_center_box_set_center_widget") core.PuregoSafeRegister(&xCenterBoxSetEndWidget, libs, "gtk_center_box_set_end_widget") core.PuregoSafeRegister(&xCenterBoxSetShrinkCenterLast, libs, "gtk_center_box_set_shrink_center_last") core.PuregoSafeRegister(&xCenterBoxSetStartWidget, libs, "gtk_center_box_set_start_widget") }