// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gtk import ( "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" ) // `GtkAppChooser` is an interface for widgets which allow the user to // choose an application. // // The main objects that implement this interface are // [class@Gtk.AppChooserWidget], // [class@Gtk.AppChooserDialog] and [class@Gtk.AppChooserButton]. // // Applications are represented by GIO `GAppInfo` objects here. // GIO has a concept of recommended and fallback applications for a // given content type. Recommended applications are those that claim // to handle the content type itself, while fallback also includes // applications that handle a more generic content type. GIO also // knows the default and last-used application for a given content // type. The `GtkAppChooserWidget` provides detailed control over // whether the shown list of applications should include default, // recommended or fallback applications. // // To obtain the application that has been selected in a `GtkAppChooser`, // use [method@Gtk.AppChooser.get_app_info]. type AppChooser interface { GoPointer() uintptr SetGoPointer(uintptr) GetAppInfo() *gio.AppInfoBase GetContentType() string Refresh() } var xAppChooserGLibType func() types.GType func AppChooserGLibType() types.GType { return xAppChooserGLibType() } type AppChooserBase struct { Ptr uintptr } func (x *AppChooserBase) GoPointer() uintptr { if x == nil { return 0 } return x.Ptr } func (x *AppChooserBase) SetGoPointer(ptr uintptr) { x.Ptr = ptr } // Returns the currently selected application. func (x *AppChooserBase) GetAppInfo() *gio.AppInfoBase { var cls *gio.AppInfoBase cret := XGtkAppChooserGetAppInfo(x.GoPointer()) if cret == 0 { return nil } cls = &gio.AppInfoBase{} cls.Ptr = cret return cls } // Returns the content type for which the `GtkAppChooser` // shows applications. func (x *AppChooserBase) GetContentType() string { cret := XGtkAppChooserGetContentType(x.GoPointer()) return cret } // Reloads the list of applications. func (x *AppChooserBase) Refresh() { XGtkAppChooserRefresh(x.GoPointer()) } // SetPropertyContentType sets the "content-type" property. // The content type of the `GtkAppChooser` object. // // See `GContentType` for more information about content types. func (x *AppChooserBase) SetPropertyContentType(value string) { obj := gobject.Object{} obj.Ptr = x.GoPointer() var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) obj.SetProperty("content-type", &v) } // GetPropertyContentType gets the "content-type" property. // The content type of the `GtkAppChooser` object. // // See `GContentType` for more information about content types. func (x *AppChooserBase) GetPropertyContentType() string { obj := gobject.Object{} obj.Ptr = x.GoPointer() var v gobject.Value obj.GetProperty("content-type", &v) return v.GetString() } var XGtkAppChooserGetAppInfo func(uintptr) uintptr var XGtkAppChooserGetContentType func(uintptr) string var XGtkAppChooserRefresh func(uintptr) 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(&xAppChooserGLibType, libs, "gtk_app_chooser_get_type") core.PuregoSafeRegister(&XGtkAppChooserGetAppInfo, libs, "gtk_app_chooser_get_app_info") core.PuregoSafeRegister(&XGtkAppChooserGetContentType, libs, "gtk_app_chooser_get_content_type") core.PuregoSafeRegister(&XGtkAppChooserRefresh, libs, "gtk_app_chooser_refresh") }