// 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 WindowTitleClass struct { _ structs.HostLayout ParentClass gtk.WidgetClass } func (x *WindowTitleClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // A helper widget for setting a window's title and subtitle. // // <picture> // // <source srcset="window-title-dark.png" media="(prefers-color-scheme: dark)"> // <img src="window-title.png" alt="window-title"> // // </picture> // // `AdwWindowTitle` shows a title and subtitle. It's intended to be used as the // title child of [class@Gtk.HeaderBar] or [class@HeaderBar]. // // ## CSS nodes // // `AdwWindowTitle` has a single CSS node with name `windowtitle`. type WindowTitle struct { gtk.Widget } var xWindowTitleGLibType func() types.GType func WindowTitleGLibType() types.GType { return xWindowTitleGLibType() } func WindowTitleNewFromInternalPtr(ptr uintptr) *WindowTitle { cls := &WindowTitle{} cls.Ptr = ptr return cls } var xNewWindowTitle func(string, string) uintptr // Creates a new `AdwWindowTitle`. func NewWindowTitle(TitleVar string, SubtitleVar string) *WindowTitle { var cls *WindowTitle cret := xNewWindowTitle(TitleVar, SubtitleVar) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &WindowTitle{} cls.Ptr = cret return cls } var xWindowTitleGetSubtitle func(uintptr) string // Gets the subtitle of @self. func (x *WindowTitle) GetSubtitle() string { cret := xWindowTitleGetSubtitle(x.GoPointer()) return cret } var xWindowTitleGetTitle func(uintptr) string // Gets the title of @self. func (x *WindowTitle) GetTitle() string { cret := xWindowTitleGetTitle(x.GoPointer()) return cret } var xWindowTitleSetSubtitle func(uintptr, string) // Sets the subtitle of @self. // // The subtitle should give the user additional details. func (x *WindowTitle) SetSubtitle(SubtitleVar string) { xWindowTitleSetSubtitle(x.GoPointer(), SubtitleVar) } var xWindowTitleSetTitle 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 *WindowTitle) SetTitle(TitleVar string) { xWindowTitleSetTitle(x.GoPointer(), TitleVar) } func (c *WindowTitle) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) GetAccessibleRole() gtk.AccessibleRole { cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *WindowTitle) ResetProperty(PropertyVar gtk.AccessibleProperty) { gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *WindowTitle) ResetRelation(RelationVar gtk.AccessibleRelation) { gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) 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 *WindowTitle) 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(&xWindowTitleGLibType, libs, "adw_window_title_get_type") core.PuregoSafeRegister(&xNewWindowTitle, libs, "adw_window_title_new") core.PuregoSafeRegister(&xWindowTitleGetSubtitle, libs, "adw_window_title_get_subtitle") core.PuregoSafeRegister(&xWindowTitleGetTitle, libs, "adw_window_title_get_title") core.PuregoSafeRegister(&xWindowTitleSetSubtitle, libs, "adw_window_title_set_subtitle") core.PuregoSafeRegister(&xWindowTitleSetTitle, libs, "adw_window_title_set_title") }