// 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/gasyncresult.go:1:1 package glib // #include // #include // #include // #include "glib.go.h" import _ "unsafe" import ( "errors" "unsafe" ) // IAsyncResult is an interface representation of AsyncResult, // used to avoid duplication when embedding the type in a wrapper of another GObject-based type. type IAsyncResult interface { GetUserData() uintptr GetSourceObject() *Object IsTagged(sourceTag uintptr) bool LegacyPropagateError() error } // AsyncReadyCallback is a representation of GAsyncReadyCallback type AsyncReadyCallback func(object *Object, res *AsyncResult) // AsyncResult is a representation of GIO's GAsyncResult. type AsyncResult struct { *Object } // native() returns a pointer to the underlying GAsyncResult. func (v *AsyncResult) native() * /*line :31:33*/_Ctype_GAsyncResult /*line :31:47*/ { if v == nil || v.GObject == nil { return nil } return func() *_Ctype_struct__GAsyncResult{ _cgo0 := /*line :35:26*/unsafe.Pointer(v.GObject); _cgoCheckPointer(_cgo0, nil); return /*line :35:52*/_Cfunc_toGAsyncResult(_cgo0); }() } func wrapAsyncResult(obj *Object) *AsyncResult { return &AsyncResult{obj} } // GetUserData is a wrapper around g_async_result_get_user_data() func (v *AsyncResult) GetUserData() uintptr { c := func() _Ctype_gpointer{ _cgo0 := /*line :44:38*/v.native(); _cgoCheckPointer(_cgo0, nil); return /*line :44:49*/_Cfunc_g_async_result_get_user_data(_cgo0); }() return uintptr(unsafe.Pointer(c)) } // GetSourceObject is a wrapper around g_async_result_get_source_object func (v *AsyncResult) GetSourceObject() *Object { obj := func() *_Ctype_struct__GObject{ _cgo0 := /*line :50:44*/v.native(); _cgoCheckPointer(_cgo0, nil); return /*line :50:55*/_Cfunc_g_async_result_get_source_object(_cgo0); }() if obj == nil { return nil } return wrapObject(unsafe.Pointer(obj)) } // IsTagged is a wrapper around g_async_result_is_tagged func (v *AsyncResult) IsTagged(sourceTag uintptr) bool { c := func() _Ctype_gboolean{ _cgo0 := /*line :59:34*/v.native(); _cgo1 := _Ctype_gpointer /*line :59:56*/(sourceTag); _cgoCheckPointer(_cgo0, nil); _cgoCheckPointer(_cgo1, nil); return /*line :59:68*/_Cfunc_g_async_result_is_tagged(_cgo0, _cgo1); }() return gobool(c) } // LegacyPropagateError is a wrapper around g_async_result_legacy_propagate_error func (v *AsyncResult) LegacyPropagateError() error { var err * /*line :65:11*/_Ctype_GError /*line :65:19*/ c := func() _Ctype_gboolean{ _cgo0 := /*line :66:47*/v.native(); _cgoBase1 := /*line :66:59*/&err; _cgo1 := _cgoBase1; _cgoCheckPointer(_cgo0, nil); _cgoCheckPointer(_cgoBase1, 0 == 0); return /*line :66:64*/_Cfunc_g_async_result_legacy_propagate_error(_cgo0, _cgo1); }() isSimpleAsyncResult := gobool(c) if isSimpleAsyncResult { defer func() func() { _cgo0 := /*line :69:24*/err; return func() { _cgoCheckPointer(_cgo0, nil); /*line :69:28*/_Cfunc_g_error_free(_cgo0); }}()() return errors.New(( /*line :70:21*/_Cfunc_GoString /*line :70:30*/)((* /*line :70:34*/_Ctype_char /*line :70:40*/)(err.message))) } return nil }