// 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 ClampClass struct { _ structs.HostLayout ParentClass gtk.WidgetClass } func (x *ClampClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // A widget constraining its child to a given size. // // <picture> // // <source srcset="clamp-wide-dark.png" media="(prefers-color-scheme: dark)"> // <img src="clamp-wide.png" alt="clamp-wide"> // // </picture> // <picture> // // <source srcset="clamp-narrow-dark.png" media="(prefers-color-scheme: dark)"> // <img src="clamp-narrow.png" alt="clamp-narrow"> // // </picture> // // The `AdwClamp` widget constrains the size of the widget it contains to a // given maximum size. It will constrain the width if it is horizontal, or the // height if it is vertical. The expansion of the child from its minimum to its // maximum size is eased out for a smooth transition. // // If the child requires more than the requested maximum size, it will be // allocated the minimum size it can fit in instead. // // `AdwClamp` can scale with the text scale factor, use the // [property@Clamp:unit] property to enable that behavior. // // See also: [class@ClampLayout], [class@ClampScrollable]. // // ## CSS nodes // // `AdwClamp` has a single CSS node with name `clamp`. type Clamp struct { gtk.Widget } var xClampGLibType func() types.GType func ClampGLibType() types.GType { return xClampGLibType() } func ClampNewFromInternalPtr(ptr uintptr) *Clamp { cls := &Clamp{} cls.Ptr = ptr return cls } var xNewClamp func() uintptr // Creates a new `AdwClamp`. func NewClamp() *Clamp { var cls *Clamp cret := xNewClamp() if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Clamp{} cls.Ptr = cret return cls } var xClampGetChild func(uintptr) uintptr // Gets the child widget of @self. func (x *Clamp) GetChild() *gtk.Widget { var cls *gtk.Widget cret := xClampGetChild(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = >k.Widget{} cls.Ptr = cret return cls } var xClampGetMaximumSize func(uintptr) int // Gets the maximum size allocated to the child. func (x *Clamp) GetMaximumSize() int { cret := xClampGetMaximumSize(x.GoPointer()) return cret } var xClampGetTighteningThreshold func(uintptr) int // Gets the size above which the child is clamped. func (x *Clamp) GetTighteningThreshold() int { cret := xClampGetTighteningThreshold(x.GoPointer()) return cret } var xClampGetUnit func(uintptr) LengthUnit // Gets the length unit for maximum size and tightening threshold. func (x *Clamp) GetUnit() LengthUnit { cret := xClampGetUnit(x.GoPointer()) return cret } var xClampSetChild func(uintptr, uintptr) // Sets the child widget of @self. func (x *Clamp) SetChild(ChildVar *gtk.Widget) { xClampSetChild(x.GoPointer(), ChildVar.GoPointer()) } var xClampSetMaximumSize func(uintptr, int) // Sets the maximum size allocated to the child. // // It is the width if the clamp is horizontal, or the height if it is vertical. func (x *Clamp) SetMaximumSize(MaximumSizeVar int) { xClampSetMaximumSize(x.GoPointer(), MaximumSizeVar) } var xClampSetTighteningThreshold func(uintptr, int) // Sets the size above which the child is clamped. // // Starting from this size, the clamp will tighten its grip on the child, slowly // allocating less and less of the available size up to the maximum allocated // size. Below that threshold and below the maximum size, the child will be // allocated all the available size. // // If the threshold is greater than the maximum size to allocate to the child, // the child will be allocated all the size up to the maximum. If the threshold // is lower than the minimum size to allocate to the child, that size will be // used as the tightening threshold. // // Effectively, tightening the grip on the child before it reaches its maximum // size makes transitions to and from the maximum size smoother when resizing. func (x *Clamp) SetTighteningThreshold(TighteningThresholdVar int) { xClampSetTighteningThreshold(x.GoPointer(), TighteningThresholdVar) } var xClampSetUnit func(uintptr, LengthUnit) // Sets the length unit for maximum size and tightening threshold. // // Allows the sizes to vary depending on the text scale factor. func (x *Clamp) SetUnit(UnitVar LengthUnit) { xClampSetUnit(x.GoPointer(), UnitVar) } func (c *Clamp) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *Clamp) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyMaximumSize sets the "maximum-size" property. // The maximum size allocated to the child. // // It is the width if the clamp is horizontal, or the height if it is vertical. func (x *Clamp) SetPropertyMaximumSize(value int) { var v gobject.Value v.Init(gobject.TypeIntVal) v.SetInt(value) x.SetProperty("maximum-size", &v) } // GetPropertyMaximumSize gets the "maximum-size" property. // The maximum size allocated to the child. // // It is the width if the clamp is horizontal, or the height if it is vertical. func (x *Clamp) GetPropertyMaximumSize() int { var v gobject.Value x.GetProperty("maximum-size", &v) return v.GetInt() } // SetPropertyTighteningThreshold sets the "tightening-threshold" property. // The size above which the child is clamped. // // Starting from this size, the clamp will tighten its grip on the child, // slowly allocating less and less of the available size up to the maximum // allocated size. Below that threshold and below the maximum size, the child // will be allocated all the available size. // // If the threshold is greater than the maximum size to allocate to the child, // the child will be allocated all the size up to the maximum. // If the threshold is lower than the minimum size to allocate to the child, // that size will be used as the tightening threshold. // // Effectively, tightening the grip on the child before it reaches its maximum // size makes transitions to and from the maximum size smoother when resizing. func (x *Clamp) SetPropertyTighteningThreshold(value int) { var v gobject.Value v.Init(gobject.TypeIntVal) v.SetInt(value) x.SetProperty("tightening-threshold", &v) } // GetPropertyTighteningThreshold gets the "tightening-threshold" property. // The size above which the child is clamped. // // Starting from this size, the clamp will tighten its grip on the child, // slowly allocating less and less of the available size up to the maximum // allocated size. Below that threshold and below the maximum size, the child // will be allocated all the available size. // // If the threshold is greater than the maximum size to allocate to the child, // the child will be allocated all the size up to the maximum. // If the threshold is lower than the minimum size to allocate to the child, // that size will be used as the tightening threshold. // // Effectively, tightening the grip on the child before it reaches its maximum // size makes transitions to and from the maximum size smoother when resizing. func (x *Clamp) GetPropertyTighteningThreshold() int { var v gobject.Value x.GetProperty("tightening-threshold", &v) return v.GetInt() } // 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 *Clamp) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) } // Retrieves the accessible parent for an accessible object. // // This function returns `NULL` for top level widgets. func (x *Clamp) GetAccessibleParent() *gtk.AccessibleBase { var cls *gtk.AccessibleBase cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) if cret == 0 { return nil } cls = >k.AccessibleBase{} cls.Ptr = cret return cls } // Retrieves the accessible role of an accessible object. func (x *Clamp) GetAccessibleRole() gtk.AccessibleRole { cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *Clamp) GetAtContext() *gtk.ATContext { var cls *gtk.ATContext cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) if cret == 0 { return nil } cls = >k.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 *Clamp) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool { cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) return cret } // Retrieves the first accessible child of an accessible object. func (x *Clamp) GetFirstAccessibleChild() *gtk.AccessibleBase { var cls *gtk.AccessibleBase cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) if cret == 0 { return nil } cls = >k.AccessibleBase{} cls.Ptr = cret return cls } // Retrieves the next accessible sibling of an accessible object func (x *Clamp) GetNextAccessibleSibling() *gtk.AccessibleBase { var cls *gtk.AccessibleBase cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) if cret == 0 { return nil } cls = >k.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 *Clamp) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *Clamp) ResetProperty(PropertyVar gtk.AccessibleProperty) { gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *Clamp) ResetRelation(RelationVar gtk.AccessibleRelation) { gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *Clamp) ResetState(StateVar gtk.AccessibleState) { gtk.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 *Clamp) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { gtk.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 *Clamp) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { gtk.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 *Clamp) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { gtk.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 *Clamp) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { gtk.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 *Clamp) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) { gtk.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 *Clamp) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { gtk.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 *Clamp) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) { gtk.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 *Clamp) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { gtk.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 *Clamp) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) { gtk.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 *Clamp) GetBuildableId() string { cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) return cret } // Retrieves the orientation of the @orientable. func (x *Clamp) GetOrientation() gtk.Orientation { cret := gtk.XGtkOrientableGetOrientation(x.GoPointer()) return cret } // Sets the orientation of the @orientable. func (x *Clamp) 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(&xClampGLibType, libs, "adw_clamp_get_type") core.PuregoSafeRegister(&xNewClamp, libs, "adw_clamp_new") core.PuregoSafeRegister(&xClampGetChild, libs, "adw_clamp_get_child") core.PuregoSafeRegister(&xClampGetMaximumSize, libs, "adw_clamp_get_maximum_size") core.PuregoSafeRegister(&xClampGetTighteningThreshold, libs, "adw_clamp_get_tightening_threshold") core.PuregoSafeRegister(&xClampGetUnit, libs, "adw_clamp_get_unit") core.PuregoSafeRegister(&xClampSetChild, libs, "adw_clamp_set_child") core.PuregoSafeRegister(&xClampSetMaximumSize, libs, "adw_clamp_set_maximum_size") core.PuregoSafeRegister(&xClampSetTighteningThreshold, libs, "adw_clamp_set_tightening_threshold") core.PuregoSafeRegister(&xClampSetUnit, libs, "adw_clamp_set_unit") }