// 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" ) type EnumListItemClass struct { _ structs.HostLayout ParentClass gobject.ObjectClass } func (x *EnumListItemClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } type EnumListModelClass struct { _ structs.HostLayout ParentClass gobject.ObjectClass } func (x *EnumListModelClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // `AdwEnumListItem` is the type of items in a [class@EnumListModel]. type EnumListItem struct { gobject.Object } var xEnumListItemGLibType func() types.GType func EnumListItemGLibType() types.GType { return xEnumListItemGLibType() } func EnumListItemNewFromInternalPtr(ptr uintptr) *EnumListItem { cls := &EnumListItem{} cls.Ptr = ptr return cls } var xEnumListItemGetName func(uintptr) string // Gets the enum value name. func (x *EnumListItem) GetName() string { cret := xEnumListItemGetName(x.GoPointer()) return cret } var xEnumListItemGetNick func(uintptr) string // Gets the enum value nick. func (x *EnumListItem) GetNick() string { cret := xEnumListItemGetNick(x.GoPointer()) return cret } var xEnumListItemGetValue func(uintptr) int // Gets the enum value. func (x *EnumListItem) GetValue() int { cret := xEnumListItemGetValue(x.GoPointer()) return cret } func (c *EnumListItem) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *EnumListItem) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // GetPropertyName gets the "name" property. // The enum value name. func (x *EnumListItem) GetPropertyName() string { var v gobject.Value x.GetProperty("name", &v) return v.GetString() } // GetPropertyNick gets the "nick" property. // The enum value nick. func (x *EnumListItem) GetPropertyNick() string { var v gobject.Value x.GetProperty("nick", &v) return v.GetString() } // GetPropertyValue gets the "value" property. // The enum value. func (x *EnumListItem) GetPropertyValue() int { var v gobject.Value x.GetProperty("value", &v) return v.GetInt() } // A [iface@Gio.ListModel] representing values of a given enum. // // `AdwEnumListModel` contains objects of type [class@EnumListItem]. type EnumListModel struct { gobject.Object } var xEnumListModelGLibType func() types.GType func EnumListModelGLibType() types.GType { return xEnumListModelGLibType() } func EnumListModelNewFromInternalPtr(ptr uintptr) *EnumListModel { cls := &EnumListModel{} cls.Ptr = ptr return cls } var xNewEnumListModel func(types.GType) uintptr // Creates a new `AdwEnumListModel` for @enum_type. func NewEnumListModel(EnumTypeVar types.GType) *EnumListModel { var cls *EnumListModel cret := xNewEnumListModel(EnumTypeVar) if cret == 0 { return nil } cls = &EnumListModel{} cls.Ptr = cret return cls } var xEnumListModelFindPosition func(uintptr, int) uint // Finds the position of a given enum value in @self. // // If the value is not found, `GTK_INVALID_LIST_POSITION` is returned. func (x *EnumListModel) FindPosition(ValueVar int) uint { cret := xEnumListModelFindPosition(x.GoPointer(), ValueVar) return cret } var xEnumListModelGetEnumType func(uintptr) types.GType // Gets the type of the enum represented by @self. func (x *EnumListModel) GetEnumType() types.GType { cret := xEnumListModelGetEnumType(x.GoPointer()) return cret } func (c *EnumListModel) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *EnumListModel) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // 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 *EnumListModel) 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 *EnumListModel) 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 *EnumListModel) 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 *EnumListModel) 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 *EnumListModel) ItemsChanged(PositionVar uint, RemovedVar uint, AddedVar uint) { gio.XGListModelItemsChanged(x.GoPointer(), PositionVar, RemovedVar, AddedVar) } 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(&xEnumListItemGLibType, libs, "adw_enum_list_item_get_type") core.PuregoSafeRegister(&xEnumListItemGetName, libs, "adw_enum_list_item_get_name") core.PuregoSafeRegister(&xEnumListItemGetNick, libs, "adw_enum_list_item_get_nick") core.PuregoSafeRegister(&xEnumListItemGetValue, libs, "adw_enum_list_item_get_value") core.PuregoSafeRegister(&xEnumListModelGLibType, libs, "adw_enum_list_model_get_type") core.PuregoSafeRegister(&xNewEnumListModel, libs, "adw_enum_list_model_new") core.PuregoSafeRegister(&xEnumListModelFindPosition, libs, "adw_enum_list_model_find_position") core.PuregoSafeRegister(&xEnumListModelGetEnumType, libs, "adw_enum_list_model_get_enum_type") }