// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gtk import ( "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gio" "github.com/bnema/puregotk/v4/glib" ) var xShowUri func(uintptr, string, uint32) // This function launches the default application for showing // a given uri, or shows an error dialog if that fails. func ShowUri(ParentVar *Window, UriVar string, TimestampVar uint32) { xShowUri(ParentVar.GoPointer(), UriVar, TimestampVar) } var xShowUriFull func(uintptr, string, uint32, uintptr, uintptr, uintptr) // This function launches the default application for showing // a given uri. // // The @callback will be called when the launch is completed. // // This is the recommended call to be used as it passes information // necessary for sandbox helpers to parent their dialogs properly. func ShowUriFull(ParentVar *Window, UriVar string, TimestampVar uint32, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { var CallbackVarRef uintptr if CallbackVar != nil { CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { CallbackVarRef = cbRefPtr } else { fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { cbFn := *CallbackVar cbFn(arg0, arg1, arg2) } CallbackVarRef = purego.NewCallback(fcb) glib.SaveCallbackWithClosure(CallbackVarPtr, CallbackVarRef, CallbackVar) } } xShowUriFull(ParentVar.GoPointer(), UriVar, TimestampVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) } var xShowUriFullFinish func(uintptr, uintptr, **glib.Error) bool // Finishes the gtk_show_uri() call and returns the result // of the operation. func ShowUriFullFinish(ParentVar *Window, ResultVar gio.AsyncResult) (bool, error) { var cerr *glib.Error cret := xShowUriFullFinish(ParentVar.GoPointer(), ResultVar.GoPointer(), &cerr) if cerr == nil { return cret, nil } return cret, cerr } 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(&xShowUri, libs, "gtk_show_uri") core.PuregoSafeRegister(&xShowUriFull, libs, "gtk_show_uri_full") core.PuregoSafeRegister(&xShowUriFullFinish, libs, "gtk_show_uri_full_finish") }