// 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 ViewSwitcherTitleClass struct { _ structs.HostLayout ParentClass gtk.WidgetClass } func (x *ViewSwitcherTitleClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // A view switcher title. // // <picture> // // <source srcset="view-switcher-title-dark.png" media="(prefers-color-scheme: dark)"> // <img src="view-switcher-title.png" alt="view-switcher-title"> // // </picture> // // A widget letting you switch between multiple views contained by a // [class@ViewStack] via an [class@ViewSwitcher]. // // It is designed to be used as the title widget of a [class@HeaderBar], and // will display the window's title when the window is too narrow to fit the view // switcher e.g. on mobile phones, or if there are less than two views. // // In order to center the title in narrow windows, the header bar should have // [property@HeaderBar:centering-policy] set to // `ADW_CENTERING_POLICY_STRICT`. // // `AdwViewSwitcherTitle` is intended to be used together with // [class@ViewSwitcherBar]. // // A common use case is to bind the [property@ViewSwitcherBar:reveal] property // to [property@ViewSwitcherTitle:title-visible] to automatically reveal the // view switcher bar when the title label is displayed in place of the view // switcher, as follows: // // ```xml // <object class="AdwWindow"> // // <property name="content"> // <object class="AdwToolbarView"> // <child type="top"> // <object class="AdwHeaderBar"> // <property name="centering-policy">strict</property> // <property name="title-widget"> // <object class="AdwViewSwitcherTitle" id="title"> // <property name="stack">stack</property> // </object> // </property> // </object> // </child> // <property name="content"> // <object class="AdwViewStack" id="stack"/> // </property> // <child type="bottom"> // <object class="AdwViewSwitcherBar"> // <property name="stack">stack</property> // <binding name="reveal"> // <lookup name="title-visible">title</lookup> // </binding> // </object> // </child> // </object> // </property> // // </object> // ``` // // ## CSS nodes // // `AdwViewSwitcherTitle` has a single CSS node with name `viewswitchertitle`. type ViewSwitcherTitle struct { gtk.Widget } var xViewSwitcherTitleGLibType func() types.GType func ViewSwitcherTitleGLibType() types.GType { return xViewSwitcherTitleGLibType() } func ViewSwitcherTitleNewFromInternalPtr(ptr uintptr) *ViewSwitcherTitle { cls := &ViewSwitcherTitle{} cls.Ptr = ptr return cls } var xNewViewSwitcherTitle func() uintptr // Creates a new `AdwViewSwitcherTitle`. func NewViewSwitcherTitle() *ViewSwitcherTitle { var cls *ViewSwitcherTitle cret := xNewViewSwitcherTitle() if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &ViewSwitcherTitle{} cls.Ptr = cret return cls } var xViewSwitcherTitleGetStack func(uintptr) uintptr // Gets the stack controlled by @self. func (x *ViewSwitcherTitle) GetStack() *ViewStack { var cls *ViewStack cret := xViewSwitcherTitleGetStack(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &ViewStack{} cls.Ptr = cret return cls } var xViewSwitcherTitleGetSubtitle func(uintptr) string // Gets the subtitle of @self. func (x *ViewSwitcherTitle) GetSubtitle() string { cret := xViewSwitcherTitleGetSubtitle(x.GoPointer()) return cret } var xViewSwitcherTitleGetTitle func(uintptr) string // Gets the title of @self. func (x *ViewSwitcherTitle) GetTitle() string { cret := xViewSwitcherTitleGetTitle(x.GoPointer()) return cret } var xViewSwitcherTitleGetTitleVisible func(uintptr) bool // Gets whether the title of @self is currently visible. // // If the title is visible, it means the view switcher is hidden an it may be // wanted to show an alternative switcher, e.g. a [class@ViewSwitcherBar]. func (x *ViewSwitcherTitle) GetTitleVisible() bool { cret := xViewSwitcherTitleGetTitleVisible(x.GoPointer()) return cret } var xViewSwitcherTitleGetViewSwitcherEnabled func(uintptr) bool // Gets whether @self's view switcher is enabled. func (x *ViewSwitcherTitle) GetViewSwitcherEnabled() bool { cret := xViewSwitcherTitleGetViewSwitcherEnabled(x.GoPointer()) return cret } var xViewSwitcherTitleSetStack func(uintptr, uintptr) // Sets the stack controlled by @self. func (x *ViewSwitcherTitle) SetStack(StackVar *ViewStack) { xViewSwitcherTitleSetStack(x.GoPointer(), StackVar.GoPointer()) } var xViewSwitcherTitleSetSubtitle func(uintptr, string) // Sets the subtitle of @self. // // The subtitle should give the user additional details. func (x *ViewSwitcherTitle) SetSubtitle(SubtitleVar string) { xViewSwitcherTitleSetSubtitle(x.GoPointer(), SubtitleVar) } var xViewSwitcherTitleSetTitle func(uintptr, string) // Sets the title of @self. // // The title typically identifies the current view or content item, and // generally does not use the application name. func (x *ViewSwitcherTitle) SetTitle(TitleVar string) { xViewSwitcherTitleSetTitle(x.GoPointer(), TitleVar) } var xViewSwitcherTitleSetViewSwitcherEnabled func(uintptr, bool) // Sets whether @self's view switcher is enabled. // // If it is disabled, the title will be displayed instead. This allows to // programmatically hide the view switcher even if it fits in the available // space. // // This can be used e.g. to ensure the view switcher is hidden below a certain // window width, or any other constraint you find suitable. func (x *ViewSwitcherTitle) SetViewSwitcherEnabled(EnabledVar bool) { xViewSwitcherTitleSetViewSwitcherEnabled(x.GoPointer(), EnabledVar) } func (c *ViewSwitcherTitle) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *ViewSwitcherTitle) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertySubtitle sets the "subtitle" property. // The subtitle to display. // // The subtitle should give the user additional details. func (x *ViewSwitcherTitle) SetPropertySubtitle(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("subtitle", &v) } // GetPropertySubtitle gets the "subtitle" property. // The subtitle to display. // // The subtitle should give the user additional details. func (x *ViewSwitcherTitle) GetPropertySubtitle() string { var v gobject.Value x.GetProperty("subtitle", &v) return v.GetString() } // SetPropertyTitle sets the "title" property. // The title to display. // // The title typically identifies the current view or content item, and // generally does not use the application name. func (x *ViewSwitcherTitle) 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 to display. // // The title typically identifies the current view or content item, and // generally does not use the application name. func (x *ViewSwitcherTitle) GetPropertyTitle() string { var v gobject.Value x.GetProperty("title", &v) return v.GetString() } // GetPropertyTitleVisible gets the "title-visible" property. // Whether the title is currently visible. // // If the title is visible, it means the view switcher is hidden an it may be // wanted to show an alternative switcher, e.g. a [class@ViewSwitcherBar]. func (x *ViewSwitcherTitle) GetPropertyTitleVisible() bool { var v gobject.Value x.GetProperty("title-visible", &v) return v.GetBoolean() } // SetPropertyViewSwitcherEnabled sets the "view-switcher-enabled" property. // Whether the view switcher is enabled. // // If it is disabled, the title will be displayed instead. This allows to // programmatically hide the view switcher even if it fits in the available // space. // // This can be used e.g. to ensure the view switcher is hidden below a certain // window width, or any other constraint you find suitable. func (x *ViewSwitcherTitle) SetPropertyViewSwitcherEnabled(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("view-switcher-enabled", &v) } // GetPropertyViewSwitcherEnabled gets the "view-switcher-enabled" property. // Whether the view switcher is enabled. // // If it is disabled, the title will be displayed instead. This allows to // programmatically hide the view switcher even if it fits in the available // space. // // This can be used e.g. to ensure the view switcher is hidden below a certain // window width, or any other constraint you find suitable. func (x *ViewSwitcherTitle) GetPropertyViewSwitcherEnabled() bool { var v gobject.Value x.GetProperty("view-switcher-enabled", &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 *ViewSwitcherTitle) 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 *ViewSwitcherTitle) 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 *ViewSwitcherTitle) GetAccessibleRole() gtk.AccessibleRole { cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *ViewSwitcherTitle) 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 *ViewSwitcherTitle) 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 *ViewSwitcherTitle) 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 *ViewSwitcherTitle) 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 *ViewSwitcherTitle) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *ViewSwitcherTitle) ResetProperty(PropertyVar gtk.AccessibleProperty) { gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *ViewSwitcherTitle) ResetRelation(RelationVar gtk.AccessibleRelation) { gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *ViewSwitcherTitle) 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 *ViewSwitcherTitle) 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 *ViewSwitcherTitle) 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 *ViewSwitcherTitle) 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 *ViewSwitcherTitle) 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 *ViewSwitcherTitle) 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 *ViewSwitcherTitle) 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 *ViewSwitcherTitle) 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 *ViewSwitcherTitle) 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 *ViewSwitcherTitle) 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 *ViewSwitcherTitle) 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(&xViewSwitcherTitleGLibType, libs, "adw_view_switcher_title_get_type") core.PuregoSafeRegister(&xNewViewSwitcherTitle, libs, "adw_view_switcher_title_new") core.PuregoSafeRegister(&xViewSwitcherTitleGetStack, libs, "adw_view_switcher_title_get_stack") core.PuregoSafeRegister(&xViewSwitcherTitleGetSubtitle, libs, "adw_view_switcher_title_get_subtitle") core.PuregoSafeRegister(&xViewSwitcherTitleGetTitle, libs, "adw_view_switcher_title_get_title") core.PuregoSafeRegister(&xViewSwitcherTitleGetTitleVisible, libs, "adw_view_switcher_title_get_title_visible") core.PuregoSafeRegister(&xViewSwitcherTitleGetViewSwitcherEnabled, libs, "adw_view_switcher_title_get_view_switcher_enabled") core.PuregoSafeRegister(&xViewSwitcherTitleSetStack, libs, "adw_view_switcher_title_set_stack") core.PuregoSafeRegister(&xViewSwitcherTitleSetSubtitle, libs, "adw_view_switcher_title_set_subtitle") core.PuregoSafeRegister(&xViewSwitcherTitleSetTitle, libs, "adw_view_switcher_title_set_title") core.PuregoSafeRegister(&xViewSwitcherTitleSetViewSwitcherEnabled, libs, "adw_view_switcher_title_set_view_switcher_enabled") }