// Code generated by cmd/cgo; DO NOT EDIT. //line /home/josie/.cache/paru/clone/wiiudownloader/src/pkg/mod/github.com/gotk3/gotk3@v0.6.5-0.20240618185848-ff349ae13f56/glib/glistmodel.go:1:1 // Same copyright and license as the rest of the files in this project // +build !glib_2_40,!glib_2_42 package glib // #include // #include // #include // #include "glib.go.h" // #include "glib_since_2_44.go.h" import _ "unsafe" import ( "unsafe" "github.com/gotk3/gotk3/internal/callback" ) /* * GListModel */ // IListModel is an interface representation of ListModel, // used to avoid duplication when embedding the type in a wrapper of another GObject-based type. type IListModel interface { toGListModel() * /*line :26:18*/_Ctype_GListModel /*line :26:30*/ } // ListModel is a representation of GIO's GListModel. type ListModel struct { *Object } func (v *ListModel) toGListModel() * /*line :34:37*/_Ctype_GListModel /*line :34:49*/ { if v == nil { return nil } return v.native() } // native returns a pointer to the underlying GListModel. func (v *ListModel) native() * /*line :42:31*/_Ctype_GListModel /*line :42:43*/ { if v == nil || v.GObject == nil { return nil } return func() *_Ctype_struct__GListModel{ _cgo0 := /*line :46:24*/unsafe.Pointer(v.GObject); _cgoCheckPointer(_cgo0, nil); return /*line :46:50*/_Cfunc_toGListModel(_cgo0); }() } // Native returns a pointer to the underlying GListModel. func (v *ListModel) Native() uintptr { return uintptr(unsafe.Pointer(v.native())) } func marshalListModel(p uintptr) (interface{}, error) { c := ( /*line :55:7*/_Cfunc_g_value_get_object /*line :55:26*/)((* /*line :55:30*/_Ctype_GValue /*line :55:38*/)(unsafe.Pointer(p))) return wrapListModel(wrapObject(unsafe.Pointer(c))), nil } func wrapListModel(obj *Object) *ListModel { return &ListModel{obj} } // GetItemType is a wrapper around g_list_model_get_item_type(). func (v *ListModel) GetItemType() Type { return Type(func() _Ctype_GType{ _cgo0 := /*line :65:43*/v.native(); _cgoCheckPointer(_cgo0, nil); return /*line :65:54*/_Cfunc_g_list_model_get_item_type(_cgo0); }()) } // GetNItems is a wrapper around g_list_model_get_n_items(). func (v *ListModel) GetNItems() uint { return uint(func() _Ctype_guint{ _cgo0 := /*line :70:41*/v.native(); _cgoCheckPointer(_cgo0, nil); return /*line :70:52*/_Cfunc_g_list_model_get_n_items(_cgo0); }()) } // GetItem is a wrapper around g_list_model_get_item(). func (v *ListModel) GetItem(position uint) uintptr { c := func() _Ctype_gpointer{ _cgo0 := /*line :75:31*/v.native(); var _cgo1 _Ctype_guint = _Ctype_guint /*line :75:50*/(position); _cgoCheckPointer(_cgo0, nil); return /*line :75:61*/_Cfunc_g_list_model_get_item(_cgo0, _cgo1); }() return uintptr(unsafe.Pointer(c)) } // GetObject is a wrapper around g_list_model_get_object(). func (v *ListModel) GetObject(position uint) *Object { c := func() *_Ctype_struct__GObject{ _cgo0 := /*line :81:33*/v.native(); var _cgo1 _Ctype_guint = _Ctype_guint /*line :81:52*/(position); _cgoCheckPointer(_cgo0, nil); return /*line :81:63*/_Cfunc_g_list_model_get_object(_cgo0, _cgo1); }() return wrapObject(unsafe.Pointer(c)) } // ItemsChanged is a wrapper around g_list_model_items_changed(). func (v *ListModel) ItemsChanged(position, removed, added uint) { func() { _cgo0 := /*line :87:31*/v.native(); var _cgo1 _Ctype_guint = _Ctype_guint /*line :87:50*/(position); var _cgo2 _Ctype_guint = _Ctype_guint /*line :87:69*/(removed); var _cgo3 _Ctype_guint = _Ctype_guint /*line :87:87*/(added); _cgoCheckPointer(_cgo0, nil); /*line :87:95*/_Cfunc_g_list_model_items_changed(_cgo0, _cgo1, _cgo2, _cgo3); }() } /* * GListStore */ // ListStore is a representation of GListStore type ListStore struct { ListModel } func (v *ListStore) native() * /*line :99:31*/_Ctype_GListStore /*line :99:43*/ { if v == nil || v.GObject == nil { return nil } return func() *_Ctype_struct__GListStore{ _cgo0 := /*line :103:24*/unsafe.Pointer(v.GObject); _cgoCheckPointer(_cgo0, nil); return /*line :103:50*/_Cfunc_toGListStore(_cgo0); }() } func (v *ListStore) Native() uintptr { return uintptr(unsafe.Pointer(v.native())) } func marshalListStore(p uintptr) (interface{}, error) { c := ( /*line :111:7*/_Cfunc_g_value_get_object /*line :111:26*/)((* /*line :111:30*/_Ctype_GValue /*line :111:38*/)(unsafe.Pointer(p))) return wrapListStore(wrapObject(unsafe.Pointer(c))), nil } func wrapListStore(obj *Object) *ListStore { return &ListStore{ListModel{obj}} } // ListStoreNew is a wrapper around g_list_store_new(). func ListStoreNew(itemType Type) *ListStore { c := ( /*line :121:7*/_Cfunc_g_list_store_new /*line :121:24*/)( /*line :121:26*/_Ctype_GType /*line :121:33*/(itemType)) if c == nil { return nil } return wrapListStore(wrapObject(unsafe.Pointer(c))) } // Insert is a wrapper around g_list_store_insert(). func (v *ListStore) Insert(position uint, item interface{}) { gItem := ToGObject(unsafe.Pointer(&item)) func() { _cgo0 := /*line :131:24*/v.native(); var _cgo1 _Ctype_guint = _Ctype_guint /*line :131:43*/(position); _cgo2 := _Ctype_gpointer /*line :131:65*/(gItem); _cgoCheckPointer(_cgo0, nil); _cgoCheckPointer(_cgo2, nil); /*line :131:73*/_Cfunc_g_list_store_insert(_cgo0, _cgo1, _cgo2); }() } // InsertSorted is a wrapper around g_list_store_insert_sorted(). func (v *ListStore) InsertSorted(item interface{}, compareFunc CompareDataFunc) { gItem := ToGObject(unsafe.Pointer(&item)) func() { _cgo0 := /*line :137:32*/v.native(); _cgo1 := _Ctype_gpointer /*line :137:54*/(gItem); _cgo2 := _Ctype_gpointer /*line :137:73*/(callback.Assign(compareFunc)); _cgoCheckPointer(_cgo0, nil); _cgoCheckPointer(_cgo1, nil); _cgoCheckPointer(_cgo2, nil); /*line :137:104*/_Cfunc__g_list_store_insert_sorted(_cgo0, _cgo1, _cgo2); }() } // Append is a wrapper around g_list_store_append(). func (v *ListStore) Append(item interface{}) { gItem := ToGObject(unsafe.Pointer(&item)) func() { _cgo0 := /*line :143:24*/v.native(); _cgo1 := _Ctype_gpointer /*line :143:46*/(gItem); _cgoCheckPointer(_cgo0, nil); _cgoCheckPointer(_cgo1, nil); /*line :143:54*/_Cfunc_g_list_store_append(_cgo0, _cgo1); }() } // Remove is a wrapper around g_list_store_remove(). func (v *ListStore) Remove(position uint) { func() { _cgo0 := /*line :148:24*/v.native(); var _cgo1 _Ctype_guint = _Ctype_guint /*line :148:43*/(position); _cgoCheckPointer(_cgo0, nil); /*line :148:54*/_Cfunc_g_list_store_remove(_cgo0, _cgo1); }() } // Splice is a wrapper around g_list_store_splice(). func (v *ListStore) Splice(position uint, removalLength uint, additions []interface{}) { additionsLength := len(additions) gAdditions := make([]* /*line :155:24*/_Ctype_GObject /*line :155:33*/, additionsLength) for i, add := range additions { gAdditions[i] = ToGObject(unsafe.Pointer(&add)) } gAdditions = append(gAdditions, nil) additionsPtr := /*line :161:18*/_Ctype_gpointer /*line :161:28*/(gAdditions[0]) func() { _cgo0 := /*line :163:24*/v.native(); var _cgo1 _Ctype_guint = _Ctype_guint /*line :163:43*/(position); var _cgo2 _Ctype_guint = _Ctype_guint /*line :163:62*/(removalLength); _cgoBase3 := /*line :163:79*/&additionsPtr; _cgo3 := _cgoBase3; var _cgo4 _Ctype_guint = _Ctype_guint /*line :163:101*/(additionsLength); _cgoCheckPointer(_cgo0, nil); _cgoCheckPointer(_cgoBase3, 0 == 0); /*line :163:119*/_Cfunc_g_list_store_splice(_cgo0, _cgo1, _cgo2, _cgo3, _cgo4); }() }