// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gtk import ( "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) // Presents contextual actions. // // <picture> // // <source srcset="action-bar-dark.png" media="(prefers-color-scheme: dark)"> // <img alt="An example GtkActionBar" src="action-bar.png"> // // </picture> // // `GtkActionBar` is expected to be displayed below the content and expand // horizontally to fill the area. // // It allows placing children at the start or the end. In addition, it // contains an internal centered box which is centered with respect to // the full width of the box, even if the children at either side take // up different amounts of space. // // # GtkActionBar as GtkBuildable // // The `GtkActionBar` implementation of the `GtkBuildable` interface supports // adding children at the start or end sides by specifying “start” or “end” as // the “type” attribute of a `<child>` element, or setting the center widget // by specifying “center” value. // // # CSS nodes // // ``` // actionbar // ╰── revealer // // ╰── box // ├── box.start // │ ╰── [start children] // ├── [center widget] // ╰── box.end // ╰── [end children] // // ``` // // A `GtkActionBar`'s CSS node is called `actionbar`. It contains a `revealer` // subnode, which contains a `box` subnode, which contains two `box` subnodes at // the start and end of the action bar, with `start` and `end` style classes // respectively, as well as a center node that represents the center child. // // Each of the boxes contains children packed for that side. type ActionBar struct { Widget } var xActionBarGLibType func() types.GType func ActionBarGLibType() types.GType { return xActionBarGLibType() } func ActionBarNewFromInternalPtr(ptr uintptr) *ActionBar { cls := &ActionBar{} cls.Ptr = ptr return cls } var xNewActionBar func() uintptr // Creates a new action bar widget. func NewActionBar() *ActionBar { var cls *ActionBar cret := xNewActionBar() if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &ActionBar{} cls.Ptr = cret return cls } var xActionBarGetCenterWidget func(uintptr) uintptr // Retrieves the center bar widget of the bar. func (x *ActionBar) GetCenterWidget() *Widget { var cls *Widget cret := xActionBarGetCenterWidget(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Widget{} cls.Ptr = cret return cls } var xActionBarGetRevealed func(uintptr) bool // Gets whether the contents of the action bar are revealed. func (x *ActionBar) GetRevealed() bool { cret := xActionBarGetRevealed(x.GoPointer()) return cret } var xActionBarPackEnd func(uintptr, uintptr) // Adds a child to the action bar, packed with reference to the // end of the action bar. func (x *ActionBar) PackEnd(ChildVar *Widget) { xActionBarPackEnd(x.GoPointer(), ChildVar.GoPointer()) } var xActionBarPackStart func(uintptr, uintptr) // Adds a child to the action, packed with reference to the // start of the action bar. func (x *ActionBar) PackStart(ChildVar *Widget) { xActionBarPackStart(x.GoPointer(), ChildVar.GoPointer()) } var xActionBarRemove func(uintptr, uintptr) // Removes a child from the action bar. func (x *ActionBar) Remove(ChildVar *Widget) { xActionBarRemove(x.GoPointer(), ChildVar.GoPointer()) } var xActionBarSetCenterWidget func(uintptr, uintptr) // Sets the center widget for the action bar. func (x *ActionBar) SetCenterWidget(CenterWidgetVar *Widget) { xActionBarSetCenterWidget(x.GoPointer(), CenterWidgetVar.GoPointer()) } var xActionBarSetRevealed func(uintptr, bool) // Reveals or conceals the content of the action bar. // // Note: this does not show or hide the action bar in the // [property@Gtk.Widget:visible] sense, so revealing has // no effect if the action bar is hidden. func (x *ActionBar) SetRevealed(RevealedVar bool) { xActionBarSetRevealed(x.GoPointer(), RevealedVar) } func (c *ActionBar) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *ActionBar) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyRevealed sets the "revealed" property. // Controls whether the action bar shows its contents. func (x *ActionBar) SetPropertyRevealed(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("revealed", &v) } // GetPropertyRevealed gets the "revealed" property. // Controls whether the action bar shows its contents. func (x *ActionBar) GetPropertyRevealed() bool { var v gobject.Value x.GetProperty("revealed", &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 *ActionBar) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) { XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) } // Retrieves the accessible parent for an accessible object. // // This function returns `NULL` for top level widgets. func (x *ActionBar) GetAccessibleParent() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetAccessibleParent(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Retrieves the accessible role of an accessible object. func (x *ActionBar) GetAccessibleRole() AccessibleRole { cret := XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *ActionBar) GetAtContext() *ATContext { var cls *ATContext cret := XGtkAccessibleGetAtContext(x.GoPointer()) if cret == 0 { return nil } cls = &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 *ActionBar) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool { cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) return cret } // Retrieves the first accessible child of an accessible object. func (x *ActionBar) GetFirstAccessibleChild() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Retrieves the next accessible sibling of an accessible object func (x *ActionBar) GetNextAccessibleSibling() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) if cret == 0 { return nil } cls = &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 *ActionBar) GetPlatformState(StateVar AccessiblePlatformState) bool { cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *ActionBar) ResetProperty(PropertyVar AccessibleProperty) { XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *ActionBar) ResetRelation(RelationVar AccessibleRelation) { XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *ActionBar) ResetState(StateVar AccessibleState) { 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 *ActionBar) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) { 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 *ActionBar) UpdateNextAccessibleSibling(NewSiblingVar Accessible) { 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 *ActionBar) UpdatePlatformState(StateVar AccessiblePlatformState) { 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 *ActionBar) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) { 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 *ActionBar) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) { 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 *ActionBar) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) { 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 *ActionBar) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) { 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 *ActionBar) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) { 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 *ActionBar) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) { 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 *ActionBar) GetBuildableId() string { cret := XGtkBuildableGetBuildableId(x.GoPointer()) return cret } func init() { core.SetPackageName("GTK", "gtk4") core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"}) var libs []uintptr for _, libPath := range core.GetPaths("GTK") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xActionBarGLibType, libs, "gtk_action_bar_get_type") core.PuregoSafeRegister(&xNewActionBar, libs, "gtk_action_bar_new") core.PuregoSafeRegister(&xActionBarGetCenterWidget, libs, "gtk_action_bar_get_center_widget") core.PuregoSafeRegister(&xActionBarGetRevealed, libs, "gtk_action_bar_get_revealed") core.PuregoSafeRegister(&xActionBarPackEnd, libs, "gtk_action_bar_pack_end") core.PuregoSafeRegister(&xActionBarPackStart, libs, "gtk_action_bar_pack_start") core.PuregoSafeRegister(&xActionBarRemove, libs, "gtk_action_bar_remove") core.PuregoSafeRegister(&xActionBarSetCenterWidget, libs, "gtk_action_bar_set_center_widget") core.PuregoSafeRegister(&xActionBarSetRevealed, libs, "gtk_action_bar_set_revealed") }