// 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/gio" "github.com/bnema/puregotk/v4/glib" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" "github.com/bnema/puregotk/v4/gtk" ) type PreferencesGroupClass struct { _ structs.HostLayout ParentClass gtk.WidgetClass Padding [4]uintptr } func (x *PreferencesGroupClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // A group of preference rows. // // <picture> // // <source srcset="preferences-group-dark.png" media="(prefers-color-scheme: dark)"> // <img src="preferences-group.png" alt="preferences-group"> // // </picture> // // An `AdwPreferencesGroup` represents a group or tightly related preferences, // which in turn are represented by [class@PreferencesRow]. // // To summarize the role of the preferences it gathers, a group can have both a // title and a description. The title will be used by [class@PreferencesDialog] // to let the user look for a preference. // // The [property@PreferencesGroup:separate-rows] property can be used to // separate the rows within the group, same as when using the // [`.boxed-list-separate`](style-classes.html#boxed-lists-cards) style class // instead of `.boxed-list`. // // ## AdwPreferencesGroup as GtkBuildable // // The `AdwPreferencesGroup` implementation of the [iface@Gtk.Buildable] interface // supports adding [class@PreferencesRow]s to the list by omitting "type". If "type" // is omitted and the widget isn't a [class@PreferencesRow] the child is added to // a box below the list. // // When the "type" attribute of a child is `header-suffix`, the child // is set as the suffix on the end of the title and description. // // ## CSS nodes // // `AdwPreferencesGroup` has a single CSS node with name `preferencesgroup`. // // ## Accessibility // // `AdwPreferencesGroup` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role. type PreferencesGroup struct { gtk.Widget } var xPreferencesGroupGLibType func() types.GType func PreferencesGroupGLibType() types.GType { return xPreferencesGroupGLibType() } func PreferencesGroupNewFromInternalPtr(ptr uintptr) *PreferencesGroup { cls := &PreferencesGroup{} cls.Ptr = ptr return cls } var xNewPreferencesGroup func() uintptr // Creates a new `AdwPreferencesGroup`. func NewPreferencesGroup() *PreferencesGroup { var cls *PreferencesGroup cret := xNewPreferencesGroup() if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &PreferencesGroup{} cls.Ptr = cret return cls } var xPreferencesGroupAdd func(uintptr, uintptr) // Adds a child to @self. func (x *PreferencesGroup) Add(ChildVar *gtk.Widget) { xPreferencesGroupAdd(x.GoPointer(), ChildVar.GoPointer()) } var xPreferencesGroupBindModel func(uintptr, uintptr, uintptr, uintptr, uintptr) // Binds @model to @self. // // See [method@Gtk.ListBox.bind_model]. func (x *PreferencesGroup) BindModel(ModelVar gio.ListModel, CreateRowFuncVar *gtk.ListBoxCreateWidgetFunc, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) { var CreateRowFuncVarRef uintptr if CreateRowFuncVar != nil { CreateRowFuncVarPtr := uintptr(unsafe.Pointer(CreateRowFuncVar)) if cbRefPtr, ok := glib.GetCallback(CreateRowFuncVarPtr); ok { CreateRowFuncVarRef = cbRefPtr } else { fcb := func(arg0 uintptr, arg1 uintptr) uintptr { cbFn := *CreateRowFuncVar return cbFn(arg0, arg1) } CreateRowFuncVarRef = purego.NewCallback(fcb) glib.SaveCallbackWithClosure(CreateRowFuncVarPtr, CreateRowFuncVarRef, CreateRowFuncVar) } } var UserDataFreeFuncVarRef uintptr if UserDataFreeFuncVar != nil { UserDataFreeFuncVarPtr := uintptr(unsafe.Pointer(UserDataFreeFuncVar)) if cbRefPtr, ok := glib.GetCallback(UserDataFreeFuncVarPtr); ok { UserDataFreeFuncVarRef = cbRefPtr } else { fcb := func(arg0 uintptr) { cbFn := *UserDataFreeFuncVar cbFn(arg0) } UserDataFreeFuncVarRef = purego.NewCallback(fcb) glib.SaveCallbackWithClosure(UserDataFreeFuncVarPtr, UserDataFreeFuncVarRef, UserDataFreeFuncVar) } } xPreferencesGroupBindModel(x.GoPointer(), ModelVar.GoPointer(), CreateRowFuncVarRef, UserDataVar, UserDataFreeFuncVarRef) } var xPreferencesGroupGetDescription func(uintptr) string // Gets the description of @self. func (x *PreferencesGroup) GetDescription() string { cret := xPreferencesGroupGetDescription(x.GoPointer()) return cret } var xPreferencesGroupGetHeaderSuffix func(uintptr) uintptr // Gets the suffix for @self's header. func (x *PreferencesGroup) GetHeaderSuffix() *gtk.Widget { var cls *gtk.Widget cret := xPreferencesGroupGetHeaderSuffix(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = >k.Widget{} cls.Ptr = cret return cls } var xPreferencesGroupGetRow func(uintptr, uint) uintptr // Gets the row at @index. // // Can return `NULL` if @index is larger than the number of rows in the group. func (x *PreferencesGroup) GetRow(IndexVar uint) *gtk.Widget { var cls *gtk.Widget cret := xPreferencesGroupGetRow(x.GoPointer(), IndexVar) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = >k.Widget{} cls.Ptr = cret return cls } var xPreferencesGroupGetSeparateRows func(uintptr) bool // Gets whether @self's rows are separated. func (x *PreferencesGroup) GetSeparateRows() bool { cret := xPreferencesGroupGetSeparateRows(x.GoPointer()) return cret } var xPreferencesGroupGetTitle func(uintptr) string // Gets the title of @self. func (x *PreferencesGroup) GetTitle() string { cret := xPreferencesGroupGetTitle(x.GoPointer()) return cret } var xPreferencesGroupRemove func(uintptr, uintptr) // Removes a child from @self. func (x *PreferencesGroup) Remove(ChildVar *gtk.Widget) { xPreferencesGroupRemove(x.GoPointer(), ChildVar.GoPointer()) } var xPreferencesGroupSetDescription func(uintptr, uintptr) // Sets the description for @self. func (x *PreferencesGroup) SetDescription(DescriptionVar *string) { DescriptionVarPtr := core.GStrdupNullable(DescriptionVar) defer core.GFreeNullable(DescriptionVarPtr) xPreferencesGroupSetDescription(x.GoPointer(), DescriptionVarPtr) } var xPreferencesGroupSetHeaderSuffix func(uintptr, uintptr) // Sets the suffix for @self's header. // // Displayed above the list, next to the title and description. // // Suffixes are commonly used to show a button or a spinner for the whole group. func (x *PreferencesGroup) SetHeaderSuffix(SuffixVar *gtk.Widget) { xPreferencesGroupSetHeaderSuffix(x.GoPointer(), SuffixVar.GoPointer()) } var xPreferencesGroupSetSeparateRows func(uintptr, bool) // Sets whether @self's rows are separated. // // Equivalent to using the // [`.boxed-list-separate`](style-classes.html#boxed-lists-cards) style class // on a [class@Gtk.ListBox] instead of `.boxed-list`. func (x *PreferencesGroup) SetSeparateRows(SeparateRowsVar bool) { xPreferencesGroupSetSeparateRows(x.GoPointer(), SeparateRowsVar) } var xPreferencesGroupSetTitle func(uintptr, string) // Sets the title for @self. func (x *PreferencesGroup) SetTitle(TitleVar string) { xPreferencesGroupSetTitle(x.GoPointer(), TitleVar) } func (c *PreferencesGroup) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *PreferencesGroup) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyDescription sets the "description" property. // The description for this group of preferences. func (x *PreferencesGroup) SetPropertyDescription(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("description", &v) } // GetPropertyDescription gets the "description" property. // The description for this group of preferences. func (x *PreferencesGroup) GetPropertyDescription() string { var v gobject.Value x.GetProperty("description", &v) return v.GetString() } // SetPropertySeparateRows sets the "separate-rows" property. // Whether to separate rows. // // Equivalent to using the // [`.boxed-list-separate`](style-classes.html#boxed-lists-cards) style class // on a [class@Gtk.ListBox] instead of `.boxed-list`. func (x *PreferencesGroup) SetPropertySeparateRows(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("separate-rows", &v) } // GetPropertySeparateRows gets the "separate-rows" property. // Whether to separate rows. // // Equivalent to using the // [`.boxed-list-separate`](style-classes.html#boxed-lists-cards) style class // on a [class@Gtk.ListBox] instead of `.boxed-list`. func (x *PreferencesGroup) GetPropertySeparateRows() bool { var v gobject.Value x.GetProperty("separate-rows", &v) return v.GetBoolean() } // SetPropertyTitle sets the "title" property. // The title for this group of preferences. func (x *PreferencesGroup) SetPropertyTitle(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("title", &v) } // GetPropertyTitle gets the "title" property. // The title for this group of preferences. func (x *PreferencesGroup) GetPropertyTitle() string { var v gobject.Value x.GetProperty("title", &v) return v.GetString() } // 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 *PreferencesGroup) 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 *PreferencesGroup) 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 *PreferencesGroup) GetAccessibleRole() gtk.AccessibleRole { cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *PreferencesGroup) 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 *PreferencesGroup) 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 *PreferencesGroup) 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 *PreferencesGroup) 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 *PreferencesGroup) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *PreferencesGroup) ResetProperty(PropertyVar gtk.AccessibleProperty) { gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *PreferencesGroup) ResetRelation(RelationVar gtk.AccessibleRelation) { gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *PreferencesGroup) 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 *PreferencesGroup) 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 *PreferencesGroup) 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 *PreferencesGroup) 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 *PreferencesGroup) 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 *PreferencesGroup) 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 *PreferencesGroup) 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 *PreferencesGroup) 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 *PreferencesGroup) 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 *PreferencesGroup) 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 *PreferencesGroup) GetBuildableId() string { cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) return cret } 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(&xPreferencesGroupGLibType, libs, "adw_preferences_group_get_type") core.PuregoSafeRegister(&xNewPreferencesGroup, libs, "adw_preferences_group_new") core.PuregoSafeRegister(&xPreferencesGroupAdd, libs, "adw_preferences_group_add") core.PuregoSafeRegister(&xPreferencesGroupBindModel, libs, "adw_preferences_group_bind_model") core.PuregoSafeRegister(&xPreferencesGroupGetDescription, libs, "adw_preferences_group_get_description") core.PuregoSafeRegister(&xPreferencesGroupGetHeaderSuffix, libs, "adw_preferences_group_get_header_suffix") core.PuregoSafeRegister(&xPreferencesGroupGetRow, libs, "adw_preferences_group_get_row") core.PuregoSafeRegister(&xPreferencesGroupGetSeparateRows, libs, "adw_preferences_group_get_separate_rows") core.PuregoSafeRegister(&xPreferencesGroupGetTitle, libs, "adw_preferences_group_get_title") core.PuregoSafeRegister(&xPreferencesGroupRemove, libs, "adw_preferences_group_remove") core.PuregoSafeRegister(&xPreferencesGroupSetDescription, libs, "adw_preferences_group_set_description") core.PuregoSafeRegister(&xPreferencesGroupSetHeaderSuffix, libs, "adw_preferences_group_set_header_suffix") core.PuregoSafeRegister(&xPreferencesGroupSetSeparateRows, libs, "adw_preferences_group_set_separate_rows") core.PuregoSafeRegister(&xPreferencesGroupSetTitle, libs, "adw_preferences_group_set_title") }