Merge branch 'dev'
328 files · +10396 -1977
M gen.sh +1 -1
| @@ -18,4 +18,4 @@ echo "running a second pass for goimports..." | |||
| 18 | 18 | goimports -w v4 | |
| 19 | 19 | ||
| 20 | 20 | echo "running go vet..." | |
| 21 | - | go vet ./v4/... | |
| 21 | + | go vet -unsafeptr=false -stdmethods=false ./v4/... | |
M internal/core/core.go +17 -0
| @@ -226,3 +226,20 @@ func GoString(c uintptr) string { | |||
| 226 | 226 | } | |
| 227 | 227 | return string(unsafe.Slice((*byte)(ptr), length)) | |
| 228 | 228 | } | |
| 229 | + | ||
| 230 | + | // NullableStringToPtr converts a nullable Go string to a uintptr suitable for C calls. | |
| 231 | + | func NullableStringToPtr(s *string) uintptr { | |
| 232 | + | if s == nil { | |
| 233 | + | return 0 | |
| 234 | + | } | |
| 235 | + | return uintptr(unsafe.Pointer(CString(*s))) | |
| 236 | + | } | |
| 237 | + | ||
| 238 | + | // PtrToNullableString converts a nullable char* to a Go *string (nil when NULL). | |
| 239 | + | func PtrToNullableString(ptr uintptr) *string { | |
| 240 | + | if ptr == 0 { | |
| 241 | + | return nil | |
| 242 | + | } | |
| 243 | + | str := GoString(ptr) | |
| 244 | + | return &str | |
| 245 | + | } | |
M internal/gir/pass/pass.go +105 -26
| @@ -134,7 +134,7 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string | |||
| 134 | 134 | Name: util.ConstructorName(c.Name, rec.Name), | |
| 135 | 135 | CName: c.CIdentifier, | |
| 136 | 136 | Doc: c.Doc.StringSafe(), | |
| 137 | - | Args: c.Parameters.Template(ns.Name, "", p.Types, c.Throws), | |
| 137 | + | Args: c.Parameters.Template(ns.Name, "", p.Types, c.Throws, types.ArgsFromGoToC), | |
| 138 | 138 | Ret: c.ReturnValue.Template(ns.Name, "", p.Types, c.Throws), | |
| 139 | 139 | } | |
| 140 | 140 | } | |
| @@ -148,7 +148,7 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string | |||
| 148 | 148 | fieldName = "x" + util.SnakeToCamel(f.Name) // Prefix callback pointer fields with `x` to make them private | |
| 149 | 149 | ||
| 150 | 150 | callbackName := util.SnakeToCamel(f.Name) | |
| 151 | - | args := f.Callback.Parameters.Template(ns.Name, "", p.Types, f.Callback.Throws) | |
| 151 | + | args := f.Callback.Parameters.Template(ns.Name, "", p.Types, f.Callback.Throws, types.ArgsFromCToGo) | |
| 152 | 152 | ret := f.Callback.ReturnValue.Template(ns.Name, "", p.Types, f.Callback.Throws) | |
| 153 | 153 | ||
| 154 | 154 | apiTypes := args.API.Types | |
| @@ -228,7 +228,7 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string | |||
| 228 | 228 | Doc: f.Doc.StringSafe(), | |
| 229 | 229 | Name: name, | |
| 230 | 230 | CName: f.CIdentifier, | |
| 231 | - | Args: f.Parameters.Template(ns.Name, "", p.Types, f.Throws), | |
| 231 | + | Args: f.Parameters.Template(ns.Name, "", p.Types, f.Throws, types.ArgsFromGoToC), | |
| 232 | 232 | Ret: f.ReturnValue.Template(ns.Name, "", p.Types, f.Throws), | |
| 233 | 233 | }) | |
| 234 | 234 | } | |
| @@ -252,7 +252,7 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string | |||
| 252 | 252 | cbT := types.CallbackTemplate{ | |
| 253 | 253 | Doc: cb.Doc.StringSafe(), | |
| 254 | 254 | Name: cb.Name, | |
| 255 | - | Args: cb.Parameters.Template(ns.Name, "", p.Types, cb.Throws), | |
| 255 | + | Args: cb.Parameters.Template(ns.Name, "", p.Types, cb.Throws, types.ArgsFromCToGo), | |
| 256 | 256 | Ret: cb.ReturnValue.Template(ns.Name, "", p.Types, cb.Throws), | |
| 257 | 257 | } | |
| 258 | 258 | callbacks[fn] = append(callbacks[fn], cbT) | |
| @@ -307,7 +307,7 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string | |||
| 307 | 307 | Name: name, | |
| 308 | 308 | CName: f.CIdentifier, | |
| 309 | 309 | Doc: f.Doc.StringSafe(), | |
| 310 | - | Args: f.Parameters.Template(ns.Name, "", p.Types, f.Throws), | |
| 310 | + | Args: f.Parameters.Template(ns.Name, "", p.Types, f.Throws, types.ArgsFromGoToC), | |
| 311 | 311 | Ret: f.ReturnValue.Template(ns.Name, "", p.Types, f.Throws), | |
| 312 | 312 | }) | |
| 313 | 313 | } | |
| @@ -326,18 +326,19 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string | |||
| 326 | 326 | Name: util.ConstructorName(c.Name, cls.Name), | |
| 327 | 327 | CName: c.CIdentifier, | |
| 328 | 328 | Doc: c.Doc.StringSafe(), | |
| 329 | - | Args: c.Parameters.Template(ns.Name, "", p.Types, c.Throws), | |
| 329 | + | Args: c.Parameters.Template(ns.Name, "", p.Types, c.Throws, types.ArgsFromGoToC), | |
| 330 | 330 | Ret: c.ReturnValue.Template(ns.Name, "", p.Types, c.Throws), | |
| 331 | 331 | } | |
| 332 | 332 | } | |
| 333 | 333 | signals := make([]types.SignalsTemplate, len(cls.Signals)) | |
| 334 | 334 | for i, s := range cls.Signals { | |
| 335 | 335 | signals[i] = types.SignalsTemplate{ | |
| 336 | - | Doc: s.Doc.StringSafe(), | |
| 337 | - | Name: util.DashToCamel(s.Name), | |
| 338 | - | CName: s.Name, | |
| 339 | - | Args: s.Parameters.Template(ns.Name, "", p.Types, false), | |
| 340 | - | Ret: s.ReturnValue.Template(ns.Name, "", p.Types, false), | |
| 336 | + | Doc: s.Doc.StringSafe(), | |
| 337 | + | Name: util.DashToCamel(s.Name), | |
| 338 | + | CName: s.Name, | |
| 339 | + | Args: s.Parameters.Template(ns.Name, "", p.Types, false, types.ArgsFromCToGo), | |
| 340 | + | Ret: s.ReturnValue.Template(ns.Name, "", p.Types, false), | |
| 341 | + | Detailed: s.Detailed, | |
| 341 | 342 | } | |
| 342 | 343 | } | |
| 343 | 344 | receivers := make([]types.FuncTemplate, len(cls.Methods)) | |
| @@ -348,7 +349,7 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string | |||
| 348 | 349 | Doc: f.Doc.StringSafe(), | |
| 349 | 350 | Name: name, | |
| 350 | 351 | CName: f.CIdentifier, | |
| 351 | - | Args: f.Parameters.Template(ns.Name, "", p.Types, f.Throws), | |
| 352 | + | Args: f.Parameters.Template(ns.Name, "", p.Types, f.Throws, types.ArgsFromGoToC), | |
| 352 | 353 | Ret: f.ReturnValue.Template(ns.Name, "", p.Types, f.Throws), | |
| 353 | 354 | } | |
| 354 | 355 | } | |
| @@ -359,7 +360,7 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string | |||
| 359 | 360 | Name: name, | |
| 360 | 361 | CName: f.CIdentifier, | |
| 361 | 362 | Doc: f.Doc.StringSafe(), | |
| 362 | - | Args: f.Parameters.Template(ns.Name, "", p.Types, f.Throws), | |
| 363 | + | Args: f.Parameters.Template(ns.Name, "", p.Types, f.Throws, types.ArgsFromGoToC), | |
| 363 | 364 | Ret: f.ReturnValue.Template(ns.Name, "", p.Types, f.Throws), | |
| 364 | 365 | } | |
| 365 | 366 | } | |
| @@ -423,20 +424,98 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string | |||
| 423 | 424 | // as they should only be loaded when there are classes | |
| 424 | 425 | needsInit := (len(functions[fn]) + methods) > 0 | |
| 425 | 426 | ||
| 427 | + | // Check if any receiver method has callback parameters | |
| 428 | + | // This is used to conditionally import unsafe and purego | |
| 429 | + | hasReceiverCallbacks := false | |
| 430 | + | for _, rec := range records[fn] { | |
| 431 | + | for _, r := range rec.Receivers { | |
| 432 | + | if len(r.Args.Callbacks) > 0 { | |
| 433 | + | hasReceiverCallbacks = true | |
| 434 | + | break | |
| 435 | + | } | |
| 436 | + | } | |
| 437 | + | if hasReceiverCallbacks { | |
| 438 | + | break | |
| 439 | + | } | |
| 440 | + | } | |
| 441 | + | if !hasReceiverCallbacks { | |
| 442 | + | for _, cls := range classes[fn] { | |
| 443 | + | for _, r := range cls.Receivers { | |
| 444 | + | if len(r.Args.Callbacks) > 0 { | |
| 445 | + | hasReceiverCallbacks = true | |
| 446 | + | break | |
| 447 | + | } | |
| 448 | + | } | |
| 449 | + | if hasReceiverCallbacks { | |
| 450 | + | break | |
| 451 | + | } | |
| 452 | + | } | |
| 453 | + | } | |
| 454 | + | ||
| 455 | + | // Check if any standalone function has callback parameters | |
| 456 | + | hasFunctionCallbacks := false | |
| 457 | + | for _, f := range functions[fn] { | |
| 458 | + | if len(f.Args.Callbacks) > 0 { | |
| 459 | + | hasFunctionCallbacks = true | |
| 460 | + | break | |
| 461 | + | } | |
| 462 | + | } | |
| 463 | + | ||
| 464 | + | needsCoreHelpers := false | |
| 465 | + | checkFuncArgs := func(funcs []types.FuncTemplate) { | |
| 466 | + | if needsCoreHelpers { | |
| 467 | + | return | |
| 468 | + | } | |
| 469 | + | for _, f := range funcs { | |
| 470 | + | if f.Args.NeedsCore() { | |
| 471 | + | needsCoreHelpers = true | |
| 472 | + | return | |
| 473 | + | } | |
| 474 | + | } | |
| 475 | + | } | |
| 476 | + | checkInterfaceArgs := func(funcs []types.InterfaceFuncTemplate) { | |
| 477 | + | if needsCoreHelpers { | |
| 478 | + | return | |
| 479 | + | } | |
| 480 | + | for _, f := range funcs { | |
| 481 | + | if f.Args.NeedsCore() { | |
| 482 | + | needsCoreHelpers = true | |
| 483 | + | return | |
| 484 | + | } | |
| 485 | + | } | |
| 486 | + | } | |
| 487 | + | ||
| 488 | + | for _, rec := range records[fn] { | |
| 489 | + | checkFuncArgs(rec.Constructors) | |
| 490 | + | checkFuncArgs(rec.Receivers) | |
| 491 | + | } | |
| 492 | + | for _, cls := range classes[fn] { | |
| 493 | + | checkFuncArgs(cls.Constructors) | |
| 494 | + | checkFuncArgs(cls.Receivers) | |
| 495 | + | checkFuncArgs(cls.Functions) | |
| 496 | + | } | |
| 497 | + | checkFuncArgs(functions[fn]) | |
| 498 | + | for _, inter := range interfaces[fn] { | |
| 499 | + | checkInterfaceArgs(inter.Methods) | |
| 500 | + | } | |
| 501 | + | ||
| 426 | 502 | args := types.TemplateArg{ | |
| 427 | - | PkgName: pkgName, | |
| 428 | - | PkgEnv: strings.ToUpper(pkgName), | |
| 429 | - | PkgConfigName: pkgConfigName, | |
| 430 | - | SharedLibraries: sharedLibraries, | |
| 431 | - | NeedsInit: needsInit, | |
| 432 | - | Aliases: aliases[fn], | |
| 433 | - | Callbacks: callbacks[fn], | |
| 434 | - | Records: records[fn], | |
| 435 | - | Enums: enums[fn], | |
| 436 | - | Constants: constants[fn], | |
| 437 | - | Functions: functions[fn], | |
| 438 | - | Interfaces: interfaces[fn], | |
| 439 | - | Classes: classes[fn], | |
| 503 | + | PkgName: pkgName, | |
| 504 | + | PkgEnv: strings.ToUpper(pkgName), | |
| 505 | + | PkgConfigName: pkgConfigName, | |
| 506 | + | SharedLibraries: sharedLibraries, | |
| 507 | + | NeedsInit: needsInit, | |
| 508 | + | NeedsCore: needsCoreHelpers, | |
| 509 | + | HasReceiverCallbacks: hasReceiverCallbacks, | |
| 510 | + | HasFunctionCallbacks: hasFunctionCallbacks, | |
| 511 | + | Aliases: aliases[fn], | |
| 512 | + | Callbacks: callbacks[fn], | |
| 513 | + | Records: records[fn], | |
| 514 | + | Enums: enums[fn], | |
| 515 | + | Constants: constants[fn], | |
| 516 | + | Functions: functions[fn], | |
| 517 | + | Interfaces: interfaces[fn], | |
| 518 | + | Classes: classes[fn], | |
| 440 | 519 | } | |
| 441 | 520 | ||
| 442 | 521 | os.MkdirAll(fmt.Sprintf(dir+"/%s", pkgName), 0o755) | |
M internal/gir/types/interface.go +1 -1
| @@ -28,7 +28,7 @@ func ConvertInterface(currns string, ins string, inter Interface, implemented ma | |||
| 28 | 28 | Doc: m.Doc.StringSafe(), | |
| 29 | 29 | CName: m.CIdentifier, | |
| 30 | 30 | Name: name, | |
| 31 | - | Args: m.Parameters.Template(currns, ins, kinds, m.Throws), | |
| 31 | + | Args: m.Parameters.Template(currns, ins, kinds, m.Throws, ArgsFromGoToC), | |
| 32 | 32 | Ret: m.ReturnValue.Template(currns, ins, kinds, m.Throws), | |
| 33 | 33 | }, | |
| 34 | 34 | }) | |
M internal/gir/types/kind.go +11 -0
| @@ -53,6 +53,17 @@ func (km KindMap) MustInterface(ns string, name string) Interface { | |||
| 53 | 53 | return p.Value.(Interface) | |
| 54 | 54 | } | |
| 55 | 55 | ||
| 56 | + | // GetCallback retrieves a callback definition by namespace and name. | |
| 57 | + | // Returns the Callback and true if found, otherwise nil and false. | |
| 58 | + | func (km KindMap) GetCallback(ns string, name string) (Callback, bool) { | |
| 59 | + | p := km.pair(ns, name) | |
| 60 | + | if p.K != CallbackType { | |
| 61 | + | return Callback{}, false | |
| 62 | + | } | |
| 63 | + | cb, ok := p.Value.(Callback) | |
| 64 | + | return cb, ok | |
| 65 | + | } | |
| 66 | + | ||
| 56 | 67 | type KindPair struct { | |
| 57 | 68 | K Kind | |
| 58 | 69 | Value interface{} | |
M internal/gir/types/template.go +188 -11
| @@ -17,9 +17,27 @@ type argsTemplate struct { | |||
| 17 | 17 | // Call are the variables as given in a function call | |
| 18 | 18 | Call []string | |
| 19 | 19 | ||
| 20 | + | // CallWithRefs is like Call but with callback parameters using {name}Ref | |
| 21 | + | // for use in contexts that generate closure wrappers | |
| 22 | + | CallWithRefs []string | |
| 23 | + | ||
| 20 | 24 | Full []string | |
| 21 | 25 | } | |
| 22 | 26 | ||
| 27 | + | // CallbackParam holds metadata for callback parameters to enable proper closure generation | |
| 28 | + | type CallbackParam struct { | |
| 29 | + | // Name is the parameter name (e.g., "CallbackVar") | |
| 30 | + | Name string | |
| 31 | + | // TypeName is the callback type name (e.g., "TickCallback") | |
| 32 | + | TypeName string | |
| 33 | + | // PureTypes are the pure argument types for the closure | |
| 34 | + | PureTypes []string | |
| 35 | + | // RetRaw is the return type for the closure (e.g., "bool") | |
| 36 | + | RetRaw string | |
| 37 | + | // Nullable indicates if the callback can be nil | |
| 38 | + | Nullable bool | |
| 39 | + | } | |
| 40 | + | ||
| 23 | 41 | type funcArgsTemplate struct { | |
| 24 | 42 | // Pure are the arguments as passed directly to PureGo | |
| 25 | 43 | // The pure Call is a special case that contains the arguments for a callback call | |
| @@ -27,16 +45,99 @@ type funcArgsTemplate struct { | |||
| 27 | 45 | ||
| 28 | 46 | // API are the arguments as suitable for a Go API | |
| 29 | 47 | API argsTemplate | |
| 48 | + | ||
| 49 | + | // Callbacks tracks callback parameters for proper closure generation | |
| 50 | + | Callbacks []CallbackParam | |
| 51 | + | ||
| 52 | + | // UsesNullableHelper indicates nullable string handling that needs core import. | |
| 53 | + | UsesNullableHelper bool | |
| 30 | 54 | } | |
| 31 | 55 | ||
| 32 | - | func (f *funcArgsTemplate) AddAPI(t string, n string, k Kind, ns string, nullable bool, isOut bool) { | |
| 56 | + | // ArgContext indicates where the arguments are flowing so we can handle | |
| 57 | + | // direction-sensitive cases (e.g. nullable strings) differently. | |
| 58 | + | type ArgContext int | |
| 59 | + | ||
| 60 | + | const ( | |
| 61 | + | // ArgsFromGoToC covers regular functions/methods where Go calls into C. | |
| 62 | + | ArgsFromGoToC ArgContext = iota | |
| 63 | + | // ArgsFromCToGo covers callbacks/signals where C calls into Go. | |
| 64 | + | ArgsFromCToGo | |
| 65 | + | ) | |
| 66 | + | ||
| 67 | + | func isStringType(t string) bool { | |
| 68 | + | if strings.HasPrefix(t, "[]") { | |
| 69 | + | return false | |
| 70 | + | } | |
| 71 | + | return strings.TrimLeft(t, "*") == "string" | |
| 72 | + | } | |
| 73 | + | ||
| 74 | + | // NeedsCore reports whether this argument set requires core helpers. | |
| 75 | + | func (f funcArgsTemplate) NeedsCore() bool { | |
| 76 | + | return f.UsesNullableHelper | |
| 77 | + | } | |
| 78 | + | ||
| 79 | + | func qualifyCallbackType(t string, callbackNS string, currentNS string) string { | |
| 80 | + | if t == "" || callbackNS == "" || strings.EqualFold(callbackNS, currentNS) { | |
| 81 | + | return t | |
| 82 | + | } | |
| 83 | + | ||
| 84 | + | if strings.Contains(t, ".") { | |
| 85 | + | return t | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | ptrPrefix := "" | |
| 89 | + | base := t | |
| 90 | + | for strings.HasPrefix(base, "*") { | |
| 91 | + | ptrPrefix += "*" | |
| 92 | + | base = strings.TrimPrefix(base, "*") | |
| 93 | + | } | |
| 94 | + | ||
| 95 | + | slicePrefix := "" | |
| 96 | + | for strings.HasPrefix(base, "[]") { | |
| 97 | + | slicePrefix += "[]" | |
| 98 | + | base = strings.TrimPrefix(base, "[]") | |
| 99 | + | } | |
| 100 | + | ||
| 101 | + | arrayPrefix := "" | |
| 102 | + | for strings.HasPrefix(base, "[") { | |
| 103 | + | end := strings.Index(base, "]") | |
| 104 | + | if end == -1 { | |
| 105 | + | break | |
| 106 | + | } | |
| 107 | + | arrayPrefix += base[:end+1] | |
| 108 | + | base = base[end+1:] | |
| 109 | + | } | |
| 110 | + | ||
| 111 | + | switch base { | |
| 112 | + | case "bool", "byte", "complex64", "complex128", "error", "float32", "float64", "int", "int8", "int16", "int32", "int64", "rune", "string", "uint", "uint8", "uint16", "uint32", "uint64", "uintptr": | |
| 113 | + | return t | |
| 114 | + | } | |
| 115 | + | ||
| 116 | + | if base == "" { | |
| 117 | + | return t | |
| 118 | + | } | |
| 119 | + | ||
| 120 | + | qualifiedBase := callbackNS + "." + base | |
| 121 | + | return ptrPrefix + slicePrefix + arrayPrefix + qualifiedBase | |
| 122 | + | } | |
| 123 | + | ||
| 124 | + | func qualifyCallbackTypes(types []string, callbackNS string, currentNS string) []string { | |
| 125 | + | qualified := make([]string, len(types)) | |
| 126 | + | for i, t := range types { | |
| 127 | + | qualified[i] = qualifyCallbackType(t, callbackNS, currentNS) | |
| 128 | + | } | |
| 129 | + | return qualified | |
| 130 | + | } | |
| 131 | + | ||
| 132 | + | func (f *funcArgsTemplate) AddAPI(t string, n string, k Kind, ns string, nullable bool, isOut bool, ctx ArgContext) { | |
| 33 | 133 | c := n | |
| 134 | + | cRef := n // For CallWithRefs, defaults to same as Call | |
| 34 | 135 | stars := strings.Count(t, "*") | |
| 35 | 136 | gobjectNs := "gobject." | |
| 137 | + | glibNs := "glib." | |
| 36 | 138 | if strings.ToLower(ns) == "gobject" { | |
| 37 | 139 | gobjectNs = "" | |
| 38 | 140 | } | |
| 39 | - | glibNs := "glib." | |
| 40 | 141 | if strings.ToLower(ns) == "glib" { | |
| 41 | 142 | glibNs = "" | |
| 42 | 143 | } | |
| @@ -48,14 +149,28 @@ func (f *funcArgsTemplate) AddAPI(t string, n string, k Kind, ns string, nullabl | |||
| 48 | 149 | t = "*" + t | |
| 49 | 150 | } | |
| 50 | 151 | c = n | |
| 152 | + | cRef = n | |
| 51 | 153 | } else { | |
| 154 | + | // Nullable strings differ based on direction. For Go->C we need a *string API type | |
| 155 | + | // and pass a pointer (or nil) to C. For C->Go we keep the string as-is. | |
| 156 | + | if ctx == ArgsFromGoToC && nullable && isStringType(t) { | |
| 157 | + | f.UsesNullableHelper = true | |
| 158 | + | t = "*string" | |
| 159 | + | c = fmt.Sprintf("core.NullableStringToPtr(%s)", n) | |
| 160 | + | cRef = c | |
| 161 | + | } | |
| 162 | + | ||
| 52 | 163 | switch k { | |
| 53 | 164 | case CallbackType: | |
| 165 | + | // Call uses glib.NewCallback for contexts like callback accessor getters | |
| 54 | 166 | if nullable { | |
| 55 | 167 | c = fmt.Sprintf("%sNewCallbackNullable(%s)", glibNs, n) | |
| 56 | 168 | } else { | |
| 57 | 169 | c = fmt.Sprintf("%sNewCallback(%s)", glibNs, n) | |
| 58 | 170 | } | |
| 171 | + | // For CallWithRefs, start with the same value as Call | |
| 172 | + | // It will be updated to {name}Ref in Add() if the callback lookup succeeds | |
| 173 | + | cRef = c | |
| 59 | 174 | t = "*" + t | |
| 60 | 175 | case ClassesType: | |
| 61 | 176 | if stars == 0 { | |
| @@ -66,6 +181,7 @@ func (f *funcArgsTemplate) AddAPI(t string, n string, k Kind, ns string, nullabl | |||
| 66 | 181 | } else if stars == 1 { | |
| 67 | 182 | c = n + ".GoPointer()" | |
| 68 | 183 | } | |
| 184 | + | cRef = c | |
| 69 | 185 | case InterfacesType: | |
| 70 | 186 | t = strings.TrimPrefix(t, "*") | |
| 71 | 187 | if stars == 0 { | |
| @@ -76,21 +192,26 @@ func (f *funcArgsTemplate) AddAPI(t string, n string, k Kind, ns string, nullabl | |||
| 76 | 192 | } else if stars == 1 { | |
| 77 | 193 | c = n + ".GoPointer()" | |
| 78 | 194 | } | |
| 195 | + | cRef = c | |
| 196 | + | default: | |
| 197 | + | cRef = c | |
| 79 | 198 | } | |
| 80 | 199 | ||
| 81 | 200 | // special case for varargs | |
| 82 | 201 | if n == "varArgs" { | |
| 83 | 202 | c = n + "..." | |
| 203 | + | cRef = c | |
| 84 | 204 | } | |
| 85 | 205 | } | |
| 86 | 206 | ||
| 87 | 207 | f.API.Names = append(f.API.Names, n) | |
| 88 | 208 | f.API.Types = append(f.API.Types, t) | |
| 89 | 209 | f.API.Call = append(f.API.Call, c) | |
| 210 | + | f.API.CallWithRefs = append(f.API.CallWithRefs, cRef) | |
| 90 | 211 | f.API.Full = append(f.API.Full, n+" "+t) | |
| 91 | 212 | } | |
| 92 | 213 | ||
| 93 | - | func (f *funcArgsTemplate) AddPure(t string, n string, k Kind, isOut bool) { | |
| 214 | + | func (f *funcArgsTemplate) AddPure(t string, n string, k Kind, isOut bool, nullable bool, ctx ArgContext) { | |
| 94 | 215 | n += "p" | |
| 95 | 216 | c := n | |
| 96 | 217 | stars := strings.Count(t, "*") | |
| @@ -103,6 +224,12 @@ func (f *funcArgsTemplate) AddPure(t string, n string, k Kind, isOut bool) { | |||
| 103 | 224 | } | |
| 104 | 225 | c = n | |
| 105 | 226 | } else { | |
| 227 | + | if ctx == ArgsFromGoToC && nullable && isStringType(t) { | |
| 228 | + | f.UsesNullableHelper = true | |
| 229 | + | t = "uintptr" | |
| 230 | + | c = fmt.Sprintf("core.NullableStringToPtr(%s)", strings.TrimSuffix(n, "p")) | |
| 231 | + | } | |
| 232 | + | ||
| 106 | 233 | switch k { | |
| 107 | 234 | case RecordsType: | |
| 108 | 235 | if stars == 0 { | |
| @@ -142,7 +269,7 @@ func (f *funcArgsTemplate) AddPure(t string, n string, k Kind, isOut bool) { | |||
| 142 | 269 | f.Pure.Full = append(f.Pure.Full, n+" "+t) | |
| 143 | 270 | } | |
| 144 | 271 | ||
| 145 | - | func (f *funcArgsTemplate) Add(p Parameter, ins string, ns string, kinds KindMap) { | |
| 272 | + | func (f *funcArgsTemplate) Add(p Parameter, ins string, ns string, kinds KindMap, ctx ArgContext) { | |
| 146 | 273 | // get the lookup namespace | |
| 147 | 274 | // as if the interface namespace is non-empty | |
| 148 | 275 | // means we can also lookup in the namespace of the interface | |
| @@ -153,6 +280,9 @@ func (f *funcArgsTemplate) Add(p Parameter, ins string, ns string, kinds KindMap | |||
| 153 | 280 | goType := p.Translate(lns, kinds) | |
| 154 | 281 | kind := kinds.Kind(lns, goType) | |
| 155 | 282 | ||
| 283 | + | // Save the original type name before normalization for callback lookup | |
| 284 | + | originalType := goType | |
| 285 | + | ||
| 156 | 286 | stars := strings.Count(goType, "*") | |
| 157 | 287 | goType = util.NormalizeNamespace(ns, goType, true) | |
| 158 | 288 | ||
| @@ -168,12 +298,51 @@ func (f *funcArgsTemplate) Add(p Parameter, ins string, ns string, kinds KindMap | |||
| 168 | 298 | ||
| 169 | 299 | isOut := p.Direction == "out" | |
| 170 | 300 | ||
| 171 | - | f.AddAPI(goType, varName, kind, ns, p.Nullable, isOut) | |
| 172 | - | f.AddPure(goType, varName, kind, isOut) | |
| 301 | + | f.AddAPI(goType, varName, kind, ns, p.Nullable, isOut, ctx) | |
| 302 | + | f.AddPure(goType, varName, kind, isOut, p.Nullable, ctx) | |
| 303 | + | ||
| 304 | + | // For callback parameters (not out parameters), populate callback metadata | |
| 305 | + | // This enables the template to generate proper closure wrapping | |
| 306 | + | if kind == CallbackType && !isOut { | |
| 307 | + | if cb, ok := kinds.GetCallback(lns, originalType); ok { | |
| 308 | + | // Determine the callback's namespace from the original type name | |
| 309 | + | // e.g., "gio.AsyncReadyCallback" -> "gio", "AsyncReadyCallback" -> lns | |
| 310 | + | cbNs := lns | |
| 311 | + | if parts := strings.Split(originalType, "."); len(parts) > 1 { | |
| 312 | + | cbNs = parts[0] | |
| 313 | + | } | |
| 314 | + | ||
| 315 | + | // Get the callback's pure argument types and return type | |
| 316 | + | // Use cbNs (callback's namespace) for proper type lookups | |
| 317 | + | cbArgs := cb.Parameters.Template(cbNs, "", kinds, cb.Throws, ArgsFromCToGo) | |
| 318 | + | var retRaw string | |
| 319 | + | if cb.ReturnValue != nil { | |
| 320 | + | cbRet := cb.ReturnValue.Template(cbNs, "", kinds, cb.Throws) | |
| 321 | + | retRaw = cbRet.Raw | |
| 322 | + | } | |
| 323 | + | ||
| 324 | + | qualifiedPureTypes := qualifyCallbackTypes(cbArgs.Pure.Types, cbNs, ns) | |
| 325 | + | qualifiedRetRaw := qualifyCallbackType(retRaw, cbNs, ns) | |
| 326 | + | ||
| 327 | + | f.Callbacks = append(f.Callbacks, CallbackParam{ | |
| 328 | + | Name: varName, | |
| 329 | + | TypeName: strings.TrimPrefix(goType, "*"), | |
| 330 | + | PureTypes: qualifiedPureTypes, | |
| 331 | + | RetRaw: qualifiedRetRaw, | |
| 332 | + | Nullable: p.Nullable, | |
| 333 | + | }) | |
| 334 | + | ||
| 335 | + | // Update CallWithRefs to use {name}Ref since we have the callback info | |
| 336 | + | // for generating the closure wrapper | |
| 337 | + | lastIdx := len(f.API.CallWithRefs) - 1 | |
| 338 | + | f.API.CallWithRefs[lastIdx] = varName + "Ref" | |
| 339 | + | } | |
| 340 | + | } | |
| 173 | 341 | } | |
| 174 | 342 | ||
| 175 | 343 | func (f *funcArgsTemplate) AddThrows(ns string) { | |
| 176 | 344 | f.API.Call = append(f.API.Call, "&cerr") | |
| 345 | + | f.API.CallWithRefs = append(f.API.CallWithRefs, "&cerr") | |
| 177 | 346 | if strings.ToLower(ns) != "glib" { | |
| 178 | 347 | f.Pure.Types = append(f.Pure.Types, "**glib.Error") | |
| 179 | 348 | } else { | |
| @@ -410,11 +579,12 @@ type InterfaceFuncTemplate struct { | |||
| 410 | 579 | } | |
| 411 | 580 | ||
| 412 | 581 | type SignalsTemplate struct { | |
| 413 | - | Doc string | |
| 414 | - | Name string | |
| 415 | - | CName string | |
| 416 | - | Args funcArgsTemplate | |
| 417 | - | Ret funcRetTemplate | |
| 582 | + | Doc string | |
| 583 | + | Name string | |
| 584 | + | CName string | |
| 585 | + | Args funcArgsTemplate | |
| 586 | + | Ret funcRetTemplate | |
| 587 | + | Detailed bool | |
| 418 | 588 | } | |
| 419 | 589 | ||
| 420 | 590 | type PropertyTemplate struct { | |
| @@ -483,6 +653,13 @@ type TemplateArg struct { | |||
| 483 | 653 | SharedLibraries []string | |
| 484 | 654 | // NeedsInit declares whether or not this file needs an init code to register functions with purego | |
| 485 | 655 | NeedsInit bool | |
| 656 | + | // NeedsCore indicates if core helpers are required even without init. | |
| 657 | + | NeedsCore bool | |
| 658 | + | // HasReceiverCallbacks indicates if any receiver method has callback parameters | |
| 659 | + | // This is used to conditionally import unsafe and purego | |
| 660 | + | HasReceiverCallbacks bool | |
| 661 | + | // HasFunctionCallbacks indicates if any standalone function has callback parameters | |
| 662 | + | HasFunctionCallbacks bool | |
| 486 | 663 | // Imports defines the package imports that we need | |
| 487 | 664 | // This does not include purego | |
| 488 | 665 | // As the template already includes that if `NeedsInit` is set to true | |
M internal/gir/types/types.go +2 -2
| @@ -658,7 +658,7 @@ func (p *Parameter) VarName() string { | |||
| 658 | 658 | return snaked + "Var" | |
| 659 | 659 | } | |
| 660 | 660 | ||
| 661 | - | func (p *Parameters) Template(ns string, ifacens string, kinds KindMap, throws bool) funcArgsTemplate { | |
| 661 | + | func (p *Parameters) Template(ns string, ifacens string, kinds KindMap, throws bool, ctx ArgContext) funcArgsTemplate { | |
| 662 | 662 | if p == nil { | |
| 663 | 663 | return funcArgsTemplate{} | |
| 664 | 664 | } | |
| @@ -668,7 +668,7 @@ func (p *Parameters) Template(ns string, ifacens string, kinds KindMap, throws b | |||
| 668 | 668 | } | |
| 669 | 669 | args := funcArgsTemplate{} | |
| 670 | 670 | for _, par := range params { | |
| 671 | - | args.Add(par, ifacens, ns, kinds) | |
| 671 | + | args.Add(par, ifacens, ns, kinds, ctx) | |
| 672 | 672 | } | |
| 673 | 673 | if throws { | |
| 674 | 674 | args.AddThrows(ns) | |
M internal/gir/util/util.go +35 -0
| @@ -93,15 +93,47 @@ func AddNamespace(val, ns string) string { | |||
| 93 | 93 | if ns == "" || strings.Count(val, ".") >= 1 { | |
| 94 | 94 | return val | |
| 95 | 95 | } | |
| 96 | + | // Don't add namespace to Go builtin types | |
| 97 | + | if isGoBuiltinType(val) { | |
| 98 | + | return val | |
| 99 | + | } | |
| 96 | 100 | return PrefixValue(val, ns+".") | |
| 97 | 101 | } | |
| 98 | 102 | ||
| 103 | + | // goBuiltinTypes contains Go builtin types that should never be namespace-prefixed | |
| 104 | + | var goBuiltinTypes = map[string]bool{ | |
| 105 | + | "bool": true, "byte": true, "complex64": true, "complex128": true, | |
| 106 | + | "error": true, "float32": true, "float64": true, "int": true, | |
| 107 | + | "int8": true, "int16": true, "int32": true, "int64": true, | |
| 108 | + | "rune": true, "string": true, "uint": true, "uint8": true, | |
| 109 | + | "uint16": true, "uint32": true, "uint64": true, "uintptr": true, | |
| 110 | + | } | |
| 111 | + | ||
| 112 | + | // isGoBuiltinType checks if the given type (after stripping pointers and slices) is a Go builtin | |
| 113 | + | func isGoBuiltinType(gotype string) bool { | |
| 114 | + | // Strip pointer prefixes | |
| 115 | + | baseType := strings.TrimLeft(gotype, "*") | |
| 116 | + | // Strip slice prefix | |
| 117 | + | baseType = strings.TrimPrefix(baseType, "[]") | |
| 118 | + | // Strip any remaining pointers (e.g., *[]byte -> []byte -> byte) | |
| 119 | + | baseType = strings.TrimLeft(baseType, "*") | |
| 120 | + | return goBuiltinTypes[baseType] | |
| 121 | + | } | |
| 122 | + | ||
| 99 | 123 | // NormalizeNamespace converts a type to one that always includes a lowercase namespace | |
| 100 | 124 | // if no namespace is found, it adds `ns`, unless if strip is True then namespaces always equaling `ns` will be removed | |
| 101 | 125 | func NormalizeNamespace(ns string, gotype string, strip bool) string { | |
| 102 | 126 | if ns == "" { | |
| 103 | 127 | return "" | |
| 104 | 128 | } | |
| 129 | + | ||
| 130 | + | // Check if this is a Go builtin type before any modifications | |
| 131 | + | // Note: gotype here may still have * prefixes which are trimmed below | |
| 132 | + | trimmedForCheck := strings.Trim(gotype, "*") | |
| 133 | + | if isGoBuiltinType(trimmedForCheck) { | |
| 134 | + | return trimmedForCheck | |
| 135 | + | } | |
| 136 | + | ||
| 105 | 137 | gotype = strings.Trim(gotype, "*") | |
| 106 | 138 | splt := strings.Split(gotype, ".") | |
| 107 | 139 | if len(splt) <= 1 { | |
| @@ -220,6 +252,9 @@ func PropertyScalarSet(notGObject bool, gvalueType, setMethod string) string { | |||
| 220 | 252 | if notGObject { | |
| 221 | 253 | prefix = "gobject." | |
| 222 | 254 | } | |
| 255 | + | if setMethod == "SetString" { | |
| 256 | + | return prefix + gvalueType + ")\n\tv." + setMethod + "(&value" | |
| 257 | + | } | |
| 223 | 258 | return prefix + gvalueType + ")\n\tv." + setMethod + "(value" | |
| 224 | 259 | } | |
| 225 | 260 | ||
M pkg/core/core.go +9 -7
| @@ -3,11 +3,13 @@ package core | |||
| 3 | 3 | import "github.com/jwijenbergh/puregotk/internal/core" | |
| 4 | 4 | ||
| 5 | 5 | var ( | |
| 6 | - | GetPaths = core.GetPaths | |
| 7 | - | ByteSlice = core.ByteSlice | |
| 8 | - | GoStringSlice = core.GoStringSlice | |
| 9 | - | GoString = core.GoString | |
| 10 | - | SetPackageName = core.SetPackageName | |
| 11 | - | SetSharedLibraries = core.SetSharedLibraries | |
| 12 | - | PuregoSafeRegister = core.PuregoSafeRegister | |
| 6 | + | GetPaths = core.GetPaths | |
| 7 | + | ByteSlice = core.ByteSlice | |
| 8 | + | GoStringSlice = core.GoStringSlice | |
| 9 | + | GoString = core.GoString | |
| 10 | + | NullableStringToPtr = core.NullableStringToPtr | |
| 11 | + | PtrToNullableString = core.PtrToNullableString | |
| 12 | + | SetPackageName = core.SetPackageName | |
| 13 | + | SetSharedLibraries = core.SetSharedLibraries | |
| 14 | + | PuregoSafeRegister = core.PuregoSafeRegister | |
| 13 | 15 | ) | |
M templates/go +151 -10
| @@ -4,27 +4,38 @@ package {{.PkgName}} | |||
| 4 | 4 | {{ $NotGObject := ne .PkgName "gobject" }} | |
| 5 | 5 | {{ $NotGLib := ne .PkgName "glib" }} | |
| 6 | 6 | {{ $HasSignals := false }} | |
| 7 | + | {{ $HasDetailedSignals := false }} | |
| 7 | 8 | {{range .Classes -}} | |
| 8 | 9 | {{if .Signals}} | |
| 9 | 10 | {{ $HasSignals = true }} | |
| 10 | 11 | {{end}} | |
| 12 | + | {{range .Signals}} | |
| 13 | + | {{if .Detailed}} | |
| 14 | + | {{ $HasDetailedSignals = true }} | |
| 15 | + | {{end}} | |
| 16 | + | {{end}} | |
| 11 | 17 | {{end}} | |
| 12 | - | {{ $NeedsUnsafe := or .Records $HasSignals }} | |
| 13 | - | {{ $NeedsPurego := or .NeedsInit $HasSignals }} | |
| 14 | - | {{ $AnyImports := or .NeedsInit .Records $HasSignals }} | |
| 18 | + | {{ $HasCallbacks := or .HasReceiverCallbacks .HasFunctionCallbacks }} | |
| 19 | + | {{ $NeedsUnsafe := or .Records $HasSignals $HasCallbacks }} | |
| 20 | + | {{ $NeedsPurego := or .NeedsInit $HasSignals $HasCallbacks }} | |
| 21 | + | {{ $NeedsCore := or .NeedsInit .NeedsCore }} | |
| 22 | + | {{ $AnyImports := or $NeedsCore .Records $HasSignals $HasCallbacks $HasDetailedSignals }} | |
| 15 | 23 | ||
| 16 | 24 | {{if $AnyImports}} | |
| 17 | 25 | import ( | |
| 18 | 26 | {{- if $NeedsUnsafe}} | |
| 19 | 27 | "unsafe" | |
| 20 | 28 | {{- end}} | |
| 29 | + | {{- if $HasDetailedSignals}} | |
| 30 | + | "fmt" | |
| 31 | + | {{- end}} | |
| 21 | 32 | {{- if .Records}} | |
| 22 | 33 | "structs" | |
| 23 | 34 | {{- end}} | |
| 24 | 35 | {{- if $NeedsPurego}} | |
| 25 | 36 | "github.com/jwijenbergh/purego" | |
| 26 | 37 | {{- end}} | |
| 27 | - | {{- if .NeedsInit}} | |
| 38 | + | {{- if $NeedsCore}} | |
| 28 | 39 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 29 | 40 | {{- end}} | |
| 30 | 41 | ) | |
| @@ -66,7 +77,24 @@ var x{{.Name}} func({{conv .Args.Pure.Types}}) {{.Ret.Raw}} | |||
| 66 | 77 | {{.Doc}} | |
| 67 | 78 | func {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Return}} { | |
| 68 | 79 | {{.Ret.Preamble $NotGLib}} | |
| 69 | - | {{if .Ret.Value}}cret :={{end}}x{{.Name}}({{convd .Args.API.Call}}) | |
| 80 | + | {{- /* Generate closure wrappers for callback parameters */}} | |
| 81 | + | {{range .Args.Callbacks}} | |
| 82 | + | var {{.Name}}Ref uintptr | |
| 83 | + | if {{.Name}} != nil { | |
| 84 | + | {{.Name}}Ptr := uintptr(unsafe.Pointer({{.Name}})) | |
| 85 | + | if cbRefPtr, ok := {{if $NotGLib}}glib.{{end}}GetCallback({{.Name}}Ptr); ok { | |
| 86 | + | {{.Name}}Ref = cbRefPtr | |
| 87 | + | } else { | |
| 88 | + | fcb := func({{range $i, $t := .PureTypes}}{{if $i}}, {{end}}arg{{$i}} {{$t}}{{end}}) {{.RetRaw}} { | |
| 89 | + | cbFn := *{{.Name}} | |
| 90 | + | {{if .RetRaw}}return {{end}}cbFn({{range $i, $t := .PureTypes}}{{if $i}}, {{end}}arg{{$i}}{{end}}) | |
| 91 | + | } | |
| 92 | + | {{.Name}}Ref = purego.NewCallback(fcb) | |
| 93 | + | {{if $NotGLib}}glib.{{end}}SaveCallback({{.Name}}Ptr, {{.Name}}Ref) | |
| 94 | + | } | |
| 95 | + | } | |
| 96 | + | {{end}} | |
| 97 | + | {{if .Ret.Value}}cret :={{end}}x{{.Name}}({{convd .Args.API.CallWithRefs}}) | |
| 70 | 98 | {{.Ret.Fmt $NotGObject}} | |
| 71 | 99 | } | |
| 72 | 100 | {{end}} | |
| @@ -78,7 +106,24 @@ var x{{$outer.Name}}{{.Name}} func(uintptr {{convc .Args.Pure.Types}}) {{.Ret.Ra | |||
| 78 | 106 | {{.Doc}} | |
| 79 | 107 | func (x *{{$outer.Name}}) {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Return}} { | |
| 80 | 108 | {{.Ret.Preamble $NotGLib}} | |
| 81 | - | {{if .Ret.Value}}cret :={{end}}x{{$outer.Name}}{{.Name}}(x.GoPointer() {{convcd .Args.API.Call}}) | |
| 109 | + | {{- /* Generate closure wrappers for callback parameters */}} | |
| 110 | + | {{range .Args.Callbacks}} | |
| 111 | + | var {{.Name}}Ref uintptr | |
| 112 | + | if {{.Name}} != nil { | |
| 113 | + | {{.Name}}Ptr := uintptr(unsafe.Pointer({{.Name}})) | |
| 114 | + | if cbRefPtr, ok := {{if $NotGLib}}glib.{{end}}GetCallback({{.Name}}Ptr); ok { | |
| 115 | + | {{.Name}}Ref = cbRefPtr | |
| 116 | + | } else { | |
| 117 | + | fcb := func({{range $i, $t := .PureTypes}}{{if $i}}, {{end}}arg{{$i}} {{$t}}{{end}}) {{.RetRaw}} { | |
| 118 | + | cbFn := *{{.Name}} | |
| 119 | + | {{if .RetRaw}}return {{end}}cbFn({{range $i, $t := .PureTypes}}{{if $i}}, {{end}}arg{{$i}}{{end}}) | |
| 120 | + | } | |
| 121 | + | {{.Name}}Ref = purego.NewCallback(fcb) | |
| 122 | + | {{if $NotGLib}}glib.{{end}}SaveCallback({{.Name}}Ptr, {{.Name}}Ref) | |
| 123 | + | } | |
| 124 | + | } | |
| 125 | + | {{end}} | |
| 126 | + | {{if .Ret.Value}}cret :={{end}}x{{$outer.Name}}{{.Name}}(x.GoPointer() {{convcd .Args.API.CallWithRefs}}) | |
| 82 | 127 | {{.Ret.Fmt $NotGObject}} | |
| 83 | 128 | } | |
| 84 | 129 | {{end}} | |
| @@ -239,7 +284,24 @@ var x{{.Name}} func({{conv .Args.Pure.Types}}) {{.Ret.Raw}} | |||
| 239 | 284 | {{.Doc}} | |
| 240 | 285 | func {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Return}} { | |
| 241 | 286 | {{.Ret.Preamble $NotGLib}} | |
| 242 | - | {{if .Ret.Value}}cret := {{end}}x{{.Name}}({{convd .Args.API.Call}}) | |
| 287 | + | {{- /* Generate closure wrappers for callback parameters */}} | |
| 288 | + | {{range .Args.Callbacks}} | |
| 289 | + | var {{.Name}}Ref uintptr | |
| 290 | + | if {{.Name}} != nil { | |
| 291 | + | {{.Name}}Ptr := uintptr(unsafe.Pointer({{.Name}})) | |
| 292 | + | if cbRefPtr, ok := {{if $NotGLib}}glib.{{end}}GetCallback({{.Name}}Ptr); ok { | |
| 293 | + | {{.Name}}Ref = cbRefPtr | |
| 294 | + | } else { | |
| 295 | + | fcb := func({{range $i, $t := .PureTypes}}{{if $i}}, {{end}}arg{{$i}} {{$t}}{{end}}) {{.RetRaw}} { | |
| 296 | + | cbFn := *{{.Name}} | |
| 297 | + | {{if .RetRaw}}return {{end}}cbFn({{range $i, $t := .PureTypes}}{{if $i}}, {{end}}arg{{$i}}{{end}}) | |
| 298 | + | } | |
| 299 | + | {{.Name}}Ref = purego.NewCallback(fcb) | |
| 300 | + | {{if $NotGLib}}glib.{{end}}SaveCallback({{.Name}}Ptr, {{.Name}}Ref) | |
| 301 | + | } | |
| 302 | + | } | |
| 303 | + | {{end}} | |
| 304 | + | {{if .Ret.Value}}cret := {{end}}x{{.Name}}({{convd .Args.API.CallWithRefs}}) | |
| 243 | 305 | {{.Ret.Fmt $NotGObject}} | |
| 244 | 306 | } | |
| 245 | 307 | {{end}} | |
| @@ -274,7 +336,24 @@ var x{{.Name}} func({{conv .Args.Pure.Types}}) {{.Ret.Raw}} | |||
| 274 | 336 | {{.Doc}} | |
| 275 | 337 | func {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Return}} { | |
| 276 | 338 | {{.Ret.Preamble $NotGLib}} | |
| 277 | - | {{if .Ret.Value}}cret :={{end}}x{{.Name}}({{convd .Args.API.Call}}) | |
| 339 | + | {{- /* Generate closure wrappers for callback parameters */}} | |
| 340 | + | {{range .Args.Callbacks}} | |
| 341 | + | var {{.Name}}Ref uintptr | |
| 342 | + | if {{.Name}} != nil { | |
| 343 | + | {{.Name}}Ptr := uintptr(unsafe.Pointer({{.Name}})) | |
| 344 | + | if cbRefPtr, ok := {{if $NotGLib}}glib.{{end}}GetCallback({{.Name}}Ptr); ok { | |
| 345 | + | {{.Name}}Ref = cbRefPtr | |
| 346 | + | } else { | |
| 347 | + | fcb := func({{range $i, $t := .PureTypes}}{{if $i}}, {{end}}arg{{$i}} {{$t}}{{end}}) {{.RetRaw}} { | |
| 348 | + | cbFn := *{{.Name}} | |
| 349 | + | {{if .RetRaw}}return {{end}}cbFn({{range $i, $t := .PureTypes}}{{if $i}}, {{end}}arg{{$i}}{{end}}) | |
| 350 | + | } | |
| 351 | + | {{.Name}}Ref = purego.NewCallback(fcb) | |
| 352 | + | {{if $NotGLib}}glib.{{end}}SaveCallback({{.Name}}Ptr, {{.Name}}Ref) | |
| 353 | + | } | |
| 354 | + | } | |
| 355 | + | {{end}} | |
| 356 | + | {{if .Ret.Value}}cret :={{end}}x{{.Name}}({{convd .Args.API.CallWithRefs}}) | |
| 278 | 357 | {{.Ret.Fmt $NotGObject}} | |
| 279 | 358 | } | |
| 280 | 359 | {{end}} | |
| @@ -286,7 +365,24 @@ var x{{$outer.Name}}{{.Name}} func(uintptr {{convc .Args.Pure.Types}}) {{.Ret.Ra | |||
| 286 | 365 | {{.Doc}} | |
| 287 | 366 | func (x *{{$outer.Name}}) {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Return}} { | |
| 288 | 367 | {{.Ret.Preamble $NotGLib}} | |
| 289 | - | {{if .Ret.Value}}cret :={{end}}x{{$outer.Name}}{{.Name}}(x.GoPointer() {{convcd .Args.API.Call}}) | |
| 368 | + | {{- /* Generate closure wrappers for callback parameters */}} | |
| 369 | + | {{range .Args.Callbacks}} | |
| 370 | + | var {{.Name}}Ref uintptr | |
| 371 | + | if {{.Name}} != nil { | |
| 372 | + | {{.Name}}Ptr := uintptr(unsafe.Pointer({{.Name}})) | |
| 373 | + | if cbRefPtr, ok := {{if $NotGLib}}glib.{{end}}GetCallback({{.Name}}Ptr); ok { | |
| 374 | + | {{.Name}}Ref = cbRefPtr | |
| 375 | + | } else { | |
| 376 | + | fcb := func({{range $i, $t := .PureTypes}}{{if $i}}, {{end}}arg{{$i}} {{$t}}{{end}}) {{.RetRaw}} { | |
| 377 | + | cbFn := *{{.Name}} | |
| 378 | + | {{if .RetRaw}}return {{end}}cbFn({{range $i, $t := .PureTypes}}{{if $i}}, {{end}}arg{{$i}}{{end}}) | |
| 379 | + | } | |
| 380 | + | {{.Name}}Ref = purego.NewCallback(fcb) | |
| 381 | + | {{if $NotGLib}}glib.{{end}}SaveCallback({{.Name}}Ptr, {{.Name}}Ref) | |
| 382 | + | } | |
| 383 | + | } | |
| 384 | + | {{end}} | |
| 385 | + | {{if .Ret.Value}}cret :={{end}}x{{$outer.Name}}{{.Name}}(x.GoPointer() {{convcd .Args.API.CallWithRefs}}) | |
| 290 | 386 | {{.Ret.Fmt $NotGObject}} | |
| 291 | 387 | } | |
| 292 | 388 | {{end}} | |
| @@ -350,6 +446,34 @@ func (x *{{$outer.Name}}) Connect{{.Name}}(cb *func({{$outer.Name}} {{convc .Arg | |||
| 350 | 446 | {{if $NotGLib}}glib.{{end}}SaveCallback(cbPtr, cbRefPtr) | |
| 351 | 447 | return {{if $NotGObject}}gobject.{{end}}SignalConnect(x.GoPointer(), "{{.CName}}", cbRefPtr) | |
| 352 | 448 | } | |
| 449 | + | {{if .Detailed}} | |
| 450 | + | // Connect{{.Name}}WithDetail connects to the "{{.CName}}" signal with a detail string. | |
| 451 | + | // The detail is appended as "{{.CName}}::<detail>". | |
| 452 | + | func (x *{{$outer.Name}}) Connect{{.Name}}WithDetail(detail string, cb *func({{$outer.Name}} {{convc .Args.API.Types}}) {{.Ret.Value}}) uint32 { | |
| 453 | + | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 454 | + | signalName := fmt.Sprintf("{{.CName}}::%s", detail) | |
| 455 | + | if cbRefPtr, ok := {{if $NotGLib}}glib.{{end}}GetCallback(cbPtr); ok { | |
| 456 | + | return {{if $NotGObject}}gobject.{{end}}SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 457 | + | } | |
| 458 | + | ||
| 459 | + | fcb := func(clsPtr uintptr {{convc .Args.Pure.Full}}) {{.Ret.Raw}} { | |
| 460 | + | fa := {{$outer.Name}}{} | |
| 461 | + | fa.Ptr = clsPtr | |
| 462 | + | cbFn := *cb | |
| 463 | + | {{if .Ret.Class}} | |
| 464 | + | {{.Name}}Cls := cbFn(fa {{convc .Args.Pure.Call}}) | |
| 465 | + | return {{.Name}}Cls.Ptr | |
| 466 | + | {{else if .Ret.Value}} | |
| 467 | + | return cbFn(fa {{convc .Args.Pure.Call}}) | |
| 468 | + | {{else}} | |
| 469 | + | cbFn(fa {{convc .Args.Pure.Call}}) | |
| 470 | + | {{end}} | |
| 471 | + | } | |
| 472 | + | cbRefPtr := purego.NewCallback(fcb) | |
| 473 | + | {{if $NotGLib}}glib.{{end}}SaveCallback(cbPtr, cbRefPtr) | |
| 474 | + | return {{if $NotGObject}}gobject.{{end}}SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 475 | + | } | |
| 476 | + | {{end}} | |
| 353 | 477 | {{end}} | |
| 354 | 478 | ||
| 355 | 479 | {{range .Interfaces -}} | |
| @@ -369,7 +493,24 @@ var x{{.Name}} func({{conv .Args.Pure.Types}}) {{.Ret.Raw}} | |||
| 369 | 493 | {{.Doc}} | |
| 370 | 494 | func {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Return}} { | |
| 371 | 495 | {{.Ret.Preamble $NotGLib}} | |
| 372 | - | {{if .Ret.Value}}cret := {{end}}x{{.Name}}({{convd .Args.API.Call}}) | |
| 496 | + | {{- /* Generate closure wrappers for callback parameters */}} | |
| 497 | + | {{range .Args.Callbacks}} | |
| 498 | + | var {{.Name}}Ref uintptr | |
| 499 | + | if {{.Name}} != nil { | |
| 500 | + | {{.Name}}Ptr := uintptr(unsafe.Pointer({{.Name}})) | |
| 501 | + | if cbRefPtr, ok := {{if $NotGLib}}glib.{{end}}GetCallback({{.Name}}Ptr); ok { | |
| 502 | + | {{.Name}}Ref = cbRefPtr | |
| 503 | + | } else { | |
| 504 | + | fcb := func({{range $i, $t := .PureTypes}}{{if $i}}, {{end}}arg{{$i}} {{$t}}{{end}}) {{.RetRaw}} { | |
| 505 | + | cbFn := *{{.Name}} | |
| 506 | + | {{if .RetRaw}}return {{end}}cbFn({{range $i, $t := .PureTypes}}{{if $i}}, {{end}}arg{{$i}}{{end}}) | |
| 507 | + | } | |
| 508 | + | {{.Name}}Ref = purego.NewCallback(fcb) | |
| 509 | + | {{if $NotGLib}}glib.{{end}}SaveCallback({{.Name}}Ptr, {{.Name}}Ref) | |
| 510 | + | } | |
| 511 | + | } | |
| 512 | + | {{end}} | |
| 513 | + | {{if .Ret.Value}}cret := {{end}}x{{.Name}}({{convd .Args.API.CallWithRefs}}) | |
| 373 | 514 | {{.Ret.Fmt $NotGObject}} | |
| 374 | 515 | } | |
| 375 | 516 | {{end}} | |
M v4/adw/adw-about-dialog.go +30 -30
| @@ -32,15 +32,15 @@ func ShowAboutDialog(ParentVar *gtk.Widget, FirstPropertyNameVar string, varArgs | |||
| 32 | 32 | ||
| 33 | 33 | } | |
| 34 | 34 | ||
| 35 | - | var xShowAboutDialogFromAppdata func(uintptr, string, string, string, ...interface{}) | |
| 35 | + | var xShowAboutDialogFromAppdata func(uintptr, string, uintptr, string, ...interface{}) | |
| 36 | 36 | ||
| 37 | 37 | // A convenience function for showing an application’s about dialog from | |
| 38 | 38 | // AppStream metadata. | |
| 39 | 39 | // | |
| 40 | 40 | // See [ctor@AboutDialog.new_from_appdata] for details. | |
| 41 | - | func ShowAboutDialogFromAppdata(ParentVar *gtk.Widget, ResourcePathVar string, ReleaseNotesVersionVar string, FirstPropertyNameVar string, varArgs ...interface{}) { | |
| 41 | + | func ShowAboutDialogFromAppdata(ParentVar *gtk.Widget, ResourcePathVar string, ReleaseNotesVersionVar *string, FirstPropertyNameVar string, varArgs ...interface{}) { | |
| 42 | 42 | ||
| 43 | - | xShowAboutDialogFromAppdata(ParentVar.GoPointer(), ResourcePathVar, ReleaseNotesVersionVar, FirstPropertyNameVar, varArgs...) | |
| 43 | + | xShowAboutDialogFromAppdata(ParentVar.GoPointer(), ResourcePathVar, core.NullableStringToPtr(ReleaseNotesVersionVar), FirstPropertyNameVar, varArgs...) | |
| 44 | 44 | ||
| 45 | 45 | } | |
| 46 | 46 | ||
| @@ -253,7 +253,7 @@ func NewAboutDialog() *AboutDialog { | |||
| 253 | 253 | return cls | |
| 254 | 254 | } | |
| 255 | 255 | ||
| 256 | - | var xNewAboutDialogFromAppdata func(string, string) uintptr | |
| 256 | + | var xNewAboutDialogFromAppdata func(string, uintptr) uintptr | |
| 257 | 257 | ||
| 258 | 258 | // Creates a new `AdwAboutDialog` using AppStream metadata. | |
| 259 | 259 | // | |
| @@ -276,10 +276,10 @@ var xNewAboutDialogFromAppdata func(string, string) uintptr | |||
| 276 | 276 | // [property@AboutDialog:release-notes-version] is set to match it, while | |
| 277 | 277 | // [property@AboutDialog:release-notes] is set from the AppStream release | |
| 278 | 278 | // description for that version. | |
| 279 | - | func NewAboutDialogFromAppdata(ResourcePathVar string, ReleaseNotesVersionVar string) *AboutDialog { | |
| 279 | + | func NewAboutDialogFromAppdata(ResourcePathVar string, ReleaseNotesVersionVar *string) *AboutDialog { | |
| 280 | 280 | var cls *AboutDialog | |
| 281 | 281 | ||
| 282 | - | cret := xNewAboutDialogFromAppdata(ResourcePathVar, ReleaseNotesVersionVar) | |
| 282 | + | cret := xNewAboutDialogFromAppdata(ResourcePathVar, core.NullableStringToPtr(ReleaseNotesVersionVar)) | |
| 283 | 283 | ||
| 284 | 284 | if cret == 0 { | |
| 285 | 285 | return nil | |
| @@ -290,7 +290,7 @@ func NewAboutDialogFromAppdata(ResourcePathVar string, ReleaseNotesVersionVar st | |||
| 290 | 290 | return cls | |
| 291 | 291 | } | |
| 292 | 292 | ||
| 293 | - | var xAboutDialogAddAcknowledgementSection func(uintptr, string, []string) | |
| 293 | + | var xAboutDialogAddAcknowledgementSection func(uintptr, uintptr, []string) | |
| 294 | 294 | ||
| 295 | 295 | // Adds a section to the Acknowledgements page. | |
| 296 | 296 | // | |
| @@ -309,13 +309,13 @@ var xAboutDialogAddAcknowledgementSection func(uintptr, string, []string) | |||
| 309 | 309 | // * [property@AboutDialog:documenters] | |
| 310 | 310 | // * [property@AboutDialog:translator-credits] | |
| 311 | 311 | // * [method@AboutDialog.add_credit_section] | |
| 312 | - | func (x *AboutDialog) AddAcknowledgementSection(NameVar string, PeopleVar []string) { | |
| 312 | + | func (x *AboutDialog) AddAcknowledgementSection(NameVar *string, PeopleVar []string) { | |
| 313 | 313 | ||
| 314 | - | xAboutDialogAddAcknowledgementSection(x.GoPointer(), NameVar, PeopleVar) | |
| 314 | + | xAboutDialogAddAcknowledgementSection(x.GoPointer(), core.NullableStringToPtr(NameVar), PeopleVar) | |
| 315 | 315 | ||
| 316 | 316 | } | |
| 317 | 317 | ||
| 318 | - | var xAboutDialogAddCreditSection func(uintptr, string, []string) | |
| 318 | + | var xAboutDialogAddCreditSection func(uintptr, uintptr, []string) | |
| 319 | 319 | ||
| 320 | 320 | // Adds an extra section to the Credits page. | |
| 321 | 321 | // | |
| @@ -332,13 +332,13 @@ var xAboutDialogAddCreditSection func(uintptr, string, []string) | |||
| 332 | 332 | // * [property@AboutDialog:documenters] | |
| 333 | 333 | // * [property@AboutDialog:translator-credits] | |
| 334 | 334 | // * [method@AboutDialog.add_acknowledgement_section] | |
| 335 | - | func (x *AboutDialog) AddCreditSection(NameVar string, PeopleVar []string) { | |
| 335 | + | func (x *AboutDialog) AddCreditSection(NameVar *string, PeopleVar []string) { | |
| 336 | 336 | ||
| 337 | - | xAboutDialogAddCreditSection(x.GoPointer(), NameVar, PeopleVar) | |
| 337 | + | xAboutDialogAddCreditSection(x.GoPointer(), core.NullableStringToPtr(NameVar), PeopleVar) | |
| 338 | 338 | ||
| 339 | 339 | } | |
| 340 | 340 | ||
| 341 | - | var xAboutDialogAddLegalSection func(uintptr, string, string, gtk.License, string) | |
| 341 | + | var xAboutDialogAddLegalSection func(uintptr, string, uintptr, gtk.License, uintptr) | |
| 342 | 342 | ||
| 343 | 343 | // Adds an extra section to the Legal page. | |
| 344 | 344 | // | |
| @@ -385,9 +385,9 @@ var xAboutDialogAddLegalSection func(uintptr, string, string, gtk.License, strin | |||
| 385 | 385 | // "Something completely custom here."); | |
| 386 | 386 | // | |
| 387 | 387 | // ``` | |
| 388 | - | func (x *AboutDialog) AddLegalSection(TitleVar string, CopyrightVar string, LicenseTypeVar gtk.License, LicenseVar string) { | |
| 388 | + | func (x *AboutDialog) AddLegalSection(TitleVar string, CopyrightVar *string, LicenseTypeVar gtk.License, LicenseVar *string) { | |
| 389 | 389 | ||
| 390 | - | xAboutDialogAddLegalSection(x.GoPointer(), TitleVar, CopyrightVar, LicenseTypeVar, LicenseVar) | |
| 390 | + | xAboutDialogAddLegalSection(x.GoPointer(), TitleVar, core.NullableStringToPtr(CopyrightVar), LicenseTypeVar, core.NullableStringToPtr(LicenseVar)) | |
| 391 | 391 | ||
| 392 | 392 | } | |
| 393 | 393 | ||
| @@ -1002,7 +1002,7 @@ func (c *AboutDialog) SetGoPointer(ptr uintptr) { | |||
| 1002 | 1002 | func (x *AboutDialog) SetPropertyApplicationIcon(value string) { | |
| 1003 | 1003 | var v gobject.Value | |
| 1004 | 1004 | v.Init(gobject.TypeStringVal) | |
| 1005 | - | v.SetString(value) | |
| 1005 | + | v.SetString(&value) | |
| 1006 | 1006 | x.SetProperty("application-icon", &v) | |
| 1007 | 1007 | } | |
| 1008 | 1008 | ||
| @@ -1023,7 +1023,7 @@ func (x *AboutDialog) GetPropertyApplicationIcon() string { | |||
| 1023 | 1023 | func (x *AboutDialog) SetPropertyApplicationName(value string) { | |
| 1024 | 1024 | var v gobject.Value | |
| 1025 | 1025 | v.Init(gobject.TypeStringVal) | |
| 1026 | - | v.SetString(value) | |
| 1026 | + | v.SetString(&value) | |
| 1027 | 1027 | x.SetProperty("application-name", &v) | |
| 1028 | 1028 | } | |
| 1029 | 1029 | ||
| @@ -1092,7 +1092,7 @@ func (x *AboutDialog) GetPropertyArtists() []string { | |||
| 1092 | 1092 | func (x *AboutDialog) SetPropertyComments(value string) { | |
| 1093 | 1093 | var v gobject.Value | |
| 1094 | 1094 | v.Init(gobject.TypeStringVal) | |
| 1095 | - | v.SetString(value) | |
| 1095 | + | v.SetString(&value) | |
| 1096 | 1096 | x.SetProperty("comments", &v) | |
| 1097 | 1097 | } | |
| 1098 | 1098 | ||
| @@ -1123,7 +1123,7 @@ func (x *AboutDialog) GetPropertyComments() string { | |||
| 1123 | 1123 | func (x *AboutDialog) SetPropertyCopyright(value string) { | |
| 1124 | 1124 | var v gobject.Value | |
| 1125 | 1125 | v.Init(gobject.TypeStringVal) | |
| 1126 | - | v.SetString(value) | |
| 1126 | + | v.SetString(&value) | |
| 1127 | 1127 | x.SetProperty("copyright", &v) | |
| 1128 | 1128 | } | |
| 1129 | 1129 | ||
| @@ -1159,7 +1159,7 @@ func (x *AboutDialog) GetPropertyCopyright() string { | |||
| 1159 | 1159 | func (x *AboutDialog) SetPropertyDebugInfo(value string) { | |
| 1160 | 1160 | var v gobject.Value | |
| 1161 | 1161 | v.Init(gobject.TypeStringVal) | |
| 1162 | - | v.SetString(value) | |
| 1162 | + | v.SetString(&value) | |
| 1163 | 1163 | x.SetProperty("debug-info", &v) | |
| 1164 | 1164 | } | |
| 1165 | 1165 | ||
| @@ -1191,7 +1191,7 @@ func (x *AboutDialog) GetPropertyDebugInfo() string { | |||
| 1191 | 1191 | func (x *AboutDialog) SetPropertyDebugInfoFilename(value string) { | |
| 1192 | 1192 | var v gobject.Value | |
| 1193 | 1193 | v.Init(gobject.TypeStringVal) | |
| 1194 | - | v.SetString(value) | |
| 1194 | + | v.SetString(&value) | |
| 1195 | 1195 | x.SetProperty("debug-info-filename", &v) | |
| 1196 | 1196 | } | |
| 1197 | 1197 | ||
| @@ -1267,7 +1267,7 @@ func (x *AboutDialog) GetPropertyDesigners() []string { | |||
| 1267 | 1267 | func (x *AboutDialog) SetPropertyDeveloperName(value string) { | |
| 1268 | 1268 | var v gobject.Value | |
| 1269 | 1269 | v.Init(gobject.TypeStringVal) | |
| 1270 | - | v.SetString(value) | |
| 1270 | + | v.SetString(&value) | |
| 1271 | 1271 | x.SetProperty("developer-name", &v) | |
| 1272 | 1272 | } | |
| 1273 | 1273 | ||
| @@ -1385,7 +1385,7 @@ func (x *AboutDialog) GetPropertyDocumenters() []string { | |||
| 1385 | 1385 | func (x *AboutDialog) SetPropertyIssueUrl(value string) { | |
| 1386 | 1386 | var v gobject.Value | |
| 1387 | 1387 | v.Init(gobject.TypeStringVal) | |
| 1388 | - | v.SetString(value) | |
| 1388 | + | v.SetString(&value) | |
| 1389 | 1389 | x.SetProperty("issue-url", &v) | |
| 1390 | 1390 | } | |
| 1391 | 1391 | ||
| @@ -1418,7 +1418,7 @@ func (x *AboutDialog) GetPropertyIssueUrl() string { | |||
| 1418 | 1418 | func (x *AboutDialog) SetPropertyLicense(value string) { | |
| 1419 | 1419 | var v gobject.Value | |
| 1420 | 1420 | v.Init(gobject.TypeStringVal) | |
| 1421 | - | v.SetString(value) | |
| 1421 | + | v.SetString(&value) | |
| 1422 | 1422 | x.SetProperty("license", &v) | |
| 1423 | 1423 | } | |
| 1424 | 1424 | ||
| @@ -1472,7 +1472,7 @@ func (x *AboutDialog) GetPropertyLicense() string { | |||
| 1472 | 1472 | func (x *AboutDialog) SetPropertyReleaseNotes(value string) { | |
| 1473 | 1473 | var v gobject.Value | |
| 1474 | 1474 | v.Init(gobject.TypeStringVal) | |
| 1475 | - | v.SetString(value) | |
| 1475 | + | v.SetString(&value) | |
| 1476 | 1476 | x.SetProperty("release-notes", &v) | |
| 1477 | 1477 | } | |
| 1478 | 1478 | ||
| @@ -1523,7 +1523,7 @@ func (x *AboutDialog) GetPropertyReleaseNotes() string { | |||
| 1523 | 1523 | func (x *AboutDialog) SetPropertyReleaseNotesVersion(value string) { | |
| 1524 | 1524 | var v gobject.Value | |
| 1525 | 1525 | v.Init(gobject.TypeStringVal) | |
| 1526 | - | v.SetString(value) | |
| 1526 | + | v.SetString(&value) | |
| 1527 | 1527 | x.SetProperty("release-notes-version", &v) | |
| 1528 | 1528 | } | |
| 1529 | 1529 | ||
| @@ -1553,7 +1553,7 @@ func (x *AboutDialog) GetPropertyReleaseNotesVersion() string { | |||
| 1553 | 1553 | func (x *AboutDialog) SetPropertySupportUrl(value string) { | |
| 1554 | 1554 | var v gobject.Value | |
| 1555 | 1555 | v.Init(gobject.TypeStringVal) | |
| 1556 | - | v.SetString(value) | |
| 1556 | + | v.SetString(&value) | |
| 1557 | 1557 | x.SetProperty("support-url", &v) | |
| 1558 | 1558 | } | |
| 1559 | 1559 | ||
| @@ -1589,7 +1589,7 @@ func (x *AboutDialog) GetPropertySupportUrl() string { | |||
| 1589 | 1589 | func (x *AboutDialog) SetPropertyTranslatorCredits(value string) { | |
| 1590 | 1590 | var v gobject.Value | |
| 1591 | 1591 | v.Init(gobject.TypeStringVal) | |
| 1592 | - | v.SetString(value) | |
| 1592 | + | v.SetString(&value) | |
| 1593 | 1593 | x.SetProperty("translator-credits", &v) | |
| 1594 | 1594 | } | |
| 1595 | 1595 | ||
| @@ -1628,7 +1628,7 @@ func (x *AboutDialog) GetPropertyTranslatorCredits() string { | |||
| 1628 | 1628 | func (x *AboutDialog) SetPropertyVersion(value string) { | |
| 1629 | 1629 | var v gobject.Value | |
| 1630 | 1630 | v.Init(gobject.TypeStringVal) | |
| 1631 | - | v.SetString(value) | |
| 1631 | + | v.SetString(&value) | |
| 1632 | 1632 | x.SetProperty("version", &v) | |
| 1633 | 1633 | } | |
| 1634 | 1634 | ||
| @@ -1655,7 +1655,7 @@ func (x *AboutDialog) GetPropertyVersion() string { | |||
| 1655 | 1655 | func (x *AboutDialog) SetPropertyWebsite(value string) { | |
| 1656 | 1656 | var v gobject.Value | |
| 1657 | 1657 | v.Init(gobject.TypeStringVal) | |
| 1658 | - | v.SetString(value) | |
| 1658 | + | v.SetString(&value) | |
| 1659 | 1659 | x.SetProperty("website", &v) | |
| 1660 | 1660 | } | |
| 1661 | 1661 | ||
M v4/adw/adw-about-window.go +30 -30
| @@ -34,15 +34,15 @@ func ShowAboutWindow(ParentVar *gtk.Window, FirstPropertyNameVar string, varArgs | |||
| 34 | 34 | ||
| 35 | 35 | } | |
| 36 | 36 | ||
| 37 | - | var xShowAboutWindowFromAppdata func(uintptr, string, string, string, ...interface{}) | |
| 37 | + | var xShowAboutWindowFromAppdata func(uintptr, string, uintptr, string, ...interface{}) | |
| 38 | 38 | ||
| 39 | 39 | // A convenience function for showing an application’s about window from | |
| 40 | 40 | // AppStream metadata. | |
| 41 | 41 | // | |
| 42 | 42 | // See [ctor@AboutWindow.new_from_appdata] for details. | |
| 43 | - | func ShowAboutWindowFromAppdata(ParentVar *gtk.Window, ResourcePathVar string, ReleaseNotesVersionVar string, FirstPropertyNameVar string, varArgs ...interface{}) { | |
| 43 | + | func ShowAboutWindowFromAppdata(ParentVar *gtk.Window, ResourcePathVar string, ReleaseNotesVersionVar *string, FirstPropertyNameVar string, varArgs ...interface{}) { | |
| 44 | 44 | ||
| 45 | - | xShowAboutWindowFromAppdata(ParentVar.GoPointer(), ResourcePathVar, ReleaseNotesVersionVar, FirstPropertyNameVar, varArgs...) | |
| 45 | + | xShowAboutWindowFromAppdata(ParentVar.GoPointer(), ResourcePathVar, core.NullableStringToPtr(ReleaseNotesVersionVar), FirstPropertyNameVar, varArgs...) | |
| 46 | 46 | ||
| 47 | 47 | } | |
| 48 | 48 | ||
| @@ -250,7 +250,7 @@ func NewAboutWindow() *AboutWindow { | |||
| 250 | 250 | return cls | |
| 251 | 251 | } | |
| 252 | 252 | ||
| 253 | - | var xNewAboutWindowFromAppdata func(string, string) uintptr | |
| 253 | + | var xNewAboutWindowFromAppdata func(string, uintptr) uintptr | |
| 254 | 254 | ||
| 255 | 255 | // Creates a new `AdwAboutWindow` using AppStream metadata. | |
| 256 | 256 | // | |
| @@ -273,10 +273,10 @@ var xNewAboutWindowFromAppdata func(string, string) uintptr | |||
| 273 | 273 | // [property@AboutWindow:release-notes-version] is set to match it, while | |
| 274 | 274 | // [property@AboutWindow:release-notes] is set from the AppStream release | |
| 275 | 275 | // description for that version. | |
| 276 | - | func NewAboutWindowFromAppdata(ResourcePathVar string, ReleaseNotesVersionVar string) *AboutWindow { | |
| 276 | + | func NewAboutWindowFromAppdata(ResourcePathVar string, ReleaseNotesVersionVar *string) *AboutWindow { | |
| 277 | 277 | var cls *AboutWindow | |
| 278 | 278 | ||
| 279 | - | cret := xNewAboutWindowFromAppdata(ResourcePathVar, ReleaseNotesVersionVar) | |
| 279 | + | cret := xNewAboutWindowFromAppdata(ResourcePathVar, core.NullableStringToPtr(ReleaseNotesVersionVar)) | |
| 280 | 280 | ||
| 281 | 281 | if cret == 0 { | |
| 282 | 282 | return nil | |
| @@ -287,7 +287,7 @@ func NewAboutWindowFromAppdata(ResourcePathVar string, ReleaseNotesVersionVar st | |||
| 287 | 287 | return cls | |
| 288 | 288 | } | |
| 289 | 289 | ||
| 290 | - | var xAboutWindowAddAcknowledgementSection func(uintptr, string, []string) | |
| 290 | + | var xAboutWindowAddAcknowledgementSection func(uintptr, uintptr, []string) | |
| 291 | 291 | ||
| 292 | 292 | // Adds a section to the Acknowledgements page. | |
| 293 | 293 | // | |
| @@ -306,13 +306,13 @@ var xAboutWindowAddAcknowledgementSection func(uintptr, string, []string) | |||
| 306 | 306 | // * [property@AboutWindow:documenters] | |
| 307 | 307 | // * [property@AboutWindow:translator-credits] | |
| 308 | 308 | // * [method@AboutWindow.add_credit_section] | |
| 309 | - | func (x *AboutWindow) AddAcknowledgementSection(NameVar string, PeopleVar []string) { | |
| 309 | + | func (x *AboutWindow) AddAcknowledgementSection(NameVar *string, PeopleVar []string) { | |
| 310 | 310 | ||
| 311 | - | xAboutWindowAddAcknowledgementSection(x.GoPointer(), NameVar, PeopleVar) | |
| 311 | + | xAboutWindowAddAcknowledgementSection(x.GoPointer(), core.NullableStringToPtr(NameVar), PeopleVar) | |
| 312 | 312 | ||
| 313 | 313 | } | |
| 314 | 314 | ||
| 315 | - | var xAboutWindowAddCreditSection func(uintptr, string, []string) | |
| 315 | + | var xAboutWindowAddCreditSection func(uintptr, uintptr, []string) | |
| 316 | 316 | ||
| 317 | 317 | // Adds an extra section to the Credits page. | |
| 318 | 318 | // | |
| @@ -329,13 +329,13 @@ var xAboutWindowAddCreditSection func(uintptr, string, []string) | |||
| 329 | 329 | // * [property@AboutWindow:documenters] | |
| 330 | 330 | // * [property@AboutWindow:translator-credits] | |
| 331 | 331 | // * [method@AboutWindow.add_acknowledgement_section] | |
| 332 | - | func (x *AboutWindow) AddCreditSection(NameVar string, PeopleVar []string) { | |
| 332 | + | func (x *AboutWindow) AddCreditSection(NameVar *string, PeopleVar []string) { | |
| 333 | 333 | ||
| 334 | - | xAboutWindowAddCreditSection(x.GoPointer(), NameVar, PeopleVar) | |
| 334 | + | xAboutWindowAddCreditSection(x.GoPointer(), core.NullableStringToPtr(NameVar), PeopleVar) | |
| 335 | 335 | ||
| 336 | 336 | } | |
| 337 | 337 | ||
| 338 | - | var xAboutWindowAddLegalSection func(uintptr, string, string, gtk.License, string) | |
| 338 | + | var xAboutWindowAddLegalSection func(uintptr, string, uintptr, gtk.License, uintptr) | |
| 339 | 339 | ||
| 340 | 340 | // Adds an extra section to the Legal page. | |
| 341 | 341 | // | |
| @@ -382,9 +382,9 @@ var xAboutWindowAddLegalSection func(uintptr, string, string, gtk.License, strin | |||
| 382 | 382 | // "Something completely custom here."); | |
| 383 | 383 | // | |
| 384 | 384 | // ``` | |
| 385 | - | func (x *AboutWindow) AddLegalSection(TitleVar string, CopyrightVar string, LicenseTypeVar gtk.License, LicenseVar string) { | |
| 385 | + | func (x *AboutWindow) AddLegalSection(TitleVar string, CopyrightVar *string, LicenseTypeVar gtk.License, LicenseVar *string) { | |
| 386 | 386 | ||
| 387 | - | xAboutWindowAddLegalSection(x.GoPointer(), TitleVar, CopyrightVar, LicenseTypeVar, LicenseVar) | |
| 387 | + | xAboutWindowAddLegalSection(x.GoPointer(), TitleVar, core.NullableStringToPtr(CopyrightVar), LicenseTypeVar, core.NullableStringToPtr(LicenseVar)) | |
| 388 | 388 | ||
| 389 | 389 | } | |
| 390 | 390 | ||
| @@ -972,7 +972,7 @@ func (c *AboutWindow) SetGoPointer(ptr uintptr) { | |||
| 972 | 972 | func (x *AboutWindow) SetPropertyApplicationIcon(value string) { | |
| 973 | 973 | var v gobject.Value | |
| 974 | 974 | v.Init(gobject.TypeStringVal) | |
| 975 | - | v.SetString(value) | |
| 975 | + | v.SetString(&value) | |
| 976 | 976 | x.SetProperty("application-icon", &v) | |
| 977 | 977 | } | |
| 978 | 978 | ||
| @@ -993,7 +993,7 @@ func (x *AboutWindow) GetPropertyApplicationIcon() string { | |||
| 993 | 993 | func (x *AboutWindow) SetPropertyApplicationName(value string) { | |
| 994 | 994 | var v gobject.Value | |
| 995 | 995 | v.Init(gobject.TypeStringVal) | |
| 996 | - | v.SetString(value) | |
| 996 | + | v.SetString(&value) | |
| 997 | 997 | x.SetProperty("application-name", &v) | |
| 998 | 998 | } | |
| 999 | 999 | ||
| @@ -1062,7 +1062,7 @@ func (x *AboutWindow) GetPropertyArtists() []string { | |||
| 1062 | 1062 | func (x *AboutWindow) SetPropertyComments(value string) { | |
| 1063 | 1063 | var v gobject.Value | |
| 1064 | 1064 | v.Init(gobject.TypeStringVal) | |
| 1065 | - | v.SetString(value) | |
| 1065 | + | v.SetString(&value) | |
| 1066 | 1066 | x.SetProperty("comments", &v) | |
| 1067 | 1067 | } | |
| 1068 | 1068 | ||
| @@ -1093,7 +1093,7 @@ func (x *AboutWindow) GetPropertyComments() string { | |||
| 1093 | 1093 | func (x *AboutWindow) SetPropertyCopyright(value string) { | |
| 1094 | 1094 | var v gobject.Value | |
| 1095 | 1095 | v.Init(gobject.TypeStringVal) | |
| 1096 | - | v.SetString(value) | |
| 1096 | + | v.SetString(&value) | |
| 1097 | 1097 | x.SetProperty("copyright", &v) | |
| 1098 | 1098 | } | |
| 1099 | 1099 | ||
| @@ -1129,7 +1129,7 @@ func (x *AboutWindow) GetPropertyCopyright() string { | |||
| 1129 | 1129 | func (x *AboutWindow) SetPropertyDebugInfo(value string) { | |
| 1130 | 1130 | var v gobject.Value | |
| 1131 | 1131 | v.Init(gobject.TypeStringVal) | |
| 1132 | - | v.SetString(value) | |
| 1132 | + | v.SetString(&value) | |
| 1133 | 1133 | x.SetProperty("debug-info", &v) | |
| 1134 | 1134 | } | |
| 1135 | 1135 | ||
| @@ -1161,7 +1161,7 @@ func (x *AboutWindow) GetPropertyDebugInfo() string { | |||
| 1161 | 1161 | func (x *AboutWindow) SetPropertyDebugInfoFilename(value string) { | |
| 1162 | 1162 | var v gobject.Value | |
| 1163 | 1163 | v.Init(gobject.TypeStringVal) | |
| 1164 | - | v.SetString(value) | |
| 1164 | + | v.SetString(&value) | |
| 1165 | 1165 | x.SetProperty("debug-info-filename", &v) | |
| 1166 | 1166 | } | |
| 1167 | 1167 | ||
| @@ -1237,7 +1237,7 @@ func (x *AboutWindow) GetPropertyDesigners() []string { | |||
| 1237 | 1237 | func (x *AboutWindow) SetPropertyDeveloperName(value string) { | |
| 1238 | 1238 | var v gobject.Value | |
| 1239 | 1239 | v.Init(gobject.TypeStringVal) | |
| 1240 | - | v.SetString(value) | |
| 1240 | + | v.SetString(&value) | |
| 1241 | 1241 | x.SetProperty("developer-name", &v) | |
| 1242 | 1242 | } | |
| 1243 | 1243 | ||
| @@ -1355,7 +1355,7 @@ func (x *AboutWindow) GetPropertyDocumenters() []string { | |||
| 1355 | 1355 | func (x *AboutWindow) SetPropertyIssueUrl(value string) { | |
| 1356 | 1356 | var v gobject.Value | |
| 1357 | 1357 | v.Init(gobject.TypeStringVal) | |
| 1358 | - | v.SetString(value) | |
| 1358 | + | v.SetString(&value) | |
| 1359 | 1359 | x.SetProperty("issue-url", &v) | |
| 1360 | 1360 | } | |
| 1361 | 1361 | ||
| @@ -1388,7 +1388,7 @@ func (x *AboutWindow) GetPropertyIssueUrl() string { | |||
| 1388 | 1388 | func (x *AboutWindow) SetPropertyLicense(value string) { | |
| 1389 | 1389 | var v gobject.Value | |
| 1390 | 1390 | v.Init(gobject.TypeStringVal) | |
| 1391 | - | v.SetString(value) | |
| 1391 | + | v.SetString(&value) | |
| 1392 | 1392 | x.SetProperty("license", &v) | |
| 1393 | 1393 | } | |
| 1394 | 1394 | ||
| @@ -1442,7 +1442,7 @@ func (x *AboutWindow) GetPropertyLicense() string { | |||
| 1442 | 1442 | func (x *AboutWindow) SetPropertyReleaseNotes(value string) { | |
| 1443 | 1443 | var v gobject.Value | |
| 1444 | 1444 | v.Init(gobject.TypeStringVal) | |
| 1445 | - | v.SetString(value) | |
| 1445 | + | v.SetString(&value) | |
| 1446 | 1446 | x.SetProperty("release-notes", &v) | |
| 1447 | 1447 | } | |
| 1448 | 1448 | ||
| @@ -1493,7 +1493,7 @@ func (x *AboutWindow) GetPropertyReleaseNotes() string { | |||
| 1493 | 1493 | func (x *AboutWindow) SetPropertyReleaseNotesVersion(value string) { | |
| 1494 | 1494 | var v gobject.Value | |
| 1495 | 1495 | v.Init(gobject.TypeStringVal) | |
| 1496 | - | v.SetString(value) | |
| 1496 | + | v.SetString(&value) | |
| 1497 | 1497 | x.SetProperty("release-notes-version", &v) | |
| 1498 | 1498 | } | |
| 1499 | 1499 | ||
| @@ -1523,7 +1523,7 @@ func (x *AboutWindow) GetPropertyReleaseNotesVersion() string { | |||
| 1523 | 1523 | func (x *AboutWindow) SetPropertySupportUrl(value string) { | |
| 1524 | 1524 | var v gobject.Value | |
| 1525 | 1525 | v.Init(gobject.TypeStringVal) | |
| 1526 | - | v.SetString(value) | |
| 1526 | + | v.SetString(&value) | |
| 1527 | 1527 | x.SetProperty("support-url", &v) | |
| 1528 | 1528 | } | |
| 1529 | 1529 | ||
| @@ -1559,7 +1559,7 @@ func (x *AboutWindow) GetPropertySupportUrl() string { | |||
| 1559 | 1559 | func (x *AboutWindow) SetPropertyTranslatorCredits(value string) { | |
| 1560 | 1560 | var v gobject.Value | |
| 1561 | 1561 | v.Init(gobject.TypeStringVal) | |
| 1562 | - | v.SetString(value) | |
| 1562 | + | v.SetString(&value) | |
| 1563 | 1563 | x.SetProperty("translator-credits", &v) | |
| 1564 | 1564 | } | |
| 1565 | 1565 | ||
| @@ -1598,7 +1598,7 @@ func (x *AboutWindow) GetPropertyTranslatorCredits() string { | |||
| 1598 | 1598 | func (x *AboutWindow) SetPropertyVersion(value string) { | |
| 1599 | 1599 | var v gobject.Value | |
| 1600 | 1600 | v.Init(gobject.TypeStringVal) | |
| 1601 | - | v.SetString(value) | |
| 1601 | + | v.SetString(&value) | |
| 1602 | 1602 | x.SetProperty("version", &v) | |
| 1603 | 1603 | } | |
| 1604 | 1604 | ||
| @@ -1625,7 +1625,7 @@ func (x *AboutWindow) GetPropertyVersion() string { | |||
| 1625 | 1625 | func (x *AboutWindow) SetPropertyWebsite(value string) { | |
| 1626 | 1626 | var v gobject.Value | |
| 1627 | 1627 | v.Init(gobject.TypeStringVal) | |
| 1628 | - | v.SetString(value) | |
| 1628 | + | v.SetString(&value) | |
| 1629 | 1629 | x.SetProperty("website", &v) | |
| 1630 | 1630 | } | |
| 1631 | 1631 | ||
M v4/adw/adw-action-row.go +7 -7
| @@ -253,12 +253,12 @@ func (x *ActionRow) SetActivatableWidget(WidgetVar *gtk.Widget) { | |||
| 253 | 253 | ||
| 254 | 254 | } | |
| 255 | 255 | ||
| 256 | - | var xActionRowSetIconName func(uintptr, string) | |
| 256 | + | var xActionRowSetIconName func(uintptr, uintptr) | |
| 257 | 257 | ||
| 258 | 258 | // Sets the icon name for @self. | |
| 259 | - | func (x *ActionRow) SetIconName(IconNameVar string) { | |
| 259 | + | func (x *ActionRow) SetIconName(IconNameVar *string) { | |
| 260 | 260 | ||
| 261 | - | xActionRowSetIconName(x.GoPointer(), IconNameVar) | |
| 261 | + | xActionRowSetIconName(x.GoPointer(), core.NullableStringToPtr(IconNameVar)) | |
| 262 | 262 | ||
| 263 | 263 | } | |
| 264 | 264 | ||
| @@ -325,7 +325,7 @@ func (c *ActionRow) SetGoPointer(ptr uintptr) { | |||
| 325 | 325 | func (x *ActionRow) SetPropertyIconName(value string) { | |
| 326 | 326 | var v gobject.Value | |
| 327 | 327 | v.Init(gobject.TypeStringVal) | |
| 328 | - | v.SetString(value) | |
| 328 | + | v.SetString(&value) | |
| 329 | 329 | x.SetProperty("icon-name", &v) | |
| 330 | 330 | } | |
| 331 | 331 | ||
| @@ -345,7 +345,7 @@ func (x *ActionRow) GetPropertyIconName() string { | |||
| 345 | 345 | func (x *ActionRow) SetPropertySubtitle(value string) { | |
| 346 | 346 | var v gobject.Value | |
| 347 | 347 | v.Init(gobject.TypeStringVal) | |
| 348 | - | v.SetString(value) | |
| 348 | + | v.SetString(&value) | |
| 349 | 349 | x.SetProperty("subtitle", &v) | |
| 350 | 350 | } | |
| 351 | 351 | ||
| @@ -740,9 +740,9 @@ func (x *ActionRow) GetActionTargetValue() *glib.Variant { | |||
| 740 | 740 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 741 | 741 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 742 | 742 | // associated with the window. | |
| 743 | - | func (x *ActionRow) SetActionName(ActionNameVar string) { | |
| 743 | + | func (x *ActionRow) SetActionName(ActionNameVar *string) { | |
| 744 | 744 | ||
| 745 | - | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 745 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 746 | 746 | ||
| 747 | 747 | } | |
| 748 | 748 | ||
M v4/adw/adw-alert-dialog.go +52 -14
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | package adw | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "fmt" | |
| 5 | 6 | "structs" | |
| 6 | 7 | "unsafe" | |
| 7 | 8 | ||
| @@ -232,7 +233,7 @@ func AlertDialogNewFromInternalPtr(ptr uintptr) *AlertDialog { | |||
| 232 | 233 | return cls | |
| 233 | 234 | } | |
| 234 | 235 | ||
| 235 | - | var xNewAlertDialog func(string, string) uintptr | |
| 236 | + | var xNewAlertDialog func(uintptr, uintptr) uintptr | |
| 236 | 237 | ||
| 237 | 238 | // Creates a new `AdwAlertDialog`. | |
| 238 | 239 | // | |
| @@ -250,10 +251,10 @@ var xNewAlertDialog func(string, string) uintptr | |||
| 250 | 251 | // filename); | |
| 251 | 252 | // | |
| 252 | 253 | // ``` | |
| 253 | - | func NewAlertDialog(HeadingVar string, BodyVar string) *AlertDialog { | |
| 254 | + | func NewAlertDialog(HeadingVar *string, BodyVar *string) *AlertDialog { | |
| 254 | 255 | var cls *AlertDialog | |
| 255 | 256 | ||
| 256 | - | cret := xNewAlertDialog(HeadingVar, BodyVar) | |
| 257 | + | cret := xNewAlertDialog(core.NullableStringToPtr(HeadingVar), core.NullableStringToPtr(BodyVar)) | |
| 257 | 258 | ||
| 258 | 259 | if cret == 0 { | |
| 259 | 260 | return nil | |
| @@ -321,7 +322,22 @@ var xAlertDialogChoose func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||
| 321 | 322 | // will be shown within it. Otherwise, it will be a separate window. | |
| 322 | 323 | func (x *AlertDialog) Choose(ParentVar *gtk.Widget, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 323 | 324 | ||
| 324 | - | xAlertDialogChoose(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 325 | + | var CallbackVarRef uintptr | |
| 326 | + | if CallbackVar != nil { | |
| 327 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 328 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 329 | + | CallbackVarRef = cbRefPtr | |
| 330 | + | } else { | |
| 331 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 332 | + | cbFn := *CallbackVar | |
| 333 | + | cbFn(arg0, arg1, arg2) | |
| 334 | + | } | |
| 335 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 336 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 337 | + | } | |
| 338 | + | } | |
| 339 | + | ||
| 340 | + | xAlertDialogChoose(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 325 | 341 | ||
| 326 | 342 | } | |
| 327 | 343 | ||
| @@ -557,7 +573,7 @@ func (x *AlertDialog) SetCloseResponse(ResponseVar string) { | |||
| 557 | 573 | ||
| 558 | 574 | } | |
| 559 | 575 | ||
| 560 | - | var xAlertDialogSetDefaultResponse func(uintptr, string) | |
| 576 | + | var xAlertDialogSetDefaultResponse func(uintptr, uintptr) | |
| 561 | 577 | ||
| 562 | 578 | // Sets the ID of the default response of @self. | |
| 563 | 579 | // | |
| @@ -568,9 +584,9 @@ var xAlertDialogSetDefaultResponse func(uintptr, string) | |||
| 568 | 584 | // will be focused by default. | |
| 569 | 585 | // | |
| 570 | 586 | // See [property@Dialog:default-widget]. | |
| 571 | - | func (x *AlertDialog) SetDefaultResponse(ResponseVar string) { | |
| 587 | + | func (x *AlertDialog) SetDefaultResponse(ResponseVar *string) { | |
| 572 | 588 | ||
| 573 | - | xAlertDialogSetDefaultResponse(x.GoPointer(), ResponseVar) | |
| 589 | + | xAlertDialogSetDefaultResponse(x.GoPointer(), core.NullableStringToPtr(ResponseVar)) | |
| 574 | 590 | ||
| 575 | 591 | } | |
| 576 | 592 | ||
| @@ -585,12 +601,12 @@ func (x *AlertDialog) SetExtraChild(ChildVar *gtk.Widget) { | |||
| 585 | 601 | ||
| 586 | 602 | } | |
| 587 | 603 | ||
| 588 | - | var xAlertDialogSetHeading func(uintptr, string) | |
| 604 | + | var xAlertDialogSetHeading func(uintptr, uintptr) | |
| 589 | 605 | ||
| 590 | 606 | // Sets the heading of @self. | |
| 591 | - | func (x *AlertDialog) SetHeading(HeadingVar string) { | |
| 607 | + | func (x *AlertDialog) SetHeading(HeadingVar *string) { | |
| 592 | 608 | ||
| 593 | - | xAlertDialogSetHeading(x.GoPointer(), HeadingVar) | |
| 609 | + | xAlertDialogSetHeading(x.GoPointer(), core.NullableStringToPtr(HeadingVar)) | |
| 594 | 610 | ||
| 595 | 611 | } | |
| 596 | 612 | ||
| @@ -690,7 +706,7 @@ func (c *AlertDialog) SetGoPointer(ptr uintptr) { | |||
| 690 | 706 | func (x *AlertDialog) SetPropertyBody(value string) { | |
| 691 | 707 | var v gobject.Value | |
| 692 | 708 | v.Init(gobject.TypeStringVal) | |
| 693 | - | v.SetString(value) | |
| 709 | + | v.SetString(&value) | |
| 694 | 710 | x.SetProperty("body", &v) | |
| 695 | 711 | } | |
| 696 | 712 | ||
| @@ -735,7 +751,7 @@ func (x *AlertDialog) GetPropertyBodyUseMarkup() bool { | |||
| 735 | 751 | func (x *AlertDialog) SetPropertyCloseResponse(value string) { | |
| 736 | 752 | var v gobject.Value | |
| 737 | 753 | v.Init(gobject.TypeStringVal) | |
| 738 | - | v.SetString(value) | |
| 754 | + | v.SetString(&value) | |
| 739 | 755 | x.SetProperty("close-response", &v) | |
| 740 | 756 | } | |
| 741 | 757 | ||
| @@ -767,7 +783,7 @@ func (x *AlertDialog) GetPropertyCloseResponse() string { | |||
| 767 | 783 | func (x *AlertDialog) SetPropertyDefaultResponse(value string) { | |
| 768 | 784 | var v gobject.Value | |
| 769 | 785 | v.Init(gobject.TypeStringVal) | |
| 770 | - | v.SetString(value) | |
| 786 | + | v.SetString(&value) | |
| 771 | 787 | x.SetProperty("default-response", &v) | |
| 772 | 788 | } | |
| 773 | 789 | ||
| @@ -792,7 +808,7 @@ func (x *AlertDialog) GetPropertyDefaultResponse() string { | |||
| 792 | 808 | func (x *AlertDialog) SetPropertyHeading(value string) { | |
| 793 | 809 | var v gobject.Value | |
| 794 | 810 | v.Init(gobject.TypeStringVal) | |
| 795 | - | v.SetString(value) | |
| 811 | + | v.SetString(&value) | |
| 796 | 812 | x.SetProperty("heading", &v) | |
| 797 | 813 | } | |
| 798 | 814 | ||
| @@ -875,6 +891,28 @@ func (x *AlertDialog) ConnectResponse(cb *func(AlertDialog, string)) uint32 { | |||
| 875 | 891 | return gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr) | |
| 876 | 892 | } | |
| 877 | 893 | ||
| 894 | + | // ConnectResponseWithDetail connects to the "response" signal with a detail string. | |
| 895 | + | // The detail is appended as "response::<detail>". | |
| 896 | + | func (x *AlertDialog) ConnectResponseWithDetail(detail string, cb *func(AlertDialog, string)) uint32 { | |
| 897 | + | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 898 | + | signalName := fmt.Sprintf("response::%s", detail) | |
| 899 | + | if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { | |
| 900 | + | return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 901 | + | } | |
| 902 | + | ||
| 903 | + | fcb := func(clsPtr uintptr, ResponseVarp string) { | |
| 904 | + | fa := AlertDialog{} | |
| 905 | + | fa.Ptr = clsPtr | |
| 906 | + | cbFn := *cb | |
| 907 | + | ||
| 908 | + | cbFn(fa, ResponseVarp) | |
| 909 | + | ||
| 910 | + | } | |
| 911 | + | cbRefPtr := purego.NewCallback(fcb) | |
| 912 | + | glib.SaveCallback(cbPtr, cbRefPtr) | |
| 913 | + | return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 914 | + | } | |
| 915 | + | ||
| 878 | 916 | // Requests the user's screen reader to announce the given message. | |
| 879 | 917 | // | |
| 880 | 918 | // This kind of notification is useful for messages that | |
M v4/adw/adw-animation-target.go +31 -1
| @@ -92,7 +92,37 @@ var xNewCallbackAnimationTarget func(uintptr, uintptr, uintptr) uintptr | |||
| 92 | 92 | func NewCallbackAnimationTarget(CallbackVar *AnimationTargetFunc, UserDataVar uintptr, DestroyVar *glib.DestroyNotify) *CallbackAnimationTarget { | |
| 93 | 93 | var cls *CallbackAnimationTarget | |
| 94 | 94 | ||
| 95 | - | cret := xNewCallbackAnimationTarget(glib.NewCallback(CallbackVar), UserDataVar, glib.NewCallback(DestroyVar)) | |
| 95 | + | var CallbackVarRef uintptr | |
| 96 | + | if CallbackVar != nil { | |
| 97 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 98 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 99 | + | CallbackVarRef = cbRefPtr | |
| 100 | + | } else { | |
| 101 | + | fcb := func(arg0 float64, arg1 uintptr) { | |
| 102 | + | cbFn := *CallbackVar | |
| 103 | + | cbFn(arg0, arg1) | |
| 104 | + | } | |
| 105 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 106 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 107 | + | } | |
| 108 | + | } | |
| 109 | + | ||
| 110 | + | var DestroyVarRef uintptr | |
| 111 | + | if DestroyVar != nil { | |
| 112 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 113 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 114 | + | DestroyVarRef = cbRefPtr | |
| 115 | + | } else { | |
| 116 | + | fcb := func(arg0 uintptr) { | |
| 117 | + | cbFn := *DestroyVar | |
| 118 | + | cbFn(arg0) | |
| 119 | + | } | |
| 120 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 121 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 122 | + | } | |
| 123 | + | } | |
| 124 | + | ||
| 125 | + | cret := xNewCallbackAnimationTarget(CallbackVarRef, UserDataVar, DestroyVarRef) | |
| 96 | 126 | ||
| 97 | 127 | if cret == 0 { | |
| 98 | 128 | return nil | |
M v4/adw/adw-application.go +3 -3
| @@ -86,7 +86,7 @@ func ApplicationNewFromInternalPtr(ptr uintptr) *Application { | |||
| 86 | 86 | return cls | |
| 87 | 87 | } | |
| 88 | 88 | ||
| 89 | - | var xNewApplication func(string, gio.ApplicationFlags) uintptr | |
| 89 | + | var xNewApplication func(uintptr, gio.ApplicationFlags) uintptr | |
| 90 | 90 | ||
| 91 | 91 | // Creates a new `AdwApplication`. | |
| 92 | 92 | // | |
| @@ -95,10 +95,10 @@ var xNewApplication func(string, gio.ApplicationFlags) uintptr | |||
| 95 | 95 | // | |
| 96 | 96 | // If no application ID is given then some features (most notably application | |
| 97 | 97 | // uniqueness) will be disabled. | |
| 98 | - | func NewApplication(ApplicationIdVar string, FlagsVar gio.ApplicationFlags) *Application { | |
| 98 | + | func NewApplication(ApplicationIdVar *string, FlagsVar gio.ApplicationFlags) *Application { | |
| 99 | 99 | var cls *Application | |
| 100 | 100 | ||
| 101 | - | cret := xNewApplication(ApplicationIdVar, FlagsVar) | |
| 101 | + | cret := xNewApplication(core.NullableStringToPtr(ApplicationIdVar), FlagsVar) | |
| 102 | 102 | ||
| 103 | 103 | if cret == 0 { | |
| 104 | 104 | return nil | |
M v4/adw/adw-avatar.go +11 -11
| @@ -68,13 +68,13 @@ func AvatarNewFromInternalPtr(ptr uintptr) *Avatar { | |||
| 68 | 68 | return cls | |
| 69 | 69 | } | |
| 70 | 70 | ||
| 71 | - | var xNewAvatar func(int, string, bool) uintptr | |
| 71 | + | var xNewAvatar func(int, uintptr, bool) uintptr | |
| 72 | 72 | ||
| 73 | 73 | // Creates a new `AdwAvatar`. | |
| 74 | - | func NewAvatar(SizeVar int, TextVar string, ShowInitialsVar bool) *Avatar { | |
| 74 | + | func NewAvatar(SizeVar int, TextVar *string, ShowInitialsVar bool) *Avatar { | |
| 75 | 75 | var cls *Avatar | |
| 76 | 76 | ||
| 77 | - | cret := xNewAvatar(SizeVar, TextVar, ShowInitialsVar) | |
| 77 | + | cret := xNewAvatar(SizeVar, core.NullableStringToPtr(TextVar), ShowInitialsVar) | |
| 78 | 78 | ||
| 79 | 79 | if cret == 0 { | |
| 80 | 80 | return nil | |
| @@ -167,14 +167,14 @@ func (x *Avatar) SetCustomImage(CustomImageVar gdk.Paintable) { | |||
| 167 | 167 | ||
| 168 | 168 | } | |
| 169 | 169 | ||
| 170 | - | var xAvatarSetIconName func(uintptr, string) | |
| 170 | + | var xAvatarSetIconName func(uintptr, uintptr) | |
| 171 | 171 | ||
| 172 | 172 | // Sets the name of an icon to use as a fallback. | |
| 173 | 173 | // | |
| 174 | 174 | // If no name is set, `avatar-default-symbolic` will be used. | |
| 175 | - | func (x *Avatar) SetIconName(IconNameVar string) { | |
| 175 | + | func (x *Avatar) SetIconName(IconNameVar *string) { | |
| 176 | 176 | ||
| 177 | - | xAvatarSetIconName(x.GoPointer(), IconNameVar) | |
| 177 | + | xAvatarSetIconName(x.GoPointer(), core.NullableStringToPtr(IconNameVar)) | |
| 178 | 178 | ||
| 179 | 179 | } | |
| 180 | 180 | ||
| @@ -198,15 +198,15 @@ func (x *Avatar) SetSize(SizeVar int) { | |||
| 198 | 198 | ||
| 199 | 199 | } | |
| 200 | 200 | ||
| 201 | - | var xAvatarSetText func(uintptr, string) | |
| 201 | + | var xAvatarSetText func(uintptr, uintptr) | |
| 202 | 202 | ||
| 203 | 203 | // Sets the text used to generate the fallback initials and color. | |
| 204 | 204 | // | |
| 205 | 205 | // It's only used to generate the color if [property@Avatar:show-initials] is | |
| 206 | 206 | // `FALSE`. | |
| 207 | - | func (x *Avatar) SetText(TextVar string) { | |
| 207 | + | func (x *Avatar) SetText(TextVar *string) { | |
| 208 | 208 | ||
| 209 | - | xAvatarSetText(x.GoPointer(), TextVar) | |
| 209 | + | xAvatarSetText(x.GoPointer(), core.NullableStringToPtr(TextVar)) | |
| 210 | 210 | ||
| 211 | 211 | } | |
| 212 | 212 | ||
| @@ -228,7 +228,7 @@ func (c *Avatar) SetGoPointer(ptr uintptr) { | |||
| 228 | 228 | func (x *Avatar) SetPropertyIconName(value string) { | |
| 229 | 229 | var v gobject.Value | |
| 230 | 230 | v.Init(gobject.TypeStringVal) | |
| 231 | - | v.SetString(value) | |
| 231 | + | v.SetString(&value) | |
| 232 | 232 | x.SetProperty("icon-name", &v) | |
| 233 | 233 | } | |
| 234 | 234 | ||
| @@ -288,7 +288,7 @@ func (x *Avatar) GetPropertySize() int { | |||
| 288 | 288 | func (x *Avatar) SetPropertyText(value string) { | |
| 289 | 289 | var v gobject.Value | |
| 290 | 290 | v.Init(gobject.TypeStringVal) | |
| 291 | - | v.SetString(value) | |
| 291 | + | v.SetString(&value) | |
| 292 | 292 | x.SetProperty("text", &v) | |
| 293 | 293 | } | |
| 294 | 294 | ||
M v4/adw/adw-banner.go +7 -7
| @@ -154,7 +154,7 @@ func (x *Banner) GetUseMarkup() bool { | |||
| 154 | 154 | return cret | |
| 155 | 155 | } | |
| 156 | 156 | ||
| 157 | - | var xBannerSetButtonLabel func(uintptr, string) | |
| 157 | + | var xBannerSetButtonLabel func(uintptr, uintptr) | |
| 158 | 158 | ||
| 159 | 159 | // Sets the button label for @self. | |
| 160 | 160 | // | |
| @@ -162,9 +162,9 @@ var xBannerSetButtonLabel func(uintptr, string) | |||
| 162 | 162 | // | |
| 163 | 163 | // The button can be used with a `GAction`, or with the | |
| 164 | 164 | // [signal@Banner::button-clicked] signal. | |
| 165 | - | func (x *Banner) SetButtonLabel(LabelVar string) { | |
| 165 | + | func (x *Banner) SetButtonLabel(LabelVar *string) { | |
| 166 | 166 | ||
| 167 | - | xBannerSetButtonLabel(x.GoPointer(), LabelVar) | |
| 167 | + | xBannerSetButtonLabel(x.GoPointer(), core.NullableStringToPtr(LabelVar)) | |
| 168 | 168 | ||
| 169 | 169 | } | |
| 170 | 170 | ||
| @@ -239,7 +239,7 @@ func (c *Banner) SetGoPointer(ptr uintptr) { | |||
| 239 | 239 | func (x *Banner) SetPropertyButtonLabel(value string) { | |
| 240 | 240 | var v gobject.Value | |
| 241 | 241 | v.Init(gobject.TypeStringVal) | |
| 242 | - | v.SetString(value) | |
| 242 | + | v.SetString(&value) | |
| 243 | 243 | x.SetProperty("button-label", &v) | |
| 244 | 244 | } | |
| 245 | 245 | ||
| @@ -280,7 +280,7 @@ func (x *Banner) GetPropertyRevealed() bool { | |||
| 280 | 280 | func (x *Banner) SetPropertyTitle(value string) { | |
| 281 | 281 | var v gobject.Value | |
| 282 | 282 | v.Init(gobject.TypeStringVal) | |
| 283 | - | v.SetString(value) | |
| 283 | + | v.SetString(&value) | |
| 284 | 284 | x.SetProperty("title", &v) | |
| 285 | 285 | } | |
| 286 | 286 | ||
| @@ -632,9 +632,9 @@ func (x *Banner) GetActionTargetValue() *glib.Variant { | |||
| 632 | 632 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 633 | 633 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 634 | 634 | // associated with the window. | |
| 635 | - | func (x *Banner) SetActionName(ActionNameVar string) { | |
| 635 | + | func (x *Banner) SetActionName(ActionNameVar *string) { | |
| 636 | 636 | ||
| 637 | - | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 637 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 638 | 638 | ||
| 639 | 639 | } | |
| 640 | 640 | ||
M v4/adw/adw-button-content.go +2 -2
| @@ -233,7 +233,7 @@ func (x *ButtonContent) GetPropertyCanShrink() bool { | |||
| 233 | 233 | func (x *ButtonContent) SetPropertyIconName(value string) { | |
| 234 | 234 | var v gobject.Value | |
| 235 | 235 | v.Init(gobject.TypeStringVal) | |
| 236 | - | v.SetString(value) | |
| 236 | + | v.SetString(&value) | |
| 237 | 237 | x.SetProperty("icon-name", &v) | |
| 238 | 238 | } | |
| 239 | 239 | ||
| @@ -252,7 +252,7 @@ func (x *ButtonContent) GetPropertyIconName() string { | |||
| 252 | 252 | func (x *ButtonContent) SetPropertyLabel(value string) { | |
| 253 | 253 | var v gobject.Value | |
| 254 | 254 | v.Init(gobject.TypeStringVal) | |
| 255 | - | v.SetString(value) | |
| 255 | + | v.SetString(&value) | |
| 256 | 256 | x.SetProperty("label", &v) | |
| 257 | 257 | } | |
| 258 | 258 | ||
M v4/adw/adw-button-row.go +10 -10
| @@ -124,21 +124,21 @@ func (x *ButtonRow) GetStartIconName() string { | |||
| 124 | 124 | return cret | |
| 125 | 125 | } | |
| 126 | 126 | ||
| 127 | - | var xButtonRowSetEndIconName func(uintptr, string) | |
| 127 | + | var xButtonRowSetEndIconName func(uintptr, uintptr) | |
| 128 | 128 | ||
| 129 | 129 | // Sets the end icon name for @self. | |
| 130 | - | func (x *ButtonRow) SetEndIconName(IconNameVar string) { | |
| 130 | + | func (x *ButtonRow) SetEndIconName(IconNameVar *string) { | |
| 131 | 131 | ||
| 132 | - | xButtonRowSetEndIconName(x.GoPointer(), IconNameVar) | |
| 132 | + | xButtonRowSetEndIconName(x.GoPointer(), core.NullableStringToPtr(IconNameVar)) | |
| 133 | 133 | ||
| 134 | 134 | } | |
| 135 | 135 | ||
| 136 | - | var xButtonRowSetStartIconName func(uintptr, string) | |
| 136 | + | var xButtonRowSetStartIconName func(uintptr, uintptr) | |
| 137 | 137 | ||
| 138 | 138 | // Sets the start icon name for @self. | |
| 139 | - | func (x *ButtonRow) SetStartIconName(IconNameVar string) { | |
| 139 | + | func (x *ButtonRow) SetStartIconName(IconNameVar *string) { | |
| 140 | 140 | ||
| 141 | - | xButtonRowSetStartIconName(x.GoPointer(), IconNameVar) | |
| 141 | + | xButtonRowSetStartIconName(x.GoPointer(), core.NullableStringToPtr(IconNameVar)) | |
| 142 | 142 | ||
| 143 | 143 | } | |
| 144 | 144 | ||
| @@ -158,7 +158,7 @@ func (c *ButtonRow) SetGoPointer(ptr uintptr) { | |||
| 158 | 158 | func (x *ButtonRow) SetPropertyEndIconName(value string) { | |
| 159 | 159 | var v gobject.Value | |
| 160 | 160 | v.Init(gobject.TypeStringVal) | |
| 161 | - | v.SetString(value) | |
| 161 | + | v.SetString(&value) | |
| 162 | 162 | x.SetProperty("end-icon-name", &v) | |
| 163 | 163 | } | |
| 164 | 164 | ||
| @@ -175,7 +175,7 @@ func (x *ButtonRow) GetPropertyEndIconName() string { | |||
| 175 | 175 | func (x *ButtonRow) SetPropertyStartIconName(value string) { | |
| 176 | 176 | var v gobject.Value | |
| 177 | 177 | v.Init(gobject.TypeStringVal) | |
| 178 | - | v.SetString(value) | |
| 178 | + | v.SetString(&value) | |
| 179 | 179 | x.SetProperty("start-icon-name", &v) | |
| 180 | 180 | } | |
| 181 | 181 | ||
| @@ -502,9 +502,9 @@ func (x *ButtonRow) GetActionTargetValue() *glib.Variant { | |||
| 502 | 502 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 503 | 503 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 504 | 504 | // associated with the window. | |
| 505 | - | func (x *ButtonRow) SetActionName(ActionNameVar string) { | |
| 505 | + | func (x *ButtonRow) SetActionName(ActionNameVar *string) { | |
| 506 | 506 | ||
| 507 | - | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 507 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 508 | 508 | ||
| 509 | 509 | } | |
| 510 | 510 | ||
M v4/adw/adw-combo-row.go +2 -2
| @@ -747,9 +747,9 @@ func (x *ComboRow) GetActionTargetValue() *glib.Variant { | |||
| 747 | 747 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 748 | 748 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 749 | 749 | // associated with the window. | |
| 750 | - | func (x *ComboRow) SetActionName(ActionNameVar string) { | |
| 750 | + | func (x *ComboRow) SetActionName(ActionNameVar *string) { | |
| 751 | 751 | ||
| 752 | - | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 752 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 753 | 753 | ||
| 754 | 754 | } | |
| 755 | 755 | ||
M v4/adw/adw-dialog.go +1 -1
| @@ -605,7 +605,7 @@ func (x *Dialog) GetPropertyFollowsContentSize() bool { | |||
| 605 | 605 | func (x *Dialog) SetPropertyTitle(value string) { | |
| 606 | 606 | var v gobject.Value | |
| 607 | 607 | v.Init(gobject.TypeStringVal) | |
| 608 | - | v.SetString(value) | |
| 608 | + | v.SetString(&value) | |
| 609 | 609 | x.SetProperty("title", &v) | |
| 610 | 610 | } | |
| 611 | 611 | ||
M v4/adw/adw-entry-row.go +2 -2
| @@ -752,9 +752,9 @@ func (x *EntryRow) GetActionTargetValue() *glib.Variant { | |||
| 752 | 752 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 753 | 753 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 754 | 754 | // associated with the window. | |
| 755 | - | func (x *EntryRow) SetActionName(ActionNameVar string) { | |
| 755 | + | func (x *EntryRow) SetActionName(ActionNameVar *string) { | |
| 756 | 756 | ||
| 757 | - | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 757 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 758 | 758 | ||
| 759 | 759 | } | |
| 760 | 760 | ||
M v4/adw/adw-expander-row.go +7 -7
| @@ -227,12 +227,12 @@ func (x *ExpanderRow) SetExpanded(ExpandedVar bool) { | |||
| 227 | 227 | ||
| 228 | 228 | } | |
| 229 | 229 | ||
| 230 | - | var xExpanderRowSetIconName func(uintptr, string) | |
| 230 | + | var xExpanderRowSetIconName func(uintptr, uintptr) | |
| 231 | 231 | ||
| 232 | 232 | // Sets the icon name for @self. | |
| 233 | - | func (x *ExpanderRow) SetIconName(IconNameVar string) { | |
| 233 | + | func (x *ExpanderRow) SetIconName(IconNameVar *string) { | |
| 234 | 234 | ||
| 235 | - | xExpanderRowSetIconName(x.GoPointer(), IconNameVar) | |
| 235 | + | xExpanderRowSetIconName(x.GoPointer(), core.NullableStringToPtr(IconNameVar)) | |
| 236 | 236 | ||
| 237 | 237 | } | |
| 238 | 238 | ||
| @@ -331,7 +331,7 @@ func (x *ExpanderRow) GetPropertyExpanded() bool { | |||
| 331 | 331 | func (x *ExpanderRow) SetPropertyIconName(value string) { | |
| 332 | 332 | var v gobject.Value | |
| 333 | 333 | v.Init(gobject.TypeStringVal) | |
| 334 | - | v.SetString(value) | |
| 334 | + | v.SetString(&value) | |
| 335 | 335 | x.SetProperty("icon-name", &v) | |
| 336 | 336 | } | |
| 337 | 337 | ||
| @@ -368,7 +368,7 @@ func (x *ExpanderRow) GetPropertyShowEnableSwitch() bool { | |||
| 368 | 368 | func (x *ExpanderRow) SetPropertySubtitle(value string) { | |
| 369 | 369 | var v gobject.Value | |
| 370 | 370 | v.Init(gobject.TypeStringVal) | |
| 371 | - | v.SetString(value) | |
| 371 | + | v.SetString(&value) | |
| 372 | 372 | x.SetProperty("subtitle", &v) | |
| 373 | 373 | } | |
| 374 | 374 | ||
| @@ -722,9 +722,9 @@ func (x *ExpanderRow) GetActionTargetValue() *glib.Variant { | |||
| 722 | 722 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 723 | 723 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 724 | 724 | // associated with the window. | |
| 725 | - | func (x *ExpanderRow) SetActionName(ActionNameVar string) { | |
| 725 | + | func (x *ExpanderRow) SetActionName(ActionNameVar *string) { | |
| 726 | 726 | ||
| 727 | - | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 727 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 728 | 728 | ||
| 729 | 729 | } | |
| 730 | 730 | ||
M v4/adw/adw-header-bar.go +4 -4
| @@ -280,7 +280,7 @@ func (x *HeaderBar) SetCenteringPolicy(CenteringPolicyVar CenteringPolicy) { | |||
| 280 | 280 | ||
| 281 | 281 | } | |
| 282 | 282 | ||
| 283 | - | var xHeaderBarSetDecorationLayout func(uintptr, string) | |
| 283 | + | var xHeaderBarSetDecorationLayout func(uintptr, uintptr) | |
| 284 | 284 | ||
| 285 | 285 | // Sets the decoration layout for @self. | |
| 286 | 286 | // | |
| @@ -294,9 +294,9 @@ var xHeaderBarSetDecorationLayout func(uintptr, string) | |||
| 294 | 294 | // | |
| 295 | 295 | // For example, “icon:minimize,maximize,close” specifies an icon at the start, | |
| 296 | 296 | // and minimize, maximize and close buttons at the end. | |
| 297 | - | func (x *HeaderBar) SetDecorationLayout(LayoutVar string) { | |
| 297 | + | func (x *HeaderBar) SetDecorationLayout(LayoutVar *string) { | |
| 298 | 298 | ||
| 299 | - | xHeaderBarSetDecorationLayout(x.GoPointer(), LayoutVar) | |
| 299 | + | xHeaderBarSetDecorationLayout(x.GoPointer(), core.NullableStringToPtr(LayoutVar)) | |
| 300 | 300 | ||
| 301 | 301 | } | |
| 302 | 302 | ||
| @@ -404,7 +404,7 @@ func (c *HeaderBar) SetGoPointer(ptr uintptr) { | |||
| 404 | 404 | func (x *HeaderBar) SetPropertyDecorationLayout(value string) { | |
| 405 | 405 | var v gobject.Value | |
| 406 | 406 | v.Init(gobject.TypeStringVal) | |
| 407 | - | v.SetString(value) | |
| 407 | + | v.SetString(&value) | |
| 408 | 408 | x.SetProperty("decoration-layout", &v) | |
| 409 | 409 | } | |
| 410 | 410 | ||
M v4/adw/adw-layout-slot.go +1 -1
| @@ -88,7 +88,7 @@ func (c *LayoutSlot) SetGoPointer(ptr uintptr) { | |||
| 88 | 88 | func (x *LayoutSlot) SetPropertyId(value string) { | |
| 89 | 89 | var v gobject.Value | |
| 90 | 90 | v.Init(gobject.TypeStringVal) | |
| 91 | - | v.SetString(value) | |
| 91 | + | v.SetString(&value) | |
| 92 | 92 | x.SetProperty("id", &v) | |
| 93 | 93 | } | |
| 94 | 94 | ||
M v4/adw/adw-layout.go +4 -4
| @@ -81,12 +81,12 @@ func (x *Layout) GetName() string { | |||
| 81 | 81 | return cret | |
| 82 | 82 | } | |
| 83 | 83 | ||
| 84 | - | var xLayoutSetName func(uintptr, string) | |
| 84 | + | var xLayoutSetName func(uintptr, uintptr) | |
| 85 | 85 | ||
| 86 | 86 | // Sets the name of the layout. | |
| 87 | - | func (x *Layout) SetName(NameVar string) { | |
| 87 | + | func (x *Layout) SetName(NameVar *string) { | |
| 88 | 88 | ||
| 89 | - | xLayoutSetName(x.GoPointer(), NameVar) | |
| 89 | + | xLayoutSetName(x.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 90 | 90 | ||
| 91 | 91 | } | |
| 92 | 92 | ||
| @@ -106,7 +106,7 @@ func (c *Layout) SetGoPointer(ptr uintptr) { | |||
| 106 | 106 | func (x *Layout) SetPropertyName(value string) { | |
| 107 | 107 | var v gobject.Value | |
| 108 | 108 | v.Init(gobject.TypeStringVal) | |
| 109 | - | v.SetString(value) | |
| 109 | + | v.SetString(&value) | |
| 110 | 110 | x.SetProperty("name", &v) | |
| 111 | 111 | } | |
| 112 | 112 | ||
M v4/adw/adw-leaflet.go +5 -5
| @@ -783,7 +783,7 @@ func (x *Leaflet) GetPropertyModeTransitionDuration() uint { | |||
| 783 | 783 | func (x *Leaflet) SetPropertyVisibleChildName(value string) { | |
| 784 | 784 | var v gobject.Value | |
| 785 | 785 | v.Init(gobject.TypeStringVal) | |
| 786 | - | v.SetString(value) | |
| 786 | + | v.SetString(&value) | |
| 787 | 787 | x.SetProperty("visible-child-name", &v) | |
| 788 | 788 | } | |
| 789 | 789 | ||
| @@ -1189,12 +1189,12 @@ func (x *LeafletPage) GetNavigatable() bool { | |||
| 1189 | 1189 | return cret | |
| 1190 | 1190 | } | |
| 1191 | 1191 | ||
| 1192 | - | var xLeafletPageSetName func(uintptr, string) | |
| 1192 | + | var xLeafletPageSetName func(uintptr, uintptr) | |
| 1193 | 1193 | ||
| 1194 | 1194 | // Sets the name of the @self. | |
| 1195 | - | func (x *LeafletPage) SetName(NameVar string) { | |
| 1195 | + | func (x *LeafletPage) SetName(NameVar *string) { | |
| 1196 | 1196 | ||
| 1197 | - | xLeafletPageSetName(x.GoPointer(), NameVar) | |
| 1197 | + | xLeafletPageSetName(x.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 1198 | 1198 | ||
| 1199 | 1199 | } | |
| 1200 | 1200 | ||
| @@ -1228,7 +1228,7 @@ func (c *LeafletPage) SetGoPointer(ptr uintptr) { | |||
| 1228 | 1228 | func (x *LeafletPage) SetPropertyName(value string) { | |
| 1229 | 1229 | var v gobject.Value | |
| 1230 | 1230 | v.Init(gobject.TypeStringVal) | |
| 1231 | - | v.SetString(value) | |
| 1231 | + | v.SetString(&value) | |
| 1232 | 1232 | x.SetProperty("name", &v) | |
| 1233 | 1233 | } | |
| 1234 | 1234 | ||
M v4/adw/adw-message-dialog.go +52 -14
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | package adw | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "fmt" | |
| 5 | 6 | "structs" | |
| 6 | 7 | "unsafe" | |
| 7 | 8 | ||
| @@ -208,7 +209,7 @@ func MessageDialogNewFromInternalPtr(ptr uintptr) *MessageDialog { | |||
| 208 | 209 | return cls | |
| 209 | 210 | } | |
| 210 | 211 | ||
| 211 | - | var xNewMessageDialog func(uintptr, string, string) uintptr | |
| 212 | + | var xNewMessageDialog func(uintptr, uintptr, uintptr) uintptr | |
| 212 | 213 | ||
| 213 | 214 | // Creates a new `AdwMessageDialog`. | |
| 214 | 215 | // | |
| @@ -226,10 +227,10 @@ var xNewMessageDialog func(uintptr, string, string) uintptr | |||
| 226 | 227 | // filename); | |
| 227 | 228 | // | |
| 228 | 229 | // ``` | |
| 229 | - | func NewMessageDialog(ParentVar *gtk.Window, HeadingVar string, BodyVar string) *MessageDialog { | |
| 230 | + | func NewMessageDialog(ParentVar *gtk.Window, HeadingVar *string, BodyVar *string) *MessageDialog { | |
| 230 | 231 | var cls *MessageDialog | |
| 231 | 232 | ||
| 232 | - | cret := xNewMessageDialog(ParentVar.GoPointer(), HeadingVar, BodyVar) | |
| 233 | + | cret := xNewMessageDialog(ParentVar.GoPointer(), core.NullableStringToPtr(HeadingVar), core.NullableStringToPtr(BodyVar)) | |
| 233 | 234 | ||
| 234 | 235 | if cret == 0 { | |
| 235 | 236 | return nil | |
| @@ -294,7 +295,22 @@ var xMessageDialogChoose func(uintptr, uintptr, uintptr, uintptr) | |||
| 294 | 295 | // This function shows @self to the user. | |
| 295 | 296 | func (x *MessageDialog) Choose(CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 296 | 297 | ||
| 297 | - | xMessageDialogChoose(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 298 | + | var CallbackVarRef uintptr | |
| 299 | + | if CallbackVar != nil { | |
| 300 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 301 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 302 | + | CallbackVarRef = cbRefPtr | |
| 303 | + | } else { | |
| 304 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 305 | + | cbFn := *CallbackVar | |
| 306 | + | cbFn(arg0, arg1, arg2) | |
| 307 | + | } | |
| 308 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 309 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 310 | + | } | |
| 311 | + | } | |
| 312 | + | ||
| 313 | + | xMessageDialogChoose(x.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 298 | 314 | ||
| 299 | 315 | } | |
| 300 | 316 | ||
| @@ -532,7 +548,7 @@ func (x *MessageDialog) SetCloseResponse(ResponseVar string) { | |||
| 532 | 548 | ||
| 533 | 549 | } | |
| 534 | 550 | ||
| 535 | - | var xMessageDialogSetDefaultResponse func(uintptr, string) | |
| 551 | + | var xMessageDialogSetDefaultResponse func(uintptr, uintptr) | |
| 536 | 552 | ||
| 537 | 553 | // Sets the ID of the default response of @self. | |
| 538 | 554 | // | |
| @@ -543,9 +559,9 @@ var xMessageDialogSetDefaultResponse func(uintptr, string) | |||
| 543 | 559 | // will be focused by default. | |
| 544 | 560 | // | |
| 545 | 561 | // See [property@Gtk.Window:default-widget]. | |
| 546 | - | func (x *MessageDialog) SetDefaultResponse(ResponseVar string) { | |
| 562 | + | func (x *MessageDialog) SetDefaultResponse(ResponseVar *string) { | |
| 547 | 563 | ||
| 548 | - | xMessageDialogSetDefaultResponse(x.GoPointer(), ResponseVar) | |
| 564 | + | xMessageDialogSetDefaultResponse(x.GoPointer(), core.NullableStringToPtr(ResponseVar)) | |
| 549 | 565 | ||
| 550 | 566 | } | |
| 551 | 567 | ||
| @@ -560,12 +576,12 @@ func (x *MessageDialog) SetExtraChild(ChildVar *gtk.Widget) { | |||
| 560 | 576 | ||
| 561 | 577 | } | |
| 562 | 578 | ||
| 563 | - | var xMessageDialogSetHeading func(uintptr, string) | |
| 579 | + | var xMessageDialogSetHeading func(uintptr, uintptr) | |
| 564 | 580 | ||
| 565 | 581 | // Sets the heading of @self. | |
| 566 | - | func (x *MessageDialog) SetHeading(HeadingVar string) { | |
| 582 | + | func (x *MessageDialog) SetHeading(HeadingVar *string) { | |
| 567 | 583 | ||
| 568 | - | xMessageDialogSetHeading(x.GoPointer(), HeadingVar) | |
| 584 | + | xMessageDialogSetHeading(x.GoPointer(), core.NullableStringToPtr(HeadingVar)) | |
| 569 | 585 | ||
| 570 | 586 | } | |
| 571 | 587 | ||
| @@ -653,7 +669,7 @@ func (c *MessageDialog) SetGoPointer(ptr uintptr) { | |||
| 653 | 669 | func (x *MessageDialog) SetPropertyBody(value string) { | |
| 654 | 670 | var v gobject.Value | |
| 655 | 671 | v.Init(gobject.TypeStringVal) | |
| 656 | - | v.SetString(value) | |
| 672 | + | v.SetString(&value) | |
| 657 | 673 | x.SetProperty("body", &v) | |
| 658 | 674 | } | |
| 659 | 675 | ||
| @@ -698,7 +714,7 @@ func (x *MessageDialog) GetPropertyBodyUseMarkup() bool { | |||
| 698 | 714 | func (x *MessageDialog) SetPropertyCloseResponse(value string) { | |
| 699 | 715 | var v gobject.Value | |
| 700 | 716 | v.Init(gobject.TypeStringVal) | |
| 701 | - | v.SetString(value) | |
| 717 | + | v.SetString(&value) | |
| 702 | 718 | x.SetProperty("close-response", &v) | |
| 703 | 719 | } | |
| 704 | 720 | ||
| @@ -730,7 +746,7 @@ func (x *MessageDialog) GetPropertyCloseResponse() string { | |||
| 730 | 746 | func (x *MessageDialog) SetPropertyDefaultResponse(value string) { | |
| 731 | 747 | var v gobject.Value | |
| 732 | 748 | v.Init(gobject.TypeStringVal) | |
| 733 | - | v.SetString(value) | |
| 749 | + | v.SetString(&value) | |
| 734 | 750 | x.SetProperty("default-response", &v) | |
| 735 | 751 | } | |
| 736 | 752 | ||
| @@ -755,7 +771,7 @@ func (x *MessageDialog) GetPropertyDefaultResponse() string { | |||
| 755 | 771 | func (x *MessageDialog) SetPropertyHeading(value string) { | |
| 756 | 772 | var v gobject.Value | |
| 757 | 773 | v.Init(gobject.TypeStringVal) | |
| 758 | - | v.SetString(value) | |
| 774 | + | v.SetString(&value) | |
| 759 | 775 | x.SetProperty("heading", &v) | |
| 760 | 776 | } | |
| 761 | 777 | ||
| @@ -815,6 +831,28 @@ func (x *MessageDialog) ConnectResponse(cb *func(MessageDialog, string)) uint32 | |||
| 815 | 831 | return gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr) | |
| 816 | 832 | } | |
| 817 | 833 | ||
| 834 | + | // ConnectResponseWithDetail connects to the "response" signal with a detail string. | |
| 835 | + | // The detail is appended as "response::<detail>". | |
| 836 | + | func (x *MessageDialog) ConnectResponseWithDetail(detail string, cb *func(MessageDialog, string)) uint32 { | |
| 837 | + | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 838 | + | signalName := fmt.Sprintf("response::%s", detail) | |
| 839 | + | if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { | |
| 840 | + | return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 841 | + | } | |
| 842 | + | ||
| 843 | + | fcb := func(clsPtr uintptr, ResponseVarp string) { | |
| 844 | + | fa := MessageDialog{} | |
| 845 | + | fa.Ptr = clsPtr | |
| 846 | + | cbFn := *cb | |
| 847 | + | ||
| 848 | + | cbFn(fa, ResponseVarp) | |
| 849 | + | ||
| 850 | + | } | |
| 851 | + | cbRefPtr := purego.NewCallback(fcb) | |
| 852 | + | glib.SaveCallback(cbPtr, cbRefPtr) | |
| 853 | + | return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 854 | + | } | |
| 855 | + | ||
| 818 | 856 | // Requests the user's screen reader to announce the given message. | |
| 819 | 857 | // | |
| 820 | 858 | // This kind of notification is useful for messages that | |
M v4/adw/adw-multi-layout-view.go +1 -1
| @@ -266,7 +266,7 @@ func (c *MultiLayoutView) SetGoPointer(ptr uintptr) { | |||
| 266 | 266 | func (x *MultiLayoutView) SetPropertyLayoutName(value string) { | |
| 267 | 267 | var v gobject.Value | |
| 268 | 268 | v.Init(gobject.TypeStringVal) | |
| 269 | - | v.SetString(value) | |
| 269 | + | v.SetString(&value) | |
| 270 | 270 | x.SetProperty("layout-name", &v) | |
| 271 | 271 | } | |
| 272 | 272 | ||
M v4/adw/adw-navigation-view.go +5 -5
| @@ -284,7 +284,7 @@ func (x *NavigationPage) SetChild(ChildVar *gtk.Widget) { | |||
| 284 | 284 | ||
| 285 | 285 | } | |
| 286 | 286 | ||
| 287 | - | var xNavigationPageSetTag func(uintptr, string) | |
| 287 | + | var xNavigationPageSetTag func(uintptr, uintptr) | |
| 288 | 288 | ||
| 289 | 289 | // Sets the tag for @self. | |
| 290 | 290 | // | |
| @@ -296,9 +296,9 @@ var xNavigationPageSetTag func(uintptr, string) | |||
| 296 | 296 | // Tags must be unique within each [class@NavigationView]. | |
| 297 | 297 | // | |
| 298 | 298 | // The tag also must be set to use the `navigation.push` action. | |
| 299 | - | func (x *NavigationPage) SetTag(TagVar string) { | |
| 299 | + | func (x *NavigationPage) SetTag(TagVar *string) { | |
| 300 | 300 | ||
| 301 | - | xNavigationPageSetTag(x.GoPointer(), TagVar) | |
| 301 | + | xNavigationPageSetTag(x.GoPointer(), core.NullableStringToPtr(TagVar)) | |
| 302 | 302 | ||
| 303 | 303 | } | |
| 304 | 304 | ||
| @@ -374,7 +374,7 @@ func (x *NavigationPage) GetPropertyCanPop() bool { | |||
| 374 | 374 | func (x *NavigationPage) SetPropertyTag(value string) { | |
| 375 | 375 | var v gobject.Value | |
| 376 | 376 | v.Init(gobject.TypeStringVal) | |
| 377 | - | v.SetString(value) | |
| 377 | + | v.SetString(&value) | |
| 378 | 378 | x.SetProperty("tag", &v) | |
| 379 | 379 | } | |
| 380 | 380 | ||
| @@ -403,7 +403,7 @@ func (x *NavigationPage) GetPropertyTag() string { | |||
| 403 | 403 | func (x *NavigationPage) SetPropertyTitle(value string) { | |
| 404 | 404 | var v gobject.Value | |
| 405 | 405 | v.Init(gobject.TypeStringVal) | |
| 406 | - | v.SetString(value) | |
| 406 | + | v.SetString(&value) | |
| 407 | 407 | x.SetProperty("title", &v) | |
| 408 | 408 | } | |
| 409 | 409 | ||
M v4/adw/adw-password-entry-row.go +2 -2
| @@ -383,9 +383,9 @@ func (x *PasswordEntryRow) GetActionTargetValue() *glib.Variant { | |||
| 383 | 383 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 384 | 384 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 385 | 385 | // associated with the window. | |
| 386 | - | func (x *PasswordEntryRow) SetActionName(ActionNameVar string) { | |
| 386 | + | func (x *PasswordEntryRow) SetActionName(ActionNameVar *string) { | |
| 387 | 387 | ||
| 388 | - | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 388 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 389 | 389 | ||
| 390 | 390 | } | |
| 391 | 391 | ||
M v4/adw/adw-preferences-dialog.go +1 -1
| @@ -227,7 +227,7 @@ func (x *PreferencesDialog) GetPropertySearchEnabled() bool { | |||
| 227 | 227 | func (x *PreferencesDialog) SetPropertyVisiblePageName(value string) { | |
| 228 | 228 | var v gobject.Value | |
| 229 | 229 | v.Init(gobject.TypeStringVal) | |
| 230 | - | v.SetString(value) | |
| 230 | + | v.SetString(&value) | |
| 231 | 231 | x.SetProperty("visible-page-name", &v) | |
| 232 | 232 | } | |
| 233 | 233 | ||
M v4/adw/adw-preferences-group.go +36 -6
| @@ -113,7 +113,37 @@ var xPreferencesGroupBindModel func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||
| 113 | 113 | // See [method@Gtk.ListBox.bind_model]. | |
| 114 | 114 | func (x *PreferencesGroup) BindModel(ModelVar gio.ListModel, CreateRowFuncVar *gtk.ListBoxCreateWidgetFunc, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) { | |
| 115 | 115 | ||
| 116 | - | xPreferencesGroupBindModel(x.GoPointer(), ModelVar.GoPointer(), glib.NewCallbackNullable(CreateRowFuncVar), UserDataVar, glib.NewCallback(UserDataFreeFuncVar)) | |
| 116 | + | var CreateRowFuncVarRef uintptr | |
| 117 | + | if CreateRowFuncVar != nil { | |
| 118 | + | CreateRowFuncVarPtr := uintptr(unsafe.Pointer(CreateRowFuncVar)) | |
| 119 | + | if cbRefPtr, ok := glib.GetCallback(CreateRowFuncVarPtr); ok { | |
| 120 | + | CreateRowFuncVarRef = cbRefPtr | |
| 121 | + | } else { | |
| 122 | + | fcb := func(arg0 uintptr, arg1 uintptr) uintptr { | |
| 123 | + | cbFn := *CreateRowFuncVar | |
| 124 | + | return cbFn(arg0, arg1) | |
| 125 | + | } | |
| 126 | + | CreateRowFuncVarRef = purego.NewCallback(fcb) | |
| 127 | + | glib.SaveCallback(CreateRowFuncVarPtr, CreateRowFuncVarRef) | |
| 128 | + | } | |
| 129 | + | } | |
| 130 | + | ||
| 131 | + | var UserDataFreeFuncVarRef uintptr | |
| 132 | + | if UserDataFreeFuncVar != nil { | |
| 133 | + | UserDataFreeFuncVarPtr := uintptr(unsafe.Pointer(UserDataFreeFuncVar)) | |
| 134 | + | if cbRefPtr, ok := glib.GetCallback(UserDataFreeFuncVarPtr); ok { | |
| 135 | + | UserDataFreeFuncVarRef = cbRefPtr | |
| 136 | + | } else { | |
| 137 | + | fcb := func(arg0 uintptr) { | |
| 138 | + | cbFn := *UserDataFreeFuncVar | |
| 139 | + | cbFn(arg0) | |
| 140 | + | } | |
| 141 | + | UserDataFreeFuncVarRef = purego.NewCallback(fcb) | |
| 142 | + | glib.SaveCallback(UserDataFreeFuncVarPtr, UserDataFreeFuncVarRef) | |
| 143 | + | } | |
| 144 | + | } | |
| 145 | + | ||
| 146 | + | xPreferencesGroupBindModel(x.GoPointer(), ModelVar.GoPointer(), CreateRowFuncVarRef, UserDataVar, UserDataFreeFuncVarRef) | |
| 117 | 147 | ||
| 118 | 148 | } | |
| 119 | 149 | ||
| @@ -189,12 +219,12 @@ func (x *PreferencesGroup) Remove(ChildVar *gtk.Widget) { | |||
| 189 | 219 | ||
| 190 | 220 | } | |
| 191 | 221 | ||
| 192 | - | var xPreferencesGroupSetDescription func(uintptr, string) | |
| 222 | + | var xPreferencesGroupSetDescription func(uintptr, uintptr) | |
| 193 | 223 | ||
| 194 | 224 | // Sets the description for @self. | |
| 195 | - | func (x *PreferencesGroup) SetDescription(DescriptionVar string) { | |
| 225 | + | func (x *PreferencesGroup) SetDescription(DescriptionVar *string) { | |
| 196 | 226 | ||
| 197 | - | xPreferencesGroupSetDescription(x.GoPointer(), DescriptionVar) | |
| 227 | + | xPreferencesGroupSetDescription(x.GoPointer(), core.NullableStringToPtr(DescriptionVar)) | |
| 198 | 228 | ||
| 199 | 229 | } | |
| 200 | 230 | ||
| @@ -249,7 +279,7 @@ func (c *PreferencesGroup) SetGoPointer(ptr uintptr) { | |||
| 249 | 279 | func (x *PreferencesGroup) SetPropertyDescription(value string) { | |
| 250 | 280 | var v gobject.Value | |
| 251 | 281 | v.Init(gobject.TypeStringVal) | |
| 252 | - | v.SetString(value) | |
| 282 | + | v.SetString(&value) | |
| 253 | 283 | x.SetProperty("description", &v) | |
| 254 | 284 | } | |
| 255 | 285 | ||
| @@ -291,7 +321,7 @@ func (x *PreferencesGroup) GetPropertySeparateRows() bool { | |||
| 291 | 321 | func (x *PreferencesGroup) SetPropertyTitle(value string) { | |
| 292 | 322 | var v gobject.Value | |
| 293 | 323 | v.Init(gobject.TypeStringVal) | |
| 294 | - | v.SetString(value) | |
| 324 | + | v.SetString(&value) | |
| 295 | 325 | x.SetProperty("title", &v) | |
| 296 | 326 | } | |
| 297 | 327 | ||
M v4/adw/adw-preferences-page.go +10 -10
| @@ -234,21 +234,21 @@ func (x *PreferencesPage) SetDescriptionCentered(CenteredVar bool) { | |||
| 234 | 234 | ||
| 235 | 235 | } | |
| 236 | 236 | ||
| 237 | - | var xPreferencesPageSetIconName func(uintptr, string) | |
| 237 | + | var xPreferencesPageSetIconName func(uintptr, uintptr) | |
| 238 | 238 | ||
| 239 | 239 | // Sets the icon name for @self. | |
| 240 | - | func (x *PreferencesPage) SetIconName(IconNameVar string) { | |
| 240 | + | func (x *PreferencesPage) SetIconName(IconNameVar *string) { | |
| 241 | 241 | ||
| 242 | - | xPreferencesPageSetIconName(x.GoPointer(), IconNameVar) | |
| 242 | + | xPreferencesPageSetIconName(x.GoPointer(), core.NullableStringToPtr(IconNameVar)) | |
| 243 | 243 | ||
| 244 | 244 | } | |
| 245 | 245 | ||
| 246 | - | var xPreferencesPageSetName func(uintptr, string) | |
| 246 | + | var xPreferencesPageSetName func(uintptr, uintptr) | |
| 247 | 247 | ||
| 248 | 248 | // Sets the name of @self. | |
| 249 | - | func (x *PreferencesPage) SetName(NameVar string) { | |
| 249 | + | func (x *PreferencesPage) SetName(NameVar *string) { | |
| 250 | 250 | ||
| 251 | - | xPreferencesPageSetName(x.GoPointer(), NameVar) | |
| 251 | + | xPreferencesPageSetName(x.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 252 | 252 | ||
| 253 | 253 | } | |
| 254 | 254 | ||
| @@ -286,7 +286,7 @@ func (c *PreferencesPage) SetGoPointer(ptr uintptr) { | |||
| 286 | 286 | func (x *PreferencesPage) SetPropertyDescription(value string) { | |
| 287 | 287 | var v gobject.Value | |
| 288 | 288 | v.Init(gobject.TypeStringVal) | |
| 289 | - | v.SetString(value) | |
| 289 | + | v.SetString(&value) | |
| 290 | 290 | x.SetProperty("description", &v) | |
| 291 | 291 | } | |
| 292 | 292 | ||
| @@ -320,7 +320,7 @@ func (x *PreferencesPage) GetPropertyDescriptionCentered() bool { | |||
| 320 | 320 | func (x *PreferencesPage) SetPropertyIconName(value string) { | |
| 321 | 321 | var v gobject.Value | |
| 322 | 322 | v.Init(gobject.TypeStringVal) | |
| 323 | - | v.SetString(value) | |
| 323 | + | v.SetString(&value) | |
| 324 | 324 | x.SetProperty("icon-name", &v) | |
| 325 | 325 | } | |
| 326 | 326 | ||
| @@ -337,7 +337,7 @@ func (x *PreferencesPage) GetPropertyIconName() string { | |||
| 337 | 337 | func (x *PreferencesPage) SetPropertyName(value string) { | |
| 338 | 338 | var v gobject.Value | |
| 339 | 339 | v.Init(gobject.TypeStringVal) | |
| 340 | - | v.SetString(value) | |
| 340 | + | v.SetString(&value) | |
| 341 | 341 | x.SetProperty("name", &v) | |
| 342 | 342 | } | |
| 343 | 343 | ||
| @@ -354,7 +354,7 @@ func (x *PreferencesPage) GetPropertyName() string { | |||
| 354 | 354 | func (x *PreferencesPage) SetPropertyTitle(value string) { | |
| 355 | 355 | var v gobject.Value | |
| 356 | 356 | v.Init(gobject.TypeStringVal) | |
| 357 | - | v.SetString(value) | |
| 357 | + | v.SetString(&value) | |
| 358 | 358 | x.SetProperty("title", &v) | |
| 359 | 359 | } | |
| 360 | 360 | ||
M v4/adw/adw-preferences-row.go +3 -3
| @@ -167,7 +167,7 @@ func (c *PreferencesRow) SetGoPointer(ptr uintptr) { | |||
| 167 | 167 | func (x *PreferencesRow) SetPropertyTitle(value string) { | |
| 168 | 168 | var v gobject.Value | |
| 169 | 169 | v.Init(gobject.TypeStringVal) | |
| 170 | - | v.SetString(value) | |
| 170 | + | v.SetString(&value) | |
| 171 | 171 | x.SetProperty("title", &v) | |
| 172 | 172 | } | |
| 173 | 173 | ||
| @@ -540,9 +540,9 @@ func (x *PreferencesRow) GetActionTargetValue() *glib.Variant { | |||
| 540 | 540 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 541 | 541 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 542 | 542 | // associated with the window. | |
| 543 | - | func (x *PreferencesRow) SetActionName(ActionNameVar string) { | |
| 543 | + | func (x *PreferencesRow) SetActionName(ActionNameVar *string) { | |
| 544 | 544 | ||
| 545 | - | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 545 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 546 | 546 | ||
| 547 | 547 | } | |
| 548 | 548 | ||
M v4/adw/adw-preferences-window.go +1 -1
| @@ -322,7 +322,7 @@ func (x *PreferencesWindow) GetPropertySearchEnabled() bool { | |||
| 322 | 322 | func (x *PreferencesWindow) SetPropertyVisiblePageName(value string) { | |
| 323 | 323 | var v gobject.Value | |
| 324 | 324 | v.Init(gobject.TypeStringVal) | |
| 325 | - | v.SetString(value) | |
| 325 | + | v.SetString(&value) | |
| 326 | 326 | x.SetProperty("visible-page-name", &v) | |
| 327 | 327 | } | |
| 328 | 328 | ||
M v4/adw/adw-shortcut-label.go +2 -2
| @@ -174,7 +174,7 @@ func (c *ShortcutLabel) SetGoPointer(ptr uintptr) { | |||
| 174 | 174 | func (x *ShortcutLabel) SetPropertyAccelerator(value string) { | |
| 175 | 175 | var v gobject.Value | |
| 176 | 176 | v.Init(gobject.TypeStringVal) | |
| 177 | - | v.SetString(value) | |
| 177 | + | v.SetString(&value) | |
| 178 | 178 | x.SetProperty("accelerator", &v) | |
| 179 | 179 | } | |
| 180 | 180 | ||
| @@ -191,7 +191,7 @@ func (x *ShortcutLabel) GetPropertyAccelerator() string { | |||
| 191 | 191 | func (x *ShortcutLabel) SetPropertyDisabledText(value string) { | |
| 192 | 192 | var v gobject.Value | |
| 193 | 193 | v.Init(gobject.TypeStringVal) | |
| 194 | - | v.SetString(value) | |
| 194 | + | v.SetString(&value) | |
| 195 | 195 | x.SetProperty("disabled-text", &v) | |
| 196 | 196 | } | |
| 197 | 197 | ||
M v4/adw/adw-shortcuts-item.go +4 -4
| @@ -199,7 +199,7 @@ func (c *ShortcutsItem) SetGoPointer(ptr uintptr) { | |||
| 199 | 199 | func (x *ShortcutsItem) SetPropertyAccelerator(value string) { | |
| 200 | 200 | var v gobject.Value | |
| 201 | 201 | v.Init(gobject.TypeStringVal) | |
| 202 | - | v.SetString(value) | |
| 202 | + | v.SetString(&value) | |
| 203 | 203 | x.SetProperty("accelerator", &v) | |
| 204 | 204 | } | |
| 205 | 205 | ||
| @@ -218,7 +218,7 @@ func (x *ShortcutsItem) GetPropertyAccelerator() string { | |||
| 218 | 218 | func (x *ShortcutsItem) SetPropertyActionName(value string) { | |
| 219 | 219 | var v gobject.Value | |
| 220 | 220 | v.Init(gobject.TypeStringVal) | |
| 221 | - | v.SetString(value) | |
| 221 | + | v.SetString(&value) | |
| 222 | 222 | x.SetProperty("action-name", &v) | |
| 223 | 223 | } | |
| 224 | 224 | ||
| @@ -235,7 +235,7 @@ func (x *ShortcutsItem) GetPropertyActionName() string { | |||
| 235 | 235 | func (x *ShortcutsItem) SetPropertySubtitle(value string) { | |
| 236 | 236 | var v gobject.Value | |
| 237 | 237 | v.Init(gobject.TypeStringVal) | |
| 238 | - | v.SetString(value) | |
| 238 | + | v.SetString(&value) | |
| 239 | 239 | x.SetProperty("subtitle", &v) | |
| 240 | 240 | } | |
| 241 | 241 | ||
| @@ -252,7 +252,7 @@ func (x *ShortcutsItem) GetPropertySubtitle() string { | |||
| 252 | 252 | func (x *ShortcutsItem) SetPropertyTitle(value string) { | |
| 253 | 253 | var v gobject.Value | |
| 254 | 254 | v.Init(gobject.TypeStringVal) | |
| 255 | - | v.SetString(value) | |
| 255 | + | v.SetString(&value) | |
| 256 | 256 | x.SetProperty("title", &v) | |
| 257 | 257 | } | |
| 258 | 258 | ||
M v4/adw/adw-shortcuts-section.go +7 -7
| @@ -50,13 +50,13 @@ func ShortcutsSectionNewFromInternalPtr(ptr uintptr) *ShortcutsSection { | |||
| 50 | 50 | return cls | |
| 51 | 51 | } | |
| 52 | 52 | ||
| 53 | - | var xNewShortcutsSection func(string) uintptr | |
| 53 | + | var xNewShortcutsSection func(uintptr) uintptr | |
| 54 | 54 | ||
| 55 | 55 | // Creates a new `AdwShortcutsSection` with @title as its title if provided. | |
| 56 | - | func NewShortcutsSection(TitleVar string) *ShortcutsSection { | |
| 56 | + | func NewShortcutsSection(TitleVar *string) *ShortcutsSection { | |
| 57 | 57 | var cls *ShortcutsSection | |
| 58 | 58 | ||
| 59 | - | cret := xNewShortcutsSection(TitleVar) | |
| 59 | + | cret := xNewShortcutsSection(core.NullableStringToPtr(TitleVar)) | |
| 60 | 60 | ||
| 61 | 61 | if cret == 0 { | |
| 62 | 62 | return nil | |
| @@ -84,12 +84,12 @@ func (x *ShortcutsSection) GetTitle() string { | |||
| 84 | 84 | return cret | |
| 85 | 85 | } | |
| 86 | 86 | ||
| 87 | - | var xShortcutsSectionSetTitle func(uintptr, string) | |
| 87 | + | var xShortcutsSectionSetTitle func(uintptr, uintptr) | |
| 88 | 88 | ||
| 89 | 89 | // Sets the title of @self. | |
| 90 | - | func (x *ShortcutsSection) SetTitle(TitleVar string) { | |
| 90 | + | func (x *ShortcutsSection) SetTitle(TitleVar *string) { | |
| 91 | 91 | ||
| 92 | - | xShortcutsSectionSetTitle(x.GoPointer(), TitleVar) | |
| 92 | + | xShortcutsSectionSetTitle(x.GoPointer(), core.NullableStringToPtr(TitleVar)) | |
| 93 | 93 | ||
| 94 | 94 | } | |
| 95 | 95 | ||
| @@ -109,7 +109,7 @@ func (c *ShortcutsSection) SetGoPointer(ptr uintptr) { | |||
| 109 | 109 | func (x *ShortcutsSection) SetPropertyTitle(value string) { | |
| 110 | 110 | var v gobject.Value | |
| 111 | 111 | v.Init(gobject.TypeStringVal) | |
| 112 | - | v.SetString(value) | |
| 112 | + | v.SetString(&value) | |
| 113 | 113 | x.SetProperty("title", &v) | |
| 114 | 114 | } | |
| 115 | 115 | ||
M v4/adw/adw-spin-row.go +2 -2
| @@ -789,9 +789,9 @@ func (x *SpinRow) GetActionTargetValue() *glib.Variant { | |||
| 789 | 789 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 790 | 790 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 791 | 791 | // associated with the window. | |
| 792 | - | func (x *SpinRow) SetActionName(ActionNameVar string) { | |
| 792 | + | func (x *SpinRow) SetActionName(ActionNameVar *string) { | |
| 793 | 793 | ||
| 794 | - | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 794 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 795 | 795 | ||
| 796 | 796 | } | |
| 797 | 797 | ||
M v4/adw/adw-split-button.go +5 -5
| @@ -396,7 +396,7 @@ func (x *SplitButton) GetPropertyCanShrink() bool { | |||
| 396 | 396 | func (x *SplitButton) SetPropertyDropdownTooltip(value string) { | |
| 397 | 397 | var v gobject.Value | |
| 398 | 398 | v.Init(gobject.TypeStringVal) | |
| 399 | - | v.SetString(value) | |
| 399 | + | v.SetString(&value) | |
| 400 | 400 | x.SetProperty("dropdown-tooltip", &v) | |
| 401 | 401 | } | |
| 402 | 402 | ||
| @@ -418,7 +418,7 @@ func (x *SplitButton) GetPropertyDropdownTooltip() string { | |||
| 418 | 418 | func (x *SplitButton) SetPropertyIconName(value string) { | |
| 419 | 419 | var v gobject.Value | |
| 420 | 420 | v.Init(gobject.TypeStringVal) | |
| 421 | - | v.SetString(value) | |
| 421 | + | v.SetString(&value) | |
| 422 | 422 | x.SetProperty("icon-name", &v) | |
| 423 | 423 | } | |
| 424 | 424 | ||
| @@ -441,7 +441,7 @@ func (x *SplitButton) GetPropertyIconName() string { | |||
| 441 | 441 | func (x *SplitButton) SetPropertyLabel(value string) { | |
| 442 | 442 | var v gobject.Value | |
| 443 | 443 | v.Init(gobject.TypeStringVal) | |
| 444 | - | v.SetString(value) | |
| 444 | + | v.SetString(&value) | |
| 445 | 445 | x.SetProperty("label", &v) | |
| 446 | 446 | } | |
| 447 | 447 | ||
| @@ -815,9 +815,9 @@ func (x *SplitButton) GetActionTargetValue() *glib.Variant { | |||
| 815 | 815 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 816 | 816 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 817 | 817 | // associated with the window. | |
| 818 | - | func (x *SplitButton) SetActionName(ActionNameVar string) { | |
| 818 | + | func (x *SplitButton) SetActionName(ActionNameVar *string) { | |
| 819 | 819 | ||
| 820 | - | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 820 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 821 | 821 | ||
| 822 | 822 | } | |
| 823 | 823 | ||
M v4/adw/adw-status-page.go +9 -9
| @@ -159,25 +159,25 @@ func (x *StatusPage) SetChild(ChildVar *gtk.Widget) { | |||
| 159 | 159 | ||
| 160 | 160 | } | |
| 161 | 161 | ||
| 162 | - | var xStatusPageSetDescription func(uintptr, string) | |
| 162 | + | var xStatusPageSetDescription func(uintptr, uintptr) | |
| 163 | 163 | ||
| 164 | 164 | // Sets the description markup for @self. | |
| 165 | 165 | // | |
| 166 | 166 | // The description is displayed below the title. It is parsed as Pango markup. | |
| 167 | - | func (x *StatusPage) SetDescription(DescriptionVar string) { | |
| 167 | + | func (x *StatusPage) SetDescription(DescriptionVar *string) { | |
| 168 | 168 | ||
| 169 | - | xStatusPageSetDescription(x.GoPointer(), DescriptionVar) | |
| 169 | + | xStatusPageSetDescription(x.GoPointer(), core.NullableStringToPtr(DescriptionVar)) | |
| 170 | 170 | ||
| 171 | 171 | } | |
| 172 | 172 | ||
| 173 | - | var xStatusPageSetIconName func(uintptr, string) | |
| 173 | + | var xStatusPageSetIconName func(uintptr, uintptr) | |
| 174 | 174 | ||
| 175 | 175 | // Sets the icon name for @self. | |
| 176 | 176 | // | |
| 177 | 177 | // Changing this will set [property@StatusPage:paintable] to `NULL`. | |
| 178 | - | func (x *StatusPage) SetIconName(IconNameVar string) { | |
| 178 | + | func (x *StatusPage) SetIconName(IconNameVar *string) { | |
| 179 | 179 | ||
| 180 | - | xStatusPageSetIconName(x.GoPointer(), IconNameVar) | |
| 180 | + | xStatusPageSetIconName(x.GoPointer(), core.NullableStringToPtr(IconNameVar)) | |
| 181 | 181 | ||
| 182 | 182 | } | |
| 183 | 183 | ||
| @@ -219,7 +219,7 @@ func (c *StatusPage) SetGoPointer(ptr uintptr) { | |||
| 219 | 219 | func (x *StatusPage) SetPropertyDescription(value string) { | |
| 220 | 220 | var v gobject.Value | |
| 221 | 221 | v.Init(gobject.TypeStringVal) | |
| 222 | - | v.SetString(value) | |
| 222 | + | v.SetString(&value) | |
| 223 | 223 | x.SetProperty("description", &v) | |
| 224 | 224 | } | |
| 225 | 225 | ||
| @@ -238,7 +238,7 @@ func (x *StatusPage) GetPropertyDescription() string { | |||
| 238 | 238 | func (x *StatusPage) SetPropertyIconName(value string) { | |
| 239 | 239 | var v gobject.Value | |
| 240 | 240 | v.Init(gobject.TypeStringVal) | |
| 241 | - | v.SetString(value) | |
| 241 | + | v.SetString(&value) | |
| 242 | 242 | x.SetProperty("icon-name", &v) | |
| 243 | 243 | } | |
| 244 | 244 | ||
| @@ -259,7 +259,7 @@ func (x *StatusPage) GetPropertyIconName() string { | |||
| 259 | 259 | func (x *StatusPage) SetPropertyTitle(value string) { | |
| 260 | 260 | var v gobject.Value | |
| 261 | 261 | v.Init(gobject.TypeStringVal) | |
| 262 | - | v.SetString(value) | |
| 262 | + | v.SetString(&value) | |
| 263 | 263 | x.SetProperty("title", &v) | |
| 264 | 264 | } | |
| 265 | 265 | ||
M v4/adw/adw-switch-row.go +2 -2
| @@ -431,9 +431,9 @@ func (x *SwitchRow) GetActionTargetValue() *glib.Variant { | |||
| 431 | 431 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 432 | 432 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 433 | 433 | // associated with the window. | |
| 434 | - | func (x *SwitchRow) SetActionName(ActionNameVar string) { | |
| 434 | + | func (x *SwitchRow) SetActionName(ActionNameVar *string) { | |
| 435 | 435 | ||
| 436 | - | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 436 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 437 | 437 | ||
| 438 | 438 | } | |
| 439 | 439 | ||
M v4/adw/adw-tab-button.go +2 -2
| @@ -463,9 +463,9 @@ func (x *TabButton) GetActionTargetValue() *glib.Variant { | |||
| 463 | 463 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 464 | 464 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 465 | 465 | // associated with the window. | |
| 466 | - | func (x *TabButton) SetActionName(ActionNameVar string) { | |
| 466 | + | func (x *TabButton) SetActionName(ActionNameVar *string) { | |
| 467 | 467 | ||
| 468 | - | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 468 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 469 | 469 | ||
| 470 | 470 | } | |
| 471 | 471 | ||
M v4/adw/adw-tab-view.go +4 -4
| @@ -544,7 +544,7 @@ func (x *TabPage) GetPropertyIndicatorActivatable() bool { | |||
| 544 | 544 | func (x *TabPage) SetPropertyIndicatorTooltip(value string) { | |
| 545 | 545 | var v gobject.Value | |
| 546 | 546 | v.Init(gobject.TypeStringVal) | |
| 547 | - | v.SetString(value) | |
| 547 | + | v.SetString(&value) | |
| 548 | 548 | x.SetProperty("indicator-tooltip", &v) | |
| 549 | 549 | } | |
| 550 | 550 | ||
| @@ -570,7 +570,7 @@ func (x *TabPage) GetPropertyIndicatorTooltip() string { | |||
| 570 | 570 | func (x *TabPage) SetPropertyKeyword(value string) { | |
| 571 | 571 | var v gobject.Value | |
| 572 | 572 | v.Init(gobject.TypeStringVal) | |
| 573 | - | v.SetString(value) | |
| 573 | + | v.SetString(&value) | |
| 574 | 574 | x.SetProperty("keyword", &v) | |
| 575 | 575 | } | |
| 576 | 576 | ||
| @@ -786,7 +786,7 @@ func (x *TabPage) GetPropertyThumbnailYalign() float32 { | |||
| 786 | 786 | func (x *TabPage) SetPropertyTitle(value string) { | |
| 787 | 787 | var v gobject.Value | |
| 788 | 788 | v.Init(gobject.TypeStringVal) | |
| 789 | - | v.SetString(value) | |
| 789 | + | v.SetString(&value) | |
| 790 | 790 | x.SetProperty("title", &v) | |
| 791 | 791 | } | |
| 792 | 792 | ||
| @@ -815,7 +815,7 @@ func (x *TabPage) GetPropertyTitle() string { | |||
| 815 | 815 | func (x *TabPage) SetPropertyTooltip(value string) { | |
| 816 | 816 | var v gobject.Value | |
| 817 | 817 | v.Init(gobject.TypeStringVal) | |
| 818 | - | v.SetString(value) | |
| 818 | + | v.SetString(&value) | |
| 819 | 819 | x.SetProperty("tooltip", &v) | |
| 820 | 820 | } | |
| 821 | 821 | ||
M v4/adw/adw-toast.go +15 -15
| @@ -327,20 +327,20 @@ func (x *Toast) GetUseMarkup() bool { | |||
| 327 | 327 | return cret | |
| 328 | 328 | } | |
| 329 | 329 | ||
| 330 | - | var xToastSetActionName func(uintptr, string) | |
| 330 | + | var xToastSetActionName func(uintptr, uintptr) | |
| 331 | 331 | ||
| 332 | 332 | // Sets the name of the associated action. | |
| 333 | 333 | // | |
| 334 | 334 | // It will be activated when clicking the button. | |
| 335 | 335 | // | |
| 336 | 336 | // See [property@Toast:action-target]. | |
| 337 | - | func (x *Toast) SetActionName(ActionNameVar string) { | |
| 337 | + | func (x *Toast) SetActionName(ActionNameVar *string) { | |
| 338 | 338 | ||
| 339 | - | xToastSetActionName(x.GoPointer(), ActionNameVar) | |
| 339 | + | xToastSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 340 | 340 | ||
| 341 | 341 | } | |
| 342 | 342 | ||
| 343 | - | var xToastSetActionTarget func(uintptr, string, ...interface{}) | |
| 343 | + | var xToastSetActionTarget func(uintptr, uintptr, ...interface{}) | |
| 344 | 344 | ||
| 345 | 345 | // Sets the parameter for action invocations. | |
| 346 | 346 | // | |
| @@ -351,9 +351,9 @@ var xToastSetActionTarget func(uintptr, string, ...interface{}) | |||
| 351 | 351 | // If you are setting a string-valued target and want to set | |
| 352 | 352 | // the action name at the same time, you can use | |
| 353 | 353 | // [method@Toast.set_detailed_action_name]. | |
| 354 | - | func (x *Toast) SetActionTarget(FormatStringVar string, varArgs ...interface{}) { | |
| 354 | + | func (x *Toast) SetActionTarget(FormatStringVar *string, varArgs ...interface{}) { | |
| 355 | 355 | ||
| 356 | - | xToastSetActionTarget(x.GoPointer(), FormatStringVar, varArgs...) | |
| 356 | + | xToastSetActionTarget(x.GoPointer(), core.NullableStringToPtr(FormatStringVar), varArgs...) | |
| 357 | 357 | ||
| 358 | 358 | } | |
| 359 | 359 | ||
| @@ -369,7 +369,7 @@ func (x *Toast) SetActionTargetValue(ActionTargetVar *glib.Variant) { | |||
| 369 | 369 | ||
| 370 | 370 | } | |
| 371 | 371 | ||
| 372 | - | var xToastSetButtonLabel func(uintptr, string) | |
| 372 | + | var xToastSetButtonLabel func(uintptr, uintptr) | |
| 373 | 373 | ||
| 374 | 374 | // Sets the label to show on the button. | |
| 375 | 375 | // | |
| @@ -378,9 +378,9 @@ var xToastSetButtonLabel func(uintptr, string) | |||
| 378 | 378 | // If set to `NULL`, the button won't be shown. | |
| 379 | 379 | // | |
| 380 | 380 | // See [property@Toast:action-name]. | |
| 381 | - | func (x *Toast) SetButtonLabel(ButtonLabelVar string) { | |
| 381 | + | func (x *Toast) SetButtonLabel(ButtonLabelVar *string) { | |
| 382 | 382 | ||
| 383 | - | xToastSetButtonLabel(x.GoPointer(), ButtonLabelVar) | |
| 383 | + | xToastSetButtonLabel(x.GoPointer(), core.NullableStringToPtr(ButtonLabelVar)) | |
| 384 | 384 | ||
| 385 | 385 | } | |
| 386 | 386 | ||
| @@ -398,15 +398,15 @@ func (x *Toast) SetCustomTitle(WidgetVar *gtk.Widget) { | |||
| 398 | 398 | ||
| 399 | 399 | } | |
| 400 | 400 | ||
| 401 | - | var xToastSetDetailedActionName func(uintptr, string) | |
| 401 | + | var xToastSetDetailedActionName func(uintptr, uintptr) | |
| 402 | 402 | ||
| 403 | 403 | // Sets the action name and its parameter. | |
| 404 | 404 | // | |
| 405 | 405 | // @detailed_action_name is a string in the format accepted by | |
| 406 | 406 | // [func@Gio.Action.parse_detailed_name]. | |
| 407 | - | func (x *Toast) SetDetailedActionName(DetailedActionNameVar string) { | |
| 407 | + | func (x *Toast) SetDetailedActionName(DetailedActionNameVar *string) { | |
| 408 | 408 | ||
| 409 | - | xToastSetDetailedActionName(x.GoPointer(), DetailedActionNameVar) | |
| 409 | + | xToastSetDetailedActionName(x.GoPointer(), core.NullableStringToPtr(DetailedActionNameVar)) | |
| 410 | 410 | ||
| 411 | 411 | } | |
| 412 | 412 | ||
| @@ -488,7 +488,7 @@ func (c *Toast) SetGoPointer(ptr uintptr) { | |||
| 488 | 488 | func (x *Toast) SetPropertyActionName(value string) { | |
| 489 | 489 | var v gobject.Value | |
| 490 | 490 | v.Init(gobject.TypeStringVal) | |
| 491 | - | v.SetString(value) | |
| 491 | + | v.SetString(&value) | |
| 492 | 492 | x.SetProperty("action-name", &v) | |
| 493 | 493 | } | |
| 494 | 494 | ||
| @@ -532,7 +532,7 @@ func (x *Toast) GetPropertyActionTarget() uintptr { | |||
| 532 | 532 | func (x *Toast) SetPropertyButtonLabel(value string) { | |
| 533 | 533 | var v gobject.Value | |
| 534 | 534 | v.Init(gobject.TypeStringVal) | |
| 535 | - | v.SetString(value) | |
| 535 | + | v.SetString(&value) | |
| 536 | 536 | x.SetProperty("button-label", &v) | |
| 537 | 537 | } | |
| 538 | 538 | ||
| @@ -590,7 +590,7 @@ func (x *Toast) GetPropertyTimeout() uint { | |||
| 590 | 590 | func (x *Toast) SetPropertyTitle(value string) { | |
| 591 | 591 | var v gobject.Value | |
| 592 | 592 | v.Init(gobject.TypeStringVal) | |
| 593 | - | v.SetString(value) | |
| 593 | + | v.SetString(&value) | |
| 594 | 594 | x.SetProperty("title", &v) | |
| 595 | 595 | } | |
| 596 | 596 | ||
M v4/adw/adw-toggle-group.go +17 -17
| @@ -172,41 +172,41 @@ func (x *Toggle) SetEnabled(EnabledVar bool) { | |||
| 172 | 172 | ||
| 173 | 173 | } | |
| 174 | 174 | ||
| 175 | - | var xToggleSetIconName func(uintptr, string) | |
| 175 | + | var xToggleSetIconName func(uintptr, uintptr) | |
| 176 | 176 | ||
| 177 | 177 | // Sets the icon name of @self to @icon_name. | |
| 178 | 178 | // | |
| 179 | 179 | // The icon will be displayed alone or next to the label, unless | |
| 180 | 180 | // [property@Toggle:child] is set. | |
| 181 | - | func (x *Toggle) SetIconName(IconNameVar string) { | |
| 181 | + | func (x *Toggle) SetIconName(IconNameVar *string) { | |
| 182 | 182 | ||
| 183 | - | xToggleSetIconName(x.GoPointer(), IconNameVar) | |
| 183 | + | xToggleSetIconName(x.GoPointer(), core.NullableStringToPtr(IconNameVar)) | |
| 184 | 184 | ||
| 185 | 185 | } | |
| 186 | 186 | ||
| 187 | - | var xToggleSetLabel func(uintptr, string) | |
| 187 | + | var xToggleSetLabel func(uintptr, uintptr) | |
| 188 | 188 | ||
| 189 | 189 | // Sets the label of @self to @label. | |
| 190 | 190 | // | |
| 191 | 191 | // The label will be displayed alone or next to the icon, unless | |
| 192 | 192 | // [property@Toggle:child] is set, but will still be read out by the screen | |
| 193 | 193 | // reader. | |
| 194 | - | func (x *Toggle) SetLabel(LabelVar string) { | |
| 194 | + | func (x *Toggle) SetLabel(LabelVar *string) { | |
| 195 | 195 | ||
| 196 | - | xToggleSetLabel(x.GoPointer(), LabelVar) | |
| 196 | + | xToggleSetLabel(x.GoPointer(), core.NullableStringToPtr(LabelVar)) | |
| 197 | 197 | ||
| 198 | 198 | } | |
| 199 | 199 | ||
| 200 | - | var xToggleSetName func(uintptr, string) | |
| 200 | + | var xToggleSetName func(uintptr, uintptr) | |
| 201 | 201 | ||
| 202 | 202 | // Sets the name of @self to @name. | |
| 203 | 203 | // | |
| 204 | 204 | // Allows accessing @self by its name instead of index. | |
| 205 | 205 | // | |
| 206 | 206 | // See [property@ToggleGroup:active-name]. | |
| 207 | - | func (x *Toggle) SetName(NameVar string) { | |
| 207 | + | func (x *Toggle) SetName(NameVar *string) { | |
| 208 | 208 | ||
| 209 | - | xToggleSetName(x.GoPointer(), NameVar) | |
| 209 | + | xToggleSetName(x.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 210 | 210 | ||
| 211 | 211 | } | |
| 212 | 212 | ||
| @@ -268,7 +268,7 @@ func (x *Toggle) GetPropertyEnabled() bool { | |||
| 268 | 268 | func (x *Toggle) SetPropertyIconName(value string) { | |
| 269 | 269 | var v gobject.Value | |
| 270 | 270 | v.Init(gobject.TypeStringVal) | |
| 271 | - | v.SetString(value) | |
| 271 | + | v.SetString(&value) | |
| 272 | 272 | x.SetProperty("icon-name", &v) | |
| 273 | 273 | } | |
| 274 | 274 | ||
| @@ -292,7 +292,7 @@ func (x *Toggle) GetPropertyIconName() string { | |||
| 292 | 292 | func (x *Toggle) SetPropertyLabel(value string) { | |
| 293 | 293 | var v gobject.Value | |
| 294 | 294 | v.Init(gobject.TypeStringVal) | |
| 295 | - | v.SetString(value) | |
| 295 | + | v.SetString(&value) | |
| 296 | 296 | x.SetProperty("label", &v) | |
| 297 | 297 | } | |
| 298 | 298 | ||
| @@ -317,7 +317,7 @@ func (x *Toggle) GetPropertyLabel() string { | |||
| 317 | 317 | func (x *Toggle) SetPropertyName(value string) { | |
| 318 | 318 | var v gobject.Value | |
| 319 | 319 | v.Init(gobject.TypeStringVal) | |
| 320 | - | v.SetString(value) | |
| 320 | + | v.SetString(&value) | |
| 321 | 321 | x.SetProperty("name", &v) | |
| 322 | 322 | } | |
| 323 | 323 | ||
| @@ -340,7 +340,7 @@ func (x *Toggle) GetPropertyName() string { | |||
| 340 | 340 | func (x *Toggle) SetPropertyTooltip(value string) { | |
| 341 | 341 | var v gobject.Value | |
| 342 | 342 | v.Init(gobject.TypeStringVal) | |
| 343 | - | v.SetString(value) | |
| 343 | + | v.SetString(&value) | |
| 344 | 344 | x.SetProperty("tooltip", &v) | |
| 345 | 345 | } | |
| 346 | 346 | ||
| @@ -659,16 +659,16 @@ func (x *ToggleGroup) SetActive(ActiveVar uint) { | |||
| 659 | 659 | ||
| 660 | 660 | } | |
| 661 | 661 | ||
| 662 | - | var xToggleGroupSetActiveName func(uintptr, string) | |
| 662 | + | var xToggleGroupSetActiveName func(uintptr, uintptr) | |
| 663 | 663 | ||
| 664 | 664 | // Sets the active toggle for @self. | |
| 665 | 665 | // | |
| 666 | 666 | // The name can be set via [property@Toggle:name]. | |
| 667 | 667 | // | |
| 668 | 668 | // If @name is `NULL`, unset the current active toggle instead. | |
| 669 | - | func (x *ToggleGroup) SetActiveName(NameVar string) { | |
| 669 | + | func (x *ToggleGroup) SetActiveName(NameVar *string) { | |
| 670 | 670 | ||
| 671 | - | xToggleGroupSetActiveName(x.GoPointer(), NameVar) | |
| 671 | + | xToggleGroupSetActiveName(x.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 672 | 672 | ||
| 673 | 673 | } | |
| 674 | 674 | ||
| @@ -745,7 +745,7 @@ func (x *ToggleGroup) GetPropertyActive() uint { | |||
| 745 | 745 | func (x *ToggleGroup) SetPropertyActiveName(value string) { | |
| 746 | 746 | var v gobject.Value | |
| 747 | 747 | v.Init(gobject.TypeStringVal) | |
| 748 | - | v.SetString(value) | |
| 748 | + | v.SetString(&value) | |
| 749 | 749 | x.SetProperty("active-name", &v) | |
| 750 | 750 | } | |
| 751 | 751 | ||
M v4/adw/adw-view-stack.go +22 -22
| @@ -151,15 +151,15 @@ func (x *ViewStack) Add(ChildVar *gtk.Widget) *ViewStackPage { | |||
| 151 | 151 | return cls | |
| 152 | 152 | } | |
| 153 | 153 | ||
| 154 | - | var xViewStackAddNamed func(uintptr, uintptr, string) uintptr | |
| 154 | + | var xViewStackAddNamed func(uintptr, uintptr, uintptr) uintptr | |
| 155 | 155 | ||
| 156 | 156 | // Adds a child to @self. | |
| 157 | 157 | // | |
| 158 | 158 | // The child is identified by the @name. | |
| 159 | - | func (x *ViewStack) AddNamed(ChildVar *gtk.Widget, NameVar string) *ViewStackPage { | |
| 159 | + | func (x *ViewStack) AddNamed(ChildVar *gtk.Widget, NameVar *string) *ViewStackPage { | |
| 160 | 160 | var cls *ViewStackPage | |
| 161 | 161 | ||
| 162 | - | cret := xViewStackAddNamed(x.GoPointer(), ChildVar.GoPointer(), NameVar) | |
| 162 | + | cret := xViewStackAddNamed(x.GoPointer(), ChildVar.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 163 | 163 | ||
| 164 | 164 | if cret == 0 { | |
| 165 | 165 | return nil | |
| @@ -170,16 +170,16 @@ func (x *ViewStack) AddNamed(ChildVar *gtk.Widget, NameVar string) *ViewStackPag | |||
| 170 | 170 | return cls | |
| 171 | 171 | } | |
| 172 | 172 | ||
| 173 | - | var xViewStackAddTitled func(uintptr, uintptr, string, string) uintptr | |
| 173 | + | var xViewStackAddTitled func(uintptr, uintptr, uintptr, string) uintptr | |
| 174 | 174 | ||
| 175 | 175 | // Adds a child to @self. | |
| 176 | 176 | // | |
| 177 | 177 | // The child is identified by the @name. The @title will be used by | |
| 178 | 178 | // [class@ViewSwitcher] to represent @child, so it should be short. | |
| 179 | - | func (x *ViewStack) AddTitled(ChildVar *gtk.Widget, NameVar string, TitleVar string) *ViewStackPage { | |
| 179 | + | func (x *ViewStack) AddTitled(ChildVar *gtk.Widget, NameVar *string, TitleVar string) *ViewStackPage { | |
| 180 | 180 | var cls *ViewStackPage | |
| 181 | 181 | ||
| 182 | - | cret := xViewStackAddTitled(x.GoPointer(), ChildVar.GoPointer(), NameVar, TitleVar) | |
| 182 | + | cret := xViewStackAddTitled(x.GoPointer(), ChildVar.GoPointer(), core.NullableStringToPtr(NameVar), TitleVar) | |
| 183 | 183 | ||
| 184 | 184 | if cret == 0 { | |
| 185 | 185 | return nil | |
| @@ -190,16 +190,16 @@ func (x *ViewStack) AddTitled(ChildVar *gtk.Widget, NameVar string, TitleVar str | |||
| 190 | 190 | return cls | |
| 191 | 191 | } | |
| 192 | 192 | ||
| 193 | - | var xViewStackAddTitledWithIcon func(uintptr, uintptr, string, string, string) uintptr | |
| 193 | + | var xViewStackAddTitledWithIcon func(uintptr, uintptr, uintptr, string, string) uintptr | |
| 194 | 194 | ||
| 195 | 195 | // Adds a child to @self. | |
| 196 | 196 | // | |
| 197 | 197 | // The child is identified by the @name. The @title and @icon_name will be used | |
| 198 | 198 | // by [class@ViewSwitcher] to represent @child. | |
| 199 | - | func (x *ViewStack) AddTitledWithIcon(ChildVar *gtk.Widget, NameVar string, TitleVar string, IconNameVar string) *ViewStackPage { | |
| 199 | + | func (x *ViewStack) AddTitledWithIcon(ChildVar *gtk.Widget, NameVar *string, TitleVar string, IconNameVar string) *ViewStackPage { | |
| 200 | 200 | var cls *ViewStackPage | |
| 201 | 201 | ||
| 202 | - | cret := xViewStackAddTitledWithIcon(x.GoPointer(), ChildVar.GoPointer(), NameVar, TitleVar, IconNameVar) | |
| 202 | + | cret := xViewStackAddTitledWithIcon(x.GoPointer(), ChildVar.GoPointer(), core.NullableStringToPtr(NameVar), TitleVar, IconNameVar) | |
| 203 | 203 | ||
| 204 | 204 | if cret == 0 { | |
| 205 | 205 | return nil | |
| @@ -556,7 +556,7 @@ func (x *ViewStack) GetPropertyVhomogeneous() bool { | |||
| 556 | 556 | func (x *ViewStack) SetPropertyVisibleChildName(value string) { | |
| 557 | 557 | var v gobject.Value | |
| 558 | 558 | v.Init(gobject.TypeStringVal) | |
| 559 | - | v.SetString(value) | |
| 559 | + | v.SetString(&value) | |
| 560 | 560 | x.SetProperty("visible-child-name", &v) | |
| 561 | 561 | } | |
| 562 | 562 | ||
| @@ -962,21 +962,21 @@ func (x *ViewStackPage) SetBadgeNumber(BadgeNumberVar uint) { | |||
| 962 | 962 | ||
| 963 | 963 | } | |
| 964 | 964 | ||
| 965 | - | var xViewStackPageSetIconName func(uintptr, string) | |
| 965 | + | var xViewStackPageSetIconName func(uintptr, uintptr) | |
| 966 | 966 | ||
| 967 | 967 | // Sets the icon name of the page. | |
| 968 | - | func (x *ViewStackPage) SetIconName(IconNameVar string) { | |
| 968 | + | func (x *ViewStackPage) SetIconName(IconNameVar *string) { | |
| 969 | 969 | ||
| 970 | - | xViewStackPageSetIconName(x.GoPointer(), IconNameVar) | |
| 970 | + | xViewStackPageSetIconName(x.GoPointer(), core.NullableStringToPtr(IconNameVar)) | |
| 971 | 971 | ||
| 972 | 972 | } | |
| 973 | 973 | ||
| 974 | - | var xViewStackPageSetName func(uintptr, string) | |
| 974 | + | var xViewStackPageSetName func(uintptr, uintptr) | |
| 975 | 975 | ||
| 976 | 976 | // Sets the name of the page. | |
| 977 | - | func (x *ViewStackPage) SetName(NameVar string) { | |
| 977 | + | func (x *ViewStackPage) SetName(NameVar *string) { | |
| 978 | 978 | ||
| 979 | - | xViewStackPageSetName(x.GoPointer(), NameVar) | |
| 979 | + | xViewStackPageSetName(x.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 980 | 980 | ||
| 981 | 981 | } | |
| 982 | 982 | ||
| @@ -991,12 +991,12 @@ func (x *ViewStackPage) SetNeedsAttention(NeedsAttentionVar bool) { | |||
| 991 | 991 | ||
| 992 | 992 | } | |
| 993 | 993 | ||
| 994 | - | var xViewStackPageSetTitle func(uintptr, string) | |
| 994 | + | var xViewStackPageSetTitle func(uintptr, uintptr) | |
| 995 | 995 | ||
| 996 | 996 | // Sets the page title. | |
| 997 | - | func (x *ViewStackPage) SetTitle(TitleVar string) { | |
| 997 | + | func (x *ViewStackPage) SetTitle(TitleVar *string) { | |
| 998 | 998 | ||
| 999 | - | xViewStackPageSetTitle(x.GoPointer(), TitleVar) | |
| 999 | + | xViewStackPageSetTitle(x.GoPointer(), core.NullableStringToPtr(TitleVar)) | |
| 1000 | 1000 | ||
| 1001 | 1001 | } | |
| 1002 | 1002 | ||
| @@ -1064,7 +1064,7 @@ func (x *ViewStackPage) GetPropertyBadgeNumber() uint { | |||
| 1064 | 1064 | func (x *ViewStackPage) SetPropertyIconName(value string) { | |
| 1065 | 1065 | var v gobject.Value | |
| 1066 | 1066 | v.Init(gobject.TypeStringVal) | |
| 1067 | - | v.SetString(value) | |
| 1067 | + | v.SetString(&value) | |
| 1068 | 1068 | x.SetProperty("icon-name", &v) | |
| 1069 | 1069 | } | |
| 1070 | 1070 | ||
| @@ -1081,7 +1081,7 @@ func (x *ViewStackPage) GetPropertyIconName() string { | |||
| 1081 | 1081 | func (x *ViewStackPage) SetPropertyName(value string) { | |
| 1082 | 1082 | var v gobject.Value | |
| 1083 | 1083 | v.Init(gobject.TypeStringVal) | |
| 1084 | - | v.SetString(value) | |
| 1084 | + | v.SetString(&value) | |
| 1085 | 1085 | x.SetProperty("name", &v) | |
| 1086 | 1086 | } | |
| 1087 | 1087 | ||
| @@ -1119,7 +1119,7 @@ func (x *ViewStackPage) GetPropertyNeedsAttention() bool { | |||
| 1119 | 1119 | func (x *ViewStackPage) SetPropertyTitle(value string) { | |
| 1120 | 1120 | var v gobject.Value | |
| 1121 | 1121 | v.Init(gobject.TypeStringVal) | |
| 1122 | - | v.SetString(value) | |
| 1122 | + | v.SetString(&value) | |
| 1123 | 1123 | x.SetProperty("title", &v) | |
| 1124 | 1124 | } | |
| 1125 | 1125 | ||
M v4/adw/adw-view-switcher-title.go +2 -2
| @@ -240,7 +240,7 @@ func (c *ViewSwitcherTitle) SetGoPointer(ptr uintptr) { | |||
| 240 | 240 | func (x *ViewSwitcherTitle) SetPropertySubtitle(value string) { | |
| 241 | 241 | var v gobject.Value | |
| 242 | 242 | v.Init(gobject.TypeStringVal) | |
| 243 | - | v.SetString(value) | |
| 243 | + | v.SetString(&value) | |
| 244 | 244 | x.SetProperty("subtitle", &v) | |
| 245 | 245 | } | |
| 246 | 246 | ||
| @@ -262,7 +262,7 @@ func (x *ViewSwitcherTitle) GetPropertySubtitle() string { | |||
| 262 | 262 | func (x *ViewSwitcherTitle) SetPropertyTitle(value string) { | |
| 263 | 263 | var v gobject.Value | |
| 264 | 264 | v.Init(gobject.TypeStringVal) | |
| 265 | - | v.SetString(value) | |
| 265 | + | v.SetString(&value) | |
| 266 | 266 | x.SetProperty("title", &v) | |
| 267 | 267 | } | |
| 268 | 268 | ||
M v4/adw/adw-window-title.go +2 -2
| @@ -129,7 +129,7 @@ func (c *WindowTitle) SetGoPointer(ptr uintptr) { | |||
| 129 | 129 | func (x *WindowTitle) SetPropertySubtitle(value string) { | |
| 130 | 130 | var v gobject.Value | |
| 131 | 131 | v.Init(gobject.TypeStringVal) | |
| 132 | - | v.SetString(value) | |
| 132 | + | v.SetString(&value) | |
| 133 | 133 | x.SetProperty("subtitle", &v) | |
| 134 | 134 | } | |
| 135 | 135 | ||
| @@ -151,7 +151,7 @@ func (x *WindowTitle) GetPropertySubtitle() string { | |||
| 151 | 151 | func (x *WindowTitle) SetPropertyTitle(value string) { | |
| 152 | 152 | var v gobject.Value | |
| 153 | 153 | v.Init(gobject.TypeStringVal) | |
| 154 | - | v.SetString(value) | |
| 154 | + | v.SetString(&value) | |
| 155 | 155 | x.SetProperty("title", &v) | |
| 156 | 156 | } | |
| 157 | 157 | ||
M v4/gdk/gdkapplaunchcontext.go +3 -3
| @@ -98,7 +98,7 @@ func (x *AppLaunchContext) SetIcon(IconVar gio.Icon) { | |||
| 98 | 98 | ||
| 99 | 99 | } | |
| 100 | 100 | ||
| 101 | - | var xAppLaunchContextSetIconName func(uintptr, string) | |
| 101 | + | var xAppLaunchContextSetIconName func(uintptr, uintptr) | |
| 102 | 102 | ||
| 103 | 103 | // Sets the icon for applications that are launched with this context. | |
| 104 | 104 | // | |
| @@ -109,9 +109,9 @@ var xAppLaunchContextSetIconName func(uintptr, string) | |||
| 109 | 109 | // If neither @icon or @icon_name is set, the icon is taken from either | |
| 110 | 110 | // the file that is passed to launched application or from the `GAppInfo` | |
| 111 | 111 | // for the launched application itself. | |
| 112 | - | func (x *AppLaunchContext) SetIconName(IconNameVar string) { | |
| 112 | + | func (x *AppLaunchContext) SetIconName(IconNameVar *string) { | |
| 113 | 113 | ||
| 114 | - | xAppLaunchContextSetIconName(x.GoPointer(), IconNameVar) | |
| 114 | + | xAppLaunchContextSetIconName(x.GoPointer(), core.NullableStringToPtr(IconNameVar)) | |
| 115 | 115 | ||
| 116 | 116 | } | |
| 117 | 117 | ||
M v4/gdk/gdkclipboard.go +80 -5
| @@ -114,7 +114,22 @@ var xClipboardReadAsync func(uintptr, []string, int, uintptr, uintptr, uintptr) | |||
| 114 | 114 | // to fulfill the request, preferring the ones listed first. | |
| 115 | 115 | func (x *Clipboard) ReadAsync(MimeTypesVar []string, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 116 | 116 | ||
| 117 | - | xClipboardReadAsync(x.GoPointer(), MimeTypesVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 117 | + | var CallbackVarRef uintptr | |
| 118 | + | if CallbackVar != nil { | |
| 119 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 120 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 121 | + | CallbackVarRef = cbRefPtr | |
| 122 | + | } else { | |
| 123 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 124 | + | cbFn := *CallbackVar | |
| 125 | + | cbFn(arg0, arg1, arg2) | |
| 126 | + | } | |
| 127 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 128 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 129 | + | } | |
| 130 | + | } | |
| 131 | + | ||
| 132 | + | xClipboardReadAsync(x.GoPointer(), MimeTypesVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 118 | 133 | ||
| 119 | 134 | } | |
| 120 | 135 | ||
| @@ -150,7 +165,22 @@ var xClipboardReadTextAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 150 | 165 | // need more control over the operation. | |
| 151 | 166 | func (x *Clipboard) ReadTextAsync(CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 152 | 167 | ||
| 153 | - | xClipboardReadTextAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 168 | + | var CallbackVarRef uintptr | |
| 169 | + | if CallbackVar != nil { | |
| 170 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 171 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 172 | + | CallbackVarRef = cbRefPtr | |
| 173 | + | } else { | |
| 174 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 175 | + | cbFn := *CallbackVar | |
| 176 | + | cbFn(arg0, arg1, arg2) | |
| 177 | + | } | |
| 178 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 179 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 180 | + | } | |
| 181 | + | } | |
| 182 | + | ||
| 183 | + | xClipboardReadTextAsync(x.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 154 | 184 | ||
| 155 | 185 | } | |
| 156 | 186 | ||
| @@ -179,7 +209,22 @@ var xClipboardReadTextureAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 179 | 209 | // need more control over the operation. | |
| 180 | 210 | func (x *Clipboard) ReadTextureAsync(CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 181 | 211 | ||
| 182 | - | xClipboardReadTextureAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 212 | + | var CallbackVarRef uintptr | |
| 213 | + | if CallbackVar != nil { | |
| 214 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 215 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 216 | + | CallbackVarRef = cbRefPtr | |
| 217 | + | } else { | |
| 218 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 219 | + | cbFn := *CallbackVar | |
| 220 | + | cbFn(arg0, arg1, arg2) | |
| 221 | + | } | |
| 222 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 223 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 224 | + | } | |
| 225 | + | } | |
| 226 | + | ||
| 227 | + | xClipboardReadTextureAsync(x.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 183 | 228 | ||
| 184 | 229 | } | |
| 185 | 230 | ||
| @@ -216,7 +261,22 @@ var xClipboardReadValueAsync func(uintptr, types.GType, int, uintptr, uintptr, u | |||
| 216 | 261 | // [func@content_deserialize_async] to convert the clipboard's data. | |
| 217 | 262 | func (x *Clipboard) ReadValueAsync(TypeVar types.GType, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 218 | 263 | ||
| 219 | - | xClipboardReadValueAsync(x.GoPointer(), TypeVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 264 | + | var CallbackVarRef uintptr | |
| 265 | + | if CallbackVar != nil { | |
| 266 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 267 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 268 | + | CallbackVarRef = cbRefPtr | |
| 269 | + | } else { | |
| 270 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 271 | + | cbFn := *CallbackVar | |
| 272 | + | cbFn(arg0, arg1, arg2) | |
| 273 | + | } | |
| 274 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 275 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 276 | + | } | |
| 277 | + | } | |
| 278 | + | ||
| 279 | + | xClipboardReadValueAsync(x.GoPointer(), TypeVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 220 | 280 | ||
| 221 | 281 | } | |
| 222 | 282 | ||
| @@ -327,7 +387,22 @@ var xClipboardStoreAsync func(uintptr, int, uintptr, uintptr, uintptr) | |||
| 327 | 387 | // is shut down, so you likely don't need to call it. | |
| 328 | 388 | func (x *Clipboard) StoreAsync(IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 329 | 389 | ||
| 330 | - | xClipboardStoreAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 390 | + | var CallbackVarRef uintptr | |
| 391 | + | if CallbackVar != nil { | |
| 392 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 393 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 394 | + | CallbackVarRef = cbRefPtr | |
| 395 | + | } else { | |
| 396 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 397 | + | cbFn := *CallbackVar | |
| 398 | + | cbFn(arg0, arg1, arg2) | |
| 399 | + | } | |
| 400 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 401 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 402 | + | } | |
| 403 | + | } | |
| 404 | + | ||
| 405 | + | xClipboardStoreAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 331 | 406 | ||
| 332 | 407 | } | |
| 333 | 408 | ||
M v4/gdk/gdkcontentdeserializer.go +65 -3
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | package gdk | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 5 | 7 | "github.com/jwijenbergh/purego" | |
| 6 | 8 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 9 | "github.com/jwijenbergh/puregotk/v4/gio" | |
| @@ -25,7 +27,22 @@ var xContentDeserializeAsync func(uintptr, string, types.GType, int, uintptr, ui | |||
| 25 | 27 | // indicate a higher priority. | |
| 26 | 28 | func ContentDeserializeAsync(StreamVar *gio.InputStream, MimeTypeVar string, TypeVar types.GType, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 27 | 29 | ||
| 28 | - | xContentDeserializeAsync(StreamVar.GoPointer(), MimeTypeVar, TypeVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 30 | + | var CallbackVarRef uintptr | |
| 31 | + | if CallbackVar != nil { | |
| 32 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 33 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 34 | + | CallbackVarRef = cbRefPtr | |
| 35 | + | } else { | |
| 36 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 37 | + | cbFn := *CallbackVar | |
| 38 | + | cbFn(arg0, arg1, arg2) | |
| 39 | + | } | |
| 40 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 41 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 42 | + | } | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | xContentDeserializeAsync(StreamVar.GoPointer(), MimeTypeVar, TypeVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 29 | 46 | ||
| 30 | 47 | } | |
| 31 | 48 | ||
| @@ -52,7 +69,37 @@ var xContentRegisterDeserializer func(string, types.GType, uintptr, uintptr, uin | |||
| 52 | 69 | // so applications can override the built-in deserializers. | |
| 53 | 70 | func ContentRegisterDeserializer(MimeTypeVar string, TypeVar types.GType, DeserializeVar *ContentDeserializeFunc, DataVar uintptr, NotifyVar *glib.DestroyNotify) { | |
| 54 | 71 | ||
| 55 | - | xContentRegisterDeserializer(MimeTypeVar, TypeVar, glib.NewCallback(DeserializeVar), DataVar, glib.NewCallback(NotifyVar)) | |
| 72 | + | var DeserializeVarRef uintptr | |
| 73 | + | if DeserializeVar != nil { | |
| 74 | + | DeserializeVarPtr := uintptr(unsafe.Pointer(DeserializeVar)) | |
| 75 | + | if cbRefPtr, ok := glib.GetCallback(DeserializeVarPtr); ok { | |
| 76 | + | DeserializeVarRef = cbRefPtr | |
| 77 | + | } else { | |
| 78 | + | fcb := func(arg0 uintptr) { | |
| 79 | + | cbFn := *DeserializeVar | |
| 80 | + | cbFn(arg0) | |
| 81 | + | } | |
| 82 | + | DeserializeVarRef = purego.NewCallback(fcb) | |
| 83 | + | glib.SaveCallback(DeserializeVarPtr, DeserializeVarRef) | |
| 84 | + | } | |
| 85 | + | } | |
| 86 | + | ||
| 87 | + | var NotifyVarRef uintptr | |
| 88 | + | if NotifyVar != nil { | |
| 89 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 90 | + | if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok { | |
| 91 | + | NotifyVarRef = cbRefPtr | |
| 92 | + | } else { | |
| 93 | + | fcb := func(arg0 uintptr) { | |
| 94 | + | cbFn := *NotifyVar | |
| 95 | + | cbFn(arg0) | |
| 96 | + | } | |
| 97 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 98 | + | glib.SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 99 | + | } | |
| 100 | + | } | |
| 101 | + | ||
| 102 | + | xContentRegisterDeserializer(MimeTypeVar, TypeVar, DeserializeVarRef, DataVar, NotifyVarRef) | |
| 56 | 103 | ||
| 57 | 104 | } | |
| 58 | 105 | ||
| @@ -203,7 +250,22 @@ var xContentDeserializerSetTaskData func(uintptr, uintptr, uintptr) | |||
| 203 | 250 | // Associate data with the current deserialization operation. | |
| 204 | 251 | func (x *ContentDeserializer) SetTaskData(DataVar uintptr, NotifyVar *glib.DestroyNotify) { | |
| 205 | 252 | ||
| 206 | - | xContentDeserializerSetTaskData(x.GoPointer(), DataVar, glib.NewCallback(NotifyVar)) | |
| 253 | + | var NotifyVarRef uintptr | |
| 254 | + | if NotifyVar != nil { | |
| 255 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 256 | + | if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok { | |
| 257 | + | NotifyVarRef = cbRefPtr | |
| 258 | + | } else { | |
| 259 | + | fcb := func(arg0 uintptr) { | |
| 260 | + | cbFn := *NotifyVar | |
| 261 | + | cbFn(arg0) | |
| 262 | + | } | |
| 263 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 264 | + | glib.SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 265 | + | } | |
| 266 | + | } | |
| 267 | + | ||
| 268 | + | xContentDeserializerSetTaskData(x.GoPointer(), DataVar, NotifyVarRef) | |
| 207 | 269 | ||
| 208 | 270 | } | |
| 209 | 271 | ||
M v4/gdk/gdkcontentprovider.go +16 -1
| @@ -402,7 +402,22 @@ var xContentProviderWriteMimeTypeAsync func(uintptr, string, uintptr, int, uintp | |||
| 402 | 402 | // The given @stream will not be closed. | |
| 403 | 403 | func (x *ContentProvider) WriteMimeTypeAsync(MimeTypeVar string, StreamVar *gio.OutputStream, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 404 | 404 | ||
| 405 | - | xContentProviderWriteMimeTypeAsync(x.GoPointer(), MimeTypeVar, StreamVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 405 | + | var CallbackVarRef uintptr | |
| 406 | + | if CallbackVar != nil { | |
| 407 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 408 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 409 | + | CallbackVarRef = cbRefPtr | |
| 410 | + | } else { | |
| 411 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 412 | + | cbFn := *CallbackVar | |
| 413 | + | cbFn(arg0, arg1, arg2) | |
| 414 | + | } | |
| 415 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 416 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 417 | + | } | |
| 418 | + | } | |
| 419 | + | ||
| 420 | + | xContentProviderWriteMimeTypeAsync(x.GoPointer(), MimeTypeVar, StreamVar.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 406 | 421 | ||
| 407 | 422 | } | |
| 408 | 423 | ||
M v4/gdk/gdkcontentserializer.go +65 -3
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | package gdk | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 5 | 7 | "github.com/jwijenbergh/purego" | |
| 6 | 8 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 9 | "github.com/jwijenbergh/puregotk/v4/gio" | |
| @@ -26,7 +28,37 @@ var xContentRegisterSerializer func(types.GType, string, uintptr, uintptr, uintp | |||
| 26 | 28 | // so applications can override the built-in serializers. | |
| 27 | 29 | func ContentRegisterSerializer(TypeVar types.GType, MimeTypeVar string, SerializeVar *ContentSerializeFunc, DataVar uintptr, NotifyVar *glib.DestroyNotify) { | |
| 28 | 30 | ||
| 29 | - | xContentRegisterSerializer(TypeVar, MimeTypeVar, glib.NewCallback(SerializeVar), DataVar, glib.NewCallback(NotifyVar)) | |
| 31 | + | var SerializeVarRef uintptr | |
| 32 | + | if SerializeVar != nil { | |
| 33 | + | SerializeVarPtr := uintptr(unsafe.Pointer(SerializeVar)) | |
| 34 | + | if cbRefPtr, ok := glib.GetCallback(SerializeVarPtr); ok { | |
| 35 | + | SerializeVarRef = cbRefPtr | |
| 36 | + | } else { | |
| 37 | + | fcb := func(arg0 uintptr) { | |
| 38 | + | cbFn := *SerializeVar | |
| 39 | + | cbFn(arg0) | |
| 40 | + | } | |
| 41 | + | SerializeVarRef = purego.NewCallback(fcb) | |
| 42 | + | glib.SaveCallback(SerializeVarPtr, SerializeVarRef) | |
| 43 | + | } | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | var NotifyVarRef uintptr | |
| 47 | + | if NotifyVar != nil { | |
| 48 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 49 | + | if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok { | |
| 50 | + | NotifyVarRef = cbRefPtr | |
| 51 | + | } else { | |
| 52 | + | fcb := func(arg0 uintptr) { | |
| 53 | + | cbFn := *NotifyVar | |
| 54 | + | cbFn(arg0) | |
| 55 | + | } | |
| 56 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 57 | + | glib.SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 58 | + | } | |
| 59 | + | } | |
| 60 | + | ||
| 61 | + | xContentRegisterSerializer(TypeVar, MimeTypeVar, SerializeVarRef, DataVar, NotifyVarRef) | |
| 30 | 62 | ||
| 31 | 63 | } | |
| 32 | 64 | ||
| @@ -38,7 +70,22 @@ var xContentSerializeAsync func(uintptr, string, *gobject.Value, int, uintptr, u | |||
| 38 | 70 | // indicate a higher priority. | |
| 39 | 71 | func ContentSerializeAsync(StreamVar *gio.OutputStream, MimeTypeVar string, ValueVar *gobject.Value, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 40 | 72 | ||
| 41 | - | xContentSerializeAsync(StreamVar.GoPointer(), MimeTypeVar, ValueVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 73 | + | var CallbackVarRef uintptr | |
| 74 | + | if CallbackVar != nil { | |
| 75 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 76 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 77 | + | CallbackVarRef = cbRefPtr | |
| 78 | + | } else { | |
| 79 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 80 | + | cbFn := *CallbackVar | |
| 81 | + | cbFn(arg0, arg1, arg2) | |
| 82 | + | } | |
| 83 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 84 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 85 | + | } | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | xContentSerializeAsync(StreamVar.GoPointer(), MimeTypeVar, ValueVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 42 | 89 | ||
| 43 | 90 | } | |
| 44 | 91 | ||
| @@ -204,7 +251,22 @@ var xContentSerializerSetTaskData func(uintptr, uintptr, uintptr) | |||
| 204 | 251 | // Associate data with the current serialization operation. | |
| 205 | 252 | func (x *ContentSerializer) SetTaskData(DataVar uintptr, NotifyVar *glib.DestroyNotify) { | |
| 206 | 253 | ||
| 207 | - | xContentSerializerSetTaskData(x.GoPointer(), DataVar, glib.NewCallback(NotifyVar)) | |
| 254 | + | var NotifyVarRef uintptr | |
| 255 | + | if NotifyVar != nil { | |
| 256 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 257 | + | if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok { | |
| 258 | + | NotifyVarRef = cbRefPtr | |
| 259 | + | } else { | |
| 260 | + | fcb := func(arg0 uintptr) { | |
| 261 | + | cbFn := *NotifyVar | |
| 262 | + | cbFn(arg0) | |
| 263 | + | } | |
| 264 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 265 | + | glib.SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 266 | + | } | |
| 267 | + | } | |
| 268 | + | ||
| 269 | + | xContentSerializerSetTaskData(x.GoPointer(), DataVar, NotifyVarRef) | |
| 208 | 270 | ||
| 209 | 271 | } | |
| 210 | 272 | ||
M v4/gdk/gdkcursor.go +34 -2
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | package gdk | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 5 | 7 | "github.com/jwijenbergh/purego" | |
| 6 | 8 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 9 | "github.com/jwijenbergh/puregotk/v4/glib" | |
| @@ -82,7 +84,37 @@ var xNewCursorFromCallback func(uintptr, uintptr, uintptr, uintptr) uintptr | |||
| 82 | 84 | func NewCursorFromCallback(CallbackVar *CursorGetTextureCallback, DataVar uintptr, DestroyVar *glib.DestroyNotify, FallbackVar *Cursor) *Cursor { | |
| 83 | 85 | var cls *Cursor | |
| 84 | 86 | ||
| 85 | - | cret := xNewCursorFromCallback(glib.NewCallback(CallbackVar), DataVar, glib.NewCallback(DestroyVar), FallbackVar.GoPointer()) | |
| 87 | + | var CallbackVarRef uintptr | |
| 88 | + | if CallbackVar != nil { | |
| 89 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 90 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 91 | + | CallbackVarRef = cbRefPtr | |
| 92 | + | } else { | |
| 93 | + | fcb := func(arg0 uintptr, arg1 int, arg2 float64, arg3 *int, arg4 *int, arg5 *int, arg6 *int, arg7 uintptr) uintptr { | |
| 94 | + | cbFn := *CallbackVar | |
| 95 | + | return cbFn(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) | |
| 96 | + | } | |
| 97 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 98 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 99 | + | } | |
| 100 | + | } | |
| 101 | + | ||
| 102 | + | var DestroyVarRef uintptr | |
| 103 | + | if DestroyVar != nil { | |
| 104 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 105 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 106 | + | DestroyVarRef = cbRefPtr | |
| 107 | + | } else { | |
| 108 | + | fcb := func(arg0 uintptr) { | |
| 109 | + | cbFn := *DestroyVar | |
| 110 | + | cbFn(arg0) | |
| 111 | + | } | |
| 112 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 113 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 114 | + | } | |
| 115 | + | } | |
| 116 | + | ||
| 117 | + | cret := xNewCursorFromCallback(CallbackVarRef, DataVar, DestroyVarRef, FallbackVar.GoPointer()) | |
| 86 | 118 | ||
| 87 | 119 | if cret == 0 { | |
| 88 | 120 | return nil | |
| @@ -303,7 +335,7 @@ func (x *Cursor) GetPropertyHotspotY() int { | |||
| 303 | 335 | func (x *Cursor) SetPropertyName(value string) { | |
| 304 | 336 | var v gobject.Value | |
| 305 | 337 | v.Init(gobject.TypeStringVal) | |
| 306 | - | v.SetString(value) | |
| 338 | + | v.SetString(&value) | |
| 307 | 339 | x.SetProperty("name", &v) | |
| 308 | 340 | } | |
| 309 | 341 | ||
M v4/gdk/gdkdevice.go +3 -3
| @@ -436,7 +436,7 @@ func (x *Device) GetPropertyNAxes() uint { | |||
| 436 | 436 | func (x *Device) SetPropertyName(value string) { | |
| 437 | 437 | var v gobject.Value | |
| 438 | 438 | v.Init(gobject.TypeStringVal) | |
| 439 | - | v.SetString(value) | |
| 439 | + | v.SetString(&value) | |
| 440 | 440 | x.SetProperty("name", &v) | |
| 441 | 441 | } | |
| 442 | 442 | ||
| @@ -488,7 +488,7 @@ func (x *Device) GetPropertyNumTouches() uint { | |||
| 488 | 488 | func (x *Device) SetPropertyProductId(value string) { | |
| 489 | 489 | var v gobject.Value | |
| 490 | 490 | v.Init(gobject.TypeStringVal) | |
| 491 | - | v.SetString(value) | |
| 491 | + | v.SetString(&value) | |
| 492 | 492 | x.SetProperty("product-id", &v) | |
| 493 | 493 | } | |
| 494 | 494 | ||
| @@ -519,7 +519,7 @@ func (x *Device) GetPropertyScrollLockState() bool { | |||
| 519 | 519 | func (x *Device) SetPropertyVendorId(value string) { | |
| 520 | 520 | var v gobject.Value | |
| 521 | 521 | v.Init(gobject.TypeStringVal) | |
| 522 | - | v.SetString(value) | |
| 522 | + | v.SetString(&value) | |
| 523 | 523 | x.SetProperty("vendor-id", &v) | |
| 524 | 524 | } | |
| 525 | 525 | ||
M v4/gdk/gdkdisplay.go +3 -3
| @@ -670,15 +670,15 @@ func DisplayGetDefault() *Display { | |||
| 670 | 670 | return cls | |
| 671 | 671 | } | |
| 672 | 672 | ||
| 673 | - | var xDisplayOpen func(string) uintptr | |
| 673 | + | var xDisplayOpen func(uintptr) uintptr | |
| 674 | 674 | ||
| 675 | 675 | // Opens a display. | |
| 676 | 676 | // | |
| 677 | 677 | // If opening the display fails, `NULL` is returned. | |
| 678 | - | func DisplayOpen(DisplayNameVar string) *Display { | |
| 678 | + | func DisplayOpen(DisplayNameVar *string) *Display { | |
| 679 | 679 | var cls *Display | |
| 680 | 680 | ||
| 681 | - | cret := xDisplayOpen(DisplayNameVar) | |
| 681 | + | cret := xDisplayOpen(core.NullableStringToPtr(DisplayNameVar)) | |
| 682 | 682 | ||
| 683 | 683 | if cret == 0 { | |
| 684 | 684 | return nil | |
M v4/gdk/gdkdisplaymanager.go +3 -3
| @@ -143,13 +143,13 @@ func (x *DisplayManager) ListDisplays() *glib.SList { | |||
| 143 | 143 | return cret | |
| 144 | 144 | } | |
| 145 | 145 | ||
| 146 | - | var xDisplayManagerOpenDisplay func(uintptr, string) uintptr | |
| 146 | + | var xDisplayManagerOpenDisplay func(uintptr, uintptr) uintptr | |
| 147 | 147 | ||
| 148 | 148 | // Opens a display. | |
| 149 | - | func (x *DisplayManager) OpenDisplay(NameVar string) *Display { | |
| 149 | + | func (x *DisplayManager) OpenDisplay(NameVar *string) *Display { | |
| 150 | 150 | var cls *Display | |
| 151 | 151 | ||
| 152 | - | cret := xDisplayManagerOpenDisplay(x.GoPointer(), NameVar) | |
| 152 | + | cret := xDisplayManagerOpenDisplay(x.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 153 | 153 | ||
| 154 | 154 | if cret == 0 { | |
| 155 | 155 | return nil | |
M v4/gdk/gdkdmabuftexturebuilder.go +16 -1
| @@ -131,7 +131,22 @@ func (x *DmabufTextureBuilder) Build(DestroyVar *glib.DestroyNotify, DataVar uin | |||
| 131 | 131 | var cls *Texture | |
| 132 | 132 | var cerr *glib.Error | |
| 133 | 133 | ||
| 134 | - | cret := xDmabufTextureBuilderBuild(x.GoPointer(), glib.NewCallbackNullable(DestroyVar), DataVar, &cerr) | |
| 134 | + | var DestroyVarRef uintptr | |
| 135 | + | if DestroyVar != nil { | |
| 136 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 137 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 138 | + | DestroyVarRef = cbRefPtr | |
| 139 | + | } else { | |
| 140 | + | fcb := func(arg0 uintptr) { | |
| 141 | + | cbFn := *DestroyVar | |
| 142 | + | cbFn(arg0) | |
| 143 | + | } | |
| 144 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 145 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 146 | + | } | |
| 147 | + | } | |
| 148 | + | ||
| 149 | + | cret := xDmabufTextureBuilderBuild(x.GoPointer(), DestroyVarRef, DataVar, &cerr) | |
| 135 | 150 | ||
| 136 | 151 | if cret == 0 { | |
| 137 | 152 | return nil, cerr | |
M v4/gdk/gdkdrop.go +34 -2
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | package gdk | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 5 | 7 | "github.com/jwijenbergh/purego" | |
| 6 | 8 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 9 | "github.com/jwijenbergh/puregotk/v4/gio" | |
| @@ -161,7 +163,22 @@ var xDropReadAsync func(uintptr, []string, int, uintptr, uintptr, uintptr) | |||
| 161 | 163 | // in a format that complies with one of the mime types. | |
| 162 | 164 | func (x *Drop) ReadAsync(MimeTypesVar []string, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 163 | 165 | ||
| 164 | - | xDropReadAsync(x.GoPointer(), MimeTypesVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 166 | + | var CallbackVarRef uintptr | |
| 167 | + | if CallbackVar != nil { | |
| 168 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 169 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 170 | + | CallbackVarRef = cbRefPtr | |
| 171 | + | } else { | |
| 172 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 173 | + | cbFn := *CallbackVar | |
| 174 | + | cbFn(arg0, arg1, arg2) | |
| 175 | + | } | |
| 176 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 177 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 178 | + | } | |
| 179 | + | } | |
| 180 | + | ||
| 181 | + | xDropReadAsync(x.GoPointer(), MimeTypesVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 165 | 182 | ||
| 166 | 183 | } | |
| 167 | 184 | ||
| @@ -203,7 +220,22 @@ var xDropReadValueAsync func(uintptr, types.GType, int, uintptr, uintptr, uintpt | |||
| 203 | 220 | // try to use [func@Gdk.content_deserialize_async] to convert the data. | |
| 204 | 221 | func (x *Drop) ReadValueAsync(TypeVar types.GType, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 205 | 222 | ||
| 206 | - | xDropReadValueAsync(x.GoPointer(), TypeVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 223 | + | var CallbackVarRef uintptr | |
| 224 | + | if CallbackVar != nil { | |
| 225 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 226 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 227 | + | CallbackVarRef = cbRefPtr | |
| 228 | + | } else { | |
| 229 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 230 | + | cbFn := *CallbackVar | |
| 231 | + | cbFn(arg0, arg1, arg2) | |
| 232 | + | } | |
| 233 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 234 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 235 | + | } | |
| 236 | + | } | |
| 237 | + | ||
| 238 | + | xDropReadValueAsync(x.GoPointer(), TypeVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 207 | 239 | ||
| 208 | 240 | } | |
| 209 | 241 | ||
M v4/gdk/gdkgltexture.go +16 -1
| @@ -47,7 +47,22 @@ var xNewGLTexture func(uintptr, uint, int, int, uintptr, uintptr) uintptr | |||
| 47 | 47 | func NewGLTexture(ContextVar *GLContext, IdVar uint, WidthVar int, HeightVar int, DestroyVar *glib.DestroyNotify, DataVar uintptr) *GLTexture { | |
| 48 | 48 | var cls *GLTexture | |
| 49 | 49 | ||
| 50 | - | cret := xNewGLTexture(ContextVar.GoPointer(), IdVar, WidthVar, HeightVar, glib.NewCallback(DestroyVar), DataVar) | |
| 50 | + | var DestroyVarRef uintptr | |
| 51 | + | if DestroyVar != nil { | |
| 52 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 53 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 54 | + | DestroyVarRef = cbRefPtr | |
| 55 | + | } else { | |
| 56 | + | fcb := func(arg0 uintptr) { | |
| 57 | + | cbFn := *DestroyVar | |
| 58 | + | cbFn(arg0) | |
| 59 | + | } | |
| 60 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 61 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 62 | + | } | |
| 63 | + | } | |
| 64 | + | ||
| 65 | + | cret := xNewGLTexture(ContextVar.GoPointer(), IdVar, WidthVar, HeightVar, DestroyVarRef, DataVar) | |
| 51 | 66 | ||
| 52 | 67 | if cret == 0 { | |
| 53 | 68 | return nil | |
M v4/gdk/gdkgltexturebuilder.go +16 -1
| @@ -81,7 +81,22 @@ var xGLTextureBuilderBuild func(uintptr, uintptr, uintptr) uintptr | |||
| 81 | 81 | func (x *GLTextureBuilder) Build(DestroyVar *glib.DestroyNotify, DataVar uintptr) *Texture { | |
| 82 | 82 | var cls *Texture | |
| 83 | 83 | ||
| 84 | - | cret := xGLTextureBuilderBuild(x.GoPointer(), glib.NewCallbackNullable(DestroyVar), DataVar) | |
| 84 | + | var DestroyVarRef uintptr | |
| 85 | + | if DestroyVar != nil { | |
| 86 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 87 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 88 | + | DestroyVarRef = cbRefPtr | |
| 89 | + | } else { | |
| 90 | + | fcb := func(arg0 uintptr) { | |
| 91 | + | cbFn := *DestroyVar | |
| 92 | + | cbFn(arg0) | |
| 93 | + | } | |
| 94 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 95 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 96 | + | } | |
| 97 | + | } | |
| 98 | + | ||
| 99 | + | cret := xGLTextureBuilderBuild(x.GoPointer(), DestroyVarRef, DataVar) | |
| 85 | 100 | ||
| 86 | 101 | if cret == 0 { | |
| 87 | 102 | return nil | |
M v4/gdk/gdktoplevel.go +2 -2
| @@ -423,7 +423,7 @@ func (x *ToplevelBase) SetPropertyStartupId(value string) { | |||
| 423 | 423 | obj.Ptr = x.GoPointer() | |
| 424 | 424 | var v gobject.Value | |
| 425 | 425 | v.Init(gobject.TypeStringVal) | |
| 426 | - | v.SetString(value) | |
| 426 | + | v.SetString(&value) | |
| 427 | 427 | obj.SetProperty("startup-id", &v) | |
| 428 | 428 | } | |
| 429 | 429 | ||
| @@ -447,7 +447,7 @@ func (x *ToplevelBase) SetPropertyTitle(value string) { | |||
| 447 | 447 | obj.Ptr = x.GoPointer() | |
| 448 | 448 | var v gobject.Value | |
| 449 | 449 | v.Init(gobject.TypeStringVal) | |
| 450 | - | v.SetString(value) | |
| 450 | + | v.SetString(&value) | |
| 451 | 451 | obj.SetProperty("title", &v) | |
| 452 | 452 | } | |
| 453 | 453 | ||
M v4/gdkpixbuf/gdk-pixbuf-animation.go +16 -1
| @@ -588,7 +588,22 @@ var xPixbufAnimationNewFromStreamAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 588 | 588 | // result of the operation. | |
| 589 | 589 | func PixbufAnimationNewFromStreamAsync(StreamVar *gio.InputStream, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 590 | 590 | ||
| 591 | - | xPixbufAnimationNewFromStreamAsync(StreamVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 591 | + | var CallbackVarRef uintptr | |
| 592 | + | if CallbackVar != nil { | |
| 593 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 594 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 595 | + | CallbackVarRef = cbRefPtr | |
| 596 | + | } else { | |
| 597 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 598 | + | cbFn := *CallbackVar | |
| 599 | + | cbFn(arg0, arg1, arg2) | |
| 600 | + | } | |
| 601 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 602 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 603 | + | } | |
| 604 | + | } | |
| 605 | + | ||
| 606 | + | xPixbufAnimationNewFromStreamAsync(StreamVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 592 | 607 | ||
| 593 | 608 | } | |
| 594 | 609 | ||
M v4/gdkpixbuf/gdk-pixbuf.go +130 -8
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | package gdkpixbuf | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 5 | 7 | "github.com/jwijenbergh/purego" | |
| 6 | 8 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 9 | "github.com/jwijenbergh/puregotk/v4/gio" | |
| @@ -219,7 +221,22 @@ var xNewPixbufFromData func([]byte, Colorspace, bool, int, int, int, int, uintpt | |||
| 219 | 221 | func NewPixbufFromData(DataVar []byte, ColorspaceVar Colorspace, HasAlphaVar bool, BitsPerSampleVar int, WidthVar int, HeightVar int, RowstrideVar int, DestroyFnVar *PixbufDestroyNotify, DestroyFnDataVar uintptr) *Pixbuf { | |
| 220 | 222 | var cls *Pixbuf | |
| 221 | 223 | ||
| 222 | - | cret := xNewPixbufFromData(DataVar, ColorspaceVar, HasAlphaVar, BitsPerSampleVar, WidthVar, HeightVar, RowstrideVar, glib.NewCallbackNullable(DestroyFnVar), DestroyFnDataVar) | |
| 224 | + | var DestroyFnVarRef uintptr | |
| 225 | + | if DestroyFnVar != nil { | |
| 226 | + | DestroyFnVarPtr := uintptr(unsafe.Pointer(DestroyFnVar)) | |
| 227 | + | if cbRefPtr, ok := glib.GetCallback(DestroyFnVarPtr); ok { | |
| 228 | + | DestroyFnVarRef = cbRefPtr | |
| 229 | + | } else { | |
| 230 | + | fcb := func(arg0 []byte, arg1 uintptr) { | |
| 231 | + | cbFn := *DestroyFnVar | |
| 232 | + | cbFn(arg0, arg1) | |
| 233 | + | } | |
| 234 | + | DestroyFnVarRef = purego.NewCallback(fcb) | |
| 235 | + | glib.SaveCallback(DestroyFnVarPtr, DestroyFnVarRef) | |
| 236 | + | } | |
| 237 | + | } | |
| 238 | + | ||
| 239 | + | cret := xNewPixbufFromData(DataVar, ColorspaceVar, HasAlphaVar, BitsPerSampleVar, WidthVar, HeightVar, RowstrideVar, DestroyFnVarRef, DestroyFnDataVar) | |
| 223 | 240 | ||
| 224 | 241 | if cret == 0 { | |
| 225 | 242 | return nil | |
| @@ -1144,7 +1161,22 @@ var xPixbufSaveToCallback func(uintptr, uintptr, uintptr, string, **glib.Error, | |||
| 1144 | 1161 | // See [method@GdkPixbuf.Pixbuf.save] for more details. | |
| 1145 | 1162 | func (x *Pixbuf) SaveToCallback(SaveFuncVar *PixbufSaveFunc, UserDataVar uintptr, TypeVar string, ErrorVar **glib.Error, varArgs ...interface{}) bool { | |
| 1146 | 1163 | ||
| 1147 | - | cret := xPixbufSaveToCallback(x.GoPointer(), glib.NewCallback(SaveFuncVar), UserDataVar, TypeVar, ErrorVar, varArgs...) | |
| 1164 | + | var SaveFuncVarRef uintptr | |
| 1165 | + | if SaveFuncVar != nil { | |
| 1166 | + | SaveFuncVarPtr := uintptr(unsafe.Pointer(SaveFuncVar)) | |
| 1167 | + | if cbRefPtr, ok := glib.GetCallback(SaveFuncVarPtr); ok { | |
| 1168 | + | SaveFuncVarRef = cbRefPtr | |
| 1169 | + | } else { | |
| 1170 | + | fcb := func(arg0 []byte, arg1 uint, arg2 **glib.Error, arg3 uintptr) bool { | |
| 1171 | + | cbFn := *SaveFuncVar | |
| 1172 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 1173 | + | } | |
| 1174 | + | SaveFuncVarRef = purego.NewCallback(fcb) | |
| 1175 | + | glib.SaveCallback(SaveFuncVarPtr, SaveFuncVarRef) | |
| 1176 | + | } | |
| 1177 | + | } | |
| 1178 | + | ||
| 1179 | + | cret := xPixbufSaveToCallback(x.GoPointer(), SaveFuncVarRef, UserDataVar, TypeVar, ErrorVar, varArgs...) | |
| 1148 | 1180 | return cret | |
| 1149 | 1181 | } | |
| 1150 | 1182 | ||
| @@ -1161,7 +1193,22 @@ var xPixbufSaveToCallbackv func(uintptr, uintptr, uintptr, string, []string, []s | |||
| 1161 | 1193 | func (x *Pixbuf) SaveToCallbackv(SaveFuncVar *PixbufSaveFunc, UserDataVar uintptr, TypeVar string, OptionKeysVar []string, OptionValuesVar []string) (bool, error) { | |
| 1162 | 1194 | var cerr *glib.Error | |
| 1163 | 1195 | ||
| 1164 | - | cret := xPixbufSaveToCallbackv(x.GoPointer(), glib.NewCallback(SaveFuncVar), UserDataVar, TypeVar, OptionKeysVar, OptionValuesVar, &cerr) | |
| 1196 | + | var SaveFuncVarRef uintptr | |
| 1197 | + | if SaveFuncVar != nil { | |
| 1198 | + | SaveFuncVarPtr := uintptr(unsafe.Pointer(SaveFuncVar)) | |
| 1199 | + | if cbRefPtr, ok := glib.GetCallback(SaveFuncVarPtr); ok { | |
| 1200 | + | SaveFuncVarRef = cbRefPtr | |
| 1201 | + | } else { | |
| 1202 | + | fcb := func(arg0 []byte, arg1 uint, arg2 **glib.Error, arg3 uintptr) bool { | |
| 1203 | + | cbFn := *SaveFuncVar | |
| 1204 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 1205 | + | } | |
| 1206 | + | SaveFuncVarRef = purego.NewCallback(fcb) | |
| 1207 | + | glib.SaveCallback(SaveFuncVarPtr, SaveFuncVarRef) | |
| 1208 | + | } | |
| 1209 | + | } | |
| 1210 | + | ||
| 1211 | + | cret := xPixbufSaveToCallbackv(x.GoPointer(), SaveFuncVarRef, UserDataVar, TypeVar, OptionKeysVar, OptionValuesVar, &cerr) | |
| 1165 | 1212 | if cerr == nil { | |
| 1166 | 1213 | return cret, nil | |
| 1167 | 1214 | } | |
| @@ -1201,7 +1248,22 @@ var xPixbufSaveToStreamAsync func(uintptr, uintptr, string, uintptr, uintptr, ui | |||
| 1201 | 1248 | // the operation. | |
| 1202 | 1249 | func (x *Pixbuf) SaveToStreamAsync(StreamVar *gio.OutputStream, TypeVar string, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr, varArgs ...interface{}) { | |
| 1203 | 1250 | ||
| 1204 | - | xPixbufSaveToStreamAsync(x.GoPointer(), StreamVar.GoPointer(), TypeVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar, varArgs...) | |
| 1251 | + | var CallbackVarRef uintptr | |
| 1252 | + | if CallbackVar != nil { | |
| 1253 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1254 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1255 | + | CallbackVarRef = cbRefPtr | |
| 1256 | + | } else { | |
| 1257 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1258 | + | cbFn := *CallbackVar | |
| 1259 | + | cbFn(arg0, arg1, arg2) | |
| 1260 | + | } | |
| 1261 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1262 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1263 | + | } | |
| 1264 | + | } | |
| 1265 | + | ||
| 1266 | + | xPixbufSaveToStreamAsync(x.GoPointer(), StreamVar.GoPointer(), TypeVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar, varArgs...) | |
| 1205 | 1267 | ||
| 1206 | 1268 | } | |
| 1207 | 1269 | ||
| @@ -1237,7 +1299,22 @@ var xPixbufSaveToStreamvAsync func(uintptr, uintptr, string, []string, []string, | |||
| 1237 | 1299 | // the operation. | |
| 1238 | 1300 | func (x *Pixbuf) SaveToStreamvAsync(StreamVar *gio.OutputStream, TypeVar string, OptionKeysVar []string, OptionValuesVar []string, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 1239 | 1301 | ||
| 1240 | - | xPixbufSaveToStreamvAsync(x.GoPointer(), StreamVar.GoPointer(), TypeVar, OptionKeysVar, OptionValuesVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1302 | + | var CallbackVarRef uintptr | |
| 1303 | + | if CallbackVar != nil { | |
| 1304 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1305 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1306 | + | CallbackVarRef = cbRefPtr | |
| 1307 | + | } else { | |
| 1308 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1309 | + | cbFn := *CallbackVar | |
| 1310 | + | cbFn(arg0, arg1, arg2) | |
| 1311 | + | } | |
| 1312 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1313 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1314 | + | } | |
| 1315 | + | } | |
| 1316 | + | ||
| 1317 | + | xPixbufSaveToStreamvAsync(x.GoPointer(), StreamVar.GoPointer(), TypeVar, OptionKeysVar, OptionValuesVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 1241 | 1318 | ||
| 1242 | 1319 | } | |
| 1243 | 1320 | ||
| @@ -1627,7 +1704,22 @@ var xPixbufGetFileInfoAsync func(string, uintptr, uintptr, uintptr) | |||
| 1627 | 1704 | // get the result of the operation. | |
| 1628 | 1705 | func PixbufGetFileInfoAsync(FilenameVar string, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 1629 | 1706 | ||
| 1630 | - | xPixbufGetFileInfoAsync(FilenameVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1707 | + | var CallbackVarRef uintptr | |
| 1708 | + | if CallbackVar != nil { | |
| 1709 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1710 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1711 | + | CallbackVarRef = cbRefPtr | |
| 1712 | + | } else { | |
| 1713 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1714 | + | cbFn := *CallbackVar | |
| 1715 | + | cbFn(arg0, arg1, arg2) | |
| 1716 | + | } | |
| 1717 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1718 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1719 | + | } | |
| 1720 | + | } | |
| 1721 | + | ||
| 1722 | + | xPixbufGetFileInfoAsync(FilenameVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 1631 | 1723 | ||
| 1632 | 1724 | } | |
| 1633 | 1725 | ||
| @@ -1694,7 +1786,22 @@ var xPixbufNewFromStreamAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 1694 | 1786 | // the operation. | |
| 1695 | 1787 | func PixbufNewFromStreamAsync(StreamVar *gio.InputStream, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 1696 | 1788 | ||
| 1697 | - | xPixbufNewFromStreamAsync(StreamVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1789 | + | var CallbackVarRef uintptr | |
| 1790 | + | if CallbackVar != nil { | |
| 1791 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1792 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1793 | + | CallbackVarRef = cbRefPtr | |
| 1794 | + | } else { | |
| 1795 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1796 | + | cbFn := *CallbackVar | |
| 1797 | + | cbFn(arg0, arg1, arg2) | |
| 1798 | + | } | |
| 1799 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1800 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1801 | + | } | |
| 1802 | + | } | |
| 1803 | + | ||
| 1804 | + | xPixbufNewFromStreamAsync(StreamVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 1698 | 1805 | ||
| 1699 | 1806 | } | |
| 1700 | 1807 | ||
| @@ -1709,7 +1816,22 @@ var xPixbufNewFromStreamAtScaleAsync func(uintptr, int, int, bool, uintptr, uint | |||
| 1709 | 1816 | // You can then call gdk_pixbuf_new_from_stream_finish() to get the result of the operation. | |
| 1710 | 1817 | func PixbufNewFromStreamAtScaleAsync(StreamVar *gio.InputStream, WidthVar int, HeightVar int, PreserveAspectRatioVar bool, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 1711 | 1818 | ||
| 1712 | - | xPixbufNewFromStreamAtScaleAsync(StreamVar.GoPointer(), WidthVar, HeightVar, PreserveAspectRatioVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1819 | + | var CallbackVarRef uintptr | |
| 1820 | + | if CallbackVar != nil { | |
| 1821 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1822 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1823 | + | CallbackVarRef = cbRefPtr | |
| 1824 | + | } else { | |
| 1825 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1826 | + | cbFn := *CallbackVar | |
| 1827 | + | cbFn(arg0, arg1, arg2) | |
| 1828 | + | } | |
| 1829 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1830 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1831 | + | } | |
| 1832 | + | } | |
| 1833 | + | ||
| 1834 | + | xPixbufNewFromStreamAtScaleAsync(StreamVar.GoPointer(), WidthVar, HeightVar, PreserveAspectRatioVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 1713 | 1835 | ||
| 1714 | 1836 | } | |
| 1715 | 1837 | ||
M v4/gio/gappinfo.go +51 -6
| @@ -1435,7 +1435,7 @@ var XGAppInfoShouldShow func(uintptr) bool | |||
| 1435 | 1435 | var XGAppInfoSupportsFiles func(uintptr) bool | |
| 1436 | 1436 | var XGAppInfoSupportsUris func(uintptr) bool | |
| 1437 | 1437 | ||
| 1438 | - | var xAppInfoCreateFromCommandline func(string, string, AppInfoCreateFlags, **glib.Error) uintptr | |
| 1438 | + | var xAppInfoCreateFromCommandline func(string, uintptr, AppInfoCreateFlags, **glib.Error) uintptr | |
| 1439 | 1439 | ||
| 1440 | 1440 | // Creates a new [iface@Gio.AppInfo] from the given information. | |
| 1441 | 1441 | // | |
| @@ -1446,11 +1446,11 @@ var xAppInfoCreateFromCommandline func(string, string, AppInfoCreateFlags, **gli | |||
| 1446 | 1446 | // being swallowed by `Exec` key unquoting. See | |
| 1447 | 1447 | // [the specification](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html) | |
| 1448 | 1448 | // for exact quoting rules. | |
| 1449 | - | func AppInfoCreateFromCommandline(CommandlineVar string, ApplicationNameVar string, FlagsVar AppInfoCreateFlags) (*AppInfoBase, error) { | |
| 1449 | + | func AppInfoCreateFromCommandline(CommandlineVar string, ApplicationNameVar *string, FlagsVar AppInfoCreateFlags) (*AppInfoBase, error) { | |
| 1450 | 1450 | var cls *AppInfoBase | |
| 1451 | 1451 | var cerr *glib.Error | |
| 1452 | 1452 | ||
| 1453 | - | cret := xAppInfoCreateFromCommandline(CommandlineVar, ApplicationNameVar, FlagsVar, &cerr) | |
| 1453 | + | cret := xAppInfoCreateFromCommandline(CommandlineVar, core.NullableStringToPtr(ApplicationNameVar), FlagsVar, &cerr) | |
| 1454 | 1454 | ||
| 1455 | 1455 | if cret == 0 { | |
| 1456 | 1456 | return nil, cerr | |
| @@ -1519,7 +1519,22 @@ var xAppInfoGetDefaultForTypeAsync func(string, bool, uintptr, uintptr, uintptr) | |||
| 1519 | 1519 | // type. | |
| 1520 | 1520 | func AppInfoGetDefaultForTypeAsync(ContentTypeVar string, MustSupportUrisVar bool, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1521 | 1521 | ||
| 1522 | - | xAppInfoGetDefaultForTypeAsync(ContentTypeVar, MustSupportUrisVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1522 | + | var CallbackVarRef uintptr | |
| 1523 | + | if CallbackVar != nil { | |
| 1524 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1525 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1526 | + | CallbackVarRef = cbRefPtr | |
| 1527 | + | } else { | |
| 1528 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1529 | + | cbFn := *CallbackVar | |
| 1530 | + | cbFn(arg0, arg1, arg2) | |
| 1531 | + | } | |
| 1532 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1533 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1534 | + | } | |
| 1535 | + | } | |
| 1536 | + | ||
| 1537 | + | xAppInfoGetDefaultForTypeAsync(ContentTypeVar, MustSupportUrisVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 1523 | 1538 | ||
| 1524 | 1539 | } | |
| 1525 | 1540 | ||
| @@ -1575,7 +1590,22 @@ var xAppInfoGetDefaultForUriSchemeAsync func(string, uintptr, uintptr, uintptr) | |||
| 1575 | 1590 | // `ftp` or `sip`. | |
| 1576 | 1591 | func AppInfoGetDefaultForUriSchemeAsync(UriSchemeVar string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1577 | 1592 | ||
| 1578 | - | xAppInfoGetDefaultForUriSchemeAsync(UriSchemeVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1593 | + | var CallbackVarRef uintptr | |
| 1594 | + | if CallbackVar != nil { | |
| 1595 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1596 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1597 | + | CallbackVarRef = cbRefPtr | |
| 1598 | + | } else { | |
| 1599 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1600 | + | cbFn := *CallbackVar | |
| 1601 | + | cbFn(arg0, arg1, arg2) | |
| 1602 | + | } | |
| 1603 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1604 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1605 | + | } | |
| 1606 | + | } | |
| 1607 | + | ||
| 1608 | + | xAppInfoGetDefaultForUriSchemeAsync(UriSchemeVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 1579 | 1609 | ||
| 1580 | 1610 | } | |
| 1581 | 1611 | ||
| @@ -1663,7 +1693,22 @@ var xAppInfoLaunchDefaultForUriAsync func(string, uintptr, uintptr, uintptr, uin | |||
| 1663 | 1693 | // in receiving error information from their activation. | |
| 1664 | 1694 | func AppInfoLaunchDefaultForUriAsync(UriVar string, ContextVar *AppLaunchContext, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1665 | 1695 | ||
| 1666 | - | xAppInfoLaunchDefaultForUriAsync(UriVar, ContextVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1696 | + | var CallbackVarRef uintptr | |
| 1697 | + | if CallbackVar != nil { | |
| 1698 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1699 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1700 | + | CallbackVarRef = cbRefPtr | |
| 1701 | + | } else { | |
| 1702 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1703 | + | cbFn := *CallbackVar | |
| 1704 | + | cbFn(arg0, arg1, arg2) | |
| 1705 | + | } | |
| 1706 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1707 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1708 | + | } | |
| 1709 | + | } | |
| 1710 | + | ||
| 1711 | + | xAppInfoLaunchDefaultForUriAsync(UriVar, ContextVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 1667 | 1712 | ||
| 1668 | 1713 | } | |
| 1669 | 1714 | ||
M v4/gio/gapplication.go +27 -27
| @@ -649,7 +649,7 @@ func ApplicationNewFromInternalPtr(ptr uintptr) *Application { | |||
| 649 | 649 | return cls | |
| 650 | 650 | } | |
| 651 | 651 | ||
| 652 | - | var xNewApplication func(string, ApplicationFlags) uintptr | |
| 652 | + | var xNewApplication func(uintptr, ApplicationFlags) uintptr | |
| 653 | 653 | ||
| 654 | 654 | // Creates a new #GApplication instance. | |
| 655 | 655 | // | |
| @@ -658,10 +658,10 @@ var xNewApplication func(string, ApplicationFlags) uintptr | |||
| 658 | 658 | // | |
| 659 | 659 | // If no application ID is given then some features of #GApplication | |
| 660 | 660 | // (most notably application uniqueness) will be disabled. | |
| 661 | - | func NewApplication(ApplicationIdVar string, FlagsVar ApplicationFlags) *Application { | |
| 661 | + | func NewApplication(ApplicationIdVar *string, FlagsVar ApplicationFlags) *Application { | |
| 662 | 662 | var cls *Application | |
| 663 | 663 | ||
| 664 | - | cret := xNewApplication(ApplicationIdVar, FlagsVar) | |
| 664 | + | cret := xNewApplication(core.NullableStringToPtr(ApplicationIdVar), FlagsVar) | |
| 665 | 665 | ||
| 666 | 666 | if cret == 0 { | |
| 667 | 667 | return nil | |
| @@ -685,7 +685,7 @@ func (x *Application) Activate() { | |||
| 685 | 685 | ||
| 686 | 686 | } | |
| 687 | 687 | ||
| 688 | - | var xApplicationAddMainOption func(uintptr, string, byte, glib.OptionFlags, glib.OptionArg, string, string) | |
| 688 | + | var xApplicationAddMainOption func(uintptr, string, byte, glib.OptionFlags, glib.OptionArg, string, uintptr) | |
| 689 | 689 | ||
| 690 | 690 | // Add an option to be handled by @application. | |
| 691 | 691 | // | |
| @@ -700,9 +700,9 @@ var xApplicationAddMainOption func(uintptr, string, byte, glib.OptionFlags, glib | |||
| 700 | 700 | // g_application_add_main_option_entries() for more details. | |
| 701 | 701 | // | |
| 702 | 702 | // See #GOptionEntry for more documentation of the arguments. | |
| 703 | - | func (x *Application) AddMainOption(LongNameVar string, ShortNameVar byte, FlagsVar glib.OptionFlags, ArgVar glib.OptionArg, DescriptionVar string, ArgDescriptionVar string) { | |
| 703 | + | func (x *Application) AddMainOption(LongNameVar string, ShortNameVar byte, FlagsVar glib.OptionFlags, ArgVar glib.OptionArg, DescriptionVar string, ArgDescriptionVar *string) { | |
| 704 | 704 | ||
| 705 | - | xApplicationAddMainOption(x.GoPointer(), LongNameVar, ShortNameVar, FlagsVar, ArgVar, DescriptionVar, ArgDescriptionVar) | |
| 705 | + | xApplicationAddMainOption(x.GoPointer(), LongNameVar, ShortNameVar, FlagsVar, ArgVar, DescriptionVar, core.NullableStringToPtr(ArgDescriptionVar)) | |
| 706 | 706 | ||
| 707 | 707 | } | |
| 708 | 708 | ||
| @@ -1178,7 +1178,7 @@ func (x *Application) Run(ArgcVar int, ArgvVar []string) int { | |||
| 1178 | 1178 | return cret | |
| 1179 | 1179 | } | |
| 1180 | 1180 | ||
| 1181 | - | var xApplicationSendNotification func(uintptr, string, uintptr) | |
| 1181 | + | var xApplicationSendNotification func(uintptr, uintptr, uintptr) | |
| 1182 | 1182 | ||
| 1183 | 1183 | // Sends a notification on behalf of @application to the desktop shell. | |
| 1184 | 1184 | // There is no guarantee that the notification is displayed immediately, | |
| @@ -1209,9 +1209,9 @@ var xApplicationSendNotification func(uintptr, string, uintptr) | |||
| 1209 | 1209 | // | |
| 1210 | 1210 | // It is an error to call this function if @application has no | |
| 1211 | 1211 | // application ID. | |
| 1212 | - | func (x *Application) SendNotification(IdVar string, NotificationVar *Notification) { | |
| 1212 | + | func (x *Application) SendNotification(IdVar *string, NotificationVar *Notification) { | |
| 1213 | 1213 | ||
| 1214 | - | xApplicationSendNotification(x.GoPointer(), IdVar, NotificationVar.GoPointer()) | |
| 1214 | + | xApplicationSendNotification(x.GoPointer(), core.NullableStringToPtr(IdVar), NotificationVar.GoPointer()) | |
| 1215 | 1215 | ||
| 1216 | 1216 | } | |
| 1217 | 1217 | ||
| @@ -1225,7 +1225,7 @@ func (x *Application) SetActionGroup(ActionGroupVar ActionGroup) { | |||
| 1225 | 1225 | ||
| 1226 | 1226 | } | |
| 1227 | 1227 | ||
| 1228 | - | var xApplicationSetApplicationId func(uintptr, string) | |
| 1228 | + | var xApplicationSetApplicationId func(uintptr, uintptr) | |
| 1229 | 1229 | ||
| 1230 | 1230 | // Sets the unique identifier for @application. | |
| 1231 | 1231 | // | |
| @@ -1234,9 +1234,9 @@ var xApplicationSetApplicationId func(uintptr, string) | |||
| 1234 | 1234 | // | |
| 1235 | 1235 | // If non-%NULL, the application id must be valid. See | |
| 1236 | 1236 | // g_application_id_is_valid(). | |
| 1237 | - | func (x *Application) SetApplicationId(ApplicationIdVar string) { | |
| 1237 | + | func (x *Application) SetApplicationId(ApplicationIdVar *string) { | |
| 1238 | 1238 | ||
| 1239 | - | xApplicationSetApplicationId(x.GoPointer(), ApplicationIdVar) | |
| 1239 | + | xApplicationSetApplicationId(x.GoPointer(), core.NullableStringToPtr(ApplicationIdVar)) | |
| 1240 | 1240 | ||
| 1241 | 1241 | } | |
| 1242 | 1242 | ||
| @@ -1284,18 +1284,18 @@ func (x *Application) SetInactivityTimeout(InactivityTimeoutVar uint) { | |||
| 1284 | 1284 | ||
| 1285 | 1285 | } | |
| 1286 | 1286 | ||
| 1287 | - | var xApplicationSetOptionContextDescription func(uintptr, string) | |
| 1287 | + | var xApplicationSetOptionContextDescription func(uintptr, uintptr) | |
| 1288 | 1288 | ||
| 1289 | 1289 | // Adds a description to the @application option context. | |
| 1290 | 1290 | // | |
| 1291 | 1291 | // See g_option_context_set_description() for more information. | |
| 1292 | - | func (x *Application) SetOptionContextDescription(DescriptionVar string) { | |
| 1292 | + | func (x *Application) SetOptionContextDescription(DescriptionVar *string) { | |
| 1293 | 1293 | ||
| 1294 | - | xApplicationSetOptionContextDescription(x.GoPointer(), DescriptionVar) | |
| 1294 | + | xApplicationSetOptionContextDescription(x.GoPointer(), core.NullableStringToPtr(DescriptionVar)) | |
| 1295 | 1295 | ||
| 1296 | 1296 | } | |
| 1297 | 1297 | ||
| 1298 | - | var xApplicationSetOptionContextParameterString func(uintptr, string) | |
| 1298 | + | var xApplicationSetOptionContextParameterString func(uintptr, uintptr) | |
| 1299 | 1299 | ||
| 1300 | 1300 | // Sets the parameter string to be used by the commandline handling of @application. | |
| 1301 | 1301 | // | |
| @@ -1303,24 +1303,24 @@ var xApplicationSetOptionContextParameterString func(uintptr, string) | |||
| 1303 | 1303 | // when the internal #GOptionContext of @application is created. | |
| 1304 | 1304 | // | |
| 1305 | 1305 | // See g_option_context_new() for more information about @parameter_string. | |
| 1306 | - | func (x *Application) SetOptionContextParameterString(ParameterStringVar string) { | |
| 1306 | + | func (x *Application) SetOptionContextParameterString(ParameterStringVar *string) { | |
| 1307 | 1307 | ||
| 1308 | - | xApplicationSetOptionContextParameterString(x.GoPointer(), ParameterStringVar) | |
| 1308 | + | xApplicationSetOptionContextParameterString(x.GoPointer(), core.NullableStringToPtr(ParameterStringVar)) | |
| 1309 | 1309 | ||
| 1310 | 1310 | } | |
| 1311 | 1311 | ||
| 1312 | - | var xApplicationSetOptionContextSummary func(uintptr, string) | |
| 1312 | + | var xApplicationSetOptionContextSummary func(uintptr, uintptr) | |
| 1313 | 1313 | ||
| 1314 | 1314 | // Adds a summary to the @application option context. | |
| 1315 | 1315 | // | |
| 1316 | 1316 | // See g_option_context_set_summary() for more information. | |
| 1317 | - | func (x *Application) SetOptionContextSummary(SummaryVar string) { | |
| 1317 | + | func (x *Application) SetOptionContextSummary(SummaryVar *string) { | |
| 1318 | 1318 | ||
| 1319 | - | xApplicationSetOptionContextSummary(x.GoPointer(), SummaryVar) | |
| 1319 | + | xApplicationSetOptionContextSummary(x.GoPointer(), core.NullableStringToPtr(SummaryVar)) | |
| 1320 | 1320 | ||
| 1321 | 1321 | } | |
| 1322 | 1322 | ||
| 1323 | - | var xApplicationSetResourceBasePath func(uintptr, string) | |
| 1323 | + | var xApplicationSetResourceBasePath func(uintptr, uintptr) | |
| 1324 | 1324 | ||
| 1325 | 1325 | // Sets (or unsets) the base resource path of @application. | |
| 1326 | 1326 | // | |
| @@ -1355,9 +1355,9 @@ var xApplicationSetResourceBasePath func(uintptr, string) | |||
| 1355 | 1355 | // this function during the instance initialization. Alternatively, you | |
| 1356 | 1356 | // can call this function in the #GApplicationClass.startup virtual function, | |
| 1357 | 1357 | // before chaining up to the parent implementation. | |
| 1358 | - | func (x *Application) SetResourceBasePath(ResourcePathVar string) { | |
| 1358 | + | func (x *Application) SetResourceBasePath(ResourcePathVar *string) { | |
| 1359 | 1359 | ||
| 1360 | - | xApplicationSetResourceBasePath(x.GoPointer(), ResourcePathVar) | |
| 1360 | + | xApplicationSetResourceBasePath(x.GoPointer(), core.NullableStringToPtr(ResourcePathVar)) | |
| 1361 | 1361 | ||
| 1362 | 1362 | } | |
| 1363 | 1363 | ||
| @@ -1437,7 +1437,7 @@ func (c *Application) SetGoPointer(ptr uintptr) { | |||
| 1437 | 1437 | func (x *Application) SetPropertyApplicationId(value string) { | |
| 1438 | 1438 | var v gobject.Value | |
| 1439 | 1439 | v.Init(gobject.TypeStringVal) | |
| 1440 | - | v.SetString(value) | |
| 1440 | + | v.SetString(&value) | |
| 1441 | 1441 | x.SetProperty("application-id", &v) | |
| 1442 | 1442 | } | |
| 1443 | 1443 | ||
| @@ -1496,7 +1496,7 @@ func (x *Application) GetPropertyIsRemote() bool { | |||
| 1496 | 1496 | func (x *Application) SetPropertyResourceBasePath(value string) { | |
| 1497 | 1497 | var v gobject.Value | |
| 1498 | 1498 | v.Init(gobject.TypeStringVal) | |
| 1499 | - | v.SetString(value) | |
| 1499 | + | v.SetString(&value) | |
| 1500 | 1500 | x.SetProperty("resource-base-path", &v) | |
| 1501 | 1501 | } | |
| 1502 | 1502 | ||
| @@ -1513,7 +1513,7 @@ func (x *Application) GetPropertyResourceBasePath() string { | |||
| 1513 | 1513 | func (x *Application) SetPropertyVersion(value string) { | |
| 1514 | 1514 | var v gobject.Value | |
| 1515 | 1515 | v.Init(gobject.TypeStringVal) | |
| 1516 | - | v.SetString(value) | |
| 1516 | + | v.SetString(&value) | |
| 1517 | 1517 | x.SetProperty("version", &v) | |
| 1518 | 1518 | } | |
| 1519 | 1519 | ||
M v4/gio/gasyncinitable.go +16 -1
| @@ -306,7 +306,22 @@ var xAsyncInitableNewvAsync func(types.GType, uint, *gobject.Parameter, int, uin | |||
| 306 | 306 | // for any errors. | |
| 307 | 307 | func AsyncInitableNewvAsync(ObjectTypeVar types.GType, NParametersVar uint, ParametersVar *gobject.Parameter, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 308 | 308 | ||
| 309 | - | xAsyncInitableNewvAsync(ObjectTypeVar, NParametersVar, ParametersVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 309 | + | var CallbackVarRef uintptr | |
| 310 | + | if CallbackVar != nil { | |
| 311 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 312 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 313 | + | CallbackVarRef = cbRefPtr | |
| 314 | + | } else { | |
| 315 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 316 | + | cbFn := *CallbackVar | |
| 317 | + | cbFn(arg0, arg1, arg2) | |
| 318 | + | } | |
| 319 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 320 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 321 | + | } | |
| 322 | + | } | |
| 323 | + | ||
| 324 | + | xAsyncInitableNewvAsync(ObjectTypeVar, NParametersVar, ParametersVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 310 | 325 | ||
| 311 | 326 | } | |
| 312 | 327 | ||
M v4/gio/gbufferedinputstream.go +16 -1
| @@ -341,7 +341,22 @@ var xBufferedInputStreamFillAsync func(uintptr, int, int, uintptr, uintptr, uint | |||
| 341 | 341 | // of bytes that are required to fill the buffer. | |
| 342 | 342 | func (x *BufferedInputStream) FillAsync(CountVar int, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 343 | 343 | ||
| 344 | - | xBufferedInputStreamFillAsync(x.GoPointer(), CountVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 344 | + | var CallbackVarRef uintptr | |
| 345 | + | if CallbackVar != nil { | |
| 346 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 347 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 348 | + | CallbackVarRef = cbRefPtr | |
| 349 | + | } else { | |
| 350 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 351 | + | cbFn := *CallbackVar | |
| 352 | + | cbFn(arg0, arg1, arg2) | |
| 353 | + | } | |
| 354 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 355 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 356 | + | } | |
| 357 | + | } | |
| 358 | + | ||
| 359 | + | xBufferedInputStreamFillAsync(x.GoPointer(), CountVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 345 | 360 | ||
| 346 | 361 | } | |
| 347 | 362 | ||
M v4/gio/gcancellable.go +31 -1
| @@ -290,7 +290,37 @@ var xCancellableConnect func(uintptr, uintptr, uintptr, uintptr) uint32 | |||
| 290 | 290 | // - [method@Gio.Cancellable.release_fd] | |
| 291 | 291 | func (x *Cancellable) Connect(CallbackVar *gobject.Callback, DataVar uintptr, DataDestroyFuncVar *glib.DestroyNotify) uint32 { | |
| 292 | 292 | ||
| 293 | - | cret := xCancellableConnect(x.GoPointer(), glib.NewCallback(CallbackVar), DataVar, glib.NewCallbackNullable(DataDestroyFuncVar)) | |
| 293 | + | var CallbackVarRef uintptr | |
| 294 | + | if CallbackVar != nil { | |
| 295 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 296 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 297 | + | CallbackVarRef = cbRefPtr | |
| 298 | + | } else { | |
| 299 | + | fcb := func() { | |
| 300 | + | cbFn := *CallbackVar | |
| 301 | + | cbFn() | |
| 302 | + | } | |
| 303 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 304 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 305 | + | } | |
| 306 | + | } | |
| 307 | + | ||
| 308 | + | var DataDestroyFuncVarRef uintptr | |
| 309 | + | if DataDestroyFuncVar != nil { | |
| 310 | + | DataDestroyFuncVarPtr := uintptr(unsafe.Pointer(DataDestroyFuncVar)) | |
| 311 | + | if cbRefPtr, ok := glib.GetCallback(DataDestroyFuncVarPtr); ok { | |
| 312 | + | DataDestroyFuncVarRef = cbRefPtr | |
| 313 | + | } else { | |
| 314 | + | fcb := func(arg0 uintptr) { | |
| 315 | + | cbFn := *DataDestroyFuncVar | |
| 316 | + | cbFn(arg0) | |
| 317 | + | } | |
| 318 | + | DataDestroyFuncVarRef = purego.NewCallback(fcb) | |
| 319 | + | glib.SaveCallback(DataDestroyFuncVarPtr, DataDestroyFuncVarRef) | |
| 320 | + | } | |
| 321 | + | } | |
| 322 | + | ||
| 323 | + | cret := xCancellableConnect(x.GoPointer(), CallbackVarRef, DataVar, DataDestroyFuncVarRef) | |
| 294 | 324 | return cret | |
| 295 | 325 | } | |
| 296 | 326 | ||
M v4/gio/gcharsetconverter.go +2 -2
| @@ -104,7 +104,7 @@ func (c *CharsetConverter) SetGoPointer(ptr uintptr) { | |||
| 104 | 104 | func (x *CharsetConverter) SetPropertyFromCharset(value string) { | |
| 105 | 105 | var v gobject.Value | |
| 106 | 106 | v.Init(gobject.TypeStringVal) | |
| 107 | - | v.SetString(value) | |
| 107 | + | v.SetString(&value) | |
| 108 | 108 | x.SetProperty("from-charset", &v) | |
| 109 | 109 | } | |
| 110 | 110 | ||
| @@ -121,7 +121,7 @@ func (x *CharsetConverter) GetPropertyFromCharset() string { | |||
| 121 | 121 | func (x *CharsetConverter) SetPropertyToCharset(value string) { | |
| 122 | 122 | var v gobject.Value | |
| 123 | 123 | v.Init(gobject.TypeStringVal) | |
| 124 | - | v.SetString(value) | |
| 124 | + | v.SetString(&value) | |
| 125 | 125 | x.SetProperty("to-charset", &v) | |
| 126 | 126 | } | |
| 127 | 127 | ||
M v4/gio/gcontenttype.go +3 -3
| @@ -108,15 +108,15 @@ func ContentTypeGetSymbolicIcon(TypeVar string) *IconBase { | |||
| 108 | 108 | return cls | |
| 109 | 109 | } | |
| 110 | 110 | ||
| 111 | - | var xContentTypeGuess func(string, []byte, uint, *bool) string | |
| 111 | + | var xContentTypeGuess func(uintptr, []byte, uint, *bool) string | |
| 112 | 112 | ||
| 113 | 113 | // Guesses the content type based on example data. If the function is | |
| 114 | 114 | // uncertain, @result_uncertain will be set to %TRUE. Either @filename | |
| 115 | 115 | // or @data may be %NULL, in which case the guess will be based solely | |
| 116 | 116 | // on the other argument. | |
| 117 | - | func ContentTypeGuess(FilenameVar string, DataVar []byte, DataSizeVar uint, ResultUncertainVar *bool) string { | |
| 117 | + | func ContentTypeGuess(FilenameVar *string, DataVar []byte, DataSizeVar uint, ResultUncertainVar *bool) string { | |
| 118 | 118 | ||
| 119 | - | cret := xContentTypeGuess(FilenameVar, DataVar, DataSizeVar, ResultUncertainVar) | |
| 119 | + | cret := xContentTypeGuess(core.NullableStringToPtr(FilenameVar), DataVar, DataSizeVar, ResultUncertainVar) | |
| 120 | 120 | return cret | |
| 121 | 121 | } | |
| 122 | 122 | ||
M v4/gio/gdatainputstream.go +48 -3
| @@ -309,7 +309,22 @@ var xDataInputStreamReadLineAsync func(uintptr, int, uintptr, uintptr, uintptr) | |||
| 309 | 309 | // the result of the operation. | |
| 310 | 310 | func (x *DataInputStream) ReadLineAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 311 | 311 | ||
| 312 | - | xDataInputStreamReadLineAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 312 | + | var CallbackVarRef uintptr | |
| 313 | + | if CallbackVar != nil { | |
| 314 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 315 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 316 | + | CallbackVarRef = cbRefPtr | |
| 317 | + | } else { | |
| 318 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 319 | + | cbFn := *CallbackVar | |
| 320 | + | cbFn(arg0, arg1, arg2) | |
| 321 | + | } | |
| 322 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 323 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 324 | + | } | |
| 325 | + | } | |
| 326 | + | ||
| 327 | + | xDataInputStreamReadLineAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 313 | 328 | ||
| 314 | 329 | } | |
| 315 | 330 | ||
| @@ -465,7 +480,22 @@ var xDataInputStreamReadUntilAsync func(uintptr, string, int, uintptr, uintptr, | |||
| 465 | 480 | // g_data_input_stream_read_upto_async() instead. | |
| 466 | 481 | func (x *DataInputStream) ReadUntilAsync(StopCharsVar string, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 467 | 482 | ||
| 468 | - | xDataInputStreamReadUntilAsync(x.GoPointer(), StopCharsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 483 | + | var CallbackVarRef uintptr | |
| 484 | + | if CallbackVar != nil { | |
| 485 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 486 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 487 | + | CallbackVarRef = cbRefPtr | |
| 488 | + | } else { | |
| 489 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 490 | + | cbFn := *CallbackVar | |
| 491 | + | cbFn(arg0, arg1, arg2) | |
| 492 | + | } | |
| 493 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 494 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 495 | + | } | |
| 496 | + | } | |
| 497 | + | ||
| 498 | + | xDataInputStreamReadUntilAsync(x.GoPointer(), StopCharsVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 469 | 499 | ||
| 470 | 500 | } | |
| 471 | 501 | ||
| @@ -527,7 +557,22 @@ var xDataInputStreamReadUptoAsync func(uintptr, string, int, int, uintptr, uintp | |||
| 527 | 557 | // the result of the operation. | |
| 528 | 558 | func (x *DataInputStream) ReadUptoAsync(StopCharsVar string, StopCharsLenVar int, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 529 | 559 | ||
| 530 | - | xDataInputStreamReadUptoAsync(x.GoPointer(), StopCharsVar, StopCharsLenVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 560 | + | var CallbackVarRef uintptr | |
| 561 | + | if CallbackVar != nil { | |
| 562 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 563 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 564 | + | CallbackVarRef = cbRefPtr | |
| 565 | + | } else { | |
| 566 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 567 | + | cbFn := *CallbackVar | |
| 568 | + | cbFn(arg0, arg1, arg2) | |
| 569 | + | } | |
| 570 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 571 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 572 | + | } | |
| 573 | + | } | |
| 574 | + | ||
| 575 | + | xDataInputStreamReadUptoAsync(x.GoPointer(), StopCharsVar, StopCharsLenVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 531 | 576 | ||
| 532 | 577 | } | |
| 533 | 578 | ||
M v4/gio/gdbusactiongroup.go +3 -3
| @@ -302,7 +302,7 @@ func (x *DBusActionGroup) ChangeActionStateFull(ActionNameVar string, ValueVar * | |||
| 302 | 302 | ||
| 303 | 303 | } | |
| 304 | 304 | ||
| 305 | - | var xDBusActionGroupGet func(uintptr, string, string) uintptr | |
| 305 | + | var xDBusActionGroupGet func(uintptr, uintptr, string) uintptr | |
| 306 | 306 | ||
| 307 | 307 | // Obtains a #GDBusActionGroup for the action group which is exported at | |
| 308 | 308 | // the given @bus_name and @object_path. | |
| @@ -317,10 +317,10 @@ var xDBusActionGroupGet func(uintptr, string, string) uintptr | |||
| 317 | 317 | // already be filled in. The correct thing to do is connect the signals | |
| 318 | 318 | // for the action group to monitor for changes and then to call | |
| 319 | 319 | // g_action_group_list_actions() to get the initial list. | |
| 320 | - | func DBusActionGroupGet(ConnectionVar *DBusConnection, BusNameVar string, ObjectPathVar string) *DBusActionGroup { | |
| 320 | + | func DBusActionGroupGet(ConnectionVar *DBusConnection, BusNameVar *string, ObjectPathVar string) *DBusActionGroup { | |
| 321 | 321 | var cls *DBusActionGroup | |
| 322 | 322 | ||
| 323 | - | cret := xDBusActionGroupGet(ConnectionVar.GoPointer(), BusNameVar, ObjectPathVar) | |
| 323 | + | cret := xDBusActionGroupGet(ConnectionVar.GoPointer(), core.NullableStringToPtr(BusNameVar), ObjectPathVar) | |
| 324 | 324 | ||
| 325 | 325 | if cret == 0 { | |
| 326 | 326 | return nil | |
M v4/gio/gdbusaddress.go +18 -1
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | package gio | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 5 | 7 | "github.com/jwijenbergh/purego" | |
| 6 | 8 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 9 | "github.com/jwijenbergh/puregotk/v4/glib" | |
| @@ -56,7 +58,22 @@ var xDbusAddressGetStream func(string, uintptr, uintptr, uintptr) | |||
| 56 | 58 | // g_dbus_address_get_stream_sync() for the synchronous version. | |
| 57 | 59 | func DbusAddressGetStream(AddressVar string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 58 | 60 | ||
| 59 | - | xDbusAddressGetStream(AddressVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 61 | + | var CallbackVarRef uintptr | |
| 62 | + | if CallbackVar != nil { | |
| 63 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 64 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 65 | + | CallbackVarRef = cbRefPtr | |
| 66 | + | } else { | |
| 67 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 68 | + | cbFn := *CallbackVar | |
| 69 | + | cbFn(arg0, arg1, arg2) | |
| 70 | + | } | |
| 71 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 72 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 73 | + | } | |
| 74 | + | } | |
| 75 | + | ||
| 76 | + | xDbusAddressGetStream(AddressVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 60 | 77 | ||
| 61 | 78 | } | |
| 62 | 79 | ||
M v4/gio/gdbusconnection.go +244 -34
| @@ -225,7 +225,22 @@ var xBusGet func(BusType, uintptr, uintptr, uintptr) | |||
| 225 | 225 | // the synchronous version. | |
| 226 | 226 | func BusGet(BusTypeVar BusType, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 227 | 227 | ||
| 228 | - | xBusGet(BusTypeVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 228 | + | var CallbackVarRef uintptr | |
| 229 | + | if CallbackVar != nil { | |
| 230 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 231 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 232 | + | CallbackVarRef = cbRefPtr | |
| 233 | + | } else { | |
| 234 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 235 | + | cbFn := *CallbackVar | |
| 236 | + | cbFn(arg0, arg1, arg2) | |
| 237 | + | } | |
| 238 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 239 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 240 | + | } | |
| 241 | + | } | |
| 242 | + | ||
| 243 | + | xBusGet(BusTypeVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 229 | 244 | ||
| 230 | 245 | } | |
| 231 | 246 | ||
| @@ -446,7 +461,7 @@ func NewDBusConnectionForAddressSync(AddressVar string, FlagsVar DBusConnectionF | |||
| 446 | 461 | ||
| 447 | 462 | } | |
| 448 | 463 | ||
| 449 | - | var xNewDBusConnectionSync func(uintptr, string, DBusConnectionFlags, uintptr, uintptr, **glib.Error) uintptr | |
| 464 | + | var xNewDBusConnectionSync func(uintptr, uintptr, DBusConnectionFlags, uintptr, uintptr, **glib.Error) uintptr | |
| 450 | 465 | ||
| 451 | 466 | // Synchronously sets up a D-Bus connection for exchanging D-Bus messages | |
| 452 | 467 | // with the end represented by @stream. | |
| @@ -463,11 +478,11 @@ var xNewDBusConnectionSync func(uintptr, string, DBusConnectionFlags, uintptr, u | |||
| 463 | 478 | // | |
| 464 | 479 | // This is a synchronous failable constructor. See | |
| 465 | 480 | // g_dbus_connection_new() for the asynchronous version. | |
| 466 | - | func NewDBusConnectionSync(StreamVar *IOStream, GuidVar string, FlagsVar DBusConnectionFlags, ObserverVar *DBusAuthObserver, CancellableVar *Cancellable) (*DBusConnection, error) { | |
| 481 | + | func NewDBusConnectionSync(StreamVar *IOStream, GuidVar *string, FlagsVar DBusConnectionFlags, ObserverVar *DBusAuthObserver, CancellableVar *Cancellable) (*DBusConnection, error) { | |
| 467 | 482 | var cls *DBusConnection | |
| 468 | 483 | var cerr *glib.Error | |
| 469 | 484 | ||
| 470 | - | cret := xNewDBusConnectionSync(StreamVar.GoPointer(), GuidVar, FlagsVar, ObserverVar.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 485 | + | cret := xNewDBusConnectionSync(StreamVar.GoPointer(), core.NullableStringToPtr(GuidVar), FlagsVar, ObserverVar.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 471 | 486 | ||
| 472 | 487 | if cret == 0 { | |
| 473 | 488 | return nil, cerr | |
| @@ -512,11 +527,41 @@ var xDBusConnectionAddFilter func(uintptr, uintptr, uintptr, uintptr) uint | |||
| 512 | 527 | // destroyed.) | |
| 513 | 528 | func (x *DBusConnection) AddFilter(FilterFunctionVar *DBusMessageFilterFunction, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) uint { | |
| 514 | 529 | ||
| 515 | - | cret := xDBusConnectionAddFilter(x.GoPointer(), glib.NewCallback(FilterFunctionVar), UserDataVar, glib.NewCallback(UserDataFreeFuncVar)) | |
| 530 | + | var FilterFunctionVarRef uintptr | |
| 531 | + | if FilterFunctionVar != nil { | |
| 532 | + | FilterFunctionVarPtr := uintptr(unsafe.Pointer(FilterFunctionVar)) | |
| 533 | + | if cbRefPtr, ok := glib.GetCallback(FilterFunctionVarPtr); ok { | |
| 534 | + | FilterFunctionVarRef = cbRefPtr | |
| 535 | + | } else { | |
| 536 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 bool, arg3 uintptr) uintptr { | |
| 537 | + | cbFn := *FilterFunctionVar | |
| 538 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 539 | + | } | |
| 540 | + | FilterFunctionVarRef = purego.NewCallback(fcb) | |
| 541 | + | glib.SaveCallback(FilterFunctionVarPtr, FilterFunctionVarRef) | |
| 542 | + | } | |
| 543 | + | } | |
| 544 | + | ||
| 545 | + | var UserDataFreeFuncVarRef uintptr | |
| 546 | + | if UserDataFreeFuncVar != nil { | |
| 547 | + | UserDataFreeFuncVarPtr := uintptr(unsafe.Pointer(UserDataFreeFuncVar)) | |
| 548 | + | if cbRefPtr, ok := glib.GetCallback(UserDataFreeFuncVarPtr); ok { | |
| 549 | + | UserDataFreeFuncVarRef = cbRefPtr | |
| 550 | + | } else { | |
| 551 | + | fcb := func(arg0 uintptr) { | |
| 552 | + | cbFn := *UserDataFreeFuncVar | |
| 553 | + | cbFn(arg0) | |
| 554 | + | } | |
| 555 | + | UserDataFreeFuncVarRef = purego.NewCallback(fcb) | |
| 556 | + | glib.SaveCallback(UserDataFreeFuncVarPtr, UserDataFreeFuncVarRef) | |
| 557 | + | } | |
| 558 | + | } | |
| 559 | + | ||
| 560 | + | cret := xDBusConnectionAddFilter(x.GoPointer(), FilterFunctionVarRef, UserDataVar, UserDataFreeFuncVarRef) | |
| 516 | 561 | return cret | |
| 517 | 562 | } | |
| 518 | 563 | ||
| 519 | - | var xDBusConnectionCall func(uintptr, string, string, string, string, *glib.Variant, *glib.VariantType, DBusCallFlags, int, uintptr, uintptr, uintptr) | |
| 564 | + | var xDBusConnectionCall func(uintptr, uintptr, string, string, string, *glib.Variant, *glib.VariantType, DBusCallFlags, int, uintptr, uintptr, uintptr) | |
| 520 | 565 | ||
| 521 | 566 | // Asynchronously invokes the @method_name method on the | |
| 522 | 567 | // @interface_name D-Bus interface on the remote object at | |
| @@ -565,9 +610,24 @@ var xDBusConnectionCall func(uintptr, string, string, string, string, *glib.Vari | |||
| 565 | 610 | // | |
| 566 | 611 | // If @callback is %NULL then the D-Bus method call message will be sent with | |
| 567 | 612 | // the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set. | |
| 568 | - | func (x *DBusConnection) Call(BusNameVar string, ObjectPathVar string, InterfaceNameVar string, MethodNameVar string, ParametersVar *glib.Variant, ReplyTypeVar *glib.VariantType, FlagsVar DBusCallFlags, TimeoutMsecVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 613 | + | func (x *DBusConnection) Call(BusNameVar *string, ObjectPathVar string, InterfaceNameVar string, MethodNameVar string, ParametersVar *glib.Variant, ReplyTypeVar *glib.VariantType, FlagsVar DBusCallFlags, TimeoutMsecVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 614 | + | ||
| 615 | + | var CallbackVarRef uintptr | |
| 616 | + | if CallbackVar != nil { | |
| 617 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 618 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 619 | + | CallbackVarRef = cbRefPtr | |
| 620 | + | } else { | |
| 621 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 622 | + | cbFn := *CallbackVar | |
| 623 | + | cbFn(arg0, arg1, arg2) | |
| 624 | + | } | |
| 625 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 626 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 627 | + | } | |
| 628 | + | } | |
| 569 | 629 | ||
| 570 | - | xDBusConnectionCall(x.GoPointer(), BusNameVar, ObjectPathVar, InterfaceNameVar, MethodNameVar, ParametersVar, ReplyTypeVar, FlagsVar, TimeoutMsecVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 630 | + | xDBusConnectionCall(x.GoPointer(), core.NullableStringToPtr(BusNameVar), ObjectPathVar, InterfaceNameVar, MethodNameVar, ParametersVar, ReplyTypeVar, FlagsVar, TimeoutMsecVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 571 | 631 | ||
| 572 | 632 | } | |
| 573 | 633 | ||
| @@ -585,7 +645,7 @@ func (x *DBusConnection) CallFinish(ResVar AsyncResult) (*glib.Variant, error) { | |||
| 585 | 645 | ||
| 586 | 646 | } | |
| 587 | 647 | ||
| 588 | - | var xDBusConnectionCallSync func(uintptr, string, string, string, string, *glib.Variant, *glib.VariantType, DBusCallFlags, int, uintptr, **glib.Error) *glib.Variant | |
| 648 | + | var xDBusConnectionCallSync func(uintptr, uintptr, string, string, string, *glib.Variant, *glib.VariantType, DBusCallFlags, int, uintptr, **glib.Error) *glib.Variant | |
| 589 | 649 | ||
| 590 | 650 | // Synchronously invokes the @method_name method on the | |
| 591 | 651 | // @interface_name D-Bus interface on the remote object at | |
| @@ -625,10 +685,10 @@ var xDBusConnectionCallSync func(uintptr, string, string, string, string, *glib. | |||
| 625 | 685 | // The calling thread is blocked until a reply is received. See | |
| 626 | 686 | // g_dbus_connection_call() for the asynchronous version of | |
| 627 | 687 | // this method. | |
| 628 | - | func (x *DBusConnection) CallSync(BusNameVar string, ObjectPathVar string, InterfaceNameVar string, MethodNameVar string, ParametersVar *glib.Variant, ReplyTypeVar *glib.VariantType, FlagsVar DBusCallFlags, TimeoutMsecVar int, CancellableVar *Cancellable) (*glib.Variant, error) { | |
| 688 | + | func (x *DBusConnection) CallSync(BusNameVar *string, ObjectPathVar string, InterfaceNameVar string, MethodNameVar string, ParametersVar *glib.Variant, ReplyTypeVar *glib.VariantType, FlagsVar DBusCallFlags, TimeoutMsecVar int, CancellableVar *Cancellable) (*glib.Variant, error) { | |
| 629 | 689 | var cerr *glib.Error | |
| 630 | 690 | ||
| 631 | - | cret := xDBusConnectionCallSync(x.GoPointer(), BusNameVar, ObjectPathVar, InterfaceNameVar, MethodNameVar, ParametersVar, ReplyTypeVar, FlagsVar, TimeoutMsecVar, CancellableVar.GoPointer(), &cerr) | |
| 691 | + | cret := xDBusConnectionCallSync(x.GoPointer(), core.NullableStringToPtr(BusNameVar), ObjectPathVar, InterfaceNameVar, MethodNameVar, ParametersVar, ReplyTypeVar, FlagsVar, TimeoutMsecVar, CancellableVar.GoPointer(), &cerr) | |
| 632 | 692 | if cerr == nil { | |
| 633 | 693 | return cret, nil | |
| 634 | 694 | } | |
| @@ -636,7 +696,7 @@ func (x *DBusConnection) CallSync(BusNameVar string, ObjectPathVar string, Inter | |||
| 636 | 696 | ||
| 637 | 697 | } | |
| 638 | 698 | ||
| 639 | - | var xDBusConnectionCallWithUnixFdList func(uintptr, string, string, string, string, *glib.Variant, *glib.VariantType, DBusCallFlags, int, uintptr, uintptr, uintptr, uintptr) | |
| 699 | + | var xDBusConnectionCallWithUnixFdList func(uintptr, uintptr, string, string, string, *glib.Variant, *glib.VariantType, DBusCallFlags, int, uintptr, uintptr, uintptr, uintptr) | |
| 640 | 700 | ||
| 641 | 701 | // Like g_dbus_connection_call() but also takes a #GUnixFDList object. | |
| 642 | 702 | // | |
| @@ -653,9 +713,24 @@ var xDBusConnectionCallWithUnixFdList func(uintptr, string, string, string, stri | |||
| 653 | 713 | // value of type %G_VARIANT_TYPE_HANDLE in the body of the message. | |
| 654 | 714 | // | |
| 655 | 715 | // This method is only available on UNIX. | |
| 656 | - | func (x *DBusConnection) CallWithUnixFdList(BusNameVar string, ObjectPathVar string, InterfaceNameVar string, MethodNameVar string, ParametersVar *glib.Variant, ReplyTypeVar *glib.VariantType, FlagsVar DBusCallFlags, TimeoutMsecVar int, FdListVar *UnixFDList, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 716 | + | func (x *DBusConnection) CallWithUnixFdList(BusNameVar *string, ObjectPathVar string, InterfaceNameVar string, MethodNameVar string, ParametersVar *glib.Variant, ReplyTypeVar *glib.VariantType, FlagsVar DBusCallFlags, TimeoutMsecVar int, FdListVar *UnixFDList, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 717 | + | ||
| 718 | + | var CallbackVarRef uintptr | |
| 719 | + | if CallbackVar != nil { | |
| 720 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 721 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 722 | + | CallbackVarRef = cbRefPtr | |
| 723 | + | } else { | |
| 724 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 725 | + | cbFn := *CallbackVar | |
| 726 | + | cbFn(arg0, arg1, arg2) | |
| 727 | + | } | |
| 728 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 729 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 730 | + | } | |
| 731 | + | } | |
| 657 | 732 | ||
| 658 | - | xDBusConnectionCallWithUnixFdList(x.GoPointer(), BusNameVar, ObjectPathVar, InterfaceNameVar, MethodNameVar, ParametersVar, ReplyTypeVar, FlagsVar, TimeoutMsecVar, FdListVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 733 | + | xDBusConnectionCallWithUnixFdList(x.GoPointer(), core.NullableStringToPtr(BusNameVar), ObjectPathVar, InterfaceNameVar, MethodNameVar, ParametersVar, ReplyTypeVar, FlagsVar, TimeoutMsecVar, FdListVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 659 | 734 | ||
| 660 | 735 | } | |
| 661 | 736 | ||
| @@ -684,17 +759,17 @@ func (x *DBusConnection) CallWithUnixFdListFinish(OutFdListVar **UnixFDList, Res | |||
| 684 | 759 | ||
| 685 | 760 | } | |
| 686 | 761 | ||
| 687 | - | var xDBusConnectionCallWithUnixFdListSync func(uintptr, string, string, string, string, *glib.Variant, *glib.VariantType, DBusCallFlags, int, uintptr, **UnixFDList, uintptr, **glib.Error) *glib.Variant | |
| 762 | + | var xDBusConnectionCallWithUnixFdListSync func(uintptr, uintptr, string, string, string, *glib.Variant, *glib.VariantType, DBusCallFlags, int, uintptr, **UnixFDList, uintptr, **glib.Error) *glib.Variant | |
| 688 | 763 | ||
| 689 | 764 | // Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects. | |
| 690 | 765 | // See g_dbus_connection_call_with_unix_fd_list() and | |
| 691 | 766 | // g_dbus_connection_call_with_unix_fd_list_finish() for more details. | |
| 692 | 767 | // | |
| 693 | 768 | // This method is only available on UNIX. | |
| 694 | - | 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) { | |
| 769 | + | 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) { | |
| 695 | 770 | var cerr *glib.Error | |
| 696 | 771 | ||
| 697 | - | cret := xDBusConnectionCallWithUnixFdListSync(x.GoPointer(), BusNameVar, ObjectPathVar, InterfaceNameVar, MethodNameVar, ParametersVar, ReplyTypeVar, FlagsVar, TimeoutMsecVar, FdListVar.GoPointer(), OutFdListVar, CancellableVar.GoPointer(), &cerr) | |
| 772 | + | cret := xDBusConnectionCallWithUnixFdListSync(x.GoPointer(), core.NullableStringToPtr(BusNameVar), ObjectPathVar, InterfaceNameVar, MethodNameVar, ParametersVar, ReplyTypeVar, FlagsVar, TimeoutMsecVar, FdListVar.GoPointer(), OutFdListVar, CancellableVar.GoPointer(), &cerr) | |
| 698 | 773 | if cerr == nil { | |
| 699 | 774 | return cret, nil | |
| 700 | 775 | } | |
| @@ -730,7 +805,22 @@ var xDBusConnectionClose func(uintptr, uintptr, uintptr, uintptr) | |||
| 730 | 805 | // version. | |
| 731 | 806 | func (x *DBusConnection) Close(CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 732 | 807 | ||
| 733 | - | xDBusConnectionClose(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 808 | + | var CallbackVarRef uintptr | |
| 809 | + | if CallbackVar != nil { | |
| 810 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 811 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 812 | + | CallbackVarRef = cbRefPtr | |
| 813 | + | } else { | |
| 814 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 815 | + | cbFn := *CallbackVar | |
| 816 | + | cbFn(arg0, arg1, arg2) | |
| 817 | + | } | |
| 818 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 819 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 820 | + | } | |
| 821 | + | } | |
| 822 | + | ||
| 823 | + | xDBusConnectionClose(x.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 734 | 824 | ||
| 735 | 825 | } | |
| 736 | 826 | ||
| @@ -765,7 +855,7 @@ func (x *DBusConnection) CloseSync(CancellableVar *Cancellable) (bool, error) { | |||
| 765 | 855 | ||
| 766 | 856 | } | |
| 767 | 857 | ||
| 768 | - | var xDBusConnectionEmitSignal func(uintptr, string, string, string, string, *glib.Variant, **glib.Error) bool | |
| 858 | + | var xDBusConnectionEmitSignal func(uintptr, uintptr, string, string, string, *glib.Variant, **glib.Error) bool | |
| 769 | 859 | ||
| 770 | 860 | // Emits a signal. | |
| 771 | 861 | // | |
| @@ -774,10 +864,10 @@ var xDBusConnectionEmitSignal func(uintptr, string, string, string, string, *gli | |||
| 774 | 864 | // This can only fail if @parameters is not compatible with the D-Bus protocol | |
| 775 | 865 | // (%G_IO_ERROR_INVALID_ARGUMENT), or if @connection has been closed | |
| 776 | 866 | // (%G_IO_ERROR_CLOSED). | |
| 777 | - | func (x *DBusConnection) EmitSignal(DestinationBusNameVar string, ObjectPathVar string, InterfaceNameVar string, SignalNameVar string, ParametersVar *glib.Variant) (bool, error) { | |
| 867 | + | func (x *DBusConnection) EmitSignal(DestinationBusNameVar *string, ObjectPathVar string, InterfaceNameVar string, SignalNameVar string, ParametersVar *glib.Variant) (bool, error) { | |
| 778 | 868 | var cerr *glib.Error | |
| 779 | 869 | ||
| 780 | - | cret := xDBusConnectionEmitSignal(x.GoPointer(), DestinationBusNameVar, ObjectPathVar, InterfaceNameVar, SignalNameVar, ParametersVar, &cerr) | |
| 870 | + | cret := xDBusConnectionEmitSignal(x.GoPointer(), core.NullableStringToPtr(DestinationBusNameVar), ObjectPathVar, InterfaceNameVar, SignalNameVar, ParametersVar, &cerr) | |
| 781 | 871 | if cerr == nil { | |
| 782 | 872 | return cret, nil | |
| 783 | 873 | } | |
| @@ -866,7 +956,22 @@ var xDBusConnectionFlush func(uintptr, uintptr, uintptr, uintptr) | |||
| 866 | 956 | // version. | |
| 867 | 957 | func (x *DBusConnection) Flush(CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 868 | 958 | ||
| 869 | - | xDBusConnectionFlush(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 959 | + | var CallbackVarRef uintptr | |
| 960 | + | if CallbackVar != nil { | |
| 961 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 962 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 963 | + | CallbackVarRef = cbRefPtr | |
| 964 | + | } else { | |
| 965 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 966 | + | cbFn := *CallbackVar | |
| 967 | + | cbFn(arg0, arg1, arg2) | |
| 968 | + | } | |
| 969 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 970 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 971 | + | } | |
| 972 | + | } | |
| 973 | + | ||
| 974 | + | xDBusConnectionFlush(x.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 870 | 975 | ||
| 871 | 976 | } | |
| 872 | 977 | ||
| @@ -1063,7 +1168,22 @@ var xDBusConnectionRegisterObject func(uintptr, string, *DBusInterfaceInfo, *DBu | |||
| 1063 | 1168 | func (x *DBusConnection) RegisterObject(ObjectPathVar string, InterfaceInfoVar *DBusInterfaceInfo, VtableVar *DBusInterfaceVTable, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) (uint, error) { | |
| 1064 | 1169 | var cerr *glib.Error | |
| 1065 | 1170 | ||
| 1066 | - | cret := xDBusConnectionRegisterObject(x.GoPointer(), ObjectPathVar, InterfaceInfoVar, VtableVar, UserDataVar, glib.NewCallback(UserDataFreeFuncVar), &cerr) | |
| 1171 | + | var UserDataFreeFuncVarRef uintptr | |
| 1172 | + | if UserDataFreeFuncVar != nil { | |
| 1173 | + | UserDataFreeFuncVarPtr := uintptr(unsafe.Pointer(UserDataFreeFuncVar)) | |
| 1174 | + | if cbRefPtr, ok := glib.GetCallback(UserDataFreeFuncVarPtr); ok { | |
| 1175 | + | UserDataFreeFuncVarRef = cbRefPtr | |
| 1176 | + | } else { | |
| 1177 | + | fcb := func(arg0 uintptr) { | |
| 1178 | + | cbFn := *UserDataFreeFuncVar | |
| 1179 | + | cbFn(arg0) | |
| 1180 | + | } | |
| 1181 | + | UserDataFreeFuncVarRef = purego.NewCallback(fcb) | |
| 1182 | + | glib.SaveCallback(UserDataFreeFuncVarPtr, UserDataFreeFuncVarRef) | |
| 1183 | + | } | |
| 1184 | + | } | |
| 1185 | + | ||
| 1186 | + | cret := xDBusConnectionRegisterObject(x.GoPointer(), ObjectPathVar, InterfaceInfoVar, VtableVar, UserDataVar, UserDataFreeFuncVarRef, &cerr) | |
| 1067 | 1187 | if cerr == nil { | |
| 1068 | 1188 | return cret, nil | |
| 1069 | 1189 | } | |
| @@ -1155,7 +1275,22 @@ var xDBusConnectionRegisterSubtree func(uintptr, string, *DBusSubtreeVTable, DBu | |||
| 1155 | 1275 | func (x *DBusConnection) RegisterSubtree(ObjectPathVar string, VtableVar *DBusSubtreeVTable, FlagsVar DBusSubtreeFlags, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) (uint, error) { | |
| 1156 | 1276 | var cerr *glib.Error | |
| 1157 | 1277 | ||
| 1158 | - | cret := xDBusConnectionRegisterSubtree(x.GoPointer(), ObjectPathVar, VtableVar, FlagsVar, UserDataVar, glib.NewCallback(UserDataFreeFuncVar), &cerr) | |
| 1278 | + | var UserDataFreeFuncVarRef uintptr | |
| 1279 | + | if UserDataFreeFuncVar != nil { | |
| 1280 | + | UserDataFreeFuncVarPtr := uintptr(unsafe.Pointer(UserDataFreeFuncVar)) | |
| 1281 | + | if cbRefPtr, ok := glib.GetCallback(UserDataFreeFuncVarPtr); ok { | |
| 1282 | + | UserDataFreeFuncVarRef = cbRefPtr | |
| 1283 | + | } else { | |
| 1284 | + | fcb := func(arg0 uintptr) { | |
| 1285 | + | cbFn := *UserDataFreeFuncVar | |
| 1286 | + | cbFn(arg0) | |
| 1287 | + | } | |
| 1288 | + | UserDataFreeFuncVarRef = purego.NewCallback(fcb) | |
| 1289 | + | glib.SaveCallback(UserDataFreeFuncVarPtr, UserDataFreeFuncVarRef) | |
| 1290 | + | } | |
| 1291 | + | } | |
| 1292 | + | ||
| 1293 | + | cret := xDBusConnectionRegisterSubtree(x.GoPointer(), ObjectPathVar, VtableVar, FlagsVar, UserDataVar, UserDataFreeFuncVarRef, &cerr) | |
| 1159 | 1294 | if cerr == nil { | |
| 1160 | 1295 | return cret, nil | |
| 1161 | 1296 | } | |
| @@ -1248,7 +1383,22 @@ var xDBusConnectionSendMessageWithReply func(uintptr, uintptr, DBusSendMessageFl | |||
| 1248 | 1383 | // UNIX file descriptors. | |
| 1249 | 1384 | func (x *DBusConnection) SendMessageWithReply(MessageVar *DBusMessage, FlagsVar DBusSendMessageFlags, TimeoutMsecVar int, OutSerialVar *uint32, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1250 | 1385 | ||
| 1251 | - | xDBusConnectionSendMessageWithReply(x.GoPointer(), MessageVar.GoPointer(), FlagsVar, TimeoutMsecVar, OutSerialVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1386 | + | var CallbackVarRef uintptr | |
| 1387 | + | if CallbackVar != nil { | |
| 1388 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1389 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1390 | + | CallbackVarRef = cbRefPtr | |
| 1391 | + | } else { | |
| 1392 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1393 | + | cbFn := *CallbackVar | |
| 1394 | + | cbFn(arg0, arg1, arg2) | |
| 1395 | + | } | |
| 1396 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1397 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1398 | + | } | |
| 1399 | + | } | |
| 1400 | + | ||
| 1401 | + | xDBusConnectionSendMessageWithReply(x.GoPointer(), MessageVar.GoPointer(), FlagsVar, TimeoutMsecVar, OutSerialVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 1252 | 1402 | ||
| 1253 | 1403 | } | |
| 1254 | 1404 | ||
| @@ -1352,7 +1502,7 @@ func (x *DBusConnection) SetExitOnClose(ExitOnCloseVar bool) { | |||
| 1352 | 1502 | ||
| 1353 | 1503 | } | |
| 1354 | 1504 | ||
| 1355 | - | var xDBusConnectionSignalSubscribe func(uintptr, string, string, string, string, string, DBusSignalFlags, uintptr, uintptr, uintptr) uint | |
| 1505 | + | var xDBusConnectionSignalSubscribe func(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, DBusSignalFlags, uintptr, uintptr, uintptr) uint | |
| 1356 | 1506 | ||
| 1357 | 1507 | // Subscribes to signals on @connection and invokes @callback whenever | |
| 1358 | 1508 | // the signal is received. Note that @callback will be invoked in the | |
| @@ -1403,9 +1553,39 @@ var xDBusConnectionSignalSubscribe func(uintptr, string, string, string, string, | |||
| 1403 | 1553 | // to never be zero. | |
| 1404 | 1554 | // | |
| 1405 | 1555 | // This function can never fail. | |
| 1406 | - | func (x *DBusConnection) SignalSubscribe(SenderVar string, InterfaceNameVar string, MemberVar string, ObjectPathVar string, Arg0Var string, FlagsVar DBusSignalFlags, CallbackVar *DBusSignalCallback, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) uint { | |
| 1556 | + | func (x *DBusConnection) SignalSubscribe(SenderVar *string, InterfaceNameVar *string, MemberVar *string, ObjectPathVar *string, Arg0Var *string, FlagsVar DBusSignalFlags, CallbackVar *DBusSignalCallback, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) uint { | |
| 1557 | + | ||
| 1558 | + | var CallbackVarRef uintptr | |
| 1559 | + | if CallbackVar != nil { | |
| 1560 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1561 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1562 | + | CallbackVarRef = cbRefPtr | |
| 1563 | + | } else { | |
| 1564 | + | fcb := func(arg0 uintptr, arg1 string, arg2 string, arg3 string, arg4 string, arg5 *glib.Variant, arg6 uintptr) { | |
| 1565 | + | cbFn := *CallbackVar | |
| 1566 | + | cbFn(arg0, arg1, arg2, arg3, arg4, arg5, arg6) | |
| 1567 | + | } | |
| 1568 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1569 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1570 | + | } | |
| 1571 | + | } | |
| 1407 | 1572 | ||
| 1408 | - | cret := xDBusConnectionSignalSubscribe(x.GoPointer(), SenderVar, InterfaceNameVar, MemberVar, ObjectPathVar, Arg0Var, FlagsVar, glib.NewCallback(CallbackVar), UserDataVar, glib.NewCallbackNullable(UserDataFreeFuncVar)) | |
| 1573 | + | var UserDataFreeFuncVarRef uintptr | |
| 1574 | + | if UserDataFreeFuncVar != nil { | |
| 1575 | + | UserDataFreeFuncVarPtr := uintptr(unsafe.Pointer(UserDataFreeFuncVar)) | |
| 1576 | + | if cbRefPtr, ok := glib.GetCallback(UserDataFreeFuncVarPtr); ok { | |
| 1577 | + | UserDataFreeFuncVarRef = cbRefPtr | |
| 1578 | + | } else { | |
| 1579 | + | fcb := func(arg0 uintptr) { | |
| 1580 | + | cbFn := *UserDataFreeFuncVar | |
| 1581 | + | cbFn(arg0) | |
| 1582 | + | } | |
| 1583 | + | UserDataFreeFuncVarRef = purego.NewCallback(fcb) | |
| 1584 | + | glib.SaveCallback(UserDataFreeFuncVarPtr, UserDataFreeFuncVarRef) | |
| 1585 | + | } | |
| 1586 | + | } | |
| 1587 | + | ||
| 1588 | + | cret := xDBusConnectionSignalSubscribe(x.GoPointer(), core.NullableStringToPtr(SenderVar), core.NullableStringToPtr(InterfaceNameVar), core.NullableStringToPtr(MemberVar), core.NullableStringToPtr(ObjectPathVar), core.NullableStringToPtr(Arg0Var), FlagsVar, CallbackVarRef, UserDataVar, UserDataFreeFuncVarRef) | |
| 1409 | 1589 | return cret | |
| 1410 | 1590 | } | |
| 1411 | 1591 | ||
| @@ -1504,7 +1684,7 @@ func (c *DBusConnection) SetGoPointer(ptr uintptr) { | |||
| 1504 | 1684 | func (x *DBusConnection) SetPropertyAddress(value string) { | |
| 1505 | 1685 | var v gobject.Value | |
| 1506 | 1686 | v.Init(gobject.TypeStringVal) | |
| 1507 | - | v.SetString(value) | |
| 1687 | + | v.SetString(&value) | |
| 1508 | 1688 | x.SetProperty("address", &v) | |
| 1509 | 1689 | } | |
| 1510 | 1690 | ||
| @@ -1569,7 +1749,7 @@ func (x *DBusConnection) GetPropertyExitOnClose() bool { | |||
| 1569 | 1749 | func (x *DBusConnection) SetPropertyGuid(value string) { | |
| 1570 | 1750 | var v gobject.Value | |
| 1571 | 1751 | v.Init(gobject.TypeStringVal) | |
| 1572 | - | v.SetString(value) | |
| 1752 | + | v.SetString(&value) | |
| 1573 | 1753 | x.SetProperty("guid", &v) | |
| 1574 | 1754 | } | |
| 1575 | 1755 | ||
| @@ -1770,7 +1950,7 @@ func (x *DBusConnection) Init(CancellableVar *Cancellable) (bool, error) { | |||
| 1770 | 1950 | ||
| 1771 | 1951 | } | |
| 1772 | 1952 | ||
| 1773 | - | var xDBusConnectionNew func(uintptr, string, DBusConnectionFlags, uintptr, uintptr, uintptr, uintptr) | |
| 1953 | + | var xDBusConnectionNew func(uintptr, uintptr, DBusConnectionFlags, uintptr, uintptr, uintptr, uintptr) | |
| 1774 | 1954 | ||
| 1775 | 1955 | // Asynchronously sets up a D-Bus connection for exchanging D-Bus messages | |
| 1776 | 1956 | // with the end represented by @stream. | |
| @@ -1792,9 +1972,24 @@ var xDBusConnectionNew func(uintptr, string, DBusConnectionFlags, uintptr, uintp | |||
| 1792 | 1972 | // This is an asynchronous failable constructor. See | |
| 1793 | 1973 | // g_dbus_connection_new_sync() for the synchronous | |
| 1794 | 1974 | // version. | |
| 1795 | - | func DBusConnectionNew(StreamVar *IOStream, GuidVar string, FlagsVar DBusConnectionFlags, ObserverVar *DBusAuthObserver, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1975 | + | func DBusConnectionNew(StreamVar *IOStream, GuidVar *string, FlagsVar DBusConnectionFlags, ObserverVar *DBusAuthObserver, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1976 | + | ||
| 1977 | + | var CallbackVarRef uintptr | |
| 1978 | + | if CallbackVar != nil { | |
| 1979 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1980 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1981 | + | CallbackVarRef = cbRefPtr | |
| 1982 | + | } else { | |
| 1983 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1984 | + | cbFn := *CallbackVar | |
| 1985 | + | cbFn(arg0, arg1, arg2) | |
| 1986 | + | } | |
| 1987 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1988 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1989 | + | } | |
| 1990 | + | } | |
| 1796 | 1991 | ||
| 1797 | - | xDBusConnectionNew(StreamVar.GoPointer(), GuidVar, FlagsVar, ObserverVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1992 | + | xDBusConnectionNew(StreamVar.GoPointer(), core.NullableStringToPtr(GuidVar), FlagsVar, ObserverVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 1798 | 1993 | ||
| 1799 | 1994 | } | |
| 1800 | 1995 | ||
| @@ -1824,7 +2019,22 @@ var xDBusConnectionNewForAddress func(string, DBusConnectionFlags, uintptr, uint | |||
| 1824 | 2019 | // version. | |
| 1825 | 2020 | func DBusConnectionNewForAddress(AddressVar string, FlagsVar DBusConnectionFlags, ObserverVar *DBusAuthObserver, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1826 | 2021 | ||
| 1827 | - | xDBusConnectionNewForAddress(AddressVar, FlagsVar, ObserverVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 2022 | + | var CallbackVarRef uintptr | |
| 2023 | + | if CallbackVar != nil { | |
| 2024 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 2025 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 2026 | + | CallbackVarRef = cbRefPtr | |
| 2027 | + | } else { | |
| 2028 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 2029 | + | cbFn := *CallbackVar | |
| 2030 | + | cbFn(arg0, arg1, arg2) | |
| 2031 | + | } | |
| 2032 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 2033 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 2034 | + | } | |
| 2035 | + | } | |
| 2036 | + | ||
| 2037 | + | xDBusConnectionNewForAddress(AddressVar, FlagsVar, ObserverVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 1828 | 2038 | ||
| 1829 | 2039 | } | |
| 1830 | 2040 | ||
M v4/gio/gdbusmenumodel.go +3 -3
| @@ -37,7 +37,7 @@ func (c *DBusMenuModel) SetGoPointer(ptr uintptr) { | |||
| 37 | 37 | c.Ptr = ptr | |
| 38 | 38 | } | |
| 39 | 39 | ||
| 40 | - | var xDBusMenuModelGet func(uintptr, string, string) uintptr | |
| 40 | + | var xDBusMenuModelGet func(uintptr, uintptr, string) uintptr | |
| 41 | 41 | ||
| 42 | 42 | // Obtains a #GDBusMenuModel for the menu model which is exported | |
| 43 | 43 | // at the given @bus_name and @object_path. | |
| @@ -47,10 +47,10 @@ var xDBusMenuModelGet func(uintptr, string, string) uintptr | |||
| 47 | 47 | // with respect to this context. All calls on the returned menu model | |
| 48 | 48 | // (and linked models) must also originate from this same context, with | |
| 49 | 49 | // the thread default main context unchanged. | |
| 50 | - | func DBusMenuModelGet(ConnectionVar *DBusConnection, BusNameVar string, ObjectPathVar string) *DBusMenuModel { | |
| 50 | + | func DBusMenuModelGet(ConnectionVar *DBusConnection, BusNameVar *string, ObjectPathVar string) *DBusMenuModel { | |
| 51 | 51 | var cls *DBusMenuModel | |
| 52 | 52 | ||
| 53 | - | cret := xDBusMenuModelGet(ConnectionVar.GoPointer(), BusNameVar, ObjectPathVar) | |
| 53 | + | cret := xDBusMenuModelGet(ConnectionVar.GoPointer(), core.NullableStringToPtr(BusNameVar), ObjectPathVar) | |
| 54 | 54 | ||
| 55 | 55 | if cret == 0 { | |
| 56 | 56 | return nil | |
M v4/gio/gdbusmessage.go +21 -21
| @@ -69,13 +69,13 @@ func NewDBusMessageFromBlob(BlobVar []byte, BlobLenVar uint, CapabilitiesVar DBu | |||
| 69 | 69 | ||
| 70 | 70 | } | |
| 71 | 71 | ||
| 72 | - | var xNewDBusMessageMethodCall func(string, string, string, string) uintptr | |
| 72 | + | var xNewDBusMessageMethodCall func(uintptr, string, uintptr, string) uintptr | |
| 73 | 73 | ||
| 74 | 74 | // Creates a new #GDBusMessage for a method call. | |
| 75 | - | func NewDBusMessageMethodCall(NameVar string, PathVar string, InterfaceVar string, MethodVar string) *DBusMessage { | |
| 75 | + | func NewDBusMessageMethodCall(NameVar *string, PathVar string, InterfaceVar *string, MethodVar string) *DBusMessage { | |
| 76 | 76 | var cls *DBusMessage | |
| 77 | 77 | ||
| 78 | - | cret := xNewDBusMessageMethodCall(NameVar, PathVar, InterfaceVar, MethodVar) | |
| 78 | + | cret := xNewDBusMessageMethodCall(core.NullableStringToPtr(NameVar), PathVar, core.NullableStringToPtr(InterfaceVar), MethodVar) | |
| 79 | 79 | ||
| 80 | 80 | if cret == 0 { | |
| 81 | 81 | return nil | |
| @@ -478,12 +478,12 @@ func (x *DBusMessage) SetByteOrder(ByteOrderVar DBusMessageByteOrder) { | |||
| 478 | 478 | ||
| 479 | 479 | } | |
| 480 | 480 | ||
| 481 | - | var xDBusMessageSetDestination func(uintptr, string) | |
| 481 | + | var xDBusMessageSetDestination func(uintptr, uintptr) | |
| 482 | 482 | ||
| 483 | 483 | // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field. | |
| 484 | - | func (x *DBusMessage) SetDestination(ValueVar string) { | |
| 484 | + | func (x *DBusMessage) SetDestination(ValueVar *string) { | |
| 485 | 485 | ||
| 486 | - | xDBusMessageSetDestination(x.GoPointer(), ValueVar) | |
| 486 | + | xDBusMessageSetDestination(x.GoPointer(), core.NullableStringToPtr(ValueVar)) | |
| 487 | 487 | ||
| 488 | 488 | } | |
| 489 | 489 | ||
| @@ -516,21 +516,21 @@ func (x *DBusMessage) SetHeader(HeaderFieldVar DBusMessageHeaderField, ValueVar | |||
| 516 | 516 | ||
| 517 | 517 | } | |
| 518 | 518 | ||
| 519 | - | var xDBusMessageSetInterface func(uintptr, string) | |
| 519 | + | var xDBusMessageSetInterface func(uintptr, uintptr) | |
| 520 | 520 | ||
| 521 | 521 | // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field. | |
| 522 | - | func (x *DBusMessage) SetInterface(ValueVar string) { | |
| 522 | + | func (x *DBusMessage) SetInterface(ValueVar *string) { | |
| 523 | 523 | ||
| 524 | - | xDBusMessageSetInterface(x.GoPointer(), ValueVar) | |
| 524 | + | xDBusMessageSetInterface(x.GoPointer(), core.NullableStringToPtr(ValueVar)) | |
| 525 | 525 | ||
| 526 | 526 | } | |
| 527 | 527 | ||
| 528 | - | var xDBusMessageSetMember func(uintptr, string) | |
| 528 | + | var xDBusMessageSetMember func(uintptr, uintptr) | |
| 529 | 529 | ||
| 530 | 530 | // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field. | |
| 531 | - | func (x *DBusMessage) SetMember(ValueVar string) { | |
| 531 | + | func (x *DBusMessage) SetMember(ValueVar *string) { | |
| 532 | 532 | ||
| 533 | - | xDBusMessageSetMember(x.GoPointer(), ValueVar) | |
| 533 | + | xDBusMessageSetMember(x.GoPointer(), core.NullableStringToPtr(ValueVar)) | |
| 534 | 534 | ||
| 535 | 535 | } | |
| 536 | 536 | ||
| @@ -552,12 +552,12 @@ func (x *DBusMessage) SetNumUnixFds(ValueVar uint32) { | |||
| 552 | 552 | ||
| 553 | 553 | } | |
| 554 | 554 | ||
| 555 | - | var xDBusMessageSetPath func(uintptr, string) | |
| 555 | + | var xDBusMessageSetPath func(uintptr, uintptr) | |
| 556 | 556 | ||
| 557 | 557 | // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field. | |
| 558 | - | func (x *DBusMessage) SetPath(ValueVar string) { | |
| 558 | + | func (x *DBusMessage) SetPath(ValueVar *string) { | |
| 559 | 559 | ||
| 560 | - | xDBusMessageSetPath(x.GoPointer(), ValueVar) | |
| 560 | + | xDBusMessageSetPath(x.GoPointer(), core.NullableStringToPtr(ValueVar)) | |
| 561 | 561 | ||
| 562 | 562 | } | |
| 563 | 563 | ||
| @@ -570,12 +570,12 @@ func (x *DBusMessage) SetReplySerial(ValueVar uint32) { | |||
| 570 | 570 | ||
| 571 | 571 | } | |
| 572 | 572 | ||
| 573 | - | var xDBusMessageSetSender func(uintptr, string) | |
| 573 | + | var xDBusMessageSetSender func(uintptr, uintptr) | |
| 574 | 574 | ||
| 575 | 575 | // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field. | |
| 576 | - | func (x *DBusMessage) SetSender(ValueVar string) { | |
| 576 | + | func (x *DBusMessage) SetSender(ValueVar *string) { | |
| 577 | 577 | ||
| 578 | - | xDBusMessageSetSender(x.GoPointer(), ValueVar) | |
| 578 | + | xDBusMessageSetSender(x.GoPointer(), core.NullableStringToPtr(ValueVar)) | |
| 579 | 579 | ||
| 580 | 580 | } | |
| 581 | 581 | ||
| @@ -591,12 +591,12 @@ func (x *DBusMessage) SetSerial(SerialVar uint32) { | |||
| 591 | 591 | ||
| 592 | 592 | } | |
| 593 | 593 | ||
| 594 | - | var xDBusMessageSetSignature func(uintptr, string) | |
| 594 | + | var xDBusMessageSetSignature func(uintptr, uintptr) | |
| 595 | 595 | ||
| 596 | 596 | // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field. | |
| 597 | - | func (x *DBusMessage) SetSignature(ValueVar string) { | |
| 597 | + | func (x *DBusMessage) SetSignature(ValueVar *string) { | |
| 598 | 598 | ||
| 599 | - | xDBusMessageSetSignature(x.GoPointer(), ValueVar) | |
| 599 | + | xDBusMessageSetSignature(x.GoPointer(), core.NullableStringToPtr(ValueVar)) | |
| 600 | 600 | ||
| 601 | 601 | } | |
| 602 | 602 | ||
M v4/gio/gdbusnameowning.go +109 -2
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | package gio | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 5 | 7 | "github.com/jwijenbergh/purego" | |
| 6 | 8 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 9 | "github.com/jwijenbergh/puregotk/v4/glib" | |
| @@ -71,7 +73,67 @@ var xBusOwnName func(BusType, string, BusNameOwnerFlags, uintptr, uintptr, uintp | |||
| 71 | 73 | // unregister the objects (if any) in @name_lost_handler. | |
| 72 | 74 | func BusOwnName(BusTypeVar BusType, NameVar string, FlagsVar BusNameOwnerFlags, BusAcquiredHandlerVar *BusAcquiredCallback, NameAcquiredHandlerVar *BusNameAcquiredCallback, NameLostHandlerVar *BusNameLostCallback, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) uint { | |
| 73 | 75 | ||
| 74 | - | cret := xBusOwnName(BusTypeVar, NameVar, FlagsVar, glib.NewCallbackNullable(BusAcquiredHandlerVar), glib.NewCallbackNullable(NameAcquiredHandlerVar), glib.NewCallbackNullable(NameLostHandlerVar), UserDataVar, glib.NewCallbackNullable(UserDataFreeFuncVar)) | |
| 76 | + | var BusAcquiredHandlerVarRef uintptr | |
| 77 | + | if BusAcquiredHandlerVar != nil { | |
| 78 | + | BusAcquiredHandlerVarPtr := uintptr(unsafe.Pointer(BusAcquiredHandlerVar)) | |
| 79 | + | if cbRefPtr, ok := glib.GetCallback(BusAcquiredHandlerVarPtr); ok { | |
| 80 | + | BusAcquiredHandlerVarRef = cbRefPtr | |
| 81 | + | } else { | |
| 82 | + | fcb := func(arg0 uintptr, arg1 string, arg2 uintptr) { | |
| 83 | + | cbFn := *BusAcquiredHandlerVar | |
| 84 | + | cbFn(arg0, arg1, arg2) | |
| 85 | + | } | |
| 86 | + | BusAcquiredHandlerVarRef = purego.NewCallback(fcb) | |
| 87 | + | glib.SaveCallback(BusAcquiredHandlerVarPtr, BusAcquiredHandlerVarRef) | |
| 88 | + | } | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | var NameAcquiredHandlerVarRef uintptr | |
| 92 | + | if NameAcquiredHandlerVar != nil { | |
| 93 | + | NameAcquiredHandlerVarPtr := uintptr(unsafe.Pointer(NameAcquiredHandlerVar)) | |
| 94 | + | if cbRefPtr, ok := glib.GetCallback(NameAcquiredHandlerVarPtr); ok { | |
| 95 | + | NameAcquiredHandlerVarRef = cbRefPtr | |
| 96 | + | } else { | |
| 97 | + | fcb := func(arg0 uintptr, arg1 string, arg2 uintptr) { | |
| 98 | + | cbFn := *NameAcquiredHandlerVar | |
| 99 | + | cbFn(arg0, arg1, arg2) | |
| 100 | + | } | |
| 101 | + | NameAcquiredHandlerVarRef = purego.NewCallback(fcb) | |
| 102 | + | glib.SaveCallback(NameAcquiredHandlerVarPtr, NameAcquiredHandlerVarRef) | |
| 103 | + | } | |
| 104 | + | } | |
| 105 | + | ||
| 106 | + | var NameLostHandlerVarRef uintptr | |
| 107 | + | if NameLostHandlerVar != nil { | |
| 108 | + | NameLostHandlerVarPtr := uintptr(unsafe.Pointer(NameLostHandlerVar)) | |
| 109 | + | if cbRefPtr, ok := glib.GetCallback(NameLostHandlerVarPtr); ok { | |
| 110 | + | NameLostHandlerVarRef = cbRefPtr | |
| 111 | + | } else { | |
| 112 | + | fcb := func(arg0 uintptr, arg1 string, arg2 uintptr) { | |
| 113 | + | cbFn := *NameLostHandlerVar | |
| 114 | + | cbFn(arg0, arg1, arg2) | |
| 115 | + | } | |
| 116 | + | NameLostHandlerVarRef = purego.NewCallback(fcb) | |
| 117 | + | glib.SaveCallback(NameLostHandlerVarPtr, NameLostHandlerVarRef) | |
| 118 | + | } | |
| 119 | + | } | |
| 120 | + | ||
| 121 | + | var UserDataFreeFuncVarRef uintptr | |
| 122 | + | if UserDataFreeFuncVar != nil { | |
| 123 | + | UserDataFreeFuncVarPtr := uintptr(unsafe.Pointer(UserDataFreeFuncVar)) | |
| 124 | + | if cbRefPtr, ok := glib.GetCallback(UserDataFreeFuncVarPtr); ok { | |
| 125 | + | UserDataFreeFuncVarRef = cbRefPtr | |
| 126 | + | } else { | |
| 127 | + | fcb := func(arg0 uintptr) { | |
| 128 | + | cbFn := *UserDataFreeFuncVar | |
| 129 | + | cbFn(arg0) | |
| 130 | + | } | |
| 131 | + | UserDataFreeFuncVarRef = purego.NewCallback(fcb) | |
| 132 | + | glib.SaveCallback(UserDataFreeFuncVarPtr, UserDataFreeFuncVarRef) | |
| 133 | + | } | |
| 134 | + | } | |
| 135 | + | ||
| 136 | + | cret := xBusOwnName(BusTypeVar, NameVar, FlagsVar, BusAcquiredHandlerVarRef, NameAcquiredHandlerVarRef, NameLostHandlerVarRef, UserDataVar, UserDataFreeFuncVarRef) | |
| 75 | 137 | return cret | |
| 76 | 138 | } | |
| 77 | 139 | ||
| @@ -81,7 +143,52 @@ var xBusOwnNameOnConnection func(uintptr, string, BusNameOwnerFlags, uintptr, ui | |||
| 81 | 143 | // of a [enum@Gio.BusType]. | |
| 82 | 144 | func BusOwnNameOnConnection(ConnectionVar *DBusConnection, NameVar string, FlagsVar BusNameOwnerFlags, NameAcquiredHandlerVar *BusNameAcquiredCallback, NameLostHandlerVar *BusNameLostCallback, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) uint { | |
| 83 | 145 | ||
| 84 | - | cret := xBusOwnNameOnConnection(ConnectionVar.GoPointer(), NameVar, FlagsVar, glib.NewCallbackNullable(NameAcquiredHandlerVar), glib.NewCallbackNullable(NameLostHandlerVar), UserDataVar, glib.NewCallbackNullable(UserDataFreeFuncVar)) | |
| 146 | + | var NameAcquiredHandlerVarRef uintptr | |
| 147 | + | if NameAcquiredHandlerVar != nil { | |
| 148 | + | NameAcquiredHandlerVarPtr := uintptr(unsafe.Pointer(NameAcquiredHandlerVar)) | |
| 149 | + | if cbRefPtr, ok := glib.GetCallback(NameAcquiredHandlerVarPtr); ok { | |
| 150 | + | NameAcquiredHandlerVarRef = cbRefPtr | |
| 151 | + | } else { | |
| 152 | + | fcb := func(arg0 uintptr, arg1 string, arg2 uintptr) { | |
| 153 | + | cbFn := *NameAcquiredHandlerVar | |
| 154 | + | cbFn(arg0, arg1, arg2) | |
| 155 | + | } | |
| 156 | + | NameAcquiredHandlerVarRef = purego.NewCallback(fcb) | |
| 157 | + | glib.SaveCallback(NameAcquiredHandlerVarPtr, NameAcquiredHandlerVarRef) | |
| 158 | + | } | |
| 159 | + | } | |
| 160 | + | ||
| 161 | + | var NameLostHandlerVarRef uintptr | |
| 162 | + | if NameLostHandlerVar != nil { | |
| 163 | + | NameLostHandlerVarPtr := uintptr(unsafe.Pointer(NameLostHandlerVar)) | |
| 164 | + | if cbRefPtr, ok := glib.GetCallback(NameLostHandlerVarPtr); ok { | |
| 165 | + | NameLostHandlerVarRef = cbRefPtr | |
| 166 | + | } else { | |
| 167 | + | fcb := func(arg0 uintptr, arg1 string, arg2 uintptr) { | |
| 168 | + | cbFn := *NameLostHandlerVar | |
| 169 | + | cbFn(arg0, arg1, arg2) | |
| 170 | + | } | |
| 171 | + | NameLostHandlerVarRef = purego.NewCallback(fcb) | |
| 172 | + | glib.SaveCallback(NameLostHandlerVarPtr, NameLostHandlerVarRef) | |
| 173 | + | } | |
| 174 | + | } | |
| 175 | + | ||
| 176 | + | var UserDataFreeFuncVarRef uintptr | |
| 177 | + | if UserDataFreeFuncVar != nil { | |
| 178 | + | UserDataFreeFuncVarPtr := uintptr(unsafe.Pointer(UserDataFreeFuncVar)) | |
| 179 | + | if cbRefPtr, ok := glib.GetCallback(UserDataFreeFuncVarPtr); ok { | |
| 180 | + | UserDataFreeFuncVarRef = cbRefPtr | |
| 181 | + | } else { | |
| 182 | + | fcb := func(arg0 uintptr) { | |
| 183 | + | cbFn := *UserDataFreeFuncVar | |
| 184 | + | cbFn(arg0) | |
| 185 | + | } | |
| 186 | + | UserDataFreeFuncVarRef = purego.NewCallback(fcb) | |
| 187 | + | glib.SaveCallback(UserDataFreeFuncVarPtr, UserDataFreeFuncVarRef) | |
| 188 | + | } | |
| 189 | + | } | |
| 190 | + | ||
| 191 | + | cret := xBusOwnNameOnConnection(ConnectionVar.GoPointer(), NameVar, FlagsVar, NameAcquiredHandlerVarRef, NameLostHandlerVarRef, UserDataVar, UserDataFreeFuncVarRef) | |
| 85 | 192 | return cret | |
| 86 | 193 | } | |
| 87 | 194 | ||
M v4/gio/gdbusnamewatching.go +94 -2
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | package gio | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 5 | 7 | "github.com/jwijenbergh/purego" | |
| 6 | 8 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 9 | "github.com/jwijenbergh/puregotk/v4/glib" | |
| @@ -67,7 +69,52 @@ var xBusWatchName func(BusType, string, BusNameWatcherFlags, uintptr, uintptr, u | |||
| 67 | 69 | // @name_vanished_handler. | |
| 68 | 70 | func BusWatchName(BusTypeVar BusType, NameVar string, FlagsVar BusNameWatcherFlags, NameAppearedHandlerVar *BusNameAppearedCallback, NameVanishedHandlerVar *BusNameVanishedCallback, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) uint { | |
| 69 | 71 | ||
| 70 | - | cret := xBusWatchName(BusTypeVar, NameVar, FlagsVar, glib.NewCallbackNullable(NameAppearedHandlerVar), glib.NewCallbackNullable(NameVanishedHandlerVar), UserDataVar, glib.NewCallbackNullable(UserDataFreeFuncVar)) | |
| 72 | + | var NameAppearedHandlerVarRef uintptr | |
| 73 | + | if NameAppearedHandlerVar != nil { | |
| 74 | + | NameAppearedHandlerVarPtr := uintptr(unsafe.Pointer(NameAppearedHandlerVar)) | |
| 75 | + | if cbRefPtr, ok := glib.GetCallback(NameAppearedHandlerVarPtr); ok { | |
| 76 | + | NameAppearedHandlerVarRef = cbRefPtr | |
| 77 | + | } else { | |
| 78 | + | fcb := func(arg0 uintptr, arg1 string, arg2 string, arg3 uintptr) { | |
| 79 | + | cbFn := *NameAppearedHandlerVar | |
| 80 | + | cbFn(arg0, arg1, arg2, arg3) | |
| 81 | + | } | |
| 82 | + | NameAppearedHandlerVarRef = purego.NewCallback(fcb) | |
| 83 | + | glib.SaveCallback(NameAppearedHandlerVarPtr, NameAppearedHandlerVarRef) | |
| 84 | + | } | |
| 85 | + | } | |
| 86 | + | ||
| 87 | + | var NameVanishedHandlerVarRef uintptr | |
| 88 | + | if NameVanishedHandlerVar != nil { | |
| 89 | + | NameVanishedHandlerVarPtr := uintptr(unsafe.Pointer(NameVanishedHandlerVar)) | |
| 90 | + | if cbRefPtr, ok := glib.GetCallback(NameVanishedHandlerVarPtr); ok { | |
| 91 | + | NameVanishedHandlerVarRef = cbRefPtr | |
| 92 | + | } else { | |
| 93 | + | fcb := func(arg0 uintptr, arg1 string, arg2 uintptr) { | |
| 94 | + | cbFn := *NameVanishedHandlerVar | |
| 95 | + | cbFn(arg0, arg1, arg2) | |
| 96 | + | } | |
| 97 | + | NameVanishedHandlerVarRef = purego.NewCallback(fcb) | |
| 98 | + | glib.SaveCallback(NameVanishedHandlerVarPtr, NameVanishedHandlerVarRef) | |
| 99 | + | } | |
| 100 | + | } | |
| 101 | + | ||
| 102 | + | var UserDataFreeFuncVarRef uintptr | |
| 103 | + | if UserDataFreeFuncVar != nil { | |
| 104 | + | UserDataFreeFuncVarPtr := uintptr(unsafe.Pointer(UserDataFreeFuncVar)) | |
| 105 | + | if cbRefPtr, ok := glib.GetCallback(UserDataFreeFuncVarPtr); ok { | |
| 106 | + | UserDataFreeFuncVarRef = cbRefPtr | |
| 107 | + | } else { | |
| 108 | + | fcb := func(arg0 uintptr) { | |
| 109 | + | cbFn := *UserDataFreeFuncVar | |
| 110 | + | cbFn(arg0) | |
| 111 | + | } | |
| 112 | + | UserDataFreeFuncVarRef = purego.NewCallback(fcb) | |
| 113 | + | glib.SaveCallback(UserDataFreeFuncVarPtr, UserDataFreeFuncVarRef) | |
| 114 | + | } | |
| 115 | + | } | |
| 116 | + | ||
| 117 | + | cret := xBusWatchName(BusTypeVar, NameVar, FlagsVar, NameAppearedHandlerVarRef, NameVanishedHandlerVarRef, UserDataVar, UserDataFreeFuncVarRef) | |
| 71 | 118 | return cret | |
| 72 | 119 | } | |
| 73 | 120 | ||
| @@ -77,7 +124,52 @@ var xBusWatchNameOnConnection func(uintptr, string, BusNameWatcherFlags, uintptr | |||
| 77 | 124 | // #GBusType. | |
| 78 | 125 | func BusWatchNameOnConnection(ConnectionVar *DBusConnection, NameVar string, FlagsVar BusNameWatcherFlags, NameAppearedHandlerVar *BusNameAppearedCallback, NameVanishedHandlerVar *BusNameVanishedCallback, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) uint { | |
| 79 | 126 | ||
| 80 | - | cret := xBusWatchNameOnConnection(ConnectionVar.GoPointer(), NameVar, FlagsVar, glib.NewCallbackNullable(NameAppearedHandlerVar), glib.NewCallbackNullable(NameVanishedHandlerVar), UserDataVar, glib.NewCallbackNullable(UserDataFreeFuncVar)) | |
| 127 | + | var NameAppearedHandlerVarRef uintptr | |
| 128 | + | if NameAppearedHandlerVar != nil { | |
| 129 | + | NameAppearedHandlerVarPtr := uintptr(unsafe.Pointer(NameAppearedHandlerVar)) | |
| 130 | + | if cbRefPtr, ok := glib.GetCallback(NameAppearedHandlerVarPtr); ok { | |
| 131 | + | NameAppearedHandlerVarRef = cbRefPtr | |
| 132 | + | } else { | |
| 133 | + | fcb := func(arg0 uintptr, arg1 string, arg2 string, arg3 uintptr) { | |
| 134 | + | cbFn := *NameAppearedHandlerVar | |
| 135 | + | cbFn(arg0, arg1, arg2, arg3) | |
| 136 | + | } | |
| 137 | + | NameAppearedHandlerVarRef = purego.NewCallback(fcb) | |
| 138 | + | glib.SaveCallback(NameAppearedHandlerVarPtr, NameAppearedHandlerVarRef) | |
| 139 | + | } | |
| 140 | + | } | |
| 141 | + | ||
| 142 | + | var NameVanishedHandlerVarRef uintptr | |
| 143 | + | if NameVanishedHandlerVar != nil { | |
| 144 | + | NameVanishedHandlerVarPtr := uintptr(unsafe.Pointer(NameVanishedHandlerVar)) | |
| 145 | + | if cbRefPtr, ok := glib.GetCallback(NameVanishedHandlerVarPtr); ok { | |
| 146 | + | NameVanishedHandlerVarRef = cbRefPtr | |
| 147 | + | } else { | |
| 148 | + | fcb := func(arg0 uintptr, arg1 string, arg2 uintptr) { | |
| 149 | + | cbFn := *NameVanishedHandlerVar | |
| 150 | + | cbFn(arg0, arg1, arg2) | |
| 151 | + | } | |
| 152 | + | NameVanishedHandlerVarRef = purego.NewCallback(fcb) | |
| 153 | + | glib.SaveCallback(NameVanishedHandlerVarPtr, NameVanishedHandlerVarRef) | |
| 154 | + | } | |
| 155 | + | } | |
| 156 | + | ||
| 157 | + | var UserDataFreeFuncVarRef uintptr | |
| 158 | + | if UserDataFreeFuncVar != nil { | |
| 159 | + | UserDataFreeFuncVarPtr := uintptr(unsafe.Pointer(UserDataFreeFuncVar)) | |
| 160 | + | if cbRefPtr, ok := glib.GetCallback(UserDataFreeFuncVarPtr); ok { | |
| 161 | + | UserDataFreeFuncVarRef = cbRefPtr | |
| 162 | + | } else { | |
| 163 | + | fcb := func(arg0 uintptr) { | |
| 164 | + | cbFn := *UserDataFreeFuncVar | |
| 165 | + | cbFn(arg0) | |
| 166 | + | } | |
| 167 | + | UserDataFreeFuncVarRef = purego.NewCallback(fcb) | |
| 168 | + | glib.SaveCallback(UserDataFreeFuncVarPtr, UserDataFreeFuncVarRef) | |
| 169 | + | } | |
| 170 | + | } | |
| 171 | + | ||
| 172 | + | cret := xBusWatchNameOnConnection(ConnectionVar.GoPointer(), NameVar, FlagsVar, NameAppearedHandlerVarRef, NameVanishedHandlerVarRef, UserDataVar, UserDataFreeFuncVarRef) | |
| 81 | 173 | return cret | |
| 82 | 174 | } | |
| 83 | 175 | ||
M v4/gio/gdbusobjectmanagerclient.go +158 -8
| @@ -235,7 +235,37 @@ func NewDBusObjectManagerClientForBusSync(BusTypeVar BusType, FlagsVar DBusObjec | |||
| 235 | 235 | var cls *DBusObjectManagerClient | |
| 236 | 236 | var cerr *glib.Error | |
| 237 | 237 | ||
| 238 | - | cret := xNewDBusObjectManagerClientForBusSync(BusTypeVar, FlagsVar, NameVar, ObjectPathVar, glib.NewCallbackNullable(GetProxyTypeFuncVar), GetProxyTypeUserDataVar, glib.NewCallbackNullable(GetProxyTypeDestroyNotifyVar), CancellableVar.GoPointer(), &cerr) | |
| 238 | + | var GetProxyTypeFuncVarRef uintptr | |
| 239 | + | if GetProxyTypeFuncVar != nil { | |
| 240 | + | GetProxyTypeFuncVarPtr := uintptr(unsafe.Pointer(GetProxyTypeFuncVar)) | |
| 241 | + | if cbRefPtr, ok := glib.GetCallback(GetProxyTypeFuncVarPtr); ok { | |
| 242 | + | GetProxyTypeFuncVarRef = cbRefPtr | |
| 243 | + | } else { | |
| 244 | + | fcb := func(arg0 uintptr, arg1 string, arg2 string, arg3 uintptr) types.GType { | |
| 245 | + | cbFn := *GetProxyTypeFuncVar | |
| 246 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 247 | + | } | |
| 248 | + | GetProxyTypeFuncVarRef = purego.NewCallback(fcb) | |
| 249 | + | glib.SaveCallback(GetProxyTypeFuncVarPtr, GetProxyTypeFuncVarRef) | |
| 250 | + | } | |
| 251 | + | } | |
| 252 | + | ||
| 253 | + | var GetProxyTypeDestroyNotifyVarRef uintptr | |
| 254 | + | if GetProxyTypeDestroyNotifyVar != nil { | |
| 255 | + | GetProxyTypeDestroyNotifyVarPtr := uintptr(unsafe.Pointer(GetProxyTypeDestroyNotifyVar)) | |
| 256 | + | if cbRefPtr, ok := glib.GetCallback(GetProxyTypeDestroyNotifyVarPtr); ok { | |
| 257 | + | GetProxyTypeDestroyNotifyVarRef = cbRefPtr | |
| 258 | + | } else { | |
| 259 | + | fcb := func(arg0 uintptr) { | |
| 260 | + | cbFn := *GetProxyTypeDestroyNotifyVar | |
| 261 | + | cbFn(arg0) | |
| 262 | + | } | |
| 263 | + | GetProxyTypeDestroyNotifyVarRef = purego.NewCallback(fcb) | |
| 264 | + | glib.SaveCallback(GetProxyTypeDestroyNotifyVarPtr, GetProxyTypeDestroyNotifyVarRef) | |
| 265 | + | } | |
| 266 | + | } | |
| 267 | + | ||
| 268 | + | cret := xNewDBusObjectManagerClientForBusSync(BusTypeVar, FlagsVar, NameVar, ObjectPathVar, GetProxyTypeFuncVarRef, GetProxyTypeUserDataVar, GetProxyTypeDestroyNotifyVarRef, CancellableVar.GoPointer(), &cerr) | |
| 239 | 269 | ||
| 240 | 270 | if cret == 0 { | |
| 241 | 271 | return nil, cerr | |
| @@ -249,18 +279,48 @@ func NewDBusObjectManagerClientForBusSync(BusTypeVar BusType, FlagsVar DBusObjec | |||
| 249 | 279 | ||
| 250 | 280 | } | |
| 251 | 281 | ||
| 252 | - | var xNewDBusObjectManagerClientSync func(uintptr, DBusObjectManagerClientFlags, string, string, uintptr, uintptr, uintptr, uintptr, **glib.Error) uintptr | |
| 282 | + | var xNewDBusObjectManagerClientSync func(uintptr, DBusObjectManagerClientFlags, uintptr, string, uintptr, uintptr, uintptr, uintptr, **glib.Error) uintptr | |
| 253 | 283 | ||
| 254 | 284 | // Creates a new #GDBusObjectManagerClient object. | |
| 255 | 285 | // | |
| 256 | 286 | // This is a synchronous failable constructor - the calling thread is | |
| 257 | 287 | // blocked until a reply is received. See g_dbus_object_manager_client_new() | |
| 258 | 288 | // for the asynchronous version. | |
| 259 | - | func NewDBusObjectManagerClientSync(ConnectionVar *DBusConnection, FlagsVar DBusObjectManagerClientFlags, NameVar string, ObjectPathVar string, GetProxyTypeFuncVar *DBusProxyTypeFunc, GetProxyTypeUserDataVar uintptr, GetProxyTypeDestroyNotifyVar *glib.DestroyNotify, CancellableVar *Cancellable) (*DBusObjectManagerClient, error) { | |
| 289 | + | func NewDBusObjectManagerClientSync(ConnectionVar *DBusConnection, FlagsVar DBusObjectManagerClientFlags, NameVar *string, ObjectPathVar string, GetProxyTypeFuncVar *DBusProxyTypeFunc, GetProxyTypeUserDataVar uintptr, GetProxyTypeDestroyNotifyVar *glib.DestroyNotify, CancellableVar *Cancellable) (*DBusObjectManagerClient, error) { | |
| 260 | 290 | var cls *DBusObjectManagerClient | |
| 261 | 291 | var cerr *glib.Error | |
| 262 | 292 | ||
| 263 | - | cret := xNewDBusObjectManagerClientSync(ConnectionVar.GoPointer(), FlagsVar, NameVar, ObjectPathVar, glib.NewCallbackNullable(GetProxyTypeFuncVar), GetProxyTypeUserDataVar, glib.NewCallbackNullable(GetProxyTypeDestroyNotifyVar), CancellableVar.GoPointer(), &cerr) | |
| 293 | + | var GetProxyTypeFuncVarRef uintptr | |
| 294 | + | if GetProxyTypeFuncVar != nil { | |
| 295 | + | GetProxyTypeFuncVarPtr := uintptr(unsafe.Pointer(GetProxyTypeFuncVar)) | |
| 296 | + | if cbRefPtr, ok := glib.GetCallback(GetProxyTypeFuncVarPtr); ok { | |
| 297 | + | GetProxyTypeFuncVarRef = cbRefPtr | |
| 298 | + | } else { | |
| 299 | + | fcb := func(arg0 uintptr, arg1 string, arg2 string, arg3 uintptr) types.GType { | |
| 300 | + | cbFn := *GetProxyTypeFuncVar | |
| 301 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 302 | + | } | |
| 303 | + | GetProxyTypeFuncVarRef = purego.NewCallback(fcb) | |
| 304 | + | glib.SaveCallback(GetProxyTypeFuncVarPtr, GetProxyTypeFuncVarRef) | |
| 305 | + | } | |
| 306 | + | } | |
| 307 | + | ||
| 308 | + | var GetProxyTypeDestroyNotifyVarRef uintptr | |
| 309 | + | if GetProxyTypeDestroyNotifyVar != nil { | |
| 310 | + | GetProxyTypeDestroyNotifyVarPtr := uintptr(unsafe.Pointer(GetProxyTypeDestroyNotifyVar)) | |
| 311 | + | if cbRefPtr, ok := glib.GetCallback(GetProxyTypeDestroyNotifyVarPtr); ok { | |
| 312 | + | GetProxyTypeDestroyNotifyVarRef = cbRefPtr | |
| 313 | + | } else { | |
| 314 | + | fcb := func(arg0 uintptr) { | |
| 315 | + | cbFn := *GetProxyTypeDestroyNotifyVar | |
| 316 | + | cbFn(arg0) | |
| 317 | + | } | |
| 318 | + | GetProxyTypeDestroyNotifyVarRef = purego.NewCallback(fcb) | |
| 319 | + | glib.SaveCallback(GetProxyTypeDestroyNotifyVarPtr, GetProxyTypeDestroyNotifyVarRef) | |
| 320 | + | } | |
| 321 | + | } | |
| 322 | + | ||
| 323 | + | cret := xNewDBusObjectManagerClientSync(ConnectionVar.GoPointer(), FlagsVar, core.NullableStringToPtr(NameVar), ObjectPathVar, GetProxyTypeFuncVarRef, GetProxyTypeUserDataVar, GetProxyTypeDestroyNotifyVarRef, CancellableVar.GoPointer(), &cerr) | |
| 264 | 324 | ||
| 265 | 325 | if cret == 0 { | |
| 266 | 326 | return nil, cerr | |
| @@ -391,7 +451,7 @@ func (x *DBusObjectManagerClient) GetPropertyGetProxyTypeUserData() uintptr { | |||
| 391 | 451 | func (x *DBusObjectManagerClient) SetPropertyName(value string) { | |
| 392 | 452 | var v gobject.Value | |
| 393 | 453 | v.Init(gobject.TypeStringVal) | |
| 394 | - | v.SetString(value) | |
| 454 | + | v.SetString(&value) | |
| 395 | 455 | x.SetProperty("name", &v) | |
| 396 | 456 | } | |
| 397 | 457 | ||
| @@ -418,7 +478,7 @@ func (x *DBusObjectManagerClient) GetPropertyNameOwner() string { | |||
| 418 | 478 | func (x *DBusObjectManagerClient) SetPropertyObjectPath(value string) { | |
| 419 | 479 | var v gobject.Value | |
| 420 | 480 | v.Init(gobject.TypeStringVal) | |
| 421 | - | v.SetString(value) | |
| 481 | + | v.SetString(&value) | |
| 422 | 482 | x.SetProperty("object-path", &v) | |
| 423 | 483 | } | |
| 424 | 484 | ||
| @@ -666,7 +726,52 @@ var xDBusObjectManagerClientNew func(uintptr, DBusObjectManagerClientFlags, stri | |||
| 666 | 726 | // g_dbus_object_manager_client_new_sync() for the synchronous version. | |
| 667 | 727 | func DBusObjectManagerClientNew(ConnectionVar *DBusConnection, FlagsVar DBusObjectManagerClientFlags, NameVar string, ObjectPathVar string, GetProxyTypeFuncVar *DBusProxyTypeFunc, GetProxyTypeUserDataVar uintptr, GetProxyTypeDestroyNotifyVar *glib.DestroyNotify, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 668 | 728 | ||
| 669 | - | xDBusObjectManagerClientNew(ConnectionVar.GoPointer(), FlagsVar, NameVar, ObjectPathVar, glib.NewCallbackNullable(GetProxyTypeFuncVar), GetProxyTypeUserDataVar, glib.NewCallbackNullable(GetProxyTypeDestroyNotifyVar), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 729 | + | var GetProxyTypeFuncVarRef uintptr | |
| 730 | + | if GetProxyTypeFuncVar != nil { | |
| 731 | + | GetProxyTypeFuncVarPtr := uintptr(unsafe.Pointer(GetProxyTypeFuncVar)) | |
| 732 | + | if cbRefPtr, ok := glib.GetCallback(GetProxyTypeFuncVarPtr); ok { | |
| 733 | + | GetProxyTypeFuncVarRef = cbRefPtr | |
| 734 | + | } else { | |
| 735 | + | fcb := func(arg0 uintptr, arg1 string, arg2 string, arg3 uintptr) types.GType { | |
| 736 | + | cbFn := *GetProxyTypeFuncVar | |
| 737 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 738 | + | } | |
| 739 | + | GetProxyTypeFuncVarRef = purego.NewCallback(fcb) | |
| 740 | + | glib.SaveCallback(GetProxyTypeFuncVarPtr, GetProxyTypeFuncVarRef) | |
| 741 | + | } | |
| 742 | + | } | |
| 743 | + | ||
| 744 | + | var GetProxyTypeDestroyNotifyVarRef uintptr | |
| 745 | + | if GetProxyTypeDestroyNotifyVar != nil { | |
| 746 | + | GetProxyTypeDestroyNotifyVarPtr := uintptr(unsafe.Pointer(GetProxyTypeDestroyNotifyVar)) | |
| 747 | + | if cbRefPtr, ok := glib.GetCallback(GetProxyTypeDestroyNotifyVarPtr); ok { | |
| 748 | + | GetProxyTypeDestroyNotifyVarRef = cbRefPtr | |
| 749 | + | } else { | |
| 750 | + | fcb := func(arg0 uintptr) { | |
| 751 | + | cbFn := *GetProxyTypeDestroyNotifyVar | |
| 752 | + | cbFn(arg0) | |
| 753 | + | } | |
| 754 | + | GetProxyTypeDestroyNotifyVarRef = purego.NewCallback(fcb) | |
| 755 | + | glib.SaveCallback(GetProxyTypeDestroyNotifyVarPtr, GetProxyTypeDestroyNotifyVarRef) | |
| 756 | + | } | |
| 757 | + | } | |
| 758 | + | ||
| 759 | + | var CallbackVarRef uintptr | |
| 760 | + | if CallbackVar != nil { | |
| 761 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 762 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 763 | + | CallbackVarRef = cbRefPtr | |
| 764 | + | } else { | |
| 765 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 766 | + | cbFn := *CallbackVar | |
| 767 | + | cbFn(arg0, arg1, arg2) | |
| 768 | + | } | |
| 769 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 770 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 771 | + | } | |
| 772 | + | } | |
| 773 | + | ||
| 774 | + | xDBusObjectManagerClientNew(ConnectionVar.GoPointer(), FlagsVar, NameVar, ObjectPathVar, GetProxyTypeFuncVarRef, GetProxyTypeUserDataVar, GetProxyTypeDestroyNotifyVarRef, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 670 | 775 | ||
| 671 | 776 | } | |
| 672 | 777 | ||
| @@ -683,7 +788,52 @@ var xDBusObjectManagerClientNewForBus func(BusType, DBusObjectManagerClientFlags | |||
| 683 | 788 | // g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version. | |
| 684 | 789 | func DBusObjectManagerClientNewForBus(BusTypeVar BusType, FlagsVar DBusObjectManagerClientFlags, NameVar string, ObjectPathVar string, GetProxyTypeFuncVar *DBusProxyTypeFunc, GetProxyTypeUserDataVar uintptr, GetProxyTypeDestroyNotifyVar *glib.DestroyNotify, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 685 | 790 | ||
| 686 | - | xDBusObjectManagerClientNewForBus(BusTypeVar, FlagsVar, NameVar, ObjectPathVar, glib.NewCallbackNullable(GetProxyTypeFuncVar), GetProxyTypeUserDataVar, glib.NewCallbackNullable(GetProxyTypeDestroyNotifyVar), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 791 | + | var GetProxyTypeFuncVarRef uintptr | |
| 792 | + | if GetProxyTypeFuncVar != nil { | |
| 793 | + | GetProxyTypeFuncVarPtr := uintptr(unsafe.Pointer(GetProxyTypeFuncVar)) | |
| 794 | + | if cbRefPtr, ok := glib.GetCallback(GetProxyTypeFuncVarPtr); ok { | |
| 795 | + | GetProxyTypeFuncVarRef = cbRefPtr | |
| 796 | + | } else { | |
| 797 | + | fcb := func(arg0 uintptr, arg1 string, arg2 string, arg3 uintptr) types.GType { | |
| 798 | + | cbFn := *GetProxyTypeFuncVar | |
| 799 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 800 | + | } | |
| 801 | + | GetProxyTypeFuncVarRef = purego.NewCallback(fcb) | |
| 802 | + | glib.SaveCallback(GetProxyTypeFuncVarPtr, GetProxyTypeFuncVarRef) | |
| 803 | + | } | |
| 804 | + | } | |
| 805 | + | ||
| 806 | + | var GetProxyTypeDestroyNotifyVarRef uintptr | |
| 807 | + | if GetProxyTypeDestroyNotifyVar != nil { | |
| 808 | + | GetProxyTypeDestroyNotifyVarPtr := uintptr(unsafe.Pointer(GetProxyTypeDestroyNotifyVar)) | |
| 809 | + | if cbRefPtr, ok := glib.GetCallback(GetProxyTypeDestroyNotifyVarPtr); ok { | |
| 810 | + | GetProxyTypeDestroyNotifyVarRef = cbRefPtr | |
| 811 | + | } else { | |
| 812 | + | fcb := func(arg0 uintptr) { | |
| 813 | + | cbFn := *GetProxyTypeDestroyNotifyVar | |
| 814 | + | cbFn(arg0) | |
| 815 | + | } | |
| 816 | + | GetProxyTypeDestroyNotifyVarRef = purego.NewCallback(fcb) | |
| 817 | + | glib.SaveCallback(GetProxyTypeDestroyNotifyVarPtr, GetProxyTypeDestroyNotifyVarRef) | |
| 818 | + | } | |
| 819 | + | } | |
| 820 | + | ||
| 821 | + | var CallbackVarRef uintptr | |
| 822 | + | if CallbackVar != nil { | |
| 823 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 824 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 825 | + | CallbackVarRef = cbRefPtr | |
| 826 | + | } else { | |
| 827 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 828 | + | cbFn := *CallbackVar | |
| 829 | + | cbFn(arg0, arg1, arg2) | |
| 830 | + | } | |
| 831 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 832 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 833 | + | } | |
| 834 | + | } | |
| 835 | + | ||
| 836 | + | xDBusObjectManagerClientNewForBus(BusTypeVar, FlagsVar, NameVar, ObjectPathVar, GetProxyTypeFuncVarRef, GetProxyTypeUserDataVar, GetProxyTypeDestroyNotifyVarRef, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 687 | 837 | ||
| 688 | 838 | } | |
| 689 | 839 | ||
M v4/gio/gdbusobjectmanagerserver.go +1 -1
| @@ -186,7 +186,7 @@ func (c *DBusObjectManagerServer) SetGoPointer(ptr uintptr) { | |||
| 186 | 186 | func (x *DBusObjectManagerServer) SetPropertyObjectPath(value string) { | |
| 187 | 187 | var v gobject.Value | |
| 188 | 188 | v.Init(gobject.TypeStringVal) | |
| 189 | - | v.SetString(value) | |
| 189 | + | v.SetString(&value) | |
| 190 | 190 | x.SetProperty("object-path", &v) | |
| 191 | 191 | } | |
| 192 | 192 | ||
M v4/gio/gdbusobjectproxy.go +1 -1
| @@ -103,7 +103,7 @@ func (c *DBusObjectProxy) SetGoPointer(ptr uintptr) { | |||
| 103 | 103 | func (x *DBusObjectProxy) SetPropertyGObjectPath(value string) { | |
| 104 | 104 | var v gobject.Value | |
| 105 | 105 | v.Init(gobject.TypeStringVal) | |
| 106 | - | v.SetString(value) | |
| 106 | + | v.SetString(&value) | |
| 107 | 107 | x.SetProperty("g-object-path", &v) | |
| 108 | 108 | } | |
| 109 | 109 | ||
M v4/gio/gdbusobjectskeleton.go +1 -1
| @@ -169,7 +169,7 @@ func (c *DBusObjectSkeleton) SetGoPointer(ptr uintptr) { | |||
| 169 | 169 | func (x *DBusObjectSkeleton) SetPropertyGObjectPath(value string) { | |
| 170 | 170 | var v gobject.Value | |
| 171 | 171 | v.Init(gobject.TypeStringVal) | |
| 172 | - | v.SetString(value) | |
| 172 | + | v.SetString(&value) | |
| 173 | 173 | x.SetProperty("g-object-path", &v) | |
| 174 | 174 | } | |
| 175 | 175 | ||
M v4/gio/gdbusproxy.go +95 -12
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | package gio | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "fmt" | |
| 5 | 6 | "structs" | |
| 6 | 7 | "unsafe" | |
| 7 | 8 | ||
| @@ -215,7 +216,7 @@ func NewDBusProxyForBusSync(BusTypeVar BusType, FlagsVar DBusProxyFlags, InfoVar | |||
| 215 | 216 | ||
| 216 | 217 | } | |
| 217 | 218 | ||
| 218 | - | var xNewDBusProxySync func(uintptr, DBusProxyFlags, *DBusInterfaceInfo, string, string, string, uintptr, **glib.Error) uintptr | |
| 219 | + | var xNewDBusProxySync func(uintptr, DBusProxyFlags, *DBusInterfaceInfo, uintptr, string, string, uintptr, **glib.Error) uintptr | |
| 219 | 220 | ||
| 220 | 221 | // Creates a proxy for accessing @interface_name on the remote object | |
| 221 | 222 | // at @object_path owned by @name at @connection and synchronously | |
| @@ -239,11 +240,11 @@ var xNewDBusProxySync func(uintptr, DBusProxyFlags, *DBusInterfaceInfo, string, | |||
| 239 | 240 | // and g_dbus_proxy_new_finish() for the asynchronous version. | |
| 240 | 241 | // | |
| 241 | 242 | // #GDBusProxy is used in this [example][class@Gio.DBusProxy#a-watch-proxy-example]. | |
| 242 | - | func NewDBusProxySync(ConnectionVar *DBusConnection, FlagsVar DBusProxyFlags, InfoVar *DBusInterfaceInfo, NameVar string, ObjectPathVar string, InterfaceNameVar string, CancellableVar *Cancellable) (*DBusProxy, error) { | |
| 243 | + | func NewDBusProxySync(ConnectionVar *DBusConnection, FlagsVar DBusProxyFlags, InfoVar *DBusInterfaceInfo, NameVar *string, ObjectPathVar string, InterfaceNameVar string, CancellableVar *Cancellable) (*DBusProxy, error) { | |
| 243 | 244 | var cls *DBusProxy | |
| 244 | 245 | var cerr *glib.Error | |
| 245 | 246 | ||
| 246 | - | cret := xNewDBusProxySync(ConnectionVar.GoPointer(), FlagsVar, InfoVar, NameVar, ObjectPathVar, InterfaceNameVar, CancellableVar.GoPointer(), &cerr) | |
| 247 | + | cret := xNewDBusProxySync(ConnectionVar.GoPointer(), FlagsVar, InfoVar, core.NullableStringToPtr(NameVar), ObjectPathVar, InterfaceNameVar, CancellableVar.GoPointer(), &cerr) | |
| 247 | 248 | ||
| 248 | 249 | if cret == 0 { | |
| 249 | 250 | return nil, cerr | |
| @@ -305,7 +306,22 @@ var xDBusProxyCall func(uintptr, string, *glib.Variant, DBusCallFlags, int, uint | |||
| 305 | 306 | // the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set. | |
| 306 | 307 | func (x *DBusProxy) Call(MethodNameVar string, ParametersVar *glib.Variant, FlagsVar DBusCallFlags, TimeoutMsecVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 307 | 308 | ||
| 308 | - | xDBusProxyCall(x.GoPointer(), MethodNameVar, ParametersVar, FlagsVar, TimeoutMsecVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 309 | + | var CallbackVarRef uintptr | |
| 310 | + | if CallbackVar != nil { | |
| 311 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 312 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 313 | + | CallbackVarRef = cbRefPtr | |
| 314 | + | } else { | |
| 315 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 316 | + | cbFn := *CallbackVar | |
| 317 | + | cbFn(arg0, arg1, arg2) | |
| 318 | + | } | |
| 319 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 320 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 321 | + | } | |
| 322 | + | } | |
| 323 | + | ||
| 324 | + | xDBusProxyCall(x.GoPointer(), MethodNameVar, ParametersVar, FlagsVar, TimeoutMsecVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 309 | 325 | ||
| 310 | 326 | } | |
| 311 | 327 | ||
| @@ -379,7 +395,22 @@ var xDBusProxyCallWithUnixFdList func(uintptr, string, *glib.Variant, DBusCallFl | |||
| 379 | 395 | // This method is only available on UNIX. | |
| 380 | 396 | func (x *DBusProxy) CallWithUnixFdList(MethodNameVar string, ParametersVar *glib.Variant, FlagsVar DBusCallFlags, TimeoutMsecVar int, FdListVar *UnixFDList, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 381 | 397 | ||
| 382 | - | xDBusProxyCallWithUnixFdList(x.GoPointer(), MethodNameVar, ParametersVar, FlagsVar, TimeoutMsecVar, FdListVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 398 | + | var CallbackVarRef uintptr | |
| 399 | + | if CallbackVar != nil { | |
| 400 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 401 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 402 | + | CallbackVarRef = cbRefPtr | |
| 403 | + | } else { | |
| 404 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 405 | + | cbFn := *CallbackVar | |
| 406 | + | cbFn(arg0, arg1, arg2) | |
| 407 | + | } | |
| 408 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 409 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 410 | + | } | |
| 411 | + | } | |
| 412 | + | ||
| 413 | + | xDBusProxyCallWithUnixFdList(x.GoPointer(), MethodNameVar, ParametersVar, FlagsVar, TimeoutMsecVar, FdListVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 383 | 414 | ||
| 384 | 415 | } | |
| 385 | 416 | ||
| @@ -708,7 +739,7 @@ func (x *DBusProxy) GetPropertyGInterfaceInfo() uintptr { | |||
| 708 | 739 | func (x *DBusProxy) SetPropertyGInterfaceName(value string) { | |
| 709 | 740 | var v gobject.Value | |
| 710 | 741 | v.Init(gobject.TypeStringVal) | |
| 711 | - | v.SetString(value) | |
| 742 | + | v.SetString(&value) | |
| 712 | 743 | x.SetProperty("g-interface-name", &v) | |
| 713 | 744 | } | |
| 714 | 745 | ||
| @@ -725,7 +756,7 @@ func (x *DBusProxy) GetPropertyGInterfaceName() string { | |||
| 725 | 756 | func (x *DBusProxy) SetPropertyGName(value string) { | |
| 726 | 757 | var v gobject.Value | |
| 727 | 758 | v.Init(gobject.TypeStringVal) | |
| 728 | - | v.SetString(value) | |
| 759 | + | v.SetString(&value) | |
| 729 | 760 | x.SetProperty("g-name", &v) | |
| 730 | 761 | } | |
| 731 | 762 | ||
| @@ -752,7 +783,7 @@ func (x *DBusProxy) GetPropertyGNameOwner() string { | |||
| 752 | 783 | func (x *DBusProxy) SetPropertyGObjectPath(value string) { | |
| 753 | 784 | var v gobject.Value | |
| 754 | 785 | v.Init(gobject.TypeStringVal) | |
| 755 | - | v.SetString(value) | |
| 786 | + | v.SetString(&value) | |
| 756 | 787 | x.SetProperty("g-object-path", &v) | |
| 757 | 788 | } | |
| 758 | 789 | ||
| @@ -819,6 +850,28 @@ func (x *DBusProxy) ConnectGSignal(cb *func(DBusProxy, string, string, uintptr)) | |||
| 819 | 850 | return gobject.SignalConnect(x.GoPointer(), "g-signal", cbRefPtr) | |
| 820 | 851 | } | |
| 821 | 852 | ||
| 853 | + | // ConnectGSignalWithDetail connects to the "g-signal" signal with a detail string. | |
| 854 | + | // The detail is appended as "g-signal::<detail>". | |
| 855 | + | func (x *DBusProxy) ConnectGSignalWithDetail(detail string, cb *func(DBusProxy, string, string, uintptr)) uint32 { | |
| 856 | + | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 857 | + | signalName := fmt.Sprintf("g-signal::%s", detail) | |
| 858 | + | if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { | |
| 859 | + | return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 860 | + | } | |
| 861 | + | ||
| 862 | + | fcb := func(clsPtr uintptr, SenderNameVarp string, SignalNameVarp string, ParametersVarp uintptr) { | |
| 863 | + | fa := DBusProxy{} | |
| 864 | + | fa.Ptr = clsPtr | |
| 865 | + | cbFn := *cb | |
| 866 | + | ||
| 867 | + | cbFn(fa, SenderNameVarp, SignalNameVarp, ParametersVarp) | |
| 868 | + | ||
| 869 | + | } | |
| 870 | + | cbRefPtr := purego.NewCallback(fcb) | |
| 871 | + | glib.SaveCallback(cbPtr, cbRefPtr) | |
| 872 | + | return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 873 | + | } | |
| 874 | + | ||
| 822 | 875 | // Starts asynchronous initialization of the object implementing the | |
| 823 | 876 | // interface. This must be done before any real use of the object after | |
| 824 | 877 | // initial construction. If the object also implements #GInitable you can | |
| @@ -993,7 +1046,7 @@ func (x *DBusProxy) Init(CancellableVar *Cancellable) (bool, error) { | |||
| 993 | 1046 | ||
| 994 | 1047 | } | |
| 995 | 1048 | ||
| 996 | - | var xDBusProxyNew func(uintptr, DBusProxyFlags, *DBusInterfaceInfo, string, string, string, uintptr, uintptr, uintptr) | |
| 1049 | + | var xDBusProxyNew func(uintptr, DBusProxyFlags, *DBusInterfaceInfo, uintptr, string, string, uintptr, uintptr, uintptr) | |
| 997 | 1050 | ||
| 998 | 1051 | // Creates a proxy for accessing @interface_name on the remote object | |
| 999 | 1052 | // at @object_path owned by @name at @connection and asynchronously | |
| @@ -1022,9 +1075,24 @@ var xDBusProxyNew func(uintptr, DBusProxyFlags, *DBusInterfaceInfo, string, stri | |||
| 1022 | 1075 | // See g_dbus_proxy_new_sync() and for a synchronous version of this constructor. | |
| 1023 | 1076 | // | |
| 1024 | 1077 | // #GDBusProxy is used in this [example][class@Gio.DBusProxy#a-watch-proxy-example]. | |
| 1025 | - | func DBusProxyNew(ConnectionVar *DBusConnection, FlagsVar DBusProxyFlags, InfoVar *DBusInterfaceInfo, NameVar string, ObjectPathVar string, InterfaceNameVar string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1078 | + | func DBusProxyNew(ConnectionVar *DBusConnection, FlagsVar DBusProxyFlags, InfoVar *DBusInterfaceInfo, NameVar *string, ObjectPathVar string, InterfaceNameVar string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1079 | + | ||
| 1080 | + | var CallbackVarRef uintptr | |
| 1081 | + | if CallbackVar != nil { | |
| 1082 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1083 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1084 | + | CallbackVarRef = cbRefPtr | |
| 1085 | + | } else { | |
| 1086 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1087 | + | cbFn := *CallbackVar | |
| 1088 | + | cbFn(arg0, arg1, arg2) | |
| 1089 | + | } | |
| 1090 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1091 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1092 | + | } | |
| 1093 | + | } | |
| 1026 | 1094 | ||
| 1027 | - | xDBusProxyNew(ConnectionVar.GoPointer(), FlagsVar, InfoVar, NameVar, ObjectPathVar, InterfaceNameVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1095 | + | xDBusProxyNew(ConnectionVar.GoPointer(), FlagsVar, InfoVar, core.NullableStringToPtr(NameVar), ObjectPathVar, InterfaceNameVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 1028 | 1096 | ||
| 1029 | 1097 | } | |
| 1030 | 1098 | ||
| @@ -1035,7 +1103,22 @@ var xDBusProxyNewForBus func(BusType, DBusProxyFlags, *DBusInterfaceInfo, string | |||
| 1035 | 1103 | // #GDBusProxy is used in this [example][class@Gio.DBusProxy#a-watch-proxy-example]. | |
| 1036 | 1104 | func DBusProxyNewForBus(BusTypeVar BusType, FlagsVar DBusProxyFlags, InfoVar *DBusInterfaceInfo, NameVar string, ObjectPathVar string, InterfaceNameVar string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1037 | 1105 | ||
| 1038 | - | xDBusProxyNewForBus(BusTypeVar, FlagsVar, InfoVar, NameVar, ObjectPathVar, InterfaceNameVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1106 | + | var CallbackVarRef uintptr | |
| 1107 | + | if CallbackVar != nil { | |
| 1108 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1109 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1110 | + | CallbackVarRef = cbRefPtr | |
| 1111 | + | } else { | |
| 1112 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1113 | + | cbFn := *CallbackVar | |
| 1114 | + | cbFn(arg0, arg1, arg2) | |
| 1115 | + | } | |
| 1116 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1117 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1118 | + | } | |
| 1119 | + | } | |
| 1120 | + | ||
| 1121 | + | xDBusProxyNewForBus(BusTypeVar, FlagsVar, InfoVar, NameVar, ObjectPathVar, InterfaceNameVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 1039 | 1122 | ||
| 1040 | 1123 | } | |
| 1041 | 1124 | ||
M v4/gio/gdbusserver.go +2 -2
| @@ -169,7 +169,7 @@ func (x *DBusServer) GetPropertyActive() bool { | |||
| 169 | 169 | func (x *DBusServer) SetPropertyAddress(value string) { | |
| 170 | 170 | var v gobject.Value | |
| 171 | 171 | v.Init(gobject.TypeStringVal) | |
| 172 | - | v.SetString(value) | |
| 172 | + | v.SetString(&value) | |
| 173 | 173 | x.SetProperty("address", &v) | |
| 174 | 174 | } | |
| 175 | 175 | ||
| @@ -196,7 +196,7 @@ func (x *DBusServer) GetPropertyClientAddress() string { | |||
| 196 | 196 | func (x *DBusServer) SetPropertyGuid(value string) { | |
| 197 | 197 | var v gobject.Value | |
| 198 | 198 | v.Init(gobject.TypeStringVal) | |
| 199 | - | v.SetString(value) | |
| 199 | + | v.SetString(&value) | |
| 200 | 200 | x.SetProperty("guid", &v) | |
| 201 | 201 | } | |
| 202 | 202 | ||
M v4/gio/gfile.go +67 -37
| @@ -3315,15 +3315,15 @@ type File interface { | |||
| 3315 | 3315 | Read(CancellableVar *Cancellable) (*FileInputStream, error) | |
| 3316 | 3316 | ReadAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 3317 | 3317 | ReadFinish(ResVar AsyncResult) (*FileInputStream, error) | |
| 3318 | - | Replace(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileOutputStream, error) | |
| 3319 | - | ReplaceAsync(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 3320 | - | ReplaceContents(ContentsVar string, LengthVar uint, EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, NewEtagVar *string, CancellableVar *Cancellable) (bool, error) | |
| 3321 | - | ReplaceContentsAsync(ContentsVar string, LengthVar uint, EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 3322 | - | ReplaceContentsBytesAsync(ContentsVar *glib.Bytes, EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 3318 | + | Replace(EtagVar *string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileOutputStream, error) | |
| 3319 | + | ReplaceAsync(EtagVar *string, MakeBackupVar bool, FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 3320 | + | ReplaceContents(ContentsVar string, LengthVar uint, EtagVar *string, MakeBackupVar bool, FlagsVar FileCreateFlags, NewEtagVar *string, CancellableVar *Cancellable) (bool, error) | |
| 3321 | + | ReplaceContentsAsync(ContentsVar string, LengthVar uint, EtagVar *string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 3322 | + | ReplaceContentsBytesAsync(ContentsVar *glib.Bytes, EtagVar *string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 3323 | 3323 | ReplaceContentsFinish(ResVar AsyncResult, NewEtagVar *string) (bool, error) | |
| 3324 | 3324 | ReplaceFinish(ResVar AsyncResult) (*FileOutputStream, error) | |
| 3325 | - | ReplaceReadwrite(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileIOStream, error) | |
| 3326 | - | ReplaceReadwriteAsync(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 3325 | + | ReplaceReadwrite(EtagVar *string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileIOStream, error) | |
| 3326 | + | ReplaceReadwriteAsync(EtagVar *string, MakeBackupVar bool, FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) | |
| 3327 | 3327 | ReplaceReadwriteFinish(ResVar AsyncResult) (*FileIOStream, error) | |
| 3328 | 3328 | ResolveRelativePath(RelativePathVar string) *FileBase | |
| 3329 | 3329 | SetAttribute(AttributeVar string, TypeVar FileAttributeType, ValuePVar uintptr, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) | |
| @@ -5280,11 +5280,11 @@ func (x *FileBase) ReadFinish(ResVar AsyncResult) (*FileInputStream, error) { | |||
| 5280 | 5280 | // %G_IO_ERROR_INVALID_FILENAME error, and if the name is to long | |
| 5281 | 5281 | // %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are | |
| 5282 | 5282 | // possible too, and depend on what kind of filesystem the file is on. | |
| 5283 | - | func (x *FileBase) Replace(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileOutputStream, error) { | |
| 5283 | + | func (x *FileBase) Replace(EtagVar *string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileOutputStream, error) { | |
| 5284 | 5284 | var cls *FileOutputStream | |
| 5285 | 5285 | var cerr *glib.Error | |
| 5286 | 5286 | ||
| 5287 | - | cret := XGFileReplace(x.GoPointer(), EtagVar, MakeBackupVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 5287 | + | cret := XGFileReplace(x.GoPointer(), core.NullableStringToPtr(EtagVar), MakeBackupVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 5288 | 5288 | ||
| 5289 | 5289 | if cret == 0 { | |
| 5290 | 5290 | return nil, cerr | |
| @@ -5307,9 +5307,9 @@ func (x *FileBase) Replace(EtagVar string, MakeBackupVar bool, FlagsVar FileCrea | |||
| 5307 | 5307 | // When the operation is finished, @callback will be called. | |
| 5308 | 5308 | // You can then call g_file_replace_finish() to get the result | |
| 5309 | 5309 | // of the operation. | |
| 5310 | - | func (x *FileBase) ReplaceAsync(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 5310 | + | func (x *FileBase) ReplaceAsync(EtagVar *string, MakeBackupVar bool, FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 5311 | 5311 | ||
| 5312 | - | XGFileReplaceAsync(x.GoPointer(), EtagVar, MakeBackupVar, FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 5312 | + | XGFileReplaceAsync(x.GoPointer(), core.NullableStringToPtr(EtagVar), MakeBackupVar, FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 5313 | 5313 | ||
| 5314 | 5314 | } | |
| 5315 | 5315 | ||
| @@ -5329,10 +5329,10 @@ func (x *FileBase) ReplaceAsync(EtagVar string, MakeBackupVar bool, FlagsVar Fil | |||
| 5329 | 5329 | // | |
| 5330 | 5330 | // The returned @new_etag can be used to verify that the file hasn't | |
| 5331 | 5331 | // changed the next time it is saved over. | |
| 5332 | - | func (x *FileBase) ReplaceContents(ContentsVar string, LengthVar uint, EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, NewEtagVar *string, CancellableVar *Cancellable) (bool, error) { | |
| 5332 | + | func (x *FileBase) ReplaceContents(ContentsVar string, LengthVar uint, EtagVar *string, MakeBackupVar bool, FlagsVar FileCreateFlags, NewEtagVar *string, CancellableVar *Cancellable) (bool, error) { | |
| 5333 | 5333 | var cerr *glib.Error | |
| 5334 | 5334 | ||
| 5335 | - | cret := XGFileReplaceContents(x.GoPointer(), ContentsVar, LengthVar, EtagVar, MakeBackupVar, FlagsVar, NewEtagVar, CancellableVar.GoPointer(), &cerr) | |
| 5335 | + | cret := XGFileReplaceContents(x.GoPointer(), ContentsVar, LengthVar, core.NullableStringToPtr(EtagVar), MakeBackupVar, FlagsVar, NewEtagVar, CancellableVar.GoPointer(), &cerr) | |
| 5336 | 5336 | if cerr == nil { | |
| 5337 | 5337 | return cret, nil | |
| 5338 | 5338 | } | |
| @@ -5359,9 +5359,9 @@ func (x *FileBase) ReplaceContents(ContentsVar string, LengthVar uint, EtagVar s | |||
| 5359 | 5359 | // until @callback is called. See g_file_replace_contents_bytes_async() | |
| 5360 | 5360 | // for a #GBytes version that will automatically hold a reference to the | |
| 5361 | 5361 | // contents (without copying) for the duration of the call. | |
| 5362 | - | func (x *FileBase) ReplaceContentsAsync(ContentsVar string, LengthVar uint, EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 5362 | + | func (x *FileBase) ReplaceContentsAsync(ContentsVar string, LengthVar uint, EtagVar *string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 5363 | 5363 | ||
| 5364 | - | XGFileReplaceContentsAsync(x.GoPointer(), ContentsVar, LengthVar, EtagVar, MakeBackupVar, FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 5364 | + | XGFileReplaceContentsAsync(x.GoPointer(), ContentsVar, LengthVar, core.NullableStringToPtr(EtagVar), MakeBackupVar, FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 5365 | 5365 | ||
| 5366 | 5366 | } | |
| 5367 | 5367 | ||
| @@ -5373,9 +5373,9 @@ func (x *FileBase) ReplaceContentsAsync(ContentsVar string, LengthVar uint, Etag | |||
| 5373 | 5373 | // When this operation has completed, @callback will be called with | |
| 5374 | 5374 | // @user_user data, and the operation can be finalized with | |
| 5375 | 5375 | // g_file_replace_contents_finish(). | |
| 5376 | - | func (x *FileBase) ReplaceContentsBytesAsync(ContentsVar *glib.Bytes, EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 5376 | + | func (x *FileBase) ReplaceContentsBytesAsync(ContentsVar *glib.Bytes, EtagVar *string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 5377 | 5377 | ||
| 5378 | - | XGFileReplaceContentsBytesAsync(x.GoPointer(), ContentsVar, EtagVar, MakeBackupVar, FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 5378 | + | XGFileReplaceContentsBytesAsync(x.GoPointer(), ContentsVar, core.NullableStringToPtr(EtagVar), MakeBackupVar, FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 5379 | 5379 | ||
| 5380 | 5380 | } | |
| 5381 | 5381 | ||
| @@ -5423,11 +5423,11 @@ func (x *FileBase) ReplaceFinish(ResVar AsyncResult) (*FileOutputStream, error) | |||
| 5423 | 5423 | // Note that in many non-local file cases read and write streams are not | |
| 5424 | 5424 | // supported, so make sure you really need to do read and write streaming, | |
| 5425 | 5425 | // rather than just opening for reading or writing. | |
| 5426 | - | func (x *FileBase) ReplaceReadwrite(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileIOStream, error) { | |
| 5426 | + | func (x *FileBase) ReplaceReadwrite(EtagVar *string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileIOStream, error) { | |
| 5427 | 5427 | var cls *FileIOStream | |
| 5428 | 5428 | var cerr *glib.Error | |
| 5429 | 5429 | ||
| 5430 | - | cret := XGFileReplaceReadwrite(x.GoPointer(), EtagVar, MakeBackupVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 5430 | + | cret := XGFileReplaceReadwrite(x.GoPointer(), core.NullableStringToPtr(EtagVar), MakeBackupVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 5431 | 5431 | ||
| 5432 | 5432 | if cret == 0 { | |
| 5433 | 5433 | return nil, cerr | |
| @@ -5451,9 +5451,9 @@ func (x *FileBase) ReplaceReadwrite(EtagVar string, MakeBackupVar bool, FlagsVar | |||
| 5451 | 5451 | // When the operation is finished, @callback will be called. | |
| 5452 | 5452 | // You can then call g_file_replace_readwrite_finish() to get | |
| 5453 | 5453 | // the result of the operation. | |
| 5454 | - | func (x *FileBase) ReplaceReadwriteAsync(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 5454 | + | func (x *FileBase) ReplaceReadwriteAsync(EtagVar *string, MakeBackupVar bool, FlagsVar FileCreateFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 5455 | 5455 | ||
| 5456 | - | XGFileReplaceReadwriteAsync(x.GoPointer(), EtagVar, MakeBackupVar, FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 5456 | + | XGFileReplaceReadwriteAsync(x.GoPointer(), core.NullableStringToPtr(EtagVar), MakeBackupVar, FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 5457 | 5457 | ||
| 5458 | 5458 | } | |
| 5459 | 5459 | ||
| @@ -6006,15 +6006,15 @@ var XGFileQueryWritableNamespaces func(uintptr, uintptr, **glib.Error) *FileAttr | |||
| 6006 | 6006 | var XGFileRead func(uintptr, uintptr, **glib.Error) uintptr | |
| 6007 | 6007 | var XGFileReadAsync func(uintptr, int, uintptr, uintptr, uintptr) | |
| 6008 | 6008 | var XGFileReadFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 6009 | - | var XGFileReplace func(uintptr, string, bool, FileCreateFlags, uintptr, **glib.Error) uintptr | |
| 6010 | - | var XGFileReplaceAsync func(uintptr, string, bool, FileCreateFlags, int, uintptr, uintptr, uintptr) | |
| 6011 | - | var XGFileReplaceContents func(uintptr, string, uint, string, bool, FileCreateFlags, *string, uintptr, **glib.Error) bool | |
| 6012 | - | var XGFileReplaceContentsAsync func(uintptr, string, uint, string, bool, FileCreateFlags, uintptr, uintptr, uintptr) | |
| 6013 | - | var XGFileReplaceContentsBytesAsync func(uintptr, *glib.Bytes, string, bool, FileCreateFlags, uintptr, uintptr, uintptr) | |
| 6009 | + | var XGFileReplace func(uintptr, uintptr, bool, FileCreateFlags, uintptr, **glib.Error) uintptr | |
| 6010 | + | var XGFileReplaceAsync func(uintptr, uintptr, bool, FileCreateFlags, int, uintptr, uintptr, uintptr) | |
| 6011 | + | var XGFileReplaceContents func(uintptr, string, uint, uintptr, bool, FileCreateFlags, *string, uintptr, **glib.Error) bool | |
| 6012 | + | var XGFileReplaceContentsAsync func(uintptr, string, uint, uintptr, bool, FileCreateFlags, uintptr, uintptr, uintptr) | |
| 6013 | + | var XGFileReplaceContentsBytesAsync func(uintptr, *glib.Bytes, uintptr, bool, FileCreateFlags, uintptr, uintptr, uintptr) | |
| 6014 | 6014 | var XGFileReplaceContentsFinish func(uintptr, uintptr, *string, **glib.Error) bool | |
| 6015 | 6015 | var XGFileReplaceFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 6016 | - | var XGFileReplaceReadwrite func(uintptr, string, bool, FileCreateFlags, uintptr, **glib.Error) uintptr | |
| 6017 | - | var XGFileReplaceReadwriteAsync func(uintptr, string, bool, FileCreateFlags, int, uintptr, uintptr, uintptr) | |
| 6016 | + | var XGFileReplaceReadwrite func(uintptr, uintptr, bool, FileCreateFlags, uintptr, **glib.Error) uintptr | |
| 6017 | + | var XGFileReplaceReadwriteAsync func(uintptr, uintptr, bool, FileCreateFlags, int, uintptr, uintptr, uintptr) | |
| 6018 | 6018 | var XGFileReplaceReadwriteFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 6019 | 6019 | var XGFileResolveRelativePath func(uintptr, string) uintptr | |
| 6020 | 6020 | var XGFileSetAttribute func(uintptr, string, FileAttributeType, uintptr, FileQueryInfoFlags, uintptr, **glib.Error) bool | |
| @@ -6155,7 +6155,7 @@ func FileNewForUri(UriVar string) *FileBase { | |||
| 6155 | 6155 | return cls | |
| 6156 | 6156 | } | |
| 6157 | 6157 | ||
| 6158 | - | var xFileNewTmp func(string, **FileIOStream, **glib.Error) uintptr | |
| 6158 | + | var xFileNewTmp func(uintptr, **FileIOStream, **glib.Error) uintptr | |
| 6159 | 6159 | ||
| 6160 | 6160 | // Opens a file in the preferred directory for temporary files (as | |
| 6161 | 6161 | // returned by g_get_tmp_dir()) and returns a #GFile and | |
| @@ -6167,11 +6167,11 @@ var xFileNewTmp func(string, **FileIOStream, **glib.Error) uintptr | |||
| 6167 | 6167 | // | |
| 6168 | 6168 | // Unlike the other #GFile constructors, this will return %NULL if | |
| 6169 | 6169 | // a temporary file could not be created. | |
| 6170 | - | func FileNewTmp(TmplVar string, IostreamVar **FileIOStream) (*FileBase, error) { | |
| 6170 | + | func FileNewTmp(TmplVar *string, IostreamVar **FileIOStream) (*FileBase, error) { | |
| 6171 | 6171 | var cls *FileBase | |
| 6172 | 6172 | var cerr *glib.Error | |
| 6173 | 6173 | ||
| 6174 | - | cret := xFileNewTmp(TmplVar, IostreamVar, &cerr) | |
| 6174 | + | cret := xFileNewTmp(core.NullableStringToPtr(TmplVar), IostreamVar, &cerr) | |
| 6175 | 6175 | ||
| 6176 | 6176 | if cret == 0 { | |
| 6177 | 6177 | return nil, cerr | |
| @@ -6185,7 +6185,7 @@ func FileNewTmp(TmplVar string, IostreamVar **FileIOStream) (*FileBase, error) { | |||
| 6185 | 6185 | ||
| 6186 | 6186 | } | |
| 6187 | 6187 | ||
| 6188 | - | var xFileNewTmpAsync func(string, int, uintptr, uintptr, uintptr) | |
| 6188 | + | var xFileNewTmpAsync func(uintptr, int, uintptr, uintptr, uintptr) | |
| 6189 | 6189 | ||
| 6190 | 6190 | // Asynchronously opens a file in the preferred directory for temporary files | |
| 6191 | 6191 | // | |
| @@ -6194,13 +6194,28 @@ var xFileNewTmpAsync func(string, int, uintptr, uintptr, uintptr) | |||
| 6194 | 6194 | // @tmpl should be a string in the GLib file name encoding | |
| 6195 | 6195 | // containing a sequence of six 'X' characters, and containing no | |
| 6196 | 6196 | // directory components. If it is %NULL, a default template is used. | |
| 6197 | - | func FileNewTmpAsync(TmplVar string, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 6197 | + | func FileNewTmpAsync(TmplVar *string, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 6198 | + | ||
| 6199 | + | var CallbackVarRef uintptr | |
| 6200 | + | if CallbackVar != nil { | |
| 6201 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 6202 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 6203 | + | CallbackVarRef = cbRefPtr | |
| 6204 | + | } else { | |
| 6205 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 6206 | + | cbFn := *CallbackVar | |
| 6207 | + | cbFn(arg0, arg1, arg2) | |
| 6208 | + | } | |
| 6209 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 6210 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 6211 | + | } | |
| 6212 | + | } | |
| 6198 | 6213 | ||
| 6199 | - | xFileNewTmpAsync(TmplVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 6214 | + | xFileNewTmpAsync(core.NullableStringToPtr(TmplVar), IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 6200 | 6215 | ||
| 6201 | 6216 | } | |
| 6202 | 6217 | ||
| 6203 | - | var xFileNewTmpDirAsync func(string, int, uintptr, uintptr, uintptr) | |
| 6218 | + | var xFileNewTmpDirAsync func(uintptr, int, uintptr, uintptr, uintptr) | |
| 6204 | 6219 | ||
| 6205 | 6220 | // Asynchronously creates a directory in the preferred directory for | |
| 6206 | 6221 | // temporary files (as returned by g_get_tmp_dir()) as g_dir_make_tmp(). | |
| @@ -6208,9 +6223,24 @@ var xFileNewTmpDirAsync func(string, int, uintptr, uintptr, uintptr) | |||
| 6208 | 6223 | // @tmpl should be a string in the GLib file name encoding | |
| 6209 | 6224 | // containing a sequence of six 'X' characters, and containing no | |
| 6210 | 6225 | // directory components. If it is %NULL, a default template is used. | |
| 6211 | - | func FileNewTmpDirAsync(TmplVar string, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 6226 | + | func FileNewTmpDirAsync(TmplVar *string, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 6227 | + | ||
| 6228 | + | var CallbackVarRef uintptr | |
| 6229 | + | if CallbackVar != nil { | |
| 6230 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 6231 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 6232 | + | CallbackVarRef = cbRefPtr | |
| 6233 | + | } else { | |
| 6234 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 6235 | + | cbFn := *CallbackVar | |
| 6236 | + | cbFn(arg0, arg1, arg2) | |
| 6237 | + | } | |
| 6238 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 6239 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 6240 | + | } | |
| 6241 | + | } | |
| 6212 | 6242 | ||
| 6213 | - | xFileNewTmpDirAsync(TmplVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 6243 | + | xFileNewTmpDirAsync(core.NullableStringToPtr(TmplVar), IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 6214 | 6244 | ||
| 6215 | 6245 | } | |
| 6216 | 6246 | ||
M v4/gio/gfileenumerator.go +32 -2
| @@ -436,7 +436,22 @@ var xFileEnumeratorCloseAsync func(uintptr, int, uintptr, uintptr, uintptr) | |||
| 436 | 436 | // g_file_enumerator_close_finish(). | |
| 437 | 437 | func (x *FileEnumerator) CloseAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 438 | 438 | ||
| 439 | - | xFileEnumeratorCloseAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 439 | + | var CallbackVarRef uintptr | |
| 440 | + | if CallbackVar != nil { | |
| 441 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 442 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 443 | + | CallbackVarRef = cbRefPtr | |
| 444 | + | } else { | |
| 445 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 446 | + | cbFn := *CallbackVar | |
| 447 | + | cbFn(arg0, arg1, arg2) | |
| 448 | + | } | |
| 449 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 450 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 451 | + | } | |
| 452 | + | } | |
| 453 | + | ||
| 454 | + | xFileEnumeratorCloseAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 440 | 455 | ||
| 441 | 456 | } | |
| 442 | 457 | ||
| @@ -688,7 +703,22 @@ var xFileEnumeratorNextFilesAsync func(uintptr, int, int, uintptr, uintptr, uint | |||
| 688 | 703 | // priority is %G_PRIORITY_DEFAULT. | |
| 689 | 704 | func (x *FileEnumerator) NextFilesAsync(NumFilesVar int, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 690 | 705 | ||
| 691 | - | xFileEnumeratorNextFilesAsync(x.GoPointer(), NumFilesVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 706 | + | var CallbackVarRef uintptr | |
| 707 | + | if CallbackVar != nil { | |
| 708 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 709 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 710 | + | CallbackVarRef = cbRefPtr | |
| 711 | + | } else { | |
| 712 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 713 | + | cbFn := *CallbackVar | |
| 714 | + | cbFn(arg0, arg1, arg2) | |
| 715 | + | } | |
| 716 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 717 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 718 | + | } | |
| 719 | + | } | |
| 720 | + | ||
| 721 | + | xFileEnumeratorNextFilesAsync(x.GoPointer(), NumFilesVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 692 | 722 | ||
| 693 | 723 | } | |
| 694 | 724 | ||
M v4/gio/gfileinfo.go +3 -3
| @@ -1249,12 +1249,12 @@ func (x *FileInfo) HasNamespace(NameSpaceVar string) bool { | |||
| 1249 | 1249 | return cret | |
| 1250 | 1250 | } | |
| 1251 | 1251 | ||
| 1252 | - | var xFileInfoListAttributes func(uintptr, string) []string | |
| 1252 | + | var xFileInfoListAttributes func(uintptr, uintptr) []string | |
| 1253 | 1253 | ||
| 1254 | 1254 | // Lists the file info structure's attributes. | |
| 1255 | - | func (x *FileInfo) ListAttributes(NameSpaceVar string) []string { | |
| 1255 | + | func (x *FileInfo) ListAttributes(NameSpaceVar *string) []string { | |
| 1256 | 1256 | ||
| 1257 | - | cret := xFileInfoListAttributes(x.GoPointer(), NameSpaceVar) | |
| 1257 | + | cret := xFileInfoListAttributes(x.GoPointer(), core.NullableStringToPtr(NameSpaceVar)) | |
| 1258 | 1258 | return cret | |
| 1259 | 1259 | } | |
| 1260 | 1260 | ||
M v4/gio/gfileinputstream.go +16 -1
| @@ -389,7 +389,22 @@ var xFileInputStreamQueryInfoAsync func(uintptr, string, int, uintptr, uintptr, | |||
| 389 | 389 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be set | |
| 390 | 390 | func (x *FileInputStream) QueryInfoAsync(AttributesVar string, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 391 | 391 | ||
| 392 | - | xFileInputStreamQueryInfoAsync(x.GoPointer(), AttributesVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 392 | + | var CallbackVarRef uintptr | |
| 393 | + | if CallbackVar != nil { | |
| 394 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 395 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 396 | + | CallbackVarRef = cbRefPtr | |
| 397 | + | } else { | |
| 398 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 399 | + | cbFn := *CallbackVar | |
| 400 | + | cbFn(arg0, arg1, arg2) | |
| 401 | + | } | |
| 402 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 403 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 404 | + | } | |
| 405 | + | } | |
| 406 | + | ||
| 407 | + | xFileInputStreamQueryInfoAsync(x.GoPointer(), AttributesVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 393 | 408 | ||
| 394 | 409 | } | |
| 395 | 410 | ||
M v4/gio/gfileiostream.go +16 -1
| @@ -492,7 +492,22 @@ var xFileIOStreamQueryInfoAsync func(uintptr, string, int, uintptr, uintptr, uin | |||
| 492 | 492 | // g_file_io_stream_query_info(). | |
| 493 | 493 | func (x *FileIOStream) QueryInfoAsync(AttributesVar string, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 494 | 494 | ||
| 495 | - | xFileIOStreamQueryInfoAsync(x.GoPointer(), AttributesVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 495 | + | var CallbackVarRef uintptr | |
| 496 | + | if CallbackVar != nil { | |
| 497 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 498 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 499 | + | CallbackVarRef = cbRefPtr | |
| 500 | + | } else { | |
| 501 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 502 | + | cbFn := *CallbackVar | |
| 503 | + | cbFn(arg0, arg1, arg2) | |
| 504 | + | } | |
| 505 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 506 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 507 | + | } | |
| 508 | + | } | |
| 509 | + | ||
| 510 | + | xFileIOStreamQueryInfoAsync(x.GoPointer(), AttributesVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 496 | 511 | ||
| 497 | 512 | } | |
| 498 | 513 | ||
M v4/gio/gfileoutputstream.go +16 -1
| @@ -487,7 +487,22 @@ var xFileOutputStreamQueryInfoAsync func(uintptr, string, int, uintptr, uintptr, | |||
| 487 | 487 | // g_file_output_stream_query_info(). | |
| 488 | 488 | func (x *FileOutputStream) QueryInfoAsync(AttributesVar string, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 489 | 489 | ||
| 490 | - | xFileOutputStreamQueryInfoAsync(x.GoPointer(), AttributesVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 490 | + | var CallbackVarRef uintptr | |
| 491 | + | if CallbackVar != nil { | |
| 492 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 493 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 494 | + | CallbackVarRef = cbRefPtr | |
| 495 | + | } else { | |
| 496 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 497 | + | cbFn := *CallbackVar | |
| 498 | + | cbFn(arg0, arg1, arg2) | |
| 499 | + | } | |
| 500 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 501 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 502 | + | } | |
| 503 | + | } | |
| 504 | + | ||
| 505 | + | xFileOutputStreamQueryInfoAsync(x.GoPointer(), AttributesVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 491 | 506 | ||
| 492 | 507 | } | |
| 493 | 508 | ||
M v4/gio/ginputstream.go +80 -5
| @@ -468,7 +468,22 @@ var xInputStreamCloseAsync func(uintptr, int, uintptr, uintptr, uintptr) | |||
| 468 | 468 | // override one you must override all. | |
| 469 | 469 | func (x *InputStream) CloseAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 470 | 470 | ||
| 471 | - | xInputStreamCloseAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 471 | + | var CallbackVarRef uintptr | |
| 472 | + | if CallbackVar != nil { | |
| 473 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 474 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 475 | + | CallbackVarRef = cbRefPtr | |
| 476 | + | } else { | |
| 477 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 478 | + | cbFn := *CallbackVar | |
| 479 | + | cbFn(arg0, arg1, arg2) | |
| 480 | + | } | |
| 481 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 482 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 483 | + | } | |
| 484 | + | } | |
| 485 | + | ||
| 486 | + | xInputStreamCloseAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 472 | 487 | ||
| 473 | 488 | } | |
| 474 | 489 | ||
| @@ -584,7 +599,22 @@ var xInputStreamReadAllAsync func(uintptr, *[]byte, uint, int, uintptr, uintptr, | |||
| 584 | 599 | // priority. Default priority is %G_PRIORITY_DEFAULT. | |
| 585 | 600 | func (x *InputStream) ReadAllAsync(BufferVar *[]byte, CountVar uint, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 586 | 601 | ||
| 587 | - | xInputStreamReadAllAsync(x.GoPointer(), BufferVar, CountVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 602 | + | var CallbackVarRef uintptr | |
| 603 | + | if CallbackVar != nil { | |
| 604 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 605 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 606 | + | CallbackVarRef = cbRefPtr | |
| 607 | + | } else { | |
| 608 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 609 | + | cbFn := *CallbackVar | |
| 610 | + | cbFn(arg0, arg1, arg2) | |
| 611 | + | } | |
| 612 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 613 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 614 | + | } | |
| 615 | + | } | |
| 616 | + | ||
| 617 | + | xInputStreamReadAllAsync(x.GoPointer(), BufferVar, CountVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 588 | 618 | ||
| 589 | 619 | } | |
| 590 | 620 | ||
| @@ -637,7 +667,22 @@ var xInputStreamReadAsync func(uintptr, *[]byte, uint, int, uintptr, uintptr, ui | |||
| 637 | 667 | // override one you must override all. | |
| 638 | 668 | func (x *InputStream) ReadAsync(BufferVar *[]byte, CountVar uint, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 639 | 669 | ||
| 640 | - | xInputStreamReadAsync(x.GoPointer(), BufferVar, CountVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 670 | + | var CallbackVarRef uintptr | |
| 671 | + | if CallbackVar != nil { | |
| 672 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 673 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 674 | + | CallbackVarRef = cbRefPtr | |
| 675 | + | } else { | |
| 676 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 677 | + | cbFn := *CallbackVar | |
| 678 | + | cbFn(arg0, arg1, arg2) | |
| 679 | + | } | |
| 680 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 681 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 682 | + | } | |
| 683 | + | } | |
| 684 | + | ||
| 685 | + | xInputStreamReadAsync(x.GoPointer(), BufferVar, CountVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 641 | 686 | ||
| 642 | 687 | } | |
| 643 | 688 | ||
| @@ -701,7 +746,22 @@ var xInputStreamReadBytesAsync func(uintptr, uint, int, uintptr, uintptr, uintpt | |||
| 701 | 746 | // priority. Default priority is %G_PRIORITY_DEFAULT. | |
| 702 | 747 | func (x *InputStream) ReadBytesAsync(CountVar uint, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 703 | 748 | ||
| 704 | - | xInputStreamReadBytesAsync(x.GoPointer(), CountVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 749 | + | var CallbackVarRef uintptr | |
| 750 | + | if CallbackVar != nil { | |
| 751 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 752 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 753 | + | CallbackVarRef = cbRefPtr | |
| 754 | + | } else { | |
| 755 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 756 | + | cbFn := *CallbackVar | |
| 757 | + | cbFn(arg0, arg1, arg2) | |
| 758 | + | } | |
| 759 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 760 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 761 | + | } | |
| 762 | + | } | |
| 763 | + | ||
| 764 | + | xInputStreamReadBytesAsync(x.GoPointer(), CountVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 705 | 765 | ||
| 706 | 766 | } | |
| 707 | 767 | ||
| @@ -803,7 +863,22 @@ var xInputStreamSkipAsync func(uintptr, uint, int, uintptr, uintptr, uintptr) | |||
| 803 | 863 | // However, if you override one, you must override all. | |
| 804 | 864 | func (x *InputStream) SkipAsync(CountVar uint, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 805 | 865 | ||
| 806 | - | xInputStreamSkipAsync(x.GoPointer(), CountVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 866 | + | var CallbackVarRef uintptr | |
| 867 | + | if CallbackVar != nil { | |
| 868 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 869 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 870 | + | CallbackVarRef = cbRefPtr | |
| 871 | + | } else { | |
| 872 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 873 | + | cbFn := *CallbackVar | |
| 874 | + | cbFn(arg0, arg1, arg2) | |
| 875 | + | } | |
| 876 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 877 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 878 | + | } | |
| 879 | + | } | |
| 880 | + | ||
| 881 | + | xInputStreamSkipAsync(x.GoPointer(), CountVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 807 | 882 | ||
| 808 | 883 | } | |
| 809 | 884 | ||
M v4/gio/gioscheduler.go +33 -1
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | package gio | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 5 | 7 | "github.com/jwijenbergh/purego" | |
| 6 | 8 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 9 | "github.com/jwijenbergh/puregotk/v4/glib" | |
| @@ -31,7 +33,37 @@ var xIoSchedulerPushJob func(uintptr, uintptr, uintptr, int, uintptr) | |||
| 31 | 33 | // g_io_scheduler_cancel_all_jobs(). | |
| 32 | 34 | func IoSchedulerPushJob(JobFuncVar *IOSchedulerJobFunc, UserDataVar uintptr, NotifyVar *glib.DestroyNotify, IoPriorityVar int, CancellableVar *Cancellable) { | |
| 33 | 35 | ||
| 34 | - | xIoSchedulerPushJob(glib.NewCallback(JobFuncVar), UserDataVar, glib.NewCallbackNullable(NotifyVar), IoPriorityVar, CancellableVar.GoPointer()) | |
| 36 | + | var JobFuncVarRef uintptr | |
| 37 | + | if JobFuncVar != nil { | |
| 38 | + | JobFuncVarPtr := uintptr(unsafe.Pointer(JobFuncVar)) | |
| 39 | + | if cbRefPtr, ok := glib.GetCallback(JobFuncVarPtr); ok { | |
| 40 | + | JobFuncVarRef = cbRefPtr | |
| 41 | + | } else { | |
| 42 | + | fcb := func(arg0 *IOSchedulerJob, arg1 uintptr, arg2 uintptr) bool { | |
| 43 | + | cbFn := *JobFuncVar | |
| 44 | + | return cbFn(arg0, arg1, arg2) | |
| 45 | + | } | |
| 46 | + | JobFuncVarRef = purego.NewCallback(fcb) | |
| 47 | + | glib.SaveCallback(JobFuncVarPtr, JobFuncVarRef) | |
| 48 | + | } | |
| 49 | + | } | |
| 50 | + | ||
| 51 | + | var NotifyVarRef uintptr | |
| 52 | + | if NotifyVar != nil { | |
| 53 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 54 | + | if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok { | |
| 55 | + | NotifyVarRef = cbRefPtr | |
| 56 | + | } else { | |
| 57 | + | fcb := func(arg0 uintptr) { | |
| 58 | + | cbFn := *NotifyVar | |
| 59 | + | cbFn(arg0) | |
| 60 | + | } | |
| 61 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 62 | + | glib.SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 63 | + | } | |
| 64 | + | } | |
| 65 | + | ||
| 66 | + | xIoSchedulerPushJob(JobFuncVarRef, UserDataVar, NotifyVarRef, IoPriorityVar, CancellableVar.GoPointer()) | |
| 35 | 67 | ||
| 36 | 68 | } | |
| 37 | 69 | ||
M v4/gio/giostream.go +32 -2
| @@ -558,7 +558,22 @@ var xIOStreamCloseAsync func(uintptr, int, uintptr, uintptr, uintptr) | |||
| 558 | 558 | // classes. However, if you override one you must override all. | |
| 559 | 559 | func (x *IOStream) CloseAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 560 | 560 | ||
| 561 | - | xIOStreamCloseAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 561 | + | var CallbackVarRef uintptr | |
| 562 | + | if CallbackVar != nil { | |
| 563 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 564 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 565 | + | CallbackVarRef = cbRefPtr | |
| 566 | + | } else { | |
| 567 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 568 | + | cbFn := *CallbackVar | |
| 569 | + | cbFn(arg0, arg1, arg2) | |
| 570 | + | } | |
| 571 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 572 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 573 | + | } | |
| 574 | + | } | |
| 575 | + | ||
| 576 | + | xIOStreamCloseAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 562 | 577 | ||
| 563 | 578 | } | |
| 564 | 579 | ||
| @@ -657,7 +672,22 @@ var xIOStreamSpliceAsync func(uintptr, uintptr, IOStreamSpliceFlags, int, uintpt | |||
| 657 | 672 | // result of the operation. | |
| 658 | 673 | func (x *IOStream) SpliceAsync(Stream2Var *IOStream, FlagsVar IOStreamSpliceFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 659 | 674 | ||
| 660 | - | xIOStreamSpliceAsync(x.GoPointer(), Stream2Var.GoPointer(), FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 675 | + | var CallbackVarRef uintptr | |
| 676 | + | if CallbackVar != nil { | |
| 677 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 678 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 679 | + | CallbackVarRef = cbRefPtr | |
| 680 | + | } else { | |
| 681 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 682 | + | cbFn := *CallbackVar | |
| 683 | + | cbFn(arg0, arg1, arg2) | |
| 684 | + | } | |
| 685 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 686 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 687 | + | } | |
| 688 | + | } | |
| 689 | + | ||
| 690 | + | xIOStreamSpliceAsync(x.GoPointer(), Stream2Var.GoPointer(), FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 661 | 691 | ||
| 662 | 692 | } | |
| 663 | 693 | ||
M v4/gio/giotypes.go +62 -2
| @@ -400,7 +400,37 @@ var xIOSchedulerJobSendToMainloop func(uintptr, uintptr, uintptr, uintptr) bool | |||
| 400 | 400 | // blocking the I/O job). | |
| 401 | 401 | func (x *IOSchedulerJob) SendToMainloop(FuncVar *glib.SourceFunc, UserDataVar uintptr, NotifyVar *glib.DestroyNotify) bool { | |
| 402 | 402 | ||
| 403 | - | cret := xIOSchedulerJobSendToMainloop(x.GoPointer(), glib.NewCallback(FuncVar), UserDataVar, glib.NewCallbackNullable(NotifyVar)) | |
| 403 | + | var FuncVarRef uintptr | |
| 404 | + | if FuncVar != nil { | |
| 405 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 406 | + | if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok { | |
| 407 | + | FuncVarRef = cbRefPtr | |
| 408 | + | } else { | |
| 409 | + | fcb := func(arg0 uintptr) bool { | |
| 410 | + | cbFn := *FuncVar | |
| 411 | + | return cbFn(arg0) | |
| 412 | + | } | |
| 413 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 414 | + | glib.SaveCallback(FuncVarPtr, FuncVarRef) | |
| 415 | + | } | |
| 416 | + | } | |
| 417 | + | ||
| 418 | + | var NotifyVarRef uintptr | |
| 419 | + | if NotifyVar != nil { | |
| 420 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 421 | + | if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok { | |
| 422 | + | NotifyVarRef = cbRefPtr | |
| 423 | + | } else { | |
| 424 | + | fcb := func(arg0 uintptr) { | |
| 425 | + | cbFn := *NotifyVar | |
| 426 | + | cbFn(arg0) | |
| 427 | + | } | |
| 428 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 429 | + | glib.SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 430 | + | } | |
| 431 | + | } | |
| 432 | + | ||
| 433 | + | cret := xIOSchedulerJobSendToMainloop(x.GoPointer(), FuncVarRef, UserDataVar, NotifyVarRef) | |
| 404 | 434 | return cret | |
| 405 | 435 | } | |
| 406 | 436 | ||
| @@ -417,7 +447,37 @@ var xIOSchedulerJobSendToMainloopAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 417 | 447 | // g_io_scheduler_push_job() or by using refcounting for @user_data. | |
| 418 | 448 | func (x *IOSchedulerJob) SendToMainloopAsync(FuncVar *glib.SourceFunc, UserDataVar uintptr, NotifyVar *glib.DestroyNotify) { | |
| 419 | 449 | ||
| 420 | - | xIOSchedulerJobSendToMainloopAsync(x.GoPointer(), glib.NewCallback(FuncVar), UserDataVar, glib.NewCallbackNullable(NotifyVar)) | |
| 450 | + | var FuncVarRef uintptr | |
| 451 | + | if FuncVar != nil { | |
| 452 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 453 | + | if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok { | |
| 454 | + | FuncVarRef = cbRefPtr | |
| 455 | + | } else { | |
| 456 | + | fcb := func(arg0 uintptr) bool { | |
| 457 | + | cbFn := *FuncVar | |
| 458 | + | return cbFn(arg0) | |
| 459 | + | } | |
| 460 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 461 | + | glib.SaveCallback(FuncVarPtr, FuncVarRef) | |
| 462 | + | } | |
| 463 | + | } | |
| 464 | + | ||
| 465 | + | var NotifyVarRef uintptr | |
| 466 | + | if NotifyVar != nil { | |
| 467 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 468 | + | if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok { | |
| 469 | + | NotifyVarRef = cbRefPtr | |
| 470 | + | } else { | |
| 471 | + | fcb := func(arg0 uintptr) { | |
| 472 | + | cbFn := *NotifyVar | |
| 473 | + | cbFn(arg0) | |
| 474 | + | } | |
| 475 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 476 | + | glib.SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 477 | + | } | |
| 478 | + | } | |
| 479 | + | ||
| 480 | + | xIOSchedulerJobSendToMainloopAsync(x.GoPointer(), FuncVarRef, UserDataVar, NotifyVarRef) | |
| 421 | 481 | ||
| 422 | 482 | } | |
| 423 | 483 | ||
M v4/gio/gliststore.go +64 -4
| @@ -100,7 +100,22 @@ var xListStoreFindWithEqualFunc func(uintptr, uintptr, uintptr, *uint) bool | |||
| 100 | 100 | // Since GLib 2.76 it is possible to pass `NULL` for @item. | |
| 101 | 101 | func (x *ListStore) FindWithEqualFunc(ItemVar *gobject.Object, EqualFuncVar *glib.EqualFunc, PositionVar *uint) bool { | |
| 102 | 102 | ||
| 103 | - | cret := xListStoreFindWithEqualFunc(x.GoPointer(), ItemVar.GoPointer(), glib.NewCallback(EqualFuncVar), PositionVar) | |
| 103 | + | var EqualFuncVarRef uintptr | |
| 104 | + | if EqualFuncVar != nil { | |
| 105 | + | EqualFuncVarPtr := uintptr(unsafe.Pointer(EqualFuncVar)) | |
| 106 | + | if cbRefPtr, ok := glib.GetCallback(EqualFuncVarPtr); ok { | |
| 107 | + | EqualFuncVarRef = cbRefPtr | |
| 108 | + | } else { | |
| 109 | + | fcb := func(arg0 uintptr, arg1 uintptr) bool { | |
| 110 | + | cbFn := *EqualFuncVar | |
| 111 | + | return cbFn(arg0, arg1) | |
| 112 | + | } | |
| 113 | + | EqualFuncVarRef = purego.NewCallback(fcb) | |
| 114 | + | glib.SaveCallback(EqualFuncVarPtr, EqualFuncVarRef) | |
| 115 | + | } | |
| 116 | + | } | |
| 117 | + | ||
| 118 | + | cret := xListStoreFindWithEqualFunc(x.GoPointer(), ItemVar.GoPointer(), EqualFuncVarRef, PositionVar) | |
| 104 | 119 | return cret | |
| 105 | 120 | } | |
| 106 | 121 | ||
| @@ -114,7 +129,22 @@ var xListStoreFindWithEqualFuncFull func(uintptr, uintptr, uintptr, uintptr, *ui | |||
| 114 | 129 | // Since GLib 2.76 it is possible to pass `NULL` for @item. | |
| 115 | 130 | func (x *ListStore) FindWithEqualFuncFull(ItemVar *gobject.Object, EqualFuncVar *glib.EqualFuncFull, UserDataVar uintptr, PositionVar *uint) bool { | |
| 116 | 131 | ||
| 117 | - | cret := xListStoreFindWithEqualFuncFull(x.GoPointer(), ItemVar.GoPointer(), glib.NewCallback(EqualFuncVar), UserDataVar, PositionVar) | |
| 132 | + | var EqualFuncVarRef uintptr | |
| 133 | + | if EqualFuncVar != nil { | |
| 134 | + | EqualFuncVarPtr := uintptr(unsafe.Pointer(EqualFuncVar)) | |
| 135 | + | if cbRefPtr, ok := glib.GetCallback(EqualFuncVarPtr); ok { | |
| 136 | + | EqualFuncVarRef = cbRefPtr | |
| 137 | + | } else { | |
| 138 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) bool { | |
| 139 | + | cbFn := *EqualFuncVar | |
| 140 | + | return cbFn(arg0, arg1, arg2) | |
| 141 | + | } | |
| 142 | + | EqualFuncVarRef = purego.NewCallback(fcb) | |
| 143 | + | glib.SaveCallback(EqualFuncVarPtr, EqualFuncVarRef) | |
| 144 | + | } | |
| 145 | + | } | |
| 146 | + | ||
| 147 | + | cret := xListStoreFindWithEqualFuncFull(x.GoPointer(), ItemVar.GoPointer(), EqualFuncVarRef, UserDataVar, PositionVar) | |
| 118 | 148 | return cret | |
| 119 | 149 | } | |
| 120 | 150 | ||
| @@ -146,7 +176,22 @@ var xListStoreInsertSorted func(uintptr, uintptr, uintptr, uintptr) uint | |||
| 146 | 176 | // This function takes a ref on @item. | |
| 147 | 177 | func (x *ListStore) InsertSorted(ItemVar *gobject.Object, CompareFuncVar *glib.CompareDataFunc, UserDataVar uintptr) uint { | |
| 148 | 178 | ||
| 149 | - | cret := xListStoreInsertSorted(x.GoPointer(), ItemVar.GoPointer(), glib.NewCallback(CompareFuncVar), UserDataVar) | |
| 179 | + | var CompareFuncVarRef uintptr | |
| 180 | + | if CompareFuncVar != nil { | |
| 181 | + | CompareFuncVarPtr := uintptr(unsafe.Pointer(CompareFuncVar)) | |
| 182 | + | if cbRefPtr, ok := glib.GetCallback(CompareFuncVarPtr); ok { | |
| 183 | + | CompareFuncVarRef = cbRefPtr | |
| 184 | + | } else { | |
| 185 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 186 | + | cbFn := *CompareFuncVar | |
| 187 | + | return cbFn(arg0, arg1, arg2) | |
| 188 | + | } | |
| 189 | + | CompareFuncVarRef = purego.NewCallback(fcb) | |
| 190 | + | glib.SaveCallback(CompareFuncVarPtr, CompareFuncVarRef) | |
| 191 | + | } | |
| 192 | + | } | |
| 193 | + | ||
| 194 | + | cret := xListStoreInsertSorted(x.GoPointer(), ItemVar.GoPointer(), CompareFuncVarRef, UserDataVar) | |
| 150 | 195 | return cret | |
| 151 | 196 | } | |
| 152 | 197 | ||
| @@ -177,7 +222,22 @@ var xListStoreSort func(uintptr, uintptr, uintptr) | |||
| 177 | 222 | // Sort the items in @store according to @compare_func. | |
| 178 | 223 | func (x *ListStore) Sort(CompareFuncVar *glib.CompareDataFunc, UserDataVar uintptr) { | |
| 179 | 224 | ||
| 180 | - | xListStoreSort(x.GoPointer(), glib.NewCallback(CompareFuncVar), UserDataVar) | |
| 225 | + | var CompareFuncVarRef uintptr | |
| 226 | + | if CompareFuncVar != nil { | |
| 227 | + | CompareFuncVarPtr := uintptr(unsafe.Pointer(CompareFuncVar)) | |
| 228 | + | if cbRefPtr, ok := glib.GetCallback(CompareFuncVarPtr); ok { | |
| 229 | + | CompareFuncVarRef = cbRefPtr | |
| 230 | + | } else { | |
| 231 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 232 | + | cbFn := *CompareFuncVar | |
| 233 | + | return cbFn(arg0, arg1, arg2) | |
| 234 | + | } | |
| 235 | + | CompareFuncVarRef = purego.NewCallback(fcb) | |
| 236 | + | glib.SaveCallback(CompareFuncVarPtr, CompareFuncVarRef) | |
| 237 | + | } | |
| 238 | + | } | |
| 239 | + | ||
| 240 | + | xListStoreSort(x.GoPointer(), CompareFuncVarRef, UserDataVar) | |
| 181 | 241 | ||
| 182 | 242 | } | |
| 183 | 243 | ||
M v4/gio/gmemoryinputstream.go +32 -2
| @@ -213,7 +213,22 @@ var xNewMemoryInputStreamFromData func([]byte, int, uintptr) uintptr | |||
| 213 | 213 | func NewMemoryInputStreamFromData(DataVar []byte, LenVar int, DestroyVar *glib.DestroyNotify) *MemoryInputStream { | |
| 214 | 214 | var cls *MemoryInputStream | |
| 215 | 215 | ||
| 216 | - | cret := xNewMemoryInputStreamFromData(DataVar, LenVar, glib.NewCallbackNullable(DestroyVar)) | |
| 216 | + | var DestroyVarRef uintptr | |
| 217 | + | if DestroyVar != nil { | |
| 218 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 219 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 220 | + | DestroyVarRef = cbRefPtr | |
| 221 | + | } else { | |
| 222 | + | fcb := func(arg0 uintptr) { | |
| 223 | + | cbFn := *DestroyVar | |
| 224 | + | cbFn(arg0) | |
| 225 | + | } | |
| 226 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 227 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 228 | + | } | |
| 229 | + | } | |
| 230 | + | ||
| 231 | + | cret := xNewMemoryInputStreamFromData(DataVar, LenVar, DestroyVarRef) | |
| 217 | 232 | ||
| 218 | 233 | if cret == 0 { | |
| 219 | 234 | return nil | |
| @@ -237,7 +252,22 @@ var xMemoryInputStreamAddData func(uintptr, []byte, int, uintptr) | |||
| 237 | 252 | // Appends @data to data that can be read from the input stream | |
| 238 | 253 | func (x *MemoryInputStream) AddData(DataVar []byte, LenVar int, DestroyVar *glib.DestroyNotify) { | |
| 239 | 254 | ||
| 240 | - | xMemoryInputStreamAddData(x.GoPointer(), DataVar, LenVar, glib.NewCallbackNullable(DestroyVar)) | |
| 255 | + | var DestroyVarRef uintptr | |
| 256 | + | if DestroyVar != nil { | |
| 257 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 258 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 259 | + | DestroyVarRef = cbRefPtr | |
| 260 | + | } else { | |
| 261 | + | fcb := func(arg0 uintptr) { | |
| 262 | + | cbFn := *DestroyVar | |
| 263 | + | cbFn(arg0) | |
| 264 | + | } | |
| 265 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 266 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 267 | + | } | |
| 268 | + | } | |
| 269 | + | ||
| 270 | + | xMemoryInputStreamAddData(x.GoPointer(), DataVar, LenVar, DestroyVarRef) | |
| 241 | 271 | ||
| 242 | 272 | } | |
| 243 | 273 | ||
M v4/gio/gmemoryoutputstream.go +31 -1
| @@ -228,7 +228,37 @@ var xNewMemoryOutputStream func(uintptr, uint, uintptr, uintptr) uintptr | |||
| 228 | 228 | func NewMemoryOutputStream(DataVar uintptr, SizeVar uint, ReallocFunctionVar *ReallocFunc, DestroyFunctionVar *glib.DestroyNotify) *MemoryOutputStream { | |
| 229 | 229 | var cls *MemoryOutputStream | |
| 230 | 230 | ||
| 231 | - | cret := xNewMemoryOutputStream(DataVar, SizeVar, glib.NewCallbackNullable(ReallocFunctionVar), glib.NewCallbackNullable(DestroyFunctionVar)) | |
| 231 | + | var ReallocFunctionVarRef uintptr | |
| 232 | + | if ReallocFunctionVar != nil { | |
| 233 | + | ReallocFunctionVarPtr := uintptr(unsafe.Pointer(ReallocFunctionVar)) | |
| 234 | + | if cbRefPtr, ok := glib.GetCallback(ReallocFunctionVarPtr); ok { | |
| 235 | + | ReallocFunctionVarRef = cbRefPtr | |
| 236 | + | } else { | |
| 237 | + | fcb := func(arg0 uintptr, arg1 uint) uintptr { | |
| 238 | + | cbFn := *ReallocFunctionVar | |
| 239 | + | return cbFn(arg0, arg1) | |
| 240 | + | } | |
| 241 | + | ReallocFunctionVarRef = purego.NewCallback(fcb) | |
| 242 | + | glib.SaveCallback(ReallocFunctionVarPtr, ReallocFunctionVarRef) | |
| 243 | + | } | |
| 244 | + | } | |
| 245 | + | ||
| 246 | + | var DestroyFunctionVarRef uintptr | |
| 247 | + | if DestroyFunctionVar != nil { | |
| 248 | + | DestroyFunctionVarPtr := uintptr(unsafe.Pointer(DestroyFunctionVar)) | |
| 249 | + | if cbRefPtr, ok := glib.GetCallback(DestroyFunctionVarPtr); ok { | |
| 250 | + | DestroyFunctionVarRef = cbRefPtr | |
| 251 | + | } else { | |
| 252 | + | fcb := func(arg0 uintptr) { | |
| 253 | + | cbFn := *DestroyFunctionVar | |
| 254 | + | cbFn(arg0) | |
| 255 | + | } | |
| 256 | + | DestroyFunctionVarRef = purego.NewCallback(fcb) | |
| 257 | + | glib.SaveCallback(DestroyFunctionVarPtr, DestroyFunctionVarRef) | |
| 258 | + | } | |
| 259 | + | } | |
| 260 | + | ||
| 261 | + | cret := xNewMemoryOutputStream(DataVar, SizeVar, ReallocFunctionVarRef, DestroyFunctionVarRef) | |
| 232 | 262 | ||
| 233 | 263 | if cret == 0 { | |
| 234 | 264 | return nil | |
M v4/gio/gmenu.go +48 -48
| @@ -51,14 +51,14 @@ func NewMenu() *Menu { | |||
| 51 | 51 | return cls | |
| 52 | 52 | } | |
| 53 | 53 | ||
| 54 | - | var xMenuAppend func(uintptr, string, string) | |
| 54 | + | var xMenuAppend func(uintptr, uintptr, uintptr) | |
| 55 | 55 | ||
| 56 | 56 | // Convenience function for appending a normal menu item to the end of | |
| 57 | 57 | // @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more | |
| 58 | 58 | // flexible alternative. | |
| 59 | - | func (x *Menu) Append(LabelVar string, DetailedActionVar string) { | |
| 59 | + | func (x *Menu) Append(LabelVar *string, DetailedActionVar *string) { | |
| 60 | 60 | ||
| 61 | - | xMenuAppend(x.GoPointer(), LabelVar, DetailedActionVar) | |
| 61 | + | xMenuAppend(x.GoPointer(), core.NullableStringToPtr(LabelVar), core.NullableStringToPtr(DetailedActionVar)) | |
| 62 | 62 | ||
| 63 | 63 | } | |
| 64 | 64 | ||
| @@ -73,25 +73,25 @@ func (x *Menu) AppendItem(ItemVar *MenuItem) { | |||
| 73 | 73 | ||
| 74 | 74 | } | |
| 75 | 75 | ||
| 76 | - | var xMenuAppendSection func(uintptr, string, uintptr) | |
| 76 | + | var xMenuAppendSection func(uintptr, uintptr, uintptr) | |
| 77 | 77 | ||
| 78 | 78 | // Convenience function for appending a section menu item to the end of | |
| 79 | 79 | // @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for a | |
| 80 | 80 | // more flexible alternative. | |
| 81 | - | func (x *Menu) AppendSection(LabelVar string, SectionVar *MenuModel) { | |
| 81 | + | func (x *Menu) AppendSection(LabelVar *string, SectionVar *MenuModel) { | |
| 82 | 82 | ||
| 83 | - | xMenuAppendSection(x.GoPointer(), LabelVar, SectionVar.GoPointer()) | |
| 83 | + | xMenuAppendSection(x.GoPointer(), core.NullableStringToPtr(LabelVar), SectionVar.GoPointer()) | |
| 84 | 84 | ||
| 85 | 85 | } | |
| 86 | 86 | ||
| 87 | - | var xMenuAppendSubmenu func(uintptr, string, uintptr) | |
| 87 | + | var xMenuAppendSubmenu func(uintptr, uintptr, uintptr) | |
| 88 | 88 | ||
| 89 | 89 | // Convenience function for appending a submenu menu item to the end of | |
| 90 | 90 | // @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for a | |
| 91 | 91 | // more flexible alternative. | |
| 92 | - | func (x *Menu) AppendSubmenu(LabelVar string, SubmenuVar *MenuModel) { | |
| 92 | + | func (x *Menu) AppendSubmenu(LabelVar *string, SubmenuVar *MenuModel) { | |
| 93 | 93 | ||
| 94 | - | xMenuAppendSubmenu(x.GoPointer(), LabelVar, SubmenuVar.GoPointer()) | |
| 94 | + | xMenuAppendSubmenu(x.GoPointer(), core.NullableStringToPtr(LabelVar), SubmenuVar.GoPointer()) | |
| 95 | 95 | ||
| 96 | 96 | } | |
| 97 | 97 | ||
| @@ -111,14 +111,14 @@ func (x *Menu) Freeze() { | |||
| 111 | 111 | ||
| 112 | 112 | } | |
| 113 | 113 | ||
| 114 | - | var xMenuInsert func(uintptr, int, string, string) | |
| 114 | + | var xMenuInsert func(uintptr, int, uintptr, uintptr) | |
| 115 | 115 | ||
| 116 | 116 | // Convenience function for inserting a normal menu item into @menu. | |
| 117 | 117 | // Combine g_menu_item_new() and g_menu_insert_item() for a more flexible | |
| 118 | 118 | // alternative. | |
| 119 | - | func (x *Menu) Insert(PositionVar int, LabelVar string, DetailedActionVar string) { | |
| 119 | + | func (x *Menu) Insert(PositionVar int, LabelVar *string, DetailedActionVar *string) { | |
| 120 | 120 | ||
| 121 | - | xMenuInsert(x.GoPointer(), PositionVar, LabelVar, DetailedActionVar) | |
| 121 | + | xMenuInsert(x.GoPointer(), PositionVar, core.NullableStringToPtr(LabelVar), core.NullableStringToPtr(DetailedActionVar)) | |
| 122 | 122 | ||
| 123 | 123 | } | |
| 124 | 124 | ||
| @@ -147,36 +147,36 @@ func (x *Menu) InsertItem(PositionVar int, ItemVar *MenuItem) { | |||
| 147 | 147 | ||
| 148 | 148 | } | |
| 149 | 149 | ||
| 150 | - | var xMenuInsertSection func(uintptr, int, string, uintptr) | |
| 150 | + | var xMenuInsertSection func(uintptr, int, uintptr, uintptr) | |
| 151 | 151 | ||
| 152 | 152 | // Convenience function for inserting a section menu item into @menu. | |
| 153 | 153 | // Combine g_menu_item_new_section() and g_menu_insert_item() for a more | |
| 154 | 154 | // flexible alternative. | |
| 155 | - | func (x *Menu) InsertSection(PositionVar int, LabelVar string, SectionVar *MenuModel) { | |
| 155 | + | func (x *Menu) InsertSection(PositionVar int, LabelVar *string, SectionVar *MenuModel) { | |
| 156 | 156 | ||
| 157 | - | xMenuInsertSection(x.GoPointer(), PositionVar, LabelVar, SectionVar.GoPointer()) | |
| 157 | + | xMenuInsertSection(x.GoPointer(), PositionVar, core.NullableStringToPtr(LabelVar), SectionVar.GoPointer()) | |
| 158 | 158 | ||
| 159 | 159 | } | |
| 160 | 160 | ||
| 161 | - | var xMenuInsertSubmenu func(uintptr, int, string, uintptr) | |
| 161 | + | var xMenuInsertSubmenu func(uintptr, int, uintptr, uintptr) | |
| 162 | 162 | ||
| 163 | 163 | // Convenience function for inserting a submenu menu item into @menu. | |
| 164 | 164 | // Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more | |
| 165 | 165 | // flexible alternative. | |
| 166 | - | func (x *Menu) InsertSubmenu(PositionVar int, LabelVar string, SubmenuVar *MenuModel) { | |
| 166 | + | func (x *Menu) InsertSubmenu(PositionVar int, LabelVar *string, SubmenuVar *MenuModel) { | |
| 167 | 167 | ||
| 168 | - | xMenuInsertSubmenu(x.GoPointer(), PositionVar, LabelVar, SubmenuVar.GoPointer()) | |
| 168 | + | xMenuInsertSubmenu(x.GoPointer(), PositionVar, core.NullableStringToPtr(LabelVar), SubmenuVar.GoPointer()) | |
| 169 | 169 | ||
| 170 | 170 | } | |
| 171 | 171 | ||
| 172 | - | var xMenuPrepend func(uintptr, string, string) | |
| 172 | + | var xMenuPrepend func(uintptr, uintptr, uintptr) | |
| 173 | 173 | ||
| 174 | 174 | // Convenience function for prepending a normal menu item to the start | |
| 175 | 175 | // of @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more | |
| 176 | 176 | // flexible alternative. | |
| 177 | - | func (x *Menu) Prepend(LabelVar string, DetailedActionVar string) { | |
| 177 | + | func (x *Menu) Prepend(LabelVar *string, DetailedActionVar *string) { | |
| 178 | 178 | ||
| 179 | - | xMenuPrepend(x.GoPointer(), LabelVar, DetailedActionVar) | |
| 179 | + | xMenuPrepend(x.GoPointer(), core.NullableStringToPtr(LabelVar), core.NullableStringToPtr(DetailedActionVar)) | |
| 180 | 180 | ||
| 181 | 181 | } | |
| 182 | 182 | ||
| @@ -191,25 +191,25 @@ func (x *Menu) PrependItem(ItemVar *MenuItem) { | |||
| 191 | 191 | ||
| 192 | 192 | } | |
| 193 | 193 | ||
| 194 | - | var xMenuPrependSection func(uintptr, string, uintptr) | |
| 194 | + | var xMenuPrependSection func(uintptr, uintptr, uintptr) | |
| 195 | 195 | ||
| 196 | 196 | // Convenience function for prepending a section menu item to the start | |
| 197 | 197 | // of @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for | |
| 198 | 198 | // a more flexible alternative. | |
| 199 | - | func (x *Menu) PrependSection(LabelVar string, SectionVar *MenuModel) { | |
| 199 | + | func (x *Menu) PrependSection(LabelVar *string, SectionVar *MenuModel) { | |
| 200 | 200 | ||
| 201 | - | xMenuPrependSection(x.GoPointer(), LabelVar, SectionVar.GoPointer()) | |
| 201 | + | xMenuPrependSection(x.GoPointer(), core.NullableStringToPtr(LabelVar), SectionVar.GoPointer()) | |
| 202 | 202 | ||
| 203 | 203 | } | |
| 204 | 204 | ||
| 205 | - | var xMenuPrependSubmenu func(uintptr, string, uintptr) | |
| 205 | + | var xMenuPrependSubmenu func(uintptr, uintptr, uintptr) | |
| 206 | 206 | ||
| 207 | 207 | // Convenience function for prepending a submenu menu item to the start | |
| 208 | 208 | // of @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for | |
| 209 | 209 | // a more flexible alternative. | |
| 210 | - | func (x *Menu) PrependSubmenu(LabelVar string, SubmenuVar *MenuModel) { | |
| 210 | + | func (x *Menu) PrependSubmenu(LabelVar *string, SubmenuVar *MenuModel) { | |
| 211 | 211 | ||
| 212 | - | xMenuPrependSubmenu(x.GoPointer(), LabelVar, SubmenuVar.GoPointer()) | |
| 212 | + | xMenuPrependSubmenu(x.GoPointer(), core.NullableStringToPtr(LabelVar), SubmenuVar.GoPointer()) | |
| 213 | 213 | ||
| 214 | 214 | } | |
| 215 | 215 | ||
| @@ -269,7 +269,7 @@ func MenuItemNewFromInternalPtr(ptr uintptr) *MenuItem { | |||
| 269 | 269 | return cls | |
| 270 | 270 | } | |
| 271 | 271 | ||
| 272 | - | var xNewMenuItem func(string, string) uintptr | |
| 272 | + | var xNewMenuItem func(uintptr, uintptr) uintptr | |
| 273 | 273 | ||
| 274 | 274 | // Creates a new #GMenuItem. | |
| 275 | 275 | // | |
| @@ -279,10 +279,10 @@ var xNewMenuItem func(string, string) uintptr | |||
| 279 | 279 | // If @detailed_action is non-%NULL it is used to set the "action" and | |
| 280 | 280 | // possibly the "target" attribute of the new item. See | |
| 281 | 281 | // g_menu_item_set_detailed_action() for more information. | |
| 282 | - | func NewMenuItem(LabelVar string, DetailedActionVar string) *MenuItem { | |
| 282 | + | func NewMenuItem(LabelVar *string, DetailedActionVar *string) *MenuItem { | |
| 283 | 283 | var cls *MenuItem | |
| 284 | 284 | ||
| 285 | - | cret := xNewMenuItem(LabelVar, DetailedActionVar) | |
| 285 | + | cret := xNewMenuItem(core.NullableStringToPtr(LabelVar), core.NullableStringToPtr(DetailedActionVar)) | |
| 286 | 286 | ||
| 287 | 287 | if cret == 0 { | |
| 288 | 288 | return nil | |
| @@ -312,7 +312,7 @@ func NewMenuItemFromModel(ModelVar *MenuModel, ItemIndexVar int) *MenuItem { | |||
| 312 | 312 | return cls | |
| 313 | 313 | } | |
| 314 | 314 | ||
| 315 | - | var xNewMenuItemSection func(string, uintptr) uintptr | |
| 315 | + | var xNewMenuItemSection func(uintptr, uintptr) uintptr | |
| 316 | 316 | ||
| 317 | 317 | // Creates a new #GMenuItem representing a section. | |
| 318 | 318 | // | |
| @@ -378,10 +378,10 @@ var xNewMenuItemSection func(string, uintptr) uintptr | |||
| 378 | 378 | // | |
| 379 | 379 | // </menu> | |
| 380 | 380 | // ]| | |
| 381 | - | func NewMenuItemSection(LabelVar string, SectionVar *MenuModel) *MenuItem { | |
| 381 | + | func NewMenuItemSection(LabelVar *string, SectionVar *MenuModel) *MenuItem { | |
| 382 | 382 | var cls *MenuItem | |
| 383 | 383 | ||
| 384 | - | cret := xNewMenuItemSection(LabelVar, SectionVar.GoPointer()) | |
| 384 | + | cret := xNewMenuItemSection(core.NullableStringToPtr(LabelVar), SectionVar.GoPointer()) | |
| 385 | 385 | ||
| 386 | 386 | if cret == 0 { | |
| 387 | 387 | return nil | |
| @@ -391,16 +391,16 @@ func NewMenuItemSection(LabelVar string, SectionVar *MenuModel) *MenuItem { | |||
| 391 | 391 | return cls | |
| 392 | 392 | } | |
| 393 | 393 | ||
| 394 | - | var xNewMenuItemSubmenu func(string, uintptr) uintptr | |
| 394 | + | var xNewMenuItemSubmenu func(uintptr, uintptr) uintptr | |
| 395 | 395 | ||
| 396 | 396 | // Creates a new #GMenuItem representing a submenu. | |
| 397 | 397 | // | |
| 398 | 398 | // This is a convenience API around g_menu_item_new() and | |
| 399 | 399 | // g_menu_item_set_submenu(). | |
| 400 | - | func NewMenuItemSubmenu(LabelVar string, SubmenuVar *MenuModel) *MenuItem { | |
| 400 | + | func NewMenuItemSubmenu(LabelVar *string, SubmenuVar *MenuModel) *MenuItem { | |
| 401 | 401 | var cls *MenuItem | |
| 402 | 402 | ||
| 403 | - | cret := xNewMenuItemSubmenu(LabelVar, SubmenuVar.GoPointer()) | |
| 403 | + | cret := xNewMenuItemSubmenu(core.NullableStringToPtr(LabelVar), SubmenuVar.GoPointer()) | |
| 404 | 404 | ||
| 405 | 405 | if cret == 0 { | |
| 406 | 406 | return nil | |
| @@ -456,7 +456,7 @@ func (x *MenuItem) GetLink(LinkVar string) *MenuModel { | |||
| 456 | 456 | return cls | |
| 457 | 457 | } | |
| 458 | 458 | ||
| 459 | - | var xMenuItemSetActionAndTarget func(uintptr, string, string, ...interface{}) | |
| 459 | + | var xMenuItemSetActionAndTarget func(uintptr, uintptr, uintptr, ...interface{}) | |
| 460 | 460 | ||
| 461 | 461 | // Sets or unsets the "action" and "target" attributes of @menu_item. | |
| 462 | 462 | // | |
| @@ -477,13 +477,13 @@ var xMenuItemSetActionAndTarget func(uintptr, string, string, ...interface{}) | |||
| 477 | 477 | // | |
| 478 | 478 | // See also g_menu_item_set_action_and_target_value() for a | |
| 479 | 479 | // description of the semantics of the action and target attributes. | |
| 480 | - | func (x *MenuItem) SetActionAndTarget(ActionVar string, FormatStringVar string, varArgs ...interface{}) { | |
| 480 | + | func (x *MenuItem) SetActionAndTarget(ActionVar *string, FormatStringVar *string, varArgs ...interface{}) { | |
| 481 | 481 | ||
| 482 | - | xMenuItemSetActionAndTarget(x.GoPointer(), ActionVar, FormatStringVar, varArgs...) | |
| 482 | + | xMenuItemSetActionAndTarget(x.GoPointer(), core.NullableStringToPtr(ActionVar), core.NullableStringToPtr(FormatStringVar), varArgs...) | |
| 483 | 483 | ||
| 484 | 484 | } | |
| 485 | 485 | ||
| 486 | - | var xMenuItemSetActionAndTargetValue func(uintptr, string, *glib.Variant) | |
| 486 | + | var xMenuItemSetActionAndTargetValue func(uintptr, uintptr, *glib.Variant) | |
| 487 | 487 | ||
| 488 | 488 | // Sets or unsets the "action" and "target" attributes of @menu_item. | |
| 489 | 489 | // | |
| @@ -521,13 +521,13 @@ var xMenuItemSetActionAndTargetValue func(uintptr, string, *glib.Variant) | |||
| 521 | 521 | // See g_menu_item_set_action_and_target() or | |
| 522 | 522 | // g_menu_item_set_detailed_action() for two equivalent calls that are | |
| 523 | 523 | // probably more convenient for most uses. | |
| 524 | - | func (x *MenuItem) SetActionAndTargetValue(ActionVar string, TargetValueVar *glib.Variant) { | |
| 524 | + | func (x *MenuItem) SetActionAndTargetValue(ActionVar *string, TargetValueVar *glib.Variant) { | |
| 525 | 525 | ||
| 526 | - | xMenuItemSetActionAndTargetValue(x.GoPointer(), ActionVar, TargetValueVar) | |
| 526 | + | xMenuItemSetActionAndTargetValue(x.GoPointer(), core.NullableStringToPtr(ActionVar), TargetValueVar) | |
| 527 | 527 | ||
| 528 | 528 | } | |
| 529 | 529 | ||
| 530 | - | var xMenuItemSetAttribute func(uintptr, string, string, ...interface{}) | |
| 530 | + | var xMenuItemSetAttribute func(uintptr, string, uintptr, ...interface{}) | |
| 531 | 531 | ||
| 532 | 532 | // Sets or unsets an attribute on @menu_item. | |
| 533 | 533 | // | |
| @@ -546,9 +546,9 @@ var xMenuItemSetAttribute func(uintptr, string, string, ...interface{}) | |||
| 546 | 546 | // | |
| 547 | 547 | // See also g_menu_item_set_attribute_value() for an equivalent call | |
| 548 | 548 | // that directly accepts a #GVariant. | |
| 549 | - | func (x *MenuItem) SetAttribute(AttributeVar string, FormatStringVar string, varArgs ...interface{}) { | |
| 549 | + | func (x *MenuItem) SetAttribute(AttributeVar string, FormatStringVar *string, varArgs ...interface{}) { | |
| 550 | 550 | ||
| 551 | - | xMenuItemSetAttribute(x.GoPointer(), AttributeVar, FormatStringVar, varArgs...) | |
| 551 | + | xMenuItemSetAttribute(x.GoPointer(), AttributeVar, core.NullableStringToPtr(FormatStringVar), varArgs...) | |
| 552 | 552 | ||
| 553 | 553 | } | |
| 554 | 554 | ||
| @@ -618,15 +618,15 @@ func (x *MenuItem) SetIcon(IconVar Icon) { | |||
| 618 | 618 | ||
| 619 | 619 | } | |
| 620 | 620 | ||
| 621 | - | var xMenuItemSetLabel func(uintptr, string) | |
| 621 | + | var xMenuItemSetLabel func(uintptr, uintptr) | |
| 622 | 622 | ||
| 623 | 623 | // Sets or unsets the "label" attribute of @menu_item. | |
| 624 | 624 | // | |
| 625 | 625 | // If @label is non-%NULL it is used as the label for the menu item. If | |
| 626 | 626 | // it is %NULL then the label attribute is unset. | |
| 627 | - | func (x *MenuItem) SetLabel(LabelVar string) { | |
| 627 | + | func (x *MenuItem) SetLabel(LabelVar *string) { | |
| 628 | 628 | ||
| 629 | - | xMenuItemSetLabel(x.GoPointer(), LabelVar) | |
| 629 | + | xMenuItemSetLabel(x.GoPointer(), core.NullableStringToPtr(LabelVar)) | |
| 630 | 630 | ||
| 631 | 631 | } | |
| 632 | 632 | ||
M v4/gio/gmountoperation.go +12 -12
| @@ -570,12 +570,12 @@ func (x *MountOperation) SetChoice(ChoiceVar int) { | |||
| 570 | 570 | ||
| 571 | 571 | } | |
| 572 | 572 | ||
| 573 | - | var xMountOperationSetDomain func(uintptr, string) | |
| 573 | + | var xMountOperationSetDomain func(uintptr, uintptr) | |
| 574 | 574 | ||
| 575 | 575 | // Sets the mount operation's domain. | |
| 576 | - | func (x *MountOperation) SetDomain(DomainVar string) { | |
| 576 | + | func (x *MountOperation) SetDomain(DomainVar *string) { | |
| 577 | 577 | ||
| 578 | - | xMountOperationSetDomain(x.GoPointer(), DomainVar) | |
| 578 | + | xMountOperationSetDomain(x.GoPointer(), core.NullableStringToPtr(DomainVar)) | |
| 579 | 579 | ||
| 580 | 580 | } | |
| 581 | 581 | ||
| @@ -597,12 +597,12 @@ func (x *MountOperation) SetIsTcryptSystemVolume(SystemVolumeVar bool) { | |||
| 597 | 597 | ||
| 598 | 598 | } | |
| 599 | 599 | ||
| 600 | - | var xMountOperationSetPassword func(uintptr, string) | |
| 600 | + | var xMountOperationSetPassword func(uintptr, uintptr) | |
| 601 | 601 | ||
| 602 | 602 | // Sets the mount operation's password to @password. | |
| 603 | - | func (x *MountOperation) SetPassword(PasswordVar string) { | |
| 603 | + | func (x *MountOperation) SetPassword(PasswordVar *string) { | |
| 604 | 604 | ||
| 605 | - | xMountOperationSetPassword(x.GoPointer(), PasswordVar) | |
| 605 | + | xMountOperationSetPassword(x.GoPointer(), core.NullableStringToPtr(PasswordVar)) | |
| 606 | 606 | ||
| 607 | 607 | } | |
| 608 | 608 | ||
| @@ -624,12 +624,12 @@ func (x *MountOperation) SetPim(PimVar uint) { | |||
| 624 | 624 | ||
| 625 | 625 | } | |
| 626 | 626 | ||
| 627 | - | var xMountOperationSetUsername func(uintptr, string) | |
| 627 | + | var xMountOperationSetUsername func(uintptr, uintptr) | |
| 628 | 628 | ||
| 629 | 629 | // Sets the user name within @op to @username. | |
| 630 | - | func (x *MountOperation) SetUsername(UsernameVar string) { | |
| 630 | + | func (x *MountOperation) SetUsername(UsernameVar *string) { | |
| 631 | 631 | ||
| 632 | - | xMountOperationSetUsername(x.GoPointer(), UsernameVar) | |
| 632 | + | xMountOperationSetUsername(x.GoPointer(), core.NullableStringToPtr(UsernameVar)) | |
| 633 | 633 | ||
| 634 | 634 | } | |
| 635 | 635 | ||
| @@ -685,7 +685,7 @@ func (x *MountOperation) GetPropertyChoice() int { | |||
| 685 | 685 | func (x *MountOperation) SetPropertyDomain(value string) { | |
| 686 | 686 | var v gobject.Value | |
| 687 | 687 | v.Init(gobject.TypeStringVal) | |
| 688 | - | v.SetString(value) | |
| 688 | + | v.SetString(&value) | |
| 689 | 689 | x.SetProperty("domain", &v) | |
| 690 | 690 | } | |
| 691 | 691 | ||
| @@ -747,7 +747,7 @@ func (x *MountOperation) GetPropertyIsTcryptSystemVolume() bool { | |||
| 747 | 747 | func (x *MountOperation) SetPropertyPassword(value string) { | |
| 748 | 748 | var v gobject.Value | |
| 749 | 749 | v.Init(gobject.TypeStringVal) | |
| 750 | - | v.SetString(value) | |
| 750 | + | v.SetString(&value) | |
| 751 | 751 | x.SetProperty("password", &v) | |
| 752 | 752 | } | |
| 753 | 753 | ||
| @@ -785,7 +785,7 @@ func (x *MountOperation) GetPropertyPim() uint { | |||
| 785 | 785 | func (x *MountOperation) SetPropertyUsername(value string) { | |
| 786 | 786 | var v gobject.Value | |
| 787 | 787 | v.Init(gobject.TypeStringVal) | |
| 788 | - | v.SetString(value) | |
| 788 | + | v.SetString(&value) | |
| 789 | 789 | x.SetProperty("username", &v) | |
| 790 | 790 | } | |
| 791 | 791 | ||
M v4/gio/gnetworkaddress.go +2 -2
| @@ -150,7 +150,7 @@ func (c *NetworkAddress) SetGoPointer(ptr uintptr) { | |||
| 150 | 150 | func (x *NetworkAddress) SetPropertyHostname(value string) { | |
| 151 | 151 | var v gobject.Value | |
| 152 | 152 | v.Init(gobject.TypeStringVal) | |
| 153 | - | v.SetString(value) | |
| 153 | + | v.SetString(&value) | |
| 154 | 154 | x.SetProperty("hostname", &v) | |
| 155 | 155 | } | |
| 156 | 156 | ||
| @@ -184,7 +184,7 @@ func (x *NetworkAddress) GetPropertyPort() uint { | |||
| 184 | 184 | func (x *NetworkAddress) SetPropertyScheme(value string) { | |
| 185 | 185 | var v gobject.Value | |
| 186 | 186 | v.Init(gobject.TypeStringVal) | |
| 187 | - | v.SetString(value) | |
| 187 | + | v.SetString(&value) | |
| 188 | 188 | x.SetProperty("scheme", &v) | |
| 189 | 189 | } | |
| 190 | 190 | ||
M v4/gio/gnetworkservice.go +4 -4
| @@ -136,7 +136,7 @@ func (c *NetworkService) SetGoPointer(ptr uintptr) { | |||
| 136 | 136 | func (x *NetworkService) SetPropertyDomain(value string) { | |
| 137 | 137 | var v gobject.Value | |
| 138 | 138 | v.Init(gobject.TypeStringVal) | |
| 139 | - | v.SetString(value) | |
| 139 | + | v.SetString(&value) | |
| 140 | 140 | x.SetProperty("domain", &v) | |
| 141 | 141 | } | |
| 142 | 142 | ||
| @@ -153,7 +153,7 @@ func (x *NetworkService) GetPropertyDomain() string { | |||
| 153 | 153 | func (x *NetworkService) SetPropertyProtocol(value string) { | |
| 154 | 154 | var v gobject.Value | |
| 155 | 155 | v.Init(gobject.TypeStringVal) | |
| 156 | - | v.SetString(value) | |
| 156 | + | v.SetString(&value) | |
| 157 | 157 | x.SetProperty("protocol", &v) | |
| 158 | 158 | } | |
| 159 | 159 | ||
| @@ -170,7 +170,7 @@ func (x *NetworkService) GetPropertyProtocol() string { | |||
| 170 | 170 | func (x *NetworkService) SetPropertyScheme(value string) { | |
| 171 | 171 | var v gobject.Value | |
| 172 | 172 | v.Init(gobject.TypeStringVal) | |
| 173 | - | v.SetString(value) | |
| 173 | + | v.SetString(&value) | |
| 174 | 174 | x.SetProperty("scheme", &v) | |
| 175 | 175 | } | |
| 176 | 176 | ||
| @@ -187,7 +187,7 @@ func (x *NetworkService) GetPropertyScheme() string { | |||
| 187 | 187 | func (x *NetworkService) SetPropertyService(value string) { | |
| 188 | 188 | var v gobject.Value | |
| 189 | 189 | v.Init(gobject.TypeStringVal) | |
| 190 | - | v.SetString(value) | |
| 190 | + | v.SetString(&value) | |
| 191 | 191 | x.SetProperty("service", &v) | |
| 192 | 192 | } | |
| 193 | 193 | ||
M v4/gio/gnotification.go +12 -12
| @@ -107,7 +107,7 @@ func (x *Notification) AddButton(LabelVar string, DetailedActionVar string) { | |||
| 107 | 107 | ||
| 108 | 108 | } | |
| 109 | 109 | ||
| 110 | - | var xNotificationAddButtonWithTarget func(uintptr, string, string, string, ...interface{}) | |
| 110 | + | var xNotificationAddButtonWithTarget func(uintptr, string, string, uintptr, ...interface{}) | |
| 111 | 111 | ||
| 112 | 112 | // Adds a button to @notification that activates @action when clicked. | |
| 113 | 113 | // @action must be an application-wide action (it must start with "app."). | |
| @@ -116,9 +116,9 @@ var xNotificationAddButtonWithTarget func(uintptr, string, string, string, ...in | |||
| 116 | 116 | // positional parameters into a #GVariant instance, similar to | |
| 117 | 117 | // g_variant_new(). @action will be activated with that #GVariant as its | |
| 118 | 118 | // parameter. | |
| 119 | - | func (x *Notification) AddButtonWithTarget(LabelVar string, ActionVar string, TargetFormatVar string, varArgs ...interface{}) { | |
| 119 | + | func (x *Notification) AddButtonWithTarget(LabelVar string, ActionVar string, TargetFormatVar *string, varArgs ...interface{}) { | |
| 120 | 120 | ||
| 121 | - | xNotificationAddButtonWithTarget(x.GoPointer(), LabelVar, ActionVar, TargetFormatVar, varArgs...) | |
| 121 | + | xNotificationAddButtonWithTarget(x.GoPointer(), LabelVar, ActionVar, core.NullableStringToPtr(TargetFormatVar), varArgs...) | |
| 122 | 122 | ||
| 123 | 123 | } | |
| 124 | 124 | ||
| @@ -135,16 +135,16 @@ func (x *Notification) AddButtonWithTargetValue(LabelVar string, ActionVar strin | |||
| 135 | 135 | ||
| 136 | 136 | } | |
| 137 | 137 | ||
| 138 | - | var xNotificationSetBody func(uintptr, string) | |
| 138 | + | var xNotificationSetBody func(uintptr, uintptr) | |
| 139 | 139 | ||
| 140 | 140 | // Sets the body of @notification to @body. | |
| 141 | - | func (x *Notification) SetBody(BodyVar string) { | |
| 141 | + | func (x *Notification) SetBody(BodyVar *string) { | |
| 142 | 142 | ||
| 143 | - | xNotificationSetBody(x.GoPointer(), BodyVar) | |
| 143 | + | xNotificationSetBody(x.GoPointer(), core.NullableStringToPtr(BodyVar)) | |
| 144 | 144 | ||
| 145 | 145 | } | |
| 146 | 146 | ||
| 147 | - | var xNotificationSetCategory func(uintptr, string) | |
| 147 | + | var xNotificationSetCategory func(uintptr, uintptr) | |
| 148 | 148 | ||
| 149 | 149 | // Sets the type of @notification to @category. Categories have a main | |
| 150 | 150 | // type like `email`, `im` or `device` and can have a detail separated | |
| @@ -152,9 +152,9 @@ var xNotificationSetCategory func(uintptr, string) | |||
| 152 | 152 | // helps the notification server to select proper feedback to the user. | |
| 153 | 153 | // | |
| 154 | 154 | // Standard categories are [listed in the specification](https://specifications.freedesktop.org/notification-spec/latest/ar01s06.html). | |
| 155 | - | func (x *Notification) SetCategory(CategoryVar string) { | |
| 155 | + | func (x *Notification) SetCategory(CategoryVar *string) { | |
| 156 | 156 | ||
| 157 | - | xNotificationSetCategory(x.GoPointer(), CategoryVar) | |
| 157 | + | xNotificationSetCategory(x.GoPointer(), core.NullableStringToPtr(CategoryVar)) | |
| 158 | 158 | ||
| 159 | 159 | } | |
| 160 | 160 | ||
| @@ -177,7 +177,7 @@ func (x *Notification) SetDefaultAction(DetailedActionVar string) { | |||
| 177 | 177 | ||
| 178 | 178 | } | |
| 179 | 179 | ||
| 180 | - | var xNotificationSetDefaultActionAndTarget func(uintptr, string, string, ...interface{}) | |
| 180 | + | var xNotificationSetDefaultActionAndTarget func(uintptr, string, uintptr, ...interface{}) | |
| 181 | 181 | ||
| 182 | 182 | // Sets the default action of @notification to @action. This action is | |
| 183 | 183 | // activated when the notification is clicked on. It must be an | |
| @@ -190,9 +190,9 @@ var xNotificationSetDefaultActionAndTarget func(uintptr, string, string, ...inte | |||
| 190 | 190 | // | |
| 191 | 191 | // When no default action is set, the application that the notification | |
| 192 | 192 | // was sent on is activated. | |
| 193 | - | func (x *Notification) SetDefaultActionAndTarget(ActionVar string, TargetFormatVar string, varArgs ...interface{}) { | |
| 193 | + | func (x *Notification) SetDefaultActionAndTarget(ActionVar string, TargetFormatVar *string, varArgs ...interface{}) { | |
| 194 | 194 | ||
| 195 | - | xNotificationSetDefaultActionAndTarget(x.GoPointer(), ActionVar, TargetFormatVar, varArgs...) | |
| 195 | + | xNotificationSetDefaultActionAndTarget(x.GoPointer(), ActionVar, core.NullableStringToPtr(TargetFormatVar), varArgs...) | |
| 196 | 196 | ||
| 197 | 197 | } | |
| 198 | 198 | ||
M v4/gio/goutputstream.go +128 -8
| @@ -628,7 +628,22 @@ var xOutputStreamCloseAsync func(uintptr, int, uintptr, uintptr, uintptr) | |||
| 628 | 628 | // classes. However, if you override one you must override all. | |
| 629 | 629 | func (x *OutputStream) CloseAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 630 | 630 | ||
| 631 | - | xOutputStreamCloseAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 631 | + | var CallbackVarRef uintptr | |
| 632 | + | if CallbackVar != nil { | |
| 633 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 634 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 635 | + | CallbackVarRef = cbRefPtr | |
| 636 | + | } else { | |
| 637 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 638 | + | cbFn := *CallbackVar | |
| 639 | + | cbFn(arg0, arg1, arg2) | |
| 640 | + | } | |
| 641 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 642 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 643 | + | } | |
| 644 | + | } | |
| 645 | + | ||
| 646 | + | xOutputStreamCloseAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 632 | 647 | ||
| 633 | 648 | } | |
| 634 | 649 | ||
| @@ -679,7 +694,22 @@ var xOutputStreamFlushAsync func(uintptr, int, uintptr, uintptr, uintptr) | |||
| 679 | 694 | // result of the operation. | |
| 680 | 695 | func (x *OutputStream) FlushAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 681 | 696 | ||
| 682 | - | xOutputStreamFlushAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 697 | + | var CallbackVarRef uintptr | |
| 698 | + | if CallbackVar != nil { | |
| 699 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 700 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 701 | + | CallbackVarRef = cbRefPtr | |
| 702 | + | } else { | |
| 703 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 704 | + | cbFn := *CallbackVar | |
| 705 | + | cbFn(arg0, arg1, arg2) | |
| 706 | + | } | |
| 707 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 708 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 709 | + | } | |
| 710 | + | } | |
| 711 | + | ||
| 712 | + | xOutputStreamFlushAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 683 | 713 | ||
| 684 | 714 | } | |
| 685 | 715 | ||
| @@ -788,7 +818,22 @@ var xOutputStreamSpliceAsync func(uintptr, uintptr, OutputStreamSpliceFlags, int | |||
| 788 | 818 | // g_output_stream_splice(). | |
| 789 | 819 | func (x *OutputStream) SpliceAsync(SourceVar *InputStream, FlagsVar OutputStreamSpliceFlags, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 790 | 820 | ||
| 791 | - | xOutputStreamSpliceAsync(x.GoPointer(), SourceVar.GoPointer(), FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 821 | + | var CallbackVarRef uintptr | |
| 822 | + | if CallbackVar != nil { | |
| 823 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 824 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 825 | + | CallbackVarRef = cbRefPtr | |
| 826 | + | } else { | |
| 827 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 828 | + | cbFn := *CallbackVar | |
| 829 | + | cbFn(arg0, arg1, arg2) | |
| 830 | + | } | |
| 831 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 832 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 833 | + | } | |
| 834 | + | } | |
| 835 | + | ||
| 836 | + | xOutputStreamSpliceAsync(x.GoPointer(), SourceVar.GoPointer(), FlagsVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 792 | 837 | ||
| 793 | 838 | } | |
| 794 | 839 | ||
| @@ -910,7 +955,22 @@ var xOutputStreamWriteAllAsync func(uintptr, []byte, uint, int, uintptr, uintptr | |||
| 910 | 955 | // until @callback is called. | |
| 911 | 956 | func (x *OutputStream) WriteAllAsync(BufferVar []byte, CountVar uint, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 912 | 957 | ||
| 913 | - | xOutputStreamWriteAllAsync(x.GoPointer(), BufferVar, CountVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 958 | + | var CallbackVarRef uintptr | |
| 959 | + | if CallbackVar != nil { | |
| 960 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 961 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 962 | + | CallbackVarRef = cbRefPtr | |
| 963 | + | } else { | |
| 964 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 965 | + | cbFn := *CallbackVar | |
| 966 | + | cbFn(arg0, arg1, arg2) | |
| 967 | + | } | |
| 968 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 969 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 970 | + | } | |
| 971 | + | } | |
| 972 | + | ||
| 973 | + | xOutputStreamWriteAllAsync(x.GoPointer(), BufferVar, CountVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 914 | 974 | ||
| 915 | 975 | } | |
| 916 | 976 | ||
| @@ -976,7 +1036,22 @@ var xOutputStreamWriteAsync func(uintptr, []byte, uint, int, uintptr, uintptr, u | |||
| 976 | 1036 | // the contents (without copying) for the duration of the call. | |
| 977 | 1037 | func (x *OutputStream) WriteAsync(BufferVar []byte, CountVar uint, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 978 | 1038 | ||
| 979 | - | xOutputStreamWriteAsync(x.GoPointer(), BufferVar, CountVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1039 | + | var CallbackVarRef uintptr | |
| 1040 | + | if CallbackVar != nil { | |
| 1041 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1042 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1043 | + | CallbackVarRef = cbRefPtr | |
| 1044 | + | } else { | |
| 1045 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1046 | + | cbFn := *CallbackVar | |
| 1047 | + | cbFn(arg0, arg1, arg2) | |
| 1048 | + | } | |
| 1049 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1050 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1051 | + | } | |
| 1052 | + | } | |
| 1053 | + | ||
| 1054 | + | xOutputStreamWriteAsync(x.GoPointer(), BufferVar, CountVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 980 | 1055 | ||
| 981 | 1056 | } | |
| 982 | 1057 | ||
| @@ -1021,7 +1096,22 @@ var xOutputStreamWriteBytesAsync func(uintptr, *glib.Bytes, int, uintptr, uintpt | |||
| 1021 | 1096 | // g_output_stream_write_bytes(). | |
| 1022 | 1097 | func (x *OutputStream) WriteBytesAsync(BytesVar *glib.Bytes, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1023 | 1098 | ||
| 1024 | - | xOutputStreamWriteBytesAsync(x.GoPointer(), BytesVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1099 | + | var CallbackVarRef uintptr | |
| 1100 | + | if CallbackVar != nil { | |
| 1101 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1102 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1103 | + | CallbackVarRef = cbRefPtr | |
| 1104 | + | } else { | |
| 1105 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1106 | + | cbFn := *CallbackVar | |
| 1107 | + | cbFn(arg0, arg1, arg2) | |
| 1108 | + | } | |
| 1109 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1110 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1111 | + | } | |
| 1112 | + | } | |
| 1113 | + | ||
| 1114 | + | xOutputStreamWriteBytesAsync(x.GoPointer(), BytesVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 1025 | 1115 | ||
| 1026 | 1116 | } | |
| 1027 | 1117 | ||
| @@ -1144,7 +1234,22 @@ var xOutputStreamWritevAllAsync func(uintptr, []OutputVector, uint, int, uintptr | |||
| 1144 | 1234 | // of @vectors might be changed by this function. | |
| 1145 | 1235 | func (x *OutputStream) WritevAllAsync(VectorsVar []OutputVector, NVectorsVar uint, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1146 | 1236 | ||
| 1147 | - | xOutputStreamWritevAllAsync(x.GoPointer(), VectorsVar, NVectorsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1237 | + | var CallbackVarRef uintptr | |
| 1238 | + | if CallbackVar != nil { | |
| 1239 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1240 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1241 | + | CallbackVarRef = cbRefPtr | |
| 1242 | + | } else { | |
| 1243 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1244 | + | cbFn := *CallbackVar | |
| 1245 | + | cbFn(arg0, arg1, arg2) | |
| 1246 | + | } | |
| 1247 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1248 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1249 | + | } | |
| 1250 | + | } | |
| 1251 | + | ||
| 1252 | + | xOutputStreamWritevAllAsync(x.GoPointer(), VectorsVar, NVectorsVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 1148 | 1253 | ||
| 1149 | 1254 | } | |
| 1150 | 1255 | ||
| @@ -1205,7 +1310,22 @@ var xOutputStreamWritevAsync func(uintptr, []OutputVector, uint, int, uintptr, u | |||
| 1205 | 1310 | // until @callback is called. | |
| 1206 | 1311 | func (x *OutputStream) WritevAsync(VectorsVar []OutputVector, NVectorsVar uint, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1207 | 1312 | ||
| 1208 | - | xOutputStreamWritevAsync(x.GoPointer(), VectorsVar, NVectorsVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1313 | + | var CallbackVarRef uintptr | |
| 1314 | + | if CallbackVar != nil { | |
| 1315 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1316 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1317 | + | CallbackVarRef = cbRefPtr | |
| 1318 | + | } else { | |
| 1319 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1320 | + | cbFn := *CallbackVar | |
| 1321 | + | cbFn(arg0, arg1, arg2) | |
| 1322 | + | } | |
| 1323 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1324 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1325 | + | } | |
| 1326 | + | } | |
| 1327 | + | ||
| 1328 | + | xOutputStreamWritevAsync(x.GoPointer(), VectorsVar, NVectorsVar, IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 1209 | 1329 | ||
| 1210 | 1330 | } | |
| 1211 | 1331 | ||
M v4/gio/gpermission.go +32 -2
| @@ -249,7 +249,22 @@ var xPermissionAcquireAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 249 | 249 | // g_permission_acquire(). | |
| 250 | 250 | func (x *Permission) AcquireAsync(CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 251 | 251 | ||
| 252 | - | xPermissionAcquireAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 252 | + | var CallbackVarRef uintptr | |
| 253 | + | if CallbackVar != nil { | |
| 254 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 255 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 256 | + | CallbackVarRef = cbRefPtr | |
| 257 | + | } else { | |
| 258 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 259 | + | cbFn := *CallbackVar | |
| 260 | + | cbFn(arg0, arg1, arg2) | |
| 261 | + | } | |
| 262 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 263 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 264 | + | } | |
| 265 | + | } | |
| 266 | + | ||
| 267 | + | xPermissionAcquireAsync(x.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 253 | 268 | ||
| 254 | 269 | } | |
| 255 | 270 | ||
| @@ -353,7 +368,22 @@ var xPermissionReleaseAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 353 | 368 | // g_permission_release(). | |
| 354 | 369 | func (x *Permission) ReleaseAsync(CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 355 | 370 | ||
| 356 | - | xPermissionReleaseAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 371 | + | var CallbackVarRef uintptr | |
| 372 | + | if CallbackVar != nil { | |
| 373 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 374 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 375 | + | CallbackVarRef = cbRefPtr | |
| 376 | + | } else { | |
| 377 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 378 | + | cbFn := *CallbackVar | |
| 379 | + | cbFn(arg0, arg1, arg2) | |
| 380 | + | } | |
| 381 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 382 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 383 | + | } | |
| 384 | + | } | |
| 385 | + | ||
| 386 | + | xPermissionReleaseAsync(x.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 357 | 387 | ||
| 358 | 388 | } | |
| 359 | 389 | ||
M v4/gio/gpropertyaction.go +2 -2
| @@ -147,7 +147,7 @@ func (x *PropertyAction) GetPropertyInvertBoolean() bool { | |||
| 147 | 147 | func (x *PropertyAction) SetPropertyName(value string) { | |
| 148 | 148 | var v gobject.Value | |
| 149 | 149 | v.Init(gobject.TypeStringVal) | |
| 150 | - | v.SetString(value) | |
| 150 | + | v.SetString(&value) | |
| 151 | 151 | x.SetProperty("name", &v) | |
| 152 | 152 | } | |
| 153 | 153 | ||
| @@ -177,7 +177,7 @@ func (x *PropertyAction) GetPropertyParameterType() uintptr { | |||
| 177 | 177 | func (x *PropertyAction) SetPropertyPropertyName(value string) { | |
| 178 | 178 | var v gobject.Value | |
| 179 | 179 | v.Init(gobject.TypeStringVal) | |
| 180 | - | v.SetString(value) | |
| 180 | + | v.SetString(&value) | |
| 181 | 181 | x.SetProperty("property-name", &v) | |
| 182 | 182 | } | |
| 183 | 183 | ||
M v4/gio/gproxyaddress.go +9 -9
| @@ -47,7 +47,7 @@ func ProxyAddressNewFromInternalPtr(ptr uintptr) *ProxyAddress { | |||
| 47 | 47 | return cls | |
| 48 | 48 | } | |
| 49 | 49 | ||
| 50 | - | var xNewProxyAddress func(uintptr, uint16, string, string, uint16, string, string) uintptr | |
| 50 | + | var xNewProxyAddress func(uintptr, uint16, string, string, uint16, uintptr, uintptr) uintptr | |
| 51 | 51 | ||
| 52 | 52 | // Creates a new #GProxyAddress for @inetaddr with @protocol that should | |
| 53 | 53 | // tunnel through @dest_hostname and @dest_port. | |
| @@ -55,10 +55,10 @@ var xNewProxyAddress func(uintptr, uint16, string, string, uint16, string, strin | |||
| 55 | 55 | // (Note that this method doesn't set the #GProxyAddress:uri or | |
| 56 | 56 | // #GProxyAddress:destination-protocol fields; use g_object_new() | |
| 57 | 57 | // directly if you want to set those.) | |
| 58 | - | func NewProxyAddress(InetaddrVar *InetAddress, PortVar uint16, ProtocolVar string, DestHostnameVar string, DestPortVar uint16, UsernameVar string, PasswordVar string) *ProxyAddress { | |
| 58 | + | func NewProxyAddress(InetaddrVar *InetAddress, PortVar uint16, ProtocolVar string, DestHostnameVar string, DestPortVar uint16, UsernameVar *string, PasswordVar *string) *ProxyAddress { | |
| 59 | 59 | var cls *ProxyAddress | |
| 60 | 60 | ||
| 61 | - | cret := xNewProxyAddress(InetaddrVar.GoPointer(), PortVar, ProtocolVar, DestHostnameVar, DestPortVar, UsernameVar, PasswordVar) | |
| 61 | + | cret := xNewProxyAddress(InetaddrVar.GoPointer(), PortVar, ProtocolVar, DestHostnameVar, DestPortVar, core.NullableStringToPtr(UsernameVar), core.NullableStringToPtr(PasswordVar)) | |
| 62 | 62 | ||
| 63 | 63 | if cret == 0 { | |
| 64 | 64 | return nil | |
| @@ -152,7 +152,7 @@ func (c *ProxyAddress) SetGoPointer(ptr uintptr) { | |||
| 152 | 152 | func (x *ProxyAddress) SetPropertyDestinationHostname(value string) { | |
| 153 | 153 | var v gobject.Value | |
| 154 | 154 | v.Init(gobject.TypeStringVal) | |
| 155 | - | v.SetString(value) | |
| 155 | + | v.SetString(&value) | |
| 156 | 156 | x.SetProperty("destination-hostname", &v) | |
| 157 | 157 | } | |
| 158 | 158 | ||
| @@ -187,7 +187,7 @@ func (x *ProxyAddress) GetPropertyDestinationPort() uint { | |||
| 187 | 187 | func (x *ProxyAddress) SetPropertyDestinationProtocol(value string) { | |
| 188 | 188 | var v gobject.Value | |
| 189 | 189 | v.Init(gobject.TypeStringVal) | |
| 190 | - | v.SetString(value) | |
| 190 | + | v.SetString(&value) | |
| 191 | 191 | x.SetProperty("destination-protocol", &v) | |
| 192 | 192 | } | |
| 193 | 193 | ||
| @@ -205,7 +205,7 @@ func (x *ProxyAddress) GetPropertyDestinationProtocol() string { | |||
| 205 | 205 | func (x *ProxyAddress) SetPropertyPassword(value string) { | |
| 206 | 206 | var v gobject.Value | |
| 207 | 207 | v.Init(gobject.TypeStringVal) | |
| 208 | - | v.SetString(value) | |
| 208 | + | v.SetString(&value) | |
| 209 | 209 | x.SetProperty("password", &v) | |
| 210 | 210 | } | |
| 211 | 211 | ||
| @@ -222,7 +222,7 @@ func (x *ProxyAddress) GetPropertyPassword() string { | |||
| 222 | 222 | func (x *ProxyAddress) SetPropertyProtocol(value string) { | |
| 223 | 223 | var v gobject.Value | |
| 224 | 224 | v.Init(gobject.TypeStringVal) | |
| 225 | - | v.SetString(value) | |
| 225 | + | v.SetString(&value) | |
| 226 | 226 | x.SetProperty("protocol", &v) | |
| 227 | 227 | } | |
| 228 | 228 | ||
| @@ -240,7 +240,7 @@ func (x *ProxyAddress) GetPropertyProtocol() string { | |||
| 240 | 240 | func (x *ProxyAddress) SetPropertyUri(value string) { | |
| 241 | 241 | var v gobject.Value | |
| 242 | 242 | v.Init(gobject.TypeStringVal) | |
| 243 | - | v.SetString(value) | |
| 243 | + | v.SetString(&value) | |
| 244 | 244 | x.SetProperty("uri", &v) | |
| 245 | 245 | } | |
| 246 | 246 | ||
| @@ -258,7 +258,7 @@ func (x *ProxyAddress) GetPropertyUri() string { | |||
| 258 | 258 | func (x *ProxyAddress) SetPropertyUsername(value string) { | |
| 259 | 259 | var v gobject.Value | |
| 260 | 260 | v.Init(gobject.TypeStringVal) | |
| 261 | - | v.SetString(value) | |
| 261 | + | v.SetString(&value) | |
| 262 | 262 | x.SetProperty("username", &v) | |
| 263 | 263 | } | |
| 264 | 264 | ||
M v4/gio/gproxyaddressenumerator.go +1 -1
| @@ -265,7 +265,7 @@ func (x *ProxyAddressEnumerator) GetPropertyDefaultPort() uint { | |||
| 265 | 265 | func (x *ProxyAddressEnumerator) SetPropertyUri(value string) { | |
| 266 | 266 | var v gobject.Value | |
| 267 | 267 | v.Init(gobject.TypeStringVal) | |
| 268 | - | v.SetString(value) | |
| 268 | + | v.SetString(&value) | |
| 269 | 269 | x.SetProperty("uri", &v) | |
| 270 | 270 | } | |
| 271 | 271 | ||
M v4/gio/gresolver.go +80 -5
| @@ -531,7 +531,22 @@ var xResolverLookupByAddressAsync func(uintptr, uintptr, uintptr, uintptr, uintp | |||
| 531 | 531 | // call g_resolver_lookup_by_address_finish() to get the final result. | |
| 532 | 532 | func (x *Resolver) LookupByAddressAsync(AddressVar *InetAddress, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 533 | 533 | ||
| 534 | - | xResolverLookupByAddressAsync(x.GoPointer(), AddressVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 534 | + | var CallbackVarRef uintptr | |
| 535 | + | if CallbackVar != nil { | |
| 536 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 537 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 538 | + | CallbackVarRef = cbRefPtr | |
| 539 | + | } else { | |
| 540 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 541 | + | cbFn := *CallbackVar | |
| 542 | + | cbFn(arg0, arg1, arg2) | |
| 543 | + | } | |
| 544 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 545 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 546 | + | } | |
| 547 | + | } | |
| 548 | + | ||
| 549 | + | xResolverLookupByAddressAsync(x.GoPointer(), AddressVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 535 | 550 | ||
| 536 | 551 | } | |
| 537 | 552 | ||
| @@ -598,7 +613,22 @@ var xResolverLookupByNameAsync func(uintptr, string, uintptr, uintptr, uintptr) | |||
| 598 | 613 | // See g_resolver_lookup_by_name() for more details. | |
| 599 | 614 | func (x *Resolver) LookupByNameAsync(HostnameVar string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 600 | 615 | ||
| 601 | - | xResolverLookupByNameAsync(x.GoPointer(), HostnameVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 616 | + | var CallbackVarRef uintptr | |
| 617 | + | if CallbackVar != nil { | |
| 618 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 619 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 620 | + | CallbackVarRef = cbRefPtr | |
| 621 | + | } else { | |
| 622 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 623 | + | cbFn := *CallbackVar | |
| 624 | + | cbFn(arg0, arg1, arg2) | |
| 625 | + | } | |
| 626 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 627 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 628 | + | } | |
| 629 | + | } | |
| 630 | + | ||
| 631 | + | xResolverLookupByNameAsync(x.GoPointer(), HostnameVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 602 | 632 | ||
| 603 | 633 | } | |
| 604 | 634 | ||
| @@ -645,7 +675,22 @@ var xResolverLookupByNameWithFlagsAsync func(uintptr, string, ResolverNameLookup | |||
| 645 | 675 | // See g_resolver_lookup_by_name() for more details. | |
| 646 | 676 | func (x *Resolver) LookupByNameWithFlagsAsync(HostnameVar string, FlagsVar ResolverNameLookupFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 647 | 677 | ||
| 648 | - | xResolverLookupByNameWithFlagsAsync(x.GoPointer(), HostnameVar, FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 678 | + | var CallbackVarRef uintptr | |
| 679 | + | if CallbackVar != nil { | |
| 680 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 681 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 682 | + | CallbackVarRef = cbRefPtr | |
| 683 | + | } else { | |
| 684 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 685 | + | cbFn := *CallbackVar | |
| 686 | + | cbFn(arg0, arg1, arg2) | |
| 687 | + | } | |
| 688 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 689 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 690 | + | } | |
| 691 | + | } | |
| 692 | + | ||
| 693 | + | xResolverLookupByNameWithFlagsAsync(x.GoPointer(), HostnameVar, FlagsVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 649 | 694 | ||
| 650 | 695 | } | |
| 651 | 696 | ||
| @@ -699,7 +744,22 @@ var xResolverLookupRecordsAsync func(uintptr, string, ResolverRecordType, uintpt | |||
| 699 | 744 | // g_resolver_lookup_records() for more details. | |
| 700 | 745 | func (x *Resolver) LookupRecordsAsync(RrnameVar string, RecordTypeVar ResolverRecordType, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 701 | 746 | ||
| 702 | - | xResolverLookupRecordsAsync(x.GoPointer(), RrnameVar, RecordTypeVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 747 | + | var CallbackVarRef uintptr | |
| 748 | + | if CallbackVar != nil { | |
| 749 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 750 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 751 | + | CallbackVarRef = cbRefPtr | |
| 752 | + | } else { | |
| 753 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 754 | + | cbFn := *CallbackVar | |
| 755 | + | cbFn(arg0, arg1, arg2) | |
| 756 | + | } | |
| 757 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 758 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 759 | + | } | |
| 760 | + | } | |
| 761 | + | ||
| 762 | + | xResolverLookupRecordsAsync(x.GoPointer(), RrnameVar, RecordTypeVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 703 | 763 | ||
| 704 | 764 | } | |
| 705 | 765 | ||
| @@ -767,7 +827,22 @@ var xResolverLookupServiceAsync func(uintptr, string, string, string, uintptr, u | |||
| 767 | 827 | // details. | |
| 768 | 828 | func (x *Resolver) LookupServiceAsync(ServiceVar string, ProtocolVar string, DomainVar string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 769 | 829 | ||
| 770 | - | xResolverLookupServiceAsync(x.GoPointer(), ServiceVar, ProtocolVar, DomainVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 830 | + | var CallbackVarRef uintptr | |
| 831 | + | if CallbackVar != nil { | |
| 832 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 833 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 834 | + | CallbackVarRef = cbRefPtr | |
| 835 | + | } else { | |
| 836 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 837 | + | cbFn := *CallbackVar | |
| 838 | + | cbFn(arg0, arg1, arg2) | |
| 839 | + | } | |
| 840 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 841 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 842 | + | } | |
| 843 | + | } | |
| 844 | + | ||
| 845 | + | xResolverLookupServiceAsync(x.GoPointer(), ServiceVar, ProtocolVar, DomainVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 771 | 846 | ||
| 772 | 847 | } | |
| 773 | 848 | ||
M v4/gio/gsettings.go +113 -8
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | package gio | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "fmt" | |
| 5 | 6 | "structs" | |
| 6 | 7 | "unsafe" | |
| 7 | 8 | ||
| @@ -629,7 +630,7 @@ func NewSettings(SchemaIdVar string) *Settings { | |||
| 629 | 630 | return cls | |
| 630 | 631 | } | |
| 631 | 632 | ||
| 632 | - | var xNewSettingsFull func(*SettingsSchema, uintptr, string) uintptr | |
| 633 | + | var xNewSettingsFull func(*SettingsSchema, uintptr, uintptr) uintptr | |
| 633 | 634 | ||
| 634 | 635 | // Creates a new [class@Gio.Settings] object with a given schema, backend and | |
| 635 | 636 | // path. | |
| @@ -654,10 +655,10 @@ var xNewSettingsFull func(*SettingsSchema, uintptr, string) uintptr | |||
| 654 | 655 | // error if @path is `NULL` and the schema has no path of its own or if | |
| 655 | 656 | // @path is non-`NULL` and not equal to the path that the schema does | |
| 656 | 657 | // have. | |
| 657 | - | func NewSettingsFull(SchemaVar *SettingsSchema, BackendVar *SettingsBackend, PathVar string) *Settings { | |
| 658 | + | func NewSettingsFull(SchemaVar *SettingsSchema, BackendVar *SettingsBackend, PathVar *string) *Settings { | |
| 658 | 659 | var cls *Settings | |
| 659 | 660 | ||
| 660 | - | cret := xNewSettingsFull(SchemaVar, BackendVar.GoPointer(), PathVar) | |
| 661 | + | cret := xNewSettingsFull(SchemaVar, BackendVar.GoPointer(), core.NullableStringToPtr(PathVar)) | |
| 661 | 662 | ||
| 662 | 663 | if cret == 0 { | |
| 663 | 664 | return nil | |
| @@ -793,7 +794,52 @@ var xSettingsBindWithMapping func(uintptr, string, uintptr, string, SettingsBind | |||
| 793 | 794 | // binding overrides the first one. | |
| 794 | 795 | func (x *Settings) BindWithMapping(KeyVar string, ObjectVar *gobject.Object, PropertyVar string, FlagsVar SettingsBindFlags, GetMappingVar *SettingsBindGetMapping, SetMappingVar *SettingsBindSetMapping, UserDataVar uintptr, DestroyVar *glib.DestroyNotify) { | |
| 795 | 796 | ||
| 796 | - | xSettingsBindWithMapping(x.GoPointer(), KeyVar, ObjectVar.GoPointer(), PropertyVar, FlagsVar, glib.NewCallbackNullable(GetMappingVar), glib.NewCallbackNullable(SetMappingVar), UserDataVar, glib.NewCallback(DestroyVar)) | |
| 797 | + | var GetMappingVarRef uintptr | |
| 798 | + | if GetMappingVar != nil { | |
| 799 | + | GetMappingVarPtr := uintptr(unsafe.Pointer(GetMappingVar)) | |
| 800 | + | if cbRefPtr, ok := glib.GetCallback(GetMappingVarPtr); ok { | |
| 801 | + | GetMappingVarRef = cbRefPtr | |
| 802 | + | } else { | |
| 803 | + | fcb := func(arg0 *gobject.Value, arg1 *glib.Variant, arg2 uintptr) bool { | |
| 804 | + | cbFn := *GetMappingVar | |
| 805 | + | return cbFn(arg0, arg1, arg2) | |
| 806 | + | } | |
| 807 | + | GetMappingVarRef = purego.NewCallback(fcb) | |
| 808 | + | glib.SaveCallback(GetMappingVarPtr, GetMappingVarRef) | |
| 809 | + | } | |
| 810 | + | } | |
| 811 | + | ||
| 812 | + | var SetMappingVarRef uintptr | |
| 813 | + | if SetMappingVar != nil { | |
| 814 | + | SetMappingVarPtr := uintptr(unsafe.Pointer(SetMappingVar)) | |
| 815 | + | if cbRefPtr, ok := glib.GetCallback(SetMappingVarPtr); ok { | |
| 816 | + | SetMappingVarRef = cbRefPtr | |
| 817 | + | } else { | |
| 818 | + | fcb := func(arg0 *gobject.Value, arg1 *glib.VariantType, arg2 uintptr) *glib.Variant { | |
| 819 | + | cbFn := *SetMappingVar | |
| 820 | + | return cbFn(arg0, arg1, arg2) | |
| 821 | + | } | |
| 822 | + | SetMappingVarRef = purego.NewCallback(fcb) | |
| 823 | + | glib.SaveCallback(SetMappingVarPtr, SetMappingVarRef) | |
| 824 | + | } | |
| 825 | + | } | |
| 826 | + | ||
| 827 | + | var DestroyVarRef uintptr | |
| 828 | + | if DestroyVar != nil { | |
| 829 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 830 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 831 | + | DestroyVarRef = cbRefPtr | |
| 832 | + | } else { | |
| 833 | + | fcb := func(arg0 uintptr) { | |
| 834 | + | cbFn := *DestroyVar | |
| 835 | + | cbFn(arg0) | |
| 836 | + | } | |
| 837 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 838 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 839 | + | } | |
| 840 | + | } | |
| 841 | + | ||
| 842 | + | xSettingsBindWithMapping(x.GoPointer(), KeyVar, ObjectVar.GoPointer(), PropertyVar, FlagsVar, GetMappingVarRef, SetMappingVarRef, UserDataVar, DestroyVarRef) | |
| 797 | 843 | ||
| 798 | 844 | } | |
| 799 | 845 | ||
| @@ -1085,7 +1131,22 @@ var xSettingsGetMapped func(uintptr, string, uintptr, uintptr) uintptr | |||
| 1085 | 1131 | // just as any other value would be. | |
| 1086 | 1132 | func (x *Settings) GetMapped(KeyVar string, MappingVar *SettingsGetMapping, UserDataVar uintptr) uintptr { | |
| 1087 | 1133 | ||
| 1088 | - | cret := xSettingsGetMapped(x.GoPointer(), KeyVar, glib.NewCallback(MappingVar), UserDataVar) | |
| 1134 | + | var MappingVarRef uintptr | |
| 1135 | + | if MappingVar != nil { | |
| 1136 | + | MappingVarPtr := uintptr(unsafe.Pointer(MappingVar)) | |
| 1137 | + | if cbRefPtr, ok := glib.GetCallback(MappingVarPtr); ok { | |
| 1138 | + | MappingVarRef = cbRefPtr | |
| 1139 | + | } else { | |
| 1140 | + | fcb := func(arg0 *glib.Variant, arg1 *uintptr, arg2 uintptr) bool { | |
| 1141 | + | cbFn := *MappingVar | |
| 1142 | + | return cbFn(arg0, arg1, arg2) | |
| 1143 | + | } | |
| 1144 | + | MappingVarRef = purego.NewCallback(fcb) | |
| 1145 | + | glib.SaveCallback(MappingVarPtr, MappingVarRef) | |
| 1146 | + | } | |
| 1147 | + | } | |
| 1148 | + | ||
| 1149 | + | cret := xSettingsGetMapped(x.GoPointer(), KeyVar, MappingVarRef, UserDataVar) | |
| 1089 | 1150 | return cret | |
| 1090 | 1151 | } | |
| 1091 | 1152 | ||
| @@ -1492,7 +1553,7 @@ func (x *Settings) GetPropertyHasUnapplied() bool { | |||
| 1492 | 1553 | func (x *Settings) SetPropertyPath(value string) { | |
| 1493 | 1554 | var v gobject.Value | |
| 1494 | 1555 | v.Init(gobject.TypeStringVal) | |
| 1495 | - | v.SetString(value) | |
| 1556 | + | v.SetString(&value) | |
| 1496 | 1557 | x.SetProperty("path", &v) | |
| 1497 | 1558 | } | |
| 1498 | 1559 | ||
| @@ -1517,7 +1578,7 @@ func (x *Settings) GetPropertyPath() string { | |||
| 1517 | 1578 | func (x *Settings) SetPropertySchema(value string) { | |
| 1518 | 1579 | var v gobject.Value | |
| 1519 | 1580 | v.Init(gobject.TypeStringVal) | |
| 1520 | - | v.SetString(value) | |
| 1581 | + | v.SetString(&value) | |
| 1521 | 1582 | x.SetProperty("schema", &v) | |
| 1522 | 1583 | } | |
| 1523 | 1584 | ||
| @@ -1543,7 +1604,7 @@ func (x *Settings) GetPropertySchema() string { | |||
| 1543 | 1604 | func (x *Settings) SetPropertySchemaId(value string) { | |
| 1544 | 1605 | var v gobject.Value | |
| 1545 | 1606 | v.Init(gobject.TypeStringVal) | |
| 1546 | - | v.SetString(value) | |
| 1607 | + | v.SetString(&value) | |
| 1547 | 1608 | x.SetProperty("schema-id", &v) | |
| 1548 | 1609 | } | |
| 1549 | 1610 | ||
| @@ -1652,6 +1713,28 @@ func (x *Settings) ConnectChanged(cb *func(Settings, string)) uint32 { | |||
| 1652 | 1713 | return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr) | |
| 1653 | 1714 | } | |
| 1654 | 1715 | ||
| 1716 | + | // ConnectChangedWithDetail connects to the "changed" signal with a detail string. | |
| 1717 | + | // The detail is appended as "changed::<detail>". | |
| 1718 | + | func (x *Settings) ConnectChangedWithDetail(detail string, cb *func(Settings, string)) uint32 { | |
| 1719 | + | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 1720 | + | signalName := fmt.Sprintf("changed::%s", detail) | |
| 1721 | + | if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { | |
| 1722 | + | return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 1723 | + | } | |
| 1724 | + | ||
| 1725 | + | fcb := func(clsPtr uintptr, KeyVarp string) { | |
| 1726 | + | fa := Settings{} | |
| 1727 | + | fa.Ptr = clsPtr | |
| 1728 | + | cbFn := *cb | |
| 1729 | + | ||
| 1730 | + | cbFn(fa, KeyVarp) | |
| 1731 | + | ||
| 1732 | + | } | |
| 1733 | + | cbRefPtr := purego.NewCallback(fcb) | |
| 1734 | + | glib.SaveCallback(cbPtr, cbRefPtr) | |
| 1735 | + | return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 1736 | + | } | |
| 1737 | + | ||
| 1655 | 1738 | // Emitted once per writability change event that affects this settings object. | |
| 1656 | 1739 | // | |
| 1657 | 1740 | // You should connect | |
| @@ -1717,6 +1800,28 @@ func (x *Settings) ConnectWritableChanged(cb *func(Settings, string)) uint32 { | |||
| 1717 | 1800 | return gobject.SignalConnect(x.GoPointer(), "writable-changed", cbRefPtr) | |
| 1718 | 1801 | } | |
| 1719 | 1802 | ||
| 1803 | + | // ConnectWritableChangedWithDetail connects to the "writable-changed" signal with a detail string. | |
| 1804 | + | // The detail is appended as "writable-changed::<detail>". | |
| 1805 | + | func (x *Settings) ConnectWritableChangedWithDetail(detail string, cb *func(Settings, string)) uint32 { | |
| 1806 | + | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 1807 | + | signalName := fmt.Sprintf("writable-changed::%s", detail) | |
| 1808 | + | if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { | |
| 1809 | + | return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 1810 | + | } | |
| 1811 | + | ||
| 1812 | + | fcb := func(clsPtr uintptr, KeyVarp string) { | |
| 1813 | + | fa := Settings{} | |
| 1814 | + | fa.Ptr = clsPtr | |
| 1815 | + | cbFn := *cb | |
| 1816 | + | ||
| 1817 | + | cbFn(fa, KeyVarp) | |
| 1818 | + | ||
| 1819 | + | } | |
| 1820 | + | cbRefPtr := purego.NewCallback(fcb) | |
| 1821 | + | glib.SaveCallback(cbPtr, cbRefPtr) | |
| 1822 | + | return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 1823 | + | } | |
| 1824 | + | ||
| 1720 | 1825 | var xSettingsListRelocatableSchemas func() []string | |
| 1721 | 1826 | ||
| 1722 | 1827 | // Deprecated. | |
M v4/gio/gsettingsbackend.go +3 -3
| @@ -318,7 +318,7 @@ const ( | |||
| 318 | 318 | SETTINGS_BACKEND_EXTENSION_POINT_NAME string = "gsettings-backend" | |
| 319 | 319 | ) | |
| 320 | 320 | ||
| 321 | - | var xKeyfileSettingsBackendNew func(string, string, string) uintptr | |
| 321 | + | var xKeyfileSettingsBackendNew func(string, string, uintptr) uintptr | |
| 322 | 322 | ||
| 323 | 323 | // Creates a keyfile-backed [class@Gio.SettingsBackend]. | |
| 324 | 324 | // | |
| @@ -369,10 +369,10 @@ var xKeyfileSettingsBackendNew func(string, string, string) uintptr | |||
| 369 | 369 | // the directory specified by the `GKeyfileSettingsBackend:defaults-dir` | |
| 370 | 370 | // property, and a list of locked keys from a text file with the name `locks` in | |
| 371 | 371 | // the same location. | |
| 372 | - | func KeyfileSettingsBackendNew(FilenameVar string, RootPathVar string, RootGroupVar string) *SettingsBackend { | |
| 372 | + | func KeyfileSettingsBackendNew(FilenameVar string, RootPathVar string, RootGroupVar *string) *SettingsBackend { | |
| 373 | 373 | var cls *SettingsBackend | |
| 374 | 374 | ||
| 375 | - | cret := xKeyfileSettingsBackendNew(FilenameVar, RootPathVar, RootGroupVar) | |
| 375 | + | cret := xKeyfileSettingsBackendNew(FilenameVar, RootPathVar, core.NullableStringToPtr(RootGroupVar)) | |
| 376 | 376 | ||
| 377 | 377 | if cret == 0 { | |
| 378 | 378 | return nil | |
M v4/gio/gsimpleaction.go +1 -1
| @@ -155,7 +155,7 @@ func (x *SimpleAction) GetPropertyEnabled() bool { | |||
| 155 | 155 | func (x *SimpleAction) SetPropertyName(value string) { | |
| 156 | 156 | var v gobject.Value | |
| 157 | 157 | v.Init(gobject.TypeStringVal) | |
| 158 | - | v.SetString(value) | |
| 158 | + | v.SetString(&value) | |
| 159 | 159 | x.SetProperty("name", &v) | |
| 160 | 160 | } | |
| 161 | 161 | ||
M v4/gio/gsimpleasyncresult.go +144 -9
| @@ -27,7 +27,22 @@ var xSimpleAsyncReportErrorInIdle func(uintptr, uintptr, uintptr, glib.Quark, in | |||
| 27 | 27 | // information. | |
| 28 | 28 | func SimpleAsyncReportErrorInIdle(ObjectVar *gobject.Object, CallbackVar *AsyncReadyCallback, UserDataVar uintptr, DomainVar glib.Quark, CodeVar int, FormatVar string, varArgs ...interface{}) { | |
| 29 | 29 | ||
| 30 | - | xSimpleAsyncReportErrorInIdle(ObjectVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar, DomainVar, CodeVar, FormatVar, varArgs...) | |
| 30 | + | var CallbackVarRef uintptr | |
| 31 | + | if CallbackVar != nil { | |
| 32 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 33 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 34 | + | CallbackVarRef = cbRefPtr | |
| 35 | + | } else { | |
| 36 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 37 | + | cbFn := *CallbackVar | |
| 38 | + | cbFn(arg0, arg1, arg2) | |
| 39 | + | } | |
| 40 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 41 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 42 | + | } | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | xSimpleAsyncReportErrorInIdle(ObjectVar.GoPointer(), CallbackVarRef, UserDataVar, DomainVar, CodeVar, FormatVar, varArgs...) | |
| 31 | 46 | ||
| 32 | 47 | } | |
| 33 | 48 | ||
| @@ -38,7 +53,22 @@ var xSimpleAsyncReportGerrorInIdle func(uintptr, uintptr, uintptr, *glib.Error) | |||
| 38 | 53 | // than building a new one. | |
| 39 | 54 | func SimpleAsyncReportGerrorInIdle(ObjectVar *gobject.Object, CallbackVar *AsyncReadyCallback, UserDataVar uintptr, ErrorVar *glib.Error) { | |
| 40 | 55 | ||
| 41 | - | xSimpleAsyncReportGerrorInIdle(ObjectVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar, ErrorVar) | |
| 56 | + | var CallbackVarRef uintptr | |
| 57 | + | if CallbackVar != nil { | |
| 58 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 59 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 60 | + | CallbackVarRef = cbRefPtr | |
| 61 | + | } else { | |
| 62 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 63 | + | cbFn := *CallbackVar | |
| 64 | + | cbFn(arg0, arg1, arg2) | |
| 65 | + | } | |
| 66 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 67 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 68 | + | } | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | xSimpleAsyncReportGerrorInIdle(ObjectVar.GoPointer(), CallbackVarRef, UserDataVar, ErrorVar) | |
| 42 | 72 | ||
| 43 | 73 | } | |
| 44 | 74 | ||
| @@ -49,7 +79,22 @@ var xSimpleAsyncReportTakeGerrorInIdle func(uintptr, uintptr, uintptr, *glib.Err | |||
| 49 | 79 | // ownership of @error, so the caller does not have to free it any more. | |
| 50 | 80 | func SimpleAsyncReportTakeGerrorInIdle(ObjectVar *gobject.Object, CallbackVar *AsyncReadyCallback, UserDataVar uintptr, ErrorVar *glib.Error) { | |
| 51 | 81 | ||
| 52 | - | xSimpleAsyncReportTakeGerrorInIdle(ObjectVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar, ErrorVar) | |
| 82 | + | var CallbackVarRef uintptr | |
| 83 | + | if CallbackVar != nil { | |
| 84 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 85 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 86 | + | CallbackVarRef = cbRefPtr | |
| 87 | + | } else { | |
| 88 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 89 | + | cbFn := *CallbackVar | |
| 90 | + | cbFn(arg0, arg1, arg2) | |
| 91 | + | } | |
| 92 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 93 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 94 | + | } | |
| 95 | + | } | |
| 96 | + | ||
| 97 | + | xSimpleAsyncReportTakeGerrorInIdle(ObjectVar.GoPointer(), CallbackVarRef, UserDataVar, ErrorVar) | |
| 53 | 98 | ||
| 54 | 99 | } | |
| 55 | 100 | ||
| @@ -257,7 +302,22 @@ var xNewSimpleAsyncResult func(uintptr, uintptr, uintptr, uintptr) uintptr | |||
| 257 | 302 | func NewSimpleAsyncResult(SourceObjectVar *gobject.Object, CallbackVar *AsyncReadyCallback, UserDataVar uintptr, SourceTagVar uintptr) *SimpleAsyncResult { | |
| 258 | 303 | var cls *SimpleAsyncResult | |
| 259 | 304 | ||
| 260 | - | cret := xNewSimpleAsyncResult(SourceObjectVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar, SourceTagVar) | |
| 305 | + | var CallbackVarRef uintptr | |
| 306 | + | if CallbackVar != nil { | |
| 307 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 308 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 309 | + | CallbackVarRef = cbRefPtr | |
| 310 | + | } else { | |
| 311 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 312 | + | cbFn := *CallbackVar | |
| 313 | + | cbFn(arg0, arg1, arg2) | |
| 314 | + | } | |
| 315 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 316 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 317 | + | } | |
| 318 | + | } | |
| 319 | + | ||
| 320 | + | cret := xNewSimpleAsyncResult(SourceObjectVar.GoPointer(), CallbackVarRef, UserDataVar, SourceTagVar) | |
| 261 | 321 | ||
| 262 | 322 | if cret == 0 { | |
| 263 | 323 | return nil | |
| @@ -273,7 +333,22 @@ var xNewSimpleAsyncResultError func(uintptr, uintptr, uintptr, glib.Quark, int, | |||
| 273 | 333 | func NewSimpleAsyncResultError(SourceObjectVar *gobject.Object, CallbackVar *AsyncReadyCallback, UserDataVar uintptr, DomainVar glib.Quark, CodeVar int, FormatVar string, varArgs ...interface{}) *SimpleAsyncResult { | |
| 274 | 334 | var cls *SimpleAsyncResult | |
| 275 | 335 | ||
| 276 | - | cret := xNewSimpleAsyncResultError(SourceObjectVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar, DomainVar, CodeVar, FormatVar, varArgs...) | |
| 336 | + | var CallbackVarRef uintptr | |
| 337 | + | if CallbackVar != nil { | |
| 338 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 339 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 340 | + | CallbackVarRef = cbRefPtr | |
| 341 | + | } else { | |
| 342 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 343 | + | cbFn := *CallbackVar | |
| 344 | + | cbFn(arg0, arg1, arg2) | |
| 345 | + | } | |
| 346 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 347 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 348 | + | } | |
| 349 | + | } | |
| 350 | + | ||
| 351 | + | cret := xNewSimpleAsyncResultError(SourceObjectVar.GoPointer(), CallbackVarRef, UserDataVar, DomainVar, CodeVar, FormatVar, varArgs...) | |
| 277 | 352 | ||
| 278 | 353 | if cret == 0 { | |
| 279 | 354 | return nil | |
| @@ -289,7 +364,22 @@ var xNewSimpleAsyncResultFromError func(uintptr, uintptr, uintptr, *glib.Error) | |||
| 289 | 364 | func NewSimpleAsyncResultFromError(SourceObjectVar *gobject.Object, CallbackVar *AsyncReadyCallback, UserDataVar uintptr, ErrorVar *glib.Error) *SimpleAsyncResult { | |
| 290 | 365 | var cls *SimpleAsyncResult | |
| 291 | 366 | ||
| 292 | - | cret := xNewSimpleAsyncResultFromError(SourceObjectVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar, ErrorVar) | |
| 367 | + | var CallbackVarRef uintptr | |
| 368 | + | if CallbackVar != nil { | |
| 369 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 370 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 371 | + | CallbackVarRef = cbRefPtr | |
| 372 | + | } else { | |
| 373 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 374 | + | cbFn := *CallbackVar | |
| 375 | + | cbFn(arg0, arg1, arg2) | |
| 376 | + | } | |
| 377 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 378 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 379 | + | } | |
| 380 | + | } | |
| 381 | + | ||
| 382 | + | cret := xNewSimpleAsyncResultFromError(SourceObjectVar.GoPointer(), CallbackVarRef, UserDataVar, ErrorVar) | |
| 293 | 383 | ||
| 294 | 384 | if cret == 0 { | |
| 295 | 385 | return nil | |
| @@ -306,7 +396,22 @@ var xNewSimpleAsyncResultTakeError func(uintptr, uintptr, uintptr, *glib.Error) | |||
| 306 | 396 | func NewSimpleAsyncResultTakeError(SourceObjectVar *gobject.Object, CallbackVar *AsyncReadyCallback, UserDataVar uintptr, ErrorVar *glib.Error) *SimpleAsyncResult { | |
| 307 | 397 | var cls *SimpleAsyncResult | |
| 308 | 398 | ||
| 309 | - | cret := xNewSimpleAsyncResultTakeError(SourceObjectVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar, ErrorVar) | |
| 399 | + | var CallbackVarRef uintptr | |
| 400 | + | if CallbackVar != nil { | |
| 401 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 402 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 403 | + | CallbackVarRef = cbRefPtr | |
| 404 | + | } else { | |
| 405 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 406 | + | cbFn := *CallbackVar | |
| 407 | + | cbFn(arg0, arg1, arg2) | |
| 408 | + | } | |
| 409 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 410 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 411 | + | } | |
| 412 | + | } | |
| 413 | + | ||
| 414 | + | cret := xNewSimpleAsyncResultTakeError(SourceObjectVar.GoPointer(), CallbackVarRef, UserDataVar, ErrorVar) | |
| 310 | 415 | ||
| 311 | 416 | if cret == 0 { | |
| 312 | 417 | return nil | |
| @@ -411,7 +516,22 @@ var xSimpleAsyncResultRunInThread func(uintptr, uintptr, int, uintptr) | |||
| 411 | 516 | // is needed to run the job and report its completion. | |
| 412 | 517 | func (x *SimpleAsyncResult) RunInThread(FuncVar *SimpleAsyncThreadFunc, IoPriorityVar int, CancellableVar *Cancellable) { | |
| 413 | 518 | ||
| 414 | - | xSimpleAsyncResultRunInThread(x.GoPointer(), glib.NewCallback(FuncVar), IoPriorityVar, CancellableVar.GoPointer()) | |
| 519 | + | var FuncVarRef uintptr | |
| 520 | + | if FuncVar != nil { | |
| 521 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 522 | + | if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok { | |
| 523 | + | FuncVarRef = cbRefPtr | |
| 524 | + | } else { | |
| 525 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 526 | + | cbFn := *FuncVar | |
| 527 | + | cbFn(arg0, arg1, arg2) | |
| 528 | + | } | |
| 529 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 530 | + | glib.SaveCallback(FuncVarPtr, FuncVarRef) | |
| 531 | + | } | |
| 532 | + | } | |
| 533 | + | ||
| 534 | + | xSimpleAsyncResultRunInThread(x.GoPointer(), FuncVarRef, IoPriorityVar, CancellableVar.GoPointer()) | |
| 415 | 535 | ||
| 416 | 536 | } | |
| 417 | 537 | ||
| @@ -493,7 +613,22 @@ var xSimpleAsyncResultSetOpResGpointer func(uintptr, uintptr, uintptr) | |||
| 493 | 613 | // Sets the operation result within the asynchronous result to a pointer. | |
| 494 | 614 | func (x *SimpleAsyncResult) SetOpResGpointer(OpResVar uintptr, DestroyOpResVar *glib.DestroyNotify) { | |
| 495 | 615 | ||
| 496 | - | xSimpleAsyncResultSetOpResGpointer(x.GoPointer(), OpResVar, glib.NewCallback(DestroyOpResVar)) | |
| 616 | + | var DestroyOpResVarRef uintptr | |
| 617 | + | if DestroyOpResVar != nil { | |
| 618 | + | DestroyOpResVarPtr := uintptr(unsafe.Pointer(DestroyOpResVar)) | |
| 619 | + | if cbRefPtr, ok := glib.GetCallback(DestroyOpResVarPtr); ok { | |
| 620 | + | DestroyOpResVarRef = cbRefPtr | |
| 621 | + | } else { | |
| 622 | + | fcb := func(arg0 uintptr) { | |
| 623 | + | cbFn := *DestroyOpResVar | |
| 624 | + | cbFn(arg0) | |
| 625 | + | } | |
| 626 | + | DestroyOpResVarRef = purego.NewCallback(fcb) | |
| 627 | + | glib.SaveCallback(DestroyOpResVarPtr, DestroyOpResVarRef) | |
| 628 | + | } | |
| 629 | + | } | |
| 630 | + | ||
| 631 | + | xSimpleAsyncResultSetOpResGpointer(x.GoPointer(), OpResVar, DestroyOpResVarRef) | |
| 497 | 632 | ||
| 498 | 633 | } | |
| 499 | 634 | ||
M v4/gio/gsimpleproxyresolver.go +7 -7
| @@ -179,7 +179,7 @@ func SimpleProxyResolverNewFromInternalPtr(ptr uintptr) *SimpleProxyResolver { | |||
| 179 | 179 | return cls | |
| 180 | 180 | } | |
| 181 | 181 | ||
| 182 | - | var xSimpleProxyResolverSetDefaultProxy func(uintptr, string) | |
| 182 | + | var xSimpleProxyResolverSetDefaultProxy func(uintptr, uintptr) | |
| 183 | 183 | ||
| 184 | 184 | // Sets the default proxy on @resolver, to be used for any URIs that | |
| 185 | 185 | // don't match #GSimpleProxyResolver:ignore-hosts or a proxy set | |
| @@ -188,9 +188,9 @@ var xSimpleProxyResolverSetDefaultProxy func(uintptr, string) | |||
| 188 | 188 | // If @default_proxy starts with "socks://", | |
| 189 | 189 | // #GSimpleProxyResolver will treat it as referring to all three of | |
| 190 | 190 | // the socks5, socks4a, and socks4 proxy types. | |
| 191 | - | func (x *SimpleProxyResolver) SetDefaultProxy(DefaultProxyVar string) { | |
| 191 | + | func (x *SimpleProxyResolver) SetDefaultProxy(DefaultProxyVar *string) { | |
| 192 | 192 | ||
| 193 | - | xSimpleProxyResolverSetDefaultProxy(x.GoPointer(), DefaultProxyVar) | |
| 193 | + | xSimpleProxyResolverSetDefaultProxy(x.GoPointer(), core.NullableStringToPtr(DefaultProxyVar)) | |
| 194 | 194 | ||
| 195 | 195 | } | |
| 196 | 196 | ||
| @@ -244,7 +244,7 @@ func (c *SimpleProxyResolver) SetGoPointer(ptr uintptr) { | |||
| 244 | 244 | func (x *SimpleProxyResolver) SetPropertyDefaultProxy(value string) { | |
| 245 | 245 | var v gobject.Value | |
| 246 | 246 | v.Init(gobject.TypeStringVal) | |
| 247 | - | v.SetString(value) | |
| 247 | + | v.SetString(&value) | |
| 248 | 248 | x.SetProperty("default-proxy", &v) | |
| 249 | 249 | } | |
| 250 | 250 | ||
| @@ -402,16 +402,16 @@ func (x *SimpleProxyResolver) LookupFinish(ResultVar AsyncResult) ([]string, err | |||
| 402 | 402 | ||
| 403 | 403 | } | |
| 404 | 404 | ||
| 405 | - | var xSimpleProxyResolverNew func(string, []string) uintptr | |
| 405 | + | var xSimpleProxyResolverNew func(uintptr, []string) uintptr | |
| 406 | 406 | ||
| 407 | 407 | // Creates a new #GSimpleProxyResolver. See | |
| 408 | 408 | // #GSimpleProxyResolver:default-proxy and | |
| 409 | 409 | // #GSimpleProxyResolver:ignore-hosts for more details on how the | |
| 410 | 410 | // arguments are interpreted. | |
| 411 | - | func SimpleProxyResolverNew(DefaultProxyVar string, IgnoreHostsVar []string) *ProxyResolverBase { | |
| 411 | + | func SimpleProxyResolverNew(DefaultProxyVar *string, IgnoreHostsVar []string) *ProxyResolverBase { | |
| 412 | 412 | var cls *ProxyResolverBase | |
| 413 | 413 | ||
| 414 | - | cret := xSimpleProxyResolverNew(DefaultProxyVar, IgnoreHostsVar) | |
| 414 | + | cret := xSimpleProxyResolverNew(core.NullableStringToPtr(DefaultProxyVar), IgnoreHostsVar) | |
| 415 | 415 | ||
| 416 | 416 | if cret == 0 { | |
| 417 | 417 | return nil | |
M v4/gio/gsocket.go +12 -12
| @@ -987,7 +987,7 @@ func (x *Socket) IsConnected() bool { | |||
| 987 | 987 | return cret | |
| 988 | 988 | } | |
| 989 | 989 | ||
| 990 | - | var xSocketJoinMulticastGroup func(uintptr, uintptr, bool, string, **glib.Error) bool | |
| 990 | + | var xSocketJoinMulticastGroup func(uintptr, uintptr, bool, uintptr, **glib.Error) bool | |
| 991 | 991 | ||
| 992 | 992 | // Registers @socket to receive multicast messages sent to @group. | |
| 993 | 993 | // @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have | |
| @@ -1003,10 +1003,10 @@ var xSocketJoinMulticastGroup func(uintptr, uintptr, bool, string, **glib.Error) | |||
| 1003 | 1003 | // | |
| 1004 | 1004 | // To bind to a given source-specific multicast address, use | |
| 1005 | 1005 | // g_socket_join_multicast_group_ssm() instead. | |
| 1006 | - | func (x *Socket) JoinMulticastGroup(GroupVar *InetAddress, SourceSpecificVar bool, IfaceVar string) (bool, error) { | |
| 1006 | + | func (x *Socket) JoinMulticastGroup(GroupVar *InetAddress, SourceSpecificVar bool, IfaceVar *string) (bool, error) { | |
| 1007 | 1007 | var cerr *glib.Error | |
| 1008 | 1008 | ||
| 1009 | - | cret := xSocketJoinMulticastGroup(x.GoPointer(), GroupVar.GoPointer(), SourceSpecificVar, IfaceVar, &cerr) | |
| 1009 | + | cret := xSocketJoinMulticastGroup(x.GoPointer(), GroupVar.GoPointer(), SourceSpecificVar, core.NullableStringToPtr(IfaceVar), &cerr) | |
| 1010 | 1010 | if cerr == nil { | |
| 1011 | 1011 | return cret, nil | |
| 1012 | 1012 | } | |
| @@ -1014,7 +1014,7 @@ func (x *Socket) JoinMulticastGroup(GroupVar *InetAddress, SourceSpecificVar boo | |||
| 1014 | 1014 | ||
| 1015 | 1015 | } | |
| 1016 | 1016 | ||
| 1017 | - | var xSocketJoinMulticastGroupSsm func(uintptr, uintptr, uintptr, string, **glib.Error) bool | |
| 1017 | + | var xSocketJoinMulticastGroupSsm func(uintptr, uintptr, uintptr, uintptr, **glib.Error) bool | |
| 1018 | 1018 | ||
| 1019 | 1019 | // Registers @socket to receive multicast messages sent to @group. | |
| 1020 | 1020 | // @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have | |
| @@ -1031,10 +1031,10 @@ var xSocketJoinMulticastGroupSsm func(uintptr, uintptr, uintptr, string, **glib. | |||
| 1031 | 1031 | // Note that this function can be called multiple times for the same | |
| 1032 | 1032 | // @group with different @source_specific in order to receive multicast | |
| 1033 | 1033 | // packets from more than one source. | |
| 1034 | - | func (x *Socket) JoinMulticastGroupSsm(GroupVar *InetAddress, SourceSpecificVar *InetAddress, IfaceVar string) (bool, error) { | |
| 1034 | + | func (x *Socket) JoinMulticastGroupSsm(GroupVar *InetAddress, SourceSpecificVar *InetAddress, IfaceVar *string) (bool, error) { | |
| 1035 | 1035 | var cerr *glib.Error | |
| 1036 | 1036 | ||
| 1037 | - | cret := xSocketJoinMulticastGroupSsm(x.GoPointer(), GroupVar.GoPointer(), SourceSpecificVar.GoPointer(), IfaceVar, &cerr) | |
| 1037 | + | cret := xSocketJoinMulticastGroupSsm(x.GoPointer(), GroupVar.GoPointer(), SourceSpecificVar.GoPointer(), core.NullableStringToPtr(IfaceVar), &cerr) | |
| 1038 | 1038 | if cerr == nil { | |
| 1039 | 1039 | return cret, nil | |
| 1040 | 1040 | } | |
| @@ -1042,7 +1042,7 @@ func (x *Socket) JoinMulticastGroupSsm(GroupVar *InetAddress, SourceSpecificVar | |||
| 1042 | 1042 | ||
| 1043 | 1043 | } | |
| 1044 | 1044 | ||
| 1045 | - | var xSocketLeaveMulticastGroup func(uintptr, uintptr, bool, string, **glib.Error) bool | |
| 1045 | + | var xSocketLeaveMulticastGroup func(uintptr, uintptr, bool, uintptr, **glib.Error) bool | |
| 1046 | 1046 | ||
| 1047 | 1047 | // Removes @socket from the multicast group defined by @group, @iface, | |
| 1048 | 1048 | // and @source_specific (which must all have the same values they had | |
| @@ -1053,10 +1053,10 @@ var xSocketLeaveMulticastGroup func(uintptr, uintptr, bool, string, **glib.Error | |||
| 1053 | 1053 | // | |
| 1054 | 1054 | // To unbind to a given source-specific multicast address, use | |
| 1055 | 1055 | // g_socket_leave_multicast_group_ssm() instead. | |
| 1056 | - | func (x *Socket) LeaveMulticastGroup(GroupVar *InetAddress, SourceSpecificVar bool, IfaceVar string) (bool, error) { | |
| 1056 | + | func (x *Socket) LeaveMulticastGroup(GroupVar *InetAddress, SourceSpecificVar bool, IfaceVar *string) (bool, error) { | |
| 1057 | 1057 | var cerr *glib.Error | |
| 1058 | 1058 | ||
| 1059 | - | cret := xSocketLeaveMulticastGroup(x.GoPointer(), GroupVar.GoPointer(), SourceSpecificVar, IfaceVar, &cerr) | |
| 1059 | + | cret := xSocketLeaveMulticastGroup(x.GoPointer(), GroupVar.GoPointer(), SourceSpecificVar, core.NullableStringToPtr(IfaceVar), &cerr) | |
| 1060 | 1060 | if cerr == nil { | |
| 1061 | 1061 | return cret, nil | |
| 1062 | 1062 | } | |
| @@ -1064,7 +1064,7 @@ func (x *Socket) LeaveMulticastGroup(GroupVar *InetAddress, SourceSpecificVar bo | |||
| 1064 | 1064 | ||
| 1065 | 1065 | } | |
| 1066 | 1066 | ||
| 1067 | - | var xSocketLeaveMulticastGroupSsm func(uintptr, uintptr, uintptr, string, **glib.Error) bool | |
| 1067 | + | var xSocketLeaveMulticastGroupSsm func(uintptr, uintptr, uintptr, uintptr, **glib.Error) bool | |
| 1068 | 1068 | ||
| 1069 | 1069 | // Removes @socket from the multicast group defined by @group, @iface, | |
| 1070 | 1070 | // and @source_specific (which must all have the same values they had | |
| @@ -1072,10 +1072,10 @@ var xSocketLeaveMulticastGroupSsm func(uintptr, uintptr, uintptr, string, **glib | |||
| 1072 | 1072 | // | |
| 1073 | 1073 | // @socket remains bound to its address and port, and can still receive | |
| 1074 | 1074 | // unicast messages after calling this. | |
| 1075 | - | func (x *Socket) LeaveMulticastGroupSsm(GroupVar *InetAddress, SourceSpecificVar *InetAddress, IfaceVar string) (bool, error) { | |
| 1075 | + | func (x *Socket) LeaveMulticastGroupSsm(GroupVar *InetAddress, SourceSpecificVar *InetAddress, IfaceVar *string) (bool, error) { | |
| 1076 | 1076 | var cerr *glib.Error | |
| 1077 | 1077 | ||
| 1078 | - | cret := xSocketLeaveMulticastGroupSsm(x.GoPointer(), GroupVar.GoPointer(), SourceSpecificVar.GoPointer(), IfaceVar, &cerr) | |
| 1078 | + | cret := xSocketLeaveMulticastGroupSsm(x.GoPointer(), GroupVar.GoPointer(), SourceSpecificVar.GoPointer(), core.NullableStringToPtr(IfaceVar), &cerr) | |
| 1079 | 1079 | if cerr == nil { | |
| 1080 | 1080 | return cret, nil | |
| 1081 | 1081 | } | |
M v4/gio/gsocketaddressenumerator.go +16 -1
| @@ -197,7 +197,22 @@ var xSocketAddressEnumeratorNextAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 197 | 197 | // It is an error to call this multiple times before the previous callback has finished. | |
| 198 | 198 | func (x *SocketAddressEnumerator) NextAsync(CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 199 | 199 | ||
| 200 | - | xSocketAddressEnumeratorNextAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 200 | + | var CallbackVarRef uintptr | |
| 201 | + | if CallbackVar != nil { | |
| 202 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 203 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 204 | + | CallbackVarRef = cbRefPtr | |
| 205 | + | } else { | |
| 206 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 207 | + | cbFn := *CallbackVar | |
| 208 | + | cbFn(arg0, arg1, arg2) | |
| 209 | + | } | |
| 210 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 211 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 212 | + | } | |
| 213 | + | } | |
| 214 | + | ||
| 215 | + | xSocketAddressEnumeratorNextAsync(x.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 201 | 216 | ||
| 202 | 217 | } | |
| 203 | 218 | ||
M v4/gio/gsocketclient.go +64 -4
| @@ -283,7 +283,22 @@ var xSocketClientConnectAsync func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||
| 283 | 283 | // the result of the operation. | |
| 284 | 284 | func (x *SocketClient) ConnectAsync(ConnectableVar SocketConnectable, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 285 | 285 | ||
| 286 | - | xSocketClientConnectAsync(x.GoPointer(), ConnectableVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 286 | + | var CallbackVarRef uintptr | |
| 287 | + | if CallbackVar != nil { | |
| 288 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 289 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 290 | + | CallbackVarRef = cbRefPtr | |
| 291 | + | } else { | |
| 292 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 293 | + | cbFn := *CallbackVar | |
| 294 | + | cbFn(arg0, arg1, arg2) | |
| 295 | + | } | |
| 296 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 297 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 298 | + | } | |
| 299 | + | } | |
| 300 | + | ||
| 301 | + | xSocketClientConnectAsync(x.GoPointer(), ConnectableVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 287 | 302 | ||
| 288 | 303 | } | |
| 289 | 304 | ||
| @@ -367,7 +382,22 @@ var xSocketClientConnectToHostAsync func(uintptr, string, uint16, uintptr, uintp | |||
| 367 | 382 | // the result of the operation. | |
| 368 | 383 | func (x *SocketClient) ConnectToHostAsync(HostAndPortVar string, DefaultPortVar uint16, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 369 | 384 | ||
| 370 | - | xSocketClientConnectToHostAsync(x.GoPointer(), HostAndPortVar, DefaultPortVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 385 | + | var CallbackVarRef uintptr | |
| 386 | + | if CallbackVar != nil { | |
| 387 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 388 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 389 | + | CallbackVarRef = cbRefPtr | |
| 390 | + | } else { | |
| 391 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 392 | + | cbFn := *CallbackVar | |
| 393 | + | cbFn(arg0, arg1, arg2) | |
| 394 | + | } | |
| 395 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 396 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 397 | + | } | |
| 398 | + | } | |
| 399 | + | ||
| 400 | + | xSocketClientConnectToHostAsync(x.GoPointer(), HostAndPortVar, DefaultPortVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 371 | 401 | ||
| 372 | 402 | } | |
| 373 | 403 | ||
| @@ -432,7 +462,22 @@ var xSocketClientConnectToServiceAsync func(uintptr, string, string, uintptr, ui | |||
| 432 | 462 | // g_socket_client_connect_to_service(). | |
| 433 | 463 | func (x *SocketClient) ConnectToServiceAsync(DomainVar string, ServiceVar string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 434 | 464 | ||
| 435 | - | xSocketClientConnectToServiceAsync(x.GoPointer(), DomainVar, ServiceVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 465 | + | var CallbackVarRef uintptr | |
| 466 | + | if CallbackVar != nil { | |
| 467 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 468 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 469 | + | CallbackVarRef = cbRefPtr | |
| 470 | + | } else { | |
| 471 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 472 | + | cbFn := *CallbackVar | |
| 473 | + | cbFn(arg0, arg1, arg2) | |
| 474 | + | } | |
| 475 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 476 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 477 | + | } | |
| 478 | + | } | |
| 479 | + | ||
| 480 | + | xSocketClientConnectToServiceAsync(x.GoPointer(), DomainVar, ServiceVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 436 | 481 | ||
| 437 | 482 | } | |
| 438 | 483 | ||
| @@ -507,7 +552,22 @@ var xSocketClientConnectToUriAsync func(uintptr, string, uint16, uintptr, uintpt | |||
| 507 | 552 | // the result of the operation. | |
| 508 | 553 | func (x *SocketClient) ConnectToUriAsync(UriVar string, DefaultPortVar uint16, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 509 | 554 | ||
| 510 | - | xSocketClientConnectToUriAsync(x.GoPointer(), UriVar, DefaultPortVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 555 | + | var CallbackVarRef uintptr | |
| 556 | + | if CallbackVar != nil { | |
| 557 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 558 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 559 | + | CallbackVarRef = cbRefPtr | |
| 560 | + | } else { | |
| 561 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 562 | + | cbFn := *CallbackVar | |
| 563 | + | cbFn(arg0, arg1, arg2) | |
| 564 | + | } | |
| 565 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 566 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 567 | + | } | |
| 568 | + | } | |
| 569 | + | ||
| 570 | + | xSocketClientConnectToUriAsync(x.GoPointer(), UriVar, DefaultPortVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 511 | 571 | ||
| 512 | 572 | } | |
| 513 | 573 | ||
M v4/gio/gsocketconnection.go +16 -1
| @@ -240,7 +240,22 @@ var xSocketConnectionConnectAsync func(uintptr, uintptr, uintptr, uintptr, uintp | |||
| 240 | 240 | // Use g_socket_connection_connect_finish() to retrieve the result. | |
| 241 | 241 | func (x *SocketConnection) ConnectAsync(AddressVar *SocketAddress, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 242 | 242 | ||
| 243 | - | xSocketConnectionConnectAsync(x.GoPointer(), AddressVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 243 | + | var CallbackVarRef uintptr | |
| 244 | + | if CallbackVar != nil { | |
| 245 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 246 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 247 | + | CallbackVarRef = cbRefPtr | |
| 248 | + | } else { | |
| 249 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 250 | + | cbFn := *CallbackVar | |
| 251 | + | cbFn(arg0, arg1, arg2) | |
| 252 | + | } | |
| 253 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 254 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 255 | + | } | |
| 256 | + | } | |
| 257 | + | ||
| 258 | + | xSocketConnectionConnectAsync(x.GoPointer(), AddressVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 244 | 259 | ||
| 245 | 260 | } | |
| 246 | 261 | ||
M v4/gio/gsocketlistener.go +32 -2
| @@ -297,7 +297,22 @@ var xSocketListenerAcceptAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 297 | 297 | // to get the result of the operation. | |
| 298 | 298 | func (x *SocketListener) AcceptAsync(CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 299 | 299 | ||
| 300 | - | xSocketListenerAcceptAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 300 | + | var CallbackVarRef uintptr | |
| 301 | + | if CallbackVar != nil { | |
| 302 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 303 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 304 | + | CallbackVarRef = cbRefPtr | |
| 305 | + | } else { | |
| 306 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 307 | + | cbFn := *CallbackVar | |
| 308 | + | cbFn(arg0, arg1, arg2) | |
| 309 | + | } | |
| 310 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 311 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 312 | + | } | |
| 313 | + | } | |
| 314 | + | ||
| 315 | + | xSocketListenerAcceptAsync(x.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 301 | 316 | ||
| 302 | 317 | } | |
| 303 | 318 | ||
| @@ -365,7 +380,22 @@ var xSocketListenerAcceptSocketAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 365 | 380 | // to get the result of the operation. | |
| 366 | 381 | func (x *SocketListener) AcceptSocketAsync(CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 367 | 382 | ||
| 368 | - | xSocketListenerAcceptSocketAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 383 | + | var CallbackVarRef uintptr | |
| 384 | + | if CallbackVar != nil { | |
| 385 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 386 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 387 | + | CallbackVarRef = cbRefPtr | |
| 388 | + | } else { | |
| 389 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 390 | + | cbFn := *CallbackVar | |
| 391 | + | cbFn(arg0, arg1, arg2) | |
| 392 | + | } | |
| 393 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 394 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 395 | + | } | |
| 396 | + | } | |
| 397 | + | ||
| 398 | + | xSocketListenerAcceptSocketAsync(x.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 369 | 399 | ||
| 370 | 400 | } | |
| 371 | 401 | ||
M v4/gio/gsubprocess.go +69 -9
| @@ -195,7 +195,22 @@ var xSubprocessCommunicateAsync func(uintptr, *glib.Bytes, uintptr, uintptr, uin | |||
| 195 | 195 | // invocation with g_subprocess_communicate_finish(). | |
| 196 | 196 | func (x *Subprocess) CommunicateAsync(StdinBufVar *glib.Bytes, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 197 | 197 | ||
| 198 | - | xSubprocessCommunicateAsync(x.GoPointer(), StdinBufVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 198 | + | var CallbackVarRef uintptr | |
| 199 | + | if CallbackVar != nil { | |
| 200 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 201 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 202 | + | CallbackVarRef = cbRefPtr | |
| 203 | + | } else { | |
| 204 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 205 | + | cbFn := *CallbackVar | |
| 206 | + | cbFn(arg0, arg1, arg2) | |
| 207 | + | } | |
| 208 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 209 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 210 | + | } | |
| 211 | + | } | |
| 212 | + | ||
| 213 | + | xSubprocessCommunicateAsync(x.GoPointer(), StdinBufVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 199 | 214 | ||
| 200 | 215 | } | |
| 201 | 216 | ||
| @@ -213,17 +228,17 @@ func (x *Subprocess) CommunicateFinish(ResultVar AsyncResult, StdoutBufVar **gli | |||
| 213 | 228 | ||
| 214 | 229 | } | |
| 215 | 230 | ||
| 216 | - | var xSubprocessCommunicateUtf8 func(uintptr, string, uintptr, *string, *string, **glib.Error) bool | |
| 231 | + | var xSubprocessCommunicateUtf8 func(uintptr, uintptr, uintptr, *string, *string, **glib.Error) bool | |
| 217 | 232 | ||
| 218 | 233 | // Like g_subprocess_communicate(), but validates the output of the | |
| 219 | 234 | // process as UTF-8, and returns it as a regular NUL terminated string. | |
| 220 | 235 | // | |
| 221 | 236 | // On error, @stdout_buf and @stderr_buf will be set to undefined values and | |
| 222 | 237 | // should not be used. | |
| 223 | - | func (x *Subprocess) CommunicateUtf8(StdinBufVar string, CancellableVar *Cancellable, StdoutBufVar *string, StderrBufVar *string) (bool, error) { | |
| 238 | + | func (x *Subprocess) CommunicateUtf8(StdinBufVar *string, CancellableVar *Cancellable, StdoutBufVar *string, StderrBufVar *string) (bool, error) { | |
| 224 | 239 | var cerr *glib.Error | |
| 225 | 240 | ||
| 226 | - | cret := xSubprocessCommunicateUtf8(x.GoPointer(), StdinBufVar, CancellableVar.GoPointer(), StdoutBufVar, StderrBufVar, &cerr) | |
| 241 | + | cret := xSubprocessCommunicateUtf8(x.GoPointer(), core.NullableStringToPtr(StdinBufVar), CancellableVar.GoPointer(), StdoutBufVar, StderrBufVar, &cerr) | |
| 227 | 242 | if cerr == nil { | |
| 228 | 243 | return cret, nil | |
| 229 | 244 | } | |
| @@ -231,13 +246,28 @@ func (x *Subprocess) CommunicateUtf8(StdinBufVar string, CancellableVar *Cancell | |||
| 231 | 246 | ||
| 232 | 247 | } | |
| 233 | 248 | ||
| 234 | - | var xSubprocessCommunicateUtf8Async func(uintptr, string, uintptr, uintptr, uintptr) | |
| 249 | + | var xSubprocessCommunicateUtf8Async func(uintptr, uintptr, uintptr, uintptr, uintptr) | |
| 235 | 250 | ||
| 236 | 251 | // Asynchronous version of g_subprocess_communicate_utf8(). Complete | |
| 237 | 252 | // invocation with g_subprocess_communicate_utf8_finish(). | |
| 238 | - | func (x *Subprocess) CommunicateUtf8Async(StdinBufVar string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 253 | + | func (x *Subprocess) CommunicateUtf8Async(StdinBufVar *string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 254 | + | ||
| 255 | + | var CallbackVarRef uintptr | |
| 256 | + | if CallbackVar != nil { | |
| 257 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 258 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 259 | + | CallbackVarRef = cbRefPtr | |
| 260 | + | } else { | |
| 261 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 262 | + | cbFn := *CallbackVar | |
| 263 | + | cbFn(arg0, arg1, arg2) | |
| 264 | + | } | |
| 265 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 266 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 267 | + | } | |
| 268 | + | } | |
| 239 | 269 | ||
| 240 | - | xSubprocessCommunicateUtf8Async(x.GoPointer(), StdinBufVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 270 | + | xSubprocessCommunicateUtf8Async(x.GoPointer(), core.NullableStringToPtr(StdinBufVar), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 241 | 271 | ||
| 242 | 272 | } | |
| 243 | 273 | ||
| @@ -483,7 +513,22 @@ var xSubprocessWaitAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 483 | 513 | // This is the asynchronous version of g_subprocess_wait(). | |
| 484 | 514 | func (x *Subprocess) WaitAsync(CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 485 | 515 | ||
| 486 | - | xSubprocessWaitAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 516 | + | var CallbackVarRef uintptr | |
| 517 | + | if CallbackVar != nil { | |
| 518 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 519 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 520 | + | CallbackVarRef = cbRefPtr | |
| 521 | + | } else { | |
| 522 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 523 | + | cbFn := *CallbackVar | |
| 524 | + | cbFn(arg0, arg1, arg2) | |
| 525 | + | } | |
| 526 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 527 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 528 | + | } | |
| 529 | + | } | |
| 530 | + | ||
| 531 | + | xSubprocessWaitAsync(x.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 487 | 532 | ||
| 488 | 533 | } | |
| 489 | 534 | ||
| @@ -508,7 +553,22 @@ var xSubprocessWaitCheckAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 508 | 553 | // This is the asynchronous version of g_subprocess_wait_check(). | |
| 509 | 554 | func (x *Subprocess) WaitCheckAsync(CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 510 | 555 | ||
| 511 | - | xSubprocessWaitCheckAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 556 | + | var CallbackVarRef uintptr | |
| 557 | + | if CallbackVar != nil { | |
| 558 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 559 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 560 | + | CallbackVarRef = cbRefPtr | |
| 561 | + | } else { | |
| 562 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 563 | + | cbFn := *CallbackVar | |
| 564 | + | cbFn(arg0, arg1, arg2) | |
| 565 | + | } | |
| 566 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 567 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 568 | + | } | |
| 569 | + | } | |
| 570 | + | ||
| 571 | + | xSubprocessWaitCheckAsync(x.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 512 | 572 | ||
| 513 | 573 | } | |
| 514 | 574 | ||
M v4/gio/gsubprocesslauncher.go +42 -10
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | package gio | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 5 | 7 | "github.com/jwijenbergh/purego" | |
| 6 | 8 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 9 | "github.com/jwijenbergh/puregotk/v4/glib" | |
| @@ -101,7 +103,37 @@ var xSubprocessLauncherSetChildSetup func(uintptr, uintptr, uintptr, uintptr) | |||
| 101 | 103 | // Child setup functions are only available on UNIX. | |
| 102 | 104 | func (x *SubprocessLauncher) SetChildSetup(ChildSetupVar *glib.SpawnChildSetupFunc, UserDataVar uintptr, DestroyNotifyVar *glib.DestroyNotify) { | |
| 103 | 105 | ||
| 104 | - | xSubprocessLauncherSetChildSetup(x.GoPointer(), glib.NewCallback(ChildSetupVar), UserDataVar, glib.NewCallback(DestroyNotifyVar)) | |
| 106 | + | var ChildSetupVarRef uintptr | |
| 107 | + | if ChildSetupVar != nil { | |
| 108 | + | ChildSetupVarPtr := uintptr(unsafe.Pointer(ChildSetupVar)) | |
| 109 | + | if cbRefPtr, ok := glib.GetCallback(ChildSetupVarPtr); ok { | |
| 110 | + | ChildSetupVarRef = cbRefPtr | |
| 111 | + | } else { | |
| 112 | + | fcb := func(arg0 uintptr) { | |
| 113 | + | cbFn := *ChildSetupVar | |
| 114 | + | cbFn(arg0) | |
| 115 | + | } | |
| 116 | + | ChildSetupVarRef = purego.NewCallback(fcb) | |
| 117 | + | glib.SaveCallback(ChildSetupVarPtr, ChildSetupVarRef) | |
| 118 | + | } | |
| 119 | + | } | |
| 120 | + | ||
| 121 | + | var DestroyNotifyVarRef uintptr | |
| 122 | + | if DestroyNotifyVar != nil { | |
| 123 | + | DestroyNotifyVarPtr := uintptr(unsafe.Pointer(DestroyNotifyVar)) | |
| 124 | + | if cbRefPtr, ok := glib.GetCallback(DestroyNotifyVarPtr); ok { | |
| 125 | + | DestroyNotifyVarRef = cbRefPtr | |
| 126 | + | } else { | |
| 127 | + | fcb := func(arg0 uintptr) { | |
| 128 | + | cbFn := *DestroyNotifyVar | |
| 129 | + | cbFn(arg0) | |
| 130 | + | } | |
| 131 | + | DestroyNotifyVarRef = purego.NewCallback(fcb) | |
| 132 | + | glib.SaveCallback(DestroyNotifyVarPtr, DestroyNotifyVarRef) | |
| 133 | + | } | |
| 134 | + | } | |
| 135 | + | ||
| 136 | + | xSubprocessLauncherSetChildSetup(x.GoPointer(), ChildSetupVarRef, UserDataVar, DestroyNotifyVarRef) | |
| 105 | 137 | ||
| 106 | 138 | } | |
| 107 | 139 | ||
| @@ -165,7 +197,7 @@ func (x *SubprocessLauncher) SetFlags(FlagsVar SubprocessFlags) { | |||
| 165 | 197 | ||
| 166 | 198 | } | |
| 167 | 199 | ||
| 168 | - | var xSubprocessLauncherSetStderrFilePath func(uintptr, string) | |
| 200 | + | var xSubprocessLauncherSetStderrFilePath func(uintptr, uintptr) | |
| 169 | 201 | ||
| 170 | 202 | // Sets the file path to use as the stderr for spawned processes. | |
| 171 | 203 | // | |
| @@ -181,13 +213,13 @@ var xSubprocessLauncherSetStderrFilePath func(uintptr, string) | |||
| 181 | 213 | // if the launcher flags contain any flags directing stderr elsewhere. | |
| 182 | 214 | // | |
| 183 | 215 | // This feature is only available on UNIX. | |
| 184 | - | func (x *SubprocessLauncher) SetStderrFilePath(PathVar string) { | |
| 216 | + | func (x *SubprocessLauncher) SetStderrFilePath(PathVar *string) { | |
| 185 | 217 | ||
| 186 | - | xSubprocessLauncherSetStderrFilePath(x.GoPointer(), PathVar) | |
| 218 | + | xSubprocessLauncherSetStderrFilePath(x.GoPointer(), core.NullableStringToPtr(PathVar)) | |
| 187 | 219 | ||
| 188 | 220 | } | |
| 189 | 221 | ||
| 190 | - | var xSubprocessLauncherSetStdinFilePath func(uintptr, string) | |
| 222 | + | var xSubprocessLauncherSetStdinFilePath func(uintptr, uintptr) | |
| 191 | 223 | ||
| 192 | 224 | // Sets the file path to use as the stdin for spawned processes. | |
| 193 | 225 | // | |
| @@ -199,13 +231,13 @@ var xSubprocessLauncherSetStdinFilePath func(uintptr, string) | |||
| 199 | 231 | // the launcher flags contain any flags directing stdin elsewhere. | |
| 200 | 232 | // | |
| 201 | 233 | // This feature is only available on UNIX. | |
| 202 | - | func (x *SubprocessLauncher) SetStdinFilePath(PathVar string) { | |
| 234 | + | func (x *SubprocessLauncher) SetStdinFilePath(PathVar *string) { | |
| 203 | 235 | ||
| 204 | - | xSubprocessLauncherSetStdinFilePath(x.GoPointer(), PathVar) | |
| 236 | + | xSubprocessLauncherSetStdinFilePath(x.GoPointer(), core.NullableStringToPtr(PathVar)) | |
| 205 | 237 | ||
| 206 | 238 | } | |
| 207 | 239 | ||
| 208 | - | var xSubprocessLauncherSetStdoutFilePath func(uintptr, string) | |
| 240 | + | var xSubprocessLauncherSetStdoutFilePath func(uintptr, uintptr) | |
| 209 | 241 | ||
| 210 | 242 | // Sets the file path to use as the stdout for spawned processes. | |
| 211 | 243 | // | |
| @@ -218,9 +250,9 @@ var xSubprocessLauncherSetStdoutFilePath func(uintptr, string) | |||
| 218 | 250 | // if the launcher flags contain any flags directing stdout elsewhere. | |
| 219 | 251 | // | |
| 220 | 252 | // This feature is only available on UNIX. | |
| 221 | - | func (x *SubprocessLauncher) SetStdoutFilePath(PathVar string) { | |
| 253 | + | func (x *SubprocessLauncher) SetStdoutFilePath(PathVar *string) { | |
| 222 | 254 | ||
| 223 | - | xSubprocessLauncherSetStdoutFilePath(x.GoPointer(), PathVar) | |
| 255 | + | xSubprocessLauncherSetStdoutFilePath(x.GoPointer(), core.NullableStringToPtr(PathVar)) | |
| 224 | 256 | ||
| 225 | 257 | } | |
| 226 | 258 | ||
M v4/gio/gtask.go +134 -14
| @@ -633,7 +633,22 @@ var xNewTask func(uintptr, uintptr, uintptr, uintptr) uintptr | |||
| 633 | 633 | func NewTask(SourceObjectVar *gobject.Object, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, CallbackDataVar uintptr) *Task { | |
| 634 | 634 | var cls *Task | |
| 635 | 635 | ||
| 636 | - | cret := xNewTask(SourceObjectVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), CallbackDataVar) | |
| 636 | + | var CallbackVarRef uintptr | |
| 637 | + | if CallbackVar != nil { | |
| 638 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 639 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 640 | + | CallbackVarRef = cbRefPtr | |
| 641 | + | } else { | |
| 642 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 643 | + | cbFn := *CallbackVar | |
| 644 | + | cbFn(arg0, arg1, arg2) | |
| 645 | + | } | |
| 646 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 647 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 648 | + | } | |
| 649 | + | } | |
| 650 | + | ||
| 651 | + | cret := xNewTask(SourceObjectVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, CallbackDataVar) | |
| 637 | 652 | ||
| 638 | 653 | if cret == 0 { | |
| 639 | 654 | return nil | |
| @@ -658,7 +673,22 @@ var xTaskAttachSource func(uintptr, *glib.Source, uintptr) | |||
| 658 | 673 | // This takes a reference on @task until @source is destroyed. | |
| 659 | 674 | func (x *Task) AttachSource(SourceVar *glib.Source, CallbackVar *glib.SourceFunc) { | |
| 660 | 675 | ||
| 661 | - | xTaskAttachSource(x.GoPointer(), SourceVar, glib.NewCallback(CallbackVar)) | |
| 676 | + | var CallbackVarRef uintptr | |
| 677 | + | if CallbackVar != nil { | |
| 678 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 679 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 680 | + | CallbackVarRef = cbRefPtr | |
| 681 | + | } else { | |
| 682 | + | fcb := func(arg0 uintptr) bool { | |
| 683 | + | cbFn := *CallbackVar | |
| 684 | + | return cbFn(arg0) | |
| 685 | + | } | |
| 686 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 687 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 688 | + | } | |
| 689 | + | } | |
| 690 | + | ||
| 691 | + | xTaskAttachSource(x.GoPointer(), SourceVar, CallbackVarRef) | |
| 662 | 692 | ||
| 663 | 693 | } | |
| 664 | 694 | ||
| @@ -977,7 +1007,22 @@ var xTaskReturnPointer func(uintptr, uintptr, uintptr) | |||
| 977 | 1007 | // reference on it. | |
| 978 | 1008 | func (x *Task) ReturnPointer(ResultVar uintptr, ResultDestroyVar *glib.DestroyNotify) { | |
| 979 | 1009 | ||
| 980 | - | xTaskReturnPointer(x.GoPointer(), ResultVar, glib.NewCallbackNullable(ResultDestroyVar)) | |
| 1010 | + | var ResultDestroyVarRef uintptr | |
| 1011 | + | if ResultDestroyVar != nil { | |
| 1012 | + | ResultDestroyVarPtr := uintptr(unsafe.Pointer(ResultDestroyVar)) | |
| 1013 | + | if cbRefPtr, ok := glib.GetCallback(ResultDestroyVarPtr); ok { | |
| 1014 | + | ResultDestroyVarRef = cbRefPtr | |
| 1015 | + | } else { | |
| 1016 | + | fcb := func(arg0 uintptr) { | |
| 1017 | + | cbFn := *ResultDestroyVar | |
| 1018 | + | cbFn(arg0) | |
| 1019 | + | } | |
| 1020 | + | ResultDestroyVarRef = purego.NewCallback(fcb) | |
| 1021 | + | glib.SaveCallback(ResultDestroyVarPtr, ResultDestroyVarRef) | |
| 1022 | + | } | |
| 1023 | + | } | |
| 1024 | + | ||
| 1025 | + | xTaskReturnPointer(x.GoPointer(), ResultVar, ResultDestroyVarRef) | |
| 981 | 1026 | ||
| 982 | 1027 | } | |
| 983 | 1028 | ||
| @@ -1040,7 +1085,22 @@ var xTaskRunInThread func(uintptr, uintptr) | |||
| 1040 | 1085 | // g_task_run_in_thread(). | |
| 1041 | 1086 | func (x *Task) RunInThread(TaskFuncVar *TaskThreadFunc) { | |
| 1042 | 1087 | ||
| 1043 | - | xTaskRunInThread(x.GoPointer(), glib.NewCallback(TaskFuncVar)) | |
| 1088 | + | var TaskFuncVarRef uintptr | |
| 1089 | + | if TaskFuncVar != nil { | |
| 1090 | + | TaskFuncVarPtr := uintptr(unsafe.Pointer(TaskFuncVar)) | |
| 1091 | + | if cbRefPtr, ok := glib.GetCallback(TaskFuncVarPtr); ok { | |
| 1092 | + | TaskFuncVarRef = cbRefPtr | |
| 1093 | + | } else { | |
| 1094 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr, arg3 uintptr) { | |
| 1095 | + | cbFn := *TaskFuncVar | |
| 1096 | + | cbFn(arg0, arg1, arg2, arg3) | |
| 1097 | + | } | |
| 1098 | + | TaskFuncVarRef = purego.NewCallback(fcb) | |
| 1099 | + | glib.SaveCallback(TaskFuncVarPtr, TaskFuncVarRef) | |
| 1100 | + | } | |
| 1101 | + | } | |
| 1102 | + | ||
| 1103 | + | xTaskRunInThread(x.GoPointer(), TaskFuncVarRef) | |
| 1044 | 1104 | ||
| 1045 | 1105 | } | |
| 1046 | 1106 | ||
| @@ -1064,7 +1124,22 @@ var xTaskRunInThreadSync func(uintptr, uintptr) | |||
| 1064 | 1124 | // limited number of them at a time. | |
| 1065 | 1125 | func (x *Task) RunInThreadSync(TaskFuncVar *TaskThreadFunc) { | |
| 1066 | 1126 | ||
| 1067 | - | xTaskRunInThreadSync(x.GoPointer(), glib.NewCallback(TaskFuncVar)) | |
| 1127 | + | var TaskFuncVarRef uintptr | |
| 1128 | + | if TaskFuncVar != nil { | |
| 1129 | + | TaskFuncVarPtr := uintptr(unsafe.Pointer(TaskFuncVar)) | |
| 1130 | + | if cbRefPtr, ok := glib.GetCallback(TaskFuncVarPtr); ok { | |
| 1131 | + | TaskFuncVarRef = cbRefPtr | |
| 1132 | + | } else { | |
| 1133 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr, arg3 uintptr) { | |
| 1134 | + | cbFn := *TaskFuncVar | |
| 1135 | + | cbFn(arg0, arg1, arg2, arg3) | |
| 1136 | + | } | |
| 1137 | + | TaskFuncVarRef = purego.NewCallback(fcb) | |
| 1138 | + | glib.SaveCallback(TaskFuncVarPtr, TaskFuncVarRef) | |
| 1139 | + | } | |
| 1140 | + | } | |
| 1141 | + | ||
| 1142 | + | xTaskRunInThreadSync(x.GoPointer(), TaskFuncVarRef) | |
| 1068 | 1143 | ||
| 1069 | 1144 | } | |
| 1070 | 1145 | ||
| @@ -1090,7 +1165,7 @@ func (x *Task) SetCheckCancellable(CheckCancellableVar bool) { | |||
| 1090 | 1165 | ||
| 1091 | 1166 | } | |
| 1092 | 1167 | ||
| 1093 | - | var xTaskSetName func(uintptr, string) | |
| 1168 | + | var xTaskSetName func(uintptr, uintptr) | |
| 1094 | 1169 | ||
| 1095 | 1170 | // Sets @task’s name, used in debugging and profiling. The name defaults to | |
| 1096 | 1171 | // %NULL. | |
| @@ -1101,9 +1176,9 @@ var xTaskSetName func(uintptr, string) | |||
| 1101 | 1176 | // | |
| 1102 | 1177 | // This function may only be called before the @task is first used in a thread | |
| 1103 | 1178 | // other than the one it was constructed in. | |
| 1104 | - | func (x *Task) SetName(NameVar string) { | |
| 1179 | + | func (x *Task) SetName(NameVar *string) { | |
| 1105 | 1180 | ||
| 1106 | - | xTaskSetName(x.GoPointer(), NameVar) | |
| 1181 | + | xTaskSetName(x.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 1107 | 1182 | ||
| 1108 | 1183 | } | |
| 1109 | 1184 | ||
| @@ -1178,7 +1253,7 @@ func (x *Task) SetSourceTag(SourceTagVar uintptr) { | |||
| 1178 | 1253 | ||
| 1179 | 1254 | } | |
| 1180 | 1255 | ||
| 1181 | - | var xTaskSetStaticName func(uintptr, string) | |
| 1256 | + | var xTaskSetStaticName func(uintptr, uintptr) | |
| 1182 | 1257 | ||
| 1183 | 1258 | // Sets @task’s name, used in debugging and profiling. | |
| 1184 | 1259 | // | |
| @@ -1186,9 +1261,9 @@ var xTaskSetStaticName func(uintptr, string) | |||
| 1186 | 1261 | // | |
| 1187 | 1262 | // This function is called automatically by [method@Gio.Task.set_source_tag] | |
| 1188 | 1263 | // unless a name is set. | |
| 1189 | - | func (x *Task) SetStaticName(NameVar string) { | |
| 1264 | + | func (x *Task) SetStaticName(NameVar *string) { | |
| 1190 | 1265 | ||
| 1191 | - | xTaskSetStaticName(x.GoPointer(), NameVar) | |
| 1266 | + | xTaskSetStaticName(x.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 1192 | 1267 | ||
| 1193 | 1268 | } | |
| 1194 | 1269 | ||
| @@ -1197,7 +1272,22 @@ var xTaskSetTaskData func(uintptr, uintptr, uintptr) | |||
| 1197 | 1272 | // Sets @task's task data (freeing the existing task data, if any). | |
| 1198 | 1273 | func (x *Task) SetTaskData(TaskDataVar uintptr, TaskDataDestroyVar *glib.DestroyNotify) { | |
| 1199 | 1274 | ||
| 1200 | - | xTaskSetTaskData(x.GoPointer(), TaskDataVar, glib.NewCallbackNullable(TaskDataDestroyVar)) | |
| 1275 | + | var TaskDataDestroyVarRef uintptr | |
| 1276 | + | if TaskDataDestroyVar != nil { | |
| 1277 | + | TaskDataDestroyVarPtr := uintptr(unsafe.Pointer(TaskDataDestroyVar)) | |
| 1278 | + | if cbRefPtr, ok := glib.GetCallback(TaskDataDestroyVarPtr); ok { | |
| 1279 | + | TaskDataDestroyVarRef = cbRefPtr | |
| 1280 | + | } else { | |
| 1281 | + | fcb := func(arg0 uintptr) { | |
| 1282 | + | cbFn := *TaskDataDestroyVar | |
| 1283 | + | cbFn(arg0) | |
| 1284 | + | } | |
| 1285 | + | TaskDataDestroyVarRef = purego.NewCallback(fcb) | |
| 1286 | + | glib.SaveCallback(TaskDataDestroyVarPtr, TaskDataDestroyVarRef) | |
| 1287 | + | } | |
| 1288 | + | } | |
| 1289 | + | ||
| 1290 | + | xTaskSetTaskData(x.GoPointer(), TaskDataVar, TaskDataDestroyVarRef) | |
| 1201 | 1291 | ||
| 1202 | 1292 | } | |
| 1203 | 1293 | ||
| @@ -1296,7 +1386,22 @@ var xTaskReportError func(uintptr, uintptr, uintptr, uintptr, *glib.Error) | |||
| 1296 | 1386 | // See also g_task_report_new_error(). | |
| 1297 | 1387 | func TaskReportError(SourceObjectVar *gobject.Object, CallbackVar *AsyncReadyCallback, CallbackDataVar uintptr, SourceTagVar uintptr, ErrorVar *glib.Error) { | |
| 1298 | 1388 | ||
| 1299 | - | xTaskReportError(SourceObjectVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), CallbackDataVar, SourceTagVar, ErrorVar) | |
| 1389 | + | var CallbackVarRef uintptr | |
| 1390 | + | if CallbackVar != nil { | |
| 1391 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1392 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1393 | + | CallbackVarRef = cbRefPtr | |
| 1394 | + | } else { | |
| 1395 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1396 | + | cbFn := *CallbackVar | |
| 1397 | + | cbFn(arg0, arg1, arg2) | |
| 1398 | + | } | |
| 1399 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1400 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1401 | + | } | |
| 1402 | + | } | |
| 1403 | + | ||
| 1404 | + | xTaskReportError(SourceObjectVar.GoPointer(), CallbackVarRef, CallbackDataVar, SourceTagVar, ErrorVar) | |
| 1300 | 1405 | ||
| 1301 | 1406 | } | |
| 1302 | 1407 | ||
| @@ -1313,7 +1418,22 @@ var xTaskReportNewError func(uintptr, uintptr, uintptr, uintptr, glib.Quark, int | |||
| 1313 | 1418 | // See also g_task_report_error(). | |
| 1314 | 1419 | func TaskReportNewError(SourceObjectVar *gobject.Object, CallbackVar *AsyncReadyCallback, CallbackDataVar uintptr, SourceTagVar uintptr, DomainVar glib.Quark, CodeVar int, FormatVar string, varArgs ...interface{}) { | |
| 1315 | 1420 | ||
| 1316 | - | xTaskReportNewError(SourceObjectVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), CallbackDataVar, SourceTagVar, DomainVar, CodeVar, FormatVar, varArgs...) | |
| 1421 | + | var CallbackVarRef uintptr | |
| 1422 | + | if CallbackVar != nil { | |
| 1423 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1424 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1425 | + | CallbackVarRef = cbRefPtr | |
| 1426 | + | } else { | |
| 1427 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 1428 | + | cbFn := *CallbackVar | |
| 1429 | + | cbFn(arg0, arg1, arg2) | |
| 1430 | + | } | |
| 1431 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1432 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1433 | + | } | |
| 1434 | + | } | |
| 1435 | + | ||
| 1436 | + | xTaskReportNewError(SourceObjectVar.GoPointer(), CallbackVarRef, CallbackDataVar, SourceTagVar, DomainVar, CodeVar, FormatVar, varArgs...) | |
| 1317 | 1437 | ||
| 1318 | 1438 | } | |
| 1319 | 1439 | ||
M v4/gio/gthemedicon.go +1 -1
| @@ -157,7 +157,7 @@ func (c *ThemedIcon) SetGoPointer(ptr uintptr) { | |||
| 157 | 157 | func (x *ThemedIcon) SetPropertyName(value string) { | |
| 158 | 158 | var v gobject.Value | |
| 159 | 159 | v.Init(gobject.TypeStringVal) | |
| 160 | - | v.SetString(value) | |
| 160 | + | v.SetString(&value) | |
| 161 | 161 | x.SetProperty("name", &v) | |
| 162 | 162 | } | |
| 163 | 163 | ||
M v4/gio/gtlscertificate.go +11 -11
| @@ -203,7 +203,7 @@ func NewTlsCertificateFromPem(DataVar string, LengthVar int) (*TlsCertificate, e | |||
| 203 | 203 | ||
| 204 | 204 | } | |
| 205 | 205 | ||
| 206 | - | var xNewTlsCertificateFromPkcs11Uris func(string, string, **glib.Error) uintptr | |
| 206 | + | var xNewTlsCertificateFromPkcs11Uris func(string, uintptr, **glib.Error) uintptr | |
| 207 | 207 | ||
| 208 | 208 | // Creates a #GTlsCertificate from a | |
| 209 | 209 | // [PKCS \#11](https://docs.oasis-open.org/pkcs11/pkcs11-base/v3.0/os/pkcs11-base-v3.0-os.html) URI. | |
| @@ -232,11 +232,11 @@ var xNewTlsCertificateFromPkcs11Uris func(string, string, **glib.Error) uintptr | |||
| 232 | 232 | // @private_key_pkcs11_uri allows using a private key exposed under a different URI. | |
| 233 | 233 | // | |
| 234 | 234 | // Note that the private key is not accessed until usage and may fail or require a PIN later. | |
| 235 | - | func NewTlsCertificateFromPkcs11Uris(Pkcs11UriVar string, PrivateKeyPkcs11UriVar string) (*TlsCertificate, error) { | |
| 235 | + | func NewTlsCertificateFromPkcs11Uris(Pkcs11UriVar string, PrivateKeyPkcs11UriVar *string) (*TlsCertificate, error) { | |
| 236 | 236 | var cls *TlsCertificate | |
| 237 | 237 | var cerr *glib.Error | |
| 238 | 238 | ||
| 239 | - | cret := xNewTlsCertificateFromPkcs11Uris(Pkcs11UriVar, PrivateKeyPkcs11UriVar, &cerr) | |
| 239 | + | cret := xNewTlsCertificateFromPkcs11Uris(Pkcs11UriVar, core.NullableStringToPtr(PrivateKeyPkcs11UriVar), &cerr) | |
| 240 | 240 | ||
| 241 | 241 | if cret == 0 { | |
| 242 | 242 | return nil, cerr | |
| @@ -250,7 +250,7 @@ func NewTlsCertificateFromPkcs11Uris(Pkcs11UriVar string, PrivateKeyPkcs11UriVar | |||
| 250 | 250 | ||
| 251 | 251 | } | |
| 252 | 252 | ||
| 253 | - | var xNewTlsCertificateFromPkcs12 func([]byte, uint, string, **glib.Error) uintptr | |
| 253 | + | var xNewTlsCertificateFromPkcs12 func([]byte, uint, uintptr, **glib.Error) uintptr | |
| 254 | 254 | ||
| 255 | 255 | // Creates a #GTlsCertificate from the data in @data. It must contain | |
| 256 | 256 | // a certificate and matching private key. | |
| @@ -269,11 +269,11 @@ var xNewTlsCertificateFromPkcs12 func([]byte, uint, string, **glib.Error) uintpt | |||
| 269 | 269 | // %G_IO_ERROR_NOT_SUPPORTED. | |
| 270 | 270 | // | |
| 271 | 271 | // Other parsing failures will error with %G_TLS_ERROR_BAD_CERTIFICATE. | |
| 272 | - | func NewTlsCertificateFromPkcs12(DataVar []byte, LengthVar uint, PasswordVar string) (*TlsCertificate, error) { | |
| 272 | + | func NewTlsCertificateFromPkcs12(DataVar []byte, LengthVar uint, PasswordVar *string) (*TlsCertificate, error) { | |
| 273 | 273 | var cls *TlsCertificate | |
| 274 | 274 | var cerr *glib.Error | |
| 275 | 275 | ||
| 276 | - | cret := xNewTlsCertificateFromPkcs12(DataVar, LengthVar, PasswordVar, &cerr) | |
| 276 | + | cret := xNewTlsCertificateFromPkcs12(DataVar, LengthVar, core.NullableStringToPtr(PasswordVar), &cerr) | |
| 277 | 277 | ||
| 278 | 278 | if cret == 0 { | |
| 279 | 279 | return nil, cerr | |
| @@ -455,7 +455,7 @@ func (x *TlsCertificate) GetPropertyCertificate() []byte { | |||
| 455 | 455 | func (x *TlsCertificate) SetPropertyCertificatePem(value string) { | |
| 456 | 456 | var v gobject.Value | |
| 457 | 457 | v.Init(gobject.TypeStringVal) | |
| 458 | - | v.SetString(value) | |
| 458 | + | v.SetString(&value) | |
| 459 | 459 | x.SetProperty("certificate-pem", &v) | |
| 460 | 460 | } | |
| 461 | 461 | ||
| @@ -527,7 +527,7 @@ func (x *TlsCertificate) GetPropertyNotValidBefore() uintptr { | |||
| 527 | 527 | func (x *TlsCertificate) SetPropertyPassword(value string) { | |
| 528 | 528 | var v gobject.Value | |
| 529 | 529 | v.Init(gobject.TypeStringVal) | |
| 530 | - | v.SetString(value) | |
| 530 | + | v.SetString(&value) | |
| 531 | 531 | x.SetProperty("password", &v) | |
| 532 | 532 | } | |
| 533 | 533 | ||
| @@ -540,7 +540,7 @@ func (x *TlsCertificate) SetPropertyPassword(value string) { | |||
| 540 | 540 | func (x *TlsCertificate) SetPropertyPkcs11Uri(value string) { | |
| 541 | 541 | var v gobject.Value | |
| 542 | 542 | v.Init(gobject.TypeStringVal) | |
| 543 | - | v.SetString(value) | |
| 543 | + | v.SetString(&value) | |
| 544 | 544 | x.SetProperty("pkcs11-uri", &v) | |
| 545 | 545 | } | |
| 546 | 546 | ||
| @@ -642,7 +642,7 @@ func (x *TlsCertificate) GetPropertyPrivateKey() []byte { | |||
| 642 | 642 | func (x *TlsCertificate) SetPropertyPrivateKeyPem(value string) { | |
| 643 | 643 | var v gobject.Value | |
| 644 | 644 | v.Init(gobject.TypeStringVal) | |
| 645 | - | v.SetString(value) | |
| 645 | + | v.SetString(&value) | |
| 646 | 646 | x.SetProperty("private-key-pem", &v) | |
| 647 | 647 | } | |
| 648 | 648 | ||
| @@ -677,7 +677,7 @@ func (x *TlsCertificate) GetPropertyPrivateKeyPem() string { | |||
| 677 | 677 | func (x *TlsCertificate) SetPropertyPrivateKeyPkcs11Uri(value string) { | |
| 678 | 678 | var v gobject.Value | |
| 679 | 679 | v.Init(gobject.TypeStringVal) | |
| 680 | - | v.SetString(value) | |
| 680 | + | v.SetString(&value) | |
| 681 | 681 | x.SetProperty("private-key-pkcs11-uri", &v) | |
| 682 | 682 | } | |
| 683 | 683 | ||
M v4/gio/gtlsconnection.go +16 -1
| @@ -483,7 +483,22 @@ var xTlsConnectionHandshakeAsync func(uintptr, int, uintptr, uintptr, uintptr) | |||
| 483 | 483 | // g_tls_connection_handshake() for more information. | |
| 484 | 484 | func (x *TlsConnection) HandshakeAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 485 | 485 | ||
| 486 | - | xTlsConnectionHandshakeAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 486 | + | var CallbackVarRef uintptr | |
| 487 | + | if CallbackVar != nil { | |
| 488 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 489 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 490 | + | CallbackVarRef = cbRefPtr | |
| 491 | + | } else { | |
| 492 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 493 | + | cbFn := *CallbackVar | |
| 494 | + | cbFn(arg0, arg1, arg2) | |
| 495 | + | } | |
| 496 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 497 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 498 | + | } | |
| 499 | + | } | |
| 500 | + | ||
| 501 | + | xTlsConnectionHandshakeAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 487 | 502 | ||
| 488 | 503 | } | |
| 489 | 504 | ||
M v4/gio/gtlsdatabase.go +64 -4
| @@ -566,7 +566,22 @@ var xTlsDatabaseLookupCertificateForHandleAsync func(uintptr, string, uintptr, T | |||
| 566 | 566 | // g_tls_database_lookup_certificate_for_handle() for more information. | |
| 567 | 567 | func (x *TlsDatabase) LookupCertificateForHandleAsync(HandleVar string, InteractionVar *TlsInteraction, FlagsVar TlsDatabaseLookupFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 568 | 568 | ||
| 569 | - | xTlsDatabaseLookupCertificateForHandleAsync(x.GoPointer(), HandleVar, InteractionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 569 | + | var CallbackVarRef uintptr | |
| 570 | + | if CallbackVar != nil { | |
| 571 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 572 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 573 | + | CallbackVarRef = cbRefPtr | |
| 574 | + | } else { | |
| 575 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 576 | + | cbFn := *CallbackVar | |
| 577 | + | cbFn(arg0, arg1, arg2) | |
| 578 | + | } | |
| 579 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 580 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 581 | + | } | |
| 582 | + | } | |
| 583 | + | ||
| 584 | + | xTlsDatabaseLookupCertificateForHandleAsync(x.GoPointer(), HandleVar, InteractionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 570 | 585 | ||
| 571 | 586 | } | |
| 572 | 587 | ||
| @@ -641,7 +656,22 @@ var xTlsDatabaseLookupCertificateIssuerAsync func(uintptr, uintptr, uintptr, Tls | |||
| 641 | 656 | // g_tls_database_lookup_certificate_issuer() for more information. | |
| 642 | 657 | func (x *TlsDatabase) LookupCertificateIssuerAsync(CertificateVar *TlsCertificate, InteractionVar *TlsInteraction, FlagsVar TlsDatabaseLookupFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 643 | 658 | ||
| 644 | - | xTlsDatabaseLookupCertificateIssuerAsync(x.GoPointer(), CertificateVar.GoPointer(), InteractionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 659 | + | var CallbackVarRef uintptr | |
| 660 | + | if CallbackVar != nil { | |
| 661 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 662 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 663 | + | CallbackVarRef = cbRefPtr | |
| 664 | + | } else { | |
| 665 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 666 | + | cbFn := *CallbackVar | |
| 667 | + | cbFn(arg0, arg1, arg2) | |
| 668 | + | } | |
| 669 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 670 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 671 | + | } | |
| 672 | + | } | |
| 673 | + | ||
| 674 | + | xTlsDatabaseLookupCertificateIssuerAsync(x.GoPointer(), CertificateVar.GoPointer(), InteractionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 645 | 675 | ||
| 646 | 676 | } | |
| 647 | 677 | ||
| @@ -694,7 +724,22 @@ var xTlsDatabaseLookupCertificatesIssuedByAsync func(uintptr, []byte, uintptr, T | |||
| 694 | 724 | // this time. | |
| 695 | 725 | func (x *TlsDatabase) LookupCertificatesIssuedByAsync(IssuerRawDnVar []byte, InteractionVar *TlsInteraction, FlagsVar TlsDatabaseLookupFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 696 | 726 | ||
| 697 | - | xTlsDatabaseLookupCertificatesIssuedByAsync(x.GoPointer(), IssuerRawDnVar, InteractionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 727 | + | var CallbackVarRef uintptr | |
| 728 | + | if CallbackVar != nil { | |
| 729 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 730 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 731 | + | CallbackVarRef = cbRefPtr | |
| 732 | + | } else { | |
| 733 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 734 | + | cbFn := *CallbackVar | |
| 735 | + | cbFn(arg0, arg1, arg2) | |
| 736 | + | } | |
| 737 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 738 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 739 | + | } | |
| 740 | + | } | |
| 741 | + | ||
| 742 | + | xTlsDatabaseLookupCertificatesIssuedByAsync(x.GoPointer(), IssuerRawDnVar, InteractionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 698 | 743 | ||
| 699 | 744 | } | |
| 700 | 745 | ||
| @@ -793,7 +838,22 @@ var xTlsDatabaseVerifyChainAsync func(uintptr, uintptr, string, uintptr, uintptr | |||
| 793 | 838 | // g_tls_database_verify_chain() for more information. | |
| 794 | 839 | func (x *TlsDatabase) VerifyChainAsync(ChainVar *TlsCertificate, PurposeVar string, IdentityVar SocketConnectable, InteractionVar *TlsInteraction, FlagsVar TlsDatabaseVerifyFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 795 | 840 | ||
| 796 | - | xTlsDatabaseVerifyChainAsync(x.GoPointer(), ChainVar.GoPointer(), PurposeVar, IdentityVar.GoPointer(), InteractionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 841 | + | var CallbackVarRef uintptr | |
| 842 | + | if CallbackVar != nil { | |
| 843 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 844 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 845 | + | CallbackVarRef = cbRefPtr | |
| 846 | + | } else { | |
| 847 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 848 | + | cbFn := *CallbackVar | |
| 849 | + | cbFn(arg0, arg1, arg2) | |
| 850 | + | } | |
| 851 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 852 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 853 | + | } | |
| 854 | + | } | |
| 855 | + | ||
| 856 | + | xTlsDatabaseVerifyChainAsync(x.GoPointer(), ChainVar.GoPointer(), PurposeVar, IdentityVar.GoPointer(), InteractionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 797 | 857 | ||
| 798 | 858 | } | |
| 799 | 859 | ||
M v4/gio/gtlsfiledatabase.go +1 -1
| @@ -64,7 +64,7 @@ func (x *TlsFileDatabaseBase) SetPropertyAnchors(value string) { | |||
| 64 | 64 | obj.Ptr = x.GoPointer() | |
| 65 | 65 | var v gobject.Value | |
| 66 | 66 | v.Init(gobject.TypeStringVal) | |
| 67 | - | v.SetString(value) | |
| 67 | + | v.SetString(&value) | |
| 68 | 68 | obj.SetProperty("anchors", &v) | |
| 69 | 69 | } | |
| 70 | 70 | ||
M v4/gio/gtlsinteraction.go +32 -2
| @@ -321,7 +321,22 @@ var xTlsInteractionAskPasswordAsync func(uintptr, uintptr, uintptr, uintptr, uin | |||
| 321 | 321 | // Certain implementations may not support immediate cancellation. | |
| 322 | 322 | func (x *TlsInteraction) AskPasswordAsync(PasswordVar *TlsPassword, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 323 | 323 | ||
| 324 | - | xTlsInteractionAskPasswordAsync(x.GoPointer(), PasswordVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 324 | + | var CallbackVarRef uintptr | |
| 325 | + | if CallbackVar != nil { | |
| 326 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 327 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 328 | + | CallbackVarRef = cbRefPtr | |
| 329 | + | } else { | |
| 330 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 331 | + | cbFn := *CallbackVar | |
| 332 | + | cbFn(arg0, arg1, arg2) | |
| 333 | + | } | |
| 334 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 335 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 336 | + | } | |
| 337 | + | } | |
| 338 | + | ||
| 339 | + | xTlsInteractionAskPasswordAsync(x.GoPointer(), PasswordVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 325 | 340 | ||
| 326 | 341 | } | |
| 327 | 342 | ||
| @@ -453,7 +468,22 @@ var xTlsInteractionRequestCertificateAsync func(uintptr, uintptr, TlsCertificate | |||
| 453 | 468 | // request, which will usually abort the TLS connection. | |
| 454 | 469 | func (x *TlsInteraction) RequestCertificateAsync(ConnectionVar *TlsConnection, FlagsVar TlsCertificateRequestFlags, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 455 | 470 | ||
| 456 | - | xTlsInteractionRequestCertificateAsync(x.GoPointer(), ConnectionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 471 | + | var CallbackVarRef uintptr | |
| 472 | + | if CallbackVar != nil { | |
| 473 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 474 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 475 | + | CallbackVarRef = cbRefPtr | |
| 476 | + | } else { | |
| 477 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 478 | + | cbFn := *CallbackVar | |
| 479 | + | cbFn(arg0, arg1, arg2) | |
| 480 | + | } | |
| 481 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 482 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 483 | + | } | |
| 484 | + | } | |
| 485 | + | ||
| 486 | + | xTlsInteractionRequestCertificateAsync(x.GoPointer(), ConnectionVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 457 | 487 | ||
| 458 | 488 | } | |
| 459 | 489 | ||
M v4/gio/gtlspassword.go +18 -3
| @@ -240,7 +240,22 @@ var xTlsPasswordSetValueFull func(uintptr, []byte, int, uintptr) | |||
| 240 | 240 | // considered part of the password in this case.) | |
| 241 | 241 | func (x *TlsPassword) SetValueFull(ValueVar []byte, LengthVar int, DestroyVar *glib.DestroyNotify) { | |
| 242 | 242 | ||
| 243 | - | xTlsPasswordSetValueFull(x.GoPointer(), ValueVar, LengthVar, glib.NewCallbackNullable(DestroyVar)) | |
| 243 | + | var DestroyVarRef uintptr | |
| 244 | + | if DestroyVar != nil { | |
| 245 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 246 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 247 | + | DestroyVarRef = cbRefPtr | |
| 248 | + | } else { | |
| 249 | + | fcb := func(arg0 uintptr) { | |
| 250 | + | cbFn := *DestroyVar | |
| 251 | + | cbFn(arg0) | |
| 252 | + | } | |
| 253 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 254 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 255 | + | } | |
| 256 | + | } | |
| 257 | + | ||
| 258 | + | xTlsPasswordSetValueFull(x.GoPointer(), ValueVar, LengthVar, DestroyVarRef) | |
| 244 | 259 | ||
| 245 | 260 | } | |
| 246 | 261 | ||
| @@ -271,7 +286,7 @@ func (c *TlsPassword) SetGoPointer(ptr uintptr) { | |||
| 271 | 286 | func (x *TlsPassword) SetPropertyDescription(value string) { | |
| 272 | 287 | var v gobject.Value | |
| 273 | 288 | v.Init(gobject.TypeStringVal) | |
| 274 | - | v.SetString(value) | |
| 289 | + | v.SetString(&value) | |
| 275 | 290 | x.SetProperty("description", &v) | |
| 276 | 291 | } | |
| 277 | 292 | ||
| @@ -288,7 +303,7 @@ func (x *TlsPassword) GetPropertyDescription() string { | |||
| 288 | 303 | func (x *TlsPassword) SetPropertyWarning(value string) { | |
| 289 | 304 | var v gobject.Value | |
| 290 | 305 | v.Init(gobject.TypeStringVal) | |
| 291 | - | v.SetString(value) | |
| 306 | + | v.SetString(&value) | |
| 292 | 307 | x.SetProperty("warning", &v) | |
| 293 | 308 | } | |
| 294 | 309 | ||
M v4/gio/gunixconnection.go +32 -2
| @@ -106,7 +106,22 @@ var xUnixConnectionReceiveCredentialsAsync func(uintptr, uintptr, uintptr, uintp | |||
| 106 | 106 | // g_unix_connection_receive_credentials_finish() to get the result of the operation. | |
| 107 | 107 | func (x *UnixConnection) ReceiveCredentialsAsync(CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 108 | 108 | ||
| 109 | - | xUnixConnectionReceiveCredentialsAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 109 | + | var CallbackVarRef uintptr | |
| 110 | + | if CallbackVar != nil { | |
| 111 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 112 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 113 | + | CallbackVarRef = cbRefPtr | |
| 114 | + | } else { | |
| 115 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 116 | + | cbFn := *CallbackVar | |
| 117 | + | cbFn(arg0, arg1, arg2) | |
| 118 | + | } | |
| 119 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 120 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 121 | + | } | |
| 122 | + | } | |
| 123 | + | ||
| 124 | + | xUnixConnectionReceiveCredentialsAsync(x.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 110 | 125 | ||
| 111 | 126 | } | |
| 112 | 127 | ||
| @@ -195,7 +210,22 @@ var xUnixConnectionSendCredentialsAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 195 | 210 | // g_unix_connection_send_credentials_finish() to get the result of the operation. | |
| 196 | 211 | func (x *UnixConnection) SendCredentialsAsync(CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 197 | 212 | ||
| 198 | - | xUnixConnectionSendCredentialsAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 213 | + | var CallbackVarRef uintptr | |
| 214 | + | if CallbackVar != nil { | |
| 215 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 216 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 217 | + | CallbackVarRef = cbRefPtr | |
| 218 | + | } else { | |
| 219 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 220 | + | cbFn := *CallbackVar | |
| 221 | + | cbFn(arg0, arg1, arg2) | |
| 222 | + | } | |
| 223 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 224 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 225 | + | } | |
| 226 | + | } | |
| 227 | + | ||
| 228 | + | xUnixConnectionSendCredentialsAsync(x.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 199 | 229 | ||
| 200 | 230 | } | |
| 201 | 231 | ||
M v4/gio/gunixsocketaddress.go +1 -1
| @@ -223,7 +223,7 @@ func (x *UnixSocketAddress) GetPropertyAbstract() bool { | |||
| 223 | 223 | func (x *UnixSocketAddress) SetPropertyPath(value string) { | |
| 224 | 224 | var v gobject.Value | |
| 225 | 225 | v.Init(gobject.TypeStringVal) | |
| 226 | - | v.SetString(value) | |
| 226 | + | v.SetString(&value) | |
| 227 | 227 | x.SetProperty("path", &v) | |
| 228 | 228 | } | |
| 229 | 229 | ||
M v4/gio/gvfs.go +61 -1
| @@ -614,7 +614,67 @@ var xVfsRegisterUriScheme func(uintptr, string, uintptr, uintptr, uintptr, uintp | |||
| 614 | 614 | // a custom URI scheme, use g_vfs_unregister_uri_scheme(). | |
| 615 | 615 | func (x *Vfs) RegisterUriScheme(SchemeVar string, UriFuncVar *VfsFileLookupFunc, UriDataVar uintptr, UriDestroyVar *glib.DestroyNotify, ParseNameFuncVar *VfsFileLookupFunc, ParseNameDataVar uintptr, ParseNameDestroyVar *glib.DestroyNotify) bool { | |
| 616 | 616 | ||
| 617 | - | cret := xVfsRegisterUriScheme(x.GoPointer(), SchemeVar, glib.NewCallbackNullable(UriFuncVar), UriDataVar, glib.NewCallbackNullable(UriDestroyVar), glib.NewCallbackNullable(ParseNameFuncVar), ParseNameDataVar, glib.NewCallbackNullable(ParseNameDestroyVar)) | |
| 617 | + | var UriFuncVarRef uintptr | |
| 618 | + | if UriFuncVar != nil { | |
| 619 | + | UriFuncVarPtr := uintptr(unsafe.Pointer(UriFuncVar)) | |
| 620 | + | if cbRefPtr, ok := glib.GetCallback(UriFuncVarPtr); ok { | |
| 621 | + | UriFuncVarRef = cbRefPtr | |
| 622 | + | } else { | |
| 623 | + | fcb := func(arg0 uintptr, arg1 string, arg2 uintptr) uintptr { | |
| 624 | + | cbFn := *UriFuncVar | |
| 625 | + | return cbFn(arg0, arg1, arg2) | |
| 626 | + | } | |
| 627 | + | UriFuncVarRef = purego.NewCallback(fcb) | |
| 628 | + | glib.SaveCallback(UriFuncVarPtr, UriFuncVarRef) | |
| 629 | + | } | |
| 630 | + | } | |
| 631 | + | ||
| 632 | + | var UriDestroyVarRef uintptr | |
| 633 | + | if UriDestroyVar != nil { | |
| 634 | + | UriDestroyVarPtr := uintptr(unsafe.Pointer(UriDestroyVar)) | |
| 635 | + | if cbRefPtr, ok := glib.GetCallback(UriDestroyVarPtr); ok { | |
| 636 | + | UriDestroyVarRef = cbRefPtr | |
| 637 | + | } else { | |
| 638 | + | fcb := func(arg0 uintptr) { | |
| 639 | + | cbFn := *UriDestroyVar | |
| 640 | + | cbFn(arg0) | |
| 641 | + | } | |
| 642 | + | UriDestroyVarRef = purego.NewCallback(fcb) | |
| 643 | + | glib.SaveCallback(UriDestroyVarPtr, UriDestroyVarRef) | |
| 644 | + | } | |
| 645 | + | } | |
| 646 | + | ||
| 647 | + | var ParseNameFuncVarRef uintptr | |
| 648 | + | if ParseNameFuncVar != nil { | |
| 649 | + | ParseNameFuncVarPtr := uintptr(unsafe.Pointer(ParseNameFuncVar)) | |
| 650 | + | if cbRefPtr, ok := glib.GetCallback(ParseNameFuncVarPtr); ok { | |
| 651 | + | ParseNameFuncVarRef = cbRefPtr | |
| 652 | + | } else { | |
| 653 | + | fcb := func(arg0 uintptr, arg1 string, arg2 uintptr) uintptr { | |
| 654 | + | cbFn := *ParseNameFuncVar | |
| 655 | + | return cbFn(arg0, arg1, arg2) | |
| 656 | + | } | |
| 657 | + | ParseNameFuncVarRef = purego.NewCallback(fcb) | |
| 658 | + | glib.SaveCallback(ParseNameFuncVarPtr, ParseNameFuncVarRef) | |
| 659 | + | } | |
| 660 | + | } | |
| 661 | + | ||
| 662 | + | var ParseNameDestroyVarRef uintptr | |
| 663 | + | if ParseNameDestroyVar != nil { | |
| 664 | + | ParseNameDestroyVarPtr := uintptr(unsafe.Pointer(ParseNameDestroyVar)) | |
| 665 | + | if cbRefPtr, ok := glib.GetCallback(ParseNameDestroyVarPtr); ok { | |
| 666 | + | ParseNameDestroyVarRef = cbRefPtr | |
| 667 | + | } else { | |
| 668 | + | fcb := func(arg0 uintptr) { | |
| 669 | + | cbFn := *ParseNameDestroyVar | |
| 670 | + | cbFn(arg0) | |
| 671 | + | } | |
| 672 | + | ParseNameDestroyVarRef = purego.NewCallback(fcb) | |
| 673 | + | glib.SaveCallback(ParseNameDestroyVarPtr, ParseNameDestroyVarRef) | |
| 674 | + | } | |
| 675 | + | } | |
| 676 | + | ||
| 677 | + | cret := xVfsRegisterUriScheme(x.GoPointer(), SchemeVar, UriFuncVarRef, UriDataVar, UriDestroyVarRef, ParseNameFuncVarRef, ParseNameDataVar, ParseNameDestroyVarRef) | |
| 618 | 678 | return cret | |
| 619 | 679 | } | |
| 620 | 680 | ||
M v4/glib/garray.go +158 -8
| @@ -147,7 +147,22 @@ var xNewBytesWithFreeFunc func([]byte, uint, uintptr, uintptr) *Bytes | |||
| 147 | 147 | // @data may be `NULL` if @size is 0. | |
| 148 | 148 | func NewBytesWithFreeFunc(DataVar []byte, SizeVar uint, FreeFuncVar *DestroyNotify, UserDataVar uintptr) *Bytes { | |
| 149 | 149 | ||
| 150 | - | cret := xNewBytesWithFreeFunc(DataVar, SizeVar, NewCallback(FreeFuncVar), UserDataVar) | |
| 150 | + | var FreeFuncVarRef uintptr | |
| 151 | + | if FreeFuncVar != nil { | |
| 152 | + | FreeFuncVarPtr := uintptr(unsafe.Pointer(FreeFuncVar)) | |
| 153 | + | if cbRefPtr, ok := GetCallback(FreeFuncVarPtr); ok { | |
| 154 | + | FreeFuncVarRef = cbRefPtr | |
| 155 | + | } else { | |
| 156 | + | fcb := func(arg0 uintptr) { | |
| 157 | + | cbFn := *FreeFuncVar | |
| 158 | + | cbFn(arg0) | |
| 159 | + | } | |
| 160 | + | FreeFuncVarRef = purego.NewCallback(fcb) | |
| 161 | + | SaveCallback(FreeFuncVarPtr, FreeFuncVarRef) | |
| 162 | + | } | |
| 163 | + | } | |
| 164 | + | ||
| 165 | + | cret := xNewBytesWithFreeFunc(DataVar, SizeVar, FreeFuncVarRef, UserDataVar) | |
| 151 | 166 | return cret | |
| 152 | 167 | } | |
| 153 | 168 | ||
| @@ -553,7 +568,22 @@ var xByteArraySort func([]byte, uintptr) | |||
| 553 | 568 | // their addresses. | |
| 554 | 569 | func ByteArraySort(ArrayVar []byte, CompareFuncVar *CompareFunc) { | |
| 555 | 570 | ||
| 556 | - | xByteArraySort(ArrayVar, NewCallback(CompareFuncVar)) | |
| 571 | + | var CompareFuncVarRef uintptr | |
| 572 | + | if CompareFuncVar != nil { | |
| 573 | + | CompareFuncVarPtr := uintptr(unsafe.Pointer(CompareFuncVar)) | |
| 574 | + | if cbRefPtr, ok := GetCallback(CompareFuncVarPtr); ok { | |
| 575 | + | CompareFuncVarRef = cbRefPtr | |
| 576 | + | } else { | |
| 577 | + | fcb := func(arg0 uintptr, arg1 uintptr) int { | |
| 578 | + | cbFn := *CompareFuncVar | |
| 579 | + | return cbFn(arg0, arg1) | |
| 580 | + | } | |
| 581 | + | CompareFuncVarRef = purego.NewCallback(fcb) | |
| 582 | + | SaveCallback(CompareFuncVarPtr, CompareFuncVarRef) | |
| 583 | + | } | |
| 584 | + | } | |
| 585 | + | ||
| 586 | + | xByteArraySort(ArrayVar, CompareFuncVarRef) | |
| 557 | 587 | ||
| 558 | 588 | } | |
| 559 | 589 | ||
| @@ -563,7 +593,22 @@ var xByteArraySortWithData func([]byte, uintptr, uintptr) | |||
| 563 | 593 | // user data argument. | |
| 564 | 594 | func ByteArraySortWithData(ArrayVar []byte, CompareFuncVar *CompareDataFunc, UserDataVar uintptr) { | |
| 565 | 595 | ||
| 566 | - | xByteArraySortWithData(ArrayVar, NewCallback(CompareFuncVar), UserDataVar) | |
| 596 | + | var CompareFuncVarRef uintptr | |
| 597 | + | if CompareFuncVar != nil { | |
| 598 | + | CompareFuncVarPtr := uintptr(unsafe.Pointer(CompareFuncVar)) | |
| 599 | + | if cbRefPtr, ok := GetCallback(CompareFuncVarPtr); ok { | |
| 600 | + | CompareFuncVarRef = cbRefPtr | |
| 601 | + | } else { | |
| 602 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 603 | + | cbFn := *CompareFuncVar | |
| 604 | + | return cbFn(arg0, arg1, arg2) | |
| 605 | + | } | |
| 606 | + | CompareFuncVarRef = purego.NewCallback(fcb) | |
| 607 | + | SaveCallback(CompareFuncVarPtr, CompareFuncVarRef) | |
| 608 | + | } | |
| 609 | + | } | |
| 610 | + | ||
| 611 | + | xByteArraySortWithData(ArrayVar, CompareFuncVarRef, UserDataVar) | |
| 567 | 612 | ||
| 568 | 613 | } | |
| 569 | 614 | ||
| @@ -619,7 +664,22 @@ var xPtrArrayFindWithEqualFunc func([]uintptr, uintptr, uintptr, *uint) bool | |||
| 619 | 664 | // equality is used. | |
| 620 | 665 | func PtrArrayFindWithEqualFunc(HaystackVar []uintptr, NeedleVar uintptr, EqualFuncVar *EqualFunc, IndexVar *uint) bool { | |
| 621 | 666 | ||
| 622 | - | cret := xPtrArrayFindWithEqualFunc(HaystackVar, NeedleVar, NewCallbackNullable(EqualFuncVar), IndexVar) | |
| 667 | + | var EqualFuncVarRef uintptr | |
| 668 | + | if EqualFuncVar != nil { | |
| 669 | + | EqualFuncVarPtr := uintptr(unsafe.Pointer(EqualFuncVar)) | |
| 670 | + | if cbRefPtr, ok := GetCallback(EqualFuncVarPtr); ok { | |
| 671 | + | EqualFuncVarRef = cbRefPtr | |
| 672 | + | } else { | |
| 673 | + | fcb := func(arg0 uintptr, arg1 uintptr) bool { | |
| 674 | + | cbFn := *EqualFuncVar | |
| 675 | + | return cbFn(arg0, arg1) | |
| 676 | + | } | |
| 677 | + | EqualFuncVarRef = purego.NewCallback(fcb) | |
| 678 | + | SaveCallback(EqualFuncVarPtr, EqualFuncVarRef) | |
| 679 | + | } | |
| 680 | + | } | |
| 681 | + | ||
| 682 | + | cret := xPtrArrayFindWithEqualFunc(HaystackVar, NeedleVar, EqualFuncVarRef, IndexVar) | |
| 623 | 683 | return cret | |
| 624 | 684 | } | |
| 625 | 685 | ||
| @@ -644,7 +704,37 @@ var xPtrArrayNewFromArray func([]uintptr, uint, uintptr, uintptr, uintptr) uintp | |||
| 644 | 704 | // than `gsize`. | |
| 645 | 705 | func PtrArrayNewFromArray(DataVar []uintptr, LenVar uint, CopyFuncVar *CopyFunc, CopyFuncUserDataVar uintptr, ElementFreeFuncVar *DestroyNotify) uintptr { | |
| 646 | 706 | ||
| 647 | - | cret := xPtrArrayNewFromArray(DataVar, LenVar, NewCallbackNullable(CopyFuncVar), CopyFuncUserDataVar, NewCallbackNullable(ElementFreeFuncVar)) | |
| 707 | + | var CopyFuncVarRef uintptr | |
| 708 | + | if CopyFuncVar != nil { | |
| 709 | + | CopyFuncVarPtr := uintptr(unsafe.Pointer(CopyFuncVar)) | |
| 710 | + | if cbRefPtr, ok := GetCallback(CopyFuncVarPtr); ok { | |
| 711 | + | CopyFuncVarRef = cbRefPtr | |
| 712 | + | } else { | |
| 713 | + | fcb := func(arg0 uintptr, arg1 uintptr) uintptr { | |
| 714 | + | cbFn := *CopyFuncVar | |
| 715 | + | return cbFn(arg0, arg1) | |
| 716 | + | } | |
| 717 | + | CopyFuncVarRef = purego.NewCallback(fcb) | |
| 718 | + | SaveCallback(CopyFuncVarPtr, CopyFuncVarRef) | |
| 719 | + | } | |
| 720 | + | } | |
| 721 | + | ||
| 722 | + | var ElementFreeFuncVarRef uintptr | |
| 723 | + | if ElementFreeFuncVar != nil { | |
| 724 | + | ElementFreeFuncVarPtr := uintptr(unsafe.Pointer(ElementFreeFuncVar)) | |
| 725 | + | if cbRefPtr, ok := GetCallback(ElementFreeFuncVarPtr); ok { | |
| 726 | + | ElementFreeFuncVarRef = cbRefPtr | |
| 727 | + | } else { | |
| 728 | + | fcb := func(arg0 uintptr) { | |
| 729 | + | cbFn := *ElementFreeFuncVar | |
| 730 | + | cbFn(arg0) | |
| 731 | + | } | |
| 732 | + | ElementFreeFuncVarRef = purego.NewCallback(fcb) | |
| 733 | + | SaveCallback(ElementFreeFuncVarPtr, ElementFreeFuncVarRef) | |
| 734 | + | } | |
| 735 | + | } | |
| 736 | + | ||
| 737 | + | cret := xPtrArrayNewFromArray(DataVar, LenVar, CopyFuncVarRef, CopyFuncUserDataVar, ElementFreeFuncVarRef) | |
| 648 | 738 | return cret | |
| 649 | 739 | } | |
| 650 | 740 | ||
| @@ -665,7 +755,37 @@ var xPtrArrayNewFromNullTerminatedArray func([]uintptr, uintptr, uintptr, uintpt | |||
| 665 | 755 | // shorter than `gsize`. | |
| 666 | 756 | func PtrArrayNewFromNullTerminatedArray(DataVar []uintptr, CopyFuncVar *CopyFunc, CopyFuncUserDataVar uintptr, ElementFreeFuncVar *DestroyNotify) uintptr { | |
| 667 | 757 | ||
| 668 | - | cret := xPtrArrayNewFromNullTerminatedArray(DataVar, NewCallbackNullable(CopyFuncVar), CopyFuncUserDataVar, NewCallbackNullable(ElementFreeFuncVar)) | |
| 758 | + | var CopyFuncVarRef uintptr | |
| 759 | + | if CopyFuncVar != nil { | |
| 760 | + | CopyFuncVarPtr := uintptr(unsafe.Pointer(CopyFuncVar)) | |
| 761 | + | if cbRefPtr, ok := GetCallback(CopyFuncVarPtr); ok { | |
| 762 | + | CopyFuncVarRef = cbRefPtr | |
| 763 | + | } else { | |
| 764 | + | fcb := func(arg0 uintptr, arg1 uintptr) uintptr { | |
| 765 | + | cbFn := *CopyFuncVar | |
| 766 | + | return cbFn(arg0, arg1) | |
| 767 | + | } | |
| 768 | + | CopyFuncVarRef = purego.NewCallback(fcb) | |
| 769 | + | SaveCallback(CopyFuncVarPtr, CopyFuncVarRef) | |
| 770 | + | } | |
| 771 | + | } | |
| 772 | + | ||
| 773 | + | var ElementFreeFuncVarRef uintptr | |
| 774 | + | if ElementFreeFuncVar != nil { | |
| 775 | + | ElementFreeFuncVarPtr := uintptr(unsafe.Pointer(ElementFreeFuncVar)) | |
| 776 | + | if cbRefPtr, ok := GetCallback(ElementFreeFuncVarPtr); ok { | |
| 777 | + | ElementFreeFuncVarRef = cbRefPtr | |
| 778 | + | } else { | |
| 779 | + | fcb := func(arg0 uintptr) { | |
| 780 | + | cbFn := *ElementFreeFuncVar | |
| 781 | + | cbFn(arg0) | |
| 782 | + | } | |
| 783 | + | ElementFreeFuncVarRef = purego.NewCallback(fcb) | |
| 784 | + | SaveCallback(ElementFreeFuncVarPtr, ElementFreeFuncVarRef) | |
| 785 | + | } | |
| 786 | + | } | |
| 787 | + | ||
| 788 | + | cret := xPtrArrayNewFromNullTerminatedArray(DataVar, CopyFuncVarRef, CopyFuncUserDataVar, ElementFreeFuncVarRef) | |
| 669 | 789 | return cret | |
| 670 | 790 | } | |
| 671 | 791 | ||
| @@ -689,7 +809,22 @@ var xPtrArrayNewTake func([]uintptr, uint, uintptr) uintptr | |||
| 689 | 809 | // than `gsize`. | |
| 690 | 810 | func PtrArrayNewTake(DataVar []uintptr, LenVar uint, ElementFreeFuncVar *DestroyNotify) uintptr { | |
| 691 | 811 | ||
| 692 | - | cret := xPtrArrayNewTake(DataVar, LenVar, NewCallbackNullable(ElementFreeFuncVar)) | |
| 812 | + | var ElementFreeFuncVarRef uintptr | |
| 813 | + | if ElementFreeFuncVar != nil { | |
| 814 | + | ElementFreeFuncVarPtr := uintptr(unsafe.Pointer(ElementFreeFuncVar)) | |
| 815 | + | if cbRefPtr, ok := GetCallback(ElementFreeFuncVarPtr); ok { | |
| 816 | + | ElementFreeFuncVarRef = cbRefPtr | |
| 817 | + | } else { | |
| 818 | + | fcb := func(arg0 uintptr) { | |
| 819 | + | cbFn := *ElementFreeFuncVar | |
| 820 | + | cbFn(arg0) | |
| 821 | + | } | |
| 822 | + | ElementFreeFuncVarRef = purego.NewCallback(fcb) | |
| 823 | + | SaveCallback(ElementFreeFuncVarPtr, ElementFreeFuncVarRef) | |
| 824 | + | } | |
| 825 | + | } | |
| 826 | + | ||
| 827 | + | cret := xPtrArrayNewTake(DataVar, LenVar, ElementFreeFuncVarRef) | |
| 693 | 828 | return cret | |
| 694 | 829 | } | |
| 695 | 830 | ||
| @@ -716,7 +851,22 @@ var xPtrArrayNewTakeNullTerminated func([]uintptr, uintptr) uintptr | |||
| 716 | 851 | // in `guint`, which may be shorter than `gsize`. | |
| 717 | 852 | func PtrArrayNewTakeNullTerminated(DataVar []uintptr, ElementFreeFuncVar *DestroyNotify) uintptr { | |
| 718 | 853 | ||
| 719 | - | cret := xPtrArrayNewTakeNullTerminated(DataVar, NewCallbackNullable(ElementFreeFuncVar)) | |
| 854 | + | var ElementFreeFuncVarRef uintptr | |
| 855 | + | if ElementFreeFuncVar != nil { | |
| 856 | + | ElementFreeFuncVarPtr := uintptr(unsafe.Pointer(ElementFreeFuncVar)) | |
| 857 | + | if cbRefPtr, ok := GetCallback(ElementFreeFuncVarPtr); ok { | |
| 858 | + | ElementFreeFuncVarRef = cbRefPtr | |
| 859 | + | } else { | |
| 860 | + | fcb := func(arg0 uintptr) { | |
| 861 | + | cbFn := *ElementFreeFuncVar | |
| 862 | + | cbFn(arg0) | |
| 863 | + | } | |
| 864 | + | ElementFreeFuncVarRef = purego.NewCallback(fcb) | |
| 865 | + | SaveCallback(ElementFreeFuncVarPtr, ElementFreeFuncVarRef) | |
| 866 | + | } | |
| 867 | + | } | |
| 868 | + | ||
| 869 | + | cret := xPtrArrayNewTakeNullTerminated(DataVar, ElementFreeFuncVarRef) | |
| 720 | 870 | return cret | |
| 721 | 871 | } | |
| 722 | 872 | ||
M v4/glib/gasyncqueue.go +80 -5
| @@ -144,7 +144,22 @@ var xAsyncQueuePushSorted func(uintptr, uintptr, uintptr, uintptr) | |||
| 144 | 144 | // For an example of @func see g_async_queue_sort(). | |
| 145 | 145 | func (x *AsyncQueue) PushSorted(DataVar uintptr, FuncVar *CompareDataFunc, UserDataVar uintptr) { | |
| 146 | 146 | ||
| 147 | - | xAsyncQueuePushSorted(x.GoPointer(), DataVar, NewCallback(FuncVar), UserDataVar) | |
| 147 | + | var FuncVarRef uintptr | |
| 148 | + | if FuncVar != nil { | |
| 149 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 150 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 151 | + | FuncVarRef = cbRefPtr | |
| 152 | + | } else { | |
| 153 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 154 | + | cbFn := *FuncVar | |
| 155 | + | return cbFn(arg0, arg1, arg2) | |
| 156 | + | } | |
| 157 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 158 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 159 | + | } | |
| 160 | + | } | |
| 161 | + | ||
| 162 | + | xAsyncQueuePushSorted(x.GoPointer(), DataVar, FuncVarRef, UserDataVar) | |
| 148 | 163 | ||
| 149 | 164 | } | |
| 150 | 165 | ||
| @@ -167,7 +182,22 @@ var xAsyncQueuePushSortedUnlocked func(uintptr, uintptr, uintptr, uintptr) | |||
| 167 | 182 | // For an example of @func see g_async_queue_sort(). | |
| 168 | 183 | func (x *AsyncQueue) PushSortedUnlocked(DataVar uintptr, FuncVar *CompareDataFunc, UserDataVar uintptr) { | |
| 169 | 184 | ||
| 170 | - | xAsyncQueuePushSortedUnlocked(x.GoPointer(), DataVar, NewCallback(FuncVar), UserDataVar) | |
| 185 | + | var FuncVarRef uintptr | |
| 186 | + | if FuncVar != nil { | |
| 187 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 188 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 189 | + | FuncVarRef = cbRefPtr | |
| 190 | + | } else { | |
| 191 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 192 | + | cbFn := *FuncVar | |
| 193 | + | return cbFn(arg0, arg1, arg2) | |
| 194 | + | } | |
| 195 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 196 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 197 | + | } | |
| 198 | + | } | |
| 199 | + | ||
| 200 | + | xAsyncQueuePushSortedUnlocked(x.GoPointer(), DataVar, FuncVarRef, UserDataVar) | |
| 171 | 201 | ||
| 172 | 202 | } | |
| 173 | 203 | ||
| @@ -251,7 +281,22 @@ var xAsyncQueueSort func(uintptr, uintptr, uintptr) | |||
| 251 | 281 | // ]| | |
| 252 | 282 | func (x *AsyncQueue) Sort(FuncVar *CompareDataFunc, UserDataVar uintptr) { | |
| 253 | 283 | ||
| 254 | - | xAsyncQueueSort(x.GoPointer(), NewCallback(FuncVar), UserDataVar) | |
| 284 | + | var FuncVarRef uintptr | |
| 285 | + | if FuncVar != nil { | |
| 286 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 287 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 288 | + | FuncVarRef = cbRefPtr | |
| 289 | + | } else { | |
| 290 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 291 | + | cbFn := *FuncVar | |
| 292 | + | return cbFn(arg0, arg1, arg2) | |
| 293 | + | } | |
| 294 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 295 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 296 | + | } | |
| 297 | + | } | |
| 298 | + | ||
| 299 | + | xAsyncQueueSort(x.GoPointer(), FuncVarRef, UserDataVar) | |
| 255 | 300 | ||
| 256 | 301 | } | |
| 257 | 302 | ||
| @@ -268,7 +313,22 @@ var xAsyncQueueSortUnlocked func(uintptr, uintptr, uintptr) | |||
| 268 | 313 | // This function must be called while holding the @queue's lock. | |
| 269 | 314 | func (x *AsyncQueue) SortUnlocked(FuncVar *CompareDataFunc, UserDataVar uintptr) { | |
| 270 | 315 | ||
| 271 | - | xAsyncQueueSortUnlocked(x.GoPointer(), NewCallback(FuncVar), UserDataVar) | |
| 316 | + | var FuncVarRef uintptr | |
| 317 | + | if FuncVar != nil { | |
| 318 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 319 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 320 | + | FuncVarRef = cbRefPtr | |
| 321 | + | } else { | |
| 322 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 323 | + | cbFn := *FuncVar | |
| 324 | + | return cbFn(arg0, arg1, arg2) | |
| 325 | + | } | |
| 326 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 327 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 328 | + | } | |
| 329 | + | } | |
| 330 | + | ||
| 331 | + | xAsyncQueueSortUnlocked(x.GoPointer(), FuncVarRef, UserDataVar) | |
| 272 | 332 | ||
| 273 | 333 | } | |
| 274 | 334 | ||
| @@ -407,7 +467,22 @@ var xAsyncQueueNewFull func(uintptr) *AsyncQueue | |||
| 407 | 467 | // the queue is destroyed after the final unref. | |
| 408 | 468 | func AsyncQueueNewFull(ItemFreeFuncVar *DestroyNotify) *AsyncQueue { | |
| 409 | 469 | ||
| 410 | - | cret := xAsyncQueueNewFull(NewCallbackNullable(ItemFreeFuncVar)) | |
| 470 | + | var ItemFreeFuncVarRef uintptr | |
| 471 | + | if ItemFreeFuncVar != nil { | |
| 472 | + | ItemFreeFuncVarPtr := uintptr(unsafe.Pointer(ItemFreeFuncVar)) | |
| 473 | + | if cbRefPtr, ok := GetCallback(ItemFreeFuncVarPtr); ok { | |
| 474 | + | ItemFreeFuncVarRef = cbRefPtr | |
| 475 | + | } else { | |
| 476 | + | fcb := func(arg0 uintptr) { | |
| 477 | + | cbFn := *ItemFreeFuncVar | |
| 478 | + | cbFn(arg0) | |
| 479 | + | } | |
| 480 | + | ItemFreeFuncVarRef = purego.NewCallback(fcb) | |
| 481 | + | SaveCallback(ItemFreeFuncVarPtr, ItemFreeFuncVarRef) | |
| 482 | + | } | |
| 483 | + | } | |
| 484 | + | ||
| 485 | + | cret := xAsyncQueueNewFull(ItemFreeFuncVarRef) | |
| 411 | 486 | return cret | |
| 412 | 487 | } | |
| 413 | 488 | ||
M v4/glib/gbacktrace.go +3 -3
| @@ -64,7 +64,7 @@ func OnErrorQuery(PrgNameVar string) { | |||
| 64 | 64 | ||
| 65 | 65 | } | |
| 66 | 66 | ||
| 67 | - | var xOnErrorStackTrace func(string) | |
| 67 | + | var xOnErrorStackTrace func(uintptr) | |
| 68 | 68 | ||
| 69 | 69 | // Invokes gdb, which attaches to the current process and shows a | |
| 70 | 70 | // stack trace. Called by g_on_error_query() when the "[S]tack trace" | |
| @@ -79,9 +79,9 @@ var xOnErrorStackTrace func(string) | |||
| 79 | 79 | // exception, which will crash the program. If the `G_DEBUGGER` environment | |
| 80 | 80 | // variable is set, a debugger will be invoked to attach and | |
| 81 | 81 | // handle that exception (see [Running GLib Applications](running.html)). | |
| 82 | - | func OnErrorStackTrace(PrgNameVar string) { | |
| 82 | + | func OnErrorStackTrace(PrgNameVar *string) { | |
| 83 | 83 | ||
| 84 | - | xOnErrorStackTrace(PrgNameVar) | |
| 84 | + | xOnErrorStackTrace(core.NullableStringToPtr(PrgNameVar)) | |
| 85 | 85 | ||
| 86 | 86 | } | |
| 87 | 87 | ||
M v4/glib/gbookmarkfile.go +18 -18
| @@ -74,7 +74,7 @@ func NewBookmarkFile() *BookmarkFile { | |||
| 74 | 74 | return cret | |
| 75 | 75 | } | |
| 76 | 76 | ||
| 77 | - | var xBookmarkFileAddApplication func(uintptr, string, string, string) | |
| 77 | + | var xBookmarkFileAddApplication func(uintptr, string, uintptr, uintptr) | |
| 78 | 78 | ||
| 79 | 79 | // Adds the application with @name and @exec to the list of | |
| 80 | 80 | // applications that have registered a bookmark for @uri into | |
| @@ -98,9 +98,9 @@ var xBookmarkFileAddApplication func(uintptr, string, string, string) | |||
| 98 | 98 | // @uri inside @bookmark. | |
| 99 | 99 | // | |
| 100 | 100 | // If no bookmark for @uri is found, one is created. | |
| 101 | - | func (x *BookmarkFile) AddApplication(UriVar string, NameVar string, ExecVar string) { | |
| 101 | + | func (x *BookmarkFile) AddApplication(UriVar string, NameVar *string, ExecVar *string) { | |
| 102 | 102 | ||
| 103 | - | xBookmarkFileAddApplication(x.GoPointer(), UriVar, NameVar, ExecVar) | |
| 103 | + | xBookmarkFileAddApplication(x.GoPointer(), UriVar, core.NullableStringToPtr(NameVar), core.NullableStringToPtr(ExecVar)) | |
| 104 | 104 | ||
| 105 | 105 | } | |
| 106 | 106 | ||
| @@ -373,7 +373,7 @@ func (x *BookmarkFile) GetSize() int { | |||
| 373 | 373 | return cret | |
| 374 | 374 | } | |
| 375 | 375 | ||
| 376 | - | var xBookmarkFileGetTitle func(uintptr, string, **Error) string | |
| 376 | + | var xBookmarkFileGetTitle func(uintptr, uintptr, **Error) string | |
| 377 | 377 | ||
| 378 | 378 | // Returns the title of the bookmark for @uri. | |
| 379 | 379 | // | |
| @@ -381,10 +381,10 @@ var xBookmarkFileGetTitle func(uintptr, string, **Error) string | |||
| 381 | 381 | // | |
| 382 | 382 | // In the event the URI cannot be found, %NULL is returned and | |
| 383 | 383 | // @error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. | |
| 384 | - | func (x *BookmarkFile) GetTitle(UriVar string) (string, error) { | |
| 384 | + | func (x *BookmarkFile) GetTitle(UriVar *string) (string, error) { | |
| 385 | 385 | var cerr *Error | |
| 386 | 386 | ||
| 387 | - | cret := xBookmarkFileGetTitle(x.GoPointer(), UriVar, &cerr) | |
| 387 | + | cret := xBookmarkFileGetTitle(x.GoPointer(), core.NullableStringToPtr(UriVar), &cerr) | |
| 388 | 388 | if cerr == nil { | |
| 389 | 389 | return cret, nil | |
| 390 | 390 | } | |
| @@ -532,7 +532,7 @@ func (x *BookmarkFile) LoadFromFile(FilenameVar string) (bool, error) { | |||
| 532 | 532 | ||
| 533 | 533 | } | |
| 534 | 534 | ||
| 535 | - | var xBookmarkFileMoveItem func(uintptr, string, string, **Error) bool | |
| 535 | + | var xBookmarkFileMoveItem func(uintptr, string, uintptr, **Error) bool | |
| 536 | 536 | ||
| 537 | 537 | // Changes the URI of a bookmark item from @old_uri to @new_uri. Any | |
| 538 | 538 | // existing bookmark for @new_uri will be overwritten. If @new_uri is | |
| @@ -540,10 +540,10 @@ var xBookmarkFileMoveItem func(uintptr, string, string, **Error) bool | |||
| 540 | 540 | // | |
| 541 | 541 | // In the event the URI cannot be found, %FALSE is returned and | |
| 542 | 542 | // @error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. | |
| 543 | - | func (x *BookmarkFile) MoveItem(OldUriVar string, NewUriVar string) (bool, error) { | |
| 543 | + | func (x *BookmarkFile) MoveItem(OldUriVar string, NewUriVar *string) (bool, error) { | |
| 544 | 544 | var cerr *Error | |
| 545 | 545 | ||
| 546 | - | cret := xBookmarkFileMoveItem(x.GoPointer(), OldUriVar, NewUriVar, &cerr) | |
| 546 | + | cret := xBookmarkFileMoveItem(x.GoPointer(), OldUriVar, core.NullableStringToPtr(NewUriVar), &cerr) | |
| 547 | 547 | if cerr == nil { | |
| 548 | 548 | return cret, nil | |
| 549 | 549 | } | |
| @@ -709,16 +709,16 @@ func (x *BookmarkFile) SetApplicationInfo(UriVar string, NameVar string, ExecVar | |||
| 709 | 709 | ||
| 710 | 710 | } | |
| 711 | 711 | ||
| 712 | - | var xBookmarkFileSetDescription func(uintptr, string, string) | |
| 712 | + | var xBookmarkFileSetDescription func(uintptr, uintptr, string) | |
| 713 | 713 | ||
| 714 | 714 | // Sets @description as the description of the bookmark for @uri. | |
| 715 | 715 | // | |
| 716 | 716 | // If @uri is %NULL, the description of @bookmark is set. | |
| 717 | 717 | // | |
| 718 | 718 | // If a bookmark for @uri cannot be found then it is created. | |
| 719 | - | func (x *BookmarkFile) SetDescription(UriVar string, DescriptionVar string) { | |
| 719 | + | func (x *BookmarkFile) SetDescription(UriVar *string, DescriptionVar string) { | |
| 720 | 720 | ||
| 721 | - | xBookmarkFileSetDescription(x.GoPointer(), UriVar, DescriptionVar) | |
| 721 | + | xBookmarkFileSetDescription(x.GoPointer(), core.NullableStringToPtr(UriVar), DescriptionVar) | |
| 722 | 722 | ||
| 723 | 723 | } | |
| 724 | 724 | ||
| @@ -734,16 +734,16 @@ func (x *BookmarkFile) SetGroups(UriVar string, GroupsVar []string, LengthVar ui | |||
| 734 | 734 | ||
| 735 | 735 | } | |
| 736 | 736 | ||
| 737 | - | var xBookmarkFileSetIcon func(uintptr, string, string, string) | |
| 737 | + | var xBookmarkFileSetIcon func(uintptr, string, uintptr, string) | |
| 738 | 738 | ||
| 739 | 739 | // Sets the icon for the bookmark for @uri. If @href is %NULL, unsets | |
| 740 | 740 | // the currently set icon. @href can either be a full URL for the icon | |
| 741 | 741 | // file or the icon name following the Icon Naming specification. | |
| 742 | 742 | // | |
| 743 | 743 | // If no bookmark for @uri is found one is created. | |
| 744 | - | func (x *BookmarkFile) SetIcon(UriVar string, HrefVar string, MimeTypeVar string) { | |
| 744 | + | func (x *BookmarkFile) SetIcon(UriVar string, HrefVar *string, MimeTypeVar string) { | |
| 745 | 745 | ||
| 746 | - | xBookmarkFileSetIcon(x.GoPointer(), UriVar, HrefVar, MimeTypeVar) | |
| 746 | + | xBookmarkFileSetIcon(x.GoPointer(), UriVar, core.NullableStringToPtr(HrefVar), MimeTypeVar) | |
| 747 | 747 | ||
| 748 | 748 | } | |
| 749 | 749 | ||
| @@ -801,7 +801,7 @@ func (x *BookmarkFile) SetModifiedDateTime(UriVar string, ModifiedVar *DateTime) | |||
| 801 | 801 | ||
| 802 | 802 | } | |
| 803 | 803 | ||
| 804 | - | var xBookmarkFileSetTitle func(uintptr, string, string) | |
| 804 | + | var xBookmarkFileSetTitle func(uintptr, uintptr, string) | |
| 805 | 805 | ||
| 806 | 806 | // Sets @title as the title of the bookmark for @uri inside the | |
| 807 | 807 | // bookmark file @bookmark. | |
| @@ -809,9 +809,9 @@ var xBookmarkFileSetTitle func(uintptr, string, string) | |||
| 809 | 809 | // If @uri is %NULL, the title of @bookmark is set. | |
| 810 | 810 | // | |
| 811 | 811 | // If a bookmark for @uri cannot be found then it is created. | |
| 812 | - | func (x *BookmarkFile) SetTitle(UriVar string, TitleVar string) { | |
| 812 | + | func (x *BookmarkFile) SetTitle(UriVar *string, TitleVar string) { | |
| 813 | 813 | ||
| 814 | - | xBookmarkFileSetTitle(x.GoPointer(), UriVar, TitleVar) | |
| 814 | + | xBookmarkFileSetTitle(x.GoPointer(), core.NullableStringToPtr(UriVar), TitleVar) | |
| 815 | 815 | ||
| 816 | 816 | } | |
| 817 | 817 | ||
M v4/glib/gcache.go +32 -2
| @@ -80,7 +80,22 @@ var xCacheKeyForeach func(uintptr, uintptr, uintptr) | |||
| 80 | 80 | // pairs to its callback function ! | |
| 81 | 81 | func (x *Cache) KeyForeach(FuncVar *HFunc, UserDataVar uintptr) { | |
| 82 | 82 | ||
| 83 | - | xCacheKeyForeach(x.GoPointer(), NewCallback(FuncVar), UserDataVar) | |
| 83 | + | var FuncVarRef uintptr | |
| 84 | + | if FuncVar != nil { | |
| 85 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 86 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 87 | + | FuncVarRef = cbRefPtr | |
| 88 | + | } else { | |
| 89 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 90 | + | cbFn := *FuncVar | |
| 91 | + | cbFn(arg0, arg1, arg2) | |
| 92 | + | } | |
| 93 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 94 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 95 | + | } | |
| 96 | + | } | |
| 97 | + | ||
| 98 | + | xCacheKeyForeach(x.GoPointer(), FuncVarRef, UserDataVar) | |
| 84 | 99 | ||
| 85 | 100 | } | |
| 86 | 101 | ||
| @@ -100,7 +115,22 @@ var xCacheValueForeach func(uintptr, uintptr, uintptr) | |||
| 100 | 115 | // Calls the given function for each of the values in the #GCache. | |
| 101 | 116 | func (x *Cache) ValueForeach(FuncVar *HFunc, UserDataVar uintptr) { | |
| 102 | 117 | ||
| 103 | - | xCacheValueForeach(x.GoPointer(), NewCallback(FuncVar), UserDataVar) | |
| 118 | + | var FuncVarRef uintptr | |
| 119 | + | if FuncVar != nil { | |
| 120 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 121 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 122 | + | FuncVarRef = cbRefPtr | |
| 123 | + | } else { | |
| 124 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 125 | + | cbFn := *FuncVar | |
| 126 | + | cbFn(arg0, arg1, arg2) | |
| 127 | + | } | |
| 128 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 129 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 130 | + | } | |
| 131 | + | } | |
| 132 | + | ||
| 133 | + | xCacheValueForeach(x.GoPointer(), FuncVarRef, UserDataVar) | |
| 104 | 134 | ||
| 105 | 135 | } | |
| 106 | 136 | ||
M v4/glib/gcompletion.go +16 -1
| @@ -131,7 +131,22 @@ var xCompletionSetCompare func(uintptr, uintptr) | |||
| 131 | 131 | // comparison function is strncmp(). | |
| 132 | 132 | func (x *Completion) SetCompare(StrncmpFuncVar *CompletionStrncmpFunc) { | |
| 133 | 133 | ||
| 134 | - | xCompletionSetCompare(x.GoPointer(), NewCallback(StrncmpFuncVar)) | |
| 134 | + | var StrncmpFuncVarRef uintptr | |
| 135 | + | if StrncmpFuncVar != nil { | |
| 136 | + | StrncmpFuncVarPtr := uintptr(unsafe.Pointer(StrncmpFuncVar)) | |
| 137 | + | if cbRefPtr, ok := GetCallback(StrncmpFuncVarPtr); ok { | |
| 138 | + | StrncmpFuncVarRef = cbRefPtr | |
| 139 | + | } else { | |
| 140 | + | fcb := func(arg0 string, arg1 string, arg2 uint) int { | |
| 141 | + | cbFn := *StrncmpFuncVar | |
| 142 | + | return cbFn(arg0, arg1, arg2) | |
| 143 | + | } | |
| 144 | + | StrncmpFuncVarRef = purego.NewCallback(fcb) | |
| 145 | + | SaveCallback(StrncmpFuncVarPtr, StrncmpFuncVarRef) | |
| 146 | + | } | |
| 147 | + | } | |
| 148 | + | ||
| 149 | + | xCompletionSetCompare(x.GoPointer(), StrncmpFuncVarRef) | |
| 135 | 150 | ||
| 136 | 151 | } | |
| 137 | 152 | ||
M v4/glib/gconvert.go +3 -3
| @@ -266,14 +266,14 @@ func FilenameFromUtf8(Utf8stringVar string, LenVar int, BytesReadVar *uint, Byte | |||
| 266 | 266 | ||
| 267 | 267 | } | |
| 268 | 268 | ||
| 269 | - | var xFilenameToUri func(string, string, **Error) string | |
| 269 | + | var xFilenameToUri func(string, uintptr, **Error) string | |
| 270 | 270 | ||
| 271 | 271 | // Converts an absolute filename to an escaped ASCII-encoded URI, with the path | |
| 272 | 272 | // component following Section 3.3. of RFC 2396. | |
| 273 | - | func FilenameToUri(FilenameVar string, HostnameVar string) (string, error) { | |
| 273 | + | func FilenameToUri(FilenameVar string, HostnameVar *string) (string, error) { | |
| 274 | 274 | var cerr *Error | |
| 275 | 275 | ||
| 276 | - | cret := xFilenameToUri(FilenameVar, HostnameVar, &cerr) | |
| 276 | + | cret := xFilenameToUri(FilenameVar, core.NullableStringToPtr(HostnameVar), &cerr) | |
| 277 | 277 | if cerr == nil { | |
| 278 | 278 | return cret, nil | |
| 279 | 279 | } | |
M v4/glib/gdataset.go +96 -6
| @@ -63,7 +63,22 @@ var xDatalistForeach func(**Data, uintptr, uintptr) | |||
| 63 | 63 | // than skipping over elements that are removed. | |
| 64 | 64 | func DatalistForeach(DatalistVar **Data, FuncVar *DataForeachFunc, UserDataVar uintptr) { | |
| 65 | 65 | ||
| 66 | - | xDatalistForeach(DatalistVar, NewCallback(FuncVar), UserDataVar) | |
| 66 | + | var FuncVarRef uintptr | |
| 67 | + | if FuncVar != nil { | |
| 68 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 69 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 70 | + | FuncVarRef = cbRefPtr | |
| 71 | + | } else { | |
| 72 | + | fcb := func(arg0 Quark, arg1 uintptr, arg2 uintptr) { | |
| 73 | + | cbFn := *FuncVar | |
| 74 | + | cbFn(arg0, arg1, arg2) | |
| 75 | + | } | |
| 76 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 77 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 78 | + | } | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | xDatalistForeach(DatalistVar, FuncVarRef, UserDataVar) | |
| 67 | 82 | ||
| 68 | 83 | } | |
| 69 | 84 | ||
| @@ -104,7 +119,22 @@ var xDatalistIdDupData func(**Data, Quark, uintptr, uintptr) uintptr | |||
| 104 | 119 | // threads are using the same datalist and the same key. | |
| 105 | 120 | func DatalistIdDupData(DatalistVar **Data, KeyIdVar Quark, DupFuncVar *DuplicateFunc, UserDataVar uintptr) uintptr { | |
| 106 | 121 | ||
| 107 | - | cret := xDatalistIdDupData(DatalistVar, KeyIdVar, NewCallbackNullable(DupFuncVar), UserDataVar) | |
| 122 | + | var DupFuncVarRef uintptr | |
| 123 | + | if DupFuncVar != nil { | |
| 124 | + | DupFuncVarPtr := uintptr(unsafe.Pointer(DupFuncVar)) | |
| 125 | + | if cbRefPtr, ok := GetCallback(DupFuncVarPtr); ok { | |
| 126 | + | DupFuncVarRef = cbRefPtr | |
| 127 | + | } else { | |
| 128 | + | fcb := func(arg0 uintptr, arg1 uintptr) uintptr { | |
| 129 | + | cbFn := *DupFuncVar | |
| 130 | + | return cbFn(arg0, arg1) | |
| 131 | + | } | |
| 132 | + | DupFuncVarRef = purego.NewCallback(fcb) | |
| 133 | + | SaveCallback(DupFuncVarPtr, DupFuncVarRef) | |
| 134 | + | } | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | cret := xDatalistIdDupData(DatalistVar, KeyIdVar, DupFuncVarRef, UserDataVar) | |
| 108 | 138 | return cret | |
| 109 | 139 | } | |
| 110 | 140 | ||
| @@ -159,7 +189,22 @@ var xDatalistIdReplaceData func(**Data, Quark, uintptr, uintptr, uintptr, *Destr | |||
| 159 | 189 | // should not destroy the object in the normal way. | |
| 160 | 190 | func DatalistIdReplaceData(DatalistVar **Data, KeyIdVar Quark, OldvalVar uintptr, NewvalVar uintptr, DestroyVar *DestroyNotify, OldDestroyVar *DestroyNotify) bool { | |
| 161 | 191 | ||
| 162 | - | cret := xDatalistIdReplaceData(DatalistVar, KeyIdVar, OldvalVar, NewvalVar, NewCallbackNullable(DestroyVar), OldDestroyVar) | |
| 192 | + | var DestroyVarRef uintptr | |
| 193 | + | if DestroyVar != nil { | |
| 194 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 195 | + | if cbRefPtr, ok := GetCallback(DestroyVarPtr); ok { | |
| 196 | + | DestroyVarRef = cbRefPtr | |
| 197 | + | } else { | |
| 198 | + | fcb := func(arg0 uintptr) { | |
| 199 | + | cbFn := *DestroyVar | |
| 200 | + | cbFn(arg0) | |
| 201 | + | } | |
| 202 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 203 | + | SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 204 | + | } | |
| 205 | + | } | |
| 206 | + | ||
| 207 | + | cret := xDatalistIdReplaceData(DatalistVar, KeyIdVar, OldvalVar, NewvalVar, DestroyVarRef, OldDestroyVar) | |
| 163 | 208 | return cret | |
| 164 | 209 | } | |
| 165 | 210 | ||
| @@ -171,7 +216,22 @@ var xDatalistIdSetDataFull func(**Data, Quark, uintptr, uintptr) | |||
| 171 | 216 | // function is called. | |
| 172 | 217 | func DatalistIdSetDataFull(DatalistVar **Data, KeyIdVar Quark, DataVar uintptr, DestroyFuncVar *DestroyNotify) { | |
| 173 | 218 | ||
| 174 | - | xDatalistIdSetDataFull(DatalistVar, KeyIdVar, DataVar, NewCallbackNullable(DestroyFuncVar)) | |
| 219 | + | var DestroyFuncVarRef uintptr | |
| 220 | + | if DestroyFuncVar != nil { | |
| 221 | + | DestroyFuncVarPtr := uintptr(unsafe.Pointer(DestroyFuncVar)) | |
| 222 | + | if cbRefPtr, ok := GetCallback(DestroyFuncVarPtr); ok { | |
| 223 | + | DestroyFuncVarRef = cbRefPtr | |
| 224 | + | } else { | |
| 225 | + | fcb := func(arg0 uintptr) { | |
| 226 | + | cbFn := *DestroyFuncVar | |
| 227 | + | cbFn(arg0) | |
| 228 | + | } | |
| 229 | + | DestroyFuncVarRef = purego.NewCallback(fcb) | |
| 230 | + | SaveCallback(DestroyFuncVarPtr, DestroyFuncVarRef) | |
| 231 | + | } | |
| 232 | + | } | |
| 233 | + | ||
| 234 | + | xDatalistIdSetDataFull(DatalistVar, KeyIdVar, DataVar, DestroyFuncVarRef) | |
| 175 | 235 | ||
| 176 | 236 | } | |
| 177 | 237 | ||
| @@ -230,7 +290,22 @@ var xDatasetForeach func(uintptr, uintptr, uintptr) | |||
| 230 | 290 | // than skipping over elements that are removed. | |
| 231 | 291 | func DatasetForeach(DatasetLocationVar uintptr, FuncVar *DataForeachFunc, UserDataVar uintptr) { | |
| 232 | 292 | ||
| 233 | - | xDatasetForeach(DatasetLocationVar, NewCallback(FuncVar), UserDataVar) | |
| 293 | + | var FuncVarRef uintptr | |
| 294 | + | if FuncVar != nil { | |
| 295 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 296 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 297 | + | FuncVarRef = cbRefPtr | |
| 298 | + | } else { | |
| 299 | + | fcb := func(arg0 Quark, arg1 uintptr, arg2 uintptr) { | |
| 300 | + | cbFn := *FuncVar | |
| 301 | + | cbFn(arg0, arg1, arg2) | |
| 302 | + | } | |
| 303 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 304 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 305 | + | } | |
| 306 | + | } | |
| 307 | + | ||
| 308 | + | xDatasetForeach(DatasetLocationVar, FuncVarRef, UserDataVar) | |
| 234 | 309 | ||
| 235 | 310 | } | |
| 236 | 311 | ||
| @@ -261,7 +336,22 @@ var xDatasetIdSetDataFull func(uintptr, Quark, uintptr, uintptr) | |||
| 261 | 336 | // is called. | |
| 262 | 337 | func DatasetIdSetDataFull(DatasetLocationVar uintptr, KeyIdVar Quark, DataVar uintptr, DestroyFuncVar *DestroyNotify) { | |
| 263 | 338 | ||
| 264 | - | xDatasetIdSetDataFull(DatasetLocationVar, KeyIdVar, DataVar, NewCallback(DestroyFuncVar)) | |
| 339 | + | var DestroyFuncVarRef uintptr | |
| 340 | + | if DestroyFuncVar != nil { | |
| 341 | + | DestroyFuncVarPtr := uintptr(unsafe.Pointer(DestroyFuncVar)) | |
| 342 | + | if cbRefPtr, ok := GetCallback(DestroyFuncVarPtr); ok { | |
| 343 | + | DestroyFuncVarRef = cbRefPtr | |
| 344 | + | } else { | |
| 345 | + | fcb := func(arg0 uintptr) { | |
| 346 | + | cbFn := *DestroyFuncVar | |
| 347 | + | cbFn(arg0) | |
| 348 | + | } | |
| 349 | + | DestroyFuncVarRef = purego.NewCallback(fcb) | |
| 350 | + | SaveCallback(DestroyFuncVarPtr, DestroyFuncVarRef) | |
| 351 | + | } | |
| 352 | + | } | |
| 353 | + | ||
| 354 | + | xDatasetIdSetDataFull(DatasetLocationVar, KeyIdVar, DataVar, DestroyFuncVarRef) | |
| 265 | 355 | ||
| 266 | 356 | } | |
| 267 | 357 | ||
M v4/glib/gerror.go +92 -2
| @@ -149,7 +149,52 @@ var xErrorDomainRegister func(string, uint, uintptr, uintptr, uintptr) Quark | |||
| 149 | 149 | // g_error_domain_register_static(). | |
| 150 | 150 | func ErrorDomainRegister(ErrorTypeNameVar string, ErrorTypePrivateSizeVar uint, ErrorTypeInitVar *ErrorInitFunc, ErrorTypeCopyVar *ErrorCopyFunc, ErrorTypeClearVar *ErrorClearFunc) Quark { | |
| 151 | 151 | ||
| 152 | - | cret := xErrorDomainRegister(ErrorTypeNameVar, ErrorTypePrivateSizeVar, NewCallback(ErrorTypeInitVar), NewCallback(ErrorTypeCopyVar), NewCallback(ErrorTypeClearVar)) | |
| 152 | + | var ErrorTypeInitVarRef uintptr | |
| 153 | + | if ErrorTypeInitVar != nil { | |
| 154 | + | ErrorTypeInitVarPtr := uintptr(unsafe.Pointer(ErrorTypeInitVar)) | |
| 155 | + | if cbRefPtr, ok := GetCallback(ErrorTypeInitVarPtr); ok { | |
| 156 | + | ErrorTypeInitVarRef = cbRefPtr | |
| 157 | + | } else { | |
| 158 | + | fcb := func(arg0 *Error) { | |
| 159 | + | cbFn := *ErrorTypeInitVar | |
| 160 | + | cbFn(arg0) | |
| 161 | + | } | |
| 162 | + | ErrorTypeInitVarRef = purego.NewCallback(fcb) | |
| 163 | + | SaveCallback(ErrorTypeInitVarPtr, ErrorTypeInitVarRef) | |
| 164 | + | } | |
| 165 | + | } | |
| 166 | + | ||
| 167 | + | var ErrorTypeCopyVarRef uintptr | |
| 168 | + | if ErrorTypeCopyVar != nil { | |
| 169 | + | ErrorTypeCopyVarPtr := uintptr(unsafe.Pointer(ErrorTypeCopyVar)) | |
| 170 | + | if cbRefPtr, ok := GetCallback(ErrorTypeCopyVarPtr); ok { | |
| 171 | + | ErrorTypeCopyVarRef = cbRefPtr | |
| 172 | + | } else { | |
| 173 | + | fcb := func(arg0 *Error, arg1 *Error) { | |
| 174 | + | cbFn := *ErrorTypeCopyVar | |
| 175 | + | cbFn(arg0, arg1) | |
| 176 | + | } | |
| 177 | + | ErrorTypeCopyVarRef = purego.NewCallback(fcb) | |
| 178 | + | SaveCallback(ErrorTypeCopyVarPtr, ErrorTypeCopyVarRef) | |
| 179 | + | } | |
| 180 | + | } | |
| 181 | + | ||
| 182 | + | var ErrorTypeClearVarRef uintptr | |
| 183 | + | if ErrorTypeClearVar != nil { | |
| 184 | + | ErrorTypeClearVarPtr := uintptr(unsafe.Pointer(ErrorTypeClearVar)) | |
| 185 | + | if cbRefPtr, ok := GetCallback(ErrorTypeClearVarPtr); ok { | |
| 186 | + | ErrorTypeClearVarRef = cbRefPtr | |
| 187 | + | } else { | |
| 188 | + | fcb := func(arg0 *Error) { | |
| 189 | + | cbFn := *ErrorTypeClearVar | |
| 190 | + | cbFn(arg0) | |
| 191 | + | } | |
| 192 | + | ErrorTypeClearVarRef = purego.NewCallback(fcb) | |
| 193 | + | SaveCallback(ErrorTypeClearVarPtr, ErrorTypeClearVarRef) | |
| 194 | + | } | |
| 195 | + | } | |
| 196 | + | ||
| 197 | + | cret := xErrorDomainRegister(ErrorTypeNameVar, ErrorTypePrivateSizeVar, ErrorTypeInitVarRef, ErrorTypeCopyVarRef, ErrorTypeClearVarRef) | |
| 153 | 198 | return cret | |
| 154 | 199 | } | |
| 155 | 200 | ||
| @@ -174,7 +219,52 @@ var xErrorDomainRegisterStatic func(string, uint, uintptr, uintptr, uintptr) Qua | |||
| 174 | 219 | // already takes care of passing valid information to this function. | |
| 175 | 220 | func ErrorDomainRegisterStatic(ErrorTypeNameVar string, ErrorTypePrivateSizeVar uint, ErrorTypeInitVar *ErrorInitFunc, ErrorTypeCopyVar *ErrorCopyFunc, ErrorTypeClearVar *ErrorClearFunc) Quark { | |
| 176 | 221 | ||
| 177 | - | cret := xErrorDomainRegisterStatic(ErrorTypeNameVar, ErrorTypePrivateSizeVar, NewCallback(ErrorTypeInitVar), NewCallback(ErrorTypeCopyVar), NewCallback(ErrorTypeClearVar)) | |
| 222 | + | var ErrorTypeInitVarRef uintptr | |
| 223 | + | if ErrorTypeInitVar != nil { | |
| 224 | + | ErrorTypeInitVarPtr := uintptr(unsafe.Pointer(ErrorTypeInitVar)) | |
| 225 | + | if cbRefPtr, ok := GetCallback(ErrorTypeInitVarPtr); ok { | |
| 226 | + | ErrorTypeInitVarRef = cbRefPtr | |
| 227 | + | } else { | |
| 228 | + | fcb := func(arg0 *Error) { | |
| 229 | + | cbFn := *ErrorTypeInitVar | |
| 230 | + | cbFn(arg0) | |
| 231 | + | } | |
| 232 | + | ErrorTypeInitVarRef = purego.NewCallback(fcb) | |
| 233 | + | SaveCallback(ErrorTypeInitVarPtr, ErrorTypeInitVarRef) | |
| 234 | + | } | |
| 235 | + | } | |
| 236 | + | ||
| 237 | + | var ErrorTypeCopyVarRef uintptr | |
| 238 | + | if ErrorTypeCopyVar != nil { | |
| 239 | + | ErrorTypeCopyVarPtr := uintptr(unsafe.Pointer(ErrorTypeCopyVar)) | |
| 240 | + | if cbRefPtr, ok := GetCallback(ErrorTypeCopyVarPtr); ok { | |
| 241 | + | ErrorTypeCopyVarRef = cbRefPtr | |
| 242 | + | } else { | |
| 243 | + | fcb := func(arg0 *Error, arg1 *Error) { | |
| 244 | + | cbFn := *ErrorTypeCopyVar | |
| 245 | + | cbFn(arg0, arg1) | |
| 246 | + | } | |
| 247 | + | ErrorTypeCopyVarRef = purego.NewCallback(fcb) | |
| 248 | + | SaveCallback(ErrorTypeCopyVarPtr, ErrorTypeCopyVarRef) | |
| 249 | + | } | |
| 250 | + | } | |
| 251 | + | ||
| 252 | + | var ErrorTypeClearVarRef uintptr | |
| 253 | + | if ErrorTypeClearVar != nil { | |
| 254 | + | ErrorTypeClearVarPtr := uintptr(unsafe.Pointer(ErrorTypeClearVar)) | |
| 255 | + | if cbRefPtr, ok := GetCallback(ErrorTypeClearVarPtr); ok { | |
| 256 | + | ErrorTypeClearVarRef = cbRefPtr | |
| 257 | + | } else { | |
| 258 | + | fcb := func(arg0 *Error) { | |
| 259 | + | cbFn := *ErrorTypeClearVar | |
| 260 | + | cbFn(arg0) | |
| 261 | + | } | |
| 262 | + | ErrorTypeClearVarRef = purego.NewCallback(fcb) | |
| 263 | + | SaveCallback(ErrorTypeClearVarPtr, ErrorTypeClearVarRef) | |
| 264 | + | } | |
| 265 | + | } | |
| 266 | + | ||
| 267 | + | cret := xErrorDomainRegisterStatic(ErrorTypeNameVar, ErrorTypePrivateSizeVar, ErrorTypeInitVarRef, ErrorTypeCopyVarRef, ErrorTypeClearVarRef) | |
| 178 | 268 | return cret | |
| 179 | 269 | } | |
| 180 | 270 | ||
M v4/glib/gfileutils.go +9 -9
| @@ -282,7 +282,7 @@ func BuildPathv(SeparatorVar string, ArgsVar []string) string { | |||
| 282 | 282 | return cret | |
| 283 | 283 | } | |
| 284 | 284 | ||
| 285 | - | var xCanonicalizeFilename func(string, string) string | |
| 285 | + | var xCanonicalizeFilename func(string, uintptr) string | |
| 286 | 286 | ||
| 287 | 287 | // Gets the canonical file name from @filename. All triple slashes are turned into | |
| 288 | 288 | // single slashes, and all `..` and `.`s resolved against @relative_to. | |
| @@ -298,13 +298,13 @@ var xCanonicalizeFilename func(string, string) string | |||
| 298 | 298 | // exist. | |
| 299 | 299 | // | |
| 300 | 300 | // No file system I/O is done. | |
| 301 | - | func CanonicalizeFilename(FilenameVar string, RelativeToVar string) string { | |
| 301 | + | func CanonicalizeFilename(FilenameVar string, RelativeToVar *string) string { | |
| 302 | 302 | ||
| 303 | - | cret := xCanonicalizeFilename(FilenameVar, RelativeToVar) | |
| 303 | + | cret := xCanonicalizeFilename(FilenameVar, core.NullableStringToPtr(RelativeToVar)) | |
| 304 | 304 | return cret | |
| 305 | 305 | } | |
| 306 | 306 | ||
| 307 | - | var xDirMakeTmp func(string, **Error) string | |
| 307 | + | var xDirMakeTmp func(uintptr, **Error) string | |
| 308 | 308 | ||
| 309 | 309 | // Creates a subdirectory in the preferred directory for temporary | |
| 310 | 310 | // files (as returned by g_get_tmp_dir()). | |
| @@ -317,10 +317,10 @@ var xDirMakeTmp func(string, **Error) string | |||
| 317 | 317 | // | |
| 318 | 318 | // Note that in contrast to g_mkdtemp() (and mkdtemp()) @tmpl is not | |
| 319 | 319 | // modified, and might thus be a read-only literal string. | |
| 320 | - | func DirMakeTmp(TmplVar string) (string, error) { | |
| 320 | + | func DirMakeTmp(TmplVar *string) (string, error) { | |
| 321 | 321 | var cerr *Error | |
| 322 | 322 | ||
| 323 | - | cret := xDirMakeTmp(TmplVar, &cerr) | |
| 323 | + | cret := xDirMakeTmp(core.NullableStringToPtr(TmplVar), &cerr) | |
| 324 | 324 | if cerr == nil { | |
| 325 | 325 | return cret, nil | |
| 326 | 326 | } | |
| @@ -368,7 +368,7 @@ func FileGetContents(FilenameVar string, ContentsVar *[]byte, LengthVar *uint) ( | |||
| 368 | 368 | ||
| 369 | 369 | } | |
| 370 | 370 | ||
| 371 | - | var xFileOpenTmp func(string, *string, **Error) int | |
| 371 | + | var xFileOpenTmp func(uintptr, *string, **Error) int | |
| 372 | 372 | ||
| 373 | 373 | // Opens a file for writing in the preferred directory for temporary | |
| 374 | 374 | // files (as returned by g_get_tmp_dir()). | |
| @@ -386,10 +386,10 @@ var xFileOpenTmp func(string, *string, **Error) int | |||
| 386 | 386 | // is returned in @name_used. This string should be freed with g_free() | |
| 387 | 387 | // when not needed any longer. The returned name is in the GLib file | |
| 388 | 388 | // name encoding. | |
| 389 | - | func FileOpenTmp(TmplVar string, NameUsedVar *string) (int, error) { | |
| 389 | + | func FileOpenTmp(TmplVar *string, NameUsedVar *string) (int, error) { | |
| 390 | 390 | var cerr *Error | |
| 391 | 391 | ||
| 392 | - | cret := xFileOpenTmp(TmplVar, NameUsedVar, &cerr) | |
| 392 | + | cret := xFileOpenTmp(core.NullableStringToPtr(TmplVar), NameUsedVar, &cerr) | |
| 393 | 393 | if cerr == nil { | |
| 394 | 394 | return cret, nil | |
| 395 | 395 | } | |
M v4/glib/ggettext.go +15 -15
| @@ -6,19 +6,19 @@ import ( | |||
| 6 | 6 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 7 | ) | |
| 8 | 8 | ||
| 9 | - | var xDcgettext func(string, string, int) string | |
| 9 | + | var xDcgettext func(uintptr, string, int) string | |
| 10 | 10 | ||
| 11 | 11 | // This is a variant of g_dgettext() that allows specifying a locale | |
| 12 | 12 | // category instead of always using `LC_MESSAGES`. See g_dgettext() for | |
| 13 | 13 | // more information about how this functions differs from calling | |
| 14 | 14 | // dcgettext() directly. | |
| 15 | - | func Dcgettext(DomainVar string, MsgidVar string, CategoryVar int) string { | |
| 15 | + | func Dcgettext(DomainVar *string, MsgidVar string, CategoryVar int) string { | |
| 16 | 16 | ||
| 17 | - | cret := xDcgettext(DomainVar, MsgidVar, CategoryVar) | |
| 17 | + | cret := xDcgettext(core.NullableStringToPtr(DomainVar), MsgidVar, CategoryVar) | |
| 18 | 18 | return cret | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | - | var xDgettext func(string, string) string | |
| 21 | + | var xDgettext func(uintptr, string) string | |
| 22 | 22 | ||
| 23 | 23 | // This function is a wrapper of dgettext() which does not translate | |
| 24 | 24 | // the message if the default domain as set with textdomain() has no | |
| @@ -52,13 +52,13 @@ var xDgettext func(string, string) string | |||
| 52 | 52 | // | |
| 53 | 53 | // Applications should normally not use this function directly, | |
| 54 | 54 | // but use the _() macro for translations. | |
| 55 | - | func Dgettext(DomainVar string, MsgidVar string) string { | |
| 55 | + | func Dgettext(DomainVar *string, MsgidVar string) string { | |
| 56 | 56 | ||
| 57 | - | cret := xDgettext(DomainVar, MsgidVar) | |
| 57 | + | cret := xDgettext(core.NullableStringToPtr(DomainVar), MsgidVar) | |
| 58 | 58 | return cret | |
| 59 | 59 | } | |
| 60 | 60 | ||
| 61 | - | var xDngettext func(string, string, string, uint32) string | |
| 61 | + | var xDngettext func(uintptr, string, string, uint32) string | |
| 62 | 62 | ||
| 63 | 63 | // This function is a wrapper of dngettext() which does not translate | |
| 64 | 64 | // the message if the default domain as set with textdomain() has no | |
| @@ -66,13 +66,13 @@ var xDngettext func(string, string, string, uint32) string | |||
| 66 | 66 | // | |
| 67 | 67 | // See g_dgettext() for details of how this differs from dngettext() | |
| 68 | 68 | // proper. | |
| 69 | - | func Dngettext(DomainVar string, MsgidVar string, MsgidPluralVar string, NVar uint32) string { | |
| 69 | + | func Dngettext(DomainVar *string, MsgidVar string, MsgidPluralVar string, NVar uint32) string { | |
| 70 | 70 | ||
| 71 | - | cret := xDngettext(DomainVar, MsgidVar, MsgidPluralVar, NVar) | |
| 71 | + | cret := xDngettext(core.NullableStringToPtr(DomainVar), MsgidVar, MsgidPluralVar, NVar) | |
| 72 | 72 | return cret | |
| 73 | 73 | } | |
| 74 | 74 | ||
| 75 | - | var xDpgettext func(string, string, uint) string | |
| 75 | + | var xDpgettext func(uintptr, string, uint) string | |
| 76 | 76 | ||
| 77 | 77 | // This function is a variant of g_dgettext() which supports | |
| 78 | 78 | // a disambiguating message context. GNU gettext uses the | |
| @@ -87,13 +87,13 @@ var xDpgettext func(string, string, uint) string | |||
| 87 | 87 | // | |
| 88 | 88 | // Applications should normally not use this function directly, | |
| 89 | 89 | // but use the C_() macro for translations with context. | |
| 90 | - | func Dpgettext(DomainVar string, MsgctxtidVar string, MsgidoffsetVar uint) string { | |
| 90 | + | func Dpgettext(DomainVar *string, MsgctxtidVar string, MsgidoffsetVar uint) string { | |
| 91 | 91 | ||
| 92 | - | cret := xDpgettext(DomainVar, MsgctxtidVar, MsgidoffsetVar) | |
| 92 | + | cret := xDpgettext(core.NullableStringToPtr(DomainVar), MsgctxtidVar, MsgidoffsetVar) | |
| 93 | 93 | return cret | |
| 94 | 94 | } | |
| 95 | 95 | ||
| 96 | - | var xDpgettext2 func(string, string, string) string | |
| 96 | + | var xDpgettext2 func(uintptr, string, string) string | |
| 97 | 97 | ||
| 98 | 98 | // This function is a variant of g_dgettext() which supports | |
| 99 | 99 | // a disambiguating message context. GNU gettext uses the | |
| @@ -105,9 +105,9 @@ var xDpgettext2 func(string, string, string) string | |||
| 105 | 105 | // | |
| 106 | 106 | // This function differs from C_() in that it is not a macro and | |
| 107 | 107 | // thus you may use non-string-literals as context and msgid arguments. | |
| 108 | - | func Dpgettext2(DomainVar string, ContextVar string, MsgidVar string) string { | |
| 108 | + | func Dpgettext2(DomainVar *string, ContextVar string, MsgidVar string) string { | |
| 109 | 109 | ||
| 110 | - | cret := xDpgettext2(DomainVar, ContextVar, MsgidVar) | |
| 110 | + | cret := xDpgettext2(core.NullableStringToPtr(DomainVar), ContextVar, MsgidVar) | |
| 111 | 111 | return cret | |
| 112 | 112 | } | |
| 113 | 113 | ||
M v4/glib/ghash.go +64 -4
| @@ -286,7 +286,22 @@ var xHashTableFind func(*HashTable, uintptr, uintptr) uintptr | |||
| 286 | 286 | // values in a hash table ends up needing O(n*n) operations). | |
| 287 | 287 | func HashTableFind(HashTableVar *HashTable, PredicateVar *HRFunc, UserDataVar uintptr) uintptr { | |
| 288 | 288 | ||
| 289 | - | cret := xHashTableFind(HashTableVar, NewCallback(PredicateVar), UserDataVar) | |
| 289 | + | var PredicateVarRef uintptr | |
| 290 | + | if PredicateVar != nil { | |
| 291 | + | PredicateVarPtr := uintptr(unsafe.Pointer(PredicateVar)) | |
| 292 | + | if cbRefPtr, ok := GetCallback(PredicateVarPtr); ok { | |
| 293 | + | PredicateVarRef = cbRefPtr | |
| 294 | + | } else { | |
| 295 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) bool { | |
| 296 | + | cbFn := *PredicateVar | |
| 297 | + | return cbFn(arg0, arg1, arg2) | |
| 298 | + | } | |
| 299 | + | PredicateVarRef = purego.NewCallback(fcb) | |
| 300 | + | SaveCallback(PredicateVarPtr, PredicateVarRef) | |
| 301 | + | } | |
| 302 | + | } | |
| 303 | + | ||
| 304 | + | cret := xHashTableFind(HashTableVar, PredicateVarRef, UserDataVar) | |
| 290 | 305 | return cret | |
| 291 | 306 | } | |
| 292 | 307 | ||
| @@ -306,7 +321,22 @@ var xHashTableForeach func(*HashTable, uintptr, uintptr) | |||
| 306 | 321 | // order searches in contrast to g_hash_table_lookup(). | |
| 307 | 322 | func HashTableForeach(HashTableVar *HashTable, FuncVar *HFunc, UserDataVar uintptr) { | |
| 308 | 323 | ||
| 309 | - | xHashTableForeach(HashTableVar, NewCallback(FuncVar), UserDataVar) | |
| 324 | + | var FuncVarRef uintptr | |
| 325 | + | if FuncVar != nil { | |
| 326 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 327 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 328 | + | FuncVarRef = cbRefPtr | |
| 329 | + | } else { | |
| 330 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 331 | + | cbFn := *FuncVar | |
| 332 | + | cbFn(arg0, arg1, arg2) | |
| 333 | + | } | |
| 334 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 335 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 336 | + | } | |
| 337 | + | } | |
| 338 | + | ||
| 339 | + | xHashTableForeach(HashTableVar, FuncVarRef, UserDataVar) | |
| 310 | 340 | ||
| 311 | 341 | } | |
| 312 | 342 | ||
| @@ -322,7 +352,22 @@ var xHashTableForeachRemove func(*HashTable, uintptr, uintptr) uint | |||
| 322 | 352 | // key/value pairs in the hash table. | |
| 323 | 353 | func HashTableForeachRemove(HashTableVar *HashTable, FuncVar *HRFunc, UserDataVar uintptr) uint { | |
| 324 | 354 | ||
| 325 | - | cret := xHashTableForeachRemove(HashTableVar, NewCallback(FuncVar), UserDataVar) | |
| 355 | + | var FuncVarRef uintptr | |
| 356 | + | if FuncVar != nil { | |
| 357 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 358 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 359 | + | FuncVarRef = cbRefPtr | |
| 360 | + | } else { | |
| 361 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) bool { | |
| 362 | + | cbFn := *FuncVar | |
| 363 | + | return cbFn(arg0, arg1, arg2) | |
| 364 | + | } | |
| 365 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 366 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 367 | + | } | |
| 368 | + | } | |
| 369 | + | ||
| 370 | + | cret := xHashTableForeachRemove(HashTableVar, FuncVarRef, UserDataVar) | |
| 326 | 371 | return cret | |
| 327 | 372 | } | |
| 328 | 373 | ||
| @@ -337,7 +382,22 @@ var xHashTableForeachSteal func(*HashTable, uintptr, uintptr) uint | |||
| 337 | 382 | // key/value pairs in the hash table. | |
| 338 | 383 | func HashTableForeachSteal(HashTableVar *HashTable, FuncVar *HRFunc, UserDataVar uintptr) uint { | |
| 339 | 384 | ||
| 340 | - | cret := xHashTableForeachSteal(HashTableVar, NewCallback(FuncVar), UserDataVar) | |
| 385 | + | var FuncVarRef uintptr | |
| 386 | + | if FuncVar != nil { | |
| 387 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 388 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 389 | + | FuncVarRef = cbRefPtr | |
| 390 | + | } else { | |
| 391 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) bool { | |
| 392 | + | cbFn := *FuncVar | |
| 393 | + | return cbFn(arg0, arg1, arg2) | |
| 394 | + | } | |
| 395 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 396 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 397 | + | } | |
| 398 | + | } | |
| 399 | + | ||
| 400 | + | cret := xHashTableForeachSteal(HashTableVar, FuncVarRef, UserDataVar) | |
| 341 | 401 | return cret | |
| 342 | 402 | } | |
| 343 | 403 | ||
M v4/glib/ghook.go +48 -3
| @@ -135,7 +135,22 @@ var xHookListMarshal func(uintptr, bool, uintptr, uintptr) | |||
| 135 | 135 | // Calls a function on each valid #GHook. | |
| 136 | 136 | func (x *HookList) Marshal(MayRecurseVar bool, MarshallerVar *HookMarshaller, MarshalDataVar uintptr) { | |
| 137 | 137 | ||
| 138 | - | xHookListMarshal(x.GoPointer(), MayRecurseVar, NewCallback(MarshallerVar), MarshalDataVar) | |
| 138 | + | var MarshallerVarRef uintptr | |
| 139 | + | if MarshallerVar != nil { | |
| 140 | + | MarshallerVarPtr := uintptr(unsafe.Pointer(MarshallerVar)) | |
| 141 | + | if cbRefPtr, ok := GetCallback(MarshallerVarPtr); ok { | |
| 142 | + | MarshallerVarRef = cbRefPtr | |
| 143 | + | } else { | |
| 144 | + | fcb := func(arg0 *Hook, arg1 uintptr) { | |
| 145 | + | cbFn := *MarshallerVar | |
| 146 | + | cbFn(arg0, arg1) | |
| 147 | + | } | |
| 148 | + | MarshallerVarRef = purego.NewCallback(fcb) | |
| 149 | + | SaveCallback(MarshallerVarPtr, MarshallerVarRef) | |
| 150 | + | } | |
| 151 | + | } | |
| 152 | + | ||
| 153 | + | xHookListMarshal(x.GoPointer(), MayRecurseVar, MarshallerVarRef, MarshalDataVar) | |
| 139 | 154 | ||
| 140 | 155 | } | |
| 141 | 156 | ||
| @@ -145,7 +160,22 @@ var xHookListMarshalCheck func(uintptr, bool, uintptr, uintptr) | |||
| 145 | 160 | // function returns %FALSE. | |
| 146 | 161 | func (x *HookList) MarshalCheck(MayRecurseVar bool, MarshallerVar *HookCheckMarshaller, MarshalDataVar uintptr) { | |
| 147 | 162 | ||
| 148 | - | xHookListMarshalCheck(x.GoPointer(), MayRecurseVar, NewCallback(MarshallerVar), MarshalDataVar) | |
| 163 | + | var MarshallerVarRef uintptr | |
| 164 | + | if MarshallerVar != nil { | |
| 165 | + | MarshallerVarPtr := uintptr(unsafe.Pointer(MarshallerVar)) | |
| 166 | + | if cbRefPtr, ok := GetCallback(MarshallerVarPtr); ok { | |
| 167 | + | MarshallerVarRef = cbRefPtr | |
| 168 | + | } else { | |
| 169 | + | fcb := func(arg0 *Hook, arg1 uintptr) bool { | |
| 170 | + | cbFn := *MarshallerVar | |
| 171 | + | return cbFn(arg0, arg1) | |
| 172 | + | } | |
| 173 | + | MarshallerVarRef = purego.NewCallback(fcb) | |
| 174 | + | SaveCallback(MarshallerVarPtr, MarshallerVarRef) | |
| 175 | + | } | |
| 176 | + | } | |
| 177 | + | ||
| 178 | + | xHookListMarshalCheck(x.GoPointer(), MayRecurseVar, MarshallerVarRef, MarshalDataVar) | |
| 149 | 179 | ||
| 150 | 180 | } | |
| 151 | 181 | ||
| @@ -214,7 +244,22 @@ var xHookInsertSorted func(*HookList, *Hook, uintptr) | |||
| 214 | 244 | // Inserts a #GHook into a #GHookList, sorted by the given function. | |
| 215 | 245 | func HookInsertSorted(HookListVar *HookList, HookVar *Hook, FuncVar *HookCompareFunc) { | |
| 216 | 246 | ||
| 217 | - | xHookInsertSorted(HookListVar, HookVar, NewCallback(FuncVar)) | |
| 247 | + | var FuncVarRef uintptr | |
| 248 | + | if FuncVar != nil { | |
| 249 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 250 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 251 | + | FuncVarRef = cbRefPtr | |
| 252 | + | } else { | |
| 253 | + | fcb := func(arg0 *Hook, arg1 *Hook) int { | |
| 254 | + | cbFn := *FuncVar | |
| 255 | + | return cbFn(arg0, arg1) | |
| 256 | + | } | |
| 257 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 258 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 259 | + | } | |
| 260 | + | } | |
| 261 | + | ||
| 262 | + | xHookInsertSorted(HookListVar, HookVar, FuncVarRef) | |
| 218 | 263 | ||
| 219 | 264 | } | |
| 220 | 265 | ||
M v4/glib/giochannel.go +53 -8
| @@ -438,7 +438,7 @@ func (x *IOChannel) SetCloseOnUnref(DoCloseVar bool) { | |||
| 438 | 438 | ||
| 439 | 439 | } | |
| 440 | 440 | ||
| 441 | - | var xIOChannelSetEncoding func(uintptr, string, **Error) IOStatus | |
| 441 | + | var xIOChannelSetEncoding func(uintptr, uintptr, **Error) IOStatus | |
| 442 | 442 | ||
| 443 | 443 | // Sets the encoding for the input/output of the channel. | |
| 444 | 444 | // The internal encoding is always UTF-8. The default encoding | |
| @@ -474,10 +474,10 @@ var xIOChannelSetEncoding func(uintptr, string, **Error) IOStatus | |||
| 474 | 474 | // g_io_channel_seek_position() with an offset of %G_SEEK_CUR, and, if | |
| 475 | 475 | // they are "seekable", cannot call g_io_channel_write_chars() after | |
| 476 | 476 | // calling one of the API "read" functions. | |
| 477 | - | func (x *IOChannel) SetEncoding(EncodingVar string) (IOStatus, error) { | |
| 477 | + | func (x *IOChannel) SetEncoding(EncodingVar *string) (IOStatus, error) { | |
| 478 | 478 | var cerr *Error | |
| 479 | 479 | ||
| 480 | - | cret := xIOChannelSetEncoding(x.GoPointer(), EncodingVar, &cerr) | |
| 480 | + | cret := xIOChannelSetEncoding(x.GoPointer(), core.NullableStringToPtr(EncodingVar), &cerr) | |
| 481 | 481 | if cerr == nil { | |
| 482 | 482 | return cret, nil | |
| 483 | 483 | } | |
| @@ -499,13 +499,13 @@ func (x *IOChannel) SetFlags(FlagsVar IOFlags) (IOStatus, error) { | |||
| 499 | 499 | ||
| 500 | 500 | } | |
| 501 | 501 | ||
| 502 | - | var xIOChannelSetLineTerm func(uintptr, string, int) | |
| 502 | + | var xIOChannelSetLineTerm func(uintptr, uintptr, int) | |
| 503 | 503 | ||
| 504 | 504 | // This sets the string that #GIOChannel uses to determine | |
| 505 | 505 | // where in the file a line break occurs. | |
| 506 | - | func (x *IOChannel) SetLineTerm(LineTermVar string, LengthVar int) { | |
| 506 | + | func (x *IOChannel) SetLineTerm(LineTermVar *string, LengthVar int) { | |
| 507 | 507 | ||
| 508 | - | xIOChannelSetLineTerm(x.GoPointer(), LineTermVar, LengthVar) | |
| 508 | + | xIOChannelSetLineTerm(x.GoPointer(), core.NullableStringToPtr(LineTermVar), LengthVar) | |
| 509 | 509 | ||
| 510 | 510 | } | |
| 511 | 511 | ||
| @@ -1018,7 +1018,22 @@ var xIoAddWatch func(*IOChannel, IOCondition, uintptr, uintptr) uint | |||
| 1018 | 1018 | // with the default priority. | |
| 1019 | 1019 | func IoAddWatch(ChannelVar *IOChannel, ConditionVar IOCondition, FuncVar *IOFunc, UserDataVar uintptr) uint { | |
| 1020 | 1020 | ||
| 1021 | - | cret := xIoAddWatch(ChannelVar, ConditionVar, NewCallback(FuncVar), UserDataVar) | |
| 1021 | + | var FuncVarRef uintptr | |
| 1022 | + | if FuncVar != nil { | |
| 1023 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 1024 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 1025 | + | FuncVarRef = cbRefPtr | |
| 1026 | + | } else { | |
| 1027 | + | fcb := func(arg0 *IOChannel, arg1 IOCondition, arg2 uintptr) bool { | |
| 1028 | + | cbFn := *FuncVar | |
| 1029 | + | return cbFn(arg0, arg1, arg2) | |
| 1030 | + | } | |
| 1031 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 1032 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 1033 | + | } | |
| 1034 | + | } | |
| 1035 | + | ||
| 1036 | + | cret := xIoAddWatch(ChannelVar, ConditionVar, FuncVarRef, UserDataVar) | |
| 1022 | 1037 | return cret | |
| 1023 | 1038 | } | |
| 1024 | 1039 | ||
| @@ -1032,7 +1047,37 @@ var xIoAddWatchFull func(*IOChannel, int, IOCondition, uintptr, uintptr, uintptr | |||
| 1032 | 1047 | // You can do these steps manually if you need greater control. | |
| 1033 | 1048 | func IoAddWatchFull(ChannelVar *IOChannel, PriorityVar int, ConditionVar IOCondition, FuncVar *IOFunc, UserDataVar uintptr, NotifyVar *DestroyNotify) uint { | |
| 1034 | 1049 | ||
| 1035 | - | cret := xIoAddWatchFull(ChannelVar, PriorityVar, ConditionVar, NewCallback(FuncVar), UserDataVar, NewCallback(NotifyVar)) | |
| 1050 | + | var FuncVarRef uintptr | |
| 1051 | + | if FuncVar != nil { | |
| 1052 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 1053 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 1054 | + | FuncVarRef = cbRefPtr | |
| 1055 | + | } else { | |
| 1056 | + | fcb := func(arg0 *IOChannel, arg1 IOCondition, arg2 uintptr) bool { | |
| 1057 | + | cbFn := *FuncVar | |
| 1058 | + | return cbFn(arg0, arg1, arg2) | |
| 1059 | + | } | |
| 1060 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 1061 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 1062 | + | } | |
| 1063 | + | } | |
| 1064 | + | ||
| 1065 | + | var NotifyVarRef uintptr | |
| 1066 | + | if NotifyVar != nil { | |
| 1067 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 1068 | + | if cbRefPtr, ok := GetCallback(NotifyVarPtr); ok { | |
| 1069 | + | NotifyVarRef = cbRefPtr | |
| 1070 | + | } else { | |
| 1071 | + | fcb := func(arg0 uintptr) { | |
| 1072 | + | cbFn := *NotifyVar | |
| 1073 | + | cbFn(arg0) | |
| 1074 | + | } | |
| 1075 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 1076 | + | SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 1077 | + | } | |
| 1078 | + | } | |
| 1079 | + | ||
| 1080 | + | cret := xIoAddWatchFull(ChannelVar, PriorityVar, ConditionVar, FuncVarRef, UserDataVar, NotifyVarRef) | |
| 1036 | 1081 | return cret | |
| 1037 | 1082 | } | |
| 1038 | 1083 | ||
M v4/glib/gkeyfile.go +18 -18
| @@ -230,7 +230,7 @@ func (x *KeyFile) GetBooleanList(GroupNameVar string, KeyVar string, LengthVar * | |||
| 230 | 230 | ||
| 231 | 231 | } | |
| 232 | 232 | ||
| 233 | - | var xKeyFileGetComment func(uintptr, string, string, **Error) string | |
| 233 | + | var xKeyFileGetComment func(uintptr, uintptr, uintptr, **Error) string | |
| 234 | 234 | ||
| 235 | 235 | // Retrieves a comment above @key from @group_name. | |
| 236 | 236 | // | |
| @@ -241,10 +241,10 @@ var xKeyFileGetComment func(uintptr, string, string, **Error) string | |||
| 241 | 241 | // Note that the returned string does not include the `#` comment markers, | |
| 242 | 242 | // but does include any whitespace after them (on each line). It includes | |
| 243 | 243 | // the line breaks between lines, but does not include the final line break. | |
| 244 | - | func (x *KeyFile) GetComment(GroupNameVar string, KeyVar string) (string, error) { | |
| 244 | + | func (x *KeyFile) GetComment(GroupNameVar *string, KeyVar *string) (string, error) { | |
| 245 | 245 | var cerr *Error | |
| 246 | 246 | ||
| 247 | - | cret := xKeyFileGetComment(x.GoPointer(), GroupNameVar, KeyVar, &cerr) | |
| 247 | + | cret := xKeyFileGetComment(x.GoPointer(), core.NullableStringToPtr(GroupNameVar), core.NullableStringToPtr(KeyVar), &cerr) | |
| 248 | 248 | if cerr == nil { | |
| 249 | 249 | return cret, nil | |
| 250 | 250 | } | |
| @@ -377,7 +377,7 @@ func (x *KeyFile) GetKeys(GroupNameVar string, LengthVar *uint) ([]string, error | |||
| 377 | 377 | ||
| 378 | 378 | } | |
| 379 | 379 | ||
| 380 | - | var xKeyFileGetLocaleForKey func(uintptr, string, string, string) string | |
| 380 | + | var xKeyFileGetLocaleForKey func(uintptr, string, string, uintptr) string | |
| 381 | 381 | ||
| 382 | 382 | // Returns the actual locale which the result of | |
| 383 | 383 | // [method@GLib.KeyFile.get_locale_string] or | |
| @@ -388,13 +388,13 @@ var xKeyFileGetLocaleForKey func(uintptr, string, string, string) string | |||
| 388 | 388 | // @group_name, @key and @locale, the result of those functions will | |
| 389 | 389 | // have originally been tagged with the locale that is the result of | |
| 390 | 390 | // this function. | |
| 391 | - | func (x *KeyFile) GetLocaleForKey(GroupNameVar string, KeyVar string, LocaleVar string) string { | |
| 391 | + | func (x *KeyFile) GetLocaleForKey(GroupNameVar string, KeyVar string, LocaleVar *string) string { | |
| 392 | 392 | ||
| 393 | - | cret := xKeyFileGetLocaleForKey(x.GoPointer(), GroupNameVar, KeyVar, LocaleVar) | |
| 393 | + | cret := xKeyFileGetLocaleForKey(x.GoPointer(), GroupNameVar, KeyVar, core.NullableStringToPtr(LocaleVar)) | |
| 394 | 394 | return cret | |
| 395 | 395 | } | |
| 396 | 396 | ||
| 397 | - | var xKeyFileGetLocaleString func(uintptr, string, string, string, **Error) string | |
| 397 | + | var xKeyFileGetLocaleString func(uintptr, string, string, uintptr, **Error) string | |
| 398 | 398 | ||
| 399 | 399 | // Returns the value associated with @key under @group_name | |
| 400 | 400 | // translated in the given @locale if available. | |
| @@ -412,10 +412,10 @@ var xKeyFileGetLocaleString func(uintptr, string, string, string, **Error) strin | |||
| 412 | 412 | // returned. If the value associated | |
| 413 | 413 | // with @key cannot be interpreted or no suitable translation can | |
| 414 | 414 | // be found then the untranslated value is returned. | |
| 415 | - | func (x *KeyFile) GetLocaleString(GroupNameVar string, KeyVar string, LocaleVar string) (string, error) { | |
| 415 | + | func (x *KeyFile) GetLocaleString(GroupNameVar string, KeyVar string, LocaleVar *string) (string, error) { | |
| 416 | 416 | var cerr *Error | |
| 417 | 417 | ||
| 418 | - | cret := xKeyFileGetLocaleString(x.GoPointer(), GroupNameVar, KeyVar, LocaleVar, &cerr) | |
| 418 | + | cret := xKeyFileGetLocaleString(x.GoPointer(), GroupNameVar, KeyVar, core.NullableStringToPtr(LocaleVar), &cerr) | |
| 419 | 419 | if cerr == nil { | |
| 420 | 420 | return cret, nil | |
| 421 | 421 | } | |
| @@ -423,7 +423,7 @@ func (x *KeyFile) GetLocaleString(GroupNameVar string, KeyVar string, LocaleVar | |||
| 423 | 423 | ||
| 424 | 424 | } | |
| 425 | 425 | ||
| 426 | - | var xKeyFileGetLocaleStringList func(uintptr, string, string, string, *uint, **Error) []string | |
| 426 | + | var xKeyFileGetLocaleStringList func(uintptr, string, string, uintptr, *uint, **Error) []string | |
| 427 | 427 | ||
| 428 | 428 | // Returns the values associated with @key under @group_name | |
| 429 | 429 | // translated in the given @locale if available. | |
| @@ -443,10 +443,10 @@ var xKeyFileGetLocaleStringList func(uintptr, string, string, string, *uint, **E | |||
| 443 | 443 | // can be found then the untranslated values are returned. The | |
| 444 | 444 | // returned array is `NULL`-terminated, so @length may optionally | |
| 445 | 445 | // be `NULL`. | |
| 446 | - | func (x *KeyFile) GetLocaleStringList(GroupNameVar string, KeyVar string, LocaleVar string, LengthVar *uint) ([]string, error) { | |
| 446 | + | func (x *KeyFile) GetLocaleStringList(GroupNameVar string, KeyVar string, LocaleVar *string, LengthVar *uint) ([]string, error) { | |
| 447 | 447 | var cerr *Error | |
| 448 | 448 | ||
| 449 | - | cret := xKeyFileGetLocaleStringList(x.GoPointer(), GroupNameVar, KeyVar, LocaleVar, LengthVar, &cerr) | |
| 449 | + | cret := xKeyFileGetLocaleStringList(x.GoPointer(), GroupNameVar, KeyVar, core.NullableStringToPtr(LocaleVar), LengthVar, &cerr) | |
| 450 | 450 | if cerr == nil { | |
| 451 | 451 | return cret, nil | |
| 452 | 452 | } | |
| @@ -686,17 +686,17 @@ func (x *KeyFile) Ref() *KeyFile { | |||
| 686 | 686 | return cret | |
| 687 | 687 | } | |
| 688 | 688 | ||
| 689 | - | var xKeyFileRemoveComment func(uintptr, string, string, **Error) bool | |
| 689 | + | var xKeyFileRemoveComment func(uintptr, uintptr, uintptr, **Error) bool | |
| 690 | 690 | ||
| 691 | 691 | // Removes a comment above @key from @group_name. | |
| 692 | 692 | // | |
| 693 | 693 | // If @key is `NULL` then @comment will be removed above @group_name. | |
| 694 | 694 | // If both @key and @group_name are `NULL`, then @comment will | |
| 695 | 695 | // be removed above the first group in the file. | |
| 696 | - | func (x *KeyFile) RemoveComment(GroupNameVar string, KeyVar string) (bool, error) { | |
| 696 | + | func (x *KeyFile) RemoveComment(GroupNameVar *string, KeyVar *string) (bool, error) { | |
| 697 | 697 | var cerr *Error | |
| 698 | 698 | ||
| 699 | - | cret := xKeyFileRemoveComment(x.GoPointer(), GroupNameVar, KeyVar, &cerr) | |
| 699 | + | cret := xKeyFileRemoveComment(x.GoPointer(), core.NullableStringToPtr(GroupNameVar), core.NullableStringToPtr(KeyVar), &cerr) | |
| 700 | 700 | if cerr == nil { | |
| 701 | 701 | return cret, nil | |
| 702 | 702 | } | |
| @@ -778,7 +778,7 @@ func (x *KeyFile) SetBooleanList(GroupNameVar string, KeyVar string, ListVar []b | |||
| 778 | 778 | ||
| 779 | 779 | } | |
| 780 | 780 | ||
| 781 | - | var xKeyFileSetComment func(uintptr, string, string, string, **Error) bool | |
| 781 | + | var xKeyFileSetComment func(uintptr, uintptr, uintptr, string, **Error) bool | |
| 782 | 782 | ||
| 783 | 783 | // Places a comment above @key from @group_name. | |
| 784 | 784 | // | |
| @@ -793,10 +793,10 @@ var xKeyFileSetComment func(uintptr, string, string, string, **Error) bool | |||
| 793 | 793 | // | |
| 794 | 794 | // Note that this function prepends a `#` comment marker to | |
| 795 | 795 | // each line of @comment. | |
| 796 | - | func (x *KeyFile) SetComment(GroupNameVar string, KeyVar string, CommentVar string) (bool, error) { | |
| 796 | + | func (x *KeyFile) SetComment(GroupNameVar *string, KeyVar *string, CommentVar string) (bool, error) { | |
| 797 | 797 | var cerr *Error | |
| 798 | 798 | ||
| 799 | - | cret := xKeyFileSetComment(x.GoPointer(), GroupNameVar, KeyVar, CommentVar, &cerr) | |
| 799 | + | cret := xKeyFileSetComment(x.GoPointer(), core.NullableStringToPtr(GroupNameVar), core.NullableStringToPtr(KeyVar), CommentVar, &cerr) | |
| 800 | 800 | if cerr == nil { | |
| 801 | 801 | return cret, nil | |
| 802 | 802 | } | |
M v4/glib/glib-unix.go +94 -4
| @@ -99,7 +99,22 @@ var xUnixFdAdd func(int, IOCondition, uintptr, uintptr) uint | |||
| 99 | 99 | // The source will never close the fd -- you must do it yourself. | |
| 100 | 100 | func UnixFdAdd(FdVar int, ConditionVar IOCondition, FunctionVar *UnixFDSourceFunc, UserDataVar uintptr) uint { | |
| 101 | 101 | ||
| 102 | - | cret := xUnixFdAdd(FdVar, ConditionVar, NewCallback(FunctionVar), UserDataVar) | |
| 102 | + | var FunctionVarRef uintptr | |
| 103 | + | if FunctionVar != nil { | |
| 104 | + | FunctionVarPtr := uintptr(unsafe.Pointer(FunctionVar)) | |
| 105 | + | if cbRefPtr, ok := GetCallback(FunctionVarPtr); ok { | |
| 106 | + | FunctionVarRef = cbRefPtr | |
| 107 | + | } else { | |
| 108 | + | fcb := func(arg0 int, arg1 IOCondition, arg2 uintptr) bool { | |
| 109 | + | cbFn := *FunctionVar | |
| 110 | + | return cbFn(arg0, arg1, arg2) | |
| 111 | + | } | |
| 112 | + | FunctionVarRef = purego.NewCallback(fcb) | |
| 113 | + | SaveCallback(FunctionVarPtr, FunctionVarRef) | |
| 114 | + | } | |
| 115 | + | } | |
| 116 | + | ||
| 117 | + | cret := xUnixFdAdd(FdVar, ConditionVar, FunctionVarRef, UserDataVar) | |
| 103 | 118 | return cret | |
| 104 | 119 | } | |
| 105 | 120 | ||
| @@ -113,7 +128,37 @@ var xUnixFdAddFull func(int, int, IOCondition, uintptr, uintptr, uintptr) uint | |||
| 113 | 128 | // @user_data. | |
| 114 | 129 | func UnixFdAddFull(PriorityVar int, FdVar int, ConditionVar IOCondition, FunctionVar *UnixFDSourceFunc, UserDataVar uintptr, NotifyVar *DestroyNotify) uint { | |
| 115 | 130 | ||
| 116 | - | cret := xUnixFdAddFull(PriorityVar, FdVar, ConditionVar, NewCallback(FunctionVar), UserDataVar, NewCallback(NotifyVar)) | |
| 131 | + | var FunctionVarRef uintptr | |
| 132 | + | if FunctionVar != nil { | |
| 133 | + | FunctionVarPtr := uintptr(unsafe.Pointer(FunctionVar)) | |
| 134 | + | if cbRefPtr, ok := GetCallback(FunctionVarPtr); ok { | |
| 135 | + | FunctionVarRef = cbRefPtr | |
| 136 | + | } else { | |
| 137 | + | fcb := func(arg0 int, arg1 IOCondition, arg2 uintptr) bool { | |
| 138 | + | cbFn := *FunctionVar | |
| 139 | + | return cbFn(arg0, arg1, arg2) | |
| 140 | + | } | |
| 141 | + | FunctionVarRef = purego.NewCallback(fcb) | |
| 142 | + | SaveCallback(FunctionVarPtr, FunctionVarRef) | |
| 143 | + | } | |
| 144 | + | } | |
| 145 | + | ||
| 146 | + | var NotifyVarRef uintptr | |
| 147 | + | if NotifyVar != nil { | |
| 148 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 149 | + | if cbRefPtr, ok := GetCallback(NotifyVarPtr); ok { | |
| 150 | + | NotifyVarRef = cbRefPtr | |
| 151 | + | } else { | |
| 152 | + | fcb := func(arg0 uintptr) { | |
| 153 | + | cbFn := *NotifyVar | |
| 154 | + | cbFn(arg0) | |
| 155 | + | } | |
| 156 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 157 | + | SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 158 | + | } | |
| 159 | + | } | |
| 160 | + | ||
| 161 | + | cret := xUnixFdAddFull(PriorityVar, FdVar, ConditionVar, FunctionVarRef, UserDataVar, NotifyVarRef) | |
| 117 | 162 | return cret | |
| 118 | 163 | } | |
| 119 | 164 | ||
| @@ -211,7 +256,22 @@ var xUnixSignalAdd func(int, uintptr, uintptr) uint | |||
| 211 | 256 | // using g_source_remove(). | |
| 212 | 257 | func UnixSignalAdd(SignumVar int, HandlerVar *SourceFunc, UserDataVar uintptr) uint { | |
| 213 | 258 | ||
| 214 | - | cret := xUnixSignalAdd(SignumVar, NewCallback(HandlerVar), UserDataVar) | |
| 259 | + | var HandlerVarRef uintptr | |
| 260 | + | if HandlerVar != nil { | |
| 261 | + | HandlerVarPtr := uintptr(unsafe.Pointer(HandlerVar)) | |
| 262 | + | if cbRefPtr, ok := GetCallback(HandlerVarPtr); ok { | |
| 263 | + | HandlerVarRef = cbRefPtr | |
| 264 | + | } else { | |
| 265 | + | fcb := func(arg0 uintptr) bool { | |
| 266 | + | cbFn := *HandlerVar | |
| 267 | + | return cbFn(arg0) | |
| 268 | + | } | |
| 269 | + | HandlerVarRef = purego.NewCallback(fcb) | |
| 270 | + | SaveCallback(HandlerVarPtr, HandlerVarRef) | |
| 271 | + | } | |
| 272 | + | } | |
| 273 | + | ||
| 274 | + | cret := xUnixSignalAdd(SignumVar, HandlerVarRef, UserDataVar) | |
| 215 | 275 | return cret | |
| 216 | 276 | } | |
| 217 | 277 | ||
| @@ -222,7 +282,37 @@ var xUnixSignalAddFull func(int, int, uintptr, uintptr, uintptr) uint | |||
| 222 | 282 | // using g_source_remove(). | |
| 223 | 283 | func UnixSignalAddFull(PriorityVar int, SignumVar int, HandlerVar *SourceFunc, UserDataVar uintptr, NotifyVar *DestroyNotify) uint { | |
| 224 | 284 | ||
| 225 | - | cret := xUnixSignalAddFull(PriorityVar, SignumVar, NewCallback(HandlerVar), UserDataVar, NewCallback(NotifyVar)) | |
| 285 | + | var HandlerVarRef uintptr | |
| 286 | + | if HandlerVar != nil { | |
| 287 | + | HandlerVarPtr := uintptr(unsafe.Pointer(HandlerVar)) | |
| 288 | + | if cbRefPtr, ok := GetCallback(HandlerVarPtr); ok { | |
| 289 | + | HandlerVarRef = cbRefPtr | |
| 290 | + | } else { | |
| 291 | + | fcb := func(arg0 uintptr) bool { | |
| 292 | + | cbFn := *HandlerVar | |
| 293 | + | return cbFn(arg0) | |
| 294 | + | } | |
| 295 | + | HandlerVarRef = purego.NewCallback(fcb) | |
| 296 | + | SaveCallback(HandlerVarPtr, HandlerVarRef) | |
| 297 | + | } | |
| 298 | + | } | |
| 299 | + | ||
| 300 | + | var NotifyVarRef uintptr | |
| 301 | + | if NotifyVar != nil { | |
| 302 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 303 | + | if cbRefPtr, ok := GetCallback(NotifyVarPtr); ok { | |
| 304 | + | NotifyVarRef = cbRefPtr | |
| 305 | + | } else { | |
| 306 | + | fcb := func(arg0 uintptr) { | |
| 307 | + | cbFn := *NotifyVar | |
| 308 | + | cbFn(arg0) | |
| 309 | + | } | |
| 310 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 311 | + | SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 312 | + | } | |
| 313 | + | } | |
| 314 | + | ||
| 315 | + | cret := xUnixSignalAddFull(PriorityVar, SignumVar, HandlerVarRef, UserDataVar, NotifyVarRef) | |
| 226 | 316 | return cret | |
| 227 | 317 | } | |
| 228 | 318 | ||
M v4/glib/glist.go +16 -1
| @@ -31,7 +31,22 @@ var xClearList func(**List, uintptr) | |||
| 31 | 31 | // @list_ptr must be a valid pointer. If @list_ptr points to a null #GList, this does nothing. | |
| 32 | 32 | func ClearList(ListPtrVar **List, DestroyVar *DestroyNotify) { | |
| 33 | 33 | ||
| 34 | - | xClearList(ListPtrVar, NewCallbackNullable(DestroyVar)) | |
| 34 | + | var DestroyVarRef uintptr | |
| 35 | + | if DestroyVar != nil { | |
| 36 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 37 | + | if cbRefPtr, ok := GetCallback(DestroyVarPtr); ok { | |
| 38 | + | DestroyVarRef = cbRefPtr | |
| 39 | + | } else { | |
| 40 | + | fcb := func(arg0 uintptr) { | |
| 41 | + | cbFn := *DestroyVar | |
| 42 | + | cbFn(arg0) | |
| 43 | + | } | |
| 44 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 45 | + | SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 46 | + | } | |
| 47 | + | } | |
| 48 | + | ||
| 49 | + | xClearList(ListPtrVar, DestroyVarRef) | |
| 35 | 50 | ||
| 36 | 51 | } | |
| 37 | 52 | ||
M v4/glib/gmain.go +362 -17
| @@ -279,7 +279,22 @@ var xMainContextInvoke func(uintptr, uintptr, uintptr) | |||
| 279 | 279 | // will be continuously run in a loop (and may prevent this call from returning). | |
| 280 | 280 | func (x *MainContext) Invoke(FunctionVar *SourceFunc, DataVar uintptr) { | |
| 281 | 281 | ||
| 282 | - | xMainContextInvoke(x.GoPointer(), NewCallback(FunctionVar), DataVar) | |
| 282 | + | var FunctionVarRef uintptr | |
| 283 | + | if FunctionVar != nil { | |
| 284 | + | FunctionVarPtr := uintptr(unsafe.Pointer(FunctionVar)) | |
| 285 | + | if cbRefPtr, ok := GetCallback(FunctionVarPtr); ok { | |
| 286 | + | FunctionVarRef = cbRefPtr | |
| 287 | + | } else { | |
| 288 | + | fcb := func(arg0 uintptr) bool { | |
| 289 | + | cbFn := *FunctionVar | |
| 290 | + | return cbFn(arg0) | |
| 291 | + | } | |
| 292 | + | FunctionVarRef = purego.NewCallback(fcb) | |
| 293 | + | SaveCallback(FunctionVarPtr, FunctionVarRef) | |
| 294 | + | } | |
| 295 | + | } | |
| 296 | + | ||
| 297 | + | xMainContextInvoke(x.GoPointer(), FunctionVarRef, DataVar) | |
| 283 | 298 | ||
| 284 | 299 | } | |
| 285 | 300 | ||
| @@ -297,7 +312,37 @@ var xMainContextInvokeFull func(uintptr, int, uintptr, uintptr, uintptr) | |||
| 297 | 312 | // thread or with any particular context acquired. | |
| 298 | 313 | func (x *MainContext) InvokeFull(PriorityVar int, FunctionVar *SourceFunc, DataVar uintptr, NotifyVar *DestroyNotify) { | |
| 299 | 314 | ||
| 300 | - | xMainContextInvokeFull(x.GoPointer(), PriorityVar, NewCallback(FunctionVar), DataVar, NewCallbackNullable(NotifyVar)) | |
| 315 | + | var FunctionVarRef uintptr | |
| 316 | + | if FunctionVar != nil { | |
| 317 | + | FunctionVarPtr := uintptr(unsafe.Pointer(FunctionVar)) | |
| 318 | + | if cbRefPtr, ok := GetCallback(FunctionVarPtr); ok { | |
| 319 | + | FunctionVarRef = cbRefPtr | |
| 320 | + | } else { | |
| 321 | + | fcb := func(arg0 uintptr) bool { | |
| 322 | + | cbFn := *FunctionVar | |
| 323 | + | return cbFn(arg0) | |
| 324 | + | } | |
| 325 | + | FunctionVarRef = purego.NewCallback(fcb) | |
| 326 | + | SaveCallback(FunctionVarPtr, FunctionVarRef) | |
| 327 | + | } | |
| 328 | + | } | |
| 329 | + | ||
| 330 | + | var NotifyVarRef uintptr | |
| 331 | + | if NotifyVar != nil { | |
| 332 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 333 | + | if cbRefPtr, ok := GetCallback(NotifyVarPtr); ok { | |
| 334 | + | NotifyVarRef = cbRefPtr | |
| 335 | + | } else { | |
| 336 | + | fcb := func(arg0 uintptr) { | |
| 337 | + | cbFn := *NotifyVar | |
| 338 | + | cbFn(arg0) | |
| 339 | + | } | |
| 340 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 341 | + | SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 342 | + | } | |
| 343 | + | } | |
| 344 | + | ||
| 345 | + | xMainContextInvokeFull(x.GoPointer(), PriorityVar, FunctionVarRef, DataVar, NotifyVarRef) | |
| 301 | 346 | ||
| 302 | 347 | } | |
| 303 | 348 | ||
| @@ -530,7 +575,22 @@ var xMainContextSetPollFunc func(uintptr, uintptr) | |||
| 530 | 575 | // loop with an external event loop. | |
| 531 | 576 | func (x *MainContext) SetPollFunc(FuncVar *PollFunc) { | |
| 532 | 577 | ||
| 533 | - | xMainContextSetPollFunc(x.GoPointer(), NewCallback(FuncVar)) | |
| 578 | + | var FuncVarRef uintptr | |
| 579 | + | if FuncVar != nil { | |
| 580 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 581 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 582 | + | FuncVarRef = cbRefPtr | |
| 583 | + | } else { | |
| 584 | + | fcb := func(arg0 *PollFD, arg1 uint, arg2 int) int { | |
| 585 | + | cbFn := *FuncVar | |
| 586 | + | return cbFn(arg0, arg1, arg2) | |
| 587 | + | } | |
| 588 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 589 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 590 | + | } | |
| 591 | + | } | |
| 592 | + | ||
| 593 | + | xMainContextSetPollFunc(x.GoPointer(), FuncVarRef) | |
| 534 | 594 | ||
| 535 | 595 | } | |
| 536 | 596 | ||
| @@ -1196,7 +1256,37 @@ var xSourceSetCallback func(uintptr, uintptr, uintptr, uintptr) | |||
| 1196 | 1256 | // of also unsetting the callback. | |
| 1197 | 1257 | func (x *Source) SetCallback(FuncVar *SourceFunc, DataVar uintptr, NotifyVar *DestroyNotify) { | |
| 1198 | 1258 | ||
| 1199 | - | xSourceSetCallback(x.GoPointer(), NewCallback(FuncVar), DataVar, NewCallbackNullable(NotifyVar)) | |
| 1259 | + | var FuncVarRef uintptr | |
| 1260 | + | if FuncVar != nil { | |
| 1261 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 1262 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 1263 | + | FuncVarRef = cbRefPtr | |
| 1264 | + | } else { | |
| 1265 | + | fcb := func(arg0 uintptr) bool { | |
| 1266 | + | cbFn := *FuncVar | |
| 1267 | + | return cbFn(arg0) | |
| 1268 | + | } | |
| 1269 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 1270 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 1271 | + | } | |
| 1272 | + | } | |
| 1273 | + | ||
| 1274 | + | var NotifyVarRef uintptr | |
| 1275 | + | if NotifyVar != nil { | |
| 1276 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 1277 | + | if cbRefPtr, ok := GetCallback(NotifyVarPtr); ok { | |
| 1278 | + | NotifyVarRef = cbRefPtr | |
| 1279 | + | } else { | |
| 1280 | + | fcb := func(arg0 uintptr) { | |
| 1281 | + | cbFn := *NotifyVar | |
| 1282 | + | cbFn(arg0) | |
| 1283 | + | } | |
| 1284 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 1285 | + | SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 1286 | + | } | |
| 1287 | + | } | |
| 1288 | + | ||
| 1289 | + | xSourceSetCallback(x.GoPointer(), FuncVarRef, DataVar, NotifyVarRef) | |
| 1200 | 1290 | ||
| 1201 | 1291 | } | |
| 1202 | 1292 | ||
| @@ -1257,7 +1347,22 @@ var xSourceSetDisposeFunction func(uintptr, uintptr) | |||
| 1257 | 1347 | // This should only ever be called from [struct@GLib.Source] implementations. | |
| 1258 | 1348 | func (x *Source) SetDisposeFunction(DisposeVar *SourceDisposeFunc) { | |
| 1259 | 1349 | ||
| 1260 | - | xSourceSetDisposeFunction(x.GoPointer(), NewCallback(DisposeVar)) | |
| 1350 | + | var DisposeVarRef uintptr | |
| 1351 | + | if DisposeVar != nil { | |
| 1352 | + | DisposeVarPtr := uintptr(unsafe.Pointer(DisposeVar)) | |
| 1353 | + | if cbRefPtr, ok := GetCallback(DisposeVarPtr); ok { | |
| 1354 | + | DisposeVarRef = cbRefPtr | |
| 1355 | + | } else { | |
| 1356 | + | fcb := func(arg0 *Source) { | |
| 1357 | + | cbFn := *DisposeVar | |
| 1358 | + | cbFn(arg0) | |
| 1359 | + | } | |
| 1360 | + | DisposeVarRef = purego.NewCallback(fcb) | |
| 1361 | + | SaveCallback(DisposeVarPtr, DisposeVarRef) | |
| 1362 | + | } | |
| 1363 | + | } | |
| 1364 | + | ||
| 1365 | + | xSourceSetDisposeFunction(x.GoPointer(), DisposeVarRef) | |
| 1261 | 1366 | ||
| 1262 | 1367 | } | |
| 1263 | 1368 | ||
| @@ -1595,7 +1700,22 @@ var xChildWatchAdd func(Pid, uintptr, uintptr) uint | |||
| 1595 | 1700 | // need greater control. | |
| 1596 | 1701 | func ChildWatchAdd(PidVar Pid, FunctionVar *ChildWatchFunc, DataVar uintptr) uint { | |
| 1597 | 1702 | ||
| 1598 | - | cret := xChildWatchAdd(PidVar, NewCallback(FunctionVar), DataVar) | |
| 1703 | + | var FunctionVarRef uintptr | |
| 1704 | + | if FunctionVar != nil { | |
| 1705 | + | FunctionVarPtr := uintptr(unsafe.Pointer(FunctionVar)) | |
| 1706 | + | if cbRefPtr, ok := GetCallback(FunctionVarPtr); ok { | |
| 1707 | + | FunctionVarRef = cbRefPtr | |
| 1708 | + | } else { | |
| 1709 | + | fcb := func(arg0 Pid, arg1 int, arg2 uintptr) { | |
| 1710 | + | cbFn := *FunctionVar | |
| 1711 | + | cbFn(arg0, arg1, arg2) | |
| 1712 | + | } | |
| 1713 | + | FunctionVarRef = purego.NewCallback(fcb) | |
| 1714 | + | SaveCallback(FunctionVarPtr, FunctionVarRef) | |
| 1715 | + | } | |
| 1716 | + | } | |
| 1717 | + | ||
| 1718 | + | cret := xChildWatchAdd(PidVar, FunctionVarRef, DataVar) | |
| 1599 | 1719 | return cret | |
| 1600 | 1720 | } | |
| 1601 | 1721 | ||
| @@ -1628,7 +1748,37 @@ var xChildWatchAddFull func(int, Pid, uintptr, uintptr, uintptr) uint | |||
| 1628 | 1748 | // need greater control. | |
| 1629 | 1749 | func ChildWatchAddFull(PriorityVar int, PidVar Pid, FunctionVar *ChildWatchFunc, DataVar uintptr, NotifyVar *DestroyNotify) uint { | |
| 1630 | 1750 | ||
| 1631 | - | cret := xChildWatchAddFull(PriorityVar, PidVar, NewCallback(FunctionVar), DataVar, NewCallbackNullable(NotifyVar)) | |
| 1751 | + | var FunctionVarRef uintptr | |
| 1752 | + | if FunctionVar != nil { | |
| 1753 | + | FunctionVarPtr := uintptr(unsafe.Pointer(FunctionVar)) | |
| 1754 | + | if cbRefPtr, ok := GetCallback(FunctionVarPtr); ok { | |
| 1755 | + | FunctionVarRef = cbRefPtr | |
| 1756 | + | } else { | |
| 1757 | + | fcb := func(arg0 Pid, arg1 int, arg2 uintptr) { | |
| 1758 | + | cbFn := *FunctionVar | |
| 1759 | + | cbFn(arg0, arg1, arg2) | |
| 1760 | + | } | |
| 1761 | + | FunctionVarRef = purego.NewCallback(fcb) | |
| 1762 | + | SaveCallback(FunctionVarPtr, FunctionVarRef) | |
| 1763 | + | } | |
| 1764 | + | } | |
| 1765 | + | ||
| 1766 | + | var NotifyVarRef uintptr | |
| 1767 | + | if NotifyVar != nil { | |
| 1768 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 1769 | + | if cbRefPtr, ok := GetCallback(NotifyVarPtr); ok { | |
| 1770 | + | NotifyVarRef = cbRefPtr | |
| 1771 | + | } else { | |
| 1772 | + | fcb := func(arg0 uintptr) { | |
| 1773 | + | cbFn := *NotifyVar | |
| 1774 | + | cbFn(arg0) | |
| 1775 | + | } | |
| 1776 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 1777 | + | SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 1778 | + | } | |
| 1779 | + | } | |
| 1780 | + | ||
| 1781 | + | cret := xChildWatchAddFull(PriorityVar, PidVar, FunctionVarRef, DataVar, NotifyVarRef) | |
| 1632 | 1782 | return cret | |
| 1633 | 1783 | } | |
| 1634 | 1784 | ||
| @@ -1694,7 +1844,22 @@ var xClearHandleId func(uint, uintptr) | |||
| 1694 | 1844 | // pointer casts. | |
| 1695 | 1845 | func ClearHandleId(TagPtrVar uint, ClearFuncVar *ClearHandleFunc) { | |
| 1696 | 1846 | ||
| 1697 | - | xClearHandleId(TagPtrVar, NewCallback(ClearFuncVar)) | |
| 1847 | + | var ClearFuncVarRef uintptr | |
| 1848 | + | if ClearFuncVar != nil { | |
| 1849 | + | ClearFuncVarPtr := uintptr(unsafe.Pointer(ClearFuncVar)) | |
| 1850 | + | if cbRefPtr, ok := GetCallback(ClearFuncVarPtr); ok { | |
| 1851 | + | ClearFuncVarRef = cbRefPtr | |
| 1852 | + | } else { | |
| 1853 | + | fcb := func(arg0 uint) { | |
| 1854 | + | cbFn := *ClearFuncVar | |
| 1855 | + | cbFn(arg0) | |
| 1856 | + | } | |
| 1857 | + | ClearFuncVarRef = purego.NewCallback(fcb) | |
| 1858 | + | SaveCallback(ClearFuncVarPtr, ClearFuncVarRef) | |
| 1859 | + | } | |
| 1860 | + | } | |
| 1861 | + | ||
| 1862 | + | xClearHandleId(TagPtrVar, ClearFuncVarRef) | |
| 1698 | 1863 | ||
| 1699 | 1864 | } | |
| 1700 | 1865 | ||
| @@ -1767,7 +1932,22 @@ var xIdleAdd func(uintptr, uintptr) uint | |||
| 1767 | 1932 | // need greater control or to use a custom main context. | |
| 1768 | 1933 | func IdleAdd(FunctionVar *SourceFunc, DataVar uintptr) uint { | |
| 1769 | 1934 | ||
| 1770 | - | cret := xIdleAdd(NewCallback(FunctionVar), DataVar) | |
| 1935 | + | var FunctionVarRef uintptr | |
| 1936 | + | if FunctionVar != nil { | |
| 1937 | + | FunctionVarPtr := uintptr(unsafe.Pointer(FunctionVar)) | |
| 1938 | + | if cbRefPtr, ok := GetCallback(FunctionVarPtr); ok { | |
| 1939 | + | FunctionVarRef = cbRefPtr | |
| 1940 | + | } else { | |
| 1941 | + | fcb := func(arg0 uintptr) bool { | |
| 1942 | + | cbFn := *FunctionVar | |
| 1943 | + | return cbFn(arg0) | |
| 1944 | + | } | |
| 1945 | + | FunctionVarRef = purego.NewCallback(fcb) | |
| 1946 | + | SaveCallback(FunctionVarPtr, FunctionVarRef) | |
| 1947 | + | } | |
| 1948 | + | } | |
| 1949 | + | ||
| 1950 | + | cret := xIdleAdd(FunctionVarRef, DataVar) | |
| 1771 | 1951 | return cret | |
| 1772 | 1952 | } | |
| 1773 | 1953 | ||
| @@ -1789,7 +1969,37 @@ var xIdleAddFull func(int, uintptr, uintptr, uintptr) uint | |||
| 1789 | 1969 | // need greater control or to use a custom main context. | |
| 1790 | 1970 | func IdleAddFull(PriorityVar int, FunctionVar *SourceFunc, DataVar uintptr, NotifyVar *DestroyNotify) uint { | |
| 1791 | 1971 | ||
| 1792 | - | cret := xIdleAddFull(PriorityVar, NewCallback(FunctionVar), DataVar, NewCallbackNullable(NotifyVar)) | |
| 1972 | + | var FunctionVarRef uintptr | |
| 1973 | + | if FunctionVar != nil { | |
| 1974 | + | FunctionVarPtr := uintptr(unsafe.Pointer(FunctionVar)) | |
| 1975 | + | if cbRefPtr, ok := GetCallback(FunctionVarPtr); ok { | |
| 1976 | + | FunctionVarRef = cbRefPtr | |
| 1977 | + | } else { | |
| 1978 | + | fcb := func(arg0 uintptr) bool { | |
| 1979 | + | cbFn := *FunctionVar | |
| 1980 | + | return cbFn(arg0) | |
| 1981 | + | } | |
| 1982 | + | FunctionVarRef = purego.NewCallback(fcb) | |
| 1983 | + | SaveCallback(FunctionVarPtr, FunctionVarRef) | |
| 1984 | + | } | |
| 1985 | + | } | |
| 1986 | + | ||
| 1987 | + | var NotifyVarRef uintptr | |
| 1988 | + | if NotifyVar != nil { | |
| 1989 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 1990 | + | if cbRefPtr, ok := GetCallback(NotifyVarPtr); ok { | |
| 1991 | + | NotifyVarRef = cbRefPtr | |
| 1992 | + | } else { | |
| 1993 | + | fcb := func(arg0 uintptr) { | |
| 1994 | + | cbFn := *NotifyVar | |
| 1995 | + | cbFn(arg0) | |
| 1996 | + | } | |
| 1997 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 1998 | + | SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 1999 | + | } | |
| 2000 | + | } | |
| 2001 | + | ||
| 2002 | + | cret := xIdleAddFull(PriorityVar, FunctionVarRef, DataVar, NotifyVarRef) | |
| 1793 | 2003 | return cret | |
| 1794 | 2004 | } | |
| 1795 | 2005 | ||
| @@ -1807,7 +2017,22 @@ var xIdleAddOnce func(uintptr, uintptr) uint | |||
| 1807 | 2017 | // This function otherwise behaves like [func@GLib.idle_add]. | |
| 1808 | 2018 | func IdleAddOnce(FunctionVar *SourceOnceFunc, DataVar uintptr) uint { | |
| 1809 | 2019 | ||
| 1810 | - | cret := xIdleAddOnce(NewCallback(FunctionVar), DataVar) | |
| 2020 | + | var FunctionVarRef uintptr | |
| 2021 | + | if FunctionVar != nil { | |
| 2022 | + | FunctionVarPtr := uintptr(unsafe.Pointer(FunctionVar)) | |
| 2023 | + | if cbRefPtr, ok := GetCallback(FunctionVarPtr); ok { | |
| 2024 | + | FunctionVarRef = cbRefPtr | |
| 2025 | + | } else { | |
| 2026 | + | fcb := func(arg0 uintptr) { | |
| 2027 | + | cbFn := *FunctionVar | |
| 2028 | + | cbFn(arg0) | |
| 2029 | + | } | |
| 2030 | + | FunctionVarRef = purego.NewCallback(fcb) | |
| 2031 | + | SaveCallback(FunctionVarPtr, FunctionVarRef) | |
| 2032 | + | } | |
| 2033 | + | } | |
| 2034 | + | ||
| 2035 | + | cret := xIdleAddOnce(FunctionVarRef, DataVar) | |
| 1811 | 2036 | return cret | |
| 1812 | 2037 | } | |
| 1813 | 2038 | ||
| @@ -2130,7 +2355,22 @@ var xTimeoutAdd func(uint, uintptr, uintptr) uint | |||
| 2130 | 2355 | // time. See [func@GLib.get_monotonic_time]. | |
| 2131 | 2356 | func TimeoutAdd(IntervalVar uint, FunctionVar *SourceFunc, DataVar uintptr) uint { | |
| 2132 | 2357 | ||
| 2133 | - | cret := xTimeoutAdd(IntervalVar, NewCallback(FunctionVar), DataVar) | |
| 2358 | + | var FunctionVarRef uintptr | |
| 2359 | + | if FunctionVar != nil { | |
| 2360 | + | FunctionVarPtr := uintptr(unsafe.Pointer(FunctionVar)) | |
| 2361 | + | if cbRefPtr, ok := GetCallback(FunctionVarPtr); ok { | |
| 2362 | + | FunctionVarRef = cbRefPtr | |
| 2363 | + | } else { | |
| 2364 | + | fcb := func(arg0 uintptr) bool { | |
| 2365 | + | cbFn := *FunctionVar | |
| 2366 | + | return cbFn(arg0) | |
| 2367 | + | } | |
| 2368 | + | FunctionVarRef = purego.NewCallback(fcb) | |
| 2369 | + | SaveCallback(FunctionVarPtr, FunctionVarRef) | |
| 2370 | + | } | |
| 2371 | + | } | |
| 2372 | + | ||
| 2373 | + | cret := xTimeoutAdd(IntervalVar, FunctionVarRef, DataVar) | |
| 2134 | 2374 | return cret | |
| 2135 | 2375 | } | |
| 2136 | 2376 | ||
| @@ -2166,7 +2406,37 @@ var xTimeoutAddFull func(int, uint, uintptr, uintptr, uintptr) uint | |||
| 2166 | 2406 | // See [func@GLib.get_monotonic_time]. | |
| 2167 | 2407 | func TimeoutAddFull(PriorityVar int, IntervalVar uint, FunctionVar *SourceFunc, DataVar uintptr, NotifyVar *DestroyNotify) uint { | |
| 2168 | 2408 | ||
| 2169 | - | cret := xTimeoutAddFull(PriorityVar, IntervalVar, NewCallback(FunctionVar), DataVar, NewCallbackNullable(NotifyVar)) | |
| 2409 | + | var FunctionVarRef uintptr | |
| 2410 | + | if FunctionVar != nil { | |
| 2411 | + | FunctionVarPtr := uintptr(unsafe.Pointer(FunctionVar)) | |
| 2412 | + | if cbRefPtr, ok := GetCallback(FunctionVarPtr); ok { | |
| 2413 | + | FunctionVarRef = cbRefPtr | |
| 2414 | + | } else { | |
| 2415 | + | fcb := func(arg0 uintptr) bool { | |
| 2416 | + | cbFn := *FunctionVar | |
| 2417 | + | return cbFn(arg0) | |
| 2418 | + | } | |
| 2419 | + | FunctionVarRef = purego.NewCallback(fcb) | |
| 2420 | + | SaveCallback(FunctionVarPtr, FunctionVarRef) | |
| 2421 | + | } | |
| 2422 | + | } | |
| 2423 | + | ||
| 2424 | + | var NotifyVarRef uintptr | |
| 2425 | + | if NotifyVar != nil { | |
| 2426 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 2427 | + | if cbRefPtr, ok := GetCallback(NotifyVarPtr); ok { | |
| 2428 | + | NotifyVarRef = cbRefPtr | |
| 2429 | + | } else { | |
| 2430 | + | fcb := func(arg0 uintptr) { | |
| 2431 | + | cbFn := *NotifyVar | |
| 2432 | + | cbFn(arg0) | |
| 2433 | + | } | |
| 2434 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 2435 | + | SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 2436 | + | } | |
| 2437 | + | } | |
| 2438 | + | ||
| 2439 | + | cret := xTimeoutAddFull(PriorityVar, IntervalVar, FunctionVarRef, DataVar, NotifyVarRef) | |
| 2170 | 2440 | return cret | |
| 2171 | 2441 | } | |
| 2172 | 2442 | ||
| @@ -2181,7 +2451,22 @@ var xTimeoutAddOnce func(uint, uintptr, uintptr) uint | |||
| 2181 | 2451 | // This function otherwise behaves like [func@GLib.timeout_add]. | |
| 2182 | 2452 | func TimeoutAddOnce(IntervalVar uint, FunctionVar *SourceOnceFunc, DataVar uintptr) uint { | |
| 2183 | 2453 | ||
| 2184 | - | cret := xTimeoutAddOnce(IntervalVar, NewCallback(FunctionVar), DataVar) | |
| 2454 | + | var FunctionVarRef uintptr | |
| 2455 | + | if FunctionVar != nil { | |
| 2456 | + | FunctionVarPtr := uintptr(unsafe.Pointer(FunctionVar)) | |
| 2457 | + | if cbRefPtr, ok := GetCallback(FunctionVarPtr); ok { | |
| 2458 | + | FunctionVarRef = cbRefPtr | |
| 2459 | + | } else { | |
| 2460 | + | fcb := func(arg0 uintptr) { | |
| 2461 | + | cbFn := *FunctionVar | |
| 2462 | + | cbFn(arg0) | |
| 2463 | + | } | |
| 2464 | + | FunctionVarRef = purego.NewCallback(fcb) | |
| 2465 | + | SaveCallback(FunctionVarPtr, FunctionVarRef) | |
| 2466 | + | } | |
| 2467 | + | } | |
| 2468 | + | ||
| 2469 | + | cret := xTimeoutAddOnce(IntervalVar, FunctionVarRef, DataVar) | |
| 2185 | 2470 | return cret | |
| 2186 | 2471 | } | |
| 2187 | 2472 | ||
| @@ -2212,7 +2497,22 @@ var xTimeoutAddSeconds func(uint, uintptr, uintptr) uint | |||
| 2212 | 2497 | // time. See [func@GLib.get_monotonic_time]. | |
| 2213 | 2498 | func TimeoutAddSeconds(IntervalVar uint, FunctionVar *SourceFunc, DataVar uintptr) uint { | |
| 2214 | 2499 | ||
| 2215 | - | cret := xTimeoutAddSeconds(IntervalVar, NewCallback(FunctionVar), DataVar) | |
| 2500 | + | var FunctionVarRef uintptr | |
| 2501 | + | if FunctionVar != nil { | |
| 2502 | + | FunctionVarPtr := uintptr(unsafe.Pointer(FunctionVar)) | |
| 2503 | + | if cbRefPtr, ok := GetCallback(FunctionVarPtr); ok { | |
| 2504 | + | FunctionVarRef = cbRefPtr | |
| 2505 | + | } else { | |
| 2506 | + | fcb := func(arg0 uintptr) bool { | |
| 2507 | + | cbFn := *FunctionVar | |
| 2508 | + | return cbFn(arg0) | |
| 2509 | + | } | |
| 2510 | + | FunctionVarRef = purego.NewCallback(fcb) | |
| 2511 | + | SaveCallback(FunctionVarPtr, FunctionVarRef) | |
| 2512 | + | } | |
| 2513 | + | } | |
| 2514 | + | ||
| 2515 | + | cret := xTimeoutAddSeconds(IntervalVar, FunctionVarRef, DataVar) | |
| 2216 | 2516 | return cret | |
| 2217 | 2517 | } | |
| 2218 | 2518 | ||
| @@ -2260,7 +2560,37 @@ var xTimeoutAddSecondsFull func(int, uint, uintptr, uintptr, uintptr) uint | |||
| 2260 | 2560 | // time. See [func@GLib.get_monotonic_time]. | |
| 2261 | 2561 | func TimeoutAddSecondsFull(PriorityVar int, IntervalVar uint, FunctionVar *SourceFunc, DataVar uintptr, NotifyVar *DestroyNotify) uint { | |
| 2262 | 2562 | ||
| 2263 | - | cret := xTimeoutAddSecondsFull(PriorityVar, IntervalVar, NewCallback(FunctionVar), DataVar, NewCallbackNullable(NotifyVar)) | |
| 2563 | + | var FunctionVarRef uintptr | |
| 2564 | + | if FunctionVar != nil { | |
| 2565 | + | FunctionVarPtr := uintptr(unsafe.Pointer(FunctionVar)) | |
| 2566 | + | if cbRefPtr, ok := GetCallback(FunctionVarPtr); ok { | |
| 2567 | + | FunctionVarRef = cbRefPtr | |
| 2568 | + | } else { | |
| 2569 | + | fcb := func(arg0 uintptr) bool { | |
| 2570 | + | cbFn := *FunctionVar | |
| 2571 | + | return cbFn(arg0) | |
| 2572 | + | } | |
| 2573 | + | FunctionVarRef = purego.NewCallback(fcb) | |
| 2574 | + | SaveCallback(FunctionVarPtr, FunctionVarRef) | |
| 2575 | + | } | |
| 2576 | + | } | |
| 2577 | + | ||
| 2578 | + | var NotifyVarRef uintptr | |
| 2579 | + | if NotifyVar != nil { | |
| 2580 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 2581 | + | if cbRefPtr, ok := GetCallback(NotifyVarPtr); ok { | |
| 2582 | + | NotifyVarRef = cbRefPtr | |
| 2583 | + | } else { | |
| 2584 | + | fcb := func(arg0 uintptr) { | |
| 2585 | + | cbFn := *NotifyVar | |
| 2586 | + | cbFn(arg0) | |
| 2587 | + | } | |
| 2588 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 2589 | + | SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 2590 | + | } | |
| 2591 | + | } | |
| 2592 | + | ||
| 2593 | + | cret := xTimeoutAddSecondsFull(PriorityVar, IntervalVar, FunctionVarRef, DataVar, NotifyVarRef) | |
| 2264 | 2594 | return cret | |
| 2265 | 2595 | } | |
| 2266 | 2596 | ||
| @@ -2270,7 +2600,22 @@ var xTimeoutAddSecondsOnce func(uint, uintptr, uintptr) uint | |||
| 2270 | 2600 | // seconds. | |
| 2271 | 2601 | func TimeoutAddSecondsOnce(IntervalVar uint, FunctionVar *SourceOnceFunc, DataVar uintptr) uint { | |
| 2272 | 2602 | ||
| 2273 | - | cret := xTimeoutAddSecondsOnce(IntervalVar, NewCallback(FunctionVar), DataVar) | |
| 2603 | + | var FunctionVarRef uintptr | |
| 2604 | + | if FunctionVar != nil { | |
| 2605 | + | FunctionVarPtr := uintptr(unsafe.Pointer(FunctionVar)) | |
| 2606 | + | if cbRefPtr, ok := GetCallback(FunctionVarPtr); ok { | |
| 2607 | + | FunctionVarRef = cbRefPtr | |
| 2608 | + | } else { | |
| 2609 | + | fcb := func(arg0 uintptr) { | |
| 2610 | + | cbFn := *FunctionVar | |
| 2611 | + | cbFn(arg0) | |
| 2612 | + | } | |
| 2613 | + | FunctionVarRef = purego.NewCallback(fcb) | |
| 2614 | + | SaveCallback(FunctionVarPtr, FunctionVarRef) | |
| 2615 | + | } | |
| 2616 | + | } | |
| 2617 | + | ||
| 2618 | + | cret := xTimeoutAddSecondsOnce(IntervalVar, FunctionVarRef, DataVar) | |
| 2274 | 2619 | return cret | |
| 2275 | 2620 | } | |
| 2276 | 2621 | ||
M v4/glib/gmarkup.go +16 -1
| @@ -38,7 +38,22 @@ var xNewMarkupParseContext func(*MarkupParser, MarkupParseFlags, uintptr, uintpt | |||
| 38 | 38 | // free it and create a new parse context). | |
| 39 | 39 | func NewMarkupParseContext(ParserVar *MarkupParser, FlagsVar MarkupParseFlags, UserDataVar uintptr, UserDataDnotifyVar *DestroyNotify) *MarkupParseContext { | |
| 40 | 40 | ||
| 41 | - | cret := xNewMarkupParseContext(ParserVar, FlagsVar, UserDataVar, NewCallback(UserDataDnotifyVar)) | |
| 41 | + | var UserDataDnotifyVarRef uintptr | |
| 42 | + | if UserDataDnotifyVar != nil { | |
| 43 | + | UserDataDnotifyVarPtr := uintptr(unsafe.Pointer(UserDataDnotifyVar)) | |
| 44 | + | if cbRefPtr, ok := GetCallback(UserDataDnotifyVarPtr); ok { | |
| 45 | + | UserDataDnotifyVarRef = cbRefPtr | |
| 46 | + | } else { | |
| 47 | + | fcb := func(arg0 uintptr) { | |
| 48 | + | cbFn := *UserDataDnotifyVar | |
| 49 | + | cbFn(arg0) | |
| 50 | + | } | |
| 51 | + | UserDataDnotifyVarRef = purego.NewCallback(fcb) | |
| 52 | + | SaveCallback(UserDataDnotifyVarPtr, UserDataDnotifyVarRef) | |
| 53 | + | } | |
| 54 | + | } | |
| 55 | + | ||
| 56 | + | cret := xNewMarkupParseContext(ParserVar, FlagsVar, UserDataVar, UserDataDnotifyVarRef) | |
| 42 | 57 | return cret | |
| 43 | 58 | } | |
| 44 | 59 | ||
M v4/glib/gmem.go +16 -1
| @@ -279,7 +279,22 @@ var xClearPointer func(uintptr, uintptr) | |||
| 279 | 279 | // ``` | |
| 280 | 280 | func ClearPointer(PpVar uintptr, DestroyVar *DestroyNotify) { | |
| 281 | 281 | ||
| 282 | - | xClearPointer(PpVar, NewCallback(DestroyVar)) | |
| 282 | + | var DestroyVarRef uintptr | |
| 283 | + | if DestroyVar != nil { | |
| 284 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 285 | + | if cbRefPtr, ok := GetCallback(DestroyVarPtr); ok { | |
| 286 | + | DestroyVarRef = cbRefPtr | |
| 287 | + | } else { | |
| 288 | + | fcb := func(arg0 uintptr) { | |
| 289 | + | cbFn := *DestroyVar | |
| 290 | + | cbFn(arg0) | |
| 291 | + | } | |
| 292 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 293 | + | SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 294 | + | } | |
| 295 | + | } | |
| 296 | + | ||
| 297 | + | xClearPointer(PpVar, DestroyVarRef) | |
| 283 | 298 | ||
| 284 | 299 | } | |
| 285 | 300 | ||
M v4/glib/gmessages.go +154 -34
| @@ -159,7 +159,7 @@ func AssertWarning(LogDomainVar string, FileVar string, LineVar int, PrettyFunct | |||
| 159 | 159 | ||
| 160 | 160 | } | |
| 161 | 161 | ||
| 162 | - | var xLog func(string, LogLevelFlags, string, ...interface{}) | |
| 162 | + | var xLog func(uintptr, LogLevelFlags, string, ...interface{}) | |
| 163 | 163 | ||
| 164 | 164 | // Logs an error or debugging message. | |
| 165 | 165 | // | |
| @@ -173,13 +173,13 @@ var xLog func(string, LogLevelFlags, string, ...interface{}) | |||
| 173 | 173 | // | |
| 174 | 174 | // If [structured logging is enabled](logging.html#using-structured-logging) this will | |
| 175 | 175 | // output via the structured log writer function (see [func@GLib.log_set_writer_func]). | |
| 176 | - | func Log(LogDomainVar string, LogLevelVar LogLevelFlags, FormatVar string, varArgs ...interface{}) { | |
| 176 | + | func Log(LogDomainVar *string, LogLevelVar LogLevelFlags, FormatVar string, varArgs ...interface{}) { | |
| 177 | 177 | ||
| 178 | - | xLog(LogDomainVar, LogLevelVar, FormatVar, varArgs...) | |
| 178 | + | xLog(core.NullableStringToPtr(LogDomainVar), LogLevelVar, FormatVar, varArgs...) | |
| 179 | 179 | ||
| 180 | 180 | } | |
| 181 | 181 | ||
| 182 | - | var xLogDefaultHandler func(string, LogLevelFlags, string, uintptr) | |
| 182 | + | var xLogDefaultHandler func(uintptr, LogLevelFlags, uintptr, uintptr) | |
| 183 | 183 | ||
| 184 | 184 | // The default log handler set up by GLib; [func@GLib.log_set_default_handler] | |
| 185 | 185 | // allows to install an alternate default log handler. | |
| @@ -212,9 +212,9 @@ var xLogDefaultHandler func(string, LogLevelFlags, string, uintptr) | |||
| 212 | 212 | // | |
| 213 | 213 | // This has no effect if structured logging is enabled; see | |
| 214 | 214 | // [Using Structured Logging](logging.html#using-structured-logging). | |
| 215 | - | func LogDefaultHandler(LogDomainVar string, LogLevelVar LogLevelFlags, MessageVar string, UnusedDataVar uintptr) { | |
| 215 | + | func LogDefaultHandler(LogDomainVar *string, LogLevelVar LogLevelFlags, MessageVar *string, UnusedDataVar uintptr) { | |
| 216 | 216 | ||
| 217 | - | xLogDefaultHandler(LogDomainVar, LogLevelVar, MessageVar, UnusedDataVar) | |
| 217 | + | xLogDefaultHandler(core.NullableStringToPtr(LogDomainVar), LogLevelVar, core.NullableStringToPtr(MessageVar), UnusedDataVar) | |
| 218 | 218 | ||
| 219 | 219 | } | |
| 220 | 220 | ||
| @@ -339,7 +339,22 @@ var xLogSetDefaultHandler func(uintptr, uintptr) uintptr | |||
| 339 | 339 | // [Using Structured Logging](logging.html#using-structured-logging). | |
| 340 | 340 | func LogSetDefaultHandler(LogFuncVar *LogFunc, UserDataVar uintptr) uintptr { | |
| 341 | 341 | ||
| 342 | - | cret := xLogSetDefaultHandler(NewCallback(LogFuncVar), UserDataVar) | |
| 342 | + | var LogFuncVarRef uintptr | |
| 343 | + | if LogFuncVar != nil { | |
| 344 | + | LogFuncVarPtr := uintptr(unsafe.Pointer(LogFuncVar)) | |
| 345 | + | if cbRefPtr, ok := GetCallback(LogFuncVarPtr); ok { | |
| 346 | + | LogFuncVarRef = cbRefPtr | |
| 347 | + | } else { | |
| 348 | + | fcb := func(arg0 string, arg1 LogLevelFlags, arg2 string, arg3 uintptr) { | |
| 349 | + | cbFn := *LogFuncVar | |
| 350 | + | cbFn(arg0, arg1, arg2, arg3) | |
| 351 | + | } | |
| 352 | + | LogFuncVarRef = purego.NewCallback(fcb) | |
| 353 | + | SaveCallback(LogFuncVarPtr, LogFuncVarRef) | |
| 354 | + | } | |
| 355 | + | } | |
| 356 | + | ||
| 357 | + | cret := xLogSetDefaultHandler(LogFuncVarRef, UserDataVar) | |
| 343 | 358 | return cret | |
| 344 | 359 | } | |
| 345 | 360 | ||
| @@ -365,7 +380,7 @@ func LogSetFatalMask(LogDomainVar string, FatalMaskVar LogLevelFlags) LogLevelFl | |||
| 365 | 380 | return cret | |
| 366 | 381 | } | |
| 367 | 382 | ||
| 368 | - | var xLogSetHandler func(string, LogLevelFlags, uintptr, uintptr) uint | |
| 383 | + | var xLogSetHandler func(uintptr, LogLevelFlags, uintptr, uintptr) uint | |
| 369 | 384 | ||
| 370 | 385 | // Sets the log handler for a domain and a set of log levels. | |
| 371 | 386 | // | |
| @@ -410,13 +425,28 @@ var xLogSetHandler func(string, LogLevelFlags, uintptr, uintptr) uint | |||
| 410 | 425 | // | G_LOG_FLAG_RECURSION, my_log_handler, NULL); | |
| 411 | 426 | // | |
| 412 | 427 | // ``` | |
| 413 | - | func LogSetHandler(LogDomainVar string, LogLevelsVar LogLevelFlags, LogFuncVar *LogFunc, UserDataVar uintptr) uint { | |
| 428 | + | func LogSetHandler(LogDomainVar *string, LogLevelsVar LogLevelFlags, LogFuncVar *LogFunc, UserDataVar uintptr) uint { | |
| 429 | + | ||
| 430 | + | var LogFuncVarRef uintptr | |
| 431 | + | if LogFuncVar != nil { | |
| 432 | + | LogFuncVarPtr := uintptr(unsafe.Pointer(LogFuncVar)) | |
| 433 | + | if cbRefPtr, ok := GetCallback(LogFuncVarPtr); ok { | |
| 434 | + | LogFuncVarRef = cbRefPtr | |
| 435 | + | } else { | |
| 436 | + | fcb := func(arg0 string, arg1 LogLevelFlags, arg2 string, arg3 uintptr) { | |
| 437 | + | cbFn := *LogFuncVar | |
| 438 | + | cbFn(arg0, arg1, arg2, arg3) | |
| 439 | + | } | |
| 440 | + | LogFuncVarRef = purego.NewCallback(fcb) | |
| 441 | + | SaveCallback(LogFuncVarPtr, LogFuncVarRef) | |
| 442 | + | } | |
| 443 | + | } | |
| 414 | 444 | ||
| 415 | - | cret := xLogSetHandler(LogDomainVar, LogLevelsVar, NewCallback(LogFuncVar), UserDataVar) | |
| 445 | + | cret := xLogSetHandler(core.NullableStringToPtr(LogDomainVar), LogLevelsVar, LogFuncVarRef, UserDataVar) | |
| 416 | 446 | return cret | |
| 417 | 447 | } | |
| 418 | 448 | ||
| 419 | - | var xLogSetHandlerFull func(string, LogLevelFlags, uintptr, uintptr, uintptr) uint | |
| 449 | + | var xLogSetHandlerFull func(uintptr, LogLevelFlags, uintptr, uintptr, uintptr) uint | |
| 420 | 450 | ||
| 421 | 451 | // Like [func@GLib.log_set_handler], but takes a destroy notify for the @user_data. | |
| 422 | 452 | // | |
| @@ -425,9 +455,39 @@ var xLogSetHandlerFull func(string, LogLevelFlags, uintptr, uintptr, uintptr) ui | |||
| 425 | 455 | // | |
| 426 | 456 | // The `log_domain` parameter can be set to `NULL` or an empty string to use the default | |
| 427 | 457 | // application domain. | |
| 428 | - | func LogSetHandlerFull(LogDomainVar string, LogLevelsVar LogLevelFlags, LogFuncVar *LogFunc, UserDataVar uintptr, DestroyVar *DestroyNotify) uint { | |
| 458 | + | func LogSetHandlerFull(LogDomainVar *string, LogLevelsVar LogLevelFlags, LogFuncVar *LogFunc, UserDataVar uintptr, DestroyVar *DestroyNotify) uint { | |
| 459 | + | ||
| 460 | + | var LogFuncVarRef uintptr | |
| 461 | + | if LogFuncVar != nil { | |
| 462 | + | LogFuncVarPtr := uintptr(unsafe.Pointer(LogFuncVar)) | |
| 463 | + | if cbRefPtr, ok := GetCallback(LogFuncVarPtr); ok { | |
| 464 | + | LogFuncVarRef = cbRefPtr | |
| 465 | + | } else { | |
| 466 | + | fcb := func(arg0 string, arg1 LogLevelFlags, arg2 string, arg3 uintptr) { | |
| 467 | + | cbFn := *LogFuncVar | |
| 468 | + | cbFn(arg0, arg1, arg2, arg3) | |
| 469 | + | } | |
| 470 | + | LogFuncVarRef = purego.NewCallback(fcb) | |
| 471 | + | SaveCallback(LogFuncVarPtr, LogFuncVarRef) | |
| 472 | + | } | |
| 473 | + | } | |
| 429 | 474 | ||
| 430 | - | cret := xLogSetHandlerFull(LogDomainVar, LogLevelsVar, NewCallback(LogFuncVar), UserDataVar, NewCallback(DestroyVar)) | |
| 475 | + | var DestroyVarRef uintptr | |
| 476 | + | if DestroyVar != nil { | |
| 477 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 478 | + | if cbRefPtr, ok := GetCallback(DestroyVarPtr); ok { | |
| 479 | + | DestroyVarRef = cbRefPtr | |
| 480 | + | } else { | |
| 481 | + | fcb := func(arg0 uintptr) { | |
| 482 | + | cbFn := *DestroyVar | |
| 483 | + | cbFn(arg0) | |
| 484 | + | } | |
| 485 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 486 | + | SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 487 | + | } | |
| 488 | + | } | |
| 489 | + | ||
| 490 | + | cret := xLogSetHandlerFull(core.NullableStringToPtr(LogDomainVar), LogLevelsVar, LogFuncVarRef, UserDataVar, DestroyVarRef) | |
| 431 | 491 | return cret | |
| 432 | 492 | } | |
| 433 | 493 | ||
| @@ -446,7 +506,37 @@ var xLogSetWriterFunc func(uintptr, uintptr, uintptr) | |||
| 446 | 506 | // There can only be one writer function. It is an error to set more than one. | |
| 447 | 507 | func LogSetWriterFunc(FuncVar *LogWriterFunc, UserDataVar uintptr, UserDataFreeVar *DestroyNotify) { | |
| 448 | 508 | ||
| 449 | - | xLogSetWriterFunc(NewCallback(FuncVar), UserDataVar, NewCallback(UserDataFreeVar)) | |
| 509 | + | var FuncVarRef uintptr | |
| 510 | + | if FuncVar != nil { | |
| 511 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 512 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 513 | + | FuncVarRef = cbRefPtr | |
| 514 | + | } else { | |
| 515 | + | fcb := func(arg0 LogLevelFlags, arg1 []LogField, arg2 uint, arg3 uintptr) LogWriterOutput { | |
| 516 | + | cbFn := *FuncVar | |
| 517 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 518 | + | } | |
| 519 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 520 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 521 | + | } | |
| 522 | + | } | |
| 523 | + | ||
| 524 | + | var UserDataFreeVarRef uintptr | |
| 525 | + | if UserDataFreeVar != nil { | |
| 526 | + | UserDataFreeVarPtr := uintptr(unsafe.Pointer(UserDataFreeVar)) | |
| 527 | + | if cbRefPtr, ok := GetCallback(UserDataFreeVarPtr); ok { | |
| 528 | + | UserDataFreeVarRef = cbRefPtr | |
| 529 | + | } else { | |
| 530 | + | fcb := func(arg0 uintptr) { | |
| 531 | + | cbFn := *UserDataFreeVar | |
| 532 | + | cbFn(arg0) | |
| 533 | + | } | |
| 534 | + | UserDataFreeVarRef = purego.NewCallback(fcb) | |
| 535 | + | SaveCallback(UserDataFreeVarPtr, UserDataFreeVarRef) | |
| 536 | + | } | |
| 537 | + | } | |
| 538 | + | ||
| 539 | + | xLogSetWriterFunc(FuncVarRef, UserDataVar, UserDataFreeVarRef) | |
| 450 | 540 | ||
| 451 | 541 | } | |
| 452 | 542 | ||
| @@ -578,7 +668,7 @@ func LogStructuredStandard(LogDomainVar string, LogLevelVar LogLevelFlags, FileV | |||
| 578 | 668 | ||
| 579 | 669 | } | |
| 580 | 670 | ||
| 581 | - | var xLogVariant func(string, LogLevelFlags, *Variant) | |
| 671 | + | var xLogVariant func(uintptr, LogLevelFlags, *Variant) | |
| 582 | 672 | ||
| 583 | 673 | // Log a message with structured data, accepting the data within a [type@GLib.Variant]. | |
| 584 | 674 | // | |
| @@ -595,9 +685,9 @@ var xLogVariant func(string, LogLevelFlags, *Variant) | |||
| 595 | 685 | // [method@GLib.Variant.print] will be used to convert the value into a string. | |
| 596 | 686 | // | |
| 597 | 687 | // For more details on its usage and about the parameters, see [func@GLib.log_structured]. | |
| 598 | - | func LogVariant(LogDomainVar string, LogLevelVar LogLevelFlags, FieldsVar *Variant) { | |
| 688 | + | func LogVariant(LogDomainVar *string, LogLevelVar LogLevelFlags, FieldsVar *Variant) { | |
| 599 | 689 | ||
| 600 | - | xLogVariant(LogDomainVar, LogLevelVar, FieldsVar) | |
| 690 | + | xLogVariant(core.NullableStringToPtr(LogDomainVar), LogLevelVar, FieldsVar) | |
| 601 | 691 | ||
| 602 | 692 | } | |
| 603 | 693 | ||
| @@ -631,15 +721,15 @@ func LogWriterDefault(LogLevelVar LogLevelFlags, FieldsVar []LogField, NFieldsVa | |||
| 631 | 721 | return cret | |
| 632 | 722 | } | |
| 633 | 723 | ||
| 634 | - | var xLogWriterDefaultSetDebugDomains func(string) | |
| 724 | + | var xLogWriterDefaultSetDebugDomains func(uintptr) | |
| 635 | 725 | ||
| 636 | 726 | // Reset the list of domains to be logged, that might be initially set by the | |
| 637 | 727 | // `G_MESSAGES_DEBUG` or `DEBUG_INVOCATION` environment variables. | |
| 638 | 728 | // | |
| 639 | 729 | // This function is thread-safe. | |
| 640 | - | func LogWriterDefaultSetDebugDomains(DomainsVar string) { | |
| 730 | + | func LogWriterDefaultSetDebugDomains(DomainsVar *string) { | |
| 641 | 731 | ||
| 642 | - | xLogWriterDefaultSetDebugDomains(DomainsVar) | |
| 732 | + | xLogWriterDefaultSetDebugDomains(core.NullableStringToPtr(DomainsVar)) | |
| 643 | 733 | ||
| 644 | 734 | } | |
| 645 | 735 | ||
| @@ -666,7 +756,7 @@ func LogWriterDefaultSetUseStderr(UseStderrVar bool) { | |||
| 666 | 756 | ||
| 667 | 757 | } | |
| 668 | 758 | ||
| 669 | - | var xLogWriterDefaultWouldDrop func(LogLevelFlags, string) bool | |
| 759 | + | var xLogWriterDefaultWouldDrop func(LogLevelFlags, uintptr) bool | |
| 670 | 760 | ||
| 671 | 761 | // Check whether [func@GLib.log_writer_default] and [func@GLib.log_default_handler] would | |
| 672 | 762 | // ignore a message with the given domain and level. | |
| @@ -699,9 +789,9 @@ var xLogWriterDefaultWouldDrop func(LogLevelFlags, string) bool | |||
| 699 | 789 | // } | |
| 700 | 790 | // | |
| 701 | 791 | // ``` | |
| 702 | - | func LogWriterDefaultWouldDrop(LogLevelVar LogLevelFlags, LogDomainVar string) bool { | |
| 792 | + | func LogWriterDefaultWouldDrop(LogLevelVar LogLevelFlags, LogDomainVar *string) bool { | |
| 703 | 793 | ||
| 704 | - | cret := xLogWriterDefaultWouldDrop(LogLevelVar, LogDomainVar) | |
| 794 | + | cret := xLogWriterDefaultWouldDrop(LogLevelVar, core.NullableStringToPtr(LogDomainVar)) | |
| 705 | 795 | return cret | |
| 706 | 796 | } | |
| 707 | 797 | ||
| @@ -817,7 +907,7 @@ func LogWriterSyslog(LogLevelVar LogLevelFlags, FieldsVar []LogField, NFieldsVar | |||
| 817 | 907 | return cret | |
| 818 | 908 | } | |
| 819 | 909 | ||
| 820 | - | var xLogv func(string, LogLevelFlags, string, []interface{}) | |
| 910 | + | var xLogv func(uintptr, LogLevelFlags, string, []interface{}) | |
| 821 | 911 | ||
| 822 | 912 | // Logs an error or debugging message. | |
| 823 | 913 | // | |
| @@ -834,9 +924,9 @@ var xLogv func(string, LogLevelFlags, string, []interface{}) | |||
| 834 | 924 | // | |
| 835 | 925 | // The `log_domain` parameter can be set to `NULL` or an empty string to use the default | |
| 836 | 926 | // application domain. | |
| 837 | - | func Logv(LogDomainVar string, LogLevelVar LogLevelFlags, FormatVar string, ArgsVar []interface{}) { | |
| 927 | + | func Logv(LogDomainVar *string, LogLevelVar LogLevelFlags, FormatVar string, ArgsVar []interface{}) { | |
| 838 | 928 | ||
| 839 | - | xLogv(LogDomainVar, LogLevelVar, FormatVar, ArgsVar) | |
| 929 | + | xLogv(core.NullableStringToPtr(LogDomainVar), LogLevelVar, FormatVar, ArgsVar) | |
| 840 | 930 | ||
| 841 | 931 | } | |
| 842 | 932 | ||
| @@ -894,13 +984,13 @@ func PrintfStringUpperBound(FormatVar string, ArgsVar []interface{}) uint { | |||
| 894 | 984 | return cret | |
| 895 | 985 | } | |
| 896 | 986 | ||
| 897 | - | var xReturnIfFailWarning func(string, string, string) | |
| 987 | + | var xReturnIfFailWarning func(uintptr, string, uintptr) | |
| 898 | 988 | ||
| 899 | 989 | // Internal function used to print messages from the public [func@GLib.return_if_fail] | |
| 900 | 990 | // and [func@GLib.return_val_if_fail] macros. | |
| 901 | - | func ReturnIfFailWarning(LogDomainVar string, PrettyFunctionVar string, ExpressionVar string) { | |
| 991 | + | func ReturnIfFailWarning(LogDomainVar *string, PrettyFunctionVar string, ExpressionVar *string) { | |
| 902 | 992 | ||
| 903 | - | xReturnIfFailWarning(LogDomainVar, PrettyFunctionVar, ExpressionVar) | |
| 993 | + | xReturnIfFailWarning(core.NullableStringToPtr(LogDomainVar), PrettyFunctionVar, core.NullableStringToPtr(ExpressionVar)) | |
| 904 | 994 | ||
| 905 | 995 | } | |
| 906 | 996 | ||
| @@ -923,7 +1013,22 @@ var xSetPrintHandler func(uintptr) uintptr | |||
| 923 | 1013 | // in all platforms. Before GLib 2.76, this was `NULL`. | |
| 924 | 1014 | func SetPrintHandler(FuncVar *PrintFunc) uintptr { | |
| 925 | 1015 | ||
| 926 | - | cret := xSetPrintHandler(NewCallbackNullable(FuncVar)) | |
| 1016 | + | var FuncVarRef uintptr | |
| 1017 | + | if FuncVar != nil { | |
| 1018 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 1019 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 1020 | + | FuncVarRef = cbRefPtr | |
| 1021 | + | } else { | |
| 1022 | + | fcb := func(arg0 string) { | |
| 1023 | + | cbFn := *FuncVar | |
| 1024 | + | cbFn(arg0) | |
| 1025 | + | } | |
| 1026 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 1027 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 1028 | + | } | |
| 1029 | + | } | |
| 1030 | + | ||
| 1031 | + | cret := xSetPrintHandler(FuncVarRef) | |
| 927 | 1032 | return cret | |
| 928 | 1033 | } | |
| 929 | 1034 | ||
| @@ -946,17 +1051,32 @@ var xSetPrinterrHandler func(uintptr) uintptr | |||
| 946 | 1051 | // Before GLib 2.76, this was `NULL`. | |
| 947 | 1052 | func SetPrinterrHandler(FuncVar *PrintFunc) uintptr { | |
| 948 | 1053 | ||
| 949 | - | cret := xSetPrinterrHandler(NewCallbackNullable(FuncVar)) | |
| 1054 | + | var FuncVarRef uintptr | |
| 1055 | + | if FuncVar != nil { | |
| 1056 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 1057 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 1058 | + | FuncVarRef = cbRefPtr | |
| 1059 | + | } else { | |
| 1060 | + | fcb := func(arg0 string) { | |
| 1061 | + | cbFn := *FuncVar | |
| 1062 | + | cbFn(arg0) | |
| 1063 | + | } | |
| 1064 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 1065 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 1066 | + | } | |
| 1067 | + | } | |
| 1068 | + | ||
| 1069 | + | cret := xSetPrinterrHandler(FuncVarRef) | |
| 950 | 1070 | return cret | |
| 951 | 1071 | } | |
| 952 | 1072 | ||
| 953 | - | var xWarnMessage func(string, string, int, string, string) | |
| 1073 | + | var xWarnMessage func(uintptr, string, int, string, uintptr) | |
| 954 | 1074 | ||
| 955 | 1075 | // Internal function used to print messages from the public [func@GLib.warn_if_reached] | |
| 956 | 1076 | // and [func@GLib.warn_if_fail] macros. | |
| 957 | - | func WarnMessage(DomainVar string, FileVar string, LineVar int, FuncVar string, WarnexprVar string) { | |
| 1077 | + | func WarnMessage(DomainVar *string, FileVar string, LineVar int, FuncVar string, WarnexprVar *string) { | |
| 958 | 1078 | ||
| 959 | - | xWarnMessage(DomainVar, FileVar, LineVar, FuncVar, WarnexprVar) | |
| 1079 | + | xWarnMessage(core.NullableStringToPtr(DomainVar), FileVar, LineVar, FuncVar, core.NullableStringToPtr(WarnexprVar)) | |
| 960 | 1080 | ||
| 961 | 1081 | } | |
| 962 | 1082 | ||
M v4/glib/gnode.go +48 -3
| @@ -67,7 +67,22 @@ var xNodeChildrenForeach func(uintptr, TraverseFlags, uintptr, uintptr) | |||
| 67 | 67 | // that would modify the structure of the tree. | |
| 68 | 68 | func (x *Node) ChildrenForeach(FlagsVar TraverseFlags, FuncVar *NodeForeachFunc, DataVar uintptr) { | |
| 69 | 69 | ||
| 70 | - | xNodeChildrenForeach(x.GoPointer(), FlagsVar, NewCallback(FuncVar), DataVar) | |
| 70 | + | var FuncVarRef uintptr | |
| 71 | + | if FuncVar != nil { | |
| 72 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 73 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 74 | + | FuncVarRef = cbRefPtr | |
| 75 | + | } else { | |
| 76 | + | fcb := func(arg0 *Node, arg1 uintptr) { | |
| 77 | + | cbFn := *FuncVar | |
| 78 | + | cbFn(arg0, arg1) | |
| 79 | + | } | |
| 80 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 81 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 82 | + | } | |
| 83 | + | } | |
| 84 | + | ||
| 85 | + | xNodeChildrenForeach(x.GoPointer(), FlagsVar, FuncVarRef, DataVar) | |
| 71 | 86 | ||
| 72 | 87 | } | |
| 73 | 88 | ||
| @@ -86,7 +101,22 @@ var xNodeCopyDeep func(uintptr, uintptr, uintptr) *Node | |||
| 86 | 101 | // Recursively copies a #GNode and its data. | |
| 87 | 102 | func (x *Node) CopyDeep(CopyFuncVar *CopyFunc, DataVar uintptr) *Node { | |
| 88 | 103 | ||
| 89 | - | cret := xNodeCopyDeep(x.GoPointer(), NewCallback(CopyFuncVar), DataVar) | |
| 104 | + | var CopyFuncVarRef uintptr | |
| 105 | + | if CopyFuncVar != nil { | |
| 106 | + | CopyFuncVarPtr := uintptr(unsafe.Pointer(CopyFuncVar)) | |
| 107 | + | if cbRefPtr, ok := GetCallback(CopyFuncVarPtr); ok { | |
| 108 | + | CopyFuncVarRef = cbRefPtr | |
| 109 | + | } else { | |
| 110 | + | fcb := func(arg0 uintptr, arg1 uintptr) uintptr { | |
| 111 | + | cbFn := *CopyFuncVar | |
| 112 | + | return cbFn(arg0, arg1) | |
| 113 | + | } | |
| 114 | + | CopyFuncVarRef = purego.NewCallback(fcb) | |
| 115 | + | SaveCallback(CopyFuncVarPtr, CopyFuncVarRef) | |
| 116 | + | } | |
| 117 | + | } | |
| 118 | + | ||
| 119 | + | cret := xNodeCopyDeep(x.GoPointer(), CopyFuncVarRef, DataVar) | |
| 90 | 120 | return cret | |
| 91 | 121 | } | |
| 92 | 122 | ||
| @@ -275,7 +305,22 @@ var xNodeTraverse func(uintptr, TraverseType, TraverseFlags, int, uintptr, uintp | |||
| 275 | 305 | // @func must not do anything that would modify the structure of the tree. | |
| 276 | 306 | func (x *Node) Traverse(OrderVar TraverseType, FlagsVar TraverseFlags, MaxDepthVar int, FuncVar *NodeTraverseFunc, DataVar uintptr) { | |
| 277 | 307 | ||
| 278 | - | xNodeTraverse(x.GoPointer(), OrderVar, FlagsVar, MaxDepthVar, NewCallback(FuncVar), DataVar) | |
| 308 | + | var FuncVarRef uintptr | |
| 309 | + | if FuncVar != nil { | |
| 310 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 311 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 312 | + | FuncVarRef = cbRefPtr | |
| 313 | + | } else { | |
| 314 | + | fcb := func(arg0 *Node, arg1 uintptr) bool { | |
| 315 | + | cbFn := *FuncVar | |
| 316 | + | return cbFn(arg0, arg1) | |
| 317 | + | } | |
| 318 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 319 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 320 | + | } | |
| 321 | + | } | |
| 322 | + | ||
| 323 | + | xNodeTraverse(x.GoPointer(), OrderVar, FlagsVar, MaxDepthVar, FuncVarRef, DataVar) | |
| 279 | 324 | ||
| 280 | 325 | } | |
| 281 | 326 | ||
M v4/glib/goption.go +134 -14
| @@ -42,13 +42,13 @@ func (x *OptionContext) AddGroup(GroupVar *OptionGroup) { | |||
| 42 | 42 | ||
| 43 | 43 | } | |
| 44 | 44 | ||
| 45 | - | var xOptionContextAddMainEntries func(uintptr, []OptionEntry, string) | |
| 45 | + | var xOptionContextAddMainEntries func(uintptr, []OptionEntry, uintptr) | |
| 46 | 46 | ||
| 47 | 47 | // A convenience function which creates a main group if it doesn't | |
| 48 | 48 | // exist, adds the @entries to it and sets the translation domain. | |
| 49 | - | func (x *OptionContext) AddMainEntries(EntriesVar []OptionEntry, TranslationDomainVar string) { | |
| 49 | + | func (x *OptionContext) AddMainEntries(EntriesVar []OptionEntry, TranslationDomainVar *string) { | |
| 50 | 50 | ||
| 51 | - | xOptionContextAddMainEntries(x.GoPointer(), EntriesVar, TranslationDomainVar) | |
| 51 | + | xOptionContextAddMainEntries(x.GoPointer(), EntriesVar, core.NullableStringToPtr(TranslationDomainVar)) | |
| 52 | 52 | ||
| 53 | 53 | } | |
| 54 | 54 | ||
| @@ -201,16 +201,16 @@ func (x *OptionContext) ParseStrv(ArgumentsVar []string) (bool, error) { | |||
| 201 | 201 | ||
| 202 | 202 | } | |
| 203 | 203 | ||
| 204 | - | var xOptionContextSetDescription func(uintptr, string) | |
| 204 | + | var xOptionContextSetDescription func(uintptr, uintptr) | |
| 205 | 205 | ||
| 206 | 206 | // Adds a string to be displayed in `--help` output after the list | |
| 207 | 207 | // of options. This text often includes a bug reporting address. | |
| 208 | 208 | // | |
| 209 | 209 | // Note that the summary is translated (see | |
| 210 | 210 | // g_option_context_set_translate_func()). | |
| 211 | - | func (x *OptionContext) SetDescription(DescriptionVar string) { | |
| 211 | + | func (x *OptionContext) SetDescription(DescriptionVar *string) { | |
| 212 | 212 | ||
| 213 | - | xOptionContextSetDescription(x.GoPointer(), DescriptionVar) | |
| 213 | + | xOptionContextSetDescription(x.GoPointer(), core.NullableStringToPtr(DescriptionVar)) | |
| 214 | 214 | ||
| 215 | 215 | } | |
| 216 | 216 | ||
| @@ -285,7 +285,7 @@ func (x *OptionContext) SetStrictPosix(StrictPosixVar bool) { | |||
| 285 | 285 | ||
| 286 | 286 | } | |
| 287 | 287 | ||
| 288 | - | var xOptionContextSetSummary func(uintptr, string) | |
| 288 | + | var xOptionContextSetSummary func(uintptr, uintptr) | |
| 289 | 289 | ||
| 290 | 290 | // Adds a string to be displayed in `--help` output before the list | |
| 291 | 291 | // of options. This is typically a summary of the program functionality. | |
| @@ -293,9 +293,9 @@ var xOptionContextSetSummary func(uintptr, string) | |||
| 293 | 293 | // Note that the summary is translated (see | |
| 294 | 294 | // g_option_context_set_translate_func() and | |
| 295 | 295 | // g_option_context_set_translation_domain()). | |
| 296 | - | func (x *OptionContext) SetSummary(SummaryVar string) { | |
| 296 | + | func (x *OptionContext) SetSummary(SummaryVar *string) { | |
| 297 | 297 | ||
| 298 | - | xOptionContextSetSummary(x.GoPointer(), SummaryVar) | |
| 298 | + | xOptionContextSetSummary(x.GoPointer(), core.NullableStringToPtr(SummaryVar)) | |
| 299 | 299 | ||
| 300 | 300 | } | |
| 301 | 301 | ||
| @@ -314,7 +314,37 @@ var xOptionContextSetTranslateFunc func(uintptr, uintptr, uintptr, uintptr) | |||
| 314 | 314 | // domain, see g_option_context_set_translation_domain(). | |
| 315 | 315 | func (x *OptionContext) SetTranslateFunc(FuncVar *TranslateFunc, DataVar uintptr, DestroyNotifyVar *DestroyNotify) { | |
| 316 | 316 | ||
| 317 | - | xOptionContextSetTranslateFunc(x.GoPointer(), NewCallbackNullable(FuncVar), DataVar, NewCallbackNullable(DestroyNotifyVar)) | |
| 317 | + | var FuncVarRef uintptr | |
| 318 | + | if FuncVar != nil { | |
| 319 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 320 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 321 | + | FuncVarRef = cbRefPtr | |
| 322 | + | } else { | |
| 323 | + | fcb := func(arg0 string, arg1 uintptr) string { | |
| 324 | + | cbFn := *FuncVar | |
| 325 | + | return cbFn(arg0, arg1) | |
| 326 | + | } | |
| 327 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 328 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 329 | + | } | |
| 330 | + | } | |
| 331 | + | ||
| 332 | + | var DestroyNotifyVarRef uintptr | |
| 333 | + | if DestroyNotifyVar != nil { | |
| 334 | + | DestroyNotifyVarPtr := uintptr(unsafe.Pointer(DestroyNotifyVar)) | |
| 335 | + | if cbRefPtr, ok := GetCallback(DestroyNotifyVarPtr); ok { | |
| 336 | + | DestroyNotifyVarRef = cbRefPtr | |
| 337 | + | } else { | |
| 338 | + | fcb := func(arg0 uintptr) { | |
| 339 | + | cbFn := *DestroyNotifyVar | |
| 340 | + | cbFn(arg0) | |
| 341 | + | } | |
| 342 | + | DestroyNotifyVarRef = purego.NewCallback(fcb) | |
| 343 | + | SaveCallback(DestroyNotifyVarPtr, DestroyNotifyVarRef) | |
| 344 | + | } | |
| 345 | + | } | |
| 346 | + | ||
| 347 | + | xOptionContextSetTranslateFunc(x.GoPointer(), FuncVarRef, DataVar, DestroyNotifyVarRef) | |
| 318 | 348 | ||
| 319 | 349 | } | |
| 320 | 350 | ||
| @@ -404,7 +434,22 @@ var xNewOptionGroup func(string, string, string, uintptr, uintptr) *OptionGroup | |||
| 404 | 434 | // ‘Application Options:’. | |
| 405 | 435 | func NewOptionGroup(NameVar string, DescriptionVar string, HelpDescriptionVar string, UserDataVar uintptr, DestroyVar *DestroyNotify) *OptionGroup { | |
| 406 | 436 | ||
| 407 | - | cret := xNewOptionGroup(NameVar, DescriptionVar, HelpDescriptionVar, UserDataVar, NewCallbackNullable(DestroyVar)) | |
| 437 | + | var DestroyVarRef uintptr | |
| 438 | + | if DestroyVar != nil { | |
| 439 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 440 | + | if cbRefPtr, ok := GetCallback(DestroyVarPtr); ok { | |
| 441 | + | DestroyVarRef = cbRefPtr | |
| 442 | + | } else { | |
| 443 | + | fcb := func(arg0 uintptr) { | |
| 444 | + | cbFn := *DestroyVar | |
| 445 | + | cbFn(arg0) | |
| 446 | + | } | |
| 447 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 448 | + | SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 449 | + | } | |
| 450 | + | } | |
| 451 | + | ||
| 452 | + | cret := xNewOptionGroup(NameVar, DescriptionVar, HelpDescriptionVar, UserDataVar, DestroyVarRef) | |
| 408 | 453 | return cret | |
| 409 | 454 | } | |
| 410 | 455 | ||
| @@ -445,7 +490,22 @@ var xOptionGroupSetErrorHook func(uintptr, uintptr) | |||
| 445 | 490 | // specified when constructing the group with g_option_group_new(). | |
| 446 | 491 | func (x *OptionGroup) SetErrorHook(ErrorFuncVar *OptionErrorFunc) { | |
| 447 | 492 | ||
| 448 | - | xOptionGroupSetErrorHook(x.GoPointer(), NewCallback(ErrorFuncVar)) | |
| 493 | + | var ErrorFuncVarRef uintptr | |
| 494 | + | if ErrorFuncVar != nil { | |
| 495 | + | ErrorFuncVarPtr := uintptr(unsafe.Pointer(ErrorFuncVar)) | |
| 496 | + | if cbRefPtr, ok := GetCallback(ErrorFuncVarPtr); ok { | |
| 497 | + | ErrorFuncVarRef = cbRefPtr | |
| 498 | + | } else { | |
| 499 | + | fcb := func(arg0 *OptionContext, arg1 *OptionGroup, arg2 uintptr, arg3 **Error) { | |
| 500 | + | cbFn := *ErrorFuncVar | |
| 501 | + | cbFn(arg0, arg1, arg2, arg3) | |
| 502 | + | } | |
| 503 | + | ErrorFuncVarRef = purego.NewCallback(fcb) | |
| 504 | + | SaveCallback(ErrorFuncVarPtr, ErrorFuncVarRef) | |
| 505 | + | } | |
| 506 | + | } | |
| 507 | + | ||
| 508 | + | xOptionGroupSetErrorHook(x.GoPointer(), ErrorFuncVarRef) | |
| 449 | 509 | ||
| 450 | 510 | } | |
| 451 | 511 | ||
| @@ -460,7 +520,37 @@ var xOptionGroupSetParseHooks func(uintptr, uintptr, uintptr) | |||
| 460 | 520 | // with g_option_group_new(). | |
| 461 | 521 | func (x *OptionGroup) SetParseHooks(PreParseFuncVar *OptionParseFunc, PostParseFuncVar *OptionParseFunc) { | |
| 462 | 522 | ||
| 463 | - | xOptionGroupSetParseHooks(x.GoPointer(), NewCallbackNullable(PreParseFuncVar), NewCallbackNullable(PostParseFuncVar)) | |
| 523 | + | var PreParseFuncVarRef uintptr | |
| 524 | + | if PreParseFuncVar != nil { | |
| 525 | + | PreParseFuncVarPtr := uintptr(unsafe.Pointer(PreParseFuncVar)) | |
| 526 | + | if cbRefPtr, ok := GetCallback(PreParseFuncVarPtr); ok { | |
| 527 | + | PreParseFuncVarRef = cbRefPtr | |
| 528 | + | } else { | |
| 529 | + | fcb := func(arg0 *OptionContext, arg1 *OptionGroup, arg2 uintptr, arg3 **Error) bool { | |
| 530 | + | cbFn := *PreParseFuncVar | |
| 531 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 532 | + | } | |
| 533 | + | PreParseFuncVarRef = purego.NewCallback(fcb) | |
| 534 | + | SaveCallback(PreParseFuncVarPtr, PreParseFuncVarRef) | |
| 535 | + | } | |
| 536 | + | } | |
| 537 | + | ||
| 538 | + | var PostParseFuncVarRef uintptr | |
| 539 | + | if PostParseFuncVar != nil { | |
| 540 | + | PostParseFuncVarPtr := uintptr(unsafe.Pointer(PostParseFuncVar)) | |
| 541 | + | if cbRefPtr, ok := GetCallback(PostParseFuncVarPtr); ok { | |
| 542 | + | PostParseFuncVarRef = cbRefPtr | |
| 543 | + | } else { | |
| 544 | + | fcb := func(arg0 *OptionContext, arg1 *OptionGroup, arg2 uintptr, arg3 **Error) bool { | |
| 545 | + | cbFn := *PostParseFuncVar | |
| 546 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 547 | + | } | |
| 548 | + | PostParseFuncVarRef = purego.NewCallback(fcb) | |
| 549 | + | SaveCallback(PostParseFuncVarPtr, PostParseFuncVarRef) | |
| 550 | + | } | |
| 551 | + | } | |
| 552 | + | ||
| 553 | + | xOptionGroupSetParseHooks(x.GoPointer(), PreParseFuncVarRef, PostParseFuncVarRef) | |
| 464 | 554 | ||
| 465 | 555 | } | |
| 466 | 556 | ||
| @@ -474,7 +564,37 @@ var xOptionGroupSetTranslateFunc func(uintptr, uintptr, uintptr, uintptr) | |||
| 474 | 564 | // domain, see g_option_group_set_translation_domain(). | |
| 475 | 565 | func (x *OptionGroup) SetTranslateFunc(FuncVar *TranslateFunc, DataVar uintptr, DestroyNotifyVar *DestroyNotify) { | |
| 476 | 566 | ||
| 477 | - | xOptionGroupSetTranslateFunc(x.GoPointer(), NewCallbackNullable(FuncVar), DataVar, NewCallbackNullable(DestroyNotifyVar)) | |
| 567 | + | var FuncVarRef uintptr | |
| 568 | + | if FuncVar != nil { | |
| 569 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 570 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 571 | + | FuncVarRef = cbRefPtr | |
| 572 | + | } else { | |
| 573 | + | fcb := func(arg0 string, arg1 uintptr) string { | |
| 574 | + | cbFn := *FuncVar | |
| 575 | + | return cbFn(arg0, arg1) | |
| 576 | + | } | |
| 577 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 578 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 579 | + | } | |
| 580 | + | } | |
| 581 | + | ||
| 582 | + | var DestroyNotifyVarRef uintptr | |
| 583 | + | if DestroyNotifyVar != nil { | |
| 584 | + | DestroyNotifyVarPtr := uintptr(unsafe.Pointer(DestroyNotifyVar)) | |
| 585 | + | if cbRefPtr, ok := GetCallback(DestroyNotifyVarPtr); ok { | |
| 586 | + | DestroyNotifyVarRef = cbRefPtr | |
| 587 | + | } else { | |
| 588 | + | fcb := func(arg0 uintptr) { | |
| 589 | + | cbFn := *DestroyNotifyVar | |
| 590 | + | cbFn(arg0) | |
| 591 | + | } | |
| 592 | + | DestroyNotifyVarRef = purego.NewCallback(fcb) | |
| 593 | + | SaveCallback(DestroyNotifyVarPtr, DestroyNotifyVarRef) | |
| 594 | + | } | |
| 595 | + | } | |
| 596 | + | ||
| 597 | + | xOptionGroupSetTranslateFunc(x.GoPointer(), FuncVarRef, DataVar, DestroyNotifyVarRef) | |
| 478 | 598 | ||
| 479 | 599 | } | |
| 480 | 600 | ||
M v4/glib/gpathbuf.go +6 -6
| @@ -116,12 +116,12 @@ func (x *PathBuf) Init() *PathBuf { | |||
| 116 | 116 | return cret | |
| 117 | 117 | } | |
| 118 | 118 | ||
| 119 | - | var xPathBufInitFromPath func(uintptr, string) *PathBuf | |
| 119 | + | var xPathBufInitFromPath func(uintptr, uintptr) *PathBuf | |
| 120 | 120 | ||
| 121 | 121 | // Initializes a `GPathBuf` instance with the given path. | |
| 122 | - | func (x *PathBuf) InitFromPath(PathVar string) *PathBuf { | |
| 122 | + | func (x *PathBuf) InitFromPath(PathVar *string) *PathBuf { | |
| 123 | 123 | ||
| 124 | - | cret := xPathBufInitFromPath(x.GoPointer(), PathVar) | |
| 124 | + | cret := xPathBufInitFromPath(x.GoPointer(), core.NullableStringToPtr(PathVar)) | |
| 125 | 125 | return cret | |
| 126 | 126 | } | |
| 127 | 127 | ||
| @@ -191,7 +191,7 @@ func (x *PathBuf) Push(PathVar string) *PathBuf { | |||
| 191 | 191 | return cret | |
| 192 | 192 | } | |
| 193 | 193 | ||
| 194 | - | var xPathBufSetExtension func(uintptr, string) bool | |
| 194 | + | var xPathBufSetExtension func(uintptr, uintptr) bool | |
| 195 | 195 | ||
| 196 | 196 | // Adds an extension to the file name in the path buffer. | |
| 197 | 197 | // | |
| @@ -199,9 +199,9 @@ var xPathBufSetExtension func(uintptr, string) bool | |||
| 199 | 199 | // | |
| 200 | 200 | // If the path buffer does not have a file name set, this function returns | |
| 201 | 201 | // `FALSE` and leaves the path buffer unmodified. | |
| 202 | - | func (x *PathBuf) SetExtension(ExtensionVar string) bool { | |
| 202 | + | func (x *PathBuf) SetExtension(ExtensionVar *string) bool { | |
| 203 | 203 | ||
| 204 | - | cret := xPathBufSetExtension(x.GoPointer(), ExtensionVar) | |
| 204 | + | cret := xPathBufSetExtension(x.GoPointer(), core.NullableStringToPtr(ExtensionVar)) | |
| 205 | 205 | return cret | |
| 206 | 206 | } | |
| 207 | 207 | ||
M v4/glib/gpattern.go +6 -6
| @@ -77,7 +77,7 @@ func (x *PatternSpec) Free() { | |||
| 77 | 77 | ||
| 78 | 78 | } | |
| 79 | 79 | ||
| 80 | - | var xPatternSpecMatch func(uintptr, uint, string, string) bool | |
| 80 | + | var xPatternSpecMatch func(uintptr, uint, string, uintptr) bool | |
| 81 | 81 | ||
| 82 | 82 | // Matches a string against a compiled pattern. | |
| 83 | 83 | // | |
| @@ -98,9 +98,9 @@ var xPatternSpecMatch func(uintptr, uint, string, string) bool | |||
| 98 | 98 | // not be obtained by [func@GLib.strreverse]. This works only if the string | |
| 99 | 99 | // does not contain any multibyte characters. GLib offers the | |
| 100 | 100 | // [func@GLib.utf8_strreverse] function to reverse UTF-8 encoded strings. | |
| 101 | - | func (x *PatternSpec) Match(StringLengthVar uint, StringVar string, StringReversedVar string) bool { | |
| 101 | + | func (x *PatternSpec) Match(StringLengthVar uint, StringVar string, StringReversedVar *string) bool { | |
| 102 | 102 | ||
| 103 | - | cret := xPatternSpecMatch(x.GoPointer(), StringLengthVar, StringVar, StringReversedVar) | |
| 103 | + | cret := xPatternSpecMatch(x.GoPointer(), StringLengthVar, StringVar, core.NullableStringToPtr(StringReversedVar)) | |
| 104 | 104 | return cret | |
| 105 | 105 | } | |
| 106 | 106 | ||
| @@ -117,7 +117,7 @@ func (x *PatternSpec) MatchString(StringVar string) bool { | |||
| 117 | 117 | return cret | |
| 118 | 118 | } | |
| 119 | 119 | ||
| 120 | - | var xPatternMatch func(*PatternSpec, uint, string, string) bool | |
| 120 | + | var xPatternMatch func(*PatternSpec, uint, string, uintptr) bool | |
| 121 | 121 | ||
| 122 | 122 | // Matches a string against a compiled pattern. | |
| 123 | 123 | // | |
| @@ -138,9 +138,9 @@ var xPatternMatch func(*PatternSpec, uint, string, string) bool | |||
| 138 | 138 | // not be obtained by [func@GLib.strreverse]. This works only if the string | |
| 139 | 139 | // does not contain any multibyte characters. GLib offers the | |
| 140 | 140 | // [func@GLib.utf8_strreverse] function to reverse UTF-8 encoded strings. | |
| 141 | - | func PatternMatch(PspecVar *PatternSpec, StringLengthVar uint, StringVar string, StringReversedVar string) bool { | |
| 141 | + | func PatternMatch(PspecVar *PatternSpec, StringLengthVar uint, StringVar string, StringReversedVar *string) bool { | |
| 142 | 142 | ||
| 143 | - | cret := xPatternMatch(PspecVar, StringLengthVar, StringVar, StringReversedVar) | |
| 143 | + | cret := xPatternMatch(PspecVar, StringLengthVar, StringVar, core.NullableStringToPtr(StringReversedVar)) | |
| 144 | 144 | return cret | |
| 145 | 145 | } | |
| 146 | 146 | ||
M v4/glib/gqsort.go +34 -2
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | package glib | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 5 | 7 | "github.com/jwijenbergh/purego" | |
| 6 | 8 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 9 | ) | |
| @@ -15,7 +17,22 @@ var xQsortWithData func(uintptr, int, uint, uintptr, uintptr) | |||
| 15 | 17 | // Unlike `qsort()`, this is guaranteed to be a stable sort (since GLib 2.32). | |
| 16 | 18 | func QsortWithData(PbaseVar uintptr, TotalElemsVar int, SizeVar uint, CompareFuncVar *CompareDataFunc, UserDataVar uintptr) { | |
| 17 | 19 | ||
| 18 | - | xQsortWithData(PbaseVar, TotalElemsVar, SizeVar, NewCallback(CompareFuncVar), UserDataVar) | |
| 20 | + | var CompareFuncVarRef uintptr | |
| 21 | + | if CompareFuncVar != nil { | |
| 22 | + | CompareFuncVarPtr := uintptr(unsafe.Pointer(CompareFuncVar)) | |
| 23 | + | if cbRefPtr, ok := GetCallback(CompareFuncVarPtr); ok { | |
| 24 | + | CompareFuncVarRef = cbRefPtr | |
| 25 | + | } else { | |
| 26 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 27 | + | cbFn := *CompareFuncVar | |
| 28 | + | return cbFn(arg0, arg1, arg2) | |
| 29 | + | } | |
| 30 | + | CompareFuncVarRef = purego.NewCallback(fcb) | |
| 31 | + | SaveCallback(CompareFuncVarPtr, CompareFuncVarRef) | |
| 32 | + | } | |
| 33 | + | } | |
| 34 | + | ||
| 35 | + | xQsortWithData(PbaseVar, TotalElemsVar, SizeVar, CompareFuncVarRef, UserDataVar) | |
| 19 | 36 | ||
| 20 | 37 | } | |
| 21 | 38 | ||
| @@ -28,7 +45,22 @@ var xSortArray func([]uintptr, uint, uint, uintptr, uintptr) | |||
| 28 | 45 | // Unlike `qsort()`, this is guaranteed to be a stable sort. | |
| 29 | 46 | func SortArray(ArrayVar []uintptr, NElementsVar uint, ElementSizeVar uint, CompareFuncVar *CompareDataFunc, UserDataVar uintptr) { | |
| 30 | 47 | ||
| 31 | - | xSortArray(ArrayVar, NElementsVar, ElementSizeVar, NewCallback(CompareFuncVar), UserDataVar) | |
| 48 | + | var CompareFuncVarRef uintptr | |
| 49 | + | if CompareFuncVar != nil { | |
| 50 | + | CompareFuncVarPtr := uintptr(unsafe.Pointer(CompareFuncVar)) | |
| 51 | + | if cbRefPtr, ok := GetCallback(CompareFuncVarPtr); ok { | |
| 52 | + | CompareFuncVarRef = cbRefPtr | |
| 53 | + | } else { | |
| 54 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 55 | + | cbFn := *CompareFuncVar | |
| 56 | + | return cbFn(arg0, arg1, arg2) | |
| 57 | + | } | |
| 58 | + | CompareFuncVarRef = purego.NewCallback(fcb) | |
| 59 | + | SaveCallback(CompareFuncVarPtr, CompareFuncVarRef) | |
| 60 | + | } | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | xSortArray(ArrayVar, NElementsVar, ElementSizeVar, CompareFuncVarRef, UserDataVar) | |
| 32 | 64 | ||
| 33 | 65 | } | |
| 34 | 66 | ||
M v4/glib/gquark.go +15 -15
| @@ -34,7 +34,7 @@ import ( | |||
| 34 | 34 | // pointer comparison, rather than using `strcmp()`. | |
| 35 | 35 | type Quark = uint32 | |
| 36 | 36 | ||
| 37 | - | var xInternStaticString func(string) string | |
| 37 | + | var xInternStaticString func(uintptr) string | |
| 38 | 38 | ||
| 39 | 39 | // Returns a canonical representation for @string. Interned strings | |
| 40 | 40 | // can be compared for equality by comparing the pointers, instead of | |
| @@ -44,13 +44,13 @@ var xInternStaticString func(string) string | |||
| 44 | 44 | // This function must not be used before library constructors have finished | |
| 45 | 45 | // running. In particular, this means it cannot be used to initialize global | |
| 46 | 46 | // variables in C++. | |
| 47 | - | func InternStaticString(StringVar string) string { | |
| 47 | + | func InternStaticString(StringVar *string) string { | |
| 48 | 48 | ||
| 49 | - | cret := xInternStaticString(StringVar) | |
| 49 | + | cret := xInternStaticString(core.NullableStringToPtr(StringVar)) | |
| 50 | 50 | return cret | |
| 51 | 51 | } | |
| 52 | 52 | ||
| 53 | - | var xInternString func(string) string | |
| 53 | + | var xInternString func(uintptr) string | |
| 54 | 54 | ||
| 55 | 55 | // Returns a canonical representation for @string. Interned strings | |
| 56 | 56 | // can be compared for equality by comparing the pointers, instead of | |
| @@ -59,13 +59,13 @@ var xInternString func(string) string | |||
| 59 | 59 | // This function must not be used before library constructors have finished | |
| 60 | 60 | // running. In particular, this means it cannot be used to initialize global | |
| 61 | 61 | // variables in C++. | |
| 62 | - | func InternString(StringVar string) string { | |
| 62 | + | func InternString(StringVar *string) string { | |
| 63 | 63 | ||
| 64 | - | cret := xInternString(StringVar) | |
| 64 | + | cret := xInternString(core.NullableStringToPtr(StringVar)) | |
| 65 | 65 | return cret | |
| 66 | 66 | } | |
| 67 | 67 | ||
| 68 | - | var xQuarkFromStaticString func(string) Quark | |
| 68 | + | var xQuarkFromStaticString func(uintptr) Quark | |
| 69 | 69 | ||
| 70 | 70 | // Gets the #GQuark identifying the given (static) string. If the | |
| 71 | 71 | // string does not currently have an associated #GQuark, a new #GQuark | |
| @@ -83,13 +83,13 @@ var xQuarkFromStaticString func(string) Quark | |||
| 83 | 83 | // This function must not be used before library constructors have finished | |
| 84 | 84 | // running. In particular, this means it cannot be used to initialize global | |
| 85 | 85 | // variables in C++. | |
| 86 | - | func QuarkFromStaticString(StringVar string) Quark { | |
| 86 | + | func QuarkFromStaticString(StringVar *string) Quark { | |
| 87 | 87 | ||
| 88 | - | cret := xQuarkFromStaticString(StringVar) | |
| 88 | + | cret := xQuarkFromStaticString(core.NullableStringToPtr(StringVar)) | |
| 89 | 89 | return cret | |
| 90 | 90 | } | |
| 91 | 91 | ||
| 92 | - | var xQuarkFromString func(string) Quark | |
| 92 | + | var xQuarkFromString func(uintptr) Quark | |
| 93 | 93 | ||
| 94 | 94 | // Gets the #GQuark identifying the given string. If the string does | |
| 95 | 95 | // not currently have an associated #GQuark, a new #GQuark is created, | |
| @@ -98,9 +98,9 @@ var xQuarkFromString func(string) Quark | |||
| 98 | 98 | // This function must not be used before library constructors have finished | |
| 99 | 99 | // running. In particular, this means it cannot be used to initialize global | |
| 100 | 100 | // variables in C++. | |
| 101 | - | func QuarkFromString(StringVar string) Quark { | |
| 101 | + | func QuarkFromString(StringVar *string) Quark { | |
| 102 | 102 | ||
| 103 | - | cret := xQuarkFromString(StringVar) | |
| 103 | + | cret := xQuarkFromString(core.NullableStringToPtr(StringVar)) | |
| 104 | 104 | return cret | |
| 105 | 105 | } | |
| 106 | 106 | ||
| @@ -113,7 +113,7 @@ func QuarkToString(QuarkVar Quark) string { | |||
| 113 | 113 | return cret | |
| 114 | 114 | } | |
| 115 | 115 | ||
| 116 | - | var xQuarkTryString func(string) Quark | |
| 116 | + | var xQuarkTryString func(uintptr) Quark | |
| 117 | 117 | ||
| 118 | 118 | // Gets the #GQuark associated with the given string, or 0 if string is | |
| 119 | 119 | // %NULL or it has no associated #GQuark. | |
| @@ -123,9 +123,9 @@ var xQuarkTryString func(string) Quark | |||
| 123 | 123 | // | |
| 124 | 124 | // This function must not be used before library constructors have finished | |
| 125 | 125 | // running. | |
| 126 | - | func QuarkTryString(StringVar string) Quark { | |
| 126 | + | func QuarkTryString(StringVar *string) Quark { | |
| 127 | 127 | ||
| 128 | - | cret := xQuarkTryString(StringVar) | |
| 128 | + | cret := xQuarkTryString(core.NullableStringToPtr(StringVar)) | |
| 129 | 129 | return cret | |
| 130 | 130 | } | |
| 131 | 131 | ||
M v4/glib/gqueue.go +96 -6
| @@ -41,7 +41,22 @@ var xQueueClearFull func(uintptr, uintptr) | |||
| 41 | 41 | // and calls the provided @free_func on each item in the #GQueue. | |
| 42 | 42 | func (x *Queue) ClearFull(FreeFuncVar *DestroyNotify) { | |
| 43 | 43 | ||
| 44 | - | xQueueClearFull(x.GoPointer(), NewCallbackNullable(FreeFuncVar)) | |
| 44 | + | var FreeFuncVarRef uintptr | |
| 45 | + | if FreeFuncVar != nil { | |
| 46 | + | FreeFuncVarPtr := uintptr(unsafe.Pointer(FreeFuncVar)) | |
| 47 | + | if cbRefPtr, ok := GetCallback(FreeFuncVarPtr); ok { | |
| 48 | + | FreeFuncVarRef = cbRefPtr | |
| 49 | + | } else { | |
| 50 | + | fcb := func(arg0 uintptr) { | |
| 51 | + | cbFn := *FreeFuncVar | |
| 52 | + | cbFn(arg0) | |
| 53 | + | } | |
| 54 | + | FreeFuncVarRef = purego.NewCallback(fcb) | |
| 55 | + | SaveCallback(FreeFuncVarPtr, FreeFuncVarRef) | |
| 56 | + | } | |
| 57 | + | } | |
| 58 | + | ||
| 59 | + | xQueueClearFull(x.GoPointer(), FreeFuncVarRef) | |
| 45 | 60 | ||
| 46 | 61 | } | |
| 47 | 62 | ||
| @@ -85,7 +100,22 @@ var xQueueFindCustom func(uintptr, uintptr, uintptr) *List | |||
| 85 | 100 | // first argument and the given user data as the second argument. | |
| 86 | 101 | func (x *Queue) FindCustom(DataVar uintptr, FuncVar *CompareFunc) *List { | |
| 87 | 102 | ||
| 88 | - | cret := xQueueFindCustom(x.GoPointer(), DataVar, NewCallback(FuncVar)) | |
| 103 | + | var FuncVarRef uintptr | |
| 104 | + | if FuncVar != nil { | |
| 105 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 106 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 107 | + | FuncVarRef = cbRefPtr | |
| 108 | + | } else { | |
| 109 | + | fcb := func(arg0 uintptr, arg1 uintptr) int { | |
| 110 | + | cbFn := *FuncVar | |
| 111 | + | return cbFn(arg0, arg1) | |
| 112 | + | } | |
| 113 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 114 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 115 | + | } | |
| 116 | + | } | |
| 117 | + | ||
| 118 | + | cret := xQueueFindCustom(x.GoPointer(), DataVar, FuncVarRef) | |
| 89 | 119 | return cret | |
| 90 | 120 | } | |
| 91 | 121 | ||
| @@ -98,7 +128,22 @@ var xQueueForeach func(uintptr, uintptr, uintptr) | |||
| 98 | 128 | // not modify any part of the queue after that element. | |
| 99 | 129 | func (x *Queue) Foreach(FuncVar *Func, UserDataVar uintptr) { | |
| 100 | 130 | ||
| 101 | - | xQueueForeach(x.GoPointer(), NewCallback(FuncVar), UserDataVar) | |
| 131 | + | var FuncVarRef uintptr | |
| 132 | + | if FuncVar != nil { | |
| 133 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 134 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 135 | + | FuncVarRef = cbRefPtr | |
| 136 | + | } else { | |
| 137 | + | fcb := func(arg0 uintptr, arg1 uintptr) { | |
| 138 | + | cbFn := *FuncVar | |
| 139 | + | cbFn(arg0, arg1) | |
| 140 | + | } | |
| 141 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 142 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 143 | + | } | |
| 144 | + | } | |
| 145 | + | ||
| 146 | + | xQueueForeach(x.GoPointer(), FuncVarRef, UserDataVar) | |
| 102 | 147 | ||
| 103 | 148 | } | |
| 104 | 149 | ||
| @@ -125,7 +170,22 @@ var xQueueFreeFull func(uintptr, uintptr) | |||
| 125 | 170 | // element from it). | |
| 126 | 171 | func (x *Queue) FreeFull(FreeFuncVar *DestroyNotify) { | |
| 127 | 172 | ||
| 128 | - | xQueueFreeFull(x.GoPointer(), NewCallback(FreeFuncVar)) | |
| 173 | + | var FreeFuncVarRef uintptr | |
| 174 | + | if FreeFuncVar != nil { | |
| 175 | + | FreeFuncVarPtr := uintptr(unsafe.Pointer(FreeFuncVar)) | |
| 176 | + | if cbRefPtr, ok := GetCallback(FreeFuncVarPtr); ok { | |
| 177 | + | FreeFuncVarRef = cbRefPtr | |
| 178 | + | } else { | |
| 179 | + | fcb := func(arg0 uintptr) { | |
| 180 | + | cbFn := *FreeFuncVar | |
| 181 | + | cbFn(arg0) | |
| 182 | + | } | |
| 183 | + | FreeFuncVarRef = purego.NewCallback(fcb) | |
| 184 | + | SaveCallback(FreeFuncVarPtr, FreeFuncVarRef) | |
| 185 | + | } | |
| 186 | + | } | |
| 187 | + | ||
| 188 | + | xQueueFreeFull(x.GoPointer(), FreeFuncVarRef) | |
| 129 | 189 | ||
| 130 | 190 | } | |
| 131 | 191 | ||
| @@ -210,7 +270,22 @@ var xQueueInsertSorted func(uintptr, uintptr, uintptr, uintptr) | |||
| 210 | 270 | // Inserts @data into @queue using @func to determine the new position. | |
| 211 | 271 | func (x *Queue) InsertSorted(DataVar uintptr, FuncVar *CompareDataFunc, UserDataVar uintptr) { | |
| 212 | 272 | ||
| 213 | - | xQueueInsertSorted(x.GoPointer(), DataVar, NewCallback(FuncVar), UserDataVar) | |
| 273 | + | var FuncVarRef uintptr | |
| 274 | + | if FuncVar != nil { | |
| 275 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 276 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 277 | + | FuncVarRef = cbRefPtr | |
| 278 | + | } else { | |
| 279 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 280 | + | cbFn := *FuncVar | |
| 281 | + | return cbFn(arg0, arg1, arg2) | |
| 282 | + | } | |
| 283 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 284 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 285 | + | } | |
| 286 | + | } | |
| 287 | + | ||
| 288 | + | xQueueInsertSorted(x.GoPointer(), DataVar, FuncVarRef, UserDataVar) | |
| 214 | 289 | ||
| 215 | 290 | } | |
| 216 | 291 | ||
| @@ -426,7 +501,22 @@ var xQueueSort func(uintptr, uintptr, uintptr) | |||
| 426 | 501 | // Sorts @queue using @compare_func. | |
| 427 | 502 | func (x *Queue) Sort(CompareFuncVar *CompareDataFunc, UserDataVar uintptr) { | |
| 428 | 503 | ||
| 429 | - | xQueueSort(x.GoPointer(), NewCallback(CompareFuncVar), UserDataVar) | |
| 504 | + | var CompareFuncVarRef uintptr | |
| 505 | + | if CompareFuncVar != nil { | |
| 506 | + | CompareFuncVarPtr := uintptr(unsafe.Pointer(CompareFuncVar)) | |
| 507 | + | if cbRefPtr, ok := GetCallback(CompareFuncVarPtr); ok { | |
| 508 | + | CompareFuncVarRef = cbRefPtr | |
| 509 | + | } else { | |
| 510 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 511 | + | cbFn := *CompareFuncVar | |
| 512 | + | return cbFn(arg0, arg1, arg2) | |
| 513 | + | } | |
| 514 | + | CompareFuncVarRef = purego.NewCallback(fcb) | |
| 515 | + | SaveCallback(CompareFuncVarPtr, CompareFuncVarRef) | |
| 516 | + | } | |
| 517 | + | } | |
| 518 | + | ||
| 519 | + | xQueueSort(x.GoPointer(), CompareFuncVarRef, UserDataVar) | |
| 430 | 520 | ||
| 431 | 521 | } | |
| 432 | 522 | ||
M v4/glib/grcbox.go +34 -2
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | package glib | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 5 | 7 | "github.com/jwijenbergh/purego" | |
| 6 | 8 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 9 | ) | |
| @@ -95,7 +97,22 @@ var xAtomicRcBoxReleaseFull func(uintptr, uintptr) | |||
| 95 | 97 | // when the callback is called and will be freed. | |
| 96 | 98 | func AtomicRcBoxReleaseFull(MemBlockVar uintptr, ClearFuncVar *DestroyNotify) { | |
| 97 | 99 | ||
| 98 | - | xAtomicRcBoxReleaseFull(MemBlockVar, NewCallback(ClearFuncVar)) | |
| 100 | + | var ClearFuncVarRef uintptr | |
| 101 | + | if ClearFuncVar != nil { | |
| 102 | + | ClearFuncVarPtr := uintptr(unsafe.Pointer(ClearFuncVar)) | |
| 103 | + | if cbRefPtr, ok := GetCallback(ClearFuncVarPtr); ok { | |
| 104 | + | ClearFuncVarRef = cbRefPtr | |
| 105 | + | } else { | |
| 106 | + | fcb := func(arg0 uintptr) { | |
| 107 | + | cbFn := *ClearFuncVar | |
| 108 | + | cbFn(arg0) | |
| 109 | + | } | |
| 110 | + | ClearFuncVarRef = purego.NewCallback(fcb) | |
| 111 | + | SaveCallback(ClearFuncVarPtr, ClearFuncVarRef) | |
| 112 | + | } | |
| 113 | + | } | |
| 114 | + | ||
| 115 | + | xAtomicRcBoxReleaseFull(MemBlockVar, ClearFuncVarRef) | |
| 99 | 116 | ||
| 100 | 117 | } | |
| 101 | 118 | ||
| @@ -183,7 +200,22 @@ var xRcBoxReleaseFull func(uintptr, uintptr) | |||
| 183 | 200 | // resources allocated for @mem_block. | |
| 184 | 201 | func RcBoxReleaseFull(MemBlockVar uintptr, ClearFuncVar *DestroyNotify) { | |
| 185 | 202 | ||
| 186 | - | xRcBoxReleaseFull(MemBlockVar, NewCallback(ClearFuncVar)) | |
| 203 | + | var ClearFuncVarRef uintptr | |
| 204 | + | if ClearFuncVar != nil { | |
| 205 | + | ClearFuncVarPtr := uintptr(unsafe.Pointer(ClearFuncVar)) | |
| 206 | + | if cbRefPtr, ok := GetCallback(ClearFuncVarPtr); ok { | |
| 207 | + | ClearFuncVarRef = cbRefPtr | |
| 208 | + | } else { | |
| 209 | + | fcb := func(arg0 uintptr) { | |
| 210 | + | cbFn := *ClearFuncVar | |
| 211 | + | cbFn(arg0) | |
| 212 | + | } | |
| 213 | + | ClearFuncVarRef = purego.NewCallback(fcb) | |
| 214 | + | SaveCallback(ClearFuncVarPtr, ClearFuncVarRef) | |
| 215 | + | } | |
| 216 | + | } | |
| 217 | + | ||
| 218 | + | xRcBoxReleaseFull(MemBlockVar, ClearFuncVarRef) | |
| 187 | 219 | ||
| 188 | 220 | } | |
| 189 | 221 | ||
M v4/glib/gregex.go +16 -1
| @@ -1028,7 +1028,22 @@ var xRegexReplaceEval func(uintptr, []string, int, int, RegexMatchFlags, uintptr | |||
| 1028 | 1028 | func (x *Regex) ReplaceEval(StringVar []string, StringLenVar int, StartPositionVar int, MatchOptionsVar RegexMatchFlags, EvalVar *RegexEvalCallback, UserDataVar uintptr) (string, error) { | |
| 1029 | 1029 | var cerr *Error | |
| 1030 | 1030 | ||
| 1031 | - | cret := xRegexReplaceEval(x.GoPointer(), StringVar, StringLenVar, StartPositionVar, MatchOptionsVar, NewCallback(EvalVar), UserDataVar, &cerr) | |
| 1031 | + | var EvalVarRef uintptr | |
| 1032 | + | if EvalVar != nil { | |
| 1033 | + | EvalVarPtr := uintptr(unsafe.Pointer(EvalVar)) | |
| 1034 | + | if cbRefPtr, ok := GetCallback(EvalVarPtr); ok { | |
| 1035 | + | EvalVarRef = cbRefPtr | |
| 1036 | + | } else { | |
| 1037 | + | fcb := func(arg0 *MatchInfo, arg1 *String, arg2 uintptr) bool { | |
| 1038 | + | cbFn := *EvalVar | |
| 1039 | + | return cbFn(arg0, arg1, arg2) | |
| 1040 | + | } | |
| 1041 | + | EvalVarRef = purego.NewCallback(fcb) | |
| 1042 | + | SaveCallback(EvalVarPtr, EvalVarRef) | |
| 1043 | + | } | |
| 1044 | + | } | |
| 1045 | + | ||
| 1046 | + | cret := xRegexReplaceEval(x.GoPointer(), StringVar, StringLenVar, StartPositionVar, MatchOptionsVar, EvalVarRef, UserDataVar, &cerr) | |
| 1032 | 1047 | if cerr == nil { | |
| 1033 | 1048 | return cret, nil | |
| 1034 | 1049 | } | |
M v4/glib/grel.go +31 -1
| @@ -104,7 +104,37 @@ var xRelationIndex func(uintptr, int, uintptr, uintptr) | |||
| 104 | 104 | // before any records are added to the #GRelation. | |
| 105 | 105 | func (x *Relation) Index(FieldVar int, HashFuncVar *HashFunc, KeyEqualFuncVar *EqualFunc) { | |
| 106 | 106 | ||
| 107 | - | xRelationIndex(x.GoPointer(), FieldVar, NewCallback(HashFuncVar), NewCallback(KeyEqualFuncVar)) | |
| 107 | + | var HashFuncVarRef uintptr | |
| 108 | + | if HashFuncVar != nil { | |
| 109 | + | HashFuncVarPtr := uintptr(unsafe.Pointer(HashFuncVar)) | |
| 110 | + | if cbRefPtr, ok := GetCallback(HashFuncVarPtr); ok { | |
| 111 | + | HashFuncVarRef = cbRefPtr | |
| 112 | + | } else { | |
| 113 | + | fcb := func(arg0 uintptr) uint { | |
| 114 | + | cbFn := *HashFuncVar | |
| 115 | + | return cbFn(arg0) | |
| 116 | + | } | |
| 117 | + | HashFuncVarRef = purego.NewCallback(fcb) | |
| 118 | + | SaveCallback(HashFuncVarPtr, HashFuncVarRef) | |
| 119 | + | } | |
| 120 | + | } | |
| 121 | + | ||
| 122 | + | var KeyEqualFuncVarRef uintptr | |
| 123 | + | if KeyEqualFuncVar != nil { | |
| 124 | + | KeyEqualFuncVarPtr := uintptr(unsafe.Pointer(KeyEqualFuncVar)) | |
| 125 | + | if cbRefPtr, ok := GetCallback(KeyEqualFuncVarPtr); ok { | |
| 126 | + | KeyEqualFuncVarRef = cbRefPtr | |
| 127 | + | } else { | |
| 128 | + | fcb := func(arg0 uintptr, arg1 uintptr) bool { | |
| 129 | + | cbFn := *KeyEqualFuncVar | |
| 130 | + | return cbFn(arg0, arg1) | |
| 131 | + | } | |
| 132 | + | KeyEqualFuncVarRef = purego.NewCallback(fcb) | |
| 133 | + | SaveCallback(KeyEqualFuncVarPtr, KeyEqualFuncVarRef) | |
| 134 | + | } | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | xRelationIndex(x.GoPointer(), FieldVar, HashFuncVarRef, KeyEqualFuncVarRef) | |
| 108 | 138 | ||
| 109 | 139 | } | |
| 110 | 140 | ||
M v4/glib/gscanner.go +16 -1
| @@ -223,7 +223,22 @@ var xScannerScopeForeachSymbol func(uintptr, uint, uintptr, uintptr) | |||
| 223 | 223 | // parameter. | |
| 224 | 224 | func (x *Scanner) ScopeForeachSymbol(ScopeIdVar uint, FuncVar *HFunc, UserDataVar uintptr) { | |
| 225 | 225 | ||
| 226 | - | xScannerScopeForeachSymbol(x.GoPointer(), ScopeIdVar, NewCallback(FuncVar), UserDataVar) | |
| 226 | + | var FuncVarRef uintptr | |
| 227 | + | if FuncVar != nil { | |
| 228 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 229 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 230 | + | FuncVarRef = cbRefPtr | |
| 231 | + | } else { | |
| 232 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 233 | + | cbFn := *FuncVar | |
| 234 | + | cbFn(arg0, arg1, arg2) | |
| 235 | + | } | |
| 236 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 237 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 238 | + | } | |
| 239 | + | } | |
| 240 | + | ||
| 241 | + | xScannerScopeForeachSymbol(x.GoPointer(), ScopeIdVar, FuncVarRef, UserDataVar) | |
| 227 | 242 | ||
| 228 | 243 | } | |
| 229 | 244 | ||
M v4/glib/gsequence.go +192 -12
| @@ -39,7 +39,22 @@ var xSequenceForeach func(uintptr, uintptr, uintptr) | |||
| 39 | 39 | // to the function. @func must not modify the sequence itself. | |
| 40 | 40 | func (x *Sequence) Foreach(FuncVar *Func, UserDataVar uintptr) { | |
| 41 | 41 | ||
| 42 | - | xSequenceForeach(x.GoPointer(), NewCallback(FuncVar), UserDataVar) | |
| 42 | + | var FuncVarRef uintptr | |
| 43 | + | if FuncVar != nil { | |
| 44 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 45 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 46 | + | FuncVarRef = cbRefPtr | |
| 47 | + | } else { | |
| 48 | + | fcb := func(arg0 uintptr, arg1 uintptr) { | |
| 49 | + | cbFn := *FuncVar | |
| 50 | + | cbFn(arg0, arg1) | |
| 51 | + | } | |
| 52 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 53 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 54 | + | } | |
| 55 | + | } | |
| 56 | + | ||
| 57 | + | xSequenceForeach(x.GoPointer(), FuncVarRef, UserDataVar) | |
| 43 | 58 | ||
| 44 | 59 | } | |
| 45 | 60 | ||
| @@ -109,7 +124,22 @@ var xSequenceInsertSorted func(uintptr, uintptr, uintptr, uintptr) *SequenceIter | |||
| 109 | 124 | // g_sequence_sort() or g_sequence_sort_iter(). | |
| 110 | 125 | func (x *Sequence) InsertSorted(DataVar uintptr, CmpFuncVar *CompareDataFunc, CmpDataVar uintptr) *SequenceIter { | |
| 111 | 126 | ||
| 112 | - | cret := xSequenceInsertSorted(x.GoPointer(), DataVar, NewCallback(CmpFuncVar), CmpDataVar) | |
| 127 | + | var CmpFuncVarRef uintptr | |
| 128 | + | if CmpFuncVar != nil { | |
| 129 | + | CmpFuncVarPtr := uintptr(unsafe.Pointer(CmpFuncVar)) | |
| 130 | + | if cbRefPtr, ok := GetCallback(CmpFuncVarPtr); ok { | |
| 131 | + | CmpFuncVarRef = cbRefPtr | |
| 132 | + | } else { | |
| 133 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 134 | + | cbFn := *CmpFuncVar | |
| 135 | + | return cbFn(arg0, arg1, arg2) | |
| 136 | + | } | |
| 137 | + | CmpFuncVarRef = purego.NewCallback(fcb) | |
| 138 | + | SaveCallback(CmpFuncVarPtr, CmpFuncVarRef) | |
| 139 | + | } | |
| 140 | + | } | |
| 141 | + | ||
| 142 | + | cret := xSequenceInsertSorted(x.GoPointer(), DataVar, CmpFuncVarRef, CmpDataVar) | |
| 113 | 143 | return cret | |
| 114 | 144 | } | |
| 115 | 145 | ||
| @@ -129,7 +159,22 @@ var xSequenceInsertSortedIter func(uintptr, uintptr, uintptr, uintptr) *Sequence | |||
| 129 | 159 | // g_sequence_sort() or g_sequence_sort_iter(). | |
| 130 | 160 | func (x *Sequence) InsertSortedIter(DataVar uintptr, IterCmpVar *SequenceIterCompareFunc, CmpDataVar uintptr) *SequenceIter { | |
| 131 | 161 | ||
| 132 | - | cret := xSequenceInsertSortedIter(x.GoPointer(), DataVar, NewCallback(IterCmpVar), CmpDataVar) | |
| 162 | + | var IterCmpVarRef uintptr | |
| 163 | + | if IterCmpVar != nil { | |
| 164 | + | IterCmpVarPtr := uintptr(unsafe.Pointer(IterCmpVar)) | |
| 165 | + | if cbRefPtr, ok := GetCallback(IterCmpVarPtr); ok { | |
| 166 | + | IterCmpVarRef = cbRefPtr | |
| 167 | + | } else { | |
| 168 | + | fcb := func(arg0 *SequenceIter, arg1 *SequenceIter, arg2 uintptr) int { | |
| 169 | + | cbFn := *IterCmpVar | |
| 170 | + | return cbFn(arg0, arg1, arg2) | |
| 171 | + | } | |
| 172 | + | IterCmpVarRef = purego.NewCallback(fcb) | |
| 173 | + | SaveCallback(IterCmpVarPtr, IterCmpVarRef) | |
| 174 | + | } | |
| 175 | + | } | |
| 176 | + | ||
| 177 | + | cret := xSequenceInsertSortedIter(x.GoPointer(), DataVar, IterCmpVarRef, CmpDataVar) | |
| 133 | 178 | return cret | |
| 134 | 179 | } | |
| 135 | 180 | ||
| @@ -163,7 +208,22 @@ var xSequenceLookup func(uintptr, uintptr, uintptr, uintptr) *SequenceIter | |||
| 163 | 208 | // unsorted. | |
| 164 | 209 | func (x *Sequence) Lookup(DataVar uintptr, CmpFuncVar *CompareDataFunc, CmpDataVar uintptr) *SequenceIter { | |
| 165 | 210 | ||
| 166 | - | cret := xSequenceLookup(x.GoPointer(), DataVar, NewCallback(CmpFuncVar), CmpDataVar) | |
| 211 | + | var CmpFuncVarRef uintptr | |
| 212 | + | if CmpFuncVar != nil { | |
| 213 | + | CmpFuncVarPtr := uintptr(unsafe.Pointer(CmpFuncVar)) | |
| 214 | + | if cbRefPtr, ok := GetCallback(CmpFuncVarPtr); ok { | |
| 215 | + | CmpFuncVarRef = cbRefPtr | |
| 216 | + | } else { | |
| 217 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 218 | + | cbFn := *CmpFuncVar | |
| 219 | + | return cbFn(arg0, arg1, arg2) | |
| 220 | + | } | |
| 221 | + | CmpFuncVarRef = purego.NewCallback(fcb) | |
| 222 | + | SaveCallback(CmpFuncVarPtr, CmpFuncVarRef) | |
| 223 | + | } | |
| 224 | + | } | |
| 225 | + | ||
| 226 | + | cret := xSequenceLookup(x.GoPointer(), DataVar, CmpFuncVarRef, CmpDataVar) | |
| 167 | 227 | return cret | |
| 168 | 228 | } | |
| 169 | 229 | ||
| @@ -181,7 +241,22 @@ var xSequenceLookupIter func(uintptr, uintptr, uintptr, uintptr) *SequenceIter | |||
| 181 | 241 | // unsorted. | |
| 182 | 242 | func (x *Sequence) LookupIter(DataVar uintptr, IterCmpVar *SequenceIterCompareFunc, CmpDataVar uintptr) *SequenceIter { | |
| 183 | 243 | ||
| 184 | - | cret := xSequenceLookupIter(x.GoPointer(), DataVar, NewCallback(IterCmpVar), CmpDataVar) | |
| 244 | + | var IterCmpVarRef uintptr | |
| 245 | + | if IterCmpVar != nil { | |
| 246 | + | IterCmpVarPtr := uintptr(unsafe.Pointer(IterCmpVar)) | |
| 247 | + | if cbRefPtr, ok := GetCallback(IterCmpVarPtr); ok { | |
| 248 | + | IterCmpVarRef = cbRefPtr | |
| 249 | + | } else { | |
| 250 | + | fcb := func(arg0 *SequenceIter, arg1 *SequenceIter, arg2 uintptr) int { | |
| 251 | + | cbFn := *IterCmpVar | |
| 252 | + | return cbFn(arg0, arg1, arg2) | |
| 253 | + | } | |
| 254 | + | IterCmpVarRef = purego.NewCallback(fcb) | |
| 255 | + | SaveCallback(IterCmpVarPtr, IterCmpVarRef) | |
| 256 | + | } | |
| 257 | + | } | |
| 258 | + | ||
| 259 | + | cret := xSequenceLookupIter(x.GoPointer(), DataVar, IterCmpVarRef, CmpDataVar) | |
| 185 | 260 | return cret | |
| 186 | 261 | } | |
| 187 | 262 | ||
| @@ -211,7 +286,22 @@ var xSequenceSearch func(uintptr, uintptr, uintptr, uintptr) *SequenceIter | |||
| 211 | 286 | // unsorted. | |
| 212 | 287 | func (x *Sequence) Search(DataVar uintptr, CmpFuncVar *CompareDataFunc, CmpDataVar uintptr) *SequenceIter { | |
| 213 | 288 | ||
| 214 | - | cret := xSequenceSearch(x.GoPointer(), DataVar, NewCallback(CmpFuncVar), CmpDataVar) | |
| 289 | + | var CmpFuncVarRef uintptr | |
| 290 | + | if CmpFuncVar != nil { | |
| 291 | + | CmpFuncVarPtr := uintptr(unsafe.Pointer(CmpFuncVar)) | |
| 292 | + | if cbRefPtr, ok := GetCallback(CmpFuncVarPtr); ok { | |
| 293 | + | CmpFuncVarRef = cbRefPtr | |
| 294 | + | } else { | |
| 295 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 296 | + | cbFn := *CmpFuncVar | |
| 297 | + | return cbFn(arg0, arg1, arg2) | |
| 298 | + | } | |
| 299 | + | CmpFuncVarRef = purego.NewCallback(fcb) | |
| 300 | + | SaveCallback(CmpFuncVarPtr, CmpFuncVarRef) | |
| 301 | + | } | |
| 302 | + | } | |
| 303 | + | ||
| 304 | + | cret := xSequenceSearch(x.GoPointer(), DataVar, CmpFuncVarRef, CmpDataVar) | |
| 215 | 305 | return cret | |
| 216 | 306 | } | |
| 217 | 307 | ||
| @@ -232,7 +322,22 @@ var xSequenceSearchIter func(uintptr, uintptr, uintptr, uintptr) *SequenceIter | |||
| 232 | 322 | // unsorted. | |
| 233 | 323 | func (x *Sequence) SearchIter(DataVar uintptr, IterCmpVar *SequenceIterCompareFunc, CmpDataVar uintptr) *SequenceIter { | |
| 234 | 324 | ||
| 235 | - | cret := xSequenceSearchIter(x.GoPointer(), DataVar, NewCallback(IterCmpVar), CmpDataVar) | |
| 325 | + | var IterCmpVarRef uintptr | |
| 326 | + | if IterCmpVar != nil { | |
| 327 | + | IterCmpVarPtr := uintptr(unsafe.Pointer(IterCmpVar)) | |
| 328 | + | if cbRefPtr, ok := GetCallback(IterCmpVarPtr); ok { | |
| 329 | + | IterCmpVarRef = cbRefPtr | |
| 330 | + | } else { | |
| 331 | + | fcb := func(arg0 *SequenceIter, arg1 *SequenceIter, arg2 uintptr) int { | |
| 332 | + | cbFn := *IterCmpVar | |
| 333 | + | return cbFn(arg0, arg1, arg2) | |
| 334 | + | } | |
| 335 | + | IterCmpVarRef = purego.NewCallback(fcb) | |
| 336 | + | SaveCallback(IterCmpVarPtr, IterCmpVarRef) | |
| 337 | + | } | |
| 338 | + | } | |
| 339 | + | ||
| 340 | + | cret := xSequenceSearchIter(x.GoPointer(), DataVar, IterCmpVarRef, CmpDataVar) | |
| 236 | 341 | return cret | |
| 237 | 342 | } | |
| 238 | 343 | ||
| @@ -246,7 +351,22 @@ var xSequenceSort func(uintptr, uintptr, uintptr) | |||
| 246 | 351 | // if the second comes before the first. | |
| 247 | 352 | func (x *Sequence) Sort(CmpFuncVar *CompareDataFunc, CmpDataVar uintptr) { | |
| 248 | 353 | ||
| 249 | - | xSequenceSort(x.GoPointer(), NewCallback(CmpFuncVar), CmpDataVar) | |
| 354 | + | var CmpFuncVarRef uintptr | |
| 355 | + | if CmpFuncVar != nil { | |
| 356 | + | CmpFuncVarPtr := uintptr(unsafe.Pointer(CmpFuncVar)) | |
| 357 | + | if cbRefPtr, ok := GetCallback(CmpFuncVarPtr); ok { | |
| 358 | + | CmpFuncVarRef = cbRefPtr | |
| 359 | + | } else { | |
| 360 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 361 | + | cbFn := *CmpFuncVar | |
| 362 | + | return cbFn(arg0, arg1, arg2) | |
| 363 | + | } | |
| 364 | + | CmpFuncVarRef = purego.NewCallback(fcb) | |
| 365 | + | SaveCallback(CmpFuncVarPtr, CmpFuncVarRef) | |
| 366 | + | } | |
| 367 | + | } | |
| 368 | + | ||
| 369 | + | xSequenceSort(x.GoPointer(), CmpFuncVarRef, CmpDataVar) | |
| 250 | 370 | ||
| 251 | 371 | } | |
| 252 | 372 | ||
| @@ -261,7 +381,22 @@ var xSequenceSortIter func(uintptr, uintptr, uintptr) | |||
| 261 | 381 | // iterator comes before the first. | |
| 262 | 382 | func (x *Sequence) SortIter(CmpFuncVar *SequenceIterCompareFunc, CmpDataVar uintptr) { | |
| 263 | 383 | ||
| 264 | - | xSequenceSortIter(x.GoPointer(), NewCallback(CmpFuncVar), CmpDataVar) | |
| 384 | + | var CmpFuncVarRef uintptr | |
| 385 | + | if CmpFuncVar != nil { | |
| 386 | + | CmpFuncVarPtr := uintptr(unsafe.Pointer(CmpFuncVar)) | |
| 387 | + | if cbRefPtr, ok := GetCallback(CmpFuncVarPtr); ok { | |
| 388 | + | CmpFuncVarRef = cbRefPtr | |
| 389 | + | } else { | |
| 390 | + | fcb := func(arg0 *SequenceIter, arg1 *SequenceIter, arg2 uintptr) int { | |
| 391 | + | cbFn := *CmpFuncVar | |
| 392 | + | return cbFn(arg0, arg1, arg2) | |
| 393 | + | } | |
| 394 | + | CmpFuncVarRef = purego.NewCallback(fcb) | |
| 395 | + | SaveCallback(CmpFuncVarPtr, CmpFuncVarRef) | |
| 396 | + | } | |
| 397 | + | } | |
| 398 | + | ||
| 399 | + | xSequenceSortIter(x.GoPointer(), CmpFuncVarRef, CmpDataVar) | |
| 265 | 400 | ||
| 266 | 401 | } | |
| 267 | 402 | ||
| @@ -362,7 +497,22 @@ var xSequenceForeachRange func(*SequenceIter, *SequenceIter, uintptr, uintptr) | |||
| 362 | 497 | // itself. | |
| 363 | 498 | func SequenceForeachRange(BeginVar *SequenceIter, EndVar *SequenceIter, FuncVar *Func, UserDataVar uintptr) { | |
| 364 | 499 | ||
| 365 | - | xSequenceForeachRange(BeginVar, EndVar, NewCallback(FuncVar), UserDataVar) | |
| 500 | + | var FuncVarRef uintptr | |
| 501 | + | if FuncVar != nil { | |
| 502 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 503 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 504 | + | FuncVarRef = cbRefPtr | |
| 505 | + | } else { | |
| 506 | + | fcb := func(arg0 uintptr, arg1 uintptr) { | |
| 507 | + | cbFn := *FuncVar | |
| 508 | + | cbFn(arg0, arg1) | |
| 509 | + | } | |
| 510 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 511 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 512 | + | } | |
| 513 | + | } | |
| 514 | + | ||
| 515 | + | xSequenceForeachRange(BeginVar, EndVar, FuncVarRef, UserDataVar) | |
| 366 | 516 | ||
| 367 | 517 | } | |
| 368 | 518 | ||
| @@ -476,7 +626,22 @@ var xSequenceSortChanged func(*SequenceIter, uintptr, uintptr) | |||
| 476 | 626 | // the second item comes before the first. | |
| 477 | 627 | func SequenceSortChanged(IterVar *SequenceIter, CmpFuncVar *CompareDataFunc, CmpDataVar uintptr) { | |
| 478 | 628 | ||
| 479 | - | xSequenceSortChanged(IterVar, NewCallback(CmpFuncVar), CmpDataVar) | |
| 629 | + | var CmpFuncVarRef uintptr | |
| 630 | + | if CmpFuncVar != nil { | |
| 631 | + | CmpFuncVarPtr := uintptr(unsafe.Pointer(CmpFuncVar)) | |
| 632 | + | if cbRefPtr, ok := GetCallback(CmpFuncVarPtr); ok { | |
| 633 | + | CmpFuncVarRef = cbRefPtr | |
| 634 | + | } else { | |
| 635 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 636 | + | cbFn := *CmpFuncVar | |
| 637 | + | return cbFn(arg0, arg1, arg2) | |
| 638 | + | } | |
| 639 | + | CmpFuncVarRef = purego.NewCallback(fcb) | |
| 640 | + | SaveCallback(CmpFuncVarPtr, CmpFuncVarRef) | |
| 641 | + | } | |
| 642 | + | } | |
| 643 | + | ||
| 644 | + | xSequenceSortChanged(IterVar, CmpFuncVarRef, CmpDataVar) | |
| 480 | 645 | ||
| 481 | 646 | } | |
| 482 | 647 | ||
| @@ -493,7 +658,22 @@ var xSequenceSortChangedIter func(*SequenceIter, uintptr, uintptr) | |||
| 493 | 658 | // iterator comes before the first. | |
| 494 | 659 | func SequenceSortChangedIter(IterVar *SequenceIter, IterCmpVar *SequenceIterCompareFunc, CmpDataVar uintptr) { | |
| 495 | 660 | ||
| 496 | - | xSequenceSortChangedIter(IterVar, NewCallback(IterCmpVar), CmpDataVar) | |
| 661 | + | var IterCmpVarRef uintptr | |
| 662 | + | if IterCmpVar != nil { | |
| 663 | + | IterCmpVarPtr := uintptr(unsafe.Pointer(IterCmpVar)) | |
| 664 | + | if cbRefPtr, ok := GetCallback(IterCmpVarPtr); ok { | |
| 665 | + | IterCmpVarRef = cbRefPtr | |
| 666 | + | } else { | |
| 667 | + | fcb := func(arg0 *SequenceIter, arg1 *SequenceIter, arg2 uintptr) int { | |
| 668 | + | cbFn := *IterCmpVar | |
| 669 | + | return cbFn(arg0, arg1, arg2) | |
| 670 | + | } | |
| 671 | + | IterCmpVarRef = purego.NewCallback(fcb) | |
| 672 | + | SaveCallback(IterCmpVarPtr, IterCmpVarRef) | |
| 673 | + | } | |
| 674 | + | } | |
| 675 | + | ||
| 676 | + | xSequenceSortChangedIter(IterVar, IterCmpVarRef, CmpDataVar) | |
| 497 | 677 | ||
| 498 | 678 | } | |
| 499 | 679 | ||
M v4/glib/gslist.go +16 -1
| @@ -30,7 +30,22 @@ var xClearSlist func(**SList, uintptr) | |||
| 30 | 30 | // @slist_ptr must be a valid pointer. If @slist_ptr points to a null #GSList, this does nothing. | |
| 31 | 31 | func ClearSlist(SlistPtrVar **SList, DestroyVar *DestroyNotify) { | |
| 32 | 32 | ||
| 33 | - | xClearSlist(SlistPtrVar, NewCallbackNullable(DestroyVar)) | |
| 33 | + | var DestroyVarRef uintptr | |
| 34 | + | if DestroyVar != nil { | |
| 35 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 36 | + | if cbRefPtr, ok := GetCallback(DestroyVarPtr); ok { | |
| 37 | + | DestroyVarRef = cbRefPtr | |
| 38 | + | } else { | |
| 39 | + | fcb := func(arg0 uintptr) { | |
| 40 | + | cbFn := *DestroyVar | |
| 41 | + | cbFn(arg0) | |
| 42 | + | } | |
| 43 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 44 | + | SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 45 | + | } | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | xClearSlist(SlistPtrVar, DestroyVarRef) | |
| 34 | 49 | ||
| 35 | 50 | } | |
| 36 | 51 | ||
M v4/glib/gspawn.go +92 -15
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | package glib | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 5 | 7 | "github.com/jwijenbergh/purego" | |
| 6 | 8 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 9 | ) | |
| @@ -134,7 +136,7 @@ const ( | |||
| 134 | 136 | GSpawnErrorFailedValue SpawnError = 19 | |
| 135 | 137 | ) | |
| 136 | 138 | ||
| 137 | - | var xSpawnAsync func(string, []string, []string, SpawnFlags, uintptr, uintptr, *Pid, **Error) bool | |
| 139 | + | var xSpawnAsync func(uintptr, []string, []string, SpawnFlags, uintptr, uintptr, *Pid, **Error) bool | |
| 138 | 140 | ||
| 139 | 141 | // Executes a child program asynchronously. | |
| 140 | 142 | // | |
| @@ -153,10 +155,25 @@ var xSpawnAsync func(string, []string, []string, SpawnFlags, uintptr, uintptr, * | |||
| 153 | 155 | // Note that the returned @child_pid on Windows is a handle to the child | |
| 154 | 156 | // process and not its identifier. Process handles and process identifiers | |
| 155 | 157 | // are different concepts on Windows. | |
| 156 | - | func SpawnAsync(WorkingDirectoryVar string, ArgvVar []string, EnvpVar []string, FlagsVar SpawnFlags, ChildSetupVar *SpawnChildSetupFunc, UserDataVar uintptr, ChildPidVar *Pid) (bool, error) { | |
| 158 | + | func SpawnAsync(WorkingDirectoryVar *string, ArgvVar []string, EnvpVar []string, FlagsVar SpawnFlags, ChildSetupVar *SpawnChildSetupFunc, UserDataVar uintptr, ChildPidVar *Pid) (bool, error) { | |
| 157 | 159 | var cerr *Error | |
| 158 | 160 | ||
| 159 | - | cret := xSpawnAsync(WorkingDirectoryVar, ArgvVar, EnvpVar, FlagsVar, NewCallbackNullable(ChildSetupVar), UserDataVar, ChildPidVar, &cerr) | |
| 161 | + | var ChildSetupVarRef uintptr | |
| 162 | + | if ChildSetupVar != nil { | |
| 163 | + | ChildSetupVarPtr := uintptr(unsafe.Pointer(ChildSetupVar)) | |
| 164 | + | if cbRefPtr, ok := GetCallback(ChildSetupVarPtr); ok { | |
| 165 | + | ChildSetupVarRef = cbRefPtr | |
| 166 | + | } else { | |
| 167 | + | fcb := func(arg0 uintptr) { | |
| 168 | + | cbFn := *ChildSetupVar | |
| 169 | + | cbFn(arg0) | |
| 170 | + | } | |
| 171 | + | ChildSetupVarRef = purego.NewCallback(fcb) | |
| 172 | + | SaveCallback(ChildSetupVarPtr, ChildSetupVarRef) | |
| 173 | + | } | |
| 174 | + | } | |
| 175 | + | ||
| 176 | + | cret := xSpawnAsync(core.NullableStringToPtr(WorkingDirectoryVar), ArgvVar, EnvpVar, FlagsVar, ChildSetupVarRef, UserDataVar, ChildPidVar, &cerr) | |
| 160 | 177 | if cerr == nil { | |
| 161 | 178 | return cret, nil | |
| 162 | 179 | } | |
| @@ -164,16 +181,31 @@ func SpawnAsync(WorkingDirectoryVar string, ArgvVar []string, EnvpVar []string, | |||
| 164 | 181 | ||
| 165 | 182 | } | |
| 166 | 183 | ||
| 167 | - | var xSpawnAsyncWithFds func(string, []string, []string, SpawnFlags, uintptr, uintptr, *Pid, int, int, int, **Error) bool | |
| 184 | + | var xSpawnAsyncWithFds func(uintptr, []string, []string, SpawnFlags, uintptr, uintptr, *Pid, int, int, int, **Error) bool | |
| 168 | 185 | ||
| 169 | 186 | // Executes a child program asynchronously. | |
| 170 | 187 | // | |
| 171 | 188 | // Identical to g_spawn_async_with_pipes_and_fds() but with `n_fds` set to zero, | |
| 172 | 189 | // so no FD assignments are used. | |
| 173 | - | func SpawnAsyncWithFds(WorkingDirectoryVar string, ArgvVar []string, EnvpVar []string, FlagsVar SpawnFlags, ChildSetupVar *SpawnChildSetupFunc, UserDataVar uintptr, ChildPidVar *Pid, StdinFdVar int, StdoutFdVar int, StderrFdVar int) (bool, error) { | |
| 190 | + | func SpawnAsyncWithFds(WorkingDirectoryVar *string, ArgvVar []string, EnvpVar []string, FlagsVar SpawnFlags, ChildSetupVar *SpawnChildSetupFunc, UserDataVar uintptr, ChildPidVar *Pid, StdinFdVar int, StdoutFdVar int, StderrFdVar int) (bool, error) { | |
| 174 | 191 | var cerr *Error | |
| 175 | 192 | ||
| 176 | - | cret := xSpawnAsyncWithFds(WorkingDirectoryVar, ArgvVar, EnvpVar, FlagsVar, NewCallbackNullable(ChildSetupVar), UserDataVar, ChildPidVar, StdinFdVar, StdoutFdVar, StderrFdVar, &cerr) | |
| 193 | + | var ChildSetupVarRef uintptr | |
| 194 | + | if ChildSetupVar != nil { | |
| 195 | + | ChildSetupVarPtr := uintptr(unsafe.Pointer(ChildSetupVar)) | |
| 196 | + | if cbRefPtr, ok := GetCallback(ChildSetupVarPtr); ok { | |
| 197 | + | ChildSetupVarRef = cbRefPtr | |
| 198 | + | } else { | |
| 199 | + | fcb := func(arg0 uintptr) { | |
| 200 | + | cbFn := *ChildSetupVar | |
| 201 | + | cbFn(arg0) | |
| 202 | + | } | |
| 203 | + | ChildSetupVarRef = purego.NewCallback(fcb) | |
| 204 | + | SaveCallback(ChildSetupVarPtr, ChildSetupVarRef) | |
| 205 | + | } | |
| 206 | + | } | |
| 207 | + | ||
| 208 | + | cret := xSpawnAsyncWithFds(core.NullableStringToPtr(WorkingDirectoryVar), ArgvVar, EnvpVar, FlagsVar, ChildSetupVarRef, UserDataVar, ChildPidVar, StdinFdVar, StdoutFdVar, StderrFdVar, &cerr) | |
| 177 | 209 | if cerr == nil { | |
| 178 | 210 | return cret, nil | |
| 179 | 211 | } | |
| @@ -181,14 +213,29 @@ func SpawnAsyncWithFds(WorkingDirectoryVar string, ArgvVar []string, EnvpVar []s | |||
| 181 | 213 | ||
| 182 | 214 | } | |
| 183 | 215 | ||
| 184 | - | var xSpawnAsyncWithPipes func(string, []string, []string, SpawnFlags, uintptr, uintptr, *Pid, *int, *int, *int, **Error) bool | |
| 216 | + | var xSpawnAsyncWithPipes func(uintptr, []string, []string, SpawnFlags, uintptr, uintptr, *Pid, *int, *int, *int, **Error) bool | |
| 185 | 217 | ||
| 186 | 218 | // Identical to g_spawn_async_with_pipes_and_fds() but with `n_fds` set to zero, | |
| 187 | 219 | // so no FD assignments are used. | |
| 188 | - | func SpawnAsyncWithPipes(WorkingDirectoryVar string, ArgvVar []string, EnvpVar []string, FlagsVar SpawnFlags, ChildSetupVar *SpawnChildSetupFunc, UserDataVar uintptr, ChildPidVar *Pid, StandardInputVar *int, StandardOutputVar *int, StandardErrorVar *int) (bool, error) { | |
| 220 | + | func SpawnAsyncWithPipes(WorkingDirectoryVar *string, ArgvVar []string, EnvpVar []string, FlagsVar SpawnFlags, ChildSetupVar *SpawnChildSetupFunc, UserDataVar uintptr, ChildPidVar *Pid, StandardInputVar *int, StandardOutputVar *int, StandardErrorVar *int) (bool, error) { | |
| 189 | 221 | var cerr *Error | |
| 190 | 222 | ||
| 191 | - | cret := xSpawnAsyncWithPipes(WorkingDirectoryVar, ArgvVar, EnvpVar, FlagsVar, NewCallbackNullable(ChildSetupVar), UserDataVar, ChildPidVar, StandardInputVar, StandardOutputVar, StandardErrorVar, &cerr) | |
| 223 | + | var ChildSetupVarRef uintptr | |
| 224 | + | if ChildSetupVar != nil { | |
| 225 | + | ChildSetupVarPtr := uintptr(unsafe.Pointer(ChildSetupVar)) | |
| 226 | + | if cbRefPtr, ok := GetCallback(ChildSetupVarPtr); ok { | |
| 227 | + | ChildSetupVarRef = cbRefPtr | |
| 228 | + | } else { | |
| 229 | + | fcb := func(arg0 uintptr) { | |
| 230 | + | cbFn := *ChildSetupVar | |
| 231 | + | cbFn(arg0) | |
| 232 | + | } | |
| 233 | + | ChildSetupVarRef = purego.NewCallback(fcb) | |
| 234 | + | SaveCallback(ChildSetupVarPtr, ChildSetupVarRef) | |
| 235 | + | } | |
| 236 | + | } | |
| 237 | + | ||
| 238 | + | cret := xSpawnAsyncWithPipes(core.NullableStringToPtr(WorkingDirectoryVar), ArgvVar, EnvpVar, FlagsVar, ChildSetupVarRef, UserDataVar, ChildPidVar, StandardInputVar, StandardOutputVar, StandardErrorVar, &cerr) | |
| 192 | 239 | if cerr == nil { | |
| 193 | 240 | return cret, nil | |
| 194 | 241 | } | |
| @@ -196,7 +243,7 @@ func SpawnAsyncWithPipes(WorkingDirectoryVar string, ArgvVar []string, EnvpVar [ | |||
| 196 | 243 | ||
| 197 | 244 | } | |
| 198 | 245 | ||
| 199 | - | var xSpawnAsyncWithPipesAndFds func(string, []string, []string, SpawnFlags, uintptr, uintptr, int, int, int, []int, []int, uint, *Pid, *int, *int, *int, **Error) bool | |
| 246 | + | var xSpawnAsyncWithPipesAndFds func(uintptr, []string, []string, SpawnFlags, uintptr, uintptr, int, int, int, []int, []int, uint, *Pid, *int, *int, *int, **Error) bool | |
| 200 | 247 | ||
| 201 | 248 | // Executes a child program asynchronously (your program will not | |
| 202 | 249 | // block waiting for the child to exit). | |
| @@ -392,10 +439,25 @@ var xSpawnAsyncWithPipesAndFds func(string, []string, []string, SpawnFlags, uint | |||
| 392 | 439 | // graphical application too, then to ensure that the spawned program opens its | |
| 393 | 440 | // windows on the right screen, you may want to use #GdkAppLaunchContext, | |
| 394 | 441 | // #GAppLaunchContext, or set the `DISPLAY` environment variable. | |
| 395 | - | func SpawnAsyncWithPipesAndFds(WorkingDirectoryVar string, ArgvVar []string, EnvpVar []string, FlagsVar SpawnFlags, ChildSetupVar *SpawnChildSetupFunc, UserDataVar uintptr, StdinFdVar int, StdoutFdVar int, StderrFdVar int, SourceFdsVar []int, TargetFdsVar []int, NFdsVar uint, ChildPidOutVar *Pid, StdinPipeOutVar *int, StdoutPipeOutVar *int, StderrPipeOutVar *int) (bool, error) { | |
| 442 | + | func SpawnAsyncWithPipesAndFds(WorkingDirectoryVar *string, ArgvVar []string, EnvpVar []string, FlagsVar SpawnFlags, ChildSetupVar *SpawnChildSetupFunc, UserDataVar uintptr, StdinFdVar int, StdoutFdVar int, StderrFdVar int, SourceFdsVar []int, TargetFdsVar []int, NFdsVar uint, ChildPidOutVar *Pid, StdinPipeOutVar *int, StdoutPipeOutVar *int, StderrPipeOutVar *int) (bool, error) { | |
| 396 | 443 | var cerr *Error | |
| 397 | 444 | ||
| 398 | - | cret := xSpawnAsyncWithPipesAndFds(WorkingDirectoryVar, ArgvVar, EnvpVar, FlagsVar, NewCallbackNullable(ChildSetupVar), UserDataVar, StdinFdVar, StdoutFdVar, StderrFdVar, SourceFdsVar, TargetFdsVar, NFdsVar, ChildPidOutVar, StdinPipeOutVar, StdoutPipeOutVar, StderrPipeOutVar, &cerr) | |
| 445 | + | var ChildSetupVarRef uintptr | |
| 446 | + | if ChildSetupVar != nil { | |
| 447 | + | ChildSetupVarPtr := uintptr(unsafe.Pointer(ChildSetupVar)) | |
| 448 | + | if cbRefPtr, ok := GetCallback(ChildSetupVarPtr); ok { | |
| 449 | + | ChildSetupVarRef = cbRefPtr | |
| 450 | + | } else { | |
| 451 | + | fcb := func(arg0 uintptr) { | |
| 452 | + | cbFn := *ChildSetupVar | |
| 453 | + | cbFn(arg0) | |
| 454 | + | } | |
| 455 | + | ChildSetupVarRef = purego.NewCallback(fcb) | |
| 456 | + | SaveCallback(ChildSetupVarPtr, ChildSetupVarRef) | |
| 457 | + | } | |
| 458 | + | } | |
| 459 | + | ||
| 460 | + | cret := xSpawnAsyncWithPipesAndFds(core.NullableStringToPtr(WorkingDirectoryVar), ArgvVar, EnvpVar, FlagsVar, ChildSetupVarRef, UserDataVar, StdinFdVar, StdoutFdVar, StderrFdVar, SourceFdsVar, TargetFdsVar, NFdsVar, ChildPidOutVar, StdinPipeOutVar, StdoutPipeOutVar, StderrPipeOutVar, &cerr) | |
| 399 | 461 | if cerr == nil { | |
| 400 | 462 | return cret, nil | |
| 401 | 463 | } | |
| @@ -553,7 +615,7 @@ func SpawnCommandLineSync(CommandLineVar string, StandardOutputVar *[]byte, Stan | |||
| 553 | 615 | ||
| 554 | 616 | } | |
| 555 | 617 | ||
| 556 | - | var xSpawnSync func(string, []string, []string, SpawnFlags, uintptr, uintptr, *[]byte, *[]byte, *int, **Error) bool | |
| 618 | + | var xSpawnSync func(uintptr, []string, []string, SpawnFlags, uintptr, uintptr, *[]byte, *[]byte, *int, **Error) bool | |
| 557 | 619 | ||
| 558 | 620 | // Executes a child synchronously (waits for the child to exit before returning). | |
| 559 | 621 | // | |
| @@ -578,10 +640,25 @@ var xSpawnSync func(string, []string, []string, SpawnFlags, uintptr, uintptr, *[ | |||
| 578 | 640 | // This function calls g_spawn_async_with_pipes() internally; see that | |
| 579 | 641 | // function for full details on the other parameters and details on | |
| 580 | 642 | // how these functions work on Windows. | |
| 581 | - | func SpawnSync(WorkingDirectoryVar string, ArgvVar []string, EnvpVar []string, FlagsVar SpawnFlags, ChildSetupVar *SpawnChildSetupFunc, UserDataVar uintptr, StandardOutputVar *[]byte, StandardErrorVar *[]byte, WaitStatusVar *int) (bool, error) { | |
| 643 | + | func SpawnSync(WorkingDirectoryVar *string, ArgvVar []string, EnvpVar []string, FlagsVar SpawnFlags, ChildSetupVar *SpawnChildSetupFunc, UserDataVar uintptr, StandardOutputVar *[]byte, StandardErrorVar *[]byte, WaitStatusVar *int) (bool, error) { | |
| 582 | 644 | var cerr *Error | |
| 583 | 645 | ||
| 584 | - | cret := xSpawnSync(WorkingDirectoryVar, ArgvVar, EnvpVar, FlagsVar, NewCallbackNullable(ChildSetupVar), UserDataVar, StandardOutputVar, StandardErrorVar, WaitStatusVar, &cerr) | |
| 646 | + | var ChildSetupVarRef uintptr | |
| 647 | + | if ChildSetupVar != nil { | |
| 648 | + | ChildSetupVarPtr := uintptr(unsafe.Pointer(ChildSetupVar)) | |
| 649 | + | if cbRefPtr, ok := GetCallback(ChildSetupVarPtr); ok { | |
| 650 | + | ChildSetupVarRef = cbRefPtr | |
| 651 | + | } else { | |
| 652 | + | fcb := func(arg0 uintptr) { | |
| 653 | + | cbFn := *ChildSetupVar | |
| 654 | + | cbFn(arg0) | |
| 655 | + | } | |
| 656 | + | ChildSetupVarRef = purego.NewCallback(fcb) | |
| 657 | + | SaveCallback(ChildSetupVarPtr, ChildSetupVarRef) | |
| 658 | + | } | |
| 659 | + | } | |
| 660 | + | ||
| 661 | + | cret := xSpawnSync(core.NullableStringToPtr(WorkingDirectoryVar), ArgvVar, EnvpVar, FlagsVar, ChildSetupVarRef, UserDataVar, StandardOutputVar, StandardErrorVar, WaitStatusVar, &cerr) | |
| 585 | 662 | if cerr == nil { | |
| 586 | 663 | return cret, nil | |
| 587 | 664 | } | |
M v4/glib/gstrfuncs.go +24 -24
| @@ -480,7 +480,7 @@ func StrMatchString(SearchTermVar string, PotentialHitVar string, AcceptAlternat | |||
| 480 | 480 | return cret | |
| 481 | 481 | } | |
| 482 | 482 | ||
| 483 | - | var xStrToAscii func(string, string) string | |
| 483 | + | var xStrToAscii func(string, uintptr) string | |
| 484 | 484 | ||
| 485 | 485 | // Transliterate @str to plain ASCII. | |
| 486 | 486 | // | |
| @@ -500,13 +500,13 @@ var xStrToAscii func(string, string) string | |||
| 500 | 500 | // If you want to do translation for no specific locale, and you want it | |
| 501 | 501 | // to be done independently of the currently locale, specify `"C"` for | |
| 502 | 502 | // @from_locale. | |
| 503 | - | func StrToAscii(StrVar string, FromLocaleVar string) string { | |
| 503 | + | func StrToAscii(StrVar string, FromLocaleVar *string) string { | |
| 504 | 504 | ||
| 505 | - | cret := xStrToAscii(StrVar, FromLocaleVar) | |
| 505 | + | cret := xStrToAscii(StrVar, core.NullableStringToPtr(FromLocaleVar)) | |
| 506 | 506 | return cret | |
| 507 | 507 | } | |
| 508 | 508 | ||
| 509 | - | var xStrTokenizeAndFold func(string, string, *[]string) []string | |
| 509 | + | var xStrTokenizeAndFold func(string, uintptr, *[]string) []string | |
| 510 | 510 | ||
| 511 | 511 | // Tokenizes @string and performs folding on each token. | |
| 512 | 512 | // | |
| @@ -523,9 +523,9 @@ var xStrTokenizeAndFold func(string, string, *[]string) []string | |||
| 523 | 523 | // for doing so is unspecified, but @translit_locale (if specified) may | |
| 524 | 524 | // improve the transliteration if the language of the source string is | |
| 525 | 525 | // known. | |
| 526 | - | func StrTokenizeAndFold(StringVar string, TranslitLocaleVar string, AsciiAlternatesVar *[]string) []string { | |
| 526 | + | func StrTokenizeAndFold(StringVar string, TranslitLocaleVar *string, AsciiAlternatesVar *[]string) []string { | |
| 527 | 527 | ||
| 528 | - | cret := xStrTokenizeAndFold(StringVar, TranslitLocaleVar, AsciiAlternatesVar) | |
| 528 | + | cret := xStrTokenizeAndFold(StringVar, core.NullableStringToPtr(TranslitLocaleVar), AsciiAlternatesVar) | |
| 529 | 529 | return cret | |
| 530 | 530 | } | |
| 531 | 531 | ||
| @@ -635,7 +635,7 @@ func Strconcat(String1Var string, varArgs ...interface{}) string { | |||
| 635 | 635 | return cret | |
| 636 | 636 | } | |
| 637 | 637 | ||
| 638 | - | var xStrdelimit func(string, string, byte) string | |
| 638 | + | var xStrdelimit func(string, uintptr, byte) string | |
| 639 | 639 | ||
| 640 | 640 | // Converts any delimiter characters in @string to @new_delimiter. | |
| 641 | 641 | // | |
| @@ -654,9 +654,9 @@ var xStrdelimit func(string, string, byte) string | |||
| 654 | 654 | // … | |
| 655 | 655 | // g_free (reformatted); | |
| 656 | 656 | // ``` | |
| 657 | - | func Strdelimit(StringVar string, DelimitersVar string, NewDelimiterVar byte) string { | |
| 657 | + | func Strdelimit(StringVar string, DelimitersVar *string, NewDelimiterVar byte) string { | |
| 658 | 658 | ||
| 659 | - | cret := xStrdelimit(StringVar, DelimitersVar, NewDelimiterVar) | |
| 659 | + | cret := xStrdelimit(StringVar, core.NullableStringToPtr(DelimitersVar), NewDelimiterVar) | |
| 660 | 660 | return cret | |
| 661 | 661 | } | |
| 662 | 662 | ||
| @@ -669,12 +669,12 @@ func Strdown(StringVar string) string { | |||
| 669 | 669 | return cret | |
| 670 | 670 | } | |
| 671 | 671 | ||
| 672 | - | var xStrdup func(string) string | |
| 672 | + | var xStrdup func(uintptr) string | |
| 673 | 673 | ||
| 674 | 674 | // Duplicates a string. If @str is `NULL` it returns `NULL`. | |
| 675 | - | func Strdup(StrVar string) string { | |
| 675 | + | func Strdup(StrVar *string) string { | |
| 676 | 676 | ||
| 677 | - | cret := xStrdup(StrVar) | |
| 677 | + | cret := xStrdup(core.NullableStringToPtr(StrVar)) | |
| 678 | 678 | return cret | |
| 679 | 679 | } | |
| 680 | 680 | ||
| @@ -752,7 +752,7 @@ func Strerror(ErrnumVar int) string { | |||
| 752 | 752 | return cret | |
| 753 | 753 | } | |
| 754 | 754 | ||
| 755 | - | var xStrescape func(string, string) string | |
| 755 | + | var xStrescape func(string, uintptr) string | |
| 756 | 756 | ||
| 757 | 757 | // It replaces the following special characters in the string @source | |
| 758 | 758 | // with their corresponding C escape sequence: | |
| @@ -773,9 +773,9 @@ var xStrescape func(string, string) string | |||
| 773 | 773 | // Characters supplied in @exceptions are not escaped. | |
| 774 | 774 | // | |
| 775 | 775 | // [func@GLib.strcompress] does the reverse conversion. | |
| 776 | - | func Strescape(SourceVar string, ExceptionsVar string) string { | |
| 776 | + | func Strescape(SourceVar string, ExceptionsVar *string) string { | |
| 777 | 777 | ||
| 778 | - | cret := xStrescape(SourceVar, ExceptionsVar) | |
| 778 | + | cret := xStrescape(SourceVar, core.NullableStringToPtr(ExceptionsVar)) | |
| 779 | 779 | return cret | |
| 780 | 780 | } | |
| 781 | 781 | ||
| @@ -790,17 +790,17 @@ func Strfreev(StrArrayVar []string) { | |||
| 790 | 790 | ||
| 791 | 791 | } | |
| 792 | 792 | ||
| 793 | - | var xStrjoin func(string, ...interface{}) string | |
| 793 | + | var xStrjoin func(uintptr, ...interface{}) string | |
| 794 | 794 | ||
| 795 | 795 | // Joins a number of strings together to form one long string, with the | |
| 796 | 796 | // optional @separator inserted between each of them. | |
| 797 | - | func Strjoin(SeparatorVar string, varArgs ...interface{}) string { | |
| 797 | + | func Strjoin(SeparatorVar *string, varArgs ...interface{}) string { | |
| 798 | 798 | ||
| 799 | - | cret := xStrjoin(SeparatorVar, varArgs...) | |
| 799 | + | cret := xStrjoin(core.NullableStringToPtr(SeparatorVar), varArgs...) | |
| 800 | 800 | return cret | |
| 801 | 801 | } | |
| 802 | 802 | ||
| 803 | - | var xStrjoinv func(string, []string) string | |
| 803 | + | var xStrjoinv func(uintptr, []string) string | |
| 804 | 804 | ||
| 805 | 805 | // Joins an array of strings together to form one long string, with the | |
| 806 | 806 | // optional @separator inserted between each of them. | |
| @@ -808,9 +808,9 @@ var xStrjoinv func(string, []string) string | |||
| 808 | 808 | // If @str_array has no items, the return value will be an | |
| 809 | 809 | // empty string. If @str_array contains a single item, @separator will not | |
| 810 | 810 | // appear in the resulting string. | |
| 811 | - | func Strjoinv(SeparatorVar string, StrArrayVar []string) string { | |
| 811 | + | func Strjoinv(SeparatorVar *string, StrArrayVar []string) string { | |
| 812 | 812 | ||
| 813 | - | cret := xStrjoinv(SeparatorVar, StrArrayVar) | |
| 813 | + | cret := xStrjoinv(core.NullableStringToPtr(SeparatorVar), StrArrayVar) | |
| 814 | 814 | return cret | |
| 815 | 815 | } | |
| 816 | 816 | ||
| @@ -869,7 +869,7 @@ func Strncasecmp(S1Var string, S2Var string, NVar uint) int { | |||
| 869 | 869 | return cret | |
| 870 | 870 | } | |
| 871 | 871 | ||
| 872 | - | var xStrndup func(string, uint) string | |
| 872 | + | var xStrndup func(uintptr, uint) string | |
| 873 | 873 | ||
| 874 | 874 | // Duplicates the first @n bytes of a string, returning a newly-allocated | |
| 875 | 875 | // buffer @n + 1 bytes long which will always be nul-terminated. If @str | |
| @@ -878,9 +878,9 @@ var xStrndup func(string, uint) string | |||
| 878 | 878 | // | |
| 879 | 879 | // To copy a number of characters from a UTF-8 encoded string, | |
| 880 | 880 | // use [func@GLib.utf8_strncpy] instead. | |
| 881 | - | func Strndup(StrVar string, NVar uint) string { | |
| 881 | + | func Strndup(StrVar *string, NVar uint) string { | |
| 882 | 882 | ||
| 883 | - | cret := xStrndup(StrVar, NVar) | |
| 883 | + | cret := xStrndup(core.NullableStringToPtr(StrVar), NVar) | |
| 884 | 884 | return cret | |
| 885 | 885 | } | |
| 886 | 886 | ||
M v4/glib/gstring.go +6 -6
| @@ -40,12 +40,12 @@ func (x *String) GoPointer() uintptr { | |||
| 40 | 40 | return uintptr(unsafe.Pointer(x)) | |
| 41 | 41 | } | |
| 42 | 42 | ||
| 43 | - | var xNewString func(string) *String | |
| 43 | + | var xNewString func(uintptr) *String | |
| 44 | 44 | ||
| 45 | 45 | // Creates a new #GString, initialized with the given string. | |
| 46 | - | func NewString(InitVar string) *String { | |
| 46 | + | func NewString(InitVar *string) *String { | |
| 47 | 47 | ||
| 48 | - | cret := xNewString(InitVar) | |
| 48 | + | cret := xNewString(core.NullableStringToPtr(InitVar)) | |
| 49 | 49 | return cret | |
| 50 | 50 | } | |
| 51 | 51 | ||
| @@ -64,16 +64,16 @@ func NewStringLen(InitVar string, LenVar int) *String { | |||
| 64 | 64 | return cret | |
| 65 | 65 | } | |
| 66 | 66 | ||
| 67 | - | var xNewStringTake func(string) *String | |
| 67 | + | var xNewStringTake func(uintptr) *String | |
| 68 | 68 | ||
| 69 | 69 | // Creates a new #GString, initialized with the given string. | |
| 70 | 70 | // | |
| 71 | 71 | // After this call, @init belongs to the #GString and may no longer be | |
| 72 | 72 | // modified by the caller. The memory of @init has to be dynamically | |
| 73 | 73 | // allocated and will eventually be freed with g_free(). | |
| 74 | - | func NewStringTake(InitVar string) *String { | |
| 74 | + | func NewStringTake(InitVar *string) *String { | |
| 75 | 75 | ||
| 76 | - | cret := xNewStringTake(InitVar) | |
| 76 | + | cret := xNewStringTake(core.NullableStringToPtr(InitVar)) | |
| 77 | 77 | return cret | |
| 78 | 78 | } | |
| 79 | 79 | ||
M v4/glib/gtestutils.go +208 -28
| @@ -379,25 +379,25 @@ func AssertionMessageError(DomainVar string, FileVar string, LineVar int, FuncVa | |||
| 379 | 379 | ||
| 380 | 380 | } | |
| 381 | 381 | ||
| 382 | - | var xAssertionMessageExpr func(string, string, int, string, string) | |
| 382 | + | var xAssertionMessageExpr func(uintptr, string, int, string, uintptr) | |
| 383 | 383 | ||
| 384 | 384 | // Internal function used to print messages from the public | |
| 385 | 385 | // g_assert() and g_assert_not_reached() macros. | |
| 386 | - | func AssertionMessageExpr(DomainVar string, FileVar string, LineVar int, FuncVar string, ExprVar string) { | |
| 386 | + | func AssertionMessageExpr(DomainVar *string, FileVar string, LineVar int, FuncVar string, ExprVar *string) { | |
| 387 | 387 | ||
| 388 | - | xAssertionMessageExpr(DomainVar, FileVar, LineVar, FuncVar, ExprVar) | |
| 388 | + | xAssertionMessageExpr(core.NullableStringToPtr(DomainVar), FileVar, LineVar, FuncVar, core.NullableStringToPtr(ExprVar)) | |
| 389 | 389 | ||
| 390 | 390 | } | |
| 391 | 391 | ||
| 392 | - | var xStrcmp0 func(string, string) int | |
| 392 | + | var xStrcmp0 func(uintptr, uintptr) int | |
| 393 | 393 | ||
| 394 | 394 | // Compares @str1 and @str2 like `strcmp()`. | |
| 395 | 395 | // | |
| 396 | 396 | // Handles `NULL` gracefully by sorting it before non-`NULL` strings. | |
| 397 | 397 | // Comparing two `NULL` pointers returns 0. | |
| 398 | - | func Strcmp0(Str1Var string, Str2Var string) int { | |
| 398 | + | func Strcmp0(Str1Var *string, Str2Var *string) int { | |
| 399 | 399 | ||
| 400 | - | cret := xStrcmp0(Str1Var, Str2Var) | |
| 400 | + | cret := xStrcmp0(core.NullableStringToPtr(Str1Var), core.NullableStringToPtr(Str2Var)) | |
| 401 | 401 | return cret | |
| 402 | 402 | } | |
| 403 | 403 | ||
| @@ -420,7 +420,22 @@ var xTestAddDataFunc func(string, uintptr, uintptr) | |||
| 420 | 420 | // and it is recommended to do so even if it isn’t. | |
| 421 | 421 | func TestAddDataFunc(TestpathVar string, TestDataVar uintptr, TestFuncVar *TestDataFunc) { | |
| 422 | 422 | ||
| 423 | - | xTestAddDataFunc(TestpathVar, TestDataVar, NewCallback(TestFuncVar)) | |
| 423 | + | var TestFuncVarRef uintptr | |
| 424 | + | if TestFuncVar != nil { | |
| 425 | + | TestFuncVarPtr := uintptr(unsafe.Pointer(TestFuncVar)) | |
| 426 | + | if cbRefPtr, ok := GetCallback(TestFuncVarPtr); ok { | |
| 427 | + | TestFuncVarRef = cbRefPtr | |
| 428 | + | } else { | |
| 429 | + | fcb := func(arg0 uintptr) { | |
| 430 | + | cbFn := *TestFuncVar | |
| 431 | + | cbFn(arg0) | |
| 432 | + | } | |
| 433 | + | TestFuncVarRef = purego.NewCallback(fcb) | |
| 434 | + | SaveCallback(TestFuncVarPtr, TestFuncVarRef) | |
| 435 | + | } | |
| 436 | + | } | |
| 437 | + | ||
| 438 | + | xTestAddDataFunc(TestpathVar, TestDataVar, TestFuncVarRef) | |
| 424 | 439 | ||
| 425 | 440 | } | |
| 426 | 441 | ||
| @@ -432,7 +447,37 @@ var xTestAddDataFuncFull func(string, uintptr, uintptr, uintptr) | |||
| 432 | 447 | // is freeing @test_data after the test run is complete. | |
| 433 | 448 | func TestAddDataFuncFull(TestpathVar string, TestDataVar uintptr, TestFuncVar *TestDataFunc, DataFreeFuncVar *DestroyNotify) { | |
| 434 | 449 | ||
| 435 | - | xTestAddDataFuncFull(TestpathVar, TestDataVar, NewCallback(TestFuncVar), NewCallback(DataFreeFuncVar)) | |
| 450 | + | var TestFuncVarRef uintptr | |
| 451 | + | if TestFuncVar != nil { | |
| 452 | + | TestFuncVarPtr := uintptr(unsafe.Pointer(TestFuncVar)) | |
| 453 | + | if cbRefPtr, ok := GetCallback(TestFuncVarPtr); ok { | |
| 454 | + | TestFuncVarRef = cbRefPtr | |
| 455 | + | } else { | |
| 456 | + | fcb := func(arg0 uintptr) { | |
| 457 | + | cbFn := *TestFuncVar | |
| 458 | + | cbFn(arg0) | |
| 459 | + | } | |
| 460 | + | TestFuncVarRef = purego.NewCallback(fcb) | |
| 461 | + | SaveCallback(TestFuncVarPtr, TestFuncVarRef) | |
| 462 | + | } | |
| 463 | + | } | |
| 464 | + | ||
| 465 | + | var DataFreeFuncVarRef uintptr | |
| 466 | + | if DataFreeFuncVar != nil { | |
| 467 | + | DataFreeFuncVarPtr := uintptr(unsafe.Pointer(DataFreeFuncVar)) | |
| 468 | + | if cbRefPtr, ok := GetCallback(DataFreeFuncVarPtr); ok { | |
| 469 | + | DataFreeFuncVarRef = cbRefPtr | |
| 470 | + | } else { | |
| 471 | + | fcb := func(arg0 uintptr) { | |
| 472 | + | cbFn := *DataFreeFuncVar | |
| 473 | + | cbFn(arg0) | |
| 474 | + | } | |
| 475 | + | DataFreeFuncVarRef = purego.NewCallback(fcb) | |
| 476 | + | SaveCallback(DataFreeFuncVarPtr, DataFreeFuncVarRef) | |
| 477 | + | } | |
| 478 | + | } | |
| 479 | + | ||
| 480 | + | xTestAddDataFuncFull(TestpathVar, TestDataVar, TestFuncVarRef, DataFreeFuncVarRef) | |
| 436 | 481 | ||
| 437 | 482 | } | |
| 438 | 483 | ||
| @@ -454,7 +499,22 @@ var xTestAddFunc func(string, uintptr) | |||
| 454 | 499 | // it is recommended to do so even if it isn’t. | |
| 455 | 500 | func TestAddFunc(TestpathVar string, TestFuncVar *TestFunc) { | |
| 456 | 501 | ||
| 457 | - | xTestAddFunc(TestpathVar, NewCallback(TestFuncVar)) | |
| 502 | + | var TestFuncVarRef uintptr | |
| 503 | + | if TestFuncVar != nil { | |
| 504 | + | TestFuncVarPtr := uintptr(unsafe.Pointer(TestFuncVar)) | |
| 505 | + | if cbRefPtr, ok := GetCallback(TestFuncVarPtr); ok { | |
| 506 | + | TestFuncVarRef = cbRefPtr | |
| 507 | + | } else { | |
| 508 | + | fcb := func() { | |
| 509 | + | cbFn := *TestFuncVar | |
| 510 | + | cbFn() | |
| 511 | + | } | |
| 512 | + | TestFuncVarRef = purego.NewCallback(fcb) | |
| 513 | + | SaveCallback(TestFuncVarPtr, TestFuncVarRef) | |
| 514 | + | } | |
| 515 | + | } | |
| 516 | + | ||
| 517 | + | xTestAddFunc(TestpathVar, TestFuncVarRef) | |
| 458 | 518 | ||
| 459 | 519 | } | |
| 460 | 520 | ||
| @@ -462,7 +522,52 @@ var xTestAddVtable func(string, uint, uintptr, uintptr, uintptr, uintptr) | |||
| 462 | 522 | ||
| 463 | 523 | func TestAddVtable(TestpathVar string, DataSizeVar uint, TestDataVar uintptr, DataSetupVar *TestFixtureFunc, DataTestVar *TestFixtureFunc, DataTeardownVar *TestFixtureFunc) { | |
| 464 | 524 | ||
| 465 | - | xTestAddVtable(TestpathVar, DataSizeVar, TestDataVar, NewCallback(DataSetupVar), NewCallback(DataTestVar), NewCallback(DataTeardownVar)) | |
| 525 | + | var DataSetupVarRef uintptr | |
| 526 | + | if DataSetupVar != nil { | |
| 527 | + | DataSetupVarPtr := uintptr(unsafe.Pointer(DataSetupVar)) | |
| 528 | + | if cbRefPtr, ok := GetCallback(DataSetupVarPtr); ok { | |
| 529 | + | DataSetupVarRef = cbRefPtr | |
| 530 | + | } else { | |
| 531 | + | fcb := func(arg0 uintptr, arg1 uintptr) { | |
| 532 | + | cbFn := *DataSetupVar | |
| 533 | + | cbFn(arg0, arg1) | |
| 534 | + | } | |
| 535 | + | DataSetupVarRef = purego.NewCallback(fcb) | |
| 536 | + | SaveCallback(DataSetupVarPtr, DataSetupVarRef) | |
| 537 | + | } | |
| 538 | + | } | |
| 539 | + | ||
| 540 | + | var DataTestVarRef uintptr | |
| 541 | + | if DataTestVar != nil { | |
| 542 | + | DataTestVarPtr := uintptr(unsafe.Pointer(DataTestVar)) | |
| 543 | + | if cbRefPtr, ok := GetCallback(DataTestVarPtr); ok { | |
| 544 | + | DataTestVarRef = cbRefPtr | |
| 545 | + | } else { | |
| 546 | + | fcb := func(arg0 uintptr, arg1 uintptr) { | |
| 547 | + | cbFn := *DataTestVar | |
| 548 | + | cbFn(arg0, arg1) | |
| 549 | + | } | |
| 550 | + | DataTestVarRef = purego.NewCallback(fcb) | |
| 551 | + | SaveCallback(DataTestVarPtr, DataTestVarRef) | |
| 552 | + | } | |
| 553 | + | } | |
| 554 | + | ||
| 555 | + | var DataTeardownVarRef uintptr | |
| 556 | + | if DataTeardownVar != nil { | |
| 557 | + | DataTeardownVarPtr := uintptr(unsafe.Pointer(DataTeardownVar)) | |
| 558 | + | if cbRefPtr, ok := GetCallback(DataTeardownVarPtr); ok { | |
| 559 | + | DataTeardownVarRef = cbRefPtr | |
| 560 | + | } else { | |
| 561 | + | fcb := func(arg0 uintptr, arg1 uintptr) { | |
| 562 | + | cbFn := *DataTeardownVar | |
| 563 | + | cbFn(arg0, arg1) | |
| 564 | + | } | |
| 565 | + | DataTeardownVarRef = purego.NewCallback(fcb) | |
| 566 | + | SaveCallback(DataTeardownVarPtr, DataTeardownVarRef) | |
| 567 | + | } | |
| 568 | + | } | |
| 569 | + | ||
| 570 | + | xTestAddVtable(TestpathVar, DataSizeVar, TestDataVar, DataSetupVarRef, DataTestVarRef, DataTeardownVarRef) | |
| 466 | 571 | ||
| 467 | 572 | } | |
| 468 | 573 | ||
| @@ -566,7 +671,52 @@ var xTestCreateCase func(string, uint, uintptr, uintptr, uintptr, uintptr) *Test | |||
| 566 | 671 | // varying @test_name and @data_test arguments. | |
| 567 | 672 | func TestCreateCase(TestNameVar string, DataSizeVar uint, TestDataVar uintptr, DataSetupVar *TestFixtureFunc, DataTestVar *TestFixtureFunc, DataTeardownVar *TestFixtureFunc) *TestCase { | |
| 568 | 673 | ||
| 569 | - | cret := xTestCreateCase(TestNameVar, DataSizeVar, TestDataVar, NewCallback(DataSetupVar), NewCallback(DataTestVar), NewCallback(DataTeardownVar)) | |
| 674 | + | var DataSetupVarRef uintptr | |
| 675 | + | if DataSetupVar != nil { | |
| 676 | + | DataSetupVarPtr := uintptr(unsafe.Pointer(DataSetupVar)) | |
| 677 | + | if cbRefPtr, ok := GetCallback(DataSetupVarPtr); ok { | |
| 678 | + | DataSetupVarRef = cbRefPtr | |
| 679 | + | } else { | |
| 680 | + | fcb := func(arg0 uintptr, arg1 uintptr) { | |
| 681 | + | cbFn := *DataSetupVar | |
| 682 | + | cbFn(arg0, arg1) | |
| 683 | + | } | |
| 684 | + | DataSetupVarRef = purego.NewCallback(fcb) | |
| 685 | + | SaveCallback(DataSetupVarPtr, DataSetupVarRef) | |
| 686 | + | } | |
| 687 | + | } | |
| 688 | + | ||
| 689 | + | var DataTestVarRef uintptr | |
| 690 | + | if DataTestVar != nil { | |
| 691 | + | DataTestVarPtr := uintptr(unsafe.Pointer(DataTestVar)) | |
| 692 | + | if cbRefPtr, ok := GetCallback(DataTestVarPtr); ok { | |
| 693 | + | DataTestVarRef = cbRefPtr | |
| 694 | + | } else { | |
| 695 | + | fcb := func(arg0 uintptr, arg1 uintptr) { | |
| 696 | + | cbFn := *DataTestVar | |
| 697 | + | cbFn(arg0, arg1) | |
| 698 | + | } | |
| 699 | + | DataTestVarRef = purego.NewCallback(fcb) | |
| 700 | + | SaveCallback(DataTestVarPtr, DataTestVarRef) | |
| 701 | + | } | |
| 702 | + | } | |
| 703 | + | ||
| 704 | + | var DataTeardownVarRef uintptr | |
| 705 | + | if DataTeardownVar != nil { | |
| 706 | + | DataTeardownVarPtr := uintptr(unsafe.Pointer(DataTeardownVar)) | |
| 707 | + | if cbRefPtr, ok := GetCallback(DataTeardownVarPtr); ok { | |
| 708 | + | DataTeardownVarRef = cbRefPtr | |
| 709 | + | } else { | |
| 710 | + | fcb := func(arg0 uintptr, arg1 uintptr) { | |
| 711 | + | cbFn := *DataTeardownVar | |
| 712 | + | cbFn(arg0, arg1) | |
| 713 | + | } | |
| 714 | + | DataTeardownVarRef = purego.NewCallback(fcb) | |
| 715 | + | SaveCallback(DataTeardownVarPtr, DataTeardownVarRef) | |
| 716 | + | } | |
| 717 | + | } | |
| 718 | + | ||
| 719 | + | cret := xTestCreateCase(TestNameVar, DataSizeVar, TestDataVar, DataSetupVarRef, DataTestVarRef, DataTeardownVarRef) | |
| 570 | 720 | return cret | |
| 571 | 721 | } | |
| 572 | 722 | ||
| @@ -592,7 +742,7 @@ func TestDisableCrashReporting() { | |||
| 592 | 742 | ||
| 593 | 743 | } | |
| 594 | 744 | ||
| 595 | - | var xTestExpectMessage func(string, LogLevelFlags, string) | |
| 745 | + | var xTestExpectMessage func(uintptr, LogLevelFlags, string) | |
| 596 | 746 | ||
| 597 | 747 | // Indicates that a message with the given @log_domain and @log_level, | |
| 598 | 748 | // with text matching @pattern, is expected to be logged. | |
| @@ -631,9 +781,9 @@ var xTestExpectMessage func(string, LogLevelFlags, string) | |||
| 631 | 781 | // | |
| 632 | 782 | // If messages at [flags@GLib.LogLevelFlags.LEVEL_DEBUG] are emitted, but not explicitly | |
| 633 | 783 | // expected via [func@GLib.test_expect_message] then they will be ignored. | |
| 634 | - | func TestExpectMessage(LogDomainVar string, LogLevelVar LogLevelFlags, PatternVar string) { | |
| 784 | + | func TestExpectMessage(LogDomainVar *string, LogLevelVar LogLevelFlags, PatternVar string) { | |
| 635 | 785 | ||
| 636 | - | xTestExpectMessage(LogDomainVar, LogLevelVar, PatternVar) | |
| 786 | + | xTestExpectMessage(core.NullableStringToPtr(LogDomainVar), LogLevelVar, PatternVar) | |
| 637 | 787 | ||
| 638 | 788 | } | |
| 639 | 789 | ||
| @@ -755,7 +905,7 @@ func TestGetRoot() *TestSuite { | |||
| 755 | 905 | return cret | |
| 756 | 906 | } | |
| 757 | 907 | ||
| 758 | - | var xTestIncomplete func(string) | |
| 908 | + | var xTestIncomplete func(uintptr) | |
| 759 | 909 | ||
| 760 | 910 | // Indicates that a test failed because of some incomplete | |
| 761 | 911 | // functionality. | |
| @@ -768,9 +918,9 @@ var xTestIncomplete func(string) | |||
| 768 | 918 | // the test. | |
| 769 | 919 | // | |
| 770 | 920 | // If not called from inside a test, this function does nothing. | |
| 771 | - | func TestIncomplete(MsgVar string) { | |
| 921 | + | func TestIncomplete(MsgVar *string) { | |
| 772 | 922 | ||
| 773 | - | xTestIncomplete(MsgVar) | |
| 923 | + | xTestIncomplete(core.NullableStringToPtr(MsgVar)) | |
| 774 | 924 | ||
| 775 | 925 | } | |
| 776 | 926 | ||
| @@ -879,7 +1029,22 @@ var xTestLogSetFatalHandler func(uintptr, uintptr) | |||
| 879 | 1029 | // [Using Structured Logging](logging.html#using-structured-logging). | |
| 880 | 1030 | func TestLogSetFatalHandler(LogFuncVar *TestLogFatalFunc, UserDataVar uintptr) { | |
| 881 | 1031 | ||
| 882 | - | xTestLogSetFatalHandler(NewCallback(LogFuncVar), UserDataVar) | |
| 1032 | + | var LogFuncVarRef uintptr | |
| 1033 | + | if LogFuncVar != nil { | |
| 1034 | + | LogFuncVarPtr := uintptr(unsafe.Pointer(LogFuncVar)) | |
| 1035 | + | if cbRefPtr, ok := GetCallback(LogFuncVarPtr); ok { | |
| 1036 | + | LogFuncVarRef = cbRefPtr | |
| 1037 | + | } else { | |
| 1038 | + | fcb := func(arg0 string, arg1 LogLevelFlags, arg2 string, arg3 uintptr) bool { | |
| 1039 | + | cbFn := *LogFuncVar | |
| 1040 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 1041 | + | } | |
| 1042 | + | LogFuncVarRef = purego.NewCallback(fcb) | |
| 1043 | + | SaveCallback(LogFuncVarPtr, LogFuncVarRef) | |
| 1044 | + | } | |
| 1045 | + | } | |
| 1046 | + | ||
| 1047 | + | xTestLogSetFatalHandler(LogFuncVarRef, UserDataVar) | |
| 883 | 1048 | ||
| 884 | 1049 | } | |
| 885 | 1050 | ||
| @@ -939,7 +1104,22 @@ var xTestQueueDestroy func(uintptr, uintptr) | |||
| 939 | 1104 | // before `A()` during teardown. | |
| 940 | 1105 | func TestQueueDestroy(DestroyFuncVar *DestroyNotify, DestroyDataVar uintptr) { | |
| 941 | 1106 | ||
| 942 | - | xTestQueueDestroy(NewCallback(DestroyFuncVar), DestroyDataVar) | |
| 1107 | + | var DestroyFuncVarRef uintptr | |
| 1108 | + | if DestroyFuncVar != nil { | |
| 1109 | + | DestroyFuncVarPtr := uintptr(unsafe.Pointer(DestroyFuncVar)) | |
| 1110 | + | if cbRefPtr, ok := GetCallback(DestroyFuncVarPtr); ok { | |
| 1111 | + | DestroyFuncVarRef = cbRefPtr | |
| 1112 | + | } else { | |
| 1113 | + | fcb := func(arg0 uintptr) { | |
| 1114 | + | cbFn := *DestroyFuncVar | |
| 1115 | + | cbFn(arg0) | |
| 1116 | + | } | |
| 1117 | + | DestroyFuncVarRef = purego.NewCallback(fcb) | |
| 1118 | + | SaveCallback(DestroyFuncVarPtr, DestroyFuncVarRef) | |
| 1119 | + | } | |
| 1120 | + | } | |
| 1121 | + | ||
| 1122 | + | xTestQueueDestroy(DestroyFuncVarRef, DestroyDataVar) | |
| 943 | 1123 | ||
| 944 | 1124 | } | |
| 945 | 1125 | ||
| @@ -1088,7 +1268,7 @@ func TestSetNonfatalAssertions() { | |||
| 1088 | 1268 | ||
| 1089 | 1269 | } | |
| 1090 | 1270 | ||
| 1091 | - | var xTestSkip func(string) | |
| 1271 | + | var xTestSkip func(uintptr) | |
| 1092 | 1272 | ||
| 1093 | 1273 | // Indicates that a test was skipped. | |
| 1094 | 1274 | // | |
| @@ -1098,9 +1278,9 @@ var xTestSkip func(string) | |||
| 1098 | 1278 | // the test. | |
| 1099 | 1279 | // | |
| 1100 | 1280 | // If not called from inside a test, this function does nothing. | |
| 1101 | - | func TestSkip(MsgVar string) { | |
| 1281 | + | func TestSkip(MsgVar *string) { | |
| 1102 | 1282 | ||
| 1103 | - | xTestSkip(MsgVar) | |
| 1283 | + | xTestSkip(core.NullableStringToPtr(MsgVar)) | |
| 1104 | 1284 | ||
| 1105 | 1285 | } | |
| 1106 | 1286 | ||
| @@ -1259,20 +1439,20 @@ func TestTrapReachedTimeout() bool { | |||
| 1259 | 1439 | return cret | |
| 1260 | 1440 | } | |
| 1261 | 1441 | ||
| 1262 | - | var xTestTrapSubprocess func(string, uint64, TestSubprocessFlags) | |
| 1442 | + | var xTestTrapSubprocess func(uintptr, uint64, TestSubprocessFlags) | |
| 1263 | 1443 | ||
| 1264 | 1444 | // Respawns the test program to run only @test_path in a subprocess. | |
| 1265 | 1445 | // | |
| 1266 | 1446 | // This is equivalent to calling [func@GLib.test_trap_subprocess_with_envp] | |
| 1267 | 1447 | // with `envp` set to `NULL`. See the documentation for that function | |
| 1268 | 1448 | // for full details. | |
| 1269 | - | func TestTrapSubprocess(TestPathVar string, UsecTimeoutVar uint64, TestFlagsVar TestSubprocessFlags) { | |
| 1449 | + | func TestTrapSubprocess(TestPathVar *string, UsecTimeoutVar uint64, TestFlagsVar TestSubprocessFlags) { | |
| 1270 | 1450 | ||
| 1271 | - | xTestTrapSubprocess(TestPathVar, UsecTimeoutVar, TestFlagsVar) | |
| 1451 | + | xTestTrapSubprocess(core.NullableStringToPtr(TestPathVar), UsecTimeoutVar, TestFlagsVar) | |
| 1272 | 1452 | ||
| 1273 | 1453 | } | |
| 1274 | 1454 | ||
| 1275 | - | var xTestTrapSubprocessWithEnvp func(string, []string, uint64, TestSubprocessFlags) | |
| 1455 | + | var xTestTrapSubprocessWithEnvp func(uintptr, []string, uint64, TestSubprocessFlags) | |
| 1276 | 1456 | ||
| 1277 | 1457 | // Respawns the test program to run only @test_path in a subprocess with | |
| 1278 | 1458 | // a given environment. | |
| @@ -1365,9 +1545,9 @@ var xTestTrapSubprocessWithEnvp func(string, []string, uint64, TestSubprocessFla | |||
| 1365 | 1545 | // } | |
| 1366 | 1546 | // | |
| 1367 | 1547 | // ``` | |
| 1368 | - | func TestTrapSubprocessWithEnvp(TestPathVar string, EnvpVar []string, UsecTimeoutVar uint64, TestFlagsVar TestSubprocessFlags) { | |
| 1548 | + | func TestTrapSubprocessWithEnvp(TestPathVar *string, EnvpVar []string, UsecTimeoutVar uint64, TestFlagsVar TestSubprocessFlags) { | |
| 1369 | 1549 | ||
| 1370 | - | xTestTrapSubprocessWithEnvp(TestPathVar, EnvpVar, UsecTimeoutVar, TestFlagsVar) | |
| 1550 | + | xTestTrapSubprocessWithEnvp(core.NullableStringToPtr(TestPathVar), EnvpVar, UsecTimeoutVar, TestFlagsVar) | |
| 1371 | 1551 | ||
| 1372 | 1552 | } | |
| 1373 | 1553 | ||
M v4/glib/gthread.go +132 -12
| @@ -281,7 +281,22 @@ var xOnceImpl func(uintptr, uintptr, uintptr) uintptr | |||
| 281 | 281 | ||
| 282 | 282 | func (x *Once) Impl(FuncVar *ThreadFunc, ArgVar uintptr) uintptr { | |
| 283 | 283 | ||
| 284 | - | cret := xOnceImpl(x.GoPointer(), NewCallback(FuncVar), ArgVar) | |
| 284 | + | var FuncVarRef uintptr | |
| 285 | + | if FuncVar != nil { | |
| 286 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 287 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 288 | + | FuncVarRef = cbRefPtr | |
| 289 | + | } else { | |
| 290 | + | fcb := func(arg0 uintptr) uintptr { | |
| 291 | + | cbFn := *FuncVar | |
| 292 | + | return cbFn(arg0) | |
| 293 | + | } | |
| 294 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 295 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 296 | + | } | |
| 297 | + | } | |
| 298 | + | ||
| 299 | + | cret := xOnceImpl(x.GoPointer(), FuncVarRef, ArgVar) | |
| 285 | 300 | return cret | |
| 286 | 301 | } | |
| 287 | 302 | ||
| @@ -859,7 +874,22 @@ var xStaticPrivateSet func(uintptr, uintptr, uintptr) | |||
| 859 | 874 | // @notify is used quite differently from @destructor in g_private_new(). | |
| 860 | 875 | func (x *StaticPrivate) Set(DataVar uintptr, NotifyVar *DestroyNotify) { | |
| 861 | 876 | ||
| 862 | - | xStaticPrivateSet(x.GoPointer(), DataVar, NewCallback(NotifyVar)) | |
| 877 | + | var NotifyVarRef uintptr | |
| 878 | + | if NotifyVar != nil { | |
| 879 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 880 | + | if cbRefPtr, ok := GetCallback(NotifyVarPtr); ok { | |
| 881 | + | NotifyVarRef = cbRefPtr | |
| 882 | + | } else { | |
| 883 | + | fcb := func(arg0 uintptr) { | |
| 884 | + | cbFn := *NotifyVar | |
| 885 | + | cbFn(arg0) | |
| 886 | + | } | |
| 887 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 888 | + | SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 889 | + | } | |
| 890 | + | } | |
| 891 | + | ||
| 892 | + | xStaticPrivateSet(x.GoPointer(), DataVar, NotifyVarRef) | |
| 863 | 893 | ||
| 864 | 894 | } | |
| 865 | 895 | ||
| @@ -1219,7 +1249,7 @@ func (x *Thread) GoPointer() uintptr { | |||
| 1219 | 1249 | return uintptr(unsafe.Pointer(x)) | |
| 1220 | 1250 | } | |
| 1221 | 1251 | ||
| 1222 | - | var xNewThread func(string, uintptr, uintptr) *Thread | |
| 1252 | + | var xNewThread func(uintptr, uintptr, uintptr) *Thread | |
| 1223 | 1253 | ||
| 1224 | 1254 | // This function creates a new thread. The new thread starts by invoking | |
| 1225 | 1255 | // @func with the argument data. The thread will run until @func returns | |
| @@ -1248,23 +1278,53 @@ var xNewThread func(string, uintptr, uintptr) *Thread | |||
| 1248 | 1278 | // inheriting the thread priority but were spawned with the default priority. | |
| 1249 | 1279 | // Starting with GLib 2.64 the behaviour is now consistent between Windows and | |
| 1250 | 1280 | // POSIX and all threads inherit their parent thread's priority. | |
| 1251 | - | func NewThread(NameVar string, FuncVar *ThreadFunc, DataVar uintptr) *Thread { | |
| 1281 | + | func NewThread(NameVar *string, FuncVar *ThreadFunc, DataVar uintptr) *Thread { | |
| 1282 | + | ||
| 1283 | + | var FuncVarRef uintptr | |
| 1284 | + | if FuncVar != nil { | |
| 1285 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 1286 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 1287 | + | FuncVarRef = cbRefPtr | |
| 1288 | + | } else { | |
| 1289 | + | fcb := func(arg0 uintptr) uintptr { | |
| 1290 | + | cbFn := *FuncVar | |
| 1291 | + | return cbFn(arg0) | |
| 1292 | + | } | |
| 1293 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 1294 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 1295 | + | } | |
| 1296 | + | } | |
| 1252 | 1297 | ||
| 1253 | - | cret := xNewThread(NameVar, NewCallback(FuncVar), DataVar) | |
| 1298 | + | cret := xNewThread(core.NullableStringToPtr(NameVar), FuncVarRef, DataVar) | |
| 1254 | 1299 | return cret | |
| 1255 | 1300 | } | |
| 1256 | 1301 | ||
| 1257 | - | var xThreadTryNew func(string, uintptr, uintptr, **Error) *Thread | |
| 1302 | + | var xThreadTryNew func(uintptr, uintptr, uintptr, **Error) *Thread | |
| 1258 | 1303 | ||
| 1259 | 1304 | // This function is the same as g_thread_new() except that | |
| 1260 | 1305 | // it allows for the possibility of failure. | |
| 1261 | 1306 | // | |
| 1262 | 1307 | // If a thread can not be created (due to resource limits), | |
| 1263 | 1308 | // @error is set and %NULL is returned. | |
| 1264 | - | func ThreadTryNew(NameVar string, FuncVar *ThreadFunc, DataVar uintptr) (*Thread, error) { | |
| 1309 | + | func ThreadTryNew(NameVar *string, FuncVar *ThreadFunc, DataVar uintptr) (*Thread, error) { | |
| 1265 | 1310 | var cerr *Error | |
| 1266 | 1311 | ||
| 1267 | - | cret := xThreadTryNew(NameVar, NewCallback(FuncVar), DataVar, &cerr) | |
| 1312 | + | var FuncVarRef uintptr | |
| 1313 | + | if FuncVar != nil { | |
| 1314 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 1315 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 1316 | + | FuncVarRef = cbRefPtr | |
| 1317 | + | } else { | |
| 1318 | + | fcb := func(arg0 uintptr) uintptr { | |
| 1319 | + | cbFn := *FuncVar | |
| 1320 | + | return cbFn(arg0) | |
| 1321 | + | } | |
| 1322 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 1323 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 1324 | + | } | |
| 1325 | + | } | |
| 1326 | + | ||
| 1327 | + | cret := xThreadTryNew(core.NullableStringToPtr(NameVar), FuncVarRef, DataVar, &cerr) | |
| 1268 | 1328 | if cerr == nil { | |
| 1269 | 1329 | return cret, nil | |
| 1270 | 1330 | } | |
| @@ -2160,7 +2220,22 @@ var xPrivateNew func(uintptr) *Private | |||
| 2160 | 2220 | // Creates a new #GPrivate. | |
| 2161 | 2221 | func PrivateNew(NotifyVar *DestroyNotify) *Private { | |
| 2162 | 2222 | ||
| 2163 | - | cret := xPrivateNew(NewCallback(NotifyVar)) | |
| 2223 | + | var NotifyVarRef uintptr | |
| 2224 | + | if NotifyVar != nil { | |
| 2225 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 2226 | + | if cbRefPtr, ok := GetCallback(NotifyVarPtr); ok { | |
| 2227 | + | NotifyVarRef = cbRefPtr | |
| 2228 | + | } else { | |
| 2229 | + | fcb := func(arg0 uintptr) { | |
| 2230 | + | cbFn := *NotifyVar | |
| 2231 | + | cbFn(arg0) | |
| 2232 | + | } | |
| 2233 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 2234 | + | SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 2235 | + | } | |
| 2236 | + | } | |
| 2237 | + | ||
| 2238 | + | cret := xPrivateNew(NotifyVarRef) | |
| 2164 | 2239 | return cret | |
| 2165 | 2240 | } | |
| 2166 | 2241 | ||
| @@ -2181,7 +2256,22 @@ var xThreadCreate func(uintptr, uintptr, bool, **Error) *Thread | |||
| 2181 | 2256 | func ThreadCreate(FuncVar *ThreadFunc, DataVar uintptr, JoinableVar bool) (*Thread, error) { | |
| 2182 | 2257 | var cerr *Error | |
| 2183 | 2258 | ||
| 2184 | - | cret := xThreadCreate(NewCallback(FuncVar), DataVar, JoinableVar, &cerr) | |
| 2259 | + | var FuncVarRef uintptr | |
| 2260 | + | if FuncVar != nil { | |
| 2261 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 2262 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 2263 | + | FuncVarRef = cbRefPtr | |
| 2264 | + | } else { | |
| 2265 | + | fcb := func(arg0 uintptr) uintptr { | |
| 2266 | + | cbFn := *FuncVar | |
| 2267 | + | return cbFn(arg0) | |
| 2268 | + | } | |
| 2269 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 2270 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 2271 | + | } | |
| 2272 | + | } | |
| 2273 | + | ||
| 2274 | + | cret := xThreadCreate(FuncVarRef, DataVar, JoinableVar, &cerr) | |
| 2185 | 2275 | if cerr == nil { | |
| 2186 | 2276 | return cret, nil | |
| 2187 | 2277 | } | |
| @@ -2195,7 +2285,22 @@ var xThreadCreateFull func(uintptr, uintptr, uint32, bool, bool, ThreadPriority, | |||
| 2195 | 2285 | func ThreadCreateFull(FuncVar *ThreadFunc, DataVar uintptr, StackSizeVar uint32, JoinableVar bool, BoundVar bool, PriorityVar ThreadPriority) (*Thread, error) { | |
| 2196 | 2286 | var cerr *Error | |
| 2197 | 2287 | ||
| 2198 | - | cret := xThreadCreateFull(NewCallback(FuncVar), DataVar, StackSizeVar, JoinableVar, BoundVar, PriorityVar, &cerr) | |
| 2288 | + | var FuncVarRef uintptr | |
| 2289 | + | if FuncVar != nil { | |
| 2290 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 2291 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 2292 | + | FuncVarRef = cbRefPtr | |
| 2293 | + | } else { | |
| 2294 | + | fcb := func(arg0 uintptr) uintptr { | |
| 2295 | + | cbFn := *FuncVar | |
| 2296 | + | return cbFn(arg0) | |
| 2297 | + | } | |
| 2298 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 2299 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 2300 | + | } | |
| 2301 | + | } | |
| 2302 | + | ||
| 2303 | + | cret := xThreadCreateFull(FuncVarRef, DataVar, StackSizeVar, JoinableVar, BoundVar, PriorityVar, &cerr) | |
| 2199 | 2304 | if cerr == nil { | |
| 2200 | 2305 | return cret, nil | |
| 2201 | 2306 | } | |
| @@ -2239,7 +2344,22 @@ var xThreadForeach func(uintptr, uintptr) | |||
| 2239 | 2344 | // which is quadratic in the number of existing threads. | |
| 2240 | 2345 | func ThreadForeach(ThreadFuncVar *Func, UserDataVar uintptr) { | |
| 2241 | 2346 | ||
| 2242 | - | xThreadForeach(NewCallback(ThreadFuncVar), UserDataVar) | |
| 2347 | + | var ThreadFuncVarRef uintptr | |
| 2348 | + | if ThreadFuncVar != nil { | |
| 2349 | + | ThreadFuncVarPtr := uintptr(unsafe.Pointer(ThreadFuncVar)) | |
| 2350 | + | if cbRefPtr, ok := GetCallback(ThreadFuncVarPtr); ok { | |
| 2351 | + | ThreadFuncVarRef = cbRefPtr | |
| 2352 | + | } else { | |
| 2353 | + | fcb := func(arg0 uintptr, arg1 uintptr) { | |
| 2354 | + | cbFn := *ThreadFuncVar | |
| 2355 | + | cbFn(arg0, arg1) | |
| 2356 | + | } | |
| 2357 | + | ThreadFuncVarRef = purego.NewCallback(fcb) | |
| 2358 | + | SaveCallback(ThreadFuncVarPtr, ThreadFuncVarRef) | |
| 2359 | + | } | |
| 2360 | + | } | |
| 2361 | + | ||
| 2362 | + | xThreadForeach(ThreadFuncVarRef, UserDataVar) | |
| 2243 | 2363 | ||
| 2244 | 2364 | } | |
| 2245 | 2365 | ||
M v4/glib/gthreadpool.go +16 -1
| @@ -172,7 +172,22 @@ var xThreadPoolSetSortFunction func(uintptr, uintptr, uintptr) | |||
| 172 | 172 | // created. | |
| 173 | 173 | func (x *ThreadPool) SetSortFunction(FuncVar *CompareDataFunc, UserDataVar uintptr) { | |
| 174 | 174 | ||
| 175 | - | xThreadPoolSetSortFunction(x.GoPointer(), NewCallback(FuncVar), UserDataVar) | |
| 175 | + | var FuncVarRef uintptr | |
| 176 | + | if FuncVar != nil { | |
| 177 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 178 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 179 | + | FuncVarRef = cbRefPtr | |
| 180 | + | } else { | |
| 181 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 182 | + | cbFn := *FuncVar | |
| 183 | + | return cbFn(arg0, arg1, arg2) | |
| 184 | + | } | |
| 185 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 186 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 187 | + | } | |
| 188 | + | } | |
| 189 | + | ||
| 190 | + | xThreadPoolSetSortFunction(x.GoPointer(), FuncVarRef, UserDataVar) | |
| 176 | 191 | ||
| 177 | 192 | } | |
| 178 | 193 | ||
M v4/glib/gtimezone.go +6 -6
| @@ -50,20 +50,20 @@ func (x *TimeZone) GoPointer() uintptr { | |||
| 50 | 50 | return uintptr(unsafe.Pointer(x)) | |
| 51 | 51 | } | |
| 52 | 52 | ||
| 53 | - | var xNewTimeZone func(string) *TimeZone | |
| 53 | + | var xNewTimeZone func(uintptr) *TimeZone | |
| 54 | 54 | ||
| 55 | 55 | // A version of g_time_zone_new_identifier() which returns the UTC time zone | |
| 56 | 56 | // if @identifier could not be parsed or loaded. | |
| 57 | 57 | // | |
| 58 | 58 | // If you need to check whether @identifier was loaded successfully, use | |
| 59 | 59 | // g_time_zone_new_identifier(). | |
| 60 | - | func NewTimeZone(IdentifierVar string) *TimeZone { | |
| 60 | + | func NewTimeZone(IdentifierVar *string) *TimeZone { | |
| 61 | 61 | ||
| 62 | - | cret := xNewTimeZone(IdentifierVar) | |
| 62 | + | cret := xNewTimeZone(core.NullableStringToPtr(IdentifierVar)) | |
| 63 | 63 | return cret | |
| 64 | 64 | } | |
| 65 | 65 | ||
| 66 | - | var xNewTimeZoneIdentifier func(string) *TimeZone | |
| 66 | + | var xNewTimeZoneIdentifier func(uintptr) *TimeZone | |
| 67 | 67 | ||
| 68 | 68 | // Creates a #GTimeZone corresponding to @identifier. If @identifier cannot be | |
| 69 | 69 | // parsed or loaded, %NULL is returned. | |
| @@ -130,9 +130,9 @@ var xNewTimeZoneIdentifier func(string) *TimeZone | |||
| 130 | 130 | // | |
| 131 | 131 | // You should release the return value by calling g_time_zone_unref() | |
| 132 | 132 | // when you are done with it. | |
| 133 | - | func NewTimeZoneIdentifier(IdentifierVar string) *TimeZone { | |
| 133 | + | func NewTimeZoneIdentifier(IdentifierVar *string) *TimeZone { | |
| 134 | 134 | ||
| 135 | - | cret := xNewTimeZoneIdentifier(IdentifierVar) | |
| 135 | + | cret := xNewTimeZoneIdentifier(core.NullableStringToPtr(IdentifierVar)) | |
| 136 | 136 | return cret | |
| 137 | 137 | } | |
| 138 | 138 | ||
M v4/glib/gtree.go +158 -8
| @@ -44,7 +44,22 @@ var xNewTree func(uintptr) *Tree | |||
| 44 | 44 | // Creates a new #GTree. | |
| 45 | 45 | func NewTree(KeyCompareFuncVar *CompareFunc) *Tree { | |
| 46 | 46 | ||
| 47 | - | cret := xNewTree(NewCallback(KeyCompareFuncVar)) | |
| 47 | + | var KeyCompareFuncVarRef uintptr | |
| 48 | + | if KeyCompareFuncVar != nil { | |
| 49 | + | KeyCompareFuncVarPtr := uintptr(unsafe.Pointer(KeyCompareFuncVar)) | |
| 50 | + | if cbRefPtr, ok := GetCallback(KeyCompareFuncVarPtr); ok { | |
| 51 | + | KeyCompareFuncVarRef = cbRefPtr | |
| 52 | + | } else { | |
| 53 | + | fcb := func(arg0 uintptr, arg1 uintptr) int { | |
| 54 | + | cbFn := *KeyCompareFuncVar | |
| 55 | + | return cbFn(arg0, arg1) | |
| 56 | + | } | |
| 57 | + | KeyCompareFuncVarRef = purego.NewCallback(fcb) | |
| 58 | + | SaveCallback(KeyCompareFuncVarPtr, KeyCompareFuncVarRef) | |
| 59 | + | } | |
| 60 | + | } | |
| 61 | + | ||
| 62 | + | cret := xNewTree(KeyCompareFuncVarRef) | |
| 48 | 63 | return cret | |
| 49 | 64 | } | |
| 50 | 65 | ||
| @@ -55,7 +70,52 @@ var xNewTreeFull func(uintptr, uintptr, uintptr, uintptr) *Tree | |||
| 55 | 70 | // removing the entry from the #GTree. | |
| 56 | 71 | func NewTreeFull(KeyCompareFuncVar *CompareDataFunc, KeyCompareDataVar uintptr, KeyDestroyFuncVar *DestroyNotify, ValueDestroyFuncVar *DestroyNotify) *Tree { | |
| 57 | 72 | ||
| 58 | - | cret := xNewTreeFull(NewCallback(KeyCompareFuncVar), KeyCompareDataVar, NewCallback(KeyDestroyFuncVar), NewCallback(ValueDestroyFuncVar)) | |
| 73 | + | var KeyCompareFuncVarRef uintptr | |
| 74 | + | if KeyCompareFuncVar != nil { | |
| 75 | + | KeyCompareFuncVarPtr := uintptr(unsafe.Pointer(KeyCompareFuncVar)) | |
| 76 | + | if cbRefPtr, ok := GetCallback(KeyCompareFuncVarPtr); ok { | |
| 77 | + | KeyCompareFuncVarRef = cbRefPtr | |
| 78 | + | } else { | |
| 79 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 80 | + | cbFn := *KeyCompareFuncVar | |
| 81 | + | return cbFn(arg0, arg1, arg2) | |
| 82 | + | } | |
| 83 | + | KeyCompareFuncVarRef = purego.NewCallback(fcb) | |
| 84 | + | SaveCallback(KeyCompareFuncVarPtr, KeyCompareFuncVarRef) | |
| 85 | + | } | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | var KeyDestroyFuncVarRef uintptr | |
| 89 | + | if KeyDestroyFuncVar != nil { | |
| 90 | + | KeyDestroyFuncVarPtr := uintptr(unsafe.Pointer(KeyDestroyFuncVar)) | |
| 91 | + | if cbRefPtr, ok := GetCallback(KeyDestroyFuncVarPtr); ok { | |
| 92 | + | KeyDestroyFuncVarRef = cbRefPtr | |
| 93 | + | } else { | |
| 94 | + | fcb := func(arg0 uintptr) { | |
| 95 | + | cbFn := *KeyDestroyFuncVar | |
| 96 | + | cbFn(arg0) | |
| 97 | + | } | |
| 98 | + | KeyDestroyFuncVarRef = purego.NewCallback(fcb) | |
| 99 | + | SaveCallback(KeyDestroyFuncVarPtr, KeyDestroyFuncVarRef) | |
| 100 | + | } | |
| 101 | + | } | |
| 102 | + | ||
| 103 | + | var ValueDestroyFuncVarRef uintptr | |
| 104 | + | if ValueDestroyFuncVar != nil { | |
| 105 | + | ValueDestroyFuncVarPtr := uintptr(unsafe.Pointer(ValueDestroyFuncVar)) | |
| 106 | + | if cbRefPtr, ok := GetCallback(ValueDestroyFuncVarPtr); ok { | |
| 107 | + | ValueDestroyFuncVarRef = cbRefPtr | |
| 108 | + | } else { | |
| 109 | + | fcb := func(arg0 uintptr) { | |
| 110 | + | cbFn := *ValueDestroyFuncVar | |
| 111 | + | cbFn(arg0) | |
| 112 | + | } | |
| 113 | + | ValueDestroyFuncVarRef = purego.NewCallback(fcb) | |
| 114 | + | SaveCallback(ValueDestroyFuncVarPtr, ValueDestroyFuncVarRef) | |
| 115 | + | } | |
| 116 | + | } | |
| 117 | + | ||
| 118 | + | cret := xNewTreeFull(KeyCompareFuncVarRef, KeyCompareDataVar, KeyDestroyFuncVarRef, ValueDestroyFuncVarRef) | |
| 59 | 119 | return cret | |
| 60 | 120 | } | |
| 61 | 121 | ||
| @@ -65,7 +125,22 @@ var xNewTreeWithData func(uintptr, uintptr) *Tree | |||
| 65 | 125 | // See g_tree_new() for more details. | |
| 66 | 126 | func NewTreeWithData(KeyCompareFuncVar *CompareDataFunc, KeyCompareDataVar uintptr) *Tree { | |
| 67 | 127 | ||
| 68 | - | cret := xNewTreeWithData(NewCallback(KeyCompareFuncVar), KeyCompareDataVar) | |
| 128 | + | var KeyCompareFuncVarRef uintptr | |
| 129 | + | if KeyCompareFuncVar != nil { | |
| 130 | + | KeyCompareFuncVarPtr := uintptr(unsafe.Pointer(KeyCompareFuncVar)) | |
| 131 | + | if cbRefPtr, ok := GetCallback(KeyCompareFuncVarPtr); ok { | |
| 132 | + | KeyCompareFuncVarRef = cbRefPtr | |
| 133 | + | } else { | |
| 134 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 135 | + | cbFn := *KeyCompareFuncVar | |
| 136 | + | return cbFn(arg0, arg1, arg2) | |
| 137 | + | } | |
| 138 | + | KeyCompareFuncVarRef = purego.NewCallback(fcb) | |
| 139 | + | SaveCallback(KeyCompareFuncVarPtr, KeyCompareFuncVarRef) | |
| 140 | + | } | |
| 141 | + | } | |
| 142 | + | ||
| 143 | + | cret := xNewTreeWithData(KeyCompareFuncVarRef, KeyCompareDataVar) | |
| 69 | 144 | return cret | |
| 70 | 145 | } | |
| 71 | 146 | ||
| @@ -95,7 +170,22 @@ var xTreeForeach func(uintptr, uintptr, uintptr) | |||
| 95 | 170 | // the tree, then walk the list and remove each item. | |
| 96 | 171 | func (x *Tree) Foreach(FuncVar *TraverseFunc, UserDataVar uintptr) { | |
| 97 | 172 | ||
| 98 | - | xTreeForeach(x.GoPointer(), NewCallback(FuncVar), UserDataVar) | |
| 173 | + | var FuncVarRef uintptr | |
| 174 | + | if FuncVar != nil { | |
| 175 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 176 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 177 | + | FuncVarRef = cbRefPtr | |
| 178 | + | } else { | |
| 179 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) bool { | |
| 180 | + | cbFn := *FuncVar | |
| 181 | + | return cbFn(arg0, arg1, arg2) | |
| 182 | + | } | |
| 183 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 184 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 185 | + | } | |
| 186 | + | } | |
| 187 | + | ||
| 188 | + | xTreeForeach(x.GoPointer(), FuncVarRef, UserDataVar) | |
| 99 | 189 | ||
| 100 | 190 | } | |
| 101 | 191 | ||
| @@ -111,7 +201,22 @@ var xTreeForeachNode func(uintptr, uintptr, uintptr) | |||
| 111 | 201 | // the tree, then walk the list and remove each item. | |
| 112 | 202 | func (x *Tree) ForeachNode(FuncVar *TraverseNodeFunc, UserDataVar uintptr) { | |
| 113 | 203 | ||
| 114 | - | xTreeForeachNode(x.GoPointer(), NewCallback(FuncVar), UserDataVar) | |
| 204 | + | var FuncVarRef uintptr | |
| 205 | + | if FuncVar != nil { | |
| 206 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 207 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 208 | + | FuncVarRef = cbRefPtr | |
| 209 | + | } else { | |
| 210 | + | fcb := func(arg0 *TreeNode, arg1 uintptr) bool { | |
| 211 | + | cbFn := *FuncVar | |
| 212 | + | return cbFn(arg0, arg1) | |
| 213 | + | } | |
| 214 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 215 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 216 | + | } | |
| 217 | + | } | |
| 218 | + | ||
| 219 | + | xTreeForeachNode(x.GoPointer(), FuncVarRef, UserDataVar) | |
| 115 | 220 | ||
| 116 | 221 | } | |
| 117 | 222 | ||
| @@ -317,7 +422,22 @@ var xTreeSearch func(uintptr, uintptr, uintptr) uintptr | |||
| 317 | 422 | // pairs that have a larger key. | |
| 318 | 423 | func (x *Tree) Search(SearchFuncVar *CompareFunc, UserDataVar uintptr) uintptr { | |
| 319 | 424 | ||
| 320 | - | cret := xTreeSearch(x.GoPointer(), NewCallback(SearchFuncVar), UserDataVar) | |
| 425 | + | var SearchFuncVarRef uintptr | |
| 426 | + | if SearchFuncVar != nil { | |
| 427 | + | SearchFuncVarPtr := uintptr(unsafe.Pointer(SearchFuncVar)) | |
| 428 | + | if cbRefPtr, ok := GetCallback(SearchFuncVarPtr); ok { | |
| 429 | + | SearchFuncVarRef = cbRefPtr | |
| 430 | + | } else { | |
| 431 | + | fcb := func(arg0 uintptr, arg1 uintptr) int { | |
| 432 | + | cbFn := *SearchFuncVar | |
| 433 | + | return cbFn(arg0, arg1) | |
| 434 | + | } | |
| 435 | + | SearchFuncVarRef = purego.NewCallback(fcb) | |
| 436 | + | SaveCallback(SearchFuncVarPtr, SearchFuncVarRef) | |
| 437 | + | } | |
| 438 | + | } | |
| 439 | + | ||
| 440 | + | cret := xTreeSearch(x.GoPointer(), SearchFuncVarRef, UserDataVar) | |
| 321 | 441 | return cret | |
| 322 | 442 | } | |
| 323 | 443 | ||
| @@ -334,7 +454,22 @@ var xTreeSearchNode func(uintptr, uintptr, uintptr) *TreeNode | |||
| 334 | 454 | // pairs that have a larger key. | |
| 335 | 455 | func (x *Tree) SearchNode(SearchFuncVar *CompareFunc, UserDataVar uintptr) *TreeNode { | |
| 336 | 456 | ||
| 337 | - | cret := xTreeSearchNode(x.GoPointer(), NewCallback(SearchFuncVar), UserDataVar) | |
| 457 | + | var SearchFuncVarRef uintptr | |
| 458 | + | if SearchFuncVar != nil { | |
| 459 | + | SearchFuncVarPtr := uintptr(unsafe.Pointer(SearchFuncVar)) | |
| 460 | + | if cbRefPtr, ok := GetCallback(SearchFuncVarPtr); ok { | |
| 461 | + | SearchFuncVarRef = cbRefPtr | |
| 462 | + | } else { | |
| 463 | + | fcb := func(arg0 uintptr, arg1 uintptr) int { | |
| 464 | + | cbFn := *SearchFuncVar | |
| 465 | + | return cbFn(arg0, arg1) | |
| 466 | + | } | |
| 467 | + | SearchFuncVarRef = purego.NewCallback(fcb) | |
| 468 | + | SaveCallback(SearchFuncVarPtr, SearchFuncVarRef) | |
| 469 | + | } | |
| 470 | + | } | |
| 471 | + | ||
| 472 | + | cret := xTreeSearchNode(x.GoPointer(), SearchFuncVarRef, UserDataVar) | |
| 338 | 473 | return cret | |
| 339 | 474 | } | |
| 340 | 475 | ||
| @@ -355,7 +490,22 @@ var xTreeTraverse func(uintptr, uintptr, TraverseType, uintptr) | |||
| 355 | 490 | // Calls the given function for each node in the #GTree. | |
| 356 | 491 | func (x *Tree) Traverse(TraverseFuncVar *TraverseFunc, TraverseTypeVar TraverseType, UserDataVar uintptr) { | |
| 357 | 492 | ||
| 358 | - | xTreeTraverse(x.GoPointer(), NewCallback(TraverseFuncVar), TraverseTypeVar, UserDataVar) | |
| 493 | + | var TraverseFuncVarRef uintptr | |
| 494 | + | if TraverseFuncVar != nil { | |
| 495 | + | TraverseFuncVarPtr := uintptr(unsafe.Pointer(TraverseFuncVar)) | |
| 496 | + | if cbRefPtr, ok := GetCallback(TraverseFuncVarPtr); ok { | |
| 497 | + | TraverseFuncVarRef = cbRefPtr | |
| 498 | + | } else { | |
| 499 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) bool { | |
| 500 | + | cbFn := *TraverseFuncVar | |
| 501 | + | return cbFn(arg0, arg1, arg2) | |
| 502 | + | } | |
| 503 | + | TraverseFuncVarRef = purego.NewCallback(fcb) | |
| 504 | + | SaveCallback(TraverseFuncVarPtr, TraverseFuncVarRef) | |
| 505 | + | } | |
| 506 | + | } | |
| 507 | + | ||
| 508 | + | xTreeTraverse(x.GoPointer(), TraverseFuncVarRef, TraverseTypeVar, UserDataVar) | |
| 359 | 509 | ||
| 360 | 510 | } | |
| 361 | 511 | ||
M v4/glib/gunicode.go +3 -3
| @@ -1249,7 +1249,7 @@ func Utf8CollateKeyForFilename(StrVar string, LenVar int) string { | |||
| 1249 | 1249 | return cret | |
| 1250 | 1250 | } | |
| 1251 | 1251 | ||
| 1252 | - | var xUtf8FindNextChar func(string, string) string | |
| 1252 | + | var xUtf8FindNextChar func(string, uintptr) string | |
| 1253 | 1253 | ||
| 1254 | 1254 | // Finds the start of the next UTF-8 character in the string after @p. | |
| 1255 | 1255 | // | |
| @@ -1261,9 +1261,9 @@ var xUtf8FindNextChar func(string, string) string | |||
| 1261 | 1261 | // string is reached, a pointer to the terminating nul byte is returned. If | |
| 1262 | 1262 | // @end is non-`NULL`, the return value will be `NULL` if the end of the string | |
| 1263 | 1263 | // is reached. | |
| 1264 | - | func Utf8FindNextChar(PVar string, EndVar string) string { | |
| 1264 | + | func Utf8FindNextChar(PVar string, EndVar *string) string { | |
| 1265 | 1265 | ||
| 1266 | - | cret := xUtf8FindNextChar(PVar, EndVar) | |
| 1266 | + | cret := xUtf8FindNextChar(PVar, core.NullableStringToPtr(EndVar)) | |
| 1267 | 1267 | return cret | |
| 1268 | 1268 | } | |
| 1269 | 1269 | ||
M v4/glib/guri.go +30 -30
| @@ -598,19 +598,19 @@ const ( | |||
| 598 | 598 | GUriErrorBadFragmentValue UriError = 9 | |
| 599 | 599 | ) | |
| 600 | 600 | ||
| 601 | - | var xUriBuild func(UriFlags, string, string, string, int, string, string, string) *Uri | |
| 601 | + | var xUriBuild func(UriFlags, string, uintptr, uintptr, int, string, uintptr, uintptr) *Uri | |
| 602 | 602 | ||
| 603 | 603 | // Creates a new #GUri from the given components according to @flags. | |
| 604 | 604 | // | |
| 605 | 605 | // See also g_uri_build_with_user(), which allows specifying the | |
| 606 | 606 | // components of the "userinfo" separately. | |
| 607 | - | func UriBuild(FlagsVar UriFlags, SchemeVar string, UserinfoVar string, HostVar string, PortVar int, PathVar string, QueryVar string, FragmentVar string) *Uri { | |
| 607 | + | func UriBuild(FlagsVar UriFlags, SchemeVar string, UserinfoVar *string, HostVar *string, PortVar int, PathVar string, QueryVar *string, FragmentVar *string) *Uri { | |
| 608 | 608 | ||
| 609 | - | cret := xUriBuild(FlagsVar, SchemeVar, UserinfoVar, HostVar, PortVar, PathVar, QueryVar, FragmentVar) | |
| 609 | + | cret := xUriBuild(FlagsVar, SchemeVar, core.NullableStringToPtr(UserinfoVar), core.NullableStringToPtr(HostVar), PortVar, PathVar, core.NullableStringToPtr(QueryVar), core.NullableStringToPtr(FragmentVar)) | |
| 610 | 610 | return cret | |
| 611 | 611 | } | |
| 612 | 612 | ||
| 613 | - | var xUriBuildWithUser func(UriFlags, string, string, string, string, string, int, string, string, string) *Uri | |
| 613 | + | var xUriBuildWithUser func(UriFlags, string, uintptr, uintptr, uintptr, uintptr, int, string, uintptr, uintptr) *Uri | |
| 614 | 614 | ||
| 615 | 615 | // Creates a new #GUri from the given components according to @flags | |
| 616 | 616 | // (%G_URI_FLAGS_HAS_PASSWORD is added unconditionally). The @flags must be | |
| @@ -620,13 +620,13 @@ var xUriBuildWithUser func(UriFlags, string, string, string, string, string, int | |||
| 620 | 620 | // In contrast to g_uri_build(), this allows specifying the components | |
| 621 | 621 | // of the ‘userinfo’ field separately. Note that @user must be non-%NULL | |
| 622 | 622 | // if either @password or @auth_params is non-%NULL. | |
| 623 | - | func UriBuildWithUser(FlagsVar UriFlags, SchemeVar string, UserVar string, PasswordVar string, AuthParamsVar string, HostVar string, PortVar int, PathVar string, QueryVar string, FragmentVar string) *Uri { | |
| 623 | + | func UriBuildWithUser(FlagsVar UriFlags, SchemeVar string, UserVar *string, PasswordVar *string, AuthParamsVar *string, HostVar *string, PortVar int, PathVar string, QueryVar *string, FragmentVar *string) *Uri { | |
| 624 | 624 | ||
| 625 | - | cret := xUriBuildWithUser(FlagsVar, SchemeVar, UserVar, PasswordVar, AuthParamsVar, HostVar, PortVar, PathVar, QueryVar, FragmentVar) | |
| 625 | + | cret := xUriBuildWithUser(FlagsVar, SchemeVar, core.NullableStringToPtr(UserVar), core.NullableStringToPtr(PasswordVar), core.NullableStringToPtr(AuthParamsVar), core.NullableStringToPtr(HostVar), PortVar, PathVar, core.NullableStringToPtr(QueryVar), core.NullableStringToPtr(FragmentVar)) | |
| 626 | 626 | return cret | |
| 627 | 627 | } | |
| 628 | 628 | ||
| 629 | - | var xUriEscapeBytes func([]byte, uint, string) string | |
| 629 | + | var xUriEscapeBytes func([]byte, uint, uintptr) string | |
| 630 | 630 | ||
| 631 | 631 | // Escapes arbitrary data for use in a URI. | |
| 632 | 632 | // | |
| @@ -639,13 +639,13 @@ var xUriEscapeBytes func([]byte, uint, string) string | |||
| 639 | 639 | // | |
| 640 | 640 | // Though technically incorrect, this will also allow escaping nul | |
| 641 | 641 | // bytes as `%“00`. | |
| 642 | - | func UriEscapeBytes(UnescapedVar []byte, LengthVar uint, ReservedCharsAllowedVar string) string { | |
| 642 | + | func UriEscapeBytes(UnescapedVar []byte, LengthVar uint, ReservedCharsAllowedVar *string) string { | |
| 643 | 643 | ||
| 644 | - | cret := xUriEscapeBytes(UnescapedVar, LengthVar, ReservedCharsAllowedVar) | |
| 644 | + | cret := xUriEscapeBytes(UnescapedVar, LengthVar, core.NullableStringToPtr(ReservedCharsAllowedVar)) | |
| 645 | 645 | return cret | |
| 646 | 646 | } | |
| 647 | 647 | ||
| 648 | - | var xUriEscapeString func(string, string, bool) string | |
| 648 | + | var xUriEscapeString func(string, uintptr, bool) string | |
| 649 | 649 | ||
| 650 | 650 | // Escapes a string for use in a URI. | |
| 651 | 651 | // | |
| @@ -655,9 +655,9 @@ var xUriEscapeString func(string, string, bool) string | |||
| 655 | 655 | // they are not escaped. This is useful for the "reserved" characters | |
| 656 | 656 | // in the URI specification, since those are allowed unescaped in some | |
| 657 | 657 | // portions of a URI. | |
| 658 | - | func UriEscapeString(UnescapedVar string, ReservedCharsAllowedVar string, AllowUtf8Var bool) string { | |
| 658 | + | func UriEscapeString(UnescapedVar string, ReservedCharsAllowedVar *string, AllowUtf8Var bool) string { | |
| 659 | 659 | ||
| 660 | - | cret := xUriEscapeString(UnescapedVar, ReservedCharsAllowedVar, AllowUtf8Var) | |
| 660 | + | cret := xUriEscapeString(UnescapedVar, core.NullableStringToPtr(ReservedCharsAllowedVar), AllowUtf8Var) | |
| 661 | 661 | return cret | |
| 662 | 662 | } | |
| 663 | 663 | ||
| @@ -682,7 +682,7 @@ func UriIsValid(UriStringVar string, FlagsVar UriFlags) (bool, error) { | |||
| 682 | 682 | ||
| 683 | 683 | } | |
| 684 | 684 | ||
| 685 | - | var xUriJoin func(UriFlags, string, string, string, int, string, string, string) string | |
| 685 | + | var xUriJoin func(UriFlags, uintptr, uintptr, uintptr, int, string, uintptr, uintptr) string | |
| 686 | 686 | ||
| 687 | 687 | // Joins the given components together according to @flags to create | |
| 688 | 688 | // an absolute URI string. @path may not be %NULL (though it may be the empty | |
| @@ -698,13 +698,13 @@ var xUriJoin func(UriFlags, string, string, string, int, string, string, string) | |||
| 698 | 698 | // | |
| 699 | 699 | // %G_URI_FLAGS_HAS_PASSWORD and %G_URI_FLAGS_HAS_AUTH_PARAMS are ignored if set | |
| 700 | 700 | // in @flags. | |
| 701 | - | func UriJoin(FlagsVar UriFlags, SchemeVar string, UserinfoVar string, HostVar string, PortVar int, PathVar string, QueryVar string, FragmentVar string) string { | |
| 701 | + | func UriJoin(FlagsVar UriFlags, SchemeVar *string, UserinfoVar *string, HostVar *string, PortVar int, PathVar string, QueryVar *string, FragmentVar *string) string { | |
| 702 | 702 | ||
| 703 | - | cret := xUriJoin(FlagsVar, SchemeVar, UserinfoVar, HostVar, PortVar, PathVar, QueryVar, FragmentVar) | |
| 703 | + | cret := xUriJoin(FlagsVar, core.NullableStringToPtr(SchemeVar), core.NullableStringToPtr(UserinfoVar), core.NullableStringToPtr(HostVar), PortVar, PathVar, core.NullableStringToPtr(QueryVar), core.NullableStringToPtr(FragmentVar)) | |
| 704 | 704 | return cret | |
| 705 | 705 | } | |
| 706 | 706 | ||
| 707 | - | var xUriJoinWithUser func(UriFlags, string, string, string, string, string, int, string, string, string) string | |
| 707 | + | var xUriJoinWithUser func(UriFlags, uintptr, uintptr, uintptr, uintptr, uintptr, int, string, uintptr, uintptr) string | |
| 708 | 708 | ||
| 709 | 709 | // Joins the given components together according to @flags to create | |
| 710 | 710 | // an absolute URI string. @path may not be %NULL (though it may be the empty | |
| @@ -715,9 +715,9 @@ var xUriJoinWithUser func(UriFlags, string, string, string, string, string, int, | |||
| 715 | 715 | // | |
| 716 | 716 | // %G_URI_FLAGS_HAS_PASSWORD and %G_URI_FLAGS_HAS_AUTH_PARAMS are ignored if set | |
| 717 | 717 | // in @flags. | |
| 718 | - | func UriJoinWithUser(FlagsVar UriFlags, SchemeVar string, UserVar string, PasswordVar string, AuthParamsVar string, HostVar string, PortVar int, PathVar string, QueryVar string, FragmentVar string) string { | |
| 718 | + | func UriJoinWithUser(FlagsVar UriFlags, SchemeVar *string, UserVar *string, PasswordVar *string, AuthParamsVar *string, HostVar *string, PortVar int, PathVar string, QueryVar *string, FragmentVar *string) string { | |
| 719 | 719 | ||
| 720 | - | cret := xUriJoinWithUser(FlagsVar, SchemeVar, UserVar, PasswordVar, AuthParamsVar, HostVar, PortVar, PathVar, QueryVar, FragmentVar) | |
| 720 | + | cret := xUriJoinWithUser(FlagsVar, core.NullableStringToPtr(SchemeVar), core.NullableStringToPtr(UserVar), core.NullableStringToPtr(PasswordVar), core.NullableStringToPtr(AuthParamsVar), core.NullableStringToPtr(HostVar), PortVar, PathVar, core.NullableStringToPtr(QueryVar), core.NullableStringToPtr(FragmentVar)) | |
| 721 | 721 | return cret | |
| 722 | 722 | } | |
| 723 | 723 | ||
| @@ -807,7 +807,7 @@ func UriPeekScheme(UriVar string) string { | |||
| 807 | 807 | return cret | |
| 808 | 808 | } | |
| 809 | 809 | ||
| 810 | - | var xUriResolveRelative func(string, string, UriFlags, **Error) string | |
| 810 | + | var xUriResolveRelative func(uintptr, string, UriFlags, **Error) string | |
| 811 | 811 | ||
| 812 | 812 | // Parses @uri_ref according to @flags and, if it is a | |
| 813 | 813 | // [relative URI](#relative-and-absolute-uris), resolves it relative to | |
| @@ -816,10 +816,10 @@ var xUriResolveRelative func(string, string, UriFlags, **Error) string | |||
| 816 | 816 | // | |
| 817 | 817 | // (If @base_uri_string is %NULL, this just returns @uri_ref, or | |
| 818 | 818 | // %NULL if @uri_ref is invalid or not absolute.) | |
| 819 | - | func UriResolveRelative(BaseUriStringVar string, UriRefVar string, FlagsVar UriFlags) (string, error) { | |
| 819 | + | func UriResolveRelative(BaseUriStringVar *string, UriRefVar string, FlagsVar UriFlags) (string, error) { | |
| 820 | 820 | var cerr *Error | |
| 821 | 821 | ||
| 822 | - | cret := xUriResolveRelative(BaseUriStringVar, UriRefVar, FlagsVar, &cerr) | |
| 822 | + | cret := xUriResolveRelative(core.NullableStringToPtr(BaseUriStringVar), UriRefVar, FlagsVar, &cerr) | |
| 823 | 823 | if cerr == nil { | |
| 824 | 824 | return cret, nil | |
| 825 | 825 | } | |
| @@ -899,7 +899,7 @@ func UriSplitWithUser(UriRefVar string, FlagsVar UriFlags, SchemeVar *string, Us | |||
| 899 | 899 | ||
| 900 | 900 | } | |
| 901 | 901 | ||
| 902 | - | var xUriUnescapeBytes func(string, int, string, **Error) *Bytes | |
| 902 | + | var xUriUnescapeBytes func(string, int, uintptr, **Error) *Bytes | |
| 903 | 903 | ||
| 904 | 904 | // Unescapes a segment of an escaped string as binary data. | |
| 905 | 905 | // | |
| @@ -911,10 +911,10 @@ var xUriUnescapeBytes func(string, int, string, **Error) *Bytes | |||
| 911 | 911 | // returned. This is useful if you want to avoid for instance having a slash | |
| 912 | 912 | // being expanded in an escaped path element, which might confuse pathname | |
| 913 | 913 | // handling. | |
| 914 | - | func UriUnescapeBytes(EscapedStringVar string, LengthVar int, IllegalCharactersVar string) (*Bytes, error) { | |
| 914 | + | func UriUnescapeBytes(EscapedStringVar string, LengthVar int, IllegalCharactersVar *string) (*Bytes, error) { | |
| 915 | 915 | var cerr *Error | |
| 916 | 916 | ||
| 917 | - | cret := xUriUnescapeBytes(EscapedStringVar, LengthVar, IllegalCharactersVar, &cerr) | |
| 917 | + | cret := xUriUnescapeBytes(EscapedStringVar, LengthVar, core.NullableStringToPtr(IllegalCharactersVar), &cerr) | |
| 918 | 918 | if cerr == nil { | |
| 919 | 919 | return cret, nil | |
| 920 | 920 | } | |
| @@ -922,7 +922,7 @@ func UriUnescapeBytes(EscapedStringVar string, LengthVar int, IllegalCharactersV | |||
| 922 | 922 | ||
| 923 | 923 | } | |
| 924 | 924 | ||
| 925 | - | var xUriUnescapeSegment func(string, string, string) string | |
| 925 | + | var xUriUnescapeSegment func(uintptr, uintptr, uintptr) string | |
| 926 | 926 | ||
| 927 | 927 | // Unescapes a segment of an escaped string. | |
| 928 | 928 | // | |
| @@ -934,13 +934,13 @@ var xUriUnescapeSegment func(string, string, string) string | |||
| 934 | 934 | // | |
| 935 | 935 | // Note: `NUL` byte is not accepted in the output, in contrast to | |
| 936 | 936 | // g_uri_unescape_bytes(). | |
| 937 | - | func UriUnescapeSegment(EscapedStringVar string, EscapedStringEndVar string, IllegalCharactersVar string) string { | |
| 937 | + | func UriUnescapeSegment(EscapedStringVar *string, EscapedStringEndVar *string, IllegalCharactersVar *string) string { | |
| 938 | 938 | ||
| 939 | - | cret := xUriUnescapeSegment(EscapedStringVar, EscapedStringEndVar, IllegalCharactersVar) | |
| 939 | + | cret := xUriUnescapeSegment(core.NullableStringToPtr(EscapedStringVar), core.NullableStringToPtr(EscapedStringEndVar), core.NullableStringToPtr(IllegalCharactersVar)) | |
| 940 | 940 | return cret | |
| 941 | 941 | } | |
| 942 | 942 | ||
| 943 | - | var xUriUnescapeString func(string, string) string | |
| 943 | + | var xUriUnescapeString func(string, uintptr) string | |
| 944 | 944 | ||
| 945 | 945 | // Unescapes a whole escaped string. | |
| 946 | 946 | // | |
| @@ -949,9 +949,9 @@ var xUriUnescapeString func(string, string) string | |||
| 949 | 949 | // that is an error and %NULL will be returned. This is useful if you | |
| 950 | 950 | // want to avoid for instance having a slash being expanded in an | |
| 951 | 951 | // escaped path element, which might confuse pathname handling. | |
| 952 | - | func UriUnescapeString(EscapedStringVar string, IllegalCharactersVar string) string { | |
| 952 | + | func UriUnescapeString(EscapedStringVar string, IllegalCharactersVar *string) string { | |
| 953 | 953 | ||
| 954 | - | cret := xUriUnescapeString(EscapedStringVar, IllegalCharactersVar) | |
| 954 | + | cret := xUriUnescapeString(EscapedStringVar, core.NullableStringToPtr(IllegalCharactersVar)) | |
| 955 | 955 | return cret | |
| 956 | 956 | } | |
| 957 | 957 | ||
M v4/glib/gutils.go +19 -4
| @@ -121,7 +121,22 @@ var xAtexit func(uintptr) | |||
| 121 | 121 | // program. | |
| 122 | 122 | func Atexit(FuncVar *VoidFunc) { | |
| 123 | 123 | ||
| 124 | - | xAtexit(NewCallback(FuncVar)) | |
| 124 | + | var FuncVarRef uintptr | |
| 125 | + | if FuncVar != nil { | |
| 126 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 127 | + | if cbRefPtr, ok := GetCallback(FuncVarPtr); ok { | |
| 128 | + | FuncVarRef = cbRefPtr | |
| 129 | + | } else { | |
| 130 | + | fcb := func() { | |
| 131 | + | cbFn := *FuncVar | |
| 132 | + | cbFn() | |
| 133 | + | } | |
| 134 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 135 | + | SaveCallback(FuncVarPtr, FuncVarRef) | |
| 136 | + | } | |
| 137 | + | } | |
| 138 | + | ||
| 139 | + | xAtexit(FuncVarRef) | |
| 125 | 140 | ||
| 126 | 141 | } | |
| 127 | 142 | ||
| @@ -596,7 +611,7 @@ func NullifyPointer(NullifyLocationVar uintptr) { | |||
| 596 | 611 | ||
| 597 | 612 | } | |
| 598 | 613 | ||
| 599 | - | var xParseDebugString func(string, []DebugKey, uint) uint | |
| 614 | + | var xParseDebugString func(uintptr, []DebugKey, uint) uint | |
| 600 | 615 | ||
| 601 | 616 | // Parses a string containing debugging options | |
| 602 | 617 | // into a %guint containing bit flags. This is used | |
| @@ -610,9 +625,9 @@ var xParseDebugString func(string, []DebugKey, uint) uint | |||
| 610 | 625 | // | |
| 611 | 626 | // If @string is equal to "help", all the available keys in @keys | |
| 612 | 627 | // are printed out to standard error. | |
| 613 | - | func ParseDebugString(StringVar string, KeysVar []DebugKey, NkeysVar uint) uint { | |
| 628 | + | func ParseDebugString(StringVar *string, KeysVar []DebugKey, NkeysVar uint) uint { | |
| 614 | 629 | ||
| 615 | - | cret := xParseDebugString(StringVar, KeysVar, NkeysVar) | |
| 630 | + | cret := xParseDebugString(core.NullableStringToPtr(StringVar), KeysVar, NkeysVar) | |
| 616 | 631 | return cret | |
| 617 | 632 | } | |
| 618 | 633 | ||
M v4/glib/gvariant.go +25 -10
| @@ -466,7 +466,22 @@ var xNewVariantFromData func(*VariantType, []byte, uint, bool, uintptr, uintptr) | |||
| 466 | 466 | // process. | |
| 467 | 467 | func NewVariantFromData(TypeVar *VariantType, DataVar []byte, SizeVar uint, TrustedVar bool, NotifyVar *DestroyNotify, UserDataVar uintptr) *Variant { | |
| 468 | 468 | ||
| 469 | - | cret := xNewVariantFromData(TypeVar, DataVar, SizeVar, TrustedVar, NewCallback(NotifyVar), UserDataVar) | |
| 469 | + | var NotifyVarRef uintptr | |
| 470 | + | if NotifyVar != nil { | |
| 471 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 472 | + | if cbRefPtr, ok := GetCallback(NotifyVarPtr); ok { | |
| 473 | + | NotifyVarRef = cbRefPtr | |
| 474 | + | } else { | |
| 475 | + | fcb := func(arg0 uintptr) { | |
| 476 | + | cbFn := *NotifyVar | |
| 477 | + | cbFn(arg0) | |
| 478 | + | } | |
| 479 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 480 | + | SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 481 | + | } | |
| 482 | + | } | |
| 483 | + | ||
| 484 | + | cret := xNewVariantFromData(TypeVar, DataVar, SizeVar, TrustedVar, NotifyVarRef, UserDataVar) | |
| 470 | 485 | return cret | |
| 471 | 486 | } | |
| 472 | 487 | ||
| @@ -737,7 +752,7 @@ func NewVariantUint64(ValueVar uint64) *Variant { | |||
| 737 | 752 | return cret | |
| 738 | 753 | } | |
| 739 | 754 | ||
| 740 | - | var xNewVariantVa func(string, string, []interface{}) *Variant | |
| 755 | + | var xNewVariantVa func(string, uintptr, []interface{}) *Variant | |
| 741 | 756 | ||
| 742 | 757 | // This function is intended to be used by libraries based on | |
| 743 | 758 | // #GVariant that want to provide g_variant_new()-like functionality | |
| @@ -775,9 +790,9 @@ var xNewVariantVa func(string, string, []interface{}) *Variant | |||
| 775 | 790 | // At this point, the caller will have their own full reference to the | |
| 776 | 791 | // result. This can also be done by adding the result to a container, | |
| 777 | 792 | // or by passing it to another g_variant_new() call. | |
| 778 | - | func NewVariantVa(FormatStringVar string, EndptrVar string, AppVar []interface{}) *Variant { | |
| 793 | + | func NewVariantVa(FormatStringVar string, EndptrVar *string, AppVar []interface{}) *Variant { | |
| 779 | 794 | ||
| 780 | - | cret := xNewVariantVa(FormatStringVar, EndptrVar, AppVar) | |
| 795 | + | cret := xNewVariantVa(FormatStringVar, core.NullableStringToPtr(EndptrVar), AppVar) | |
| 781 | 796 | return cret | |
| 782 | 797 | } | |
| 783 | 798 | ||
| @@ -1435,7 +1450,7 @@ func (x *Variant) GetUint64() uint64 { | |||
| 1435 | 1450 | return cret | |
| 1436 | 1451 | } | |
| 1437 | 1452 | ||
| 1438 | - | var xVariantGetVa func(uintptr, string, string, []interface{}) | |
| 1453 | + | var xVariantGetVa func(uintptr, string, uintptr, []interface{}) | |
| 1439 | 1454 | ||
| 1440 | 1455 | // This function is intended to be used by libraries based on #GVariant | |
| 1441 | 1456 | // that want to provide g_variant_get()-like functionality to their | |
| @@ -1461,9 +1476,9 @@ var xVariantGetVa func(uintptr, string, string, []interface{}) | |||
| 1461 | 1476 | // the values and also determines if the values are copied or borrowed, | |
| 1462 | 1477 | // see the section on | |
| 1463 | 1478 | // [`GVariant` format strings](gvariant-format-strings.html#pointers). | |
| 1464 | - | func (x *Variant) GetVa(FormatStringVar string, EndptrVar string, AppVar []interface{}) { | |
| 1479 | + | func (x *Variant) GetVa(FormatStringVar string, EndptrVar *string, AppVar []interface{}) { | |
| 1465 | 1480 | ||
| 1466 | - | xVariantGetVa(x.GoPointer(), FormatStringVar, EndptrVar, AppVar) | |
| 1481 | + | xVariantGetVa(x.GoPointer(), FormatStringVar, core.NullableStringToPtr(EndptrVar), AppVar) | |
| 1467 | 1482 | ||
| 1468 | 1483 | } | |
| 1469 | 1484 | ||
| @@ -2731,7 +2746,7 @@ func VariantIsSignature(StringVar string) bool { | |||
| 2731 | 2746 | return cret | |
| 2732 | 2747 | } | |
| 2733 | 2748 | ||
| 2734 | - | var xVariantParse func(*VariantType, string, string, string, **Error) *Variant | |
| 2749 | + | var xVariantParse func(*VariantType, string, uintptr, uintptr, **Error) *Variant | |
| 2735 | 2750 | ||
| 2736 | 2751 | // Parses a #GVariant from a text representation. | |
| 2737 | 2752 | // | |
| @@ -2769,10 +2784,10 @@ var xVariantParse func(*VariantType, string, string, string, **Error) *Variant | |||
| 2769 | 2784 | // There may be implementation specific restrictions on deeply nested values, | |
| 2770 | 2785 | // which would result in a %G_VARIANT_PARSE_ERROR_RECURSION error. #GVariant is | |
| 2771 | 2786 | // guaranteed to handle nesting up to at least 64 levels. | |
| 2772 | - | func VariantParse(TypeVar *VariantType, TextVar string, LimitVar string, EndptrVar string) (*Variant, error) { | |
| 2787 | + | func VariantParse(TypeVar *VariantType, TextVar string, LimitVar *string, EndptrVar *string) (*Variant, error) { | |
| 2773 | 2788 | var cerr *Error | |
| 2774 | 2789 | ||
| 2775 | - | cret := xVariantParse(TypeVar, TextVar, LimitVar, EndptrVar, &cerr) | |
| 2790 | + | cret := xVariantParse(TypeVar, TextVar, core.NullableStringToPtr(LimitVar), core.NullableStringToPtr(EndptrVar), &cerr) | |
| 2776 | 2791 | if cerr == nil { | |
| 2777 | 2792 | return cret, nil | |
| 2778 | 2793 | } | |
M v4/glib/gvarianttype.go +3 -3
| @@ -625,7 +625,7 @@ func VariantTypeStringIsValid(TypeStringVar string) bool { | |||
| 625 | 625 | return cret | |
| 626 | 626 | } | |
| 627 | 627 | ||
| 628 | - | var xVariantTypeStringScan func(string, string, *string) bool | |
| 628 | + | var xVariantTypeStringScan func(string, uintptr, *string) bool | |
| 629 | 629 | ||
| 630 | 630 | // Scan for a single complete and valid GVariant type string in @string. | |
| 631 | 631 | // | |
| @@ -641,9 +641,9 @@ var xVariantTypeStringScan func(string, string, *string) bool | |||
| 641 | 641 | // | |
| 642 | 642 | // For the simple case of checking if a string is a valid type string, | |
| 643 | 643 | // see [func@GLib.VariantType.string_is_valid]. | |
| 644 | - | func VariantTypeStringScan(StringVar string, LimitVar string, EndptrVar *string) bool { | |
| 644 | + | func VariantTypeStringScan(StringVar string, LimitVar *string, EndptrVar *string) bool { | |
| 645 | 645 | ||
| 646 | - | cret := xVariantTypeStringScan(StringVar, LimitVar, EndptrVar) | |
| 646 | + | cret := xVariantTypeStringScan(StringVar, core.NullableStringToPtr(LimitVar), EndptrVar) | |
| 647 | 647 | return cret | |
| 648 | 648 | } | |
| 649 | 649 | ||
M v4/gmodule/gmodule.go +3 -3
| @@ -107,7 +107,7 @@ const ( | |||
| 107 | 107 | GModuleErrorCheckFailedValue ModuleError = 1 | |
| 108 | 108 | ) | |
| 109 | 109 | ||
| 110 | - | var xModuleBuildPath func(string, string) string | |
| 110 | + | var xModuleBuildPath func(uintptr, string) string | |
| 111 | 111 | ||
| 112 | 112 | // A portable way to build the filename of a module. The platform-specific | |
| 113 | 113 | // prefix and suffix are added to the filename, if needed, and the result | |
| @@ -122,9 +122,9 @@ var xModuleBuildPath func(string, string) string | |||
| 122 | 122 | // @directory of `/lib` and a @module_name of "mylibrary" will return | |
| 123 | 123 | // `/lib/libmylibrary.so`. On a Windows system, using `\Windows` as the | |
| 124 | 124 | // directory it will return `\Windows\mylibrary.dll`. | |
| 125 | - | func ModuleBuildPath(DirectoryVar string, ModuleNameVar string) string { | |
| 125 | + | func ModuleBuildPath(DirectoryVar *string, ModuleNameVar string) string { | |
| 126 | 126 | ||
| 127 | - | cret := xModuleBuildPath(DirectoryVar, ModuleNameVar) | |
| 127 | + | cret := xModuleBuildPath(core.NullableStringToPtr(DirectoryVar), ModuleNameVar) | |
| 128 | 128 | return cret | |
| 129 | 129 | } | |
| 130 | 130 | ||
M v4/gobject/gbinding.go +2 -2
| @@ -306,7 +306,7 @@ func (c *Binding) SetGoPointer(ptr uintptr) { | |||
| 306 | 306 | func (x *Binding) SetPropertySourceProperty(value string) { | |
| 307 | 307 | var v Value | |
| 308 | 308 | v.Init(TypeStringVal) | |
| 309 | - | v.SetString(value) | |
| 309 | + | v.SetString(&value) | |
| 310 | 310 | x.SetProperty("source-property", &v) | |
| 311 | 311 | } | |
| 312 | 312 | ||
| @@ -331,7 +331,7 @@ func (x *Binding) GetPropertySourceProperty() string { | |||
| 331 | 331 | func (x *Binding) SetPropertyTargetProperty(value string) { | |
| 332 | 332 | var v Value | |
| 333 | 333 | v.Init(TypeStringVal) | |
| 334 | - | v.SetString(value) | |
| 334 | + | v.SetString(&value) | |
| 335 | 335 | x.SetProperty("target-property", &v) | |
| 336 | 336 | } | |
| 337 | 337 | ||
M v4/gobject/gbindinggroup.go +48 -1
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | package gobject | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 5 | 7 | "github.com/jwijenbergh/purego" | |
| 6 | 8 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 9 | "github.com/jwijenbergh/puregotk/v4/glib" | |
| @@ -71,7 +73,52 @@ var xBindingGroupBindFull func(uintptr, string, uintptr, string, BindingFlags, u | |||
| 71 | 73 | // See g_object_bind_property_full() for more information. | |
| 72 | 74 | func (x *BindingGroup) BindFull(SourcePropertyVar string, TargetVar *Object, TargetPropertyVar string, FlagsVar BindingFlags, TransformToVar *BindingTransformFunc, TransformFromVar *BindingTransformFunc, UserDataVar uintptr, UserDataDestroyVar *glib.DestroyNotify) { | |
| 73 | 75 | ||
| 74 | - | xBindingGroupBindFull(x.GoPointer(), SourcePropertyVar, TargetVar.GoPointer(), TargetPropertyVar, FlagsVar, glib.NewCallbackNullable(TransformToVar), glib.NewCallbackNullable(TransformFromVar), UserDataVar, glib.NewCallback(UserDataDestroyVar)) | |
| 76 | + | var TransformToVarRef uintptr | |
| 77 | + | if TransformToVar != nil { | |
| 78 | + | TransformToVarPtr := uintptr(unsafe.Pointer(TransformToVar)) | |
| 79 | + | if cbRefPtr, ok := glib.GetCallback(TransformToVarPtr); ok { | |
| 80 | + | TransformToVarRef = cbRefPtr | |
| 81 | + | } else { | |
| 82 | + | fcb := func(arg0 uintptr, arg1 *Value, arg2 *Value, arg3 uintptr) bool { | |
| 83 | + | cbFn := *TransformToVar | |
| 84 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 85 | + | } | |
| 86 | + | TransformToVarRef = purego.NewCallback(fcb) | |
| 87 | + | glib.SaveCallback(TransformToVarPtr, TransformToVarRef) | |
| 88 | + | } | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | var TransformFromVarRef uintptr | |
| 92 | + | if TransformFromVar != nil { | |
| 93 | + | TransformFromVarPtr := uintptr(unsafe.Pointer(TransformFromVar)) | |
| 94 | + | if cbRefPtr, ok := glib.GetCallback(TransformFromVarPtr); ok { | |
| 95 | + | TransformFromVarRef = cbRefPtr | |
| 96 | + | } else { | |
| 97 | + | fcb := func(arg0 uintptr, arg1 *Value, arg2 *Value, arg3 uintptr) bool { | |
| 98 | + | cbFn := *TransformFromVar | |
| 99 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 100 | + | } | |
| 101 | + | TransformFromVarRef = purego.NewCallback(fcb) | |
| 102 | + | glib.SaveCallback(TransformFromVarPtr, TransformFromVarRef) | |
| 103 | + | } | |
| 104 | + | } | |
| 105 | + | ||
| 106 | + | var UserDataDestroyVarRef uintptr | |
| 107 | + | if UserDataDestroyVar != nil { | |
| 108 | + | UserDataDestroyVarPtr := uintptr(unsafe.Pointer(UserDataDestroyVar)) | |
| 109 | + | if cbRefPtr, ok := glib.GetCallback(UserDataDestroyVarPtr); ok { | |
| 110 | + | UserDataDestroyVarRef = cbRefPtr | |
| 111 | + | } else { | |
| 112 | + | fcb := func(arg0 uintptr) { | |
| 113 | + | cbFn := *UserDataDestroyVar | |
| 114 | + | cbFn(arg0) | |
| 115 | + | } | |
| 116 | + | UserDataDestroyVarRef = purego.NewCallback(fcb) | |
| 117 | + | glib.SaveCallback(UserDataDestroyVarPtr, UserDataDestroyVarRef) | |
| 118 | + | } | |
| 119 | + | } | |
| 120 | + | ||
| 121 | + | xBindingGroupBindFull(x.GoPointer(), SourcePropertyVar, TargetVar.GoPointer(), TargetPropertyVar, FlagsVar, TransformToVarRef, TransformFromVarRef, UserDataVar, UserDataDestroyVarRef) | |
| 75 | 122 | ||
| 76 | 123 | } | |
| 77 | 124 | ||
M v4/gobject/gboxed.go +33 -1
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | package gobject | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 5 | 7 | "github.com/jwijenbergh/purego" | |
| 6 | 8 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 9 | "github.com/jwijenbergh/puregotk/v4/glib" | |
| @@ -47,7 +49,37 @@ var xBoxedTypeRegisterStatic func(string, uintptr, uintptr) types.GType | |||
| 47 | 49 | // will create the appropriate `*_get_type()` function for the boxed type. | |
| 48 | 50 | func BoxedTypeRegisterStatic(NameVar string, BoxedCopyVar *BoxedCopyFunc, BoxedFreeVar *BoxedFreeFunc) types.GType { | |
| 49 | 51 | ||
| 50 | - | cret := xBoxedTypeRegisterStatic(NameVar, glib.NewCallback(BoxedCopyVar), glib.NewCallback(BoxedFreeVar)) | |
| 52 | + | var BoxedCopyVarRef uintptr | |
| 53 | + | if BoxedCopyVar != nil { | |
| 54 | + | BoxedCopyVarPtr := uintptr(unsafe.Pointer(BoxedCopyVar)) | |
| 55 | + | if cbRefPtr, ok := glib.GetCallback(BoxedCopyVarPtr); ok { | |
| 56 | + | BoxedCopyVarRef = cbRefPtr | |
| 57 | + | } else { | |
| 58 | + | fcb := func(arg0 uintptr) uintptr { | |
| 59 | + | cbFn := *BoxedCopyVar | |
| 60 | + | return cbFn(arg0) | |
| 61 | + | } | |
| 62 | + | BoxedCopyVarRef = purego.NewCallback(fcb) | |
| 63 | + | glib.SaveCallback(BoxedCopyVarPtr, BoxedCopyVarRef) | |
| 64 | + | } | |
| 65 | + | } | |
| 66 | + | ||
| 67 | + | var BoxedFreeVarRef uintptr | |
| 68 | + | if BoxedFreeVar != nil { | |
| 69 | + | BoxedFreeVarPtr := uintptr(unsafe.Pointer(BoxedFreeVar)) | |
| 70 | + | if cbRefPtr, ok := glib.GetCallback(BoxedFreeVarPtr); ok { | |
| 71 | + | BoxedFreeVarRef = cbRefPtr | |
| 72 | + | } else { | |
| 73 | + | fcb := func(arg0 uintptr) { | |
| 74 | + | cbFn := *BoxedFreeVar | |
| 75 | + | cbFn(arg0) | |
| 76 | + | } | |
| 77 | + | BoxedFreeVarRef = purego.NewCallback(fcb) | |
| 78 | + | glib.SaveCallback(BoxedFreeVarPtr, BoxedFreeVarRef) | |
| 79 | + | } | |
| 80 | + | } | |
| 81 | + | ||
| 82 | + | cret := xBoxedTypeRegisterStatic(NameVar, BoxedCopyVarRef, BoxedFreeVarRef) | |
| 51 | 83 | return cret | |
| 52 | 84 | } | |
| 53 | 85 | ||
M v4/gobject/gclosure.go +189 -9
| @@ -203,7 +203,22 @@ var xClosureAddFinalizeNotifier func(uintptr, uintptr, uintptr) | |||
| 203 | 203 | // notifiers will be run before the finalize notifiers. | |
| 204 | 204 | func (x *Closure) AddFinalizeNotifier(NotifyDataVar uintptr, NotifyFuncVar *ClosureNotify) { | |
| 205 | 205 | ||
| 206 | - | xClosureAddFinalizeNotifier(x.GoPointer(), NotifyDataVar, glib.NewCallback(NotifyFuncVar)) | |
| 206 | + | var NotifyFuncVarRef uintptr | |
| 207 | + | if NotifyFuncVar != nil { | |
| 208 | + | NotifyFuncVarPtr := uintptr(unsafe.Pointer(NotifyFuncVar)) | |
| 209 | + | if cbRefPtr, ok := glib.GetCallback(NotifyFuncVarPtr); ok { | |
| 210 | + | NotifyFuncVarRef = cbRefPtr | |
| 211 | + | } else { | |
| 212 | + | fcb := func(arg0 uintptr, arg1 *Closure) { | |
| 213 | + | cbFn := *NotifyFuncVar | |
| 214 | + | cbFn(arg0, arg1) | |
| 215 | + | } | |
| 216 | + | NotifyFuncVarRef = purego.NewCallback(fcb) | |
| 217 | + | glib.SaveCallback(NotifyFuncVarPtr, NotifyFuncVarRef) | |
| 218 | + | } | |
| 219 | + | } | |
| 220 | + | ||
| 221 | + | xClosureAddFinalizeNotifier(x.GoPointer(), NotifyDataVar, NotifyFuncVarRef) | |
| 207 | 222 | ||
| 208 | 223 | } | |
| 209 | 224 | ||
| @@ -216,7 +231,22 @@ var xClosureAddInvalidateNotifier func(uintptr, uintptr, uintptr) | |||
| 216 | 231 | // in an unspecified order. | |
| 217 | 232 | func (x *Closure) AddInvalidateNotifier(NotifyDataVar uintptr, NotifyFuncVar *ClosureNotify) { | |
| 218 | 233 | ||
| 219 | - | xClosureAddInvalidateNotifier(x.GoPointer(), NotifyDataVar, glib.NewCallback(NotifyFuncVar)) | |
| 234 | + | var NotifyFuncVarRef uintptr | |
| 235 | + | if NotifyFuncVar != nil { | |
| 236 | + | NotifyFuncVarPtr := uintptr(unsafe.Pointer(NotifyFuncVar)) | |
| 237 | + | if cbRefPtr, ok := glib.GetCallback(NotifyFuncVarPtr); ok { | |
| 238 | + | NotifyFuncVarRef = cbRefPtr | |
| 239 | + | } else { | |
| 240 | + | fcb := func(arg0 uintptr, arg1 *Closure) { | |
| 241 | + | cbFn := *NotifyFuncVar | |
| 242 | + | cbFn(arg0, arg1) | |
| 243 | + | } | |
| 244 | + | NotifyFuncVarRef = purego.NewCallback(fcb) | |
| 245 | + | glib.SaveCallback(NotifyFuncVarPtr, NotifyFuncVarRef) | |
| 246 | + | } | |
| 247 | + | } | |
| 248 | + | ||
| 249 | + | xClosureAddInvalidateNotifier(x.GoPointer(), NotifyDataVar, NotifyFuncVarRef) | |
| 220 | 250 | ||
| 221 | 251 | } | |
| 222 | 252 | ||
| @@ -230,7 +260,37 @@ var xClosureAddMarshalGuards func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||
| 230 | 260 | // example of marshal guards. | |
| 231 | 261 | func (x *Closure) AddMarshalGuards(PreMarshalDataVar uintptr, PreMarshalNotifyVar *ClosureNotify, PostMarshalDataVar uintptr, PostMarshalNotifyVar *ClosureNotify) { | |
| 232 | 262 | ||
| 233 | - | xClosureAddMarshalGuards(x.GoPointer(), PreMarshalDataVar, glib.NewCallback(PreMarshalNotifyVar), PostMarshalDataVar, glib.NewCallback(PostMarshalNotifyVar)) | |
| 263 | + | var PreMarshalNotifyVarRef uintptr | |
| 264 | + | if PreMarshalNotifyVar != nil { | |
| 265 | + | PreMarshalNotifyVarPtr := uintptr(unsafe.Pointer(PreMarshalNotifyVar)) | |
| 266 | + | if cbRefPtr, ok := glib.GetCallback(PreMarshalNotifyVarPtr); ok { | |
| 267 | + | PreMarshalNotifyVarRef = cbRefPtr | |
| 268 | + | } else { | |
| 269 | + | fcb := func(arg0 uintptr, arg1 *Closure) { | |
| 270 | + | cbFn := *PreMarshalNotifyVar | |
| 271 | + | cbFn(arg0, arg1) | |
| 272 | + | } | |
| 273 | + | PreMarshalNotifyVarRef = purego.NewCallback(fcb) | |
| 274 | + | glib.SaveCallback(PreMarshalNotifyVarPtr, PreMarshalNotifyVarRef) | |
| 275 | + | } | |
| 276 | + | } | |
| 277 | + | ||
| 278 | + | var PostMarshalNotifyVarRef uintptr | |
| 279 | + | if PostMarshalNotifyVar != nil { | |
| 280 | + | PostMarshalNotifyVarPtr := uintptr(unsafe.Pointer(PostMarshalNotifyVar)) | |
| 281 | + | if cbRefPtr, ok := glib.GetCallback(PostMarshalNotifyVarPtr); ok { | |
| 282 | + | PostMarshalNotifyVarRef = cbRefPtr | |
| 283 | + | } else { | |
| 284 | + | fcb := func(arg0 uintptr, arg1 *Closure) { | |
| 285 | + | cbFn := *PostMarshalNotifyVar | |
| 286 | + | cbFn(arg0, arg1) | |
| 287 | + | } | |
| 288 | + | PostMarshalNotifyVarRef = purego.NewCallback(fcb) | |
| 289 | + | glib.SaveCallback(PostMarshalNotifyVarPtr, PostMarshalNotifyVarRef) | |
| 290 | + | } | |
| 291 | + | } | |
| 292 | + | ||
| 293 | + | xClosureAddMarshalGuards(x.GoPointer(), PreMarshalDataVar, PreMarshalNotifyVarRef, PostMarshalDataVar, PostMarshalNotifyVarRef) | |
| 234 | 294 | ||
| 235 | 295 | } | |
| 236 | 296 | ||
| @@ -283,7 +343,22 @@ var xClosureRemoveFinalizeNotifier func(uintptr, uintptr, uintptr) | |||
| 283 | 343 | // Notice that notifiers are automatically removed after they are run. | |
| 284 | 344 | func (x *Closure) RemoveFinalizeNotifier(NotifyDataVar uintptr, NotifyFuncVar *ClosureNotify) { | |
| 285 | 345 | ||
| 286 | - | xClosureRemoveFinalizeNotifier(x.GoPointer(), NotifyDataVar, glib.NewCallback(NotifyFuncVar)) | |
| 346 | + | var NotifyFuncVarRef uintptr | |
| 347 | + | if NotifyFuncVar != nil { | |
| 348 | + | NotifyFuncVarPtr := uintptr(unsafe.Pointer(NotifyFuncVar)) | |
| 349 | + | if cbRefPtr, ok := glib.GetCallback(NotifyFuncVarPtr); ok { | |
| 350 | + | NotifyFuncVarRef = cbRefPtr | |
| 351 | + | } else { | |
| 352 | + | fcb := func(arg0 uintptr, arg1 *Closure) { | |
| 353 | + | cbFn := *NotifyFuncVar | |
| 354 | + | cbFn(arg0, arg1) | |
| 355 | + | } | |
| 356 | + | NotifyFuncVarRef = purego.NewCallback(fcb) | |
| 357 | + | glib.SaveCallback(NotifyFuncVarPtr, NotifyFuncVarRef) | |
| 358 | + | } | |
| 359 | + | } | |
| 360 | + | ||
| 361 | + | xClosureRemoveFinalizeNotifier(x.GoPointer(), NotifyDataVar, NotifyFuncVarRef) | |
| 287 | 362 | ||
| 288 | 363 | } | |
| 289 | 364 | ||
| @@ -294,7 +369,22 @@ var xClosureRemoveInvalidateNotifier func(uintptr, uintptr, uintptr) | |||
| 294 | 369 | // Notice that notifiers are automatically removed after they are run. | |
| 295 | 370 | func (x *Closure) RemoveInvalidateNotifier(NotifyDataVar uintptr, NotifyFuncVar *ClosureNotify) { | |
| 296 | 371 | ||
| 297 | - | xClosureRemoveInvalidateNotifier(x.GoPointer(), NotifyDataVar, glib.NewCallback(NotifyFuncVar)) | |
| 372 | + | var NotifyFuncVarRef uintptr | |
| 373 | + | if NotifyFuncVar != nil { | |
| 374 | + | NotifyFuncVarPtr := uintptr(unsafe.Pointer(NotifyFuncVar)) | |
| 375 | + | if cbRefPtr, ok := glib.GetCallback(NotifyFuncVarPtr); ok { | |
| 376 | + | NotifyFuncVarRef = cbRefPtr | |
| 377 | + | } else { | |
| 378 | + | fcb := func(arg0 uintptr, arg1 *Closure) { | |
| 379 | + | cbFn := *NotifyFuncVar | |
| 380 | + | cbFn(arg0, arg1) | |
| 381 | + | } | |
| 382 | + | NotifyFuncVarRef = purego.NewCallback(fcb) | |
| 383 | + | glib.SaveCallback(NotifyFuncVarPtr, NotifyFuncVarRef) | |
| 384 | + | } | |
| 385 | + | } | |
| 386 | + | ||
| 387 | + | xClosureRemoveInvalidateNotifier(x.GoPointer(), NotifyDataVar, NotifyFuncVarRef) | |
| 298 | 388 | ||
| 299 | 389 | } | |
| 300 | 390 | ||
| @@ -312,7 +402,22 @@ var xClosureSetMarshal func(uintptr, uintptr) | |||
| 312 | 402 | // See also: g_closure_set_meta_marshal() | |
| 313 | 403 | func (x *Closure) SetMarshal(MarshalVar *ClosureMarshal) { | |
| 314 | 404 | ||
| 315 | - | xClosureSetMarshal(x.GoPointer(), glib.NewCallback(MarshalVar)) | |
| 405 | + | var MarshalVarRef uintptr | |
| 406 | + | if MarshalVar != nil { | |
| 407 | + | MarshalVarPtr := uintptr(unsafe.Pointer(MarshalVar)) | |
| 408 | + | if cbRefPtr, ok := glib.GetCallback(MarshalVarPtr); ok { | |
| 409 | + | MarshalVarRef = cbRefPtr | |
| 410 | + | } else { | |
| 411 | + | fcb := func(arg0 *Closure, arg1 *Value, arg2 uint, arg3 []Value, arg4 uintptr, arg5 uintptr) { | |
| 412 | + | cbFn := *MarshalVar | |
| 413 | + | cbFn(arg0, arg1, arg2, arg3, arg4, arg5) | |
| 414 | + | } | |
| 415 | + | MarshalVarRef = purego.NewCallback(fcb) | |
| 416 | + | glib.SaveCallback(MarshalVarPtr, MarshalVarRef) | |
| 417 | + | } | |
| 418 | + | } | |
| 419 | + | ||
| 420 | + | xClosureSetMarshal(x.GoPointer(), MarshalVarRef) | |
| 316 | 421 | ||
| 317 | 422 | } | |
| 318 | 423 | ||
| @@ -337,7 +442,22 @@ var xClosureSetMetaMarshal func(uintptr, uintptr, uintptr) | |||
| 337 | 442 | // @marshal_data argument. | |
| 338 | 443 | func (x *Closure) SetMetaMarshal(MarshalDataVar uintptr, MetaMarshalVar *ClosureMarshal) { | |
| 339 | 444 | ||
| 340 | - | xClosureSetMetaMarshal(x.GoPointer(), MarshalDataVar, glib.NewCallback(MetaMarshalVar)) | |
| 445 | + | var MetaMarshalVarRef uintptr | |
| 446 | + | if MetaMarshalVar != nil { | |
| 447 | + | MetaMarshalVarPtr := uintptr(unsafe.Pointer(MetaMarshalVar)) | |
| 448 | + | if cbRefPtr, ok := glib.GetCallback(MetaMarshalVarPtr); ok { | |
| 449 | + | MetaMarshalVarRef = cbRefPtr | |
| 450 | + | } else { | |
| 451 | + | fcb := func(arg0 *Closure, arg1 *Value, arg2 uint, arg3 []Value, arg4 uintptr, arg5 uintptr) { | |
| 452 | + | cbFn := *MetaMarshalVar | |
| 453 | + | cbFn(arg0, arg1, arg2, arg3, arg4, arg5) | |
| 454 | + | } | |
| 455 | + | MetaMarshalVarRef = purego.NewCallback(fcb) | |
| 456 | + | glib.SaveCallback(MetaMarshalVarPtr, MetaMarshalVarRef) | |
| 457 | + | } | |
| 458 | + | } | |
| 459 | + | ||
| 460 | + | xClosureSetMetaMarshal(x.GoPointer(), MarshalDataVar, MetaMarshalVarRef) | |
| 341 | 461 | ||
| 342 | 462 | } | |
| 343 | 463 | ||
| @@ -467,7 +587,37 @@ var xCclosureNew func(uintptr, uintptr, uintptr) *Closure | |||
| 467 | 587 | // @destroy_data will be called as a finalize notifier on the #GClosure. | |
| 468 | 588 | func CclosureNew(CallbackFuncVar *Callback, UserDataVar uintptr, DestroyDataVar *ClosureNotify) *Closure { | |
| 469 | 589 | ||
| 470 | - | cret := xCclosureNew(glib.NewCallback(CallbackFuncVar), UserDataVar, glib.NewCallback(DestroyDataVar)) | |
| 590 | + | var CallbackFuncVarRef uintptr | |
| 591 | + | if CallbackFuncVar != nil { | |
| 592 | + | CallbackFuncVarPtr := uintptr(unsafe.Pointer(CallbackFuncVar)) | |
| 593 | + | if cbRefPtr, ok := glib.GetCallback(CallbackFuncVarPtr); ok { | |
| 594 | + | CallbackFuncVarRef = cbRefPtr | |
| 595 | + | } else { | |
| 596 | + | fcb := func() { | |
| 597 | + | cbFn := *CallbackFuncVar | |
| 598 | + | cbFn() | |
| 599 | + | } | |
| 600 | + | CallbackFuncVarRef = purego.NewCallback(fcb) | |
| 601 | + | glib.SaveCallback(CallbackFuncVarPtr, CallbackFuncVarRef) | |
| 602 | + | } | |
| 603 | + | } | |
| 604 | + | ||
| 605 | + | var DestroyDataVarRef uintptr | |
| 606 | + | if DestroyDataVar != nil { | |
| 607 | + | DestroyDataVarPtr := uintptr(unsafe.Pointer(DestroyDataVar)) | |
| 608 | + | if cbRefPtr, ok := glib.GetCallback(DestroyDataVarPtr); ok { | |
| 609 | + | DestroyDataVarRef = cbRefPtr | |
| 610 | + | } else { | |
| 611 | + | fcb := func(arg0 uintptr, arg1 *Closure) { | |
| 612 | + | cbFn := *DestroyDataVar | |
| 613 | + | cbFn(arg0, arg1) | |
| 614 | + | } | |
| 615 | + | DestroyDataVarRef = purego.NewCallback(fcb) | |
| 616 | + | glib.SaveCallback(DestroyDataVarPtr, DestroyDataVarRef) | |
| 617 | + | } | |
| 618 | + | } | |
| 619 | + | ||
| 620 | + | cret := xCclosureNew(CallbackFuncVarRef, UserDataVar, DestroyDataVarRef) | |
| 471 | 621 | return cret | |
| 472 | 622 | } | |
| 473 | 623 | ||
| @@ -479,7 +629,37 @@ var xCclosureNewSwap func(uintptr, uintptr, uintptr) *Closure | |||
| 479 | 629 | // @destroy_data will be called as a finalize notifier on the #GClosure. | |
| 480 | 630 | func CclosureNewSwap(CallbackFuncVar *Callback, UserDataVar uintptr, DestroyDataVar *ClosureNotify) *Closure { | |
| 481 | 631 | ||
| 482 | - | cret := xCclosureNewSwap(glib.NewCallback(CallbackFuncVar), UserDataVar, glib.NewCallback(DestroyDataVar)) | |
| 632 | + | var CallbackFuncVarRef uintptr | |
| 633 | + | if CallbackFuncVar != nil { | |
| 634 | + | CallbackFuncVarPtr := uintptr(unsafe.Pointer(CallbackFuncVar)) | |
| 635 | + | if cbRefPtr, ok := glib.GetCallback(CallbackFuncVarPtr); ok { | |
| 636 | + | CallbackFuncVarRef = cbRefPtr | |
| 637 | + | } else { | |
| 638 | + | fcb := func() { | |
| 639 | + | cbFn := *CallbackFuncVar | |
| 640 | + | cbFn() | |
| 641 | + | } | |
| 642 | + | CallbackFuncVarRef = purego.NewCallback(fcb) | |
| 643 | + | glib.SaveCallback(CallbackFuncVarPtr, CallbackFuncVarRef) | |
| 644 | + | } | |
| 645 | + | } | |
| 646 | + | ||
| 647 | + | var DestroyDataVarRef uintptr | |
| 648 | + | if DestroyDataVar != nil { | |
| 649 | + | DestroyDataVarPtr := uintptr(unsafe.Pointer(DestroyDataVar)) | |
| 650 | + | if cbRefPtr, ok := glib.GetCallback(DestroyDataVarPtr); ok { | |
| 651 | + | DestroyDataVarRef = cbRefPtr | |
| 652 | + | } else { | |
| 653 | + | fcb := func(arg0 uintptr, arg1 *Closure) { | |
| 654 | + | cbFn := *DestroyDataVar | |
| 655 | + | cbFn(arg0, arg1) | |
| 656 | + | } | |
| 657 | + | DestroyDataVarRef = purego.NewCallback(fcb) | |
| 658 | + | glib.SaveCallback(DestroyDataVarPtr, DestroyDataVarRef) | |
| 659 | + | } | |
| 660 | + | } | |
| 661 | + | ||
| 662 | + | cret := xCclosureNewSwap(CallbackFuncVarRef, UserDataVar, DestroyDataVarRef) | |
| 483 | 663 | return cret | |
| 484 | 664 | } | |
| 485 | 665 | ||
M v4/gobject/gobject.go +277 -14
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | package gobject | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "fmt" | |
| 5 | 6 | "structs" | |
| 6 | 7 | "unsafe" | |
| 7 | 8 | ||
| @@ -931,7 +932,22 @@ var xCclosureNewObject func(uintptr, uintptr) *Closure | |||
| 931 | 932 | // after the object is is freed. | |
| 932 | 933 | func CclosureNewObject(CallbackFuncVar *Callback, ObjectVar *Object) *Closure { | |
| 933 | 934 | ||
| 934 | - | cret := xCclosureNewObject(glib.NewCallback(CallbackFuncVar), ObjectVar.GoPointer()) | |
| 935 | + | var CallbackFuncVarRef uintptr | |
| 936 | + | if CallbackFuncVar != nil { | |
| 937 | + | CallbackFuncVarPtr := uintptr(unsafe.Pointer(CallbackFuncVar)) | |
| 938 | + | if cbRefPtr, ok := glib.GetCallback(CallbackFuncVarPtr); ok { | |
| 939 | + | CallbackFuncVarRef = cbRefPtr | |
| 940 | + | } else { | |
| 941 | + | fcb := func() { | |
| 942 | + | cbFn := *CallbackFuncVar | |
| 943 | + | cbFn() | |
| 944 | + | } | |
| 945 | + | CallbackFuncVarRef = purego.NewCallback(fcb) | |
| 946 | + | glib.SaveCallback(CallbackFuncVarPtr, CallbackFuncVarRef) | |
| 947 | + | } | |
| 948 | + | } | |
| 949 | + | ||
| 950 | + | cret := xCclosureNewObject(CallbackFuncVarRef, ObjectVar.GoPointer()) | |
| 935 | 951 | return cret | |
| 936 | 952 | } | |
| 937 | 953 | ||
| @@ -944,7 +960,22 @@ var xCclosureNewObjectSwap func(uintptr, uintptr) *Closure | |||
| 944 | 960 | // after the object is is freed. | |
| 945 | 961 | func CclosureNewObjectSwap(CallbackFuncVar *Callback, ObjectVar *Object) *Closure { | |
| 946 | 962 | ||
| 947 | - | cret := xCclosureNewObjectSwap(glib.NewCallback(CallbackFuncVar), ObjectVar.GoPointer()) | |
| 963 | + | var CallbackFuncVarRef uintptr | |
| 964 | + | if CallbackFuncVar != nil { | |
| 965 | + | CallbackFuncVarPtr := uintptr(unsafe.Pointer(CallbackFuncVar)) | |
| 966 | + | if cbRefPtr, ok := glib.GetCallback(CallbackFuncVarPtr); ok { | |
| 967 | + | CallbackFuncVarRef = cbRefPtr | |
| 968 | + | } else { | |
| 969 | + | fcb := func() { | |
| 970 | + | cbFn := *CallbackFuncVar | |
| 971 | + | cbFn() | |
| 972 | + | } | |
| 973 | + | CallbackFuncVarRef = purego.NewCallback(fcb) | |
| 974 | + | glib.SaveCallback(CallbackFuncVarPtr, CallbackFuncVarRef) | |
| 975 | + | } | |
| 976 | + | } | |
| 977 | + | ||
| 978 | + | cret := xCclosureNewObjectSwap(CallbackFuncVarRef, ObjectVar.GoPointer()) | |
| 948 | 979 | return cret | |
| 949 | 980 | } | |
| 950 | 981 | ||
| @@ -986,7 +1017,22 @@ var xSignalConnectObject func(*TypeInstance, string, uintptr, uintptr, ConnectFl | |||
| 986 | 1017 | // details. | |
| 987 | 1018 | func SignalConnectObject(InstanceVar *TypeInstance, DetailedSignalVar string, CHandlerVar *Callback, GobjectVar *Object, ConnectFlagsVar ConnectFlags) uint32 { | |
| 988 | 1019 | ||
| 989 | - | cret := xSignalConnectObject(InstanceVar, DetailedSignalVar, glib.NewCallback(CHandlerVar), GobjectVar.GoPointer(), ConnectFlagsVar) | |
| 1020 | + | var CHandlerVarRef uintptr | |
| 1021 | + | if CHandlerVar != nil { | |
| 1022 | + | CHandlerVarPtr := uintptr(unsafe.Pointer(CHandlerVar)) | |
| 1023 | + | if cbRefPtr, ok := glib.GetCallback(CHandlerVarPtr); ok { | |
| 1024 | + | CHandlerVarRef = cbRefPtr | |
| 1025 | + | } else { | |
| 1026 | + | fcb := func() { | |
| 1027 | + | cbFn := *CHandlerVar | |
| 1028 | + | cbFn() | |
| 1029 | + | } | |
| 1030 | + | CHandlerVarRef = purego.NewCallback(fcb) | |
| 1031 | + | glib.SaveCallback(CHandlerVarPtr, CHandlerVarRef) | |
| 1032 | + | } | |
| 1033 | + | } | |
| 1034 | + | ||
| 1035 | + | cret := xSignalConnectObject(InstanceVar, DetailedSignalVar, CHandlerVarRef, GobjectVar.GoPointer(), ConnectFlagsVar) | |
| 990 | 1036 | return cret | |
| 991 | 1037 | } | |
| 992 | 1038 | ||
| @@ -1198,7 +1244,22 @@ var xObjectAddToggleRef func(uintptr, uintptr, uintptr) | |||
| 1198 | 1244 | // A g_object_add_toggle_ref() must be released with g_object_remove_toggle_ref(). | |
| 1199 | 1245 | func (x *Object) AddToggleRef(NotifyVar *ToggleNotify, DataVar uintptr) { | |
| 1200 | 1246 | ||
| 1201 | - | xObjectAddToggleRef(x.GoPointer(), glib.NewCallback(NotifyVar), DataVar) | |
| 1247 | + | var NotifyVarRef uintptr | |
| 1248 | + | if NotifyVar != nil { | |
| 1249 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 1250 | + | if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok { | |
| 1251 | + | NotifyVarRef = cbRefPtr | |
| 1252 | + | } else { | |
| 1253 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 bool) { | |
| 1254 | + | cbFn := *NotifyVar | |
| 1255 | + | cbFn(arg0, arg1, arg2) | |
| 1256 | + | } | |
| 1257 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 1258 | + | glib.SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 1259 | + | } | |
| 1260 | + | } | |
| 1261 | + | ||
| 1262 | + | xObjectAddToggleRef(x.GoPointer(), NotifyVarRef, DataVar) | |
| 1202 | 1263 | ||
| 1203 | 1264 | } | |
| 1204 | 1265 | ||
| @@ -1298,7 +1359,52 @@ var xObjectBindPropertyFull func(uintptr, string, uintptr, string, BindingFlags, | |||
| 1298 | 1359 | func (x *Object) BindPropertyFull(SourcePropertyVar string, TargetVar *Object, TargetPropertyVar string, FlagsVar BindingFlags, TransformToVar *BindingTransformFunc, TransformFromVar *BindingTransformFunc, UserDataVar uintptr, NotifyVar *glib.DestroyNotify) *Binding { | |
| 1299 | 1360 | var cls *Binding | |
| 1300 | 1361 | ||
| 1301 | - | cret := xObjectBindPropertyFull(x.GoPointer(), SourcePropertyVar, TargetVar.GoPointer(), TargetPropertyVar, FlagsVar, glib.NewCallbackNullable(TransformToVar), glib.NewCallbackNullable(TransformFromVar), UserDataVar, glib.NewCallbackNullable(NotifyVar)) | |
| 1362 | + | var TransformToVarRef uintptr | |
| 1363 | + | if TransformToVar != nil { | |
| 1364 | + | TransformToVarPtr := uintptr(unsafe.Pointer(TransformToVar)) | |
| 1365 | + | if cbRefPtr, ok := glib.GetCallback(TransformToVarPtr); ok { | |
| 1366 | + | TransformToVarRef = cbRefPtr | |
| 1367 | + | } else { | |
| 1368 | + | fcb := func(arg0 uintptr, arg1 *Value, arg2 *Value, arg3 uintptr) bool { | |
| 1369 | + | cbFn := *TransformToVar | |
| 1370 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 1371 | + | } | |
| 1372 | + | TransformToVarRef = purego.NewCallback(fcb) | |
| 1373 | + | glib.SaveCallback(TransformToVarPtr, TransformToVarRef) | |
| 1374 | + | } | |
| 1375 | + | } | |
| 1376 | + | ||
| 1377 | + | var TransformFromVarRef uintptr | |
| 1378 | + | if TransformFromVar != nil { | |
| 1379 | + | TransformFromVarPtr := uintptr(unsafe.Pointer(TransformFromVar)) | |
| 1380 | + | if cbRefPtr, ok := glib.GetCallback(TransformFromVarPtr); ok { | |
| 1381 | + | TransformFromVarRef = cbRefPtr | |
| 1382 | + | } else { | |
| 1383 | + | fcb := func(arg0 uintptr, arg1 *Value, arg2 *Value, arg3 uintptr) bool { | |
| 1384 | + | cbFn := *TransformFromVar | |
| 1385 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 1386 | + | } | |
| 1387 | + | TransformFromVarRef = purego.NewCallback(fcb) | |
| 1388 | + | glib.SaveCallback(TransformFromVarPtr, TransformFromVarRef) | |
| 1389 | + | } | |
| 1390 | + | } | |
| 1391 | + | ||
| 1392 | + | var NotifyVarRef uintptr | |
| 1393 | + | if NotifyVar != nil { | |
| 1394 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 1395 | + | if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok { | |
| 1396 | + | NotifyVarRef = cbRefPtr | |
| 1397 | + | } else { | |
| 1398 | + | fcb := func(arg0 uintptr) { | |
| 1399 | + | cbFn := *NotifyVar | |
| 1400 | + | cbFn(arg0) | |
| 1401 | + | } | |
| 1402 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 1403 | + | glib.SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 1404 | + | } | |
| 1405 | + | } | |
| 1406 | + | ||
| 1407 | + | cret := xObjectBindPropertyFull(x.GoPointer(), SourcePropertyVar, TargetVar.GoPointer(), TargetPropertyVar, FlagsVar, TransformToVarRef, TransformFromVarRef, UserDataVar, NotifyVarRef) | |
| 1302 | 1408 | ||
| 1303 | 1409 | if cret == 0 { | |
| 1304 | 1410 | return nil | |
| @@ -1407,7 +1513,22 @@ var xObjectDupData func(uintptr, string, uintptr, uintptr) uintptr | |||
| 1407 | 1513 | // object. | |
| 1408 | 1514 | func (x *Object) DupData(KeyVar string, DupFuncVar *glib.DuplicateFunc, UserDataVar uintptr) uintptr { | |
| 1409 | 1515 | ||
| 1410 | - | cret := xObjectDupData(x.GoPointer(), KeyVar, glib.NewCallbackNullable(DupFuncVar), UserDataVar) | |
| 1516 | + | var DupFuncVarRef uintptr | |
| 1517 | + | if DupFuncVar != nil { | |
| 1518 | + | DupFuncVarPtr := uintptr(unsafe.Pointer(DupFuncVar)) | |
| 1519 | + | if cbRefPtr, ok := glib.GetCallback(DupFuncVarPtr); ok { | |
| 1520 | + | DupFuncVarRef = cbRefPtr | |
| 1521 | + | } else { | |
| 1522 | + | fcb := func(arg0 uintptr, arg1 uintptr) uintptr { | |
| 1523 | + | cbFn := *DupFuncVar | |
| 1524 | + | return cbFn(arg0, arg1) | |
| 1525 | + | } | |
| 1526 | + | DupFuncVarRef = purego.NewCallback(fcb) | |
| 1527 | + | glib.SaveCallback(DupFuncVarPtr, DupFuncVarRef) | |
| 1528 | + | } | |
| 1529 | + | } | |
| 1530 | + | ||
| 1531 | + | cret := xObjectDupData(x.GoPointer(), KeyVar, DupFuncVarRef, UserDataVar) | |
| 1411 | 1532 | return cret | |
| 1412 | 1533 | } | |
| 1413 | 1534 | ||
| @@ -1429,7 +1550,22 @@ var xObjectDupQdata func(uintptr, glib.Quark, uintptr, uintptr) uintptr | |||
| 1429 | 1550 | // object. | |
| 1430 | 1551 | func (x *Object) DupQdata(QuarkVar glib.Quark, DupFuncVar *glib.DuplicateFunc, UserDataVar uintptr) uintptr { | |
| 1431 | 1552 | ||
| 1432 | - | cret := xObjectDupQdata(x.GoPointer(), QuarkVar, glib.NewCallbackNullable(DupFuncVar), UserDataVar) | |
| 1553 | + | var DupFuncVarRef uintptr | |
| 1554 | + | if DupFuncVar != nil { | |
| 1555 | + | DupFuncVarPtr := uintptr(unsafe.Pointer(DupFuncVar)) | |
| 1556 | + | if cbRefPtr, ok := glib.GetCallback(DupFuncVarPtr); ok { | |
| 1557 | + | DupFuncVarRef = cbRefPtr | |
| 1558 | + | } else { | |
| 1559 | + | fcb := func(arg0 uintptr, arg1 uintptr) uintptr { | |
| 1560 | + | cbFn := *DupFuncVar | |
| 1561 | + | return cbFn(arg0, arg1) | |
| 1562 | + | } | |
| 1563 | + | DupFuncVarRef = purego.NewCallback(fcb) | |
| 1564 | + | glib.SaveCallback(DupFuncVarPtr, DupFuncVarRef) | |
| 1565 | + | } | |
| 1566 | + | } | |
| 1567 | + | ||
| 1568 | + | cret := xObjectDupQdata(x.GoPointer(), QuarkVar, DupFuncVarRef, UserDataVar) | |
| 1433 | 1569 | return cret | |
| 1434 | 1570 | } | |
| 1435 | 1571 | ||
| @@ -1703,7 +1839,22 @@ var xObjectRemoveToggleRef func(uintptr, uintptr, uintptr) | |||
| 1703 | 1839 | // you must take care of that yourself. | |
| 1704 | 1840 | func (x *Object) RemoveToggleRef(NotifyVar *ToggleNotify, DataVar uintptr) { | |
| 1705 | 1841 | ||
| 1706 | - | xObjectRemoveToggleRef(x.GoPointer(), glib.NewCallback(NotifyVar), DataVar) | |
| 1842 | + | var NotifyVarRef uintptr | |
| 1843 | + | if NotifyVar != nil { | |
| 1844 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 1845 | + | if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok { | |
| 1846 | + | NotifyVarRef = cbRefPtr | |
| 1847 | + | } else { | |
| 1848 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 bool) { | |
| 1849 | + | cbFn := *NotifyVar | |
| 1850 | + | cbFn(arg0, arg1, arg2) | |
| 1851 | + | } | |
| 1852 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 1853 | + | glib.SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 1854 | + | } | |
| 1855 | + | } | |
| 1856 | + | ||
| 1857 | + | xObjectRemoveToggleRef(x.GoPointer(), NotifyVarRef, DataVar) | |
| 1707 | 1858 | ||
| 1708 | 1859 | } | |
| 1709 | 1860 | ||
| @@ -1738,7 +1889,22 @@ var xObjectReplaceData func(uintptr, string, uintptr, uintptr, uintptr, *glib.De | |||
| 1738 | 1889 | // for @key. | |
| 1739 | 1890 | func (x *Object) ReplaceData(KeyVar string, OldvalVar uintptr, NewvalVar uintptr, DestroyVar *glib.DestroyNotify, OldDestroyVar *glib.DestroyNotify) bool { | |
| 1740 | 1891 | ||
| 1741 | - | cret := xObjectReplaceData(x.GoPointer(), KeyVar, OldvalVar, NewvalVar, glib.NewCallbackNullable(DestroyVar), OldDestroyVar) | |
| 1892 | + | var DestroyVarRef uintptr | |
| 1893 | + | if DestroyVar != nil { | |
| 1894 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 1895 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 1896 | + | DestroyVarRef = cbRefPtr | |
| 1897 | + | } else { | |
| 1898 | + | fcb := func(arg0 uintptr) { | |
| 1899 | + | cbFn := *DestroyVar | |
| 1900 | + | cbFn(arg0) | |
| 1901 | + | } | |
| 1902 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 1903 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 1904 | + | } | |
| 1905 | + | } | |
| 1906 | + | ||
| 1907 | + | cret := xObjectReplaceData(x.GoPointer(), KeyVar, OldvalVar, NewvalVar, DestroyVarRef, OldDestroyVar) | |
| 1742 | 1908 | return cret | |
| 1743 | 1909 | } | |
| 1744 | 1910 | ||
| @@ -1759,7 +1925,22 @@ var xObjectReplaceQdata func(uintptr, glib.Quark, uintptr, uintptr, uintptr, *gl | |||
| 1759 | 1925 | // should not destroy the object in the normal way. | |
| 1760 | 1926 | func (x *Object) ReplaceQdata(QuarkVar glib.Quark, OldvalVar uintptr, NewvalVar uintptr, DestroyVar *glib.DestroyNotify, OldDestroyVar *glib.DestroyNotify) bool { | |
| 1761 | 1927 | ||
| 1762 | - | cret := xObjectReplaceQdata(x.GoPointer(), QuarkVar, OldvalVar, NewvalVar, glib.NewCallbackNullable(DestroyVar), OldDestroyVar) | |
| 1928 | + | var DestroyVarRef uintptr | |
| 1929 | + | if DestroyVar != nil { | |
| 1930 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 1931 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 1932 | + | DestroyVarRef = cbRefPtr | |
| 1933 | + | } else { | |
| 1934 | + | fcb := func(arg0 uintptr) { | |
| 1935 | + | cbFn := *DestroyVar | |
| 1936 | + | cbFn(arg0) | |
| 1937 | + | } | |
| 1938 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 1939 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 1940 | + | } | |
| 1941 | + | } | |
| 1942 | + | ||
| 1943 | + | cret := xObjectReplaceQdata(x.GoPointer(), QuarkVar, OldvalVar, NewvalVar, DestroyVarRef, OldDestroyVar) | |
| 1763 | 1944 | return cret | |
| 1764 | 1945 | } | |
| 1765 | 1946 | ||
| @@ -1820,7 +2001,22 @@ var xObjectSetDataFull func(uintptr, string, uintptr, uintptr) | |||
| 1820 | 2001 | // Note that the @destroy callback is not called if @data is %NULL. | |
| 1821 | 2002 | func (x *Object) SetDataFull(KeyVar string, DataVar uintptr, DestroyVar *glib.DestroyNotify) { | |
| 1822 | 2003 | ||
| 1823 | - | xObjectSetDataFull(x.GoPointer(), KeyVar, DataVar, glib.NewCallbackNullable(DestroyVar)) | |
| 2004 | + | var DestroyVarRef uintptr | |
| 2005 | + | if DestroyVar != nil { | |
| 2006 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 2007 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 2008 | + | DestroyVarRef = cbRefPtr | |
| 2009 | + | } else { | |
| 2010 | + | fcb := func(arg0 uintptr) { | |
| 2011 | + | cbFn := *DestroyVar | |
| 2012 | + | cbFn(arg0) | |
| 2013 | + | } | |
| 2014 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 2015 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 2016 | + | } | |
| 2017 | + | } | |
| 2018 | + | ||
| 2019 | + | xObjectSetDataFull(x.GoPointer(), KeyVar, DataVar, DestroyVarRef) | |
| 1824 | 2020 | ||
| 1825 | 2021 | } | |
| 1826 | 2022 | ||
| @@ -1858,7 +2054,22 @@ var xObjectSetQdataFull func(uintptr, glib.Quark, uintptr, uintptr) | |||
| 1858 | 2054 | // with the same @quark. | |
| 1859 | 2055 | func (x *Object) SetQdataFull(QuarkVar glib.Quark, DataVar uintptr, DestroyVar *glib.DestroyNotify) { | |
| 1860 | 2056 | ||
| 1861 | - | xObjectSetQdataFull(x.GoPointer(), QuarkVar, DataVar, glib.NewCallbackNullable(DestroyVar)) | |
| 2057 | + | var DestroyVarRef uintptr | |
| 2058 | + | if DestroyVar != nil { | |
| 2059 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 2060 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 2061 | + | DestroyVarRef = cbRefPtr | |
| 2062 | + | } else { | |
| 2063 | + | fcb := func(arg0 uintptr) { | |
| 2064 | + | cbFn := *DestroyVar | |
| 2065 | + | cbFn(arg0) | |
| 2066 | + | } | |
| 2067 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 2068 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 2069 | + | } | |
| 2070 | + | } | |
| 2071 | + | ||
| 2072 | + | xObjectSetQdataFull(x.GoPointer(), QuarkVar, DataVar, DestroyVarRef) | |
| 1862 | 2073 | ||
| 1863 | 2074 | } | |
| 1864 | 2075 | ||
| @@ -2054,7 +2265,22 @@ var xObjectWeakRef func(uintptr, uintptr, uintptr) | |||
| 2054 | 2265 | // Use #GWeakRef if thread-safety is required. | |
| 2055 | 2266 | func (x *Object) WeakRef(NotifyVar *WeakNotify, DataVar uintptr) { | |
| 2056 | 2267 | ||
| 2057 | - | xObjectWeakRef(x.GoPointer(), glib.NewCallback(NotifyVar), DataVar) | |
| 2268 | + | var NotifyVarRef uintptr | |
| 2269 | + | if NotifyVar != nil { | |
| 2270 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 2271 | + | if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok { | |
| 2272 | + | NotifyVarRef = cbRefPtr | |
| 2273 | + | } else { | |
| 2274 | + | fcb := func(arg0 uintptr, arg1 uintptr) { | |
| 2275 | + | cbFn := *NotifyVar | |
| 2276 | + | cbFn(arg0, arg1) | |
| 2277 | + | } | |
| 2278 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 2279 | + | glib.SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 2280 | + | } | |
| 2281 | + | } | |
| 2282 | + | ||
| 2283 | + | xObjectWeakRef(x.GoPointer(), NotifyVarRef, DataVar) | |
| 2058 | 2284 | ||
| 2059 | 2285 | } | |
| 2060 | 2286 | ||
| @@ -2063,7 +2289,22 @@ var xObjectWeakUnref func(uintptr, uintptr, uintptr) | |||
| 2063 | 2289 | // Removes a weak reference callback to an object. | |
| 2064 | 2290 | func (x *Object) WeakUnref(NotifyVar *WeakNotify, DataVar uintptr) { | |
| 2065 | 2291 | ||
| 2066 | - | xObjectWeakUnref(x.GoPointer(), glib.NewCallback(NotifyVar), DataVar) | |
| 2292 | + | var NotifyVarRef uintptr | |
| 2293 | + | if NotifyVar != nil { | |
| 2294 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 2295 | + | if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok { | |
| 2296 | + | NotifyVarRef = cbRefPtr | |
| 2297 | + | } else { | |
| 2298 | + | fcb := func(arg0 uintptr, arg1 uintptr) { | |
| 2299 | + | cbFn := *NotifyVar | |
| 2300 | + | cbFn(arg0, arg1) | |
| 2301 | + | } | |
| 2302 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 2303 | + | glib.SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 2304 | + | } | |
| 2305 | + | } | |
| 2306 | + | ||
| 2307 | + | xObjectWeakUnref(x.GoPointer(), NotifyVarRef, DataVar) | |
| 2067 | 2308 | ||
| 2068 | 2309 | } | |
| 2069 | 2310 | ||
| @@ -2124,6 +2365,28 @@ func (x *Object) ConnectNotify(cb *func(Object, uintptr)) uint32 { | |||
| 2124 | 2365 | return SignalConnect(x.GoPointer(), "notify", cbRefPtr) | |
| 2125 | 2366 | } | |
| 2126 | 2367 | ||
| 2368 | + | // ConnectNotifyWithDetail connects to the "notify" signal with a detail string. | |
| 2369 | + | // The detail is appended as "notify::<detail>". | |
| 2370 | + | func (x *Object) ConnectNotifyWithDetail(detail string, cb *func(Object, uintptr)) uint32 { | |
| 2371 | + | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 2372 | + | signalName := fmt.Sprintf("notify::%s", detail) | |
| 2373 | + | if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { | |
| 2374 | + | return SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 2375 | + | } | |
| 2376 | + | ||
| 2377 | + | fcb := func(clsPtr uintptr, PspecVarp uintptr) { | |
| 2378 | + | fa := Object{} | |
| 2379 | + | fa.Ptr = clsPtr | |
| 2380 | + | cbFn := *cb | |
| 2381 | + | ||
| 2382 | + | cbFn(fa, PspecVarp) | |
| 2383 | + | ||
| 2384 | + | } | |
| 2385 | + | cbRefPtr := purego.NewCallback(fcb) | |
| 2386 | + | glib.SaveCallback(cbPtr, cbRefPtr) | |
| 2387 | + | return SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 2388 | + | } | |
| 2389 | + | ||
| 2127 | 2390 | var xObjectCompatControl func(uint, uintptr) uint | |
| 2128 | 2391 | ||
| 2129 | 2392 | func ObjectCompatControl(WhatVar uint, DataVar uintptr) uint { | |
M v4/gobject/gparam.go +19 -4
| @@ -770,7 +770,22 @@ var xParamSpecSetQdataFull func(uintptr, glib.Quark, uintptr, uintptr) | |||
| 770 | 770 | // g_param_spec_set_qdata() with the same @quark. | |
| 771 | 771 | func (x *ParamSpec) SetQdataFull(QuarkVar glib.Quark, DataVar uintptr, DestroyVar *glib.DestroyNotify) { | |
| 772 | 772 | ||
| 773 | - | xParamSpecSetQdataFull(x.GoPointer(), QuarkVar, DataVar, glib.NewCallbackNullable(DestroyVar)) | |
| 773 | + | var DestroyVarRef uintptr | |
| 774 | + | if DestroyVar != nil { | |
| 775 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 776 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 777 | + | DestroyVarRef = cbRefPtr | |
| 778 | + | } else { | |
| 779 | + | fcb := func(arg0 uintptr) { | |
| 780 | + | cbFn := *DestroyVar | |
| 781 | + | cbFn(arg0) | |
| 782 | + | } | |
| 783 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 784 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 785 | + | } | |
| 786 | + | } | |
| 787 | + | ||
| 788 | + | xParamSpecSetQdataFull(x.GoPointer(), QuarkVar, DataVar, DestroyVarRef) | |
| 774 | 789 | ||
| 775 | 790 | } | |
| 776 | 791 | ||
| @@ -821,7 +836,7 @@ func (c *ParamSpec) SetGoPointer(ptr uintptr) { | |||
| 821 | 836 | c.Ptr = ptr | |
| 822 | 837 | } | |
| 823 | 838 | ||
| 824 | - | var xParamSpecInternal func(types.GType, string, string, string, ParamFlags) uintptr | |
| 839 | + | var xParamSpecInternal func(types.GType, string, uintptr, uintptr, ParamFlags) uintptr | |
| 825 | 840 | ||
| 826 | 841 | // Creates a new #GParamSpec instance. | |
| 827 | 842 | // | |
| @@ -835,10 +850,10 @@ var xParamSpecInternal func(types.GType, string, string, string, ParamFlags) uin | |||
| 835 | 850 | // omitted, while for other libraries such as GStreamer and its plugins they | |
| 836 | 851 | // are essential. When in doubt, follow the conventions used in the | |
| 837 | 852 | // surrounding code and supporting libraries. | |
| 838 | - | func ParamSpecInternal(ParamTypeVar types.GType, NameVar string, NickVar string, BlurbVar string, FlagsVar ParamFlags) *ParamSpec { | |
| 853 | + | func ParamSpecInternal(ParamTypeVar types.GType, NameVar string, NickVar *string, BlurbVar *string, FlagsVar ParamFlags) *ParamSpec { | |
| 839 | 854 | var cls *ParamSpec | |
| 840 | 855 | ||
| 841 | - | cret := xParamSpecInternal(ParamTypeVar, NameVar, NickVar, BlurbVar, FlagsVar) | |
| 856 | + | cret := xParamSpecInternal(ParamTypeVar, NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), FlagsVar) | |
| 842 | 857 | ||
| 843 | 858 | if cret == 0 { | |
| 844 | 859 | return nil | |
M v4/gobject/gparamspecs.go +66 -66
| @@ -8,7 +8,7 @@ import ( | |||
| 8 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 9 | 9 | ) | |
| 10 | 10 | ||
| 11 | - | var xNewParamSpecBoolean func(string, string, string, bool, ParamFlags) uintptr | |
| 11 | + | var xNewParamSpecBoolean func(string, uintptr, uintptr, bool, ParamFlags) uintptr | |
| 12 | 12 | ||
| 13 | 13 | // Creates a new #GParamSpecBoolean instance specifying a %G_TYPE_BOOLEAN | |
| 14 | 14 | // property. In many cases, it may be more appropriate to use an enum with | |
| @@ -17,10 +17,10 @@ var xNewParamSpecBoolean func(string, string, string, bool, ParamFlags) uintptr | |||
| 17 | 17 | // API. | |
| 18 | 18 | // | |
| 19 | 19 | // See g_param_spec_internal() for details on property names. | |
| 20 | - | func NewParamSpecBoolean(NameVar string, NickVar string, BlurbVar string, DefaultValueVar bool, FlagsVar ParamFlags) *ParamSpec { | |
| 20 | + | func NewParamSpecBoolean(NameVar string, NickVar *string, BlurbVar *string, DefaultValueVar bool, FlagsVar ParamFlags) *ParamSpec { | |
| 21 | 21 | var cls *ParamSpec | |
| 22 | 22 | ||
| 23 | - | cret := xNewParamSpecBoolean(NameVar, NickVar, BlurbVar, DefaultValueVar, FlagsVar) | |
| 23 | + | cret := xNewParamSpecBoolean(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), DefaultValueVar, FlagsVar) | |
| 24 | 24 | ||
| 25 | 25 | if cret == 0 { | |
| 26 | 26 | return nil | |
| @@ -30,16 +30,16 @@ func NewParamSpecBoolean(NameVar string, NickVar string, BlurbVar string, Defaul | |||
| 30 | 30 | return cls | |
| 31 | 31 | } | |
| 32 | 32 | ||
| 33 | - | var xNewParamSpecBoxed func(string, string, string, types.GType, ParamFlags) uintptr | |
| 33 | + | var xNewParamSpecBoxed func(string, uintptr, uintptr, types.GType, ParamFlags) uintptr | |
| 34 | 34 | ||
| 35 | 35 | // Creates a new #GParamSpecBoxed instance specifying a %G_TYPE_BOXED | |
| 36 | 36 | // derived property. | |
| 37 | 37 | // | |
| 38 | 38 | // See g_param_spec_internal() for details on property names. | |
| 39 | - | func NewParamSpecBoxed(NameVar string, NickVar string, BlurbVar string, BoxedTypeVar types.GType, FlagsVar ParamFlags) *ParamSpec { | |
| 39 | + | func NewParamSpecBoxed(NameVar string, NickVar *string, BlurbVar *string, BoxedTypeVar types.GType, FlagsVar ParamFlags) *ParamSpec { | |
| 40 | 40 | var cls *ParamSpec | |
| 41 | 41 | ||
| 42 | - | cret := xNewParamSpecBoxed(NameVar, NickVar, BlurbVar, BoxedTypeVar, FlagsVar) | |
| 42 | + | cret := xNewParamSpecBoxed(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), BoxedTypeVar, FlagsVar) | |
| 43 | 43 | ||
| 44 | 44 | if cret == 0 { | |
| 45 | 45 | return nil | |
| @@ -49,13 +49,13 @@ func NewParamSpecBoxed(NameVar string, NickVar string, BlurbVar string, BoxedTyp | |||
| 49 | 49 | return cls | |
| 50 | 50 | } | |
| 51 | 51 | ||
| 52 | - | var xNewParamSpecChar func(string, string, string, int8, int8, int8, ParamFlags) uintptr | |
| 52 | + | var xNewParamSpecChar func(string, uintptr, uintptr, int8, int8, int8, ParamFlags) uintptr | |
| 53 | 53 | ||
| 54 | 54 | // Creates a new #GParamSpecChar instance specifying a %G_TYPE_CHAR property. | |
| 55 | - | func NewParamSpecChar(NameVar string, NickVar string, BlurbVar string, MinimumVar int8, MaximumVar int8, DefaultValueVar int8, FlagsVar ParamFlags) *ParamSpec { | |
| 55 | + | func NewParamSpecChar(NameVar string, NickVar *string, BlurbVar *string, MinimumVar int8, MaximumVar int8, DefaultValueVar int8, FlagsVar ParamFlags) *ParamSpec { | |
| 56 | 56 | var cls *ParamSpec | |
| 57 | 57 | ||
| 58 | - | cret := xNewParamSpecChar(NameVar, NickVar, BlurbVar, MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 58 | + | cret := xNewParamSpecChar(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 59 | 59 | ||
| 60 | 60 | if cret == 0 { | |
| 61 | 61 | return nil | |
| @@ -65,16 +65,16 @@ func NewParamSpecChar(NameVar string, NickVar string, BlurbVar string, MinimumVa | |||
| 65 | 65 | return cls | |
| 66 | 66 | } | |
| 67 | 67 | ||
| 68 | - | var xNewParamSpecDouble func(string, string, string, float64, float64, float64, ParamFlags) uintptr | |
| 68 | + | var xNewParamSpecDouble func(string, uintptr, uintptr, float64, float64, float64, ParamFlags) uintptr | |
| 69 | 69 | ||
| 70 | 70 | // Creates a new #GParamSpecDouble instance specifying a %G_TYPE_DOUBLE | |
| 71 | 71 | // property. | |
| 72 | 72 | // | |
| 73 | 73 | // See g_param_spec_internal() for details on property names. | |
| 74 | - | func NewParamSpecDouble(NameVar string, NickVar string, BlurbVar string, MinimumVar float64, MaximumVar float64, DefaultValueVar float64, FlagsVar ParamFlags) *ParamSpec { | |
| 74 | + | func NewParamSpecDouble(NameVar string, NickVar *string, BlurbVar *string, MinimumVar float64, MaximumVar float64, DefaultValueVar float64, FlagsVar ParamFlags) *ParamSpec { | |
| 75 | 75 | var cls *ParamSpec | |
| 76 | 76 | ||
| 77 | - | cret := xNewParamSpecDouble(NameVar, NickVar, BlurbVar, MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 77 | + | cret := xNewParamSpecDouble(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 78 | 78 | ||
| 79 | 79 | if cret == 0 { | |
| 80 | 80 | return nil | |
| @@ -84,16 +84,16 @@ func NewParamSpecDouble(NameVar string, NickVar string, BlurbVar string, Minimum | |||
| 84 | 84 | return cls | |
| 85 | 85 | } | |
| 86 | 86 | ||
| 87 | - | var xNewParamSpecEnum func(string, string, string, types.GType, int, ParamFlags) uintptr | |
| 87 | + | var xNewParamSpecEnum func(string, uintptr, uintptr, types.GType, int, ParamFlags) uintptr | |
| 88 | 88 | ||
| 89 | 89 | // Creates a new #GParamSpecEnum instance specifying a %G_TYPE_ENUM | |
| 90 | 90 | // property. | |
| 91 | 91 | // | |
| 92 | 92 | // See g_param_spec_internal() for details on property names. | |
| 93 | - | func NewParamSpecEnum(NameVar string, NickVar string, BlurbVar string, EnumTypeVar types.GType, DefaultValueVar int, FlagsVar ParamFlags) *ParamSpec { | |
| 93 | + | func NewParamSpecEnum(NameVar string, NickVar *string, BlurbVar *string, EnumTypeVar types.GType, DefaultValueVar int, FlagsVar ParamFlags) *ParamSpec { | |
| 94 | 94 | var cls *ParamSpec | |
| 95 | 95 | ||
| 96 | - | cret := xNewParamSpecEnum(NameVar, NickVar, BlurbVar, EnumTypeVar, DefaultValueVar, FlagsVar) | |
| 96 | + | cret := xNewParamSpecEnum(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), EnumTypeVar, DefaultValueVar, FlagsVar) | |
| 97 | 97 | ||
| 98 | 98 | if cret == 0 { | |
| 99 | 99 | return nil | |
| @@ -103,16 +103,16 @@ func NewParamSpecEnum(NameVar string, NickVar string, BlurbVar string, EnumTypeV | |||
| 103 | 103 | return cls | |
| 104 | 104 | } | |
| 105 | 105 | ||
| 106 | - | var xNewParamSpecFlags func(string, string, string, types.GType, uint, ParamFlags) uintptr | |
| 106 | + | var xNewParamSpecFlags func(string, uintptr, uintptr, types.GType, uint, ParamFlags) uintptr | |
| 107 | 107 | ||
| 108 | 108 | // Creates a new #GParamSpecFlags instance specifying a %G_TYPE_FLAGS | |
| 109 | 109 | // property. | |
| 110 | 110 | // | |
| 111 | 111 | // See g_param_spec_internal() for details on property names. | |
| 112 | - | func NewParamSpecFlags(NameVar string, NickVar string, BlurbVar string, FlagsTypeVar types.GType, DefaultValueVar uint, FlagsVar ParamFlags) *ParamSpec { | |
| 112 | + | func NewParamSpecFlags(NameVar string, NickVar *string, BlurbVar *string, FlagsTypeVar types.GType, DefaultValueVar uint, FlagsVar ParamFlags) *ParamSpec { | |
| 113 | 113 | var cls *ParamSpec | |
| 114 | 114 | ||
| 115 | - | cret := xNewParamSpecFlags(NameVar, NickVar, BlurbVar, FlagsTypeVar, DefaultValueVar, FlagsVar) | |
| 115 | + | cret := xNewParamSpecFlags(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), FlagsTypeVar, DefaultValueVar, FlagsVar) | |
| 116 | 116 | ||
| 117 | 117 | if cret == 0 { | |
| 118 | 118 | return nil | |
| @@ -122,15 +122,15 @@ func NewParamSpecFlags(NameVar string, NickVar string, BlurbVar string, FlagsTyp | |||
| 122 | 122 | return cls | |
| 123 | 123 | } | |
| 124 | 124 | ||
| 125 | - | var xNewParamSpecFloat func(string, string, string, float32, float32, float32, ParamFlags) uintptr | |
| 125 | + | var xNewParamSpecFloat func(string, uintptr, uintptr, float32, float32, float32, ParamFlags) uintptr | |
| 126 | 126 | ||
| 127 | 127 | // Creates a new #GParamSpecFloat instance specifying a %G_TYPE_FLOAT property. | |
| 128 | 128 | // | |
| 129 | 129 | // See g_param_spec_internal() for details on property names. | |
| 130 | - | func NewParamSpecFloat(NameVar string, NickVar string, BlurbVar string, MinimumVar float32, MaximumVar float32, DefaultValueVar float32, FlagsVar ParamFlags) *ParamSpec { | |
| 130 | + | func NewParamSpecFloat(NameVar string, NickVar *string, BlurbVar *string, MinimumVar float32, MaximumVar float32, DefaultValueVar float32, FlagsVar ParamFlags) *ParamSpec { | |
| 131 | 131 | var cls *ParamSpec | |
| 132 | 132 | ||
| 133 | - | cret := xNewParamSpecFloat(NameVar, NickVar, BlurbVar, MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 133 | + | cret := xNewParamSpecFloat(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 134 | 134 | ||
| 135 | 135 | if cret == 0 { | |
| 136 | 136 | return nil | |
| @@ -140,16 +140,16 @@ func NewParamSpecFloat(NameVar string, NickVar string, BlurbVar string, MinimumV | |||
| 140 | 140 | return cls | |
| 141 | 141 | } | |
| 142 | 142 | ||
| 143 | - | var xParamSpecGtype func(string, string, string, types.GType, ParamFlags) uintptr | |
| 143 | + | var xParamSpecGtype func(string, uintptr, uintptr, types.GType, ParamFlags) uintptr | |
| 144 | 144 | ||
| 145 | 145 | // Creates a new #GParamSpecGType instance specifying a | |
| 146 | 146 | // %G_TYPE_GTYPE property. | |
| 147 | 147 | // | |
| 148 | 148 | // See g_param_spec_internal() for details on property names. | |
| 149 | - | func ParamSpecGtype(NameVar string, NickVar string, BlurbVar string, IsATypeVar types.GType, FlagsVar ParamFlags) *ParamSpec { | |
| 149 | + | func ParamSpecGtype(NameVar string, NickVar *string, BlurbVar *string, IsATypeVar types.GType, FlagsVar ParamFlags) *ParamSpec { | |
| 150 | 150 | var cls *ParamSpec | |
| 151 | 151 | ||
| 152 | - | cret := xParamSpecGtype(NameVar, NickVar, BlurbVar, IsATypeVar, FlagsVar) | |
| 152 | + | cret := xParamSpecGtype(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), IsATypeVar, FlagsVar) | |
| 153 | 153 | ||
| 154 | 154 | if cret == 0 { | |
| 155 | 155 | return nil | |
| @@ -159,15 +159,15 @@ func ParamSpecGtype(NameVar string, NickVar string, BlurbVar string, IsATypeVar | |||
| 159 | 159 | return cls | |
| 160 | 160 | } | |
| 161 | 161 | ||
| 162 | - | var xNewParamSpecInt func(string, string, string, int, int, int, ParamFlags) uintptr | |
| 162 | + | var xNewParamSpecInt func(string, uintptr, uintptr, int, int, int, ParamFlags) uintptr | |
| 163 | 163 | ||
| 164 | 164 | // Creates a new #GParamSpecInt instance specifying a %G_TYPE_INT property. | |
| 165 | 165 | // | |
| 166 | 166 | // See g_param_spec_internal() for details on property names. | |
| 167 | - | func NewParamSpecInt(NameVar string, NickVar string, BlurbVar string, MinimumVar int, MaximumVar int, DefaultValueVar int, FlagsVar ParamFlags) *ParamSpec { | |
| 167 | + | func NewParamSpecInt(NameVar string, NickVar *string, BlurbVar *string, MinimumVar int, MaximumVar int, DefaultValueVar int, FlagsVar ParamFlags) *ParamSpec { | |
| 168 | 168 | var cls *ParamSpec | |
| 169 | 169 | ||
| 170 | - | cret := xNewParamSpecInt(NameVar, NickVar, BlurbVar, MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 170 | + | cret := xNewParamSpecInt(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 171 | 171 | ||
| 172 | 172 | if cret == 0 { | |
| 173 | 173 | return nil | |
| @@ -177,15 +177,15 @@ func NewParamSpecInt(NameVar string, NickVar string, BlurbVar string, MinimumVar | |||
| 177 | 177 | return cls | |
| 178 | 178 | } | |
| 179 | 179 | ||
| 180 | - | var xNewParamSpecInt64 func(string, string, string, int64, int64, int64, ParamFlags) uintptr | |
| 180 | + | var xNewParamSpecInt64 func(string, uintptr, uintptr, int64, int64, int64, ParamFlags) uintptr | |
| 181 | 181 | ||
| 182 | 182 | // Creates a new #GParamSpecInt64 instance specifying a %G_TYPE_INT64 property. | |
| 183 | 183 | // | |
| 184 | 184 | // See g_param_spec_internal() for details on property names. | |
| 185 | - | func NewParamSpecInt64(NameVar string, NickVar string, BlurbVar string, MinimumVar int64, MaximumVar int64, DefaultValueVar int64, FlagsVar ParamFlags) *ParamSpec { | |
| 185 | + | func NewParamSpecInt64(NameVar string, NickVar *string, BlurbVar *string, MinimumVar int64, MaximumVar int64, DefaultValueVar int64, FlagsVar ParamFlags) *ParamSpec { | |
| 186 | 186 | var cls *ParamSpec | |
| 187 | 187 | ||
| 188 | - | cret := xNewParamSpecInt64(NameVar, NickVar, BlurbVar, MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 188 | + | cret := xNewParamSpecInt64(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 189 | 189 | ||
| 190 | 190 | if cret == 0 { | |
| 191 | 191 | return nil | |
| @@ -195,15 +195,15 @@ func NewParamSpecInt64(NameVar string, NickVar string, BlurbVar string, MinimumV | |||
| 195 | 195 | return cls | |
| 196 | 196 | } | |
| 197 | 197 | ||
| 198 | - | var xNewParamSpecLong func(string, string, string, int32, int32, int32, ParamFlags) uintptr | |
| 198 | + | var xNewParamSpecLong func(string, uintptr, uintptr, int32, int32, int32, ParamFlags) uintptr | |
| 199 | 199 | ||
| 200 | 200 | // Creates a new #GParamSpecLong instance specifying a %G_TYPE_LONG property. | |
| 201 | 201 | // | |
| 202 | 202 | // See g_param_spec_internal() for details on property names. | |
| 203 | - | func NewParamSpecLong(NameVar string, NickVar string, BlurbVar string, MinimumVar int32, MaximumVar int32, DefaultValueVar int32, FlagsVar ParamFlags) *ParamSpec { | |
| 203 | + | func NewParamSpecLong(NameVar string, NickVar *string, BlurbVar *string, MinimumVar int32, MaximumVar int32, DefaultValueVar int32, FlagsVar ParamFlags) *ParamSpec { | |
| 204 | 204 | var cls *ParamSpec | |
| 205 | 205 | ||
| 206 | - | cret := xNewParamSpecLong(NameVar, NickVar, BlurbVar, MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 206 | + | cret := xNewParamSpecLong(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 207 | 207 | ||
| 208 | 208 | if cret == 0 { | |
| 209 | 209 | return nil | |
| @@ -213,16 +213,16 @@ func NewParamSpecLong(NameVar string, NickVar string, BlurbVar string, MinimumVa | |||
| 213 | 213 | return cls | |
| 214 | 214 | } | |
| 215 | 215 | ||
| 216 | - | var xNewParamSpecObject func(string, string, string, types.GType, ParamFlags) uintptr | |
| 216 | + | var xNewParamSpecObject func(string, uintptr, uintptr, types.GType, ParamFlags) uintptr | |
| 217 | 217 | ||
| 218 | 218 | // Creates a new #GParamSpecBoxed instance specifying a %G_TYPE_OBJECT | |
| 219 | 219 | // derived property. | |
| 220 | 220 | // | |
| 221 | 221 | // See g_param_spec_internal() for details on property names. | |
| 222 | - | func NewParamSpecObject(NameVar string, NickVar string, BlurbVar string, ObjectTypeVar types.GType, FlagsVar ParamFlags) *ParamSpec { | |
| 222 | + | func NewParamSpecObject(NameVar string, NickVar *string, BlurbVar *string, ObjectTypeVar types.GType, FlagsVar ParamFlags) *ParamSpec { | |
| 223 | 223 | var cls *ParamSpec | |
| 224 | 224 | ||
| 225 | - | cret := xNewParamSpecObject(NameVar, NickVar, BlurbVar, ObjectTypeVar, FlagsVar) | |
| 225 | + | cret := xNewParamSpecObject(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), ObjectTypeVar, FlagsVar) | |
| 226 | 226 | ||
| 227 | 227 | if cret == 0 { | |
| 228 | 228 | return nil | |
| @@ -250,16 +250,16 @@ func NewParamSpecOverride(NameVar string, OverriddenVar *ParamSpec) *ParamSpec { | |||
| 250 | 250 | return cls | |
| 251 | 251 | } | |
| 252 | 252 | ||
| 253 | - | var xNewParamSpecParam func(string, string, string, types.GType, ParamFlags) uintptr | |
| 253 | + | var xNewParamSpecParam func(string, uintptr, uintptr, types.GType, ParamFlags) uintptr | |
| 254 | 254 | ||
| 255 | 255 | // Creates a new #GParamSpecParam instance specifying a %G_TYPE_PARAM | |
| 256 | 256 | // property. | |
| 257 | 257 | // | |
| 258 | 258 | // See g_param_spec_internal() for details on property names. | |
| 259 | - | func NewParamSpecParam(NameVar string, NickVar string, BlurbVar string, ParamTypeVar types.GType, FlagsVar ParamFlags) *ParamSpec { | |
| 259 | + | func NewParamSpecParam(NameVar string, NickVar *string, BlurbVar *string, ParamTypeVar types.GType, FlagsVar ParamFlags) *ParamSpec { | |
| 260 | 260 | var cls *ParamSpec | |
| 261 | 261 | ||
| 262 | - | cret := xNewParamSpecParam(NameVar, NickVar, BlurbVar, ParamTypeVar, FlagsVar) | |
| 262 | + | cret := xNewParamSpecParam(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), ParamTypeVar, FlagsVar) | |
| 263 | 263 | ||
| 264 | 264 | if cret == 0 { | |
| 265 | 265 | return nil | |
| @@ -269,17 +269,17 @@ func NewParamSpecParam(NameVar string, NickVar string, BlurbVar string, ParamTyp | |||
| 269 | 269 | return cls | |
| 270 | 270 | } | |
| 271 | 271 | ||
| 272 | - | var xNewParamSpecPointer func(string, string, string, ParamFlags) uintptr | |
| 272 | + | var xNewParamSpecPointer func(string, uintptr, uintptr, ParamFlags) uintptr | |
| 273 | 273 | ||
| 274 | 274 | // Creates a new #GParamSpecPointer instance specifying a pointer property. | |
| 275 | 275 | // Where possible, it is better to use g_param_spec_object() or | |
| 276 | 276 | // g_param_spec_boxed() to expose memory management information. | |
| 277 | 277 | // | |
| 278 | 278 | // See g_param_spec_internal() for details on property names. | |
| 279 | - | func NewParamSpecPointer(NameVar string, NickVar string, BlurbVar string, FlagsVar ParamFlags) *ParamSpec { | |
| 279 | + | func NewParamSpecPointer(NameVar string, NickVar *string, BlurbVar *string, FlagsVar ParamFlags) *ParamSpec { | |
| 280 | 280 | var cls *ParamSpec | |
| 281 | 281 | ||
| 282 | - | cret := xNewParamSpecPointer(NameVar, NickVar, BlurbVar, FlagsVar) | |
| 282 | + | cret := xNewParamSpecPointer(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), FlagsVar) | |
| 283 | 283 | ||
| 284 | 284 | if cret == 0 { | |
| 285 | 285 | return nil | |
| @@ -289,15 +289,15 @@ func NewParamSpecPointer(NameVar string, NickVar string, BlurbVar string, FlagsV | |||
| 289 | 289 | return cls | |
| 290 | 290 | } | |
| 291 | 291 | ||
| 292 | - | var xNewParamSpecString func(string, string, string, string, ParamFlags) uintptr | |
| 292 | + | var xNewParamSpecString func(string, uintptr, uintptr, uintptr, ParamFlags) uintptr | |
| 293 | 293 | ||
| 294 | 294 | // Creates a new #GParamSpecString instance. | |
| 295 | 295 | // | |
| 296 | 296 | // See g_param_spec_internal() for details on property names. | |
| 297 | - | func NewParamSpecString(NameVar string, NickVar string, BlurbVar string, DefaultValueVar string, FlagsVar ParamFlags) *ParamSpec { | |
| 297 | + | func NewParamSpecString(NameVar string, NickVar *string, BlurbVar *string, DefaultValueVar *string, FlagsVar ParamFlags) *ParamSpec { | |
| 298 | 298 | var cls *ParamSpec | |
| 299 | 299 | ||
| 300 | - | cret := xNewParamSpecString(NameVar, NickVar, BlurbVar, DefaultValueVar, FlagsVar) | |
| 300 | + | cret := xNewParamSpecString(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), core.NullableStringToPtr(DefaultValueVar), FlagsVar) | |
| 301 | 301 | ||
| 302 | 302 | if cret == 0 { | |
| 303 | 303 | return nil | |
| @@ -307,13 +307,13 @@ func NewParamSpecString(NameVar string, NickVar string, BlurbVar string, Default | |||
| 307 | 307 | return cls | |
| 308 | 308 | } | |
| 309 | 309 | ||
| 310 | - | var xParamSpecUchar func(string, string, string, byte, byte, byte, ParamFlags) uintptr | |
| 310 | + | var xParamSpecUchar func(string, uintptr, uintptr, byte, byte, byte, ParamFlags) uintptr | |
| 311 | 311 | ||
| 312 | 312 | // Creates a new #GParamSpecUChar instance specifying a %G_TYPE_UCHAR property. | |
| 313 | - | func ParamSpecUchar(NameVar string, NickVar string, BlurbVar string, MinimumVar byte, MaximumVar byte, DefaultValueVar byte, FlagsVar ParamFlags) *ParamSpec { | |
| 313 | + | func ParamSpecUchar(NameVar string, NickVar *string, BlurbVar *string, MinimumVar byte, MaximumVar byte, DefaultValueVar byte, FlagsVar ParamFlags) *ParamSpec { | |
| 314 | 314 | var cls *ParamSpec | |
| 315 | 315 | ||
| 316 | - | cret := xParamSpecUchar(NameVar, NickVar, BlurbVar, MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 316 | + | cret := xParamSpecUchar(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 317 | 317 | ||
| 318 | 318 | if cret == 0 { | |
| 319 | 319 | return nil | |
| @@ -323,15 +323,15 @@ func ParamSpecUchar(NameVar string, NickVar string, BlurbVar string, MinimumVar | |||
| 323 | 323 | return cls | |
| 324 | 324 | } | |
| 325 | 325 | ||
| 326 | - | var xParamSpecUint func(string, string, string, uint, uint, uint, ParamFlags) uintptr | |
| 326 | + | var xParamSpecUint func(string, uintptr, uintptr, uint, uint, uint, ParamFlags) uintptr | |
| 327 | 327 | ||
| 328 | 328 | // Creates a new #GParamSpecUInt instance specifying a %G_TYPE_UINT property. | |
| 329 | 329 | // | |
| 330 | 330 | // See g_param_spec_internal() for details on property names. | |
| 331 | - | func ParamSpecUint(NameVar string, NickVar string, BlurbVar string, MinimumVar uint, MaximumVar uint, DefaultValueVar uint, FlagsVar ParamFlags) *ParamSpec { | |
| 331 | + | func ParamSpecUint(NameVar string, NickVar *string, BlurbVar *string, MinimumVar uint, MaximumVar uint, DefaultValueVar uint, FlagsVar ParamFlags) *ParamSpec { | |
| 332 | 332 | var cls *ParamSpec | |
| 333 | 333 | ||
| 334 | - | cret := xParamSpecUint(NameVar, NickVar, BlurbVar, MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 334 | + | cret := xParamSpecUint(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 335 | 335 | ||
| 336 | 336 | if cret == 0 { | |
| 337 | 337 | return nil | |
| @@ -341,16 +341,16 @@ func ParamSpecUint(NameVar string, NickVar string, BlurbVar string, MinimumVar u | |||
| 341 | 341 | return cls | |
| 342 | 342 | } | |
| 343 | 343 | ||
| 344 | - | var xParamSpecUint64 func(string, string, string, uint64, uint64, uint64, ParamFlags) uintptr | |
| 344 | + | var xParamSpecUint64 func(string, uintptr, uintptr, uint64, uint64, uint64, ParamFlags) uintptr | |
| 345 | 345 | ||
| 346 | 346 | // Creates a new #GParamSpecUInt64 instance specifying a %G_TYPE_UINT64 | |
| 347 | 347 | // property. | |
| 348 | 348 | // | |
| 349 | 349 | // See g_param_spec_internal() for details on property names. | |
| 350 | - | func ParamSpecUint64(NameVar string, NickVar string, BlurbVar string, MinimumVar uint64, MaximumVar uint64, DefaultValueVar uint64, FlagsVar ParamFlags) *ParamSpec { | |
| 350 | + | func ParamSpecUint64(NameVar string, NickVar *string, BlurbVar *string, MinimumVar uint64, MaximumVar uint64, DefaultValueVar uint64, FlagsVar ParamFlags) *ParamSpec { | |
| 351 | 351 | var cls *ParamSpec | |
| 352 | 352 | ||
| 353 | - | cret := xParamSpecUint64(NameVar, NickVar, BlurbVar, MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 353 | + | cret := xParamSpecUint64(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 354 | 354 | ||
| 355 | 355 | if cret == 0 { | |
| 356 | 356 | return nil | |
| @@ -360,16 +360,16 @@ func ParamSpecUint64(NameVar string, NickVar string, BlurbVar string, MinimumVar | |||
| 360 | 360 | return cls | |
| 361 | 361 | } | |
| 362 | 362 | ||
| 363 | - | var xParamSpecUlong func(string, string, string, uint32, uint32, uint32, ParamFlags) uintptr | |
| 363 | + | var xParamSpecUlong func(string, uintptr, uintptr, uint32, uint32, uint32, ParamFlags) uintptr | |
| 364 | 364 | ||
| 365 | 365 | // Creates a new #GParamSpecULong instance specifying a %G_TYPE_ULONG | |
| 366 | 366 | // property. | |
| 367 | 367 | // | |
| 368 | 368 | // See g_param_spec_internal() for details on property names. | |
| 369 | - | func ParamSpecUlong(NameVar string, NickVar string, BlurbVar string, MinimumVar uint32, MaximumVar uint32, DefaultValueVar uint32, FlagsVar ParamFlags) *ParamSpec { | |
| 369 | + | func ParamSpecUlong(NameVar string, NickVar *string, BlurbVar *string, MinimumVar uint32, MaximumVar uint32, DefaultValueVar uint32, FlagsVar ParamFlags) *ParamSpec { | |
| 370 | 370 | var cls *ParamSpec | |
| 371 | 371 | ||
| 372 | - | cret := xParamSpecUlong(NameVar, NickVar, BlurbVar, MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 372 | + | cret := xParamSpecUlong(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), MinimumVar, MaximumVar, DefaultValueVar, FlagsVar) | |
| 373 | 373 | ||
| 374 | 374 | if cret == 0 { | |
| 375 | 375 | return nil | |
| @@ -379,17 +379,17 @@ func ParamSpecUlong(NameVar string, NickVar string, BlurbVar string, MinimumVar | |||
| 379 | 379 | return cls | |
| 380 | 380 | } | |
| 381 | 381 | ||
| 382 | - | var xNewParamSpecUnichar func(string, string, string, uint32, ParamFlags) uintptr | |
| 382 | + | var xNewParamSpecUnichar func(string, uintptr, uintptr, uint32, ParamFlags) uintptr | |
| 383 | 383 | ||
| 384 | 384 | // Creates a new #GParamSpecUnichar instance specifying a %G_TYPE_UINT | |
| 385 | 385 | // property. #GValue structures for this property can be accessed with | |
| 386 | 386 | // g_value_set_uint() and g_value_get_uint(). | |
| 387 | 387 | // | |
| 388 | 388 | // See g_param_spec_internal() for details on property names. | |
| 389 | - | func NewParamSpecUnichar(NameVar string, NickVar string, BlurbVar string, DefaultValueVar uint32, FlagsVar ParamFlags) *ParamSpec { | |
| 389 | + | func NewParamSpecUnichar(NameVar string, NickVar *string, BlurbVar *string, DefaultValueVar uint32, FlagsVar ParamFlags) *ParamSpec { | |
| 390 | 390 | var cls *ParamSpec | |
| 391 | 391 | ||
| 392 | - | cret := xNewParamSpecUnichar(NameVar, NickVar, BlurbVar, DefaultValueVar, FlagsVar) | |
| 392 | + | cret := xNewParamSpecUnichar(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), DefaultValueVar, FlagsVar) | |
| 393 | 393 | ||
| 394 | 394 | if cret == 0 { | |
| 395 | 395 | return nil | |
| @@ -399,7 +399,7 @@ func NewParamSpecUnichar(NameVar string, NickVar string, BlurbVar string, Defaul | |||
| 399 | 399 | return cls | |
| 400 | 400 | } | |
| 401 | 401 | ||
| 402 | - | var xNewParamSpecValueArray func(string, string, string, uintptr, ParamFlags) uintptr | |
| 402 | + | var xNewParamSpecValueArray func(string, uintptr, uintptr, uintptr, ParamFlags) uintptr | |
| 403 | 403 | ||
| 404 | 404 | // Creates a new #GParamSpecValueArray instance specifying a | |
| 405 | 405 | // %G_TYPE_VALUE_ARRAY property. %G_TYPE_VALUE_ARRAY is a | |
| @@ -407,10 +407,10 @@ var xNewParamSpecValueArray func(string, string, string, uintptr, ParamFlags) ui | |||
| 407 | 407 | // can be accessed with g_value_set_boxed() and g_value_get_boxed(). | |
| 408 | 408 | // | |
| 409 | 409 | // See g_param_spec_internal() for details on property names. | |
| 410 | - | func NewParamSpecValueArray(NameVar string, NickVar string, BlurbVar string, ElementSpecVar *ParamSpec, FlagsVar ParamFlags) *ParamSpec { | |
| 410 | + | func NewParamSpecValueArray(NameVar string, NickVar *string, BlurbVar *string, ElementSpecVar *ParamSpec, FlagsVar ParamFlags) *ParamSpec { | |
| 411 | 411 | var cls *ParamSpec | |
| 412 | 412 | ||
| 413 | - | cret := xNewParamSpecValueArray(NameVar, NickVar, BlurbVar, ElementSpecVar.GoPointer(), FlagsVar) | |
| 413 | + | cret := xNewParamSpecValueArray(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), ElementSpecVar.GoPointer(), FlagsVar) | |
| 414 | 414 | ||
| 415 | 415 | if cret == 0 { | |
| 416 | 416 | return nil | |
| @@ -420,7 +420,7 @@ func NewParamSpecValueArray(NameVar string, NickVar string, BlurbVar string, Ele | |||
| 420 | 420 | return cls | |
| 421 | 421 | } | |
| 422 | 422 | ||
| 423 | - | var xNewParamSpecVariant func(string, string, string, *glib.VariantType, *glib.Variant, ParamFlags) uintptr | |
| 423 | + | var xNewParamSpecVariant func(string, uintptr, uintptr, *glib.VariantType, *glib.Variant, ParamFlags) uintptr | |
| 424 | 424 | ||
| 425 | 425 | // Creates a new #GParamSpecVariant instance specifying a #GVariant | |
| 426 | 426 | // property. | |
| @@ -428,10 +428,10 @@ var xNewParamSpecVariant func(string, string, string, *glib.VariantType, *glib.V | |||
| 428 | 428 | // If @default_value is floating, it is consumed. | |
| 429 | 429 | // | |
| 430 | 430 | // See g_param_spec_internal() for details on property names. | |
| 431 | - | func NewParamSpecVariant(NameVar string, NickVar string, BlurbVar string, TypeVar *glib.VariantType, DefaultValueVar *glib.Variant, FlagsVar ParamFlags) *ParamSpec { | |
| 431 | + | func NewParamSpecVariant(NameVar string, NickVar *string, BlurbVar *string, TypeVar *glib.VariantType, DefaultValueVar *glib.Variant, FlagsVar ParamFlags) *ParamSpec { | |
| 432 | 432 | var cls *ParamSpec | |
| 433 | 433 | ||
| 434 | - | cret := xNewParamSpecVariant(NameVar, NickVar, BlurbVar, TypeVar, DefaultValueVar, FlagsVar) | |
| 434 | + | cret := xNewParamSpecVariant(NameVar, core.NullableStringToPtr(NickVar), core.NullableStringToPtr(BlurbVar), TypeVar, DefaultValueVar, FlagsVar) | |
| 435 | 435 | ||
| 436 | 436 | if cret == 0 { | |
| 437 | 437 | return nil | |
M v4/gobject/gsignal.go +157 -7
| @@ -228,7 +228,37 @@ var xSignalAddEmissionHook func(uint, glib.Quark, uintptr, uintptr, uintptr) uin | |||
| 228 | 228 | // for signals which don't have %G_SIGNAL_NO_HOOKS flag set. | |
| 229 | 229 | func SignalAddEmissionHook(SignalIdVar uint, DetailVar glib.Quark, HookFuncVar *SignalEmissionHook, HookDataVar uintptr, DataDestroyVar *glib.DestroyNotify) uint32 { | |
| 230 | 230 | ||
| 231 | - | cret := xSignalAddEmissionHook(SignalIdVar, DetailVar, glib.NewCallback(HookFuncVar), HookDataVar, glib.NewCallbackNullable(DataDestroyVar)) | |
| 231 | + | var HookFuncVarRef uintptr | |
| 232 | + | if HookFuncVar != nil { | |
| 233 | + | HookFuncVarPtr := uintptr(unsafe.Pointer(HookFuncVar)) | |
| 234 | + | if cbRefPtr, ok := glib.GetCallback(HookFuncVarPtr); ok { | |
| 235 | + | HookFuncVarRef = cbRefPtr | |
| 236 | + | } else { | |
| 237 | + | fcb := func(arg0 *SignalInvocationHint, arg1 uint, arg2 []Value, arg3 uintptr) bool { | |
| 238 | + | cbFn := *HookFuncVar | |
| 239 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 240 | + | } | |
| 241 | + | HookFuncVarRef = purego.NewCallback(fcb) | |
| 242 | + | glib.SaveCallback(HookFuncVarPtr, HookFuncVarRef) | |
| 243 | + | } | |
| 244 | + | } | |
| 245 | + | ||
| 246 | + | var DataDestroyVarRef uintptr | |
| 247 | + | if DataDestroyVar != nil { | |
| 248 | + | DataDestroyVarPtr := uintptr(unsafe.Pointer(DataDestroyVar)) | |
| 249 | + | if cbRefPtr, ok := glib.GetCallback(DataDestroyVarPtr); ok { | |
| 250 | + | DataDestroyVarRef = cbRefPtr | |
| 251 | + | } else { | |
| 252 | + | fcb := func(arg0 uintptr) { | |
| 253 | + | cbFn := *DataDestroyVar | |
| 254 | + | cbFn(arg0) | |
| 255 | + | } | |
| 256 | + | DataDestroyVarRef = purego.NewCallback(fcb) | |
| 257 | + | glib.SaveCallback(DataDestroyVarPtr, DataDestroyVarRef) | |
| 258 | + | } | |
| 259 | + | } | |
| 260 | + | ||
| 261 | + | cret := xSignalAddEmissionHook(SignalIdVar, DetailVar, HookFuncVarRef, HookDataVar, DataDestroyVarRef) | |
| 232 | 262 | return cret | |
| 233 | 263 | } | |
| 234 | 264 | ||
| @@ -313,7 +343,37 @@ var xSignalConnectData func(uintptr, string, uintptr, uintptr, uintptr, ConnectF | |||
| 313 | 343 | // details. | |
| 314 | 344 | func SignalConnectData(InstanceVar *Object, DetailedSignalVar string, CHandlerVar *Callback, DataVar uintptr, DestroyDataVar *ClosureNotify, ConnectFlagsVar ConnectFlags) uint32 { | |
| 315 | 345 | ||
| 316 | - | cret := xSignalConnectData(InstanceVar.GoPointer(), DetailedSignalVar, glib.NewCallback(CHandlerVar), DataVar, glib.NewCallbackNullable(DestroyDataVar), ConnectFlagsVar) | |
| 346 | + | var CHandlerVarRef uintptr | |
| 347 | + | if CHandlerVar != nil { | |
| 348 | + | CHandlerVarPtr := uintptr(unsafe.Pointer(CHandlerVar)) | |
| 349 | + | if cbRefPtr, ok := glib.GetCallback(CHandlerVarPtr); ok { | |
| 350 | + | CHandlerVarRef = cbRefPtr | |
| 351 | + | } else { | |
| 352 | + | fcb := func() { | |
| 353 | + | cbFn := *CHandlerVar | |
| 354 | + | cbFn() | |
| 355 | + | } | |
| 356 | + | CHandlerVarRef = purego.NewCallback(fcb) | |
| 357 | + | glib.SaveCallback(CHandlerVarPtr, CHandlerVarRef) | |
| 358 | + | } | |
| 359 | + | } | |
| 360 | + | ||
| 361 | + | var DestroyDataVarRef uintptr | |
| 362 | + | if DestroyDataVar != nil { | |
| 363 | + | DestroyDataVarPtr := uintptr(unsafe.Pointer(DestroyDataVar)) | |
| 364 | + | if cbRefPtr, ok := glib.GetCallback(DestroyDataVarPtr); ok { | |
| 365 | + | DestroyDataVarRef = cbRefPtr | |
| 366 | + | } else { | |
| 367 | + | fcb := func(arg0 uintptr, arg1 *Closure) { | |
| 368 | + | cbFn := *DestroyDataVar | |
| 369 | + | cbFn(arg0, arg1) | |
| 370 | + | } | |
| 371 | + | DestroyDataVarRef = purego.NewCallback(fcb) | |
| 372 | + | glib.SaveCallback(DestroyDataVarPtr, DestroyDataVarRef) | |
| 373 | + | } | |
| 374 | + | } | |
| 375 | + | ||
| 376 | + | cret := xSignalConnectData(InstanceVar.GoPointer(), DetailedSignalVar, CHandlerVarRef, DataVar, DestroyDataVarRef, ConnectFlagsVar) | |
| 317 | 377 | return cret | |
| 318 | 378 | } | |
| 319 | 379 | ||
| @@ -634,7 +694,22 @@ var xSignalNew func(string, types.GType, SignalFlags, uint, uintptr, uintptr, ui | |||
| 634 | 694 | // be used. | |
| 635 | 695 | func SignalNew(SignalNameVar string, ItypeVar types.GType, SignalFlagsVar SignalFlags, ClassOffsetVar uint, AccumulatorVar *SignalAccumulator, AccuDataVar uintptr, CMarshallerVar *SignalCMarshaller, ReturnTypeVar types.GType, NParamsVar uint, varArgs ...interface{}) uint { | |
| 636 | 696 | ||
| 637 | - | cret := xSignalNew(SignalNameVar, ItypeVar, SignalFlagsVar, ClassOffsetVar, glib.NewCallbackNullable(AccumulatorVar), AccuDataVar, glib.NewCallbackNullable(CMarshallerVar), ReturnTypeVar, NParamsVar, varArgs...) | |
| 697 | + | var AccumulatorVarRef uintptr | |
| 698 | + | if AccumulatorVar != nil { | |
| 699 | + | AccumulatorVarPtr := uintptr(unsafe.Pointer(AccumulatorVar)) | |
| 700 | + | if cbRefPtr, ok := glib.GetCallback(AccumulatorVarPtr); ok { | |
| 701 | + | AccumulatorVarRef = cbRefPtr | |
| 702 | + | } else { | |
| 703 | + | fcb := func(arg0 *SignalInvocationHint, arg1 *Value, arg2 *Value, arg3 uintptr) bool { | |
| 704 | + | cbFn := *AccumulatorVar | |
| 705 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 706 | + | } | |
| 707 | + | AccumulatorVarRef = purego.NewCallback(fcb) | |
| 708 | + | glib.SaveCallback(AccumulatorVarPtr, AccumulatorVarRef) | |
| 709 | + | } | |
| 710 | + | } | |
| 711 | + | ||
| 712 | + | cret := xSignalNew(SignalNameVar, ItypeVar, SignalFlagsVar, ClassOffsetVar, AccumulatorVarRef, AccuDataVar, glib.NewCallbackNullable(CMarshallerVar), ReturnTypeVar, NParamsVar, varArgs...) | |
| 638 | 713 | return cret | |
| 639 | 714 | } | |
| 640 | 715 | ||
| @@ -658,7 +733,37 @@ var xSignalNewClassHandler func(string, types.GType, SignalFlags, uintptr, uintp | |||
| 658 | 733 | // the marshaller for this signal. | |
| 659 | 734 | func SignalNewClassHandler(SignalNameVar string, ItypeVar types.GType, SignalFlagsVar SignalFlags, ClassHandlerVar *Callback, AccumulatorVar *SignalAccumulator, AccuDataVar uintptr, CMarshallerVar *SignalCMarshaller, ReturnTypeVar types.GType, NParamsVar uint, varArgs ...interface{}) uint { | |
| 660 | 735 | ||
| 661 | - | cret := xSignalNewClassHandler(SignalNameVar, ItypeVar, SignalFlagsVar, glib.NewCallbackNullable(ClassHandlerVar), glib.NewCallbackNullable(AccumulatorVar), AccuDataVar, glib.NewCallbackNullable(CMarshallerVar), ReturnTypeVar, NParamsVar, varArgs...) | |
| 736 | + | var ClassHandlerVarRef uintptr | |
| 737 | + | if ClassHandlerVar != nil { | |
| 738 | + | ClassHandlerVarPtr := uintptr(unsafe.Pointer(ClassHandlerVar)) | |
| 739 | + | if cbRefPtr, ok := glib.GetCallback(ClassHandlerVarPtr); ok { | |
| 740 | + | ClassHandlerVarRef = cbRefPtr | |
| 741 | + | } else { | |
| 742 | + | fcb := func() { | |
| 743 | + | cbFn := *ClassHandlerVar | |
| 744 | + | cbFn() | |
| 745 | + | } | |
| 746 | + | ClassHandlerVarRef = purego.NewCallback(fcb) | |
| 747 | + | glib.SaveCallback(ClassHandlerVarPtr, ClassHandlerVarRef) | |
| 748 | + | } | |
| 749 | + | } | |
| 750 | + | ||
| 751 | + | var AccumulatorVarRef uintptr | |
| 752 | + | if AccumulatorVar != nil { | |
| 753 | + | AccumulatorVarPtr := uintptr(unsafe.Pointer(AccumulatorVar)) | |
| 754 | + | if cbRefPtr, ok := glib.GetCallback(AccumulatorVarPtr); ok { | |
| 755 | + | AccumulatorVarRef = cbRefPtr | |
| 756 | + | } else { | |
| 757 | + | fcb := func(arg0 *SignalInvocationHint, arg1 *Value, arg2 *Value, arg3 uintptr) bool { | |
| 758 | + | cbFn := *AccumulatorVar | |
| 759 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 760 | + | } | |
| 761 | + | AccumulatorVarRef = purego.NewCallback(fcb) | |
| 762 | + | glib.SaveCallback(AccumulatorVarPtr, AccumulatorVarRef) | |
| 763 | + | } | |
| 764 | + | } | |
| 765 | + | ||
| 766 | + | cret := xSignalNewClassHandler(SignalNameVar, ItypeVar, SignalFlagsVar, ClassHandlerVarRef, AccumulatorVarRef, AccuDataVar, glib.NewCallbackNullable(CMarshallerVar), ReturnTypeVar, NParamsVar, varArgs...) | |
| 662 | 767 | return cret | |
| 663 | 768 | } | |
| 664 | 769 | ||
| @@ -672,7 +777,22 @@ var xSignalNewValist func(string, types.GType, SignalFlags, *Closure, uintptr, u | |||
| 672 | 777 | // the marshaller for this signal. | |
| 673 | 778 | func SignalNewValist(SignalNameVar string, ItypeVar types.GType, SignalFlagsVar SignalFlags, ClassClosureVar *Closure, AccumulatorVar *SignalAccumulator, AccuDataVar uintptr, CMarshallerVar *SignalCMarshaller, ReturnTypeVar types.GType, NParamsVar uint, ArgsVar []interface{}) uint { | |
| 674 | 779 | ||
| 675 | - | cret := xSignalNewValist(SignalNameVar, ItypeVar, SignalFlagsVar, ClassClosureVar, glib.NewCallbackNullable(AccumulatorVar), AccuDataVar, glib.NewCallbackNullable(CMarshallerVar), ReturnTypeVar, NParamsVar, ArgsVar) | |
| 780 | + | var AccumulatorVarRef uintptr | |
| 781 | + | if AccumulatorVar != nil { | |
| 782 | + | AccumulatorVarPtr := uintptr(unsafe.Pointer(AccumulatorVar)) | |
| 783 | + | if cbRefPtr, ok := glib.GetCallback(AccumulatorVarPtr); ok { | |
| 784 | + | AccumulatorVarRef = cbRefPtr | |
| 785 | + | } else { | |
| 786 | + | fcb := func(arg0 *SignalInvocationHint, arg1 *Value, arg2 *Value, arg3 uintptr) bool { | |
| 787 | + | cbFn := *AccumulatorVar | |
| 788 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 789 | + | } | |
| 790 | + | AccumulatorVarRef = purego.NewCallback(fcb) | |
| 791 | + | glib.SaveCallback(AccumulatorVarPtr, AccumulatorVarRef) | |
| 792 | + | } | |
| 793 | + | } | |
| 794 | + | ||
| 795 | + | cret := xSignalNewValist(SignalNameVar, ItypeVar, SignalFlagsVar, ClassClosureVar, AccumulatorVarRef, AccuDataVar, glib.NewCallbackNullable(CMarshallerVar), ReturnTypeVar, NParamsVar, ArgsVar) | |
| 676 | 796 | return cret | |
| 677 | 797 | } | |
| 678 | 798 | ||
| @@ -686,7 +806,22 @@ var xSignalNewv func(string, types.GType, SignalFlags, *Closure, uintptr, uintpt | |||
| 686 | 806 | // the marshaller for this signal. | |
| 687 | 807 | func SignalNewv(SignalNameVar string, ItypeVar types.GType, SignalFlagsVar SignalFlags, ClassClosureVar *Closure, AccumulatorVar *SignalAccumulator, AccuDataVar uintptr, CMarshallerVar *SignalCMarshaller, ReturnTypeVar types.GType, NParamsVar uint, ParamTypesVar []types.GType) uint { | |
| 688 | 808 | ||
| 689 | - | cret := xSignalNewv(SignalNameVar, ItypeVar, SignalFlagsVar, ClassClosureVar, glib.NewCallbackNullable(AccumulatorVar), AccuDataVar, glib.NewCallbackNullable(CMarshallerVar), ReturnTypeVar, NParamsVar, ParamTypesVar) | |
| 809 | + | var AccumulatorVarRef uintptr | |
| 810 | + | if AccumulatorVar != nil { | |
| 811 | + | AccumulatorVarPtr := uintptr(unsafe.Pointer(AccumulatorVar)) | |
| 812 | + | if cbRefPtr, ok := glib.GetCallback(AccumulatorVarPtr); ok { | |
| 813 | + | AccumulatorVarRef = cbRefPtr | |
| 814 | + | } else { | |
| 815 | + | fcb := func(arg0 *SignalInvocationHint, arg1 *Value, arg2 *Value, arg3 uintptr) bool { | |
| 816 | + | cbFn := *AccumulatorVar | |
| 817 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 818 | + | } | |
| 819 | + | AccumulatorVarRef = purego.NewCallback(fcb) | |
| 820 | + | glib.SaveCallback(AccumulatorVarPtr, AccumulatorVarRef) | |
| 821 | + | } | |
| 822 | + | } | |
| 823 | + | ||
| 824 | + | cret := xSignalNewv(SignalNameVar, ItypeVar, SignalFlagsVar, ClassClosureVar, AccumulatorVarRef, AccuDataVar, glib.NewCallbackNullable(CMarshallerVar), ReturnTypeVar, NParamsVar, ParamTypesVar) | |
| 690 | 825 | return cret | |
| 691 | 826 | } | |
| 692 | 827 | ||
| @@ -717,7 +852,22 @@ var xSignalOverrideClassHandler func(string, types.GType, uintptr) | |||
| 717 | 852 | // parent class closure from inside the overridden one. | |
| 718 | 853 | func SignalOverrideClassHandler(SignalNameVar string, InstanceTypeVar types.GType, ClassHandlerVar *Callback) { | |
| 719 | 854 | ||
| 720 | - | xSignalOverrideClassHandler(SignalNameVar, InstanceTypeVar, glib.NewCallback(ClassHandlerVar)) | |
| 855 | + | var ClassHandlerVarRef uintptr | |
| 856 | + | if ClassHandlerVar != nil { | |
| 857 | + | ClassHandlerVarPtr := uintptr(unsafe.Pointer(ClassHandlerVar)) | |
| 858 | + | if cbRefPtr, ok := glib.GetCallback(ClassHandlerVarPtr); ok { | |
| 859 | + | ClassHandlerVarRef = cbRefPtr | |
| 860 | + | } else { | |
| 861 | + | fcb := func() { | |
| 862 | + | cbFn := *ClassHandlerVar | |
| 863 | + | cbFn() | |
| 864 | + | } | |
| 865 | + | ClassHandlerVarRef = purego.NewCallback(fcb) | |
| 866 | + | glib.SaveCallback(ClassHandlerVarPtr, ClassHandlerVarRef) | |
| 867 | + | } | |
| 868 | + | } | |
| 869 | + | ||
| 870 | + | xSignalOverrideClassHandler(SignalNameVar, InstanceTypeVar, ClassHandlerVarRef) | |
| 721 | 871 | ||
| 722 | 872 | } | |
| 723 | 873 | ||
M v4/gobject/gsignalgroup.go +95 -5
| @@ -82,7 +82,22 @@ var xSignalGroupConnect func(uintptr, string, uintptr, uintptr) | |||
| 82 | 82 | // You cannot connect a signal handler after #GSignalGroup:target has been set. | |
| 83 | 83 | func (x *SignalGroup) Connect(DetailedSignalVar string, CHandlerVar *Callback, DataVar uintptr) { | |
| 84 | 84 | ||
| 85 | - | xSignalGroupConnect(x.GoPointer(), DetailedSignalVar, glib.NewCallback(CHandlerVar), DataVar) | |
| 85 | + | var CHandlerVarRef uintptr | |
| 86 | + | if CHandlerVar != nil { | |
| 87 | + | CHandlerVarPtr := uintptr(unsafe.Pointer(CHandlerVar)) | |
| 88 | + | if cbRefPtr, ok := glib.GetCallback(CHandlerVarPtr); ok { | |
| 89 | + | CHandlerVarRef = cbRefPtr | |
| 90 | + | } else { | |
| 91 | + | fcb := func() { | |
| 92 | + | cbFn := *CHandlerVar | |
| 93 | + | cbFn() | |
| 94 | + | } | |
| 95 | + | CHandlerVarRef = purego.NewCallback(fcb) | |
| 96 | + | glib.SaveCallback(CHandlerVarPtr, CHandlerVarRef) | |
| 97 | + | } | |
| 98 | + | } | |
| 99 | + | ||
| 100 | + | xSignalGroupConnect(x.GoPointer(), DetailedSignalVar, CHandlerVarRef, DataVar) | |
| 86 | 101 | ||
| 87 | 102 | } | |
| 88 | 103 | ||
| @@ -96,7 +111,22 @@ var xSignalGroupConnectAfter func(uintptr, string, uintptr, uintptr) | |||
| 96 | 111 | // You cannot connect a signal handler after #GSignalGroup:target has been set. | |
| 97 | 112 | func (x *SignalGroup) ConnectAfter(DetailedSignalVar string, CHandlerVar *Callback, DataVar uintptr) { | |
| 98 | 113 | ||
| 99 | - | xSignalGroupConnectAfter(x.GoPointer(), DetailedSignalVar, glib.NewCallback(CHandlerVar), DataVar) | |
| 114 | + | var CHandlerVarRef uintptr | |
| 115 | + | if CHandlerVar != nil { | |
| 116 | + | CHandlerVarPtr := uintptr(unsafe.Pointer(CHandlerVar)) | |
| 117 | + | if cbRefPtr, ok := glib.GetCallback(CHandlerVarPtr); ok { | |
| 118 | + | CHandlerVarRef = cbRefPtr | |
| 119 | + | } else { | |
| 120 | + | fcb := func() { | |
| 121 | + | cbFn := *CHandlerVar | |
| 122 | + | cbFn() | |
| 123 | + | } | |
| 124 | + | CHandlerVarRef = purego.NewCallback(fcb) | |
| 125 | + | glib.SaveCallback(CHandlerVarPtr, CHandlerVarRef) | |
| 126 | + | } | |
| 127 | + | } | |
| 128 | + | ||
| 129 | + | xSignalGroupConnectAfter(x.GoPointer(), DetailedSignalVar, CHandlerVarRef, DataVar) | |
| 100 | 130 | ||
| 101 | 131 | } | |
| 102 | 132 | ||
| @@ -119,7 +149,37 @@ var xSignalGroupConnectData func(uintptr, string, uintptr, uintptr, uintptr, Con | |||
| 119 | 149 | // You cannot connect a signal handler after #GSignalGroup:target has been set. | |
| 120 | 150 | func (x *SignalGroup) ConnectData(DetailedSignalVar string, CHandlerVar *Callback, DataVar uintptr, NotifyVar *ClosureNotify, FlagsVar ConnectFlags) { | |
| 121 | 151 | ||
| 122 | - | xSignalGroupConnectData(x.GoPointer(), DetailedSignalVar, glib.NewCallback(CHandlerVar), DataVar, glib.NewCallback(NotifyVar), FlagsVar) | |
| 152 | + | var CHandlerVarRef uintptr | |
| 153 | + | if CHandlerVar != nil { | |
| 154 | + | CHandlerVarPtr := uintptr(unsafe.Pointer(CHandlerVar)) | |
| 155 | + | if cbRefPtr, ok := glib.GetCallback(CHandlerVarPtr); ok { | |
| 156 | + | CHandlerVarRef = cbRefPtr | |
| 157 | + | } else { | |
| 158 | + | fcb := func() { | |
| 159 | + | cbFn := *CHandlerVar | |
| 160 | + | cbFn() | |
| 161 | + | } | |
| 162 | + | CHandlerVarRef = purego.NewCallback(fcb) | |
| 163 | + | glib.SaveCallback(CHandlerVarPtr, CHandlerVarRef) | |
| 164 | + | } | |
| 165 | + | } | |
| 166 | + | ||
| 167 | + | var NotifyVarRef uintptr | |
| 168 | + | if NotifyVar != nil { | |
| 169 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 170 | + | if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok { | |
| 171 | + | NotifyVarRef = cbRefPtr | |
| 172 | + | } else { | |
| 173 | + | fcb := func(arg0 uintptr, arg1 *Closure) { | |
| 174 | + | cbFn := *NotifyVar | |
| 175 | + | cbFn(arg0, arg1) | |
| 176 | + | } | |
| 177 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 178 | + | glib.SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 179 | + | } | |
| 180 | + | } | |
| 181 | + | ||
| 182 | + | xSignalGroupConnectData(x.GoPointer(), DetailedSignalVar, CHandlerVarRef, DataVar, NotifyVarRef, FlagsVar) | |
| 123 | 183 | ||
| 124 | 184 | } | |
| 125 | 185 | ||
| @@ -134,7 +194,22 @@ var xSignalGroupConnectObject func(uintptr, string, uintptr, uintptr, ConnectFla | |||
| 134 | 194 | // You cannot connect a signal handler after #GSignalGroup:target has been set. | |
| 135 | 195 | func (x *SignalGroup) ConnectObject(DetailedSignalVar string, CHandlerVar *Callback, ObjectVar uintptr, FlagsVar ConnectFlags) { | |
| 136 | 196 | ||
| 137 | - | xSignalGroupConnectObject(x.GoPointer(), DetailedSignalVar, glib.NewCallback(CHandlerVar), ObjectVar, FlagsVar) | |
| 197 | + | var CHandlerVarRef uintptr | |
| 198 | + | if CHandlerVar != nil { | |
| 199 | + | CHandlerVarPtr := uintptr(unsafe.Pointer(CHandlerVar)) | |
| 200 | + | if cbRefPtr, ok := glib.GetCallback(CHandlerVarPtr); ok { | |
| 201 | + | CHandlerVarRef = cbRefPtr | |
| 202 | + | } else { | |
| 203 | + | fcb := func() { | |
| 204 | + | cbFn := *CHandlerVar | |
| 205 | + | cbFn() | |
| 206 | + | } | |
| 207 | + | CHandlerVarRef = purego.NewCallback(fcb) | |
| 208 | + | glib.SaveCallback(CHandlerVarPtr, CHandlerVarRef) | |
| 209 | + | } | |
| 210 | + | } | |
| 211 | + | ||
| 212 | + | xSignalGroupConnectObject(x.GoPointer(), DetailedSignalVar, CHandlerVarRef, ObjectVar, FlagsVar) | |
| 138 | 213 | ||
| 139 | 214 | } | |
| 140 | 215 | ||
| @@ -149,7 +224,22 @@ var xSignalGroupConnectSwapped func(uintptr, string, uintptr, uintptr) | |||
| 149 | 224 | // You cannot connect a signal handler after #GSignalGroup:target has been set. | |
| 150 | 225 | func (x *SignalGroup) ConnectSwapped(DetailedSignalVar string, CHandlerVar *Callback, DataVar uintptr) { | |
| 151 | 226 | ||
| 152 | - | xSignalGroupConnectSwapped(x.GoPointer(), DetailedSignalVar, glib.NewCallback(CHandlerVar), DataVar) | |
| 227 | + | var CHandlerVarRef uintptr | |
| 228 | + | if CHandlerVar != nil { | |
| 229 | + | CHandlerVarPtr := uintptr(unsafe.Pointer(CHandlerVar)) | |
| 230 | + | if cbRefPtr, ok := glib.GetCallback(CHandlerVarPtr); ok { | |
| 231 | + | CHandlerVarRef = cbRefPtr | |
| 232 | + | } else { | |
| 233 | + | fcb := func() { | |
| 234 | + | cbFn := *CHandlerVar | |
| 235 | + | cbFn() | |
| 236 | + | } | |
| 237 | + | CHandlerVarRef = purego.NewCallback(fcb) | |
| 238 | + | glib.SaveCallback(CHandlerVarPtr, CHandlerVarRef) | |
| 239 | + | } | |
| 240 | + | } | |
| 241 | + | ||
| 242 | + | xSignalGroupConnectSwapped(x.GoPointer(), DetailedSignalVar, CHandlerVarRef, DataVar) | |
| 153 | 243 | ||
| 154 | 244 | } | |
| 155 | 245 | ||
M v4/gobject/gtype.go +95 -5
| @@ -810,7 +810,22 @@ var xTypeAddClassCacheFunc func(uintptr, uintptr) | |||
| 810 | 810 | // chain. | |
| 811 | 811 | func TypeAddClassCacheFunc(CacheDataVar uintptr, CacheFuncVar *TypeClassCacheFunc) { | |
| 812 | 812 | ||
| 813 | - | xTypeAddClassCacheFunc(CacheDataVar, glib.NewCallback(CacheFuncVar)) | |
| 813 | + | var CacheFuncVarRef uintptr | |
| 814 | + | if CacheFuncVar != nil { | |
| 815 | + | CacheFuncVarPtr := uintptr(unsafe.Pointer(CacheFuncVar)) | |
| 816 | + | if cbRefPtr, ok := glib.GetCallback(CacheFuncVarPtr); ok { | |
| 817 | + | CacheFuncVarRef = cbRefPtr | |
| 818 | + | } else { | |
| 819 | + | fcb := func(arg0 uintptr, arg1 *TypeClass) bool { | |
| 820 | + | cbFn := *CacheFuncVar | |
| 821 | + | return cbFn(arg0, arg1) | |
| 822 | + | } | |
| 823 | + | CacheFuncVarRef = purego.NewCallback(fcb) | |
| 824 | + | glib.SaveCallback(CacheFuncVarPtr, CacheFuncVarRef) | |
| 825 | + | } | |
| 826 | + | } | |
| 827 | + | ||
| 828 | + | xTypeAddClassCacheFunc(CacheDataVar, CacheFuncVarRef) | |
| 814 | 829 | ||
| 815 | 830 | } | |
| 816 | 831 | ||
| @@ -853,7 +868,22 @@ var xTypeAddInterfaceCheck func(uintptr, uintptr) | |||
| 853 | 868 | // interfaces. | |
| 854 | 869 | func TypeAddInterfaceCheck(CheckDataVar uintptr, CheckFuncVar *TypeInterfaceCheckFunc) { | |
| 855 | 870 | ||
| 856 | - | xTypeAddInterfaceCheck(CheckDataVar, glib.NewCallback(CheckFuncVar)) | |
| 871 | + | var CheckFuncVarRef uintptr | |
| 872 | + | if CheckFuncVar != nil { | |
| 873 | + | CheckFuncVarPtr := uintptr(unsafe.Pointer(CheckFuncVar)) | |
| 874 | + | if cbRefPtr, ok := glib.GetCallback(CheckFuncVarPtr); ok { | |
| 875 | + | CheckFuncVarRef = cbRefPtr | |
| 876 | + | } else { | |
| 877 | + | fcb := func(arg0 uintptr, arg1 *TypeInterface) { | |
| 878 | + | cbFn := *CheckFuncVar | |
| 879 | + | cbFn(arg0, arg1) | |
| 880 | + | } | |
| 881 | + | CheckFuncVarRef = purego.NewCallback(fcb) | |
| 882 | + | glib.SaveCallback(CheckFuncVarPtr, CheckFuncVarRef) | |
| 883 | + | } | |
| 884 | + | } | |
| 885 | + | ||
| 886 | + | xTypeAddInterfaceCheck(CheckDataVar, CheckFuncVarRef) | |
| 857 | 887 | ||
| 858 | 888 | } | |
| 859 | 889 | ||
| @@ -1474,7 +1504,37 @@ var xTypeRegisterStaticSimple func(types.GType, string, uint, uintptr, uint, uin | |||
| 1474 | 1504 | // struct and calling g_type_register_static(). | |
| 1475 | 1505 | func TypeRegisterStaticSimple(ParentTypeVar types.GType, TypeNameVar string, ClassSizeVar uint, ClassInitVar *ClassInitFunc, InstanceSizeVar uint, InstanceInitVar *InstanceInitFunc, FlagsVar TypeFlags) types.GType { | |
| 1476 | 1506 | ||
| 1477 | - | cret := xTypeRegisterStaticSimple(ParentTypeVar, TypeNameVar, ClassSizeVar, glib.NewCallback(ClassInitVar), InstanceSizeVar, glib.NewCallback(InstanceInitVar), FlagsVar) | |
| 1507 | + | var ClassInitVarRef uintptr | |
| 1508 | + | if ClassInitVar != nil { | |
| 1509 | + | ClassInitVarPtr := uintptr(unsafe.Pointer(ClassInitVar)) | |
| 1510 | + | if cbRefPtr, ok := glib.GetCallback(ClassInitVarPtr); ok { | |
| 1511 | + | ClassInitVarRef = cbRefPtr | |
| 1512 | + | } else { | |
| 1513 | + | fcb := func(arg0 *TypeClass, arg1 uintptr) { | |
| 1514 | + | cbFn := *ClassInitVar | |
| 1515 | + | cbFn(arg0, arg1) | |
| 1516 | + | } | |
| 1517 | + | ClassInitVarRef = purego.NewCallback(fcb) | |
| 1518 | + | glib.SaveCallback(ClassInitVarPtr, ClassInitVarRef) | |
| 1519 | + | } | |
| 1520 | + | } | |
| 1521 | + | ||
| 1522 | + | var InstanceInitVarRef uintptr | |
| 1523 | + | if InstanceInitVar != nil { | |
| 1524 | + | InstanceInitVarPtr := uintptr(unsafe.Pointer(InstanceInitVar)) | |
| 1525 | + | if cbRefPtr, ok := glib.GetCallback(InstanceInitVarPtr); ok { | |
| 1526 | + | InstanceInitVarRef = cbRefPtr | |
| 1527 | + | } else { | |
| 1528 | + | fcb := func(arg0 *TypeInstance, arg1 *TypeClass) { | |
| 1529 | + | cbFn := *InstanceInitVar | |
| 1530 | + | cbFn(arg0, arg1) | |
| 1531 | + | } | |
| 1532 | + | InstanceInitVarRef = purego.NewCallback(fcb) | |
| 1533 | + | glib.SaveCallback(InstanceInitVarPtr, InstanceInitVarRef) | |
| 1534 | + | } | |
| 1535 | + | } | |
| 1536 | + | ||
| 1537 | + | cret := xTypeRegisterStaticSimple(ParentTypeVar, TypeNameVar, ClassSizeVar, ClassInitVarRef, InstanceSizeVar, InstanceInitVarRef, FlagsVar) | |
| 1478 | 1538 | return cret | |
| 1479 | 1539 | } | |
| 1480 | 1540 | ||
| @@ -1485,7 +1545,22 @@ var xTypeRemoveClassCacheFunc func(uintptr, uintptr) | |||
| 1485 | 1545 | // g_type_remove_class_cache_func() to avoid leaks. | |
| 1486 | 1546 | func TypeRemoveClassCacheFunc(CacheDataVar uintptr, CacheFuncVar *TypeClassCacheFunc) { | |
| 1487 | 1547 | ||
| 1488 | - | xTypeRemoveClassCacheFunc(CacheDataVar, glib.NewCallback(CacheFuncVar)) | |
| 1548 | + | var CacheFuncVarRef uintptr | |
| 1549 | + | if CacheFuncVar != nil { | |
| 1550 | + | CacheFuncVarPtr := uintptr(unsafe.Pointer(CacheFuncVar)) | |
| 1551 | + | if cbRefPtr, ok := glib.GetCallback(CacheFuncVarPtr); ok { | |
| 1552 | + | CacheFuncVarRef = cbRefPtr | |
| 1553 | + | } else { | |
| 1554 | + | fcb := func(arg0 uintptr, arg1 *TypeClass) bool { | |
| 1555 | + | cbFn := *CacheFuncVar | |
| 1556 | + | return cbFn(arg0, arg1) | |
| 1557 | + | } | |
| 1558 | + | CacheFuncVarRef = purego.NewCallback(fcb) | |
| 1559 | + | glib.SaveCallback(CacheFuncVarPtr, CacheFuncVarRef) | |
| 1560 | + | } | |
| 1561 | + | } | |
| 1562 | + | ||
| 1563 | + | xTypeRemoveClassCacheFunc(CacheDataVar, CacheFuncVarRef) | |
| 1489 | 1564 | ||
| 1490 | 1565 | } | |
| 1491 | 1566 | ||
| @@ -1495,7 +1570,22 @@ var xTypeRemoveInterfaceCheck func(uintptr, uintptr) | |||
| 1495 | 1570 | // g_type_add_interface_check(). | |
| 1496 | 1571 | func TypeRemoveInterfaceCheck(CheckDataVar uintptr, CheckFuncVar *TypeInterfaceCheckFunc) { | |
| 1497 | 1572 | ||
| 1498 | - | xTypeRemoveInterfaceCheck(CheckDataVar, glib.NewCallback(CheckFuncVar)) | |
| 1573 | + | var CheckFuncVarRef uintptr | |
| 1574 | + | if CheckFuncVar != nil { | |
| 1575 | + | CheckFuncVarPtr := uintptr(unsafe.Pointer(CheckFuncVar)) | |
| 1576 | + | if cbRefPtr, ok := glib.GetCallback(CheckFuncVarPtr); ok { | |
| 1577 | + | CheckFuncVarRef = cbRefPtr | |
| 1578 | + | } else { | |
| 1579 | + | fcb := func(arg0 uintptr, arg1 *TypeInterface) { | |
| 1580 | + | cbFn := *CheckFuncVar | |
| 1581 | + | cbFn(arg0, arg1) | |
| 1582 | + | } | |
| 1583 | + | CheckFuncVarRef = purego.NewCallback(fcb) | |
| 1584 | + | glib.SaveCallback(CheckFuncVarPtr, CheckFuncVarRef) | |
| 1585 | + | } | |
| 1586 | + | } | |
| 1587 | + | ||
| 1588 | + | xTypeRemoveInterfaceCheck(CheckDataVar, CheckFuncVarRef) | |
| 1499 | 1589 | ||
| 1500 | 1590 | } | |
| 1501 | 1591 | ||
M v4/gobject/gvalue.go +31 -16
| @@ -524,14 +524,14 @@ func (x *Value) SetInt64(VInt64Var int64) { | |||
| 524 | 524 | ||
| 525 | 525 | } | |
| 526 | 526 | ||
| 527 | - | var xValueSetInternedString func(uintptr, string) | |
| 527 | + | var xValueSetInternedString func(uintptr, uintptr) | |
| 528 | 528 | ||
| 529 | 529 | // Set the contents of a %G_TYPE_STRING #GValue to @v_string. The string is | |
| 530 | 530 | // assumed to be static and interned (canonical, for example from | |
| 531 | 531 | // g_intern_string()), and is thus not duplicated when setting the #GValue. | |
| 532 | - | func (x *Value) SetInternedString(VStringVar string) { | |
| 532 | + | func (x *Value) SetInternedString(VStringVar *string) { | |
| 533 | 533 | ||
| 534 | - | xValueSetInternedString(x.GoPointer(), VStringVar) | |
| 534 | + | xValueSetInternedString(x.GoPointer(), core.NullableStringToPtr(VStringVar)) | |
| 535 | 535 | ||
| 536 | 536 | } | |
| 537 | 537 | ||
| @@ -620,7 +620,7 @@ func (x *Value) SetStaticBoxed(VBoxedVar uintptr) { | |||
| 620 | 620 | ||
| 621 | 621 | } | |
| 622 | 622 | ||
| 623 | - | var xValueSetStaticString func(uintptr, string) | |
| 623 | + | var xValueSetStaticString func(uintptr, uintptr) | |
| 624 | 624 | ||
| 625 | 625 | // Set the contents of a %G_TYPE_STRING #GValue to @v_string. | |
| 626 | 626 | // The string is assumed to be static, and is thus not duplicated | |
| @@ -628,27 +628,27 @@ var xValueSetStaticString func(uintptr, string) | |||
| 628 | 628 | // | |
| 629 | 629 | // If the the string is a canonical string, using g_value_set_interned_string() | |
| 630 | 630 | // is more appropriate. | |
| 631 | - | func (x *Value) SetStaticString(VStringVar string) { | |
| 631 | + | func (x *Value) SetStaticString(VStringVar *string) { | |
| 632 | 632 | ||
| 633 | - | xValueSetStaticString(x.GoPointer(), VStringVar) | |
| 633 | + | xValueSetStaticString(x.GoPointer(), core.NullableStringToPtr(VStringVar)) | |
| 634 | 634 | ||
| 635 | 635 | } | |
| 636 | 636 | ||
| 637 | - | var xValueSetString func(uintptr, string) | |
| 637 | + | var xValueSetString func(uintptr, uintptr) | |
| 638 | 638 | ||
| 639 | 639 | // Set the contents of a %G_TYPE_STRING #GValue to a copy of @v_string. | |
| 640 | - | func (x *Value) SetString(VStringVar string) { | |
| 640 | + | func (x *Value) SetString(VStringVar *string) { | |
| 641 | 641 | ||
| 642 | - | xValueSetString(x.GoPointer(), VStringVar) | |
| 642 | + | xValueSetString(x.GoPointer(), core.NullableStringToPtr(VStringVar)) | |
| 643 | 643 | ||
| 644 | 644 | } | |
| 645 | 645 | ||
| 646 | - | var xValueSetStringTakeOwnership func(uintptr, string) | |
| 646 | + | var xValueSetStringTakeOwnership func(uintptr, uintptr) | |
| 647 | 647 | ||
| 648 | 648 | // This is an internal function introduced mainly for C marshallers. | |
| 649 | - | func (x *Value) SetStringTakeOwnership(VStringVar string) { | |
| 649 | + | func (x *Value) SetStringTakeOwnership(VStringVar *string) { | |
| 650 | 650 | ||
| 651 | - | xValueSetStringTakeOwnership(x.GoPointer(), VStringVar) | |
| 651 | + | xValueSetStringTakeOwnership(x.GoPointer(), core.NullableStringToPtr(VStringVar)) | |
| 652 | 652 | ||
| 653 | 653 | } | |
| 654 | 654 | ||
| @@ -752,12 +752,12 @@ func (x *Value) TakeParam(ParamVar *ParamSpec) { | |||
| 752 | 752 | ||
| 753 | 753 | } | |
| 754 | 754 | ||
| 755 | - | var xValueTakeString func(uintptr, string) | |
| 755 | + | var xValueTakeString func(uintptr, uintptr) | |
| 756 | 756 | ||
| 757 | 757 | // Sets the contents of a %G_TYPE_STRING #GValue to @v_string. | |
| 758 | - | func (x *Value) TakeString(VStringVar string) { | |
| 758 | + | func (x *Value) TakeString(VStringVar *string) { | |
| 759 | 759 | ||
| 760 | - | xValueTakeString(x.GoPointer(), VStringVar) | |
| 760 | + | xValueTakeString(x.GoPointer(), core.NullableStringToPtr(VStringVar)) | |
| 761 | 761 | ||
| 762 | 762 | } | |
| 763 | 763 | ||
| @@ -848,7 +848,22 @@ var xValueRegisterTransformFunc func(types.GType, types.GType, uintptr) | |||
| 848 | 848 | // @dest_type will be replaced. | |
| 849 | 849 | func ValueRegisterTransformFunc(SrcTypeVar types.GType, DestTypeVar types.GType, TransformFuncVar *ValueTransform) { | |
| 850 | 850 | ||
| 851 | - | xValueRegisterTransformFunc(SrcTypeVar, DestTypeVar, glib.NewCallback(TransformFuncVar)) | |
| 851 | + | var TransformFuncVarRef uintptr | |
| 852 | + | if TransformFuncVar != nil { | |
| 853 | + | TransformFuncVarPtr := uintptr(unsafe.Pointer(TransformFuncVar)) | |
| 854 | + | if cbRefPtr, ok := glib.GetCallback(TransformFuncVarPtr); ok { | |
| 855 | + | TransformFuncVarRef = cbRefPtr | |
| 856 | + | } else { | |
| 857 | + | fcb := func(arg0 *Value, arg1 *Value) { | |
| 858 | + | cbFn := *TransformFuncVar | |
| 859 | + | cbFn(arg0, arg1) | |
| 860 | + | } | |
| 861 | + | TransformFuncVarRef = purego.NewCallback(fcb) | |
| 862 | + | glib.SaveCallback(TransformFuncVarPtr, TransformFuncVarRef) | |
| 863 | + | } | |
| 864 | + | } | |
| 865 | + | ||
| 866 | + | xValueRegisterTransformFunc(SrcTypeVar, DestTypeVar, TransformFuncVarRef) | |
| 852 | 867 | ||
| 853 | 868 | } | |
| 854 | 869 | ||
M v4/gobject/gvaluearray.go +32 -2
| @@ -145,7 +145,22 @@ var xValueArraySort func(uintptr, uintptr) *ValueArray | |||
| 145 | 145 | // C qsort() function. | |
| 146 | 146 | func (x *ValueArray) Sort(CompareFuncVar *glib.CompareFunc) *ValueArray { | |
| 147 | 147 | ||
| 148 | - | cret := xValueArraySort(x.GoPointer(), glib.NewCallback(CompareFuncVar)) | |
| 148 | + | var CompareFuncVarRef uintptr | |
| 149 | + | if CompareFuncVar != nil { | |
| 150 | + | CompareFuncVarPtr := uintptr(unsafe.Pointer(CompareFuncVar)) | |
| 151 | + | if cbRefPtr, ok := glib.GetCallback(CompareFuncVarPtr); ok { | |
| 152 | + | CompareFuncVarRef = cbRefPtr | |
| 153 | + | } else { | |
| 154 | + | fcb := func(arg0 uintptr, arg1 uintptr) int { | |
| 155 | + | cbFn := *CompareFuncVar | |
| 156 | + | return cbFn(arg0, arg1) | |
| 157 | + | } | |
| 158 | + | CompareFuncVarRef = purego.NewCallback(fcb) | |
| 159 | + | glib.SaveCallback(CompareFuncVarPtr, CompareFuncVarRef) | |
| 160 | + | } | |
| 161 | + | } | |
| 162 | + | ||
| 163 | + | cret := xValueArraySort(x.GoPointer(), CompareFuncVarRef) | |
| 149 | 164 | return cret | |
| 150 | 165 | } | |
| 151 | 166 | ||
| @@ -158,7 +173,22 @@ var xValueArraySortWithData func(uintptr, uintptr, uintptr) *ValueArray | |||
| 158 | 173 | // C qsort() function. | |
| 159 | 174 | func (x *ValueArray) SortWithData(CompareFuncVar *glib.CompareDataFunc, UserDataVar uintptr) *ValueArray { | |
| 160 | 175 | ||
| 161 | - | cret := xValueArraySortWithData(x.GoPointer(), glib.NewCallback(CompareFuncVar), UserDataVar) | |
| 176 | + | var CompareFuncVarRef uintptr | |
| 177 | + | if CompareFuncVar != nil { | |
| 178 | + | CompareFuncVarPtr := uintptr(unsafe.Pointer(CompareFuncVar)) | |
| 179 | + | if cbRefPtr, ok := glib.GetCallback(CompareFuncVarPtr); ok { | |
| 180 | + | CompareFuncVarRef = cbRefPtr | |
| 181 | + | } else { | |
| 182 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 183 | + | cbFn := *CompareFuncVar | |
| 184 | + | return cbFn(arg0, arg1, arg2) | |
| 185 | + | } | |
| 186 | + | CompareFuncVarRef = purego.NewCallback(fcb) | |
| 187 | + | glib.SaveCallback(CompareFuncVarPtr, CompareFuncVarRef) | |
| 188 | + | } | |
| 189 | + | } | |
| 190 | + | ||
| 191 | + | cret := xValueArraySortWithData(x.GoPointer(), CompareFuncVarRef, UserDataVar) | |
| 162 | 192 | return cret | |
| 163 | 193 | } | |
| 164 | 194 | ||
M v4/gsk/gskglshader.go +1 -1
| @@ -585,7 +585,7 @@ func (c *GLShader) SetGoPointer(ptr uintptr) { | |||
| 585 | 585 | func (x *GLShader) SetPropertyResource(value string) { | |
| 586 | 586 | var v gobject.Value | |
| 587 | 587 | v.Init(gobject.TypeStringVal) | |
| 588 | - | v.SetString(value) | |
| 588 | + | v.SetString(&value) | |
| 589 | 589 | x.SetProperty("resource", &v) | |
| 590 | 590 | } | |
| 591 | 591 | ||
M v4/gsk/gskrendernode.go +16 -1
| @@ -298,7 +298,22 @@ var xRenderNodeDeserialize func(*glib.Bytes, uintptr, uintptr) uintptr | |||
| 298 | 298 | func RenderNodeDeserialize(BytesVar *glib.Bytes, ErrorFuncVar *ParseErrorFunc, UserDataVar uintptr) *RenderNode { | |
| 299 | 299 | var cls *RenderNode | |
| 300 | 300 | ||
| 301 | - | cret := xRenderNodeDeserialize(BytesVar, glib.NewCallbackNullable(ErrorFuncVar), UserDataVar) | |
| 301 | + | var ErrorFuncVarRef uintptr | |
| 302 | + | if ErrorFuncVar != nil { | |
| 303 | + | ErrorFuncVarPtr := uintptr(unsafe.Pointer(ErrorFuncVar)) | |
| 304 | + | if cbRefPtr, ok := glib.GetCallback(ErrorFuncVarPtr); ok { | |
| 305 | + | ErrorFuncVarRef = cbRefPtr | |
| 306 | + | } else { | |
| 307 | + | fcb := func(arg0 *ParseLocation, arg1 *ParseLocation, arg2 *glib.Error, arg3 uintptr) { | |
| 308 | + | cbFn := *ErrorFuncVar | |
| 309 | + | cbFn(arg0, arg1, arg2, arg3) | |
| 310 | + | } | |
| 311 | + | ErrorFuncVarRef = purego.NewCallback(fcb) | |
| 312 | + | glib.SaveCallback(ErrorFuncVarPtr, ErrorFuncVarRef) | |
| 313 | + | } | |
| 314 | + | } | |
| 315 | + | ||
| 316 | + | cret := xRenderNodeDeserialize(BytesVar, ErrorFuncVarRef, UserDataVar) | |
| 302 | 317 | ||
| 303 | 318 | if cret == 0 { | |
| 304 | 319 | return nil | |
M v4/gsk/gsktypes.go +32 -2
| @@ -247,7 +247,22 @@ var xPathForeach func(uintptr, PathForeachFlags, uintptr, uintptr) bool | |||
| 247 | 247 | // an approximation of the path using just the allowed operations. | |
| 248 | 248 | func (x *Path) Foreach(FlagsVar PathForeachFlags, FuncVar *PathForeachFunc, UserDataVar uintptr) bool { | |
| 249 | 249 | ||
| 250 | - | cret := xPathForeach(x.GoPointer(), FlagsVar, glib.NewCallback(FuncVar), UserDataVar) | |
| 250 | + | var FuncVarRef uintptr | |
| 251 | + | if FuncVar != nil { | |
| 252 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 253 | + | if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok { | |
| 254 | + | FuncVarRef = cbRefPtr | |
| 255 | + | } else { | |
| 256 | + | fcb := func(arg0 PathOperation, arg1 []graphene.Point, arg2 uint, arg3 float32, arg4 uintptr) bool { | |
| 257 | + | cbFn := *FuncVar | |
| 258 | + | return cbFn(arg0, arg1, arg2, arg3, arg4) | |
| 259 | + | } | |
| 260 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 261 | + | glib.SaveCallback(FuncVarPtr, FuncVarRef) | |
| 262 | + | } | |
| 263 | + | } | |
| 264 | + | ||
| 265 | + | cret := xPathForeach(x.GoPointer(), FlagsVar, FuncVarRef, UserDataVar) | |
| 251 | 266 | return cret | |
| 252 | 267 | } | |
| 253 | 268 | ||
| @@ -270,7 +285,22 @@ var xPathForeachIntersection func(uintptr, *Path, uintptr, uintptr) bool | |||
| 270 | 285 | // If @func returns `FALSE`, the iteration is stopped. | |
| 271 | 286 | func (x *Path) ForeachIntersection(Path2Var *Path, FuncVar *PathIntersectionFunc, UserDataVar uintptr) bool { | |
| 272 | 287 | ||
| 273 | - | cret := xPathForeachIntersection(x.GoPointer(), Path2Var, glib.NewCallback(FuncVar), UserDataVar) | |
| 288 | + | var FuncVarRef uintptr | |
| 289 | + | if FuncVar != nil { | |
| 290 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 291 | + | if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok { | |
| 292 | + | FuncVarRef = cbRefPtr | |
| 293 | + | } else { | |
| 294 | + | fcb := func(arg0 *Path, arg1 *PathPoint, arg2 *Path, arg3 *PathPoint, arg4 PathIntersection, arg5 uintptr) bool { | |
| 295 | + | cbFn := *FuncVar | |
| 296 | + | return cbFn(arg0, arg1, arg2, arg3, arg4, arg5) | |
| 297 | + | } | |
| 298 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 299 | + | glib.SaveCallback(FuncVarPtr, FuncVarRef) | |
| 300 | + | } | |
| 301 | + | } | |
| 302 | + | ||
| 303 | + | cret := xPathForeachIntersection(x.GoPointer(), Path2Var, FuncVarRef, UserDataVar) | |
| 274 | 304 | return cret | |
| 275 | 305 | } | |
| 276 | 306 | ||
M v4/gtk/gtkaboutdialog.go +37 -37
| @@ -357,25 +357,25 @@ func (x *AboutDialog) SetAuthors(AuthorsVar []string) { | |||
| 357 | 357 | ||
| 358 | 358 | } | |
| 359 | 359 | ||
| 360 | - | var xAboutDialogSetComments func(uintptr, string) | |
| 360 | + | var xAboutDialogSetComments func(uintptr, uintptr) | |
| 361 | 361 | ||
| 362 | 362 | // Sets the comments string to display in the about dialog. | |
| 363 | 363 | // | |
| 364 | 364 | // This should be a short string of one or two lines. | |
| 365 | - | func (x *AboutDialog) SetComments(CommentsVar string) { | |
| 365 | + | func (x *AboutDialog) SetComments(CommentsVar *string) { | |
| 366 | 366 | ||
| 367 | - | xAboutDialogSetComments(x.GoPointer(), CommentsVar) | |
| 367 | + | xAboutDialogSetComments(x.GoPointer(), core.NullableStringToPtr(CommentsVar)) | |
| 368 | 368 | ||
| 369 | 369 | } | |
| 370 | 370 | ||
| 371 | - | var xAboutDialogSetCopyright func(uintptr, string) | |
| 371 | + | var xAboutDialogSetCopyright func(uintptr, uintptr) | |
| 372 | 372 | ||
| 373 | 373 | // Sets the copyright string to display in the about dialog. | |
| 374 | 374 | // | |
| 375 | 375 | // This should be a short string of one or two lines. | |
| 376 | - | func (x *AboutDialog) SetCopyright(CopyrightVar string) { | |
| 376 | + | func (x *AboutDialog) SetCopyright(CopyrightVar *string) { | |
| 377 | 377 | ||
| 378 | - | xAboutDialogSetCopyright(x.GoPointer(), CopyrightVar) | |
| 378 | + | xAboutDialogSetCopyright(x.GoPointer(), core.NullableStringToPtr(CopyrightVar)) | |
| 379 | 379 | ||
| 380 | 380 | } | |
| 381 | 381 | ||
| @@ -389,15 +389,15 @@ func (x *AboutDialog) SetDocumenters(DocumentersVar []string) { | |||
| 389 | 389 | ||
| 390 | 390 | } | |
| 391 | 391 | ||
| 392 | - | var xAboutDialogSetLicense func(uintptr, string) | |
| 392 | + | var xAboutDialogSetLicense func(uintptr, uintptr) | |
| 393 | 393 | ||
| 394 | 394 | // Sets the license information to be displayed in the | |
| 395 | 395 | // about dialog. | |
| 396 | 396 | // | |
| 397 | 397 | // If `license` is `NULL`, the license page is hidden. | |
| 398 | - | func (x *AboutDialog) SetLicense(LicenseVar string) { | |
| 398 | + | func (x *AboutDialog) SetLicense(LicenseVar *string) { | |
| 399 | 399 | ||
| 400 | - | xAboutDialogSetLicense(x.GoPointer(), LicenseVar) | |
| 400 | + | xAboutDialogSetLicense(x.GoPointer(), core.NullableStringToPtr(LicenseVar)) | |
| 401 | 401 | ||
| 402 | 402 | } | |
| 403 | 403 | ||
| @@ -423,28 +423,28 @@ func (x *AboutDialog) SetLogo(LogoVar gdk.Paintable) { | |||
| 423 | 423 | ||
| 424 | 424 | } | |
| 425 | 425 | ||
| 426 | - | var xAboutDialogSetLogoIconName func(uintptr, string) | |
| 426 | + | var xAboutDialogSetLogoIconName func(uintptr, uintptr) | |
| 427 | 427 | ||
| 428 | 428 | // Sets the icon name to be displayed as logo in the about dialog. | |
| 429 | - | func (x *AboutDialog) SetLogoIconName(IconNameVar string) { | |
| 429 | + | func (x *AboutDialog) SetLogoIconName(IconNameVar *string) { | |
| 430 | 430 | ||
| 431 | - | xAboutDialogSetLogoIconName(x.GoPointer(), IconNameVar) | |
| 431 | + | xAboutDialogSetLogoIconName(x.GoPointer(), core.NullableStringToPtr(IconNameVar)) | |
| 432 | 432 | ||
| 433 | 433 | } | |
| 434 | 434 | ||
| 435 | - | var xAboutDialogSetProgramName func(uintptr, string) | |
| 435 | + | var xAboutDialogSetProgramName func(uintptr, uintptr) | |
| 436 | 436 | ||
| 437 | 437 | // Sets the name to display in the about dialog. | |
| 438 | 438 | // | |
| 439 | 439 | // If `name` is not set, the string returned | |
| 440 | 440 | // by `g_get_application_name()` is used. | |
| 441 | - | func (x *AboutDialog) SetProgramName(NameVar string) { | |
| 441 | + | func (x *AboutDialog) SetProgramName(NameVar *string) { | |
| 442 | 442 | ||
| 443 | - | xAboutDialogSetProgramName(x.GoPointer(), NameVar) | |
| 443 | + | xAboutDialogSetProgramName(x.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 444 | 444 | ||
| 445 | 445 | } | |
| 446 | 446 | ||
| 447 | - | var xAboutDialogSetSystemInformation func(uintptr, string) | |
| 447 | + | var xAboutDialogSetSystemInformation func(uintptr, uintptr) | |
| 448 | 448 | ||
| 449 | 449 | // Sets the system information to be displayed in the about | |
| 450 | 450 | // dialog. | |
| @@ -453,13 +453,13 @@ var xAboutDialogSetSystemInformation func(uintptr, string) | |||
| 453 | 453 | // page is hidden. | |
| 454 | 454 | // | |
| 455 | 455 | // See [property@Gtk.AboutDialog:system-information]. | |
| 456 | - | func (x *AboutDialog) SetSystemInformation(SystemInformationVar string) { | |
| 456 | + | func (x *AboutDialog) SetSystemInformation(SystemInformationVar *string) { | |
| 457 | 457 | ||
| 458 | - | xAboutDialogSetSystemInformation(x.GoPointer(), SystemInformationVar) | |
| 458 | + | xAboutDialogSetSystemInformation(x.GoPointer(), core.NullableStringToPtr(SystemInformationVar)) | |
| 459 | 459 | ||
| 460 | 460 | } | |
| 461 | 461 | ||
| 462 | - | var xAboutDialogSetTranslatorCredits func(uintptr, string) | |
| 462 | + | var xAboutDialogSetTranslatorCredits func(uintptr, uintptr) | |
| 463 | 463 | ||
| 464 | 464 | // Sets the translator credits string which is displayed in | |
| 465 | 465 | // the credits page. | |
| @@ -481,27 +481,27 @@ var xAboutDialogSetTranslatorCredits func(uintptr, string) | |||
| 481 | 481 | // for this purpose, since translators will already know the purpose of | |
| 482 | 482 | // that `msgid`, and since `GtkAboutDialog` will detect if “translator-credits” | |
| 483 | 483 | // is untranslated and omit translator credits. | |
| 484 | - | func (x *AboutDialog) SetTranslatorCredits(TranslatorCreditsVar string) { | |
| 484 | + | func (x *AboutDialog) SetTranslatorCredits(TranslatorCreditsVar *string) { | |
| 485 | 485 | ||
| 486 | - | xAboutDialogSetTranslatorCredits(x.GoPointer(), TranslatorCreditsVar) | |
| 486 | + | xAboutDialogSetTranslatorCredits(x.GoPointer(), core.NullableStringToPtr(TranslatorCreditsVar)) | |
| 487 | 487 | ||
| 488 | 488 | } | |
| 489 | 489 | ||
| 490 | - | var xAboutDialogSetVersion func(uintptr, string) | |
| 490 | + | var xAboutDialogSetVersion func(uintptr, uintptr) | |
| 491 | 491 | ||
| 492 | 492 | // Sets the version string to display in the about dialog. | |
| 493 | - | func (x *AboutDialog) SetVersion(VersionVar string) { | |
| 493 | + | func (x *AboutDialog) SetVersion(VersionVar *string) { | |
| 494 | 494 | ||
| 495 | - | xAboutDialogSetVersion(x.GoPointer(), VersionVar) | |
| 495 | + | xAboutDialogSetVersion(x.GoPointer(), core.NullableStringToPtr(VersionVar)) | |
| 496 | 496 | ||
| 497 | 497 | } | |
| 498 | 498 | ||
| 499 | - | var xAboutDialogSetWebsite func(uintptr, string) | |
| 499 | + | var xAboutDialogSetWebsite func(uintptr, uintptr) | |
| 500 | 500 | ||
| 501 | 501 | // Sets the URL to use for the website link. | |
| 502 | - | func (x *AboutDialog) SetWebsite(WebsiteVar string) { | |
| 502 | + | func (x *AboutDialog) SetWebsite(WebsiteVar *string) { | |
| 503 | 503 | ||
| 504 | - | xAboutDialogSetWebsite(x.GoPointer(), WebsiteVar) | |
| 504 | + | xAboutDialogSetWebsite(x.GoPointer(), core.NullableStringToPtr(WebsiteVar)) | |
| 505 | 505 | ||
| 506 | 506 | } | |
| 507 | 507 | ||
| @@ -590,7 +590,7 @@ func (x *AboutDialog) GetPropertyAuthors() []string { | |||
| 590 | 590 | func (x *AboutDialog) SetPropertyComments(value string) { | |
| 591 | 591 | var v gobject.Value | |
| 592 | 592 | v.Init(gobject.TypeStringVal) | |
| 593 | - | v.SetString(value) | |
| 593 | + | v.SetString(&value) | |
| 594 | 594 | x.SetProperty("comments", &v) | |
| 595 | 595 | } | |
| 596 | 596 | ||
| @@ -611,7 +611,7 @@ func (x *AboutDialog) GetPropertyComments() string { | |||
| 611 | 611 | func (x *AboutDialog) SetPropertyCopyright(value string) { | |
| 612 | 612 | var v gobject.Value | |
| 613 | 613 | v.Init(gobject.TypeStringVal) | |
| 614 | - | v.SetString(value) | |
| 614 | + | v.SetString(&value) | |
| 615 | 615 | x.SetProperty("copyright", &v) | |
| 616 | 616 | } | |
| 617 | 617 | ||
| @@ -664,7 +664,7 @@ func (x *AboutDialog) GetPropertyDocumenters() []string { | |||
| 664 | 664 | func (x *AboutDialog) SetPropertyLicense(value string) { | |
| 665 | 665 | var v gobject.Value | |
| 666 | 666 | v.Init(gobject.TypeStringVal) | |
| 667 | - | v.SetString(value) | |
| 667 | + | v.SetString(&value) | |
| 668 | 668 | x.SetProperty("license", &v) | |
| 669 | 669 | } | |
| 670 | 670 | ||
| @@ -696,7 +696,7 @@ func (x *AboutDialog) GetPropertyLicense() string { | |||
| 696 | 696 | func (x *AboutDialog) SetPropertyLogoIconName(value string) { | |
| 697 | 697 | var v gobject.Value | |
| 698 | 698 | v.Init(gobject.TypeStringVal) | |
| 699 | - | v.SetString(value) | |
| 699 | + | v.SetString(&value) | |
| 700 | 700 | x.SetProperty("logo-icon-name", &v) | |
| 701 | 701 | } | |
| 702 | 702 | ||
| @@ -718,7 +718,7 @@ func (x *AboutDialog) GetPropertyLogoIconName() string { | |||
| 718 | 718 | func (x *AboutDialog) SetPropertyProgramName(value string) { | |
| 719 | 719 | var v gobject.Value | |
| 720 | 720 | v.Init(gobject.TypeStringVal) | |
| 721 | - | v.SetString(value) | |
| 721 | + | v.SetString(&value) | |
| 722 | 722 | x.SetProperty("program-name", &v) | |
| 723 | 723 | } | |
| 724 | 724 | ||
| @@ -746,7 +746,7 @@ func (x *AboutDialog) GetPropertyProgramName() string { | |||
| 746 | 746 | func (x *AboutDialog) SetPropertySystemInformation(value string) { | |
| 747 | 747 | var v gobject.Value | |
| 748 | 748 | v.Init(gobject.TypeStringVal) | |
| 749 | - | v.SetString(value) | |
| 749 | + | v.SetString(&value) | |
| 750 | 750 | x.SetProperty("system-information", &v) | |
| 751 | 751 | } | |
| 752 | 752 | ||
| @@ -776,7 +776,7 @@ func (x *AboutDialog) GetPropertySystemInformation() string { | |||
| 776 | 776 | func (x *AboutDialog) SetPropertyTranslatorCredits(value string) { | |
| 777 | 777 | var v gobject.Value | |
| 778 | 778 | v.Init(gobject.TypeStringVal) | |
| 779 | - | v.SetString(value) | |
| 779 | + | v.SetString(&value) | |
| 780 | 780 | x.SetProperty("translator-credits", &v) | |
| 781 | 781 | } | |
| 782 | 782 | ||
| @@ -798,7 +798,7 @@ func (x *AboutDialog) GetPropertyTranslatorCredits() string { | |||
| 798 | 798 | func (x *AboutDialog) SetPropertyVersion(value string) { | |
| 799 | 799 | var v gobject.Value | |
| 800 | 800 | v.Init(gobject.TypeStringVal) | |
| 801 | - | v.SetString(value) | |
| 801 | + | v.SetString(&value) | |
| 802 | 802 | x.SetProperty("version", &v) | |
| 803 | 803 | } | |
| 804 | 804 | ||
| @@ -817,7 +817,7 @@ func (x *AboutDialog) GetPropertyVersion() string { | |||
| 817 | 817 | func (x *AboutDialog) SetPropertyWebsite(value string) { | |
| 818 | 818 | var v gobject.Value | |
| 819 | 819 | v.Init(gobject.TypeStringVal) | |
| 820 | - | v.SetString(value) | |
| 820 | + | v.SetString(&value) | |
| 821 | 821 | x.SetProperty("website", &v) | |
| 822 | 822 | } | |
| 823 | 823 | ||
| @@ -836,7 +836,7 @@ func (x *AboutDialog) GetPropertyWebsite() string { | |||
| 836 | 836 | func (x *AboutDialog) SetPropertyWebsiteLabel(value string) { | |
| 837 | 837 | var v gobject.Value | |
| 838 | 838 | v.Init(gobject.TypeStringVal) | |
| 839 | - | v.SetString(value) | |
| 839 | + | v.SetString(&value) | |
| 840 | 840 | x.SetProperty("website-label", &v) | |
| 841 | 841 | } | |
| 842 | 842 | ||
M v4/gtk/gtkactionable.go +5 -5
| @@ -148,7 +148,7 @@ type Actionable interface { | |||
| 148 | 148 | SetGoPointer(uintptr) | |
| 149 | 149 | GetActionName() string | |
| 150 | 150 | GetActionTargetValue() *glib.Variant | |
| 151 | - | SetActionName(ActionNameVar string) | |
| 151 | + | SetActionName(ActionNameVar *string) | |
| 152 | 152 | SetActionTarget(FormatStringVar string, varArgs ...interface{}) | |
| 153 | 153 | SetActionTargetValue(TargetValueVar *glib.Variant) | |
| 154 | 154 | SetDetailedActionName(DetailedActionNameVar string) | |
| @@ -202,9 +202,9 @@ func (x *ActionableBase) GetActionTargetValue() *glib.Variant { | |||
| 202 | 202 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 203 | 203 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 204 | 204 | // associated with the window. | |
| 205 | - | func (x *ActionableBase) SetActionName(ActionNameVar string) { | |
| 205 | + | func (x *ActionableBase) SetActionName(ActionNameVar *string) { | |
| 206 | 206 | ||
| 207 | - | XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 207 | + | XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 208 | 208 | ||
| 209 | 209 | } | |
| 210 | 210 | ||
| @@ -265,7 +265,7 @@ func (x *ActionableBase) SetPropertyActionName(value string) { | |||
| 265 | 265 | obj.Ptr = x.GoPointer() | |
| 266 | 266 | var v gobject.Value | |
| 267 | 267 | v.Init(gobject.TypeStringVal) | |
| 268 | - | v.SetString(value) | |
| 268 | + | v.SetString(&value) | |
| 269 | 269 | obj.SetProperty("action-name", &v) | |
| 270 | 270 | } | |
| 271 | 271 | ||
| @@ -302,7 +302,7 @@ func (x *ActionableBase) GetPropertyActionTarget() uintptr { | |||
| 302 | 302 | ||
| 303 | 303 | var XGtkActionableGetActionName func(uintptr) string | |
| 304 | 304 | var XGtkActionableGetActionTargetValue func(uintptr) *glib.Variant | |
| 305 | - | var XGtkActionableSetActionName func(uintptr, string) | |
| 305 | + | var XGtkActionableSetActionName func(uintptr, uintptr) | |
| 306 | 306 | var XGtkActionableSetActionTarget func(uintptr, string, ...interface{}) | |
| 307 | 307 | var XGtkActionableSetActionTargetValue func(uintptr, *glib.Variant) | |
| 308 | 308 | var XGtkActionableSetDetailedActionName func(uintptr, string) | |
M v4/gtk/gtkalertdialog.go +18 -3
| @@ -74,7 +74,22 @@ var xAlertDialogChoose func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||
| 74 | 74 | // this case is [method@Gtk.AlertDialog.show]. | |
| 75 | 75 | func (x *AlertDialog) Choose(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 76 | 76 | ||
| 77 | - | xAlertDialogChoose(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 77 | + | var CallbackVarRef uintptr | |
| 78 | + | if CallbackVar != nil { | |
| 79 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 80 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 81 | + | CallbackVarRef = cbRefPtr | |
| 82 | + | } else { | |
| 83 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 84 | + | cbFn := *CallbackVar | |
| 85 | + | cbFn(arg0, arg1, arg2) | |
| 86 | + | } | |
| 87 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 88 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 89 | + | } | |
| 90 | + | } | |
| 91 | + | ||
| 92 | + | xAlertDialogChoose(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 78 | 93 | ||
| 79 | 94 | } | |
| 80 | 95 | ||
| @@ -335,7 +350,7 @@ func (x *AlertDialog) GetPropertyDefaultButton() int { | |||
| 335 | 350 | func (x *AlertDialog) SetPropertyDetail(value string) { | |
| 336 | 351 | var v gobject.Value | |
| 337 | 352 | v.Init(gobject.TypeStringVal) | |
| 338 | - | v.SetString(value) | |
| 353 | + | v.SetString(&value) | |
| 339 | 354 | x.SetProperty("detail", &v) | |
| 340 | 355 | } | |
| 341 | 356 | ||
| @@ -352,7 +367,7 @@ func (x *AlertDialog) GetPropertyDetail() string { | |||
| 352 | 367 | func (x *AlertDialog) SetPropertyMessage(value string) { | |
| 353 | 368 | var v gobject.Value | |
| 354 | 369 | v.Init(gobject.TypeStringVal) | |
| 355 | - | v.SetString(value) | |
| 370 | + | v.SetString(&value) | |
| 356 | 371 | x.SetProperty("message", &v) | |
| 357 | 372 | } | |
| 358 | 373 | ||
M v4/gtk/gtkappchooser.go +1 -1
| @@ -95,7 +95,7 @@ func (x *AppChooserBase) SetPropertyContentType(value string) { | |||
| 95 | 95 | obj.Ptr = x.GoPointer() | |
| 96 | 96 | var v gobject.Value | |
| 97 | 97 | v.Init(gobject.TypeStringVal) | |
| 98 | - | v.SetString(value) | |
| 98 | + | v.SetString(&value) | |
| 99 | 99 | obj.SetProperty("content-type", &v) | |
| 100 | 100 | } | |
| 101 | 101 | ||
M v4/gtk/gtkappchooserbutton.go +24 -1
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | package gtk | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "fmt" | |
| 5 | 6 | "unsafe" | |
| 6 | 7 | ||
| 7 | 8 | "github.com/jwijenbergh/purego" | |
| @@ -216,7 +217,7 @@ func (c *AppChooserButton) SetGoPointer(ptr uintptr) { | |||
| 216 | 217 | func (x *AppChooserButton) SetPropertyHeading(value string) { | |
| 217 | 218 | var v gobject.Value | |
| 218 | 219 | v.Init(gobject.TypeStringVal) | |
| 219 | - | v.SetString(value) | |
| 220 | + | v.SetString(&value) | |
| 220 | 221 | x.SetProperty("heading", &v) | |
| 221 | 222 | } | |
| 222 | 223 | ||
| @@ -352,6 +353,28 @@ func (x *AppChooserButton) ConnectCustomItemActivated(cb *func(AppChooserButton, | |||
| 352 | 353 | return gobject.SignalConnect(x.GoPointer(), "custom-item-activated", cbRefPtr) | |
| 353 | 354 | } | |
| 354 | 355 | ||
| 356 | + | // ConnectCustomItemActivatedWithDetail connects to the "custom-item-activated" signal with a detail string. | |
| 357 | + | // The detail is appended as "custom-item-activated::<detail>". | |
| 358 | + | func (x *AppChooserButton) ConnectCustomItemActivatedWithDetail(detail string, cb *func(AppChooserButton, string)) uint32 { | |
| 359 | + | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 360 | + | signalName := fmt.Sprintf("custom-item-activated::%s", detail) | |
| 361 | + | if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { | |
| 362 | + | return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 363 | + | } | |
| 364 | + | ||
| 365 | + | fcb := func(clsPtr uintptr, ItemNameVarp string) { | |
| 366 | + | fa := AppChooserButton{} | |
| 367 | + | fa.Ptr = clsPtr | |
| 368 | + | cbFn := *cb | |
| 369 | + | ||
| 370 | + | cbFn(fa, ItemNameVarp) | |
| 371 | + | ||
| 372 | + | } | |
| 373 | + | cbRefPtr := purego.NewCallback(fcb) | |
| 374 | + | glib.SaveCallback(cbPtr, cbRefPtr) | |
| 375 | + | return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 376 | + | } | |
| 377 | + | ||
| 355 | 378 | // Requests the user's screen reader to announce the given message. | |
| 356 | 379 | // | |
| 357 | 380 | // This kind of notification is useful for messages that | |
M v4/gtk/gtkappchooserdialog.go +1 -1
| @@ -142,7 +142,7 @@ func (c *AppChooserDialog) SetGoPointer(ptr uintptr) { | |||
| 142 | 142 | func (x *AppChooserDialog) SetPropertyHeading(value string) { | |
| 143 | 143 | var v gobject.Value | |
| 144 | 144 | v.Init(gobject.TypeStringVal) | |
| 145 | - | v.SetString(value) | |
| 145 | + | v.SetString(&value) | |
| 146 | 146 | x.SetProperty("heading", &v) | |
| 147 | 147 | } | |
| 148 | 148 | ||
M v4/gtk/gtkappchooserwidget.go +1 -1
| @@ -206,7 +206,7 @@ func (c *AppChooserWidget) SetGoPointer(ptr uintptr) { | |||
| 206 | 206 | func (x *AppChooserWidget) SetPropertyDefaultText(value string) { | |
| 207 | 207 | var v gobject.Value | |
| 208 | 208 | v.Init(gobject.TypeStringVal) | |
| 209 | - | v.SetString(value) | |
| 209 | + | v.SetString(&value) | |
| 210 | 210 | x.SetProperty("default-text", &v) | |
| 211 | 211 | } | |
| 212 | 212 | ||
M v4/gtk/gtkapplication.go +6 -6
| @@ -199,7 +199,7 @@ func ApplicationNewFromInternalPtr(ptr uintptr) *Application { | |||
| 199 | 199 | return cls | |
| 200 | 200 | } | |
| 201 | 201 | ||
| 202 | - | var xNewApplication func(string, gio.ApplicationFlags) uintptr | |
| 202 | + | var xNewApplication func(uintptr, gio.ApplicationFlags) uintptr | |
| 203 | 203 | ||
| 204 | 204 | // Creates a new application instance. | |
| 205 | 205 | // | |
| @@ -219,10 +219,10 @@ var xNewApplication func(string, gio.ApplicationFlags) uintptr | |||
| 219 | 219 | // | |
| 220 | 220 | // If no application ID is given then some features (most notably application | |
| 221 | 221 | // uniqueness) will be disabled. | |
| 222 | - | func NewApplication(ApplicationIdVar string, FlagsVar gio.ApplicationFlags) *Application { | |
| 222 | + | func NewApplication(ApplicationIdVar *string, FlagsVar gio.ApplicationFlags) *Application { | |
| 223 | 223 | var cls *Application | |
| 224 | 224 | ||
| 225 | - | cret := xNewApplication(ApplicationIdVar, FlagsVar) | |
| 225 | + | cret := xNewApplication(core.NullableStringToPtr(ApplicationIdVar), FlagsVar) | |
| 226 | 226 | ||
| 227 | 227 | if cret == 0 { | |
| 228 | 228 | return nil | |
| @@ -385,7 +385,7 @@ func (x *Application) GetWindows() *glib.List { | |||
| 385 | 385 | return cret | |
| 386 | 386 | } | |
| 387 | 387 | ||
| 388 | - | var xApplicationInhibit func(uintptr, uintptr, ApplicationInhibitFlags, string) uint | |
| 388 | + | var xApplicationInhibit func(uintptr, uintptr, ApplicationInhibitFlags, uintptr) uint | |
| 389 | 389 | ||
| 390 | 390 | // Informs the session manager that certain types of actions should be | |
| 391 | 391 | // inhibited. | |
| @@ -414,9 +414,9 @@ var xApplicationInhibit func(uintptr, uintptr, ApplicationInhibitFlags, string) | |||
| 414 | 414 | // The cookie that is returned by this function should be used as an | |
| 415 | 415 | // argument to [method@Gtk.Application.uninhibit] in order to remove | |
| 416 | 416 | // the request. | |
| 417 | - | func (x *Application) Inhibit(WindowVar *Window, FlagsVar ApplicationInhibitFlags, ReasonVar string) uint { | |
| 417 | + | func (x *Application) Inhibit(WindowVar *Window, FlagsVar ApplicationInhibitFlags, ReasonVar *string) uint { | |
| 418 | 418 | ||
| 419 | - | cret := xApplicationInhibit(x.GoPointer(), WindowVar.GoPointer(), FlagsVar, ReasonVar) | |
| 419 | + | cret := xApplicationInhibit(x.GoPointer(), WindowVar.GoPointer(), FlagsVar, core.NullableStringToPtr(ReasonVar)) | |
| 420 | 420 | return cret | |
| 421 | 421 | } | |
| 422 | 422 | ||
M v4/gtk/gtkassistant.go +32 -2
| @@ -360,7 +360,37 @@ var xAssistantSetForwardPageFunc func(uintptr, uintptr, uintptr, uintptr) | |||
| 360 | 360 | // next visible page. | |
| 361 | 361 | func (x *Assistant) SetForwardPageFunc(PageFuncVar *AssistantPageFunc, DataVar uintptr, DestroyVar *glib.DestroyNotify) { | |
| 362 | 362 | ||
| 363 | - | xAssistantSetForwardPageFunc(x.GoPointer(), glib.NewCallbackNullable(PageFuncVar), DataVar, glib.NewCallback(DestroyVar)) | |
| 363 | + | var PageFuncVarRef uintptr | |
| 364 | + | if PageFuncVar != nil { | |
| 365 | + | PageFuncVarPtr := uintptr(unsafe.Pointer(PageFuncVar)) | |
| 366 | + | if cbRefPtr, ok := glib.GetCallback(PageFuncVarPtr); ok { | |
| 367 | + | PageFuncVarRef = cbRefPtr | |
| 368 | + | } else { | |
| 369 | + | fcb := func(arg0 int, arg1 uintptr) int { | |
| 370 | + | cbFn := *PageFuncVar | |
| 371 | + | return cbFn(arg0, arg1) | |
| 372 | + | } | |
| 373 | + | PageFuncVarRef = purego.NewCallback(fcb) | |
| 374 | + | glib.SaveCallback(PageFuncVarPtr, PageFuncVarRef) | |
| 375 | + | } | |
| 376 | + | } | |
| 377 | + | ||
| 378 | + | var DestroyVarRef uintptr | |
| 379 | + | if DestroyVar != nil { | |
| 380 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 381 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 382 | + | DestroyVarRef = cbRefPtr | |
| 383 | + | } else { | |
| 384 | + | fcb := func(arg0 uintptr) { | |
| 385 | + | cbFn := *DestroyVar | |
| 386 | + | cbFn(arg0) | |
| 387 | + | } | |
| 388 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 389 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 390 | + | } | |
| 391 | + | } | |
| 392 | + | ||
| 393 | + | xAssistantSetForwardPageFunc(x.GoPointer(), PageFuncVarRef, DataVar, DestroyVarRef) | |
| 364 | 394 | ||
| 365 | 395 | } | |
| 366 | 396 | ||
| @@ -1026,7 +1056,7 @@ func (x *AssistantPage) GetPropertyComplete() bool { | |||
| 1026 | 1056 | func (x *AssistantPage) SetPropertyTitle(value string) { | |
| 1027 | 1057 | var v gobject.Value | |
| 1028 | 1058 | v.Init(gobject.TypeStringVal) | |
| 1029 | - | v.SetString(value) | |
| 1059 | + | v.SetString(&value) | |
| 1030 | 1060 | x.SetProperty("title", &v) | |
| 1031 | 1061 | } | |
| 1032 | 1062 | ||
M v4/gtk/gtkbookmarklist.go +8 -8
| @@ -46,13 +46,13 @@ func BookmarkListNewFromInternalPtr(ptr uintptr) *BookmarkList { | |||
| 46 | 46 | return cls | |
| 47 | 47 | } | |
| 48 | 48 | ||
| 49 | - | var xNewBookmarkList func(string, string) uintptr | |
| 49 | + | var xNewBookmarkList func(uintptr, uintptr) uintptr | |
| 50 | 50 | ||
| 51 | 51 | // Creates a new `GtkBookmarkList` with the given @attributes. | |
| 52 | - | func NewBookmarkList(FilenameVar string, AttributesVar string) *BookmarkList { | |
| 52 | + | func NewBookmarkList(FilenameVar *string, AttributesVar *string) *BookmarkList { | |
| 53 | 53 | var cls *BookmarkList | |
| 54 | 54 | ||
| 55 | - | cret := xNewBookmarkList(FilenameVar, AttributesVar) | |
| 55 | + | cret := xNewBookmarkList(core.NullableStringToPtr(FilenameVar), core.NullableStringToPtr(AttributesVar)) | |
| 56 | 56 | ||
| 57 | 57 | if cret == 0 { | |
| 58 | 58 | return nil | |
| @@ -103,15 +103,15 @@ func (x *BookmarkList) IsLoading() bool { | |||
| 103 | 103 | return cret | |
| 104 | 104 | } | |
| 105 | 105 | ||
| 106 | - | var xBookmarkListSetAttributes func(uintptr, string) | |
| 106 | + | var xBookmarkListSetAttributes func(uintptr, uintptr) | |
| 107 | 107 | ||
| 108 | 108 | // Sets the @attributes to be enumerated and starts the enumeration. | |
| 109 | 109 | // | |
| 110 | 110 | // If @attributes is %NULL, no attributes will be queried, but a list | |
| 111 | 111 | // of `GFileInfo`s will still be created. | |
| 112 | - | func (x *BookmarkList) SetAttributes(AttributesVar string) { | |
| 112 | + | func (x *BookmarkList) SetAttributes(AttributesVar *string) { | |
| 113 | 113 | ||
| 114 | - | xBookmarkListSetAttributes(x.GoPointer(), AttributesVar) | |
| 114 | + | xBookmarkListSetAttributes(x.GoPointer(), core.NullableStringToPtr(AttributesVar)) | |
| 115 | 115 | ||
| 116 | 116 | } | |
| 117 | 117 | ||
| @@ -142,7 +142,7 @@ func (c *BookmarkList) SetGoPointer(ptr uintptr) { | |||
| 142 | 142 | func (x *BookmarkList) SetPropertyAttributes(value string) { | |
| 143 | 143 | var v gobject.Value | |
| 144 | 144 | v.Init(gobject.TypeStringVal) | |
| 145 | - | v.SetString(value) | |
| 145 | + | v.SetString(&value) | |
| 146 | 146 | x.SetProperty("attributes", &v) | |
| 147 | 147 | } | |
| 148 | 148 | ||
| @@ -159,7 +159,7 @@ func (x *BookmarkList) GetPropertyAttributes() string { | |||
| 159 | 159 | func (x *BookmarkList) SetPropertyFilename(value string) { | |
| 160 | 160 | var v gobject.Value | |
| 161 | 161 | v.Init(gobject.TypeStringVal) | |
| 162 | - | v.SetString(value) | |
| 162 | + | v.SetString(&value) | |
| 163 | 163 | x.SetProperty("filename", &v) | |
| 164 | 164 | } | |
| 165 | 165 | ||
M v4/gtk/gtkbuilder.go +4 -4
| @@ -888,12 +888,12 @@ func (x *Builder) SetScope(ScopeVar BuilderScope) { | |||
| 888 | 888 | ||
| 889 | 889 | } | |
| 890 | 890 | ||
| 891 | - | var xBuilderSetTranslationDomain func(uintptr, string) | |
| 891 | + | var xBuilderSetTranslationDomain func(uintptr, uintptr) | |
| 892 | 892 | ||
| 893 | 893 | // Sets the translation domain of @builder. | |
| 894 | - | func (x *Builder) SetTranslationDomain(DomainVar string) { | |
| 894 | + | func (x *Builder) SetTranslationDomain(DomainVar *string) { | |
| 895 | 895 | ||
| 896 | - | xBuilderSetTranslationDomain(x.GoPointer(), DomainVar) | |
| 896 | + | xBuilderSetTranslationDomain(x.GoPointer(), core.NullableStringToPtr(DomainVar)) | |
| 897 | 897 | ||
| 898 | 898 | } | |
| 899 | 899 | ||
| @@ -964,7 +964,7 @@ func (c *Builder) SetGoPointer(ptr uintptr) { | |||
| 964 | 964 | func (x *Builder) SetPropertyTranslationDomain(value string) { | |
| 965 | 965 | var v gobject.Value | |
| 966 | 966 | v.Init(gobject.TypeStringVal) | |
| 967 | - | v.SetString(value) | |
| 967 | + | v.SetString(&value) | |
| 968 | 968 | x.SetProperty("translation-domain", &v) | |
| 969 | 969 | } | |
| 970 | 970 | ||
M v4/gtk/gtkbuilderlistitemfactory.go +1 -1
| @@ -172,7 +172,7 @@ func (x *BuilderListItemFactory) GetPropertyBytes() uintptr { | |||
| 172 | 172 | func (x *BuilderListItemFactory) SetPropertyResource(value string) { | |
| 173 | 173 | var v gobject.Value | |
| 174 | 174 | v.Init(gobject.TypeStringVal) | |
| 175 | - | v.SetString(value) | |
| 175 | + | v.SetString(&value) | |
| 176 | 176 | x.SetProperty("resource", &v) | |
| 177 | 177 | } | |
| 178 | 178 | ||
M v4/gtk/gtkbuilderscope.go +32 -2
| @@ -274,7 +274,22 @@ var xBuilderCScopeAddCallbackSymbol func(uintptr, string, uintptr) | |||
| 274 | 274 | // namespace. | |
| 275 | 275 | func (x *BuilderCScope) AddCallbackSymbol(CallbackNameVar string, CallbackSymbolVar *gobject.Callback) { | |
| 276 | 276 | ||
| 277 | - | xBuilderCScopeAddCallbackSymbol(x.GoPointer(), CallbackNameVar, glib.NewCallback(CallbackSymbolVar)) | |
| 277 | + | var CallbackSymbolVarRef uintptr | |
| 278 | + | if CallbackSymbolVar != nil { | |
| 279 | + | CallbackSymbolVarPtr := uintptr(unsafe.Pointer(CallbackSymbolVar)) | |
| 280 | + | if cbRefPtr, ok := glib.GetCallback(CallbackSymbolVarPtr); ok { | |
| 281 | + | CallbackSymbolVarRef = cbRefPtr | |
| 282 | + | } else { | |
| 283 | + | fcb := func() { | |
| 284 | + | cbFn := *CallbackSymbolVar | |
| 285 | + | cbFn() | |
| 286 | + | } | |
| 287 | + | CallbackSymbolVarRef = purego.NewCallback(fcb) | |
| 288 | + | glib.SaveCallback(CallbackSymbolVarPtr, CallbackSymbolVarRef) | |
| 289 | + | } | |
| 290 | + | } | |
| 291 | + | ||
| 292 | + | xBuilderCScopeAddCallbackSymbol(x.GoPointer(), CallbackNameVar, CallbackSymbolVarRef) | |
| 278 | 293 | ||
| 279 | 294 | } | |
| 280 | 295 | ||
| @@ -286,7 +301,22 @@ var xBuilderCScopeAddCallbackSymbols func(uintptr, string, uintptr, ...interface | |||
| 286 | 301 | // for each symbol. | |
| 287 | 302 | func (x *BuilderCScope) AddCallbackSymbols(FirstCallbackNameVar string, FirstCallbackSymbolVar *gobject.Callback, varArgs ...interface{}) { | |
| 288 | 303 | ||
| 289 | - | xBuilderCScopeAddCallbackSymbols(x.GoPointer(), FirstCallbackNameVar, glib.NewCallback(FirstCallbackSymbolVar), varArgs...) | |
| 304 | + | var FirstCallbackSymbolVarRef uintptr | |
| 305 | + | if FirstCallbackSymbolVar != nil { | |
| 306 | + | FirstCallbackSymbolVarPtr := uintptr(unsafe.Pointer(FirstCallbackSymbolVar)) | |
| 307 | + | if cbRefPtr, ok := glib.GetCallback(FirstCallbackSymbolVarPtr); ok { | |
| 308 | + | FirstCallbackSymbolVarRef = cbRefPtr | |
| 309 | + | } else { | |
| 310 | + | fcb := func() { | |
| 311 | + | cbFn := *FirstCallbackSymbolVar | |
| 312 | + | cbFn() | |
| 313 | + | } | |
| 314 | + | FirstCallbackSymbolVarRef = purego.NewCallback(fcb) | |
| 315 | + | glib.SaveCallback(FirstCallbackSymbolVarPtr, FirstCallbackSymbolVarRef) | |
| 316 | + | } | |
| 317 | + | } | |
| 318 | + | ||
| 319 | + | xBuilderCScopeAddCallbackSymbols(x.GoPointer(), FirstCallbackNameVar, FirstCallbackSymbolVarRef, varArgs...) | |
| 290 | 320 | ||
| 291 | 321 | } | |
| 292 | 322 | ||
M v4/gtk/gtkbutton.go +4 -4
| @@ -438,7 +438,7 @@ func (x *Button) GetPropertyHasFrame() bool { | |||
| 438 | 438 | func (x *Button) SetPropertyIconName(value string) { | |
| 439 | 439 | var v gobject.Value | |
| 440 | 440 | v.Init(gobject.TypeStringVal) | |
| 441 | - | v.SetString(value) | |
| 441 | + | v.SetString(&value) | |
| 442 | 442 | x.SetProperty("icon-name", &v) | |
| 443 | 443 | } | |
| 444 | 444 | ||
| @@ -455,7 +455,7 @@ func (x *Button) GetPropertyIconName() string { | |||
| 455 | 455 | func (x *Button) SetPropertyLabel(value string) { | |
| 456 | 456 | var v gobject.Value | |
| 457 | 457 | v.Init(gobject.TypeStringVal) | |
| 458 | - | v.SetString(value) | |
| 458 | + | v.SetString(&value) | |
| 459 | 459 | x.SetProperty("label", &v) | |
| 460 | 460 | } | |
| 461 | 461 | ||
| @@ -827,9 +827,9 @@ func (x *Button) GetActionTargetValue() *glib.Variant { | |||
| 827 | 827 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 828 | 828 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 829 | 829 | // associated with the window. | |
| 830 | - | func (x *Button) SetActionName(ActionNameVar string) { | |
| 830 | + | func (x *Button) SetActionName(ActionNameVar *string) { | |
| 831 | 831 | ||
| 832 | - | XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 832 | + | XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 833 | 833 | ||
| 834 | 834 | } | |
| 835 | 835 | ||
M v4/gtk/gtkcellarea.go +32 -2
| @@ -1299,7 +1299,22 @@ var xCellAreaForeach func(uintptr, uintptr, uintptr) | |||
| 1299 | 1299 | // Calls @callback for every `GtkCellRenderer` in @area. | |
| 1300 | 1300 | func (x *CellArea) Foreach(CallbackVar *CellCallback, CallbackDataVar uintptr) { | |
| 1301 | 1301 | ||
| 1302 | - | xCellAreaForeach(x.GoPointer(), glib.NewCallback(CallbackVar), CallbackDataVar) | |
| 1302 | + | var CallbackVarRef uintptr | |
| 1303 | + | if CallbackVar != nil { | |
| 1304 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1305 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1306 | + | CallbackVarRef = cbRefPtr | |
| 1307 | + | } else { | |
| 1308 | + | fcb := func(arg0 uintptr, arg1 uintptr) bool { | |
| 1309 | + | cbFn := *CallbackVar | |
| 1310 | + | return cbFn(arg0, arg1) | |
| 1311 | + | } | |
| 1312 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1313 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1314 | + | } | |
| 1315 | + | } | |
| 1316 | + | ||
| 1317 | + | xCellAreaForeach(x.GoPointer(), CallbackVarRef, CallbackDataVar) | |
| 1303 | 1318 | ||
| 1304 | 1319 | } | |
| 1305 | 1320 | ||
| @@ -1309,7 +1324,22 @@ var xCellAreaForeachAlloc func(uintptr, uintptr, uintptr, *gdk.Rectangle, *gdk.R | |||
| 1309 | 1324 | // allocated rectangle inside @cell_area. | |
| 1310 | 1325 | func (x *CellArea) ForeachAlloc(ContextVar *CellAreaContext, WidgetVar *Widget, CellAreaVar *gdk.Rectangle, BackgroundAreaVar *gdk.Rectangle, CallbackVar *CellAllocCallback, CallbackDataVar uintptr) { | |
| 1311 | 1326 | ||
| 1312 | - | xCellAreaForeachAlloc(x.GoPointer(), ContextVar.GoPointer(), WidgetVar.GoPointer(), CellAreaVar, BackgroundAreaVar, glib.NewCallback(CallbackVar), CallbackDataVar) | |
| 1327 | + | var CallbackVarRef uintptr | |
| 1328 | + | if CallbackVar != nil { | |
| 1329 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 1330 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 1331 | + | CallbackVarRef = cbRefPtr | |
| 1332 | + | } else { | |
| 1333 | + | fcb := func(arg0 uintptr, arg1 *gdk.Rectangle, arg2 *gdk.Rectangle, arg3 uintptr) bool { | |
| 1334 | + | cbFn := *CallbackVar | |
| 1335 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 1336 | + | } | |
| 1337 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 1338 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 1339 | + | } | |
| 1340 | + | } | |
| 1341 | + | ||
| 1342 | + | xCellAreaForeachAlloc(x.GoPointer(), ContextVar.GoPointer(), WidgetVar.GoPointer(), CellAreaVar, BackgroundAreaVar, CallbackVarRef, CallbackDataVar) | |
| 1313 | 1343 | ||
| 1314 | 1344 | } | |
| 1315 | 1345 | ||
M v4/gtk/gtkcellrenderer.go +1 -1
| @@ -743,7 +743,7 @@ func (c *CellRenderer) SetGoPointer(ptr uintptr) { | |||
| 743 | 743 | func (x *CellRenderer) SetPropertyCellBackground(value string) { | |
| 744 | 744 | var v gobject.Value | |
| 745 | 745 | v.Init(gobject.TypeStringVal) | |
| 746 | - | v.SetString(value) | |
| 746 | + | v.SetString(&value) | |
| 747 | 747 | x.SetProperty("cell-background", &v) | |
| 748 | 748 | } | |
| 749 | 749 | ||
M v4/gtk/gtkcellrendererpixbuf.go +1 -1
| @@ -78,7 +78,7 @@ func (c *CellRendererPixbuf) SetGoPointer(ptr uintptr) { | |||
| 78 | 78 | func (x *CellRendererPixbuf) SetPropertyIconName(value string) { | |
| 79 | 79 | var v gobject.Value | |
| 80 | 80 | v.Init(gobject.TypeStringVal) | |
| 81 | - | v.SetString(value) | |
| 81 | + | v.SetString(&value) | |
| 82 | 82 | x.SetProperty("icon-name", &v) | |
| 83 | 83 | } | |
| 84 | 84 | ||
M v4/gtk/gtkcellrendererprogress.go +1 -1
| @@ -116,7 +116,7 @@ func (x *CellRendererProgress) GetPropertyPulse() int { | |||
| 116 | 116 | func (x *CellRendererProgress) SetPropertyText(value string) { | |
| 117 | 117 | var v gobject.Value | |
| 118 | 118 | v.Init(gobject.TypeStringVal) | |
| 119 | - | v.SetString(value) | |
| 119 | + | v.SetString(&value) | |
| 120 | 120 | x.SetProperty("text", &v) | |
| 121 | 121 | } | |
| 122 | 122 | ||
M v4/gtk/gtkcellrenderertext.go +8 -8
| @@ -156,7 +156,7 @@ func (x *CellRendererText) GetPropertyAttributes() uintptr { | |||
| 156 | 156 | func (x *CellRendererText) SetPropertyBackground(value string) { | |
| 157 | 157 | var v gobject.Value | |
| 158 | 158 | v.Init(gobject.TypeStringVal) | |
| 159 | - | v.SetString(value) | |
| 159 | + | v.SetString(&value) | |
| 160 | 160 | x.SetProperty("background", &v) | |
| 161 | 161 | } | |
| 162 | 162 | ||
| @@ -241,7 +241,7 @@ func (x *CellRendererText) GetPropertyEllipsizeSet() bool { | |||
| 241 | 241 | func (x *CellRendererText) SetPropertyFamily(value string) { | |
| 242 | 242 | var v gobject.Value | |
| 243 | 243 | v.Init(gobject.TypeStringVal) | |
| 244 | - | v.SetString(value) | |
| 244 | + | v.SetString(&value) | |
| 245 | 245 | x.SetProperty("family", &v) | |
| 246 | 246 | } | |
| 247 | 247 | ||
| @@ -271,7 +271,7 @@ func (x *CellRendererText) GetPropertyFamilySet() bool { | |||
| 271 | 271 | func (x *CellRendererText) SetPropertyFont(value string) { | |
| 272 | 272 | var v gobject.Value | |
| 273 | 273 | v.Init(gobject.TypeStringVal) | |
| 274 | - | v.SetString(value) | |
| 274 | + | v.SetString(&value) | |
| 275 | 275 | x.SetProperty("font", &v) | |
| 276 | 276 | } | |
| 277 | 277 | ||
| @@ -301,7 +301,7 @@ func (x *CellRendererText) GetPropertyFontDesc() uintptr { | |||
| 301 | 301 | func (x *CellRendererText) SetPropertyForeground(value string) { | |
| 302 | 302 | var v gobject.Value | |
| 303 | 303 | v.Init(gobject.TypeStringVal) | |
| 304 | - | v.SetString(value) | |
| 304 | + | v.SetString(&value) | |
| 305 | 305 | x.SetProperty("foreground", &v) | |
| 306 | 306 | } | |
| 307 | 307 | ||
| @@ -341,7 +341,7 @@ func (x *CellRendererText) GetPropertyForegroundSet() bool { | |||
| 341 | 341 | func (x *CellRendererText) SetPropertyLanguage(value string) { | |
| 342 | 342 | var v gobject.Value | |
| 343 | 343 | v.Init(gobject.TypeStringVal) | |
| 344 | - | v.SetString(value) | |
| 344 | + | v.SetString(&value) | |
| 345 | 345 | x.SetProperty("language", &v) | |
| 346 | 346 | } | |
| 347 | 347 | ||
| @@ -371,7 +371,7 @@ func (x *CellRendererText) GetPropertyLanguageSet() bool { | |||
| 371 | 371 | func (x *CellRendererText) SetPropertyMarkup(value string) { | |
| 372 | 372 | var v gobject.Value | |
| 373 | 373 | v.Init(gobject.TypeStringVal) | |
| 374 | - | v.SetString(value) | |
| 374 | + | v.SetString(&value) | |
| 375 | 375 | x.SetProperty("markup", &v) | |
| 376 | 376 | } | |
| 377 | 377 | ||
| @@ -412,7 +412,7 @@ func (x *CellRendererText) GetPropertyMaxWidthChars() int { | |||
| 412 | 412 | func (x *CellRendererText) SetPropertyPlaceholderText(value string) { | |
| 413 | 413 | var v gobject.Value | |
| 414 | 414 | v.Init(gobject.TypeStringVal) | |
| 415 | - | v.SetString(value) | |
| 415 | + | v.SetString(&value) | |
| 416 | 416 | x.SetProperty("placeholder-text", &v) | |
| 417 | 417 | } | |
| 418 | 418 | ||
| @@ -609,7 +609,7 @@ func (x *CellRendererText) GetPropertyStyleSet() bool { | |||
| 609 | 609 | func (x *CellRendererText) SetPropertyText(value string) { | |
| 610 | 610 | var v gobject.Value | |
| 611 | 611 | v.Init(gobject.TypeStringVal) | |
| 612 | - | v.SetString(value) | |
| 612 | + | v.SetString(&value) | |
| 613 | 613 | x.SetProperty("text", &v) | |
| 614 | 614 | } | |
| 615 | 615 | ||
M v4/gtk/gtkcheckbutton.go +12 -12
| @@ -180,13 +180,13 @@ func NewCheckButton() *CheckButton { | |||
| 180 | 180 | return cls | |
| 181 | 181 | } | |
| 182 | 182 | ||
| 183 | - | var xNewCheckButtonWithLabel func(string) uintptr | |
| 183 | + | var xNewCheckButtonWithLabel func(uintptr) uintptr | |
| 184 | 184 | ||
| 185 | 185 | // Creates a new `GtkCheckButton` with the given text. | |
| 186 | - | func NewCheckButtonWithLabel(LabelVar string) *CheckButton { | |
| 186 | + | func NewCheckButtonWithLabel(LabelVar *string) *CheckButton { | |
| 187 | 187 | var cls *CheckButton | |
| 188 | 188 | ||
| 189 | - | cret := xNewCheckButtonWithLabel(LabelVar) | |
| 189 | + | cret := xNewCheckButtonWithLabel(core.NullableStringToPtr(LabelVar)) | |
| 190 | 190 | ||
| 191 | 191 | if cret == 0 { | |
| 192 | 192 | return nil | |
| @@ -197,13 +197,13 @@ func NewCheckButtonWithLabel(LabelVar string) *CheckButton { | |||
| 197 | 197 | return cls | |
| 198 | 198 | } | |
| 199 | 199 | ||
| 200 | - | var xNewCheckButtonWithMnemonic func(string) uintptr | |
| 200 | + | var xNewCheckButtonWithMnemonic func(uintptr) uintptr | |
| 201 | 201 | ||
| 202 | 202 | // Creates a new `GtkCheckButton` with the given text and a mnemonic. | |
| 203 | - | func NewCheckButtonWithMnemonic(LabelVar string) *CheckButton { | |
| 203 | + | func NewCheckButtonWithMnemonic(LabelVar *string) *CheckButton { | |
| 204 | 204 | var cls *CheckButton | |
| 205 | 205 | ||
| 206 | - | cret := xNewCheckButtonWithMnemonic(LabelVar) | |
| 206 | + | cret := xNewCheckButtonWithMnemonic(core.NullableStringToPtr(LabelVar)) | |
| 207 | 207 | ||
| 208 | 208 | if cret == 0 { | |
| 209 | 209 | return nil | |
| @@ -326,16 +326,16 @@ func (x *CheckButton) SetInconsistent(InconsistentVar bool) { | |||
| 326 | 326 | ||
| 327 | 327 | } | |
| 328 | 328 | ||
| 329 | - | var xCheckButtonSetLabel func(uintptr, string) | |
| 329 | + | var xCheckButtonSetLabel func(uintptr, uintptr) | |
| 330 | 330 | ||
| 331 | 331 | // Sets the text of @self. | |
| 332 | 332 | // | |
| 333 | 333 | // If [property@Gtk.CheckButton:use-underline] is %TRUE, an underscore | |
| 334 | 334 | // in @label is interpreted as mnemonic indicator, see | |
| 335 | 335 | // [method@Gtk.CheckButton.set_use_underline] for details on this behavior. | |
| 336 | - | func (x *CheckButton) SetLabel(LabelVar string) { | |
| 336 | + | func (x *CheckButton) SetLabel(LabelVar *string) { | |
| 337 | 337 | ||
| 338 | - | xCheckButtonSetLabel(x.GoPointer(), LabelVar) | |
| 338 | + | xCheckButtonSetLabel(x.GoPointer(), core.NullableStringToPtr(LabelVar)) | |
| 339 | 339 | ||
| 340 | 340 | } | |
| 341 | 341 | ||
| @@ -414,7 +414,7 @@ func (x *CheckButton) GetPropertyInconsistent() bool { | |||
| 414 | 414 | func (x *CheckButton) SetPropertyLabel(value string) { | |
| 415 | 415 | var v gobject.Value | |
| 416 | 416 | v.Init(gobject.TypeStringVal) | |
| 417 | - | v.SetString(value) | |
| 417 | + | v.SetString(&value) | |
| 418 | 418 | x.SetProperty("label", &v) | |
| 419 | 419 | } | |
| 420 | 420 | ||
| @@ -790,9 +790,9 @@ func (x *CheckButton) GetActionTargetValue() *glib.Variant { | |||
| 790 | 790 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 791 | 791 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 792 | 792 | // associated with the window. | |
| 793 | - | func (x *CheckButton) SetActionName(ActionNameVar string) { | |
| 793 | + | func (x *CheckButton) SetActionName(ActionNameVar *string) { | |
| 794 | 794 | ||
| 795 | - | XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 795 | + | XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 796 | 796 | ||
| 797 | 797 | } | |
| 798 | 798 | ||
M v4/gtk/gtkcolorbutton.go +1 -1
| @@ -187,7 +187,7 @@ func (x *ColorButton) GetPropertyShowEditor() bool { | |||
| 187 | 187 | func (x *ColorButton) SetPropertyTitle(value string) { | |
| 188 | 188 | var v gobject.Value | |
| 189 | 189 | v.Init(gobject.TypeStringVal) | |
| 190 | - | v.SetString(value) | |
| 190 | + | v.SetString(&value) | |
| 191 | 191 | x.SetProperty("title", &v) | |
| 192 | 192 | } | |
| 193 | 193 | ||
M v4/gtk/gtkcolorchooserdialog.go +3 -3
| @@ -50,13 +50,13 @@ func ColorChooserDialogNewFromInternalPtr(ptr uintptr) *ColorChooserDialog { | |||
| 50 | 50 | return cls | |
| 51 | 51 | } | |
| 52 | 52 | ||
| 53 | - | var xNewColorChooserDialog func(string, uintptr) uintptr | |
| 53 | + | var xNewColorChooserDialog func(uintptr, uintptr) uintptr | |
| 54 | 54 | ||
| 55 | 55 | // Creates a new `GtkColorChooserDialog`. | |
| 56 | - | func NewColorChooserDialog(TitleVar string, ParentVar *Window) *ColorChooserDialog { | |
| 56 | + | func NewColorChooserDialog(TitleVar *string, ParentVar *Window) *ColorChooserDialog { | |
| 57 | 57 | var cls *ColorChooserDialog | |
| 58 | 58 | ||
| 59 | - | cret := xNewColorChooserDialog(TitleVar, ParentVar.GoPointer()) | |
| 59 | + | cret := xNewColorChooserDialog(core.NullableStringToPtr(TitleVar), ParentVar.GoPointer()) | |
| 60 | 60 | ||
| 61 | 61 | if cret == 0 { | |
| 62 | 62 | return nil | |
M v4/gtk/gtkcolordialog.go +17 -2
| @@ -72,7 +72,22 @@ var xColorDialogChooseRgba func(uintptr, uintptr, *gdk.RGBA, uintptr, uintptr, u | |||
| 72 | 72 | // Presents a color chooser dialog to the user. | |
| 73 | 73 | func (x *ColorDialog) ChooseRgba(ParentVar *Window, InitialColorVar *gdk.RGBA, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 74 | 74 | ||
| 75 | - | xColorDialogChooseRgba(x.GoPointer(), ParentVar.GoPointer(), InitialColorVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 75 | + | var CallbackVarRef uintptr | |
| 76 | + | if CallbackVar != nil { | |
| 77 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 78 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 79 | + | CallbackVarRef = cbRefPtr | |
| 80 | + | } else { | |
| 81 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 82 | + | cbFn := *CallbackVar | |
| 83 | + | cbFn(arg0, arg1, arg2) | |
| 84 | + | } | |
| 85 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 86 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 87 | + | } | |
| 88 | + | } | |
| 89 | + | ||
| 90 | + | xColorDialogChooseRgba(x.GoPointer(), ParentVar.GoPointer(), InitialColorVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 76 | 91 | ||
| 77 | 92 | } | |
| 78 | 93 | ||
| @@ -186,7 +201,7 @@ func (x *ColorDialog) GetPropertyModal() bool { | |||
| 186 | 201 | func (x *ColorDialog) SetPropertyTitle(value string) { | |
| 187 | 202 | var v gobject.Value | |
| 188 | 203 | v.Init(gobject.TypeStringVal) | |
| 189 | - | v.SetString(value) | |
| 204 | + | v.SetString(&value) | |
| 190 | 205 | x.SetProperty("title", &v) | |
| 191 | 206 | } | |
| 192 | 207 | ||
M v4/gtk/gtkcolumnviewcolumn.go +11 -11
| @@ -48,7 +48,7 @@ func ColumnViewColumnNewFromInternalPtr(ptr uintptr) *ColumnViewColumn { | |||
| 48 | 48 | return cls | |
| 49 | 49 | } | |
| 50 | 50 | ||
| 51 | - | var xNewColumnViewColumn func(string, uintptr) uintptr | |
| 51 | + | var xNewColumnViewColumn func(uintptr, uintptr) uintptr | |
| 52 | 52 | ||
| 53 | 53 | // Creates a new `GtkColumnViewColumn` that uses the given @factory for | |
| 54 | 54 | // mapping items to widgets. | |
| @@ -63,10 +63,10 @@ var xNewColumnViewColumn func(string, uintptr) uintptr | |||
| 63 | 63 | // gtk_builder_list_item_factory_new_from_resource ("/name.ui")); | |
| 64 | 64 | // | |
| 65 | 65 | // ``` | |
| 66 | - | func NewColumnViewColumn(TitleVar string, FactoryVar *ListItemFactory) *ColumnViewColumn { | |
| 66 | + | func NewColumnViewColumn(TitleVar *string, FactoryVar *ListItemFactory) *ColumnViewColumn { | |
| 67 | 67 | var cls *ColumnViewColumn | |
| 68 | 68 | ||
| 69 | - | cret := xNewColumnViewColumn(TitleVar, FactoryVar.GoPointer()) | |
| 69 | + | cret := xNewColumnViewColumn(core.NullableStringToPtr(TitleVar), FactoryVar.GoPointer()) | |
| 70 | 70 | ||
| 71 | 71 | if cret == 0 { | |
| 72 | 72 | return nil | |
| @@ -248,7 +248,7 @@ func (x *ColumnViewColumn) SetHeaderMenu(MenuVar *gio.MenuModel) { | |||
| 248 | 248 | ||
| 249 | 249 | } | |
| 250 | 250 | ||
| 251 | - | var xColumnViewColumnSetId func(uintptr, string) | |
| 251 | + | var xColumnViewColumnSetId func(uintptr, uintptr) | |
| 252 | 252 | ||
| 253 | 253 | // Sets the id of this column. | |
| 254 | 254 | // | |
| @@ -256,9 +256,9 @@ var xColumnViewColumnSetId func(uintptr, string) | |||
| 256 | 256 | // storing column view configuration. | |
| 257 | 257 | // | |
| 258 | 258 | // It is up to callers to ensure uniqueness of IDs. | |
| 259 | - | func (x *ColumnViewColumn) SetId(IdVar string) { | |
| 259 | + | func (x *ColumnViewColumn) SetId(IdVar *string) { | |
| 260 | 260 | ||
| 261 | - | xColumnViewColumnSetId(x.GoPointer(), IdVar) | |
| 261 | + | xColumnViewColumnSetId(x.GoPointer(), core.NullableStringToPtr(IdVar)) | |
| 262 | 262 | ||
| 263 | 263 | } | |
| 264 | 264 | ||
| @@ -289,16 +289,16 @@ func (x *ColumnViewColumn) SetSorter(SorterVar *Sorter) { | |||
| 289 | 289 | ||
| 290 | 290 | } | |
| 291 | 291 | ||
| 292 | - | var xColumnViewColumnSetTitle func(uintptr, string) | |
| 292 | + | var xColumnViewColumnSetTitle func(uintptr, uintptr) | |
| 293 | 293 | ||
| 294 | 294 | // Sets the title of this column. | |
| 295 | 295 | // | |
| 296 | 296 | // The title is displayed in the header of a `GtkColumnView` | |
| 297 | 297 | // for this column and is therefore user-facing text that should | |
| 298 | 298 | // be translated. | |
| 299 | - | func (x *ColumnViewColumn) SetTitle(TitleVar string) { | |
| 299 | + | func (x *ColumnViewColumn) SetTitle(TitleVar *string) { | |
| 300 | 300 | ||
| 301 | - | xColumnViewColumnSetTitle(x.GoPointer(), TitleVar) | |
| 301 | + | xColumnViewColumnSetTitle(x.GoPointer(), core.NullableStringToPtr(TitleVar)) | |
| 302 | 302 | ||
| 303 | 303 | } | |
| 304 | 304 | ||
| @@ -369,7 +369,7 @@ func (x *ColumnViewColumn) GetPropertyFixedWidth() int { | |||
| 369 | 369 | func (x *ColumnViewColumn) SetPropertyId(value string) { | |
| 370 | 370 | var v gobject.Value | |
| 371 | 371 | v.Init(gobject.TypeStringVal) | |
| 372 | - | v.SetString(value) | |
| 372 | + | v.SetString(&value) | |
| 373 | 373 | x.SetProperty("id", &v) | |
| 374 | 374 | } | |
| 375 | 375 | ||
| @@ -409,7 +409,7 @@ func (x *ColumnViewColumn) GetPropertyResizable() bool { | |||
| 409 | 409 | func (x *ColumnViewColumn) SetPropertyTitle(value string) { | |
| 410 | 410 | var v gobject.Value | |
| 411 | 411 | v.Init(gobject.TypeStringVal) | |
| 412 | - | v.SetString(value) | |
| 412 | + | v.SetString(&value) | |
| 413 | 413 | x.SetProperty("title", &v) | |
| 414 | 414 | } | |
| 415 | 415 | ||
M v4/gtk/gtkcolumnviewrow.go +2 -2
| @@ -219,7 +219,7 @@ func (c *ColumnViewRow) SetGoPointer(ptr uintptr) { | |||
| 219 | 219 | func (x *ColumnViewRow) SetPropertyAccessibleDescription(value string) { | |
| 220 | 220 | var v gobject.Value | |
| 221 | 221 | v.Init(gobject.TypeStringVal) | |
| 222 | - | v.SetString(value) | |
| 222 | + | v.SetString(&value) | |
| 223 | 223 | x.SetProperty("accessible-description", &v) | |
| 224 | 224 | } | |
| 225 | 225 | ||
| @@ -236,7 +236,7 @@ func (x *ColumnViewRow) GetPropertyAccessibleDescription() string { | |||
| 236 | 236 | func (x *ColumnViewRow) SetPropertyAccessibleLabel(value string) { | |
| 237 | 237 | var v gobject.Value | |
| 238 | 238 | v.Init(gobject.TypeStringVal) | |
| 239 | - | v.SetString(value) | |
| 239 | + | v.SetString(&value) | |
| 240 | 240 | x.SetProperty("accessible-label", &v) | |
| 241 | 241 | } | |
| 242 | 242 | ||
M v4/gtk/gtkcombobox.go +35 -5
| @@ -449,7 +449,7 @@ func (x *ComboBox) SetActive(IndexVar int) { | |||
| 449 | 449 | ||
| 450 | 450 | } | |
| 451 | 451 | ||
| 452 | - | var xComboBoxSetActiveId func(uintptr, string) bool | |
| 452 | + | var xComboBoxSetActiveId func(uintptr, uintptr) bool | |
| 453 | 453 | ||
| 454 | 454 | // Changes the active row of @combo_box to the one that has an ID equal to | |
| 455 | 455 | // @active_id. | |
| @@ -460,9 +460,9 @@ var xComboBoxSetActiveId func(uintptr, string) bool | |||
| 460 | 460 | // If the [property@Gtk.ComboBox:id-column] property of @combo_box is | |
| 461 | 461 | // unset or if no row has the given ID then the function does nothing | |
| 462 | 462 | // and returns %FALSE. | |
| 463 | - | func (x *ComboBox) SetActiveId(ActiveIdVar string) bool { | |
| 463 | + | func (x *ComboBox) SetActiveId(ActiveIdVar *string) bool { | |
| 464 | 464 | ||
| 465 | - | cret := xComboBoxSetActiveId(x.GoPointer(), ActiveIdVar) | |
| 465 | + | cret := xComboBoxSetActiveId(x.GoPointer(), core.NullableStringToPtr(ActiveIdVar)) | |
| 466 | 466 | return cret | |
| 467 | 467 | } | |
| 468 | 468 | ||
| @@ -565,7 +565,37 @@ var xComboBoxSetRowSeparatorFunc func(uintptr, uintptr, uintptr, uintptr) | |||
| 565 | 565 | // This is the default value. | |
| 566 | 566 | func (x *ComboBox) SetRowSeparatorFunc(FuncVar *TreeViewRowSeparatorFunc, DataVar uintptr, DestroyVar *glib.DestroyNotify) { | |
| 567 | 567 | ||
| 568 | - | xComboBoxSetRowSeparatorFunc(x.GoPointer(), glib.NewCallbackNullable(FuncVar), DataVar, glib.NewCallbackNullable(DestroyVar)) | |
| 568 | + | var FuncVarRef uintptr | |
| 569 | + | if FuncVar != nil { | |
| 570 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 571 | + | if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok { | |
| 572 | + | FuncVarRef = cbRefPtr | |
| 573 | + | } else { | |
| 574 | + | fcb := func(arg0 uintptr, arg1 *TreeIter, arg2 uintptr) bool { | |
| 575 | + | cbFn := *FuncVar | |
| 576 | + | return cbFn(arg0, arg1, arg2) | |
| 577 | + | } | |
| 578 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 579 | + | glib.SaveCallback(FuncVarPtr, FuncVarRef) | |
| 580 | + | } | |
| 581 | + | } | |
| 582 | + | ||
| 583 | + | var DestroyVarRef uintptr | |
| 584 | + | if DestroyVar != nil { | |
| 585 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 586 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 587 | + | DestroyVarRef = cbRefPtr | |
| 588 | + | } else { | |
| 589 | + | fcb := func(arg0 uintptr) { | |
| 590 | + | cbFn := *DestroyVar | |
| 591 | + | cbFn(arg0) | |
| 592 | + | } | |
| 593 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 594 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 595 | + | } | |
| 596 | + | } | |
| 597 | + | ||
| 598 | + | xComboBoxSetRowSeparatorFunc(x.GoPointer(), FuncVarRef, DataVar, DestroyVarRef) | |
| 569 | 599 | ||
| 570 | 600 | } | |
| 571 | 601 | ||
| @@ -612,7 +642,7 @@ func (x *ComboBox) GetPropertyActive() int { | |||
| 612 | 642 | func (x *ComboBox) SetPropertyActiveId(value string) { | |
| 613 | 643 | var v gobject.Value | |
| 614 | 644 | v.Init(gobject.TypeStringVal) | |
| 615 | - | v.SetString(value) | |
| 645 | + | v.SetString(&value) | |
| 616 | 646 | x.SetProperty("active-id", &v) | |
| 617 | 647 | } | |
| 618 | 648 | ||
M v4/gtk/gtkcomboboxtext.go +9 -9
| @@ -124,7 +124,7 @@ func NewComboBoxTextWithEntry() *ComboBoxText { | |||
| 124 | 124 | return cls | |
| 125 | 125 | } | |
| 126 | 126 | ||
| 127 | - | var xComboBoxTextAppend func(uintptr, string, string) | |
| 127 | + | var xComboBoxTextAppend func(uintptr, uintptr, string) | |
| 128 | 128 | ||
| 129 | 129 | // Appends @text to the list of strings stored in @combo_box. | |
| 130 | 130 | // | |
| @@ -132,9 +132,9 @@ var xComboBoxTextAppend func(uintptr, string, string) | |||
| 132 | 132 | // | |
| 133 | 133 | // This is the same as calling [method@Gtk.ComboBoxText.insert] | |
| 134 | 134 | // with a position of -1. | |
| 135 | - | func (x *ComboBoxText) Append(IdVar string, TextVar string) { | |
| 135 | + | func (x *ComboBoxText) Append(IdVar *string, TextVar string) { | |
| 136 | 136 | ||
| 137 | - | xComboBoxTextAppend(x.GoPointer(), IdVar, TextVar) | |
| 137 | + | xComboBoxTextAppend(x.GoPointer(), core.NullableStringToPtr(IdVar), TextVar) | |
| 138 | 138 | ||
| 139 | 139 | } | |
| 140 | 140 | ||
| @@ -164,7 +164,7 @@ func (x *ComboBoxText) GetActiveText() string { | |||
| 164 | 164 | return cret | |
| 165 | 165 | } | |
| 166 | 166 | ||
| 167 | - | var xComboBoxTextInsert func(uintptr, int, string, string) | |
| 167 | + | var xComboBoxTextInsert func(uintptr, int, uintptr, string) | |
| 168 | 168 | ||
| 169 | 169 | // Inserts @text at @position in the list of strings stored in @combo_box. | |
| 170 | 170 | // | |
| @@ -172,9 +172,9 @@ var xComboBoxTextInsert func(uintptr, int, string, string) | |||
| 172 | 172 | // See [property@Gtk.ComboBox:id-column]. | |
| 173 | 173 | // | |
| 174 | 174 | // If @position is negative then @text is appended. | |
| 175 | - | func (x *ComboBoxText) Insert(PositionVar int, IdVar string, TextVar string) { | |
| 175 | + | func (x *ComboBoxText) Insert(PositionVar int, IdVar *string, TextVar string) { | |
| 176 | 176 | ||
| 177 | - | xComboBoxTextInsert(x.GoPointer(), PositionVar, IdVar, TextVar) | |
| 177 | + | xComboBoxTextInsert(x.GoPointer(), PositionVar, core.NullableStringToPtr(IdVar), TextVar) | |
| 178 | 178 | ||
| 179 | 179 | } | |
| 180 | 180 | ||
| @@ -192,7 +192,7 @@ func (x *ComboBoxText) InsertText(PositionVar int, TextVar string) { | |||
| 192 | 192 | ||
| 193 | 193 | } | |
| 194 | 194 | ||
| 195 | - | var xComboBoxTextPrepend func(uintptr, string, string) | |
| 195 | + | var xComboBoxTextPrepend func(uintptr, uintptr, string) | |
| 196 | 196 | ||
| 197 | 197 | // Prepends @text to the list of strings stored in @combo_box. | |
| 198 | 198 | // | |
| @@ -200,9 +200,9 @@ var xComboBoxTextPrepend func(uintptr, string, string) | |||
| 200 | 200 | // | |
| 201 | 201 | // This is the same as calling [method@Gtk.ComboBoxText.insert] | |
| 202 | 202 | // with a position of 0. | |
| 203 | - | func (x *ComboBoxText) Prepend(IdVar string, TextVar string) { | |
| 203 | + | func (x *ComboBoxText) Prepend(IdVar *string, TextVar string) { | |
| 204 | 204 | ||
| 205 | - | xComboBoxTextPrepend(x.GoPointer(), IdVar, TextVar) | |
| 205 | + | xComboBoxTextPrepend(x.GoPointer(), core.NullableStringToPtr(IdVar), TextVar) | |
| 206 | 206 | ||
| 207 | 207 | } | |
| 208 | 208 | ||
M v4/gtk/gtkconstraintguide.go +4 -4
| @@ -133,14 +133,14 @@ func (x *ConstraintGuide) SetMinSize(WidthVar int, HeightVar int) { | |||
| 133 | 133 | ||
| 134 | 134 | } | |
| 135 | 135 | ||
| 136 | - | var xConstraintGuideSetName func(uintptr, string) | |
| 136 | + | var xConstraintGuideSetName func(uintptr, uintptr) | |
| 137 | 137 | ||
| 138 | 138 | // Sets a name for the given `GtkConstraintGuide`. | |
| 139 | 139 | // | |
| 140 | 140 | // The name is useful for debugging purposes. | |
| 141 | - | func (x *ConstraintGuide) SetName(NameVar string) { | |
| 141 | + | func (x *ConstraintGuide) SetName(NameVar *string) { | |
| 142 | 142 | ||
| 143 | - | xConstraintGuideSetName(x.GoPointer(), NameVar) | |
| 143 | + | xConstraintGuideSetName(x.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 144 | 144 | ||
| 145 | 145 | } | |
| 146 | 146 | ||
| @@ -250,7 +250,7 @@ func (x *ConstraintGuide) GetPropertyMinWidth() int { | |||
| 250 | 250 | func (x *ConstraintGuide) SetPropertyName(value string) { | |
| 251 | 251 | var v gobject.Value | |
| 252 | 252 | v.Init(gobject.TypeStringVal) | |
| 253 | - | v.SetString(value) | |
| 253 | + | v.SetString(&value) | |
| 254 | 254 | x.SetProperty("name", &v) | |
| 255 | 255 | } | |
| 256 | 256 | ||
M v4/gtk/gtkcssprovider.go +3 -3
| @@ -156,16 +156,16 @@ func (x *CssProvider) LoadFromString(StringVar string) { | |||
| 156 | 156 | ||
| 157 | 157 | } | |
| 158 | 158 | ||
| 159 | - | var xCssProviderLoadNamed func(uintptr, string, string) | |
| 159 | + | var xCssProviderLoadNamed func(uintptr, string, uintptr) | |
| 160 | 160 | ||
| 161 | 161 | // Loads a theme from the usual theme paths. | |
| 162 | 162 | // | |
| 163 | 163 | // The actual process of finding the theme might change between | |
| 164 | 164 | // releases, but it is guaranteed that this function uses the same | |
| 165 | 165 | // mechanism to load the theme that GTK uses for loading its own theme. | |
| 166 | - | func (x *CssProvider) LoadNamed(NameVar string, VariantVar string) { | |
| 166 | + | func (x *CssProvider) LoadNamed(NameVar string, VariantVar *string) { | |
| 167 | 167 | ||
| 168 | - | xCssProviderLoadNamed(x.GoPointer(), NameVar, VariantVar) | |
| 168 | + | xCssProviderLoadNamed(x.GoPointer(), NameVar, core.NullableStringToPtr(VariantVar)) | |
| 169 | 169 | ||
| 170 | 170 | } | |
| 171 | 171 | ||
M v4/gtk/gtkcustomfilter.go +62 -2
| @@ -55,7 +55,37 @@ var xNewCustomFilter func(uintptr, uintptr, uintptr) uintptr | |||
| 55 | 55 | func NewCustomFilter(MatchFuncVar *CustomFilterFunc, UserDataVar uintptr, UserDestroyVar *glib.DestroyNotify) *CustomFilter { | |
| 56 | 56 | var cls *CustomFilter | |
| 57 | 57 | ||
| 58 | - | cret := xNewCustomFilter(glib.NewCallbackNullable(MatchFuncVar), UserDataVar, glib.NewCallback(UserDestroyVar)) | |
| 58 | + | var MatchFuncVarRef uintptr | |
| 59 | + | if MatchFuncVar != nil { | |
| 60 | + | MatchFuncVarPtr := uintptr(unsafe.Pointer(MatchFuncVar)) | |
| 61 | + | if cbRefPtr, ok := glib.GetCallback(MatchFuncVarPtr); ok { | |
| 62 | + | MatchFuncVarRef = cbRefPtr | |
| 63 | + | } else { | |
| 64 | + | fcb := func(arg0 uintptr, arg1 uintptr) bool { | |
| 65 | + | cbFn := *MatchFuncVar | |
| 66 | + | return cbFn(arg0, arg1) | |
| 67 | + | } | |
| 68 | + | MatchFuncVarRef = purego.NewCallback(fcb) | |
| 69 | + | glib.SaveCallback(MatchFuncVarPtr, MatchFuncVarRef) | |
| 70 | + | } | |
| 71 | + | } | |
| 72 | + | ||
| 73 | + | var UserDestroyVarRef uintptr | |
| 74 | + | if UserDestroyVar != nil { | |
| 75 | + | UserDestroyVarPtr := uintptr(unsafe.Pointer(UserDestroyVar)) | |
| 76 | + | if cbRefPtr, ok := glib.GetCallback(UserDestroyVarPtr); ok { | |
| 77 | + | UserDestroyVarRef = cbRefPtr | |
| 78 | + | } else { | |
| 79 | + | fcb := func(arg0 uintptr) { | |
| 80 | + | cbFn := *UserDestroyVar | |
| 81 | + | cbFn(arg0) | |
| 82 | + | } | |
| 83 | + | UserDestroyVarRef = purego.NewCallback(fcb) | |
| 84 | + | glib.SaveCallback(UserDestroyVarPtr, UserDestroyVarRef) | |
| 85 | + | } | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | cret := xNewCustomFilter(MatchFuncVarRef, UserDataVar, UserDestroyVarRef) | |
| 59 | 89 | ||
| 60 | 90 | if cret == 0 { | |
| 61 | 91 | return nil | |
| @@ -78,7 +108,37 @@ var xCustomFilterSetFilterFunc func(uintptr, uintptr, uintptr, uintptr) | |||
| 78 | 108 | // will be called. | |
| 79 | 109 | func (x *CustomFilter) SetFilterFunc(MatchFuncVar *CustomFilterFunc, UserDataVar uintptr, UserDestroyVar *glib.DestroyNotify) { | |
| 80 | 110 | ||
| 81 | - | xCustomFilterSetFilterFunc(x.GoPointer(), glib.NewCallbackNullable(MatchFuncVar), UserDataVar, glib.NewCallback(UserDestroyVar)) | |
| 111 | + | var MatchFuncVarRef uintptr | |
| 112 | + | if MatchFuncVar != nil { | |
| 113 | + | MatchFuncVarPtr := uintptr(unsafe.Pointer(MatchFuncVar)) | |
| 114 | + | if cbRefPtr, ok := glib.GetCallback(MatchFuncVarPtr); ok { | |
| 115 | + | MatchFuncVarRef = cbRefPtr | |
| 116 | + | } else { | |
| 117 | + | fcb := func(arg0 uintptr, arg1 uintptr) bool { | |
| 118 | + | cbFn := *MatchFuncVar | |
| 119 | + | return cbFn(arg0, arg1) | |
| 120 | + | } | |
| 121 | + | MatchFuncVarRef = purego.NewCallback(fcb) | |
| 122 | + | glib.SaveCallback(MatchFuncVarPtr, MatchFuncVarRef) | |
| 123 | + | } | |
| 124 | + | } | |
| 125 | + | ||
| 126 | + | var UserDestroyVarRef uintptr | |
| 127 | + | if UserDestroyVar != nil { | |
| 128 | + | UserDestroyVarPtr := uintptr(unsafe.Pointer(UserDestroyVar)) | |
| 129 | + | if cbRefPtr, ok := glib.GetCallback(UserDestroyVarPtr); ok { | |
| 130 | + | UserDestroyVarRef = cbRefPtr | |
| 131 | + | } else { | |
| 132 | + | fcb := func(arg0 uintptr) { | |
| 133 | + | cbFn := *UserDestroyVar | |
| 134 | + | cbFn(arg0) | |
| 135 | + | } | |
| 136 | + | UserDestroyVarRef = purego.NewCallback(fcb) | |
| 137 | + | glib.SaveCallback(UserDestroyVarPtr, UserDestroyVarRef) | |
| 138 | + | } | |
| 139 | + | } | |
| 140 | + | ||
| 141 | + | xCustomFilterSetFilterFunc(x.GoPointer(), MatchFuncVarRef, UserDataVar, UserDestroyVarRef) | |
| 82 | 142 | ||
| 83 | 143 | } | |
| 84 | 144 | ||
M v4/gtk/gtkcustomlayout.go +46 -1
| @@ -62,7 +62,52 @@ var xNewCustomLayout func(uintptr, uintptr, uintptr) uintptr | |||
| 62 | 62 | func NewCustomLayout(RequestModeVar *CustomRequestModeFunc, MeasureVar *CustomMeasureFunc, AllocateVar *CustomAllocateFunc) *CustomLayout { | |
| 63 | 63 | var cls *CustomLayout | |
| 64 | 64 | ||
| 65 | - | cret := xNewCustomLayout(glib.NewCallbackNullable(RequestModeVar), glib.NewCallback(MeasureVar), glib.NewCallback(AllocateVar)) | |
| 65 | + | var RequestModeVarRef uintptr | |
| 66 | + | if RequestModeVar != nil { | |
| 67 | + | RequestModeVarPtr := uintptr(unsafe.Pointer(RequestModeVar)) | |
| 68 | + | if cbRefPtr, ok := glib.GetCallback(RequestModeVarPtr); ok { | |
| 69 | + | RequestModeVarRef = cbRefPtr | |
| 70 | + | } else { | |
| 71 | + | fcb := func(arg0 uintptr) SizeRequestMode { | |
| 72 | + | cbFn := *RequestModeVar | |
| 73 | + | return cbFn(arg0) | |
| 74 | + | } | |
| 75 | + | RequestModeVarRef = purego.NewCallback(fcb) | |
| 76 | + | glib.SaveCallback(RequestModeVarPtr, RequestModeVarRef) | |
| 77 | + | } | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | var MeasureVarRef uintptr | |
| 81 | + | if MeasureVar != nil { | |
| 82 | + | MeasureVarPtr := uintptr(unsafe.Pointer(MeasureVar)) | |
| 83 | + | if cbRefPtr, ok := glib.GetCallback(MeasureVarPtr); ok { | |
| 84 | + | MeasureVarRef = cbRefPtr | |
| 85 | + | } else { | |
| 86 | + | fcb := func(arg0 uintptr, arg1 Orientation, arg2 int, arg3 *int, arg4 *int, arg5 *int, arg6 *int) { | |
| 87 | + | cbFn := *MeasureVar | |
| 88 | + | cbFn(arg0, arg1, arg2, arg3, arg4, arg5, arg6) | |
| 89 | + | } | |
| 90 | + | MeasureVarRef = purego.NewCallback(fcb) | |
| 91 | + | glib.SaveCallback(MeasureVarPtr, MeasureVarRef) | |
| 92 | + | } | |
| 93 | + | } | |
| 94 | + | ||
| 95 | + | var AllocateVarRef uintptr | |
| 96 | + | if AllocateVar != nil { | |
| 97 | + | AllocateVarPtr := uintptr(unsafe.Pointer(AllocateVar)) | |
| 98 | + | if cbRefPtr, ok := glib.GetCallback(AllocateVarPtr); ok { | |
| 99 | + | AllocateVarRef = cbRefPtr | |
| 100 | + | } else { | |
| 101 | + | fcb := func(arg0 uintptr, arg1 int, arg2 int, arg3 int) { | |
| 102 | + | cbFn := *AllocateVar | |
| 103 | + | cbFn(arg0, arg1, arg2, arg3) | |
| 104 | + | } | |
| 105 | + | AllocateVarRef = purego.NewCallback(fcb) | |
| 106 | + | glib.SaveCallback(AllocateVarPtr, AllocateVarRef) | |
| 107 | + | } | |
| 108 | + | } | |
| 109 | + | ||
| 110 | + | cret := xNewCustomLayout(RequestModeVarRef, MeasureVarRef, AllocateVarRef) | |
| 66 | 111 | ||
| 67 | 112 | if cret == 0 { | |
| 68 | 113 | return nil | |
M v4/gtk/gtkcustomsorter.go +62 -2
| @@ -47,7 +47,37 @@ var xNewCustomSorter func(uintptr, uintptr, uintptr) uintptr | |||
| 47 | 47 | func NewCustomSorter(SortFuncVar *glib.CompareDataFunc, UserDataVar uintptr, UserDestroyVar *glib.DestroyNotify) *CustomSorter { | |
| 48 | 48 | var cls *CustomSorter | |
| 49 | 49 | ||
| 50 | - | cret := xNewCustomSorter(glib.NewCallbackNullable(SortFuncVar), UserDataVar, glib.NewCallbackNullable(UserDestroyVar)) | |
| 50 | + | var SortFuncVarRef uintptr | |
| 51 | + | if SortFuncVar != nil { | |
| 52 | + | SortFuncVarPtr := uintptr(unsafe.Pointer(SortFuncVar)) | |
| 53 | + | if cbRefPtr, ok := glib.GetCallback(SortFuncVarPtr); ok { | |
| 54 | + | SortFuncVarRef = cbRefPtr | |
| 55 | + | } else { | |
| 56 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 57 | + | cbFn := *SortFuncVar | |
| 58 | + | return cbFn(arg0, arg1, arg2) | |
| 59 | + | } | |
| 60 | + | SortFuncVarRef = purego.NewCallback(fcb) | |
| 61 | + | glib.SaveCallback(SortFuncVarPtr, SortFuncVarRef) | |
| 62 | + | } | |
| 63 | + | } | |
| 64 | + | ||
| 65 | + | var UserDestroyVarRef uintptr | |
| 66 | + | if UserDestroyVar != nil { | |
| 67 | + | UserDestroyVarPtr := uintptr(unsafe.Pointer(UserDestroyVar)) | |
| 68 | + | if cbRefPtr, ok := glib.GetCallback(UserDestroyVarPtr); ok { | |
| 69 | + | UserDestroyVarRef = cbRefPtr | |
| 70 | + | } else { | |
| 71 | + | fcb := func(arg0 uintptr) { | |
| 72 | + | cbFn := *UserDestroyVar | |
| 73 | + | cbFn(arg0) | |
| 74 | + | } | |
| 75 | + | UserDestroyVarRef = purego.NewCallback(fcb) | |
| 76 | + | glib.SaveCallback(UserDestroyVarPtr, UserDestroyVarRef) | |
| 77 | + | } | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | cret := xNewCustomSorter(SortFuncVarRef, UserDataVar, UserDestroyVarRef) | |
| 51 | 81 | ||
| 52 | 82 | if cret == 0 { | |
| 53 | 83 | return nil | |
| @@ -70,7 +100,37 @@ var xCustomSorterSetSortFunc func(uintptr, uintptr, uintptr, uintptr) | |||
| 70 | 100 | // called now. | |
| 71 | 101 | func (x *CustomSorter) SetSortFunc(SortFuncVar *glib.CompareDataFunc, UserDataVar uintptr, UserDestroyVar *glib.DestroyNotify) { | |
| 72 | 102 | ||
| 73 | - | xCustomSorterSetSortFunc(x.GoPointer(), glib.NewCallbackNullable(SortFuncVar), UserDataVar, glib.NewCallback(UserDestroyVar)) | |
| 103 | + | var SortFuncVarRef uintptr | |
| 104 | + | if SortFuncVar != nil { | |
| 105 | + | SortFuncVarPtr := uintptr(unsafe.Pointer(SortFuncVar)) | |
| 106 | + | if cbRefPtr, ok := glib.GetCallback(SortFuncVarPtr); ok { | |
| 107 | + | SortFuncVarRef = cbRefPtr | |
| 108 | + | } else { | |
| 109 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 110 | + | cbFn := *SortFuncVar | |
| 111 | + | return cbFn(arg0, arg1, arg2) | |
| 112 | + | } | |
| 113 | + | SortFuncVarRef = purego.NewCallback(fcb) | |
| 114 | + | glib.SaveCallback(SortFuncVarPtr, SortFuncVarRef) | |
| 115 | + | } | |
| 116 | + | } | |
| 117 | + | ||
| 118 | + | var UserDestroyVarRef uintptr | |
| 119 | + | if UserDestroyVar != nil { | |
| 120 | + | UserDestroyVarPtr := uintptr(unsafe.Pointer(UserDestroyVar)) | |
| 121 | + | if cbRefPtr, ok := glib.GetCallback(UserDestroyVarPtr); ok { | |
| 122 | + | UserDestroyVarRef = cbRefPtr | |
| 123 | + | } else { | |
| 124 | + | fcb := func(arg0 uintptr) { | |
| 125 | + | cbFn := *UserDestroyVar | |
| 126 | + | cbFn(arg0) | |
| 127 | + | } | |
| 128 | + | UserDestroyVarRef = purego.NewCallback(fcb) | |
| 129 | + | glib.SaveCallback(UserDestroyVarPtr, UserDestroyVarRef) | |
| 130 | + | } | |
| 131 | + | } | |
| 132 | + | ||
| 133 | + | xCustomSorterSetSortFunc(x.GoPointer(), SortFuncVarRef, UserDataVar, UserDestroyVarRef) | |
| 74 | 134 | ||
| 75 | 135 | } | |
| 76 | 136 | ||
M v4/gtk/gtkdialog.go +3 -3
| @@ -306,7 +306,7 @@ func NewDialog() *Dialog { | |||
| 306 | 306 | return cls | |
| 307 | 307 | } | |
| 308 | 308 | ||
| 309 | - | var xNewDialogWithButtons func(string, uintptr, DialogFlags, string, ...interface{}) uintptr | |
| 309 | + | var xNewDialogWithButtons func(uintptr, uintptr, DialogFlags, uintptr, ...interface{}) uintptr | |
| 310 | 310 | ||
| 311 | 311 | // Creates a new `GtkDialog` with the given title and transient parent. | |
| 312 | 312 | // | |
| @@ -343,10 +343,10 @@ var xNewDialogWithButtons func(string, uintptr, DialogFlags, string, ...interfac | |||
| 343 | 343 | // NULL); | |
| 344 | 344 | // | |
| 345 | 345 | // ``` | |
| 346 | - | func NewDialogWithButtons(TitleVar string, ParentVar *Window, FlagsVar DialogFlags, FirstButtonTextVar string, varArgs ...interface{}) *Dialog { | |
| 346 | + | func NewDialogWithButtons(TitleVar *string, ParentVar *Window, FlagsVar DialogFlags, FirstButtonTextVar *string, varArgs ...interface{}) *Dialog { | |
| 347 | 347 | var cls *Dialog | |
| 348 | 348 | ||
| 349 | - | cret := xNewDialogWithButtons(TitleVar, ParentVar.GoPointer(), FlagsVar, FirstButtonTextVar, varArgs...) | |
| 349 | + | cret := xNewDialogWithButtons(core.NullableStringToPtr(TitleVar), ParentVar.GoPointer(), FlagsVar, core.NullableStringToPtr(FirstButtonTextVar), varArgs...) | |
| 350 | 350 | ||
| 351 | 351 | if cret == 0 { | |
| 352 | 352 | return nil | |
M v4/gtk/gtkdirectorylist.go +7 -7
| @@ -61,16 +61,16 @@ func DirectoryListNewFromInternalPtr(ptr uintptr) *DirectoryList { | |||
| 61 | 61 | return cls | |
| 62 | 62 | } | |
| 63 | 63 | ||
| 64 | - | var xNewDirectoryList func(string, uintptr) uintptr | |
| 64 | + | var xNewDirectoryList func(uintptr, uintptr) uintptr | |
| 65 | 65 | ||
| 66 | 66 | // Creates a new `GtkDirectoryList`. | |
| 67 | 67 | // | |
| 68 | 68 | // The `GtkDirectoryList` is querying the given @file | |
| 69 | 69 | // with the given @attributes. | |
| 70 | - | func NewDirectoryList(AttributesVar string, FileVar gio.File) *DirectoryList { | |
| 70 | + | func NewDirectoryList(AttributesVar *string, FileVar gio.File) *DirectoryList { | |
| 71 | 71 | var cls *DirectoryList | |
| 72 | 72 | ||
| 73 | - | cret := xNewDirectoryList(AttributesVar, FileVar.GoPointer()) | |
| 73 | + | cret := xNewDirectoryList(core.NullableStringToPtr(AttributesVar), FileVar.GoPointer()) | |
| 74 | 74 | ||
| 75 | 75 | if cret == 0 { | |
| 76 | 76 | return nil | |
| @@ -155,15 +155,15 @@ func (x *DirectoryList) IsLoading() bool { | |||
| 155 | 155 | return cret | |
| 156 | 156 | } | |
| 157 | 157 | ||
| 158 | - | var xDirectoryListSetAttributes func(uintptr, string) | |
| 158 | + | var xDirectoryListSetAttributes func(uintptr, uintptr) | |
| 159 | 159 | ||
| 160 | 160 | // Sets the @attributes to be enumerated and starts the enumeration. | |
| 161 | 161 | // | |
| 162 | 162 | // If @attributes is %NULL, the list of file infos will still be created, it will just | |
| 163 | 163 | // not contain any extra attributes. | |
| 164 | - | func (x *DirectoryList) SetAttributes(AttributesVar string) { | |
| 164 | + | func (x *DirectoryList) SetAttributes(AttributesVar *string) { | |
| 165 | 165 | ||
| 166 | - | xDirectoryListSetAttributes(x.GoPointer(), AttributesVar) | |
| 166 | + | xDirectoryListSetAttributes(x.GoPointer(), core.NullableStringToPtr(AttributesVar)) | |
| 167 | 167 | ||
| 168 | 168 | } | |
| 169 | 169 | ||
| @@ -229,7 +229,7 @@ func (c *DirectoryList) SetGoPointer(ptr uintptr) { | |||
| 229 | 229 | func (x *DirectoryList) SetPropertyAttributes(value string) { | |
| 230 | 230 | var v gobject.Value | |
| 231 | 231 | v.Init(gobject.TypeStringVal) | |
| 232 | - | v.SetString(value) | |
| 232 | + | v.SetString(&value) | |
| 233 | 233 | x.SetProperty("attributes", &v) | |
| 234 | 234 | } | |
| 235 | 235 | ||
M v4/gtk/gtkdrawingarea.go +31 -1
| @@ -244,7 +244,37 @@ var xDrawingAreaSetDrawFunc func(uintptr, uintptr, uintptr, uintptr) | |||
| 244 | 244 | // on the drawing area. This will cause a redraw and will call @draw_func again. | |
| 245 | 245 | func (x *DrawingArea) SetDrawFunc(DrawFuncVar *DrawingAreaDrawFunc, UserDataVar uintptr, DestroyVar *glib.DestroyNotify) { | |
| 246 | 246 | ||
| 247 | - | xDrawingAreaSetDrawFunc(x.GoPointer(), glib.NewCallbackNullable(DrawFuncVar), UserDataVar, glib.NewCallback(DestroyVar)) | |
| 247 | + | var DrawFuncVarRef uintptr | |
| 248 | + | if DrawFuncVar != nil { | |
| 249 | + | DrawFuncVarPtr := uintptr(unsafe.Pointer(DrawFuncVar)) | |
| 250 | + | if cbRefPtr, ok := glib.GetCallback(DrawFuncVarPtr); ok { | |
| 251 | + | DrawFuncVarRef = cbRefPtr | |
| 252 | + | } else { | |
| 253 | + | fcb := func(arg0 uintptr, arg1 *cairo.Context, arg2 int, arg3 int, arg4 uintptr) { | |
| 254 | + | cbFn := *DrawFuncVar | |
| 255 | + | cbFn(arg0, arg1, arg2, arg3, arg4) | |
| 256 | + | } | |
| 257 | + | DrawFuncVarRef = purego.NewCallback(fcb) | |
| 258 | + | glib.SaveCallback(DrawFuncVarPtr, DrawFuncVarRef) | |
| 259 | + | } | |
| 260 | + | } | |
| 261 | + | ||
| 262 | + | var DestroyVarRef uintptr | |
| 263 | + | if DestroyVar != nil { | |
| 264 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 265 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 266 | + | DestroyVarRef = cbRefPtr | |
| 267 | + | } else { | |
| 268 | + | fcb := func(arg0 uintptr) { | |
| 269 | + | cbFn := *DestroyVar | |
| 270 | + | cbFn(arg0) | |
| 271 | + | } | |
| 272 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 273 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 274 | + | } | |
| 275 | + | } | |
| 276 | + | ||
| 277 | + | xDrawingAreaSetDrawFunc(x.GoPointer(), DrawFuncVarRef, UserDataVar, DestroyVarRef) | |
| 248 | 278 | ||
| 249 | 279 | } | |
| 250 | 280 | ||
M v4/gtk/gtkeditable.go +1 -1
| @@ -822,7 +822,7 @@ func (x *EditableBase) SetPropertyText(value string) { | |||
| 822 | 822 | obj.Ptr = x.GoPointer() | |
| 823 | 823 | var v gobject.Value | |
| 824 | 824 | v.Init(gobject.TypeStringVal) | |
| 825 | - | v.SetString(value) | |
| 825 | + | v.SetString(&value) | |
| 826 | 826 | obj.SetProperty("text", &v) | |
| 827 | 827 | } | |
| 828 | 828 | ||
M v4/gtk/gtkentry.go +22 -22
| @@ -751,7 +751,7 @@ func (x *Entry) SetIconFromGicon(IconPosVar EntryIconPosition, IconVar gio.Icon) | |||
| 751 | 751 | ||
| 752 | 752 | } | |
| 753 | 753 | ||
| 754 | - | var xEntrySetIconFromIconName func(uintptr, EntryIconPosition, string) | |
| 754 | + | var xEntrySetIconFromIconName func(uintptr, EntryIconPosition, uintptr) | |
| 755 | 755 | ||
| 756 | 756 | // Sets the icon shown in the entry at the specified position | |
| 757 | 757 | // from the current icon theme. | |
| @@ -761,9 +761,9 @@ var xEntrySetIconFromIconName func(uintptr, EntryIconPosition, string) | |||
| 761 | 761 | // | |
| 762 | 762 | // If @icon_name is %NULL, no icon will be shown in the | |
| 763 | 763 | // specified position. | |
| 764 | - | func (x *Entry) SetIconFromIconName(IconPosVar EntryIconPosition, IconNameVar string) { | |
| 764 | + | func (x *Entry) SetIconFromIconName(IconPosVar EntryIconPosition, IconNameVar *string) { | |
| 765 | 765 | ||
| 766 | - | xEntrySetIconFromIconName(x.GoPointer(), IconPosVar, IconNameVar) | |
| 766 | + | xEntrySetIconFromIconName(x.GoPointer(), IconPosVar, core.NullableStringToPtr(IconNameVar)) | |
| 767 | 767 | ||
| 768 | 768 | } | |
| 769 | 769 | ||
| @@ -787,7 +787,7 @@ func (x *Entry) SetIconSensitive(IconPosVar EntryIconPosition, SensitiveVar bool | |||
| 787 | 787 | ||
| 788 | 788 | } | |
| 789 | 789 | ||
| 790 | - | var xEntrySetIconTooltipMarkup func(uintptr, EntryIconPosition, string) | |
| 790 | + | var xEntrySetIconTooltipMarkup func(uintptr, EntryIconPosition, uintptr) | |
| 791 | 791 | ||
| 792 | 792 | // Sets @tooltip as the contents of the tooltip for the icon at | |
| 793 | 793 | // the specified position. | |
| @@ -798,13 +798,13 @@ var xEntrySetIconTooltipMarkup func(uintptr, EntryIconPosition, string) | |||
| 798 | 798 | // | |
| 799 | 799 | // See also [method@Gtk.Widget.set_tooltip_markup] and | |
| 800 | 800 | // [method@Gtk.Entry.set_icon_tooltip_text]. | |
| 801 | - | func (x *Entry) SetIconTooltipMarkup(IconPosVar EntryIconPosition, TooltipVar string) { | |
| 801 | + | func (x *Entry) SetIconTooltipMarkup(IconPosVar EntryIconPosition, TooltipVar *string) { | |
| 802 | 802 | ||
| 803 | - | xEntrySetIconTooltipMarkup(x.GoPointer(), IconPosVar, TooltipVar) | |
| 803 | + | xEntrySetIconTooltipMarkup(x.GoPointer(), IconPosVar, core.NullableStringToPtr(TooltipVar)) | |
| 804 | 804 | ||
| 805 | 805 | } | |
| 806 | 806 | ||
| 807 | - | var xEntrySetIconTooltipText func(uintptr, EntryIconPosition, string) | |
| 807 | + | var xEntrySetIconTooltipText func(uintptr, EntryIconPosition, uintptr) | |
| 808 | 808 | ||
| 809 | 809 | // Sets @tooltip as the contents of the tooltip for the icon | |
| 810 | 810 | // at the specified position. | |
| @@ -823,9 +823,9 @@ var xEntrySetIconTooltipText func(uintptr, EntryIconPosition, string) | |||
| 823 | 823 | // [property@Gtk.Widget:has-tooltip] back to %TRUE, or | |
| 824 | 824 | // setting at least one non-empty tooltip on any icon | |
| 825 | 825 | // achieves the same result. | |
| 826 | - | func (x *Entry) SetIconTooltipText(IconPosVar EntryIconPosition, TooltipVar string) { | |
| 826 | + | func (x *Entry) SetIconTooltipText(IconPosVar EntryIconPosition, TooltipVar *string) { | |
| 827 | 827 | ||
| 828 | - | xEntrySetIconTooltipText(x.GoPointer(), IconPosVar, TooltipVar) | |
| 828 | + | xEntrySetIconTooltipText(x.GoPointer(), IconPosVar, core.NullableStringToPtr(TooltipVar)) | |
| 829 | 829 | ||
| 830 | 830 | } | |
| 831 | 831 | ||
| @@ -905,15 +905,15 @@ func (x *Entry) SetOverwriteMode(OverwriteVar bool) { | |||
| 905 | 905 | ||
| 906 | 906 | } | |
| 907 | 907 | ||
| 908 | - | var xEntrySetPlaceholderText func(uintptr, string) | |
| 908 | + | var xEntrySetPlaceholderText func(uintptr, uintptr) | |
| 909 | 909 | ||
| 910 | 910 | // Sets text to be displayed in @entry when it is empty. | |
| 911 | 911 | // | |
| 912 | 912 | // This can be used to give a visual hint of the expected | |
| 913 | 913 | // contents of the `GtkEntry`. | |
| 914 | - | func (x *Entry) SetPlaceholderText(TextVar string) { | |
| 914 | + | func (x *Entry) SetPlaceholderText(TextVar *string) { | |
| 915 | 915 | ||
| 916 | - | xEntrySetPlaceholderText(x.GoPointer(), TextVar) | |
| 916 | + | xEntrySetPlaceholderText(x.GoPointer(), core.NullableStringToPtr(TextVar)) | |
| 917 | 917 | ||
| 918 | 918 | } | |
| 919 | 919 | ||
| @@ -1087,7 +1087,7 @@ func (x *Entry) GetPropertyHasFrame() bool { | |||
| 1087 | 1087 | func (x *Entry) SetPropertyImModule(value string) { | |
| 1088 | 1088 | var v gobject.Value | |
| 1089 | 1089 | v.Init(gobject.TypeStringVal) | |
| 1090 | - | v.SetString(value) | |
| 1090 | + | v.SetString(&value) | |
| 1091 | 1091 | x.SetProperty("im-module", &v) | |
| 1092 | 1092 | } | |
| 1093 | 1093 | ||
| @@ -1172,7 +1172,7 @@ func (x *Entry) GetPropertyMaxLength() int { | |||
| 1172 | 1172 | func (x *Entry) SetPropertyMenuEntryIconPrimaryText(value string) { | |
| 1173 | 1173 | var v gobject.Value | |
| 1174 | 1174 | v.Init(gobject.TypeStringVal) | |
| 1175 | - | v.SetString(value) | |
| 1175 | + | v.SetString(&value) | |
| 1176 | 1176 | x.SetProperty("menu-entry-icon-primary-text", &v) | |
| 1177 | 1177 | } | |
| 1178 | 1178 | ||
| @@ -1211,7 +1211,7 @@ func (x *Entry) GetPropertyMenuEntryIconPrimaryText() string { | |||
| 1211 | 1211 | func (x *Entry) SetPropertyMenuEntryIconSecondaryText(value string) { | |
| 1212 | 1212 | var v gobject.Value | |
| 1213 | 1213 | v.Init(gobject.TypeStringVal) | |
| 1214 | - | v.SetString(value) | |
| 1214 | + | v.SetString(&value) | |
| 1215 | 1215 | x.SetProperty("menu-entry-icon-secondary-text", &v) | |
| 1216 | 1216 | } | |
| 1217 | 1217 | ||
| @@ -1257,7 +1257,7 @@ func (x *Entry) GetPropertyOverwriteMode() bool { | |||
| 1257 | 1257 | func (x *Entry) SetPropertyPlaceholderText(value string) { | |
| 1258 | 1258 | var v gobject.Value | |
| 1259 | 1259 | v.Init(gobject.TypeStringVal) | |
| 1260 | - | v.SetString(value) | |
| 1260 | + | v.SetString(&value) | |
| 1261 | 1261 | x.SetProperty("placeholder-text", &v) | |
| 1262 | 1262 | } | |
| 1263 | 1263 | ||
| @@ -1306,7 +1306,7 @@ func (x *Entry) GetPropertyPrimaryIconActivatable() bool { | |||
| 1306 | 1306 | func (x *Entry) SetPropertyPrimaryIconName(value string) { | |
| 1307 | 1307 | var v gobject.Value | |
| 1308 | 1308 | v.Init(gobject.TypeStringVal) | |
| 1309 | - | v.SetString(value) | |
| 1309 | + | v.SetString(&value) | |
| 1310 | 1310 | x.SetProperty("primary-icon-name", &v) | |
| 1311 | 1311 | } | |
| 1312 | 1312 | ||
| @@ -1356,7 +1356,7 @@ func (x *Entry) GetPropertyPrimaryIconSensitive() bool { | |||
| 1356 | 1356 | func (x *Entry) SetPropertyPrimaryIconTooltipMarkup(value string) { | |
| 1357 | 1357 | var v gobject.Value | |
| 1358 | 1358 | v.Init(gobject.TypeStringVal) | |
| 1359 | - | v.SetString(value) | |
| 1359 | + | v.SetString(&value) | |
| 1360 | 1360 | x.SetProperty("primary-icon-tooltip-markup", &v) | |
| 1361 | 1361 | } | |
| 1362 | 1362 | ||
| @@ -1377,7 +1377,7 @@ func (x *Entry) GetPropertyPrimaryIconTooltipMarkup() string { | |||
| 1377 | 1377 | func (x *Entry) SetPropertyPrimaryIconTooltipText(value string) { | |
| 1378 | 1378 | var v gobject.Value | |
| 1379 | 1379 | v.Init(gobject.TypeStringVal) | |
| 1380 | - | v.SetString(value) | |
| 1380 | + | v.SetString(&value) | |
| 1381 | 1381 | x.SetProperty("primary-icon-tooltip-text", &v) | |
| 1382 | 1382 | } | |
| 1383 | 1383 | ||
| @@ -1475,7 +1475,7 @@ func (x *Entry) GetPropertySecondaryIconActivatable() bool { | |||
| 1475 | 1475 | func (x *Entry) SetPropertySecondaryIconName(value string) { | |
| 1476 | 1476 | var v gobject.Value | |
| 1477 | 1477 | v.Init(gobject.TypeStringVal) | |
| 1478 | - | v.SetString(value) | |
| 1478 | + | v.SetString(&value) | |
| 1479 | 1479 | x.SetProperty("secondary-icon-name", &v) | |
| 1480 | 1480 | } | |
| 1481 | 1481 | ||
| @@ -1525,7 +1525,7 @@ func (x *Entry) GetPropertySecondaryIconSensitive() bool { | |||
| 1525 | 1525 | func (x *Entry) SetPropertySecondaryIconTooltipMarkup(value string) { | |
| 1526 | 1526 | var v gobject.Value | |
| 1527 | 1527 | v.Init(gobject.TypeStringVal) | |
| 1528 | - | v.SetString(value) | |
| 1528 | + | v.SetString(&value) | |
| 1529 | 1529 | x.SetProperty("secondary-icon-tooltip-markup", &v) | |
| 1530 | 1530 | } | |
| 1531 | 1531 | ||
| @@ -1546,7 +1546,7 @@ func (x *Entry) GetPropertySecondaryIconTooltipMarkup() string { | |||
| 1546 | 1546 | func (x *Entry) SetPropertySecondaryIconTooltipText(value string) { | |
| 1547 | 1547 | var v gobject.Value | |
| 1548 | 1548 | v.Init(gobject.TypeStringVal) | |
| 1549 | - | v.SetString(value) | |
| 1549 | + | v.SetString(&value) | |
| 1550 | 1550 | x.SetProperty("secondary-icon-tooltip-text", &v) | |
| 1551 | 1551 | } | |
| 1552 | 1552 | ||
M v4/gtk/gtkentrybuffer.go +4 -4
| @@ -398,15 +398,15 @@ func EntryBufferNewFromInternalPtr(ptr uintptr) *EntryBuffer { | |||
| 398 | 398 | return cls | |
| 399 | 399 | } | |
| 400 | 400 | ||
| 401 | - | var xNewEntryBuffer func(string, int) uintptr | |
| 401 | + | var xNewEntryBuffer func(uintptr, int) uintptr | |
| 402 | 402 | ||
| 403 | 403 | // Create a new `GtkEntryBuffer` object. | |
| 404 | 404 | // | |
| 405 | 405 | // Optionally, specify initial text to set in the buffer. | |
| 406 | - | func NewEntryBuffer(InitialCharsVar string, NInitialCharsVar int) *EntryBuffer { | |
| 406 | + | func NewEntryBuffer(InitialCharsVar *string, NInitialCharsVar int) *EntryBuffer { | |
| 407 | 407 | var cls *EntryBuffer | |
| 408 | 408 | ||
| 409 | - | cret := xNewEntryBuffer(InitialCharsVar, NInitialCharsVar) | |
| 409 | + | cret := xNewEntryBuffer(core.NullableStringToPtr(InitialCharsVar), NInitialCharsVar) | |
| 410 | 410 | ||
| 411 | 411 | if cret == 0 { | |
| 412 | 412 | return nil | |
| @@ -579,7 +579,7 @@ func (x *EntryBuffer) GetPropertyMaxLength() int { | |||
| 579 | 579 | func (x *EntryBuffer) SetPropertyText(value string) { | |
| 580 | 580 | var v gobject.Value | |
| 581 | 581 | v.Init(gobject.TypeStringVal) | |
| 582 | - | v.SetString(value) | |
| 582 | + | v.SetString(&value) | |
| 583 | 583 | x.SetProperty("text", &v) | |
| 584 | 584 | } | |
| 585 | 585 | ||
M v4/gtk/gtkentrycompletion.go +31 -1
| @@ -285,7 +285,37 @@ var xEntryCompletionSetMatchFunc func(uintptr, uintptr, uintptr, uintptr) | |||
| 285 | 285 | // should not be in the completion list. | |
| 286 | 286 | func (x *EntryCompletion) SetMatchFunc(FuncVar *EntryCompletionMatchFunc, FuncDataVar uintptr, FuncNotifyVar *glib.DestroyNotify) { | |
| 287 | 287 | ||
| 288 | - | xEntryCompletionSetMatchFunc(x.GoPointer(), glib.NewCallback(FuncVar), FuncDataVar, glib.NewCallback(FuncNotifyVar)) | |
| 288 | + | var FuncVarRef uintptr | |
| 289 | + | if FuncVar != nil { | |
| 290 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 291 | + | if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok { | |
| 292 | + | FuncVarRef = cbRefPtr | |
| 293 | + | } else { | |
| 294 | + | fcb := func(arg0 uintptr, arg1 string, arg2 *TreeIter, arg3 uintptr) bool { | |
| 295 | + | cbFn := *FuncVar | |
| 296 | + | return cbFn(arg0, arg1, arg2, arg3) | |
| 297 | + | } | |
| 298 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 299 | + | glib.SaveCallback(FuncVarPtr, FuncVarRef) | |
| 300 | + | } | |
| 301 | + | } | |
| 302 | + | ||
| 303 | + | var FuncNotifyVarRef uintptr | |
| 304 | + | if FuncNotifyVar != nil { | |
| 305 | + | FuncNotifyVarPtr := uintptr(unsafe.Pointer(FuncNotifyVar)) | |
| 306 | + | if cbRefPtr, ok := glib.GetCallback(FuncNotifyVarPtr); ok { | |
| 307 | + | FuncNotifyVarRef = cbRefPtr | |
| 308 | + | } else { | |
| 309 | + | fcb := func(arg0 uintptr) { | |
| 310 | + | cbFn := *FuncNotifyVar | |
| 311 | + | cbFn(arg0) | |
| 312 | + | } | |
| 313 | + | FuncNotifyVarRef = purego.NewCallback(fcb) | |
| 314 | + | glib.SaveCallback(FuncNotifyVarPtr, FuncNotifyVarRef) | |
| 315 | + | } | |
| 316 | + | } | |
| 317 | + | ||
| 318 | + | xEntryCompletionSetMatchFunc(x.GoPointer(), FuncVarRef, FuncDataVar, FuncNotifyVarRef) | |
| 289 | 319 | ||
| 290 | 320 | } | |
| 291 | 321 | ||
M v4/gtk/gtkeventcontroller.go +7 -7
| @@ -164,12 +164,12 @@ func (x *EventController) Reset() { | |||
| 164 | 164 | ||
| 165 | 165 | } | |
| 166 | 166 | ||
| 167 | - | var xEventControllerSetName func(uintptr, string) | |
| 167 | + | var xEventControllerSetName func(uintptr, uintptr) | |
| 168 | 168 | ||
| 169 | 169 | // Sets a name on the controller that can be used for debugging. | |
| 170 | - | func (x *EventController) SetName(NameVar string) { | |
| 170 | + | func (x *EventController) SetName(NameVar *string) { | |
| 171 | 171 | ||
| 172 | - | xEventControllerSetName(x.GoPointer(), NameVar) | |
| 172 | + | xEventControllerSetName(x.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 173 | 173 | ||
| 174 | 174 | } | |
| 175 | 175 | ||
| @@ -198,12 +198,12 @@ func (x *EventController) SetPropagationPhase(PhaseVar PropagationPhase) { | |||
| 198 | 198 | ||
| 199 | 199 | } | |
| 200 | 200 | ||
| 201 | - | var xEventControllerSetStaticName func(uintptr, string) | |
| 201 | + | var xEventControllerSetStaticName func(uintptr, uintptr) | |
| 202 | 202 | ||
| 203 | 203 | // Sets a name on the controller that can be used for debugging. | |
| 204 | - | func (x *EventController) SetStaticName(NameVar string) { | |
| 204 | + | func (x *EventController) SetStaticName(NameVar *string) { | |
| 205 | 205 | ||
| 206 | - | xEventControllerSetStaticName(x.GoPointer(), NameVar) | |
| 206 | + | xEventControllerSetStaticName(x.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 207 | 207 | ||
| 208 | 208 | } | |
| 209 | 209 | ||
| @@ -223,7 +223,7 @@ func (c *EventController) SetGoPointer(ptr uintptr) { | |||
| 223 | 223 | func (x *EventController) SetPropertyName(value string) { | |
| 224 | 224 | var v gobject.Value | |
| 225 | 225 | v.Init(gobject.TypeStringVal) | |
| 226 | - | v.SetString(value) | |
| 226 | + | v.SetString(&value) | |
| 227 | 227 | x.SetProperty("name", &v) | |
| 228 | 228 | } | |
| 229 | 229 | ||
M v4/gtk/gtkexpander.go +10 -10
| @@ -126,13 +126,13 @@ func ExpanderNewFromInternalPtr(ptr uintptr) *Expander { | |||
| 126 | 126 | return cls | |
| 127 | 127 | } | |
| 128 | 128 | ||
| 129 | - | var xNewExpander func(string) uintptr | |
| 129 | + | var xNewExpander func(uintptr) uintptr | |
| 130 | 130 | ||
| 131 | 131 | // Creates a new expander using @label as the text of the label. | |
| 132 | - | func NewExpander(LabelVar string) *Expander { | |
| 132 | + | func NewExpander(LabelVar *string) *Expander { | |
| 133 | 133 | var cls *Expander | |
| 134 | 134 | ||
| 135 | - | cret := xNewExpander(LabelVar) | |
| 135 | + | cret := xNewExpander(core.NullableStringToPtr(LabelVar)) | |
| 136 | 136 | ||
| 137 | 137 | if cret == 0 { | |
| 138 | 138 | return nil | |
| @@ -143,7 +143,7 @@ func NewExpander(LabelVar string) *Expander { | |||
| 143 | 143 | return cls | |
| 144 | 144 | } | |
| 145 | 145 | ||
| 146 | - | var xNewExpanderWithMnemonic func(string) uintptr | |
| 146 | + | var xNewExpanderWithMnemonic func(uintptr) uintptr | |
| 147 | 147 | ||
| 148 | 148 | // Creates a new expander using @label as the text of the label. | |
| 149 | 149 | // | |
| @@ -153,10 +153,10 @@ var xNewExpanderWithMnemonic func(string) uintptr | |||
| 153 | 153 | // a keyboard accelerator called a mnemonic. | |
| 154 | 154 | // | |
| 155 | 155 | // Pressing Alt and that key activates the button. | |
| 156 | - | func NewExpanderWithMnemonic(LabelVar string) *Expander { | |
| 156 | + | func NewExpanderWithMnemonic(LabelVar *string) *Expander { | |
| 157 | 157 | var cls *Expander | |
| 158 | 158 | ||
| 159 | - | cret := xNewExpanderWithMnemonic(LabelVar) | |
| 159 | + | cret := xNewExpanderWithMnemonic(core.NullableStringToPtr(LabelVar)) | |
| 160 | 160 | ||
| 161 | 161 | if cret == 0 { | |
| 162 | 162 | return nil | |
| @@ -276,14 +276,14 @@ func (x *Expander) SetExpanded(ExpandedVar bool) { | |||
| 276 | 276 | ||
| 277 | 277 | } | |
| 278 | 278 | ||
| 279 | - | var xExpanderSetLabel func(uintptr, string) | |
| 279 | + | var xExpanderSetLabel func(uintptr, uintptr) | |
| 280 | 280 | ||
| 281 | 281 | // Sets the text of the label of the expander to @label. | |
| 282 | 282 | // | |
| 283 | 283 | // This will also clear any previously set labels. | |
| 284 | - | func (x *Expander) SetLabel(LabelVar string) { | |
| 284 | + | func (x *Expander) SetLabel(LabelVar *string) { | |
| 285 | 285 | ||
| 286 | - | xExpanderSetLabel(x.GoPointer(), LabelVar) | |
| 286 | + | xExpanderSetLabel(x.GoPointer(), core.NullableStringToPtr(LabelVar)) | |
| 287 | 287 | ||
| 288 | 288 | } | |
| 289 | 289 | ||
| @@ -360,7 +360,7 @@ func (x *Expander) GetPropertyExpanded() bool { | |||
| 360 | 360 | func (x *Expander) SetPropertyLabel(value string) { | |
| 361 | 361 | var v gobject.Value | |
| 362 | 362 | v.Init(gobject.TypeStringVal) | |
| 363 | - | v.SetString(value) | |
| 363 | + | v.SetString(&value) | |
| 364 | 364 | x.SetProperty("label", &v) | |
| 365 | 365 | } | |
| 366 | 366 | ||
M v4/gtk/gtkexpression.go +77 -2
| @@ -181,7 +181,52 @@ var xNewCClosureExpression func(types.GType, uintptr, uint, uintptr, uintptr, ui | |||
| 181 | 181 | func NewCClosureExpression(ValueTypeVar types.GType, MarshalVar *gobject.ClosureMarshal, NParamsVar uint, ParamsVar uintptr, CallbackFuncVar *gobject.Callback, UserDataVar uintptr, UserDestroyVar *gobject.ClosureNotify) *CClosureExpression { | |
| 182 | 182 | var cls *CClosureExpression | |
| 183 | 183 | ||
| 184 | - | cret := xNewCClosureExpression(ValueTypeVar, glib.NewCallbackNullable(MarshalVar), NParamsVar, ParamsVar, glib.NewCallback(CallbackFuncVar), UserDataVar, glib.NewCallbackNullable(UserDestroyVar)) | |
| 184 | + | var MarshalVarRef uintptr | |
| 185 | + | if MarshalVar != nil { | |
| 186 | + | MarshalVarPtr := uintptr(unsafe.Pointer(MarshalVar)) | |
| 187 | + | if cbRefPtr, ok := glib.GetCallback(MarshalVarPtr); ok { | |
| 188 | + | MarshalVarRef = cbRefPtr | |
| 189 | + | } else { | |
| 190 | + | fcb := func(arg0 *gobject.Closure, arg1 *gobject.Value, arg2 uint, arg3 []gobject.Value, arg4 uintptr, arg5 uintptr) { | |
| 191 | + | cbFn := *MarshalVar | |
| 192 | + | cbFn(arg0, arg1, arg2, arg3, arg4, arg5) | |
| 193 | + | } | |
| 194 | + | MarshalVarRef = purego.NewCallback(fcb) | |
| 195 | + | glib.SaveCallback(MarshalVarPtr, MarshalVarRef) | |
| 196 | + | } | |
| 197 | + | } | |
| 198 | + | ||
| 199 | + | var CallbackFuncVarRef uintptr | |
| 200 | + | if CallbackFuncVar != nil { | |
| 201 | + | CallbackFuncVarPtr := uintptr(unsafe.Pointer(CallbackFuncVar)) | |
| 202 | + | if cbRefPtr, ok := glib.GetCallback(CallbackFuncVarPtr); ok { | |
| 203 | + | CallbackFuncVarRef = cbRefPtr | |
| 204 | + | } else { | |
| 205 | + | fcb := func() { | |
| 206 | + | cbFn := *CallbackFuncVar | |
| 207 | + | cbFn() | |
| 208 | + | } | |
| 209 | + | CallbackFuncVarRef = purego.NewCallback(fcb) | |
| 210 | + | glib.SaveCallback(CallbackFuncVarPtr, CallbackFuncVarRef) | |
| 211 | + | } | |
| 212 | + | } | |
| 213 | + | ||
| 214 | + | var UserDestroyVarRef uintptr | |
| 215 | + | if UserDestroyVar != nil { | |
| 216 | + | UserDestroyVarPtr := uintptr(unsafe.Pointer(UserDestroyVar)) | |
| 217 | + | if cbRefPtr, ok := glib.GetCallback(UserDestroyVarPtr); ok { | |
| 218 | + | UserDestroyVarRef = cbRefPtr | |
| 219 | + | } else { | |
| 220 | + | fcb := func(arg0 uintptr, arg1 *gobject.Closure) { | |
| 221 | + | cbFn := *UserDestroyVar | |
| 222 | + | cbFn(arg0, arg1) | |
| 223 | + | } | |
| 224 | + | UserDestroyVarRef = purego.NewCallback(fcb) | |
| 225 | + | glib.SaveCallback(UserDestroyVarPtr, UserDestroyVarRef) | |
| 226 | + | } | |
| 227 | + | } | |
| 228 | + | ||
| 229 | + | cret := xNewCClosureExpression(ValueTypeVar, MarshalVarRef, NParamsVar, ParamsVar, CallbackFuncVarRef, UserDataVar, UserDestroyVarRef) | |
| 185 | 230 | ||
| 186 | 231 | if cret == 0 { | |
| 187 | 232 | return nil | |
| @@ -629,7 +674,37 @@ var xExpressionWatch func(uintptr, uintptr, uintptr, uintptr, uintptr) *Expressi | |||
| 629 | 674 | // the @notify will be invoked. | |
| 630 | 675 | func (x *Expression) Watch(ThisVar *gobject.Object, NotifyVar *ExpressionNotify, UserDataVar uintptr, UserDestroyVar *glib.DestroyNotify) *ExpressionWatch { | |
| 631 | 676 | ||
| 632 | - | cret := xExpressionWatch(x.GoPointer(), ThisVar.GoPointer(), glib.NewCallback(NotifyVar), UserDataVar, glib.NewCallback(UserDestroyVar)) | |
| 677 | + | var NotifyVarRef uintptr | |
| 678 | + | if NotifyVar != nil { | |
| 679 | + | NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar)) | |
| 680 | + | if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok { | |
| 681 | + | NotifyVarRef = cbRefPtr | |
| 682 | + | } else { | |
| 683 | + | fcb := func(arg0 uintptr) { | |
| 684 | + | cbFn := *NotifyVar | |
| 685 | + | cbFn(arg0) | |
| 686 | + | } | |
| 687 | + | NotifyVarRef = purego.NewCallback(fcb) | |
| 688 | + | glib.SaveCallback(NotifyVarPtr, NotifyVarRef) | |
| 689 | + | } | |
| 690 | + | } | |
| 691 | + | ||
| 692 | + | var UserDestroyVarRef uintptr | |
| 693 | + | if UserDestroyVar != nil { | |
| 694 | + | UserDestroyVarPtr := uintptr(unsafe.Pointer(UserDestroyVar)) | |
| 695 | + | if cbRefPtr, ok := glib.GetCallback(UserDestroyVarPtr); ok { | |
| 696 | + | UserDestroyVarRef = cbRefPtr | |
| 697 | + | } else { | |
| 698 | + | fcb := func(arg0 uintptr) { | |
| 699 | + | cbFn := *UserDestroyVar | |
| 700 | + | cbFn(arg0) | |
| 701 | + | } | |
| 702 | + | UserDestroyVarRef = purego.NewCallback(fcb) | |
| 703 | + | glib.SaveCallback(UserDestroyVarPtr, UserDestroyVarRef) | |
| 704 | + | } | |
| 705 | + | } | |
| 706 | + | ||
| 707 | + | cret := xExpressionWatch(x.GoPointer(), ThisVar.GoPointer(), NotifyVarRef, UserDataVar, UserDestroyVarRef) | |
| 633 | 708 | return cret | |
| 634 | 709 | } | |
| 635 | 710 | ||
M v4/gtk/gtkfilechooserdialog.go +3 -3
| @@ -208,15 +208,15 @@ func FileChooserDialogNewFromInternalPtr(ptr uintptr) *FileChooserDialog { | |||
| 208 | 208 | return cls | |
| 209 | 209 | } | |
| 210 | 210 | ||
| 211 | - | var xNewFileChooserDialog func(string, uintptr, FileChooserAction, string, ...interface{}) uintptr | |
| 211 | + | var xNewFileChooserDialog func(uintptr, uintptr, FileChooserAction, uintptr, ...interface{}) uintptr | |
| 212 | 212 | ||
| 213 | 213 | // Creates a new `GtkFileChooserDialog`. | |
| 214 | 214 | // | |
| 215 | 215 | // This function is analogous to [ctor@Gtk.Dialog.new_with_buttons]. | |
| 216 | - | func NewFileChooserDialog(TitleVar string, ParentVar *Window, ActionVar FileChooserAction, FirstButtonTextVar string, varArgs ...interface{}) *FileChooserDialog { | |
| 216 | + | func NewFileChooserDialog(TitleVar *string, ParentVar *Window, ActionVar FileChooserAction, FirstButtonTextVar *string, varArgs ...interface{}) *FileChooserDialog { | |
| 217 | 217 | var cls *FileChooserDialog | |
| 218 | 218 | ||
| 219 | - | cret := xNewFileChooserDialog(TitleVar, ParentVar.GoPointer(), ActionVar, FirstButtonTextVar, varArgs...) | |
| 219 | + | cret := xNewFileChooserDialog(core.NullableStringToPtr(TitleVar), ParentVar.GoPointer(), ActionVar, core.NullableStringToPtr(FirstButtonTextVar), varArgs...) | |
| 220 | 220 | ||
| 221 | 221 | if cret == 0 { | |
| 222 | 222 | return nil | |
M v4/gtk/gtkfilechoosernative.go +11 -11
| @@ -191,13 +191,13 @@ func FileChooserNativeNewFromInternalPtr(ptr uintptr) *FileChooserNative { | |||
| 191 | 191 | return cls | |
| 192 | 192 | } | |
| 193 | 193 | ||
| 194 | - | var xNewFileChooserNative func(string, uintptr, FileChooserAction, string, string) uintptr | |
| 194 | + | var xNewFileChooserNative func(uintptr, uintptr, FileChooserAction, uintptr, uintptr) uintptr | |
| 195 | 195 | ||
| 196 | 196 | // Creates a new `GtkFileChooserNative`. | |
| 197 | - | func NewFileChooserNative(TitleVar string, ParentVar *Window, ActionVar FileChooserAction, AcceptLabelVar string, CancelLabelVar string) *FileChooserNative { | |
| 197 | + | func NewFileChooserNative(TitleVar *string, ParentVar *Window, ActionVar FileChooserAction, AcceptLabelVar *string, CancelLabelVar *string) *FileChooserNative { | |
| 198 | 198 | var cls *FileChooserNative | |
| 199 | 199 | ||
| 200 | - | cret := xNewFileChooserNative(TitleVar, ParentVar.GoPointer(), ActionVar, AcceptLabelVar, CancelLabelVar) | |
| 200 | + | cret := xNewFileChooserNative(core.NullableStringToPtr(TitleVar), ParentVar.GoPointer(), ActionVar, core.NullableStringToPtr(AcceptLabelVar), core.NullableStringToPtr(CancelLabelVar)) | |
| 201 | 201 | ||
| 202 | 202 | if cret == 0 { | |
| 203 | 203 | return nil | |
| @@ -225,7 +225,7 @@ func (x *FileChooserNative) GetCancelLabel() string { | |||
| 225 | 225 | return cret | |
| 226 | 226 | } | |
| 227 | 227 | ||
| 228 | - | var xFileChooserNativeSetAcceptLabel func(uintptr, string) | |
| 228 | + | var xFileChooserNativeSetAcceptLabel func(uintptr, uintptr) | |
| 229 | 229 | ||
| 230 | 230 | // Sets the custom label text for the accept button. | |
| 231 | 231 | // | |
| @@ -235,13 +235,13 @@ var xFileChooserNativeSetAcceptLabel func(uintptr, string) | |||
| 235 | 235 | // a keyboard accelerator called a mnemonic. | |
| 236 | 236 | // | |
| 237 | 237 | // Pressing Alt and that key should activate the button. | |
| 238 | - | func (x *FileChooserNative) SetAcceptLabel(AcceptLabelVar string) { | |
| 238 | + | func (x *FileChooserNative) SetAcceptLabel(AcceptLabelVar *string) { | |
| 239 | 239 | ||
| 240 | - | xFileChooserNativeSetAcceptLabel(x.GoPointer(), AcceptLabelVar) | |
| 240 | + | xFileChooserNativeSetAcceptLabel(x.GoPointer(), core.NullableStringToPtr(AcceptLabelVar)) | |
| 241 | 241 | ||
| 242 | 242 | } | |
| 243 | 243 | ||
| 244 | - | var xFileChooserNativeSetCancelLabel func(uintptr, string) | |
| 244 | + | var xFileChooserNativeSetCancelLabel func(uintptr, uintptr) | |
| 245 | 245 | ||
| 246 | 246 | // Sets the custom label text for the cancel button. | |
| 247 | 247 | // | |
| @@ -251,9 +251,9 @@ var xFileChooserNativeSetCancelLabel func(uintptr, string) | |||
| 251 | 251 | // a keyboard accelerator called a mnemonic. | |
| 252 | 252 | // | |
| 253 | 253 | // Pressing Alt and that key should activate the button. | |
| 254 | - | func (x *FileChooserNative) SetCancelLabel(CancelLabelVar string) { | |
| 254 | + | func (x *FileChooserNative) SetCancelLabel(CancelLabelVar *string) { | |
| 255 | 255 | ||
| 256 | - | xFileChooserNativeSetCancelLabel(x.GoPointer(), CancelLabelVar) | |
| 256 | + | xFileChooserNativeSetCancelLabel(x.GoPointer(), core.NullableStringToPtr(CancelLabelVar)) | |
| 257 | 257 | ||
| 258 | 258 | } | |
| 259 | 259 | ||
| @@ -274,7 +274,7 @@ func (c *FileChooserNative) SetGoPointer(ptr uintptr) { | |||
| 274 | 274 | func (x *FileChooserNative) SetPropertyAcceptLabel(value string) { | |
| 275 | 275 | var v gobject.Value | |
| 276 | 276 | v.Init(gobject.TypeStringVal) | |
| 277 | - | v.SetString(value) | |
| 277 | + | v.SetString(&value) | |
| 278 | 278 | x.SetProperty("accept-label", &v) | |
| 279 | 279 | } | |
| 280 | 280 | ||
| @@ -293,7 +293,7 @@ func (x *FileChooserNative) GetPropertyAcceptLabel() string { | |||
| 293 | 293 | func (x *FileChooserNative) SetPropertyCancelLabel(value string) { | |
| 294 | 294 | var v gobject.Value | |
| 295 | 295 | v.Init(gobject.TypeStringVal) | |
| 296 | - | v.SetString(value) | |
| 296 | + | v.SetString(&value) | |
| 297 | 297 | x.SetProperty("cancel-label", &v) | |
| 298 | 298 | } | |
| 299 | 299 | ||
M v4/gtk/gtkfiledialog.go +137 -17
| @@ -181,7 +181,22 @@ var xFileDialogOpen func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||
| 181 | 181 | // The @callback will be called when the dialog is closed. | |
| 182 | 182 | func (x *FileDialog) Open(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 183 | 183 | ||
| 184 | - | xFileDialogOpen(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 184 | + | var CallbackVarRef uintptr | |
| 185 | + | if CallbackVar != nil { | |
| 186 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 187 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 188 | + | CallbackVarRef = cbRefPtr | |
| 189 | + | } else { | |
| 190 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 191 | + | cbFn := *CallbackVar | |
| 192 | + | cbFn(arg0, arg1, arg2) | |
| 193 | + | } | |
| 194 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 195 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 196 | + | } | |
| 197 | + | } | |
| 198 | + | ||
| 199 | + | xFileDialogOpen(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 185 | 200 | ||
| 186 | 201 | } | |
| 187 | 202 | ||
| @@ -221,7 +236,22 @@ var xFileDialogOpenMultiple func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||
| 221 | 236 | // The @callback will be called when the dialog is closed. | |
| 222 | 237 | func (x *FileDialog) OpenMultiple(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 223 | 238 | ||
| 224 | - | xFileDialogOpenMultiple(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 239 | + | var CallbackVarRef uintptr | |
| 240 | + | if CallbackVar != nil { | |
| 241 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 242 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 243 | + | CallbackVarRef = cbRefPtr | |
| 244 | + | } else { | |
| 245 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 246 | + | cbFn := *CallbackVar | |
| 247 | + | cbFn(arg0, arg1, arg2) | |
| 248 | + | } | |
| 249 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 250 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 251 | + | } | |
| 252 | + | } | |
| 253 | + | ||
| 254 | + | xFileDialogOpenMultiple(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 225 | 255 | ||
| 226 | 256 | } | |
| 227 | 257 | ||
| @@ -264,7 +294,22 @@ var xFileDialogOpenMultipleTextFiles func(uintptr, uintptr, uintptr, uintptr, ui | |||
| 264 | 294 | // The @callback will be called when the dialog is closed. | |
| 265 | 295 | func (x *FileDialog) OpenMultipleTextFiles(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 266 | 296 | ||
| 267 | - | xFileDialogOpenMultipleTextFiles(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 297 | + | var CallbackVarRef uintptr | |
| 298 | + | if CallbackVar != nil { | |
| 299 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 300 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 301 | + | CallbackVarRef = cbRefPtr | |
| 302 | + | } else { | |
| 303 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 304 | + | cbFn := *CallbackVar | |
| 305 | + | cbFn(arg0, arg1, arg2) | |
| 306 | + | } | |
| 307 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 308 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 309 | + | } | |
| 310 | + | } | |
| 311 | + | ||
| 312 | + | xFileDialogOpenMultipleTextFiles(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 268 | 313 | ||
| 269 | 314 | } | |
| 270 | 315 | ||
| @@ -303,7 +348,22 @@ var xFileDialogOpenTextFile func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||
| 303 | 348 | // The @callback will be called when the dialog is closed. | |
| 304 | 349 | func (x *FileDialog) OpenTextFile(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 305 | 350 | ||
| 306 | - | xFileDialogOpenTextFile(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 351 | + | var CallbackVarRef uintptr | |
| 352 | + | if CallbackVar != nil { | |
| 353 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 354 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 355 | + | CallbackVarRef = cbRefPtr | |
| 356 | + | } else { | |
| 357 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 358 | + | cbFn := *CallbackVar | |
| 359 | + | cbFn(arg0, arg1, arg2) | |
| 360 | + | } | |
| 361 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 362 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 363 | + | } | |
| 364 | + | } | |
| 365 | + | ||
| 366 | + | xFileDialogOpenTextFile(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 307 | 367 | ||
| 308 | 368 | } | |
| 309 | 369 | ||
| @@ -346,7 +406,22 @@ var xFileDialogSave func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||
| 346 | 406 | // The @callback will be called when the dialog is closed. | |
| 347 | 407 | func (x *FileDialog) Save(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 348 | 408 | ||
| 349 | - | xFileDialogSave(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 409 | + | var CallbackVarRef uintptr | |
| 410 | + | if CallbackVar != nil { | |
| 411 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 412 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 413 | + | CallbackVarRef = cbRefPtr | |
| 414 | + | } else { | |
| 415 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 416 | + | cbFn := *CallbackVar | |
| 417 | + | cbFn(arg0, arg1, arg2) | |
| 418 | + | } | |
| 419 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 420 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 421 | + | } | |
| 422 | + | } | |
| 423 | + | ||
| 424 | + | xFileDialogSave(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 350 | 425 | ||
| 351 | 426 | } | |
| 352 | 427 | ||
| @@ -386,7 +461,22 @@ var xFileDialogSaveTextFile func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||
| 386 | 461 | // The @callback will be called when the dialog is closed. | |
| 387 | 462 | func (x *FileDialog) SaveTextFile(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 388 | 463 | ||
| 389 | - | xFileDialogSaveTextFile(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 464 | + | var CallbackVarRef uintptr | |
| 465 | + | if CallbackVar != nil { | |
| 466 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 467 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 468 | + | CallbackVarRef = cbRefPtr | |
| 469 | + | } else { | |
| 470 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 471 | + | cbFn := *CallbackVar | |
| 472 | + | cbFn(arg0, arg1, arg2) | |
| 473 | + | } | |
| 474 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 475 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 476 | + | } | |
| 477 | + | } | |
| 478 | + | ||
| 479 | + | xFileDialogSaveTextFile(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 390 | 480 | ||
| 391 | 481 | } | |
| 392 | 482 | ||
| @@ -436,7 +526,22 @@ var xFileDialogSelectFolder func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||
| 436 | 526 | // The @callback will be called when the dialog is closed. | |
| 437 | 527 | func (x *FileDialog) SelectFolder(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 438 | 528 | ||
| 439 | - | xFileDialogSelectFolder(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 529 | + | var CallbackVarRef uintptr | |
| 530 | + | if CallbackVar != nil { | |
| 531 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 532 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 533 | + | CallbackVarRef = cbRefPtr | |
| 534 | + | } else { | |
| 535 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 536 | + | cbFn := *CallbackVar | |
| 537 | + | cbFn(arg0, arg1, arg2) | |
| 538 | + | } | |
| 539 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 540 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 541 | + | } | |
| 542 | + | } | |
| 543 | + | ||
| 544 | + | xFileDialogSelectFolder(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 440 | 545 | ||
| 441 | 546 | } | |
| 442 | 547 | ||
| @@ -477,7 +582,22 @@ var xFileDialogSelectMultipleFolders func(uintptr, uintptr, uintptr, uintptr, ui | |||
| 477 | 582 | // The @callback will be called when the dialog is closed. | |
| 478 | 583 | func (x *FileDialog) SelectMultipleFolders(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 479 | 584 | ||
| 480 | - | xFileDialogSelectMultipleFolders(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 585 | + | var CallbackVarRef uintptr | |
| 586 | + | if CallbackVar != nil { | |
| 587 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 588 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 589 | + | CallbackVarRef = cbRefPtr | |
| 590 | + | } else { | |
| 591 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 592 | + | cbFn := *CallbackVar | |
| 593 | + | cbFn(arg0, arg1, arg2) | |
| 594 | + | } | |
| 595 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 596 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 597 | + | } | |
| 598 | + | } | |
| 599 | + | ||
| 600 | + | xFileDialogSelectMultipleFolders(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 481 | 601 | ||
| 482 | 602 | } | |
| 483 | 603 | ||
| @@ -505,16 +625,16 @@ func (x *FileDialog) SelectMultipleFoldersFinish(ResultVar gio.AsyncResult) (*gi | |||
| 505 | 625 | ||
| 506 | 626 | } | |
| 507 | 627 | ||
| 508 | - | var xFileDialogSetAcceptLabel func(uintptr, string) | |
| 628 | + | var xFileDialogSetAcceptLabel func(uintptr, uintptr) | |
| 509 | 629 | ||
| 510 | 630 | // Sets the label shown on the file chooser's accept button. | |
| 511 | 631 | // | |
| 512 | 632 | // Leaving the accept label unset or setting it as `NULL` will | |
| 513 | 633 | // fall back to a default label, depending on what API is used | |
| 514 | 634 | // to launch the file dialog. | |
| 515 | - | func (x *FileDialog) SetAcceptLabel(AcceptLabelVar string) { | |
| 635 | + | func (x *FileDialog) SetAcceptLabel(AcceptLabelVar *string) { | |
| 516 | 636 | ||
| 517 | - | xFileDialogSetAcceptLabel(x.GoPointer(), AcceptLabelVar) | |
| 637 | + | xFileDialogSetAcceptLabel(x.GoPointer(), core.NullableStringToPtr(AcceptLabelVar)) | |
| 518 | 638 | ||
| 519 | 639 | } | |
| 520 | 640 | ||
| @@ -567,7 +687,7 @@ func (x *FileDialog) SetInitialFolder(FolderVar gio.File) { | |||
| 567 | 687 | ||
| 568 | 688 | } | |
| 569 | 689 | ||
| 570 | - | var xFileDialogSetInitialName func(uintptr, string) | |
| 690 | + | var xFileDialogSetInitialName func(uintptr, uintptr) | |
| 571 | 691 | ||
| 572 | 692 | // Sets the filename that will be initially selected. | |
| 573 | 693 | // | |
| @@ -577,9 +697,9 @@ var xFileDialogSetInitialName func(uintptr, string) | |||
| 577 | 697 | // If a file with this name already exists in the directory set | |
| 578 | 698 | // via [property@Gtk.FileDialog:initial-folder], the dialog will | |
| 579 | 699 | // preselect it. | |
| 580 | - | func (x *FileDialog) SetInitialName(NameVar string) { | |
| 700 | + | func (x *FileDialog) SetInitialName(NameVar *string) { | |
| 581 | 701 | ||
| 582 | - | xFileDialogSetInitialName(x.GoPointer(), NameVar) | |
| 702 | + | xFileDialogSetInitialName(x.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 583 | 703 | ||
| 584 | 704 | } | |
| 585 | 705 | ||
| @@ -618,7 +738,7 @@ func (c *FileDialog) SetGoPointer(ptr uintptr) { | |||
| 618 | 738 | func (x *FileDialog) SetPropertyAcceptLabel(value string) { | |
| 619 | 739 | var v gobject.Value | |
| 620 | 740 | v.Init(gobject.TypeStringVal) | |
| 621 | - | v.SetString(value) | |
| 741 | + | v.SetString(&value) | |
| 622 | 742 | x.SetProperty("accept-label", &v) | |
| 623 | 743 | } | |
| 624 | 744 | ||
| @@ -637,7 +757,7 @@ func (x *FileDialog) GetPropertyAcceptLabel() string { | |||
| 637 | 757 | func (x *FileDialog) SetPropertyInitialName(value string) { | |
| 638 | 758 | var v gobject.Value | |
| 639 | 759 | v.Init(gobject.TypeStringVal) | |
| 640 | - | v.SetString(value) | |
| 760 | + | v.SetString(&value) | |
| 641 | 761 | x.SetProperty("initial-name", &v) | |
| 642 | 762 | } | |
| 643 | 763 | ||
| @@ -673,7 +793,7 @@ func (x *FileDialog) GetPropertyModal() bool { | |||
| 673 | 793 | func (x *FileDialog) SetPropertyTitle(value string) { | |
| 674 | 794 | var v gobject.Value | |
| 675 | 795 | v.Init(gobject.TypeStringVal) | |
| 676 | - | v.SetString(value) | |
| 796 | + | v.SetString(&value) | |
| 677 | 797 | x.SetProperty("title", &v) | |
| 678 | 798 | } | |
| 679 | 799 | ||
M v4/gtk/gtkfilefilter.go +4 -4
| @@ -202,15 +202,15 @@ func (x *FileFilter) GetName() string { | |||
| 202 | 202 | return cret | |
| 203 | 203 | } | |
| 204 | 204 | ||
| 205 | - | var xFileFilterSetName func(uintptr, string) | |
| 205 | + | var xFileFilterSetName func(uintptr, uintptr) | |
| 206 | 206 | ||
| 207 | 207 | // Sets a human-readable name of the filter. | |
| 208 | 208 | // | |
| 209 | 209 | // This is the string that will be displayed in the user interface | |
| 210 | 210 | // if there is a selectable list of filters. | |
| 211 | - | func (x *FileFilter) SetName(NameVar string) { | |
| 211 | + | func (x *FileFilter) SetName(NameVar *string) { | |
| 212 | 212 | ||
| 213 | - | xFileFilterSetName(x.GoPointer(), NameVar) | |
| 213 | + | xFileFilterSetName(x.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 214 | 214 | ||
| 215 | 215 | } | |
| 216 | 216 | ||
| @@ -251,7 +251,7 @@ func (x *FileFilter) SetPropertyMimeTypes(value []string) { | |||
| 251 | 251 | func (x *FileFilter) SetPropertyName(value string) { | |
| 252 | 252 | var v gobject.Value | |
| 253 | 253 | v.Init(gobject.TypeStringVal) | |
| 254 | - | v.SetString(value) | |
| 254 | + | v.SetString(&value) | |
| 255 | 255 | x.SetProperty("name", &v) | |
| 256 | 256 | } | |
| 257 | 257 | ||
M v4/gtk/gtkfilelauncher.go +32 -2
| @@ -108,7 +108,22 @@ var xFileLauncherLaunch func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||
| 108 | 108 | // This may present an app chooser dialog to the user. | |
| 109 | 109 | func (x *FileLauncher) Launch(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 110 | 110 | ||
| 111 | - | xFileLauncherLaunch(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 111 | + | var CallbackVarRef uintptr | |
| 112 | + | if CallbackVar != nil { | |
| 113 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 114 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 115 | + | CallbackVarRef = cbRefPtr | |
| 116 | + | } else { | |
| 117 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 118 | + | cbFn := *CallbackVar | |
| 119 | + | cbFn(arg0, arg1, arg2) | |
| 120 | + | } | |
| 121 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 122 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 123 | + | } | |
| 124 | + | } | |
| 125 | + | ||
| 126 | + | xFileLauncherLaunch(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 112 | 127 | ||
| 113 | 128 | } | |
| 114 | 129 | ||
| @@ -135,7 +150,22 @@ var xFileLauncherOpenContainingFolder func(uintptr, uintptr, uintptr, uintptr, u | |||
| 135 | 150 | // is e.g. a http:// uri. | |
| 136 | 151 | func (x *FileLauncher) OpenContainingFolder(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 137 | 152 | ||
| 138 | - | xFileLauncherOpenContainingFolder(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 153 | + | var CallbackVarRef uintptr | |
| 154 | + | if CallbackVar != nil { | |
| 155 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 156 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 157 | + | CallbackVarRef = cbRefPtr | |
| 158 | + | } else { | |
| 159 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 160 | + | cbFn := *CallbackVar | |
| 161 | + | cbFn(arg0, arg1, arg2) | |
| 162 | + | } | |
| 163 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 164 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 165 | + | } | |
| 166 | + | } | |
| 167 | + | ||
| 168 | + | xFileLauncherOpenContainingFolder(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 139 | 169 | ||
| 140 | 170 | } | |
| 141 | 171 | ||
M v4/gtk/gtkflowbox.go +109 -4
| @@ -198,7 +198,37 @@ var xFlowBoxBindModel func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||
| 198 | 198 | // should be implemented by the model. | |
| 199 | 199 | func (x *FlowBox) BindModel(ModelVar gio.ListModel, CreateWidgetFuncVar *FlowBoxCreateWidgetFunc, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) { | |
| 200 | 200 | ||
| 201 | - | xFlowBoxBindModel(x.GoPointer(), ModelVar.GoPointer(), glib.NewCallback(CreateWidgetFuncVar), UserDataVar, glib.NewCallback(UserDataFreeFuncVar)) | |
| 201 | + | var CreateWidgetFuncVarRef uintptr | |
| 202 | + | if CreateWidgetFuncVar != nil { | |
| 203 | + | CreateWidgetFuncVarPtr := uintptr(unsafe.Pointer(CreateWidgetFuncVar)) | |
| 204 | + | if cbRefPtr, ok := glib.GetCallback(CreateWidgetFuncVarPtr); ok { | |
| 205 | + | CreateWidgetFuncVarRef = cbRefPtr | |
| 206 | + | } else { | |
| 207 | + | fcb := func(arg0 uintptr, arg1 uintptr) uintptr { | |
| 208 | + | cbFn := *CreateWidgetFuncVar | |
| 209 | + | return cbFn(arg0, arg1) | |
| 210 | + | } | |
| 211 | + | CreateWidgetFuncVarRef = purego.NewCallback(fcb) | |
| 212 | + | glib.SaveCallback(CreateWidgetFuncVarPtr, CreateWidgetFuncVarRef) | |
| 213 | + | } | |
| 214 | + | } | |
| 215 | + | ||
| 216 | + | var UserDataFreeFuncVarRef uintptr | |
| 217 | + | if UserDataFreeFuncVar != nil { | |
| 218 | + | UserDataFreeFuncVarPtr := uintptr(unsafe.Pointer(UserDataFreeFuncVar)) | |
| 219 | + | if cbRefPtr, ok := glib.GetCallback(UserDataFreeFuncVarPtr); ok { | |
| 220 | + | UserDataFreeFuncVarRef = cbRefPtr | |
| 221 | + | } else { | |
| 222 | + | fcb := func(arg0 uintptr) { | |
| 223 | + | cbFn := *UserDataFreeFuncVar | |
| 224 | + | cbFn(arg0) | |
| 225 | + | } | |
| 226 | + | UserDataFreeFuncVarRef = purego.NewCallback(fcb) | |
| 227 | + | glib.SaveCallback(UserDataFreeFuncVarPtr, UserDataFreeFuncVarRef) | |
| 228 | + | } | |
| 229 | + | } | |
| 230 | + | ||
| 231 | + | xFlowBoxBindModel(x.GoPointer(), ModelVar.GoPointer(), CreateWidgetFuncVarRef, UserDataVar, UserDataFreeFuncVarRef) | |
| 202 | 232 | ||
| 203 | 233 | } | |
| 204 | 234 | ||
| @@ -414,7 +444,22 @@ var xFlowBoxSelectedForeach func(uintptr, uintptr, uintptr) | |||
| 414 | 444 | // this function. | |
| 415 | 445 | func (x *FlowBox) SelectedForeach(FuncVar *FlowBoxForeachFunc, DataVar uintptr) { | |
| 416 | 446 | ||
| 417 | - | xFlowBoxSelectedForeach(x.GoPointer(), glib.NewCallback(FuncVar), DataVar) | |
| 447 | + | var FuncVarRef uintptr | |
| 448 | + | if FuncVar != nil { | |
| 449 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 450 | + | if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok { | |
| 451 | + | FuncVarRef = cbRefPtr | |
| 452 | + | } else { | |
| 453 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 454 | + | cbFn := *FuncVar | |
| 455 | + | cbFn(arg0, arg1, arg2) | |
| 456 | + | } | |
| 457 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 458 | + | glib.SaveCallback(FuncVarPtr, FuncVarRef) | |
| 459 | + | } | |
| 460 | + | } | |
| 461 | + | ||
| 462 | + | xFlowBoxSelectedForeach(x.GoPointer(), FuncVarRef, DataVar) | |
| 418 | 463 | ||
| 419 | 464 | } | |
| 420 | 465 | ||
| @@ -454,7 +499,37 @@ var xFlowBoxSetFilterFunc func(uintptr, uintptr, uintptr, uintptr) | |||
| 454 | 499 | // (see [method@Gtk.FlowBox.bind_model]). | |
| 455 | 500 | func (x *FlowBox) SetFilterFunc(FilterFuncVar *FlowBoxFilterFunc, UserDataVar uintptr, DestroyVar *glib.DestroyNotify) { | |
| 456 | 501 | ||
| 457 | - | xFlowBoxSetFilterFunc(x.GoPointer(), glib.NewCallbackNullable(FilterFuncVar), UserDataVar, glib.NewCallback(DestroyVar)) | |
| 502 | + | var FilterFuncVarRef uintptr | |
| 503 | + | if FilterFuncVar != nil { | |
| 504 | + | FilterFuncVarPtr := uintptr(unsafe.Pointer(FilterFuncVar)) | |
| 505 | + | if cbRefPtr, ok := glib.GetCallback(FilterFuncVarPtr); ok { | |
| 506 | + | FilterFuncVarRef = cbRefPtr | |
| 507 | + | } else { | |
| 508 | + | fcb := func(arg0 uintptr, arg1 uintptr) bool { | |
| 509 | + | cbFn := *FilterFuncVar | |
| 510 | + | return cbFn(arg0, arg1) | |
| 511 | + | } | |
| 512 | + | FilterFuncVarRef = purego.NewCallback(fcb) | |
| 513 | + | glib.SaveCallback(FilterFuncVarPtr, FilterFuncVarRef) | |
| 514 | + | } | |
| 515 | + | } | |
| 516 | + | ||
| 517 | + | var DestroyVarRef uintptr | |
| 518 | + | if DestroyVar != nil { | |
| 519 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 520 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 521 | + | DestroyVarRef = cbRefPtr | |
| 522 | + | } else { | |
| 523 | + | fcb := func(arg0 uintptr) { | |
| 524 | + | cbFn := *DestroyVar | |
| 525 | + | cbFn(arg0) | |
| 526 | + | } | |
| 527 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 528 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 529 | + | } | |
| 530 | + | } | |
| 531 | + | ||
| 532 | + | xFlowBoxSetFilterFunc(x.GoPointer(), FilterFuncVarRef, UserDataVar, DestroyVarRef) | |
| 458 | 533 | ||
| 459 | 534 | } | |
| 460 | 535 | ||
| @@ -544,7 +619,37 @@ var xFlowBoxSetSortFunc func(uintptr, uintptr, uintptr, uintptr) | |||
| 544 | 619 | // (see [method@Gtk.FlowBox.bind_model]). | |
| 545 | 620 | func (x *FlowBox) SetSortFunc(SortFuncVar *FlowBoxSortFunc, UserDataVar uintptr, DestroyVar *glib.DestroyNotify) { | |
| 546 | 621 | ||
| 547 | - | xFlowBoxSetSortFunc(x.GoPointer(), glib.NewCallbackNullable(SortFuncVar), UserDataVar, glib.NewCallback(DestroyVar)) | |
| 622 | + | var SortFuncVarRef uintptr | |
| 623 | + | if SortFuncVar != nil { | |
| 624 | + | SortFuncVarPtr := uintptr(unsafe.Pointer(SortFuncVar)) | |
| 625 | + | if cbRefPtr, ok := glib.GetCallback(SortFuncVarPtr); ok { | |
| 626 | + | SortFuncVarRef = cbRefPtr | |
| 627 | + | } else { | |
| 628 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 629 | + | cbFn := *SortFuncVar | |
| 630 | + | return cbFn(arg0, arg1, arg2) | |
| 631 | + | } | |
| 632 | + | SortFuncVarRef = purego.NewCallback(fcb) | |
| 633 | + | glib.SaveCallback(SortFuncVarPtr, SortFuncVarRef) | |
| 634 | + | } | |
| 635 | + | } | |
| 636 | + | ||
| 637 | + | var DestroyVarRef uintptr | |
| 638 | + | if DestroyVar != nil { | |
| 639 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 640 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 641 | + | DestroyVarRef = cbRefPtr | |
| 642 | + | } else { | |
| 643 | + | fcb := func(arg0 uintptr) { | |
| 644 | + | cbFn := *DestroyVar | |
| 645 | + | cbFn(arg0) | |
| 646 | + | } | |
| 647 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 648 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 649 | + | } | |
| 650 | + | } | |
| 651 | + | ||
| 652 | + | xFlowBoxSetSortFunc(x.GoPointer(), SortFuncVarRef, UserDataVar, DestroyVarRef) | |
| 548 | 653 | ||
| 549 | 654 | } | |
| 550 | 655 | ||
M v4/gtk/gtkfontbutton.go +1 -1
| @@ -193,7 +193,7 @@ func (x *FontButton) GetPropertyModal() bool { | |||
| 193 | 193 | func (x *FontButton) SetPropertyTitle(value string) { | |
| 194 | 194 | var v gobject.Value | |
| 195 | 195 | v.Init(gobject.TypeStringVal) | |
| 196 | - | v.SetString(value) | |
| 196 | + | v.SetString(&value) | |
| 197 | 197 | x.SetProperty("title", &v) | |
| 198 | 198 | } | |
| 199 | 199 | ||
M v4/gtk/gtkfontchooser.go +3 -3
| @@ -507,7 +507,7 @@ func (x *FontChooserBase) SetPropertyFont(value string) { | |||
| 507 | 507 | obj.Ptr = x.GoPointer() | |
| 508 | 508 | var v gobject.Value | |
| 509 | 509 | v.Init(gobject.TypeStringVal) | |
| 510 | - | v.SetString(value) | |
| 510 | + | v.SetString(&value) | |
| 511 | 511 | obj.SetProperty("font", &v) | |
| 512 | 512 | } | |
| 513 | 513 | ||
| @@ -562,7 +562,7 @@ func (x *FontChooserBase) SetPropertyLanguage(value string) { | |||
| 562 | 562 | obj.Ptr = x.GoPointer() | |
| 563 | 563 | var v gobject.Value | |
| 564 | 564 | v.Init(gobject.TypeStringVal) | |
| 565 | - | v.SetString(value) | |
| 565 | + | v.SetString(&value) | |
| 566 | 566 | obj.SetProperty("language", &v) | |
| 567 | 567 | } | |
| 568 | 568 | ||
| @@ -583,7 +583,7 @@ func (x *FontChooserBase) SetPropertyPreviewText(value string) { | |||
| 583 | 583 | obj.Ptr = x.GoPointer() | |
| 584 | 584 | var v gobject.Value | |
| 585 | 585 | v.Init(gobject.TypeStringVal) | |
| 586 | - | v.SetString(value) | |
| 586 | + | v.SetString(&value) | |
| 587 | 587 | obj.SetProperty("preview-text", &v) | |
| 588 | 588 | } | |
| 589 | 589 | ||
M v4/gtk/gtkfontchooserdialog.go +3 -3
| @@ -52,13 +52,13 @@ func FontChooserDialogNewFromInternalPtr(ptr uintptr) *FontChooserDialog { | |||
| 52 | 52 | return cls | |
| 53 | 53 | } | |
| 54 | 54 | ||
| 55 | - | var xNewFontChooserDialog func(string, uintptr) uintptr | |
| 55 | + | var xNewFontChooserDialog func(uintptr, uintptr) uintptr | |
| 56 | 56 | ||
| 57 | 57 | // Creates a new `GtkFontChooserDialog`. | |
| 58 | - | func NewFontChooserDialog(TitleVar string, ParentVar *Window) *FontChooserDialog { | |
| 58 | + | func NewFontChooserDialog(TitleVar *string, ParentVar *Window) *FontChooserDialog { | |
| 59 | 59 | var cls *FontChooserDialog | |
| 60 | 60 | ||
| 61 | - | cret := xNewFontChooserDialog(TitleVar, ParentVar.GoPointer()) | |
| 61 | + | cret := xNewFontChooserDialog(core.NullableStringToPtr(TitleVar), ParentVar.GoPointer()) | |
| 62 | 62 | ||
| 63 | 63 | if cret == 0 { | |
| 64 | 64 | return nil | |
M v4/gtk/gtkfontdialog.go +65 -5
| @@ -76,7 +76,22 @@ var xFontDialogChooseFace func(uintptr, uintptr, uintptr, uintptr, uintptr, uint | |||
| 76 | 76 | // A font face represents a font family and style, but no specific font size. | |
| 77 | 77 | func (x *FontDialog) ChooseFace(ParentVar *Window, InitialValueVar *pango.FontFace, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 78 | 78 | ||
| 79 | - | xFontDialogChooseFace(x.GoPointer(), ParentVar.GoPointer(), InitialValueVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 79 | + | var CallbackVarRef uintptr | |
| 80 | + | if CallbackVar != nil { | |
| 81 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 82 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 83 | + | CallbackVarRef = cbRefPtr | |
| 84 | + | } else { | |
| 85 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 86 | + | cbFn := *CallbackVar | |
| 87 | + | cbFn(arg0, arg1, arg2) | |
| 88 | + | } | |
| 89 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 90 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 91 | + | } | |
| 92 | + | } | |
| 93 | + | ||
| 94 | + | xFontDialogChooseFace(x.GoPointer(), ParentVar.GoPointer(), InitialValueVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 80 | 95 | ||
| 81 | 96 | } | |
| 82 | 97 | ||
| @@ -111,7 +126,22 @@ var xFontDialogChooseFamily func(uintptr, uintptr, uintptr, uintptr, uintptr, ui | |||
| 111 | 126 | // The font chooser dialog will be set up for selecting a font family. | |
| 112 | 127 | func (x *FontDialog) ChooseFamily(ParentVar *Window, InitialValueVar *pango.FontFamily, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 113 | 128 | ||
| 114 | - | xFontDialogChooseFamily(x.GoPointer(), ParentVar.GoPointer(), InitialValueVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 129 | + | var CallbackVarRef uintptr | |
| 130 | + | if CallbackVar != nil { | |
| 131 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 132 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 133 | + | CallbackVarRef = cbRefPtr | |
| 134 | + | } else { | |
| 135 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 136 | + | cbFn := *CallbackVar | |
| 137 | + | cbFn(arg0, arg1, arg2) | |
| 138 | + | } | |
| 139 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 140 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 141 | + | } | |
| 142 | + | } | |
| 143 | + | ||
| 144 | + | xFontDialogChooseFamily(x.GoPointer(), ParentVar.GoPointer(), InitialValueVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 115 | 145 | ||
| 116 | 146 | } | |
| 117 | 147 | ||
| @@ -149,7 +179,22 @@ var xFontDialogChooseFont func(uintptr, uintptr, *pango.FontDescription, uintptr | |||
| 149 | 179 | // use [method@Gtk.FontDialog.choose_font_and_features] instead. | |
| 150 | 180 | func (x *FontDialog) ChooseFont(ParentVar *Window, InitialValueVar *pango.FontDescription, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 151 | 181 | ||
| 152 | - | xFontDialogChooseFont(x.GoPointer(), ParentVar.GoPointer(), InitialValueVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 182 | + | var CallbackVarRef uintptr | |
| 183 | + | if CallbackVar != nil { | |
| 184 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 185 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 186 | + | CallbackVarRef = cbRefPtr | |
| 187 | + | } else { | |
| 188 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 189 | + | cbFn := *CallbackVar | |
| 190 | + | cbFn(arg0, arg1, arg2) | |
| 191 | + | } | |
| 192 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 193 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 194 | + | } | |
| 195 | + | } | |
| 196 | + | ||
| 197 | + | xFontDialogChooseFont(x.GoPointer(), ParentVar.GoPointer(), InitialValueVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 153 | 198 | ||
| 154 | 199 | } | |
| 155 | 200 | ||
| @@ -164,7 +209,22 @@ var xFontDialogChooseFontAndFeatures func(uintptr, uintptr, *pango.FontDescripti | |||
| 164 | 209 | // enabling glyph variants or ligatures. | |
| 165 | 210 | func (x *FontDialog) ChooseFontAndFeatures(ParentVar *Window, InitialValueVar *pango.FontDescription, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 166 | 211 | ||
| 167 | - | xFontDialogChooseFontAndFeatures(x.GoPointer(), ParentVar.GoPointer(), InitialValueVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 212 | + | var CallbackVarRef uintptr | |
| 213 | + | if CallbackVar != nil { | |
| 214 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 215 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 216 | + | CallbackVarRef = cbRefPtr | |
| 217 | + | } else { | |
| 218 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 219 | + | cbFn := *CallbackVar | |
| 220 | + | cbFn(arg0, arg1, arg2) | |
| 221 | + | } | |
| 222 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 223 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 224 | + | } | |
| 225 | + | } | |
| 226 | + | ||
| 227 | + | xFontDialogChooseFontAndFeatures(x.GoPointer(), ParentVar.GoPointer(), InitialValueVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 168 | 228 | ||
| 169 | 229 | } | |
| 170 | 230 | ||
| @@ -372,7 +432,7 @@ func (x *FontDialog) GetPropertyModal() bool { | |||
| 372 | 432 | func (x *FontDialog) SetPropertyTitle(value string) { | |
| 373 | 433 | var v gobject.Value | |
| 374 | 434 | v.Init(gobject.TypeStringVal) | |
| 375 | - | v.SetString(value) | |
| 435 | + | v.SetString(&value) | |
| 376 | 436 | x.SetProperty("title", &v) | |
| 377 | 437 | } | |
| 378 | 438 | ||
M v4/gtk/gtkfontdialogbutton.go +4 -4
| @@ -212,12 +212,12 @@ func (x *FontDialogButton) SetFontDesc(FontDescVar *pango.FontDescription) { | |||
| 212 | 212 | ||
| 213 | 213 | } | |
| 214 | 214 | ||
| 215 | - | var xFontDialogButtonSetFontFeatures func(uintptr, string) | |
| 215 | + | var xFontDialogButtonSetFontFeatures func(uintptr, uintptr) | |
| 216 | 216 | ||
| 217 | 217 | // Sets the font features of the button. | |
| 218 | - | func (x *FontDialogButton) SetFontFeatures(FontFeaturesVar string) { | |
| 218 | + | func (x *FontDialogButton) SetFontFeatures(FontFeaturesVar *string) { | |
| 219 | 219 | ||
| 220 | - | xFontDialogButtonSetFontFeatures(x.GoPointer(), FontFeaturesVar) | |
| 220 | + | xFontDialogButtonSetFontFeatures(x.GoPointer(), core.NullableStringToPtr(FontFeaturesVar)) | |
| 221 | 221 | ||
| 222 | 222 | } | |
| 223 | 223 | ||
| @@ -313,7 +313,7 @@ func (x *FontDialogButton) GetPropertyFontDesc() uintptr { | |||
| 313 | 313 | func (x *FontDialogButton) SetPropertyFontFeatures(value string) { | |
| 314 | 314 | var v gobject.Value | |
| 315 | 315 | v.Init(gobject.TypeStringVal) | |
| 316 | - | v.SetString(value) | |
| 316 | + | v.SetString(&value) | |
| 317 | 317 | x.SetProperty("font-features", &v) | |
| 318 | 318 | } | |
| 319 | 319 | ||
M v4/gtk/gtkframe.go +7 -7
| @@ -112,15 +112,15 @@ func FrameNewFromInternalPtr(ptr uintptr) *Frame { | |||
| 112 | 112 | return cls | |
| 113 | 113 | } | |
| 114 | 114 | ||
| 115 | - | var xNewFrame func(string) uintptr | |
| 115 | + | var xNewFrame func(uintptr) uintptr | |
| 116 | 116 | ||
| 117 | 117 | // Creates a new `GtkFrame`, with optional label @label. | |
| 118 | 118 | // | |
| 119 | 119 | // If @label is %NULL, the label is omitted. | |
| 120 | - | func NewFrame(LabelVar string) *Frame { | |
| 120 | + | func NewFrame(LabelVar *string) *Frame { | |
| 121 | 121 | var cls *Frame | |
| 122 | 122 | ||
| 123 | - | cret := xNewFrame(LabelVar) | |
| 123 | + | cret := xNewFrame(core.NullableStringToPtr(LabelVar)) | |
| 124 | 124 | ||
| 125 | 125 | if cret == 0 { | |
| 126 | 126 | return nil | |
| @@ -195,13 +195,13 @@ func (x *Frame) SetChild(ChildVar *Widget) { | |||
| 195 | 195 | ||
| 196 | 196 | } | |
| 197 | 197 | ||
| 198 | - | var xFrameSetLabel func(uintptr, string) | |
| 198 | + | var xFrameSetLabel func(uintptr, uintptr) | |
| 199 | 199 | ||
| 200 | 200 | // Creates a new `GtkLabel` with the @label and sets it as the frame's | |
| 201 | 201 | // label widget. | |
| 202 | - | func (x *Frame) SetLabel(LabelVar string) { | |
| 202 | + | func (x *Frame) SetLabel(LabelVar *string) { | |
| 203 | 203 | ||
| 204 | - | xFrameSetLabel(x.GoPointer(), LabelVar) | |
| 204 | + | xFrameSetLabel(x.GoPointer(), core.NullableStringToPtr(LabelVar)) | |
| 205 | 205 | ||
| 206 | 206 | } | |
| 207 | 207 | ||
| @@ -244,7 +244,7 @@ func (c *Frame) SetGoPointer(ptr uintptr) { | |||
| 244 | 244 | func (x *Frame) SetPropertyLabel(value string) { | |
| 245 | 245 | var v gobject.Value | |
| 246 | 246 | v.Init(gobject.TypeStringVal) | |
| 247 | - | v.SetString(value) | |
| 247 | + | v.SetString(&value) | |
| 248 | 248 | x.SetProperty("label", &v) | |
| 249 | 249 | } | |
| 250 | 250 | ||
M v4/gtk/gtkheaderbar.go +4 -4
| @@ -201,7 +201,7 @@ func (x *HeaderBar) Remove(ChildVar *Widget) { | |||
| 201 | 201 | ||
| 202 | 202 | } | |
| 203 | 203 | ||
| 204 | - | var xHeaderBarSetDecorationLayout func(uintptr, string) | |
| 204 | + | var xHeaderBarSetDecorationLayout func(uintptr, uintptr) | |
| 205 | 205 | ||
| 206 | 206 | // Sets the decoration layout for this header bar. | |
| 207 | 207 | // | |
| @@ -220,9 +220,9 @@ var xHeaderBarSetDecorationLayout func(uintptr, string) | |||
| 220 | 220 | // | |
| 221 | 221 | // For example, “icon:minimize,maximize,close” specifies an icon | |
| 222 | 222 | // on the left, and minimize, maximize and close buttons on the right. | |
| 223 | - | func (x *HeaderBar) SetDecorationLayout(LayoutVar string) { | |
| 223 | + | func (x *HeaderBar) SetDecorationLayout(LayoutVar *string) { | |
| 224 | 224 | ||
| 225 | - | xHeaderBarSetDecorationLayout(x.GoPointer(), LayoutVar) | |
| 225 | + | xHeaderBarSetDecorationLayout(x.GoPointer(), core.NullableStringToPtr(LayoutVar)) | |
| 226 | 226 | ||
| 227 | 227 | } | |
| 228 | 228 | ||
| @@ -288,7 +288,7 @@ func (c *HeaderBar) SetGoPointer(ptr uintptr) { | |||
| 288 | 288 | func (x *HeaderBar) SetPropertyDecorationLayout(value string) { | |
| 289 | 289 | var v gobject.Value | |
| 290 | 290 | v.Init(gobject.TypeStringVal) | |
| 291 | - | v.SetString(value) | |
| 291 | + | v.SetString(&value) | |
| 292 | 292 | x.SetProperty("decoration-layout", &v) | |
| 293 | 293 | } | |
| 294 | 294 | ||
M v4/gtk/gtkiconpaintable.go +1 -1
| @@ -124,7 +124,7 @@ func (c *IconPaintable) SetGoPointer(ptr uintptr) { | |||
| 124 | 124 | func (x *IconPaintable) SetPropertyIconName(value string) { | |
| 125 | 125 | var v gobject.Value | |
| 126 | 126 | v.Init(gobject.TypeStringVal) | |
| 127 | - | v.SetString(value) | |
| 127 | + | v.SetString(&value) | |
| 128 | 128 | x.SetProperty("icon-name", &v) | |
| 129 | 129 | } | |
| 130 | 130 | ||
M v4/gtk/gtkicontheme.go +4 -4
| @@ -343,16 +343,16 @@ func (x *IconTheme) SetSearchPath(PathVar []string) { | |||
| 343 | 343 | ||
| 344 | 344 | } | |
| 345 | 345 | ||
| 346 | - | var xIconThemeSetThemeName func(uintptr, string) | |
| 346 | + | var xIconThemeSetThemeName func(uintptr, uintptr) | |
| 347 | 347 | ||
| 348 | 348 | // Sets the name of the icon theme that the `GtkIconTheme` object uses | |
| 349 | 349 | // overriding system configuration. | |
| 350 | 350 | // | |
| 351 | 351 | // This function cannot be called on the icon theme objects returned | |
| 352 | 352 | // from [func@Gtk.IconTheme.get_for_display]. | |
| 353 | - | func (x *IconTheme) SetThemeName(ThemeNameVar string) { | |
| 353 | + | func (x *IconTheme) SetThemeName(ThemeNameVar *string) { | |
| 354 | 354 | ||
| 355 | - | xIconThemeSetThemeName(x.GoPointer(), ThemeNameVar) | |
| 355 | + | xIconThemeSetThemeName(x.GoPointer(), core.NullableStringToPtr(ThemeNameVar)) | |
| 356 | 356 | ||
| 357 | 357 | } | |
| 358 | 358 | ||
| @@ -444,7 +444,7 @@ func (x *IconTheme) GetPropertySearchPath() []string { | |||
| 444 | 444 | func (x *IconTheme) SetPropertyThemeName(value string) { | |
| 445 | 445 | var v gobject.Value | |
| 446 | 446 | v.Init(gobject.TypeStringVal) | |
| 447 | - | v.SetString(value) | |
| 447 | + | v.SetString(&value) | |
| 448 | 448 | x.SetProperty("theme-name", &v) | |
| 449 | 449 | } | |
| 450 | 450 | ||
M v4/gtk/gtkiconview.go +16 -1
| @@ -536,7 +536,22 @@ var xIconViewSelectedForeach func(uintptr, uintptr, uintptr) | |||
| 536 | 536 | // selection cannot be modified from within this function. | |
| 537 | 537 | func (x *IconView) SelectedForeach(FuncVar *IconViewForeachFunc, DataVar uintptr) { | |
| 538 | 538 | ||
| 539 | - | xIconViewSelectedForeach(x.GoPointer(), glib.NewCallback(FuncVar), DataVar) | |
| 539 | + | var FuncVarRef uintptr | |
| 540 | + | if FuncVar != nil { | |
| 541 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 542 | + | if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok { | |
| 543 | + | FuncVarRef = cbRefPtr | |
| 544 | + | } else { | |
| 545 | + | fcb := func(arg0 uintptr, arg1 *TreePath, arg2 uintptr) { | |
| 546 | + | cbFn := *FuncVar | |
| 547 | + | cbFn(arg0, arg1, arg2) | |
| 548 | + | } | |
| 549 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 550 | + | glib.SaveCallback(FuncVarPtr, FuncVarRef) | |
| 551 | + | } | |
| 552 | + | } | |
| 553 | + | ||
| 554 | + | xIconViewSelectedForeach(x.GoPointer(), FuncVarRef, DataVar) | |
| 540 | 555 | ||
| 541 | 556 | } | |
| 542 | 557 | ||
M v4/gtk/gtkimage.go +15 -15
| @@ -166,17 +166,17 @@ func NewImageFromGicon(IconVar gio.Icon) *Image { | |||
| 166 | 166 | return cls | |
| 167 | 167 | } | |
| 168 | 168 | ||
| 169 | - | var xNewImageFromIconName func(string) uintptr | |
| 169 | + | var xNewImageFromIconName func(uintptr) uintptr | |
| 170 | 170 | ||
| 171 | 171 | // Creates a `GtkImage` displaying an icon from the current icon theme. | |
| 172 | 172 | // | |
| 173 | 173 | // If the icon name isn’t known, a “broken image” icon will be | |
| 174 | 174 | // displayed instead. If the current icon theme is changed, the icon | |
| 175 | 175 | // will be updated appropriately. | |
| 176 | - | func NewImageFromIconName(IconNameVar string) *Image { | |
| 176 | + | func NewImageFromIconName(IconNameVar *string) *Image { | |
| 177 | 177 | var cls *Image | |
| 178 | 178 | ||
| 179 | - | cret := xNewImageFromIconName(IconNameVar) | |
| 179 | + | cret := xNewImageFromIconName(core.NullableStringToPtr(IconNameVar)) | |
| 180 | 180 | ||
| 181 | 181 | if cret == 0 { | |
| 182 | 182 | return nil | |
| @@ -373,7 +373,7 @@ func (x *Image) GetStorageType() ImageType { | |||
| 373 | 373 | return cret | |
| 374 | 374 | } | |
| 375 | 375 | ||
| 376 | - | var xImageSetFromFile func(uintptr, string) | |
| 376 | + | var xImageSetFromFile func(uintptr, uintptr) | |
| 377 | 377 | ||
| 378 | 378 | // Sets a `GtkImage` to show a file. | |
| 379 | 379 | // | |
| @@ -385,9 +385,9 @@ var xImageSetFromFile func(uintptr, string) | |||
| 385 | 385 | // Use a proper image loading framework such as libglycin, which can | |
| 386 | 386 | // load many image formats into a `GdkTexture`, and then use | |
| 387 | 387 | // [method@Gtk.Image.set_from_paintable]. | |
| 388 | - | func (x *Image) SetFromFile(FilenameVar string) { | |
| 388 | + | func (x *Image) SetFromFile(FilenameVar *string) { | |
| 389 | 389 | ||
| 390 | - | xImageSetFromFile(x.GoPointer(), FilenameVar) | |
| 390 | + | xImageSetFromFile(x.GoPointer(), core.NullableStringToPtr(FilenameVar)) | |
| 391 | 391 | ||
| 392 | 392 | } | |
| 393 | 393 | ||
| @@ -402,14 +402,14 @@ func (x *Image) SetFromGicon(IconVar gio.Icon) { | |||
| 402 | 402 | ||
| 403 | 403 | } | |
| 404 | 404 | ||
| 405 | - | var xImageSetFromIconName func(uintptr, string) | |
| 405 | + | var xImageSetFromIconName func(uintptr, uintptr) | |
| 406 | 406 | ||
| 407 | 407 | // Sets a `GtkImage` to show a named icon. | |
| 408 | 408 | // | |
| 409 | 409 | // See [ctor@Gtk.Image.new_from_icon_name] for details. | |
| 410 | - | func (x *Image) SetFromIconName(IconNameVar string) { | |
| 410 | + | func (x *Image) SetFromIconName(IconNameVar *string) { | |
| 411 | 411 | ||
| 412 | - | xImageSetFromIconName(x.GoPointer(), IconNameVar) | |
| 412 | + | xImageSetFromIconName(x.GoPointer(), core.NullableStringToPtr(IconNameVar)) | |
| 413 | 413 | ||
| 414 | 414 | } | |
| 415 | 415 | ||
| @@ -439,14 +439,14 @@ func (x *Image) SetFromPixbuf(PixbufVar *gdkpixbuf.Pixbuf) { | |||
| 439 | 439 | ||
| 440 | 440 | } | |
| 441 | 441 | ||
| 442 | - | var xImageSetFromResource func(uintptr, string) | |
| 442 | + | var xImageSetFromResource func(uintptr, uintptr) | |
| 443 | 443 | ||
| 444 | 444 | // Sets a `GtkImage` to show a resource. | |
| 445 | 445 | // | |
| 446 | 446 | // See [ctor@Gtk.Image.new_from_resource] for details. | |
| 447 | - | func (x *Image) SetFromResource(ResourcePathVar string) { | |
| 447 | + | func (x *Image) SetFromResource(ResourcePathVar *string) { | |
| 448 | 448 | ||
| 449 | - | xImageSetFromResource(x.GoPointer(), ResourcePathVar) | |
| 449 | + | xImageSetFromResource(x.GoPointer(), core.NullableStringToPtr(ResourcePathVar)) | |
| 450 | 450 | ||
| 451 | 451 | } | |
| 452 | 452 | ||
| @@ -487,7 +487,7 @@ func (c *Image) SetGoPointer(ptr uintptr) { | |||
| 487 | 487 | func (x *Image) SetPropertyFile(value string) { | |
| 488 | 488 | var v gobject.Value | |
| 489 | 489 | v.Init(gobject.TypeStringVal) | |
| 490 | - | v.SetString(value) | |
| 490 | + | v.SetString(&value) | |
| 491 | 491 | x.SetProperty("file", &v) | |
| 492 | 492 | } | |
| 493 | 493 | ||
| @@ -506,7 +506,7 @@ func (x *Image) GetPropertyFile() string { | |||
| 506 | 506 | func (x *Image) SetPropertyIconName(value string) { | |
| 507 | 507 | var v gobject.Value | |
| 508 | 508 | v.Init(gobject.TypeStringVal) | |
| 509 | - | v.SetString(value) | |
| 509 | + | v.SetString(&value) | |
| 510 | 510 | x.SetProperty("icon-name", &v) | |
| 511 | 511 | } | |
| 512 | 512 | ||
| @@ -550,7 +550,7 @@ func (x *Image) GetPropertyPixelSize() int { | |||
| 550 | 550 | func (x *Image) SetPropertyResource(value string) { | |
| 551 | 551 | var v gobject.Value | |
| 552 | 552 | v.Init(gobject.TypeStringVal) | |
| 553 | - | v.SetString(value) | |
| 553 | + | v.SetString(&value) | |
| 554 | 554 | x.SetProperty("resource", &v) | |
| 555 | 555 | } | |
| 556 | 556 | ||
M v4/gtk/gtkimmulticontext.go +3 -3
| @@ -174,7 +174,7 @@ func (x *IMMulticontext) GetContextId() string { | |||
| 174 | 174 | return cret | |
| 175 | 175 | } | |
| 176 | 176 | ||
| 177 | - | var xIMMulticontextSetContextId func(uintptr, string) | |
| 177 | + | var xIMMulticontextSetContextId func(uintptr, uintptr) | |
| 178 | 178 | ||
| 179 | 179 | // Sets the context id for @context. | |
| 180 | 180 | // | |
| @@ -184,9 +184,9 @@ var xIMMulticontextSetContextId func(uintptr, string) | |||
| 184 | 184 | // Setting this to a non-%NULL value overrides the system-wide | |
| 185 | 185 | // IM module setting. See the [property@Gtk.Settings:gtk-im-module] | |
| 186 | 186 | // property. | |
| 187 | - | func (x *IMMulticontext) SetContextId(ContextIdVar string) { | |
| 187 | + | func (x *IMMulticontext) SetContextId(ContextIdVar *string) { | |
| 188 | 188 | ||
| 189 | - | xIMMulticontextSetContextId(x.GoPointer(), ContextIdVar) | |
| 189 | + | xIMMulticontextSetContextId(x.GoPointer(), core.NullableStringToPtr(ContextIdVar)) | |
| 190 | 190 | ||
| 191 | 191 | } | |
| 192 | 192 | ||
M v4/gtk/gtkinfobar.go +3 -3
| @@ -127,7 +127,7 @@ func NewInfoBar() *InfoBar { | |||
| 127 | 127 | return cls | |
| 128 | 128 | } | |
| 129 | 129 | ||
| 130 | - | var xNewInfoBarWithButtons func(string, ...interface{}) uintptr | |
| 130 | + | var xNewInfoBarWithButtons func(uintptr, ...interface{}) uintptr | |
| 131 | 131 | ||
| 132 | 132 | // Creates a new `GtkInfoBar` with buttons. | |
| 133 | 133 | // | |
| @@ -137,10 +137,10 @@ var xNewInfoBarWithButtons func(string, ...interface{}) uintptr | |||
| 137 | 137 | // user clicks one of these dialog buttons, GtkInfoBar will emit | |
| 138 | 138 | // the [signal@Gtk.InfoBar::response] signal with the corresponding | |
| 139 | 139 | // response ID. | |
| 140 | - | func NewInfoBarWithButtons(FirstButtonTextVar string, varArgs ...interface{}) *InfoBar { | |
| 140 | + | func NewInfoBarWithButtons(FirstButtonTextVar *string, varArgs ...interface{}) *InfoBar { | |
| 141 | 141 | var cls *InfoBar | |
| 142 | 142 | ||
| 143 | - | cret := xNewInfoBarWithButtons(FirstButtonTextVar, varArgs...) | |
| 143 | + | cret := xNewInfoBarWithButtons(core.NullableStringToPtr(FirstButtonTextVar), varArgs...) | |
| 144 | 144 | ||
| 145 | 145 | if cret == 0 { | |
| 146 | 146 | return nil | |
M v4/gtk/gtkinscription.go +11 -11
| @@ -76,13 +76,13 @@ func InscriptionNewFromInternalPtr(ptr uintptr) *Inscription { | |||
| 76 | 76 | return cls | |
| 77 | 77 | } | |
| 78 | 78 | ||
| 79 | - | var xNewInscription func(string) uintptr | |
| 79 | + | var xNewInscription func(uintptr) uintptr | |
| 80 | 80 | ||
| 81 | 81 | // Creates a new `GtkInscription` with the given text. | |
| 82 | - | func NewInscription(TextVar string) *Inscription { | |
| 82 | + | func NewInscription(TextVar *string) *Inscription { | |
| 83 | 83 | var cls *Inscription | |
| 84 | 84 | ||
| 85 | - | cret := xNewInscription(TextVar) | |
| 85 | + | cret := xNewInscription(core.NullableStringToPtr(TextVar)) | |
| 86 | 86 | ||
| 87 | 87 | if cret == 0 { | |
| 88 | 88 | return nil | |
| @@ -208,14 +208,14 @@ func (x *Inscription) SetAttributes(AttrsVar *pango.AttrList) { | |||
| 208 | 208 | ||
| 209 | 209 | } | |
| 210 | 210 | ||
| 211 | - | var xInscriptionSetMarkup func(uintptr, string) | |
| 211 | + | var xInscriptionSetMarkup func(uintptr, uintptr) | |
| 212 | 212 | ||
| 213 | 213 | // Utility function to set the text and attributes to be displayed. | |
| 214 | 214 | // | |
| 215 | 215 | // See the [property@Gtk.Inscription:markup] property. | |
| 216 | - | func (x *Inscription) SetMarkup(MarkupVar string) { | |
| 216 | + | func (x *Inscription) SetMarkup(MarkupVar *string) { | |
| 217 | 217 | ||
| 218 | - | xInscriptionSetMarkup(x.GoPointer(), MarkupVar) | |
| 218 | + | xInscriptionSetMarkup(x.GoPointer(), core.NullableStringToPtr(MarkupVar)) | |
| 219 | 219 | ||
| 220 | 220 | } | |
| 221 | 221 | ||
| @@ -263,12 +263,12 @@ func (x *Inscription) SetNatLines(NatLinesVar uint) { | |||
| 263 | 263 | ||
| 264 | 264 | } | |
| 265 | 265 | ||
| 266 | - | var xInscriptionSetText func(uintptr, string) | |
| 266 | + | var xInscriptionSetText func(uintptr, uintptr) | |
| 267 | 267 | ||
| 268 | 268 | // Sets the text to be displayed. | |
| 269 | - | func (x *Inscription) SetText(TextVar string) { | |
| 269 | + | func (x *Inscription) SetText(TextVar *string) { | |
| 270 | 270 | ||
| 271 | - | xInscriptionSetText(x.GoPointer(), TextVar) | |
| 271 | + | xInscriptionSetText(x.GoPointer(), core.NullableStringToPtr(TextVar)) | |
| 272 | 272 | ||
| 273 | 273 | } | |
| 274 | 274 | ||
| @@ -351,7 +351,7 @@ func (x *Inscription) GetPropertyAttributes() uintptr { | |||
| 351 | 351 | func (x *Inscription) SetPropertyMarkup(value string) { | |
| 352 | 352 | var v gobject.Value | |
| 353 | 353 | v.Init(gobject.TypeStringVal) | |
| 354 | - | v.SetString(value) | |
| 354 | + | v.SetString(&value) | |
| 355 | 355 | x.SetProperty("markup", &v) | |
| 356 | 356 | } | |
| 357 | 357 | ||
| @@ -494,7 +494,7 @@ func (x *Inscription) GetPropertyNatLines() uint { | |||
| 494 | 494 | func (x *Inscription) SetPropertyText(value string) { | |
| 495 | 495 | var v gobject.Value | |
| 496 | 496 | v.Init(gobject.TypeStringVal) | |
| 497 | - | v.SetString(value) | |
| 497 | + | v.SetString(&value) | |
| 498 | 498 | x.SetProperty("text", &v) | |
| 499 | 499 | } | |
| 500 | 500 | ||
M v4/gtk/gtklabel.go +7 -7
| @@ -249,15 +249,15 @@ func LabelNewFromInternalPtr(ptr uintptr) *Label { | |||
| 249 | 249 | return cls | |
| 250 | 250 | } | |
| 251 | 251 | ||
| 252 | - | var xNewLabel func(string) uintptr | |
| 252 | + | var xNewLabel func(uintptr) uintptr | |
| 253 | 253 | ||
| 254 | 254 | // Creates a new label with the given text inside it. | |
| 255 | 255 | // | |
| 256 | 256 | // You can pass `NULL` to get an empty label widget. | |
| 257 | - | func NewLabel(StrVar string) *Label { | |
| 257 | + | func NewLabel(StrVar *string) *Label { | |
| 258 | 258 | var cls *Label | |
| 259 | 259 | ||
| 260 | - | cret := xNewLabel(StrVar) | |
| 260 | + | cret := xNewLabel(core.NullableStringToPtr(StrVar)) | |
| 261 | 261 | ||
| 262 | 262 | if cret == 0 { | |
| 263 | 263 | return nil | |
| @@ -268,7 +268,7 @@ func NewLabel(StrVar string) *Label { | |||
| 268 | 268 | return cls | |
| 269 | 269 | } | |
| 270 | 270 | ||
| 271 | - | var xNewLabelWithMnemonic func(string) uintptr | |
| 271 | + | var xNewLabelWithMnemonic func(uintptr) uintptr | |
| 272 | 272 | ||
| 273 | 273 | // Creates a new label with the given text inside it, and a mnemonic. | |
| 274 | 274 | // | |
| @@ -284,10 +284,10 @@ var xNewLabelWithMnemonic func(string) uintptr | |||
| 284 | 284 | // widget. For instance, if the label is inside a button or menu item, | |
| 285 | 285 | // the button or menu item will automatically become the mnemonic widget | |
| 286 | 286 | // and be activated by the mnemonic. | |
| 287 | - | func NewLabelWithMnemonic(StrVar string) *Label { | |
| 287 | + | func NewLabelWithMnemonic(StrVar *string) *Label { | |
| 288 | 288 | var cls *Label | |
| 289 | 289 | ||
| 290 | - | cret := xNewLabelWithMnemonic(StrVar) | |
| 290 | + | cret := xNewLabelWithMnemonic(core.NullableStringToPtr(StrVar)) | |
| 291 | 291 | ||
| 292 | 292 | if cret == 0 { | |
| 293 | 293 | return nil | |
| @@ -998,7 +998,7 @@ func (x *Label) GetPropertyAttributes() uintptr { | |||
| 998 | 998 | func (x *Label) SetPropertyLabel(value string) { | |
| 999 | 999 | var v gobject.Value | |
| 1000 | 1000 | v.Init(gobject.TypeStringVal) | |
| 1001 | - | v.SetString(value) | |
| 1001 | + | v.SetString(&value) | |
| 1002 | 1002 | x.SetProperty("label", &v) | |
| 1003 | 1003 | } | |
| 1004 | 1004 | ||
M v4/gtk/gtklevelbar.go +29 -6
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | package gtk | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "fmt" | |
| 5 | 6 | "unsafe" | |
| 6 | 7 | ||
| 7 | 8 | "github.com/jwijenbergh/purego" | |
| @@ -229,12 +230,12 @@ func (x *LevelBar) GetMode() LevelBarMode { | |||
| 229 | 230 | return cret | |
| 230 | 231 | } | |
| 231 | 232 | ||
| 232 | - | var xLevelBarGetOffsetValue func(uintptr, string, *float64) bool | |
| 233 | + | var xLevelBarGetOffsetValue func(uintptr, uintptr, *float64) bool | |
| 233 | 234 | ||
| 234 | 235 | // Fetches the value specified for the offset marker @name in @self. | |
| 235 | - | func (x *LevelBar) GetOffsetValue(NameVar string, ValueVar *float64) bool { | |
| 236 | + | func (x *LevelBar) GetOffsetValue(NameVar *string, ValueVar *float64) bool { | |
| 236 | 237 | ||
| 237 | - | cret := xLevelBarGetOffsetValue(x.GoPointer(), NameVar, ValueVar) | |
| 238 | + | cret := xLevelBarGetOffsetValue(x.GoPointer(), core.NullableStringToPtr(NameVar), ValueVar) | |
| 238 | 239 | return cret | |
| 239 | 240 | } | |
| 240 | 241 | ||
| @@ -247,15 +248,15 @@ func (x *LevelBar) GetValue() float64 { | |||
| 247 | 248 | return cret | |
| 248 | 249 | } | |
| 249 | 250 | ||
| 250 | - | var xLevelBarRemoveOffsetValue func(uintptr, string) | |
| 251 | + | var xLevelBarRemoveOffsetValue func(uintptr, uintptr) | |
| 251 | 252 | ||
| 252 | 253 | // Removes an offset marker from a `GtkLevelBar`. | |
| 253 | 254 | // | |
| 254 | 255 | // The marker must have been previously added with | |
| 255 | 256 | // [method@Gtk.LevelBar.add_offset_value]. | |
| 256 | - | func (x *LevelBar) RemoveOffsetValue(NameVar string) { | |
| 257 | + | func (x *LevelBar) RemoveOffsetValue(NameVar *string) { | |
| 257 | 258 | ||
| 258 | - | xLevelBarRemoveOffsetValue(x.GoPointer(), NameVar) | |
| 259 | + | xLevelBarRemoveOffsetValue(x.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 259 | 260 | ||
| 260 | 261 | } | |
| 261 | 262 | ||
| @@ -422,6 +423,28 @@ func (x *LevelBar) ConnectOffsetChanged(cb *func(LevelBar, string)) uint32 { | |||
| 422 | 423 | return gobject.SignalConnect(x.GoPointer(), "offset-changed", cbRefPtr) | |
| 423 | 424 | } | |
| 424 | 425 | ||
| 426 | + | // ConnectOffsetChangedWithDetail connects to the "offset-changed" signal with a detail string. | |
| 427 | + | // The detail is appended as "offset-changed::<detail>". | |
| 428 | + | func (x *LevelBar) ConnectOffsetChangedWithDetail(detail string, cb *func(LevelBar, string)) uint32 { | |
| 429 | + | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 430 | + | signalName := fmt.Sprintf("offset-changed::%s", detail) | |
| 431 | + | if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { | |
| 432 | + | return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 433 | + | } | |
| 434 | + | ||
| 435 | + | fcb := func(clsPtr uintptr, NameVarp string) { | |
| 436 | + | fa := LevelBar{} | |
| 437 | + | fa.Ptr = clsPtr | |
| 438 | + | cbFn := *cb | |
| 439 | + | ||
| 440 | + | cbFn(fa, NameVarp) | |
| 441 | + | ||
| 442 | + | } | |
| 443 | + | cbRefPtr := purego.NewCallback(fcb) | |
| 444 | + | glib.SaveCallback(cbPtr, cbRefPtr) | |
| 445 | + | return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr) | |
| 446 | + | } | |
| 447 | + | ||
| 425 | 448 | // Requests the user's screen reader to announce the given message. | |
| 426 | 449 | // | |
| 427 | 450 | // This kind of notification is useful for messages that | |
M v4/gtk/gtklinkbutton.go +6 -6
| @@ -88,13 +88,13 @@ func NewLinkButton(UriVar string) *LinkButton { | |||
| 88 | 88 | return cls | |
| 89 | 89 | } | |
| 90 | 90 | ||
| 91 | - | var xNewLinkButtonWithLabel func(string, string) uintptr | |
| 91 | + | var xNewLinkButtonWithLabel func(string, uintptr) uintptr | |
| 92 | 92 | ||
| 93 | 93 | // Creates a new `GtkLinkButton` containing a label. | |
| 94 | - | func NewLinkButtonWithLabel(UriVar string, LabelVar string) *LinkButton { | |
| 94 | + | func NewLinkButtonWithLabel(UriVar string, LabelVar *string) *LinkButton { | |
| 95 | 95 | var cls *LinkButton | |
| 96 | 96 | ||
| 97 | - | cret := xNewLinkButtonWithLabel(UriVar, LabelVar) | |
| 97 | + | cret := xNewLinkButtonWithLabel(UriVar, core.NullableStringToPtr(LabelVar)) | |
| 98 | 98 | ||
| 99 | 99 | if cret == 0 { | |
| 100 | 100 | return nil | |
| @@ -166,7 +166,7 @@ func (c *LinkButton) SetGoPointer(ptr uintptr) { | |||
| 166 | 166 | func (x *LinkButton) SetPropertyUri(value string) { | |
| 167 | 167 | var v gobject.Value | |
| 168 | 168 | v.Init(gobject.TypeStringVal) | |
| 169 | - | v.SetString(value) | |
| 169 | + | v.SetString(&value) | |
| 170 | 170 | x.SetProperty("uri", &v) | |
| 171 | 171 | } | |
| 172 | 172 | ||
| @@ -521,9 +521,9 @@ func (x *LinkButton) GetActionTargetValue() *glib.Variant { | |||
| 521 | 521 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 522 | 522 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 523 | 523 | // associated with the window. | |
| 524 | - | func (x *LinkButton) SetActionName(ActionNameVar string) { | |
| 524 | + | func (x *LinkButton) SetActionName(ActionNameVar *string) { | |
| 525 | 525 | ||
| 526 | - | XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 526 | + | XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 527 | 527 | ||
| 528 | 528 | } | |
| 529 | 529 | ||
M v4/gtk/gtklistbox.go +142 -7
| @@ -209,7 +209,37 @@ var xListBoxBindModel func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||
| 209 | 209 | // should be implemented by the model. | |
| 210 | 210 | func (x *ListBox) BindModel(ModelVar gio.ListModel, CreateWidgetFuncVar *ListBoxCreateWidgetFunc, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) { | |
| 211 | 211 | ||
| 212 | - | xListBoxBindModel(x.GoPointer(), ModelVar.GoPointer(), glib.NewCallbackNullable(CreateWidgetFuncVar), UserDataVar, glib.NewCallback(UserDataFreeFuncVar)) | |
| 212 | + | var CreateWidgetFuncVarRef uintptr | |
| 213 | + | if CreateWidgetFuncVar != nil { | |
| 214 | + | CreateWidgetFuncVarPtr := uintptr(unsafe.Pointer(CreateWidgetFuncVar)) | |
| 215 | + | if cbRefPtr, ok := glib.GetCallback(CreateWidgetFuncVarPtr); ok { | |
| 216 | + | CreateWidgetFuncVarRef = cbRefPtr | |
| 217 | + | } else { | |
| 218 | + | fcb := func(arg0 uintptr, arg1 uintptr) uintptr { | |
| 219 | + | cbFn := *CreateWidgetFuncVar | |
| 220 | + | return cbFn(arg0, arg1) | |
| 221 | + | } | |
| 222 | + | CreateWidgetFuncVarRef = purego.NewCallback(fcb) | |
| 223 | + | glib.SaveCallback(CreateWidgetFuncVarPtr, CreateWidgetFuncVarRef) | |
| 224 | + | } | |
| 225 | + | } | |
| 226 | + | ||
| 227 | + | var UserDataFreeFuncVarRef uintptr | |
| 228 | + | if UserDataFreeFuncVar != nil { | |
| 229 | + | UserDataFreeFuncVarPtr := uintptr(unsafe.Pointer(UserDataFreeFuncVar)) | |
| 230 | + | if cbRefPtr, ok := glib.GetCallback(UserDataFreeFuncVarPtr); ok { | |
| 231 | + | UserDataFreeFuncVarRef = cbRefPtr | |
| 232 | + | } else { | |
| 233 | + | fcb := func(arg0 uintptr) { | |
| 234 | + | cbFn := *UserDataFreeFuncVar | |
| 235 | + | cbFn(arg0) | |
| 236 | + | } | |
| 237 | + | UserDataFreeFuncVarRef = purego.NewCallback(fcb) | |
| 238 | + | glib.SaveCallback(UserDataFreeFuncVarPtr, UserDataFreeFuncVarRef) | |
| 239 | + | } | |
| 240 | + | } | |
| 241 | + | ||
| 242 | + | xListBoxBindModel(x.GoPointer(), ModelVar.GoPointer(), CreateWidgetFuncVarRef, UserDataVar, UserDataFreeFuncVarRef) | |
| 213 | 243 | ||
| 214 | 244 | } | |
| 215 | 245 | ||
| @@ -475,7 +505,22 @@ var xListBoxSelectedForeach func(uintptr, uintptr, uintptr) | |||
| 475 | 505 | // Note that the selection cannot be modified from within this function. | |
| 476 | 506 | func (x *ListBox) SelectedForeach(FuncVar *ListBoxForeachFunc, DataVar uintptr) { | |
| 477 | 507 | ||
| 478 | - | xListBoxSelectedForeach(x.GoPointer(), glib.NewCallback(FuncVar), DataVar) | |
| 508 | + | var FuncVarRef uintptr | |
| 509 | + | if FuncVar != nil { | |
| 510 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 511 | + | if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok { | |
| 512 | + | FuncVarRef = cbRefPtr | |
| 513 | + | } else { | |
| 514 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 515 | + | cbFn := *FuncVar | |
| 516 | + | cbFn(arg0, arg1, arg2) | |
| 517 | + | } | |
| 518 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 519 | + | glib.SaveCallback(FuncVarPtr, FuncVarRef) | |
| 520 | + | } | |
| 521 | + | } | |
| 522 | + | ||
| 523 | + | xListBoxSelectedForeach(x.GoPointer(), FuncVarRef, DataVar) | |
| 479 | 524 | ||
| 480 | 525 | } | |
| 481 | 526 | ||
| @@ -524,7 +569,37 @@ var xListBoxSetFilterFunc func(uintptr, uintptr, uintptr, uintptr) | |||
| 524 | 569 | // (see [method@Gtk.ListBox.bind_model]). | |
| 525 | 570 | func (x *ListBox) SetFilterFunc(FilterFuncVar *ListBoxFilterFunc, UserDataVar uintptr, DestroyVar *glib.DestroyNotify) { | |
| 526 | 571 | ||
| 527 | - | xListBoxSetFilterFunc(x.GoPointer(), glib.NewCallbackNullable(FilterFuncVar), UserDataVar, glib.NewCallback(DestroyVar)) | |
| 572 | + | var FilterFuncVarRef uintptr | |
| 573 | + | if FilterFuncVar != nil { | |
| 574 | + | FilterFuncVarPtr := uintptr(unsafe.Pointer(FilterFuncVar)) | |
| 575 | + | if cbRefPtr, ok := glib.GetCallback(FilterFuncVarPtr); ok { | |
| 576 | + | FilterFuncVarRef = cbRefPtr | |
| 577 | + | } else { | |
| 578 | + | fcb := func(arg0 uintptr, arg1 uintptr) bool { | |
| 579 | + | cbFn := *FilterFuncVar | |
| 580 | + | return cbFn(arg0, arg1) | |
| 581 | + | } | |
| 582 | + | FilterFuncVarRef = purego.NewCallback(fcb) | |
| 583 | + | glib.SaveCallback(FilterFuncVarPtr, FilterFuncVarRef) | |
| 584 | + | } | |
| 585 | + | } | |
| 586 | + | ||
| 587 | + | var DestroyVarRef uintptr | |
| 588 | + | if DestroyVar != nil { | |
| 589 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 590 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 591 | + | DestroyVarRef = cbRefPtr | |
| 592 | + | } else { | |
| 593 | + | fcb := func(arg0 uintptr) { | |
| 594 | + | cbFn := *DestroyVar | |
| 595 | + | cbFn(arg0) | |
| 596 | + | } | |
| 597 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 598 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 599 | + | } | |
| 600 | + | } | |
| 601 | + | ||
| 602 | + | xListBoxSetFilterFunc(x.GoPointer(), FilterFuncVarRef, UserDataVar, DestroyVarRef) | |
| 528 | 603 | ||
| 529 | 604 | } | |
| 530 | 605 | ||
| @@ -557,7 +632,37 @@ var xListBoxSetHeaderFunc func(uintptr, uintptr, uintptr, uintptr) | |||
| 557 | 632 | // [method@Gtk.ListBox.invalidate_headers] is called. | |
| 558 | 633 | func (x *ListBox) SetHeaderFunc(UpdateHeaderVar *ListBoxUpdateHeaderFunc, UserDataVar uintptr, DestroyVar *glib.DestroyNotify) { | |
| 559 | 634 | ||
| 560 | - | xListBoxSetHeaderFunc(x.GoPointer(), glib.NewCallbackNullable(UpdateHeaderVar), UserDataVar, glib.NewCallback(DestroyVar)) | |
| 635 | + | var UpdateHeaderVarRef uintptr | |
| 636 | + | if UpdateHeaderVar != nil { | |
| 637 | + | UpdateHeaderVarPtr := uintptr(unsafe.Pointer(UpdateHeaderVar)) | |
| 638 | + | if cbRefPtr, ok := glib.GetCallback(UpdateHeaderVarPtr); ok { | |
| 639 | + | UpdateHeaderVarRef = cbRefPtr | |
| 640 | + | } else { | |
| 641 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 642 | + | cbFn := *UpdateHeaderVar | |
| 643 | + | cbFn(arg0, arg1, arg2) | |
| 644 | + | } | |
| 645 | + | UpdateHeaderVarRef = purego.NewCallback(fcb) | |
| 646 | + | glib.SaveCallback(UpdateHeaderVarPtr, UpdateHeaderVarRef) | |
| 647 | + | } | |
| 648 | + | } | |
| 649 | + | ||
| 650 | + | var DestroyVarRef uintptr | |
| 651 | + | if DestroyVar != nil { | |
| 652 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 653 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 654 | + | DestroyVarRef = cbRefPtr | |
| 655 | + | } else { | |
| 656 | + | fcb := func(arg0 uintptr) { | |
| 657 | + | cbFn := *DestroyVar | |
| 658 | + | cbFn(arg0) | |
| 659 | + | } | |
| 660 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 661 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 662 | + | } | |
| 663 | + | } | |
| 664 | + | ||
| 665 | + | xListBoxSetHeaderFunc(x.GoPointer(), UpdateHeaderVarRef, UserDataVar, DestroyVarRef) | |
| 561 | 666 | ||
| 562 | 667 | } | |
| 563 | 668 | ||
| @@ -606,7 +711,37 @@ var xListBoxSetSortFunc func(uintptr, uintptr, uintptr, uintptr) | |||
| 606 | 711 | // (see [method@Gtk.ListBox.bind_model]). | |
| 607 | 712 | func (x *ListBox) SetSortFunc(SortFuncVar *ListBoxSortFunc, UserDataVar uintptr, DestroyVar *glib.DestroyNotify) { | |
| 608 | 713 | ||
| 609 | - | xListBoxSetSortFunc(x.GoPointer(), glib.NewCallbackNullable(SortFuncVar), UserDataVar, glib.NewCallback(DestroyVar)) | |
| 714 | + | var SortFuncVarRef uintptr | |
| 715 | + | if SortFuncVar != nil { | |
| 716 | + | SortFuncVarPtr := uintptr(unsafe.Pointer(SortFuncVar)) | |
| 717 | + | if cbRefPtr, ok := glib.GetCallback(SortFuncVarPtr); ok { | |
| 718 | + | SortFuncVarRef = cbRefPtr | |
| 719 | + | } else { | |
| 720 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int { | |
| 721 | + | cbFn := *SortFuncVar | |
| 722 | + | return cbFn(arg0, arg1, arg2) | |
| 723 | + | } | |
| 724 | + | SortFuncVarRef = purego.NewCallback(fcb) | |
| 725 | + | glib.SaveCallback(SortFuncVarPtr, SortFuncVarRef) | |
| 726 | + | } | |
| 727 | + | } | |
| 728 | + | ||
| 729 | + | var DestroyVarRef uintptr | |
| 730 | + | if DestroyVar != nil { | |
| 731 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 732 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 733 | + | DestroyVarRef = cbRefPtr | |
| 734 | + | } else { | |
| 735 | + | fcb := func(arg0 uintptr) { | |
| 736 | + | cbFn := *DestroyVar | |
| 737 | + | cbFn(arg0) | |
| 738 | + | } | |
| 739 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 740 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 741 | + | } | |
| 742 | + | } | |
| 743 | + | ||
| 744 | + | xListBoxSetSortFunc(x.GoPointer(), SortFuncVarRef, UserDataVar, DestroyVarRef) | |
| 610 | 745 | ||
| 611 | 746 | } | |
| 612 | 747 | ||
| @@ -1713,9 +1848,9 @@ func (x *ListBoxRow) GetActionTargetValue() *glib.Variant { | |||
| 1713 | 1848 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 1714 | 1849 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 1715 | 1850 | // associated with the window. | |
| 1716 | - | func (x *ListBoxRow) SetActionName(ActionNameVar string) { | |
| 1851 | + | func (x *ListBoxRow) SetActionName(ActionNameVar *string) { | |
| 1717 | 1852 | ||
| 1718 | - | XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 1853 | + | XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 1719 | 1854 | ||
| 1720 | 1855 | } | |
| 1721 | 1856 | ||
M v4/gtk/gtklistitem.go +2 -2
| @@ -264,7 +264,7 @@ func (c *ListItem) SetGoPointer(ptr uintptr) { | |||
| 264 | 264 | func (x *ListItem) SetPropertyAccessibleDescription(value string) { | |
| 265 | 265 | var v gobject.Value | |
| 266 | 266 | v.Init(gobject.TypeStringVal) | |
| 267 | - | v.SetString(value) | |
| 267 | + | v.SetString(&value) | |
| 268 | 268 | x.SetProperty("accessible-description", &v) | |
| 269 | 269 | } | |
| 270 | 270 | ||
| @@ -281,7 +281,7 @@ func (x *ListItem) GetPropertyAccessibleDescription() string { | |||
| 281 | 281 | func (x *ListItem) SetPropertyAccessibleLabel(value string) { | |
| 282 | 282 | var v gobject.Value | |
| 283 | 283 | v.Init(gobject.TypeStringVal) | |
| 284 | - | v.SetString(value) | |
| 284 | + | v.SetString(&value) | |
| 285 | 285 | x.SetProperty("accessible-label", &v) | |
| 286 | 286 | } | |
| 287 | 287 | ||
M v4/gtk/gtklockbutton.go +7 -7
| @@ -142,7 +142,7 @@ func (c *LockButton) SetGoPointer(ptr uintptr) { | |||
| 142 | 142 | func (x *LockButton) SetPropertyTextLock(value string) { | |
| 143 | 143 | var v gobject.Value | |
| 144 | 144 | v.Init(gobject.TypeStringVal) | |
| 145 | - | v.SetString(value) | |
| 145 | + | v.SetString(&value) | |
| 146 | 146 | x.SetProperty("text-lock", &v) | |
| 147 | 147 | } | |
| 148 | 148 | ||
| @@ -159,7 +159,7 @@ func (x *LockButton) GetPropertyTextLock() string { | |||
| 159 | 159 | func (x *LockButton) SetPropertyTextUnlock(value string) { | |
| 160 | 160 | var v gobject.Value | |
| 161 | 161 | v.Init(gobject.TypeStringVal) | |
| 162 | - | v.SetString(value) | |
| 162 | + | v.SetString(&value) | |
| 163 | 163 | x.SetProperty("text-unlock", &v) | |
| 164 | 164 | } | |
| 165 | 165 | ||
| @@ -176,7 +176,7 @@ func (x *LockButton) GetPropertyTextUnlock() string { | |||
| 176 | 176 | func (x *LockButton) SetPropertyTooltipLock(value string) { | |
| 177 | 177 | var v gobject.Value | |
| 178 | 178 | v.Init(gobject.TypeStringVal) | |
| 179 | - | v.SetString(value) | |
| 179 | + | v.SetString(&value) | |
| 180 | 180 | x.SetProperty("tooltip-lock", &v) | |
| 181 | 181 | } | |
| 182 | 182 | ||
| @@ -193,7 +193,7 @@ func (x *LockButton) GetPropertyTooltipLock() string { | |||
| 193 | 193 | func (x *LockButton) SetPropertyTooltipNotAuthorized(value string) { | |
| 194 | 194 | var v gobject.Value | |
| 195 | 195 | v.Init(gobject.TypeStringVal) | |
| 196 | - | v.SetString(value) | |
| 196 | + | v.SetString(&value) | |
| 197 | 197 | x.SetProperty("tooltip-not-authorized", &v) | |
| 198 | 198 | } | |
| 199 | 199 | ||
| @@ -210,7 +210,7 @@ func (x *LockButton) GetPropertyTooltipNotAuthorized() string { | |||
| 210 | 210 | func (x *LockButton) SetPropertyTooltipUnlock(value string) { | |
| 211 | 211 | var v gobject.Value | |
| 212 | 212 | v.Init(gobject.TypeStringVal) | |
| 213 | - | v.SetString(value) | |
| 213 | + | v.SetString(&value) | |
| 214 | 214 | x.SetProperty("tooltip-unlock", &v) | |
| 215 | 215 | } | |
| 216 | 216 | ||
| @@ -517,9 +517,9 @@ func (x *LockButton) GetActionTargetValue() *glib.Variant { | |||
| 517 | 517 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 518 | 518 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 519 | 519 | // associated with the window. | |
| 520 | - | func (x *LockButton) SetActionName(ActionNameVar string) { | |
| 520 | + | func (x *LockButton) SetActionName(ActionNameVar *string) { | |
| 521 | 521 | ||
| 522 | - | XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 522 | + | XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 523 | 523 | ||
| 524 | 524 | } | |
| 525 | 525 | ||
M v4/gtk/gtkmaplistmodel.go +62 -2
| @@ -86,7 +86,37 @@ var xNewMapListModel func(uintptr, uintptr, uintptr, uintptr) uintptr | |||
| 86 | 86 | func NewMapListModel(ModelVar gio.ListModel, MapFuncVar *MapListModelMapFunc, UserDataVar uintptr, UserDestroyVar *glib.DestroyNotify) *MapListModel { | |
| 87 | 87 | var cls *MapListModel | |
| 88 | 88 | ||
| 89 | - | cret := xNewMapListModel(ModelVar.GoPointer(), glib.NewCallbackNullable(MapFuncVar), UserDataVar, glib.NewCallback(UserDestroyVar)) | |
| 89 | + | var MapFuncVarRef uintptr | |
| 90 | + | if MapFuncVar != nil { | |
| 91 | + | MapFuncVarPtr := uintptr(unsafe.Pointer(MapFuncVar)) | |
| 92 | + | if cbRefPtr, ok := glib.GetCallback(MapFuncVarPtr); ok { | |
| 93 | + | MapFuncVarRef = cbRefPtr | |
| 94 | + | } else { | |
| 95 | + | fcb := func(arg0 uintptr, arg1 uintptr) uintptr { | |
| 96 | + | cbFn := *MapFuncVar | |
| 97 | + | return cbFn(arg0, arg1) | |
| 98 | + | } | |
| 99 | + | MapFuncVarRef = purego.NewCallback(fcb) | |
| 100 | + | glib.SaveCallback(MapFuncVarPtr, MapFuncVarRef) | |
| 101 | + | } | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | var UserDestroyVarRef uintptr | |
| 105 | + | if UserDestroyVar != nil { | |
| 106 | + | UserDestroyVarPtr := uintptr(unsafe.Pointer(UserDestroyVar)) | |
| 107 | + | if cbRefPtr, ok := glib.GetCallback(UserDestroyVarPtr); ok { | |
| 108 | + | UserDestroyVarRef = cbRefPtr | |
| 109 | + | } else { | |
| 110 | + | fcb := func(arg0 uintptr) { | |
| 111 | + | cbFn := *UserDestroyVar | |
| 112 | + | cbFn(arg0) | |
| 113 | + | } | |
| 114 | + | UserDestroyVarRef = purego.NewCallback(fcb) | |
| 115 | + | glib.SaveCallback(UserDestroyVarPtr, UserDestroyVarRef) | |
| 116 | + | } | |
| 117 | + | } | |
| 118 | + | ||
| 119 | + | cret := xNewMapListModel(ModelVar.GoPointer(), MapFuncVarRef, UserDataVar, UserDestroyVarRef) | |
| 90 | 120 | ||
| 91 | 121 | if cret == 0 { | |
| 92 | 122 | return nil | |
| @@ -137,7 +167,37 @@ var xMapListModelSetMapFunc func(uintptr, uintptr, uintptr, uintptr) | |||
| 137 | 167 | // function returns items of the appropriate type. | |
| 138 | 168 | func (x *MapListModel) SetMapFunc(MapFuncVar *MapListModelMapFunc, UserDataVar uintptr, UserDestroyVar *glib.DestroyNotify) { | |
| 139 | 169 | ||
| 140 | - | xMapListModelSetMapFunc(x.GoPointer(), glib.NewCallbackNullable(MapFuncVar), UserDataVar, glib.NewCallback(UserDestroyVar)) | |
| 170 | + | var MapFuncVarRef uintptr | |
| 171 | + | if MapFuncVar != nil { | |
| 172 | + | MapFuncVarPtr := uintptr(unsafe.Pointer(MapFuncVar)) | |
| 173 | + | if cbRefPtr, ok := glib.GetCallback(MapFuncVarPtr); ok { | |
| 174 | + | MapFuncVarRef = cbRefPtr | |
| 175 | + | } else { | |
| 176 | + | fcb := func(arg0 uintptr, arg1 uintptr) uintptr { | |
| 177 | + | cbFn := *MapFuncVar | |
| 178 | + | return cbFn(arg0, arg1) | |
| 179 | + | } | |
| 180 | + | MapFuncVarRef = purego.NewCallback(fcb) | |
| 181 | + | glib.SaveCallback(MapFuncVarPtr, MapFuncVarRef) | |
| 182 | + | } | |
| 183 | + | } | |
| 184 | + | ||
| 185 | + | var UserDestroyVarRef uintptr | |
| 186 | + | if UserDestroyVar != nil { | |
| 187 | + | UserDestroyVarPtr := uintptr(unsafe.Pointer(UserDestroyVar)) | |
| 188 | + | if cbRefPtr, ok := glib.GetCallback(UserDestroyVarPtr); ok { | |
| 189 | + | UserDestroyVarRef = cbRefPtr | |
| 190 | + | } else { | |
| 191 | + | fcb := func(arg0 uintptr) { | |
| 192 | + | cbFn := *UserDestroyVar | |
| 193 | + | cbFn(arg0) | |
| 194 | + | } | |
| 195 | + | UserDestroyVarRef = purego.NewCallback(fcb) | |
| 196 | + | glib.SaveCallback(UserDestroyVarPtr, UserDestroyVarRef) | |
| 197 | + | } | |
| 198 | + | } | |
| 199 | + | ||
| 200 | + | xMapListModelSetMapFunc(x.GoPointer(), MapFuncVarRef, UserDataVar, UserDestroyVarRef) | |
| 141 | 201 | ||
| 142 | 202 | } | |
| 143 | 203 | ||
M v4/gtk/gtkmediafile.go +6 -6
| @@ -351,15 +351,15 @@ func (x *MediaFile) SetFile(FileVar gio.File) { | |||
| 351 | 351 | ||
| 352 | 352 | } | |
| 353 | 353 | ||
| 354 | - | var xMediaFileSetFilename func(uintptr, string) | |
| 354 | + | var xMediaFileSetFilename func(uintptr, uintptr) | |
| 355 | 355 | ||
| 356 | 356 | // Sets the `GtkMediaFile` to play the given file. | |
| 357 | 357 | // | |
| 358 | 358 | // This is a utility function that converts the given @filename | |
| 359 | 359 | // to a `GFile` and calls [method@Gtk.MediaFile.set_file]. | |
| 360 | - | func (x *MediaFile) SetFilename(FilenameVar string) { | |
| 360 | + | func (x *MediaFile) SetFilename(FilenameVar *string) { | |
| 361 | 361 | ||
| 362 | - | xMediaFileSetFilename(x.GoPointer(), FilenameVar) | |
| 362 | + | xMediaFileSetFilename(x.GoPointer(), core.NullableStringToPtr(FilenameVar)) | |
| 363 | 363 | ||
| 364 | 364 | } | |
| 365 | 365 | ||
| @@ -377,15 +377,15 @@ func (x *MediaFile) SetInputStream(StreamVar *gio.InputStream) { | |||
| 377 | 377 | ||
| 378 | 378 | } | |
| 379 | 379 | ||
| 380 | - | var xMediaFileSetResource func(uintptr, string) | |
| 380 | + | var xMediaFileSetResource func(uintptr, uintptr) | |
| 381 | 381 | ||
| 382 | 382 | // Sets the `GtkMediaFile` to play the given resource. | |
| 383 | 383 | // | |
| 384 | 384 | // This is a utility function that converts the given @resource_path | |
| 385 | 385 | // to a `GFile` and calls [method@Gtk.MediaFile.set_file]. | |
| 386 | - | func (x *MediaFile) SetResource(ResourcePathVar string) { | |
| 386 | + | func (x *MediaFile) SetResource(ResourcePathVar *string) { | |
| 387 | 387 | ||
| 388 | - | xMediaFileSetResource(x.GoPointer(), ResourcePathVar) | |
| 388 | + | xMediaFileSetResource(x.GoPointer(), core.NullableStringToPtr(ResourcePathVar)) | |
| 389 | 389 | ||
| 390 | 390 | } | |
| 391 | 391 | ||
M v4/gtk/gtkmenubutton.go +33 -3
| @@ -347,7 +347,37 @@ var xMenuButtonSetCreatePopupFunc func(uintptr, uintptr, uintptr, uintptr) | |||
| 347 | 347 | // @menu_button. Instead, this can be done manually in @func. | |
| 348 | 348 | func (x *MenuButton) SetCreatePopupFunc(FuncVar *MenuButtonCreatePopupFunc, UserDataVar uintptr, DestroyNotifyVar *glib.DestroyNotify) { | |
| 349 | 349 | ||
| 350 | - | xMenuButtonSetCreatePopupFunc(x.GoPointer(), glib.NewCallbackNullable(FuncVar), UserDataVar, glib.NewCallbackNullable(DestroyNotifyVar)) | |
| 350 | + | var FuncVarRef uintptr | |
| 351 | + | if FuncVar != nil { | |
| 352 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 353 | + | if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok { | |
| 354 | + | FuncVarRef = cbRefPtr | |
| 355 | + | } else { | |
| 356 | + | fcb := func(arg0 uintptr, arg1 uintptr) { | |
| 357 | + | cbFn := *FuncVar | |
| 358 | + | cbFn(arg0, arg1) | |
| 359 | + | } | |
| 360 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 361 | + | glib.SaveCallback(FuncVarPtr, FuncVarRef) | |
| 362 | + | } | |
| 363 | + | } | |
| 364 | + | ||
| 365 | + | var DestroyNotifyVarRef uintptr | |
| 366 | + | if DestroyNotifyVar != nil { | |
| 367 | + | DestroyNotifyVarPtr := uintptr(unsafe.Pointer(DestroyNotifyVar)) | |
| 368 | + | if cbRefPtr, ok := glib.GetCallback(DestroyNotifyVarPtr); ok { | |
| 369 | + | DestroyNotifyVarRef = cbRefPtr | |
| 370 | + | } else { | |
| 371 | + | fcb := func(arg0 uintptr) { | |
| 372 | + | cbFn := *DestroyNotifyVar | |
| 373 | + | cbFn(arg0) | |
| 374 | + | } | |
| 375 | + | DestroyNotifyVarRef = purego.NewCallback(fcb) | |
| 376 | + | glib.SaveCallback(DestroyNotifyVarPtr, DestroyNotifyVarRef) | |
| 377 | + | } | |
| 378 | + | } | |
| 379 | + | ||
| 380 | + | xMenuButtonSetCreatePopupFunc(x.GoPointer(), FuncVarRef, UserDataVar, DestroyNotifyVarRef) | |
| 351 | 381 | ||
| 352 | 382 | } | |
| 353 | 383 | ||
| @@ -547,7 +577,7 @@ func (x *MenuButton) GetPropertyHasFrame() bool { | |||
| 547 | 577 | func (x *MenuButton) SetPropertyIconName(value string) { | |
| 548 | 578 | var v gobject.Value | |
| 549 | 579 | v.Init(gobject.TypeStringVal) | |
| 550 | - | v.SetString(value) | |
| 580 | + | v.SetString(&value) | |
| 551 | 581 | x.SetProperty("icon-name", &v) | |
| 552 | 582 | } | |
| 553 | 583 | ||
| @@ -564,7 +594,7 @@ func (x *MenuButton) GetPropertyIconName() string { | |||
| 564 | 594 | func (x *MenuButton) SetPropertyLabel(value string) { | |
| 565 | 595 | var v gobject.Value | |
| 566 | 596 | v.Init(gobject.TypeStringVal) | |
| 567 | - | v.SetString(value) | |
| 597 | + | v.SetString(&value) | |
| 568 | 598 | x.SetProperty("label", &v) | |
| 569 | 599 | } | |
| 570 | 600 | ||
M v4/gtk/gtkmessagedialog.go +11 -11
| @@ -137,7 +137,7 @@ func MessageDialogNewFromInternalPtr(ptr uintptr) *MessageDialog { | |||
| 137 | 137 | return cls | |
| 138 | 138 | } | |
| 139 | 139 | ||
| 140 | - | var xNewMessageDialog func(uintptr, DialogFlags, MessageType, ButtonsType, string, ...interface{}) uintptr | |
| 140 | + | var xNewMessageDialog func(uintptr, DialogFlags, MessageType, ButtonsType, uintptr, ...interface{}) uintptr | |
| 141 | 141 | ||
| 142 | 142 | // Creates a new message dialog. | |
| 143 | 143 | // | |
| @@ -145,10 +145,10 @@ var xNewMessageDialog func(uintptr, DialogFlags, MessageType, ButtonsType, strin | |||
| 145 | 145 | // When the user clicks a button a “response” signal is emitted with | |
| 146 | 146 | // response IDs from [enum@Gtk.ResponseType]. See [class@Gtk.Dialog] | |
| 147 | 147 | // for more details. | |
| 148 | - | func NewMessageDialog(ParentVar *Window, FlagsVar DialogFlags, TypeVar MessageType, ButtonsVar ButtonsType, MessageFormatVar string, varArgs ...interface{}) *MessageDialog { | |
| 148 | + | func NewMessageDialog(ParentVar *Window, FlagsVar DialogFlags, TypeVar MessageType, ButtonsVar ButtonsType, MessageFormatVar *string, varArgs ...interface{}) *MessageDialog { | |
| 149 | 149 | var cls *MessageDialog | |
| 150 | 150 | ||
| 151 | - | cret := xNewMessageDialog(ParentVar.GoPointer(), FlagsVar, TypeVar, ButtonsVar, MessageFormatVar, varArgs...) | |
| 151 | + | cret := xNewMessageDialog(ParentVar.GoPointer(), FlagsVar, TypeVar, ButtonsVar, core.NullableStringToPtr(MessageFormatVar), varArgs...) | |
| 152 | 152 | ||
| 153 | 153 | if cret == 0 { | |
| 154 | 154 | return nil | |
| @@ -159,7 +159,7 @@ func NewMessageDialog(ParentVar *Window, FlagsVar DialogFlags, TypeVar MessageTy | |||
| 159 | 159 | return cls | |
| 160 | 160 | } | |
| 161 | 161 | ||
| 162 | - | var xNewMessageDialogWithMarkup func(uintptr, DialogFlags, MessageType, ButtonsType, string, ...interface{}) uintptr | |
| 162 | + | var xNewMessageDialogWithMarkup func(uintptr, DialogFlags, MessageType, ButtonsType, uintptr, ...interface{}) uintptr | |
| 163 | 163 | ||
| 164 | 164 | // Creates a new message dialog. | |
| 165 | 165 | // | |
| @@ -193,10 +193,10 @@ var xNewMessageDialogWithMarkup func(uintptr, DialogFlags, MessageType, ButtonsT | |||
| 193 | 193 | // markup); | |
| 194 | 194 | // | |
| 195 | 195 | // ``` | |
| 196 | - | func NewMessageDialogWithMarkup(ParentVar *Window, FlagsVar DialogFlags, TypeVar MessageType, ButtonsVar ButtonsType, MessageFormatVar string, varArgs ...interface{}) *MessageDialog { | |
| 196 | + | func NewMessageDialogWithMarkup(ParentVar *Window, FlagsVar DialogFlags, TypeVar MessageType, ButtonsVar ButtonsType, MessageFormatVar *string, varArgs ...interface{}) *MessageDialog { | |
| 197 | 197 | var cls *MessageDialog | |
| 198 | 198 | ||
| 199 | - | cret := xNewMessageDialogWithMarkup(ParentVar.GoPointer(), FlagsVar, TypeVar, ButtonsVar, MessageFormatVar, varArgs...) | |
| 199 | + | cret := xNewMessageDialogWithMarkup(ParentVar.GoPointer(), FlagsVar, TypeVar, ButtonsVar, core.NullableStringToPtr(MessageFormatVar), varArgs...) | |
| 200 | 200 | ||
| 201 | 201 | if cret == 0 { | |
| 202 | 202 | return nil | |
| @@ -234,12 +234,12 @@ func (x *MessageDialog) FormatSecondaryMarkup(MessageFormatVar string, varArgs . | |||
| 234 | 234 | ||
| 235 | 235 | } | |
| 236 | 236 | ||
| 237 | - | var xMessageDialogFormatSecondaryText func(uintptr, string, ...interface{}) | |
| 237 | + | var xMessageDialogFormatSecondaryText func(uintptr, uintptr, ...interface{}) | |
| 238 | 238 | ||
| 239 | 239 | // Sets the secondary text of the message dialog. | |
| 240 | - | func (x *MessageDialog) FormatSecondaryText(MessageFormatVar string, varArgs ...interface{}) { | |
| 240 | + | func (x *MessageDialog) FormatSecondaryText(MessageFormatVar *string, varArgs ...interface{}) { | |
| 241 | 241 | ||
| 242 | - | xMessageDialogFormatSecondaryText(x.GoPointer(), MessageFormatVar, varArgs...) | |
| 242 | + | xMessageDialogFormatSecondaryText(x.GoPointer(), core.NullableStringToPtr(MessageFormatVar), varArgs...) | |
| 243 | 243 | ||
| 244 | 244 | } | |
| 245 | 245 | ||
| @@ -290,7 +290,7 @@ func (c *MessageDialog) SetGoPointer(ptr uintptr) { | |||
| 290 | 290 | func (x *MessageDialog) SetPropertySecondaryText(value string) { | |
| 291 | 291 | var v gobject.Value | |
| 292 | 292 | v.Init(gobject.TypeStringVal) | |
| 293 | - | v.SetString(value) | |
| 293 | + | v.SetString(&value) | |
| 294 | 294 | x.SetProperty("secondary-text", &v) | |
| 295 | 295 | } | |
| 296 | 296 | ||
| @@ -330,7 +330,7 @@ func (x *MessageDialog) GetPropertySecondaryUseMarkup() bool { | |||
| 330 | 330 | func (x *MessageDialog) SetPropertyText(value string) { | |
| 331 | 331 | var v gobject.Value | |
| 332 | 332 | v.Init(gobject.TypeStringVal) | |
| 333 | - | v.SetString(value) | |
| 333 | + | v.SetString(&value) | |
| 334 | 334 | x.SetProperty("text", &v) | |
| 335 | 335 | } | |
| 336 | 336 | ||
M v4/gtk/gtknativedialog.go +1 -1
| @@ -398,7 +398,7 @@ func (x *NativeDialog) GetPropertyModal() bool { | |||
| 398 | 398 | func (x *NativeDialog) SetPropertyTitle(value string) { | |
| 399 | 399 | var v gobject.Value | |
| 400 | 400 | v.Init(gobject.TypeStringVal) | |
| 401 | - | v.SetString(value) | |
| 401 | + | v.SetString(&value) | |
| 402 | 402 | x.SetProperty("title", &v) | |
| 403 | 403 | } | |
| 404 | 404 | ||
M v4/gtk/gtknotebook.go +6 -6
| @@ -572,16 +572,16 @@ func (x *Notebook) SetCurrentPage(PageNumVar int) { | |||
| 572 | 572 | ||
| 573 | 573 | } | |
| 574 | 574 | ||
| 575 | - | var xNotebookSetGroupName func(uintptr, string) | |
| 575 | + | var xNotebookSetGroupName func(uintptr, uintptr) | |
| 576 | 576 | ||
| 577 | 577 | // Sets a group name for @notebook. | |
| 578 | 578 | // | |
| 579 | 579 | // Notebooks with the same name will be able to exchange tabs | |
| 580 | 580 | // via drag and drop. A notebook with a %NULL group name will | |
| 581 | 581 | // not be able to exchange tabs with any other notebook. | |
| 582 | - | func (x *Notebook) SetGroupName(GroupNameVar string) { | |
| 582 | + | func (x *Notebook) SetGroupName(GroupNameVar *string) { | |
| 583 | 583 | ||
| 584 | - | xNotebookSetGroupName(x.GoPointer(), GroupNameVar) | |
| 584 | + | xNotebookSetGroupName(x.GoPointer(), core.NullableStringToPtr(GroupNameVar)) | |
| 585 | 585 | ||
| 586 | 586 | } | |
| 587 | 587 | ||
| @@ -763,7 +763,7 @@ func (x *Notebook) GetPropertyEnablePopup() bool { | |||
| 763 | 763 | func (x *Notebook) SetPropertyGroupName(value string) { | |
| 764 | 764 | var v gobject.Value | |
| 765 | 765 | v.Init(gobject.TypeStringVal) | |
| 766 | - | v.SetString(value) | |
| 766 | + | v.SetString(&value) | |
| 767 | 767 | x.SetProperty("group-name", &v) | |
| 768 | 768 | } | |
| 769 | 769 | ||
| @@ -1418,7 +1418,7 @@ func (x *NotebookPage) GetPropertyDetachable() bool { | |||
| 1418 | 1418 | func (x *NotebookPage) SetPropertyMenuLabel(value string) { | |
| 1419 | 1419 | var v gobject.Value | |
| 1420 | 1420 | v.Init(gobject.TypeStringVal) | |
| 1421 | - | v.SetString(value) | |
| 1421 | + | v.SetString(&value) | |
| 1422 | 1422 | x.SetProperty("menu-label", &v) | |
| 1423 | 1423 | } | |
| 1424 | 1424 | ||
| @@ -1503,7 +1503,7 @@ func (x *NotebookPage) GetPropertyTabFill() bool { | |||
| 1503 | 1503 | func (x *NotebookPage) SetPropertyTabLabel(value string) { | |
| 1504 | 1504 | var v gobject.Value | |
| 1505 | 1505 | v.Init(gobject.TypeStringVal) | |
| 1506 | - | v.SetString(value) | |
| 1506 | + | v.SetString(&value) | |
| 1507 | 1507 | x.SetProperty("tab-label", &v) | |
| 1508 | 1508 | } | |
| 1509 | 1509 | ||
M v4/gtk/gtkpagesetup.go +9 -9
| @@ -129,18 +129,18 @@ func NewPageSetupFromGvariant(VariantVar *glib.Variant) *PageSetup { | |||
| 129 | 129 | return cls | |
| 130 | 130 | } | |
| 131 | 131 | ||
| 132 | - | var xNewPageSetupFromKeyFile func(*glib.KeyFile, string, **glib.Error) uintptr | |
| 132 | + | var xNewPageSetupFromKeyFile func(*glib.KeyFile, uintptr, **glib.Error) uintptr | |
| 133 | 133 | ||
| 134 | 134 | // Reads the page setup from the group @group_name in the key file | |
| 135 | 135 | // @key_file. | |
| 136 | 136 | // | |
| 137 | 137 | // Returns a new `GtkPageSetup` object with the restored | |
| 138 | 138 | // page setup, or %NULL if an error occurred. | |
| 139 | - | func NewPageSetupFromKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar string) (*PageSetup, error) { | |
| 139 | + | func NewPageSetupFromKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar *string) (*PageSetup, error) { | |
| 140 | 140 | var cls *PageSetup | |
| 141 | 141 | var cerr *glib.Error | |
| 142 | 142 | ||
| 143 | - | cret := xNewPageSetupFromKeyFile(KeyFileVar, GroupNameVar, &cerr) | |
| 143 | + | cret := xNewPageSetupFromKeyFile(KeyFileVar, core.NullableStringToPtr(GroupNameVar), &cerr) | |
| 144 | 144 | ||
| 145 | 145 | if cret == 0 { | |
| 146 | 146 | return nil, cerr | |
| @@ -292,14 +292,14 @@ func (x *PageSetup) LoadFile(FileNameVar string) (bool, error) { | |||
| 292 | 292 | ||
| 293 | 293 | } | |
| 294 | 294 | ||
| 295 | - | var xPageSetupLoadKeyFile func(uintptr, *glib.KeyFile, string, **glib.Error) bool | |
| 295 | + | var xPageSetupLoadKeyFile func(uintptr, *glib.KeyFile, uintptr, **glib.Error) bool | |
| 296 | 296 | ||
| 297 | 297 | // Reads the page setup from the group @group_name in the key file | |
| 298 | 298 | // @key_file. | |
| 299 | - | func (x *PageSetup) LoadKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar string) (bool, error) { | |
| 299 | + | func (x *PageSetup) LoadKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar *string) (bool, error) { | |
| 300 | 300 | var cerr *glib.Error | |
| 301 | 301 | ||
| 302 | - | cret := xPageSetupLoadKeyFile(x.GoPointer(), KeyFileVar, GroupNameVar, &cerr) | |
| 302 | + | cret := xPageSetupLoadKeyFile(x.GoPointer(), KeyFileVar, core.NullableStringToPtr(GroupNameVar), &cerr) | |
| 303 | 303 | if cerr == nil { | |
| 304 | 304 | return cret, nil | |
| 305 | 305 | } | |
| @@ -397,12 +397,12 @@ func (x *PageSetup) ToGvariant() *glib.Variant { | |||
| 397 | 397 | return cret | |
| 398 | 398 | } | |
| 399 | 399 | ||
| 400 | - | var xPageSetupToKeyFile func(uintptr, *glib.KeyFile, string) | |
| 400 | + | var xPageSetupToKeyFile func(uintptr, *glib.KeyFile, uintptr) | |
| 401 | 401 | ||
| 402 | 402 | // This function adds the page setup from @setup to @key_file. | |
| 403 | - | func (x *PageSetup) ToKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar string) { | |
| 403 | + | func (x *PageSetup) ToKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar *string) { | |
| 404 | 404 | ||
| 405 | - | xPageSetupToKeyFile(x.GoPointer(), KeyFileVar, GroupNameVar) | |
| 405 | + | xPageSetupToKeyFile(x.GoPointer(), KeyFileVar, core.NullableStringToPtr(GroupNameVar)) | |
| 406 | 406 | ||
| 407 | 407 | } | |
| 408 | 408 | ||
M v4/gtk/gtkpagesetupunixdialog.go +3 -3
| @@ -44,13 +44,13 @@ func PageSetupUnixDialogNewFromInternalPtr(ptr uintptr) *PageSetupUnixDialog { | |||
| 44 | 44 | return cls | |
| 45 | 45 | } | |
| 46 | 46 | ||
| 47 | - | var xNewPageSetupUnixDialog func(string, uintptr) uintptr | |
| 47 | + | var xNewPageSetupUnixDialog func(uintptr, uintptr) uintptr | |
| 48 | 48 | ||
| 49 | 49 | // Creates a new page setup dialog. | |
| 50 | - | func NewPageSetupUnixDialog(TitleVar string, ParentVar *Window) *PageSetupUnixDialog { | |
| 50 | + | func NewPageSetupUnixDialog(TitleVar *string, ParentVar *Window) *PageSetupUnixDialog { | |
| 51 | 51 | var cls *PageSetupUnixDialog | |
| 52 | 52 | ||
| 53 | - | cret := xNewPageSetupUnixDialog(TitleVar, ParentVar.GoPointer()) | |
| 53 | + | cret := xNewPageSetupUnixDialog(core.NullableStringToPtr(TitleVar), ParentVar.GoPointer()) | |
| 54 | 54 | ||
| 55 | 55 | if cret == 0 { | |
| 56 | 56 | return nil | |
M v4/gtk/gtkpapersize.go +6 -6
| @@ -36,7 +36,7 @@ func (x *PaperSize) GoPointer() uintptr { | |||
| 36 | 36 | return uintptr(unsafe.Pointer(x)) | |
| 37 | 37 | } | |
| 38 | 38 | ||
| 39 | - | var xNewPaperSize func(string) *PaperSize | |
| 39 | + | var xNewPaperSize func(uintptr) *PaperSize | |
| 40 | 40 | ||
| 41 | 41 | // Creates a new `GtkPaperSize` object by parsing a | |
| 42 | 42 | // [PWG 5101.1-2002](ftp://ftp.pwg.org/pub/pwg/candidates/cs-pwgmsn10-20020226-5101.1.pdf) | |
| @@ -44,9 +44,9 @@ var xNewPaperSize func(string) *PaperSize | |||
| 44 | 44 | // | |
| 45 | 45 | // If @name is %NULL, the default paper size is returned, | |
| 46 | 46 | // see [func@Gtk.PaperSize.get_default]. | |
| 47 | - | func NewPaperSize(NameVar string) *PaperSize { | |
| 47 | + | func NewPaperSize(NameVar *string) *PaperSize { | |
| 48 | 48 | ||
| 49 | - | cret := xNewPaperSize(NameVar) | |
| 49 | + | cret := xNewPaperSize(core.NullableStringToPtr(NameVar)) | |
| 50 | 50 | return cret | |
| 51 | 51 | } | |
| 52 | 52 | ||
| @@ -86,14 +86,14 @@ func NewPaperSizeFromIpp(IppNameVar string, WidthVar float64, HeightVar float64) | |||
| 86 | 86 | return cret | |
| 87 | 87 | } | |
| 88 | 88 | ||
| 89 | - | var xNewPaperSizeFromKeyFile func(*glib.KeyFile, string, **glib.Error) *PaperSize | |
| 89 | + | var xNewPaperSizeFromKeyFile func(*glib.KeyFile, uintptr, **glib.Error) *PaperSize | |
| 90 | 90 | ||
| 91 | 91 | // Reads a paper size from the group @group_name in the key file | |
| 92 | 92 | // @key_file. | |
| 93 | - | func NewPaperSizeFromKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar string) (*PaperSize, error) { | |
| 93 | + | func NewPaperSizeFromKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar *string) (*PaperSize, error) { | |
| 94 | 94 | var cerr *glib.Error | |
| 95 | 95 | ||
| 96 | - | cret := xNewPaperSizeFromKeyFile(KeyFileVar, GroupNameVar, &cerr) | |
| 96 | + | cret := xNewPaperSizeFromKeyFile(KeyFileVar, core.NullableStringToPtr(GroupNameVar), &cerr) | |
| 97 | 97 | if cerr == nil { | |
| 98 | 98 | return cret, nil | |
| 99 | 99 | } | |
M v4/gtk/gtkpasswordentry.go +1 -1
| @@ -176,7 +176,7 @@ func (x *PasswordEntry) GetPropertyActivatesDefault() bool { | |||
| 176 | 176 | func (x *PasswordEntry) SetPropertyPlaceholderText(value string) { | |
| 177 | 177 | var v gobject.Value | |
| 178 | 178 | v.Init(gobject.TypeStringVal) | |
| 179 | - | v.SetString(value) | |
| 179 | + | v.SetString(&value) | |
| 180 | 180 | x.SetProperty("placeholder-text", &v) | |
| 181 | 181 | } | |
| 182 | 182 | ||
M v4/gtk/gtkpicture.go +16 -16
| @@ -132,16 +132,16 @@ func NewPictureForFile(FileVar gio.File) *Picture { | |||
| 132 | 132 | return cls | |
| 133 | 133 | } | |
| 134 | 134 | ||
| 135 | - | var xNewPictureForFilename func(string) uintptr | |
| 135 | + | var xNewPictureForFilename func(uintptr) uintptr | |
| 136 | 136 | ||
| 137 | 137 | // Creates a new `GtkPicture` displaying the file @filename. | |
| 138 | 138 | // | |
| 139 | 139 | // This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. | |
| 140 | 140 | // See that function for details. | |
| 141 | - | func NewPictureForFilename(FilenameVar string) *Picture { | |
| 141 | + | func NewPictureForFilename(FilenameVar *string) *Picture { | |
| 142 | 142 | var cls *Picture | |
| 143 | 143 | ||
| 144 | - | cret := xNewPictureForFilename(FilenameVar) | |
| 144 | + | cret := xNewPictureForFilename(core.NullableStringToPtr(FilenameVar)) | |
| 145 | 145 | ||
| 146 | 146 | if cret == 0 { | |
| 147 | 147 | return nil | |
| @@ -194,16 +194,16 @@ func NewPictureForPixbuf(PixbufVar *gdkpixbuf.Pixbuf) *Picture { | |||
| 194 | 194 | return cls | |
| 195 | 195 | } | |
| 196 | 196 | ||
| 197 | - | var xNewPictureForResource func(string) uintptr | |
| 197 | + | var xNewPictureForResource func(uintptr) uintptr | |
| 198 | 198 | ||
| 199 | 199 | // Creates a new `GtkPicture` displaying the resource at @resource_path. | |
| 200 | 200 | // | |
| 201 | 201 | // This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. | |
| 202 | 202 | // See that function for details. | |
| 203 | - | func NewPictureForResource(ResourcePathVar string) *Picture { | |
| 203 | + | func NewPictureForResource(ResourcePathVar *string) *Picture { | |
| 204 | 204 | var cls *Picture | |
| 205 | 205 | ||
| 206 | - | cret := xNewPictureForResource(ResourcePathVar) | |
| 206 | + | cret := xNewPictureForResource(core.NullableStringToPtr(ResourcePathVar)) | |
| 207 | 207 | ||
| 208 | 208 | if cret == 0 { | |
| 209 | 209 | return nil | |
| @@ -291,7 +291,7 @@ func (x *Picture) GetPaintable() *gdk.PaintableBase { | |||
| 291 | 291 | return cls | |
| 292 | 292 | } | |
| 293 | 293 | ||
| 294 | - | var xPictureSetAlternativeText func(uintptr, string) | |
| 294 | + | var xPictureSetAlternativeText func(uintptr, uintptr) | |
| 295 | 295 | ||
| 296 | 296 | // Sets an alternative textual description for the picture contents. | |
| 297 | 297 | // | |
| @@ -300,9 +300,9 @@ var xPictureSetAlternativeText func(uintptr, string) | |||
| 300 | 300 | // This text will be made available to accessibility tools. | |
| 301 | 301 | // | |
| 302 | 302 | // If the picture cannot be described textually, set this property to %NULL. | |
| 303 | - | func (x *Picture) SetAlternativeText(AlternativeTextVar string) { | |
| 303 | + | func (x *Picture) SetAlternativeText(AlternativeTextVar *string) { | |
| 304 | 304 | ||
| 305 | - | xPictureSetAlternativeText(x.GoPointer(), AlternativeTextVar) | |
| 305 | + | xPictureSetAlternativeText(x.GoPointer(), core.NullableStringToPtr(AlternativeTextVar)) | |
| 306 | 306 | ||
| 307 | 307 | } | |
| 308 | 308 | ||
| @@ -353,7 +353,7 @@ func (x *Picture) SetFile(FileVar gio.File) { | |||
| 353 | 353 | ||
| 354 | 354 | } | |
| 355 | 355 | ||
| 356 | - | var xPictureSetFilename func(uintptr, string) | |
| 356 | + | var xPictureSetFilename func(uintptr, uintptr) | |
| 357 | 357 | ||
| 358 | 358 | // Makes @self load and display the given @filename. | |
| 359 | 359 | // | |
| @@ -365,9 +365,9 @@ var xPictureSetFilename func(uintptr, string) | |||
| 365 | 365 | // Use a proper image loading framework such as libglycin, which can | |
| 366 | 366 | // load many image formats into a `GdkTexture`, and then use | |
| 367 | 367 | // [method@Gtk.Image.set_from_paintable]. | |
| 368 | - | func (x *Picture) SetFilename(FilenameVar string) { | |
| 368 | + | func (x *Picture) SetFilename(FilenameVar *string) { | |
| 369 | 369 | ||
| 370 | - | xPictureSetFilename(x.GoPointer(), FilenameVar) | |
| 370 | + | xPictureSetFilename(x.GoPointer(), core.NullableStringToPtr(FilenameVar)) | |
| 371 | 371 | ||
| 372 | 372 | } | |
| 373 | 373 | ||
| @@ -413,15 +413,15 @@ func (x *Picture) SetPixbuf(PixbufVar *gdkpixbuf.Pixbuf) { | |||
| 413 | 413 | ||
| 414 | 414 | } | |
| 415 | 415 | ||
| 416 | - | var xPictureSetResource func(uintptr, string) | |
| 416 | + | var xPictureSetResource func(uintptr, uintptr) | |
| 417 | 417 | ||
| 418 | 418 | // Makes @self load and display the resource at the given | |
| 419 | 419 | // @resource_path. | |
| 420 | 420 | // | |
| 421 | 421 | // This is a utility function that calls [method@Gtk.Picture.set_file]. | |
| 422 | - | func (x *Picture) SetResource(ResourcePathVar string) { | |
| 422 | + | func (x *Picture) SetResource(ResourcePathVar *string) { | |
| 423 | 423 | ||
| 424 | - | xPictureSetResource(x.GoPointer(), ResourcePathVar) | |
| 424 | + | xPictureSetResource(x.GoPointer(), core.NullableStringToPtr(ResourcePathVar)) | |
| 425 | 425 | ||
| 426 | 426 | } | |
| 427 | 427 | ||
| @@ -441,7 +441,7 @@ func (c *Picture) SetGoPointer(ptr uintptr) { | |||
| 441 | 441 | func (x *Picture) SetPropertyAlternativeText(value string) { | |
| 442 | 442 | var v gobject.Value | |
| 443 | 443 | v.Init(gobject.TypeStringVal) | |
| 444 | - | v.SetString(value) | |
| 444 | + | v.SetString(&value) | |
| 445 | 445 | x.SetProperty("alternative-text", &v) | |
| 446 | 446 | } | |
| 447 | 447 | ||
M v4/gtk/gtkpopovermenu.go +1 -1
| @@ -291,7 +291,7 @@ func (c *PopoverMenu) SetGoPointer(ptr uintptr) { | |||
| 291 | 291 | func (x *PopoverMenu) SetPropertyVisibleSubmenu(value string) { | |
| 292 | 292 | var v gobject.Value | |
| 293 | 293 | v.Init(gobject.TypeStringVal) | |
| 294 | - | v.SetString(value) | |
| 294 | + | v.SetString(&value) | |
| 295 | 295 | x.SetProperty("visible-submenu", &v) | |
| 296 | 296 | } | |
| 297 | 297 | ||
M v4/gtk/gtkprintdialog.go +50 -5
| @@ -226,7 +226,22 @@ var xPrintDialogPrint func(uintptr, uintptr, *PrintSetup, uintptr, uintptr, uint | |||
| 226 | 226 | // The @callback will be called when the printing is done. | |
| 227 | 227 | func (x *PrintDialog) Print(ParentVar *Window, SetupVar *PrintSetup, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 228 | 228 | ||
| 229 | - | xPrintDialogPrint(x.GoPointer(), ParentVar.GoPointer(), SetupVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 229 | + | var CallbackVarRef uintptr | |
| 230 | + | if CallbackVar != nil { | |
| 231 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 232 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 233 | + | CallbackVarRef = cbRefPtr | |
| 234 | + | } else { | |
| 235 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 236 | + | cbFn := *CallbackVar | |
| 237 | + | cbFn(arg0, arg1, arg2) | |
| 238 | + | } | |
| 239 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 240 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 241 | + | } | |
| 242 | + | } | |
| 243 | + | ||
| 244 | + | xPrintDialogPrint(x.GoPointer(), ParentVar.GoPointer(), SetupVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 230 | 245 | ||
| 231 | 246 | } | |
| 232 | 247 | ||
| @@ -238,7 +253,22 @@ var xPrintDialogPrintFile func(uintptr, uintptr, *PrintSetup, uintptr, uintptr, | |||
| 238 | 253 | // Otherwise, it will attempt to print directly, without user interaction. | |
| 239 | 254 | func (x *PrintDialog) PrintFile(ParentVar *Window, SetupVar *PrintSetup, FileVar gio.File, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 240 | 255 | ||
| 241 | - | xPrintDialogPrintFile(x.GoPointer(), ParentVar.GoPointer(), SetupVar, FileVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 256 | + | var CallbackVarRef uintptr | |
| 257 | + | if CallbackVar != nil { | |
| 258 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 259 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 260 | + | CallbackVarRef = cbRefPtr | |
| 261 | + | } else { | |
| 262 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 263 | + | cbFn := *CallbackVar | |
| 264 | + | cbFn(arg0, arg1, arg2) | |
| 265 | + | } | |
| 266 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 267 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 268 | + | } | |
| 269 | + | } | |
| 270 | + | ||
| 271 | + | xPrintDialogPrintFile(x.GoPointer(), ParentVar.GoPointer(), SetupVar, FileVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 242 | 272 | ||
| 243 | 273 | } | |
| 244 | 274 | ||
| @@ -359,7 +389,22 @@ var xPrintDialogSetup func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||
| 359 | 389 | // to do the printing without further user interaction. | |
| 360 | 390 | func (x *PrintDialog) Setup(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 361 | 391 | ||
| 362 | - | xPrintDialogSetup(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 392 | + | var CallbackVarRef uintptr | |
| 393 | + | if CallbackVar != nil { | |
| 394 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 395 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 396 | + | CallbackVarRef = cbRefPtr | |
| 397 | + | } else { | |
| 398 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 399 | + | cbFn := *CallbackVar | |
| 400 | + | cbFn(arg0, arg1, arg2) | |
| 401 | + | } | |
| 402 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 403 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 404 | + | } | |
| 405 | + | } | |
| 406 | + | ||
| 407 | + | xPrintDialogSetup(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 363 | 408 | ||
| 364 | 409 | } | |
| 365 | 410 | ||
| @@ -401,7 +446,7 @@ func (c *PrintDialog) SetGoPointer(ptr uintptr) { | |||
| 401 | 446 | func (x *PrintDialog) SetPropertyAcceptLabel(value string) { | |
| 402 | 447 | var v gobject.Value | |
| 403 | 448 | v.Init(gobject.TypeStringVal) | |
| 404 | - | v.SetString(value) | |
| 449 | + | v.SetString(&value) | |
| 405 | 450 | x.SetProperty("accept-label", &v) | |
| 406 | 451 | } | |
| 407 | 452 | ||
| @@ -437,7 +482,7 @@ func (x *PrintDialog) GetPropertyModal() bool { | |||
| 437 | 482 | func (x *PrintDialog) SetPropertyTitle(value string) { | |
| 438 | 483 | var v gobject.Value | |
| 439 | 484 | v.Init(gobject.TypeStringVal) | |
| 440 | - | v.SetString(value) | |
| 485 | + | v.SetString(&value) | |
| 441 | 486 | x.SetProperty("title", &v) | |
| 442 | 487 | } | |
| 443 | 488 | ||
M v4/gtk/gtkprinter.go +32 -2
| @@ -75,7 +75,37 @@ var xEnumeratePrinters func(uintptr, uintptr, uintptr, bool) | |||
| 75 | 75 | // If @func returns true, the enumeration is stopped. | |
| 76 | 76 | func EnumeratePrinters(FuncVar *PrinterFunc, DataVar uintptr, DestroyVar *glib.DestroyNotify, WaitVar bool) { | |
| 77 | 77 | ||
| 78 | - | xEnumeratePrinters(glib.NewCallback(FuncVar), DataVar, glib.NewCallback(DestroyVar), WaitVar) | |
| 78 | + | var FuncVarRef uintptr | |
| 79 | + | if FuncVar != nil { | |
| 80 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 81 | + | if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok { | |
| 82 | + | FuncVarRef = cbRefPtr | |
| 83 | + | } else { | |
| 84 | + | fcb := func(arg0 uintptr, arg1 uintptr) bool { | |
| 85 | + | cbFn := *FuncVar | |
| 86 | + | return cbFn(arg0, arg1) | |
| 87 | + | } | |
| 88 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 89 | + | glib.SaveCallback(FuncVarPtr, FuncVarRef) | |
| 90 | + | } | |
| 91 | + | } | |
| 92 | + | ||
| 93 | + | var DestroyVarRef uintptr | |
| 94 | + | if DestroyVar != nil { | |
| 95 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 96 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 97 | + | DestroyVarRef = cbRefPtr | |
| 98 | + | } else { | |
| 99 | + | fcb := func(arg0 uintptr) { | |
| 100 | + | cbFn := *DestroyVar | |
| 101 | + | cbFn(arg0) | |
| 102 | + | } | |
| 103 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 104 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 105 | + | } | |
| 106 | + | } | |
| 107 | + | ||
| 108 | + | xEnumeratePrinters(FuncVarRef, DataVar, DestroyVarRef, WaitVar) | |
| 79 | 109 | ||
| 80 | 110 | } | |
| 81 | 111 | ||
| @@ -463,7 +493,7 @@ func (x *Printer) GetPropertyLocation() string { | |||
| 463 | 493 | func (x *Printer) SetPropertyName(value string) { | |
| 464 | 494 | var v gobject.Value | |
| 465 | 495 | v.Init(gobject.TypeStringVal) | |
| 466 | - | v.SetString(value) | |
| 496 | + | v.SetString(&value) | |
| 467 | 497 | x.SetProperty("name", &v) | |
| 468 | 498 | } | |
| 469 | 499 | ||
M v4/gtk/gtkprintjob.go +32 -2
| @@ -232,7 +232,37 @@ var xPrintJobSend func(uintptr, uintptr, uintptr, uintptr) | |||
| 232 | 232 | // Sends the print job off to the printer. | |
| 233 | 233 | func (x *PrintJob) Send(CallbackVar *PrintJobCompleteFunc, UserDataVar uintptr, DnotifyVar *glib.DestroyNotify) { | |
| 234 | 234 | ||
| 235 | - | xPrintJobSend(x.GoPointer(), glib.NewCallback(CallbackVar), UserDataVar, glib.NewCallback(DnotifyVar)) | |
| 235 | + | var CallbackVarRef uintptr | |
| 236 | + | if CallbackVar != nil { | |
| 237 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 238 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 239 | + | CallbackVarRef = cbRefPtr | |
| 240 | + | } else { | |
| 241 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 *glib.Error) { | |
| 242 | + | cbFn := *CallbackVar | |
| 243 | + | cbFn(arg0, arg1, arg2) | |
| 244 | + | } | |
| 245 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 246 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 247 | + | } | |
| 248 | + | } | |
| 249 | + | ||
| 250 | + | var DnotifyVarRef uintptr | |
| 251 | + | if DnotifyVar != nil { | |
| 252 | + | DnotifyVarPtr := uintptr(unsafe.Pointer(DnotifyVar)) | |
| 253 | + | if cbRefPtr, ok := glib.GetCallback(DnotifyVarPtr); ok { | |
| 254 | + | DnotifyVarRef = cbRefPtr | |
| 255 | + | } else { | |
| 256 | + | fcb := func(arg0 uintptr) { | |
| 257 | + | cbFn := *DnotifyVar | |
| 258 | + | cbFn(arg0) | |
| 259 | + | } | |
| 260 | + | DnotifyVarRef = purego.NewCallback(fcb) | |
| 261 | + | glib.SaveCallback(DnotifyVarPtr, DnotifyVarRef) | |
| 262 | + | } | |
| 263 | + | } | |
| 264 | + | ||
| 265 | + | xPrintJobSend(x.GoPointer(), CallbackVarRef, UserDataVar, DnotifyVarRef) | |
| 236 | 266 | ||
| 237 | 267 | } | |
| 238 | 268 | ||
| @@ -404,7 +434,7 @@ func (c *PrintJob) SetGoPointer(ptr uintptr) { | |||
| 404 | 434 | func (x *PrintJob) SetPropertyTitle(value string) { | |
| 405 | 435 | var v gobject.Value | |
| 406 | 436 | v.Init(gobject.TypeStringVal) | |
| 407 | - | v.SetString(value) | |
| 437 | + | v.SetString(&value) | |
| 408 | 438 | x.SetProperty("title", &v) | |
| 409 | 439 | } | |
| 410 | 440 | ||
M v4/gtk/gtkprintoperation.go +22 -7
| @@ -528,7 +528,22 @@ var xPrintRunPageSetupDialogAsync func(uintptr, uintptr, uintptr, uintptr, uintp | |||
| 528 | 528 | // @done_cb from a signal handler for the ::response signal of the dialog. | |
| 529 | 529 | func PrintRunPageSetupDialogAsync(ParentVar *Window, PageSetupVar *PageSetup, SettingsVar *PrintSettings, DoneCbVar *PageSetupDoneFunc, DataVar uintptr) { | |
| 530 | 530 | ||
| 531 | - | xPrintRunPageSetupDialogAsync(ParentVar.GoPointer(), PageSetupVar.GoPointer(), SettingsVar.GoPointer(), glib.NewCallback(DoneCbVar), DataVar) | |
| 531 | + | var DoneCbVarRef uintptr | |
| 532 | + | if DoneCbVar != nil { | |
| 533 | + | DoneCbVarPtr := uintptr(unsafe.Pointer(DoneCbVar)) | |
| 534 | + | if cbRefPtr, ok := glib.GetCallback(DoneCbVarPtr); ok { | |
| 535 | + | DoneCbVarRef = cbRefPtr | |
| 536 | + | } else { | |
| 537 | + | fcb := func(arg0 uintptr, arg1 uintptr) { | |
| 538 | + | cbFn := *DoneCbVar | |
| 539 | + | cbFn(arg0, arg1) | |
| 540 | + | } | |
| 541 | + | DoneCbVarRef = purego.NewCallback(fcb) | |
| 542 | + | glib.SaveCallback(DoneCbVarPtr, DoneCbVarRef) | |
| 543 | + | } | |
| 544 | + | } | |
| 545 | + | ||
| 546 | + | xPrintRunPageSetupDialogAsync(ParentVar.GoPointer(), PageSetupVar.GoPointer(), SettingsVar.GoPointer(), DoneCbVarRef, DataVar) | |
| 532 | 547 | ||
| 533 | 548 | } | |
| 534 | 549 | ||
| @@ -910,12 +925,12 @@ func (x *PrintOperation) SetCurrentPage(CurrentPageVar int) { | |||
| 910 | 925 | ||
| 911 | 926 | } | |
| 912 | 927 | ||
| 913 | - | var xPrintOperationSetCustomTabLabel func(uintptr, string) | |
| 928 | + | var xPrintOperationSetCustomTabLabel func(uintptr, uintptr) | |
| 914 | 929 | ||
| 915 | 930 | // Sets the label for the tab holding custom widgets. | |
| 916 | - | func (x *PrintOperation) SetCustomTabLabel(LabelVar string) { | |
| 931 | + | func (x *PrintOperation) SetCustomTabLabel(LabelVar *string) { | |
| 917 | 932 | ||
| 918 | - | xPrintOperationSetCustomTabLabel(x.GoPointer(), LabelVar) | |
| 933 | + | xPrintOperationSetCustomTabLabel(x.GoPointer(), core.NullableStringToPtr(LabelVar)) | |
| 919 | 934 | ||
| 920 | 935 | } | |
| 921 | 936 | ||
| @@ -1178,7 +1193,7 @@ func (x *PrintOperation) GetPropertyCurrentPage() int { | |||
| 1178 | 1193 | func (x *PrintOperation) SetPropertyCustomTabLabel(value string) { | |
| 1179 | 1194 | var v gobject.Value | |
| 1180 | 1195 | v.Init(gobject.TypeStringVal) | |
| 1181 | - | v.SetString(value) | |
| 1196 | + | v.SetString(&value) | |
| 1182 | 1197 | x.SetProperty("custom-tab-label", &v) | |
| 1183 | 1198 | } | |
| 1184 | 1199 | ||
| @@ -1227,7 +1242,7 @@ func (x *PrintOperation) GetPropertyEmbedPageSetup() bool { | |||
| 1227 | 1242 | func (x *PrintOperation) SetPropertyExportFilename(value string) { | |
| 1228 | 1243 | var v gobject.Value | |
| 1229 | 1244 | v.Init(gobject.TypeStringVal) | |
| 1230 | - | v.SetString(value) | |
| 1245 | + | v.SetString(&value) | |
| 1231 | 1246 | x.SetProperty("export-filename", &v) | |
| 1232 | 1247 | } | |
| 1233 | 1248 | ||
| @@ -1280,7 +1295,7 @@ func (x *PrintOperation) GetPropertyHasSelection() bool { | |||
| 1280 | 1295 | func (x *PrintOperation) SetPropertyJobName(value string) { | |
| 1281 | 1296 | var v gobject.Value | |
| 1282 | 1297 | v.Init(gobject.TypeStringVal) | |
| 1283 | - | v.SetString(value) | |
| 1298 | + | v.SetString(&value) | |
| 1284 | 1299 | x.SetProperty("job-name", &v) | |
| 1285 | 1300 | } | |
| 1286 | 1301 | ||
M v4/gtk/gtkprintsettings.go +28 -13
| @@ -207,18 +207,18 @@ func NewPrintSettingsFromGvariant(VariantVar *glib.Variant) *PrintSettings { | |||
| 207 | 207 | return cls | |
| 208 | 208 | } | |
| 209 | 209 | ||
| 210 | - | var xNewPrintSettingsFromKeyFile func(*glib.KeyFile, string, **glib.Error) uintptr | |
| 210 | + | var xNewPrintSettingsFromKeyFile func(*glib.KeyFile, uintptr, **glib.Error) uintptr | |
| 211 | 211 | ||
| 212 | 212 | // Reads the print settings from the group @group_name in @key_file. | |
| 213 | 213 | // | |
| 214 | 214 | // Returns a new `GtkPrintSettings` object with the restored settings, | |
| 215 | 215 | // or %NULL if an error occurred. If the file could not be loaded then | |
| 216 | 216 | // error is set to either `GFileError` or `GKeyFileError`. | |
| 217 | - | func NewPrintSettingsFromKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar string) (*PrintSettings, error) { | |
| 217 | + | func NewPrintSettingsFromKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar *string) (*PrintSettings, error) { | |
| 218 | 218 | var cls *PrintSettings | |
| 219 | 219 | var cerr *glib.Error | |
| 220 | 220 | ||
| 221 | - | cret := xNewPrintSettingsFromKeyFile(KeyFileVar, GroupNameVar, &cerr) | |
| 221 | + | cret := xNewPrintSettingsFromKeyFile(KeyFileVar, core.NullableStringToPtr(GroupNameVar), &cerr) | |
| 222 | 222 | ||
| 223 | 223 | if cret == 0 { | |
| 224 | 224 | return nil, cerr | |
| @@ -253,7 +253,22 @@ var xPrintSettingsForeach func(uintptr, uintptr, uintptr) | |||
| 253 | 253 | // Calls @func for each key-value pair of @settings. | |
| 254 | 254 | func (x *PrintSettings) Foreach(FuncVar *PrintSettingsFunc, UserDataVar uintptr) { | |
| 255 | 255 | ||
| 256 | - | xPrintSettingsForeach(x.GoPointer(), glib.NewCallback(FuncVar), UserDataVar) | |
| 256 | + | var FuncVarRef uintptr | |
| 257 | + | if FuncVar != nil { | |
| 258 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 259 | + | if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok { | |
| 260 | + | FuncVarRef = cbRefPtr | |
| 261 | + | } else { | |
| 262 | + | fcb := func(arg0 string, arg1 string, arg2 uintptr) { | |
| 263 | + | cbFn := *FuncVar | |
| 264 | + | cbFn(arg0, arg1, arg2) | |
| 265 | + | } | |
| 266 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 267 | + | glib.SaveCallback(FuncVarPtr, FuncVarRef) | |
| 268 | + | } | |
| 269 | + | } | |
| 270 | + | ||
| 271 | + | xPrintSettingsForeach(x.GoPointer(), FuncVarRef, UserDataVar) | |
| 257 | 272 | ||
| 258 | 273 | } | |
| 259 | 274 | ||
| @@ -601,16 +616,16 @@ func (x *PrintSettings) LoadFile(FileNameVar string) (bool, error) { | |||
| 601 | 616 | ||
| 602 | 617 | } | |
| 603 | 618 | ||
| 604 | - | var xPrintSettingsLoadKeyFile func(uintptr, *glib.KeyFile, string, **glib.Error) bool | |
| 619 | + | var xPrintSettingsLoadKeyFile func(uintptr, *glib.KeyFile, uintptr, **glib.Error) bool | |
| 605 | 620 | ||
| 606 | 621 | // Reads the print settings from the group @group_name in @key_file. | |
| 607 | 622 | // | |
| 608 | 623 | // If the file could not be loaded then error is set to either a | |
| 609 | 624 | // `GFileError` or `GKeyFileError`. | |
| 610 | - | func (x *PrintSettings) LoadKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar string) (bool, error) { | |
| 625 | + | func (x *PrintSettings) LoadKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar *string) (bool, error) { | |
| 611 | 626 | var cerr *glib.Error | |
| 612 | 627 | ||
| 613 | - | cret := xPrintSettingsLoadKeyFile(x.GoPointer(), KeyFileVar, GroupNameVar, &cerr) | |
| 628 | + | cret := xPrintSettingsLoadKeyFile(x.GoPointer(), KeyFileVar, core.NullableStringToPtr(GroupNameVar), &cerr) | |
| 614 | 629 | if cerr == nil { | |
| 615 | 630 | return cret, nil | |
| 616 | 631 | } | |
| @@ -618,12 +633,12 @@ func (x *PrintSettings) LoadKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar strin | |||
| 618 | 633 | ||
| 619 | 634 | } | |
| 620 | 635 | ||
| 621 | - | var xPrintSettingsSet func(uintptr, string, string) | |
| 636 | + | var xPrintSettingsSet func(uintptr, string, uintptr) | |
| 622 | 637 | ||
| 623 | 638 | // Associates @value with @key. | |
| 624 | - | func (x *PrintSettings) Set(KeyVar string, ValueVar string) { | |
| 639 | + | func (x *PrintSettings) Set(KeyVar string, ValueVar *string) { | |
| 625 | 640 | ||
| 626 | - | xPrintSettingsSet(x.GoPointer(), KeyVar, ValueVar) | |
| 641 | + | xPrintSettingsSet(x.GoPointer(), KeyVar, core.NullableStringToPtr(ValueVar)) | |
| 627 | 642 | ||
| 628 | 643 | } | |
| 629 | 644 | ||
| @@ -923,12 +938,12 @@ func (x *PrintSettings) ToGvariant() *glib.Variant { | |||
| 923 | 938 | return cret | |
| 924 | 939 | } | |
| 925 | 940 | ||
| 926 | - | var xPrintSettingsToKeyFile func(uintptr, *glib.KeyFile, string) | |
| 941 | + | var xPrintSettingsToKeyFile func(uintptr, *glib.KeyFile, uintptr) | |
| 927 | 942 | ||
| 928 | 943 | // This function adds the print settings from @settings to @key_file. | |
| 929 | - | func (x *PrintSettings) ToKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar string) { | |
| 944 | + | func (x *PrintSettings) ToKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar *string) { | |
| 930 | 945 | ||
| 931 | - | xPrintSettingsToKeyFile(x.GoPointer(), KeyFileVar, GroupNameVar) | |
| 946 | + | xPrintSettingsToKeyFile(x.GoPointer(), KeyFileVar, core.NullableStringToPtr(GroupNameVar)) | |
| 932 | 947 | ||
| 933 | 948 | } | |
| 934 | 949 | ||
M v4/gtk/gtkprintunixdialog.go +3 -3
| @@ -89,13 +89,13 @@ func PrintUnixDialogNewFromInternalPtr(ptr uintptr) *PrintUnixDialog { | |||
| 89 | 89 | return cls | |
| 90 | 90 | } | |
| 91 | 91 | ||
| 92 | - | var xNewPrintUnixDialog func(string, uintptr) uintptr | |
| 92 | + | var xNewPrintUnixDialog func(uintptr, uintptr) uintptr | |
| 93 | 93 | ||
| 94 | 94 | // Creates a new `GtkPrintUnixDialog`. | |
| 95 | - | func NewPrintUnixDialog(TitleVar string, ParentVar *Window) *PrintUnixDialog { | |
| 95 | + | func NewPrintUnixDialog(TitleVar *string, ParentVar *Window) *PrintUnixDialog { | |
| 96 | 96 | var cls *PrintUnixDialog | |
| 97 | 97 | ||
| 98 | - | cret := xNewPrintUnixDialog(TitleVar, ParentVar.GoPointer()) | |
| 98 | + | cret := xNewPrintUnixDialog(core.NullableStringToPtr(TitleVar), ParentVar.GoPointer()) | |
| 99 | 99 | ||
| 100 | 100 | if cret == 0 { | |
| 101 | 101 | return nil | |
M v4/gtk/gtkprogressbar.go +4 -4
| @@ -239,7 +239,7 @@ func (x *ProgressBar) SetShowText(ShowTextVar bool) { | |||
| 239 | 239 | ||
| 240 | 240 | } | |
| 241 | 241 | ||
| 242 | - | var xProgressBarSetText func(uintptr, string) | |
| 242 | + | var xProgressBarSetText func(uintptr, uintptr) | |
| 243 | 243 | ||
| 244 | 244 | // Causes the given @text to appear next to the progress bar. | |
| 245 | 245 | // | |
| @@ -252,9 +252,9 @@ var xProgressBarSetText func(uintptr, string) | |||
| 252 | 252 | // percentage. If @text is the empty string, the progress bar will still | |
| 253 | 253 | // be styled and sized suitably for containing text, as long as | |
| 254 | 254 | // [property@Gtk.ProgressBar:show-text] is %TRUE. | |
| 255 | - | func (x *ProgressBar) SetText(TextVar string) { | |
| 255 | + | func (x *ProgressBar) SetText(TextVar *string) { | |
| 256 | 256 | ||
| 257 | - | xProgressBarSetText(x.GoPointer(), TextVar) | |
| 257 | + | xProgressBarSetText(x.GoPointer(), core.NullableStringToPtr(TextVar)) | |
| 258 | 258 | ||
| 259 | 259 | } | |
| 260 | 260 | ||
| @@ -360,7 +360,7 @@ func (x *ProgressBar) GetPropertyShowText() bool { | |||
| 360 | 360 | func (x *ProgressBar) SetPropertyText(value string) { | |
| 361 | 361 | var v gobject.Value | |
| 362 | 362 | v.Init(gobject.TypeStringVal) | |
| 363 | - | v.SetString(value) | |
| 363 | + | v.SetString(&value) | |
| 364 | 364 | x.SetProperty("text", &v) | |
| 365 | 365 | } | |
| 366 | 366 | ||
M v4/gtk/gtkrecentmanager.go +7 -7
| @@ -53,17 +53,17 @@ func (x *RecentInfo) GoPointer() uintptr { | |||
| 53 | 53 | return uintptr(unsafe.Pointer(x)) | |
| 54 | 54 | } | |
| 55 | 55 | ||
| 56 | - | var xRecentInfoCreateAppInfo func(uintptr, string, **glib.Error) uintptr | |
| 56 | + | var xRecentInfoCreateAppInfo func(uintptr, uintptr, **glib.Error) uintptr | |
| 57 | 57 | ||
| 58 | 58 | // Creates a `GAppInfo` for the specified `GtkRecentInfo` | |
| 59 | 59 | // | |
| 60 | 60 | // In case of error, @error will be set either with a | |
| 61 | 61 | // %GTK_RECENT_MANAGER_ERROR or a %G_IO_ERROR | |
| 62 | - | func (x *RecentInfo) CreateAppInfo(AppNameVar string) (*gio.AppInfoBase, error) { | |
| 62 | + | func (x *RecentInfo) CreateAppInfo(AppNameVar *string) (*gio.AppInfoBase, error) { | |
| 63 | 63 | var cls *gio.AppInfoBase | |
| 64 | 64 | var cerr *glib.Error | |
| 65 | 65 | ||
| 66 | - | cret := xRecentInfoCreateAppInfo(x.GoPointer(), AppNameVar, &cerr) | |
| 66 | + | cret := xRecentInfoCreateAppInfo(x.GoPointer(), core.NullableStringToPtr(AppNameVar), &cerr) | |
| 67 | 67 | ||
| 68 | 68 | if cret == 0 { | |
| 69 | 69 | return nil, cerr | |
| @@ -690,16 +690,16 @@ func (x *RecentManager) LookupItem(UriVar string) (*RecentInfo, error) { | |||
| 690 | 690 | ||
| 691 | 691 | } | |
| 692 | 692 | ||
| 693 | - | var xRecentManagerMoveItem func(uintptr, string, string, **glib.Error) bool | |
| 693 | + | var xRecentManagerMoveItem func(uintptr, string, uintptr, **glib.Error) bool | |
| 694 | 694 | ||
| 695 | 695 | // Changes the location of a recently used resource from @uri to @new_uri. | |
| 696 | 696 | // | |
| 697 | 697 | // Please note that this function will not affect the resource pointed | |
| 698 | 698 | // by the URIs, but only the URI used in the recently used resources list. | |
| 699 | - | func (x *RecentManager) MoveItem(UriVar string, NewUriVar string) (bool, error) { | |
| 699 | + | func (x *RecentManager) MoveItem(UriVar string, NewUriVar *string) (bool, error) { | |
| 700 | 700 | var cerr *glib.Error | |
| 701 | 701 | ||
| 702 | - | cret := xRecentManagerMoveItem(x.GoPointer(), UriVar, NewUriVar, &cerr) | |
| 702 | + | cret := xRecentManagerMoveItem(x.GoPointer(), UriVar, core.NullableStringToPtr(NewUriVar), &cerr) | |
| 703 | 703 | if cerr == nil { | |
| 704 | 704 | return cret, nil | |
| 705 | 705 | } | |
| @@ -753,7 +753,7 @@ func (c *RecentManager) SetGoPointer(ptr uintptr) { | |||
| 753 | 753 | func (x *RecentManager) SetPropertyFilename(value string) { | |
| 754 | 754 | var v gobject.Value | |
| 755 | 755 | v.Init(gobject.TypeStringVal) | |
| 756 | - | v.SetString(value) | |
| 756 | + | v.SetString(&value) | |
| 757 | 757 | x.SetProperty("filename", &v) | |
| 758 | 758 | } | |
| 759 | 759 | ||
M v4/gtk/gtkscale.go +34 -4
| @@ -211,7 +211,7 @@ func NewScaleWithRange(OrientationVar Orientation, MinVar float64, MaxVar float6 | |||
| 211 | 211 | return cls | |
| 212 | 212 | } | |
| 213 | 213 | ||
| 214 | - | var xScaleAddMark func(uintptr, float64, PositionType, string) | |
| 214 | + | var xScaleAddMark func(uintptr, float64, PositionType, uintptr) | |
| 215 | 215 | ||
| 216 | 216 | // Adds a mark at @value. | |
| 217 | 217 | // | |
| @@ -222,9 +222,9 @@ var xScaleAddMark func(uintptr, float64, PositionType, string) | |||
| 222 | 222 | // If @markup is not %NULL, text is shown next to the tick mark. | |
| 223 | 223 | // | |
| 224 | 224 | // To remove marks from a scale, use [method@Gtk.Scale.clear_marks]. | |
| 225 | - | func (x *Scale) AddMark(ValueVar float64, PositionVar PositionType, MarkupVar string) { | |
| 225 | + | func (x *Scale) AddMark(ValueVar float64, PositionVar PositionType, MarkupVar *string) { | |
| 226 | 226 | ||
| 227 | - | xScaleAddMark(x.GoPointer(), ValueVar, PositionVar, MarkupVar) | |
| 227 | + | xScaleAddMark(x.GoPointer(), ValueVar, PositionVar, core.NullableStringToPtr(MarkupVar)) | |
| 228 | 228 | ||
| 229 | 229 | } | |
| 230 | 230 | ||
| @@ -352,7 +352,37 @@ var xScaleSetFormatValueFunc func(uintptr, uintptr, uintptr, uintptr) | |||
| 352 | 352 | // [property@Gtk.Scale:digits] property. | |
| 353 | 353 | func (x *Scale) SetFormatValueFunc(FuncVar *ScaleFormatValueFunc, UserDataVar uintptr, DestroyNotifyVar *glib.DestroyNotify) { | |
| 354 | 354 | ||
| 355 | - | xScaleSetFormatValueFunc(x.GoPointer(), glib.NewCallbackNullable(FuncVar), UserDataVar, glib.NewCallbackNullable(DestroyNotifyVar)) | |
| 355 | + | var FuncVarRef uintptr | |
| 356 | + | if FuncVar != nil { | |
| 357 | + | FuncVarPtr := uintptr(unsafe.Pointer(FuncVar)) | |
| 358 | + | if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok { | |
| 359 | + | FuncVarRef = cbRefPtr | |
| 360 | + | } else { | |
| 361 | + | fcb := func(arg0 uintptr, arg1 float64, arg2 uintptr) string { | |
| 362 | + | cbFn := *FuncVar | |
| 363 | + | return cbFn(arg0, arg1, arg2) | |
| 364 | + | } | |
| 365 | + | FuncVarRef = purego.NewCallback(fcb) | |
| 366 | + | glib.SaveCallback(FuncVarPtr, FuncVarRef) | |
| 367 | + | } | |
| 368 | + | } | |
| 369 | + | ||
| 370 | + | var DestroyNotifyVarRef uintptr | |
| 371 | + | if DestroyNotifyVar != nil { | |
| 372 | + | DestroyNotifyVarPtr := uintptr(unsafe.Pointer(DestroyNotifyVar)) | |
| 373 | + | if cbRefPtr, ok := glib.GetCallback(DestroyNotifyVarPtr); ok { | |
| 374 | + | DestroyNotifyVarRef = cbRefPtr | |
| 375 | + | } else { | |
| 376 | + | fcb := func(arg0 uintptr) { | |
| 377 | + | cbFn := *DestroyNotifyVar | |
| 378 | + | cbFn(arg0) | |
| 379 | + | } | |
| 380 | + | DestroyNotifyVarRef = purego.NewCallback(fcb) | |
| 381 | + | glib.SaveCallback(DestroyNotifyVarPtr, DestroyNotifyVarRef) | |
| 382 | + | } | |
| 383 | + | } | |
| 384 | + | ||
| 385 | + | xScaleSetFormatValueFunc(x.GoPointer(), FuncVarRef, UserDataVar, DestroyNotifyVarRef) | |
| 356 | 386 | ||
| 357 | 387 | } | |
| 358 | 388 | ||
M v4/gtk/gtksearchentry.go +4 -4
| @@ -198,12 +198,12 @@ func (x *SearchEntry) SetKeyCaptureWidget(WidgetVar *Widget) { | |||
| 198 | 198 | ||
| 199 | 199 | } | |
| 200 | 200 | ||
| 201 | - | var xSearchEntrySetPlaceholderText func(uintptr, string) | |
| 201 | + | var xSearchEntrySetPlaceholderText func(uintptr, uintptr) | |
| 202 | 202 | ||
| 203 | 203 | // Sets the placeholder text associated with @entry. | |
| 204 | - | func (x *SearchEntry) SetPlaceholderText(TextVar string) { | |
| 204 | + | func (x *SearchEntry) SetPlaceholderText(TextVar *string) { | |
| 205 | 205 | ||
| 206 | - | xSearchEntrySetPlaceholderText(x.GoPointer(), TextVar) | |
| 206 | + | xSearchEntrySetPlaceholderText(x.GoPointer(), core.NullableStringToPtr(TextVar)) | |
| 207 | 207 | ||
| 208 | 208 | } | |
| 209 | 209 | ||
| @@ -251,7 +251,7 @@ func (x *SearchEntry) GetPropertyActivatesDefault() bool { | |||
| 251 | 251 | func (x *SearchEntry) SetPropertyPlaceholderText(value string) { | |
| 252 | 252 | var v gobject.Value | |
| 253 | 253 | v.Init(gobject.TypeStringVal) | |
| 254 | - | v.SetString(value) | |
| 254 | + | v.SetString(&value) | |
| 255 | 255 | x.SetProperty("placeholder-text", &v) | |
| 256 | 256 | } | |
| 257 | 257 | ||
M v4/gtk/gtksettings.go +14 -14
| @@ -252,7 +252,7 @@ func (x *Settings) GetPropertyGtkCursorBlinkTimeout() int { | |||
| 252 | 252 | func (x *Settings) SetPropertyGtkCursorThemeName(value string) { | |
| 253 | 253 | var v gobject.Value | |
| 254 | 254 | v.Init(gobject.TypeStringVal) | |
| 255 | - | v.SetString(value) | |
| 255 | + | v.SetString(&value) | |
| 256 | 256 | x.SetProperty("gtk-cursor-theme-name", &v) | |
| 257 | 257 | } | |
| 258 | 258 | ||
| @@ -311,7 +311,7 @@ func (x *Settings) GetPropertyGtkCursorThemeSize() int { | |||
| 311 | 311 | func (x *Settings) SetPropertyGtkDecorationLayout(value string) { | |
| 312 | 312 | var v gobject.Value | |
| 313 | 313 | v.Init(gobject.TypeStringVal) | |
| 314 | - | v.SetString(value) | |
| 314 | + | v.SetString(&value) | |
| 315 | 315 | x.SetProperty("gtk-decoration-layout", &v) | |
| 316 | 316 | } | |
| 317 | 317 | ||
| @@ -613,7 +613,7 @@ func (x *Settings) GetPropertyGtkErrorBell() bool { | |||
| 613 | 613 | func (x *Settings) SetPropertyGtkFontName(value string) { | |
| 614 | 614 | var v gobject.Value | |
| 615 | 615 | v.Init(gobject.TypeStringVal) | |
| 616 | - | v.SetString(value) | |
| 616 | + | v.SetString(&value) | |
| 617 | 617 | x.SetProperty("gtk-font-name", &v) | |
| 618 | 618 | } | |
| 619 | 619 | ||
| @@ -675,7 +675,7 @@ func (x *Settings) GetPropertyGtkHintFontMetrics() bool { | |||
| 675 | 675 | func (x *Settings) SetPropertyGtkIconThemeName(value string) { | |
| 676 | 676 | var v gobject.Value | |
| 677 | 677 | v.Init(gobject.TypeStringVal) | |
| 678 | - | v.SetString(value) | |
| 678 | + | v.SetString(&value) | |
| 679 | 679 | x.SetProperty("gtk-icon-theme-name", &v) | |
| 680 | 680 | } | |
| 681 | 681 | ||
| @@ -702,7 +702,7 @@ func (x *Settings) GetPropertyGtkIconThemeName() string { | |||
| 702 | 702 | func (x *Settings) SetPropertyGtkImModule(value string) { | |
| 703 | 703 | var v gobject.Value | |
| 704 | 704 | v.Init(gobject.TypeStringVal) | |
| 705 | - | v.SetString(value) | |
| 705 | + | v.SetString(&value) | |
| 706 | 706 | x.SetProperty("gtk-im-module", &v) | |
| 707 | 707 | } | |
| 708 | 708 | ||
| @@ -851,7 +851,7 @@ func (x *Settings) GetPropertyGtkPrimaryButtonWarpsSlider() bool { | |||
| 851 | 851 | func (x *Settings) SetPropertyGtkPrintBackends(value string) { | |
| 852 | 852 | var v gobject.Value | |
| 853 | 853 | v.Init(gobject.TypeStringVal) | |
| 854 | - | v.SetString(value) | |
| 854 | + | v.SetString(&value) | |
| 855 | 855 | x.SetProperty("gtk-print-backends", &v) | |
| 856 | 856 | } | |
| 857 | 857 | ||
| @@ -881,7 +881,7 @@ func (x *Settings) GetPropertyGtkPrintBackends() string { | |||
| 881 | 881 | func (x *Settings) SetPropertyGtkPrintPreviewCommand(value string) { | |
| 882 | 882 | var v gobject.Value | |
| 883 | 883 | v.Init(gobject.TypeStringVal) | |
| 884 | - | v.SetString(value) | |
| 884 | + | v.SetString(&value) | |
| 885 | 885 | x.SetProperty("gtk-print-preview-command", &v) | |
| 886 | 886 | } | |
| 887 | 887 | ||
| @@ -1037,7 +1037,7 @@ func (x *Settings) GetPropertyGtkShowStatusShapes() bool { | |||
| 1037 | 1037 | func (x *Settings) SetPropertyGtkSoundThemeName(value string) { | |
| 1038 | 1038 | var v gobject.Value | |
| 1039 | 1039 | v.Init(gobject.TypeStringVal) | |
| 1040 | - | v.SetString(value) | |
| 1040 | + | v.SetString(&value) | |
| 1041 | 1041 | x.SetProperty("gtk-sound-theme-name", &v) | |
| 1042 | 1042 | } | |
| 1043 | 1043 | ||
| @@ -1082,7 +1082,7 @@ func (x *Settings) GetPropertyGtkSplitCursor() bool { | |||
| 1082 | 1082 | func (x *Settings) SetPropertyGtkThemeName(value string) { | |
| 1083 | 1083 | var v gobject.Value | |
| 1084 | 1084 | v.Init(gobject.TypeStringVal) | |
| 1085 | - | v.SetString(value) | |
| 1085 | + | v.SetString(&value) | |
| 1086 | 1086 | x.SetProperty("gtk-theme-name", &v) | |
| 1087 | 1087 | } | |
| 1088 | 1088 | ||
| @@ -1106,7 +1106,7 @@ func (x *Settings) GetPropertyGtkThemeName() string { | |||
| 1106 | 1106 | func (x *Settings) SetPropertyGtkTitlebarDoubleClick(value string) { | |
| 1107 | 1107 | var v gobject.Value | |
| 1108 | 1108 | v.Init(gobject.TypeStringVal) | |
| 1109 | - | v.SetString(value) | |
| 1109 | + | v.SetString(&value) | |
| 1110 | 1110 | x.SetProperty("gtk-titlebar-double-click", &v) | |
| 1111 | 1111 | } | |
| 1112 | 1112 | ||
| @@ -1131,7 +1131,7 @@ func (x *Settings) GetPropertyGtkTitlebarDoubleClick() string { | |||
| 1131 | 1131 | func (x *Settings) SetPropertyGtkTitlebarMiddleClick(value string) { | |
| 1132 | 1132 | var v gobject.Value | |
| 1133 | 1133 | v.Init(gobject.TypeStringVal) | |
| 1134 | - | v.SetString(value) | |
| 1134 | + | v.SetString(&value) | |
| 1135 | 1135 | x.SetProperty("gtk-titlebar-middle-click", &v) | |
| 1136 | 1136 | } | |
| 1137 | 1137 | ||
| @@ -1156,7 +1156,7 @@ func (x *Settings) GetPropertyGtkTitlebarMiddleClick() string { | |||
| 1156 | 1156 | func (x *Settings) SetPropertyGtkTitlebarRightClick(value string) { | |
| 1157 | 1157 | var v gobject.Value | |
| 1158 | 1158 | v.Init(gobject.TypeStringVal) | |
| 1159 | - | v.SetString(value) | |
| 1159 | + | v.SetString(&value) | |
| 1160 | 1160 | x.SetProperty("gtk-titlebar-right-click", &v) | |
| 1161 | 1161 | } | |
| 1162 | 1162 | ||
| @@ -1243,7 +1243,7 @@ func (x *Settings) GetPropertyGtkXftHinting() int { | |||
| 1243 | 1243 | func (x *Settings) SetPropertyGtkXftHintstyle(value string) { | |
| 1244 | 1244 | var v gobject.Value | |
| 1245 | 1245 | v.Init(gobject.TypeStringVal) | |
| 1246 | - | v.SetString(value) | |
| 1246 | + | v.SetString(&value) | |
| 1247 | 1247 | x.SetProperty("gtk-xft-hintstyle", &v) | |
| 1248 | 1248 | } | |
| 1249 | 1249 | ||
| @@ -1268,7 +1268,7 @@ func (x *Settings) GetPropertyGtkXftHintstyle() string { | |||
| 1268 | 1268 | func (x *Settings) SetPropertyGtkXftRgba(value string) { | |
| 1269 | 1269 | var v gobject.Value | |
| 1270 | 1270 | v.Init(gobject.TypeStringVal) | |
| 1271 | - | v.SetString(value) | |
| 1271 | + | v.SetString(&value) | |
| 1272 | 1272 | x.SetProperty("gtk-xft-rgba", &v) | |
| 1273 | 1273 | } | |
| 1274 | 1274 | ||
M v4/gtk/gtkshortcut.go +3 -3
| @@ -70,14 +70,14 @@ func NewShortcut(TriggerVar *ShortcutTrigger, ActionVar *ShortcutAction) *Shortc | |||
| 70 | 70 | return cls | |
| 71 | 71 | } | |
| 72 | 72 | ||
| 73 | - | var xNewShortcutWithArguments func(uintptr, uintptr, string, ...interface{}) uintptr | |
| 73 | + | var xNewShortcutWithArguments func(uintptr, uintptr, uintptr, ...interface{}) uintptr | |
| 74 | 74 | ||
| 75 | 75 | // Creates a new `GtkShortcut` that is triggered by @trigger and then activates | |
| 76 | 76 | // @action with arguments given by @format_string. | |
| 77 | - | func NewShortcutWithArguments(TriggerVar *ShortcutTrigger, ActionVar *ShortcutAction, FormatStringVar string, varArgs ...interface{}) *Shortcut { | |
| 77 | + | func NewShortcutWithArguments(TriggerVar *ShortcutTrigger, ActionVar *ShortcutAction, FormatStringVar *string, varArgs ...interface{}) *Shortcut { | |
| 78 | 78 | var cls *Shortcut | |
| 79 | 79 | ||
| 80 | - | cret := xNewShortcutWithArguments(TriggerVar.GoPointer(), ActionVar.GoPointer(), FormatStringVar, varArgs...) | |
| 80 | + | cret := xNewShortcutWithArguments(TriggerVar.GoPointer(), ActionVar.GoPointer(), core.NullableStringToPtr(FormatStringVar), varArgs...) | |
| 81 | 81 | ||
| 82 | 82 | if cret == 0 { | |
| 83 | 83 | return nil | |
M v4/gtk/gtkshortcutaction.go +33 -3
| @@ -164,7 +164,37 @@ var xNewCallbackAction func(uintptr, uintptr, uintptr) uintptr | |||
| 164 | 164 | func NewCallbackAction(CallbackVar *ShortcutFunc, DataVar uintptr, DestroyVar *glib.DestroyNotify) *CallbackAction { | |
| 165 | 165 | var cls *CallbackAction | |
| 166 | 166 | ||
| 167 | - | cret := xNewCallbackAction(glib.NewCallback(CallbackVar), DataVar, glib.NewCallback(DestroyVar)) | |
| 167 | + | var CallbackVarRef uintptr | |
| 168 | + | if CallbackVar != nil { | |
| 169 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 170 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 171 | + | CallbackVarRef = cbRefPtr | |
| 172 | + | } else { | |
| 173 | + | fcb := func(arg0 uintptr, arg1 *glib.Variant, arg2 uintptr) bool { | |
| 174 | + | cbFn := *CallbackVar | |
| 175 | + | return cbFn(arg0, arg1, arg2) | |
| 176 | + | } | |
| 177 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 178 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 179 | + | } | |
| 180 | + | } | |
| 181 | + | ||
| 182 | + | var DestroyVarRef uintptr | |
| 183 | + | if DestroyVar != nil { | |
| 184 | + | DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) | |
| 185 | + | if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { | |
| 186 | + | DestroyVarRef = cbRefPtr | |
| 187 | + | } else { | |
| 188 | + | fcb := func(arg0 uintptr) { | |
| 189 | + | cbFn := *DestroyVar | |
| 190 | + | cbFn(arg0) | |
| 191 | + | } | |
| 192 | + | DestroyVarRef = purego.NewCallback(fcb) | |
| 193 | + | glib.SaveCallback(DestroyVarPtr, DestroyVarRef) | |
| 194 | + | } | |
| 195 | + | } | |
| 196 | + | ||
| 197 | + | cret := xNewCallbackAction(CallbackVarRef, DataVar, DestroyVarRef) | |
| 168 | 198 | ||
| 169 | 199 | if cret == 0 { | |
| 170 | 200 | return nil | |
| @@ -303,7 +333,7 @@ func (c *NamedAction) SetGoPointer(ptr uintptr) { | |||
| 303 | 333 | func (x *NamedAction) SetPropertyActionName(value string) { | |
| 304 | 334 | var v gobject.Value | |
| 305 | 335 | v.Init(gobject.TypeStringVal) | |
| 306 | - | v.SetString(value) | |
| 336 | + | v.SetString(&value) | |
| 307 | 337 | x.SetProperty("action-name", &v) | |
| 308 | 338 | } | |
| 309 | 339 | ||
| @@ -548,7 +578,7 @@ func (c *SignalAction) SetGoPointer(ptr uintptr) { | |||
| 548 | 578 | func (x *SignalAction) SetPropertySignalName(value string) { | |
| 549 | 579 | var v gobject.Value | |
| 550 | 580 | v.Init(gobject.TypeStringVal) | |
| 551 | - | v.SetString(value) | |
| 581 | + | v.SetString(&value) | |
| 552 | 582 | x.SetProperty("signal-name", &v) | |
| 553 | 583 | } | |
| 554 | 584 | ||
M v4/gtk/gtkshortcutlabel.go +2 -2
| @@ -110,7 +110,7 @@ func (c *ShortcutLabel) SetGoPointer(ptr uintptr) { | |||
| 110 | 110 | func (x *ShortcutLabel) SetPropertyAccelerator(value string) { | |
| 111 | 111 | var v gobject.Value | |
| 112 | 112 | v.Init(gobject.TypeStringVal) | |
| 113 | - | v.SetString(value) | |
| 113 | + | v.SetString(&value) | |
| 114 | 114 | x.SetProperty("accelerator", &v) | |
| 115 | 115 | } | |
| 116 | 116 | ||
| @@ -130,7 +130,7 @@ func (x *ShortcutLabel) GetPropertyAccelerator() string { | |||
| 130 | 130 | func (x *ShortcutLabel) SetPropertyDisabledText(value string) { | |
| 131 | 131 | var v gobject.Value | |
| 132 | 132 | v.Init(gobject.TypeStringVal) | |
| 133 | - | v.SetString(value) | |
| 133 | + | v.SetString(&value) | |
| 134 | 134 | x.SetProperty("disabled-text", &v) | |
| 135 | 135 | } | |
| 136 | 136 | ||
M v4/gtk/gtkshortcutsgroup.go +2 -2
| @@ -90,7 +90,7 @@ func (x *ShortcutsGroup) GetPropertyHeight() uint { | |||
| 90 | 90 | func (x *ShortcutsGroup) SetPropertyTitle(value string) { | |
| 91 | 91 | var v gobject.Value | |
| 92 | 92 | v.Init(gobject.TypeStringVal) | |
| 93 | - | v.SetString(value) | |
| 93 | + | v.SetString(&value) | |
| 94 | 94 | x.SetProperty("title", &v) | |
| 95 | 95 | } | |
| 96 | 96 | ||
| @@ -112,7 +112,7 @@ func (x *ShortcutsGroup) GetPropertyTitle() string { | |||
| 112 | 112 | func (x *ShortcutsGroup) SetPropertyView(value string) { | |
| 113 | 113 | var v gobject.Value | |
| 114 | 114 | v.Init(gobject.TypeStringVal) | |
| 115 | - | v.SetString(value) | |
| 115 | + | v.SetString(&value) | |
| 116 | 116 | x.SetProperty("view", &v) | |
| 117 | 117 | } | |
| 118 | 118 | ||
M v4/gtk/gtkshortcutssection.go +3 -3
| @@ -126,7 +126,7 @@ func (x *ShortcutsSection) GetPropertyMaxHeight() uint { | |||
| 126 | 126 | func (x *ShortcutsSection) SetPropertySectionName(value string) { | |
| 127 | 127 | var v gobject.Value | |
| 128 | 128 | v.Init(gobject.TypeStringVal) | |
| 129 | - | v.SetString(value) | |
| 129 | + | v.SetString(&value) | |
| 130 | 130 | x.SetProperty("section-name", &v) | |
| 131 | 131 | } | |
| 132 | 132 | ||
| @@ -151,7 +151,7 @@ func (x *ShortcutsSection) GetPropertySectionName() string { | |||
| 151 | 151 | func (x *ShortcutsSection) SetPropertyTitle(value string) { | |
| 152 | 152 | var v gobject.Value | |
| 153 | 153 | v.Init(gobject.TypeStringVal) | |
| 154 | - | v.SetString(value) | |
| 154 | + | v.SetString(&value) | |
| 155 | 155 | x.SetProperty("title", &v) | |
| 156 | 156 | } | |
| 157 | 157 | ||
| @@ -178,7 +178,7 @@ func (x *ShortcutsSection) GetPropertyTitle() string { | |||
| 178 | 178 | func (x *ShortcutsSection) SetPropertyViewName(value string) { | |
| 179 | 179 | var v gobject.Value | |
| 180 | 180 | v.Init(gobject.TypeStringVal) | |
| 181 | - | v.SetString(value) | |
| 181 | + | v.SetString(&value) | |
| 182 | 182 | x.SetProperty("view-name", &v) | |
| 183 | 183 | } | |
| 184 | 184 | ||
M v4/gtk/gtkshortcutsshortcut.go +4 -4
| @@ -116,7 +116,7 @@ func (c *ShortcutsShortcut) SetGoPointer(ptr uintptr) { | |||
| 116 | 116 | func (x *ShortcutsShortcut) SetPropertyAccelerator(value string) { | |
| 117 | 117 | var v gobject.Value | |
| 118 | 118 | v.Init(gobject.TypeStringVal) | |
| 119 | - | v.SetString(value) | |
| 119 | + | v.SetString(&value) | |
| 120 | 120 | x.SetProperty("accelerator", &v) | |
| 121 | 121 | } | |
| 122 | 122 | ||
| @@ -164,7 +164,7 @@ func (x *ShortcutsShortcut) GetPropertyAccelerator() string { | |||
| 164 | 164 | func (x *ShortcutsShortcut) SetPropertyActionName(value string) { | |
| 165 | 165 | var v gobject.Value | |
| 166 | 166 | v.Init(gobject.TypeStringVal) | |
| 167 | - | v.SetString(value) | |
| 167 | + | v.SetString(&value) | |
| 168 | 168 | x.SetProperty("action-name", &v) | |
| 169 | 169 | } | |
| 170 | 170 | ||
| @@ -207,7 +207,7 @@ func (x *ShortcutsShortcut) GetPropertyIconSet() bool { | |||
| 207 | 207 | func (x *ShortcutsShortcut) SetPropertySubtitle(value string) { | |
| 208 | 208 | var v gobject.Value | |
| 209 | 209 | v.Init(gobject.TypeStringVal) | |
| 210 | - | v.SetString(value) | |
| 210 | + | v.SetString(&value) | |
| 211 | 211 | x.SetProperty("subtitle", &v) | |
| 212 | 212 | } | |
| 213 | 213 | ||
| @@ -248,7 +248,7 @@ func (x *ShortcutsShortcut) GetPropertySubtitleSet() bool { | |||
| 248 | 248 | func (x *ShortcutsShortcut) SetPropertyTitle(value string) { | |
| 249 | 249 | var v gobject.Value | |
| 250 | 250 | v.Init(gobject.TypeStringVal) | |
| 251 | - | v.SetString(value) | |
| 251 | + | v.SetString(&value) | |
| 252 | 252 | x.SetProperty("title", &v) | |
| 253 | 253 | } | |
| 254 | 254 | ||
M v4/gtk/gtkshortcutswindow.go +2 -2
| @@ -136,7 +136,7 @@ func (c *ShortcutsWindow) SetGoPointer(ptr uintptr) { | |||
| 136 | 136 | func (x *ShortcutsWindow) SetPropertySectionName(value string) { | |
| 137 | 137 | var v gobject.Value | |
| 138 | 138 | v.Init(gobject.TypeStringVal) | |
| 139 | - | v.SetString(value) | |
| 139 | + | v.SetString(&value) | |
| 140 | 140 | x.SetProperty("section-name", &v) | |
| 141 | 141 | } | |
| 142 | 142 | ||
| @@ -162,7 +162,7 @@ func (x *ShortcutsWindow) GetPropertySectionName() string { | |||
| 162 | 162 | func (x *ShortcutsWindow) SetPropertyViewName(value string) { | |
| 163 | 163 | var v gobject.Value | |
| 164 | 164 | v.Init(gobject.TypeStringVal) | |
| 165 | - | v.SetString(value) | |
| 165 | + | v.SetString(&value) | |
| 166 | 166 | x.SetProperty("view-name", &v) | |
| 167 | 167 | } | |
| 168 | 168 | ||
M v4/gtk/gtkshow.go +18 -1
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | package gtk | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 5 | 7 | "github.com/jwijenbergh/purego" | |
| 6 | 8 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | 9 | "github.com/jwijenbergh/puregotk/v4/gio" | |
| @@ -29,7 +31,22 @@ var xShowUriFull func(uintptr, string, uint32, uintptr, uintptr, uintptr) | |||
| 29 | 31 | // necessary for sandbox helpers to parent their dialogs properly. | |
| 30 | 32 | func ShowUriFull(ParentVar *Window, UriVar string, TimestampVar uint32, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 31 | 33 | ||
| 32 | - | xShowUriFull(ParentVar.GoPointer(), UriVar, TimestampVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 34 | + | var CallbackVarRef uintptr | |
| 35 | + | if CallbackVar != nil { | |
| 36 | + | CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) | |
| 37 | + | if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { | |
| 38 | + | CallbackVarRef = cbRefPtr | |
| 39 | + | } else { | |
| 40 | + | fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) { | |
| 41 | + | cbFn := *CallbackVar | |
| 42 | + | cbFn(arg0, arg1, arg2) | |
| 43 | + | } | |
| 44 | + | CallbackVarRef = purego.NewCallback(fcb) | |
| 45 | + | glib.SaveCallback(CallbackVarPtr, CallbackVarRef) | |
| 46 | + | } | |
| 47 | + | } | |
| 48 | + | ||
| 49 | + | xShowUriFull(ParentVar.GoPointer(), UriVar, TimestampVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar) | |
| 33 | 50 | ||
| 34 | 51 | } | |
| 35 | 52 | ||
M v4/gtk/gtkstack.go +10 -10
| @@ -174,15 +174,15 @@ func (x *Stack) AddChild(ChildVar *Widget) *StackPage { | |||
| 174 | 174 | return cls | |
| 175 | 175 | } | |
| 176 | 176 | ||
| 177 | - | var xStackAddNamed func(uintptr, uintptr, string) uintptr | |
| 177 | + | var xStackAddNamed func(uintptr, uintptr, uintptr) uintptr | |
| 178 | 178 | ||
| 179 | 179 | // Adds a child to @stack. | |
| 180 | 180 | // | |
| 181 | 181 | // The child is identified by the @name. | |
| 182 | - | func (x *Stack) AddNamed(ChildVar *Widget, NameVar string) *StackPage { | |
| 182 | + | func (x *Stack) AddNamed(ChildVar *Widget, NameVar *string) *StackPage { | |
| 183 | 183 | var cls *StackPage | |
| 184 | 184 | ||
| 185 | - | cret := xStackAddNamed(x.GoPointer(), ChildVar.GoPointer(), NameVar) | |
| 185 | + | cret := xStackAddNamed(x.GoPointer(), ChildVar.GoPointer(), core.NullableStringToPtr(NameVar)) | |
| 186 | 186 | ||
| 187 | 187 | if cret == 0 { | |
| 188 | 188 | return nil | |
| @@ -193,17 +193,17 @@ func (x *Stack) AddNamed(ChildVar *Widget, NameVar string) *StackPage { | |||
| 193 | 193 | return cls | |
| 194 | 194 | } | |
| 195 | 195 | ||
| 196 | - | var xStackAddTitled func(uintptr, uintptr, string, string) uintptr | |
| 196 | + | var xStackAddTitled func(uintptr, uintptr, uintptr, string) uintptr | |
| 197 | 197 | ||
| 198 | 198 | // Adds a child to @stack. | |
| 199 | 199 | // | |
| 200 | 200 | // The child is identified by the @name. The @title | |
| 201 | 201 | // will be used by `GtkStackSwitcher` to represent | |
| 202 | 202 | // @child in a tab bar, so it should be short. | |
| 203 | - | func (x *Stack) AddTitled(ChildVar *Widget, NameVar string, TitleVar string) *StackPage { | |
| 203 | + | func (x *Stack) AddTitled(ChildVar *Widget, NameVar *string, TitleVar string) *StackPage { | |
| 204 | 204 | var cls *StackPage | |
| 205 | 205 | ||
| 206 | - | cret := xStackAddTitled(x.GoPointer(), ChildVar.GoPointer(), NameVar, TitleVar) | |
| 206 | + | cret := xStackAddTitled(x.GoPointer(), ChildVar.GoPointer(), core.NullableStringToPtr(NameVar), TitleVar) | |
| 207 | 207 | ||
| 208 | 208 | if cret == 0 { | |
| 209 | 209 | return nil | |
| @@ -573,7 +573,7 @@ func (x *Stack) GetPropertyVhomogeneous() bool { | |||
| 573 | 573 | func (x *Stack) SetPropertyVisibleChildName(value string) { | |
| 574 | 574 | var v gobject.Value | |
| 575 | 575 | v.Init(gobject.TypeStringVal) | |
| 576 | - | v.SetString(value) | |
| 576 | + | v.SetString(&value) | |
| 577 | 577 | x.SetProperty("visible-child-name", &v) | |
| 578 | 578 | } | |
| 579 | 579 | ||
| @@ -1024,7 +1024,7 @@ func (c *StackPage) SetGoPointer(ptr uintptr) { | |||
| 1024 | 1024 | func (x *StackPage) SetPropertyIconName(value string) { | |
| 1025 | 1025 | var v gobject.Value | |
| 1026 | 1026 | v.Init(gobject.TypeStringVal) | |
| 1027 | - | v.SetString(value) | |
| 1027 | + | v.SetString(&value) | |
| 1028 | 1028 | x.SetProperty("icon-name", &v) | |
| 1029 | 1029 | } | |
| 1030 | 1030 | ||
| @@ -1041,7 +1041,7 @@ func (x *StackPage) GetPropertyIconName() string { | |||
| 1041 | 1041 | func (x *StackPage) SetPropertyName(value string) { | |
| 1042 | 1042 | var v gobject.Value | |
| 1043 | 1043 | v.Init(gobject.TypeStringVal) | |
| 1044 | - | v.SetString(value) | |
| 1044 | + | v.SetString(&value) | |
| 1045 | 1045 | x.SetProperty("name", &v) | |
| 1046 | 1046 | } | |
| 1047 | 1047 | ||
| @@ -1083,7 +1083,7 @@ func (x *StackPage) GetPropertyNeedsAttention() bool { | |||
| 1083 | 1083 | func (x *StackPage) SetPropertyTitle(value string) { | |
| 1084 | 1084 | var v gobject.Value | |
| 1085 | 1085 | v.Init(gobject.TypeStringVal) | |
| 1086 | - | v.SetString(value) | |
| 1086 | + | v.SetString(&value) | |
| 1087 | 1087 | x.SetProperty("title", &v) | |
| 1088 | 1088 | } | |
| 1089 | 1089 | ||
M v4/gtk/gtkstringfilter.go +4 -4
| @@ -165,12 +165,12 @@ func (x *StringFilter) SetMatchMode(ModeVar StringFilterMatchMode) { | |||
| 165 | 165 | ||
| 166 | 166 | } | |
| 167 | 167 | ||
| 168 | - | var xStringFilterSetSearch func(uintptr, string) | |
| 168 | + | var xStringFilterSetSearch func(uintptr, uintptr) | |
| 169 | 169 | ||
| 170 | 170 | // Sets the string to search for. | |
| 171 | - | func (x *StringFilter) SetSearch(SearchVar string) { | |
| 171 | + | func (x *StringFilter) SetSearch(SearchVar *string) { | |
| 172 | 172 | ||
| 173 | - | xStringFilterSetSearch(x.GoPointer(), SearchVar) | |
| 173 | + | xStringFilterSetSearch(x.GoPointer(), core.NullableStringToPtr(SearchVar)) | |
| 174 | 174 | ||
| 175 | 175 | } | |
| 176 | 176 | ||
| @@ -207,7 +207,7 @@ func (x *StringFilter) GetPropertyIgnoreCase() bool { | |||
| 207 | 207 | func (x *StringFilter) SetPropertySearch(value string) { | |
| 208 | 208 | var v gobject.Value | |
| 209 | 209 | v.Init(gobject.TypeStringVal) | |
| 210 | - | v.SetString(value) | |
| 210 | + | v.SetString(&value) | |
| 211 | 211 | x.SetProperty("search", &v) | |
| 212 | 212 | } | |
| 213 | 213 | ||
M v4/gtk/gtkswitch.go +2 -2
| @@ -537,9 +537,9 @@ func (x *Switch) GetActionTargetValue() *glib.Variant { | |||
| 537 | 537 | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 538 | 538 | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 539 | 539 | // associated with the window. | |
| 540 | - | func (x *Switch) SetActionName(ActionNameVar string) { | |
| 540 | + | func (x *Switch) SetActionName(ActionNameVar *string) { | |
| 541 | 541 | ||
| 542 | - | XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 542 | + | XGtkActionableSetActionName(x.GoPointer(), core.NullableStringToPtr(ActionNameVar)) | |
| 543 | 543 | ||
| 544 | 544 | } | |
| 545 | 545 | ||