// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gtk import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gdk" "github.com/bnema/puregotk/v4/gio" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) type MountOperationClass struct { _ structs.HostLayout ParentClass gio.MountOperationClass xGtkReserved1 uintptr xGtkReserved2 uintptr xGtkReserved3 uintptr xGtkReserved4 uintptr } func (x *MountOperationClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // OverrideGtkReserved1 sets the "_gtk_reserved1" callback function. func (x *MountOperationClass) OverrideGtkReserved1(cb func()) { if cb == nil { x.xGtkReserved1 = 0 } else { x.xGtkReserved1 = purego.NewCallback(func() { cb() }) } } // GetGtkReserved1 gets the "_gtk_reserved1" callback function. func (x *MountOperationClass) GetGtkReserved1() func() { if x.xGtkReserved1 == 0 { return nil } var rawCallback func() purego.RegisterFunc(&rawCallback, x.xGtkReserved1) return func() { rawCallback() } } // OverrideGtkReserved2 sets the "_gtk_reserved2" callback function. func (x *MountOperationClass) OverrideGtkReserved2(cb func()) { if cb == nil { x.xGtkReserved2 = 0 } else { x.xGtkReserved2 = purego.NewCallback(func() { cb() }) } } // GetGtkReserved2 gets the "_gtk_reserved2" callback function. func (x *MountOperationClass) GetGtkReserved2() func() { if x.xGtkReserved2 == 0 { return nil } var rawCallback func() purego.RegisterFunc(&rawCallback, x.xGtkReserved2) return func() { rawCallback() } } // OverrideGtkReserved3 sets the "_gtk_reserved3" callback function. func (x *MountOperationClass) OverrideGtkReserved3(cb func()) { if cb == nil { x.xGtkReserved3 = 0 } else { x.xGtkReserved3 = purego.NewCallback(func() { cb() }) } } // GetGtkReserved3 gets the "_gtk_reserved3" callback function. func (x *MountOperationClass) GetGtkReserved3() func() { if x.xGtkReserved3 == 0 { return nil } var rawCallback func() purego.RegisterFunc(&rawCallback, x.xGtkReserved3) return func() { rawCallback() } } // OverrideGtkReserved4 sets the "_gtk_reserved4" callback function. func (x *MountOperationClass) OverrideGtkReserved4(cb func()) { if cb == nil { x.xGtkReserved4 = 0 } else { x.xGtkReserved4 = purego.NewCallback(func() { cb() }) } } // GetGtkReserved4 gets the "_gtk_reserved4" callback function. func (x *MountOperationClass) GetGtkReserved4() func() { if x.xGtkReserved4 == 0 { return nil } var rawCallback func() purego.RegisterFunc(&rawCallback, x.xGtkReserved4) return func() { rawCallback() } } type MountOperationPrivate struct { _ structs.HostLayout } func (x *MountOperationPrivate) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Asks the user for passwords and other information required to // mount a volume. // // `GtkMountOperation` is needed when mounting volumes: // It is an implementation of `GMountOperation` that can be used with // GIO functions for mounting volumes such as // [method@Gio.File.mount_enclosing_volume], // [method@Gio.File.mount_mountable], // [method@Gio.Volume.mount], // [method@Gio.Mount.unmount_with_operation] and others. // // When necessary, `GtkMountOperation` shows dialogs to let the user // enter passwords, ask questions or show processes blocking unmount. type MountOperation struct { gio.MountOperation } var xMountOperationGLibType func() types.GType func MountOperationGLibType() types.GType { return xMountOperationGLibType() } func MountOperationNewFromInternalPtr(ptr uintptr) *MountOperation { cls := &MountOperation{} cls.Ptr = ptr return cls } var xNewMountOperation func(uintptr) uintptr // Creates a new `GtkMountOperation`. func NewMountOperation(ParentVar *Window) *MountOperation { var cls *MountOperation cret := xNewMountOperation(ParentVar.GoPointer()) if cret == 0 { return nil } cls = &MountOperation{} cls.Ptr = cret return cls } var xMountOperationGetDisplay func(uintptr) uintptr // Gets the display on which windows of the `GtkMountOperation` // will be shown. func (x *MountOperation) GetDisplay() *gdk.Display { var cls *gdk.Display cret := xMountOperationGetDisplay(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &gdk.Display{} cls.Ptr = cret return cls } var xMountOperationGetParent func(uintptr) uintptr // Gets the transient parent used by the `GtkMountOperation`. func (x *MountOperation) GetParent() *Window { var cls *Window cret := xMountOperationGetParent(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Window{} cls.Ptr = cret return cls } var xMountOperationIsShowing func(uintptr) bool // Returns whether the `GtkMountOperation` is currently displaying // a window. func (x *MountOperation) IsShowing() bool { cret := xMountOperationIsShowing(x.GoPointer()) return cret } var xMountOperationSetDisplay func(uintptr, uintptr) // Sets the display to show windows of the `GtkMountOperation` on. func (x *MountOperation) SetDisplay(DisplayVar *gdk.Display) { xMountOperationSetDisplay(x.GoPointer(), DisplayVar.GoPointer()) } var xMountOperationSetParent func(uintptr, uintptr) // Sets the transient parent for windows shown by the // `GtkMountOperation`. func (x *MountOperation) SetParent(ParentVar *Window) { xMountOperationSetParent(x.GoPointer(), ParentVar.GoPointer()) } func (c *MountOperation) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *MountOperation) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // GetPropertyIsShowing gets the "is-showing" property. // Whether a dialog is currently shown. func (x *MountOperation) GetPropertyIsShowing() bool { var v gobject.Value x.GetProperty("is-showing", &v) return v.GetBoolean() } 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(&xMountOperationGLibType, libs, "gtk_mount_operation_get_type") core.PuregoSafeRegister(&xNewMountOperation, libs, "gtk_mount_operation_new") core.PuregoSafeRegister(&xMountOperationGetDisplay, libs, "gtk_mount_operation_get_display") core.PuregoSafeRegister(&xMountOperationGetParent, libs, "gtk_mount_operation_get_parent") core.PuregoSafeRegister(&xMountOperationIsShowing, libs, "gtk_mount_operation_is_showing") core.PuregoSafeRegister(&xMountOperationSetDisplay, libs, "gtk_mount_operation_set_display") core.PuregoSafeRegister(&xMountOperationSetParent, libs, "gtk_mount_operation_set_parent") }