// 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/glib" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" "github.com/bnema/puregotk/v4/gtk" ) type BannerClass struct { _ structs.HostLayout ParentClass gtk.WidgetClass } func (x *BannerClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Describes the available button styles for [class@Banner]. // // New values may be added to this enumeration over time. // // See [property@Banner:button-style]. type BannerButtonStyle int var xBannerButtonStyleGLibType func() types.GType func BannerButtonStyleGLibType() types.GType { return xBannerButtonStyleGLibType() } const ( // The default button style. BannerButtonDefaultValue BannerButtonStyle = 0 // A button in the suggested action style. BannerButtonSuggestedValue BannerButtonStyle = 1 ) // A bar with contextual information. // // <picture> // // <source srcset="banner-dark.png" media="(prefers-color-scheme: dark)"> // <img src="banner.png" alt="banner"> // // </picture> // // Banners are hidden by default, use [property@Banner:revealed] to show them. // // Banners have a title, set with [property@Banner:title]. Titles can be marked // up with Pango markup, use [property@Banner:use-markup] to enable it. // // The title will be shown centered or left-aligned depending on available // space. // // Banners can optionally have a button with text on it, set through // [property@Banner:button-label]. The button can be used with a `GAction`, // or with the [signal@Banner::button-clicked] signal. The button can have // different styles, a gray style and a suggested style. // // <picture> // // <source srcset="banner-suggested-dark.png" media="(prefers-color-scheme: dark)"> // <img src="banner-suggested.png" alt="banner with suggested button style"> // // </picture> // // ## CSS nodes // // `AdwBanner` has a main CSS node with the name `banner`. type Banner struct { gtk.Widget } var xBannerGLibType func() types.GType func BannerGLibType() types.GType { return xBannerGLibType() } func BannerNewFromInternalPtr(ptr uintptr) *Banner { cls := &Banner{} cls.Ptr = ptr return cls } var xNewBanner func(string) uintptr // Creates a new `AdwBanner`. func NewBanner(TitleVar string) *Banner { var cls *Banner cret := xNewBanner(TitleVar) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Banner{} cls.Ptr = cret return cls } var xBannerGetButtonLabel func(uintptr) string // Gets the button label for @self. func (x *Banner) GetButtonLabel() string { cret := xBannerGetButtonLabel(x.GoPointer()) return cret } var xBannerGetButtonStyle func(uintptr) BannerButtonStyle // Gets the style class in use for the banner button. func (x *Banner) GetButtonStyle() BannerButtonStyle { cret := xBannerGetButtonStyle(x.GoPointer()) return cret } var xBannerGetRevealed func(uintptr) bool // Gets if a banner is revealed func (x *Banner) GetRevealed() bool { cret := xBannerGetRevealed(x.GoPointer()) return cret } var xBannerGetTitle func(uintptr) string // Gets the title for @self. func (x *Banner) GetTitle() string { cret := xBannerGetTitle(x.GoPointer()) return cret } var xBannerGetUseMarkup func(uintptr) bool // Gets whether to use Pango markup for the banner title. func (x *Banner) GetUseMarkup() bool { cret := xBannerGetUseMarkup(x.GoPointer()) return cret } var xBannerSetButtonLabel func(uintptr, uintptr) // Sets the button label for @self. // // If set to `""` or `NULL`, the button won't be shown. // // The button can be used with a `GAction`, or with the // [signal@Banner::button-clicked] signal. func (x *Banner) SetButtonLabel(LabelVar *string) { LabelVarPtr := core.GStrdupNullable(LabelVar) defer core.GFreeNullable(LabelVarPtr) xBannerSetButtonLabel(x.GoPointer(), LabelVarPtr) } var xBannerSetButtonStyle func(uintptr, BannerButtonStyle) // Sets the style class to use for the banner button. // // When set to `ADW_BANNER_BUTTON_DEFAULT`, the button stays grey. // When set to `ADW_BANNER_BUTTON_SUGGESTED`, the button follows the [`.suggested-action`](style-classes.html#suggested-action) style // // <picture> // // <source srcset="banner-suggested-dark.png" media="(prefers-color-scheme: dark)"> // <img src="banner-suggested.png" alt="banner with suggested button style"> // // </picture> func (x *Banner) SetButtonStyle(StyleVar BannerButtonStyle) { xBannerSetButtonStyle(x.GoPointer(), StyleVar) } var xBannerSetRevealed func(uintptr, bool) // Sets whether a banner should be revealed func (x *Banner) SetRevealed(RevealedVar bool) { xBannerSetRevealed(x.GoPointer(), RevealedVar) } var xBannerSetTitle func(uintptr, string) // Sets the title for this banner. // // See also: [property@Banner:use-markup]. func (x *Banner) SetTitle(TitleVar string) { xBannerSetTitle(x.GoPointer(), TitleVar) } var xBannerSetUseMarkup func(uintptr, bool) // Sets whether to use Pango markup for the banner title. // // See also [func@Pango.parse_markup]. func (x *Banner) SetUseMarkup(UseMarkupVar bool) { xBannerSetUseMarkup(x.GoPointer(), UseMarkupVar) } func (c *Banner) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *Banner) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyButtonLabel sets the "button-label" property. // The label to show on the button. // // If set to `""` or `NULL`, the button won't be shown. // // The button can be used with a `GAction`, or with the // [signal@Banner::button-clicked] signal. func (x *Banner) SetPropertyButtonLabel(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("button-label", &v) } // GetPropertyButtonLabel gets the "button-label" property. // The label to show on the button. // // If set to `""` or `NULL`, the button won't be shown. // // The button can be used with a `GAction`, or with the // [signal@Banner::button-clicked] signal. func (x *Banner) GetPropertyButtonLabel() string { var v gobject.Value x.GetProperty("button-label", &v) return v.GetString() } // SetPropertyRevealed sets the "revealed" property. // Whether the banner is currently revealed. func (x *Banner) SetPropertyRevealed(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("revealed", &v) } // GetPropertyRevealed gets the "revealed" property. // Whether the banner is currently revealed. func (x *Banner) GetPropertyRevealed() bool { var v gobject.Value x.GetProperty("revealed", &v) return v.GetBoolean() } // SetPropertyTitle sets the "title" property. // The title for this banner. // // See also: [property@Banner:use-markup]. func (x *Banner) 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 banner. // // See also: [property@Banner:use-markup]. func (x *Banner) GetPropertyTitle() string { var v gobject.Value x.GetProperty("title", &v) return v.GetString() } // SetPropertyUseMarkup sets the "use-markup" property. // Whether to use Pango markup for the banner title. // // See also [func@Pango.parse_markup]. func (x *Banner) SetPropertyUseMarkup(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("use-markup", &v) } // GetPropertyUseMarkup gets the "use-markup" property. // Whether to use Pango markup for the banner title. // // See also [func@Pango.parse_markup]. func (x *Banner) GetPropertyUseMarkup() bool { var v gobject.Value x.GetProperty("use-markup", &v) return v.GetBoolean() } // This signal is emitted after the action button has been clicked. // // It can be used as an alternative to setting an action. func (x *Banner) ConnectButtonClicked(cb *func(Banner)) uint { cbPtr := uintptr(unsafe.Pointer(cb)) if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { handlerID := gobject.SignalConnect(x.GoPointer(), "button-clicked", cbRefPtr) glib.SaveHandlerMapping(handlerID, cbPtr) return handlerID } fcb := func(clsPtr uintptr) { fa := Banner{} fa.Ptr = clsPtr cbFn := *cb cbFn(fa) } cbRefPtr := purego.NewCallback(fcb) glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb) handlerID := gobject.SignalConnect(x.GoPointer(), "button-clicked", cbRefPtr) glib.SaveHandlerMapping(handlerID, cbPtr) return handlerID } // 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 *Banner) 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 *Banner) 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 *Banner) GetAccessibleRole() gtk.AccessibleRole { cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *Banner) 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 *Banner) 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 *Banner) 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 *Banner) 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 *Banner) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *Banner) ResetProperty(PropertyVar gtk.AccessibleProperty) { gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *Banner) ResetRelation(RelationVar gtk.AccessibleRelation) { gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *Banner) 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 *Banner) 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 *Banner) 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 *Banner) 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 *Banner) 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 *Banner) 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 *Banner) 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 *Banner) 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 *Banner) 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 *Banner) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) { gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) } // Gets the action name for @actionable. func (x *Banner) GetActionName() string { cret := gtk.XGtkActionableGetActionName(x.GoPointer()) return cret } // Gets the current target value of @actionable. func (x *Banner) GetActionTargetValue() *glib.Variant { cret := gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) return cret } // Specifies the name of the action with which this widget should be // associated. // // If @action_name is %NULL then the widget will be unassociated from // any previous action. // // Usually this function is used when the widget is located (or will be // located) within the hierarchy of a `GtkApplicationWindow`. // // Names are of the form “win.save” or “app.quit” for actions on the // containing [class@ApplicationWindow] or its associated [class@Application], // respectively. This is the same form used for actions in the [class@Gio.Menu] // associated with the window. func (x *Banner) SetActionName(ActionNameVar *string) { ActionNameVarPtr := core.GStrdupNullable(ActionNameVar) defer core.GFreeNullable(ActionNameVarPtr) gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVarPtr) } // Sets the target of an actionable widget. // // This is a convenience function that calls [ctor@GLib.Variant.new] for // @format_string and uses the result to call // [method@Gtk.Actionable.set_action_target_value]. // // If you are setting a string-valued target and want to set // the action name at the same time, you can use // [method@Gtk.Actionable.set_detailed_action_name]. func (x *Banner) SetActionTarget(FormatStringVar string, varArgs ...interface{}) { gtk.XGtkActionableSetActionTarget(x.GoPointer(), FormatStringVar, varArgs...) } // Sets the target value of an actionable widget. // // If @target_value is %NULL then the target value is unset. // // The target value has two purposes. First, it is used as the parameter // to activation of the action associated with the `GtkActionable` widget. // Second, it is used to determine if the widget should be rendered as // “active” — the widget is active if the state is equal to the given target. // // Consider the example of associating a set of buttons with a [iface@Gio.Action] // with string state in a typical “radio button” situation. Each button // will be associated with the same action, but with a different target // value for that action. Clicking on a particular button will activate // the action with the target of that button, which will typically cause // the action’s state to change to that value. Since the action’s state // is now equal to the target value of the button, the button will now // be rendered as active (and the other buttons, with different targets, // rendered inactive). func (x *Banner) SetActionTargetValue(TargetValueVar *glib.Variant) { gtk.XGtkActionableSetActionTargetValue(x.GoPointer(), TargetValueVar) } // Sets the action-name and associated string target value of an // actionable widget. // // @detailed_action_name is a string in the format accepted by // [func@Gio.Action.parse_detailed_name]. func (x *Banner) SetDetailedActionName(DetailedActionNameVar string) { gtk.XGtkActionableSetDetailedActionName(x.GoPointer(), DetailedActionNameVar) } // 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 *Banner) 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(&xBannerButtonStyleGLibType, libs, "adw_banner_button_style_get_type") core.PuregoSafeRegister(&xBannerGLibType, libs, "adw_banner_get_type") core.PuregoSafeRegister(&xNewBanner, libs, "adw_banner_new") core.PuregoSafeRegister(&xBannerGetButtonLabel, libs, "adw_banner_get_button_label") core.PuregoSafeRegister(&xBannerGetButtonStyle, libs, "adw_banner_get_button_style") core.PuregoSafeRegister(&xBannerGetRevealed, libs, "adw_banner_get_revealed") core.PuregoSafeRegister(&xBannerGetTitle, libs, "adw_banner_get_title") core.PuregoSafeRegister(&xBannerGetUseMarkup, libs, "adw_banner_get_use_markup") core.PuregoSafeRegister(&xBannerSetButtonLabel, libs, "adw_banner_set_button_label") core.PuregoSafeRegister(&xBannerSetButtonStyle, libs, "adw_banner_set_button_style") core.PuregoSafeRegister(&xBannerSetRevealed, libs, "adw_banner_set_revealed") core.PuregoSafeRegister(&xBannerSetTitle, libs, "adw_banner_set_title") core.PuregoSafeRegister(&xBannerSetUseMarkup, libs, "adw_banner_set_use_markup") }