// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gtk import ( "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) // Preserves the aspect ratio of its child. // // The frame can respect the aspect ratio of the child widget, // or use its own aspect ratio. // // # CSS nodes // // `GtkAspectFrame` uses a CSS node with name `aspectframe`. // // # Accessibility // // Until GTK 4.10, `GtkAspectFrame` used the [enum@Gtk.AccessibleRole.group] role. // // Starting from GTK 4.12, `GtkAspectFrame` uses the [enum@Gtk.AccessibleRole.generic] role. type AspectFrame struct { Widget } var xAspectFrameGLibType func() types.GType func AspectFrameGLibType() types.GType { return xAspectFrameGLibType() } func AspectFrameNewFromInternalPtr(ptr uintptr) *AspectFrame { cls := &AspectFrame{} cls.Ptr = ptr return cls } var xNewAspectFrame func(float32, float32, float32, bool) uintptr // Create a new `GtkAspectFrame`. func NewAspectFrame(XalignVar float32, YalignVar float32, RatioVar float32, ObeyChildVar bool) *AspectFrame { var cls *AspectFrame cret := xNewAspectFrame(XalignVar, YalignVar, RatioVar, ObeyChildVar) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &AspectFrame{} cls.Ptr = cret return cls } var xAspectFrameGetChild func(uintptr) uintptr // Gets the child widget of @self. func (x *AspectFrame) GetChild() *Widget { var cls *Widget cret := xAspectFrameGetChild(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Widget{} cls.Ptr = cret return cls } var xAspectFrameGetObeyChild func(uintptr) bool // Returns whether the child's size request should override // the set aspect ratio of the `GtkAspectFrame`. func (x *AspectFrame) GetObeyChild() bool { cret := xAspectFrameGetObeyChild(x.GoPointer()) return cret } var xAspectFrameGetRatio func(uintptr) float32 // Returns the desired aspect ratio of the child. func (x *AspectFrame) GetRatio() float32 { cret := xAspectFrameGetRatio(x.GoPointer()) return cret } var xAspectFrameGetXalign func(uintptr) float32 // Returns the horizontal alignment of the child within the // allocation of the `GtkAspectFrame`. func (x *AspectFrame) GetXalign() float32 { cret := xAspectFrameGetXalign(x.GoPointer()) return cret } var xAspectFrameGetYalign func(uintptr) float32 // Returns the vertical alignment of the child within the // allocation of the `GtkAspectFrame`. func (x *AspectFrame) GetYalign() float32 { cret := xAspectFrameGetYalign(x.GoPointer()) return cret } var xAspectFrameSetChild func(uintptr, uintptr) // Sets the child widget of @self. func (x *AspectFrame) SetChild(ChildVar *Widget) { xAspectFrameSetChild(x.GoPointer(), ChildVar.GoPointer()) } var xAspectFrameSetObeyChild func(uintptr, bool) // Sets whether the aspect ratio of the child's size // request should override the set aspect ratio of // the `GtkAspectFrame`. func (x *AspectFrame) SetObeyChild(ObeyChildVar bool) { xAspectFrameSetObeyChild(x.GoPointer(), ObeyChildVar) } var xAspectFrameSetRatio func(uintptr, float32) // Sets the desired aspect ratio of the child. func (x *AspectFrame) SetRatio(RatioVar float32) { xAspectFrameSetRatio(x.GoPointer(), RatioVar) } var xAspectFrameSetXalign func(uintptr, float32) // Sets the horizontal alignment of the child within the allocation // of the `GtkAspectFrame`. func (x *AspectFrame) SetXalign(XalignVar float32) { xAspectFrameSetXalign(x.GoPointer(), XalignVar) } var xAspectFrameSetYalign func(uintptr, float32) // Sets the vertical alignment of the child within the allocation // of the `GtkAspectFrame`. func (x *AspectFrame) SetYalign(YalignVar float32) { xAspectFrameSetYalign(x.GoPointer(), YalignVar) } func (c *AspectFrame) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *AspectFrame) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyObeyChild sets the "obey-child" property. // Whether the `GtkAspectFrame` should use the aspect ratio of its child. func (x *AspectFrame) SetPropertyObeyChild(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("obey-child", &v) } // GetPropertyObeyChild gets the "obey-child" property. // Whether the `GtkAspectFrame` should use the aspect ratio of its child. func (x *AspectFrame) GetPropertyObeyChild() bool { var v gobject.Value x.GetProperty("obey-child", &v) return v.GetBoolean() } // SetPropertyRatio sets the "ratio" property. // The aspect ratio to be used by the `GtkAspectFrame`. // // This property is only used if // [property@Gtk.AspectFrame:obey-child] is set to %FALSE. func (x *AspectFrame) SetPropertyRatio(value float32) { var v gobject.Value v.Init(gobject.TypeFloatVal) v.SetFloat(value) x.SetProperty("ratio", &v) } // GetPropertyRatio gets the "ratio" property. // The aspect ratio to be used by the `GtkAspectFrame`. // // This property is only used if // [property@Gtk.AspectFrame:obey-child] is set to %FALSE. func (x *AspectFrame) GetPropertyRatio() float32 { var v gobject.Value x.GetProperty("ratio", &v) return v.GetFloat() } // SetPropertyXalign sets the "xalign" property. // The horizontal alignment of the child. func (x *AspectFrame) SetPropertyXalign(value float32) { var v gobject.Value v.Init(gobject.TypeFloatVal) v.SetFloat(value) x.SetProperty("xalign", &v) } // GetPropertyXalign gets the "xalign" property. // The horizontal alignment of the child. func (x *AspectFrame) GetPropertyXalign() float32 { var v gobject.Value x.GetProperty("xalign", &v) return v.GetFloat() } // SetPropertyYalign sets the "yalign" property. // The vertical alignment of the child. func (x *AspectFrame) SetPropertyYalign(value float32) { var v gobject.Value v.Init(gobject.TypeFloatVal) v.SetFloat(value) x.SetProperty("yalign", &v) } // GetPropertyYalign gets the "yalign" property. // The vertical alignment of the child. func (x *AspectFrame) GetPropertyYalign() float32 { var v gobject.Value x.GetProperty("yalign", &v) return v.GetFloat() } // 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 *AspectFrame) 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 *AspectFrame) 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 *AspectFrame) GetAccessibleRole() AccessibleRole { cret := XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *AspectFrame) 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 *AspectFrame) 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 *AspectFrame) 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 *AspectFrame) 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 *AspectFrame) GetPlatformState(StateVar AccessiblePlatformState) bool { cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *AspectFrame) ResetProperty(PropertyVar AccessibleProperty) { XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *AspectFrame) ResetRelation(RelationVar AccessibleRelation) { XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *AspectFrame) 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 *AspectFrame) 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 *AspectFrame) 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 *AspectFrame) 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 *AspectFrame) 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 *AspectFrame) 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 *AspectFrame) 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 *AspectFrame) 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 *AspectFrame) 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 *AspectFrame) 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 *AspectFrame) GetBuildableId() string { cret := XGtkBuildableGetBuildableId(x.GoPointer()) return cret } 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(&xAspectFrameGLibType, libs, "gtk_aspect_frame_get_type") core.PuregoSafeRegister(&xNewAspectFrame, libs, "gtk_aspect_frame_new") core.PuregoSafeRegister(&xAspectFrameGetChild, libs, "gtk_aspect_frame_get_child") core.PuregoSafeRegister(&xAspectFrameGetObeyChild, libs, "gtk_aspect_frame_get_obey_child") core.PuregoSafeRegister(&xAspectFrameGetRatio, libs, "gtk_aspect_frame_get_ratio") core.PuregoSafeRegister(&xAspectFrameGetXalign, libs, "gtk_aspect_frame_get_xalign") core.PuregoSafeRegister(&xAspectFrameGetYalign, libs, "gtk_aspect_frame_get_yalign") core.PuregoSafeRegister(&xAspectFrameSetChild, libs, "gtk_aspect_frame_set_child") core.PuregoSafeRegister(&xAspectFrameSetObeyChild, libs, "gtk_aspect_frame_set_obey_child") core.PuregoSafeRegister(&xAspectFrameSetRatio, libs, "gtk_aspect_frame_set_ratio") core.PuregoSafeRegister(&xAspectFrameSetXalign, libs, "gtk_aspect_frame_set_xalign") core.PuregoSafeRegister(&xAspectFrameSetYalign, libs, "gtk_aspect_frame_set_yalign") }