// 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 PreferencesDialogClass struct { _ structs.HostLayout ParentClass DialogClass Padding [4]uintptr } func (x *PreferencesDialogClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // A dialog showing application's preferences. // // <picture> // // <source srcset="preferences-dialog-dark.png" media="(prefers-color-scheme: dark)"> // <img src="preferences-dialog.png" alt="preferences-dialog"> // // </picture> // // The `AdwPreferencesDialog` widget presents an application's preferences // gathered into pages and groups. The preferences are searchable by the user. // // ## Actions // // `AdwPrefencesDialog` defines the `navigation.pop` action, it doesn't take any // parameters and pops the current subpage from the navigation stack, equivalent // to calling [method@PreferencesDialog.pop_subpage]. // // ## CSS nodes // // `AdwPreferencesDialog` has a main CSS node with the name `dialog` and the // style class `.preferences`. type PreferencesDialog struct { Dialog } var xPreferencesDialogGLibType func() types.GType func PreferencesDialogGLibType() types.GType { return xPreferencesDialogGLibType() } func PreferencesDialogNewFromInternalPtr(ptr uintptr) *PreferencesDialog { cls := &PreferencesDialog{} cls.Ptr = ptr return cls } var xNewPreferencesDialog func() uintptr // Creates a new `AdwPreferencesDialog`. func NewPreferencesDialog() *PreferencesDialog { var cls *PreferencesDialog cret := xNewPreferencesDialog() if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &PreferencesDialog{} cls.Ptr = cret return cls } var xPreferencesDialogAdd func(uintptr, uintptr) // Adds a preferences page to @self. func (x *PreferencesDialog) Add(PageVar *PreferencesPage) { xPreferencesDialogAdd(x.GoPointer(), PageVar.GoPointer()) } var xPreferencesDialogAddToast func(uintptr, uintptr) // Displays @toast. // // See [method@ToastOverlay.add_toast]. func (x *PreferencesDialog) AddToast(ToastVar *Toast) { xPreferencesDialogAddToast(x.GoPointer(), ToastVar.GoPointer()) } var xPreferencesDialogGetSearchEnabled func(uintptr) bool // Gets whether search is enabled for @self. func (x *PreferencesDialog) GetSearchEnabled() bool { cret := xPreferencesDialogGetSearchEnabled(x.GoPointer()) return cret } var xPreferencesDialogGetVisiblePage func(uintptr) uintptr // Gets the currently visible page of @self. func (x *PreferencesDialog) GetVisiblePage() *PreferencesPage { var cls *PreferencesPage cret := xPreferencesDialogGetVisiblePage(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &PreferencesPage{} cls.Ptr = cret return cls } var xPreferencesDialogGetVisiblePageName func(uintptr) string // Gets the name of currently visible page of @self. func (x *PreferencesDialog) GetVisiblePageName() string { cret := xPreferencesDialogGetVisiblePageName(x.GoPointer()) return cret } var xPreferencesDialogPopSubpage func(uintptr) bool // Pop the visible page from the subpage stack of @self. func (x *PreferencesDialog) PopSubpage() bool { cret := xPreferencesDialogPopSubpage(x.GoPointer()) return cret } var xPreferencesDialogPushSubpage func(uintptr, uintptr) // Pushes @page onto the subpage stack of @self. // // The page will be automatically removed when popped. func (x *PreferencesDialog) PushSubpage(PageVar *NavigationPage) { xPreferencesDialogPushSubpage(x.GoPointer(), PageVar.GoPointer()) } var xPreferencesDialogRemove func(uintptr, uintptr) // Removes a page from @self. func (x *PreferencesDialog) Remove(PageVar *PreferencesPage) { xPreferencesDialogRemove(x.GoPointer(), PageVar.GoPointer()) } var xPreferencesDialogSetSearchEnabled func(uintptr, bool) // Sets whether search is enabled for @self. func (x *PreferencesDialog) SetSearchEnabled(SearchEnabledVar bool) { xPreferencesDialogSetSearchEnabled(x.GoPointer(), SearchEnabledVar) } var xPreferencesDialogSetVisiblePage func(uintptr, uintptr) // Makes @page the visible page of @self. func (x *PreferencesDialog) SetVisiblePage(PageVar *PreferencesPage) { xPreferencesDialogSetVisiblePage(x.GoPointer(), PageVar.GoPointer()) } var xPreferencesDialogSetVisiblePageName func(uintptr, string) // Makes the page with the given name visible. // // See [property@PreferencesDialog:visible-page]. func (x *PreferencesDialog) SetVisiblePageName(NameVar string) { xPreferencesDialogSetVisiblePageName(x.GoPointer(), NameVar) } func (c *PreferencesDialog) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *PreferencesDialog) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertySearchEnabled sets the "search-enabled" property. // Whether search is enabled. func (x *PreferencesDialog) SetPropertySearchEnabled(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("search-enabled", &v) } // GetPropertySearchEnabled gets the "search-enabled" property. // Whether search is enabled. func (x *PreferencesDialog) GetPropertySearchEnabled() bool { var v gobject.Value x.GetProperty("search-enabled", &v) return v.GetBoolean() } // SetPropertyVisiblePageName sets the "visible-page-name" property. // The name of the currently visible page. // // See [property@AdwPreferencesDialog:visible-page]. func (x *PreferencesDialog) SetPropertyVisiblePageName(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("visible-page-name", &v) } // GetPropertyVisiblePageName gets the "visible-page-name" property. // The name of the currently visible page. // // See [property@AdwPreferencesDialog:visible-page]. func (x *PreferencesDialog) GetPropertyVisiblePageName() string { var v gobject.Value x.GetProperty("visible-page-name", &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 *PreferencesDialog) 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 *PreferencesDialog) 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 *PreferencesDialog) GetAccessibleRole() gtk.AccessibleRole { cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *PreferencesDialog) 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 *PreferencesDialog) 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 *PreferencesDialog) 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 *PreferencesDialog) 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 *PreferencesDialog) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *PreferencesDialog) ResetProperty(PropertyVar gtk.AccessibleProperty) { gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *PreferencesDialog) ResetRelation(RelationVar gtk.AccessibleRelation) { gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *PreferencesDialog) 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 *PreferencesDialog) 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 *PreferencesDialog) 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 *PreferencesDialog) 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 *PreferencesDialog) 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 *PreferencesDialog) 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 *PreferencesDialog) 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 *PreferencesDialog) 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 *PreferencesDialog) 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 *PreferencesDialog) 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 *PreferencesDialog) 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(&xPreferencesDialogGLibType, libs, "adw_preferences_dialog_get_type") core.PuregoSafeRegister(&xNewPreferencesDialog, libs, "adw_preferences_dialog_new") core.PuregoSafeRegister(&xPreferencesDialogAdd, libs, "adw_preferences_dialog_add") core.PuregoSafeRegister(&xPreferencesDialogAddToast, libs, "adw_preferences_dialog_add_toast") core.PuregoSafeRegister(&xPreferencesDialogGetSearchEnabled, libs, "adw_preferences_dialog_get_search_enabled") core.PuregoSafeRegister(&xPreferencesDialogGetVisiblePage, libs, "adw_preferences_dialog_get_visible_page") core.PuregoSafeRegister(&xPreferencesDialogGetVisiblePageName, libs, "adw_preferences_dialog_get_visible_page_name") core.PuregoSafeRegister(&xPreferencesDialogPopSubpage, libs, "adw_preferences_dialog_pop_subpage") core.PuregoSafeRegister(&xPreferencesDialogPushSubpage, libs, "adw_preferences_dialog_push_subpage") core.PuregoSafeRegister(&xPreferencesDialogRemove, libs, "adw_preferences_dialog_remove") core.PuregoSafeRegister(&xPreferencesDialogSetSearchEnabled, libs, "adw_preferences_dialog_set_search_enabled") core.PuregoSafeRegister(&xPreferencesDialogSetVisiblePage, libs, "adw_preferences_dialog_set_visible_page") core.PuregoSafeRegister(&xPreferencesDialogSetVisiblePageName, libs, "adw_preferences_dialog_set_visible_page_name") }