// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gtk 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" ) type ShortcutsSectionClass struct { _ structs.HostLayout } func (x *ShortcutsSectionClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // A `GtkShortcutsSection` collects all the keyboard shortcuts and gestures // for a major application mode. // // If your application needs multiple sections, you should give each // section a unique [property@Gtk.ShortcutsSection:section-name] and // a [property@Gtk.ShortcutsSection:title] that can be shown in the // section selector of the [class@Gtk.ShortcutsWindow]. // // The [property@Gtk.ShortcutsSection:max-height] property can be used // to influence how the groups in the section are distributed over pages // and columns. // // This widget is only meant to be used with [class@Gtk.ShortcutsWindow]. // // The recommended way to construct a `GtkShortcutsSection` is with // [class@Gtk.Builder], by using the `<child>` tag to populate a // `GtkShortcutsSection` with one or more [class@Gtk.ShortcutsGroup] // instances, which in turn contain one or more [class@Gtk.ShortcutsShortcut] // objects. // // If you need to add a group programmatically, use // [method@Gtk.ShortcutsSection.add_group]. // // # Shortcuts and Gestures // // Pan gestures allow to navigate between sections. // // The following signals have default keybindings: // // - [signal@Gtk.ShortcutsSection::change-current-page] type ShortcutsSection struct { Box } var xShortcutsSectionGLibType func() types.GType func ShortcutsSectionGLibType() types.GType { return xShortcutsSectionGLibType() } func ShortcutsSectionNewFromInternalPtr(ptr uintptr) *ShortcutsSection { cls := &ShortcutsSection{} cls.Ptr = ptr return cls } var xShortcutsSectionAddGroup func(uintptr, uintptr) // Adds a group to the shortcuts section. // // This is the programmatic equivalent to using [class@Gtk.Builder] and a // `<child>` tag to add the child. // // Adding children with the `GtkBox` API is not appropriate, as // `GtkShortcutsSection` manages its children internally. func (x *ShortcutsSection) AddGroup(GroupVar *ShortcutsGroup) { xShortcutsSectionAddGroup(x.GoPointer(), GroupVar.GoPointer()) } func (c *ShortcutsSection) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *ShortcutsSection) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyMaxHeight sets the "max-height" property. // The maximum number of lines to allow per column. // // This property can be used to influence how the groups in this // section are distributed across pages and columns. The default // value of 15 should work in most cases. func (x *ShortcutsSection) SetPropertyMaxHeight(value uint) { var v gobject.Value v.Init(gobject.TypeUintVal) v.SetUint(value) x.SetProperty("max-height", &v) } // GetPropertyMaxHeight gets the "max-height" property. // The maximum number of lines to allow per column. // // This property can be used to influence how the groups in this // section are distributed across pages and columns. The default // value of 15 should work in most cases. func (x *ShortcutsSection) GetPropertyMaxHeight() uint { var v gobject.Value x.GetProperty("max-height", &v) return v.GetUint() } // SetPropertySectionName sets the "section-name" property. // A unique name to identify this section among the sections // added to the `GtkShortcutsWindow`. // // Setting the [property@Gtk.ShortcutsWindow:section-name] property // to this string will make this section shown in the `GtkShortcutsWindow`. func (x *ShortcutsSection) SetPropertySectionName(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("section-name", &v) } // GetPropertySectionName gets the "section-name" property. // A unique name to identify this section among the sections // added to the `GtkShortcutsWindow`. // // Setting the [property@Gtk.ShortcutsWindow:section-name] property // to this string will make this section shown in the `GtkShortcutsWindow`. func (x *ShortcutsSection) GetPropertySectionName() string { var v gobject.Value x.GetProperty("section-name", &v) return v.GetString() } // SetPropertyTitle sets the "title" property. // The string to show in the section selector of the `GtkShortcutsWindow` // for this section. // // If there is only one section, you don't need to set a title, // since the section selector will not be shown in this case. func (x *ShortcutsSection) SetPropertyTitle(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("title", &v) } // GetPropertyTitle gets the "title" property. // The string to show in the section selector of the `GtkShortcutsWindow` // for this section. // // If there is only one section, you don't need to set a title, // since the section selector will not be shown in this case. func (x *ShortcutsSection) GetPropertyTitle() string { var v gobject.Value x.GetProperty("title", &v) return v.GetString() } // SetPropertyViewName sets the "view-name" property. // A view name to filter the groups in this section by. // // See [property@Gtk.ShortcutsGroup:view]. // // Applications are expected to use the // [property@Gtk.ShortcutsWindow:view-name] property // for this purpose. func (x *ShortcutsSection) SetPropertyViewName(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("view-name", &v) } // GetPropertyViewName gets the "view-name" property. // A view name to filter the groups in this section by. // // See [property@Gtk.ShortcutsGroup:view]. // // Applications are expected to use the // [property@Gtk.ShortcutsWindow:view-name] property // for this purpose. func (x *ShortcutsSection) GetPropertyViewName() string { var v gobject.Value x.GetProperty("view-name", &v) return v.GetString() } // Emitted when we change the current page. // // The default bindings for this signal are // <kbd>Ctrl</kbd>+<kbd>PgUp</kbd>, <kbd>PgUp</kbd>, // <kbd>Ctrl</kbd>+<kbd>PgDn</kbd>, <kbd>PgDn</kbd>. func (x *ShortcutsSection) ConnectChangeCurrentPage(cb *func(ShortcutsSection, int) bool) uint { cbPtr := uintptr(unsafe.Pointer(cb)) if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { handlerID := gobject.SignalConnect(x.GoPointer(), "change-current-page", cbRefPtr) glib.SaveHandlerMapping(handlerID, cbPtr) return handlerID } fcb := func(clsPtr uintptr, OffsetVarp int) bool { fa := ShortcutsSection{} fa.Ptr = clsPtr cbFn := *cb return cbFn(fa, OffsetVarp) } cbRefPtr := purego.NewCallback(fcb) glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb) handlerID := gobject.SignalConnect(x.GoPointer(), "change-current-page", 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 *ShortcutsSection) 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 *ShortcutsSection) 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 *ShortcutsSection) GetAccessibleRole() AccessibleRole { cret := XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *ShortcutsSection) 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 *ShortcutsSection) 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 *ShortcutsSection) 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 *ShortcutsSection) 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 *ShortcutsSection) GetPlatformState(StateVar AccessiblePlatformState) bool { cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *ShortcutsSection) ResetProperty(PropertyVar AccessibleProperty) { XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *ShortcutsSection) ResetRelation(RelationVar AccessibleRelation) { XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *ShortcutsSection) 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 *ShortcutsSection) 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 *ShortcutsSection) 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 *ShortcutsSection) 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 *ShortcutsSection) 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 *ShortcutsSection) 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 *ShortcutsSection) 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 *ShortcutsSection) 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 *ShortcutsSection) 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 *ShortcutsSection) 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 *ShortcutsSection) GetBuildableId() string { cret := XGtkBuildableGetBuildableId(x.GoPointer()) return cret } // Retrieves the orientation of the @orientable. func (x *ShortcutsSection) GetOrientation() Orientation { cret := XGtkOrientableGetOrientation(x.GoPointer()) return cret } // Sets the orientation of the @orientable. func (x *ShortcutsSection) SetOrientation(OrientationVar Orientation) { XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar) } 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(&xShortcutsSectionGLibType, libs, "gtk_shortcuts_section_get_type") core.PuregoSafeRegister(&xShortcutsSectionAddGroup, libs, "gtk_shortcuts_section_add_group") }