File tree 8 files changed +11534
-72
lines changed
8 files changed +11534
-72
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ package gendata
4
4
5
5
import (
6
6
"fmt"
7
+ "slices"
7
8
"strings"
8
9
9
10
"github.com/diamondburned/gotk4/gir"
@@ -12,6 +13,7 @@ import (
12
13
"github.com/diamondburned/gotk4/gir/girgen/file"
13
14
. "github.com/diamondburned/gotk4/gir/girgen/types"
14
15
. "github.com/diamondburned/gotk4/gir/girgen/types/typeconv"
16
+ "github.com/diamondburned/gotk4/gir/internal/ptr"
15
17
)
16
18
17
19
const Module = "github.com/diamondburned/gotk4/pkg"
@@ -211,6 +213,20 @@ var Preprocessors = []Preprocessor{
211
213
}
212
214
}
213
215
}),
216
+
217
+ // Fix GAsyncReadyCallback missing the closure bit for the user_data
218
+ // parameter.
219
+ PreprocessorFunc (func (repos gir.Repositories ) {
220
+ callback := repos .FindFullType ("Gio-2.AsyncReadyCallback" ).Type .(* gir.Callback )
221
+
222
+ userDataIx := slices .IndexFunc (
223
+ callback .Parameters .Parameters ,
224
+ func (p gir.Parameter ) bool { return p .Name == "data" },
225
+ )
226
+
227
+ userData := & callback .Parameters .Parameters [userDataIx ]
228
+ userData .Closure = ptr .To (userDataIx )
229
+ }),
214
230
}
215
231
216
232
var ConversionProcessors = []ConversionProcessor {
Original file line number Diff line number Diff line change
1
+ package ptr
2
+
3
+ // To returns a pointer to the given value.
4
+ func To [T any ](v T ) * T {
5
+ return & v
6
+ }
You can’t perform that action at this time.
0 commit comments