// 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/gio" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" "github.com/bnema/puregotk/v4/gtk" ) type ShortcutsSectionClass struct { _ structs.HostLayout ParentClass gobject.ObjectClass } func (x *ShortcutsSectionClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // An object representing a section in [class@ShortcutsDialog]. // // It contains [class@ShortcutsItem] objects, use [method@ShortcutsSection.add] to // add them. // // `AdwShortcutsSection` implements the [iface@Gio.ListModel] interface and // allows to access the added shortcut items through it. // // ## `AdwShortcutsSection` as `GtkBuildable` // // `AdwShortcutsSection` allows adding `AdwShortcutsItem` objects as children. type ShortcutsSection struct { gobject.Object } var xShortcutsSectionGLibType func() types.GType func ShortcutsSectionGLibType() types.GType { return xShortcutsSectionGLibType() } func ShortcutsSectionNewFromInternalPtr(ptr uintptr) *ShortcutsSection { cls := &ShortcutsSection{} cls.Ptr = ptr return cls } var xNewShortcutsSection func(uintptr) uintptr // Creates a new `AdwShortcutsSection` with @title as its title if provided. func NewShortcutsSection(TitleVar *string) *ShortcutsSection { var cls *ShortcutsSection TitleVarPtr := core.GStrdupNullable(TitleVar) defer core.GFreeNullable(TitleVarPtr) cret := xNewShortcutsSection(TitleVarPtr) if cret == 0 { return nil } cls = &ShortcutsSection{} cls.Ptr = cret return cls } var xShortcutsSectionAdd func(uintptr, uintptr) // Adds @item to @self. func (x *ShortcutsSection) Add(ItemVar *ShortcutsItem) { xShortcutsSectionAdd(x.GoPointer(), ItemVar.GoPointer()) } var xShortcutsSectionGetTitle func(uintptr) string // Gets the title of @self. func (x *ShortcutsSection) GetTitle() string { cret := xShortcutsSectionGetTitle(x.GoPointer()) return cret } var xShortcutsSectionSetTitle func(uintptr, uintptr) // Sets the title of @self. func (x *ShortcutsSection) SetTitle(TitleVar *string) { TitleVarPtr := core.GStrdupNullable(TitleVar) defer core.GFreeNullable(TitleVarPtr) xShortcutsSectionSetTitle(x.GoPointer(), TitleVarPtr) } func (c *ShortcutsSection) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *ShortcutsSection) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyTitle sets the "title" property. // The title of the section, can be `NULL`. 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 title of the section, can be `NULL`. func (x *ShortcutsSection) GetPropertyTitle() string { var v gobject.Value x.GetProperty("title", &v) return v.GetString() } // Get the item at @position. // // If @position is greater than the number of items in @list, %NULL is // returned. // // %NULL is never returned for an index that is smaller than the length // of the list. // // See also: g_list_model_get_n_items() func (x *ShortcutsSection) GetItem(PositionVar uint) uintptr { cret := gio.XGListModelGetItem(x.GoPointer(), PositionVar) return cret } // Gets the type of the items in @list. // // All items returned from g_list_model_get_item() are of the type // returned by this function, or a subtype, or if the type is an // interface, they are an implementation of that interface. // // The item type of a #GListModel can not change during the life of the // model. func (x *ShortcutsSection) GetItemType() types.GType { cret := gio.XGListModelGetItemType(x.GoPointer()) return cret } // Gets the number of items in @list. // // Depending on the model implementation, calling this function may be // less efficient than iterating the list with increasing values for // @position until g_list_model_get_item() returns %NULL. func (x *ShortcutsSection) GetNItems() uint { cret := gio.XGListModelGetNItems(x.GoPointer()) return cret } // Get the item at @position. // // If @position is greater than the number of items in @list, %NULL is // returned. // // %NULL is never returned for an index that is smaller than the length // of the list. // // This function is meant to be used by language bindings in place // of g_list_model_get_item(). // // See also: g_list_model_get_n_items() func (x *ShortcutsSection) GetObject(PositionVar uint) *gobject.Object { var cls *gobject.Object cret := gio.XGListModelGetObject(x.GoPointer(), PositionVar) if cret == 0 { return nil } cls = &gobject.Object{} cls.Ptr = cret return cls } // Emits the #GListModel::items-changed signal on @list. // // This function should only be called by classes implementing // #GListModel. It has to be called after the internal representation // of @list has been updated, because handlers connected to this signal // might query the new state of the list. // // Implementations must only make changes to the model (as visible to // its consumer) in places that will not cause problems for that // consumer. For models that are driven directly by a write API (such // as #GListStore), changes can be reported in response to uses of that // API. For models that represent remote data, changes should only be // made from a fresh mainloop dispatch. It is particularly not // permitted to make changes in response to a call to the #GListModel // consumer API. // // Stated another way: in general, it is assumed that code making a // series of accesses to the model via the API, without returning to the // mainloop, and without calling other code, will continue to view the // same contents of the model. func (x *ShortcutsSection) ItemsChanged(PositionVar uint, RemovedVar uint, AddedVar uint) { gio.XGListModelItemsChanged(x.GoPointer(), PositionVar, RemovedVar, AddedVar) } // 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 := 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(&xShortcutsSectionGLibType, libs, "adw_shortcuts_section_get_type") core.PuregoSafeRegister(&xNewShortcutsSection, libs, "adw_shortcuts_section_new") core.PuregoSafeRegister(&xShortcutsSectionAdd, libs, "adw_shortcuts_section_add") core.PuregoSafeRegister(&xShortcutsSectionGetTitle, libs, "adw_shortcuts_section_get_title") core.PuregoSafeRegister(&xShortcutsSectionSetTitle, libs, "adw_shortcuts_section_set_title") }