Gen: Re-run script
- commit
- 2379e376119336a120cf27828754384f3c2368e9
- author
- Jeroen Wijenbergh · · 2025-10-16 13:42 UTC
- parent
- 1ba02a9
- signature
- SSH Unverified
SHA256:8N5EoON8reSTMm461SyWlzRhib6IymBjUHb1p62kwywThe key is unknown
310 files · +34199 -437
M v4/adw/adw-about-dialog.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type AboutDialogClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass DialogClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *AboutDialogClass) GoPointer() uintptr { | |
M v4/adw/adw-about-window.go +1 -1
| @@ -18,7 +18,7 @@ import ( | |||
| 18 | 18 | type AboutWindowClass struct { | |
| 19 | 19 | _ structs.HostLayout | |
| 20 | 20 | ||
| 21 | - | ParentClass uintptr | |
| 21 | + | ParentClass WindowClass | |
| 22 | 22 | } | |
| 23 | 23 | ||
| 24 | 24 | func (x *AboutWindowClass) GoPointer() uintptr { | |
M v4/adw/adw-action-row.go +28 -1
| @@ -16,7 +16,9 @@ import ( | |||
| 16 | 16 | type ActionRowClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass PreferencesRowClass | |
| 20 | + | ||
| 21 | + | xActivate uintptr | |
| 20 | 22 | ||
| 21 | 23 | Padding [4]uintptr | |
| 22 | 24 | } | |
| @@ -25,6 +27,31 @@ func (x *ActionRowClass) GoPointer() uintptr { | |||
| 25 | 27 | return uintptr(unsafe.Pointer(x)) | |
| 26 | 28 | } | |
| 27 | 29 | ||
| 30 | + | // OverrideActivate sets the callback function. | |
| 31 | + | // Activates the row to trigger its main action. | |
| 32 | + | func (x *ActionRowClass) OverrideActivate(cb func(*ActionRow)) { | |
| 33 | + | if cb == nil { | |
| 34 | + | x.xActivate = 0 | |
| 35 | + | } else { | |
| 36 | + | x.xActivate = purego.NewCallback(func(SelfVarp uintptr) { | |
| 37 | + | cb(ActionRowNewFromInternalPtr(SelfVarp)) | |
| 38 | + | }) | |
| 39 | + | } | |
| 40 | + | } | |
| 41 | + | ||
| 42 | + | // GetActivate gets the callback function. | |
| 43 | + | // Activates the row to trigger its main action. | |
| 44 | + | func (x *ActionRowClass) GetActivate() func(*ActionRow) { | |
| 45 | + | if x.xActivate == 0 { | |
| 46 | + | return nil | |
| 47 | + | } | |
| 48 | + | var rawCallback func(SelfVarp uintptr) | |
| 49 | + | purego.RegisterFunc(&rawCallback, x.xActivate) | |
| 50 | + | return func(SelfVar *ActionRow) { | |
| 51 | + | rawCallback(SelfVar.GoPointer()) | |
| 52 | + | } | |
| 53 | + | } | |
| 54 | + | ||
| 28 | 55 | // A [class@Gtk.ListBoxRow] used to present actions. | |
| 29 | 56 | // | |
| 30 | 57 | // <picture> | |
M v4/adw/adw-alert-dialog.go +26 -1
| @@ -17,7 +17,9 @@ import ( | |||
| 17 | 17 | type AlertDialogClass struct { | |
| 18 | 18 | _ structs.HostLayout | |
| 19 | 19 | ||
| 20 | - | ParentClass uintptr | |
| 20 | + | ParentClass DialogClass | |
| 21 | + | ||
| 22 | + | xResponse uintptr | |
| 21 | 23 | ||
| 22 | 24 | Padding [4]uintptr | |
| 23 | 25 | } | |
| @@ -26,6 +28,29 @@ func (x *AlertDialogClass) GoPointer() uintptr { | |||
| 26 | 28 | return uintptr(unsafe.Pointer(x)) | |
| 27 | 29 | } | |
| 28 | 30 | ||
| 31 | + | // OverrideResponse sets the callback function. | |
| 32 | + | func (x *AlertDialogClass) OverrideResponse(cb func(*AlertDialog, string)) { | |
| 33 | + | if cb == nil { | |
| 34 | + | x.xResponse = 0 | |
| 35 | + | } else { | |
| 36 | + | x.xResponse = purego.NewCallback(func(SelfVarp uintptr, ResponseVarp string) { | |
| 37 | + | cb(AlertDialogNewFromInternalPtr(SelfVarp), ResponseVarp) | |
| 38 | + | }) | |
| 39 | + | } | |
| 40 | + | } | |
| 41 | + | ||
| 42 | + | // GetResponse gets the callback function. | |
| 43 | + | func (x *AlertDialogClass) GetResponse() func(*AlertDialog, string) { | |
| 44 | + | if x.xResponse == 0 { | |
| 45 | + | return nil | |
| 46 | + | } | |
| 47 | + | var rawCallback func(SelfVarp uintptr, ResponseVarp string) | |
| 48 | + | purego.RegisterFunc(&rawCallback, x.xResponse) | |
| 49 | + | return func(SelfVar *AlertDialog, ResponseVar string) { | |
| 50 | + | rawCallback(SelfVar.GoPointer(), ResponseVar) | |
| 51 | + | } | |
| 52 | + | } | |
| 53 | + | ||
| 29 | 54 | // Describes the possible styles of [class@AlertDialog] response buttons. | |
| 30 | 55 | // | |
| 31 | 56 | // See [method@AlertDialog.set_response_appearance]. | |
M v4/adw/adw-application-window.go +1 -1
| @@ -19,7 +19,7 @@ import ( | |||
| 19 | 19 | type ApplicationWindowClass struct { | |
| 20 | 20 | _ structs.HostLayout | |
| 21 | 21 | ||
| 22 | - | ParentClass uintptr | |
| 22 | + | ParentClass gtk.ApplicationWindowClass | |
| 23 | 23 | ||
| 24 | 24 | Padding [4]uintptr | |
| 25 | 25 | } | |
M v4/adw/adw-application.go +1 -1
| @@ -17,7 +17,7 @@ import ( | |||
| 17 | 17 | type ApplicationClass struct { | |
| 18 | 18 | _ structs.HostLayout | |
| 19 | 19 | ||
| 20 | - | ParentClass uintptr | |
| 20 | + | ParentClass gtk.ApplicationClass | |
| 21 | 21 | ||
| 22 | 22 | Padding [4]uintptr | |
| 23 | 23 | } | |
M v4/adw/adw-avatar.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type AvatarClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gtk.WidgetClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *AvatarClass) GoPointer() uintptr { | |
M v4/adw/adw-banner.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type BannerClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gtk.WidgetClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *BannerClass) GoPointer() uintptr { | |
M v4/adw/adw-bin.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type BinClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *BinClass) GoPointer() uintptr { | |
M v4/adw/adw-bottom-sheet.go +1 -1
| @@ -17,7 +17,7 @@ import ( | |||
| 17 | 17 | type BottomSheetClass struct { | |
| 18 | 18 | _ structs.HostLayout | |
| 19 | 19 | ||
| 20 | - | ParentClass uintptr | |
| 20 | + | ParentClass gtk.WidgetClass | |
| 21 | 21 | } | |
| 22 | 22 | ||
| 23 | 23 | func (x *BottomSheetClass) GoPointer() uintptr { | |
M v4/adw/adw-breakpoint-bin.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type BreakpointBinClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | ||
| 20 | 20 | Padding [4]uintptr | |
| 21 | 21 | } | |
M v4/adw/adw-breakpoint.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type BreakpointClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *BreakpointClass) GoPointer() uintptr { | |
M v4/adw/adw-button-content.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type ButtonContentClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *ButtonContentClass) GoPointer() uintptr { | |
M v4/adw/adw-button-row.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type ButtonRowClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass PreferencesRowClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *ButtonRowClass) GoPointer() uintptr { | |
M v4/adw/adw-carousel-indicator-dots.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type CarouselIndicatorDotsClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *CarouselIndicatorDotsClass) GoPointer() uintptr { | |
M v4/adw/adw-carousel-indicator-lines.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type CarouselIndicatorLinesClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *CarouselIndicatorLinesClass) GoPointer() uintptr { | |
M v4/adw/adw-carousel.go +1 -1
| @@ -17,7 +17,7 @@ import ( | |||
| 17 | 17 | type CarouselClass struct { | |
| 18 | 18 | _ structs.HostLayout | |
| 19 | 19 | ||
| 20 | - | ParentClass uintptr | |
| 20 | + | ParentClass gtk.WidgetClass | |
| 21 | 21 | } | |
| 22 | 22 | ||
| 23 | 23 | func (x *CarouselClass) GoPointer() uintptr { | |
M v4/adw/adw-clamp-layout.go +1 -1
| @@ -14,7 +14,7 @@ import ( | |||
| 14 | 14 | type ClampLayoutClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass gtk.LayoutManagerClass | |
| 18 | 18 | } | |
| 19 | 19 | ||
| 20 | 20 | func (x *ClampLayoutClass) GoPointer() uintptr { | |
M v4/adw/adw-clamp-scrollable.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type ClampScrollableClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *ClampScrollableClass) GoPointer() uintptr { | |
M v4/adw/adw-clamp.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type ClampClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *ClampClass) GoPointer() uintptr { | |
M v4/adw/adw-combo-row.go +1 -1
| @@ -17,7 +17,7 @@ import ( | |||
| 17 | 17 | type ComboRowClass struct { | |
| 18 | 18 | _ structs.HostLayout | |
| 19 | 19 | ||
| 20 | - | ParentClass uintptr | |
| 20 | + | ParentClass ActionRowClass | |
| 21 | 21 | ||
| 22 | 22 | Padding [4]uintptr | |
| 23 | 23 | } | |
M v4/adw/adw-dialog.go +51 -1
| @@ -16,7 +16,11 @@ import ( | |||
| 16 | 16 | type DialogClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gtk.WidgetClass | |
| 20 | + | ||
| 21 | + | xCloseAttempt uintptr | |
| 22 | + | ||
| 23 | + | xClosed uintptr | |
| 20 | 24 | ||
| 21 | 25 | Padding [4]uintptr | |
| 22 | 26 | } | |
| @@ -25,6 +29,52 @@ func (x *DialogClass) GoPointer() uintptr { | |||
| 25 | 29 | return uintptr(unsafe.Pointer(x)) | |
| 26 | 30 | } | |
| 27 | 31 | ||
| 32 | + | // OverrideCloseAttempt sets the callback function. | |
| 33 | + | func (x *DialogClass) OverrideCloseAttempt(cb func(*Dialog)) { | |
| 34 | + | if cb == nil { | |
| 35 | + | x.xCloseAttempt = 0 | |
| 36 | + | } else { | |
| 37 | + | x.xCloseAttempt = purego.NewCallback(func(DialogVarp uintptr) { | |
| 38 | + | cb(DialogNewFromInternalPtr(DialogVarp)) | |
| 39 | + | }) | |
| 40 | + | } | |
| 41 | + | } | |
| 42 | + | ||
| 43 | + | // GetCloseAttempt gets the callback function. | |
| 44 | + | func (x *DialogClass) GetCloseAttempt() func(*Dialog) { | |
| 45 | + | if x.xCloseAttempt == 0 { | |
| 46 | + | return nil | |
| 47 | + | } | |
| 48 | + | var rawCallback func(DialogVarp uintptr) | |
| 49 | + | purego.RegisterFunc(&rawCallback, x.xCloseAttempt) | |
| 50 | + | return func(DialogVar *Dialog) { | |
| 51 | + | rawCallback(DialogVar.GoPointer()) | |
| 52 | + | } | |
| 53 | + | } | |
| 54 | + | ||
| 55 | + | // OverrideClosed sets the callback function. | |
| 56 | + | func (x *DialogClass) OverrideClosed(cb func(*Dialog)) { | |
| 57 | + | if cb == nil { | |
| 58 | + | x.xClosed = 0 | |
| 59 | + | } else { | |
| 60 | + | x.xClosed = purego.NewCallback(func(DialogVarp uintptr) { | |
| 61 | + | cb(DialogNewFromInternalPtr(DialogVarp)) | |
| 62 | + | }) | |
| 63 | + | } | |
| 64 | + | } | |
| 65 | + | ||
| 66 | + | // GetClosed gets the callback function. | |
| 67 | + | func (x *DialogClass) GetClosed() func(*Dialog) { | |
| 68 | + | if x.xClosed == 0 { | |
| 69 | + | return nil | |
| 70 | + | } | |
| 71 | + | var rawCallback func(DialogVarp uintptr) | |
| 72 | + | purego.RegisterFunc(&rawCallback, x.xClosed) | |
| 73 | + | return func(DialogVar *Dialog) { | |
| 74 | + | rawCallback(DialogVar.GoPointer()) | |
| 75 | + | } | |
| 76 | + | } | |
| 77 | + | ||
| 28 | 78 | // Describes the available presentation modes for [class@Dialog]. | |
| 29 | 79 | // | |
| 30 | 80 | // New values may be added to this enumeration over time. | |
M v4/adw/adw-entry-row.go +1 -1
| @@ -17,7 +17,7 @@ import ( | |||
| 17 | 17 | type EntryRowClass struct { | |
| 18 | 18 | _ structs.HostLayout | |
| 19 | 19 | ||
| 20 | - | ParentClass uintptr | |
| 20 | + | ParentClass PreferencesRowClass | |
| 21 | 21 | } | |
| 22 | 22 | ||
| 23 | 23 | func (x *EntryRowClass) GoPointer() uintptr { | |
M v4/adw/adw-enum-list-model.go +2 -2
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type EnumListItemClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *EnumListItemClass) GoPointer() uintptr { | |
| @@ -25,7 +25,7 @@ func (x *EnumListItemClass) GoPointer() uintptr { | |||
| 25 | 25 | type EnumListModelClass struct { | |
| 26 | 26 | _ structs.HostLayout | |
| 27 | 27 | ||
| 28 | - | ParentClass uintptr | |
| 28 | + | ParentClass gobject.ObjectClass | |
| 29 | 29 | } | |
| 30 | 30 | ||
| 31 | 31 | func (x *EnumListModelClass) GoPointer() uintptr { | |
M v4/adw/adw-expander-row.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type ExpanderRowClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass PreferencesRowClass | |
| 20 | 20 | ||
| 21 | 21 | Padding [4]uintptr | |
| 22 | 22 | } | |
M v4/adw/adw-flap.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type FlapClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gtk.WidgetClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *FlapClass) GoPointer() uintptr { | |
M v4/adw/adw-header-bar.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type HeaderBarClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *HeaderBarClass) GoPointer() uintptr { | |
M v4/adw/adw-layout-slot.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type LayoutSlotClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *LayoutSlotClass) GoPointer() uintptr { | |
M v4/adw/adw-layout.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type LayoutClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *LayoutClass) GoPointer() uintptr { | |
M v4/adw/adw-leaflet.go +2 -2
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type LeafletClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gtk.WidgetClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *LeafletClass) GoPointer() uintptr { | |
| @@ -26,7 +26,7 @@ func (x *LeafletClass) GoPointer() uintptr { | |||
| 26 | 26 | type LeafletPageClass struct { | |
| 27 | 27 | _ structs.HostLayout | |
| 28 | 28 | ||
| 29 | - | ParentClass uintptr | |
| 29 | + | ParentClass gobject.ObjectClass | |
| 30 | 30 | } | |
| 31 | 31 | ||
| 32 | 32 | func (x *LeafletPageClass) GoPointer() uintptr { | |
M v4/adw/adw-message-dialog.go +26 -1
| @@ -19,7 +19,9 @@ import ( | |||
| 19 | 19 | type MessageDialogClass struct { | |
| 20 | 20 | _ structs.HostLayout | |
| 21 | 21 | ||
| 22 | - | ParentClass uintptr | |
| 22 | + | ParentClass gtk.WindowClass | |
| 23 | + | ||
| 24 | + | xResponse uintptr | |
| 23 | 25 | ||
| 24 | 26 | Padding [4]uintptr | |
| 25 | 27 | } | |
| @@ -28,6 +30,29 @@ func (x *MessageDialogClass) GoPointer() uintptr { | |||
| 28 | 30 | return uintptr(unsafe.Pointer(x)) | |
| 29 | 31 | } | |
| 30 | 32 | ||
| 33 | + | // OverrideResponse sets the callback function. | |
| 34 | + | func (x *MessageDialogClass) OverrideResponse(cb func(*MessageDialog, string)) { | |
| 35 | + | if cb == nil { | |
| 36 | + | x.xResponse = 0 | |
| 37 | + | } else { | |
| 38 | + | x.xResponse = purego.NewCallback(func(SelfVarp uintptr, ResponseVarp string) { | |
| 39 | + | cb(MessageDialogNewFromInternalPtr(SelfVarp), ResponseVarp) | |
| 40 | + | }) | |
| 41 | + | } | |
| 42 | + | } | |
| 43 | + | ||
| 44 | + | // GetResponse gets the callback function. | |
| 45 | + | func (x *MessageDialogClass) GetResponse() func(*MessageDialog, string) { | |
| 46 | + | if x.xResponse == 0 { | |
| 47 | + | return nil | |
| 48 | + | } | |
| 49 | + | var rawCallback func(SelfVarp uintptr, ResponseVarp string) | |
| 50 | + | purego.RegisterFunc(&rawCallback, x.xResponse) | |
| 51 | + | return func(SelfVar *MessageDialog, ResponseVar string) { | |
| 52 | + | rawCallback(SelfVar.GoPointer(), ResponseVar) | |
| 53 | + | } | |
| 54 | + | } | |
| 55 | + | ||
| 31 | 56 | // A dialog presenting a message or a question. | |
| 32 | 57 | // | |
| 33 | 58 | // <picture> | |
M v4/adw/adw-multi-layout-view.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type MultiLayoutViewClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *MultiLayoutViewClass) GoPointer() uintptr { | |
M v4/adw/adw-navigation-split-view.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type NavigationSplitViewClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *NavigationSplitViewClass) GoPointer() uintptr { | |
M v4/adw/adw-navigation-view.go +102 -2
| @@ -18,7 +18,15 @@ import ( | |||
| 18 | 18 | type NavigationPageClass struct { | |
| 19 | 19 | _ structs.HostLayout | |
| 20 | 20 | ||
| 21 | - | ParentClass uintptr | |
| 21 | + | ParentClass gtk.WidgetClass | |
| 22 | + | ||
| 23 | + | xShowing uintptr | |
| 24 | + | ||
| 25 | + | xShown uintptr | |
| 26 | + | ||
| 27 | + | xHiding uintptr | |
| 28 | + | ||
| 29 | + | xHidden uintptr | |
| 22 | 30 | ||
| 23 | 31 | Padding [8]uintptr | |
| 24 | 32 | } | |
| @@ -27,10 +35,102 @@ func (x *NavigationPageClass) GoPointer() uintptr { | |||
| 27 | 35 | return uintptr(unsafe.Pointer(x)) | |
| 28 | 36 | } | |
| 29 | 37 | ||
| 38 | + | // OverrideShowing sets the callback function. | |
| 39 | + | func (x *NavigationPageClass) OverrideShowing(cb func(*NavigationPage)) { | |
| 40 | + | if cb == nil { | |
| 41 | + | x.xShowing = 0 | |
| 42 | + | } else { | |
| 43 | + | x.xShowing = purego.NewCallback(func(SelfVarp uintptr) { | |
| 44 | + | cb(NavigationPageNewFromInternalPtr(SelfVarp)) | |
| 45 | + | }) | |
| 46 | + | } | |
| 47 | + | } | |
| 48 | + | ||
| 49 | + | // GetShowing gets the callback function. | |
| 50 | + | func (x *NavigationPageClass) GetShowing() func(*NavigationPage) { | |
| 51 | + | if x.xShowing == 0 { | |
| 52 | + | return nil | |
| 53 | + | } | |
| 54 | + | var rawCallback func(SelfVarp uintptr) | |
| 55 | + | purego.RegisterFunc(&rawCallback, x.xShowing) | |
| 56 | + | return func(SelfVar *NavigationPage) { | |
| 57 | + | rawCallback(SelfVar.GoPointer()) | |
| 58 | + | } | |
| 59 | + | } | |
| 60 | + | ||
| 61 | + | // OverrideShown sets the callback function. | |
| 62 | + | func (x *NavigationPageClass) OverrideShown(cb func(*NavigationPage)) { | |
| 63 | + | if cb == nil { | |
| 64 | + | x.xShown = 0 | |
| 65 | + | } else { | |
| 66 | + | x.xShown = purego.NewCallback(func(SelfVarp uintptr) { | |
| 67 | + | cb(NavigationPageNewFromInternalPtr(SelfVarp)) | |
| 68 | + | }) | |
| 69 | + | } | |
| 70 | + | } | |
| 71 | + | ||
| 72 | + | // GetShown gets the callback function. | |
| 73 | + | func (x *NavigationPageClass) GetShown() func(*NavigationPage) { | |
| 74 | + | if x.xShown == 0 { | |
| 75 | + | return nil | |
| 76 | + | } | |
| 77 | + | var rawCallback func(SelfVarp uintptr) | |
| 78 | + | purego.RegisterFunc(&rawCallback, x.xShown) | |
| 79 | + | return func(SelfVar *NavigationPage) { | |
| 80 | + | rawCallback(SelfVar.GoPointer()) | |
| 81 | + | } | |
| 82 | + | } | |
| 83 | + | ||
| 84 | + | // OverrideHiding sets the callback function. | |
| 85 | + | func (x *NavigationPageClass) OverrideHiding(cb func(*NavigationPage)) { | |
| 86 | + | if cb == nil { | |
| 87 | + | x.xHiding = 0 | |
| 88 | + | } else { | |
| 89 | + | x.xHiding = purego.NewCallback(func(SelfVarp uintptr) { | |
| 90 | + | cb(NavigationPageNewFromInternalPtr(SelfVarp)) | |
| 91 | + | }) | |
| 92 | + | } | |
| 93 | + | } | |
| 94 | + | ||
| 95 | + | // GetHiding gets the callback function. | |
| 96 | + | func (x *NavigationPageClass) GetHiding() func(*NavigationPage) { | |
| 97 | + | if x.xHiding == 0 { | |
| 98 | + | return nil | |
| 99 | + | } | |
| 100 | + | var rawCallback func(SelfVarp uintptr) | |
| 101 | + | purego.RegisterFunc(&rawCallback, x.xHiding) | |
| 102 | + | return func(SelfVar *NavigationPage) { | |
| 103 | + | rawCallback(SelfVar.GoPointer()) | |
| 104 | + | } | |
| 105 | + | } | |
| 106 | + | ||
| 107 | + | // OverrideHidden sets the callback function. | |
| 108 | + | func (x *NavigationPageClass) OverrideHidden(cb func(*NavigationPage)) { | |
| 109 | + | if cb == nil { | |
| 110 | + | x.xHidden = 0 | |
| 111 | + | } else { | |
| 112 | + | x.xHidden = purego.NewCallback(func(SelfVarp uintptr) { | |
| 113 | + | cb(NavigationPageNewFromInternalPtr(SelfVarp)) | |
| 114 | + | }) | |
| 115 | + | } | |
| 116 | + | } | |
| 117 | + | ||
| 118 | + | // GetHidden gets the callback function. | |
| 119 | + | func (x *NavigationPageClass) GetHidden() func(*NavigationPage) { | |
| 120 | + | if x.xHidden == 0 { | |
| 121 | + | return nil | |
| 122 | + | } | |
| 123 | + | var rawCallback func(SelfVarp uintptr) | |
| 124 | + | purego.RegisterFunc(&rawCallback, x.xHidden) | |
| 125 | + | return func(SelfVar *NavigationPage) { | |
| 126 | + | rawCallback(SelfVar.GoPointer()) | |
| 127 | + | } | |
| 128 | + | } | |
| 129 | + | ||
| 30 | 130 | type NavigationViewClass struct { | |
| 31 | 131 | _ structs.HostLayout | |
| 32 | 132 | ||
| 33 | - | ParentClass uintptr | |
| 133 | + | ParentClass gtk.WidgetClass | |
| 34 | 134 | } | |
| 35 | 135 | ||
| 36 | 136 | func (x *NavigationViewClass) GoPointer() uintptr { | |
M v4/adw/adw-overlay-split-view.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type OverlaySplitViewClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gtk.WidgetClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *OverlaySplitViewClass) GoPointer() uintptr { | |
M v4/adw/adw-password-entry-row.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type PasswordEntryRowClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass EntryRowClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *PasswordEntryRowClass) GoPointer() uintptr { | |
M v4/adw/adw-preferences-dialog.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type PreferencesDialogClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass DialogClass | |
| 19 | 19 | ||
| 20 | 20 | Padding [4]uintptr | |
| 21 | 21 | } | |
M v4/adw/adw-preferences-group.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type PreferencesGroupClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | ||
| 20 | 20 | Padding [4]uintptr | |
| 21 | 21 | } | |
M v4/adw/adw-preferences-page.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type PreferencesPageClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | ||
| 20 | 20 | Padding [4]uintptr | |
| 21 | 21 | } | |
M v4/adw/adw-preferences-row.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type PreferencesRowClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gtk.ListBoxRowClass | |
| 20 | 20 | ||
| 21 | 21 | Padding [4]uintptr | |
| 22 | 22 | } | |
M v4/adw/adw-preferences-window.go +1 -1
| @@ -17,7 +17,7 @@ import ( | |||
| 17 | 17 | type PreferencesWindowClass struct { | |
| 18 | 18 | _ structs.HostLayout | |
| 19 | 19 | ||
| 20 | - | ParentClass uintptr | |
| 20 | + | ParentClass WindowClass | |
| 21 | 21 | ||
| 22 | 22 | Padding [4]uintptr | |
| 23 | 23 | } | |
M v4/adw/adw-spin-row.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type SpinRowClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass ActionRowClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *SpinRowClass) GoPointer() uintptr { | |
M v4/adw/adw-spinner-paintable.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type SpinnerPaintableClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *SpinnerPaintableClass) GoPointer() uintptr { | |
M v4/adw/adw-spinner.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type SpinnerClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *SpinnerClass) GoPointer() uintptr { | |
M v4/adw/adw-split-button.go +1 -1
| @@ -17,7 +17,7 @@ import ( | |||
| 17 | 17 | type SplitButtonClass struct { | |
| 18 | 18 | _ structs.HostLayout | |
| 19 | 19 | ||
| 20 | - | ParentClass uintptr | |
| 20 | + | ParentClass gtk.WidgetClass | |
| 21 | 21 | } | |
| 22 | 22 | ||
| 23 | 23 | func (x *SplitButtonClass) GoPointer() uintptr { | |
M v4/adw/adw-squeezer.go +2 -2
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type SqueezerClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *SqueezerClass) GoPointer() uintptr { | |
| @@ -25,7 +25,7 @@ func (x *SqueezerClass) GoPointer() uintptr { | |||
| 25 | 25 | type SqueezerPageClass struct { | |
| 26 | 26 | _ structs.HostLayout | |
| 27 | 27 | ||
| 28 | - | ParentClass uintptr | |
| 28 | + | ParentClass gobject.ObjectClass | |
| 29 | 29 | } | |
| 30 | 30 | ||
| 31 | 31 | func (x *SqueezerPageClass) GoPointer() uintptr { | |
M v4/adw/adw-status-page.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type StatusPageClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gtk.WidgetClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *StatusPageClass) GoPointer() uintptr { | |
M v4/adw/adw-style-manager.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type StyleManagerClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *StyleManagerClass) GoPointer() uintptr { | |
M v4/adw/adw-swipe-tracker.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type SwipeTrackerClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *SwipeTrackerClass) GoPointer() uintptr { | |
M v4/adw/adw-swipeable.go +135 -0
| @@ -17,6 +17,16 @@ type SwipeableInterface struct { | |||
| 17 | 17 | ||
| 18 | 18 | Parent uintptr | |
| 19 | 19 | ||
| 20 | + | xGetDistance uintptr | |
| 21 | + | ||
| 22 | + | xGetSnapPoints uintptr | |
| 23 | + | ||
| 24 | + | xGetProgress uintptr | |
| 25 | + | ||
| 26 | + | xGetCancelProgress uintptr | |
| 27 | + | ||
| 28 | + | xGetSwipeArea uintptr | |
| 29 | + | ||
| 20 | 30 | Padding [4]uintptr | |
| 21 | 31 | } | |
| 22 | 32 | ||
| @@ -24,6 +34,131 @@ func (x *SwipeableInterface) GoPointer() uintptr { | |||
| 24 | 34 | return uintptr(unsafe.Pointer(x)) | |
| 25 | 35 | } | |
| 26 | 36 | ||
| 37 | + | // OverrideGetDistance sets the callback function. | |
| 38 | + | // Gets the swipe distance. | |
| 39 | + | func (x *SwipeableInterface) OverrideGetDistance(cb func(Swipeable) float64) { | |
| 40 | + | if cb == nil { | |
| 41 | + | x.xGetDistance = 0 | |
| 42 | + | } else { | |
| 43 | + | x.xGetDistance = purego.NewCallback(func(SelfVarp uintptr) float64 { | |
| 44 | + | return cb(&SwipeableBase{Ptr: SelfVarp}) | |
| 45 | + | }) | |
| 46 | + | } | |
| 47 | + | } | |
| 48 | + | ||
| 49 | + | // GetGetDistance gets the callback function. | |
| 50 | + | // Gets the swipe distance. | |
| 51 | + | func (x *SwipeableInterface) GetGetDistance() func(Swipeable) float64 { | |
| 52 | + | if x.xGetDistance == 0 { | |
| 53 | + | return nil | |
| 54 | + | } | |
| 55 | + | var rawCallback func(SelfVarp uintptr) float64 | |
| 56 | + | purego.RegisterFunc(&rawCallback, x.xGetDistance) | |
| 57 | + | return func(SelfVar Swipeable) float64 { | |
| 58 | + | return rawCallback(SelfVar.GoPointer()) | |
| 59 | + | } | |
| 60 | + | } | |
| 61 | + | ||
| 62 | + | // OverrideGetSnapPoints sets the callback function. | |
| 63 | + | // Gets the snap points. | |
| 64 | + | func (x *SwipeableInterface) OverrideGetSnapPoints(cb func(Swipeable, int) uintptr) { | |
| 65 | + | if cb == nil { | |
| 66 | + | x.xGetSnapPoints = 0 | |
| 67 | + | } else { | |
| 68 | + | x.xGetSnapPoints = purego.NewCallback(func(SelfVarp uintptr, NSnapPointsVarp int) uintptr { | |
| 69 | + | return cb(&SwipeableBase{Ptr: SelfVarp}, NSnapPointsVarp) | |
| 70 | + | }) | |
| 71 | + | } | |
| 72 | + | } | |
| 73 | + | ||
| 74 | + | // GetGetSnapPoints gets the callback function. | |
| 75 | + | // Gets the snap points. | |
| 76 | + | func (x *SwipeableInterface) GetGetSnapPoints() func(Swipeable, int) uintptr { | |
| 77 | + | if x.xGetSnapPoints == 0 { | |
| 78 | + | return nil | |
| 79 | + | } | |
| 80 | + | var rawCallback func(SelfVarp uintptr, NSnapPointsVarp int) uintptr | |
| 81 | + | purego.RegisterFunc(&rawCallback, x.xGetSnapPoints) | |
| 82 | + | return func(SelfVar Swipeable, NSnapPointsVar int) uintptr { | |
| 83 | + | return rawCallback(SelfVar.GoPointer(), NSnapPointsVar) | |
| 84 | + | } | |
| 85 | + | } | |
| 86 | + | ||
| 87 | + | // OverrideGetProgress sets the callback function. | |
| 88 | + | // Gets the current progress. | |
| 89 | + | func (x *SwipeableInterface) OverrideGetProgress(cb func(Swipeable) float64) { | |
| 90 | + | if cb == nil { | |
| 91 | + | x.xGetProgress = 0 | |
| 92 | + | } else { | |
| 93 | + | x.xGetProgress = purego.NewCallback(func(SelfVarp uintptr) float64 { | |
| 94 | + | return cb(&SwipeableBase{Ptr: SelfVarp}) | |
| 95 | + | }) | |
| 96 | + | } | |
| 97 | + | } | |
| 98 | + | ||
| 99 | + | // GetGetProgress gets the callback function. | |
| 100 | + | // Gets the current progress. | |
| 101 | + | func (x *SwipeableInterface) GetGetProgress() func(Swipeable) float64 { | |
| 102 | + | if x.xGetProgress == 0 { | |
| 103 | + | return nil | |
| 104 | + | } | |
| 105 | + | var rawCallback func(SelfVarp uintptr) float64 | |
| 106 | + | purego.RegisterFunc(&rawCallback, x.xGetProgress) | |
| 107 | + | return func(SelfVar Swipeable) float64 { | |
| 108 | + | return rawCallback(SelfVar.GoPointer()) | |
| 109 | + | } | |
| 110 | + | } | |
| 111 | + | ||
| 112 | + | // OverrideGetCancelProgress sets the callback function. | |
| 113 | + | // Gets the cancel progress. | |
| 114 | + | func (x *SwipeableInterface) OverrideGetCancelProgress(cb func(Swipeable) float64) { | |
| 115 | + | if cb == nil { | |
| 116 | + | x.xGetCancelProgress = 0 | |
| 117 | + | } else { | |
| 118 | + | x.xGetCancelProgress = purego.NewCallback(func(SelfVarp uintptr) float64 { | |
| 119 | + | return cb(&SwipeableBase{Ptr: SelfVarp}) | |
| 120 | + | }) | |
| 121 | + | } | |
| 122 | + | } | |
| 123 | + | ||
| 124 | + | // GetGetCancelProgress gets the callback function. | |
| 125 | + | // Gets the cancel progress. | |
| 126 | + | func (x *SwipeableInterface) GetGetCancelProgress() func(Swipeable) float64 { | |
| 127 | + | if x.xGetCancelProgress == 0 { | |
| 128 | + | return nil | |
| 129 | + | } | |
| 130 | + | var rawCallback func(SelfVarp uintptr) float64 | |
| 131 | + | purego.RegisterFunc(&rawCallback, x.xGetCancelProgress) | |
| 132 | + | return func(SelfVar Swipeable) float64 { | |
| 133 | + | return rawCallback(SelfVar.GoPointer()) | |
| 134 | + | } | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | // OverrideGetSwipeArea sets the callback function. | |
| 138 | + | // Gets the swipeable rectangle. | |
| 139 | + | func (x *SwipeableInterface) OverrideGetSwipeArea(cb func(Swipeable, NavigationDirection, bool, *gdk.Rectangle)) { | |
| 140 | + | if cb == nil { | |
| 141 | + | x.xGetSwipeArea = 0 | |
| 142 | + | } else { | |
| 143 | + | x.xGetSwipeArea = purego.NewCallback(func(SelfVarp uintptr, NavigationDirectionVarp NavigationDirection, IsDragVarp bool, RectVarp *gdk.Rectangle) { | |
| 144 | + | cb(&SwipeableBase{Ptr: SelfVarp}, NavigationDirectionVarp, IsDragVarp, RectVarp) | |
| 145 | + | }) | |
| 146 | + | } | |
| 147 | + | } | |
| 148 | + | ||
| 149 | + | // GetGetSwipeArea gets the callback function. | |
| 150 | + | // Gets the swipeable rectangle. | |
| 151 | + | func (x *SwipeableInterface) GetGetSwipeArea() func(Swipeable, NavigationDirection, bool, *gdk.Rectangle) { | |
| 152 | + | if x.xGetSwipeArea == 0 { | |
| 153 | + | return nil | |
| 154 | + | } | |
| 155 | + | var rawCallback func(SelfVarp uintptr, NavigationDirectionVarp NavigationDirection, IsDragVarp bool, RectVarp *gdk.Rectangle) | |
| 156 | + | purego.RegisterFunc(&rawCallback, x.xGetSwipeArea) | |
| 157 | + | return func(SelfVar Swipeable, NavigationDirectionVar NavigationDirection, IsDragVar bool, RectVar *gdk.Rectangle) { | |
| 158 | + | rawCallback(SelfVar.GoPointer(), NavigationDirectionVar, IsDragVar, RectVar) | |
| 159 | + | } | |
| 160 | + | } | |
| 161 | + | ||
| 27 | 162 | // An interface for swipeable widgets. | |
| 28 | 163 | // | |
| 29 | 164 | // The `AdwSwipeable` interface is implemented by all swipeable widgets. | |
M v4/adw/adw-switch-row.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type SwitchRowClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass ActionRowClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *SwitchRowClass) GoPointer() uintptr { | |
M v4/adw/adw-tab-bar.go +1 -1
| @@ -17,7 +17,7 @@ import ( | |||
| 17 | 17 | type TabBarClass struct { | |
| 18 | 18 | _ structs.HostLayout | |
| 19 | 19 | ||
| 20 | - | ParentClass uintptr | |
| 20 | + | ParentClass gtk.WidgetClass | |
| 21 | 21 | } | |
| 22 | 22 | ||
| 23 | 23 | func (x *TabBarClass) GoPointer() uintptr { | |
M v4/adw/adw-tab-button.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type TabButtonClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gtk.WidgetClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *TabButtonClass) GoPointer() uintptr { | |
M v4/adw/adw-tab-overview.go +1 -1
| @@ -18,7 +18,7 @@ import ( | |||
| 18 | 18 | type TabOverviewClass struct { | |
| 19 | 19 | _ structs.HostLayout | |
| 20 | 20 | ||
| 21 | - | ParentClass uintptr | |
| 21 | + | ParentClass gtk.WidgetClass | |
| 22 | 22 | } | |
| 23 | 23 | ||
| 24 | 24 | func (x *TabOverviewClass) GoPointer() uintptr { | |
M v4/adw/adw-tab-view.go +2 -2
| @@ -17,7 +17,7 @@ import ( | |||
| 17 | 17 | type TabPageClass struct { | |
| 18 | 18 | _ structs.HostLayout | |
| 19 | 19 | ||
| 20 | - | ParentClass uintptr | |
| 20 | + | ParentClass gobject.ObjectClass | |
| 21 | 21 | } | |
| 22 | 22 | ||
| 23 | 23 | func (x *TabPageClass) GoPointer() uintptr { | |
| @@ -27,7 +27,7 @@ func (x *TabPageClass) GoPointer() uintptr { | |||
| 27 | 27 | type TabViewClass struct { | |
| 28 | 28 | _ structs.HostLayout | |
| 29 | 29 | ||
| 30 | - | ParentClass uintptr | |
| 30 | + | ParentClass gtk.WidgetClass | |
| 31 | 31 | } | |
| 32 | 32 | ||
| 33 | 33 | func (x *TabViewClass) GoPointer() uintptr { | |
M v4/adw/adw-toast-overlay.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type ToastOverlayClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *ToastOverlayClass) GoPointer() uintptr { | |
M v4/adw/adw-toast.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type ToastClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *ToastClass) GoPointer() uintptr { | |
M v4/adw/adw-toolbar-view.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type ToolbarViewClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *ToolbarViewClass) GoPointer() uintptr { | |
M v4/adw/adw-view-stack.go +3 -3
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type ViewStackClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gtk.WidgetClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *ViewStackClass) GoPointer() uintptr { | |
| @@ -26,7 +26,7 @@ func (x *ViewStackClass) GoPointer() uintptr { | |||
| 26 | 26 | type ViewStackPageClass struct { | |
| 27 | 27 | _ structs.HostLayout | |
| 28 | 28 | ||
| 29 | - | ParentClass uintptr | |
| 29 | + | ParentClass gobject.ObjectClass | |
| 30 | 30 | } | |
| 31 | 31 | ||
| 32 | 32 | func (x *ViewStackPageClass) GoPointer() uintptr { | |
| @@ -36,7 +36,7 @@ func (x *ViewStackPageClass) GoPointer() uintptr { | |||
| 36 | 36 | type ViewStackPagesClass struct { | |
| 37 | 37 | _ structs.HostLayout | |
| 38 | 38 | ||
| 39 | - | ParentClass uintptr | |
| 39 | + | ParentClass gobject.ObjectClass | |
| 40 | 40 | } | |
| 41 | 41 | ||
| 42 | 42 | func (x *ViewStackPagesClass) GoPointer() uintptr { | |
M v4/adw/adw-view-switcher-bar.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type ViewSwitcherBarClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *ViewSwitcherBarClass) GoPointer() uintptr { | |
M v4/adw/adw-view-switcher-title.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type ViewSwitcherTitleClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *ViewSwitcherTitleClass) GoPointer() uintptr { | |
M v4/adw/adw-view-switcher.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type ViewSwitcherClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *ViewSwitcherClass) GoPointer() uintptr { | |
M v4/adw/adw-window-title.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type WindowTitleClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *WindowTitleClass) GoPointer() uintptr { | |
M v4/adw/adw-window.go +1 -1
| @@ -18,7 +18,7 @@ import ( | |||
| 18 | 18 | type WindowClass struct { | |
| 19 | 19 | _ structs.HostLayout | |
| 20 | 20 | ||
| 21 | - | ParentClass uintptr | |
| 21 | + | ParentClass gtk.WindowClass | |
| 22 | 22 | ||
| 23 | 23 | Padding [4]uintptr | |
| 24 | 24 | } | |
M v4/gdk/gdkcontentprovider.go +201 -1
| @@ -17,7 +17,23 @@ import ( | |||
| 17 | 17 | type ContentProviderClass struct { | |
| 18 | 18 | _ structs.HostLayout | |
| 19 | 19 | ||
| 20 | - | ParentClass uintptr | |
| 20 | + | ParentClass gobject.ObjectClass | |
| 21 | + | ||
| 22 | + | xContentChanged uintptr | |
| 23 | + | ||
| 24 | + | xAttachClipboard uintptr | |
| 25 | + | ||
| 26 | + | xDetachClipboard uintptr | |
| 27 | + | ||
| 28 | + | xRefFormats uintptr | |
| 29 | + | ||
| 30 | + | xRefStorableFormats uintptr | |
| 31 | + | ||
| 32 | + | xWriteMimeTypeAsync uintptr | |
| 33 | + | ||
| 34 | + | xWriteMimeTypeFinish uintptr | |
| 35 | + | ||
| 36 | + | xGetValue uintptr | |
| 21 | 37 | ||
| 22 | 38 | Padding [8]uintptr | |
| 23 | 39 | } | |
| @@ -26,6 +42,190 @@ func (x *ContentProviderClass) GoPointer() uintptr { | |||
| 26 | 42 | return uintptr(unsafe.Pointer(x)) | |
| 27 | 43 | } | |
| 28 | 44 | ||
| 45 | + | // OverrideContentChanged sets the callback function. | |
| 46 | + | func (x *ContentProviderClass) OverrideContentChanged(cb func(*ContentProvider)) { | |
| 47 | + | if cb == nil { | |
| 48 | + | x.xContentChanged = 0 | |
| 49 | + | } else { | |
| 50 | + | x.xContentChanged = purego.NewCallback(func(ProviderVarp uintptr) { | |
| 51 | + | cb(ContentProviderNewFromInternalPtr(ProviderVarp)) | |
| 52 | + | }) | |
| 53 | + | } | |
| 54 | + | } | |
| 55 | + | ||
| 56 | + | // GetContentChanged gets the callback function. | |
| 57 | + | func (x *ContentProviderClass) GetContentChanged() func(*ContentProvider) { | |
| 58 | + | if x.xContentChanged == 0 { | |
| 59 | + | return nil | |
| 60 | + | } | |
| 61 | + | var rawCallback func(ProviderVarp uintptr) | |
| 62 | + | purego.RegisterFunc(&rawCallback, x.xContentChanged) | |
| 63 | + | return func(ProviderVar *ContentProvider) { | |
| 64 | + | rawCallback(ProviderVar.GoPointer()) | |
| 65 | + | } | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | // OverrideAttachClipboard sets the callback function. | |
| 69 | + | func (x *ContentProviderClass) OverrideAttachClipboard(cb func(*ContentProvider, *Clipboard)) { | |
| 70 | + | if cb == nil { | |
| 71 | + | x.xAttachClipboard = 0 | |
| 72 | + | } else { | |
| 73 | + | x.xAttachClipboard = purego.NewCallback(func(ProviderVarp uintptr, ClipboardVarp uintptr) { | |
| 74 | + | cb(ContentProviderNewFromInternalPtr(ProviderVarp), ClipboardNewFromInternalPtr(ClipboardVarp)) | |
| 75 | + | }) | |
| 76 | + | } | |
| 77 | + | } | |
| 78 | + | ||
| 79 | + | // GetAttachClipboard gets the callback function. | |
| 80 | + | func (x *ContentProviderClass) GetAttachClipboard() func(*ContentProvider, *Clipboard) { | |
| 81 | + | if x.xAttachClipboard == 0 { | |
| 82 | + | return nil | |
| 83 | + | } | |
| 84 | + | var rawCallback func(ProviderVarp uintptr, ClipboardVarp uintptr) | |
| 85 | + | purego.RegisterFunc(&rawCallback, x.xAttachClipboard) | |
| 86 | + | return func(ProviderVar *ContentProvider, ClipboardVar *Clipboard) { | |
| 87 | + | rawCallback(ProviderVar.GoPointer(), ClipboardVar.GoPointer()) | |
| 88 | + | } | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | // OverrideDetachClipboard sets the callback function. | |
| 92 | + | func (x *ContentProviderClass) OverrideDetachClipboard(cb func(*ContentProvider, *Clipboard)) { | |
| 93 | + | if cb == nil { | |
| 94 | + | x.xDetachClipboard = 0 | |
| 95 | + | } else { | |
| 96 | + | x.xDetachClipboard = purego.NewCallback(func(ProviderVarp uintptr, ClipboardVarp uintptr) { | |
| 97 | + | cb(ContentProviderNewFromInternalPtr(ProviderVarp), ClipboardNewFromInternalPtr(ClipboardVarp)) | |
| 98 | + | }) | |
| 99 | + | } | |
| 100 | + | } | |
| 101 | + | ||
| 102 | + | // GetDetachClipboard gets the callback function. | |
| 103 | + | func (x *ContentProviderClass) GetDetachClipboard() func(*ContentProvider, *Clipboard) { | |
| 104 | + | if x.xDetachClipboard == 0 { | |
| 105 | + | return nil | |
| 106 | + | } | |
| 107 | + | var rawCallback func(ProviderVarp uintptr, ClipboardVarp uintptr) | |
| 108 | + | purego.RegisterFunc(&rawCallback, x.xDetachClipboard) | |
| 109 | + | return func(ProviderVar *ContentProvider, ClipboardVar *Clipboard) { | |
| 110 | + | rawCallback(ProviderVar.GoPointer(), ClipboardVar.GoPointer()) | |
| 111 | + | } | |
| 112 | + | } | |
| 113 | + | ||
| 114 | + | // OverrideRefFormats sets the callback function. | |
| 115 | + | func (x *ContentProviderClass) OverrideRefFormats(cb func(*ContentProvider) *ContentFormats) { | |
| 116 | + | if cb == nil { | |
| 117 | + | x.xRefFormats = 0 | |
| 118 | + | } else { | |
| 119 | + | x.xRefFormats = purego.NewCallback(func(ProviderVarp uintptr) *ContentFormats { | |
| 120 | + | return cb(ContentProviderNewFromInternalPtr(ProviderVarp)) | |
| 121 | + | }) | |
| 122 | + | } | |
| 123 | + | } | |
| 124 | + | ||
| 125 | + | // GetRefFormats gets the callback function. | |
| 126 | + | func (x *ContentProviderClass) GetRefFormats() func(*ContentProvider) *ContentFormats { | |
| 127 | + | if x.xRefFormats == 0 { | |
| 128 | + | return nil | |
| 129 | + | } | |
| 130 | + | var rawCallback func(ProviderVarp uintptr) *ContentFormats | |
| 131 | + | purego.RegisterFunc(&rawCallback, x.xRefFormats) | |
| 132 | + | return func(ProviderVar *ContentProvider) *ContentFormats { | |
| 133 | + | return rawCallback(ProviderVar.GoPointer()) | |
| 134 | + | } | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | // OverrideRefStorableFormats sets the callback function. | |
| 138 | + | func (x *ContentProviderClass) OverrideRefStorableFormats(cb func(*ContentProvider) *ContentFormats) { | |
| 139 | + | if cb == nil { | |
| 140 | + | x.xRefStorableFormats = 0 | |
| 141 | + | } else { | |
| 142 | + | x.xRefStorableFormats = purego.NewCallback(func(ProviderVarp uintptr) *ContentFormats { | |
| 143 | + | return cb(ContentProviderNewFromInternalPtr(ProviderVarp)) | |
| 144 | + | }) | |
| 145 | + | } | |
| 146 | + | } | |
| 147 | + | ||
| 148 | + | // GetRefStorableFormats gets the callback function. | |
| 149 | + | func (x *ContentProviderClass) GetRefStorableFormats() func(*ContentProvider) *ContentFormats { | |
| 150 | + | if x.xRefStorableFormats == 0 { | |
| 151 | + | return nil | |
| 152 | + | } | |
| 153 | + | var rawCallback func(ProviderVarp uintptr) *ContentFormats | |
| 154 | + | purego.RegisterFunc(&rawCallback, x.xRefStorableFormats) | |
| 155 | + | return func(ProviderVar *ContentProvider) *ContentFormats { | |
| 156 | + | return rawCallback(ProviderVar.GoPointer()) | |
| 157 | + | } | |
| 158 | + | } | |
| 159 | + | ||
| 160 | + | // OverrideWriteMimeTypeAsync sets the callback function. | |
| 161 | + | func (x *ContentProviderClass) OverrideWriteMimeTypeAsync(cb func(*ContentProvider, string, *gio.OutputStream, int, *gio.Cancellable, *gio.AsyncReadyCallback, uintptr)) { | |
| 162 | + | if cb == nil { | |
| 163 | + | x.xWriteMimeTypeAsync = 0 | |
| 164 | + | } else { | |
| 165 | + | x.xWriteMimeTypeAsync = purego.NewCallback(func(ProviderVarp uintptr, MimeTypeVarp string, StreamVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 166 | + | cb(ContentProviderNewFromInternalPtr(ProviderVarp), MimeTypeVarp, gio.OutputStreamNewFromInternalPtr(StreamVarp), IoPriorityVarp, gio.CancellableNewFromInternalPtr(CancellableVarp), (*gio.AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 167 | + | }) | |
| 168 | + | } | |
| 169 | + | } | |
| 170 | + | ||
| 171 | + | // GetWriteMimeTypeAsync gets the callback function. | |
| 172 | + | func (x *ContentProviderClass) GetWriteMimeTypeAsync() func(*ContentProvider, string, *gio.OutputStream, int, *gio.Cancellable, *gio.AsyncReadyCallback, uintptr) { | |
| 173 | + | if x.xWriteMimeTypeAsync == 0 { | |
| 174 | + | return nil | |
| 175 | + | } | |
| 176 | + | var rawCallback func(ProviderVarp uintptr, MimeTypeVarp string, StreamVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 177 | + | purego.RegisterFunc(&rawCallback, x.xWriteMimeTypeAsync) | |
| 178 | + | return func(ProviderVar *ContentProvider, MimeTypeVar string, StreamVar *gio.OutputStream, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 179 | + | rawCallback(ProviderVar.GoPointer(), MimeTypeVar, StreamVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 180 | + | } | |
| 181 | + | } | |
| 182 | + | ||
| 183 | + | // OverrideWriteMimeTypeFinish sets the callback function. | |
| 184 | + | func (x *ContentProviderClass) OverrideWriteMimeTypeFinish(cb func(*ContentProvider, gio.AsyncResult) bool) { | |
| 185 | + | if cb == nil { | |
| 186 | + | x.xWriteMimeTypeFinish = 0 | |
| 187 | + | } else { | |
| 188 | + | x.xWriteMimeTypeFinish = purego.NewCallback(func(ProviderVarp uintptr, ResultVarp uintptr) bool { | |
| 189 | + | return cb(ContentProviderNewFromInternalPtr(ProviderVarp), &gio.AsyncResultBase{Ptr: ResultVarp}) | |
| 190 | + | }) | |
| 191 | + | } | |
| 192 | + | } | |
| 193 | + | ||
| 194 | + | // GetWriteMimeTypeFinish gets the callback function. | |
| 195 | + | func (x *ContentProviderClass) GetWriteMimeTypeFinish() func(*ContentProvider, gio.AsyncResult) bool { | |
| 196 | + | if x.xWriteMimeTypeFinish == 0 { | |
| 197 | + | return nil | |
| 198 | + | } | |
| 199 | + | var rawCallback func(ProviderVarp uintptr, ResultVarp uintptr) bool | |
| 200 | + | purego.RegisterFunc(&rawCallback, x.xWriteMimeTypeFinish) | |
| 201 | + | return func(ProviderVar *ContentProvider, ResultVar gio.AsyncResult) bool { | |
| 202 | + | return rawCallback(ProviderVar.GoPointer(), ResultVar.GoPointer()) | |
| 203 | + | } | |
| 204 | + | } | |
| 205 | + | ||
| 206 | + | // OverrideGetValue sets the callback function. | |
| 207 | + | func (x *ContentProviderClass) OverrideGetValue(cb func(*ContentProvider, *gobject.Value) bool) { | |
| 208 | + | if cb == nil { | |
| 209 | + | x.xGetValue = 0 | |
| 210 | + | } else { | |
| 211 | + | x.xGetValue = purego.NewCallback(func(ProviderVarp uintptr, ValueVarp *gobject.Value) bool { | |
| 212 | + | return cb(ContentProviderNewFromInternalPtr(ProviderVarp), ValueVarp) | |
| 213 | + | }) | |
| 214 | + | } | |
| 215 | + | } | |
| 216 | + | ||
| 217 | + | // GetGetValue gets the callback function. | |
| 218 | + | func (x *ContentProviderClass) GetGetValue() func(*ContentProvider, *gobject.Value) bool { | |
| 219 | + | if x.xGetValue == 0 { | |
| 220 | + | return nil | |
| 221 | + | } | |
| 222 | + | var rawCallback func(ProviderVarp uintptr, ValueVarp *gobject.Value) bool | |
| 223 | + | purego.RegisterFunc(&rawCallback, x.xGetValue) | |
| 224 | + | return func(ProviderVar *ContentProvider, ValueVar *gobject.Value) bool { | |
| 225 | + | return rawCallback(ProviderVar.GoPointer(), ValueVar) | |
| 226 | + | } | |
| 227 | + | } | |
| 228 | + | ||
| 29 | 229 | // A `GdkContentProvider` is used to provide content for the clipboard or | |
| 30 | 230 | // for drag-and-drop operations in a number of formats. | |
| 31 | 231 | // | |
M v4/gdk/gdkpaintable.go +160 -0
| @@ -23,12 +23,172 @@ type PaintableInterface struct { | |||
| 23 | 23 | _ structs.HostLayout | |
| 24 | 24 | ||
| 25 | 25 | GIface uintptr | |
| 26 | + | ||
| 27 | + | xSnapshot uintptr | |
| 28 | + | ||
| 29 | + | xGetCurrentImage uintptr | |
| 30 | + | ||
| 31 | + | xGetFlags uintptr | |
| 32 | + | ||
| 33 | + | xGetIntrinsicWidth uintptr | |
| 34 | + | ||
| 35 | + | xGetIntrinsicHeight uintptr | |
| 36 | + | ||
| 37 | + | xGetIntrinsicAspectRatio uintptr | |
| 26 | 38 | } | |
| 27 | 39 | ||
| 28 | 40 | func (x *PaintableInterface) GoPointer() uintptr { | |
| 29 | 41 | return uintptr(unsafe.Pointer(x)) | |
| 30 | 42 | } | |
| 31 | 43 | ||
| 44 | + | // OverrideSnapshot sets the callback function. | |
| 45 | + | func (x *PaintableInterface) OverrideSnapshot(cb func(Paintable, *Snapshot, float64, float64)) { | |
| 46 | + | if cb == nil { | |
| 47 | + | x.xSnapshot = 0 | |
| 48 | + | } else { | |
| 49 | + | x.xSnapshot = purego.NewCallback(func(PaintableVarp uintptr, SnapshotVarp uintptr, WidthVarp float64, HeightVarp float64) { | |
| 50 | + | cb(&PaintableBase{Ptr: PaintableVarp}, SnapshotNewFromInternalPtr(SnapshotVarp), WidthVarp, HeightVarp) | |
| 51 | + | }) | |
| 52 | + | } | |
| 53 | + | } | |
| 54 | + | ||
| 55 | + | // GetSnapshot gets the callback function. | |
| 56 | + | func (x *PaintableInterface) GetSnapshot() func(Paintable, *Snapshot, float64, float64) { | |
| 57 | + | if x.xSnapshot == 0 { | |
| 58 | + | return nil | |
| 59 | + | } | |
| 60 | + | var rawCallback func(PaintableVarp uintptr, SnapshotVarp uintptr, WidthVarp float64, HeightVarp float64) | |
| 61 | + | purego.RegisterFunc(&rawCallback, x.xSnapshot) | |
| 62 | + | return func(PaintableVar Paintable, SnapshotVar *Snapshot, WidthVar float64, HeightVar float64) { | |
| 63 | + | rawCallback(PaintableVar.GoPointer(), SnapshotVar.GoPointer(), WidthVar, HeightVar) | |
| 64 | + | } | |
| 65 | + | } | |
| 66 | + | ||
| 67 | + | // OverrideGetCurrentImage sets the callback function. | |
| 68 | + | func (x *PaintableInterface) OverrideGetCurrentImage(cb func(Paintable) *PaintableBase) { | |
| 69 | + | if cb == nil { | |
| 70 | + | x.xGetCurrentImage = 0 | |
| 71 | + | } else { | |
| 72 | + | x.xGetCurrentImage = purego.NewCallback(func(PaintableVarp uintptr) uintptr { | |
| 73 | + | ret := cb(&PaintableBase{Ptr: PaintableVarp}) | |
| 74 | + | if ret == nil { | |
| 75 | + | return 0 | |
| 76 | + | } | |
| 77 | + | return ret.GoPointer() | |
| 78 | + | }) | |
| 79 | + | } | |
| 80 | + | } | |
| 81 | + | ||
| 82 | + | // GetGetCurrentImage gets the callback function. | |
| 83 | + | func (x *PaintableInterface) GetGetCurrentImage() func(Paintable) *PaintableBase { | |
| 84 | + | if x.xGetCurrentImage == 0 { | |
| 85 | + | return nil | |
| 86 | + | } | |
| 87 | + | var rawCallback func(PaintableVarp uintptr) uintptr | |
| 88 | + | purego.RegisterFunc(&rawCallback, x.xGetCurrentImage) | |
| 89 | + | return func(PaintableVar Paintable) *PaintableBase { | |
| 90 | + | rawRet := rawCallback(PaintableVar.GoPointer()) | |
| 91 | + | if rawRet == 0 { | |
| 92 | + | return nil | |
| 93 | + | } | |
| 94 | + | ret := &PaintableBase{} | |
| 95 | + | ret.Ptr = rawRet | |
| 96 | + | return ret | |
| 97 | + | } | |
| 98 | + | } | |
| 99 | + | ||
| 100 | + | // OverrideGetFlags sets the callback function. | |
| 101 | + | func (x *PaintableInterface) OverrideGetFlags(cb func(Paintable) PaintableFlags) { | |
| 102 | + | if cb == nil { | |
| 103 | + | x.xGetFlags = 0 | |
| 104 | + | } else { | |
| 105 | + | x.xGetFlags = purego.NewCallback(func(PaintableVarp uintptr) PaintableFlags { | |
| 106 | + | return cb(&PaintableBase{Ptr: PaintableVarp}) | |
| 107 | + | }) | |
| 108 | + | } | |
| 109 | + | } | |
| 110 | + | ||
| 111 | + | // GetGetFlags gets the callback function. | |
| 112 | + | func (x *PaintableInterface) GetGetFlags() func(Paintable) PaintableFlags { | |
| 113 | + | if x.xGetFlags == 0 { | |
| 114 | + | return nil | |
| 115 | + | } | |
| 116 | + | var rawCallback func(PaintableVarp uintptr) PaintableFlags | |
| 117 | + | purego.RegisterFunc(&rawCallback, x.xGetFlags) | |
| 118 | + | return func(PaintableVar Paintable) PaintableFlags { | |
| 119 | + | return rawCallback(PaintableVar.GoPointer()) | |
| 120 | + | } | |
| 121 | + | } | |
| 122 | + | ||
| 123 | + | // OverrideGetIntrinsicWidth sets the callback function. | |
| 124 | + | func (x *PaintableInterface) OverrideGetIntrinsicWidth(cb func(Paintable) int) { | |
| 125 | + | if cb == nil { | |
| 126 | + | x.xGetIntrinsicWidth = 0 | |
| 127 | + | } else { | |
| 128 | + | x.xGetIntrinsicWidth = purego.NewCallback(func(PaintableVarp uintptr) int { | |
| 129 | + | return cb(&PaintableBase{Ptr: PaintableVarp}) | |
| 130 | + | }) | |
| 131 | + | } | |
| 132 | + | } | |
| 133 | + | ||
| 134 | + | // GetGetIntrinsicWidth gets the callback function. | |
| 135 | + | func (x *PaintableInterface) GetGetIntrinsicWidth() func(Paintable) int { | |
| 136 | + | if x.xGetIntrinsicWidth == 0 { | |
| 137 | + | return nil | |
| 138 | + | } | |
| 139 | + | var rawCallback func(PaintableVarp uintptr) int | |
| 140 | + | purego.RegisterFunc(&rawCallback, x.xGetIntrinsicWidth) | |
| 141 | + | return func(PaintableVar Paintable) int { | |
| 142 | + | return rawCallback(PaintableVar.GoPointer()) | |
| 143 | + | } | |
| 144 | + | } | |
| 145 | + | ||
| 146 | + | // OverrideGetIntrinsicHeight sets the callback function. | |
| 147 | + | func (x *PaintableInterface) OverrideGetIntrinsicHeight(cb func(Paintable) int) { | |
| 148 | + | if cb == nil { | |
| 149 | + | x.xGetIntrinsicHeight = 0 | |
| 150 | + | } else { | |
| 151 | + | x.xGetIntrinsicHeight = purego.NewCallback(func(PaintableVarp uintptr) int { | |
| 152 | + | return cb(&PaintableBase{Ptr: PaintableVarp}) | |
| 153 | + | }) | |
| 154 | + | } | |
| 155 | + | } | |
| 156 | + | ||
| 157 | + | // GetGetIntrinsicHeight gets the callback function. | |
| 158 | + | func (x *PaintableInterface) GetGetIntrinsicHeight() func(Paintable) int { | |
| 159 | + | if x.xGetIntrinsicHeight == 0 { | |
| 160 | + | return nil | |
| 161 | + | } | |
| 162 | + | var rawCallback func(PaintableVarp uintptr) int | |
| 163 | + | purego.RegisterFunc(&rawCallback, x.xGetIntrinsicHeight) | |
| 164 | + | return func(PaintableVar Paintable) int { | |
| 165 | + | return rawCallback(PaintableVar.GoPointer()) | |
| 166 | + | } | |
| 167 | + | } | |
| 168 | + | ||
| 169 | + | // OverrideGetIntrinsicAspectRatio sets the callback function. | |
| 170 | + | func (x *PaintableInterface) OverrideGetIntrinsicAspectRatio(cb func(Paintable) float64) { | |
| 171 | + | if cb == nil { | |
| 172 | + | x.xGetIntrinsicAspectRatio = 0 | |
| 173 | + | } else { | |
| 174 | + | x.xGetIntrinsicAspectRatio = purego.NewCallback(func(PaintableVarp uintptr) float64 { | |
| 175 | + | return cb(&PaintableBase{Ptr: PaintableVarp}) | |
| 176 | + | }) | |
| 177 | + | } | |
| 178 | + | } | |
| 179 | + | ||
| 180 | + | // GetGetIntrinsicAspectRatio gets the callback function. | |
| 181 | + | func (x *PaintableInterface) GetGetIntrinsicAspectRatio() func(Paintable) float64 { | |
| 182 | + | if x.xGetIntrinsicAspectRatio == 0 { | |
| 183 | + | return nil | |
| 184 | + | } | |
| 185 | + | var rawCallback func(PaintableVarp uintptr) float64 | |
| 186 | + | purego.RegisterFunc(&rawCallback, x.xGetIntrinsicAspectRatio) | |
| 187 | + | return func(PaintableVar Paintable) float64 { | |
| 188 | + | return rawCallback(PaintableVar.GoPointer()) | |
| 189 | + | } | |
| 190 | + | } | |
| 191 | + | ||
| 32 | 192 | // `GdkPaintable` is a simple interface used by GTK to represent content that | |
| 33 | 193 | // can be painted. | |
| 34 | 194 | // | |
M v4/gdkpixbuf/gdk-pixbuf-animation.go +232 -2
| @@ -19,26 +19,256 @@ import ( | |||
| 19 | 19 | type PixbufAnimationClass struct { | |
| 20 | 20 | _ structs.HostLayout | |
| 21 | 21 | ||
| 22 | - | ParentClass uintptr | |
| 22 | + | ParentClass gobject.ObjectClass | |
| 23 | + | ||
| 24 | + | xIsStaticImage uintptr | |
| 25 | + | ||
| 26 | + | xGetStaticImage uintptr | |
| 27 | + | ||
| 28 | + | xGetSize uintptr | |
| 29 | + | ||
| 30 | + | xGetIter uintptr | |
| 23 | 31 | } | |
| 24 | 32 | ||
| 25 | 33 | func (x *PixbufAnimationClass) GoPointer() uintptr { | |
| 26 | 34 | return uintptr(unsafe.Pointer(x)) | |
| 27 | 35 | } | |
| 28 | 36 | ||
| 37 | + | // OverrideIsStaticImage sets the callback function. | |
| 38 | + | func (x *PixbufAnimationClass) OverrideIsStaticImage(cb func(*PixbufAnimation) bool) { | |
| 39 | + | if cb == nil { | |
| 40 | + | x.xIsStaticImage = 0 | |
| 41 | + | } else { | |
| 42 | + | x.xIsStaticImage = purego.NewCallback(func(AnimationVarp uintptr) bool { | |
| 43 | + | return cb(PixbufAnimationNewFromInternalPtr(AnimationVarp)) | |
| 44 | + | }) | |
| 45 | + | } | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | // GetIsStaticImage gets the callback function. | |
| 49 | + | func (x *PixbufAnimationClass) GetIsStaticImage() func(*PixbufAnimation) bool { | |
| 50 | + | if x.xIsStaticImage == 0 { | |
| 51 | + | return nil | |
| 52 | + | } | |
| 53 | + | var rawCallback func(AnimationVarp uintptr) bool | |
| 54 | + | purego.RegisterFunc(&rawCallback, x.xIsStaticImage) | |
| 55 | + | return func(AnimationVar *PixbufAnimation) bool { | |
| 56 | + | return rawCallback(AnimationVar.GoPointer()) | |
| 57 | + | } | |
| 58 | + | } | |
| 59 | + | ||
| 60 | + | // OverrideGetStaticImage sets the callback function. | |
| 61 | + | func (x *PixbufAnimationClass) OverrideGetStaticImage(cb func(*PixbufAnimation) *Pixbuf) { | |
| 62 | + | if cb == nil { | |
| 63 | + | x.xGetStaticImage = 0 | |
| 64 | + | } else { | |
| 65 | + | x.xGetStaticImage = purego.NewCallback(func(AnimationVarp uintptr) uintptr { | |
| 66 | + | ret := cb(PixbufAnimationNewFromInternalPtr(AnimationVarp)) | |
| 67 | + | if ret == nil { | |
| 68 | + | return 0 | |
| 69 | + | } | |
| 70 | + | return ret.GoPointer() | |
| 71 | + | }) | |
| 72 | + | } | |
| 73 | + | } | |
| 74 | + | ||
| 75 | + | // GetGetStaticImage gets the callback function. | |
| 76 | + | func (x *PixbufAnimationClass) GetGetStaticImage() func(*PixbufAnimation) *Pixbuf { | |
| 77 | + | if x.xGetStaticImage == 0 { | |
| 78 | + | return nil | |
| 79 | + | } | |
| 80 | + | var rawCallback func(AnimationVarp uintptr) uintptr | |
| 81 | + | purego.RegisterFunc(&rawCallback, x.xGetStaticImage) | |
| 82 | + | return func(AnimationVar *PixbufAnimation) *Pixbuf { | |
| 83 | + | rawRet := rawCallback(AnimationVar.GoPointer()) | |
| 84 | + | if rawRet == 0 { | |
| 85 | + | return nil | |
| 86 | + | } | |
| 87 | + | ret := &Pixbuf{} | |
| 88 | + | ret.Ptr = rawRet | |
| 89 | + | return ret | |
| 90 | + | } | |
| 91 | + | } | |
| 92 | + | ||
| 93 | + | // OverrideGetSize sets the callback function. | |
| 94 | + | func (x *PixbufAnimationClass) OverrideGetSize(cb func(*PixbufAnimation, int, int)) { | |
| 95 | + | if cb == nil { | |
| 96 | + | x.xGetSize = 0 | |
| 97 | + | } else { | |
| 98 | + | x.xGetSize = purego.NewCallback(func(AnimationVarp uintptr, WidthVarp int, HeightVarp int) { | |
| 99 | + | cb(PixbufAnimationNewFromInternalPtr(AnimationVarp), WidthVarp, HeightVarp) | |
| 100 | + | }) | |
| 101 | + | } | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | // GetGetSize gets the callback function. | |
| 105 | + | func (x *PixbufAnimationClass) GetGetSize() func(*PixbufAnimation, int, int) { | |
| 106 | + | if x.xGetSize == 0 { | |
| 107 | + | return nil | |
| 108 | + | } | |
| 109 | + | var rawCallback func(AnimationVarp uintptr, WidthVarp int, HeightVarp int) | |
| 110 | + | purego.RegisterFunc(&rawCallback, x.xGetSize) | |
| 111 | + | return func(AnimationVar *PixbufAnimation, WidthVar int, HeightVar int) { | |
| 112 | + | rawCallback(AnimationVar.GoPointer(), WidthVar, HeightVar) | |
| 113 | + | } | |
| 114 | + | } | |
| 115 | + | ||
| 116 | + | // OverrideGetIter sets the callback function. | |
| 117 | + | func (x *PixbufAnimationClass) OverrideGetIter(cb func(*PixbufAnimation, *glib.TimeVal) *PixbufAnimationIter) { | |
| 118 | + | if cb == nil { | |
| 119 | + | x.xGetIter = 0 | |
| 120 | + | } else { | |
| 121 | + | x.xGetIter = purego.NewCallback(func(AnimationVarp uintptr, StartTimeVarp *glib.TimeVal) uintptr { | |
| 122 | + | ret := cb(PixbufAnimationNewFromInternalPtr(AnimationVarp), StartTimeVarp) | |
| 123 | + | if ret == nil { | |
| 124 | + | return 0 | |
| 125 | + | } | |
| 126 | + | return ret.GoPointer() | |
| 127 | + | }) | |
| 128 | + | } | |
| 129 | + | } | |
| 130 | + | ||
| 131 | + | // GetGetIter gets the callback function. | |
| 132 | + | func (x *PixbufAnimationClass) GetGetIter() func(*PixbufAnimation, *glib.TimeVal) *PixbufAnimationIter { | |
| 133 | + | if x.xGetIter == 0 { | |
| 134 | + | return nil | |
| 135 | + | } | |
| 136 | + | var rawCallback func(AnimationVarp uintptr, StartTimeVarp *glib.TimeVal) uintptr | |
| 137 | + | purego.RegisterFunc(&rawCallback, x.xGetIter) | |
| 138 | + | return func(AnimationVar *PixbufAnimation, StartTimeVar *glib.TimeVal) *PixbufAnimationIter { | |
| 139 | + | rawRet := rawCallback(AnimationVar.GoPointer(), StartTimeVar) | |
| 140 | + | if rawRet == 0 { | |
| 141 | + | return nil | |
| 142 | + | } | |
| 143 | + | ret := &PixbufAnimationIter{} | |
| 144 | + | ret.Ptr = rawRet | |
| 145 | + | return ret | |
| 146 | + | } | |
| 147 | + | } | |
| 148 | + | ||
| 29 | 149 | // Modules supporting animations must derive a type from | |
| 30 | 150 | // #GdkPixbufAnimationIter, providing suitable implementations of the | |
| 31 | 151 | // virtual functions. | |
| 32 | 152 | type PixbufAnimationIterClass struct { | |
| 33 | 153 | _ structs.HostLayout | |
| 34 | 154 | ||
| 35 | - | ParentClass uintptr | |
| 155 | + | ParentClass gobject.ObjectClass | |
| 156 | + | ||
| 157 | + | xGetDelayTime uintptr | |
| 158 | + | ||
| 159 | + | xGetPixbuf uintptr | |
| 160 | + | ||
| 161 | + | xOnCurrentlyLoadingFrame uintptr | |
| 162 | + | ||
| 163 | + | xAdvance uintptr | |
| 36 | 164 | } | |
| 37 | 165 | ||
| 38 | 166 | func (x *PixbufAnimationIterClass) GoPointer() uintptr { | |
| 39 | 167 | return uintptr(unsafe.Pointer(x)) | |
| 40 | 168 | } | |
| 41 | 169 | ||
| 170 | + | // OverrideGetDelayTime sets the callback function. | |
| 171 | + | func (x *PixbufAnimationIterClass) OverrideGetDelayTime(cb func(*PixbufAnimationIter) int) { | |
| 172 | + | if cb == nil { | |
| 173 | + | x.xGetDelayTime = 0 | |
| 174 | + | } else { | |
| 175 | + | x.xGetDelayTime = purego.NewCallback(func(IterVarp uintptr) int { | |
| 176 | + | return cb(PixbufAnimationIterNewFromInternalPtr(IterVarp)) | |
| 177 | + | }) | |
| 178 | + | } | |
| 179 | + | } | |
| 180 | + | ||
| 181 | + | // GetGetDelayTime gets the callback function. | |
| 182 | + | func (x *PixbufAnimationIterClass) GetGetDelayTime() func(*PixbufAnimationIter) int { | |
| 183 | + | if x.xGetDelayTime == 0 { | |
| 184 | + | return nil | |
| 185 | + | } | |
| 186 | + | var rawCallback func(IterVarp uintptr) int | |
| 187 | + | purego.RegisterFunc(&rawCallback, x.xGetDelayTime) | |
| 188 | + | return func(IterVar *PixbufAnimationIter) int { | |
| 189 | + | return rawCallback(IterVar.GoPointer()) | |
| 190 | + | } | |
| 191 | + | } | |
| 192 | + | ||
| 193 | + | // OverrideGetPixbuf sets the callback function. | |
| 194 | + | func (x *PixbufAnimationIterClass) OverrideGetPixbuf(cb func(*PixbufAnimationIter) *Pixbuf) { | |
| 195 | + | if cb == nil { | |
| 196 | + | x.xGetPixbuf = 0 | |
| 197 | + | } else { | |
| 198 | + | x.xGetPixbuf = purego.NewCallback(func(IterVarp uintptr) uintptr { | |
| 199 | + | ret := cb(PixbufAnimationIterNewFromInternalPtr(IterVarp)) | |
| 200 | + | if ret == nil { | |
| 201 | + | return 0 | |
| 202 | + | } | |
| 203 | + | return ret.GoPointer() | |
| 204 | + | }) | |
| 205 | + | } | |
| 206 | + | } | |
| 207 | + | ||
| 208 | + | // GetGetPixbuf gets the callback function. | |
| 209 | + | func (x *PixbufAnimationIterClass) GetGetPixbuf() func(*PixbufAnimationIter) *Pixbuf { | |
| 210 | + | if x.xGetPixbuf == 0 { | |
| 211 | + | return nil | |
| 212 | + | } | |
| 213 | + | var rawCallback func(IterVarp uintptr) uintptr | |
| 214 | + | purego.RegisterFunc(&rawCallback, x.xGetPixbuf) | |
| 215 | + | return func(IterVar *PixbufAnimationIter) *Pixbuf { | |
| 216 | + | rawRet := rawCallback(IterVar.GoPointer()) | |
| 217 | + | if rawRet == 0 { | |
| 218 | + | return nil | |
| 219 | + | } | |
| 220 | + | ret := &Pixbuf{} | |
| 221 | + | ret.Ptr = rawRet | |
| 222 | + | return ret | |
| 223 | + | } | |
| 224 | + | } | |
| 225 | + | ||
| 226 | + | // OverrideOnCurrentlyLoadingFrame sets the callback function. | |
| 227 | + | func (x *PixbufAnimationIterClass) OverrideOnCurrentlyLoadingFrame(cb func(*PixbufAnimationIter) bool) { | |
| 228 | + | if cb == nil { | |
| 229 | + | x.xOnCurrentlyLoadingFrame = 0 | |
| 230 | + | } else { | |
| 231 | + | x.xOnCurrentlyLoadingFrame = purego.NewCallback(func(IterVarp uintptr) bool { | |
| 232 | + | return cb(PixbufAnimationIterNewFromInternalPtr(IterVarp)) | |
| 233 | + | }) | |
| 234 | + | } | |
| 235 | + | } | |
| 236 | + | ||
| 237 | + | // GetOnCurrentlyLoadingFrame gets the callback function. | |
| 238 | + | func (x *PixbufAnimationIterClass) GetOnCurrentlyLoadingFrame() func(*PixbufAnimationIter) bool { | |
| 239 | + | if x.xOnCurrentlyLoadingFrame == 0 { | |
| 240 | + | return nil | |
| 241 | + | } | |
| 242 | + | var rawCallback func(IterVarp uintptr) bool | |
| 243 | + | purego.RegisterFunc(&rawCallback, x.xOnCurrentlyLoadingFrame) | |
| 244 | + | return func(IterVar *PixbufAnimationIter) bool { | |
| 245 | + | return rawCallback(IterVar.GoPointer()) | |
| 246 | + | } | |
| 247 | + | } | |
| 248 | + | ||
| 249 | + | // OverrideAdvance sets the callback function. | |
| 250 | + | func (x *PixbufAnimationIterClass) OverrideAdvance(cb func(*PixbufAnimationIter, *glib.TimeVal) bool) { | |
| 251 | + | if cb == nil { | |
| 252 | + | x.xAdvance = 0 | |
| 253 | + | } else { | |
| 254 | + | x.xAdvance = purego.NewCallback(func(IterVarp uintptr, CurrentTimeVarp *glib.TimeVal) bool { | |
| 255 | + | return cb(PixbufAnimationIterNewFromInternalPtr(IterVarp), CurrentTimeVarp) | |
| 256 | + | }) | |
| 257 | + | } | |
| 258 | + | } | |
| 259 | + | ||
| 260 | + | // GetAdvance gets the callback function. | |
| 261 | + | func (x *PixbufAnimationIterClass) GetAdvance() func(*PixbufAnimationIter, *glib.TimeVal) bool { | |
| 262 | + | if x.xAdvance == 0 { | |
| 263 | + | return nil | |
| 264 | + | } | |
| 265 | + | var rawCallback func(IterVarp uintptr, CurrentTimeVarp *glib.TimeVal) bool | |
| 266 | + | purego.RegisterFunc(&rawCallback, x.xAdvance) | |
| 267 | + | return func(IterVar *PixbufAnimationIter, CurrentTimeVar *glib.TimeVal) bool { | |
| 268 | + | return rawCallback(IterVar.GoPointer(), CurrentTimeVar) | |
| 269 | + | } | |
| 270 | + | } | |
| 271 | + | ||
| 42 | 272 | // An opaque object representing an animation. | |
| 43 | 273 | // | |
| 44 | 274 | // The GdkPixBuf library provides a simple mechanism to load and | |
M v4/gdkpixbuf/gdk-pixbuf-io.go +100 -0
| @@ -338,12 +338,112 @@ type PixbufModule struct { | |||
| 338 | 338 | SaveToCallback PixbufModuleSaveCallbackFunc | |
| 339 | 339 | ||
| 340 | 340 | IsSaveOptionSupported PixbufModuleSaveOptionSupportedFunc | |
| 341 | + | ||
| 342 | + | xReserved1 uintptr | |
| 343 | + | ||
| 344 | + | xReserved2 uintptr | |
| 345 | + | ||
| 346 | + | xReserved3 uintptr | |
| 347 | + | ||
| 348 | + | xReserved4 uintptr | |
| 341 | 349 | } | |
| 342 | 350 | ||
| 343 | 351 | func (x *PixbufModule) GoPointer() uintptr { | |
| 344 | 352 | return uintptr(unsafe.Pointer(x)) | |
| 345 | 353 | } | |
| 346 | 354 | ||
| 355 | + | // OverrideReserved1 sets the callback function. | |
| 356 | + | func (x *PixbufModule) OverrideReserved1(cb func()) { | |
| 357 | + | if cb == nil { | |
| 358 | + | x.xReserved1 = 0 | |
| 359 | + | } else { | |
| 360 | + | x.xReserved1 = purego.NewCallback(func() { | |
| 361 | + | cb() | |
| 362 | + | }) | |
| 363 | + | } | |
| 364 | + | } | |
| 365 | + | ||
| 366 | + | // GetReserved1 gets the callback function. | |
| 367 | + | func (x *PixbufModule) GetReserved1() func() { | |
| 368 | + | if x.xReserved1 == 0 { | |
| 369 | + | return nil | |
| 370 | + | } | |
| 371 | + | var rawCallback func() | |
| 372 | + | purego.RegisterFunc(&rawCallback, x.xReserved1) | |
| 373 | + | return func() { | |
| 374 | + | rawCallback() | |
| 375 | + | } | |
| 376 | + | } | |
| 377 | + | ||
| 378 | + | // OverrideReserved2 sets the callback function. | |
| 379 | + | func (x *PixbufModule) OverrideReserved2(cb func()) { | |
| 380 | + | if cb == nil { | |
| 381 | + | x.xReserved2 = 0 | |
| 382 | + | } else { | |
| 383 | + | x.xReserved2 = purego.NewCallback(func() { | |
| 384 | + | cb() | |
| 385 | + | }) | |
| 386 | + | } | |
| 387 | + | } | |
| 388 | + | ||
| 389 | + | // GetReserved2 gets the callback function. | |
| 390 | + | func (x *PixbufModule) GetReserved2() func() { | |
| 391 | + | if x.xReserved2 == 0 { | |
| 392 | + | return nil | |
| 393 | + | } | |
| 394 | + | var rawCallback func() | |
| 395 | + | purego.RegisterFunc(&rawCallback, x.xReserved2) | |
| 396 | + | return func() { | |
| 397 | + | rawCallback() | |
| 398 | + | } | |
| 399 | + | } | |
| 400 | + | ||
| 401 | + | // OverrideReserved3 sets the callback function. | |
| 402 | + | func (x *PixbufModule) OverrideReserved3(cb func()) { | |
| 403 | + | if cb == nil { | |
| 404 | + | x.xReserved3 = 0 | |
| 405 | + | } else { | |
| 406 | + | x.xReserved3 = purego.NewCallback(func() { | |
| 407 | + | cb() | |
| 408 | + | }) | |
| 409 | + | } | |
| 410 | + | } | |
| 411 | + | ||
| 412 | + | // GetReserved3 gets the callback function. | |
| 413 | + | func (x *PixbufModule) GetReserved3() func() { | |
| 414 | + | if x.xReserved3 == 0 { | |
| 415 | + | return nil | |
| 416 | + | } | |
| 417 | + | var rawCallback func() | |
| 418 | + | purego.RegisterFunc(&rawCallback, x.xReserved3) | |
| 419 | + | return func() { | |
| 420 | + | rawCallback() | |
| 421 | + | } | |
| 422 | + | } | |
| 423 | + | ||
| 424 | + | // OverrideReserved4 sets the callback function. | |
| 425 | + | func (x *PixbufModule) OverrideReserved4(cb func()) { | |
| 426 | + | if cb == nil { | |
| 427 | + | x.xReserved4 = 0 | |
| 428 | + | } else { | |
| 429 | + | x.xReserved4 = purego.NewCallback(func() { | |
| 430 | + | cb() | |
| 431 | + | }) | |
| 432 | + | } | |
| 433 | + | } | |
| 434 | + | ||
| 435 | + | // GetReserved4 gets the callback function. | |
| 436 | + | func (x *PixbufModule) GetReserved4() func() { | |
| 437 | + | if x.xReserved4 == 0 { | |
| 438 | + | return nil | |
| 439 | + | } | |
| 440 | + | var rawCallback func() | |
| 441 | + | purego.RegisterFunc(&rawCallback, x.xReserved4) | |
| 442 | + | return func() { | |
| 443 | + | rawCallback() | |
| 444 | + | } | |
| 445 | + | } | |
| 446 | + | ||
| 347 | 447 | // The signature prefix for a module. | |
| 348 | 448 | // | |
| 349 | 449 | // The signature of a module is a set of prefixes. Prefixes are encoded as | |
M v4/gdkpixbuf/gdk-pixbuf-loader.go +101 -1
| @@ -15,13 +15,113 @@ import ( | |||
| 15 | 15 | type PixbufLoaderClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xSizePrepared uintptr | |
| 21 | + | ||
| 22 | + | xAreaPrepared uintptr | |
| 23 | + | ||
| 24 | + | xAreaUpdated uintptr | |
| 25 | + | ||
| 26 | + | xClosed uintptr | |
| 19 | 27 | } | |
| 20 | 28 | ||
| 21 | 29 | func (x *PixbufLoaderClass) GoPointer() uintptr { | |
| 22 | 30 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 31 | } | |
| 24 | 32 | ||
| 33 | + | // OverrideSizePrepared sets the callback function. | |
| 34 | + | func (x *PixbufLoaderClass) OverrideSizePrepared(cb func(*PixbufLoader, int, int)) { | |
| 35 | + | if cb == nil { | |
| 36 | + | x.xSizePrepared = 0 | |
| 37 | + | } else { | |
| 38 | + | x.xSizePrepared = purego.NewCallback(func(LoaderVarp uintptr, WidthVarp int, HeightVarp int) { | |
| 39 | + | cb(PixbufLoaderNewFromInternalPtr(LoaderVarp), WidthVarp, HeightVarp) | |
| 40 | + | }) | |
| 41 | + | } | |
| 42 | + | } | |
| 43 | + | ||
| 44 | + | // GetSizePrepared gets the callback function. | |
| 45 | + | func (x *PixbufLoaderClass) GetSizePrepared() func(*PixbufLoader, int, int) { | |
| 46 | + | if x.xSizePrepared == 0 { | |
| 47 | + | return nil | |
| 48 | + | } | |
| 49 | + | var rawCallback func(LoaderVarp uintptr, WidthVarp int, HeightVarp int) | |
| 50 | + | purego.RegisterFunc(&rawCallback, x.xSizePrepared) | |
| 51 | + | return func(LoaderVar *PixbufLoader, WidthVar int, HeightVar int) { | |
| 52 | + | rawCallback(LoaderVar.GoPointer(), WidthVar, HeightVar) | |
| 53 | + | } | |
| 54 | + | } | |
| 55 | + | ||
| 56 | + | // OverrideAreaPrepared sets the callback function. | |
| 57 | + | func (x *PixbufLoaderClass) OverrideAreaPrepared(cb func(*PixbufLoader)) { | |
| 58 | + | if cb == nil { | |
| 59 | + | x.xAreaPrepared = 0 | |
| 60 | + | } else { | |
| 61 | + | x.xAreaPrepared = purego.NewCallback(func(LoaderVarp uintptr) { | |
| 62 | + | cb(PixbufLoaderNewFromInternalPtr(LoaderVarp)) | |
| 63 | + | }) | |
| 64 | + | } | |
| 65 | + | } | |
| 66 | + | ||
| 67 | + | // GetAreaPrepared gets the callback function. | |
| 68 | + | func (x *PixbufLoaderClass) GetAreaPrepared() func(*PixbufLoader) { | |
| 69 | + | if x.xAreaPrepared == 0 { | |
| 70 | + | return nil | |
| 71 | + | } | |
| 72 | + | var rawCallback func(LoaderVarp uintptr) | |
| 73 | + | purego.RegisterFunc(&rawCallback, x.xAreaPrepared) | |
| 74 | + | return func(LoaderVar *PixbufLoader) { | |
| 75 | + | rawCallback(LoaderVar.GoPointer()) | |
| 76 | + | } | |
| 77 | + | } | |
| 78 | + | ||
| 79 | + | // OverrideAreaUpdated sets the callback function. | |
| 80 | + | func (x *PixbufLoaderClass) OverrideAreaUpdated(cb func(*PixbufLoader, int, int, int, int)) { | |
| 81 | + | if cb == nil { | |
| 82 | + | x.xAreaUpdated = 0 | |
| 83 | + | } else { | |
| 84 | + | x.xAreaUpdated = purego.NewCallback(func(LoaderVarp uintptr, XVarp int, YVarp int, WidthVarp int, HeightVarp int) { | |
| 85 | + | cb(PixbufLoaderNewFromInternalPtr(LoaderVarp), XVarp, YVarp, WidthVarp, HeightVarp) | |
| 86 | + | }) | |
| 87 | + | } | |
| 88 | + | } | |
| 89 | + | ||
| 90 | + | // GetAreaUpdated gets the callback function. | |
| 91 | + | func (x *PixbufLoaderClass) GetAreaUpdated() func(*PixbufLoader, int, int, int, int) { | |
| 92 | + | if x.xAreaUpdated == 0 { | |
| 93 | + | return nil | |
| 94 | + | } | |
| 95 | + | var rawCallback func(LoaderVarp uintptr, XVarp int, YVarp int, WidthVarp int, HeightVarp int) | |
| 96 | + | purego.RegisterFunc(&rawCallback, x.xAreaUpdated) | |
| 97 | + | return func(LoaderVar *PixbufLoader, XVar int, YVar int, WidthVar int, HeightVar int) { | |
| 98 | + | rawCallback(LoaderVar.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 99 | + | } | |
| 100 | + | } | |
| 101 | + | ||
| 102 | + | // OverrideClosed sets the callback function. | |
| 103 | + | func (x *PixbufLoaderClass) OverrideClosed(cb func(*PixbufLoader)) { | |
| 104 | + | if cb == nil { | |
| 105 | + | x.xClosed = 0 | |
| 106 | + | } else { | |
| 107 | + | x.xClosed = purego.NewCallback(func(LoaderVarp uintptr) { | |
| 108 | + | cb(PixbufLoaderNewFromInternalPtr(LoaderVarp)) | |
| 109 | + | }) | |
| 110 | + | } | |
| 111 | + | } | |
| 112 | + | ||
| 113 | + | // GetClosed gets the callback function. | |
| 114 | + | func (x *PixbufLoaderClass) GetClosed() func(*PixbufLoader) { | |
| 115 | + | if x.xClosed == 0 { | |
| 116 | + | return nil | |
| 117 | + | } | |
| 118 | + | var rawCallback func(LoaderVarp uintptr) | |
| 119 | + | purego.RegisterFunc(&rawCallback, x.xClosed) | |
| 120 | + | return func(LoaderVar *PixbufLoader) { | |
| 121 | + | rawCallback(LoaderVar.GoPointer()) | |
| 122 | + | } | |
| 123 | + | } | |
| 124 | + | ||
| 25 | 125 | // Incremental image loader. | |
| 26 | 126 | // | |
| 27 | 127 | // `GdkPixbufLoader` provides a way for applications to drive the | |
M v4/gio/gaction.go +200 -0
| @@ -16,12 +16,212 @@ type ActionInterface struct { | |||
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | 18 | GIface uintptr | |
| 19 | + | ||
| 20 | + | xGetName uintptr | |
| 21 | + | ||
| 22 | + | xGetParameterType uintptr | |
| 23 | + | ||
| 24 | + | xGetStateType uintptr | |
| 25 | + | ||
| 26 | + | xGetStateHint uintptr | |
| 27 | + | ||
| 28 | + | xGetEnabled uintptr | |
| 29 | + | ||
| 30 | + | xGetState uintptr | |
| 31 | + | ||
| 32 | + | xChangeState uintptr | |
| 33 | + | ||
| 34 | + | xActivate uintptr | |
| 19 | 35 | } | |
| 20 | 36 | ||
| 21 | 37 | func (x *ActionInterface) GoPointer() uintptr { | |
| 22 | 38 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 39 | } | |
| 24 | 40 | ||
| 41 | + | // OverrideGetName sets the callback function. | |
| 42 | + | func (x *ActionInterface) OverrideGetName(cb func(Action) string) { | |
| 43 | + | if cb == nil { | |
| 44 | + | x.xGetName = 0 | |
| 45 | + | } else { | |
| 46 | + | x.xGetName = purego.NewCallback(func(ActionVarp uintptr) string { | |
| 47 | + | return cb(&ActionBase{Ptr: ActionVarp}) | |
| 48 | + | }) | |
| 49 | + | } | |
| 50 | + | } | |
| 51 | + | ||
| 52 | + | // GetGetName gets the callback function. | |
| 53 | + | func (x *ActionInterface) GetGetName() func(Action) string { | |
| 54 | + | if x.xGetName == 0 { | |
| 55 | + | return nil | |
| 56 | + | } | |
| 57 | + | var rawCallback func(ActionVarp uintptr) string | |
| 58 | + | purego.RegisterFunc(&rawCallback, x.xGetName) | |
| 59 | + | return func(ActionVar Action) string { | |
| 60 | + | return rawCallback(ActionVar.GoPointer()) | |
| 61 | + | } | |
| 62 | + | } | |
| 63 | + | ||
| 64 | + | // OverrideGetParameterType sets the callback function. | |
| 65 | + | func (x *ActionInterface) OverrideGetParameterType(cb func(Action) *glib.VariantType) { | |
| 66 | + | if cb == nil { | |
| 67 | + | x.xGetParameterType = 0 | |
| 68 | + | } else { | |
| 69 | + | x.xGetParameterType = purego.NewCallback(func(ActionVarp uintptr) *glib.VariantType { | |
| 70 | + | return cb(&ActionBase{Ptr: ActionVarp}) | |
| 71 | + | }) | |
| 72 | + | } | |
| 73 | + | } | |
| 74 | + | ||
| 75 | + | // GetGetParameterType gets the callback function. | |
| 76 | + | func (x *ActionInterface) GetGetParameterType() func(Action) *glib.VariantType { | |
| 77 | + | if x.xGetParameterType == 0 { | |
| 78 | + | return nil | |
| 79 | + | } | |
| 80 | + | var rawCallback func(ActionVarp uintptr) *glib.VariantType | |
| 81 | + | purego.RegisterFunc(&rawCallback, x.xGetParameterType) | |
| 82 | + | return func(ActionVar Action) *glib.VariantType { | |
| 83 | + | return rawCallback(ActionVar.GoPointer()) | |
| 84 | + | } | |
| 85 | + | } | |
| 86 | + | ||
| 87 | + | // OverrideGetStateType sets the callback function. | |
| 88 | + | func (x *ActionInterface) OverrideGetStateType(cb func(Action) *glib.VariantType) { | |
| 89 | + | if cb == nil { | |
| 90 | + | x.xGetStateType = 0 | |
| 91 | + | } else { | |
| 92 | + | x.xGetStateType = purego.NewCallback(func(ActionVarp uintptr) *glib.VariantType { | |
| 93 | + | return cb(&ActionBase{Ptr: ActionVarp}) | |
| 94 | + | }) | |
| 95 | + | } | |
| 96 | + | } | |
| 97 | + | ||
| 98 | + | // GetGetStateType gets the callback function. | |
| 99 | + | func (x *ActionInterface) GetGetStateType() func(Action) *glib.VariantType { | |
| 100 | + | if x.xGetStateType == 0 { | |
| 101 | + | return nil | |
| 102 | + | } | |
| 103 | + | var rawCallback func(ActionVarp uintptr) *glib.VariantType | |
| 104 | + | purego.RegisterFunc(&rawCallback, x.xGetStateType) | |
| 105 | + | return func(ActionVar Action) *glib.VariantType { | |
| 106 | + | return rawCallback(ActionVar.GoPointer()) | |
| 107 | + | } | |
| 108 | + | } | |
| 109 | + | ||
| 110 | + | // OverrideGetStateHint sets the callback function. | |
| 111 | + | func (x *ActionInterface) OverrideGetStateHint(cb func(Action) *glib.Variant) { | |
| 112 | + | if cb == nil { | |
| 113 | + | x.xGetStateHint = 0 | |
| 114 | + | } else { | |
| 115 | + | x.xGetStateHint = purego.NewCallback(func(ActionVarp uintptr) *glib.Variant { | |
| 116 | + | return cb(&ActionBase{Ptr: ActionVarp}) | |
| 117 | + | }) | |
| 118 | + | } | |
| 119 | + | } | |
| 120 | + | ||
| 121 | + | // GetGetStateHint gets the callback function. | |
| 122 | + | func (x *ActionInterface) GetGetStateHint() func(Action) *glib.Variant { | |
| 123 | + | if x.xGetStateHint == 0 { | |
| 124 | + | return nil | |
| 125 | + | } | |
| 126 | + | var rawCallback func(ActionVarp uintptr) *glib.Variant | |
| 127 | + | purego.RegisterFunc(&rawCallback, x.xGetStateHint) | |
| 128 | + | return func(ActionVar Action) *glib.Variant { | |
| 129 | + | return rawCallback(ActionVar.GoPointer()) | |
| 130 | + | } | |
| 131 | + | } | |
| 132 | + | ||
| 133 | + | // OverrideGetEnabled sets the callback function. | |
| 134 | + | func (x *ActionInterface) OverrideGetEnabled(cb func(Action) bool) { | |
| 135 | + | if cb == nil { | |
| 136 | + | x.xGetEnabled = 0 | |
| 137 | + | } else { | |
| 138 | + | x.xGetEnabled = purego.NewCallback(func(ActionVarp uintptr) bool { | |
| 139 | + | return cb(&ActionBase{Ptr: ActionVarp}) | |
| 140 | + | }) | |
| 141 | + | } | |
| 142 | + | } | |
| 143 | + | ||
| 144 | + | // GetGetEnabled gets the callback function. | |
| 145 | + | func (x *ActionInterface) GetGetEnabled() func(Action) bool { | |
| 146 | + | if x.xGetEnabled == 0 { | |
| 147 | + | return nil | |
| 148 | + | } | |
| 149 | + | var rawCallback func(ActionVarp uintptr) bool | |
| 150 | + | purego.RegisterFunc(&rawCallback, x.xGetEnabled) | |
| 151 | + | return func(ActionVar Action) bool { | |
| 152 | + | return rawCallback(ActionVar.GoPointer()) | |
| 153 | + | } | |
| 154 | + | } | |
| 155 | + | ||
| 156 | + | // OverrideGetState sets the callback function. | |
| 157 | + | func (x *ActionInterface) OverrideGetState(cb func(Action) *glib.Variant) { | |
| 158 | + | if cb == nil { | |
| 159 | + | x.xGetState = 0 | |
| 160 | + | } else { | |
| 161 | + | x.xGetState = purego.NewCallback(func(ActionVarp uintptr) *glib.Variant { | |
| 162 | + | return cb(&ActionBase{Ptr: ActionVarp}) | |
| 163 | + | }) | |
| 164 | + | } | |
| 165 | + | } | |
| 166 | + | ||
| 167 | + | // GetGetState gets the callback function. | |
| 168 | + | func (x *ActionInterface) GetGetState() func(Action) *glib.Variant { | |
| 169 | + | if x.xGetState == 0 { | |
| 170 | + | return nil | |
| 171 | + | } | |
| 172 | + | var rawCallback func(ActionVarp uintptr) *glib.Variant | |
| 173 | + | purego.RegisterFunc(&rawCallback, x.xGetState) | |
| 174 | + | return func(ActionVar Action) *glib.Variant { | |
| 175 | + | return rawCallback(ActionVar.GoPointer()) | |
| 176 | + | } | |
| 177 | + | } | |
| 178 | + | ||
| 179 | + | // OverrideChangeState sets the callback function. | |
| 180 | + | func (x *ActionInterface) OverrideChangeState(cb func(Action, *glib.Variant)) { | |
| 181 | + | if cb == nil { | |
| 182 | + | x.xChangeState = 0 | |
| 183 | + | } else { | |
| 184 | + | x.xChangeState = purego.NewCallback(func(ActionVarp uintptr, ValueVarp *glib.Variant) { | |
| 185 | + | cb(&ActionBase{Ptr: ActionVarp}, ValueVarp) | |
| 186 | + | }) | |
| 187 | + | } | |
| 188 | + | } | |
| 189 | + | ||
| 190 | + | // GetChangeState gets the callback function. | |
| 191 | + | func (x *ActionInterface) GetChangeState() func(Action, *glib.Variant) { | |
| 192 | + | if x.xChangeState == 0 { | |
| 193 | + | return nil | |
| 194 | + | } | |
| 195 | + | var rawCallback func(ActionVarp uintptr, ValueVarp *glib.Variant) | |
| 196 | + | purego.RegisterFunc(&rawCallback, x.xChangeState) | |
| 197 | + | return func(ActionVar Action, ValueVar *glib.Variant) { | |
| 198 | + | rawCallback(ActionVar.GoPointer(), ValueVar) | |
| 199 | + | } | |
| 200 | + | } | |
| 201 | + | ||
| 202 | + | // OverrideActivate sets the callback function. | |
| 203 | + | func (x *ActionInterface) OverrideActivate(cb func(Action, *glib.Variant)) { | |
| 204 | + | if cb == nil { | |
| 205 | + | x.xActivate = 0 | |
| 206 | + | } else { | |
| 207 | + | x.xActivate = purego.NewCallback(func(ActionVarp uintptr, ParameterVarp *glib.Variant) { | |
| 208 | + | cb(&ActionBase{Ptr: ActionVarp}, ParameterVarp) | |
| 209 | + | }) | |
| 210 | + | } | |
| 211 | + | } | |
| 212 | + | ||
| 213 | + | // GetActivate gets the callback function. | |
| 214 | + | func (x *ActionInterface) GetActivate() func(Action, *glib.Variant) { | |
| 215 | + | if x.xActivate == 0 { | |
| 216 | + | return nil | |
| 217 | + | } | |
| 218 | + | var rawCallback func(ActionVarp uintptr, ParameterVarp *glib.Variant) | |
| 219 | + | purego.RegisterFunc(&rawCallback, x.xActivate) | |
| 220 | + | return func(ActionVar Action, ParameterVar *glib.Variant) { | |
| 221 | + | rawCallback(ActionVar.GoPointer(), ParameterVar) | |
| 222 | + | } | |
| 223 | + | } | |
| 224 | + | ||
| 25 | 225 | // #GAction represents a single named action. | |
| 26 | 226 | // | |
| 27 | 227 | // The main interface to an action is that it can be activated with | |
M v4/gio/gactiongroup.go +350 -0
| @@ -16,12 +16,362 @@ type ActionGroupInterface struct { | |||
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | 18 | GIface uintptr | |
| 19 | + | ||
| 20 | + | xHasAction uintptr | |
| 21 | + | ||
| 22 | + | xListActions uintptr | |
| 23 | + | ||
| 24 | + | xGetActionEnabled uintptr | |
| 25 | + | ||
| 26 | + | xGetActionParameterType uintptr | |
| 27 | + | ||
| 28 | + | xGetActionStateType uintptr | |
| 29 | + | ||
| 30 | + | xGetActionStateHint uintptr | |
| 31 | + | ||
| 32 | + | xGetActionState uintptr | |
| 33 | + | ||
| 34 | + | xChangeActionState uintptr | |
| 35 | + | ||
| 36 | + | xActivateAction uintptr | |
| 37 | + | ||
| 38 | + | xActionAdded uintptr | |
| 39 | + | ||
| 40 | + | xActionRemoved uintptr | |
| 41 | + | ||
| 42 | + | xActionEnabledChanged uintptr | |
| 43 | + | ||
| 44 | + | xActionStateChanged uintptr | |
| 45 | + | ||
| 46 | + | xQueryAction uintptr | |
| 19 | 47 | } | |
| 20 | 48 | ||
| 21 | 49 | func (x *ActionGroupInterface) GoPointer() uintptr { | |
| 22 | 50 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 51 | } | |
| 24 | 52 | ||
| 53 | + | // OverrideHasAction sets the callback function. | |
| 54 | + | func (x *ActionGroupInterface) OverrideHasAction(cb func(ActionGroup, string) bool) { | |
| 55 | + | if cb == nil { | |
| 56 | + | x.xHasAction = 0 | |
| 57 | + | } else { | |
| 58 | + | x.xHasAction = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string) bool { | |
| 59 | + | return cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp) | |
| 60 | + | }) | |
| 61 | + | } | |
| 62 | + | } | |
| 63 | + | ||
| 64 | + | // GetHasAction gets the callback function. | |
| 65 | + | func (x *ActionGroupInterface) GetHasAction() func(ActionGroup, string) bool { | |
| 66 | + | if x.xHasAction == 0 { | |
| 67 | + | return nil | |
| 68 | + | } | |
| 69 | + | var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string) bool | |
| 70 | + | purego.RegisterFunc(&rawCallback, x.xHasAction) | |
| 71 | + | return func(ActionGroupVar ActionGroup, ActionNameVar string) bool { | |
| 72 | + | return rawCallback(ActionGroupVar.GoPointer(), ActionNameVar) | |
| 73 | + | } | |
| 74 | + | } | |
| 75 | + | ||
| 76 | + | // OverrideListActions sets the callback function. | |
| 77 | + | func (x *ActionGroupInterface) OverrideListActions(cb func(ActionGroup) []string) { | |
| 78 | + | if cb == nil { | |
| 79 | + | x.xListActions = 0 | |
| 80 | + | } else { | |
| 81 | + | x.xListActions = purego.NewCallback(func(ActionGroupVarp uintptr) []string { | |
| 82 | + | return cb(&ActionGroupBase{Ptr: ActionGroupVarp}) | |
| 83 | + | }) | |
| 84 | + | } | |
| 85 | + | } | |
| 86 | + | ||
| 87 | + | // GetListActions gets the callback function. | |
| 88 | + | func (x *ActionGroupInterface) GetListActions() func(ActionGroup) []string { | |
| 89 | + | if x.xListActions == 0 { | |
| 90 | + | return nil | |
| 91 | + | } | |
| 92 | + | var rawCallback func(ActionGroupVarp uintptr) []string | |
| 93 | + | purego.RegisterFunc(&rawCallback, x.xListActions) | |
| 94 | + | return func(ActionGroupVar ActionGroup) []string { | |
| 95 | + | return rawCallback(ActionGroupVar.GoPointer()) | |
| 96 | + | } | |
| 97 | + | } | |
| 98 | + | ||
| 99 | + | // OverrideGetActionEnabled sets the callback function. | |
| 100 | + | func (x *ActionGroupInterface) OverrideGetActionEnabled(cb func(ActionGroup, string) bool) { | |
| 101 | + | if cb == nil { | |
| 102 | + | x.xGetActionEnabled = 0 | |
| 103 | + | } else { | |
| 104 | + | x.xGetActionEnabled = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string) bool { | |
| 105 | + | return cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp) | |
| 106 | + | }) | |
| 107 | + | } | |
| 108 | + | } | |
| 109 | + | ||
| 110 | + | // GetGetActionEnabled gets the callback function. | |
| 111 | + | func (x *ActionGroupInterface) GetGetActionEnabled() func(ActionGroup, string) bool { | |
| 112 | + | if x.xGetActionEnabled == 0 { | |
| 113 | + | return nil | |
| 114 | + | } | |
| 115 | + | var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string) bool | |
| 116 | + | purego.RegisterFunc(&rawCallback, x.xGetActionEnabled) | |
| 117 | + | return func(ActionGroupVar ActionGroup, ActionNameVar string) bool { | |
| 118 | + | return rawCallback(ActionGroupVar.GoPointer(), ActionNameVar) | |
| 119 | + | } | |
| 120 | + | } | |
| 121 | + | ||
| 122 | + | // OverrideGetActionParameterType sets the callback function. | |
| 123 | + | func (x *ActionGroupInterface) OverrideGetActionParameterType(cb func(ActionGroup, string) *glib.VariantType) { | |
| 124 | + | if cb == nil { | |
| 125 | + | x.xGetActionParameterType = 0 | |
| 126 | + | } else { | |
| 127 | + | x.xGetActionParameterType = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string) *glib.VariantType { | |
| 128 | + | return cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp) | |
| 129 | + | }) | |
| 130 | + | } | |
| 131 | + | } | |
| 132 | + | ||
| 133 | + | // GetGetActionParameterType gets the callback function. | |
| 134 | + | func (x *ActionGroupInterface) GetGetActionParameterType() func(ActionGroup, string) *glib.VariantType { | |
| 135 | + | if x.xGetActionParameterType == 0 { | |
| 136 | + | return nil | |
| 137 | + | } | |
| 138 | + | var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string) *glib.VariantType | |
| 139 | + | purego.RegisterFunc(&rawCallback, x.xGetActionParameterType) | |
| 140 | + | return func(ActionGroupVar ActionGroup, ActionNameVar string) *glib.VariantType { | |
| 141 | + | return rawCallback(ActionGroupVar.GoPointer(), ActionNameVar) | |
| 142 | + | } | |
| 143 | + | } | |
| 144 | + | ||
| 145 | + | // OverrideGetActionStateType sets the callback function. | |
| 146 | + | func (x *ActionGroupInterface) OverrideGetActionStateType(cb func(ActionGroup, string) *glib.VariantType) { | |
| 147 | + | if cb == nil { | |
| 148 | + | x.xGetActionStateType = 0 | |
| 149 | + | } else { | |
| 150 | + | x.xGetActionStateType = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string) *glib.VariantType { | |
| 151 | + | return cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp) | |
| 152 | + | }) | |
| 153 | + | } | |
| 154 | + | } | |
| 155 | + | ||
| 156 | + | // GetGetActionStateType gets the callback function. | |
| 157 | + | func (x *ActionGroupInterface) GetGetActionStateType() func(ActionGroup, string) *glib.VariantType { | |
| 158 | + | if x.xGetActionStateType == 0 { | |
| 159 | + | return nil | |
| 160 | + | } | |
| 161 | + | var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string) *glib.VariantType | |
| 162 | + | purego.RegisterFunc(&rawCallback, x.xGetActionStateType) | |
| 163 | + | return func(ActionGroupVar ActionGroup, ActionNameVar string) *glib.VariantType { | |
| 164 | + | return rawCallback(ActionGroupVar.GoPointer(), ActionNameVar) | |
| 165 | + | } | |
| 166 | + | } | |
| 167 | + | ||
| 168 | + | // OverrideGetActionStateHint sets the callback function. | |
| 169 | + | func (x *ActionGroupInterface) OverrideGetActionStateHint(cb func(ActionGroup, string) *glib.Variant) { | |
| 170 | + | if cb == nil { | |
| 171 | + | x.xGetActionStateHint = 0 | |
| 172 | + | } else { | |
| 173 | + | x.xGetActionStateHint = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string) *glib.Variant { | |
| 174 | + | return cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp) | |
| 175 | + | }) | |
| 176 | + | } | |
| 177 | + | } | |
| 178 | + | ||
| 179 | + | // GetGetActionStateHint gets the callback function. | |
| 180 | + | func (x *ActionGroupInterface) GetGetActionStateHint() func(ActionGroup, string) *glib.Variant { | |
| 181 | + | if x.xGetActionStateHint == 0 { | |
| 182 | + | return nil | |
| 183 | + | } | |
| 184 | + | var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string) *glib.Variant | |
| 185 | + | purego.RegisterFunc(&rawCallback, x.xGetActionStateHint) | |
| 186 | + | return func(ActionGroupVar ActionGroup, ActionNameVar string) *glib.Variant { | |
| 187 | + | return rawCallback(ActionGroupVar.GoPointer(), ActionNameVar) | |
| 188 | + | } | |
| 189 | + | } | |
| 190 | + | ||
| 191 | + | // OverrideGetActionState sets the callback function. | |
| 192 | + | func (x *ActionGroupInterface) OverrideGetActionState(cb func(ActionGroup, string) *glib.Variant) { | |
| 193 | + | if cb == nil { | |
| 194 | + | x.xGetActionState = 0 | |
| 195 | + | } else { | |
| 196 | + | x.xGetActionState = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string) *glib.Variant { | |
| 197 | + | return cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp) | |
| 198 | + | }) | |
| 199 | + | } | |
| 200 | + | } | |
| 201 | + | ||
| 202 | + | // GetGetActionState gets the callback function. | |
| 203 | + | func (x *ActionGroupInterface) GetGetActionState() func(ActionGroup, string) *glib.Variant { | |
| 204 | + | if x.xGetActionState == 0 { | |
| 205 | + | return nil | |
| 206 | + | } | |
| 207 | + | var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string) *glib.Variant | |
| 208 | + | purego.RegisterFunc(&rawCallback, x.xGetActionState) | |
| 209 | + | return func(ActionGroupVar ActionGroup, ActionNameVar string) *glib.Variant { | |
| 210 | + | return rawCallback(ActionGroupVar.GoPointer(), ActionNameVar) | |
| 211 | + | } | |
| 212 | + | } | |
| 213 | + | ||
| 214 | + | // OverrideChangeActionState sets the callback function. | |
| 215 | + | func (x *ActionGroupInterface) OverrideChangeActionState(cb func(ActionGroup, string, *glib.Variant)) { | |
| 216 | + | if cb == nil { | |
| 217 | + | x.xChangeActionState = 0 | |
| 218 | + | } else { | |
| 219 | + | x.xChangeActionState = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string, ValueVarp *glib.Variant) { | |
| 220 | + | cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp, ValueVarp) | |
| 221 | + | }) | |
| 222 | + | } | |
| 223 | + | } | |
| 224 | + | ||
| 225 | + | // GetChangeActionState gets the callback function. | |
| 226 | + | func (x *ActionGroupInterface) GetChangeActionState() func(ActionGroup, string, *glib.Variant) { | |
| 227 | + | if x.xChangeActionState == 0 { | |
| 228 | + | return nil | |
| 229 | + | } | |
| 230 | + | var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string, ValueVarp *glib.Variant) | |
| 231 | + | purego.RegisterFunc(&rawCallback, x.xChangeActionState) | |
| 232 | + | return func(ActionGroupVar ActionGroup, ActionNameVar string, ValueVar *glib.Variant) { | |
| 233 | + | rawCallback(ActionGroupVar.GoPointer(), ActionNameVar, ValueVar) | |
| 234 | + | } | |
| 235 | + | } | |
| 236 | + | ||
| 237 | + | // OverrideActivateAction sets the callback function. | |
| 238 | + | func (x *ActionGroupInterface) OverrideActivateAction(cb func(ActionGroup, string, *glib.Variant)) { | |
| 239 | + | if cb == nil { | |
| 240 | + | x.xActivateAction = 0 | |
| 241 | + | } else { | |
| 242 | + | x.xActivateAction = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string, ParameterVarp *glib.Variant) { | |
| 243 | + | cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp, ParameterVarp) | |
| 244 | + | }) | |
| 245 | + | } | |
| 246 | + | } | |
| 247 | + | ||
| 248 | + | // GetActivateAction gets the callback function. | |
| 249 | + | func (x *ActionGroupInterface) GetActivateAction() func(ActionGroup, string, *glib.Variant) { | |
| 250 | + | if x.xActivateAction == 0 { | |
| 251 | + | return nil | |
| 252 | + | } | |
| 253 | + | var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string, ParameterVarp *glib.Variant) | |
| 254 | + | purego.RegisterFunc(&rawCallback, x.xActivateAction) | |
| 255 | + | return func(ActionGroupVar ActionGroup, ActionNameVar string, ParameterVar *glib.Variant) { | |
| 256 | + | rawCallback(ActionGroupVar.GoPointer(), ActionNameVar, ParameterVar) | |
| 257 | + | } | |
| 258 | + | } | |
| 259 | + | ||
| 260 | + | // OverrideActionAdded sets the callback function. | |
| 261 | + | func (x *ActionGroupInterface) OverrideActionAdded(cb func(ActionGroup, string)) { | |
| 262 | + | if cb == nil { | |
| 263 | + | x.xActionAdded = 0 | |
| 264 | + | } else { | |
| 265 | + | x.xActionAdded = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string) { | |
| 266 | + | cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp) | |
| 267 | + | }) | |
| 268 | + | } | |
| 269 | + | } | |
| 270 | + | ||
| 271 | + | // GetActionAdded gets the callback function. | |
| 272 | + | func (x *ActionGroupInterface) GetActionAdded() func(ActionGroup, string) { | |
| 273 | + | if x.xActionAdded == 0 { | |
| 274 | + | return nil | |
| 275 | + | } | |
| 276 | + | var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string) | |
| 277 | + | purego.RegisterFunc(&rawCallback, x.xActionAdded) | |
| 278 | + | return func(ActionGroupVar ActionGroup, ActionNameVar string) { | |
| 279 | + | rawCallback(ActionGroupVar.GoPointer(), ActionNameVar) | |
| 280 | + | } | |
| 281 | + | } | |
| 282 | + | ||
| 283 | + | // OverrideActionRemoved sets the callback function. | |
| 284 | + | func (x *ActionGroupInterface) OverrideActionRemoved(cb func(ActionGroup, string)) { | |
| 285 | + | if cb == nil { | |
| 286 | + | x.xActionRemoved = 0 | |
| 287 | + | } else { | |
| 288 | + | x.xActionRemoved = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string) { | |
| 289 | + | cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp) | |
| 290 | + | }) | |
| 291 | + | } | |
| 292 | + | } | |
| 293 | + | ||
| 294 | + | // GetActionRemoved gets the callback function. | |
| 295 | + | func (x *ActionGroupInterface) GetActionRemoved() func(ActionGroup, string) { | |
| 296 | + | if x.xActionRemoved == 0 { | |
| 297 | + | return nil | |
| 298 | + | } | |
| 299 | + | var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string) | |
| 300 | + | purego.RegisterFunc(&rawCallback, x.xActionRemoved) | |
| 301 | + | return func(ActionGroupVar ActionGroup, ActionNameVar string) { | |
| 302 | + | rawCallback(ActionGroupVar.GoPointer(), ActionNameVar) | |
| 303 | + | } | |
| 304 | + | } | |
| 305 | + | ||
| 306 | + | // OverrideActionEnabledChanged sets the callback function. | |
| 307 | + | func (x *ActionGroupInterface) OverrideActionEnabledChanged(cb func(ActionGroup, string, bool)) { | |
| 308 | + | if cb == nil { | |
| 309 | + | x.xActionEnabledChanged = 0 | |
| 310 | + | } else { | |
| 311 | + | x.xActionEnabledChanged = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string, EnabledVarp bool) { | |
| 312 | + | cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp, EnabledVarp) | |
| 313 | + | }) | |
| 314 | + | } | |
| 315 | + | } | |
| 316 | + | ||
| 317 | + | // GetActionEnabledChanged gets the callback function. | |
| 318 | + | func (x *ActionGroupInterface) GetActionEnabledChanged() func(ActionGroup, string, bool) { | |
| 319 | + | if x.xActionEnabledChanged == 0 { | |
| 320 | + | return nil | |
| 321 | + | } | |
| 322 | + | var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string, EnabledVarp bool) | |
| 323 | + | purego.RegisterFunc(&rawCallback, x.xActionEnabledChanged) | |
| 324 | + | return func(ActionGroupVar ActionGroup, ActionNameVar string, EnabledVar bool) { | |
| 325 | + | rawCallback(ActionGroupVar.GoPointer(), ActionNameVar, EnabledVar) | |
| 326 | + | } | |
| 327 | + | } | |
| 328 | + | ||
| 329 | + | // OverrideActionStateChanged sets the callback function. | |
| 330 | + | func (x *ActionGroupInterface) OverrideActionStateChanged(cb func(ActionGroup, string, *glib.Variant)) { | |
| 331 | + | if cb == nil { | |
| 332 | + | x.xActionStateChanged = 0 | |
| 333 | + | } else { | |
| 334 | + | x.xActionStateChanged = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string, StateVarp *glib.Variant) { | |
| 335 | + | cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp, StateVarp) | |
| 336 | + | }) | |
| 337 | + | } | |
| 338 | + | } | |
| 339 | + | ||
| 340 | + | // GetActionStateChanged gets the callback function. | |
| 341 | + | func (x *ActionGroupInterface) GetActionStateChanged() func(ActionGroup, string, *glib.Variant) { | |
| 342 | + | if x.xActionStateChanged == 0 { | |
| 343 | + | return nil | |
| 344 | + | } | |
| 345 | + | var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string, StateVarp *glib.Variant) | |
| 346 | + | purego.RegisterFunc(&rawCallback, x.xActionStateChanged) | |
| 347 | + | return func(ActionGroupVar ActionGroup, ActionNameVar string, StateVar *glib.Variant) { | |
| 348 | + | rawCallback(ActionGroupVar.GoPointer(), ActionNameVar, StateVar) | |
| 349 | + | } | |
| 350 | + | } | |
| 351 | + | ||
| 352 | + | // OverrideQueryAction sets the callback function. | |
| 353 | + | func (x *ActionGroupInterface) OverrideQueryAction(cb func(ActionGroup, string, bool, **glib.VariantType, **glib.VariantType, **glib.Variant, **glib.Variant) bool) { | |
| 354 | + | if cb == nil { | |
| 355 | + | x.xQueryAction = 0 | |
| 356 | + | } else { | |
| 357 | + | x.xQueryAction = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string, EnabledVarp bool, ParameterTypeVarp **glib.VariantType, StateTypeVarp **glib.VariantType, StateHintVarp **glib.Variant, StateVarp **glib.Variant) bool { | |
| 358 | + | return cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp, EnabledVarp, ParameterTypeVarp, StateTypeVarp, StateHintVarp, StateVarp) | |
| 359 | + | }) | |
| 360 | + | } | |
| 361 | + | } | |
| 362 | + | ||
| 363 | + | // GetQueryAction gets the callback function. | |
| 364 | + | func (x *ActionGroupInterface) GetQueryAction() func(ActionGroup, string, bool, **glib.VariantType, **glib.VariantType, **glib.Variant, **glib.Variant) bool { | |
| 365 | + | if x.xQueryAction == 0 { | |
| 366 | + | return nil | |
| 367 | + | } | |
| 368 | + | var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string, EnabledVarp bool, ParameterTypeVarp **glib.VariantType, StateTypeVarp **glib.VariantType, StateHintVarp **glib.Variant, StateVarp **glib.Variant) bool | |
| 369 | + | purego.RegisterFunc(&rawCallback, x.xQueryAction) | |
| 370 | + | return func(ActionGroupVar ActionGroup, ActionNameVar string, EnabledVar bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool { | |
| 371 | + | return rawCallback(ActionGroupVar.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) | |
| 372 | + | } | |
| 373 | + | } | |
| 374 | + | ||
| 25 | 375 | // #GActionGroup represents a group of actions. Actions can be used to | |
| 26 | 376 | // expose functionality in a structured way, either from one part of a | |
| 27 | 377 | // program to another, or to the outside world. Action groups are often | |
M v4/gio/gactionmap.go +136 -0
| @@ -7,6 +7,7 @@ import ( | |||
| 7 | 7 | ||
| 8 | 8 | "github.com/jwijenbergh/purego" | |
| 9 | 9 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 10 | 11 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 11 | 12 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 12 | 13 | ) | |
| @@ -26,10 +27,14 @@ type ActionEntry struct { | |||
| 26 | 27 | ||
| 27 | 28 | Name uintptr | |
| 28 | 29 | ||
| 30 | + | xActivate uintptr | |
| 31 | + | ||
| 29 | 32 | ParameterType uintptr | |
| 30 | 33 | ||
| 31 | 34 | State uintptr | |
| 32 | 35 | ||
| 36 | + | xChangeState uintptr | |
| 37 | + | ||
| 33 | 38 | Padding [3]uint | |
| 34 | 39 | } | |
| 35 | 40 | ||
| @@ -37,17 +42,148 @@ func (x *ActionEntry) GoPointer() uintptr { | |||
| 37 | 42 | return uintptr(unsafe.Pointer(x)) | |
| 38 | 43 | } | |
| 39 | 44 | ||
| 45 | + | // OverrideActivate sets the callback function. | |
| 46 | + | func (x *ActionEntry) OverrideActivate(cb func(*SimpleAction, *glib.Variant, uintptr)) { | |
| 47 | + | if cb == nil { | |
| 48 | + | x.xActivate = 0 | |
| 49 | + | } else { | |
| 50 | + | x.xActivate = purego.NewCallback(func(ActionVarp uintptr, ParameterVarp *glib.Variant, UserDataVarp uintptr) { | |
| 51 | + | cb(SimpleActionNewFromInternalPtr(ActionVarp), ParameterVarp, UserDataVarp) | |
| 52 | + | }) | |
| 53 | + | } | |
| 54 | + | } | |
| 55 | + | ||
| 56 | + | // GetActivate gets the callback function. | |
| 57 | + | func (x *ActionEntry) GetActivate() func(*SimpleAction, *glib.Variant, uintptr) { | |
| 58 | + | if x.xActivate == 0 { | |
| 59 | + | return nil | |
| 60 | + | } | |
| 61 | + | var rawCallback func(ActionVarp uintptr, ParameterVarp *glib.Variant, UserDataVarp uintptr) | |
| 62 | + | purego.RegisterFunc(&rawCallback, x.xActivate) | |
| 63 | + | return func(ActionVar *SimpleAction, ParameterVar *glib.Variant, UserDataVar uintptr) { | |
| 64 | + | rawCallback(ActionVar.GoPointer(), ParameterVar, UserDataVar) | |
| 65 | + | } | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | // OverrideChangeState sets the callback function. | |
| 69 | + | func (x *ActionEntry) OverrideChangeState(cb func(*SimpleAction, *glib.Variant, uintptr)) { | |
| 70 | + | if cb == nil { | |
| 71 | + | x.xChangeState = 0 | |
| 72 | + | } else { | |
| 73 | + | x.xChangeState = purego.NewCallback(func(ActionVarp uintptr, ValueVarp *glib.Variant, UserDataVarp uintptr) { | |
| 74 | + | cb(SimpleActionNewFromInternalPtr(ActionVarp), ValueVarp, UserDataVarp) | |
| 75 | + | }) | |
| 76 | + | } | |
| 77 | + | } | |
| 78 | + | ||
| 79 | + | // GetChangeState gets the callback function. | |
| 80 | + | func (x *ActionEntry) GetChangeState() func(*SimpleAction, *glib.Variant, uintptr) { | |
| 81 | + | if x.xChangeState == 0 { | |
| 82 | + | return nil | |
| 83 | + | } | |
| 84 | + | var rawCallback func(ActionVarp uintptr, ValueVarp *glib.Variant, UserDataVarp uintptr) | |
| 85 | + | purego.RegisterFunc(&rawCallback, x.xChangeState) | |
| 86 | + | return func(ActionVar *SimpleAction, ValueVar *glib.Variant, UserDataVar uintptr) { | |
| 87 | + | rawCallback(ActionVar.GoPointer(), ValueVar, UserDataVar) | |
| 88 | + | } | |
| 89 | + | } | |
| 90 | + | ||
| 40 | 91 | // The virtual function table for #GActionMap. | |
| 41 | 92 | type ActionMapInterface struct { | |
| 42 | 93 | _ structs.HostLayout | |
| 43 | 94 | ||
| 44 | 95 | GIface uintptr | |
| 96 | + | ||
| 97 | + | xLookupAction uintptr | |
| 98 | + | ||
| 99 | + | xAddAction uintptr | |
| 100 | + | ||
| 101 | + | xRemoveAction uintptr | |
| 45 | 102 | } | |
| 46 | 103 | ||
| 47 | 104 | func (x *ActionMapInterface) GoPointer() uintptr { | |
| 48 | 105 | return uintptr(unsafe.Pointer(x)) | |
| 49 | 106 | } | |
| 50 | 107 | ||
| 108 | + | // OverrideLookupAction sets the callback function. | |
| 109 | + | func (x *ActionMapInterface) OverrideLookupAction(cb func(ActionMap, string) *ActionBase) { | |
| 110 | + | if cb == nil { | |
| 111 | + | x.xLookupAction = 0 | |
| 112 | + | } else { | |
| 113 | + | x.xLookupAction = purego.NewCallback(func(ActionMapVarp uintptr, ActionNameVarp string) uintptr { | |
| 114 | + | ret := cb(&ActionMapBase{Ptr: ActionMapVarp}, ActionNameVarp) | |
| 115 | + | if ret == nil { | |
| 116 | + | return 0 | |
| 117 | + | } | |
| 118 | + | return ret.GoPointer() | |
| 119 | + | }) | |
| 120 | + | } | |
| 121 | + | } | |
| 122 | + | ||
| 123 | + | // GetLookupAction gets the callback function. | |
| 124 | + | func (x *ActionMapInterface) GetLookupAction() func(ActionMap, string) *ActionBase { | |
| 125 | + | if x.xLookupAction == 0 { | |
| 126 | + | return nil | |
| 127 | + | } | |
| 128 | + | var rawCallback func(ActionMapVarp uintptr, ActionNameVarp string) uintptr | |
| 129 | + | purego.RegisterFunc(&rawCallback, x.xLookupAction) | |
| 130 | + | return func(ActionMapVar ActionMap, ActionNameVar string) *ActionBase { | |
| 131 | + | rawRet := rawCallback(ActionMapVar.GoPointer(), ActionNameVar) | |
| 132 | + | if rawRet == 0 { | |
| 133 | + | return nil | |
| 134 | + | } | |
| 135 | + | ret := &ActionBase{} | |
| 136 | + | ret.Ptr = rawRet | |
| 137 | + | return ret | |
| 138 | + | } | |
| 139 | + | } | |
| 140 | + | ||
| 141 | + | // OverrideAddAction sets the callback function. | |
| 142 | + | func (x *ActionMapInterface) OverrideAddAction(cb func(ActionMap, Action)) { | |
| 143 | + | if cb == nil { | |
| 144 | + | x.xAddAction = 0 | |
| 145 | + | } else { | |
| 146 | + | x.xAddAction = purego.NewCallback(func(ActionMapVarp uintptr, ActionVarp uintptr) { | |
| 147 | + | cb(&ActionMapBase{Ptr: ActionMapVarp}, &ActionBase{Ptr: ActionVarp}) | |
| 148 | + | }) | |
| 149 | + | } | |
| 150 | + | } | |
| 151 | + | ||
| 152 | + | // GetAddAction gets the callback function. | |
| 153 | + | func (x *ActionMapInterface) GetAddAction() func(ActionMap, Action) { | |
| 154 | + | if x.xAddAction == 0 { | |
| 155 | + | return nil | |
| 156 | + | } | |
| 157 | + | var rawCallback func(ActionMapVarp uintptr, ActionVarp uintptr) | |
| 158 | + | purego.RegisterFunc(&rawCallback, x.xAddAction) | |
| 159 | + | return func(ActionMapVar ActionMap, ActionVar Action) { | |
| 160 | + | rawCallback(ActionMapVar.GoPointer(), ActionVar.GoPointer()) | |
| 161 | + | } | |
| 162 | + | } | |
| 163 | + | ||
| 164 | + | // OverrideRemoveAction sets the callback function. | |
| 165 | + | func (x *ActionMapInterface) OverrideRemoveAction(cb func(ActionMap, string)) { | |
| 166 | + | if cb == nil { | |
| 167 | + | x.xRemoveAction = 0 | |
| 168 | + | } else { | |
| 169 | + | x.xRemoveAction = purego.NewCallback(func(ActionMapVarp uintptr, ActionNameVarp string) { | |
| 170 | + | cb(&ActionMapBase{Ptr: ActionMapVarp}, ActionNameVarp) | |
| 171 | + | }) | |
| 172 | + | } | |
| 173 | + | } | |
| 174 | + | ||
| 175 | + | // GetRemoveAction gets the callback function. | |
| 176 | + | func (x *ActionMapInterface) GetRemoveAction() func(ActionMap, string) { | |
| 177 | + | if x.xRemoveAction == 0 { | |
| 178 | + | return nil | |
| 179 | + | } | |
| 180 | + | var rawCallback func(ActionMapVarp uintptr, ActionNameVarp string) | |
| 181 | + | purego.RegisterFunc(&rawCallback, x.xRemoveAction) | |
| 182 | + | return func(ActionMapVar ActionMap, ActionNameVar string) { | |
| 183 | + | rawCallback(ActionMapVar.GoPointer(), ActionNameVar) | |
| 184 | + | } | |
| 185 | + | } | |
| 186 | + | ||
| 51 | 187 | // The GActionMap interface is implemented by #GActionGroup | |
| 52 | 188 | // implementations that operate by containing a number of | |
| 53 | 189 | // named #GAction instances, such as #GSimpleActionGroup. | |
M v4/gio/gappinfo.go +854 -9
| @@ -17,22 +17,867 @@ type AppInfoIface struct { | |||
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | 19 | GIface uintptr | |
| 20 | + | ||
| 21 | + | xDup uintptr | |
| 22 | + | ||
| 23 | + | xEqual uintptr | |
| 24 | + | ||
| 25 | + | xGetId uintptr | |
| 26 | + | ||
| 27 | + | xGetName uintptr | |
| 28 | + | ||
| 29 | + | xGetDescription uintptr | |
| 30 | + | ||
| 31 | + | xGetExecutable uintptr | |
| 32 | + | ||
| 33 | + | xGetIcon uintptr | |
| 34 | + | ||
| 35 | + | xLaunch uintptr | |
| 36 | + | ||
| 37 | + | xSupportsUris uintptr | |
| 38 | + | ||
| 39 | + | xSupportsFiles uintptr | |
| 40 | + | ||
| 41 | + | xLaunchUris uintptr | |
| 42 | + | ||
| 43 | + | xShouldShow uintptr | |
| 44 | + | ||
| 45 | + | xSetAsDefaultForType uintptr | |
| 46 | + | ||
| 47 | + | xSetAsDefaultForExtension uintptr | |
| 48 | + | ||
| 49 | + | xAddSupportsType uintptr | |
| 50 | + | ||
| 51 | + | xCanRemoveSupportsType uintptr | |
| 52 | + | ||
| 53 | + | xRemoveSupportsType uintptr | |
| 54 | + | ||
| 55 | + | xCanDelete uintptr | |
| 56 | + | ||
| 57 | + | xDoDelete uintptr | |
| 58 | + | ||
| 59 | + | xGetCommandline uintptr | |
| 60 | + | ||
| 61 | + | xGetDisplayName uintptr | |
| 62 | + | ||
| 63 | + | xSetAsLastUsedForType uintptr | |
| 64 | + | ||
| 65 | + | xGetSupportedTypes uintptr | |
| 66 | + | ||
| 67 | + | xLaunchUrisAsync uintptr | |
| 68 | + | ||
| 69 | + | xLaunchUrisFinish uintptr | |
| 20 | 70 | } | |
| 21 | 71 | ||
| 22 | 72 | func (x *AppInfoIface) GoPointer() uintptr { | |
| 23 | 73 | return uintptr(unsafe.Pointer(x)) | |
| 24 | 74 | } | |
| 25 | 75 | ||
| 76 | + | // OverrideDup sets the callback function. | |
| 77 | + | func (x *AppInfoIface) OverrideDup(cb func(AppInfo) *AppInfoBase) { | |
| 78 | + | if cb == nil { | |
| 79 | + | x.xDup = 0 | |
| 80 | + | } else { | |
| 81 | + | x.xDup = purego.NewCallback(func(AppinfoVarp uintptr) uintptr { | |
| 82 | + | ret := cb(&AppInfoBase{Ptr: AppinfoVarp}) | |
| 83 | + | if ret == nil { | |
| 84 | + | return 0 | |
| 85 | + | } | |
| 86 | + | return ret.GoPointer() | |
| 87 | + | }) | |
| 88 | + | } | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | // GetDup gets the callback function. | |
| 92 | + | func (x *AppInfoIface) GetDup() func(AppInfo) *AppInfoBase { | |
| 93 | + | if x.xDup == 0 { | |
| 94 | + | return nil | |
| 95 | + | } | |
| 96 | + | var rawCallback func(AppinfoVarp uintptr) uintptr | |
| 97 | + | purego.RegisterFunc(&rawCallback, x.xDup) | |
| 98 | + | return func(AppinfoVar AppInfo) *AppInfoBase { | |
| 99 | + | rawRet := rawCallback(AppinfoVar.GoPointer()) | |
| 100 | + | if rawRet == 0 { | |
| 101 | + | return nil | |
| 102 | + | } | |
| 103 | + | ret := &AppInfoBase{} | |
| 104 | + | ret.Ptr = rawRet | |
| 105 | + | return ret | |
| 106 | + | } | |
| 107 | + | } | |
| 108 | + | ||
| 109 | + | // OverrideEqual sets the callback function. | |
| 110 | + | func (x *AppInfoIface) OverrideEqual(cb func(AppInfo, AppInfo) bool) { | |
| 111 | + | if cb == nil { | |
| 112 | + | x.xEqual = 0 | |
| 113 | + | } else { | |
| 114 | + | x.xEqual = purego.NewCallback(func(Appinfo1Varp uintptr, Appinfo2Varp uintptr) bool { | |
| 115 | + | return cb(&AppInfoBase{Ptr: Appinfo1Varp}, &AppInfoBase{Ptr: Appinfo2Varp}) | |
| 116 | + | }) | |
| 117 | + | } | |
| 118 | + | } | |
| 119 | + | ||
| 120 | + | // GetEqual gets the callback function. | |
| 121 | + | func (x *AppInfoIface) GetEqual() func(AppInfo, AppInfo) bool { | |
| 122 | + | if x.xEqual == 0 { | |
| 123 | + | return nil | |
| 124 | + | } | |
| 125 | + | var rawCallback func(Appinfo1Varp uintptr, Appinfo2Varp uintptr) bool | |
| 126 | + | purego.RegisterFunc(&rawCallback, x.xEqual) | |
| 127 | + | return func(Appinfo1Var AppInfo, Appinfo2Var AppInfo) bool { | |
| 128 | + | return rawCallback(Appinfo1Var.GoPointer(), Appinfo2Var.GoPointer()) | |
| 129 | + | } | |
| 130 | + | } | |
| 131 | + | ||
| 132 | + | // OverrideGetId sets the callback function. | |
| 133 | + | func (x *AppInfoIface) OverrideGetId(cb func(AppInfo) string) { | |
| 134 | + | if cb == nil { | |
| 135 | + | x.xGetId = 0 | |
| 136 | + | } else { | |
| 137 | + | x.xGetId = purego.NewCallback(func(AppinfoVarp uintptr) string { | |
| 138 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}) | |
| 139 | + | }) | |
| 140 | + | } | |
| 141 | + | } | |
| 142 | + | ||
| 143 | + | // GetGetId gets the callback function. | |
| 144 | + | func (x *AppInfoIface) GetGetId() func(AppInfo) string { | |
| 145 | + | if x.xGetId == 0 { | |
| 146 | + | return nil | |
| 147 | + | } | |
| 148 | + | var rawCallback func(AppinfoVarp uintptr) string | |
| 149 | + | purego.RegisterFunc(&rawCallback, x.xGetId) | |
| 150 | + | return func(AppinfoVar AppInfo) string { | |
| 151 | + | return rawCallback(AppinfoVar.GoPointer()) | |
| 152 | + | } | |
| 153 | + | } | |
| 154 | + | ||
| 155 | + | // OverrideGetName sets the callback function. | |
| 156 | + | func (x *AppInfoIface) OverrideGetName(cb func(AppInfo) string) { | |
| 157 | + | if cb == nil { | |
| 158 | + | x.xGetName = 0 | |
| 159 | + | } else { | |
| 160 | + | x.xGetName = purego.NewCallback(func(AppinfoVarp uintptr) string { | |
| 161 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}) | |
| 162 | + | }) | |
| 163 | + | } | |
| 164 | + | } | |
| 165 | + | ||
| 166 | + | // GetGetName gets the callback function. | |
| 167 | + | func (x *AppInfoIface) GetGetName() func(AppInfo) string { | |
| 168 | + | if x.xGetName == 0 { | |
| 169 | + | return nil | |
| 170 | + | } | |
| 171 | + | var rawCallback func(AppinfoVarp uintptr) string | |
| 172 | + | purego.RegisterFunc(&rawCallback, x.xGetName) | |
| 173 | + | return func(AppinfoVar AppInfo) string { | |
| 174 | + | return rawCallback(AppinfoVar.GoPointer()) | |
| 175 | + | } | |
| 176 | + | } | |
| 177 | + | ||
| 178 | + | // OverrideGetDescription sets the callback function. | |
| 179 | + | func (x *AppInfoIface) OverrideGetDescription(cb func(AppInfo) string) { | |
| 180 | + | if cb == nil { | |
| 181 | + | x.xGetDescription = 0 | |
| 182 | + | } else { | |
| 183 | + | x.xGetDescription = purego.NewCallback(func(AppinfoVarp uintptr) string { | |
| 184 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}) | |
| 185 | + | }) | |
| 186 | + | } | |
| 187 | + | } | |
| 188 | + | ||
| 189 | + | // GetGetDescription gets the callback function. | |
| 190 | + | func (x *AppInfoIface) GetGetDescription() func(AppInfo) string { | |
| 191 | + | if x.xGetDescription == 0 { | |
| 192 | + | return nil | |
| 193 | + | } | |
| 194 | + | var rawCallback func(AppinfoVarp uintptr) string | |
| 195 | + | purego.RegisterFunc(&rawCallback, x.xGetDescription) | |
| 196 | + | return func(AppinfoVar AppInfo) string { | |
| 197 | + | return rawCallback(AppinfoVar.GoPointer()) | |
| 198 | + | } | |
| 199 | + | } | |
| 200 | + | ||
| 201 | + | // OverrideGetExecutable sets the callback function. | |
| 202 | + | func (x *AppInfoIface) OverrideGetExecutable(cb func(AppInfo) string) { | |
| 203 | + | if cb == nil { | |
| 204 | + | x.xGetExecutable = 0 | |
| 205 | + | } else { | |
| 206 | + | x.xGetExecutable = purego.NewCallback(func(AppinfoVarp uintptr) string { | |
| 207 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}) | |
| 208 | + | }) | |
| 209 | + | } | |
| 210 | + | } | |
| 211 | + | ||
| 212 | + | // GetGetExecutable gets the callback function. | |
| 213 | + | func (x *AppInfoIface) GetGetExecutable() func(AppInfo) string { | |
| 214 | + | if x.xGetExecutable == 0 { | |
| 215 | + | return nil | |
| 216 | + | } | |
| 217 | + | var rawCallback func(AppinfoVarp uintptr) string | |
| 218 | + | purego.RegisterFunc(&rawCallback, x.xGetExecutable) | |
| 219 | + | return func(AppinfoVar AppInfo) string { | |
| 220 | + | return rawCallback(AppinfoVar.GoPointer()) | |
| 221 | + | } | |
| 222 | + | } | |
| 223 | + | ||
| 224 | + | // OverrideGetIcon sets the callback function. | |
| 225 | + | func (x *AppInfoIface) OverrideGetIcon(cb func(AppInfo) *IconBase) { | |
| 226 | + | if cb == nil { | |
| 227 | + | x.xGetIcon = 0 | |
| 228 | + | } else { | |
| 229 | + | x.xGetIcon = purego.NewCallback(func(AppinfoVarp uintptr) uintptr { | |
| 230 | + | ret := cb(&AppInfoBase{Ptr: AppinfoVarp}) | |
| 231 | + | if ret == nil { | |
| 232 | + | return 0 | |
| 233 | + | } | |
| 234 | + | return ret.GoPointer() | |
| 235 | + | }) | |
| 236 | + | } | |
| 237 | + | } | |
| 238 | + | ||
| 239 | + | // GetGetIcon gets the callback function. | |
| 240 | + | func (x *AppInfoIface) GetGetIcon() func(AppInfo) *IconBase { | |
| 241 | + | if x.xGetIcon == 0 { | |
| 242 | + | return nil | |
| 243 | + | } | |
| 244 | + | var rawCallback func(AppinfoVarp uintptr) uintptr | |
| 245 | + | purego.RegisterFunc(&rawCallback, x.xGetIcon) | |
| 246 | + | return func(AppinfoVar AppInfo) *IconBase { | |
| 247 | + | rawRet := rawCallback(AppinfoVar.GoPointer()) | |
| 248 | + | if rawRet == 0 { | |
| 249 | + | return nil | |
| 250 | + | } | |
| 251 | + | ret := &IconBase{} | |
| 252 | + | ret.Ptr = rawRet | |
| 253 | + | return ret | |
| 254 | + | } | |
| 255 | + | } | |
| 256 | + | ||
| 257 | + | // OverrideLaunch sets the callback function. | |
| 258 | + | func (x *AppInfoIface) OverrideLaunch(cb func(AppInfo, *glib.List, *AppLaunchContext) bool) { | |
| 259 | + | if cb == nil { | |
| 260 | + | x.xLaunch = 0 | |
| 261 | + | } else { | |
| 262 | + | x.xLaunch = purego.NewCallback(func(AppinfoVarp uintptr, FilesVarp *glib.List, ContextVarp uintptr) bool { | |
| 263 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}, FilesVarp, AppLaunchContextNewFromInternalPtr(ContextVarp)) | |
| 264 | + | }) | |
| 265 | + | } | |
| 266 | + | } | |
| 267 | + | ||
| 268 | + | // GetLaunch gets the callback function. | |
| 269 | + | func (x *AppInfoIface) GetLaunch() func(AppInfo, *glib.List, *AppLaunchContext) bool { | |
| 270 | + | if x.xLaunch == 0 { | |
| 271 | + | return nil | |
| 272 | + | } | |
| 273 | + | var rawCallback func(AppinfoVarp uintptr, FilesVarp *glib.List, ContextVarp uintptr) bool | |
| 274 | + | purego.RegisterFunc(&rawCallback, x.xLaunch) | |
| 275 | + | return func(AppinfoVar AppInfo, FilesVar *glib.List, ContextVar *AppLaunchContext) bool { | |
| 276 | + | return rawCallback(AppinfoVar.GoPointer(), FilesVar, ContextVar.GoPointer()) | |
| 277 | + | } | |
| 278 | + | } | |
| 279 | + | ||
| 280 | + | // OverrideSupportsUris sets the callback function. | |
| 281 | + | func (x *AppInfoIface) OverrideSupportsUris(cb func(AppInfo) bool) { | |
| 282 | + | if cb == nil { | |
| 283 | + | x.xSupportsUris = 0 | |
| 284 | + | } else { | |
| 285 | + | x.xSupportsUris = purego.NewCallback(func(AppinfoVarp uintptr) bool { | |
| 286 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}) | |
| 287 | + | }) | |
| 288 | + | } | |
| 289 | + | } | |
| 290 | + | ||
| 291 | + | // GetSupportsUris gets the callback function. | |
| 292 | + | func (x *AppInfoIface) GetSupportsUris() func(AppInfo) bool { | |
| 293 | + | if x.xSupportsUris == 0 { | |
| 294 | + | return nil | |
| 295 | + | } | |
| 296 | + | var rawCallback func(AppinfoVarp uintptr) bool | |
| 297 | + | purego.RegisterFunc(&rawCallback, x.xSupportsUris) | |
| 298 | + | return func(AppinfoVar AppInfo) bool { | |
| 299 | + | return rawCallback(AppinfoVar.GoPointer()) | |
| 300 | + | } | |
| 301 | + | } | |
| 302 | + | ||
| 303 | + | // OverrideSupportsFiles sets the callback function. | |
| 304 | + | func (x *AppInfoIface) OverrideSupportsFiles(cb func(AppInfo) bool) { | |
| 305 | + | if cb == nil { | |
| 306 | + | x.xSupportsFiles = 0 | |
| 307 | + | } else { | |
| 308 | + | x.xSupportsFiles = purego.NewCallback(func(AppinfoVarp uintptr) bool { | |
| 309 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}) | |
| 310 | + | }) | |
| 311 | + | } | |
| 312 | + | } | |
| 313 | + | ||
| 314 | + | // GetSupportsFiles gets the callback function. | |
| 315 | + | func (x *AppInfoIface) GetSupportsFiles() func(AppInfo) bool { | |
| 316 | + | if x.xSupportsFiles == 0 { | |
| 317 | + | return nil | |
| 318 | + | } | |
| 319 | + | var rawCallback func(AppinfoVarp uintptr) bool | |
| 320 | + | purego.RegisterFunc(&rawCallback, x.xSupportsFiles) | |
| 321 | + | return func(AppinfoVar AppInfo) bool { | |
| 322 | + | return rawCallback(AppinfoVar.GoPointer()) | |
| 323 | + | } | |
| 324 | + | } | |
| 325 | + | ||
| 326 | + | // OverrideLaunchUris sets the callback function. | |
| 327 | + | func (x *AppInfoIface) OverrideLaunchUris(cb func(AppInfo, *glib.List, *AppLaunchContext) bool) { | |
| 328 | + | if cb == nil { | |
| 329 | + | x.xLaunchUris = 0 | |
| 330 | + | } else { | |
| 331 | + | x.xLaunchUris = purego.NewCallback(func(AppinfoVarp uintptr, UrisVarp *glib.List, ContextVarp uintptr) bool { | |
| 332 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}, UrisVarp, AppLaunchContextNewFromInternalPtr(ContextVarp)) | |
| 333 | + | }) | |
| 334 | + | } | |
| 335 | + | } | |
| 336 | + | ||
| 337 | + | // GetLaunchUris gets the callback function. | |
| 338 | + | func (x *AppInfoIface) GetLaunchUris() func(AppInfo, *glib.List, *AppLaunchContext) bool { | |
| 339 | + | if x.xLaunchUris == 0 { | |
| 340 | + | return nil | |
| 341 | + | } | |
| 342 | + | var rawCallback func(AppinfoVarp uintptr, UrisVarp *glib.List, ContextVarp uintptr) bool | |
| 343 | + | purego.RegisterFunc(&rawCallback, x.xLaunchUris) | |
| 344 | + | return func(AppinfoVar AppInfo, UrisVar *glib.List, ContextVar *AppLaunchContext) bool { | |
| 345 | + | return rawCallback(AppinfoVar.GoPointer(), UrisVar, ContextVar.GoPointer()) | |
| 346 | + | } | |
| 347 | + | } | |
| 348 | + | ||
| 349 | + | // OverrideShouldShow sets the callback function. | |
| 350 | + | func (x *AppInfoIface) OverrideShouldShow(cb func(AppInfo) bool) { | |
| 351 | + | if cb == nil { | |
| 352 | + | x.xShouldShow = 0 | |
| 353 | + | } else { | |
| 354 | + | x.xShouldShow = purego.NewCallback(func(AppinfoVarp uintptr) bool { | |
| 355 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}) | |
| 356 | + | }) | |
| 357 | + | } | |
| 358 | + | } | |
| 359 | + | ||
| 360 | + | // GetShouldShow gets the callback function. | |
| 361 | + | func (x *AppInfoIface) GetShouldShow() func(AppInfo) bool { | |
| 362 | + | if x.xShouldShow == 0 { | |
| 363 | + | return nil | |
| 364 | + | } | |
| 365 | + | var rawCallback func(AppinfoVarp uintptr) bool | |
| 366 | + | purego.RegisterFunc(&rawCallback, x.xShouldShow) | |
| 367 | + | return func(AppinfoVar AppInfo) bool { | |
| 368 | + | return rawCallback(AppinfoVar.GoPointer()) | |
| 369 | + | } | |
| 370 | + | } | |
| 371 | + | ||
| 372 | + | // OverrideSetAsDefaultForType sets the callback function. | |
| 373 | + | func (x *AppInfoIface) OverrideSetAsDefaultForType(cb func(AppInfo, string) bool) { | |
| 374 | + | if cb == nil { | |
| 375 | + | x.xSetAsDefaultForType = 0 | |
| 376 | + | } else { | |
| 377 | + | x.xSetAsDefaultForType = purego.NewCallback(func(AppinfoVarp uintptr, ContentTypeVarp string) bool { | |
| 378 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}, ContentTypeVarp) | |
| 379 | + | }) | |
| 380 | + | } | |
| 381 | + | } | |
| 382 | + | ||
| 383 | + | // GetSetAsDefaultForType gets the callback function. | |
| 384 | + | func (x *AppInfoIface) GetSetAsDefaultForType() func(AppInfo, string) bool { | |
| 385 | + | if x.xSetAsDefaultForType == 0 { | |
| 386 | + | return nil | |
| 387 | + | } | |
| 388 | + | var rawCallback func(AppinfoVarp uintptr, ContentTypeVarp string) bool | |
| 389 | + | purego.RegisterFunc(&rawCallback, x.xSetAsDefaultForType) | |
| 390 | + | return func(AppinfoVar AppInfo, ContentTypeVar string) bool { | |
| 391 | + | return rawCallback(AppinfoVar.GoPointer(), ContentTypeVar) | |
| 392 | + | } | |
| 393 | + | } | |
| 394 | + | ||
| 395 | + | // OverrideSetAsDefaultForExtension sets the callback function. | |
| 396 | + | func (x *AppInfoIface) OverrideSetAsDefaultForExtension(cb func(AppInfo, string) bool) { | |
| 397 | + | if cb == nil { | |
| 398 | + | x.xSetAsDefaultForExtension = 0 | |
| 399 | + | } else { | |
| 400 | + | x.xSetAsDefaultForExtension = purego.NewCallback(func(AppinfoVarp uintptr, ExtensionVarp string) bool { | |
| 401 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}, ExtensionVarp) | |
| 402 | + | }) | |
| 403 | + | } | |
| 404 | + | } | |
| 405 | + | ||
| 406 | + | // GetSetAsDefaultForExtension gets the callback function. | |
| 407 | + | func (x *AppInfoIface) GetSetAsDefaultForExtension() func(AppInfo, string) bool { | |
| 408 | + | if x.xSetAsDefaultForExtension == 0 { | |
| 409 | + | return nil | |
| 410 | + | } | |
| 411 | + | var rawCallback func(AppinfoVarp uintptr, ExtensionVarp string) bool | |
| 412 | + | purego.RegisterFunc(&rawCallback, x.xSetAsDefaultForExtension) | |
| 413 | + | return func(AppinfoVar AppInfo, ExtensionVar string) bool { | |
| 414 | + | return rawCallback(AppinfoVar.GoPointer(), ExtensionVar) | |
| 415 | + | } | |
| 416 | + | } | |
| 417 | + | ||
| 418 | + | // OverrideAddSupportsType sets the callback function. | |
| 419 | + | func (x *AppInfoIface) OverrideAddSupportsType(cb func(AppInfo, string) bool) { | |
| 420 | + | if cb == nil { | |
| 421 | + | x.xAddSupportsType = 0 | |
| 422 | + | } else { | |
| 423 | + | x.xAddSupportsType = purego.NewCallback(func(AppinfoVarp uintptr, ContentTypeVarp string) bool { | |
| 424 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}, ContentTypeVarp) | |
| 425 | + | }) | |
| 426 | + | } | |
| 427 | + | } | |
| 428 | + | ||
| 429 | + | // GetAddSupportsType gets the callback function. | |
| 430 | + | func (x *AppInfoIface) GetAddSupportsType() func(AppInfo, string) bool { | |
| 431 | + | if x.xAddSupportsType == 0 { | |
| 432 | + | return nil | |
| 433 | + | } | |
| 434 | + | var rawCallback func(AppinfoVarp uintptr, ContentTypeVarp string) bool | |
| 435 | + | purego.RegisterFunc(&rawCallback, x.xAddSupportsType) | |
| 436 | + | return func(AppinfoVar AppInfo, ContentTypeVar string) bool { | |
| 437 | + | return rawCallback(AppinfoVar.GoPointer(), ContentTypeVar) | |
| 438 | + | } | |
| 439 | + | } | |
| 440 | + | ||
| 441 | + | // OverrideCanRemoveSupportsType sets the callback function. | |
| 442 | + | func (x *AppInfoIface) OverrideCanRemoveSupportsType(cb func(AppInfo) bool) { | |
| 443 | + | if cb == nil { | |
| 444 | + | x.xCanRemoveSupportsType = 0 | |
| 445 | + | } else { | |
| 446 | + | x.xCanRemoveSupportsType = purego.NewCallback(func(AppinfoVarp uintptr) bool { | |
| 447 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}) | |
| 448 | + | }) | |
| 449 | + | } | |
| 450 | + | } | |
| 451 | + | ||
| 452 | + | // GetCanRemoveSupportsType gets the callback function. | |
| 453 | + | func (x *AppInfoIface) GetCanRemoveSupportsType() func(AppInfo) bool { | |
| 454 | + | if x.xCanRemoveSupportsType == 0 { | |
| 455 | + | return nil | |
| 456 | + | } | |
| 457 | + | var rawCallback func(AppinfoVarp uintptr) bool | |
| 458 | + | purego.RegisterFunc(&rawCallback, x.xCanRemoveSupportsType) | |
| 459 | + | return func(AppinfoVar AppInfo) bool { | |
| 460 | + | return rawCallback(AppinfoVar.GoPointer()) | |
| 461 | + | } | |
| 462 | + | } | |
| 463 | + | ||
| 464 | + | // OverrideRemoveSupportsType sets the callback function. | |
| 465 | + | func (x *AppInfoIface) OverrideRemoveSupportsType(cb func(AppInfo, string) bool) { | |
| 466 | + | if cb == nil { | |
| 467 | + | x.xRemoveSupportsType = 0 | |
| 468 | + | } else { | |
| 469 | + | x.xRemoveSupportsType = purego.NewCallback(func(AppinfoVarp uintptr, ContentTypeVarp string) bool { | |
| 470 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}, ContentTypeVarp) | |
| 471 | + | }) | |
| 472 | + | } | |
| 473 | + | } | |
| 474 | + | ||
| 475 | + | // GetRemoveSupportsType gets the callback function. | |
| 476 | + | func (x *AppInfoIface) GetRemoveSupportsType() func(AppInfo, string) bool { | |
| 477 | + | if x.xRemoveSupportsType == 0 { | |
| 478 | + | return nil | |
| 479 | + | } | |
| 480 | + | var rawCallback func(AppinfoVarp uintptr, ContentTypeVarp string) bool | |
| 481 | + | purego.RegisterFunc(&rawCallback, x.xRemoveSupportsType) | |
| 482 | + | return func(AppinfoVar AppInfo, ContentTypeVar string) bool { | |
| 483 | + | return rawCallback(AppinfoVar.GoPointer(), ContentTypeVar) | |
| 484 | + | } | |
| 485 | + | } | |
| 486 | + | ||
| 487 | + | // OverrideCanDelete sets the callback function. | |
| 488 | + | func (x *AppInfoIface) OverrideCanDelete(cb func(AppInfo) bool) { | |
| 489 | + | if cb == nil { | |
| 490 | + | x.xCanDelete = 0 | |
| 491 | + | } else { | |
| 492 | + | x.xCanDelete = purego.NewCallback(func(AppinfoVarp uintptr) bool { | |
| 493 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}) | |
| 494 | + | }) | |
| 495 | + | } | |
| 496 | + | } | |
| 497 | + | ||
| 498 | + | // GetCanDelete gets the callback function. | |
| 499 | + | func (x *AppInfoIface) GetCanDelete() func(AppInfo) bool { | |
| 500 | + | if x.xCanDelete == 0 { | |
| 501 | + | return nil | |
| 502 | + | } | |
| 503 | + | var rawCallback func(AppinfoVarp uintptr) bool | |
| 504 | + | purego.RegisterFunc(&rawCallback, x.xCanDelete) | |
| 505 | + | return func(AppinfoVar AppInfo) bool { | |
| 506 | + | return rawCallback(AppinfoVar.GoPointer()) | |
| 507 | + | } | |
| 508 | + | } | |
| 509 | + | ||
| 510 | + | // OverrideDoDelete sets the callback function. | |
| 511 | + | func (x *AppInfoIface) OverrideDoDelete(cb func(AppInfo) bool) { | |
| 512 | + | if cb == nil { | |
| 513 | + | x.xDoDelete = 0 | |
| 514 | + | } else { | |
| 515 | + | x.xDoDelete = purego.NewCallback(func(AppinfoVarp uintptr) bool { | |
| 516 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}) | |
| 517 | + | }) | |
| 518 | + | } | |
| 519 | + | } | |
| 520 | + | ||
| 521 | + | // GetDoDelete gets the callback function. | |
| 522 | + | func (x *AppInfoIface) GetDoDelete() func(AppInfo) bool { | |
| 523 | + | if x.xDoDelete == 0 { | |
| 524 | + | return nil | |
| 525 | + | } | |
| 526 | + | var rawCallback func(AppinfoVarp uintptr) bool | |
| 527 | + | purego.RegisterFunc(&rawCallback, x.xDoDelete) | |
| 528 | + | return func(AppinfoVar AppInfo) bool { | |
| 529 | + | return rawCallback(AppinfoVar.GoPointer()) | |
| 530 | + | } | |
| 531 | + | } | |
| 532 | + | ||
| 533 | + | // OverrideGetCommandline sets the callback function. | |
| 534 | + | func (x *AppInfoIface) OverrideGetCommandline(cb func(AppInfo) string) { | |
| 535 | + | if cb == nil { | |
| 536 | + | x.xGetCommandline = 0 | |
| 537 | + | } else { | |
| 538 | + | x.xGetCommandline = purego.NewCallback(func(AppinfoVarp uintptr) string { | |
| 539 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}) | |
| 540 | + | }) | |
| 541 | + | } | |
| 542 | + | } | |
| 543 | + | ||
| 544 | + | // GetGetCommandline gets the callback function. | |
| 545 | + | func (x *AppInfoIface) GetGetCommandline() func(AppInfo) string { | |
| 546 | + | if x.xGetCommandline == 0 { | |
| 547 | + | return nil | |
| 548 | + | } | |
| 549 | + | var rawCallback func(AppinfoVarp uintptr) string | |
| 550 | + | purego.RegisterFunc(&rawCallback, x.xGetCommandline) | |
| 551 | + | return func(AppinfoVar AppInfo) string { | |
| 552 | + | return rawCallback(AppinfoVar.GoPointer()) | |
| 553 | + | } | |
| 554 | + | } | |
| 555 | + | ||
| 556 | + | // OverrideGetDisplayName sets the callback function. | |
| 557 | + | func (x *AppInfoIface) OverrideGetDisplayName(cb func(AppInfo) string) { | |
| 558 | + | if cb == nil { | |
| 559 | + | x.xGetDisplayName = 0 | |
| 560 | + | } else { | |
| 561 | + | x.xGetDisplayName = purego.NewCallback(func(AppinfoVarp uintptr) string { | |
| 562 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}) | |
| 563 | + | }) | |
| 564 | + | } | |
| 565 | + | } | |
| 566 | + | ||
| 567 | + | // GetGetDisplayName gets the callback function. | |
| 568 | + | func (x *AppInfoIface) GetGetDisplayName() func(AppInfo) string { | |
| 569 | + | if x.xGetDisplayName == 0 { | |
| 570 | + | return nil | |
| 571 | + | } | |
| 572 | + | var rawCallback func(AppinfoVarp uintptr) string | |
| 573 | + | purego.RegisterFunc(&rawCallback, x.xGetDisplayName) | |
| 574 | + | return func(AppinfoVar AppInfo) string { | |
| 575 | + | return rawCallback(AppinfoVar.GoPointer()) | |
| 576 | + | } | |
| 577 | + | } | |
| 578 | + | ||
| 579 | + | // OverrideSetAsLastUsedForType sets the callback function. | |
| 580 | + | func (x *AppInfoIface) OverrideSetAsLastUsedForType(cb func(AppInfo, string) bool) { | |
| 581 | + | if cb == nil { | |
| 582 | + | x.xSetAsLastUsedForType = 0 | |
| 583 | + | } else { | |
| 584 | + | x.xSetAsLastUsedForType = purego.NewCallback(func(AppinfoVarp uintptr, ContentTypeVarp string) bool { | |
| 585 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}, ContentTypeVarp) | |
| 586 | + | }) | |
| 587 | + | } | |
| 588 | + | } | |
| 589 | + | ||
| 590 | + | // GetSetAsLastUsedForType gets the callback function. | |
| 591 | + | func (x *AppInfoIface) GetSetAsLastUsedForType() func(AppInfo, string) bool { | |
| 592 | + | if x.xSetAsLastUsedForType == 0 { | |
| 593 | + | return nil | |
| 594 | + | } | |
| 595 | + | var rawCallback func(AppinfoVarp uintptr, ContentTypeVarp string) bool | |
| 596 | + | purego.RegisterFunc(&rawCallback, x.xSetAsLastUsedForType) | |
| 597 | + | return func(AppinfoVar AppInfo, ContentTypeVar string) bool { | |
| 598 | + | return rawCallback(AppinfoVar.GoPointer(), ContentTypeVar) | |
| 599 | + | } | |
| 600 | + | } | |
| 601 | + | ||
| 602 | + | // OverrideGetSupportedTypes sets the callback function. | |
| 603 | + | func (x *AppInfoIface) OverrideGetSupportedTypes(cb func(AppInfo) []string) { | |
| 604 | + | if cb == nil { | |
| 605 | + | x.xGetSupportedTypes = 0 | |
| 606 | + | } else { | |
| 607 | + | x.xGetSupportedTypes = purego.NewCallback(func(AppinfoVarp uintptr) []string { | |
| 608 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}) | |
| 609 | + | }) | |
| 610 | + | } | |
| 611 | + | } | |
| 612 | + | ||
| 613 | + | // GetGetSupportedTypes gets the callback function. | |
| 614 | + | func (x *AppInfoIface) GetGetSupportedTypes() func(AppInfo) []string { | |
| 615 | + | if x.xGetSupportedTypes == 0 { | |
| 616 | + | return nil | |
| 617 | + | } | |
| 618 | + | var rawCallback func(AppinfoVarp uintptr) []string | |
| 619 | + | purego.RegisterFunc(&rawCallback, x.xGetSupportedTypes) | |
| 620 | + | return func(AppinfoVar AppInfo) []string { | |
| 621 | + | return rawCallback(AppinfoVar.GoPointer()) | |
| 622 | + | } | |
| 623 | + | } | |
| 624 | + | ||
| 625 | + | // OverrideLaunchUrisAsync sets the callback function. | |
| 626 | + | func (x *AppInfoIface) OverrideLaunchUrisAsync(cb func(AppInfo, *glib.List, *AppLaunchContext, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 627 | + | if cb == nil { | |
| 628 | + | x.xLaunchUrisAsync = 0 | |
| 629 | + | } else { | |
| 630 | + | x.xLaunchUrisAsync = purego.NewCallback(func(AppinfoVarp uintptr, UrisVarp *glib.List, ContextVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 631 | + | cb(&AppInfoBase{Ptr: AppinfoVarp}, UrisVarp, AppLaunchContextNewFromInternalPtr(ContextVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 632 | + | }) | |
| 633 | + | } | |
| 634 | + | } | |
| 635 | + | ||
| 636 | + | // GetLaunchUrisAsync gets the callback function. | |
| 637 | + | func (x *AppInfoIface) GetLaunchUrisAsync() func(AppInfo, *glib.List, *AppLaunchContext, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 638 | + | if x.xLaunchUrisAsync == 0 { | |
| 639 | + | return nil | |
| 640 | + | } | |
| 641 | + | var rawCallback func(AppinfoVarp uintptr, UrisVarp *glib.List, ContextVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 642 | + | purego.RegisterFunc(&rawCallback, x.xLaunchUrisAsync) | |
| 643 | + | return func(AppinfoVar AppInfo, UrisVar *glib.List, ContextVar *AppLaunchContext, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 644 | + | rawCallback(AppinfoVar.GoPointer(), UrisVar, ContextVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 645 | + | } | |
| 646 | + | } | |
| 647 | + | ||
| 648 | + | // OverrideLaunchUrisFinish sets the callback function. | |
| 649 | + | func (x *AppInfoIface) OverrideLaunchUrisFinish(cb func(AppInfo, AsyncResult) bool) { | |
| 650 | + | if cb == nil { | |
| 651 | + | x.xLaunchUrisFinish = 0 | |
| 652 | + | } else { | |
| 653 | + | x.xLaunchUrisFinish = purego.NewCallback(func(AppinfoVarp uintptr, ResultVarp uintptr) bool { | |
| 654 | + | return cb(&AppInfoBase{Ptr: AppinfoVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 655 | + | }) | |
| 656 | + | } | |
| 657 | + | } | |
| 658 | + | ||
| 659 | + | // GetLaunchUrisFinish gets the callback function. | |
| 660 | + | func (x *AppInfoIface) GetLaunchUrisFinish() func(AppInfo, AsyncResult) bool { | |
| 661 | + | if x.xLaunchUrisFinish == 0 { | |
| 662 | + | return nil | |
| 663 | + | } | |
| 664 | + | var rawCallback func(AppinfoVarp uintptr, ResultVarp uintptr) bool | |
| 665 | + | purego.RegisterFunc(&rawCallback, x.xLaunchUrisFinish) | |
| 666 | + | return func(AppinfoVar AppInfo, ResultVar AsyncResult) bool { | |
| 667 | + | return rawCallback(AppinfoVar.GoPointer(), ResultVar.GoPointer()) | |
| 668 | + | } | |
| 669 | + | } | |
| 670 | + | ||
| 26 | 671 | type AppLaunchContextClass struct { | |
| 27 | 672 | _ structs.HostLayout | |
| 28 | 673 | ||
| 29 | - | ParentClass uintptr | |
| 674 | + | ParentClass gobject.ObjectClass | |
| 675 | + | ||
| 676 | + | xGetDisplay uintptr | |
| 677 | + | ||
| 678 | + | xGetStartupNotifyId uintptr | |
| 679 | + | ||
| 680 | + | xLaunchFailed uintptr | |
| 681 | + | ||
| 682 | + | xLaunched uintptr | |
| 683 | + | ||
| 684 | + | xLaunchStarted uintptr | |
| 685 | + | ||
| 686 | + | xGReserved1 uintptr | |
| 687 | + | ||
| 688 | + | xGReserved2 uintptr | |
| 689 | + | ||
| 690 | + | xGReserved3 uintptr | |
| 30 | 691 | } | |
| 31 | 692 | ||
| 32 | 693 | func (x *AppLaunchContextClass) GoPointer() uintptr { | |
| 33 | 694 | return uintptr(unsafe.Pointer(x)) | |
| 34 | 695 | } | |
| 35 | 696 | ||
| 697 | + | // OverrideGetDisplay sets the callback function. | |
| 698 | + | func (x *AppLaunchContextClass) OverrideGetDisplay(cb func(*AppLaunchContext, AppInfo, *glib.List) string) { | |
| 699 | + | if cb == nil { | |
| 700 | + | x.xGetDisplay = 0 | |
| 701 | + | } else { | |
| 702 | + | x.xGetDisplay = purego.NewCallback(func(ContextVarp uintptr, InfoVarp uintptr, FilesVarp *glib.List) string { | |
| 703 | + | return cb(AppLaunchContextNewFromInternalPtr(ContextVarp), &AppInfoBase{Ptr: InfoVarp}, FilesVarp) | |
| 704 | + | }) | |
| 705 | + | } | |
| 706 | + | } | |
| 707 | + | ||
| 708 | + | // GetGetDisplay gets the callback function. | |
| 709 | + | func (x *AppLaunchContextClass) GetGetDisplay() func(*AppLaunchContext, AppInfo, *glib.List) string { | |
| 710 | + | if x.xGetDisplay == 0 { | |
| 711 | + | return nil | |
| 712 | + | } | |
| 713 | + | var rawCallback func(ContextVarp uintptr, InfoVarp uintptr, FilesVarp *glib.List) string | |
| 714 | + | purego.RegisterFunc(&rawCallback, x.xGetDisplay) | |
| 715 | + | return func(ContextVar *AppLaunchContext, InfoVar AppInfo, FilesVar *glib.List) string { | |
| 716 | + | return rawCallback(ContextVar.GoPointer(), InfoVar.GoPointer(), FilesVar) | |
| 717 | + | } | |
| 718 | + | } | |
| 719 | + | ||
| 720 | + | // OverrideGetStartupNotifyId sets the callback function. | |
| 721 | + | func (x *AppLaunchContextClass) OverrideGetStartupNotifyId(cb func(*AppLaunchContext, AppInfo, *glib.List) string) { | |
| 722 | + | if cb == nil { | |
| 723 | + | x.xGetStartupNotifyId = 0 | |
| 724 | + | } else { | |
| 725 | + | x.xGetStartupNotifyId = purego.NewCallback(func(ContextVarp uintptr, InfoVarp uintptr, FilesVarp *glib.List) string { | |
| 726 | + | return cb(AppLaunchContextNewFromInternalPtr(ContextVarp), &AppInfoBase{Ptr: InfoVarp}, FilesVarp) | |
| 727 | + | }) | |
| 728 | + | } | |
| 729 | + | } | |
| 730 | + | ||
| 731 | + | // GetGetStartupNotifyId gets the callback function. | |
| 732 | + | func (x *AppLaunchContextClass) GetGetStartupNotifyId() func(*AppLaunchContext, AppInfo, *glib.List) string { | |
| 733 | + | if x.xGetStartupNotifyId == 0 { | |
| 734 | + | return nil | |
| 735 | + | } | |
| 736 | + | var rawCallback func(ContextVarp uintptr, InfoVarp uintptr, FilesVarp *glib.List) string | |
| 737 | + | purego.RegisterFunc(&rawCallback, x.xGetStartupNotifyId) | |
| 738 | + | return func(ContextVar *AppLaunchContext, InfoVar AppInfo, FilesVar *glib.List) string { | |
| 739 | + | return rawCallback(ContextVar.GoPointer(), InfoVar.GoPointer(), FilesVar) | |
| 740 | + | } | |
| 741 | + | } | |
| 742 | + | ||
| 743 | + | // OverrideLaunchFailed sets the callback function. | |
| 744 | + | func (x *AppLaunchContextClass) OverrideLaunchFailed(cb func(*AppLaunchContext, string)) { | |
| 745 | + | if cb == nil { | |
| 746 | + | x.xLaunchFailed = 0 | |
| 747 | + | } else { | |
| 748 | + | x.xLaunchFailed = purego.NewCallback(func(ContextVarp uintptr, StartupNotifyIdVarp string) { | |
| 749 | + | cb(AppLaunchContextNewFromInternalPtr(ContextVarp), StartupNotifyIdVarp) | |
| 750 | + | }) | |
| 751 | + | } | |
| 752 | + | } | |
| 753 | + | ||
| 754 | + | // GetLaunchFailed gets the callback function. | |
| 755 | + | func (x *AppLaunchContextClass) GetLaunchFailed() func(*AppLaunchContext, string) { | |
| 756 | + | if x.xLaunchFailed == 0 { | |
| 757 | + | return nil | |
| 758 | + | } | |
| 759 | + | var rawCallback func(ContextVarp uintptr, StartupNotifyIdVarp string) | |
| 760 | + | purego.RegisterFunc(&rawCallback, x.xLaunchFailed) | |
| 761 | + | return func(ContextVar *AppLaunchContext, StartupNotifyIdVar string) { | |
| 762 | + | rawCallback(ContextVar.GoPointer(), StartupNotifyIdVar) | |
| 763 | + | } | |
| 764 | + | } | |
| 765 | + | ||
| 766 | + | // OverrideLaunched sets the callback function. | |
| 767 | + | func (x *AppLaunchContextClass) OverrideLaunched(cb func(*AppLaunchContext, AppInfo, *glib.Variant)) { | |
| 768 | + | if cb == nil { | |
| 769 | + | x.xLaunched = 0 | |
| 770 | + | } else { | |
| 771 | + | x.xLaunched = purego.NewCallback(func(ContextVarp uintptr, InfoVarp uintptr, PlatformDataVarp *glib.Variant) { | |
| 772 | + | cb(AppLaunchContextNewFromInternalPtr(ContextVarp), &AppInfoBase{Ptr: InfoVarp}, PlatformDataVarp) | |
| 773 | + | }) | |
| 774 | + | } | |
| 775 | + | } | |
| 776 | + | ||
| 777 | + | // GetLaunched gets the callback function. | |
| 778 | + | func (x *AppLaunchContextClass) GetLaunched() func(*AppLaunchContext, AppInfo, *glib.Variant) { | |
| 779 | + | if x.xLaunched == 0 { | |
| 780 | + | return nil | |
| 781 | + | } | |
| 782 | + | var rawCallback func(ContextVarp uintptr, InfoVarp uintptr, PlatformDataVarp *glib.Variant) | |
| 783 | + | purego.RegisterFunc(&rawCallback, x.xLaunched) | |
| 784 | + | return func(ContextVar *AppLaunchContext, InfoVar AppInfo, PlatformDataVar *glib.Variant) { | |
| 785 | + | rawCallback(ContextVar.GoPointer(), InfoVar.GoPointer(), PlatformDataVar) | |
| 786 | + | } | |
| 787 | + | } | |
| 788 | + | ||
| 789 | + | // OverrideLaunchStarted sets the callback function. | |
| 790 | + | func (x *AppLaunchContextClass) OverrideLaunchStarted(cb func(*AppLaunchContext, AppInfo, *glib.Variant)) { | |
| 791 | + | if cb == nil { | |
| 792 | + | x.xLaunchStarted = 0 | |
| 793 | + | } else { | |
| 794 | + | x.xLaunchStarted = purego.NewCallback(func(ContextVarp uintptr, InfoVarp uintptr, PlatformDataVarp *glib.Variant) { | |
| 795 | + | cb(AppLaunchContextNewFromInternalPtr(ContextVarp), &AppInfoBase{Ptr: InfoVarp}, PlatformDataVarp) | |
| 796 | + | }) | |
| 797 | + | } | |
| 798 | + | } | |
| 799 | + | ||
| 800 | + | // GetLaunchStarted gets the callback function. | |
| 801 | + | func (x *AppLaunchContextClass) GetLaunchStarted() func(*AppLaunchContext, AppInfo, *glib.Variant) { | |
| 802 | + | if x.xLaunchStarted == 0 { | |
| 803 | + | return nil | |
| 804 | + | } | |
| 805 | + | var rawCallback func(ContextVarp uintptr, InfoVarp uintptr, PlatformDataVarp *glib.Variant) | |
| 806 | + | purego.RegisterFunc(&rawCallback, x.xLaunchStarted) | |
| 807 | + | return func(ContextVar *AppLaunchContext, InfoVar AppInfo, PlatformDataVar *glib.Variant) { | |
| 808 | + | rawCallback(ContextVar.GoPointer(), InfoVar.GoPointer(), PlatformDataVar) | |
| 809 | + | } | |
| 810 | + | } | |
| 811 | + | ||
| 812 | + | // OverrideGReserved1 sets the callback function. | |
| 813 | + | func (x *AppLaunchContextClass) OverrideGReserved1(cb func()) { | |
| 814 | + | if cb == nil { | |
| 815 | + | x.xGReserved1 = 0 | |
| 816 | + | } else { | |
| 817 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 818 | + | cb() | |
| 819 | + | }) | |
| 820 | + | } | |
| 821 | + | } | |
| 822 | + | ||
| 823 | + | // GetGReserved1 gets the callback function. | |
| 824 | + | func (x *AppLaunchContextClass) GetGReserved1() func() { | |
| 825 | + | if x.xGReserved1 == 0 { | |
| 826 | + | return nil | |
| 827 | + | } | |
| 828 | + | var rawCallback func() | |
| 829 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 830 | + | return func() { | |
| 831 | + | rawCallback() | |
| 832 | + | } | |
| 833 | + | } | |
| 834 | + | ||
| 835 | + | // OverrideGReserved2 sets the callback function. | |
| 836 | + | func (x *AppLaunchContextClass) OverrideGReserved2(cb func()) { | |
| 837 | + | if cb == nil { | |
| 838 | + | x.xGReserved2 = 0 | |
| 839 | + | } else { | |
| 840 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 841 | + | cb() | |
| 842 | + | }) | |
| 843 | + | } | |
| 844 | + | } | |
| 845 | + | ||
| 846 | + | // GetGReserved2 gets the callback function. | |
| 847 | + | func (x *AppLaunchContextClass) GetGReserved2() func() { | |
| 848 | + | if x.xGReserved2 == 0 { | |
| 849 | + | return nil | |
| 850 | + | } | |
| 851 | + | var rawCallback func() | |
| 852 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 853 | + | return func() { | |
| 854 | + | rawCallback() | |
| 855 | + | } | |
| 856 | + | } | |
| 857 | + | ||
| 858 | + | // OverrideGReserved3 sets the callback function. | |
| 859 | + | func (x *AppLaunchContextClass) OverrideGReserved3(cb func()) { | |
| 860 | + | if cb == nil { | |
| 861 | + | x.xGReserved3 = 0 | |
| 862 | + | } else { | |
| 863 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 864 | + | cb() | |
| 865 | + | }) | |
| 866 | + | } | |
| 867 | + | } | |
| 868 | + | ||
| 869 | + | // GetGReserved3 gets the callback function. | |
| 870 | + | func (x *AppLaunchContextClass) GetGReserved3() func() { | |
| 871 | + | if x.xGReserved3 == 0 { | |
| 872 | + | return nil | |
| 873 | + | } | |
| 874 | + | var rawCallback func() | |
| 875 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 876 | + | return func() { | |
| 877 | + | rawCallback() | |
| 878 | + | } | |
| 879 | + | } | |
| 880 | + | ||
| 36 | 881 | type AppLaunchContextPrivate struct { | |
| 37 | 882 | _ structs.HostLayout | |
| 38 | 883 | } | |
| @@ -94,7 +939,7 @@ func (x *AppLaunchContextPrivate) GoPointer() uintptr { | |||
| 94 | 939 | type AppInfo interface { | |
| 95 | 940 | GoPointer() uintptr | |
| 96 | 941 | SetGoPointer(uintptr) | |
| 97 | - | AddSupportsType(ContentTypeVar string) bool | |
| 942 | + | AddSupportsType(ContentTypeVar string) (bool, error) | |
| 98 | 943 | CanDelete() bool | |
| 99 | 944 | CanRemoveSupportsType() bool | |
| 100 | 945 | Delete() bool | |
| @@ -108,14 +953,14 @@ type AppInfo interface { | |||
| 108 | 953 | GetId() string | |
| 109 | 954 | GetName() string | |
| 110 | 955 | GetSupportedTypes() []string | |
| 111 | - | Launch(FilesVar *glib.List, ContextVar *AppLaunchContext) bool | |
| 112 | - | LaunchUris(UrisVar *glib.List, ContextVar *AppLaunchContext) bool | |
| 956 | + | Launch(FilesVar *glib.List, ContextVar *AppLaunchContext) (bool, error) | |
| 957 | + | LaunchUris(UrisVar *glib.List, ContextVar *AppLaunchContext) (bool, error) | |
| 113 | 958 | LaunchUrisAsync(UrisVar *glib.List, ContextVar *AppLaunchContext, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 114 | - | LaunchUrisFinish(ResultVar AsyncResult) bool | |
| 115 | - | RemoveSupportsType(ContentTypeVar string) bool | |
| 116 | - | SetAsDefaultForExtension(ExtensionVar string) bool | |
| 117 | - | SetAsDefaultForType(ContentTypeVar string) bool | |
| 118 | - | SetAsLastUsedForType(ContentTypeVar string) bool | |
| 959 | + | LaunchUrisFinish(ResultVar AsyncResult) (bool, error) | |
| 960 | + | RemoveSupportsType(ContentTypeVar string) (bool, error) | |
| 961 | + | SetAsDefaultForExtension(ExtensionVar string) (bool, error) | |
| 962 | + | SetAsDefaultForType(ContentTypeVar string) (bool, error) | |
| 963 | + | SetAsLastUsedForType(ContentTypeVar string) (bool, error) | |
| 119 | 964 | ShouldShow() bool | |
| 120 | 965 | SupportsFiles() bool | |
| 121 | 966 | SupportsUris() bool | |
M v4/gio/gapplication.go +376 -1
| @@ -16,7 +16,37 @@ import ( | |||
| 16 | 16 | type ApplicationClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | + | ||
| 21 | + | xStartup uintptr | |
| 22 | + | ||
| 23 | + | xActivate uintptr | |
| 24 | + | ||
| 25 | + | xOpen uintptr | |
| 26 | + | ||
| 27 | + | xCommandLine uintptr | |
| 28 | + | ||
| 29 | + | xLocalCommandLine uintptr | |
| 30 | + | ||
| 31 | + | xBeforeEmit uintptr | |
| 32 | + | ||
| 33 | + | xAfterEmit uintptr | |
| 34 | + | ||
| 35 | + | xAddPlatformData uintptr | |
| 36 | + | ||
| 37 | + | xQuitMainloop uintptr | |
| 38 | + | ||
| 39 | + | xRunMainloop uintptr | |
| 40 | + | ||
| 41 | + | xShutdown uintptr | |
| 42 | + | ||
| 43 | + | xDbusRegister uintptr | |
| 44 | + | ||
| 45 | + | xDbusUnregister uintptr | |
| 46 | + | ||
| 47 | + | xHandleLocalOptions uintptr | |
| 48 | + | ||
| 49 | + | xNameLost uintptr | |
| 20 | 50 | ||
| 21 | 51 | Padding [7]uintptr | |
| 22 | 52 | } | |
| @@ -25,6 +55,351 @@ func (x *ApplicationClass) GoPointer() uintptr { | |||
| 25 | 55 | return uintptr(unsafe.Pointer(x)) | |
| 26 | 56 | } | |
| 27 | 57 | ||
| 58 | + | // OverrideStartup sets the callback function. | |
| 59 | + | func (x *ApplicationClass) OverrideStartup(cb func(*Application)) { | |
| 60 | + | if cb == nil { | |
| 61 | + | x.xStartup = 0 | |
| 62 | + | } else { | |
| 63 | + | x.xStartup = purego.NewCallback(func(ApplicationVarp uintptr) { | |
| 64 | + | cb(ApplicationNewFromInternalPtr(ApplicationVarp)) | |
| 65 | + | }) | |
| 66 | + | } | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | // GetStartup gets the callback function. | |
| 70 | + | func (x *ApplicationClass) GetStartup() func(*Application) { | |
| 71 | + | if x.xStartup == 0 { | |
| 72 | + | return nil | |
| 73 | + | } | |
| 74 | + | var rawCallback func(ApplicationVarp uintptr) | |
| 75 | + | purego.RegisterFunc(&rawCallback, x.xStartup) | |
| 76 | + | return func(ApplicationVar *Application) { | |
| 77 | + | rawCallback(ApplicationVar.GoPointer()) | |
| 78 | + | } | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | // OverrideActivate sets the callback function. | |
| 82 | + | func (x *ApplicationClass) OverrideActivate(cb func(*Application)) { | |
| 83 | + | if cb == nil { | |
| 84 | + | x.xActivate = 0 | |
| 85 | + | } else { | |
| 86 | + | x.xActivate = purego.NewCallback(func(ApplicationVarp uintptr) { | |
| 87 | + | cb(ApplicationNewFromInternalPtr(ApplicationVarp)) | |
| 88 | + | }) | |
| 89 | + | } | |
| 90 | + | } | |
| 91 | + | ||
| 92 | + | // GetActivate gets the callback function. | |
| 93 | + | func (x *ApplicationClass) GetActivate() func(*Application) { | |
| 94 | + | if x.xActivate == 0 { | |
| 95 | + | return nil | |
| 96 | + | } | |
| 97 | + | var rawCallback func(ApplicationVarp uintptr) | |
| 98 | + | purego.RegisterFunc(&rawCallback, x.xActivate) | |
| 99 | + | return func(ApplicationVar *Application) { | |
| 100 | + | rawCallback(ApplicationVar.GoPointer()) | |
| 101 | + | } | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | // OverrideOpen sets the callback function. | |
| 105 | + | func (x *ApplicationClass) OverrideOpen(cb func(*Application, uintptr, int, string)) { | |
| 106 | + | if cb == nil { | |
| 107 | + | x.xOpen = 0 | |
| 108 | + | } else { | |
| 109 | + | x.xOpen = purego.NewCallback(func(ApplicationVarp uintptr, FilesVarp uintptr, NFilesVarp int, HintVarp string) { | |
| 110 | + | cb(ApplicationNewFromInternalPtr(ApplicationVarp), FilesVarp, NFilesVarp, HintVarp) | |
| 111 | + | }) | |
| 112 | + | } | |
| 113 | + | } | |
| 114 | + | ||
| 115 | + | // GetOpen gets the callback function. | |
| 116 | + | func (x *ApplicationClass) GetOpen() func(*Application, uintptr, int, string) { | |
| 117 | + | if x.xOpen == 0 { | |
| 118 | + | return nil | |
| 119 | + | } | |
| 120 | + | var rawCallback func(ApplicationVarp uintptr, FilesVarp uintptr, NFilesVarp int, HintVarp string) | |
| 121 | + | purego.RegisterFunc(&rawCallback, x.xOpen) | |
| 122 | + | return func(ApplicationVar *Application, FilesVar uintptr, NFilesVar int, HintVar string) { | |
| 123 | + | rawCallback(ApplicationVar.GoPointer(), FilesVar, NFilesVar, HintVar) | |
| 124 | + | } | |
| 125 | + | } | |
| 126 | + | ||
| 127 | + | // OverrideCommandLine sets the callback function. | |
| 128 | + | func (x *ApplicationClass) OverrideCommandLine(cb func(*Application, *ApplicationCommandLine) int) { | |
| 129 | + | if cb == nil { | |
| 130 | + | x.xCommandLine = 0 | |
| 131 | + | } else { | |
| 132 | + | x.xCommandLine = purego.NewCallback(func(ApplicationVarp uintptr, CommandLineVarp uintptr) int { | |
| 133 | + | return cb(ApplicationNewFromInternalPtr(ApplicationVarp), ApplicationCommandLineNewFromInternalPtr(CommandLineVarp)) | |
| 134 | + | }) | |
| 135 | + | } | |
| 136 | + | } | |
| 137 | + | ||
| 138 | + | // GetCommandLine gets the callback function. | |
| 139 | + | func (x *ApplicationClass) GetCommandLine() func(*Application, *ApplicationCommandLine) int { | |
| 140 | + | if x.xCommandLine == 0 { | |
| 141 | + | return nil | |
| 142 | + | } | |
| 143 | + | var rawCallback func(ApplicationVarp uintptr, CommandLineVarp uintptr) int | |
| 144 | + | purego.RegisterFunc(&rawCallback, x.xCommandLine) | |
| 145 | + | return func(ApplicationVar *Application, CommandLineVar *ApplicationCommandLine) int { | |
| 146 | + | return rawCallback(ApplicationVar.GoPointer(), CommandLineVar.GoPointer()) | |
| 147 | + | } | |
| 148 | + | } | |
| 149 | + | ||
| 150 | + | // OverrideLocalCommandLine sets the callback function. | |
| 151 | + | func (x *ApplicationClass) OverrideLocalCommandLine(cb func(*Application, []string, int) bool) { | |
| 152 | + | if cb == nil { | |
| 153 | + | x.xLocalCommandLine = 0 | |
| 154 | + | } else { | |
| 155 | + | x.xLocalCommandLine = purego.NewCallback(func(ApplicationVarp uintptr, ArgumentsVarp []string, ExitStatusVarp int) bool { | |
| 156 | + | return cb(ApplicationNewFromInternalPtr(ApplicationVarp), ArgumentsVarp, ExitStatusVarp) | |
| 157 | + | }) | |
| 158 | + | } | |
| 159 | + | } | |
| 160 | + | ||
| 161 | + | // GetLocalCommandLine gets the callback function. | |
| 162 | + | func (x *ApplicationClass) GetLocalCommandLine() func(*Application, []string, int) bool { | |
| 163 | + | if x.xLocalCommandLine == 0 { | |
| 164 | + | return nil | |
| 165 | + | } | |
| 166 | + | var rawCallback func(ApplicationVarp uintptr, ArgumentsVarp []string, ExitStatusVarp int) bool | |
| 167 | + | purego.RegisterFunc(&rawCallback, x.xLocalCommandLine) | |
| 168 | + | return func(ApplicationVar *Application, ArgumentsVar []string, ExitStatusVar int) bool { | |
| 169 | + | return rawCallback(ApplicationVar.GoPointer(), ArgumentsVar, ExitStatusVar) | |
| 170 | + | } | |
| 171 | + | } | |
| 172 | + | ||
| 173 | + | // OverrideBeforeEmit sets the callback function. | |
| 174 | + | func (x *ApplicationClass) OverrideBeforeEmit(cb func(*Application, *glib.Variant)) { | |
| 175 | + | if cb == nil { | |
| 176 | + | x.xBeforeEmit = 0 | |
| 177 | + | } else { | |
| 178 | + | x.xBeforeEmit = purego.NewCallback(func(ApplicationVarp uintptr, PlatformDataVarp *glib.Variant) { | |
| 179 | + | cb(ApplicationNewFromInternalPtr(ApplicationVarp), PlatformDataVarp) | |
| 180 | + | }) | |
| 181 | + | } | |
| 182 | + | } | |
| 183 | + | ||
| 184 | + | // GetBeforeEmit gets the callback function. | |
| 185 | + | func (x *ApplicationClass) GetBeforeEmit() func(*Application, *glib.Variant) { | |
| 186 | + | if x.xBeforeEmit == 0 { | |
| 187 | + | return nil | |
| 188 | + | } | |
| 189 | + | var rawCallback func(ApplicationVarp uintptr, PlatformDataVarp *glib.Variant) | |
| 190 | + | purego.RegisterFunc(&rawCallback, x.xBeforeEmit) | |
| 191 | + | return func(ApplicationVar *Application, PlatformDataVar *glib.Variant) { | |
| 192 | + | rawCallback(ApplicationVar.GoPointer(), PlatformDataVar) | |
| 193 | + | } | |
| 194 | + | } | |
| 195 | + | ||
| 196 | + | // OverrideAfterEmit sets the callback function. | |
| 197 | + | func (x *ApplicationClass) OverrideAfterEmit(cb func(*Application, *glib.Variant)) { | |
| 198 | + | if cb == nil { | |
| 199 | + | x.xAfterEmit = 0 | |
| 200 | + | } else { | |
| 201 | + | x.xAfterEmit = purego.NewCallback(func(ApplicationVarp uintptr, PlatformDataVarp *glib.Variant) { | |
| 202 | + | cb(ApplicationNewFromInternalPtr(ApplicationVarp), PlatformDataVarp) | |
| 203 | + | }) | |
| 204 | + | } | |
| 205 | + | } | |
| 206 | + | ||
| 207 | + | // GetAfterEmit gets the callback function. | |
| 208 | + | func (x *ApplicationClass) GetAfterEmit() func(*Application, *glib.Variant) { | |
| 209 | + | if x.xAfterEmit == 0 { | |
| 210 | + | return nil | |
| 211 | + | } | |
| 212 | + | var rawCallback func(ApplicationVarp uintptr, PlatformDataVarp *glib.Variant) | |
| 213 | + | purego.RegisterFunc(&rawCallback, x.xAfterEmit) | |
| 214 | + | return func(ApplicationVar *Application, PlatformDataVar *glib.Variant) { | |
| 215 | + | rawCallback(ApplicationVar.GoPointer(), PlatformDataVar) | |
| 216 | + | } | |
| 217 | + | } | |
| 218 | + | ||
| 219 | + | // OverrideAddPlatformData sets the callback function. | |
| 220 | + | func (x *ApplicationClass) OverrideAddPlatformData(cb func(*Application, *glib.VariantBuilder)) { | |
| 221 | + | if cb == nil { | |
| 222 | + | x.xAddPlatformData = 0 | |
| 223 | + | } else { | |
| 224 | + | x.xAddPlatformData = purego.NewCallback(func(ApplicationVarp uintptr, BuilderVarp *glib.VariantBuilder) { | |
| 225 | + | cb(ApplicationNewFromInternalPtr(ApplicationVarp), BuilderVarp) | |
| 226 | + | }) | |
| 227 | + | } | |
| 228 | + | } | |
| 229 | + | ||
| 230 | + | // GetAddPlatformData gets the callback function. | |
| 231 | + | func (x *ApplicationClass) GetAddPlatformData() func(*Application, *glib.VariantBuilder) { | |
| 232 | + | if x.xAddPlatformData == 0 { | |
| 233 | + | return nil | |
| 234 | + | } | |
| 235 | + | var rawCallback func(ApplicationVarp uintptr, BuilderVarp *glib.VariantBuilder) | |
| 236 | + | purego.RegisterFunc(&rawCallback, x.xAddPlatformData) | |
| 237 | + | return func(ApplicationVar *Application, BuilderVar *glib.VariantBuilder) { | |
| 238 | + | rawCallback(ApplicationVar.GoPointer(), BuilderVar) | |
| 239 | + | } | |
| 240 | + | } | |
| 241 | + | ||
| 242 | + | // OverrideQuitMainloop sets the callback function. | |
| 243 | + | func (x *ApplicationClass) OverrideQuitMainloop(cb func(*Application)) { | |
| 244 | + | if cb == nil { | |
| 245 | + | x.xQuitMainloop = 0 | |
| 246 | + | } else { | |
| 247 | + | x.xQuitMainloop = purego.NewCallback(func(ApplicationVarp uintptr) { | |
| 248 | + | cb(ApplicationNewFromInternalPtr(ApplicationVarp)) | |
| 249 | + | }) | |
| 250 | + | } | |
| 251 | + | } | |
| 252 | + | ||
| 253 | + | // GetQuitMainloop gets the callback function. | |
| 254 | + | func (x *ApplicationClass) GetQuitMainloop() func(*Application) { | |
| 255 | + | if x.xQuitMainloop == 0 { | |
| 256 | + | return nil | |
| 257 | + | } | |
| 258 | + | var rawCallback func(ApplicationVarp uintptr) | |
| 259 | + | purego.RegisterFunc(&rawCallback, x.xQuitMainloop) | |
| 260 | + | return func(ApplicationVar *Application) { | |
| 261 | + | rawCallback(ApplicationVar.GoPointer()) | |
| 262 | + | } | |
| 263 | + | } | |
| 264 | + | ||
| 265 | + | // OverrideRunMainloop sets the callback function. | |
| 266 | + | func (x *ApplicationClass) OverrideRunMainloop(cb func(*Application)) { | |
| 267 | + | if cb == nil { | |
| 268 | + | x.xRunMainloop = 0 | |
| 269 | + | } else { | |
| 270 | + | x.xRunMainloop = purego.NewCallback(func(ApplicationVarp uintptr) { | |
| 271 | + | cb(ApplicationNewFromInternalPtr(ApplicationVarp)) | |
| 272 | + | }) | |
| 273 | + | } | |
| 274 | + | } | |
| 275 | + | ||
| 276 | + | // GetRunMainloop gets the callback function. | |
| 277 | + | func (x *ApplicationClass) GetRunMainloop() func(*Application) { | |
| 278 | + | if x.xRunMainloop == 0 { | |
| 279 | + | return nil | |
| 280 | + | } | |
| 281 | + | var rawCallback func(ApplicationVarp uintptr) | |
| 282 | + | purego.RegisterFunc(&rawCallback, x.xRunMainloop) | |
| 283 | + | return func(ApplicationVar *Application) { | |
| 284 | + | rawCallback(ApplicationVar.GoPointer()) | |
| 285 | + | } | |
| 286 | + | } | |
| 287 | + | ||
| 288 | + | // OverrideShutdown sets the callback function. | |
| 289 | + | func (x *ApplicationClass) OverrideShutdown(cb func(*Application)) { | |
| 290 | + | if cb == nil { | |
| 291 | + | x.xShutdown = 0 | |
| 292 | + | } else { | |
| 293 | + | x.xShutdown = purego.NewCallback(func(ApplicationVarp uintptr) { | |
| 294 | + | cb(ApplicationNewFromInternalPtr(ApplicationVarp)) | |
| 295 | + | }) | |
| 296 | + | } | |
| 297 | + | } | |
| 298 | + | ||
| 299 | + | // GetShutdown gets the callback function. | |
| 300 | + | func (x *ApplicationClass) GetShutdown() func(*Application) { | |
| 301 | + | if x.xShutdown == 0 { | |
| 302 | + | return nil | |
| 303 | + | } | |
| 304 | + | var rawCallback func(ApplicationVarp uintptr) | |
| 305 | + | purego.RegisterFunc(&rawCallback, x.xShutdown) | |
| 306 | + | return func(ApplicationVar *Application) { | |
| 307 | + | rawCallback(ApplicationVar.GoPointer()) | |
| 308 | + | } | |
| 309 | + | } | |
| 310 | + | ||
| 311 | + | // OverrideDbusRegister sets the callback function. | |
| 312 | + | func (x *ApplicationClass) OverrideDbusRegister(cb func(*Application, *DBusConnection, string) bool) { | |
| 313 | + | if cb == nil { | |
| 314 | + | x.xDbusRegister = 0 | |
| 315 | + | } else { | |
| 316 | + | x.xDbusRegister = purego.NewCallback(func(ApplicationVarp uintptr, ConnectionVarp uintptr, ObjectPathVarp string) bool { | |
| 317 | + | return cb(ApplicationNewFromInternalPtr(ApplicationVarp), DBusConnectionNewFromInternalPtr(ConnectionVarp), ObjectPathVarp) | |
| 318 | + | }) | |
| 319 | + | } | |
| 320 | + | } | |
| 321 | + | ||
| 322 | + | // GetDbusRegister gets the callback function. | |
| 323 | + | func (x *ApplicationClass) GetDbusRegister() func(*Application, *DBusConnection, string) bool { | |
| 324 | + | if x.xDbusRegister == 0 { | |
| 325 | + | return nil | |
| 326 | + | } | |
| 327 | + | var rawCallback func(ApplicationVarp uintptr, ConnectionVarp uintptr, ObjectPathVarp string) bool | |
| 328 | + | purego.RegisterFunc(&rawCallback, x.xDbusRegister) | |
| 329 | + | return func(ApplicationVar *Application, ConnectionVar *DBusConnection, ObjectPathVar string) bool { | |
| 330 | + | return rawCallback(ApplicationVar.GoPointer(), ConnectionVar.GoPointer(), ObjectPathVar) | |
| 331 | + | } | |
| 332 | + | } | |
| 333 | + | ||
| 334 | + | // OverrideDbusUnregister sets the callback function. | |
| 335 | + | func (x *ApplicationClass) OverrideDbusUnregister(cb func(*Application, *DBusConnection, string)) { | |
| 336 | + | if cb == nil { | |
| 337 | + | x.xDbusUnregister = 0 | |
| 338 | + | } else { | |
| 339 | + | x.xDbusUnregister = purego.NewCallback(func(ApplicationVarp uintptr, ConnectionVarp uintptr, ObjectPathVarp string) { | |
| 340 | + | cb(ApplicationNewFromInternalPtr(ApplicationVarp), DBusConnectionNewFromInternalPtr(ConnectionVarp), ObjectPathVarp) | |
| 341 | + | }) | |
| 342 | + | } | |
| 343 | + | } | |
| 344 | + | ||
| 345 | + | // GetDbusUnregister gets the callback function. | |
| 346 | + | func (x *ApplicationClass) GetDbusUnregister() func(*Application, *DBusConnection, string) { | |
| 347 | + | if x.xDbusUnregister == 0 { | |
| 348 | + | return nil | |
| 349 | + | } | |
| 350 | + | var rawCallback func(ApplicationVarp uintptr, ConnectionVarp uintptr, ObjectPathVarp string) | |
| 351 | + | purego.RegisterFunc(&rawCallback, x.xDbusUnregister) | |
| 352 | + | return func(ApplicationVar *Application, ConnectionVar *DBusConnection, ObjectPathVar string) { | |
| 353 | + | rawCallback(ApplicationVar.GoPointer(), ConnectionVar.GoPointer(), ObjectPathVar) | |
| 354 | + | } | |
| 355 | + | } | |
| 356 | + | ||
| 357 | + | // OverrideHandleLocalOptions sets the callback function. | |
| 358 | + | func (x *ApplicationClass) OverrideHandleLocalOptions(cb func(*Application, *glib.VariantDict) int) { | |
| 359 | + | if cb == nil { | |
| 360 | + | x.xHandleLocalOptions = 0 | |
| 361 | + | } else { | |
| 362 | + | x.xHandleLocalOptions = purego.NewCallback(func(ApplicationVarp uintptr, OptionsVarp *glib.VariantDict) int { | |
| 363 | + | return cb(ApplicationNewFromInternalPtr(ApplicationVarp), OptionsVarp) | |
| 364 | + | }) | |
| 365 | + | } | |
| 366 | + | } | |
| 367 | + | ||
| 368 | + | // GetHandleLocalOptions gets the callback function. | |
| 369 | + | func (x *ApplicationClass) GetHandleLocalOptions() func(*Application, *glib.VariantDict) int { | |
| 370 | + | if x.xHandleLocalOptions == 0 { | |
| 371 | + | return nil | |
| 372 | + | } | |
| 373 | + | var rawCallback func(ApplicationVarp uintptr, OptionsVarp *glib.VariantDict) int | |
| 374 | + | purego.RegisterFunc(&rawCallback, x.xHandleLocalOptions) | |
| 375 | + | return func(ApplicationVar *Application, OptionsVar *glib.VariantDict) int { | |
| 376 | + | return rawCallback(ApplicationVar.GoPointer(), OptionsVar) | |
| 377 | + | } | |
| 378 | + | } | |
| 379 | + | ||
| 380 | + | // OverrideNameLost sets the callback function. | |
| 381 | + | func (x *ApplicationClass) OverrideNameLost(cb func(*Application) bool) { | |
| 382 | + | if cb == nil { | |
| 383 | + | x.xNameLost = 0 | |
| 384 | + | } else { | |
| 385 | + | x.xNameLost = purego.NewCallback(func(ApplicationVarp uintptr) bool { | |
| 386 | + | return cb(ApplicationNewFromInternalPtr(ApplicationVarp)) | |
| 387 | + | }) | |
| 388 | + | } | |
| 389 | + | } | |
| 390 | + | ||
| 391 | + | // GetNameLost gets the callback function. | |
| 392 | + | func (x *ApplicationClass) GetNameLost() func(*Application) bool { | |
| 393 | + | if x.xNameLost == 0 { | |
| 394 | + | return nil | |
| 395 | + | } | |
| 396 | + | var rawCallback func(ApplicationVarp uintptr) bool | |
| 397 | + | purego.RegisterFunc(&rawCallback, x.xNameLost) | |
| 398 | + | return func(ApplicationVar *Application) bool { | |
| 399 | + | return rawCallback(ApplicationVar.GoPointer()) | |
| 400 | + | } | |
| 401 | + | } | |
| 402 | + | ||
| 28 | 403 | type ApplicationPrivate struct { | |
| 29 | 404 | _ structs.HostLayout | |
| 30 | 405 | } | |
M v4/gio/gapplicationcommandline.go +86 -1
| @@ -17,7 +17,13 @@ import ( | |||
| 17 | 17 | type ApplicationCommandLineClass struct { | |
| 18 | 18 | _ structs.HostLayout | |
| 19 | 19 | ||
| 20 | - | ParentClass uintptr | |
| 20 | + | ParentClass gobject.ObjectClass | |
| 21 | + | ||
| 22 | + | xPrintLiteral uintptr | |
| 23 | + | ||
| 24 | + | xPrinterrLiteral uintptr | |
| 25 | + | ||
| 26 | + | xGetStdin uintptr | |
| 21 | 27 | ||
| 22 | 28 | Padding [11]uintptr | |
| 23 | 29 | } | |
| @@ -26,6 +32,85 @@ func (x *ApplicationCommandLineClass) GoPointer() uintptr { | |||
| 26 | 32 | return uintptr(unsafe.Pointer(x)) | |
| 27 | 33 | } | |
| 28 | 34 | ||
| 35 | + | // OverridePrintLiteral sets the callback function. | |
| 36 | + | func (x *ApplicationCommandLineClass) OverridePrintLiteral(cb func(*ApplicationCommandLine, string)) { | |
| 37 | + | if cb == nil { | |
| 38 | + | x.xPrintLiteral = 0 | |
| 39 | + | } else { | |
| 40 | + | x.xPrintLiteral = purego.NewCallback(func(CmdlineVarp uintptr, MessageVarp string) { | |
| 41 | + | cb(ApplicationCommandLineNewFromInternalPtr(CmdlineVarp), MessageVarp) | |
| 42 | + | }) | |
| 43 | + | } | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | // GetPrintLiteral gets the callback function. | |
| 47 | + | func (x *ApplicationCommandLineClass) GetPrintLiteral() func(*ApplicationCommandLine, string) { | |
| 48 | + | if x.xPrintLiteral == 0 { | |
| 49 | + | return nil | |
| 50 | + | } | |
| 51 | + | var rawCallback func(CmdlineVarp uintptr, MessageVarp string) | |
| 52 | + | purego.RegisterFunc(&rawCallback, x.xPrintLiteral) | |
| 53 | + | return func(CmdlineVar *ApplicationCommandLine, MessageVar string) { | |
| 54 | + | rawCallback(CmdlineVar.GoPointer(), MessageVar) | |
| 55 | + | } | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | // OverridePrinterrLiteral sets the callback function. | |
| 59 | + | func (x *ApplicationCommandLineClass) OverridePrinterrLiteral(cb func(*ApplicationCommandLine, string)) { | |
| 60 | + | if cb == nil { | |
| 61 | + | x.xPrinterrLiteral = 0 | |
| 62 | + | } else { | |
| 63 | + | x.xPrinterrLiteral = purego.NewCallback(func(CmdlineVarp uintptr, MessageVarp string) { | |
| 64 | + | cb(ApplicationCommandLineNewFromInternalPtr(CmdlineVarp), MessageVarp) | |
| 65 | + | }) | |
| 66 | + | } | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | // GetPrinterrLiteral gets the callback function. | |
| 70 | + | func (x *ApplicationCommandLineClass) GetPrinterrLiteral() func(*ApplicationCommandLine, string) { | |
| 71 | + | if x.xPrinterrLiteral == 0 { | |
| 72 | + | return nil | |
| 73 | + | } | |
| 74 | + | var rawCallback func(CmdlineVarp uintptr, MessageVarp string) | |
| 75 | + | purego.RegisterFunc(&rawCallback, x.xPrinterrLiteral) | |
| 76 | + | return func(CmdlineVar *ApplicationCommandLine, MessageVar string) { | |
| 77 | + | rawCallback(CmdlineVar.GoPointer(), MessageVar) | |
| 78 | + | } | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | // OverrideGetStdin sets the callback function. | |
| 82 | + | func (x *ApplicationCommandLineClass) OverrideGetStdin(cb func(*ApplicationCommandLine) *InputStream) { | |
| 83 | + | if cb == nil { | |
| 84 | + | x.xGetStdin = 0 | |
| 85 | + | } else { | |
| 86 | + | x.xGetStdin = purego.NewCallback(func(CmdlineVarp uintptr) uintptr { | |
| 87 | + | ret := cb(ApplicationCommandLineNewFromInternalPtr(CmdlineVarp)) | |
| 88 | + | if ret == nil { | |
| 89 | + | return 0 | |
| 90 | + | } | |
| 91 | + | return ret.GoPointer() | |
| 92 | + | }) | |
| 93 | + | } | |
| 94 | + | } | |
| 95 | + | ||
| 96 | + | // GetGetStdin gets the callback function. | |
| 97 | + | func (x *ApplicationCommandLineClass) GetGetStdin() func(*ApplicationCommandLine) *InputStream { | |
| 98 | + | if x.xGetStdin == 0 { | |
| 99 | + | return nil | |
| 100 | + | } | |
| 101 | + | var rawCallback func(CmdlineVarp uintptr) uintptr | |
| 102 | + | purego.RegisterFunc(&rawCallback, x.xGetStdin) | |
| 103 | + | return func(CmdlineVar *ApplicationCommandLine) *InputStream { | |
| 104 | + | rawRet := rawCallback(CmdlineVar.GoPointer()) | |
| 105 | + | if rawRet == 0 { | |
| 106 | + | return nil | |
| 107 | + | } | |
| 108 | + | ret := &InputStream{} | |
| 109 | + | ret.Ptr = rawRet | |
| 110 | + | return ret | |
| 111 | + | } | |
| 112 | + | } | |
| 113 | + | ||
| 29 | 114 | type ApplicationCommandLinePrivate struct { | |
| 30 | 115 | _ structs.HostLayout | |
| 31 | 116 | } | |
M v4/gio/gasyncinitable.go +52 -2
| @@ -18,12 +18,62 @@ type AsyncInitableIface struct { | |||
| 18 | 18 | _ structs.HostLayout | |
| 19 | 19 | ||
| 20 | 20 | GIface uintptr | |
| 21 | + | ||
| 22 | + | xInitAsync uintptr | |
| 23 | + | ||
| 24 | + | xInitFinish uintptr | |
| 21 | 25 | } | |
| 22 | 26 | ||
| 23 | 27 | func (x *AsyncInitableIface) GoPointer() uintptr { | |
| 24 | 28 | return uintptr(unsafe.Pointer(x)) | |
| 25 | 29 | } | |
| 26 | 30 | ||
| 31 | + | // OverrideInitAsync sets the callback function. | |
| 32 | + | func (x *AsyncInitableIface) OverrideInitAsync(cb func(AsyncInitable, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 33 | + | if cb == nil { | |
| 34 | + | x.xInitAsync = 0 | |
| 35 | + | } else { | |
| 36 | + | x.xInitAsync = purego.NewCallback(func(InitableVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 37 | + | cb(&AsyncInitableBase{Ptr: InitableVarp}, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 38 | + | }) | |
| 39 | + | } | |
| 40 | + | } | |
| 41 | + | ||
| 42 | + | // GetInitAsync gets the callback function. | |
| 43 | + | func (x *AsyncInitableIface) GetInitAsync() func(AsyncInitable, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 44 | + | if x.xInitAsync == 0 { | |
| 45 | + | return nil | |
| 46 | + | } | |
| 47 | + | var rawCallback func(InitableVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 48 | + | purego.RegisterFunc(&rawCallback, x.xInitAsync) | |
| 49 | + | return func(InitableVar AsyncInitable, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 50 | + | rawCallback(InitableVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 51 | + | } | |
| 52 | + | } | |
| 53 | + | ||
| 54 | + | // OverrideInitFinish sets the callback function. | |
| 55 | + | func (x *AsyncInitableIface) OverrideInitFinish(cb func(AsyncInitable, AsyncResult) bool) { | |
| 56 | + | if cb == nil { | |
| 57 | + | x.xInitFinish = 0 | |
| 58 | + | } else { | |
| 59 | + | x.xInitFinish = purego.NewCallback(func(InitableVarp uintptr, ResVarp uintptr) bool { | |
| 60 | + | return cb(&AsyncInitableBase{Ptr: InitableVarp}, &AsyncResultBase{Ptr: ResVarp}) | |
| 61 | + | }) | |
| 62 | + | } | |
| 63 | + | } | |
| 64 | + | ||
| 65 | + | // GetInitFinish gets the callback function. | |
| 66 | + | func (x *AsyncInitableIface) GetInitFinish() func(AsyncInitable, AsyncResult) bool { | |
| 67 | + | if x.xInitFinish == 0 { | |
| 68 | + | return nil | |
| 69 | + | } | |
| 70 | + | var rawCallback func(InitableVarp uintptr, ResVarp uintptr) bool | |
| 71 | + | purego.RegisterFunc(&rawCallback, x.xInitFinish) | |
| 72 | + | return func(InitableVar AsyncInitable, ResVar AsyncResult) bool { | |
| 73 | + | return rawCallback(InitableVar.GoPointer(), ResVar.GoPointer()) | |
| 74 | + | } | |
| 75 | + | } | |
| 76 | + | ||
| 27 | 77 | // This is the asynchronous version of #GInitable; it behaves the same | |
| 28 | 78 | // in all ways except that initialization is asynchronous. For more details | |
| 29 | 79 | // see the descriptions on #GInitable. | |
| @@ -136,8 +186,8 @@ type AsyncInitable interface { | |||
| 136 | 186 | GoPointer() uintptr | |
| 137 | 187 | SetGoPointer(uintptr) | |
| 138 | 188 | InitAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 139 | - | InitFinish(ResVar AsyncResult) bool | |
| 140 | - | NewFinish(ResVar AsyncResult) *gobject.Object | |
| 189 | + | InitFinish(ResVar AsyncResult) (bool, error) | |
| 190 | + | NewFinish(ResVar AsyncResult) (*gobject.Object, error) | |
| 141 | 191 | } | |
| 142 | 192 | ||
| 143 | 193 | var xAsyncInitableGLibType func() types.GType | |
M v4/gio/gasyncresult.go +86 -1
| @@ -17,12 +17,97 @@ type AsyncResultIface struct { | |||
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | 19 | GIface uintptr | |
| 20 | + | ||
| 21 | + | xGetUserData uintptr | |
| 22 | + | ||
| 23 | + | xGetSourceObject uintptr | |
| 24 | + | ||
| 25 | + | xIsTagged uintptr | |
| 20 | 26 | } | |
| 21 | 27 | ||
| 22 | 28 | func (x *AsyncResultIface) GoPointer() uintptr { | |
| 23 | 29 | return uintptr(unsafe.Pointer(x)) | |
| 24 | 30 | } | |
| 25 | 31 | ||
| 32 | + | // OverrideGetUserData sets the callback function. | |
| 33 | + | func (x *AsyncResultIface) OverrideGetUserData(cb func(AsyncResult) uintptr) { | |
| 34 | + | if cb == nil { | |
| 35 | + | x.xGetUserData = 0 | |
| 36 | + | } else { | |
| 37 | + | x.xGetUserData = purego.NewCallback(func(ResVarp uintptr) uintptr { | |
| 38 | + | return cb(&AsyncResultBase{Ptr: ResVarp}) | |
| 39 | + | }) | |
| 40 | + | } | |
| 41 | + | } | |
| 42 | + | ||
| 43 | + | // GetGetUserData gets the callback function. | |
| 44 | + | func (x *AsyncResultIface) GetGetUserData() func(AsyncResult) uintptr { | |
| 45 | + | if x.xGetUserData == 0 { | |
| 46 | + | return nil | |
| 47 | + | } | |
| 48 | + | var rawCallback func(ResVarp uintptr) uintptr | |
| 49 | + | purego.RegisterFunc(&rawCallback, x.xGetUserData) | |
| 50 | + | return func(ResVar AsyncResult) uintptr { | |
| 51 | + | return rawCallback(ResVar.GoPointer()) | |
| 52 | + | } | |
| 53 | + | } | |
| 54 | + | ||
| 55 | + | // OverrideGetSourceObject sets the callback function. | |
| 56 | + | func (x *AsyncResultIface) OverrideGetSourceObject(cb func(AsyncResult) *gobject.Object) { | |
| 57 | + | if cb == nil { | |
| 58 | + | x.xGetSourceObject = 0 | |
| 59 | + | } else { | |
| 60 | + | x.xGetSourceObject = purego.NewCallback(func(ResVarp uintptr) uintptr { | |
| 61 | + | ret := cb(&AsyncResultBase{Ptr: ResVarp}) | |
| 62 | + | if ret == nil { | |
| 63 | + | return 0 | |
| 64 | + | } | |
| 65 | + | return ret.GoPointer() | |
| 66 | + | }) | |
| 67 | + | } | |
| 68 | + | } | |
| 69 | + | ||
| 70 | + | // GetGetSourceObject gets the callback function. | |
| 71 | + | func (x *AsyncResultIface) GetGetSourceObject() func(AsyncResult) *gobject.Object { | |
| 72 | + | if x.xGetSourceObject == 0 { | |
| 73 | + | return nil | |
| 74 | + | } | |
| 75 | + | var rawCallback func(ResVarp uintptr) uintptr | |
| 76 | + | purego.RegisterFunc(&rawCallback, x.xGetSourceObject) | |
| 77 | + | return func(ResVar AsyncResult) *gobject.Object { | |
| 78 | + | rawRet := rawCallback(ResVar.GoPointer()) | |
| 79 | + | if rawRet == 0 { | |
| 80 | + | return nil | |
| 81 | + | } | |
| 82 | + | ret := &gobject.Object{} | |
| 83 | + | ret.Ptr = rawRet | |
| 84 | + | return ret | |
| 85 | + | } | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | // OverrideIsTagged sets the callback function. | |
| 89 | + | func (x *AsyncResultIface) OverrideIsTagged(cb func(AsyncResult, uintptr) bool) { | |
| 90 | + | if cb == nil { | |
| 91 | + | x.xIsTagged = 0 | |
| 92 | + | } else { | |
| 93 | + | x.xIsTagged = purego.NewCallback(func(ResVarp uintptr, SourceTagVarp uintptr) bool { | |
| 94 | + | return cb(&AsyncResultBase{Ptr: ResVarp}, SourceTagVarp) | |
| 95 | + | }) | |
| 96 | + | } | |
| 97 | + | } | |
| 98 | + | ||
| 99 | + | // GetIsTagged gets the callback function. | |
| 100 | + | func (x *AsyncResultIface) GetIsTagged() func(AsyncResult, uintptr) bool { | |
| 101 | + | if x.xIsTagged == 0 { | |
| 102 | + | return nil | |
| 103 | + | } | |
| 104 | + | var rawCallback func(ResVarp uintptr, SourceTagVarp uintptr) bool | |
| 105 | + | purego.RegisterFunc(&rawCallback, x.xIsTagged) | |
| 106 | + | return func(ResVar AsyncResult, SourceTagVar uintptr) bool { | |
| 107 | + | return rawCallback(ResVar.GoPointer(), SourceTagVar) | |
| 108 | + | } | |
| 109 | + | } | |
| 110 | + | ||
| 26 | 111 | // Provides a base class for implementing asynchronous function results. | |
| 27 | 112 | // | |
| 28 | 113 | // Asynchronous operations are broken up into two separate operations | |
| @@ -119,7 +204,7 @@ type AsyncResult interface { | |||
| 119 | 204 | GetSourceObject() *gobject.Object | |
| 120 | 205 | GetUserData() uintptr | |
| 121 | 206 | IsTagged(SourceTagVar uintptr) bool | |
| 122 | - | LegacyPropagateError() bool | |
| 207 | + | LegacyPropagateError() (bool, error) | |
| 123 | 208 | } | |
| 124 | 209 | ||
| 125 | 210 | var xAsyncResultGLibType func() types.GType | |
M v4/gio/gbufferedinputstream.go +201 -1
| @@ -14,13 +14,213 @@ import ( | |||
| 14 | 14 | type BufferedInputStreamClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass FilterInputStreamClass | |
| 18 | + | ||
| 19 | + | xFill uintptr | |
| 20 | + | ||
| 21 | + | xFillAsync uintptr | |
| 22 | + | ||
| 23 | + | xFillFinish uintptr | |
| 24 | + | ||
| 25 | + | xGReserved1 uintptr | |
| 26 | + | ||
| 27 | + | xGReserved2 uintptr | |
| 28 | + | ||
| 29 | + | xGReserved3 uintptr | |
| 30 | + | ||
| 31 | + | xGReserved4 uintptr | |
| 32 | + | ||
| 33 | + | xGReserved5 uintptr | |
| 18 | 34 | } | |
| 19 | 35 | ||
| 20 | 36 | func (x *BufferedInputStreamClass) GoPointer() uintptr { | |
| 21 | 37 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 38 | } | |
| 23 | 39 | ||
| 40 | + | // OverrideFill sets the callback function. | |
| 41 | + | func (x *BufferedInputStreamClass) OverrideFill(cb func(*BufferedInputStream, int, *Cancellable) int) { | |
| 42 | + | if cb == nil { | |
| 43 | + | x.xFill = 0 | |
| 44 | + | } else { | |
| 45 | + | x.xFill = purego.NewCallback(func(StreamVarp uintptr, CountVarp int, CancellableVarp uintptr) int { | |
| 46 | + | return cb(BufferedInputStreamNewFromInternalPtr(StreamVarp), CountVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 47 | + | }) | |
| 48 | + | } | |
| 49 | + | } | |
| 50 | + | ||
| 51 | + | // GetFill gets the callback function. | |
| 52 | + | func (x *BufferedInputStreamClass) GetFill() func(*BufferedInputStream, int, *Cancellable) int { | |
| 53 | + | if x.xFill == 0 { | |
| 54 | + | return nil | |
| 55 | + | } | |
| 56 | + | var rawCallback func(StreamVarp uintptr, CountVarp int, CancellableVarp uintptr) int | |
| 57 | + | purego.RegisterFunc(&rawCallback, x.xFill) | |
| 58 | + | return func(StreamVar *BufferedInputStream, CountVar int, CancellableVar *Cancellable) int { | |
| 59 | + | return rawCallback(StreamVar.GoPointer(), CountVar, CancellableVar.GoPointer()) | |
| 60 | + | } | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // OverrideFillAsync sets the callback function. | |
| 64 | + | func (x *BufferedInputStreamClass) OverrideFillAsync(cb func(*BufferedInputStream, int, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 65 | + | if cb == nil { | |
| 66 | + | x.xFillAsync = 0 | |
| 67 | + | } else { | |
| 68 | + | x.xFillAsync = purego.NewCallback(func(StreamVarp uintptr, CountVarp int, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 69 | + | cb(BufferedInputStreamNewFromInternalPtr(StreamVarp), CountVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 70 | + | }) | |
| 71 | + | } | |
| 72 | + | } | |
| 73 | + | ||
| 74 | + | // GetFillAsync gets the callback function. | |
| 75 | + | func (x *BufferedInputStreamClass) GetFillAsync() func(*BufferedInputStream, int, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 76 | + | if x.xFillAsync == 0 { | |
| 77 | + | return nil | |
| 78 | + | } | |
| 79 | + | var rawCallback func(StreamVarp uintptr, CountVarp int, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 80 | + | purego.RegisterFunc(&rawCallback, x.xFillAsync) | |
| 81 | + | return func(StreamVar *BufferedInputStream, CountVar int, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 82 | + | rawCallback(StreamVar.GoPointer(), CountVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 83 | + | } | |
| 84 | + | } | |
| 85 | + | ||
| 86 | + | // OverrideFillFinish sets the callback function. | |
| 87 | + | func (x *BufferedInputStreamClass) OverrideFillFinish(cb func(*BufferedInputStream, AsyncResult) int) { | |
| 88 | + | if cb == nil { | |
| 89 | + | x.xFillFinish = 0 | |
| 90 | + | } else { | |
| 91 | + | x.xFillFinish = purego.NewCallback(func(StreamVarp uintptr, ResultVarp uintptr) int { | |
| 92 | + | return cb(BufferedInputStreamNewFromInternalPtr(StreamVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 93 | + | }) | |
| 94 | + | } | |
| 95 | + | } | |
| 96 | + | ||
| 97 | + | // GetFillFinish gets the callback function. | |
| 98 | + | func (x *BufferedInputStreamClass) GetFillFinish() func(*BufferedInputStream, AsyncResult) int { | |
| 99 | + | if x.xFillFinish == 0 { | |
| 100 | + | return nil | |
| 101 | + | } | |
| 102 | + | var rawCallback func(StreamVarp uintptr, ResultVarp uintptr) int | |
| 103 | + | purego.RegisterFunc(&rawCallback, x.xFillFinish) | |
| 104 | + | return func(StreamVar *BufferedInputStream, ResultVar AsyncResult) int { | |
| 105 | + | return rawCallback(StreamVar.GoPointer(), ResultVar.GoPointer()) | |
| 106 | + | } | |
| 107 | + | } | |
| 108 | + | ||
| 109 | + | // OverrideGReserved1 sets the callback function. | |
| 110 | + | func (x *BufferedInputStreamClass) OverrideGReserved1(cb func()) { | |
| 111 | + | if cb == nil { | |
| 112 | + | x.xGReserved1 = 0 | |
| 113 | + | } else { | |
| 114 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 115 | + | cb() | |
| 116 | + | }) | |
| 117 | + | } | |
| 118 | + | } | |
| 119 | + | ||
| 120 | + | // GetGReserved1 gets the callback function. | |
| 121 | + | func (x *BufferedInputStreamClass) GetGReserved1() func() { | |
| 122 | + | if x.xGReserved1 == 0 { | |
| 123 | + | return nil | |
| 124 | + | } | |
| 125 | + | var rawCallback func() | |
| 126 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 127 | + | return func() { | |
| 128 | + | rawCallback() | |
| 129 | + | } | |
| 130 | + | } | |
| 131 | + | ||
| 132 | + | // OverrideGReserved2 sets the callback function. | |
| 133 | + | func (x *BufferedInputStreamClass) OverrideGReserved2(cb func()) { | |
| 134 | + | if cb == nil { | |
| 135 | + | x.xGReserved2 = 0 | |
| 136 | + | } else { | |
| 137 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 138 | + | cb() | |
| 139 | + | }) | |
| 140 | + | } | |
| 141 | + | } | |
| 142 | + | ||
| 143 | + | // GetGReserved2 gets the callback function. | |
| 144 | + | func (x *BufferedInputStreamClass) GetGReserved2() func() { | |
| 145 | + | if x.xGReserved2 == 0 { | |
| 146 | + | return nil | |
| 147 | + | } | |
| 148 | + | var rawCallback func() | |
| 149 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 150 | + | return func() { | |
| 151 | + | rawCallback() | |
| 152 | + | } | |
| 153 | + | } | |
| 154 | + | ||
| 155 | + | // OverrideGReserved3 sets the callback function. | |
| 156 | + | func (x *BufferedInputStreamClass) OverrideGReserved3(cb func()) { | |
| 157 | + | if cb == nil { | |
| 158 | + | x.xGReserved3 = 0 | |
| 159 | + | } else { | |
| 160 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 161 | + | cb() | |
| 162 | + | }) | |
| 163 | + | } | |
| 164 | + | } | |
| 165 | + | ||
| 166 | + | // GetGReserved3 gets the callback function. | |
| 167 | + | func (x *BufferedInputStreamClass) GetGReserved3() func() { | |
| 168 | + | if x.xGReserved3 == 0 { | |
| 169 | + | return nil | |
| 170 | + | } | |
| 171 | + | var rawCallback func() | |
| 172 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 173 | + | return func() { | |
| 174 | + | rawCallback() | |
| 175 | + | } | |
| 176 | + | } | |
| 177 | + | ||
| 178 | + | // OverrideGReserved4 sets the callback function. | |
| 179 | + | func (x *BufferedInputStreamClass) OverrideGReserved4(cb func()) { | |
| 180 | + | if cb == nil { | |
| 181 | + | x.xGReserved4 = 0 | |
| 182 | + | } else { | |
| 183 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 184 | + | cb() | |
| 185 | + | }) | |
| 186 | + | } | |
| 187 | + | } | |
| 188 | + | ||
| 189 | + | // GetGReserved4 gets the callback function. | |
| 190 | + | func (x *BufferedInputStreamClass) GetGReserved4() func() { | |
| 191 | + | if x.xGReserved4 == 0 { | |
| 192 | + | return nil | |
| 193 | + | } | |
| 194 | + | var rawCallback func() | |
| 195 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 196 | + | return func() { | |
| 197 | + | rawCallback() | |
| 198 | + | } | |
| 199 | + | } | |
| 200 | + | ||
| 201 | + | // OverrideGReserved5 sets the callback function. | |
| 202 | + | func (x *BufferedInputStreamClass) OverrideGReserved5(cb func()) { | |
| 203 | + | if cb == nil { | |
| 204 | + | x.xGReserved5 = 0 | |
| 205 | + | } else { | |
| 206 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 207 | + | cb() | |
| 208 | + | }) | |
| 209 | + | } | |
| 210 | + | } | |
| 211 | + | ||
| 212 | + | // GetGReserved5 gets the callback function. | |
| 213 | + | func (x *BufferedInputStreamClass) GetGReserved5() func() { | |
| 214 | + | if x.xGReserved5 == 0 { | |
| 215 | + | return nil | |
| 216 | + | } | |
| 217 | + | var rawCallback func() | |
| 218 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 219 | + | return func() { | |
| 220 | + | rawCallback() | |
| 221 | + | } | |
| 222 | + | } | |
| 223 | + | ||
| 24 | 224 | type BufferedInputStreamPrivate struct { | |
| 25 | 225 | _ structs.HostLayout | |
| 26 | 226 | } | |
M v4/gio/gbufferedoutputstream.go +51 -1
| @@ -14,13 +14,63 @@ import ( | |||
| 14 | 14 | type BufferedOutputStreamClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass FilterOutputStreamClass | |
| 18 | + | ||
| 19 | + | xGReserved1 uintptr | |
| 20 | + | ||
| 21 | + | xGReserved2 uintptr | |
| 18 | 22 | } | |
| 19 | 23 | ||
| 20 | 24 | func (x *BufferedOutputStreamClass) GoPointer() uintptr { | |
| 21 | 25 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 26 | } | |
| 23 | 27 | ||
| 28 | + | // OverrideGReserved1 sets the callback function. | |
| 29 | + | func (x *BufferedOutputStreamClass) OverrideGReserved1(cb func()) { | |
| 30 | + | if cb == nil { | |
| 31 | + | x.xGReserved1 = 0 | |
| 32 | + | } else { | |
| 33 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 34 | + | cb() | |
| 35 | + | }) | |
| 36 | + | } | |
| 37 | + | } | |
| 38 | + | ||
| 39 | + | // GetGReserved1 gets the callback function. | |
| 40 | + | func (x *BufferedOutputStreamClass) GetGReserved1() func() { | |
| 41 | + | if x.xGReserved1 == 0 { | |
| 42 | + | return nil | |
| 43 | + | } | |
| 44 | + | var rawCallback func() | |
| 45 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 46 | + | return func() { | |
| 47 | + | rawCallback() | |
| 48 | + | } | |
| 49 | + | } | |
| 50 | + | ||
| 51 | + | // OverrideGReserved2 sets the callback function. | |
| 52 | + | func (x *BufferedOutputStreamClass) OverrideGReserved2(cb func()) { | |
| 53 | + | if cb == nil { | |
| 54 | + | x.xGReserved2 = 0 | |
| 55 | + | } else { | |
| 56 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 57 | + | cb() | |
| 58 | + | }) | |
| 59 | + | } | |
| 60 | + | } | |
| 61 | + | ||
| 62 | + | // GetGReserved2 gets the callback function. | |
| 63 | + | func (x *BufferedOutputStreamClass) GetGReserved2() func() { | |
| 64 | + | if x.xGReserved2 == 0 { | |
| 65 | + | return nil | |
| 66 | + | } | |
| 67 | + | var rawCallback func() | |
| 68 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 69 | + | return func() { | |
| 70 | + | rawCallback() | |
| 71 | + | } | |
| 72 | + | } | |
| 73 | + | ||
| 24 | 74 | type BufferedOutputStreamPrivate struct { | |
| 25 | 75 | _ structs.HostLayout | |
| 26 | 76 | } | |
M v4/gio/gcancellable.go +151 -1
| @@ -15,13 +15,163 @@ import ( | |||
| 15 | 15 | type CancellableClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xCancelled uintptr | |
| 21 | + | ||
| 22 | + | xGReserved1 uintptr | |
| 23 | + | ||
| 24 | + | xGReserved2 uintptr | |
| 25 | + | ||
| 26 | + | xGReserved3 uintptr | |
| 27 | + | ||
| 28 | + | xGReserved4 uintptr | |
| 29 | + | ||
| 30 | + | xGReserved5 uintptr | |
| 19 | 31 | } | |
| 20 | 32 | ||
| 21 | 33 | func (x *CancellableClass) GoPointer() uintptr { | |
| 22 | 34 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 35 | } | |
| 24 | 36 | ||
| 37 | + | // OverrideCancelled sets the callback function. | |
| 38 | + | func (x *CancellableClass) OverrideCancelled(cb func(*Cancellable)) { | |
| 39 | + | if cb == nil { | |
| 40 | + | x.xCancelled = 0 | |
| 41 | + | } else { | |
| 42 | + | x.xCancelled = purego.NewCallback(func(CancellableVarp uintptr) { | |
| 43 | + | cb(CancellableNewFromInternalPtr(CancellableVarp)) | |
| 44 | + | }) | |
| 45 | + | } | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | // GetCancelled gets the callback function. | |
| 49 | + | func (x *CancellableClass) GetCancelled() func(*Cancellable) { | |
| 50 | + | if x.xCancelled == 0 { | |
| 51 | + | return nil | |
| 52 | + | } | |
| 53 | + | var rawCallback func(CancellableVarp uintptr) | |
| 54 | + | purego.RegisterFunc(&rawCallback, x.xCancelled) | |
| 55 | + | return func(CancellableVar *Cancellable) { | |
| 56 | + | rawCallback(CancellableVar.GoPointer()) | |
| 57 | + | } | |
| 58 | + | } | |
| 59 | + | ||
| 60 | + | // OverrideGReserved1 sets the callback function. | |
| 61 | + | func (x *CancellableClass) OverrideGReserved1(cb func()) { | |
| 62 | + | if cb == nil { | |
| 63 | + | x.xGReserved1 = 0 | |
| 64 | + | } else { | |
| 65 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 66 | + | cb() | |
| 67 | + | }) | |
| 68 | + | } | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | // GetGReserved1 gets the callback function. | |
| 72 | + | func (x *CancellableClass) GetGReserved1() func() { | |
| 73 | + | if x.xGReserved1 == 0 { | |
| 74 | + | return nil | |
| 75 | + | } | |
| 76 | + | var rawCallback func() | |
| 77 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 78 | + | return func() { | |
| 79 | + | rawCallback() | |
| 80 | + | } | |
| 81 | + | } | |
| 82 | + | ||
| 83 | + | // OverrideGReserved2 sets the callback function. | |
| 84 | + | func (x *CancellableClass) OverrideGReserved2(cb func()) { | |
| 85 | + | if cb == nil { | |
| 86 | + | x.xGReserved2 = 0 | |
| 87 | + | } else { | |
| 88 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 89 | + | cb() | |
| 90 | + | }) | |
| 91 | + | } | |
| 92 | + | } | |
| 93 | + | ||
| 94 | + | // GetGReserved2 gets the callback function. | |
| 95 | + | func (x *CancellableClass) GetGReserved2() func() { | |
| 96 | + | if x.xGReserved2 == 0 { | |
| 97 | + | return nil | |
| 98 | + | } | |
| 99 | + | var rawCallback func() | |
| 100 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 101 | + | return func() { | |
| 102 | + | rawCallback() | |
| 103 | + | } | |
| 104 | + | } | |
| 105 | + | ||
| 106 | + | // OverrideGReserved3 sets the callback function. | |
| 107 | + | func (x *CancellableClass) OverrideGReserved3(cb func()) { | |
| 108 | + | if cb == nil { | |
| 109 | + | x.xGReserved3 = 0 | |
| 110 | + | } else { | |
| 111 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 112 | + | cb() | |
| 113 | + | }) | |
| 114 | + | } | |
| 115 | + | } | |
| 116 | + | ||
| 117 | + | // GetGReserved3 gets the callback function. | |
| 118 | + | func (x *CancellableClass) GetGReserved3() func() { | |
| 119 | + | if x.xGReserved3 == 0 { | |
| 120 | + | return nil | |
| 121 | + | } | |
| 122 | + | var rawCallback func() | |
| 123 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 124 | + | return func() { | |
| 125 | + | rawCallback() | |
| 126 | + | } | |
| 127 | + | } | |
| 128 | + | ||
| 129 | + | // OverrideGReserved4 sets the callback function. | |
| 130 | + | func (x *CancellableClass) OverrideGReserved4(cb func()) { | |
| 131 | + | if cb == nil { | |
| 132 | + | x.xGReserved4 = 0 | |
| 133 | + | } else { | |
| 134 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 135 | + | cb() | |
| 136 | + | }) | |
| 137 | + | } | |
| 138 | + | } | |
| 139 | + | ||
| 140 | + | // GetGReserved4 gets the callback function. | |
| 141 | + | func (x *CancellableClass) GetGReserved4() func() { | |
| 142 | + | if x.xGReserved4 == 0 { | |
| 143 | + | return nil | |
| 144 | + | } | |
| 145 | + | var rawCallback func() | |
| 146 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 147 | + | return func() { | |
| 148 | + | rawCallback() | |
| 149 | + | } | |
| 150 | + | } | |
| 151 | + | ||
| 152 | + | // OverrideGReserved5 sets the callback function. | |
| 153 | + | func (x *CancellableClass) OverrideGReserved5(cb func()) { | |
| 154 | + | if cb == nil { | |
| 155 | + | x.xGReserved5 = 0 | |
| 156 | + | } else { | |
| 157 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 158 | + | cb() | |
| 159 | + | }) | |
| 160 | + | } | |
| 161 | + | } | |
| 162 | + | ||
| 163 | + | // GetGReserved5 gets the callback function. | |
| 164 | + | func (x *CancellableClass) GetGReserved5() func() { | |
| 165 | + | if x.xGReserved5 == 0 { | |
| 166 | + | return nil | |
| 167 | + | } | |
| 168 | + | var rawCallback func() | |
| 169 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 170 | + | return func() { | |
| 171 | + | rawCallback() | |
| 172 | + | } | |
| 173 | + | } | |
| 174 | + | ||
| 25 | 175 | type CancellablePrivate struct { | |
| 26 | 176 | _ structs.HostLayout | |
| 27 | 177 | } | |
M v4/gio/gcharsetconverter.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type CharsetConverterClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *CharsetConverterClass) GoPointer() uintptr { | |
M v4/gio/gconverter.go +51 -1
| @@ -18,12 +18,62 @@ type ConverterIface struct { | |||
| 18 | 18 | _ structs.HostLayout | |
| 19 | 19 | ||
| 20 | 20 | GIface uintptr | |
| 21 | + | ||
| 22 | + | xConvert uintptr | |
| 23 | + | ||
| 24 | + | xReset uintptr | |
| 21 | 25 | } | |
| 22 | 26 | ||
| 23 | 27 | func (x *ConverterIface) GoPointer() uintptr { | |
| 24 | 28 | return uintptr(unsafe.Pointer(x)) | |
| 25 | 29 | } | |
| 26 | 30 | ||
| 31 | + | // OverrideConvert sets the callback function. | |
| 32 | + | func (x *ConverterIface) OverrideConvert(cb func(Converter, []byte, uint, []byte, uint, ConverterFlags, uint, uint) ConverterResult) { | |
| 33 | + | if cb == nil { | |
| 34 | + | x.xConvert = 0 | |
| 35 | + | } else { | |
| 36 | + | x.xConvert = purego.NewCallback(func(ConverterVarp uintptr, InbufVarp []byte, InbufSizeVarp uint, OutbufVarp []byte, OutbufSizeVarp uint, FlagsVarp ConverterFlags, BytesReadVarp uint, BytesWrittenVarp uint) ConverterResult { | |
| 37 | + | return cb(&ConverterBase{Ptr: ConverterVarp}, InbufVarp, InbufSizeVarp, OutbufVarp, OutbufSizeVarp, FlagsVarp, BytesReadVarp, BytesWrittenVarp) | |
| 38 | + | }) | |
| 39 | + | } | |
| 40 | + | } | |
| 41 | + | ||
| 42 | + | // GetConvert gets the callback function. | |
| 43 | + | func (x *ConverterIface) GetConvert() func(Converter, []byte, uint, []byte, uint, ConverterFlags, uint, uint) ConverterResult { | |
| 44 | + | if x.xConvert == 0 { | |
| 45 | + | return nil | |
| 46 | + | } | |
| 47 | + | var rawCallback func(ConverterVarp uintptr, InbufVarp []byte, InbufSizeVarp uint, OutbufVarp []byte, OutbufSizeVarp uint, FlagsVarp ConverterFlags, BytesReadVarp uint, BytesWrittenVarp uint) ConverterResult | |
| 48 | + | purego.RegisterFunc(&rawCallback, x.xConvert) | |
| 49 | + | return func(ConverterVar Converter, InbufVar []byte, InbufSizeVar uint, OutbufVar []byte, OutbufSizeVar uint, FlagsVar ConverterFlags, BytesReadVar uint, BytesWrittenVar uint) ConverterResult { | |
| 50 | + | return rawCallback(ConverterVar.GoPointer(), InbufVar, InbufSizeVar, OutbufVar, OutbufSizeVar, FlagsVar, BytesReadVar, BytesWrittenVar) | |
| 51 | + | } | |
| 52 | + | } | |
| 53 | + | ||
| 54 | + | // OverrideReset sets the callback function. | |
| 55 | + | func (x *ConverterIface) OverrideReset(cb func(Converter)) { | |
| 56 | + | if cb == nil { | |
| 57 | + | x.xReset = 0 | |
| 58 | + | } else { | |
| 59 | + | x.xReset = purego.NewCallback(func(ConverterVarp uintptr) { | |
| 60 | + | cb(&ConverterBase{Ptr: ConverterVarp}) | |
| 61 | + | }) | |
| 62 | + | } | |
| 63 | + | } | |
| 64 | + | ||
| 65 | + | // GetReset gets the callback function. | |
| 66 | + | func (x *ConverterIface) GetReset() func(Converter) { | |
| 67 | + | if x.xReset == 0 { | |
| 68 | + | return nil | |
| 69 | + | } | |
| 70 | + | var rawCallback func(ConverterVarp uintptr) | |
| 71 | + | purego.RegisterFunc(&rawCallback, x.xReset) | |
| 72 | + | return func(ConverterVar Converter) { | |
| 73 | + | rawCallback(ConverterVar.GoPointer()) | |
| 74 | + | } | |
| 75 | + | } | |
| 76 | + | ||
| 27 | 77 | // #GConverter is implemented by objects that convert | |
| 28 | 78 | // binary data in various ways. The conversion can be | |
| 29 | 79 | // stateful and may fail at any place. | |
| @@ -34,7 +84,7 @@ func (x *ConverterIface) GoPointer() uintptr { | |||
| 34 | 84 | type Converter interface { | |
| 35 | 85 | GoPointer() uintptr | |
| 36 | 86 | SetGoPointer(uintptr) | |
| 37 | - | Convert(InbufVar []byte, InbufSizeVar uint, OutbufVar []byte, OutbufSizeVar uint, FlagsVar ConverterFlags, BytesReadVar uint, BytesWrittenVar uint) ConverterResult | |
| 87 | + | Convert(InbufVar []byte, InbufSizeVar uint, OutbufVar []byte, OutbufSizeVar uint, FlagsVar ConverterFlags, BytesReadVar uint, BytesWrittenVar uint) (ConverterResult, error) | |
| 38 | 88 | Reset() | |
| 39 | 89 | } | |
| 40 | 90 | ||
M v4/gio/gconverterinputstream.go +126 -1
| @@ -15,13 +15,138 @@ import ( | |||
| 15 | 15 | type ConverterInputStreamClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass FilterInputStreamClass | |
| 19 | + | ||
| 20 | + | xGReserved1 uintptr | |
| 21 | + | ||
| 22 | + | xGReserved2 uintptr | |
| 23 | + | ||
| 24 | + | xGReserved3 uintptr | |
| 25 | + | ||
| 26 | + | xGReserved4 uintptr | |
| 27 | + | ||
| 28 | + | xGReserved5 uintptr | |
| 19 | 29 | } | |
| 20 | 30 | ||
| 21 | 31 | func (x *ConverterInputStreamClass) GoPointer() uintptr { | |
| 22 | 32 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 33 | } | |
| 24 | 34 | ||
| 35 | + | // OverrideGReserved1 sets the callback function. | |
| 36 | + | func (x *ConverterInputStreamClass) OverrideGReserved1(cb func()) { | |
| 37 | + | if cb == nil { | |
| 38 | + | x.xGReserved1 = 0 | |
| 39 | + | } else { | |
| 40 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 41 | + | cb() | |
| 42 | + | }) | |
| 43 | + | } | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | // GetGReserved1 gets the callback function. | |
| 47 | + | func (x *ConverterInputStreamClass) GetGReserved1() func() { | |
| 48 | + | if x.xGReserved1 == 0 { | |
| 49 | + | return nil | |
| 50 | + | } | |
| 51 | + | var rawCallback func() | |
| 52 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 53 | + | return func() { | |
| 54 | + | rawCallback() | |
| 55 | + | } | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | // OverrideGReserved2 sets the callback function. | |
| 59 | + | func (x *ConverterInputStreamClass) OverrideGReserved2(cb func()) { | |
| 60 | + | if cb == nil { | |
| 61 | + | x.xGReserved2 = 0 | |
| 62 | + | } else { | |
| 63 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 64 | + | cb() | |
| 65 | + | }) | |
| 66 | + | } | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | // GetGReserved2 gets the callback function. | |
| 70 | + | func (x *ConverterInputStreamClass) GetGReserved2() func() { | |
| 71 | + | if x.xGReserved2 == 0 { | |
| 72 | + | return nil | |
| 73 | + | } | |
| 74 | + | var rawCallback func() | |
| 75 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 76 | + | return func() { | |
| 77 | + | rawCallback() | |
| 78 | + | } | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | // OverrideGReserved3 sets the callback function. | |
| 82 | + | func (x *ConverterInputStreamClass) OverrideGReserved3(cb func()) { | |
| 83 | + | if cb == nil { | |
| 84 | + | x.xGReserved3 = 0 | |
| 85 | + | } else { | |
| 86 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 87 | + | cb() | |
| 88 | + | }) | |
| 89 | + | } | |
| 90 | + | } | |
| 91 | + | ||
| 92 | + | // GetGReserved3 gets the callback function. | |
| 93 | + | func (x *ConverterInputStreamClass) GetGReserved3() func() { | |
| 94 | + | if x.xGReserved3 == 0 { | |
| 95 | + | return nil | |
| 96 | + | } | |
| 97 | + | var rawCallback func() | |
| 98 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 99 | + | return func() { | |
| 100 | + | rawCallback() | |
| 101 | + | } | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | // OverrideGReserved4 sets the callback function. | |
| 105 | + | func (x *ConverterInputStreamClass) OverrideGReserved4(cb func()) { | |
| 106 | + | if cb == nil { | |
| 107 | + | x.xGReserved4 = 0 | |
| 108 | + | } else { | |
| 109 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 110 | + | cb() | |
| 111 | + | }) | |
| 112 | + | } | |
| 113 | + | } | |
| 114 | + | ||
| 115 | + | // GetGReserved4 gets the callback function. | |
| 116 | + | func (x *ConverterInputStreamClass) GetGReserved4() func() { | |
| 117 | + | if x.xGReserved4 == 0 { | |
| 118 | + | return nil | |
| 119 | + | } | |
| 120 | + | var rawCallback func() | |
| 121 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 122 | + | return func() { | |
| 123 | + | rawCallback() | |
| 124 | + | } | |
| 125 | + | } | |
| 126 | + | ||
| 127 | + | // OverrideGReserved5 sets the callback function. | |
| 128 | + | func (x *ConverterInputStreamClass) OverrideGReserved5(cb func()) { | |
| 129 | + | if cb == nil { | |
| 130 | + | x.xGReserved5 = 0 | |
| 131 | + | } else { | |
| 132 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 133 | + | cb() | |
| 134 | + | }) | |
| 135 | + | } | |
| 136 | + | } | |
| 137 | + | ||
| 138 | + | // GetGReserved5 gets the callback function. | |
| 139 | + | func (x *ConverterInputStreamClass) GetGReserved5() func() { | |
| 140 | + | if x.xGReserved5 == 0 { | |
| 141 | + | return nil | |
| 142 | + | } | |
| 143 | + | var rawCallback func() | |
| 144 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 145 | + | return func() { | |
| 146 | + | rawCallback() | |
| 147 | + | } | |
| 148 | + | } | |
| 149 | + | ||
| 25 | 150 | type ConverterInputStreamPrivate struct { | |
| 26 | 151 | _ structs.HostLayout | |
| 27 | 152 | } | |
M v4/gio/gconverteroutputstream.go +126 -1
| @@ -15,13 +15,138 @@ import ( | |||
| 15 | 15 | type ConverterOutputStreamClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass FilterOutputStreamClass | |
| 19 | + | ||
| 20 | + | xGReserved1 uintptr | |
| 21 | + | ||
| 22 | + | xGReserved2 uintptr | |
| 23 | + | ||
| 24 | + | xGReserved3 uintptr | |
| 25 | + | ||
| 26 | + | xGReserved4 uintptr | |
| 27 | + | ||
| 28 | + | xGReserved5 uintptr | |
| 19 | 29 | } | |
| 20 | 30 | ||
| 21 | 31 | func (x *ConverterOutputStreamClass) GoPointer() uintptr { | |
| 22 | 32 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 33 | } | |
| 24 | 34 | ||
| 35 | + | // OverrideGReserved1 sets the callback function. | |
| 36 | + | func (x *ConverterOutputStreamClass) OverrideGReserved1(cb func()) { | |
| 37 | + | if cb == nil { | |
| 38 | + | x.xGReserved1 = 0 | |
| 39 | + | } else { | |
| 40 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 41 | + | cb() | |
| 42 | + | }) | |
| 43 | + | } | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | // GetGReserved1 gets the callback function. | |
| 47 | + | func (x *ConverterOutputStreamClass) GetGReserved1() func() { | |
| 48 | + | if x.xGReserved1 == 0 { | |
| 49 | + | return nil | |
| 50 | + | } | |
| 51 | + | var rawCallback func() | |
| 52 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 53 | + | return func() { | |
| 54 | + | rawCallback() | |
| 55 | + | } | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | // OverrideGReserved2 sets the callback function. | |
| 59 | + | func (x *ConverterOutputStreamClass) OverrideGReserved2(cb func()) { | |
| 60 | + | if cb == nil { | |
| 61 | + | x.xGReserved2 = 0 | |
| 62 | + | } else { | |
| 63 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 64 | + | cb() | |
| 65 | + | }) | |
| 66 | + | } | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | // GetGReserved2 gets the callback function. | |
| 70 | + | func (x *ConverterOutputStreamClass) GetGReserved2() func() { | |
| 71 | + | if x.xGReserved2 == 0 { | |
| 72 | + | return nil | |
| 73 | + | } | |
| 74 | + | var rawCallback func() | |
| 75 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 76 | + | return func() { | |
| 77 | + | rawCallback() | |
| 78 | + | } | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | // OverrideGReserved3 sets the callback function. | |
| 82 | + | func (x *ConverterOutputStreamClass) OverrideGReserved3(cb func()) { | |
| 83 | + | if cb == nil { | |
| 84 | + | x.xGReserved3 = 0 | |
| 85 | + | } else { | |
| 86 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 87 | + | cb() | |
| 88 | + | }) | |
| 89 | + | } | |
| 90 | + | } | |
| 91 | + | ||
| 92 | + | // GetGReserved3 gets the callback function. | |
| 93 | + | func (x *ConverterOutputStreamClass) GetGReserved3() func() { | |
| 94 | + | if x.xGReserved3 == 0 { | |
| 95 | + | return nil | |
| 96 | + | } | |
| 97 | + | var rawCallback func() | |
| 98 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 99 | + | return func() { | |
| 100 | + | rawCallback() | |
| 101 | + | } | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | // OverrideGReserved4 sets the callback function. | |
| 105 | + | func (x *ConverterOutputStreamClass) OverrideGReserved4(cb func()) { | |
| 106 | + | if cb == nil { | |
| 107 | + | x.xGReserved4 = 0 | |
| 108 | + | } else { | |
| 109 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 110 | + | cb() | |
| 111 | + | }) | |
| 112 | + | } | |
| 113 | + | } | |
| 114 | + | ||
| 115 | + | // GetGReserved4 gets the callback function. | |
| 116 | + | func (x *ConverterOutputStreamClass) GetGReserved4() func() { | |
| 117 | + | if x.xGReserved4 == 0 { | |
| 118 | + | return nil | |
| 119 | + | } | |
| 120 | + | var rawCallback func() | |
| 121 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 122 | + | return func() { | |
| 123 | + | rawCallback() | |
| 124 | + | } | |
| 125 | + | } | |
| 126 | + | ||
| 127 | + | // OverrideGReserved5 sets the callback function. | |
| 128 | + | func (x *ConverterOutputStreamClass) OverrideGReserved5(cb func()) { | |
| 129 | + | if cb == nil { | |
| 130 | + | x.xGReserved5 = 0 | |
| 131 | + | } else { | |
| 132 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 133 | + | cb() | |
| 134 | + | }) | |
| 135 | + | } | |
| 136 | + | } | |
| 137 | + | ||
| 138 | + | // GetGReserved5 gets the callback function. | |
| 139 | + | func (x *ConverterOutputStreamClass) GetGReserved5() func() { | |
| 140 | + | if x.xGReserved5 == 0 { | |
| 141 | + | return nil | |
| 142 | + | } | |
| 143 | + | var rawCallback func() | |
| 144 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 145 | + | return func() { | |
| 146 | + | rawCallback() | |
| 147 | + | } | |
| 148 | + | } | |
| 149 | + | ||
| 25 | 150 | type ConverterOutputStreamPrivate struct { | |
| 26 | 151 | _ structs.HostLayout | |
| 27 | 152 | } | |
M v4/gio/gdatagrambased.go +128 -3
| @@ -20,12 +20,137 @@ type DatagramBasedInterface struct { | |||
| 20 | 20 | _ structs.HostLayout | |
| 21 | 21 | ||
| 22 | 22 | GIface uintptr | |
| 23 | + | ||
| 24 | + | xReceiveMessages uintptr | |
| 25 | + | ||
| 26 | + | xSendMessages uintptr | |
| 27 | + | ||
| 28 | + | xCreateSource uintptr | |
| 29 | + | ||
| 30 | + | xConditionCheck uintptr | |
| 31 | + | ||
| 32 | + | xConditionWait uintptr | |
| 23 | 33 | } | |
| 24 | 34 | ||
| 25 | 35 | func (x *DatagramBasedInterface) GoPointer() uintptr { | |
| 26 | 36 | return uintptr(unsafe.Pointer(x)) | |
| 27 | 37 | } | |
| 28 | 38 | ||
| 39 | + | // OverrideReceiveMessages sets the callback function. | |
| 40 | + | func (x *DatagramBasedInterface) OverrideReceiveMessages(cb func(DatagramBased, []InputMessage, uint, int, int64, *Cancellable) int) { | |
| 41 | + | if cb == nil { | |
| 42 | + | x.xReceiveMessages = 0 | |
| 43 | + | } else { | |
| 44 | + | x.xReceiveMessages = purego.NewCallback(func(DatagramBasedVarp uintptr, MessagesVarp []InputMessage, NumMessagesVarp uint, FlagsVarp int, TimeoutVarp int64, CancellableVarp uintptr) int { | |
| 45 | + | return cb(&DatagramBasedBase{Ptr: DatagramBasedVarp}, MessagesVarp, NumMessagesVarp, FlagsVarp, TimeoutVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 46 | + | }) | |
| 47 | + | } | |
| 48 | + | } | |
| 49 | + | ||
| 50 | + | // GetReceiveMessages gets the callback function. | |
| 51 | + | func (x *DatagramBasedInterface) GetReceiveMessages() func(DatagramBased, []InputMessage, uint, int, int64, *Cancellable) int { | |
| 52 | + | if x.xReceiveMessages == 0 { | |
| 53 | + | return nil | |
| 54 | + | } | |
| 55 | + | var rawCallback func(DatagramBasedVarp uintptr, MessagesVarp []InputMessage, NumMessagesVarp uint, FlagsVarp int, TimeoutVarp int64, CancellableVarp uintptr) int | |
| 56 | + | purego.RegisterFunc(&rawCallback, x.xReceiveMessages) | |
| 57 | + | return func(DatagramBasedVar DatagramBased, MessagesVar []InputMessage, NumMessagesVar uint, FlagsVar int, TimeoutVar int64, CancellableVar *Cancellable) int { | |
| 58 | + | return rawCallback(DatagramBasedVar.GoPointer(), MessagesVar, NumMessagesVar, FlagsVar, TimeoutVar, CancellableVar.GoPointer()) | |
| 59 | + | } | |
| 60 | + | } | |
| 61 | + | ||
| 62 | + | // OverrideSendMessages sets the callback function. | |
| 63 | + | func (x *DatagramBasedInterface) OverrideSendMessages(cb func(DatagramBased, []OutputMessage, uint, int, int64, *Cancellable) int) { | |
| 64 | + | if cb == nil { | |
| 65 | + | x.xSendMessages = 0 | |
| 66 | + | } else { | |
| 67 | + | x.xSendMessages = purego.NewCallback(func(DatagramBasedVarp uintptr, MessagesVarp []OutputMessage, NumMessagesVarp uint, FlagsVarp int, TimeoutVarp int64, CancellableVarp uintptr) int { | |
| 68 | + | return cb(&DatagramBasedBase{Ptr: DatagramBasedVarp}, MessagesVarp, NumMessagesVarp, FlagsVarp, TimeoutVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 69 | + | }) | |
| 70 | + | } | |
| 71 | + | } | |
| 72 | + | ||
| 73 | + | // GetSendMessages gets the callback function. | |
| 74 | + | func (x *DatagramBasedInterface) GetSendMessages() func(DatagramBased, []OutputMessage, uint, int, int64, *Cancellable) int { | |
| 75 | + | if x.xSendMessages == 0 { | |
| 76 | + | return nil | |
| 77 | + | } | |
| 78 | + | var rawCallback func(DatagramBasedVarp uintptr, MessagesVarp []OutputMessage, NumMessagesVarp uint, FlagsVarp int, TimeoutVarp int64, CancellableVarp uintptr) int | |
| 79 | + | purego.RegisterFunc(&rawCallback, x.xSendMessages) | |
| 80 | + | return func(DatagramBasedVar DatagramBased, MessagesVar []OutputMessage, NumMessagesVar uint, FlagsVar int, TimeoutVar int64, CancellableVar *Cancellable) int { | |
| 81 | + | return rawCallback(DatagramBasedVar.GoPointer(), MessagesVar, NumMessagesVar, FlagsVar, TimeoutVar, CancellableVar.GoPointer()) | |
| 82 | + | } | |
| 83 | + | } | |
| 84 | + | ||
| 85 | + | // OverrideCreateSource sets the callback function. | |
| 86 | + | func (x *DatagramBasedInterface) OverrideCreateSource(cb func(DatagramBased, glib.IOCondition, *Cancellable) *glib.Source) { | |
| 87 | + | if cb == nil { | |
| 88 | + | x.xCreateSource = 0 | |
| 89 | + | } else { | |
| 90 | + | x.xCreateSource = purego.NewCallback(func(DatagramBasedVarp uintptr, ConditionVarp glib.IOCondition, CancellableVarp uintptr) *glib.Source { | |
| 91 | + | return cb(&DatagramBasedBase{Ptr: DatagramBasedVarp}, ConditionVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 92 | + | }) | |
| 93 | + | } | |
| 94 | + | } | |
| 95 | + | ||
| 96 | + | // GetCreateSource gets the callback function. | |
| 97 | + | func (x *DatagramBasedInterface) GetCreateSource() func(DatagramBased, glib.IOCondition, *Cancellable) *glib.Source { | |
| 98 | + | if x.xCreateSource == 0 { | |
| 99 | + | return nil | |
| 100 | + | } | |
| 101 | + | var rawCallback func(DatagramBasedVarp uintptr, ConditionVarp glib.IOCondition, CancellableVarp uintptr) *glib.Source | |
| 102 | + | purego.RegisterFunc(&rawCallback, x.xCreateSource) | |
| 103 | + | return func(DatagramBasedVar DatagramBased, ConditionVar glib.IOCondition, CancellableVar *Cancellable) *glib.Source { | |
| 104 | + | return rawCallback(DatagramBasedVar.GoPointer(), ConditionVar, CancellableVar.GoPointer()) | |
| 105 | + | } | |
| 106 | + | } | |
| 107 | + | ||
| 108 | + | // OverrideConditionCheck sets the callback function. | |
| 109 | + | func (x *DatagramBasedInterface) OverrideConditionCheck(cb func(DatagramBased, glib.IOCondition) glib.IOCondition) { | |
| 110 | + | if cb == nil { | |
| 111 | + | x.xConditionCheck = 0 | |
| 112 | + | } else { | |
| 113 | + | x.xConditionCheck = purego.NewCallback(func(DatagramBasedVarp uintptr, ConditionVarp glib.IOCondition) glib.IOCondition { | |
| 114 | + | return cb(&DatagramBasedBase{Ptr: DatagramBasedVarp}, ConditionVarp) | |
| 115 | + | }) | |
| 116 | + | } | |
| 117 | + | } | |
| 118 | + | ||
| 119 | + | // GetConditionCheck gets the callback function. | |
| 120 | + | func (x *DatagramBasedInterface) GetConditionCheck() func(DatagramBased, glib.IOCondition) glib.IOCondition { | |
| 121 | + | if x.xConditionCheck == 0 { | |
| 122 | + | return nil | |
| 123 | + | } | |
| 124 | + | var rawCallback func(DatagramBasedVarp uintptr, ConditionVarp glib.IOCondition) glib.IOCondition | |
| 125 | + | purego.RegisterFunc(&rawCallback, x.xConditionCheck) | |
| 126 | + | return func(DatagramBasedVar DatagramBased, ConditionVar glib.IOCondition) glib.IOCondition { | |
| 127 | + | return rawCallback(DatagramBasedVar.GoPointer(), ConditionVar) | |
| 128 | + | } | |
| 129 | + | } | |
| 130 | + | ||
| 131 | + | // OverrideConditionWait sets the callback function. | |
| 132 | + | func (x *DatagramBasedInterface) OverrideConditionWait(cb func(DatagramBased, glib.IOCondition, int64, *Cancellable) bool) { | |
| 133 | + | if cb == nil { | |
| 134 | + | x.xConditionWait = 0 | |
| 135 | + | } else { | |
| 136 | + | x.xConditionWait = purego.NewCallback(func(DatagramBasedVarp uintptr, ConditionVarp glib.IOCondition, TimeoutVarp int64, CancellableVarp uintptr) bool { | |
| 137 | + | return cb(&DatagramBasedBase{Ptr: DatagramBasedVarp}, ConditionVarp, TimeoutVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 138 | + | }) | |
| 139 | + | } | |
| 140 | + | } | |
| 141 | + | ||
| 142 | + | // GetConditionWait gets the callback function. | |
| 143 | + | func (x *DatagramBasedInterface) GetConditionWait() func(DatagramBased, glib.IOCondition, int64, *Cancellable) bool { | |
| 144 | + | if x.xConditionWait == 0 { | |
| 145 | + | return nil | |
| 146 | + | } | |
| 147 | + | var rawCallback func(DatagramBasedVarp uintptr, ConditionVarp glib.IOCondition, TimeoutVarp int64, CancellableVarp uintptr) bool | |
| 148 | + | purego.RegisterFunc(&rawCallback, x.xConditionWait) | |
| 149 | + | return func(DatagramBasedVar DatagramBased, ConditionVar glib.IOCondition, TimeoutVar int64, CancellableVar *Cancellable) bool { | |
| 150 | + | return rawCallback(DatagramBasedVar.GoPointer(), ConditionVar, TimeoutVar, CancellableVar.GoPointer()) | |
| 151 | + | } | |
| 152 | + | } | |
| 153 | + | ||
| 29 | 154 | // A #GDatagramBased is a networking interface for representing datagram-based | |
| 30 | 155 | // communications. It is a more or less direct mapping of the core parts of the | |
| 31 | 156 | // BSD socket API in a portable GObject interface. It is implemented by | |
| @@ -77,10 +202,10 @@ type DatagramBased interface { | |||
| 77 | 202 | GoPointer() uintptr | |
| 78 | 203 | SetGoPointer(uintptr) | |
| 79 | 204 | ConditionCheck(ConditionVar glib.IOCondition) glib.IOCondition | |
| 80 | - | ConditionWait(ConditionVar glib.IOCondition, TimeoutVar int64, CancellableVar *Cancellable) bool | |
| 205 | + | ConditionWait(ConditionVar glib.IOCondition, TimeoutVar int64, CancellableVar *Cancellable) (bool, error) | |
| 81 | 206 | CreateSource(ConditionVar glib.IOCondition, CancellableVar *Cancellable) *glib.Source | |
| 82 | - | ReceiveMessages(MessagesVar []InputMessage, NumMessagesVar uint, FlagsVar int, TimeoutVar int64, CancellableVar *Cancellable) int | |
| 83 | - | SendMessages(MessagesVar []OutputMessage, NumMessagesVar uint, FlagsVar int, TimeoutVar int64, CancellableVar *Cancellable) int | |
| 207 | + | ReceiveMessages(MessagesVar []InputMessage, NumMessagesVar uint, FlagsVar int, TimeoutVar int64, CancellableVar *Cancellable) (int, error) | |
| 208 | + | SendMessages(MessagesVar []OutputMessage, NumMessagesVar uint, FlagsVar int, TimeoutVar int64, CancellableVar *Cancellable) (int, error) | |
| 84 | 209 | } | |
| 85 | 210 | ||
| 86 | 211 | var xDatagramBasedGLibType func() types.GType | |
M v4/gio/gdatainputstream.go +126 -1
| @@ -14,13 +14,138 @@ import ( | |||
| 14 | 14 | type DataInputStreamClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass BufferedInputStreamClass | |
| 18 | + | ||
| 19 | + | xGReserved1 uintptr | |
| 20 | + | ||
| 21 | + | xGReserved2 uintptr | |
| 22 | + | ||
| 23 | + | xGReserved3 uintptr | |
| 24 | + | ||
| 25 | + | xGReserved4 uintptr | |
| 26 | + | ||
| 27 | + | xGReserved5 uintptr | |
| 18 | 28 | } | |
| 19 | 29 | ||
| 20 | 30 | func (x *DataInputStreamClass) GoPointer() uintptr { | |
| 21 | 31 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 32 | } | |
| 23 | 33 | ||
| 34 | + | // OverrideGReserved1 sets the callback function. | |
| 35 | + | func (x *DataInputStreamClass) OverrideGReserved1(cb func()) { | |
| 36 | + | if cb == nil { | |
| 37 | + | x.xGReserved1 = 0 | |
| 38 | + | } else { | |
| 39 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 40 | + | cb() | |
| 41 | + | }) | |
| 42 | + | } | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | // GetGReserved1 gets the callback function. | |
| 46 | + | func (x *DataInputStreamClass) GetGReserved1() func() { | |
| 47 | + | if x.xGReserved1 == 0 { | |
| 48 | + | return nil | |
| 49 | + | } | |
| 50 | + | var rawCallback func() | |
| 51 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 52 | + | return func() { | |
| 53 | + | rawCallback() | |
| 54 | + | } | |
| 55 | + | } | |
| 56 | + | ||
| 57 | + | // OverrideGReserved2 sets the callback function. | |
| 58 | + | func (x *DataInputStreamClass) OverrideGReserved2(cb func()) { | |
| 59 | + | if cb == nil { | |
| 60 | + | x.xGReserved2 = 0 | |
| 61 | + | } else { | |
| 62 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 63 | + | cb() | |
| 64 | + | }) | |
| 65 | + | } | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | // GetGReserved2 gets the callback function. | |
| 69 | + | func (x *DataInputStreamClass) GetGReserved2() func() { | |
| 70 | + | if x.xGReserved2 == 0 { | |
| 71 | + | return nil | |
| 72 | + | } | |
| 73 | + | var rawCallback func() | |
| 74 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 75 | + | return func() { | |
| 76 | + | rawCallback() | |
| 77 | + | } | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | // OverrideGReserved3 sets the callback function. | |
| 81 | + | func (x *DataInputStreamClass) OverrideGReserved3(cb func()) { | |
| 82 | + | if cb == nil { | |
| 83 | + | x.xGReserved3 = 0 | |
| 84 | + | } else { | |
| 85 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 86 | + | cb() | |
| 87 | + | }) | |
| 88 | + | } | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | // GetGReserved3 gets the callback function. | |
| 92 | + | func (x *DataInputStreamClass) GetGReserved3() func() { | |
| 93 | + | if x.xGReserved3 == 0 { | |
| 94 | + | return nil | |
| 95 | + | } | |
| 96 | + | var rawCallback func() | |
| 97 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 98 | + | return func() { | |
| 99 | + | rawCallback() | |
| 100 | + | } | |
| 101 | + | } | |
| 102 | + | ||
| 103 | + | // OverrideGReserved4 sets the callback function. | |
| 104 | + | func (x *DataInputStreamClass) OverrideGReserved4(cb func()) { | |
| 105 | + | if cb == nil { | |
| 106 | + | x.xGReserved4 = 0 | |
| 107 | + | } else { | |
| 108 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 109 | + | cb() | |
| 110 | + | }) | |
| 111 | + | } | |
| 112 | + | } | |
| 113 | + | ||
| 114 | + | // GetGReserved4 gets the callback function. | |
| 115 | + | func (x *DataInputStreamClass) GetGReserved4() func() { | |
| 116 | + | if x.xGReserved4 == 0 { | |
| 117 | + | return nil | |
| 118 | + | } | |
| 119 | + | var rawCallback func() | |
| 120 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 121 | + | return func() { | |
| 122 | + | rawCallback() | |
| 123 | + | } | |
| 124 | + | } | |
| 125 | + | ||
| 126 | + | // OverrideGReserved5 sets the callback function. | |
| 127 | + | func (x *DataInputStreamClass) OverrideGReserved5(cb func()) { | |
| 128 | + | if cb == nil { | |
| 129 | + | x.xGReserved5 = 0 | |
| 130 | + | } else { | |
| 131 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 132 | + | cb() | |
| 133 | + | }) | |
| 134 | + | } | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | // GetGReserved5 gets the callback function. | |
| 138 | + | func (x *DataInputStreamClass) GetGReserved5() func() { | |
| 139 | + | if x.xGReserved5 == 0 { | |
| 140 | + | return nil | |
| 141 | + | } | |
| 142 | + | var rawCallback func() | |
| 143 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 144 | + | return func() { | |
| 145 | + | rawCallback() | |
| 146 | + | } | |
| 147 | + | } | |
| 148 | + | ||
| 24 | 149 | type DataInputStreamPrivate struct { | |
| 25 | 150 | _ structs.HostLayout | |
| 26 | 151 | } | |
M v4/gio/gdataoutputstream.go +126 -1
| @@ -14,13 +14,138 @@ import ( | |||
| 14 | 14 | type DataOutputStreamClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass FilterOutputStreamClass | |
| 18 | + | ||
| 19 | + | xGReserved1 uintptr | |
| 20 | + | ||
| 21 | + | xGReserved2 uintptr | |
| 22 | + | ||
| 23 | + | xGReserved3 uintptr | |
| 24 | + | ||
| 25 | + | xGReserved4 uintptr | |
| 26 | + | ||
| 27 | + | xGReserved5 uintptr | |
| 18 | 28 | } | |
| 19 | 29 | ||
| 20 | 30 | func (x *DataOutputStreamClass) GoPointer() uintptr { | |
| 21 | 31 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 32 | } | |
| 23 | 33 | ||
| 34 | + | // OverrideGReserved1 sets the callback function. | |
| 35 | + | func (x *DataOutputStreamClass) OverrideGReserved1(cb func()) { | |
| 36 | + | if cb == nil { | |
| 37 | + | x.xGReserved1 = 0 | |
| 38 | + | } else { | |
| 39 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 40 | + | cb() | |
| 41 | + | }) | |
| 42 | + | } | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | // GetGReserved1 gets the callback function. | |
| 46 | + | func (x *DataOutputStreamClass) GetGReserved1() func() { | |
| 47 | + | if x.xGReserved1 == 0 { | |
| 48 | + | return nil | |
| 49 | + | } | |
| 50 | + | var rawCallback func() | |
| 51 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 52 | + | return func() { | |
| 53 | + | rawCallback() | |
| 54 | + | } | |
| 55 | + | } | |
| 56 | + | ||
| 57 | + | // OverrideGReserved2 sets the callback function. | |
| 58 | + | func (x *DataOutputStreamClass) OverrideGReserved2(cb func()) { | |
| 59 | + | if cb == nil { | |
| 60 | + | x.xGReserved2 = 0 | |
| 61 | + | } else { | |
| 62 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 63 | + | cb() | |
| 64 | + | }) | |
| 65 | + | } | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | // GetGReserved2 gets the callback function. | |
| 69 | + | func (x *DataOutputStreamClass) GetGReserved2() func() { | |
| 70 | + | if x.xGReserved2 == 0 { | |
| 71 | + | return nil | |
| 72 | + | } | |
| 73 | + | var rawCallback func() | |
| 74 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 75 | + | return func() { | |
| 76 | + | rawCallback() | |
| 77 | + | } | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | // OverrideGReserved3 sets the callback function. | |
| 81 | + | func (x *DataOutputStreamClass) OverrideGReserved3(cb func()) { | |
| 82 | + | if cb == nil { | |
| 83 | + | x.xGReserved3 = 0 | |
| 84 | + | } else { | |
| 85 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 86 | + | cb() | |
| 87 | + | }) | |
| 88 | + | } | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | // GetGReserved3 gets the callback function. | |
| 92 | + | func (x *DataOutputStreamClass) GetGReserved3() func() { | |
| 93 | + | if x.xGReserved3 == 0 { | |
| 94 | + | return nil | |
| 95 | + | } | |
| 96 | + | var rawCallback func() | |
| 97 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 98 | + | return func() { | |
| 99 | + | rawCallback() | |
| 100 | + | } | |
| 101 | + | } | |
| 102 | + | ||
| 103 | + | // OverrideGReserved4 sets the callback function. | |
| 104 | + | func (x *DataOutputStreamClass) OverrideGReserved4(cb func()) { | |
| 105 | + | if cb == nil { | |
| 106 | + | x.xGReserved4 = 0 | |
| 107 | + | } else { | |
| 108 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 109 | + | cb() | |
| 110 | + | }) | |
| 111 | + | } | |
| 112 | + | } | |
| 113 | + | ||
| 114 | + | // GetGReserved4 gets the callback function. | |
| 115 | + | func (x *DataOutputStreamClass) GetGReserved4() func() { | |
| 116 | + | if x.xGReserved4 == 0 { | |
| 117 | + | return nil | |
| 118 | + | } | |
| 119 | + | var rawCallback func() | |
| 120 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 121 | + | return func() { | |
| 122 | + | rawCallback() | |
| 123 | + | } | |
| 124 | + | } | |
| 125 | + | ||
| 126 | + | // OverrideGReserved5 sets the callback function. | |
| 127 | + | func (x *DataOutputStreamClass) OverrideGReserved5(cb func()) { | |
| 128 | + | if cb == nil { | |
| 129 | + | x.xGReserved5 = 0 | |
| 130 | + | } else { | |
| 131 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 132 | + | cb() | |
| 133 | + | }) | |
| 134 | + | } | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | // GetGReserved5 gets the callback function. | |
| 138 | + | func (x *DataOutputStreamClass) GetGReserved5() func() { | |
| 139 | + | if x.xGReserved5 == 0 { | |
| 140 | + | return nil | |
| 141 | + | } | |
| 142 | + | var rawCallback func() | |
| 143 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 144 | + | return func() { | |
| 145 | + | rawCallback() | |
| 146 | + | } | |
| 147 | + | } | |
| 148 | + | ||
| 24 | 149 | type DataOutputStreamPrivate struct { | |
| 25 | 150 | _ structs.HostLayout | |
| 26 | 151 | } | |
M v4/gio/gdbusinterface.go +120 -0
| @@ -16,12 +16,132 @@ type DBusInterfaceIface struct { | |||
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | 18 | ParentIface uintptr | |
| 19 | + | ||
| 20 | + | xGetInfo uintptr | |
| 21 | + | ||
| 22 | + | xGetObject uintptr | |
| 23 | + | ||
| 24 | + | xSetObject uintptr | |
| 25 | + | ||
| 26 | + | xDupObject uintptr | |
| 19 | 27 | } | |
| 20 | 28 | ||
| 21 | 29 | func (x *DBusInterfaceIface) GoPointer() uintptr { | |
| 22 | 30 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 31 | } | |
| 24 | 32 | ||
| 33 | + | // OverrideGetInfo sets the callback function. | |
| 34 | + | func (x *DBusInterfaceIface) OverrideGetInfo(cb func(DBusInterface) *DBusInterfaceInfo) { | |
| 35 | + | if cb == nil { | |
| 36 | + | x.xGetInfo = 0 | |
| 37 | + | } else { | |
| 38 | + | x.xGetInfo = purego.NewCallback(func(InterfaceVarp uintptr) *DBusInterfaceInfo { | |
| 39 | + | return cb(&DBusInterfaceBase{Ptr: InterfaceVarp}) | |
| 40 | + | }) | |
| 41 | + | } | |
| 42 | + | } | |
| 43 | + | ||
| 44 | + | // GetGetInfo gets the callback function. | |
| 45 | + | func (x *DBusInterfaceIface) GetGetInfo() func(DBusInterface) *DBusInterfaceInfo { | |
| 46 | + | if x.xGetInfo == 0 { | |
| 47 | + | return nil | |
| 48 | + | } | |
| 49 | + | var rawCallback func(InterfaceVarp uintptr) *DBusInterfaceInfo | |
| 50 | + | purego.RegisterFunc(&rawCallback, x.xGetInfo) | |
| 51 | + | return func(InterfaceVar DBusInterface) *DBusInterfaceInfo { | |
| 52 | + | return rawCallback(InterfaceVar.GoPointer()) | |
| 53 | + | } | |
| 54 | + | } | |
| 55 | + | ||
| 56 | + | // OverrideGetObject sets the callback function. | |
| 57 | + | func (x *DBusInterfaceIface) OverrideGetObject(cb func(DBusInterface) *DBusObjectBase) { | |
| 58 | + | if cb == nil { | |
| 59 | + | x.xGetObject = 0 | |
| 60 | + | } else { | |
| 61 | + | x.xGetObject = purego.NewCallback(func(InterfaceVarp uintptr) uintptr { | |
| 62 | + | ret := cb(&DBusInterfaceBase{Ptr: InterfaceVarp}) | |
| 63 | + | if ret == nil { | |
| 64 | + | return 0 | |
| 65 | + | } | |
| 66 | + | return ret.GoPointer() | |
| 67 | + | }) | |
| 68 | + | } | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | // GetGetObject gets the callback function. | |
| 72 | + | func (x *DBusInterfaceIface) GetGetObject() func(DBusInterface) *DBusObjectBase { | |
| 73 | + | if x.xGetObject == 0 { | |
| 74 | + | return nil | |
| 75 | + | } | |
| 76 | + | var rawCallback func(InterfaceVarp uintptr) uintptr | |
| 77 | + | purego.RegisterFunc(&rawCallback, x.xGetObject) | |
| 78 | + | return func(InterfaceVar DBusInterface) *DBusObjectBase { | |
| 79 | + | rawRet := rawCallback(InterfaceVar.GoPointer()) | |
| 80 | + | if rawRet == 0 { | |
| 81 | + | return nil | |
| 82 | + | } | |
| 83 | + | ret := &DBusObjectBase{} | |
| 84 | + | ret.Ptr = rawRet | |
| 85 | + | return ret | |
| 86 | + | } | |
| 87 | + | } | |
| 88 | + | ||
| 89 | + | // OverrideSetObject sets the callback function. | |
| 90 | + | func (x *DBusInterfaceIface) OverrideSetObject(cb func(DBusInterface, DBusObject)) { | |
| 91 | + | if cb == nil { | |
| 92 | + | x.xSetObject = 0 | |
| 93 | + | } else { | |
| 94 | + | x.xSetObject = purego.NewCallback(func(InterfaceVarp uintptr, ObjectVarp uintptr) { | |
| 95 | + | cb(&DBusInterfaceBase{Ptr: InterfaceVarp}, &DBusObjectBase{Ptr: ObjectVarp}) | |
| 96 | + | }) | |
| 97 | + | } | |
| 98 | + | } | |
| 99 | + | ||
| 100 | + | // GetSetObject gets the callback function. | |
| 101 | + | func (x *DBusInterfaceIface) GetSetObject() func(DBusInterface, DBusObject) { | |
| 102 | + | if x.xSetObject == 0 { | |
| 103 | + | return nil | |
| 104 | + | } | |
| 105 | + | var rawCallback func(InterfaceVarp uintptr, ObjectVarp uintptr) | |
| 106 | + | purego.RegisterFunc(&rawCallback, x.xSetObject) | |
| 107 | + | return func(InterfaceVar DBusInterface, ObjectVar DBusObject) { | |
| 108 | + | rawCallback(InterfaceVar.GoPointer(), ObjectVar.GoPointer()) | |
| 109 | + | } | |
| 110 | + | } | |
| 111 | + | ||
| 112 | + | // OverrideDupObject sets the callback function. | |
| 113 | + | func (x *DBusInterfaceIface) OverrideDupObject(cb func(DBusInterface) *DBusObjectBase) { | |
| 114 | + | if cb == nil { | |
| 115 | + | x.xDupObject = 0 | |
| 116 | + | } else { | |
| 117 | + | x.xDupObject = purego.NewCallback(func(InterfaceVarp uintptr) uintptr { | |
| 118 | + | ret := cb(&DBusInterfaceBase{Ptr: InterfaceVarp}) | |
| 119 | + | if ret == nil { | |
| 120 | + | return 0 | |
| 121 | + | } | |
| 122 | + | return ret.GoPointer() | |
| 123 | + | }) | |
| 124 | + | } | |
| 125 | + | } | |
| 126 | + | ||
| 127 | + | // GetDupObject gets the callback function. | |
| 128 | + | func (x *DBusInterfaceIface) GetDupObject() func(DBusInterface) *DBusObjectBase { | |
| 129 | + | if x.xDupObject == 0 { | |
| 130 | + | return nil | |
| 131 | + | } | |
| 132 | + | var rawCallback func(InterfaceVarp uintptr) uintptr | |
| 133 | + | purego.RegisterFunc(&rawCallback, x.xDupObject) | |
| 134 | + | return func(InterfaceVar DBusInterface) *DBusObjectBase { | |
| 135 | + | rawRet := rawCallback(InterfaceVar.GoPointer()) | |
| 136 | + | if rawRet == 0 { | |
| 137 | + | return nil | |
| 138 | + | } | |
| 139 | + | ret := &DBusObjectBase{} | |
| 140 | + | ret.Ptr = rawRet | |
| 141 | + | return ret | |
| 142 | + | } | |
| 143 | + | } | |
| 144 | + | ||
| 25 | 145 | // The #GDBusInterface type is the base type for D-Bus interfaces both | |
| 26 | 146 | // on the service side (see #GDBusInterfaceSkeleton) and client side | |
| 27 | 147 | // (see #GDBusProxy). | |
M v4/gio/gdbusinterfaceskeleton.go +126 -1
| @@ -16,10 +16,20 @@ import ( | |||
| 16 | 16 | type DBusInterfaceSkeletonClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | + | ||
| 21 | + | xGetInfo uintptr | |
| 22 | + | ||
| 23 | + | xGetVtable uintptr | |
| 24 | + | ||
| 25 | + | xGetProperties uintptr | |
| 26 | + | ||
| 27 | + | xFlush uintptr | |
| 20 | 28 | ||
| 21 | 29 | VfuncPadding [8]uintptr | |
| 22 | 30 | ||
| 31 | + | xGAuthorizeMethod uintptr | |
| 32 | + | ||
| 23 | 33 | SignalPadding [8]uintptr | |
| 24 | 34 | } | |
| 25 | 35 | ||
| @@ -27,6 +37,121 @@ func (x *DBusInterfaceSkeletonClass) GoPointer() uintptr { | |||
| 27 | 37 | return uintptr(unsafe.Pointer(x)) | |
| 28 | 38 | } | |
| 29 | 39 | ||
| 40 | + | // OverrideGetInfo sets the callback function. | |
| 41 | + | func (x *DBusInterfaceSkeletonClass) OverrideGetInfo(cb func(*DBusInterfaceSkeleton) *DBusInterfaceInfo) { | |
| 42 | + | if cb == nil { | |
| 43 | + | x.xGetInfo = 0 | |
| 44 | + | } else { | |
| 45 | + | x.xGetInfo = purego.NewCallback(func(InterfaceVarp uintptr) *DBusInterfaceInfo { | |
| 46 | + | return cb(DBusInterfaceSkeletonNewFromInternalPtr(InterfaceVarp)) | |
| 47 | + | }) | |
| 48 | + | } | |
| 49 | + | } | |
| 50 | + | ||
| 51 | + | // GetGetInfo gets the callback function. | |
| 52 | + | func (x *DBusInterfaceSkeletonClass) GetGetInfo() func(*DBusInterfaceSkeleton) *DBusInterfaceInfo { | |
| 53 | + | if x.xGetInfo == 0 { | |
| 54 | + | return nil | |
| 55 | + | } | |
| 56 | + | var rawCallback func(InterfaceVarp uintptr) *DBusInterfaceInfo | |
| 57 | + | purego.RegisterFunc(&rawCallback, x.xGetInfo) | |
| 58 | + | return func(InterfaceVar *DBusInterfaceSkeleton) *DBusInterfaceInfo { | |
| 59 | + | return rawCallback(InterfaceVar.GoPointer()) | |
| 60 | + | } | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // OverrideGetVtable sets the callback function. | |
| 64 | + | func (x *DBusInterfaceSkeletonClass) OverrideGetVtable(cb func(*DBusInterfaceSkeleton) *DBusInterfaceVTable) { | |
| 65 | + | if cb == nil { | |
| 66 | + | x.xGetVtable = 0 | |
| 67 | + | } else { | |
| 68 | + | x.xGetVtable = purego.NewCallback(func(InterfaceVarp uintptr) *DBusInterfaceVTable { | |
| 69 | + | return cb(DBusInterfaceSkeletonNewFromInternalPtr(InterfaceVarp)) | |
| 70 | + | }) | |
| 71 | + | } | |
| 72 | + | } | |
| 73 | + | ||
| 74 | + | // GetGetVtable gets the callback function. | |
| 75 | + | func (x *DBusInterfaceSkeletonClass) GetGetVtable() func(*DBusInterfaceSkeleton) *DBusInterfaceVTable { | |
| 76 | + | if x.xGetVtable == 0 { | |
| 77 | + | return nil | |
| 78 | + | } | |
| 79 | + | var rawCallback func(InterfaceVarp uintptr) *DBusInterfaceVTable | |
| 80 | + | purego.RegisterFunc(&rawCallback, x.xGetVtable) | |
| 81 | + | return func(InterfaceVar *DBusInterfaceSkeleton) *DBusInterfaceVTable { | |
| 82 | + | return rawCallback(InterfaceVar.GoPointer()) | |
| 83 | + | } | |
| 84 | + | } | |
| 85 | + | ||
| 86 | + | // OverrideGetProperties sets the callback function. | |
| 87 | + | func (x *DBusInterfaceSkeletonClass) OverrideGetProperties(cb func(*DBusInterfaceSkeleton) *glib.Variant) { | |
| 88 | + | if cb == nil { | |
| 89 | + | x.xGetProperties = 0 | |
| 90 | + | } else { | |
| 91 | + | x.xGetProperties = purego.NewCallback(func(InterfaceVarp uintptr) *glib.Variant { | |
| 92 | + | return cb(DBusInterfaceSkeletonNewFromInternalPtr(InterfaceVarp)) | |
| 93 | + | }) | |
| 94 | + | } | |
| 95 | + | } | |
| 96 | + | ||
| 97 | + | // GetGetProperties gets the callback function. | |
| 98 | + | func (x *DBusInterfaceSkeletonClass) GetGetProperties() func(*DBusInterfaceSkeleton) *glib.Variant { | |
| 99 | + | if x.xGetProperties == 0 { | |
| 100 | + | return nil | |
| 101 | + | } | |
| 102 | + | var rawCallback func(InterfaceVarp uintptr) *glib.Variant | |
| 103 | + | purego.RegisterFunc(&rawCallback, x.xGetProperties) | |
| 104 | + | return func(InterfaceVar *DBusInterfaceSkeleton) *glib.Variant { | |
| 105 | + | return rawCallback(InterfaceVar.GoPointer()) | |
| 106 | + | } | |
| 107 | + | } | |
| 108 | + | ||
| 109 | + | // OverrideFlush sets the callback function. | |
| 110 | + | func (x *DBusInterfaceSkeletonClass) OverrideFlush(cb func(*DBusInterfaceSkeleton)) { | |
| 111 | + | if cb == nil { | |
| 112 | + | x.xFlush = 0 | |
| 113 | + | } else { | |
| 114 | + | x.xFlush = purego.NewCallback(func(InterfaceVarp uintptr) { | |
| 115 | + | cb(DBusInterfaceSkeletonNewFromInternalPtr(InterfaceVarp)) | |
| 116 | + | }) | |
| 117 | + | } | |
| 118 | + | } | |
| 119 | + | ||
| 120 | + | // GetFlush gets the callback function. | |
| 121 | + | func (x *DBusInterfaceSkeletonClass) GetFlush() func(*DBusInterfaceSkeleton) { | |
| 122 | + | if x.xFlush == 0 { | |
| 123 | + | return nil | |
| 124 | + | } | |
| 125 | + | var rawCallback func(InterfaceVarp uintptr) | |
| 126 | + | purego.RegisterFunc(&rawCallback, x.xFlush) | |
| 127 | + | return func(InterfaceVar *DBusInterfaceSkeleton) { | |
| 128 | + | rawCallback(InterfaceVar.GoPointer()) | |
| 129 | + | } | |
| 130 | + | } | |
| 131 | + | ||
| 132 | + | // OverrideGAuthorizeMethod sets the callback function. | |
| 133 | + | func (x *DBusInterfaceSkeletonClass) OverrideGAuthorizeMethod(cb func(*DBusInterfaceSkeleton, *DBusMethodInvocation) bool) { | |
| 134 | + | if cb == nil { | |
| 135 | + | x.xGAuthorizeMethod = 0 | |
| 136 | + | } else { | |
| 137 | + | x.xGAuthorizeMethod = purego.NewCallback(func(InterfaceVarp uintptr, InvocationVarp uintptr) bool { | |
| 138 | + | return cb(DBusInterfaceSkeletonNewFromInternalPtr(InterfaceVarp), DBusMethodInvocationNewFromInternalPtr(InvocationVarp)) | |
| 139 | + | }) | |
| 140 | + | } | |
| 141 | + | } | |
| 142 | + | ||
| 143 | + | // GetGAuthorizeMethod gets the callback function. | |
| 144 | + | func (x *DBusInterfaceSkeletonClass) GetGAuthorizeMethod() func(*DBusInterfaceSkeleton, *DBusMethodInvocation) bool { | |
| 145 | + | if x.xGAuthorizeMethod == 0 { | |
| 146 | + | return nil | |
| 147 | + | } | |
| 148 | + | var rawCallback func(InterfaceVarp uintptr, InvocationVarp uintptr) bool | |
| 149 | + | purego.RegisterFunc(&rawCallback, x.xGAuthorizeMethod) | |
| 150 | + | return func(InterfaceVar *DBusInterfaceSkeleton, InvocationVar *DBusMethodInvocation) bool { | |
| 151 | + | return rawCallback(InterfaceVar.GoPointer(), InvocationVar.GoPointer()) | |
| 152 | + | } | |
| 153 | + | } | |
| 154 | + | ||
| 30 | 155 | type DBusInterfaceSkeletonPrivate struct { | |
| 31 | 156 | _ structs.HostLayout | |
| 32 | 157 | } | |
M v4/gio/gdbusobject.go +135 -0
| @@ -16,12 +16,147 @@ type DBusObjectIface struct { | |||
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | 18 | ParentIface uintptr | |
| 19 | + | ||
| 20 | + | xGetObjectPath uintptr | |
| 21 | + | ||
| 22 | + | xGetInterfaces uintptr | |
| 23 | + | ||
| 24 | + | xGetInterface uintptr | |
| 25 | + | ||
| 26 | + | xInterfaceAdded uintptr | |
| 27 | + | ||
| 28 | + | xInterfaceRemoved uintptr | |
| 19 | 29 | } | |
| 20 | 30 | ||
| 21 | 31 | func (x *DBusObjectIface) GoPointer() uintptr { | |
| 22 | 32 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 33 | } | |
| 24 | 34 | ||
| 35 | + | // OverrideGetObjectPath sets the callback function. | |
| 36 | + | func (x *DBusObjectIface) OverrideGetObjectPath(cb func(DBusObject) string) { | |
| 37 | + | if cb == nil { | |
| 38 | + | x.xGetObjectPath = 0 | |
| 39 | + | } else { | |
| 40 | + | x.xGetObjectPath = purego.NewCallback(func(ObjectVarp uintptr) string { | |
| 41 | + | return cb(&DBusObjectBase{Ptr: ObjectVarp}) | |
| 42 | + | }) | |
| 43 | + | } | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | // GetGetObjectPath gets the callback function. | |
| 47 | + | func (x *DBusObjectIface) GetGetObjectPath() func(DBusObject) string { | |
| 48 | + | if x.xGetObjectPath == 0 { | |
| 49 | + | return nil | |
| 50 | + | } | |
| 51 | + | var rawCallback func(ObjectVarp uintptr) string | |
| 52 | + | purego.RegisterFunc(&rawCallback, x.xGetObjectPath) | |
| 53 | + | return func(ObjectVar DBusObject) string { | |
| 54 | + | return rawCallback(ObjectVar.GoPointer()) | |
| 55 | + | } | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | // OverrideGetInterfaces sets the callback function. | |
| 59 | + | func (x *DBusObjectIface) OverrideGetInterfaces(cb func(DBusObject) *glib.List) { | |
| 60 | + | if cb == nil { | |
| 61 | + | x.xGetInterfaces = 0 | |
| 62 | + | } else { | |
| 63 | + | x.xGetInterfaces = purego.NewCallback(func(ObjectVarp uintptr) *glib.List { | |
| 64 | + | return cb(&DBusObjectBase{Ptr: ObjectVarp}) | |
| 65 | + | }) | |
| 66 | + | } | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | // GetGetInterfaces gets the callback function. | |
| 70 | + | func (x *DBusObjectIface) GetGetInterfaces() func(DBusObject) *glib.List { | |
| 71 | + | if x.xGetInterfaces == 0 { | |
| 72 | + | return nil | |
| 73 | + | } | |
| 74 | + | var rawCallback func(ObjectVarp uintptr) *glib.List | |
| 75 | + | purego.RegisterFunc(&rawCallback, x.xGetInterfaces) | |
| 76 | + | return func(ObjectVar DBusObject) *glib.List { | |
| 77 | + | return rawCallback(ObjectVar.GoPointer()) | |
| 78 | + | } | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | // OverrideGetInterface sets the callback function. | |
| 82 | + | func (x *DBusObjectIface) OverrideGetInterface(cb func(DBusObject, string) *DBusInterfaceBase) { | |
| 83 | + | if cb == nil { | |
| 84 | + | x.xGetInterface = 0 | |
| 85 | + | } else { | |
| 86 | + | x.xGetInterface = purego.NewCallback(func(ObjectVarp uintptr, InterfaceNameVarp string) uintptr { | |
| 87 | + | ret := cb(&DBusObjectBase{Ptr: ObjectVarp}, InterfaceNameVarp) | |
| 88 | + | if ret == nil { | |
| 89 | + | return 0 | |
| 90 | + | } | |
| 91 | + | return ret.GoPointer() | |
| 92 | + | }) | |
| 93 | + | } | |
| 94 | + | } | |
| 95 | + | ||
| 96 | + | // GetGetInterface gets the callback function. | |
| 97 | + | func (x *DBusObjectIface) GetGetInterface() func(DBusObject, string) *DBusInterfaceBase { | |
| 98 | + | if x.xGetInterface == 0 { | |
| 99 | + | return nil | |
| 100 | + | } | |
| 101 | + | var rawCallback func(ObjectVarp uintptr, InterfaceNameVarp string) uintptr | |
| 102 | + | purego.RegisterFunc(&rawCallback, x.xGetInterface) | |
| 103 | + | return func(ObjectVar DBusObject, InterfaceNameVar string) *DBusInterfaceBase { | |
| 104 | + | rawRet := rawCallback(ObjectVar.GoPointer(), InterfaceNameVar) | |
| 105 | + | if rawRet == 0 { | |
| 106 | + | return nil | |
| 107 | + | } | |
| 108 | + | ret := &DBusInterfaceBase{} | |
| 109 | + | ret.Ptr = rawRet | |
| 110 | + | return ret | |
| 111 | + | } | |
| 112 | + | } | |
| 113 | + | ||
| 114 | + | // OverrideInterfaceAdded sets the callback function. | |
| 115 | + | func (x *DBusObjectIface) OverrideInterfaceAdded(cb func(DBusObject, DBusInterface)) { | |
| 116 | + | if cb == nil { | |
| 117 | + | x.xInterfaceAdded = 0 | |
| 118 | + | } else { | |
| 119 | + | x.xInterfaceAdded = purego.NewCallback(func(ObjectVarp uintptr, InterfaceVarp uintptr) { | |
| 120 | + | cb(&DBusObjectBase{Ptr: ObjectVarp}, &DBusInterfaceBase{Ptr: InterfaceVarp}) | |
| 121 | + | }) | |
| 122 | + | } | |
| 123 | + | } | |
| 124 | + | ||
| 125 | + | // GetInterfaceAdded gets the callback function. | |
| 126 | + | func (x *DBusObjectIface) GetInterfaceAdded() func(DBusObject, DBusInterface) { | |
| 127 | + | if x.xInterfaceAdded == 0 { | |
| 128 | + | return nil | |
| 129 | + | } | |
| 130 | + | var rawCallback func(ObjectVarp uintptr, InterfaceVarp uintptr) | |
| 131 | + | purego.RegisterFunc(&rawCallback, x.xInterfaceAdded) | |
| 132 | + | return func(ObjectVar DBusObject, InterfaceVar DBusInterface) { | |
| 133 | + | rawCallback(ObjectVar.GoPointer(), InterfaceVar.GoPointer()) | |
| 134 | + | } | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | // OverrideInterfaceRemoved sets the callback function. | |
| 138 | + | func (x *DBusObjectIface) OverrideInterfaceRemoved(cb func(DBusObject, DBusInterface)) { | |
| 139 | + | if cb == nil { | |
| 140 | + | x.xInterfaceRemoved = 0 | |
| 141 | + | } else { | |
| 142 | + | x.xInterfaceRemoved = purego.NewCallback(func(ObjectVarp uintptr, InterfaceVarp uintptr) { | |
| 143 | + | cb(&DBusObjectBase{Ptr: ObjectVarp}, &DBusInterfaceBase{Ptr: InterfaceVarp}) | |
| 144 | + | }) | |
| 145 | + | } | |
| 146 | + | } | |
| 147 | + | ||
| 148 | + | // GetInterfaceRemoved gets the callback function. | |
| 149 | + | func (x *DBusObjectIface) GetInterfaceRemoved() func(DBusObject, DBusInterface) { | |
| 150 | + | if x.xInterfaceRemoved == 0 { | |
| 151 | + | return nil | |
| 152 | + | } | |
| 153 | + | var rawCallback func(ObjectVarp uintptr, InterfaceVarp uintptr) | |
| 154 | + | purego.RegisterFunc(&rawCallback, x.xInterfaceRemoved) | |
| 155 | + | return func(ObjectVar DBusObject, InterfaceVar DBusInterface) { | |
| 156 | + | rawCallback(ObjectVar.GoPointer(), InterfaceVar.GoPointer()) | |
| 157 | + | } | |
| 158 | + | } | |
| 159 | + | ||
| 25 | 160 | // The #GDBusObject type is the base type for D-Bus objects on both | |
| 26 | 161 | // the service side (see #GDBusObjectSkeleton) and the client side | |
| 27 | 162 | // (see #GDBusObjectProxy). It is essentially just a container of | |
M v4/gio/gdbusobjectmanager.go +220 -0
| @@ -16,12 +16,232 @@ type DBusObjectManagerIface struct { | |||
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | 18 | ParentIface uintptr | |
| 19 | + | ||
| 20 | + | xGetObjectPath uintptr | |
| 21 | + | ||
| 22 | + | xGetObjects uintptr | |
| 23 | + | ||
| 24 | + | xGetObject uintptr | |
| 25 | + | ||
| 26 | + | xGetInterface uintptr | |
| 27 | + | ||
| 28 | + | xObjectAdded uintptr | |
| 29 | + | ||
| 30 | + | xObjectRemoved uintptr | |
| 31 | + | ||
| 32 | + | xInterfaceAdded uintptr | |
| 33 | + | ||
| 34 | + | xInterfaceRemoved uintptr | |
| 19 | 35 | } | |
| 20 | 36 | ||
| 21 | 37 | func (x *DBusObjectManagerIface) GoPointer() uintptr { | |
| 22 | 38 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 39 | } | |
| 24 | 40 | ||
| 41 | + | // OverrideGetObjectPath sets the callback function. | |
| 42 | + | func (x *DBusObjectManagerIface) OverrideGetObjectPath(cb func(DBusObjectManager) string) { | |
| 43 | + | if cb == nil { | |
| 44 | + | x.xGetObjectPath = 0 | |
| 45 | + | } else { | |
| 46 | + | x.xGetObjectPath = purego.NewCallback(func(ManagerVarp uintptr) string { | |
| 47 | + | return cb(&DBusObjectManagerBase{Ptr: ManagerVarp}) | |
| 48 | + | }) | |
| 49 | + | } | |
| 50 | + | } | |
| 51 | + | ||
| 52 | + | // GetGetObjectPath gets the callback function. | |
| 53 | + | func (x *DBusObjectManagerIface) GetGetObjectPath() func(DBusObjectManager) string { | |
| 54 | + | if x.xGetObjectPath == 0 { | |
| 55 | + | return nil | |
| 56 | + | } | |
| 57 | + | var rawCallback func(ManagerVarp uintptr) string | |
| 58 | + | purego.RegisterFunc(&rawCallback, x.xGetObjectPath) | |
| 59 | + | return func(ManagerVar DBusObjectManager) string { | |
| 60 | + | return rawCallback(ManagerVar.GoPointer()) | |
| 61 | + | } | |
| 62 | + | } | |
| 63 | + | ||
| 64 | + | // OverrideGetObjects sets the callback function. | |
| 65 | + | func (x *DBusObjectManagerIface) OverrideGetObjects(cb func(DBusObjectManager) *glib.List) { | |
| 66 | + | if cb == nil { | |
| 67 | + | x.xGetObjects = 0 | |
| 68 | + | } else { | |
| 69 | + | x.xGetObjects = purego.NewCallback(func(ManagerVarp uintptr) *glib.List { | |
| 70 | + | return cb(&DBusObjectManagerBase{Ptr: ManagerVarp}) | |
| 71 | + | }) | |
| 72 | + | } | |
| 73 | + | } | |
| 74 | + | ||
| 75 | + | // GetGetObjects gets the callback function. | |
| 76 | + | func (x *DBusObjectManagerIface) GetGetObjects() func(DBusObjectManager) *glib.List { | |
| 77 | + | if x.xGetObjects == 0 { | |
| 78 | + | return nil | |
| 79 | + | } | |
| 80 | + | var rawCallback func(ManagerVarp uintptr) *glib.List | |
| 81 | + | purego.RegisterFunc(&rawCallback, x.xGetObjects) | |
| 82 | + | return func(ManagerVar DBusObjectManager) *glib.List { | |
| 83 | + | return rawCallback(ManagerVar.GoPointer()) | |
| 84 | + | } | |
| 85 | + | } | |
| 86 | + | ||
| 87 | + | // OverrideGetObject sets the callback function. | |
| 88 | + | func (x *DBusObjectManagerIface) OverrideGetObject(cb func(DBusObjectManager, string) *DBusObjectBase) { | |
| 89 | + | if cb == nil { | |
| 90 | + | x.xGetObject = 0 | |
| 91 | + | } else { | |
| 92 | + | x.xGetObject = purego.NewCallback(func(ManagerVarp uintptr, ObjectPathVarp string) uintptr { | |
| 93 | + | ret := cb(&DBusObjectManagerBase{Ptr: ManagerVarp}, ObjectPathVarp) | |
| 94 | + | if ret == nil { | |
| 95 | + | return 0 | |
| 96 | + | } | |
| 97 | + | return ret.GoPointer() | |
| 98 | + | }) | |
| 99 | + | } | |
| 100 | + | } | |
| 101 | + | ||
| 102 | + | // GetGetObject gets the callback function. | |
| 103 | + | func (x *DBusObjectManagerIface) GetGetObject() func(DBusObjectManager, string) *DBusObjectBase { | |
| 104 | + | if x.xGetObject == 0 { | |
| 105 | + | return nil | |
| 106 | + | } | |
| 107 | + | var rawCallback func(ManagerVarp uintptr, ObjectPathVarp string) uintptr | |
| 108 | + | purego.RegisterFunc(&rawCallback, x.xGetObject) | |
| 109 | + | return func(ManagerVar DBusObjectManager, ObjectPathVar string) *DBusObjectBase { | |
| 110 | + | rawRet := rawCallback(ManagerVar.GoPointer(), ObjectPathVar) | |
| 111 | + | if rawRet == 0 { | |
| 112 | + | return nil | |
| 113 | + | } | |
| 114 | + | ret := &DBusObjectBase{} | |
| 115 | + | ret.Ptr = rawRet | |
| 116 | + | return ret | |
| 117 | + | } | |
| 118 | + | } | |
| 119 | + | ||
| 120 | + | // OverrideGetInterface sets the callback function. | |
| 121 | + | func (x *DBusObjectManagerIface) OverrideGetInterface(cb func(DBusObjectManager, string, string) *DBusInterfaceBase) { | |
| 122 | + | if cb == nil { | |
| 123 | + | x.xGetInterface = 0 | |
| 124 | + | } else { | |
| 125 | + | x.xGetInterface = purego.NewCallback(func(ManagerVarp uintptr, ObjectPathVarp string, InterfaceNameVarp string) uintptr { | |
| 126 | + | ret := cb(&DBusObjectManagerBase{Ptr: ManagerVarp}, ObjectPathVarp, InterfaceNameVarp) | |
| 127 | + | if ret == nil { | |
| 128 | + | return 0 | |
| 129 | + | } | |
| 130 | + | return ret.GoPointer() | |
| 131 | + | }) | |
| 132 | + | } | |
| 133 | + | } | |
| 134 | + | ||
| 135 | + | // GetGetInterface gets the callback function. | |
| 136 | + | func (x *DBusObjectManagerIface) GetGetInterface() func(DBusObjectManager, string, string) *DBusInterfaceBase { | |
| 137 | + | if x.xGetInterface == 0 { | |
| 138 | + | return nil | |
| 139 | + | } | |
| 140 | + | var rawCallback func(ManagerVarp uintptr, ObjectPathVarp string, InterfaceNameVarp string) uintptr | |
| 141 | + | purego.RegisterFunc(&rawCallback, x.xGetInterface) | |
| 142 | + | return func(ManagerVar DBusObjectManager, ObjectPathVar string, InterfaceNameVar string) *DBusInterfaceBase { | |
| 143 | + | rawRet := rawCallback(ManagerVar.GoPointer(), ObjectPathVar, InterfaceNameVar) | |
| 144 | + | if rawRet == 0 { | |
| 145 | + | return nil | |
| 146 | + | } | |
| 147 | + | ret := &DBusInterfaceBase{} | |
| 148 | + | ret.Ptr = rawRet | |
| 149 | + | return ret | |
| 150 | + | } | |
| 151 | + | } | |
| 152 | + | ||
| 153 | + | // OverrideObjectAdded sets the callback function. | |
| 154 | + | func (x *DBusObjectManagerIface) OverrideObjectAdded(cb func(DBusObjectManager, DBusObject)) { | |
| 155 | + | if cb == nil { | |
| 156 | + | x.xObjectAdded = 0 | |
| 157 | + | } else { | |
| 158 | + | x.xObjectAdded = purego.NewCallback(func(ManagerVarp uintptr, ObjectVarp uintptr) { | |
| 159 | + | cb(&DBusObjectManagerBase{Ptr: ManagerVarp}, &DBusObjectBase{Ptr: ObjectVarp}) | |
| 160 | + | }) | |
| 161 | + | } | |
| 162 | + | } | |
| 163 | + | ||
| 164 | + | // GetObjectAdded gets the callback function. | |
| 165 | + | func (x *DBusObjectManagerIface) GetObjectAdded() func(DBusObjectManager, DBusObject) { | |
| 166 | + | if x.xObjectAdded == 0 { | |
| 167 | + | return nil | |
| 168 | + | } | |
| 169 | + | var rawCallback func(ManagerVarp uintptr, ObjectVarp uintptr) | |
| 170 | + | purego.RegisterFunc(&rawCallback, x.xObjectAdded) | |
| 171 | + | return func(ManagerVar DBusObjectManager, ObjectVar DBusObject) { | |
| 172 | + | rawCallback(ManagerVar.GoPointer(), ObjectVar.GoPointer()) | |
| 173 | + | } | |
| 174 | + | } | |
| 175 | + | ||
| 176 | + | // OverrideObjectRemoved sets the callback function. | |
| 177 | + | func (x *DBusObjectManagerIface) OverrideObjectRemoved(cb func(DBusObjectManager, DBusObject)) { | |
| 178 | + | if cb == nil { | |
| 179 | + | x.xObjectRemoved = 0 | |
| 180 | + | } else { | |
| 181 | + | x.xObjectRemoved = purego.NewCallback(func(ManagerVarp uintptr, ObjectVarp uintptr) { | |
| 182 | + | cb(&DBusObjectManagerBase{Ptr: ManagerVarp}, &DBusObjectBase{Ptr: ObjectVarp}) | |
| 183 | + | }) | |
| 184 | + | } | |
| 185 | + | } | |
| 186 | + | ||
| 187 | + | // GetObjectRemoved gets the callback function. | |
| 188 | + | func (x *DBusObjectManagerIface) GetObjectRemoved() func(DBusObjectManager, DBusObject) { | |
| 189 | + | if x.xObjectRemoved == 0 { | |
| 190 | + | return nil | |
| 191 | + | } | |
| 192 | + | var rawCallback func(ManagerVarp uintptr, ObjectVarp uintptr) | |
| 193 | + | purego.RegisterFunc(&rawCallback, x.xObjectRemoved) | |
| 194 | + | return func(ManagerVar DBusObjectManager, ObjectVar DBusObject) { | |
| 195 | + | rawCallback(ManagerVar.GoPointer(), ObjectVar.GoPointer()) | |
| 196 | + | } | |
| 197 | + | } | |
| 198 | + | ||
| 199 | + | // OverrideInterfaceAdded sets the callback function. | |
| 200 | + | func (x *DBusObjectManagerIface) OverrideInterfaceAdded(cb func(DBusObjectManager, DBusObject, DBusInterface)) { | |
| 201 | + | if cb == nil { | |
| 202 | + | x.xInterfaceAdded = 0 | |
| 203 | + | } else { | |
| 204 | + | x.xInterfaceAdded = purego.NewCallback(func(ManagerVarp uintptr, ObjectVarp uintptr, InterfaceVarp uintptr) { | |
| 205 | + | cb(&DBusObjectManagerBase{Ptr: ManagerVarp}, &DBusObjectBase{Ptr: ObjectVarp}, &DBusInterfaceBase{Ptr: InterfaceVarp}) | |
| 206 | + | }) | |
| 207 | + | } | |
| 208 | + | } | |
| 209 | + | ||
| 210 | + | // GetInterfaceAdded gets the callback function. | |
| 211 | + | func (x *DBusObjectManagerIface) GetInterfaceAdded() func(DBusObjectManager, DBusObject, DBusInterface) { | |
| 212 | + | if x.xInterfaceAdded == 0 { | |
| 213 | + | return nil | |
| 214 | + | } | |
| 215 | + | var rawCallback func(ManagerVarp uintptr, ObjectVarp uintptr, InterfaceVarp uintptr) | |
| 216 | + | purego.RegisterFunc(&rawCallback, x.xInterfaceAdded) | |
| 217 | + | return func(ManagerVar DBusObjectManager, ObjectVar DBusObject, InterfaceVar DBusInterface) { | |
| 218 | + | rawCallback(ManagerVar.GoPointer(), ObjectVar.GoPointer(), InterfaceVar.GoPointer()) | |
| 219 | + | } | |
| 220 | + | } | |
| 221 | + | ||
| 222 | + | // OverrideInterfaceRemoved sets the callback function. | |
| 223 | + | func (x *DBusObjectManagerIface) OverrideInterfaceRemoved(cb func(DBusObjectManager, DBusObject, DBusInterface)) { | |
| 224 | + | if cb == nil { | |
| 225 | + | x.xInterfaceRemoved = 0 | |
| 226 | + | } else { | |
| 227 | + | x.xInterfaceRemoved = purego.NewCallback(func(ManagerVarp uintptr, ObjectVarp uintptr, InterfaceVarp uintptr) { | |
| 228 | + | cb(&DBusObjectManagerBase{Ptr: ManagerVarp}, &DBusObjectBase{Ptr: ObjectVarp}, &DBusInterfaceBase{Ptr: InterfaceVarp}) | |
| 229 | + | }) | |
| 230 | + | } | |
| 231 | + | } | |
| 232 | + | ||
| 233 | + | // GetInterfaceRemoved gets the callback function. | |
| 234 | + | func (x *DBusObjectManagerIface) GetInterfaceRemoved() func(DBusObjectManager, DBusObject, DBusInterface) { | |
| 235 | + | if x.xInterfaceRemoved == 0 { | |
| 236 | + | return nil | |
| 237 | + | } | |
| 238 | + | var rawCallback func(ManagerVarp uintptr, ObjectVarp uintptr, InterfaceVarp uintptr) | |
| 239 | + | purego.RegisterFunc(&rawCallback, x.xInterfaceRemoved) | |
| 240 | + | return func(ManagerVar DBusObjectManager, ObjectVar DBusObject, InterfaceVar DBusInterface) { | |
| 241 | + | rawCallback(ManagerVar.GoPointer(), ObjectVar.GoPointer(), InterfaceVar.GoPointer()) | |
| 242 | + | } | |
| 243 | + | } | |
| 244 | + | ||
| 25 | 245 | // The #GDBusObjectManager type is the base type for service- and | |
| 26 | 246 | // client-side implementations of the standardized | |
| 27 | 247 | // [org.freedesktop.DBus.ObjectManager](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager) | |
M v4/gio/gdbusobjectmanagerclient.go +51 -1
| @@ -16,7 +16,11 @@ import ( | |||
| 16 | 16 | type DBusObjectManagerClientClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | + | ||
| 21 | + | xInterfaceProxySignal uintptr | |
| 22 | + | ||
| 23 | + | xInterfaceProxyPropertiesChanged uintptr | |
| 20 | 24 | ||
| 21 | 25 | Padding [8]uintptr | |
| 22 | 26 | } | |
| @@ -25,6 +29,52 @@ func (x *DBusObjectManagerClientClass) GoPointer() uintptr { | |||
| 25 | 29 | return uintptr(unsafe.Pointer(x)) | |
| 26 | 30 | } | |
| 27 | 31 | ||
| 32 | + | // OverrideInterfaceProxySignal sets the callback function. | |
| 33 | + | func (x *DBusObjectManagerClientClass) OverrideInterfaceProxySignal(cb func(*DBusObjectManagerClient, *DBusObjectProxy, *DBusProxy, string, string, *glib.Variant)) { | |
| 34 | + | if cb == nil { | |
| 35 | + | x.xInterfaceProxySignal = 0 | |
| 36 | + | } else { | |
| 37 | + | x.xInterfaceProxySignal = purego.NewCallback(func(ManagerVarp uintptr, ObjectProxyVarp uintptr, InterfaceProxyVarp uintptr, SenderNameVarp string, SignalNameVarp string, ParametersVarp *glib.Variant) { | |
| 38 | + | cb(DBusObjectManagerClientNewFromInternalPtr(ManagerVarp), DBusObjectProxyNewFromInternalPtr(ObjectProxyVarp), DBusProxyNewFromInternalPtr(InterfaceProxyVarp), SenderNameVarp, SignalNameVarp, ParametersVarp) | |
| 39 | + | }) | |
| 40 | + | } | |
| 41 | + | } | |
| 42 | + | ||
| 43 | + | // GetInterfaceProxySignal gets the callback function. | |
| 44 | + | func (x *DBusObjectManagerClientClass) GetInterfaceProxySignal() func(*DBusObjectManagerClient, *DBusObjectProxy, *DBusProxy, string, string, *glib.Variant) { | |
| 45 | + | if x.xInterfaceProxySignal == 0 { | |
| 46 | + | return nil | |
| 47 | + | } | |
| 48 | + | var rawCallback func(ManagerVarp uintptr, ObjectProxyVarp uintptr, InterfaceProxyVarp uintptr, SenderNameVarp string, SignalNameVarp string, ParametersVarp *glib.Variant) | |
| 49 | + | purego.RegisterFunc(&rawCallback, x.xInterfaceProxySignal) | |
| 50 | + | return func(ManagerVar *DBusObjectManagerClient, ObjectProxyVar *DBusObjectProxy, InterfaceProxyVar *DBusProxy, SenderNameVar string, SignalNameVar string, ParametersVar *glib.Variant) { | |
| 51 | + | rawCallback(ManagerVar.GoPointer(), ObjectProxyVar.GoPointer(), InterfaceProxyVar.GoPointer(), SenderNameVar, SignalNameVar, ParametersVar) | |
| 52 | + | } | |
| 53 | + | } | |
| 54 | + | ||
| 55 | + | // OverrideInterfaceProxyPropertiesChanged sets the callback function. | |
| 56 | + | func (x *DBusObjectManagerClientClass) OverrideInterfaceProxyPropertiesChanged(cb func(*DBusObjectManagerClient, *DBusObjectProxy, *DBusProxy, *glib.Variant, string)) { | |
| 57 | + | if cb == nil { | |
| 58 | + | x.xInterfaceProxyPropertiesChanged = 0 | |
| 59 | + | } else { | |
| 60 | + | x.xInterfaceProxyPropertiesChanged = purego.NewCallback(func(ManagerVarp uintptr, ObjectProxyVarp uintptr, InterfaceProxyVarp uintptr, ChangedPropertiesVarp *glib.Variant, InvalidatedPropertiesVarp string) { | |
| 61 | + | cb(DBusObjectManagerClientNewFromInternalPtr(ManagerVarp), DBusObjectProxyNewFromInternalPtr(ObjectProxyVarp), DBusProxyNewFromInternalPtr(InterfaceProxyVarp), ChangedPropertiesVarp, InvalidatedPropertiesVarp) | |
| 62 | + | }) | |
| 63 | + | } | |
| 64 | + | } | |
| 65 | + | ||
| 66 | + | // GetInterfaceProxyPropertiesChanged gets the callback function. | |
| 67 | + | func (x *DBusObjectManagerClientClass) GetInterfaceProxyPropertiesChanged() func(*DBusObjectManagerClient, *DBusObjectProxy, *DBusProxy, *glib.Variant, string) { | |
| 68 | + | if x.xInterfaceProxyPropertiesChanged == 0 { | |
| 69 | + | return nil | |
| 70 | + | } | |
| 71 | + | var rawCallback func(ManagerVarp uintptr, ObjectProxyVarp uintptr, InterfaceProxyVarp uintptr, ChangedPropertiesVarp *glib.Variant, InvalidatedPropertiesVarp string) | |
| 72 | + | purego.RegisterFunc(&rawCallback, x.xInterfaceProxyPropertiesChanged) | |
| 73 | + | return func(ManagerVar *DBusObjectManagerClient, ObjectProxyVar *DBusObjectProxy, InterfaceProxyVar *DBusProxy, ChangedPropertiesVar *glib.Variant, InvalidatedPropertiesVar string) { | |
| 74 | + | rawCallback(ManagerVar.GoPointer(), ObjectProxyVar.GoPointer(), InterfaceProxyVar.GoPointer(), ChangedPropertiesVar, InvalidatedPropertiesVar) | |
| 75 | + | } | |
| 76 | + | } | |
| 77 | + | ||
| 28 | 78 | type DBusObjectManagerClientPrivate struct { | |
| 29 | 79 | _ structs.HostLayout | |
| 30 | 80 | } | |
M v4/gio/gdbusobjectmanagerserver.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type DBusObjectManagerServerClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | 20 | ||
| 21 | 21 | Padding [8]uintptr | |
| 22 | 22 | } | |
M v4/gio/gdbusobjectproxy.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type DBusObjectProxyClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | 20 | ||
| 21 | 21 | Padding [8]uintptr | |
| 22 | 22 | } | |
M v4/gio/gdbusobjectskeleton.go +26 -1
| @@ -16,7 +16,9 @@ import ( | |||
| 16 | 16 | type DBusObjectSkeletonClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | + | ||
| 21 | + | xAuthorizeMethod uintptr | |
| 20 | 22 | ||
| 21 | 23 | Padding [8]uintptr | |
| 22 | 24 | } | |
| @@ -25,6 +27,29 @@ func (x *DBusObjectSkeletonClass) GoPointer() uintptr { | |||
| 25 | 27 | return uintptr(unsafe.Pointer(x)) | |
| 26 | 28 | } | |
| 27 | 29 | ||
| 30 | + | // OverrideAuthorizeMethod sets the callback function. | |
| 31 | + | func (x *DBusObjectSkeletonClass) OverrideAuthorizeMethod(cb func(*DBusObjectSkeleton, *DBusInterfaceSkeleton, *DBusMethodInvocation) bool) { | |
| 32 | + | if cb == nil { | |
| 33 | + | x.xAuthorizeMethod = 0 | |
| 34 | + | } else { | |
| 35 | + | x.xAuthorizeMethod = purego.NewCallback(func(ObjectVarp uintptr, InterfaceVarp uintptr, InvocationVarp uintptr) bool { | |
| 36 | + | return cb(DBusObjectSkeletonNewFromInternalPtr(ObjectVarp), DBusInterfaceSkeletonNewFromInternalPtr(InterfaceVarp), DBusMethodInvocationNewFromInternalPtr(InvocationVarp)) | |
| 37 | + | }) | |
| 38 | + | } | |
| 39 | + | } | |
| 40 | + | ||
| 41 | + | // GetAuthorizeMethod gets the callback function. | |
| 42 | + | func (x *DBusObjectSkeletonClass) GetAuthorizeMethod() func(*DBusObjectSkeleton, *DBusInterfaceSkeleton, *DBusMethodInvocation) bool { | |
| 43 | + | if x.xAuthorizeMethod == 0 { | |
| 44 | + | return nil | |
| 45 | + | } | |
| 46 | + | var rawCallback func(ObjectVarp uintptr, InterfaceVarp uintptr, InvocationVarp uintptr) bool | |
| 47 | + | purego.RegisterFunc(&rawCallback, x.xAuthorizeMethod) | |
| 48 | + | return func(ObjectVar *DBusObjectSkeleton, InterfaceVar *DBusInterfaceSkeleton, InvocationVar *DBusMethodInvocation) bool { | |
| 49 | + | return rawCallback(ObjectVar.GoPointer(), InterfaceVar.GoPointer(), InvocationVar.GoPointer()) | |
| 50 | + | } | |
| 51 | + | } | |
| 52 | + | ||
| 28 | 53 | type DBusObjectSkeletonPrivate struct { | |
| 29 | 54 | _ structs.HostLayout | |
| 30 | 55 | } | |
M v4/gio/gdbusproxy.go +55 -5
| @@ -16,7 +16,11 @@ import ( | |||
| 16 | 16 | type DBusProxyClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | + | ||
| 21 | + | xGPropertiesChanged uintptr | |
| 22 | + | ||
| 23 | + | xGSignal uintptr | |
| 20 | 24 | ||
| 21 | 25 | Padding [32]uintptr | |
| 22 | 26 | } | |
| @@ -25,6 +29,52 @@ func (x *DBusProxyClass) GoPointer() uintptr { | |||
| 25 | 29 | return uintptr(unsafe.Pointer(x)) | |
| 26 | 30 | } | |
| 27 | 31 | ||
| 32 | + | // OverrideGPropertiesChanged sets the callback function. | |
| 33 | + | func (x *DBusProxyClass) OverrideGPropertiesChanged(cb func(*DBusProxy, *glib.Variant, string)) { | |
| 34 | + | if cb == nil { | |
| 35 | + | x.xGPropertiesChanged = 0 | |
| 36 | + | } else { | |
| 37 | + | x.xGPropertiesChanged = purego.NewCallback(func(ProxyVarp uintptr, ChangedPropertiesVarp *glib.Variant, InvalidatedPropertiesVarp string) { | |
| 38 | + | cb(DBusProxyNewFromInternalPtr(ProxyVarp), ChangedPropertiesVarp, InvalidatedPropertiesVarp) | |
| 39 | + | }) | |
| 40 | + | } | |
| 41 | + | } | |
| 42 | + | ||
| 43 | + | // GetGPropertiesChanged gets the callback function. | |
| 44 | + | func (x *DBusProxyClass) GetGPropertiesChanged() func(*DBusProxy, *glib.Variant, string) { | |
| 45 | + | if x.xGPropertiesChanged == 0 { | |
| 46 | + | return nil | |
| 47 | + | } | |
| 48 | + | var rawCallback func(ProxyVarp uintptr, ChangedPropertiesVarp *glib.Variant, InvalidatedPropertiesVarp string) | |
| 49 | + | purego.RegisterFunc(&rawCallback, x.xGPropertiesChanged) | |
| 50 | + | return func(ProxyVar *DBusProxy, ChangedPropertiesVar *glib.Variant, InvalidatedPropertiesVar string) { | |
| 51 | + | rawCallback(ProxyVar.GoPointer(), ChangedPropertiesVar, InvalidatedPropertiesVar) | |
| 52 | + | } | |
| 53 | + | } | |
| 54 | + | ||
| 55 | + | // OverrideGSignal sets the callback function. | |
| 56 | + | func (x *DBusProxyClass) OverrideGSignal(cb func(*DBusProxy, string, string, *glib.Variant)) { | |
| 57 | + | if cb == nil { | |
| 58 | + | x.xGSignal = 0 | |
| 59 | + | } else { | |
| 60 | + | x.xGSignal = purego.NewCallback(func(ProxyVarp uintptr, SenderNameVarp string, SignalNameVarp string, ParametersVarp *glib.Variant) { | |
| 61 | + | cb(DBusProxyNewFromInternalPtr(ProxyVarp), SenderNameVarp, SignalNameVarp, ParametersVarp) | |
| 62 | + | }) | |
| 63 | + | } | |
| 64 | + | } | |
| 65 | + | ||
| 66 | + | // GetGSignal gets the callback function. | |
| 67 | + | func (x *DBusProxyClass) GetGSignal() func(*DBusProxy, string, string, *glib.Variant) { | |
| 68 | + | if x.xGSignal == 0 { | |
| 69 | + | return nil | |
| 70 | + | } | |
| 71 | + | var rawCallback func(ProxyVarp uintptr, SenderNameVarp string, SignalNameVarp string, ParametersVarp *glib.Variant) | |
| 72 | + | purego.RegisterFunc(&rawCallback, x.xGSignal) | |
| 73 | + | return func(ProxyVar *DBusProxy, SenderNameVar string, SignalNameVar string, ParametersVar *glib.Variant) { | |
| 74 | + | rawCallback(ProxyVar.GoPointer(), SenderNameVar, SignalNameVar, ParametersVar) | |
| 75 | + | } | |
| 76 | + | } | |
| 77 | + | ||
| 28 | 78 | type DBusProxyPrivate struct { | |
| 29 | 79 | _ structs.HostLayout | |
| 30 | 80 | } | |
| @@ -326,13 +376,13 @@ func (x *DBusProxy) CallWithUnixFdList(MethodNameVar string, ParametersVar *glib | |||
| 326 | 376 | ||
| 327 | 377 | } | |
| 328 | 378 | ||
| 329 | - | var xDBusProxyCallWithUnixFdListFinish func(uintptr, *uintptr, uintptr, **glib.Error) *glib.Variant | |
| 379 | + | var xDBusProxyCallWithUnixFdListFinish func(uintptr, uintptr, uintptr, **glib.Error) *glib.Variant | |
| 330 | 380 | ||
| 331 | 381 | // Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list(). | |
| 332 | 382 | func (x *DBusProxy) CallWithUnixFdListFinish(OutFdListVar **UnixFDList, ResVar AsyncResult) (*glib.Variant, error) { | |
| 333 | 383 | var cerr *glib.Error | |
| 334 | 384 | ||
| 335 | - | cret := xDBusProxyCallWithUnixFdListFinish(x.GoPointer(), gobject.ConvertPtr(OutFdListVar), ResVar.GoPointer(), &cerr) | |
| 385 | + | cret := xDBusProxyCallWithUnixFdListFinish(x.GoPointer(), *gobject.ConvertPtr(OutFdListVar), ResVar.GoPointer(), &cerr) | |
| 336 | 386 | if cerr == nil { | |
| 337 | 387 | return cret, nil | |
| 338 | 388 | } | |
| @@ -340,7 +390,7 @@ func (x *DBusProxy) CallWithUnixFdListFinish(OutFdListVar **UnixFDList, ResVar A | |||
| 340 | 390 | ||
| 341 | 391 | } | |
| 342 | 392 | ||
| 343 | - | var xDBusProxyCallWithUnixFdListSync func(uintptr, string, *glib.Variant, DBusCallFlags, int, uintptr, *uintptr, uintptr, **glib.Error) *glib.Variant | |
| 393 | + | var xDBusProxyCallWithUnixFdListSync func(uintptr, string, *glib.Variant, DBusCallFlags, int, uintptr, uintptr, uintptr, **glib.Error) *glib.Variant | |
| 344 | 394 | ||
| 345 | 395 | // Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects. | |
| 346 | 396 | // | |
| @@ -348,7 +398,7 @@ var xDBusProxyCallWithUnixFdListSync func(uintptr, string, *glib.Variant, DBusCa | |||
| 348 | 398 | func (x *DBusProxy) CallWithUnixFdListSync(MethodNameVar string, ParametersVar *glib.Variant, FlagsVar DBusCallFlags, TimeoutMsecVar int, FdListVar *UnixFDList, OutFdListVar **UnixFDList, CancellableVar *Cancellable) (*glib.Variant, error) { | |
| 349 | 399 | var cerr *glib.Error | |
| 350 | 400 | ||
| 351 | - | cret := xDBusProxyCallWithUnixFdListSync(x.GoPointer(), MethodNameVar, ParametersVar, FlagsVar, TimeoutMsecVar, FdListVar.GoPointer(), gobject.ConvertPtr(OutFdListVar), CancellableVar.GoPointer(), &cerr) | |
| 401 | + | cret := xDBusProxyCallWithUnixFdListSync(x.GoPointer(), MethodNameVar, ParametersVar, FlagsVar, TimeoutMsecVar, FdListVar.GoPointer(), *gobject.ConvertPtr(OutFdListVar), CancellableVar.GoPointer(), &cerr) | |
| 352 | 402 | if cerr == nil { | |
| 353 | 403 | return cret, nil | |
| 354 | 404 | } | |
M v4/gio/gdebugcontrollerdbus.go +26 -1
| @@ -16,7 +16,9 @@ import ( | |||
| 16 | 16 | type DebugControllerDBusClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | + | ||
| 21 | + | xAuthorize uintptr | |
| 20 | 22 | ||
| 21 | 23 | Padding [12]uintptr | |
| 22 | 24 | } | |
| @@ -25,6 +27,29 @@ func (x *DebugControllerDBusClass) GoPointer() uintptr { | |||
| 25 | 27 | return uintptr(unsafe.Pointer(x)) | |
| 26 | 28 | } | |
| 27 | 29 | ||
| 30 | + | // OverrideAuthorize sets the callback function. | |
| 31 | + | func (x *DebugControllerDBusClass) OverrideAuthorize(cb func(*DebugControllerDBus, *DBusMethodInvocation) bool) { | |
| 32 | + | if cb == nil { | |
| 33 | + | x.xAuthorize = 0 | |
| 34 | + | } else { | |
| 35 | + | x.xAuthorize = purego.NewCallback(func(ControllerVarp uintptr, InvocationVarp uintptr) bool { | |
| 36 | + | return cb(DebugControllerDBusNewFromInternalPtr(ControllerVarp), DBusMethodInvocationNewFromInternalPtr(InvocationVarp)) | |
| 37 | + | }) | |
| 38 | + | } | |
| 39 | + | } | |
| 40 | + | ||
| 41 | + | // GetAuthorize gets the callback function. | |
| 42 | + | func (x *DebugControllerDBusClass) GetAuthorize() func(*DebugControllerDBus, *DBusMethodInvocation) bool { | |
| 43 | + | if x.xAuthorize == 0 { | |
| 44 | + | return nil | |
| 45 | + | } | |
| 46 | + | var rawCallback func(ControllerVarp uintptr, InvocationVarp uintptr) bool | |
| 47 | + | purego.RegisterFunc(&rawCallback, x.xAuthorize) | |
| 48 | + | return func(ControllerVar *DebugControllerDBus, InvocationVar *DBusMethodInvocation) bool { | |
| 49 | + | return rawCallback(ControllerVar.GoPointer(), InvocationVar.GoPointer()) | |
| 50 | + | } | |
| 51 | + | } | |
| 52 | + | ||
| 28 | 53 | // #GDebugControllerDBus is an implementation of #GDebugController which exposes | |
| 29 | 54 | // debug settings as a D-Bus object. | |
| 30 | 55 | // | |
M v4/gio/gdesktopappinfo.go +36 -1
| @@ -20,7 +20,7 @@ type DesktopAppLaunchCallback func(uintptr, glib.Pid, uintptr) | |||
| 20 | 20 | type DesktopAppInfoClass struct { | |
| 21 | 21 | _ structs.HostLayout | |
| 22 | 22 | ||
| 23 | - | ParentClass uintptr | |
| 23 | + | ParentClass gobject.ObjectClass | |
| 24 | 24 | } | |
| 25 | 25 | ||
| 26 | 26 | func (x *DesktopAppInfoClass) GoPointer() uintptr { | |
| @@ -33,12 +33,47 @@ type DesktopAppInfoLookupIface struct { | |||
| 33 | 33 | _ structs.HostLayout | |
| 34 | 34 | ||
| 35 | 35 | GIface uintptr | |
| 36 | + | ||
| 37 | + | xGetDefaultForUriScheme uintptr | |
| 36 | 38 | } | |
| 37 | 39 | ||
| 38 | 40 | func (x *DesktopAppInfoLookupIface) GoPointer() uintptr { | |
| 39 | 41 | return uintptr(unsafe.Pointer(x)) | |
| 40 | 42 | } | |
| 41 | 43 | ||
| 44 | + | // OverrideGetDefaultForUriScheme sets the callback function. | |
| 45 | + | func (x *DesktopAppInfoLookupIface) OverrideGetDefaultForUriScheme(cb func(DesktopAppInfoLookup, string) *AppInfoBase) { | |
| 46 | + | if cb == nil { | |
| 47 | + | x.xGetDefaultForUriScheme = 0 | |
| 48 | + | } else { | |
| 49 | + | x.xGetDefaultForUriScheme = purego.NewCallback(func(LookupVarp uintptr, UriSchemeVarp string) uintptr { | |
| 50 | + | ret := cb(&DesktopAppInfoLookupBase{Ptr: LookupVarp}, UriSchemeVarp) | |
| 51 | + | if ret == nil { | |
| 52 | + | return 0 | |
| 53 | + | } | |
| 54 | + | return ret.GoPointer() | |
| 55 | + | }) | |
| 56 | + | } | |
| 57 | + | } | |
| 58 | + | ||
| 59 | + | // GetGetDefaultForUriScheme gets the callback function. | |
| 60 | + | func (x *DesktopAppInfoLookupIface) GetGetDefaultForUriScheme() func(DesktopAppInfoLookup, string) *AppInfoBase { | |
| 61 | + | if x.xGetDefaultForUriScheme == 0 { | |
| 62 | + | return nil | |
| 63 | + | } | |
| 64 | + | var rawCallback func(LookupVarp uintptr, UriSchemeVarp string) uintptr | |
| 65 | + | purego.RegisterFunc(&rawCallback, x.xGetDefaultForUriScheme) | |
| 66 | + | return func(LookupVar DesktopAppInfoLookup, UriSchemeVar string) *AppInfoBase { | |
| 67 | + | rawRet := rawCallback(LookupVar.GoPointer(), UriSchemeVar) | |
| 68 | + | if rawRet == 0 { | |
| 69 | + | return nil | |
| 70 | + | } | |
| 71 | + | ret := &AppInfoBase{} | |
| 72 | + | ret.Ptr = rawRet | |
| 73 | + | return ret | |
| 74 | + | } | |
| 75 | + | } | |
| 76 | + | ||
| 42 | 77 | // #GDesktopAppInfoLookup is an opaque data structure and can only be accessed | |
| 43 | 78 | // using the following functions. | |
| 44 | 79 | type DesktopAppInfoLookup interface { | |
M v4/gio/gdrive.go +825 -5
| @@ -16,12 +16,832 @@ type DriveIface struct { | |||
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | 18 | GIface uintptr | |
| 19 | + | ||
| 20 | + | xChanged uintptr | |
| 21 | + | ||
| 22 | + | xDisconnected uintptr | |
| 23 | + | ||
| 24 | + | xEjectButton uintptr | |
| 25 | + | ||
| 26 | + | xGetName uintptr | |
| 27 | + | ||
| 28 | + | xGetIcon uintptr | |
| 29 | + | ||
| 30 | + | xHasVolumes uintptr | |
| 31 | + | ||
| 32 | + | xGetVolumes uintptr | |
| 33 | + | ||
| 34 | + | xIsMediaRemovable uintptr | |
| 35 | + | ||
| 36 | + | xHasMedia uintptr | |
| 37 | + | ||
| 38 | + | xIsMediaCheckAutomatic uintptr | |
| 39 | + | ||
| 40 | + | xCanEject uintptr | |
| 41 | + | ||
| 42 | + | xCanPollForMedia uintptr | |
| 43 | + | ||
| 44 | + | xEject uintptr | |
| 45 | + | ||
| 46 | + | xEjectFinish uintptr | |
| 47 | + | ||
| 48 | + | xPollForMedia uintptr | |
| 49 | + | ||
| 50 | + | xPollForMediaFinish uintptr | |
| 51 | + | ||
| 52 | + | xGetIdentifier uintptr | |
| 53 | + | ||
| 54 | + | xEnumerateIdentifiers uintptr | |
| 55 | + | ||
| 56 | + | xGetStartStopType uintptr | |
| 57 | + | ||
| 58 | + | xCanStart uintptr | |
| 59 | + | ||
| 60 | + | xCanStartDegraded uintptr | |
| 61 | + | ||
| 62 | + | xStart uintptr | |
| 63 | + | ||
| 64 | + | xStartFinish uintptr | |
| 65 | + | ||
| 66 | + | xCanStop uintptr | |
| 67 | + | ||
| 68 | + | xStop uintptr | |
| 69 | + | ||
| 70 | + | xStopFinish uintptr | |
| 71 | + | ||
| 72 | + | xStopButton uintptr | |
| 73 | + | ||
| 74 | + | xEjectWithOperation uintptr | |
| 75 | + | ||
| 76 | + | xEjectWithOperationFinish uintptr | |
| 77 | + | ||
| 78 | + | xGetSortKey uintptr | |
| 79 | + | ||
| 80 | + | xGetSymbolicIcon uintptr | |
| 81 | + | ||
| 82 | + | xIsRemovable uintptr | |
| 19 | 83 | } | |
| 20 | 84 | ||
| 21 | 85 | func (x *DriveIface) GoPointer() uintptr { | |
| 22 | 86 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 87 | } | |
| 24 | 88 | ||
| 89 | + | // OverrideChanged sets the callback function. | |
| 90 | + | func (x *DriveIface) OverrideChanged(cb func(Drive)) { | |
| 91 | + | if cb == nil { | |
| 92 | + | x.xChanged = 0 | |
| 93 | + | } else { | |
| 94 | + | x.xChanged = purego.NewCallback(func(DriveVarp uintptr) { | |
| 95 | + | cb(&DriveBase{Ptr: DriveVarp}) | |
| 96 | + | }) | |
| 97 | + | } | |
| 98 | + | } | |
| 99 | + | ||
| 100 | + | // GetChanged gets the callback function. | |
| 101 | + | func (x *DriveIface) GetChanged() func(Drive) { | |
| 102 | + | if x.xChanged == 0 { | |
| 103 | + | return nil | |
| 104 | + | } | |
| 105 | + | var rawCallback func(DriveVarp uintptr) | |
| 106 | + | purego.RegisterFunc(&rawCallback, x.xChanged) | |
| 107 | + | return func(DriveVar Drive) { | |
| 108 | + | rawCallback(DriveVar.GoPointer()) | |
| 109 | + | } | |
| 110 | + | } | |
| 111 | + | ||
| 112 | + | // OverrideDisconnected sets the callback function. | |
| 113 | + | func (x *DriveIface) OverrideDisconnected(cb func(Drive)) { | |
| 114 | + | if cb == nil { | |
| 115 | + | x.xDisconnected = 0 | |
| 116 | + | } else { | |
| 117 | + | x.xDisconnected = purego.NewCallback(func(DriveVarp uintptr) { | |
| 118 | + | cb(&DriveBase{Ptr: DriveVarp}) | |
| 119 | + | }) | |
| 120 | + | } | |
| 121 | + | } | |
| 122 | + | ||
| 123 | + | // GetDisconnected gets the callback function. | |
| 124 | + | func (x *DriveIface) GetDisconnected() func(Drive) { | |
| 125 | + | if x.xDisconnected == 0 { | |
| 126 | + | return nil | |
| 127 | + | } | |
| 128 | + | var rawCallback func(DriveVarp uintptr) | |
| 129 | + | purego.RegisterFunc(&rawCallback, x.xDisconnected) | |
| 130 | + | return func(DriveVar Drive) { | |
| 131 | + | rawCallback(DriveVar.GoPointer()) | |
| 132 | + | } | |
| 133 | + | } | |
| 134 | + | ||
| 135 | + | // OverrideEjectButton sets the callback function. | |
| 136 | + | func (x *DriveIface) OverrideEjectButton(cb func(Drive)) { | |
| 137 | + | if cb == nil { | |
| 138 | + | x.xEjectButton = 0 | |
| 139 | + | } else { | |
| 140 | + | x.xEjectButton = purego.NewCallback(func(DriveVarp uintptr) { | |
| 141 | + | cb(&DriveBase{Ptr: DriveVarp}) | |
| 142 | + | }) | |
| 143 | + | } | |
| 144 | + | } | |
| 145 | + | ||
| 146 | + | // GetEjectButton gets the callback function. | |
| 147 | + | func (x *DriveIface) GetEjectButton() func(Drive) { | |
| 148 | + | if x.xEjectButton == 0 { | |
| 149 | + | return nil | |
| 150 | + | } | |
| 151 | + | var rawCallback func(DriveVarp uintptr) | |
| 152 | + | purego.RegisterFunc(&rawCallback, x.xEjectButton) | |
| 153 | + | return func(DriveVar Drive) { | |
| 154 | + | rawCallback(DriveVar.GoPointer()) | |
| 155 | + | } | |
| 156 | + | } | |
| 157 | + | ||
| 158 | + | // OverrideGetName sets the callback function. | |
| 159 | + | func (x *DriveIface) OverrideGetName(cb func(Drive) string) { | |
| 160 | + | if cb == nil { | |
| 161 | + | x.xGetName = 0 | |
| 162 | + | } else { | |
| 163 | + | x.xGetName = purego.NewCallback(func(DriveVarp uintptr) string { | |
| 164 | + | return cb(&DriveBase{Ptr: DriveVarp}) | |
| 165 | + | }) | |
| 166 | + | } | |
| 167 | + | } | |
| 168 | + | ||
| 169 | + | // GetGetName gets the callback function. | |
| 170 | + | func (x *DriveIface) GetGetName() func(Drive) string { | |
| 171 | + | if x.xGetName == 0 { | |
| 172 | + | return nil | |
| 173 | + | } | |
| 174 | + | var rawCallback func(DriveVarp uintptr) string | |
| 175 | + | purego.RegisterFunc(&rawCallback, x.xGetName) | |
| 176 | + | return func(DriveVar Drive) string { | |
| 177 | + | return rawCallback(DriveVar.GoPointer()) | |
| 178 | + | } | |
| 179 | + | } | |
| 180 | + | ||
| 181 | + | // OverrideGetIcon sets the callback function. | |
| 182 | + | func (x *DriveIface) OverrideGetIcon(cb func(Drive) *IconBase) { | |
| 183 | + | if cb == nil { | |
| 184 | + | x.xGetIcon = 0 | |
| 185 | + | } else { | |
| 186 | + | x.xGetIcon = purego.NewCallback(func(DriveVarp uintptr) uintptr { | |
| 187 | + | ret := cb(&DriveBase{Ptr: DriveVarp}) | |
| 188 | + | if ret == nil { | |
| 189 | + | return 0 | |
| 190 | + | } | |
| 191 | + | return ret.GoPointer() | |
| 192 | + | }) | |
| 193 | + | } | |
| 194 | + | } | |
| 195 | + | ||
| 196 | + | // GetGetIcon gets the callback function. | |
| 197 | + | func (x *DriveIface) GetGetIcon() func(Drive) *IconBase { | |
| 198 | + | if x.xGetIcon == 0 { | |
| 199 | + | return nil | |
| 200 | + | } | |
| 201 | + | var rawCallback func(DriveVarp uintptr) uintptr | |
| 202 | + | purego.RegisterFunc(&rawCallback, x.xGetIcon) | |
| 203 | + | return func(DriveVar Drive) *IconBase { | |
| 204 | + | rawRet := rawCallback(DriveVar.GoPointer()) | |
| 205 | + | if rawRet == 0 { | |
| 206 | + | return nil | |
| 207 | + | } | |
| 208 | + | ret := &IconBase{} | |
| 209 | + | ret.Ptr = rawRet | |
| 210 | + | return ret | |
| 211 | + | } | |
| 212 | + | } | |
| 213 | + | ||
| 214 | + | // OverrideHasVolumes sets the callback function. | |
| 215 | + | func (x *DriveIface) OverrideHasVolumes(cb func(Drive) bool) { | |
| 216 | + | if cb == nil { | |
| 217 | + | x.xHasVolumes = 0 | |
| 218 | + | } else { | |
| 219 | + | x.xHasVolumes = purego.NewCallback(func(DriveVarp uintptr) bool { | |
| 220 | + | return cb(&DriveBase{Ptr: DriveVarp}) | |
| 221 | + | }) | |
| 222 | + | } | |
| 223 | + | } | |
| 224 | + | ||
| 225 | + | // GetHasVolumes gets the callback function. | |
| 226 | + | func (x *DriveIface) GetHasVolumes() func(Drive) bool { | |
| 227 | + | if x.xHasVolumes == 0 { | |
| 228 | + | return nil | |
| 229 | + | } | |
| 230 | + | var rawCallback func(DriveVarp uintptr) bool | |
| 231 | + | purego.RegisterFunc(&rawCallback, x.xHasVolumes) | |
| 232 | + | return func(DriveVar Drive) bool { | |
| 233 | + | return rawCallback(DriveVar.GoPointer()) | |
| 234 | + | } | |
| 235 | + | } | |
| 236 | + | ||
| 237 | + | // OverrideGetVolumes sets the callback function. | |
| 238 | + | func (x *DriveIface) OverrideGetVolumes(cb func(Drive) *glib.List) { | |
| 239 | + | if cb == nil { | |
| 240 | + | x.xGetVolumes = 0 | |
| 241 | + | } else { | |
| 242 | + | x.xGetVolumes = purego.NewCallback(func(DriveVarp uintptr) *glib.List { | |
| 243 | + | return cb(&DriveBase{Ptr: DriveVarp}) | |
| 244 | + | }) | |
| 245 | + | } | |
| 246 | + | } | |
| 247 | + | ||
| 248 | + | // GetGetVolumes gets the callback function. | |
| 249 | + | func (x *DriveIface) GetGetVolumes() func(Drive) *glib.List { | |
| 250 | + | if x.xGetVolumes == 0 { | |
| 251 | + | return nil | |
| 252 | + | } | |
| 253 | + | var rawCallback func(DriveVarp uintptr) *glib.List | |
| 254 | + | purego.RegisterFunc(&rawCallback, x.xGetVolumes) | |
| 255 | + | return func(DriveVar Drive) *glib.List { | |
| 256 | + | return rawCallback(DriveVar.GoPointer()) | |
| 257 | + | } | |
| 258 | + | } | |
| 259 | + | ||
| 260 | + | // OverrideIsMediaRemovable sets the callback function. | |
| 261 | + | func (x *DriveIface) OverrideIsMediaRemovable(cb func(Drive) bool) { | |
| 262 | + | if cb == nil { | |
| 263 | + | x.xIsMediaRemovable = 0 | |
| 264 | + | } else { | |
| 265 | + | x.xIsMediaRemovable = purego.NewCallback(func(DriveVarp uintptr) bool { | |
| 266 | + | return cb(&DriveBase{Ptr: DriveVarp}) | |
| 267 | + | }) | |
| 268 | + | } | |
| 269 | + | } | |
| 270 | + | ||
| 271 | + | // GetIsMediaRemovable gets the callback function. | |
| 272 | + | func (x *DriveIface) GetIsMediaRemovable() func(Drive) bool { | |
| 273 | + | if x.xIsMediaRemovable == 0 { | |
| 274 | + | return nil | |
| 275 | + | } | |
| 276 | + | var rawCallback func(DriveVarp uintptr) bool | |
| 277 | + | purego.RegisterFunc(&rawCallback, x.xIsMediaRemovable) | |
| 278 | + | return func(DriveVar Drive) bool { | |
| 279 | + | return rawCallback(DriveVar.GoPointer()) | |
| 280 | + | } | |
| 281 | + | } | |
| 282 | + | ||
| 283 | + | // OverrideHasMedia sets the callback function. | |
| 284 | + | func (x *DriveIface) OverrideHasMedia(cb func(Drive) bool) { | |
| 285 | + | if cb == nil { | |
| 286 | + | x.xHasMedia = 0 | |
| 287 | + | } else { | |
| 288 | + | x.xHasMedia = purego.NewCallback(func(DriveVarp uintptr) bool { | |
| 289 | + | return cb(&DriveBase{Ptr: DriveVarp}) | |
| 290 | + | }) | |
| 291 | + | } | |
| 292 | + | } | |
| 293 | + | ||
| 294 | + | // GetHasMedia gets the callback function. | |
| 295 | + | func (x *DriveIface) GetHasMedia() func(Drive) bool { | |
| 296 | + | if x.xHasMedia == 0 { | |
| 297 | + | return nil | |
| 298 | + | } | |
| 299 | + | var rawCallback func(DriveVarp uintptr) bool | |
| 300 | + | purego.RegisterFunc(&rawCallback, x.xHasMedia) | |
| 301 | + | return func(DriveVar Drive) bool { | |
| 302 | + | return rawCallback(DriveVar.GoPointer()) | |
| 303 | + | } | |
| 304 | + | } | |
| 305 | + | ||
| 306 | + | // OverrideIsMediaCheckAutomatic sets the callback function. | |
| 307 | + | func (x *DriveIface) OverrideIsMediaCheckAutomatic(cb func(Drive) bool) { | |
| 308 | + | if cb == nil { | |
| 309 | + | x.xIsMediaCheckAutomatic = 0 | |
| 310 | + | } else { | |
| 311 | + | x.xIsMediaCheckAutomatic = purego.NewCallback(func(DriveVarp uintptr) bool { | |
| 312 | + | return cb(&DriveBase{Ptr: DriveVarp}) | |
| 313 | + | }) | |
| 314 | + | } | |
| 315 | + | } | |
| 316 | + | ||
| 317 | + | // GetIsMediaCheckAutomatic gets the callback function. | |
| 318 | + | func (x *DriveIface) GetIsMediaCheckAutomatic() func(Drive) bool { | |
| 319 | + | if x.xIsMediaCheckAutomatic == 0 { | |
| 320 | + | return nil | |
| 321 | + | } | |
| 322 | + | var rawCallback func(DriveVarp uintptr) bool | |
| 323 | + | purego.RegisterFunc(&rawCallback, x.xIsMediaCheckAutomatic) | |
| 324 | + | return func(DriveVar Drive) bool { | |
| 325 | + | return rawCallback(DriveVar.GoPointer()) | |
| 326 | + | } | |
| 327 | + | } | |
| 328 | + | ||
| 329 | + | // OverrideCanEject sets the callback function. | |
| 330 | + | func (x *DriveIface) OverrideCanEject(cb func(Drive) bool) { | |
| 331 | + | if cb == nil { | |
| 332 | + | x.xCanEject = 0 | |
| 333 | + | } else { | |
| 334 | + | x.xCanEject = purego.NewCallback(func(DriveVarp uintptr) bool { | |
| 335 | + | return cb(&DriveBase{Ptr: DriveVarp}) | |
| 336 | + | }) | |
| 337 | + | } | |
| 338 | + | } | |
| 339 | + | ||
| 340 | + | // GetCanEject gets the callback function. | |
| 341 | + | func (x *DriveIface) GetCanEject() func(Drive) bool { | |
| 342 | + | if x.xCanEject == 0 { | |
| 343 | + | return nil | |
| 344 | + | } | |
| 345 | + | var rawCallback func(DriveVarp uintptr) bool | |
| 346 | + | purego.RegisterFunc(&rawCallback, x.xCanEject) | |
| 347 | + | return func(DriveVar Drive) bool { | |
| 348 | + | return rawCallback(DriveVar.GoPointer()) | |
| 349 | + | } | |
| 350 | + | } | |
| 351 | + | ||
| 352 | + | // OverrideCanPollForMedia sets the callback function. | |
| 353 | + | func (x *DriveIface) OverrideCanPollForMedia(cb func(Drive) bool) { | |
| 354 | + | if cb == nil { | |
| 355 | + | x.xCanPollForMedia = 0 | |
| 356 | + | } else { | |
| 357 | + | x.xCanPollForMedia = purego.NewCallback(func(DriveVarp uintptr) bool { | |
| 358 | + | return cb(&DriveBase{Ptr: DriveVarp}) | |
| 359 | + | }) | |
| 360 | + | } | |
| 361 | + | } | |
| 362 | + | ||
| 363 | + | // GetCanPollForMedia gets the callback function. | |
| 364 | + | func (x *DriveIface) GetCanPollForMedia() func(Drive) bool { | |
| 365 | + | if x.xCanPollForMedia == 0 { | |
| 366 | + | return nil | |
| 367 | + | } | |
| 368 | + | var rawCallback func(DriveVarp uintptr) bool | |
| 369 | + | purego.RegisterFunc(&rawCallback, x.xCanPollForMedia) | |
| 370 | + | return func(DriveVar Drive) bool { | |
| 371 | + | return rawCallback(DriveVar.GoPointer()) | |
| 372 | + | } | |
| 373 | + | } | |
| 374 | + | ||
| 375 | + | // OverrideEject sets the callback function. | |
| 376 | + | func (x *DriveIface) OverrideEject(cb func(Drive, MountUnmountFlags, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 377 | + | if cb == nil { | |
| 378 | + | x.xEject = 0 | |
| 379 | + | } else { | |
| 380 | + | x.xEject = purego.NewCallback(func(DriveVarp uintptr, FlagsVarp MountUnmountFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 381 | + | cb(&DriveBase{Ptr: DriveVarp}, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 382 | + | }) | |
| 383 | + | } | |
| 384 | + | } | |
| 385 | + | ||
| 386 | + | // GetEject gets the callback function. | |
| 387 | + | func (x *DriveIface) GetEject() func(Drive, MountUnmountFlags, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 388 | + | if x.xEject == 0 { | |
| 389 | + | return nil | |
| 390 | + | } | |
| 391 | + | var rawCallback func(DriveVarp uintptr, FlagsVarp MountUnmountFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 392 | + | purego.RegisterFunc(&rawCallback, x.xEject) | |
| 393 | + | return func(DriveVar Drive, FlagsVar MountUnmountFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 394 | + | rawCallback(DriveVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 395 | + | } | |
| 396 | + | } | |
| 397 | + | ||
| 398 | + | // OverrideEjectFinish sets the callback function. | |
| 399 | + | func (x *DriveIface) OverrideEjectFinish(cb func(Drive, AsyncResult) bool) { | |
| 400 | + | if cb == nil { | |
| 401 | + | x.xEjectFinish = 0 | |
| 402 | + | } else { | |
| 403 | + | x.xEjectFinish = purego.NewCallback(func(DriveVarp uintptr, ResultVarp uintptr) bool { | |
| 404 | + | return cb(&DriveBase{Ptr: DriveVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 405 | + | }) | |
| 406 | + | } | |
| 407 | + | } | |
| 408 | + | ||
| 409 | + | // GetEjectFinish gets the callback function. | |
| 410 | + | func (x *DriveIface) GetEjectFinish() func(Drive, AsyncResult) bool { | |
| 411 | + | if x.xEjectFinish == 0 { | |
| 412 | + | return nil | |
| 413 | + | } | |
| 414 | + | var rawCallback func(DriveVarp uintptr, ResultVarp uintptr) bool | |
| 415 | + | purego.RegisterFunc(&rawCallback, x.xEjectFinish) | |
| 416 | + | return func(DriveVar Drive, ResultVar AsyncResult) bool { | |
| 417 | + | return rawCallback(DriveVar.GoPointer(), ResultVar.GoPointer()) | |
| 418 | + | } | |
| 419 | + | } | |
| 420 | + | ||
| 421 | + | // OverridePollForMedia sets the callback function. | |
| 422 | + | func (x *DriveIface) OverridePollForMedia(cb func(Drive, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 423 | + | if cb == nil { | |
| 424 | + | x.xPollForMedia = 0 | |
| 425 | + | } else { | |
| 426 | + | x.xPollForMedia = purego.NewCallback(func(DriveVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 427 | + | cb(&DriveBase{Ptr: DriveVarp}, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 428 | + | }) | |
| 429 | + | } | |
| 430 | + | } | |
| 431 | + | ||
| 432 | + | // GetPollForMedia gets the callback function. | |
| 433 | + | func (x *DriveIface) GetPollForMedia() func(Drive, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 434 | + | if x.xPollForMedia == 0 { | |
| 435 | + | return nil | |
| 436 | + | } | |
| 437 | + | var rawCallback func(DriveVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 438 | + | purego.RegisterFunc(&rawCallback, x.xPollForMedia) | |
| 439 | + | return func(DriveVar Drive, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 440 | + | rawCallback(DriveVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 441 | + | } | |
| 442 | + | } | |
| 443 | + | ||
| 444 | + | // OverridePollForMediaFinish sets the callback function. | |
| 445 | + | func (x *DriveIface) OverridePollForMediaFinish(cb func(Drive, AsyncResult) bool) { | |
| 446 | + | if cb == nil { | |
| 447 | + | x.xPollForMediaFinish = 0 | |
| 448 | + | } else { | |
| 449 | + | x.xPollForMediaFinish = purego.NewCallback(func(DriveVarp uintptr, ResultVarp uintptr) bool { | |
| 450 | + | return cb(&DriveBase{Ptr: DriveVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 451 | + | }) | |
| 452 | + | } | |
| 453 | + | } | |
| 454 | + | ||
| 455 | + | // GetPollForMediaFinish gets the callback function. | |
| 456 | + | func (x *DriveIface) GetPollForMediaFinish() func(Drive, AsyncResult) bool { | |
| 457 | + | if x.xPollForMediaFinish == 0 { | |
| 458 | + | return nil | |
| 459 | + | } | |
| 460 | + | var rawCallback func(DriveVarp uintptr, ResultVarp uintptr) bool | |
| 461 | + | purego.RegisterFunc(&rawCallback, x.xPollForMediaFinish) | |
| 462 | + | return func(DriveVar Drive, ResultVar AsyncResult) bool { | |
| 463 | + | return rawCallback(DriveVar.GoPointer(), ResultVar.GoPointer()) | |
| 464 | + | } | |
| 465 | + | } | |
| 466 | + | ||
| 467 | + | // OverrideGetIdentifier sets the callback function. | |
| 468 | + | func (x *DriveIface) OverrideGetIdentifier(cb func(Drive, string) string) { | |
| 469 | + | if cb == nil { | |
| 470 | + | x.xGetIdentifier = 0 | |
| 471 | + | } else { | |
| 472 | + | x.xGetIdentifier = purego.NewCallback(func(DriveVarp uintptr, KindVarp string) string { | |
| 473 | + | return cb(&DriveBase{Ptr: DriveVarp}, KindVarp) | |
| 474 | + | }) | |
| 475 | + | } | |
| 476 | + | } | |
| 477 | + | ||
| 478 | + | // GetGetIdentifier gets the callback function. | |
| 479 | + | func (x *DriveIface) GetGetIdentifier() func(Drive, string) string { | |
| 480 | + | if x.xGetIdentifier == 0 { | |
| 481 | + | return nil | |
| 482 | + | } | |
| 483 | + | var rawCallback func(DriveVarp uintptr, KindVarp string) string | |
| 484 | + | purego.RegisterFunc(&rawCallback, x.xGetIdentifier) | |
| 485 | + | return func(DriveVar Drive, KindVar string) string { | |
| 486 | + | return rawCallback(DriveVar.GoPointer(), KindVar) | |
| 487 | + | } | |
| 488 | + | } | |
| 489 | + | ||
| 490 | + | // OverrideEnumerateIdentifiers sets the callback function. | |
| 491 | + | func (x *DriveIface) OverrideEnumerateIdentifiers(cb func(Drive) []string) { | |
| 492 | + | if cb == nil { | |
| 493 | + | x.xEnumerateIdentifiers = 0 | |
| 494 | + | } else { | |
| 495 | + | x.xEnumerateIdentifiers = purego.NewCallback(func(DriveVarp uintptr) []string { | |
| 496 | + | return cb(&DriveBase{Ptr: DriveVarp}) | |
| 497 | + | }) | |
| 498 | + | } | |
| 499 | + | } | |
| 500 | + | ||
| 501 | + | // GetEnumerateIdentifiers gets the callback function. | |
| 502 | + | func (x *DriveIface) GetEnumerateIdentifiers() func(Drive) []string { | |
| 503 | + | if x.xEnumerateIdentifiers == 0 { | |
| 504 | + | return nil | |
| 505 | + | } | |
| 506 | + | var rawCallback func(DriveVarp uintptr) []string | |
| 507 | + | purego.RegisterFunc(&rawCallback, x.xEnumerateIdentifiers) | |
| 508 | + | return func(DriveVar Drive) []string { | |
| 509 | + | return rawCallback(DriveVar.GoPointer()) | |
| 510 | + | } | |
| 511 | + | } | |
| 512 | + | ||
| 513 | + | // OverrideGetStartStopType sets the callback function. | |
| 514 | + | func (x *DriveIface) OverrideGetStartStopType(cb func(Drive) DriveStartStopType) { | |
| 515 | + | if cb == nil { | |
| 516 | + | x.xGetStartStopType = 0 | |
| 517 | + | } else { | |
| 518 | + | x.xGetStartStopType = purego.NewCallback(func(DriveVarp uintptr) DriveStartStopType { | |
| 519 | + | return cb(&DriveBase{Ptr: DriveVarp}) | |
| 520 | + | }) | |
| 521 | + | } | |
| 522 | + | } | |
| 523 | + | ||
| 524 | + | // GetGetStartStopType gets the callback function. | |
| 525 | + | func (x *DriveIface) GetGetStartStopType() func(Drive) DriveStartStopType { | |
| 526 | + | if x.xGetStartStopType == 0 { | |
| 527 | + | return nil | |
| 528 | + | } | |
| 529 | + | var rawCallback func(DriveVarp uintptr) DriveStartStopType | |
| 530 | + | purego.RegisterFunc(&rawCallback, x.xGetStartStopType) | |
| 531 | + | return func(DriveVar Drive) DriveStartStopType { | |
| 532 | + | return rawCallback(DriveVar.GoPointer()) | |
| 533 | + | } | |
| 534 | + | } | |
| 535 | + | ||
| 536 | + | // OverrideCanStart sets the callback function. | |
| 537 | + | func (x *DriveIface) OverrideCanStart(cb func(Drive) bool) { | |
| 538 | + | if cb == nil { | |
| 539 | + | x.xCanStart = 0 | |
| 540 | + | } else { | |
| 541 | + | x.xCanStart = purego.NewCallback(func(DriveVarp uintptr) bool { | |
| 542 | + | return cb(&DriveBase{Ptr: DriveVarp}) | |
| 543 | + | }) | |
| 544 | + | } | |
| 545 | + | } | |
| 546 | + | ||
| 547 | + | // GetCanStart gets the callback function. | |
| 548 | + | func (x *DriveIface) GetCanStart() func(Drive) bool { | |
| 549 | + | if x.xCanStart == 0 { | |
| 550 | + | return nil | |
| 551 | + | } | |
| 552 | + | var rawCallback func(DriveVarp uintptr) bool | |
| 553 | + | purego.RegisterFunc(&rawCallback, x.xCanStart) | |
| 554 | + | return func(DriveVar Drive) bool { | |
| 555 | + | return rawCallback(DriveVar.GoPointer()) | |
| 556 | + | } | |
| 557 | + | } | |
| 558 | + | ||
| 559 | + | // OverrideCanStartDegraded sets the callback function. | |
| 560 | + | func (x *DriveIface) OverrideCanStartDegraded(cb func(Drive) bool) { | |
| 561 | + | if cb == nil { | |
| 562 | + | x.xCanStartDegraded = 0 | |
| 563 | + | } else { | |
| 564 | + | x.xCanStartDegraded = purego.NewCallback(func(DriveVarp uintptr) bool { | |
| 565 | + | return cb(&DriveBase{Ptr: DriveVarp}) | |
| 566 | + | }) | |
| 567 | + | } | |
| 568 | + | } | |
| 569 | + | ||
| 570 | + | // GetCanStartDegraded gets the callback function. | |
| 571 | + | func (x *DriveIface) GetCanStartDegraded() func(Drive) bool { | |
| 572 | + | if x.xCanStartDegraded == 0 { | |
| 573 | + | return nil | |
| 574 | + | } | |
| 575 | + | var rawCallback func(DriveVarp uintptr) bool | |
| 576 | + | purego.RegisterFunc(&rawCallback, x.xCanStartDegraded) | |
| 577 | + | return func(DriveVar Drive) bool { | |
| 578 | + | return rawCallback(DriveVar.GoPointer()) | |
| 579 | + | } | |
| 580 | + | } | |
| 581 | + | ||
| 582 | + | // OverrideStart sets the callback function. | |
| 583 | + | func (x *DriveIface) OverrideStart(cb func(Drive, DriveStartFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 584 | + | if cb == nil { | |
| 585 | + | x.xStart = 0 | |
| 586 | + | } else { | |
| 587 | + | x.xStart = purego.NewCallback(func(DriveVarp uintptr, FlagsVarp DriveStartFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 588 | + | cb(&DriveBase{Ptr: DriveVarp}, FlagsVarp, MountOperationNewFromInternalPtr(MountOperationVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 589 | + | }) | |
| 590 | + | } | |
| 591 | + | } | |
| 592 | + | ||
| 593 | + | // GetStart gets the callback function. | |
| 594 | + | func (x *DriveIface) GetStart() func(Drive, DriveStartFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 595 | + | if x.xStart == 0 { | |
| 596 | + | return nil | |
| 597 | + | } | |
| 598 | + | var rawCallback func(DriveVarp uintptr, FlagsVarp DriveStartFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 599 | + | purego.RegisterFunc(&rawCallback, x.xStart) | |
| 600 | + | return func(DriveVar Drive, FlagsVar DriveStartFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 601 | + | rawCallback(DriveVar.GoPointer(), FlagsVar, MountOperationVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 602 | + | } | |
| 603 | + | } | |
| 604 | + | ||
| 605 | + | // OverrideStartFinish sets the callback function. | |
| 606 | + | func (x *DriveIface) OverrideStartFinish(cb func(Drive, AsyncResult) bool) { | |
| 607 | + | if cb == nil { | |
| 608 | + | x.xStartFinish = 0 | |
| 609 | + | } else { | |
| 610 | + | x.xStartFinish = purego.NewCallback(func(DriveVarp uintptr, ResultVarp uintptr) bool { | |
| 611 | + | return cb(&DriveBase{Ptr: DriveVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 612 | + | }) | |
| 613 | + | } | |
| 614 | + | } | |
| 615 | + | ||
| 616 | + | // GetStartFinish gets the callback function. | |
| 617 | + | func (x *DriveIface) GetStartFinish() func(Drive, AsyncResult) bool { | |
| 618 | + | if x.xStartFinish == 0 { | |
| 619 | + | return nil | |
| 620 | + | } | |
| 621 | + | var rawCallback func(DriveVarp uintptr, ResultVarp uintptr) bool | |
| 622 | + | purego.RegisterFunc(&rawCallback, x.xStartFinish) | |
| 623 | + | return func(DriveVar Drive, ResultVar AsyncResult) bool { | |
| 624 | + | return rawCallback(DriveVar.GoPointer(), ResultVar.GoPointer()) | |
| 625 | + | } | |
| 626 | + | } | |
| 627 | + | ||
| 628 | + | // OverrideCanStop sets the callback function. | |
| 629 | + | func (x *DriveIface) OverrideCanStop(cb func(Drive) bool) { | |
| 630 | + | if cb == nil { | |
| 631 | + | x.xCanStop = 0 | |
| 632 | + | } else { | |
| 633 | + | x.xCanStop = purego.NewCallback(func(DriveVarp uintptr) bool { | |
| 634 | + | return cb(&DriveBase{Ptr: DriveVarp}) | |
| 635 | + | }) | |
| 636 | + | } | |
| 637 | + | } | |
| 638 | + | ||
| 639 | + | // GetCanStop gets the callback function. | |
| 640 | + | func (x *DriveIface) GetCanStop() func(Drive) bool { | |
| 641 | + | if x.xCanStop == 0 { | |
| 642 | + | return nil | |
| 643 | + | } | |
| 644 | + | var rawCallback func(DriveVarp uintptr) bool | |
| 645 | + | purego.RegisterFunc(&rawCallback, x.xCanStop) | |
| 646 | + | return func(DriveVar Drive) bool { | |
| 647 | + | return rawCallback(DriveVar.GoPointer()) | |
| 648 | + | } | |
| 649 | + | } | |
| 650 | + | ||
| 651 | + | // OverrideStop sets the callback function. | |
| 652 | + | func (x *DriveIface) OverrideStop(cb func(Drive, MountUnmountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 653 | + | if cb == nil { | |
| 654 | + | x.xStop = 0 | |
| 655 | + | } else { | |
| 656 | + | x.xStop = purego.NewCallback(func(DriveVarp uintptr, FlagsVarp MountUnmountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 657 | + | cb(&DriveBase{Ptr: DriveVarp}, FlagsVarp, MountOperationNewFromInternalPtr(MountOperationVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 658 | + | }) | |
| 659 | + | } | |
| 660 | + | } | |
| 661 | + | ||
| 662 | + | // GetStop gets the callback function. | |
| 663 | + | func (x *DriveIface) GetStop() func(Drive, MountUnmountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 664 | + | if x.xStop == 0 { | |
| 665 | + | return nil | |
| 666 | + | } | |
| 667 | + | var rawCallback func(DriveVarp uintptr, FlagsVarp MountUnmountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 668 | + | purego.RegisterFunc(&rawCallback, x.xStop) | |
| 669 | + | return func(DriveVar Drive, FlagsVar MountUnmountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 670 | + | rawCallback(DriveVar.GoPointer(), FlagsVar, MountOperationVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 671 | + | } | |
| 672 | + | } | |
| 673 | + | ||
| 674 | + | // OverrideStopFinish sets the callback function. | |
| 675 | + | func (x *DriveIface) OverrideStopFinish(cb func(Drive, AsyncResult) bool) { | |
| 676 | + | if cb == nil { | |
| 677 | + | x.xStopFinish = 0 | |
| 678 | + | } else { | |
| 679 | + | x.xStopFinish = purego.NewCallback(func(DriveVarp uintptr, ResultVarp uintptr) bool { | |
| 680 | + | return cb(&DriveBase{Ptr: DriveVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 681 | + | }) | |
| 682 | + | } | |
| 683 | + | } | |
| 684 | + | ||
| 685 | + | // GetStopFinish gets the callback function. | |
| 686 | + | func (x *DriveIface) GetStopFinish() func(Drive, AsyncResult) bool { | |
| 687 | + | if x.xStopFinish == 0 { | |
| 688 | + | return nil | |
| 689 | + | } | |
| 690 | + | var rawCallback func(DriveVarp uintptr, ResultVarp uintptr) bool | |
| 691 | + | purego.RegisterFunc(&rawCallback, x.xStopFinish) | |
| 692 | + | return func(DriveVar Drive, ResultVar AsyncResult) bool { | |
| 693 | + | return rawCallback(DriveVar.GoPointer(), ResultVar.GoPointer()) | |
| 694 | + | } | |
| 695 | + | } | |
| 696 | + | ||
| 697 | + | // OverrideStopButton sets the callback function. | |
| 698 | + | func (x *DriveIface) OverrideStopButton(cb func(Drive)) { | |
| 699 | + | if cb == nil { | |
| 700 | + | x.xStopButton = 0 | |
| 701 | + | } else { | |
| 702 | + | x.xStopButton = purego.NewCallback(func(DriveVarp uintptr) { | |
| 703 | + | cb(&DriveBase{Ptr: DriveVarp}) | |
| 704 | + | }) | |
| 705 | + | } | |
| 706 | + | } | |
| 707 | + | ||
| 708 | + | // GetStopButton gets the callback function. | |
| 709 | + | func (x *DriveIface) GetStopButton() func(Drive) { | |
| 710 | + | if x.xStopButton == 0 { | |
| 711 | + | return nil | |
| 712 | + | } | |
| 713 | + | var rawCallback func(DriveVarp uintptr) | |
| 714 | + | purego.RegisterFunc(&rawCallback, x.xStopButton) | |
| 715 | + | return func(DriveVar Drive) { | |
| 716 | + | rawCallback(DriveVar.GoPointer()) | |
| 717 | + | } | |
| 718 | + | } | |
| 719 | + | ||
| 720 | + | // OverrideEjectWithOperation sets the callback function. | |
| 721 | + | func (x *DriveIface) OverrideEjectWithOperation(cb func(Drive, MountUnmountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 722 | + | if cb == nil { | |
| 723 | + | x.xEjectWithOperation = 0 | |
| 724 | + | } else { | |
| 725 | + | x.xEjectWithOperation = purego.NewCallback(func(DriveVarp uintptr, FlagsVarp MountUnmountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 726 | + | cb(&DriveBase{Ptr: DriveVarp}, FlagsVarp, MountOperationNewFromInternalPtr(MountOperationVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 727 | + | }) | |
| 728 | + | } | |
| 729 | + | } | |
| 730 | + | ||
| 731 | + | // GetEjectWithOperation gets the callback function. | |
| 732 | + | func (x *DriveIface) GetEjectWithOperation() func(Drive, MountUnmountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 733 | + | if x.xEjectWithOperation == 0 { | |
| 734 | + | return nil | |
| 735 | + | } | |
| 736 | + | var rawCallback func(DriveVarp uintptr, FlagsVarp MountUnmountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 737 | + | purego.RegisterFunc(&rawCallback, x.xEjectWithOperation) | |
| 738 | + | return func(DriveVar Drive, FlagsVar MountUnmountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 739 | + | rawCallback(DriveVar.GoPointer(), FlagsVar, MountOperationVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 740 | + | } | |
| 741 | + | } | |
| 742 | + | ||
| 743 | + | // OverrideEjectWithOperationFinish sets the callback function. | |
| 744 | + | func (x *DriveIface) OverrideEjectWithOperationFinish(cb func(Drive, AsyncResult) bool) { | |
| 745 | + | if cb == nil { | |
| 746 | + | x.xEjectWithOperationFinish = 0 | |
| 747 | + | } else { | |
| 748 | + | x.xEjectWithOperationFinish = purego.NewCallback(func(DriveVarp uintptr, ResultVarp uintptr) bool { | |
| 749 | + | return cb(&DriveBase{Ptr: DriveVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 750 | + | }) | |
| 751 | + | } | |
| 752 | + | } | |
| 753 | + | ||
| 754 | + | // GetEjectWithOperationFinish gets the callback function. | |
| 755 | + | func (x *DriveIface) GetEjectWithOperationFinish() func(Drive, AsyncResult) bool { | |
| 756 | + | if x.xEjectWithOperationFinish == 0 { | |
| 757 | + | return nil | |
| 758 | + | } | |
| 759 | + | var rawCallback func(DriveVarp uintptr, ResultVarp uintptr) bool | |
| 760 | + | purego.RegisterFunc(&rawCallback, x.xEjectWithOperationFinish) | |
| 761 | + | return func(DriveVar Drive, ResultVar AsyncResult) bool { | |
| 762 | + | return rawCallback(DriveVar.GoPointer(), ResultVar.GoPointer()) | |
| 763 | + | } | |
| 764 | + | } | |
| 765 | + | ||
| 766 | + | // OverrideGetSortKey sets the callback function. | |
| 767 | + | func (x *DriveIface) OverrideGetSortKey(cb func(Drive) string) { | |
| 768 | + | if cb == nil { | |
| 769 | + | x.xGetSortKey = 0 | |
| 770 | + | } else { | |
| 771 | + | x.xGetSortKey = purego.NewCallback(func(DriveVarp uintptr) string { | |
| 772 | + | return cb(&DriveBase{Ptr: DriveVarp}) | |
| 773 | + | }) | |
| 774 | + | } | |
| 775 | + | } | |
| 776 | + | ||
| 777 | + | // GetGetSortKey gets the callback function. | |
| 778 | + | func (x *DriveIface) GetGetSortKey() func(Drive) string { | |
| 779 | + | if x.xGetSortKey == 0 { | |
| 780 | + | return nil | |
| 781 | + | } | |
| 782 | + | var rawCallback func(DriveVarp uintptr) string | |
| 783 | + | purego.RegisterFunc(&rawCallback, x.xGetSortKey) | |
| 784 | + | return func(DriveVar Drive) string { | |
| 785 | + | return rawCallback(DriveVar.GoPointer()) | |
| 786 | + | } | |
| 787 | + | } | |
| 788 | + | ||
| 789 | + | // OverrideGetSymbolicIcon sets the callback function. | |
| 790 | + | func (x *DriveIface) OverrideGetSymbolicIcon(cb func(Drive) *IconBase) { | |
| 791 | + | if cb == nil { | |
| 792 | + | x.xGetSymbolicIcon = 0 | |
| 793 | + | } else { | |
| 794 | + | x.xGetSymbolicIcon = purego.NewCallback(func(DriveVarp uintptr) uintptr { | |
| 795 | + | ret := cb(&DriveBase{Ptr: DriveVarp}) | |
| 796 | + | if ret == nil { | |
| 797 | + | return 0 | |
| 798 | + | } | |
| 799 | + | return ret.GoPointer() | |
| 800 | + | }) | |
| 801 | + | } | |
| 802 | + | } | |
| 803 | + | ||
| 804 | + | // GetGetSymbolicIcon gets the callback function. | |
| 805 | + | func (x *DriveIface) GetGetSymbolicIcon() func(Drive) *IconBase { | |
| 806 | + | if x.xGetSymbolicIcon == 0 { | |
| 807 | + | return nil | |
| 808 | + | } | |
| 809 | + | var rawCallback func(DriveVarp uintptr) uintptr | |
| 810 | + | purego.RegisterFunc(&rawCallback, x.xGetSymbolicIcon) | |
| 811 | + | return func(DriveVar Drive) *IconBase { | |
| 812 | + | rawRet := rawCallback(DriveVar.GoPointer()) | |
| 813 | + | if rawRet == 0 { | |
| 814 | + | return nil | |
| 815 | + | } | |
| 816 | + | ret := &IconBase{} | |
| 817 | + | ret.Ptr = rawRet | |
| 818 | + | return ret | |
| 819 | + | } | |
| 820 | + | } | |
| 821 | + | ||
| 822 | + | // OverrideIsRemovable sets the callback function. | |
| 823 | + | func (x *DriveIface) OverrideIsRemovable(cb func(Drive) bool) { | |
| 824 | + | if cb == nil { | |
| 825 | + | x.xIsRemovable = 0 | |
| 826 | + | } else { | |
| 827 | + | x.xIsRemovable = purego.NewCallback(func(DriveVarp uintptr) bool { | |
| 828 | + | return cb(&DriveBase{Ptr: DriveVarp}) | |
| 829 | + | }) | |
| 830 | + | } | |
| 831 | + | } | |
| 832 | + | ||
| 833 | + | // GetIsRemovable gets the callback function. | |
| 834 | + | func (x *DriveIface) GetIsRemovable() func(Drive) bool { | |
| 835 | + | if x.xIsRemovable == 0 { | |
| 836 | + | return nil | |
| 837 | + | } | |
| 838 | + | var rawCallback func(DriveVarp uintptr) bool | |
| 839 | + | purego.RegisterFunc(&rawCallback, x.xIsRemovable) | |
| 840 | + | return func(DriveVar Drive) bool { | |
| 841 | + | return rawCallback(DriveVar.GoPointer()) | |
| 842 | + | } | |
| 843 | + | } | |
| 844 | + | ||
| 25 | 845 | // #GDrive - this represent a piece of hardware connected to the machine. | |
| 26 | 846 | // It's generally only created for removable hardware or hardware with | |
| 27 | 847 | // removable media. | |
| @@ -57,9 +877,9 @@ type Drive interface { | |||
| 57 | 877 | CanStartDegraded() bool | |
| 58 | 878 | CanStop() bool | |
| 59 | 879 | Eject(FlagsVar MountUnmountFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 60 | - | EjectFinish(ResultVar AsyncResult) bool | |
| 880 | + | EjectFinish(ResultVar AsyncResult) (bool, error) | |
| 61 | 881 | EjectWithOperation(FlagsVar MountUnmountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 62 | - | EjectWithOperationFinish(ResultVar AsyncResult) bool | |
| 882 | + | EjectWithOperationFinish(ResultVar AsyncResult) (bool, error) | |
| 63 | 883 | EnumerateIdentifiers() []string | |
| 64 | 884 | GetIcon() *IconBase | |
| 65 | 885 | GetIdentifier(KindVar string) string | |
| @@ -74,11 +894,11 @@ type Drive interface { | |||
| 74 | 894 | IsMediaRemovable() bool | |
| 75 | 895 | IsRemovable() bool | |
| 76 | 896 | PollForMedia(CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 77 | - | PollForMediaFinish(ResultVar AsyncResult) bool | |
| 897 | + | PollForMediaFinish(ResultVar AsyncResult) (bool, error) | |
| 78 | 898 | Start(FlagsVar DriveStartFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 79 | - | StartFinish(ResultVar AsyncResult) bool | |
| 899 | + | StartFinish(ResultVar AsyncResult) (bool, error) | |
| 80 | 900 | Stop(FlagsVar MountUnmountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 81 | - | StopFinish(ResultVar AsyncResult) bool | |
| 901 | + | StopFinish(ResultVar AsyncResult) (bool, error) | |
| 82 | 902 | } | |
| 83 | 903 | ||
| 84 | 904 | var xDriveGLibType func() types.GType | |
M v4/gio/gdtlsconnection.go +257 -7
| @@ -17,12 +17,262 @@ type DtlsConnectionInterface struct { | |||
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | 19 | GIface uintptr | |
| 20 | + | ||
| 21 | + | xAcceptCertificate uintptr | |
| 22 | + | ||
| 23 | + | xHandshake uintptr | |
| 24 | + | ||
| 25 | + | xHandshakeAsync uintptr | |
| 26 | + | ||
| 27 | + | xHandshakeFinish uintptr | |
| 28 | + | ||
| 29 | + | xShutdown uintptr | |
| 30 | + | ||
| 31 | + | xShutdownAsync uintptr | |
| 32 | + | ||
| 33 | + | xShutdownFinish uintptr | |
| 34 | + | ||
| 35 | + | xSetAdvertisedProtocols uintptr | |
| 36 | + | ||
| 37 | + | xGetNegotiatedProtocol uintptr | |
| 38 | + | ||
| 39 | + | xGetBindingData uintptr | |
| 20 | 40 | } | |
| 21 | 41 | ||
| 22 | 42 | func (x *DtlsConnectionInterface) GoPointer() uintptr { | |
| 23 | 43 | return uintptr(unsafe.Pointer(x)) | |
| 24 | 44 | } | |
| 25 | 45 | ||
| 46 | + | // OverrideAcceptCertificate sets the callback function. | |
| 47 | + | func (x *DtlsConnectionInterface) OverrideAcceptCertificate(cb func(DtlsConnection, *TlsCertificate, TlsCertificateFlags) bool) { | |
| 48 | + | if cb == nil { | |
| 49 | + | x.xAcceptCertificate = 0 | |
| 50 | + | } else { | |
| 51 | + | x.xAcceptCertificate = purego.NewCallback(func(ConnectionVarp uintptr, PeerCertVarp uintptr, ErrorsVarp TlsCertificateFlags) bool { | |
| 52 | + | return cb(&DtlsConnectionBase{Ptr: ConnectionVarp}, TlsCertificateNewFromInternalPtr(PeerCertVarp), ErrorsVarp) | |
| 53 | + | }) | |
| 54 | + | } | |
| 55 | + | } | |
| 56 | + | ||
| 57 | + | // GetAcceptCertificate gets the callback function. | |
| 58 | + | func (x *DtlsConnectionInterface) GetAcceptCertificate() func(DtlsConnection, *TlsCertificate, TlsCertificateFlags) bool { | |
| 59 | + | if x.xAcceptCertificate == 0 { | |
| 60 | + | return nil | |
| 61 | + | } | |
| 62 | + | var rawCallback func(ConnectionVarp uintptr, PeerCertVarp uintptr, ErrorsVarp TlsCertificateFlags) bool | |
| 63 | + | purego.RegisterFunc(&rawCallback, x.xAcceptCertificate) | |
| 64 | + | return func(ConnectionVar DtlsConnection, PeerCertVar *TlsCertificate, ErrorsVar TlsCertificateFlags) bool { | |
| 65 | + | return rawCallback(ConnectionVar.GoPointer(), PeerCertVar.GoPointer(), ErrorsVar) | |
| 66 | + | } | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | // OverrideHandshake sets the callback function. | |
| 70 | + | func (x *DtlsConnectionInterface) OverrideHandshake(cb func(DtlsConnection, *Cancellable) bool) { | |
| 71 | + | if cb == nil { | |
| 72 | + | x.xHandshake = 0 | |
| 73 | + | } else { | |
| 74 | + | x.xHandshake = purego.NewCallback(func(ConnVarp uintptr, CancellableVarp uintptr) bool { | |
| 75 | + | return cb(&DtlsConnectionBase{Ptr: ConnVarp}, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 76 | + | }) | |
| 77 | + | } | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | // GetHandshake gets the callback function. | |
| 81 | + | func (x *DtlsConnectionInterface) GetHandshake() func(DtlsConnection, *Cancellable) bool { | |
| 82 | + | if x.xHandshake == 0 { | |
| 83 | + | return nil | |
| 84 | + | } | |
| 85 | + | var rawCallback func(ConnVarp uintptr, CancellableVarp uintptr) bool | |
| 86 | + | purego.RegisterFunc(&rawCallback, x.xHandshake) | |
| 87 | + | return func(ConnVar DtlsConnection, CancellableVar *Cancellable) bool { | |
| 88 | + | return rawCallback(ConnVar.GoPointer(), CancellableVar.GoPointer()) | |
| 89 | + | } | |
| 90 | + | } | |
| 91 | + | ||
| 92 | + | // OverrideHandshakeAsync sets the callback function. | |
| 93 | + | func (x *DtlsConnectionInterface) OverrideHandshakeAsync(cb func(DtlsConnection, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 94 | + | if cb == nil { | |
| 95 | + | x.xHandshakeAsync = 0 | |
| 96 | + | } else { | |
| 97 | + | x.xHandshakeAsync = purego.NewCallback(func(ConnVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 98 | + | cb(&DtlsConnectionBase{Ptr: ConnVarp}, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 99 | + | }) | |
| 100 | + | } | |
| 101 | + | } | |
| 102 | + | ||
| 103 | + | // GetHandshakeAsync gets the callback function. | |
| 104 | + | func (x *DtlsConnectionInterface) GetHandshakeAsync() func(DtlsConnection, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 105 | + | if x.xHandshakeAsync == 0 { | |
| 106 | + | return nil | |
| 107 | + | } | |
| 108 | + | var rawCallback func(ConnVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 109 | + | purego.RegisterFunc(&rawCallback, x.xHandshakeAsync) | |
| 110 | + | return func(ConnVar DtlsConnection, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 111 | + | rawCallback(ConnVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 112 | + | } | |
| 113 | + | } | |
| 114 | + | ||
| 115 | + | // OverrideHandshakeFinish sets the callback function. | |
| 116 | + | func (x *DtlsConnectionInterface) OverrideHandshakeFinish(cb func(DtlsConnection, AsyncResult) bool) { | |
| 117 | + | if cb == nil { | |
| 118 | + | x.xHandshakeFinish = 0 | |
| 119 | + | } else { | |
| 120 | + | x.xHandshakeFinish = purego.NewCallback(func(ConnVarp uintptr, ResultVarp uintptr) bool { | |
| 121 | + | return cb(&DtlsConnectionBase{Ptr: ConnVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 122 | + | }) | |
| 123 | + | } | |
| 124 | + | } | |
| 125 | + | ||
| 126 | + | // GetHandshakeFinish gets the callback function. | |
| 127 | + | func (x *DtlsConnectionInterface) GetHandshakeFinish() func(DtlsConnection, AsyncResult) bool { | |
| 128 | + | if x.xHandshakeFinish == 0 { | |
| 129 | + | return nil | |
| 130 | + | } | |
| 131 | + | var rawCallback func(ConnVarp uintptr, ResultVarp uintptr) bool | |
| 132 | + | purego.RegisterFunc(&rawCallback, x.xHandshakeFinish) | |
| 133 | + | return func(ConnVar DtlsConnection, ResultVar AsyncResult) bool { | |
| 134 | + | return rawCallback(ConnVar.GoPointer(), ResultVar.GoPointer()) | |
| 135 | + | } | |
| 136 | + | } | |
| 137 | + | ||
| 138 | + | // OverrideShutdown sets the callback function. | |
| 139 | + | func (x *DtlsConnectionInterface) OverrideShutdown(cb func(DtlsConnection, bool, bool, *Cancellable) bool) { | |
| 140 | + | if cb == nil { | |
| 141 | + | x.xShutdown = 0 | |
| 142 | + | } else { | |
| 143 | + | x.xShutdown = purego.NewCallback(func(ConnVarp uintptr, ShutdownReadVarp bool, ShutdownWriteVarp bool, CancellableVarp uintptr) bool { | |
| 144 | + | return cb(&DtlsConnectionBase{Ptr: ConnVarp}, ShutdownReadVarp, ShutdownWriteVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 145 | + | }) | |
| 146 | + | } | |
| 147 | + | } | |
| 148 | + | ||
| 149 | + | // GetShutdown gets the callback function. | |
| 150 | + | func (x *DtlsConnectionInterface) GetShutdown() func(DtlsConnection, bool, bool, *Cancellable) bool { | |
| 151 | + | if x.xShutdown == 0 { | |
| 152 | + | return nil | |
| 153 | + | } | |
| 154 | + | var rawCallback func(ConnVarp uintptr, ShutdownReadVarp bool, ShutdownWriteVarp bool, CancellableVarp uintptr) bool | |
| 155 | + | purego.RegisterFunc(&rawCallback, x.xShutdown) | |
| 156 | + | return func(ConnVar DtlsConnection, ShutdownReadVar bool, ShutdownWriteVar bool, CancellableVar *Cancellable) bool { | |
| 157 | + | return rawCallback(ConnVar.GoPointer(), ShutdownReadVar, ShutdownWriteVar, CancellableVar.GoPointer()) | |
| 158 | + | } | |
| 159 | + | } | |
| 160 | + | ||
| 161 | + | // OverrideShutdownAsync sets the callback function. | |
| 162 | + | func (x *DtlsConnectionInterface) OverrideShutdownAsync(cb func(DtlsConnection, bool, bool, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 163 | + | if cb == nil { | |
| 164 | + | x.xShutdownAsync = 0 | |
| 165 | + | } else { | |
| 166 | + | x.xShutdownAsync = purego.NewCallback(func(ConnVarp uintptr, ShutdownReadVarp bool, ShutdownWriteVarp bool, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 167 | + | cb(&DtlsConnectionBase{Ptr: ConnVarp}, ShutdownReadVarp, ShutdownWriteVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 168 | + | }) | |
| 169 | + | } | |
| 170 | + | } | |
| 171 | + | ||
| 172 | + | // GetShutdownAsync gets the callback function. | |
| 173 | + | func (x *DtlsConnectionInterface) GetShutdownAsync() func(DtlsConnection, bool, bool, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 174 | + | if x.xShutdownAsync == 0 { | |
| 175 | + | return nil | |
| 176 | + | } | |
| 177 | + | var rawCallback func(ConnVarp uintptr, ShutdownReadVarp bool, ShutdownWriteVarp bool, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 178 | + | purego.RegisterFunc(&rawCallback, x.xShutdownAsync) | |
| 179 | + | return func(ConnVar DtlsConnection, ShutdownReadVar bool, ShutdownWriteVar bool, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 180 | + | rawCallback(ConnVar.GoPointer(), ShutdownReadVar, ShutdownWriteVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 181 | + | } | |
| 182 | + | } | |
| 183 | + | ||
| 184 | + | // OverrideShutdownFinish sets the callback function. | |
| 185 | + | func (x *DtlsConnectionInterface) OverrideShutdownFinish(cb func(DtlsConnection, AsyncResult) bool) { | |
| 186 | + | if cb == nil { | |
| 187 | + | x.xShutdownFinish = 0 | |
| 188 | + | } else { | |
| 189 | + | x.xShutdownFinish = purego.NewCallback(func(ConnVarp uintptr, ResultVarp uintptr) bool { | |
| 190 | + | return cb(&DtlsConnectionBase{Ptr: ConnVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 191 | + | }) | |
| 192 | + | } | |
| 193 | + | } | |
| 194 | + | ||
| 195 | + | // GetShutdownFinish gets the callback function. | |
| 196 | + | func (x *DtlsConnectionInterface) GetShutdownFinish() func(DtlsConnection, AsyncResult) bool { | |
| 197 | + | if x.xShutdownFinish == 0 { | |
| 198 | + | return nil | |
| 199 | + | } | |
| 200 | + | var rawCallback func(ConnVarp uintptr, ResultVarp uintptr) bool | |
| 201 | + | purego.RegisterFunc(&rawCallback, x.xShutdownFinish) | |
| 202 | + | return func(ConnVar DtlsConnection, ResultVar AsyncResult) bool { | |
| 203 | + | return rawCallback(ConnVar.GoPointer(), ResultVar.GoPointer()) | |
| 204 | + | } | |
| 205 | + | } | |
| 206 | + | ||
| 207 | + | // OverrideSetAdvertisedProtocols sets the callback function. | |
| 208 | + | func (x *DtlsConnectionInterface) OverrideSetAdvertisedProtocols(cb func(DtlsConnection, []string)) { | |
| 209 | + | if cb == nil { | |
| 210 | + | x.xSetAdvertisedProtocols = 0 | |
| 211 | + | } else { | |
| 212 | + | x.xSetAdvertisedProtocols = purego.NewCallback(func(ConnVarp uintptr, ProtocolsVarp []string) { | |
| 213 | + | cb(&DtlsConnectionBase{Ptr: ConnVarp}, ProtocolsVarp) | |
| 214 | + | }) | |
| 215 | + | } | |
| 216 | + | } | |
| 217 | + | ||
| 218 | + | // GetSetAdvertisedProtocols gets the callback function. | |
| 219 | + | func (x *DtlsConnectionInterface) GetSetAdvertisedProtocols() func(DtlsConnection, []string) { | |
| 220 | + | if x.xSetAdvertisedProtocols == 0 { | |
| 221 | + | return nil | |
| 222 | + | } | |
| 223 | + | var rawCallback func(ConnVarp uintptr, ProtocolsVarp []string) | |
| 224 | + | purego.RegisterFunc(&rawCallback, x.xSetAdvertisedProtocols) | |
| 225 | + | return func(ConnVar DtlsConnection, ProtocolsVar []string) { | |
| 226 | + | rawCallback(ConnVar.GoPointer(), ProtocolsVar) | |
| 227 | + | } | |
| 228 | + | } | |
| 229 | + | ||
| 230 | + | // OverrideGetNegotiatedProtocol sets the callback function. | |
| 231 | + | func (x *DtlsConnectionInterface) OverrideGetNegotiatedProtocol(cb func(DtlsConnection) string) { | |
| 232 | + | if cb == nil { | |
| 233 | + | x.xGetNegotiatedProtocol = 0 | |
| 234 | + | } else { | |
| 235 | + | x.xGetNegotiatedProtocol = purego.NewCallback(func(ConnVarp uintptr) string { | |
| 236 | + | return cb(&DtlsConnectionBase{Ptr: ConnVarp}) | |
| 237 | + | }) | |
| 238 | + | } | |
| 239 | + | } | |
| 240 | + | ||
| 241 | + | // GetGetNegotiatedProtocol gets the callback function. | |
| 242 | + | func (x *DtlsConnectionInterface) GetGetNegotiatedProtocol() func(DtlsConnection) string { | |
| 243 | + | if x.xGetNegotiatedProtocol == 0 { | |
| 244 | + | return nil | |
| 245 | + | } | |
| 246 | + | var rawCallback func(ConnVarp uintptr) string | |
| 247 | + | purego.RegisterFunc(&rawCallback, x.xGetNegotiatedProtocol) | |
| 248 | + | return func(ConnVar DtlsConnection) string { | |
| 249 | + | return rawCallback(ConnVar.GoPointer()) | |
| 250 | + | } | |
| 251 | + | } | |
| 252 | + | ||
| 253 | + | // OverrideGetBindingData sets the callback function. | |
| 254 | + | func (x *DtlsConnectionInterface) OverrideGetBindingData(cb func(DtlsConnection, TlsChannelBindingType, []byte) bool) { | |
| 255 | + | if cb == nil { | |
| 256 | + | x.xGetBindingData = 0 | |
| 257 | + | } else { | |
| 258 | + | x.xGetBindingData = purego.NewCallback(func(ConnVarp uintptr, TypeVarp TlsChannelBindingType, DataVarp []byte) bool { | |
| 259 | + | return cb(&DtlsConnectionBase{Ptr: ConnVarp}, TypeVarp, DataVarp) | |
| 260 | + | }) | |
| 261 | + | } | |
| 262 | + | } | |
| 263 | + | ||
| 264 | + | // GetGetBindingData gets the callback function. | |
| 265 | + | func (x *DtlsConnectionInterface) GetGetBindingData() func(DtlsConnection, TlsChannelBindingType, []byte) bool { | |
| 266 | + | if x.xGetBindingData == 0 { | |
| 267 | + | return nil | |
| 268 | + | } | |
| 269 | + | var rawCallback func(ConnVarp uintptr, TypeVarp TlsChannelBindingType, DataVarp []byte) bool | |
| 270 | + | purego.RegisterFunc(&rawCallback, x.xGetBindingData) | |
| 271 | + | return func(ConnVar DtlsConnection, TypeVar TlsChannelBindingType, DataVar []byte) bool { | |
| 272 | + | return rawCallback(ConnVar.GoPointer(), TypeVar, DataVar) | |
| 273 | + | } | |
| 274 | + | } | |
| 275 | + | ||
| 26 | 276 | // #GDtlsConnection is the base DTLS connection class type, which wraps | |
| 27 | 277 | // a #GDatagramBased and provides DTLS encryption on top of it. Its | |
| 28 | 278 | // subclasses, #GDtlsClientConnection and #GDtlsServerConnection, | |
| @@ -45,12 +295,12 @@ func (x *DtlsConnectionInterface) GoPointer() uintptr { | |||
| 45 | 295 | type DtlsConnection interface { | |
| 46 | 296 | GoPointer() uintptr | |
| 47 | 297 | SetGoPointer(uintptr) | |
| 48 | - | Close(CancellableVar *Cancellable) bool | |
| 298 | + | Close(CancellableVar *Cancellable) (bool, error) | |
| 49 | 299 | CloseAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 50 | - | CloseFinish(ResultVar AsyncResult) bool | |
| 300 | + | CloseFinish(ResultVar AsyncResult) (bool, error) | |
| 51 | 301 | EmitAcceptCertificate(PeerCertVar *TlsCertificate, ErrorsVar TlsCertificateFlags) bool | |
| 52 | 302 | GetCertificate() *TlsCertificate | |
| 53 | - | GetChannelBindingData(TypeVar TlsChannelBindingType, DataVar []byte) bool | |
| 303 | + | GetChannelBindingData(TypeVar TlsChannelBindingType, DataVar []byte) (bool, error) | |
| 54 | 304 | GetCiphersuiteName() string | |
| 55 | 305 | GetDatabase() *TlsDatabase | |
| 56 | 306 | GetInteraction() *TlsInteraction | |
| @@ -60,18 +310,18 @@ type DtlsConnection interface { | |||
| 60 | 310 | GetProtocolVersion() TlsProtocolVersion | |
| 61 | 311 | GetRehandshakeMode() TlsRehandshakeMode | |
| 62 | 312 | GetRequireCloseNotify() bool | |
| 63 | - | Handshake(CancellableVar *Cancellable) bool | |
| 313 | + | Handshake(CancellableVar *Cancellable) (bool, error) | |
| 64 | 314 | HandshakeAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 65 | - | HandshakeFinish(ResultVar AsyncResult) bool | |
| 315 | + | HandshakeFinish(ResultVar AsyncResult) (bool, error) | |
| 66 | 316 | SetAdvertisedProtocols(ProtocolsVar []string) | |
| 67 | 317 | SetCertificate(CertificateVar *TlsCertificate) | |
| 68 | 318 | SetDatabase(DatabaseVar *TlsDatabase) | |
| 69 | 319 | SetInteraction(InteractionVar *TlsInteraction) | |
| 70 | 320 | SetRehandshakeMode(ModeVar TlsRehandshakeMode) | |
| 71 | 321 | SetRequireCloseNotify(RequireCloseNotifyVar bool) | |
| 72 | - | Shutdown(ShutdownReadVar bool, ShutdownWriteVar bool, CancellableVar *Cancellable) bool | |
| 322 | + | Shutdown(ShutdownReadVar bool, ShutdownWriteVar bool, CancellableVar *Cancellable) (bool, error) | |
| 73 | 323 | ShutdownAsync(ShutdownReadVar bool, ShutdownWriteVar bool, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 74 | - | ShutdownFinish(ResultVar AsyncResult) bool | |
| 324 | + | ShutdownFinish(ResultVar AsyncResult) (bool, error) | |
| 75 | 325 | } | |
| 76 | 326 | ||
| 77 | 327 | var xDtlsConnectionGLibType func() types.GType | |
M v4/gio/gemblemedicon.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type EmblemedIconClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *EmblemedIconClass) GoPointer() uintptr { | |
M v4/gio/gfile.go +2937 -77
| @@ -18,13 +18,2873 @@ type FileIface struct { | |||
| 18 | 18 | ||
| 19 | 19 | GIface uintptr | |
| 20 | 20 | ||
| 21 | + | xDup uintptr | |
| 22 | + | ||
| 23 | + | xHash uintptr | |
| 24 | + | ||
| 25 | + | xEqual uintptr | |
| 26 | + | ||
| 27 | + | xIsNative uintptr | |
| 28 | + | ||
| 29 | + | xHasUriScheme uintptr | |
| 30 | + | ||
| 31 | + | xGetUriScheme uintptr | |
| 32 | + | ||
| 33 | + | xGetBasename uintptr | |
| 34 | + | ||
| 35 | + | xGetPath uintptr | |
| 36 | + | ||
| 37 | + | xGetUri uintptr | |
| 38 | + | ||
| 39 | + | xGetParseName uintptr | |
| 40 | + | ||
| 41 | + | xGetParent uintptr | |
| 42 | + | ||
| 43 | + | xPrefixMatches uintptr | |
| 44 | + | ||
| 45 | + | xGetRelativePath uintptr | |
| 46 | + | ||
| 47 | + | xResolveRelativePath uintptr | |
| 48 | + | ||
| 49 | + | xGetChildForDisplayName uintptr | |
| 50 | + | ||
| 51 | + | xEnumerateChildren uintptr | |
| 52 | + | ||
| 53 | + | xEnumerateChildrenAsync uintptr | |
| 54 | + | ||
| 55 | + | xEnumerateChildrenFinish uintptr | |
| 56 | + | ||
| 57 | + | xQueryInfo uintptr | |
| 58 | + | ||
| 59 | + | xQueryInfoAsync uintptr | |
| 60 | + | ||
| 61 | + | xQueryInfoFinish uintptr | |
| 62 | + | ||
| 63 | + | xQueryFilesystemInfo uintptr | |
| 64 | + | ||
| 65 | + | xQueryFilesystemInfoAsync uintptr | |
| 66 | + | ||
| 67 | + | xQueryFilesystemInfoFinish uintptr | |
| 68 | + | ||
| 69 | + | xFindEnclosingMount uintptr | |
| 70 | + | ||
| 71 | + | xFindEnclosingMountAsync uintptr | |
| 72 | + | ||
| 73 | + | xFindEnclosingMountFinish uintptr | |
| 74 | + | ||
| 75 | + | xSetDisplayName uintptr | |
| 76 | + | ||
| 77 | + | xSetDisplayNameAsync uintptr | |
| 78 | + | ||
| 79 | + | xSetDisplayNameFinish uintptr | |
| 80 | + | ||
| 81 | + | xQuerySettableAttributes uintptr | |
| 82 | + | ||
| 83 | + | xQuerySettableAttributesAsync uintptr | |
| 84 | + | ||
| 85 | + | xQuerySettableAttributesFinish uintptr | |
| 86 | + | ||
| 87 | + | xQueryWritableNamespaces uintptr | |
| 88 | + | ||
| 89 | + | xQueryWritableNamespacesAsync uintptr | |
| 90 | + | ||
| 91 | + | xQueryWritableNamespacesFinish uintptr | |
| 92 | + | ||
| 93 | + | xSetAttribute uintptr | |
| 94 | + | ||
| 95 | + | xSetAttributesFromInfo uintptr | |
| 96 | + | ||
| 97 | + | xSetAttributesAsync uintptr | |
| 98 | + | ||
| 99 | + | xSetAttributesFinish uintptr | |
| 100 | + | ||
| 101 | + | xReadFn uintptr | |
| 102 | + | ||
| 103 | + | xReadAsync uintptr | |
| 104 | + | ||
| 105 | + | xReadFinish uintptr | |
| 106 | + | ||
| 107 | + | xAppendTo uintptr | |
| 108 | + | ||
| 109 | + | xAppendToAsync uintptr | |
| 110 | + | ||
| 111 | + | xAppendToFinish uintptr | |
| 112 | + | ||
| 113 | + | xCreate uintptr | |
| 114 | + | ||
| 115 | + | xCreateAsync uintptr | |
| 116 | + | ||
| 117 | + | xCreateFinish uintptr | |
| 118 | + | ||
| 119 | + | xReplace uintptr | |
| 120 | + | ||
| 121 | + | xReplaceAsync uintptr | |
| 122 | + | ||
| 123 | + | xReplaceFinish uintptr | |
| 124 | + | ||
| 125 | + | xDeleteFile uintptr | |
| 126 | + | ||
| 127 | + | xDeleteFileAsync uintptr | |
| 128 | + | ||
| 129 | + | xDeleteFileFinish uintptr | |
| 130 | + | ||
| 131 | + | xTrash uintptr | |
| 132 | + | ||
| 133 | + | xTrashAsync uintptr | |
| 134 | + | ||
| 135 | + | xTrashFinish uintptr | |
| 136 | + | ||
| 137 | + | xMakeDirectory uintptr | |
| 138 | + | ||
| 139 | + | xMakeDirectoryAsync uintptr | |
| 140 | + | ||
| 141 | + | xMakeDirectoryFinish uintptr | |
| 142 | + | ||
| 143 | + | xMakeSymbolicLink uintptr | |
| 144 | + | ||
| 145 | + | xMakeSymbolicLinkAsync uintptr | |
| 146 | + | ||
| 147 | + | xMakeSymbolicLinkFinish uintptr | |
| 148 | + | ||
| 149 | + | xCopy uintptr | |
| 150 | + | ||
| 151 | + | xCopyAsync uintptr | |
| 152 | + | ||
| 153 | + | xCopyFinish uintptr | |
| 154 | + | ||
| 155 | + | xMove uintptr | |
| 156 | + | ||
| 157 | + | xMoveAsync uintptr | |
| 158 | + | ||
| 159 | + | xMoveFinish uintptr | |
| 160 | + | ||
| 161 | + | xMountMountable uintptr | |
| 162 | + | ||
| 163 | + | xMountMountableFinish uintptr | |
| 164 | + | ||
| 165 | + | xUnmountMountable uintptr | |
| 166 | + | ||
| 167 | + | xUnmountMountableFinish uintptr | |
| 168 | + | ||
| 169 | + | xEjectMountable uintptr | |
| 170 | + | ||
| 171 | + | xEjectMountableFinish uintptr | |
| 172 | + | ||
| 173 | + | xMountEnclosingVolume uintptr | |
| 174 | + | ||
| 175 | + | xMountEnclosingVolumeFinish uintptr | |
| 176 | + | ||
| 177 | + | xMonitorDir uintptr | |
| 178 | + | ||
| 179 | + | xMonitorFile uintptr | |
| 180 | + | ||
| 181 | + | xOpenReadwrite uintptr | |
| 182 | + | ||
| 183 | + | xOpenReadwriteAsync uintptr | |
| 184 | + | ||
| 185 | + | xOpenReadwriteFinish uintptr | |
| 186 | + | ||
| 187 | + | xCreateReadwrite uintptr | |
| 188 | + | ||
| 189 | + | xCreateReadwriteAsync uintptr | |
| 190 | + | ||
| 191 | + | xCreateReadwriteFinish uintptr | |
| 192 | + | ||
| 193 | + | xReplaceReadwrite uintptr | |
| 194 | + | ||
| 195 | + | xReplaceReadwriteAsync uintptr | |
| 196 | + | ||
| 197 | + | xReplaceReadwriteFinish uintptr | |
| 198 | + | ||
| 199 | + | xStartMountable uintptr | |
| 200 | + | ||
| 201 | + | xStartMountableFinish uintptr | |
| 202 | + | ||
| 203 | + | xStopMountable uintptr | |
| 204 | + | ||
| 205 | + | xStopMountableFinish uintptr | |
| 206 | + | ||
| 21 | 207 | SupportsThreadContexts bool | |
| 208 | + | ||
| 209 | + | xUnmountMountableWithOperation uintptr | |
| 210 | + | ||
| 211 | + | xUnmountMountableWithOperationFinish uintptr | |
| 212 | + | ||
| 213 | + | xEjectMountableWithOperation uintptr | |
| 214 | + | ||
| 215 | + | xEjectMountableWithOperationFinish uintptr | |
| 216 | + | ||
| 217 | + | xPollMountable uintptr | |
| 218 | + | ||
| 219 | + | xPollMountableFinish uintptr | |
| 220 | + | ||
| 221 | + | xMeasureDiskUsage uintptr | |
| 222 | + | ||
| 223 | + | xMeasureDiskUsageAsync uintptr | |
| 224 | + | ||
| 225 | + | xMeasureDiskUsageFinish uintptr | |
| 22 | 226 | } | |
| 23 | 227 | ||
| 24 | 228 | func (x *FileIface) GoPointer() uintptr { | |
| 25 | 229 | return uintptr(unsafe.Pointer(x)) | |
| 26 | 230 | } | |
| 27 | 231 | ||
| 232 | + | // OverrideDup sets the callback function. | |
| 233 | + | func (x *FileIface) OverrideDup(cb func(File) *FileBase) { | |
| 234 | + | if cb == nil { | |
| 235 | + | x.xDup = 0 | |
| 236 | + | } else { | |
| 237 | + | x.xDup = purego.NewCallback(func(FileVarp uintptr) uintptr { | |
| 238 | + | ret := cb(&FileBase{Ptr: FileVarp}) | |
| 239 | + | if ret == nil { | |
| 240 | + | return 0 | |
| 241 | + | } | |
| 242 | + | return ret.GoPointer() | |
| 243 | + | }) | |
| 244 | + | } | |
| 245 | + | } | |
| 246 | + | ||
| 247 | + | // GetDup gets the callback function. | |
| 248 | + | func (x *FileIface) GetDup() func(File) *FileBase { | |
| 249 | + | if x.xDup == 0 { | |
| 250 | + | return nil | |
| 251 | + | } | |
| 252 | + | var rawCallback func(FileVarp uintptr) uintptr | |
| 253 | + | purego.RegisterFunc(&rawCallback, x.xDup) | |
| 254 | + | return func(FileVar File) *FileBase { | |
| 255 | + | rawRet := rawCallback(FileVar.GoPointer()) | |
| 256 | + | if rawRet == 0 { | |
| 257 | + | return nil | |
| 258 | + | } | |
| 259 | + | ret := &FileBase{} | |
| 260 | + | ret.Ptr = rawRet | |
| 261 | + | return ret | |
| 262 | + | } | |
| 263 | + | } | |
| 264 | + | ||
| 265 | + | // OverrideHash sets the callback function. | |
| 266 | + | func (x *FileIface) OverrideHash(cb func(File) uint) { | |
| 267 | + | if cb == nil { | |
| 268 | + | x.xHash = 0 | |
| 269 | + | } else { | |
| 270 | + | x.xHash = purego.NewCallback(func(FileVarp uintptr) uint { | |
| 271 | + | return cb(&FileBase{Ptr: FileVarp}) | |
| 272 | + | }) | |
| 273 | + | } | |
| 274 | + | } | |
| 275 | + | ||
| 276 | + | // GetHash gets the callback function. | |
| 277 | + | func (x *FileIface) GetHash() func(File) uint { | |
| 278 | + | if x.xHash == 0 { | |
| 279 | + | return nil | |
| 280 | + | } | |
| 281 | + | var rawCallback func(FileVarp uintptr) uint | |
| 282 | + | purego.RegisterFunc(&rawCallback, x.xHash) | |
| 283 | + | return func(FileVar File) uint { | |
| 284 | + | return rawCallback(FileVar.GoPointer()) | |
| 285 | + | } | |
| 286 | + | } | |
| 287 | + | ||
| 288 | + | // OverrideEqual sets the callback function. | |
| 289 | + | func (x *FileIface) OverrideEqual(cb func(File, File) bool) { | |
| 290 | + | if cb == nil { | |
| 291 | + | x.xEqual = 0 | |
| 292 | + | } else { | |
| 293 | + | x.xEqual = purego.NewCallback(func(File1Varp uintptr, File2Varp uintptr) bool { | |
| 294 | + | return cb(&FileBase{Ptr: File1Varp}, &FileBase{Ptr: File2Varp}) | |
| 295 | + | }) | |
| 296 | + | } | |
| 297 | + | } | |
| 298 | + | ||
| 299 | + | // GetEqual gets the callback function. | |
| 300 | + | func (x *FileIface) GetEqual() func(File, File) bool { | |
| 301 | + | if x.xEqual == 0 { | |
| 302 | + | return nil | |
| 303 | + | } | |
| 304 | + | var rawCallback func(File1Varp uintptr, File2Varp uintptr) bool | |
| 305 | + | purego.RegisterFunc(&rawCallback, x.xEqual) | |
| 306 | + | return func(File1Var File, File2Var File) bool { | |
| 307 | + | return rawCallback(File1Var.GoPointer(), File2Var.GoPointer()) | |
| 308 | + | } | |
| 309 | + | } | |
| 310 | + | ||
| 311 | + | // OverrideIsNative sets the callback function. | |
| 312 | + | func (x *FileIface) OverrideIsNative(cb func(File) bool) { | |
| 313 | + | if cb == nil { | |
| 314 | + | x.xIsNative = 0 | |
| 315 | + | } else { | |
| 316 | + | x.xIsNative = purego.NewCallback(func(FileVarp uintptr) bool { | |
| 317 | + | return cb(&FileBase{Ptr: FileVarp}) | |
| 318 | + | }) | |
| 319 | + | } | |
| 320 | + | } | |
| 321 | + | ||
| 322 | + | // GetIsNative gets the callback function. | |
| 323 | + | func (x *FileIface) GetIsNative() func(File) bool { | |
| 324 | + | if x.xIsNative == 0 { | |
| 325 | + | return nil | |
| 326 | + | } | |
| 327 | + | var rawCallback func(FileVarp uintptr) bool | |
| 328 | + | purego.RegisterFunc(&rawCallback, x.xIsNative) | |
| 329 | + | return func(FileVar File) bool { | |
| 330 | + | return rawCallback(FileVar.GoPointer()) | |
| 331 | + | } | |
| 332 | + | } | |
| 333 | + | ||
| 334 | + | // OverrideHasUriScheme sets the callback function. | |
| 335 | + | func (x *FileIface) OverrideHasUriScheme(cb func(File, string) bool) { | |
| 336 | + | if cb == nil { | |
| 337 | + | x.xHasUriScheme = 0 | |
| 338 | + | } else { | |
| 339 | + | x.xHasUriScheme = purego.NewCallback(func(FileVarp uintptr, UriSchemeVarp string) bool { | |
| 340 | + | return cb(&FileBase{Ptr: FileVarp}, UriSchemeVarp) | |
| 341 | + | }) | |
| 342 | + | } | |
| 343 | + | } | |
| 344 | + | ||
| 345 | + | // GetHasUriScheme gets the callback function. | |
| 346 | + | func (x *FileIface) GetHasUriScheme() func(File, string) bool { | |
| 347 | + | if x.xHasUriScheme == 0 { | |
| 348 | + | return nil | |
| 349 | + | } | |
| 350 | + | var rawCallback func(FileVarp uintptr, UriSchemeVarp string) bool | |
| 351 | + | purego.RegisterFunc(&rawCallback, x.xHasUriScheme) | |
| 352 | + | return func(FileVar File, UriSchemeVar string) bool { | |
| 353 | + | return rawCallback(FileVar.GoPointer(), UriSchemeVar) | |
| 354 | + | } | |
| 355 | + | } | |
| 356 | + | ||
| 357 | + | // OverrideGetUriScheme sets the callback function. | |
| 358 | + | func (x *FileIface) OverrideGetUriScheme(cb func(File) string) { | |
| 359 | + | if cb == nil { | |
| 360 | + | x.xGetUriScheme = 0 | |
| 361 | + | } else { | |
| 362 | + | x.xGetUriScheme = purego.NewCallback(func(FileVarp uintptr) string { | |
| 363 | + | return cb(&FileBase{Ptr: FileVarp}) | |
| 364 | + | }) | |
| 365 | + | } | |
| 366 | + | } | |
| 367 | + | ||
| 368 | + | // GetGetUriScheme gets the callback function. | |
| 369 | + | func (x *FileIface) GetGetUriScheme() func(File) string { | |
| 370 | + | if x.xGetUriScheme == 0 { | |
| 371 | + | return nil | |
| 372 | + | } | |
| 373 | + | var rawCallback func(FileVarp uintptr) string | |
| 374 | + | purego.RegisterFunc(&rawCallback, x.xGetUriScheme) | |
| 375 | + | return func(FileVar File) string { | |
| 376 | + | return rawCallback(FileVar.GoPointer()) | |
| 377 | + | } | |
| 378 | + | } | |
| 379 | + | ||
| 380 | + | // OverrideGetBasename sets the callback function. | |
| 381 | + | func (x *FileIface) OverrideGetBasename(cb func(File) string) { | |
| 382 | + | if cb == nil { | |
| 383 | + | x.xGetBasename = 0 | |
| 384 | + | } else { | |
| 385 | + | x.xGetBasename = purego.NewCallback(func(FileVarp uintptr) string { | |
| 386 | + | return cb(&FileBase{Ptr: FileVarp}) | |
| 387 | + | }) | |
| 388 | + | } | |
| 389 | + | } | |
| 390 | + | ||
| 391 | + | // GetGetBasename gets the callback function. | |
| 392 | + | func (x *FileIface) GetGetBasename() func(File) string { | |
| 393 | + | if x.xGetBasename == 0 { | |
| 394 | + | return nil | |
| 395 | + | } | |
| 396 | + | var rawCallback func(FileVarp uintptr) string | |
| 397 | + | purego.RegisterFunc(&rawCallback, x.xGetBasename) | |
| 398 | + | return func(FileVar File) string { | |
| 399 | + | return rawCallback(FileVar.GoPointer()) | |
| 400 | + | } | |
| 401 | + | } | |
| 402 | + | ||
| 403 | + | // OverrideGetPath sets the callback function. | |
| 404 | + | func (x *FileIface) OverrideGetPath(cb func(File) string) { | |
| 405 | + | if cb == nil { | |
| 406 | + | x.xGetPath = 0 | |
| 407 | + | } else { | |
| 408 | + | x.xGetPath = purego.NewCallback(func(FileVarp uintptr) string { | |
| 409 | + | return cb(&FileBase{Ptr: FileVarp}) | |
| 410 | + | }) | |
| 411 | + | } | |
| 412 | + | } | |
| 413 | + | ||
| 414 | + | // GetGetPath gets the callback function. | |
| 415 | + | func (x *FileIface) GetGetPath() func(File) string { | |
| 416 | + | if x.xGetPath == 0 { | |
| 417 | + | return nil | |
| 418 | + | } | |
| 419 | + | var rawCallback func(FileVarp uintptr) string | |
| 420 | + | purego.RegisterFunc(&rawCallback, x.xGetPath) | |
| 421 | + | return func(FileVar File) string { | |
| 422 | + | return rawCallback(FileVar.GoPointer()) | |
| 423 | + | } | |
| 424 | + | } | |
| 425 | + | ||
| 426 | + | // OverrideGetUri sets the callback function. | |
| 427 | + | func (x *FileIface) OverrideGetUri(cb func(File) string) { | |
| 428 | + | if cb == nil { | |
| 429 | + | x.xGetUri = 0 | |
| 430 | + | } else { | |
| 431 | + | x.xGetUri = purego.NewCallback(func(FileVarp uintptr) string { | |
| 432 | + | return cb(&FileBase{Ptr: FileVarp}) | |
| 433 | + | }) | |
| 434 | + | } | |
| 435 | + | } | |
| 436 | + | ||
| 437 | + | // GetGetUri gets the callback function. | |
| 438 | + | func (x *FileIface) GetGetUri() func(File) string { | |
| 439 | + | if x.xGetUri == 0 { | |
| 440 | + | return nil | |
| 441 | + | } | |
| 442 | + | var rawCallback func(FileVarp uintptr) string | |
| 443 | + | purego.RegisterFunc(&rawCallback, x.xGetUri) | |
| 444 | + | return func(FileVar File) string { | |
| 445 | + | return rawCallback(FileVar.GoPointer()) | |
| 446 | + | } | |
| 447 | + | } | |
| 448 | + | ||
| 449 | + | // OverrideGetParseName sets the callback function. | |
| 450 | + | func (x *FileIface) OverrideGetParseName(cb func(File) string) { | |
| 451 | + | if cb == nil { | |
| 452 | + | x.xGetParseName = 0 | |
| 453 | + | } else { | |
| 454 | + | x.xGetParseName = purego.NewCallback(func(FileVarp uintptr) string { | |
| 455 | + | return cb(&FileBase{Ptr: FileVarp}) | |
| 456 | + | }) | |
| 457 | + | } | |
| 458 | + | } | |
| 459 | + | ||
| 460 | + | // GetGetParseName gets the callback function. | |
| 461 | + | func (x *FileIface) GetGetParseName() func(File) string { | |
| 462 | + | if x.xGetParseName == 0 { | |
| 463 | + | return nil | |
| 464 | + | } | |
| 465 | + | var rawCallback func(FileVarp uintptr) string | |
| 466 | + | purego.RegisterFunc(&rawCallback, x.xGetParseName) | |
| 467 | + | return func(FileVar File) string { | |
| 468 | + | return rawCallback(FileVar.GoPointer()) | |
| 469 | + | } | |
| 470 | + | } | |
| 471 | + | ||
| 472 | + | // OverrideGetParent sets the callback function. | |
| 473 | + | func (x *FileIface) OverrideGetParent(cb func(File) *FileBase) { | |
| 474 | + | if cb == nil { | |
| 475 | + | x.xGetParent = 0 | |
| 476 | + | } else { | |
| 477 | + | x.xGetParent = purego.NewCallback(func(FileVarp uintptr) uintptr { | |
| 478 | + | ret := cb(&FileBase{Ptr: FileVarp}) | |
| 479 | + | if ret == nil { | |
| 480 | + | return 0 | |
| 481 | + | } | |
| 482 | + | return ret.GoPointer() | |
| 483 | + | }) | |
| 484 | + | } | |
| 485 | + | } | |
| 486 | + | ||
| 487 | + | // GetGetParent gets the callback function. | |
| 488 | + | func (x *FileIface) GetGetParent() func(File) *FileBase { | |
| 489 | + | if x.xGetParent == 0 { | |
| 490 | + | return nil | |
| 491 | + | } | |
| 492 | + | var rawCallback func(FileVarp uintptr) uintptr | |
| 493 | + | purego.RegisterFunc(&rawCallback, x.xGetParent) | |
| 494 | + | return func(FileVar File) *FileBase { | |
| 495 | + | rawRet := rawCallback(FileVar.GoPointer()) | |
| 496 | + | if rawRet == 0 { | |
| 497 | + | return nil | |
| 498 | + | } | |
| 499 | + | ret := &FileBase{} | |
| 500 | + | ret.Ptr = rawRet | |
| 501 | + | return ret | |
| 502 | + | } | |
| 503 | + | } | |
| 504 | + | ||
| 505 | + | // OverridePrefixMatches sets the callback function. | |
| 506 | + | func (x *FileIface) OverridePrefixMatches(cb func(File, File) bool) { | |
| 507 | + | if cb == nil { | |
| 508 | + | x.xPrefixMatches = 0 | |
| 509 | + | } else { | |
| 510 | + | x.xPrefixMatches = purego.NewCallback(func(PrefixVarp uintptr, FileVarp uintptr) bool { | |
| 511 | + | return cb(&FileBase{Ptr: PrefixVarp}, &FileBase{Ptr: FileVarp}) | |
| 512 | + | }) | |
| 513 | + | } | |
| 514 | + | } | |
| 515 | + | ||
| 516 | + | // GetPrefixMatches gets the callback function. | |
| 517 | + | func (x *FileIface) GetPrefixMatches() func(File, File) bool { | |
| 518 | + | if x.xPrefixMatches == 0 { | |
| 519 | + | return nil | |
| 520 | + | } | |
| 521 | + | var rawCallback func(PrefixVarp uintptr, FileVarp uintptr) bool | |
| 522 | + | purego.RegisterFunc(&rawCallback, x.xPrefixMatches) | |
| 523 | + | return func(PrefixVar File, FileVar File) bool { | |
| 524 | + | return rawCallback(PrefixVar.GoPointer(), FileVar.GoPointer()) | |
| 525 | + | } | |
| 526 | + | } | |
| 527 | + | ||
| 528 | + | // OverrideGetRelativePath sets the callback function. | |
| 529 | + | func (x *FileIface) OverrideGetRelativePath(cb func(File, File) string) { | |
| 530 | + | if cb == nil { | |
| 531 | + | x.xGetRelativePath = 0 | |
| 532 | + | } else { | |
| 533 | + | x.xGetRelativePath = purego.NewCallback(func(ParentVarp uintptr, DescendantVarp uintptr) string { | |
| 534 | + | return cb(&FileBase{Ptr: ParentVarp}, &FileBase{Ptr: DescendantVarp}) | |
| 535 | + | }) | |
| 536 | + | } | |
| 537 | + | } | |
| 538 | + | ||
| 539 | + | // GetGetRelativePath gets the callback function. | |
| 540 | + | func (x *FileIface) GetGetRelativePath() func(File, File) string { | |
| 541 | + | if x.xGetRelativePath == 0 { | |
| 542 | + | return nil | |
| 543 | + | } | |
| 544 | + | var rawCallback func(ParentVarp uintptr, DescendantVarp uintptr) string | |
| 545 | + | purego.RegisterFunc(&rawCallback, x.xGetRelativePath) | |
| 546 | + | return func(ParentVar File, DescendantVar File) string { | |
| 547 | + | return rawCallback(ParentVar.GoPointer(), DescendantVar.GoPointer()) | |
| 548 | + | } | |
| 549 | + | } | |
| 550 | + | ||
| 551 | + | // OverrideResolveRelativePath sets the callback function. | |
| 552 | + | func (x *FileIface) OverrideResolveRelativePath(cb func(File, string) *FileBase) { | |
| 553 | + | if cb == nil { | |
| 554 | + | x.xResolveRelativePath = 0 | |
| 555 | + | } else { | |
| 556 | + | x.xResolveRelativePath = purego.NewCallback(func(FileVarp uintptr, RelativePathVarp string) uintptr { | |
| 557 | + | ret := cb(&FileBase{Ptr: FileVarp}, RelativePathVarp) | |
| 558 | + | if ret == nil { | |
| 559 | + | return 0 | |
| 560 | + | } | |
| 561 | + | return ret.GoPointer() | |
| 562 | + | }) | |
| 563 | + | } | |
| 564 | + | } | |
| 565 | + | ||
| 566 | + | // GetResolveRelativePath gets the callback function. | |
| 567 | + | func (x *FileIface) GetResolveRelativePath() func(File, string) *FileBase { | |
| 568 | + | if x.xResolveRelativePath == 0 { | |
| 569 | + | return nil | |
| 570 | + | } | |
| 571 | + | var rawCallback func(FileVarp uintptr, RelativePathVarp string) uintptr | |
| 572 | + | purego.RegisterFunc(&rawCallback, x.xResolveRelativePath) | |
| 573 | + | return func(FileVar File, RelativePathVar string) *FileBase { | |
| 574 | + | rawRet := rawCallback(FileVar.GoPointer(), RelativePathVar) | |
| 575 | + | if rawRet == 0 { | |
| 576 | + | return nil | |
| 577 | + | } | |
| 578 | + | ret := &FileBase{} | |
| 579 | + | ret.Ptr = rawRet | |
| 580 | + | return ret | |
| 581 | + | } | |
| 582 | + | } | |
| 583 | + | ||
| 584 | + | // OverrideGetChildForDisplayName sets the callback function. | |
| 585 | + | func (x *FileIface) OverrideGetChildForDisplayName(cb func(File, string) *FileBase) { | |
| 586 | + | if cb == nil { | |
| 587 | + | x.xGetChildForDisplayName = 0 | |
| 588 | + | } else { | |
| 589 | + | x.xGetChildForDisplayName = purego.NewCallback(func(FileVarp uintptr, DisplayNameVarp string) uintptr { | |
| 590 | + | ret := cb(&FileBase{Ptr: FileVarp}, DisplayNameVarp) | |
| 591 | + | if ret == nil { | |
| 592 | + | return 0 | |
| 593 | + | } | |
| 594 | + | return ret.GoPointer() | |
| 595 | + | }) | |
| 596 | + | } | |
| 597 | + | } | |
| 598 | + | ||
| 599 | + | // GetGetChildForDisplayName gets the callback function. | |
| 600 | + | func (x *FileIface) GetGetChildForDisplayName() func(File, string) *FileBase { | |
| 601 | + | if x.xGetChildForDisplayName == 0 { | |
| 602 | + | return nil | |
| 603 | + | } | |
| 604 | + | var rawCallback func(FileVarp uintptr, DisplayNameVarp string) uintptr | |
| 605 | + | purego.RegisterFunc(&rawCallback, x.xGetChildForDisplayName) | |
| 606 | + | return func(FileVar File, DisplayNameVar string) *FileBase { | |
| 607 | + | rawRet := rawCallback(FileVar.GoPointer(), DisplayNameVar) | |
| 608 | + | if rawRet == 0 { | |
| 609 | + | return nil | |
| 610 | + | } | |
| 611 | + | ret := &FileBase{} | |
| 612 | + | ret.Ptr = rawRet | |
| 613 | + | return ret | |
| 614 | + | } | |
| 615 | + | } | |
| 616 | + | ||
| 617 | + | // OverrideEnumerateChildren sets the callback function. | |
| 618 | + | func (x *FileIface) OverrideEnumerateChildren(cb func(File, string, FileQueryInfoFlags, *Cancellable) *FileEnumerator) { | |
| 619 | + | if cb == nil { | |
| 620 | + | x.xEnumerateChildren = 0 | |
| 621 | + | } else { | |
| 622 | + | x.xEnumerateChildren = purego.NewCallback(func(FileVarp uintptr, AttributesVarp string, FlagsVarp FileQueryInfoFlags, CancellableVarp uintptr) uintptr { | |
| 623 | + | ret := cb(&FileBase{Ptr: FileVarp}, AttributesVarp, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 624 | + | if ret == nil { | |
| 625 | + | return 0 | |
| 626 | + | } | |
| 627 | + | return ret.GoPointer() | |
| 628 | + | }) | |
| 629 | + | } | |
| 630 | + | } | |
| 631 | + | ||
| 632 | + | // GetEnumerateChildren gets the callback function. | |
| 633 | + | func (x *FileIface) GetEnumerateChildren() func(File, string, FileQueryInfoFlags, *Cancellable) *FileEnumerator { | |
| 634 | + | if x.xEnumerateChildren == 0 { | |
| 635 | + | return nil | |
| 636 | + | } | |
| 637 | + | var rawCallback func(FileVarp uintptr, AttributesVarp string, FlagsVarp FileQueryInfoFlags, CancellableVarp uintptr) uintptr | |
| 638 | + | purego.RegisterFunc(&rawCallback, x.xEnumerateChildren) | |
| 639 | + | return func(FileVar File, AttributesVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) *FileEnumerator { | |
| 640 | + | rawRet := rawCallback(FileVar.GoPointer(), AttributesVar, FlagsVar, CancellableVar.GoPointer()) | |
| 641 | + | if rawRet == 0 { | |
| 642 | + | return nil | |
| 643 | + | } | |
| 644 | + | ret := &FileEnumerator{} | |
| 645 | + | ret.Ptr = rawRet | |
| 646 | + | return ret | |
| 647 | + | } | |
| 648 | + | } | |
| 649 | + | ||
| 650 | + | // OverrideEnumerateChildrenAsync sets the callback function. | |
| 651 | + | func (x *FileIface) OverrideEnumerateChildrenAsync(cb func(File, string, FileQueryInfoFlags, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 652 | + | if cb == nil { | |
| 653 | + | x.xEnumerateChildrenAsync = 0 | |
| 654 | + | } else { | |
| 655 | + | x.xEnumerateChildrenAsync = purego.NewCallback(func(FileVarp uintptr, AttributesVarp string, FlagsVarp FileQueryInfoFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 656 | + | cb(&FileBase{Ptr: FileVarp}, AttributesVarp, FlagsVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 657 | + | }) | |
| 658 | + | } | |
| 659 | + | } | |
| 660 | + | ||
| 661 | + | // GetEnumerateChildrenAsync gets the callback function. | |
| 662 | + | func (x *FileIface) GetEnumerateChildrenAsync() func(File, string, FileQueryInfoFlags, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 663 | + | if x.xEnumerateChildrenAsync == 0 { | |
| 664 | + | return nil | |
| 665 | + | } | |
| 666 | + | var rawCallback func(FileVarp uintptr, AttributesVarp string, FlagsVarp FileQueryInfoFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 667 | + | purego.RegisterFunc(&rawCallback, x.xEnumerateChildrenAsync) | |
| 668 | + | return func(FileVar File, AttributesVar string, FlagsVar FileQueryInfoFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 669 | + | rawCallback(FileVar.GoPointer(), AttributesVar, FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 670 | + | } | |
| 671 | + | } | |
| 672 | + | ||
| 673 | + | // OverrideEnumerateChildrenFinish sets the callback function. | |
| 674 | + | func (x *FileIface) OverrideEnumerateChildrenFinish(cb func(File, AsyncResult) *FileEnumerator) { | |
| 675 | + | if cb == nil { | |
| 676 | + | x.xEnumerateChildrenFinish = 0 | |
| 677 | + | } else { | |
| 678 | + | x.xEnumerateChildrenFinish = purego.NewCallback(func(FileVarp uintptr, ResVarp uintptr) uintptr { | |
| 679 | + | ret := cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResVarp}) | |
| 680 | + | if ret == nil { | |
| 681 | + | return 0 | |
| 682 | + | } | |
| 683 | + | return ret.GoPointer() | |
| 684 | + | }) | |
| 685 | + | } | |
| 686 | + | } | |
| 687 | + | ||
| 688 | + | // GetEnumerateChildrenFinish gets the callback function. | |
| 689 | + | func (x *FileIface) GetEnumerateChildrenFinish() func(File, AsyncResult) *FileEnumerator { | |
| 690 | + | if x.xEnumerateChildrenFinish == 0 { | |
| 691 | + | return nil | |
| 692 | + | } | |
| 693 | + | var rawCallback func(FileVarp uintptr, ResVarp uintptr) uintptr | |
| 694 | + | purego.RegisterFunc(&rawCallback, x.xEnumerateChildrenFinish) | |
| 695 | + | return func(FileVar File, ResVar AsyncResult) *FileEnumerator { | |
| 696 | + | rawRet := rawCallback(FileVar.GoPointer(), ResVar.GoPointer()) | |
| 697 | + | if rawRet == 0 { | |
| 698 | + | return nil | |
| 699 | + | } | |
| 700 | + | ret := &FileEnumerator{} | |
| 701 | + | ret.Ptr = rawRet | |
| 702 | + | return ret | |
| 703 | + | } | |
| 704 | + | } | |
| 705 | + | ||
| 706 | + | // OverrideQueryInfo sets the callback function. | |
| 707 | + | func (x *FileIface) OverrideQueryInfo(cb func(File, string, FileQueryInfoFlags, *Cancellable) *FileInfo) { | |
| 708 | + | if cb == nil { | |
| 709 | + | x.xQueryInfo = 0 | |
| 710 | + | } else { | |
| 711 | + | x.xQueryInfo = purego.NewCallback(func(FileVarp uintptr, AttributesVarp string, FlagsVarp FileQueryInfoFlags, CancellableVarp uintptr) uintptr { | |
| 712 | + | ret := cb(&FileBase{Ptr: FileVarp}, AttributesVarp, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 713 | + | if ret == nil { | |
| 714 | + | return 0 | |
| 715 | + | } | |
| 716 | + | return ret.GoPointer() | |
| 717 | + | }) | |
| 718 | + | } | |
| 719 | + | } | |
| 720 | + | ||
| 721 | + | // GetQueryInfo gets the callback function. | |
| 722 | + | func (x *FileIface) GetQueryInfo() func(File, string, FileQueryInfoFlags, *Cancellable) *FileInfo { | |
| 723 | + | if x.xQueryInfo == 0 { | |
| 724 | + | return nil | |
| 725 | + | } | |
| 726 | + | var rawCallback func(FileVarp uintptr, AttributesVarp string, FlagsVarp FileQueryInfoFlags, CancellableVarp uintptr) uintptr | |
| 727 | + | purego.RegisterFunc(&rawCallback, x.xQueryInfo) | |
| 728 | + | return func(FileVar File, AttributesVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) *FileInfo { | |
| 729 | + | rawRet := rawCallback(FileVar.GoPointer(), AttributesVar, FlagsVar, CancellableVar.GoPointer()) | |
| 730 | + | if rawRet == 0 { | |
| 731 | + | return nil | |
| 732 | + | } | |
| 733 | + | ret := &FileInfo{} | |
| 734 | + | ret.Ptr = rawRet | |
| 735 | + | return ret | |
| 736 | + | } | |
| 737 | + | } | |
| 738 | + | ||
| 739 | + | // OverrideQueryInfoAsync sets the callback function. | |
| 740 | + | func (x *FileIface) OverrideQueryInfoAsync(cb func(File, string, FileQueryInfoFlags, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 741 | + | if cb == nil { | |
| 742 | + | x.xQueryInfoAsync = 0 | |
| 743 | + | } else { | |
| 744 | + | x.xQueryInfoAsync = purego.NewCallback(func(FileVarp uintptr, AttributesVarp string, FlagsVarp FileQueryInfoFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 745 | + | cb(&FileBase{Ptr: FileVarp}, AttributesVarp, FlagsVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 746 | + | }) | |
| 747 | + | } | |
| 748 | + | } | |
| 749 | + | ||
| 750 | + | // GetQueryInfoAsync gets the callback function. | |
| 751 | + | func (x *FileIface) GetQueryInfoAsync() func(File, string, FileQueryInfoFlags, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 752 | + | if x.xQueryInfoAsync == 0 { | |
| 753 | + | return nil | |
| 754 | + | } | |
| 755 | + | var rawCallback func(FileVarp uintptr, AttributesVarp string, FlagsVarp FileQueryInfoFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 756 | + | purego.RegisterFunc(&rawCallback, x.xQueryInfoAsync) | |
| 757 | + | return func(FileVar File, AttributesVar string, FlagsVar FileQueryInfoFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 758 | + | rawCallback(FileVar.GoPointer(), AttributesVar, FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 759 | + | } | |
| 760 | + | } | |
| 761 | + | ||
| 762 | + | // OverrideQueryInfoFinish sets the callback function. | |
| 763 | + | func (x *FileIface) OverrideQueryInfoFinish(cb func(File, AsyncResult) *FileInfo) { | |
| 764 | + | if cb == nil { | |
| 765 | + | x.xQueryInfoFinish = 0 | |
| 766 | + | } else { | |
| 767 | + | x.xQueryInfoFinish = purego.NewCallback(func(FileVarp uintptr, ResVarp uintptr) uintptr { | |
| 768 | + | ret := cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResVarp}) | |
| 769 | + | if ret == nil { | |
| 770 | + | return 0 | |
| 771 | + | } | |
| 772 | + | return ret.GoPointer() | |
| 773 | + | }) | |
| 774 | + | } | |
| 775 | + | } | |
| 776 | + | ||
| 777 | + | // GetQueryInfoFinish gets the callback function. | |
| 778 | + | func (x *FileIface) GetQueryInfoFinish() func(File, AsyncResult) *FileInfo { | |
| 779 | + | if x.xQueryInfoFinish == 0 { | |
| 780 | + | return nil | |
| 781 | + | } | |
| 782 | + | var rawCallback func(FileVarp uintptr, ResVarp uintptr) uintptr | |
| 783 | + | purego.RegisterFunc(&rawCallback, x.xQueryInfoFinish) | |
| 784 | + | return func(FileVar File, ResVar AsyncResult) *FileInfo { | |
| 785 | + | rawRet := rawCallback(FileVar.GoPointer(), ResVar.GoPointer()) | |
| 786 | + | if rawRet == 0 { | |
| 787 | + | return nil | |
| 788 | + | } | |
| 789 | + | ret := &FileInfo{} | |
| 790 | + | ret.Ptr = rawRet | |
| 791 | + | return ret | |
| 792 | + | } | |
| 793 | + | } | |
| 794 | + | ||
| 795 | + | // OverrideQueryFilesystemInfo sets the callback function. | |
| 796 | + | func (x *FileIface) OverrideQueryFilesystemInfo(cb func(File, string, *Cancellable) *FileInfo) { | |
| 797 | + | if cb == nil { | |
| 798 | + | x.xQueryFilesystemInfo = 0 | |
| 799 | + | } else { | |
| 800 | + | x.xQueryFilesystemInfo = purego.NewCallback(func(FileVarp uintptr, AttributesVarp string, CancellableVarp uintptr) uintptr { | |
| 801 | + | ret := cb(&FileBase{Ptr: FileVarp}, AttributesVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 802 | + | if ret == nil { | |
| 803 | + | return 0 | |
| 804 | + | } | |
| 805 | + | return ret.GoPointer() | |
| 806 | + | }) | |
| 807 | + | } | |
| 808 | + | } | |
| 809 | + | ||
| 810 | + | // GetQueryFilesystemInfo gets the callback function. | |
| 811 | + | func (x *FileIface) GetQueryFilesystemInfo() func(File, string, *Cancellable) *FileInfo { | |
| 812 | + | if x.xQueryFilesystemInfo == 0 { | |
| 813 | + | return nil | |
| 814 | + | } | |
| 815 | + | var rawCallback func(FileVarp uintptr, AttributesVarp string, CancellableVarp uintptr) uintptr | |
| 816 | + | purego.RegisterFunc(&rawCallback, x.xQueryFilesystemInfo) | |
| 817 | + | return func(FileVar File, AttributesVar string, CancellableVar *Cancellable) *FileInfo { | |
| 818 | + | rawRet := rawCallback(FileVar.GoPointer(), AttributesVar, CancellableVar.GoPointer()) | |
| 819 | + | if rawRet == 0 { | |
| 820 | + | return nil | |
| 821 | + | } | |
| 822 | + | ret := &FileInfo{} | |
| 823 | + | ret.Ptr = rawRet | |
| 824 | + | return ret | |
| 825 | + | } | |
| 826 | + | } | |
| 827 | + | ||
| 828 | + | // OverrideQueryFilesystemInfoAsync sets the callback function. | |
| 829 | + | func (x *FileIface) OverrideQueryFilesystemInfoAsync(cb func(File, string, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 830 | + | if cb == nil { | |
| 831 | + | x.xQueryFilesystemInfoAsync = 0 | |
| 832 | + | } else { | |
| 833 | + | x.xQueryFilesystemInfoAsync = purego.NewCallback(func(FileVarp uintptr, AttributesVarp string, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 834 | + | cb(&FileBase{Ptr: FileVarp}, AttributesVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 835 | + | }) | |
| 836 | + | } | |
| 837 | + | } | |
| 838 | + | ||
| 839 | + | // GetQueryFilesystemInfoAsync gets the callback function. | |
| 840 | + | func (x *FileIface) GetQueryFilesystemInfoAsync() func(File, string, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 841 | + | if x.xQueryFilesystemInfoAsync == 0 { | |
| 842 | + | return nil | |
| 843 | + | } | |
| 844 | + | var rawCallback func(FileVarp uintptr, AttributesVarp string, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 845 | + | purego.RegisterFunc(&rawCallback, x.xQueryFilesystemInfoAsync) | |
| 846 | + | return func(FileVar File, AttributesVar string, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 847 | + | rawCallback(FileVar.GoPointer(), AttributesVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 848 | + | } | |
| 849 | + | } | |
| 850 | + | ||
| 851 | + | // OverrideQueryFilesystemInfoFinish sets the callback function. | |
| 852 | + | func (x *FileIface) OverrideQueryFilesystemInfoFinish(cb func(File, AsyncResult) *FileInfo) { | |
| 853 | + | if cb == nil { | |
| 854 | + | x.xQueryFilesystemInfoFinish = 0 | |
| 855 | + | } else { | |
| 856 | + | x.xQueryFilesystemInfoFinish = purego.NewCallback(func(FileVarp uintptr, ResVarp uintptr) uintptr { | |
| 857 | + | ret := cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResVarp}) | |
| 858 | + | if ret == nil { | |
| 859 | + | return 0 | |
| 860 | + | } | |
| 861 | + | return ret.GoPointer() | |
| 862 | + | }) | |
| 863 | + | } | |
| 864 | + | } | |
| 865 | + | ||
| 866 | + | // GetQueryFilesystemInfoFinish gets the callback function. | |
| 867 | + | func (x *FileIface) GetQueryFilesystemInfoFinish() func(File, AsyncResult) *FileInfo { | |
| 868 | + | if x.xQueryFilesystemInfoFinish == 0 { | |
| 869 | + | return nil | |
| 870 | + | } | |
| 871 | + | var rawCallback func(FileVarp uintptr, ResVarp uintptr) uintptr | |
| 872 | + | purego.RegisterFunc(&rawCallback, x.xQueryFilesystemInfoFinish) | |
| 873 | + | return func(FileVar File, ResVar AsyncResult) *FileInfo { | |
| 874 | + | rawRet := rawCallback(FileVar.GoPointer(), ResVar.GoPointer()) | |
| 875 | + | if rawRet == 0 { | |
| 876 | + | return nil | |
| 877 | + | } | |
| 878 | + | ret := &FileInfo{} | |
| 879 | + | ret.Ptr = rawRet | |
| 880 | + | return ret | |
| 881 | + | } | |
| 882 | + | } | |
| 883 | + | ||
| 884 | + | // OverrideFindEnclosingMount sets the callback function. | |
| 885 | + | func (x *FileIface) OverrideFindEnclosingMount(cb func(File, *Cancellable) *MountBase) { | |
| 886 | + | if cb == nil { | |
| 887 | + | x.xFindEnclosingMount = 0 | |
| 888 | + | } else { | |
| 889 | + | x.xFindEnclosingMount = purego.NewCallback(func(FileVarp uintptr, CancellableVarp uintptr) uintptr { | |
| 890 | + | ret := cb(&FileBase{Ptr: FileVarp}, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 891 | + | if ret == nil { | |
| 892 | + | return 0 | |
| 893 | + | } | |
| 894 | + | return ret.GoPointer() | |
| 895 | + | }) | |
| 896 | + | } | |
| 897 | + | } | |
| 898 | + | ||
| 899 | + | // GetFindEnclosingMount gets the callback function. | |
| 900 | + | func (x *FileIface) GetFindEnclosingMount() func(File, *Cancellable) *MountBase { | |
| 901 | + | if x.xFindEnclosingMount == 0 { | |
| 902 | + | return nil | |
| 903 | + | } | |
| 904 | + | var rawCallback func(FileVarp uintptr, CancellableVarp uintptr) uintptr | |
| 905 | + | purego.RegisterFunc(&rawCallback, x.xFindEnclosingMount) | |
| 906 | + | return func(FileVar File, CancellableVar *Cancellable) *MountBase { | |
| 907 | + | rawRet := rawCallback(FileVar.GoPointer(), CancellableVar.GoPointer()) | |
| 908 | + | if rawRet == 0 { | |
| 909 | + | return nil | |
| 910 | + | } | |
| 911 | + | ret := &MountBase{} | |
| 912 | + | ret.Ptr = rawRet | |
| 913 | + | return ret | |
| 914 | + | } | |
| 915 | + | } | |
| 916 | + | ||
| 917 | + | // OverrideFindEnclosingMountAsync sets the callback function. | |
| 918 | + | func (x *FileIface) OverrideFindEnclosingMountAsync(cb func(File, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 919 | + | if cb == nil { | |
| 920 | + | x.xFindEnclosingMountAsync = 0 | |
| 921 | + | } else { | |
| 922 | + | x.xFindEnclosingMountAsync = purego.NewCallback(func(FileVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 923 | + | cb(&FileBase{Ptr: FileVarp}, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 924 | + | }) | |
| 925 | + | } | |
| 926 | + | } | |
| 927 | + | ||
| 928 | + | // GetFindEnclosingMountAsync gets the callback function. | |
| 929 | + | func (x *FileIface) GetFindEnclosingMountAsync() func(File, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 930 | + | if x.xFindEnclosingMountAsync == 0 { | |
| 931 | + | return nil | |
| 932 | + | } | |
| 933 | + | var rawCallback func(FileVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 934 | + | purego.RegisterFunc(&rawCallback, x.xFindEnclosingMountAsync) | |
| 935 | + | return func(FileVar File, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 936 | + | rawCallback(FileVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 937 | + | } | |
| 938 | + | } | |
| 939 | + | ||
| 940 | + | // OverrideFindEnclosingMountFinish sets the callback function. | |
| 941 | + | func (x *FileIface) OverrideFindEnclosingMountFinish(cb func(File, AsyncResult) *MountBase) { | |
| 942 | + | if cb == nil { | |
| 943 | + | x.xFindEnclosingMountFinish = 0 | |
| 944 | + | } else { | |
| 945 | + | x.xFindEnclosingMountFinish = purego.NewCallback(func(FileVarp uintptr, ResVarp uintptr) uintptr { | |
| 946 | + | ret := cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResVarp}) | |
| 947 | + | if ret == nil { | |
| 948 | + | return 0 | |
| 949 | + | } | |
| 950 | + | return ret.GoPointer() | |
| 951 | + | }) | |
| 952 | + | } | |
| 953 | + | } | |
| 954 | + | ||
| 955 | + | // GetFindEnclosingMountFinish gets the callback function. | |
| 956 | + | func (x *FileIface) GetFindEnclosingMountFinish() func(File, AsyncResult) *MountBase { | |
| 957 | + | if x.xFindEnclosingMountFinish == 0 { | |
| 958 | + | return nil | |
| 959 | + | } | |
| 960 | + | var rawCallback func(FileVarp uintptr, ResVarp uintptr) uintptr | |
| 961 | + | purego.RegisterFunc(&rawCallback, x.xFindEnclosingMountFinish) | |
| 962 | + | return func(FileVar File, ResVar AsyncResult) *MountBase { | |
| 963 | + | rawRet := rawCallback(FileVar.GoPointer(), ResVar.GoPointer()) | |
| 964 | + | if rawRet == 0 { | |
| 965 | + | return nil | |
| 966 | + | } | |
| 967 | + | ret := &MountBase{} | |
| 968 | + | ret.Ptr = rawRet | |
| 969 | + | return ret | |
| 970 | + | } | |
| 971 | + | } | |
| 972 | + | ||
| 973 | + | // OverrideSetDisplayName sets the callback function. | |
| 974 | + | func (x *FileIface) OverrideSetDisplayName(cb func(File, string, *Cancellable) *FileBase) { | |
| 975 | + | if cb == nil { | |
| 976 | + | x.xSetDisplayName = 0 | |
| 977 | + | } else { | |
| 978 | + | x.xSetDisplayName = purego.NewCallback(func(FileVarp uintptr, DisplayNameVarp string, CancellableVarp uintptr) uintptr { | |
| 979 | + | ret := cb(&FileBase{Ptr: FileVarp}, DisplayNameVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 980 | + | if ret == nil { | |
| 981 | + | return 0 | |
| 982 | + | } | |
| 983 | + | return ret.GoPointer() | |
| 984 | + | }) | |
| 985 | + | } | |
| 986 | + | } | |
| 987 | + | ||
| 988 | + | // GetSetDisplayName gets the callback function. | |
| 989 | + | func (x *FileIface) GetSetDisplayName() func(File, string, *Cancellable) *FileBase { | |
| 990 | + | if x.xSetDisplayName == 0 { | |
| 991 | + | return nil | |
| 992 | + | } | |
| 993 | + | var rawCallback func(FileVarp uintptr, DisplayNameVarp string, CancellableVarp uintptr) uintptr | |
| 994 | + | purego.RegisterFunc(&rawCallback, x.xSetDisplayName) | |
| 995 | + | return func(FileVar File, DisplayNameVar string, CancellableVar *Cancellable) *FileBase { | |
| 996 | + | rawRet := rawCallback(FileVar.GoPointer(), DisplayNameVar, CancellableVar.GoPointer()) | |
| 997 | + | if rawRet == 0 { | |
| 998 | + | return nil | |
| 999 | + | } | |
| 1000 | + | ret := &FileBase{} | |
| 1001 | + | ret.Ptr = rawRet | |
| 1002 | + | return ret | |
| 1003 | + | } | |
| 1004 | + | } | |
| 1005 | + | ||
| 1006 | + | // OverrideSetDisplayNameAsync sets the callback function. | |
| 1007 | + | func (x *FileIface) OverrideSetDisplayNameAsync(cb func(File, string, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 1008 | + | if cb == nil { | |
| 1009 | + | x.xSetDisplayNameAsync = 0 | |
| 1010 | + | } else { | |
| 1011 | + | x.xSetDisplayNameAsync = purego.NewCallback(func(FileVarp uintptr, DisplayNameVarp string, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 1012 | + | cb(&FileBase{Ptr: FileVarp}, DisplayNameVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 1013 | + | }) | |
| 1014 | + | } | |
| 1015 | + | } | |
| 1016 | + | ||
| 1017 | + | // GetSetDisplayNameAsync gets the callback function. | |
| 1018 | + | func (x *FileIface) GetSetDisplayNameAsync() func(File, string, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 1019 | + | if x.xSetDisplayNameAsync == 0 { | |
| 1020 | + | return nil | |
| 1021 | + | } | |
| 1022 | + | var rawCallback func(FileVarp uintptr, DisplayNameVarp string, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 1023 | + | purego.RegisterFunc(&rawCallback, x.xSetDisplayNameAsync) | |
| 1024 | + | return func(FileVar File, DisplayNameVar string, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1025 | + | rawCallback(FileVar.GoPointer(), DisplayNameVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1026 | + | } | |
| 1027 | + | } | |
| 1028 | + | ||
| 1029 | + | // OverrideSetDisplayNameFinish sets the callback function. | |
| 1030 | + | func (x *FileIface) OverrideSetDisplayNameFinish(cb func(File, AsyncResult) *FileBase) { | |
| 1031 | + | if cb == nil { | |
| 1032 | + | x.xSetDisplayNameFinish = 0 | |
| 1033 | + | } else { | |
| 1034 | + | x.xSetDisplayNameFinish = purego.NewCallback(func(FileVarp uintptr, ResVarp uintptr) uintptr { | |
| 1035 | + | ret := cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResVarp}) | |
| 1036 | + | if ret == nil { | |
| 1037 | + | return 0 | |
| 1038 | + | } | |
| 1039 | + | return ret.GoPointer() | |
| 1040 | + | }) | |
| 1041 | + | } | |
| 1042 | + | } | |
| 1043 | + | ||
| 1044 | + | // GetSetDisplayNameFinish gets the callback function. | |
| 1045 | + | func (x *FileIface) GetSetDisplayNameFinish() func(File, AsyncResult) *FileBase { | |
| 1046 | + | if x.xSetDisplayNameFinish == 0 { | |
| 1047 | + | return nil | |
| 1048 | + | } | |
| 1049 | + | var rawCallback func(FileVarp uintptr, ResVarp uintptr) uintptr | |
| 1050 | + | purego.RegisterFunc(&rawCallback, x.xSetDisplayNameFinish) | |
| 1051 | + | return func(FileVar File, ResVar AsyncResult) *FileBase { | |
| 1052 | + | rawRet := rawCallback(FileVar.GoPointer(), ResVar.GoPointer()) | |
| 1053 | + | if rawRet == 0 { | |
| 1054 | + | return nil | |
| 1055 | + | } | |
| 1056 | + | ret := &FileBase{} | |
| 1057 | + | ret.Ptr = rawRet | |
| 1058 | + | return ret | |
| 1059 | + | } | |
| 1060 | + | } | |
| 1061 | + | ||
| 1062 | + | // OverrideQuerySettableAttributes sets the callback function. | |
| 1063 | + | func (x *FileIface) OverrideQuerySettableAttributes(cb func(File, *Cancellable) *FileAttributeInfoList) { | |
| 1064 | + | if cb == nil { | |
| 1065 | + | x.xQuerySettableAttributes = 0 | |
| 1066 | + | } else { | |
| 1067 | + | x.xQuerySettableAttributes = purego.NewCallback(func(FileVarp uintptr, CancellableVarp uintptr) *FileAttributeInfoList { | |
| 1068 | + | return cb(&FileBase{Ptr: FileVarp}, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 1069 | + | }) | |
| 1070 | + | } | |
| 1071 | + | } | |
| 1072 | + | ||
| 1073 | + | // GetQuerySettableAttributes gets the callback function. | |
| 1074 | + | func (x *FileIface) GetQuerySettableAttributes() func(File, *Cancellable) *FileAttributeInfoList { | |
| 1075 | + | if x.xQuerySettableAttributes == 0 { | |
| 1076 | + | return nil | |
| 1077 | + | } | |
| 1078 | + | var rawCallback func(FileVarp uintptr, CancellableVarp uintptr) *FileAttributeInfoList | |
| 1079 | + | purego.RegisterFunc(&rawCallback, x.xQuerySettableAttributes) | |
| 1080 | + | return func(FileVar File, CancellableVar *Cancellable) *FileAttributeInfoList { | |
| 1081 | + | return rawCallback(FileVar.GoPointer(), CancellableVar.GoPointer()) | |
| 1082 | + | } | |
| 1083 | + | } | |
| 1084 | + | ||
| 1085 | + | // OverrideQuerySettableAttributesAsync sets the callback function. | |
| 1086 | + | func (x *FileIface) OverrideQuerySettableAttributesAsync(cb func()) { | |
| 1087 | + | if cb == nil { | |
| 1088 | + | x.xQuerySettableAttributesAsync = 0 | |
| 1089 | + | } else { | |
| 1090 | + | x.xQuerySettableAttributesAsync = purego.NewCallback(func() { | |
| 1091 | + | cb() | |
| 1092 | + | }) | |
| 1093 | + | } | |
| 1094 | + | } | |
| 1095 | + | ||
| 1096 | + | // GetQuerySettableAttributesAsync gets the callback function. | |
| 1097 | + | func (x *FileIface) GetQuerySettableAttributesAsync() func() { | |
| 1098 | + | if x.xQuerySettableAttributesAsync == 0 { | |
| 1099 | + | return nil | |
| 1100 | + | } | |
| 1101 | + | var rawCallback func() | |
| 1102 | + | purego.RegisterFunc(&rawCallback, x.xQuerySettableAttributesAsync) | |
| 1103 | + | return func() { | |
| 1104 | + | rawCallback() | |
| 1105 | + | } | |
| 1106 | + | } | |
| 1107 | + | ||
| 1108 | + | // OverrideQuerySettableAttributesFinish sets the callback function. | |
| 1109 | + | func (x *FileIface) OverrideQuerySettableAttributesFinish(cb func()) { | |
| 1110 | + | if cb == nil { | |
| 1111 | + | x.xQuerySettableAttributesFinish = 0 | |
| 1112 | + | } else { | |
| 1113 | + | x.xQuerySettableAttributesFinish = purego.NewCallback(func() { | |
| 1114 | + | cb() | |
| 1115 | + | }) | |
| 1116 | + | } | |
| 1117 | + | } | |
| 1118 | + | ||
| 1119 | + | // GetQuerySettableAttributesFinish gets the callback function. | |
| 1120 | + | func (x *FileIface) GetQuerySettableAttributesFinish() func() { | |
| 1121 | + | if x.xQuerySettableAttributesFinish == 0 { | |
| 1122 | + | return nil | |
| 1123 | + | } | |
| 1124 | + | var rawCallback func() | |
| 1125 | + | purego.RegisterFunc(&rawCallback, x.xQuerySettableAttributesFinish) | |
| 1126 | + | return func() { | |
| 1127 | + | rawCallback() | |
| 1128 | + | } | |
| 1129 | + | } | |
| 1130 | + | ||
| 1131 | + | // OverrideQueryWritableNamespaces sets the callback function. | |
| 1132 | + | func (x *FileIface) OverrideQueryWritableNamespaces(cb func(File, *Cancellable) *FileAttributeInfoList) { | |
| 1133 | + | if cb == nil { | |
| 1134 | + | x.xQueryWritableNamespaces = 0 | |
| 1135 | + | } else { | |
| 1136 | + | x.xQueryWritableNamespaces = purego.NewCallback(func(FileVarp uintptr, CancellableVarp uintptr) *FileAttributeInfoList { | |
| 1137 | + | return cb(&FileBase{Ptr: FileVarp}, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 1138 | + | }) | |
| 1139 | + | } | |
| 1140 | + | } | |
| 1141 | + | ||
| 1142 | + | // GetQueryWritableNamespaces gets the callback function. | |
| 1143 | + | func (x *FileIface) GetQueryWritableNamespaces() func(File, *Cancellable) *FileAttributeInfoList { | |
| 1144 | + | if x.xQueryWritableNamespaces == 0 { | |
| 1145 | + | return nil | |
| 1146 | + | } | |
| 1147 | + | var rawCallback func(FileVarp uintptr, CancellableVarp uintptr) *FileAttributeInfoList | |
| 1148 | + | purego.RegisterFunc(&rawCallback, x.xQueryWritableNamespaces) | |
| 1149 | + | return func(FileVar File, CancellableVar *Cancellable) *FileAttributeInfoList { | |
| 1150 | + | return rawCallback(FileVar.GoPointer(), CancellableVar.GoPointer()) | |
| 1151 | + | } | |
| 1152 | + | } | |
| 1153 | + | ||
| 1154 | + | // OverrideQueryWritableNamespacesAsync sets the callback function. | |
| 1155 | + | func (x *FileIface) OverrideQueryWritableNamespacesAsync(cb func()) { | |
| 1156 | + | if cb == nil { | |
| 1157 | + | x.xQueryWritableNamespacesAsync = 0 | |
| 1158 | + | } else { | |
| 1159 | + | x.xQueryWritableNamespacesAsync = purego.NewCallback(func() { | |
| 1160 | + | cb() | |
| 1161 | + | }) | |
| 1162 | + | } | |
| 1163 | + | } | |
| 1164 | + | ||
| 1165 | + | // GetQueryWritableNamespacesAsync gets the callback function. | |
| 1166 | + | func (x *FileIface) GetQueryWritableNamespacesAsync() func() { | |
| 1167 | + | if x.xQueryWritableNamespacesAsync == 0 { | |
| 1168 | + | return nil | |
| 1169 | + | } | |
| 1170 | + | var rawCallback func() | |
| 1171 | + | purego.RegisterFunc(&rawCallback, x.xQueryWritableNamespacesAsync) | |
| 1172 | + | return func() { | |
| 1173 | + | rawCallback() | |
| 1174 | + | } | |
| 1175 | + | } | |
| 1176 | + | ||
| 1177 | + | // OverrideQueryWritableNamespacesFinish sets the callback function. | |
| 1178 | + | func (x *FileIface) OverrideQueryWritableNamespacesFinish(cb func()) { | |
| 1179 | + | if cb == nil { | |
| 1180 | + | x.xQueryWritableNamespacesFinish = 0 | |
| 1181 | + | } else { | |
| 1182 | + | x.xQueryWritableNamespacesFinish = purego.NewCallback(func() { | |
| 1183 | + | cb() | |
| 1184 | + | }) | |
| 1185 | + | } | |
| 1186 | + | } | |
| 1187 | + | ||
| 1188 | + | // GetQueryWritableNamespacesFinish gets the callback function. | |
| 1189 | + | func (x *FileIface) GetQueryWritableNamespacesFinish() func() { | |
| 1190 | + | if x.xQueryWritableNamespacesFinish == 0 { | |
| 1191 | + | return nil | |
| 1192 | + | } | |
| 1193 | + | var rawCallback func() | |
| 1194 | + | purego.RegisterFunc(&rawCallback, x.xQueryWritableNamespacesFinish) | |
| 1195 | + | return func() { | |
| 1196 | + | rawCallback() | |
| 1197 | + | } | |
| 1198 | + | } | |
| 1199 | + | ||
| 1200 | + | // OverrideSetAttribute sets the callback function. | |
| 1201 | + | func (x *FileIface) OverrideSetAttribute(cb func(File, string, FileAttributeType, uintptr, FileQueryInfoFlags, *Cancellable) bool) { | |
| 1202 | + | if cb == nil { | |
| 1203 | + | x.xSetAttribute = 0 | |
| 1204 | + | } else { | |
| 1205 | + | x.xSetAttribute = purego.NewCallback(func(FileVarp uintptr, AttributeVarp string, TypeVarp FileAttributeType, ValuePVarp uintptr, FlagsVarp FileQueryInfoFlags, CancellableVarp uintptr) bool { | |
| 1206 | + | return cb(&FileBase{Ptr: FileVarp}, AttributeVarp, TypeVarp, ValuePVarp, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 1207 | + | }) | |
| 1208 | + | } | |
| 1209 | + | } | |
| 1210 | + | ||
| 1211 | + | // GetSetAttribute gets the callback function. | |
| 1212 | + | func (x *FileIface) GetSetAttribute() func(File, string, FileAttributeType, uintptr, FileQueryInfoFlags, *Cancellable) bool { | |
| 1213 | + | if x.xSetAttribute == 0 { | |
| 1214 | + | return nil | |
| 1215 | + | } | |
| 1216 | + | var rawCallback func(FileVarp uintptr, AttributeVarp string, TypeVarp FileAttributeType, ValuePVarp uintptr, FlagsVarp FileQueryInfoFlags, CancellableVarp uintptr) bool | |
| 1217 | + | purego.RegisterFunc(&rawCallback, x.xSetAttribute) | |
| 1218 | + | return func(FileVar File, AttributeVar string, TypeVar FileAttributeType, ValuePVar uintptr, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool { | |
| 1219 | + | return rawCallback(FileVar.GoPointer(), AttributeVar, TypeVar, ValuePVar, FlagsVar, CancellableVar.GoPointer()) | |
| 1220 | + | } | |
| 1221 | + | } | |
| 1222 | + | ||
| 1223 | + | // OverrideSetAttributesFromInfo sets the callback function. | |
| 1224 | + | func (x *FileIface) OverrideSetAttributesFromInfo(cb func(File, *FileInfo, FileQueryInfoFlags, *Cancellable) bool) { | |
| 1225 | + | if cb == nil { | |
| 1226 | + | x.xSetAttributesFromInfo = 0 | |
| 1227 | + | } else { | |
| 1228 | + | x.xSetAttributesFromInfo = purego.NewCallback(func(FileVarp uintptr, InfoVarp uintptr, FlagsVarp FileQueryInfoFlags, CancellableVarp uintptr) bool { | |
| 1229 | + | return cb(&FileBase{Ptr: FileVarp}, FileInfoNewFromInternalPtr(InfoVarp), FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 1230 | + | }) | |
| 1231 | + | } | |
| 1232 | + | } | |
| 1233 | + | ||
| 1234 | + | // GetSetAttributesFromInfo gets the callback function. | |
| 1235 | + | func (x *FileIface) GetSetAttributesFromInfo() func(File, *FileInfo, FileQueryInfoFlags, *Cancellable) bool { | |
| 1236 | + | if x.xSetAttributesFromInfo == 0 { | |
| 1237 | + | return nil | |
| 1238 | + | } | |
| 1239 | + | var rawCallback func(FileVarp uintptr, InfoVarp uintptr, FlagsVarp FileQueryInfoFlags, CancellableVarp uintptr) bool | |
| 1240 | + | purego.RegisterFunc(&rawCallback, x.xSetAttributesFromInfo) | |
| 1241 | + | return func(FileVar File, InfoVar *FileInfo, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool { | |
| 1242 | + | return rawCallback(FileVar.GoPointer(), InfoVar.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 1243 | + | } | |
| 1244 | + | } | |
| 1245 | + | ||
| 1246 | + | // OverrideSetAttributesAsync sets the callback function. | |
| 1247 | + | func (x *FileIface) OverrideSetAttributesAsync(cb func(File, *FileInfo, FileQueryInfoFlags, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 1248 | + | if cb == nil { | |
| 1249 | + | x.xSetAttributesAsync = 0 | |
| 1250 | + | } else { | |
| 1251 | + | x.xSetAttributesAsync = purego.NewCallback(func(FileVarp uintptr, InfoVarp uintptr, FlagsVarp FileQueryInfoFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 1252 | + | cb(&FileBase{Ptr: FileVarp}, FileInfoNewFromInternalPtr(InfoVarp), FlagsVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 1253 | + | }) | |
| 1254 | + | } | |
| 1255 | + | } | |
| 1256 | + | ||
| 1257 | + | // GetSetAttributesAsync gets the callback function. | |
| 1258 | + | func (x *FileIface) GetSetAttributesAsync() func(File, *FileInfo, FileQueryInfoFlags, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 1259 | + | if x.xSetAttributesAsync == 0 { | |
| 1260 | + | return nil | |
| 1261 | + | } | |
| 1262 | + | var rawCallback func(FileVarp uintptr, InfoVarp uintptr, FlagsVarp FileQueryInfoFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 1263 | + | purego.RegisterFunc(&rawCallback, x.xSetAttributesAsync) | |
| 1264 | + | return func(FileVar File, InfoVar *FileInfo, FlagsVar FileQueryInfoFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1265 | + | rawCallback(FileVar.GoPointer(), InfoVar.GoPointer(), FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1266 | + | } | |
| 1267 | + | } | |
| 1268 | + | ||
| 1269 | + | // OverrideSetAttributesFinish sets the callback function. | |
| 1270 | + | func (x *FileIface) OverrideSetAttributesFinish(cb func(File, AsyncResult, **FileInfo) bool) { | |
| 1271 | + | if cb == nil { | |
| 1272 | + | x.xSetAttributesFinish = 0 | |
| 1273 | + | } else { | |
| 1274 | + | x.xSetAttributesFinish = purego.NewCallback(func(FileVarp uintptr, ResultVarp uintptr, InfoVarp uintptr) bool { | |
| 1275 | + | return cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResultVarp}, (**FileInfo)(unsafe.Pointer(InfoVarp))) | |
| 1276 | + | }) | |
| 1277 | + | } | |
| 1278 | + | } | |
| 1279 | + | ||
| 1280 | + | // GetSetAttributesFinish gets the callback function. | |
| 1281 | + | func (x *FileIface) GetSetAttributesFinish() func(File, AsyncResult, **FileInfo) bool { | |
| 1282 | + | if x.xSetAttributesFinish == 0 { | |
| 1283 | + | return nil | |
| 1284 | + | } | |
| 1285 | + | var rawCallback func(FileVarp uintptr, ResultVarp uintptr, InfoVarp uintptr) bool | |
| 1286 | + | purego.RegisterFunc(&rawCallback, x.xSetAttributesFinish) | |
| 1287 | + | return func(FileVar File, ResultVar AsyncResult, InfoVar **FileInfo) bool { | |
| 1288 | + | return rawCallback(FileVar.GoPointer(), ResultVar.GoPointer(), *gobject.ConvertPtr(InfoVar)) | |
| 1289 | + | } | |
| 1290 | + | } | |
| 1291 | + | ||
| 1292 | + | // OverrideReadFn sets the callback function. | |
| 1293 | + | func (x *FileIface) OverrideReadFn(cb func(File, *Cancellable) *FileInputStream) { | |
| 1294 | + | if cb == nil { | |
| 1295 | + | x.xReadFn = 0 | |
| 1296 | + | } else { | |
| 1297 | + | x.xReadFn = purego.NewCallback(func(FileVarp uintptr, CancellableVarp uintptr) uintptr { | |
| 1298 | + | ret := cb(&FileBase{Ptr: FileVarp}, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 1299 | + | if ret == nil { | |
| 1300 | + | return 0 | |
| 1301 | + | } | |
| 1302 | + | return ret.GoPointer() | |
| 1303 | + | }) | |
| 1304 | + | } | |
| 1305 | + | } | |
| 1306 | + | ||
| 1307 | + | // GetReadFn gets the callback function. | |
| 1308 | + | func (x *FileIface) GetReadFn() func(File, *Cancellable) *FileInputStream { | |
| 1309 | + | if x.xReadFn == 0 { | |
| 1310 | + | return nil | |
| 1311 | + | } | |
| 1312 | + | var rawCallback func(FileVarp uintptr, CancellableVarp uintptr) uintptr | |
| 1313 | + | purego.RegisterFunc(&rawCallback, x.xReadFn) | |
| 1314 | + | return func(FileVar File, CancellableVar *Cancellable) *FileInputStream { | |
| 1315 | + | rawRet := rawCallback(FileVar.GoPointer(), CancellableVar.GoPointer()) | |
| 1316 | + | if rawRet == 0 { | |
| 1317 | + | return nil | |
| 1318 | + | } | |
| 1319 | + | ret := &FileInputStream{} | |
| 1320 | + | ret.Ptr = rawRet | |
| 1321 | + | return ret | |
| 1322 | + | } | |
| 1323 | + | } | |
| 1324 | + | ||
| 1325 | + | // OverrideReadAsync sets the callback function. | |
| 1326 | + | func (x *FileIface) OverrideReadAsync(cb func(File, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 1327 | + | if cb == nil { | |
| 1328 | + | x.xReadAsync = 0 | |
| 1329 | + | } else { | |
| 1330 | + | x.xReadAsync = purego.NewCallback(func(FileVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 1331 | + | cb(&FileBase{Ptr: FileVarp}, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 1332 | + | }) | |
| 1333 | + | } | |
| 1334 | + | } | |
| 1335 | + | ||
| 1336 | + | // GetReadAsync gets the callback function. | |
| 1337 | + | func (x *FileIface) GetReadAsync() func(File, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 1338 | + | if x.xReadAsync == 0 { | |
| 1339 | + | return nil | |
| 1340 | + | } | |
| 1341 | + | var rawCallback func(FileVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 1342 | + | purego.RegisterFunc(&rawCallback, x.xReadAsync) | |
| 1343 | + | return func(FileVar File, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1344 | + | rawCallback(FileVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1345 | + | } | |
| 1346 | + | } | |
| 1347 | + | ||
| 1348 | + | // OverrideReadFinish sets the callback function. | |
| 1349 | + | func (x *FileIface) OverrideReadFinish(cb func(File, AsyncResult) *FileInputStream) { | |
| 1350 | + | if cb == nil { | |
| 1351 | + | x.xReadFinish = 0 | |
| 1352 | + | } else { | |
| 1353 | + | x.xReadFinish = purego.NewCallback(func(FileVarp uintptr, ResVarp uintptr) uintptr { | |
| 1354 | + | ret := cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResVarp}) | |
| 1355 | + | if ret == nil { | |
| 1356 | + | return 0 | |
| 1357 | + | } | |
| 1358 | + | return ret.GoPointer() | |
| 1359 | + | }) | |
| 1360 | + | } | |
| 1361 | + | } | |
| 1362 | + | ||
| 1363 | + | // GetReadFinish gets the callback function. | |
| 1364 | + | func (x *FileIface) GetReadFinish() func(File, AsyncResult) *FileInputStream { | |
| 1365 | + | if x.xReadFinish == 0 { | |
| 1366 | + | return nil | |
| 1367 | + | } | |
| 1368 | + | var rawCallback func(FileVarp uintptr, ResVarp uintptr) uintptr | |
| 1369 | + | purego.RegisterFunc(&rawCallback, x.xReadFinish) | |
| 1370 | + | return func(FileVar File, ResVar AsyncResult) *FileInputStream { | |
| 1371 | + | rawRet := rawCallback(FileVar.GoPointer(), ResVar.GoPointer()) | |
| 1372 | + | if rawRet == 0 { | |
| 1373 | + | return nil | |
| 1374 | + | } | |
| 1375 | + | ret := &FileInputStream{} | |
| 1376 | + | ret.Ptr = rawRet | |
| 1377 | + | return ret | |
| 1378 | + | } | |
| 1379 | + | } | |
| 1380 | + | ||
| 1381 | + | // OverrideAppendTo sets the callback function. | |
| 1382 | + | func (x *FileIface) OverrideAppendTo(cb func(File, FileCreateFlags, *Cancellable) *FileOutputStream) { | |
| 1383 | + | if cb == nil { | |
| 1384 | + | x.xAppendTo = 0 | |
| 1385 | + | } else { | |
| 1386 | + | x.xAppendTo = purego.NewCallback(func(FileVarp uintptr, FlagsVarp FileCreateFlags, CancellableVarp uintptr) uintptr { | |
| 1387 | + | ret := cb(&FileBase{Ptr: FileVarp}, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 1388 | + | if ret == nil { | |
| 1389 | + | return 0 | |
| 1390 | + | } | |
| 1391 | + | return ret.GoPointer() | |
| 1392 | + | }) | |
| 1393 | + | } | |
| 1394 | + | } | |
| 1395 | + | ||
| 1396 | + | // GetAppendTo gets the callback function. | |
| 1397 | + | func (x *FileIface) GetAppendTo() func(File, FileCreateFlags, *Cancellable) *FileOutputStream { | |
| 1398 | + | if x.xAppendTo == 0 { | |
| 1399 | + | return nil | |
| 1400 | + | } | |
| 1401 | + | var rawCallback func(FileVarp uintptr, FlagsVarp FileCreateFlags, CancellableVarp uintptr) uintptr | |
| 1402 | + | purego.RegisterFunc(&rawCallback, x.xAppendTo) | |
| 1403 | + | return func(FileVar File, FlagsVar FileCreateFlags, CancellableVar *Cancellable) *FileOutputStream { | |
| 1404 | + | rawRet := rawCallback(FileVar.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 1405 | + | if rawRet == 0 { | |
| 1406 | + | return nil | |
| 1407 | + | } | |
| 1408 | + | ret := &FileOutputStream{} | |
| 1409 | + | ret.Ptr = rawRet | |
| 1410 | + | return ret | |
| 1411 | + | } | |
| 1412 | + | } | |
| 1413 | + | ||
| 1414 | + | // OverrideAppendToAsync sets the callback function. | |
| 1415 | + | func (x *FileIface) OverrideAppendToAsync(cb func(File, FileCreateFlags, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 1416 | + | if cb == nil { | |
| 1417 | + | x.xAppendToAsync = 0 | |
| 1418 | + | } else { | |
| 1419 | + | x.xAppendToAsync = purego.NewCallback(func(FileVarp uintptr, FlagsVarp FileCreateFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 1420 | + | cb(&FileBase{Ptr: FileVarp}, FlagsVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 1421 | + | }) | |
| 1422 | + | } | |
| 1423 | + | } | |
| 1424 | + | ||
| 1425 | + | // GetAppendToAsync gets the callback function. | |
| 1426 | + | func (x *FileIface) GetAppendToAsync() func(File, FileCreateFlags, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 1427 | + | if x.xAppendToAsync == 0 { | |
| 1428 | + | return nil | |
| 1429 | + | } | |
| 1430 | + | var rawCallback func(FileVarp uintptr, FlagsVarp FileCreateFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 1431 | + | purego.RegisterFunc(&rawCallback, x.xAppendToAsync) | |
| 1432 | + | return func(FileVar File, FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1433 | + | rawCallback(FileVar.GoPointer(), FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1434 | + | } | |
| 1435 | + | } | |
| 1436 | + | ||
| 1437 | + | // OverrideAppendToFinish sets the callback function. | |
| 1438 | + | func (x *FileIface) OverrideAppendToFinish(cb func(File, AsyncResult) *FileOutputStream) { | |
| 1439 | + | if cb == nil { | |
| 1440 | + | x.xAppendToFinish = 0 | |
| 1441 | + | } else { | |
| 1442 | + | x.xAppendToFinish = purego.NewCallback(func(FileVarp uintptr, ResVarp uintptr) uintptr { | |
| 1443 | + | ret := cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResVarp}) | |
| 1444 | + | if ret == nil { | |
| 1445 | + | return 0 | |
| 1446 | + | } | |
| 1447 | + | return ret.GoPointer() | |
| 1448 | + | }) | |
| 1449 | + | } | |
| 1450 | + | } | |
| 1451 | + | ||
| 1452 | + | // GetAppendToFinish gets the callback function. | |
| 1453 | + | func (x *FileIface) GetAppendToFinish() func(File, AsyncResult) *FileOutputStream { | |
| 1454 | + | if x.xAppendToFinish == 0 { | |
| 1455 | + | return nil | |
| 1456 | + | } | |
| 1457 | + | var rawCallback func(FileVarp uintptr, ResVarp uintptr) uintptr | |
| 1458 | + | purego.RegisterFunc(&rawCallback, x.xAppendToFinish) | |
| 1459 | + | return func(FileVar File, ResVar AsyncResult) *FileOutputStream { | |
| 1460 | + | rawRet := rawCallback(FileVar.GoPointer(), ResVar.GoPointer()) | |
| 1461 | + | if rawRet == 0 { | |
| 1462 | + | return nil | |
| 1463 | + | } | |
| 1464 | + | ret := &FileOutputStream{} | |
| 1465 | + | ret.Ptr = rawRet | |
| 1466 | + | return ret | |
| 1467 | + | } | |
| 1468 | + | } | |
| 1469 | + | ||
| 1470 | + | // OverrideCreate sets the callback function. | |
| 1471 | + | func (x *FileIface) OverrideCreate(cb func(File, FileCreateFlags, *Cancellable) *FileOutputStream) { | |
| 1472 | + | if cb == nil { | |
| 1473 | + | x.xCreate = 0 | |
| 1474 | + | } else { | |
| 1475 | + | x.xCreate = purego.NewCallback(func(FileVarp uintptr, FlagsVarp FileCreateFlags, CancellableVarp uintptr) uintptr { | |
| 1476 | + | ret := cb(&FileBase{Ptr: FileVarp}, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 1477 | + | if ret == nil { | |
| 1478 | + | return 0 | |
| 1479 | + | } | |
| 1480 | + | return ret.GoPointer() | |
| 1481 | + | }) | |
| 1482 | + | } | |
| 1483 | + | } | |
| 1484 | + | ||
| 1485 | + | // GetCreate gets the callback function. | |
| 1486 | + | func (x *FileIface) GetCreate() func(File, FileCreateFlags, *Cancellable) *FileOutputStream { | |
| 1487 | + | if x.xCreate == 0 { | |
| 1488 | + | return nil | |
| 1489 | + | } | |
| 1490 | + | var rawCallback func(FileVarp uintptr, FlagsVarp FileCreateFlags, CancellableVarp uintptr) uintptr | |
| 1491 | + | purego.RegisterFunc(&rawCallback, x.xCreate) | |
| 1492 | + | return func(FileVar File, FlagsVar FileCreateFlags, CancellableVar *Cancellable) *FileOutputStream { | |
| 1493 | + | rawRet := rawCallback(FileVar.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 1494 | + | if rawRet == 0 { | |
| 1495 | + | return nil | |
| 1496 | + | } | |
| 1497 | + | ret := &FileOutputStream{} | |
| 1498 | + | ret.Ptr = rawRet | |
| 1499 | + | return ret | |
| 1500 | + | } | |
| 1501 | + | } | |
| 1502 | + | ||
| 1503 | + | // OverrideCreateAsync sets the callback function. | |
| 1504 | + | func (x *FileIface) OverrideCreateAsync(cb func(File, FileCreateFlags, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 1505 | + | if cb == nil { | |
| 1506 | + | x.xCreateAsync = 0 | |
| 1507 | + | } else { | |
| 1508 | + | x.xCreateAsync = purego.NewCallback(func(FileVarp uintptr, FlagsVarp FileCreateFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 1509 | + | cb(&FileBase{Ptr: FileVarp}, FlagsVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 1510 | + | }) | |
| 1511 | + | } | |
| 1512 | + | } | |
| 1513 | + | ||
| 1514 | + | // GetCreateAsync gets the callback function. | |
| 1515 | + | func (x *FileIface) GetCreateAsync() func(File, FileCreateFlags, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 1516 | + | if x.xCreateAsync == 0 { | |
| 1517 | + | return nil | |
| 1518 | + | } | |
| 1519 | + | var rawCallback func(FileVarp uintptr, FlagsVarp FileCreateFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 1520 | + | purego.RegisterFunc(&rawCallback, x.xCreateAsync) | |
| 1521 | + | return func(FileVar File, FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1522 | + | rawCallback(FileVar.GoPointer(), FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1523 | + | } | |
| 1524 | + | } | |
| 1525 | + | ||
| 1526 | + | // OverrideCreateFinish sets the callback function. | |
| 1527 | + | func (x *FileIface) OverrideCreateFinish(cb func(File, AsyncResult) *FileOutputStream) { | |
| 1528 | + | if cb == nil { | |
| 1529 | + | x.xCreateFinish = 0 | |
| 1530 | + | } else { | |
| 1531 | + | x.xCreateFinish = purego.NewCallback(func(FileVarp uintptr, ResVarp uintptr) uintptr { | |
| 1532 | + | ret := cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResVarp}) | |
| 1533 | + | if ret == nil { | |
| 1534 | + | return 0 | |
| 1535 | + | } | |
| 1536 | + | return ret.GoPointer() | |
| 1537 | + | }) | |
| 1538 | + | } | |
| 1539 | + | } | |
| 1540 | + | ||
| 1541 | + | // GetCreateFinish gets the callback function. | |
| 1542 | + | func (x *FileIface) GetCreateFinish() func(File, AsyncResult) *FileOutputStream { | |
| 1543 | + | if x.xCreateFinish == 0 { | |
| 1544 | + | return nil | |
| 1545 | + | } | |
| 1546 | + | var rawCallback func(FileVarp uintptr, ResVarp uintptr) uintptr | |
| 1547 | + | purego.RegisterFunc(&rawCallback, x.xCreateFinish) | |
| 1548 | + | return func(FileVar File, ResVar AsyncResult) *FileOutputStream { | |
| 1549 | + | rawRet := rawCallback(FileVar.GoPointer(), ResVar.GoPointer()) | |
| 1550 | + | if rawRet == 0 { | |
| 1551 | + | return nil | |
| 1552 | + | } | |
| 1553 | + | ret := &FileOutputStream{} | |
| 1554 | + | ret.Ptr = rawRet | |
| 1555 | + | return ret | |
| 1556 | + | } | |
| 1557 | + | } | |
| 1558 | + | ||
| 1559 | + | // OverrideReplace sets the callback function. | |
| 1560 | + | func (x *FileIface) OverrideReplace(cb func(File, string, bool, FileCreateFlags, *Cancellable) *FileOutputStream) { | |
| 1561 | + | if cb == nil { | |
| 1562 | + | x.xReplace = 0 | |
| 1563 | + | } else { | |
| 1564 | + | x.xReplace = purego.NewCallback(func(FileVarp uintptr, EtagVarp string, MakeBackupVarp bool, FlagsVarp FileCreateFlags, CancellableVarp uintptr) uintptr { | |
| 1565 | + | ret := cb(&FileBase{Ptr: FileVarp}, EtagVarp, MakeBackupVarp, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 1566 | + | if ret == nil { | |
| 1567 | + | return 0 | |
| 1568 | + | } | |
| 1569 | + | return ret.GoPointer() | |
| 1570 | + | }) | |
| 1571 | + | } | |
| 1572 | + | } | |
| 1573 | + | ||
| 1574 | + | // GetReplace gets the callback function. | |
| 1575 | + | func (x *FileIface) GetReplace() func(File, string, bool, FileCreateFlags, *Cancellable) *FileOutputStream { | |
| 1576 | + | if x.xReplace == 0 { | |
| 1577 | + | return nil | |
| 1578 | + | } | |
| 1579 | + | var rawCallback func(FileVarp uintptr, EtagVarp string, MakeBackupVarp bool, FlagsVarp FileCreateFlags, CancellableVarp uintptr) uintptr | |
| 1580 | + | purego.RegisterFunc(&rawCallback, x.xReplace) | |
| 1581 | + | return func(FileVar File, EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) *FileOutputStream { | |
| 1582 | + | rawRet := rawCallback(FileVar.GoPointer(), EtagVar, MakeBackupVar, FlagsVar, CancellableVar.GoPointer()) | |
| 1583 | + | if rawRet == 0 { | |
| 1584 | + | return nil | |
| 1585 | + | } | |
| 1586 | + | ret := &FileOutputStream{} | |
| 1587 | + | ret.Ptr = rawRet | |
| 1588 | + | return ret | |
| 1589 | + | } | |
| 1590 | + | } | |
| 1591 | + | ||
| 1592 | + | // OverrideReplaceAsync sets the callback function. | |
| 1593 | + | func (x *FileIface) OverrideReplaceAsync(cb func(File, string, bool, FileCreateFlags, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 1594 | + | if cb == nil { | |
| 1595 | + | x.xReplaceAsync = 0 | |
| 1596 | + | } else { | |
| 1597 | + | x.xReplaceAsync = purego.NewCallback(func(FileVarp uintptr, EtagVarp string, MakeBackupVarp bool, FlagsVarp FileCreateFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 1598 | + | cb(&FileBase{Ptr: FileVarp}, EtagVarp, MakeBackupVarp, FlagsVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 1599 | + | }) | |
| 1600 | + | } | |
| 1601 | + | } | |
| 1602 | + | ||
| 1603 | + | // GetReplaceAsync gets the callback function. | |
| 1604 | + | func (x *FileIface) GetReplaceAsync() func(File, string, bool, FileCreateFlags, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 1605 | + | if x.xReplaceAsync == 0 { | |
| 1606 | + | return nil | |
| 1607 | + | } | |
| 1608 | + | var rawCallback func(FileVarp uintptr, EtagVarp string, MakeBackupVarp bool, FlagsVarp FileCreateFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 1609 | + | purego.RegisterFunc(&rawCallback, x.xReplaceAsync) | |
| 1610 | + | return func(FileVar File, EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1611 | + | rawCallback(FileVar.GoPointer(), EtagVar, MakeBackupVar, FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1612 | + | } | |
| 1613 | + | } | |
| 1614 | + | ||
| 1615 | + | // OverrideReplaceFinish sets the callback function. | |
| 1616 | + | func (x *FileIface) OverrideReplaceFinish(cb func(File, AsyncResult) *FileOutputStream) { | |
| 1617 | + | if cb == nil { | |
| 1618 | + | x.xReplaceFinish = 0 | |
| 1619 | + | } else { | |
| 1620 | + | x.xReplaceFinish = purego.NewCallback(func(FileVarp uintptr, ResVarp uintptr) uintptr { | |
| 1621 | + | ret := cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResVarp}) | |
| 1622 | + | if ret == nil { | |
| 1623 | + | return 0 | |
| 1624 | + | } | |
| 1625 | + | return ret.GoPointer() | |
| 1626 | + | }) | |
| 1627 | + | } | |
| 1628 | + | } | |
| 1629 | + | ||
| 1630 | + | // GetReplaceFinish gets the callback function. | |
| 1631 | + | func (x *FileIface) GetReplaceFinish() func(File, AsyncResult) *FileOutputStream { | |
| 1632 | + | if x.xReplaceFinish == 0 { | |
| 1633 | + | return nil | |
| 1634 | + | } | |
| 1635 | + | var rawCallback func(FileVarp uintptr, ResVarp uintptr) uintptr | |
| 1636 | + | purego.RegisterFunc(&rawCallback, x.xReplaceFinish) | |
| 1637 | + | return func(FileVar File, ResVar AsyncResult) *FileOutputStream { | |
| 1638 | + | rawRet := rawCallback(FileVar.GoPointer(), ResVar.GoPointer()) | |
| 1639 | + | if rawRet == 0 { | |
| 1640 | + | return nil | |
| 1641 | + | } | |
| 1642 | + | ret := &FileOutputStream{} | |
| 1643 | + | ret.Ptr = rawRet | |
| 1644 | + | return ret | |
| 1645 | + | } | |
| 1646 | + | } | |
| 1647 | + | ||
| 1648 | + | // OverrideDeleteFile sets the callback function. | |
| 1649 | + | func (x *FileIface) OverrideDeleteFile(cb func(File, *Cancellable) bool) { | |
| 1650 | + | if cb == nil { | |
| 1651 | + | x.xDeleteFile = 0 | |
| 1652 | + | } else { | |
| 1653 | + | x.xDeleteFile = purego.NewCallback(func(FileVarp uintptr, CancellableVarp uintptr) bool { | |
| 1654 | + | return cb(&FileBase{Ptr: FileVarp}, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 1655 | + | }) | |
| 1656 | + | } | |
| 1657 | + | } | |
| 1658 | + | ||
| 1659 | + | // GetDeleteFile gets the callback function. | |
| 1660 | + | func (x *FileIface) GetDeleteFile() func(File, *Cancellable) bool { | |
| 1661 | + | if x.xDeleteFile == 0 { | |
| 1662 | + | return nil | |
| 1663 | + | } | |
| 1664 | + | var rawCallback func(FileVarp uintptr, CancellableVarp uintptr) bool | |
| 1665 | + | purego.RegisterFunc(&rawCallback, x.xDeleteFile) | |
| 1666 | + | return func(FileVar File, CancellableVar *Cancellable) bool { | |
| 1667 | + | return rawCallback(FileVar.GoPointer(), CancellableVar.GoPointer()) | |
| 1668 | + | } | |
| 1669 | + | } | |
| 1670 | + | ||
| 1671 | + | // OverrideDeleteFileAsync sets the callback function. | |
| 1672 | + | func (x *FileIface) OverrideDeleteFileAsync(cb func(File, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 1673 | + | if cb == nil { | |
| 1674 | + | x.xDeleteFileAsync = 0 | |
| 1675 | + | } else { | |
| 1676 | + | x.xDeleteFileAsync = purego.NewCallback(func(FileVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 1677 | + | cb(&FileBase{Ptr: FileVarp}, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 1678 | + | }) | |
| 1679 | + | } | |
| 1680 | + | } | |
| 1681 | + | ||
| 1682 | + | // GetDeleteFileAsync gets the callback function. | |
| 1683 | + | func (x *FileIface) GetDeleteFileAsync() func(File, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 1684 | + | if x.xDeleteFileAsync == 0 { | |
| 1685 | + | return nil | |
| 1686 | + | } | |
| 1687 | + | var rawCallback func(FileVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 1688 | + | purego.RegisterFunc(&rawCallback, x.xDeleteFileAsync) | |
| 1689 | + | return func(FileVar File, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1690 | + | rawCallback(FileVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1691 | + | } | |
| 1692 | + | } | |
| 1693 | + | ||
| 1694 | + | // OverrideDeleteFileFinish sets the callback function. | |
| 1695 | + | func (x *FileIface) OverrideDeleteFileFinish(cb func(File, AsyncResult) bool) { | |
| 1696 | + | if cb == nil { | |
| 1697 | + | x.xDeleteFileFinish = 0 | |
| 1698 | + | } else { | |
| 1699 | + | x.xDeleteFileFinish = purego.NewCallback(func(FileVarp uintptr, ResultVarp uintptr) bool { | |
| 1700 | + | return cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 1701 | + | }) | |
| 1702 | + | } | |
| 1703 | + | } | |
| 1704 | + | ||
| 1705 | + | // GetDeleteFileFinish gets the callback function. | |
| 1706 | + | func (x *FileIface) GetDeleteFileFinish() func(File, AsyncResult) bool { | |
| 1707 | + | if x.xDeleteFileFinish == 0 { | |
| 1708 | + | return nil | |
| 1709 | + | } | |
| 1710 | + | var rawCallback func(FileVarp uintptr, ResultVarp uintptr) bool | |
| 1711 | + | purego.RegisterFunc(&rawCallback, x.xDeleteFileFinish) | |
| 1712 | + | return func(FileVar File, ResultVar AsyncResult) bool { | |
| 1713 | + | return rawCallback(FileVar.GoPointer(), ResultVar.GoPointer()) | |
| 1714 | + | } | |
| 1715 | + | } | |
| 1716 | + | ||
| 1717 | + | // OverrideTrash sets the callback function. | |
| 1718 | + | func (x *FileIface) OverrideTrash(cb func(File, *Cancellable) bool) { | |
| 1719 | + | if cb == nil { | |
| 1720 | + | x.xTrash = 0 | |
| 1721 | + | } else { | |
| 1722 | + | x.xTrash = purego.NewCallback(func(FileVarp uintptr, CancellableVarp uintptr) bool { | |
| 1723 | + | return cb(&FileBase{Ptr: FileVarp}, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 1724 | + | }) | |
| 1725 | + | } | |
| 1726 | + | } | |
| 1727 | + | ||
| 1728 | + | // GetTrash gets the callback function. | |
| 1729 | + | func (x *FileIface) GetTrash() func(File, *Cancellable) bool { | |
| 1730 | + | if x.xTrash == 0 { | |
| 1731 | + | return nil | |
| 1732 | + | } | |
| 1733 | + | var rawCallback func(FileVarp uintptr, CancellableVarp uintptr) bool | |
| 1734 | + | purego.RegisterFunc(&rawCallback, x.xTrash) | |
| 1735 | + | return func(FileVar File, CancellableVar *Cancellable) bool { | |
| 1736 | + | return rawCallback(FileVar.GoPointer(), CancellableVar.GoPointer()) | |
| 1737 | + | } | |
| 1738 | + | } | |
| 1739 | + | ||
| 1740 | + | // OverrideTrashAsync sets the callback function. | |
| 1741 | + | func (x *FileIface) OverrideTrashAsync(cb func(File, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 1742 | + | if cb == nil { | |
| 1743 | + | x.xTrashAsync = 0 | |
| 1744 | + | } else { | |
| 1745 | + | x.xTrashAsync = purego.NewCallback(func(FileVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 1746 | + | cb(&FileBase{Ptr: FileVarp}, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 1747 | + | }) | |
| 1748 | + | } | |
| 1749 | + | } | |
| 1750 | + | ||
| 1751 | + | // GetTrashAsync gets the callback function. | |
| 1752 | + | func (x *FileIface) GetTrashAsync() func(File, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 1753 | + | if x.xTrashAsync == 0 { | |
| 1754 | + | return nil | |
| 1755 | + | } | |
| 1756 | + | var rawCallback func(FileVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 1757 | + | purego.RegisterFunc(&rawCallback, x.xTrashAsync) | |
| 1758 | + | return func(FileVar File, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1759 | + | rawCallback(FileVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1760 | + | } | |
| 1761 | + | } | |
| 1762 | + | ||
| 1763 | + | // OverrideTrashFinish sets the callback function. | |
| 1764 | + | func (x *FileIface) OverrideTrashFinish(cb func(File, AsyncResult) bool) { | |
| 1765 | + | if cb == nil { | |
| 1766 | + | x.xTrashFinish = 0 | |
| 1767 | + | } else { | |
| 1768 | + | x.xTrashFinish = purego.NewCallback(func(FileVarp uintptr, ResultVarp uintptr) bool { | |
| 1769 | + | return cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 1770 | + | }) | |
| 1771 | + | } | |
| 1772 | + | } | |
| 1773 | + | ||
| 1774 | + | // GetTrashFinish gets the callback function. | |
| 1775 | + | func (x *FileIface) GetTrashFinish() func(File, AsyncResult) bool { | |
| 1776 | + | if x.xTrashFinish == 0 { | |
| 1777 | + | return nil | |
| 1778 | + | } | |
| 1779 | + | var rawCallback func(FileVarp uintptr, ResultVarp uintptr) bool | |
| 1780 | + | purego.RegisterFunc(&rawCallback, x.xTrashFinish) | |
| 1781 | + | return func(FileVar File, ResultVar AsyncResult) bool { | |
| 1782 | + | return rawCallback(FileVar.GoPointer(), ResultVar.GoPointer()) | |
| 1783 | + | } | |
| 1784 | + | } | |
| 1785 | + | ||
| 1786 | + | // OverrideMakeDirectory sets the callback function. | |
| 1787 | + | func (x *FileIface) OverrideMakeDirectory(cb func(File, *Cancellable) bool) { | |
| 1788 | + | if cb == nil { | |
| 1789 | + | x.xMakeDirectory = 0 | |
| 1790 | + | } else { | |
| 1791 | + | x.xMakeDirectory = purego.NewCallback(func(FileVarp uintptr, CancellableVarp uintptr) bool { | |
| 1792 | + | return cb(&FileBase{Ptr: FileVarp}, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 1793 | + | }) | |
| 1794 | + | } | |
| 1795 | + | } | |
| 1796 | + | ||
| 1797 | + | // GetMakeDirectory gets the callback function. | |
| 1798 | + | func (x *FileIface) GetMakeDirectory() func(File, *Cancellable) bool { | |
| 1799 | + | if x.xMakeDirectory == 0 { | |
| 1800 | + | return nil | |
| 1801 | + | } | |
| 1802 | + | var rawCallback func(FileVarp uintptr, CancellableVarp uintptr) bool | |
| 1803 | + | purego.RegisterFunc(&rawCallback, x.xMakeDirectory) | |
| 1804 | + | return func(FileVar File, CancellableVar *Cancellable) bool { | |
| 1805 | + | return rawCallback(FileVar.GoPointer(), CancellableVar.GoPointer()) | |
| 1806 | + | } | |
| 1807 | + | } | |
| 1808 | + | ||
| 1809 | + | // OverrideMakeDirectoryAsync sets the callback function. | |
| 1810 | + | func (x *FileIface) OverrideMakeDirectoryAsync(cb func(File, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 1811 | + | if cb == nil { | |
| 1812 | + | x.xMakeDirectoryAsync = 0 | |
| 1813 | + | } else { | |
| 1814 | + | x.xMakeDirectoryAsync = purego.NewCallback(func(FileVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 1815 | + | cb(&FileBase{Ptr: FileVarp}, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 1816 | + | }) | |
| 1817 | + | } | |
| 1818 | + | } | |
| 1819 | + | ||
| 1820 | + | // GetMakeDirectoryAsync gets the callback function. | |
| 1821 | + | func (x *FileIface) GetMakeDirectoryAsync() func(File, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 1822 | + | if x.xMakeDirectoryAsync == 0 { | |
| 1823 | + | return nil | |
| 1824 | + | } | |
| 1825 | + | var rawCallback func(FileVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 1826 | + | purego.RegisterFunc(&rawCallback, x.xMakeDirectoryAsync) | |
| 1827 | + | return func(FileVar File, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1828 | + | rawCallback(FileVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1829 | + | } | |
| 1830 | + | } | |
| 1831 | + | ||
| 1832 | + | // OverrideMakeDirectoryFinish sets the callback function. | |
| 1833 | + | func (x *FileIface) OverrideMakeDirectoryFinish(cb func(File, AsyncResult) bool) { | |
| 1834 | + | if cb == nil { | |
| 1835 | + | x.xMakeDirectoryFinish = 0 | |
| 1836 | + | } else { | |
| 1837 | + | x.xMakeDirectoryFinish = purego.NewCallback(func(FileVarp uintptr, ResultVarp uintptr) bool { | |
| 1838 | + | return cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 1839 | + | }) | |
| 1840 | + | } | |
| 1841 | + | } | |
| 1842 | + | ||
| 1843 | + | // GetMakeDirectoryFinish gets the callback function. | |
| 1844 | + | func (x *FileIface) GetMakeDirectoryFinish() func(File, AsyncResult) bool { | |
| 1845 | + | if x.xMakeDirectoryFinish == 0 { | |
| 1846 | + | return nil | |
| 1847 | + | } | |
| 1848 | + | var rawCallback func(FileVarp uintptr, ResultVarp uintptr) bool | |
| 1849 | + | purego.RegisterFunc(&rawCallback, x.xMakeDirectoryFinish) | |
| 1850 | + | return func(FileVar File, ResultVar AsyncResult) bool { | |
| 1851 | + | return rawCallback(FileVar.GoPointer(), ResultVar.GoPointer()) | |
| 1852 | + | } | |
| 1853 | + | } | |
| 1854 | + | ||
| 1855 | + | // OverrideMakeSymbolicLink sets the callback function. | |
| 1856 | + | func (x *FileIface) OverrideMakeSymbolicLink(cb func(File, string, *Cancellable) bool) { | |
| 1857 | + | if cb == nil { | |
| 1858 | + | x.xMakeSymbolicLink = 0 | |
| 1859 | + | } else { | |
| 1860 | + | x.xMakeSymbolicLink = purego.NewCallback(func(FileVarp uintptr, SymlinkValueVarp string, CancellableVarp uintptr) bool { | |
| 1861 | + | return cb(&FileBase{Ptr: FileVarp}, SymlinkValueVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 1862 | + | }) | |
| 1863 | + | } | |
| 1864 | + | } | |
| 1865 | + | ||
| 1866 | + | // GetMakeSymbolicLink gets the callback function. | |
| 1867 | + | func (x *FileIface) GetMakeSymbolicLink() func(File, string, *Cancellable) bool { | |
| 1868 | + | if x.xMakeSymbolicLink == 0 { | |
| 1869 | + | return nil | |
| 1870 | + | } | |
| 1871 | + | var rawCallback func(FileVarp uintptr, SymlinkValueVarp string, CancellableVarp uintptr) bool | |
| 1872 | + | purego.RegisterFunc(&rawCallback, x.xMakeSymbolicLink) | |
| 1873 | + | return func(FileVar File, SymlinkValueVar string, CancellableVar *Cancellable) bool { | |
| 1874 | + | return rawCallback(FileVar.GoPointer(), SymlinkValueVar, CancellableVar.GoPointer()) | |
| 1875 | + | } | |
| 1876 | + | } | |
| 1877 | + | ||
| 1878 | + | // OverrideMakeSymbolicLinkAsync sets the callback function. | |
| 1879 | + | func (x *FileIface) OverrideMakeSymbolicLinkAsync(cb func()) { | |
| 1880 | + | if cb == nil { | |
| 1881 | + | x.xMakeSymbolicLinkAsync = 0 | |
| 1882 | + | } else { | |
| 1883 | + | x.xMakeSymbolicLinkAsync = purego.NewCallback(func() { | |
| 1884 | + | cb() | |
| 1885 | + | }) | |
| 1886 | + | } | |
| 1887 | + | } | |
| 1888 | + | ||
| 1889 | + | // GetMakeSymbolicLinkAsync gets the callback function. | |
| 1890 | + | func (x *FileIface) GetMakeSymbolicLinkAsync() func() { | |
| 1891 | + | if x.xMakeSymbolicLinkAsync == 0 { | |
| 1892 | + | return nil | |
| 1893 | + | } | |
| 1894 | + | var rawCallback func() | |
| 1895 | + | purego.RegisterFunc(&rawCallback, x.xMakeSymbolicLinkAsync) | |
| 1896 | + | return func() { | |
| 1897 | + | rawCallback() | |
| 1898 | + | } | |
| 1899 | + | } | |
| 1900 | + | ||
| 1901 | + | // OverrideMakeSymbolicLinkFinish sets the callback function. | |
| 1902 | + | func (x *FileIface) OverrideMakeSymbolicLinkFinish(cb func()) { | |
| 1903 | + | if cb == nil { | |
| 1904 | + | x.xMakeSymbolicLinkFinish = 0 | |
| 1905 | + | } else { | |
| 1906 | + | x.xMakeSymbolicLinkFinish = purego.NewCallback(func() { | |
| 1907 | + | cb() | |
| 1908 | + | }) | |
| 1909 | + | } | |
| 1910 | + | } | |
| 1911 | + | ||
| 1912 | + | // GetMakeSymbolicLinkFinish gets the callback function. | |
| 1913 | + | func (x *FileIface) GetMakeSymbolicLinkFinish() func() { | |
| 1914 | + | if x.xMakeSymbolicLinkFinish == 0 { | |
| 1915 | + | return nil | |
| 1916 | + | } | |
| 1917 | + | var rawCallback func() | |
| 1918 | + | purego.RegisterFunc(&rawCallback, x.xMakeSymbolicLinkFinish) | |
| 1919 | + | return func() { | |
| 1920 | + | rawCallback() | |
| 1921 | + | } | |
| 1922 | + | } | |
| 1923 | + | ||
| 1924 | + | // OverrideCopy sets the callback function. | |
| 1925 | + | func (x *FileIface) OverrideCopy(cb func(File, File, FileCopyFlags, *Cancellable, *FileProgressCallback, uintptr) bool) { | |
| 1926 | + | if cb == nil { | |
| 1927 | + | x.xCopy = 0 | |
| 1928 | + | } else { | |
| 1929 | + | x.xCopy = purego.NewCallback(func(SourceVarp uintptr, DestinationVarp uintptr, FlagsVarp FileCopyFlags, CancellableVarp uintptr, ProgressCallbackVarp uintptr, ProgressCallbackDataVarp uintptr) bool { | |
| 1930 | + | return cb(&FileBase{Ptr: SourceVarp}, &FileBase{Ptr: DestinationVarp}, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp), (*FileProgressCallback)(unsafe.Pointer(ProgressCallbackVarp)), ProgressCallbackDataVarp) | |
| 1931 | + | }) | |
| 1932 | + | } | |
| 1933 | + | } | |
| 1934 | + | ||
| 1935 | + | // GetCopy gets the callback function. | |
| 1936 | + | func (x *FileIface) GetCopy() func(File, File, FileCopyFlags, *Cancellable, *FileProgressCallback, uintptr) bool { | |
| 1937 | + | if x.xCopy == 0 { | |
| 1938 | + | return nil | |
| 1939 | + | } | |
| 1940 | + | var rawCallback func(SourceVarp uintptr, DestinationVarp uintptr, FlagsVarp FileCopyFlags, CancellableVarp uintptr, ProgressCallbackVarp uintptr, ProgressCallbackDataVarp uintptr) bool | |
| 1941 | + | purego.RegisterFunc(&rawCallback, x.xCopy) | |
| 1942 | + | return func(SourceVar File, DestinationVar File, FlagsVar FileCopyFlags, CancellableVar *Cancellable, ProgressCallbackVar *FileProgressCallback, ProgressCallbackDataVar uintptr) bool { | |
| 1943 | + | return rawCallback(SourceVar.GoPointer(), DestinationVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(ProgressCallbackVar), ProgressCallbackDataVar) | |
| 1944 | + | } | |
| 1945 | + | } | |
| 1946 | + | ||
| 1947 | + | // OverrideCopyAsync sets the callback function. | |
| 1948 | + | func (x *FileIface) OverrideCopyAsync(cb func(File, File, FileCopyFlags, int, *Cancellable, *FileProgressCallback, uintptr, *AsyncReadyCallback, uintptr)) { | |
| 1949 | + | if cb == nil { | |
| 1950 | + | x.xCopyAsync = 0 | |
| 1951 | + | } else { | |
| 1952 | + | x.xCopyAsync = purego.NewCallback(func(SourceVarp uintptr, DestinationVarp uintptr, FlagsVarp FileCopyFlags, IoPriorityVarp int, CancellableVarp uintptr, ProgressCallbackVarp uintptr, ProgressCallbackDataVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 1953 | + | cb(&FileBase{Ptr: SourceVarp}, &FileBase{Ptr: DestinationVarp}, FlagsVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*FileProgressCallback)(unsafe.Pointer(ProgressCallbackVarp)), ProgressCallbackDataVarp, (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 1954 | + | }) | |
| 1955 | + | } | |
| 1956 | + | } | |
| 1957 | + | ||
| 1958 | + | // GetCopyAsync gets the callback function. | |
| 1959 | + | func (x *FileIface) GetCopyAsync() func(File, File, FileCopyFlags, int, *Cancellable, *FileProgressCallback, uintptr, *AsyncReadyCallback, uintptr) { | |
| 1960 | + | if x.xCopyAsync == 0 { | |
| 1961 | + | return nil | |
| 1962 | + | } | |
| 1963 | + | var rawCallback func(SourceVarp uintptr, DestinationVarp uintptr, FlagsVarp FileCopyFlags, IoPriorityVarp int, CancellableVarp uintptr, ProgressCallbackVarp uintptr, ProgressCallbackDataVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 1964 | + | purego.RegisterFunc(&rawCallback, x.xCopyAsync) | |
| 1965 | + | return func(SourceVar File, DestinationVar File, FlagsVar FileCopyFlags, IoPriorityVar int, CancellableVar *Cancellable, ProgressCallbackVar *FileProgressCallback, ProgressCallbackDataVar uintptr, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1966 | + | rawCallback(SourceVar.GoPointer(), DestinationVar.GoPointer(), FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(ProgressCallbackVar), ProgressCallbackDataVar, glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1967 | + | } | |
| 1968 | + | } | |
| 1969 | + | ||
| 1970 | + | // OverrideCopyFinish sets the callback function. | |
| 1971 | + | func (x *FileIface) OverrideCopyFinish(cb func(File, AsyncResult) bool) { | |
| 1972 | + | if cb == nil { | |
| 1973 | + | x.xCopyFinish = 0 | |
| 1974 | + | } else { | |
| 1975 | + | x.xCopyFinish = purego.NewCallback(func(FileVarp uintptr, ResVarp uintptr) bool { | |
| 1976 | + | return cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResVarp}) | |
| 1977 | + | }) | |
| 1978 | + | } | |
| 1979 | + | } | |
| 1980 | + | ||
| 1981 | + | // GetCopyFinish gets the callback function. | |
| 1982 | + | func (x *FileIface) GetCopyFinish() func(File, AsyncResult) bool { | |
| 1983 | + | if x.xCopyFinish == 0 { | |
| 1984 | + | return nil | |
| 1985 | + | } | |
| 1986 | + | var rawCallback func(FileVarp uintptr, ResVarp uintptr) bool | |
| 1987 | + | purego.RegisterFunc(&rawCallback, x.xCopyFinish) | |
| 1988 | + | return func(FileVar File, ResVar AsyncResult) bool { | |
| 1989 | + | return rawCallback(FileVar.GoPointer(), ResVar.GoPointer()) | |
| 1990 | + | } | |
| 1991 | + | } | |
| 1992 | + | ||
| 1993 | + | // OverrideMove sets the callback function. | |
| 1994 | + | func (x *FileIface) OverrideMove(cb func(File, File, FileCopyFlags, *Cancellable, *FileProgressCallback, uintptr) bool) { | |
| 1995 | + | if cb == nil { | |
| 1996 | + | x.xMove = 0 | |
| 1997 | + | } else { | |
| 1998 | + | x.xMove = purego.NewCallback(func(SourceVarp uintptr, DestinationVarp uintptr, FlagsVarp FileCopyFlags, CancellableVarp uintptr, ProgressCallbackVarp uintptr, ProgressCallbackDataVarp uintptr) bool { | |
| 1999 | + | return cb(&FileBase{Ptr: SourceVarp}, &FileBase{Ptr: DestinationVarp}, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp), (*FileProgressCallback)(unsafe.Pointer(ProgressCallbackVarp)), ProgressCallbackDataVarp) | |
| 2000 | + | }) | |
| 2001 | + | } | |
| 2002 | + | } | |
| 2003 | + | ||
| 2004 | + | // GetMove gets the callback function. | |
| 2005 | + | func (x *FileIface) GetMove() func(File, File, FileCopyFlags, *Cancellable, *FileProgressCallback, uintptr) bool { | |
| 2006 | + | if x.xMove == 0 { | |
| 2007 | + | return nil | |
| 2008 | + | } | |
| 2009 | + | var rawCallback func(SourceVarp uintptr, DestinationVarp uintptr, FlagsVarp FileCopyFlags, CancellableVarp uintptr, ProgressCallbackVarp uintptr, ProgressCallbackDataVarp uintptr) bool | |
| 2010 | + | purego.RegisterFunc(&rawCallback, x.xMove) | |
| 2011 | + | return func(SourceVar File, DestinationVar File, FlagsVar FileCopyFlags, CancellableVar *Cancellable, ProgressCallbackVar *FileProgressCallback, ProgressCallbackDataVar uintptr) bool { | |
| 2012 | + | return rawCallback(SourceVar.GoPointer(), DestinationVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(ProgressCallbackVar), ProgressCallbackDataVar) | |
| 2013 | + | } | |
| 2014 | + | } | |
| 2015 | + | ||
| 2016 | + | // OverrideMoveAsync sets the callback function. | |
| 2017 | + | func (x *FileIface) OverrideMoveAsync(cb func(File, File, FileCopyFlags, int, *Cancellable, *FileProgressCallback, uintptr, *AsyncReadyCallback, uintptr)) { | |
| 2018 | + | if cb == nil { | |
| 2019 | + | x.xMoveAsync = 0 | |
| 2020 | + | } else { | |
| 2021 | + | x.xMoveAsync = purego.NewCallback(func(SourceVarp uintptr, DestinationVarp uintptr, FlagsVarp FileCopyFlags, IoPriorityVarp int, CancellableVarp uintptr, ProgressCallbackVarp uintptr, ProgressCallbackDataVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 2022 | + | cb(&FileBase{Ptr: SourceVarp}, &FileBase{Ptr: DestinationVarp}, FlagsVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*FileProgressCallback)(unsafe.Pointer(ProgressCallbackVarp)), ProgressCallbackDataVarp, (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 2023 | + | }) | |
| 2024 | + | } | |
| 2025 | + | } | |
| 2026 | + | ||
| 2027 | + | // GetMoveAsync gets the callback function. | |
| 2028 | + | func (x *FileIface) GetMoveAsync() func(File, File, FileCopyFlags, int, *Cancellable, *FileProgressCallback, uintptr, *AsyncReadyCallback, uintptr) { | |
| 2029 | + | if x.xMoveAsync == 0 { | |
| 2030 | + | return nil | |
| 2031 | + | } | |
| 2032 | + | var rawCallback func(SourceVarp uintptr, DestinationVarp uintptr, FlagsVarp FileCopyFlags, IoPriorityVarp int, CancellableVarp uintptr, ProgressCallbackVarp uintptr, ProgressCallbackDataVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 2033 | + | purego.RegisterFunc(&rawCallback, x.xMoveAsync) | |
| 2034 | + | return func(SourceVar File, DestinationVar File, FlagsVar FileCopyFlags, IoPriorityVar int, CancellableVar *Cancellable, ProgressCallbackVar *FileProgressCallback, ProgressCallbackDataVar uintptr, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 2035 | + | rawCallback(SourceVar.GoPointer(), DestinationVar.GoPointer(), FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(ProgressCallbackVar), ProgressCallbackDataVar, glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 2036 | + | } | |
| 2037 | + | } | |
| 2038 | + | ||
| 2039 | + | // OverrideMoveFinish sets the callback function. | |
| 2040 | + | func (x *FileIface) OverrideMoveFinish(cb func(File, AsyncResult) bool) { | |
| 2041 | + | if cb == nil { | |
| 2042 | + | x.xMoveFinish = 0 | |
| 2043 | + | } else { | |
| 2044 | + | x.xMoveFinish = purego.NewCallback(func(FileVarp uintptr, ResultVarp uintptr) bool { | |
| 2045 | + | return cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 2046 | + | }) | |
| 2047 | + | } | |
| 2048 | + | } | |
| 2049 | + | ||
| 2050 | + | // GetMoveFinish gets the callback function. | |
| 2051 | + | func (x *FileIface) GetMoveFinish() func(File, AsyncResult) bool { | |
| 2052 | + | if x.xMoveFinish == 0 { | |
| 2053 | + | return nil | |
| 2054 | + | } | |
| 2055 | + | var rawCallback func(FileVarp uintptr, ResultVarp uintptr) bool | |
| 2056 | + | purego.RegisterFunc(&rawCallback, x.xMoveFinish) | |
| 2057 | + | return func(FileVar File, ResultVar AsyncResult) bool { | |
| 2058 | + | return rawCallback(FileVar.GoPointer(), ResultVar.GoPointer()) | |
| 2059 | + | } | |
| 2060 | + | } | |
| 2061 | + | ||
| 2062 | + | // OverrideMountMountable sets the callback function. | |
| 2063 | + | func (x *FileIface) OverrideMountMountable(cb func(File, MountMountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 2064 | + | if cb == nil { | |
| 2065 | + | x.xMountMountable = 0 | |
| 2066 | + | } else { | |
| 2067 | + | x.xMountMountable = purego.NewCallback(func(FileVarp uintptr, FlagsVarp MountMountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 2068 | + | cb(&FileBase{Ptr: FileVarp}, FlagsVarp, MountOperationNewFromInternalPtr(MountOperationVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 2069 | + | }) | |
| 2070 | + | } | |
| 2071 | + | } | |
| 2072 | + | ||
| 2073 | + | // GetMountMountable gets the callback function. | |
| 2074 | + | func (x *FileIface) GetMountMountable() func(File, MountMountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 2075 | + | if x.xMountMountable == 0 { | |
| 2076 | + | return nil | |
| 2077 | + | } | |
| 2078 | + | var rawCallback func(FileVarp uintptr, FlagsVarp MountMountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 2079 | + | purego.RegisterFunc(&rawCallback, x.xMountMountable) | |
| 2080 | + | return func(FileVar File, FlagsVar MountMountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 2081 | + | rawCallback(FileVar.GoPointer(), FlagsVar, MountOperationVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 2082 | + | } | |
| 2083 | + | } | |
| 2084 | + | ||
| 2085 | + | // OverrideMountMountableFinish sets the callback function. | |
| 2086 | + | func (x *FileIface) OverrideMountMountableFinish(cb func(File, AsyncResult) *FileBase) { | |
| 2087 | + | if cb == nil { | |
| 2088 | + | x.xMountMountableFinish = 0 | |
| 2089 | + | } else { | |
| 2090 | + | x.xMountMountableFinish = purego.NewCallback(func(FileVarp uintptr, ResultVarp uintptr) uintptr { | |
| 2091 | + | ret := cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 2092 | + | if ret == nil { | |
| 2093 | + | return 0 | |
| 2094 | + | } | |
| 2095 | + | return ret.GoPointer() | |
| 2096 | + | }) | |
| 2097 | + | } | |
| 2098 | + | } | |
| 2099 | + | ||
| 2100 | + | // GetMountMountableFinish gets the callback function. | |
| 2101 | + | func (x *FileIface) GetMountMountableFinish() func(File, AsyncResult) *FileBase { | |
| 2102 | + | if x.xMountMountableFinish == 0 { | |
| 2103 | + | return nil | |
| 2104 | + | } | |
| 2105 | + | var rawCallback func(FileVarp uintptr, ResultVarp uintptr) uintptr | |
| 2106 | + | purego.RegisterFunc(&rawCallback, x.xMountMountableFinish) | |
| 2107 | + | return func(FileVar File, ResultVar AsyncResult) *FileBase { | |
| 2108 | + | rawRet := rawCallback(FileVar.GoPointer(), ResultVar.GoPointer()) | |
| 2109 | + | if rawRet == 0 { | |
| 2110 | + | return nil | |
| 2111 | + | } | |
| 2112 | + | ret := &FileBase{} | |
| 2113 | + | ret.Ptr = rawRet | |
| 2114 | + | return ret | |
| 2115 | + | } | |
| 2116 | + | } | |
| 2117 | + | ||
| 2118 | + | // OverrideUnmountMountable sets the callback function. | |
| 2119 | + | func (x *FileIface) OverrideUnmountMountable(cb func(File, MountUnmountFlags, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 2120 | + | if cb == nil { | |
| 2121 | + | x.xUnmountMountable = 0 | |
| 2122 | + | } else { | |
| 2123 | + | x.xUnmountMountable = purego.NewCallback(func(FileVarp uintptr, FlagsVarp MountUnmountFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 2124 | + | cb(&FileBase{Ptr: FileVarp}, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 2125 | + | }) | |
| 2126 | + | } | |
| 2127 | + | } | |
| 2128 | + | ||
| 2129 | + | // GetUnmountMountable gets the callback function. | |
| 2130 | + | func (x *FileIface) GetUnmountMountable() func(File, MountUnmountFlags, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 2131 | + | if x.xUnmountMountable == 0 { | |
| 2132 | + | return nil | |
| 2133 | + | } | |
| 2134 | + | var rawCallback func(FileVarp uintptr, FlagsVarp MountUnmountFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 2135 | + | purego.RegisterFunc(&rawCallback, x.xUnmountMountable) | |
| 2136 | + | return func(FileVar File, FlagsVar MountUnmountFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 2137 | + | rawCallback(FileVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 2138 | + | } | |
| 2139 | + | } | |
| 2140 | + | ||
| 2141 | + | // OverrideUnmountMountableFinish sets the callback function. | |
| 2142 | + | func (x *FileIface) OverrideUnmountMountableFinish(cb func(File, AsyncResult) bool) { | |
| 2143 | + | if cb == nil { | |
| 2144 | + | x.xUnmountMountableFinish = 0 | |
| 2145 | + | } else { | |
| 2146 | + | x.xUnmountMountableFinish = purego.NewCallback(func(FileVarp uintptr, ResultVarp uintptr) bool { | |
| 2147 | + | return cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 2148 | + | }) | |
| 2149 | + | } | |
| 2150 | + | } | |
| 2151 | + | ||
| 2152 | + | // GetUnmountMountableFinish gets the callback function. | |
| 2153 | + | func (x *FileIface) GetUnmountMountableFinish() func(File, AsyncResult) bool { | |
| 2154 | + | if x.xUnmountMountableFinish == 0 { | |
| 2155 | + | return nil | |
| 2156 | + | } | |
| 2157 | + | var rawCallback func(FileVarp uintptr, ResultVarp uintptr) bool | |
| 2158 | + | purego.RegisterFunc(&rawCallback, x.xUnmountMountableFinish) | |
| 2159 | + | return func(FileVar File, ResultVar AsyncResult) bool { | |
| 2160 | + | return rawCallback(FileVar.GoPointer(), ResultVar.GoPointer()) | |
| 2161 | + | } | |
| 2162 | + | } | |
| 2163 | + | ||
| 2164 | + | // OverrideEjectMountable sets the callback function. | |
| 2165 | + | func (x *FileIface) OverrideEjectMountable(cb func(File, MountUnmountFlags, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 2166 | + | if cb == nil { | |
| 2167 | + | x.xEjectMountable = 0 | |
| 2168 | + | } else { | |
| 2169 | + | x.xEjectMountable = purego.NewCallback(func(FileVarp uintptr, FlagsVarp MountUnmountFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 2170 | + | cb(&FileBase{Ptr: FileVarp}, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 2171 | + | }) | |
| 2172 | + | } | |
| 2173 | + | } | |
| 2174 | + | ||
| 2175 | + | // GetEjectMountable gets the callback function. | |
| 2176 | + | func (x *FileIface) GetEjectMountable() func(File, MountUnmountFlags, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 2177 | + | if x.xEjectMountable == 0 { | |
| 2178 | + | return nil | |
| 2179 | + | } | |
| 2180 | + | var rawCallback func(FileVarp uintptr, FlagsVarp MountUnmountFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 2181 | + | purego.RegisterFunc(&rawCallback, x.xEjectMountable) | |
| 2182 | + | return func(FileVar File, FlagsVar MountUnmountFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 2183 | + | rawCallback(FileVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 2184 | + | } | |
| 2185 | + | } | |
| 2186 | + | ||
| 2187 | + | // OverrideEjectMountableFinish sets the callback function. | |
| 2188 | + | func (x *FileIface) OverrideEjectMountableFinish(cb func(File, AsyncResult) bool) { | |
| 2189 | + | if cb == nil { | |
| 2190 | + | x.xEjectMountableFinish = 0 | |
| 2191 | + | } else { | |
| 2192 | + | x.xEjectMountableFinish = purego.NewCallback(func(FileVarp uintptr, ResultVarp uintptr) bool { | |
| 2193 | + | return cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 2194 | + | }) | |
| 2195 | + | } | |
| 2196 | + | } | |
| 2197 | + | ||
| 2198 | + | // GetEjectMountableFinish gets the callback function. | |
| 2199 | + | func (x *FileIface) GetEjectMountableFinish() func(File, AsyncResult) bool { | |
| 2200 | + | if x.xEjectMountableFinish == 0 { | |
| 2201 | + | return nil | |
| 2202 | + | } | |
| 2203 | + | var rawCallback func(FileVarp uintptr, ResultVarp uintptr) bool | |
| 2204 | + | purego.RegisterFunc(&rawCallback, x.xEjectMountableFinish) | |
| 2205 | + | return func(FileVar File, ResultVar AsyncResult) bool { | |
| 2206 | + | return rawCallback(FileVar.GoPointer(), ResultVar.GoPointer()) | |
| 2207 | + | } | |
| 2208 | + | } | |
| 2209 | + | ||
| 2210 | + | // OverrideMountEnclosingVolume sets the callback function. | |
| 2211 | + | func (x *FileIface) OverrideMountEnclosingVolume(cb func(File, MountMountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 2212 | + | if cb == nil { | |
| 2213 | + | x.xMountEnclosingVolume = 0 | |
| 2214 | + | } else { | |
| 2215 | + | x.xMountEnclosingVolume = purego.NewCallback(func(LocationVarp uintptr, FlagsVarp MountMountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 2216 | + | cb(&FileBase{Ptr: LocationVarp}, FlagsVarp, MountOperationNewFromInternalPtr(MountOperationVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 2217 | + | }) | |
| 2218 | + | } | |
| 2219 | + | } | |
| 2220 | + | ||
| 2221 | + | // GetMountEnclosingVolume gets the callback function. | |
| 2222 | + | func (x *FileIface) GetMountEnclosingVolume() func(File, MountMountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 2223 | + | if x.xMountEnclosingVolume == 0 { | |
| 2224 | + | return nil | |
| 2225 | + | } | |
| 2226 | + | var rawCallback func(LocationVarp uintptr, FlagsVarp MountMountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 2227 | + | purego.RegisterFunc(&rawCallback, x.xMountEnclosingVolume) | |
| 2228 | + | return func(LocationVar File, FlagsVar MountMountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 2229 | + | rawCallback(LocationVar.GoPointer(), FlagsVar, MountOperationVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 2230 | + | } | |
| 2231 | + | } | |
| 2232 | + | ||
| 2233 | + | // OverrideMountEnclosingVolumeFinish sets the callback function. | |
| 2234 | + | func (x *FileIface) OverrideMountEnclosingVolumeFinish(cb func(File, AsyncResult) bool) { | |
| 2235 | + | if cb == nil { | |
| 2236 | + | x.xMountEnclosingVolumeFinish = 0 | |
| 2237 | + | } else { | |
| 2238 | + | x.xMountEnclosingVolumeFinish = purego.NewCallback(func(LocationVarp uintptr, ResultVarp uintptr) bool { | |
| 2239 | + | return cb(&FileBase{Ptr: LocationVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 2240 | + | }) | |
| 2241 | + | } | |
| 2242 | + | } | |
| 2243 | + | ||
| 2244 | + | // GetMountEnclosingVolumeFinish gets the callback function. | |
| 2245 | + | func (x *FileIface) GetMountEnclosingVolumeFinish() func(File, AsyncResult) bool { | |
| 2246 | + | if x.xMountEnclosingVolumeFinish == 0 { | |
| 2247 | + | return nil | |
| 2248 | + | } | |
| 2249 | + | var rawCallback func(LocationVarp uintptr, ResultVarp uintptr) bool | |
| 2250 | + | purego.RegisterFunc(&rawCallback, x.xMountEnclosingVolumeFinish) | |
| 2251 | + | return func(LocationVar File, ResultVar AsyncResult) bool { | |
| 2252 | + | return rawCallback(LocationVar.GoPointer(), ResultVar.GoPointer()) | |
| 2253 | + | } | |
| 2254 | + | } | |
| 2255 | + | ||
| 2256 | + | // OverrideMonitorDir sets the callback function. | |
| 2257 | + | func (x *FileIface) OverrideMonitorDir(cb func(File, FileMonitorFlags, *Cancellable) *FileMonitor) { | |
| 2258 | + | if cb == nil { | |
| 2259 | + | x.xMonitorDir = 0 | |
| 2260 | + | } else { | |
| 2261 | + | x.xMonitorDir = purego.NewCallback(func(FileVarp uintptr, FlagsVarp FileMonitorFlags, CancellableVarp uintptr) uintptr { | |
| 2262 | + | ret := cb(&FileBase{Ptr: FileVarp}, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 2263 | + | if ret == nil { | |
| 2264 | + | return 0 | |
| 2265 | + | } | |
| 2266 | + | return ret.GoPointer() | |
| 2267 | + | }) | |
| 2268 | + | } | |
| 2269 | + | } | |
| 2270 | + | ||
| 2271 | + | // GetMonitorDir gets the callback function. | |
| 2272 | + | func (x *FileIface) GetMonitorDir() func(File, FileMonitorFlags, *Cancellable) *FileMonitor { | |
| 2273 | + | if x.xMonitorDir == 0 { | |
| 2274 | + | return nil | |
| 2275 | + | } | |
| 2276 | + | var rawCallback func(FileVarp uintptr, FlagsVarp FileMonitorFlags, CancellableVarp uintptr) uintptr | |
| 2277 | + | purego.RegisterFunc(&rawCallback, x.xMonitorDir) | |
| 2278 | + | return func(FileVar File, FlagsVar FileMonitorFlags, CancellableVar *Cancellable) *FileMonitor { | |
| 2279 | + | rawRet := rawCallback(FileVar.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 2280 | + | if rawRet == 0 { | |
| 2281 | + | return nil | |
| 2282 | + | } | |
| 2283 | + | ret := &FileMonitor{} | |
| 2284 | + | ret.Ptr = rawRet | |
| 2285 | + | return ret | |
| 2286 | + | } | |
| 2287 | + | } | |
| 2288 | + | ||
| 2289 | + | // OverrideMonitorFile sets the callback function. | |
| 2290 | + | func (x *FileIface) OverrideMonitorFile(cb func(File, FileMonitorFlags, *Cancellable) *FileMonitor) { | |
| 2291 | + | if cb == nil { | |
| 2292 | + | x.xMonitorFile = 0 | |
| 2293 | + | } else { | |
| 2294 | + | x.xMonitorFile = purego.NewCallback(func(FileVarp uintptr, FlagsVarp FileMonitorFlags, CancellableVarp uintptr) uintptr { | |
| 2295 | + | ret := cb(&FileBase{Ptr: FileVarp}, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 2296 | + | if ret == nil { | |
| 2297 | + | return 0 | |
| 2298 | + | } | |
| 2299 | + | return ret.GoPointer() | |
| 2300 | + | }) | |
| 2301 | + | } | |
| 2302 | + | } | |
| 2303 | + | ||
| 2304 | + | // GetMonitorFile gets the callback function. | |
| 2305 | + | func (x *FileIface) GetMonitorFile() func(File, FileMonitorFlags, *Cancellable) *FileMonitor { | |
| 2306 | + | if x.xMonitorFile == 0 { | |
| 2307 | + | return nil | |
| 2308 | + | } | |
| 2309 | + | var rawCallback func(FileVarp uintptr, FlagsVarp FileMonitorFlags, CancellableVarp uintptr) uintptr | |
| 2310 | + | purego.RegisterFunc(&rawCallback, x.xMonitorFile) | |
| 2311 | + | return func(FileVar File, FlagsVar FileMonitorFlags, CancellableVar *Cancellable) *FileMonitor { | |
| 2312 | + | rawRet := rawCallback(FileVar.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 2313 | + | if rawRet == 0 { | |
| 2314 | + | return nil | |
| 2315 | + | } | |
| 2316 | + | ret := &FileMonitor{} | |
| 2317 | + | ret.Ptr = rawRet | |
| 2318 | + | return ret | |
| 2319 | + | } | |
| 2320 | + | } | |
| 2321 | + | ||
| 2322 | + | // OverrideOpenReadwrite sets the callback function. | |
| 2323 | + | func (x *FileIface) OverrideOpenReadwrite(cb func(File, *Cancellable) *FileIOStream) { | |
| 2324 | + | if cb == nil { | |
| 2325 | + | x.xOpenReadwrite = 0 | |
| 2326 | + | } else { | |
| 2327 | + | x.xOpenReadwrite = purego.NewCallback(func(FileVarp uintptr, CancellableVarp uintptr) uintptr { | |
| 2328 | + | ret := cb(&FileBase{Ptr: FileVarp}, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 2329 | + | if ret == nil { | |
| 2330 | + | return 0 | |
| 2331 | + | } | |
| 2332 | + | return ret.GoPointer() | |
| 2333 | + | }) | |
| 2334 | + | } | |
| 2335 | + | } | |
| 2336 | + | ||
| 2337 | + | // GetOpenReadwrite gets the callback function. | |
| 2338 | + | func (x *FileIface) GetOpenReadwrite() func(File, *Cancellable) *FileIOStream { | |
| 2339 | + | if x.xOpenReadwrite == 0 { | |
| 2340 | + | return nil | |
| 2341 | + | } | |
| 2342 | + | var rawCallback func(FileVarp uintptr, CancellableVarp uintptr) uintptr | |
| 2343 | + | purego.RegisterFunc(&rawCallback, x.xOpenReadwrite) | |
| 2344 | + | return func(FileVar File, CancellableVar *Cancellable) *FileIOStream { | |
| 2345 | + | rawRet := rawCallback(FileVar.GoPointer(), CancellableVar.GoPointer()) | |
| 2346 | + | if rawRet == 0 { | |
| 2347 | + | return nil | |
| 2348 | + | } | |
| 2349 | + | ret := &FileIOStream{} | |
| 2350 | + | ret.Ptr = rawRet | |
| 2351 | + | return ret | |
| 2352 | + | } | |
| 2353 | + | } | |
| 2354 | + | ||
| 2355 | + | // OverrideOpenReadwriteAsync sets the callback function. | |
| 2356 | + | func (x *FileIface) OverrideOpenReadwriteAsync(cb func(File, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 2357 | + | if cb == nil { | |
| 2358 | + | x.xOpenReadwriteAsync = 0 | |
| 2359 | + | } else { | |
| 2360 | + | x.xOpenReadwriteAsync = purego.NewCallback(func(FileVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 2361 | + | cb(&FileBase{Ptr: FileVarp}, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 2362 | + | }) | |
| 2363 | + | } | |
| 2364 | + | } | |
| 2365 | + | ||
| 2366 | + | // GetOpenReadwriteAsync gets the callback function. | |
| 2367 | + | func (x *FileIface) GetOpenReadwriteAsync() func(File, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 2368 | + | if x.xOpenReadwriteAsync == 0 { | |
| 2369 | + | return nil | |
| 2370 | + | } | |
| 2371 | + | var rawCallback func(FileVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 2372 | + | purego.RegisterFunc(&rawCallback, x.xOpenReadwriteAsync) | |
| 2373 | + | return func(FileVar File, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 2374 | + | rawCallback(FileVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 2375 | + | } | |
| 2376 | + | } | |
| 2377 | + | ||
| 2378 | + | // OverrideOpenReadwriteFinish sets the callback function. | |
| 2379 | + | func (x *FileIface) OverrideOpenReadwriteFinish(cb func(File, AsyncResult) *FileIOStream) { | |
| 2380 | + | if cb == nil { | |
| 2381 | + | x.xOpenReadwriteFinish = 0 | |
| 2382 | + | } else { | |
| 2383 | + | x.xOpenReadwriteFinish = purego.NewCallback(func(FileVarp uintptr, ResVarp uintptr) uintptr { | |
| 2384 | + | ret := cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResVarp}) | |
| 2385 | + | if ret == nil { | |
| 2386 | + | return 0 | |
| 2387 | + | } | |
| 2388 | + | return ret.GoPointer() | |
| 2389 | + | }) | |
| 2390 | + | } | |
| 2391 | + | } | |
| 2392 | + | ||
| 2393 | + | // GetOpenReadwriteFinish gets the callback function. | |
| 2394 | + | func (x *FileIface) GetOpenReadwriteFinish() func(File, AsyncResult) *FileIOStream { | |
| 2395 | + | if x.xOpenReadwriteFinish == 0 { | |
| 2396 | + | return nil | |
| 2397 | + | } | |
| 2398 | + | var rawCallback func(FileVarp uintptr, ResVarp uintptr) uintptr | |
| 2399 | + | purego.RegisterFunc(&rawCallback, x.xOpenReadwriteFinish) | |
| 2400 | + | return func(FileVar File, ResVar AsyncResult) *FileIOStream { | |
| 2401 | + | rawRet := rawCallback(FileVar.GoPointer(), ResVar.GoPointer()) | |
| 2402 | + | if rawRet == 0 { | |
| 2403 | + | return nil | |
| 2404 | + | } | |
| 2405 | + | ret := &FileIOStream{} | |
| 2406 | + | ret.Ptr = rawRet | |
| 2407 | + | return ret | |
| 2408 | + | } | |
| 2409 | + | } | |
| 2410 | + | ||
| 2411 | + | // OverrideCreateReadwrite sets the callback function. | |
| 2412 | + | func (x *FileIface) OverrideCreateReadwrite(cb func(File, FileCreateFlags, *Cancellable) *FileIOStream) { | |
| 2413 | + | if cb == nil { | |
| 2414 | + | x.xCreateReadwrite = 0 | |
| 2415 | + | } else { | |
| 2416 | + | x.xCreateReadwrite = purego.NewCallback(func(FileVarp uintptr, FlagsVarp FileCreateFlags, CancellableVarp uintptr) uintptr { | |
| 2417 | + | ret := cb(&FileBase{Ptr: FileVarp}, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 2418 | + | if ret == nil { | |
| 2419 | + | return 0 | |
| 2420 | + | } | |
| 2421 | + | return ret.GoPointer() | |
| 2422 | + | }) | |
| 2423 | + | } | |
| 2424 | + | } | |
| 2425 | + | ||
| 2426 | + | // GetCreateReadwrite gets the callback function. | |
| 2427 | + | func (x *FileIface) GetCreateReadwrite() func(File, FileCreateFlags, *Cancellable) *FileIOStream { | |
| 2428 | + | if x.xCreateReadwrite == 0 { | |
| 2429 | + | return nil | |
| 2430 | + | } | |
| 2431 | + | var rawCallback func(FileVarp uintptr, FlagsVarp FileCreateFlags, CancellableVarp uintptr) uintptr | |
| 2432 | + | purego.RegisterFunc(&rawCallback, x.xCreateReadwrite) | |
| 2433 | + | return func(FileVar File, FlagsVar FileCreateFlags, CancellableVar *Cancellable) *FileIOStream { | |
| 2434 | + | rawRet := rawCallback(FileVar.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 2435 | + | if rawRet == 0 { | |
| 2436 | + | return nil | |
| 2437 | + | } | |
| 2438 | + | ret := &FileIOStream{} | |
| 2439 | + | ret.Ptr = rawRet | |
| 2440 | + | return ret | |
| 2441 | + | } | |
| 2442 | + | } | |
| 2443 | + | ||
| 2444 | + | // OverrideCreateReadwriteAsync sets the callback function. | |
| 2445 | + | func (x *FileIface) OverrideCreateReadwriteAsync(cb func(File, FileCreateFlags, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 2446 | + | if cb == nil { | |
| 2447 | + | x.xCreateReadwriteAsync = 0 | |
| 2448 | + | } else { | |
| 2449 | + | x.xCreateReadwriteAsync = purego.NewCallback(func(FileVarp uintptr, FlagsVarp FileCreateFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 2450 | + | cb(&FileBase{Ptr: FileVarp}, FlagsVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 2451 | + | }) | |
| 2452 | + | } | |
| 2453 | + | } | |
| 2454 | + | ||
| 2455 | + | // GetCreateReadwriteAsync gets the callback function. | |
| 2456 | + | func (x *FileIface) GetCreateReadwriteAsync() func(File, FileCreateFlags, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 2457 | + | if x.xCreateReadwriteAsync == 0 { | |
| 2458 | + | return nil | |
| 2459 | + | } | |
| 2460 | + | var rawCallback func(FileVarp uintptr, FlagsVarp FileCreateFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 2461 | + | purego.RegisterFunc(&rawCallback, x.xCreateReadwriteAsync) | |
| 2462 | + | return func(FileVar File, FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 2463 | + | rawCallback(FileVar.GoPointer(), FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 2464 | + | } | |
| 2465 | + | } | |
| 2466 | + | ||
| 2467 | + | // OverrideCreateReadwriteFinish sets the callback function. | |
| 2468 | + | func (x *FileIface) OverrideCreateReadwriteFinish(cb func(File, AsyncResult) *FileIOStream) { | |
| 2469 | + | if cb == nil { | |
| 2470 | + | x.xCreateReadwriteFinish = 0 | |
| 2471 | + | } else { | |
| 2472 | + | x.xCreateReadwriteFinish = purego.NewCallback(func(FileVarp uintptr, ResVarp uintptr) uintptr { | |
| 2473 | + | ret := cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResVarp}) | |
| 2474 | + | if ret == nil { | |
| 2475 | + | return 0 | |
| 2476 | + | } | |
| 2477 | + | return ret.GoPointer() | |
| 2478 | + | }) | |
| 2479 | + | } | |
| 2480 | + | } | |
| 2481 | + | ||
| 2482 | + | // GetCreateReadwriteFinish gets the callback function. | |
| 2483 | + | func (x *FileIface) GetCreateReadwriteFinish() func(File, AsyncResult) *FileIOStream { | |
| 2484 | + | if x.xCreateReadwriteFinish == 0 { | |
| 2485 | + | return nil | |
| 2486 | + | } | |
| 2487 | + | var rawCallback func(FileVarp uintptr, ResVarp uintptr) uintptr | |
| 2488 | + | purego.RegisterFunc(&rawCallback, x.xCreateReadwriteFinish) | |
| 2489 | + | return func(FileVar File, ResVar AsyncResult) *FileIOStream { | |
| 2490 | + | rawRet := rawCallback(FileVar.GoPointer(), ResVar.GoPointer()) | |
| 2491 | + | if rawRet == 0 { | |
| 2492 | + | return nil | |
| 2493 | + | } | |
| 2494 | + | ret := &FileIOStream{} | |
| 2495 | + | ret.Ptr = rawRet | |
| 2496 | + | return ret | |
| 2497 | + | } | |
| 2498 | + | } | |
| 2499 | + | ||
| 2500 | + | // OverrideReplaceReadwrite sets the callback function. | |
| 2501 | + | func (x *FileIface) OverrideReplaceReadwrite(cb func(File, string, bool, FileCreateFlags, *Cancellable) *FileIOStream) { | |
| 2502 | + | if cb == nil { | |
| 2503 | + | x.xReplaceReadwrite = 0 | |
| 2504 | + | } else { | |
| 2505 | + | x.xReplaceReadwrite = purego.NewCallback(func(FileVarp uintptr, EtagVarp string, MakeBackupVarp bool, FlagsVarp FileCreateFlags, CancellableVarp uintptr) uintptr { | |
| 2506 | + | ret := cb(&FileBase{Ptr: FileVarp}, EtagVarp, MakeBackupVarp, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 2507 | + | if ret == nil { | |
| 2508 | + | return 0 | |
| 2509 | + | } | |
| 2510 | + | return ret.GoPointer() | |
| 2511 | + | }) | |
| 2512 | + | } | |
| 2513 | + | } | |
| 2514 | + | ||
| 2515 | + | // GetReplaceReadwrite gets the callback function. | |
| 2516 | + | func (x *FileIface) GetReplaceReadwrite() func(File, string, bool, FileCreateFlags, *Cancellable) *FileIOStream { | |
| 2517 | + | if x.xReplaceReadwrite == 0 { | |
| 2518 | + | return nil | |
| 2519 | + | } | |
| 2520 | + | var rawCallback func(FileVarp uintptr, EtagVarp string, MakeBackupVarp bool, FlagsVarp FileCreateFlags, CancellableVarp uintptr) uintptr | |
| 2521 | + | purego.RegisterFunc(&rawCallback, x.xReplaceReadwrite) | |
| 2522 | + | return func(FileVar File, EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) *FileIOStream { | |
| 2523 | + | rawRet := rawCallback(FileVar.GoPointer(), EtagVar, MakeBackupVar, FlagsVar, CancellableVar.GoPointer()) | |
| 2524 | + | if rawRet == 0 { | |
| 2525 | + | return nil | |
| 2526 | + | } | |
| 2527 | + | ret := &FileIOStream{} | |
| 2528 | + | ret.Ptr = rawRet | |
| 2529 | + | return ret | |
| 2530 | + | } | |
| 2531 | + | } | |
| 2532 | + | ||
| 2533 | + | // OverrideReplaceReadwriteAsync sets the callback function. | |
| 2534 | + | func (x *FileIface) OverrideReplaceReadwriteAsync(cb func(File, string, bool, FileCreateFlags, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 2535 | + | if cb == nil { | |
| 2536 | + | x.xReplaceReadwriteAsync = 0 | |
| 2537 | + | } else { | |
| 2538 | + | x.xReplaceReadwriteAsync = purego.NewCallback(func(FileVarp uintptr, EtagVarp string, MakeBackupVarp bool, FlagsVarp FileCreateFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 2539 | + | cb(&FileBase{Ptr: FileVarp}, EtagVarp, MakeBackupVarp, FlagsVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 2540 | + | }) | |
| 2541 | + | } | |
| 2542 | + | } | |
| 2543 | + | ||
| 2544 | + | // GetReplaceReadwriteAsync gets the callback function. | |
| 2545 | + | func (x *FileIface) GetReplaceReadwriteAsync() func(File, string, bool, FileCreateFlags, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 2546 | + | if x.xReplaceReadwriteAsync == 0 { | |
| 2547 | + | return nil | |
| 2548 | + | } | |
| 2549 | + | var rawCallback func(FileVarp uintptr, EtagVarp string, MakeBackupVarp bool, FlagsVarp FileCreateFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 2550 | + | purego.RegisterFunc(&rawCallback, x.xReplaceReadwriteAsync) | |
| 2551 | + | return func(FileVar File, EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 2552 | + | rawCallback(FileVar.GoPointer(), EtagVar, MakeBackupVar, FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 2553 | + | } | |
| 2554 | + | } | |
| 2555 | + | ||
| 2556 | + | // OverrideReplaceReadwriteFinish sets the callback function. | |
| 2557 | + | func (x *FileIface) OverrideReplaceReadwriteFinish(cb func(File, AsyncResult) *FileIOStream) { | |
| 2558 | + | if cb == nil { | |
| 2559 | + | x.xReplaceReadwriteFinish = 0 | |
| 2560 | + | } else { | |
| 2561 | + | x.xReplaceReadwriteFinish = purego.NewCallback(func(FileVarp uintptr, ResVarp uintptr) uintptr { | |
| 2562 | + | ret := cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResVarp}) | |
| 2563 | + | if ret == nil { | |
| 2564 | + | return 0 | |
| 2565 | + | } | |
| 2566 | + | return ret.GoPointer() | |
| 2567 | + | }) | |
| 2568 | + | } | |
| 2569 | + | } | |
| 2570 | + | ||
| 2571 | + | // GetReplaceReadwriteFinish gets the callback function. | |
| 2572 | + | func (x *FileIface) GetReplaceReadwriteFinish() func(File, AsyncResult) *FileIOStream { | |
| 2573 | + | if x.xReplaceReadwriteFinish == 0 { | |
| 2574 | + | return nil | |
| 2575 | + | } | |
| 2576 | + | var rawCallback func(FileVarp uintptr, ResVarp uintptr) uintptr | |
| 2577 | + | purego.RegisterFunc(&rawCallback, x.xReplaceReadwriteFinish) | |
| 2578 | + | return func(FileVar File, ResVar AsyncResult) *FileIOStream { | |
| 2579 | + | rawRet := rawCallback(FileVar.GoPointer(), ResVar.GoPointer()) | |
| 2580 | + | if rawRet == 0 { | |
| 2581 | + | return nil | |
| 2582 | + | } | |
| 2583 | + | ret := &FileIOStream{} | |
| 2584 | + | ret.Ptr = rawRet | |
| 2585 | + | return ret | |
| 2586 | + | } | |
| 2587 | + | } | |
| 2588 | + | ||
| 2589 | + | // OverrideStartMountable sets the callback function. | |
| 2590 | + | func (x *FileIface) OverrideStartMountable(cb func(File, DriveStartFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 2591 | + | if cb == nil { | |
| 2592 | + | x.xStartMountable = 0 | |
| 2593 | + | } else { | |
| 2594 | + | x.xStartMountable = purego.NewCallback(func(FileVarp uintptr, FlagsVarp DriveStartFlags, StartOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 2595 | + | cb(&FileBase{Ptr: FileVarp}, FlagsVarp, MountOperationNewFromInternalPtr(StartOperationVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 2596 | + | }) | |
| 2597 | + | } | |
| 2598 | + | } | |
| 2599 | + | ||
| 2600 | + | // GetStartMountable gets the callback function. | |
| 2601 | + | func (x *FileIface) GetStartMountable() func(File, DriveStartFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 2602 | + | if x.xStartMountable == 0 { | |
| 2603 | + | return nil | |
| 2604 | + | } | |
| 2605 | + | var rawCallback func(FileVarp uintptr, FlagsVarp DriveStartFlags, StartOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 2606 | + | purego.RegisterFunc(&rawCallback, x.xStartMountable) | |
| 2607 | + | return func(FileVar File, FlagsVar DriveStartFlags, StartOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 2608 | + | rawCallback(FileVar.GoPointer(), FlagsVar, StartOperationVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 2609 | + | } | |
| 2610 | + | } | |
| 2611 | + | ||
| 2612 | + | // OverrideStartMountableFinish sets the callback function. | |
| 2613 | + | func (x *FileIface) OverrideStartMountableFinish(cb func(File, AsyncResult) bool) { | |
| 2614 | + | if cb == nil { | |
| 2615 | + | x.xStartMountableFinish = 0 | |
| 2616 | + | } else { | |
| 2617 | + | x.xStartMountableFinish = purego.NewCallback(func(FileVarp uintptr, ResultVarp uintptr) bool { | |
| 2618 | + | return cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 2619 | + | }) | |
| 2620 | + | } | |
| 2621 | + | } | |
| 2622 | + | ||
| 2623 | + | // GetStartMountableFinish gets the callback function. | |
| 2624 | + | func (x *FileIface) GetStartMountableFinish() func(File, AsyncResult) bool { | |
| 2625 | + | if x.xStartMountableFinish == 0 { | |
| 2626 | + | return nil | |
| 2627 | + | } | |
| 2628 | + | var rawCallback func(FileVarp uintptr, ResultVarp uintptr) bool | |
| 2629 | + | purego.RegisterFunc(&rawCallback, x.xStartMountableFinish) | |
| 2630 | + | return func(FileVar File, ResultVar AsyncResult) bool { | |
| 2631 | + | return rawCallback(FileVar.GoPointer(), ResultVar.GoPointer()) | |
| 2632 | + | } | |
| 2633 | + | } | |
| 2634 | + | ||
| 2635 | + | // OverrideStopMountable sets the callback function. | |
| 2636 | + | func (x *FileIface) OverrideStopMountable(cb func(File, MountUnmountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 2637 | + | if cb == nil { | |
| 2638 | + | x.xStopMountable = 0 | |
| 2639 | + | } else { | |
| 2640 | + | x.xStopMountable = purego.NewCallback(func(FileVarp uintptr, FlagsVarp MountUnmountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 2641 | + | cb(&FileBase{Ptr: FileVarp}, FlagsVarp, MountOperationNewFromInternalPtr(MountOperationVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 2642 | + | }) | |
| 2643 | + | } | |
| 2644 | + | } | |
| 2645 | + | ||
| 2646 | + | // GetStopMountable gets the callback function. | |
| 2647 | + | func (x *FileIface) GetStopMountable() func(File, MountUnmountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 2648 | + | if x.xStopMountable == 0 { | |
| 2649 | + | return nil | |
| 2650 | + | } | |
| 2651 | + | var rawCallback func(FileVarp uintptr, FlagsVarp MountUnmountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 2652 | + | purego.RegisterFunc(&rawCallback, x.xStopMountable) | |
| 2653 | + | return func(FileVar File, FlagsVar MountUnmountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 2654 | + | rawCallback(FileVar.GoPointer(), FlagsVar, MountOperationVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 2655 | + | } | |
| 2656 | + | } | |
| 2657 | + | ||
| 2658 | + | // OverrideStopMountableFinish sets the callback function. | |
| 2659 | + | func (x *FileIface) OverrideStopMountableFinish(cb func(File, AsyncResult) bool) { | |
| 2660 | + | if cb == nil { | |
| 2661 | + | x.xStopMountableFinish = 0 | |
| 2662 | + | } else { | |
| 2663 | + | x.xStopMountableFinish = purego.NewCallback(func(FileVarp uintptr, ResultVarp uintptr) bool { | |
| 2664 | + | return cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 2665 | + | }) | |
| 2666 | + | } | |
| 2667 | + | } | |
| 2668 | + | ||
| 2669 | + | // GetStopMountableFinish gets the callback function. | |
| 2670 | + | func (x *FileIface) GetStopMountableFinish() func(File, AsyncResult) bool { | |
| 2671 | + | if x.xStopMountableFinish == 0 { | |
| 2672 | + | return nil | |
| 2673 | + | } | |
| 2674 | + | var rawCallback func(FileVarp uintptr, ResultVarp uintptr) bool | |
| 2675 | + | purego.RegisterFunc(&rawCallback, x.xStopMountableFinish) | |
| 2676 | + | return func(FileVar File, ResultVar AsyncResult) bool { | |
| 2677 | + | return rawCallback(FileVar.GoPointer(), ResultVar.GoPointer()) | |
| 2678 | + | } | |
| 2679 | + | } | |
| 2680 | + | ||
| 2681 | + | // OverrideUnmountMountableWithOperation sets the callback function. | |
| 2682 | + | func (x *FileIface) OverrideUnmountMountableWithOperation(cb func(File, MountUnmountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 2683 | + | if cb == nil { | |
| 2684 | + | x.xUnmountMountableWithOperation = 0 | |
| 2685 | + | } else { | |
| 2686 | + | x.xUnmountMountableWithOperation = purego.NewCallback(func(FileVarp uintptr, FlagsVarp MountUnmountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 2687 | + | cb(&FileBase{Ptr: FileVarp}, FlagsVarp, MountOperationNewFromInternalPtr(MountOperationVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 2688 | + | }) | |
| 2689 | + | } | |
| 2690 | + | } | |
| 2691 | + | ||
| 2692 | + | // GetUnmountMountableWithOperation gets the callback function. | |
| 2693 | + | func (x *FileIface) GetUnmountMountableWithOperation() func(File, MountUnmountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 2694 | + | if x.xUnmountMountableWithOperation == 0 { | |
| 2695 | + | return nil | |
| 2696 | + | } | |
| 2697 | + | var rawCallback func(FileVarp uintptr, FlagsVarp MountUnmountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 2698 | + | purego.RegisterFunc(&rawCallback, x.xUnmountMountableWithOperation) | |
| 2699 | + | return func(FileVar File, FlagsVar MountUnmountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 2700 | + | rawCallback(FileVar.GoPointer(), FlagsVar, MountOperationVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 2701 | + | } | |
| 2702 | + | } | |
| 2703 | + | ||
| 2704 | + | // OverrideUnmountMountableWithOperationFinish sets the callback function. | |
| 2705 | + | func (x *FileIface) OverrideUnmountMountableWithOperationFinish(cb func(File, AsyncResult) bool) { | |
| 2706 | + | if cb == nil { | |
| 2707 | + | x.xUnmountMountableWithOperationFinish = 0 | |
| 2708 | + | } else { | |
| 2709 | + | x.xUnmountMountableWithOperationFinish = purego.NewCallback(func(FileVarp uintptr, ResultVarp uintptr) bool { | |
| 2710 | + | return cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 2711 | + | }) | |
| 2712 | + | } | |
| 2713 | + | } | |
| 2714 | + | ||
| 2715 | + | // GetUnmountMountableWithOperationFinish gets the callback function. | |
| 2716 | + | func (x *FileIface) GetUnmountMountableWithOperationFinish() func(File, AsyncResult) bool { | |
| 2717 | + | if x.xUnmountMountableWithOperationFinish == 0 { | |
| 2718 | + | return nil | |
| 2719 | + | } | |
| 2720 | + | var rawCallback func(FileVarp uintptr, ResultVarp uintptr) bool | |
| 2721 | + | purego.RegisterFunc(&rawCallback, x.xUnmountMountableWithOperationFinish) | |
| 2722 | + | return func(FileVar File, ResultVar AsyncResult) bool { | |
| 2723 | + | return rawCallback(FileVar.GoPointer(), ResultVar.GoPointer()) | |
| 2724 | + | } | |
| 2725 | + | } | |
| 2726 | + | ||
| 2727 | + | // OverrideEjectMountableWithOperation sets the callback function. | |
| 2728 | + | func (x *FileIface) OverrideEjectMountableWithOperation(cb func(File, MountUnmountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 2729 | + | if cb == nil { | |
| 2730 | + | x.xEjectMountableWithOperation = 0 | |
| 2731 | + | } else { | |
| 2732 | + | x.xEjectMountableWithOperation = purego.NewCallback(func(FileVarp uintptr, FlagsVarp MountUnmountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 2733 | + | cb(&FileBase{Ptr: FileVarp}, FlagsVarp, MountOperationNewFromInternalPtr(MountOperationVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 2734 | + | }) | |
| 2735 | + | } | |
| 2736 | + | } | |
| 2737 | + | ||
| 2738 | + | // GetEjectMountableWithOperation gets the callback function. | |
| 2739 | + | func (x *FileIface) GetEjectMountableWithOperation() func(File, MountUnmountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 2740 | + | if x.xEjectMountableWithOperation == 0 { | |
| 2741 | + | return nil | |
| 2742 | + | } | |
| 2743 | + | var rawCallback func(FileVarp uintptr, FlagsVarp MountUnmountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 2744 | + | purego.RegisterFunc(&rawCallback, x.xEjectMountableWithOperation) | |
| 2745 | + | return func(FileVar File, FlagsVar MountUnmountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 2746 | + | rawCallback(FileVar.GoPointer(), FlagsVar, MountOperationVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 2747 | + | } | |
| 2748 | + | } | |
| 2749 | + | ||
| 2750 | + | // OverrideEjectMountableWithOperationFinish sets the callback function. | |
| 2751 | + | func (x *FileIface) OverrideEjectMountableWithOperationFinish(cb func(File, AsyncResult) bool) { | |
| 2752 | + | if cb == nil { | |
| 2753 | + | x.xEjectMountableWithOperationFinish = 0 | |
| 2754 | + | } else { | |
| 2755 | + | x.xEjectMountableWithOperationFinish = purego.NewCallback(func(FileVarp uintptr, ResultVarp uintptr) bool { | |
| 2756 | + | return cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 2757 | + | }) | |
| 2758 | + | } | |
| 2759 | + | } | |
| 2760 | + | ||
| 2761 | + | // GetEjectMountableWithOperationFinish gets the callback function. | |
| 2762 | + | func (x *FileIface) GetEjectMountableWithOperationFinish() func(File, AsyncResult) bool { | |
| 2763 | + | if x.xEjectMountableWithOperationFinish == 0 { | |
| 2764 | + | return nil | |
| 2765 | + | } | |
| 2766 | + | var rawCallback func(FileVarp uintptr, ResultVarp uintptr) bool | |
| 2767 | + | purego.RegisterFunc(&rawCallback, x.xEjectMountableWithOperationFinish) | |
| 2768 | + | return func(FileVar File, ResultVar AsyncResult) bool { | |
| 2769 | + | return rawCallback(FileVar.GoPointer(), ResultVar.GoPointer()) | |
| 2770 | + | } | |
| 2771 | + | } | |
| 2772 | + | ||
| 2773 | + | // OverridePollMountable sets the callback function. | |
| 2774 | + | func (x *FileIface) OverridePollMountable(cb func(File, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 2775 | + | if cb == nil { | |
| 2776 | + | x.xPollMountable = 0 | |
| 2777 | + | } else { | |
| 2778 | + | x.xPollMountable = purego.NewCallback(func(FileVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 2779 | + | cb(&FileBase{Ptr: FileVarp}, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 2780 | + | }) | |
| 2781 | + | } | |
| 2782 | + | } | |
| 2783 | + | ||
| 2784 | + | // GetPollMountable gets the callback function. | |
| 2785 | + | func (x *FileIface) GetPollMountable() func(File, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 2786 | + | if x.xPollMountable == 0 { | |
| 2787 | + | return nil | |
| 2788 | + | } | |
| 2789 | + | var rawCallback func(FileVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 2790 | + | purego.RegisterFunc(&rawCallback, x.xPollMountable) | |
| 2791 | + | return func(FileVar File, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 2792 | + | rawCallback(FileVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 2793 | + | } | |
| 2794 | + | } | |
| 2795 | + | ||
| 2796 | + | // OverridePollMountableFinish sets the callback function. | |
| 2797 | + | func (x *FileIface) OverridePollMountableFinish(cb func(File, AsyncResult) bool) { | |
| 2798 | + | if cb == nil { | |
| 2799 | + | x.xPollMountableFinish = 0 | |
| 2800 | + | } else { | |
| 2801 | + | x.xPollMountableFinish = purego.NewCallback(func(FileVarp uintptr, ResultVarp uintptr) bool { | |
| 2802 | + | return cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 2803 | + | }) | |
| 2804 | + | } | |
| 2805 | + | } | |
| 2806 | + | ||
| 2807 | + | // GetPollMountableFinish gets the callback function. | |
| 2808 | + | func (x *FileIface) GetPollMountableFinish() func(File, AsyncResult) bool { | |
| 2809 | + | if x.xPollMountableFinish == 0 { | |
| 2810 | + | return nil | |
| 2811 | + | } | |
| 2812 | + | var rawCallback func(FileVarp uintptr, ResultVarp uintptr) bool | |
| 2813 | + | purego.RegisterFunc(&rawCallback, x.xPollMountableFinish) | |
| 2814 | + | return func(FileVar File, ResultVar AsyncResult) bool { | |
| 2815 | + | return rawCallback(FileVar.GoPointer(), ResultVar.GoPointer()) | |
| 2816 | + | } | |
| 2817 | + | } | |
| 2818 | + | ||
| 2819 | + | // OverrideMeasureDiskUsage sets the callback function. | |
| 2820 | + | func (x *FileIface) OverrideMeasureDiskUsage(cb func(File, FileMeasureFlags, *Cancellable, *FileMeasureProgressCallback, uintptr, uint64, uint64, uint64) bool) { | |
| 2821 | + | if cb == nil { | |
| 2822 | + | x.xMeasureDiskUsage = 0 | |
| 2823 | + | } else { | |
| 2824 | + | x.xMeasureDiskUsage = purego.NewCallback(func(FileVarp uintptr, FlagsVarp FileMeasureFlags, CancellableVarp uintptr, ProgressCallbackVarp uintptr, ProgressDataVarp uintptr, DiskUsageVarp uint64, NumDirsVarp uint64, NumFilesVarp uint64) bool { | |
| 2825 | + | return cb(&FileBase{Ptr: FileVarp}, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp), (*FileMeasureProgressCallback)(unsafe.Pointer(ProgressCallbackVarp)), ProgressDataVarp, DiskUsageVarp, NumDirsVarp, NumFilesVarp) | |
| 2826 | + | }) | |
| 2827 | + | } | |
| 2828 | + | } | |
| 2829 | + | ||
| 2830 | + | // GetMeasureDiskUsage gets the callback function. | |
| 2831 | + | func (x *FileIface) GetMeasureDiskUsage() func(File, FileMeasureFlags, *Cancellable, *FileMeasureProgressCallback, uintptr, uint64, uint64, uint64) bool { | |
| 2832 | + | if x.xMeasureDiskUsage == 0 { | |
| 2833 | + | return nil | |
| 2834 | + | } | |
| 2835 | + | var rawCallback func(FileVarp uintptr, FlagsVarp FileMeasureFlags, CancellableVarp uintptr, ProgressCallbackVarp uintptr, ProgressDataVarp uintptr, DiskUsageVarp uint64, NumDirsVarp uint64, NumFilesVarp uint64) bool | |
| 2836 | + | purego.RegisterFunc(&rawCallback, x.xMeasureDiskUsage) | |
| 2837 | + | return func(FileVar File, FlagsVar FileMeasureFlags, CancellableVar *Cancellable, ProgressCallbackVar *FileMeasureProgressCallback, ProgressDataVar uintptr, DiskUsageVar uint64, NumDirsVar uint64, NumFilesVar uint64) bool { | |
| 2838 | + | return rawCallback(FileVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(ProgressCallbackVar), ProgressDataVar, DiskUsageVar, NumDirsVar, NumFilesVar) | |
| 2839 | + | } | |
| 2840 | + | } | |
| 2841 | + | ||
| 2842 | + | // OverrideMeasureDiskUsageAsync sets the callback function. | |
| 2843 | + | func (x *FileIface) OverrideMeasureDiskUsageAsync(cb func(File, FileMeasureFlags, int, *Cancellable, *FileMeasureProgressCallback, uintptr, *AsyncReadyCallback, uintptr)) { | |
| 2844 | + | if cb == nil { | |
| 2845 | + | x.xMeasureDiskUsageAsync = 0 | |
| 2846 | + | } else { | |
| 2847 | + | x.xMeasureDiskUsageAsync = purego.NewCallback(func(FileVarp uintptr, FlagsVarp FileMeasureFlags, IoPriorityVarp int, CancellableVarp uintptr, ProgressCallbackVarp uintptr, ProgressDataVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 2848 | + | cb(&FileBase{Ptr: FileVarp}, FlagsVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*FileMeasureProgressCallback)(unsafe.Pointer(ProgressCallbackVarp)), ProgressDataVarp, (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 2849 | + | }) | |
| 2850 | + | } | |
| 2851 | + | } | |
| 2852 | + | ||
| 2853 | + | // GetMeasureDiskUsageAsync gets the callback function. | |
| 2854 | + | func (x *FileIface) GetMeasureDiskUsageAsync() func(File, FileMeasureFlags, int, *Cancellable, *FileMeasureProgressCallback, uintptr, *AsyncReadyCallback, uintptr) { | |
| 2855 | + | if x.xMeasureDiskUsageAsync == 0 { | |
| 2856 | + | return nil | |
| 2857 | + | } | |
| 2858 | + | var rawCallback func(FileVarp uintptr, FlagsVarp FileMeasureFlags, IoPriorityVarp int, CancellableVarp uintptr, ProgressCallbackVarp uintptr, ProgressDataVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 2859 | + | purego.RegisterFunc(&rawCallback, x.xMeasureDiskUsageAsync) | |
| 2860 | + | return func(FileVar File, FlagsVar FileMeasureFlags, IoPriorityVar int, CancellableVar *Cancellable, ProgressCallbackVar *FileMeasureProgressCallback, ProgressDataVar uintptr, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 2861 | + | rawCallback(FileVar.GoPointer(), FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(ProgressCallbackVar), ProgressDataVar, glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 2862 | + | } | |
| 2863 | + | } | |
| 2864 | + | ||
| 2865 | + | // OverrideMeasureDiskUsageFinish sets the callback function. | |
| 2866 | + | func (x *FileIface) OverrideMeasureDiskUsageFinish(cb func(File, AsyncResult, uint64, uint64, uint64) bool) { | |
| 2867 | + | if cb == nil { | |
| 2868 | + | x.xMeasureDiskUsageFinish = 0 | |
| 2869 | + | } else { | |
| 2870 | + | x.xMeasureDiskUsageFinish = purego.NewCallback(func(FileVarp uintptr, ResultVarp uintptr, DiskUsageVarp uint64, NumDirsVarp uint64, NumFilesVarp uint64) bool { | |
| 2871 | + | return cb(&FileBase{Ptr: FileVarp}, &AsyncResultBase{Ptr: ResultVarp}, DiskUsageVarp, NumDirsVarp, NumFilesVarp) | |
| 2872 | + | }) | |
| 2873 | + | } | |
| 2874 | + | } | |
| 2875 | + | ||
| 2876 | + | // GetMeasureDiskUsageFinish gets the callback function. | |
| 2877 | + | func (x *FileIface) GetMeasureDiskUsageFinish() func(File, AsyncResult, uint64, uint64, uint64) bool { | |
| 2878 | + | if x.xMeasureDiskUsageFinish == 0 { | |
| 2879 | + | return nil | |
| 2880 | + | } | |
| 2881 | + | var rawCallback func(FileVarp uintptr, ResultVarp uintptr, DiskUsageVarp uint64, NumDirsVarp uint64, NumFilesVarp uint64) bool | |
| 2882 | + | purego.RegisterFunc(&rawCallback, x.xMeasureDiskUsageFinish) | |
| 2883 | + | return func(FileVar File, ResultVar AsyncResult, DiskUsageVar uint64, NumDirsVar uint64, NumFilesVar uint64) bool { | |
| 2884 | + | return rawCallback(FileVar.GoPointer(), ResultVar.GoPointer(), DiskUsageVar, NumDirsVar, NumFilesVar) | |
| 2885 | + | } | |
| 2886 | + | } | |
| 2887 | + | ||
| 28 | 2888 | // #GFile is a high level abstraction for manipulating files on a | |
| 29 | 2889 | // virtual file system. #GFiles are lightweight, immutable objects | |
| 30 | 2890 | // that do no I/O upon creation. It is necessary to understand that | |
| @@ -109,38 +2969,38 @@ func (x *FileIface) GoPointer() uintptr { | |||
| 109 | 2969 | type File interface { | |
| 110 | 2970 | GoPointer() uintptr | |
| 111 | 2971 | SetGoPointer(uintptr) | |
| 112 | - | AppendTo(FlagsVar FileCreateFlags, CancellableVar *Cancellable) *FileOutputStream | |
| 2972 | + | AppendTo(FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileOutputStream, error) | |
| 113 | 2973 | AppendToAsync(FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 114 | - | AppendToFinish(ResVar AsyncResult) *FileOutputStream | |
| 115 | - | BuildAttributeListForCopy(FlagsVar FileCopyFlags, CancellableVar *Cancellable) string | |
| 116 | - | Copy(DestinationVar File, FlagsVar FileCopyFlags, CancellableVar *Cancellable, ProgressCallbackVar *FileProgressCallback, ProgressCallbackDataVar uintptr) bool | |
| 2974 | + | AppendToFinish(ResVar AsyncResult) (*FileOutputStream, error) | |
| 2975 | + | BuildAttributeListForCopy(FlagsVar FileCopyFlags, CancellableVar *Cancellable) (string, error) | |
| 2976 | + | Copy(DestinationVar File, FlagsVar FileCopyFlags, CancellableVar *Cancellable, ProgressCallbackVar *FileProgressCallback, ProgressCallbackDataVar uintptr) (bool, error) | |
| 117 | 2977 | CopyAsync(DestinationVar File, FlagsVar FileCopyFlags, IoPriorityVar int, CancellableVar *Cancellable, ProgressCallbackVar *FileProgressCallback, ProgressCallbackDataVar uintptr, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 118 | - | CopyAttributes(DestinationVar File, FlagsVar FileCopyFlags, CancellableVar *Cancellable) bool | |
| 119 | - | CopyFinish(ResVar AsyncResult) bool | |
| 120 | - | Create(FlagsVar FileCreateFlags, CancellableVar *Cancellable) *FileOutputStream | |
| 2978 | + | CopyAttributes(DestinationVar File, FlagsVar FileCopyFlags, CancellableVar *Cancellable) (bool, error) | |
| 2979 | + | CopyFinish(ResVar AsyncResult) (bool, error) | |
| 2980 | + | Create(FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileOutputStream, error) | |
| 121 | 2981 | CreateAsync(FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 122 | - | CreateFinish(ResVar AsyncResult) *FileOutputStream | |
| 123 | - | CreateReadwrite(FlagsVar FileCreateFlags, CancellableVar *Cancellable) *FileIOStream | |
| 2982 | + | CreateFinish(ResVar AsyncResult) (*FileOutputStream, error) | |
| 2983 | + | CreateReadwrite(FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileIOStream, error) | |
| 124 | 2984 | CreateReadwriteAsync(FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 125 | - | CreateReadwriteFinish(ResVar AsyncResult) *FileIOStream | |
| 126 | - | Delete(CancellableVar *Cancellable) bool | |
| 2985 | + | CreateReadwriteFinish(ResVar AsyncResult) (*FileIOStream, error) | |
| 2986 | + | Delete(CancellableVar *Cancellable) (bool, error) | |
| 127 | 2987 | DeleteAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 128 | - | DeleteFinish(ResultVar AsyncResult) bool | |
| 2988 | + | DeleteFinish(ResultVar AsyncResult) (bool, error) | |
| 129 | 2989 | Dup() *FileBase | |
| 130 | 2990 | EjectMountable(FlagsVar MountUnmountFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 131 | - | EjectMountableFinish(ResultVar AsyncResult) bool | |
| 2991 | + | EjectMountableFinish(ResultVar AsyncResult) (bool, error) | |
| 132 | 2992 | EjectMountableWithOperation(FlagsVar MountUnmountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 133 | - | EjectMountableWithOperationFinish(ResultVar AsyncResult) bool | |
| 134 | - | EnumerateChildren(AttributesVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) *FileEnumerator | |
| 2993 | + | EjectMountableWithOperationFinish(ResultVar AsyncResult) (bool, error) | |
| 2994 | + | EnumerateChildren(AttributesVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (*FileEnumerator, error) | |
| 135 | 2995 | EnumerateChildrenAsync(AttributesVar string, FlagsVar FileQueryInfoFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 136 | - | EnumerateChildrenFinish(ResVar AsyncResult) *FileEnumerator | |
| 2996 | + | EnumerateChildrenFinish(ResVar AsyncResult) (*FileEnumerator, error) | |
| 137 | 2997 | Equal(File2Var File) bool | |
| 138 | - | FindEnclosingMount(CancellableVar *Cancellable) *MountBase | |
| 2998 | + | FindEnclosingMount(CancellableVar *Cancellable) (*MountBase, error) | |
| 139 | 2999 | FindEnclosingMountAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 140 | - | FindEnclosingMountFinish(ResVar AsyncResult) *MountBase | |
| 3000 | + | FindEnclosingMountFinish(ResVar AsyncResult) (*MountBase, error) | |
| 141 | 3001 | GetBasename() string | |
| 142 | 3002 | GetChild(NameVar string) *FileBase | |
| 143 | - | GetChildForDisplayName(DisplayNameVar string) *FileBase | |
| 3003 | + | GetChildForDisplayName(DisplayNameVar string) (*FileBase, error) | |
| 144 | 3004 | GetParent() *FileBase | |
| 145 | 3005 | GetParseName() string | |
| 146 | 3006 | GetPath() string | |
| @@ -152,90 +3012,90 @@ type File interface { | |||
| 152 | 3012 | HasUriScheme(UriSchemeVar string) bool | |
| 153 | 3013 | Hash() uint | |
| 154 | 3014 | IsNative() bool | |
| 155 | - | LoadBytes(CancellableVar *Cancellable, EtagOutVar string) *glib.Bytes | |
| 3015 | + | LoadBytes(CancellableVar *Cancellable, EtagOutVar string) (*glib.Bytes, error) | |
| 156 | 3016 | LoadBytesAsync(CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 157 | - | LoadBytesFinish(ResultVar AsyncResult, EtagOutVar string) *glib.Bytes | |
| 158 | - | LoadContents(CancellableVar *Cancellable, ContentsVar []string, LengthVar uint, EtagOutVar string) bool | |
| 3017 | + | LoadBytesFinish(ResultVar AsyncResult, EtagOutVar string) (*glib.Bytes, error) | |
| 3018 | + | LoadContents(CancellableVar *Cancellable, ContentsVar []string, LengthVar uint, EtagOutVar string) (bool, error) | |
| 159 | 3019 | LoadContentsAsync(CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 160 | - | LoadContentsFinish(ResVar AsyncResult, ContentsVar []string, LengthVar uint, EtagOutVar string) bool | |
| 3020 | + | LoadContentsFinish(ResVar AsyncResult, ContentsVar []string, LengthVar uint, EtagOutVar string) (bool, error) | |
| 161 | 3021 | LoadPartialContentsAsync(CancellableVar *Cancellable, ReadMoreCallbackVar *FileReadMoreCallback, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 162 | - | LoadPartialContentsFinish(ResVar AsyncResult, ContentsVar []string, LengthVar uint, EtagOutVar string) bool | |
| 163 | - | MakeDirectory(CancellableVar *Cancellable) bool | |
| 3022 | + | LoadPartialContentsFinish(ResVar AsyncResult, ContentsVar []string, LengthVar uint, EtagOutVar string) (bool, error) | |
| 3023 | + | MakeDirectory(CancellableVar *Cancellable) (bool, error) | |
| 164 | 3024 | MakeDirectoryAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 165 | - | MakeDirectoryFinish(ResultVar AsyncResult) bool | |
| 166 | - | MakeDirectoryWithParents(CancellableVar *Cancellable) bool | |
| 167 | - | MakeSymbolicLink(SymlinkValueVar string, CancellableVar *Cancellable) bool | |
| 168 | - | MeasureDiskUsage(FlagsVar FileMeasureFlags, CancellableVar *Cancellable, ProgressCallbackVar *FileMeasureProgressCallback, ProgressDataVar uintptr, DiskUsageVar uint64, NumDirsVar uint64, NumFilesVar uint64) bool | |
| 3025 | + | MakeDirectoryFinish(ResultVar AsyncResult) (bool, error) | |
| 3026 | + | MakeDirectoryWithParents(CancellableVar *Cancellable) (bool, error) | |
| 3027 | + | MakeSymbolicLink(SymlinkValueVar string, CancellableVar *Cancellable) (bool, error) | |
| 3028 | + | MeasureDiskUsage(FlagsVar FileMeasureFlags, CancellableVar *Cancellable, ProgressCallbackVar *FileMeasureProgressCallback, ProgressDataVar uintptr, DiskUsageVar uint64, NumDirsVar uint64, NumFilesVar uint64) (bool, error) | |
| 169 | 3029 | MeasureDiskUsageAsync(FlagsVar FileMeasureFlags, IoPriorityVar int, CancellableVar *Cancellable, ProgressCallbackVar *FileMeasureProgressCallback, ProgressDataVar uintptr, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 170 | - | MeasureDiskUsageFinish(ResultVar AsyncResult, DiskUsageVar uint64, NumDirsVar uint64, NumFilesVar uint64) bool | |
| 171 | - | Monitor(FlagsVar FileMonitorFlags, CancellableVar *Cancellable) *FileMonitor | |
| 172 | - | MonitorDirectory(FlagsVar FileMonitorFlags, CancellableVar *Cancellable) *FileMonitor | |
| 173 | - | MonitorFile(FlagsVar FileMonitorFlags, CancellableVar *Cancellable) *FileMonitor | |
| 3030 | + | MeasureDiskUsageFinish(ResultVar AsyncResult, DiskUsageVar uint64, NumDirsVar uint64, NumFilesVar uint64) (bool, error) | |
| 3031 | + | Monitor(FlagsVar FileMonitorFlags, CancellableVar *Cancellable) (*FileMonitor, error) | |
| 3032 | + | MonitorDirectory(FlagsVar FileMonitorFlags, CancellableVar *Cancellable) (*FileMonitor, error) | |
| 3033 | + | MonitorFile(FlagsVar FileMonitorFlags, CancellableVar *Cancellable) (*FileMonitor, error) | |
| 174 | 3034 | MountEnclosingVolume(FlagsVar MountMountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 175 | - | MountEnclosingVolumeFinish(ResultVar AsyncResult) bool | |
| 3035 | + | MountEnclosingVolumeFinish(ResultVar AsyncResult) (bool, error) | |
| 176 | 3036 | MountMountable(FlagsVar MountMountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 177 | - | MountMountableFinish(ResultVar AsyncResult) *FileBase | |
| 178 | - | Move(DestinationVar File, FlagsVar FileCopyFlags, CancellableVar *Cancellable, ProgressCallbackVar *FileProgressCallback, ProgressCallbackDataVar uintptr) bool | |
| 3037 | + | MountMountableFinish(ResultVar AsyncResult) (*FileBase, error) | |
| 3038 | + | Move(DestinationVar File, FlagsVar FileCopyFlags, CancellableVar *Cancellable, ProgressCallbackVar *FileProgressCallback, ProgressCallbackDataVar uintptr) (bool, error) | |
| 179 | 3039 | MoveAsync(DestinationVar File, FlagsVar FileCopyFlags, IoPriorityVar int, CancellableVar *Cancellable, ProgressCallbackVar *FileProgressCallback, ProgressCallbackDataVar uintptr, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 180 | - | MoveFinish(ResultVar AsyncResult) bool | |
| 181 | - | OpenReadwrite(CancellableVar *Cancellable) *FileIOStream | |
| 3040 | + | MoveFinish(ResultVar AsyncResult) (bool, error) | |
| 3041 | + | OpenReadwrite(CancellableVar *Cancellable) (*FileIOStream, error) | |
| 182 | 3042 | OpenReadwriteAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 183 | - | OpenReadwriteFinish(ResVar AsyncResult) *FileIOStream | |
| 3043 | + | OpenReadwriteFinish(ResVar AsyncResult) (*FileIOStream, error) | |
| 184 | 3044 | PeekPath() string | |
| 185 | 3045 | PollMountable(CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 186 | - | PollMountableFinish(ResultVar AsyncResult) bool | |
| 187 | - | QueryDefaultHandler(CancellableVar *Cancellable) *AppInfoBase | |
| 3046 | + | PollMountableFinish(ResultVar AsyncResult) (bool, error) | |
| 3047 | + | QueryDefaultHandler(CancellableVar *Cancellable) (*AppInfoBase, error) | |
| 188 | 3048 | QueryDefaultHandlerAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 189 | - | QueryDefaultHandlerFinish(ResultVar AsyncResult) *AppInfoBase | |
| 3049 | + | QueryDefaultHandlerFinish(ResultVar AsyncResult) (*AppInfoBase, error) | |
| 190 | 3050 | QueryExists(CancellableVar *Cancellable) bool | |
| 191 | 3051 | QueryFileType(FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) FileType | |
| 192 | - | QueryFilesystemInfo(AttributesVar string, CancellableVar *Cancellable) *FileInfo | |
| 3052 | + | QueryFilesystemInfo(AttributesVar string, CancellableVar *Cancellable) (*FileInfo, error) | |
| 193 | 3053 | QueryFilesystemInfoAsync(AttributesVar string, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 194 | - | QueryFilesystemInfoFinish(ResVar AsyncResult) *FileInfo | |
| 195 | - | QueryInfo(AttributesVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) *FileInfo | |
| 3054 | + | QueryFilesystemInfoFinish(ResVar AsyncResult) (*FileInfo, error) | |
| 3055 | + | QueryInfo(AttributesVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (*FileInfo, error) | |
| 196 | 3056 | QueryInfoAsync(AttributesVar string, FlagsVar FileQueryInfoFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 197 | - | QueryInfoFinish(ResVar AsyncResult) *FileInfo | |
| 198 | - | QuerySettableAttributes(CancellableVar *Cancellable) *FileAttributeInfoList | |
| 199 | - | QueryWritableNamespaces(CancellableVar *Cancellable) *FileAttributeInfoList | |
| 200 | - | Read(CancellableVar *Cancellable) *FileInputStream | |
| 3057 | + | QueryInfoFinish(ResVar AsyncResult) (*FileInfo, error) | |
| 3058 | + | QuerySettableAttributes(CancellableVar *Cancellable) (*FileAttributeInfoList, error) | |
| 3059 | + | QueryWritableNamespaces(CancellableVar *Cancellable) (*FileAttributeInfoList, error) | |
| 3060 | + | Read(CancellableVar *Cancellable) (*FileInputStream, error) | |
| 201 | 3061 | ReadAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 202 | - | ReadFinish(ResVar AsyncResult) *FileInputStream | |
| 203 | - | Replace(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) *FileOutputStream | |
| 3062 | + | ReadFinish(ResVar AsyncResult) (*FileInputStream, error) | |
| 3063 | + | Replace(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileOutputStream, error) | |
| 204 | 3064 | ReplaceAsync(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 205 | - | ReplaceContents(ContentsVar string, LengthVar uint, EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, NewEtagVar string, CancellableVar *Cancellable) bool | |
| 3065 | + | ReplaceContents(ContentsVar string, LengthVar uint, EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, NewEtagVar string, CancellableVar *Cancellable) (bool, error) | |
| 206 | 3066 | ReplaceContentsAsync(ContentsVar string, LengthVar uint, EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 207 | 3067 | ReplaceContentsBytesAsync(ContentsVar *glib.Bytes, EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 208 | - | ReplaceContentsFinish(ResVar AsyncResult, NewEtagVar string) bool | |
| 209 | - | ReplaceFinish(ResVar AsyncResult) *FileOutputStream | |
| 210 | - | ReplaceReadwrite(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) *FileIOStream | |
| 3068 | + | ReplaceContentsFinish(ResVar AsyncResult, NewEtagVar string) (bool, error) | |
| 3069 | + | ReplaceFinish(ResVar AsyncResult) (*FileOutputStream, error) | |
| 3070 | + | ReplaceReadwrite(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileIOStream, error) | |
| 211 | 3071 | ReplaceReadwriteAsync(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 212 | - | ReplaceReadwriteFinish(ResVar AsyncResult) *FileIOStream | |
| 3072 | + | ReplaceReadwriteFinish(ResVar AsyncResult) (*FileIOStream, error) | |
| 213 | 3073 | ResolveRelativePath(RelativePathVar string) *FileBase | |
| 214 | - | SetAttribute(AttributeVar string, TypeVar FileAttributeType, ValuePVar uintptr, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool | |
| 215 | - | SetAttributeByteString(AttributeVar string, ValueVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool | |
| 216 | - | SetAttributeInt32(AttributeVar string, ValueVar int32, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool | |
| 217 | - | SetAttributeInt64(AttributeVar string, ValueVar int64, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool | |
| 218 | - | SetAttributeString(AttributeVar string, ValueVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool | |
| 219 | - | SetAttributeUint32(AttributeVar string, ValueVar uint32, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool | |
| 220 | - | SetAttributeUint64(AttributeVar string, ValueVar uint64, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool | |
| 3074 | + | SetAttribute(AttributeVar string, TypeVar FileAttributeType, ValuePVar uintptr, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) | |
| 3075 | + | SetAttributeByteString(AttributeVar string, ValueVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) | |
| 3076 | + | SetAttributeInt32(AttributeVar string, ValueVar int32, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) | |
| 3077 | + | SetAttributeInt64(AttributeVar string, ValueVar int64, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) | |
| 3078 | + | SetAttributeString(AttributeVar string, ValueVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) | |
| 3079 | + | SetAttributeUint32(AttributeVar string, ValueVar uint32, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) | |
| 3080 | + | SetAttributeUint64(AttributeVar string, ValueVar uint64, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) | |
| 221 | 3081 | SetAttributesAsync(InfoVar *FileInfo, FlagsVar FileQueryInfoFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 222 | - | SetAttributesFinish(ResultVar AsyncResult, InfoVar **FileInfo) bool | |
| 223 | - | SetAttributesFromInfo(InfoVar *FileInfo, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool | |
| 224 | - | SetDisplayName(DisplayNameVar string, CancellableVar *Cancellable) *FileBase | |
| 3082 | + | SetAttributesFinish(ResultVar AsyncResult, InfoVar **FileInfo) (bool, error) | |
| 3083 | + | SetAttributesFromInfo(InfoVar *FileInfo, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) | |
| 3084 | + | SetDisplayName(DisplayNameVar string, CancellableVar *Cancellable) (*FileBase, error) | |
| 225 | 3085 | SetDisplayNameAsync(DisplayNameVar string, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 226 | - | SetDisplayNameFinish(ResVar AsyncResult) *FileBase | |
| 3086 | + | SetDisplayNameFinish(ResVar AsyncResult) (*FileBase, error) | |
| 227 | 3087 | StartMountable(FlagsVar DriveStartFlags, StartOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 228 | - | StartMountableFinish(ResultVar AsyncResult) bool | |
| 3088 | + | StartMountableFinish(ResultVar AsyncResult) (bool, error) | |
| 229 | 3089 | StopMountable(FlagsVar MountUnmountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 230 | - | StopMountableFinish(ResultVar AsyncResult) bool | |
| 3090 | + | StopMountableFinish(ResultVar AsyncResult) (bool, error) | |
| 231 | 3091 | SupportsThreadContexts() bool | |
| 232 | - | Trash(CancellableVar *Cancellable) bool | |
| 3092 | + | Trash(CancellableVar *Cancellable) (bool, error) | |
| 233 | 3093 | TrashAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 234 | - | TrashFinish(ResultVar AsyncResult) bool | |
| 3094 | + | TrashFinish(ResultVar AsyncResult) (bool, error) | |
| 235 | 3095 | UnmountMountable(FlagsVar MountUnmountFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 236 | - | UnmountMountableFinish(ResultVar AsyncResult) bool | |
| 3096 | + | UnmountMountableFinish(ResultVar AsyncResult) (bool, error) | |
| 237 | 3097 | UnmountMountableWithOperation(FlagsVar MountUnmountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 238 | - | UnmountMountableWithOperationFinish(ResultVar AsyncResult) bool | |
| 3098 | + | UnmountMountableWithOperationFinish(ResultVar AsyncResult) (bool, error) | |
| 239 | 3099 | } | |
| 240 | 3100 | ||
| 241 | 3101 | var xFileGLibType func() types.GType | |
| @@ -2464,7 +5324,7 @@ func (x *FileBase) SetAttributesAsync(InfoVar *FileInfo, FlagsVar FileQueryInfoF | |||
| 2464 | 5324 | func (x *FileBase) SetAttributesFinish(ResultVar AsyncResult, InfoVar **FileInfo) (bool, error) { | |
| 2465 | 5325 | var cerr *glib.Error | |
| 2466 | 5326 | ||
| 2467 | - | cret := XGFileSetAttributesFinish(x.GoPointer(), ResultVar.GoPointer(), gobject.ConvertPtr(InfoVar), &cerr) | |
| 5327 | + | cret := XGFileSetAttributesFinish(x.GoPointer(), ResultVar.GoPointer(), *gobject.ConvertPtr(InfoVar), &cerr) | |
| 2468 | 5328 | if cerr == nil { | |
| 2469 | 5329 | return cret, nil | |
| 2470 | 5330 | } | |
| @@ -2846,7 +5706,7 @@ var XGFileSetAttributeString func(uintptr, string, string, FileQueryInfoFlags, u | |||
| 2846 | 5706 | var XGFileSetAttributeUint32 func(uintptr, string, uint32, FileQueryInfoFlags, uintptr, **glib.Error) bool | |
| 2847 | 5707 | var XGFileSetAttributeUint64 func(uintptr, string, uint64, FileQueryInfoFlags, uintptr, **glib.Error) bool | |
| 2848 | 5708 | var XGFileSetAttributesAsync func(uintptr, uintptr, FileQueryInfoFlags, int, uintptr, uintptr, uintptr) | |
| 2849 | - | var XGFileSetAttributesFinish func(uintptr, uintptr, *uintptr, **glib.Error) bool | |
| 5709 | + | var XGFileSetAttributesFinish func(uintptr, uintptr, uintptr, **glib.Error) bool | |
| 2850 | 5710 | var XGFileSetAttributesFromInfo func(uintptr, uintptr, FileQueryInfoFlags, uintptr, **glib.Error) bool | |
| 2851 | 5711 | var XGFileSetDisplayName func(uintptr, string, uintptr, **glib.Error) uintptr | |
| 2852 | 5712 | var XGFileSetDisplayNameAsync func(uintptr, string, int, uintptr, uintptr, uintptr) | |
| @@ -2956,7 +5816,7 @@ func FileNewForUri(UriVar string) *FileBase { | |||
| 2956 | 5816 | return cls | |
| 2957 | 5817 | } | |
| 2958 | 5818 | ||
| 2959 | - | var xFileNewTmp func(string, *uintptr, **glib.Error) uintptr | |
| 5819 | + | var xFileNewTmp func(string, uintptr, **glib.Error) uintptr | |
| 2960 | 5820 | ||
| 2961 | 5821 | // Opens a file in the preferred directory for temporary files (as | |
| 2962 | 5822 | // returned by g_get_tmp_dir()) and returns a #GFile and | |
| @@ -2972,7 +5832,7 @@ func FileNewTmp(TmplVar string, IostreamVar **FileIOStream) (*FileBase, error) { | |||
| 2972 | 5832 | var cls *FileBase | |
| 2973 | 5833 | var cerr *glib.Error | |
| 2974 | 5834 | ||
| 2975 | - | cret := xFileNewTmp(TmplVar, gobject.ConvertPtr(IostreamVar), &cerr) | |
| 5835 | + | cret := xFileNewTmp(TmplVar, *gobject.ConvertPtr(IostreamVar), &cerr) | |
| 2976 | 5836 | ||
| 2977 | 5837 | if cret == 0 { | |
| 2978 | 5838 | return nil, cerr | |
M v4/gio/gfiledescriptorbased.go +25 -0
| @@ -15,12 +15,37 @@ type FileDescriptorBasedIface struct { | |||
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | 17 | GIface uintptr | |
| 18 | + | ||
| 19 | + | xGetFd uintptr | |
| 18 | 20 | } | |
| 19 | 21 | ||
| 20 | 22 | func (x *FileDescriptorBasedIface) GoPointer() uintptr { | |
| 21 | 23 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 24 | } | |
| 23 | 25 | ||
| 26 | + | // OverrideGetFd sets the callback function. | |
| 27 | + | func (x *FileDescriptorBasedIface) OverrideGetFd(cb func(FileDescriptorBased) int) { | |
| 28 | + | if cb == nil { | |
| 29 | + | x.xGetFd = 0 | |
| 30 | + | } else { | |
| 31 | + | x.xGetFd = purego.NewCallback(func(FdBasedVarp uintptr) int { | |
| 32 | + | return cb(&FileDescriptorBasedBase{Ptr: FdBasedVarp}) | |
| 33 | + | }) | |
| 34 | + | } | |
| 35 | + | } | |
| 36 | + | ||
| 37 | + | // GetGetFd gets the callback function. | |
| 38 | + | func (x *FileDescriptorBasedIface) GetGetFd() func(FileDescriptorBased) int { | |
| 39 | + | if x.xGetFd == 0 { | |
| 40 | + | return nil | |
| 41 | + | } | |
| 42 | + | var rawCallback func(FdBasedVarp uintptr) int | |
| 43 | + | purego.RegisterFunc(&rawCallback, x.xGetFd) | |
| 44 | + | return func(FdBasedVar FileDescriptorBased) int { | |
| 45 | + | return rawCallback(FdBasedVar.GoPointer()) | |
| 46 | + | } | |
| 47 | + | } | |
| 48 | + | ||
| 24 | 49 | // #GFileDescriptorBased is implemented by streams (implementations of | |
| 25 | 50 | // #GInputStream or #GOutputStream) that are based on file descriptors. | |
| 26 | 51 | // | |
M v4/gio/gfileenumerator.go +338 -3
| @@ -15,13 +15,348 @@ import ( | |||
| 15 | 15 | type FileEnumeratorClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xNextFile uintptr | |
| 21 | + | ||
| 22 | + | xCloseFn uintptr | |
| 23 | + | ||
| 24 | + | xNextFilesAsync uintptr | |
| 25 | + | ||
| 26 | + | xNextFilesFinish uintptr | |
| 27 | + | ||
| 28 | + | xCloseAsync uintptr | |
| 29 | + | ||
| 30 | + | xCloseFinish uintptr | |
| 31 | + | ||
| 32 | + | xGReserved1 uintptr | |
| 33 | + | ||
| 34 | + | xGReserved2 uintptr | |
| 35 | + | ||
| 36 | + | xGReserved3 uintptr | |
| 37 | + | ||
| 38 | + | xGReserved4 uintptr | |
| 39 | + | ||
| 40 | + | xGReserved5 uintptr | |
| 41 | + | ||
| 42 | + | xGReserved6 uintptr | |
| 43 | + | ||
| 44 | + | xGReserved7 uintptr | |
| 19 | 45 | } | |
| 20 | 46 | ||
| 21 | 47 | func (x *FileEnumeratorClass) GoPointer() uintptr { | |
| 22 | 48 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 49 | } | |
| 24 | 50 | ||
| 51 | + | // OverrideNextFile sets the callback function. | |
| 52 | + | func (x *FileEnumeratorClass) OverrideNextFile(cb func(*FileEnumerator, *Cancellable) *FileInfo) { | |
| 53 | + | if cb == nil { | |
| 54 | + | x.xNextFile = 0 | |
| 55 | + | } else { | |
| 56 | + | x.xNextFile = purego.NewCallback(func(EnumeratorVarp uintptr, CancellableVarp uintptr) uintptr { | |
| 57 | + | ret := cb(FileEnumeratorNewFromInternalPtr(EnumeratorVarp), CancellableNewFromInternalPtr(CancellableVarp)) | |
| 58 | + | if ret == nil { | |
| 59 | + | return 0 | |
| 60 | + | } | |
| 61 | + | return ret.GoPointer() | |
| 62 | + | }) | |
| 63 | + | } | |
| 64 | + | } | |
| 65 | + | ||
| 66 | + | // GetNextFile gets the callback function. | |
| 67 | + | func (x *FileEnumeratorClass) GetNextFile() func(*FileEnumerator, *Cancellable) *FileInfo { | |
| 68 | + | if x.xNextFile == 0 { | |
| 69 | + | return nil | |
| 70 | + | } | |
| 71 | + | var rawCallback func(EnumeratorVarp uintptr, CancellableVarp uintptr) uintptr | |
| 72 | + | purego.RegisterFunc(&rawCallback, x.xNextFile) | |
| 73 | + | return func(EnumeratorVar *FileEnumerator, CancellableVar *Cancellable) *FileInfo { | |
| 74 | + | rawRet := rawCallback(EnumeratorVar.GoPointer(), CancellableVar.GoPointer()) | |
| 75 | + | if rawRet == 0 { | |
| 76 | + | return nil | |
| 77 | + | } | |
| 78 | + | ret := &FileInfo{} | |
| 79 | + | ret.Ptr = rawRet | |
| 80 | + | return ret | |
| 81 | + | } | |
| 82 | + | } | |
| 83 | + | ||
| 84 | + | // OverrideCloseFn sets the callback function. | |
| 85 | + | func (x *FileEnumeratorClass) OverrideCloseFn(cb func(*FileEnumerator, *Cancellable) bool) { | |
| 86 | + | if cb == nil { | |
| 87 | + | x.xCloseFn = 0 | |
| 88 | + | } else { | |
| 89 | + | x.xCloseFn = purego.NewCallback(func(EnumeratorVarp uintptr, CancellableVarp uintptr) bool { | |
| 90 | + | return cb(FileEnumeratorNewFromInternalPtr(EnumeratorVarp), CancellableNewFromInternalPtr(CancellableVarp)) | |
| 91 | + | }) | |
| 92 | + | } | |
| 93 | + | } | |
| 94 | + | ||
| 95 | + | // GetCloseFn gets the callback function. | |
| 96 | + | func (x *FileEnumeratorClass) GetCloseFn() func(*FileEnumerator, *Cancellable) bool { | |
| 97 | + | if x.xCloseFn == 0 { | |
| 98 | + | return nil | |
| 99 | + | } | |
| 100 | + | var rawCallback func(EnumeratorVarp uintptr, CancellableVarp uintptr) bool | |
| 101 | + | purego.RegisterFunc(&rawCallback, x.xCloseFn) | |
| 102 | + | return func(EnumeratorVar *FileEnumerator, CancellableVar *Cancellable) bool { | |
| 103 | + | return rawCallback(EnumeratorVar.GoPointer(), CancellableVar.GoPointer()) | |
| 104 | + | } | |
| 105 | + | } | |
| 106 | + | ||
| 107 | + | // OverrideNextFilesAsync sets the callback function. | |
| 108 | + | func (x *FileEnumeratorClass) OverrideNextFilesAsync(cb func(*FileEnumerator, int, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 109 | + | if cb == nil { | |
| 110 | + | x.xNextFilesAsync = 0 | |
| 111 | + | } else { | |
| 112 | + | x.xNextFilesAsync = purego.NewCallback(func(EnumeratorVarp uintptr, NumFilesVarp int, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 113 | + | cb(FileEnumeratorNewFromInternalPtr(EnumeratorVarp), NumFilesVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 114 | + | }) | |
| 115 | + | } | |
| 116 | + | } | |
| 117 | + | ||
| 118 | + | // GetNextFilesAsync gets the callback function. | |
| 119 | + | func (x *FileEnumeratorClass) GetNextFilesAsync() func(*FileEnumerator, int, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 120 | + | if x.xNextFilesAsync == 0 { | |
| 121 | + | return nil | |
| 122 | + | } | |
| 123 | + | var rawCallback func(EnumeratorVarp uintptr, NumFilesVarp int, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 124 | + | purego.RegisterFunc(&rawCallback, x.xNextFilesAsync) | |
| 125 | + | return func(EnumeratorVar *FileEnumerator, NumFilesVar int, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 126 | + | rawCallback(EnumeratorVar.GoPointer(), NumFilesVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 127 | + | } | |
| 128 | + | } | |
| 129 | + | ||
| 130 | + | // OverrideNextFilesFinish sets the callback function. | |
| 131 | + | func (x *FileEnumeratorClass) OverrideNextFilesFinish(cb func(*FileEnumerator, AsyncResult) *glib.List) { | |
| 132 | + | if cb == nil { | |
| 133 | + | x.xNextFilesFinish = 0 | |
| 134 | + | } else { | |
| 135 | + | x.xNextFilesFinish = purego.NewCallback(func(EnumeratorVarp uintptr, ResultVarp uintptr) *glib.List { | |
| 136 | + | return cb(FileEnumeratorNewFromInternalPtr(EnumeratorVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 137 | + | }) | |
| 138 | + | } | |
| 139 | + | } | |
| 140 | + | ||
| 141 | + | // GetNextFilesFinish gets the callback function. | |
| 142 | + | func (x *FileEnumeratorClass) GetNextFilesFinish() func(*FileEnumerator, AsyncResult) *glib.List { | |
| 143 | + | if x.xNextFilesFinish == 0 { | |
| 144 | + | return nil | |
| 145 | + | } | |
| 146 | + | var rawCallback func(EnumeratorVarp uintptr, ResultVarp uintptr) *glib.List | |
| 147 | + | purego.RegisterFunc(&rawCallback, x.xNextFilesFinish) | |
| 148 | + | return func(EnumeratorVar *FileEnumerator, ResultVar AsyncResult) *glib.List { | |
| 149 | + | return rawCallback(EnumeratorVar.GoPointer(), ResultVar.GoPointer()) | |
| 150 | + | } | |
| 151 | + | } | |
| 152 | + | ||
| 153 | + | // OverrideCloseAsync sets the callback function. | |
| 154 | + | func (x *FileEnumeratorClass) OverrideCloseAsync(cb func(*FileEnumerator, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 155 | + | if cb == nil { | |
| 156 | + | x.xCloseAsync = 0 | |
| 157 | + | } else { | |
| 158 | + | x.xCloseAsync = purego.NewCallback(func(EnumeratorVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 159 | + | cb(FileEnumeratorNewFromInternalPtr(EnumeratorVarp), IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 160 | + | }) | |
| 161 | + | } | |
| 162 | + | } | |
| 163 | + | ||
| 164 | + | // GetCloseAsync gets the callback function. | |
| 165 | + | func (x *FileEnumeratorClass) GetCloseAsync() func(*FileEnumerator, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 166 | + | if x.xCloseAsync == 0 { | |
| 167 | + | return nil | |
| 168 | + | } | |
| 169 | + | var rawCallback func(EnumeratorVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 170 | + | purego.RegisterFunc(&rawCallback, x.xCloseAsync) | |
| 171 | + | return func(EnumeratorVar *FileEnumerator, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 172 | + | rawCallback(EnumeratorVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 173 | + | } | |
| 174 | + | } | |
| 175 | + | ||
| 176 | + | // OverrideCloseFinish sets the callback function. | |
| 177 | + | func (x *FileEnumeratorClass) OverrideCloseFinish(cb func(*FileEnumerator, AsyncResult) bool) { | |
| 178 | + | if cb == nil { | |
| 179 | + | x.xCloseFinish = 0 | |
| 180 | + | } else { | |
| 181 | + | x.xCloseFinish = purego.NewCallback(func(EnumeratorVarp uintptr, ResultVarp uintptr) bool { | |
| 182 | + | return cb(FileEnumeratorNewFromInternalPtr(EnumeratorVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 183 | + | }) | |
| 184 | + | } | |
| 185 | + | } | |
| 186 | + | ||
| 187 | + | // GetCloseFinish gets the callback function. | |
| 188 | + | func (x *FileEnumeratorClass) GetCloseFinish() func(*FileEnumerator, AsyncResult) bool { | |
| 189 | + | if x.xCloseFinish == 0 { | |
| 190 | + | return nil | |
| 191 | + | } | |
| 192 | + | var rawCallback func(EnumeratorVarp uintptr, ResultVarp uintptr) bool | |
| 193 | + | purego.RegisterFunc(&rawCallback, x.xCloseFinish) | |
| 194 | + | return func(EnumeratorVar *FileEnumerator, ResultVar AsyncResult) bool { | |
| 195 | + | return rawCallback(EnumeratorVar.GoPointer(), ResultVar.GoPointer()) | |
| 196 | + | } | |
| 197 | + | } | |
| 198 | + | ||
| 199 | + | // OverrideGReserved1 sets the callback function. | |
| 200 | + | func (x *FileEnumeratorClass) OverrideGReserved1(cb func()) { | |
| 201 | + | if cb == nil { | |
| 202 | + | x.xGReserved1 = 0 | |
| 203 | + | } else { | |
| 204 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 205 | + | cb() | |
| 206 | + | }) | |
| 207 | + | } | |
| 208 | + | } | |
| 209 | + | ||
| 210 | + | // GetGReserved1 gets the callback function. | |
| 211 | + | func (x *FileEnumeratorClass) GetGReserved1() func() { | |
| 212 | + | if x.xGReserved1 == 0 { | |
| 213 | + | return nil | |
| 214 | + | } | |
| 215 | + | var rawCallback func() | |
| 216 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 217 | + | return func() { | |
| 218 | + | rawCallback() | |
| 219 | + | } | |
| 220 | + | } | |
| 221 | + | ||
| 222 | + | // OverrideGReserved2 sets the callback function. | |
| 223 | + | func (x *FileEnumeratorClass) OverrideGReserved2(cb func()) { | |
| 224 | + | if cb == nil { | |
| 225 | + | x.xGReserved2 = 0 | |
| 226 | + | } else { | |
| 227 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 228 | + | cb() | |
| 229 | + | }) | |
| 230 | + | } | |
| 231 | + | } | |
| 232 | + | ||
| 233 | + | // GetGReserved2 gets the callback function. | |
| 234 | + | func (x *FileEnumeratorClass) GetGReserved2() func() { | |
| 235 | + | if x.xGReserved2 == 0 { | |
| 236 | + | return nil | |
| 237 | + | } | |
| 238 | + | var rawCallback func() | |
| 239 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 240 | + | return func() { | |
| 241 | + | rawCallback() | |
| 242 | + | } | |
| 243 | + | } | |
| 244 | + | ||
| 245 | + | // OverrideGReserved3 sets the callback function. | |
| 246 | + | func (x *FileEnumeratorClass) OverrideGReserved3(cb func()) { | |
| 247 | + | if cb == nil { | |
| 248 | + | x.xGReserved3 = 0 | |
| 249 | + | } else { | |
| 250 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 251 | + | cb() | |
| 252 | + | }) | |
| 253 | + | } | |
| 254 | + | } | |
| 255 | + | ||
| 256 | + | // GetGReserved3 gets the callback function. | |
| 257 | + | func (x *FileEnumeratorClass) GetGReserved3() func() { | |
| 258 | + | if x.xGReserved3 == 0 { | |
| 259 | + | return nil | |
| 260 | + | } | |
| 261 | + | var rawCallback func() | |
| 262 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 263 | + | return func() { | |
| 264 | + | rawCallback() | |
| 265 | + | } | |
| 266 | + | } | |
| 267 | + | ||
| 268 | + | // OverrideGReserved4 sets the callback function. | |
| 269 | + | func (x *FileEnumeratorClass) OverrideGReserved4(cb func()) { | |
| 270 | + | if cb == nil { | |
| 271 | + | x.xGReserved4 = 0 | |
| 272 | + | } else { | |
| 273 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 274 | + | cb() | |
| 275 | + | }) | |
| 276 | + | } | |
| 277 | + | } | |
| 278 | + | ||
| 279 | + | // GetGReserved4 gets the callback function. | |
| 280 | + | func (x *FileEnumeratorClass) GetGReserved4() func() { | |
| 281 | + | if x.xGReserved4 == 0 { | |
| 282 | + | return nil | |
| 283 | + | } | |
| 284 | + | var rawCallback func() | |
| 285 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 286 | + | return func() { | |
| 287 | + | rawCallback() | |
| 288 | + | } | |
| 289 | + | } | |
| 290 | + | ||
| 291 | + | // OverrideGReserved5 sets the callback function. | |
| 292 | + | func (x *FileEnumeratorClass) OverrideGReserved5(cb func()) { | |
| 293 | + | if cb == nil { | |
| 294 | + | x.xGReserved5 = 0 | |
| 295 | + | } else { | |
| 296 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 297 | + | cb() | |
| 298 | + | }) | |
| 299 | + | } | |
| 300 | + | } | |
| 301 | + | ||
| 302 | + | // GetGReserved5 gets the callback function. | |
| 303 | + | func (x *FileEnumeratorClass) GetGReserved5() func() { | |
| 304 | + | if x.xGReserved5 == 0 { | |
| 305 | + | return nil | |
| 306 | + | } | |
| 307 | + | var rawCallback func() | |
| 308 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 309 | + | return func() { | |
| 310 | + | rawCallback() | |
| 311 | + | } | |
| 312 | + | } | |
| 313 | + | ||
| 314 | + | // OverrideGReserved6 sets the callback function. | |
| 315 | + | func (x *FileEnumeratorClass) OverrideGReserved6(cb func()) { | |
| 316 | + | if cb == nil { | |
| 317 | + | x.xGReserved6 = 0 | |
| 318 | + | } else { | |
| 319 | + | x.xGReserved6 = purego.NewCallback(func() { | |
| 320 | + | cb() | |
| 321 | + | }) | |
| 322 | + | } | |
| 323 | + | } | |
| 324 | + | ||
| 325 | + | // GetGReserved6 gets the callback function. | |
| 326 | + | func (x *FileEnumeratorClass) GetGReserved6() func() { | |
| 327 | + | if x.xGReserved6 == 0 { | |
| 328 | + | return nil | |
| 329 | + | } | |
| 330 | + | var rawCallback func() | |
| 331 | + | purego.RegisterFunc(&rawCallback, x.xGReserved6) | |
| 332 | + | return func() { | |
| 333 | + | rawCallback() | |
| 334 | + | } | |
| 335 | + | } | |
| 336 | + | ||
| 337 | + | // OverrideGReserved7 sets the callback function. | |
| 338 | + | func (x *FileEnumeratorClass) OverrideGReserved7(cb func()) { | |
| 339 | + | if cb == nil { | |
| 340 | + | x.xGReserved7 = 0 | |
| 341 | + | } else { | |
| 342 | + | x.xGReserved7 = purego.NewCallback(func() { | |
| 343 | + | cb() | |
| 344 | + | }) | |
| 345 | + | } | |
| 346 | + | } | |
| 347 | + | ||
| 348 | + | // GetGReserved7 gets the callback function. | |
| 349 | + | func (x *FileEnumeratorClass) GetGReserved7() func() { | |
| 350 | + | if x.xGReserved7 == 0 { | |
| 351 | + | return nil | |
| 352 | + | } | |
| 353 | + | var rawCallback func() | |
| 354 | + | purego.RegisterFunc(&rawCallback, x.xGReserved7) | |
| 355 | + | return func() { | |
| 356 | + | rawCallback() | |
| 357 | + | } | |
| 358 | + | } | |
| 359 | + | ||
| 25 | 360 | type FileEnumeratorPrivate struct { | |
| 26 | 361 | _ structs.HostLayout | |
| 27 | 362 | } | |
| @@ -193,7 +528,7 @@ func (x *FileEnumerator) IsClosed() bool { | |||
| 193 | 528 | return cret | |
| 194 | 529 | } | |
| 195 | 530 | ||
| 196 | - | var xFileEnumeratorIterate func(uintptr, *uintptr, *uintptr, uintptr, **glib.Error) bool | |
| 531 | + | var xFileEnumeratorIterate func(uintptr, uintptr, *uintptr, uintptr, **glib.Error) bool | |
| 197 | 532 | ||
| 198 | 533 | // This is a version of g_file_enumerator_next_file() that's easier to | |
| 199 | 534 | // use correctly from C programs. With g_file_enumerator_next_file(), | |
| @@ -239,7 +574,7 @@ var xFileEnumeratorIterate func(uintptr, *uintptr, *uintptr, uintptr, **glib.Err | |||
| 239 | 574 | func (x *FileEnumerator) Iterate(OutInfoVar **FileInfo, OutChildVar *File, CancellableVar *Cancellable) (bool, error) { | |
| 240 | 575 | var cerr *glib.Error | |
| 241 | 576 | ||
| 242 | - | cret := xFileEnumeratorIterate(x.GoPointer(), gobject.ConvertPtr(OutInfoVar), gobject.ConvertPtr(OutChildVar), CancellableVar.GoPointer(), &cerr) | |
| 577 | + | cret := xFileEnumeratorIterate(x.GoPointer(), *gobject.ConvertPtr(OutInfoVar), gobject.ConvertPtr(OutChildVar), CancellableVar.GoPointer(), &cerr) | |
| 243 | 578 | if cerr == nil { | |
| 244 | 579 | return cret, nil | |
| 245 | 580 | } | |
M v4/gio/gfileinputstream.go +296 -1
| @@ -14,13 +14,308 @@ import ( | |||
| 14 | 14 | type FileInputStreamClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass InputStreamClass | |
| 18 | + | ||
| 19 | + | xTell uintptr | |
| 20 | + | ||
| 21 | + | xCanSeek uintptr | |
| 22 | + | ||
| 23 | + | xSeek uintptr | |
| 24 | + | ||
| 25 | + | xQueryInfo uintptr | |
| 26 | + | ||
| 27 | + | xQueryInfoAsync uintptr | |
| 28 | + | ||
| 29 | + | xQueryInfoFinish uintptr | |
| 30 | + | ||
| 31 | + | xGReserved1 uintptr | |
| 32 | + | ||
| 33 | + | xGReserved2 uintptr | |
| 34 | + | ||
| 35 | + | xGReserved3 uintptr | |
| 36 | + | ||
| 37 | + | xGReserved4 uintptr | |
| 38 | + | ||
| 39 | + | xGReserved5 uintptr | |
| 18 | 40 | } | |
| 19 | 41 | ||
| 20 | 42 | func (x *FileInputStreamClass) GoPointer() uintptr { | |
| 21 | 43 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 44 | } | |
| 23 | 45 | ||
| 46 | + | // OverrideTell sets the callback function. | |
| 47 | + | func (x *FileInputStreamClass) OverrideTell(cb func(*FileInputStream) int64) { | |
| 48 | + | if cb == nil { | |
| 49 | + | x.xTell = 0 | |
| 50 | + | } else { | |
| 51 | + | x.xTell = purego.NewCallback(func(StreamVarp uintptr) int64 { | |
| 52 | + | return cb(FileInputStreamNewFromInternalPtr(StreamVarp)) | |
| 53 | + | }) | |
| 54 | + | } | |
| 55 | + | } | |
| 56 | + | ||
| 57 | + | // GetTell gets the callback function. | |
| 58 | + | func (x *FileInputStreamClass) GetTell() func(*FileInputStream) int64 { | |
| 59 | + | if x.xTell == 0 { | |
| 60 | + | return nil | |
| 61 | + | } | |
| 62 | + | var rawCallback func(StreamVarp uintptr) int64 | |
| 63 | + | purego.RegisterFunc(&rawCallback, x.xTell) | |
| 64 | + | return func(StreamVar *FileInputStream) int64 { | |
| 65 | + | return rawCallback(StreamVar.GoPointer()) | |
| 66 | + | } | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | // OverrideCanSeek sets the callback function. | |
| 70 | + | func (x *FileInputStreamClass) OverrideCanSeek(cb func(*FileInputStream) bool) { | |
| 71 | + | if cb == nil { | |
| 72 | + | x.xCanSeek = 0 | |
| 73 | + | } else { | |
| 74 | + | x.xCanSeek = purego.NewCallback(func(StreamVarp uintptr) bool { | |
| 75 | + | return cb(FileInputStreamNewFromInternalPtr(StreamVarp)) | |
| 76 | + | }) | |
| 77 | + | } | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | // GetCanSeek gets the callback function. | |
| 81 | + | func (x *FileInputStreamClass) GetCanSeek() func(*FileInputStream) bool { | |
| 82 | + | if x.xCanSeek == 0 { | |
| 83 | + | return nil | |
| 84 | + | } | |
| 85 | + | var rawCallback func(StreamVarp uintptr) bool | |
| 86 | + | purego.RegisterFunc(&rawCallback, x.xCanSeek) | |
| 87 | + | return func(StreamVar *FileInputStream) bool { | |
| 88 | + | return rawCallback(StreamVar.GoPointer()) | |
| 89 | + | } | |
| 90 | + | } | |
| 91 | + | ||
| 92 | + | // OverrideSeek sets the callback function. | |
| 93 | + | func (x *FileInputStreamClass) OverrideSeek(cb func(*FileInputStream, int64, glib.SeekType, *Cancellable) bool) { | |
| 94 | + | if cb == nil { | |
| 95 | + | x.xSeek = 0 | |
| 96 | + | } else { | |
| 97 | + | x.xSeek = purego.NewCallback(func(StreamVarp uintptr, OffsetVarp int64, TypeVarp glib.SeekType, CancellableVarp uintptr) bool { | |
| 98 | + | return cb(FileInputStreamNewFromInternalPtr(StreamVarp), OffsetVarp, TypeVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 99 | + | }) | |
| 100 | + | } | |
| 101 | + | } | |
| 102 | + | ||
| 103 | + | // GetSeek gets the callback function. | |
| 104 | + | func (x *FileInputStreamClass) GetSeek() func(*FileInputStream, int64, glib.SeekType, *Cancellable) bool { | |
| 105 | + | if x.xSeek == 0 { | |
| 106 | + | return nil | |
| 107 | + | } | |
| 108 | + | var rawCallback func(StreamVarp uintptr, OffsetVarp int64, TypeVarp glib.SeekType, CancellableVarp uintptr) bool | |
| 109 | + | purego.RegisterFunc(&rawCallback, x.xSeek) | |
| 110 | + | return func(StreamVar *FileInputStream, OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) bool { | |
| 111 | + | return rawCallback(StreamVar.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer()) | |
| 112 | + | } | |
| 113 | + | } | |
| 114 | + | ||
| 115 | + | // OverrideQueryInfo sets the callback function. | |
| 116 | + | func (x *FileInputStreamClass) OverrideQueryInfo(cb func(*FileInputStream, string, *Cancellable) *FileInfo) { | |
| 117 | + | if cb == nil { | |
| 118 | + | x.xQueryInfo = 0 | |
| 119 | + | } else { | |
| 120 | + | x.xQueryInfo = purego.NewCallback(func(StreamVarp uintptr, AttributesVarp string, CancellableVarp uintptr) uintptr { | |
| 121 | + | ret := cb(FileInputStreamNewFromInternalPtr(StreamVarp), AttributesVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 122 | + | if ret == nil { | |
| 123 | + | return 0 | |
| 124 | + | } | |
| 125 | + | return ret.GoPointer() | |
| 126 | + | }) | |
| 127 | + | } | |
| 128 | + | } | |
| 129 | + | ||
| 130 | + | // GetQueryInfo gets the callback function. | |
| 131 | + | func (x *FileInputStreamClass) GetQueryInfo() func(*FileInputStream, string, *Cancellable) *FileInfo { | |
| 132 | + | if x.xQueryInfo == 0 { | |
| 133 | + | return nil | |
| 134 | + | } | |
| 135 | + | var rawCallback func(StreamVarp uintptr, AttributesVarp string, CancellableVarp uintptr) uintptr | |
| 136 | + | purego.RegisterFunc(&rawCallback, x.xQueryInfo) | |
| 137 | + | return func(StreamVar *FileInputStream, AttributesVar string, CancellableVar *Cancellable) *FileInfo { | |
| 138 | + | rawRet := rawCallback(StreamVar.GoPointer(), AttributesVar, CancellableVar.GoPointer()) | |
| 139 | + | if rawRet == 0 { | |
| 140 | + | return nil | |
| 141 | + | } | |
| 142 | + | ret := &FileInfo{} | |
| 143 | + | ret.Ptr = rawRet | |
| 144 | + | return ret | |
| 145 | + | } | |
| 146 | + | } | |
| 147 | + | ||
| 148 | + | // OverrideQueryInfoAsync sets the callback function. | |
| 149 | + | func (x *FileInputStreamClass) OverrideQueryInfoAsync(cb func(*FileInputStream, string, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 150 | + | if cb == nil { | |
| 151 | + | x.xQueryInfoAsync = 0 | |
| 152 | + | } else { | |
| 153 | + | x.xQueryInfoAsync = purego.NewCallback(func(StreamVarp uintptr, AttributesVarp string, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 154 | + | cb(FileInputStreamNewFromInternalPtr(StreamVarp), AttributesVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 155 | + | }) | |
| 156 | + | } | |
| 157 | + | } | |
| 158 | + | ||
| 159 | + | // GetQueryInfoAsync gets the callback function. | |
| 160 | + | func (x *FileInputStreamClass) GetQueryInfoAsync() func(*FileInputStream, string, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 161 | + | if x.xQueryInfoAsync == 0 { | |
| 162 | + | return nil | |
| 163 | + | } | |
| 164 | + | var rawCallback func(StreamVarp uintptr, AttributesVarp string, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 165 | + | purego.RegisterFunc(&rawCallback, x.xQueryInfoAsync) | |
| 166 | + | return func(StreamVar *FileInputStream, AttributesVar string, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 167 | + | rawCallback(StreamVar.GoPointer(), AttributesVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 168 | + | } | |
| 169 | + | } | |
| 170 | + | ||
| 171 | + | // OverrideQueryInfoFinish sets the callback function. | |
| 172 | + | func (x *FileInputStreamClass) OverrideQueryInfoFinish(cb func(*FileInputStream, AsyncResult) *FileInfo) { | |
| 173 | + | if cb == nil { | |
| 174 | + | x.xQueryInfoFinish = 0 | |
| 175 | + | } else { | |
| 176 | + | x.xQueryInfoFinish = purego.NewCallback(func(StreamVarp uintptr, ResultVarp uintptr) uintptr { | |
| 177 | + | ret := cb(FileInputStreamNewFromInternalPtr(StreamVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 178 | + | if ret == nil { | |
| 179 | + | return 0 | |
| 180 | + | } | |
| 181 | + | return ret.GoPointer() | |
| 182 | + | }) | |
| 183 | + | } | |
| 184 | + | } | |
| 185 | + | ||
| 186 | + | // GetQueryInfoFinish gets the callback function. | |
| 187 | + | func (x *FileInputStreamClass) GetQueryInfoFinish() func(*FileInputStream, AsyncResult) *FileInfo { | |
| 188 | + | if x.xQueryInfoFinish == 0 { | |
| 189 | + | return nil | |
| 190 | + | } | |
| 191 | + | var rawCallback func(StreamVarp uintptr, ResultVarp uintptr) uintptr | |
| 192 | + | purego.RegisterFunc(&rawCallback, x.xQueryInfoFinish) | |
| 193 | + | return func(StreamVar *FileInputStream, ResultVar AsyncResult) *FileInfo { | |
| 194 | + | rawRet := rawCallback(StreamVar.GoPointer(), ResultVar.GoPointer()) | |
| 195 | + | if rawRet == 0 { | |
| 196 | + | return nil | |
| 197 | + | } | |
| 198 | + | ret := &FileInfo{} | |
| 199 | + | ret.Ptr = rawRet | |
| 200 | + | return ret | |
| 201 | + | } | |
| 202 | + | } | |
| 203 | + | ||
| 204 | + | // OverrideGReserved1 sets the callback function. | |
| 205 | + | func (x *FileInputStreamClass) OverrideGReserved1(cb func()) { | |
| 206 | + | if cb == nil { | |
| 207 | + | x.xGReserved1 = 0 | |
| 208 | + | } else { | |
| 209 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 210 | + | cb() | |
| 211 | + | }) | |
| 212 | + | } | |
| 213 | + | } | |
| 214 | + | ||
| 215 | + | // GetGReserved1 gets the callback function. | |
| 216 | + | func (x *FileInputStreamClass) GetGReserved1() func() { | |
| 217 | + | if x.xGReserved1 == 0 { | |
| 218 | + | return nil | |
| 219 | + | } | |
| 220 | + | var rawCallback func() | |
| 221 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 222 | + | return func() { | |
| 223 | + | rawCallback() | |
| 224 | + | } | |
| 225 | + | } | |
| 226 | + | ||
| 227 | + | // OverrideGReserved2 sets the callback function. | |
| 228 | + | func (x *FileInputStreamClass) OverrideGReserved2(cb func()) { | |
| 229 | + | if cb == nil { | |
| 230 | + | x.xGReserved2 = 0 | |
| 231 | + | } else { | |
| 232 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 233 | + | cb() | |
| 234 | + | }) | |
| 235 | + | } | |
| 236 | + | } | |
| 237 | + | ||
| 238 | + | // GetGReserved2 gets the callback function. | |
| 239 | + | func (x *FileInputStreamClass) GetGReserved2() func() { | |
| 240 | + | if x.xGReserved2 == 0 { | |
| 241 | + | return nil | |
| 242 | + | } | |
| 243 | + | var rawCallback func() | |
| 244 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 245 | + | return func() { | |
| 246 | + | rawCallback() | |
| 247 | + | } | |
| 248 | + | } | |
| 249 | + | ||
| 250 | + | // OverrideGReserved3 sets the callback function. | |
| 251 | + | func (x *FileInputStreamClass) OverrideGReserved3(cb func()) { | |
| 252 | + | if cb == nil { | |
| 253 | + | x.xGReserved3 = 0 | |
| 254 | + | } else { | |
| 255 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 256 | + | cb() | |
| 257 | + | }) | |
| 258 | + | } | |
| 259 | + | } | |
| 260 | + | ||
| 261 | + | // GetGReserved3 gets the callback function. | |
| 262 | + | func (x *FileInputStreamClass) GetGReserved3() func() { | |
| 263 | + | if x.xGReserved3 == 0 { | |
| 264 | + | return nil | |
| 265 | + | } | |
| 266 | + | var rawCallback func() | |
| 267 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 268 | + | return func() { | |
| 269 | + | rawCallback() | |
| 270 | + | } | |
| 271 | + | } | |
| 272 | + | ||
| 273 | + | // OverrideGReserved4 sets the callback function. | |
| 274 | + | func (x *FileInputStreamClass) OverrideGReserved4(cb func()) { | |
| 275 | + | if cb == nil { | |
| 276 | + | x.xGReserved4 = 0 | |
| 277 | + | } else { | |
| 278 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 279 | + | cb() | |
| 280 | + | }) | |
| 281 | + | } | |
| 282 | + | } | |
| 283 | + | ||
| 284 | + | // GetGReserved4 gets the callback function. | |
| 285 | + | func (x *FileInputStreamClass) GetGReserved4() func() { | |
| 286 | + | if x.xGReserved4 == 0 { | |
| 287 | + | return nil | |
| 288 | + | } | |
| 289 | + | var rawCallback func() | |
| 290 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 291 | + | return func() { | |
| 292 | + | rawCallback() | |
| 293 | + | } | |
| 294 | + | } | |
| 295 | + | ||
| 296 | + | // OverrideGReserved5 sets the callback function. | |
| 297 | + | func (x *FileInputStreamClass) OverrideGReserved5(cb func()) { | |
| 298 | + | if cb == nil { | |
| 299 | + | x.xGReserved5 = 0 | |
| 300 | + | } else { | |
| 301 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 302 | + | cb() | |
| 303 | + | }) | |
| 304 | + | } | |
| 305 | + | } | |
| 306 | + | ||
| 307 | + | // GetGReserved5 gets the callback function. | |
| 308 | + | func (x *FileInputStreamClass) GetGReserved5() func() { | |
| 309 | + | if x.xGReserved5 == 0 { | |
| 310 | + | return nil | |
| 311 | + | } | |
| 312 | + | var rawCallback func() | |
| 313 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 314 | + | return func() { | |
| 315 | + | rawCallback() | |
| 316 | + | } | |
| 317 | + | } | |
| 318 | + | ||
| 24 | 319 | type FileInputStreamPrivate struct { | |
| 25 | 320 | _ structs.HostLayout | |
| 26 | 321 | } | |
M v4/gio/gfileiostream.go +371 -1
| @@ -14,13 +14,383 @@ import ( | |||
| 14 | 14 | type FileIOStreamClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass IOStreamClass | |
| 18 | + | ||
| 19 | + | xTell uintptr | |
| 20 | + | ||
| 21 | + | xCanSeek uintptr | |
| 22 | + | ||
| 23 | + | xSeek uintptr | |
| 24 | + | ||
| 25 | + | xCanTruncate uintptr | |
| 26 | + | ||
| 27 | + | xTruncateFn uintptr | |
| 28 | + | ||
| 29 | + | xQueryInfo uintptr | |
| 30 | + | ||
| 31 | + | xQueryInfoAsync uintptr | |
| 32 | + | ||
| 33 | + | xQueryInfoFinish uintptr | |
| 34 | + | ||
| 35 | + | xGetEtag uintptr | |
| 36 | + | ||
| 37 | + | xGReserved1 uintptr | |
| 38 | + | ||
| 39 | + | xGReserved2 uintptr | |
| 40 | + | ||
| 41 | + | xGReserved3 uintptr | |
| 42 | + | ||
| 43 | + | xGReserved4 uintptr | |
| 44 | + | ||
| 45 | + | xGReserved5 uintptr | |
| 18 | 46 | } | |
| 19 | 47 | ||
| 20 | 48 | func (x *FileIOStreamClass) GoPointer() uintptr { | |
| 21 | 49 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 50 | } | |
| 23 | 51 | ||
| 52 | + | // OverrideTell sets the callback function. | |
| 53 | + | func (x *FileIOStreamClass) OverrideTell(cb func(*FileIOStream) int64) { | |
| 54 | + | if cb == nil { | |
| 55 | + | x.xTell = 0 | |
| 56 | + | } else { | |
| 57 | + | x.xTell = purego.NewCallback(func(StreamVarp uintptr) int64 { | |
| 58 | + | return cb(FileIOStreamNewFromInternalPtr(StreamVarp)) | |
| 59 | + | }) | |
| 60 | + | } | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // GetTell gets the callback function. | |
| 64 | + | func (x *FileIOStreamClass) GetTell() func(*FileIOStream) int64 { | |
| 65 | + | if x.xTell == 0 { | |
| 66 | + | return nil | |
| 67 | + | } | |
| 68 | + | var rawCallback func(StreamVarp uintptr) int64 | |
| 69 | + | purego.RegisterFunc(&rawCallback, x.xTell) | |
| 70 | + | return func(StreamVar *FileIOStream) int64 { | |
| 71 | + | return rawCallback(StreamVar.GoPointer()) | |
| 72 | + | } | |
| 73 | + | } | |
| 74 | + | ||
| 75 | + | // OverrideCanSeek sets the callback function. | |
| 76 | + | func (x *FileIOStreamClass) OverrideCanSeek(cb func(*FileIOStream) bool) { | |
| 77 | + | if cb == nil { | |
| 78 | + | x.xCanSeek = 0 | |
| 79 | + | } else { | |
| 80 | + | x.xCanSeek = purego.NewCallback(func(StreamVarp uintptr) bool { | |
| 81 | + | return cb(FileIOStreamNewFromInternalPtr(StreamVarp)) | |
| 82 | + | }) | |
| 83 | + | } | |
| 84 | + | } | |
| 85 | + | ||
| 86 | + | // GetCanSeek gets the callback function. | |
| 87 | + | func (x *FileIOStreamClass) GetCanSeek() func(*FileIOStream) bool { | |
| 88 | + | if x.xCanSeek == 0 { | |
| 89 | + | return nil | |
| 90 | + | } | |
| 91 | + | var rawCallback func(StreamVarp uintptr) bool | |
| 92 | + | purego.RegisterFunc(&rawCallback, x.xCanSeek) | |
| 93 | + | return func(StreamVar *FileIOStream) bool { | |
| 94 | + | return rawCallback(StreamVar.GoPointer()) | |
| 95 | + | } | |
| 96 | + | } | |
| 97 | + | ||
| 98 | + | // OverrideSeek sets the callback function. | |
| 99 | + | func (x *FileIOStreamClass) OverrideSeek(cb func(*FileIOStream, int64, glib.SeekType, *Cancellable) bool) { | |
| 100 | + | if cb == nil { | |
| 101 | + | x.xSeek = 0 | |
| 102 | + | } else { | |
| 103 | + | x.xSeek = purego.NewCallback(func(StreamVarp uintptr, OffsetVarp int64, TypeVarp glib.SeekType, CancellableVarp uintptr) bool { | |
| 104 | + | return cb(FileIOStreamNewFromInternalPtr(StreamVarp), OffsetVarp, TypeVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 105 | + | }) | |
| 106 | + | } | |
| 107 | + | } | |
| 108 | + | ||
| 109 | + | // GetSeek gets the callback function. | |
| 110 | + | func (x *FileIOStreamClass) GetSeek() func(*FileIOStream, int64, glib.SeekType, *Cancellable) bool { | |
| 111 | + | if x.xSeek == 0 { | |
| 112 | + | return nil | |
| 113 | + | } | |
| 114 | + | var rawCallback func(StreamVarp uintptr, OffsetVarp int64, TypeVarp glib.SeekType, CancellableVarp uintptr) bool | |
| 115 | + | purego.RegisterFunc(&rawCallback, x.xSeek) | |
| 116 | + | return func(StreamVar *FileIOStream, OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) bool { | |
| 117 | + | return rawCallback(StreamVar.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer()) | |
| 118 | + | } | |
| 119 | + | } | |
| 120 | + | ||
| 121 | + | // OverrideCanTruncate sets the callback function. | |
| 122 | + | func (x *FileIOStreamClass) OverrideCanTruncate(cb func(*FileIOStream) bool) { | |
| 123 | + | if cb == nil { | |
| 124 | + | x.xCanTruncate = 0 | |
| 125 | + | } else { | |
| 126 | + | x.xCanTruncate = purego.NewCallback(func(StreamVarp uintptr) bool { | |
| 127 | + | return cb(FileIOStreamNewFromInternalPtr(StreamVarp)) | |
| 128 | + | }) | |
| 129 | + | } | |
| 130 | + | } | |
| 131 | + | ||
| 132 | + | // GetCanTruncate gets the callback function. | |
| 133 | + | func (x *FileIOStreamClass) GetCanTruncate() func(*FileIOStream) bool { | |
| 134 | + | if x.xCanTruncate == 0 { | |
| 135 | + | return nil | |
| 136 | + | } | |
| 137 | + | var rawCallback func(StreamVarp uintptr) bool | |
| 138 | + | purego.RegisterFunc(&rawCallback, x.xCanTruncate) | |
| 139 | + | return func(StreamVar *FileIOStream) bool { | |
| 140 | + | return rawCallback(StreamVar.GoPointer()) | |
| 141 | + | } | |
| 142 | + | } | |
| 143 | + | ||
| 144 | + | // OverrideTruncateFn sets the callback function. | |
| 145 | + | func (x *FileIOStreamClass) OverrideTruncateFn(cb func(*FileIOStream, int64, *Cancellable) bool) { | |
| 146 | + | if cb == nil { | |
| 147 | + | x.xTruncateFn = 0 | |
| 148 | + | } else { | |
| 149 | + | x.xTruncateFn = purego.NewCallback(func(StreamVarp uintptr, SizeVarp int64, CancellableVarp uintptr) bool { | |
| 150 | + | return cb(FileIOStreamNewFromInternalPtr(StreamVarp), SizeVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 151 | + | }) | |
| 152 | + | } | |
| 153 | + | } | |
| 154 | + | ||
| 155 | + | // GetTruncateFn gets the callback function. | |
| 156 | + | func (x *FileIOStreamClass) GetTruncateFn() func(*FileIOStream, int64, *Cancellable) bool { | |
| 157 | + | if x.xTruncateFn == 0 { | |
| 158 | + | return nil | |
| 159 | + | } | |
| 160 | + | var rawCallback func(StreamVarp uintptr, SizeVarp int64, CancellableVarp uintptr) bool | |
| 161 | + | purego.RegisterFunc(&rawCallback, x.xTruncateFn) | |
| 162 | + | return func(StreamVar *FileIOStream, SizeVar int64, CancellableVar *Cancellable) bool { | |
| 163 | + | return rawCallback(StreamVar.GoPointer(), SizeVar, CancellableVar.GoPointer()) | |
| 164 | + | } | |
| 165 | + | } | |
| 166 | + | ||
| 167 | + | // OverrideQueryInfo sets the callback function. | |
| 168 | + | func (x *FileIOStreamClass) OverrideQueryInfo(cb func(*FileIOStream, string, *Cancellable) *FileInfo) { | |
| 169 | + | if cb == nil { | |
| 170 | + | x.xQueryInfo = 0 | |
| 171 | + | } else { | |
| 172 | + | x.xQueryInfo = purego.NewCallback(func(StreamVarp uintptr, AttributesVarp string, CancellableVarp uintptr) uintptr { | |
| 173 | + | ret := cb(FileIOStreamNewFromInternalPtr(StreamVarp), AttributesVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 174 | + | if ret == nil { | |
| 175 | + | return 0 | |
| 176 | + | } | |
| 177 | + | return ret.GoPointer() | |
| 178 | + | }) | |
| 179 | + | } | |
| 180 | + | } | |
| 181 | + | ||
| 182 | + | // GetQueryInfo gets the callback function. | |
| 183 | + | func (x *FileIOStreamClass) GetQueryInfo() func(*FileIOStream, string, *Cancellable) *FileInfo { | |
| 184 | + | if x.xQueryInfo == 0 { | |
| 185 | + | return nil | |
| 186 | + | } | |
| 187 | + | var rawCallback func(StreamVarp uintptr, AttributesVarp string, CancellableVarp uintptr) uintptr | |
| 188 | + | purego.RegisterFunc(&rawCallback, x.xQueryInfo) | |
| 189 | + | return func(StreamVar *FileIOStream, AttributesVar string, CancellableVar *Cancellable) *FileInfo { | |
| 190 | + | rawRet := rawCallback(StreamVar.GoPointer(), AttributesVar, CancellableVar.GoPointer()) | |
| 191 | + | if rawRet == 0 { | |
| 192 | + | return nil | |
| 193 | + | } | |
| 194 | + | ret := &FileInfo{} | |
| 195 | + | ret.Ptr = rawRet | |
| 196 | + | return ret | |
| 197 | + | } | |
| 198 | + | } | |
| 199 | + | ||
| 200 | + | // OverrideQueryInfoAsync sets the callback function. | |
| 201 | + | func (x *FileIOStreamClass) OverrideQueryInfoAsync(cb func(*FileIOStream, string, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 202 | + | if cb == nil { | |
| 203 | + | x.xQueryInfoAsync = 0 | |
| 204 | + | } else { | |
| 205 | + | x.xQueryInfoAsync = purego.NewCallback(func(StreamVarp uintptr, AttributesVarp string, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 206 | + | cb(FileIOStreamNewFromInternalPtr(StreamVarp), AttributesVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 207 | + | }) | |
| 208 | + | } | |
| 209 | + | } | |
| 210 | + | ||
| 211 | + | // GetQueryInfoAsync gets the callback function. | |
| 212 | + | func (x *FileIOStreamClass) GetQueryInfoAsync() func(*FileIOStream, string, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 213 | + | if x.xQueryInfoAsync == 0 { | |
| 214 | + | return nil | |
| 215 | + | } | |
| 216 | + | var rawCallback func(StreamVarp uintptr, AttributesVarp string, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 217 | + | purego.RegisterFunc(&rawCallback, x.xQueryInfoAsync) | |
| 218 | + | return func(StreamVar *FileIOStream, AttributesVar string, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 219 | + | rawCallback(StreamVar.GoPointer(), AttributesVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 220 | + | } | |
| 221 | + | } | |
| 222 | + | ||
| 223 | + | // OverrideQueryInfoFinish sets the callback function. | |
| 224 | + | func (x *FileIOStreamClass) OverrideQueryInfoFinish(cb func(*FileIOStream, AsyncResult) *FileInfo) { | |
| 225 | + | if cb == nil { | |
| 226 | + | x.xQueryInfoFinish = 0 | |
| 227 | + | } else { | |
| 228 | + | x.xQueryInfoFinish = purego.NewCallback(func(StreamVarp uintptr, ResultVarp uintptr) uintptr { | |
| 229 | + | ret := cb(FileIOStreamNewFromInternalPtr(StreamVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 230 | + | if ret == nil { | |
| 231 | + | return 0 | |
| 232 | + | } | |
| 233 | + | return ret.GoPointer() | |
| 234 | + | }) | |
| 235 | + | } | |
| 236 | + | } | |
| 237 | + | ||
| 238 | + | // GetQueryInfoFinish gets the callback function. | |
| 239 | + | func (x *FileIOStreamClass) GetQueryInfoFinish() func(*FileIOStream, AsyncResult) *FileInfo { | |
| 240 | + | if x.xQueryInfoFinish == 0 { | |
| 241 | + | return nil | |
| 242 | + | } | |
| 243 | + | var rawCallback func(StreamVarp uintptr, ResultVarp uintptr) uintptr | |
| 244 | + | purego.RegisterFunc(&rawCallback, x.xQueryInfoFinish) | |
| 245 | + | return func(StreamVar *FileIOStream, ResultVar AsyncResult) *FileInfo { | |
| 246 | + | rawRet := rawCallback(StreamVar.GoPointer(), ResultVar.GoPointer()) | |
| 247 | + | if rawRet == 0 { | |
| 248 | + | return nil | |
| 249 | + | } | |
| 250 | + | ret := &FileInfo{} | |
| 251 | + | ret.Ptr = rawRet | |
| 252 | + | return ret | |
| 253 | + | } | |
| 254 | + | } | |
| 255 | + | ||
| 256 | + | // OverrideGetEtag sets the callback function. | |
| 257 | + | func (x *FileIOStreamClass) OverrideGetEtag(cb func(*FileIOStream) string) { | |
| 258 | + | if cb == nil { | |
| 259 | + | x.xGetEtag = 0 | |
| 260 | + | } else { | |
| 261 | + | x.xGetEtag = purego.NewCallback(func(StreamVarp uintptr) string { | |
| 262 | + | return cb(FileIOStreamNewFromInternalPtr(StreamVarp)) | |
| 263 | + | }) | |
| 264 | + | } | |
| 265 | + | } | |
| 266 | + | ||
| 267 | + | // GetGetEtag gets the callback function. | |
| 268 | + | func (x *FileIOStreamClass) GetGetEtag() func(*FileIOStream) string { | |
| 269 | + | if x.xGetEtag == 0 { | |
| 270 | + | return nil | |
| 271 | + | } | |
| 272 | + | var rawCallback func(StreamVarp uintptr) string | |
| 273 | + | purego.RegisterFunc(&rawCallback, x.xGetEtag) | |
| 274 | + | return func(StreamVar *FileIOStream) string { | |
| 275 | + | return rawCallback(StreamVar.GoPointer()) | |
| 276 | + | } | |
| 277 | + | } | |
| 278 | + | ||
| 279 | + | // OverrideGReserved1 sets the callback function. | |
| 280 | + | func (x *FileIOStreamClass) OverrideGReserved1(cb func()) { | |
| 281 | + | if cb == nil { | |
| 282 | + | x.xGReserved1 = 0 | |
| 283 | + | } else { | |
| 284 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 285 | + | cb() | |
| 286 | + | }) | |
| 287 | + | } | |
| 288 | + | } | |
| 289 | + | ||
| 290 | + | // GetGReserved1 gets the callback function. | |
| 291 | + | func (x *FileIOStreamClass) GetGReserved1() func() { | |
| 292 | + | if x.xGReserved1 == 0 { | |
| 293 | + | return nil | |
| 294 | + | } | |
| 295 | + | var rawCallback func() | |
| 296 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 297 | + | return func() { | |
| 298 | + | rawCallback() | |
| 299 | + | } | |
| 300 | + | } | |
| 301 | + | ||
| 302 | + | // OverrideGReserved2 sets the callback function. | |
| 303 | + | func (x *FileIOStreamClass) OverrideGReserved2(cb func()) { | |
| 304 | + | if cb == nil { | |
| 305 | + | x.xGReserved2 = 0 | |
| 306 | + | } else { | |
| 307 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 308 | + | cb() | |
| 309 | + | }) | |
| 310 | + | } | |
| 311 | + | } | |
| 312 | + | ||
| 313 | + | // GetGReserved2 gets the callback function. | |
| 314 | + | func (x *FileIOStreamClass) GetGReserved2() func() { | |
| 315 | + | if x.xGReserved2 == 0 { | |
| 316 | + | return nil | |
| 317 | + | } | |
| 318 | + | var rawCallback func() | |
| 319 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 320 | + | return func() { | |
| 321 | + | rawCallback() | |
| 322 | + | } | |
| 323 | + | } | |
| 324 | + | ||
| 325 | + | // OverrideGReserved3 sets the callback function. | |
| 326 | + | func (x *FileIOStreamClass) OverrideGReserved3(cb func()) { | |
| 327 | + | if cb == nil { | |
| 328 | + | x.xGReserved3 = 0 | |
| 329 | + | } else { | |
| 330 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 331 | + | cb() | |
| 332 | + | }) | |
| 333 | + | } | |
| 334 | + | } | |
| 335 | + | ||
| 336 | + | // GetGReserved3 gets the callback function. | |
| 337 | + | func (x *FileIOStreamClass) GetGReserved3() func() { | |
| 338 | + | if x.xGReserved3 == 0 { | |
| 339 | + | return nil | |
| 340 | + | } | |
| 341 | + | var rawCallback func() | |
| 342 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 343 | + | return func() { | |
| 344 | + | rawCallback() | |
| 345 | + | } | |
| 346 | + | } | |
| 347 | + | ||
| 348 | + | // OverrideGReserved4 sets the callback function. | |
| 349 | + | func (x *FileIOStreamClass) OverrideGReserved4(cb func()) { | |
| 350 | + | if cb == nil { | |
| 351 | + | x.xGReserved4 = 0 | |
| 352 | + | } else { | |
| 353 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 354 | + | cb() | |
| 355 | + | }) | |
| 356 | + | } | |
| 357 | + | } | |
| 358 | + | ||
| 359 | + | // GetGReserved4 gets the callback function. | |
| 360 | + | func (x *FileIOStreamClass) GetGReserved4() func() { | |
| 361 | + | if x.xGReserved4 == 0 { | |
| 362 | + | return nil | |
| 363 | + | } | |
| 364 | + | var rawCallback func() | |
| 365 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 366 | + | return func() { | |
| 367 | + | rawCallback() | |
| 368 | + | } | |
| 369 | + | } | |
| 370 | + | ||
| 371 | + | // OverrideGReserved5 sets the callback function. | |
| 372 | + | func (x *FileIOStreamClass) OverrideGReserved5(cb func()) { | |
| 373 | + | if cb == nil { | |
| 374 | + | x.xGReserved5 = 0 | |
| 375 | + | } else { | |
| 376 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 377 | + | cb() | |
| 378 | + | }) | |
| 379 | + | } | |
| 380 | + | } | |
| 381 | + | ||
| 382 | + | // GetGReserved5 gets the callback function. | |
| 383 | + | func (x *FileIOStreamClass) GetGReserved5() func() { | |
| 384 | + | if x.xGReserved5 == 0 { | |
| 385 | + | return nil | |
| 386 | + | } | |
| 387 | + | var rawCallback func() | |
| 388 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 389 | + | return func() { | |
| 390 | + | rawCallback() | |
| 391 | + | } | |
| 392 | + | } | |
| 393 | + | ||
| 24 | 394 | type FileIOStreamPrivate struct { | |
| 25 | 395 | _ structs.HostLayout | |
| 26 | 396 | } | |
M v4/gio/gfilemonitor.go +176 -1
| @@ -15,13 +15,188 @@ import ( | |||
| 15 | 15 | type FileMonitorClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xChanged uintptr | |
| 21 | + | ||
| 22 | + | xCancel uintptr | |
| 23 | + | ||
| 24 | + | xGReserved1 uintptr | |
| 25 | + | ||
| 26 | + | xGReserved2 uintptr | |
| 27 | + | ||
| 28 | + | xGReserved3 uintptr | |
| 29 | + | ||
| 30 | + | xGReserved4 uintptr | |
| 31 | + | ||
| 32 | + | xGReserved5 uintptr | |
| 19 | 33 | } | |
| 20 | 34 | ||
| 21 | 35 | func (x *FileMonitorClass) GoPointer() uintptr { | |
| 22 | 36 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 37 | } | |
| 24 | 38 | ||
| 39 | + | // OverrideChanged sets the callback function. | |
| 40 | + | func (x *FileMonitorClass) OverrideChanged(cb func(*FileMonitor, File, File, FileMonitorEvent)) { | |
| 41 | + | if cb == nil { | |
| 42 | + | x.xChanged = 0 | |
| 43 | + | } else { | |
| 44 | + | x.xChanged = purego.NewCallback(func(MonitorVarp uintptr, FileVarp uintptr, OtherFileVarp uintptr, EventTypeVarp FileMonitorEvent) { | |
| 45 | + | cb(FileMonitorNewFromInternalPtr(MonitorVarp), &FileBase{Ptr: FileVarp}, &FileBase{Ptr: OtherFileVarp}, EventTypeVarp) | |
| 46 | + | }) | |
| 47 | + | } | |
| 48 | + | } | |
| 49 | + | ||
| 50 | + | // GetChanged gets the callback function. | |
| 51 | + | func (x *FileMonitorClass) GetChanged() func(*FileMonitor, File, File, FileMonitorEvent) { | |
| 52 | + | if x.xChanged == 0 { | |
| 53 | + | return nil | |
| 54 | + | } | |
| 55 | + | var rawCallback func(MonitorVarp uintptr, FileVarp uintptr, OtherFileVarp uintptr, EventTypeVarp FileMonitorEvent) | |
| 56 | + | purego.RegisterFunc(&rawCallback, x.xChanged) | |
| 57 | + | return func(MonitorVar *FileMonitor, FileVar File, OtherFileVar File, EventTypeVar FileMonitorEvent) { | |
| 58 | + | rawCallback(MonitorVar.GoPointer(), FileVar.GoPointer(), OtherFileVar.GoPointer(), EventTypeVar) | |
| 59 | + | } | |
| 60 | + | } | |
| 61 | + | ||
| 62 | + | // OverrideCancel sets the callback function. | |
| 63 | + | func (x *FileMonitorClass) OverrideCancel(cb func(*FileMonitor) bool) { | |
| 64 | + | if cb == nil { | |
| 65 | + | x.xCancel = 0 | |
| 66 | + | } else { | |
| 67 | + | x.xCancel = purego.NewCallback(func(MonitorVarp uintptr) bool { | |
| 68 | + | return cb(FileMonitorNewFromInternalPtr(MonitorVarp)) | |
| 69 | + | }) | |
| 70 | + | } | |
| 71 | + | } | |
| 72 | + | ||
| 73 | + | // GetCancel gets the callback function. | |
| 74 | + | func (x *FileMonitorClass) GetCancel() func(*FileMonitor) bool { | |
| 75 | + | if x.xCancel == 0 { | |
| 76 | + | return nil | |
| 77 | + | } | |
| 78 | + | var rawCallback func(MonitorVarp uintptr) bool | |
| 79 | + | purego.RegisterFunc(&rawCallback, x.xCancel) | |
| 80 | + | return func(MonitorVar *FileMonitor) bool { | |
| 81 | + | return rawCallback(MonitorVar.GoPointer()) | |
| 82 | + | } | |
| 83 | + | } | |
| 84 | + | ||
| 85 | + | // OverrideGReserved1 sets the callback function. | |
| 86 | + | func (x *FileMonitorClass) OverrideGReserved1(cb func()) { | |
| 87 | + | if cb == nil { | |
| 88 | + | x.xGReserved1 = 0 | |
| 89 | + | } else { | |
| 90 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 91 | + | cb() | |
| 92 | + | }) | |
| 93 | + | } | |
| 94 | + | } | |
| 95 | + | ||
| 96 | + | // GetGReserved1 gets the callback function. | |
| 97 | + | func (x *FileMonitorClass) GetGReserved1() func() { | |
| 98 | + | if x.xGReserved1 == 0 { | |
| 99 | + | return nil | |
| 100 | + | } | |
| 101 | + | var rawCallback func() | |
| 102 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 103 | + | return func() { | |
| 104 | + | rawCallback() | |
| 105 | + | } | |
| 106 | + | } | |
| 107 | + | ||
| 108 | + | // OverrideGReserved2 sets the callback function. | |
| 109 | + | func (x *FileMonitorClass) OverrideGReserved2(cb func()) { | |
| 110 | + | if cb == nil { | |
| 111 | + | x.xGReserved2 = 0 | |
| 112 | + | } else { | |
| 113 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 114 | + | cb() | |
| 115 | + | }) | |
| 116 | + | } | |
| 117 | + | } | |
| 118 | + | ||
| 119 | + | // GetGReserved2 gets the callback function. | |
| 120 | + | func (x *FileMonitorClass) GetGReserved2() func() { | |
| 121 | + | if x.xGReserved2 == 0 { | |
| 122 | + | return nil | |
| 123 | + | } | |
| 124 | + | var rawCallback func() | |
| 125 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 126 | + | return func() { | |
| 127 | + | rawCallback() | |
| 128 | + | } | |
| 129 | + | } | |
| 130 | + | ||
| 131 | + | // OverrideGReserved3 sets the callback function. | |
| 132 | + | func (x *FileMonitorClass) OverrideGReserved3(cb func()) { | |
| 133 | + | if cb == nil { | |
| 134 | + | x.xGReserved3 = 0 | |
| 135 | + | } else { | |
| 136 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 137 | + | cb() | |
| 138 | + | }) | |
| 139 | + | } | |
| 140 | + | } | |
| 141 | + | ||
| 142 | + | // GetGReserved3 gets the callback function. | |
| 143 | + | func (x *FileMonitorClass) GetGReserved3() func() { | |
| 144 | + | if x.xGReserved3 == 0 { | |
| 145 | + | return nil | |
| 146 | + | } | |
| 147 | + | var rawCallback func() | |
| 148 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 149 | + | return func() { | |
| 150 | + | rawCallback() | |
| 151 | + | } | |
| 152 | + | } | |
| 153 | + | ||
| 154 | + | // OverrideGReserved4 sets the callback function. | |
| 155 | + | func (x *FileMonitorClass) OverrideGReserved4(cb func()) { | |
| 156 | + | if cb == nil { | |
| 157 | + | x.xGReserved4 = 0 | |
| 158 | + | } else { | |
| 159 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 160 | + | cb() | |
| 161 | + | }) | |
| 162 | + | } | |
| 163 | + | } | |
| 164 | + | ||
| 165 | + | // GetGReserved4 gets the callback function. | |
| 166 | + | func (x *FileMonitorClass) GetGReserved4() func() { | |
| 167 | + | if x.xGReserved4 == 0 { | |
| 168 | + | return nil | |
| 169 | + | } | |
| 170 | + | var rawCallback func() | |
| 171 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 172 | + | return func() { | |
| 173 | + | rawCallback() | |
| 174 | + | } | |
| 175 | + | } | |
| 176 | + | ||
| 177 | + | // OverrideGReserved5 sets the callback function. | |
| 178 | + | func (x *FileMonitorClass) OverrideGReserved5(cb func()) { | |
| 179 | + | if cb == nil { | |
| 180 | + | x.xGReserved5 = 0 | |
| 181 | + | } else { | |
| 182 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 183 | + | cb() | |
| 184 | + | }) | |
| 185 | + | } | |
| 186 | + | } | |
| 187 | + | ||
| 188 | + | // GetGReserved5 gets the callback function. | |
| 189 | + | func (x *FileMonitorClass) GetGReserved5() func() { | |
| 190 | + | if x.xGReserved5 == 0 { | |
| 191 | + | return nil | |
| 192 | + | } | |
| 193 | + | var rawCallback func() | |
| 194 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 195 | + | return func() { | |
| 196 | + | rawCallback() | |
| 197 | + | } | |
| 198 | + | } | |
| 199 | + | ||
| 25 | 200 | type FileMonitorPrivate struct { | |
| 26 | 201 | _ structs.HostLayout | |
| 27 | 202 | } | |
M v4/gio/gfilenamecompleter.go +101 -1
| @@ -15,13 +15,113 @@ import ( | |||
| 15 | 15 | type FilenameCompleterClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xGotCompletionData uintptr | |
| 21 | + | ||
| 22 | + | xGReserved1 uintptr | |
| 23 | + | ||
| 24 | + | xGReserved2 uintptr | |
| 25 | + | ||
| 26 | + | xGReserved3 uintptr | |
| 19 | 27 | } | |
| 20 | 28 | ||
| 21 | 29 | func (x *FilenameCompleterClass) GoPointer() uintptr { | |
| 22 | 30 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 31 | } | |
| 24 | 32 | ||
| 33 | + | // OverrideGotCompletionData sets the callback function. | |
| 34 | + | func (x *FilenameCompleterClass) OverrideGotCompletionData(cb func(*FilenameCompleter)) { | |
| 35 | + | if cb == nil { | |
| 36 | + | x.xGotCompletionData = 0 | |
| 37 | + | } else { | |
| 38 | + | x.xGotCompletionData = purego.NewCallback(func(FilenameCompleterVarp uintptr) { | |
| 39 | + | cb(FilenameCompleterNewFromInternalPtr(FilenameCompleterVarp)) | |
| 40 | + | }) | |
| 41 | + | } | |
| 42 | + | } | |
| 43 | + | ||
| 44 | + | // GetGotCompletionData gets the callback function. | |
| 45 | + | func (x *FilenameCompleterClass) GetGotCompletionData() func(*FilenameCompleter) { | |
| 46 | + | if x.xGotCompletionData == 0 { | |
| 47 | + | return nil | |
| 48 | + | } | |
| 49 | + | var rawCallback func(FilenameCompleterVarp uintptr) | |
| 50 | + | purego.RegisterFunc(&rawCallback, x.xGotCompletionData) | |
| 51 | + | return func(FilenameCompleterVar *FilenameCompleter) { | |
| 52 | + | rawCallback(FilenameCompleterVar.GoPointer()) | |
| 53 | + | } | |
| 54 | + | } | |
| 55 | + | ||
| 56 | + | // OverrideGReserved1 sets the callback function. | |
| 57 | + | func (x *FilenameCompleterClass) OverrideGReserved1(cb func()) { | |
| 58 | + | if cb == nil { | |
| 59 | + | x.xGReserved1 = 0 | |
| 60 | + | } else { | |
| 61 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 62 | + | cb() | |
| 63 | + | }) | |
| 64 | + | } | |
| 65 | + | } | |
| 66 | + | ||
| 67 | + | // GetGReserved1 gets the callback function. | |
| 68 | + | func (x *FilenameCompleterClass) GetGReserved1() func() { | |
| 69 | + | if x.xGReserved1 == 0 { | |
| 70 | + | return nil | |
| 71 | + | } | |
| 72 | + | var rawCallback func() | |
| 73 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 74 | + | return func() { | |
| 75 | + | rawCallback() | |
| 76 | + | } | |
| 77 | + | } | |
| 78 | + | ||
| 79 | + | // OverrideGReserved2 sets the callback function. | |
| 80 | + | func (x *FilenameCompleterClass) OverrideGReserved2(cb func()) { | |
| 81 | + | if cb == nil { | |
| 82 | + | x.xGReserved2 = 0 | |
| 83 | + | } else { | |
| 84 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 85 | + | cb() | |
| 86 | + | }) | |
| 87 | + | } | |
| 88 | + | } | |
| 89 | + | ||
| 90 | + | // GetGReserved2 gets the callback function. | |
| 91 | + | func (x *FilenameCompleterClass) GetGReserved2() func() { | |
| 92 | + | if x.xGReserved2 == 0 { | |
| 93 | + | return nil | |
| 94 | + | } | |
| 95 | + | var rawCallback func() | |
| 96 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 97 | + | return func() { | |
| 98 | + | rawCallback() | |
| 99 | + | } | |
| 100 | + | } | |
| 101 | + | ||
| 102 | + | // OverrideGReserved3 sets the callback function. | |
| 103 | + | func (x *FilenameCompleterClass) OverrideGReserved3(cb func()) { | |
| 104 | + | if cb == nil { | |
| 105 | + | x.xGReserved3 = 0 | |
| 106 | + | } else { | |
| 107 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 108 | + | cb() | |
| 109 | + | }) | |
| 110 | + | } | |
| 111 | + | } | |
| 112 | + | ||
| 113 | + | // GetGReserved3 gets the callback function. | |
| 114 | + | func (x *FilenameCompleterClass) GetGReserved3() func() { | |
| 115 | + | if x.xGReserved3 == 0 { | |
| 116 | + | return nil | |
| 117 | + | } | |
| 118 | + | var rawCallback func() | |
| 119 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 120 | + | return func() { | |
| 121 | + | rawCallback() | |
| 122 | + | } | |
| 123 | + | } | |
| 124 | + | ||
| 25 | 125 | // Completes partial file and directory names given a partial string by | |
| 26 | 126 | // looking in the file system for clues. Can return a list of possible | |
| 27 | 127 | // completion strings for widget implementations. | |
M v4/gio/gfileoutputstream.go +371 -1
| @@ -14,13 +14,383 @@ import ( | |||
| 14 | 14 | type FileOutputStreamClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass OutputStreamClass | |
| 18 | + | ||
| 19 | + | xTell uintptr | |
| 20 | + | ||
| 21 | + | xCanSeek uintptr | |
| 22 | + | ||
| 23 | + | xSeek uintptr | |
| 24 | + | ||
| 25 | + | xCanTruncate uintptr | |
| 26 | + | ||
| 27 | + | xTruncateFn uintptr | |
| 28 | + | ||
| 29 | + | xQueryInfo uintptr | |
| 30 | + | ||
| 31 | + | xQueryInfoAsync uintptr | |
| 32 | + | ||
| 33 | + | xQueryInfoFinish uintptr | |
| 34 | + | ||
| 35 | + | xGetEtag uintptr | |
| 36 | + | ||
| 37 | + | xGReserved1 uintptr | |
| 38 | + | ||
| 39 | + | xGReserved2 uintptr | |
| 40 | + | ||
| 41 | + | xGReserved3 uintptr | |
| 42 | + | ||
| 43 | + | xGReserved4 uintptr | |
| 44 | + | ||
| 45 | + | xGReserved5 uintptr | |
| 18 | 46 | } | |
| 19 | 47 | ||
| 20 | 48 | func (x *FileOutputStreamClass) GoPointer() uintptr { | |
| 21 | 49 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 50 | } | |
| 23 | 51 | ||
| 52 | + | // OverrideTell sets the callback function. | |
| 53 | + | func (x *FileOutputStreamClass) OverrideTell(cb func(*FileOutputStream) int64) { | |
| 54 | + | if cb == nil { | |
| 55 | + | x.xTell = 0 | |
| 56 | + | } else { | |
| 57 | + | x.xTell = purego.NewCallback(func(StreamVarp uintptr) int64 { | |
| 58 | + | return cb(FileOutputStreamNewFromInternalPtr(StreamVarp)) | |
| 59 | + | }) | |
| 60 | + | } | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // GetTell gets the callback function. | |
| 64 | + | func (x *FileOutputStreamClass) GetTell() func(*FileOutputStream) int64 { | |
| 65 | + | if x.xTell == 0 { | |
| 66 | + | return nil | |
| 67 | + | } | |
| 68 | + | var rawCallback func(StreamVarp uintptr) int64 | |
| 69 | + | purego.RegisterFunc(&rawCallback, x.xTell) | |
| 70 | + | return func(StreamVar *FileOutputStream) int64 { | |
| 71 | + | return rawCallback(StreamVar.GoPointer()) | |
| 72 | + | } | |
| 73 | + | } | |
| 74 | + | ||
| 75 | + | // OverrideCanSeek sets the callback function. | |
| 76 | + | func (x *FileOutputStreamClass) OverrideCanSeek(cb func(*FileOutputStream) bool) { | |
| 77 | + | if cb == nil { | |
| 78 | + | x.xCanSeek = 0 | |
| 79 | + | } else { | |
| 80 | + | x.xCanSeek = purego.NewCallback(func(StreamVarp uintptr) bool { | |
| 81 | + | return cb(FileOutputStreamNewFromInternalPtr(StreamVarp)) | |
| 82 | + | }) | |
| 83 | + | } | |
| 84 | + | } | |
| 85 | + | ||
| 86 | + | // GetCanSeek gets the callback function. | |
| 87 | + | func (x *FileOutputStreamClass) GetCanSeek() func(*FileOutputStream) bool { | |
| 88 | + | if x.xCanSeek == 0 { | |
| 89 | + | return nil | |
| 90 | + | } | |
| 91 | + | var rawCallback func(StreamVarp uintptr) bool | |
| 92 | + | purego.RegisterFunc(&rawCallback, x.xCanSeek) | |
| 93 | + | return func(StreamVar *FileOutputStream) bool { | |
| 94 | + | return rawCallback(StreamVar.GoPointer()) | |
| 95 | + | } | |
| 96 | + | } | |
| 97 | + | ||
| 98 | + | // OverrideSeek sets the callback function. | |
| 99 | + | func (x *FileOutputStreamClass) OverrideSeek(cb func(*FileOutputStream, int64, glib.SeekType, *Cancellable) bool) { | |
| 100 | + | if cb == nil { | |
| 101 | + | x.xSeek = 0 | |
| 102 | + | } else { | |
| 103 | + | x.xSeek = purego.NewCallback(func(StreamVarp uintptr, OffsetVarp int64, TypeVarp glib.SeekType, CancellableVarp uintptr) bool { | |
| 104 | + | return cb(FileOutputStreamNewFromInternalPtr(StreamVarp), OffsetVarp, TypeVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 105 | + | }) | |
| 106 | + | } | |
| 107 | + | } | |
| 108 | + | ||
| 109 | + | // GetSeek gets the callback function. | |
| 110 | + | func (x *FileOutputStreamClass) GetSeek() func(*FileOutputStream, int64, glib.SeekType, *Cancellable) bool { | |
| 111 | + | if x.xSeek == 0 { | |
| 112 | + | return nil | |
| 113 | + | } | |
| 114 | + | var rawCallback func(StreamVarp uintptr, OffsetVarp int64, TypeVarp glib.SeekType, CancellableVarp uintptr) bool | |
| 115 | + | purego.RegisterFunc(&rawCallback, x.xSeek) | |
| 116 | + | return func(StreamVar *FileOutputStream, OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) bool { | |
| 117 | + | return rawCallback(StreamVar.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer()) | |
| 118 | + | } | |
| 119 | + | } | |
| 120 | + | ||
| 121 | + | // OverrideCanTruncate sets the callback function. | |
| 122 | + | func (x *FileOutputStreamClass) OverrideCanTruncate(cb func(*FileOutputStream) bool) { | |
| 123 | + | if cb == nil { | |
| 124 | + | x.xCanTruncate = 0 | |
| 125 | + | } else { | |
| 126 | + | x.xCanTruncate = purego.NewCallback(func(StreamVarp uintptr) bool { | |
| 127 | + | return cb(FileOutputStreamNewFromInternalPtr(StreamVarp)) | |
| 128 | + | }) | |
| 129 | + | } | |
| 130 | + | } | |
| 131 | + | ||
| 132 | + | // GetCanTruncate gets the callback function. | |
| 133 | + | func (x *FileOutputStreamClass) GetCanTruncate() func(*FileOutputStream) bool { | |
| 134 | + | if x.xCanTruncate == 0 { | |
| 135 | + | return nil | |
| 136 | + | } | |
| 137 | + | var rawCallback func(StreamVarp uintptr) bool | |
| 138 | + | purego.RegisterFunc(&rawCallback, x.xCanTruncate) | |
| 139 | + | return func(StreamVar *FileOutputStream) bool { | |
| 140 | + | return rawCallback(StreamVar.GoPointer()) | |
| 141 | + | } | |
| 142 | + | } | |
| 143 | + | ||
| 144 | + | // OverrideTruncateFn sets the callback function. | |
| 145 | + | func (x *FileOutputStreamClass) OverrideTruncateFn(cb func(*FileOutputStream, int64, *Cancellable) bool) { | |
| 146 | + | if cb == nil { | |
| 147 | + | x.xTruncateFn = 0 | |
| 148 | + | } else { | |
| 149 | + | x.xTruncateFn = purego.NewCallback(func(StreamVarp uintptr, SizeVarp int64, CancellableVarp uintptr) bool { | |
| 150 | + | return cb(FileOutputStreamNewFromInternalPtr(StreamVarp), SizeVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 151 | + | }) | |
| 152 | + | } | |
| 153 | + | } | |
| 154 | + | ||
| 155 | + | // GetTruncateFn gets the callback function. | |
| 156 | + | func (x *FileOutputStreamClass) GetTruncateFn() func(*FileOutputStream, int64, *Cancellable) bool { | |
| 157 | + | if x.xTruncateFn == 0 { | |
| 158 | + | return nil | |
| 159 | + | } | |
| 160 | + | var rawCallback func(StreamVarp uintptr, SizeVarp int64, CancellableVarp uintptr) bool | |
| 161 | + | purego.RegisterFunc(&rawCallback, x.xTruncateFn) | |
| 162 | + | return func(StreamVar *FileOutputStream, SizeVar int64, CancellableVar *Cancellable) bool { | |
| 163 | + | return rawCallback(StreamVar.GoPointer(), SizeVar, CancellableVar.GoPointer()) | |
| 164 | + | } | |
| 165 | + | } | |
| 166 | + | ||
| 167 | + | // OverrideQueryInfo sets the callback function. | |
| 168 | + | func (x *FileOutputStreamClass) OverrideQueryInfo(cb func(*FileOutputStream, string, *Cancellable) *FileInfo) { | |
| 169 | + | if cb == nil { | |
| 170 | + | x.xQueryInfo = 0 | |
| 171 | + | } else { | |
| 172 | + | x.xQueryInfo = purego.NewCallback(func(StreamVarp uintptr, AttributesVarp string, CancellableVarp uintptr) uintptr { | |
| 173 | + | ret := cb(FileOutputStreamNewFromInternalPtr(StreamVarp), AttributesVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 174 | + | if ret == nil { | |
| 175 | + | return 0 | |
| 176 | + | } | |
| 177 | + | return ret.GoPointer() | |
| 178 | + | }) | |
| 179 | + | } | |
| 180 | + | } | |
| 181 | + | ||
| 182 | + | // GetQueryInfo gets the callback function. | |
| 183 | + | func (x *FileOutputStreamClass) GetQueryInfo() func(*FileOutputStream, string, *Cancellable) *FileInfo { | |
| 184 | + | if x.xQueryInfo == 0 { | |
| 185 | + | return nil | |
| 186 | + | } | |
| 187 | + | var rawCallback func(StreamVarp uintptr, AttributesVarp string, CancellableVarp uintptr) uintptr | |
| 188 | + | purego.RegisterFunc(&rawCallback, x.xQueryInfo) | |
| 189 | + | return func(StreamVar *FileOutputStream, AttributesVar string, CancellableVar *Cancellable) *FileInfo { | |
| 190 | + | rawRet := rawCallback(StreamVar.GoPointer(), AttributesVar, CancellableVar.GoPointer()) | |
| 191 | + | if rawRet == 0 { | |
| 192 | + | return nil | |
| 193 | + | } | |
| 194 | + | ret := &FileInfo{} | |
| 195 | + | ret.Ptr = rawRet | |
| 196 | + | return ret | |
| 197 | + | } | |
| 198 | + | } | |
| 199 | + | ||
| 200 | + | // OverrideQueryInfoAsync sets the callback function. | |
| 201 | + | func (x *FileOutputStreamClass) OverrideQueryInfoAsync(cb func(*FileOutputStream, string, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 202 | + | if cb == nil { | |
| 203 | + | x.xQueryInfoAsync = 0 | |
| 204 | + | } else { | |
| 205 | + | x.xQueryInfoAsync = purego.NewCallback(func(StreamVarp uintptr, AttributesVarp string, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 206 | + | cb(FileOutputStreamNewFromInternalPtr(StreamVarp), AttributesVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 207 | + | }) | |
| 208 | + | } | |
| 209 | + | } | |
| 210 | + | ||
| 211 | + | // GetQueryInfoAsync gets the callback function. | |
| 212 | + | func (x *FileOutputStreamClass) GetQueryInfoAsync() func(*FileOutputStream, string, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 213 | + | if x.xQueryInfoAsync == 0 { | |
| 214 | + | return nil | |
| 215 | + | } | |
| 216 | + | var rawCallback func(StreamVarp uintptr, AttributesVarp string, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 217 | + | purego.RegisterFunc(&rawCallback, x.xQueryInfoAsync) | |
| 218 | + | return func(StreamVar *FileOutputStream, AttributesVar string, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 219 | + | rawCallback(StreamVar.GoPointer(), AttributesVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 220 | + | } | |
| 221 | + | } | |
| 222 | + | ||
| 223 | + | // OverrideQueryInfoFinish sets the callback function. | |
| 224 | + | func (x *FileOutputStreamClass) OverrideQueryInfoFinish(cb func(*FileOutputStream, AsyncResult) *FileInfo) { | |
| 225 | + | if cb == nil { | |
| 226 | + | x.xQueryInfoFinish = 0 | |
| 227 | + | } else { | |
| 228 | + | x.xQueryInfoFinish = purego.NewCallback(func(StreamVarp uintptr, ResultVarp uintptr) uintptr { | |
| 229 | + | ret := cb(FileOutputStreamNewFromInternalPtr(StreamVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 230 | + | if ret == nil { | |
| 231 | + | return 0 | |
| 232 | + | } | |
| 233 | + | return ret.GoPointer() | |
| 234 | + | }) | |
| 235 | + | } | |
| 236 | + | } | |
| 237 | + | ||
| 238 | + | // GetQueryInfoFinish gets the callback function. | |
| 239 | + | func (x *FileOutputStreamClass) GetQueryInfoFinish() func(*FileOutputStream, AsyncResult) *FileInfo { | |
| 240 | + | if x.xQueryInfoFinish == 0 { | |
| 241 | + | return nil | |
| 242 | + | } | |
| 243 | + | var rawCallback func(StreamVarp uintptr, ResultVarp uintptr) uintptr | |
| 244 | + | purego.RegisterFunc(&rawCallback, x.xQueryInfoFinish) | |
| 245 | + | return func(StreamVar *FileOutputStream, ResultVar AsyncResult) *FileInfo { | |
| 246 | + | rawRet := rawCallback(StreamVar.GoPointer(), ResultVar.GoPointer()) | |
| 247 | + | if rawRet == 0 { | |
| 248 | + | return nil | |
| 249 | + | } | |
| 250 | + | ret := &FileInfo{} | |
| 251 | + | ret.Ptr = rawRet | |
| 252 | + | return ret | |
| 253 | + | } | |
| 254 | + | } | |
| 255 | + | ||
| 256 | + | // OverrideGetEtag sets the callback function. | |
| 257 | + | func (x *FileOutputStreamClass) OverrideGetEtag(cb func(*FileOutputStream) string) { | |
| 258 | + | if cb == nil { | |
| 259 | + | x.xGetEtag = 0 | |
| 260 | + | } else { | |
| 261 | + | x.xGetEtag = purego.NewCallback(func(StreamVarp uintptr) string { | |
| 262 | + | return cb(FileOutputStreamNewFromInternalPtr(StreamVarp)) | |
| 263 | + | }) | |
| 264 | + | } | |
| 265 | + | } | |
| 266 | + | ||
| 267 | + | // GetGetEtag gets the callback function. | |
| 268 | + | func (x *FileOutputStreamClass) GetGetEtag() func(*FileOutputStream) string { | |
| 269 | + | if x.xGetEtag == 0 { | |
| 270 | + | return nil | |
| 271 | + | } | |
| 272 | + | var rawCallback func(StreamVarp uintptr) string | |
| 273 | + | purego.RegisterFunc(&rawCallback, x.xGetEtag) | |
| 274 | + | return func(StreamVar *FileOutputStream) string { | |
| 275 | + | return rawCallback(StreamVar.GoPointer()) | |
| 276 | + | } | |
| 277 | + | } | |
| 278 | + | ||
| 279 | + | // OverrideGReserved1 sets the callback function. | |
| 280 | + | func (x *FileOutputStreamClass) OverrideGReserved1(cb func()) { | |
| 281 | + | if cb == nil { | |
| 282 | + | x.xGReserved1 = 0 | |
| 283 | + | } else { | |
| 284 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 285 | + | cb() | |
| 286 | + | }) | |
| 287 | + | } | |
| 288 | + | } | |
| 289 | + | ||
| 290 | + | // GetGReserved1 gets the callback function. | |
| 291 | + | func (x *FileOutputStreamClass) GetGReserved1() func() { | |
| 292 | + | if x.xGReserved1 == 0 { | |
| 293 | + | return nil | |
| 294 | + | } | |
| 295 | + | var rawCallback func() | |
| 296 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 297 | + | return func() { | |
| 298 | + | rawCallback() | |
| 299 | + | } | |
| 300 | + | } | |
| 301 | + | ||
| 302 | + | // OverrideGReserved2 sets the callback function. | |
| 303 | + | func (x *FileOutputStreamClass) OverrideGReserved2(cb func()) { | |
| 304 | + | if cb == nil { | |
| 305 | + | x.xGReserved2 = 0 | |
| 306 | + | } else { | |
| 307 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 308 | + | cb() | |
| 309 | + | }) | |
| 310 | + | } | |
| 311 | + | } | |
| 312 | + | ||
| 313 | + | // GetGReserved2 gets the callback function. | |
| 314 | + | func (x *FileOutputStreamClass) GetGReserved2() func() { | |
| 315 | + | if x.xGReserved2 == 0 { | |
| 316 | + | return nil | |
| 317 | + | } | |
| 318 | + | var rawCallback func() | |
| 319 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 320 | + | return func() { | |
| 321 | + | rawCallback() | |
| 322 | + | } | |
| 323 | + | } | |
| 324 | + | ||
| 325 | + | // OverrideGReserved3 sets the callback function. | |
| 326 | + | func (x *FileOutputStreamClass) OverrideGReserved3(cb func()) { | |
| 327 | + | if cb == nil { | |
| 328 | + | x.xGReserved3 = 0 | |
| 329 | + | } else { | |
| 330 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 331 | + | cb() | |
| 332 | + | }) | |
| 333 | + | } | |
| 334 | + | } | |
| 335 | + | ||
| 336 | + | // GetGReserved3 gets the callback function. | |
| 337 | + | func (x *FileOutputStreamClass) GetGReserved3() func() { | |
| 338 | + | if x.xGReserved3 == 0 { | |
| 339 | + | return nil | |
| 340 | + | } | |
| 341 | + | var rawCallback func() | |
| 342 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 343 | + | return func() { | |
| 344 | + | rawCallback() | |
| 345 | + | } | |
| 346 | + | } | |
| 347 | + | ||
| 348 | + | // OverrideGReserved4 sets the callback function. | |
| 349 | + | func (x *FileOutputStreamClass) OverrideGReserved4(cb func()) { | |
| 350 | + | if cb == nil { | |
| 351 | + | x.xGReserved4 = 0 | |
| 352 | + | } else { | |
| 353 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 354 | + | cb() | |
| 355 | + | }) | |
| 356 | + | } | |
| 357 | + | } | |
| 358 | + | ||
| 359 | + | // GetGReserved4 gets the callback function. | |
| 360 | + | func (x *FileOutputStreamClass) GetGReserved4() func() { | |
| 361 | + | if x.xGReserved4 == 0 { | |
| 362 | + | return nil | |
| 363 | + | } | |
| 364 | + | var rawCallback func() | |
| 365 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 366 | + | return func() { | |
| 367 | + | rawCallback() | |
| 368 | + | } | |
| 369 | + | } | |
| 370 | + | ||
| 371 | + | // OverrideGReserved5 sets the callback function. | |
| 372 | + | func (x *FileOutputStreamClass) OverrideGReserved5(cb func()) { | |
| 373 | + | if cb == nil { | |
| 374 | + | x.xGReserved5 = 0 | |
| 375 | + | } else { | |
| 376 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 377 | + | cb() | |
| 378 | + | }) | |
| 379 | + | } | |
| 380 | + | } | |
| 381 | + | ||
| 382 | + | // GetGReserved5 gets the callback function. | |
| 383 | + | func (x *FileOutputStreamClass) GetGReserved5() func() { | |
| 384 | + | if x.xGReserved5 == 0 { | |
| 385 | + | return nil | |
| 386 | + | } | |
| 387 | + | var rawCallback func() | |
| 388 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 389 | + | return func() { | |
| 390 | + | rawCallback() | |
| 391 | + | } | |
| 392 | + | } | |
| 393 | + | ||
| 24 | 394 | type FileOutputStreamPrivate struct { | |
| 25 | 395 | _ structs.HostLayout | |
| 26 | 396 | } | |
M v4/gio/gfilterinputstream.go +76 -1
| @@ -14,13 +14,88 @@ import ( | |||
| 14 | 14 | type FilterInputStreamClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass InputStreamClass | |
| 18 | + | ||
| 19 | + | xGReserved1 uintptr | |
| 20 | + | ||
| 21 | + | xGReserved2 uintptr | |
| 22 | + | ||
| 23 | + | xGReserved3 uintptr | |
| 18 | 24 | } | |
| 19 | 25 | ||
| 20 | 26 | func (x *FilterInputStreamClass) GoPointer() uintptr { | |
| 21 | 27 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 28 | } | |
| 23 | 29 | ||
| 30 | + | // OverrideGReserved1 sets the callback function. | |
| 31 | + | func (x *FilterInputStreamClass) OverrideGReserved1(cb func()) { | |
| 32 | + | if cb == nil { | |
| 33 | + | x.xGReserved1 = 0 | |
| 34 | + | } else { | |
| 35 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 36 | + | cb() | |
| 37 | + | }) | |
| 38 | + | } | |
| 39 | + | } | |
| 40 | + | ||
| 41 | + | // GetGReserved1 gets the callback function. | |
| 42 | + | func (x *FilterInputStreamClass) GetGReserved1() func() { | |
| 43 | + | if x.xGReserved1 == 0 { | |
| 44 | + | return nil | |
| 45 | + | } | |
| 46 | + | var rawCallback func() | |
| 47 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 48 | + | return func() { | |
| 49 | + | rawCallback() | |
| 50 | + | } | |
| 51 | + | } | |
| 52 | + | ||
| 53 | + | // OverrideGReserved2 sets the callback function. | |
| 54 | + | func (x *FilterInputStreamClass) OverrideGReserved2(cb func()) { | |
| 55 | + | if cb == nil { | |
| 56 | + | x.xGReserved2 = 0 | |
| 57 | + | } else { | |
| 58 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 59 | + | cb() | |
| 60 | + | }) | |
| 61 | + | } | |
| 62 | + | } | |
| 63 | + | ||
| 64 | + | // GetGReserved2 gets the callback function. | |
| 65 | + | func (x *FilterInputStreamClass) GetGReserved2() func() { | |
| 66 | + | if x.xGReserved2 == 0 { | |
| 67 | + | return nil | |
| 68 | + | } | |
| 69 | + | var rawCallback func() | |
| 70 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 71 | + | return func() { | |
| 72 | + | rawCallback() | |
| 73 | + | } | |
| 74 | + | } | |
| 75 | + | ||
| 76 | + | // OverrideGReserved3 sets the callback function. | |
| 77 | + | func (x *FilterInputStreamClass) OverrideGReserved3(cb func()) { | |
| 78 | + | if cb == nil { | |
| 79 | + | x.xGReserved3 = 0 | |
| 80 | + | } else { | |
| 81 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 82 | + | cb() | |
| 83 | + | }) | |
| 84 | + | } | |
| 85 | + | } | |
| 86 | + | ||
| 87 | + | // GetGReserved3 gets the callback function. | |
| 88 | + | func (x *FilterInputStreamClass) GetGReserved3() func() { | |
| 89 | + | if x.xGReserved3 == 0 { | |
| 90 | + | return nil | |
| 91 | + | } | |
| 92 | + | var rawCallback func() | |
| 93 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 94 | + | return func() { | |
| 95 | + | rawCallback() | |
| 96 | + | } | |
| 97 | + | } | |
| 98 | + | ||
| 24 | 99 | // Base class for input stream implementations that perform some | |
| 25 | 100 | // kind of filtering operation on a base stream. Typical examples | |
| 26 | 101 | // of filtering operations are character set conversion, compression | |
M v4/gio/gfilteroutputstream.go +76 -1
| @@ -14,13 +14,88 @@ import ( | |||
| 14 | 14 | type FilterOutputStreamClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass OutputStreamClass | |
| 18 | + | ||
| 19 | + | xGReserved1 uintptr | |
| 20 | + | ||
| 21 | + | xGReserved2 uintptr | |
| 22 | + | ||
| 23 | + | xGReserved3 uintptr | |
| 18 | 24 | } | |
| 19 | 25 | ||
| 20 | 26 | func (x *FilterOutputStreamClass) GoPointer() uintptr { | |
| 21 | 27 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 28 | } | |
| 23 | 29 | ||
| 30 | + | // OverrideGReserved1 sets the callback function. | |
| 31 | + | func (x *FilterOutputStreamClass) OverrideGReserved1(cb func()) { | |
| 32 | + | if cb == nil { | |
| 33 | + | x.xGReserved1 = 0 | |
| 34 | + | } else { | |
| 35 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 36 | + | cb() | |
| 37 | + | }) | |
| 38 | + | } | |
| 39 | + | } | |
| 40 | + | ||
| 41 | + | // GetGReserved1 gets the callback function. | |
| 42 | + | func (x *FilterOutputStreamClass) GetGReserved1() func() { | |
| 43 | + | if x.xGReserved1 == 0 { | |
| 44 | + | return nil | |
| 45 | + | } | |
| 46 | + | var rawCallback func() | |
| 47 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 48 | + | return func() { | |
| 49 | + | rawCallback() | |
| 50 | + | } | |
| 51 | + | } | |
| 52 | + | ||
| 53 | + | // OverrideGReserved2 sets the callback function. | |
| 54 | + | func (x *FilterOutputStreamClass) OverrideGReserved2(cb func()) { | |
| 55 | + | if cb == nil { | |
| 56 | + | x.xGReserved2 = 0 | |
| 57 | + | } else { | |
| 58 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 59 | + | cb() | |
| 60 | + | }) | |
| 61 | + | } | |
| 62 | + | } | |
| 63 | + | ||
| 64 | + | // GetGReserved2 gets the callback function. | |
| 65 | + | func (x *FilterOutputStreamClass) GetGReserved2() func() { | |
| 66 | + | if x.xGReserved2 == 0 { | |
| 67 | + | return nil | |
| 68 | + | } | |
| 69 | + | var rawCallback func() | |
| 70 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 71 | + | return func() { | |
| 72 | + | rawCallback() | |
| 73 | + | } | |
| 74 | + | } | |
| 75 | + | ||
| 76 | + | // OverrideGReserved3 sets the callback function. | |
| 77 | + | func (x *FilterOutputStreamClass) OverrideGReserved3(cb func()) { | |
| 78 | + | if cb == nil { | |
| 79 | + | x.xGReserved3 = 0 | |
| 80 | + | } else { | |
| 81 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 82 | + | cb() | |
| 83 | + | }) | |
| 84 | + | } | |
| 85 | + | } | |
| 86 | + | ||
| 87 | + | // GetGReserved3 gets the callback function. | |
| 88 | + | func (x *FilterOutputStreamClass) GetGReserved3() func() { | |
| 89 | + | if x.xGReserved3 == 0 { | |
| 90 | + | return nil | |
| 91 | + | } | |
| 92 | + | var rawCallback func() | |
| 93 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 94 | + | return func() { | |
| 95 | + | rawCallback() | |
| 96 | + | } | |
| 97 | + | } | |
| 98 | + | ||
| 24 | 99 | // Base class for output stream implementations that perform some | |
| 25 | 100 | // kind of filtering operation on a base stream. Typical examples | |
| 26 | 101 | // of filtering operations are character set conversion, compression | |
M v4/gio/gicon.go +135 -0
| @@ -18,12 +18,147 @@ type IconIface struct { | |||
| 18 | 18 | _ structs.HostLayout | |
| 19 | 19 | ||
| 20 | 20 | GIface uintptr | |
| 21 | + | ||
| 22 | + | xHash uintptr | |
| 23 | + | ||
| 24 | + | xEqual uintptr | |
| 25 | + | ||
| 26 | + | xToTokens uintptr | |
| 27 | + | ||
| 28 | + | xFromTokens uintptr | |
| 29 | + | ||
| 30 | + | xSerialize uintptr | |
| 21 | 31 | } | |
| 22 | 32 | ||
| 23 | 33 | func (x *IconIface) GoPointer() uintptr { | |
| 24 | 34 | return uintptr(unsafe.Pointer(x)) | |
| 25 | 35 | } | |
| 26 | 36 | ||
| 37 | + | // OverrideHash sets the callback function. | |
| 38 | + | func (x *IconIface) OverrideHash(cb func(Icon) uint) { | |
| 39 | + | if cb == nil { | |
| 40 | + | x.xHash = 0 | |
| 41 | + | } else { | |
| 42 | + | x.xHash = purego.NewCallback(func(IconVarp uintptr) uint { | |
| 43 | + | return cb(&IconBase{Ptr: IconVarp}) | |
| 44 | + | }) | |
| 45 | + | } | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | // GetHash gets the callback function. | |
| 49 | + | func (x *IconIface) GetHash() func(Icon) uint { | |
| 50 | + | if x.xHash == 0 { | |
| 51 | + | return nil | |
| 52 | + | } | |
| 53 | + | var rawCallback func(IconVarp uintptr) uint | |
| 54 | + | purego.RegisterFunc(&rawCallback, x.xHash) | |
| 55 | + | return func(IconVar Icon) uint { | |
| 56 | + | return rawCallback(IconVar.GoPointer()) | |
| 57 | + | } | |
| 58 | + | } | |
| 59 | + | ||
| 60 | + | // OverrideEqual sets the callback function. | |
| 61 | + | func (x *IconIface) OverrideEqual(cb func(Icon, Icon) bool) { | |
| 62 | + | if cb == nil { | |
| 63 | + | x.xEqual = 0 | |
| 64 | + | } else { | |
| 65 | + | x.xEqual = purego.NewCallback(func(Icon1Varp uintptr, Icon2Varp uintptr) bool { | |
| 66 | + | return cb(&IconBase{Ptr: Icon1Varp}, &IconBase{Ptr: Icon2Varp}) | |
| 67 | + | }) | |
| 68 | + | } | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | // GetEqual gets the callback function. | |
| 72 | + | func (x *IconIface) GetEqual() func(Icon, Icon) bool { | |
| 73 | + | if x.xEqual == 0 { | |
| 74 | + | return nil | |
| 75 | + | } | |
| 76 | + | var rawCallback func(Icon1Varp uintptr, Icon2Varp uintptr) bool | |
| 77 | + | purego.RegisterFunc(&rawCallback, x.xEqual) | |
| 78 | + | return func(Icon1Var Icon, Icon2Var Icon) bool { | |
| 79 | + | return rawCallback(Icon1Var.GoPointer(), Icon2Var.GoPointer()) | |
| 80 | + | } | |
| 81 | + | } | |
| 82 | + | ||
| 83 | + | // OverrideToTokens sets the callback function. | |
| 84 | + | func (x *IconIface) OverrideToTokens(cb func(Icon, []uintptr, int) bool) { | |
| 85 | + | if cb == nil { | |
| 86 | + | x.xToTokens = 0 | |
| 87 | + | } else { | |
| 88 | + | x.xToTokens = purego.NewCallback(func(IconVarp uintptr, TokensVarp []uintptr, OutVersionVarp int) bool { | |
| 89 | + | return cb(&IconBase{Ptr: IconVarp}, TokensVarp, OutVersionVarp) | |
| 90 | + | }) | |
| 91 | + | } | |
| 92 | + | } | |
| 93 | + | ||
| 94 | + | // GetToTokens gets the callback function. | |
| 95 | + | func (x *IconIface) GetToTokens() func(Icon, []uintptr, int) bool { | |
| 96 | + | if x.xToTokens == 0 { | |
| 97 | + | return nil | |
| 98 | + | } | |
| 99 | + | var rawCallback func(IconVarp uintptr, TokensVarp []uintptr, OutVersionVarp int) bool | |
| 100 | + | purego.RegisterFunc(&rawCallback, x.xToTokens) | |
| 101 | + | return func(IconVar Icon, TokensVar []uintptr, OutVersionVar int) bool { | |
| 102 | + | return rawCallback(IconVar.GoPointer(), TokensVar, OutVersionVar) | |
| 103 | + | } | |
| 104 | + | } | |
| 105 | + | ||
| 106 | + | // OverrideFromTokens sets the callback function. | |
| 107 | + | func (x *IconIface) OverrideFromTokens(cb func(string, int, int) *IconBase) { | |
| 108 | + | if cb == nil { | |
| 109 | + | x.xFromTokens = 0 | |
| 110 | + | } else { | |
| 111 | + | x.xFromTokens = purego.NewCallback(func(TokensVarp string, NumTokensVarp int, VersionVarp int) uintptr { | |
| 112 | + | ret := cb(TokensVarp, NumTokensVarp, VersionVarp) | |
| 113 | + | if ret == nil { | |
| 114 | + | return 0 | |
| 115 | + | } | |
| 116 | + | return ret.GoPointer() | |
| 117 | + | }) | |
| 118 | + | } | |
| 119 | + | } | |
| 120 | + | ||
| 121 | + | // GetFromTokens gets the callback function. | |
| 122 | + | func (x *IconIface) GetFromTokens() func(string, int, int) *IconBase { | |
| 123 | + | if x.xFromTokens == 0 { | |
| 124 | + | return nil | |
| 125 | + | } | |
| 126 | + | var rawCallback func(TokensVarp string, NumTokensVarp int, VersionVarp int) uintptr | |
| 127 | + | purego.RegisterFunc(&rawCallback, x.xFromTokens) | |
| 128 | + | return func(TokensVar string, NumTokensVar int, VersionVar int) *IconBase { | |
| 129 | + | rawRet := rawCallback(TokensVar, NumTokensVar, VersionVar) | |
| 130 | + | if rawRet == 0 { | |
| 131 | + | return nil | |
| 132 | + | } | |
| 133 | + | ret := &IconBase{} | |
| 134 | + | ret.Ptr = rawRet | |
| 135 | + | return ret | |
| 136 | + | } | |
| 137 | + | } | |
| 138 | + | ||
| 139 | + | // OverrideSerialize sets the callback function. | |
| 140 | + | func (x *IconIface) OverrideSerialize(cb func(Icon) *glib.Variant) { | |
| 141 | + | if cb == nil { | |
| 142 | + | x.xSerialize = 0 | |
| 143 | + | } else { | |
| 144 | + | x.xSerialize = purego.NewCallback(func(IconVarp uintptr) *glib.Variant { | |
| 145 | + | return cb(&IconBase{Ptr: IconVarp}) | |
| 146 | + | }) | |
| 147 | + | } | |
| 148 | + | } | |
| 149 | + | ||
| 150 | + | // GetSerialize gets the callback function. | |
| 151 | + | func (x *IconIface) GetSerialize() func(Icon) *glib.Variant { | |
| 152 | + | if x.xSerialize == 0 { | |
| 153 | + | return nil | |
| 154 | + | } | |
| 155 | + | var rawCallback func(IconVarp uintptr) *glib.Variant | |
| 156 | + | purego.RegisterFunc(&rawCallback, x.xSerialize) | |
| 157 | + | return func(IconVar Icon) *glib.Variant { | |
| 158 | + | return rawCallback(IconVar.GoPointer()) | |
| 159 | + | } | |
| 160 | + | } | |
| 161 | + | ||
| 27 | 162 | // #GIcon is a very minimal interface for icons. It provides functions | |
| 28 | 163 | // for checking the equality of two icons, hashing of icons and | |
| 29 | 164 | // serializing an icon to and from strings. | |
M v4/gio/ginetaddress.go +51 -1
| @@ -14,13 +14,63 @@ import ( | |||
| 14 | 14 | type InetAddressClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass gobject.ObjectClass | |
| 18 | + | ||
| 19 | + | xToString uintptr | |
| 20 | + | ||
| 21 | + | xToBytes uintptr | |
| 18 | 22 | } | |
| 19 | 23 | ||
| 20 | 24 | func (x *InetAddressClass) GoPointer() uintptr { | |
| 21 | 25 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 26 | } | |
| 23 | 27 | ||
| 28 | + | // OverrideToString sets the callback function. | |
| 29 | + | func (x *InetAddressClass) OverrideToString(cb func(*InetAddress) string) { | |
| 30 | + | if cb == nil { | |
| 31 | + | x.xToString = 0 | |
| 32 | + | } else { | |
| 33 | + | x.xToString = purego.NewCallback(func(AddressVarp uintptr) string { | |
| 34 | + | return cb(InetAddressNewFromInternalPtr(AddressVarp)) | |
| 35 | + | }) | |
| 36 | + | } | |
| 37 | + | } | |
| 38 | + | ||
| 39 | + | // GetToString gets the callback function. | |
| 40 | + | func (x *InetAddressClass) GetToString() func(*InetAddress) string { | |
| 41 | + | if x.xToString == 0 { | |
| 42 | + | return nil | |
| 43 | + | } | |
| 44 | + | var rawCallback func(AddressVarp uintptr) string | |
| 45 | + | purego.RegisterFunc(&rawCallback, x.xToString) | |
| 46 | + | return func(AddressVar *InetAddress) string { | |
| 47 | + | return rawCallback(AddressVar.GoPointer()) | |
| 48 | + | } | |
| 49 | + | } | |
| 50 | + | ||
| 51 | + | // OverrideToBytes sets the callback function. | |
| 52 | + | func (x *InetAddressClass) OverrideToBytes(cb func(*InetAddress) byte) { | |
| 53 | + | if cb == nil { | |
| 54 | + | x.xToBytes = 0 | |
| 55 | + | } else { | |
| 56 | + | x.xToBytes = purego.NewCallback(func(AddressVarp uintptr) byte { | |
| 57 | + | return cb(InetAddressNewFromInternalPtr(AddressVarp)) | |
| 58 | + | }) | |
| 59 | + | } | |
| 60 | + | } | |
| 61 | + | ||
| 62 | + | // GetToBytes gets the callback function. | |
| 63 | + | func (x *InetAddressClass) GetToBytes() func(*InetAddress) byte { | |
| 64 | + | if x.xToBytes == 0 { | |
| 65 | + | return nil | |
| 66 | + | } | |
| 67 | + | var rawCallback func(AddressVarp uintptr) byte | |
| 68 | + | purego.RegisterFunc(&rawCallback, x.xToBytes) | |
| 69 | + | return func(AddressVar *InetAddress) byte { | |
| 70 | + | return rawCallback(AddressVar.GoPointer()) | |
| 71 | + | } | |
| 72 | + | } | |
| 73 | + | ||
| 24 | 74 | type InetAddressPrivate struct { | |
| 25 | 75 | _ structs.HostLayout | |
| 26 | 76 | } | |
M v4/gio/ginetaddressmask.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type InetAddressMaskClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *InetAddressMaskClass) GoPointer() uintptr { | |
M v4/gio/ginetsocketaddress.go +1 -1
| @@ -14,7 +14,7 @@ import ( | |||
| 14 | 14 | type InetSocketAddressClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass SocketAddressClass | |
| 18 | 18 | } | |
| 19 | 19 | ||
| 20 | 20 | func (x *InetSocketAddressClass) GoPointer() uintptr { | |
M v4/gio/ginitable.go +26 -1
| @@ -18,12 +18,37 @@ type InitableIface struct { | |||
| 18 | 18 | _ structs.HostLayout | |
| 19 | 19 | ||
| 20 | 20 | GIface uintptr | |
| 21 | + | ||
| 22 | + | xInit uintptr | |
| 21 | 23 | } | |
| 22 | 24 | ||
| 23 | 25 | func (x *InitableIface) GoPointer() uintptr { | |
| 24 | 26 | return uintptr(unsafe.Pointer(x)) | |
| 25 | 27 | } | |
| 26 | 28 | ||
| 29 | + | // OverrideInit sets the callback function. | |
| 30 | + | func (x *InitableIface) OverrideInit(cb func(Initable, *Cancellable) bool) { | |
| 31 | + | if cb == nil { | |
| 32 | + | x.xInit = 0 | |
| 33 | + | } else { | |
| 34 | + | x.xInit = purego.NewCallback(func(InitableVarp uintptr, CancellableVarp uintptr) bool { | |
| 35 | + | return cb(&InitableBase{Ptr: InitableVarp}, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 36 | + | }) | |
| 37 | + | } | |
| 38 | + | } | |
| 39 | + | ||
| 40 | + | // GetInit gets the callback function. | |
| 41 | + | func (x *InitableIface) GetInit() func(Initable, *Cancellable) bool { | |
| 42 | + | if x.xInit == 0 { | |
| 43 | + | return nil | |
| 44 | + | } | |
| 45 | + | var rawCallback func(InitableVarp uintptr, CancellableVarp uintptr) bool | |
| 46 | + | purego.RegisterFunc(&rawCallback, x.xInit) | |
| 47 | + | return func(InitableVar Initable, CancellableVar *Cancellable) bool { | |
| 48 | + | return rawCallback(InitableVar.GoPointer(), CancellableVar.GoPointer()) | |
| 49 | + | } | |
| 50 | + | } | |
| 51 | + | ||
| 27 | 52 | // #GInitable is implemented by objects that can fail during | |
| 28 | 53 | // initialization. If an object implements this interface then | |
| 29 | 54 | // it must be initialized as the first thing after construction, | |
| @@ -51,7 +76,7 @@ func (x *InitableIface) GoPointer() uintptr { | |||
| 51 | 76 | type Initable interface { | |
| 52 | 77 | GoPointer() uintptr | |
| 53 | 78 | SetGoPointer(uintptr) | |
| 54 | - | Init(CancellableVar *Cancellable) bool | |
| 79 | + | Init(CancellableVar *Cancellable) (bool, error) | |
| 55 | 80 | } | |
| 56 | 81 | ||
| 57 | 82 | var xInitableGLibType func() types.GType | |
M v4/gio/ginputstream.go +351 -1
| @@ -15,13 +15,363 @@ import ( | |||
| 15 | 15 | type InputStreamClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xReadFn uintptr | |
| 21 | + | ||
| 22 | + | xSkip uintptr | |
| 23 | + | ||
| 24 | + | xCloseFn uintptr | |
| 25 | + | ||
| 26 | + | xReadAsync uintptr | |
| 27 | + | ||
| 28 | + | xReadFinish uintptr | |
| 29 | + | ||
| 30 | + | xSkipAsync uintptr | |
| 31 | + | ||
| 32 | + | xSkipFinish uintptr | |
| 33 | + | ||
| 34 | + | xCloseAsync uintptr | |
| 35 | + | ||
| 36 | + | xCloseFinish uintptr | |
| 37 | + | ||
| 38 | + | xGReserved1 uintptr | |
| 39 | + | ||
| 40 | + | xGReserved2 uintptr | |
| 41 | + | ||
| 42 | + | xGReserved3 uintptr | |
| 43 | + | ||
| 44 | + | xGReserved4 uintptr | |
| 45 | + | ||
| 46 | + | xGReserved5 uintptr | |
| 19 | 47 | } | |
| 20 | 48 | ||
| 21 | 49 | func (x *InputStreamClass) GoPointer() uintptr { | |
| 22 | 50 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 51 | } | |
| 24 | 52 | ||
| 53 | + | // OverrideReadFn sets the callback function. | |
| 54 | + | func (x *InputStreamClass) OverrideReadFn(cb func(*InputStream, uintptr, uint, *Cancellable) int) { | |
| 55 | + | if cb == nil { | |
| 56 | + | x.xReadFn = 0 | |
| 57 | + | } else { | |
| 58 | + | x.xReadFn = purego.NewCallback(func(StreamVarp uintptr, BufferVarp uintptr, CountVarp uint, CancellableVarp uintptr) int { | |
| 59 | + | return cb(InputStreamNewFromInternalPtr(StreamVarp), BufferVarp, CountVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 60 | + | }) | |
| 61 | + | } | |
| 62 | + | } | |
| 63 | + | ||
| 64 | + | // GetReadFn gets the callback function. | |
| 65 | + | func (x *InputStreamClass) GetReadFn() func(*InputStream, uintptr, uint, *Cancellable) int { | |
| 66 | + | if x.xReadFn == 0 { | |
| 67 | + | return nil | |
| 68 | + | } | |
| 69 | + | var rawCallback func(StreamVarp uintptr, BufferVarp uintptr, CountVarp uint, CancellableVarp uintptr) int | |
| 70 | + | purego.RegisterFunc(&rawCallback, x.xReadFn) | |
| 71 | + | return func(StreamVar *InputStream, BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) int { | |
| 72 | + | return rawCallback(StreamVar.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer()) | |
| 73 | + | } | |
| 74 | + | } | |
| 75 | + | ||
| 76 | + | // OverrideSkip sets the callback function. | |
| 77 | + | func (x *InputStreamClass) OverrideSkip(cb func(*InputStream, uint, *Cancellable) int) { | |
| 78 | + | if cb == nil { | |
| 79 | + | x.xSkip = 0 | |
| 80 | + | } else { | |
| 81 | + | x.xSkip = purego.NewCallback(func(StreamVarp uintptr, CountVarp uint, CancellableVarp uintptr) int { | |
| 82 | + | return cb(InputStreamNewFromInternalPtr(StreamVarp), CountVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 83 | + | }) | |
| 84 | + | } | |
| 85 | + | } | |
| 86 | + | ||
| 87 | + | // GetSkip gets the callback function. | |
| 88 | + | func (x *InputStreamClass) GetSkip() func(*InputStream, uint, *Cancellable) int { | |
| 89 | + | if x.xSkip == 0 { | |
| 90 | + | return nil | |
| 91 | + | } | |
| 92 | + | var rawCallback func(StreamVarp uintptr, CountVarp uint, CancellableVarp uintptr) int | |
| 93 | + | purego.RegisterFunc(&rawCallback, x.xSkip) | |
| 94 | + | return func(StreamVar *InputStream, CountVar uint, CancellableVar *Cancellable) int { | |
| 95 | + | return rawCallback(StreamVar.GoPointer(), CountVar, CancellableVar.GoPointer()) | |
| 96 | + | } | |
| 97 | + | } | |
| 98 | + | ||
| 99 | + | // OverrideCloseFn sets the callback function. | |
| 100 | + | func (x *InputStreamClass) OverrideCloseFn(cb func(*InputStream, *Cancellable) bool) { | |
| 101 | + | if cb == nil { | |
| 102 | + | x.xCloseFn = 0 | |
| 103 | + | } else { | |
| 104 | + | x.xCloseFn = purego.NewCallback(func(StreamVarp uintptr, CancellableVarp uintptr) bool { | |
| 105 | + | return cb(InputStreamNewFromInternalPtr(StreamVarp), CancellableNewFromInternalPtr(CancellableVarp)) | |
| 106 | + | }) | |
| 107 | + | } | |
| 108 | + | } | |
| 109 | + | ||
| 110 | + | // GetCloseFn gets the callback function. | |
| 111 | + | func (x *InputStreamClass) GetCloseFn() func(*InputStream, *Cancellable) bool { | |
| 112 | + | if x.xCloseFn == 0 { | |
| 113 | + | return nil | |
| 114 | + | } | |
| 115 | + | var rawCallback func(StreamVarp uintptr, CancellableVarp uintptr) bool | |
| 116 | + | purego.RegisterFunc(&rawCallback, x.xCloseFn) | |
| 117 | + | return func(StreamVar *InputStream, CancellableVar *Cancellable) bool { | |
| 118 | + | return rawCallback(StreamVar.GoPointer(), CancellableVar.GoPointer()) | |
| 119 | + | } | |
| 120 | + | } | |
| 121 | + | ||
| 122 | + | // OverrideReadAsync sets the callback function. | |
| 123 | + | func (x *InputStreamClass) OverrideReadAsync(cb func(*InputStream, []byte, uint, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 124 | + | if cb == nil { | |
| 125 | + | x.xReadAsync = 0 | |
| 126 | + | } else { | |
| 127 | + | x.xReadAsync = purego.NewCallback(func(StreamVarp uintptr, BufferVarp []byte, CountVarp uint, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 128 | + | cb(InputStreamNewFromInternalPtr(StreamVarp), BufferVarp, CountVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 129 | + | }) | |
| 130 | + | } | |
| 131 | + | } | |
| 132 | + | ||
| 133 | + | // GetReadAsync gets the callback function. | |
| 134 | + | func (x *InputStreamClass) GetReadAsync() func(*InputStream, []byte, uint, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 135 | + | if x.xReadAsync == 0 { | |
| 136 | + | return nil | |
| 137 | + | } | |
| 138 | + | var rawCallback func(StreamVarp uintptr, BufferVarp []byte, CountVarp uint, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 139 | + | purego.RegisterFunc(&rawCallback, x.xReadAsync) | |
| 140 | + | return func(StreamVar *InputStream, BufferVar []byte, CountVar uint, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 141 | + | rawCallback(StreamVar.GoPointer(), BufferVar, CountVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 142 | + | } | |
| 143 | + | } | |
| 144 | + | ||
| 145 | + | // OverrideReadFinish sets the callback function. | |
| 146 | + | func (x *InputStreamClass) OverrideReadFinish(cb func(*InputStream, AsyncResult) int) { | |
| 147 | + | if cb == nil { | |
| 148 | + | x.xReadFinish = 0 | |
| 149 | + | } else { | |
| 150 | + | x.xReadFinish = purego.NewCallback(func(StreamVarp uintptr, ResultVarp uintptr) int { | |
| 151 | + | return cb(InputStreamNewFromInternalPtr(StreamVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 152 | + | }) | |
| 153 | + | } | |
| 154 | + | } | |
| 155 | + | ||
| 156 | + | // GetReadFinish gets the callback function. | |
| 157 | + | func (x *InputStreamClass) GetReadFinish() func(*InputStream, AsyncResult) int { | |
| 158 | + | if x.xReadFinish == 0 { | |
| 159 | + | return nil | |
| 160 | + | } | |
| 161 | + | var rawCallback func(StreamVarp uintptr, ResultVarp uintptr) int | |
| 162 | + | purego.RegisterFunc(&rawCallback, x.xReadFinish) | |
| 163 | + | return func(StreamVar *InputStream, ResultVar AsyncResult) int { | |
| 164 | + | return rawCallback(StreamVar.GoPointer(), ResultVar.GoPointer()) | |
| 165 | + | } | |
| 166 | + | } | |
| 167 | + | ||
| 168 | + | // OverrideSkipAsync sets the callback function. | |
| 169 | + | func (x *InputStreamClass) OverrideSkipAsync(cb func(*InputStream, uint, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 170 | + | if cb == nil { | |
| 171 | + | x.xSkipAsync = 0 | |
| 172 | + | } else { | |
| 173 | + | x.xSkipAsync = purego.NewCallback(func(StreamVarp uintptr, CountVarp uint, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 174 | + | cb(InputStreamNewFromInternalPtr(StreamVarp), CountVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 175 | + | }) | |
| 176 | + | } | |
| 177 | + | } | |
| 178 | + | ||
| 179 | + | // GetSkipAsync gets the callback function. | |
| 180 | + | func (x *InputStreamClass) GetSkipAsync() func(*InputStream, uint, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 181 | + | if x.xSkipAsync == 0 { | |
| 182 | + | return nil | |
| 183 | + | } | |
| 184 | + | var rawCallback func(StreamVarp uintptr, CountVarp uint, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 185 | + | purego.RegisterFunc(&rawCallback, x.xSkipAsync) | |
| 186 | + | return func(StreamVar *InputStream, CountVar uint, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 187 | + | rawCallback(StreamVar.GoPointer(), CountVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 188 | + | } | |
| 189 | + | } | |
| 190 | + | ||
| 191 | + | // OverrideSkipFinish sets the callback function. | |
| 192 | + | func (x *InputStreamClass) OverrideSkipFinish(cb func(*InputStream, AsyncResult) int) { | |
| 193 | + | if cb == nil { | |
| 194 | + | x.xSkipFinish = 0 | |
| 195 | + | } else { | |
| 196 | + | x.xSkipFinish = purego.NewCallback(func(StreamVarp uintptr, ResultVarp uintptr) int { | |
| 197 | + | return cb(InputStreamNewFromInternalPtr(StreamVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 198 | + | }) | |
| 199 | + | } | |
| 200 | + | } | |
| 201 | + | ||
| 202 | + | // GetSkipFinish gets the callback function. | |
| 203 | + | func (x *InputStreamClass) GetSkipFinish() func(*InputStream, AsyncResult) int { | |
| 204 | + | if x.xSkipFinish == 0 { | |
| 205 | + | return nil | |
| 206 | + | } | |
| 207 | + | var rawCallback func(StreamVarp uintptr, ResultVarp uintptr) int | |
| 208 | + | purego.RegisterFunc(&rawCallback, x.xSkipFinish) | |
| 209 | + | return func(StreamVar *InputStream, ResultVar AsyncResult) int { | |
| 210 | + | return rawCallback(StreamVar.GoPointer(), ResultVar.GoPointer()) | |
| 211 | + | } | |
| 212 | + | } | |
| 213 | + | ||
| 214 | + | // OverrideCloseAsync sets the callback function. | |
| 215 | + | func (x *InputStreamClass) OverrideCloseAsync(cb func(*InputStream, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 216 | + | if cb == nil { | |
| 217 | + | x.xCloseAsync = 0 | |
| 218 | + | } else { | |
| 219 | + | x.xCloseAsync = purego.NewCallback(func(StreamVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 220 | + | cb(InputStreamNewFromInternalPtr(StreamVarp), IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 221 | + | }) | |
| 222 | + | } | |
| 223 | + | } | |
| 224 | + | ||
| 225 | + | // GetCloseAsync gets the callback function. | |
| 226 | + | func (x *InputStreamClass) GetCloseAsync() func(*InputStream, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 227 | + | if x.xCloseAsync == 0 { | |
| 228 | + | return nil | |
| 229 | + | } | |
| 230 | + | var rawCallback func(StreamVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 231 | + | purego.RegisterFunc(&rawCallback, x.xCloseAsync) | |
| 232 | + | return func(StreamVar *InputStream, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 233 | + | rawCallback(StreamVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 234 | + | } | |
| 235 | + | } | |
| 236 | + | ||
| 237 | + | // OverrideCloseFinish sets the callback function. | |
| 238 | + | func (x *InputStreamClass) OverrideCloseFinish(cb func(*InputStream, AsyncResult) bool) { | |
| 239 | + | if cb == nil { | |
| 240 | + | x.xCloseFinish = 0 | |
| 241 | + | } else { | |
| 242 | + | x.xCloseFinish = purego.NewCallback(func(StreamVarp uintptr, ResultVarp uintptr) bool { | |
| 243 | + | return cb(InputStreamNewFromInternalPtr(StreamVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 244 | + | }) | |
| 245 | + | } | |
| 246 | + | } | |
| 247 | + | ||
| 248 | + | // GetCloseFinish gets the callback function. | |
| 249 | + | func (x *InputStreamClass) GetCloseFinish() func(*InputStream, AsyncResult) bool { | |
| 250 | + | if x.xCloseFinish == 0 { | |
| 251 | + | return nil | |
| 252 | + | } | |
| 253 | + | var rawCallback func(StreamVarp uintptr, ResultVarp uintptr) bool | |
| 254 | + | purego.RegisterFunc(&rawCallback, x.xCloseFinish) | |
| 255 | + | return func(StreamVar *InputStream, ResultVar AsyncResult) bool { | |
| 256 | + | return rawCallback(StreamVar.GoPointer(), ResultVar.GoPointer()) | |
| 257 | + | } | |
| 258 | + | } | |
| 259 | + | ||
| 260 | + | // OverrideGReserved1 sets the callback function. | |
| 261 | + | func (x *InputStreamClass) OverrideGReserved1(cb func()) { | |
| 262 | + | if cb == nil { | |
| 263 | + | x.xGReserved1 = 0 | |
| 264 | + | } else { | |
| 265 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 266 | + | cb() | |
| 267 | + | }) | |
| 268 | + | } | |
| 269 | + | } | |
| 270 | + | ||
| 271 | + | // GetGReserved1 gets the callback function. | |
| 272 | + | func (x *InputStreamClass) GetGReserved1() func() { | |
| 273 | + | if x.xGReserved1 == 0 { | |
| 274 | + | return nil | |
| 275 | + | } | |
| 276 | + | var rawCallback func() | |
| 277 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 278 | + | return func() { | |
| 279 | + | rawCallback() | |
| 280 | + | } | |
| 281 | + | } | |
| 282 | + | ||
| 283 | + | // OverrideGReserved2 sets the callback function. | |
| 284 | + | func (x *InputStreamClass) OverrideGReserved2(cb func()) { | |
| 285 | + | if cb == nil { | |
| 286 | + | x.xGReserved2 = 0 | |
| 287 | + | } else { | |
| 288 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 289 | + | cb() | |
| 290 | + | }) | |
| 291 | + | } | |
| 292 | + | } | |
| 293 | + | ||
| 294 | + | // GetGReserved2 gets the callback function. | |
| 295 | + | func (x *InputStreamClass) GetGReserved2() func() { | |
| 296 | + | if x.xGReserved2 == 0 { | |
| 297 | + | return nil | |
| 298 | + | } | |
| 299 | + | var rawCallback func() | |
| 300 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 301 | + | return func() { | |
| 302 | + | rawCallback() | |
| 303 | + | } | |
| 304 | + | } | |
| 305 | + | ||
| 306 | + | // OverrideGReserved3 sets the callback function. | |
| 307 | + | func (x *InputStreamClass) OverrideGReserved3(cb func()) { | |
| 308 | + | if cb == nil { | |
| 309 | + | x.xGReserved3 = 0 | |
| 310 | + | } else { | |
| 311 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 312 | + | cb() | |
| 313 | + | }) | |
| 314 | + | } | |
| 315 | + | } | |
| 316 | + | ||
| 317 | + | // GetGReserved3 gets the callback function. | |
| 318 | + | func (x *InputStreamClass) GetGReserved3() func() { | |
| 319 | + | if x.xGReserved3 == 0 { | |
| 320 | + | return nil | |
| 321 | + | } | |
| 322 | + | var rawCallback func() | |
| 323 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 324 | + | return func() { | |
| 325 | + | rawCallback() | |
| 326 | + | } | |
| 327 | + | } | |
| 328 | + | ||
| 329 | + | // OverrideGReserved4 sets the callback function. | |
| 330 | + | func (x *InputStreamClass) OverrideGReserved4(cb func()) { | |
| 331 | + | if cb == nil { | |
| 332 | + | x.xGReserved4 = 0 | |
| 333 | + | } else { | |
| 334 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 335 | + | cb() | |
| 336 | + | }) | |
| 337 | + | } | |
| 338 | + | } | |
| 339 | + | ||
| 340 | + | // GetGReserved4 gets the callback function. | |
| 341 | + | func (x *InputStreamClass) GetGReserved4() func() { | |
| 342 | + | if x.xGReserved4 == 0 { | |
| 343 | + | return nil | |
| 344 | + | } | |
| 345 | + | var rawCallback func() | |
| 346 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 347 | + | return func() { | |
| 348 | + | rawCallback() | |
| 349 | + | } | |
| 350 | + | } | |
| 351 | + | ||
| 352 | + | // OverrideGReserved5 sets the callback function. | |
| 353 | + | func (x *InputStreamClass) OverrideGReserved5(cb func()) { | |
| 354 | + | if cb == nil { | |
| 355 | + | x.xGReserved5 = 0 | |
| 356 | + | } else { | |
| 357 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 358 | + | cb() | |
| 359 | + | }) | |
| 360 | + | } | |
| 361 | + | } | |
| 362 | + | ||
| 363 | + | // GetGReserved5 gets the callback function. | |
| 364 | + | func (x *InputStreamClass) GetGReserved5() func() { | |
| 365 | + | if x.xGReserved5 == 0 { | |
| 366 | + | return nil | |
| 367 | + | } | |
| 368 | + | var rawCallback func() | |
| 369 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 370 | + | return func() { | |
| 371 | + | rawCallback() | |
| 372 | + | } | |
| 373 | + | } | |
| 374 | + | ||
| 25 | 375 | type InputStreamPrivate struct { | |
| 26 | 376 | _ structs.HostLayout | |
| 27 | 377 | } | |
M v4/gio/gio-2.0.go +4 -4
| @@ -1136,7 +1136,7 @@ func (x *DBusConnection) CallWithUnixFdList(BusNameVar string, ObjectPathVar str | |||
| 1136 | 1136 | ||
| 1137 | 1137 | } | |
| 1138 | 1138 | ||
| 1139 | - | var xDBusConnectionCallWithUnixFdListFinish func(uintptr, *uintptr, uintptr, **glib.Error) *glib.Variant | |
| 1139 | + | var xDBusConnectionCallWithUnixFdListFinish func(uintptr, uintptr, uintptr, **glib.Error) *glib.Variant | |
| 1140 | 1140 | ||
| 1141 | 1141 | // Finishes an operation started with g_dbus_connection_call_with_unix_fd_list(). | |
| 1142 | 1142 | // | |
| @@ -1153,7 +1153,7 @@ var xDBusConnectionCallWithUnixFdListFinish func(uintptr, *uintptr, uintptr, **g | |||
| 1153 | 1153 | func (x *DBusConnection) CallWithUnixFdListFinish(OutFdListVar **UnixFDList, ResVar AsyncResult) (*glib.Variant, error) { | |
| 1154 | 1154 | var cerr *glib.Error | |
| 1155 | 1155 | ||
| 1156 | - | cret := xDBusConnectionCallWithUnixFdListFinish(x.GoPointer(), gobject.ConvertPtr(OutFdListVar), ResVar.GoPointer(), &cerr) | |
| 1156 | + | cret := xDBusConnectionCallWithUnixFdListFinish(x.GoPointer(), *gobject.ConvertPtr(OutFdListVar), ResVar.GoPointer(), &cerr) | |
| 1157 | 1157 | if cerr == nil { | |
| 1158 | 1158 | return cret, nil | |
| 1159 | 1159 | } | |
| @@ -1161,7 +1161,7 @@ func (x *DBusConnection) CallWithUnixFdListFinish(OutFdListVar **UnixFDList, Res | |||
| 1161 | 1161 | ||
| 1162 | 1162 | } | |
| 1163 | 1163 | ||
| 1164 | - | var xDBusConnectionCallWithUnixFdListSync func(uintptr, string, string, string, string, *glib.Variant, *glib.VariantType, DBusCallFlags, int, uintptr, *uintptr, uintptr, **glib.Error) *glib.Variant | |
| 1164 | + | var xDBusConnectionCallWithUnixFdListSync func(uintptr, string, string, string, string, *glib.Variant, *glib.VariantType, DBusCallFlags, int, uintptr, uintptr, uintptr, **glib.Error) *glib.Variant | |
| 1165 | 1165 | ||
| 1166 | 1166 | // Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects. | |
| 1167 | 1167 | // See g_dbus_connection_call_with_unix_fd_list() and | |
| @@ -1171,7 +1171,7 @@ var xDBusConnectionCallWithUnixFdListSync func(uintptr, string, string, string, | |||
| 1171 | 1171 | func (x *DBusConnection) CallWithUnixFdListSync(BusNameVar string, ObjectPathVar string, InterfaceNameVar string, MethodNameVar string, ParametersVar *glib.Variant, ReplyTypeVar *glib.VariantType, FlagsVar DBusCallFlags, TimeoutMsecVar int, FdListVar *UnixFDList, OutFdListVar **UnixFDList, CancellableVar *Cancellable) (*glib.Variant, error) { | |
| 1172 | 1172 | var cerr *glib.Error | |
| 1173 | 1173 | ||
| 1174 | - | cret := xDBusConnectionCallWithUnixFdListSync(x.GoPointer(), BusNameVar, ObjectPathVar, InterfaceNameVar, MethodNameVar, ParametersVar, ReplyTypeVar, FlagsVar, TimeoutMsecVar, FdListVar.GoPointer(), gobject.ConvertPtr(OutFdListVar), CancellableVar.GoPointer(), &cerr) | |
| 1174 | + | cret := xDBusConnectionCallWithUnixFdListSync(x.GoPointer(), BusNameVar, ObjectPathVar, InterfaceNameVar, MethodNameVar, ParametersVar, ReplyTypeVar, FlagsVar, TimeoutMsecVar, FdListVar.GoPointer(), *gobject.ConvertPtr(OutFdListVar), CancellableVar.GoPointer(), &cerr) | |
| 1175 | 1175 | if cerr == nil { | |
| 1176 | 1176 | return cret, nil | |
| 1177 | 1177 | } | |
M v4/gio/giostream.go +396 -1
| @@ -15,13 +15,408 @@ import ( | |||
| 15 | 15 | type IOStreamClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xGetInputStream uintptr | |
| 21 | + | ||
| 22 | + | xGetOutputStream uintptr | |
| 23 | + | ||
| 24 | + | xCloseFn uintptr | |
| 25 | + | ||
| 26 | + | xCloseAsync uintptr | |
| 27 | + | ||
| 28 | + | xCloseFinish uintptr | |
| 29 | + | ||
| 30 | + | xGReserved1 uintptr | |
| 31 | + | ||
| 32 | + | xGReserved2 uintptr | |
| 33 | + | ||
| 34 | + | xGReserved3 uintptr | |
| 35 | + | ||
| 36 | + | xGReserved4 uintptr | |
| 37 | + | ||
| 38 | + | xGReserved5 uintptr | |
| 39 | + | ||
| 40 | + | xGReserved6 uintptr | |
| 41 | + | ||
| 42 | + | xGReserved7 uintptr | |
| 43 | + | ||
| 44 | + | xGReserved8 uintptr | |
| 45 | + | ||
| 46 | + | xGReserved9 uintptr | |
| 47 | + | ||
| 48 | + | xGReserved10 uintptr | |
| 19 | 49 | } | |
| 20 | 50 | ||
| 21 | 51 | func (x *IOStreamClass) GoPointer() uintptr { | |
| 22 | 52 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 53 | } | |
| 24 | 54 | ||
| 55 | + | // OverrideGetInputStream sets the callback function. | |
| 56 | + | func (x *IOStreamClass) OverrideGetInputStream(cb func(*IOStream) *InputStream) { | |
| 57 | + | if cb == nil { | |
| 58 | + | x.xGetInputStream = 0 | |
| 59 | + | } else { | |
| 60 | + | x.xGetInputStream = purego.NewCallback(func(StreamVarp uintptr) uintptr { | |
| 61 | + | ret := cb(IOStreamNewFromInternalPtr(StreamVarp)) | |
| 62 | + | if ret == nil { | |
| 63 | + | return 0 | |
| 64 | + | } | |
| 65 | + | return ret.GoPointer() | |
| 66 | + | }) | |
| 67 | + | } | |
| 68 | + | } | |
| 69 | + | ||
| 70 | + | // GetGetInputStream gets the callback function. | |
| 71 | + | func (x *IOStreamClass) GetGetInputStream() func(*IOStream) *InputStream { | |
| 72 | + | if x.xGetInputStream == 0 { | |
| 73 | + | return nil | |
| 74 | + | } | |
| 75 | + | var rawCallback func(StreamVarp uintptr) uintptr | |
| 76 | + | purego.RegisterFunc(&rawCallback, x.xGetInputStream) | |
| 77 | + | return func(StreamVar *IOStream) *InputStream { | |
| 78 | + | rawRet := rawCallback(StreamVar.GoPointer()) | |
| 79 | + | if rawRet == 0 { | |
| 80 | + | return nil | |
| 81 | + | } | |
| 82 | + | ret := &InputStream{} | |
| 83 | + | ret.Ptr = rawRet | |
| 84 | + | return ret | |
| 85 | + | } | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | // OverrideGetOutputStream sets the callback function. | |
| 89 | + | func (x *IOStreamClass) OverrideGetOutputStream(cb func(*IOStream) *OutputStream) { | |
| 90 | + | if cb == nil { | |
| 91 | + | x.xGetOutputStream = 0 | |
| 92 | + | } else { | |
| 93 | + | x.xGetOutputStream = purego.NewCallback(func(StreamVarp uintptr) uintptr { | |
| 94 | + | ret := cb(IOStreamNewFromInternalPtr(StreamVarp)) | |
| 95 | + | if ret == nil { | |
| 96 | + | return 0 | |
| 97 | + | } | |
| 98 | + | return ret.GoPointer() | |
| 99 | + | }) | |
| 100 | + | } | |
| 101 | + | } | |
| 102 | + | ||
| 103 | + | // GetGetOutputStream gets the callback function. | |
| 104 | + | func (x *IOStreamClass) GetGetOutputStream() func(*IOStream) *OutputStream { | |
| 105 | + | if x.xGetOutputStream == 0 { | |
| 106 | + | return nil | |
| 107 | + | } | |
| 108 | + | var rawCallback func(StreamVarp uintptr) uintptr | |
| 109 | + | purego.RegisterFunc(&rawCallback, x.xGetOutputStream) | |
| 110 | + | return func(StreamVar *IOStream) *OutputStream { | |
| 111 | + | rawRet := rawCallback(StreamVar.GoPointer()) | |
| 112 | + | if rawRet == 0 { | |
| 113 | + | return nil | |
| 114 | + | } | |
| 115 | + | ret := &OutputStream{} | |
| 116 | + | ret.Ptr = rawRet | |
| 117 | + | return ret | |
| 118 | + | } | |
| 119 | + | } | |
| 120 | + | ||
| 121 | + | // OverrideCloseFn sets the callback function. | |
| 122 | + | func (x *IOStreamClass) OverrideCloseFn(cb func(*IOStream, *Cancellable) bool) { | |
| 123 | + | if cb == nil { | |
| 124 | + | x.xCloseFn = 0 | |
| 125 | + | } else { | |
| 126 | + | x.xCloseFn = purego.NewCallback(func(StreamVarp uintptr, CancellableVarp uintptr) bool { | |
| 127 | + | return cb(IOStreamNewFromInternalPtr(StreamVarp), CancellableNewFromInternalPtr(CancellableVarp)) | |
| 128 | + | }) | |
| 129 | + | } | |
| 130 | + | } | |
| 131 | + | ||
| 132 | + | // GetCloseFn gets the callback function. | |
| 133 | + | func (x *IOStreamClass) GetCloseFn() func(*IOStream, *Cancellable) bool { | |
| 134 | + | if x.xCloseFn == 0 { | |
| 135 | + | return nil | |
| 136 | + | } | |
| 137 | + | var rawCallback func(StreamVarp uintptr, CancellableVarp uintptr) bool | |
| 138 | + | purego.RegisterFunc(&rawCallback, x.xCloseFn) | |
| 139 | + | return func(StreamVar *IOStream, CancellableVar *Cancellable) bool { | |
| 140 | + | return rawCallback(StreamVar.GoPointer(), CancellableVar.GoPointer()) | |
| 141 | + | } | |
| 142 | + | } | |
| 143 | + | ||
| 144 | + | // OverrideCloseAsync sets the callback function. | |
| 145 | + | func (x *IOStreamClass) OverrideCloseAsync(cb func(*IOStream, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 146 | + | if cb == nil { | |
| 147 | + | x.xCloseAsync = 0 | |
| 148 | + | } else { | |
| 149 | + | x.xCloseAsync = purego.NewCallback(func(StreamVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 150 | + | cb(IOStreamNewFromInternalPtr(StreamVarp), IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 151 | + | }) | |
| 152 | + | } | |
| 153 | + | } | |
| 154 | + | ||
| 155 | + | // GetCloseAsync gets the callback function. | |
| 156 | + | func (x *IOStreamClass) GetCloseAsync() func(*IOStream, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 157 | + | if x.xCloseAsync == 0 { | |
| 158 | + | return nil | |
| 159 | + | } | |
| 160 | + | var rawCallback func(StreamVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 161 | + | purego.RegisterFunc(&rawCallback, x.xCloseAsync) | |
| 162 | + | return func(StreamVar *IOStream, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 163 | + | rawCallback(StreamVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 164 | + | } | |
| 165 | + | } | |
| 166 | + | ||
| 167 | + | // OverrideCloseFinish sets the callback function. | |
| 168 | + | func (x *IOStreamClass) OverrideCloseFinish(cb func(*IOStream, AsyncResult) bool) { | |
| 169 | + | if cb == nil { | |
| 170 | + | x.xCloseFinish = 0 | |
| 171 | + | } else { | |
| 172 | + | x.xCloseFinish = purego.NewCallback(func(StreamVarp uintptr, ResultVarp uintptr) bool { | |
| 173 | + | return cb(IOStreamNewFromInternalPtr(StreamVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 174 | + | }) | |
| 175 | + | } | |
| 176 | + | } | |
| 177 | + | ||
| 178 | + | // GetCloseFinish gets the callback function. | |
| 179 | + | func (x *IOStreamClass) GetCloseFinish() func(*IOStream, AsyncResult) bool { | |
| 180 | + | if x.xCloseFinish == 0 { | |
| 181 | + | return nil | |
| 182 | + | } | |
| 183 | + | var rawCallback func(StreamVarp uintptr, ResultVarp uintptr) bool | |
| 184 | + | purego.RegisterFunc(&rawCallback, x.xCloseFinish) | |
| 185 | + | return func(StreamVar *IOStream, ResultVar AsyncResult) bool { | |
| 186 | + | return rawCallback(StreamVar.GoPointer(), ResultVar.GoPointer()) | |
| 187 | + | } | |
| 188 | + | } | |
| 189 | + | ||
| 190 | + | // OverrideGReserved1 sets the callback function. | |
| 191 | + | func (x *IOStreamClass) OverrideGReserved1(cb func()) { | |
| 192 | + | if cb == nil { | |
| 193 | + | x.xGReserved1 = 0 | |
| 194 | + | } else { | |
| 195 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 196 | + | cb() | |
| 197 | + | }) | |
| 198 | + | } | |
| 199 | + | } | |
| 200 | + | ||
| 201 | + | // GetGReserved1 gets the callback function. | |
| 202 | + | func (x *IOStreamClass) GetGReserved1() func() { | |
| 203 | + | if x.xGReserved1 == 0 { | |
| 204 | + | return nil | |
| 205 | + | } | |
| 206 | + | var rawCallback func() | |
| 207 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 208 | + | return func() { | |
| 209 | + | rawCallback() | |
| 210 | + | } | |
| 211 | + | } | |
| 212 | + | ||
| 213 | + | // OverrideGReserved2 sets the callback function. | |
| 214 | + | func (x *IOStreamClass) OverrideGReserved2(cb func()) { | |
| 215 | + | if cb == nil { | |
| 216 | + | x.xGReserved2 = 0 | |
| 217 | + | } else { | |
| 218 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 219 | + | cb() | |
| 220 | + | }) | |
| 221 | + | } | |
| 222 | + | } | |
| 223 | + | ||
| 224 | + | // GetGReserved2 gets the callback function. | |
| 225 | + | func (x *IOStreamClass) GetGReserved2() func() { | |
| 226 | + | if x.xGReserved2 == 0 { | |
| 227 | + | return nil | |
| 228 | + | } | |
| 229 | + | var rawCallback func() | |
| 230 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 231 | + | return func() { | |
| 232 | + | rawCallback() | |
| 233 | + | } | |
| 234 | + | } | |
| 235 | + | ||
| 236 | + | // OverrideGReserved3 sets the callback function. | |
| 237 | + | func (x *IOStreamClass) OverrideGReserved3(cb func()) { | |
| 238 | + | if cb == nil { | |
| 239 | + | x.xGReserved3 = 0 | |
| 240 | + | } else { | |
| 241 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 242 | + | cb() | |
| 243 | + | }) | |
| 244 | + | } | |
| 245 | + | } | |
| 246 | + | ||
| 247 | + | // GetGReserved3 gets the callback function. | |
| 248 | + | func (x *IOStreamClass) GetGReserved3() func() { | |
| 249 | + | if x.xGReserved3 == 0 { | |
| 250 | + | return nil | |
| 251 | + | } | |
| 252 | + | var rawCallback func() | |
| 253 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 254 | + | return func() { | |
| 255 | + | rawCallback() | |
| 256 | + | } | |
| 257 | + | } | |
| 258 | + | ||
| 259 | + | // OverrideGReserved4 sets the callback function. | |
| 260 | + | func (x *IOStreamClass) OverrideGReserved4(cb func()) { | |
| 261 | + | if cb == nil { | |
| 262 | + | x.xGReserved4 = 0 | |
| 263 | + | } else { | |
| 264 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 265 | + | cb() | |
| 266 | + | }) | |
| 267 | + | } | |
| 268 | + | } | |
| 269 | + | ||
| 270 | + | // GetGReserved4 gets the callback function. | |
| 271 | + | func (x *IOStreamClass) GetGReserved4() func() { | |
| 272 | + | if x.xGReserved4 == 0 { | |
| 273 | + | return nil | |
| 274 | + | } | |
| 275 | + | var rawCallback func() | |
| 276 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 277 | + | return func() { | |
| 278 | + | rawCallback() | |
| 279 | + | } | |
| 280 | + | } | |
| 281 | + | ||
| 282 | + | // OverrideGReserved5 sets the callback function. | |
| 283 | + | func (x *IOStreamClass) OverrideGReserved5(cb func()) { | |
| 284 | + | if cb == nil { | |
| 285 | + | x.xGReserved5 = 0 | |
| 286 | + | } else { | |
| 287 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 288 | + | cb() | |
| 289 | + | }) | |
| 290 | + | } | |
| 291 | + | } | |
| 292 | + | ||
| 293 | + | // GetGReserved5 gets the callback function. | |
| 294 | + | func (x *IOStreamClass) GetGReserved5() func() { | |
| 295 | + | if x.xGReserved5 == 0 { | |
| 296 | + | return nil | |
| 297 | + | } | |
| 298 | + | var rawCallback func() | |
| 299 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 300 | + | return func() { | |
| 301 | + | rawCallback() | |
| 302 | + | } | |
| 303 | + | } | |
| 304 | + | ||
| 305 | + | // OverrideGReserved6 sets the callback function. | |
| 306 | + | func (x *IOStreamClass) OverrideGReserved6(cb func()) { | |
| 307 | + | if cb == nil { | |
| 308 | + | x.xGReserved6 = 0 | |
| 309 | + | } else { | |
| 310 | + | x.xGReserved6 = purego.NewCallback(func() { | |
| 311 | + | cb() | |
| 312 | + | }) | |
| 313 | + | } | |
| 314 | + | } | |
| 315 | + | ||
| 316 | + | // GetGReserved6 gets the callback function. | |
| 317 | + | func (x *IOStreamClass) GetGReserved6() func() { | |
| 318 | + | if x.xGReserved6 == 0 { | |
| 319 | + | return nil | |
| 320 | + | } | |
| 321 | + | var rawCallback func() | |
| 322 | + | purego.RegisterFunc(&rawCallback, x.xGReserved6) | |
| 323 | + | return func() { | |
| 324 | + | rawCallback() | |
| 325 | + | } | |
| 326 | + | } | |
| 327 | + | ||
| 328 | + | // OverrideGReserved7 sets the callback function. | |
| 329 | + | func (x *IOStreamClass) OverrideGReserved7(cb func()) { | |
| 330 | + | if cb == nil { | |
| 331 | + | x.xGReserved7 = 0 | |
| 332 | + | } else { | |
| 333 | + | x.xGReserved7 = purego.NewCallback(func() { | |
| 334 | + | cb() | |
| 335 | + | }) | |
| 336 | + | } | |
| 337 | + | } | |
| 338 | + | ||
| 339 | + | // GetGReserved7 gets the callback function. | |
| 340 | + | func (x *IOStreamClass) GetGReserved7() func() { | |
| 341 | + | if x.xGReserved7 == 0 { | |
| 342 | + | return nil | |
| 343 | + | } | |
| 344 | + | var rawCallback func() | |
| 345 | + | purego.RegisterFunc(&rawCallback, x.xGReserved7) | |
| 346 | + | return func() { | |
| 347 | + | rawCallback() | |
| 348 | + | } | |
| 349 | + | } | |
| 350 | + | ||
| 351 | + | // OverrideGReserved8 sets the callback function. | |
| 352 | + | func (x *IOStreamClass) OverrideGReserved8(cb func()) { | |
| 353 | + | if cb == nil { | |
| 354 | + | x.xGReserved8 = 0 | |
| 355 | + | } else { | |
| 356 | + | x.xGReserved8 = purego.NewCallback(func() { | |
| 357 | + | cb() | |
| 358 | + | }) | |
| 359 | + | } | |
| 360 | + | } | |
| 361 | + | ||
| 362 | + | // GetGReserved8 gets the callback function. | |
| 363 | + | func (x *IOStreamClass) GetGReserved8() func() { | |
| 364 | + | if x.xGReserved8 == 0 { | |
| 365 | + | return nil | |
| 366 | + | } | |
| 367 | + | var rawCallback func() | |
| 368 | + | purego.RegisterFunc(&rawCallback, x.xGReserved8) | |
| 369 | + | return func() { | |
| 370 | + | rawCallback() | |
| 371 | + | } | |
| 372 | + | } | |
| 373 | + | ||
| 374 | + | // OverrideGReserved9 sets the callback function. | |
| 375 | + | func (x *IOStreamClass) OverrideGReserved9(cb func()) { | |
| 376 | + | if cb == nil { | |
| 377 | + | x.xGReserved9 = 0 | |
| 378 | + | } else { | |
| 379 | + | x.xGReserved9 = purego.NewCallback(func() { | |
| 380 | + | cb() | |
| 381 | + | }) | |
| 382 | + | } | |
| 383 | + | } | |
| 384 | + | ||
| 385 | + | // GetGReserved9 gets the callback function. | |
| 386 | + | func (x *IOStreamClass) GetGReserved9() func() { | |
| 387 | + | if x.xGReserved9 == 0 { | |
| 388 | + | return nil | |
| 389 | + | } | |
| 390 | + | var rawCallback func() | |
| 391 | + | purego.RegisterFunc(&rawCallback, x.xGReserved9) | |
| 392 | + | return func() { | |
| 393 | + | rawCallback() | |
| 394 | + | } | |
| 395 | + | } | |
| 396 | + | ||
| 397 | + | // OverrideGReserved10 sets the callback function. | |
| 398 | + | func (x *IOStreamClass) OverrideGReserved10(cb func()) { | |
| 399 | + | if cb == nil { | |
| 400 | + | x.xGReserved10 = 0 | |
| 401 | + | } else { | |
| 402 | + | x.xGReserved10 = purego.NewCallback(func() { | |
| 403 | + | cb() | |
| 404 | + | }) | |
| 405 | + | } | |
| 406 | + | } | |
| 407 | + | ||
| 408 | + | // GetGReserved10 gets the callback function. | |
| 409 | + | func (x *IOStreamClass) GetGReserved10() func() { | |
| 410 | + | if x.xGReserved10 == 0 { | |
| 411 | + | return nil | |
| 412 | + | } | |
| 413 | + | var rawCallback func() | |
| 414 | + | purego.RegisterFunc(&rawCallback, x.xGReserved10) | |
| 415 | + | return func() { | |
| 416 | + | rawCallback() | |
| 417 | + | } | |
| 418 | + | } | |
| 419 | + | ||
| 25 | 420 | type IOStreamPrivate struct { | |
| 26 | 421 | _ structs.HostLayout | |
| 27 | 422 | } | |
M v4/gio/glistmodel.go +85 -0
| @@ -16,12 +16,97 @@ type ListModelInterface struct { | |||
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | 18 | GIface uintptr | |
| 19 | + | ||
| 20 | + | xGetItemType uintptr | |
| 21 | + | ||
| 22 | + | xGetNItems uintptr | |
| 23 | + | ||
| 24 | + | xGetItem uintptr | |
| 19 | 25 | } | |
| 20 | 26 | ||
| 21 | 27 | func (x *ListModelInterface) GoPointer() uintptr { | |
| 22 | 28 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 29 | } | |
| 24 | 30 | ||
| 31 | + | // OverrideGetItemType sets the callback function. | |
| 32 | + | func (x *ListModelInterface) OverrideGetItemType(cb func(ListModel) types.GType) { | |
| 33 | + | if cb == nil { | |
| 34 | + | x.xGetItemType = 0 | |
| 35 | + | } else { | |
| 36 | + | x.xGetItemType = purego.NewCallback(func(ListVarp uintptr) types.GType { | |
| 37 | + | return cb(&ListModelBase{Ptr: ListVarp}) | |
| 38 | + | }) | |
| 39 | + | } | |
| 40 | + | } | |
| 41 | + | ||
| 42 | + | // GetGetItemType gets the callback function. | |
| 43 | + | func (x *ListModelInterface) GetGetItemType() func(ListModel) types.GType { | |
| 44 | + | if x.xGetItemType == 0 { | |
| 45 | + | return nil | |
| 46 | + | } | |
| 47 | + | var rawCallback func(ListVarp uintptr) types.GType | |
| 48 | + | purego.RegisterFunc(&rawCallback, x.xGetItemType) | |
| 49 | + | return func(ListVar ListModel) types.GType { | |
| 50 | + | return rawCallback(ListVar.GoPointer()) | |
| 51 | + | } | |
| 52 | + | } | |
| 53 | + | ||
| 54 | + | // OverrideGetNItems sets the callback function. | |
| 55 | + | func (x *ListModelInterface) OverrideGetNItems(cb func(ListModel) uint) { | |
| 56 | + | if cb == nil { | |
| 57 | + | x.xGetNItems = 0 | |
| 58 | + | } else { | |
| 59 | + | x.xGetNItems = purego.NewCallback(func(ListVarp uintptr) uint { | |
| 60 | + | return cb(&ListModelBase{Ptr: ListVarp}) | |
| 61 | + | }) | |
| 62 | + | } | |
| 63 | + | } | |
| 64 | + | ||
| 65 | + | // GetGetNItems gets the callback function. | |
| 66 | + | func (x *ListModelInterface) GetGetNItems() func(ListModel) uint { | |
| 67 | + | if x.xGetNItems == 0 { | |
| 68 | + | return nil | |
| 69 | + | } | |
| 70 | + | var rawCallback func(ListVarp uintptr) uint | |
| 71 | + | purego.RegisterFunc(&rawCallback, x.xGetNItems) | |
| 72 | + | return func(ListVar ListModel) uint { | |
| 73 | + | return rawCallback(ListVar.GoPointer()) | |
| 74 | + | } | |
| 75 | + | } | |
| 76 | + | ||
| 77 | + | // OverrideGetItem sets the callback function. | |
| 78 | + | func (x *ListModelInterface) OverrideGetItem(cb func(ListModel, uint) *gobject.Object) { | |
| 79 | + | if cb == nil { | |
| 80 | + | x.xGetItem = 0 | |
| 81 | + | } else { | |
| 82 | + | x.xGetItem = purego.NewCallback(func(ListVarp uintptr, PositionVarp uint) uintptr { | |
| 83 | + | ret := cb(&ListModelBase{Ptr: ListVarp}, PositionVarp) | |
| 84 | + | if ret == nil { | |
| 85 | + | return 0 | |
| 86 | + | } | |
| 87 | + | return ret.GoPointer() | |
| 88 | + | }) | |
| 89 | + | } | |
| 90 | + | } | |
| 91 | + | ||
| 92 | + | // GetGetItem gets the callback function. | |
| 93 | + | func (x *ListModelInterface) GetGetItem() func(ListModel, uint) *gobject.Object { | |
| 94 | + | if x.xGetItem == 0 { | |
| 95 | + | return nil | |
| 96 | + | } | |
| 97 | + | var rawCallback func(ListVarp uintptr, PositionVarp uint) uintptr | |
| 98 | + | purego.RegisterFunc(&rawCallback, x.xGetItem) | |
| 99 | + | return func(ListVar ListModel, PositionVar uint) *gobject.Object { | |
| 100 | + | rawRet := rawCallback(ListVar.GoPointer(), PositionVar) | |
| 101 | + | if rawRet == 0 { | |
| 102 | + | return nil | |
| 103 | + | } | |
| 104 | + | ret := &gobject.Object{} | |
| 105 | + | ret.Ptr = rawRet | |
| 106 | + | return ret | |
| 107 | + | } | |
| 108 | + | } | |
| 109 | + | ||
| 25 | 110 | // #GListModel is an interface that represents a mutable list of | |
| 26 | 111 | // #GObjects. Its main intention is as a model for various widgets in | |
| 27 | 112 | // user interfaces, such as list views, but it can also be used as a | |
M v4/gio/gliststore.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type ListStoreClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *ListStoreClass) GoPointer() uintptr { | |
M v4/gio/gloadableicon.go +97 -2
| @@ -16,20 +16,115 @@ type LoadableIconIface struct { | |||
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | 18 | GIface uintptr | |
| 19 | + | ||
| 20 | + | xLoad uintptr | |
| 21 | + | ||
| 22 | + | xLoadAsync uintptr | |
| 23 | + | ||
| 24 | + | xLoadFinish uintptr | |
| 19 | 25 | } | |
| 20 | 26 | ||
| 21 | 27 | func (x *LoadableIconIface) GoPointer() uintptr { | |
| 22 | 28 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 29 | } | |
| 24 | 30 | ||
| 31 | + | // OverrideLoad sets the callback function. | |
| 32 | + | func (x *LoadableIconIface) OverrideLoad(cb func(LoadableIcon, int, string, *Cancellable) *InputStream) { | |
| 33 | + | if cb == nil { | |
| 34 | + | x.xLoad = 0 | |
| 35 | + | } else { | |
| 36 | + | x.xLoad = purego.NewCallback(func(IconVarp uintptr, SizeVarp int, TypeVarp string, CancellableVarp uintptr) uintptr { | |
| 37 | + | ret := cb(&LoadableIconBase{Ptr: IconVarp}, SizeVarp, TypeVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 38 | + | if ret == nil { | |
| 39 | + | return 0 | |
| 40 | + | } | |
| 41 | + | return ret.GoPointer() | |
| 42 | + | }) | |
| 43 | + | } | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | // GetLoad gets the callback function. | |
| 47 | + | func (x *LoadableIconIface) GetLoad() func(LoadableIcon, int, string, *Cancellable) *InputStream { | |
| 48 | + | if x.xLoad == 0 { | |
| 49 | + | return nil | |
| 50 | + | } | |
| 51 | + | var rawCallback func(IconVarp uintptr, SizeVarp int, TypeVarp string, CancellableVarp uintptr) uintptr | |
| 52 | + | purego.RegisterFunc(&rawCallback, x.xLoad) | |
| 53 | + | return func(IconVar LoadableIcon, SizeVar int, TypeVar string, CancellableVar *Cancellable) *InputStream { | |
| 54 | + | rawRet := rawCallback(IconVar.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer()) | |
| 55 | + | if rawRet == 0 { | |
| 56 | + | return nil | |
| 57 | + | } | |
| 58 | + | ret := &InputStream{} | |
| 59 | + | ret.Ptr = rawRet | |
| 60 | + | return ret | |
| 61 | + | } | |
| 62 | + | } | |
| 63 | + | ||
| 64 | + | // OverrideLoadAsync sets the callback function. | |
| 65 | + | func (x *LoadableIconIface) OverrideLoadAsync(cb func(LoadableIcon, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 66 | + | if cb == nil { | |
| 67 | + | x.xLoadAsync = 0 | |
| 68 | + | } else { | |
| 69 | + | x.xLoadAsync = purego.NewCallback(func(IconVarp uintptr, SizeVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 70 | + | cb(&LoadableIconBase{Ptr: IconVarp}, SizeVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 71 | + | }) | |
| 72 | + | } | |
| 73 | + | } | |
| 74 | + | ||
| 75 | + | // GetLoadAsync gets the callback function. | |
| 76 | + | func (x *LoadableIconIface) GetLoadAsync() func(LoadableIcon, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 77 | + | if x.xLoadAsync == 0 { | |
| 78 | + | return nil | |
| 79 | + | } | |
| 80 | + | var rawCallback func(IconVarp uintptr, SizeVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 81 | + | purego.RegisterFunc(&rawCallback, x.xLoadAsync) | |
| 82 | + | return func(IconVar LoadableIcon, SizeVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 83 | + | rawCallback(IconVar.GoPointer(), SizeVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 84 | + | } | |
| 85 | + | } | |
| 86 | + | ||
| 87 | + | // OverrideLoadFinish sets the callback function. | |
| 88 | + | func (x *LoadableIconIface) OverrideLoadFinish(cb func(LoadableIcon, AsyncResult, string) *InputStream) { | |
| 89 | + | if cb == nil { | |
| 90 | + | x.xLoadFinish = 0 | |
| 91 | + | } else { | |
| 92 | + | x.xLoadFinish = purego.NewCallback(func(IconVarp uintptr, ResVarp uintptr, TypeVarp string) uintptr { | |
| 93 | + | ret := cb(&LoadableIconBase{Ptr: IconVarp}, &AsyncResultBase{Ptr: ResVarp}, TypeVarp) | |
| 94 | + | if ret == nil { | |
| 95 | + | return 0 | |
| 96 | + | } | |
| 97 | + | return ret.GoPointer() | |
| 98 | + | }) | |
| 99 | + | } | |
| 100 | + | } | |
| 101 | + | ||
| 102 | + | // GetLoadFinish gets the callback function. | |
| 103 | + | func (x *LoadableIconIface) GetLoadFinish() func(LoadableIcon, AsyncResult, string) *InputStream { | |
| 104 | + | if x.xLoadFinish == 0 { | |
| 105 | + | return nil | |
| 106 | + | } | |
| 107 | + | var rawCallback func(IconVarp uintptr, ResVarp uintptr, TypeVarp string) uintptr | |
| 108 | + | purego.RegisterFunc(&rawCallback, x.xLoadFinish) | |
| 109 | + | return func(IconVar LoadableIcon, ResVar AsyncResult, TypeVar string) *InputStream { | |
| 110 | + | rawRet := rawCallback(IconVar.GoPointer(), ResVar.GoPointer(), TypeVar) | |
| 111 | + | if rawRet == 0 { | |
| 112 | + | return nil | |
| 113 | + | } | |
| 114 | + | ret := &InputStream{} | |
| 115 | + | ret.Ptr = rawRet | |
| 116 | + | return ret | |
| 117 | + | } | |
| 118 | + | } | |
| 119 | + | ||
| 25 | 120 | // Extends the #GIcon interface and adds the ability to | |
| 26 | 121 | // load icons from streams. | |
| 27 | 122 | type LoadableIcon interface { | |
| 28 | 123 | GoPointer() uintptr | |
| 29 | 124 | SetGoPointer(uintptr) | |
| 30 | - | Load(SizeVar int, TypeVar string, CancellableVar *Cancellable) *InputStream | |
| 125 | + | Load(SizeVar int, TypeVar string, CancellableVar *Cancellable) (*InputStream, error) | |
| 31 | 126 | LoadAsync(SizeVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 32 | - | LoadFinish(ResVar AsyncResult, TypeVar string) *InputStream | |
| 127 | + | LoadFinish(ResVar AsyncResult, TypeVar string) (*InputStream, error) | |
| 33 | 128 | } | |
| 34 | 129 | ||
| 35 | 130 | var xLoadableIconGLibType func() types.GType | |
M v4/gio/gmemoryinputstream.go +126 -1
| @@ -14,13 +14,138 @@ import ( | |||
| 14 | 14 | type MemoryInputStreamClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass InputStreamClass | |
| 18 | + | ||
| 19 | + | xGReserved1 uintptr | |
| 20 | + | ||
| 21 | + | xGReserved2 uintptr | |
| 22 | + | ||
| 23 | + | xGReserved3 uintptr | |
| 24 | + | ||
| 25 | + | xGReserved4 uintptr | |
| 26 | + | ||
| 27 | + | xGReserved5 uintptr | |
| 18 | 28 | } | |
| 19 | 29 | ||
| 20 | 30 | func (x *MemoryInputStreamClass) GoPointer() uintptr { | |
| 21 | 31 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 32 | } | |
| 23 | 33 | ||
| 34 | + | // OverrideGReserved1 sets the callback function. | |
| 35 | + | func (x *MemoryInputStreamClass) OverrideGReserved1(cb func()) { | |
| 36 | + | if cb == nil { | |
| 37 | + | x.xGReserved1 = 0 | |
| 38 | + | } else { | |
| 39 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 40 | + | cb() | |
| 41 | + | }) | |
| 42 | + | } | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | // GetGReserved1 gets the callback function. | |
| 46 | + | func (x *MemoryInputStreamClass) GetGReserved1() func() { | |
| 47 | + | if x.xGReserved1 == 0 { | |
| 48 | + | return nil | |
| 49 | + | } | |
| 50 | + | var rawCallback func() | |
| 51 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 52 | + | return func() { | |
| 53 | + | rawCallback() | |
| 54 | + | } | |
| 55 | + | } | |
| 56 | + | ||
| 57 | + | // OverrideGReserved2 sets the callback function. | |
| 58 | + | func (x *MemoryInputStreamClass) OverrideGReserved2(cb func()) { | |
| 59 | + | if cb == nil { | |
| 60 | + | x.xGReserved2 = 0 | |
| 61 | + | } else { | |
| 62 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 63 | + | cb() | |
| 64 | + | }) | |
| 65 | + | } | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | // GetGReserved2 gets the callback function. | |
| 69 | + | func (x *MemoryInputStreamClass) GetGReserved2() func() { | |
| 70 | + | if x.xGReserved2 == 0 { | |
| 71 | + | return nil | |
| 72 | + | } | |
| 73 | + | var rawCallback func() | |
| 74 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 75 | + | return func() { | |
| 76 | + | rawCallback() | |
| 77 | + | } | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | // OverrideGReserved3 sets the callback function. | |
| 81 | + | func (x *MemoryInputStreamClass) OverrideGReserved3(cb func()) { | |
| 82 | + | if cb == nil { | |
| 83 | + | x.xGReserved3 = 0 | |
| 84 | + | } else { | |
| 85 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 86 | + | cb() | |
| 87 | + | }) | |
| 88 | + | } | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | // GetGReserved3 gets the callback function. | |
| 92 | + | func (x *MemoryInputStreamClass) GetGReserved3() func() { | |
| 93 | + | if x.xGReserved3 == 0 { | |
| 94 | + | return nil | |
| 95 | + | } | |
| 96 | + | var rawCallback func() | |
| 97 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 98 | + | return func() { | |
| 99 | + | rawCallback() | |
| 100 | + | } | |
| 101 | + | } | |
| 102 | + | ||
| 103 | + | // OverrideGReserved4 sets the callback function. | |
| 104 | + | func (x *MemoryInputStreamClass) OverrideGReserved4(cb func()) { | |
| 105 | + | if cb == nil { | |
| 106 | + | x.xGReserved4 = 0 | |
| 107 | + | } else { | |
| 108 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 109 | + | cb() | |
| 110 | + | }) | |
| 111 | + | } | |
| 112 | + | } | |
| 113 | + | ||
| 114 | + | // GetGReserved4 gets the callback function. | |
| 115 | + | func (x *MemoryInputStreamClass) GetGReserved4() func() { | |
| 116 | + | if x.xGReserved4 == 0 { | |
| 117 | + | return nil | |
| 118 | + | } | |
| 119 | + | var rawCallback func() | |
| 120 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 121 | + | return func() { | |
| 122 | + | rawCallback() | |
| 123 | + | } | |
| 124 | + | } | |
| 125 | + | ||
| 126 | + | // OverrideGReserved5 sets the callback function. | |
| 127 | + | func (x *MemoryInputStreamClass) OverrideGReserved5(cb func()) { | |
| 128 | + | if cb == nil { | |
| 129 | + | x.xGReserved5 = 0 | |
| 130 | + | } else { | |
| 131 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 132 | + | cb() | |
| 133 | + | }) | |
| 134 | + | } | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | // GetGReserved5 gets the callback function. | |
| 138 | + | func (x *MemoryInputStreamClass) GetGReserved5() func() { | |
| 139 | + | if x.xGReserved5 == 0 { | |
| 140 | + | return nil | |
| 141 | + | } | |
| 142 | + | var rawCallback func() | |
| 143 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 144 | + | return func() { | |
| 145 | + | rawCallback() | |
| 146 | + | } | |
| 147 | + | } | |
| 148 | + | ||
| 24 | 149 | type MemoryInputStreamPrivate struct { | |
| 25 | 150 | _ structs.HostLayout | |
| 26 | 151 | } | |
M v4/gio/gmemorymonitor.go +25 -0
| @@ -15,12 +15,37 @@ type MemoryMonitorInterface struct { | |||
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | 17 | GIface uintptr | |
| 18 | + | ||
| 19 | + | xLowMemoryWarning uintptr | |
| 18 | 20 | } | |
| 19 | 21 | ||
| 20 | 22 | func (x *MemoryMonitorInterface) GoPointer() uintptr { | |
| 21 | 23 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 24 | } | |
| 23 | 25 | ||
| 26 | + | // OverrideLowMemoryWarning sets the callback function. | |
| 27 | + | func (x *MemoryMonitorInterface) OverrideLowMemoryWarning(cb func(MemoryMonitor, MemoryMonitorWarningLevel)) { | |
| 28 | + | if cb == nil { | |
| 29 | + | x.xLowMemoryWarning = 0 | |
| 30 | + | } else { | |
| 31 | + | x.xLowMemoryWarning = purego.NewCallback(func(MonitorVarp uintptr, LevelVarp MemoryMonitorWarningLevel) { | |
| 32 | + | cb(&MemoryMonitorBase{Ptr: MonitorVarp}, LevelVarp) | |
| 33 | + | }) | |
| 34 | + | } | |
| 35 | + | } | |
| 36 | + | ||
| 37 | + | // GetLowMemoryWarning gets the callback function. | |
| 38 | + | func (x *MemoryMonitorInterface) GetLowMemoryWarning() func(MemoryMonitor, MemoryMonitorWarningLevel) { | |
| 39 | + | if x.xLowMemoryWarning == 0 { | |
| 40 | + | return nil | |
| 41 | + | } | |
| 42 | + | var rawCallback func(MonitorVarp uintptr, LevelVarp MemoryMonitorWarningLevel) | |
| 43 | + | purego.RegisterFunc(&rawCallback, x.xLowMemoryWarning) | |
| 44 | + | return func(MonitorVar MemoryMonitor, LevelVar MemoryMonitorWarningLevel) { | |
| 45 | + | rawCallback(MonitorVar.GoPointer(), LevelVar) | |
| 46 | + | } | |
| 47 | + | } | |
| 48 | + | ||
| 24 | 49 | // #GMemoryMonitor will monitor system memory and suggest to the application | |
| 25 | 50 | // when to free memory so as to leave more room for other applications. | |
| 26 | 51 | // It is implemented on Linux using the [Low Memory Monitor](https://gitlab.freedesktop.org/hadess/low-memory-monitor/) | |
M v4/gio/gmemoryoutputstream.go +126 -1
| @@ -20,13 +20,138 @@ type ReallocFunc func(uintptr, uint) uintptr | |||
| 20 | 20 | type MemoryOutputStreamClass struct { | |
| 21 | 21 | _ structs.HostLayout | |
| 22 | 22 | ||
| 23 | - | ParentClass uintptr | |
| 23 | + | ParentClass OutputStreamClass | |
| 24 | + | ||
| 25 | + | xGReserved1 uintptr | |
| 26 | + | ||
| 27 | + | xGReserved2 uintptr | |
| 28 | + | ||
| 29 | + | xGReserved3 uintptr | |
| 30 | + | ||
| 31 | + | xGReserved4 uintptr | |
| 32 | + | ||
| 33 | + | xGReserved5 uintptr | |
| 24 | 34 | } | |
| 25 | 35 | ||
| 26 | 36 | func (x *MemoryOutputStreamClass) GoPointer() uintptr { | |
| 27 | 37 | return uintptr(unsafe.Pointer(x)) | |
| 28 | 38 | } | |
| 29 | 39 | ||
| 40 | + | // OverrideGReserved1 sets the callback function. | |
| 41 | + | func (x *MemoryOutputStreamClass) OverrideGReserved1(cb func()) { | |
| 42 | + | if cb == nil { | |
| 43 | + | x.xGReserved1 = 0 | |
| 44 | + | } else { | |
| 45 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 46 | + | cb() | |
| 47 | + | }) | |
| 48 | + | } | |
| 49 | + | } | |
| 50 | + | ||
| 51 | + | // GetGReserved1 gets the callback function. | |
| 52 | + | func (x *MemoryOutputStreamClass) GetGReserved1() func() { | |
| 53 | + | if x.xGReserved1 == 0 { | |
| 54 | + | return nil | |
| 55 | + | } | |
| 56 | + | var rawCallback func() | |
| 57 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 58 | + | return func() { | |
| 59 | + | rawCallback() | |
| 60 | + | } | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // OverrideGReserved2 sets the callback function. | |
| 64 | + | func (x *MemoryOutputStreamClass) OverrideGReserved2(cb func()) { | |
| 65 | + | if cb == nil { | |
| 66 | + | x.xGReserved2 = 0 | |
| 67 | + | } else { | |
| 68 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 69 | + | cb() | |
| 70 | + | }) | |
| 71 | + | } | |
| 72 | + | } | |
| 73 | + | ||
| 74 | + | // GetGReserved2 gets the callback function. | |
| 75 | + | func (x *MemoryOutputStreamClass) GetGReserved2() func() { | |
| 76 | + | if x.xGReserved2 == 0 { | |
| 77 | + | return nil | |
| 78 | + | } | |
| 79 | + | var rawCallback func() | |
| 80 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 81 | + | return func() { | |
| 82 | + | rawCallback() | |
| 83 | + | } | |
| 84 | + | } | |
| 85 | + | ||
| 86 | + | // OverrideGReserved3 sets the callback function. | |
| 87 | + | func (x *MemoryOutputStreamClass) OverrideGReserved3(cb func()) { | |
| 88 | + | if cb == nil { | |
| 89 | + | x.xGReserved3 = 0 | |
| 90 | + | } else { | |
| 91 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 92 | + | cb() | |
| 93 | + | }) | |
| 94 | + | } | |
| 95 | + | } | |
| 96 | + | ||
| 97 | + | // GetGReserved3 gets the callback function. | |
| 98 | + | func (x *MemoryOutputStreamClass) GetGReserved3() func() { | |
| 99 | + | if x.xGReserved3 == 0 { | |
| 100 | + | return nil | |
| 101 | + | } | |
| 102 | + | var rawCallback func() | |
| 103 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 104 | + | return func() { | |
| 105 | + | rawCallback() | |
| 106 | + | } | |
| 107 | + | } | |
| 108 | + | ||
| 109 | + | // OverrideGReserved4 sets the callback function. | |
| 110 | + | func (x *MemoryOutputStreamClass) OverrideGReserved4(cb func()) { | |
| 111 | + | if cb == nil { | |
| 112 | + | x.xGReserved4 = 0 | |
| 113 | + | } else { | |
| 114 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 115 | + | cb() | |
| 116 | + | }) | |
| 117 | + | } | |
| 118 | + | } | |
| 119 | + | ||
| 120 | + | // GetGReserved4 gets the callback function. | |
| 121 | + | func (x *MemoryOutputStreamClass) GetGReserved4() func() { | |
| 122 | + | if x.xGReserved4 == 0 { | |
| 123 | + | return nil | |
| 124 | + | } | |
| 125 | + | var rawCallback func() | |
| 126 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 127 | + | return func() { | |
| 128 | + | rawCallback() | |
| 129 | + | } | |
| 130 | + | } | |
| 131 | + | ||
| 132 | + | // OverrideGReserved5 sets the callback function. | |
| 133 | + | func (x *MemoryOutputStreamClass) OverrideGReserved5(cb func()) { | |
| 134 | + | if cb == nil { | |
| 135 | + | x.xGReserved5 = 0 | |
| 136 | + | } else { | |
| 137 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 138 | + | cb() | |
| 139 | + | }) | |
| 140 | + | } | |
| 141 | + | } | |
| 142 | + | ||
| 143 | + | // GetGReserved5 gets the callback function. | |
| 144 | + | func (x *MemoryOutputStreamClass) GetGReserved5() func() { | |
| 145 | + | if x.xGReserved5 == 0 { | |
| 146 | + | return nil | |
| 147 | + | } | |
| 148 | + | var rawCallback func() | |
| 149 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 150 | + | return func() { | |
| 151 | + | rawCallback() | |
| 152 | + | } | |
| 153 | + | } | |
| 154 | + | ||
| 30 | 155 | type MemoryOutputStreamPrivate struct { | |
| 31 | 156 | _ structs.HostLayout | |
| 32 | 157 | } | |
M v4/gio/gmenumodel.go +285 -5
| @@ -15,13 +15,38 @@ import ( | |||
| 15 | 15 | type MenuAttributeIterClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xGetNext uintptr | |
| 19 | 21 | } | |
| 20 | 22 | ||
| 21 | 23 | func (x *MenuAttributeIterClass) GoPointer() uintptr { | |
| 22 | 24 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 25 | } | |
| 24 | 26 | ||
| 27 | + | // OverrideGetNext sets the callback function. | |
| 28 | + | func (x *MenuAttributeIterClass) OverrideGetNext(cb func(*MenuAttributeIter, string, **glib.Variant) bool) { | |
| 29 | + | if cb == nil { | |
| 30 | + | x.xGetNext = 0 | |
| 31 | + | } else { | |
| 32 | + | x.xGetNext = purego.NewCallback(func(IterVarp uintptr, OutNameVarp string, ValueVarp **glib.Variant) bool { | |
| 33 | + | return cb(MenuAttributeIterNewFromInternalPtr(IterVarp), OutNameVarp, ValueVarp) | |
| 34 | + | }) | |
| 35 | + | } | |
| 36 | + | } | |
| 37 | + | ||
| 38 | + | // GetGetNext gets the callback function. | |
| 39 | + | func (x *MenuAttributeIterClass) GetGetNext() func(*MenuAttributeIter, string, **glib.Variant) bool { | |
| 40 | + | if x.xGetNext == 0 { | |
| 41 | + | return nil | |
| 42 | + | } | |
| 43 | + | var rawCallback func(IterVarp uintptr, OutNameVarp string, ValueVarp **glib.Variant) bool | |
| 44 | + | purego.RegisterFunc(&rawCallback, x.xGetNext) | |
| 45 | + | return func(IterVar *MenuAttributeIter, OutNameVar string, ValueVar **glib.Variant) bool { | |
| 46 | + | return rawCallback(IterVar.GoPointer(), OutNameVar, ValueVar) | |
| 47 | + | } | |
| 48 | + | } | |
| 49 | + | ||
| 25 | 50 | type MenuAttributeIterPrivate struct { | |
| 26 | 51 | _ structs.HostLayout | |
| 27 | 52 | } | |
| @@ -33,13 +58,38 @@ func (x *MenuAttributeIterPrivate) GoPointer() uintptr { | |||
| 33 | 58 | type MenuLinkIterClass struct { | |
| 34 | 59 | _ structs.HostLayout | |
| 35 | 60 | ||
| 36 | - | ParentClass uintptr | |
| 61 | + | ParentClass gobject.ObjectClass | |
| 62 | + | ||
| 63 | + | xGetNext uintptr | |
| 37 | 64 | } | |
| 38 | 65 | ||
| 39 | 66 | func (x *MenuLinkIterClass) GoPointer() uintptr { | |
| 40 | 67 | return uintptr(unsafe.Pointer(x)) | |
| 41 | 68 | } | |
| 42 | 69 | ||
| 70 | + | // OverrideGetNext sets the callback function. | |
| 71 | + | func (x *MenuLinkIterClass) OverrideGetNext(cb func(*MenuLinkIter, string, **MenuModel) bool) { | |
| 72 | + | if cb == nil { | |
| 73 | + | x.xGetNext = 0 | |
| 74 | + | } else { | |
| 75 | + | x.xGetNext = purego.NewCallback(func(IterVarp uintptr, OutLinkVarp string, ValueVarp uintptr) bool { | |
| 76 | + | return cb(MenuLinkIterNewFromInternalPtr(IterVarp), OutLinkVarp, (**MenuModel)(unsafe.Pointer(ValueVarp))) | |
| 77 | + | }) | |
| 78 | + | } | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | // GetGetNext gets the callback function. | |
| 82 | + | func (x *MenuLinkIterClass) GetGetNext() func(*MenuLinkIter, string, **MenuModel) bool { | |
| 83 | + | if x.xGetNext == 0 { | |
| 84 | + | return nil | |
| 85 | + | } | |
| 86 | + | var rawCallback func(IterVarp uintptr, OutLinkVarp string, ValueVarp uintptr) bool | |
| 87 | + | purego.RegisterFunc(&rawCallback, x.xGetNext) | |
| 88 | + | return func(IterVar *MenuLinkIter, OutLinkVar string, ValueVar **MenuModel) bool { | |
| 89 | + | return rawCallback(IterVar.GoPointer(), OutLinkVar, *gobject.ConvertPtr(ValueVar)) | |
| 90 | + | } | |
| 91 | + | } | |
| 92 | + | ||
| 43 | 93 | type MenuLinkIterPrivate struct { | |
| 44 | 94 | _ structs.HostLayout | |
| 45 | 95 | } | |
| @@ -51,13 +101,243 @@ func (x *MenuLinkIterPrivate) GoPointer() uintptr { | |||
| 51 | 101 | type MenuModelClass struct { | |
| 52 | 102 | _ structs.HostLayout | |
| 53 | 103 | ||
| 54 | - | ParentClass uintptr | |
| 104 | + | ParentClass gobject.ObjectClass | |
| 105 | + | ||
| 106 | + | xIsMutable uintptr | |
| 107 | + | ||
| 108 | + | xGetNItems uintptr | |
| 109 | + | ||
| 110 | + | xGetItemAttributes uintptr | |
| 111 | + | ||
| 112 | + | xIterateItemAttributes uintptr | |
| 113 | + | ||
| 114 | + | xGetItemAttributeValue uintptr | |
| 115 | + | ||
| 116 | + | xGetItemLinks uintptr | |
| 117 | + | ||
| 118 | + | xIterateItemLinks uintptr | |
| 119 | + | ||
| 120 | + | xGetItemLink uintptr | |
| 55 | 121 | } | |
| 56 | 122 | ||
| 57 | 123 | func (x *MenuModelClass) GoPointer() uintptr { | |
| 58 | 124 | return uintptr(unsafe.Pointer(x)) | |
| 59 | 125 | } | |
| 60 | 126 | ||
| 127 | + | // OverrideIsMutable sets the callback function. | |
| 128 | + | func (x *MenuModelClass) OverrideIsMutable(cb func(*MenuModel) bool) { | |
| 129 | + | if cb == nil { | |
| 130 | + | x.xIsMutable = 0 | |
| 131 | + | } else { | |
| 132 | + | x.xIsMutable = purego.NewCallback(func(ModelVarp uintptr) bool { | |
| 133 | + | return cb(MenuModelNewFromInternalPtr(ModelVarp)) | |
| 134 | + | }) | |
| 135 | + | } | |
| 136 | + | } | |
| 137 | + | ||
| 138 | + | // GetIsMutable gets the callback function. | |
| 139 | + | func (x *MenuModelClass) GetIsMutable() func(*MenuModel) bool { | |
| 140 | + | if x.xIsMutable == 0 { | |
| 141 | + | return nil | |
| 142 | + | } | |
| 143 | + | var rawCallback func(ModelVarp uintptr) bool | |
| 144 | + | purego.RegisterFunc(&rawCallback, x.xIsMutable) | |
| 145 | + | return func(ModelVar *MenuModel) bool { | |
| 146 | + | return rawCallback(ModelVar.GoPointer()) | |
| 147 | + | } | |
| 148 | + | } | |
| 149 | + | ||
| 150 | + | // OverrideGetNItems sets the callback function. | |
| 151 | + | func (x *MenuModelClass) OverrideGetNItems(cb func(*MenuModel) int) { | |
| 152 | + | if cb == nil { | |
| 153 | + | x.xGetNItems = 0 | |
| 154 | + | } else { | |
| 155 | + | x.xGetNItems = purego.NewCallback(func(ModelVarp uintptr) int { | |
| 156 | + | return cb(MenuModelNewFromInternalPtr(ModelVarp)) | |
| 157 | + | }) | |
| 158 | + | } | |
| 159 | + | } | |
| 160 | + | ||
| 161 | + | // GetGetNItems gets the callback function. | |
| 162 | + | func (x *MenuModelClass) GetGetNItems() func(*MenuModel) int { | |
| 163 | + | if x.xGetNItems == 0 { | |
| 164 | + | return nil | |
| 165 | + | } | |
| 166 | + | var rawCallback func(ModelVarp uintptr) int | |
| 167 | + | purego.RegisterFunc(&rawCallback, x.xGetNItems) | |
| 168 | + | return func(ModelVar *MenuModel) int { | |
| 169 | + | return rawCallback(ModelVar.GoPointer()) | |
| 170 | + | } | |
| 171 | + | } | |
| 172 | + | ||
| 173 | + | // OverrideGetItemAttributes sets the callback function. | |
| 174 | + | func (x *MenuModelClass) OverrideGetItemAttributes(cb func(*MenuModel, int, **glib.HashTable)) { | |
| 175 | + | if cb == nil { | |
| 176 | + | x.xGetItemAttributes = 0 | |
| 177 | + | } else { | |
| 178 | + | x.xGetItemAttributes = purego.NewCallback(func(ModelVarp uintptr, ItemIndexVarp int, AttributesVarp **glib.HashTable) { | |
| 179 | + | cb(MenuModelNewFromInternalPtr(ModelVarp), ItemIndexVarp, AttributesVarp) | |
| 180 | + | }) | |
| 181 | + | } | |
| 182 | + | } | |
| 183 | + | ||
| 184 | + | // GetGetItemAttributes gets the callback function. | |
| 185 | + | func (x *MenuModelClass) GetGetItemAttributes() func(*MenuModel, int, **glib.HashTable) { | |
| 186 | + | if x.xGetItemAttributes == 0 { | |
| 187 | + | return nil | |
| 188 | + | } | |
| 189 | + | var rawCallback func(ModelVarp uintptr, ItemIndexVarp int, AttributesVarp **glib.HashTable) | |
| 190 | + | purego.RegisterFunc(&rawCallback, x.xGetItemAttributes) | |
| 191 | + | return func(ModelVar *MenuModel, ItemIndexVar int, AttributesVar **glib.HashTable) { | |
| 192 | + | rawCallback(ModelVar.GoPointer(), ItemIndexVar, AttributesVar) | |
| 193 | + | } | |
| 194 | + | } | |
| 195 | + | ||
| 196 | + | // OverrideIterateItemAttributes sets the callback function. | |
| 197 | + | func (x *MenuModelClass) OverrideIterateItemAttributes(cb func(*MenuModel, int) *MenuAttributeIter) { | |
| 198 | + | if cb == nil { | |
| 199 | + | x.xIterateItemAttributes = 0 | |
| 200 | + | } else { | |
| 201 | + | x.xIterateItemAttributes = purego.NewCallback(func(ModelVarp uintptr, ItemIndexVarp int) uintptr { | |
| 202 | + | ret := cb(MenuModelNewFromInternalPtr(ModelVarp), ItemIndexVarp) | |
| 203 | + | if ret == nil { | |
| 204 | + | return 0 | |
| 205 | + | } | |
| 206 | + | return ret.GoPointer() | |
| 207 | + | }) | |
| 208 | + | } | |
| 209 | + | } | |
| 210 | + | ||
| 211 | + | // GetIterateItemAttributes gets the callback function. | |
| 212 | + | func (x *MenuModelClass) GetIterateItemAttributes() func(*MenuModel, int) *MenuAttributeIter { | |
| 213 | + | if x.xIterateItemAttributes == 0 { | |
| 214 | + | return nil | |
| 215 | + | } | |
| 216 | + | var rawCallback func(ModelVarp uintptr, ItemIndexVarp int) uintptr | |
| 217 | + | purego.RegisterFunc(&rawCallback, x.xIterateItemAttributes) | |
| 218 | + | return func(ModelVar *MenuModel, ItemIndexVar int) *MenuAttributeIter { | |
| 219 | + | rawRet := rawCallback(ModelVar.GoPointer(), ItemIndexVar) | |
| 220 | + | if rawRet == 0 { | |
| 221 | + | return nil | |
| 222 | + | } | |
| 223 | + | ret := &MenuAttributeIter{} | |
| 224 | + | ret.Ptr = rawRet | |
| 225 | + | return ret | |
| 226 | + | } | |
| 227 | + | } | |
| 228 | + | ||
| 229 | + | // OverrideGetItemAttributeValue sets the callback function. | |
| 230 | + | func (x *MenuModelClass) OverrideGetItemAttributeValue(cb func(*MenuModel, int, string, *glib.VariantType) *glib.Variant) { | |
| 231 | + | if cb == nil { | |
| 232 | + | x.xGetItemAttributeValue = 0 | |
| 233 | + | } else { | |
| 234 | + | x.xGetItemAttributeValue = purego.NewCallback(func(ModelVarp uintptr, ItemIndexVarp int, AttributeVarp string, ExpectedTypeVarp *glib.VariantType) *glib.Variant { | |
| 235 | + | return cb(MenuModelNewFromInternalPtr(ModelVarp), ItemIndexVarp, AttributeVarp, ExpectedTypeVarp) | |
| 236 | + | }) | |
| 237 | + | } | |
| 238 | + | } | |
| 239 | + | ||
| 240 | + | // GetGetItemAttributeValue gets the callback function. | |
| 241 | + | func (x *MenuModelClass) GetGetItemAttributeValue() func(*MenuModel, int, string, *glib.VariantType) *glib.Variant { | |
| 242 | + | if x.xGetItemAttributeValue == 0 { | |
| 243 | + | return nil | |
| 244 | + | } | |
| 245 | + | var rawCallback func(ModelVarp uintptr, ItemIndexVarp int, AttributeVarp string, ExpectedTypeVarp *glib.VariantType) *glib.Variant | |
| 246 | + | purego.RegisterFunc(&rawCallback, x.xGetItemAttributeValue) | |
| 247 | + | return func(ModelVar *MenuModel, ItemIndexVar int, AttributeVar string, ExpectedTypeVar *glib.VariantType) *glib.Variant { | |
| 248 | + | return rawCallback(ModelVar.GoPointer(), ItemIndexVar, AttributeVar, ExpectedTypeVar) | |
| 249 | + | } | |
| 250 | + | } | |
| 251 | + | ||
| 252 | + | // OverrideGetItemLinks sets the callback function. | |
| 253 | + | func (x *MenuModelClass) OverrideGetItemLinks(cb func(*MenuModel, int, **glib.HashTable)) { | |
| 254 | + | if cb == nil { | |
| 255 | + | x.xGetItemLinks = 0 | |
| 256 | + | } else { | |
| 257 | + | x.xGetItemLinks = purego.NewCallback(func(ModelVarp uintptr, ItemIndexVarp int, LinksVarp **glib.HashTable) { | |
| 258 | + | cb(MenuModelNewFromInternalPtr(ModelVarp), ItemIndexVarp, LinksVarp) | |
| 259 | + | }) | |
| 260 | + | } | |
| 261 | + | } | |
| 262 | + | ||
| 263 | + | // GetGetItemLinks gets the callback function. | |
| 264 | + | func (x *MenuModelClass) GetGetItemLinks() func(*MenuModel, int, **glib.HashTable) { | |
| 265 | + | if x.xGetItemLinks == 0 { | |
| 266 | + | return nil | |
| 267 | + | } | |
| 268 | + | var rawCallback func(ModelVarp uintptr, ItemIndexVarp int, LinksVarp **glib.HashTable) | |
| 269 | + | purego.RegisterFunc(&rawCallback, x.xGetItemLinks) | |
| 270 | + | return func(ModelVar *MenuModel, ItemIndexVar int, LinksVar **glib.HashTable) { | |
| 271 | + | rawCallback(ModelVar.GoPointer(), ItemIndexVar, LinksVar) | |
| 272 | + | } | |
| 273 | + | } | |
| 274 | + | ||
| 275 | + | // OverrideIterateItemLinks sets the callback function. | |
| 276 | + | func (x *MenuModelClass) OverrideIterateItemLinks(cb func(*MenuModel, int) *MenuLinkIter) { | |
| 277 | + | if cb == nil { | |
| 278 | + | x.xIterateItemLinks = 0 | |
| 279 | + | } else { | |
| 280 | + | x.xIterateItemLinks = purego.NewCallback(func(ModelVarp uintptr, ItemIndexVarp int) uintptr { | |
| 281 | + | ret := cb(MenuModelNewFromInternalPtr(ModelVarp), ItemIndexVarp) | |
| 282 | + | if ret == nil { | |
| 283 | + | return 0 | |
| 284 | + | } | |
| 285 | + | return ret.GoPointer() | |
| 286 | + | }) | |
| 287 | + | } | |
| 288 | + | } | |
| 289 | + | ||
| 290 | + | // GetIterateItemLinks gets the callback function. | |
| 291 | + | func (x *MenuModelClass) GetIterateItemLinks() func(*MenuModel, int) *MenuLinkIter { | |
| 292 | + | if x.xIterateItemLinks == 0 { | |
| 293 | + | return nil | |
| 294 | + | } | |
| 295 | + | var rawCallback func(ModelVarp uintptr, ItemIndexVarp int) uintptr | |
| 296 | + | purego.RegisterFunc(&rawCallback, x.xIterateItemLinks) | |
| 297 | + | return func(ModelVar *MenuModel, ItemIndexVar int) *MenuLinkIter { | |
| 298 | + | rawRet := rawCallback(ModelVar.GoPointer(), ItemIndexVar) | |
| 299 | + | if rawRet == 0 { | |
| 300 | + | return nil | |
| 301 | + | } | |
| 302 | + | ret := &MenuLinkIter{} | |
| 303 | + | ret.Ptr = rawRet | |
| 304 | + | return ret | |
| 305 | + | } | |
| 306 | + | } | |
| 307 | + | ||
| 308 | + | // OverrideGetItemLink sets the callback function. | |
| 309 | + | func (x *MenuModelClass) OverrideGetItemLink(cb func(*MenuModel, int, string) *MenuModel) { | |
| 310 | + | if cb == nil { | |
| 311 | + | x.xGetItemLink = 0 | |
| 312 | + | } else { | |
| 313 | + | x.xGetItemLink = purego.NewCallback(func(ModelVarp uintptr, ItemIndexVarp int, LinkVarp string) uintptr { | |
| 314 | + | ret := cb(MenuModelNewFromInternalPtr(ModelVarp), ItemIndexVarp, LinkVarp) | |
| 315 | + | if ret == nil { | |
| 316 | + | return 0 | |
| 317 | + | } | |
| 318 | + | return ret.GoPointer() | |
| 319 | + | }) | |
| 320 | + | } | |
| 321 | + | } | |
| 322 | + | ||
| 323 | + | // GetGetItemLink gets the callback function. | |
| 324 | + | func (x *MenuModelClass) GetGetItemLink() func(*MenuModel, int, string) *MenuModel { | |
| 325 | + | if x.xGetItemLink == 0 { | |
| 326 | + | return nil | |
| 327 | + | } | |
| 328 | + | var rawCallback func(ModelVarp uintptr, ItemIndexVarp int, LinkVarp string) uintptr | |
| 329 | + | purego.RegisterFunc(&rawCallback, x.xGetItemLink) | |
| 330 | + | return func(ModelVar *MenuModel, ItemIndexVar int, LinkVar string) *MenuModel { | |
| 331 | + | rawRet := rawCallback(ModelVar.GoPointer(), ItemIndexVar, LinkVar) | |
| 332 | + | if rawRet == 0 { | |
| 333 | + | return nil | |
| 334 | + | } | |
| 335 | + | ret := &MenuModel{} | |
| 336 | + | ret.Ptr = rawRet | |
| 337 | + | return ret | |
| 338 | + | } | |
| 339 | + | } | |
| 340 | + | ||
| 61 | 341 | type MenuModelPrivate struct { | |
| 62 | 342 | _ structs.HostLayout | |
| 63 | 343 | } | |
| @@ -225,7 +505,7 @@ func (x *MenuLinkIter) GetName() string { | |||
| 225 | 505 | return cret | |
| 226 | 506 | } | |
| 227 | 507 | ||
| 228 | - | var xMenuLinkIterGetNext func(uintptr, string, *uintptr) bool | |
| 508 | + | var xMenuLinkIterGetNext func(uintptr, string, uintptr) bool | |
| 229 | 509 | ||
| 230 | 510 | // This function combines g_menu_link_iter_next() with | |
| 231 | 511 | // g_menu_link_iter_get_name() and g_menu_link_iter_get_value(). | |
| @@ -243,7 +523,7 @@ var xMenuLinkIterGetNext func(uintptr, string, *uintptr) bool | |||
| 243 | 523 | // be unreffed using g_object_unref() when it is no longer in use. | |
| 244 | 524 | func (x *MenuLinkIter) GetNext(OutLinkVar string, ValueVar **MenuModel) bool { | |
| 245 | 525 | ||
| 246 | - | cret := xMenuLinkIterGetNext(x.GoPointer(), OutLinkVar, gobject.ConvertPtr(ValueVar)) | |
| 526 | + | cret := xMenuLinkIterGetNext(x.GoPointer(), OutLinkVar, *gobject.ConvertPtr(ValueVar)) | |
| 247 | 527 | return cret | |
| 248 | 528 | } | |
| 249 | 529 | ||
M v4/gio/gmount.go +742 -7
| @@ -16,12 +16,747 @@ type MountIface struct { | |||
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | 18 | GIface uintptr | |
| 19 | + | ||
| 20 | + | xChanged uintptr | |
| 21 | + | ||
| 22 | + | xUnmounted uintptr | |
| 23 | + | ||
| 24 | + | xGetRoot uintptr | |
| 25 | + | ||
| 26 | + | xGetName uintptr | |
| 27 | + | ||
| 28 | + | xGetIcon uintptr | |
| 29 | + | ||
| 30 | + | xGetUuid uintptr | |
| 31 | + | ||
| 32 | + | xGetVolume uintptr | |
| 33 | + | ||
| 34 | + | xGetDrive uintptr | |
| 35 | + | ||
| 36 | + | xCanUnmount uintptr | |
| 37 | + | ||
| 38 | + | xCanEject uintptr | |
| 39 | + | ||
| 40 | + | xUnmount uintptr | |
| 41 | + | ||
| 42 | + | xUnmountFinish uintptr | |
| 43 | + | ||
| 44 | + | xEject uintptr | |
| 45 | + | ||
| 46 | + | xEjectFinish uintptr | |
| 47 | + | ||
| 48 | + | xRemount uintptr | |
| 49 | + | ||
| 50 | + | xRemountFinish uintptr | |
| 51 | + | ||
| 52 | + | xGuessContentType uintptr | |
| 53 | + | ||
| 54 | + | xGuessContentTypeFinish uintptr | |
| 55 | + | ||
| 56 | + | xGuessContentTypeSync uintptr | |
| 57 | + | ||
| 58 | + | xPreUnmount uintptr | |
| 59 | + | ||
| 60 | + | xUnmountWithOperation uintptr | |
| 61 | + | ||
| 62 | + | xUnmountWithOperationFinish uintptr | |
| 63 | + | ||
| 64 | + | xEjectWithOperation uintptr | |
| 65 | + | ||
| 66 | + | xEjectWithOperationFinish uintptr | |
| 67 | + | ||
| 68 | + | xGetDefaultLocation uintptr | |
| 69 | + | ||
| 70 | + | xGetSortKey uintptr | |
| 71 | + | ||
| 72 | + | xGetSymbolicIcon uintptr | |
| 19 | 73 | } | |
| 20 | 74 | ||
| 21 | 75 | func (x *MountIface) GoPointer() uintptr { | |
| 22 | 76 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 77 | } | |
| 24 | 78 | ||
| 79 | + | // OverrideChanged sets the callback function. | |
| 80 | + | func (x *MountIface) OverrideChanged(cb func(Mount)) { | |
| 81 | + | if cb == nil { | |
| 82 | + | x.xChanged = 0 | |
| 83 | + | } else { | |
| 84 | + | x.xChanged = purego.NewCallback(func(MountVarp uintptr) { | |
| 85 | + | cb(&MountBase{Ptr: MountVarp}) | |
| 86 | + | }) | |
| 87 | + | } | |
| 88 | + | } | |
| 89 | + | ||
| 90 | + | // GetChanged gets the callback function. | |
| 91 | + | func (x *MountIface) GetChanged() func(Mount) { | |
| 92 | + | if x.xChanged == 0 { | |
| 93 | + | return nil | |
| 94 | + | } | |
| 95 | + | var rawCallback func(MountVarp uintptr) | |
| 96 | + | purego.RegisterFunc(&rawCallback, x.xChanged) | |
| 97 | + | return func(MountVar Mount) { | |
| 98 | + | rawCallback(MountVar.GoPointer()) | |
| 99 | + | } | |
| 100 | + | } | |
| 101 | + | ||
| 102 | + | // OverrideUnmounted sets the callback function. | |
| 103 | + | func (x *MountIface) OverrideUnmounted(cb func(Mount)) { | |
| 104 | + | if cb == nil { | |
| 105 | + | x.xUnmounted = 0 | |
| 106 | + | } else { | |
| 107 | + | x.xUnmounted = purego.NewCallback(func(MountVarp uintptr) { | |
| 108 | + | cb(&MountBase{Ptr: MountVarp}) | |
| 109 | + | }) | |
| 110 | + | } | |
| 111 | + | } | |
| 112 | + | ||
| 113 | + | // GetUnmounted gets the callback function. | |
| 114 | + | func (x *MountIface) GetUnmounted() func(Mount) { | |
| 115 | + | if x.xUnmounted == 0 { | |
| 116 | + | return nil | |
| 117 | + | } | |
| 118 | + | var rawCallback func(MountVarp uintptr) | |
| 119 | + | purego.RegisterFunc(&rawCallback, x.xUnmounted) | |
| 120 | + | return func(MountVar Mount) { | |
| 121 | + | rawCallback(MountVar.GoPointer()) | |
| 122 | + | } | |
| 123 | + | } | |
| 124 | + | ||
| 125 | + | // OverrideGetRoot sets the callback function. | |
| 126 | + | func (x *MountIface) OverrideGetRoot(cb func(Mount) *FileBase) { | |
| 127 | + | if cb == nil { | |
| 128 | + | x.xGetRoot = 0 | |
| 129 | + | } else { | |
| 130 | + | x.xGetRoot = purego.NewCallback(func(MountVarp uintptr) uintptr { | |
| 131 | + | ret := cb(&MountBase{Ptr: MountVarp}) | |
| 132 | + | if ret == nil { | |
| 133 | + | return 0 | |
| 134 | + | } | |
| 135 | + | return ret.GoPointer() | |
| 136 | + | }) | |
| 137 | + | } | |
| 138 | + | } | |
| 139 | + | ||
| 140 | + | // GetGetRoot gets the callback function. | |
| 141 | + | func (x *MountIface) GetGetRoot() func(Mount) *FileBase { | |
| 142 | + | if x.xGetRoot == 0 { | |
| 143 | + | return nil | |
| 144 | + | } | |
| 145 | + | var rawCallback func(MountVarp uintptr) uintptr | |
| 146 | + | purego.RegisterFunc(&rawCallback, x.xGetRoot) | |
| 147 | + | return func(MountVar Mount) *FileBase { | |
| 148 | + | rawRet := rawCallback(MountVar.GoPointer()) | |
| 149 | + | if rawRet == 0 { | |
| 150 | + | return nil | |
| 151 | + | } | |
| 152 | + | ret := &FileBase{} | |
| 153 | + | ret.Ptr = rawRet | |
| 154 | + | return ret | |
| 155 | + | } | |
| 156 | + | } | |
| 157 | + | ||
| 158 | + | // OverrideGetName sets the callback function. | |
| 159 | + | func (x *MountIface) OverrideGetName(cb func(Mount) string) { | |
| 160 | + | if cb == nil { | |
| 161 | + | x.xGetName = 0 | |
| 162 | + | } else { | |
| 163 | + | x.xGetName = purego.NewCallback(func(MountVarp uintptr) string { | |
| 164 | + | return cb(&MountBase{Ptr: MountVarp}) | |
| 165 | + | }) | |
| 166 | + | } | |
| 167 | + | } | |
| 168 | + | ||
| 169 | + | // GetGetName gets the callback function. | |
| 170 | + | func (x *MountIface) GetGetName() func(Mount) string { | |
| 171 | + | if x.xGetName == 0 { | |
| 172 | + | return nil | |
| 173 | + | } | |
| 174 | + | var rawCallback func(MountVarp uintptr) string | |
| 175 | + | purego.RegisterFunc(&rawCallback, x.xGetName) | |
| 176 | + | return func(MountVar Mount) string { | |
| 177 | + | return rawCallback(MountVar.GoPointer()) | |
| 178 | + | } | |
| 179 | + | } | |
| 180 | + | ||
| 181 | + | // OverrideGetIcon sets the callback function. | |
| 182 | + | func (x *MountIface) OverrideGetIcon(cb func(Mount) *IconBase) { | |
| 183 | + | if cb == nil { | |
| 184 | + | x.xGetIcon = 0 | |
| 185 | + | } else { | |
| 186 | + | x.xGetIcon = purego.NewCallback(func(MountVarp uintptr) uintptr { | |
| 187 | + | ret := cb(&MountBase{Ptr: MountVarp}) | |
| 188 | + | if ret == nil { | |
| 189 | + | return 0 | |
| 190 | + | } | |
| 191 | + | return ret.GoPointer() | |
| 192 | + | }) | |
| 193 | + | } | |
| 194 | + | } | |
| 195 | + | ||
| 196 | + | // GetGetIcon gets the callback function. | |
| 197 | + | func (x *MountIface) GetGetIcon() func(Mount) *IconBase { | |
| 198 | + | if x.xGetIcon == 0 { | |
| 199 | + | return nil | |
| 200 | + | } | |
| 201 | + | var rawCallback func(MountVarp uintptr) uintptr | |
| 202 | + | purego.RegisterFunc(&rawCallback, x.xGetIcon) | |
| 203 | + | return func(MountVar Mount) *IconBase { | |
| 204 | + | rawRet := rawCallback(MountVar.GoPointer()) | |
| 205 | + | if rawRet == 0 { | |
| 206 | + | return nil | |
| 207 | + | } | |
| 208 | + | ret := &IconBase{} | |
| 209 | + | ret.Ptr = rawRet | |
| 210 | + | return ret | |
| 211 | + | } | |
| 212 | + | } | |
| 213 | + | ||
| 214 | + | // OverrideGetUuid sets the callback function. | |
| 215 | + | func (x *MountIface) OverrideGetUuid(cb func(Mount) string) { | |
| 216 | + | if cb == nil { | |
| 217 | + | x.xGetUuid = 0 | |
| 218 | + | } else { | |
| 219 | + | x.xGetUuid = purego.NewCallback(func(MountVarp uintptr) string { | |
| 220 | + | return cb(&MountBase{Ptr: MountVarp}) | |
| 221 | + | }) | |
| 222 | + | } | |
| 223 | + | } | |
| 224 | + | ||
| 225 | + | // GetGetUuid gets the callback function. | |
| 226 | + | func (x *MountIface) GetGetUuid() func(Mount) string { | |
| 227 | + | if x.xGetUuid == 0 { | |
| 228 | + | return nil | |
| 229 | + | } | |
| 230 | + | var rawCallback func(MountVarp uintptr) string | |
| 231 | + | purego.RegisterFunc(&rawCallback, x.xGetUuid) | |
| 232 | + | return func(MountVar Mount) string { | |
| 233 | + | return rawCallback(MountVar.GoPointer()) | |
| 234 | + | } | |
| 235 | + | } | |
| 236 | + | ||
| 237 | + | // OverrideGetVolume sets the callback function. | |
| 238 | + | func (x *MountIface) OverrideGetVolume(cb func(Mount) *VolumeBase) { | |
| 239 | + | if cb == nil { | |
| 240 | + | x.xGetVolume = 0 | |
| 241 | + | } else { | |
| 242 | + | x.xGetVolume = purego.NewCallback(func(MountVarp uintptr) uintptr { | |
| 243 | + | ret := cb(&MountBase{Ptr: MountVarp}) | |
| 244 | + | if ret == nil { | |
| 245 | + | return 0 | |
| 246 | + | } | |
| 247 | + | return ret.GoPointer() | |
| 248 | + | }) | |
| 249 | + | } | |
| 250 | + | } | |
| 251 | + | ||
| 252 | + | // GetGetVolume gets the callback function. | |
| 253 | + | func (x *MountIface) GetGetVolume() func(Mount) *VolumeBase { | |
| 254 | + | if x.xGetVolume == 0 { | |
| 255 | + | return nil | |
| 256 | + | } | |
| 257 | + | var rawCallback func(MountVarp uintptr) uintptr | |
| 258 | + | purego.RegisterFunc(&rawCallback, x.xGetVolume) | |
| 259 | + | return func(MountVar Mount) *VolumeBase { | |
| 260 | + | rawRet := rawCallback(MountVar.GoPointer()) | |
| 261 | + | if rawRet == 0 { | |
| 262 | + | return nil | |
| 263 | + | } | |
| 264 | + | ret := &VolumeBase{} | |
| 265 | + | ret.Ptr = rawRet | |
| 266 | + | return ret | |
| 267 | + | } | |
| 268 | + | } | |
| 269 | + | ||
| 270 | + | // OverrideGetDrive sets the callback function. | |
| 271 | + | func (x *MountIface) OverrideGetDrive(cb func(Mount) *DriveBase) { | |
| 272 | + | if cb == nil { | |
| 273 | + | x.xGetDrive = 0 | |
| 274 | + | } else { | |
| 275 | + | x.xGetDrive = purego.NewCallback(func(MountVarp uintptr) uintptr { | |
| 276 | + | ret := cb(&MountBase{Ptr: MountVarp}) | |
| 277 | + | if ret == nil { | |
| 278 | + | return 0 | |
| 279 | + | } | |
| 280 | + | return ret.GoPointer() | |
| 281 | + | }) | |
| 282 | + | } | |
| 283 | + | } | |
| 284 | + | ||
| 285 | + | // GetGetDrive gets the callback function. | |
| 286 | + | func (x *MountIface) GetGetDrive() func(Mount) *DriveBase { | |
| 287 | + | if x.xGetDrive == 0 { | |
| 288 | + | return nil | |
| 289 | + | } | |
| 290 | + | var rawCallback func(MountVarp uintptr) uintptr | |
| 291 | + | purego.RegisterFunc(&rawCallback, x.xGetDrive) | |
| 292 | + | return func(MountVar Mount) *DriveBase { | |
| 293 | + | rawRet := rawCallback(MountVar.GoPointer()) | |
| 294 | + | if rawRet == 0 { | |
| 295 | + | return nil | |
| 296 | + | } | |
| 297 | + | ret := &DriveBase{} | |
| 298 | + | ret.Ptr = rawRet | |
| 299 | + | return ret | |
| 300 | + | } | |
| 301 | + | } | |
| 302 | + | ||
| 303 | + | // OverrideCanUnmount sets the callback function. | |
| 304 | + | func (x *MountIface) OverrideCanUnmount(cb func(Mount) bool) { | |
| 305 | + | if cb == nil { | |
| 306 | + | x.xCanUnmount = 0 | |
| 307 | + | } else { | |
| 308 | + | x.xCanUnmount = purego.NewCallback(func(MountVarp uintptr) bool { | |
| 309 | + | return cb(&MountBase{Ptr: MountVarp}) | |
| 310 | + | }) | |
| 311 | + | } | |
| 312 | + | } | |
| 313 | + | ||
| 314 | + | // GetCanUnmount gets the callback function. | |
| 315 | + | func (x *MountIface) GetCanUnmount() func(Mount) bool { | |
| 316 | + | if x.xCanUnmount == 0 { | |
| 317 | + | return nil | |
| 318 | + | } | |
| 319 | + | var rawCallback func(MountVarp uintptr) bool | |
| 320 | + | purego.RegisterFunc(&rawCallback, x.xCanUnmount) | |
| 321 | + | return func(MountVar Mount) bool { | |
| 322 | + | return rawCallback(MountVar.GoPointer()) | |
| 323 | + | } | |
| 324 | + | } | |
| 325 | + | ||
| 326 | + | // OverrideCanEject sets the callback function. | |
| 327 | + | func (x *MountIface) OverrideCanEject(cb func(Mount) bool) { | |
| 328 | + | if cb == nil { | |
| 329 | + | x.xCanEject = 0 | |
| 330 | + | } else { | |
| 331 | + | x.xCanEject = purego.NewCallback(func(MountVarp uintptr) bool { | |
| 332 | + | return cb(&MountBase{Ptr: MountVarp}) | |
| 333 | + | }) | |
| 334 | + | } | |
| 335 | + | } | |
| 336 | + | ||
| 337 | + | // GetCanEject gets the callback function. | |
| 338 | + | func (x *MountIface) GetCanEject() func(Mount) bool { | |
| 339 | + | if x.xCanEject == 0 { | |
| 340 | + | return nil | |
| 341 | + | } | |
| 342 | + | var rawCallback func(MountVarp uintptr) bool | |
| 343 | + | purego.RegisterFunc(&rawCallback, x.xCanEject) | |
| 344 | + | return func(MountVar Mount) bool { | |
| 345 | + | return rawCallback(MountVar.GoPointer()) | |
| 346 | + | } | |
| 347 | + | } | |
| 348 | + | ||
| 349 | + | // OverrideUnmount sets the callback function. | |
| 350 | + | func (x *MountIface) OverrideUnmount(cb func(Mount, MountUnmountFlags, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 351 | + | if cb == nil { | |
| 352 | + | x.xUnmount = 0 | |
| 353 | + | } else { | |
| 354 | + | x.xUnmount = purego.NewCallback(func(MountVarp uintptr, FlagsVarp MountUnmountFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 355 | + | cb(&MountBase{Ptr: MountVarp}, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 356 | + | }) | |
| 357 | + | } | |
| 358 | + | } | |
| 359 | + | ||
| 360 | + | // GetUnmount gets the callback function. | |
| 361 | + | func (x *MountIface) GetUnmount() func(Mount, MountUnmountFlags, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 362 | + | if x.xUnmount == 0 { | |
| 363 | + | return nil | |
| 364 | + | } | |
| 365 | + | var rawCallback func(MountVarp uintptr, FlagsVarp MountUnmountFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 366 | + | purego.RegisterFunc(&rawCallback, x.xUnmount) | |
| 367 | + | return func(MountVar Mount, FlagsVar MountUnmountFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 368 | + | rawCallback(MountVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 369 | + | } | |
| 370 | + | } | |
| 371 | + | ||
| 372 | + | // OverrideUnmountFinish sets the callback function. | |
| 373 | + | func (x *MountIface) OverrideUnmountFinish(cb func(Mount, AsyncResult) bool) { | |
| 374 | + | if cb == nil { | |
| 375 | + | x.xUnmountFinish = 0 | |
| 376 | + | } else { | |
| 377 | + | x.xUnmountFinish = purego.NewCallback(func(MountVarp uintptr, ResultVarp uintptr) bool { | |
| 378 | + | return cb(&MountBase{Ptr: MountVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 379 | + | }) | |
| 380 | + | } | |
| 381 | + | } | |
| 382 | + | ||
| 383 | + | // GetUnmountFinish gets the callback function. | |
| 384 | + | func (x *MountIface) GetUnmountFinish() func(Mount, AsyncResult) bool { | |
| 385 | + | if x.xUnmountFinish == 0 { | |
| 386 | + | return nil | |
| 387 | + | } | |
| 388 | + | var rawCallback func(MountVarp uintptr, ResultVarp uintptr) bool | |
| 389 | + | purego.RegisterFunc(&rawCallback, x.xUnmountFinish) | |
| 390 | + | return func(MountVar Mount, ResultVar AsyncResult) bool { | |
| 391 | + | return rawCallback(MountVar.GoPointer(), ResultVar.GoPointer()) | |
| 392 | + | } | |
| 393 | + | } | |
| 394 | + | ||
| 395 | + | // OverrideEject sets the callback function. | |
| 396 | + | func (x *MountIface) OverrideEject(cb func(Mount, MountUnmountFlags, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 397 | + | if cb == nil { | |
| 398 | + | x.xEject = 0 | |
| 399 | + | } else { | |
| 400 | + | x.xEject = purego.NewCallback(func(MountVarp uintptr, FlagsVarp MountUnmountFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 401 | + | cb(&MountBase{Ptr: MountVarp}, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 402 | + | }) | |
| 403 | + | } | |
| 404 | + | } | |
| 405 | + | ||
| 406 | + | // GetEject gets the callback function. | |
| 407 | + | func (x *MountIface) GetEject() func(Mount, MountUnmountFlags, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 408 | + | if x.xEject == 0 { | |
| 409 | + | return nil | |
| 410 | + | } | |
| 411 | + | var rawCallback func(MountVarp uintptr, FlagsVarp MountUnmountFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 412 | + | purego.RegisterFunc(&rawCallback, x.xEject) | |
| 413 | + | return func(MountVar Mount, FlagsVar MountUnmountFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 414 | + | rawCallback(MountVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 415 | + | } | |
| 416 | + | } | |
| 417 | + | ||
| 418 | + | // OverrideEjectFinish sets the callback function. | |
| 419 | + | func (x *MountIface) OverrideEjectFinish(cb func(Mount, AsyncResult) bool) { | |
| 420 | + | if cb == nil { | |
| 421 | + | x.xEjectFinish = 0 | |
| 422 | + | } else { | |
| 423 | + | x.xEjectFinish = purego.NewCallback(func(MountVarp uintptr, ResultVarp uintptr) bool { | |
| 424 | + | return cb(&MountBase{Ptr: MountVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 425 | + | }) | |
| 426 | + | } | |
| 427 | + | } | |
| 428 | + | ||
| 429 | + | // GetEjectFinish gets the callback function. | |
| 430 | + | func (x *MountIface) GetEjectFinish() func(Mount, AsyncResult) bool { | |
| 431 | + | if x.xEjectFinish == 0 { | |
| 432 | + | return nil | |
| 433 | + | } | |
| 434 | + | var rawCallback func(MountVarp uintptr, ResultVarp uintptr) bool | |
| 435 | + | purego.RegisterFunc(&rawCallback, x.xEjectFinish) | |
| 436 | + | return func(MountVar Mount, ResultVar AsyncResult) bool { | |
| 437 | + | return rawCallback(MountVar.GoPointer(), ResultVar.GoPointer()) | |
| 438 | + | } | |
| 439 | + | } | |
| 440 | + | ||
| 441 | + | // OverrideRemount sets the callback function. | |
| 442 | + | func (x *MountIface) OverrideRemount(cb func(Mount, MountMountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 443 | + | if cb == nil { | |
| 444 | + | x.xRemount = 0 | |
| 445 | + | } else { | |
| 446 | + | x.xRemount = purego.NewCallback(func(MountVarp uintptr, FlagsVarp MountMountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 447 | + | cb(&MountBase{Ptr: MountVarp}, FlagsVarp, MountOperationNewFromInternalPtr(MountOperationVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 448 | + | }) | |
| 449 | + | } | |
| 450 | + | } | |
| 451 | + | ||
| 452 | + | // GetRemount gets the callback function. | |
| 453 | + | func (x *MountIface) GetRemount() func(Mount, MountMountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 454 | + | if x.xRemount == 0 { | |
| 455 | + | return nil | |
| 456 | + | } | |
| 457 | + | var rawCallback func(MountVarp uintptr, FlagsVarp MountMountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 458 | + | purego.RegisterFunc(&rawCallback, x.xRemount) | |
| 459 | + | return func(MountVar Mount, FlagsVar MountMountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 460 | + | rawCallback(MountVar.GoPointer(), FlagsVar, MountOperationVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 461 | + | } | |
| 462 | + | } | |
| 463 | + | ||
| 464 | + | // OverrideRemountFinish sets the callback function. | |
| 465 | + | func (x *MountIface) OverrideRemountFinish(cb func(Mount, AsyncResult) bool) { | |
| 466 | + | if cb == nil { | |
| 467 | + | x.xRemountFinish = 0 | |
| 468 | + | } else { | |
| 469 | + | x.xRemountFinish = purego.NewCallback(func(MountVarp uintptr, ResultVarp uintptr) bool { | |
| 470 | + | return cb(&MountBase{Ptr: MountVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 471 | + | }) | |
| 472 | + | } | |
| 473 | + | } | |
| 474 | + | ||
| 475 | + | // GetRemountFinish gets the callback function. | |
| 476 | + | func (x *MountIface) GetRemountFinish() func(Mount, AsyncResult) bool { | |
| 477 | + | if x.xRemountFinish == 0 { | |
| 478 | + | return nil | |
| 479 | + | } | |
| 480 | + | var rawCallback func(MountVarp uintptr, ResultVarp uintptr) bool | |
| 481 | + | purego.RegisterFunc(&rawCallback, x.xRemountFinish) | |
| 482 | + | return func(MountVar Mount, ResultVar AsyncResult) bool { | |
| 483 | + | return rawCallback(MountVar.GoPointer(), ResultVar.GoPointer()) | |
| 484 | + | } | |
| 485 | + | } | |
| 486 | + | ||
| 487 | + | // OverrideGuessContentType sets the callback function. | |
| 488 | + | func (x *MountIface) OverrideGuessContentType(cb func(Mount, bool, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 489 | + | if cb == nil { | |
| 490 | + | x.xGuessContentType = 0 | |
| 491 | + | } else { | |
| 492 | + | x.xGuessContentType = purego.NewCallback(func(MountVarp uintptr, ForceRescanVarp bool, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 493 | + | cb(&MountBase{Ptr: MountVarp}, ForceRescanVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 494 | + | }) | |
| 495 | + | } | |
| 496 | + | } | |
| 497 | + | ||
| 498 | + | // GetGuessContentType gets the callback function. | |
| 499 | + | func (x *MountIface) GetGuessContentType() func(Mount, bool, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 500 | + | if x.xGuessContentType == 0 { | |
| 501 | + | return nil | |
| 502 | + | } | |
| 503 | + | var rawCallback func(MountVarp uintptr, ForceRescanVarp bool, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 504 | + | purego.RegisterFunc(&rawCallback, x.xGuessContentType) | |
| 505 | + | return func(MountVar Mount, ForceRescanVar bool, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 506 | + | rawCallback(MountVar.GoPointer(), ForceRescanVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 507 | + | } | |
| 508 | + | } | |
| 509 | + | ||
| 510 | + | // OverrideGuessContentTypeFinish sets the callback function. | |
| 511 | + | func (x *MountIface) OverrideGuessContentTypeFinish(cb func(Mount, AsyncResult) []string) { | |
| 512 | + | if cb == nil { | |
| 513 | + | x.xGuessContentTypeFinish = 0 | |
| 514 | + | } else { | |
| 515 | + | x.xGuessContentTypeFinish = purego.NewCallback(func(MountVarp uintptr, ResultVarp uintptr) []string { | |
| 516 | + | return cb(&MountBase{Ptr: MountVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 517 | + | }) | |
| 518 | + | } | |
| 519 | + | } | |
| 520 | + | ||
| 521 | + | // GetGuessContentTypeFinish gets the callback function. | |
| 522 | + | func (x *MountIface) GetGuessContentTypeFinish() func(Mount, AsyncResult) []string { | |
| 523 | + | if x.xGuessContentTypeFinish == 0 { | |
| 524 | + | return nil | |
| 525 | + | } | |
| 526 | + | var rawCallback func(MountVarp uintptr, ResultVarp uintptr) []string | |
| 527 | + | purego.RegisterFunc(&rawCallback, x.xGuessContentTypeFinish) | |
| 528 | + | return func(MountVar Mount, ResultVar AsyncResult) []string { | |
| 529 | + | return rawCallback(MountVar.GoPointer(), ResultVar.GoPointer()) | |
| 530 | + | } | |
| 531 | + | } | |
| 532 | + | ||
| 533 | + | // OverrideGuessContentTypeSync sets the callback function. | |
| 534 | + | func (x *MountIface) OverrideGuessContentTypeSync(cb func(Mount, bool, *Cancellable) []string) { | |
| 535 | + | if cb == nil { | |
| 536 | + | x.xGuessContentTypeSync = 0 | |
| 537 | + | } else { | |
| 538 | + | x.xGuessContentTypeSync = purego.NewCallback(func(MountVarp uintptr, ForceRescanVarp bool, CancellableVarp uintptr) []string { | |
| 539 | + | return cb(&MountBase{Ptr: MountVarp}, ForceRescanVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 540 | + | }) | |
| 541 | + | } | |
| 542 | + | } | |
| 543 | + | ||
| 544 | + | // GetGuessContentTypeSync gets the callback function. | |
| 545 | + | func (x *MountIface) GetGuessContentTypeSync() func(Mount, bool, *Cancellable) []string { | |
| 546 | + | if x.xGuessContentTypeSync == 0 { | |
| 547 | + | return nil | |
| 548 | + | } | |
| 549 | + | var rawCallback func(MountVarp uintptr, ForceRescanVarp bool, CancellableVarp uintptr) []string | |
| 550 | + | purego.RegisterFunc(&rawCallback, x.xGuessContentTypeSync) | |
| 551 | + | return func(MountVar Mount, ForceRescanVar bool, CancellableVar *Cancellable) []string { | |
| 552 | + | return rawCallback(MountVar.GoPointer(), ForceRescanVar, CancellableVar.GoPointer()) | |
| 553 | + | } | |
| 554 | + | } | |
| 555 | + | ||
| 556 | + | // OverridePreUnmount sets the callback function. | |
| 557 | + | func (x *MountIface) OverridePreUnmount(cb func(Mount)) { | |
| 558 | + | if cb == nil { | |
| 559 | + | x.xPreUnmount = 0 | |
| 560 | + | } else { | |
| 561 | + | x.xPreUnmount = purego.NewCallback(func(MountVarp uintptr) { | |
| 562 | + | cb(&MountBase{Ptr: MountVarp}) | |
| 563 | + | }) | |
| 564 | + | } | |
| 565 | + | } | |
| 566 | + | ||
| 567 | + | // GetPreUnmount gets the callback function. | |
| 568 | + | func (x *MountIface) GetPreUnmount() func(Mount) { | |
| 569 | + | if x.xPreUnmount == 0 { | |
| 570 | + | return nil | |
| 571 | + | } | |
| 572 | + | var rawCallback func(MountVarp uintptr) | |
| 573 | + | purego.RegisterFunc(&rawCallback, x.xPreUnmount) | |
| 574 | + | return func(MountVar Mount) { | |
| 575 | + | rawCallback(MountVar.GoPointer()) | |
| 576 | + | } | |
| 577 | + | } | |
| 578 | + | ||
| 579 | + | // OverrideUnmountWithOperation sets the callback function. | |
| 580 | + | func (x *MountIface) OverrideUnmountWithOperation(cb func(Mount, MountUnmountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 581 | + | if cb == nil { | |
| 582 | + | x.xUnmountWithOperation = 0 | |
| 583 | + | } else { | |
| 584 | + | x.xUnmountWithOperation = purego.NewCallback(func(MountVarp uintptr, FlagsVarp MountUnmountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 585 | + | cb(&MountBase{Ptr: MountVarp}, FlagsVarp, MountOperationNewFromInternalPtr(MountOperationVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 586 | + | }) | |
| 587 | + | } | |
| 588 | + | } | |
| 589 | + | ||
| 590 | + | // GetUnmountWithOperation gets the callback function. | |
| 591 | + | func (x *MountIface) GetUnmountWithOperation() func(Mount, MountUnmountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 592 | + | if x.xUnmountWithOperation == 0 { | |
| 593 | + | return nil | |
| 594 | + | } | |
| 595 | + | var rawCallback func(MountVarp uintptr, FlagsVarp MountUnmountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 596 | + | purego.RegisterFunc(&rawCallback, x.xUnmountWithOperation) | |
| 597 | + | return func(MountVar Mount, FlagsVar MountUnmountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 598 | + | rawCallback(MountVar.GoPointer(), FlagsVar, MountOperationVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 599 | + | } | |
| 600 | + | } | |
| 601 | + | ||
| 602 | + | // OverrideUnmountWithOperationFinish sets the callback function. | |
| 603 | + | func (x *MountIface) OverrideUnmountWithOperationFinish(cb func(Mount, AsyncResult) bool) { | |
| 604 | + | if cb == nil { | |
| 605 | + | x.xUnmountWithOperationFinish = 0 | |
| 606 | + | } else { | |
| 607 | + | x.xUnmountWithOperationFinish = purego.NewCallback(func(MountVarp uintptr, ResultVarp uintptr) bool { | |
| 608 | + | return cb(&MountBase{Ptr: MountVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 609 | + | }) | |
| 610 | + | } | |
| 611 | + | } | |
| 612 | + | ||
| 613 | + | // GetUnmountWithOperationFinish gets the callback function. | |
| 614 | + | func (x *MountIface) GetUnmountWithOperationFinish() func(Mount, AsyncResult) bool { | |
| 615 | + | if x.xUnmountWithOperationFinish == 0 { | |
| 616 | + | return nil | |
| 617 | + | } | |
| 618 | + | var rawCallback func(MountVarp uintptr, ResultVarp uintptr) bool | |
| 619 | + | purego.RegisterFunc(&rawCallback, x.xUnmountWithOperationFinish) | |
| 620 | + | return func(MountVar Mount, ResultVar AsyncResult) bool { | |
| 621 | + | return rawCallback(MountVar.GoPointer(), ResultVar.GoPointer()) | |
| 622 | + | } | |
| 623 | + | } | |
| 624 | + | ||
| 625 | + | // OverrideEjectWithOperation sets the callback function. | |
| 626 | + | func (x *MountIface) OverrideEjectWithOperation(cb func(Mount, MountUnmountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 627 | + | if cb == nil { | |
| 628 | + | x.xEjectWithOperation = 0 | |
| 629 | + | } else { | |
| 630 | + | x.xEjectWithOperation = purego.NewCallback(func(MountVarp uintptr, FlagsVarp MountUnmountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 631 | + | cb(&MountBase{Ptr: MountVarp}, FlagsVarp, MountOperationNewFromInternalPtr(MountOperationVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 632 | + | }) | |
| 633 | + | } | |
| 634 | + | } | |
| 635 | + | ||
| 636 | + | // GetEjectWithOperation gets the callback function. | |
| 637 | + | func (x *MountIface) GetEjectWithOperation() func(Mount, MountUnmountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 638 | + | if x.xEjectWithOperation == 0 { | |
| 639 | + | return nil | |
| 640 | + | } | |
| 641 | + | var rawCallback func(MountVarp uintptr, FlagsVarp MountUnmountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 642 | + | purego.RegisterFunc(&rawCallback, x.xEjectWithOperation) | |
| 643 | + | return func(MountVar Mount, FlagsVar MountUnmountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 644 | + | rawCallback(MountVar.GoPointer(), FlagsVar, MountOperationVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 645 | + | } | |
| 646 | + | } | |
| 647 | + | ||
| 648 | + | // OverrideEjectWithOperationFinish sets the callback function. | |
| 649 | + | func (x *MountIface) OverrideEjectWithOperationFinish(cb func(Mount, AsyncResult) bool) { | |
| 650 | + | if cb == nil { | |
| 651 | + | x.xEjectWithOperationFinish = 0 | |
| 652 | + | } else { | |
| 653 | + | x.xEjectWithOperationFinish = purego.NewCallback(func(MountVarp uintptr, ResultVarp uintptr) bool { | |
| 654 | + | return cb(&MountBase{Ptr: MountVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 655 | + | }) | |
| 656 | + | } | |
| 657 | + | } | |
| 658 | + | ||
| 659 | + | // GetEjectWithOperationFinish gets the callback function. | |
| 660 | + | func (x *MountIface) GetEjectWithOperationFinish() func(Mount, AsyncResult) bool { | |
| 661 | + | if x.xEjectWithOperationFinish == 0 { | |
| 662 | + | return nil | |
| 663 | + | } | |
| 664 | + | var rawCallback func(MountVarp uintptr, ResultVarp uintptr) bool | |
| 665 | + | purego.RegisterFunc(&rawCallback, x.xEjectWithOperationFinish) | |
| 666 | + | return func(MountVar Mount, ResultVar AsyncResult) bool { | |
| 667 | + | return rawCallback(MountVar.GoPointer(), ResultVar.GoPointer()) | |
| 668 | + | } | |
| 669 | + | } | |
| 670 | + | ||
| 671 | + | // OverrideGetDefaultLocation sets the callback function. | |
| 672 | + | func (x *MountIface) OverrideGetDefaultLocation(cb func(Mount) *FileBase) { | |
| 673 | + | if cb == nil { | |
| 674 | + | x.xGetDefaultLocation = 0 | |
| 675 | + | } else { | |
| 676 | + | x.xGetDefaultLocation = purego.NewCallback(func(MountVarp uintptr) uintptr { | |
| 677 | + | ret := cb(&MountBase{Ptr: MountVarp}) | |
| 678 | + | if ret == nil { | |
| 679 | + | return 0 | |
| 680 | + | } | |
| 681 | + | return ret.GoPointer() | |
| 682 | + | }) | |
| 683 | + | } | |
| 684 | + | } | |
| 685 | + | ||
| 686 | + | // GetGetDefaultLocation gets the callback function. | |
| 687 | + | func (x *MountIface) GetGetDefaultLocation() func(Mount) *FileBase { | |
| 688 | + | if x.xGetDefaultLocation == 0 { | |
| 689 | + | return nil | |
| 690 | + | } | |
| 691 | + | var rawCallback func(MountVarp uintptr) uintptr | |
| 692 | + | purego.RegisterFunc(&rawCallback, x.xGetDefaultLocation) | |
| 693 | + | return func(MountVar Mount) *FileBase { | |
| 694 | + | rawRet := rawCallback(MountVar.GoPointer()) | |
| 695 | + | if rawRet == 0 { | |
| 696 | + | return nil | |
| 697 | + | } | |
| 698 | + | ret := &FileBase{} | |
| 699 | + | ret.Ptr = rawRet | |
| 700 | + | return ret | |
| 701 | + | } | |
| 702 | + | } | |
| 703 | + | ||
| 704 | + | // OverrideGetSortKey sets the callback function. | |
| 705 | + | func (x *MountIface) OverrideGetSortKey(cb func(Mount) string) { | |
| 706 | + | if cb == nil { | |
| 707 | + | x.xGetSortKey = 0 | |
| 708 | + | } else { | |
| 709 | + | x.xGetSortKey = purego.NewCallback(func(MountVarp uintptr) string { | |
| 710 | + | return cb(&MountBase{Ptr: MountVarp}) | |
| 711 | + | }) | |
| 712 | + | } | |
| 713 | + | } | |
| 714 | + | ||
| 715 | + | // GetGetSortKey gets the callback function. | |
| 716 | + | func (x *MountIface) GetGetSortKey() func(Mount) string { | |
| 717 | + | if x.xGetSortKey == 0 { | |
| 718 | + | return nil | |
| 719 | + | } | |
| 720 | + | var rawCallback func(MountVarp uintptr) string | |
| 721 | + | purego.RegisterFunc(&rawCallback, x.xGetSortKey) | |
| 722 | + | return func(MountVar Mount) string { | |
| 723 | + | return rawCallback(MountVar.GoPointer()) | |
| 724 | + | } | |
| 725 | + | } | |
| 726 | + | ||
| 727 | + | // OverrideGetSymbolicIcon sets the callback function. | |
| 728 | + | func (x *MountIface) OverrideGetSymbolicIcon(cb func(Mount) *IconBase) { | |
| 729 | + | if cb == nil { | |
| 730 | + | x.xGetSymbolicIcon = 0 | |
| 731 | + | } else { | |
| 732 | + | x.xGetSymbolicIcon = purego.NewCallback(func(MountVarp uintptr) uintptr { | |
| 733 | + | ret := cb(&MountBase{Ptr: MountVarp}) | |
| 734 | + | if ret == nil { | |
| 735 | + | return 0 | |
| 736 | + | } | |
| 737 | + | return ret.GoPointer() | |
| 738 | + | }) | |
| 739 | + | } | |
| 740 | + | } | |
| 741 | + | ||
| 742 | + | // GetGetSymbolicIcon gets the callback function. | |
| 743 | + | func (x *MountIface) GetGetSymbolicIcon() func(Mount) *IconBase { | |
| 744 | + | if x.xGetSymbolicIcon == 0 { | |
| 745 | + | return nil | |
| 746 | + | } | |
| 747 | + | var rawCallback func(MountVarp uintptr) uintptr | |
| 748 | + | purego.RegisterFunc(&rawCallback, x.xGetSymbolicIcon) | |
| 749 | + | return func(MountVar Mount) *IconBase { | |
| 750 | + | rawRet := rawCallback(MountVar.GoPointer()) | |
| 751 | + | if rawRet == 0 { | |
| 752 | + | return nil | |
| 753 | + | } | |
| 754 | + | ret := &IconBase{} | |
| 755 | + | ret.Ptr = rawRet | |
| 756 | + | return ret | |
| 757 | + | } | |
| 758 | + | } | |
| 759 | + | ||
| 25 | 760 | // The #GMount interface represents user-visible mounts. Note, when | |
| 26 | 761 | // porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume. | |
| 27 | 762 | // | |
| @@ -47,9 +782,9 @@ type Mount interface { | |||
| 47 | 782 | CanEject() bool | |
| 48 | 783 | CanUnmount() bool | |
| 49 | 784 | Eject(FlagsVar MountUnmountFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 50 | - | EjectFinish(ResultVar AsyncResult) bool | |
| 785 | + | EjectFinish(ResultVar AsyncResult) (bool, error) | |
| 51 | 786 | EjectWithOperation(FlagsVar MountUnmountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 52 | - | EjectWithOperationFinish(ResultVar AsyncResult) bool | |
| 787 | + | EjectWithOperationFinish(ResultVar AsyncResult) (bool, error) | |
| 53 | 788 | GetDefaultLocation() *FileBase | |
| 54 | 789 | GetDrive() *DriveBase | |
| 55 | 790 | GetIcon() *IconBase | |
| @@ -60,16 +795,16 @@ type Mount interface { | |||
| 60 | 795 | GetUuid() string | |
| 61 | 796 | GetVolume() *VolumeBase | |
| 62 | 797 | GuessContentType(ForceRescanVar bool, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 63 | - | GuessContentTypeFinish(ResultVar AsyncResult) []string | |
| 64 | - | GuessContentTypeSync(ForceRescanVar bool, CancellableVar *Cancellable) []string | |
| 798 | + | GuessContentTypeFinish(ResultVar AsyncResult) ([]string, error) | |
| 799 | + | GuessContentTypeSync(ForceRescanVar bool, CancellableVar *Cancellable) ([]string, error) | |
| 65 | 800 | IsShadowed() bool | |
| 66 | 801 | Remount(FlagsVar MountMountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 67 | - | RemountFinish(ResultVar AsyncResult) bool | |
| 802 | + | RemountFinish(ResultVar AsyncResult) (bool, error) | |
| 68 | 803 | Shadow() | |
| 69 | 804 | Unmount(FlagsVar MountUnmountFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 70 | - | UnmountFinish(ResultVar AsyncResult) bool | |
| 805 | + | UnmountFinish(ResultVar AsyncResult) (bool, error) | |
| 71 | 806 | UnmountWithOperation(FlagsVar MountUnmountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 72 | - | UnmountWithOperationFinish(ResultVar AsyncResult) bool | |
| 807 | + | UnmountWithOperationFinish(ResultVar AsyncResult) (bool, error) | |
| 73 | 808 | Unshadow() | |
| 74 | 809 | } | |
| 75 | 810 | ||
M v4/gio/gmountoperation.go +376 -1
| @@ -15,13 +15,388 @@ import ( | |||
| 15 | 15 | type MountOperationClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xAskPassword uintptr | |
| 21 | + | ||
| 22 | + | xAskQuestion uintptr | |
| 23 | + | ||
| 24 | + | xReply uintptr | |
| 25 | + | ||
| 26 | + | xAborted uintptr | |
| 27 | + | ||
| 28 | + | xShowProcesses uintptr | |
| 29 | + | ||
| 30 | + | xShowUnmountProgress uintptr | |
| 31 | + | ||
| 32 | + | xGReserved1 uintptr | |
| 33 | + | ||
| 34 | + | xGReserved2 uintptr | |
| 35 | + | ||
| 36 | + | xGReserved3 uintptr | |
| 37 | + | ||
| 38 | + | xGReserved4 uintptr | |
| 39 | + | ||
| 40 | + | xGReserved5 uintptr | |
| 41 | + | ||
| 42 | + | xGReserved6 uintptr | |
| 43 | + | ||
| 44 | + | xGReserved7 uintptr | |
| 45 | + | ||
| 46 | + | xGReserved8 uintptr | |
| 47 | + | ||
| 48 | + | xGReserved9 uintptr | |
| 19 | 49 | } | |
| 20 | 50 | ||
| 21 | 51 | func (x *MountOperationClass) GoPointer() uintptr { | |
| 22 | 52 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 53 | } | |
| 24 | 54 | ||
| 55 | + | // OverrideAskPassword sets the callback function. | |
| 56 | + | func (x *MountOperationClass) OverrideAskPassword(cb func(*MountOperation, string, string, string, AskPasswordFlags)) { | |
| 57 | + | if cb == nil { | |
| 58 | + | x.xAskPassword = 0 | |
| 59 | + | } else { | |
| 60 | + | x.xAskPassword = purego.NewCallback(func(OpVarp uintptr, MessageVarp string, DefaultUserVarp string, DefaultDomainVarp string, FlagsVarp AskPasswordFlags) { | |
| 61 | + | cb(MountOperationNewFromInternalPtr(OpVarp), MessageVarp, DefaultUserVarp, DefaultDomainVarp, FlagsVarp) | |
| 62 | + | }) | |
| 63 | + | } | |
| 64 | + | } | |
| 65 | + | ||
| 66 | + | // GetAskPassword gets the callback function. | |
| 67 | + | func (x *MountOperationClass) GetAskPassword() func(*MountOperation, string, string, string, AskPasswordFlags) { | |
| 68 | + | if x.xAskPassword == 0 { | |
| 69 | + | return nil | |
| 70 | + | } | |
| 71 | + | var rawCallback func(OpVarp uintptr, MessageVarp string, DefaultUserVarp string, DefaultDomainVarp string, FlagsVarp AskPasswordFlags) | |
| 72 | + | purego.RegisterFunc(&rawCallback, x.xAskPassword) | |
| 73 | + | return func(OpVar *MountOperation, MessageVar string, DefaultUserVar string, DefaultDomainVar string, FlagsVar AskPasswordFlags) { | |
| 74 | + | rawCallback(OpVar.GoPointer(), MessageVar, DefaultUserVar, DefaultDomainVar, FlagsVar) | |
| 75 | + | } | |
| 76 | + | } | |
| 77 | + | ||
| 78 | + | // OverrideAskQuestion sets the callback function. | |
| 79 | + | func (x *MountOperationClass) OverrideAskQuestion(cb func(*MountOperation, string, []string)) { | |
| 80 | + | if cb == nil { | |
| 81 | + | x.xAskQuestion = 0 | |
| 82 | + | } else { | |
| 83 | + | x.xAskQuestion = purego.NewCallback(func(OpVarp uintptr, MessageVarp string, ChoicesVarp []string) { | |
| 84 | + | cb(MountOperationNewFromInternalPtr(OpVarp), MessageVarp, ChoicesVarp) | |
| 85 | + | }) | |
| 86 | + | } | |
| 87 | + | } | |
| 88 | + | ||
| 89 | + | // GetAskQuestion gets the callback function. | |
| 90 | + | func (x *MountOperationClass) GetAskQuestion() func(*MountOperation, string, []string) { | |
| 91 | + | if x.xAskQuestion == 0 { | |
| 92 | + | return nil | |
| 93 | + | } | |
| 94 | + | var rawCallback func(OpVarp uintptr, MessageVarp string, ChoicesVarp []string) | |
| 95 | + | purego.RegisterFunc(&rawCallback, x.xAskQuestion) | |
| 96 | + | return func(OpVar *MountOperation, MessageVar string, ChoicesVar []string) { | |
| 97 | + | rawCallback(OpVar.GoPointer(), MessageVar, ChoicesVar) | |
| 98 | + | } | |
| 99 | + | } | |
| 100 | + | ||
| 101 | + | // OverrideReply sets the callback function. | |
| 102 | + | func (x *MountOperationClass) OverrideReply(cb func(*MountOperation, MountOperationResult)) { | |
| 103 | + | if cb == nil { | |
| 104 | + | x.xReply = 0 | |
| 105 | + | } else { | |
| 106 | + | x.xReply = purego.NewCallback(func(OpVarp uintptr, ResultVarp MountOperationResult) { | |
| 107 | + | cb(MountOperationNewFromInternalPtr(OpVarp), ResultVarp) | |
| 108 | + | }) | |
| 109 | + | } | |
| 110 | + | } | |
| 111 | + | ||
| 112 | + | // GetReply gets the callback function. | |
| 113 | + | func (x *MountOperationClass) GetReply() func(*MountOperation, MountOperationResult) { | |
| 114 | + | if x.xReply == 0 { | |
| 115 | + | return nil | |
| 116 | + | } | |
| 117 | + | var rawCallback func(OpVarp uintptr, ResultVarp MountOperationResult) | |
| 118 | + | purego.RegisterFunc(&rawCallback, x.xReply) | |
| 119 | + | return func(OpVar *MountOperation, ResultVar MountOperationResult) { | |
| 120 | + | rawCallback(OpVar.GoPointer(), ResultVar) | |
| 121 | + | } | |
| 122 | + | } | |
| 123 | + | ||
| 124 | + | // OverrideAborted sets the callback function. | |
| 125 | + | func (x *MountOperationClass) OverrideAborted(cb func(*MountOperation)) { | |
| 126 | + | if cb == nil { | |
| 127 | + | x.xAborted = 0 | |
| 128 | + | } else { | |
| 129 | + | x.xAborted = purego.NewCallback(func(OpVarp uintptr) { | |
| 130 | + | cb(MountOperationNewFromInternalPtr(OpVarp)) | |
| 131 | + | }) | |
| 132 | + | } | |
| 133 | + | } | |
| 134 | + | ||
| 135 | + | // GetAborted gets the callback function. | |
| 136 | + | func (x *MountOperationClass) GetAborted() func(*MountOperation) { | |
| 137 | + | if x.xAborted == 0 { | |
| 138 | + | return nil | |
| 139 | + | } | |
| 140 | + | var rawCallback func(OpVarp uintptr) | |
| 141 | + | purego.RegisterFunc(&rawCallback, x.xAborted) | |
| 142 | + | return func(OpVar *MountOperation) { | |
| 143 | + | rawCallback(OpVar.GoPointer()) | |
| 144 | + | } | |
| 145 | + | } | |
| 146 | + | ||
| 147 | + | // OverrideShowProcesses sets the callback function. | |
| 148 | + | func (x *MountOperationClass) OverrideShowProcesses(cb func(*MountOperation, string, []glib.Pid, []string)) { | |
| 149 | + | if cb == nil { | |
| 150 | + | x.xShowProcesses = 0 | |
| 151 | + | } else { | |
| 152 | + | x.xShowProcesses = purego.NewCallback(func(OpVarp uintptr, MessageVarp string, ProcessesVarp []glib.Pid, ChoicesVarp []string) { | |
| 153 | + | cb(MountOperationNewFromInternalPtr(OpVarp), MessageVarp, ProcessesVarp, ChoicesVarp) | |
| 154 | + | }) | |
| 155 | + | } | |
| 156 | + | } | |
| 157 | + | ||
| 158 | + | // GetShowProcesses gets the callback function. | |
| 159 | + | func (x *MountOperationClass) GetShowProcesses() func(*MountOperation, string, []glib.Pid, []string) { | |
| 160 | + | if x.xShowProcesses == 0 { | |
| 161 | + | return nil | |
| 162 | + | } | |
| 163 | + | var rawCallback func(OpVarp uintptr, MessageVarp string, ProcessesVarp []glib.Pid, ChoicesVarp []string) | |
| 164 | + | purego.RegisterFunc(&rawCallback, x.xShowProcesses) | |
| 165 | + | return func(OpVar *MountOperation, MessageVar string, ProcessesVar []glib.Pid, ChoicesVar []string) { | |
| 166 | + | rawCallback(OpVar.GoPointer(), MessageVar, ProcessesVar, ChoicesVar) | |
| 167 | + | } | |
| 168 | + | } | |
| 169 | + | ||
| 170 | + | // OverrideShowUnmountProgress sets the callback function. | |
| 171 | + | func (x *MountOperationClass) OverrideShowUnmountProgress(cb func(*MountOperation, string, int64, int64)) { | |
| 172 | + | if cb == nil { | |
| 173 | + | x.xShowUnmountProgress = 0 | |
| 174 | + | } else { | |
| 175 | + | x.xShowUnmountProgress = purego.NewCallback(func(OpVarp uintptr, MessageVarp string, TimeLeftVarp int64, BytesLeftVarp int64) { | |
| 176 | + | cb(MountOperationNewFromInternalPtr(OpVarp), MessageVarp, TimeLeftVarp, BytesLeftVarp) | |
| 177 | + | }) | |
| 178 | + | } | |
| 179 | + | } | |
| 180 | + | ||
| 181 | + | // GetShowUnmountProgress gets the callback function. | |
| 182 | + | func (x *MountOperationClass) GetShowUnmountProgress() func(*MountOperation, string, int64, int64) { | |
| 183 | + | if x.xShowUnmountProgress == 0 { | |
| 184 | + | return nil | |
| 185 | + | } | |
| 186 | + | var rawCallback func(OpVarp uintptr, MessageVarp string, TimeLeftVarp int64, BytesLeftVarp int64) | |
| 187 | + | purego.RegisterFunc(&rawCallback, x.xShowUnmountProgress) | |
| 188 | + | return func(OpVar *MountOperation, MessageVar string, TimeLeftVar int64, BytesLeftVar int64) { | |
| 189 | + | rawCallback(OpVar.GoPointer(), MessageVar, TimeLeftVar, BytesLeftVar) | |
| 190 | + | } | |
| 191 | + | } | |
| 192 | + | ||
| 193 | + | // OverrideGReserved1 sets the callback function. | |
| 194 | + | func (x *MountOperationClass) OverrideGReserved1(cb func()) { | |
| 195 | + | if cb == nil { | |
| 196 | + | x.xGReserved1 = 0 | |
| 197 | + | } else { | |
| 198 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 199 | + | cb() | |
| 200 | + | }) | |
| 201 | + | } | |
| 202 | + | } | |
| 203 | + | ||
| 204 | + | // GetGReserved1 gets the callback function. | |
| 205 | + | func (x *MountOperationClass) GetGReserved1() func() { | |
| 206 | + | if x.xGReserved1 == 0 { | |
| 207 | + | return nil | |
| 208 | + | } | |
| 209 | + | var rawCallback func() | |
| 210 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 211 | + | return func() { | |
| 212 | + | rawCallback() | |
| 213 | + | } | |
| 214 | + | } | |
| 215 | + | ||
| 216 | + | // OverrideGReserved2 sets the callback function. | |
| 217 | + | func (x *MountOperationClass) OverrideGReserved2(cb func()) { | |
| 218 | + | if cb == nil { | |
| 219 | + | x.xGReserved2 = 0 | |
| 220 | + | } else { | |
| 221 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 222 | + | cb() | |
| 223 | + | }) | |
| 224 | + | } | |
| 225 | + | } | |
| 226 | + | ||
| 227 | + | // GetGReserved2 gets the callback function. | |
| 228 | + | func (x *MountOperationClass) GetGReserved2() func() { | |
| 229 | + | if x.xGReserved2 == 0 { | |
| 230 | + | return nil | |
| 231 | + | } | |
| 232 | + | var rawCallback func() | |
| 233 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 234 | + | return func() { | |
| 235 | + | rawCallback() | |
| 236 | + | } | |
| 237 | + | } | |
| 238 | + | ||
| 239 | + | // OverrideGReserved3 sets the callback function. | |
| 240 | + | func (x *MountOperationClass) OverrideGReserved3(cb func()) { | |
| 241 | + | if cb == nil { | |
| 242 | + | x.xGReserved3 = 0 | |
| 243 | + | } else { | |
| 244 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 245 | + | cb() | |
| 246 | + | }) | |
| 247 | + | } | |
| 248 | + | } | |
| 249 | + | ||
| 250 | + | // GetGReserved3 gets the callback function. | |
| 251 | + | func (x *MountOperationClass) GetGReserved3() func() { | |
| 252 | + | if x.xGReserved3 == 0 { | |
| 253 | + | return nil | |
| 254 | + | } | |
| 255 | + | var rawCallback func() | |
| 256 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 257 | + | return func() { | |
| 258 | + | rawCallback() | |
| 259 | + | } | |
| 260 | + | } | |
| 261 | + | ||
| 262 | + | // OverrideGReserved4 sets the callback function. | |
| 263 | + | func (x *MountOperationClass) OverrideGReserved4(cb func()) { | |
| 264 | + | if cb == nil { | |
| 265 | + | x.xGReserved4 = 0 | |
| 266 | + | } else { | |
| 267 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 268 | + | cb() | |
| 269 | + | }) | |
| 270 | + | } | |
| 271 | + | } | |
| 272 | + | ||
| 273 | + | // GetGReserved4 gets the callback function. | |
| 274 | + | func (x *MountOperationClass) GetGReserved4() func() { | |
| 275 | + | if x.xGReserved4 == 0 { | |
| 276 | + | return nil | |
| 277 | + | } | |
| 278 | + | var rawCallback func() | |
| 279 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 280 | + | return func() { | |
| 281 | + | rawCallback() | |
| 282 | + | } | |
| 283 | + | } | |
| 284 | + | ||
| 285 | + | // OverrideGReserved5 sets the callback function. | |
| 286 | + | func (x *MountOperationClass) OverrideGReserved5(cb func()) { | |
| 287 | + | if cb == nil { | |
| 288 | + | x.xGReserved5 = 0 | |
| 289 | + | } else { | |
| 290 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 291 | + | cb() | |
| 292 | + | }) | |
| 293 | + | } | |
| 294 | + | } | |
| 295 | + | ||
| 296 | + | // GetGReserved5 gets the callback function. | |
| 297 | + | func (x *MountOperationClass) GetGReserved5() func() { | |
| 298 | + | if x.xGReserved5 == 0 { | |
| 299 | + | return nil | |
| 300 | + | } | |
| 301 | + | var rawCallback func() | |
| 302 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 303 | + | return func() { | |
| 304 | + | rawCallback() | |
| 305 | + | } | |
| 306 | + | } | |
| 307 | + | ||
| 308 | + | // OverrideGReserved6 sets the callback function. | |
| 309 | + | func (x *MountOperationClass) OverrideGReserved6(cb func()) { | |
| 310 | + | if cb == nil { | |
| 311 | + | x.xGReserved6 = 0 | |
| 312 | + | } else { | |
| 313 | + | x.xGReserved6 = purego.NewCallback(func() { | |
| 314 | + | cb() | |
| 315 | + | }) | |
| 316 | + | } | |
| 317 | + | } | |
| 318 | + | ||
| 319 | + | // GetGReserved6 gets the callback function. | |
| 320 | + | func (x *MountOperationClass) GetGReserved6() func() { | |
| 321 | + | if x.xGReserved6 == 0 { | |
| 322 | + | return nil | |
| 323 | + | } | |
| 324 | + | var rawCallback func() | |
| 325 | + | purego.RegisterFunc(&rawCallback, x.xGReserved6) | |
| 326 | + | return func() { | |
| 327 | + | rawCallback() | |
| 328 | + | } | |
| 329 | + | } | |
| 330 | + | ||
| 331 | + | // OverrideGReserved7 sets the callback function. | |
| 332 | + | func (x *MountOperationClass) OverrideGReserved7(cb func()) { | |
| 333 | + | if cb == nil { | |
| 334 | + | x.xGReserved7 = 0 | |
| 335 | + | } else { | |
| 336 | + | x.xGReserved7 = purego.NewCallback(func() { | |
| 337 | + | cb() | |
| 338 | + | }) | |
| 339 | + | } | |
| 340 | + | } | |
| 341 | + | ||
| 342 | + | // GetGReserved7 gets the callback function. | |
| 343 | + | func (x *MountOperationClass) GetGReserved7() func() { | |
| 344 | + | if x.xGReserved7 == 0 { | |
| 345 | + | return nil | |
| 346 | + | } | |
| 347 | + | var rawCallback func() | |
| 348 | + | purego.RegisterFunc(&rawCallback, x.xGReserved7) | |
| 349 | + | return func() { | |
| 350 | + | rawCallback() | |
| 351 | + | } | |
| 352 | + | } | |
| 353 | + | ||
| 354 | + | // OverrideGReserved8 sets the callback function. | |
| 355 | + | func (x *MountOperationClass) OverrideGReserved8(cb func()) { | |
| 356 | + | if cb == nil { | |
| 357 | + | x.xGReserved8 = 0 | |
| 358 | + | } else { | |
| 359 | + | x.xGReserved8 = purego.NewCallback(func() { | |
| 360 | + | cb() | |
| 361 | + | }) | |
| 362 | + | } | |
| 363 | + | } | |
| 364 | + | ||
| 365 | + | // GetGReserved8 gets the callback function. | |
| 366 | + | func (x *MountOperationClass) GetGReserved8() func() { | |
| 367 | + | if x.xGReserved8 == 0 { | |
| 368 | + | return nil | |
| 369 | + | } | |
| 370 | + | var rawCallback func() | |
| 371 | + | purego.RegisterFunc(&rawCallback, x.xGReserved8) | |
| 372 | + | return func() { | |
| 373 | + | rawCallback() | |
| 374 | + | } | |
| 375 | + | } | |
| 376 | + | ||
| 377 | + | // OverrideGReserved9 sets the callback function. | |
| 378 | + | func (x *MountOperationClass) OverrideGReserved9(cb func()) { | |
| 379 | + | if cb == nil { | |
| 380 | + | x.xGReserved9 = 0 | |
| 381 | + | } else { | |
| 382 | + | x.xGReserved9 = purego.NewCallback(func() { | |
| 383 | + | cb() | |
| 384 | + | }) | |
| 385 | + | } | |
| 386 | + | } | |
| 387 | + | ||
| 388 | + | // GetGReserved9 gets the callback function. | |
| 389 | + | func (x *MountOperationClass) GetGReserved9() func() { | |
| 390 | + | if x.xGReserved9 == 0 { | |
| 391 | + | return nil | |
| 392 | + | } | |
| 393 | + | var rawCallback func() | |
| 394 | + | purego.RegisterFunc(&rawCallback, x.xGReserved9) | |
| 395 | + | return func() { | |
| 396 | + | rawCallback() | |
| 397 | + | } | |
| 398 | + | } | |
| 399 | + | ||
| 25 | 400 | type MountOperationPrivate struct { | |
| 26 | 401 | _ structs.HostLayout | |
| 27 | 402 | } | |
M v4/gio/gnativesocketaddress.go +1 -1
| @@ -13,7 +13,7 @@ import ( | |||
| 13 | 13 | type NativeSocketAddressClass struct { | |
| 14 | 14 | _ structs.HostLayout | |
| 15 | 15 | ||
| 16 | - | ParentClass uintptr | |
| 16 | + | ParentClass SocketAddressClass | |
| 17 | 17 | } | |
| 18 | 18 | ||
| 19 | 19 | func (x *NativeSocketAddressClass) GoPointer() uintptr { | |
M v4/gio/gnativevolumemonitor.go +37 -1
| @@ -5,19 +5,55 @@ import ( | |||
| 5 | 5 | "structs" | |
| 6 | 6 | "unsafe" | |
| 7 | 7 | ||
| 8 | + | "github.com/jwijenbergh/purego" | |
| 8 | 9 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 9 | 10 | ) | |
| 10 | 11 | ||
| 11 | 12 | type NativeVolumeMonitorClass struct { | |
| 12 | 13 | _ structs.HostLayout | |
| 13 | 14 | ||
| 14 | - | ParentClass uintptr | |
| 15 | + | ParentClass VolumeMonitorClass | |
| 16 | + | ||
| 17 | + | xGetMountForMountPath uintptr | |
| 15 | 18 | } | |
| 16 | 19 | ||
| 17 | 20 | func (x *NativeVolumeMonitorClass) GoPointer() uintptr { | |
| 18 | 21 | return uintptr(unsafe.Pointer(x)) | |
| 19 | 22 | } | |
| 20 | 23 | ||
| 24 | + | // OverrideGetMountForMountPath sets the callback function. | |
| 25 | + | func (x *NativeVolumeMonitorClass) OverrideGetMountForMountPath(cb func(string, *Cancellable) *MountBase) { | |
| 26 | + | if cb == nil { | |
| 27 | + | x.xGetMountForMountPath = 0 | |
| 28 | + | } else { | |
| 29 | + | x.xGetMountForMountPath = purego.NewCallback(func(MountPathVarp string, CancellableVarp uintptr) uintptr { | |
| 30 | + | ret := cb(MountPathVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 31 | + | if ret == nil { | |
| 32 | + | return 0 | |
| 33 | + | } | |
| 34 | + | return ret.GoPointer() | |
| 35 | + | }) | |
| 36 | + | } | |
| 37 | + | } | |
| 38 | + | ||
| 39 | + | // GetGetMountForMountPath gets the callback function. | |
| 40 | + | func (x *NativeVolumeMonitorClass) GetGetMountForMountPath() func(string, *Cancellable) *MountBase { | |
| 41 | + | if x.xGetMountForMountPath == 0 { | |
| 42 | + | return nil | |
| 43 | + | } | |
| 44 | + | var rawCallback func(MountPathVarp string, CancellableVarp uintptr) uintptr | |
| 45 | + | purego.RegisterFunc(&rawCallback, x.xGetMountForMountPath) | |
| 46 | + | return func(MountPathVar string, CancellableVar *Cancellable) *MountBase { | |
| 47 | + | rawRet := rawCallback(MountPathVar, CancellableVar.GoPointer()) | |
| 48 | + | if rawRet == 0 { | |
| 49 | + | return nil | |
| 50 | + | } | |
| 51 | + | ret := &MountBase{} | |
| 52 | + | ret.Ptr = rawRet | |
| 53 | + | return ret | |
| 54 | + | } | |
| 55 | + | } | |
| 56 | + | ||
| 21 | 57 | const ( | |
| 22 | 58 | NATIVE_VOLUME_MONITOR_EXTENSION_POINT_NAME string = "gio-native-volume-monitor" | |
| 23 | 59 | ) | |
M v4/gio/gnetworkaddress.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type NetworkAddressClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *NetworkAddressClass) GoPointer() uintptr { | |
M v4/gio/gnetworkmonitor.go +102 -2
| @@ -17,12 +17,112 @@ type NetworkMonitorInterface struct { | |||
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | 19 | GIface uintptr | |
| 20 | + | ||
| 21 | + | xNetworkChanged uintptr | |
| 22 | + | ||
| 23 | + | xCanReach uintptr | |
| 24 | + | ||
| 25 | + | xCanReachAsync uintptr | |
| 26 | + | ||
| 27 | + | xCanReachFinish uintptr | |
| 20 | 28 | } | |
| 21 | 29 | ||
| 22 | 30 | func (x *NetworkMonitorInterface) GoPointer() uintptr { | |
| 23 | 31 | return uintptr(unsafe.Pointer(x)) | |
| 24 | 32 | } | |
| 25 | 33 | ||
| 34 | + | // OverrideNetworkChanged sets the callback function. | |
| 35 | + | func (x *NetworkMonitorInterface) OverrideNetworkChanged(cb func(NetworkMonitor, bool)) { | |
| 36 | + | if cb == nil { | |
| 37 | + | x.xNetworkChanged = 0 | |
| 38 | + | } else { | |
| 39 | + | x.xNetworkChanged = purego.NewCallback(func(MonitorVarp uintptr, NetworkAvailableVarp bool) { | |
| 40 | + | cb(&NetworkMonitorBase{Ptr: MonitorVarp}, NetworkAvailableVarp) | |
| 41 | + | }) | |
| 42 | + | } | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | // GetNetworkChanged gets the callback function. | |
| 46 | + | func (x *NetworkMonitorInterface) GetNetworkChanged() func(NetworkMonitor, bool) { | |
| 47 | + | if x.xNetworkChanged == 0 { | |
| 48 | + | return nil | |
| 49 | + | } | |
| 50 | + | var rawCallback func(MonitorVarp uintptr, NetworkAvailableVarp bool) | |
| 51 | + | purego.RegisterFunc(&rawCallback, x.xNetworkChanged) | |
| 52 | + | return func(MonitorVar NetworkMonitor, NetworkAvailableVar bool) { | |
| 53 | + | rawCallback(MonitorVar.GoPointer(), NetworkAvailableVar) | |
| 54 | + | } | |
| 55 | + | } | |
| 56 | + | ||
| 57 | + | // OverrideCanReach sets the callback function. | |
| 58 | + | func (x *NetworkMonitorInterface) OverrideCanReach(cb func(NetworkMonitor, SocketConnectable, *Cancellable) bool) { | |
| 59 | + | if cb == nil { | |
| 60 | + | x.xCanReach = 0 | |
| 61 | + | } else { | |
| 62 | + | x.xCanReach = purego.NewCallback(func(MonitorVarp uintptr, ConnectableVarp uintptr, CancellableVarp uintptr) bool { | |
| 63 | + | return cb(&NetworkMonitorBase{Ptr: MonitorVarp}, &SocketConnectableBase{Ptr: ConnectableVarp}, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 64 | + | }) | |
| 65 | + | } | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | // GetCanReach gets the callback function. | |
| 69 | + | func (x *NetworkMonitorInterface) GetCanReach() func(NetworkMonitor, SocketConnectable, *Cancellable) bool { | |
| 70 | + | if x.xCanReach == 0 { | |
| 71 | + | return nil | |
| 72 | + | } | |
| 73 | + | var rawCallback func(MonitorVarp uintptr, ConnectableVarp uintptr, CancellableVarp uintptr) bool | |
| 74 | + | purego.RegisterFunc(&rawCallback, x.xCanReach) | |
| 75 | + | return func(MonitorVar NetworkMonitor, ConnectableVar SocketConnectable, CancellableVar *Cancellable) bool { | |
| 76 | + | return rawCallback(MonitorVar.GoPointer(), ConnectableVar.GoPointer(), CancellableVar.GoPointer()) | |
| 77 | + | } | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | // OverrideCanReachAsync sets the callback function. | |
| 81 | + | func (x *NetworkMonitorInterface) OverrideCanReachAsync(cb func(NetworkMonitor, SocketConnectable, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 82 | + | if cb == nil { | |
| 83 | + | x.xCanReachAsync = 0 | |
| 84 | + | } else { | |
| 85 | + | x.xCanReachAsync = purego.NewCallback(func(MonitorVarp uintptr, ConnectableVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 86 | + | cb(&NetworkMonitorBase{Ptr: MonitorVarp}, &SocketConnectableBase{Ptr: ConnectableVarp}, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 87 | + | }) | |
| 88 | + | } | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | // GetCanReachAsync gets the callback function. | |
| 92 | + | func (x *NetworkMonitorInterface) GetCanReachAsync() func(NetworkMonitor, SocketConnectable, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 93 | + | if x.xCanReachAsync == 0 { | |
| 94 | + | return nil | |
| 95 | + | } | |
| 96 | + | var rawCallback func(MonitorVarp uintptr, ConnectableVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 97 | + | purego.RegisterFunc(&rawCallback, x.xCanReachAsync) | |
| 98 | + | return func(MonitorVar NetworkMonitor, ConnectableVar SocketConnectable, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 99 | + | rawCallback(MonitorVar.GoPointer(), ConnectableVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 100 | + | } | |
| 101 | + | } | |
| 102 | + | ||
| 103 | + | // OverrideCanReachFinish sets the callback function. | |
| 104 | + | func (x *NetworkMonitorInterface) OverrideCanReachFinish(cb func(NetworkMonitor, AsyncResult) bool) { | |
| 105 | + | if cb == nil { | |
| 106 | + | x.xCanReachFinish = 0 | |
| 107 | + | } else { | |
| 108 | + | x.xCanReachFinish = purego.NewCallback(func(MonitorVarp uintptr, ResultVarp uintptr) bool { | |
| 109 | + | return cb(&NetworkMonitorBase{Ptr: MonitorVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 110 | + | }) | |
| 111 | + | } | |
| 112 | + | } | |
| 113 | + | ||
| 114 | + | // GetCanReachFinish gets the callback function. | |
| 115 | + | func (x *NetworkMonitorInterface) GetCanReachFinish() func(NetworkMonitor, AsyncResult) bool { | |
| 116 | + | if x.xCanReachFinish == 0 { | |
| 117 | + | return nil | |
| 118 | + | } | |
| 119 | + | var rawCallback func(MonitorVarp uintptr, ResultVarp uintptr) bool | |
| 120 | + | purego.RegisterFunc(&rawCallback, x.xCanReachFinish) | |
| 121 | + | return func(MonitorVar NetworkMonitor, ResultVar AsyncResult) bool { | |
| 122 | + | return rawCallback(MonitorVar.GoPointer(), ResultVar.GoPointer()) | |
| 123 | + | } | |
| 124 | + | } | |
| 125 | + | ||
| 26 | 126 | // #GNetworkMonitor provides an easy-to-use cross-platform API | |
| 27 | 127 | // for monitoring network connectivity. On Linux, the available | |
| 28 | 128 | // implementations are based on the kernel's netlink interface and | |
| @@ -32,9 +132,9 @@ func (x *NetworkMonitorInterface) GoPointer() uintptr { | |||
| 32 | 132 | type NetworkMonitor interface { | |
| 33 | 133 | GoPointer() uintptr | |
| 34 | 134 | SetGoPointer(uintptr) | |
| 35 | - | CanReach(ConnectableVar SocketConnectable, CancellableVar *Cancellable) bool | |
| 135 | + | CanReach(ConnectableVar SocketConnectable, CancellableVar *Cancellable) (bool, error) | |
| 36 | 136 | CanReachAsync(ConnectableVar SocketConnectable, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 37 | - | CanReachFinish(ResultVar AsyncResult) bool | |
| 137 | + | CanReachFinish(ResultVar AsyncResult) (bool, error) | |
| 38 | 138 | GetConnectivity() NetworkConnectivity | |
| 39 | 139 | GetNetworkAvailable() bool | |
| 40 | 140 | GetNetworkMetered() bool | |
M v4/gio/gnetworkservice.go +1 -1
| @@ -14,7 +14,7 @@ import ( | |||
| 14 | 14 | type NetworkServiceClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass gobject.ObjectClass | |
| 18 | 18 | } | |
| 19 | 19 | ||
| 20 | 20 | func (x *NetworkServiceClass) GoPointer() uintptr { | |
M v4/gio/goutputstream.go +501 -1
| @@ -15,13 +15,513 @@ import ( | |||
| 15 | 15 | type OutputStreamClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xWriteFn uintptr | |
| 21 | + | ||
| 22 | + | xSplice uintptr | |
| 23 | + | ||
| 24 | + | xFlush uintptr | |
| 25 | + | ||
| 26 | + | xCloseFn uintptr | |
| 27 | + | ||
| 28 | + | xWriteAsync uintptr | |
| 29 | + | ||
| 30 | + | xWriteFinish uintptr | |
| 31 | + | ||
| 32 | + | xSpliceAsync uintptr | |
| 33 | + | ||
| 34 | + | xSpliceFinish uintptr | |
| 35 | + | ||
| 36 | + | xFlushAsync uintptr | |
| 37 | + | ||
| 38 | + | xFlushFinish uintptr | |
| 39 | + | ||
| 40 | + | xCloseAsync uintptr | |
| 41 | + | ||
| 42 | + | xCloseFinish uintptr | |
| 43 | + | ||
| 44 | + | xWritevFn uintptr | |
| 45 | + | ||
| 46 | + | xWritevAsync uintptr | |
| 47 | + | ||
| 48 | + | xWritevFinish uintptr | |
| 49 | + | ||
| 50 | + | xGReserved4 uintptr | |
| 51 | + | ||
| 52 | + | xGReserved5 uintptr | |
| 53 | + | ||
| 54 | + | xGReserved6 uintptr | |
| 55 | + | ||
| 56 | + | xGReserved7 uintptr | |
| 57 | + | ||
| 58 | + | xGReserved8 uintptr | |
| 19 | 59 | } | |
| 20 | 60 | ||
| 21 | 61 | func (x *OutputStreamClass) GoPointer() uintptr { | |
| 22 | 62 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 63 | } | |
| 24 | 64 | ||
| 65 | + | // OverrideWriteFn sets the callback function. | |
| 66 | + | func (x *OutputStreamClass) OverrideWriteFn(cb func(*OutputStream, []byte, uint, *Cancellable) int) { | |
| 67 | + | if cb == nil { | |
| 68 | + | x.xWriteFn = 0 | |
| 69 | + | } else { | |
| 70 | + | x.xWriteFn = purego.NewCallback(func(StreamVarp uintptr, BufferVarp []byte, CountVarp uint, CancellableVarp uintptr) int { | |
| 71 | + | return cb(OutputStreamNewFromInternalPtr(StreamVarp), BufferVarp, CountVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 72 | + | }) | |
| 73 | + | } | |
| 74 | + | } | |
| 75 | + | ||
| 76 | + | // GetWriteFn gets the callback function. | |
| 77 | + | func (x *OutputStreamClass) GetWriteFn() func(*OutputStream, []byte, uint, *Cancellable) int { | |
| 78 | + | if x.xWriteFn == 0 { | |
| 79 | + | return nil | |
| 80 | + | } | |
| 81 | + | var rawCallback func(StreamVarp uintptr, BufferVarp []byte, CountVarp uint, CancellableVarp uintptr) int | |
| 82 | + | purego.RegisterFunc(&rawCallback, x.xWriteFn) | |
| 83 | + | return func(StreamVar *OutputStream, BufferVar []byte, CountVar uint, CancellableVar *Cancellable) int { | |
| 84 | + | return rawCallback(StreamVar.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer()) | |
| 85 | + | } | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | // OverrideSplice sets the callback function. | |
| 89 | + | func (x *OutputStreamClass) OverrideSplice(cb func(*OutputStream, *InputStream, OutputStreamSpliceFlags, *Cancellable) int) { | |
| 90 | + | if cb == nil { | |
| 91 | + | x.xSplice = 0 | |
| 92 | + | } else { | |
| 93 | + | x.xSplice = purego.NewCallback(func(StreamVarp uintptr, SourceVarp uintptr, FlagsVarp OutputStreamSpliceFlags, CancellableVarp uintptr) int { | |
| 94 | + | return cb(OutputStreamNewFromInternalPtr(StreamVarp), InputStreamNewFromInternalPtr(SourceVarp), FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 95 | + | }) | |
| 96 | + | } | |
| 97 | + | } | |
| 98 | + | ||
| 99 | + | // GetSplice gets the callback function. | |
| 100 | + | func (x *OutputStreamClass) GetSplice() func(*OutputStream, *InputStream, OutputStreamSpliceFlags, *Cancellable) int { | |
| 101 | + | if x.xSplice == 0 { | |
| 102 | + | return nil | |
| 103 | + | } | |
| 104 | + | var rawCallback func(StreamVarp uintptr, SourceVarp uintptr, FlagsVarp OutputStreamSpliceFlags, CancellableVarp uintptr) int | |
| 105 | + | purego.RegisterFunc(&rawCallback, x.xSplice) | |
| 106 | + | return func(StreamVar *OutputStream, SourceVar *InputStream, FlagsVar OutputStreamSpliceFlags, CancellableVar *Cancellable) int { | |
| 107 | + | return rawCallback(StreamVar.GoPointer(), SourceVar.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 108 | + | } | |
| 109 | + | } | |
| 110 | + | ||
| 111 | + | // OverrideFlush sets the callback function. | |
| 112 | + | func (x *OutputStreamClass) OverrideFlush(cb func(*OutputStream, *Cancellable) bool) { | |
| 113 | + | if cb == nil { | |
| 114 | + | x.xFlush = 0 | |
| 115 | + | } else { | |
| 116 | + | x.xFlush = purego.NewCallback(func(StreamVarp uintptr, CancellableVarp uintptr) bool { | |
| 117 | + | return cb(OutputStreamNewFromInternalPtr(StreamVarp), CancellableNewFromInternalPtr(CancellableVarp)) | |
| 118 | + | }) | |
| 119 | + | } | |
| 120 | + | } | |
| 121 | + | ||
| 122 | + | // GetFlush gets the callback function. | |
| 123 | + | func (x *OutputStreamClass) GetFlush() func(*OutputStream, *Cancellable) bool { | |
| 124 | + | if x.xFlush == 0 { | |
| 125 | + | return nil | |
| 126 | + | } | |
| 127 | + | var rawCallback func(StreamVarp uintptr, CancellableVarp uintptr) bool | |
| 128 | + | purego.RegisterFunc(&rawCallback, x.xFlush) | |
| 129 | + | return func(StreamVar *OutputStream, CancellableVar *Cancellable) bool { | |
| 130 | + | return rawCallback(StreamVar.GoPointer(), CancellableVar.GoPointer()) | |
| 131 | + | } | |
| 132 | + | } | |
| 133 | + | ||
| 134 | + | // OverrideCloseFn sets the callback function. | |
| 135 | + | func (x *OutputStreamClass) OverrideCloseFn(cb func(*OutputStream, *Cancellable) bool) { | |
| 136 | + | if cb == nil { | |
| 137 | + | x.xCloseFn = 0 | |
| 138 | + | } else { | |
| 139 | + | x.xCloseFn = purego.NewCallback(func(StreamVarp uintptr, CancellableVarp uintptr) bool { | |
| 140 | + | return cb(OutputStreamNewFromInternalPtr(StreamVarp), CancellableNewFromInternalPtr(CancellableVarp)) | |
| 141 | + | }) | |
| 142 | + | } | |
| 143 | + | } | |
| 144 | + | ||
| 145 | + | // GetCloseFn gets the callback function. | |
| 146 | + | func (x *OutputStreamClass) GetCloseFn() func(*OutputStream, *Cancellable) bool { | |
| 147 | + | if x.xCloseFn == 0 { | |
| 148 | + | return nil | |
| 149 | + | } | |
| 150 | + | var rawCallback func(StreamVarp uintptr, CancellableVarp uintptr) bool | |
| 151 | + | purego.RegisterFunc(&rawCallback, x.xCloseFn) | |
| 152 | + | return func(StreamVar *OutputStream, CancellableVar *Cancellable) bool { | |
| 153 | + | return rawCallback(StreamVar.GoPointer(), CancellableVar.GoPointer()) | |
| 154 | + | } | |
| 155 | + | } | |
| 156 | + | ||
| 157 | + | // OverrideWriteAsync sets the callback function. | |
| 158 | + | func (x *OutputStreamClass) OverrideWriteAsync(cb func(*OutputStream, []byte, uint, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 159 | + | if cb == nil { | |
| 160 | + | x.xWriteAsync = 0 | |
| 161 | + | } else { | |
| 162 | + | x.xWriteAsync = purego.NewCallback(func(StreamVarp uintptr, BufferVarp []byte, CountVarp uint, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 163 | + | cb(OutputStreamNewFromInternalPtr(StreamVarp), BufferVarp, CountVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 164 | + | }) | |
| 165 | + | } | |
| 166 | + | } | |
| 167 | + | ||
| 168 | + | // GetWriteAsync gets the callback function. | |
| 169 | + | func (x *OutputStreamClass) GetWriteAsync() func(*OutputStream, []byte, uint, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 170 | + | if x.xWriteAsync == 0 { | |
| 171 | + | return nil | |
| 172 | + | } | |
| 173 | + | var rawCallback func(StreamVarp uintptr, BufferVarp []byte, CountVarp uint, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 174 | + | purego.RegisterFunc(&rawCallback, x.xWriteAsync) | |
| 175 | + | return func(StreamVar *OutputStream, BufferVar []byte, CountVar uint, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 176 | + | rawCallback(StreamVar.GoPointer(), BufferVar, CountVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 177 | + | } | |
| 178 | + | } | |
| 179 | + | ||
| 180 | + | // OverrideWriteFinish sets the callback function. | |
| 181 | + | func (x *OutputStreamClass) OverrideWriteFinish(cb func(*OutputStream, AsyncResult) int) { | |
| 182 | + | if cb == nil { | |
| 183 | + | x.xWriteFinish = 0 | |
| 184 | + | } else { | |
| 185 | + | x.xWriteFinish = purego.NewCallback(func(StreamVarp uintptr, ResultVarp uintptr) int { | |
| 186 | + | return cb(OutputStreamNewFromInternalPtr(StreamVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 187 | + | }) | |
| 188 | + | } | |
| 189 | + | } | |
| 190 | + | ||
| 191 | + | // GetWriteFinish gets the callback function. | |
| 192 | + | func (x *OutputStreamClass) GetWriteFinish() func(*OutputStream, AsyncResult) int { | |
| 193 | + | if x.xWriteFinish == 0 { | |
| 194 | + | return nil | |
| 195 | + | } | |
| 196 | + | var rawCallback func(StreamVarp uintptr, ResultVarp uintptr) int | |
| 197 | + | purego.RegisterFunc(&rawCallback, x.xWriteFinish) | |
| 198 | + | return func(StreamVar *OutputStream, ResultVar AsyncResult) int { | |
| 199 | + | return rawCallback(StreamVar.GoPointer(), ResultVar.GoPointer()) | |
| 200 | + | } | |
| 201 | + | } | |
| 202 | + | ||
| 203 | + | // OverrideSpliceAsync sets the callback function. | |
| 204 | + | func (x *OutputStreamClass) OverrideSpliceAsync(cb func(*OutputStream, *InputStream, OutputStreamSpliceFlags, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 205 | + | if cb == nil { | |
| 206 | + | x.xSpliceAsync = 0 | |
| 207 | + | } else { | |
| 208 | + | x.xSpliceAsync = purego.NewCallback(func(StreamVarp uintptr, SourceVarp uintptr, FlagsVarp OutputStreamSpliceFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 209 | + | cb(OutputStreamNewFromInternalPtr(StreamVarp), InputStreamNewFromInternalPtr(SourceVarp), FlagsVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 210 | + | }) | |
| 211 | + | } | |
| 212 | + | } | |
| 213 | + | ||
| 214 | + | // GetSpliceAsync gets the callback function. | |
| 215 | + | func (x *OutputStreamClass) GetSpliceAsync() func(*OutputStream, *InputStream, OutputStreamSpliceFlags, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 216 | + | if x.xSpliceAsync == 0 { | |
| 217 | + | return nil | |
| 218 | + | } | |
| 219 | + | var rawCallback func(StreamVarp uintptr, SourceVarp uintptr, FlagsVarp OutputStreamSpliceFlags, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 220 | + | purego.RegisterFunc(&rawCallback, x.xSpliceAsync) | |
| 221 | + | return func(StreamVar *OutputStream, SourceVar *InputStream, FlagsVar OutputStreamSpliceFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 222 | + | rawCallback(StreamVar.GoPointer(), SourceVar.GoPointer(), FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 223 | + | } | |
| 224 | + | } | |
| 225 | + | ||
| 226 | + | // OverrideSpliceFinish sets the callback function. | |
| 227 | + | func (x *OutputStreamClass) OverrideSpliceFinish(cb func(*OutputStream, AsyncResult) int) { | |
| 228 | + | if cb == nil { | |
| 229 | + | x.xSpliceFinish = 0 | |
| 230 | + | } else { | |
| 231 | + | x.xSpliceFinish = purego.NewCallback(func(StreamVarp uintptr, ResultVarp uintptr) int { | |
| 232 | + | return cb(OutputStreamNewFromInternalPtr(StreamVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 233 | + | }) | |
| 234 | + | } | |
| 235 | + | } | |
| 236 | + | ||
| 237 | + | // GetSpliceFinish gets the callback function. | |
| 238 | + | func (x *OutputStreamClass) GetSpliceFinish() func(*OutputStream, AsyncResult) int { | |
| 239 | + | if x.xSpliceFinish == 0 { | |
| 240 | + | return nil | |
| 241 | + | } | |
| 242 | + | var rawCallback func(StreamVarp uintptr, ResultVarp uintptr) int | |
| 243 | + | purego.RegisterFunc(&rawCallback, x.xSpliceFinish) | |
| 244 | + | return func(StreamVar *OutputStream, ResultVar AsyncResult) int { | |
| 245 | + | return rawCallback(StreamVar.GoPointer(), ResultVar.GoPointer()) | |
| 246 | + | } | |
| 247 | + | } | |
| 248 | + | ||
| 249 | + | // OverrideFlushAsync sets the callback function. | |
| 250 | + | func (x *OutputStreamClass) OverrideFlushAsync(cb func(*OutputStream, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 251 | + | if cb == nil { | |
| 252 | + | x.xFlushAsync = 0 | |
| 253 | + | } else { | |
| 254 | + | x.xFlushAsync = purego.NewCallback(func(StreamVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 255 | + | cb(OutputStreamNewFromInternalPtr(StreamVarp), IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 256 | + | }) | |
| 257 | + | } | |
| 258 | + | } | |
| 259 | + | ||
| 260 | + | // GetFlushAsync gets the callback function. | |
| 261 | + | func (x *OutputStreamClass) GetFlushAsync() func(*OutputStream, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 262 | + | if x.xFlushAsync == 0 { | |
| 263 | + | return nil | |
| 264 | + | } | |
| 265 | + | var rawCallback func(StreamVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 266 | + | purego.RegisterFunc(&rawCallback, x.xFlushAsync) | |
| 267 | + | return func(StreamVar *OutputStream, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 268 | + | rawCallback(StreamVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 269 | + | } | |
| 270 | + | } | |
| 271 | + | ||
| 272 | + | // OverrideFlushFinish sets the callback function. | |
| 273 | + | func (x *OutputStreamClass) OverrideFlushFinish(cb func(*OutputStream, AsyncResult) bool) { | |
| 274 | + | if cb == nil { | |
| 275 | + | x.xFlushFinish = 0 | |
| 276 | + | } else { | |
| 277 | + | x.xFlushFinish = purego.NewCallback(func(StreamVarp uintptr, ResultVarp uintptr) bool { | |
| 278 | + | return cb(OutputStreamNewFromInternalPtr(StreamVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 279 | + | }) | |
| 280 | + | } | |
| 281 | + | } | |
| 282 | + | ||
| 283 | + | // GetFlushFinish gets the callback function. | |
| 284 | + | func (x *OutputStreamClass) GetFlushFinish() func(*OutputStream, AsyncResult) bool { | |
| 285 | + | if x.xFlushFinish == 0 { | |
| 286 | + | return nil | |
| 287 | + | } | |
| 288 | + | var rawCallback func(StreamVarp uintptr, ResultVarp uintptr) bool | |
| 289 | + | purego.RegisterFunc(&rawCallback, x.xFlushFinish) | |
| 290 | + | return func(StreamVar *OutputStream, ResultVar AsyncResult) bool { | |
| 291 | + | return rawCallback(StreamVar.GoPointer(), ResultVar.GoPointer()) | |
| 292 | + | } | |
| 293 | + | } | |
| 294 | + | ||
| 295 | + | // OverrideCloseAsync sets the callback function. | |
| 296 | + | func (x *OutputStreamClass) OverrideCloseAsync(cb func(*OutputStream, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 297 | + | if cb == nil { | |
| 298 | + | x.xCloseAsync = 0 | |
| 299 | + | } else { | |
| 300 | + | x.xCloseAsync = purego.NewCallback(func(StreamVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 301 | + | cb(OutputStreamNewFromInternalPtr(StreamVarp), IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 302 | + | }) | |
| 303 | + | } | |
| 304 | + | } | |
| 305 | + | ||
| 306 | + | // GetCloseAsync gets the callback function. | |
| 307 | + | func (x *OutputStreamClass) GetCloseAsync() func(*OutputStream, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 308 | + | if x.xCloseAsync == 0 { | |
| 309 | + | return nil | |
| 310 | + | } | |
| 311 | + | var rawCallback func(StreamVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 312 | + | purego.RegisterFunc(&rawCallback, x.xCloseAsync) | |
| 313 | + | return func(StreamVar *OutputStream, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 314 | + | rawCallback(StreamVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 315 | + | } | |
| 316 | + | } | |
| 317 | + | ||
| 318 | + | // OverrideCloseFinish sets the callback function. | |
| 319 | + | func (x *OutputStreamClass) OverrideCloseFinish(cb func(*OutputStream, AsyncResult) bool) { | |
| 320 | + | if cb == nil { | |
| 321 | + | x.xCloseFinish = 0 | |
| 322 | + | } else { | |
| 323 | + | x.xCloseFinish = purego.NewCallback(func(StreamVarp uintptr, ResultVarp uintptr) bool { | |
| 324 | + | return cb(OutputStreamNewFromInternalPtr(StreamVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 325 | + | }) | |
| 326 | + | } | |
| 327 | + | } | |
| 328 | + | ||
| 329 | + | // GetCloseFinish gets the callback function. | |
| 330 | + | func (x *OutputStreamClass) GetCloseFinish() func(*OutputStream, AsyncResult) bool { | |
| 331 | + | if x.xCloseFinish == 0 { | |
| 332 | + | return nil | |
| 333 | + | } | |
| 334 | + | var rawCallback func(StreamVarp uintptr, ResultVarp uintptr) bool | |
| 335 | + | purego.RegisterFunc(&rawCallback, x.xCloseFinish) | |
| 336 | + | return func(StreamVar *OutputStream, ResultVar AsyncResult) bool { | |
| 337 | + | return rawCallback(StreamVar.GoPointer(), ResultVar.GoPointer()) | |
| 338 | + | } | |
| 339 | + | } | |
| 340 | + | ||
| 341 | + | // OverrideWritevFn sets the callback function. | |
| 342 | + | func (x *OutputStreamClass) OverrideWritevFn(cb func(*OutputStream, []OutputVector, uint, uint, *Cancellable) bool) { | |
| 343 | + | if cb == nil { | |
| 344 | + | x.xWritevFn = 0 | |
| 345 | + | } else { | |
| 346 | + | x.xWritevFn = purego.NewCallback(func(StreamVarp uintptr, VectorsVarp []OutputVector, NVectorsVarp uint, BytesWrittenVarp uint, CancellableVarp uintptr) bool { | |
| 347 | + | return cb(OutputStreamNewFromInternalPtr(StreamVarp), VectorsVarp, NVectorsVarp, BytesWrittenVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 348 | + | }) | |
| 349 | + | } | |
| 350 | + | } | |
| 351 | + | ||
| 352 | + | // GetWritevFn gets the callback function. | |
| 353 | + | func (x *OutputStreamClass) GetWritevFn() func(*OutputStream, []OutputVector, uint, uint, *Cancellable) bool { | |
| 354 | + | if x.xWritevFn == 0 { | |
| 355 | + | return nil | |
| 356 | + | } | |
| 357 | + | var rawCallback func(StreamVarp uintptr, VectorsVarp []OutputVector, NVectorsVarp uint, BytesWrittenVarp uint, CancellableVarp uintptr) bool | |
| 358 | + | purego.RegisterFunc(&rawCallback, x.xWritevFn) | |
| 359 | + | return func(StreamVar *OutputStream, VectorsVar []OutputVector, NVectorsVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) bool { | |
| 360 | + | return rawCallback(StreamVar.GoPointer(), VectorsVar, NVectorsVar, BytesWrittenVar, CancellableVar.GoPointer()) | |
| 361 | + | } | |
| 362 | + | } | |
| 363 | + | ||
| 364 | + | // OverrideWritevAsync sets the callback function. | |
| 365 | + | func (x *OutputStreamClass) OverrideWritevAsync(cb func(*OutputStream, []OutputVector, uint, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 366 | + | if cb == nil { | |
| 367 | + | x.xWritevAsync = 0 | |
| 368 | + | } else { | |
| 369 | + | x.xWritevAsync = purego.NewCallback(func(StreamVarp uintptr, VectorsVarp []OutputVector, NVectorsVarp uint, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 370 | + | cb(OutputStreamNewFromInternalPtr(StreamVarp), VectorsVarp, NVectorsVarp, IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 371 | + | }) | |
| 372 | + | } | |
| 373 | + | } | |
| 374 | + | ||
| 375 | + | // GetWritevAsync gets the callback function. | |
| 376 | + | func (x *OutputStreamClass) GetWritevAsync() func(*OutputStream, []OutputVector, uint, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 377 | + | if x.xWritevAsync == 0 { | |
| 378 | + | return nil | |
| 379 | + | } | |
| 380 | + | var rawCallback func(StreamVarp uintptr, VectorsVarp []OutputVector, NVectorsVarp uint, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 381 | + | purego.RegisterFunc(&rawCallback, x.xWritevAsync) | |
| 382 | + | return func(StreamVar *OutputStream, VectorsVar []OutputVector, NVectorsVar uint, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 383 | + | rawCallback(StreamVar.GoPointer(), VectorsVar, NVectorsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 384 | + | } | |
| 385 | + | } | |
| 386 | + | ||
| 387 | + | // OverrideWritevFinish sets the callback function. | |
| 388 | + | func (x *OutputStreamClass) OverrideWritevFinish(cb func(*OutputStream, AsyncResult, uint) bool) { | |
| 389 | + | if cb == nil { | |
| 390 | + | x.xWritevFinish = 0 | |
| 391 | + | } else { | |
| 392 | + | x.xWritevFinish = purego.NewCallback(func(StreamVarp uintptr, ResultVarp uintptr, BytesWrittenVarp uint) bool { | |
| 393 | + | return cb(OutputStreamNewFromInternalPtr(StreamVarp), &AsyncResultBase{Ptr: ResultVarp}, BytesWrittenVarp) | |
| 394 | + | }) | |
| 395 | + | } | |
| 396 | + | } | |
| 397 | + | ||
| 398 | + | // GetWritevFinish gets the callback function. | |
| 399 | + | func (x *OutputStreamClass) GetWritevFinish() func(*OutputStream, AsyncResult, uint) bool { | |
| 400 | + | if x.xWritevFinish == 0 { | |
| 401 | + | return nil | |
| 402 | + | } | |
| 403 | + | var rawCallback func(StreamVarp uintptr, ResultVarp uintptr, BytesWrittenVarp uint) bool | |
| 404 | + | purego.RegisterFunc(&rawCallback, x.xWritevFinish) | |
| 405 | + | return func(StreamVar *OutputStream, ResultVar AsyncResult, BytesWrittenVar uint) bool { | |
| 406 | + | return rawCallback(StreamVar.GoPointer(), ResultVar.GoPointer(), BytesWrittenVar) | |
| 407 | + | } | |
| 408 | + | } | |
| 409 | + | ||
| 410 | + | // OverrideGReserved4 sets the callback function. | |
| 411 | + | func (x *OutputStreamClass) OverrideGReserved4(cb func()) { | |
| 412 | + | if cb == nil { | |
| 413 | + | x.xGReserved4 = 0 | |
| 414 | + | } else { | |
| 415 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 416 | + | cb() | |
| 417 | + | }) | |
| 418 | + | } | |
| 419 | + | } | |
| 420 | + | ||
| 421 | + | // GetGReserved4 gets the callback function. | |
| 422 | + | func (x *OutputStreamClass) GetGReserved4() func() { | |
| 423 | + | if x.xGReserved4 == 0 { | |
| 424 | + | return nil | |
| 425 | + | } | |
| 426 | + | var rawCallback func() | |
| 427 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 428 | + | return func() { | |
| 429 | + | rawCallback() | |
| 430 | + | } | |
| 431 | + | } | |
| 432 | + | ||
| 433 | + | // OverrideGReserved5 sets the callback function. | |
| 434 | + | func (x *OutputStreamClass) OverrideGReserved5(cb func()) { | |
| 435 | + | if cb == nil { | |
| 436 | + | x.xGReserved5 = 0 | |
| 437 | + | } else { | |
| 438 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 439 | + | cb() | |
| 440 | + | }) | |
| 441 | + | } | |
| 442 | + | } | |
| 443 | + | ||
| 444 | + | // GetGReserved5 gets the callback function. | |
| 445 | + | func (x *OutputStreamClass) GetGReserved5() func() { | |
| 446 | + | if x.xGReserved5 == 0 { | |
| 447 | + | return nil | |
| 448 | + | } | |
| 449 | + | var rawCallback func() | |
| 450 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 451 | + | return func() { | |
| 452 | + | rawCallback() | |
| 453 | + | } | |
| 454 | + | } | |
| 455 | + | ||
| 456 | + | // OverrideGReserved6 sets the callback function. | |
| 457 | + | func (x *OutputStreamClass) OverrideGReserved6(cb func()) { | |
| 458 | + | if cb == nil { | |
| 459 | + | x.xGReserved6 = 0 | |
| 460 | + | } else { | |
| 461 | + | x.xGReserved6 = purego.NewCallback(func() { | |
| 462 | + | cb() | |
| 463 | + | }) | |
| 464 | + | } | |
| 465 | + | } | |
| 466 | + | ||
| 467 | + | // GetGReserved6 gets the callback function. | |
| 468 | + | func (x *OutputStreamClass) GetGReserved6() func() { | |
| 469 | + | if x.xGReserved6 == 0 { | |
| 470 | + | return nil | |
| 471 | + | } | |
| 472 | + | var rawCallback func() | |
| 473 | + | purego.RegisterFunc(&rawCallback, x.xGReserved6) | |
| 474 | + | return func() { | |
| 475 | + | rawCallback() | |
| 476 | + | } | |
| 477 | + | } | |
| 478 | + | ||
| 479 | + | // OverrideGReserved7 sets the callback function. | |
| 480 | + | func (x *OutputStreamClass) OverrideGReserved7(cb func()) { | |
| 481 | + | if cb == nil { | |
| 482 | + | x.xGReserved7 = 0 | |
| 483 | + | } else { | |
| 484 | + | x.xGReserved7 = purego.NewCallback(func() { | |
| 485 | + | cb() | |
| 486 | + | }) | |
| 487 | + | } | |
| 488 | + | } | |
| 489 | + | ||
| 490 | + | // GetGReserved7 gets the callback function. | |
| 491 | + | func (x *OutputStreamClass) GetGReserved7() func() { | |
| 492 | + | if x.xGReserved7 == 0 { | |
| 493 | + | return nil | |
| 494 | + | } | |
| 495 | + | var rawCallback func() | |
| 496 | + | purego.RegisterFunc(&rawCallback, x.xGReserved7) | |
| 497 | + | return func() { | |
| 498 | + | rawCallback() | |
| 499 | + | } | |
| 500 | + | } | |
| 501 | + | ||
| 502 | + | // OverrideGReserved8 sets the callback function. | |
| 503 | + | func (x *OutputStreamClass) OverrideGReserved8(cb func()) { | |
| 504 | + | if cb == nil { | |
| 505 | + | x.xGReserved8 = 0 | |
| 506 | + | } else { | |
| 507 | + | x.xGReserved8 = purego.NewCallback(func() { | |
| 508 | + | cb() | |
| 509 | + | }) | |
| 510 | + | } | |
| 511 | + | } | |
| 512 | + | ||
| 513 | + | // GetGReserved8 gets the callback function. | |
| 514 | + | func (x *OutputStreamClass) GetGReserved8() func() { | |
| 515 | + | if x.xGReserved8 == 0 { | |
| 516 | + | return nil | |
| 517 | + | } | |
| 518 | + | var rawCallback func() | |
| 519 | + | purego.RegisterFunc(&rawCallback, x.xGReserved8) | |
| 520 | + | return func() { | |
| 521 | + | rawCallback() | |
| 522 | + | } | |
| 523 | + | } | |
| 524 | + | ||
| 25 | 525 | type OutputStreamPrivate struct { | |
| 26 | 526 | _ structs.HostLayout | |
| 27 | 527 | } | |
M v4/gio/gpermission.go +151 -1
| @@ -15,7 +15,19 @@ import ( | |||
| 15 | 15 | type PermissionClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xAcquire uintptr | |
| 21 | + | ||
| 22 | + | xAcquireAsync uintptr | |
| 23 | + | ||
| 24 | + | xAcquireFinish uintptr | |
| 25 | + | ||
| 26 | + | xRelease uintptr | |
| 27 | + | ||
| 28 | + | xReleaseAsync uintptr | |
| 29 | + | ||
| 30 | + | xReleaseFinish uintptr | |
| 19 | 31 | ||
| 20 | 32 | Reserved [16]uintptr | |
| 21 | 33 | } | |
| @@ -24,6 +36,144 @@ func (x *PermissionClass) GoPointer() uintptr { | |||
| 24 | 36 | return uintptr(unsafe.Pointer(x)) | |
| 25 | 37 | } | |
| 26 | 38 | ||
| 39 | + | // OverrideAcquire sets the callback function. | |
| 40 | + | func (x *PermissionClass) OverrideAcquire(cb func(*Permission, *Cancellable) bool) { | |
| 41 | + | if cb == nil { | |
| 42 | + | x.xAcquire = 0 | |
| 43 | + | } else { | |
| 44 | + | x.xAcquire = purego.NewCallback(func(PermissionVarp uintptr, CancellableVarp uintptr) bool { | |
| 45 | + | return cb(PermissionNewFromInternalPtr(PermissionVarp), CancellableNewFromInternalPtr(CancellableVarp)) | |
| 46 | + | }) | |
| 47 | + | } | |
| 48 | + | } | |
| 49 | + | ||
| 50 | + | // GetAcquire gets the callback function. | |
| 51 | + | func (x *PermissionClass) GetAcquire() func(*Permission, *Cancellable) bool { | |
| 52 | + | if x.xAcquire == 0 { | |
| 53 | + | return nil | |
| 54 | + | } | |
| 55 | + | var rawCallback func(PermissionVarp uintptr, CancellableVarp uintptr) bool | |
| 56 | + | purego.RegisterFunc(&rawCallback, x.xAcquire) | |
| 57 | + | return func(PermissionVar *Permission, CancellableVar *Cancellable) bool { | |
| 58 | + | return rawCallback(PermissionVar.GoPointer(), CancellableVar.GoPointer()) | |
| 59 | + | } | |
| 60 | + | } | |
| 61 | + | ||
| 62 | + | // OverrideAcquireAsync sets the callback function. | |
| 63 | + | func (x *PermissionClass) OverrideAcquireAsync(cb func(*Permission, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 64 | + | if cb == nil { | |
| 65 | + | x.xAcquireAsync = 0 | |
| 66 | + | } else { | |
| 67 | + | x.xAcquireAsync = purego.NewCallback(func(PermissionVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 68 | + | cb(PermissionNewFromInternalPtr(PermissionVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 69 | + | }) | |
| 70 | + | } | |
| 71 | + | } | |
| 72 | + | ||
| 73 | + | // GetAcquireAsync gets the callback function. | |
| 74 | + | func (x *PermissionClass) GetAcquireAsync() func(*Permission, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 75 | + | if x.xAcquireAsync == 0 { | |
| 76 | + | return nil | |
| 77 | + | } | |
| 78 | + | var rawCallback func(PermissionVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 79 | + | purego.RegisterFunc(&rawCallback, x.xAcquireAsync) | |
| 80 | + | return func(PermissionVar *Permission, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 81 | + | rawCallback(PermissionVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 82 | + | } | |
| 83 | + | } | |
| 84 | + | ||
| 85 | + | // OverrideAcquireFinish sets the callback function. | |
| 86 | + | func (x *PermissionClass) OverrideAcquireFinish(cb func(*Permission, AsyncResult) bool) { | |
| 87 | + | if cb == nil { | |
| 88 | + | x.xAcquireFinish = 0 | |
| 89 | + | } else { | |
| 90 | + | x.xAcquireFinish = purego.NewCallback(func(PermissionVarp uintptr, ResultVarp uintptr) bool { | |
| 91 | + | return cb(PermissionNewFromInternalPtr(PermissionVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 92 | + | }) | |
| 93 | + | } | |
| 94 | + | } | |
| 95 | + | ||
| 96 | + | // GetAcquireFinish gets the callback function. | |
| 97 | + | func (x *PermissionClass) GetAcquireFinish() func(*Permission, AsyncResult) bool { | |
| 98 | + | if x.xAcquireFinish == 0 { | |
| 99 | + | return nil | |
| 100 | + | } | |
| 101 | + | var rawCallback func(PermissionVarp uintptr, ResultVarp uintptr) bool | |
| 102 | + | purego.RegisterFunc(&rawCallback, x.xAcquireFinish) | |
| 103 | + | return func(PermissionVar *Permission, ResultVar AsyncResult) bool { | |
| 104 | + | return rawCallback(PermissionVar.GoPointer(), ResultVar.GoPointer()) | |
| 105 | + | } | |
| 106 | + | } | |
| 107 | + | ||
| 108 | + | // OverrideRelease sets the callback function. | |
| 109 | + | func (x *PermissionClass) OverrideRelease(cb func(*Permission, *Cancellable) bool) { | |
| 110 | + | if cb == nil { | |
| 111 | + | x.xRelease = 0 | |
| 112 | + | } else { | |
| 113 | + | x.xRelease = purego.NewCallback(func(PermissionVarp uintptr, CancellableVarp uintptr) bool { | |
| 114 | + | return cb(PermissionNewFromInternalPtr(PermissionVarp), CancellableNewFromInternalPtr(CancellableVarp)) | |
| 115 | + | }) | |
| 116 | + | } | |
| 117 | + | } | |
| 118 | + | ||
| 119 | + | // GetRelease gets the callback function. | |
| 120 | + | func (x *PermissionClass) GetRelease() func(*Permission, *Cancellable) bool { | |
| 121 | + | if x.xRelease == 0 { | |
| 122 | + | return nil | |
| 123 | + | } | |
| 124 | + | var rawCallback func(PermissionVarp uintptr, CancellableVarp uintptr) bool | |
| 125 | + | purego.RegisterFunc(&rawCallback, x.xRelease) | |
| 126 | + | return func(PermissionVar *Permission, CancellableVar *Cancellable) bool { | |
| 127 | + | return rawCallback(PermissionVar.GoPointer(), CancellableVar.GoPointer()) | |
| 128 | + | } | |
| 129 | + | } | |
| 130 | + | ||
| 131 | + | // OverrideReleaseAsync sets the callback function. | |
| 132 | + | func (x *PermissionClass) OverrideReleaseAsync(cb func(*Permission, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 133 | + | if cb == nil { | |
| 134 | + | x.xReleaseAsync = 0 | |
| 135 | + | } else { | |
| 136 | + | x.xReleaseAsync = purego.NewCallback(func(PermissionVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 137 | + | cb(PermissionNewFromInternalPtr(PermissionVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 138 | + | }) | |
| 139 | + | } | |
| 140 | + | } | |
| 141 | + | ||
| 142 | + | // GetReleaseAsync gets the callback function. | |
| 143 | + | func (x *PermissionClass) GetReleaseAsync() func(*Permission, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 144 | + | if x.xReleaseAsync == 0 { | |
| 145 | + | return nil | |
| 146 | + | } | |
| 147 | + | var rawCallback func(PermissionVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 148 | + | purego.RegisterFunc(&rawCallback, x.xReleaseAsync) | |
| 149 | + | return func(PermissionVar *Permission, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 150 | + | rawCallback(PermissionVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 151 | + | } | |
| 152 | + | } | |
| 153 | + | ||
| 154 | + | // OverrideReleaseFinish sets the callback function. | |
| 155 | + | func (x *PermissionClass) OverrideReleaseFinish(cb func(*Permission, AsyncResult) bool) { | |
| 156 | + | if cb == nil { | |
| 157 | + | x.xReleaseFinish = 0 | |
| 158 | + | } else { | |
| 159 | + | x.xReleaseFinish = purego.NewCallback(func(PermissionVarp uintptr, ResultVarp uintptr) bool { | |
| 160 | + | return cb(PermissionNewFromInternalPtr(PermissionVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 161 | + | }) | |
| 162 | + | } | |
| 163 | + | } | |
| 164 | + | ||
| 165 | + | // GetReleaseFinish gets the callback function. | |
| 166 | + | func (x *PermissionClass) GetReleaseFinish() func(*Permission, AsyncResult) bool { | |
| 167 | + | if x.xReleaseFinish == 0 { | |
| 168 | + | return nil | |
| 169 | + | } | |
| 170 | + | var rawCallback func(PermissionVarp uintptr, ResultVarp uintptr) bool | |
| 171 | + | purego.RegisterFunc(&rawCallback, x.xReleaseFinish) | |
| 172 | + | return func(PermissionVar *Permission, ResultVar AsyncResult) bool { | |
| 173 | + | return rawCallback(PermissionVar.GoPointer(), ResultVar.GoPointer()) | |
| 174 | + | } | |
| 175 | + | } | |
| 176 | + | ||
| 27 | 177 | type PermissionPrivate struct { | |
| 28 | 178 | _ structs.HostLayout | |
| 29 | 179 | } | |
M v4/gio/gpollableinputstream.go +101 -1
| @@ -25,12 +25,112 @@ type PollableInputStreamInterface struct { | |||
| 25 | 25 | _ structs.HostLayout | |
| 26 | 26 | ||
| 27 | 27 | GIface uintptr | |
| 28 | + | ||
| 29 | + | xCanPoll uintptr | |
| 30 | + | ||
| 31 | + | xIsReadable uintptr | |
| 32 | + | ||
| 33 | + | xCreateSource uintptr | |
| 34 | + | ||
| 35 | + | xReadNonblocking uintptr | |
| 28 | 36 | } | |
| 29 | 37 | ||
| 30 | 38 | func (x *PollableInputStreamInterface) GoPointer() uintptr { | |
| 31 | 39 | return uintptr(unsafe.Pointer(x)) | |
| 32 | 40 | } | |
| 33 | 41 | ||
| 42 | + | // OverrideCanPoll sets the callback function. | |
| 43 | + | func (x *PollableInputStreamInterface) OverrideCanPoll(cb func(PollableInputStream) bool) { | |
| 44 | + | if cb == nil { | |
| 45 | + | x.xCanPoll = 0 | |
| 46 | + | } else { | |
| 47 | + | x.xCanPoll = purego.NewCallback(func(StreamVarp uintptr) bool { | |
| 48 | + | return cb(&PollableInputStreamBase{Ptr: StreamVarp}) | |
| 49 | + | }) | |
| 50 | + | } | |
| 51 | + | } | |
| 52 | + | ||
| 53 | + | // GetCanPoll gets the callback function. | |
| 54 | + | func (x *PollableInputStreamInterface) GetCanPoll() func(PollableInputStream) bool { | |
| 55 | + | if x.xCanPoll == 0 { | |
| 56 | + | return nil | |
| 57 | + | } | |
| 58 | + | var rawCallback func(StreamVarp uintptr) bool | |
| 59 | + | purego.RegisterFunc(&rawCallback, x.xCanPoll) | |
| 60 | + | return func(StreamVar PollableInputStream) bool { | |
| 61 | + | return rawCallback(StreamVar.GoPointer()) | |
| 62 | + | } | |
| 63 | + | } | |
| 64 | + | ||
| 65 | + | // OverrideIsReadable sets the callback function. | |
| 66 | + | func (x *PollableInputStreamInterface) OverrideIsReadable(cb func(PollableInputStream) bool) { | |
| 67 | + | if cb == nil { | |
| 68 | + | x.xIsReadable = 0 | |
| 69 | + | } else { | |
| 70 | + | x.xIsReadable = purego.NewCallback(func(StreamVarp uintptr) bool { | |
| 71 | + | return cb(&PollableInputStreamBase{Ptr: StreamVarp}) | |
| 72 | + | }) | |
| 73 | + | } | |
| 74 | + | } | |
| 75 | + | ||
| 76 | + | // GetIsReadable gets the callback function. | |
| 77 | + | func (x *PollableInputStreamInterface) GetIsReadable() func(PollableInputStream) bool { | |
| 78 | + | if x.xIsReadable == 0 { | |
| 79 | + | return nil | |
| 80 | + | } | |
| 81 | + | var rawCallback func(StreamVarp uintptr) bool | |
| 82 | + | purego.RegisterFunc(&rawCallback, x.xIsReadable) | |
| 83 | + | return func(StreamVar PollableInputStream) bool { | |
| 84 | + | return rawCallback(StreamVar.GoPointer()) | |
| 85 | + | } | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | // OverrideCreateSource sets the callback function. | |
| 89 | + | func (x *PollableInputStreamInterface) OverrideCreateSource(cb func(PollableInputStream, *Cancellable) *glib.Source) { | |
| 90 | + | if cb == nil { | |
| 91 | + | x.xCreateSource = 0 | |
| 92 | + | } else { | |
| 93 | + | x.xCreateSource = purego.NewCallback(func(StreamVarp uintptr, CancellableVarp uintptr) *glib.Source { | |
| 94 | + | return cb(&PollableInputStreamBase{Ptr: StreamVarp}, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 95 | + | }) | |
| 96 | + | } | |
| 97 | + | } | |
| 98 | + | ||
| 99 | + | // GetCreateSource gets the callback function. | |
| 100 | + | func (x *PollableInputStreamInterface) GetCreateSource() func(PollableInputStream, *Cancellable) *glib.Source { | |
| 101 | + | if x.xCreateSource == 0 { | |
| 102 | + | return nil | |
| 103 | + | } | |
| 104 | + | var rawCallback func(StreamVarp uintptr, CancellableVarp uintptr) *glib.Source | |
| 105 | + | purego.RegisterFunc(&rawCallback, x.xCreateSource) | |
| 106 | + | return func(StreamVar PollableInputStream, CancellableVar *Cancellable) *glib.Source { | |
| 107 | + | return rawCallback(StreamVar.GoPointer(), CancellableVar.GoPointer()) | |
| 108 | + | } | |
| 109 | + | } | |
| 110 | + | ||
| 111 | + | // OverrideReadNonblocking sets the callback function. | |
| 112 | + | func (x *PollableInputStreamInterface) OverrideReadNonblocking(cb func(PollableInputStream, []byte, uint) int) { | |
| 113 | + | if cb == nil { | |
| 114 | + | x.xReadNonblocking = 0 | |
| 115 | + | } else { | |
| 116 | + | x.xReadNonblocking = purego.NewCallback(func(StreamVarp uintptr, BufferVarp []byte, CountVarp uint) int { | |
| 117 | + | return cb(&PollableInputStreamBase{Ptr: StreamVarp}, BufferVarp, CountVarp) | |
| 118 | + | }) | |
| 119 | + | } | |
| 120 | + | } | |
| 121 | + | ||
| 122 | + | // GetReadNonblocking gets the callback function. | |
| 123 | + | func (x *PollableInputStreamInterface) GetReadNonblocking() func(PollableInputStream, []byte, uint) int { | |
| 124 | + | if x.xReadNonblocking == 0 { | |
| 125 | + | return nil | |
| 126 | + | } | |
| 127 | + | var rawCallback func(StreamVarp uintptr, BufferVarp []byte, CountVarp uint) int | |
| 128 | + | purego.RegisterFunc(&rawCallback, x.xReadNonblocking) | |
| 129 | + | return func(StreamVar PollableInputStream, BufferVar []byte, CountVar uint) int { | |
| 130 | + | return rawCallback(StreamVar.GoPointer(), BufferVar, CountVar) | |
| 131 | + | } | |
| 132 | + | } | |
| 133 | + | ||
| 34 | 134 | // #GPollableInputStream is implemented by #GInputStreams that | |
| 35 | 135 | // can be polled for readiness to read. This can be used when | |
| 36 | 136 | // interfacing with a non-GIO API that expects | |
| @@ -41,7 +141,7 @@ type PollableInputStream interface { | |||
| 41 | 141 | CanPoll() bool | |
| 42 | 142 | CreateSource(CancellableVar *Cancellable) *glib.Source | |
| 43 | 143 | IsReadable() bool | |
| 44 | - | ReadNonblocking(BufferVar []byte, CountVar uint, CancellableVar *Cancellable) int | |
| 144 | + | ReadNonblocking(BufferVar []byte, CountVar uint, CancellableVar *Cancellable) (int, error) | |
| 45 | 145 | } | |
| 46 | 146 | ||
| 47 | 147 | var xPollableInputStreamGLibType func() types.GType | |
M v4/gio/gpollableoutputstream.go +127 -2
| @@ -31,12 +31,137 @@ type PollableOutputStreamInterface struct { | |||
| 31 | 31 | _ structs.HostLayout | |
| 32 | 32 | ||
| 33 | 33 | GIface uintptr | |
| 34 | + | ||
| 35 | + | xCanPoll uintptr | |
| 36 | + | ||
| 37 | + | xIsWritable uintptr | |
| 38 | + | ||
| 39 | + | xCreateSource uintptr | |
| 40 | + | ||
| 41 | + | xWriteNonblocking uintptr | |
| 42 | + | ||
| 43 | + | xWritevNonblocking uintptr | |
| 34 | 44 | } | |
| 35 | 45 | ||
| 36 | 46 | func (x *PollableOutputStreamInterface) GoPointer() uintptr { | |
| 37 | 47 | return uintptr(unsafe.Pointer(x)) | |
| 38 | 48 | } | |
| 39 | 49 | ||
| 50 | + | // OverrideCanPoll sets the callback function. | |
| 51 | + | func (x *PollableOutputStreamInterface) OverrideCanPoll(cb func(PollableOutputStream) bool) { | |
| 52 | + | if cb == nil { | |
| 53 | + | x.xCanPoll = 0 | |
| 54 | + | } else { | |
| 55 | + | x.xCanPoll = purego.NewCallback(func(StreamVarp uintptr) bool { | |
| 56 | + | return cb(&PollableOutputStreamBase{Ptr: StreamVarp}) | |
| 57 | + | }) | |
| 58 | + | } | |
| 59 | + | } | |
| 60 | + | ||
| 61 | + | // GetCanPoll gets the callback function. | |
| 62 | + | func (x *PollableOutputStreamInterface) GetCanPoll() func(PollableOutputStream) bool { | |
| 63 | + | if x.xCanPoll == 0 { | |
| 64 | + | return nil | |
| 65 | + | } | |
| 66 | + | var rawCallback func(StreamVarp uintptr) bool | |
| 67 | + | purego.RegisterFunc(&rawCallback, x.xCanPoll) | |
| 68 | + | return func(StreamVar PollableOutputStream) bool { | |
| 69 | + | return rawCallback(StreamVar.GoPointer()) | |
| 70 | + | } | |
| 71 | + | } | |
| 72 | + | ||
| 73 | + | // OverrideIsWritable sets the callback function. | |
| 74 | + | func (x *PollableOutputStreamInterface) OverrideIsWritable(cb func(PollableOutputStream) bool) { | |
| 75 | + | if cb == nil { | |
| 76 | + | x.xIsWritable = 0 | |
| 77 | + | } else { | |
| 78 | + | x.xIsWritable = purego.NewCallback(func(StreamVarp uintptr) bool { | |
| 79 | + | return cb(&PollableOutputStreamBase{Ptr: StreamVarp}) | |
| 80 | + | }) | |
| 81 | + | } | |
| 82 | + | } | |
| 83 | + | ||
| 84 | + | // GetIsWritable gets the callback function. | |
| 85 | + | func (x *PollableOutputStreamInterface) GetIsWritable() func(PollableOutputStream) bool { | |
| 86 | + | if x.xIsWritable == 0 { | |
| 87 | + | return nil | |
| 88 | + | } | |
| 89 | + | var rawCallback func(StreamVarp uintptr) bool | |
| 90 | + | purego.RegisterFunc(&rawCallback, x.xIsWritable) | |
| 91 | + | return func(StreamVar PollableOutputStream) bool { | |
| 92 | + | return rawCallback(StreamVar.GoPointer()) | |
| 93 | + | } | |
| 94 | + | } | |
| 95 | + | ||
| 96 | + | // OverrideCreateSource sets the callback function. | |
| 97 | + | func (x *PollableOutputStreamInterface) OverrideCreateSource(cb func(PollableOutputStream, *Cancellable) *glib.Source) { | |
| 98 | + | if cb == nil { | |
| 99 | + | x.xCreateSource = 0 | |
| 100 | + | } else { | |
| 101 | + | x.xCreateSource = purego.NewCallback(func(StreamVarp uintptr, CancellableVarp uintptr) *glib.Source { | |
| 102 | + | return cb(&PollableOutputStreamBase{Ptr: StreamVarp}, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 103 | + | }) | |
| 104 | + | } | |
| 105 | + | } | |
| 106 | + | ||
| 107 | + | // GetCreateSource gets the callback function. | |
| 108 | + | func (x *PollableOutputStreamInterface) GetCreateSource() func(PollableOutputStream, *Cancellable) *glib.Source { | |
| 109 | + | if x.xCreateSource == 0 { | |
| 110 | + | return nil | |
| 111 | + | } | |
| 112 | + | var rawCallback func(StreamVarp uintptr, CancellableVarp uintptr) *glib.Source | |
| 113 | + | purego.RegisterFunc(&rawCallback, x.xCreateSource) | |
| 114 | + | return func(StreamVar PollableOutputStream, CancellableVar *Cancellable) *glib.Source { | |
| 115 | + | return rawCallback(StreamVar.GoPointer(), CancellableVar.GoPointer()) | |
| 116 | + | } | |
| 117 | + | } | |
| 118 | + | ||
| 119 | + | // OverrideWriteNonblocking sets the callback function. | |
| 120 | + | func (x *PollableOutputStreamInterface) OverrideWriteNonblocking(cb func(PollableOutputStream, []byte, uint) int) { | |
| 121 | + | if cb == nil { | |
| 122 | + | x.xWriteNonblocking = 0 | |
| 123 | + | } else { | |
| 124 | + | x.xWriteNonblocking = purego.NewCallback(func(StreamVarp uintptr, BufferVarp []byte, CountVarp uint) int { | |
| 125 | + | return cb(&PollableOutputStreamBase{Ptr: StreamVarp}, BufferVarp, CountVarp) | |
| 126 | + | }) | |
| 127 | + | } | |
| 128 | + | } | |
| 129 | + | ||
| 130 | + | // GetWriteNonblocking gets the callback function. | |
| 131 | + | func (x *PollableOutputStreamInterface) GetWriteNonblocking() func(PollableOutputStream, []byte, uint) int { | |
| 132 | + | if x.xWriteNonblocking == 0 { | |
| 133 | + | return nil | |
| 134 | + | } | |
| 135 | + | var rawCallback func(StreamVarp uintptr, BufferVarp []byte, CountVarp uint) int | |
| 136 | + | purego.RegisterFunc(&rawCallback, x.xWriteNonblocking) | |
| 137 | + | return func(StreamVar PollableOutputStream, BufferVar []byte, CountVar uint) int { | |
| 138 | + | return rawCallback(StreamVar.GoPointer(), BufferVar, CountVar) | |
| 139 | + | } | |
| 140 | + | } | |
| 141 | + | ||
| 142 | + | // OverrideWritevNonblocking sets the callback function. | |
| 143 | + | func (x *PollableOutputStreamInterface) OverrideWritevNonblocking(cb func(PollableOutputStream, []OutputVector, uint, uint) PollableReturn) { | |
| 144 | + | if cb == nil { | |
| 145 | + | x.xWritevNonblocking = 0 | |
| 146 | + | } else { | |
| 147 | + | x.xWritevNonblocking = purego.NewCallback(func(StreamVarp uintptr, VectorsVarp []OutputVector, NVectorsVarp uint, BytesWrittenVarp uint) PollableReturn { | |
| 148 | + | return cb(&PollableOutputStreamBase{Ptr: StreamVarp}, VectorsVarp, NVectorsVarp, BytesWrittenVarp) | |
| 149 | + | }) | |
| 150 | + | } | |
| 151 | + | } | |
| 152 | + | ||
| 153 | + | // GetWritevNonblocking gets the callback function. | |
| 154 | + | func (x *PollableOutputStreamInterface) GetWritevNonblocking() func(PollableOutputStream, []OutputVector, uint, uint) PollableReturn { | |
| 155 | + | if x.xWritevNonblocking == 0 { | |
| 156 | + | return nil | |
| 157 | + | } | |
| 158 | + | var rawCallback func(StreamVarp uintptr, VectorsVarp []OutputVector, NVectorsVarp uint, BytesWrittenVarp uint) PollableReturn | |
| 159 | + | purego.RegisterFunc(&rawCallback, x.xWritevNonblocking) | |
| 160 | + | return func(StreamVar PollableOutputStream, VectorsVar []OutputVector, NVectorsVar uint, BytesWrittenVar uint) PollableReturn { | |
| 161 | + | return rawCallback(StreamVar.GoPointer(), VectorsVar, NVectorsVar, BytesWrittenVar) | |
| 162 | + | } | |
| 163 | + | } | |
| 164 | + | ||
| 40 | 165 | // #GPollableOutputStream is implemented by #GOutputStreams that | |
| 41 | 166 | // can be polled for readiness to write. This can be used when | |
| 42 | 167 | // interfacing with a non-GIO API that expects | |
| @@ -47,8 +172,8 @@ type PollableOutputStream interface { | |||
| 47 | 172 | CanPoll() bool | |
| 48 | 173 | CreateSource(CancellableVar *Cancellable) *glib.Source | |
| 49 | 174 | IsWritable() bool | |
| 50 | - | WriteNonblocking(BufferVar []byte, CountVar uint, CancellableVar *Cancellable) int | |
| 51 | - | WritevNonblocking(VectorsVar []OutputVector, NVectorsVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) PollableReturn | |
| 175 | + | WriteNonblocking(BufferVar []byte, CountVar uint, CancellableVar *Cancellable) (int, error) | |
| 176 | + | WritevNonblocking(VectorsVar []OutputVector, NVectorsVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) (PollableReturn, error) | |
| 52 | 177 | } | |
| 53 | 178 | ||
| 54 | 179 | var xPollableOutputStreamGLibType func() types.GType | |
M v4/gio/gproxy.go +122 -2
| @@ -16,12 +16,132 @@ type ProxyInterface struct { | |||
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | 18 | GIface uintptr | |
| 19 | + | ||
| 20 | + | xConnect uintptr | |
| 21 | + | ||
| 22 | + | xConnectAsync uintptr | |
| 23 | + | ||
| 24 | + | xConnectFinish uintptr | |
| 25 | + | ||
| 26 | + | xSupportsHostname uintptr | |
| 19 | 27 | } | |
| 20 | 28 | ||
| 21 | 29 | func (x *ProxyInterface) GoPointer() uintptr { | |
| 22 | 30 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 31 | } | |
| 24 | 32 | ||
| 33 | + | // OverrideConnect sets the callback function. | |
| 34 | + | func (x *ProxyInterface) OverrideConnect(cb func(Proxy, *IOStream, *ProxyAddress, *Cancellable) *IOStream) { | |
| 35 | + | if cb == nil { | |
| 36 | + | x.xConnect = 0 | |
| 37 | + | } else { | |
| 38 | + | x.xConnect = purego.NewCallback(func(ProxyVarp uintptr, ConnectionVarp uintptr, ProxyAddressVarp uintptr, CancellableVarp uintptr) uintptr { | |
| 39 | + | ret := cb(&ProxyBase{Ptr: ProxyVarp}, IOStreamNewFromInternalPtr(ConnectionVarp), ProxyAddressNewFromInternalPtr(ProxyAddressVarp), CancellableNewFromInternalPtr(CancellableVarp)) | |
| 40 | + | if ret == nil { | |
| 41 | + | return 0 | |
| 42 | + | } | |
| 43 | + | return ret.GoPointer() | |
| 44 | + | }) | |
| 45 | + | } | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | // GetConnect gets the callback function. | |
| 49 | + | func (x *ProxyInterface) GetConnect() func(Proxy, *IOStream, *ProxyAddress, *Cancellable) *IOStream { | |
| 50 | + | if x.xConnect == 0 { | |
| 51 | + | return nil | |
| 52 | + | } | |
| 53 | + | var rawCallback func(ProxyVarp uintptr, ConnectionVarp uintptr, ProxyAddressVarp uintptr, CancellableVarp uintptr) uintptr | |
| 54 | + | purego.RegisterFunc(&rawCallback, x.xConnect) | |
| 55 | + | return func(ProxyVar Proxy, ConnectionVar *IOStream, ProxyAddressVar *ProxyAddress, CancellableVar *Cancellable) *IOStream { | |
| 56 | + | rawRet := rawCallback(ProxyVar.GoPointer(), ConnectionVar.GoPointer(), ProxyAddressVar.GoPointer(), CancellableVar.GoPointer()) | |
| 57 | + | if rawRet == 0 { | |
| 58 | + | return nil | |
| 59 | + | } | |
| 60 | + | ret := &IOStream{} | |
| 61 | + | ret.Ptr = rawRet | |
| 62 | + | return ret | |
| 63 | + | } | |
| 64 | + | } | |
| 65 | + | ||
| 66 | + | // OverrideConnectAsync sets the callback function. | |
| 67 | + | func (x *ProxyInterface) OverrideConnectAsync(cb func(Proxy, *IOStream, *ProxyAddress, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 68 | + | if cb == nil { | |
| 69 | + | x.xConnectAsync = 0 | |
| 70 | + | } else { | |
| 71 | + | x.xConnectAsync = purego.NewCallback(func(ProxyVarp uintptr, ConnectionVarp uintptr, ProxyAddressVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 72 | + | cb(&ProxyBase{Ptr: ProxyVarp}, IOStreamNewFromInternalPtr(ConnectionVarp), ProxyAddressNewFromInternalPtr(ProxyAddressVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 73 | + | }) | |
| 74 | + | } | |
| 75 | + | } | |
| 76 | + | ||
| 77 | + | // GetConnectAsync gets the callback function. | |
| 78 | + | func (x *ProxyInterface) GetConnectAsync() func(Proxy, *IOStream, *ProxyAddress, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 79 | + | if x.xConnectAsync == 0 { | |
| 80 | + | return nil | |
| 81 | + | } | |
| 82 | + | var rawCallback func(ProxyVarp uintptr, ConnectionVarp uintptr, ProxyAddressVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 83 | + | purego.RegisterFunc(&rawCallback, x.xConnectAsync) | |
| 84 | + | return func(ProxyVar Proxy, ConnectionVar *IOStream, ProxyAddressVar *ProxyAddress, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 85 | + | rawCallback(ProxyVar.GoPointer(), ConnectionVar.GoPointer(), ProxyAddressVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 86 | + | } | |
| 87 | + | } | |
| 88 | + | ||
| 89 | + | // OverrideConnectFinish sets the callback function. | |
| 90 | + | func (x *ProxyInterface) OverrideConnectFinish(cb func(Proxy, AsyncResult) *IOStream) { | |
| 91 | + | if cb == nil { | |
| 92 | + | x.xConnectFinish = 0 | |
| 93 | + | } else { | |
| 94 | + | x.xConnectFinish = purego.NewCallback(func(ProxyVarp uintptr, ResultVarp uintptr) uintptr { | |
| 95 | + | ret := cb(&ProxyBase{Ptr: ProxyVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 96 | + | if ret == nil { | |
| 97 | + | return 0 | |
| 98 | + | } | |
| 99 | + | return ret.GoPointer() | |
| 100 | + | }) | |
| 101 | + | } | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | // GetConnectFinish gets the callback function. | |
| 105 | + | func (x *ProxyInterface) GetConnectFinish() func(Proxy, AsyncResult) *IOStream { | |
| 106 | + | if x.xConnectFinish == 0 { | |
| 107 | + | return nil | |
| 108 | + | } | |
| 109 | + | var rawCallback func(ProxyVarp uintptr, ResultVarp uintptr) uintptr | |
| 110 | + | purego.RegisterFunc(&rawCallback, x.xConnectFinish) | |
| 111 | + | return func(ProxyVar Proxy, ResultVar AsyncResult) *IOStream { | |
| 112 | + | rawRet := rawCallback(ProxyVar.GoPointer(), ResultVar.GoPointer()) | |
| 113 | + | if rawRet == 0 { | |
| 114 | + | return nil | |
| 115 | + | } | |
| 116 | + | ret := &IOStream{} | |
| 117 | + | ret.Ptr = rawRet | |
| 118 | + | return ret | |
| 119 | + | } | |
| 120 | + | } | |
| 121 | + | ||
| 122 | + | // OverrideSupportsHostname sets the callback function. | |
| 123 | + | func (x *ProxyInterface) OverrideSupportsHostname(cb func(Proxy) bool) { | |
| 124 | + | if cb == nil { | |
| 125 | + | x.xSupportsHostname = 0 | |
| 126 | + | } else { | |
| 127 | + | x.xSupportsHostname = purego.NewCallback(func(ProxyVarp uintptr) bool { | |
| 128 | + | return cb(&ProxyBase{Ptr: ProxyVarp}) | |
| 129 | + | }) | |
| 130 | + | } | |
| 131 | + | } | |
| 132 | + | ||
| 133 | + | // GetSupportsHostname gets the callback function. | |
| 134 | + | func (x *ProxyInterface) GetSupportsHostname() func(Proxy) bool { | |
| 135 | + | if x.xSupportsHostname == 0 { | |
| 136 | + | return nil | |
| 137 | + | } | |
| 138 | + | var rawCallback func(ProxyVarp uintptr) bool | |
| 139 | + | purego.RegisterFunc(&rawCallback, x.xSupportsHostname) | |
| 140 | + | return func(ProxyVar Proxy) bool { | |
| 141 | + | return rawCallback(ProxyVar.GoPointer()) | |
| 142 | + | } | |
| 143 | + | } | |
| 144 | + | ||
| 25 | 145 | // A #GProxy handles connecting to a remote host via a given type of | |
| 26 | 146 | // proxy server. It is implemented by the 'gio-proxy' extension point. | |
| 27 | 147 | // The extensions are named after their proxy protocol name. As an | |
| @@ -31,9 +151,9 @@ func (x *ProxyInterface) GoPointer() uintptr { | |||
| 31 | 151 | type Proxy interface { | |
| 32 | 152 | GoPointer() uintptr | |
| 33 | 153 | SetGoPointer(uintptr) | |
| 34 | - | Connect(ConnectionVar *IOStream, ProxyAddressVar *ProxyAddress, CancellableVar *Cancellable) *IOStream | |
| 154 | + | Connect(ConnectionVar *IOStream, ProxyAddressVar *ProxyAddress, CancellableVar *Cancellable) (*IOStream, error) | |
| 35 | 155 | ConnectAsync(ConnectionVar *IOStream, ProxyAddressVar *ProxyAddress, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 36 | - | ConnectFinish(ResultVar AsyncResult) *IOStream | |
| 156 | + | ConnectFinish(ResultVar AsyncResult) (*IOStream, error) | |
| 37 | 157 | SupportsHostname() bool | |
| 38 | 158 | } | |
| 39 | 159 | ||
M v4/gio/gproxyaddress.go +1 -1
| @@ -14,7 +14,7 @@ import ( | |||
| 14 | 14 | type ProxyAddressClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass InetSocketAddressClass | |
| 18 | 18 | } | |
| 19 | 19 | ||
| 20 | 20 | func (x *ProxyAddressClass) GoPointer() uintptr { | |
M v4/gio/gproxyaddressenumerator.go +177 -1
| @@ -5,6 +5,7 @@ import ( | |||
| 5 | 5 | "structs" | |
| 6 | 6 | "unsafe" | |
| 7 | 7 | ||
| 8 | + | "github.com/jwijenbergh/purego" | |
| 8 | 9 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 9 | 10 | ) | |
| 10 | 11 | ||
| @@ -12,13 +13,188 @@ import ( | |||
| 12 | 13 | type ProxyAddressEnumeratorClass struct { | |
| 13 | 14 | _ structs.HostLayout | |
| 14 | 15 | ||
| 15 | - | ParentClass uintptr | |
| 16 | + | ParentClass SocketAddressEnumeratorClass | |
| 17 | + | ||
| 18 | + | xGReserved1 uintptr | |
| 19 | + | ||
| 20 | + | xGReserved2 uintptr | |
| 21 | + | ||
| 22 | + | xGReserved3 uintptr | |
| 23 | + | ||
| 24 | + | xGReserved4 uintptr | |
| 25 | + | ||
| 26 | + | xGReserved5 uintptr | |
| 27 | + | ||
| 28 | + | xGReserved6 uintptr | |
| 29 | + | ||
| 30 | + | xGReserved7 uintptr | |
| 16 | 31 | } | |
| 17 | 32 | ||
| 18 | 33 | func (x *ProxyAddressEnumeratorClass) GoPointer() uintptr { | |
| 19 | 34 | return uintptr(unsafe.Pointer(x)) | |
| 20 | 35 | } | |
| 21 | 36 | ||
| 37 | + | // OverrideGReserved1 sets the callback function. | |
| 38 | + | func (x *ProxyAddressEnumeratorClass) OverrideGReserved1(cb func()) { | |
| 39 | + | if cb == nil { | |
| 40 | + | x.xGReserved1 = 0 | |
| 41 | + | } else { | |
| 42 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 43 | + | cb() | |
| 44 | + | }) | |
| 45 | + | } | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | // GetGReserved1 gets the callback function. | |
| 49 | + | func (x *ProxyAddressEnumeratorClass) GetGReserved1() func() { | |
| 50 | + | if x.xGReserved1 == 0 { | |
| 51 | + | return nil | |
| 52 | + | } | |
| 53 | + | var rawCallback func() | |
| 54 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 55 | + | return func() { | |
| 56 | + | rawCallback() | |
| 57 | + | } | |
| 58 | + | } | |
| 59 | + | ||
| 60 | + | // OverrideGReserved2 sets the callback function. | |
| 61 | + | func (x *ProxyAddressEnumeratorClass) OverrideGReserved2(cb func()) { | |
| 62 | + | if cb == nil { | |
| 63 | + | x.xGReserved2 = 0 | |
| 64 | + | } else { | |
| 65 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 66 | + | cb() | |
| 67 | + | }) | |
| 68 | + | } | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | // GetGReserved2 gets the callback function. | |
| 72 | + | func (x *ProxyAddressEnumeratorClass) GetGReserved2() func() { | |
| 73 | + | if x.xGReserved2 == 0 { | |
| 74 | + | return nil | |
| 75 | + | } | |
| 76 | + | var rawCallback func() | |
| 77 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 78 | + | return func() { | |
| 79 | + | rawCallback() | |
| 80 | + | } | |
| 81 | + | } | |
| 82 | + | ||
| 83 | + | // OverrideGReserved3 sets the callback function. | |
| 84 | + | func (x *ProxyAddressEnumeratorClass) OverrideGReserved3(cb func()) { | |
| 85 | + | if cb == nil { | |
| 86 | + | x.xGReserved3 = 0 | |
| 87 | + | } else { | |
| 88 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 89 | + | cb() | |
| 90 | + | }) | |
| 91 | + | } | |
| 92 | + | } | |
| 93 | + | ||
| 94 | + | // GetGReserved3 gets the callback function. | |
| 95 | + | func (x *ProxyAddressEnumeratorClass) GetGReserved3() func() { | |
| 96 | + | if x.xGReserved3 == 0 { | |
| 97 | + | return nil | |
| 98 | + | } | |
| 99 | + | var rawCallback func() | |
| 100 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 101 | + | return func() { | |
| 102 | + | rawCallback() | |
| 103 | + | } | |
| 104 | + | } | |
| 105 | + | ||
| 106 | + | // OverrideGReserved4 sets the callback function. | |
| 107 | + | func (x *ProxyAddressEnumeratorClass) OverrideGReserved4(cb func()) { | |
| 108 | + | if cb == nil { | |
| 109 | + | x.xGReserved4 = 0 | |
| 110 | + | } else { | |
| 111 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 112 | + | cb() | |
| 113 | + | }) | |
| 114 | + | } | |
| 115 | + | } | |
| 116 | + | ||
| 117 | + | // GetGReserved4 gets the callback function. | |
| 118 | + | func (x *ProxyAddressEnumeratorClass) GetGReserved4() func() { | |
| 119 | + | if x.xGReserved4 == 0 { | |
| 120 | + | return nil | |
| 121 | + | } | |
| 122 | + | var rawCallback func() | |
| 123 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 124 | + | return func() { | |
| 125 | + | rawCallback() | |
| 126 | + | } | |
| 127 | + | } | |
| 128 | + | ||
| 129 | + | // OverrideGReserved5 sets the callback function. | |
| 130 | + | func (x *ProxyAddressEnumeratorClass) OverrideGReserved5(cb func()) { | |
| 131 | + | if cb == nil { | |
| 132 | + | x.xGReserved5 = 0 | |
| 133 | + | } else { | |
| 134 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 135 | + | cb() | |
| 136 | + | }) | |
| 137 | + | } | |
| 138 | + | } | |
| 139 | + | ||
| 140 | + | // GetGReserved5 gets the callback function. | |
| 141 | + | func (x *ProxyAddressEnumeratorClass) GetGReserved5() func() { | |
| 142 | + | if x.xGReserved5 == 0 { | |
| 143 | + | return nil | |
| 144 | + | } | |
| 145 | + | var rawCallback func() | |
| 146 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 147 | + | return func() { | |
| 148 | + | rawCallback() | |
| 149 | + | } | |
| 150 | + | } | |
| 151 | + | ||
| 152 | + | // OverrideGReserved6 sets the callback function. | |
| 153 | + | func (x *ProxyAddressEnumeratorClass) OverrideGReserved6(cb func()) { | |
| 154 | + | if cb == nil { | |
| 155 | + | x.xGReserved6 = 0 | |
| 156 | + | } else { | |
| 157 | + | x.xGReserved6 = purego.NewCallback(func() { | |
| 158 | + | cb() | |
| 159 | + | }) | |
| 160 | + | } | |
| 161 | + | } | |
| 162 | + | ||
| 163 | + | // GetGReserved6 gets the callback function. | |
| 164 | + | func (x *ProxyAddressEnumeratorClass) GetGReserved6() func() { | |
| 165 | + | if x.xGReserved6 == 0 { | |
| 166 | + | return nil | |
| 167 | + | } | |
| 168 | + | var rawCallback func() | |
| 169 | + | purego.RegisterFunc(&rawCallback, x.xGReserved6) | |
| 170 | + | return func() { | |
| 171 | + | rawCallback() | |
| 172 | + | } | |
| 173 | + | } | |
| 174 | + | ||
| 175 | + | // OverrideGReserved7 sets the callback function. | |
| 176 | + | func (x *ProxyAddressEnumeratorClass) OverrideGReserved7(cb func()) { | |
| 177 | + | if cb == nil { | |
| 178 | + | x.xGReserved7 = 0 | |
| 179 | + | } else { | |
| 180 | + | x.xGReserved7 = purego.NewCallback(func() { | |
| 181 | + | cb() | |
| 182 | + | }) | |
| 183 | + | } | |
| 184 | + | } | |
| 185 | + | ||
| 186 | + | // GetGReserved7 gets the callback function. | |
| 187 | + | func (x *ProxyAddressEnumeratorClass) GetGReserved7() func() { | |
| 188 | + | if x.xGReserved7 == 0 { | |
| 189 | + | return nil | |
| 190 | + | } | |
| 191 | + | var rawCallback func() | |
| 192 | + | purego.RegisterFunc(&rawCallback, x.xGReserved7) | |
| 193 | + | return func() { | |
| 194 | + | rawCallback() | |
| 195 | + | } | |
| 196 | + | } | |
| 197 | + | ||
| 22 | 198 | type ProxyAddressEnumeratorPrivate struct { | |
| 23 | 199 | _ structs.HostLayout | |
| 24 | 200 | } | |
M v4/gio/gproxyresolver.go +102 -2
| @@ -17,12 +17,112 @@ type ProxyResolverInterface struct { | |||
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | 19 | GIface uintptr | |
| 20 | + | ||
| 21 | + | xIsSupported uintptr | |
| 22 | + | ||
| 23 | + | xLookup uintptr | |
| 24 | + | ||
| 25 | + | xLookupAsync uintptr | |
| 26 | + | ||
| 27 | + | xLookupFinish uintptr | |
| 20 | 28 | } | |
| 21 | 29 | ||
| 22 | 30 | func (x *ProxyResolverInterface) GoPointer() uintptr { | |
| 23 | 31 | return uintptr(unsafe.Pointer(x)) | |
| 24 | 32 | } | |
| 25 | 33 | ||
| 34 | + | // OverrideIsSupported sets the callback function. | |
| 35 | + | func (x *ProxyResolverInterface) OverrideIsSupported(cb func(ProxyResolver) bool) { | |
| 36 | + | if cb == nil { | |
| 37 | + | x.xIsSupported = 0 | |
| 38 | + | } else { | |
| 39 | + | x.xIsSupported = purego.NewCallback(func(ResolverVarp uintptr) bool { | |
| 40 | + | return cb(&ProxyResolverBase{Ptr: ResolverVarp}) | |
| 41 | + | }) | |
| 42 | + | } | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | // GetIsSupported gets the callback function. | |
| 46 | + | func (x *ProxyResolverInterface) GetIsSupported() func(ProxyResolver) bool { | |
| 47 | + | if x.xIsSupported == 0 { | |
| 48 | + | return nil | |
| 49 | + | } | |
| 50 | + | var rawCallback func(ResolverVarp uintptr) bool | |
| 51 | + | purego.RegisterFunc(&rawCallback, x.xIsSupported) | |
| 52 | + | return func(ResolverVar ProxyResolver) bool { | |
| 53 | + | return rawCallback(ResolverVar.GoPointer()) | |
| 54 | + | } | |
| 55 | + | } | |
| 56 | + | ||
| 57 | + | // OverrideLookup sets the callback function. | |
| 58 | + | func (x *ProxyResolverInterface) OverrideLookup(cb func(ProxyResolver, string, *Cancellable) []string) { | |
| 59 | + | if cb == nil { | |
| 60 | + | x.xLookup = 0 | |
| 61 | + | } else { | |
| 62 | + | x.xLookup = purego.NewCallback(func(ResolverVarp uintptr, UriVarp string, CancellableVarp uintptr) []string { | |
| 63 | + | return cb(&ProxyResolverBase{Ptr: ResolverVarp}, UriVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 64 | + | }) | |
| 65 | + | } | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | // GetLookup gets the callback function. | |
| 69 | + | func (x *ProxyResolverInterface) GetLookup() func(ProxyResolver, string, *Cancellable) []string { | |
| 70 | + | if x.xLookup == 0 { | |
| 71 | + | return nil | |
| 72 | + | } | |
| 73 | + | var rawCallback func(ResolverVarp uintptr, UriVarp string, CancellableVarp uintptr) []string | |
| 74 | + | purego.RegisterFunc(&rawCallback, x.xLookup) | |
| 75 | + | return func(ResolverVar ProxyResolver, UriVar string, CancellableVar *Cancellable) []string { | |
| 76 | + | return rawCallback(ResolverVar.GoPointer(), UriVar, CancellableVar.GoPointer()) | |
| 77 | + | } | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | // OverrideLookupAsync sets the callback function. | |
| 81 | + | func (x *ProxyResolverInterface) OverrideLookupAsync(cb func(ProxyResolver, string, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 82 | + | if cb == nil { | |
| 83 | + | x.xLookupAsync = 0 | |
| 84 | + | } else { | |
| 85 | + | x.xLookupAsync = purego.NewCallback(func(ResolverVarp uintptr, UriVarp string, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 86 | + | cb(&ProxyResolverBase{Ptr: ResolverVarp}, UriVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 87 | + | }) | |
| 88 | + | } | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | // GetLookupAsync gets the callback function. | |
| 92 | + | func (x *ProxyResolverInterface) GetLookupAsync() func(ProxyResolver, string, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 93 | + | if x.xLookupAsync == 0 { | |
| 94 | + | return nil | |
| 95 | + | } | |
| 96 | + | var rawCallback func(ResolverVarp uintptr, UriVarp string, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 97 | + | purego.RegisterFunc(&rawCallback, x.xLookupAsync) | |
| 98 | + | return func(ResolverVar ProxyResolver, UriVar string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 99 | + | rawCallback(ResolverVar.GoPointer(), UriVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 100 | + | } | |
| 101 | + | } | |
| 102 | + | ||
| 103 | + | // OverrideLookupFinish sets the callback function. | |
| 104 | + | func (x *ProxyResolverInterface) OverrideLookupFinish(cb func(ProxyResolver, AsyncResult) []string) { | |
| 105 | + | if cb == nil { | |
| 106 | + | x.xLookupFinish = 0 | |
| 107 | + | } else { | |
| 108 | + | x.xLookupFinish = purego.NewCallback(func(ResolverVarp uintptr, ResultVarp uintptr) []string { | |
| 109 | + | return cb(&ProxyResolverBase{Ptr: ResolverVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 110 | + | }) | |
| 111 | + | } | |
| 112 | + | } | |
| 113 | + | ||
| 114 | + | // GetLookupFinish gets the callback function. | |
| 115 | + | func (x *ProxyResolverInterface) GetLookupFinish() func(ProxyResolver, AsyncResult) []string { | |
| 116 | + | if x.xLookupFinish == 0 { | |
| 117 | + | return nil | |
| 118 | + | } | |
| 119 | + | var rawCallback func(ResolverVarp uintptr, ResultVarp uintptr) []string | |
| 120 | + | purego.RegisterFunc(&rawCallback, x.xLookupFinish) | |
| 121 | + | return func(ResolverVar ProxyResolver, ResultVar AsyncResult) []string { | |
| 122 | + | return rawCallback(ResolverVar.GoPointer(), ResultVar.GoPointer()) | |
| 123 | + | } | |
| 124 | + | } | |
| 125 | + | ||
| 26 | 126 | // #GProxyResolver provides synchronous and asynchronous network proxy | |
| 27 | 127 | // resolution. #GProxyResolver is used within #GSocketClient through | |
| 28 | 128 | // the method g_socket_connectable_proxy_enumerate(). | |
| @@ -34,9 +134,9 @@ type ProxyResolver interface { | |||
| 34 | 134 | GoPointer() uintptr | |
| 35 | 135 | SetGoPointer(uintptr) | |
| 36 | 136 | IsSupported() bool | |
| 37 | - | Lookup(UriVar string, CancellableVar *Cancellable) []string | |
| 137 | + | Lookup(UriVar string, CancellableVar *Cancellable) ([]string, error) | |
| 38 | 138 | LookupAsync(UriVar string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 39 | - | LookupFinish(ResultVar AsyncResult) []string | |
| 139 | + | LookupFinish(ResultVar AsyncResult) ([]string, error) | |
| 40 | 140 | } | |
| 41 | 141 | ||
| 42 | 142 | var xProxyResolverGLibType func() types.GType | |
M v4/gio/gremoteactiongroup.go +50 -0
| @@ -16,12 +16,62 @@ type RemoteActionGroupInterface struct { | |||
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | 18 | GIface uintptr | |
| 19 | + | ||
| 20 | + | xActivateActionFull uintptr | |
| 21 | + | ||
| 22 | + | xChangeActionStateFull uintptr | |
| 19 | 23 | } | |
| 20 | 24 | ||
| 21 | 25 | func (x *RemoteActionGroupInterface) GoPointer() uintptr { | |
| 22 | 26 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 27 | } | |
| 24 | 28 | ||
| 29 | + | // OverrideActivateActionFull sets the callback function. | |
| 30 | + | func (x *RemoteActionGroupInterface) OverrideActivateActionFull(cb func(RemoteActionGroup, string, *glib.Variant, *glib.Variant)) { | |
| 31 | + | if cb == nil { | |
| 32 | + | x.xActivateActionFull = 0 | |
| 33 | + | } else { | |
| 34 | + | x.xActivateActionFull = purego.NewCallback(func(RemoteVarp uintptr, ActionNameVarp string, ParameterVarp *glib.Variant, PlatformDataVarp *glib.Variant) { | |
| 35 | + | cb(&RemoteActionGroupBase{Ptr: RemoteVarp}, ActionNameVarp, ParameterVarp, PlatformDataVarp) | |
| 36 | + | }) | |
| 37 | + | } | |
| 38 | + | } | |
| 39 | + | ||
| 40 | + | // GetActivateActionFull gets the callback function. | |
| 41 | + | func (x *RemoteActionGroupInterface) GetActivateActionFull() func(RemoteActionGroup, string, *glib.Variant, *glib.Variant) { | |
| 42 | + | if x.xActivateActionFull == 0 { | |
| 43 | + | return nil | |
| 44 | + | } | |
| 45 | + | var rawCallback func(RemoteVarp uintptr, ActionNameVarp string, ParameterVarp *glib.Variant, PlatformDataVarp *glib.Variant) | |
| 46 | + | purego.RegisterFunc(&rawCallback, x.xActivateActionFull) | |
| 47 | + | return func(RemoteVar RemoteActionGroup, ActionNameVar string, ParameterVar *glib.Variant, PlatformDataVar *glib.Variant) { | |
| 48 | + | rawCallback(RemoteVar.GoPointer(), ActionNameVar, ParameterVar, PlatformDataVar) | |
| 49 | + | } | |
| 50 | + | } | |
| 51 | + | ||
| 52 | + | // OverrideChangeActionStateFull sets the callback function. | |
| 53 | + | func (x *RemoteActionGroupInterface) OverrideChangeActionStateFull(cb func(RemoteActionGroup, string, *glib.Variant, *glib.Variant)) { | |
| 54 | + | if cb == nil { | |
| 55 | + | x.xChangeActionStateFull = 0 | |
| 56 | + | } else { | |
| 57 | + | x.xChangeActionStateFull = purego.NewCallback(func(RemoteVarp uintptr, ActionNameVarp string, ValueVarp *glib.Variant, PlatformDataVarp *glib.Variant) { | |
| 58 | + | cb(&RemoteActionGroupBase{Ptr: RemoteVarp}, ActionNameVarp, ValueVarp, PlatformDataVarp) | |
| 59 | + | }) | |
| 60 | + | } | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // GetChangeActionStateFull gets the callback function. | |
| 64 | + | func (x *RemoteActionGroupInterface) GetChangeActionStateFull() func(RemoteActionGroup, string, *glib.Variant, *glib.Variant) { | |
| 65 | + | if x.xChangeActionStateFull == 0 { | |
| 66 | + | return nil | |
| 67 | + | } | |
| 68 | + | var rawCallback func(RemoteVarp uintptr, ActionNameVarp string, ValueVarp *glib.Variant, PlatformDataVarp *glib.Variant) | |
| 69 | + | purego.RegisterFunc(&rawCallback, x.xChangeActionStateFull) | |
| 70 | + | return func(RemoteVar RemoteActionGroup, ActionNameVar string, ValueVar *glib.Variant, PlatformDataVar *glib.Variant) { | |
| 71 | + | rawCallback(RemoteVar.GoPointer(), ActionNameVar, ValueVar, PlatformDataVar) | |
| 72 | + | } | |
| 73 | + | } | |
| 74 | + | ||
| 25 | 75 | // The GRemoteActionGroup interface is implemented by #GActionGroup | |
| 26 | 76 | // instances that either transmit action invocations to other processes | |
| 27 | 77 | // or receive action invocations in the local process from other | |
M v4/gio/gresolver.go +401 -1
| @@ -15,13 +15,413 @@ import ( | |||
| 15 | 15 | type ResolverClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xReload uintptr | |
| 21 | + | ||
| 22 | + | xLookupByName uintptr | |
| 23 | + | ||
| 24 | + | xLookupByNameAsync uintptr | |
| 25 | + | ||
| 26 | + | xLookupByNameFinish uintptr | |
| 27 | + | ||
| 28 | + | xLookupByAddress uintptr | |
| 29 | + | ||
| 30 | + | xLookupByAddressAsync uintptr | |
| 31 | + | ||
| 32 | + | xLookupByAddressFinish uintptr | |
| 33 | + | ||
| 34 | + | xLookupService uintptr | |
| 35 | + | ||
| 36 | + | xLookupServiceAsync uintptr | |
| 37 | + | ||
| 38 | + | xLookupServiceFinish uintptr | |
| 39 | + | ||
| 40 | + | xLookupRecords uintptr | |
| 41 | + | ||
| 42 | + | xLookupRecordsAsync uintptr | |
| 43 | + | ||
| 44 | + | xLookupRecordsFinish uintptr | |
| 45 | + | ||
| 46 | + | xLookupByNameWithFlagsAsync uintptr | |
| 47 | + | ||
| 48 | + | xLookupByNameWithFlagsFinish uintptr | |
| 49 | + | ||
| 50 | + | xLookupByNameWithFlags uintptr | |
| 19 | 51 | } | |
| 20 | 52 | ||
| 21 | 53 | func (x *ResolverClass) GoPointer() uintptr { | |
| 22 | 54 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 55 | } | |
| 24 | 56 | ||
| 57 | + | // OverrideReload sets the callback function. | |
| 58 | + | func (x *ResolverClass) OverrideReload(cb func(*Resolver)) { | |
| 59 | + | if cb == nil { | |
| 60 | + | x.xReload = 0 | |
| 61 | + | } else { | |
| 62 | + | x.xReload = purego.NewCallback(func(ResolverVarp uintptr) { | |
| 63 | + | cb(ResolverNewFromInternalPtr(ResolverVarp)) | |
| 64 | + | }) | |
| 65 | + | } | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | // GetReload gets the callback function. | |
| 69 | + | func (x *ResolverClass) GetReload() func(*Resolver) { | |
| 70 | + | if x.xReload == 0 { | |
| 71 | + | return nil | |
| 72 | + | } | |
| 73 | + | var rawCallback func(ResolverVarp uintptr) | |
| 74 | + | purego.RegisterFunc(&rawCallback, x.xReload) | |
| 75 | + | return func(ResolverVar *Resolver) { | |
| 76 | + | rawCallback(ResolverVar.GoPointer()) | |
| 77 | + | } | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | // OverrideLookupByName sets the callback function. | |
| 81 | + | func (x *ResolverClass) OverrideLookupByName(cb func(*Resolver, string, *Cancellable) *glib.List) { | |
| 82 | + | if cb == nil { | |
| 83 | + | x.xLookupByName = 0 | |
| 84 | + | } else { | |
| 85 | + | x.xLookupByName = purego.NewCallback(func(ResolverVarp uintptr, HostnameVarp string, CancellableVarp uintptr) *glib.List { | |
| 86 | + | return cb(ResolverNewFromInternalPtr(ResolverVarp), HostnameVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 87 | + | }) | |
| 88 | + | } | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | // GetLookupByName gets the callback function. | |
| 92 | + | func (x *ResolverClass) GetLookupByName() func(*Resolver, string, *Cancellable) *glib.List { | |
| 93 | + | if x.xLookupByName == 0 { | |
| 94 | + | return nil | |
| 95 | + | } | |
| 96 | + | var rawCallback func(ResolverVarp uintptr, HostnameVarp string, CancellableVarp uintptr) *glib.List | |
| 97 | + | purego.RegisterFunc(&rawCallback, x.xLookupByName) | |
| 98 | + | return func(ResolverVar *Resolver, HostnameVar string, CancellableVar *Cancellable) *glib.List { | |
| 99 | + | return rawCallback(ResolverVar.GoPointer(), HostnameVar, CancellableVar.GoPointer()) | |
| 100 | + | } | |
| 101 | + | } | |
| 102 | + | ||
| 103 | + | // OverrideLookupByNameAsync sets the callback function. | |
| 104 | + | func (x *ResolverClass) OverrideLookupByNameAsync(cb func(*Resolver, string, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 105 | + | if cb == nil { | |
| 106 | + | x.xLookupByNameAsync = 0 | |
| 107 | + | } else { | |
| 108 | + | x.xLookupByNameAsync = purego.NewCallback(func(ResolverVarp uintptr, HostnameVarp string, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 109 | + | cb(ResolverNewFromInternalPtr(ResolverVarp), HostnameVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 110 | + | }) | |
| 111 | + | } | |
| 112 | + | } | |
| 113 | + | ||
| 114 | + | // GetLookupByNameAsync gets the callback function. | |
| 115 | + | func (x *ResolverClass) GetLookupByNameAsync() func(*Resolver, string, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 116 | + | if x.xLookupByNameAsync == 0 { | |
| 117 | + | return nil | |
| 118 | + | } | |
| 119 | + | var rawCallback func(ResolverVarp uintptr, HostnameVarp string, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 120 | + | purego.RegisterFunc(&rawCallback, x.xLookupByNameAsync) | |
| 121 | + | return func(ResolverVar *Resolver, HostnameVar string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 122 | + | rawCallback(ResolverVar.GoPointer(), HostnameVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 123 | + | } | |
| 124 | + | } | |
| 125 | + | ||
| 126 | + | // OverrideLookupByNameFinish sets the callback function. | |
| 127 | + | func (x *ResolverClass) OverrideLookupByNameFinish(cb func(*Resolver, AsyncResult) *glib.List) { | |
| 128 | + | if cb == nil { | |
| 129 | + | x.xLookupByNameFinish = 0 | |
| 130 | + | } else { | |
| 131 | + | x.xLookupByNameFinish = purego.NewCallback(func(ResolverVarp uintptr, ResultVarp uintptr) *glib.List { | |
| 132 | + | return cb(ResolverNewFromInternalPtr(ResolverVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 133 | + | }) | |
| 134 | + | } | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | // GetLookupByNameFinish gets the callback function. | |
| 138 | + | func (x *ResolverClass) GetLookupByNameFinish() func(*Resolver, AsyncResult) *glib.List { | |
| 139 | + | if x.xLookupByNameFinish == 0 { | |
| 140 | + | return nil | |
| 141 | + | } | |
| 142 | + | var rawCallback func(ResolverVarp uintptr, ResultVarp uintptr) *glib.List | |
| 143 | + | purego.RegisterFunc(&rawCallback, x.xLookupByNameFinish) | |
| 144 | + | return func(ResolverVar *Resolver, ResultVar AsyncResult) *glib.List { | |
| 145 | + | return rawCallback(ResolverVar.GoPointer(), ResultVar.GoPointer()) | |
| 146 | + | } | |
| 147 | + | } | |
| 148 | + | ||
| 149 | + | // OverrideLookupByAddress sets the callback function. | |
| 150 | + | func (x *ResolverClass) OverrideLookupByAddress(cb func(*Resolver, *InetAddress, *Cancellable) string) { | |
| 151 | + | if cb == nil { | |
| 152 | + | x.xLookupByAddress = 0 | |
| 153 | + | } else { | |
| 154 | + | x.xLookupByAddress = purego.NewCallback(func(ResolverVarp uintptr, AddressVarp uintptr, CancellableVarp uintptr) string { | |
| 155 | + | return cb(ResolverNewFromInternalPtr(ResolverVarp), InetAddressNewFromInternalPtr(AddressVarp), CancellableNewFromInternalPtr(CancellableVarp)) | |
| 156 | + | }) | |
| 157 | + | } | |
| 158 | + | } | |
| 159 | + | ||
| 160 | + | // GetLookupByAddress gets the callback function. | |
| 161 | + | func (x *ResolverClass) GetLookupByAddress() func(*Resolver, *InetAddress, *Cancellable) string { | |
| 162 | + | if x.xLookupByAddress == 0 { | |
| 163 | + | return nil | |
| 164 | + | } | |
| 165 | + | var rawCallback func(ResolverVarp uintptr, AddressVarp uintptr, CancellableVarp uintptr) string | |
| 166 | + | purego.RegisterFunc(&rawCallback, x.xLookupByAddress) | |
| 167 | + | return func(ResolverVar *Resolver, AddressVar *InetAddress, CancellableVar *Cancellable) string { | |
| 168 | + | return rawCallback(ResolverVar.GoPointer(), AddressVar.GoPointer(), CancellableVar.GoPointer()) | |
| 169 | + | } | |
| 170 | + | } | |
| 171 | + | ||
| 172 | + | // OverrideLookupByAddressAsync sets the callback function. | |
| 173 | + | func (x *ResolverClass) OverrideLookupByAddressAsync(cb func(*Resolver, *InetAddress, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 174 | + | if cb == nil { | |
| 175 | + | x.xLookupByAddressAsync = 0 | |
| 176 | + | } else { | |
| 177 | + | x.xLookupByAddressAsync = purego.NewCallback(func(ResolverVarp uintptr, AddressVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 178 | + | cb(ResolverNewFromInternalPtr(ResolverVarp), InetAddressNewFromInternalPtr(AddressVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 179 | + | }) | |
| 180 | + | } | |
| 181 | + | } | |
| 182 | + | ||
| 183 | + | // GetLookupByAddressAsync gets the callback function. | |
| 184 | + | func (x *ResolverClass) GetLookupByAddressAsync() func(*Resolver, *InetAddress, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 185 | + | if x.xLookupByAddressAsync == 0 { | |
| 186 | + | return nil | |
| 187 | + | } | |
| 188 | + | var rawCallback func(ResolverVarp uintptr, AddressVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 189 | + | purego.RegisterFunc(&rawCallback, x.xLookupByAddressAsync) | |
| 190 | + | return func(ResolverVar *Resolver, AddressVar *InetAddress, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 191 | + | rawCallback(ResolverVar.GoPointer(), AddressVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 192 | + | } | |
| 193 | + | } | |
| 194 | + | ||
| 195 | + | // OverrideLookupByAddressFinish sets the callback function. | |
| 196 | + | func (x *ResolverClass) OverrideLookupByAddressFinish(cb func(*Resolver, AsyncResult) string) { | |
| 197 | + | if cb == nil { | |
| 198 | + | x.xLookupByAddressFinish = 0 | |
| 199 | + | } else { | |
| 200 | + | x.xLookupByAddressFinish = purego.NewCallback(func(ResolverVarp uintptr, ResultVarp uintptr) string { | |
| 201 | + | return cb(ResolverNewFromInternalPtr(ResolverVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 202 | + | }) | |
| 203 | + | } | |
| 204 | + | } | |
| 205 | + | ||
| 206 | + | // GetLookupByAddressFinish gets the callback function. | |
| 207 | + | func (x *ResolverClass) GetLookupByAddressFinish() func(*Resolver, AsyncResult) string { | |
| 208 | + | if x.xLookupByAddressFinish == 0 { | |
| 209 | + | return nil | |
| 210 | + | } | |
| 211 | + | var rawCallback func(ResolverVarp uintptr, ResultVarp uintptr) string | |
| 212 | + | purego.RegisterFunc(&rawCallback, x.xLookupByAddressFinish) | |
| 213 | + | return func(ResolverVar *Resolver, ResultVar AsyncResult) string { | |
| 214 | + | return rawCallback(ResolverVar.GoPointer(), ResultVar.GoPointer()) | |
| 215 | + | } | |
| 216 | + | } | |
| 217 | + | ||
| 218 | + | // OverrideLookupService sets the callback function. | |
| 219 | + | func (x *ResolverClass) OverrideLookupService(cb func(*Resolver, string, *Cancellable) *glib.List) { | |
| 220 | + | if cb == nil { | |
| 221 | + | x.xLookupService = 0 | |
| 222 | + | } else { | |
| 223 | + | x.xLookupService = purego.NewCallback(func(ResolverVarp uintptr, RrnameVarp string, CancellableVarp uintptr) *glib.List { | |
| 224 | + | return cb(ResolverNewFromInternalPtr(ResolverVarp), RrnameVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 225 | + | }) | |
| 226 | + | } | |
| 227 | + | } | |
| 228 | + | ||
| 229 | + | // GetLookupService gets the callback function. | |
| 230 | + | func (x *ResolverClass) GetLookupService() func(*Resolver, string, *Cancellable) *glib.List { | |
| 231 | + | if x.xLookupService == 0 { | |
| 232 | + | return nil | |
| 233 | + | } | |
| 234 | + | var rawCallback func(ResolverVarp uintptr, RrnameVarp string, CancellableVarp uintptr) *glib.List | |
| 235 | + | purego.RegisterFunc(&rawCallback, x.xLookupService) | |
| 236 | + | return func(ResolverVar *Resolver, RrnameVar string, CancellableVar *Cancellable) *glib.List { | |
| 237 | + | return rawCallback(ResolverVar.GoPointer(), RrnameVar, CancellableVar.GoPointer()) | |
| 238 | + | } | |
| 239 | + | } | |
| 240 | + | ||
| 241 | + | // OverrideLookupServiceAsync sets the callback function. | |
| 242 | + | func (x *ResolverClass) OverrideLookupServiceAsync(cb func(*Resolver, string, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 243 | + | if cb == nil { | |
| 244 | + | x.xLookupServiceAsync = 0 | |
| 245 | + | } else { | |
| 246 | + | x.xLookupServiceAsync = purego.NewCallback(func(ResolverVarp uintptr, RrnameVarp string, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 247 | + | cb(ResolverNewFromInternalPtr(ResolverVarp), RrnameVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 248 | + | }) | |
| 249 | + | } | |
| 250 | + | } | |
| 251 | + | ||
| 252 | + | // GetLookupServiceAsync gets the callback function. | |
| 253 | + | func (x *ResolverClass) GetLookupServiceAsync() func(*Resolver, string, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 254 | + | if x.xLookupServiceAsync == 0 { | |
| 255 | + | return nil | |
| 256 | + | } | |
| 257 | + | var rawCallback func(ResolverVarp uintptr, RrnameVarp string, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 258 | + | purego.RegisterFunc(&rawCallback, x.xLookupServiceAsync) | |
| 259 | + | return func(ResolverVar *Resolver, RrnameVar string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 260 | + | rawCallback(ResolverVar.GoPointer(), RrnameVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 261 | + | } | |
| 262 | + | } | |
| 263 | + | ||
| 264 | + | // OverrideLookupServiceFinish sets the callback function. | |
| 265 | + | func (x *ResolverClass) OverrideLookupServiceFinish(cb func(*Resolver, AsyncResult) *glib.List) { | |
| 266 | + | if cb == nil { | |
| 267 | + | x.xLookupServiceFinish = 0 | |
| 268 | + | } else { | |
| 269 | + | x.xLookupServiceFinish = purego.NewCallback(func(ResolverVarp uintptr, ResultVarp uintptr) *glib.List { | |
| 270 | + | return cb(ResolverNewFromInternalPtr(ResolverVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 271 | + | }) | |
| 272 | + | } | |
| 273 | + | } | |
| 274 | + | ||
| 275 | + | // GetLookupServiceFinish gets the callback function. | |
| 276 | + | func (x *ResolverClass) GetLookupServiceFinish() func(*Resolver, AsyncResult) *glib.List { | |
| 277 | + | if x.xLookupServiceFinish == 0 { | |
| 278 | + | return nil | |
| 279 | + | } | |
| 280 | + | var rawCallback func(ResolverVarp uintptr, ResultVarp uintptr) *glib.List | |
| 281 | + | purego.RegisterFunc(&rawCallback, x.xLookupServiceFinish) | |
| 282 | + | return func(ResolverVar *Resolver, ResultVar AsyncResult) *glib.List { | |
| 283 | + | return rawCallback(ResolverVar.GoPointer(), ResultVar.GoPointer()) | |
| 284 | + | } | |
| 285 | + | } | |
| 286 | + | ||
| 287 | + | // OverrideLookupRecords sets the callback function. | |
| 288 | + | func (x *ResolverClass) OverrideLookupRecords(cb func(*Resolver, string, ResolverRecordType, *Cancellable) *glib.List) { | |
| 289 | + | if cb == nil { | |
| 290 | + | x.xLookupRecords = 0 | |
| 291 | + | } else { | |
| 292 | + | x.xLookupRecords = purego.NewCallback(func(ResolverVarp uintptr, RrnameVarp string, RecordTypeVarp ResolverRecordType, CancellableVarp uintptr) *glib.List { | |
| 293 | + | return cb(ResolverNewFromInternalPtr(ResolverVarp), RrnameVarp, RecordTypeVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 294 | + | }) | |
| 295 | + | } | |
| 296 | + | } | |
| 297 | + | ||
| 298 | + | // GetLookupRecords gets the callback function. | |
| 299 | + | func (x *ResolverClass) GetLookupRecords() func(*Resolver, string, ResolverRecordType, *Cancellable) *glib.List { | |
| 300 | + | if x.xLookupRecords == 0 { | |
| 301 | + | return nil | |
| 302 | + | } | |
| 303 | + | var rawCallback func(ResolverVarp uintptr, RrnameVarp string, RecordTypeVarp ResolverRecordType, CancellableVarp uintptr) *glib.List | |
| 304 | + | purego.RegisterFunc(&rawCallback, x.xLookupRecords) | |
| 305 | + | return func(ResolverVar *Resolver, RrnameVar string, RecordTypeVar ResolverRecordType, CancellableVar *Cancellable) *glib.List { | |
| 306 | + | return rawCallback(ResolverVar.GoPointer(), RrnameVar, RecordTypeVar, CancellableVar.GoPointer()) | |
| 307 | + | } | |
| 308 | + | } | |
| 309 | + | ||
| 310 | + | // OverrideLookupRecordsAsync sets the callback function. | |
| 311 | + | func (x *ResolverClass) OverrideLookupRecordsAsync(cb func(*Resolver, string, ResolverRecordType, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 312 | + | if cb == nil { | |
| 313 | + | x.xLookupRecordsAsync = 0 | |
| 314 | + | } else { | |
| 315 | + | x.xLookupRecordsAsync = purego.NewCallback(func(ResolverVarp uintptr, RrnameVarp string, RecordTypeVarp ResolverRecordType, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 316 | + | cb(ResolverNewFromInternalPtr(ResolverVarp), RrnameVarp, RecordTypeVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 317 | + | }) | |
| 318 | + | } | |
| 319 | + | } | |
| 320 | + | ||
| 321 | + | // GetLookupRecordsAsync gets the callback function. | |
| 322 | + | func (x *ResolverClass) GetLookupRecordsAsync() func(*Resolver, string, ResolverRecordType, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 323 | + | if x.xLookupRecordsAsync == 0 { | |
| 324 | + | return nil | |
| 325 | + | } | |
| 326 | + | var rawCallback func(ResolverVarp uintptr, RrnameVarp string, RecordTypeVarp ResolverRecordType, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 327 | + | purego.RegisterFunc(&rawCallback, x.xLookupRecordsAsync) | |
| 328 | + | return func(ResolverVar *Resolver, RrnameVar string, RecordTypeVar ResolverRecordType, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 329 | + | rawCallback(ResolverVar.GoPointer(), RrnameVar, RecordTypeVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 330 | + | } | |
| 331 | + | } | |
| 332 | + | ||
| 333 | + | // OverrideLookupRecordsFinish sets the callback function. | |
| 334 | + | func (x *ResolverClass) OverrideLookupRecordsFinish(cb func(*Resolver, AsyncResult) *glib.List) { | |
| 335 | + | if cb == nil { | |
| 336 | + | x.xLookupRecordsFinish = 0 | |
| 337 | + | } else { | |
| 338 | + | x.xLookupRecordsFinish = purego.NewCallback(func(ResolverVarp uintptr, ResultVarp uintptr) *glib.List { | |
| 339 | + | return cb(ResolverNewFromInternalPtr(ResolverVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 340 | + | }) | |
| 341 | + | } | |
| 342 | + | } | |
| 343 | + | ||
| 344 | + | // GetLookupRecordsFinish gets the callback function. | |
| 345 | + | func (x *ResolverClass) GetLookupRecordsFinish() func(*Resolver, AsyncResult) *glib.List { | |
| 346 | + | if x.xLookupRecordsFinish == 0 { | |
| 347 | + | return nil | |
| 348 | + | } | |
| 349 | + | var rawCallback func(ResolverVarp uintptr, ResultVarp uintptr) *glib.List | |
| 350 | + | purego.RegisterFunc(&rawCallback, x.xLookupRecordsFinish) | |
| 351 | + | return func(ResolverVar *Resolver, ResultVar AsyncResult) *glib.List { | |
| 352 | + | return rawCallback(ResolverVar.GoPointer(), ResultVar.GoPointer()) | |
| 353 | + | } | |
| 354 | + | } | |
| 355 | + | ||
| 356 | + | // OverrideLookupByNameWithFlagsAsync sets the callback function. | |
| 357 | + | func (x *ResolverClass) OverrideLookupByNameWithFlagsAsync(cb func(*Resolver, string, ResolverNameLookupFlags, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 358 | + | if cb == nil { | |
| 359 | + | x.xLookupByNameWithFlagsAsync = 0 | |
| 360 | + | } else { | |
| 361 | + | x.xLookupByNameWithFlagsAsync = purego.NewCallback(func(ResolverVarp uintptr, HostnameVarp string, FlagsVarp ResolverNameLookupFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 362 | + | cb(ResolverNewFromInternalPtr(ResolverVarp), HostnameVarp, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 363 | + | }) | |
| 364 | + | } | |
| 365 | + | } | |
| 366 | + | ||
| 367 | + | // GetLookupByNameWithFlagsAsync gets the callback function. | |
| 368 | + | func (x *ResolverClass) GetLookupByNameWithFlagsAsync() func(*Resolver, string, ResolverNameLookupFlags, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 369 | + | if x.xLookupByNameWithFlagsAsync == 0 { | |
| 370 | + | return nil | |
| 371 | + | } | |
| 372 | + | var rawCallback func(ResolverVarp uintptr, HostnameVarp string, FlagsVarp ResolverNameLookupFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 373 | + | purego.RegisterFunc(&rawCallback, x.xLookupByNameWithFlagsAsync) | |
| 374 | + | return func(ResolverVar *Resolver, HostnameVar string, FlagsVar ResolverNameLookupFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 375 | + | rawCallback(ResolverVar.GoPointer(), HostnameVar, FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 376 | + | } | |
| 377 | + | } | |
| 378 | + | ||
| 379 | + | // OverrideLookupByNameWithFlagsFinish sets the callback function. | |
| 380 | + | func (x *ResolverClass) OverrideLookupByNameWithFlagsFinish(cb func(*Resolver, AsyncResult) *glib.List) { | |
| 381 | + | if cb == nil { | |
| 382 | + | x.xLookupByNameWithFlagsFinish = 0 | |
| 383 | + | } else { | |
| 384 | + | x.xLookupByNameWithFlagsFinish = purego.NewCallback(func(ResolverVarp uintptr, ResultVarp uintptr) *glib.List { | |
| 385 | + | return cb(ResolverNewFromInternalPtr(ResolverVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 386 | + | }) | |
| 387 | + | } | |
| 388 | + | } | |
| 389 | + | ||
| 390 | + | // GetLookupByNameWithFlagsFinish gets the callback function. | |
| 391 | + | func (x *ResolverClass) GetLookupByNameWithFlagsFinish() func(*Resolver, AsyncResult) *glib.List { | |
| 392 | + | if x.xLookupByNameWithFlagsFinish == 0 { | |
| 393 | + | return nil | |
| 394 | + | } | |
| 395 | + | var rawCallback func(ResolverVarp uintptr, ResultVarp uintptr) *glib.List | |
| 396 | + | purego.RegisterFunc(&rawCallback, x.xLookupByNameWithFlagsFinish) | |
| 397 | + | return func(ResolverVar *Resolver, ResultVar AsyncResult) *glib.List { | |
| 398 | + | return rawCallback(ResolverVar.GoPointer(), ResultVar.GoPointer()) | |
| 399 | + | } | |
| 400 | + | } | |
| 401 | + | ||
| 402 | + | // OverrideLookupByNameWithFlags sets the callback function. | |
| 403 | + | func (x *ResolverClass) OverrideLookupByNameWithFlags(cb func(*Resolver, string, ResolverNameLookupFlags, *Cancellable) *glib.List) { | |
| 404 | + | if cb == nil { | |
| 405 | + | x.xLookupByNameWithFlags = 0 | |
| 406 | + | } else { | |
| 407 | + | x.xLookupByNameWithFlags = purego.NewCallback(func(ResolverVarp uintptr, HostnameVarp string, FlagsVarp ResolverNameLookupFlags, CancellableVarp uintptr) *glib.List { | |
| 408 | + | return cb(ResolverNewFromInternalPtr(ResolverVarp), HostnameVarp, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 409 | + | }) | |
| 410 | + | } | |
| 411 | + | } | |
| 412 | + | ||
| 413 | + | // GetLookupByNameWithFlags gets the callback function. | |
| 414 | + | func (x *ResolverClass) GetLookupByNameWithFlags() func(*Resolver, string, ResolverNameLookupFlags, *Cancellable) *glib.List { | |
| 415 | + | if x.xLookupByNameWithFlags == 0 { | |
| 416 | + | return nil | |
| 417 | + | } | |
| 418 | + | var rawCallback func(ResolverVarp uintptr, HostnameVarp string, FlagsVarp ResolverNameLookupFlags, CancellableVarp uintptr) *glib.List | |
| 419 | + | purego.RegisterFunc(&rawCallback, x.xLookupByNameWithFlags) | |
| 420 | + | return func(ResolverVar *Resolver, HostnameVar string, FlagsVar ResolverNameLookupFlags, CancellableVar *Cancellable) *glib.List { | |
| 421 | + | return rawCallback(ResolverVar.GoPointer(), HostnameVar, FlagsVar, CancellableVar.GoPointer()) | |
| 422 | + | } | |
| 423 | + | } | |
| 424 | + | ||
| 25 | 425 | type ResolverPrivate struct { | |
| 26 | 426 | _ structs.HostLayout | |
| 27 | 427 | } | |
M v4/gio/gseekable.go +127 -2
| @@ -16,12 +16,137 @@ type SeekableIface struct { | |||
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | 18 | GIface uintptr | |
| 19 | + | ||
| 20 | + | xTell uintptr | |
| 21 | + | ||
| 22 | + | xCanSeek uintptr | |
| 23 | + | ||
| 24 | + | xSeek uintptr | |
| 25 | + | ||
| 26 | + | xCanTruncate uintptr | |
| 27 | + | ||
| 28 | + | xTruncateFn uintptr | |
| 19 | 29 | } | |
| 20 | 30 | ||
| 21 | 31 | func (x *SeekableIface) GoPointer() uintptr { | |
| 22 | 32 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 33 | } | |
| 24 | 34 | ||
| 35 | + | // OverrideTell sets the callback function. | |
| 36 | + | func (x *SeekableIface) OverrideTell(cb func(Seekable) int64) { | |
| 37 | + | if cb == nil { | |
| 38 | + | x.xTell = 0 | |
| 39 | + | } else { | |
| 40 | + | x.xTell = purego.NewCallback(func(SeekableVarp uintptr) int64 { | |
| 41 | + | return cb(&SeekableBase{Ptr: SeekableVarp}) | |
| 42 | + | }) | |
| 43 | + | } | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | // GetTell gets the callback function. | |
| 47 | + | func (x *SeekableIface) GetTell() func(Seekable) int64 { | |
| 48 | + | if x.xTell == 0 { | |
| 49 | + | return nil | |
| 50 | + | } | |
| 51 | + | var rawCallback func(SeekableVarp uintptr) int64 | |
| 52 | + | purego.RegisterFunc(&rawCallback, x.xTell) | |
| 53 | + | return func(SeekableVar Seekable) int64 { | |
| 54 | + | return rawCallback(SeekableVar.GoPointer()) | |
| 55 | + | } | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | // OverrideCanSeek sets the callback function. | |
| 59 | + | func (x *SeekableIface) OverrideCanSeek(cb func(Seekable) bool) { | |
| 60 | + | if cb == nil { | |
| 61 | + | x.xCanSeek = 0 | |
| 62 | + | } else { | |
| 63 | + | x.xCanSeek = purego.NewCallback(func(SeekableVarp uintptr) bool { | |
| 64 | + | return cb(&SeekableBase{Ptr: SeekableVarp}) | |
| 65 | + | }) | |
| 66 | + | } | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | // GetCanSeek gets the callback function. | |
| 70 | + | func (x *SeekableIface) GetCanSeek() func(Seekable) bool { | |
| 71 | + | if x.xCanSeek == 0 { | |
| 72 | + | return nil | |
| 73 | + | } | |
| 74 | + | var rawCallback func(SeekableVarp uintptr) bool | |
| 75 | + | purego.RegisterFunc(&rawCallback, x.xCanSeek) | |
| 76 | + | return func(SeekableVar Seekable) bool { | |
| 77 | + | return rawCallback(SeekableVar.GoPointer()) | |
| 78 | + | } | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | // OverrideSeek sets the callback function. | |
| 82 | + | func (x *SeekableIface) OverrideSeek(cb func(Seekable, int64, glib.SeekType, *Cancellable) bool) { | |
| 83 | + | if cb == nil { | |
| 84 | + | x.xSeek = 0 | |
| 85 | + | } else { | |
| 86 | + | x.xSeek = purego.NewCallback(func(SeekableVarp uintptr, OffsetVarp int64, TypeVarp glib.SeekType, CancellableVarp uintptr) bool { | |
| 87 | + | return cb(&SeekableBase{Ptr: SeekableVarp}, OffsetVarp, TypeVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 88 | + | }) | |
| 89 | + | } | |
| 90 | + | } | |
| 91 | + | ||
| 92 | + | // GetSeek gets the callback function. | |
| 93 | + | func (x *SeekableIface) GetSeek() func(Seekable, int64, glib.SeekType, *Cancellable) bool { | |
| 94 | + | if x.xSeek == 0 { | |
| 95 | + | return nil | |
| 96 | + | } | |
| 97 | + | var rawCallback func(SeekableVarp uintptr, OffsetVarp int64, TypeVarp glib.SeekType, CancellableVarp uintptr) bool | |
| 98 | + | purego.RegisterFunc(&rawCallback, x.xSeek) | |
| 99 | + | return func(SeekableVar Seekable, OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) bool { | |
| 100 | + | return rawCallback(SeekableVar.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer()) | |
| 101 | + | } | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | // OverrideCanTruncate sets the callback function. | |
| 105 | + | func (x *SeekableIface) OverrideCanTruncate(cb func(Seekable) bool) { | |
| 106 | + | if cb == nil { | |
| 107 | + | x.xCanTruncate = 0 | |
| 108 | + | } else { | |
| 109 | + | x.xCanTruncate = purego.NewCallback(func(SeekableVarp uintptr) bool { | |
| 110 | + | return cb(&SeekableBase{Ptr: SeekableVarp}) | |
| 111 | + | }) | |
| 112 | + | } | |
| 113 | + | } | |
| 114 | + | ||
| 115 | + | // GetCanTruncate gets the callback function. | |
| 116 | + | func (x *SeekableIface) GetCanTruncate() func(Seekable) bool { | |
| 117 | + | if x.xCanTruncate == 0 { | |
| 118 | + | return nil | |
| 119 | + | } | |
| 120 | + | var rawCallback func(SeekableVarp uintptr) bool | |
| 121 | + | purego.RegisterFunc(&rawCallback, x.xCanTruncate) | |
| 122 | + | return func(SeekableVar Seekable) bool { | |
| 123 | + | return rawCallback(SeekableVar.GoPointer()) | |
| 124 | + | } | |
| 125 | + | } | |
| 126 | + | ||
| 127 | + | // OverrideTruncateFn sets the callback function. | |
| 128 | + | func (x *SeekableIface) OverrideTruncateFn(cb func(Seekable, int64, *Cancellable) bool) { | |
| 129 | + | if cb == nil { | |
| 130 | + | x.xTruncateFn = 0 | |
| 131 | + | } else { | |
| 132 | + | x.xTruncateFn = purego.NewCallback(func(SeekableVarp uintptr, OffsetVarp int64, CancellableVarp uintptr) bool { | |
| 133 | + | return cb(&SeekableBase{Ptr: SeekableVarp}, OffsetVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 134 | + | }) | |
| 135 | + | } | |
| 136 | + | } | |
| 137 | + | ||
| 138 | + | // GetTruncateFn gets the callback function. | |
| 139 | + | func (x *SeekableIface) GetTruncateFn() func(Seekable, int64, *Cancellable) bool { | |
| 140 | + | if x.xTruncateFn == 0 { | |
| 141 | + | return nil | |
| 142 | + | } | |
| 143 | + | var rawCallback func(SeekableVarp uintptr, OffsetVarp int64, CancellableVarp uintptr) bool | |
| 144 | + | purego.RegisterFunc(&rawCallback, x.xTruncateFn) | |
| 145 | + | return func(SeekableVar Seekable, OffsetVar int64, CancellableVar *Cancellable) bool { | |
| 146 | + | return rawCallback(SeekableVar.GoPointer(), OffsetVar, CancellableVar.GoPointer()) | |
| 147 | + | } | |
| 148 | + | } | |
| 149 | + | ||
| 25 | 150 | // #GSeekable is implemented by streams (implementations of | |
| 26 | 151 | // #GInputStream or #GOutputStream) that support seeking. | |
| 27 | 152 | // | |
| @@ -41,9 +166,9 @@ type Seekable interface { | |||
| 41 | 166 | SetGoPointer(uintptr) | |
| 42 | 167 | CanSeek() bool | |
| 43 | 168 | CanTruncate() bool | |
| 44 | - | Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) bool | |
| 169 | + | Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) (bool, error) | |
| 45 | 170 | Tell() int64 | |
| 46 | - | Truncate(OffsetVar int64, CancellableVar *Cancellable) bool | |
| 171 | + | Truncate(OffsetVar int64, CancellableVar *Cancellable) (bool, error) | |
| 47 | 172 | } | |
| 48 | 173 | ||
| 49 | 174 | var xSeekableGLibType func() types.GType | |
M v4/gio/gsettings.go +101 -1
| @@ -36,7 +36,15 @@ type SettingsGetMapping func(*glib.Variant, uintptr, uintptr) bool | |||
| 36 | 36 | type SettingsClass struct { | |
| 37 | 37 | _ structs.HostLayout | |
| 38 | 38 | ||
| 39 | - | ParentClass uintptr | |
| 39 | + | ParentClass gobject.ObjectClass | |
| 40 | + | ||
| 41 | + | xWritableChanged uintptr | |
| 42 | + | ||
| 43 | + | xChanged uintptr | |
| 44 | + | ||
| 45 | + | xWritableChangeEvent uintptr | |
| 46 | + | ||
| 47 | + | xChangeEvent uintptr | |
| 40 | 48 | ||
| 41 | 49 | Padding [20]uintptr | |
| 42 | 50 | } | |
| @@ -45,6 +53,98 @@ func (x *SettingsClass) GoPointer() uintptr { | |||
| 45 | 53 | return uintptr(unsafe.Pointer(x)) | |
| 46 | 54 | } | |
| 47 | 55 | ||
| 56 | + | // OverrideWritableChanged sets the callback function. | |
| 57 | + | func (x *SettingsClass) OverrideWritableChanged(cb func(*Settings, string)) { | |
| 58 | + | if cb == nil { | |
| 59 | + | x.xWritableChanged = 0 | |
| 60 | + | } else { | |
| 61 | + | x.xWritableChanged = purego.NewCallback(func(SettingsVarp uintptr, KeyVarp string) { | |
| 62 | + | cb(SettingsNewFromInternalPtr(SettingsVarp), KeyVarp) | |
| 63 | + | }) | |
| 64 | + | } | |
| 65 | + | } | |
| 66 | + | ||
| 67 | + | // GetWritableChanged gets the callback function. | |
| 68 | + | func (x *SettingsClass) GetWritableChanged() func(*Settings, string) { | |
| 69 | + | if x.xWritableChanged == 0 { | |
| 70 | + | return nil | |
| 71 | + | } | |
| 72 | + | var rawCallback func(SettingsVarp uintptr, KeyVarp string) | |
| 73 | + | purego.RegisterFunc(&rawCallback, x.xWritableChanged) | |
| 74 | + | return func(SettingsVar *Settings, KeyVar string) { | |
| 75 | + | rawCallback(SettingsVar.GoPointer(), KeyVar) | |
| 76 | + | } | |
| 77 | + | } | |
| 78 | + | ||
| 79 | + | // OverrideChanged sets the callback function. | |
| 80 | + | func (x *SettingsClass) OverrideChanged(cb func(*Settings, string)) { | |
| 81 | + | if cb == nil { | |
| 82 | + | x.xChanged = 0 | |
| 83 | + | } else { | |
| 84 | + | x.xChanged = purego.NewCallback(func(SettingsVarp uintptr, KeyVarp string) { | |
| 85 | + | cb(SettingsNewFromInternalPtr(SettingsVarp), KeyVarp) | |
| 86 | + | }) | |
| 87 | + | } | |
| 88 | + | } | |
| 89 | + | ||
| 90 | + | // GetChanged gets the callback function. | |
| 91 | + | func (x *SettingsClass) GetChanged() func(*Settings, string) { | |
| 92 | + | if x.xChanged == 0 { | |
| 93 | + | return nil | |
| 94 | + | } | |
| 95 | + | var rawCallback func(SettingsVarp uintptr, KeyVarp string) | |
| 96 | + | purego.RegisterFunc(&rawCallback, x.xChanged) | |
| 97 | + | return func(SettingsVar *Settings, KeyVar string) { | |
| 98 | + | rawCallback(SettingsVar.GoPointer(), KeyVar) | |
| 99 | + | } | |
| 100 | + | } | |
| 101 | + | ||
| 102 | + | // OverrideWritableChangeEvent sets the callback function. | |
| 103 | + | func (x *SettingsClass) OverrideWritableChangeEvent(cb func(*Settings, glib.Quark) bool) { | |
| 104 | + | if cb == nil { | |
| 105 | + | x.xWritableChangeEvent = 0 | |
| 106 | + | } else { | |
| 107 | + | x.xWritableChangeEvent = purego.NewCallback(func(SettingsVarp uintptr, KeyVarp glib.Quark) bool { | |
| 108 | + | return cb(SettingsNewFromInternalPtr(SettingsVarp), KeyVarp) | |
| 109 | + | }) | |
| 110 | + | } | |
| 111 | + | } | |
| 112 | + | ||
| 113 | + | // GetWritableChangeEvent gets the callback function. | |
| 114 | + | func (x *SettingsClass) GetWritableChangeEvent() func(*Settings, glib.Quark) bool { | |
| 115 | + | if x.xWritableChangeEvent == 0 { | |
| 116 | + | return nil | |
| 117 | + | } | |
| 118 | + | var rawCallback func(SettingsVarp uintptr, KeyVarp glib.Quark) bool | |
| 119 | + | purego.RegisterFunc(&rawCallback, x.xWritableChangeEvent) | |
| 120 | + | return func(SettingsVar *Settings, KeyVar glib.Quark) bool { | |
| 121 | + | return rawCallback(SettingsVar.GoPointer(), KeyVar) | |
| 122 | + | } | |
| 123 | + | } | |
| 124 | + | ||
| 125 | + | // OverrideChangeEvent sets the callback function. | |
| 126 | + | func (x *SettingsClass) OverrideChangeEvent(cb func(*Settings, *glib.Quark, int) bool) { | |
| 127 | + | if cb == nil { | |
| 128 | + | x.xChangeEvent = 0 | |
| 129 | + | } else { | |
| 130 | + | x.xChangeEvent = purego.NewCallback(func(SettingsVarp uintptr, KeysVarp *glib.Quark, NKeysVarp int) bool { | |
| 131 | + | return cb(SettingsNewFromInternalPtr(SettingsVarp), KeysVarp, NKeysVarp) | |
| 132 | + | }) | |
| 133 | + | } | |
| 134 | + | } | |
| 135 | + | ||
| 136 | + | // GetChangeEvent gets the callback function. | |
| 137 | + | func (x *SettingsClass) GetChangeEvent() func(*Settings, *glib.Quark, int) bool { | |
| 138 | + | if x.xChangeEvent == 0 { | |
| 139 | + | return nil | |
| 140 | + | } | |
| 141 | + | var rawCallback func(SettingsVarp uintptr, KeysVarp *glib.Quark, NKeysVarp int) bool | |
| 142 | + | purego.RegisterFunc(&rawCallback, x.xChangeEvent) | |
| 143 | + | return func(SettingsVar *Settings, KeysVar *glib.Quark, NKeysVar int) bool { | |
| 144 | + | return rawCallback(SettingsVar.GoPointer(), KeysVar, NKeysVar) | |
| 145 | + | } | |
| 146 | + | } | |
| 147 | + | ||
| 48 | 148 | type SettingsPrivate struct { | |
| 49 | 149 | _ structs.HostLayout | |
| 50 | 150 | } | |
M v4/gio/gsettingsbackend.go +261 -1
| @@ -16,7 +16,27 @@ import ( | |||
| 16 | 16 | type SettingsBackendClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | + | ||
| 21 | + | xRead uintptr | |
| 22 | + | ||
| 23 | + | xGetWritable uintptr | |
| 24 | + | ||
| 25 | + | xWrite uintptr | |
| 26 | + | ||
| 27 | + | xWriteTree uintptr | |
| 28 | + | ||
| 29 | + | xReset uintptr | |
| 30 | + | ||
| 31 | + | xSubscribe uintptr | |
| 32 | + | ||
| 33 | + | xUnsubscribe uintptr | |
| 34 | + | ||
| 35 | + | xSync uintptr | |
| 36 | + | ||
| 37 | + | xGetPermission uintptr | |
| 38 | + | ||
| 39 | + | xReadUserValue uintptr | |
| 20 | 40 | ||
| 21 | 41 | Padding [23]uintptr | |
| 22 | 42 | } | |
| @@ -25,6 +45,246 @@ func (x *SettingsBackendClass) GoPointer() uintptr { | |||
| 25 | 45 | return uintptr(unsafe.Pointer(x)) | |
| 26 | 46 | } | |
| 27 | 47 | ||
| 48 | + | // OverrideRead sets the callback function. | |
| 49 | + | func (x *SettingsBackendClass) OverrideRead(cb func(*SettingsBackend, string, *glib.VariantType, bool) *glib.Variant) { | |
| 50 | + | if cb == nil { | |
| 51 | + | x.xRead = 0 | |
| 52 | + | } else { | |
| 53 | + | x.xRead = purego.NewCallback(func(BackendVarp uintptr, KeyVarp string, ExpectedTypeVarp *glib.VariantType, DefaultValueVarp bool) *glib.Variant { | |
| 54 | + | return cb(SettingsBackendNewFromInternalPtr(BackendVarp), KeyVarp, ExpectedTypeVarp, DefaultValueVarp) | |
| 55 | + | }) | |
| 56 | + | } | |
| 57 | + | } | |
| 58 | + | ||
| 59 | + | // GetRead gets the callback function. | |
| 60 | + | func (x *SettingsBackendClass) GetRead() func(*SettingsBackend, string, *glib.VariantType, bool) *glib.Variant { | |
| 61 | + | if x.xRead == 0 { | |
| 62 | + | return nil | |
| 63 | + | } | |
| 64 | + | var rawCallback func(BackendVarp uintptr, KeyVarp string, ExpectedTypeVarp *glib.VariantType, DefaultValueVarp bool) *glib.Variant | |
| 65 | + | purego.RegisterFunc(&rawCallback, x.xRead) | |
| 66 | + | return func(BackendVar *SettingsBackend, KeyVar string, ExpectedTypeVar *glib.VariantType, DefaultValueVar bool) *glib.Variant { | |
| 67 | + | return rawCallback(BackendVar.GoPointer(), KeyVar, ExpectedTypeVar, DefaultValueVar) | |
| 68 | + | } | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | // OverrideGetWritable sets the callback function. | |
| 72 | + | func (x *SettingsBackendClass) OverrideGetWritable(cb func(*SettingsBackend, string) bool) { | |
| 73 | + | if cb == nil { | |
| 74 | + | x.xGetWritable = 0 | |
| 75 | + | } else { | |
| 76 | + | x.xGetWritable = purego.NewCallback(func(BackendVarp uintptr, KeyVarp string) bool { | |
| 77 | + | return cb(SettingsBackendNewFromInternalPtr(BackendVarp), KeyVarp) | |
| 78 | + | }) | |
| 79 | + | } | |
| 80 | + | } | |
| 81 | + | ||
| 82 | + | // GetGetWritable gets the callback function. | |
| 83 | + | func (x *SettingsBackendClass) GetGetWritable() func(*SettingsBackend, string) bool { | |
| 84 | + | if x.xGetWritable == 0 { | |
| 85 | + | return nil | |
| 86 | + | } | |
| 87 | + | var rawCallback func(BackendVarp uintptr, KeyVarp string) bool | |
| 88 | + | purego.RegisterFunc(&rawCallback, x.xGetWritable) | |
| 89 | + | return func(BackendVar *SettingsBackend, KeyVar string) bool { | |
| 90 | + | return rawCallback(BackendVar.GoPointer(), KeyVar) | |
| 91 | + | } | |
| 92 | + | } | |
| 93 | + | ||
| 94 | + | // OverrideWrite sets the callback function. | |
| 95 | + | func (x *SettingsBackendClass) OverrideWrite(cb func(*SettingsBackend, string, *glib.Variant, uintptr) bool) { | |
| 96 | + | if cb == nil { | |
| 97 | + | x.xWrite = 0 | |
| 98 | + | } else { | |
| 99 | + | x.xWrite = purego.NewCallback(func(BackendVarp uintptr, KeyVarp string, ValueVarp *glib.Variant, OriginTagVarp uintptr) bool { | |
| 100 | + | return cb(SettingsBackendNewFromInternalPtr(BackendVarp), KeyVarp, ValueVarp, OriginTagVarp) | |
| 101 | + | }) | |
| 102 | + | } | |
| 103 | + | } | |
| 104 | + | ||
| 105 | + | // GetWrite gets the callback function. | |
| 106 | + | func (x *SettingsBackendClass) GetWrite() func(*SettingsBackend, string, *glib.Variant, uintptr) bool { | |
| 107 | + | if x.xWrite == 0 { | |
| 108 | + | return nil | |
| 109 | + | } | |
| 110 | + | var rawCallback func(BackendVarp uintptr, KeyVarp string, ValueVarp *glib.Variant, OriginTagVarp uintptr) bool | |
| 111 | + | purego.RegisterFunc(&rawCallback, x.xWrite) | |
| 112 | + | return func(BackendVar *SettingsBackend, KeyVar string, ValueVar *glib.Variant, OriginTagVar uintptr) bool { | |
| 113 | + | return rawCallback(BackendVar.GoPointer(), KeyVar, ValueVar, OriginTagVar) | |
| 114 | + | } | |
| 115 | + | } | |
| 116 | + | ||
| 117 | + | // OverrideWriteTree sets the callback function. | |
| 118 | + | func (x *SettingsBackendClass) OverrideWriteTree(cb func(*SettingsBackend, *glib.Tree, uintptr) bool) { | |
| 119 | + | if cb == nil { | |
| 120 | + | x.xWriteTree = 0 | |
| 121 | + | } else { | |
| 122 | + | x.xWriteTree = purego.NewCallback(func(BackendVarp uintptr, TreeVarp *glib.Tree, OriginTagVarp uintptr) bool { | |
| 123 | + | return cb(SettingsBackendNewFromInternalPtr(BackendVarp), TreeVarp, OriginTagVarp) | |
| 124 | + | }) | |
| 125 | + | } | |
| 126 | + | } | |
| 127 | + | ||
| 128 | + | // GetWriteTree gets the callback function. | |
| 129 | + | func (x *SettingsBackendClass) GetWriteTree() func(*SettingsBackend, *glib.Tree, uintptr) bool { | |
| 130 | + | if x.xWriteTree == 0 { | |
| 131 | + | return nil | |
| 132 | + | } | |
| 133 | + | var rawCallback func(BackendVarp uintptr, TreeVarp *glib.Tree, OriginTagVarp uintptr) bool | |
| 134 | + | purego.RegisterFunc(&rawCallback, x.xWriteTree) | |
| 135 | + | return func(BackendVar *SettingsBackend, TreeVar *glib.Tree, OriginTagVar uintptr) bool { | |
| 136 | + | return rawCallback(BackendVar.GoPointer(), TreeVar, OriginTagVar) | |
| 137 | + | } | |
| 138 | + | } | |
| 139 | + | ||
| 140 | + | // OverrideReset sets the callback function. | |
| 141 | + | func (x *SettingsBackendClass) OverrideReset(cb func(*SettingsBackend, string, uintptr)) { | |
| 142 | + | if cb == nil { | |
| 143 | + | x.xReset = 0 | |
| 144 | + | } else { | |
| 145 | + | x.xReset = purego.NewCallback(func(BackendVarp uintptr, KeyVarp string, OriginTagVarp uintptr) { | |
| 146 | + | cb(SettingsBackendNewFromInternalPtr(BackendVarp), KeyVarp, OriginTagVarp) | |
| 147 | + | }) | |
| 148 | + | } | |
| 149 | + | } | |
| 150 | + | ||
| 151 | + | // GetReset gets the callback function. | |
| 152 | + | func (x *SettingsBackendClass) GetReset() func(*SettingsBackend, string, uintptr) { | |
| 153 | + | if x.xReset == 0 { | |
| 154 | + | return nil | |
| 155 | + | } | |
| 156 | + | var rawCallback func(BackendVarp uintptr, KeyVarp string, OriginTagVarp uintptr) | |
| 157 | + | purego.RegisterFunc(&rawCallback, x.xReset) | |
| 158 | + | return func(BackendVar *SettingsBackend, KeyVar string, OriginTagVar uintptr) { | |
| 159 | + | rawCallback(BackendVar.GoPointer(), KeyVar, OriginTagVar) | |
| 160 | + | } | |
| 161 | + | } | |
| 162 | + | ||
| 163 | + | // OverrideSubscribe sets the callback function. | |
| 164 | + | func (x *SettingsBackendClass) OverrideSubscribe(cb func(*SettingsBackend, string)) { | |
| 165 | + | if cb == nil { | |
| 166 | + | x.xSubscribe = 0 | |
| 167 | + | } else { | |
| 168 | + | x.xSubscribe = purego.NewCallback(func(BackendVarp uintptr, NameVarp string) { | |
| 169 | + | cb(SettingsBackendNewFromInternalPtr(BackendVarp), NameVarp) | |
| 170 | + | }) | |
| 171 | + | } | |
| 172 | + | } | |
| 173 | + | ||
| 174 | + | // GetSubscribe gets the callback function. | |
| 175 | + | func (x *SettingsBackendClass) GetSubscribe() func(*SettingsBackend, string) { | |
| 176 | + | if x.xSubscribe == 0 { | |
| 177 | + | return nil | |
| 178 | + | } | |
| 179 | + | var rawCallback func(BackendVarp uintptr, NameVarp string) | |
| 180 | + | purego.RegisterFunc(&rawCallback, x.xSubscribe) | |
| 181 | + | return func(BackendVar *SettingsBackend, NameVar string) { | |
| 182 | + | rawCallback(BackendVar.GoPointer(), NameVar) | |
| 183 | + | } | |
| 184 | + | } | |
| 185 | + | ||
| 186 | + | // OverrideUnsubscribe sets the callback function. | |
| 187 | + | func (x *SettingsBackendClass) OverrideUnsubscribe(cb func(*SettingsBackend, string)) { | |
| 188 | + | if cb == nil { | |
| 189 | + | x.xUnsubscribe = 0 | |
| 190 | + | } else { | |
| 191 | + | x.xUnsubscribe = purego.NewCallback(func(BackendVarp uintptr, NameVarp string) { | |
| 192 | + | cb(SettingsBackendNewFromInternalPtr(BackendVarp), NameVarp) | |
| 193 | + | }) | |
| 194 | + | } | |
| 195 | + | } | |
| 196 | + | ||
| 197 | + | // GetUnsubscribe gets the callback function. | |
| 198 | + | func (x *SettingsBackendClass) GetUnsubscribe() func(*SettingsBackend, string) { | |
| 199 | + | if x.xUnsubscribe == 0 { | |
| 200 | + | return nil | |
| 201 | + | } | |
| 202 | + | var rawCallback func(BackendVarp uintptr, NameVarp string) | |
| 203 | + | purego.RegisterFunc(&rawCallback, x.xUnsubscribe) | |
| 204 | + | return func(BackendVar *SettingsBackend, NameVar string) { | |
| 205 | + | rawCallback(BackendVar.GoPointer(), NameVar) | |
| 206 | + | } | |
| 207 | + | } | |
| 208 | + | ||
| 209 | + | // OverrideSync sets the callback function. | |
| 210 | + | func (x *SettingsBackendClass) OverrideSync(cb func(*SettingsBackend)) { | |
| 211 | + | if cb == nil { | |
| 212 | + | x.xSync = 0 | |
| 213 | + | } else { | |
| 214 | + | x.xSync = purego.NewCallback(func(BackendVarp uintptr) { | |
| 215 | + | cb(SettingsBackendNewFromInternalPtr(BackendVarp)) | |
| 216 | + | }) | |
| 217 | + | } | |
| 218 | + | } | |
| 219 | + | ||
| 220 | + | // GetSync gets the callback function. | |
| 221 | + | func (x *SettingsBackendClass) GetSync() func(*SettingsBackend) { | |
| 222 | + | if x.xSync == 0 { | |
| 223 | + | return nil | |
| 224 | + | } | |
| 225 | + | var rawCallback func(BackendVarp uintptr) | |
| 226 | + | purego.RegisterFunc(&rawCallback, x.xSync) | |
| 227 | + | return func(BackendVar *SettingsBackend) { | |
| 228 | + | rawCallback(BackendVar.GoPointer()) | |
| 229 | + | } | |
| 230 | + | } | |
| 231 | + | ||
| 232 | + | // OverrideGetPermission sets the callback function. | |
| 233 | + | func (x *SettingsBackendClass) OverrideGetPermission(cb func(*SettingsBackend, string) *Permission) { | |
| 234 | + | if cb == nil { | |
| 235 | + | x.xGetPermission = 0 | |
| 236 | + | } else { | |
| 237 | + | x.xGetPermission = purego.NewCallback(func(BackendVarp uintptr, PathVarp string) uintptr { | |
| 238 | + | ret := cb(SettingsBackendNewFromInternalPtr(BackendVarp), PathVarp) | |
| 239 | + | if ret == nil { | |
| 240 | + | return 0 | |
| 241 | + | } | |
| 242 | + | return ret.GoPointer() | |
| 243 | + | }) | |
| 244 | + | } | |
| 245 | + | } | |
| 246 | + | ||
| 247 | + | // GetGetPermission gets the callback function. | |
| 248 | + | func (x *SettingsBackendClass) GetGetPermission() func(*SettingsBackend, string) *Permission { | |
| 249 | + | if x.xGetPermission == 0 { | |
| 250 | + | return nil | |
| 251 | + | } | |
| 252 | + | var rawCallback func(BackendVarp uintptr, PathVarp string) uintptr | |
| 253 | + | purego.RegisterFunc(&rawCallback, x.xGetPermission) | |
| 254 | + | return func(BackendVar *SettingsBackend, PathVar string) *Permission { | |
| 255 | + | rawRet := rawCallback(BackendVar.GoPointer(), PathVar) | |
| 256 | + | if rawRet == 0 { | |
| 257 | + | return nil | |
| 258 | + | } | |
| 259 | + | ret := &Permission{} | |
| 260 | + | ret.Ptr = rawRet | |
| 261 | + | return ret | |
| 262 | + | } | |
| 263 | + | } | |
| 264 | + | ||
| 265 | + | // OverrideReadUserValue sets the callback function. | |
| 266 | + | func (x *SettingsBackendClass) OverrideReadUserValue(cb func(*SettingsBackend, string, *glib.VariantType) *glib.Variant) { | |
| 267 | + | if cb == nil { | |
| 268 | + | x.xReadUserValue = 0 | |
| 269 | + | } else { | |
| 270 | + | x.xReadUserValue = purego.NewCallback(func(BackendVarp uintptr, KeyVarp string, ExpectedTypeVarp *glib.VariantType) *glib.Variant { | |
| 271 | + | return cb(SettingsBackendNewFromInternalPtr(BackendVarp), KeyVarp, ExpectedTypeVarp) | |
| 272 | + | }) | |
| 273 | + | } | |
| 274 | + | } | |
| 275 | + | ||
| 276 | + | // GetReadUserValue gets the callback function. | |
| 277 | + | func (x *SettingsBackendClass) GetReadUserValue() func(*SettingsBackend, string, *glib.VariantType) *glib.Variant { | |
| 278 | + | if x.xReadUserValue == 0 { | |
| 279 | + | return nil | |
| 280 | + | } | |
| 281 | + | var rawCallback func(BackendVarp uintptr, KeyVarp string, ExpectedTypeVarp *glib.VariantType) *glib.Variant | |
| 282 | + | purego.RegisterFunc(&rawCallback, x.xReadUserValue) | |
| 283 | + | return func(BackendVar *SettingsBackend, KeyVar string, ExpectedTypeVar *glib.VariantType) *glib.Variant { | |
| 284 | + | return rawCallback(BackendVar.GoPointer(), KeyVar, ExpectedTypeVar) | |
| 285 | + | } | |
| 286 | + | } | |
| 287 | + | ||
| 28 | 288 | type SettingsBackendPrivate struct { | |
| 29 | 289 | _ structs.HostLayout | |
| 30 | 290 | } | |
M v4/gio/gsimpleactiongroup.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type SimpleActionGroupClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | 19 | ||
| 20 | 20 | Padding [12]uintptr | |
| 21 | 21 | } | |
M v4/gio/gsimpleproxyresolver.go +126 -1
| @@ -15,13 +15,138 @@ import ( | |||
| 15 | 15 | type SimpleProxyResolverClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xGReserved1 uintptr | |
| 21 | + | ||
| 22 | + | xGReserved2 uintptr | |
| 23 | + | ||
| 24 | + | xGReserved3 uintptr | |
| 25 | + | ||
| 26 | + | xGReserved4 uintptr | |
| 27 | + | ||
| 28 | + | xGReserved5 uintptr | |
| 19 | 29 | } | |
| 20 | 30 | ||
| 21 | 31 | func (x *SimpleProxyResolverClass) GoPointer() uintptr { | |
| 22 | 32 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 33 | } | |
| 24 | 34 | ||
| 35 | + | // OverrideGReserved1 sets the callback function. | |
| 36 | + | func (x *SimpleProxyResolverClass) OverrideGReserved1(cb func()) { | |
| 37 | + | if cb == nil { | |
| 38 | + | x.xGReserved1 = 0 | |
| 39 | + | } else { | |
| 40 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 41 | + | cb() | |
| 42 | + | }) | |
| 43 | + | } | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | // GetGReserved1 gets the callback function. | |
| 47 | + | func (x *SimpleProxyResolverClass) GetGReserved1() func() { | |
| 48 | + | if x.xGReserved1 == 0 { | |
| 49 | + | return nil | |
| 50 | + | } | |
| 51 | + | var rawCallback func() | |
| 52 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 53 | + | return func() { | |
| 54 | + | rawCallback() | |
| 55 | + | } | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | // OverrideGReserved2 sets the callback function. | |
| 59 | + | func (x *SimpleProxyResolverClass) OverrideGReserved2(cb func()) { | |
| 60 | + | if cb == nil { | |
| 61 | + | x.xGReserved2 = 0 | |
| 62 | + | } else { | |
| 63 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 64 | + | cb() | |
| 65 | + | }) | |
| 66 | + | } | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | // GetGReserved2 gets the callback function. | |
| 70 | + | func (x *SimpleProxyResolverClass) GetGReserved2() func() { | |
| 71 | + | if x.xGReserved2 == 0 { | |
| 72 | + | return nil | |
| 73 | + | } | |
| 74 | + | var rawCallback func() | |
| 75 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 76 | + | return func() { | |
| 77 | + | rawCallback() | |
| 78 | + | } | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | // OverrideGReserved3 sets the callback function. | |
| 82 | + | func (x *SimpleProxyResolverClass) OverrideGReserved3(cb func()) { | |
| 83 | + | if cb == nil { | |
| 84 | + | x.xGReserved3 = 0 | |
| 85 | + | } else { | |
| 86 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 87 | + | cb() | |
| 88 | + | }) | |
| 89 | + | } | |
| 90 | + | } | |
| 91 | + | ||
| 92 | + | // GetGReserved3 gets the callback function. | |
| 93 | + | func (x *SimpleProxyResolverClass) GetGReserved3() func() { | |
| 94 | + | if x.xGReserved3 == 0 { | |
| 95 | + | return nil | |
| 96 | + | } | |
| 97 | + | var rawCallback func() | |
| 98 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 99 | + | return func() { | |
| 100 | + | rawCallback() | |
| 101 | + | } | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | // OverrideGReserved4 sets the callback function. | |
| 105 | + | func (x *SimpleProxyResolverClass) OverrideGReserved4(cb func()) { | |
| 106 | + | if cb == nil { | |
| 107 | + | x.xGReserved4 = 0 | |
| 108 | + | } else { | |
| 109 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 110 | + | cb() | |
| 111 | + | }) | |
| 112 | + | } | |
| 113 | + | } | |
| 114 | + | ||
| 115 | + | // GetGReserved4 gets the callback function. | |
| 116 | + | func (x *SimpleProxyResolverClass) GetGReserved4() func() { | |
| 117 | + | if x.xGReserved4 == 0 { | |
| 118 | + | return nil | |
| 119 | + | } | |
| 120 | + | var rawCallback func() | |
| 121 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 122 | + | return func() { | |
| 123 | + | rawCallback() | |
| 124 | + | } | |
| 125 | + | } | |
| 126 | + | ||
| 127 | + | // OverrideGReserved5 sets the callback function. | |
| 128 | + | func (x *SimpleProxyResolverClass) OverrideGReserved5(cb func()) { | |
| 129 | + | if cb == nil { | |
| 130 | + | x.xGReserved5 = 0 | |
| 131 | + | } else { | |
| 132 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 133 | + | cb() | |
| 134 | + | }) | |
| 135 | + | } | |
| 136 | + | } | |
| 137 | + | ||
| 138 | + | // GetGReserved5 gets the callback function. | |
| 139 | + | func (x *SimpleProxyResolverClass) GetGReserved5() func() { | |
| 140 | + | if x.xGReserved5 == 0 { | |
| 141 | + | return nil | |
| 142 | + | } | |
| 143 | + | var rawCallback func() | |
| 144 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 145 | + | return func() { | |
| 146 | + | rawCallback() | |
| 147 | + | } | |
| 148 | + | } | |
| 149 | + | ||
| 25 | 150 | type SimpleProxyResolverPrivate struct { | |
| 26 | 151 | _ structs.HostLayout | |
| 27 | 152 | } | |
M v4/gio/gsocket.go +255 -5
| @@ -15,13 +15,263 @@ import ( | |||
| 15 | 15 | type SocketClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xGReserved1 uintptr | |
| 21 | + | ||
| 22 | + | xGReserved2 uintptr | |
| 23 | + | ||
| 24 | + | xGReserved3 uintptr | |
| 25 | + | ||
| 26 | + | xGReserved4 uintptr | |
| 27 | + | ||
| 28 | + | xGReserved5 uintptr | |
| 29 | + | ||
| 30 | + | xGReserved6 uintptr | |
| 31 | + | ||
| 32 | + | xGReserved7 uintptr | |
| 33 | + | ||
| 34 | + | xGReserved8 uintptr | |
| 35 | + | ||
| 36 | + | xGReserved9 uintptr | |
| 37 | + | ||
| 38 | + | xGReserved10 uintptr | |
| 19 | 39 | } | |
| 20 | 40 | ||
| 21 | 41 | func (x *SocketClass) GoPointer() uintptr { | |
| 22 | 42 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 43 | } | |
| 24 | 44 | ||
| 45 | + | // OverrideGReserved1 sets the callback function. | |
| 46 | + | func (x *SocketClass) OverrideGReserved1(cb func()) { | |
| 47 | + | if cb == nil { | |
| 48 | + | x.xGReserved1 = 0 | |
| 49 | + | } else { | |
| 50 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 51 | + | cb() | |
| 52 | + | }) | |
| 53 | + | } | |
| 54 | + | } | |
| 55 | + | ||
| 56 | + | // GetGReserved1 gets the callback function. | |
| 57 | + | func (x *SocketClass) GetGReserved1() func() { | |
| 58 | + | if x.xGReserved1 == 0 { | |
| 59 | + | return nil | |
| 60 | + | } | |
| 61 | + | var rawCallback func() | |
| 62 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 63 | + | return func() { | |
| 64 | + | rawCallback() | |
| 65 | + | } | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | // OverrideGReserved2 sets the callback function. | |
| 69 | + | func (x *SocketClass) OverrideGReserved2(cb func()) { | |
| 70 | + | if cb == nil { | |
| 71 | + | x.xGReserved2 = 0 | |
| 72 | + | } else { | |
| 73 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 74 | + | cb() | |
| 75 | + | }) | |
| 76 | + | } | |
| 77 | + | } | |
| 78 | + | ||
| 79 | + | // GetGReserved2 gets the callback function. | |
| 80 | + | func (x *SocketClass) GetGReserved2() func() { | |
| 81 | + | if x.xGReserved2 == 0 { | |
| 82 | + | return nil | |
| 83 | + | } | |
| 84 | + | var rawCallback func() | |
| 85 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 86 | + | return func() { | |
| 87 | + | rawCallback() | |
| 88 | + | } | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | // OverrideGReserved3 sets the callback function. | |
| 92 | + | func (x *SocketClass) OverrideGReserved3(cb func()) { | |
| 93 | + | if cb == nil { | |
| 94 | + | x.xGReserved3 = 0 | |
| 95 | + | } else { | |
| 96 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 97 | + | cb() | |
| 98 | + | }) | |
| 99 | + | } | |
| 100 | + | } | |
| 101 | + | ||
| 102 | + | // GetGReserved3 gets the callback function. | |
| 103 | + | func (x *SocketClass) GetGReserved3() func() { | |
| 104 | + | if x.xGReserved3 == 0 { | |
| 105 | + | return nil | |
| 106 | + | } | |
| 107 | + | var rawCallback func() | |
| 108 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 109 | + | return func() { | |
| 110 | + | rawCallback() | |
| 111 | + | } | |
| 112 | + | } | |
| 113 | + | ||
| 114 | + | // OverrideGReserved4 sets the callback function. | |
| 115 | + | func (x *SocketClass) OverrideGReserved4(cb func()) { | |
| 116 | + | if cb == nil { | |
| 117 | + | x.xGReserved4 = 0 | |
| 118 | + | } else { | |
| 119 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 120 | + | cb() | |
| 121 | + | }) | |
| 122 | + | } | |
| 123 | + | } | |
| 124 | + | ||
| 125 | + | // GetGReserved4 gets the callback function. | |
| 126 | + | func (x *SocketClass) GetGReserved4() func() { | |
| 127 | + | if x.xGReserved4 == 0 { | |
| 128 | + | return nil | |
| 129 | + | } | |
| 130 | + | var rawCallback func() | |
| 131 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 132 | + | return func() { | |
| 133 | + | rawCallback() | |
| 134 | + | } | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | // OverrideGReserved5 sets the callback function. | |
| 138 | + | func (x *SocketClass) OverrideGReserved5(cb func()) { | |
| 139 | + | if cb == nil { | |
| 140 | + | x.xGReserved5 = 0 | |
| 141 | + | } else { | |
| 142 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 143 | + | cb() | |
| 144 | + | }) | |
| 145 | + | } | |
| 146 | + | } | |
| 147 | + | ||
| 148 | + | // GetGReserved5 gets the callback function. | |
| 149 | + | func (x *SocketClass) GetGReserved5() func() { | |
| 150 | + | if x.xGReserved5 == 0 { | |
| 151 | + | return nil | |
| 152 | + | } | |
| 153 | + | var rawCallback func() | |
| 154 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 155 | + | return func() { | |
| 156 | + | rawCallback() | |
| 157 | + | } | |
| 158 | + | } | |
| 159 | + | ||
| 160 | + | // OverrideGReserved6 sets the callback function. | |
| 161 | + | func (x *SocketClass) OverrideGReserved6(cb func()) { | |
| 162 | + | if cb == nil { | |
| 163 | + | x.xGReserved6 = 0 | |
| 164 | + | } else { | |
| 165 | + | x.xGReserved6 = purego.NewCallback(func() { | |
| 166 | + | cb() | |
| 167 | + | }) | |
| 168 | + | } | |
| 169 | + | } | |
| 170 | + | ||
| 171 | + | // GetGReserved6 gets the callback function. | |
| 172 | + | func (x *SocketClass) GetGReserved6() func() { | |
| 173 | + | if x.xGReserved6 == 0 { | |
| 174 | + | return nil | |
| 175 | + | } | |
| 176 | + | var rawCallback func() | |
| 177 | + | purego.RegisterFunc(&rawCallback, x.xGReserved6) | |
| 178 | + | return func() { | |
| 179 | + | rawCallback() | |
| 180 | + | } | |
| 181 | + | } | |
| 182 | + | ||
| 183 | + | // OverrideGReserved7 sets the callback function. | |
| 184 | + | func (x *SocketClass) OverrideGReserved7(cb func()) { | |
| 185 | + | if cb == nil { | |
| 186 | + | x.xGReserved7 = 0 | |
| 187 | + | } else { | |
| 188 | + | x.xGReserved7 = purego.NewCallback(func() { | |
| 189 | + | cb() | |
| 190 | + | }) | |
| 191 | + | } | |
| 192 | + | } | |
| 193 | + | ||
| 194 | + | // GetGReserved7 gets the callback function. | |
| 195 | + | func (x *SocketClass) GetGReserved7() func() { | |
| 196 | + | if x.xGReserved7 == 0 { | |
| 197 | + | return nil | |
| 198 | + | } | |
| 199 | + | var rawCallback func() | |
| 200 | + | purego.RegisterFunc(&rawCallback, x.xGReserved7) | |
| 201 | + | return func() { | |
| 202 | + | rawCallback() | |
| 203 | + | } | |
| 204 | + | } | |
| 205 | + | ||
| 206 | + | // OverrideGReserved8 sets the callback function. | |
| 207 | + | func (x *SocketClass) OverrideGReserved8(cb func()) { | |
| 208 | + | if cb == nil { | |
| 209 | + | x.xGReserved8 = 0 | |
| 210 | + | } else { | |
| 211 | + | x.xGReserved8 = purego.NewCallback(func() { | |
| 212 | + | cb() | |
| 213 | + | }) | |
| 214 | + | } | |
| 215 | + | } | |
| 216 | + | ||
| 217 | + | // GetGReserved8 gets the callback function. | |
| 218 | + | func (x *SocketClass) GetGReserved8() func() { | |
| 219 | + | if x.xGReserved8 == 0 { | |
| 220 | + | return nil | |
| 221 | + | } | |
| 222 | + | var rawCallback func() | |
| 223 | + | purego.RegisterFunc(&rawCallback, x.xGReserved8) | |
| 224 | + | return func() { | |
| 225 | + | rawCallback() | |
| 226 | + | } | |
| 227 | + | } | |
| 228 | + | ||
| 229 | + | // OverrideGReserved9 sets the callback function. | |
| 230 | + | func (x *SocketClass) OverrideGReserved9(cb func()) { | |
| 231 | + | if cb == nil { | |
| 232 | + | x.xGReserved9 = 0 | |
| 233 | + | } else { | |
| 234 | + | x.xGReserved9 = purego.NewCallback(func() { | |
| 235 | + | cb() | |
| 236 | + | }) | |
| 237 | + | } | |
| 238 | + | } | |
| 239 | + | ||
| 240 | + | // GetGReserved9 gets the callback function. | |
| 241 | + | func (x *SocketClass) GetGReserved9() func() { | |
| 242 | + | if x.xGReserved9 == 0 { | |
| 243 | + | return nil | |
| 244 | + | } | |
| 245 | + | var rawCallback func() | |
| 246 | + | purego.RegisterFunc(&rawCallback, x.xGReserved9) | |
| 247 | + | return func() { | |
| 248 | + | rawCallback() | |
| 249 | + | } | |
| 250 | + | } | |
| 251 | + | ||
| 252 | + | // OverrideGReserved10 sets the callback function. | |
| 253 | + | func (x *SocketClass) OverrideGReserved10(cb func()) { | |
| 254 | + | if cb == nil { | |
| 255 | + | x.xGReserved10 = 0 | |
| 256 | + | } else { | |
| 257 | + | x.xGReserved10 = purego.NewCallback(func() { | |
| 258 | + | cb() | |
| 259 | + | }) | |
| 260 | + | } | |
| 261 | + | } | |
| 262 | + | ||
| 263 | + | // GetGReserved10 gets the callback function. | |
| 264 | + | func (x *SocketClass) GetGReserved10() func() { | |
| 265 | + | if x.xGReserved10 == 0 { | |
| 266 | + | return nil | |
| 267 | + | } | |
| 268 | + | var rawCallback func() | |
| 269 | + | purego.RegisterFunc(&rawCallback, x.xGReserved10) | |
| 270 | + | return func() { | |
| 271 | + | rawCallback() | |
| 272 | + | } | |
| 273 | + | } | |
| 274 | + | ||
| 25 | 275 | type SocketPrivate struct { | |
| 26 | 276 | _ structs.HostLayout | |
| 27 | 277 | } | |
| @@ -869,7 +1119,7 @@ func (x *Socket) Receive(BufferVar []byte, SizeVar uint, CancellableVar *Cancell | |||
| 869 | 1119 | ||
| 870 | 1120 | } | |
| 871 | 1121 | ||
| 872 | - | var xSocketReceiveFrom func(uintptr, *uintptr, []byte, uint, uintptr, **glib.Error) int | |
| 1122 | + | var xSocketReceiveFrom func(uintptr, uintptr, []byte, uint, uintptr, **glib.Error) int | |
| 873 | 1123 | ||
| 874 | 1124 | // Receive data (up to @size bytes) from a socket. | |
| 875 | 1125 | // | |
| @@ -881,7 +1131,7 @@ var xSocketReceiveFrom func(uintptr, *uintptr, []byte, uint, uintptr, **glib.Err | |||
| 881 | 1131 | func (x *Socket) ReceiveFrom(AddressVar **SocketAddress, BufferVar []byte, SizeVar uint, CancellableVar *Cancellable) (int, error) { | |
| 882 | 1132 | var cerr *glib.Error | |
| 883 | 1133 | ||
| 884 | - | cret := xSocketReceiveFrom(x.GoPointer(), gobject.ConvertPtr(AddressVar), BufferVar, SizeVar, CancellableVar.GoPointer(), &cerr) | |
| 1134 | + | cret := xSocketReceiveFrom(x.GoPointer(), *gobject.ConvertPtr(AddressVar), BufferVar, SizeVar, CancellableVar.GoPointer(), &cerr) | |
| 885 | 1135 | if cerr == nil { | |
| 886 | 1136 | return cret, nil | |
| 887 | 1137 | } | |
| @@ -889,7 +1139,7 @@ func (x *Socket) ReceiveFrom(AddressVar **SocketAddress, BufferVar []byte, SizeV | |||
| 889 | 1139 | ||
| 890 | 1140 | } | |
| 891 | 1141 | ||
| 892 | - | var xSocketReceiveMessage func(uintptr, *uintptr, []InputVector, int, uintptr, int, int, uintptr, **glib.Error) int | |
| 1142 | + | var xSocketReceiveMessage func(uintptr, uintptr, []InputVector, int, uintptr, int, int, uintptr, **glib.Error) int | |
| 893 | 1143 | ||
| 894 | 1144 | // Receive data from a socket. For receiving multiple messages, see | |
| 895 | 1145 | // g_socket_receive_messages(); for easier use, see | |
| @@ -953,7 +1203,7 @@ var xSocketReceiveMessage func(uintptr, *uintptr, []InputVector, int, uintptr, i | |||
| 953 | 1203 | func (x *Socket) ReceiveMessage(AddressVar **SocketAddress, VectorsVar []InputVector, NumVectorsVar int, MessagesVar uintptr, NumMessagesVar int, FlagsVar int, CancellableVar *Cancellable) (int, error) { | |
| 954 | 1204 | var cerr *glib.Error | |
| 955 | 1205 | ||
| 956 | - | cret := xSocketReceiveMessage(x.GoPointer(), gobject.ConvertPtr(AddressVar), VectorsVar, NumVectorsVar, MessagesVar, NumMessagesVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 1206 | + | cret := xSocketReceiveMessage(x.GoPointer(), *gobject.ConvertPtr(AddressVar), VectorsVar, NumVectorsVar, MessagesVar, NumMessagesVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 957 | 1207 | if cerr == nil { | |
| 958 | 1208 | return cret, nil | |
| 959 | 1209 | } | |
M v4/gio/gsocketaddress.go +76 -1
| @@ -15,13 +15,88 @@ import ( | |||
| 15 | 15 | type SocketAddressClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xGetFamily uintptr | |
| 21 | + | ||
| 22 | + | xGetNativeSize uintptr | |
| 23 | + | ||
| 24 | + | xToNative uintptr | |
| 19 | 25 | } | |
| 20 | 26 | ||
| 21 | 27 | func (x *SocketAddressClass) GoPointer() uintptr { | |
| 22 | 28 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 29 | } | |
| 24 | 30 | ||
| 31 | + | // OverrideGetFamily sets the callback function. | |
| 32 | + | func (x *SocketAddressClass) OverrideGetFamily(cb func(*SocketAddress) SocketFamily) { | |
| 33 | + | if cb == nil { | |
| 34 | + | x.xGetFamily = 0 | |
| 35 | + | } else { | |
| 36 | + | x.xGetFamily = purego.NewCallback(func(AddressVarp uintptr) SocketFamily { | |
| 37 | + | return cb(SocketAddressNewFromInternalPtr(AddressVarp)) | |
| 38 | + | }) | |
| 39 | + | } | |
| 40 | + | } | |
| 41 | + | ||
| 42 | + | // GetGetFamily gets the callback function. | |
| 43 | + | func (x *SocketAddressClass) GetGetFamily() func(*SocketAddress) SocketFamily { | |
| 44 | + | if x.xGetFamily == 0 { | |
| 45 | + | return nil | |
| 46 | + | } | |
| 47 | + | var rawCallback func(AddressVarp uintptr) SocketFamily | |
| 48 | + | purego.RegisterFunc(&rawCallback, x.xGetFamily) | |
| 49 | + | return func(AddressVar *SocketAddress) SocketFamily { | |
| 50 | + | return rawCallback(AddressVar.GoPointer()) | |
| 51 | + | } | |
| 52 | + | } | |
| 53 | + | ||
| 54 | + | // OverrideGetNativeSize sets the callback function. | |
| 55 | + | func (x *SocketAddressClass) OverrideGetNativeSize(cb func(*SocketAddress) int) { | |
| 56 | + | if cb == nil { | |
| 57 | + | x.xGetNativeSize = 0 | |
| 58 | + | } else { | |
| 59 | + | x.xGetNativeSize = purego.NewCallback(func(AddressVarp uintptr) int { | |
| 60 | + | return cb(SocketAddressNewFromInternalPtr(AddressVarp)) | |
| 61 | + | }) | |
| 62 | + | } | |
| 63 | + | } | |
| 64 | + | ||
| 65 | + | // GetGetNativeSize gets the callback function. | |
| 66 | + | func (x *SocketAddressClass) GetGetNativeSize() func(*SocketAddress) int { | |
| 67 | + | if x.xGetNativeSize == 0 { | |
| 68 | + | return nil | |
| 69 | + | } | |
| 70 | + | var rawCallback func(AddressVarp uintptr) int | |
| 71 | + | purego.RegisterFunc(&rawCallback, x.xGetNativeSize) | |
| 72 | + | return func(AddressVar *SocketAddress) int { | |
| 73 | + | return rawCallback(AddressVar.GoPointer()) | |
| 74 | + | } | |
| 75 | + | } | |
| 76 | + | ||
| 77 | + | // OverrideToNative sets the callback function. | |
| 78 | + | func (x *SocketAddressClass) OverrideToNative(cb func(*SocketAddress, uintptr, uint) bool) { | |
| 79 | + | if cb == nil { | |
| 80 | + | x.xToNative = 0 | |
| 81 | + | } else { | |
| 82 | + | x.xToNative = purego.NewCallback(func(AddressVarp uintptr, DestVarp uintptr, DestlenVarp uint) bool { | |
| 83 | + | return cb(SocketAddressNewFromInternalPtr(AddressVarp), DestVarp, DestlenVarp) | |
| 84 | + | }) | |
| 85 | + | } | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | // GetToNative gets the callback function. | |
| 89 | + | func (x *SocketAddressClass) GetToNative() func(*SocketAddress, uintptr, uint) bool { | |
| 90 | + | if x.xToNative == 0 { | |
| 91 | + | return nil | |
| 92 | + | } | |
| 93 | + | var rawCallback func(AddressVarp uintptr, DestVarp uintptr, DestlenVarp uint) bool | |
| 94 | + | purego.RegisterFunc(&rawCallback, x.xToNative) | |
| 95 | + | return func(AddressVar *SocketAddress, DestVar uintptr, DestlenVar uint) bool { | |
| 96 | + | return rawCallback(AddressVar.GoPointer(), DestVar, DestlenVar) | |
| 97 | + | } | |
| 98 | + | } | |
| 99 | + | ||
| 25 | 100 | // #GSocketAddress is the equivalent of struct sockaddr in the BSD | |
| 26 | 101 | // sockets API. This is an abstract class; use #GInetSocketAddress | |
| 27 | 102 | // for internet sockets, or #GUnixSocketAddress for UNIX domain sockets. | |
M v4/gio/gsocketaddressenumerator.go +96 -1
| @@ -16,13 +16,108 @@ import ( | |||
| 16 | 16 | type SocketAddressEnumeratorClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | + | ||
| 21 | + | xNext uintptr | |
| 22 | + | ||
| 23 | + | xNextAsync uintptr | |
| 24 | + | ||
| 25 | + | xNextFinish uintptr | |
| 20 | 26 | } | |
| 21 | 27 | ||
| 22 | 28 | func (x *SocketAddressEnumeratorClass) GoPointer() uintptr { | |
| 23 | 29 | return uintptr(unsafe.Pointer(x)) | |
| 24 | 30 | } | |
| 25 | 31 | ||
| 32 | + | // OverrideNext sets the callback function. | |
| 33 | + | func (x *SocketAddressEnumeratorClass) OverrideNext(cb func(*SocketAddressEnumerator, *Cancellable) *SocketAddress) { | |
| 34 | + | if cb == nil { | |
| 35 | + | x.xNext = 0 | |
| 36 | + | } else { | |
| 37 | + | x.xNext = purego.NewCallback(func(EnumeratorVarp uintptr, CancellableVarp uintptr) uintptr { | |
| 38 | + | ret := cb(SocketAddressEnumeratorNewFromInternalPtr(EnumeratorVarp), CancellableNewFromInternalPtr(CancellableVarp)) | |
| 39 | + | if ret == nil { | |
| 40 | + | return 0 | |
| 41 | + | } | |
| 42 | + | return ret.GoPointer() | |
| 43 | + | }) | |
| 44 | + | } | |
| 45 | + | } | |
| 46 | + | ||
| 47 | + | // GetNext gets the callback function. | |
| 48 | + | func (x *SocketAddressEnumeratorClass) GetNext() func(*SocketAddressEnumerator, *Cancellable) *SocketAddress { | |
| 49 | + | if x.xNext == 0 { | |
| 50 | + | return nil | |
| 51 | + | } | |
| 52 | + | var rawCallback func(EnumeratorVarp uintptr, CancellableVarp uintptr) uintptr | |
| 53 | + | purego.RegisterFunc(&rawCallback, x.xNext) | |
| 54 | + | return func(EnumeratorVar *SocketAddressEnumerator, CancellableVar *Cancellable) *SocketAddress { | |
| 55 | + | rawRet := rawCallback(EnumeratorVar.GoPointer(), CancellableVar.GoPointer()) | |
| 56 | + | if rawRet == 0 { | |
| 57 | + | return nil | |
| 58 | + | } | |
| 59 | + | ret := &SocketAddress{} | |
| 60 | + | ret.Ptr = rawRet | |
| 61 | + | return ret | |
| 62 | + | } | |
| 63 | + | } | |
| 64 | + | ||
| 65 | + | // OverrideNextAsync sets the callback function. | |
| 66 | + | func (x *SocketAddressEnumeratorClass) OverrideNextAsync(cb func(*SocketAddressEnumerator, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 67 | + | if cb == nil { | |
| 68 | + | x.xNextAsync = 0 | |
| 69 | + | } else { | |
| 70 | + | x.xNextAsync = purego.NewCallback(func(EnumeratorVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 71 | + | cb(SocketAddressEnumeratorNewFromInternalPtr(EnumeratorVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 72 | + | }) | |
| 73 | + | } | |
| 74 | + | } | |
| 75 | + | ||
| 76 | + | // GetNextAsync gets the callback function. | |
| 77 | + | func (x *SocketAddressEnumeratorClass) GetNextAsync() func(*SocketAddressEnumerator, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 78 | + | if x.xNextAsync == 0 { | |
| 79 | + | return nil | |
| 80 | + | } | |
| 81 | + | var rawCallback func(EnumeratorVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 82 | + | purego.RegisterFunc(&rawCallback, x.xNextAsync) | |
| 83 | + | return func(EnumeratorVar *SocketAddressEnumerator, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 84 | + | rawCallback(EnumeratorVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 85 | + | } | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | // OverrideNextFinish sets the callback function. | |
| 89 | + | func (x *SocketAddressEnumeratorClass) OverrideNextFinish(cb func(*SocketAddressEnumerator, AsyncResult) *SocketAddress) { | |
| 90 | + | if cb == nil { | |
| 91 | + | x.xNextFinish = 0 | |
| 92 | + | } else { | |
| 93 | + | x.xNextFinish = purego.NewCallback(func(EnumeratorVarp uintptr, ResultVarp uintptr) uintptr { | |
| 94 | + | ret := cb(SocketAddressEnumeratorNewFromInternalPtr(EnumeratorVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 95 | + | if ret == nil { | |
| 96 | + | return 0 | |
| 97 | + | } | |
| 98 | + | return ret.GoPointer() | |
| 99 | + | }) | |
| 100 | + | } | |
| 101 | + | } | |
| 102 | + | ||
| 103 | + | // GetNextFinish gets the callback function. | |
| 104 | + | func (x *SocketAddressEnumeratorClass) GetNextFinish() func(*SocketAddressEnumerator, AsyncResult) *SocketAddress { | |
| 105 | + | if x.xNextFinish == 0 { | |
| 106 | + | return nil | |
| 107 | + | } | |
| 108 | + | var rawCallback func(EnumeratorVarp uintptr, ResultVarp uintptr) uintptr | |
| 109 | + | purego.RegisterFunc(&rawCallback, x.xNextFinish) | |
| 110 | + | return func(EnumeratorVar *SocketAddressEnumerator, ResultVar AsyncResult) *SocketAddress { | |
| 111 | + | rawRet := rawCallback(EnumeratorVar.GoPointer(), ResultVar.GoPointer()) | |
| 112 | + | if rawRet == 0 { | |
| 113 | + | return nil | |
| 114 | + | } | |
| 115 | + | ret := &SocketAddress{} | |
| 116 | + | ret.Ptr = rawRet | |
| 117 | + | return ret | |
| 118 | + | } | |
| 119 | + | } | |
| 120 | + | ||
| 26 | 121 | // #GSocketAddressEnumerator is an enumerator type for #GSocketAddress | |
| 27 | 122 | // instances. It is returned by enumeration functions such as | |
| 28 | 123 | // g_socket_connectable_enumerate(), which returns a #GSocketAddressEnumerator | |
M v4/gio/gsocketclient.go +126 -1
| @@ -15,13 +15,138 @@ import ( | |||
| 15 | 15 | type SocketClientClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xEvent uintptr | |
| 21 | + | ||
| 22 | + | xGReserved1 uintptr | |
| 23 | + | ||
| 24 | + | xGReserved2 uintptr | |
| 25 | + | ||
| 26 | + | xGReserved3 uintptr | |
| 27 | + | ||
| 28 | + | xGReserved4 uintptr | |
| 19 | 29 | } | |
| 20 | 30 | ||
| 21 | 31 | func (x *SocketClientClass) GoPointer() uintptr { | |
| 22 | 32 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 33 | } | |
| 24 | 34 | ||
| 35 | + | // OverrideEvent sets the callback function. | |
| 36 | + | func (x *SocketClientClass) OverrideEvent(cb func(*SocketClient, SocketClientEvent, SocketConnectable, *IOStream)) { | |
| 37 | + | if cb == nil { | |
| 38 | + | x.xEvent = 0 | |
| 39 | + | } else { | |
| 40 | + | x.xEvent = purego.NewCallback(func(ClientVarp uintptr, EventVarp SocketClientEvent, ConnectableVarp uintptr, ConnectionVarp uintptr) { | |
| 41 | + | cb(SocketClientNewFromInternalPtr(ClientVarp), EventVarp, &SocketConnectableBase{Ptr: ConnectableVarp}, IOStreamNewFromInternalPtr(ConnectionVarp)) | |
| 42 | + | }) | |
| 43 | + | } | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | // GetEvent gets the callback function. | |
| 47 | + | func (x *SocketClientClass) GetEvent() func(*SocketClient, SocketClientEvent, SocketConnectable, *IOStream) { | |
| 48 | + | if x.xEvent == 0 { | |
| 49 | + | return nil | |
| 50 | + | } | |
| 51 | + | var rawCallback func(ClientVarp uintptr, EventVarp SocketClientEvent, ConnectableVarp uintptr, ConnectionVarp uintptr) | |
| 52 | + | purego.RegisterFunc(&rawCallback, x.xEvent) | |
| 53 | + | return func(ClientVar *SocketClient, EventVar SocketClientEvent, ConnectableVar SocketConnectable, ConnectionVar *IOStream) { | |
| 54 | + | rawCallback(ClientVar.GoPointer(), EventVar, ConnectableVar.GoPointer(), ConnectionVar.GoPointer()) | |
| 55 | + | } | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | // OverrideGReserved1 sets the callback function. | |
| 59 | + | func (x *SocketClientClass) OverrideGReserved1(cb func()) { | |
| 60 | + | if cb == nil { | |
| 61 | + | x.xGReserved1 = 0 | |
| 62 | + | } else { | |
| 63 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 64 | + | cb() | |
| 65 | + | }) | |
| 66 | + | } | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | // GetGReserved1 gets the callback function. | |
| 70 | + | func (x *SocketClientClass) GetGReserved1() func() { | |
| 71 | + | if x.xGReserved1 == 0 { | |
| 72 | + | return nil | |
| 73 | + | } | |
| 74 | + | var rawCallback func() | |
| 75 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 76 | + | return func() { | |
| 77 | + | rawCallback() | |
| 78 | + | } | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | // OverrideGReserved2 sets the callback function. | |
| 82 | + | func (x *SocketClientClass) OverrideGReserved2(cb func()) { | |
| 83 | + | if cb == nil { | |
| 84 | + | x.xGReserved2 = 0 | |
| 85 | + | } else { | |
| 86 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 87 | + | cb() | |
| 88 | + | }) | |
| 89 | + | } | |
| 90 | + | } | |
| 91 | + | ||
| 92 | + | // GetGReserved2 gets the callback function. | |
| 93 | + | func (x *SocketClientClass) GetGReserved2() func() { | |
| 94 | + | if x.xGReserved2 == 0 { | |
| 95 | + | return nil | |
| 96 | + | } | |
| 97 | + | var rawCallback func() | |
| 98 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 99 | + | return func() { | |
| 100 | + | rawCallback() | |
| 101 | + | } | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | // OverrideGReserved3 sets the callback function. | |
| 105 | + | func (x *SocketClientClass) OverrideGReserved3(cb func()) { | |
| 106 | + | if cb == nil { | |
| 107 | + | x.xGReserved3 = 0 | |
| 108 | + | } else { | |
| 109 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 110 | + | cb() | |
| 111 | + | }) | |
| 112 | + | } | |
| 113 | + | } | |
| 114 | + | ||
| 115 | + | // GetGReserved3 gets the callback function. | |
| 116 | + | func (x *SocketClientClass) GetGReserved3() func() { | |
| 117 | + | if x.xGReserved3 == 0 { | |
| 118 | + | return nil | |
| 119 | + | } | |
| 120 | + | var rawCallback func() | |
| 121 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 122 | + | return func() { | |
| 123 | + | rawCallback() | |
| 124 | + | } | |
| 125 | + | } | |
| 126 | + | ||
| 127 | + | // OverrideGReserved4 sets the callback function. | |
| 128 | + | func (x *SocketClientClass) OverrideGReserved4(cb func()) { | |
| 129 | + | if cb == nil { | |
| 130 | + | x.xGReserved4 = 0 | |
| 131 | + | } else { | |
| 132 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 133 | + | cb() | |
| 134 | + | }) | |
| 135 | + | } | |
| 136 | + | } | |
| 137 | + | ||
| 138 | + | // GetGReserved4 gets the callback function. | |
| 139 | + | func (x *SocketClientClass) GetGReserved4() func() { | |
| 140 | + | if x.xGReserved4 == 0 { | |
| 141 | + | return nil | |
| 142 | + | } | |
| 143 | + | var rawCallback func() | |
| 144 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 145 | + | return func() { | |
| 146 | + | rawCallback() | |
| 147 | + | } | |
| 148 | + | } | |
| 149 | + | ||
| 25 | 150 | type SocketClientPrivate struct { | |
| 26 | 151 | _ structs.HostLayout | |
| 27 | 152 | } | |
M v4/gio/gsocketconnectable.go +95 -0
| @@ -16,12 +16,107 @@ type SocketConnectableIface struct { | |||
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | 18 | GIface uintptr | |
| 19 | + | ||
| 20 | + | xEnumerate uintptr | |
| 21 | + | ||
| 22 | + | xProxyEnumerate uintptr | |
| 23 | + | ||
| 24 | + | xToString uintptr | |
| 19 | 25 | } | |
| 20 | 26 | ||
| 21 | 27 | func (x *SocketConnectableIface) GoPointer() uintptr { | |
| 22 | 28 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 29 | } | |
| 24 | 30 | ||
| 31 | + | // OverrideEnumerate sets the callback function. | |
| 32 | + | func (x *SocketConnectableIface) OverrideEnumerate(cb func(SocketConnectable) *SocketAddressEnumerator) { | |
| 33 | + | if cb == nil { | |
| 34 | + | x.xEnumerate = 0 | |
| 35 | + | } else { | |
| 36 | + | x.xEnumerate = purego.NewCallback(func(ConnectableVarp uintptr) uintptr { | |
| 37 | + | ret := cb(&SocketConnectableBase{Ptr: ConnectableVarp}) | |
| 38 | + | if ret == nil { | |
| 39 | + | return 0 | |
| 40 | + | } | |
| 41 | + | return ret.GoPointer() | |
| 42 | + | }) | |
| 43 | + | } | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | // GetEnumerate gets the callback function. | |
| 47 | + | func (x *SocketConnectableIface) GetEnumerate() func(SocketConnectable) *SocketAddressEnumerator { | |
| 48 | + | if x.xEnumerate == 0 { | |
| 49 | + | return nil | |
| 50 | + | } | |
| 51 | + | var rawCallback func(ConnectableVarp uintptr) uintptr | |
| 52 | + | purego.RegisterFunc(&rawCallback, x.xEnumerate) | |
| 53 | + | return func(ConnectableVar SocketConnectable) *SocketAddressEnumerator { | |
| 54 | + | rawRet := rawCallback(ConnectableVar.GoPointer()) | |
| 55 | + | if rawRet == 0 { | |
| 56 | + | return nil | |
| 57 | + | } | |
| 58 | + | ret := &SocketAddressEnumerator{} | |
| 59 | + | ret.Ptr = rawRet | |
| 60 | + | return ret | |
| 61 | + | } | |
| 62 | + | } | |
| 63 | + | ||
| 64 | + | // OverrideProxyEnumerate sets the callback function. | |
| 65 | + | func (x *SocketConnectableIface) OverrideProxyEnumerate(cb func(SocketConnectable) *SocketAddressEnumerator) { | |
| 66 | + | if cb == nil { | |
| 67 | + | x.xProxyEnumerate = 0 | |
| 68 | + | } else { | |
| 69 | + | x.xProxyEnumerate = purego.NewCallback(func(ConnectableVarp uintptr) uintptr { | |
| 70 | + | ret := cb(&SocketConnectableBase{Ptr: ConnectableVarp}) | |
| 71 | + | if ret == nil { | |
| 72 | + | return 0 | |
| 73 | + | } | |
| 74 | + | return ret.GoPointer() | |
| 75 | + | }) | |
| 76 | + | } | |
| 77 | + | } | |
| 78 | + | ||
| 79 | + | // GetProxyEnumerate gets the callback function. | |
| 80 | + | func (x *SocketConnectableIface) GetProxyEnumerate() func(SocketConnectable) *SocketAddressEnumerator { | |
| 81 | + | if x.xProxyEnumerate == 0 { | |
| 82 | + | return nil | |
| 83 | + | } | |
| 84 | + | var rawCallback func(ConnectableVarp uintptr) uintptr | |
| 85 | + | purego.RegisterFunc(&rawCallback, x.xProxyEnumerate) | |
| 86 | + | return func(ConnectableVar SocketConnectable) *SocketAddressEnumerator { | |
| 87 | + | rawRet := rawCallback(ConnectableVar.GoPointer()) | |
| 88 | + | if rawRet == 0 { | |
| 89 | + | return nil | |
| 90 | + | } | |
| 91 | + | ret := &SocketAddressEnumerator{} | |
| 92 | + | ret.Ptr = rawRet | |
| 93 | + | return ret | |
| 94 | + | } | |
| 95 | + | } | |
| 96 | + | ||
| 97 | + | // OverrideToString sets the callback function. | |
| 98 | + | func (x *SocketConnectableIface) OverrideToString(cb func(SocketConnectable) string) { | |
| 99 | + | if cb == nil { | |
| 100 | + | x.xToString = 0 | |
| 101 | + | } else { | |
| 102 | + | x.xToString = purego.NewCallback(func(ConnectableVarp uintptr) string { | |
| 103 | + | return cb(&SocketConnectableBase{Ptr: ConnectableVarp}) | |
| 104 | + | }) | |
| 105 | + | } | |
| 106 | + | } | |
| 107 | + | ||
| 108 | + | // GetToString gets the callback function. | |
| 109 | + | func (x *SocketConnectableIface) GetToString() func(SocketConnectable) string { | |
| 110 | + | if x.xToString == 0 { | |
| 111 | + | return nil | |
| 112 | + | } | |
| 113 | + | var rawCallback func(ConnectableVarp uintptr) string | |
| 114 | + | purego.RegisterFunc(&rawCallback, x.xToString) | |
| 115 | + | return func(ConnectableVar SocketConnectable) string { | |
| 116 | + | return rawCallback(ConnectableVar.GoPointer()) | |
| 117 | + | } | |
| 118 | + | } | |
| 119 | + | ||
| 25 | 120 | // Objects that describe one or more potential socket endpoints | |
| 26 | 121 | // implement #GSocketConnectable. Callers can then use | |
| 27 | 122 | // g_socket_connectable_enumerate() to get a #GSocketAddressEnumerator | |
M v4/gio/gsocketconnection.go +151 -1
| @@ -15,13 +15,163 @@ import ( | |||
| 15 | 15 | type SocketConnectionClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass IOStreamClass | |
| 19 | + | ||
| 20 | + | xGReserved1 uintptr | |
| 21 | + | ||
| 22 | + | xGReserved2 uintptr | |
| 23 | + | ||
| 24 | + | xGReserved3 uintptr | |
| 25 | + | ||
| 26 | + | xGReserved4 uintptr | |
| 27 | + | ||
| 28 | + | xGReserved5 uintptr | |
| 29 | + | ||
| 30 | + | xGReserved6 uintptr | |
| 19 | 31 | } | |
| 20 | 32 | ||
| 21 | 33 | func (x *SocketConnectionClass) GoPointer() uintptr { | |
| 22 | 34 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 35 | } | |
| 24 | 36 | ||
| 37 | + | // OverrideGReserved1 sets the callback function. | |
| 38 | + | func (x *SocketConnectionClass) OverrideGReserved1(cb func()) { | |
| 39 | + | if cb == nil { | |
| 40 | + | x.xGReserved1 = 0 | |
| 41 | + | } else { | |
| 42 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 43 | + | cb() | |
| 44 | + | }) | |
| 45 | + | } | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | // GetGReserved1 gets the callback function. | |
| 49 | + | func (x *SocketConnectionClass) GetGReserved1() func() { | |
| 50 | + | if x.xGReserved1 == 0 { | |
| 51 | + | return nil | |
| 52 | + | } | |
| 53 | + | var rawCallback func() | |
| 54 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 55 | + | return func() { | |
| 56 | + | rawCallback() | |
| 57 | + | } | |
| 58 | + | } | |
| 59 | + | ||
| 60 | + | // OverrideGReserved2 sets the callback function. | |
| 61 | + | func (x *SocketConnectionClass) OverrideGReserved2(cb func()) { | |
| 62 | + | if cb == nil { | |
| 63 | + | x.xGReserved2 = 0 | |
| 64 | + | } else { | |
| 65 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 66 | + | cb() | |
| 67 | + | }) | |
| 68 | + | } | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | // GetGReserved2 gets the callback function. | |
| 72 | + | func (x *SocketConnectionClass) GetGReserved2() func() { | |
| 73 | + | if x.xGReserved2 == 0 { | |
| 74 | + | return nil | |
| 75 | + | } | |
| 76 | + | var rawCallback func() | |
| 77 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 78 | + | return func() { | |
| 79 | + | rawCallback() | |
| 80 | + | } | |
| 81 | + | } | |
| 82 | + | ||
| 83 | + | // OverrideGReserved3 sets the callback function. | |
| 84 | + | func (x *SocketConnectionClass) OverrideGReserved3(cb func()) { | |
| 85 | + | if cb == nil { | |
| 86 | + | x.xGReserved3 = 0 | |
| 87 | + | } else { | |
| 88 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 89 | + | cb() | |
| 90 | + | }) | |
| 91 | + | } | |
| 92 | + | } | |
| 93 | + | ||
| 94 | + | // GetGReserved3 gets the callback function. | |
| 95 | + | func (x *SocketConnectionClass) GetGReserved3() func() { | |
| 96 | + | if x.xGReserved3 == 0 { | |
| 97 | + | return nil | |
| 98 | + | } | |
| 99 | + | var rawCallback func() | |
| 100 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 101 | + | return func() { | |
| 102 | + | rawCallback() | |
| 103 | + | } | |
| 104 | + | } | |
| 105 | + | ||
| 106 | + | // OverrideGReserved4 sets the callback function. | |
| 107 | + | func (x *SocketConnectionClass) OverrideGReserved4(cb func()) { | |
| 108 | + | if cb == nil { | |
| 109 | + | x.xGReserved4 = 0 | |
| 110 | + | } else { | |
| 111 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 112 | + | cb() | |
| 113 | + | }) | |
| 114 | + | } | |
| 115 | + | } | |
| 116 | + | ||
| 117 | + | // GetGReserved4 gets the callback function. | |
| 118 | + | func (x *SocketConnectionClass) GetGReserved4() func() { | |
| 119 | + | if x.xGReserved4 == 0 { | |
| 120 | + | return nil | |
| 121 | + | } | |
| 122 | + | var rawCallback func() | |
| 123 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 124 | + | return func() { | |
| 125 | + | rawCallback() | |
| 126 | + | } | |
| 127 | + | } | |
| 128 | + | ||
| 129 | + | // OverrideGReserved5 sets the callback function. | |
| 130 | + | func (x *SocketConnectionClass) OverrideGReserved5(cb func()) { | |
| 131 | + | if cb == nil { | |
| 132 | + | x.xGReserved5 = 0 | |
| 133 | + | } else { | |
| 134 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 135 | + | cb() | |
| 136 | + | }) | |
| 137 | + | } | |
| 138 | + | } | |
| 139 | + | ||
| 140 | + | // GetGReserved5 gets the callback function. | |
| 141 | + | func (x *SocketConnectionClass) GetGReserved5() func() { | |
| 142 | + | if x.xGReserved5 == 0 { | |
| 143 | + | return nil | |
| 144 | + | } | |
| 145 | + | var rawCallback func() | |
| 146 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 147 | + | return func() { | |
| 148 | + | rawCallback() | |
| 149 | + | } | |
| 150 | + | } | |
| 151 | + | ||
| 152 | + | // OverrideGReserved6 sets the callback function. | |
| 153 | + | func (x *SocketConnectionClass) OverrideGReserved6(cb func()) { | |
| 154 | + | if cb == nil { | |
| 155 | + | x.xGReserved6 = 0 | |
| 156 | + | } else { | |
| 157 | + | x.xGReserved6 = purego.NewCallback(func() { | |
| 158 | + | cb() | |
| 159 | + | }) | |
| 160 | + | } | |
| 161 | + | } | |
| 162 | + | ||
| 163 | + | // GetGReserved6 gets the callback function. | |
| 164 | + | func (x *SocketConnectionClass) GetGReserved6() func() { | |
| 165 | + | if x.xGReserved6 == 0 { | |
| 166 | + | return nil | |
| 167 | + | } | |
| 168 | + | var rawCallback func() | |
| 169 | + | purego.RegisterFunc(&rawCallback, x.xGReserved6) | |
| 170 | + | return func() { | |
| 171 | + | rawCallback() | |
| 172 | + | } | |
| 173 | + | } | |
| 174 | + | ||
| 25 | 175 | type SocketConnectionPrivate struct { | |
| 26 | 176 | _ structs.HostLayout | |
| 27 | 177 | } | |
M v4/gio/gsocketcontrolmessage.go +261 -1
| @@ -15,13 +15,273 @@ import ( | |||
| 15 | 15 | type SocketControlMessageClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xGetSize uintptr | |
| 21 | + | ||
| 22 | + | xGetLevel uintptr | |
| 23 | + | ||
| 24 | + | xGetType uintptr | |
| 25 | + | ||
| 26 | + | xSerialize uintptr | |
| 27 | + | ||
| 28 | + | xDeserialize uintptr | |
| 29 | + | ||
| 30 | + | xGReserved1 uintptr | |
| 31 | + | ||
| 32 | + | xGReserved2 uintptr | |
| 33 | + | ||
| 34 | + | xGReserved3 uintptr | |
| 35 | + | ||
| 36 | + | xGReserved4 uintptr | |
| 37 | + | ||
| 38 | + | xGReserved5 uintptr | |
| 19 | 39 | } | |
| 20 | 40 | ||
| 21 | 41 | func (x *SocketControlMessageClass) GoPointer() uintptr { | |
| 22 | 42 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 43 | } | |
| 24 | 44 | ||
| 45 | + | // OverrideGetSize sets the callback function. | |
| 46 | + | func (x *SocketControlMessageClass) OverrideGetSize(cb func(*SocketControlMessage) uint) { | |
| 47 | + | if cb == nil { | |
| 48 | + | x.xGetSize = 0 | |
| 49 | + | } else { | |
| 50 | + | x.xGetSize = purego.NewCallback(func(MessageVarp uintptr) uint { | |
| 51 | + | return cb(SocketControlMessageNewFromInternalPtr(MessageVarp)) | |
| 52 | + | }) | |
| 53 | + | } | |
| 54 | + | } | |
| 55 | + | ||
| 56 | + | // GetGetSize gets the callback function. | |
| 57 | + | func (x *SocketControlMessageClass) GetGetSize() func(*SocketControlMessage) uint { | |
| 58 | + | if x.xGetSize == 0 { | |
| 59 | + | return nil | |
| 60 | + | } | |
| 61 | + | var rawCallback func(MessageVarp uintptr) uint | |
| 62 | + | purego.RegisterFunc(&rawCallback, x.xGetSize) | |
| 63 | + | return func(MessageVar *SocketControlMessage) uint { | |
| 64 | + | return rawCallback(MessageVar.GoPointer()) | |
| 65 | + | } | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | // OverrideGetLevel sets the callback function. | |
| 69 | + | func (x *SocketControlMessageClass) OverrideGetLevel(cb func(*SocketControlMessage) int) { | |
| 70 | + | if cb == nil { | |
| 71 | + | x.xGetLevel = 0 | |
| 72 | + | } else { | |
| 73 | + | x.xGetLevel = purego.NewCallback(func(MessageVarp uintptr) int { | |
| 74 | + | return cb(SocketControlMessageNewFromInternalPtr(MessageVarp)) | |
| 75 | + | }) | |
| 76 | + | } | |
| 77 | + | } | |
| 78 | + | ||
| 79 | + | // GetGetLevel gets the callback function. | |
| 80 | + | func (x *SocketControlMessageClass) GetGetLevel() func(*SocketControlMessage) int { | |
| 81 | + | if x.xGetLevel == 0 { | |
| 82 | + | return nil | |
| 83 | + | } | |
| 84 | + | var rawCallback func(MessageVarp uintptr) int | |
| 85 | + | purego.RegisterFunc(&rawCallback, x.xGetLevel) | |
| 86 | + | return func(MessageVar *SocketControlMessage) int { | |
| 87 | + | return rawCallback(MessageVar.GoPointer()) | |
| 88 | + | } | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | // OverrideGetType sets the callback function. | |
| 92 | + | func (x *SocketControlMessageClass) OverrideGetType(cb func(*SocketControlMessage) int) { | |
| 93 | + | if cb == nil { | |
| 94 | + | x.xGetType = 0 | |
| 95 | + | } else { | |
| 96 | + | x.xGetType = purego.NewCallback(func(MessageVarp uintptr) int { | |
| 97 | + | return cb(SocketControlMessageNewFromInternalPtr(MessageVarp)) | |
| 98 | + | }) | |
| 99 | + | } | |
| 100 | + | } | |
| 101 | + | ||
| 102 | + | // GetGetType gets the callback function. | |
| 103 | + | func (x *SocketControlMessageClass) GetGetType() func(*SocketControlMessage) int { | |
| 104 | + | if x.xGetType == 0 { | |
| 105 | + | return nil | |
| 106 | + | } | |
| 107 | + | var rawCallback func(MessageVarp uintptr) int | |
| 108 | + | purego.RegisterFunc(&rawCallback, x.xGetType) | |
| 109 | + | return func(MessageVar *SocketControlMessage) int { | |
| 110 | + | return rawCallback(MessageVar.GoPointer()) | |
| 111 | + | } | |
| 112 | + | } | |
| 113 | + | ||
| 114 | + | // OverrideSerialize sets the callback function. | |
| 115 | + | func (x *SocketControlMessageClass) OverrideSerialize(cb func(*SocketControlMessage, uintptr)) { | |
| 116 | + | if cb == nil { | |
| 117 | + | x.xSerialize = 0 | |
| 118 | + | } else { | |
| 119 | + | x.xSerialize = purego.NewCallback(func(MessageVarp uintptr, DataVarp uintptr) { | |
| 120 | + | cb(SocketControlMessageNewFromInternalPtr(MessageVarp), DataVarp) | |
| 121 | + | }) | |
| 122 | + | } | |
| 123 | + | } | |
| 124 | + | ||
| 125 | + | // GetSerialize gets the callback function. | |
| 126 | + | func (x *SocketControlMessageClass) GetSerialize() func(*SocketControlMessage, uintptr) { | |
| 127 | + | if x.xSerialize == 0 { | |
| 128 | + | return nil | |
| 129 | + | } | |
| 130 | + | var rawCallback func(MessageVarp uintptr, DataVarp uintptr) | |
| 131 | + | purego.RegisterFunc(&rawCallback, x.xSerialize) | |
| 132 | + | return func(MessageVar *SocketControlMessage, DataVar uintptr) { | |
| 133 | + | rawCallback(MessageVar.GoPointer(), DataVar) | |
| 134 | + | } | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | // OverrideDeserialize sets the callback function. | |
| 138 | + | func (x *SocketControlMessageClass) OverrideDeserialize(cb func(int, int, uint, uintptr) *SocketControlMessage) { | |
| 139 | + | if cb == nil { | |
| 140 | + | x.xDeserialize = 0 | |
| 141 | + | } else { | |
| 142 | + | x.xDeserialize = purego.NewCallback(func(LevelVarp int, TypeVarp int, SizeVarp uint, DataVarp uintptr) uintptr { | |
| 143 | + | ret := cb(LevelVarp, TypeVarp, SizeVarp, DataVarp) | |
| 144 | + | if ret == nil { | |
| 145 | + | return 0 | |
| 146 | + | } | |
| 147 | + | return ret.GoPointer() | |
| 148 | + | }) | |
| 149 | + | } | |
| 150 | + | } | |
| 151 | + | ||
| 152 | + | // GetDeserialize gets the callback function. | |
| 153 | + | func (x *SocketControlMessageClass) GetDeserialize() func(int, int, uint, uintptr) *SocketControlMessage { | |
| 154 | + | if x.xDeserialize == 0 { | |
| 155 | + | return nil | |
| 156 | + | } | |
| 157 | + | var rawCallback func(LevelVarp int, TypeVarp int, SizeVarp uint, DataVarp uintptr) uintptr | |
| 158 | + | purego.RegisterFunc(&rawCallback, x.xDeserialize) | |
| 159 | + | return func(LevelVar int, TypeVar int, SizeVar uint, DataVar uintptr) *SocketControlMessage { | |
| 160 | + | rawRet := rawCallback(LevelVar, TypeVar, SizeVar, DataVar) | |
| 161 | + | if rawRet == 0 { | |
| 162 | + | return nil | |
| 163 | + | } | |
| 164 | + | ret := &SocketControlMessage{} | |
| 165 | + | ret.Ptr = rawRet | |
| 166 | + | return ret | |
| 167 | + | } | |
| 168 | + | } | |
| 169 | + | ||
| 170 | + | // OverrideGReserved1 sets the callback function. | |
| 171 | + | func (x *SocketControlMessageClass) OverrideGReserved1(cb func()) { | |
| 172 | + | if cb == nil { | |
| 173 | + | x.xGReserved1 = 0 | |
| 174 | + | } else { | |
| 175 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 176 | + | cb() | |
| 177 | + | }) | |
| 178 | + | } | |
| 179 | + | } | |
| 180 | + | ||
| 181 | + | // GetGReserved1 gets the callback function. | |
| 182 | + | func (x *SocketControlMessageClass) GetGReserved1() func() { | |
| 183 | + | if x.xGReserved1 == 0 { | |
| 184 | + | return nil | |
| 185 | + | } | |
| 186 | + | var rawCallback func() | |
| 187 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 188 | + | return func() { | |
| 189 | + | rawCallback() | |
| 190 | + | } | |
| 191 | + | } | |
| 192 | + | ||
| 193 | + | // OverrideGReserved2 sets the callback function. | |
| 194 | + | func (x *SocketControlMessageClass) OverrideGReserved2(cb func()) { | |
| 195 | + | if cb == nil { | |
| 196 | + | x.xGReserved2 = 0 | |
| 197 | + | } else { | |
| 198 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 199 | + | cb() | |
| 200 | + | }) | |
| 201 | + | } | |
| 202 | + | } | |
| 203 | + | ||
| 204 | + | // GetGReserved2 gets the callback function. | |
| 205 | + | func (x *SocketControlMessageClass) GetGReserved2() func() { | |
| 206 | + | if x.xGReserved2 == 0 { | |
| 207 | + | return nil | |
| 208 | + | } | |
| 209 | + | var rawCallback func() | |
| 210 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 211 | + | return func() { | |
| 212 | + | rawCallback() | |
| 213 | + | } | |
| 214 | + | } | |
| 215 | + | ||
| 216 | + | // OverrideGReserved3 sets the callback function. | |
| 217 | + | func (x *SocketControlMessageClass) OverrideGReserved3(cb func()) { | |
| 218 | + | if cb == nil { | |
| 219 | + | x.xGReserved3 = 0 | |
| 220 | + | } else { | |
| 221 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 222 | + | cb() | |
| 223 | + | }) | |
| 224 | + | } | |
| 225 | + | } | |
| 226 | + | ||
| 227 | + | // GetGReserved3 gets the callback function. | |
| 228 | + | func (x *SocketControlMessageClass) GetGReserved3() func() { | |
| 229 | + | if x.xGReserved3 == 0 { | |
| 230 | + | return nil | |
| 231 | + | } | |
| 232 | + | var rawCallback func() | |
| 233 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 234 | + | return func() { | |
| 235 | + | rawCallback() | |
| 236 | + | } | |
| 237 | + | } | |
| 238 | + | ||
| 239 | + | // OverrideGReserved4 sets the callback function. | |
| 240 | + | func (x *SocketControlMessageClass) OverrideGReserved4(cb func()) { | |
| 241 | + | if cb == nil { | |
| 242 | + | x.xGReserved4 = 0 | |
| 243 | + | } else { | |
| 244 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 245 | + | cb() | |
| 246 | + | }) | |
| 247 | + | } | |
| 248 | + | } | |
| 249 | + | ||
| 250 | + | // GetGReserved4 gets the callback function. | |
| 251 | + | func (x *SocketControlMessageClass) GetGReserved4() func() { | |
| 252 | + | if x.xGReserved4 == 0 { | |
| 253 | + | return nil | |
| 254 | + | } | |
| 255 | + | var rawCallback func() | |
| 256 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 257 | + | return func() { | |
| 258 | + | rawCallback() | |
| 259 | + | } | |
| 260 | + | } | |
| 261 | + | ||
| 262 | + | // OverrideGReserved5 sets the callback function. | |
| 263 | + | func (x *SocketControlMessageClass) OverrideGReserved5(cb func()) { | |
| 264 | + | if cb == nil { | |
| 265 | + | x.xGReserved5 = 0 | |
| 266 | + | } else { | |
| 267 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 268 | + | cb() | |
| 269 | + | }) | |
| 270 | + | } | |
| 271 | + | } | |
| 272 | + | ||
| 273 | + | // GetGReserved5 gets the callback function. | |
| 274 | + | func (x *SocketControlMessageClass) GetGReserved5() func() { | |
| 275 | + | if x.xGReserved5 == 0 { | |
| 276 | + | return nil | |
| 277 | + | } | |
| 278 | + | var rawCallback func() | |
| 279 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 280 | + | return func() { | |
| 281 | + | rawCallback() | |
| 282 | + | } | |
| 283 | + | } | |
| 284 | + | ||
| 25 | 285 | type SocketControlMessagePrivate struct { | |
| 26 | 286 | _ structs.HostLayout | |
| 27 | 287 | } | |
M v4/gio/gsocketlistener.go +186 -11
| @@ -16,13 +16,188 @@ import ( | |||
| 16 | 16 | type SocketListenerClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | + | ||
| 21 | + | xChanged uintptr | |
| 22 | + | ||
| 23 | + | xEvent uintptr | |
| 24 | + | ||
| 25 | + | xGReserved2 uintptr | |
| 26 | + | ||
| 27 | + | xGReserved3 uintptr | |
| 28 | + | ||
| 29 | + | xGReserved4 uintptr | |
| 30 | + | ||
| 31 | + | xGReserved5 uintptr | |
| 32 | + | ||
| 33 | + | xGReserved6 uintptr | |
| 20 | 34 | } | |
| 21 | 35 | ||
| 22 | 36 | func (x *SocketListenerClass) GoPointer() uintptr { | |
| 23 | 37 | return uintptr(unsafe.Pointer(x)) | |
| 24 | 38 | } | |
| 25 | 39 | ||
| 40 | + | // OverrideChanged sets the callback function. | |
| 41 | + | func (x *SocketListenerClass) OverrideChanged(cb func(*SocketListener)) { | |
| 42 | + | if cb == nil { | |
| 43 | + | x.xChanged = 0 | |
| 44 | + | } else { | |
| 45 | + | x.xChanged = purego.NewCallback(func(ListenerVarp uintptr) { | |
| 46 | + | cb(SocketListenerNewFromInternalPtr(ListenerVarp)) | |
| 47 | + | }) | |
| 48 | + | } | |
| 49 | + | } | |
| 50 | + | ||
| 51 | + | // GetChanged gets the callback function. | |
| 52 | + | func (x *SocketListenerClass) GetChanged() func(*SocketListener) { | |
| 53 | + | if x.xChanged == 0 { | |
| 54 | + | return nil | |
| 55 | + | } | |
| 56 | + | var rawCallback func(ListenerVarp uintptr) | |
| 57 | + | purego.RegisterFunc(&rawCallback, x.xChanged) | |
| 58 | + | return func(ListenerVar *SocketListener) { | |
| 59 | + | rawCallback(ListenerVar.GoPointer()) | |
| 60 | + | } | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // OverrideEvent sets the callback function. | |
| 64 | + | func (x *SocketListenerClass) OverrideEvent(cb func(*SocketListener, SocketListenerEvent, *Socket)) { | |
| 65 | + | if cb == nil { | |
| 66 | + | x.xEvent = 0 | |
| 67 | + | } else { | |
| 68 | + | x.xEvent = purego.NewCallback(func(ListenerVarp uintptr, EventVarp SocketListenerEvent, SocketVarp uintptr) { | |
| 69 | + | cb(SocketListenerNewFromInternalPtr(ListenerVarp), EventVarp, SocketNewFromInternalPtr(SocketVarp)) | |
| 70 | + | }) | |
| 71 | + | } | |
| 72 | + | } | |
| 73 | + | ||
| 74 | + | // GetEvent gets the callback function. | |
| 75 | + | func (x *SocketListenerClass) GetEvent() func(*SocketListener, SocketListenerEvent, *Socket) { | |
| 76 | + | if x.xEvent == 0 { | |
| 77 | + | return nil | |
| 78 | + | } | |
| 79 | + | var rawCallback func(ListenerVarp uintptr, EventVarp SocketListenerEvent, SocketVarp uintptr) | |
| 80 | + | purego.RegisterFunc(&rawCallback, x.xEvent) | |
| 81 | + | return func(ListenerVar *SocketListener, EventVar SocketListenerEvent, SocketVar *Socket) { | |
| 82 | + | rawCallback(ListenerVar.GoPointer(), EventVar, SocketVar.GoPointer()) | |
| 83 | + | } | |
| 84 | + | } | |
| 85 | + | ||
| 86 | + | // OverrideGReserved2 sets the callback function. | |
| 87 | + | func (x *SocketListenerClass) OverrideGReserved2(cb func()) { | |
| 88 | + | if cb == nil { | |
| 89 | + | x.xGReserved2 = 0 | |
| 90 | + | } else { | |
| 91 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 92 | + | cb() | |
| 93 | + | }) | |
| 94 | + | } | |
| 95 | + | } | |
| 96 | + | ||
| 97 | + | // GetGReserved2 gets the callback function. | |
| 98 | + | func (x *SocketListenerClass) GetGReserved2() func() { | |
| 99 | + | if x.xGReserved2 == 0 { | |
| 100 | + | return nil | |
| 101 | + | } | |
| 102 | + | var rawCallback func() | |
| 103 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 104 | + | return func() { | |
| 105 | + | rawCallback() | |
| 106 | + | } | |
| 107 | + | } | |
| 108 | + | ||
| 109 | + | // OverrideGReserved3 sets the callback function. | |
| 110 | + | func (x *SocketListenerClass) OverrideGReserved3(cb func()) { | |
| 111 | + | if cb == nil { | |
| 112 | + | x.xGReserved3 = 0 | |
| 113 | + | } else { | |
| 114 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 115 | + | cb() | |
| 116 | + | }) | |
| 117 | + | } | |
| 118 | + | } | |
| 119 | + | ||
| 120 | + | // GetGReserved3 gets the callback function. | |
| 121 | + | func (x *SocketListenerClass) GetGReserved3() func() { | |
| 122 | + | if x.xGReserved3 == 0 { | |
| 123 | + | return nil | |
| 124 | + | } | |
| 125 | + | var rawCallback func() | |
| 126 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 127 | + | return func() { | |
| 128 | + | rawCallback() | |
| 129 | + | } | |
| 130 | + | } | |
| 131 | + | ||
| 132 | + | // OverrideGReserved4 sets the callback function. | |
| 133 | + | func (x *SocketListenerClass) OverrideGReserved4(cb func()) { | |
| 134 | + | if cb == nil { | |
| 135 | + | x.xGReserved4 = 0 | |
| 136 | + | } else { | |
| 137 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 138 | + | cb() | |
| 139 | + | }) | |
| 140 | + | } | |
| 141 | + | } | |
| 142 | + | ||
| 143 | + | // GetGReserved4 gets the callback function. | |
| 144 | + | func (x *SocketListenerClass) GetGReserved4() func() { | |
| 145 | + | if x.xGReserved4 == 0 { | |
| 146 | + | return nil | |
| 147 | + | } | |
| 148 | + | var rawCallback func() | |
| 149 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 150 | + | return func() { | |
| 151 | + | rawCallback() | |
| 152 | + | } | |
| 153 | + | } | |
| 154 | + | ||
| 155 | + | // OverrideGReserved5 sets the callback function. | |
| 156 | + | func (x *SocketListenerClass) OverrideGReserved5(cb func()) { | |
| 157 | + | if cb == nil { | |
| 158 | + | x.xGReserved5 = 0 | |
| 159 | + | } else { | |
| 160 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 161 | + | cb() | |
| 162 | + | }) | |
| 163 | + | } | |
| 164 | + | } | |
| 165 | + | ||
| 166 | + | // GetGReserved5 gets the callback function. | |
| 167 | + | func (x *SocketListenerClass) GetGReserved5() func() { | |
| 168 | + | if x.xGReserved5 == 0 { | |
| 169 | + | return nil | |
| 170 | + | } | |
| 171 | + | var rawCallback func() | |
| 172 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 173 | + | return func() { | |
| 174 | + | rawCallback() | |
| 175 | + | } | |
| 176 | + | } | |
| 177 | + | ||
| 178 | + | // OverrideGReserved6 sets the callback function. | |
| 179 | + | func (x *SocketListenerClass) OverrideGReserved6(cb func()) { | |
| 180 | + | if cb == nil { | |
| 181 | + | x.xGReserved6 = 0 | |
| 182 | + | } else { | |
| 183 | + | x.xGReserved6 = purego.NewCallback(func() { | |
| 184 | + | cb() | |
| 185 | + | }) | |
| 186 | + | } | |
| 187 | + | } | |
| 188 | + | ||
| 189 | + | // GetGReserved6 gets the callback function. | |
| 190 | + | func (x *SocketListenerClass) GetGReserved6() func() { | |
| 191 | + | if x.xGReserved6 == 0 { | |
| 192 | + | return nil | |
| 193 | + | } | |
| 194 | + | var rawCallback func() | |
| 195 | + | purego.RegisterFunc(&rawCallback, x.xGReserved6) | |
| 196 | + | return func() { | |
| 197 | + | rawCallback() | |
| 198 | + | } | |
| 199 | + | } | |
| 200 | + | ||
| 26 | 201 | type SocketListenerPrivate struct { | |
| 27 | 202 | _ structs.HostLayout | |
| 28 | 203 | } | |
| @@ -79,7 +254,7 @@ func NewSocketListener() *SocketListener { | |||
| 79 | 254 | return cls | |
| 80 | 255 | } | |
| 81 | 256 | ||
| 82 | - | var xSocketListenerAccept func(uintptr, *uintptr, uintptr, **glib.Error) uintptr | |
| 257 | + | var xSocketListenerAccept func(uintptr, uintptr, uintptr, **glib.Error) uintptr | |
| 83 | 258 | ||
| 84 | 259 | // Blocks waiting for a client to connect to any of the sockets added | |
| 85 | 260 | // to the listener. Returns a #GSocketConnection for the socket that was | |
| @@ -96,7 +271,7 @@ func (x *SocketListener) Accept(SourceObjectVar **gobject.Object, CancellableVar | |||
| 96 | 271 | var cls *SocketConnection | |
| 97 | 272 | var cerr *glib.Error | |
| 98 | 273 | ||
| 99 | - | cret := xSocketListenerAccept(x.GoPointer(), gobject.ConvertPtr(SourceObjectVar), CancellableVar.GoPointer(), &cerr) | |
| 274 | + | cret := xSocketListenerAccept(x.GoPointer(), *gobject.ConvertPtr(SourceObjectVar), CancellableVar.GoPointer(), &cerr) | |
| 100 | 275 | ||
| 101 | 276 | if cret == 0 { | |
| 102 | 277 | return nil, cerr | |
| @@ -123,14 +298,14 @@ func (x *SocketListener) AcceptAsync(CancellableVar *Cancellable, CallbackVar *A | |||
| 123 | 298 | ||
| 124 | 299 | } | |
| 125 | 300 | ||
| 126 | - | var xSocketListenerAcceptFinish func(uintptr, uintptr, *uintptr, **glib.Error) uintptr | |
| 301 | + | var xSocketListenerAcceptFinish func(uintptr, uintptr, uintptr, **glib.Error) uintptr | |
| 127 | 302 | ||
| 128 | 303 | // Finishes an async accept operation. See g_socket_listener_accept_async() | |
| 129 | 304 | func (x *SocketListener) AcceptFinish(ResultVar AsyncResult, SourceObjectVar **gobject.Object) (*SocketConnection, error) { | |
| 130 | 305 | var cls *SocketConnection | |
| 131 | 306 | var cerr *glib.Error | |
| 132 | 307 | ||
| 133 | - | cret := xSocketListenerAcceptFinish(x.GoPointer(), ResultVar.GoPointer(), gobject.ConvertPtr(SourceObjectVar), &cerr) | |
| 308 | + | cret := xSocketListenerAcceptFinish(x.GoPointer(), ResultVar.GoPointer(), *gobject.ConvertPtr(SourceObjectVar), &cerr) | |
| 134 | 309 | ||
| 135 | 310 | if cret == 0 { | |
| 136 | 311 | return nil, cerr | |
| @@ -144,7 +319,7 @@ func (x *SocketListener) AcceptFinish(ResultVar AsyncResult, SourceObjectVar **g | |||
| 144 | 319 | ||
| 145 | 320 | } | |
| 146 | 321 | ||
| 147 | - | var xSocketListenerAcceptSocket func(uintptr, *uintptr, uintptr, **glib.Error) uintptr | |
| 322 | + | var xSocketListenerAcceptSocket func(uintptr, uintptr, uintptr, **glib.Error) uintptr | |
| 148 | 323 | ||
| 149 | 324 | // Blocks waiting for a client to connect to any of the sockets added | |
| 150 | 325 | // to the listener. Returns the #GSocket that was accepted. | |
| @@ -164,7 +339,7 @@ func (x *SocketListener) AcceptSocket(SourceObjectVar **gobject.Object, Cancella | |||
| 164 | 339 | var cls *Socket | |
| 165 | 340 | var cerr *glib.Error | |
| 166 | 341 | ||
| 167 | - | cret := xSocketListenerAcceptSocket(x.GoPointer(), gobject.ConvertPtr(SourceObjectVar), CancellableVar.GoPointer(), &cerr) | |
| 342 | + | cret := xSocketListenerAcceptSocket(x.GoPointer(), *gobject.ConvertPtr(SourceObjectVar), CancellableVar.GoPointer(), &cerr) | |
| 168 | 343 | ||
| 169 | 344 | if cret == 0 { | |
| 170 | 345 | return nil, cerr | |
| @@ -191,14 +366,14 @@ func (x *SocketListener) AcceptSocketAsync(CancellableVar *Cancellable, Callback | |||
| 191 | 366 | ||
| 192 | 367 | } | |
| 193 | 368 | ||
| 194 | - | var xSocketListenerAcceptSocketFinish func(uintptr, uintptr, *uintptr, **glib.Error) uintptr | |
| 369 | + | var xSocketListenerAcceptSocketFinish func(uintptr, uintptr, uintptr, **glib.Error) uintptr | |
| 195 | 370 | ||
| 196 | 371 | // Finishes an async accept operation. See g_socket_listener_accept_socket_async() | |
| 197 | 372 | func (x *SocketListener) AcceptSocketFinish(ResultVar AsyncResult, SourceObjectVar **gobject.Object) (*Socket, error) { | |
| 198 | 373 | var cls *Socket | |
| 199 | 374 | var cerr *glib.Error | |
| 200 | 375 | ||
| 201 | - | cret := xSocketListenerAcceptSocketFinish(x.GoPointer(), ResultVar.GoPointer(), gobject.ConvertPtr(SourceObjectVar), &cerr) | |
| 376 | + | cret := xSocketListenerAcceptSocketFinish(x.GoPointer(), ResultVar.GoPointer(), *gobject.ConvertPtr(SourceObjectVar), &cerr) | |
| 202 | 377 | ||
| 203 | 378 | if cret == 0 { | |
| 204 | 379 | return nil, cerr | |
| @@ -212,7 +387,7 @@ func (x *SocketListener) AcceptSocketFinish(ResultVar AsyncResult, SourceObjectV | |||
| 212 | 387 | ||
| 213 | 388 | } | |
| 214 | 389 | ||
| 215 | - | var xSocketListenerAddAddress func(uintptr, uintptr, SocketType, SocketProtocol, uintptr, *uintptr, **glib.Error) bool | |
| 390 | + | var xSocketListenerAddAddress func(uintptr, uintptr, SocketType, SocketProtocol, uintptr, uintptr, **glib.Error) bool | |
| 216 | 391 | ||
| 217 | 392 | // Creates a socket of type @type and protocol @protocol, binds | |
| 218 | 393 | // it to @address and adds it to the set of sockets we're accepting | |
| @@ -240,7 +415,7 @@ var xSocketListenerAddAddress func(uintptr, uintptr, SocketType, SocketProtocol, | |||
| 240 | 415 | func (x *SocketListener) AddAddress(AddressVar *SocketAddress, TypeVar SocketType, ProtocolVar SocketProtocol, SourceObjectVar *gobject.Object, EffectiveAddressVar **SocketAddress) (bool, error) { | |
| 241 | 416 | var cerr *glib.Error | |
| 242 | 417 | ||
| 243 | - | cret := xSocketListenerAddAddress(x.GoPointer(), AddressVar.GoPointer(), TypeVar, ProtocolVar, SourceObjectVar.GoPointer(), gobject.ConvertPtr(EffectiveAddressVar), &cerr) | |
| 418 | + | cret := xSocketListenerAddAddress(x.GoPointer(), AddressVar.GoPointer(), TypeVar, ProtocolVar, SourceObjectVar.GoPointer(), *gobject.ConvertPtr(EffectiveAddressVar), &cerr) | |
| 244 | 419 | if cerr == nil { | |
| 245 | 420 | return cret, nil | |
| 246 | 421 | } | |
M v4/gio/gsocketservice.go +176 -1
| @@ -16,13 +16,188 @@ import ( | |||
| 16 | 16 | type SocketServiceClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass SocketListenerClass | |
| 20 | + | ||
| 21 | + | xIncoming uintptr | |
| 22 | + | ||
| 23 | + | xGReserved1 uintptr | |
| 24 | + | ||
| 25 | + | xGReserved2 uintptr | |
| 26 | + | ||
| 27 | + | xGReserved3 uintptr | |
| 28 | + | ||
| 29 | + | xGReserved4 uintptr | |
| 30 | + | ||
| 31 | + | xGReserved5 uintptr | |
| 32 | + | ||
| 33 | + | xGReserved6 uintptr | |
| 20 | 34 | } | |
| 21 | 35 | ||
| 22 | 36 | func (x *SocketServiceClass) GoPointer() uintptr { | |
| 23 | 37 | return uintptr(unsafe.Pointer(x)) | |
| 24 | 38 | } | |
| 25 | 39 | ||
| 40 | + | // OverrideIncoming sets the callback function. | |
| 41 | + | func (x *SocketServiceClass) OverrideIncoming(cb func(*SocketService, *SocketConnection, *gobject.Object) bool) { | |
| 42 | + | if cb == nil { | |
| 43 | + | x.xIncoming = 0 | |
| 44 | + | } else { | |
| 45 | + | x.xIncoming = purego.NewCallback(func(ServiceVarp uintptr, ConnectionVarp uintptr, SourceObjectVarp uintptr) bool { | |
| 46 | + | return cb(SocketServiceNewFromInternalPtr(ServiceVarp), SocketConnectionNewFromInternalPtr(ConnectionVarp), gobject.ObjectNewFromInternalPtr(SourceObjectVarp)) | |
| 47 | + | }) | |
| 48 | + | } | |
| 49 | + | } | |
| 50 | + | ||
| 51 | + | // GetIncoming gets the callback function. | |
| 52 | + | func (x *SocketServiceClass) GetIncoming() func(*SocketService, *SocketConnection, *gobject.Object) bool { | |
| 53 | + | if x.xIncoming == 0 { | |
| 54 | + | return nil | |
| 55 | + | } | |
| 56 | + | var rawCallback func(ServiceVarp uintptr, ConnectionVarp uintptr, SourceObjectVarp uintptr) bool | |
| 57 | + | purego.RegisterFunc(&rawCallback, x.xIncoming) | |
| 58 | + | return func(ServiceVar *SocketService, ConnectionVar *SocketConnection, SourceObjectVar *gobject.Object) bool { | |
| 59 | + | return rawCallback(ServiceVar.GoPointer(), ConnectionVar.GoPointer(), SourceObjectVar.GoPointer()) | |
| 60 | + | } | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // OverrideGReserved1 sets the callback function. | |
| 64 | + | func (x *SocketServiceClass) OverrideGReserved1(cb func()) { | |
| 65 | + | if cb == nil { | |
| 66 | + | x.xGReserved1 = 0 | |
| 67 | + | } else { | |
| 68 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 69 | + | cb() | |
| 70 | + | }) | |
| 71 | + | } | |
| 72 | + | } | |
| 73 | + | ||
| 74 | + | // GetGReserved1 gets the callback function. | |
| 75 | + | func (x *SocketServiceClass) GetGReserved1() func() { | |
| 76 | + | if x.xGReserved1 == 0 { | |
| 77 | + | return nil | |
| 78 | + | } | |
| 79 | + | var rawCallback func() | |
| 80 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 81 | + | return func() { | |
| 82 | + | rawCallback() | |
| 83 | + | } | |
| 84 | + | } | |
| 85 | + | ||
| 86 | + | // OverrideGReserved2 sets the callback function. | |
| 87 | + | func (x *SocketServiceClass) OverrideGReserved2(cb func()) { | |
| 88 | + | if cb == nil { | |
| 89 | + | x.xGReserved2 = 0 | |
| 90 | + | } else { | |
| 91 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 92 | + | cb() | |
| 93 | + | }) | |
| 94 | + | } | |
| 95 | + | } | |
| 96 | + | ||
| 97 | + | // GetGReserved2 gets the callback function. | |
| 98 | + | func (x *SocketServiceClass) GetGReserved2() func() { | |
| 99 | + | if x.xGReserved2 == 0 { | |
| 100 | + | return nil | |
| 101 | + | } | |
| 102 | + | var rawCallback func() | |
| 103 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 104 | + | return func() { | |
| 105 | + | rawCallback() | |
| 106 | + | } | |
| 107 | + | } | |
| 108 | + | ||
| 109 | + | // OverrideGReserved3 sets the callback function. | |
| 110 | + | func (x *SocketServiceClass) OverrideGReserved3(cb func()) { | |
| 111 | + | if cb == nil { | |
| 112 | + | x.xGReserved3 = 0 | |
| 113 | + | } else { | |
| 114 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 115 | + | cb() | |
| 116 | + | }) | |
| 117 | + | } | |
| 118 | + | } | |
| 119 | + | ||
| 120 | + | // GetGReserved3 gets the callback function. | |
| 121 | + | func (x *SocketServiceClass) GetGReserved3() func() { | |
| 122 | + | if x.xGReserved3 == 0 { | |
| 123 | + | return nil | |
| 124 | + | } | |
| 125 | + | var rawCallback func() | |
| 126 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 127 | + | return func() { | |
| 128 | + | rawCallback() | |
| 129 | + | } | |
| 130 | + | } | |
| 131 | + | ||
| 132 | + | // OverrideGReserved4 sets the callback function. | |
| 133 | + | func (x *SocketServiceClass) OverrideGReserved4(cb func()) { | |
| 134 | + | if cb == nil { | |
| 135 | + | x.xGReserved4 = 0 | |
| 136 | + | } else { | |
| 137 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 138 | + | cb() | |
| 139 | + | }) | |
| 140 | + | } | |
| 141 | + | } | |
| 142 | + | ||
| 143 | + | // GetGReserved4 gets the callback function. | |
| 144 | + | func (x *SocketServiceClass) GetGReserved4() func() { | |
| 145 | + | if x.xGReserved4 == 0 { | |
| 146 | + | return nil | |
| 147 | + | } | |
| 148 | + | var rawCallback func() | |
| 149 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 150 | + | return func() { | |
| 151 | + | rawCallback() | |
| 152 | + | } | |
| 153 | + | } | |
| 154 | + | ||
| 155 | + | // OverrideGReserved5 sets the callback function. | |
| 156 | + | func (x *SocketServiceClass) OverrideGReserved5(cb func()) { | |
| 157 | + | if cb == nil { | |
| 158 | + | x.xGReserved5 = 0 | |
| 159 | + | } else { | |
| 160 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 161 | + | cb() | |
| 162 | + | }) | |
| 163 | + | } | |
| 164 | + | } | |
| 165 | + | ||
| 166 | + | // GetGReserved5 gets the callback function. | |
| 167 | + | func (x *SocketServiceClass) GetGReserved5() func() { | |
| 168 | + | if x.xGReserved5 == 0 { | |
| 169 | + | return nil | |
| 170 | + | } | |
| 171 | + | var rawCallback func() | |
| 172 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 173 | + | return func() { | |
| 174 | + | rawCallback() | |
| 175 | + | } | |
| 176 | + | } | |
| 177 | + | ||
| 178 | + | // OverrideGReserved6 sets the callback function. | |
| 179 | + | func (x *SocketServiceClass) OverrideGReserved6(cb func()) { | |
| 180 | + | if cb == nil { | |
| 181 | + | x.xGReserved6 = 0 | |
| 182 | + | } else { | |
| 183 | + | x.xGReserved6 = purego.NewCallback(func() { | |
| 184 | + | cb() | |
| 185 | + | }) | |
| 186 | + | } | |
| 187 | + | } | |
| 188 | + | ||
| 189 | + | // GetGReserved6 gets the callback function. | |
| 190 | + | func (x *SocketServiceClass) GetGReserved6() func() { | |
| 191 | + | if x.xGReserved6 == 0 { | |
| 192 | + | return nil | |
| 193 | + | } | |
| 194 | + | var rawCallback func() | |
| 195 | + | purego.RegisterFunc(&rawCallback, x.xGReserved6) | |
| 196 | + | return func() { | |
| 197 | + | rawCallback() | |
| 198 | + | } | |
| 199 | + | } | |
| 200 | + | ||
| 26 | 201 | type SocketServicePrivate struct { | |
| 27 | 202 | _ structs.HostLayout | |
| 28 | 203 | } | |
M v4/gio/gtcpconnection.go +1 -1
| @@ -13,7 +13,7 @@ import ( | |||
| 13 | 13 | type TcpConnectionClass struct { | |
| 14 | 14 | _ structs.HostLayout | |
| 15 | 15 | ||
| 16 | - | ParentClass uintptr | |
| 16 | + | ParentClass SocketConnectionClass | |
| 17 | 17 | } | |
| 18 | 18 | ||
| 19 | 19 | func (x *TcpConnectionClass) GoPointer() uintptr { | |
M v4/gio/gtcpwrapperconnection.go +1 -1
| @@ -14,7 +14,7 @@ import ( | |||
| 14 | 14 | type TcpWrapperConnectionClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass TcpConnectionClass | |
| 18 | 18 | } | |
| 19 | 19 | ||
| 20 | 20 | func (x *TcpWrapperConnectionClass) GoPointer() uintptr { | |
M v4/gio/gthreadedsocketservice.go +151 -1
| @@ -15,13 +15,163 @@ import ( | |||
| 15 | 15 | type ThreadedSocketServiceClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass SocketServiceClass | |
| 19 | + | ||
| 20 | + | xRun uintptr | |
| 21 | + | ||
| 22 | + | xGReserved1 uintptr | |
| 23 | + | ||
| 24 | + | xGReserved2 uintptr | |
| 25 | + | ||
| 26 | + | xGReserved3 uintptr | |
| 27 | + | ||
| 28 | + | xGReserved4 uintptr | |
| 29 | + | ||
| 30 | + | xGReserved5 uintptr | |
| 19 | 31 | } | |
| 20 | 32 | ||
| 21 | 33 | func (x *ThreadedSocketServiceClass) GoPointer() uintptr { | |
| 22 | 34 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 35 | } | |
| 24 | 36 | ||
| 37 | + | // OverrideRun sets the callback function. | |
| 38 | + | func (x *ThreadedSocketServiceClass) OverrideRun(cb func(*ThreadedSocketService, *SocketConnection, *gobject.Object) bool) { | |
| 39 | + | if cb == nil { | |
| 40 | + | x.xRun = 0 | |
| 41 | + | } else { | |
| 42 | + | x.xRun = purego.NewCallback(func(ServiceVarp uintptr, ConnectionVarp uintptr, SourceObjectVarp uintptr) bool { | |
| 43 | + | return cb(ThreadedSocketServiceNewFromInternalPtr(ServiceVarp), SocketConnectionNewFromInternalPtr(ConnectionVarp), gobject.ObjectNewFromInternalPtr(SourceObjectVarp)) | |
| 44 | + | }) | |
| 45 | + | } | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | // GetRun gets the callback function. | |
| 49 | + | func (x *ThreadedSocketServiceClass) GetRun() func(*ThreadedSocketService, *SocketConnection, *gobject.Object) bool { | |
| 50 | + | if x.xRun == 0 { | |
| 51 | + | return nil | |
| 52 | + | } | |
| 53 | + | var rawCallback func(ServiceVarp uintptr, ConnectionVarp uintptr, SourceObjectVarp uintptr) bool | |
| 54 | + | purego.RegisterFunc(&rawCallback, x.xRun) | |
| 55 | + | return func(ServiceVar *ThreadedSocketService, ConnectionVar *SocketConnection, SourceObjectVar *gobject.Object) bool { | |
| 56 | + | return rawCallback(ServiceVar.GoPointer(), ConnectionVar.GoPointer(), SourceObjectVar.GoPointer()) | |
| 57 | + | } | |
| 58 | + | } | |
| 59 | + | ||
| 60 | + | // OverrideGReserved1 sets the callback function. | |
| 61 | + | func (x *ThreadedSocketServiceClass) OverrideGReserved1(cb func()) { | |
| 62 | + | if cb == nil { | |
| 63 | + | x.xGReserved1 = 0 | |
| 64 | + | } else { | |
| 65 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 66 | + | cb() | |
| 67 | + | }) | |
| 68 | + | } | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | // GetGReserved1 gets the callback function. | |
| 72 | + | func (x *ThreadedSocketServiceClass) GetGReserved1() func() { | |
| 73 | + | if x.xGReserved1 == 0 { | |
| 74 | + | return nil | |
| 75 | + | } | |
| 76 | + | var rawCallback func() | |
| 77 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 78 | + | return func() { | |
| 79 | + | rawCallback() | |
| 80 | + | } | |
| 81 | + | } | |
| 82 | + | ||
| 83 | + | // OverrideGReserved2 sets the callback function. | |
| 84 | + | func (x *ThreadedSocketServiceClass) OverrideGReserved2(cb func()) { | |
| 85 | + | if cb == nil { | |
| 86 | + | x.xGReserved2 = 0 | |
| 87 | + | } else { | |
| 88 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 89 | + | cb() | |
| 90 | + | }) | |
| 91 | + | } | |
| 92 | + | } | |
| 93 | + | ||
| 94 | + | // GetGReserved2 gets the callback function. | |
| 95 | + | func (x *ThreadedSocketServiceClass) GetGReserved2() func() { | |
| 96 | + | if x.xGReserved2 == 0 { | |
| 97 | + | return nil | |
| 98 | + | } | |
| 99 | + | var rawCallback func() | |
| 100 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 101 | + | return func() { | |
| 102 | + | rawCallback() | |
| 103 | + | } | |
| 104 | + | } | |
| 105 | + | ||
| 106 | + | // OverrideGReserved3 sets the callback function. | |
| 107 | + | func (x *ThreadedSocketServiceClass) OverrideGReserved3(cb func()) { | |
| 108 | + | if cb == nil { | |
| 109 | + | x.xGReserved3 = 0 | |
| 110 | + | } else { | |
| 111 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 112 | + | cb() | |
| 113 | + | }) | |
| 114 | + | } | |
| 115 | + | } | |
| 116 | + | ||
| 117 | + | // GetGReserved3 gets the callback function. | |
| 118 | + | func (x *ThreadedSocketServiceClass) GetGReserved3() func() { | |
| 119 | + | if x.xGReserved3 == 0 { | |
| 120 | + | return nil | |
| 121 | + | } | |
| 122 | + | var rawCallback func() | |
| 123 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 124 | + | return func() { | |
| 125 | + | rawCallback() | |
| 126 | + | } | |
| 127 | + | } | |
| 128 | + | ||
| 129 | + | // OverrideGReserved4 sets the callback function. | |
| 130 | + | func (x *ThreadedSocketServiceClass) OverrideGReserved4(cb func()) { | |
| 131 | + | if cb == nil { | |
| 132 | + | x.xGReserved4 = 0 | |
| 133 | + | } else { | |
| 134 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 135 | + | cb() | |
| 136 | + | }) | |
| 137 | + | } | |
| 138 | + | } | |
| 139 | + | ||
| 140 | + | // GetGReserved4 gets the callback function. | |
| 141 | + | func (x *ThreadedSocketServiceClass) GetGReserved4() func() { | |
| 142 | + | if x.xGReserved4 == 0 { | |
| 143 | + | return nil | |
| 144 | + | } | |
| 145 | + | var rawCallback func() | |
| 146 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 147 | + | return func() { | |
| 148 | + | rawCallback() | |
| 149 | + | } | |
| 150 | + | } | |
| 151 | + | ||
| 152 | + | // OverrideGReserved5 sets the callback function. | |
| 153 | + | func (x *ThreadedSocketServiceClass) OverrideGReserved5(cb func()) { | |
| 154 | + | if cb == nil { | |
| 155 | + | x.xGReserved5 = 0 | |
| 156 | + | } else { | |
| 157 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 158 | + | cb() | |
| 159 | + | }) | |
| 160 | + | } | |
| 161 | + | } | |
| 162 | + | ||
| 163 | + | // GetGReserved5 gets the callback function. | |
| 164 | + | func (x *ThreadedSocketServiceClass) GetGReserved5() func() { | |
| 165 | + | if x.xGReserved5 == 0 { | |
| 166 | + | return nil | |
| 167 | + | } | |
| 168 | + | var rawCallback func() | |
| 169 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 170 | + | return func() { | |
| 171 | + | rawCallback() | |
| 172 | + | } | |
| 173 | + | } | |
| 174 | + | ||
| 25 | 175 | type ThreadedSocketServicePrivate struct { | |
| 26 | 176 | _ structs.HostLayout | |
| 27 | 177 | } | |
M v4/gio/gtlsbackend.go +235 -0
| @@ -16,12 +16,247 @@ type TlsBackendInterface struct { | |||
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | 18 | GIface uintptr | |
| 19 | + | ||
| 20 | + | xSupportsTls uintptr | |
| 21 | + | ||
| 22 | + | xGetCertificateType uintptr | |
| 23 | + | ||
| 24 | + | xGetClientConnectionType uintptr | |
| 25 | + | ||
| 26 | + | xGetServerConnectionType uintptr | |
| 27 | + | ||
| 28 | + | xGetFileDatabaseType uintptr | |
| 29 | + | ||
| 30 | + | xGetDefaultDatabase uintptr | |
| 31 | + | ||
| 32 | + | xSupportsDtls uintptr | |
| 33 | + | ||
| 34 | + | xGetDtlsClientConnectionType uintptr | |
| 35 | + | ||
| 36 | + | xGetDtlsServerConnectionType uintptr | |
| 19 | 37 | } | |
| 20 | 38 | ||
| 21 | 39 | func (x *TlsBackendInterface) GoPointer() uintptr { | |
| 22 | 40 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 41 | } | |
| 24 | 42 | ||
| 43 | + | // OverrideSupportsTls sets the callback function. | |
| 44 | + | func (x *TlsBackendInterface) OverrideSupportsTls(cb func(TlsBackend) bool) { | |
| 45 | + | if cb == nil { | |
| 46 | + | x.xSupportsTls = 0 | |
| 47 | + | } else { | |
| 48 | + | x.xSupportsTls = purego.NewCallback(func(BackendVarp uintptr) bool { | |
| 49 | + | return cb(&TlsBackendBase{Ptr: BackendVarp}) | |
| 50 | + | }) | |
| 51 | + | } | |
| 52 | + | } | |
| 53 | + | ||
| 54 | + | // GetSupportsTls gets the callback function. | |
| 55 | + | func (x *TlsBackendInterface) GetSupportsTls() func(TlsBackend) bool { | |
| 56 | + | if x.xSupportsTls == 0 { | |
| 57 | + | return nil | |
| 58 | + | } | |
| 59 | + | var rawCallback func(BackendVarp uintptr) bool | |
| 60 | + | purego.RegisterFunc(&rawCallback, x.xSupportsTls) | |
| 61 | + | return func(BackendVar TlsBackend) bool { | |
| 62 | + | return rawCallback(BackendVar.GoPointer()) | |
| 63 | + | } | |
| 64 | + | } | |
| 65 | + | ||
| 66 | + | // OverrideGetCertificateType sets the callback function. | |
| 67 | + | func (x *TlsBackendInterface) OverrideGetCertificateType(cb func() types.GType) { | |
| 68 | + | if cb == nil { | |
| 69 | + | x.xGetCertificateType = 0 | |
| 70 | + | } else { | |
| 71 | + | x.xGetCertificateType = purego.NewCallback(func() types.GType { | |
| 72 | + | return cb() | |
| 73 | + | }) | |
| 74 | + | } | |
| 75 | + | } | |
| 76 | + | ||
| 77 | + | // GetGetCertificateType gets the callback function. | |
| 78 | + | func (x *TlsBackendInterface) GetGetCertificateType() func() types.GType { | |
| 79 | + | if x.xGetCertificateType == 0 { | |
| 80 | + | return nil | |
| 81 | + | } | |
| 82 | + | var rawCallback func() types.GType | |
| 83 | + | purego.RegisterFunc(&rawCallback, x.xGetCertificateType) | |
| 84 | + | return func() types.GType { | |
| 85 | + | return rawCallback() | |
| 86 | + | } | |
| 87 | + | } | |
| 88 | + | ||
| 89 | + | // OverrideGetClientConnectionType sets the callback function. | |
| 90 | + | func (x *TlsBackendInterface) OverrideGetClientConnectionType(cb func() types.GType) { | |
| 91 | + | if cb == nil { | |
| 92 | + | x.xGetClientConnectionType = 0 | |
| 93 | + | } else { | |
| 94 | + | x.xGetClientConnectionType = purego.NewCallback(func() types.GType { | |
| 95 | + | return cb() | |
| 96 | + | }) | |
| 97 | + | } | |
| 98 | + | } | |
| 99 | + | ||
| 100 | + | // GetGetClientConnectionType gets the callback function. | |
| 101 | + | func (x *TlsBackendInterface) GetGetClientConnectionType() func() types.GType { | |
| 102 | + | if x.xGetClientConnectionType == 0 { | |
| 103 | + | return nil | |
| 104 | + | } | |
| 105 | + | var rawCallback func() types.GType | |
| 106 | + | purego.RegisterFunc(&rawCallback, x.xGetClientConnectionType) | |
| 107 | + | return func() types.GType { | |
| 108 | + | return rawCallback() | |
| 109 | + | } | |
| 110 | + | } | |
| 111 | + | ||
| 112 | + | // OverrideGetServerConnectionType sets the callback function. | |
| 113 | + | func (x *TlsBackendInterface) OverrideGetServerConnectionType(cb func() types.GType) { | |
| 114 | + | if cb == nil { | |
| 115 | + | x.xGetServerConnectionType = 0 | |
| 116 | + | } else { | |
| 117 | + | x.xGetServerConnectionType = purego.NewCallback(func() types.GType { | |
| 118 | + | return cb() | |
| 119 | + | }) | |
| 120 | + | } | |
| 121 | + | } | |
| 122 | + | ||
| 123 | + | // GetGetServerConnectionType gets the callback function. | |
| 124 | + | func (x *TlsBackendInterface) GetGetServerConnectionType() func() types.GType { | |
| 125 | + | if x.xGetServerConnectionType == 0 { | |
| 126 | + | return nil | |
| 127 | + | } | |
| 128 | + | var rawCallback func() types.GType | |
| 129 | + | purego.RegisterFunc(&rawCallback, x.xGetServerConnectionType) | |
| 130 | + | return func() types.GType { | |
| 131 | + | return rawCallback() | |
| 132 | + | } | |
| 133 | + | } | |
| 134 | + | ||
| 135 | + | // OverrideGetFileDatabaseType sets the callback function. | |
| 136 | + | func (x *TlsBackendInterface) OverrideGetFileDatabaseType(cb func() types.GType) { | |
| 137 | + | if cb == nil { | |
| 138 | + | x.xGetFileDatabaseType = 0 | |
| 139 | + | } else { | |
| 140 | + | x.xGetFileDatabaseType = purego.NewCallback(func() types.GType { | |
| 141 | + | return cb() | |
| 142 | + | }) | |
| 143 | + | } | |
| 144 | + | } | |
| 145 | + | ||
| 146 | + | // GetGetFileDatabaseType gets the callback function. | |
| 147 | + | func (x *TlsBackendInterface) GetGetFileDatabaseType() func() types.GType { | |
| 148 | + | if x.xGetFileDatabaseType == 0 { | |
| 149 | + | return nil | |
| 150 | + | } | |
| 151 | + | var rawCallback func() types.GType | |
| 152 | + | purego.RegisterFunc(&rawCallback, x.xGetFileDatabaseType) | |
| 153 | + | return func() types.GType { | |
| 154 | + | return rawCallback() | |
| 155 | + | } | |
| 156 | + | } | |
| 157 | + | ||
| 158 | + | // OverrideGetDefaultDatabase sets the callback function. | |
| 159 | + | func (x *TlsBackendInterface) OverrideGetDefaultDatabase(cb func(TlsBackend) *TlsDatabase) { | |
| 160 | + | if cb == nil { | |
| 161 | + | x.xGetDefaultDatabase = 0 | |
| 162 | + | } else { | |
| 163 | + | x.xGetDefaultDatabase = purego.NewCallback(func(BackendVarp uintptr) uintptr { | |
| 164 | + | ret := cb(&TlsBackendBase{Ptr: BackendVarp}) | |
| 165 | + | if ret == nil { | |
| 166 | + | return 0 | |
| 167 | + | } | |
| 168 | + | return ret.GoPointer() | |
| 169 | + | }) | |
| 170 | + | } | |
| 171 | + | } | |
| 172 | + | ||
| 173 | + | // GetGetDefaultDatabase gets the callback function. | |
| 174 | + | func (x *TlsBackendInterface) GetGetDefaultDatabase() func(TlsBackend) *TlsDatabase { | |
| 175 | + | if x.xGetDefaultDatabase == 0 { | |
| 176 | + | return nil | |
| 177 | + | } | |
| 178 | + | var rawCallback func(BackendVarp uintptr) uintptr | |
| 179 | + | purego.RegisterFunc(&rawCallback, x.xGetDefaultDatabase) | |
| 180 | + | return func(BackendVar TlsBackend) *TlsDatabase { | |
| 181 | + | rawRet := rawCallback(BackendVar.GoPointer()) | |
| 182 | + | if rawRet == 0 { | |
| 183 | + | return nil | |
| 184 | + | } | |
| 185 | + | ret := &TlsDatabase{} | |
| 186 | + | ret.Ptr = rawRet | |
| 187 | + | return ret | |
| 188 | + | } | |
| 189 | + | } | |
| 190 | + | ||
| 191 | + | // OverrideSupportsDtls sets the callback function. | |
| 192 | + | func (x *TlsBackendInterface) OverrideSupportsDtls(cb func(TlsBackend) bool) { | |
| 193 | + | if cb == nil { | |
| 194 | + | x.xSupportsDtls = 0 | |
| 195 | + | } else { | |
| 196 | + | x.xSupportsDtls = purego.NewCallback(func(BackendVarp uintptr) bool { | |
| 197 | + | return cb(&TlsBackendBase{Ptr: BackendVarp}) | |
| 198 | + | }) | |
| 199 | + | } | |
| 200 | + | } | |
| 201 | + | ||
| 202 | + | // GetSupportsDtls gets the callback function. | |
| 203 | + | func (x *TlsBackendInterface) GetSupportsDtls() func(TlsBackend) bool { | |
| 204 | + | if x.xSupportsDtls == 0 { | |
| 205 | + | return nil | |
| 206 | + | } | |
| 207 | + | var rawCallback func(BackendVarp uintptr) bool | |
| 208 | + | purego.RegisterFunc(&rawCallback, x.xSupportsDtls) | |
| 209 | + | return func(BackendVar TlsBackend) bool { | |
| 210 | + | return rawCallback(BackendVar.GoPointer()) | |
| 211 | + | } | |
| 212 | + | } | |
| 213 | + | ||
| 214 | + | // OverrideGetDtlsClientConnectionType sets the callback function. | |
| 215 | + | func (x *TlsBackendInterface) OverrideGetDtlsClientConnectionType(cb func() types.GType) { | |
| 216 | + | if cb == nil { | |
| 217 | + | x.xGetDtlsClientConnectionType = 0 | |
| 218 | + | } else { | |
| 219 | + | x.xGetDtlsClientConnectionType = purego.NewCallback(func() types.GType { | |
| 220 | + | return cb() | |
| 221 | + | }) | |
| 222 | + | } | |
| 223 | + | } | |
| 224 | + | ||
| 225 | + | // GetGetDtlsClientConnectionType gets the callback function. | |
| 226 | + | func (x *TlsBackendInterface) GetGetDtlsClientConnectionType() func() types.GType { | |
| 227 | + | if x.xGetDtlsClientConnectionType == 0 { | |
| 228 | + | return nil | |
| 229 | + | } | |
| 230 | + | var rawCallback func() types.GType | |
| 231 | + | purego.RegisterFunc(&rawCallback, x.xGetDtlsClientConnectionType) | |
| 232 | + | return func() types.GType { | |
| 233 | + | return rawCallback() | |
| 234 | + | } | |
| 235 | + | } | |
| 236 | + | ||
| 237 | + | // OverrideGetDtlsServerConnectionType sets the callback function. | |
| 238 | + | func (x *TlsBackendInterface) OverrideGetDtlsServerConnectionType(cb func() types.GType) { | |
| 239 | + | if cb == nil { | |
| 240 | + | x.xGetDtlsServerConnectionType = 0 | |
| 241 | + | } else { | |
| 242 | + | x.xGetDtlsServerConnectionType = purego.NewCallback(func() types.GType { | |
| 243 | + | return cb() | |
| 244 | + | }) | |
| 245 | + | } | |
| 246 | + | } | |
| 247 | + | ||
| 248 | + | // GetGetDtlsServerConnectionType gets the callback function. | |
| 249 | + | func (x *TlsBackendInterface) GetGetDtlsServerConnectionType() func() types.GType { | |
| 250 | + | if x.xGetDtlsServerConnectionType == 0 { | |
| 251 | + | return nil | |
| 252 | + | } | |
| 253 | + | var rawCallback func() types.GType | |
| 254 | + | purego.RegisterFunc(&rawCallback, x.xGetDtlsServerConnectionType) | |
| 255 | + | return func() types.GType { | |
| 256 | + | return rawCallback() | |
| 257 | + | } | |
| 258 | + | } | |
| 259 | + | ||
| 25 | 260 | // TLS (Transport Layer Security, aka SSL) and DTLS backend. | |
| 26 | 261 | type TlsBackend interface { | |
| 27 | 262 | GoPointer() uintptr | |
M v4/gio/gtlscertificate.go +26 -1
| @@ -15,7 +15,9 @@ import ( | |||
| 15 | 15 | type TlsCertificateClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xVerify uintptr | |
| 19 | 21 | ||
| 20 | 22 | Padding [8]uintptr | |
| 21 | 23 | } | |
| @@ -24,6 +26,29 @@ func (x *TlsCertificateClass) GoPointer() uintptr { | |||
| 24 | 26 | return uintptr(unsafe.Pointer(x)) | |
| 25 | 27 | } | |
| 26 | 28 | ||
| 29 | + | // OverrideVerify sets the callback function. | |
| 30 | + | func (x *TlsCertificateClass) OverrideVerify(cb func(*TlsCertificate, SocketConnectable, *TlsCertificate) TlsCertificateFlags) { | |
| 31 | + | if cb == nil { | |
| 32 | + | x.xVerify = 0 | |
| 33 | + | } else { | |
| 34 | + | x.xVerify = purego.NewCallback(func(CertVarp uintptr, IdentityVarp uintptr, TrustedCaVarp uintptr) TlsCertificateFlags { | |
| 35 | + | return cb(TlsCertificateNewFromInternalPtr(CertVarp), &SocketConnectableBase{Ptr: IdentityVarp}, TlsCertificateNewFromInternalPtr(TrustedCaVarp)) | |
| 36 | + | }) | |
| 37 | + | } | |
| 38 | + | } | |
| 39 | + | ||
| 40 | + | // GetVerify gets the callback function. | |
| 41 | + | func (x *TlsCertificateClass) GetVerify() func(*TlsCertificate, SocketConnectable, *TlsCertificate) TlsCertificateFlags { | |
| 42 | + | if x.xVerify == 0 { | |
| 43 | + | return nil | |
| 44 | + | } | |
| 45 | + | var rawCallback func(CertVarp uintptr, IdentityVarp uintptr, TrustedCaVarp uintptr) TlsCertificateFlags | |
| 46 | + | purego.RegisterFunc(&rawCallback, x.xVerify) | |
| 47 | + | return func(CertVar *TlsCertificate, IdentityVar SocketConnectable, TrustedCaVar *TlsCertificate) TlsCertificateFlags { | |
| 48 | + | return rawCallback(CertVar.GoPointer(), IdentityVar.GoPointer(), TrustedCaVar.GoPointer()) | |
| 49 | + | } | |
| 50 | + | } | |
| 51 | + | ||
| 27 | 52 | type TlsCertificatePrivate struct { | |
| 28 | 53 | _ structs.HostLayout | |
| 29 | 54 | } | |
M v4/gio/gtlsclientconnection.go +25 -0
| @@ -17,12 +17,37 @@ type TlsClientConnectionInterface struct { | |||
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | 19 | GIface uintptr | |
| 20 | + | ||
| 21 | + | xCopySessionState uintptr | |
| 20 | 22 | } | |
| 21 | 23 | ||
| 22 | 24 | func (x *TlsClientConnectionInterface) GoPointer() uintptr { | |
| 23 | 25 | return uintptr(unsafe.Pointer(x)) | |
| 24 | 26 | } | |
| 25 | 27 | ||
| 28 | + | // OverrideCopySessionState sets the callback function. | |
| 29 | + | func (x *TlsClientConnectionInterface) OverrideCopySessionState(cb func(TlsClientConnection, TlsClientConnection)) { | |
| 30 | + | if cb == nil { | |
| 31 | + | x.xCopySessionState = 0 | |
| 32 | + | } else { | |
| 33 | + | x.xCopySessionState = purego.NewCallback(func(ConnVarp uintptr, SourceVarp uintptr) { | |
| 34 | + | cb(&TlsClientConnectionBase{Ptr: ConnVarp}, &TlsClientConnectionBase{Ptr: SourceVarp}) | |
| 35 | + | }) | |
| 36 | + | } | |
| 37 | + | } | |
| 38 | + | ||
| 39 | + | // GetCopySessionState gets the callback function. | |
| 40 | + | func (x *TlsClientConnectionInterface) GetCopySessionState() func(TlsClientConnection, TlsClientConnection) { | |
| 41 | + | if x.xCopySessionState == 0 { | |
| 42 | + | return nil | |
| 43 | + | } | |
| 44 | + | var rawCallback func(ConnVarp uintptr, SourceVarp uintptr) | |
| 45 | + | purego.RegisterFunc(&rawCallback, x.xCopySessionState) | |
| 46 | + | return func(ConnVar TlsClientConnection, SourceVar TlsClientConnection) { | |
| 47 | + | rawCallback(ConnVar.GoPointer(), SourceVar.GoPointer()) | |
| 48 | + | } | |
| 49 | + | } | |
| 50 | + | ||
| 26 | 51 | // #GTlsClientConnection is the client-side subclass of | |
| 27 | 52 | // #GTlsConnection, representing a client-side TLS connection. | |
| 28 | 53 | type TlsClientConnection interface { | |
M v4/gio/gtlsconnection.go +151 -1
| @@ -16,7 +16,19 @@ import ( | |||
| 16 | 16 | type TlsConnectionClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass IOStreamClass | |
| 20 | + | ||
| 21 | + | xAcceptCertificate uintptr | |
| 22 | + | ||
| 23 | + | xHandshake uintptr | |
| 24 | + | ||
| 25 | + | xHandshakeAsync uintptr | |
| 26 | + | ||
| 27 | + | xHandshakeFinish uintptr | |
| 28 | + | ||
| 29 | + | xGetBindingData uintptr | |
| 30 | + | ||
| 31 | + | xGetNegotiatedProtocol uintptr | |
| 20 | 32 | ||
| 21 | 33 | Padding [6]uintptr | |
| 22 | 34 | } | |
| @@ -25,6 +37,144 @@ func (x *TlsConnectionClass) GoPointer() uintptr { | |||
| 25 | 37 | return uintptr(unsafe.Pointer(x)) | |
| 26 | 38 | } | |
| 27 | 39 | ||
| 40 | + | // OverrideAcceptCertificate sets the callback function. | |
| 41 | + | func (x *TlsConnectionClass) OverrideAcceptCertificate(cb func(*TlsConnection, *TlsCertificate, TlsCertificateFlags) bool) { | |
| 42 | + | if cb == nil { | |
| 43 | + | x.xAcceptCertificate = 0 | |
| 44 | + | } else { | |
| 45 | + | x.xAcceptCertificate = purego.NewCallback(func(ConnectionVarp uintptr, PeerCertVarp uintptr, ErrorsVarp TlsCertificateFlags) bool { | |
| 46 | + | return cb(TlsConnectionNewFromInternalPtr(ConnectionVarp), TlsCertificateNewFromInternalPtr(PeerCertVarp), ErrorsVarp) | |
| 47 | + | }) | |
| 48 | + | } | |
| 49 | + | } | |
| 50 | + | ||
| 51 | + | // GetAcceptCertificate gets the callback function. | |
| 52 | + | func (x *TlsConnectionClass) GetAcceptCertificate() func(*TlsConnection, *TlsCertificate, TlsCertificateFlags) bool { | |
| 53 | + | if x.xAcceptCertificate == 0 { | |
| 54 | + | return nil | |
| 55 | + | } | |
| 56 | + | var rawCallback func(ConnectionVarp uintptr, PeerCertVarp uintptr, ErrorsVarp TlsCertificateFlags) bool | |
| 57 | + | purego.RegisterFunc(&rawCallback, x.xAcceptCertificate) | |
| 58 | + | return func(ConnectionVar *TlsConnection, PeerCertVar *TlsCertificate, ErrorsVar TlsCertificateFlags) bool { | |
| 59 | + | return rawCallback(ConnectionVar.GoPointer(), PeerCertVar.GoPointer(), ErrorsVar) | |
| 60 | + | } | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // OverrideHandshake sets the callback function. | |
| 64 | + | func (x *TlsConnectionClass) OverrideHandshake(cb func(*TlsConnection, *Cancellable) bool) { | |
| 65 | + | if cb == nil { | |
| 66 | + | x.xHandshake = 0 | |
| 67 | + | } else { | |
| 68 | + | x.xHandshake = purego.NewCallback(func(ConnVarp uintptr, CancellableVarp uintptr) bool { | |
| 69 | + | return cb(TlsConnectionNewFromInternalPtr(ConnVarp), CancellableNewFromInternalPtr(CancellableVarp)) | |
| 70 | + | }) | |
| 71 | + | } | |
| 72 | + | } | |
| 73 | + | ||
| 74 | + | // GetHandshake gets the callback function. | |
| 75 | + | func (x *TlsConnectionClass) GetHandshake() func(*TlsConnection, *Cancellable) bool { | |
| 76 | + | if x.xHandshake == 0 { | |
| 77 | + | return nil | |
| 78 | + | } | |
| 79 | + | var rawCallback func(ConnVarp uintptr, CancellableVarp uintptr) bool | |
| 80 | + | purego.RegisterFunc(&rawCallback, x.xHandshake) | |
| 81 | + | return func(ConnVar *TlsConnection, CancellableVar *Cancellable) bool { | |
| 82 | + | return rawCallback(ConnVar.GoPointer(), CancellableVar.GoPointer()) | |
| 83 | + | } | |
| 84 | + | } | |
| 85 | + | ||
| 86 | + | // OverrideHandshakeAsync sets the callback function. | |
| 87 | + | func (x *TlsConnectionClass) OverrideHandshakeAsync(cb func(*TlsConnection, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 88 | + | if cb == nil { | |
| 89 | + | x.xHandshakeAsync = 0 | |
| 90 | + | } else { | |
| 91 | + | x.xHandshakeAsync = purego.NewCallback(func(ConnVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 92 | + | cb(TlsConnectionNewFromInternalPtr(ConnVarp), IoPriorityVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 93 | + | }) | |
| 94 | + | } | |
| 95 | + | } | |
| 96 | + | ||
| 97 | + | // GetHandshakeAsync gets the callback function. | |
| 98 | + | func (x *TlsConnectionClass) GetHandshakeAsync() func(*TlsConnection, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 99 | + | if x.xHandshakeAsync == 0 { | |
| 100 | + | return nil | |
| 101 | + | } | |
| 102 | + | var rawCallback func(ConnVarp uintptr, IoPriorityVarp int, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 103 | + | purego.RegisterFunc(&rawCallback, x.xHandshakeAsync) | |
| 104 | + | return func(ConnVar *TlsConnection, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 105 | + | rawCallback(ConnVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 106 | + | } | |
| 107 | + | } | |
| 108 | + | ||
| 109 | + | // OverrideHandshakeFinish sets the callback function. | |
| 110 | + | func (x *TlsConnectionClass) OverrideHandshakeFinish(cb func(*TlsConnection, AsyncResult) bool) { | |
| 111 | + | if cb == nil { | |
| 112 | + | x.xHandshakeFinish = 0 | |
| 113 | + | } else { | |
| 114 | + | x.xHandshakeFinish = purego.NewCallback(func(ConnVarp uintptr, ResultVarp uintptr) bool { | |
| 115 | + | return cb(TlsConnectionNewFromInternalPtr(ConnVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 116 | + | }) | |
| 117 | + | } | |
| 118 | + | } | |
| 119 | + | ||
| 120 | + | // GetHandshakeFinish gets the callback function. | |
| 121 | + | func (x *TlsConnectionClass) GetHandshakeFinish() func(*TlsConnection, AsyncResult) bool { | |
| 122 | + | if x.xHandshakeFinish == 0 { | |
| 123 | + | return nil | |
| 124 | + | } | |
| 125 | + | var rawCallback func(ConnVarp uintptr, ResultVarp uintptr) bool | |
| 126 | + | purego.RegisterFunc(&rawCallback, x.xHandshakeFinish) | |
| 127 | + | return func(ConnVar *TlsConnection, ResultVar AsyncResult) bool { | |
| 128 | + | return rawCallback(ConnVar.GoPointer(), ResultVar.GoPointer()) | |
| 129 | + | } | |
| 130 | + | } | |
| 131 | + | ||
| 132 | + | // OverrideGetBindingData sets the callback function. | |
| 133 | + | func (x *TlsConnectionClass) OverrideGetBindingData(cb func(*TlsConnection, TlsChannelBindingType, []byte) bool) { | |
| 134 | + | if cb == nil { | |
| 135 | + | x.xGetBindingData = 0 | |
| 136 | + | } else { | |
| 137 | + | x.xGetBindingData = purego.NewCallback(func(ConnVarp uintptr, TypeVarp TlsChannelBindingType, DataVarp []byte) bool { | |
| 138 | + | return cb(TlsConnectionNewFromInternalPtr(ConnVarp), TypeVarp, DataVarp) | |
| 139 | + | }) | |
| 140 | + | } | |
| 141 | + | } | |
| 142 | + | ||
| 143 | + | // GetGetBindingData gets the callback function. | |
| 144 | + | func (x *TlsConnectionClass) GetGetBindingData() func(*TlsConnection, TlsChannelBindingType, []byte) bool { | |
| 145 | + | if x.xGetBindingData == 0 { | |
| 146 | + | return nil | |
| 147 | + | } | |
| 148 | + | var rawCallback func(ConnVarp uintptr, TypeVarp TlsChannelBindingType, DataVarp []byte) bool | |
| 149 | + | purego.RegisterFunc(&rawCallback, x.xGetBindingData) | |
| 150 | + | return func(ConnVar *TlsConnection, TypeVar TlsChannelBindingType, DataVar []byte) bool { | |
| 151 | + | return rawCallback(ConnVar.GoPointer(), TypeVar, DataVar) | |
| 152 | + | } | |
| 153 | + | } | |
| 154 | + | ||
| 155 | + | // OverrideGetNegotiatedProtocol sets the callback function. | |
| 156 | + | func (x *TlsConnectionClass) OverrideGetNegotiatedProtocol(cb func(*TlsConnection) string) { | |
| 157 | + | if cb == nil { | |
| 158 | + | x.xGetNegotiatedProtocol = 0 | |
| 159 | + | } else { | |
| 160 | + | x.xGetNegotiatedProtocol = purego.NewCallback(func(ConnVarp uintptr) string { | |
| 161 | + | return cb(TlsConnectionNewFromInternalPtr(ConnVarp)) | |
| 162 | + | }) | |
| 163 | + | } | |
| 164 | + | } | |
| 165 | + | ||
| 166 | + | // GetGetNegotiatedProtocol gets the callback function. | |
| 167 | + | func (x *TlsConnectionClass) GetGetNegotiatedProtocol() func(*TlsConnection) string { | |
| 168 | + | if x.xGetNegotiatedProtocol == 0 { | |
| 169 | + | return nil | |
| 170 | + | } | |
| 171 | + | var rawCallback func(ConnVarp uintptr) string | |
| 172 | + | purego.RegisterFunc(&rawCallback, x.xGetNegotiatedProtocol) | |
| 173 | + | return func(ConnVar *TlsConnection) string { | |
| 174 | + | return rawCallback(ConnVar.GoPointer()) | |
| 175 | + | } | |
| 176 | + | } | |
| 177 | + | ||
| 28 | 178 | type TlsConnectionPrivate struct { | |
| 29 | 179 | _ structs.HostLayout | |
| 30 | 180 | } | |
M v4/gio/gtlsdatabase.go +366 -1
| @@ -18,7 +18,33 @@ import ( | |||
| 18 | 18 | type TlsDatabaseClass struct { | |
| 19 | 19 | _ structs.HostLayout | |
| 20 | 20 | ||
| 21 | - | ParentClass uintptr | |
| 21 | + | ParentClass gobject.ObjectClass | |
| 22 | + | ||
| 23 | + | xVerifyChain uintptr | |
| 24 | + | ||
| 25 | + | xVerifyChainAsync uintptr | |
| 26 | + | ||
| 27 | + | xVerifyChainFinish uintptr | |
| 28 | + | ||
| 29 | + | xCreateCertificateHandle uintptr | |
| 30 | + | ||
| 31 | + | xLookupCertificateForHandle uintptr | |
| 32 | + | ||
| 33 | + | xLookupCertificateForHandleAsync uintptr | |
| 34 | + | ||
| 35 | + | xLookupCertificateForHandleFinish uintptr | |
| 36 | + | ||
| 37 | + | xLookupCertificateIssuer uintptr | |
| 38 | + | ||
| 39 | + | xLookupCertificateIssuerAsync uintptr | |
| 40 | + | ||
| 41 | + | xLookupCertificateIssuerFinish uintptr | |
| 42 | + | ||
| 43 | + | xLookupCertificatesIssuedBy uintptr | |
| 44 | + | ||
| 45 | + | xLookupCertificatesIssuedByAsync uintptr | |
| 46 | + | ||
| 47 | + | xLookupCertificatesIssuedByFinish uintptr | |
| 22 | 48 | ||
| 23 | 49 | Padding [16]uintptr | |
| 24 | 50 | } | |
| @@ -27,6 +53,345 @@ func (x *TlsDatabaseClass) GoPointer() uintptr { | |||
| 27 | 53 | return uintptr(unsafe.Pointer(x)) | |
| 28 | 54 | } | |
| 29 | 55 | ||
| 56 | + | // OverrideVerifyChain sets the callback function. | |
| 57 | + | func (x *TlsDatabaseClass) OverrideVerifyChain(cb func(*TlsDatabase, *TlsCertificate, string, SocketConnectable, *TlsInteraction, TlsDatabaseVerifyFlags, *Cancellable) TlsCertificateFlags) { | |
| 58 | + | if cb == nil { | |
| 59 | + | x.xVerifyChain = 0 | |
| 60 | + | } else { | |
| 61 | + | x.xVerifyChain = purego.NewCallback(func(SelfVarp uintptr, ChainVarp uintptr, PurposeVarp string, IdentityVarp uintptr, InteractionVarp uintptr, FlagsVarp TlsDatabaseVerifyFlags, CancellableVarp uintptr) TlsCertificateFlags { | |
| 62 | + | return cb(TlsDatabaseNewFromInternalPtr(SelfVarp), TlsCertificateNewFromInternalPtr(ChainVarp), PurposeVarp, &SocketConnectableBase{Ptr: IdentityVarp}, TlsInteractionNewFromInternalPtr(InteractionVarp), FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 63 | + | }) | |
| 64 | + | } | |
| 65 | + | } | |
| 66 | + | ||
| 67 | + | // GetVerifyChain gets the callback function. | |
| 68 | + | func (x *TlsDatabaseClass) GetVerifyChain() func(*TlsDatabase, *TlsCertificate, string, SocketConnectable, *TlsInteraction, TlsDatabaseVerifyFlags, *Cancellable) TlsCertificateFlags { | |
| 69 | + | if x.xVerifyChain == 0 { | |
| 70 | + | return nil | |
| 71 | + | } | |
| 72 | + | var rawCallback func(SelfVarp uintptr, ChainVarp uintptr, PurposeVarp string, IdentityVarp uintptr, InteractionVarp uintptr, FlagsVarp TlsDatabaseVerifyFlags, CancellableVarp uintptr) TlsCertificateFlags | |
| 73 | + | purego.RegisterFunc(&rawCallback, x.xVerifyChain) | |
| 74 | + | return func(SelfVar *TlsDatabase, ChainVar *TlsCertificate, PurposeVar string, IdentityVar SocketConnectable, InteractionVar *TlsInteraction, FlagsVar TlsDatabaseVerifyFlags, CancellableVar *Cancellable) TlsCertificateFlags { | |
| 75 | + | return rawCallback(SelfVar.GoPointer(), ChainVar.GoPointer(), PurposeVar, IdentityVar.GoPointer(), InteractionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 76 | + | } | |
| 77 | + | } | |
| 78 | + | ||
| 79 | + | // OverrideVerifyChainAsync sets the callback function. | |
| 80 | + | func (x *TlsDatabaseClass) OverrideVerifyChainAsync(cb func(*TlsDatabase, *TlsCertificate, string, SocketConnectable, *TlsInteraction, TlsDatabaseVerifyFlags, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 81 | + | if cb == nil { | |
| 82 | + | x.xVerifyChainAsync = 0 | |
| 83 | + | } else { | |
| 84 | + | x.xVerifyChainAsync = purego.NewCallback(func(SelfVarp uintptr, ChainVarp uintptr, PurposeVarp string, IdentityVarp uintptr, InteractionVarp uintptr, FlagsVarp TlsDatabaseVerifyFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 85 | + | cb(TlsDatabaseNewFromInternalPtr(SelfVarp), TlsCertificateNewFromInternalPtr(ChainVarp), PurposeVarp, &SocketConnectableBase{Ptr: IdentityVarp}, TlsInteractionNewFromInternalPtr(InteractionVarp), FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 86 | + | }) | |
| 87 | + | } | |
| 88 | + | } | |
| 89 | + | ||
| 90 | + | // GetVerifyChainAsync gets the callback function. | |
| 91 | + | func (x *TlsDatabaseClass) GetVerifyChainAsync() func(*TlsDatabase, *TlsCertificate, string, SocketConnectable, *TlsInteraction, TlsDatabaseVerifyFlags, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 92 | + | if x.xVerifyChainAsync == 0 { | |
| 93 | + | return nil | |
| 94 | + | } | |
| 95 | + | var rawCallback func(SelfVarp uintptr, ChainVarp uintptr, PurposeVarp string, IdentityVarp uintptr, InteractionVarp uintptr, FlagsVarp TlsDatabaseVerifyFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 96 | + | purego.RegisterFunc(&rawCallback, x.xVerifyChainAsync) | |
| 97 | + | return func(SelfVar *TlsDatabase, ChainVar *TlsCertificate, PurposeVar string, IdentityVar SocketConnectable, InteractionVar *TlsInteraction, FlagsVar TlsDatabaseVerifyFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 98 | + | rawCallback(SelfVar.GoPointer(), ChainVar.GoPointer(), PurposeVar, IdentityVar.GoPointer(), InteractionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 99 | + | } | |
| 100 | + | } | |
| 101 | + | ||
| 102 | + | // OverrideVerifyChainFinish sets the callback function. | |
| 103 | + | func (x *TlsDatabaseClass) OverrideVerifyChainFinish(cb func(*TlsDatabase, AsyncResult) TlsCertificateFlags) { | |
| 104 | + | if cb == nil { | |
| 105 | + | x.xVerifyChainFinish = 0 | |
| 106 | + | } else { | |
| 107 | + | x.xVerifyChainFinish = purego.NewCallback(func(SelfVarp uintptr, ResultVarp uintptr) TlsCertificateFlags { | |
| 108 | + | return cb(TlsDatabaseNewFromInternalPtr(SelfVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 109 | + | }) | |
| 110 | + | } | |
| 111 | + | } | |
| 112 | + | ||
| 113 | + | // GetVerifyChainFinish gets the callback function. | |
| 114 | + | func (x *TlsDatabaseClass) GetVerifyChainFinish() func(*TlsDatabase, AsyncResult) TlsCertificateFlags { | |
| 115 | + | if x.xVerifyChainFinish == 0 { | |
| 116 | + | return nil | |
| 117 | + | } | |
| 118 | + | var rawCallback func(SelfVarp uintptr, ResultVarp uintptr) TlsCertificateFlags | |
| 119 | + | purego.RegisterFunc(&rawCallback, x.xVerifyChainFinish) | |
| 120 | + | return func(SelfVar *TlsDatabase, ResultVar AsyncResult) TlsCertificateFlags { | |
| 121 | + | return rawCallback(SelfVar.GoPointer(), ResultVar.GoPointer()) | |
| 122 | + | } | |
| 123 | + | } | |
| 124 | + | ||
| 125 | + | // OverrideCreateCertificateHandle sets the callback function. | |
| 126 | + | func (x *TlsDatabaseClass) OverrideCreateCertificateHandle(cb func(*TlsDatabase, *TlsCertificate) string) { | |
| 127 | + | if cb == nil { | |
| 128 | + | x.xCreateCertificateHandle = 0 | |
| 129 | + | } else { | |
| 130 | + | x.xCreateCertificateHandle = purego.NewCallback(func(SelfVarp uintptr, CertificateVarp uintptr) string { | |
| 131 | + | return cb(TlsDatabaseNewFromInternalPtr(SelfVarp), TlsCertificateNewFromInternalPtr(CertificateVarp)) | |
| 132 | + | }) | |
| 133 | + | } | |
| 134 | + | } | |
| 135 | + | ||
| 136 | + | // GetCreateCertificateHandle gets the callback function. | |
| 137 | + | func (x *TlsDatabaseClass) GetCreateCertificateHandle() func(*TlsDatabase, *TlsCertificate) string { | |
| 138 | + | if x.xCreateCertificateHandle == 0 { | |
| 139 | + | return nil | |
| 140 | + | } | |
| 141 | + | var rawCallback func(SelfVarp uintptr, CertificateVarp uintptr) string | |
| 142 | + | purego.RegisterFunc(&rawCallback, x.xCreateCertificateHandle) | |
| 143 | + | return func(SelfVar *TlsDatabase, CertificateVar *TlsCertificate) string { | |
| 144 | + | return rawCallback(SelfVar.GoPointer(), CertificateVar.GoPointer()) | |
| 145 | + | } | |
| 146 | + | } | |
| 147 | + | ||
| 148 | + | // OverrideLookupCertificateForHandle sets the callback function. | |
| 149 | + | func (x *TlsDatabaseClass) OverrideLookupCertificateForHandle(cb func(*TlsDatabase, string, *TlsInteraction, TlsDatabaseLookupFlags, *Cancellable) *TlsCertificate) { | |
| 150 | + | if cb == nil { | |
| 151 | + | x.xLookupCertificateForHandle = 0 | |
| 152 | + | } else { | |
| 153 | + | x.xLookupCertificateForHandle = purego.NewCallback(func(SelfVarp uintptr, HandleVarp string, InteractionVarp uintptr, FlagsVarp TlsDatabaseLookupFlags, CancellableVarp uintptr) uintptr { | |
| 154 | + | ret := cb(TlsDatabaseNewFromInternalPtr(SelfVarp), HandleVarp, TlsInteractionNewFromInternalPtr(InteractionVarp), FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 155 | + | if ret == nil { | |
| 156 | + | return 0 | |
| 157 | + | } | |
| 158 | + | return ret.GoPointer() | |
| 159 | + | }) | |
| 160 | + | } | |
| 161 | + | } | |
| 162 | + | ||
| 163 | + | // GetLookupCertificateForHandle gets the callback function. | |
| 164 | + | func (x *TlsDatabaseClass) GetLookupCertificateForHandle() func(*TlsDatabase, string, *TlsInteraction, TlsDatabaseLookupFlags, *Cancellable) *TlsCertificate { | |
| 165 | + | if x.xLookupCertificateForHandle == 0 { | |
| 166 | + | return nil | |
| 167 | + | } | |
| 168 | + | var rawCallback func(SelfVarp uintptr, HandleVarp string, InteractionVarp uintptr, FlagsVarp TlsDatabaseLookupFlags, CancellableVarp uintptr) uintptr | |
| 169 | + | purego.RegisterFunc(&rawCallback, x.xLookupCertificateForHandle) | |
| 170 | + | return func(SelfVar *TlsDatabase, HandleVar string, InteractionVar *TlsInteraction, FlagsVar TlsDatabaseLookupFlags, CancellableVar *Cancellable) *TlsCertificate { | |
| 171 | + | rawRet := rawCallback(SelfVar.GoPointer(), HandleVar, InteractionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 172 | + | if rawRet == 0 { | |
| 173 | + | return nil | |
| 174 | + | } | |
| 175 | + | ret := &TlsCertificate{} | |
| 176 | + | ret.Ptr = rawRet | |
| 177 | + | return ret | |
| 178 | + | } | |
| 179 | + | } | |
| 180 | + | ||
| 181 | + | // OverrideLookupCertificateForHandleAsync sets the callback function. | |
| 182 | + | func (x *TlsDatabaseClass) OverrideLookupCertificateForHandleAsync(cb func(*TlsDatabase, string, *TlsInteraction, TlsDatabaseLookupFlags, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 183 | + | if cb == nil { | |
| 184 | + | x.xLookupCertificateForHandleAsync = 0 | |
| 185 | + | } else { | |
| 186 | + | x.xLookupCertificateForHandleAsync = purego.NewCallback(func(SelfVarp uintptr, HandleVarp string, InteractionVarp uintptr, FlagsVarp TlsDatabaseLookupFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 187 | + | cb(TlsDatabaseNewFromInternalPtr(SelfVarp), HandleVarp, TlsInteractionNewFromInternalPtr(InteractionVarp), FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 188 | + | }) | |
| 189 | + | } | |
| 190 | + | } | |
| 191 | + | ||
| 192 | + | // GetLookupCertificateForHandleAsync gets the callback function. | |
| 193 | + | func (x *TlsDatabaseClass) GetLookupCertificateForHandleAsync() func(*TlsDatabase, string, *TlsInteraction, TlsDatabaseLookupFlags, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 194 | + | if x.xLookupCertificateForHandleAsync == 0 { | |
| 195 | + | return nil | |
| 196 | + | } | |
| 197 | + | var rawCallback func(SelfVarp uintptr, HandleVarp string, InteractionVarp uintptr, FlagsVarp TlsDatabaseLookupFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 198 | + | purego.RegisterFunc(&rawCallback, x.xLookupCertificateForHandleAsync) | |
| 199 | + | return func(SelfVar *TlsDatabase, HandleVar string, InteractionVar *TlsInteraction, FlagsVar TlsDatabaseLookupFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 200 | + | rawCallback(SelfVar.GoPointer(), HandleVar, InteractionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 201 | + | } | |
| 202 | + | } | |
| 203 | + | ||
| 204 | + | // OverrideLookupCertificateForHandleFinish sets the callback function. | |
| 205 | + | func (x *TlsDatabaseClass) OverrideLookupCertificateForHandleFinish(cb func(*TlsDatabase, AsyncResult) *TlsCertificate) { | |
| 206 | + | if cb == nil { | |
| 207 | + | x.xLookupCertificateForHandleFinish = 0 | |
| 208 | + | } else { | |
| 209 | + | x.xLookupCertificateForHandleFinish = purego.NewCallback(func(SelfVarp uintptr, ResultVarp uintptr) uintptr { | |
| 210 | + | ret := cb(TlsDatabaseNewFromInternalPtr(SelfVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 211 | + | if ret == nil { | |
| 212 | + | return 0 | |
| 213 | + | } | |
| 214 | + | return ret.GoPointer() | |
| 215 | + | }) | |
| 216 | + | } | |
| 217 | + | } | |
| 218 | + | ||
| 219 | + | // GetLookupCertificateForHandleFinish gets the callback function. | |
| 220 | + | func (x *TlsDatabaseClass) GetLookupCertificateForHandleFinish() func(*TlsDatabase, AsyncResult) *TlsCertificate { | |
| 221 | + | if x.xLookupCertificateForHandleFinish == 0 { | |
| 222 | + | return nil | |
| 223 | + | } | |
| 224 | + | var rawCallback func(SelfVarp uintptr, ResultVarp uintptr) uintptr | |
| 225 | + | purego.RegisterFunc(&rawCallback, x.xLookupCertificateForHandleFinish) | |
| 226 | + | return func(SelfVar *TlsDatabase, ResultVar AsyncResult) *TlsCertificate { | |
| 227 | + | rawRet := rawCallback(SelfVar.GoPointer(), ResultVar.GoPointer()) | |
| 228 | + | if rawRet == 0 { | |
| 229 | + | return nil | |
| 230 | + | } | |
| 231 | + | ret := &TlsCertificate{} | |
| 232 | + | ret.Ptr = rawRet | |
| 233 | + | return ret | |
| 234 | + | } | |
| 235 | + | } | |
| 236 | + | ||
| 237 | + | // OverrideLookupCertificateIssuer sets the callback function. | |
| 238 | + | func (x *TlsDatabaseClass) OverrideLookupCertificateIssuer(cb func(*TlsDatabase, *TlsCertificate, *TlsInteraction, TlsDatabaseLookupFlags, *Cancellable) *TlsCertificate) { | |
| 239 | + | if cb == nil { | |
| 240 | + | x.xLookupCertificateIssuer = 0 | |
| 241 | + | } else { | |
| 242 | + | x.xLookupCertificateIssuer = purego.NewCallback(func(SelfVarp uintptr, CertificateVarp uintptr, InteractionVarp uintptr, FlagsVarp TlsDatabaseLookupFlags, CancellableVarp uintptr) uintptr { | |
| 243 | + | ret := cb(TlsDatabaseNewFromInternalPtr(SelfVarp), TlsCertificateNewFromInternalPtr(CertificateVarp), TlsInteractionNewFromInternalPtr(InteractionVarp), FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 244 | + | if ret == nil { | |
| 245 | + | return 0 | |
| 246 | + | } | |
| 247 | + | return ret.GoPointer() | |
| 248 | + | }) | |
| 249 | + | } | |
| 250 | + | } | |
| 251 | + | ||
| 252 | + | // GetLookupCertificateIssuer gets the callback function. | |
| 253 | + | func (x *TlsDatabaseClass) GetLookupCertificateIssuer() func(*TlsDatabase, *TlsCertificate, *TlsInteraction, TlsDatabaseLookupFlags, *Cancellable) *TlsCertificate { | |
| 254 | + | if x.xLookupCertificateIssuer == 0 { | |
| 255 | + | return nil | |
| 256 | + | } | |
| 257 | + | var rawCallback func(SelfVarp uintptr, CertificateVarp uintptr, InteractionVarp uintptr, FlagsVarp TlsDatabaseLookupFlags, CancellableVarp uintptr) uintptr | |
| 258 | + | purego.RegisterFunc(&rawCallback, x.xLookupCertificateIssuer) | |
| 259 | + | return func(SelfVar *TlsDatabase, CertificateVar *TlsCertificate, InteractionVar *TlsInteraction, FlagsVar TlsDatabaseLookupFlags, CancellableVar *Cancellable) *TlsCertificate { | |
| 260 | + | rawRet := rawCallback(SelfVar.GoPointer(), CertificateVar.GoPointer(), InteractionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 261 | + | if rawRet == 0 { | |
| 262 | + | return nil | |
| 263 | + | } | |
| 264 | + | ret := &TlsCertificate{} | |
| 265 | + | ret.Ptr = rawRet | |
| 266 | + | return ret | |
| 267 | + | } | |
| 268 | + | } | |
| 269 | + | ||
| 270 | + | // OverrideLookupCertificateIssuerAsync sets the callback function. | |
| 271 | + | func (x *TlsDatabaseClass) OverrideLookupCertificateIssuerAsync(cb func(*TlsDatabase, *TlsCertificate, *TlsInteraction, TlsDatabaseLookupFlags, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 272 | + | if cb == nil { | |
| 273 | + | x.xLookupCertificateIssuerAsync = 0 | |
| 274 | + | } else { | |
| 275 | + | x.xLookupCertificateIssuerAsync = purego.NewCallback(func(SelfVarp uintptr, CertificateVarp uintptr, InteractionVarp uintptr, FlagsVarp TlsDatabaseLookupFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 276 | + | cb(TlsDatabaseNewFromInternalPtr(SelfVarp), TlsCertificateNewFromInternalPtr(CertificateVarp), TlsInteractionNewFromInternalPtr(InteractionVarp), FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 277 | + | }) | |
| 278 | + | } | |
| 279 | + | } | |
| 280 | + | ||
| 281 | + | // GetLookupCertificateIssuerAsync gets the callback function. | |
| 282 | + | func (x *TlsDatabaseClass) GetLookupCertificateIssuerAsync() func(*TlsDatabase, *TlsCertificate, *TlsInteraction, TlsDatabaseLookupFlags, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 283 | + | if x.xLookupCertificateIssuerAsync == 0 { | |
| 284 | + | return nil | |
| 285 | + | } | |
| 286 | + | var rawCallback func(SelfVarp uintptr, CertificateVarp uintptr, InteractionVarp uintptr, FlagsVarp TlsDatabaseLookupFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 287 | + | purego.RegisterFunc(&rawCallback, x.xLookupCertificateIssuerAsync) | |
| 288 | + | return func(SelfVar *TlsDatabase, CertificateVar *TlsCertificate, InteractionVar *TlsInteraction, FlagsVar TlsDatabaseLookupFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 289 | + | rawCallback(SelfVar.GoPointer(), CertificateVar.GoPointer(), InteractionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 290 | + | } | |
| 291 | + | } | |
| 292 | + | ||
| 293 | + | // OverrideLookupCertificateIssuerFinish sets the callback function. | |
| 294 | + | func (x *TlsDatabaseClass) OverrideLookupCertificateIssuerFinish(cb func(*TlsDatabase, AsyncResult) *TlsCertificate) { | |
| 295 | + | if cb == nil { | |
| 296 | + | x.xLookupCertificateIssuerFinish = 0 | |
| 297 | + | } else { | |
| 298 | + | x.xLookupCertificateIssuerFinish = purego.NewCallback(func(SelfVarp uintptr, ResultVarp uintptr) uintptr { | |
| 299 | + | ret := cb(TlsDatabaseNewFromInternalPtr(SelfVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 300 | + | if ret == nil { | |
| 301 | + | return 0 | |
| 302 | + | } | |
| 303 | + | return ret.GoPointer() | |
| 304 | + | }) | |
| 305 | + | } | |
| 306 | + | } | |
| 307 | + | ||
| 308 | + | // GetLookupCertificateIssuerFinish gets the callback function. | |
| 309 | + | func (x *TlsDatabaseClass) GetLookupCertificateIssuerFinish() func(*TlsDatabase, AsyncResult) *TlsCertificate { | |
| 310 | + | if x.xLookupCertificateIssuerFinish == 0 { | |
| 311 | + | return nil | |
| 312 | + | } | |
| 313 | + | var rawCallback func(SelfVarp uintptr, ResultVarp uintptr) uintptr | |
| 314 | + | purego.RegisterFunc(&rawCallback, x.xLookupCertificateIssuerFinish) | |
| 315 | + | return func(SelfVar *TlsDatabase, ResultVar AsyncResult) *TlsCertificate { | |
| 316 | + | rawRet := rawCallback(SelfVar.GoPointer(), ResultVar.GoPointer()) | |
| 317 | + | if rawRet == 0 { | |
| 318 | + | return nil | |
| 319 | + | } | |
| 320 | + | ret := &TlsCertificate{} | |
| 321 | + | ret.Ptr = rawRet | |
| 322 | + | return ret | |
| 323 | + | } | |
| 324 | + | } | |
| 325 | + | ||
| 326 | + | // OverrideLookupCertificatesIssuedBy sets the callback function. | |
| 327 | + | func (x *TlsDatabaseClass) OverrideLookupCertificatesIssuedBy(cb func(*TlsDatabase, []byte, *TlsInteraction, TlsDatabaseLookupFlags, *Cancellable) *glib.List) { | |
| 328 | + | if cb == nil { | |
| 329 | + | x.xLookupCertificatesIssuedBy = 0 | |
| 330 | + | } else { | |
| 331 | + | x.xLookupCertificatesIssuedBy = purego.NewCallback(func(SelfVarp uintptr, IssuerRawDnVarp []byte, InteractionVarp uintptr, FlagsVarp TlsDatabaseLookupFlags, CancellableVarp uintptr) *glib.List { | |
| 332 | + | return cb(TlsDatabaseNewFromInternalPtr(SelfVarp), IssuerRawDnVarp, TlsInteractionNewFromInternalPtr(InteractionVarp), FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 333 | + | }) | |
| 334 | + | } | |
| 335 | + | } | |
| 336 | + | ||
| 337 | + | // GetLookupCertificatesIssuedBy gets the callback function. | |
| 338 | + | func (x *TlsDatabaseClass) GetLookupCertificatesIssuedBy() func(*TlsDatabase, []byte, *TlsInteraction, TlsDatabaseLookupFlags, *Cancellable) *glib.List { | |
| 339 | + | if x.xLookupCertificatesIssuedBy == 0 { | |
| 340 | + | return nil | |
| 341 | + | } | |
| 342 | + | var rawCallback func(SelfVarp uintptr, IssuerRawDnVarp []byte, InteractionVarp uintptr, FlagsVarp TlsDatabaseLookupFlags, CancellableVarp uintptr) *glib.List | |
| 343 | + | purego.RegisterFunc(&rawCallback, x.xLookupCertificatesIssuedBy) | |
| 344 | + | return func(SelfVar *TlsDatabase, IssuerRawDnVar []byte, InteractionVar *TlsInteraction, FlagsVar TlsDatabaseLookupFlags, CancellableVar *Cancellable) *glib.List { | |
| 345 | + | return rawCallback(SelfVar.GoPointer(), IssuerRawDnVar, InteractionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 346 | + | } | |
| 347 | + | } | |
| 348 | + | ||
| 349 | + | // OverrideLookupCertificatesIssuedByAsync sets the callback function. | |
| 350 | + | func (x *TlsDatabaseClass) OverrideLookupCertificatesIssuedByAsync(cb func(*TlsDatabase, []byte, *TlsInteraction, TlsDatabaseLookupFlags, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 351 | + | if cb == nil { | |
| 352 | + | x.xLookupCertificatesIssuedByAsync = 0 | |
| 353 | + | } else { | |
| 354 | + | x.xLookupCertificatesIssuedByAsync = purego.NewCallback(func(SelfVarp uintptr, IssuerRawDnVarp []byte, InteractionVarp uintptr, FlagsVarp TlsDatabaseLookupFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 355 | + | cb(TlsDatabaseNewFromInternalPtr(SelfVarp), IssuerRawDnVarp, TlsInteractionNewFromInternalPtr(InteractionVarp), FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 356 | + | }) | |
| 357 | + | } | |
| 358 | + | } | |
| 359 | + | ||
| 360 | + | // GetLookupCertificatesIssuedByAsync gets the callback function. | |
| 361 | + | func (x *TlsDatabaseClass) GetLookupCertificatesIssuedByAsync() func(*TlsDatabase, []byte, *TlsInteraction, TlsDatabaseLookupFlags, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 362 | + | if x.xLookupCertificatesIssuedByAsync == 0 { | |
| 363 | + | return nil | |
| 364 | + | } | |
| 365 | + | var rawCallback func(SelfVarp uintptr, IssuerRawDnVarp []byte, InteractionVarp uintptr, FlagsVarp TlsDatabaseLookupFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 366 | + | purego.RegisterFunc(&rawCallback, x.xLookupCertificatesIssuedByAsync) | |
| 367 | + | return func(SelfVar *TlsDatabase, IssuerRawDnVar []byte, InteractionVar *TlsInteraction, FlagsVar TlsDatabaseLookupFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 368 | + | rawCallback(SelfVar.GoPointer(), IssuerRawDnVar, InteractionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 369 | + | } | |
| 370 | + | } | |
| 371 | + | ||
| 372 | + | // OverrideLookupCertificatesIssuedByFinish sets the callback function. | |
| 373 | + | func (x *TlsDatabaseClass) OverrideLookupCertificatesIssuedByFinish(cb func(*TlsDatabase, AsyncResult) *glib.List) { | |
| 374 | + | if cb == nil { | |
| 375 | + | x.xLookupCertificatesIssuedByFinish = 0 | |
| 376 | + | } else { | |
| 377 | + | x.xLookupCertificatesIssuedByFinish = purego.NewCallback(func(SelfVarp uintptr, ResultVarp uintptr) *glib.List { | |
| 378 | + | return cb(TlsDatabaseNewFromInternalPtr(SelfVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 379 | + | }) | |
| 380 | + | } | |
| 381 | + | } | |
| 382 | + | ||
| 383 | + | // GetLookupCertificatesIssuedByFinish gets the callback function. | |
| 384 | + | func (x *TlsDatabaseClass) GetLookupCertificatesIssuedByFinish() func(*TlsDatabase, AsyncResult) *glib.List { | |
| 385 | + | if x.xLookupCertificatesIssuedByFinish == 0 { | |
| 386 | + | return nil | |
| 387 | + | } | |
| 388 | + | var rawCallback func(SelfVarp uintptr, ResultVarp uintptr) *glib.List | |
| 389 | + | purego.RegisterFunc(&rawCallback, x.xLookupCertificatesIssuedByFinish) | |
| 390 | + | return func(SelfVar *TlsDatabase, ResultVar AsyncResult) *glib.List { | |
| 391 | + | return rawCallback(SelfVar.GoPointer(), ResultVar.GoPointer()) | |
| 392 | + | } | |
| 393 | + | } | |
| 394 | + | ||
| 30 | 395 | type TlsDatabasePrivate struct { | |
| 31 | 396 | _ structs.HostLayout | |
| 32 | 397 | } | |
M v4/gio/gtlsinteraction.go +151 -1
| @@ -29,7 +29,19 @@ import ( | |||
| 29 | 29 | type TlsInteractionClass struct { | |
| 30 | 30 | _ structs.HostLayout | |
| 31 | 31 | ||
| 32 | - | ParentClass uintptr | |
| 32 | + | ParentClass gobject.ObjectClass | |
| 33 | + | ||
| 34 | + | xAskPassword uintptr | |
| 35 | + | ||
| 36 | + | xAskPasswordAsync uintptr | |
| 37 | + | ||
| 38 | + | xAskPasswordFinish uintptr | |
| 39 | + | ||
| 40 | + | xRequestCertificate uintptr | |
| 41 | + | ||
| 42 | + | xRequestCertificateAsync uintptr | |
| 43 | + | ||
| 44 | + | xRequestCertificateFinish uintptr | |
| 33 | 45 | ||
| 34 | 46 | Padding [21]uintptr | |
| 35 | 47 | } | |
| @@ -38,6 +50,144 @@ func (x *TlsInteractionClass) GoPointer() uintptr { | |||
| 38 | 50 | return uintptr(unsafe.Pointer(x)) | |
| 39 | 51 | } | |
| 40 | 52 | ||
| 53 | + | // OverrideAskPassword sets the callback function. | |
| 54 | + | func (x *TlsInteractionClass) OverrideAskPassword(cb func(*TlsInteraction, *TlsPassword, *Cancellable) TlsInteractionResult) { | |
| 55 | + | if cb == nil { | |
| 56 | + | x.xAskPassword = 0 | |
| 57 | + | } else { | |
| 58 | + | x.xAskPassword = purego.NewCallback(func(InteractionVarp uintptr, PasswordVarp uintptr, CancellableVarp uintptr) TlsInteractionResult { | |
| 59 | + | return cb(TlsInteractionNewFromInternalPtr(InteractionVarp), TlsPasswordNewFromInternalPtr(PasswordVarp), CancellableNewFromInternalPtr(CancellableVarp)) | |
| 60 | + | }) | |
| 61 | + | } | |
| 62 | + | } | |
| 63 | + | ||
| 64 | + | // GetAskPassword gets the callback function. | |
| 65 | + | func (x *TlsInteractionClass) GetAskPassword() func(*TlsInteraction, *TlsPassword, *Cancellable) TlsInteractionResult { | |
| 66 | + | if x.xAskPassword == 0 { | |
| 67 | + | return nil | |
| 68 | + | } | |
| 69 | + | var rawCallback func(InteractionVarp uintptr, PasswordVarp uintptr, CancellableVarp uintptr) TlsInteractionResult | |
| 70 | + | purego.RegisterFunc(&rawCallback, x.xAskPassword) | |
| 71 | + | return func(InteractionVar *TlsInteraction, PasswordVar *TlsPassword, CancellableVar *Cancellable) TlsInteractionResult { | |
| 72 | + | return rawCallback(InteractionVar.GoPointer(), PasswordVar.GoPointer(), CancellableVar.GoPointer()) | |
| 73 | + | } | |
| 74 | + | } | |
| 75 | + | ||
| 76 | + | // OverrideAskPasswordAsync sets the callback function. | |
| 77 | + | func (x *TlsInteractionClass) OverrideAskPasswordAsync(cb func(*TlsInteraction, *TlsPassword, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 78 | + | if cb == nil { | |
| 79 | + | x.xAskPasswordAsync = 0 | |
| 80 | + | } else { | |
| 81 | + | x.xAskPasswordAsync = purego.NewCallback(func(InteractionVarp uintptr, PasswordVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 82 | + | cb(TlsInteractionNewFromInternalPtr(InteractionVarp), TlsPasswordNewFromInternalPtr(PasswordVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 83 | + | }) | |
| 84 | + | } | |
| 85 | + | } | |
| 86 | + | ||
| 87 | + | // GetAskPasswordAsync gets the callback function. | |
| 88 | + | func (x *TlsInteractionClass) GetAskPasswordAsync() func(*TlsInteraction, *TlsPassword, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 89 | + | if x.xAskPasswordAsync == 0 { | |
| 90 | + | return nil | |
| 91 | + | } | |
| 92 | + | var rawCallback func(InteractionVarp uintptr, PasswordVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 93 | + | purego.RegisterFunc(&rawCallback, x.xAskPasswordAsync) | |
| 94 | + | return func(InteractionVar *TlsInteraction, PasswordVar *TlsPassword, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 95 | + | rawCallback(InteractionVar.GoPointer(), PasswordVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 96 | + | } | |
| 97 | + | } | |
| 98 | + | ||
| 99 | + | // OverrideAskPasswordFinish sets the callback function. | |
| 100 | + | func (x *TlsInteractionClass) OverrideAskPasswordFinish(cb func(*TlsInteraction, AsyncResult) TlsInteractionResult) { | |
| 101 | + | if cb == nil { | |
| 102 | + | x.xAskPasswordFinish = 0 | |
| 103 | + | } else { | |
| 104 | + | x.xAskPasswordFinish = purego.NewCallback(func(InteractionVarp uintptr, ResultVarp uintptr) TlsInteractionResult { | |
| 105 | + | return cb(TlsInteractionNewFromInternalPtr(InteractionVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 106 | + | }) | |
| 107 | + | } | |
| 108 | + | } | |
| 109 | + | ||
| 110 | + | // GetAskPasswordFinish gets the callback function. | |
| 111 | + | func (x *TlsInteractionClass) GetAskPasswordFinish() func(*TlsInteraction, AsyncResult) TlsInteractionResult { | |
| 112 | + | if x.xAskPasswordFinish == 0 { | |
| 113 | + | return nil | |
| 114 | + | } | |
| 115 | + | var rawCallback func(InteractionVarp uintptr, ResultVarp uintptr) TlsInteractionResult | |
| 116 | + | purego.RegisterFunc(&rawCallback, x.xAskPasswordFinish) | |
| 117 | + | return func(InteractionVar *TlsInteraction, ResultVar AsyncResult) TlsInteractionResult { | |
| 118 | + | return rawCallback(InteractionVar.GoPointer(), ResultVar.GoPointer()) | |
| 119 | + | } | |
| 120 | + | } | |
| 121 | + | ||
| 122 | + | // OverrideRequestCertificate sets the callback function. | |
| 123 | + | func (x *TlsInteractionClass) OverrideRequestCertificate(cb func(*TlsInteraction, *TlsConnection, TlsCertificateRequestFlags, *Cancellable) TlsInteractionResult) { | |
| 124 | + | if cb == nil { | |
| 125 | + | x.xRequestCertificate = 0 | |
| 126 | + | } else { | |
| 127 | + | x.xRequestCertificate = purego.NewCallback(func(InteractionVarp uintptr, ConnectionVarp uintptr, FlagsVarp TlsCertificateRequestFlags, CancellableVarp uintptr) TlsInteractionResult { | |
| 128 | + | return cb(TlsInteractionNewFromInternalPtr(InteractionVarp), TlsConnectionNewFromInternalPtr(ConnectionVarp), FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 129 | + | }) | |
| 130 | + | } | |
| 131 | + | } | |
| 132 | + | ||
| 133 | + | // GetRequestCertificate gets the callback function. | |
| 134 | + | func (x *TlsInteractionClass) GetRequestCertificate() func(*TlsInteraction, *TlsConnection, TlsCertificateRequestFlags, *Cancellable) TlsInteractionResult { | |
| 135 | + | if x.xRequestCertificate == 0 { | |
| 136 | + | return nil | |
| 137 | + | } | |
| 138 | + | var rawCallback func(InteractionVarp uintptr, ConnectionVarp uintptr, FlagsVarp TlsCertificateRequestFlags, CancellableVarp uintptr) TlsInteractionResult | |
| 139 | + | purego.RegisterFunc(&rawCallback, x.xRequestCertificate) | |
| 140 | + | return func(InteractionVar *TlsInteraction, ConnectionVar *TlsConnection, FlagsVar TlsCertificateRequestFlags, CancellableVar *Cancellable) TlsInteractionResult { | |
| 141 | + | return rawCallback(InteractionVar.GoPointer(), ConnectionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 142 | + | } | |
| 143 | + | } | |
| 144 | + | ||
| 145 | + | // OverrideRequestCertificateAsync sets the callback function. | |
| 146 | + | func (x *TlsInteractionClass) OverrideRequestCertificateAsync(cb func(*TlsInteraction, *TlsConnection, TlsCertificateRequestFlags, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 147 | + | if cb == nil { | |
| 148 | + | x.xRequestCertificateAsync = 0 | |
| 149 | + | } else { | |
| 150 | + | x.xRequestCertificateAsync = purego.NewCallback(func(InteractionVarp uintptr, ConnectionVarp uintptr, FlagsVarp TlsCertificateRequestFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 151 | + | cb(TlsInteractionNewFromInternalPtr(InteractionVarp), TlsConnectionNewFromInternalPtr(ConnectionVarp), FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 152 | + | }) | |
| 153 | + | } | |
| 154 | + | } | |
| 155 | + | ||
| 156 | + | // GetRequestCertificateAsync gets the callback function. | |
| 157 | + | func (x *TlsInteractionClass) GetRequestCertificateAsync() func(*TlsInteraction, *TlsConnection, TlsCertificateRequestFlags, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 158 | + | if x.xRequestCertificateAsync == 0 { | |
| 159 | + | return nil | |
| 160 | + | } | |
| 161 | + | var rawCallback func(InteractionVarp uintptr, ConnectionVarp uintptr, FlagsVarp TlsCertificateRequestFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 162 | + | purego.RegisterFunc(&rawCallback, x.xRequestCertificateAsync) | |
| 163 | + | return func(InteractionVar *TlsInteraction, ConnectionVar *TlsConnection, FlagsVar TlsCertificateRequestFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 164 | + | rawCallback(InteractionVar.GoPointer(), ConnectionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 165 | + | } | |
| 166 | + | } | |
| 167 | + | ||
| 168 | + | // OverrideRequestCertificateFinish sets the callback function. | |
| 169 | + | func (x *TlsInteractionClass) OverrideRequestCertificateFinish(cb func(*TlsInteraction, AsyncResult) TlsInteractionResult) { | |
| 170 | + | if cb == nil { | |
| 171 | + | x.xRequestCertificateFinish = 0 | |
| 172 | + | } else { | |
| 173 | + | x.xRequestCertificateFinish = purego.NewCallback(func(InteractionVarp uintptr, ResultVarp uintptr) TlsInteractionResult { | |
| 174 | + | return cb(TlsInteractionNewFromInternalPtr(InteractionVarp), &AsyncResultBase{Ptr: ResultVarp}) | |
| 175 | + | }) | |
| 176 | + | } | |
| 177 | + | } | |
| 178 | + | ||
| 179 | + | // GetRequestCertificateFinish gets the callback function. | |
| 180 | + | func (x *TlsInteractionClass) GetRequestCertificateFinish() func(*TlsInteraction, AsyncResult) TlsInteractionResult { | |
| 181 | + | if x.xRequestCertificateFinish == 0 { | |
| 182 | + | return nil | |
| 183 | + | } | |
| 184 | + | var rawCallback func(InteractionVarp uintptr, ResultVarp uintptr) TlsInteractionResult | |
| 185 | + | purego.RegisterFunc(&rawCallback, x.xRequestCertificateFinish) | |
| 186 | + | return func(InteractionVar *TlsInteraction, ResultVar AsyncResult) TlsInteractionResult { | |
| 187 | + | return rawCallback(InteractionVar.GoPointer(), ResultVar.GoPointer()) | |
| 188 | + | } | |
| 189 | + | } | |
| 190 | + | ||
| 41 | 191 | type TlsInteractionPrivate struct { | |
| 42 | 192 | _ structs.HostLayout | |
| 43 | 193 | } | |
M v4/gio/gtlspassword.go +76 -1
| @@ -16,7 +16,13 @@ import ( | |||
| 16 | 16 | type TlsPasswordClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | + | ||
| 21 | + | xGetValue uintptr | |
| 22 | + | ||
| 23 | + | xSetValue uintptr | |
| 24 | + | ||
| 25 | + | xGetDefaultWarning uintptr | |
| 20 | 26 | ||
| 21 | 27 | Padding [4]uintptr | |
| 22 | 28 | } | |
| @@ -25,6 +31,75 @@ func (x *TlsPasswordClass) GoPointer() uintptr { | |||
| 25 | 31 | return uintptr(unsafe.Pointer(x)) | |
| 26 | 32 | } | |
| 27 | 33 | ||
| 34 | + | // OverrideGetValue sets the callback function. | |
| 35 | + | func (x *TlsPasswordClass) OverrideGetValue(cb func(*TlsPassword, uint) uintptr) { | |
| 36 | + | if cb == nil { | |
| 37 | + | x.xGetValue = 0 | |
| 38 | + | } else { | |
| 39 | + | x.xGetValue = purego.NewCallback(func(PasswordVarp uintptr, LengthVarp uint) uintptr { | |
| 40 | + | return cb(TlsPasswordNewFromInternalPtr(PasswordVarp), LengthVarp) | |
| 41 | + | }) | |
| 42 | + | } | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | // GetGetValue gets the callback function. | |
| 46 | + | func (x *TlsPasswordClass) GetGetValue() func(*TlsPassword, uint) uintptr { | |
| 47 | + | if x.xGetValue == 0 { | |
| 48 | + | return nil | |
| 49 | + | } | |
| 50 | + | var rawCallback func(PasswordVarp uintptr, LengthVarp uint) uintptr | |
| 51 | + | purego.RegisterFunc(&rawCallback, x.xGetValue) | |
| 52 | + | return func(PasswordVar *TlsPassword, LengthVar uint) uintptr { | |
| 53 | + | return rawCallback(PasswordVar.GoPointer(), LengthVar) | |
| 54 | + | } | |
| 55 | + | } | |
| 56 | + | ||
| 57 | + | // OverrideSetValue sets the callback function. | |
| 58 | + | func (x *TlsPasswordClass) OverrideSetValue(cb func(*TlsPassword, []byte, int, *glib.DestroyNotify)) { | |
| 59 | + | if cb == nil { | |
| 60 | + | x.xSetValue = 0 | |
| 61 | + | } else { | |
| 62 | + | x.xSetValue = purego.NewCallback(func(PasswordVarp uintptr, ValueVarp []byte, LengthVarp int, DestroyVarp uintptr) { | |
| 63 | + | cb(TlsPasswordNewFromInternalPtr(PasswordVarp), ValueVarp, LengthVarp, (*glib.DestroyNotify)(unsafe.Pointer(DestroyVarp))) | |
| 64 | + | }) | |
| 65 | + | } | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | // GetSetValue gets the callback function. | |
| 69 | + | func (x *TlsPasswordClass) GetSetValue() func(*TlsPassword, []byte, int, *glib.DestroyNotify) { | |
| 70 | + | if x.xSetValue == 0 { | |
| 71 | + | return nil | |
| 72 | + | } | |
| 73 | + | var rawCallback func(PasswordVarp uintptr, ValueVarp []byte, LengthVarp int, DestroyVarp uintptr) | |
| 74 | + | purego.RegisterFunc(&rawCallback, x.xSetValue) | |
| 75 | + | return func(PasswordVar *TlsPassword, ValueVar []byte, LengthVar int, DestroyVar *glib.DestroyNotify) { | |
| 76 | + | rawCallback(PasswordVar.GoPointer(), ValueVar, LengthVar, glib.NewCallbackNullable(DestroyVar)) | |
| 77 | + | } | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | // OverrideGetDefaultWarning sets the callback function. | |
| 81 | + | func (x *TlsPasswordClass) OverrideGetDefaultWarning(cb func(*TlsPassword) string) { | |
| 82 | + | if cb == nil { | |
| 83 | + | x.xGetDefaultWarning = 0 | |
| 84 | + | } else { | |
| 85 | + | x.xGetDefaultWarning = purego.NewCallback(func(PasswordVarp uintptr) string { | |
| 86 | + | return cb(TlsPasswordNewFromInternalPtr(PasswordVarp)) | |
| 87 | + | }) | |
| 88 | + | } | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | // GetGetDefaultWarning gets the callback function. | |
| 92 | + | func (x *TlsPasswordClass) GetGetDefaultWarning() func(*TlsPassword) string { | |
| 93 | + | if x.xGetDefaultWarning == 0 { | |
| 94 | + | return nil | |
| 95 | + | } | |
| 96 | + | var rawCallback func(PasswordVarp uintptr) string | |
| 97 | + | purego.RegisterFunc(&rawCallback, x.xGetDefaultWarning) | |
| 98 | + | return func(PasswordVar *TlsPassword) string { | |
| 99 | + | return rawCallback(PasswordVar.GoPointer()) | |
| 100 | + | } | |
| 101 | + | } | |
| 102 | + | ||
| 28 | 103 | type TlsPasswordPrivate struct { | |
| 29 | 104 | _ structs.HostLayout | |
| 30 | 105 | } | |
M v4/gio/gunixconnection.go +1 -1
| @@ -14,7 +14,7 @@ import ( | |||
| 14 | 14 | type UnixConnectionClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass SocketConnectionClass | |
| 18 | 18 | } | |
| 19 | 19 | ||
| 20 | 20 | func (x *UnixConnectionClass) GoPointer() uintptr { | |
M v4/gio/gunixcredentialsmessage.go +51 -1
| @@ -15,13 +15,63 @@ import ( | |||
| 15 | 15 | type UnixCredentialsMessageClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass SocketControlMessageClass | |
| 19 | + | ||
| 20 | + | xGReserved1 uintptr | |
| 21 | + | ||
| 22 | + | xGReserved2 uintptr | |
| 19 | 23 | } | |
| 20 | 24 | ||
| 21 | 25 | func (x *UnixCredentialsMessageClass) GoPointer() uintptr { | |
| 22 | 26 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 27 | } | |
| 24 | 28 | ||
| 29 | + | // OverrideGReserved1 sets the callback function. | |
| 30 | + | func (x *UnixCredentialsMessageClass) OverrideGReserved1(cb func()) { | |
| 31 | + | if cb == nil { | |
| 32 | + | x.xGReserved1 = 0 | |
| 33 | + | } else { | |
| 34 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 35 | + | cb() | |
| 36 | + | }) | |
| 37 | + | } | |
| 38 | + | } | |
| 39 | + | ||
| 40 | + | // GetGReserved1 gets the callback function. | |
| 41 | + | func (x *UnixCredentialsMessageClass) GetGReserved1() func() { | |
| 42 | + | if x.xGReserved1 == 0 { | |
| 43 | + | return nil | |
| 44 | + | } | |
| 45 | + | var rawCallback func() | |
| 46 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 47 | + | return func() { | |
| 48 | + | rawCallback() | |
| 49 | + | } | |
| 50 | + | } | |
| 51 | + | ||
| 52 | + | // OverrideGReserved2 sets the callback function. | |
| 53 | + | func (x *UnixCredentialsMessageClass) OverrideGReserved2(cb func()) { | |
| 54 | + | if cb == nil { | |
| 55 | + | x.xGReserved2 = 0 | |
| 56 | + | } else { | |
| 57 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 58 | + | cb() | |
| 59 | + | }) | |
| 60 | + | } | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // GetGReserved2 gets the callback function. | |
| 64 | + | func (x *UnixCredentialsMessageClass) GetGReserved2() func() { | |
| 65 | + | if x.xGReserved2 == 0 { | |
| 66 | + | return nil | |
| 67 | + | } | |
| 68 | + | var rawCallback func() | |
| 69 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 70 | + | return func() { | |
| 71 | + | rawCallback() | |
| 72 | + | } | |
| 73 | + | } | |
| 74 | + | ||
| 25 | 75 | type UnixCredentialsMessagePrivate struct { | |
| 26 | 76 | _ structs.HostLayout | |
| 27 | 77 | } | |
M v4/gio/gunixfdlist.go +126 -1
| @@ -15,13 +15,138 @@ import ( | |||
| 15 | 15 | type UnixFDListClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xGReserved1 uintptr | |
| 21 | + | ||
| 22 | + | xGReserved2 uintptr | |
| 23 | + | ||
| 24 | + | xGReserved3 uintptr | |
| 25 | + | ||
| 26 | + | xGReserved4 uintptr | |
| 27 | + | ||
| 28 | + | xGReserved5 uintptr | |
| 19 | 29 | } | |
| 20 | 30 | ||
| 21 | 31 | func (x *UnixFDListClass) GoPointer() uintptr { | |
| 22 | 32 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 33 | } | |
| 24 | 34 | ||
| 35 | + | // OverrideGReserved1 sets the callback function. | |
| 36 | + | func (x *UnixFDListClass) OverrideGReserved1(cb func()) { | |
| 37 | + | if cb == nil { | |
| 38 | + | x.xGReserved1 = 0 | |
| 39 | + | } else { | |
| 40 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 41 | + | cb() | |
| 42 | + | }) | |
| 43 | + | } | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | // GetGReserved1 gets the callback function. | |
| 47 | + | func (x *UnixFDListClass) GetGReserved1() func() { | |
| 48 | + | if x.xGReserved1 == 0 { | |
| 49 | + | return nil | |
| 50 | + | } | |
| 51 | + | var rawCallback func() | |
| 52 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 53 | + | return func() { | |
| 54 | + | rawCallback() | |
| 55 | + | } | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | // OverrideGReserved2 sets the callback function. | |
| 59 | + | func (x *UnixFDListClass) OverrideGReserved2(cb func()) { | |
| 60 | + | if cb == nil { | |
| 61 | + | x.xGReserved2 = 0 | |
| 62 | + | } else { | |
| 63 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 64 | + | cb() | |
| 65 | + | }) | |
| 66 | + | } | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | // GetGReserved2 gets the callback function. | |
| 70 | + | func (x *UnixFDListClass) GetGReserved2() func() { | |
| 71 | + | if x.xGReserved2 == 0 { | |
| 72 | + | return nil | |
| 73 | + | } | |
| 74 | + | var rawCallback func() | |
| 75 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 76 | + | return func() { | |
| 77 | + | rawCallback() | |
| 78 | + | } | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | // OverrideGReserved3 sets the callback function. | |
| 82 | + | func (x *UnixFDListClass) OverrideGReserved3(cb func()) { | |
| 83 | + | if cb == nil { | |
| 84 | + | x.xGReserved3 = 0 | |
| 85 | + | } else { | |
| 86 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 87 | + | cb() | |
| 88 | + | }) | |
| 89 | + | } | |
| 90 | + | } | |
| 91 | + | ||
| 92 | + | // GetGReserved3 gets the callback function. | |
| 93 | + | func (x *UnixFDListClass) GetGReserved3() func() { | |
| 94 | + | if x.xGReserved3 == 0 { | |
| 95 | + | return nil | |
| 96 | + | } | |
| 97 | + | var rawCallback func() | |
| 98 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 99 | + | return func() { | |
| 100 | + | rawCallback() | |
| 101 | + | } | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | // OverrideGReserved4 sets the callback function. | |
| 105 | + | func (x *UnixFDListClass) OverrideGReserved4(cb func()) { | |
| 106 | + | if cb == nil { | |
| 107 | + | x.xGReserved4 = 0 | |
| 108 | + | } else { | |
| 109 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 110 | + | cb() | |
| 111 | + | }) | |
| 112 | + | } | |
| 113 | + | } | |
| 114 | + | ||
| 115 | + | // GetGReserved4 gets the callback function. | |
| 116 | + | func (x *UnixFDListClass) GetGReserved4() func() { | |
| 117 | + | if x.xGReserved4 == 0 { | |
| 118 | + | return nil | |
| 119 | + | } | |
| 120 | + | var rawCallback func() | |
| 121 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 122 | + | return func() { | |
| 123 | + | rawCallback() | |
| 124 | + | } | |
| 125 | + | } | |
| 126 | + | ||
| 127 | + | // OverrideGReserved5 sets the callback function. | |
| 128 | + | func (x *UnixFDListClass) OverrideGReserved5(cb func()) { | |
| 129 | + | if cb == nil { | |
| 130 | + | x.xGReserved5 = 0 | |
| 131 | + | } else { | |
| 132 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 133 | + | cb() | |
| 134 | + | }) | |
| 135 | + | } | |
| 136 | + | } | |
| 137 | + | ||
| 138 | + | // GetGReserved5 gets the callback function. | |
| 139 | + | func (x *UnixFDListClass) GetGReserved5() func() { | |
| 140 | + | if x.xGReserved5 == 0 { | |
| 141 | + | return nil | |
| 142 | + | } | |
| 143 | + | var rawCallback func() | |
| 144 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 145 | + | return func() { | |
| 146 | + | rawCallback() | |
| 147 | + | } | |
| 148 | + | } | |
| 149 | + | ||
| 25 | 150 | type UnixFDListPrivate struct { | |
| 26 | 151 | _ structs.HostLayout | |
| 27 | 152 | } | |
M v4/gio/gunixfdmessage.go +51 -1
| @@ -15,13 +15,63 @@ import ( | |||
| 15 | 15 | type UnixFDMessageClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass SocketControlMessageClass | |
| 19 | + | ||
| 20 | + | xGReserved1 uintptr | |
| 21 | + | ||
| 22 | + | xGReserved2 uintptr | |
| 19 | 23 | } | |
| 20 | 24 | ||
| 21 | 25 | func (x *UnixFDMessageClass) GoPointer() uintptr { | |
| 22 | 26 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 27 | } | |
| 24 | 28 | ||
| 29 | + | // OverrideGReserved1 sets the callback function. | |
| 30 | + | func (x *UnixFDMessageClass) OverrideGReserved1(cb func()) { | |
| 31 | + | if cb == nil { | |
| 32 | + | x.xGReserved1 = 0 | |
| 33 | + | } else { | |
| 34 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 35 | + | cb() | |
| 36 | + | }) | |
| 37 | + | } | |
| 38 | + | } | |
| 39 | + | ||
| 40 | + | // GetGReserved1 gets the callback function. | |
| 41 | + | func (x *UnixFDMessageClass) GetGReserved1() func() { | |
| 42 | + | if x.xGReserved1 == 0 { | |
| 43 | + | return nil | |
| 44 | + | } | |
| 45 | + | var rawCallback func() | |
| 46 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 47 | + | return func() { | |
| 48 | + | rawCallback() | |
| 49 | + | } | |
| 50 | + | } | |
| 51 | + | ||
| 52 | + | // OverrideGReserved2 sets the callback function. | |
| 53 | + | func (x *UnixFDMessageClass) OverrideGReserved2(cb func()) { | |
| 54 | + | if cb == nil { | |
| 55 | + | x.xGReserved2 = 0 | |
| 56 | + | } else { | |
| 57 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 58 | + | cb() | |
| 59 | + | }) | |
| 60 | + | } | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // GetGReserved2 gets the callback function. | |
| 64 | + | func (x *UnixFDMessageClass) GetGReserved2() func() { | |
| 65 | + | if x.xGReserved2 == 0 { | |
| 66 | + | return nil | |
| 67 | + | } | |
| 68 | + | var rawCallback func() | |
| 69 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 70 | + | return func() { | |
| 71 | + | rawCallback() | |
| 72 | + | } | |
| 73 | + | } | |
| 74 | + | ||
| 25 | 75 | type UnixFDMessagePrivate struct { | |
| 26 | 76 | _ structs.HostLayout | |
| 27 | 77 | } | |
M v4/gio/gunixinputstream.go +126 -1
| @@ -14,13 +14,138 @@ import ( | |||
| 14 | 14 | type UnixInputStreamClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass InputStreamClass | |
| 18 | + | ||
| 19 | + | xGReserved1 uintptr | |
| 20 | + | ||
| 21 | + | xGReserved2 uintptr | |
| 22 | + | ||
| 23 | + | xGReserved3 uintptr | |
| 24 | + | ||
| 25 | + | xGReserved4 uintptr | |
| 26 | + | ||
| 27 | + | xGReserved5 uintptr | |
| 18 | 28 | } | |
| 19 | 29 | ||
| 20 | 30 | func (x *UnixInputStreamClass) GoPointer() uintptr { | |
| 21 | 31 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 32 | } | |
| 23 | 33 | ||
| 34 | + | // OverrideGReserved1 sets the callback function. | |
| 35 | + | func (x *UnixInputStreamClass) OverrideGReserved1(cb func()) { | |
| 36 | + | if cb == nil { | |
| 37 | + | x.xGReserved1 = 0 | |
| 38 | + | } else { | |
| 39 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 40 | + | cb() | |
| 41 | + | }) | |
| 42 | + | } | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | // GetGReserved1 gets the callback function. | |
| 46 | + | func (x *UnixInputStreamClass) GetGReserved1() func() { | |
| 47 | + | if x.xGReserved1 == 0 { | |
| 48 | + | return nil | |
| 49 | + | } | |
| 50 | + | var rawCallback func() | |
| 51 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 52 | + | return func() { | |
| 53 | + | rawCallback() | |
| 54 | + | } | |
| 55 | + | } | |
| 56 | + | ||
| 57 | + | // OverrideGReserved2 sets the callback function. | |
| 58 | + | func (x *UnixInputStreamClass) OverrideGReserved2(cb func()) { | |
| 59 | + | if cb == nil { | |
| 60 | + | x.xGReserved2 = 0 | |
| 61 | + | } else { | |
| 62 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 63 | + | cb() | |
| 64 | + | }) | |
| 65 | + | } | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | // GetGReserved2 gets the callback function. | |
| 69 | + | func (x *UnixInputStreamClass) GetGReserved2() func() { | |
| 70 | + | if x.xGReserved2 == 0 { | |
| 71 | + | return nil | |
| 72 | + | } | |
| 73 | + | var rawCallback func() | |
| 74 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 75 | + | return func() { | |
| 76 | + | rawCallback() | |
| 77 | + | } | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | // OverrideGReserved3 sets the callback function. | |
| 81 | + | func (x *UnixInputStreamClass) OverrideGReserved3(cb func()) { | |
| 82 | + | if cb == nil { | |
| 83 | + | x.xGReserved3 = 0 | |
| 84 | + | } else { | |
| 85 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 86 | + | cb() | |
| 87 | + | }) | |
| 88 | + | } | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | // GetGReserved3 gets the callback function. | |
| 92 | + | func (x *UnixInputStreamClass) GetGReserved3() func() { | |
| 93 | + | if x.xGReserved3 == 0 { | |
| 94 | + | return nil | |
| 95 | + | } | |
| 96 | + | var rawCallback func() | |
| 97 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 98 | + | return func() { | |
| 99 | + | rawCallback() | |
| 100 | + | } | |
| 101 | + | } | |
| 102 | + | ||
| 103 | + | // OverrideGReserved4 sets the callback function. | |
| 104 | + | func (x *UnixInputStreamClass) OverrideGReserved4(cb func()) { | |
| 105 | + | if cb == nil { | |
| 106 | + | x.xGReserved4 = 0 | |
| 107 | + | } else { | |
| 108 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 109 | + | cb() | |
| 110 | + | }) | |
| 111 | + | } | |
| 112 | + | } | |
| 113 | + | ||
| 114 | + | // GetGReserved4 gets the callback function. | |
| 115 | + | func (x *UnixInputStreamClass) GetGReserved4() func() { | |
| 116 | + | if x.xGReserved4 == 0 { | |
| 117 | + | return nil | |
| 118 | + | } | |
| 119 | + | var rawCallback func() | |
| 120 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 121 | + | return func() { | |
| 122 | + | rawCallback() | |
| 123 | + | } | |
| 124 | + | } | |
| 125 | + | ||
| 126 | + | // OverrideGReserved5 sets the callback function. | |
| 127 | + | func (x *UnixInputStreamClass) OverrideGReserved5(cb func()) { | |
| 128 | + | if cb == nil { | |
| 129 | + | x.xGReserved5 = 0 | |
| 130 | + | } else { | |
| 131 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 132 | + | cb() | |
| 133 | + | }) | |
| 134 | + | } | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | // GetGReserved5 gets the callback function. | |
| 138 | + | func (x *UnixInputStreamClass) GetGReserved5() func() { | |
| 139 | + | if x.xGReserved5 == 0 { | |
| 140 | + | return nil | |
| 141 | + | } | |
| 142 | + | var rawCallback func() | |
| 143 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 144 | + | return func() { | |
| 145 | + | rawCallback() | |
| 146 | + | } | |
| 147 | + | } | |
| 148 | + | ||
| 24 | 149 | type UnixInputStreamPrivate struct { | |
| 25 | 150 | _ structs.HostLayout | |
| 26 | 151 | } | |
M v4/gio/gunixoutputstream.go +126 -1
| @@ -14,13 +14,138 @@ import ( | |||
| 14 | 14 | type UnixOutputStreamClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass OutputStreamClass | |
| 18 | + | ||
| 19 | + | xGReserved1 uintptr | |
| 20 | + | ||
| 21 | + | xGReserved2 uintptr | |
| 22 | + | ||
| 23 | + | xGReserved3 uintptr | |
| 24 | + | ||
| 25 | + | xGReserved4 uintptr | |
| 26 | + | ||
| 27 | + | xGReserved5 uintptr | |
| 18 | 28 | } | |
| 19 | 29 | ||
| 20 | 30 | func (x *UnixOutputStreamClass) GoPointer() uintptr { | |
| 21 | 31 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 32 | } | |
| 23 | 33 | ||
| 34 | + | // OverrideGReserved1 sets the callback function. | |
| 35 | + | func (x *UnixOutputStreamClass) OverrideGReserved1(cb func()) { | |
| 36 | + | if cb == nil { | |
| 37 | + | x.xGReserved1 = 0 | |
| 38 | + | } else { | |
| 39 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 40 | + | cb() | |
| 41 | + | }) | |
| 42 | + | } | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | // GetGReserved1 gets the callback function. | |
| 46 | + | func (x *UnixOutputStreamClass) GetGReserved1() func() { | |
| 47 | + | if x.xGReserved1 == 0 { | |
| 48 | + | return nil | |
| 49 | + | } | |
| 50 | + | var rawCallback func() | |
| 51 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 52 | + | return func() { | |
| 53 | + | rawCallback() | |
| 54 | + | } | |
| 55 | + | } | |
| 56 | + | ||
| 57 | + | // OverrideGReserved2 sets the callback function. | |
| 58 | + | func (x *UnixOutputStreamClass) OverrideGReserved2(cb func()) { | |
| 59 | + | if cb == nil { | |
| 60 | + | x.xGReserved2 = 0 | |
| 61 | + | } else { | |
| 62 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 63 | + | cb() | |
| 64 | + | }) | |
| 65 | + | } | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | // GetGReserved2 gets the callback function. | |
| 69 | + | func (x *UnixOutputStreamClass) GetGReserved2() func() { | |
| 70 | + | if x.xGReserved2 == 0 { | |
| 71 | + | return nil | |
| 72 | + | } | |
| 73 | + | var rawCallback func() | |
| 74 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 75 | + | return func() { | |
| 76 | + | rawCallback() | |
| 77 | + | } | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | // OverrideGReserved3 sets the callback function. | |
| 81 | + | func (x *UnixOutputStreamClass) OverrideGReserved3(cb func()) { | |
| 82 | + | if cb == nil { | |
| 83 | + | x.xGReserved3 = 0 | |
| 84 | + | } else { | |
| 85 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 86 | + | cb() | |
| 87 | + | }) | |
| 88 | + | } | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | // GetGReserved3 gets the callback function. | |
| 92 | + | func (x *UnixOutputStreamClass) GetGReserved3() func() { | |
| 93 | + | if x.xGReserved3 == 0 { | |
| 94 | + | return nil | |
| 95 | + | } | |
| 96 | + | var rawCallback func() | |
| 97 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 98 | + | return func() { | |
| 99 | + | rawCallback() | |
| 100 | + | } | |
| 101 | + | } | |
| 102 | + | ||
| 103 | + | // OverrideGReserved4 sets the callback function. | |
| 104 | + | func (x *UnixOutputStreamClass) OverrideGReserved4(cb func()) { | |
| 105 | + | if cb == nil { | |
| 106 | + | x.xGReserved4 = 0 | |
| 107 | + | } else { | |
| 108 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 109 | + | cb() | |
| 110 | + | }) | |
| 111 | + | } | |
| 112 | + | } | |
| 113 | + | ||
| 114 | + | // GetGReserved4 gets the callback function. | |
| 115 | + | func (x *UnixOutputStreamClass) GetGReserved4() func() { | |
| 116 | + | if x.xGReserved4 == 0 { | |
| 117 | + | return nil | |
| 118 | + | } | |
| 119 | + | var rawCallback func() | |
| 120 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 121 | + | return func() { | |
| 122 | + | rawCallback() | |
| 123 | + | } | |
| 124 | + | } | |
| 125 | + | ||
| 126 | + | // OverrideGReserved5 sets the callback function. | |
| 127 | + | func (x *UnixOutputStreamClass) OverrideGReserved5(cb func()) { | |
| 128 | + | if cb == nil { | |
| 129 | + | x.xGReserved5 = 0 | |
| 130 | + | } else { | |
| 131 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 132 | + | cb() | |
| 133 | + | }) | |
| 134 | + | } | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | // GetGReserved5 gets the callback function. | |
| 138 | + | func (x *UnixOutputStreamClass) GetGReserved5() func() { | |
| 139 | + | if x.xGReserved5 == 0 { | |
| 140 | + | return nil | |
| 141 | + | } | |
| 142 | + | var rawCallback func() | |
| 143 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 144 | + | return func() { | |
| 145 | + | rawCallback() | |
| 146 | + | } | |
| 147 | + | } | |
| 148 | + | ||
| 24 | 149 | type UnixOutputStreamPrivate struct { | |
| 25 | 150 | _ structs.HostLayout | |
| 26 | 151 | } | |
M v4/gio/gunixsocketaddress.go +1 -1
| @@ -13,7 +13,7 @@ import ( | |||
| 13 | 13 | type UnixSocketAddressClass struct { | |
| 14 | 14 | _ structs.HostLayout | |
| 15 | 15 | ||
| 16 | - | ParentClass uintptr | |
| 16 | + | ParentClass SocketAddressClass | |
| 17 | 17 | } | |
| 18 | 18 | ||
| 19 | 19 | func (x *UnixSocketAddressClass) GoPointer() uintptr { | |
M v4/gio/gvfs.go +466 -1
| @@ -23,13 +23,478 @@ type VfsFileLookupFunc func(uintptr, string, uintptr) uintptr | |||
| 23 | 23 | type VfsClass struct { | |
| 24 | 24 | _ structs.HostLayout | |
| 25 | 25 | ||
| 26 | - | ParentClass uintptr | |
| 26 | + | ParentClass gobject.ObjectClass | |
| 27 | + | ||
| 28 | + | xIsActive uintptr | |
| 29 | + | ||
| 30 | + | xGetFileForPath uintptr | |
| 31 | + | ||
| 32 | + | xGetFileForUri uintptr | |
| 33 | + | ||
| 34 | + | xGetSupportedUriSchemes uintptr | |
| 35 | + | ||
| 36 | + | xParseName uintptr | |
| 37 | + | ||
| 38 | + | xLocalFileAddInfo uintptr | |
| 39 | + | ||
| 40 | + | xAddWritableNamespaces uintptr | |
| 41 | + | ||
| 42 | + | xLocalFileSetAttributes uintptr | |
| 43 | + | ||
| 44 | + | xLocalFileRemoved uintptr | |
| 45 | + | ||
| 46 | + | xLocalFileMoved uintptr | |
| 47 | + | ||
| 48 | + | xDeserializeIcon uintptr | |
| 49 | + | ||
| 50 | + | xGReserved1 uintptr | |
| 51 | + | ||
| 52 | + | xGReserved2 uintptr | |
| 53 | + | ||
| 54 | + | xGReserved3 uintptr | |
| 55 | + | ||
| 56 | + | xGReserved4 uintptr | |
| 57 | + | ||
| 58 | + | xGReserved5 uintptr | |
| 59 | + | ||
| 60 | + | xGReserved6 uintptr | |
| 27 | 61 | } | |
| 28 | 62 | ||
| 29 | 63 | func (x *VfsClass) GoPointer() uintptr { | |
| 30 | 64 | return uintptr(unsafe.Pointer(x)) | |
| 31 | 65 | } | |
| 32 | 66 | ||
| 67 | + | // OverrideIsActive sets the callback function. | |
| 68 | + | func (x *VfsClass) OverrideIsActive(cb func(*Vfs) bool) { | |
| 69 | + | if cb == nil { | |
| 70 | + | x.xIsActive = 0 | |
| 71 | + | } else { | |
| 72 | + | x.xIsActive = purego.NewCallback(func(VfsVarp uintptr) bool { | |
| 73 | + | return cb(VfsNewFromInternalPtr(VfsVarp)) | |
| 74 | + | }) | |
| 75 | + | } | |
| 76 | + | } | |
| 77 | + | ||
| 78 | + | // GetIsActive gets the callback function. | |
| 79 | + | func (x *VfsClass) GetIsActive() func(*Vfs) bool { | |
| 80 | + | if x.xIsActive == 0 { | |
| 81 | + | return nil | |
| 82 | + | } | |
| 83 | + | var rawCallback func(VfsVarp uintptr) bool | |
| 84 | + | purego.RegisterFunc(&rawCallback, x.xIsActive) | |
| 85 | + | return func(VfsVar *Vfs) bool { | |
| 86 | + | return rawCallback(VfsVar.GoPointer()) | |
| 87 | + | } | |
| 88 | + | } | |
| 89 | + | ||
| 90 | + | // OverrideGetFileForPath sets the callback function. | |
| 91 | + | func (x *VfsClass) OverrideGetFileForPath(cb func(*Vfs, string) *FileBase) { | |
| 92 | + | if cb == nil { | |
| 93 | + | x.xGetFileForPath = 0 | |
| 94 | + | } else { | |
| 95 | + | x.xGetFileForPath = purego.NewCallback(func(VfsVarp uintptr, PathVarp string) uintptr { | |
| 96 | + | ret := cb(VfsNewFromInternalPtr(VfsVarp), PathVarp) | |
| 97 | + | if ret == nil { | |
| 98 | + | return 0 | |
| 99 | + | } | |
| 100 | + | return ret.GoPointer() | |
| 101 | + | }) | |
| 102 | + | } | |
| 103 | + | } | |
| 104 | + | ||
| 105 | + | // GetGetFileForPath gets the callback function. | |
| 106 | + | func (x *VfsClass) GetGetFileForPath() func(*Vfs, string) *FileBase { | |
| 107 | + | if x.xGetFileForPath == 0 { | |
| 108 | + | return nil | |
| 109 | + | } | |
| 110 | + | var rawCallback func(VfsVarp uintptr, PathVarp string) uintptr | |
| 111 | + | purego.RegisterFunc(&rawCallback, x.xGetFileForPath) | |
| 112 | + | return func(VfsVar *Vfs, PathVar string) *FileBase { | |
| 113 | + | rawRet := rawCallback(VfsVar.GoPointer(), PathVar) | |
| 114 | + | if rawRet == 0 { | |
| 115 | + | return nil | |
| 116 | + | } | |
| 117 | + | ret := &FileBase{} | |
| 118 | + | ret.Ptr = rawRet | |
| 119 | + | return ret | |
| 120 | + | } | |
| 121 | + | } | |
| 122 | + | ||
| 123 | + | // OverrideGetFileForUri sets the callback function. | |
| 124 | + | func (x *VfsClass) OverrideGetFileForUri(cb func(*Vfs, string) *FileBase) { | |
| 125 | + | if cb == nil { | |
| 126 | + | x.xGetFileForUri = 0 | |
| 127 | + | } else { | |
| 128 | + | x.xGetFileForUri = purego.NewCallback(func(VfsVarp uintptr, UriVarp string) uintptr { | |
| 129 | + | ret := cb(VfsNewFromInternalPtr(VfsVarp), UriVarp) | |
| 130 | + | if ret == nil { | |
| 131 | + | return 0 | |
| 132 | + | } | |
| 133 | + | return ret.GoPointer() | |
| 134 | + | }) | |
| 135 | + | } | |
| 136 | + | } | |
| 137 | + | ||
| 138 | + | // GetGetFileForUri gets the callback function. | |
| 139 | + | func (x *VfsClass) GetGetFileForUri() func(*Vfs, string) *FileBase { | |
| 140 | + | if x.xGetFileForUri == 0 { | |
| 141 | + | return nil | |
| 142 | + | } | |
| 143 | + | var rawCallback func(VfsVarp uintptr, UriVarp string) uintptr | |
| 144 | + | purego.RegisterFunc(&rawCallback, x.xGetFileForUri) | |
| 145 | + | return func(VfsVar *Vfs, UriVar string) *FileBase { | |
| 146 | + | rawRet := rawCallback(VfsVar.GoPointer(), UriVar) | |
| 147 | + | if rawRet == 0 { | |
| 148 | + | return nil | |
| 149 | + | } | |
| 150 | + | ret := &FileBase{} | |
| 151 | + | ret.Ptr = rawRet | |
| 152 | + | return ret | |
| 153 | + | } | |
| 154 | + | } | |
| 155 | + | ||
| 156 | + | // OverrideGetSupportedUriSchemes sets the callback function. | |
| 157 | + | func (x *VfsClass) OverrideGetSupportedUriSchemes(cb func(*Vfs) []string) { | |
| 158 | + | if cb == nil { | |
| 159 | + | x.xGetSupportedUriSchemes = 0 | |
| 160 | + | } else { | |
| 161 | + | x.xGetSupportedUriSchemes = purego.NewCallback(func(VfsVarp uintptr) []string { | |
| 162 | + | return cb(VfsNewFromInternalPtr(VfsVarp)) | |
| 163 | + | }) | |
| 164 | + | } | |
| 165 | + | } | |
| 166 | + | ||
| 167 | + | // GetGetSupportedUriSchemes gets the callback function. | |
| 168 | + | func (x *VfsClass) GetGetSupportedUriSchemes() func(*Vfs) []string { | |
| 169 | + | if x.xGetSupportedUriSchemes == 0 { | |
| 170 | + | return nil | |
| 171 | + | } | |
| 172 | + | var rawCallback func(VfsVarp uintptr) []string | |
| 173 | + | purego.RegisterFunc(&rawCallback, x.xGetSupportedUriSchemes) | |
| 174 | + | return func(VfsVar *Vfs) []string { | |
| 175 | + | return rawCallback(VfsVar.GoPointer()) | |
| 176 | + | } | |
| 177 | + | } | |
| 178 | + | ||
| 179 | + | // OverrideParseName sets the callback function. | |
| 180 | + | func (x *VfsClass) OverrideParseName(cb func(*Vfs, string) *FileBase) { | |
| 181 | + | if cb == nil { | |
| 182 | + | x.xParseName = 0 | |
| 183 | + | } else { | |
| 184 | + | x.xParseName = purego.NewCallback(func(VfsVarp uintptr, ParseNameVarp string) uintptr { | |
| 185 | + | ret := cb(VfsNewFromInternalPtr(VfsVarp), ParseNameVarp) | |
| 186 | + | if ret == nil { | |
| 187 | + | return 0 | |
| 188 | + | } | |
| 189 | + | return ret.GoPointer() | |
| 190 | + | }) | |
| 191 | + | } | |
| 192 | + | } | |
| 193 | + | ||
| 194 | + | // GetParseName gets the callback function. | |
| 195 | + | func (x *VfsClass) GetParseName() func(*Vfs, string) *FileBase { | |
| 196 | + | if x.xParseName == 0 { | |
| 197 | + | return nil | |
| 198 | + | } | |
| 199 | + | var rawCallback func(VfsVarp uintptr, ParseNameVarp string) uintptr | |
| 200 | + | purego.RegisterFunc(&rawCallback, x.xParseName) | |
| 201 | + | return func(VfsVar *Vfs, ParseNameVar string) *FileBase { | |
| 202 | + | rawRet := rawCallback(VfsVar.GoPointer(), ParseNameVar) | |
| 203 | + | if rawRet == 0 { | |
| 204 | + | return nil | |
| 205 | + | } | |
| 206 | + | ret := &FileBase{} | |
| 207 | + | ret.Ptr = rawRet | |
| 208 | + | return ret | |
| 209 | + | } | |
| 210 | + | } | |
| 211 | + | ||
| 212 | + | // OverrideLocalFileAddInfo sets the callback function. | |
| 213 | + | func (x *VfsClass) OverrideLocalFileAddInfo(cb func(*Vfs, string, uint64, *FileAttributeMatcher, *FileInfo, *Cancellable, uintptr, *glib.DestroyNotify)) { | |
| 214 | + | if cb == nil { | |
| 215 | + | x.xLocalFileAddInfo = 0 | |
| 216 | + | } else { | |
| 217 | + | x.xLocalFileAddInfo = purego.NewCallback(func(VfsVarp uintptr, FilenameVarp string, DeviceVarp uint64, AttributeMatcherVarp *FileAttributeMatcher, InfoVarp uintptr, CancellableVarp uintptr, ExtraDataVarp uintptr, FreeExtraDataVarp uintptr) { | |
| 218 | + | cb(VfsNewFromInternalPtr(VfsVarp), FilenameVarp, DeviceVarp, AttributeMatcherVarp, FileInfoNewFromInternalPtr(InfoVarp), CancellableNewFromInternalPtr(CancellableVarp), ExtraDataVarp, (*glib.DestroyNotify)(unsafe.Pointer(FreeExtraDataVarp))) | |
| 219 | + | }) | |
| 220 | + | } | |
| 221 | + | } | |
| 222 | + | ||
| 223 | + | // GetLocalFileAddInfo gets the callback function. | |
| 224 | + | func (x *VfsClass) GetLocalFileAddInfo() func(*Vfs, string, uint64, *FileAttributeMatcher, *FileInfo, *Cancellable, uintptr, *glib.DestroyNotify) { | |
| 225 | + | if x.xLocalFileAddInfo == 0 { | |
| 226 | + | return nil | |
| 227 | + | } | |
| 228 | + | var rawCallback func(VfsVarp uintptr, FilenameVarp string, DeviceVarp uint64, AttributeMatcherVarp *FileAttributeMatcher, InfoVarp uintptr, CancellableVarp uintptr, ExtraDataVarp uintptr, FreeExtraDataVarp uintptr) | |
| 229 | + | purego.RegisterFunc(&rawCallback, x.xLocalFileAddInfo) | |
| 230 | + | return func(VfsVar *Vfs, FilenameVar string, DeviceVar uint64, AttributeMatcherVar *FileAttributeMatcher, InfoVar *FileInfo, CancellableVar *Cancellable, ExtraDataVar uintptr, FreeExtraDataVar *glib.DestroyNotify) { | |
| 231 | + | rawCallback(VfsVar.GoPointer(), FilenameVar, DeviceVar, AttributeMatcherVar, InfoVar.GoPointer(), CancellableVar.GoPointer(), ExtraDataVar, glib.NewCallback(FreeExtraDataVar)) | |
| 232 | + | } | |
| 233 | + | } | |
| 234 | + | ||
| 235 | + | // OverrideAddWritableNamespaces sets the callback function. | |
| 236 | + | func (x *VfsClass) OverrideAddWritableNamespaces(cb func(*Vfs, *FileAttributeInfoList)) { | |
| 237 | + | if cb == nil { | |
| 238 | + | x.xAddWritableNamespaces = 0 | |
| 239 | + | } else { | |
| 240 | + | x.xAddWritableNamespaces = purego.NewCallback(func(VfsVarp uintptr, ListVarp *FileAttributeInfoList) { | |
| 241 | + | cb(VfsNewFromInternalPtr(VfsVarp), ListVarp) | |
| 242 | + | }) | |
| 243 | + | } | |
| 244 | + | } | |
| 245 | + | ||
| 246 | + | // GetAddWritableNamespaces gets the callback function. | |
| 247 | + | func (x *VfsClass) GetAddWritableNamespaces() func(*Vfs, *FileAttributeInfoList) { | |
| 248 | + | if x.xAddWritableNamespaces == 0 { | |
| 249 | + | return nil | |
| 250 | + | } | |
| 251 | + | var rawCallback func(VfsVarp uintptr, ListVarp *FileAttributeInfoList) | |
| 252 | + | purego.RegisterFunc(&rawCallback, x.xAddWritableNamespaces) | |
| 253 | + | return func(VfsVar *Vfs, ListVar *FileAttributeInfoList) { | |
| 254 | + | rawCallback(VfsVar.GoPointer(), ListVar) | |
| 255 | + | } | |
| 256 | + | } | |
| 257 | + | ||
| 258 | + | // OverrideLocalFileSetAttributes sets the callback function. | |
| 259 | + | func (x *VfsClass) OverrideLocalFileSetAttributes(cb func(*Vfs, string, *FileInfo, FileQueryInfoFlags, *Cancellable) bool) { | |
| 260 | + | if cb == nil { | |
| 261 | + | x.xLocalFileSetAttributes = 0 | |
| 262 | + | } else { | |
| 263 | + | x.xLocalFileSetAttributes = purego.NewCallback(func(VfsVarp uintptr, FilenameVarp string, InfoVarp uintptr, FlagsVarp FileQueryInfoFlags, CancellableVarp uintptr) bool { | |
| 264 | + | return cb(VfsNewFromInternalPtr(VfsVarp), FilenameVarp, FileInfoNewFromInternalPtr(InfoVarp), FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp)) | |
| 265 | + | }) | |
| 266 | + | } | |
| 267 | + | } | |
| 268 | + | ||
| 269 | + | // GetLocalFileSetAttributes gets the callback function. | |
| 270 | + | func (x *VfsClass) GetLocalFileSetAttributes() func(*Vfs, string, *FileInfo, FileQueryInfoFlags, *Cancellable) bool { | |
| 271 | + | if x.xLocalFileSetAttributes == 0 { | |
| 272 | + | return nil | |
| 273 | + | } | |
| 274 | + | var rawCallback func(VfsVarp uintptr, FilenameVarp string, InfoVarp uintptr, FlagsVarp FileQueryInfoFlags, CancellableVarp uintptr) bool | |
| 275 | + | purego.RegisterFunc(&rawCallback, x.xLocalFileSetAttributes) | |
| 276 | + | return func(VfsVar *Vfs, FilenameVar string, InfoVar *FileInfo, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool { | |
| 277 | + | return rawCallback(VfsVar.GoPointer(), FilenameVar, InfoVar.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 278 | + | } | |
| 279 | + | } | |
| 280 | + | ||
| 281 | + | // OverrideLocalFileRemoved sets the callback function. | |
| 282 | + | func (x *VfsClass) OverrideLocalFileRemoved(cb func(*Vfs, string)) { | |
| 283 | + | if cb == nil { | |
| 284 | + | x.xLocalFileRemoved = 0 | |
| 285 | + | } else { | |
| 286 | + | x.xLocalFileRemoved = purego.NewCallback(func(VfsVarp uintptr, FilenameVarp string) { | |
| 287 | + | cb(VfsNewFromInternalPtr(VfsVarp), FilenameVarp) | |
| 288 | + | }) | |
| 289 | + | } | |
| 290 | + | } | |
| 291 | + | ||
| 292 | + | // GetLocalFileRemoved gets the callback function. | |
| 293 | + | func (x *VfsClass) GetLocalFileRemoved() func(*Vfs, string) { | |
| 294 | + | if x.xLocalFileRemoved == 0 { | |
| 295 | + | return nil | |
| 296 | + | } | |
| 297 | + | var rawCallback func(VfsVarp uintptr, FilenameVarp string) | |
| 298 | + | purego.RegisterFunc(&rawCallback, x.xLocalFileRemoved) | |
| 299 | + | return func(VfsVar *Vfs, FilenameVar string) { | |
| 300 | + | rawCallback(VfsVar.GoPointer(), FilenameVar) | |
| 301 | + | } | |
| 302 | + | } | |
| 303 | + | ||
| 304 | + | // OverrideLocalFileMoved sets the callback function. | |
| 305 | + | func (x *VfsClass) OverrideLocalFileMoved(cb func(*Vfs, string, string)) { | |
| 306 | + | if cb == nil { | |
| 307 | + | x.xLocalFileMoved = 0 | |
| 308 | + | } else { | |
| 309 | + | x.xLocalFileMoved = purego.NewCallback(func(VfsVarp uintptr, SourceVarp string, DestVarp string) { | |
| 310 | + | cb(VfsNewFromInternalPtr(VfsVarp), SourceVarp, DestVarp) | |
| 311 | + | }) | |
| 312 | + | } | |
| 313 | + | } | |
| 314 | + | ||
| 315 | + | // GetLocalFileMoved gets the callback function. | |
| 316 | + | func (x *VfsClass) GetLocalFileMoved() func(*Vfs, string, string) { | |
| 317 | + | if x.xLocalFileMoved == 0 { | |
| 318 | + | return nil | |
| 319 | + | } | |
| 320 | + | var rawCallback func(VfsVarp uintptr, SourceVarp string, DestVarp string) | |
| 321 | + | purego.RegisterFunc(&rawCallback, x.xLocalFileMoved) | |
| 322 | + | return func(VfsVar *Vfs, SourceVar string, DestVar string) { | |
| 323 | + | rawCallback(VfsVar.GoPointer(), SourceVar, DestVar) | |
| 324 | + | } | |
| 325 | + | } | |
| 326 | + | ||
| 327 | + | // OverrideDeserializeIcon sets the callback function. | |
| 328 | + | func (x *VfsClass) OverrideDeserializeIcon(cb func(*Vfs, *glib.Variant) *IconBase) { | |
| 329 | + | if cb == nil { | |
| 330 | + | x.xDeserializeIcon = 0 | |
| 331 | + | } else { | |
| 332 | + | x.xDeserializeIcon = purego.NewCallback(func(VfsVarp uintptr, ValueVarp *glib.Variant) uintptr { | |
| 333 | + | ret := cb(VfsNewFromInternalPtr(VfsVarp), ValueVarp) | |
| 334 | + | if ret == nil { | |
| 335 | + | return 0 | |
| 336 | + | } | |
| 337 | + | return ret.GoPointer() | |
| 338 | + | }) | |
| 339 | + | } | |
| 340 | + | } | |
| 341 | + | ||
| 342 | + | // GetDeserializeIcon gets the callback function. | |
| 343 | + | func (x *VfsClass) GetDeserializeIcon() func(*Vfs, *glib.Variant) *IconBase { | |
| 344 | + | if x.xDeserializeIcon == 0 { | |
| 345 | + | return nil | |
| 346 | + | } | |
| 347 | + | var rawCallback func(VfsVarp uintptr, ValueVarp *glib.Variant) uintptr | |
| 348 | + | purego.RegisterFunc(&rawCallback, x.xDeserializeIcon) | |
| 349 | + | return func(VfsVar *Vfs, ValueVar *glib.Variant) *IconBase { | |
| 350 | + | rawRet := rawCallback(VfsVar.GoPointer(), ValueVar) | |
| 351 | + | if rawRet == 0 { | |
| 352 | + | return nil | |
| 353 | + | } | |
| 354 | + | ret := &IconBase{} | |
| 355 | + | ret.Ptr = rawRet | |
| 356 | + | return ret | |
| 357 | + | } | |
| 358 | + | } | |
| 359 | + | ||
| 360 | + | // OverrideGReserved1 sets the callback function. | |
| 361 | + | func (x *VfsClass) OverrideGReserved1(cb func()) { | |
| 362 | + | if cb == nil { | |
| 363 | + | x.xGReserved1 = 0 | |
| 364 | + | } else { | |
| 365 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 366 | + | cb() | |
| 367 | + | }) | |
| 368 | + | } | |
| 369 | + | } | |
| 370 | + | ||
| 371 | + | // GetGReserved1 gets the callback function. | |
| 372 | + | func (x *VfsClass) GetGReserved1() func() { | |
| 373 | + | if x.xGReserved1 == 0 { | |
| 374 | + | return nil | |
| 375 | + | } | |
| 376 | + | var rawCallback func() | |
| 377 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 378 | + | return func() { | |
| 379 | + | rawCallback() | |
| 380 | + | } | |
| 381 | + | } | |
| 382 | + | ||
| 383 | + | // OverrideGReserved2 sets the callback function. | |
| 384 | + | func (x *VfsClass) OverrideGReserved2(cb func()) { | |
| 385 | + | if cb == nil { | |
| 386 | + | x.xGReserved2 = 0 | |
| 387 | + | } else { | |
| 388 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 389 | + | cb() | |
| 390 | + | }) | |
| 391 | + | } | |
| 392 | + | } | |
| 393 | + | ||
| 394 | + | // GetGReserved2 gets the callback function. | |
| 395 | + | func (x *VfsClass) GetGReserved2() func() { | |
| 396 | + | if x.xGReserved2 == 0 { | |
| 397 | + | return nil | |
| 398 | + | } | |
| 399 | + | var rawCallback func() | |
| 400 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 401 | + | return func() { | |
| 402 | + | rawCallback() | |
| 403 | + | } | |
| 404 | + | } | |
| 405 | + | ||
| 406 | + | // OverrideGReserved3 sets the callback function. | |
| 407 | + | func (x *VfsClass) OverrideGReserved3(cb func()) { | |
| 408 | + | if cb == nil { | |
| 409 | + | x.xGReserved3 = 0 | |
| 410 | + | } else { | |
| 411 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 412 | + | cb() | |
| 413 | + | }) | |
| 414 | + | } | |
| 415 | + | } | |
| 416 | + | ||
| 417 | + | // GetGReserved3 gets the callback function. | |
| 418 | + | func (x *VfsClass) GetGReserved3() func() { | |
| 419 | + | if x.xGReserved3 == 0 { | |
| 420 | + | return nil | |
| 421 | + | } | |
| 422 | + | var rawCallback func() | |
| 423 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 424 | + | return func() { | |
| 425 | + | rawCallback() | |
| 426 | + | } | |
| 427 | + | } | |
| 428 | + | ||
| 429 | + | // OverrideGReserved4 sets the callback function. | |
| 430 | + | func (x *VfsClass) OverrideGReserved4(cb func()) { | |
| 431 | + | if cb == nil { | |
| 432 | + | x.xGReserved4 = 0 | |
| 433 | + | } else { | |
| 434 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 435 | + | cb() | |
| 436 | + | }) | |
| 437 | + | } | |
| 438 | + | } | |
| 439 | + | ||
| 440 | + | // GetGReserved4 gets the callback function. | |
| 441 | + | func (x *VfsClass) GetGReserved4() func() { | |
| 442 | + | if x.xGReserved4 == 0 { | |
| 443 | + | return nil | |
| 444 | + | } | |
| 445 | + | var rawCallback func() | |
| 446 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 447 | + | return func() { | |
| 448 | + | rawCallback() | |
| 449 | + | } | |
| 450 | + | } | |
| 451 | + | ||
| 452 | + | // OverrideGReserved5 sets the callback function. | |
| 453 | + | func (x *VfsClass) OverrideGReserved5(cb func()) { | |
| 454 | + | if cb == nil { | |
| 455 | + | x.xGReserved5 = 0 | |
| 456 | + | } else { | |
| 457 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 458 | + | cb() | |
| 459 | + | }) | |
| 460 | + | } | |
| 461 | + | } | |
| 462 | + | ||
| 463 | + | // GetGReserved5 gets the callback function. | |
| 464 | + | func (x *VfsClass) GetGReserved5() func() { | |
| 465 | + | if x.xGReserved5 == 0 { | |
| 466 | + | return nil | |
| 467 | + | } | |
| 468 | + | var rawCallback func() | |
| 469 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 470 | + | return func() { | |
| 471 | + | rawCallback() | |
| 472 | + | } | |
| 473 | + | } | |
| 474 | + | ||
| 475 | + | // OverrideGReserved6 sets the callback function. | |
| 476 | + | func (x *VfsClass) OverrideGReserved6(cb func()) { | |
| 477 | + | if cb == nil { | |
| 478 | + | x.xGReserved6 = 0 | |
| 479 | + | } else { | |
| 480 | + | x.xGReserved6 = purego.NewCallback(func() { | |
| 481 | + | cb() | |
| 482 | + | }) | |
| 483 | + | } | |
| 484 | + | } | |
| 485 | + | ||
| 486 | + | // GetGReserved6 gets the callback function. | |
| 487 | + | func (x *VfsClass) GetGReserved6() func() { | |
| 488 | + | if x.xGReserved6 == 0 { | |
| 489 | + | return nil | |
| 490 | + | } | |
| 491 | + | var rawCallback func() | |
| 492 | + | purego.RegisterFunc(&rawCallback, x.xGReserved6) | |
| 493 | + | return func() { | |
| 494 | + | rawCallback() | |
| 495 | + | } | |
| 496 | + | } | |
| 497 | + | ||
| 33 | 498 | const ( | |
| 34 | 499 | // Extension point for #GVfs functionality. | |
| 35 | 500 | // See [Extending GIO][extending-gio]. | |
M v4/gio/gvolume.go +578 -3
| @@ -16,12 +16,587 @@ type VolumeIface struct { | |||
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | 18 | GIface uintptr | |
| 19 | + | ||
| 20 | + | xChanged uintptr | |
| 21 | + | ||
| 22 | + | xRemoved uintptr | |
| 23 | + | ||
| 24 | + | xGetName uintptr | |
| 25 | + | ||
| 26 | + | xGetIcon uintptr | |
| 27 | + | ||
| 28 | + | xGetUuid uintptr | |
| 29 | + | ||
| 30 | + | xGetDrive uintptr | |
| 31 | + | ||
| 32 | + | xGetMount uintptr | |
| 33 | + | ||
| 34 | + | xCanMount uintptr | |
| 35 | + | ||
| 36 | + | xCanEject uintptr | |
| 37 | + | ||
| 38 | + | xMountFn uintptr | |
| 39 | + | ||
| 40 | + | xMountFinish uintptr | |
| 41 | + | ||
| 42 | + | xEject uintptr | |
| 43 | + | ||
| 44 | + | xEjectFinish uintptr | |
| 45 | + | ||
| 46 | + | xGetIdentifier uintptr | |
| 47 | + | ||
| 48 | + | xEnumerateIdentifiers uintptr | |
| 49 | + | ||
| 50 | + | xShouldAutomount uintptr | |
| 51 | + | ||
| 52 | + | xGetActivationRoot uintptr | |
| 53 | + | ||
| 54 | + | xEjectWithOperation uintptr | |
| 55 | + | ||
| 56 | + | xEjectWithOperationFinish uintptr | |
| 57 | + | ||
| 58 | + | xGetSortKey uintptr | |
| 59 | + | ||
| 60 | + | xGetSymbolicIcon uintptr | |
| 19 | 61 | } | |
| 20 | 62 | ||
| 21 | 63 | func (x *VolumeIface) GoPointer() uintptr { | |
| 22 | 64 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 65 | } | |
| 24 | 66 | ||
| 67 | + | // OverrideChanged sets the callback function. | |
| 68 | + | func (x *VolumeIface) OverrideChanged(cb func(Volume)) { | |
| 69 | + | if cb == nil { | |
| 70 | + | x.xChanged = 0 | |
| 71 | + | } else { | |
| 72 | + | x.xChanged = purego.NewCallback(func(VolumeVarp uintptr) { | |
| 73 | + | cb(&VolumeBase{Ptr: VolumeVarp}) | |
| 74 | + | }) | |
| 75 | + | } | |
| 76 | + | } | |
| 77 | + | ||
| 78 | + | // GetChanged gets the callback function. | |
| 79 | + | func (x *VolumeIface) GetChanged() func(Volume) { | |
| 80 | + | if x.xChanged == 0 { | |
| 81 | + | return nil | |
| 82 | + | } | |
| 83 | + | var rawCallback func(VolumeVarp uintptr) | |
| 84 | + | purego.RegisterFunc(&rawCallback, x.xChanged) | |
| 85 | + | return func(VolumeVar Volume) { | |
| 86 | + | rawCallback(VolumeVar.GoPointer()) | |
| 87 | + | } | |
| 88 | + | } | |
| 89 | + | ||
| 90 | + | // OverrideRemoved sets the callback function. | |
| 91 | + | func (x *VolumeIface) OverrideRemoved(cb func(Volume)) { | |
| 92 | + | if cb == nil { | |
| 93 | + | x.xRemoved = 0 | |
| 94 | + | } else { | |
| 95 | + | x.xRemoved = purego.NewCallback(func(VolumeVarp uintptr) { | |
| 96 | + | cb(&VolumeBase{Ptr: VolumeVarp}) | |
| 97 | + | }) | |
| 98 | + | } | |
| 99 | + | } | |
| 100 | + | ||
| 101 | + | // GetRemoved gets the callback function. | |
| 102 | + | func (x *VolumeIface) GetRemoved() func(Volume) { | |
| 103 | + | if x.xRemoved == 0 { | |
| 104 | + | return nil | |
| 105 | + | } | |
| 106 | + | var rawCallback func(VolumeVarp uintptr) | |
| 107 | + | purego.RegisterFunc(&rawCallback, x.xRemoved) | |
| 108 | + | return func(VolumeVar Volume) { | |
| 109 | + | rawCallback(VolumeVar.GoPointer()) | |
| 110 | + | } | |
| 111 | + | } | |
| 112 | + | ||
| 113 | + | // OverrideGetName sets the callback function. | |
| 114 | + | func (x *VolumeIface) OverrideGetName(cb func(Volume) string) { | |
| 115 | + | if cb == nil { | |
| 116 | + | x.xGetName = 0 | |
| 117 | + | } else { | |
| 118 | + | x.xGetName = purego.NewCallback(func(VolumeVarp uintptr) string { | |
| 119 | + | return cb(&VolumeBase{Ptr: VolumeVarp}) | |
| 120 | + | }) | |
| 121 | + | } | |
| 122 | + | } | |
| 123 | + | ||
| 124 | + | // GetGetName gets the callback function. | |
| 125 | + | func (x *VolumeIface) GetGetName() func(Volume) string { | |
| 126 | + | if x.xGetName == 0 { | |
| 127 | + | return nil | |
| 128 | + | } | |
| 129 | + | var rawCallback func(VolumeVarp uintptr) string | |
| 130 | + | purego.RegisterFunc(&rawCallback, x.xGetName) | |
| 131 | + | return func(VolumeVar Volume) string { | |
| 132 | + | return rawCallback(VolumeVar.GoPointer()) | |
| 133 | + | } | |
| 134 | + | } | |
| 135 | + | ||
| 136 | + | // OverrideGetIcon sets the callback function. | |
| 137 | + | func (x *VolumeIface) OverrideGetIcon(cb func(Volume) *IconBase) { | |
| 138 | + | if cb == nil { | |
| 139 | + | x.xGetIcon = 0 | |
| 140 | + | } else { | |
| 141 | + | x.xGetIcon = purego.NewCallback(func(VolumeVarp uintptr) uintptr { | |
| 142 | + | ret := cb(&VolumeBase{Ptr: VolumeVarp}) | |
| 143 | + | if ret == nil { | |
| 144 | + | return 0 | |
| 145 | + | } | |
| 146 | + | return ret.GoPointer() | |
| 147 | + | }) | |
| 148 | + | } | |
| 149 | + | } | |
| 150 | + | ||
| 151 | + | // GetGetIcon gets the callback function. | |
| 152 | + | func (x *VolumeIface) GetGetIcon() func(Volume) *IconBase { | |
| 153 | + | if x.xGetIcon == 0 { | |
| 154 | + | return nil | |
| 155 | + | } | |
| 156 | + | var rawCallback func(VolumeVarp uintptr) uintptr | |
| 157 | + | purego.RegisterFunc(&rawCallback, x.xGetIcon) | |
| 158 | + | return func(VolumeVar Volume) *IconBase { | |
| 159 | + | rawRet := rawCallback(VolumeVar.GoPointer()) | |
| 160 | + | if rawRet == 0 { | |
| 161 | + | return nil | |
| 162 | + | } | |
| 163 | + | ret := &IconBase{} | |
| 164 | + | ret.Ptr = rawRet | |
| 165 | + | return ret | |
| 166 | + | } | |
| 167 | + | } | |
| 168 | + | ||
| 169 | + | // OverrideGetUuid sets the callback function. | |
| 170 | + | func (x *VolumeIface) OverrideGetUuid(cb func(Volume) string) { | |
| 171 | + | if cb == nil { | |
| 172 | + | x.xGetUuid = 0 | |
| 173 | + | } else { | |
| 174 | + | x.xGetUuid = purego.NewCallback(func(VolumeVarp uintptr) string { | |
| 175 | + | return cb(&VolumeBase{Ptr: VolumeVarp}) | |
| 176 | + | }) | |
| 177 | + | } | |
| 178 | + | } | |
| 179 | + | ||
| 180 | + | // GetGetUuid gets the callback function. | |
| 181 | + | func (x *VolumeIface) GetGetUuid() func(Volume) string { | |
| 182 | + | if x.xGetUuid == 0 { | |
| 183 | + | return nil | |
| 184 | + | } | |
| 185 | + | var rawCallback func(VolumeVarp uintptr) string | |
| 186 | + | purego.RegisterFunc(&rawCallback, x.xGetUuid) | |
| 187 | + | return func(VolumeVar Volume) string { | |
| 188 | + | return rawCallback(VolumeVar.GoPointer()) | |
| 189 | + | } | |
| 190 | + | } | |
| 191 | + | ||
| 192 | + | // OverrideGetDrive sets the callback function. | |
| 193 | + | func (x *VolumeIface) OverrideGetDrive(cb func(Volume) *DriveBase) { | |
| 194 | + | if cb == nil { | |
| 195 | + | x.xGetDrive = 0 | |
| 196 | + | } else { | |
| 197 | + | x.xGetDrive = purego.NewCallback(func(VolumeVarp uintptr) uintptr { | |
| 198 | + | ret := cb(&VolumeBase{Ptr: VolumeVarp}) | |
| 199 | + | if ret == nil { | |
| 200 | + | return 0 | |
| 201 | + | } | |
| 202 | + | return ret.GoPointer() | |
| 203 | + | }) | |
| 204 | + | } | |
| 205 | + | } | |
| 206 | + | ||
| 207 | + | // GetGetDrive gets the callback function. | |
| 208 | + | func (x *VolumeIface) GetGetDrive() func(Volume) *DriveBase { | |
| 209 | + | if x.xGetDrive == 0 { | |
| 210 | + | return nil | |
| 211 | + | } | |
| 212 | + | var rawCallback func(VolumeVarp uintptr) uintptr | |
| 213 | + | purego.RegisterFunc(&rawCallback, x.xGetDrive) | |
| 214 | + | return func(VolumeVar Volume) *DriveBase { | |
| 215 | + | rawRet := rawCallback(VolumeVar.GoPointer()) | |
| 216 | + | if rawRet == 0 { | |
| 217 | + | return nil | |
| 218 | + | } | |
| 219 | + | ret := &DriveBase{} | |
| 220 | + | ret.Ptr = rawRet | |
| 221 | + | return ret | |
| 222 | + | } | |
| 223 | + | } | |
| 224 | + | ||
| 225 | + | // OverrideGetMount sets the callback function. | |
| 226 | + | func (x *VolumeIface) OverrideGetMount(cb func(Volume) *MountBase) { | |
| 227 | + | if cb == nil { | |
| 228 | + | x.xGetMount = 0 | |
| 229 | + | } else { | |
| 230 | + | x.xGetMount = purego.NewCallback(func(VolumeVarp uintptr) uintptr { | |
| 231 | + | ret := cb(&VolumeBase{Ptr: VolumeVarp}) | |
| 232 | + | if ret == nil { | |
| 233 | + | return 0 | |
| 234 | + | } | |
| 235 | + | return ret.GoPointer() | |
| 236 | + | }) | |
| 237 | + | } | |
| 238 | + | } | |
| 239 | + | ||
| 240 | + | // GetGetMount gets the callback function. | |
| 241 | + | func (x *VolumeIface) GetGetMount() func(Volume) *MountBase { | |
| 242 | + | if x.xGetMount == 0 { | |
| 243 | + | return nil | |
| 244 | + | } | |
| 245 | + | var rawCallback func(VolumeVarp uintptr) uintptr | |
| 246 | + | purego.RegisterFunc(&rawCallback, x.xGetMount) | |
| 247 | + | return func(VolumeVar Volume) *MountBase { | |
| 248 | + | rawRet := rawCallback(VolumeVar.GoPointer()) | |
| 249 | + | if rawRet == 0 { | |
| 250 | + | return nil | |
| 251 | + | } | |
| 252 | + | ret := &MountBase{} | |
| 253 | + | ret.Ptr = rawRet | |
| 254 | + | return ret | |
| 255 | + | } | |
| 256 | + | } | |
| 257 | + | ||
| 258 | + | // OverrideCanMount sets the callback function. | |
| 259 | + | func (x *VolumeIface) OverrideCanMount(cb func(Volume) bool) { | |
| 260 | + | if cb == nil { | |
| 261 | + | x.xCanMount = 0 | |
| 262 | + | } else { | |
| 263 | + | x.xCanMount = purego.NewCallback(func(VolumeVarp uintptr) bool { | |
| 264 | + | return cb(&VolumeBase{Ptr: VolumeVarp}) | |
| 265 | + | }) | |
| 266 | + | } | |
| 267 | + | } | |
| 268 | + | ||
| 269 | + | // GetCanMount gets the callback function. | |
| 270 | + | func (x *VolumeIface) GetCanMount() func(Volume) bool { | |
| 271 | + | if x.xCanMount == 0 { | |
| 272 | + | return nil | |
| 273 | + | } | |
| 274 | + | var rawCallback func(VolumeVarp uintptr) bool | |
| 275 | + | purego.RegisterFunc(&rawCallback, x.xCanMount) | |
| 276 | + | return func(VolumeVar Volume) bool { | |
| 277 | + | return rawCallback(VolumeVar.GoPointer()) | |
| 278 | + | } | |
| 279 | + | } | |
| 280 | + | ||
| 281 | + | // OverrideCanEject sets the callback function. | |
| 282 | + | func (x *VolumeIface) OverrideCanEject(cb func(Volume) bool) { | |
| 283 | + | if cb == nil { | |
| 284 | + | x.xCanEject = 0 | |
| 285 | + | } else { | |
| 286 | + | x.xCanEject = purego.NewCallback(func(VolumeVarp uintptr) bool { | |
| 287 | + | return cb(&VolumeBase{Ptr: VolumeVarp}) | |
| 288 | + | }) | |
| 289 | + | } | |
| 290 | + | } | |
| 291 | + | ||
| 292 | + | // GetCanEject gets the callback function. | |
| 293 | + | func (x *VolumeIface) GetCanEject() func(Volume) bool { | |
| 294 | + | if x.xCanEject == 0 { | |
| 295 | + | return nil | |
| 296 | + | } | |
| 297 | + | var rawCallback func(VolumeVarp uintptr) bool | |
| 298 | + | purego.RegisterFunc(&rawCallback, x.xCanEject) | |
| 299 | + | return func(VolumeVar Volume) bool { | |
| 300 | + | return rawCallback(VolumeVar.GoPointer()) | |
| 301 | + | } | |
| 302 | + | } | |
| 303 | + | ||
| 304 | + | // OverrideMountFn sets the callback function. | |
| 305 | + | func (x *VolumeIface) OverrideMountFn(cb func(Volume, MountMountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 306 | + | if cb == nil { | |
| 307 | + | x.xMountFn = 0 | |
| 308 | + | } else { | |
| 309 | + | x.xMountFn = purego.NewCallback(func(VolumeVarp uintptr, FlagsVarp MountMountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 310 | + | cb(&VolumeBase{Ptr: VolumeVarp}, FlagsVarp, MountOperationNewFromInternalPtr(MountOperationVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 311 | + | }) | |
| 312 | + | } | |
| 313 | + | } | |
| 314 | + | ||
| 315 | + | // GetMountFn gets the callback function. | |
| 316 | + | func (x *VolumeIface) GetMountFn() func(Volume, MountMountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 317 | + | if x.xMountFn == 0 { | |
| 318 | + | return nil | |
| 319 | + | } | |
| 320 | + | var rawCallback func(VolumeVarp uintptr, FlagsVarp MountMountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 321 | + | purego.RegisterFunc(&rawCallback, x.xMountFn) | |
| 322 | + | return func(VolumeVar Volume, FlagsVar MountMountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 323 | + | rawCallback(VolumeVar.GoPointer(), FlagsVar, MountOperationVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 324 | + | } | |
| 325 | + | } | |
| 326 | + | ||
| 327 | + | // OverrideMountFinish sets the callback function. | |
| 328 | + | func (x *VolumeIface) OverrideMountFinish(cb func(Volume, AsyncResult) bool) { | |
| 329 | + | if cb == nil { | |
| 330 | + | x.xMountFinish = 0 | |
| 331 | + | } else { | |
| 332 | + | x.xMountFinish = purego.NewCallback(func(VolumeVarp uintptr, ResultVarp uintptr) bool { | |
| 333 | + | return cb(&VolumeBase{Ptr: VolumeVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 334 | + | }) | |
| 335 | + | } | |
| 336 | + | } | |
| 337 | + | ||
| 338 | + | // GetMountFinish gets the callback function. | |
| 339 | + | func (x *VolumeIface) GetMountFinish() func(Volume, AsyncResult) bool { | |
| 340 | + | if x.xMountFinish == 0 { | |
| 341 | + | return nil | |
| 342 | + | } | |
| 343 | + | var rawCallback func(VolumeVarp uintptr, ResultVarp uintptr) bool | |
| 344 | + | purego.RegisterFunc(&rawCallback, x.xMountFinish) | |
| 345 | + | return func(VolumeVar Volume, ResultVar AsyncResult) bool { | |
| 346 | + | return rawCallback(VolumeVar.GoPointer(), ResultVar.GoPointer()) | |
| 347 | + | } | |
| 348 | + | } | |
| 349 | + | ||
| 350 | + | // OverrideEject sets the callback function. | |
| 351 | + | func (x *VolumeIface) OverrideEject(cb func(Volume, MountUnmountFlags, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 352 | + | if cb == nil { | |
| 353 | + | x.xEject = 0 | |
| 354 | + | } else { | |
| 355 | + | x.xEject = purego.NewCallback(func(VolumeVarp uintptr, FlagsVarp MountUnmountFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 356 | + | cb(&VolumeBase{Ptr: VolumeVarp}, FlagsVarp, CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 357 | + | }) | |
| 358 | + | } | |
| 359 | + | } | |
| 360 | + | ||
| 361 | + | // GetEject gets the callback function. | |
| 362 | + | func (x *VolumeIface) GetEject() func(Volume, MountUnmountFlags, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 363 | + | if x.xEject == 0 { | |
| 364 | + | return nil | |
| 365 | + | } | |
| 366 | + | var rawCallback func(VolumeVarp uintptr, FlagsVarp MountUnmountFlags, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 367 | + | purego.RegisterFunc(&rawCallback, x.xEject) | |
| 368 | + | return func(VolumeVar Volume, FlagsVar MountUnmountFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 369 | + | rawCallback(VolumeVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 370 | + | } | |
| 371 | + | } | |
| 372 | + | ||
| 373 | + | // OverrideEjectFinish sets the callback function. | |
| 374 | + | func (x *VolumeIface) OverrideEjectFinish(cb func(Volume, AsyncResult) bool) { | |
| 375 | + | if cb == nil { | |
| 376 | + | x.xEjectFinish = 0 | |
| 377 | + | } else { | |
| 378 | + | x.xEjectFinish = purego.NewCallback(func(VolumeVarp uintptr, ResultVarp uintptr) bool { | |
| 379 | + | return cb(&VolumeBase{Ptr: VolumeVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 380 | + | }) | |
| 381 | + | } | |
| 382 | + | } | |
| 383 | + | ||
| 384 | + | // GetEjectFinish gets the callback function. | |
| 385 | + | func (x *VolumeIface) GetEjectFinish() func(Volume, AsyncResult) bool { | |
| 386 | + | if x.xEjectFinish == 0 { | |
| 387 | + | return nil | |
| 388 | + | } | |
| 389 | + | var rawCallback func(VolumeVarp uintptr, ResultVarp uintptr) bool | |
| 390 | + | purego.RegisterFunc(&rawCallback, x.xEjectFinish) | |
| 391 | + | return func(VolumeVar Volume, ResultVar AsyncResult) bool { | |
| 392 | + | return rawCallback(VolumeVar.GoPointer(), ResultVar.GoPointer()) | |
| 393 | + | } | |
| 394 | + | } | |
| 395 | + | ||
| 396 | + | // OverrideGetIdentifier sets the callback function. | |
| 397 | + | func (x *VolumeIface) OverrideGetIdentifier(cb func(Volume, string) string) { | |
| 398 | + | if cb == nil { | |
| 399 | + | x.xGetIdentifier = 0 | |
| 400 | + | } else { | |
| 401 | + | x.xGetIdentifier = purego.NewCallback(func(VolumeVarp uintptr, KindVarp string) string { | |
| 402 | + | return cb(&VolumeBase{Ptr: VolumeVarp}, KindVarp) | |
| 403 | + | }) | |
| 404 | + | } | |
| 405 | + | } | |
| 406 | + | ||
| 407 | + | // GetGetIdentifier gets the callback function. | |
| 408 | + | func (x *VolumeIface) GetGetIdentifier() func(Volume, string) string { | |
| 409 | + | if x.xGetIdentifier == 0 { | |
| 410 | + | return nil | |
| 411 | + | } | |
| 412 | + | var rawCallback func(VolumeVarp uintptr, KindVarp string) string | |
| 413 | + | purego.RegisterFunc(&rawCallback, x.xGetIdentifier) | |
| 414 | + | return func(VolumeVar Volume, KindVar string) string { | |
| 415 | + | return rawCallback(VolumeVar.GoPointer(), KindVar) | |
| 416 | + | } | |
| 417 | + | } | |
| 418 | + | ||
| 419 | + | // OverrideEnumerateIdentifiers sets the callback function. | |
| 420 | + | func (x *VolumeIface) OverrideEnumerateIdentifiers(cb func(Volume) []string) { | |
| 421 | + | if cb == nil { | |
| 422 | + | x.xEnumerateIdentifiers = 0 | |
| 423 | + | } else { | |
| 424 | + | x.xEnumerateIdentifiers = purego.NewCallback(func(VolumeVarp uintptr) []string { | |
| 425 | + | return cb(&VolumeBase{Ptr: VolumeVarp}) | |
| 426 | + | }) | |
| 427 | + | } | |
| 428 | + | } | |
| 429 | + | ||
| 430 | + | // GetEnumerateIdentifiers gets the callback function. | |
| 431 | + | func (x *VolumeIface) GetEnumerateIdentifiers() func(Volume) []string { | |
| 432 | + | if x.xEnumerateIdentifiers == 0 { | |
| 433 | + | return nil | |
| 434 | + | } | |
| 435 | + | var rawCallback func(VolumeVarp uintptr) []string | |
| 436 | + | purego.RegisterFunc(&rawCallback, x.xEnumerateIdentifiers) | |
| 437 | + | return func(VolumeVar Volume) []string { | |
| 438 | + | return rawCallback(VolumeVar.GoPointer()) | |
| 439 | + | } | |
| 440 | + | } | |
| 441 | + | ||
| 442 | + | // OverrideShouldAutomount sets the callback function. | |
| 443 | + | func (x *VolumeIface) OverrideShouldAutomount(cb func(Volume) bool) { | |
| 444 | + | if cb == nil { | |
| 445 | + | x.xShouldAutomount = 0 | |
| 446 | + | } else { | |
| 447 | + | x.xShouldAutomount = purego.NewCallback(func(VolumeVarp uintptr) bool { | |
| 448 | + | return cb(&VolumeBase{Ptr: VolumeVarp}) | |
| 449 | + | }) | |
| 450 | + | } | |
| 451 | + | } | |
| 452 | + | ||
| 453 | + | // GetShouldAutomount gets the callback function. | |
| 454 | + | func (x *VolumeIface) GetShouldAutomount() func(Volume) bool { | |
| 455 | + | if x.xShouldAutomount == 0 { | |
| 456 | + | return nil | |
| 457 | + | } | |
| 458 | + | var rawCallback func(VolumeVarp uintptr) bool | |
| 459 | + | purego.RegisterFunc(&rawCallback, x.xShouldAutomount) | |
| 460 | + | return func(VolumeVar Volume) bool { | |
| 461 | + | return rawCallback(VolumeVar.GoPointer()) | |
| 462 | + | } | |
| 463 | + | } | |
| 464 | + | ||
| 465 | + | // OverrideGetActivationRoot sets the callback function. | |
| 466 | + | func (x *VolumeIface) OverrideGetActivationRoot(cb func(Volume) *FileBase) { | |
| 467 | + | if cb == nil { | |
| 468 | + | x.xGetActivationRoot = 0 | |
| 469 | + | } else { | |
| 470 | + | x.xGetActivationRoot = purego.NewCallback(func(VolumeVarp uintptr) uintptr { | |
| 471 | + | ret := cb(&VolumeBase{Ptr: VolumeVarp}) | |
| 472 | + | if ret == nil { | |
| 473 | + | return 0 | |
| 474 | + | } | |
| 475 | + | return ret.GoPointer() | |
| 476 | + | }) | |
| 477 | + | } | |
| 478 | + | } | |
| 479 | + | ||
| 480 | + | // GetGetActivationRoot gets the callback function. | |
| 481 | + | func (x *VolumeIface) GetGetActivationRoot() func(Volume) *FileBase { | |
| 482 | + | if x.xGetActivationRoot == 0 { | |
| 483 | + | return nil | |
| 484 | + | } | |
| 485 | + | var rawCallback func(VolumeVarp uintptr) uintptr | |
| 486 | + | purego.RegisterFunc(&rawCallback, x.xGetActivationRoot) | |
| 487 | + | return func(VolumeVar Volume) *FileBase { | |
| 488 | + | rawRet := rawCallback(VolumeVar.GoPointer()) | |
| 489 | + | if rawRet == 0 { | |
| 490 | + | return nil | |
| 491 | + | } | |
| 492 | + | ret := &FileBase{} | |
| 493 | + | ret.Ptr = rawRet | |
| 494 | + | return ret | |
| 495 | + | } | |
| 496 | + | } | |
| 497 | + | ||
| 498 | + | // OverrideEjectWithOperation sets the callback function. | |
| 499 | + | func (x *VolumeIface) OverrideEjectWithOperation(cb func(Volume, MountUnmountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 500 | + | if cb == nil { | |
| 501 | + | x.xEjectWithOperation = 0 | |
| 502 | + | } else { | |
| 503 | + | x.xEjectWithOperation = purego.NewCallback(func(VolumeVarp uintptr, FlagsVarp MountUnmountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) { | |
| 504 | + | cb(&VolumeBase{Ptr: VolumeVarp}, FlagsVarp, MountOperationNewFromInternalPtr(MountOperationVarp), CancellableNewFromInternalPtr(CancellableVarp), (*AsyncReadyCallback)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 505 | + | }) | |
| 506 | + | } | |
| 507 | + | } | |
| 508 | + | ||
| 509 | + | // GetEjectWithOperation gets the callback function. | |
| 510 | + | func (x *VolumeIface) GetEjectWithOperation() func(Volume, MountUnmountFlags, *MountOperation, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 511 | + | if x.xEjectWithOperation == 0 { | |
| 512 | + | return nil | |
| 513 | + | } | |
| 514 | + | var rawCallback func(VolumeVarp uintptr, FlagsVarp MountUnmountFlags, MountOperationVarp uintptr, CancellableVarp uintptr, CallbackVarp uintptr, UserDataVarp uintptr) | |
| 515 | + | purego.RegisterFunc(&rawCallback, x.xEjectWithOperation) | |
| 516 | + | return func(VolumeVar Volume, FlagsVar MountUnmountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 517 | + | rawCallback(VolumeVar.GoPointer(), FlagsVar, MountOperationVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 518 | + | } | |
| 519 | + | } | |
| 520 | + | ||
| 521 | + | // OverrideEjectWithOperationFinish sets the callback function. | |
| 522 | + | func (x *VolumeIface) OverrideEjectWithOperationFinish(cb func(Volume, AsyncResult) bool) { | |
| 523 | + | if cb == nil { | |
| 524 | + | x.xEjectWithOperationFinish = 0 | |
| 525 | + | } else { | |
| 526 | + | x.xEjectWithOperationFinish = purego.NewCallback(func(VolumeVarp uintptr, ResultVarp uintptr) bool { | |
| 527 | + | return cb(&VolumeBase{Ptr: VolumeVarp}, &AsyncResultBase{Ptr: ResultVarp}) | |
| 528 | + | }) | |
| 529 | + | } | |
| 530 | + | } | |
| 531 | + | ||
| 532 | + | // GetEjectWithOperationFinish gets the callback function. | |
| 533 | + | func (x *VolumeIface) GetEjectWithOperationFinish() func(Volume, AsyncResult) bool { | |
| 534 | + | if x.xEjectWithOperationFinish == 0 { | |
| 535 | + | return nil | |
| 536 | + | } | |
| 537 | + | var rawCallback func(VolumeVarp uintptr, ResultVarp uintptr) bool | |
| 538 | + | purego.RegisterFunc(&rawCallback, x.xEjectWithOperationFinish) | |
| 539 | + | return func(VolumeVar Volume, ResultVar AsyncResult) bool { | |
| 540 | + | return rawCallback(VolumeVar.GoPointer(), ResultVar.GoPointer()) | |
| 541 | + | } | |
| 542 | + | } | |
| 543 | + | ||
| 544 | + | // OverrideGetSortKey sets the callback function. | |
| 545 | + | func (x *VolumeIface) OverrideGetSortKey(cb func(Volume) string) { | |
| 546 | + | if cb == nil { | |
| 547 | + | x.xGetSortKey = 0 | |
| 548 | + | } else { | |
| 549 | + | x.xGetSortKey = purego.NewCallback(func(VolumeVarp uintptr) string { | |
| 550 | + | return cb(&VolumeBase{Ptr: VolumeVarp}) | |
| 551 | + | }) | |
| 552 | + | } | |
| 553 | + | } | |
| 554 | + | ||
| 555 | + | // GetGetSortKey gets the callback function. | |
| 556 | + | func (x *VolumeIface) GetGetSortKey() func(Volume) string { | |
| 557 | + | if x.xGetSortKey == 0 { | |
| 558 | + | return nil | |
| 559 | + | } | |
| 560 | + | var rawCallback func(VolumeVarp uintptr) string | |
| 561 | + | purego.RegisterFunc(&rawCallback, x.xGetSortKey) | |
| 562 | + | return func(VolumeVar Volume) string { | |
| 563 | + | return rawCallback(VolumeVar.GoPointer()) | |
| 564 | + | } | |
| 565 | + | } | |
| 566 | + | ||
| 567 | + | // OverrideGetSymbolicIcon sets the callback function. | |
| 568 | + | func (x *VolumeIface) OverrideGetSymbolicIcon(cb func(Volume) *IconBase) { | |
| 569 | + | if cb == nil { | |
| 570 | + | x.xGetSymbolicIcon = 0 | |
| 571 | + | } else { | |
| 572 | + | x.xGetSymbolicIcon = purego.NewCallback(func(VolumeVarp uintptr) uintptr { | |
| 573 | + | ret := cb(&VolumeBase{Ptr: VolumeVarp}) | |
| 574 | + | if ret == nil { | |
| 575 | + | return 0 | |
| 576 | + | } | |
| 577 | + | return ret.GoPointer() | |
| 578 | + | }) | |
| 579 | + | } | |
| 580 | + | } | |
| 581 | + | ||
| 582 | + | // GetGetSymbolicIcon gets the callback function. | |
| 583 | + | func (x *VolumeIface) GetGetSymbolicIcon() func(Volume) *IconBase { | |
| 584 | + | if x.xGetSymbolicIcon == 0 { | |
| 585 | + | return nil | |
| 586 | + | } | |
| 587 | + | var rawCallback func(VolumeVarp uintptr) uintptr | |
| 588 | + | purego.RegisterFunc(&rawCallback, x.xGetSymbolicIcon) | |
| 589 | + | return func(VolumeVar Volume) *IconBase { | |
| 590 | + | rawRet := rawCallback(VolumeVar.GoPointer()) | |
| 591 | + | if rawRet == 0 { | |
| 592 | + | return nil | |
| 593 | + | } | |
| 594 | + | ret := &IconBase{} | |
| 595 | + | ret.Ptr = rawRet | |
| 596 | + | return ret | |
| 597 | + | } | |
| 598 | + | } | |
| 599 | + | ||
| 25 | 600 | // The #GVolume interface represents user-visible objects that can be | |
| 26 | 601 | // mounted. Note, when porting from GnomeVFS, #GVolume is the moral | |
| 27 | 602 | // equivalent of #GnomeVFSDrive. | |
| @@ -68,9 +643,9 @@ type Volume interface { | |||
| 68 | 643 | CanEject() bool | |
| 69 | 644 | CanMount() bool | |
| 70 | 645 | Eject(FlagsVar MountUnmountFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 71 | - | EjectFinish(ResultVar AsyncResult) bool | |
| 646 | + | EjectFinish(ResultVar AsyncResult) (bool, error) | |
| 72 | 647 | EjectWithOperation(FlagsVar MountUnmountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 73 | - | EjectWithOperationFinish(ResultVar AsyncResult) bool | |
| 648 | + | EjectWithOperationFinish(ResultVar AsyncResult) (bool, error) | |
| 74 | 649 | EnumerateIdentifiers() []string | |
| 75 | 650 | GetActivationRoot() *FileBase | |
| 76 | 651 | GetDrive() *DriveBase | |
| @@ -82,7 +657,7 @@ type Volume interface { | |||
| 82 | 657 | GetSymbolicIcon() *IconBase | |
| 83 | 658 | GetUuid() string | |
| 84 | 659 | Mount(FlagsVar MountMountFlags, MountOperationVar *MountOperation, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 85 | - | MountFinish(ResultVar AsyncResult) bool | |
| 660 | + | MountFinish(ResultVar AsyncResult) (bool, error) | |
| 86 | 661 | ShouldAutomount() bool | |
| 87 | 662 | } | |
| 88 | 663 | ||
M v4/gio/gvolumemonitor.go +656 -1
| @@ -15,13 +15,668 @@ import ( | |||
| 15 | 15 | type VolumeMonitorClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | ||
| 20 | + | xVolumeAdded uintptr | |
| 21 | + | ||
| 22 | + | xVolumeRemoved uintptr | |
| 23 | + | ||
| 24 | + | xVolumeChanged uintptr | |
| 25 | + | ||
| 26 | + | xMountAdded uintptr | |
| 27 | + | ||
| 28 | + | xMountRemoved uintptr | |
| 29 | + | ||
| 30 | + | xMountPreUnmount uintptr | |
| 31 | + | ||
| 32 | + | xMountChanged uintptr | |
| 33 | + | ||
| 34 | + | xDriveConnected uintptr | |
| 35 | + | ||
| 36 | + | xDriveDisconnected uintptr | |
| 37 | + | ||
| 38 | + | xDriveChanged uintptr | |
| 39 | + | ||
| 40 | + | xIsSupported uintptr | |
| 41 | + | ||
| 42 | + | xGetConnectedDrives uintptr | |
| 43 | + | ||
| 44 | + | xGetVolumes uintptr | |
| 45 | + | ||
| 46 | + | xGetMounts uintptr | |
| 47 | + | ||
| 48 | + | xGetVolumeForUuid uintptr | |
| 49 | + | ||
| 50 | + | xGetMountForUuid uintptr | |
| 51 | + | ||
| 52 | + | xAdoptOrphanMount uintptr | |
| 53 | + | ||
| 54 | + | xDriveEjectButton uintptr | |
| 55 | + | ||
| 56 | + | xDriveStopButton uintptr | |
| 57 | + | ||
| 58 | + | xGReserved1 uintptr | |
| 59 | + | ||
| 60 | + | xGReserved2 uintptr | |
| 61 | + | ||
| 62 | + | xGReserved3 uintptr | |
| 63 | + | ||
| 64 | + | xGReserved4 uintptr | |
| 65 | + | ||
| 66 | + | xGReserved5 uintptr | |
| 67 | + | ||
| 68 | + | xGReserved6 uintptr | |
| 19 | 69 | } | |
| 20 | 70 | ||
| 21 | 71 | func (x *VolumeMonitorClass) GoPointer() uintptr { | |
| 22 | 72 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 73 | } | |
| 24 | 74 | ||
| 75 | + | // OverrideVolumeAdded sets the callback function. | |
| 76 | + | func (x *VolumeMonitorClass) OverrideVolumeAdded(cb func(*VolumeMonitor, Volume)) { | |
| 77 | + | if cb == nil { | |
| 78 | + | x.xVolumeAdded = 0 | |
| 79 | + | } else { | |
| 80 | + | x.xVolumeAdded = purego.NewCallback(func(VolumeMonitorVarp uintptr, VolumeVarp uintptr) { | |
| 81 | + | cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp), &VolumeBase{Ptr: VolumeVarp}) | |
| 82 | + | }) | |
| 83 | + | } | |
| 84 | + | } | |
| 85 | + | ||
| 86 | + | // GetVolumeAdded gets the callback function. | |
| 87 | + | func (x *VolumeMonitorClass) GetVolumeAdded() func(*VolumeMonitor, Volume) { | |
| 88 | + | if x.xVolumeAdded == 0 { | |
| 89 | + | return nil | |
| 90 | + | } | |
| 91 | + | var rawCallback func(VolumeMonitorVarp uintptr, VolumeVarp uintptr) | |
| 92 | + | purego.RegisterFunc(&rawCallback, x.xVolumeAdded) | |
| 93 | + | return func(VolumeMonitorVar *VolumeMonitor, VolumeVar Volume) { | |
| 94 | + | rawCallback(VolumeMonitorVar.GoPointer(), VolumeVar.GoPointer()) | |
| 95 | + | } | |
| 96 | + | } | |
| 97 | + | ||
| 98 | + | // OverrideVolumeRemoved sets the callback function. | |
| 99 | + | func (x *VolumeMonitorClass) OverrideVolumeRemoved(cb func(*VolumeMonitor, Volume)) { | |
| 100 | + | if cb == nil { | |
| 101 | + | x.xVolumeRemoved = 0 | |
| 102 | + | } else { | |
| 103 | + | x.xVolumeRemoved = purego.NewCallback(func(VolumeMonitorVarp uintptr, VolumeVarp uintptr) { | |
| 104 | + | cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp), &VolumeBase{Ptr: VolumeVarp}) | |
| 105 | + | }) | |
| 106 | + | } | |
| 107 | + | } | |
| 108 | + | ||
| 109 | + | // GetVolumeRemoved gets the callback function. | |
| 110 | + | func (x *VolumeMonitorClass) GetVolumeRemoved() func(*VolumeMonitor, Volume) { | |
| 111 | + | if x.xVolumeRemoved == 0 { | |
| 112 | + | return nil | |
| 113 | + | } | |
| 114 | + | var rawCallback func(VolumeMonitorVarp uintptr, VolumeVarp uintptr) | |
| 115 | + | purego.RegisterFunc(&rawCallback, x.xVolumeRemoved) | |
| 116 | + | return func(VolumeMonitorVar *VolumeMonitor, VolumeVar Volume) { | |
| 117 | + | rawCallback(VolumeMonitorVar.GoPointer(), VolumeVar.GoPointer()) | |
| 118 | + | } | |
| 119 | + | } | |
| 120 | + | ||
| 121 | + | // OverrideVolumeChanged sets the callback function. | |
| 122 | + | func (x *VolumeMonitorClass) OverrideVolumeChanged(cb func(*VolumeMonitor, Volume)) { | |
| 123 | + | if cb == nil { | |
| 124 | + | x.xVolumeChanged = 0 | |
| 125 | + | } else { | |
| 126 | + | x.xVolumeChanged = purego.NewCallback(func(VolumeMonitorVarp uintptr, VolumeVarp uintptr) { | |
| 127 | + | cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp), &VolumeBase{Ptr: VolumeVarp}) | |
| 128 | + | }) | |
| 129 | + | } | |
| 130 | + | } | |
| 131 | + | ||
| 132 | + | // GetVolumeChanged gets the callback function. | |
| 133 | + | func (x *VolumeMonitorClass) GetVolumeChanged() func(*VolumeMonitor, Volume) { | |
| 134 | + | if x.xVolumeChanged == 0 { | |
| 135 | + | return nil | |
| 136 | + | } | |
| 137 | + | var rawCallback func(VolumeMonitorVarp uintptr, VolumeVarp uintptr) | |
| 138 | + | purego.RegisterFunc(&rawCallback, x.xVolumeChanged) | |
| 139 | + | return func(VolumeMonitorVar *VolumeMonitor, VolumeVar Volume) { | |
| 140 | + | rawCallback(VolumeMonitorVar.GoPointer(), VolumeVar.GoPointer()) | |
| 141 | + | } | |
| 142 | + | } | |
| 143 | + | ||
| 144 | + | // OverrideMountAdded sets the callback function. | |
| 145 | + | func (x *VolumeMonitorClass) OverrideMountAdded(cb func(*VolumeMonitor, Mount)) { | |
| 146 | + | if cb == nil { | |
| 147 | + | x.xMountAdded = 0 | |
| 148 | + | } else { | |
| 149 | + | x.xMountAdded = purego.NewCallback(func(VolumeMonitorVarp uintptr, MountVarp uintptr) { | |
| 150 | + | cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp), &MountBase{Ptr: MountVarp}) | |
| 151 | + | }) | |
| 152 | + | } | |
| 153 | + | } | |
| 154 | + | ||
| 155 | + | // GetMountAdded gets the callback function. | |
| 156 | + | func (x *VolumeMonitorClass) GetMountAdded() func(*VolumeMonitor, Mount) { | |
| 157 | + | if x.xMountAdded == 0 { | |
| 158 | + | return nil | |
| 159 | + | } | |
| 160 | + | var rawCallback func(VolumeMonitorVarp uintptr, MountVarp uintptr) | |
| 161 | + | purego.RegisterFunc(&rawCallback, x.xMountAdded) | |
| 162 | + | return func(VolumeMonitorVar *VolumeMonitor, MountVar Mount) { | |
| 163 | + | rawCallback(VolumeMonitorVar.GoPointer(), MountVar.GoPointer()) | |
| 164 | + | } | |
| 165 | + | } | |
| 166 | + | ||
| 167 | + | // OverrideMountRemoved sets the callback function. | |
| 168 | + | func (x *VolumeMonitorClass) OverrideMountRemoved(cb func(*VolumeMonitor, Mount)) { | |
| 169 | + | if cb == nil { | |
| 170 | + | x.xMountRemoved = 0 | |
| 171 | + | } else { | |
| 172 | + | x.xMountRemoved = purego.NewCallback(func(VolumeMonitorVarp uintptr, MountVarp uintptr) { | |
| 173 | + | cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp), &MountBase{Ptr: MountVarp}) | |
| 174 | + | }) | |
| 175 | + | } | |
| 176 | + | } | |
| 177 | + | ||
| 178 | + | // GetMountRemoved gets the callback function. | |
| 179 | + | func (x *VolumeMonitorClass) GetMountRemoved() func(*VolumeMonitor, Mount) { | |
| 180 | + | if x.xMountRemoved == 0 { | |
| 181 | + | return nil | |
| 182 | + | } | |
| 183 | + | var rawCallback func(VolumeMonitorVarp uintptr, MountVarp uintptr) | |
| 184 | + | purego.RegisterFunc(&rawCallback, x.xMountRemoved) | |
| 185 | + | return func(VolumeMonitorVar *VolumeMonitor, MountVar Mount) { | |
| 186 | + | rawCallback(VolumeMonitorVar.GoPointer(), MountVar.GoPointer()) | |
| 187 | + | } | |
| 188 | + | } | |
| 189 | + | ||
| 190 | + | // OverrideMountPreUnmount sets the callback function. | |
| 191 | + | func (x *VolumeMonitorClass) OverrideMountPreUnmount(cb func(*VolumeMonitor, Mount)) { | |
| 192 | + | if cb == nil { | |
| 193 | + | x.xMountPreUnmount = 0 | |
| 194 | + | } else { | |
| 195 | + | x.xMountPreUnmount = purego.NewCallback(func(VolumeMonitorVarp uintptr, MountVarp uintptr) { | |
| 196 | + | cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp), &MountBase{Ptr: MountVarp}) | |
| 197 | + | }) | |
| 198 | + | } | |
| 199 | + | } | |
| 200 | + | ||
| 201 | + | // GetMountPreUnmount gets the callback function. | |
| 202 | + | func (x *VolumeMonitorClass) GetMountPreUnmount() func(*VolumeMonitor, Mount) { | |
| 203 | + | if x.xMountPreUnmount == 0 { | |
| 204 | + | return nil | |
| 205 | + | } | |
| 206 | + | var rawCallback func(VolumeMonitorVarp uintptr, MountVarp uintptr) | |
| 207 | + | purego.RegisterFunc(&rawCallback, x.xMountPreUnmount) | |
| 208 | + | return func(VolumeMonitorVar *VolumeMonitor, MountVar Mount) { | |
| 209 | + | rawCallback(VolumeMonitorVar.GoPointer(), MountVar.GoPointer()) | |
| 210 | + | } | |
| 211 | + | } | |
| 212 | + | ||
| 213 | + | // OverrideMountChanged sets the callback function. | |
| 214 | + | func (x *VolumeMonitorClass) OverrideMountChanged(cb func(*VolumeMonitor, Mount)) { | |
| 215 | + | if cb == nil { | |
| 216 | + | x.xMountChanged = 0 | |
| 217 | + | } else { | |
| 218 | + | x.xMountChanged = purego.NewCallback(func(VolumeMonitorVarp uintptr, MountVarp uintptr) { | |
| 219 | + | cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp), &MountBase{Ptr: MountVarp}) | |
| 220 | + | }) | |
| 221 | + | } | |
| 222 | + | } | |
| 223 | + | ||
| 224 | + | // GetMountChanged gets the callback function. | |
| 225 | + | func (x *VolumeMonitorClass) GetMountChanged() func(*VolumeMonitor, Mount) { | |
| 226 | + | if x.xMountChanged == 0 { | |
| 227 | + | return nil | |
| 228 | + | } | |
| 229 | + | var rawCallback func(VolumeMonitorVarp uintptr, MountVarp uintptr) | |
| 230 | + | purego.RegisterFunc(&rawCallback, x.xMountChanged) | |
| 231 | + | return func(VolumeMonitorVar *VolumeMonitor, MountVar Mount) { | |
| 232 | + | rawCallback(VolumeMonitorVar.GoPointer(), MountVar.GoPointer()) | |
| 233 | + | } | |
| 234 | + | } | |
| 235 | + | ||
| 236 | + | // OverrideDriveConnected sets the callback function. | |
| 237 | + | func (x *VolumeMonitorClass) OverrideDriveConnected(cb func(*VolumeMonitor, Drive)) { | |
| 238 | + | if cb == nil { | |
| 239 | + | x.xDriveConnected = 0 | |
| 240 | + | } else { | |
| 241 | + | x.xDriveConnected = purego.NewCallback(func(VolumeMonitorVarp uintptr, DriveVarp uintptr) { | |
| 242 | + | cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp), &DriveBase{Ptr: DriveVarp}) | |
| 243 | + | }) | |
| 244 | + | } | |
| 245 | + | } | |
| 246 | + | ||
| 247 | + | // GetDriveConnected gets the callback function. | |
| 248 | + | func (x *VolumeMonitorClass) GetDriveConnected() func(*VolumeMonitor, Drive) { | |
| 249 | + | if x.xDriveConnected == 0 { | |
| 250 | + | return nil | |
| 251 | + | } | |
| 252 | + | var rawCallback func(VolumeMonitorVarp uintptr, DriveVarp uintptr) | |
| 253 | + | purego.RegisterFunc(&rawCallback, x.xDriveConnected) | |
| 254 | + | return func(VolumeMonitorVar *VolumeMonitor, DriveVar Drive) { | |
| 255 | + | rawCallback(VolumeMonitorVar.GoPointer(), DriveVar.GoPointer()) | |
| 256 | + | } | |
| 257 | + | } | |
| 258 | + | ||
| 259 | + | // OverrideDriveDisconnected sets the callback function. | |
| 260 | + | func (x *VolumeMonitorClass) OverrideDriveDisconnected(cb func(*VolumeMonitor, Drive)) { | |
| 261 | + | if cb == nil { | |
| 262 | + | x.xDriveDisconnected = 0 | |
| 263 | + | } else { | |
| 264 | + | x.xDriveDisconnected = purego.NewCallback(func(VolumeMonitorVarp uintptr, DriveVarp uintptr) { | |
| 265 | + | cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp), &DriveBase{Ptr: DriveVarp}) | |
| 266 | + | }) | |
| 267 | + | } | |
| 268 | + | } | |
| 269 | + | ||
| 270 | + | // GetDriveDisconnected gets the callback function. | |
| 271 | + | func (x *VolumeMonitorClass) GetDriveDisconnected() func(*VolumeMonitor, Drive) { | |
| 272 | + | if x.xDriveDisconnected == 0 { | |
| 273 | + | return nil | |
| 274 | + | } | |
| 275 | + | var rawCallback func(VolumeMonitorVarp uintptr, DriveVarp uintptr) | |
| 276 | + | purego.RegisterFunc(&rawCallback, x.xDriveDisconnected) | |
| 277 | + | return func(VolumeMonitorVar *VolumeMonitor, DriveVar Drive) { | |
| 278 | + | rawCallback(VolumeMonitorVar.GoPointer(), DriveVar.GoPointer()) | |
| 279 | + | } | |
| 280 | + | } | |
| 281 | + | ||
| 282 | + | // OverrideDriveChanged sets the callback function. | |
| 283 | + | func (x *VolumeMonitorClass) OverrideDriveChanged(cb func(*VolumeMonitor, Drive)) { | |
| 284 | + | if cb == nil { | |
| 285 | + | x.xDriveChanged = 0 | |
| 286 | + | } else { | |
| 287 | + | x.xDriveChanged = purego.NewCallback(func(VolumeMonitorVarp uintptr, DriveVarp uintptr) { | |
| 288 | + | cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp), &DriveBase{Ptr: DriveVarp}) | |
| 289 | + | }) | |
| 290 | + | } | |
| 291 | + | } | |
| 292 | + | ||
| 293 | + | // GetDriveChanged gets the callback function. | |
| 294 | + | func (x *VolumeMonitorClass) GetDriveChanged() func(*VolumeMonitor, Drive) { | |
| 295 | + | if x.xDriveChanged == 0 { | |
| 296 | + | return nil | |
| 297 | + | } | |
| 298 | + | var rawCallback func(VolumeMonitorVarp uintptr, DriveVarp uintptr) | |
| 299 | + | purego.RegisterFunc(&rawCallback, x.xDriveChanged) | |
| 300 | + | return func(VolumeMonitorVar *VolumeMonitor, DriveVar Drive) { | |
| 301 | + | rawCallback(VolumeMonitorVar.GoPointer(), DriveVar.GoPointer()) | |
| 302 | + | } | |
| 303 | + | } | |
| 304 | + | ||
| 305 | + | // OverrideIsSupported sets the callback function. | |
| 306 | + | func (x *VolumeMonitorClass) OverrideIsSupported(cb func() bool) { | |
| 307 | + | if cb == nil { | |
| 308 | + | x.xIsSupported = 0 | |
| 309 | + | } else { | |
| 310 | + | x.xIsSupported = purego.NewCallback(func() bool { | |
| 311 | + | return cb() | |
| 312 | + | }) | |
| 313 | + | } | |
| 314 | + | } | |
| 315 | + | ||
| 316 | + | // GetIsSupported gets the callback function. | |
| 317 | + | func (x *VolumeMonitorClass) GetIsSupported() func() bool { | |
| 318 | + | if x.xIsSupported == 0 { | |
| 319 | + | return nil | |
| 320 | + | } | |
| 321 | + | var rawCallback func() bool | |
| 322 | + | purego.RegisterFunc(&rawCallback, x.xIsSupported) | |
| 323 | + | return func() bool { | |
| 324 | + | return rawCallback() | |
| 325 | + | } | |
| 326 | + | } | |
| 327 | + | ||
| 328 | + | // OverrideGetConnectedDrives sets the callback function. | |
| 329 | + | func (x *VolumeMonitorClass) OverrideGetConnectedDrives(cb func(*VolumeMonitor) *glib.List) { | |
| 330 | + | if cb == nil { | |
| 331 | + | x.xGetConnectedDrives = 0 | |
| 332 | + | } else { | |
| 333 | + | x.xGetConnectedDrives = purego.NewCallback(func(VolumeMonitorVarp uintptr) *glib.List { | |
| 334 | + | return cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp)) | |
| 335 | + | }) | |
| 336 | + | } | |
| 337 | + | } | |
| 338 | + | ||
| 339 | + | // GetGetConnectedDrives gets the callback function. | |
| 340 | + | func (x *VolumeMonitorClass) GetGetConnectedDrives() func(*VolumeMonitor) *glib.List { | |
| 341 | + | if x.xGetConnectedDrives == 0 { | |
| 342 | + | return nil | |
| 343 | + | } | |
| 344 | + | var rawCallback func(VolumeMonitorVarp uintptr) *glib.List | |
| 345 | + | purego.RegisterFunc(&rawCallback, x.xGetConnectedDrives) | |
| 346 | + | return func(VolumeMonitorVar *VolumeMonitor) *glib.List { | |
| 347 | + | return rawCallback(VolumeMonitorVar.GoPointer()) | |
| 348 | + | } | |
| 349 | + | } | |
| 350 | + | ||
| 351 | + | // OverrideGetVolumes sets the callback function. | |
| 352 | + | func (x *VolumeMonitorClass) OverrideGetVolumes(cb func(*VolumeMonitor) *glib.List) { | |
| 353 | + | if cb == nil { | |
| 354 | + | x.xGetVolumes = 0 | |
| 355 | + | } else { | |
| 356 | + | x.xGetVolumes = purego.NewCallback(func(VolumeMonitorVarp uintptr) *glib.List { | |
| 357 | + | return cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp)) | |
| 358 | + | }) | |
| 359 | + | } | |
| 360 | + | } | |
| 361 | + | ||
| 362 | + | // GetGetVolumes gets the callback function. | |
| 363 | + | func (x *VolumeMonitorClass) GetGetVolumes() func(*VolumeMonitor) *glib.List { | |
| 364 | + | if x.xGetVolumes == 0 { | |
| 365 | + | return nil | |
| 366 | + | } | |
| 367 | + | var rawCallback func(VolumeMonitorVarp uintptr) *glib.List | |
| 368 | + | purego.RegisterFunc(&rawCallback, x.xGetVolumes) | |
| 369 | + | return func(VolumeMonitorVar *VolumeMonitor) *glib.List { | |
| 370 | + | return rawCallback(VolumeMonitorVar.GoPointer()) | |
| 371 | + | } | |
| 372 | + | } | |
| 373 | + | ||
| 374 | + | // OverrideGetMounts sets the callback function. | |
| 375 | + | func (x *VolumeMonitorClass) OverrideGetMounts(cb func(*VolumeMonitor) *glib.List) { | |
| 376 | + | if cb == nil { | |
| 377 | + | x.xGetMounts = 0 | |
| 378 | + | } else { | |
| 379 | + | x.xGetMounts = purego.NewCallback(func(VolumeMonitorVarp uintptr) *glib.List { | |
| 380 | + | return cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp)) | |
| 381 | + | }) | |
| 382 | + | } | |
| 383 | + | } | |
| 384 | + | ||
| 385 | + | // GetGetMounts gets the callback function. | |
| 386 | + | func (x *VolumeMonitorClass) GetGetMounts() func(*VolumeMonitor) *glib.List { | |
| 387 | + | if x.xGetMounts == 0 { | |
| 388 | + | return nil | |
| 389 | + | } | |
| 390 | + | var rawCallback func(VolumeMonitorVarp uintptr) *glib.List | |
| 391 | + | purego.RegisterFunc(&rawCallback, x.xGetMounts) | |
| 392 | + | return func(VolumeMonitorVar *VolumeMonitor) *glib.List { | |
| 393 | + | return rawCallback(VolumeMonitorVar.GoPointer()) | |
| 394 | + | } | |
| 395 | + | } | |
| 396 | + | ||
| 397 | + | // OverrideGetVolumeForUuid sets the callback function. | |
| 398 | + | func (x *VolumeMonitorClass) OverrideGetVolumeForUuid(cb func(*VolumeMonitor, string) *VolumeBase) { | |
| 399 | + | if cb == nil { | |
| 400 | + | x.xGetVolumeForUuid = 0 | |
| 401 | + | } else { | |
| 402 | + | x.xGetVolumeForUuid = purego.NewCallback(func(VolumeMonitorVarp uintptr, UuidVarp string) uintptr { | |
| 403 | + | ret := cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp), UuidVarp) | |
| 404 | + | if ret == nil { | |
| 405 | + | return 0 | |
| 406 | + | } | |
| 407 | + | return ret.GoPointer() | |
| 408 | + | }) | |
| 409 | + | } | |
| 410 | + | } | |
| 411 | + | ||
| 412 | + | // GetGetVolumeForUuid gets the callback function. | |
| 413 | + | func (x *VolumeMonitorClass) GetGetVolumeForUuid() func(*VolumeMonitor, string) *VolumeBase { | |
| 414 | + | if x.xGetVolumeForUuid == 0 { | |
| 415 | + | return nil | |
| 416 | + | } | |
| 417 | + | var rawCallback func(VolumeMonitorVarp uintptr, UuidVarp string) uintptr | |
| 418 | + | purego.RegisterFunc(&rawCallback, x.xGetVolumeForUuid) | |
| 419 | + | return func(VolumeMonitorVar *VolumeMonitor, UuidVar string) *VolumeBase { | |
| 420 | + | rawRet := rawCallback(VolumeMonitorVar.GoPointer(), UuidVar) | |
| 421 | + | if rawRet == 0 { | |
| 422 | + | return nil | |
| 423 | + | } | |
| 424 | + | ret := &VolumeBase{} | |
| 425 | + | ret.Ptr = rawRet | |
| 426 | + | return ret | |
| 427 | + | } | |
| 428 | + | } | |
| 429 | + | ||
| 430 | + | // OverrideGetMountForUuid sets the callback function. | |
| 431 | + | func (x *VolumeMonitorClass) OverrideGetMountForUuid(cb func(*VolumeMonitor, string) *MountBase) { | |
| 432 | + | if cb == nil { | |
| 433 | + | x.xGetMountForUuid = 0 | |
| 434 | + | } else { | |
| 435 | + | x.xGetMountForUuid = purego.NewCallback(func(VolumeMonitorVarp uintptr, UuidVarp string) uintptr { | |
| 436 | + | ret := cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp), UuidVarp) | |
| 437 | + | if ret == nil { | |
| 438 | + | return 0 | |
| 439 | + | } | |
| 440 | + | return ret.GoPointer() | |
| 441 | + | }) | |
| 442 | + | } | |
| 443 | + | } | |
| 444 | + | ||
| 445 | + | // GetGetMountForUuid gets the callback function. | |
| 446 | + | func (x *VolumeMonitorClass) GetGetMountForUuid() func(*VolumeMonitor, string) *MountBase { | |
| 447 | + | if x.xGetMountForUuid == 0 { | |
| 448 | + | return nil | |
| 449 | + | } | |
| 450 | + | var rawCallback func(VolumeMonitorVarp uintptr, UuidVarp string) uintptr | |
| 451 | + | purego.RegisterFunc(&rawCallback, x.xGetMountForUuid) | |
| 452 | + | return func(VolumeMonitorVar *VolumeMonitor, UuidVar string) *MountBase { | |
| 453 | + | rawRet := rawCallback(VolumeMonitorVar.GoPointer(), UuidVar) | |
| 454 | + | if rawRet == 0 { | |
| 455 | + | return nil | |
| 456 | + | } | |
| 457 | + | ret := &MountBase{} | |
| 458 | + | ret.Ptr = rawRet | |
| 459 | + | return ret | |
| 460 | + | } | |
| 461 | + | } | |
| 462 | + | ||
| 463 | + | // OverrideAdoptOrphanMount sets the callback function. | |
| 464 | + | func (x *VolumeMonitorClass) OverrideAdoptOrphanMount(cb func(Mount, *VolumeMonitor) *VolumeBase) { | |
| 465 | + | if cb == nil { | |
| 466 | + | x.xAdoptOrphanMount = 0 | |
| 467 | + | } else { | |
| 468 | + | x.xAdoptOrphanMount = purego.NewCallback(func(MountVarp uintptr, VolumeMonitorVarp uintptr) uintptr { | |
| 469 | + | ret := cb(&MountBase{Ptr: MountVarp}, VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp)) | |
| 470 | + | if ret == nil { | |
| 471 | + | return 0 | |
| 472 | + | } | |
| 473 | + | return ret.GoPointer() | |
| 474 | + | }) | |
| 475 | + | } | |
| 476 | + | } | |
| 477 | + | ||
| 478 | + | // GetAdoptOrphanMount gets the callback function. | |
| 479 | + | func (x *VolumeMonitorClass) GetAdoptOrphanMount() func(Mount, *VolumeMonitor) *VolumeBase { | |
| 480 | + | if x.xAdoptOrphanMount == 0 { | |
| 481 | + | return nil | |
| 482 | + | } | |
| 483 | + | var rawCallback func(MountVarp uintptr, VolumeMonitorVarp uintptr) uintptr | |
| 484 | + | purego.RegisterFunc(&rawCallback, x.xAdoptOrphanMount) | |
| 485 | + | return func(MountVar Mount, VolumeMonitorVar *VolumeMonitor) *VolumeBase { | |
| 486 | + | rawRet := rawCallback(MountVar.GoPointer(), VolumeMonitorVar.GoPointer()) | |
| 487 | + | if rawRet == 0 { | |
| 488 | + | return nil | |
| 489 | + | } | |
| 490 | + | ret := &VolumeBase{} | |
| 491 | + | ret.Ptr = rawRet | |
| 492 | + | return ret | |
| 493 | + | } | |
| 494 | + | } | |
| 495 | + | ||
| 496 | + | // OverrideDriveEjectButton sets the callback function. | |
| 497 | + | func (x *VolumeMonitorClass) OverrideDriveEjectButton(cb func(*VolumeMonitor, Drive)) { | |
| 498 | + | if cb == nil { | |
| 499 | + | x.xDriveEjectButton = 0 | |
| 500 | + | } else { | |
| 501 | + | x.xDriveEjectButton = purego.NewCallback(func(VolumeMonitorVarp uintptr, DriveVarp uintptr) { | |
| 502 | + | cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp), &DriveBase{Ptr: DriveVarp}) | |
| 503 | + | }) | |
| 504 | + | } | |
| 505 | + | } | |
| 506 | + | ||
| 507 | + | // GetDriveEjectButton gets the callback function. | |
| 508 | + | func (x *VolumeMonitorClass) GetDriveEjectButton() func(*VolumeMonitor, Drive) { | |
| 509 | + | if x.xDriveEjectButton == 0 { | |
| 510 | + | return nil | |
| 511 | + | } | |
| 512 | + | var rawCallback func(VolumeMonitorVarp uintptr, DriveVarp uintptr) | |
| 513 | + | purego.RegisterFunc(&rawCallback, x.xDriveEjectButton) | |
| 514 | + | return func(VolumeMonitorVar *VolumeMonitor, DriveVar Drive) { | |
| 515 | + | rawCallback(VolumeMonitorVar.GoPointer(), DriveVar.GoPointer()) | |
| 516 | + | } | |
| 517 | + | } | |
| 518 | + | ||
| 519 | + | // OverrideDriveStopButton sets the callback function. | |
| 520 | + | func (x *VolumeMonitorClass) OverrideDriveStopButton(cb func(*VolumeMonitor, Drive)) { | |
| 521 | + | if cb == nil { | |
| 522 | + | x.xDriveStopButton = 0 | |
| 523 | + | } else { | |
| 524 | + | x.xDriveStopButton = purego.NewCallback(func(VolumeMonitorVarp uintptr, DriveVarp uintptr) { | |
| 525 | + | cb(VolumeMonitorNewFromInternalPtr(VolumeMonitorVarp), &DriveBase{Ptr: DriveVarp}) | |
| 526 | + | }) | |
| 527 | + | } | |
| 528 | + | } | |
| 529 | + | ||
| 530 | + | // GetDriveStopButton gets the callback function. | |
| 531 | + | func (x *VolumeMonitorClass) GetDriveStopButton() func(*VolumeMonitor, Drive) { | |
| 532 | + | if x.xDriveStopButton == 0 { | |
| 533 | + | return nil | |
| 534 | + | } | |
| 535 | + | var rawCallback func(VolumeMonitorVarp uintptr, DriveVarp uintptr) | |
| 536 | + | purego.RegisterFunc(&rawCallback, x.xDriveStopButton) | |
| 537 | + | return func(VolumeMonitorVar *VolumeMonitor, DriveVar Drive) { | |
| 538 | + | rawCallback(VolumeMonitorVar.GoPointer(), DriveVar.GoPointer()) | |
| 539 | + | } | |
| 540 | + | } | |
| 541 | + | ||
| 542 | + | // OverrideGReserved1 sets the callback function. | |
| 543 | + | func (x *VolumeMonitorClass) OverrideGReserved1(cb func()) { | |
| 544 | + | if cb == nil { | |
| 545 | + | x.xGReserved1 = 0 | |
| 546 | + | } else { | |
| 547 | + | x.xGReserved1 = purego.NewCallback(func() { | |
| 548 | + | cb() | |
| 549 | + | }) | |
| 550 | + | } | |
| 551 | + | } | |
| 552 | + | ||
| 553 | + | // GetGReserved1 gets the callback function. | |
| 554 | + | func (x *VolumeMonitorClass) GetGReserved1() func() { | |
| 555 | + | if x.xGReserved1 == 0 { | |
| 556 | + | return nil | |
| 557 | + | } | |
| 558 | + | var rawCallback func() | |
| 559 | + | purego.RegisterFunc(&rawCallback, x.xGReserved1) | |
| 560 | + | return func() { | |
| 561 | + | rawCallback() | |
| 562 | + | } | |
| 563 | + | } | |
| 564 | + | ||
| 565 | + | // OverrideGReserved2 sets the callback function. | |
| 566 | + | func (x *VolumeMonitorClass) OverrideGReserved2(cb func()) { | |
| 567 | + | if cb == nil { | |
| 568 | + | x.xGReserved2 = 0 | |
| 569 | + | } else { | |
| 570 | + | x.xGReserved2 = purego.NewCallback(func() { | |
| 571 | + | cb() | |
| 572 | + | }) | |
| 573 | + | } | |
| 574 | + | } | |
| 575 | + | ||
| 576 | + | // GetGReserved2 gets the callback function. | |
| 577 | + | func (x *VolumeMonitorClass) GetGReserved2() func() { | |
| 578 | + | if x.xGReserved2 == 0 { | |
| 579 | + | return nil | |
| 580 | + | } | |
| 581 | + | var rawCallback func() | |
| 582 | + | purego.RegisterFunc(&rawCallback, x.xGReserved2) | |
| 583 | + | return func() { | |
| 584 | + | rawCallback() | |
| 585 | + | } | |
| 586 | + | } | |
| 587 | + | ||
| 588 | + | // OverrideGReserved3 sets the callback function. | |
| 589 | + | func (x *VolumeMonitorClass) OverrideGReserved3(cb func()) { | |
| 590 | + | if cb == nil { | |
| 591 | + | x.xGReserved3 = 0 | |
| 592 | + | } else { | |
| 593 | + | x.xGReserved3 = purego.NewCallback(func() { | |
| 594 | + | cb() | |
| 595 | + | }) | |
| 596 | + | } | |
| 597 | + | } | |
| 598 | + | ||
| 599 | + | // GetGReserved3 gets the callback function. | |
| 600 | + | func (x *VolumeMonitorClass) GetGReserved3() func() { | |
| 601 | + | if x.xGReserved3 == 0 { | |
| 602 | + | return nil | |
| 603 | + | } | |
| 604 | + | var rawCallback func() | |
| 605 | + | purego.RegisterFunc(&rawCallback, x.xGReserved3) | |
| 606 | + | return func() { | |
| 607 | + | rawCallback() | |
| 608 | + | } | |
| 609 | + | } | |
| 610 | + | ||
| 611 | + | // OverrideGReserved4 sets the callback function. | |
| 612 | + | func (x *VolumeMonitorClass) OverrideGReserved4(cb func()) { | |
| 613 | + | if cb == nil { | |
| 614 | + | x.xGReserved4 = 0 | |
| 615 | + | } else { | |
| 616 | + | x.xGReserved4 = purego.NewCallback(func() { | |
| 617 | + | cb() | |
| 618 | + | }) | |
| 619 | + | } | |
| 620 | + | } | |
| 621 | + | ||
| 622 | + | // GetGReserved4 gets the callback function. | |
| 623 | + | func (x *VolumeMonitorClass) GetGReserved4() func() { | |
| 624 | + | if x.xGReserved4 == 0 { | |
| 625 | + | return nil | |
| 626 | + | } | |
| 627 | + | var rawCallback func() | |
| 628 | + | purego.RegisterFunc(&rawCallback, x.xGReserved4) | |
| 629 | + | return func() { | |
| 630 | + | rawCallback() | |
| 631 | + | } | |
| 632 | + | } | |
| 633 | + | ||
| 634 | + | // OverrideGReserved5 sets the callback function. | |
| 635 | + | func (x *VolumeMonitorClass) OverrideGReserved5(cb func()) { | |
| 636 | + | if cb == nil { | |
| 637 | + | x.xGReserved5 = 0 | |
| 638 | + | } else { | |
| 639 | + | x.xGReserved5 = purego.NewCallback(func() { | |
| 640 | + | cb() | |
| 641 | + | }) | |
| 642 | + | } | |
| 643 | + | } | |
| 644 | + | ||
| 645 | + | // GetGReserved5 gets the callback function. | |
| 646 | + | func (x *VolumeMonitorClass) GetGReserved5() func() { | |
| 647 | + | if x.xGReserved5 == 0 { | |
| 648 | + | return nil | |
| 649 | + | } | |
| 650 | + | var rawCallback func() | |
| 651 | + | purego.RegisterFunc(&rawCallback, x.xGReserved5) | |
| 652 | + | return func() { | |
| 653 | + | rawCallback() | |
| 654 | + | } | |
| 655 | + | } | |
| 656 | + | ||
| 657 | + | // OverrideGReserved6 sets the callback function. | |
| 658 | + | func (x *VolumeMonitorClass) OverrideGReserved6(cb func()) { | |
| 659 | + | if cb == nil { | |
| 660 | + | x.xGReserved6 = 0 | |
| 661 | + | } else { | |
| 662 | + | x.xGReserved6 = purego.NewCallback(func() { | |
| 663 | + | cb() | |
| 664 | + | }) | |
| 665 | + | } | |
| 666 | + | } | |
| 667 | + | ||
| 668 | + | // GetGReserved6 gets the callback function. | |
| 669 | + | func (x *VolumeMonitorClass) GetGReserved6() func() { | |
| 670 | + | if x.xGReserved6 == 0 { | |
| 671 | + | return nil | |
| 672 | + | } | |
| 673 | + | var rawCallback func() | |
| 674 | + | purego.RegisterFunc(&rawCallback, x.xGReserved6) | |
| 675 | + | return func() { | |
| 676 | + | rawCallback() | |
| 677 | + | } | |
| 678 | + | } | |
| 679 | + | ||
| 25 | 680 | const ( | |
| 26 | 681 | // Extension point for volume monitor functionality. | |
| 27 | 682 | // See [Extending GIO][extending-gio]. | |
M v4/gio/gzlibcompressor.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type ZlibCompressorClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *ZlibCompressorClass) GoPointer() uintptr { | |
M v4/gio/gzlibdecompressor.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type ZlibDecompressorClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *ZlibDecompressorClass) GoPointer() uintptr { | |
M v4/glib/giochannel.go +200 -0
| @@ -559,12 +559,212 @@ func (x *IOChannel) WriteUnichar(ThecharVar uint32) (IOStatus, error) { | |||
| 559 | 559 | // in a generic way. | |
| 560 | 560 | type IOFuncs struct { | |
| 561 | 561 | _ structs.HostLayout | |
| 562 | + | ||
| 563 | + | xIoRead uintptr | |
| 564 | + | ||
| 565 | + | xIoWrite uintptr | |
| 566 | + | ||
| 567 | + | xIoSeek uintptr | |
| 568 | + | ||
| 569 | + | xIoClose uintptr | |
| 570 | + | ||
| 571 | + | xIoCreateWatch uintptr | |
| 572 | + | ||
| 573 | + | xIoFree uintptr | |
| 574 | + | ||
| 575 | + | xIoSetFlags uintptr | |
| 576 | + | ||
| 577 | + | xIoGetFlags uintptr | |
| 562 | 578 | } | |
| 563 | 579 | ||
| 564 | 580 | func (x *IOFuncs) GoPointer() uintptr { | |
| 565 | 581 | return uintptr(unsafe.Pointer(x)) | |
| 566 | 582 | } | |
| 567 | 583 | ||
| 584 | + | // OverrideIoRead sets the callback function. | |
| 585 | + | func (x *IOFuncs) OverrideIoRead(cb func(*IOChannel, string, uint, uint) IOStatus) { | |
| 586 | + | if cb == nil { | |
| 587 | + | x.xIoRead = 0 | |
| 588 | + | } else { | |
| 589 | + | x.xIoRead = purego.NewCallback(func(ChannelVarp *IOChannel, BufVarp string, CountVarp uint, BytesReadVarp uint) IOStatus { | |
| 590 | + | return cb(ChannelVarp, BufVarp, CountVarp, BytesReadVarp) | |
| 591 | + | }) | |
| 592 | + | } | |
| 593 | + | } | |
| 594 | + | ||
| 595 | + | // GetIoRead gets the callback function. | |
| 596 | + | func (x *IOFuncs) GetIoRead() func(*IOChannel, string, uint, uint) IOStatus { | |
| 597 | + | if x.xIoRead == 0 { | |
| 598 | + | return nil | |
| 599 | + | } | |
| 600 | + | var rawCallback func(ChannelVarp *IOChannel, BufVarp string, CountVarp uint, BytesReadVarp uint) IOStatus | |
| 601 | + | purego.RegisterFunc(&rawCallback, x.xIoRead) | |
| 602 | + | return func(ChannelVar *IOChannel, BufVar string, CountVar uint, BytesReadVar uint) IOStatus { | |
| 603 | + | return rawCallback(ChannelVar, BufVar, CountVar, BytesReadVar) | |
| 604 | + | } | |
| 605 | + | } | |
| 606 | + | ||
| 607 | + | // OverrideIoWrite sets the callback function. | |
| 608 | + | func (x *IOFuncs) OverrideIoWrite(cb func(*IOChannel, string, uint, uint) IOStatus) { | |
| 609 | + | if cb == nil { | |
| 610 | + | x.xIoWrite = 0 | |
| 611 | + | } else { | |
| 612 | + | x.xIoWrite = purego.NewCallback(func(ChannelVarp *IOChannel, BufVarp string, CountVarp uint, BytesWrittenVarp uint) IOStatus { | |
| 613 | + | return cb(ChannelVarp, BufVarp, CountVarp, BytesWrittenVarp) | |
| 614 | + | }) | |
| 615 | + | } | |
| 616 | + | } | |
| 617 | + | ||
| 618 | + | // GetIoWrite gets the callback function. | |
| 619 | + | func (x *IOFuncs) GetIoWrite() func(*IOChannel, string, uint, uint) IOStatus { | |
| 620 | + | if x.xIoWrite == 0 { | |
| 621 | + | return nil | |
| 622 | + | } | |
| 623 | + | var rawCallback func(ChannelVarp *IOChannel, BufVarp string, CountVarp uint, BytesWrittenVarp uint) IOStatus | |
| 624 | + | purego.RegisterFunc(&rawCallback, x.xIoWrite) | |
| 625 | + | return func(ChannelVar *IOChannel, BufVar string, CountVar uint, BytesWrittenVar uint) IOStatus { | |
| 626 | + | return rawCallback(ChannelVar, BufVar, CountVar, BytesWrittenVar) | |
| 627 | + | } | |
| 628 | + | } | |
| 629 | + | ||
| 630 | + | // OverrideIoSeek sets the callback function. | |
| 631 | + | func (x *IOFuncs) OverrideIoSeek(cb func(*IOChannel, int64, SeekType) IOStatus) { | |
| 632 | + | if cb == nil { | |
| 633 | + | x.xIoSeek = 0 | |
| 634 | + | } else { | |
| 635 | + | x.xIoSeek = purego.NewCallback(func(ChannelVarp *IOChannel, OffsetVarp int64, TypeVarp SeekType) IOStatus { | |
| 636 | + | return cb(ChannelVarp, OffsetVarp, TypeVarp) | |
| 637 | + | }) | |
| 638 | + | } | |
| 639 | + | } | |
| 640 | + | ||
| 641 | + | // GetIoSeek gets the callback function. | |
| 642 | + | func (x *IOFuncs) GetIoSeek() func(*IOChannel, int64, SeekType) IOStatus { | |
| 643 | + | if x.xIoSeek == 0 { | |
| 644 | + | return nil | |
| 645 | + | } | |
| 646 | + | var rawCallback func(ChannelVarp *IOChannel, OffsetVarp int64, TypeVarp SeekType) IOStatus | |
| 647 | + | purego.RegisterFunc(&rawCallback, x.xIoSeek) | |
| 648 | + | return func(ChannelVar *IOChannel, OffsetVar int64, TypeVar SeekType) IOStatus { | |
| 649 | + | return rawCallback(ChannelVar, OffsetVar, TypeVar) | |
| 650 | + | } | |
| 651 | + | } | |
| 652 | + | ||
| 653 | + | // OverrideIoClose sets the callback function. | |
| 654 | + | func (x *IOFuncs) OverrideIoClose(cb func(*IOChannel) IOStatus) { | |
| 655 | + | if cb == nil { | |
| 656 | + | x.xIoClose = 0 | |
| 657 | + | } else { | |
| 658 | + | x.xIoClose = purego.NewCallback(func(ChannelVarp *IOChannel) IOStatus { | |
| 659 | + | return cb(ChannelVarp) | |
| 660 | + | }) | |
| 661 | + | } | |
| 662 | + | } | |
| 663 | + | ||
| 664 | + | // GetIoClose gets the callback function. | |
| 665 | + | func (x *IOFuncs) GetIoClose() func(*IOChannel) IOStatus { | |
| 666 | + | if x.xIoClose == 0 { | |
| 667 | + | return nil | |
| 668 | + | } | |
| 669 | + | var rawCallback func(ChannelVarp *IOChannel) IOStatus | |
| 670 | + | purego.RegisterFunc(&rawCallback, x.xIoClose) | |
| 671 | + | return func(ChannelVar *IOChannel) IOStatus { | |
| 672 | + | return rawCallback(ChannelVar) | |
| 673 | + | } | |
| 674 | + | } | |
| 675 | + | ||
| 676 | + | // OverrideIoCreateWatch sets the callback function. | |
| 677 | + | func (x *IOFuncs) OverrideIoCreateWatch(cb func(*IOChannel, IOCondition) *Source) { | |
| 678 | + | if cb == nil { | |
| 679 | + | x.xIoCreateWatch = 0 | |
| 680 | + | } else { | |
| 681 | + | x.xIoCreateWatch = purego.NewCallback(func(ChannelVarp *IOChannel, ConditionVarp IOCondition) *Source { | |
| 682 | + | return cb(ChannelVarp, ConditionVarp) | |
| 683 | + | }) | |
| 684 | + | } | |
| 685 | + | } | |
| 686 | + | ||
| 687 | + | // GetIoCreateWatch gets the callback function. | |
| 688 | + | func (x *IOFuncs) GetIoCreateWatch() func(*IOChannel, IOCondition) *Source { | |
| 689 | + | if x.xIoCreateWatch == 0 { | |
| 690 | + | return nil | |
| 691 | + | } | |
| 692 | + | var rawCallback func(ChannelVarp *IOChannel, ConditionVarp IOCondition) *Source | |
| 693 | + | purego.RegisterFunc(&rawCallback, x.xIoCreateWatch) | |
| 694 | + | return func(ChannelVar *IOChannel, ConditionVar IOCondition) *Source { | |
| 695 | + | return rawCallback(ChannelVar, ConditionVar) | |
| 696 | + | } | |
| 697 | + | } | |
| 698 | + | ||
| 699 | + | // OverrideIoFree sets the callback function. | |
| 700 | + | func (x *IOFuncs) OverrideIoFree(cb func(*IOChannel)) { | |
| 701 | + | if cb == nil { | |
| 702 | + | x.xIoFree = 0 | |
| 703 | + | } else { | |
| 704 | + | x.xIoFree = purego.NewCallback(func(ChannelVarp *IOChannel) { | |
| 705 | + | cb(ChannelVarp) | |
| 706 | + | }) | |
| 707 | + | } | |
| 708 | + | } | |
| 709 | + | ||
| 710 | + | // GetIoFree gets the callback function. | |
| 711 | + | func (x *IOFuncs) GetIoFree() func(*IOChannel) { | |
| 712 | + | if x.xIoFree == 0 { | |
| 713 | + | return nil | |
| 714 | + | } | |
| 715 | + | var rawCallback func(ChannelVarp *IOChannel) | |
| 716 | + | purego.RegisterFunc(&rawCallback, x.xIoFree) | |
| 717 | + | return func(ChannelVar *IOChannel) { | |
| 718 | + | rawCallback(ChannelVar) | |
| 719 | + | } | |
| 720 | + | } | |
| 721 | + | ||
| 722 | + | // OverrideIoSetFlags sets the callback function. | |
| 723 | + | func (x *IOFuncs) OverrideIoSetFlags(cb func(*IOChannel, IOFlags) IOStatus) { | |
| 724 | + | if cb == nil { | |
| 725 | + | x.xIoSetFlags = 0 | |
| 726 | + | } else { | |
| 727 | + | x.xIoSetFlags = purego.NewCallback(func(ChannelVarp *IOChannel, FlagsVarp IOFlags) IOStatus { | |
| 728 | + | return cb(ChannelVarp, FlagsVarp) | |
| 729 | + | }) | |
| 730 | + | } | |
| 731 | + | } | |
| 732 | + | ||
| 733 | + | // GetIoSetFlags gets the callback function. | |
| 734 | + | func (x *IOFuncs) GetIoSetFlags() func(*IOChannel, IOFlags) IOStatus { | |
| 735 | + | if x.xIoSetFlags == 0 { | |
| 736 | + | return nil | |
| 737 | + | } | |
| 738 | + | var rawCallback func(ChannelVarp *IOChannel, FlagsVarp IOFlags) IOStatus | |
| 739 | + | purego.RegisterFunc(&rawCallback, x.xIoSetFlags) | |
| 740 | + | return func(ChannelVar *IOChannel, FlagsVar IOFlags) IOStatus { | |
| 741 | + | return rawCallback(ChannelVar, FlagsVar) | |
| 742 | + | } | |
| 743 | + | } | |
| 744 | + | ||
| 745 | + | // OverrideIoGetFlags sets the callback function. | |
| 746 | + | func (x *IOFuncs) OverrideIoGetFlags(cb func(*IOChannel) IOFlags) { | |
| 747 | + | if cb == nil { | |
| 748 | + | x.xIoGetFlags = 0 | |
| 749 | + | } else { | |
| 750 | + | x.xIoGetFlags = purego.NewCallback(func(ChannelVarp *IOChannel) IOFlags { | |
| 751 | + | return cb(ChannelVarp) | |
| 752 | + | }) | |
| 753 | + | } | |
| 754 | + | } | |
| 755 | + | ||
| 756 | + | // GetIoGetFlags gets the callback function. | |
| 757 | + | func (x *IOFuncs) GetIoGetFlags() func(*IOChannel) IOFlags { | |
| 758 | + | if x.xIoGetFlags == 0 { | |
| 759 | + | return nil | |
| 760 | + | } | |
| 761 | + | var rawCallback func(ChannelVarp *IOChannel) IOFlags | |
| 762 | + | purego.RegisterFunc(&rawCallback, x.xIoGetFlags) | |
| 763 | + | return func(ChannelVar *IOChannel) IOFlags { | |
| 764 | + | return rawCallback(ChannelVar) | |
| 765 | + | } | |
| 766 | + | } | |
| 767 | + | ||
| 568 | 768 | const ( | |
| 569 | 769 | WIN32_MSG_HANDLE int = 19981206 | |
| 570 | 770 | ) | |
M v4/glib/gmain.go +175 -0
| @@ -1180,12 +1180,87 @@ func (x *Source) Unref() { | |||
| 1180 | 1180 | // functions for managing callback objects. | |
| 1181 | 1181 | type SourceCallbackFuncs struct { | |
| 1182 | 1182 | _ structs.HostLayout | |
| 1183 | + | ||
| 1184 | + | xRef uintptr | |
| 1185 | + | ||
| 1186 | + | xUnref uintptr | |
| 1187 | + | ||
| 1188 | + | xGet uintptr | |
| 1183 | 1189 | } | |
| 1184 | 1190 | ||
| 1185 | 1191 | func (x *SourceCallbackFuncs) GoPointer() uintptr { | |
| 1186 | 1192 | return uintptr(unsafe.Pointer(x)) | |
| 1187 | 1193 | } | |
| 1188 | 1194 | ||
| 1195 | + | // OverrideRef sets the callback function. | |
| 1196 | + | func (x *SourceCallbackFuncs) OverrideRef(cb func(uintptr)) { | |
| 1197 | + | if cb == nil { | |
| 1198 | + | x.xRef = 0 | |
| 1199 | + | } else { | |
| 1200 | + | x.xRef = purego.NewCallback(func(CbDataVarp uintptr) { | |
| 1201 | + | cb(CbDataVarp) | |
| 1202 | + | }) | |
| 1203 | + | } | |
| 1204 | + | } | |
| 1205 | + | ||
| 1206 | + | // GetRef gets the callback function. | |
| 1207 | + | func (x *SourceCallbackFuncs) GetRef() func(uintptr) { | |
| 1208 | + | if x.xRef == 0 { | |
| 1209 | + | return nil | |
| 1210 | + | } | |
| 1211 | + | var rawCallback func(CbDataVarp uintptr) | |
| 1212 | + | purego.RegisterFunc(&rawCallback, x.xRef) | |
| 1213 | + | return func(CbDataVar uintptr) { | |
| 1214 | + | rawCallback(CbDataVar) | |
| 1215 | + | } | |
| 1216 | + | } | |
| 1217 | + | ||
| 1218 | + | // OverrideUnref sets the callback function. | |
| 1219 | + | func (x *SourceCallbackFuncs) OverrideUnref(cb func(uintptr)) { | |
| 1220 | + | if cb == nil { | |
| 1221 | + | x.xUnref = 0 | |
| 1222 | + | } else { | |
| 1223 | + | x.xUnref = purego.NewCallback(func(CbDataVarp uintptr) { | |
| 1224 | + | cb(CbDataVarp) | |
| 1225 | + | }) | |
| 1226 | + | } | |
| 1227 | + | } | |
| 1228 | + | ||
| 1229 | + | // GetUnref gets the callback function. | |
| 1230 | + | func (x *SourceCallbackFuncs) GetUnref() func(uintptr) { | |
| 1231 | + | if x.xUnref == 0 { | |
| 1232 | + | return nil | |
| 1233 | + | } | |
| 1234 | + | var rawCallback func(CbDataVarp uintptr) | |
| 1235 | + | purego.RegisterFunc(&rawCallback, x.xUnref) | |
| 1236 | + | return func(CbDataVar uintptr) { | |
| 1237 | + | rawCallback(CbDataVar) | |
| 1238 | + | } | |
| 1239 | + | } | |
| 1240 | + | ||
| 1241 | + | // OverrideGet sets the callback function. | |
| 1242 | + | func (x *SourceCallbackFuncs) OverrideGet(cb func(uintptr, *Source, *SourceFunc, uintptr)) { | |
| 1243 | + | if cb == nil { | |
| 1244 | + | x.xGet = 0 | |
| 1245 | + | } else { | |
| 1246 | + | x.xGet = purego.NewCallback(func(CbDataVarp uintptr, SourceVarp *Source, FuncVarp uintptr, DataVarp uintptr) { | |
| 1247 | + | cb(CbDataVarp, SourceVarp, (*SourceFunc)(unsafe.Pointer(FuncVarp)), DataVarp) | |
| 1248 | + | }) | |
| 1249 | + | } | |
| 1250 | + | } | |
| 1251 | + | ||
| 1252 | + | // GetGet gets the callback function. | |
| 1253 | + | func (x *SourceCallbackFuncs) GetGet() func(uintptr, *Source, *SourceFunc, uintptr) { | |
| 1254 | + | if x.xGet == 0 { | |
| 1255 | + | return nil | |
| 1256 | + | } | |
| 1257 | + | var rawCallback func(CbDataVarp uintptr, SourceVarp *Source, FuncVarp uintptr, DataVarp uintptr) | |
| 1258 | + | purego.RegisterFunc(&rawCallback, x.xGet) | |
| 1259 | + | return func(CbDataVar uintptr, SourceVar *Source, FuncVar *SourceFunc, DataVar uintptr) { | |
| 1260 | + | rawCallback(CbDataVar, SourceVar, NewCallback(FuncVar), DataVar) | |
| 1261 | + | } | |
| 1262 | + | } | |
| 1263 | + | ||
| 1189 | 1264 | // The `GSourceFuncs` struct contains a table of | |
| 1190 | 1265 | // functions used to handle event sources in a generic manner. | |
| 1191 | 1266 | // | |
| @@ -1209,6 +1284,14 @@ func (x *SourceCallbackFuncs) GoPointer() uintptr { | |||
| 1209 | 1284 | type SourceFuncs struct { | |
| 1210 | 1285 | _ structs.HostLayout | |
| 1211 | 1286 | ||
| 1287 | + | xPrepare uintptr | |
| 1288 | + | ||
| 1289 | + | xCheck uintptr | |
| 1290 | + | ||
| 1291 | + | xDispatch uintptr | |
| 1292 | + | ||
| 1293 | + | xFinalize uintptr | |
| 1294 | + | ||
| 1212 | 1295 | ClosureCallback SourceFunc | |
| 1213 | 1296 | ||
| 1214 | 1297 | ClosureMarshal SourceDummyMarshal | |
| @@ -1218,6 +1301,98 @@ func (x *SourceFuncs) GoPointer() uintptr { | |||
| 1218 | 1301 | return uintptr(unsafe.Pointer(x)) | |
| 1219 | 1302 | } | |
| 1220 | 1303 | ||
| 1304 | + | // OverridePrepare sets the callback function. | |
| 1305 | + | func (x *SourceFuncs) OverridePrepare(cb func(*Source, int) bool) { | |
| 1306 | + | if cb == nil { | |
| 1307 | + | x.xPrepare = 0 | |
| 1308 | + | } else { | |
| 1309 | + | x.xPrepare = purego.NewCallback(func(SourceVarp *Source, TimeoutVarp int) bool { | |
| 1310 | + | return cb(SourceVarp, TimeoutVarp) | |
| 1311 | + | }) | |
| 1312 | + | } | |
| 1313 | + | } | |
| 1314 | + | ||
| 1315 | + | // GetPrepare gets the callback function. | |
| 1316 | + | func (x *SourceFuncs) GetPrepare() func(*Source, int) bool { | |
| 1317 | + | if x.xPrepare == 0 { | |
| 1318 | + | return nil | |
| 1319 | + | } | |
| 1320 | + | var rawCallback func(SourceVarp *Source, TimeoutVarp int) bool | |
| 1321 | + | purego.RegisterFunc(&rawCallback, x.xPrepare) | |
| 1322 | + | return func(SourceVar *Source, TimeoutVar int) bool { | |
| 1323 | + | return rawCallback(SourceVar, TimeoutVar) | |
| 1324 | + | } | |
| 1325 | + | } | |
| 1326 | + | ||
| 1327 | + | // OverrideCheck sets the callback function. | |
| 1328 | + | func (x *SourceFuncs) OverrideCheck(cb func(*Source) bool) { | |
| 1329 | + | if cb == nil { | |
| 1330 | + | x.xCheck = 0 | |
| 1331 | + | } else { | |
| 1332 | + | x.xCheck = purego.NewCallback(func(SourceVarp *Source) bool { | |
| 1333 | + | return cb(SourceVarp) | |
| 1334 | + | }) | |
| 1335 | + | } | |
| 1336 | + | } | |
| 1337 | + | ||
| 1338 | + | // GetCheck gets the callback function. | |
| 1339 | + | func (x *SourceFuncs) GetCheck() func(*Source) bool { | |
| 1340 | + | if x.xCheck == 0 { | |
| 1341 | + | return nil | |
| 1342 | + | } | |
| 1343 | + | var rawCallback func(SourceVarp *Source) bool | |
| 1344 | + | purego.RegisterFunc(&rawCallback, x.xCheck) | |
| 1345 | + | return func(SourceVar *Source) bool { | |
| 1346 | + | return rawCallback(SourceVar) | |
| 1347 | + | } | |
| 1348 | + | } | |
| 1349 | + | ||
| 1350 | + | // OverrideDispatch sets the callback function. | |
| 1351 | + | func (x *SourceFuncs) OverrideDispatch(cb func(*Source, *SourceFunc, uintptr) bool) { | |
| 1352 | + | if cb == nil { | |
| 1353 | + | x.xDispatch = 0 | |
| 1354 | + | } else { | |
| 1355 | + | x.xDispatch = purego.NewCallback(func(SourceVarp *Source, CallbackVarp uintptr, UserDataVarp uintptr) bool { | |
| 1356 | + | return cb(SourceVarp, (*SourceFunc)(unsafe.Pointer(CallbackVarp)), UserDataVarp) | |
| 1357 | + | }) | |
| 1358 | + | } | |
| 1359 | + | } | |
| 1360 | + | ||
| 1361 | + | // GetDispatch gets the callback function. | |
| 1362 | + | func (x *SourceFuncs) GetDispatch() func(*Source, *SourceFunc, uintptr) bool { | |
| 1363 | + | if x.xDispatch == 0 { | |
| 1364 | + | return nil | |
| 1365 | + | } | |
| 1366 | + | var rawCallback func(SourceVarp *Source, CallbackVarp uintptr, UserDataVarp uintptr) bool | |
| 1367 | + | purego.RegisterFunc(&rawCallback, x.xDispatch) | |
| 1368 | + | return func(SourceVar *Source, CallbackVar *SourceFunc, UserDataVar uintptr) bool { | |
| 1369 | + | return rawCallback(SourceVar, NewCallback(CallbackVar), UserDataVar) | |
| 1370 | + | } | |
| 1371 | + | } | |
| 1372 | + | ||
| 1373 | + | // OverrideFinalize sets the callback function. | |
| 1374 | + | func (x *SourceFuncs) OverrideFinalize(cb func(*Source)) { | |
| 1375 | + | if cb == nil { | |
| 1376 | + | x.xFinalize = 0 | |
| 1377 | + | } else { | |
| 1378 | + | x.xFinalize = purego.NewCallback(func(SourceVarp *Source) { | |
| 1379 | + | cb(SourceVarp) | |
| 1380 | + | }) | |
| 1381 | + | } | |
| 1382 | + | } | |
| 1383 | + | ||
| 1384 | + | // GetFinalize gets the callback function. | |
| 1385 | + | func (x *SourceFuncs) GetFinalize() func(*Source) { | |
| 1386 | + | if x.xFinalize == 0 { | |
| 1387 | + | return nil | |
| 1388 | + | } | |
| 1389 | + | var rawCallback func(SourceVarp *Source) | |
| 1390 | + | purego.RegisterFunc(&rawCallback, x.xFinalize) | |
| 1391 | + | return func(SourceVar *Source) { | |
| 1392 | + | rawCallback(SourceVar) | |
| 1393 | + | } | |
| 1394 | + | } | |
| 1395 | + | ||
| 1221 | 1396 | type SourcePrivate struct { | |
| 1222 | 1397 | _ structs.HostLayout | |
| 1223 | 1398 | } | |
M v4/glib/gmarkup.go +125 -0
| @@ -336,12 +336,137 @@ func (x *MarkupParseContext) Unref() { | |||
| 336 | 336 | // back to its caller. | |
| 337 | 337 | type MarkupParser struct { | |
| 338 | 338 | _ structs.HostLayout | |
| 339 | + | ||
| 340 | + | xStartElement uintptr | |
| 341 | + | ||
| 342 | + | xEndElement uintptr | |
| 343 | + | ||
| 344 | + | xText uintptr | |
| 345 | + | ||
| 346 | + | xPassthrough uintptr | |
| 347 | + | ||
| 348 | + | xError uintptr | |
| 339 | 349 | } | |
| 340 | 350 | ||
| 341 | 351 | func (x *MarkupParser) GoPointer() uintptr { | |
| 342 | 352 | return uintptr(unsafe.Pointer(x)) | |
| 343 | 353 | } | |
| 344 | 354 | ||
| 355 | + | // OverrideStartElement sets the callback function. | |
| 356 | + | func (x *MarkupParser) OverrideStartElement(cb func(*MarkupParseContext, string, string, string, uintptr)) { | |
| 357 | + | if cb == nil { | |
| 358 | + | x.xStartElement = 0 | |
| 359 | + | } else { | |
| 360 | + | x.xStartElement = purego.NewCallback(func(ContextVarp *MarkupParseContext, ElementNameVarp string, AttributeNamesVarp string, AttributeValuesVarp string, UserDataVarp uintptr) { | |
| 361 | + | cb(ContextVarp, ElementNameVarp, AttributeNamesVarp, AttributeValuesVarp, UserDataVarp) | |
| 362 | + | }) | |
| 363 | + | } | |
| 364 | + | } | |
| 365 | + | ||
| 366 | + | // GetStartElement gets the callback function. | |
| 367 | + | func (x *MarkupParser) GetStartElement() func(*MarkupParseContext, string, string, string, uintptr) { | |
| 368 | + | if x.xStartElement == 0 { | |
| 369 | + | return nil | |
| 370 | + | } | |
| 371 | + | var rawCallback func(ContextVarp *MarkupParseContext, ElementNameVarp string, AttributeNamesVarp string, AttributeValuesVarp string, UserDataVarp uintptr) | |
| 372 | + | purego.RegisterFunc(&rawCallback, x.xStartElement) | |
| 373 | + | return func(ContextVar *MarkupParseContext, ElementNameVar string, AttributeNamesVar string, AttributeValuesVar string, UserDataVar uintptr) { | |
| 374 | + | rawCallback(ContextVar, ElementNameVar, AttributeNamesVar, AttributeValuesVar, UserDataVar) | |
| 375 | + | } | |
| 376 | + | } | |
| 377 | + | ||
| 378 | + | // OverrideEndElement sets the callback function. | |
| 379 | + | func (x *MarkupParser) OverrideEndElement(cb func(*MarkupParseContext, string, uintptr)) { | |
| 380 | + | if cb == nil { | |
| 381 | + | x.xEndElement = 0 | |
| 382 | + | } else { | |
| 383 | + | x.xEndElement = purego.NewCallback(func(ContextVarp *MarkupParseContext, ElementNameVarp string, UserDataVarp uintptr) { | |
| 384 | + | cb(ContextVarp, ElementNameVarp, UserDataVarp) | |
| 385 | + | }) | |
| 386 | + | } | |
| 387 | + | } | |
| 388 | + | ||
| 389 | + | // GetEndElement gets the callback function. | |
| 390 | + | func (x *MarkupParser) GetEndElement() func(*MarkupParseContext, string, uintptr) { | |
| 391 | + | if x.xEndElement == 0 { | |
| 392 | + | return nil | |
| 393 | + | } | |
| 394 | + | var rawCallback func(ContextVarp *MarkupParseContext, ElementNameVarp string, UserDataVarp uintptr) | |
| 395 | + | purego.RegisterFunc(&rawCallback, x.xEndElement) | |
| 396 | + | return func(ContextVar *MarkupParseContext, ElementNameVar string, UserDataVar uintptr) { | |
| 397 | + | rawCallback(ContextVar, ElementNameVar, UserDataVar) | |
| 398 | + | } | |
| 399 | + | } | |
| 400 | + | ||
| 401 | + | // OverrideText sets the callback function. | |
| 402 | + | func (x *MarkupParser) OverrideText(cb func(*MarkupParseContext, string, uint, uintptr)) { | |
| 403 | + | if cb == nil { | |
| 404 | + | x.xText = 0 | |
| 405 | + | } else { | |
| 406 | + | x.xText = purego.NewCallback(func(ContextVarp *MarkupParseContext, TextVarp string, TextLenVarp uint, UserDataVarp uintptr) { | |
| 407 | + | cb(ContextVarp, TextVarp, TextLenVarp, UserDataVarp) | |
| 408 | + | }) | |
| 409 | + | } | |
| 410 | + | } | |
| 411 | + | ||
| 412 | + | // GetText gets the callback function. | |
| 413 | + | func (x *MarkupParser) GetText() func(*MarkupParseContext, string, uint, uintptr) { | |
| 414 | + | if x.xText == 0 { | |
| 415 | + | return nil | |
| 416 | + | } | |
| 417 | + | var rawCallback func(ContextVarp *MarkupParseContext, TextVarp string, TextLenVarp uint, UserDataVarp uintptr) | |
| 418 | + | purego.RegisterFunc(&rawCallback, x.xText) | |
| 419 | + | return func(ContextVar *MarkupParseContext, TextVar string, TextLenVar uint, UserDataVar uintptr) { | |
| 420 | + | rawCallback(ContextVar, TextVar, TextLenVar, UserDataVar) | |
| 421 | + | } | |
| 422 | + | } | |
| 423 | + | ||
| 424 | + | // OverridePassthrough sets the callback function. | |
| 425 | + | func (x *MarkupParser) OverridePassthrough(cb func(*MarkupParseContext, string, uint, uintptr)) { | |
| 426 | + | if cb == nil { | |
| 427 | + | x.xPassthrough = 0 | |
| 428 | + | } else { | |
| 429 | + | x.xPassthrough = purego.NewCallback(func(ContextVarp *MarkupParseContext, PassthroughTextVarp string, TextLenVarp uint, UserDataVarp uintptr) { | |
| 430 | + | cb(ContextVarp, PassthroughTextVarp, TextLenVarp, UserDataVarp) | |
| 431 | + | }) | |
| 432 | + | } | |
| 433 | + | } | |
| 434 | + | ||
| 435 | + | // GetPassthrough gets the callback function. | |
| 436 | + | func (x *MarkupParser) GetPassthrough() func(*MarkupParseContext, string, uint, uintptr) { | |
| 437 | + | if x.xPassthrough == 0 { | |
| 438 | + | return nil | |
| 439 | + | } | |
| 440 | + | var rawCallback func(ContextVarp *MarkupParseContext, PassthroughTextVarp string, TextLenVarp uint, UserDataVarp uintptr) | |
| 441 | + | purego.RegisterFunc(&rawCallback, x.xPassthrough) | |
| 442 | + | return func(ContextVar *MarkupParseContext, PassthroughTextVar string, TextLenVar uint, UserDataVar uintptr) { | |
| 443 | + | rawCallback(ContextVar, PassthroughTextVar, TextLenVar, UserDataVar) | |
| 444 | + | } | |
| 445 | + | } | |
| 446 | + | ||
| 447 | + | // OverrideError sets the callback function. | |
| 448 | + | func (x *MarkupParser) OverrideError(cb func(*MarkupParseContext, *Error, uintptr)) { | |
| 449 | + | if cb == nil { | |
| 450 | + | x.xError = 0 | |
| 451 | + | } else { | |
| 452 | + | x.xError = purego.NewCallback(func(ContextVarp *MarkupParseContext, ErrorVarp *Error, UserDataVarp uintptr) { | |
| 453 | + | cb(ContextVarp, ErrorVarp, UserDataVarp) | |
| 454 | + | }) | |
| 455 | + | } | |
| 456 | + | } | |
| 457 | + | ||
| 458 | + | // GetError gets the callback function. | |
| 459 | + | func (x *MarkupParser) GetError() func(*MarkupParseContext, *Error, uintptr) { | |
| 460 | + | if x.xError == 0 { | |
| 461 | + | return nil | |
| 462 | + | } | |
| 463 | + | var rawCallback func(ContextVarp *MarkupParseContext, ErrorVarp *Error, UserDataVarp uintptr) | |
| 464 | + | purego.RegisterFunc(&rawCallback, x.xError) | |
| 465 | + | return func(ContextVar *MarkupParseContext, ErrorVar *Error, UserDataVar uintptr) { | |
| 466 | + | rawCallback(ContextVar, ErrorVar, UserDataVar) | |
| 467 | + | } | |
| 468 | + | } | |
| 469 | + | ||
| 345 | 470 | // A mixed enumerated type and flags field. You must specify one type | |
| 346 | 471 | // (string, strdup, boolean, tristate). Additionally, you may optionally | |
| 347 | 472 | // bitwise OR the type with the flag %G_MARKUP_COLLECT_OPTIONAL. | |
M v4/glib/gmem.go +150 -0
| @@ -16,12 +16,162 @@ import ( | |||
| 16 | 16 | // This functions related to this has been deprecated in 2.46, and no longer work. | |
| 17 | 17 | type MemVTable struct { | |
| 18 | 18 | _ structs.HostLayout | |
| 19 | + | ||
| 20 | + | xMalloc uintptr | |
| 21 | + | ||
| 22 | + | xRealloc uintptr | |
| 23 | + | ||
| 24 | + | xFree uintptr | |
| 25 | + | ||
| 26 | + | xCalloc uintptr | |
| 27 | + | ||
| 28 | + | xTryMalloc uintptr | |
| 29 | + | ||
| 30 | + | xTryRealloc uintptr | |
| 19 | 31 | } | |
| 20 | 32 | ||
| 21 | 33 | func (x *MemVTable) GoPointer() uintptr { | |
| 22 | 34 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 35 | } | |
| 24 | 36 | ||
| 37 | + | // OverrideMalloc sets the callback function. | |
| 38 | + | func (x *MemVTable) OverrideMalloc(cb func(uint) uintptr) { | |
| 39 | + | if cb == nil { | |
| 40 | + | x.xMalloc = 0 | |
| 41 | + | } else { | |
| 42 | + | x.xMalloc = purego.NewCallback(func(NBytesVarp uint) uintptr { | |
| 43 | + | return cb(NBytesVarp) | |
| 44 | + | }) | |
| 45 | + | } | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | // GetMalloc gets the callback function. | |
| 49 | + | func (x *MemVTable) GetMalloc() func(uint) uintptr { | |
| 50 | + | if x.xMalloc == 0 { | |
| 51 | + | return nil | |
| 52 | + | } | |
| 53 | + | var rawCallback func(NBytesVarp uint) uintptr | |
| 54 | + | purego.RegisterFunc(&rawCallback, x.xMalloc) | |
| 55 | + | return func(NBytesVar uint) uintptr { | |
| 56 | + | return rawCallback(NBytesVar) | |
| 57 | + | } | |
| 58 | + | } | |
| 59 | + | ||
| 60 | + | // OverrideRealloc sets the callback function. | |
| 61 | + | func (x *MemVTable) OverrideRealloc(cb func(uintptr, uint) uintptr) { | |
| 62 | + | if cb == nil { | |
| 63 | + | x.xRealloc = 0 | |
| 64 | + | } else { | |
| 65 | + | x.xRealloc = purego.NewCallback(func(MemVarp uintptr, NBytesVarp uint) uintptr { | |
| 66 | + | return cb(MemVarp, NBytesVarp) | |
| 67 | + | }) | |
| 68 | + | } | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | // GetRealloc gets the callback function. | |
| 72 | + | func (x *MemVTable) GetRealloc() func(uintptr, uint) uintptr { | |
| 73 | + | if x.xRealloc == 0 { | |
| 74 | + | return nil | |
| 75 | + | } | |
| 76 | + | var rawCallback func(MemVarp uintptr, NBytesVarp uint) uintptr | |
| 77 | + | purego.RegisterFunc(&rawCallback, x.xRealloc) | |
| 78 | + | return func(MemVar uintptr, NBytesVar uint) uintptr { | |
| 79 | + | return rawCallback(MemVar, NBytesVar) | |
| 80 | + | } | |
| 81 | + | } | |
| 82 | + | ||
| 83 | + | // OverrideFree sets the callback function. | |
| 84 | + | func (x *MemVTable) OverrideFree(cb func(uintptr)) { | |
| 85 | + | if cb == nil { | |
| 86 | + | x.xFree = 0 | |
| 87 | + | } else { | |
| 88 | + | x.xFree = purego.NewCallback(func(MemVarp uintptr) { | |
| 89 | + | cb(MemVarp) | |
| 90 | + | }) | |
| 91 | + | } | |
| 92 | + | } | |
| 93 | + | ||
| 94 | + | // GetFree gets the callback function. | |
| 95 | + | func (x *MemVTable) GetFree() func(uintptr) { | |
| 96 | + | if x.xFree == 0 { | |
| 97 | + | return nil | |
| 98 | + | } | |
| 99 | + | var rawCallback func(MemVarp uintptr) | |
| 100 | + | purego.RegisterFunc(&rawCallback, x.xFree) | |
| 101 | + | return func(MemVar uintptr) { | |
| 102 | + | rawCallback(MemVar) | |
| 103 | + | } | |
| 104 | + | } | |
| 105 | + | ||
| 106 | + | // OverrideCalloc sets the callback function. | |
| 107 | + | func (x *MemVTable) OverrideCalloc(cb func(uint, uint) uintptr) { | |
| 108 | + | if cb == nil { | |
| 109 | + | x.xCalloc = 0 | |
| 110 | + | } else { | |
| 111 | + | x.xCalloc = purego.NewCallback(func(NBlocksVarp uint, NBlockBytesVarp uint) uintptr { | |
| 112 | + | return cb(NBlocksVarp, NBlockBytesVarp) | |
| 113 | + | }) | |
| 114 | + | } | |
| 115 | + | } | |
| 116 | + | ||
| 117 | + | // GetCalloc gets the callback function. | |
| 118 | + | func (x *MemVTable) GetCalloc() func(uint, uint) uintptr { | |
| 119 | + | if x.xCalloc == 0 { | |
| 120 | + | return nil | |
| 121 | + | } | |
| 122 | + | var rawCallback func(NBlocksVarp uint, NBlockBytesVarp uint) uintptr | |
| 123 | + | purego.RegisterFunc(&rawCallback, x.xCalloc) | |
| 124 | + | return func(NBlocksVar uint, NBlockBytesVar uint) uintptr { | |
| 125 | + | return rawCallback(NBlocksVar, NBlockBytesVar) | |
| 126 | + | } | |
| 127 | + | } | |
| 128 | + | ||
| 129 | + | // OverrideTryMalloc sets the callback function. | |
| 130 | + | func (x *MemVTable) OverrideTryMalloc(cb func(uint) uintptr) { | |
| 131 | + | if cb == nil { | |
| 132 | + | x.xTryMalloc = 0 | |
| 133 | + | } else { | |
| 134 | + | x.xTryMalloc = purego.NewCallback(func(NBytesVarp uint) uintptr { | |
| 135 | + | return cb(NBytesVarp) | |
| 136 | + | }) | |
| 137 | + | } | |
| 138 | + | } | |
| 139 | + | ||
| 140 | + | // GetTryMalloc gets the callback function. | |
| 141 | + | func (x *MemVTable) GetTryMalloc() func(uint) uintptr { | |
| 142 | + | if x.xTryMalloc == 0 { | |
| 143 | + | return nil | |
| 144 | + | } | |
| 145 | + | var rawCallback func(NBytesVarp uint) uintptr | |
| 146 | + | purego.RegisterFunc(&rawCallback, x.xTryMalloc) | |
| 147 | + | return func(NBytesVar uint) uintptr { | |
| 148 | + | return rawCallback(NBytesVar) | |
| 149 | + | } | |
| 150 | + | } | |
| 151 | + | ||
| 152 | + | // OverrideTryRealloc sets the callback function. | |
| 153 | + | func (x *MemVTable) OverrideTryRealloc(cb func(uintptr, uint) uintptr) { | |
| 154 | + | if cb == nil { | |
| 155 | + | x.xTryRealloc = 0 | |
| 156 | + | } else { | |
| 157 | + | x.xTryRealloc = purego.NewCallback(func(MemVarp uintptr, NBytesVarp uint) uintptr { | |
| 158 | + | return cb(MemVarp, NBytesVarp) | |
| 159 | + | }) | |
| 160 | + | } | |
| 161 | + | } | |
| 162 | + | ||
| 163 | + | // GetTryRealloc gets the callback function. | |
| 164 | + | func (x *MemVTable) GetTryRealloc() func(uintptr, uint) uintptr { | |
| 165 | + | if x.xTryRealloc == 0 { | |
| 166 | + | return nil | |
| 167 | + | } | |
| 168 | + | var rawCallback func(MemVarp uintptr, NBytesVarp uint) uintptr | |
| 169 | + | purego.RegisterFunc(&rawCallback, x.xTryRealloc) | |
| 170 | + | return func(MemVar uintptr, NBytesVar uint) uintptr { | |
| 171 | + | return rawCallback(MemVar, NBytesVar) | |
| 172 | + | } | |
| 173 | + | } | |
| 174 | + | ||
| 25 | 175 | var xAlignedAlloc func(uint, uint, uint) uintptr | |
| 26 | 176 | ||
| 27 | 177 | // This function is similar to g_malloc(), allocating (@n_blocks * @n_block_bytes) | |
M v4/gobject/gclosure.go +25 -0
| @@ -113,6 +113,8 @@ type Closure struct { | |||
| 113 | 113 | ||
| 114 | 114 | IsInvalid uint | |
| 115 | 115 | ||
| 116 | + | xMarshal uintptr | |
| 117 | + | ||
| 116 | 118 | Data uintptr | |
| 117 | 119 | ||
| 118 | 120 | Notifiers *ClosureNotifyData | |
| @@ -409,6 +411,29 @@ func (x *Closure) Unref() { | |||
| 409 | 411 | ||
| 410 | 412 | } | |
| 411 | 413 | ||
| 414 | + | // OverrideMarshal sets the callback function. | |
| 415 | + | func (x *Closure) OverrideMarshal(cb func(*Closure, *Value, uint, *Value, uintptr, uintptr)) { | |
| 416 | + | if cb == nil { | |
| 417 | + | x.xMarshal = 0 | |
| 418 | + | } else { | |
| 419 | + | x.xMarshal = purego.NewCallback(func(ClosureVarp *Closure, ReturnValueVarp *Value, NParamValuesVarp uint, ParamValuesVarp *Value, InvocationHintVarp uintptr, MarshalDataVarp uintptr) { | |
| 420 | + | cb(ClosureVarp, ReturnValueVarp, NParamValuesVarp, ParamValuesVarp, InvocationHintVarp, MarshalDataVarp) | |
| 421 | + | }) | |
| 422 | + | } | |
| 423 | + | } | |
| 424 | + | ||
| 425 | + | // GetMarshal gets the callback function. | |
| 426 | + | func (x *Closure) GetMarshal() func(*Closure, *Value, uint, *Value, uintptr, uintptr) { | |
| 427 | + | if x.xMarshal == 0 { | |
| 428 | + | return nil | |
| 429 | + | } | |
| 430 | + | var rawCallback func(ClosureVarp *Closure, ReturnValueVarp *Value, NParamValuesVarp uint, ParamValuesVarp *Value, InvocationHintVarp uintptr, MarshalDataVarp uintptr) | |
| 431 | + | purego.RegisterFunc(&rawCallback, x.xMarshal) | |
| 432 | + | return func(ClosureVar *Closure, ReturnValueVar *Value, NParamValuesVar uint, ParamValuesVar *Value, InvocationHintVar uintptr, MarshalDataVar uintptr) { | |
| 433 | + | rawCallback(ClosureVar, ReturnValueVar, NParamValuesVar, ParamValuesVar, InvocationHintVar, MarshalDataVar) | |
| 434 | + | } | |
| 435 | + | } | |
| 436 | + | ||
| 412 | 437 | type ClosureNotifyData struct { | |
| 413 | 438 | _ structs.HostLayout | |
| 414 | 439 | ||
M v4/gobject/gobject.go +428 -2
| @@ -47,6 +47,22 @@ type InitiallyUnownedClass struct { | |||
| 47 | 47 | ||
| 48 | 48 | ConstructProperties *glib.SList | |
| 49 | 49 | ||
| 50 | + | xConstructor uintptr | |
| 51 | + | ||
| 52 | + | xSetProperty uintptr | |
| 53 | + | ||
| 54 | + | xGetProperty uintptr | |
| 55 | + | ||
| 56 | + | xDispose uintptr | |
| 57 | + | ||
| 58 | + | xFinalize uintptr | |
| 59 | + | ||
| 60 | + | xDispatchPropertiesChanged uintptr | |
| 61 | + | ||
| 62 | + | xNotify uintptr | |
| 63 | + | ||
| 64 | + | xConstructed uintptr | |
| 65 | + | ||
| 50 | 66 | Flags uint | |
| 51 | 67 | ||
| 52 | 68 | Pdummy [6]uintptr | |
| @@ -56,6 +72,200 @@ func (x *InitiallyUnownedClass) GoPointer() uintptr { | |||
| 56 | 72 | return uintptr(unsafe.Pointer(x)) | |
| 57 | 73 | } | |
| 58 | 74 | ||
| 75 | + | // OverrideConstructor sets the callback function. | |
| 76 | + | func (x *InitiallyUnownedClass) OverrideConstructor(cb func(types.GType, uint, *ObjectConstructParam) *Object) { | |
| 77 | + | if cb == nil { | |
| 78 | + | x.xConstructor = 0 | |
| 79 | + | } else { | |
| 80 | + | x.xConstructor = purego.NewCallback(func(TypeVarp types.GType, NConstructPropertiesVarp uint, ConstructPropertiesVarp *ObjectConstructParam) uintptr { | |
| 81 | + | ret := cb(TypeVarp, NConstructPropertiesVarp, ConstructPropertiesVarp) | |
| 82 | + | if ret == nil { | |
| 83 | + | return 0 | |
| 84 | + | } | |
| 85 | + | return ret.GoPointer() | |
| 86 | + | }) | |
| 87 | + | } | |
| 88 | + | } | |
| 89 | + | ||
| 90 | + | // GetConstructor gets the callback function. | |
| 91 | + | func (x *InitiallyUnownedClass) GetConstructor() func(types.GType, uint, *ObjectConstructParam) *Object { | |
| 92 | + | if x.xConstructor == 0 { | |
| 93 | + | return nil | |
| 94 | + | } | |
| 95 | + | var rawCallback func(TypeVarp types.GType, NConstructPropertiesVarp uint, ConstructPropertiesVarp *ObjectConstructParam) uintptr | |
| 96 | + | purego.RegisterFunc(&rawCallback, x.xConstructor) | |
| 97 | + | return func(TypeVar types.GType, NConstructPropertiesVar uint, ConstructPropertiesVar *ObjectConstructParam) *Object { | |
| 98 | + | rawRet := rawCallback(TypeVar, NConstructPropertiesVar, ConstructPropertiesVar) | |
| 99 | + | if rawRet == 0 { | |
| 100 | + | return nil | |
| 101 | + | } | |
| 102 | + | ret := &Object{} | |
| 103 | + | ret.Ptr = rawRet | |
| 104 | + | return ret | |
| 105 | + | } | |
| 106 | + | } | |
| 107 | + | ||
| 108 | + | // OverrideSetProperty sets the callback function. | |
| 109 | + | func (x *InitiallyUnownedClass) OverrideSetProperty(cb func(*Object, uint, *Value, *ParamSpec)) { | |
| 110 | + | if cb == nil { | |
| 111 | + | x.xSetProperty = 0 | |
| 112 | + | } else { | |
| 113 | + | x.xSetProperty = purego.NewCallback(func(ObjectVarp uintptr, PropertyIdVarp uint, ValueVarp *Value, PspecVarp uintptr) { | |
| 114 | + | cb(ObjectNewFromInternalPtr(ObjectVarp), PropertyIdVarp, ValueVarp, ParamSpecNewFromInternalPtr(PspecVarp)) | |
| 115 | + | }) | |
| 116 | + | } | |
| 117 | + | } | |
| 118 | + | ||
| 119 | + | // GetSetProperty gets the callback function. | |
| 120 | + | func (x *InitiallyUnownedClass) GetSetProperty() func(*Object, uint, *Value, *ParamSpec) { | |
| 121 | + | if x.xSetProperty == 0 { | |
| 122 | + | return nil | |
| 123 | + | } | |
| 124 | + | var rawCallback func(ObjectVarp uintptr, PropertyIdVarp uint, ValueVarp *Value, PspecVarp uintptr) | |
| 125 | + | purego.RegisterFunc(&rawCallback, x.xSetProperty) | |
| 126 | + | return func(ObjectVar *Object, PropertyIdVar uint, ValueVar *Value, PspecVar *ParamSpec) { | |
| 127 | + | rawCallback(ObjectVar.GoPointer(), PropertyIdVar, ValueVar, PspecVar.GoPointer()) | |
| 128 | + | } | |
| 129 | + | } | |
| 130 | + | ||
| 131 | + | // OverrideGetProperty sets the callback function. | |
| 132 | + | func (x *InitiallyUnownedClass) OverrideGetProperty(cb func(*Object, uint, *Value, *ParamSpec)) { | |
| 133 | + | if cb == nil { | |
| 134 | + | x.xGetProperty = 0 | |
| 135 | + | } else { | |
| 136 | + | x.xGetProperty = purego.NewCallback(func(ObjectVarp uintptr, PropertyIdVarp uint, ValueVarp *Value, PspecVarp uintptr) { | |
| 137 | + | cb(ObjectNewFromInternalPtr(ObjectVarp), PropertyIdVarp, ValueVarp, ParamSpecNewFromInternalPtr(PspecVarp)) | |
| 138 | + | }) | |
| 139 | + | } | |
| 140 | + | } | |
| 141 | + | ||
| 142 | + | // GetGetProperty gets the callback function. | |
| 143 | + | func (x *InitiallyUnownedClass) GetGetProperty() func(*Object, uint, *Value, *ParamSpec) { | |
| 144 | + | if x.xGetProperty == 0 { | |
| 145 | + | return nil | |
| 146 | + | } | |
| 147 | + | var rawCallback func(ObjectVarp uintptr, PropertyIdVarp uint, ValueVarp *Value, PspecVarp uintptr) | |
| 148 | + | purego.RegisterFunc(&rawCallback, x.xGetProperty) | |
| 149 | + | return func(ObjectVar *Object, PropertyIdVar uint, ValueVar *Value, PspecVar *ParamSpec) { | |
| 150 | + | rawCallback(ObjectVar.GoPointer(), PropertyIdVar, ValueVar, PspecVar.GoPointer()) | |
| 151 | + | } | |
| 152 | + | } | |
| 153 | + | ||
| 154 | + | // OverrideDispose sets the callback function. | |
| 155 | + | func (x *InitiallyUnownedClass) OverrideDispose(cb func(*Object)) { | |
| 156 | + | if cb == nil { | |
| 157 | + | x.xDispose = 0 | |
| 158 | + | } else { | |
| 159 | + | x.xDispose = purego.NewCallback(func(ObjectVarp uintptr) { | |
| 160 | + | cb(ObjectNewFromInternalPtr(ObjectVarp)) | |
| 161 | + | }) | |
| 162 | + | } | |
| 163 | + | } | |
| 164 | + | ||
| 165 | + | // GetDispose gets the callback function. | |
| 166 | + | func (x *InitiallyUnownedClass) GetDispose() func(*Object) { | |
| 167 | + | if x.xDispose == 0 { | |
| 168 | + | return nil | |
| 169 | + | } | |
| 170 | + | var rawCallback func(ObjectVarp uintptr) | |
| 171 | + | purego.RegisterFunc(&rawCallback, x.xDispose) | |
| 172 | + | return func(ObjectVar *Object) { | |
| 173 | + | rawCallback(ObjectVar.GoPointer()) | |
| 174 | + | } | |
| 175 | + | } | |
| 176 | + | ||
| 177 | + | // OverrideFinalize sets the callback function. | |
| 178 | + | func (x *InitiallyUnownedClass) OverrideFinalize(cb func(*Object)) { | |
| 179 | + | if cb == nil { | |
| 180 | + | x.xFinalize = 0 | |
| 181 | + | } else { | |
| 182 | + | x.xFinalize = purego.NewCallback(func(ObjectVarp uintptr) { | |
| 183 | + | cb(ObjectNewFromInternalPtr(ObjectVarp)) | |
| 184 | + | }) | |
| 185 | + | } | |
| 186 | + | } | |
| 187 | + | ||
| 188 | + | // GetFinalize gets the callback function. | |
| 189 | + | func (x *InitiallyUnownedClass) GetFinalize() func(*Object) { | |
| 190 | + | if x.xFinalize == 0 { | |
| 191 | + | return nil | |
| 192 | + | } | |
| 193 | + | var rawCallback func(ObjectVarp uintptr) | |
| 194 | + | purego.RegisterFunc(&rawCallback, x.xFinalize) | |
| 195 | + | return func(ObjectVar *Object) { | |
| 196 | + | rawCallback(ObjectVar.GoPointer()) | |
| 197 | + | } | |
| 198 | + | } | |
| 199 | + | ||
| 200 | + | // OverrideDispatchPropertiesChanged sets the callback function. | |
| 201 | + | func (x *InitiallyUnownedClass) OverrideDispatchPropertiesChanged(cb func(*Object, uint, **ParamSpec)) { | |
| 202 | + | if cb == nil { | |
| 203 | + | x.xDispatchPropertiesChanged = 0 | |
| 204 | + | } else { | |
| 205 | + | x.xDispatchPropertiesChanged = purego.NewCallback(func(ObjectVarp uintptr, NPspecsVarp uint, PspecsVarp uintptr) { | |
| 206 | + | cb(ObjectNewFromInternalPtr(ObjectVarp), NPspecsVarp, (**ParamSpec)(unsafe.Pointer(PspecsVarp))) | |
| 207 | + | }) | |
| 208 | + | } | |
| 209 | + | } | |
| 210 | + | ||
| 211 | + | // GetDispatchPropertiesChanged gets the callback function. | |
| 212 | + | func (x *InitiallyUnownedClass) GetDispatchPropertiesChanged() func(*Object, uint, **ParamSpec) { | |
| 213 | + | if x.xDispatchPropertiesChanged == 0 { | |
| 214 | + | return nil | |
| 215 | + | } | |
| 216 | + | var rawCallback func(ObjectVarp uintptr, NPspecsVarp uint, PspecsVarp uintptr) | |
| 217 | + | purego.RegisterFunc(&rawCallback, x.xDispatchPropertiesChanged) | |
| 218 | + | return func(ObjectVar *Object, NPspecsVar uint, PspecsVar **ParamSpec) { | |
| 219 | + | rawCallback(ObjectVar.GoPointer(), NPspecsVar, *ConvertPtr(PspecsVar)) | |
| 220 | + | } | |
| 221 | + | } | |
| 222 | + | ||
| 223 | + | // OverrideNotify sets the callback function. | |
| 224 | + | func (x *InitiallyUnownedClass) OverrideNotify(cb func(*Object, *ParamSpec)) { | |
| 225 | + | if cb == nil { | |
| 226 | + | x.xNotify = 0 | |
| 227 | + | } else { | |
| 228 | + | x.xNotify = purego.NewCallback(func(ObjectVarp uintptr, PspecVarp uintptr) { | |
| 229 | + | cb(ObjectNewFromInternalPtr(ObjectVarp), ParamSpecNewFromInternalPtr(PspecVarp)) | |
| 230 | + | }) | |
| 231 | + | } | |
| 232 | + | } | |
| 233 | + | ||
| 234 | + | // GetNotify gets the callback function. | |
| 235 | + | func (x *InitiallyUnownedClass) GetNotify() func(*Object, *ParamSpec) { | |
| 236 | + | if x.xNotify == 0 { | |
| 237 | + | return nil | |
| 238 | + | } | |
| 239 | + | var rawCallback func(ObjectVarp uintptr, PspecVarp uintptr) | |
| 240 | + | purego.RegisterFunc(&rawCallback, x.xNotify) | |
| 241 | + | return func(ObjectVar *Object, PspecVar *ParamSpec) { | |
| 242 | + | rawCallback(ObjectVar.GoPointer(), PspecVar.GoPointer()) | |
| 243 | + | } | |
| 244 | + | } | |
| 245 | + | ||
| 246 | + | // OverrideConstructed sets the callback function. | |
| 247 | + | func (x *InitiallyUnownedClass) OverrideConstructed(cb func(*Object)) { | |
| 248 | + | if cb == nil { | |
| 249 | + | x.xConstructed = 0 | |
| 250 | + | } else { | |
| 251 | + | x.xConstructed = purego.NewCallback(func(ObjectVarp uintptr) { | |
| 252 | + | cb(ObjectNewFromInternalPtr(ObjectVarp)) | |
| 253 | + | }) | |
| 254 | + | } | |
| 255 | + | } | |
| 256 | + | ||
| 257 | + | // GetConstructed gets the callback function. | |
| 258 | + | func (x *InitiallyUnownedClass) GetConstructed() func(*Object) { | |
| 259 | + | if x.xConstructed == 0 { | |
| 260 | + | return nil | |
| 261 | + | } | |
| 262 | + | var rawCallback func(ObjectVarp uintptr) | |
| 263 | + | purego.RegisterFunc(&rawCallback, x.xConstructed) | |
| 264 | + | return func(ObjectVar *Object) { | |
| 265 | + | rawCallback(ObjectVar.GoPointer()) | |
| 266 | + | } | |
| 267 | + | } | |
| 268 | + | ||
| 59 | 269 | // The class structure for the GObject type. | |
| 60 | 270 | // | |
| 61 | 271 | // |[<!-- language="C" --> | |
| @@ -92,6 +302,22 @@ type ObjectClass struct { | |||
| 92 | 302 | ||
| 93 | 303 | ConstructProperties *glib.SList | |
| 94 | 304 | ||
| 305 | + | xConstructor uintptr | |
| 306 | + | ||
| 307 | + | xSetProperty uintptr | |
| 308 | + | ||
| 309 | + | xGetProperty uintptr | |
| 310 | + | ||
| 311 | + | xDispose uintptr | |
| 312 | + | ||
| 313 | + | xFinalize uintptr | |
| 314 | + | ||
| 315 | + | xDispatchPropertiesChanged uintptr | |
| 316 | + | ||
| 317 | + | xNotify uintptr | |
| 318 | + | ||
| 319 | + | xConstructed uintptr | |
| 320 | + | ||
| 95 | 321 | Flags uint | |
| 96 | 322 | ||
| 97 | 323 | Pdummy [6]uintptr | |
| @@ -243,6 +469,206 @@ func (x *ObjectClass) OverrideProperty(PropertyIdVar uint, NameVar string) { | |||
| 243 | 469 | ||
| 244 | 470 | } | |
| 245 | 471 | ||
| 472 | + | // OverrideConstructor sets the callback function. | |
| 473 | + | func (x *ObjectClass) OverrideConstructor(cb func(types.GType, uint, *ObjectConstructParam) *Object) { | |
| 474 | + | if cb == nil { | |
| 475 | + | x.xConstructor = 0 | |
| 476 | + | } else { | |
| 477 | + | x.xConstructor = purego.NewCallback(func(TypeVarp types.GType, NConstructPropertiesVarp uint, ConstructPropertiesVarp *ObjectConstructParam) uintptr { | |
| 478 | + | ret := cb(TypeVarp, NConstructPropertiesVarp, ConstructPropertiesVarp) | |
| 479 | + | if ret == nil { | |
| 480 | + | return 0 | |
| 481 | + | } | |
| 482 | + | return ret.GoPointer() | |
| 483 | + | }) | |
| 484 | + | } | |
| 485 | + | } | |
| 486 | + | ||
| 487 | + | // GetConstructor gets the callback function. | |
| 488 | + | func (x *ObjectClass) GetConstructor() func(types.GType, uint, *ObjectConstructParam) *Object { | |
| 489 | + | if x.xConstructor == 0 { | |
| 490 | + | return nil | |
| 491 | + | } | |
| 492 | + | var rawCallback func(TypeVarp types.GType, NConstructPropertiesVarp uint, ConstructPropertiesVarp *ObjectConstructParam) uintptr | |
| 493 | + | purego.RegisterFunc(&rawCallback, x.xConstructor) | |
| 494 | + | return func(TypeVar types.GType, NConstructPropertiesVar uint, ConstructPropertiesVar *ObjectConstructParam) *Object { | |
| 495 | + | rawRet := rawCallback(TypeVar, NConstructPropertiesVar, ConstructPropertiesVar) | |
| 496 | + | if rawRet == 0 { | |
| 497 | + | return nil | |
| 498 | + | } | |
| 499 | + | ret := &Object{} | |
| 500 | + | ret.Ptr = rawRet | |
| 501 | + | return ret | |
| 502 | + | } | |
| 503 | + | } | |
| 504 | + | ||
| 505 | + | // OverrideSetProperty sets the callback function. | |
| 506 | + | // The type of the @set_property function of #GObjectClass. | |
| 507 | + | func (x *ObjectClass) OverrideSetProperty(cb func(*Object, uint, *Value, *ParamSpec)) { | |
| 508 | + | if cb == nil { | |
| 509 | + | x.xSetProperty = 0 | |
| 510 | + | } else { | |
| 511 | + | x.xSetProperty = purego.NewCallback(func(ObjectVarp uintptr, PropertyIdVarp uint, ValueVarp *Value, PspecVarp uintptr) { | |
| 512 | + | cb(ObjectNewFromInternalPtr(ObjectVarp), PropertyIdVarp, ValueVarp, ParamSpecNewFromInternalPtr(PspecVarp)) | |
| 513 | + | }) | |
| 514 | + | } | |
| 515 | + | } | |
| 516 | + | ||
| 517 | + | // GetSetProperty gets the callback function. | |
| 518 | + | // The type of the @set_property function of #GObjectClass. | |
| 519 | + | func (x *ObjectClass) GetSetProperty() func(*Object, uint, *Value, *ParamSpec) { | |
| 520 | + | if x.xSetProperty == 0 { | |
| 521 | + | return nil | |
| 522 | + | } | |
| 523 | + | var rawCallback func(ObjectVarp uintptr, PropertyIdVarp uint, ValueVarp *Value, PspecVarp uintptr) | |
| 524 | + | purego.RegisterFunc(&rawCallback, x.xSetProperty) | |
| 525 | + | return func(ObjectVar *Object, PropertyIdVar uint, ValueVar *Value, PspecVar *ParamSpec) { | |
| 526 | + | rawCallback(ObjectVar.GoPointer(), PropertyIdVar, ValueVar, PspecVar.GoPointer()) | |
| 527 | + | } | |
| 528 | + | } | |
| 529 | + | ||
| 530 | + | // OverrideGetProperty sets the callback function. | |
| 531 | + | // The type of the @get_property function of #GObjectClass. | |
| 532 | + | func (x *ObjectClass) OverrideGetProperty(cb func(*Object, uint, *Value, *ParamSpec)) { | |
| 533 | + | if cb == nil { | |
| 534 | + | x.xGetProperty = 0 | |
| 535 | + | } else { | |
| 536 | + | x.xGetProperty = purego.NewCallback(func(ObjectVarp uintptr, PropertyIdVarp uint, ValueVarp *Value, PspecVarp uintptr) { | |
| 537 | + | cb(ObjectNewFromInternalPtr(ObjectVarp), PropertyIdVarp, ValueVarp, ParamSpecNewFromInternalPtr(PspecVarp)) | |
| 538 | + | }) | |
| 539 | + | } | |
| 540 | + | } | |
| 541 | + | ||
| 542 | + | // GetGetProperty gets the callback function. | |
| 543 | + | // The type of the @get_property function of #GObjectClass. | |
| 544 | + | func (x *ObjectClass) GetGetProperty() func(*Object, uint, *Value, *ParamSpec) { | |
| 545 | + | if x.xGetProperty == 0 { | |
| 546 | + | return nil | |
| 547 | + | } | |
| 548 | + | var rawCallback func(ObjectVarp uintptr, PropertyIdVarp uint, ValueVarp *Value, PspecVarp uintptr) | |
| 549 | + | purego.RegisterFunc(&rawCallback, x.xGetProperty) | |
| 550 | + | return func(ObjectVar *Object, PropertyIdVar uint, ValueVar *Value, PspecVar *ParamSpec) { | |
| 551 | + | rawCallback(ObjectVar.GoPointer(), PropertyIdVar, ValueVar, PspecVar.GoPointer()) | |
| 552 | + | } | |
| 553 | + | } | |
| 554 | + | ||
| 555 | + | // OverrideDispose sets the callback function. | |
| 556 | + | func (x *ObjectClass) OverrideDispose(cb func(*Object)) { | |
| 557 | + | if cb == nil { | |
| 558 | + | x.xDispose = 0 | |
| 559 | + | } else { | |
| 560 | + | x.xDispose = purego.NewCallback(func(ObjectVarp uintptr) { | |
| 561 | + | cb(ObjectNewFromInternalPtr(ObjectVarp)) | |
| 562 | + | }) | |
| 563 | + | } | |
| 564 | + | } | |
| 565 | + | ||
| 566 | + | // GetDispose gets the callback function. | |
| 567 | + | func (x *ObjectClass) GetDispose() func(*Object) { | |
| 568 | + | if x.xDispose == 0 { | |
| 569 | + | return nil | |
| 570 | + | } | |
| 571 | + | var rawCallback func(ObjectVarp uintptr) | |
| 572 | + | purego.RegisterFunc(&rawCallback, x.xDispose) | |
| 573 | + | return func(ObjectVar *Object) { | |
| 574 | + | rawCallback(ObjectVar.GoPointer()) | |
| 575 | + | } | |
| 576 | + | } | |
| 577 | + | ||
| 578 | + | // OverrideFinalize sets the callback function. | |
| 579 | + | // The type of the @finalize function of #GObjectClass. | |
| 580 | + | func (x *ObjectClass) OverrideFinalize(cb func(*Object)) { | |
| 581 | + | if cb == nil { | |
| 582 | + | x.xFinalize = 0 | |
| 583 | + | } else { | |
| 584 | + | x.xFinalize = purego.NewCallback(func(ObjectVarp uintptr) { | |
| 585 | + | cb(ObjectNewFromInternalPtr(ObjectVarp)) | |
| 586 | + | }) | |
| 587 | + | } | |
| 588 | + | } | |
| 589 | + | ||
| 590 | + | // GetFinalize gets the callback function. | |
| 591 | + | // The type of the @finalize function of #GObjectClass. | |
| 592 | + | func (x *ObjectClass) GetFinalize() func(*Object) { | |
| 593 | + | if x.xFinalize == 0 { | |
| 594 | + | return nil | |
| 595 | + | } | |
| 596 | + | var rawCallback func(ObjectVarp uintptr) | |
| 597 | + | purego.RegisterFunc(&rawCallback, x.xFinalize) | |
| 598 | + | return func(ObjectVar *Object) { | |
| 599 | + | rawCallback(ObjectVar.GoPointer()) | |
| 600 | + | } | |
| 601 | + | } | |
| 602 | + | ||
| 603 | + | // OverrideDispatchPropertiesChanged sets the callback function. | |
| 604 | + | func (x *ObjectClass) OverrideDispatchPropertiesChanged(cb func(*Object, uint, **ParamSpec)) { | |
| 605 | + | if cb == nil { | |
| 606 | + | x.xDispatchPropertiesChanged = 0 | |
| 607 | + | } else { | |
| 608 | + | x.xDispatchPropertiesChanged = purego.NewCallback(func(ObjectVarp uintptr, NPspecsVarp uint, PspecsVarp uintptr) { | |
| 609 | + | cb(ObjectNewFromInternalPtr(ObjectVarp), NPspecsVarp, (**ParamSpec)(unsafe.Pointer(PspecsVarp))) | |
| 610 | + | }) | |
| 611 | + | } | |
| 612 | + | } | |
| 613 | + | ||
| 614 | + | // GetDispatchPropertiesChanged gets the callback function. | |
| 615 | + | func (x *ObjectClass) GetDispatchPropertiesChanged() func(*Object, uint, **ParamSpec) { | |
| 616 | + | if x.xDispatchPropertiesChanged == 0 { | |
| 617 | + | return nil | |
| 618 | + | } | |
| 619 | + | var rawCallback func(ObjectVarp uintptr, NPspecsVarp uint, PspecsVarp uintptr) | |
| 620 | + | purego.RegisterFunc(&rawCallback, x.xDispatchPropertiesChanged) | |
| 621 | + | return func(ObjectVar *Object, NPspecsVar uint, PspecsVar **ParamSpec) { | |
| 622 | + | rawCallback(ObjectVar.GoPointer(), NPspecsVar, *ConvertPtr(PspecsVar)) | |
| 623 | + | } | |
| 624 | + | } | |
| 625 | + | ||
| 626 | + | // OverrideNotify sets the callback function. | |
| 627 | + | func (x *ObjectClass) OverrideNotify(cb func(*Object, *ParamSpec)) { | |
| 628 | + | if cb == nil { | |
| 629 | + | x.xNotify = 0 | |
| 630 | + | } else { | |
| 631 | + | x.xNotify = purego.NewCallback(func(ObjectVarp uintptr, PspecVarp uintptr) { | |
| 632 | + | cb(ObjectNewFromInternalPtr(ObjectVarp), ParamSpecNewFromInternalPtr(PspecVarp)) | |
| 633 | + | }) | |
| 634 | + | } | |
| 635 | + | } | |
| 636 | + | ||
| 637 | + | // GetNotify gets the callback function. | |
| 638 | + | func (x *ObjectClass) GetNotify() func(*Object, *ParamSpec) { | |
| 639 | + | if x.xNotify == 0 { | |
| 640 | + | return nil | |
| 641 | + | } | |
| 642 | + | var rawCallback func(ObjectVarp uintptr, PspecVarp uintptr) | |
| 643 | + | purego.RegisterFunc(&rawCallback, x.xNotify) | |
| 644 | + | return func(ObjectVar *Object, PspecVar *ParamSpec) { | |
| 645 | + | rawCallback(ObjectVar.GoPointer(), PspecVar.GoPointer()) | |
| 646 | + | } | |
| 647 | + | } | |
| 648 | + | ||
| 649 | + | // OverrideConstructed sets the callback function. | |
| 650 | + | func (x *ObjectClass) OverrideConstructed(cb func(*Object)) { | |
| 651 | + | if cb == nil { | |
| 652 | + | x.xConstructed = 0 | |
| 653 | + | } else { | |
| 654 | + | x.xConstructed = purego.NewCallback(func(ObjectVarp uintptr) { | |
| 655 | + | cb(ObjectNewFromInternalPtr(ObjectVarp)) | |
| 656 | + | }) | |
| 657 | + | } | |
| 658 | + | } | |
| 659 | + | ||
| 660 | + | // GetConstructed gets the callback function. | |
| 661 | + | func (x *ObjectClass) GetConstructed() func(*Object) { | |
| 662 | + | if x.xConstructed == 0 { | |
| 663 | + | return nil | |
| 664 | + | } | |
| 665 | + | var rawCallback func(ObjectVarp uintptr) | |
| 666 | + | purego.RegisterFunc(&rawCallback, x.xConstructed) | |
| 667 | + | return func(ObjectVar *Object) { | |
| 668 | + | rawCallback(ObjectVar.GoPointer()) | |
| 669 | + | } | |
| 670 | + | } | |
| 671 | + | ||
| 246 | 672 | // The GObjectConstructParam struct is an auxiliary structure used to hand | |
| 247 | 673 | // #GParamSpec/#GValue pairs to the @constructor of a #GObjectClass. | |
| 248 | 674 | type ObjectConstructParam struct { | |
| @@ -382,7 +808,7 @@ func CclosureNewObjectSwap(CallbackFuncVar *Callback, ObjectVar *Object) *Closur | |||
| 382 | 808 | return cret | |
| 383 | 809 | } | |
| 384 | 810 | ||
| 385 | - | var xClearObject func(*uintptr) | |
| 811 | + | var xClearObject func(uintptr) | |
| 386 | 812 | ||
| 387 | 813 | // Clears a reference to a #GObject. | |
| 388 | 814 | // | |
| @@ -396,7 +822,7 @@ var xClearObject func(*uintptr) | |||
| 396 | 822 | // pointer casts. | |
| 397 | 823 | func ClearObject(ObjectPtrVar **Object) { | |
| 398 | 824 | ||
| 399 | - | xClearObject(ConvertPtr(ObjectPtrVar)) | |
| 825 | + | xClearObject(*ConvertPtr(ObjectPtrVar)) | |
| 400 | 826 | ||
| 401 | 827 | } | |
| 402 | 828 | ||
M v4/gobject/gparam.go +225 -0
| @@ -21,6 +21,14 @@ type ParamSpecClass struct { | |||
| 21 | 21 | ||
| 22 | 22 | ValueType types.GType | |
| 23 | 23 | ||
| 24 | + | xFinalize uintptr | |
| 25 | + | ||
| 26 | + | xValueSetDefault uintptr | |
| 27 | + | ||
| 28 | + | xValueValidate uintptr | |
| 29 | + | ||
| 30 | + | xValuesCmp uintptr | |
| 31 | + | ||
| 24 | 32 | Dummy [4]uintptr | |
| 25 | 33 | } | |
| 26 | 34 | ||
| @@ -28,6 +36,98 @@ func (x *ParamSpecClass) GoPointer() uintptr { | |||
| 28 | 36 | return uintptr(unsafe.Pointer(x)) | |
| 29 | 37 | } | |
| 30 | 38 | ||
| 39 | + | // OverrideFinalize sets the callback function. | |
| 40 | + | func (x *ParamSpecClass) OverrideFinalize(cb func(*ParamSpec)) { | |
| 41 | + | if cb == nil { | |
| 42 | + | x.xFinalize = 0 | |
| 43 | + | } else { | |
| 44 | + | x.xFinalize = purego.NewCallback(func(PspecVarp uintptr) { | |
| 45 | + | cb(ParamSpecNewFromInternalPtr(PspecVarp)) | |
| 46 | + | }) | |
| 47 | + | } | |
| 48 | + | } | |
| 49 | + | ||
| 50 | + | // GetFinalize gets the callback function. | |
| 51 | + | func (x *ParamSpecClass) GetFinalize() func(*ParamSpec) { | |
| 52 | + | if x.xFinalize == 0 { | |
| 53 | + | return nil | |
| 54 | + | } | |
| 55 | + | var rawCallback func(PspecVarp uintptr) | |
| 56 | + | purego.RegisterFunc(&rawCallback, x.xFinalize) | |
| 57 | + | return func(PspecVar *ParamSpec) { | |
| 58 | + | rawCallback(PspecVar.GoPointer()) | |
| 59 | + | } | |
| 60 | + | } | |
| 61 | + | ||
| 62 | + | // OverrideValueSetDefault sets the callback function. | |
| 63 | + | func (x *ParamSpecClass) OverrideValueSetDefault(cb func(*ParamSpec, *Value)) { | |
| 64 | + | if cb == nil { | |
| 65 | + | x.xValueSetDefault = 0 | |
| 66 | + | } else { | |
| 67 | + | x.xValueSetDefault = purego.NewCallback(func(PspecVarp uintptr, ValueVarp *Value) { | |
| 68 | + | cb(ParamSpecNewFromInternalPtr(PspecVarp), ValueVarp) | |
| 69 | + | }) | |
| 70 | + | } | |
| 71 | + | } | |
| 72 | + | ||
| 73 | + | // GetValueSetDefault gets the callback function. | |
| 74 | + | func (x *ParamSpecClass) GetValueSetDefault() func(*ParamSpec, *Value) { | |
| 75 | + | if x.xValueSetDefault == 0 { | |
| 76 | + | return nil | |
| 77 | + | } | |
| 78 | + | var rawCallback func(PspecVarp uintptr, ValueVarp *Value) | |
| 79 | + | purego.RegisterFunc(&rawCallback, x.xValueSetDefault) | |
| 80 | + | return func(PspecVar *ParamSpec, ValueVar *Value) { | |
| 81 | + | rawCallback(PspecVar.GoPointer(), ValueVar) | |
| 82 | + | } | |
| 83 | + | } | |
| 84 | + | ||
| 85 | + | // OverrideValueValidate sets the callback function. | |
| 86 | + | func (x *ParamSpecClass) OverrideValueValidate(cb func(*ParamSpec, *Value) bool) { | |
| 87 | + | if cb == nil { | |
| 88 | + | x.xValueValidate = 0 | |
| 89 | + | } else { | |
| 90 | + | x.xValueValidate = purego.NewCallback(func(PspecVarp uintptr, ValueVarp *Value) bool { | |
| 91 | + | return cb(ParamSpecNewFromInternalPtr(PspecVarp), ValueVarp) | |
| 92 | + | }) | |
| 93 | + | } | |
| 94 | + | } | |
| 95 | + | ||
| 96 | + | // GetValueValidate gets the callback function. | |
| 97 | + | func (x *ParamSpecClass) GetValueValidate() func(*ParamSpec, *Value) bool { | |
| 98 | + | if x.xValueValidate == 0 { | |
| 99 | + | return nil | |
| 100 | + | } | |
| 101 | + | var rawCallback func(PspecVarp uintptr, ValueVarp *Value) bool | |
| 102 | + | purego.RegisterFunc(&rawCallback, x.xValueValidate) | |
| 103 | + | return func(PspecVar *ParamSpec, ValueVar *Value) bool { | |
| 104 | + | return rawCallback(PspecVar.GoPointer(), ValueVar) | |
| 105 | + | } | |
| 106 | + | } | |
| 107 | + | ||
| 108 | + | // OverrideValuesCmp sets the callback function. | |
| 109 | + | func (x *ParamSpecClass) OverrideValuesCmp(cb func(*ParamSpec, *Value, *Value) int) { | |
| 110 | + | if cb == nil { | |
| 111 | + | x.xValuesCmp = 0 | |
| 112 | + | } else { | |
| 113 | + | x.xValuesCmp = purego.NewCallback(func(PspecVarp uintptr, Value1Varp *Value, Value2Varp *Value) int { | |
| 114 | + | return cb(ParamSpecNewFromInternalPtr(PspecVarp), Value1Varp, Value2Varp) | |
| 115 | + | }) | |
| 116 | + | } | |
| 117 | + | } | |
| 118 | + | ||
| 119 | + | // GetValuesCmp gets the callback function. | |
| 120 | + | func (x *ParamSpecClass) GetValuesCmp() func(*ParamSpec, *Value, *Value) int { | |
| 121 | + | if x.xValuesCmp == 0 { | |
| 122 | + | return nil | |
| 123 | + | } | |
| 124 | + | var rawCallback func(PspecVarp uintptr, Value1Varp *Value, Value2Varp *Value) int | |
| 125 | + | purego.RegisterFunc(&rawCallback, x.xValuesCmp) | |
| 126 | + | return func(PspecVar *ParamSpec, Value1Var *Value, Value2Var *Value) int { | |
| 127 | + | return rawCallback(PspecVar.GoPointer(), Value1Var, Value2Var) | |
| 128 | + | } | |
| 129 | + | } | |
| 130 | + | ||
| 31 | 131 | // A #GParamSpecPool maintains a collection of #GParamSpecs which can be | |
| 32 | 132 | // quickly accessed by owner and name. | |
| 33 | 133 | // | |
| @@ -111,13 +211,138 @@ type ParamSpecTypeInfo struct { | |||
| 111 | 211 | ||
| 112 | 212 | NPreallocs uint16 | |
| 113 | 213 | ||
| 214 | + | xInstanceInit uintptr | |
| 215 | + | ||
| 114 | 216 | ValueType types.GType | |
| 217 | + | ||
| 218 | + | xFinalize uintptr | |
| 219 | + | ||
| 220 | + | xValueSetDefault uintptr | |
| 221 | + | ||
| 222 | + | xValueValidate uintptr | |
| 223 | + | ||
| 224 | + | xValuesCmp uintptr | |
| 115 | 225 | } | |
| 116 | 226 | ||
| 117 | 227 | func (x *ParamSpecTypeInfo) GoPointer() uintptr { | |
| 118 | 228 | return uintptr(unsafe.Pointer(x)) | |
| 119 | 229 | } | |
| 120 | 230 | ||
| 231 | + | // OverrideInstanceInit sets the callback function. | |
| 232 | + | func (x *ParamSpecTypeInfo) OverrideInstanceInit(cb func(*ParamSpec)) { | |
| 233 | + | if cb == nil { | |
| 234 | + | x.xInstanceInit = 0 | |
| 235 | + | } else { | |
| 236 | + | x.xInstanceInit = purego.NewCallback(func(PspecVarp uintptr) { | |
| 237 | + | cb(ParamSpecNewFromInternalPtr(PspecVarp)) | |
| 238 | + | }) | |
| 239 | + | } | |
| 240 | + | } | |
| 241 | + | ||
| 242 | + | // GetInstanceInit gets the callback function. | |
| 243 | + | func (x *ParamSpecTypeInfo) GetInstanceInit() func(*ParamSpec) { | |
| 244 | + | if x.xInstanceInit == 0 { | |
| 245 | + | return nil | |
| 246 | + | } | |
| 247 | + | var rawCallback func(PspecVarp uintptr) | |
| 248 | + | purego.RegisterFunc(&rawCallback, x.xInstanceInit) | |
| 249 | + | return func(PspecVar *ParamSpec) { | |
| 250 | + | rawCallback(PspecVar.GoPointer()) | |
| 251 | + | } | |
| 252 | + | } | |
| 253 | + | ||
| 254 | + | // OverrideFinalize sets the callback function. | |
| 255 | + | func (x *ParamSpecTypeInfo) OverrideFinalize(cb func(*ParamSpec)) { | |
| 256 | + | if cb == nil { | |
| 257 | + | x.xFinalize = 0 | |
| 258 | + | } else { | |
| 259 | + | x.xFinalize = purego.NewCallback(func(PspecVarp uintptr) { | |
| 260 | + | cb(ParamSpecNewFromInternalPtr(PspecVarp)) | |
| 261 | + | }) | |
| 262 | + | } | |
| 263 | + | } | |
| 264 | + | ||
| 265 | + | // GetFinalize gets the callback function. | |
| 266 | + | func (x *ParamSpecTypeInfo) GetFinalize() func(*ParamSpec) { | |
| 267 | + | if x.xFinalize == 0 { | |
| 268 | + | return nil | |
| 269 | + | } | |
| 270 | + | var rawCallback func(PspecVarp uintptr) | |
| 271 | + | purego.RegisterFunc(&rawCallback, x.xFinalize) | |
| 272 | + | return func(PspecVar *ParamSpec) { | |
| 273 | + | rawCallback(PspecVar.GoPointer()) | |
| 274 | + | } | |
| 275 | + | } | |
| 276 | + | ||
| 277 | + | // OverrideValueSetDefault sets the callback function. | |
| 278 | + | func (x *ParamSpecTypeInfo) OverrideValueSetDefault(cb func(*ParamSpec, *Value)) { | |
| 279 | + | if cb == nil { | |
| 280 | + | x.xValueSetDefault = 0 | |
| 281 | + | } else { | |
| 282 | + | x.xValueSetDefault = purego.NewCallback(func(PspecVarp uintptr, ValueVarp *Value) { | |
| 283 | + | cb(ParamSpecNewFromInternalPtr(PspecVarp), ValueVarp) | |
| 284 | + | }) | |
| 285 | + | } | |
| 286 | + | } | |
| 287 | + | ||
| 288 | + | // GetValueSetDefault gets the callback function. | |
| 289 | + | func (x *ParamSpecTypeInfo) GetValueSetDefault() func(*ParamSpec, *Value) { | |
| 290 | + | if x.xValueSetDefault == 0 { | |
| 291 | + | return nil | |
| 292 | + | } | |
| 293 | + | var rawCallback func(PspecVarp uintptr, ValueVarp *Value) | |
| 294 | + | purego.RegisterFunc(&rawCallback, x.xValueSetDefault) | |
| 295 | + | return func(PspecVar *ParamSpec, ValueVar *Value) { | |
| 296 | + | rawCallback(PspecVar.GoPointer(), ValueVar) | |
| 297 | + | } | |
| 298 | + | } | |
| 299 | + | ||
| 300 | + | // OverrideValueValidate sets the callback function. | |
| 301 | + | func (x *ParamSpecTypeInfo) OverrideValueValidate(cb func(*ParamSpec, *Value) bool) { | |
| 302 | + | if cb == nil { | |
| 303 | + | x.xValueValidate = 0 | |
| 304 | + | } else { | |
| 305 | + | x.xValueValidate = purego.NewCallback(func(PspecVarp uintptr, ValueVarp *Value) bool { | |
| 306 | + | return cb(ParamSpecNewFromInternalPtr(PspecVarp), ValueVarp) | |
| 307 | + | }) | |
| 308 | + | } | |
| 309 | + | } | |
| 310 | + | ||
| 311 | + | // GetValueValidate gets the callback function. | |
| 312 | + | func (x *ParamSpecTypeInfo) GetValueValidate() func(*ParamSpec, *Value) bool { | |
| 313 | + | if x.xValueValidate == 0 { | |
| 314 | + | return nil | |
| 315 | + | } | |
| 316 | + | var rawCallback func(PspecVarp uintptr, ValueVarp *Value) bool | |
| 317 | + | purego.RegisterFunc(&rawCallback, x.xValueValidate) | |
| 318 | + | return func(PspecVar *ParamSpec, ValueVar *Value) bool { | |
| 319 | + | return rawCallback(PspecVar.GoPointer(), ValueVar) | |
| 320 | + | } | |
| 321 | + | } | |
| 322 | + | ||
| 323 | + | // OverrideValuesCmp sets the callback function. | |
| 324 | + | func (x *ParamSpecTypeInfo) OverrideValuesCmp(cb func(*ParamSpec, *Value, *Value) int) { | |
| 325 | + | if cb == nil { | |
| 326 | + | x.xValuesCmp = 0 | |
| 327 | + | } else { | |
| 328 | + | x.xValuesCmp = purego.NewCallback(func(PspecVarp uintptr, Value1Varp *Value, Value2Varp *Value) int { | |
| 329 | + | return cb(ParamSpecNewFromInternalPtr(PspecVarp), Value1Varp, Value2Varp) | |
| 330 | + | }) | |
| 331 | + | } | |
| 332 | + | } | |
| 333 | + | ||
| 334 | + | // GetValuesCmp gets the callback function. | |
| 335 | + | func (x *ParamSpecTypeInfo) GetValuesCmp() func(*ParamSpec, *Value, *Value) int { | |
| 336 | + | if x.xValuesCmp == 0 { | |
| 337 | + | return nil | |
| 338 | + | } | |
| 339 | + | var rawCallback func(PspecVarp uintptr, Value1Varp *Value, Value2Varp *Value) int | |
| 340 | + | purego.RegisterFunc(&rawCallback, x.xValuesCmp) | |
| 341 | + | return func(PspecVar *ParamSpec, Value1Var *Value, Value2Var *Value) int { | |
| 342 | + | return rawCallback(PspecVar.GoPointer(), Value1Var, Value2Var) | |
| 343 | + | } | |
| 344 | + | } | |
| 345 | + | ||
| 121 | 346 | // The GParameter struct is an auxiliary structure used | |
| 122 | 347 | // to hand parameter name/value pairs to g_object_newv(). | |
| 123 | 348 | type Parameter struct { | |
M v4/gobject/gtype.go +150 -0
| @@ -488,15 +488,165 @@ func (x *TypeQuery) GoPointer() uintptr { | |||
| 488 | 488 | type TypeValueTable struct { | |
| 489 | 489 | _ structs.HostLayout | |
| 490 | 490 | ||
| 491 | + | xValueInit uintptr | |
| 492 | + | ||
| 493 | + | xValueFree uintptr | |
| 494 | + | ||
| 495 | + | xValueCopy uintptr | |
| 496 | + | ||
| 497 | + | xValuePeekPointer uintptr | |
| 498 | + | ||
| 491 | 499 | CollectFormat uintptr | |
| 492 | 500 | ||
| 501 | + | xCollectValue uintptr | |
| 502 | + | ||
| 493 | 503 | LcopyFormat uintptr | |
| 504 | + | ||
| 505 | + | xLcopyValue uintptr | |
| 494 | 506 | } | |
| 495 | 507 | ||
| 496 | 508 | func (x *TypeValueTable) GoPointer() uintptr { | |
| 497 | 509 | return uintptr(unsafe.Pointer(x)) | |
| 498 | 510 | } | |
| 499 | 511 | ||
| 512 | + | // OverrideValueInit sets the callback function. | |
| 513 | + | func (x *TypeValueTable) OverrideValueInit(cb func(*Value)) { | |
| 514 | + | if cb == nil { | |
| 515 | + | x.xValueInit = 0 | |
| 516 | + | } else { | |
| 517 | + | x.xValueInit = purego.NewCallback(func(ValueVarp *Value) { | |
| 518 | + | cb(ValueVarp) | |
| 519 | + | }) | |
| 520 | + | } | |
| 521 | + | } | |
| 522 | + | ||
| 523 | + | // GetValueInit gets the callback function. | |
| 524 | + | func (x *TypeValueTable) GetValueInit() func(*Value) { | |
| 525 | + | if x.xValueInit == 0 { | |
| 526 | + | return nil | |
| 527 | + | } | |
| 528 | + | var rawCallback func(ValueVarp *Value) | |
| 529 | + | purego.RegisterFunc(&rawCallback, x.xValueInit) | |
| 530 | + | return func(ValueVar *Value) { | |
| 531 | + | rawCallback(ValueVar) | |
| 532 | + | } | |
| 533 | + | } | |
| 534 | + | ||
| 535 | + | // OverrideValueFree sets the callback function. | |
| 536 | + | func (x *TypeValueTable) OverrideValueFree(cb func(*Value)) { | |
| 537 | + | if cb == nil { | |
| 538 | + | x.xValueFree = 0 | |
| 539 | + | } else { | |
| 540 | + | x.xValueFree = purego.NewCallback(func(ValueVarp *Value) { | |
| 541 | + | cb(ValueVarp) | |
| 542 | + | }) | |
| 543 | + | } | |
| 544 | + | } | |
| 545 | + | ||
| 546 | + | // GetValueFree gets the callback function. | |
| 547 | + | func (x *TypeValueTable) GetValueFree() func(*Value) { | |
| 548 | + | if x.xValueFree == 0 { | |
| 549 | + | return nil | |
| 550 | + | } | |
| 551 | + | var rawCallback func(ValueVarp *Value) | |
| 552 | + | purego.RegisterFunc(&rawCallback, x.xValueFree) | |
| 553 | + | return func(ValueVar *Value) { | |
| 554 | + | rawCallback(ValueVar) | |
| 555 | + | } | |
| 556 | + | } | |
| 557 | + | ||
| 558 | + | // OverrideValueCopy sets the callback function. | |
| 559 | + | func (x *TypeValueTable) OverrideValueCopy(cb func(*Value, *Value)) { | |
| 560 | + | if cb == nil { | |
| 561 | + | x.xValueCopy = 0 | |
| 562 | + | } else { | |
| 563 | + | x.xValueCopy = purego.NewCallback(func(SrcValueVarp *Value, DestValueVarp *Value) { | |
| 564 | + | cb(SrcValueVarp, DestValueVarp) | |
| 565 | + | }) | |
| 566 | + | } | |
| 567 | + | } | |
| 568 | + | ||
| 569 | + | // GetValueCopy gets the callback function. | |
| 570 | + | func (x *TypeValueTable) GetValueCopy() func(*Value, *Value) { | |
| 571 | + | if x.xValueCopy == 0 { | |
| 572 | + | return nil | |
| 573 | + | } | |
| 574 | + | var rawCallback func(SrcValueVarp *Value, DestValueVarp *Value) | |
| 575 | + | purego.RegisterFunc(&rawCallback, x.xValueCopy) | |
| 576 | + | return func(SrcValueVar *Value, DestValueVar *Value) { | |
| 577 | + | rawCallback(SrcValueVar, DestValueVar) | |
| 578 | + | } | |
| 579 | + | } | |
| 580 | + | ||
| 581 | + | // OverrideValuePeekPointer sets the callback function. | |
| 582 | + | func (x *TypeValueTable) OverrideValuePeekPointer(cb func(*Value) uintptr) { | |
| 583 | + | if cb == nil { | |
| 584 | + | x.xValuePeekPointer = 0 | |
| 585 | + | } else { | |
| 586 | + | x.xValuePeekPointer = purego.NewCallback(func(ValueVarp *Value) uintptr { | |
| 587 | + | return cb(ValueVarp) | |
| 588 | + | }) | |
| 589 | + | } | |
| 590 | + | } | |
| 591 | + | ||
| 592 | + | // GetValuePeekPointer gets the callback function. | |
| 593 | + | func (x *TypeValueTable) GetValuePeekPointer() func(*Value) uintptr { | |
| 594 | + | if x.xValuePeekPointer == 0 { | |
| 595 | + | return nil | |
| 596 | + | } | |
| 597 | + | var rawCallback func(ValueVarp *Value) uintptr | |
| 598 | + | purego.RegisterFunc(&rawCallback, x.xValuePeekPointer) | |
| 599 | + | return func(ValueVar *Value) uintptr { | |
| 600 | + | return rawCallback(ValueVar) | |
| 601 | + | } | |
| 602 | + | } | |
| 603 | + | ||
| 604 | + | // OverrideCollectValue sets the callback function. | |
| 605 | + | func (x *TypeValueTable) OverrideCollectValue(cb func(*Value, uint, *TypeCValue, uint) string) { | |
| 606 | + | if cb == nil { | |
| 607 | + | x.xCollectValue = 0 | |
| 608 | + | } else { | |
| 609 | + | x.xCollectValue = purego.NewCallback(func(ValueVarp *Value, NCollectValuesVarp uint, CollectValuesVarp *TypeCValue, CollectFlagsVarp uint) string { | |
| 610 | + | return cb(ValueVarp, NCollectValuesVarp, CollectValuesVarp, CollectFlagsVarp) | |
| 611 | + | }) | |
| 612 | + | } | |
| 613 | + | } | |
| 614 | + | ||
| 615 | + | // GetCollectValue gets the callback function. | |
| 616 | + | func (x *TypeValueTable) GetCollectValue() func(*Value, uint, *TypeCValue, uint) string { | |
| 617 | + | if x.xCollectValue == 0 { | |
| 618 | + | return nil | |
| 619 | + | } | |
| 620 | + | var rawCallback func(ValueVarp *Value, NCollectValuesVarp uint, CollectValuesVarp *TypeCValue, CollectFlagsVarp uint) string | |
| 621 | + | purego.RegisterFunc(&rawCallback, x.xCollectValue) | |
| 622 | + | return func(ValueVar *Value, NCollectValuesVar uint, CollectValuesVar *TypeCValue, CollectFlagsVar uint) string { | |
| 623 | + | return rawCallback(ValueVar, NCollectValuesVar, CollectValuesVar, CollectFlagsVar) | |
| 624 | + | } | |
| 625 | + | } | |
| 626 | + | ||
| 627 | + | // OverrideLcopyValue sets the callback function. | |
| 628 | + | func (x *TypeValueTable) OverrideLcopyValue(cb func(*Value, uint, *TypeCValue, uint) string) { | |
| 629 | + | if cb == nil { | |
| 630 | + | x.xLcopyValue = 0 | |
| 631 | + | } else { | |
| 632 | + | x.xLcopyValue = purego.NewCallback(func(ValueVarp *Value, NCollectValuesVarp uint, CollectValuesVarp *TypeCValue, CollectFlagsVarp uint) string { | |
| 633 | + | return cb(ValueVarp, NCollectValuesVarp, CollectValuesVarp, CollectFlagsVarp) | |
| 634 | + | }) | |
| 635 | + | } | |
| 636 | + | } | |
| 637 | + | ||
| 638 | + | // GetLcopyValue gets the callback function. | |
| 639 | + | func (x *TypeValueTable) GetLcopyValue() func(*Value, uint, *TypeCValue, uint) string { | |
| 640 | + | if x.xLcopyValue == 0 { | |
| 641 | + | return nil | |
| 642 | + | } | |
| 643 | + | var rawCallback func(ValueVarp *Value, NCollectValuesVarp uint, CollectValuesVarp *TypeCValue, CollectFlagsVarp uint) string | |
| 644 | + | purego.RegisterFunc(&rawCallback, x.xLcopyValue) | |
| 645 | + | return func(ValueVar *Value, NCollectValuesVar uint, CollectValuesVar *TypeCValue, CollectFlagsVar uint) string { | |
| 646 | + | return rawCallback(ValueVar, NCollectValuesVar, CollectValuesVar, CollectFlagsVar) | |
| 647 | + | } | |
| 648 | + | } | |
| 649 | + | ||
| 500 | 650 | type TypeCValue = uintptr | |
| 501 | 651 | ||
| 502 | 652 | // A numerical value which represents the unique identifier of a registered | |
M v4/gobject/gtypemodule.go +151 -1 collapsed to keep the page light
M v4/gsk/gskglshader.go +1 -1
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | type GLShaderClass struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| 19 | - | ParentClass uintptr | |
| 19 | + | ParentClass gobject.ObjectClass | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func (x *GLShaderClass) GoPointer() uintptr { | |
M v4/gtk/gtkactionable.go +100 -0 collapsed to keep the page light
M v4/gtk/gtkadjustment.go +151 -1 collapsed to keep the page light
M v4/gtk/gtkapplication.go +51 -1 collapsed to keep the page light
M v4/gtk/gtkapplicationwindow.go +1 -1
| @@ -18,7 +18,7 @@ import ( | |||
| 18 | 18 | type ApplicationWindowClass struct { | |
| 19 | 19 | _ structs.HostLayout | |
| 20 | 20 | ||
| 21 | - | ParentClass uintptr | |
| 21 | + | ParentClass WindowClass | |
| 22 | 22 | ||
| 23 | 23 | Padding [8]uintptr | |
| 24 | 24 | } | |
M v4/gtk/gtkbinlayout.go +1 -1
| @@ -13,7 +13,7 @@ import ( | |||
| 13 | 13 | type BinLayoutClass struct { | |
| 14 | 14 | _ structs.HostLayout | |
| 15 | 15 | ||
| 16 | - | ParentClass uintptr | |
| 16 | + | ParentClass LayoutManagerClass | |
| 17 | 17 | } | |
| 18 | 18 | ||
| 19 | 19 | func (x *BinLayoutClass) GoPointer() uintptr { | |
M v4/gtk/gtkbookmarklist.go +1 -1
| @@ -15,7 +15,7 @@ import ( | |||
| 15 | 15 | type BookmarkListClass struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| 18 | - | ParentClass uintptr | |
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | func (x *BookmarkListClass) GoPointer() uintptr { | |
M v4/gtk/gtkboolfilter.go +1 -1
| @@ -14,7 +14,7 @@ import ( | |||
| 14 | 14 | type BoolFilterClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass FilterClass | |
| 18 | 18 | } | |
| 19 | 19 | ||
| 20 | 20 | func (x *BoolFilterClass) GoPointer() uintptr { | |
M v4/gtk/gtkbox.go +1 -1
| @@ -14,7 +14,7 @@ import ( | |||
| 14 | 14 | type BoxClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass WidgetClass | |
| 18 | 18 | ||
| 19 | 19 | Padding [8]uintptr | |
| 20 | 20 | } | |
M v4/gtk/gtkboxlayout.go +1 -1
| @@ -13,7 +13,7 @@ import ( | |||
| 13 | 13 | type BoxLayoutClass struct { | |
| 14 | 14 | _ structs.HostLayout | |
| 15 | 15 | ||
| 16 | - | ParentClass uintptr | |
| 16 | + | ParentClass LayoutManagerClass | |
| 17 | 17 | } | |
| 18 | 18 | ||
| 19 | 19 | func (x *BoxLayoutClass) GoPointer() uintptr { | |
M v4/gtk/gtkbuildable.go +372 -0 collapsed to keep the page light
M v4/gtk/gtkbuilderscope.go +76 -1 collapsed to keep the page light
M v4/gtk/gtkbutton.go +51 -1 collapsed to keep the page light
M v4/gtk/gtkcellarea.go +496 -1 collapsed to keep the page light
M v4/gtk/gtkcellareacontext.go +101 -1 collapsed to keep the page light
M v4/gtk/gtkcelleditable.go +75 -0 collapsed to keep the page light
M v4/gtk/gtkcelllayout.go +235 -0 collapsed to keep the page light
M v4/gtk/gtkcellrenderer.go +286 -1 collapsed to keep the page light
M v4/gtk/gtkcellrenderertext.go +26 -1 collapsed to keep the page light
M v4/gtk/gtkcenterlayout.go +1 -1
| @@ -14,7 +14,7 @@ import ( | |||
| 14 | 14 | type CenterLayoutClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass LayoutManagerClass | |
| 18 | 18 | } | |
| 19 | 19 | ||
| 20 | 20 | func (x *CenterLayoutClass) GoPointer() uintptr { | |
M v4/gtk/gtkcheckbutton.go +51 -1 collapsed to keep the page light
M v4/gtk/gtkcolorchooser.go +100 -0 collapsed to keep the page light
M v4/gtk/gtkcombobox.go +76 -1 collapsed to keep the page light
M v4/gtk/gtkconstraint.go +1 -1
| @@ -14,7 +14,7 @@ import ( | |||
| 14 | 14 | type ConstraintClass struct { | |
| 15 | 15 | _ structs.HostLayout | |
| 16 | 16 | ||
| 17 | - | ParentClass uintptr | |
| 17 | + | ParentClass gobject.ObjectClass | |
| 18 | 18 | } | |
| 19 | 19 | ||
| 20 | 20 | func (x *ConstraintClass) GoPointer() uintptr { | |