Core + Gen + GIR + Templates: Support error returns when throws=1
- commit
- 4bd10555ef83ef3ce5a635c20ff10d7d5b3b8360
- author
- jwijenbergh · · 2023-08-16 16:10 UTC
- parent
- 33775f6
- signature
- GPG Unverified
1A2298F6C34F96E5The key is unknown
598 files · +25884 -22504
M gen.go +4 -0
| @@ -44,4 +44,8 @@ func main() { | |||
| 44 | 44 | if err == nil { | |
| 45 | 45 | os.WriteFile("v4/gobject/more.go", data, 0o644) | |
| 46 | 46 | } | |
| 47 | + | data, err = os.ReadFile("templates/glib") | |
| 48 | + | if err == nil { | |
| 49 | + | os.WriteFile("v4/glib/more.go", data, 0o644) | |
| 50 | + | } | |
| 47 | 51 | } | |
M internal/core/core.go +21 -0
| @@ -9,6 +9,7 @@ import ( | |||
| 9 | 9 | "os/exec" | |
| 10 | 10 | "path/filepath" | |
| 11 | 11 | "strings" | |
| 12 | + | "unsafe" | |
| 12 | 13 | ||
| 13 | 14 | "github.com/jwijenbergh/purego" | |
| 14 | 15 | ) | |
| @@ -136,3 +137,23 @@ func GetPath(name string) string { | |||
| 136 | 137 | ||
| 137 | 138 | panic(fmt.Sprintf("Path for library: %s not found. Please set the path to this library shared object file manually with env variable: %s. Or make sure pkg-config is setup correctly", strings.ToLower(name), ev)) | |
| 138 | 139 | } | |
| 140 | + | ||
| 141 | + | ||
| 142 | + | ||
| 143 | + | // GoString copies a char* to a Go string. | |
| 144 | + | // This function was copied from purego | |
| 145 | + | func GoString(c uintptr) string { | |
| 146 | + | // We take the address and then dereference it to trick go vet from creating a possible misuse of unsafe.Pointer | |
| 147 | + | ptr := *(*unsafe.Pointer)(unsafe.Pointer(&c)) | |
| 148 | + | if ptr == nil { | |
| 149 | + | return "" | |
| 150 | + | } | |
| 151 | + | var length int | |
| 152 | + | for { | |
| 153 | + | if *(*byte)(unsafe.Add(ptr, uintptr(length))) == '\x00' { | |
| 154 | + | break | |
| 155 | + | } | |
| 156 | + | length++ | |
| 157 | + | } | |
| 158 | + | return string(unsafe.Slice((*byte)(ptr), length)) | |
| 159 | + | } | |
M internal/gir/pass/pass.go +15 -10
| @@ -110,6 +110,11 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string | |||
| 110 | 110 | if f.AnyType.Type != nil && f.AnyType.Type.CType == "gint" { | |
| 111 | 111 | _type = "int32" | |
| 112 | 112 | } | |
| 113 | + | ||
| 114 | + | // HACK: in structs the strings should be uintptr as we convert it ourselves | |
| 115 | + | if _type == "string" { | |
| 116 | + | _type = "uintptr" | |
| 117 | + | } | |
| 113 | 118 | fields = append(fields, types.RecordField{ | |
| 114 | 119 | Name: util.SnakeToCamel(f.Name), | |
| 115 | 120 | Type: _type, | |
| @@ -131,8 +136,8 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string | |||
| 131 | 136 | cbT := types.CallbackTemplate{ | |
| 132 | 137 | Doc: cb.Doc.StringSafe(), | |
| 133 | 138 | Name: cb.Name, | |
| 134 | - | Args: cb.Parameters.Template(ns.Name, "", p.Types), | |
| 135 | - | Ret: cb.ReturnValue.Template(ns.Name, "", p.Types), | |
| 139 | + | Args: cb.Parameters.Template(ns.Name, "", p.Types, cb.Throws), | |
| 140 | + | Ret: cb.ReturnValue.Template(ns.Name, "", p.Types, cb.Throws), | |
| 136 | 141 | } | |
| 137 | 142 | callbacks[fn] = append(callbacks[fn], cbT) | |
| 138 | 143 | } | |
| @@ -186,8 +191,8 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string | |||
| 186 | 191 | Name: name, | |
| 187 | 192 | CName: f.CIdentifier, | |
| 188 | 193 | Doc: f.Doc.StringSafe(), | |
| 189 | - | Args: f.Parameters.Template(ns.Name, "", p.Types), | |
| 190 | - | Ret: f.ReturnValue.Template(ns.Name, "", p.Types), | |
| 194 | + | Args: f.Parameters.Template(ns.Name, "", p.Types, f.Throws), | |
| 195 | + | Ret: f.ReturnValue.Template(ns.Name, "", p.Types, f.Throws), | |
| 191 | 196 | }) | |
| 192 | 197 | } | |
| 193 | 198 | ||
| @@ -204,8 +209,8 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string | |||
| 204 | 209 | Name: name, | |
| 205 | 210 | CName: c.CIdentifier, | |
| 206 | 211 | Doc: c.Doc.StringSafe(), | |
| 207 | - | Args: c.Parameters.Template(ns.Name, "", p.Types), | |
| 208 | - | Ret: c.ReturnValue.Template(ns.Name, "", p.Types), | |
| 212 | + | Args: c.Parameters.Template(ns.Name, "", p.Types, c.Throws), | |
| 213 | + | Ret: c.ReturnValue.Template(ns.Name, "", p.Types, c.Throws), | |
| 209 | 214 | } | |
| 210 | 215 | } | |
| 211 | 216 | signals := make([]types.SignalsTemplate, len(cls.Signals)) | |
| @@ -214,8 +219,8 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string | |||
| 214 | 219 | Doc: s.Doc.StringSafe(), | |
| 215 | 220 | Name: util.DashToCamel(s.Name), | |
| 216 | 221 | CName: s.Name, | |
| 217 | - | Args: s.Parameters.Template(ns.Name, "", p.Types), | |
| 218 | - | Ret: s.ReturnValue.Template(ns.Name, "", p.Types), | |
| 222 | + | Args: s.Parameters.Template(ns.Name, "", p.Types, false), | |
| 223 | + | Ret: s.ReturnValue.Template(ns.Name, "", p.Types, false), | |
| 219 | 224 | } | |
| 220 | 225 | } | |
| 221 | 226 | receivers := make([]types.FuncTemplate, len(cls.Methods)) | |
| @@ -226,8 +231,8 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string | |||
| 226 | 231 | Doc: f.Doc.StringSafe(), | |
| 227 | 232 | Name: name, | |
| 228 | 233 | CName: f.CIdentifier, | |
| 229 | - | Args: f.Parameters.Template(ns.Name, "", p.Types), | |
| 230 | - | Ret: f.ReturnValue.Template(ns.Name, "", p.Types), | |
| 234 | + | Args: f.Parameters.Template(ns.Name, "", p.Types, f.Throws), | |
| 235 | + | Ret: f.ReturnValue.Template(ns.Name, "", p.Types, f.Throws), | |
| 231 | 236 | } | |
| 232 | 237 | } | |
| 233 | 238 | var interfaces []types.InterfaceTemplate | |
M internal/gir/types/interface.go +2 -2
| @@ -28,8 +28,8 @@ 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), | |
| 32 | - | Ret: m.ReturnValue.Template(currns, ins, kinds), | |
| 31 | + | Args: m.Parameters.Template(currns, ins, kinds, m.Throws), | |
| 32 | + | Ret: m.ReturnValue.Template(currns, ins, kinds, m.Throws), | |
| 33 | 33 | }, | |
| 34 | 34 | }) | |
| 35 | 35 | } | |
M internal/gir/types/template.go +98 -1
| @@ -132,6 +132,15 @@ func (f *funcArgsTemplate) Add(p Parameter, ins string, ns string, kinds KindMap | |||
| 132 | 132 | f.AddPure(goType, varName, kind) | |
| 133 | 133 | } | |
| 134 | 134 | ||
| 135 | + | func (f *funcArgsTemplate) AddThrows(ns string) { | |
| 136 | + | f.API.Call = append(f.API.Call, "&cerr") | |
| 137 | + | if strings.ToLower(ns) != "glib" { | |
| 138 | + | f.Pure.Types = append(f.Pure.Types, "**glib.Error") | |
| 139 | + | } else { | |
| 140 | + | f.Pure.Types = append(f.Pure.Types, "**Error") | |
| 141 | + | } | |
| 142 | + | } | |
| 143 | + | ||
| 135 | 144 | type CallbackTemplate struct { | |
| 136 | 145 | Doc string | |
| 137 | 146 | Name string | |
| @@ -196,15 +205,103 @@ type funcRetTemplate struct { | |||
| 196 | 205 | Class bool | |
| 197 | 206 | // RefSink indicates whether or not we should increase the reference count using obj.RefSink() | |
| 198 | 207 | RefSink bool | |
| 208 | + | // Throws indicates whether or not this function throws | |
| 209 | + | Throws bool | |
| 199 | 210 | } | |
| 200 | 211 | ||
| 201 | 212 | func (fr *funcRetTemplate) Instance() string { | |
| 213 | + | val := fr.Value + "{}" | |
| 202 | 214 | if strings.HasPrefix(fr.Value, "*") { | |
| 203 | - | return "&"+fr.Value[1:] | |
| 215 | + | return "&"+val[1:] | |
| 216 | + | } | |
| 217 | + | return val | |
| 218 | + | } | |
| 219 | + | ||
| 220 | + | func (fr *funcRetTemplate) Return() string { | |
| 221 | + | if fr.Throws { | |
| 222 | + | if fr.Value == "" { | |
| 223 | + | return "error" | |
| 224 | + | } | |
| 225 | + | return fmt.Sprintf("(%s, error)", fr.Value) | |
| 204 | 226 | } | |
| 205 | 227 | return fr.Value | |
| 206 | 228 | } | |
| 207 | 229 | ||
| 230 | + | func (fr *funcRetTemplate) HasReturn() bool { | |
| 231 | + | return fr.Value != "" || fr.Throws | |
| 232 | + | } | |
| 233 | + | ||
| 234 | + | func (fr *funcRetTemplate) Preamble(nglib bool) string { | |
| 235 | + | preamb := strings.Builder{} | |
| 236 | + | if fr.Class { | |
| 237 | + | preamb.WriteString("var cls ") | |
| 238 | + | preamb.WriteString(fr.Value) | |
| 239 | + | preamb.WriteString("\n") | |
| 240 | + | } | |
| 241 | + | if fr.Throws { | |
| 242 | + | preamb.WriteString("var cerr *") | |
| 243 | + | if nglib { | |
| 244 | + | preamb.WriteString("glib.") | |
| 245 | + | } | |
| 246 | + | preamb.WriteString("Error\n") | |
| 247 | + | } | |
| 248 | + | return preamb.String() | |
| 249 | + | } | |
| 250 | + | ||
| 251 | + | func (fr *funcRetTemplate) Fmt(ngo bool) string { | |
| 252 | + | if !fr.HasReturn() { | |
| 253 | + | return "" | |
| 254 | + | } | |
| 255 | + | after := strings.Builder{} | |
| 256 | + | val := "cret" | |
| 257 | + | if fr.Class { | |
| 258 | + | if fr.Throws { | |
| 259 | + | after.WriteString(` | |
| 260 | + | if cret == 0 { | |
| 261 | + | return cls, cerr | |
| 262 | + | } | |
| 263 | + | `) | |
| 264 | + | } else { | |
| 265 | + | after.WriteString(` | |
| 266 | + | if cret == 0 { | |
| 267 | + | return cls | |
| 268 | + | } | |
| 269 | + | `) | |
| 270 | + | } | |
| 271 | + | if fr.RefSink { | |
| 272 | + | if ngo { | |
| 273 | + | after.WriteString("gobject.") | |
| 274 | + | } | |
| 275 | + | after.WriteString("IncreaseRef(cret)\n") | |
| 276 | + | } | |
| 277 | + | after.WriteString("cls = ") | |
| 278 | + | after.WriteString(fr.Instance()) | |
| 279 | + | after.WriteString("\n") | |
| 280 | + | after.WriteString("cls.Ptr = cret\n") | |
| 281 | + | val = "cls" | |
| 282 | + | } | |
| 283 | + | if fr.Throws { | |
| 284 | + | after.WriteString("if cerr == nil {\n") | |
| 285 | + | after.WriteString("return ") | |
| 286 | + | if fr.Value != "" { | |
| 287 | + | after.WriteString(val) | |
| 288 | + | after.WriteString(",") | |
| 289 | + | } | |
| 290 | + | after.WriteString( "nil\n") | |
| 291 | + | after.WriteString("}\n") | |
| 292 | + | after.WriteString("return ") | |
| 293 | + | if fr.Value != "" { | |
| 294 | + | after.WriteString(val) | |
| 295 | + | after.WriteString(",") | |
| 296 | + | } | |
| 297 | + | after.WriteString( "cerr\n") | |
| 298 | + | return after.String() | |
| 299 | + | } | |
| 300 | + | after.WriteString("return ") | |
| 301 | + | after.WriteString(val) | |
| 302 | + | return after.String() | |
| 303 | + | } | |
| 304 | + | ||
| 208 | 305 | type FuncTemplate struct { | |
| 209 | 306 | // Name is the name of the function declared as the Go function variable and public exposed API | |
| 210 | 307 | Name string | |
M internal/gir/types/types.go +6 -2
| @@ -579,7 +579,7 @@ func (p *Parameter) VarName() string { | |||
| 579 | 579 | return snaked + "Var" | |
| 580 | 580 | } | |
| 581 | 581 | ||
| 582 | - | func (p *Parameters) Template(ns string, ifacens string, kinds KindMap) funcArgsTemplate { | |
| 582 | + | func (p *Parameters) Template(ns string, ifacens string, kinds KindMap, throws bool) funcArgsTemplate { | |
| 583 | 583 | if p == nil { | |
| 584 | 584 | return funcArgsTemplate{} | |
| 585 | 585 | } | |
| @@ -591,6 +591,9 @@ func (p *Parameters) Template(ns string, ifacens string, kinds KindMap) funcArgs | |||
| 591 | 591 | for _, par := range params { | |
| 592 | 592 | args.Add(par, ifacens, ns, kinds) | |
| 593 | 593 | } | |
| 594 | + | if throws { | |
| 595 | + | args.AddThrows(ns) | |
| 596 | + | } | |
| 594 | 597 | return args | |
| 595 | 598 | } | |
| 596 | 599 | ||
| @@ -659,7 +662,7 @@ type ReturnValue struct { | |||
| 659 | 662 | AnyType | |
| 660 | 663 | } | |
| 661 | 664 | ||
| 662 | - | func (r *ReturnValue) Template(ns string, ins string, kinds KindMap) funcRetTemplate { | |
| 665 | + | func (r *ReturnValue) Template(ns string, ins string, kinds KindMap, throws bool) funcRetTemplate { | |
| 663 | 666 | val := r.AnyType.Translate(ns, kinds) | |
| 664 | 667 | raw := val | |
| 665 | 668 | class := false | |
| @@ -691,5 +694,6 @@ func (r *ReturnValue) Template(ns string, ins string, kinds KindMap) funcRetTemp | |||
| 691 | 694 | Value: val, | |
| 692 | 695 | Class: class, | |
| 693 | 696 | RefSink: r.TransferOwnership.TransferOwnership == "none", | |
| 697 | + | Throws: throws, | |
| 694 | 698 | } | |
| 695 | 699 | } | |
A templates/glib +14 -0
| @@ -0,0 +1,14 @@ | |||
| 1 | + | package glib | |
| 2 | + | ||
| 3 | + | import ( | |
| 4 | + | "fmt" | |
| 5 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 6 | + | ) | |
| 7 | + | ||
| 8 | + | func (e *Error) Error() string { | |
| 9 | + | return fmt.Sprintf("Gtk reported an error with message: '%s', Domain: '%v' and Code: '%v'", e.MessageGo(), e.Domain, e.Code) | |
| 10 | + | } | |
| 11 | + | ||
| 12 | + | func (e *Error) MessageGo() string { | |
| 13 | + | return core.GoString(e.Message) | |
| 14 | + | }⏎̸ | |
M templates/go +21 -79
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | package {{.PkgName}} | |
| 3 | 3 | ||
| 4 | 4 | {{ $NotGObject := ne .PkgName "gobject" }} | |
| 5 | + | {{ $NotGLib := ne .PkgName "glib" }} | |
| 5 | 6 | ||
| 6 | 7 | {{if or .Imports .NeedsInit}} | |
| 7 | 8 | import ( | |
| @@ -55,23 +56,10 @@ func (x *{{.Name}}Base) SetGoPointer(ptr uintptr) { | |||
| 55 | 56 | {{$outer := .}} | |
| 56 | 57 | {{range .Methods -}} | |
| 57 | 58 | {{.Doc}} | |
| 58 | - | func (x *{{$outer.Name}}Base) {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Value}} { | |
| 59 | - | {{if .Ret.Class}} | |
| 60 | - | {{.Name}}Ptr := {{.Namespace}}X{{.FullName}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 61 | - | if {{.Name}}Ptr == 0 { | |
| 62 | - | return nil | |
| 63 | - | } | |
| 64 | - | {{if .Ret.RefSink}} | |
| 65 | - | {{if $NotGObject}}gobject.{{end}}IncreaseRef({{.Name}}Ptr) | |
| 66 | - | {{end}} | |
| 67 | - | {{.Name}}Cls := {{.Ret.Instance}}{} | |
| 68 | - | {{.Name}}Cls.Ptr = {{.Name}}Ptr | |
| 69 | - | return {{.Name}}Cls | |
| 70 | - | {{else if .Ret.Value}} | |
| 71 | - | return {{.Namespace}}X{{.FullName}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 72 | - | {{else}} | |
| 73 | - | {{.Namespace}}X{{.FullName}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 74 | - | {{end}} | |
| 59 | + | func (x *{{$outer.Name}}Base) {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Return}} { | |
| 60 | + | {{.Ret.Preamble $NotGLib}} | |
| 61 | + | {{if .Ret.Value}}cret := {{end}}{{.Namespace}}X{{.FullName}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 62 | + | {{.Ret.Fmt $NotGObject}} | |
| 75 | 63 | } | |
| 76 | 64 | {{end}} | |
| 77 | 65 | ||
| @@ -101,23 +89,10 @@ const ( | |||
| 101 | 89 | var x{{.Name}} func({{conv .Args.Pure.Types}}) {{.Ret.Raw}} | |
| 102 | 90 | ||
| 103 | 91 | {{.Doc}} | |
| 104 | - | func {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Value}} { | |
| 105 | - | {{if .Ret.Class}} | |
| 106 | - | {{.Name}}Ptr := x{{.Name}}({{conv .Args.API.Call}}) | |
| 107 | - | if {{.Name}}Ptr == 0 { | |
| 108 | - | return nil | |
| 109 | - | } | |
| 110 | - | {{if .Ret.RefSink}} | |
| 111 | - | {{if $NotGObject}}gobject.{{end}}IncreaseRef({{.Name}}Ptr) | |
| 112 | - | {{end}} | |
| 113 | - | {{.Name}}Cls := {{.Ret.Instance}}{} | |
| 114 | - | {{.Name}}Cls.Ptr = {{.Name}}Ptr | |
| 115 | - | return {{.Name}}Cls | |
| 116 | - | {{else if .Ret.Value}} | |
| 117 | - | return x{{.Name}}({{conv .Args.API.Call}}) | |
| 118 | - | {{else}} | |
| 119 | - | x{{.Name}}({{conv .Args.API.Call}}) | |
| 120 | - | {{end}} | |
| 92 | + | func {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Return}} { | |
| 93 | + | {{.Ret.Preamble $NotGLib}} | |
| 94 | + | {{if .Ret.Value}}cret := {{end}}x{{.Name}}({{conv .Args.API.Call}}) | |
| 95 | + | {{.Ret.Fmt $NotGObject}} | |
| 121 | 96 | } | |
| 122 | 97 | {{end}} | |
| 123 | 98 | ||
| @@ -142,17 +117,10 @@ var x{{.Name}}{{$outer.Name}} func({{conv .Args.Pure.Types}}) {{.Ret.Raw}} | |||
| 142 | 117 | ||
| 143 | 118 | ||
| 144 | 119 | {{.Doc}} | |
| 145 | - | func {{.Name}}{{$outer.Name}}({{conv .Args.API.Full}}) {{.Ret.Value}} { | |
| 146 | - | {{.Name}}{{$outer.Name}}Ptr := x{{.Name}}{{$outer.Name}}({{conv .Args.API.Call}}) | |
| 147 | - | if {{.Name}}{{$outer.Name}}Ptr == 0 { | |
| 148 | - | return nil | |
| 149 | - | } | |
| 150 | - | {{if .Ret.RefSink}} | |
| 151 | - | {{if $NotGObject}}gobject.{{end}}IncreaseRef({{.Name}}{{$outer.Name}}Ptr) | |
| 152 | - | {{end}} | |
| 153 | - | {{.Name}}{{$outer.Name}}Cls := {{.Ret.Instance}}{} | |
| 154 | - | {{.Name}}{{$outer.Name}}Cls.Ptr = {{.Name}}{{$outer.Name}}Ptr | |
| 155 | - | return {{.Name}}{{$outer.Name}}Cls | |
| 120 | + | func {{.Name}}{{$outer.Name}}({{conv .Args.API.Full}}) {{.Ret.Return}} { | |
| 121 | + | {{.Ret.Preamble $NotGLib}} | |
| 122 | + | {{if .Ret.Value}}cret :={{end}}x{{.Name}}{{$outer.Name}}({{conv .Args.API.Call}}) | |
| 123 | + | {{.Ret.Fmt $NotGObject}} | |
| 156 | 124 | } | |
| 157 | 125 | {{end}} | |
| 158 | 126 | ||
| @@ -161,23 +129,10 @@ func {{.Name}}{{$outer.Name}}({{conv .Args.API.Full}}) {{.Ret.Value}} { | |||
| 161 | 129 | var x{{$outer.Name}}{{.Name}} func(uintptr {{convc .Args.Pure.Types}}) {{.Ret.Raw}} | |
| 162 | 130 | ||
| 163 | 131 | {{.Doc}} | |
| 164 | - | func (x *{{$outer.Name}}) {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Value}} { | |
| 165 | - | {{if .Ret.Class}} | |
| 166 | - | {{.Name}}Ptr := x{{$outer.Name}}{{.Name}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 167 | - | if {{.Name}}Ptr == 0 { | |
| 168 | - | return nil | |
| 169 | - | } | |
| 170 | - | {{if .Ret.RefSink}} | |
| 171 | - | {{if $NotGObject}}gobject.{{end}}IncreaseRef({{.Name}}Ptr) | |
| 172 | - | {{end}} | |
| 173 | - | {{.Name}}Cls := {{.Ret.Instance}}{} | |
| 174 | - | {{.Name}}Cls.Ptr = {{.Name}}Ptr | |
| 175 | - | return {{.Name}}Cls | |
| 176 | - | {{else if .Ret.Value}} | |
| 177 | - | return x{{$outer.Name}}{{.Name}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 178 | - | {{else}} | |
| 179 | - | x{{$outer.Name}}{{.Name}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 180 | - | {{end}} | |
| 132 | + | func (x *{{$outer.Name}}) {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Return}} { | |
| 133 | + | {{.Ret.Preamble $NotGLib}} | |
| 134 | + | {{if .Ret.Value}}cret :={{end}}x{{$outer.Name}}{{.Name}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 135 | + | {{.Ret.Fmt $NotGObject}} | |
| 181 | 136 | } | |
| 182 | 137 | {{end}} | |
| 183 | 138 | ||
| @@ -212,23 +167,10 @@ func (x *{{$outer.Name}}) Connect{{.Name}}(cb func({{$outer.Name}} {{convc .Args | |||
| 212 | 167 | {{range .Interfaces -}} | |
| 213 | 168 | {{range .Methods -}} | |
| 214 | 169 | {{.Doc}} | |
| 215 | - | func (x *{{$outer.Name}}) {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Value}} { | |
| 216 | - | {{if .Ret.Class}} | |
| 217 | - | {{.Name}}Ptr := {{.Namespace}}X{{.FullName}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 218 | - | if {{.Name}}Ptr == 0 { | |
| 219 | - | return nil | |
| 220 | - | } | |
| 221 | - | {{if .Ret.RefSink}} | |
| 222 | - | {{if $NotGObject}}gobject.{{end}}IncreaseRef({{.Name}}Ptr) | |
| 223 | - | {{end}} | |
| 224 | - | {{.Name}}Cls := {{.Ret.Instance}}{} | |
| 225 | - | {{.Name}}Cls.Ptr = {{.Name}}Ptr | |
| 226 | - | return {{.Name}}Cls | |
| 227 | - | {{else if .Ret.Value}} | |
| 228 | - | return {{.Namespace}}X{{.FullName}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 229 | - | {{else}} | |
| 230 | - | {{.Namespace}}X{{.FullName}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 231 | - | {{end}} | |
| 170 | + | func (x *{{$outer.Name}}) {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Return}} { | |
| 171 | + | {{.Ret.Preamble $NotGLib}} | |
| 172 | + | {{if .Ret.Value}}cret := {{end}} {{.Namespace}}X{{.FullName}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 173 | + | {{.Ret.Fmt $NotGObject}} | |
| 232 | 174 | } | |
| 233 | 175 | {{end}} | |
| 234 | 176 | {{end}} | |
M v4/adw/adw-about-window.go +89 -92
| @@ -208,16 +208,17 @@ var xNewAboutWindow func() uintptr | |||
| 208 | 208 | ||
| 209 | 209 | // Creates a new `AdwAboutWindow`. | |
| 210 | 210 | func NewAboutWindow() *gtk.Widget { | |
| 211 | - | NewAboutWindowPtr := xNewAboutWindow() | |
| 212 | - | if NewAboutWindowPtr == 0 { | |
| 213 | - | return nil | |
| 214 | - | } | |
| 211 | + | var cls *gtk.Widget | |
| 215 | 212 | ||
| 216 | - | gobject.IncreaseRef(NewAboutWindowPtr) | |
| 213 | + | cret := xNewAboutWindow() | |
| 217 | 214 | ||
| 218 | - | NewAboutWindowCls := >k.Widget{} | |
| 219 | - | NewAboutWindowCls.Ptr = NewAboutWindowPtr | |
| 220 | - | return NewAboutWindowCls | |
| 215 | + | if cret == 0 { | |
| 216 | + | return cls | |
| 217 | + | } | |
| 218 | + | gobject.IncreaseRef(cret) | |
| 219 | + | cls = >k.Widget{} | |
| 220 | + | cls.Ptr = cret | |
| 221 | + | return cls | |
| 221 | 222 | } | |
| 222 | 223 | ||
| 223 | 224 | var xAboutWindowAddAcknowledgementSection func(uintptr, string, uintptr) | |
| @@ -341,8 +342,8 @@ var xAboutWindowGetApplicationIcon func(uintptr) string | |||
| 341 | 342 | // Gets the name of the application icon for @self. | |
| 342 | 343 | func (x *AboutWindow) GetApplicationIcon() string { | |
| 343 | 344 | ||
| 344 | - | return xAboutWindowGetApplicationIcon(x.GoPointer()) | |
| 345 | - | ||
| 345 | + | cret := xAboutWindowGetApplicationIcon(x.GoPointer()) | |
| 346 | + | return cret | |
| 346 | 347 | } | |
| 347 | 348 | ||
| 348 | 349 | var xAboutWindowGetApplicationName func(uintptr) string | |
| @@ -350,8 +351,8 @@ var xAboutWindowGetApplicationName func(uintptr) string | |||
| 350 | 351 | // Gets the application name for @self. | |
| 351 | 352 | func (x *AboutWindow) GetApplicationName() string { | |
| 352 | 353 | ||
| 353 | - | return xAboutWindowGetApplicationName(x.GoPointer()) | |
| 354 | - | ||
| 354 | + | cret := xAboutWindowGetApplicationName(x.GoPointer()) | |
| 355 | + | return cret | |
| 355 | 356 | } | |
| 356 | 357 | ||
| 357 | 358 | var xAboutWindowGetArtists func(uintptr) uintptr | |
| @@ -359,8 +360,8 @@ var xAboutWindowGetArtists func(uintptr) uintptr | |||
| 359 | 360 | // Gets the list of artists of the application. | |
| 360 | 361 | func (x *AboutWindow) GetArtists() uintptr { | |
| 361 | 362 | ||
| 362 | - | return xAboutWindowGetArtists(x.GoPointer()) | |
| 363 | - | ||
| 363 | + | cret := xAboutWindowGetArtists(x.GoPointer()) | |
| 364 | + | return cret | |
| 364 | 365 | } | |
| 365 | 366 | ||
| 366 | 367 | var xAboutWindowGetComments func(uintptr) string | |
| @@ -368,8 +369,8 @@ var xAboutWindowGetComments func(uintptr) string | |||
| 368 | 369 | // Gets the comments about the application. | |
| 369 | 370 | func (x *AboutWindow) GetComments() string { | |
| 370 | 371 | ||
| 371 | - | return xAboutWindowGetComments(x.GoPointer()) | |
| 372 | - | ||
| 372 | + | cret := xAboutWindowGetComments(x.GoPointer()) | |
| 373 | + | return cret | |
| 373 | 374 | } | |
| 374 | 375 | ||
| 375 | 376 | var xAboutWindowGetCopyright func(uintptr) string | |
| @@ -377,8 +378,8 @@ var xAboutWindowGetCopyright func(uintptr) string | |||
| 377 | 378 | // Gets the copyright information for @self. | |
| 378 | 379 | func (x *AboutWindow) GetCopyright() string { | |
| 379 | 380 | ||
| 380 | - | return xAboutWindowGetCopyright(x.GoPointer()) | |
| 381 | - | ||
| 381 | + | cret := xAboutWindowGetCopyright(x.GoPointer()) | |
| 382 | + | return cret | |
| 382 | 383 | } | |
| 383 | 384 | ||
| 384 | 385 | var xAboutWindowGetDebugInfo func(uintptr) string | |
| @@ -386,8 +387,8 @@ var xAboutWindowGetDebugInfo func(uintptr) string | |||
| 386 | 387 | // Gets the debug information for @self. | |
| 387 | 388 | func (x *AboutWindow) GetDebugInfo() string { | |
| 388 | 389 | ||
| 389 | - | return xAboutWindowGetDebugInfo(x.GoPointer()) | |
| 390 | - | ||
| 390 | + | cret := xAboutWindowGetDebugInfo(x.GoPointer()) | |
| 391 | + | return cret | |
| 391 | 392 | } | |
| 392 | 393 | ||
| 393 | 394 | var xAboutWindowGetDebugInfoFilename func(uintptr) string | |
| @@ -395,8 +396,8 @@ var xAboutWindowGetDebugInfoFilename func(uintptr) string | |||
| 395 | 396 | // Gets the debug information filename for @self. | |
| 396 | 397 | func (x *AboutWindow) GetDebugInfoFilename() string { | |
| 397 | 398 | ||
| 398 | - | return xAboutWindowGetDebugInfoFilename(x.GoPointer()) | |
| 399 | - | ||
| 399 | + | cret := xAboutWindowGetDebugInfoFilename(x.GoPointer()) | |
| 400 | + | return cret | |
| 400 | 401 | } | |
| 401 | 402 | ||
| 402 | 403 | var xAboutWindowGetDesigners func(uintptr) uintptr | |
| @@ -404,8 +405,8 @@ var xAboutWindowGetDesigners func(uintptr) uintptr | |||
| 404 | 405 | // Gets the list of designers of the application. | |
| 405 | 406 | func (x *AboutWindow) GetDesigners() uintptr { | |
| 406 | 407 | ||
| 407 | - | return xAboutWindowGetDesigners(x.GoPointer()) | |
| 408 | - | ||
| 408 | + | cret := xAboutWindowGetDesigners(x.GoPointer()) | |
| 409 | + | return cret | |
| 409 | 410 | } | |
| 410 | 411 | ||
| 411 | 412 | var xAboutWindowGetDeveloperName func(uintptr) string | |
| @@ -413,8 +414,8 @@ var xAboutWindowGetDeveloperName func(uintptr) string | |||
| 413 | 414 | // Gets the developer name for @self. | |
| 414 | 415 | func (x *AboutWindow) GetDeveloperName() string { | |
| 415 | 416 | ||
| 416 | - | return xAboutWindowGetDeveloperName(x.GoPointer()) | |
| 417 | - | ||
| 417 | + | cret := xAboutWindowGetDeveloperName(x.GoPointer()) | |
| 418 | + | return cret | |
| 418 | 419 | } | |
| 419 | 420 | ||
| 420 | 421 | var xAboutWindowGetDevelopers func(uintptr) uintptr | |
| @@ -422,8 +423,8 @@ var xAboutWindowGetDevelopers func(uintptr) uintptr | |||
| 422 | 423 | // Gets the list of developers of the application. | |
| 423 | 424 | func (x *AboutWindow) GetDevelopers() uintptr { | |
| 424 | 425 | ||
| 425 | - | return xAboutWindowGetDevelopers(x.GoPointer()) | |
| 426 | - | ||
| 426 | + | cret := xAboutWindowGetDevelopers(x.GoPointer()) | |
| 427 | + | return cret | |
| 427 | 428 | } | |
| 428 | 429 | ||
| 429 | 430 | var xAboutWindowGetDocumenters func(uintptr) uintptr | |
| @@ -431,8 +432,8 @@ var xAboutWindowGetDocumenters func(uintptr) uintptr | |||
| 431 | 432 | // Gets the list of documenters of the application. | |
| 432 | 433 | func (x *AboutWindow) GetDocumenters() uintptr { | |
| 433 | 434 | ||
| 434 | - | return xAboutWindowGetDocumenters(x.GoPointer()) | |
| 435 | - | ||
| 435 | + | cret := xAboutWindowGetDocumenters(x.GoPointer()) | |
| 436 | + | return cret | |
| 436 | 437 | } | |
| 437 | 438 | ||
| 438 | 439 | var xAboutWindowGetIssueUrl func(uintptr) string | |
| @@ -440,8 +441,8 @@ var xAboutWindowGetIssueUrl func(uintptr) string | |||
| 440 | 441 | // Gets the issue tracker URL for @self. | |
| 441 | 442 | func (x *AboutWindow) GetIssueUrl() string { | |
| 442 | 443 | ||
| 443 | - | return xAboutWindowGetIssueUrl(x.GoPointer()) | |
| 444 | - | ||
| 444 | + | cret := xAboutWindowGetIssueUrl(x.GoPointer()) | |
| 445 | + | return cret | |
| 445 | 446 | } | |
| 446 | 447 | ||
| 447 | 448 | var xAboutWindowGetLicense func(uintptr) string | |
| @@ -449,8 +450,8 @@ var xAboutWindowGetLicense func(uintptr) string | |||
| 449 | 450 | // Gets the license for @self. | |
| 450 | 451 | func (x *AboutWindow) GetLicense() string { | |
| 451 | 452 | ||
| 452 | - | return xAboutWindowGetLicense(x.GoPointer()) | |
| 453 | - | ||
| 453 | + | cret := xAboutWindowGetLicense(x.GoPointer()) | |
| 454 | + | return cret | |
| 454 | 455 | } | |
| 455 | 456 | ||
| 456 | 457 | var xAboutWindowGetLicenseType func(uintptr) gtk.License | |
| @@ -458,8 +459,8 @@ var xAboutWindowGetLicenseType func(uintptr) gtk.License | |||
| 458 | 459 | // Gets the license type for @self. | |
| 459 | 460 | func (x *AboutWindow) GetLicenseType() gtk.License { | |
| 460 | 461 | ||
| 461 | - | return xAboutWindowGetLicenseType(x.GoPointer()) | |
| 462 | - | ||
| 462 | + | cret := xAboutWindowGetLicenseType(x.GoPointer()) | |
| 463 | + | return cret | |
| 463 | 464 | } | |
| 464 | 465 | ||
| 465 | 466 | var xAboutWindowGetReleaseNotes func(uintptr) string | |
| @@ -467,8 +468,8 @@ var xAboutWindowGetReleaseNotes func(uintptr) string | |||
| 467 | 468 | // Gets the release notes for @self. | |
| 468 | 469 | func (x *AboutWindow) GetReleaseNotes() string { | |
| 469 | 470 | ||
| 470 | - | return xAboutWindowGetReleaseNotes(x.GoPointer()) | |
| 471 | - | ||
| 471 | + | cret := xAboutWindowGetReleaseNotes(x.GoPointer()) | |
| 472 | + | return cret | |
| 472 | 473 | } | |
| 473 | 474 | ||
| 474 | 475 | var xAboutWindowGetReleaseNotesVersion func(uintptr) string | |
| @@ -476,8 +477,8 @@ var xAboutWindowGetReleaseNotesVersion func(uintptr) string | |||
| 476 | 477 | // Gets the version described by the application's release notes. | |
| 477 | 478 | func (x *AboutWindow) GetReleaseNotesVersion() string { | |
| 478 | 479 | ||
| 479 | - | return xAboutWindowGetReleaseNotesVersion(x.GoPointer()) | |
| 480 | - | ||
| 480 | + | cret := xAboutWindowGetReleaseNotesVersion(x.GoPointer()) | |
| 481 | + | return cret | |
| 481 | 482 | } | |
| 482 | 483 | ||
| 483 | 484 | var xAboutWindowGetSupportUrl func(uintptr) string | |
| @@ -485,8 +486,8 @@ var xAboutWindowGetSupportUrl func(uintptr) string | |||
| 485 | 486 | // Gets the URL of the support page for @self. | |
| 486 | 487 | func (x *AboutWindow) GetSupportUrl() string { | |
| 487 | 488 | ||
| 488 | - | return xAboutWindowGetSupportUrl(x.GoPointer()) | |
| 489 | - | ||
| 489 | + | cret := xAboutWindowGetSupportUrl(x.GoPointer()) | |
| 490 | + | return cret | |
| 490 | 491 | } | |
| 491 | 492 | ||
| 492 | 493 | var xAboutWindowGetTranslatorCredits func(uintptr) string | |
| @@ -494,8 +495,8 @@ var xAboutWindowGetTranslatorCredits func(uintptr) string | |||
| 494 | 495 | // Gets the translator credits string. | |
| 495 | 496 | func (x *AboutWindow) GetTranslatorCredits() string { | |
| 496 | 497 | ||
| 497 | - | return xAboutWindowGetTranslatorCredits(x.GoPointer()) | |
| 498 | - | ||
| 498 | + | cret := xAboutWindowGetTranslatorCredits(x.GoPointer()) | |
| 499 | + | return cret | |
| 499 | 500 | } | |
| 500 | 501 | ||
| 501 | 502 | var xAboutWindowGetVersion func(uintptr) string | |
| @@ -503,8 +504,8 @@ var xAboutWindowGetVersion func(uintptr) string | |||
| 503 | 504 | // Gets the version for @self. | |
| 504 | 505 | func (x *AboutWindow) GetVersion() string { | |
| 505 | 506 | ||
| 506 | - | return xAboutWindowGetVersion(x.GoPointer()) | |
| 507 | - | ||
| 507 | + | cret := xAboutWindowGetVersion(x.GoPointer()) | |
| 508 | + | return cret | |
| 508 | 509 | } | |
| 509 | 510 | ||
| 510 | 511 | var xAboutWindowGetWebsite func(uintptr) string | |
| @@ -512,8 +513,8 @@ var xAboutWindowGetWebsite func(uintptr) string | |||
| 512 | 513 | // Gets the application website URL for @self. | |
| 513 | 514 | func (x *AboutWindow) GetWebsite() string { | |
| 514 | 515 | ||
| 515 | - | return xAboutWindowGetWebsite(x.GoPointer()) | |
| 516 | - | ||
| 516 | + | cret := xAboutWindowGetWebsite(x.GoPointer()) | |
| 517 | + | return cret | |
| 517 | 518 | } | |
| 518 | 519 | ||
| 519 | 520 | var xAboutWindowSetApplicationIcon func(uintptr, string) | |
| @@ -912,8 +913,8 @@ func (x *AboutWindow) ConnectActivateLink(cb func(AboutWindow, string) bool) { | |||
| 912 | 913 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 913 | 914 | func (x *AboutWindow) GetAccessibleRole() gtk.AccessibleRole { | |
| 914 | 915 | ||
| 915 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 916 | - | ||
| 916 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 917 | + | return cret | |
| 917 | 918 | } | |
| 918 | 919 | ||
| 919 | 920 | // Resets the accessible @property to its default value. | |
| @@ -1048,40 +1049,38 @@ func (x *AboutWindow) UpdateStateValue(NStatesVar int, StatesVar uintptr, Values | |||
| 1048 | 1049 | // of the <object> tag used to construct the @buildable. | |
| 1049 | 1050 | func (x *AboutWindow) GetBuildableId() string { | |
| 1050 | 1051 | ||
| 1051 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 1052 | - | ||
| 1052 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 1053 | + | return cret | |
| 1053 | 1054 | } | |
| 1054 | 1055 | ||
| 1055 | 1056 | // Returns the renderer that is used for this `GtkNative`. | |
| 1056 | 1057 | func (x *AboutWindow) GetRenderer() *gsk.Renderer { | |
| 1058 | + | var cls *gsk.Renderer | |
| 1057 | 1059 | ||
| 1058 | - | GetRendererPtr := gtk.XGtkNativeGetRenderer(x.GoPointer()) | |
| 1059 | - | if GetRendererPtr == 0 { | |
| 1060 | - | return nil | |
| 1061 | - | } | |
| 1062 | - | ||
| 1063 | - | gobject.IncreaseRef(GetRendererPtr) | |
| 1064 | - | ||
| 1065 | - | GetRendererCls := &gsk.Renderer{} | |
| 1066 | - | GetRendererCls.Ptr = GetRendererPtr | |
| 1067 | - | return GetRendererCls | |
| 1060 | + | cret := gtk.XGtkNativeGetRenderer(x.GoPointer()) | |
| 1068 | 1061 | ||
| 1062 | + | if cret == 0 { | |
| 1063 | + | return cls | |
| 1064 | + | } | |
| 1065 | + | gobject.IncreaseRef(cret) | |
| 1066 | + | cls = &gsk.Renderer{} | |
| 1067 | + | cls.Ptr = cret | |
| 1068 | + | return cls | |
| 1069 | 1069 | } | |
| 1070 | 1070 | ||
| 1071 | 1071 | // Returns the surface of this `GtkNative`. | |
| 1072 | 1072 | func (x *AboutWindow) GetSurface() *gdk.Surface { | |
| 1073 | + | var cls *gdk.Surface | |
| 1073 | 1074 | ||
| 1074 | - | GetSurfacePtr := gtk.XGtkNativeGetSurface(x.GoPointer()) | |
| 1075 | - | if GetSurfacePtr == 0 { | |
| 1076 | - | return nil | |
| 1077 | - | } | |
| 1078 | - | ||
| 1079 | - | gobject.IncreaseRef(GetSurfacePtr) | |
| 1080 | - | ||
| 1081 | - | GetSurfaceCls := &gdk.Surface{} | |
| 1082 | - | GetSurfaceCls.Ptr = GetSurfacePtr | |
| 1083 | - | return GetSurfaceCls | |
| 1075 | + | cret := gtk.XGtkNativeGetSurface(x.GoPointer()) | |
| 1084 | 1076 | ||
| 1077 | + | if cret == 0 { | |
| 1078 | + | return cls | |
| 1079 | + | } | |
| 1080 | + | gobject.IncreaseRef(cret) | |
| 1081 | + | cls = &gdk.Surface{} | |
| 1082 | + | cls.Ptr = cret | |
| 1083 | + | return cls | |
| 1085 | 1084 | } | |
| 1086 | 1085 | ||
| 1087 | 1086 | // Retrieves the surface transform of @self. | |
| @@ -1114,18 +1113,17 @@ func (x *AboutWindow) Unrealize() { | |||
| 1114 | 1113 | ||
| 1115 | 1114 | // Returns the display that this `GtkRoot` is on. | |
| 1116 | 1115 | func (x *AboutWindow) GetDisplay() *gdk.Display { | |
| 1116 | + | var cls *gdk.Display | |
| 1117 | 1117 | ||
| 1118 | - | GetDisplayPtr := gtk.XGtkRootGetDisplay(x.GoPointer()) | |
| 1119 | - | if GetDisplayPtr == 0 { | |
| 1120 | - | return nil | |
| 1121 | - | } | |
| 1122 | - | ||
| 1123 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 1124 | - | ||
| 1125 | - | GetDisplayCls := &gdk.Display{} | |
| 1126 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 1127 | - | return GetDisplayCls | |
| 1118 | + | cret := gtk.XGtkRootGetDisplay(x.GoPointer()) | |
| 1128 | 1119 | ||
| 1120 | + | if cret == 0 { | |
| 1121 | + | return cls | |
| 1122 | + | } | |
| 1123 | + | gobject.IncreaseRef(cret) | |
| 1124 | + | cls = &gdk.Display{} | |
| 1125 | + | cls.Ptr = cret | |
| 1126 | + | return cls | |
| 1129 | 1127 | } | |
| 1130 | 1128 | ||
| 1131 | 1129 | // Retrieves the current focused widget within the root. | |
| @@ -1135,18 +1133,17 @@ func (x *AboutWindow) GetDisplay() *gdk.Display { | |||
| 1135 | 1133 | // `gtk_widget_has_focus (widget)` will be %FALSE for the | |
| 1136 | 1134 | // widget. | |
| 1137 | 1135 | func (x *AboutWindow) GetFocus() *gtk.Widget { | |
| 1136 | + | var cls *gtk.Widget | |
| 1138 | 1137 | ||
| 1139 | - | GetFocusPtr := gtk.XGtkRootGetFocus(x.GoPointer()) | |
| 1140 | - | if GetFocusPtr == 0 { | |
| 1141 | - | return nil | |
| 1142 | - | } | |
| 1143 | - | ||
| 1144 | - | gobject.IncreaseRef(GetFocusPtr) | |
| 1145 | - | ||
| 1146 | - | GetFocusCls := >k.Widget{} | |
| 1147 | - | GetFocusCls.Ptr = GetFocusPtr | |
| 1148 | - | return GetFocusCls | |
| 1138 | + | cret := gtk.XGtkRootGetFocus(x.GoPointer()) | |
| 1149 | 1139 | ||
| 1140 | + | if cret == 0 { | |
| 1141 | + | return cls | |
| 1142 | + | } | |
| 1143 | + | gobject.IncreaseRef(cret) | |
| 1144 | + | cls = >k.Widget{} | |
| 1145 | + | cls.Ptr = cret | |
| 1146 | + | return cls | |
| 1150 | 1147 | } | |
| 1151 | 1148 | ||
| 1152 | 1149 | // If @focus is not the current focus widget, and is focusable, sets | |
M v4/adw/adw-action-row.go +36 -36
| @@ -65,16 +65,17 @@ var xNewActionRow func() uintptr | |||
| 65 | 65 | ||
| 66 | 66 | // Creates a new `AdwActionRow`. | |
| 67 | 67 | func NewActionRow() *gtk.Widget { | |
| 68 | - | NewActionRowPtr := xNewActionRow() | |
| 69 | - | if NewActionRowPtr == 0 { | |
| 70 | - | return nil | |
| 71 | - | } | |
| 68 | + | var cls *gtk.Widget | |
| 72 | 69 | ||
| 73 | - | gobject.IncreaseRef(NewActionRowPtr) | |
| 70 | + | cret := xNewActionRow() | |
| 74 | 71 | ||
| 75 | - | NewActionRowCls := >k.Widget{} | |
| 76 | - | NewActionRowCls.Ptr = NewActionRowPtr | |
| 77 | - | return NewActionRowCls | |
| 72 | + | if cret == 0 { | |
| 73 | + | return cls | |
| 74 | + | } | |
| 75 | + | gobject.IncreaseRef(cret) | |
| 76 | + | cls = >k.Widget{} | |
| 77 | + | cls.Ptr = cret | |
| 78 | + | return cls | |
| 78 | 79 | } | |
| 79 | 80 | ||
| 80 | 81 | var xActionRowActivate func(uintptr) | |
| @@ -108,18 +109,17 @@ var xActionRowGetActivatableWidget func(uintptr) uintptr | |||
| 108 | 109 | ||
| 109 | 110 | // Gets the widget activated when @self is activated. | |
| 110 | 111 | func (x *ActionRow) GetActivatableWidget() *gtk.Widget { | |
| 112 | + | var cls *gtk.Widget | |
| 111 | 113 | ||
| 112 | - | GetActivatableWidgetPtr := xActionRowGetActivatableWidget(x.GoPointer()) | |
| 113 | - | if GetActivatableWidgetPtr == 0 { | |
| 114 | - | return nil | |
| 115 | - | } | |
| 116 | - | ||
| 117 | - | gobject.IncreaseRef(GetActivatableWidgetPtr) | |
| 118 | - | ||
| 119 | - | GetActivatableWidgetCls := >k.Widget{} | |
| 120 | - | GetActivatableWidgetCls.Ptr = GetActivatableWidgetPtr | |
| 121 | - | return GetActivatableWidgetCls | |
| 114 | + | cret := xActionRowGetActivatableWidget(x.GoPointer()) | |
| 122 | 115 | ||
| 116 | + | if cret == 0 { | |
| 117 | + | return cls | |
| 118 | + | } | |
| 119 | + | gobject.IncreaseRef(cret) | |
| 120 | + | cls = >k.Widget{} | |
| 121 | + | cls.Ptr = cret | |
| 122 | + | return cls | |
| 123 | 123 | } | |
| 124 | 124 | ||
| 125 | 125 | var xActionRowGetIconName func(uintptr) string | |
| @@ -127,8 +127,8 @@ var xActionRowGetIconName func(uintptr) string | |||
| 127 | 127 | // Gets the icon name for @self. | |
| 128 | 128 | func (x *ActionRow) GetIconName() string { | |
| 129 | 129 | ||
| 130 | - | return xActionRowGetIconName(x.GoPointer()) | |
| 131 | - | ||
| 130 | + | cret := xActionRowGetIconName(x.GoPointer()) | |
| 131 | + | return cret | |
| 132 | 132 | } | |
| 133 | 133 | ||
| 134 | 134 | var xActionRowGetSubtitle func(uintptr) string | |
| @@ -136,8 +136,8 @@ var xActionRowGetSubtitle func(uintptr) string | |||
| 136 | 136 | // Gets the subtitle for @self. | |
| 137 | 137 | func (x *ActionRow) GetSubtitle() string { | |
| 138 | 138 | ||
| 139 | - | return xActionRowGetSubtitle(x.GoPointer()) | |
| 140 | - | ||
| 139 | + | cret := xActionRowGetSubtitle(x.GoPointer()) | |
| 140 | + | return cret | |
| 141 | 141 | } | |
| 142 | 142 | ||
| 143 | 143 | var xActionRowGetSubtitleLines func(uintptr) int | |
| @@ -146,8 +146,8 @@ var xActionRowGetSubtitleLines func(uintptr) int | |||
| 146 | 146 | // ellipsized. | |
| 147 | 147 | func (x *ActionRow) GetSubtitleLines() int { | |
| 148 | 148 | ||
| 149 | - | return xActionRowGetSubtitleLines(x.GoPointer()) | |
| 150 | - | ||
| 149 | + | cret := xActionRowGetSubtitleLines(x.GoPointer()) | |
| 150 | + | return cret | |
| 151 | 151 | } | |
| 152 | 152 | ||
| 153 | 153 | var xActionRowGetSubtitleSelectable func(uintptr) bool | |
| @@ -155,8 +155,8 @@ var xActionRowGetSubtitleSelectable func(uintptr) bool | |||
| 155 | 155 | // Gets whether the user can copy the subtitle from the label | |
| 156 | 156 | func (x *ActionRow) GetSubtitleSelectable() bool { | |
| 157 | 157 | ||
| 158 | - | return xActionRowGetSubtitleSelectable(x.GoPointer()) | |
| 159 | - | ||
| 158 | + | cret := xActionRowGetSubtitleSelectable(x.GoPointer()) | |
| 159 | + | return cret | |
| 160 | 160 | } | |
| 161 | 161 | ||
| 162 | 162 | var xActionRowGetTitleLines func(uintptr) int | |
| @@ -165,8 +165,8 @@ var xActionRowGetTitleLines func(uintptr) int | |||
| 165 | 165 | // ellipsized. | |
| 166 | 166 | func (x *ActionRow) GetTitleLines() int { | |
| 167 | 167 | ||
| 168 | - | return xActionRowGetTitleLines(x.GoPointer()) | |
| 169 | - | ||
| 168 | + | cret := xActionRowGetTitleLines(x.GoPointer()) | |
| 169 | + | return cret | |
| 170 | 170 | } | |
| 171 | 171 | ||
| 172 | 172 | var xActionRowRemove func(uintptr, uintptr) | |
| @@ -273,8 +273,8 @@ func (x *ActionRow) ConnectActivated(cb func(ActionRow)) { | |||
| 273 | 273 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 274 | 274 | func (x *ActionRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 275 | 275 | ||
| 276 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 277 | - | ||
| 276 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 277 | + | return cret | |
| 278 | 278 | } | |
| 279 | 279 | ||
| 280 | 280 | // Resets the accessible @property to its default value. | |
| @@ -406,15 +406,15 @@ func (x *ActionRow) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVa | |||
| 406 | 406 | // Gets the action name for @actionable. | |
| 407 | 407 | func (x *ActionRow) GetActionName() string { | |
| 408 | 408 | ||
| 409 | - | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 410 | - | ||
| 409 | + | cret := gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 410 | + | return cret | |
| 411 | 411 | } | |
| 412 | 412 | ||
| 413 | 413 | // Gets the current target value of @actionable. | |
| 414 | 414 | func (x *ActionRow) GetActionTargetValue() *glib.Variant { | |
| 415 | 415 | ||
| 416 | - | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 417 | - | ||
| 416 | + | cret := gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 417 | + | return cret | |
| 418 | 418 | } | |
| 419 | 419 | ||
| 420 | 420 | // Specifies the name of the action with which this widget should be | |
| @@ -492,8 +492,8 @@ func (x *ActionRow) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 492 | 492 | // of the <object> tag used to construct the @buildable. | |
| 493 | 493 | func (x *ActionRow) GetBuildableId() string { | |
| 494 | 494 | ||
| 495 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 496 | - | ||
| 495 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 496 | + | return cret | |
| 497 | 497 | } | |
| 498 | 498 | ||
| 499 | 499 | func init() { | |
M v4/adw/adw-animation-target.go +45 -41
| @@ -56,14 +56,16 @@ var xNewCallbackAnimationTarget func(uintptr, uintptr, uintptr) uintptr | |||
| 56 | 56 | // Creates a new `AdwAnimationTarget` that calls the given @callback during | |
| 57 | 57 | // the animation. | |
| 58 | 58 | func NewCallbackAnimationTarget(CallbackVar AnimationTargetFunc, UserDataVar uintptr, DestroyVar glib.DestroyNotify) *AnimationTarget { | |
| 59 | - | NewCallbackAnimationTargetPtr := xNewCallbackAnimationTarget(purego.NewCallback(CallbackVar), UserDataVar, purego.NewCallback(DestroyVar)) | |
| 60 | - | if NewCallbackAnimationTargetPtr == 0 { | |
| 61 | - | return nil | |
| 62 | - | } | |
| 59 | + | var cls *AnimationTarget | |
| 60 | + | ||
| 61 | + | cret := xNewCallbackAnimationTarget(purego.NewCallback(CallbackVar), UserDataVar, purego.NewCallback(DestroyVar)) | |
| 63 | 62 | ||
| 64 | - | NewCallbackAnimationTargetCls := &AnimationTarget{} | |
| 65 | - | NewCallbackAnimationTargetCls.Ptr = NewCallbackAnimationTargetPtr | |
| 66 | - | return NewCallbackAnimationTargetCls | |
| 63 | + | if cret == 0 { | |
| 64 | + | return cls | |
| 65 | + | } | |
| 66 | + | cls = &AnimationTarget{} | |
| 67 | + | cls.Ptr = cret | |
| 68 | + | return cls | |
| 67 | 69 | } | |
| 68 | 70 | ||
| 69 | 71 | func (c *CallbackAnimationTarget) GoPointer() uintptr { | |
| @@ -91,14 +93,16 @@ var xNewPropertyAnimationTarget func(uintptr, string) uintptr | |||
| 91 | 93 | // Creates a new `AdwPropertyAnimationTarget` for the @property_name property on | |
| 92 | 94 | // @object. | |
| 93 | 95 | func NewPropertyAnimationTarget(ObjectVar *gobject.Object, PropertyNameVar string) *AnimationTarget { | |
| 94 | - | NewPropertyAnimationTargetPtr := xNewPropertyAnimationTarget(ObjectVar.GoPointer(), PropertyNameVar) | |
| 95 | - | if NewPropertyAnimationTargetPtr == 0 { | |
| 96 | - | return nil | |
| 97 | - | } | |
| 96 | + | var cls *AnimationTarget | |
| 97 | + | ||
| 98 | + | cret := xNewPropertyAnimationTarget(ObjectVar.GoPointer(), PropertyNameVar) | |
| 98 | 99 | ||
| 99 | - | NewPropertyAnimationTargetCls := &AnimationTarget{} | |
| 100 | - | NewPropertyAnimationTargetCls.Ptr = NewPropertyAnimationTargetPtr | |
| 101 | - | return NewPropertyAnimationTargetCls | |
| 100 | + | if cret == 0 { | |
| 101 | + | return cls | |
| 102 | + | } | |
| 103 | + | cls = &AnimationTarget{} | |
| 104 | + | cls.Ptr = cret | |
| 105 | + | return cls | |
| 102 | 106 | } | |
| 103 | 107 | ||
| 104 | 108 | var xNewForPspecPropertyAnimationTarget func(uintptr, uintptr) uintptr | |
| @@ -106,14 +110,16 @@ var xNewForPspecPropertyAnimationTarget func(uintptr, uintptr) uintptr | |||
| 106 | 110 | // Creates a new `AdwPropertyAnimationTarget` for the @pspec property on | |
| 107 | 111 | // @object. | |
| 108 | 112 | func NewForPspecPropertyAnimationTarget(ObjectVar *gobject.Object, PspecVar *gobject.ParamSpec) *AnimationTarget { | |
| 109 | - | NewForPspecPropertyAnimationTargetPtr := xNewForPspecPropertyAnimationTarget(ObjectVar.GoPointer(), PspecVar.GoPointer()) | |
| 110 | - | if NewForPspecPropertyAnimationTargetPtr == 0 { | |
| 111 | - | return nil | |
| 112 | - | } | |
| 113 | + | var cls *AnimationTarget | |
| 113 | 114 | ||
| 114 | - | NewForPspecPropertyAnimationTargetCls := &AnimationTarget{} | |
| 115 | - | NewForPspecPropertyAnimationTargetCls.Ptr = NewForPspecPropertyAnimationTargetPtr | |
| 116 | - | return NewForPspecPropertyAnimationTargetCls | |
| 115 | + | cret := xNewForPspecPropertyAnimationTarget(ObjectVar.GoPointer(), PspecVar.GoPointer()) | |
| 116 | + | ||
| 117 | + | if cret == 0 { | |
| 118 | + | return cls | |
| 119 | + | } | |
| 120 | + | cls = &AnimationTarget{} | |
| 121 | + | cls.Ptr = cret | |
| 122 | + | return cls | |
| 117 | 123 | } | |
| 118 | 124 | ||
| 119 | 125 | var xPropertyAnimationTargetGetObject func(uintptr) uintptr | |
| @@ -124,36 +130,34 @@ var xPropertyAnimationTargetGetObject func(uintptr) uintptr | |||
| 124 | 130 | // the object; make sure the object is kept alive throughout the target's | |
| 125 | 131 | // lifetime. | |
| 126 | 132 | func (x *PropertyAnimationTarget) GetObject() *gobject.Object { | |
| 133 | + | var cls *gobject.Object | |
| 127 | 134 | ||
| 128 | - | GetObjectPtr := xPropertyAnimationTargetGetObject(x.GoPointer()) | |
| 129 | - | if GetObjectPtr == 0 { | |
| 130 | - | return nil | |
| 131 | - | } | |
| 132 | - | ||
| 133 | - | gobject.IncreaseRef(GetObjectPtr) | |
| 134 | - | ||
| 135 | - | GetObjectCls := &gobject.Object{} | |
| 136 | - | GetObjectCls.Ptr = GetObjectPtr | |
| 137 | - | return GetObjectCls | |
| 135 | + | cret := xPropertyAnimationTargetGetObject(x.GoPointer()) | |
| 138 | 136 | ||
| 137 | + | if cret == 0 { | |
| 138 | + | return cls | |
| 139 | + | } | |
| 140 | + | gobject.IncreaseRef(cret) | |
| 141 | + | cls = &gobject.Object{} | |
| 142 | + | cls.Ptr = cret | |
| 143 | + | return cls | |
| 139 | 144 | } | |
| 140 | 145 | ||
| 141 | 146 | var xPropertyAnimationTargetGetPspec func(uintptr) uintptr | |
| 142 | 147 | ||
| 143 | 148 | // Gets the `GParamSpec` of the property animated by @self. | |
| 144 | 149 | func (x *PropertyAnimationTarget) GetPspec() *gobject.ParamSpec { | |
| 150 | + | var cls *gobject.ParamSpec | |
| 145 | 151 | ||
| 146 | - | GetPspecPtr := xPropertyAnimationTargetGetPspec(x.GoPointer()) | |
| 147 | - | if GetPspecPtr == 0 { | |
| 148 | - | return nil | |
| 149 | - | } | |
| 150 | - | ||
| 151 | - | gobject.IncreaseRef(GetPspecPtr) | |
| 152 | - | ||
| 153 | - | GetPspecCls := &gobject.ParamSpec{} | |
| 154 | - | GetPspecCls.Ptr = GetPspecPtr | |
| 155 | - | return GetPspecCls | |
| 152 | + | cret := xPropertyAnimationTargetGetPspec(x.GoPointer()) | |
| 156 | 153 | ||
| 154 | + | if cret == 0 { | |
| 155 | + | return cls | |
| 156 | + | } | |
| 157 | + | gobject.IncreaseRef(cret) | |
| 158 | + | cls = &gobject.ParamSpec{} | |
| 159 | + | cls.Ptr = cret | |
| 160 | + | return cls | |
| 157 | 161 | } | |
| 158 | 162 | ||
| 159 | 163 | func (c *PropertyAnimationTarget) GoPointer() uintptr { | |
M v4/adw/adw-animation-util.go +4 -4
| @@ -15,8 +15,8 @@ var xGetEnableAnimations func(uintptr) bool | |||
| 15 | 15 | // animate it or not. | |
| 16 | 16 | func GetEnableAnimations(WidgetVar *gtk.Widget) bool { | |
| 17 | 17 | ||
| 18 | - | return xGetEnableAnimations(WidgetVar.GoPointer()) | |
| 19 | - | ||
| 18 | + | cret := xGetEnableAnimations(WidgetVar.GoPointer()) | |
| 19 | + | return cret | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | var xLerp func(float64, float64, float64) float64 | |
| @@ -24,8 +24,8 @@ var xLerp func(float64, float64, float64) float64 | |||
| 24 | 24 | // Computes the linear interpolation between @a and @b for @t. | |
| 25 | 25 | func Lerp(AVar float64, BVar float64, TVar float64) float64 { | |
| 26 | 26 | ||
| 27 | - | return xLerp(AVar, BVar, TVar) | |
| 28 | - | ||
| 27 | + | cret := xLerp(AVar, BVar, TVar) | |
| 28 | + | return cret | |
| 29 | 29 | } | |
| 30 | 30 | ||
| 31 | 31 | func init() { | |
M v4/adw/adw-animation.go +24 -26
| @@ -94,8 +94,8 @@ var xAnimationGetFollowEnableAnimationsSetting func(uintptr) bool | |||
| 94 | 94 | // Gets whether @self should be skipped when animations are globally disabled. | |
| 95 | 95 | func (x *Animation) GetFollowEnableAnimationsSetting() bool { | |
| 96 | 96 | ||
| 97 | - | return xAnimationGetFollowEnableAnimationsSetting(x.GoPointer()) | |
| 98 | - | ||
| 97 | + | cret := xAnimationGetFollowEnableAnimationsSetting(x.GoPointer()) | |
| 98 | + | return cret | |
| 99 | 99 | } | |
| 100 | 100 | ||
| 101 | 101 | var xAnimationGetState func(uintptr) AnimationState | |
| @@ -106,26 +106,25 @@ var xAnimationGetState func(uintptr) AnimationState | |||
| 106 | 106 | // hasn't been started yet. | |
| 107 | 107 | func (x *Animation) GetState() AnimationState { | |
| 108 | 108 | ||
| 109 | - | return xAnimationGetState(x.GoPointer()) | |
| 110 | - | ||
| 109 | + | cret := xAnimationGetState(x.GoPointer()) | |
| 110 | + | return cret | |
| 111 | 111 | } | |
| 112 | 112 | ||
| 113 | 113 | var xAnimationGetTarget func(uintptr) uintptr | |
| 114 | 114 | ||
| 115 | 115 | // Gets the target @self animates. | |
| 116 | 116 | func (x *Animation) GetTarget() *AnimationTarget { | |
| 117 | + | var cls *AnimationTarget | |
| 117 | 118 | ||
| 118 | - | GetTargetPtr := xAnimationGetTarget(x.GoPointer()) | |
| 119 | - | if GetTargetPtr == 0 { | |
| 120 | - | return nil | |
| 121 | - | } | |
| 122 | - | ||
| 123 | - | gobject.IncreaseRef(GetTargetPtr) | |
| 124 | - | ||
| 125 | - | GetTargetCls := &AnimationTarget{} | |
| 126 | - | GetTargetCls.Ptr = GetTargetPtr | |
| 127 | - | return GetTargetCls | |
| 119 | + | cret := xAnimationGetTarget(x.GoPointer()) | |
| 128 | 120 | ||
| 121 | + | if cret == 0 { | |
| 122 | + | return cls | |
| 123 | + | } | |
| 124 | + | gobject.IncreaseRef(cret) | |
| 125 | + | cls = &AnimationTarget{} | |
| 126 | + | cls.Ptr = cret | |
| 127 | + | return cls | |
| 129 | 128 | } | |
| 130 | 129 | ||
| 131 | 130 | var xAnimationGetValue func(uintptr) float64 | |
| @@ -133,8 +132,8 @@ var xAnimationGetValue func(uintptr) float64 | |||
| 133 | 132 | // Gets the current value of @self. | |
| 134 | 133 | func (x *Animation) GetValue() float64 { | |
| 135 | 134 | ||
| 136 | - | return xAnimationGetValue(x.GoPointer()) | |
| 137 | - | ||
| 135 | + | cret := xAnimationGetValue(x.GoPointer()) | |
| 136 | + | return cret | |
| 138 | 137 | } | |
| 139 | 138 | ||
| 140 | 139 | var xAnimationGetWidget func(uintptr) uintptr | |
| @@ -148,18 +147,17 @@ var xAnimationGetWidget func(uintptr) uintptr | |||
| 148 | 147 | // mapped, or if it gets unmapped during an ongoing animation, the animation | |
| 149 | 148 | // will be automatically skipped. | |
| 150 | 149 | func (x *Animation) GetWidget() *gtk.Widget { | |
| 150 | + | var cls *gtk.Widget | |
| 151 | 151 | ||
| 152 | - | GetWidgetPtr := xAnimationGetWidget(x.GoPointer()) | |
| 153 | - | if GetWidgetPtr == 0 { | |
| 154 | - | return nil | |
| 155 | - | } | |
| 156 | - | ||
| 157 | - | gobject.IncreaseRef(GetWidgetPtr) | |
| 158 | - | ||
| 159 | - | GetWidgetCls := >k.Widget{} | |
| 160 | - | GetWidgetCls.Ptr = GetWidgetPtr | |
| 161 | - | return GetWidgetCls | |
| 152 | + | cret := xAnimationGetWidget(x.GoPointer()) | |
| 162 | 153 | ||
| 154 | + | if cret == 0 { | |
| 155 | + | return cls | |
| 156 | + | } | |
| 157 | + | gobject.IncreaseRef(cret) | |
| 158 | + | cls = >k.Widget{} | |
| 159 | + | cls.Ptr = cret | |
| 160 | + | return cls | |
| 163 | 161 | } | |
| 164 | 162 | ||
| 165 | 163 | var xAnimationPause func(uintptr) | |
M v4/adw/adw-application-window.go +83 -88
| @@ -48,16 +48,17 @@ var xNewApplicationWindow func(uintptr) uintptr | |||
| 48 | 48 | ||
| 49 | 49 | // Creates a new `AdwApplicationWindow` for @app. | |
| 50 | 50 | func NewApplicationWindow(AppVar *gtk.Application) *gtk.Widget { | |
| 51 | - | NewApplicationWindowPtr := xNewApplicationWindow(AppVar.GoPointer()) | |
| 52 | - | if NewApplicationWindowPtr == 0 { | |
| 53 | - | return nil | |
| 54 | - | } | |
| 51 | + | var cls *gtk.Widget | |
| 55 | 52 | ||
| 56 | - | gobject.IncreaseRef(NewApplicationWindowPtr) | |
| 53 | + | cret := xNewApplicationWindow(AppVar.GoPointer()) | |
| 57 | 54 | ||
| 58 | - | NewApplicationWindowCls := >k.Widget{} | |
| 59 | - | NewApplicationWindowCls.Ptr = NewApplicationWindowPtr | |
| 60 | - | return NewApplicationWindowCls | |
| 55 | + | if cret == 0 { | |
| 56 | + | return cls | |
| 57 | + | } | |
| 58 | + | gobject.IncreaseRef(cret) | |
| 59 | + | cls = >k.Widget{} | |
| 60 | + | cls.Ptr = cret | |
| 61 | + | return cls | |
| 61 | 62 | } | |
| 62 | 63 | ||
| 63 | 64 | var xApplicationWindowGetContent func(uintptr) uintptr | |
| @@ -66,18 +67,17 @@ var xApplicationWindowGetContent func(uintptr) uintptr | |||
| 66 | 67 | // | |
| 67 | 68 | // This method should always be used instead of [method@Gtk.Window.get_child]. | |
| 68 | 69 | func (x *ApplicationWindow) GetContent() *gtk.Widget { | |
| 70 | + | var cls *gtk.Widget | |
| 69 | 71 | ||
| 70 | - | GetContentPtr := xApplicationWindowGetContent(x.GoPointer()) | |
| 71 | - | if GetContentPtr == 0 { | |
| 72 | - | return nil | |
| 73 | - | } | |
| 74 | - | ||
| 75 | - | gobject.IncreaseRef(GetContentPtr) | |
| 76 | - | ||
| 77 | - | GetContentCls := >k.Widget{} | |
| 78 | - | GetContentCls.Ptr = GetContentPtr | |
| 79 | - | return GetContentCls | |
| 72 | + | cret := xApplicationWindowGetContent(x.GoPointer()) | |
| 80 | 73 | ||
| 74 | + | if cret == 0 { | |
| 75 | + | return cls | |
| 76 | + | } | |
| 77 | + | gobject.IncreaseRef(cret) | |
| 78 | + | cls = >k.Widget{} | |
| 79 | + | cls.Ptr = cret | |
| 80 | + | return cls | |
| 81 | 81 | } | |
| 82 | 82 | ||
| 83 | 83 | var xApplicationWindowSetContent func(uintptr, uintptr) | |
| @@ -197,8 +197,8 @@ func (x *ApplicationWindow) ChangeActionState(ActionNameVar string, ValueVar *gl | |||
| 197 | 197 | // have its state changed from outside callers. | |
| 198 | 198 | func (x *ApplicationWindow) GetActionEnabled(ActionNameVar string) bool { | |
| 199 | 199 | ||
| 200 | - | return gio.XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar) | |
| 201 | - | ||
| 200 | + | cret := gio.XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar) | |
| 201 | + | return cret | |
| 202 | 202 | } | |
| 203 | 203 | ||
| 204 | 204 | // Queries the type of the parameter that must be given when activating | |
| @@ -216,8 +216,8 @@ func (x *ApplicationWindow) GetActionEnabled(ActionNameVar string) bool { | |||
| 216 | 216 | // with the same name but a different parameter type. | |
| 217 | 217 | func (x *ApplicationWindow) GetActionParameterType(ActionNameVar string) *glib.VariantType { | |
| 218 | 218 | ||
| 219 | - | return gio.XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar) | |
| 220 | - | ||
| 219 | + | cret := gio.XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar) | |
| 220 | + | return cret | |
| 221 | 221 | } | |
| 222 | 222 | ||
| 223 | 223 | // Queries the current state of the named action within @action_group. | |
| @@ -230,8 +230,8 @@ func (x *ApplicationWindow) GetActionParameterType(ActionNameVar string) *glib.V | |||
| 230 | 230 | // g_variant_unref() when it is no longer required. | |
| 231 | 231 | func (x *ApplicationWindow) GetActionState(ActionNameVar string) *glib.Variant { | |
| 232 | 232 | ||
| 233 | - | return gio.XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| 234 | - | ||
| 233 | + | cret := gio.XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| 234 | + | return cret | |
| 235 | 235 | } | |
| 236 | 236 | ||
| 237 | 237 | // Requests a hint about the valid range of values for the state of the | |
| @@ -254,8 +254,8 @@ func (x *ApplicationWindow) GetActionState(ActionNameVar string) *glib.Variant { | |||
| 254 | 254 | // g_variant_unref() when it is no longer required. | |
| 255 | 255 | func (x *ApplicationWindow) GetActionStateHint(ActionNameVar string) *glib.Variant { | |
| 256 | 256 | ||
| 257 | - | return gio.XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| 258 | - | ||
| 257 | + | cret := gio.XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| 258 | + | return cret | |
| 259 | 259 | } | |
| 260 | 260 | ||
| 261 | 261 | // Queries the type of the state of the named action within | |
| @@ -276,15 +276,15 @@ func (x *ApplicationWindow) GetActionStateHint(ActionNameVar string) *glib.Varia | |||
| 276 | 276 | // with the same name but a different state type. | |
| 277 | 277 | func (x *ApplicationWindow) GetActionStateType(ActionNameVar string) *glib.VariantType { | |
| 278 | 278 | ||
| 279 | - | return gio.XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar) | |
| 280 | - | ||
| 279 | + | cret := gio.XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar) | |
| 280 | + | return cret | |
| 281 | 281 | } | |
| 282 | 282 | ||
| 283 | 283 | // Checks if the named action exists within @action_group. | |
| 284 | 284 | func (x *ApplicationWindow) HasAction(ActionNameVar string) bool { | |
| 285 | 285 | ||
| 286 | - | return gio.XGActionGroupHasAction(x.GoPointer(), ActionNameVar) | |
| 287 | - | ||
| 286 | + | cret := gio.XGActionGroupHasAction(x.GoPointer(), ActionNameVar) | |
| 287 | + | return cret | |
| 288 | 288 | } | |
| 289 | 289 | ||
| 290 | 290 | // Lists the actions contained within @action_group. | |
| @@ -293,8 +293,8 @@ func (x *ApplicationWindow) HasAction(ActionNameVar string) bool { | |||
| 293 | 293 | // it is no longer required. | |
| 294 | 294 | func (x *ApplicationWindow) ListActions() uintptr { | |
| 295 | 295 | ||
| 296 | - | return gio.XGActionGroupListActions(x.GoPointer()) | |
| 297 | - | ||
| 296 | + | cret := gio.XGActionGroupListActions(x.GoPointer()) | |
| 297 | + | return cret | |
| 298 | 298 | } | |
| 299 | 299 | ||
| 300 | 300 | // Queries all aspects of the named action within an @action_group. | |
| @@ -326,8 +326,8 @@ func (x *ApplicationWindow) ListActions() uintptr { | |||
| 326 | 326 | // fields may or may not have been modified. | |
| 327 | 327 | func (x *ApplicationWindow) QueryAction(ActionNameVar string, EnabledVar bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool { | |
| 328 | 328 | ||
| 329 | - | return gio.XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) | |
| 330 | - | ||
| 329 | + | cret := gio.XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) | |
| 330 | + | return cret | |
| 331 | 331 | } | |
| 332 | 332 | ||
| 333 | 333 | // Adds an action to the @action_map. | |
| @@ -395,18 +395,17 @@ func (x *ApplicationWindow) AddActionEntries(EntriesVar uintptr, NEntriesVar int | |||
| 395 | 395 | // | |
| 396 | 396 | // If no such action exists, returns %NULL. | |
| 397 | 397 | func (x *ApplicationWindow) LookupAction(ActionNameVar string) *gio.ActionBase { | |
| 398 | + | var cls *gio.ActionBase | |
| 398 | 399 | ||
| 399 | - | LookupActionPtr := gio.XGActionMapLookupAction(x.GoPointer(), ActionNameVar) | |
| 400 | - | if LookupActionPtr == 0 { | |
| 401 | - | return nil | |
| 402 | - | } | |
| 403 | - | ||
| 404 | - | gobject.IncreaseRef(LookupActionPtr) | |
| 405 | - | ||
| 406 | - | LookupActionCls := &gio.ActionBase{} | |
| 407 | - | LookupActionCls.Ptr = LookupActionPtr | |
| 408 | - | return LookupActionCls | |
| 400 | + | cret := gio.XGActionMapLookupAction(x.GoPointer(), ActionNameVar) | |
| 409 | 401 | ||
| 402 | + | if cret == 0 { | |
| 403 | + | return cls | |
| 404 | + | } | |
| 405 | + | gobject.IncreaseRef(cret) | |
| 406 | + | cls = &gio.ActionBase{} | |
| 407 | + | cls.Ptr = cret | |
| 408 | + | return cls | |
| 410 | 409 | } | |
| 411 | 410 | ||
| 412 | 411 | // Removes the named action from the action map. | |
| @@ -421,8 +420,8 @@ func (x *ApplicationWindow) RemoveAction(ActionNameVar string) { | |||
| 421 | 420 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 422 | 421 | func (x *ApplicationWindow) GetAccessibleRole() gtk.AccessibleRole { | |
| 423 | 422 | ||
| 424 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 425 | - | ||
| 423 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 424 | + | return cret | |
| 426 | 425 | } | |
| 427 | 426 | ||
| 428 | 427 | // Resets the accessible @property to its default value. | |
| @@ -557,40 +556,38 @@ func (x *ApplicationWindow) UpdateStateValue(NStatesVar int, StatesVar uintptr, | |||
| 557 | 556 | // of the <object> tag used to construct the @buildable. | |
| 558 | 557 | func (x *ApplicationWindow) GetBuildableId() string { | |
| 559 | 558 | ||
| 560 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 561 | - | ||
| 559 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 560 | + | return cret | |
| 562 | 561 | } | |
| 563 | 562 | ||
| 564 | 563 | // Returns the renderer that is used for this `GtkNative`. | |
| 565 | 564 | func (x *ApplicationWindow) GetRenderer() *gsk.Renderer { | |
| 565 | + | var cls *gsk.Renderer | |
| 566 | 566 | ||
| 567 | - | GetRendererPtr := gtk.XGtkNativeGetRenderer(x.GoPointer()) | |
| 568 | - | if GetRendererPtr == 0 { | |
| 569 | - | return nil | |
| 570 | - | } | |
| 571 | - | ||
| 572 | - | gobject.IncreaseRef(GetRendererPtr) | |
| 573 | - | ||
| 574 | - | GetRendererCls := &gsk.Renderer{} | |
| 575 | - | GetRendererCls.Ptr = GetRendererPtr | |
| 576 | - | return GetRendererCls | |
| 567 | + | cret := gtk.XGtkNativeGetRenderer(x.GoPointer()) | |
| 577 | 568 | ||
| 569 | + | if cret == 0 { | |
| 570 | + | return cls | |
| 571 | + | } | |
| 572 | + | gobject.IncreaseRef(cret) | |
| 573 | + | cls = &gsk.Renderer{} | |
| 574 | + | cls.Ptr = cret | |
| 575 | + | return cls | |
| 578 | 576 | } | |
| 579 | 577 | ||
| 580 | 578 | // Returns the surface of this `GtkNative`. | |
| 581 | 579 | func (x *ApplicationWindow) GetSurface() *gdk.Surface { | |
| 580 | + | var cls *gdk.Surface | |
| 582 | 581 | ||
| 583 | - | GetSurfacePtr := gtk.XGtkNativeGetSurface(x.GoPointer()) | |
| 584 | - | if GetSurfacePtr == 0 { | |
| 585 | - | return nil | |
| 586 | - | } | |
| 587 | - | ||
| 588 | - | gobject.IncreaseRef(GetSurfacePtr) | |
| 589 | - | ||
| 590 | - | GetSurfaceCls := &gdk.Surface{} | |
| 591 | - | GetSurfaceCls.Ptr = GetSurfacePtr | |
| 592 | - | return GetSurfaceCls | |
| 582 | + | cret := gtk.XGtkNativeGetSurface(x.GoPointer()) | |
| 593 | 583 | ||
| 584 | + | if cret == 0 { | |
| 585 | + | return cls | |
| 586 | + | } | |
| 587 | + | gobject.IncreaseRef(cret) | |
| 588 | + | cls = &gdk.Surface{} | |
| 589 | + | cls.Ptr = cret | |
| 590 | + | return cls | |
| 594 | 591 | } | |
| 595 | 592 | ||
| 596 | 593 | // Retrieves the surface transform of @self. | |
| @@ -623,18 +620,17 @@ func (x *ApplicationWindow) Unrealize() { | |||
| 623 | 620 | ||
| 624 | 621 | // Returns the display that this `GtkRoot` is on. | |
| 625 | 622 | func (x *ApplicationWindow) GetDisplay() *gdk.Display { | |
| 623 | + | var cls *gdk.Display | |
| 626 | 624 | ||
| 627 | - | GetDisplayPtr := gtk.XGtkRootGetDisplay(x.GoPointer()) | |
| 628 | - | if GetDisplayPtr == 0 { | |
| 629 | - | return nil | |
| 630 | - | } | |
| 631 | - | ||
| 632 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 633 | - | ||
| 634 | - | GetDisplayCls := &gdk.Display{} | |
| 635 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 636 | - | return GetDisplayCls | |
| 625 | + | cret := gtk.XGtkRootGetDisplay(x.GoPointer()) | |
| 637 | 626 | ||
| 627 | + | if cret == 0 { | |
| 628 | + | return cls | |
| 629 | + | } | |
| 630 | + | gobject.IncreaseRef(cret) | |
| 631 | + | cls = &gdk.Display{} | |
| 632 | + | cls.Ptr = cret | |
| 633 | + | return cls | |
| 638 | 634 | } | |
| 639 | 635 | ||
| 640 | 636 | // Retrieves the current focused widget within the root. | |
| @@ -644,18 +640,17 @@ func (x *ApplicationWindow) GetDisplay() *gdk.Display { | |||
| 644 | 640 | // `gtk_widget_has_focus (widget)` will be %FALSE for the | |
| 645 | 641 | // widget. | |
| 646 | 642 | func (x *ApplicationWindow) GetFocus() *gtk.Widget { | |
| 643 | + | var cls *gtk.Widget | |
| 647 | 644 | ||
| 648 | - | GetFocusPtr := gtk.XGtkRootGetFocus(x.GoPointer()) | |
| 649 | - | if GetFocusPtr == 0 { | |
| 650 | - | return nil | |
| 651 | - | } | |
| 652 | - | ||
| 653 | - | gobject.IncreaseRef(GetFocusPtr) | |
| 654 | - | ||
| 655 | - | GetFocusCls := >k.Widget{} | |
| 656 | - | GetFocusCls.Ptr = GetFocusPtr | |
| 657 | - | return GetFocusCls | |
| 645 | + | cret := gtk.XGtkRootGetFocus(x.GoPointer()) | |
| 658 | 646 | ||
| 647 | + | if cret == 0 { | |
| 648 | + | return cls | |
| 649 | + | } | |
| 650 | + | gobject.IncreaseRef(cret) | |
| 651 | + | cls = >k.Widget{} | |
| 652 | + | cls.Ptr = cret | |
| 653 | + | return cls | |
| 659 | 654 | } | |
| 660 | 655 | ||
| 661 | 656 | // If @focus is not the current focus widget, and is focusable, sets | |
M v4/adw/adw-application.go +43 -43
| @@ -62,14 +62,16 @@ var xNewApplication func(string, gio.ApplicationFlags) uintptr | |||
| 62 | 62 | // If no application ID is given then some features (most notably application | |
| 63 | 63 | // uniqueness) will be disabled. | |
| 64 | 64 | func NewApplication(ApplicationIdVar string, FlagsVar gio.ApplicationFlags) *Application { | |
| 65 | - | NewApplicationPtr := xNewApplication(ApplicationIdVar, FlagsVar) | |
| 66 | - | if NewApplicationPtr == 0 { | |
| 67 | - | return nil | |
| 68 | - | } | |
| 65 | + | var cls *Application | |
| 66 | + | ||
| 67 | + | cret := xNewApplication(ApplicationIdVar, FlagsVar) | |
| 69 | 68 | ||
| 70 | - | NewApplicationCls := &Application{} | |
| 71 | - | NewApplicationCls.Ptr = NewApplicationPtr | |
| 72 | - | return NewApplicationCls | |
| 69 | + | if cret == 0 { | |
| 70 | + | return cls | |
| 71 | + | } | |
| 72 | + | cls = &Application{} | |
| 73 | + | cls.Ptr = cret | |
| 74 | + | return cls | |
| 73 | 75 | } | |
| 74 | 76 | ||
| 75 | 77 | var xApplicationGetStyleManager func(uintptr) uintptr | |
| @@ -79,18 +81,17 @@ var xApplicationGetStyleManager func(uintptr) uintptr | |||
| 79 | 81 | // This is a convenience property allowing to access `AdwStyleManager` through | |
| 80 | 82 | // property bindings or expressions. | |
| 81 | 83 | func (x *Application) GetStyleManager() *StyleManager { | |
| 84 | + | var cls *StyleManager | |
| 82 | 85 | ||
| 83 | - | GetStyleManagerPtr := xApplicationGetStyleManager(x.GoPointer()) | |
| 84 | - | if GetStyleManagerPtr == 0 { | |
| 85 | - | return nil | |
| 86 | - | } | |
| 87 | - | ||
| 88 | - | gobject.IncreaseRef(GetStyleManagerPtr) | |
| 89 | - | ||
| 90 | - | GetStyleManagerCls := &StyleManager{} | |
| 91 | - | GetStyleManagerCls.Ptr = GetStyleManagerPtr | |
| 92 | - | return GetStyleManagerCls | |
| 86 | + | cret := xApplicationGetStyleManager(x.GoPointer()) | |
| 93 | 87 | ||
| 88 | + | if cret == 0 { | |
| 89 | + | return cls | |
| 90 | + | } | |
| 91 | + | gobject.IncreaseRef(cret) | |
| 92 | + | cls = &StyleManager{} | |
| 93 | + | cls.Ptr = cret | |
| 94 | + | return cls | |
| 94 | 95 | } | |
| 95 | 96 | ||
| 96 | 97 | func (c *Application) GoPointer() uintptr { | |
| @@ -199,8 +200,8 @@ func (x *Application) ChangeActionState(ActionNameVar string, ValueVar *glib.Var | |||
| 199 | 200 | // have its state changed from outside callers. | |
| 200 | 201 | func (x *Application) GetActionEnabled(ActionNameVar string) bool { | |
| 201 | 202 | ||
| 202 | - | return gio.XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar) | |
| 203 | - | ||
| 203 | + | cret := gio.XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar) | |
| 204 | + | return cret | |
| 204 | 205 | } | |
| 205 | 206 | ||
| 206 | 207 | // Queries the type of the parameter that must be given when activating | |
| @@ -218,8 +219,8 @@ func (x *Application) GetActionEnabled(ActionNameVar string) bool { | |||
| 218 | 219 | // with the same name but a different parameter type. | |
| 219 | 220 | func (x *Application) GetActionParameterType(ActionNameVar string) *glib.VariantType { | |
| 220 | 221 | ||
| 221 | - | return gio.XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar) | |
| 222 | - | ||
| 222 | + | cret := gio.XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar) | |
| 223 | + | return cret | |
| 223 | 224 | } | |
| 224 | 225 | ||
| 225 | 226 | // Queries the current state of the named action within @action_group. | |
| @@ -232,8 +233,8 @@ func (x *Application) GetActionParameterType(ActionNameVar string) *glib.Variant | |||
| 232 | 233 | // g_variant_unref() when it is no longer required. | |
| 233 | 234 | func (x *Application) GetActionState(ActionNameVar string) *glib.Variant { | |
| 234 | 235 | ||
| 235 | - | return gio.XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| 236 | - | ||
| 236 | + | cret := gio.XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| 237 | + | return cret | |
| 237 | 238 | } | |
| 238 | 239 | ||
| 239 | 240 | // Requests a hint about the valid range of values for the state of the | |
| @@ -256,8 +257,8 @@ func (x *Application) GetActionState(ActionNameVar string) *glib.Variant { | |||
| 256 | 257 | // g_variant_unref() when it is no longer required. | |
| 257 | 258 | func (x *Application) GetActionStateHint(ActionNameVar string) *glib.Variant { | |
| 258 | 259 | ||
| 259 | - | return gio.XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| 260 | - | ||
| 260 | + | cret := gio.XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| 261 | + | return cret | |
| 261 | 262 | } | |
| 262 | 263 | ||
| 263 | 264 | // Queries the type of the state of the named action within | |
| @@ -278,15 +279,15 @@ func (x *Application) GetActionStateHint(ActionNameVar string) *glib.Variant { | |||
| 278 | 279 | // with the same name but a different state type. | |
| 279 | 280 | func (x *Application) GetActionStateType(ActionNameVar string) *glib.VariantType { | |
| 280 | 281 | ||
| 281 | - | return gio.XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar) | |
| 282 | - | ||
| 282 | + | cret := gio.XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar) | |
| 283 | + | return cret | |
| 283 | 284 | } | |
| 284 | 285 | ||
| 285 | 286 | // Checks if the named action exists within @action_group. | |
| 286 | 287 | func (x *Application) HasAction(ActionNameVar string) bool { | |
| 287 | 288 | ||
| 288 | - | return gio.XGActionGroupHasAction(x.GoPointer(), ActionNameVar) | |
| 289 | - | ||
| 289 | + | cret := gio.XGActionGroupHasAction(x.GoPointer(), ActionNameVar) | |
| 290 | + | return cret | |
| 290 | 291 | } | |
| 291 | 292 | ||
| 292 | 293 | // Lists the actions contained within @action_group. | |
| @@ -295,8 +296,8 @@ func (x *Application) HasAction(ActionNameVar string) bool { | |||
| 295 | 296 | // it is no longer required. | |
| 296 | 297 | func (x *Application) ListActions() uintptr { | |
| 297 | 298 | ||
| 298 | - | return gio.XGActionGroupListActions(x.GoPointer()) | |
| 299 | - | ||
| 299 | + | cret := gio.XGActionGroupListActions(x.GoPointer()) | |
| 300 | + | return cret | |
| 300 | 301 | } | |
| 301 | 302 | ||
| 302 | 303 | // Queries all aspects of the named action within an @action_group. | |
| @@ -328,8 +329,8 @@ func (x *Application) ListActions() uintptr { | |||
| 328 | 329 | // fields may or may not have been modified. | |
| 329 | 330 | func (x *Application) QueryAction(ActionNameVar string, EnabledVar bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool { | |
| 330 | 331 | ||
| 331 | - | return gio.XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) | |
| 332 | - | ||
| 332 | + | cret := gio.XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) | |
| 333 | + | return cret | |
| 333 | 334 | } | |
| 334 | 335 | ||
| 335 | 336 | // Adds an action to the @action_map. | |
| @@ -397,18 +398,17 @@ func (x *Application) AddActionEntries(EntriesVar uintptr, NEntriesVar int, User | |||
| 397 | 398 | // | |
| 398 | 399 | // If no such action exists, returns %NULL. | |
| 399 | 400 | func (x *Application) LookupAction(ActionNameVar string) *gio.ActionBase { | |
| 401 | + | var cls *gio.ActionBase | |
| 400 | 402 | ||
| 401 | - | LookupActionPtr := gio.XGActionMapLookupAction(x.GoPointer(), ActionNameVar) | |
| 402 | - | if LookupActionPtr == 0 { | |
| 403 | - | return nil | |
| 404 | - | } | |
| 405 | - | ||
| 406 | - | gobject.IncreaseRef(LookupActionPtr) | |
| 407 | - | ||
| 408 | - | LookupActionCls := &gio.ActionBase{} | |
| 409 | - | LookupActionCls.Ptr = LookupActionPtr | |
| 410 | - | return LookupActionCls | |
| 403 | + | cret := gio.XGActionMapLookupAction(x.GoPointer(), ActionNameVar) | |
| 411 | 404 | ||
| 405 | + | if cret == 0 { | |
| 406 | + | return cls | |
| 407 | + | } | |
| 408 | + | gobject.IncreaseRef(cret) | |
| 409 | + | cls = &gio.ActionBase{} | |
| 410 | + | cls.Ptr = cret | |
| 411 | + | return cls | |
| 412 | 412 | } | |
| 413 | 413 | ||
| 414 | 414 | // Removes the named action from the action map. | |
M v4/adw/adw-avatar.go +38 -38
| @@ -52,16 +52,17 @@ var xNewAvatar func(int, string, bool) uintptr | |||
| 52 | 52 | ||
| 53 | 53 | // Creates a new `AdwAvatar`. | |
| 54 | 54 | func NewAvatar(SizeVar int, TextVar string, ShowInitialsVar bool) *gtk.Widget { | |
| 55 | - | NewAvatarPtr := xNewAvatar(SizeVar, TextVar, ShowInitialsVar) | |
| 56 | - | if NewAvatarPtr == 0 { | |
| 57 | - | return nil | |
| 58 | - | } | |
| 55 | + | var cls *gtk.Widget | |
| 59 | 56 | ||
| 60 | - | gobject.IncreaseRef(NewAvatarPtr) | |
| 57 | + | cret := xNewAvatar(SizeVar, TextVar, ShowInitialsVar) | |
| 61 | 58 | ||
| 62 | - | NewAvatarCls := >k.Widget{} | |
| 63 | - | NewAvatarCls.Ptr = NewAvatarPtr | |
| 64 | - | return NewAvatarCls | |
| 59 | + | if cret == 0 { | |
| 60 | + | return cls | |
| 61 | + | } | |
| 62 | + | gobject.IncreaseRef(cret) | |
| 63 | + | cls = >k.Widget{} | |
| 64 | + | cls.Ptr = cret | |
| 65 | + | return cls | |
| 65 | 66 | } | |
| 66 | 67 | ||
| 67 | 68 | var xAvatarDrawToTexture func(uintptr, int) uintptr | |
| @@ -70,34 +71,33 @@ var xAvatarDrawToTexture func(uintptr, int) uintptr | |||
| 70 | 71 | // | |
| 71 | 72 | // This can be used to export the fallback avatar. | |
| 72 | 73 | func (x *Avatar) DrawToTexture(ScaleFactorVar int) *gdk.Texture { | |
| 74 | + | var cls *gdk.Texture | |
| 73 | 75 | ||
| 74 | - | DrawToTexturePtr := xAvatarDrawToTexture(x.GoPointer(), ScaleFactorVar) | |
| 75 | - | if DrawToTexturePtr == 0 { | |
| 76 | - | return nil | |
| 77 | - | } | |
| 78 | - | ||
| 79 | - | DrawToTextureCls := &gdk.Texture{} | |
| 80 | - | DrawToTextureCls.Ptr = DrawToTexturePtr | |
| 81 | - | return DrawToTextureCls | |
| 76 | + | cret := xAvatarDrawToTexture(x.GoPointer(), ScaleFactorVar) | |
| 82 | 77 | ||
| 78 | + | if cret == 0 { | |
| 79 | + | return cls | |
| 80 | + | } | |
| 81 | + | cls = &gdk.Texture{} | |
| 82 | + | cls.Ptr = cret | |
| 83 | + | return cls | |
| 83 | 84 | } | |
| 84 | 85 | ||
| 85 | 86 | var xAvatarGetCustomImage func(uintptr) uintptr | |
| 86 | 87 | ||
| 87 | 88 | // Gets the custom image paintable. | |
| 88 | 89 | func (x *Avatar) GetCustomImage() *gdk.PaintableBase { | |
| 90 | + | var cls *gdk.PaintableBase | |
| 89 | 91 | ||
| 90 | - | GetCustomImagePtr := xAvatarGetCustomImage(x.GoPointer()) | |
| 91 | - | if GetCustomImagePtr == 0 { | |
| 92 | - | return nil | |
| 93 | - | } | |
| 94 | - | ||
| 95 | - | gobject.IncreaseRef(GetCustomImagePtr) | |
| 96 | - | ||
| 97 | - | GetCustomImageCls := &gdk.PaintableBase{} | |
| 98 | - | GetCustomImageCls.Ptr = GetCustomImagePtr | |
| 99 | - | return GetCustomImageCls | |
| 92 | + | cret := xAvatarGetCustomImage(x.GoPointer()) | |
| 100 | 93 | ||
| 94 | + | if cret == 0 { | |
| 95 | + | return cls | |
| 96 | + | } | |
| 97 | + | gobject.IncreaseRef(cret) | |
| 98 | + | cls = &gdk.PaintableBase{} | |
| 99 | + | cls.Ptr = cret | |
| 100 | + | return cls | |
| 101 | 101 | } | |
| 102 | 102 | ||
| 103 | 103 | var xAvatarGetIconName func(uintptr) string | |
| @@ -105,8 +105,8 @@ var xAvatarGetIconName func(uintptr) string | |||
| 105 | 105 | // Gets the name of an icon to use as a fallback. | |
| 106 | 106 | func (x *Avatar) GetIconName() string { | |
| 107 | 107 | ||
| 108 | - | return xAvatarGetIconName(x.GoPointer()) | |
| 109 | - | ||
| 108 | + | cret := xAvatarGetIconName(x.GoPointer()) | |
| 109 | + | return cret | |
| 110 | 110 | } | |
| 111 | 111 | ||
| 112 | 112 | var xAvatarGetShowInitials func(uintptr) bool | |
| @@ -114,8 +114,8 @@ var xAvatarGetShowInitials func(uintptr) bool | |||
| 114 | 114 | // Gets whether initials are used instead of an icon on the fallback avatar. | |
| 115 | 115 | func (x *Avatar) GetShowInitials() bool { | |
| 116 | 116 | ||
| 117 | - | return xAvatarGetShowInitials(x.GoPointer()) | |
| 118 | - | ||
| 117 | + | cret := xAvatarGetShowInitials(x.GoPointer()) | |
| 118 | + | return cret | |
| 119 | 119 | } | |
| 120 | 120 | ||
| 121 | 121 | var xAvatarGetSize func(uintptr) int | |
| @@ -123,8 +123,8 @@ var xAvatarGetSize func(uintptr) int | |||
| 123 | 123 | // Gets the size of the avatar. | |
| 124 | 124 | func (x *Avatar) GetSize() int { | |
| 125 | 125 | ||
| 126 | - | return xAvatarGetSize(x.GoPointer()) | |
| 127 | - | ||
| 126 | + | cret := xAvatarGetSize(x.GoPointer()) | |
| 127 | + | return cret | |
| 128 | 128 | } | |
| 129 | 129 | ||
| 130 | 130 | var xAvatarGetText func(uintptr) string | |
| @@ -132,8 +132,8 @@ var xAvatarGetText func(uintptr) string | |||
| 132 | 132 | // Gets the text used to generate the fallback initials and color. | |
| 133 | 133 | func (x *Avatar) GetText() string { | |
| 134 | 134 | ||
| 135 | - | return xAvatarGetText(x.GoPointer()) | |
| 136 | - | ||
| 135 | + | cret := xAvatarGetText(x.GoPointer()) | |
| 136 | + | return cret | |
| 137 | 137 | } | |
| 138 | 138 | ||
| 139 | 139 | var xAvatarSetCustomImage func(uintptr, uintptr) | |
| @@ -201,8 +201,8 @@ func (c *Avatar) SetGoPointer(ptr uintptr) { | |||
| 201 | 201 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 202 | 202 | func (x *Avatar) GetAccessibleRole() gtk.AccessibleRole { | |
| 203 | 203 | ||
| 204 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 205 | - | ||
| 204 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 205 | + | return cret | |
| 206 | 206 | } | |
| 207 | 207 | ||
| 208 | 208 | // Resets the accessible @property to its default value. | |
| @@ -337,8 +337,8 @@ func (x *Avatar) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVar u | |||
| 337 | 337 | // of the <object> tag used to construct the @buildable. | |
| 338 | 338 | func (x *Avatar) GetBuildableId() string { | |
| 339 | 339 | ||
| 340 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 341 | - | ||
| 340 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 341 | + | return cret | |
| 342 | 342 | } | |
| 343 | 343 | ||
| 344 | 344 | func init() { | |
M v4/adw/adw-banner.go +25 -24
| @@ -51,16 +51,17 @@ var xNewBanner func(string) uintptr | |||
| 51 | 51 | ||
| 52 | 52 | // Creates a new `AdwBanner`. | |
| 53 | 53 | func NewBanner(TitleVar string) *gtk.Widget { | |
| 54 | - | NewBannerPtr := xNewBanner(TitleVar) | |
| 55 | - | if NewBannerPtr == 0 { | |
| 56 | - | return nil | |
| 57 | - | } | |
| 54 | + | var cls *gtk.Widget | |
| 58 | 55 | ||
| 59 | - | gobject.IncreaseRef(NewBannerPtr) | |
| 56 | + | cret := xNewBanner(TitleVar) | |
| 60 | 57 | ||
| 61 | - | NewBannerCls := >k.Widget{} | |
| 62 | - | NewBannerCls.Ptr = NewBannerPtr | |
| 63 | - | return NewBannerCls | |
| 58 | + | if cret == 0 { | |
| 59 | + | return cls | |
| 60 | + | } | |
| 61 | + | gobject.IncreaseRef(cret) | |
| 62 | + | cls = >k.Widget{} | |
| 63 | + | cls.Ptr = cret | |
| 64 | + | return cls | |
| 64 | 65 | } | |
| 65 | 66 | ||
| 66 | 67 | var xBannerGetButtonLabel func(uintptr) string | |
| @@ -68,8 +69,8 @@ var xBannerGetButtonLabel func(uintptr) string | |||
| 68 | 69 | // Gets the button label for @self. | |
| 69 | 70 | func (x *Banner) GetButtonLabel() string { | |
| 70 | 71 | ||
| 71 | - | return xBannerGetButtonLabel(x.GoPointer()) | |
| 72 | - | ||
| 72 | + | cret := xBannerGetButtonLabel(x.GoPointer()) | |
| 73 | + | return cret | |
| 73 | 74 | } | |
| 74 | 75 | ||
| 75 | 76 | var xBannerGetRevealed func(uintptr) bool | |
| @@ -77,8 +78,8 @@ var xBannerGetRevealed func(uintptr) bool | |||
| 77 | 78 | // Gets if a banner is revealed | |
| 78 | 79 | func (x *Banner) GetRevealed() bool { | |
| 79 | 80 | ||
| 80 | - | return xBannerGetRevealed(x.GoPointer()) | |
| 81 | - | ||
| 81 | + | cret := xBannerGetRevealed(x.GoPointer()) | |
| 82 | + | return cret | |
| 82 | 83 | } | |
| 83 | 84 | ||
| 84 | 85 | var xBannerGetTitle func(uintptr) string | |
| @@ -86,8 +87,8 @@ var xBannerGetTitle func(uintptr) string | |||
| 86 | 87 | // Gets the title for @self. | |
| 87 | 88 | func (x *Banner) GetTitle() string { | |
| 88 | 89 | ||
| 89 | - | return xBannerGetTitle(x.GoPointer()) | |
| 90 | - | ||
| 90 | + | cret := xBannerGetTitle(x.GoPointer()) | |
| 91 | + | return cret | |
| 91 | 92 | } | |
| 92 | 93 | ||
| 93 | 94 | var xBannerGetUseMarkup func(uintptr) bool | |
| @@ -95,8 +96,8 @@ var xBannerGetUseMarkup func(uintptr) bool | |||
| 95 | 96 | // Gets whether to use Pango markup for the banner title. | |
| 96 | 97 | func (x *Banner) GetUseMarkup() bool { | |
| 97 | 98 | ||
| 98 | - | return xBannerGetUseMarkup(x.GoPointer()) | |
| 99 | - | ||
| 99 | + | cret := xBannerGetUseMarkup(x.GoPointer()) | |
| 100 | + | return cret | |
| 100 | 101 | } | |
| 101 | 102 | ||
| 102 | 103 | var xBannerSetButtonLabel func(uintptr, string) | |
| @@ -169,8 +170,8 @@ func (x *Banner) ConnectButtonClicked(cb func(Banner)) { | |||
| 169 | 170 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 170 | 171 | func (x *Banner) GetAccessibleRole() gtk.AccessibleRole { | |
| 171 | 172 | ||
| 172 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 173 | - | ||
| 173 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 174 | + | return cret | |
| 174 | 175 | } | |
| 175 | 176 | ||
| 176 | 177 | // Resets the accessible @property to its default value. | |
| @@ -302,15 +303,15 @@ func (x *Banner) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVar u | |||
| 302 | 303 | // Gets the action name for @actionable. | |
| 303 | 304 | func (x *Banner) GetActionName() string { | |
| 304 | 305 | ||
| 305 | - | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 306 | - | ||
| 306 | + | cret := gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 307 | + | return cret | |
| 307 | 308 | } | |
| 308 | 309 | ||
| 309 | 310 | // Gets the current target value of @actionable. | |
| 310 | 311 | func (x *Banner) GetActionTargetValue() *glib.Variant { | |
| 311 | 312 | ||
| 312 | - | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 313 | - | ||
| 313 | + | cret := gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 314 | + | return cret | |
| 314 | 315 | } | |
| 315 | 316 | ||
| 316 | 317 | // Specifies the name of the action with which this widget should be | |
| @@ -388,8 +389,8 @@ func (x *Banner) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 388 | 389 | // of the <object> tag used to construct the @buildable. | |
| 389 | 390 | func (x *Banner) GetBuildableId() string { | |
| 390 | 391 | ||
| 391 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 392 | - | ||
| 392 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 393 | + | return cret | |
| 393 | 394 | } | |
| 394 | 395 | ||
| 395 | 396 | func init() { | |
M v4/adw/adw-bin.go +22 -22
| @@ -40,34 +40,34 @@ var xNewBin func() uintptr | |||
| 40 | 40 | ||
| 41 | 41 | // Creates a new `AdwBin`. | |
| 42 | 42 | func NewBin() *gtk.Widget { | |
| 43 | - | NewBinPtr := xNewBin() | |
| 44 | - | if NewBinPtr == 0 { | |
| 45 | - | return nil | |
| 46 | - | } | |
| 43 | + | var cls *gtk.Widget | |
| 47 | 44 | ||
| 48 | - | gobject.IncreaseRef(NewBinPtr) | |
| 45 | + | cret := xNewBin() | |
| 49 | 46 | ||
| 50 | - | NewBinCls := >k.Widget{} | |
| 51 | - | NewBinCls.Ptr = NewBinPtr | |
| 52 | - | return NewBinCls | |
| 47 | + | if cret == 0 { | |
| 48 | + | return cls | |
| 49 | + | } | |
| 50 | + | gobject.IncreaseRef(cret) | |
| 51 | + | cls = >k.Widget{} | |
| 52 | + | cls.Ptr = cret | |
| 53 | + | return cls | |
| 53 | 54 | } | |
| 54 | 55 | ||
| 55 | 56 | var xBinGetChild func(uintptr) uintptr | |
| 56 | 57 | ||
| 57 | 58 | // Gets the child widget of @self. | |
| 58 | 59 | func (x *Bin) GetChild() *gtk.Widget { | |
| 60 | + | var cls *gtk.Widget | |
| 59 | 61 | ||
| 60 | - | GetChildPtr := xBinGetChild(x.GoPointer()) | |
| 61 | - | if GetChildPtr == 0 { | |
| 62 | - | return nil | |
| 63 | - | } | |
| 64 | - | ||
| 65 | - | gobject.IncreaseRef(GetChildPtr) | |
| 66 | - | ||
| 67 | - | GetChildCls := >k.Widget{} | |
| 68 | - | GetChildCls.Ptr = GetChildPtr | |
| 69 | - | return GetChildCls | |
| 62 | + | cret := xBinGetChild(x.GoPointer()) | |
| 70 | 63 | ||
| 64 | + | if cret == 0 { | |
| 65 | + | return cls | |
| 66 | + | } | |
| 67 | + | gobject.IncreaseRef(cret) | |
| 68 | + | cls = >k.Widget{} | |
| 69 | + | cls.Ptr = cret | |
| 70 | + | return cls | |
| 71 | 71 | } | |
| 72 | 72 | ||
| 73 | 73 | var xBinSetChild func(uintptr, uintptr) | |
| @@ -90,8 +90,8 @@ func (c *Bin) SetGoPointer(ptr uintptr) { | |||
| 90 | 90 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 91 | 91 | func (x *Bin) GetAccessibleRole() gtk.AccessibleRole { | |
| 92 | 92 | ||
| 93 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 94 | - | ||
| 93 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 94 | + | return cret | |
| 95 | 95 | } | |
| 96 | 96 | ||
| 97 | 97 | // Resets the accessible @property to its default value. | |
| @@ -226,8 +226,8 @@ func (x *Bin) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVar uint | |||
| 226 | 226 | // of the <object> tag used to construct the @buildable. | |
| 227 | 227 | func (x *Bin) GetBuildableId() string { | |
| 228 | 228 | ||
| 229 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 230 | - | ||
| 229 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 230 | + | return cret | |
| 231 | 231 | } | |
| 232 | 232 | ||
| 233 | 233 | func init() { | |
M v4/adw/adw-button-content.go +19 -18
| @@ -76,16 +76,17 @@ var xNewButtonContent func() uintptr | |||
| 76 | 76 | ||
| 77 | 77 | // Creates a new `AdwButtonContent`. | |
| 78 | 78 | func NewButtonContent() *gtk.Widget { | |
| 79 | - | NewButtonContentPtr := xNewButtonContent() | |
| 80 | - | if NewButtonContentPtr == 0 { | |
| 81 | - | return nil | |
| 82 | - | } | |
| 79 | + | var cls *gtk.Widget | |
| 83 | 80 | ||
| 84 | - | gobject.IncreaseRef(NewButtonContentPtr) | |
| 81 | + | cret := xNewButtonContent() | |
| 85 | 82 | ||
| 86 | - | NewButtonContentCls := >k.Widget{} | |
| 87 | - | NewButtonContentCls.Ptr = NewButtonContentPtr | |
| 88 | - | return NewButtonContentCls | |
| 83 | + | if cret == 0 { | |
| 84 | + | return cls | |
| 85 | + | } | |
| 86 | + | gobject.IncreaseRef(cret) | |
| 87 | + | cls = >k.Widget{} | |
| 88 | + | cls.Ptr = cret | |
| 89 | + | return cls | |
| 89 | 90 | } | |
| 90 | 91 | ||
| 91 | 92 | var xButtonContentGetIconName func(uintptr) string | |
| @@ -93,8 +94,8 @@ var xButtonContentGetIconName func(uintptr) string | |||
| 93 | 94 | // Gets the name of the displayed icon. | |
| 94 | 95 | func (x *ButtonContent) GetIconName() string { | |
| 95 | 96 | ||
| 96 | - | return xButtonContentGetIconName(x.GoPointer()) | |
| 97 | - | ||
| 97 | + | cret := xButtonContentGetIconName(x.GoPointer()) | |
| 98 | + | return cret | |
| 98 | 99 | } | |
| 99 | 100 | ||
| 100 | 101 | var xButtonContentGetLabel func(uintptr) string | |
| @@ -102,8 +103,8 @@ var xButtonContentGetLabel func(uintptr) string | |||
| 102 | 103 | // Gets the displayed label. | |
| 103 | 104 | func (x *ButtonContent) GetLabel() string { | |
| 104 | 105 | ||
| 105 | - | return xButtonContentGetLabel(x.GoPointer()) | |
| 106 | - | ||
| 106 | + | cret := xButtonContentGetLabel(x.GoPointer()) | |
| 107 | + | return cret | |
| 107 | 108 | } | |
| 108 | 109 | ||
| 109 | 110 | var xButtonContentGetUseUnderline func(uintptr) bool | |
| @@ -111,8 +112,8 @@ var xButtonContentGetUseUnderline func(uintptr) bool | |||
| 111 | 112 | // Gets whether an underline in the text indicates a mnemonic. | |
| 112 | 113 | func (x *ButtonContent) GetUseUnderline() bool { | |
| 113 | 114 | ||
| 114 | - | return xButtonContentGetUseUnderline(x.GoPointer()) | |
| 115 | - | ||
| 115 | + | cret := xButtonContentGetUseUnderline(x.GoPointer()) | |
| 116 | + | return cret | |
| 116 | 117 | } | |
| 117 | 118 | ||
| 118 | 119 | var xButtonContentSetIconName func(uintptr, string) | |
| @@ -159,8 +160,8 @@ func (c *ButtonContent) SetGoPointer(ptr uintptr) { | |||
| 159 | 160 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 160 | 161 | func (x *ButtonContent) GetAccessibleRole() gtk.AccessibleRole { | |
| 161 | 162 | ||
| 162 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 163 | - | ||
| 163 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 164 | + | return cret | |
| 164 | 165 | } | |
| 165 | 166 | ||
| 166 | 167 | // Resets the accessible @property to its default value. | |
| @@ -295,8 +296,8 @@ func (x *ButtonContent) UpdateStateValue(NStatesVar int, StatesVar uintptr, Valu | |||
| 295 | 296 | // of the <object> tag used to construct the @buildable. | |
| 296 | 297 | func (x *ButtonContent) GetBuildableId() string { | |
| 297 | 298 | ||
| 298 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 299 | - | ||
| 299 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 300 | + | return cret | |
| 300 | 301 | } | |
| 301 | 302 | ||
| 302 | 303 | func init() { | |
M v4/adw/adw-carousel-indicator-dots.go +24 -24
| @@ -46,34 +46,34 @@ var xNewCarouselIndicatorDots func() uintptr | |||
| 46 | 46 | ||
| 47 | 47 | // Creates a new `AdwCarouselIndicatorDots`. | |
| 48 | 48 | func NewCarouselIndicatorDots() *gtk.Widget { | |
| 49 | - | NewCarouselIndicatorDotsPtr := xNewCarouselIndicatorDots() | |
| 50 | - | if NewCarouselIndicatorDotsPtr == 0 { | |
| 51 | - | return nil | |
| 52 | - | } | |
| 49 | + | var cls *gtk.Widget | |
| 53 | 50 | ||
| 54 | - | gobject.IncreaseRef(NewCarouselIndicatorDotsPtr) | |
| 51 | + | cret := xNewCarouselIndicatorDots() | |
| 55 | 52 | ||
| 56 | - | NewCarouselIndicatorDotsCls := >k.Widget{} | |
| 57 | - | NewCarouselIndicatorDotsCls.Ptr = NewCarouselIndicatorDotsPtr | |
| 58 | - | return NewCarouselIndicatorDotsCls | |
| 53 | + | if cret == 0 { | |
| 54 | + | return cls | |
| 55 | + | } | |
| 56 | + | gobject.IncreaseRef(cret) | |
| 57 | + | cls = >k.Widget{} | |
| 58 | + | cls.Ptr = cret | |
| 59 | + | return cls | |
| 59 | 60 | } | |
| 60 | 61 | ||
| 61 | 62 | var xCarouselIndicatorDotsGetCarousel func(uintptr) uintptr | |
| 62 | 63 | ||
| 63 | 64 | // Gets the displayed carousel. | |
| 64 | 65 | func (x *CarouselIndicatorDots) GetCarousel() *Carousel { | |
| 66 | + | var cls *Carousel | |
| 65 | 67 | ||
| 66 | - | GetCarouselPtr := xCarouselIndicatorDotsGetCarousel(x.GoPointer()) | |
| 67 | - | if GetCarouselPtr == 0 { | |
| 68 | - | return nil | |
| 69 | - | } | |
| 70 | - | ||
| 71 | - | gobject.IncreaseRef(GetCarouselPtr) | |
| 72 | - | ||
| 73 | - | GetCarouselCls := &Carousel{} | |
| 74 | - | GetCarouselCls.Ptr = GetCarouselPtr | |
| 75 | - | return GetCarouselCls | |
| 68 | + | cret := xCarouselIndicatorDotsGetCarousel(x.GoPointer()) | |
| 76 | 69 | ||
| 70 | + | if cret == 0 { | |
| 71 | + | return cls | |
| 72 | + | } | |
| 73 | + | gobject.IncreaseRef(cret) | |
| 74 | + | cls = &Carousel{} | |
| 75 | + | cls.Ptr = cret | |
| 76 | + | return cls | |
| 77 | 77 | } | |
| 78 | 78 | ||
| 79 | 79 | var xCarouselIndicatorDotsSetCarousel func(uintptr, uintptr) | |
| @@ -96,8 +96,8 @@ func (c *CarouselIndicatorDots) SetGoPointer(ptr uintptr) { | |||
| 96 | 96 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 97 | 97 | func (x *CarouselIndicatorDots) GetAccessibleRole() gtk.AccessibleRole { | |
| 98 | 98 | ||
| 99 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 100 | - | ||
| 99 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 100 | + | return cret | |
| 101 | 101 | } | |
| 102 | 102 | ||
| 103 | 103 | // Resets the accessible @property to its default value. | |
| @@ -232,15 +232,15 @@ func (x *CarouselIndicatorDots) UpdateStateValue(NStatesVar int, StatesVar uintp | |||
| 232 | 232 | // of the <object> tag used to construct the @buildable. | |
| 233 | 233 | func (x *CarouselIndicatorDots) GetBuildableId() string { | |
| 234 | 234 | ||
| 235 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 236 | - | ||
| 235 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 236 | + | return cret | |
| 237 | 237 | } | |
| 238 | 238 | ||
| 239 | 239 | // Retrieves the orientation of the @orientable. | |
| 240 | 240 | func (x *CarouselIndicatorDots) GetOrientation() gtk.Orientation { | |
| 241 | 241 | ||
| 242 | - | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 243 | - | ||
| 242 | + | cret := gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 243 | + | return cret | |
| 244 | 244 | } | |
| 245 | 245 | ||
| 246 | 246 | // Sets the orientation of the @orientable. | |
M v4/adw/adw-carousel-indicator-lines.go +24 -24
| @@ -45,34 +45,34 @@ var xNewCarouselIndicatorLines func() uintptr | |||
| 45 | 45 | ||
| 46 | 46 | // Creates a new `AdwCarouselIndicatorLines`. | |
| 47 | 47 | func NewCarouselIndicatorLines() *gtk.Widget { | |
| 48 | - | NewCarouselIndicatorLinesPtr := xNewCarouselIndicatorLines() | |
| 49 | - | if NewCarouselIndicatorLinesPtr == 0 { | |
| 50 | - | return nil | |
| 51 | - | } | |
| 48 | + | var cls *gtk.Widget | |
| 52 | 49 | ||
| 53 | - | gobject.IncreaseRef(NewCarouselIndicatorLinesPtr) | |
| 50 | + | cret := xNewCarouselIndicatorLines() | |
| 54 | 51 | ||
| 55 | - | NewCarouselIndicatorLinesCls := >k.Widget{} | |
| 56 | - | NewCarouselIndicatorLinesCls.Ptr = NewCarouselIndicatorLinesPtr | |
| 57 | - | return NewCarouselIndicatorLinesCls | |
| 52 | + | if cret == 0 { | |
| 53 | + | return cls | |
| 54 | + | } | |
| 55 | + | gobject.IncreaseRef(cret) | |
| 56 | + | cls = >k.Widget{} | |
| 57 | + | cls.Ptr = cret | |
| 58 | + | return cls | |
| 58 | 59 | } | |
| 59 | 60 | ||
| 60 | 61 | var xCarouselIndicatorLinesGetCarousel func(uintptr) uintptr | |
| 61 | 62 | ||
| 62 | 63 | // Gets the displayed carousel. | |
| 63 | 64 | func (x *CarouselIndicatorLines) GetCarousel() *Carousel { | |
| 65 | + | var cls *Carousel | |
| 64 | 66 | ||
| 65 | - | GetCarouselPtr := xCarouselIndicatorLinesGetCarousel(x.GoPointer()) | |
| 66 | - | if GetCarouselPtr == 0 { | |
| 67 | - | return nil | |
| 68 | - | } | |
| 69 | - | ||
| 70 | - | gobject.IncreaseRef(GetCarouselPtr) | |
| 71 | - | ||
| 72 | - | GetCarouselCls := &Carousel{} | |
| 73 | - | GetCarouselCls.Ptr = GetCarouselPtr | |
| 74 | - | return GetCarouselCls | |
| 67 | + | cret := xCarouselIndicatorLinesGetCarousel(x.GoPointer()) | |
| 75 | 68 | ||
| 69 | + | if cret == 0 { | |
| 70 | + | return cls | |
| 71 | + | } | |
| 72 | + | gobject.IncreaseRef(cret) | |
| 73 | + | cls = &Carousel{} | |
| 74 | + | cls.Ptr = cret | |
| 75 | + | return cls | |
| 76 | 76 | } | |
| 77 | 77 | ||
| 78 | 78 | var xCarouselIndicatorLinesSetCarousel func(uintptr, uintptr) | |
| @@ -95,8 +95,8 @@ func (c *CarouselIndicatorLines) SetGoPointer(ptr uintptr) { | |||
| 95 | 95 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 96 | 96 | func (x *CarouselIndicatorLines) GetAccessibleRole() gtk.AccessibleRole { | |
| 97 | 97 | ||
| 98 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 99 | - | ||
| 98 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 99 | + | return cret | |
| 100 | 100 | } | |
| 101 | 101 | ||
| 102 | 102 | // Resets the accessible @property to its default value. | |
| @@ -231,15 +231,15 @@ func (x *CarouselIndicatorLines) UpdateStateValue(NStatesVar int, StatesVar uint | |||
| 231 | 231 | // of the <object> tag used to construct the @buildable. | |
| 232 | 232 | func (x *CarouselIndicatorLines) GetBuildableId() string { | |
| 233 | 233 | ||
| 234 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 235 | - | ||
| 234 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 235 | + | return cret | |
| 236 | 236 | } | |
| 237 | 237 | ||
| 238 | 238 | // Retrieves the orientation of the @orientable. | |
| 239 | 239 | func (x *CarouselIndicatorLines) GetOrientation() gtk.Orientation { | |
| 240 | 240 | ||
| 241 | - | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 242 | - | ||
| 241 | + | cret := gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 242 | + | return cret | |
| 243 | 243 | } | |
| 244 | 244 | ||
| 245 | 245 | // Sets the orientation of the @orientable. | |
M v4/adw/adw-carousel.go +50 -50
| @@ -45,16 +45,17 @@ var xNewCarousel func() uintptr | |||
| 45 | 45 | ||
| 46 | 46 | // Creates a new `AdwCarousel`. | |
| 47 | 47 | func NewCarousel() *gtk.Widget { | |
| 48 | - | NewCarouselPtr := xNewCarousel() | |
| 49 | - | if NewCarouselPtr == 0 { | |
| 50 | - | return nil | |
| 51 | - | } | |
| 48 | + | var cls *gtk.Widget | |
| 52 | 49 | ||
| 53 | - | gobject.IncreaseRef(NewCarouselPtr) | |
| 50 | + | cret := xNewCarousel() | |
| 54 | 51 | ||
| 55 | - | NewCarouselCls := >k.Widget{} | |
| 56 | - | NewCarouselCls.Ptr = NewCarouselPtr | |
| 57 | - | return NewCarouselCls | |
| 52 | + | if cret == 0 { | |
| 53 | + | return cls | |
| 54 | + | } | |
| 55 | + | gobject.IncreaseRef(cret) | |
| 56 | + | cls = >k.Widget{} | |
| 57 | + | cls.Ptr = cret | |
| 58 | + | return cls | |
| 58 | 59 | } | |
| 59 | 60 | ||
| 60 | 61 | var xCarouselAppend func(uintptr, uintptr) | |
| @@ -71,8 +72,8 @@ var xCarouselGetAllowLongSwipes func(uintptr) bool | |||
| 71 | 72 | // Gets whether to allow swiping for more than one page at a time. | |
| 72 | 73 | func (x *Carousel) GetAllowLongSwipes() bool { | |
| 73 | 74 | ||
| 74 | - | return xCarouselGetAllowLongSwipes(x.GoPointer()) | |
| 75 | - | ||
| 75 | + | cret := xCarouselGetAllowLongSwipes(x.GoPointer()) | |
| 76 | + | return cret | |
| 76 | 77 | } | |
| 77 | 78 | ||
| 78 | 79 | var xCarouselGetAllowMouseDrag func(uintptr) bool | |
| @@ -80,8 +81,8 @@ var xCarouselGetAllowMouseDrag func(uintptr) bool | |||
| 80 | 81 | // Sets whether @self can be dragged with mouse pointer. | |
| 81 | 82 | func (x *Carousel) GetAllowMouseDrag() bool { | |
| 82 | 83 | ||
| 83 | - | return xCarouselGetAllowMouseDrag(x.GoPointer()) | |
| 84 | - | ||
| 84 | + | cret := xCarouselGetAllowMouseDrag(x.GoPointer()) | |
| 85 | + | return cret | |
| 85 | 86 | } | |
| 86 | 87 | ||
| 87 | 88 | var xCarouselGetAllowScrollWheel func(uintptr) bool | |
| @@ -89,8 +90,8 @@ var xCarouselGetAllowScrollWheel func(uintptr) bool | |||
| 89 | 90 | // Gets whether @self will respond to scroll wheel events. | |
| 90 | 91 | func (x *Carousel) GetAllowScrollWheel() bool { | |
| 91 | 92 | ||
| 92 | - | return xCarouselGetAllowScrollWheel(x.GoPointer()) | |
| 93 | - | ||
| 93 | + | cret := xCarouselGetAllowScrollWheel(x.GoPointer()) | |
| 94 | + | return cret | |
| 94 | 95 | } | |
| 95 | 96 | ||
| 96 | 97 | var xCarouselGetInteractive func(uintptr) bool | |
| @@ -98,8 +99,8 @@ var xCarouselGetInteractive func(uintptr) bool | |||
| 98 | 99 | // Gets whether @self can be navigated. | |
| 99 | 100 | func (x *Carousel) GetInteractive() bool { | |
| 100 | 101 | ||
| 101 | - | return xCarouselGetInteractive(x.GoPointer()) | |
| 102 | - | ||
| 102 | + | cret := xCarouselGetInteractive(x.GoPointer()) | |
| 103 | + | return cret | |
| 103 | 104 | } | |
| 104 | 105 | ||
| 105 | 106 | var xCarouselGetNPages func(uintptr) uint | |
| @@ -107,26 +108,25 @@ var xCarouselGetNPages func(uintptr) uint | |||
| 107 | 108 | // Gets the number of pages in @self. | |
| 108 | 109 | func (x *Carousel) GetNPages() uint { | |
| 109 | 110 | ||
| 110 | - | return xCarouselGetNPages(x.GoPointer()) | |
| 111 | - | ||
| 111 | + | cret := xCarouselGetNPages(x.GoPointer()) | |
| 112 | + | return cret | |
| 112 | 113 | } | |
| 113 | 114 | ||
| 114 | 115 | var xCarouselGetNthPage func(uintptr, uint) uintptr | |
| 115 | 116 | ||
| 116 | 117 | // Gets the page at position @n. | |
| 117 | 118 | func (x *Carousel) GetNthPage(NVar uint) *gtk.Widget { | |
| 119 | + | var cls *gtk.Widget | |
| 118 | 120 | ||
| 119 | - | GetNthPagePtr := xCarouselGetNthPage(x.GoPointer(), NVar) | |
| 120 | - | if GetNthPagePtr == 0 { | |
| 121 | - | return nil | |
| 122 | - | } | |
| 123 | - | ||
| 124 | - | gobject.IncreaseRef(GetNthPagePtr) | |
| 125 | - | ||
| 126 | - | GetNthPageCls := >k.Widget{} | |
| 127 | - | GetNthPageCls.Ptr = GetNthPagePtr | |
| 128 | - | return GetNthPageCls | |
| 121 | + | cret := xCarouselGetNthPage(x.GoPointer(), NVar) | |
| 129 | 122 | ||
| 123 | + | if cret == 0 { | |
| 124 | + | return cls | |
| 125 | + | } | |
| 126 | + | gobject.IncreaseRef(cret) | |
| 127 | + | cls = >k.Widget{} | |
| 128 | + | cls.Ptr = cret | |
| 129 | + | return cls | |
| 130 | 130 | } | |
| 131 | 131 | ||
| 132 | 132 | var xCarouselGetPosition func(uintptr) float64 | |
| @@ -136,8 +136,8 @@ var xCarouselGetPosition func(uintptr) float64 | |||
| 136 | 136 | // 1 matches 1 page. Use [method@Carousel.scroll_to] for changing it. | |
| 137 | 137 | func (x *Carousel) GetPosition() float64 { | |
| 138 | 138 | ||
| 139 | - | return xCarouselGetPosition(x.GoPointer()) | |
| 140 | - | ||
| 139 | + | cret := xCarouselGetPosition(x.GoPointer()) | |
| 140 | + | return cret | |
| 141 | 141 | } | |
| 142 | 142 | ||
| 143 | 143 | var xCarouselGetRevealDuration func(uintptr) uint | |
| @@ -145,8 +145,8 @@ var xCarouselGetRevealDuration func(uintptr) uint | |||
| 145 | 145 | // Gets the page reveal duration, in milliseconds. | |
| 146 | 146 | func (x *Carousel) GetRevealDuration() uint { | |
| 147 | 147 | ||
| 148 | - | return xCarouselGetRevealDuration(x.GoPointer()) | |
| 149 | - | ||
| 148 | + | cret := xCarouselGetRevealDuration(x.GoPointer()) | |
| 149 | + | return cret | |
| 150 | 150 | } | |
| 151 | 151 | ||
| 152 | 152 | var xCarouselGetScrollParams func(uintptr) *SpringParams | |
| @@ -154,8 +154,8 @@ var xCarouselGetScrollParams func(uintptr) *SpringParams | |||
| 154 | 154 | // Gets the scroll animation spring parameters for @self. | |
| 155 | 155 | func (x *Carousel) GetScrollParams() *SpringParams { | |
| 156 | 156 | ||
| 157 | - | return xCarouselGetScrollParams(x.GoPointer()) | |
| 158 | - | ||
| 157 | + | cret := xCarouselGetScrollParams(x.GoPointer()) | |
| 158 | + | return cret | |
| 159 | 159 | } | |
| 160 | 160 | ||
| 161 | 161 | var xCarouselGetSpacing func(uintptr) uint | |
| @@ -163,8 +163,8 @@ var xCarouselGetSpacing func(uintptr) uint | |||
| 163 | 163 | // Gets spacing between pages in pixels. | |
| 164 | 164 | func (x *Carousel) GetSpacing() uint { | |
| 165 | 165 | ||
| 166 | - | return xCarouselGetSpacing(x.GoPointer()) | |
| 167 | - | ||
| 166 | + | cret := xCarouselGetSpacing(x.GoPointer()) | |
| 167 | + | return cret | |
| 168 | 168 | } | |
| 169 | 169 | ||
| 170 | 170 | var xCarouselInsert func(uintptr, uintptr, int) | |
| @@ -328,8 +328,8 @@ func (x *Carousel) ConnectPageChanged(cb func(Carousel, uint)) { | |||
| 328 | 328 | // Gets the progress @self will snap back to after the gesture is canceled. | |
| 329 | 329 | func (x *Carousel) GetCancelProgress() float64 { | |
| 330 | 330 | ||
| 331 | - | return XAdwSwipeableGetCancelProgress(x.GoPointer()) | |
| 332 | - | ||
| 331 | + | cret := XAdwSwipeableGetCancelProgress(x.GoPointer()) | |
| 332 | + | return cret | |
| 333 | 333 | } | |
| 334 | 334 | ||
| 335 | 335 | // Gets the swipe distance of @self. | |
| @@ -337,15 +337,15 @@ func (x *Carousel) GetCancelProgress() float64 { | |||
| 337 | 337 | // This corresponds to how many pixels 1 unit represents. | |
| 338 | 338 | func (x *Carousel) GetDistance() float64 { | |
| 339 | 339 | ||
| 340 | - | return XAdwSwipeableGetDistance(x.GoPointer()) | |
| 341 | - | ||
| 340 | + | cret := XAdwSwipeableGetDistance(x.GoPointer()) | |
| 341 | + | return cret | |
| 342 | 342 | } | |
| 343 | 343 | ||
| 344 | 344 | // Gets the current progress of @self. | |
| 345 | 345 | func (x *Carousel) GetProgress() float64 { | |
| 346 | 346 | ||
| 347 | - | return XAdwSwipeableGetProgress(x.GoPointer()) | |
| 348 | - | ||
| 347 | + | cret := XAdwSwipeableGetProgress(x.GoPointer()) | |
| 348 | + | return cret | |
| 349 | 349 | } | |
| 350 | 350 | ||
| 351 | 351 | // Gets the snap points of @self. | |
| @@ -354,8 +354,8 @@ func (x *Carousel) GetProgress() float64 { | |||
| 354 | 354 | // end the swipe on. | |
| 355 | 355 | func (x *Carousel) GetSnapPoints(NSnapPointsVar int) uintptr { | |
| 356 | 356 | ||
| 357 | - | return XAdwSwipeableGetSnapPoints(x.GoPointer(), NSnapPointsVar) | |
| 358 | - | ||
| 357 | + | cret := XAdwSwipeableGetSnapPoints(x.GoPointer(), NSnapPointsVar) | |
| 358 | + | return cret | |
| 359 | 359 | } | |
| 360 | 360 | ||
| 361 | 361 | // Gets the area @self can start a swipe from for the given direction and | |
| @@ -376,8 +376,8 @@ func (x *Carousel) GetSwipeArea(NavigationDirectionVar NavigationDirection, IsDr | |||
| 376 | 376 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 377 | 377 | func (x *Carousel) GetAccessibleRole() gtk.AccessibleRole { | |
| 378 | 378 | ||
| 379 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 380 | - | ||
| 379 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 380 | + | return cret | |
| 381 | 381 | } | |
| 382 | 382 | ||
| 383 | 383 | // Resets the accessible @property to its default value. | |
| @@ -512,15 +512,15 @@ func (x *Carousel) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVar | |||
| 512 | 512 | // of the <object> tag used to construct the @buildable. | |
| 513 | 513 | func (x *Carousel) GetBuildableId() string { | |
| 514 | 514 | ||
| 515 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 516 | - | ||
| 515 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 516 | + | return cret | |
| 517 | 517 | } | |
| 518 | 518 | ||
| 519 | 519 | // Retrieves the orientation of the @orientable. | |
| 520 | 520 | func (x *Carousel) GetOrientation() gtk.Orientation { | |
| 521 | 521 | ||
| 522 | - | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 523 | - | ||
| 522 | + | cret := gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 523 | + | return cret | |
| 524 | 524 | } | |
| 525 | 525 | ||
| 526 | 526 | // Sets the orientation of the @orientable. | |
M v4/adw/adw-clamp-layout.go +15 -13
| @@ -51,14 +51,16 @@ var xNewClampLayout func() uintptr | |||
| 51 | 51 | ||
| 52 | 52 | // Creates a new `AdwClampLayout`. | |
| 53 | 53 | func NewClampLayout() *gtk.LayoutManager { | |
| 54 | - | NewClampLayoutPtr := xNewClampLayout() | |
| 55 | - | if NewClampLayoutPtr == 0 { | |
| 56 | - | return nil | |
| 57 | - | } | |
| 54 | + | var cls *gtk.LayoutManager | |
| 55 | + | ||
| 56 | + | cret := xNewClampLayout() | |
| 58 | 57 | ||
| 59 | - | NewClampLayoutCls := >k.LayoutManager{} | |
| 60 | - | NewClampLayoutCls.Ptr = NewClampLayoutPtr | |
| 61 | - | return NewClampLayoutCls | |
| 58 | + | if cret == 0 { | |
| 59 | + | return cls | |
| 60 | + | } | |
| 61 | + | cls = >k.LayoutManager{} | |
| 62 | + | cls.Ptr = cret | |
| 63 | + | return cls | |
| 62 | 64 | } | |
| 63 | 65 | ||
| 64 | 66 | var xClampLayoutGetMaximumSize func(uintptr) int | |
| @@ -66,8 +68,8 @@ var xClampLayoutGetMaximumSize func(uintptr) int | |||
| 66 | 68 | // Gets the maximum size allocated to the children. | |
| 67 | 69 | func (x *ClampLayout) GetMaximumSize() int { | |
| 68 | 70 | ||
| 69 | - | return xClampLayoutGetMaximumSize(x.GoPointer()) | |
| 70 | - | ||
| 71 | + | cret := xClampLayoutGetMaximumSize(x.GoPointer()) | |
| 72 | + | return cret | |
| 71 | 73 | } | |
| 72 | 74 | ||
| 73 | 75 | var xClampLayoutGetTighteningThreshold func(uintptr) int | |
| @@ -75,8 +77,8 @@ var xClampLayoutGetTighteningThreshold func(uintptr) int | |||
| 75 | 77 | // Gets the size above which the children are clamped. | |
| 76 | 78 | func (x *ClampLayout) GetTighteningThreshold() int { | |
| 77 | 79 | ||
| 78 | - | return xClampLayoutGetTighteningThreshold(x.GoPointer()) | |
| 79 | - | ||
| 80 | + | cret := xClampLayoutGetTighteningThreshold(x.GoPointer()) | |
| 81 | + | return cret | |
| 80 | 82 | } | |
| 81 | 83 | ||
| 82 | 84 | var xClampLayoutSetMaximumSize func(uintptr, int) | |
| @@ -123,8 +125,8 @@ func (c *ClampLayout) SetGoPointer(ptr uintptr) { | |||
| 123 | 125 | // Retrieves the orientation of the @orientable. | |
| 124 | 126 | func (x *ClampLayout) GetOrientation() gtk.Orientation { | |
| 125 | 127 | ||
| 126 | - | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 127 | - | ||
| 128 | + | cret := gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 129 | + | return cret | |
| 128 | 130 | } | |
| 129 | 131 | ||
| 130 | 132 | // Sets the orientation of the @orientable. | |
M v4/adw/adw-clamp-scrollable.go +52 -54
| @@ -33,34 +33,34 @@ var xNewClampScrollable func() uintptr | |||
| 33 | 33 | ||
| 34 | 34 | // Creates a new `AdwClampScrollable`. | |
| 35 | 35 | func NewClampScrollable() *gtk.Widget { | |
| 36 | - | NewClampScrollablePtr := xNewClampScrollable() | |
| 37 | - | if NewClampScrollablePtr == 0 { | |
| 38 | - | return nil | |
| 39 | - | } | |
| 36 | + | var cls *gtk.Widget | |
| 40 | 37 | ||
| 41 | - | gobject.IncreaseRef(NewClampScrollablePtr) | |
| 38 | + | cret := xNewClampScrollable() | |
| 42 | 39 | ||
| 43 | - | NewClampScrollableCls := >k.Widget{} | |
| 44 | - | NewClampScrollableCls.Ptr = NewClampScrollablePtr | |
| 45 | - | return NewClampScrollableCls | |
| 40 | + | if cret == 0 { | |
| 41 | + | return cls | |
| 42 | + | } | |
| 43 | + | gobject.IncreaseRef(cret) | |
| 44 | + | cls = >k.Widget{} | |
| 45 | + | cls.Ptr = cret | |
| 46 | + | return cls | |
| 46 | 47 | } | |
| 47 | 48 | ||
| 48 | 49 | var xClampScrollableGetChild func(uintptr) uintptr | |
| 49 | 50 | ||
| 50 | 51 | // Gets the child widget of @self. | |
| 51 | 52 | func (x *ClampScrollable) GetChild() *gtk.Widget { | |
| 53 | + | var cls *gtk.Widget | |
| 52 | 54 | ||
| 53 | - | GetChildPtr := xClampScrollableGetChild(x.GoPointer()) | |
| 54 | - | if GetChildPtr == 0 { | |
| 55 | - | return nil | |
| 56 | - | } | |
| 57 | - | ||
| 58 | - | gobject.IncreaseRef(GetChildPtr) | |
| 59 | - | ||
| 60 | - | GetChildCls := >k.Widget{} | |
| 61 | - | GetChildCls.Ptr = GetChildPtr | |
| 62 | - | return GetChildCls | |
| 55 | + | cret := xClampScrollableGetChild(x.GoPointer()) | |
| 63 | 56 | ||
| 57 | + | if cret == 0 { | |
| 58 | + | return cls | |
| 59 | + | } | |
| 60 | + | gobject.IncreaseRef(cret) | |
| 61 | + | cls = >k.Widget{} | |
| 62 | + | cls.Ptr = cret | |
| 63 | + | return cls | |
| 64 | 64 | } | |
| 65 | 65 | ||
| 66 | 66 | var xClampScrollableGetMaximumSize func(uintptr) int | |
| @@ -68,8 +68,8 @@ var xClampScrollableGetMaximumSize func(uintptr) int | |||
| 68 | 68 | // Gets the maximum size allocated to the child. | |
| 69 | 69 | func (x *ClampScrollable) GetMaximumSize() int { | |
| 70 | 70 | ||
| 71 | - | return xClampScrollableGetMaximumSize(x.GoPointer()) | |
| 72 | - | ||
| 71 | + | cret := xClampScrollableGetMaximumSize(x.GoPointer()) | |
| 72 | + | return cret | |
| 73 | 73 | } | |
| 74 | 74 | ||
| 75 | 75 | var xClampScrollableGetTighteningThreshold func(uintptr) int | |
| @@ -77,8 +77,8 @@ var xClampScrollableGetTighteningThreshold func(uintptr) int | |||
| 77 | 77 | // Gets the size above which the child is clamped. | |
| 78 | 78 | func (x *ClampScrollable) GetTighteningThreshold() int { | |
| 79 | 79 | ||
| 80 | - | return xClampScrollableGetTighteningThreshold(x.GoPointer()) | |
| 81 | - | ||
| 80 | + | cret := xClampScrollableGetTighteningThreshold(x.GoPointer()) | |
| 81 | + | return cret | |
| 82 | 82 | } | |
| 83 | 83 | ||
| 84 | 84 | var xClampScrollableSetChild func(uintptr, uintptr) | |
| @@ -134,8 +134,8 @@ func (c *ClampScrollable) SetGoPointer(ptr uintptr) { | |||
| 134 | 134 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 135 | 135 | func (x *ClampScrollable) GetAccessibleRole() gtk.AccessibleRole { | |
| 136 | 136 | ||
| 137 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 138 | - | ||
| 137 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 138 | + | return cret | |
| 139 | 139 | } | |
| 140 | 140 | ||
| 141 | 141 | // Resets the accessible @property to its default value. | |
| @@ -270,15 +270,15 @@ func (x *ClampScrollable) UpdateStateValue(NStatesVar int, StatesVar uintptr, Va | |||
| 270 | 270 | // of the <object> tag used to construct the @buildable. | |
| 271 | 271 | func (x *ClampScrollable) GetBuildableId() string { | |
| 272 | 272 | ||
| 273 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 274 | - | ||
| 273 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 274 | + | return cret | |
| 275 | 275 | } | |
| 276 | 276 | ||
| 277 | 277 | // Retrieves the orientation of the @orientable. | |
| 278 | 278 | func (x *ClampScrollable) GetOrientation() gtk.Orientation { | |
| 279 | 279 | ||
| 280 | - | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 281 | - | ||
| 280 | + | cret := gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 281 | + | return cret | |
| 282 | 282 | } | |
| 283 | 283 | ||
| 284 | 284 | // Sets the orientation of the @orientable. | |
| @@ -296,54 +296,52 @@ func (x *ClampScrollable) SetOrientation(OrientationVar gtk.Orientation) { | |||
| 296 | 296 | // overshoot indication, at the right position. | |
| 297 | 297 | func (x *ClampScrollable) GetBorder(BorderVar *gtk.Border) bool { | |
| 298 | 298 | ||
| 299 | - | return gtk.XGtkScrollableGetBorder(x.GoPointer(), BorderVar) | |
| 300 | - | ||
| 299 | + | cret := gtk.XGtkScrollableGetBorder(x.GoPointer(), BorderVar) | |
| 300 | + | return cret | |
| 301 | 301 | } | |
| 302 | 302 | ||
| 303 | 303 | // Retrieves the `GtkAdjustment` used for horizontal scrolling. | |
| 304 | 304 | func (x *ClampScrollable) GetHadjustment() *gtk.Adjustment { | |
| 305 | + | var cls *gtk.Adjustment | |
| 305 | 306 | ||
| 306 | - | GetHadjustmentPtr := gtk.XGtkScrollableGetHadjustment(x.GoPointer()) | |
| 307 | - | if GetHadjustmentPtr == 0 { | |
| 308 | - | return nil | |
| 309 | - | } | |
| 310 | - | ||
| 311 | - | gobject.IncreaseRef(GetHadjustmentPtr) | |
| 312 | - | ||
| 313 | - | GetHadjustmentCls := >k.Adjustment{} | |
| 314 | - | GetHadjustmentCls.Ptr = GetHadjustmentPtr | |
| 315 | - | return GetHadjustmentCls | |
| 307 | + | cret := gtk.XGtkScrollableGetHadjustment(x.GoPointer()) | |
| 316 | 308 | ||
| 309 | + | if cret == 0 { | |
| 310 | + | return cls | |
| 311 | + | } | |
| 312 | + | gobject.IncreaseRef(cret) | |
| 313 | + | cls = >k.Adjustment{} | |
| 314 | + | cls.Ptr = cret | |
| 315 | + | return cls | |
| 317 | 316 | } | |
| 318 | 317 | ||
| 319 | 318 | // Gets the horizontal `GtkScrollablePolicy`. | |
| 320 | 319 | func (x *ClampScrollable) GetHscrollPolicy() gtk.ScrollablePolicy { | |
| 321 | 320 | ||
| 322 | - | return gtk.XGtkScrollableGetHscrollPolicy(x.GoPointer()) | |
| 323 | - | ||
| 321 | + | cret := gtk.XGtkScrollableGetHscrollPolicy(x.GoPointer()) | |
| 322 | + | return cret | |
| 324 | 323 | } | |
| 325 | 324 | ||
| 326 | 325 | // Retrieves the `GtkAdjustment` used for vertical scrolling. | |
| 327 | 326 | func (x *ClampScrollable) GetVadjustment() *gtk.Adjustment { | |
| 327 | + | var cls *gtk.Adjustment | |
| 328 | 328 | ||
| 329 | - | GetVadjustmentPtr := gtk.XGtkScrollableGetVadjustment(x.GoPointer()) | |
| 330 | - | if GetVadjustmentPtr == 0 { | |
| 331 | - | return nil | |
| 332 | - | } | |
| 333 | - | ||
| 334 | - | gobject.IncreaseRef(GetVadjustmentPtr) | |
| 335 | - | ||
| 336 | - | GetVadjustmentCls := >k.Adjustment{} | |
| 337 | - | GetVadjustmentCls.Ptr = GetVadjustmentPtr | |
| 338 | - | return GetVadjustmentCls | |
| 329 | + | cret := gtk.XGtkScrollableGetVadjustment(x.GoPointer()) | |
| 339 | 330 | ||
| 331 | + | if cret == 0 { | |
| 332 | + | return cls | |
| 333 | + | } | |
| 334 | + | gobject.IncreaseRef(cret) | |
| 335 | + | cls = >k.Adjustment{} | |
| 336 | + | cls.Ptr = cret | |
| 337 | + | return cls | |
| 340 | 338 | } | |
| 341 | 339 | ||
| 342 | 340 | // Gets the vertical `GtkScrollablePolicy`. | |
| 343 | 341 | func (x *ClampScrollable) GetVscrollPolicy() gtk.ScrollablePolicy { | |
| 344 | 342 | ||
| 345 | - | return gtk.XGtkScrollableGetVscrollPolicy(x.GoPointer()) | |
| 346 | - | ||
| 343 | + | cret := gtk.XGtkScrollableGetVscrollPolicy(x.GoPointer()) | |
| 344 | + | return cret | |
| 347 | 345 | } | |
| 348 | 346 | ||
| 349 | 347 | // Sets the horizontal adjustment of the `GtkScrollable`. | |
M v4/adw/adw-clamp.go +28 -28
| @@ -56,34 +56,34 @@ var xNewClamp func() uintptr | |||
| 56 | 56 | ||
| 57 | 57 | // Creates a new `AdwClamp`. | |
| 58 | 58 | func NewClamp() *gtk.Widget { | |
| 59 | - | NewClampPtr := xNewClamp() | |
| 60 | - | if NewClampPtr == 0 { | |
| 61 | - | return nil | |
| 62 | - | } | |
| 59 | + | var cls *gtk.Widget | |
| 63 | 60 | ||
| 64 | - | gobject.IncreaseRef(NewClampPtr) | |
| 61 | + | cret := xNewClamp() | |
| 65 | 62 | ||
| 66 | - | NewClampCls := >k.Widget{} | |
| 67 | - | NewClampCls.Ptr = NewClampPtr | |
| 68 | - | return NewClampCls | |
| 63 | + | if cret == 0 { | |
| 64 | + | return cls | |
| 65 | + | } | |
| 66 | + | gobject.IncreaseRef(cret) | |
| 67 | + | cls = >k.Widget{} | |
| 68 | + | cls.Ptr = cret | |
| 69 | + | return cls | |
| 69 | 70 | } | |
| 70 | 71 | ||
| 71 | 72 | var xClampGetChild func(uintptr) uintptr | |
| 72 | 73 | ||
| 73 | 74 | // Gets the child widget of @self. | |
| 74 | 75 | func (x *Clamp) GetChild() *gtk.Widget { | |
| 76 | + | var cls *gtk.Widget | |
| 75 | 77 | ||
| 76 | - | GetChildPtr := xClampGetChild(x.GoPointer()) | |
| 77 | - | if GetChildPtr == 0 { | |
| 78 | - | return nil | |
| 79 | - | } | |
| 80 | - | ||
| 81 | - | gobject.IncreaseRef(GetChildPtr) | |
| 82 | - | ||
| 83 | - | GetChildCls := >k.Widget{} | |
| 84 | - | GetChildCls.Ptr = GetChildPtr | |
| 85 | - | return GetChildCls | |
| 78 | + | cret := xClampGetChild(x.GoPointer()) | |
| 86 | 79 | ||
| 80 | + | if cret == 0 { | |
| 81 | + | return cls | |
| 82 | + | } | |
| 83 | + | gobject.IncreaseRef(cret) | |
| 84 | + | cls = >k.Widget{} | |
| 85 | + | cls.Ptr = cret | |
| 86 | + | return cls | |
| 87 | 87 | } | |
| 88 | 88 | ||
| 89 | 89 | var xClampGetMaximumSize func(uintptr) int | |
| @@ -91,8 +91,8 @@ var xClampGetMaximumSize func(uintptr) int | |||
| 91 | 91 | // Gets the maximum size allocated to the child. | |
| 92 | 92 | func (x *Clamp) GetMaximumSize() int { | |
| 93 | 93 | ||
| 94 | - | return xClampGetMaximumSize(x.GoPointer()) | |
| 95 | - | ||
| 94 | + | cret := xClampGetMaximumSize(x.GoPointer()) | |
| 95 | + | return cret | |
| 96 | 96 | } | |
| 97 | 97 | ||
| 98 | 98 | var xClampGetTighteningThreshold func(uintptr) int | |
| @@ -100,8 +100,8 @@ var xClampGetTighteningThreshold func(uintptr) int | |||
| 100 | 100 | // Gets the size above which the child is clamped. | |
| 101 | 101 | func (x *Clamp) GetTighteningThreshold() int { | |
| 102 | 102 | ||
| 103 | - | return xClampGetTighteningThreshold(x.GoPointer()) | |
| 104 | - | ||
| 103 | + | cret := xClampGetTighteningThreshold(x.GoPointer()) | |
| 104 | + | return cret | |
| 105 | 105 | } | |
| 106 | 106 | ||
| 107 | 107 | var xClampSetChild func(uintptr, uintptr) | |
| @@ -157,8 +157,8 @@ func (c *Clamp) SetGoPointer(ptr uintptr) { | |||
| 157 | 157 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 158 | 158 | func (x *Clamp) GetAccessibleRole() gtk.AccessibleRole { | |
| 159 | 159 | ||
| 160 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 161 | - | ||
| 160 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 161 | + | return cret | |
| 162 | 162 | } | |
| 163 | 163 | ||
| 164 | 164 | // Resets the accessible @property to its default value. | |
| @@ -293,15 +293,15 @@ func (x *Clamp) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVar ui | |||
| 293 | 293 | // of the <object> tag used to construct the @buildable. | |
| 294 | 294 | func (x *Clamp) GetBuildableId() string { | |
| 295 | 295 | ||
| 296 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 297 | - | ||
| 296 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 297 | + | return cret | |
| 298 | 298 | } | |
| 299 | 299 | ||
| 300 | 300 | // Retrieves the orientation of the @orientable. | |
| 301 | 301 | func (x *Clamp) GetOrientation() gtk.Orientation { | |
| 302 | 302 | ||
| 303 | - | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 304 | - | ||
| 303 | + | cret := gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 304 | + | return cret | |
| 305 | 305 | } | |
| 306 | 306 | ||
| 307 | 307 | // Sets the orientation of the @orientable. | |
M v4/adw/adw-combo-row.go +66 -70
| @@ -81,88 +81,85 @@ var xNewComboRow func() uintptr | |||
| 81 | 81 | ||
| 82 | 82 | // Creates a new `AdwComboRow`. | |
| 83 | 83 | func NewComboRow() *gtk.Widget { | |
| 84 | - | NewComboRowPtr := xNewComboRow() | |
| 85 | - | if NewComboRowPtr == 0 { | |
| 86 | - | return nil | |
| 87 | - | } | |
| 84 | + | var cls *gtk.Widget | |
| 88 | 85 | ||
| 89 | - | gobject.IncreaseRef(NewComboRowPtr) | |
| 86 | + | cret := xNewComboRow() | |
| 90 | 87 | ||
| 91 | - | NewComboRowCls := >k.Widget{} | |
| 92 | - | NewComboRowCls.Ptr = NewComboRowPtr | |
| 93 | - | return NewComboRowCls | |
| 88 | + | if cret == 0 { | |
| 89 | + | return cls | |
| 90 | + | } | |
| 91 | + | gobject.IncreaseRef(cret) | |
| 92 | + | cls = >k.Widget{} | |
| 93 | + | cls.Ptr = cret | |
| 94 | + | return cls | |
| 94 | 95 | } | |
| 95 | 96 | ||
| 96 | 97 | var xComboRowGetExpression func(uintptr) uintptr | |
| 97 | 98 | ||
| 98 | 99 | // Gets the expression used to obtain strings from items. | |
| 99 | 100 | func (x *ComboRow) GetExpression() *gtk.Expression { | |
| 101 | + | var cls *gtk.Expression | |
| 100 | 102 | ||
| 101 | - | GetExpressionPtr := xComboRowGetExpression(x.GoPointer()) | |
| 102 | - | if GetExpressionPtr == 0 { | |
| 103 | - | return nil | |
| 104 | - | } | |
| 105 | - | ||
| 106 | - | gobject.IncreaseRef(GetExpressionPtr) | |
| 107 | - | ||
| 108 | - | GetExpressionCls := >k.Expression{} | |
| 109 | - | GetExpressionCls.Ptr = GetExpressionPtr | |
| 110 | - | return GetExpressionCls | |
| 103 | + | cret := xComboRowGetExpression(x.GoPointer()) | |
| 111 | 104 | ||
| 105 | + | if cret == 0 { | |
| 106 | + | return cls | |
| 107 | + | } | |
| 108 | + | gobject.IncreaseRef(cret) | |
| 109 | + | cls = >k.Expression{} | |
| 110 | + | cls.Ptr = cret | |
| 111 | + | return cls | |
| 112 | 112 | } | |
| 113 | 113 | ||
| 114 | 114 | var xComboRowGetFactory func(uintptr) uintptr | |
| 115 | 115 | ||
| 116 | 116 | // Gets the factory for populating list items. | |
| 117 | 117 | func (x *ComboRow) GetFactory() *gtk.ListItemFactory { | |
| 118 | + | var cls *gtk.ListItemFactory | |
| 118 | 119 | ||
| 119 | - | GetFactoryPtr := xComboRowGetFactory(x.GoPointer()) | |
| 120 | - | if GetFactoryPtr == 0 { | |
| 121 | - | return nil | |
| 122 | - | } | |
| 123 | - | ||
| 124 | - | gobject.IncreaseRef(GetFactoryPtr) | |
| 125 | - | ||
| 126 | - | GetFactoryCls := >k.ListItemFactory{} | |
| 127 | - | GetFactoryCls.Ptr = GetFactoryPtr | |
| 128 | - | return GetFactoryCls | |
| 120 | + | cret := xComboRowGetFactory(x.GoPointer()) | |
| 129 | 121 | ||
| 122 | + | if cret == 0 { | |
| 123 | + | return cls | |
| 124 | + | } | |
| 125 | + | gobject.IncreaseRef(cret) | |
| 126 | + | cls = >k.ListItemFactory{} | |
| 127 | + | cls.Ptr = cret | |
| 128 | + | return cls | |
| 130 | 129 | } | |
| 131 | 130 | ||
| 132 | 131 | var xComboRowGetListFactory func(uintptr) uintptr | |
| 133 | 132 | ||
| 134 | 133 | // Gets the factory for populating list items in the popup. | |
| 135 | 134 | func (x *ComboRow) GetListFactory() *gtk.ListItemFactory { | |
| 135 | + | var cls *gtk.ListItemFactory | |
| 136 | 136 | ||
| 137 | - | GetListFactoryPtr := xComboRowGetListFactory(x.GoPointer()) | |
| 138 | - | if GetListFactoryPtr == 0 { | |
| 139 | - | return nil | |
| 140 | - | } | |
| 141 | - | ||
| 142 | - | gobject.IncreaseRef(GetListFactoryPtr) | |
| 143 | - | ||
| 144 | - | GetListFactoryCls := >k.ListItemFactory{} | |
| 145 | - | GetListFactoryCls.Ptr = GetListFactoryPtr | |
| 146 | - | return GetListFactoryCls | |
| 137 | + | cret := xComboRowGetListFactory(x.GoPointer()) | |
| 147 | 138 | ||
| 139 | + | if cret == 0 { | |
| 140 | + | return cls | |
| 141 | + | } | |
| 142 | + | gobject.IncreaseRef(cret) | |
| 143 | + | cls = >k.ListItemFactory{} | |
| 144 | + | cls.Ptr = cret | |
| 145 | + | return cls | |
| 148 | 146 | } | |
| 149 | 147 | ||
| 150 | 148 | var xComboRowGetModel func(uintptr) uintptr | |
| 151 | 149 | ||
| 152 | 150 | // Gets the model that provides the displayed items. | |
| 153 | 151 | func (x *ComboRow) GetModel() *gio.ListModelBase { | |
| 152 | + | var cls *gio.ListModelBase | |
| 154 | 153 | ||
| 155 | - | GetModelPtr := xComboRowGetModel(x.GoPointer()) | |
| 156 | - | if GetModelPtr == 0 { | |
| 157 | - | return nil | |
| 158 | - | } | |
| 159 | - | ||
| 160 | - | gobject.IncreaseRef(GetModelPtr) | |
| 161 | - | ||
| 162 | - | GetModelCls := &gio.ListModelBase{} | |
| 163 | - | GetModelCls.Ptr = GetModelPtr | |
| 164 | - | return GetModelCls | |
| 154 | + | cret := xComboRowGetModel(x.GoPointer()) | |
| 165 | 155 | ||
| 156 | + | if cret == 0 { | |
| 157 | + | return cls | |
| 158 | + | } | |
| 159 | + | gobject.IncreaseRef(cret) | |
| 160 | + | cls = &gio.ListModelBase{} | |
| 161 | + | cls.Ptr = cret | |
| 162 | + | return cls | |
| 166 | 163 | } | |
| 167 | 164 | ||
| 168 | 165 | var xComboRowGetSelected func(uintptr) uint | |
| @@ -170,26 +167,25 @@ var xComboRowGetSelected func(uintptr) uint | |||
| 170 | 167 | // Gets the position of the selected item. | |
| 171 | 168 | func (x *ComboRow) GetSelected() uint { | |
| 172 | 169 | ||
| 173 | - | return xComboRowGetSelected(x.GoPointer()) | |
| 174 | - | ||
| 170 | + | cret := xComboRowGetSelected(x.GoPointer()) | |
| 171 | + | return cret | |
| 175 | 172 | } | |
| 176 | 173 | ||
| 177 | 174 | var xComboRowGetSelectedItem func(uintptr) uintptr | |
| 178 | 175 | ||
| 179 | 176 | // Gets the selected item. | |
| 180 | 177 | func (x *ComboRow) GetSelectedItem() *gobject.Object { | |
| 178 | + | var cls *gobject.Object | |
| 181 | 179 | ||
| 182 | - | GetSelectedItemPtr := xComboRowGetSelectedItem(x.GoPointer()) | |
| 183 | - | if GetSelectedItemPtr == 0 { | |
| 184 | - | return nil | |
| 185 | - | } | |
| 186 | - | ||
| 187 | - | gobject.IncreaseRef(GetSelectedItemPtr) | |
| 188 | - | ||
| 189 | - | GetSelectedItemCls := &gobject.Object{} | |
| 190 | - | GetSelectedItemCls.Ptr = GetSelectedItemPtr | |
| 191 | - | return GetSelectedItemCls | |
| 180 | + | cret := xComboRowGetSelectedItem(x.GoPointer()) | |
| 192 | 181 | ||
| 182 | + | if cret == 0 { | |
| 183 | + | return cls | |
| 184 | + | } | |
| 185 | + | gobject.IncreaseRef(cret) | |
| 186 | + | cls = &gobject.Object{} | |
| 187 | + | cls.Ptr = cret | |
| 188 | + | return cls | |
| 193 | 189 | } | |
| 194 | 190 | ||
| 195 | 191 | var xComboRowGetUseSubtitle func(uintptr) bool | |
| @@ -197,8 +193,8 @@ var xComboRowGetUseSubtitle func(uintptr) bool | |||
| 197 | 193 | // Gets whether to use the current value as the subtitle. | |
| 198 | 194 | func (x *ComboRow) GetUseSubtitle() bool { | |
| 199 | 195 | ||
| 200 | - | return xComboRowGetUseSubtitle(x.GoPointer()) | |
| 201 | - | ||
| 196 | + | cret := xComboRowGetUseSubtitle(x.GoPointer()) | |
| 197 | + | return cret | |
| 202 | 198 | } | |
| 203 | 199 | ||
| 204 | 200 | var xComboRowSetExpression func(uintptr, uintptr) | |
| @@ -285,8 +281,8 @@ func (c *ComboRow) SetGoPointer(ptr uintptr) { | |||
| 285 | 281 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 286 | 282 | func (x *ComboRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 287 | 283 | ||
| 288 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 289 | - | ||
| 284 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 285 | + | return cret | |
| 290 | 286 | } | |
| 291 | 287 | ||
| 292 | 288 | // Resets the accessible @property to its default value. | |
| @@ -418,15 +414,15 @@ func (x *ComboRow) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVar | |||
| 418 | 414 | // Gets the action name for @actionable. | |
| 419 | 415 | func (x *ComboRow) GetActionName() string { | |
| 420 | 416 | ||
| 421 | - | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 422 | - | ||
| 417 | + | cret := gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 418 | + | return cret | |
| 423 | 419 | } | |
| 424 | 420 | ||
| 425 | 421 | // Gets the current target value of @actionable. | |
| 426 | 422 | func (x *ComboRow) GetActionTargetValue() *glib.Variant { | |
| 427 | 423 | ||
| 428 | - | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 429 | - | ||
| 424 | + | cret := gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 425 | + | return cret | |
| 430 | 426 | } | |
| 431 | 427 | ||
| 432 | 428 | // Specifies the name of the action with which this widget should be | |
| @@ -504,8 +500,8 @@ func (x *ComboRow) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 504 | 500 | // of the <object> tag used to construct the @buildable. | |
| 505 | 501 | func (x *ComboRow) GetBuildableId() string { | |
| 506 | 502 | ||
| 507 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 508 | - | ||
| 503 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 504 | + | return cret | |
| 509 | 505 | } | |
| 510 | 506 | ||
| 511 | 507 | func init() { | |
M v4/adw/adw-easing.go +2 -2
| @@ -100,8 +100,8 @@ var xEasingEase func(Easing, float64) float64 | |||
| 100 | 100 | // @value should generally be in the [0, 1] range. | |
| 101 | 101 | func EasingEase(SelfVar Easing, ValueVar float64) float64 { | |
| 102 | 102 | ||
| 103 | - | return xEasingEase(SelfVar, ValueVar) | |
| 104 | - | ||
| 103 | + | cret := xEasingEase(SelfVar, ValueVar) | |
| 104 | + | return cret | |
| 105 | 105 | } | |
| 106 | 106 | ||
| 107 | 107 | func init() { | |
M v4/adw/adw-entry-row.go +58 -58
| @@ -64,16 +64,17 @@ var xNewEntryRow func() uintptr | |||
| 64 | 64 | ||
| 65 | 65 | // Creates a new `AdwEntryRow`. | |
| 66 | 66 | func NewEntryRow() *gtk.Widget { | |
| 67 | - | NewEntryRowPtr := xNewEntryRow() | |
| 68 | - | if NewEntryRowPtr == 0 { | |
| 69 | - | return nil | |
| 70 | - | } | |
| 67 | + | var cls *gtk.Widget | |
| 71 | 68 | ||
| 72 | - | gobject.IncreaseRef(NewEntryRowPtr) | |
| 69 | + | cret := xNewEntryRow() | |
| 73 | 70 | ||
| 74 | - | NewEntryRowCls := >k.Widget{} | |
| 75 | - | NewEntryRowCls.Ptr = NewEntryRowPtr | |
| 76 | - | return NewEntryRowCls | |
| 71 | + | if cret == 0 { | |
| 72 | + | return cls | |
| 73 | + | } | |
| 74 | + | gobject.IncreaseRef(cret) | |
| 75 | + | cls = >k.Widget{} | |
| 76 | + | cls.Ptr = cret | |
| 77 | + | return cls | |
| 77 | 78 | } | |
| 78 | 79 | ||
| 79 | 80 | var xEntryRowAddPrefix func(uintptr, uintptr) | |
| @@ -99,8 +100,8 @@ var xEntryRowGetActivatesDefault func(uintptr) bool | |||
| 99 | 100 | // Gets whether activating the embedded entry can activate the default widget. | |
| 100 | 101 | func (x *EntryRow) GetActivatesDefault() bool { | |
| 101 | 102 | ||
| 102 | - | return xEntryRowGetActivatesDefault(x.GoPointer()) | |
| 103 | - | ||
| 103 | + | cret := xEntryRowGetActivatesDefault(x.GoPointer()) | |
| 104 | + | return cret | |
| 104 | 105 | } | |
| 105 | 106 | ||
| 106 | 107 | var xEntryRowGetAttributes func(uintptr) *pango.AttrList | |
| @@ -108,8 +109,8 @@ var xEntryRowGetAttributes func(uintptr) *pango.AttrList | |||
| 108 | 109 | // Gets Pango attributes applied to the text of the embedded entry. | |
| 109 | 110 | func (x *EntryRow) GetAttributes() *pango.AttrList { | |
| 110 | 111 | ||
| 111 | - | return xEntryRowGetAttributes(x.GoPointer()) | |
| 112 | - | ||
| 112 | + | cret := xEntryRowGetAttributes(x.GoPointer()) | |
| 113 | + | return cret | |
| 113 | 114 | } | |
| 114 | 115 | ||
| 115 | 116 | var xEntryRowGetEnableEmojiCompletion func(uintptr) bool | |
| @@ -117,8 +118,8 @@ var xEntryRowGetEnableEmojiCompletion func(uintptr) bool | |||
| 117 | 118 | // Gets whether to suggest emoji replacements on @self. | |
| 118 | 119 | func (x *EntryRow) GetEnableEmojiCompletion() bool { | |
| 119 | 120 | ||
| 120 | - | return xEntryRowGetEnableEmojiCompletion(x.GoPointer()) | |
| 121 | - | ||
| 121 | + | cret := xEntryRowGetEnableEmojiCompletion(x.GoPointer()) | |
| 122 | + | return cret | |
| 122 | 123 | } | |
| 123 | 124 | ||
| 124 | 125 | var xEntryRowGetInputHints func(uintptr) gtk.InputHints | |
| @@ -126,8 +127,8 @@ var xEntryRowGetInputHints func(uintptr) gtk.InputHints | |||
| 126 | 127 | // Gets the additional input hints of @self. | |
| 127 | 128 | func (x *EntryRow) GetInputHints() gtk.InputHints { | |
| 128 | 129 | ||
| 129 | - | return xEntryRowGetInputHints(x.GoPointer()) | |
| 130 | - | ||
| 130 | + | cret := xEntryRowGetInputHints(x.GoPointer()) | |
| 131 | + | return cret | |
| 131 | 132 | } | |
| 132 | 133 | ||
| 133 | 134 | var xEntryRowGetInputPurpose func(uintptr) gtk.InputPurpose | |
| @@ -135,8 +136,8 @@ var xEntryRowGetInputPurpose func(uintptr) gtk.InputPurpose | |||
| 135 | 136 | // Gets the input purpose of @self. | |
| 136 | 137 | func (x *EntryRow) GetInputPurpose() gtk.InputPurpose { | |
| 137 | 138 | ||
| 138 | - | return xEntryRowGetInputPurpose(x.GoPointer()) | |
| 139 | - | ||
| 139 | + | cret := xEntryRowGetInputPurpose(x.GoPointer()) | |
| 140 | + | return cret | |
| 140 | 141 | } | |
| 141 | 142 | ||
| 142 | 143 | var xEntryRowGetShowApplyButton func(uintptr) bool | |
| @@ -144,8 +145,8 @@ var xEntryRowGetShowApplyButton func(uintptr) bool | |||
| 144 | 145 | // Gets whether @self can show the apply button. | |
| 145 | 146 | func (x *EntryRow) GetShowApplyButton() bool { | |
| 146 | 147 | ||
| 147 | - | return xEntryRowGetShowApplyButton(x.GoPointer()) | |
| 148 | - | ||
| 148 | + | cret := xEntryRowGetShowApplyButton(x.GoPointer()) | |
| 149 | + | return cret | |
| 149 | 150 | } | |
| 150 | 151 | ||
| 151 | 152 | var xEntryRowGrabFocusWithoutSelecting func(uintptr) bool | |
| @@ -155,8 +156,8 @@ var xEntryRowGrabFocusWithoutSelecting func(uintptr) bool | |||
| 155 | 156 | // See [method@Gtk.Text.grab_focus_without_selecting] for more information. | |
| 156 | 157 | func (x *EntryRow) GrabFocusWithoutSelecting() bool { | |
| 157 | 158 | ||
| 158 | - | return xEntryRowGrabFocusWithoutSelecting(x.GoPointer()) | |
| 159 | - | ||
| 159 | + | cret := xEntryRowGrabFocusWithoutSelecting(x.GoPointer()) | |
| 160 | + | return cret | |
| 160 | 161 | } | |
| 161 | 162 | ||
| 162 | 163 | var xEntryRowRemove func(uintptr, uintptr) | |
| @@ -278,8 +279,8 @@ func (x *EntryRow) ConnectEntryActivated(cb func(EntryRow)) { | |||
| 278 | 279 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 279 | 280 | func (x *EntryRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 280 | 281 | ||
| 281 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 282 | - | ||
| 282 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 283 | + | return cret | |
| 283 | 284 | } | |
| 284 | 285 | ||
| 285 | 286 | // Resets the accessible @property to its default value. | |
| @@ -411,15 +412,15 @@ func (x *EntryRow) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVar | |||
| 411 | 412 | // Gets the action name for @actionable. | |
| 412 | 413 | func (x *EntryRow) GetActionName() string { | |
| 413 | 414 | ||
| 414 | - | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 415 | - | ||
| 415 | + | cret := gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 416 | + | return cret | |
| 416 | 417 | } | |
| 417 | 418 | ||
| 418 | 419 | // Gets the current target value of @actionable. | |
| 419 | 420 | func (x *EntryRow) GetActionTargetValue() *glib.Variant { | |
| 420 | 421 | ||
| 421 | - | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 422 | - | ||
| 422 | + | cret := gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 423 | + | return cret | |
| 423 | 424 | } | |
| 424 | 425 | ||
| 425 | 426 | // Specifies the name of the action with which this widget should be | |
| @@ -497,8 +498,8 @@ func (x *EntryRow) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 497 | 498 | // of the <object> tag used to construct the @buildable. | |
| 498 | 499 | func (x *EntryRow) GetBuildableId() string { | |
| 499 | 500 | ||
| 500 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 501 | - | ||
| 501 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 502 | + | return cret | |
| 502 | 503 | } | |
| 503 | 504 | ||
| 504 | 505 | // Deletes the currently selected text of the editable. | |
| @@ -537,8 +538,8 @@ func (x *EntryRow) FinishDelegate() { | |||
| 537 | 538 | // Gets the alignment of the editable. | |
| 538 | 539 | func (x *EntryRow) GetAlignment() float32 { | |
| 539 | 540 | ||
| 540 | - | return gtk.XGtkEditableGetAlignment(x.GoPointer()) | |
| 541 | - | ||
| 541 | + | cret := gtk.XGtkEditableGetAlignment(x.GoPointer()) | |
| 542 | + | return cret | |
| 542 | 543 | } | |
| 543 | 544 | ||
| 544 | 545 | // Retrieves a sequence of characters. | |
| @@ -551,8 +552,8 @@ func (x *EntryRow) GetAlignment() float32 { | |||
| 551 | 552 | // Note that positions are specified in characters, not bytes. | |
| 552 | 553 | func (x *EntryRow) GetChars(StartPosVar int, EndPosVar int) string { | |
| 553 | 554 | ||
| 554 | - | return gtk.XGtkEditableGetChars(x.GoPointer(), StartPosVar, EndPosVar) | |
| 555 | - | ||
| 555 | + | cret := gtk.XGtkEditableGetChars(x.GoPointer(), StartPosVar, EndPosVar) | |
| 556 | + | return cret | |
| 556 | 557 | } | |
| 557 | 558 | ||
| 558 | 559 | // Gets the `GtkEditable` that @editable is delegating its | |
| @@ -560,39 +561,38 @@ func (x *EntryRow) GetChars(StartPosVar int, EndPosVar int) string { | |||
| 560 | 561 | // | |
| 561 | 562 | // Typically, the delegate is a [class@Gtk.Text] widget. | |
| 562 | 563 | func (x *EntryRow) GetDelegate() *gtk.EditableBase { | |
| 564 | + | var cls *gtk.EditableBase | |
| 563 | 565 | ||
| 564 | - | GetDelegatePtr := gtk.XGtkEditableGetDelegate(x.GoPointer()) | |
| 565 | - | if GetDelegatePtr == 0 { | |
| 566 | - | return nil | |
| 567 | - | } | |
| 568 | - | ||
| 569 | - | gobject.IncreaseRef(GetDelegatePtr) | |
| 570 | - | ||
| 571 | - | GetDelegateCls := >k.EditableBase{} | |
| 572 | - | GetDelegateCls.Ptr = GetDelegatePtr | |
| 573 | - | return GetDelegateCls | |
| 566 | + | cret := gtk.XGtkEditableGetDelegate(x.GoPointer()) | |
| 574 | 567 | ||
| 568 | + | if cret == 0 { | |
| 569 | + | return cls | |
| 570 | + | } | |
| 571 | + | gobject.IncreaseRef(cret) | |
| 572 | + | cls = >k.EditableBase{} | |
| 573 | + | cls.Ptr = cret | |
| 574 | + | return cls | |
| 575 | 575 | } | |
| 576 | 576 | ||
| 577 | 577 | // Retrieves whether @editable is editable. | |
| 578 | 578 | func (x *EntryRow) GetEditable() bool { | |
| 579 | 579 | ||
| 580 | - | return gtk.XGtkEditableGetEditable(x.GoPointer()) | |
| 581 | - | ||
| 580 | + | cret := gtk.XGtkEditableGetEditable(x.GoPointer()) | |
| 581 | + | return cret | |
| 582 | 582 | } | |
| 583 | 583 | ||
| 584 | 584 | // Gets if undo/redo actions are enabled for @editable | |
| 585 | 585 | func (x *EntryRow) GetEnableUndo() bool { | |
| 586 | 586 | ||
| 587 | - | return gtk.XGtkEditableGetEnableUndo(x.GoPointer()) | |
| 588 | - | ||
| 587 | + | cret := gtk.XGtkEditableGetEnableUndo(x.GoPointer()) | |
| 588 | + | return cret | |
| 589 | 589 | } | |
| 590 | 590 | ||
| 591 | 591 | // Retrieves the desired maximum width of @editable, in characters. | |
| 592 | 592 | func (x *EntryRow) GetMaxWidthChars() int { | |
| 593 | 593 | ||
| 594 | - | return gtk.XGtkEditableGetMaxWidthChars(x.GoPointer()) | |
| 595 | - | ||
| 594 | + | cret := gtk.XGtkEditableGetMaxWidthChars(x.GoPointer()) | |
| 595 | + | return cret | |
| 596 | 596 | } | |
| 597 | 597 | ||
| 598 | 598 | // Retrieves the current position of the cursor relative | |
| @@ -601,8 +601,8 @@ func (x *EntryRow) GetMaxWidthChars() int { | |||
| 601 | 601 | // Note that this position is in characters, not in bytes. | |
| 602 | 602 | func (x *EntryRow) GetPosition() int { | |
| 603 | 603 | ||
| 604 | - | return gtk.XGtkEditableGetPosition(x.GoPointer()) | |
| 605 | - | ||
| 604 | + | cret := gtk.XGtkEditableGetPosition(x.GoPointer()) | |
| 605 | + | return cret | |
| 606 | 606 | } | |
| 607 | 607 | ||
| 608 | 608 | // Retrieves the selection bound of the editable. | |
| @@ -614,8 +614,8 @@ func (x *EntryRow) GetPosition() int { | |||
| 614 | 614 | // Note that positions are specified in characters, not bytes. | |
| 615 | 615 | func (x *EntryRow) GetSelectionBounds(StartPosVar int, EndPosVar int) bool { | |
| 616 | 616 | ||
| 617 | - | return gtk.XGtkEditableGetSelectionBounds(x.GoPointer(), StartPosVar, EndPosVar) | |
| 618 | - | ||
| 617 | + | cret := gtk.XGtkEditableGetSelectionBounds(x.GoPointer(), StartPosVar, EndPosVar) | |
| 618 | + | return cret | |
| 619 | 619 | } | |
| 620 | 620 | ||
| 621 | 621 | // Retrieves the contents of @editable. | |
| @@ -623,16 +623,16 @@ func (x *EntryRow) GetSelectionBounds(StartPosVar int, EndPosVar int) bool { | |||
| 623 | 623 | // The returned string is owned by GTK and must not be modified or freed. | |
| 624 | 624 | func (x *EntryRow) GetText() string { | |
| 625 | 625 | ||
| 626 | - | return gtk.XGtkEditableGetText(x.GoPointer()) | |
| 627 | - | ||
| 626 | + | cret := gtk.XGtkEditableGetText(x.GoPointer()) | |
| 627 | + | return cret | |
| 628 | 628 | } | |
| 629 | 629 | ||
| 630 | 630 | // Gets the number of characters of space reserved | |
| 631 | 631 | // for the contents of the editable. | |
| 632 | 632 | func (x *EntryRow) GetWidthChars() int { | |
| 633 | 633 | ||
| 634 | - | return gtk.XGtkEditableGetWidthChars(x.GoPointer()) | |
| 635 | - | ||
| 634 | + | cret := gtk.XGtkEditableGetWidthChars(x.GoPointer()) | |
| 635 | + | return cret | |
| 636 | 636 | } | |
| 637 | 637 | ||
| 638 | 638 | // Sets up a delegate for `GtkEditable`. | |
M v4/adw/adw-enum-list-model.go +33 -31
| @@ -32,8 +32,8 @@ var xEnumListItemGetName func(uintptr) string | |||
| 32 | 32 | // Gets the enum value name. | |
| 33 | 33 | func (x *EnumListItem) GetName() string { | |
| 34 | 34 | ||
| 35 | - | return xEnumListItemGetName(x.GoPointer()) | |
| 36 | - | ||
| 35 | + | cret := xEnumListItemGetName(x.GoPointer()) | |
| 36 | + | return cret | |
| 37 | 37 | } | |
| 38 | 38 | ||
| 39 | 39 | var xEnumListItemGetNick func(uintptr) string | |
| @@ -41,8 +41,8 @@ var xEnumListItemGetNick func(uintptr) string | |||
| 41 | 41 | // Gets the enum value nick. | |
| 42 | 42 | func (x *EnumListItem) GetNick() string { | |
| 43 | 43 | ||
| 44 | - | return xEnumListItemGetNick(x.GoPointer()) | |
| 45 | - | ||
| 44 | + | cret := xEnumListItemGetNick(x.GoPointer()) | |
| 45 | + | return cret | |
| 46 | 46 | } | |
| 47 | 47 | ||
| 48 | 48 | var xEnumListItemGetValue func(uintptr) int | |
| @@ -50,8 +50,8 @@ var xEnumListItemGetValue func(uintptr) int | |||
| 50 | 50 | // Gets the enum value. | |
| 51 | 51 | func (x *EnumListItem) GetValue() int { | |
| 52 | 52 | ||
| 53 | - | return xEnumListItemGetValue(x.GoPointer()) | |
| 54 | - | ||
| 53 | + | cret := xEnumListItemGetValue(x.GoPointer()) | |
| 54 | + | return cret | |
| 55 | 55 | } | |
| 56 | 56 | ||
| 57 | 57 | func (c *EnumListItem) GoPointer() uintptr { | |
| @@ -79,14 +79,16 @@ var xNewEnumListModel func([]interface{}) uintptr | |||
| 79 | 79 | ||
| 80 | 80 | // Creates a new `AdwEnumListModel` for @enum_type. | |
| 81 | 81 | func NewEnumListModel(EnumTypeVar []interface{}) *EnumListModel { | |
| 82 | - | NewEnumListModelPtr := xNewEnumListModel(EnumTypeVar) | |
| 83 | - | if NewEnumListModelPtr == 0 { | |
| 84 | - | return nil | |
| 85 | - | } | |
| 82 | + | var cls *EnumListModel | |
| 86 | 83 | ||
| 87 | - | NewEnumListModelCls := &EnumListModel{} | |
| 88 | - | NewEnumListModelCls.Ptr = NewEnumListModelPtr | |
| 89 | - | return NewEnumListModelCls | |
| 84 | + | cret := xNewEnumListModel(EnumTypeVar) | |
| 85 | + | ||
| 86 | + | if cret == 0 { | |
| 87 | + | return cls | |
| 88 | + | } | |
| 89 | + | cls = &EnumListModel{} | |
| 90 | + | cls.Ptr = cret | |
| 91 | + | return cls | |
| 90 | 92 | } | |
| 91 | 93 | ||
| 92 | 94 | var xEnumListModelFindPosition func(uintptr, int) uint | |
| @@ -94,8 +96,8 @@ var xEnumListModelFindPosition func(uintptr, int) uint | |||
| 94 | 96 | // Finds the position of a given enum value in @self. | |
| 95 | 97 | func (x *EnumListModel) FindPosition(ValueVar int) uint { | |
| 96 | 98 | ||
| 97 | - | return xEnumListModelFindPosition(x.GoPointer(), ValueVar) | |
| 98 | - | ||
| 99 | + | cret := xEnumListModelFindPosition(x.GoPointer(), ValueVar) | |
| 100 | + | return cret | |
| 99 | 101 | } | |
| 100 | 102 | ||
| 101 | 103 | var xEnumListModelGetEnumType func(uintptr) []interface{} | |
| @@ -103,8 +105,8 @@ var xEnumListModelGetEnumType func(uintptr) []interface{} | |||
| 103 | 105 | // Gets the type of the enum represented by @self. | |
| 104 | 106 | func (x *EnumListModel) GetEnumType() []interface{} { | |
| 105 | 107 | ||
| 106 | - | return xEnumListModelGetEnumType(x.GoPointer()) | |
| 107 | - | ||
| 108 | + | cret := xEnumListModelGetEnumType(x.GoPointer()) | |
| 109 | + | return cret | |
| 108 | 110 | } | |
| 109 | 111 | ||
| 110 | 112 | func (c *EnumListModel) GoPointer() uintptr { | |
| @@ -126,8 +128,8 @@ func (c *EnumListModel) SetGoPointer(ptr uintptr) { | |||
| 126 | 128 | // See also: g_list_model_get_n_items() | |
| 127 | 129 | func (x *EnumListModel) GetItem(PositionVar uint) uintptr { | |
| 128 | 130 | ||
| 129 | - | return gio.XGListModelGetItem(x.GoPointer(), PositionVar) | |
| 130 | - | ||
| 131 | + | cret := gio.XGListModelGetItem(x.GoPointer(), PositionVar) | |
| 132 | + | return cret | |
| 131 | 133 | } | |
| 132 | 134 | ||
| 133 | 135 | // Gets the type of the items in @list. | |
| @@ -140,8 +142,8 @@ func (x *EnumListModel) GetItem(PositionVar uint) uintptr { | |||
| 140 | 142 | // model. | |
| 141 | 143 | func (x *EnumListModel) GetItemType() []interface{} { | |
| 142 | 144 | ||
| 143 | - | return gio.XGListModelGetItemType(x.GoPointer()) | |
| 144 | - | ||
| 145 | + | cret := gio.XGListModelGetItemType(x.GoPointer()) | |
| 146 | + | return cret | |
| 145 | 147 | } | |
| 146 | 148 | ||
| 147 | 149 | // Gets the number of items in @list. | |
| @@ -151,8 +153,8 @@ func (x *EnumListModel) GetItemType() []interface{} { | |||
| 151 | 153 | // @position until g_list_model_get_item() returns %NULL. | |
| 152 | 154 | func (x *EnumListModel) GetNItems() uint { | |
| 153 | 155 | ||
| 154 | - | return gio.XGListModelGetNItems(x.GoPointer()) | |
| 155 | - | ||
| 156 | + | cret := gio.XGListModelGetNItems(x.GoPointer()) | |
| 157 | + | return cret | |
| 156 | 158 | } | |
| 157 | 159 | ||
| 158 | 160 | // Get the item at @position. | |
| @@ -168,16 +170,16 @@ func (x *EnumListModel) GetNItems() uint { | |||
| 168 | 170 | // | |
| 169 | 171 | // See also: g_list_model_get_n_items() | |
| 170 | 172 | func (x *EnumListModel) GetObject(PositionVar uint) *gobject.Object { | |
| 173 | + | var cls *gobject.Object | |
| 171 | 174 | ||
| 172 | - | GetObjectPtr := gio.XGListModelGetObject(x.GoPointer(), PositionVar) | |
| 173 | - | if GetObjectPtr == 0 { | |
| 174 | - | return nil | |
| 175 | - | } | |
| 176 | - | ||
| 177 | - | GetObjectCls := &gobject.Object{} | |
| 178 | - | GetObjectCls.Ptr = GetObjectPtr | |
| 179 | - | return GetObjectCls | |
| 175 | + | cret := gio.XGListModelGetObject(x.GoPointer(), PositionVar) | |
| 180 | 176 | ||
| 177 | + | if cret == 0 { | |
| 178 | + | return cls | |
| 179 | + | } | |
| 180 | + | cls = &gobject.Object{} | |
| 181 | + | cls.Ptr = cret | |
| 182 | + | return cls | |
| 181 | 183 | } | |
| 182 | 184 | ||
| 183 | 185 | // Emits the #GListModel::items-changed signal on @list. | |
M v4/adw/adw-expander-row.go +31 -30
| @@ -59,16 +59,17 @@ var xNewExpanderRow func() uintptr | |||
| 59 | 59 | ||
| 60 | 60 | // Creates a new `AdwExpanderRow`. | |
| 61 | 61 | func NewExpanderRow() *gtk.Widget { | |
| 62 | - | NewExpanderRowPtr := xNewExpanderRow() | |
| 63 | - | if NewExpanderRowPtr == 0 { | |
| 64 | - | return nil | |
| 65 | - | } | |
| 62 | + | var cls *gtk.Widget | |
| 66 | 63 | ||
| 67 | - | gobject.IncreaseRef(NewExpanderRowPtr) | |
| 64 | + | cret := xNewExpanderRow() | |
| 68 | 65 | ||
| 69 | - | NewExpanderRowCls := >k.Widget{} | |
| 70 | - | NewExpanderRowCls.Ptr = NewExpanderRowPtr | |
| 71 | - | return NewExpanderRowCls | |
| 66 | + | if cret == 0 { | |
| 67 | + | return cls | |
| 68 | + | } | |
| 69 | + | gobject.IncreaseRef(cret) | |
| 70 | + | cls = >k.Widget{} | |
| 71 | + | cls.Ptr = cret | |
| 72 | + | return cls | |
| 72 | 73 | } | |
| 73 | 74 | ||
| 74 | 75 | var xExpanderRowAddAction func(uintptr, uintptr) | |
| @@ -105,8 +106,8 @@ var xExpanderRowGetEnableExpansion func(uintptr) bool | |||
| 105 | 106 | // Gets whether the expansion of @self is enabled. | |
| 106 | 107 | func (x *ExpanderRow) GetEnableExpansion() bool { | |
| 107 | 108 | ||
| 108 | - | return xExpanderRowGetEnableExpansion(x.GoPointer()) | |
| 109 | - | ||
| 109 | + | cret := xExpanderRowGetEnableExpansion(x.GoPointer()) | |
| 110 | + | return cret | |
| 110 | 111 | } | |
| 111 | 112 | ||
| 112 | 113 | var xExpanderRowGetExpanded func(uintptr) bool | |
| @@ -114,8 +115,8 @@ var xExpanderRowGetExpanded func(uintptr) bool | |||
| 114 | 115 | // Gets whether @self is expanded. | |
| 115 | 116 | func (x *ExpanderRow) GetExpanded() bool { | |
| 116 | 117 | ||
| 117 | - | return xExpanderRowGetExpanded(x.GoPointer()) | |
| 118 | - | ||
| 118 | + | cret := xExpanderRowGetExpanded(x.GoPointer()) | |
| 119 | + | return cret | |
| 119 | 120 | } | |
| 120 | 121 | ||
| 121 | 122 | var xExpanderRowGetIconName func(uintptr) string | |
| @@ -123,8 +124,8 @@ var xExpanderRowGetIconName func(uintptr) string | |||
| 123 | 124 | // Gets the icon name for @self. | |
| 124 | 125 | func (x *ExpanderRow) GetIconName() string { | |
| 125 | 126 | ||
| 126 | - | return xExpanderRowGetIconName(x.GoPointer()) | |
| 127 | - | ||
| 127 | + | cret := xExpanderRowGetIconName(x.GoPointer()) | |
| 128 | + | return cret | |
| 128 | 129 | } | |
| 129 | 130 | ||
| 130 | 131 | var xExpanderRowGetShowEnableSwitch func(uintptr) bool | |
| @@ -132,8 +133,8 @@ var xExpanderRowGetShowEnableSwitch func(uintptr) bool | |||
| 132 | 133 | // Gets whether the switch enabling the expansion of @self is visible. | |
| 133 | 134 | func (x *ExpanderRow) GetShowEnableSwitch() bool { | |
| 134 | 135 | ||
| 135 | - | return xExpanderRowGetShowEnableSwitch(x.GoPointer()) | |
| 136 | - | ||
| 136 | + | cret := xExpanderRowGetShowEnableSwitch(x.GoPointer()) | |
| 137 | + | return cret | |
| 137 | 138 | } | |
| 138 | 139 | ||
| 139 | 140 | var xExpanderRowGetSubtitle func(uintptr) string | |
| @@ -141,8 +142,8 @@ var xExpanderRowGetSubtitle func(uintptr) string | |||
| 141 | 142 | // Gets the subtitle for @self. | |
| 142 | 143 | func (x *ExpanderRow) GetSubtitle() string { | |
| 143 | 144 | ||
| 144 | - | return xExpanderRowGetSubtitle(x.GoPointer()) | |
| 145 | - | ||
| 145 | + | cret := xExpanderRowGetSubtitle(x.GoPointer()) | |
| 146 | + | return cret | |
| 146 | 147 | } | |
| 147 | 148 | ||
| 148 | 149 | var xExpanderRowGetSubtitleLines func(uintptr) bool | |
| @@ -151,8 +152,8 @@ var xExpanderRowGetSubtitleLines func(uintptr) bool | |||
| 151 | 152 | // ellipsized. | |
| 152 | 153 | func (x *ExpanderRow) GetSubtitleLines() bool { | |
| 153 | 154 | ||
| 154 | - | return xExpanderRowGetSubtitleLines(x.GoPointer()) | |
| 155 | - | ||
| 155 | + | cret := xExpanderRowGetSubtitleLines(x.GoPointer()) | |
| 156 | + | return cret | |
| 156 | 157 | } | |
| 157 | 158 | ||
| 158 | 159 | var xExpanderRowGetTitleLines func(uintptr) bool | |
| @@ -161,8 +162,8 @@ var xExpanderRowGetTitleLines func(uintptr) bool | |||
| 161 | 162 | // ellipsized. | |
| 162 | 163 | func (x *ExpanderRow) GetTitleLines() bool { | |
| 163 | 164 | ||
| 164 | - | return xExpanderRowGetTitleLines(x.GoPointer()) | |
| 165 | - | ||
| 165 | + | cret := xExpanderRowGetTitleLines(x.GoPointer()) | |
| 166 | + | return cret | |
| 166 | 167 | } | |
| 167 | 168 | ||
| 168 | 169 | var xExpanderRowRemove func(uintptr, uintptr) | |
| @@ -256,8 +257,8 @@ func (c *ExpanderRow) SetGoPointer(ptr uintptr) { | |||
| 256 | 257 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 257 | 258 | func (x *ExpanderRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 258 | 259 | ||
| 259 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 260 | - | ||
| 260 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 261 | + | return cret | |
| 261 | 262 | } | |
| 262 | 263 | ||
| 263 | 264 | // Resets the accessible @property to its default value. | |
| @@ -389,15 +390,15 @@ func (x *ExpanderRow) UpdateStateValue(NStatesVar int, StatesVar uintptr, Values | |||
| 389 | 390 | // Gets the action name for @actionable. | |
| 390 | 391 | func (x *ExpanderRow) GetActionName() string { | |
| 391 | 392 | ||
| 392 | - | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 393 | - | ||
| 393 | + | cret := gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 394 | + | return cret | |
| 394 | 395 | } | |
| 395 | 396 | ||
| 396 | 397 | // Gets the current target value of @actionable. | |
| 397 | 398 | func (x *ExpanderRow) GetActionTargetValue() *glib.Variant { | |
| 398 | 399 | ||
| 399 | - | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 400 | - | ||
| 400 | + | cret := gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 401 | + | return cret | |
| 401 | 402 | } | |
| 402 | 403 | ||
| 403 | 404 | // Specifies the name of the action with which this widget should be | |
| @@ -475,8 +476,8 @@ func (x *ExpanderRow) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 475 | 476 | // of the <object> tag used to construct the @buildable. | |
| 476 | 477 | func (x *ExpanderRow) GetBuildableId() string { | |
| 477 | 478 | ||
| 478 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 479 | - | ||
| 479 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 480 | + | return cret | |
| 480 | 481 | } | |
| 481 | 482 | ||
| 482 | 483 | func init() { | |
M v4/adw/adw-flap.go +76 -78
| @@ -126,52 +126,51 @@ var xNewFlap func() uintptr | |||
| 126 | 126 | ||
| 127 | 127 | // Creates a new `AdwFlap`. | |
| 128 | 128 | func NewFlap() *gtk.Widget { | |
| 129 | - | NewFlapPtr := xNewFlap() | |
| 130 | - | if NewFlapPtr == 0 { | |
| 131 | - | return nil | |
| 132 | - | } | |
| 129 | + | var cls *gtk.Widget | |
| 133 | 130 | ||
| 134 | - | gobject.IncreaseRef(NewFlapPtr) | |
| 131 | + | cret := xNewFlap() | |
| 135 | 132 | ||
| 136 | - | NewFlapCls := >k.Widget{} | |
| 137 | - | NewFlapCls.Ptr = NewFlapPtr | |
| 138 | - | return NewFlapCls | |
| 133 | + | if cret == 0 { | |
| 134 | + | return cls | |
| 135 | + | } | |
| 136 | + | gobject.IncreaseRef(cret) | |
| 137 | + | cls = >k.Widget{} | |
| 138 | + | cls.Ptr = cret | |
| 139 | + | return cls | |
| 139 | 140 | } | |
| 140 | 141 | ||
| 141 | 142 | var xFlapGetContent func(uintptr) uintptr | |
| 142 | 143 | ||
| 143 | 144 | // Gets the content widget for @self. | |
| 144 | 145 | func (x *Flap) GetContent() *gtk.Widget { | |
| 146 | + | var cls *gtk.Widget | |
| 145 | 147 | ||
| 146 | - | GetContentPtr := xFlapGetContent(x.GoPointer()) | |
| 147 | - | if GetContentPtr == 0 { | |
| 148 | - | return nil | |
| 149 | - | } | |
| 150 | - | ||
| 151 | - | gobject.IncreaseRef(GetContentPtr) | |
| 152 | - | ||
| 153 | - | GetContentCls := >k.Widget{} | |
| 154 | - | GetContentCls.Ptr = GetContentPtr | |
| 155 | - | return GetContentCls | |
| 148 | + | cret := xFlapGetContent(x.GoPointer()) | |
| 156 | 149 | ||
| 150 | + | if cret == 0 { | |
| 151 | + | return cls | |
| 152 | + | } | |
| 153 | + | gobject.IncreaseRef(cret) | |
| 154 | + | cls = >k.Widget{} | |
| 155 | + | cls.Ptr = cret | |
| 156 | + | return cls | |
| 157 | 157 | } | |
| 158 | 158 | ||
| 159 | 159 | var xFlapGetFlap func(uintptr) uintptr | |
| 160 | 160 | ||
| 161 | 161 | // Gets the flap widget for @self. | |
| 162 | 162 | func (x *Flap) GetFlap() *gtk.Widget { | |
| 163 | + | var cls *gtk.Widget | |
| 163 | 164 | ||
| 164 | - | GetFlapPtr := xFlapGetFlap(x.GoPointer()) | |
| 165 | - | if GetFlapPtr == 0 { | |
| 166 | - | return nil | |
| 167 | - | } | |
| 168 | - | ||
| 169 | - | gobject.IncreaseRef(GetFlapPtr) | |
| 170 | - | ||
| 171 | - | GetFlapCls := >k.Widget{} | |
| 172 | - | GetFlapCls.Ptr = GetFlapPtr | |
| 173 | - | return GetFlapCls | |
| 165 | + | cret := xFlapGetFlap(x.GoPointer()) | |
| 174 | 166 | ||
| 167 | + | if cret == 0 { | |
| 168 | + | return cls | |
| 169 | + | } | |
| 170 | + | gobject.IncreaseRef(cret) | |
| 171 | + | cls = >k.Widget{} | |
| 172 | + | cls.Ptr = cret | |
| 173 | + | return cls | |
| 175 | 174 | } | |
| 176 | 175 | ||
| 177 | 176 | var xFlapGetFlapPosition func(uintptr) gtk.PackType | |
| @@ -179,8 +178,8 @@ var xFlapGetFlapPosition func(uintptr) gtk.PackType | |||
| 179 | 178 | // Gets the flap position for @self. | |
| 180 | 179 | func (x *Flap) GetFlapPosition() gtk.PackType { | |
| 181 | 180 | ||
| 182 | - | return xFlapGetFlapPosition(x.GoPointer()) | |
| 183 | - | ||
| 181 | + | cret := xFlapGetFlapPosition(x.GoPointer()) | |
| 182 | + | return cret | |
| 184 | 183 | } | |
| 185 | 184 | ||
| 186 | 185 | var xFlapGetFoldDuration func(uintptr) uint | |
| @@ -188,8 +187,8 @@ var xFlapGetFoldDuration func(uintptr) uint | |||
| 188 | 187 | // Gets the fold transition animation duration for @self, in milliseconds. | |
| 189 | 188 | func (x *Flap) GetFoldDuration() uint { | |
| 190 | 189 | ||
| 191 | - | return xFlapGetFoldDuration(x.GoPointer()) | |
| 192 | - | ||
| 190 | + | cret := xFlapGetFoldDuration(x.GoPointer()) | |
| 191 | + | return cret | |
| 193 | 192 | } | |
| 194 | 193 | ||
| 195 | 194 | var xFlapGetFoldPolicy func(uintptr) FlapFoldPolicy | |
| @@ -197,8 +196,8 @@ var xFlapGetFoldPolicy func(uintptr) FlapFoldPolicy | |||
| 197 | 196 | // Gets the fold policy for @self. | |
| 198 | 197 | func (x *Flap) GetFoldPolicy() FlapFoldPolicy { | |
| 199 | 198 | ||
| 200 | - | return xFlapGetFoldPolicy(x.GoPointer()) | |
| 201 | - | ||
| 199 | + | cret := xFlapGetFoldPolicy(x.GoPointer()) | |
| 200 | + | return cret | |
| 202 | 201 | } | |
| 203 | 202 | ||
| 204 | 203 | var xFlapGetFoldThresholdPolicy func(uintptr) FoldThresholdPolicy | |
| @@ -206,8 +205,8 @@ var xFlapGetFoldThresholdPolicy func(uintptr) FoldThresholdPolicy | |||
| 206 | 205 | // Gets the fold threshold policy for @self. | |
| 207 | 206 | func (x *Flap) GetFoldThresholdPolicy() FoldThresholdPolicy { | |
| 208 | 207 | ||
| 209 | - | return xFlapGetFoldThresholdPolicy(x.GoPointer()) | |
| 210 | - | ||
| 208 | + | cret := xFlapGetFoldThresholdPolicy(x.GoPointer()) | |
| 209 | + | return cret | |
| 211 | 210 | } | |
| 212 | 211 | ||
| 213 | 212 | var xFlapGetFolded func(uintptr) bool | |
| @@ -217,8 +216,8 @@ var xFlapGetFolded func(uintptr) bool | |||
| 217 | 216 | // See [property@Flap:fold-policy]. | |
| 218 | 217 | func (x *Flap) GetFolded() bool { | |
| 219 | 218 | ||
| 220 | - | return xFlapGetFolded(x.GoPointer()) | |
| 221 | - | ||
| 219 | + | cret := xFlapGetFolded(x.GoPointer()) | |
| 220 | + | return cret | |
| 222 | 221 | } | |
| 223 | 222 | ||
| 224 | 223 | var xFlapGetLocked func(uintptr) bool | |
| @@ -226,8 +225,8 @@ var xFlapGetLocked func(uintptr) bool | |||
| 226 | 225 | // Gets whether @self is locked. | |
| 227 | 226 | func (x *Flap) GetLocked() bool { | |
| 228 | 227 | ||
| 229 | - | return xFlapGetLocked(x.GoPointer()) | |
| 230 | - | ||
| 228 | + | cret := xFlapGetLocked(x.GoPointer()) | |
| 229 | + | return cret | |
| 231 | 230 | } | |
| 232 | 231 | ||
| 233 | 232 | var xFlapGetModal func(uintptr) bool | |
| @@ -235,8 +234,8 @@ var xFlapGetModal func(uintptr) bool | |||
| 235 | 234 | // Gets whether @self is modal. | |
| 236 | 235 | func (x *Flap) GetModal() bool { | |
| 237 | 236 | ||
| 238 | - | return xFlapGetModal(x.GoPointer()) | |
| 239 | - | ||
| 237 | + | cret := xFlapGetModal(x.GoPointer()) | |
| 238 | + | return cret | |
| 240 | 239 | } | |
| 241 | 240 | ||
| 242 | 241 | var xFlapGetRevealFlap func(uintptr) bool | |
| @@ -244,8 +243,8 @@ var xFlapGetRevealFlap func(uintptr) bool | |||
| 244 | 243 | // Gets whether the flap widget is revealed for @self. | |
| 245 | 244 | func (x *Flap) GetRevealFlap() bool { | |
| 246 | 245 | ||
| 247 | - | return xFlapGetRevealFlap(x.GoPointer()) | |
| 248 | - | ||
| 246 | + | cret := xFlapGetRevealFlap(x.GoPointer()) | |
| 247 | + | return cret | |
| 249 | 248 | } | |
| 250 | 249 | ||
| 251 | 250 | var xFlapGetRevealParams func(uintptr) *SpringParams | |
| @@ -253,8 +252,8 @@ var xFlapGetRevealParams func(uintptr) *SpringParams | |||
| 253 | 252 | // Gets the reveal animation spring parameters for @self. | |
| 254 | 253 | func (x *Flap) GetRevealParams() *SpringParams { | |
| 255 | 254 | ||
| 256 | - | return xFlapGetRevealParams(x.GoPointer()) | |
| 257 | - | ||
| 255 | + | cret := xFlapGetRevealParams(x.GoPointer()) | |
| 256 | + | return cret | |
| 258 | 257 | } | |
| 259 | 258 | ||
| 260 | 259 | var xFlapGetRevealProgress func(uintptr) float64 | |
| @@ -266,26 +265,25 @@ var xFlapGetRevealProgress func(uintptr) float64 | |||
| 266 | 265 | // See [property@Flap:reveal-flap]. | |
| 267 | 266 | func (x *Flap) GetRevealProgress() float64 { | |
| 268 | 267 | ||
| 269 | - | return xFlapGetRevealProgress(x.GoPointer()) | |
| 270 | - | ||
| 268 | + | cret := xFlapGetRevealProgress(x.GoPointer()) | |
| 269 | + | return cret | |
| 271 | 270 | } | |
| 272 | 271 | ||
| 273 | 272 | var xFlapGetSeparator func(uintptr) uintptr | |
| 274 | 273 | ||
| 275 | 274 | // Gets the separator widget for @self. | |
| 276 | 275 | func (x *Flap) GetSeparator() *gtk.Widget { | |
| 276 | + | var cls *gtk.Widget | |
| 277 | 277 | ||
| 278 | - | GetSeparatorPtr := xFlapGetSeparator(x.GoPointer()) | |
| 279 | - | if GetSeparatorPtr == 0 { | |
| 280 | - | return nil | |
| 281 | - | } | |
| 282 | - | ||
| 283 | - | gobject.IncreaseRef(GetSeparatorPtr) | |
| 284 | - | ||
| 285 | - | GetSeparatorCls := >k.Widget{} | |
| 286 | - | GetSeparatorCls.Ptr = GetSeparatorPtr | |
| 287 | - | return GetSeparatorCls | |
| 278 | + | cret := xFlapGetSeparator(x.GoPointer()) | |
| 288 | 279 | ||
| 280 | + | if cret == 0 { | |
| 281 | + | return cls | |
| 282 | + | } | |
| 283 | + | gobject.IncreaseRef(cret) | |
| 284 | + | cls = >k.Widget{} | |
| 285 | + | cls.Ptr = cret | |
| 286 | + | return cls | |
| 289 | 287 | } | |
| 290 | 288 | ||
| 291 | 289 | var xFlapGetSwipeToClose func(uintptr) bool | |
| @@ -293,8 +291,8 @@ var xFlapGetSwipeToClose func(uintptr) bool | |||
| 293 | 291 | // Gets whether @self can be closed with a swipe gesture. | |
| 294 | 292 | func (x *Flap) GetSwipeToClose() bool { | |
| 295 | 293 | ||
| 296 | - | return xFlapGetSwipeToClose(x.GoPointer()) | |
| 297 | - | ||
| 294 | + | cret := xFlapGetSwipeToClose(x.GoPointer()) | |
| 295 | + | return cret | |
| 298 | 296 | } | |
| 299 | 297 | ||
| 300 | 298 | var xFlapGetSwipeToOpen func(uintptr) bool | |
| @@ -302,8 +300,8 @@ var xFlapGetSwipeToOpen func(uintptr) bool | |||
| 302 | 300 | // Gets whether @self can be opened with a swipe gesture. | |
| 303 | 301 | func (x *Flap) GetSwipeToOpen() bool { | |
| 304 | 302 | ||
| 305 | - | return xFlapGetSwipeToOpen(x.GoPointer()) | |
| 306 | - | ||
| 303 | + | cret := xFlapGetSwipeToOpen(x.GoPointer()) | |
| 304 | + | return cret | |
| 307 | 305 | } | |
| 308 | 306 | ||
| 309 | 307 | var xFlapGetTransitionType func(uintptr) FlapTransitionType | |
| @@ -311,8 +309,8 @@ var xFlapGetTransitionType func(uintptr) FlapTransitionType | |||
| 311 | 309 | // Gets the type of animation used for reveal and fold transitions in @self. | |
| 312 | 310 | func (x *Flap) GetTransitionType() FlapTransitionType { | |
| 313 | 311 | ||
| 314 | - | return xFlapGetTransitionType(x.GoPointer()) | |
| 315 | - | ||
| 312 | + | cret := xFlapGetTransitionType(x.GoPointer()) | |
| 313 | + | return cret | |
| 316 | 314 | } | |
| 317 | 315 | ||
| 318 | 316 | var xFlapSetContent func(uintptr, uintptr) | |
| @@ -495,8 +493,8 @@ func (c *Flap) SetGoPointer(ptr uintptr) { | |||
| 495 | 493 | // Gets the progress @self will snap back to after the gesture is canceled. | |
| 496 | 494 | func (x *Flap) GetCancelProgress() float64 { | |
| 497 | 495 | ||
| 498 | - | return XAdwSwipeableGetCancelProgress(x.GoPointer()) | |
| 499 | - | ||
| 496 | + | cret := XAdwSwipeableGetCancelProgress(x.GoPointer()) | |
| 497 | + | return cret | |
| 500 | 498 | } | |
| 501 | 499 | ||
| 502 | 500 | // Gets the swipe distance of @self. | |
| @@ -504,15 +502,15 @@ func (x *Flap) GetCancelProgress() float64 { | |||
| 504 | 502 | // This corresponds to how many pixels 1 unit represents. | |
| 505 | 503 | func (x *Flap) GetDistance() float64 { | |
| 506 | 504 | ||
| 507 | - | return XAdwSwipeableGetDistance(x.GoPointer()) | |
| 508 | - | ||
| 505 | + | cret := XAdwSwipeableGetDistance(x.GoPointer()) | |
| 506 | + | return cret | |
| 509 | 507 | } | |
| 510 | 508 | ||
| 511 | 509 | // Gets the current progress of @self. | |
| 512 | 510 | func (x *Flap) GetProgress() float64 { | |
| 513 | 511 | ||
| 514 | - | return XAdwSwipeableGetProgress(x.GoPointer()) | |
| 515 | - | ||
| 512 | + | cret := XAdwSwipeableGetProgress(x.GoPointer()) | |
| 513 | + | return cret | |
| 516 | 514 | } | |
| 517 | 515 | ||
| 518 | 516 | // Gets the snap points of @self. | |
| @@ -521,8 +519,8 @@ func (x *Flap) GetProgress() float64 { | |||
| 521 | 519 | // end the swipe on. | |
| 522 | 520 | func (x *Flap) GetSnapPoints(NSnapPointsVar int) uintptr { | |
| 523 | 521 | ||
| 524 | - | return XAdwSwipeableGetSnapPoints(x.GoPointer(), NSnapPointsVar) | |
| 525 | - | ||
| 522 | + | cret := XAdwSwipeableGetSnapPoints(x.GoPointer(), NSnapPointsVar) | |
| 523 | + | return cret | |
| 526 | 524 | } | |
| 527 | 525 | ||
| 528 | 526 | // Gets the area @self can start a swipe from for the given direction and | |
| @@ -543,8 +541,8 @@ func (x *Flap) GetSwipeArea(NavigationDirectionVar NavigationDirection, IsDragVa | |||
| 543 | 541 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 544 | 542 | func (x *Flap) GetAccessibleRole() gtk.AccessibleRole { | |
| 545 | 543 | ||
| 546 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 547 | - | ||
| 544 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 545 | + | return cret | |
| 548 | 546 | } | |
| 549 | 547 | ||
| 550 | 548 | // Resets the accessible @property to its default value. | |
| @@ -679,15 +677,15 @@ func (x *Flap) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVar uin | |||
| 679 | 677 | // of the <object> tag used to construct the @buildable. | |
| 680 | 678 | func (x *Flap) GetBuildableId() string { | |
| 681 | 679 | ||
| 682 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 683 | - | ||
| 680 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 681 | + | return cret | |
| 684 | 682 | } | |
| 685 | 683 | ||
| 686 | 684 | // Retrieves the orientation of the @orientable. | |
| 687 | 685 | func (x *Flap) GetOrientation() gtk.Orientation { | |
| 688 | 686 | ||
| 689 | - | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 690 | - | ||
| 687 | + | cret := gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 688 | + | return cret | |
| 691 | 689 | } | |
| 692 | 690 | ||
| 693 | 691 | // Sets the orientation of the @orientable. | |
M v4/adw/adw-header-bar.go +30 -30
| @@ -129,16 +129,17 @@ var xNewHeaderBar func() uintptr | |||
| 129 | 129 | ||
| 130 | 130 | // Creates a new `AdwHeaderBar`. | |
| 131 | 131 | func NewHeaderBar() *gtk.Widget { | |
| 132 | - | NewHeaderBarPtr := xNewHeaderBar() | |
| 133 | - | if NewHeaderBarPtr == 0 { | |
| 134 | - | return nil | |
| 135 | - | } | |
| 132 | + | var cls *gtk.Widget | |
| 136 | 133 | ||
| 137 | - | gobject.IncreaseRef(NewHeaderBarPtr) | |
| 134 | + | cret := xNewHeaderBar() | |
| 138 | 135 | ||
| 139 | - | NewHeaderBarCls := >k.Widget{} | |
| 140 | - | NewHeaderBarCls.Ptr = NewHeaderBarPtr | |
| 141 | - | return NewHeaderBarCls | |
| 136 | + | if cret == 0 { | |
| 137 | + | return cls | |
| 138 | + | } | |
| 139 | + | gobject.IncreaseRef(cret) | |
| 140 | + | cls = >k.Widget{} | |
| 141 | + | cls.Ptr = cret | |
| 142 | + | return cls | |
| 142 | 143 | } | |
| 143 | 144 | ||
| 144 | 145 | var xHeaderBarGetCenteringPolicy func(uintptr) CenteringPolicy | |
| @@ -146,8 +147,8 @@ var xHeaderBarGetCenteringPolicy func(uintptr) CenteringPolicy | |||
| 146 | 147 | // Gets the policy for aligning the center widget. | |
| 147 | 148 | func (x *HeaderBar) GetCenteringPolicy() CenteringPolicy { | |
| 148 | 149 | ||
| 149 | - | return xHeaderBarGetCenteringPolicy(x.GoPointer()) | |
| 150 | - | ||
| 150 | + | cret := xHeaderBarGetCenteringPolicy(x.GoPointer()) | |
| 151 | + | return cret | |
| 151 | 152 | } | |
| 152 | 153 | ||
| 153 | 154 | var xHeaderBarGetDecorationLayout func(uintptr) string | |
| @@ -155,8 +156,8 @@ var xHeaderBarGetDecorationLayout func(uintptr) string | |||
| 155 | 156 | // Gets the decoration layout for @self. | |
| 156 | 157 | func (x *HeaderBar) GetDecorationLayout() string { | |
| 157 | 158 | ||
| 158 | - | return xHeaderBarGetDecorationLayout(x.GoPointer()) | |
| 159 | - | ||
| 159 | + | cret := xHeaderBarGetDecorationLayout(x.GoPointer()) | |
| 160 | + | return cret | |
| 160 | 161 | } | |
| 161 | 162 | ||
| 162 | 163 | var xHeaderBarGetShowEndTitleButtons func(uintptr) bool | |
| @@ -164,8 +165,8 @@ var xHeaderBarGetShowEndTitleButtons func(uintptr) bool | |||
| 164 | 165 | // Gets whether to show title buttons at the end of @self. | |
| 165 | 166 | func (x *HeaderBar) GetShowEndTitleButtons() bool { | |
| 166 | 167 | ||
| 167 | - | return xHeaderBarGetShowEndTitleButtons(x.GoPointer()) | |
| 168 | - | ||
| 168 | + | cret := xHeaderBarGetShowEndTitleButtons(x.GoPointer()) | |
| 169 | + | return cret | |
| 169 | 170 | } | |
| 170 | 171 | ||
| 171 | 172 | var xHeaderBarGetShowStartTitleButtons func(uintptr) bool | |
| @@ -173,26 +174,25 @@ var xHeaderBarGetShowStartTitleButtons func(uintptr) bool | |||
| 173 | 174 | // Gets whether to show title buttons at the start of @self. | |
| 174 | 175 | func (x *HeaderBar) GetShowStartTitleButtons() bool { | |
| 175 | 176 | ||
| 176 | - | return xHeaderBarGetShowStartTitleButtons(x.GoPointer()) | |
| 177 | - | ||
| 177 | + | cret := xHeaderBarGetShowStartTitleButtons(x.GoPointer()) | |
| 178 | + | return cret | |
| 178 | 179 | } | |
| 179 | 180 | ||
| 180 | 181 | var xHeaderBarGetTitleWidget func(uintptr) uintptr | |
| 181 | 182 | ||
| 182 | 183 | // Gets the title widget widget of @self. | |
| 183 | 184 | func (x *HeaderBar) GetTitleWidget() *gtk.Widget { | |
| 185 | + | var cls *gtk.Widget | |
| 184 | 186 | ||
| 185 | - | GetTitleWidgetPtr := xHeaderBarGetTitleWidget(x.GoPointer()) | |
| 186 | - | if GetTitleWidgetPtr == 0 { | |
| 187 | - | return nil | |
| 188 | - | } | |
| 189 | - | ||
| 190 | - | gobject.IncreaseRef(GetTitleWidgetPtr) | |
| 191 | - | ||
| 192 | - | GetTitleWidgetCls := >k.Widget{} | |
| 193 | - | GetTitleWidgetCls.Ptr = GetTitleWidgetPtr | |
| 194 | - | return GetTitleWidgetCls | |
| 187 | + | cret := xHeaderBarGetTitleWidget(x.GoPointer()) | |
| 195 | 188 | ||
| 189 | + | if cret == 0 { | |
| 190 | + | return cls | |
| 191 | + | } | |
| 192 | + | gobject.IncreaseRef(cret) | |
| 193 | + | cls = >k.Widget{} | |
| 194 | + | cls.Ptr = cret | |
| 195 | + | return cls | |
| 196 | 196 | } | |
| 197 | 197 | ||
| 198 | 198 | var xHeaderBarPackEnd func(uintptr, uintptr) | |
| @@ -321,8 +321,8 @@ func (c *HeaderBar) SetGoPointer(ptr uintptr) { | |||
| 321 | 321 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 322 | 322 | func (x *HeaderBar) GetAccessibleRole() gtk.AccessibleRole { | |
| 323 | 323 | ||
| 324 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 325 | - | ||
| 324 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 325 | + | return cret | |
| 326 | 326 | } | |
| 327 | 327 | ||
| 328 | 328 | // Resets the accessible @property to its default value. | |
| @@ -457,8 +457,8 @@ func (x *HeaderBar) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVa | |||
| 457 | 457 | // of the <object> tag used to construct the @buildable. | |
| 458 | 458 | func (x *HeaderBar) GetBuildableId() string { | |
| 459 | 459 | ||
| 460 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 461 | - | ||
| 460 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 461 | + | return cret | |
| 462 | 462 | } | |
| 463 | 463 | ||
| 464 | 464 | func init() { | |
M v4/adw/adw-leaflet.go +131 -138
| @@ -81,34 +81,34 @@ var xNewLeaflet func() uintptr | |||
| 81 | 81 | ||
| 82 | 82 | // Creates a new `AdwLeaflet`. | |
| 83 | 83 | func NewLeaflet() *gtk.Widget { | |
| 84 | - | NewLeafletPtr := xNewLeaflet() | |
| 85 | - | if NewLeafletPtr == 0 { | |
| 86 | - | return nil | |
| 87 | - | } | |
| 84 | + | var cls *gtk.Widget | |
| 88 | 85 | ||
| 89 | - | gobject.IncreaseRef(NewLeafletPtr) | |
| 86 | + | cret := xNewLeaflet() | |
| 90 | 87 | ||
| 91 | - | NewLeafletCls := >k.Widget{} | |
| 92 | - | NewLeafletCls.Ptr = NewLeafletPtr | |
| 93 | - | return NewLeafletCls | |
| 88 | + | if cret == 0 { | |
| 89 | + | return cls | |
| 90 | + | } | |
| 91 | + | gobject.IncreaseRef(cret) | |
| 92 | + | cls = >k.Widget{} | |
| 93 | + | cls.Ptr = cret | |
| 94 | + | return cls | |
| 94 | 95 | } | |
| 95 | 96 | ||
| 96 | 97 | var xLeafletAppend func(uintptr, uintptr) uintptr | |
| 97 | 98 | ||
| 98 | 99 | // Adds a child to @self. | |
| 99 | 100 | func (x *Leaflet) Append(ChildVar *gtk.Widget) *LeafletPage { | |
| 101 | + | var cls *LeafletPage | |
| 100 | 102 | ||
| 101 | - | AppendPtr := xLeafletAppend(x.GoPointer(), ChildVar.GoPointer()) | |
| 102 | - | if AppendPtr == 0 { | |
| 103 | - | return nil | |
| 104 | - | } | |
| 105 | - | ||
| 106 | - | gobject.IncreaseRef(AppendPtr) | |
| 107 | - | ||
| 108 | - | AppendCls := &LeafletPage{} | |
| 109 | - | AppendCls.Ptr = AppendPtr | |
| 110 | - | return AppendCls | |
| 103 | + | cret := xLeafletAppend(x.GoPointer(), ChildVar.GoPointer()) | |
| 111 | 104 | ||
| 105 | + | if cret == 0 { | |
| 106 | + | return cls | |
| 107 | + | } | |
| 108 | + | gobject.IncreaseRef(cret) | |
| 109 | + | cls = &LeafletPage{} | |
| 110 | + | cls.Ptr = cret | |
| 111 | + | return cls | |
| 112 | 112 | } | |
| 113 | 113 | ||
| 114 | 114 | var xLeafletGetAdjacentChild func(uintptr, NavigationDirection) uintptr | |
| @@ -122,18 +122,17 @@ var xLeafletGetAdjacentChild func(uintptr, NavigationDirection) uintptr | |||
| 122 | 122 | // | |
| 123 | 123 | // See [property@LeafletPage:navigatable]. | |
| 124 | 124 | func (x *Leaflet) GetAdjacentChild(DirectionVar NavigationDirection) *gtk.Widget { | |
| 125 | + | var cls *gtk.Widget | |
| 125 | 126 | ||
| 126 | - | GetAdjacentChildPtr := xLeafletGetAdjacentChild(x.GoPointer(), DirectionVar) | |
| 127 | - | if GetAdjacentChildPtr == 0 { | |
| 128 | - | return nil | |
| 129 | - | } | |
| 130 | - | ||
| 131 | - | gobject.IncreaseRef(GetAdjacentChildPtr) | |
| 132 | - | ||
| 133 | - | GetAdjacentChildCls := >k.Widget{} | |
| 134 | - | GetAdjacentChildCls.Ptr = GetAdjacentChildPtr | |
| 135 | - | return GetAdjacentChildCls | |
| 127 | + | cret := xLeafletGetAdjacentChild(x.GoPointer(), DirectionVar) | |
| 136 | 128 | ||
| 129 | + | if cret == 0 { | |
| 130 | + | return cls | |
| 131 | + | } | |
| 132 | + | gobject.IncreaseRef(cret) | |
| 133 | + | cls = >k.Widget{} | |
| 134 | + | cls.Ptr = cret | |
| 135 | + | return cls | |
| 137 | 136 | } | |
| 138 | 137 | ||
| 139 | 138 | var xLeafletGetCanNavigateBack func(uintptr) bool | |
| @@ -141,8 +140,8 @@ var xLeafletGetCanNavigateBack func(uintptr) bool | |||
| 141 | 140 | // Gets whether gestures and shortcuts for navigating backward are enabled. | |
| 142 | 141 | func (x *Leaflet) GetCanNavigateBack() bool { | |
| 143 | 142 | ||
| 144 | - | return xLeafletGetCanNavigateBack(x.GoPointer()) | |
| 145 | - | ||
| 143 | + | cret := xLeafletGetCanNavigateBack(x.GoPointer()) | |
| 144 | + | return cret | |
| 146 | 145 | } | |
| 147 | 146 | ||
| 148 | 147 | var xLeafletGetCanNavigateForward func(uintptr) bool | |
| @@ -150,8 +149,8 @@ var xLeafletGetCanNavigateForward func(uintptr) bool | |||
| 150 | 149 | // Gets whether gestures and shortcuts for navigating forward are enabled. | |
| 151 | 150 | func (x *Leaflet) GetCanNavigateForward() bool { | |
| 152 | 151 | ||
| 153 | - | return xLeafletGetCanNavigateForward(x.GoPointer()) | |
| 154 | - | ||
| 152 | + | cret := xLeafletGetCanNavigateForward(x.GoPointer()) | |
| 153 | + | return cret | |
| 155 | 154 | } | |
| 156 | 155 | ||
| 157 | 156 | var xLeafletGetCanUnfold func(uintptr) bool | |
| @@ -159,8 +158,8 @@ var xLeafletGetCanUnfold func(uintptr) bool | |||
| 159 | 158 | // Gets whether @self can unfold. | |
| 160 | 159 | func (x *Leaflet) GetCanUnfold() bool { | |
| 161 | 160 | ||
| 162 | - | return xLeafletGetCanUnfold(x.GoPointer()) | |
| 163 | - | ||
| 161 | + | cret := xLeafletGetCanUnfold(x.GoPointer()) | |
| 162 | + | return cret | |
| 164 | 163 | } | |
| 165 | 164 | ||
| 166 | 165 | var xLeafletGetChildByName func(uintptr, string) uintptr | |
| @@ -171,18 +170,17 @@ var xLeafletGetChildByName func(uintptr, string) uintptr | |||
| 171 | 170 | // | |
| 172 | 171 | // See [property@LeafletPage:name]. | |
| 173 | 172 | func (x *Leaflet) GetChildByName(NameVar string) *gtk.Widget { | |
| 173 | + | var cls *gtk.Widget | |
| 174 | 174 | ||
| 175 | - | GetChildByNamePtr := xLeafletGetChildByName(x.GoPointer(), NameVar) | |
| 176 | - | if GetChildByNamePtr == 0 { | |
| 177 | - | return nil | |
| 178 | - | } | |
| 179 | - | ||
| 180 | - | gobject.IncreaseRef(GetChildByNamePtr) | |
| 181 | - | ||
| 182 | - | GetChildByNameCls := >k.Widget{} | |
| 183 | - | GetChildByNameCls.Ptr = GetChildByNamePtr | |
| 184 | - | return GetChildByNameCls | |
| 175 | + | cret := xLeafletGetChildByName(x.GoPointer(), NameVar) | |
| 185 | 176 | ||
| 177 | + | if cret == 0 { | |
| 178 | + | return cls | |
| 179 | + | } | |
| 180 | + | gobject.IncreaseRef(cret) | |
| 181 | + | cls = >k.Widget{} | |
| 182 | + | cls.Ptr = cret | |
| 183 | + | return cls | |
| 186 | 184 | } | |
| 187 | 185 | ||
| 188 | 186 | var xLeafletGetChildTransitionParams func(uintptr) *SpringParams | |
| @@ -190,8 +188,8 @@ var xLeafletGetChildTransitionParams func(uintptr) *SpringParams | |||
| 190 | 188 | // Gets the child transition spring parameters for @self. | |
| 191 | 189 | func (x *Leaflet) GetChildTransitionParams() *SpringParams { | |
| 192 | 190 | ||
| 193 | - | return xLeafletGetChildTransitionParams(x.GoPointer()) | |
| 194 | - | ||
| 191 | + | cret := xLeafletGetChildTransitionParams(x.GoPointer()) | |
| 192 | + | return cret | |
| 195 | 193 | } | |
| 196 | 194 | ||
| 197 | 195 | var xLeafletGetChildTransitionRunning func(uintptr) bool | |
| @@ -199,8 +197,8 @@ var xLeafletGetChildTransitionRunning func(uintptr) bool | |||
| 199 | 197 | // Gets whether a child transition is currently running for @self. | |
| 200 | 198 | func (x *Leaflet) GetChildTransitionRunning() bool { | |
| 201 | 199 | ||
| 202 | - | return xLeafletGetChildTransitionRunning(x.GoPointer()) | |
| 203 | - | ||
| 200 | + | cret := xLeafletGetChildTransitionRunning(x.GoPointer()) | |
| 201 | + | return cret | |
| 204 | 202 | } | |
| 205 | 203 | ||
| 206 | 204 | var xLeafletGetFoldThresholdPolicy func(uintptr) FoldThresholdPolicy | |
| @@ -208,8 +206,8 @@ var xLeafletGetFoldThresholdPolicy func(uintptr) FoldThresholdPolicy | |||
| 208 | 206 | // Gets the fold threshold policy for @self. | |
| 209 | 207 | func (x *Leaflet) GetFoldThresholdPolicy() FoldThresholdPolicy { | |
| 210 | 208 | ||
| 211 | - | return xLeafletGetFoldThresholdPolicy(x.GoPointer()) | |
| 212 | - | ||
| 209 | + | cret := xLeafletGetFoldThresholdPolicy(x.GoPointer()) | |
| 210 | + | return cret | |
| 213 | 211 | } | |
| 214 | 212 | ||
| 215 | 213 | var xLeafletGetFolded func(uintptr) bool | |
| @@ -221,8 +219,8 @@ var xLeafletGetFolded func(uintptr) bool | |||
| 221 | 219 | // [property@Leaflet:fold-threshold-policy]), it will be unfolded otherwise. | |
| 222 | 220 | func (x *Leaflet) GetFolded() bool { | |
| 223 | 221 | ||
| 224 | - | return xLeafletGetFolded(x.GoPointer()) | |
| 225 | - | ||
| 222 | + | cret := xLeafletGetFolded(x.GoPointer()) | |
| 223 | + | return cret | |
| 226 | 224 | } | |
| 227 | 225 | ||
| 228 | 226 | var xLeafletGetHomogeneous func(uintptr) bool | |
| @@ -230,8 +228,8 @@ var xLeafletGetHomogeneous func(uintptr) bool | |||
| 230 | 228 | // Gets whether @self is homogeneous. | |
| 231 | 229 | func (x *Leaflet) GetHomogeneous() bool { | |
| 232 | 230 | ||
| 233 | - | return xLeafletGetHomogeneous(x.GoPointer()) | |
| 234 | - | ||
| 231 | + | cret := xLeafletGetHomogeneous(x.GoPointer()) | |
| 232 | + | return cret | |
| 235 | 233 | } | |
| 236 | 234 | ||
| 237 | 235 | var xLeafletGetModeTransitionDuration func(uintptr) uint | |
| @@ -239,26 +237,25 @@ var xLeafletGetModeTransitionDuration func(uintptr) uint | |||
| 239 | 237 | // Gets the mode transition animation duration for @self. | |
| 240 | 238 | func (x *Leaflet) GetModeTransitionDuration() uint { | |
| 241 | 239 | ||
| 242 | - | return xLeafletGetModeTransitionDuration(x.GoPointer()) | |
| 243 | - | ||
| 240 | + | cret := xLeafletGetModeTransitionDuration(x.GoPointer()) | |
| 241 | + | return cret | |
| 244 | 242 | } | |
| 245 | 243 | ||
| 246 | 244 | var xLeafletGetPage func(uintptr, uintptr) uintptr | |
| 247 | 245 | ||
| 248 | 246 | // Returns the [class@LeafletPage] object for @child. | |
| 249 | 247 | func (x *Leaflet) GetPage(ChildVar *gtk.Widget) *LeafletPage { | |
| 248 | + | var cls *LeafletPage | |
| 250 | 249 | ||
| 251 | - | GetPagePtr := xLeafletGetPage(x.GoPointer(), ChildVar.GoPointer()) | |
| 252 | - | if GetPagePtr == 0 { | |
| 253 | - | return nil | |
| 254 | - | } | |
| 255 | - | ||
| 256 | - | gobject.IncreaseRef(GetPagePtr) | |
| 257 | - | ||
| 258 | - | GetPageCls := &LeafletPage{} | |
| 259 | - | GetPageCls.Ptr = GetPagePtr | |
| 260 | - | return GetPageCls | |
| 250 | + | cret := xLeafletGetPage(x.GoPointer(), ChildVar.GoPointer()) | |
| 261 | 251 | ||
| 252 | + | if cret == 0 { | |
| 253 | + | return cls | |
| 254 | + | } | |
| 255 | + | gobject.IncreaseRef(cret) | |
| 256 | + | cls = &LeafletPage{} | |
| 257 | + | cls.Ptr = cret | |
| 258 | + | return cls | |
| 262 | 259 | } | |
| 263 | 260 | ||
| 264 | 261 | var xLeafletGetPages func(uintptr) uintptr | |
| @@ -269,16 +266,16 @@ var xLeafletGetPages func(uintptr) uintptr | |||
| 269 | 266 | // [iface@Gtk.SelectionModel] and can be used to track and change the visible | |
| 270 | 267 | // page. | |
| 271 | 268 | func (x *Leaflet) GetPages() *gtk.SelectionModelBase { | |
| 269 | + | var cls *gtk.SelectionModelBase | |
| 272 | 270 | ||
| 273 | - | GetPagesPtr := xLeafletGetPages(x.GoPointer()) | |
| 274 | - | if GetPagesPtr == 0 { | |
| 275 | - | return nil | |
| 276 | - | } | |
| 277 | - | ||
| 278 | - | GetPagesCls := >k.SelectionModelBase{} | |
| 279 | - | GetPagesCls.Ptr = GetPagesPtr | |
| 280 | - | return GetPagesCls | |
| 271 | + | cret := xLeafletGetPages(x.GoPointer()) | |
| 281 | 272 | ||
| 273 | + | if cret == 0 { | |
| 274 | + | return cls | |
| 275 | + | } | |
| 276 | + | cls = >k.SelectionModelBase{} | |
| 277 | + | cls.Ptr = cret | |
| 278 | + | return cls | |
| 282 | 279 | } | |
| 283 | 280 | ||
| 284 | 281 | var xLeafletGetTransitionType func(uintptr) LeafletTransitionType | |
| @@ -286,26 +283,25 @@ var xLeafletGetTransitionType func(uintptr) LeafletTransitionType | |||
| 286 | 283 | // Gets the type of animation used for transitions between modes and children. | |
| 287 | 284 | func (x *Leaflet) GetTransitionType() LeafletTransitionType { | |
| 288 | 285 | ||
| 289 | - | return xLeafletGetTransitionType(x.GoPointer()) | |
| 290 | - | ||
| 286 | + | cret := xLeafletGetTransitionType(x.GoPointer()) | |
| 287 | + | return cret | |
| 291 | 288 | } | |
| 292 | 289 | ||
| 293 | 290 | var xLeafletGetVisibleChild func(uintptr) uintptr | |
| 294 | 291 | ||
| 295 | 292 | // Gets the widget currently visible when the leaflet is folded. | |
| 296 | 293 | func (x *Leaflet) GetVisibleChild() *gtk.Widget { | |
| 294 | + | var cls *gtk.Widget | |
| 297 | 295 | ||
| 298 | - | GetVisibleChildPtr := xLeafletGetVisibleChild(x.GoPointer()) | |
| 299 | - | if GetVisibleChildPtr == 0 { | |
| 300 | - | return nil | |
| 301 | - | } | |
| 302 | - | ||
| 303 | - | gobject.IncreaseRef(GetVisibleChildPtr) | |
| 304 | - | ||
| 305 | - | GetVisibleChildCls := >k.Widget{} | |
| 306 | - | GetVisibleChildCls.Ptr = GetVisibleChildPtr | |
| 307 | - | return GetVisibleChildCls | |
| 296 | + | cret := xLeafletGetVisibleChild(x.GoPointer()) | |
| 308 | 297 | ||
| 298 | + | if cret == 0 { | |
| 299 | + | return cls | |
| 300 | + | } | |
| 301 | + | gobject.IncreaseRef(cret) | |
| 302 | + | cls = >k.Widget{} | |
| 303 | + | cls.Ptr = cret | |
| 304 | + | return cls | |
| 309 | 305 | } | |
| 310 | 306 | ||
| 311 | 307 | var xLeafletGetVisibleChildName func(uintptr) string | |
| @@ -313,8 +309,8 @@ var xLeafletGetVisibleChildName func(uintptr) string | |||
| 313 | 309 | // Gets the name of the currently visible child widget. | |
| 314 | 310 | func (x *Leaflet) GetVisibleChildName() string { | |
| 315 | 311 | ||
| 316 | - | return xLeafletGetVisibleChildName(x.GoPointer()) | |
| 317 | - | ||
| 312 | + | cret := xLeafletGetVisibleChildName(x.GoPointer()) | |
| 313 | + | return cret | |
| 318 | 314 | } | |
| 319 | 315 | ||
| 320 | 316 | var xLeafletInsertChildAfter func(uintptr, uintptr, uintptr) uintptr | |
| @@ -323,18 +319,17 @@ var xLeafletInsertChildAfter func(uintptr, uintptr, uintptr) uintptr | |||
| 323 | 319 | // | |
| 324 | 320 | // If @sibling is `NULL`, inserts @child at the first position. | |
| 325 | 321 | func (x *Leaflet) InsertChildAfter(ChildVar *gtk.Widget, SiblingVar *gtk.Widget) *LeafletPage { | |
| 322 | + | var cls *LeafletPage | |
| 326 | 323 | ||
| 327 | - | InsertChildAfterPtr := xLeafletInsertChildAfter(x.GoPointer(), ChildVar.GoPointer(), SiblingVar.GoPointer()) | |
| 328 | - | if InsertChildAfterPtr == 0 { | |
| 329 | - | return nil | |
| 330 | - | } | |
| 331 | - | ||
| 332 | - | gobject.IncreaseRef(InsertChildAfterPtr) | |
| 333 | - | ||
| 334 | - | InsertChildAfterCls := &LeafletPage{} | |
| 335 | - | InsertChildAfterCls.Ptr = InsertChildAfterPtr | |
| 336 | - | return InsertChildAfterCls | |
| 324 | + | cret := xLeafletInsertChildAfter(x.GoPointer(), ChildVar.GoPointer(), SiblingVar.GoPointer()) | |
| 337 | 325 | ||
| 326 | + | if cret == 0 { | |
| 327 | + | return cls | |
| 328 | + | } | |
| 329 | + | gobject.IncreaseRef(cret) | |
| 330 | + | cls = &LeafletPage{} | |
| 331 | + | cls.Ptr = cret | |
| 332 | + | return cls | |
| 338 | 333 | } | |
| 339 | 334 | ||
| 340 | 335 | var xLeafletNavigate func(uintptr, NavigationDirection) bool | |
| @@ -348,26 +343,25 @@ var xLeafletNavigate func(uintptr, NavigationDirection) bool | |||
| 348 | 343 | // [method@Leaflet.get_adjacent_child] or navigated to via swipe gestures. | |
| 349 | 344 | func (x *Leaflet) Navigate(DirectionVar NavigationDirection) bool { | |
| 350 | 345 | ||
| 351 | - | return xLeafletNavigate(x.GoPointer(), DirectionVar) | |
| 352 | - | ||
| 346 | + | cret := xLeafletNavigate(x.GoPointer(), DirectionVar) | |
| 347 | + | return cret | |
| 353 | 348 | } | |
| 354 | 349 | ||
| 355 | 350 | var xLeafletPrepend func(uintptr, uintptr) uintptr | |
| 356 | 351 | ||
| 357 | 352 | // Inserts @child at the first position in @self. | |
| 358 | 353 | func (x *Leaflet) Prepend(ChildVar *gtk.Widget) *LeafletPage { | |
| 354 | + | var cls *LeafletPage | |
| 359 | 355 | ||
| 360 | - | PrependPtr := xLeafletPrepend(x.GoPointer(), ChildVar.GoPointer()) | |
| 361 | - | if PrependPtr == 0 { | |
| 362 | - | return nil | |
| 363 | - | } | |
| 364 | - | ||
| 365 | - | gobject.IncreaseRef(PrependPtr) | |
| 366 | - | ||
| 367 | - | PrependCls := &LeafletPage{} | |
| 368 | - | PrependCls.Ptr = PrependPtr | |
| 369 | - | return PrependCls | |
| 356 | + | cret := xLeafletPrepend(x.GoPointer(), ChildVar.GoPointer()) | |
| 370 | 357 | ||
| 358 | + | if cret == 0 { | |
| 359 | + | return cls | |
| 360 | + | } | |
| 361 | + | gobject.IncreaseRef(cret) | |
| 362 | + | cls = &LeafletPage{} | |
| 363 | + | cls.Ptr = cret | |
| 364 | + | return cls | |
| 371 | 365 | } | |
| 372 | 366 | ||
| 373 | 367 | var xLeafletRemove func(uintptr, uintptr) | |
| @@ -550,8 +544,8 @@ func (c *Leaflet) SetGoPointer(ptr uintptr) { | |||
| 550 | 544 | // Gets the progress @self will snap back to after the gesture is canceled. | |
| 551 | 545 | func (x *Leaflet) GetCancelProgress() float64 { | |
| 552 | 546 | ||
| 553 | - | return XAdwSwipeableGetCancelProgress(x.GoPointer()) | |
| 554 | - | ||
| 547 | + | cret := XAdwSwipeableGetCancelProgress(x.GoPointer()) | |
| 548 | + | return cret | |
| 555 | 549 | } | |
| 556 | 550 | ||
| 557 | 551 | // Gets the swipe distance of @self. | |
| @@ -559,15 +553,15 @@ func (x *Leaflet) GetCancelProgress() float64 { | |||
| 559 | 553 | // This corresponds to how many pixels 1 unit represents. | |
| 560 | 554 | func (x *Leaflet) GetDistance() float64 { | |
| 561 | 555 | ||
| 562 | - | return XAdwSwipeableGetDistance(x.GoPointer()) | |
| 563 | - | ||
| 556 | + | cret := XAdwSwipeableGetDistance(x.GoPointer()) | |
| 557 | + | return cret | |
| 564 | 558 | } | |
| 565 | 559 | ||
| 566 | 560 | // Gets the current progress of @self. | |
| 567 | 561 | func (x *Leaflet) GetProgress() float64 { | |
| 568 | 562 | ||
| 569 | - | return XAdwSwipeableGetProgress(x.GoPointer()) | |
| 570 | - | ||
| 563 | + | cret := XAdwSwipeableGetProgress(x.GoPointer()) | |
| 564 | + | return cret | |
| 571 | 565 | } | |
| 572 | 566 | ||
| 573 | 567 | // Gets the snap points of @self. | |
| @@ -576,8 +570,8 @@ func (x *Leaflet) GetProgress() float64 { | |||
| 576 | 570 | // end the swipe on. | |
| 577 | 571 | func (x *Leaflet) GetSnapPoints(NSnapPointsVar int) uintptr { | |
| 578 | 572 | ||
| 579 | - | return XAdwSwipeableGetSnapPoints(x.GoPointer(), NSnapPointsVar) | |
| 580 | - | ||
| 573 | + | cret := XAdwSwipeableGetSnapPoints(x.GoPointer(), NSnapPointsVar) | |
| 574 | + | return cret | |
| 581 | 575 | } | |
| 582 | 576 | ||
| 583 | 577 | // Gets the area @self can start a swipe from for the given direction and | |
| @@ -598,8 +592,8 @@ func (x *Leaflet) GetSwipeArea(NavigationDirectionVar NavigationDirection, IsDra | |||
| 598 | 592 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 599 | 593 | func (x *Leaflet) GetAccessibleRole() gtk.AccessibleRole { | |
| 600 | 594 | ||
| 601 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 602 | - | ||
| 595 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 596 | + | return cret | |
| 603 | 597 | } | |
| 604 | 598 | ||
| 605 | 599 | // Resets the accessible @property to its default value. | |
| @@ -734,15 +728,15 @@ func (x *Leaflet) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVar | |||
| 734 | 728 | // of the <object> tag used to construct the @buildable. | |
| 735 | 729 | func (x *Leaflet) GetBuildableId() string { | |
| 736 | 730 | ||
| 737 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 738 | - | ||
| 731 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 732 | + | return cret | |
| 739 | 733 | } | |
| 740 | 734 | ||
| 741 | 735 | // Retrieves the orientation of the @orientable. | |
| 742 | 736 | func (x *Leaflet) GetOrientation() gtk.Orientation { | |
| 743 | 737 | ||
| 744 | - | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 745 | - | ||
| 738 | + | cret := gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 739 | + | return cret | |
| 746 | 740 | } | |
| 747 | 741 | ||
| 748 | 742 | // Sets the orientation of the @orientable. | |
| @@ -767,18 +761,17 @@ var xLeafletPageGetChild func(uintptr) uintptr | |||
| 767 | 761 | ||
| 768 | 762 | // Gets the leaflet child to which @self belongs. | |
| 769 | 763 | func (x *LeafletPage) GetChild() *gtk.Widget { | |
| 764 | + | var cls *gtk.Widget | |
| 770 | 765 | ||
| 771 | - | GetChildPtr := xLeafletPageGetChild(x.GoPointer()) | |
| 772 | - | if GetChildPtr == 0 { | |
| 773 | - | return nil | |
| 774 | - | } | |
| 775 | - | ||
| 776 | - | gobject.IncreaseRef(GetChildPtr) | |
| 777 | - | ||
| 778 | - | GetChildCls := >k.Widget{} | |
| 779 | - | GetChildCls.Ptr = GetChildPtr | |
| 780 | - | return GetChildCls | |
| 766 | + | cret := xLeafletPageGetChild(x.GoPointer()) | |
| 781 | 767 | ||
| 768 | + | if cret == 0 { | |
| 769 | + | return cls | |
| 770 | + | } | |
| 771 | + | gobject.IncreaseRef(cret) | |
| 772 | + | cls = >k.Widget{} | |
| 773 | + | cls.Ptr = cret | |
| 774 | + | return cls | |
| 782 | 775 | } | |
| 783 | 776 | ||
| 784 | 777 | var xLeafletPageGetName func(uintptr) string | |
| @@ -786,8 +779,8 @@ var xLeafletPageGetName func(uintptr) string | |||
| 786 | 779 | // Gets the name of @self. | |
| 787 | 780 | func (x *LeafletPage) GetName() string { | |
| 788 | 781 | ||
| 789 | - | return xLeafletPageGetName(x.GoPointer()) | |
| 790 | - | ||
| 782 | + | cret := xLeafletPageGetName(x.GoPointer()) | |
| 783 | + | return cret | |
| 791 | 784 | } | |
| 792 | 785 | ||
| 793 | 786 | var xLeafletPageGetNavigatable func(uintptr) bool | |
| @@ -795,8 +788,8 @@ var xLeafletPageGetNavigatable func(uintptr) bool | |||
| 795 | 788 | // Gets whether the child can be navigated to when folded. | |
| 796 | 789 | func (x *LeafletPage) GetNavigatable() bool { | |
| 797 | 790 | ||
| 798 | - | return xLeafletPageGetNavigatable(x.GoPointer()) | |
| 799 | - | ||
| 791 | + | cret := xLeafletPageGetNavigatable(x.GoPointer()) | |
| 792 | + | return cret | |
| 800 | 793 | } | |
| 801 | 794 | ||
| 802 | 795 | var xLeafletPageSetName func(uintptr, string) | |
M v4/adw/adw-main.go +2 -2
| @@ -31,8 +31,8 @@ var xIsInitialized func() bool | |||
| 31 | 31 | // [func@init]. | |
| 32 | 32 | func IsInitialized() bool { | |
| 33 | 33 | ||
| 34 | - | return xIsInitialized() | |
| 35 | - | ||
| 34 | + | cret := xIsInitialized() | |
| 35 | + | return cret | |
| 36 | 36 | } | |
| 37 | 37 | ||
| 38 | 38 | func init() { | |
M v4/adw/adw-message-dialog.go +80 -84
| @@ -204,16 +204,17 @@ var xNewMessageDialog func(uintptr, string, string) uintptr | |||
| 204 | 204 | // | |
| 205 | 205 | // ``` | |
| 206 | 206 | func NewMessageDialog(ParentVar *gtk.Window, HeadingVar string, BodyVar string) *gtk.Widget { | |
| 207 | - | NewMessageDialogPtr := xNewMessageDialog(ParentVar.GoPointer(), HeadingVar, BodyVar) | |
| 208 | - | if NewMessageDialogPtr == 0 { | |
| 209 | - | return nil | |
| 210 | - | } | |
| 207 | + | var cls *gtk.Widget | |
| 211 | 208 | ||
| 212 | - | gobject.IncreaseRef(NewMessageDialogPtr) | |
| 209 | + | cret := xNewMessageDialog(ParentVar.GoPointer(), HeadingVar, BodyVar) | |
| 213 | 210 | ||
| 214 | - | NewMessageDialogCls := >k.Widget{} | |
| 215 | - | NewMessageDialogCls.Ptr = NewMessageDialogPtr | |
| 216 | - | return NewMessageDialogCls | |
| 211 | + | if cret == 0 { | |
| 212 | + | return cls | |
| 213 | + | } | |
| 214 | + | gobject.IncreaseRef(cret) | |
| 215 | + | cls = >k.Widget{} | |
| 216 | + | cls.Ptr = cret | |
| 217 | + | return cls | |
| 217 | 218 | } | |
| 218 | 219 | ||
| 219 | 220 | var xMessageDialogAddResponse func(uintptr, string, string) | |
| @@ -282,8 +283,8 @@ var xMessageDialogChooseFinish func(uintptr, uintptr) string | |||
| 282 | 283 | // Finishes the [method@MessageDialog.choose] call and returns the response ID. | |
| 283 | 284 | func (x *MessageDialog) ChooseFinish(ResultVar gio.AsyncResult) string { | |
| 284 | 285 | ||
| 285 | - | return xMessageDialogChooseFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 286 | - | ||
| 286 | + | cret := xMessageDialogChooseFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 287 | + | return cret | |
| 287 | 288 | } | |
| 288 | 289 | ||
| 289 | 290 | var xMessageDialogFormatBody func(uintptr, string, ...interface{}) | |
| @@ -347,8 +348,8 @@ var xMessageDialogGetBody func(uintptr) string | |||
| 347 | 348 | // Gets the body text of @self. | |
| 348 | 349 | func (x *MessageDialog) GetBody() string { | |
| 349 | 350 | ||
| 350 | - | return xMessageDialogGetBody(x.GoPointer()) | |
| 351 | - | ||
| 351 | + | cret := xMessageDialogGetBody(x.GoPointer()) | |
| 352 | + | return cret | |
| 352 | 353 | } | |
| 353 | 354 | ||
| 354 | 355 | var xMessageDialogGetBodyUseMarkup func(uintptr) bool | |
| @@ -356,8 +357,8 @@ var xMessageDialogGetBodyUseMarkup func(uintptr) bool | |||
| 356 | 357 | // Gets whether the body text of @self includes Pango markup. | |
| 357 | 358 | func (x *MessageDialog) GetBodyUseMarkup() bool { | |
| 358 | 359 | ||
| 359 | - | return xMessageDialogGetBodyUseMarkup(x.GoPointer()) | |
| 360 | - | ||
| 360 | + | cret := xMessageDialogGetBodyUseMarkup(x.GoPointer()) | |
| 361 | + | return cret | |
| 361 | 362 | } | |
| 362 | 363 | ||
| 363 | 364 | var xMessageDialogGetCloseResponse func(uintptr) string | |
| @@ -365,8 +366,8 @@ var xMessageDialogGetCloseResponse func(uintptr) string | |||
| 365 | 366 | // Gets the ID of the close response of @self. | |
| 366 | 367 | func (x *MessageDialog) GetCloseResponse() string { | |
| 367 | 368 | ||
| 368 | - | return xMessageDialogGetCloseResponse(x.GoPointer()) | |
| 369 | - | ||
| 369 | + | cret := xMessageDialogGetCloseResponse(x.GoPointer()) | |
| 370 | + | return cret | |
| 370 | 371 | } | |
| 371 | 372 | ||
| 372 | 373 | var xMessageDialogGetDefaultResponse func(uintptr) string | |
| @@ -374,26 +375,25 @@ var xMessageDialogGetDefaultResponse func(uintptr) string | |||
| 374 | 375 | // Gets the ID of the default response of @self. | |
| 375 | 376 | func (x *MessageDialog) GetDefaultResponse() string { | |
| 376 | 377 | ||
| 377 | - | return xMessageDialogGetDefaultResponse(x.GoPointer()) | |
| 378 | - | ||
| 378 | + | cret := xMessageDialogGetDefaultResponse(x.GoPointer()) | |
| 379 | + | return cret | |
| 379 | 380 | } | |
| 380 | 381 | ||
| 381 | 382 | var xMessageDialogGetExtraChild func(uintptr) uintptr | |
| 382 | 383 | ||
| 383 | 384 | // Gets the child widget of @self. | |
| 384 | 385 | func (x *MessageDialog) GetExtraChild() *gtk.Widget { | |
| 386 | + | var cls *gtk.Widget | |
| 385 | 387 | ||
| 386 | - | GetExtraChildPtr := xMessageDialogGetExtraChild(x.GoPointer()) | |
| 387 | - | if GetExtraChildPtr == 0 { | |
| 388 | - | return nil | |
| 389 | - | } | |
| 390 | - | ||
| 391 | - | gobject.IncreaseRef(GetExtraChildPtr) | |
| 392 | - | ||
| 393 | - | GetExtraChildCls := >k.Widget{} | |
| 394 | - | GetExtraChildCls.Ptr = GetExtraChildPtr | |
| 395 | - | return GetExtraChildCls | |
| 388 | + | cret := xMessageDialogGetExtraChild(x.GoPointer()) | |
| 396 | 389 | ||
| 390 | + | if cret == 0 { | |
| 391 | + | return cls | |
| 392 | + | } | |
| 393 | + | gobject.IncreaseRef(cret) | |
| 394 | + | cls = >k.Widget{} | |
| 395 | + | cls.Ptr = cret | |
| 396 | + | return cls | |
| 397 | 397 | } | |
| 398 | 398 | ||
| 399 | 399 | var xMessageDialogGetHeading func(uintptr) string | |
| @@ -401,8 +401,8 @@ var xMessageDialogGetHeading func(uintptr) string | |||
| 401 | 401 | // Gets the heading of @self. | |
| 402 | 402 | func (x *MessageDialog) GetHeading() string { | |
| 403 | 403 | ||
| 404 | - | return xMessageDialogGetHeading(x.GoPointer()) | |
| 405 | - | ||
| 404 | + | cret := xMessageDialogGetHeading(x.GoPointer()) | |
| 405 | + | return cret | |
| 406 | 406 | } | |
| 407 | 407 | ||
| 408 | 408 | var xMessageDialogGetHeadingUseMarkup func(uintptr) bool | |
| @@ -410,8 +410,8 @@ var xMessageDialogGetHeadingUseMarkup func(uintptr) bool | |||
| 410 | 410 | // Gets whether the heading of @self includes Pango markup. | |
| 411 | 411 | func (x *MessageDialog) GetHeadingUseMarkup() bool { | |
| 412 | 412 | ||
| 413 | - | return xMessageDialogGetHeadingUseMarkup(x.GoPointer()) | |
| 414 | - | ||
| 413 | + | cret := xMessageDialogGetHeadingUseMarkup(x.GoPointer()) | |
| 414 | + | return cret | |
| 415 | 415 | } | |
| 416 | 416 | ||
| 417 | 417 | var xMessageDialogGetResponseAppearance func(uintptr, string) ResponseAppearance | |
| @@ -421,8 +421,8 @@ var xMessageDialogGetResponseAppearance func(uintptr, string) ResponseAppearance | |||
| 421 | 421 | // See [method@MessageDialog.set_response_appearance]. | |
| 422 | 422 | func (x *MessageDialog) GetResponseAppearance(ResponseVar string) ResponseAppearance { | |
| 423 | 423 | ||
| 424 | - | return xMessageDialogGetResponseAppearance(x.GoPointer(), ResponseVar) | |
| 425 | - | ||
| 424 | + | cret := xMessageDialogGetResponseAppearance(x.GoPointer(), ResponseVar) | |
| 425 | + | return cret | |
| 426 | 426 | } | |
| 427 | 427 | ||
| 428 | 428 | var xMessageDialogGetResponseEnabled func(uintptr, string) bool | |
| @@ -432,8 +432,8 @@ var xMessageDialogGetResponseEnabled func(uintptr, string) bool | |||
| 432 | 432 | // See [method@MessageDialog.set_response_enabled]. | |
| 433 | 433 | func (x *MessageDialog) GetResponseEnabled(ResponseVar string) bool { | |
| 434 | 434 | ||
| 435 | - | return xMessageDialogGetResponseEnabled(x.GoPointer(), ResponseVar) | |
| 436 | - | ||
| 435 | + | cret := xMessageDialogGetResponseEnabled(x.GoPointer(), ResponseVar) | |
| 436 | + | return cret | |
| 437 | 437 | } | |
| 438 | 438 | ||
| 439 | 439 | var xMessageDialogGetResponseLabel func(uintptr, string) string | |
| @@ -443,8 +443,8 @@ var xMessageDialogGetResponseLabel func(uintptr, string) string | |||
| 443 | 443 | // See [method@MessageDialog.set_response_label]. | |
| 444 | 444 | func (x *MessageDialog) GetResponseLabel(ResponseVar string) string { | |
| 445 | 445 | ||
| 446 | - | return xMessageDialogGetResponseLabel(x.GoPointer(), ResponseVar) | |
| 447 | - | ||
| 446 | + | cret := xMessageDialogGetResponseLabel(x.GoPointer(), ResponseVar) | |
| 447 | + | return cret | |
| 448 | 448 | } | |
| 449 | 449 | ||
| 450 | 450 | var xMessageDialogHasResponse func(uintptr, string) bool | |
| @@ -452,8 +452,8 @@ var xMessageDialogHasResponse func(uintptr, string) bool | |||
| 452 | 452 | // Gets whether @self has a response with the ID @response. | |
| 453 | 453 | func (x *MessageDialog) HasResponse(ResponseVar string) bool { | |
| 454 | 454 | ||
| 455 | - | return xMessageDialogHasResponse(x.GoPointer(), ResponseVar) | |
| 456 | - | ||
| 455 | + | cret := xMessageDialogHasResponse(x.GoPointer(), ResponseVar) | |
| 456 | + | return cret | |
| 457 | 457 | } | |
| 458 | 458 | ||
| 459 | 459 | var xMessageDialogResponse func(uintptr, string) | |
| @@ -635,8 +635,8 @@ func (x *MessageDialog) ConnectResponse(cb func(MessageDialog, string)) { | |||
| 635 | 635 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 636 | 636 | func (x *MessageDialog) GetAccessibleRole() gtk.AccessibleRole { | |
| 637 | 637 | ||
| 638 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 639 | - | ||
| 638 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 639 | + | return cret | |
| 640 | 640 | } | |
| 641 | 641 | ||
| 642 | 642 | // Resets the accessible @property to its default value. | |
| @@ -771,40 +771,38 @@ func (x *MessageDialog) UpdateStateValue(NStatesVar int, StatesVar uintptr, Valu | |||
| 771 | 771 | // of the <object> tag used to construct the @buildable. | |
| 772 | 772 | func (x *MessageDialog) GetBuildableId() string { | |
| 773 | 773 | ||
| 774 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 775 | - | ||
| 774 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 775 | + | return cret | |
| 776 | 776 | } | |
| 777 | 777 | ||
| 778 | 778 | // Returns the renderer that is used for this `GtkNative`. | |
| 779 | 779 | func (x *MessageDialog) GetRenderer() *gsk.Renderer { | |
| 780 | + | var cls *gsk.Renderer | |
| 780 | 781 | ||
| 781 | - | GetRendererPtr := gtk.XGtkNativeGetRenderer(x.GoPointer()) | |
| 782 | - | if GetRendererPtr == 0 { | |
| 783 | - | return nil | |
| 784 | - | } | |
| 785 | - | ||
| 786 | - | gobject.IncreaseRef(GetRendererPtr) | |
| 787 | - | ||
| 788 | - | GetRendererCls := &gsk.Renderer{} | |
| 789 | - | GetRendererCls.Ptr = GetRendererPtr | |
| 790 | - | return GetRendererCls | |
| 782 | + | cret := gtk.XGtkNativeGetRenderer(x.GoPointer()) | |
| 791 | 783 | ||
| 784 | + | if cret == 0 { | |
| 785 | + | return cls | |
| 786 | + | } | |
| 787 | + | gobject.IncreaseRef(cret) | |
| 788 | + | cls = &gsk.Renderer{} | |
| 789 | + | cls.Ptr = cret | |
| 790 | + | return cls | |
| 792 | 791 | } | |
| 793 | 792 | ||
| 794 | 793 | // Returns the surface of this `GtkNative`. | |
| 795 | 794 | func (x *MessageDialog) GetSurface() *gdk.Surface { | |
| 795 | + | var cls *gdk.Surface | |
| 796 | 796 | ||
| 797 | - | GetSurfacePtr := gtk.XGtkNativeGetSurface(x.GoPointer()) | |
| 798 | - | if GetSurfacePtr == 0 { | |
| 799 | - | return nil | |
| 800 | - | } | |
| 801 | - | ||
| 802 | - | gobject.IncreaseRef(GetSurfacePtr) | |
| 803 | - | ||
| 804 | - | GetSurfaceCls := &gdk.Surface{} | |
| 805 | - | GetSurfaceCls.Ptr = GetSurfacePtr | |
| 806 | - | return GetSurfaceCls | |
| 797 | + | cret := gtk.XGtkNativeGetSurface(x.GoPointer()) | |
| 807 | 798 | ||
| 799 | + | if cret == 0 { | |
| 800 | + | return cls | |
| 801 | + | } | |
| 802 | + | gobject.IncreaseRef(cret) | |
| 803 | + | cls = &gdk.Surface{} | |
| 804 | + | cls.Ptr = cret | |
| 805 | + | return cls | |
| 808 | 806 | } | |
| 809 | 807 | ||
| 810 | 808 | // Retrieves the surface transform of @self. | |
| @@ -837,18 +835,17 @@ func (x *MessageDialog) Unrealize() { | |||
| 837 | 835 | ||
| 838 | 836 | // Returns the display that this `GtkRoot` is on. | |
| 839 | 837 | func (x *MessageDialog) GetDisplay() *gdk.Display { | |
| 838 | + | var cls *gdk.Display | |
| 840 | 839 | ||
| 841 | - | GetDisplayPtr := gtk.XGtkRootGetDisplay(x.GoPointer()) | |
| 842 | - | if GetDisplayPtr == 0 { | |
| 843 | - | return nil | |
| 844 | - | } | |
| 845 | - | ||
| 846 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 847 | - | ||
| 848 | - | GetDisplayCls := &gdk.Display{} | |
| 849 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 850 | - | return GetDisplayCls | |
| 840 | + | cret := gtk.XGtkRootGetDisplay(x.GoPointer()) | |
| 851 | 841 | ||
| 842 | + | if cret == 0 { | |
| 843 | + | return cls | |
| 844 | + | } | |
| 845 | + | gobject.IncreaseRef(cret) | |
| 846 | + | cls = &gdk.Display{} | |
| 847 | + | cls.Ptr = cret | |
| 848 | + | return cls | |
| 852 | 849 | } | |
| 853 | 850 | ||
| 854 | 851 | // Retrieves the current focused widget within the root. | |
| @@ -858,18 +855,17 @@ func (x *MessageDialog) GetDisplay() *gdk.Display { | |||
| 858 | 855 | // `gtk_widget_has_focus (widget)` will be %FALSE for the | |
| 859 | 856 | // widget. | |
| 860 | 857 | func (x *MessageDialog) GetFocus() *gtk.Widget { | |
| 858 | + | var cls *gtk.Widget | |
| 861 | 859 | ||
| 862 | - | GetFocusPtr := gtk.XGtkRootGetFocus(x.GoPointer()) | |
| 863 | - | if GetFocusPtr == 0 { | |
| 864 | - | return nil | |
| 865 | - | } | |
| 866 | - | ||
| 867 | - | gobject.IncreaseRef(GetFocusPtr) | |
| 868 | - | ||
| 869 | - | GetFocusCls := >k.Widget{} | |
| 870 | - | GetFocusCls.Ptr = GetFocusPtr | |
| 871 | - | return GetFocusCls | |
| 860 | + | cret := gtk.XGtkRootGetFocus(x.GoPointer()) | |
| 872 | 861 | ||
| 862 | + | if cret == 0 { | |
| 863 | + | return cls | |
| 864 | + | } | |
| 865 | + | gobject.IncreaseRef(cret) | |
| 866 | + | cls = >k.Widget{} | |
| 867 | + | cls.Ptr = cret | |
| 868 | + | return cls | |
| 873 | 869 | } | |
| 874 | 870 | ||
| 875 | 871 | // If @focus is not the current focus widget, and is focusable, sets | |
M v4/adw/adw-password-entry-row.go +44 -44
| @@ -48,16 +48,17 @@ var xNewPasswordEntryRow func() uintptr | |||
| 48 | 48 | ||
| 49 | 49 | // Creates a new `AdwPasswordEntryRow`. | |
| 50 | 50 | func NewPasswordEntryRow() *gtk.Widget { | |
| 51 | - | NewPasswordEntryRowPtr := xNewPasswordEntryRow() | |
| 52 | - | if NewPasswordEntryRowPtr == 0 { | |
| 53 | - | return nil | |
| 54 | - | } | |
| 51 | + | var cls *gtk.Widget | |
| 55 | 52 | ||
| 56 | - | gobject.IncreaseRef(NewPasswordEntryRowPtr) | |
| 53 | + | cret := xNewPasswordEntryRow() | |
| 57 | 54 | ||
| 58 | - | NewPasswordEntryRowCls := >k.Widget{} | |
| 59 | - | NewPasswordEntryRowCls.Ptr = NewPasswordEntryRowPtr | |
| 60 | - | return NewPasswordEntryRowCls | |
| 55 | + | if cret == 0 { | |
| 56 | + | return cls | |
| 57 | + | } | |
| 58 | + | gobject.IncreaseRef(cret) | |
| 59 | + | cls = >k.Widget{} | |
| 60 | + | cls.Ptr = cret | |
| 61 | + | return cls | |
| 61 | 62 | } | |
| 62 | 63 | ||
| 63 | 64 | func (c *PasswordEntryRow) GoPointer() uintptr { | |
| @@ -71,8 +72,8 @@ func (c *PasswordEntryRow) SetGoPointer(ptr uintptr) { | |||
| 71 | 72 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 72 | 73 | func (x *PasswordEntryRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 73 | 74 | ||
| 74 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 75 | - | ||
| 75 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 76 | + | return cret | |
| 76 | 77 | } | |
| 77 | 78 | ||
| 78 | 79 | // Resets the accessible @property to its default value. | |
| @@ -204,15 +205,15 @@ func (x *PasswordEntryRow) UpdateStateValue(NStatesVar int, StatesVar uintptr, V | |||
| 204 | 205 | // Gets the action name for @actionable. | |
| 205 | 206 | func (x *PasswordEntryRow) GetActionName() string { | |
| 206 | 207 | ||
| 207 | - | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 208 | - | ||
| 208 | + | cret := gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 209 | + | return cret | |
| 209 | 210 | } | |
| 210 | 211 | ||
| 211 | 212 | // Gets the current target value of @actionable. | |
| 212 | 213 | func (x *PasswordEntryRow) GetActionTargetValue() *glib.Variant { | |
| 213 | 214 | ||
| 214 | - | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 215 | - | ||
| 215 | + | cret := gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 216 | + | return cret | |
| 216 | 217 | } | |
| 217 | 218 | ||
| 218 | 219 | // Specifies the name of the action with which this widget should be | |
| @@ -290,8 +291,8 @@ func (x *PasswordEntryRow) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 290 | 291 | // of the <object> tag used to construct the @buildable. | |
| 291 | 292 | func (x *PasswordEntryRow) GetBuildableId() string { | |
| 292 | 293 | ||
| 293 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 294 | - | ||
| 294 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 295 | + | return cret | |
| 295 | 296 | } | |
| 296 | 297 | ||
| 297 | 298 | // Deletes the currently selected text of the editable. | |
| @@ -330,8 +331,8 @@ func (x *PasswordEntryRow) FinishDelegate() { | |||
| 330 | 331 | // Gets the alignment of the editable. | |
| 331 | 332 | func (x *PasswordEntryRow) GetAlignment() float32 { | |
| 332 | 333 | ||
| 333 | - | return gtk.XGtkEditableGetAlignment(x.GoPointer()) | |
| 334 | - | ||
| 334 | + | cret := gtk.XGtkEditableGetAlignment(x.GoPointer()) | |
| 335 | + | return cret | |
| 335 | 336 | } | |
| 336 | 337 | ||
| 337 | 338 | // Retrieves a sequence of characters. | |
| @@ -344,8 +345,8 @@ func (x *PasswordEntryRow) GetAlignment() float32 { | |||
| 344 | 345 | // Note that positions are specified in characters, not bytes. | |
| 345 | 346 | func (x *PasswordEntryRow) GetChars(StartPosVar int, EndPosVar int) string { | |
| 346 | 347 | ||
| 347 | - | return gtk.XGtkEditableGetChars(x.GoPointer(), StartPosVar, EndPosVar) | |
| 348 | - | ||
| 348 | + | cret := gtk.XGtkEditableGetChars(x.GoPointer(), StartPosVar, EndPosVar) | |
| 349 | + | return cret | |
| 349 | 350 | } | |
| 350 | 351 | ||
| 351 | 352 | // Gets the `GtkEditable` that @editable is delegating its | |
| @@ -353,39 +354,38 @@ func (x *PasswordEntryRow) GetChars(StartPosVar int, EndPosVar int) string { | |||
| 353 | 354 | // | |
| 354 | 355 | // Typically, the delegate is a [class@Gtk.Text] widget. | |
| 355 | 356 | func (x *PasswordEntryRow) GetDelegate() *gtk.EditableBase { | |
| 357 | + | var cls *gtk.EditableBase | |
| 356 | 358 | ||
| 357 | - | GetDelegatePtr := gtk.XGtkEditableGetDelegate(x.GoPointer()) | |
| 358 | - | if GetDelegatePtr == 0 { | |
| 359 | - | return nil | |
| 360 | - | } | |
| 361 | - | ||
| 362 | - | gobject.IncreaseRef(GetDelegatePtr) | |
| 363 | - | ||
| 364 | - | GetDelegateCls := >k.EditableBase{} | |
| 365 | - | GetDelegateCls.Ptr = GetDelegatePtr | |
| 366 | - | return GetDelegateCls | |
| 359 | + | cret := gtk.XGtkEditableGetDelegate(x.GoPointer()) | |
| 367 | 360 | ||
| 361 | + | if cret == 0 { | |
| 362 | + | return cls | |
| 363 | + | } | |
| 364 | + | gobject.IncreaseRef(cret) | |
| 365 | + | cls = >k.EditableBase{} | |
| 366 | + | cls.Ptr = cret | |
| 367 | + | return cls | |
| 368 | 368 | } | |
| 369 | 369 | ||
| 370 | 370 | // Retrieves whether @editable is editable. | |
| 371 | 371 | func (x *PasswordEntryRow) GetEditable() bool { | |
| 372 | 372 | ||
| 373 | - | return gtk.XGtkEditableGetEditable(x.GoPointer()) | |
| 374 | - | ||
| 373 | + | cret := gtk.XGtkEditableGetEditable(x.GoPointer()) | |
| 374 | + | return cret | |
| 375 | 375 | } | |
| 376 | 376 | ||
| 377 | 377 | // Gets if undo/redo actions are enabled for @editable | |
| 378 | 378 | func (x *PasswordEntryRow) GetEnableUndo() bool { | |
| 379 | 379 | ||
| 380 | - | return gtk.XGtkEditableGetEnableUndo(x.GoPointer()) | |
| 381 | - | ||
| 380 | + | cret := gtk.XGtkEditableGetEnableUndo(x.GoPointer()) | |
| 381 | + | return cret | |
| 382 | 382 | } | |
| 383 | 383 | ||
| 384 | 384 | // Retrieves the desired maximum width of @editable, in characters. | |
| 385 | 385 | func (x *PasswordEntryRow) GetMaxWidthChars() int { | |
| 386 | 386 | ||
| 387 | - | return gtk.XGtkEditableGetMaxWidthChars(x.GoPointer()) | |
| 388 | - | ||
| 387 | + | cret := gtk.XGtkEditableGetMaxWidthChars(x.GoPointer()) | |
| 388 | + | return cret | |
| 389 | 389 | } | |
| 390 | 390 | ||
| 391 | 391 | // Retrieves the current position of the cursor relative | |
| @@ -394,8 +394,8 @@ func (x *PasswordEntryRow) GetMaxWidthChars() int { | |||
| 394 | 394 | // Note that this position is in characters, not in bytes. | |
| 395 | 395 | func (x *PasswordEntryRow) GetPosition() int { | |
| 396 | 396 | ||
| 397 | - | return gtk.XGtkEditableGetPosition(x.GoPointer()) | |
| 398 | - | ||
| 397 | + | cret := gtk.XGtkEditableGetPosition(x.GoPointer()) | |
| 398 | + | return cret | |
| 399 | 399 | } | |
| 400 | 400 | ||
| 401 | 401 | // Retrieves the selection bound of the editable. | |
| @@ -407,8 +407,8 @@ func (x *PasswordEntryRow) GetPosition() int { | |||
| 407 | 407 | // Note that positions are specified in characters, not bytes. | |
| 408 | 408 | func (x *PasswordEntryRow) GetSelectionBounds(StartPosVar int, EndPosVar int) bool { | |
| 409 | 409 | ||
| 410 | - | return gtk.XGtkEditableGetSelectionBounds(x.GoPointer(), StartPosVar, EndPosVar) | |
| 411 | - | ||
| 410 | + | cret := gtk.XGtkEditableGetSelectionBounds(x.GoPointer(), StartPosVar, EndPosVar) | |
| 411 | + | return cret | |
| 412 | 412 | } | |
| 413 | 413 | ||
| 414 | 414 | // Retrieves the contents of @editable. | |
| @@ -416,16 +416,16 @@ func (x *PasswordEntryRow) GetSelectionBounds(StartPosVar int, EndPosVar int) bo | |||
| 416 | 416 | // The returned string is owned by GTK and must not be modified or freed. | |
| 417 | 417 | func (x *PasswordEntryRow) GetText() string { | |
| 418 | 418 | ||
| 419 | - | return gtk.XGtkEditableGetText(x.GoPointer()) | |
| 420 | - | ||
| 419 | + | cret := gtk.XGtkEditableGetText(x.GoPointer()) | |
| 420 | + | return cret | |
| 421 | 421 | } | |
| 422 | 422 | ||
| 423 | 423 | // Gets the number of characters of space reserved | |
| 424 | 424 | // for the contents of the editable. | |
| 425 | 425 | func (x *PasswordEntryRow) GetWidthChars() int { | |
| 426 | 426 | ||
| 427 | - | return gtk.XGtkEditableGetWidthChars(x.GoPointer()) | |
| 428 | - | ||
| 427 | + | cret := gtk.XGtkEditableGetWidthChars(x.GoPointer()) | |
| 428 | + | return cret | |
| 429 | 429 | } | |
| 430 | 430 | ||
| 431 | 431 | // Sets up a delegate for `GtkEditable`. | |
M v4/adw/adw-preferences-group.go +26 -26
| @@ -61,16 +61,17 @@ var xNewPreferencesGroup func() uintptr | |||
| 61 | 61 | ||
| 62 | 62 | // Creates a new `AdwPreferencesGroup`. | |
| 63 | 63 | func NewPreferencesGroup() *gtk.Widget { | |
| 64 | - | NewPreferencesGroupPtr := xNewPreferencesGroup() | |
| 65 | - | if NewPreferencesGroupPtr == 0 { | |
| 66 | - | return nil | |
| 67 | - | } | |
| 64 | + | var cls *gtk.Widget | |
| 68 | 65 | ||
| 69 | - | gobject.IncreaseRef(NewPreferencesGroupPtr) | |
| 66 | + | cret := xNewPreferencesGroup() | |
| 70 | 67 | ||
| 71 | - | NewPreferencesGroupCls := >k.Widget{} | |
| 72 | - | NewPreferencesGroupCls.Ptr = NewPreferencesGroupPtr | |
| 73 | - | return NewPreferencesGroupCls | |
| 68 | + | if cret == 0 { | |
| 69 | + | return cls | |
| 70 | + | } | |
| 71 | + | gobject.IncreaseRef(cret) | |
| 72 | + | cls = >k.Widget{} | |
| 73 | + | cls.Ptr = cret | |
| 74 | + | return cls | |
| 74 | 75 | } | |
| 75 | 76 | ||
| 76 | 77 | var xPreferencesGroupAdd func(uintptr, uintptr) | |
| @@ -87,26 +88,25 @@ var xPreferencesGroupGetDescription func(uintptr) string | |||
| 87 | 88 | // Gets the description of @self. | |
| 88 | 89 | func (x *PreferencesGroup) GetDescription() string { | |
| 89 | 90 | ||
| 90 | - | return xPreferencesGroupGetDescription(x.GoPointer()) | |
| 91 | - | ||
| 91 | + | cret := xPreferencesGroupGetDescription(x.GoPointer()) | |
| 92 | + | return cret | |
| 92 | 93 | } | |
| 93 | 94 | ||
| 94 | 95 | var xPreferencesGroupGetHeaderSuffix func(uintptr) uintptr | |
| 95 | 96 | ||
| 96 | 97 | // Gets the suffix for @self's header. | |
| 97 | 98 | func (x *PreferencesGroup) GetHeaderSuffix() *gtk.Widget { | |
| 99 | + | var cls *gtk.Widget | |
| 98 | 100 | ||
| 99 | - | GetHeaderSuffixPtr := xPreferencesGroupGetHeaderSuffix(x.GoPointer()) | |
| 100 | - | if GetHeaderSuffixPtr == 0 { | |
| 101 | - | return nil | |
| 102 | - | } | |
| 103 | - | ||
| 104 | - | gobject.IncreaseRef(GetHeaderSuffixPtr) | |
| 105 | - | ||
| 106 | - | GetHeaderSuffixCls := >k.Widget{} | |
| 107 | - | GetHeaderSuffixCls.Ptr = GetHeaderSuffixPtr | |
| 108 | - | return GetHeaderSuffixCls | |
| 101 | + | cret := xPreferencesGroupGetHeaderSuffix(x.GoPointer()) | |
| 109 | 102 | ||
| 103 | + | if cret == 0 { | |
| 104 | + | return cls | |
| 105 | + | } | |
| 106 | + | gobject.IncreaseRef(cret) | |
| 107 | + | cls = >k.Widget{} | |
| 108 | + | cls.Ptr = cret | |
| 109 | + | return cls | |
| 110 | 110 | } | |
| 111 | 111 | ||
| 112 | 112 | var xPreferencesGroupGetTitle func(uintptr) string | |
| @@ -114,8 +114,8 @@ var xPreferencesGroupGetTitle func(uintptr) string | |||
| 114 | 114 | // Gets the title of @self. | |
| 115 | 115 | func (x *PreferencesGroup) GetTitle() string { | |
| 116 | 116 | ||
| 117 | - | return xPreferencesGroupGetTitle(x.GoPointer()) | |
| 118 | - | ||
| 117 | + | cret := xPreferencesGroupGetTitle(x.GoPointer()) | |
| 118 | + | return cret | |
| 119 | 119 | } | |
| 120 | 120 | ||
| 121 | 121 | var xPreferencesGroupRemove func(uintptr, uintptr) | |
| @@ -169,8 +169,8 @@ func (c *PreferencesGroup) SetGoPointer(ptr uintptr) { | |||
| 169 | 169 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 170 | 170 | func (x *PreferencesGroup) GetAccessibleRole() gtk.AccessibleRole { | |
| 171 | 171 | ||
| 172 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 173 | - | ||
| 172 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 173 | + | return cret | |
| 174 | 174 | } | |
| 175 | 175 | ||
| 176 | 176 | // Resets the accessible @property to its default value. | |
| @@ -305,8 +305,8 @@ func (x *PreferencesGroup) UpdateStateValue(NStatesVar int, StatesVar uintptr, V | |||
| 305 | 305 | // of the <object> tag used to construct the @buildable. | |
| 306 | 306 | func (x *PreferencesGroup) GetBuildableId() string { | |
| 307 | 307 | ||
| 308 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 309 | - | ||
| 308 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 309 | + | return cret | |
| 310 | 310 | } | |
| 311 | 311 | ||
| 312 | 312 | func init() { | |
M v4/adw/adw-preferences-page.go +21 -20
| @@ -47,16 +47,17 @@ var xNewPreferencesPage func() uintptr | |||
| 47 | 47 | ||
| 48 | 48 | // Creates a new `AdwPreferencesPage`. | |
| 49 | 49 | func NewPreferencesPage() *gtk.Widget { | |
| 50 | - | NewPreferencesPagePtr := xNewPreferencesPage() | |
| 51 | - | if NewPreferencesPagePtr == 0 { | |
| 52 | - | return nil | |
| 53 | - | } | |
| 50 | + | var cls *gtk.Widget | |
| 54 | 51 | ||
| 55 | - | gobject.IncreaseRef(NewPreferencesPagePtr) | |
| 52 | + | cret := xNewPreferencesPage() | |
| 56 | 53 | ||
| 57 | - | NewPreferencesPageCls := >k.Widget{} | |
| 58 | - | NewPreferencesPageCls.Ptr = NewPreferencesPagePtr | |
| 59 | - | return NewPreferencesPageCls | |
| 54 | + | if cret == 0 { | |
| 55 | + | return cls | |
| 56 | + | } | |
| 57 | + | gobject.IncreaseRef(cret) | |
| 58 | + | cls = >k.Widget{} | |
| 59 | + | cls.Ptr = cret | |
| 60 | + | return cls | |
| 60 | 61 | } | |
| 61 | 62 | ||
| 62 | 63 | var xPreferencesPageAdd func(uintptr, uintptr) | |
| @@ -73,8 +74,8 @@ var xPreferencesPageGetIconName func(uintptr) string | |||
| 73 | 74 | // Gets the icon name for @self. | |
| 74 | 75 | func (x *PreferencesPage) GetIconName() string { | |
| 75 | 76 | ||
| 76 | - | return xPreferencesPageGetIconName(x.GoPointer()) | |
| 77 | - | ||
| 77 | + | cret := xPreferencesPageGetIconName(x.GoPointer()) | |
| 78 | + | return cret | |
| 78 | 79 | } | |
| 79 | 80 | ||
| 80 | 81 | var xPreferencesPageGetName func(uintptr) string | |
| @@ -82,8 +83,8 @@ var xPreferencesPageGetName func(uintptr) string | |||
| 82 | 83 | // Gets the name of @self. | |
| 83 | 84 | func (x *PreferencesPage) GetName() string { | |
| 84 | 85 | ||
| 85 | - | return xPreferencesPageGetName(x.GoPointer()) | |
| 86 | - | ||
| 86 | + | cret := xPreferencesPageGetName(x.GoPointer()) | |
| 87 | + | return cret | |
| 87 | 88 | } | |
| 88 | 89 | ||
| 89 | 90 | var xPreferencesPageGetTitle func(uintptr) string | |
| @@ -91,8 +92,8 @@ var xPreferencesPageGetTitle func(uintptr) string | |||
| 91 | 92 | // Gets the title of @self. | |
| 92 | 93 | func (x *PreferencesPage) GetTitle() string { | |
| 93 | 94 | ||
| 94 | - | return xPreferencesPageGetTitle(x.GoPointer()) | |
| 95 | - | ||
| 95 | + | cret := xPreferencesPageGetTitle(x.GoPointer()) | |
| 96 | + | return cret | |
| 96 | 97 | } | |
| 97 | 98 | ||
| 98 | 99 | var xPreferencesPageGetUseUnderline func(uintptr) bool | |
| @@ -100,8 +101,8 @@ var xPreferencesPageGetUseUnderline func(uintptr) bool | |||
| 100 | 101 | // Gets whether an embedded underline in the title indicates a mnemonic. | |
| 101 | 102 | func (x *PreferencesPage) GetUseUnderline() bool { | |
| 102 | 103 | ||
| 103 | - | return xPreferencesPageGetUseUnderline(x.GoPointer()) | |
| 104 | - | ||
| 104 | + | cret := xPreferencesPageGetUseUnderline(x.GoPointer()) | |
| 105 | + | return cret | |
| 105 | 106 | } | |
| 106 | 107 | ||
| 107 | 108 | var xPreferencesPageRemove func(uintptr, uintptr) | |
| @@ -169,8 +170,8 @@ func (c *PreferencesPage) SetGoPointer(ptr uintptr) { | |||
| 169 | 170 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 170 | 171 | func (x *PreferencesPage) GetAccessibleRole() gtk.AccessibleRole { | |
| 171 | 172 | ||
| 172 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 173 | - | ||
| 173 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 174 | + | return cret | |
| 174 | 175 | } | |
| 175 | 176 | ||
| 176 | 177 | // Resets the accessible @property to its default value. | |
| @@ -305,8 +306,8 @@ func (x *PreferencesPage) UpdateStateValue(NStatesVar int, StatesVar uintptr, Va | |||
| 305 | 306 | // of the <object> tag used to construct the @buildable. | |
| 306 | 307 | func (x *PreferencesPage) GetBuildableId() string { | |
| 307 | 308 | ||
| 308 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 309 | - | ||
| 309 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 310 | + | return cret | |
| 310 | 311 | } | |
| 311 | 312 | ||
| 312 | 313 | func init() { | |
M v4/adw/adw-preferences-row.go +25 -24
| @@ -38,16 +38,17 @@ var xNewPreferencesRow func() uintptr | |||
| 38 | 38 | ||
| 39 | 39 | // Creates a new `AdwPreferencesRow`. | |
| 40 | 40 | func NewPreferencesRow() *gtk.Widget { | |
| 41 | - | NewPreferencesRowPtr := xNewPreferencesRow() | |
| 42 | - | if NewPreferencesRowPtr == 0 { | |
| 43 | - | return nil | |
| 44 | - | } | |
| 41 | + | var cls *gtk.Widget | |
| 45 | 42 | ||
| 46 | - | gobject.IncreaseRef(NewPreferencesRowPtr) | |
| 43 | + | cret := xNewPreferencesRow() | |
| 47 | 44 | ||
| 48 | - | NewPreferencesRowCls := >k.Widget{} | |
| 49 | - | NewPreferencesRowCls.Ptr = NewPreferencesRowPtr | |
| 50 | - | return NewPreferencesRowCls | |
| 45 | + | if cret == 0 { | |
| 46 | + | return cls | |
| 47 | + | } | |
| 48 | + | gobject.IncreaseRef(cret) | |
| 49 | + | cls = >k.Widget{} | |
| 50 | + | cls.Ptr = cret | |
| 51 | + | return cls | |
| 51 | 52 | } | |
| 52 | 53 | ||
| 53 | 54 | var xPreferencesRowGetTitle func(uintptr) string | |
| @@ -55,8 +56,8 @@ var xPreferencesRowGetTitle func(uintptr) string | |||
| 55 | 56 | // Gets the title of the preference represented by @self. | |
| 56 | 57 | func (x *PreferencesRow) GetTitle() string { | |
| 57 | 58 | ||
| 58 | - | return xPreferencesRowGetTitle(x.GoPointer()) | |
| 59 | - | ||
| 59 | + | cret := xPreferencesRowGetTitle(x.GoPointer()) | |
| 60 | + | return cret | |
| 60 | 61 | } | |
| 61 | 62 | ||
| 62 | 63 | var xPreferencesRowGetTitleSelectable func(uintptr) bool | |
| @@ -64,8 +65,8 @@ var xPreferencesRowGetTitleSelectable func(uintptr) bool | |||
| 64 | 65 | // Gets whether the user can copy the title from the label | |
| 65 | 66 | func (x *PreferencesRow) GetTitleSelectable() bool { | |
| 66 | 67 | ||
| 67 | - | return xPreferencesRowGetTitleSelectable(x.GoPointer()) | |
| 68 | - | ||
| 68 | + | cret := xPreferencesRowGetTitleSelectable(x.GoPointer()) | |
| 69 | + | return cret | |
| 69 | 70 | } | |
| 70 | 71 | ||
| 71 | 72 | var xPreferencesRowGetUseMarkup func(uintptr) bool | |
| @@ -73,8 +74,8 @@ var xPreferencesRowGetUseMarkup func(uintptr) bool | |||
| 73 | 74 | // Gets whether to use Pango markup for the title label. | |
| 74 | 75 | func (x *PreferencesRow) GetUseMarkup() bool { | |
| 75 | 76 | ||
| 76 | - | return xPreferencesRowGetUseMarkup(x.GoPointer()) | |
| 77 | - | ||
| 77 | + | cret := xPreferencesRowGetUseMarkup(x.GoPointer()) | |
| 78 | + | return cret | |
| 78 | 79 | } | |
| 79 | 80 | ||
| 80 | 81 | var xPreferencesRowGetUseUnderline func(uintptr) bool | |
| @@ -82,8 +83,8 @@ var xPreferencesRowGetUseUnderline func(uintptr) bool | |||
| 82 | 83 | // Gets whether an embedded underline in the title indicates a mnemonic. | |
| 83 | 84 | func (x *PreferencesRow) GetUseUnderline() bool { | |
| 84 | 85 | ||
| 85 | - | return xPreferencesRowGetUseUnderline(x.GoPointer()) | |
| 86 | - | ||
| 86 | + | cret := xPreferencesRowGetUseUnderline(x.GoPointer()) | |
| 87 | + | return cret | |
| 87 | 88 | } | |
| 88 | 89 | ||
| 89 | 90 | var xPreferencesRowSetTitle func(uintptr, string) | |
| @@ -142,8 +143,8 @@ func (c *PreferencesRow) SetGoPointer(ptr uintptr) { | |||
| 142 | 143 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 143 | 144 | func (x *PreferencesRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 144 | 145 | ||
| 145 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 146 | - | ||
| 146 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 147 | + | return cret | |
| 147 | 148 | } | |
| 148 | 149 | ||
| 149 | 150 | // Resets the accessible @property to its default value. | |
| @@ -275,15 +276,15 @@ func (x *PreferencesRow) UpdateStateValue(NStatesVar int, StatesVar uintptr, Val | |||
| 275 | 276 | // Gets the action name for @actionable. | |
| 276 | 277 | func (x *PreferencesRow) GetActionName() string { | |
| 277 | 278 | ||
| 278 | - | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 279 | - | ||
| 279 | + | cret := gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 280 | + | return cret | |
| 280 | 281 | } | |
| 281 | 282 | ||
| 282 | 283 | // Gets the current target value of @actionable. | |
| 283 | 284 | func (x *PreferencesRow) GetActionTargetValue() *glib.Variant { | |
| 284 | 285 | ||
| 285 | - | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 286 | - | ||
| 286 | + | cret := gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 287 | + | return cret | |
| 287 | 288 | } | |
| 288 | 289 | ||
| 289 | 290 | // Specifies the name of the action with which this widget should be | |
| @@ -361,8 +362,8 @@ func (x *PreferencesRow) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 361 | 362 | // of the <object> tag used to construct the @buildable. | |
| 362 | 363 | func (x *PreferencesRow) GetBuildableId() string { | |
| 363 | 364 | ||
| 364 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 365 | - | ||
| 365 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 366 | + | return cret | |
| 366 | 367 | } | |
| 367 | 368 | ||
| 368 | 369 | func init() { | |
M v4/adw/adw-preferences-window.go +64 -68
| @@ -46,16 +46,17 @@ var xNewPreferencesWindow func() uintptr | |||
| 46 | 46 | ||
| 47 | 47 | // Creates a new `AdwPreferencesWindow`. | |
| 48 | 48 | func NewPreferencesWindow() *gtk.Widget { | |
| 49 | - | NewPreferencesWindowPtr := xNewPreferencesWindow() | |
| 50 | - | if NewPreferencesWindowPtr == 0 { | |
| 51 | - | return nil | |
| 52 | - | } | |
| 49 | + | var cls *gtk.Widget | |
| 53 | 50 | ||
| 54 | - | gobject.IncreaseRef(NewPreferencesWindowPtr) | |
| 51 | + | cret := xNewPreferencesWindow() | |
| 55 | 52 | ||
| 56 | - | NewPreferencesWindowCls := >k.Widget{} | |
| 57 | - | NewPreferencesWindowCls.Ptr = NewPreferencesWindowPtr | |
| 58 | - | return NewPreferencesWindowCls | |
| 53 | + | if cret == 0 { | |
| 54 | + | return cls | |
| 55 | + | } | |
| 56 | + | gobject.IncreaseRef(cret) | |
| 57 | + | cls = >k.Widget{} | |
| 58 | + | cls.Ptr = cret | |
| 59 | + | return cls | |
| 59 | 60 | } | |
| 60 | 61 | ||
| 61 | 62 | var xPreferencesWindowAdd func(uintptr, uintptr) | |
| @@ -94,8 +95,8 @@ var xPreferencesWindowGetCanNavigateBack func(uintptr) bool | |||
| 94 | 95 | // Gets whether gestures and shortcuts for closing subpages are enabled. | |
| 95 | 96 | func (x *PreferencesWindow) GetCanNavigateBack() bool { | |
| 96 | 97 | ||
| 97 | - | return xPreferencesWindowGetCanNavigateBack(x.GoPointer()) | |
| 98 | - | ||
| 98 | + | cret := xPreferencesWindowGetCanNavigateBack(x.GoPointer()) | |
| 99 | + | return cret | |
| 99 | 100 | } | |
| 100 | 101 | ||
| 101 | 102 | var xPreferencesWindowGetSearchEnabled func(uintptr) bool | |
| @@ -103,26 +104,25 @@ var xPreferencesWindowGetSearchEnabled func(uintptr) bool | |||
| 103 | 104 | // Gets whether search is enabled for @self. | |
| 104 | 105 | func (x *PreferencesWindow) GetSearchEnabled() bool { | |
| 105 | 106 | ||
| 106 | - | return xPreferencesWindowGetSearchEnabled(x.GoPointer()) | |
| 107 | - | ||
| 107 | + | cret := xPreferencesWindowGetSearchEnabled(x.GoPointer()) | |
| 108 | + | return cret | |
| 108 | 109 | } | |
| 109 | 110 | ||
| 110 | 111 | var xPreferencesWindowGetVisiblePage func(uintptr) uintptr | |
| 111 | 112 | ||
| 112 | 113 | // Gets the currently visible page of @self. | |
| 113 | 114 | func (x *PreferencesWindow) GetVisiblePage() *PreferencesPage { | |
| 115 | + | var cls *PreferencesPage | |
| 114 | 116 | ||
| 115 | - | GetVisiblePagePtr := xPreferencesWindowGetVisiblePage(x.GoPointer()) | |
| 116 | - | if GetVisiblePagePtr == 0 { | |
| 117 | - | return nil | |
| 118 | - | } | |
| 119 | - | ||
| 120 | - | gobject.IncreaseRef(GetVisiblePagePtr) | |
| 121 | - | ||
| 122 | - | GetVisiblePageCls := &PreferencesPage{} | |
| 123 | - | GetVisiblePageCls.Ptr = GetVisiblePagePtr | |
| 124 | - | return GetVisiblePageCls | |
| 117 | + | cret := xPreferencesWindowGetVisiblePage(x.GoPointer()) | |
| 125 | 118 | ||
| 119 | + | if cret == 0 { | |
| 120 | + | return cls | |
| 121 | + | } | |
| 122 | + | gobject.IncreaseRef(cret) | |
| 123 | + | cls = &PreferencesPage{} | |
| 124 | + | cls.Ptr = cret | |
| 125 | + | return cls | |
| 126 | 126 | } | |
| 127 | 127 | ||
| 128 | 128 | var xPreferencesWindowGetVisiblePageName func(uintptr) string | |
| @@ -130,8 +130,8 @@ var xPreferencesWindowGetVisiblePageName func(uintptr) string | |||
| 130 | 130 | // Gets the name of currently visible page of @self. | |
| 131 | 131 | func (x *PreferencesWindow) GetVisiblePageName() string { | |
| 132 | 132 | ||
| 133 | - | return xPreferencesWindowGetVisiblePageName(x.GoPointer()) | |
| 134 | - | ||
| 133 | + | cret := xPreferencesWindowGetVisiblePageName(x.GoPointer()) | |
| 134 | + | return cret | |
| 135 | 135 | } | |
| 136 | 136 | ||
| 137 | 137 | var xPreferencesWindowPresentSubpage func(uintptr, uintptr) | |
| @@ -215,8 +215,8 @@ func (c *PreferencesWindow) SetGoPointer(ptr uintptr) { | |||
| 215 | 215 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 216 | 216 | func (x *PreferencesWindow) GetAccessibleRole() gtk.AccessibleRole { | |
| 217 | 217 | ||
| 218 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 219 | - | ||
| 218 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 219 | + | return cret | |
| 220 | 220 | } | |
| 221 | 221 | ||
| 222 | 222 | // Resets the accessible @property to its default value. | |
| @@ -351,40 +351,38 @@ func (x *PreferencesWindow) UpdateStateValue(NStatesVar int, StatesVar uintptr, | |||
| 351 | 351 | // of the <object> tag used to construct the @buildable. | |
| 352 | 352 | func (x *PreferencesWindow) GetBuildableId() string { | |
| 353 | 353 | ||
| 354 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 355 | - | ||
| 354 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 355 | + | return cret | |
| 356 | 356 | } | |
| 357 | 357 | ||
| 358 | 358 | // Returns the renderer that is used for this `GtkNative`. | |
| 359 | 359 | func (x *PreferencesWindow) GetRenderer() *gsk.Renderer { | |
| 360 | + | var cls *gsk.Renderer | |
| 360 | 361 | ||
| 361 | - | GetRendererPtr := gtk.XGtkNativeGetRenderer(x.GoPointer()) | |
| 362 | - | if GetRendererPtr == 0 { | |
| 363 | - | return nil | |
| 364 | - | } | |
| 365 | - | ||
| 366 | - | gobject.IncreaseRef(GetRendererPtr) | |
| 367 | - | ||
| 368 | - | GetRendererCls := &gsk.Renderer{} | |
| 369 | - | GetRendererCls.Ptr = GetRendererPtr | |
| 370 | - | return GetRendererCls | |
| 362 | + | cret := gtk.XGtkNativeGetRenderer(x.GoPointer()) | |
| 371 | 363 | ||
| 364 | + | if cret == 0 { | |
| 365 | + | return cls | |
| 366 | + | } | |
| 367 | + | gobject.IncreaseRef(cret) | |
| 368 | + | cls = &gsk.Renderer{} | |
| 369 | + | cls.Ptr = cret | |
| 370 | + | return cls | |
| 372 | 371 | } | |
| 373 | 372 | ||
| 374 | 373 | // Returns the surface of this `GtkNative`. | |
| 375 | 374 | func (x *PreferencesWindow) GetSurface() *gdk.Surface { | |
| 375 | + | var cls *gdk.Surface | |
| 376 | 376 | ||
| 377 | - | GetSurfacePtr := gtk.XGtkNativeGetSurface(x.GoPointer()) | |
| 378 | - | if GetSurfacePtr == 0 { | |
| 379 | - | return nil | |
| 380 | - | } | |
| 381 | - | ||
| 382 | - | gobject.IncreaseRef(GetSurfacePtr) | |
| 383 | - | ||
| 384 | - | GetSurfaceCls := &gdk.Surface{} | |
| 385 | - | GetSurfaceCls.Ptr = GetSurfacePtr | |
| 386 | - | return GetSurfaceCls | |
| 377 | + | cret := gtk.XGtkNativeGetSurface(x.GoPointer()) | |
| 387 | 378 | ||
| 379 | + | if cret == 0 { | |
| 380 | + | return cls | |
| 381 | + | } | |
| 382 | + | gobject.IncreaseRef(cret) | |
| 383 | + | cls = &gdk.Surface{} | |
| 384 | + | cls.Ptr = cret | |
| 385 | + | return cls | |
| 388 | 386 | } | |
| 389 | 387 | ||
| 390 | 388 | // Retrieves the surface transform of @self. | |
| @@ -417,18 +415,17 @@ func (x *PreferencesWindow) Unrealize() { | |||
| 417 | 415 | ||
| 418 | 416 | // Returns the display that this `GtkRoot` is on. | |
| 419 | 417 | func (x *PreferencesWindow) GetDisplay() *gdk.Display { | |
| 418 | + | var cls *gdk.Display | |
| 420 | 419 | ||
| 421 | - | GetDisplayPtr := gtk.XGtkRootGetDisplay(x.GoPointer()) | |
| 422 | - | if GetDisplayPtr == 0 { | |
| 423 | - | return nil | |
| 424 | - | } | |
| 425 | - | ||
| 426 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 427 | - | ||
| 428 | - | GetDisplayCls := &gdk.Display{} | |
| 429 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 430 | - | return GetDisplayCls | |
| 420 | + | cret := gtk.XGtkRootGetDisplay(x.GoPointer()) | |
| 431 | 421 | ||
| 422 | + | if cret == 0 { | |
| 423 | + | return cls | |
| 424 | + | } | |
| 425 | + | gobject.IncreaseRef(cret) | |
| 426 | + | cls = &gdk.Display{} | |
| 427 | + | cls.Ptr = cret | |
| 428 | + | return cls | |
| 432 | 429 | } | |
| 433 | 430 | ||
| 434 | 431 | // Retrieves the current focused widget within the root. | |
| @@ -438,18 +435,17 @@ func (x *PreferencesWindow) GetDisplay() *gdk.Display { | |||
| 438 | 435 | // `gtk_widget_has_focus (widget)` will be %FALSE for the | |
| 439 | 436 | // widget. | |
| 440 | 437 | func (x *PreferencesWindow) GetFocus() *gtk.Widget { | |
| 438 | + | var cls *gtk.Widget | |
| 441 | 439 | ||
| 442 | - | GetFocusPtr := gtk.XGtkRootGetFocus(x.GoPointer()) | |
| 443 | - | if GetFocusPtr == 0 { | |
| 444 | - | return nil | |
| 445 | - | } | |
| 446 | - | ||
| 447 | - | gobject.IncreaseRef(GetFocusPtr) | |
| 448 | - | ||
| 449 | - | GetFocusCls := >k.Widget{} | |
| 450 | - | GetFocusCls.Ptr = GetFocusPtr | |
| 451 | - | return GetFocusCls | |
| 440 | + | cret := gtk.XGtkRootGetFocus(x.GoPointer()) | |
| 452 | 441 | ||
| 442 | + | if cret == 0 { | |
| 443 | + | return cls | |
| 444 | + | } | |
| 445 | + | gobject.IncreaseRef(cret) | |
| 446 | + | cls = >k.Widget{} | |
| 447 | + | cls.Ptr = cret | |
| 448 | + | return cls | |
| 453 | 449 | } | |
| 454 | 450 | ||
| 455 | 451 | // If @focus is not the current focus widget, and is focusable, sets | |
M v4/adw/adw-split-button.go +54 -56
| @@ -68,34 +68,34 @@ var xNewSplitButton func() uintptr | |||
| 68 | 68 | ||
| 69 | 69 | // Creates a new `AdwSplitButton`. | |
| 70 | 70 | func NewSplitButton() *gtk.Widget { | |
| 71 | - | NewSplitButtonPtr := xNewSplitButton() | |
| 72 | - | if NewSplitButtonPtr == 0 { | |
| 73 | - | return nil | |
| 74 | - | } | |
| 71 | + | var cls *gtk.Widget | |
| 75 | 72 | ||
| 76 | - | gobject.IncreaseRef(NewSplitButtonPtr) | |
| 73 | + | cret := xNewSplitButton() | |
| 77 | 74 | ||
| 78 | - | NewSplitButtonCls := >k.Widget{} | |
| 79 | - | NewSplitButtonCls.Ptr = NewSplitButtonPtr | |
| 80 | - | return NewSplitButtonCls | |
| 75 | + | if cret == 0 { | |
| 76 | + | return cls | |
| 77 | + | } | |
| 78 | + | gobject.IncreaseRef(cret) | |
| 79 | + | cls = >k.Widget{} | |
| 80 | + | cls.Ptr = cret | |
| 81 | + | return cls | |
| 81 | 82 | } | |
| 82 | 83 | ||
| 83 | 84 | var xSplitButtonGetChild func(uintptr) uintptr | |
| 84 | 85 | ||
| 85 | 86 | // Gets the child widget. | |
| 86 | 87 | func (x *SplitButton) GetChild() *gtk.Widget { | |
| 88 | + | var cls *gtk.Widget | |
| 87 | 89 | ||
| 88 | - | GetChildPtr := xSplitButtonGetChild(x.GoPointer()) | |
| 89 | - | if GetChildPtr == 0 { | |
| 90 | - | return nil | |
| 91 | - | } | |
| 92 | - | ||
| 93 | - | gobject.IncreaseRef(GetChildPtr) | |
| 94 | - | ||
| 95 | - | GetChildCls := >k.Widget{} | |
| 96 | - | GetChildCls.Ptr = GetChildPtr | |
| 97 | - | return GetChildCls | |
| 90 | + | cret := xSplitButtonGetChild(x.GoPointer()) | |
| 98 | 91 | ||
| 92 | + | if cret == 0 { | |
| 93 | + | return cls | |
| 94 | + | } | |
| 95 | + | gobject.IncreaseRef(cret) | |
| 96 | + | cls = >k.Widget{} | |
| 97 | + | cls.Ptr = cret | |
| 98 | + | return cls | |
| 99 | 99 | } | |
| 100 | 100 | ||
| 101 | 101 | var xSplitButtonGetDirection func(uintptr) gtk.ArrowType | |
| @@ -103,8 +103,8 @@ var xSplitButtonGetDirection func(uintptr) gtk.ArrowType | |||
| 103 | 103 | // Gets the direction in which the popup will be popped up. | |
| 104 | 104 | func (x *SplitButton) GetDirection() gtk.ArrowType { | |
| 105 | 105 | ||
| 106 | - | return xSplitButtonGetDirection(x.GoPointer()) | |
| 107 | - | ||
| 106 | + | cret := xSplitButtonGetDirection(x.GoPointer()) | |
| 107 | + | return cret | |
| 108 | 108 | } | |
| 109 | 109 | ||
| 110 | 110 | var xSplitButtonGetDropdownTooltip func(uintptr) string | |
| @@ -112,8 +112,8 @@ var xSplitButtonGetDropdownTooltip func(uintptr) string | |||
| 112 | 112 | // Gets the tooltip of the dropdown button of @self. | |
| 113 | 113 | func (x *SplitButton) GetDropdownTooltip() string { | |
| 114 | 114 | ||
| 115 | - | return xSplitButtonGetDropdownTooltip(x.GoPointer()) | |
| 116 | - | ||
| 115 | + | cret := xSplitButtonGetDropdownTooltip(x.GoPointer()) | |
| 116 | + | return cret | |
| 117 | 117 | } | |
| 118 | 118 | ||
| 119 | 119 | var xSplitButtonGetIconName func(uintptr) string | |
| @@ -121,8 +121,8 @@ var xSplitButtonGetIconName func(uintptr) string | |||
| 121 | 121 | // Gets the name of the icon used to automatically populate the button. | |
| 122 | 122 | func (x *SplitButton) GetIconName() string { | |
| 123 | 123 | ||
| 124 | - | return xSplitButtonGetIconName(x.GoPointer()) | |
| 125 | - | ||
| 124 | + | cret := xSplitButtonGetIconName(x.GoPointer()) | |
| 125 | + | return cret | |
| 126 | 126 | } | |
| 127 | 127 | ||
| 128 | 128 | var xSplitButtonGetLabel func(uintptr) string | |
| @@ -130,44 +130,42 @@ var xSplitButtonGetLabel func(uintptr) string | |||
| 130 | 130 | // Gets the label for @self. | |
| 131 | 131 | func (x *SplitButton) GetLabel() string { | |
| 132 | 132 | ||
| 133 | - | return xSplitButtonGetLabel(x.GoPointer()) | |
| 134 | - | ||
| 133 | + | cret := xSplitButtonGetLabel(x.GoPointer()) | |
| 134 | + | return cret | |
| 135 | 135 | } | |
| 136 | 136 | ||
| 137 | 137 | var xSplitButtonGetMenuModel func(uintptr) uintptr | |
| 138 | 138 | ||
| 139 | 139 | // Gets the menu model from which the popup will be created. | |
| 140 | 140 | func (x *SplitButton) GetMenuModel() *gio.MenuModel { | |
| 141 | + | var cls *gio.MenuModel | |
| 141 | 142 | ||
| 142 | - | GetMenuModelPtr := xSplitButtonGetMenuModel(x.GoPointer()) | |
| 143 | - | if GetMenuModelPtr == 0 { | |
| 144 | - | return nil | |
| 145 | - | } | |
| 146 | - | ||
| 147 | - | gobject.IncreaseRef(GetMenuModelPtr) | |
| 148 | - | ||
| 149 | - | GetMenuModelCls := &gio.MenuModel{} | |
| 150 | - | GetMenuModelCls.Ptr = GetMenuModelPtr | |
| 151 | - | return GetMenuModelCls | |
| 143 | + | cret := xSplitButtonGetMenuModel(x.GoPointer()) | |
| 152 | 144 | ||
| 145 | + | if cret == 0 { | |
| 146 | + | return cls | |
| 147 | + | } | |
| 148 | + | gobject.IncreaseRef(cret) | |
| 149 | + | cls = &gio.MenuModel{} | |
| 150 | + | cls.Ptr = cret | |
| 151 | + | return cls | |
| 153 | 152 | } | |
| 154 | 153 | ||
| 155 | 154 | var xSplitButtonGetPopover func(uintptr) uintptr | |
| 156 | 155 | ||
| 157 | 156 | // Gets the popover that will be popped up when the dropdown is clicked. | |
| 158 | 157 | func (x *SplitButton) GetPopover() *gtk.Popover { | |
| 158 | + | var cls *gtk.Popover | |
| 159 | 159 | ||
| 160 | - | GetPopoverPtr := xSplitButtonGetPopover(x.GoPointer()) | |
| 161 | - | if GetPopoverPtr == 0 { | |
| 162 | - | return nil | |
| 163 | - | } | |
| 164 | - | ||
| 165 | - | gobject.IncreaseRef(GetPopoverPtr) | |
| 166 | - | ||
| 167 | - | GetPopoverCls := >k.Popover{} | |
| 168 | - | GetPopoverCls.Ptr = GetPopoverPtr | |
| 169 | - | return GetPopoverCls | |
| 160 | + | cret := xSplitButtonGetPopover(x.GoPointer()) | |
| 170 | 161 | ||
| 162 | + | if cret == 0 { | |
| 163 | + | return cls | |
| 164 | + | } | |
| 165 | + | gobject.IncreaseRef(cret) | |
| 166 | + | cls = >k.Popover{} | |
| 167 | + | cls.Ptr = cret | |
| 168 | + | return cls | |
| 171 | 169 | } | |
| 172 | 170 | ||
| 173 | 171 | var xSplitButtonGetUseUnderline func(uintptr) bool | |
| @@ -175,8 +173,8 @@ var xSplitButtonGetUseUnderline func(uintptr) bool | |||
| 175 | 173 | // Gets whether an underline in the text indicates a mnemonic. | |
| 176 | 174 | func (x *SplitButton) GetUseUnderline() bool { | |
| 177 | 175 | ||
| 178 | - | return xSplitButtonGetUseUnderline(x.GoPointer()) | |
| 179 | - | ||
| 176 | + | cret := xSplitButtonGetUseUnderline(x.GoPointer()) | |
| 177 | + | return cret | |
| 180 | 178 | } | |
| 181 | 179 | ||
| 182 | 180 | var xSplitButtonPopdown func(uintptr) | |
| @@ -341,8 +339,8 @@ func (x *SplitButton) ConnectClicked(cb func(SplitButton)) { | |||
| 341 | 339 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 342 | 340 | func (x *SplitButton) GetAccessibleRole() gtk.AccessibleRole { | |
| 343 | 341 | ||
| 344 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 345 | - | ||
| 342 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 343 | + | return cret | |
| 346 | 344 | } | |
| 347 | 345 | ||
| 348 | 346 | // Resets the accessible @property to its default value. | |
| @@ -474,15 +472,15 @@ func (x *SplitButton) UpdateStateValue(NStatesVar int, StatesVar uintptr, Values | |||
| 474 | 472 | // Gets the action name for @actionable. | |
| 475 | 473 | func (x *SplitButton) GetActionName() string { | |
| 476 | 474 | ||
| 477 | - | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 478 | - | ||
| 475 | + | cret := gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 476 | + | return cret | |
| 479 | 477 | } | |
| 480 | 478 | ||
| 481 | 479 | // Gets the current target value of @actionable. | |
| 482 | 480 | func (x *SplitButton) GetActionTargetValue() *glib.Variant { | |
| 483 | 481 | ||
| 484 | - | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 485 | - | ||
| 482 | + | cret := gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 483 | + | return cret | |
| 486 | 484 | } | |
| 487 | 485 | ||
| 488 | 486 | // Specifies the name of the action with which this widget should be | |
| @@ -560,8 +558,8 @@ func (x *SplitButton) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 560 | 558 | // of the <object> tag used to construct the @buildable. | |
| 561 | 559 | func (x *SplitButton) GetBuildableId() string { | |
| 562 | 560 | ||
| 563 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 564 | - | ||
| 561 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 562 | + | return cret | |
| 565 | 563 | } | |
| 566 | 564 | ||
| 567 | 565 | func init() { | |
M v4/adw/adw-spring-animation.go +29 -28
| @@ -59,16 +59,17 @@ var xNewSpringAnimation func(uintptr, float64, float64, *SpringParams, uintptr) | |||
| 59 | 59 | // The animation will animate @target from @from to @to with the dynamics of a | |
| 60 | 60 | // spring described by @spring_params. | |
| 61 | 61 | func NewSpringAnimation(WidgetVar *gtk.Widget, FromVar float64, ToVar float64, SpringParamsVar *SpringParams, TargetVar *AnimationTarget) *Animation { | |
| 62 | - | NewSpringAnimationPtr := xNewSpringAnimation(WidgetVar.GoPointer(), FromVar, ToVar, SpringParamsVar, TargetVar.GoPointer()) | |
| 63 | - | if NewSpringAnimationPtr == 0 { | |
| 64 | - | return nil | |
| 65 | - | } | |
| 62 | + | var cls *Animation | |
| 66 | 63 | ||
| 67 | - | gobject.IncreaseRef(NewSpringAnimationPtr) | |
| 64 | + | cret := xNewSpringAnimation(WidgetVar.GoPointer(), FromVar, ToVar, SpringParamsVar, TargetVar.GoPointer()) | |
| 68 | 65 | ||
| 69 | - | NewSpringAnimationCls := &Animation{} | |
| 70 | - | NewSpringAnimationCls.Ptr = NewSpringAnimationPtr | |
| 71 | - | return NewSpringAnimationCls | |
| 66 | + | if cret == 0 { | |
| 67 | + | return cls | |
| 68 | + | } | |
| 69 | + | gobject.IncreaseRef(cret) | |
| 70 | + | cls = &Animation{} | |
| 71 | + | cls.Ptr = cret | |
| 72 | + | return cls | |
| 72 | 73 | } | |
| 73 | 74 | ||
| 74 | 75 | var xSpringAnimationCalculateValue func(uintptr, uint) float64 | |
| @@ -81,8 +82,8 @@ var xSpringAnimationCalculateValue func(uintptr, uint) float64 | |||
| 81 | 82 | // See also [method@SpringAnimation.calculate_velocity]. | |
| 82 | 83 | func (x *SpringAnimation) CalculateValue(TimeVar uint) float64 { | |
| 83 | 84 | ||
| 84 | - | return xSpringAnimationCalculateValue(x.GoPointer(), TimeVar) | |
| 85 | - | ||
| 85 | + | cret := xSpringAnimationCalculateValue(x.GoPointer(), TimeVar) | |
| 86 | + | return cret | |
| 86 | 87 | } | |
| 87 | 88 | ||
| 88 | 89 | var xSpringAnimationCalculateVelocity func(uintptr, uint) float64 | |
| @@ -95,8 +96,8 @@ var xSpringAnimationCalculateVelocity func(uintptr, uint) float64 | |||
| 95 | 96 | // See also [method@SpringAnimation.calculate_value]. | |
| 96 | 97 | func (x *SpringAnimation) CalculateVelocity(TimeVar uint) float64 { | |
| 97 | 98 | ||
| 98 | - | return xSpringAnimationCalculateVelocity(x.GoPointer(), TimeVar) | |
| 99 | - | ||
| 99 | + | cret := xSpringAnimationCalculateVelocity(x.GoPointer(), TimeVar) | |
| 100 | + | return cret | |
| 100 | 101 | } | |
| 101 | 102 | ||
| 102 | 103 | var xSpringAnimationGetClamp func(uintptr) bool | |
| @@ -104,8 +105,8 @@ var xSpringAnimationGetClamp func(uintptr) bool | |||
| 104 | 105 | // Gets whether @self should be clamped. | |
| 105 | 106 | func (x *SpringAnimation) GetClamp() bool { | |
| 106 | 107 | ||
| 107 | - | return xSpringAnimationGetClamp(x.GoPointer()) | |
| 108 | - | ||
| 108 | + | cret := xSpringAnimationGetClamp(x.GoPointer()) | |
| 109 | + | return cret | |
| 109 | 110 | } | |
| 110 | 111 | ||
| 111 | 112 | var xSpringAnimationGetEpsilon func(uintptr) float64 | |
| @@ -113,8 +114,8 @@ var xSpringAnimationGetEpsilon func(uintptr) float64 | |||
| 113 | 114 | // Gets the precision of the spring. | |
| 114 | 115 | func (x *SpringAnimation) GetEpsilon() float64 { | |
| 115 | 116 | ||
| 116 | - | return xSpringAnimationGetEpsilon(x.GoPointer()) | |
| 117 | - | ||
| 117 | + | cret := xSpringAnimationGetEpsilon(x.GoPointer()) | |
| 118 | + | return cret | |
| 118 | 119 | } | |
| 119 | 120 | ||
| 120 | 121 | var xSpringAnimationGetEstimatedDuration func(uintptr) uint | |
| @@ -124,8 +125,8 @@ var xSpringAnimationGetEstimatedDuration func(uintptr) uint | |||
| 124 | 125 | // Can be [const@DURATION_INFINITE] if the spring damping is set to 0. | |
| 125 | 126 | func (x *SpringAnimation) GetEstimatedDuration() uint { | |
| 126 | 127 | ||
| 127 | - | return xSpringAnimationGetEstimatedDuration(x.GoPointer()) | |
| 128 | - | ||
| 128 | + | cret := xSpringAnimationGetEstimatedDuration(x.GoPointer()) | |
| 129 | + | return cret | |
| 129 | 130 | } | |
| 130 | 131 | ||
| 131 | 132 | var xSpringAnimationGetInitialVelocity func(uintptr) float64 | |
| @@ -133,8 +134,8 @@ var xSpringAnimationGetInitialVelocity func(uintptr) float64 | |||
| 133 | 134 | // Gets the initial velocity of @self. | |
| 134 | 135 | func (x *SpringAnimation) GetInitialVelocity() float64 { | |
| 135 | 136 | ||
| 136 | - | return xSpringAnimationGetInitialVelocity(x.GoPointer()) | |
| 137 | - | ||
| 137 | + | cret := xSpringAnimationGetInitialVelocity(x.GoPointer()) | |
| 138 | + | return cret | |
| 138 | 139 | } | |
| 139 | 140 | ||
| 140 | 141 | var xSpringAnimationGetSpringParams func(uintptr) *SpringParams | |
| @@ -142,8 +143,8 @@ var xSpringAnimationGetSpringParams func(uintptr) *SpringParams | |||
| 142 | 143 | // Gets the physical parameters of the spring of @self. | |
| 143 | 144 | func (x *SpringAnimation) GetSpringParams() *SpringParams { | |
| 144 | 145 | ||
| 145 | - | return xSpringAnimationGetSpringParams(x.GoPointer()) | |
| 146 | - | ||
| 146 | + | cret := xSpringAnimationGetSpringParams(x.GoPointer()) | |
| 147 | + | return cret | |
| 147 | 148 | } | |
| 148 | 149 | ||
| 149 | 150 | var xSpringAnimationGetValueFrom func(uintptr) float64 | |
| @@ -151,8 +152,8 @@ var xSpringAnimationGetValueFrom func(uintptr) float64 | |||
| 151 | 152 | // Gets the value @self will animate from. | |
| 152 | 153 | func (x *SpringAnimation) GetValueFrom() float64 { | |
| 153 | 154 | ||
| 154 | - | return xSpringAnimationGetValueFrom(x.GoPointer()) | |
| 155 | - | ||
| 155 | + | cret := xSpringAnimationGetValueFrom(x.GoPointer()) | |
| 156 | + | return cret | |
| 156 | 157 | } | |
| 157 | 158 | ||
| 158 | 159 | var xSpringAnimationGetValueTo func(uintptr) float64 | |
| @@ -160,8 +161,8 @@ var xSpringAnimationGetValueTo func(uintptr) float64 | |||
| 160 | 161 | // Gets the value @self will animate to. | |
| 161 | 162 | func (x *SpringAnimation) GetValueTo() float64 { | |
| 162 | 163 | ||
| 163 | - | return xSpringAnimationGetValueTo(x.GoPointer()) | |
| 164 | - | ||
| 164 | + | cret := xSpringAnimationGetValueTo(x.GoPointer()) | |
| 165 | + | return cret | |
| 165 | 166 | } | |
| 166 | 167 | ||
| 167 | 168 | var xSpringAnimationGetVelocity func(uintptr) float64 | |
| @@ -169,8 +170,8 @@ var xSpringAnimationGetVelocity func(uintptr) float64 | |||
| 169 | 170 | // Gets the current velocity of @self. | |
| 170 | 171 | func (x *SpringAnimation) GetVelocity() float64 { | |
| 171 | 172 | ||
| 172 | - | return xSpringAnimationGetVelocity(x.GoPointer()) | |
| 173 | - | ||
| 173 | + | cret := xSpringAnimationGetVelocity(x.GoPointer()) | |
| 174 | + | return cret | |
| 174 | 175 | } | |
| 175 | 176 | ||
| 176 | 177 | var xSpringAnimationSetClamp func(uintptr, bool) | |
M v4/adw/adw-squeezer.go +79 -82
| @@ -67,34 +67,34 @@ var xNewSqueezer func() uintptr | |||
| 67 | 67 | ||
| 68 | 68 | // Creates a new `AdwSqueezer`. | |
| 69 | 69 | func NewSqueezer() *gtk.Widget { | |
| 70 | - | NewSqueezerPtr := xNewSqueezer() | |
| 71 | - | if NewSqueezerPtr == 0 { | |
| 72 | - | return nil | |
| 73 | - | } | |
| 70 | + | var cls *gtk.Widget | |
| 74 | 71 | ||
| 75 | - | gobject.IncreaseRef(NewSqueezerPtr) | |
| 72 | + | cret := xNewSqueezer() | |
| 76 | 73 | ||
| 77 | - | NewSqueezerCls := >k.Widget{} | |
| 78 | - | NewSqueezerCls.Ptr = NewSqueezerPtr | |
| 79 | - | return NewSqueezerCls | |
| 74 | + | if cret == 0 { | |
| 75 | + | return cls | |
| 76 | + | } | |
| 77 | + | gobject.IncreaseRef(cret) | |
| 78 | + | cls = >k.Widget{} | |
| 79 | + | cls.Ptr = cret | |
| 80 | + | return cls | |
| 80 | 81 | } | |
| 81 | 82 | ||
| 82 | 83 | var xSqueezerAdd func(uintptr, uintptr) uintptr | |
| 83 | 84 | ||
| 84 | 85 | // Adds a child to @self. | |
| 85 | 86 | func (x *Squeezer) Add(ChildVar *gtk.Widget) *SqueezerPage { | |
| 87 | + | var cls *SqueezerPage | |
| 86 | 88 | ||
| 87 | - | AddPtr := xSqueezerAdd(x.GoPointer(), ChildVar.GoPointer()) | |
| 88 | - | if AddPtr == 0 { | |
| 89 | - | return nil | |
| 90 | - | } | |
| 91 | - | ||
| 92 | - | gobject.IncreaseRef(AddPtr) | |
| 93 | - | ||
| 94 | - | AddCls := &SqueezerPage{} | |
| 95 | - | AddCls.Ptr = AddPtr | |
| 96 | - | return AddCls | |
| 89 | + | cret := xSqueezerAdd(x.GoPointer(), ChildVar.GoPointer()) | |
| 97 | 90 | ||
| 91 | + | if cret == 0 { | |
| 92 | + | return cls | |
| 93 | + | } | |
| 94 | + | gobject.IncreaseRef(cret) | |
| 95 | + | cls = &SqueezerPage{} | |
| 96 | + | cls.Ptr = cret | |
| 97 | + | return cls | |
| 98 | 98 | } | |
| 99 | 99 | ||
| 100 | 100 | var xSqueezerGetAllowNone func(uintptr) bool | |
| @@ -102,8 +102,8 @@ var xSqueezerGetAllowNone func(uintptr) bool | |||
| 102 | 102 | // Gets whether to allow squeezing beyond the last child's minimum size. | |
| 103 | 103 | func (x *Squeezer) GetAllowNone() bool { | |
| 104 | 104 | ||
| 105 | - | return xSqueezerGetAllowNone(x.GoPointer()) | |
| 106 | - | ||
| 105 | + | cret := xSqueezerGetAllowNone(x.GoPointer()) | |
| 106 | + | return cret | |
| 107 | 107 | } | |
| 108 | 108 | ||
| 109 | 109 | var xSqueezerGetHomogeneous func(uintptr) bool | |
| @@ -111,8 +111,8 @@ var xSqueezerGetHomogeneous func(uintptr) bool | |||
| 111 | 111 | // Gets whether all children have the same size for the opposite orientation. | |
| 112 | 112 | func (x *Squeezer) GetHomogeneous() bool { | |
| 113 | 113 | ||
| 114 | - | return xSqueezerGetHomogeneous(x.GoPointer()) | |
| 115 | - | ||
| 114 | + | cret := xSqueezerGetHomogeneous(x.GoPointer()) | |
| 115 | + | return cret | |
| 116 | 116 | } | |
| 117 | 117 | ||
| 118 | 118 | var xSqueezerGetInterpolateSize func(uintptr) bool | |
| @@ -120,26 +120,25 @@ var xSqueezerGetInterpolateSize func(uintptr) bool | |||
| 120 | 120 | // Gets whether @self interpolates its size when changing the visible child. | |
| 121 | 121 | func (x *Squeezer) GetInterpolateSize() bool { | |
| 122 | 122 | ||
| 123 | - | return xSqueezerGetInterpolateSize(x.GoPointer()) | |
| 124 | - | ||
| 123 | + | cret := xSqueezerGetInterpolateSize(x.GoPointer()) | |
| 124 | + | return cret | |
| 125 | 125 | } | |
| 126 | 126 | ||
| 127 | 127 | var xSqueezerGetPage func(uintptr, uintptr) uintptr | |
| 128 | 128 | ||
| 129 | 129 | // Returns the [class@SqueezerPage] object for @child. | |
| 130 | 130 | func (x *Squeezer) GetPage(ChildVar *gtk.Widget) *SqueezerPage { | |
| 131 | + | var cls *SqueezerPage | |
| 131 | 132 | ||
| 132 | - | GetPagePtr := xSqueezerGetPage(x.GoPointer(), ChildVar.GoPointer()) | |
| 133 | - | if GetPagePtr == 0 { | |
| 134 | - | return nil | |
| 135 | - | } | |
| 136 | - | ||
| 137 | - | gobject.IncreaseRef(GetPagePtr) | |
| 138 | - | ||
| 139 | - | GetPageCls := &SqueezerPage{} | |
| 140 | - | GetPageCls.Ptr = GetPagePtr | |
| 141 | - | return GetPageCls | |
| 133 | + | cret := xSqueezerGetPage(x.GoPointer(), ChildVar.GoPointer()) | |
| 142 | 134 | ||
| 135 | + | if cret == 0 { | |
| 136 | + | return cls | |
| 137 | + | } | |
| 138 | + | gobject.IncreaseRef(cret) | |
| 139 | + | cls = &SqueezerPage{} | |
| 140 | + | cls.Ptr = cret | |
| 141 | + | return cls | |
| 143 | 142 | } | |
| 144 | 143 | ||
| 145 | 144 | var xSqueezerGetPages func(uintptr) uintptr | |
| @@ -149,16 +148,16 @@ var xSqueezerGetPages func(uintptr) uintptr | |||
| 149 | 148 | // This can be used to keep an up-to-date view. The model also implements | |
| 150 | 149 | // [iface@Gtk.SelectionModel] and can be used to track the visible page. | |
| 151 | 150 | func (x *Squeezer) GetPages() *gtk.SelectionModelBase { | |
| 151 | + | var cls *gtk.SelectionModelBase | |
| 152 | 152 | ||
| 153 | - | GetPagesPtr := xSqueezerGetPages(x.GoPointer()) | |
| 154 | - | if GetPagesPtr == 0 { | |
| 155 | - | return nil | |
| 156 | - | } | |
| 157 | - | ||
| 158 | - | GetPagesCls := >k.SelectionModelBase{} | |
| 159 | - | GetPagesCls.Ptr = GetPagesPtr | |
| 160 | - | return GetPagesCls | |
| 153 | + | cret := xSqueezerGetPages(x.GoPointer()) | |
| 161 | 154 | ||
| 155 | + | if cret == 0 { | |
| 156 | + | return cls | |
| 157 | + | } | |
| 158 | + | cls = >k.SelectionModelBase{} | |
| 159 | + | cls.Ptr = cret | |
| 160 | + | return cls | |
| 162 | 161 | } | |
| 163 | 162 | ||
| 164 | 163 | var xSqueezerGetSwitchThresholdPolicy func(uintptr) FoldThresholdPolicy | |
| @@ -166,8 +165,8 @@ var xSqueezerGetSwitchThresholdPolicy func(uintptr) FoldThresholdPolicy | |||
| 166 | 165 | // Gets the switch threshold policy for @self. | |
| 167 | 166 | func (x *Squeezer) GetSwitchThresholdPolicy() FoldThresholdPolicy { | |
| 168 | 167 | ||
| 169 | - | return xSqueezerGetSwitchThresholdPolicy(x.GoPointer()) | |
| 170 | - | ||
| 168 | + | cret := xSqueezerGetSwitchThresholdPolicy(x.GoPointer()) | |
| 169 | + | return cret | |
| 171 | 170 | } | |
| 172 | 171 | ||
| 173 | 172 | var xSqueezerGetTransitionDuration func(uintptr) uint | |
| @@ -175,8 +174,8 @@ var xSqueezerGetTransitionDuration func(uintptr) uint | |||
| 175 | 174 | // Gets the transition animation duration for @self. | |
| 176 | 175 | func (x *Squeezer) GetTransitionDuration() uint { | |
| 177 | 176 | ||
| 178 | - | return xSqueezerGetTransitionDuration(x.GoPointer()) | |
| 179 | - | ||
| 177 | + | cret := xSqueezerGetTransitionDuration(x.GoPointer()) | |
| 178 | + | return cret | |
| 180 | 179 | } | |
| 181 | 180 | ||
| 182 | 181 | var xSqueezerGetTransitionRunning func(uintptr) bool | |
| @@ -188,8 +187,8 @@ var xSqueezerGetTransitionRunning func(uintptr) bool | |||
| 188 | 187 | // to know that a transition has happened. | |
| 189 | 188 | func (x *Squeezer) GetTransitionRunning() bool { | |
| 190 | 189 | ||
| 191 | - | return xSqueezerGetTransitionRunning(x.GoPointer()) | |
| 192 | - | ||
| 190 | + | cret := xSqueezerGetTransitionRunning(x.GoPointer()) | |
| 191 | + | return cret | |
| 193 | 192 | } | |
| 194 | 193 | ||
| 195 | 194 | var xSqueezerGetTransitionType func(uintptr) SqueezerTransitionType | |
| @@ -197,26 +196,25 @@ var xSqueezerGetTransitionType func(uintptr) SqueezerTransitionType | |||
| 197 | 196 | // Gets the type of animation used for transitions between children in @self. | |
| 198 | 197 | func (x *Squeezer) GetTransitionType() SqueezerTransitionType { | |
| 199 | 198 | ||
| 200 | - | return xSqueezerGetTransitionType(x.GoPointer()) | |
| 201 | - | ||
| 199 | + | cret := xSqueezerGetTransitionType(x.GoPointer()) | |
| 200 | + | return cret | |
| 202 | 201 | } | |
| 203 | 202 | ||
| 204 | 203 | var xSqueezerGetVisibleChild func(uintptr) uintptr | |
| 205 | 204 | ||
| 206 | 205 | // Gets the currently visible child of @self. | |
| 207 | 206 | func (x *Squeezer) GetVisibleChild() *gtk.Widget { | |
| 207 | + | var cls *gtk.Widget | |
| 208 | 208 | ||
| 209 | - | GetVisibleChildPtr := xSqueezerGetVisibleChild(x.GoPointer()) | |
| 210 | - | if GetVisibleChildPtr == 0 { | |
| 211 | - | return nil | |
| 212 | - | } | |
| 213 | - | ||
| 214 | - | gobject.IncreaseRef(GetVisibleChildPtr) | |
| 215 | - | ||
| 216 | - | GetVisibleChildCls := >k.Widget{} | |
| 217 | - | GetVisibleChildCls.Ptr = GetVisibleChildPtr | |
| 218 | - | return GetVisibleChildCls | |
| 209 | + | cret := xSqueezerGetVisibleChild(x.GoPointer()) | |
| 219 | 210 | ||
| 211 | + | if cret == 0 { | |
| 212 | + | return cls | |
| 213 | + | } | |
| 214 | + | gobject.IncreaseRef(cret) | |
| 215 | + | cls = >k.Widget{} | |
| 216 | + | cls.Ptr = cret | |
| 217 | + | return cls | |
| 220 | 218 | } | |
| 221 | 219 | ||
| 222 | 220 | var xSqueezerGetXalign func(uintptr) float32 | |
| @@ -224,8 +222,8 @@ var xSqueezerGetXalign func(uintptr) float32 | |||
| 224 | 222 | // Gets the horizontal alignment, from 0 (start) to 1 (end). | |
| 225 | 223 | func (x *Squeezer) GetXalign() float32 { | |
| 226 | 224 | ||
| 227 | - | return xSqueezerGetXalign(x.GoPointer()) | |
| 228 | - | ||
| 225 | + | cret := xSqueezerGetXalign(x.GoPointer()) | |
| 226 | + | return cret | |
| 229 | 227 | } | |
| 230 | 228 | ||
| 231 | 229 | var xSqueezerGetYalign func(uintptr) float32 | |
| @@ -233,8 +231,8 @@ var xSqueezerGetYalign func(uintptr) float32 | |||
| 233 | 231 | // Gets the vertical alignment, from 0 (top) to 1 (bottom). | |
| 234 | 232 | func (x *Squeezer) GetYalign() float32 { | |
| 235 | 233 | ||
| 236 | - | return xSqueezerGetYalign(x.GoPointer()) | |
| 237 | - | ||
| 234 | + | cret := xSqueezerGetYalign(x.GoPointer()) | |
| 235 | + | return cret | |
| 238 | 236 | } | |
| 239 | 237 | ||
| 240 | 238 | var xSqueezerRemove func(uintptr, uintptr) | |
| @@ -363,8 +361,8 @@ func (c *Squeezer) SetGoPointer(ptr uintptr) { | |||
| 363 | 361 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 364 | 362 | func (x *Squeezer) GetAccessibleRole() gtk.AccessibleRole { | |
| 365 | 363 | ||
| 366 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 367 | - | ||
| 364 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 365 | + | return cret | |
| 368 | 366 | } | |
| 369 | 367 | ||
| 370 | 368 | // Resets the accessible @property to its default value. | |
| @@ -499,15 +497,15 @@ func (x *Squeezer) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVar | |||
| 499 | 497 | // of the <object> tag used to construct the @buildable. | |
| 500 | 498 | func (x *Squeezer) GetBuildableId() string { | |
| 501 | 499 | ||
| 502 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 503 | - | ||
| 500 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 501 | + | return cret | |
| 504 | 502 | } | |
| 505 | 503 | ||
| 506 | 504 | // Retrieves the orientation of the @orientable. | |
| 507 | 505 | func (x *Squeezer) GetOrientation() gtk.Orientation { | |
| 508 | 506 | ||
| 509 | - | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 510 | - | ||
| 507 | + | cret := gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 508 | + | return cret | |
| 511 | 509 | } | |
| 512 | 510 | ||
| 513 | 511 | // Sets the orientation of the @orientable. | |
| @@ -532,18 +530,17 @@ var xSqueezerPageGetChild func(uintptr) uintptr | |||
| 532 | 530 | ||
| 533 | 531 | // Returns the squeezer child to which @self belongs. | |
| 534 | 532 | func (x *SqueezerPage) GetChild() *gtk.Widget { | |
| 533 | + | var cls *gtk.Widget | |
| 535 | 534 | ||
| 536 | - | GetChildPtr := xSqueezerPageGetChild(x.GoPointer()) | |
| 537 | - | if GetChildPtr == 0 { | |
| 538 | - | return nil | |
| 539 | - | } | |
| 540 | - | ||
| 541 | - | gobject.IncreaseRef(GetChildPtr) | |
| 542 | - | ||
| 543 | - | GetChildCls := >k.Widget{} | |
| 544 | - | GetChildCls.Ptr = GetChildPtr | |
| 545 | - | return GetChildCls | |
| 535 | + | cret := xSqueezerPageGetChild(x.GoPointer()) | |
| 546 | 536 | ||
| 537 | + | if cret == 0 { | |
| 538 | + | return cls | |
| 539 | + | } | |
| 540 | + | gobject.IncreaseRef(cret) | |
| 541 | + | cls = >k.Widget{} | |
| 542 | + | cls.Ptr = cret | |
| 543 | + | return cls | |
| 547 | 544 | } | |
| 548 | 545 | ||
| 549 | 546 | var xSqueezerPageGetEnabled func(uintptr) bool | |
| @@ -551,8 +548,8 @@ var xSqueezerPageGetEnabled func(uintptr) bool | |||
| 551 | 548 | // Gets whether @self is enabled. | |
| 552 | 549 | func (x *SqueezerPage) GetEnabled() bool { | |
| 553 | 550 | ||
| 554 | - | return xSqueezerPageGetEnabled(x.GoPointer()) | |
| 555 | - | ||
| 551 | + | cret := xSqueezerPageGetEnabled(x.GoPointer()) | |
| 552 | + | return cret | |
| 556 | 553 | } | |
| 557 | 554 | ||
| 558 | 555 | var xSqueezerPageSetEnabled func(uintptr, bool) | |
M v4/adw/adw-status-page.go +37 -38
| @@ -46,34 +46,34 @@ var xNewStatusPage func() uintptr | |||
| 46 | 46 | ||
| 47 | 47 | // Creates a new `AdwStatusPage`. | |
| 48 | 48 | func NewStatusPage() *gtk.Widget { | |
| 49 | - | NewStatusPagePtr := xNewStatusPage() | |
| 50 | - | if NewStatusPagePtr == 0 { | |
| 51 | - | return nil | |
| 52 | - | } | |
| 49 | + | var cls *gtk.Widget | |
| 53 | 50 | ||
| 54 | - | gobject.IncreaseRef(NewStatusPagePtr) | |
| 51 | + | cret := xNewStatusPage() | |
| 55 | 52 | ||
| 56 | - | NewStatusPageCls := >k.Widget{} | |
| 57 | - | NewStatusPageCls.Ptr = NewStatusPagePtr | |
| 58 | - | return NewStatusPageCls | |
| 53 | + | if cret == 0 { | |
| 54 | + | return cls | |
| 55 | + | } | |
| 56 | + | gobject.IncreaseRef(cret) | |
| 57 | + | cls = >k.Widget{} | |
| 58 | + | cls.Ptr = cret | |
| 59 | + | return cls | |
| 59 | 60 | } | |
| 60 | 61 | ||
| 61 | 62 | var xStatusPageGetChild func(uintptr) uintptr | |
| 62 | 63 | ||
| 63 | 64 | // Gets the child widget of @self. | |
| 64 | 65 | func (x *StatusPage) GetChild() *gtk.Widget { | |
| 66 | + | var cls *gtk.Widget | |
| 65 | 67 | ||
| 66 | - | GetChildPtr := xStatusPageGetChild(x.GoPointer()) | |
| 67 | - | if GetChildPtr == 0 { | |
| 68 | - | return nil | |
| 69 | - | } | |
| 70 | - | ||
| 71 | - | gobject.IncreaseRef(GetChildPtr) | |
| 72 | - | ||
| 73 | - | GetChildCls := >k.Widget{} | |
| 74 | - | GetChildCls.Ptr = GetChildPtr | |
| 75 | - | return GetChildCls | |
| 68 | + | cret := xStatusPageGetChild(x.GoPointer()) | |
| 76 | 69 | ||
| 70 | + | if cret == 0 { | |
| 71 | + | return cls | |
| 72 | + | } | |
| 73 | + | gobject.IncreaseRef(cret) | |
| 74 | + | cls = >k.Widget{} | |
| 75 | + | cls.Ptr = cret | |
| 76 | + | return cls | |
| 77 | 77 | } | |
| 78 | 78 | ||
| 79 | 79 | var xStatusPageGetDescription func(uintptr) string | |
| @@ -81,8 +81,8 @@ var xStatusPageGetDescription func(uintptr) string | |||
| 81 | 81 | // Gets the description for @self. | |
| 82 | 82 | func (x *StatusPage) GetDescription() string { | |
| 83 | 83 | ||
| 84 | - | return xStatusPageGetDescription(x.GoPointer()) | |
| 85 | - | ||
| 84 | + | cret := xStatusPageGetDescription(x.GoPointer()) | |
| 85 | + | return cret | |
| 86 | 86 | } | |
| 87 | 87 | ||
| 88 | 88 | var xStatusPageGetIconName func(uintptr) string | |
| @@ -90,26 +90,25 @@ var xStatusPageGetIconName func(uintptr) string | |||
| 90 | 90 | // Gets the icon name for @self. | |
| 91 | 91 | func (x *StatusPage) GetIconName() string { | |
| 92 | 92 | ||
| 93 | - | return xStatusPageGetIconName(x.GoPointer()) | |
| 94 | - | ||
| 93 | + | cret := xStatusPageGetIconName(x.GoPointer()) | |
| 94 | + | return cret | |
| 95 | 95 | } | |
| 96 | 96 | ||
| 97 | 97 | var xStatusPageGetPaintable func(uintptr) uintptr | |
| 98 | 98 | ||
| 99 | 99 | // Gets the paintable for @self. | |
| 100 | 100 | func (x *StatusPage) GetPaintable() *gdk.PaintableBase { | |
| 101 | + | var cls *gdk.PaintableBase | |
| 101 | 102 | ||
| 102 | - | GetPaintablePtr := xStatusPageGetPaintable(x.GoPointer()) | |
| 103 | - | if GetPaintablePtr == 0 { | |
| 104 | - | return nil | |
| 105 | - | } | |
| 106 | - | ||
| 107 | - | gobject.IncreaseRef(GetPaintablePtr) | |
| 108 | - | ||
| 109 | - | GetPaintableCls := &gdk.PaintableBase{} | |
| 110 | - | GetPaintableCls.Ptr = GetPaintablePtr | |
| 111 | - | return GetPaintableCls | |
| 103 | + | cret := xStatusPageGetPaintable(x.GoPointer()) | |
| 112 | 104 | ||
| 105 | + | if cret == 0 { | |
| 106 | + | return cls | |
| 107 | + | } | |
| 108 | + | gobject.IncreaseRef(cret) | |
| 109 | + | cls = &gdk.PaintableBase{} | |
| 110 | + | cls.Ptr = cret | |
| 111 | + | return cls | |
| 113 | 112 | } | |
| 114 | 113 | ||
| 115 | 114 | var xStatusPageGetTitle func(uintptr) string | |
| @@ -117,8 +116,8 @@ var xStatusPageGetTitle func(uintptr) string | |||
| 117 | 116 | // Gets the title for @self. | |
| 118 | 117 | func (x *StatusPage) GetTitle() string { | |
| 119 | 118 | ||
| 120 | - | return xStatusPageGetTitle(x.GoPointer()) | |
| 121 | - | ||
| 119 | + | cret := xStatusPageGetTitle(x.GoPointer()) | |
| 120 | + | return cret | |
| 122 | 121 | } | |
| 123 | 122 | ||
| 124 | 123 | var xStatusPageSetChild func(uintptr, uintptr) | |
| @@ -185,8 +184,8 @@ func (c *StatusPage) SetGoPointer(ptr uintptr) { | |||
| 185 | 184 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 186 | 185 | func (x *StatusPage) GetAccessibleRole() gtk.AccessibleRole { | |
| 187 | 186 | ||
| 188 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 189 | - | ||
| 187 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 188 | + | return cret | |
| 190 | 189 | } | |
| 191 | 190 | ||
| 192 | 191 | // Resets the accessible @property to its default value. | |
| @@ -321,8 +320,8 @@ func (x *StatusPage) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesV | |||
| 321 | 320 | // of the <object> tag used to construct the @buildable. | |
| 322 | 321 | func (x *StatusPage) GetBuildableId() string { | |
| 323 | 322 | ||
| 324 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 325 | - | ||
| 323 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 324 | + | return cret | |
| 326 | 325 | } | |
| 327 | 326 | ||
| 328 | 327 | func init() { | |
M v4/adw/adw-style-manager.go +17 -18
| @@ -56,8 +56,8 @@ var xStyleManagerGetColorScheme func(uintptr) ColorScheme | |||
| 56 | 56 | // Gets the requested application color scheme. | |
| 57 | 57 | func (x *StyleManager) GetColorScheme() ColorScheme { | |
| 58 | 58 | ||
| 59 | - | return xStyleManagerGetColorScheme(x.GoPointer()) | |
| 60 | - | ||
| 59 | + | cret := xStyleManagerGetColorScheme(x.GoPointer()) | |
| 60 | + | return cret | |
| 61 | 61 | } | |
| 62 | 62 | ||
| 63 | 63 | var xStyleManagerGetDark func(uintptr) bool | |
| @@ -68,8 +68,8 @@ var xStyleManagerGetDark func(uintptr) bool | |||
| 68 | 68 | // [property@StyleManager:color-scheme]. | |
| 69 | 69 | func (x *StyleManager) GetDark() bool { | |
| 70 | 70 | ||
| 71 | - | return xStyleManagerGetDark(x.GoPointer()) | |
| 72 | - | ||
| 71 | + | cret := xStyleManagerGetDark(x.GoPointer()) | |
| 72 | + | return cret | |
| 73 | 73 | } | |
| 74 | 74 | ||
| 75 | 75 | var xStyleManagerGetDisplay func(uintptr) uintptr | |
| @@ -79,18 +79,17 @@ var xStyleManagerGetDisplay func(uintptr) uintptr | |||
| 79 | 79 | // The display will be `NULL` for the style manager returned by | |
| 80 | 80 | // [func@StyleManager.get_default]. | |
| 81 | 81 | func (x *StyleManager) GetDisplay() *gdk.Display { | |
| 82 | + | var cls *gdk.Display | |
| 82 | 83 | ||
| 83 | - | GetDisplayPtr := xStyleManagerGetDisplay(x.GoPointer()) | |
| 84 | - | if GetDisplayPtr == 0 { | |
| 85 | - | return nil | |
| 86 | - | } | |
| 87 | - | ||
| 88 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 89 | - | ||
| 90 | - | GetDisplayCls := &gdk.Display{} | |
| 91 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 92 | - | return GetDisplayCls | |
| 84 | + | cret := xStyleManagerGetDisplay(x.GoPointer()) | |
| 93 | 85 | ||
| 86 | + | if cret == 0 { | |
| 87 | + | return cls | |
| 88 | + | } | |
| 89 | + | gobject.IncreaseRef(cret) | |
| 90 | + | cls = &gdk.Display{} | |
| 91 | + | cls.Ptr = cret | |
| 92 | + | return cls | |
| 94 | 93 | } | |
| 95 | 94 | ||
| 96 | 95 | var xStyleManagerGetHighContrast func(uintptr) bool | |
| @@ -100,8 +99,8 @@ var xStyleManagerGetHighContrast func(uintptr) bool | |||
| 100 | 99 | // This cannot be overridden by applications. | |
| 101 | 100 | func (x *StyleManager) GetHighContrast() bool { | |
| 102 | 101 | ||
| 103 | - | return xStyleManagerGetHighContrast(x.GoPointer()) | |
| 104 | - | ||
| 102 | + | cret := xStyleManagerGetHighContrast(x.GoPointer()) | |
| 103 | + | return cret | |
| 105 | 104 | } | |
| 106 | 105 | ||
| 107 | 106 | var xStyleManagerGetSystemSupportsColorSchemes func(uintptr) bool | |
| @@ -113,8 +112,8 @@ var xStyleManagerGetSystemSupportsColorSchemes func(uintptr) bool | |||
| 113 | 112 | // appearance switcher if it's set to `FALSE`. | |
| 114 | 113 | func (x *StyleManager) GetSystemSupportsColorSchemes() bool { | |
| 115 | 114 | ||
| 116 | - | return xStyleManagerGetSystemSupportsColorSchemes(x.GoPointer()) | |
| 117 | - | ||
| 115 | + | cret := xStyleManagerGetSystemSupportsColorSchemes(x.GoPointer()) | |
| 116 | + | return cret | |
| 118 | 117 | } | |
| 119 | 118 | ||
| 120 | 119 | var xStyleManagerSetColorScheme func(uintptr, ColorScheme) | |
M v4/adw/adw-swipe-tracker.go +28 -27
| @@ -36,14 +36,16 @@ var xNewSwipeTracker func(uintptr) uintptr | |||
| 36 | 36 | ||
| 37 | 37 | // Creates a new `AdwSwipeTracker` for @widget. | |
| 38 | 38 | func NewSwipeTracker(SwipeableVar Swipeable) *SwipeTracker { | |
| 39 | - | NewSwipeTrackerPtr := xNewSwipeTracker(SwipeableVar.GoPointer()) | |
| 40 | - | if NewSwipeTrackerPtr == 0 { | |
| 41 | - | return nil | |
| 42 | - | } | |
| 39 | + | var cls *SwipeTracker | |
| 40 | + | ||
| 41 | + | cret := xNewSwipeTracker(SwipeableVar.GoPointer()) | |
| 43 | 42 | ||
| 44 | - | NewSwipeTrackerCls := &SwipeTracker{} | |
| 45 | - | NewSwipeTrackerCls.Ptr = NewSwipeTrackerPtr | |
| 46 | - | return NewSwipeTrackerCls | |
| 43 | + | if cret == 0 { | |
| 44 | + | return cls | |
| 45 | + | } | |
| 46 | + | cls = &SwipeTracker{} | |
| 47 | + | cls.Ptr = cret | |
| 48 | + | return cls | |
| 47 | 49 | } | |
| 48 | 50 | ||
| 49 | 51 | var xSwipeTrackerGetAllowLongSwipes func(uintptr) bool | |
| @@ -51,8 +53,8 @@ var xSwipeTrackerGetAllowLongSwipes func(uintptr) bool | |||
| 51 | 53 | // Gets whether to allow swiping for more than one snap point at a time. | |
| 52 | 54 | func (x *SwipeTracker) GetAllowLongSwipes() bool { | |
| 53 | 55 | ||
| 54 | - | return xSwipeTrackerGetAllowLongSwipes(x.GoPointer()) | |
| 55 | - | ||
| 56 | + | cret := xSwipeTrackerGetAllowLongSwipes(x.GoPointer()) | |
| 57 | + | return cret | |
| 56 | 58 | } | |
| 57 | 59 | ||
| 58 | 60 | var xSwipeTrackerGetAllowMouseDrag func(uintptr) bool | |
| @@ -60,8 +62,8 @@ var xSwipeTrackerGetAllowMouseDrag func(uintptr) bool | |||
| 60 | 62 | // Gets whether @self can be dragged with mouse pointer. | |
| 61 | 63 | func (x *SwipeTracker) GetAllowMouseDrag() bool { | |
| 62 | 64 | ||
| 63 | - | return xSwipeTrackerGetAllowMouseDrag(x.GoPointer()) | |
| 64 | - | ||
| 65 | + | cret := xSwipeTrackerGetAllowMouseDrag(x.GoPointer()) | |
| 66 | + | return cret | |
| 65 | 67 | } | |
| 66 | 68 | ||
| 67 | 69 | var xSwipeTrackerGetEnabled func(uintptr) bool | |
| @@ -69,8 +71,8 @@ var xSwipeTrackerGetEnabled func(uintptr) bool | |||
| 69 | 71 | // Gets whether @self is enabled. | |
| 70 | 72 | func (x *SwipeTracker) GetEnabled() bool { | |
| 71 | 73 | ||
| 72 | - | return xSwipeTrackerGetEnabled(x.GoPointer()) | |
| 73 | - | ||
| 74 | + | cret := xSwipeTrackerGetEnabled(x.GoPointer()) | |
| 75 | + | return cret | |
| 74 | 76 | } | |
| 75 | 77 | ||
| 76 | 78 | var xSwipeTrackerGetReversed func(uintptr) bool | |
| @@ -78,26 +80,25 @@ var xSwipeTrackerGetReversed func(uintptr) bool | |||
| 78 | 80 | // Gets whether @self is reversing the swipe direction. | |
| 79 | 81 | func (x *SwipeTracker) GetReversed() bool { | |
| 80 | 82 | ||
| 81 | - | return xSwipeTrackerGetReversed(x.GoPointer()) | |
| 82 | - | ||
| 83 | + | cret := xSwipeTrackerGetReversed(x.GoPointer()) | |
| 84 | + | return cret | |
| 83 | 85 | } | |
| 84 | 86 | ||
| 85 | 87 | var xSwipeTrackerGetSwipeable func(uintptr) uintptr | |
| 86 | 88 | ||
| 87 | 89 | // Get the widget @self is attached to. | |
| 88 | 90 | func (x *SwipeTracker) GetSwipeable() *SwipeableBase { | |
| 91 | + | var cls *SwipeableBase | |
| 89 | 92 | ||
| 90 | - | GetSwipeablePtr := xSwipeTrackerGetSwipeable(x.GoPointer()) | |
| 91 | - | if GetSwipeablePtr == 0 { | |
| 92 | - | return nil | |
| 93 | - | } | |
| 94 | - | ||
| 95 | - | gobject.IncreaseRef(GetSwipeablePtr) | |
| 96 | - | ||
| 97 | - | GetSwipeableCls := &SwipeableBase{} | |
| 98 | - | GetSwipeableCls.Ptr = GetSwipeablePtr | |
| 99 | - | return GetSwipeableCls | |
| 93 | + | cret := xSwipeTrackerGetSwipeable(x.GoPointer()) | |
| 100 | 94 | ||
| 95 | + | if cret == 0 { | |
| 96 | + | return cls | |
| 97 | + | } | |
| 98 | + | gobject.IncreaseRef(cret) | |
| 99 | + | cls = &SwipeableBase{} | |
| 100 | + | cls.Ptr = cret | |
| 101 | + | return cls | |
| 101 | 102 | } | |
| 102 | 103 | ||
| 103 | 104 | var xSwipeTrackerSetAllowLongSwipes func(uintptr, bool) | |
| @@ -225,8 +226,8 @@ func (x *SwipeTracker) ConnectUpdateSwipe(cb func(SwipeTracker, float64)) { | |||
| 225 | 226 | // Retrieves the orientation of the @orientable. | |
| 226 | 227 | func (x *SwipeTracker) GetOrientation() gtk.Orientation { | |
| 227 | 228 | ||
| 228 | - | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 229 | - | ||
| 229 | + | cret := gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 230 | + | return cret | |
| 230 | 231 | } | |
| 231 | 232 | ||
| 232 | 233 | // Sets the orientation of the @orientable. | |
M v4/adw/adw-swipeable.go +8 -8
| @@ -43,8 +43,8 @@ func (x *SwipeableBase) SetGoPointer(ptr uintptr) { | |||
| 43 | 43 | // Gets the progress @self will snap back to after the gesture is canceled. | |
| 44 | 44 | func (x *SwipeableBase) GetCancelProgress() float64 { | |
| 45 | 45 | ||
| 46 | - | return XAdwSwipeableGetCancelProgress(x.GoPointer()) | |
| 47 | - | ||
| 46 | + | cret := XAdwSwipeableGetCancelProgress(x.GoPointer()) | |
| 47 | + | return cret | |
| 48 | 48 | } | |
| 49 | 49 | ||
| 50 | 50 | // Gets the swipe distance of @self. | |
| @@ -52,15 +52,15 @@ func (x *SwipeableBase) GetCancelProgress() float64 { | |||
| 52 | 52 | // This corresponds to how many pixels 1 unit represents. | |
| 53 | 53 | func (x *SwipeableBase) GetDistance() float64 { | |
| 54 | 54 | ||
| 55 | - | return XAdwSwipeableGetDistance(x.GoPointer()) | |
| 56 | - | ||
| 55 | + | cret := XAdwSwipeableGetDistance(x.GoPointer()) | |
| 56 | + | return cret | |
| 57 | 57 | } | |
| 58 | 58 | ||
| 59 | 59 | // Gets the current progress of @self. | |
| 60 | 60 | func (x *SwipeableBase) GetProgress() float64 { | |
| 61 | 61 | ||
| 62 | - | return XAdwSwipeableGetProgress(x.GoPointer()) | |
| 63 | - | ||
| 62 | + | cret := XAdwSwipeableGetProgress(x.GoPointer()) | |
| 63 | + | return cret | |
| 64 | 64 | } | |
| 65 | 65 | ||
| 66 | 66 | // Gets the snap points of @self. | |
| @@ -69,8 +69,8 @@ func (x *SwipeableBase) GetProgress() float64 { | |||
| 69 | 69 | // end the swipe on. | |
| 70 | 70 | func (x *SwipeableBase) GetSnapPoints(NSnapPointsVar int) uintptr { | |
| 71 | 71 | ||
| 72 | - | return XAdwSwipeableGetSnapPoints(x.GoPointer(), NSnapPointsVar) | |
| 73 | - | ||
| 72 | + | cret := XAdwSwipeableGetSnapPoints(x.GoPointer(), NSnapPointsVar) | |
| 73 | + | return cret | |
| 74 | 74 | } | |
| 75 | 75 | ||
| 76 | 76 | // Gets the area @self can start a swipe from for the given direction and | |
M v4/adw/adw-tab-bar.go +52 -54
| @@ -49,16 +49,17 @@ var xNewTabBar func() uintptr | |||
| 49 | 49 | ||
| 50 | 50 | // Creates a new `AdwTabBar`. | |
| 51 | 51 | func NewTabBar() *TabBar { | |
| 52 | - | NewTabBarPtr := xNewTabBar() | |
| 53 | - | if NewTabBarPtr == 0 { | |
| 54 | - | return nil | |
| 55 | - | } | |
| 52 | + | var cls *TabBar | |
| 56 | 53 | ||
| 57 | - | gobject.IncreaseRef(NewTabBarPtr) | |
| 54 | + | cret := xNewTabBar() | |
| 58 | 55 | ||
| 59 | - | NewTabBarCls := &TabBar{} | |
| 60 | - | NewTabBarCls.Ptr = NewTabBarPtr | |
| 61 | - | return NewTabBarCls | |
| 56 | + | if cret == 0 { | |
| 57 | + | return cls | |
| 58 | + | } | |
| 59 | + | gobject.IncreaseRef(cret) | |
| 60 | + | cls = &TabBar{} | |
| 61 | + | cls.Ptr = cret | |
| 62 | + | return cls | |
| 62 | 63 | } | |
| 63 | 64 | ||
| 64 | 65 | var xTabBarGetAutohide func(uintptr) bool | |
| @@ -66,26 +67,25 @@ var xTabBarGetAutohide func(uintptr) bool | |||
| 66 | 67 | // Gets whether the tabs automatically hide. | |
| 67 | 68 | func (x *TabBar) GetAutohide() bool { | |
| 68 | 69 | ||
| 69 | - | return xTabBarGetAutohide(x.GoPointer()) | |
| 70 | - | ||
| 70 | + | cret := xTabBarGetAutohide(x.GoPointer()) | |
| 71 | + | return cret | |
| 71 | 72 | } | |
| 72 | 73 | ||
| 73 | 74 | var xTabBarGetEndActionWidget func(uintptr) uintptr | |
| 74 | 75 | ||
| 75 | 76 | // Gets the widget shown after the tabs. | |
| 76 | 77 | func (x *TabBar) GetEndActionWidget() *gtk.Widget { | |
| 78 | + | var cls *gtk.Widget | |
| 77 | 79 | ||
| 78 | - | GetEndActionWidgetPtr := xTabBarGetEndActionWidget(x.GoPointer()) | |
| 79 | - | if GetEndActionWidgetPtr == 0 { | |
| 80 | - | return nil | |
| 81 | - | } | |
| 82 | - | ||
| 83 | - | gobject.IncreaseRef(GetEndActionWidgetPtr) | |
| 84 | - | ||
| 85 | - | GetEndActionWidgetCls := >k.Widget{} | |
| 86 | - | GetEndActionWidgetCls.Ptr = GetEndActionWidgetPtr | |
| 87 | - | return GetEndActionWidgetCls | |
| 80 | + | cret := xTabBarGetEndActionWidget(x.GoPointer()) | |
| 88 | 81 | ||
| 82 | + | if cret == 0 { | |
| 83 | + | return cls | |
| 84 | + | } | |
| 85 | + | gobject.IncreaseRef(cret) | |
| 86 | + | cls = >k.Widget{} | |
| 87 | + | cls.Ptr = cret | |
| 88 | + | return cls | |
| 89 | 89 | } | |
| 90 | 90 | ||
| 91 | 91 | var xTabBarGetExpandTabs func(uintptr) bool | |
| @@ -93,8 +93,8 @@ var xTabBarGetExpandTabs func(uintptr) bool | |||
| 93 | 93 | // Gets whether tabs expand to full width. | |
| 94 | 94 | func (x *TabBar) GetExpandTabs() bool { | |
| 95 | 95 | ||
| 96 | - | return xTabBarGetExpandTabs(x.GoPointer()) | |
| 97 | - | ||
| 96 | + | cret := xTabBarGetExpandTabs(x.GoPointer()) | |
| 97 | + | return cret | |
| 98 | 98 | } | |
| 99 | 99 | ||
| 100 | 100 | var xTabBarGetExtraDragPreload func(uintptr) bool | |
| @@ -102,8 +102,8 @@ var xTabBarGetExtraDragPreload func(uintptr) bool | |||
| 102 | 102 | // Gets whether drop data should be preloaded on hover. | |
| 103 | 103 | func (x *TabBar) GetExtraDragPreload() bool { | |
| 104 | 104 | ||
| 105 | - | return xTabBarGetExtraDragPreload(x.GoPointer()) | |
| 106 | - | ||
| 105 | + | cret := xTabBarGetExtraDragPreload(x.GoPointer()) | |
| 106 | + | return cret | |
| 107 | 107 | } | |
| 108 | 108 | ||
| 109 | 109 | var xTabBarGetInverted func(uintptr) bool | |
| @@ -111,8 +111,8 @@ var xTabBarGetInverted func(uintptr) bool | |||
| 111 | 111 | // Gets whether tabs use inverted layout. | |
| 112 | 112 | func (x *TabBar) GetInverted() bool { | |
| 113 | 113 | ||
| 114 | - | return xTabBarGetInverted(x.GoPointer()) | |
| 115 | - | ||
| 114 | + | cret := xTabBarGetInverted(x.GoPointer()) | |
| 115 | + | return cret | |
| 116 | 116 | } | |
| 117 | 117 | ||
| 118 | 118 | var xTabBarGetIsOverflowing func(uintptr) bool | |
| @@ -122,26 +122,25 @@ var xTabBarGetIsOverflowing func(uintptr) bool | |||
| 122 | 122 | // If `TRUE`, all tabs cannot be displayed at once and require scrolling. | |
| 123 | 123 | func (x *TabBar) GetIsOverflowing() bool { | |
| 124 | 124 | ||
| 125 | - | return xTabBarGetIsOverflowing(x.GoPointer()) | |
| 126 | - | ||
| 125 | + | cret := xTabBarGetIsOverflowing(x.GoPointer()) | |
| 126 | + | return cret | |
| 127 | 127 | } | |
| 128 | 128 | ||
| 129 | 129 | var xTabBarGetStartActionWidget func(uintptr) uintptr | |
| 130 | 130 | ||
| 131 | 131 | // Gets the widget shown before the tabs. | |
| 132 | 132 | func (x *TabBar) GetStartActionWidget() *gtk.Widget { | |
| 133 | + | var cls *gtk.Widget | |
| 133 | 134 | ||
| 134 | - | GetStartActionWidgetPtr := xTabBarGetStartActionWidget(x.GoPointer()) | |
| 135 | - | if GetStartActionWidgetPtr == 0 { | |
| 136 | - | return nil | |
| 137 | - | } | |
| 138 | - | ||
| 139 | - | gobject.IncreaseRef(GetStartActionWidgetPtr) | |
| 140 | - | ||
| 141 | - | GetStartActionWidgetCls := >k.Widget{} | |
| 142 | - | GetStartActionWidgetCls.Ptr = GetStartActionWidgetPtr | |
| 143 | - | return GetStartActionWidgetCls | |
| 135 | + | cret := xTabBarGetStartActionWidget(x.GoPointer()) | |
| 144 | 136 | ||
| 137 | + | if cret == 0 { | |
| 138 | + | return cls | |
| 139 | + | } | |
| 140 | + | gobject.IncreaseRef(cret) | |
| 141 | + | cls = >k.Widget{} | |
| 142 | + | cls.Ptr = cret | |
| 143 | + | return cls | |
| 145 | 144 | } | |
| 146 | 145 | ||
| 147 | 146 | var xTabBarGetTabsRevealed func(uintptr) bool | |
| @@ -151,26 +150,25 @@ var xTabBarGetTabsRevealed func(uintptr) bool | |||
| 151 | 150 | // See [property@TabBar:autohide]. | |
| 152 | 151 | func (x *TabBar) GetTabsRevealed() bool { | |
| 153 | 152 | ||
| 154 | - | return xTabBarGetTabsRevealed(x.GoPointer()) | |
| 155 | - | ||
| 153 | + | cret := xTabBarGetTabsRevealed(x.GoPointer()) | |
| 154 | + | return cret | |
| 156 | 155 | } | |
| 157 | 156 | ||
| 158 | 157 | var xTabBarGetView func(uintptr) uintptr | |
| 159 | 158 | ||
| 160 | 159 | // Gets the tab view @self controls. | |
| 161 | 160 | func (x *TabBar) GetView() *TabView { | |
| 161 | + | var cls *TabView | |
| 162 | 162 | ||
| 163 | - | GetViewPtr := xTabBarGetView(x.GoPointer()) | |
| 164 | - | if GetViewPtr == 0 { | |
| 165 | - | return nil | |
| 166 | - | } | |
| 167 | - | ||
| 168 | - | gobject.IncreaseRef(GetViewPtr) | |
| 169 | - | ||
| 170 | - | GetViewCls := &TabView{} | |
| 171 | - | GetViewCls.Ptr = GetViewPtr | |
| 172 | - | return GetViewCls | |
| 163 | + | cret := xTabBarGetView(x.GoPointer()) | |
| 173 | 164 | ||
| 165 | + | if cret == 0 { | |
| 166 | + | return cls | |
| 167 | + | } | |
| 168 | + | gobject.IncreaseRef(cret) | |
| 169 | + | cls = &TabView{} | |
| 170 | + | cls.Ptr = cret | |
| 171 | + | return cls | |
| 174 | 172 | } | |
| 175 | 173 | ||
| 176 | 174 | var xTabBarSetAutohide func(uintptr, bool) | |
| @@ -316,8 +314,8 @@ func (x *TabBar) ConnectExtraDragValue(cb func(TabBar, uintptr, uintptr) gdk.Dra | |||
| 316 | 314 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 317 | 315 | func (x *TabBar) GetAccessibleRole() gtk.AccessibleRole { | |
| 318 | 316 | ||
| 319 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 320 | - | ||
| 317 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 318 | + | return cret | |
| 321 | 319 | } | |
| 322 | 320 | ||
| 323 | 321 | // Resets the accessible @property to its default value. | |
| @@ -452,8 +450,8 @@ func (x *TabBar) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVar u | |||
| 452 | 450 | // of the <object> tag used to construct the @buildable. | |
| 453 | 451 | func (x *TabBar) GetBuildableId() string { | |
| 454 | 452 | ||
| 455 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 456 | - | ||
| 453 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 454 | + | return cret | |
| 457 | 455 | } | |
| 458 | 456 | ||
| 459 | 457 | func init() { | |
M v4/adw/adw-tab-button.go +26 -26
| @@ -59,34 +59,34 @@ var xNewTabButton func() uintptr | |||
| 59 | 59 | ||
| 60 | 60 | // Creates a new `AdwTabButton`. | |
| 61 | 61 | func NewTabButton() *gtk.Widget { | |
| 62 | - | NewTabButtonPtr := xNewTabButton() | |
| 63 | - | if NewTabButtonPtr == 0 { | |
| 64 | - | return nil | |
| 65 | - | } | |
| 62 | + | var cls *gtk.Widget | |
| 66 | 63 | ||
| 67 | - | gobject.IncreaseRef(NewTabButtonPtr) | |
| 64 | + | cret := xNewTabButton() | |
| 68 | 65 | ||
| 69 | - | NewTabButtonCls := >k.Widget{} | |
| 70 | - | NewTabButtonCls.Ptr = NewTabButtonPtr | |
| 71 | - | return NewTabButtonCls | |
| 66 | + | if cret == 0 { | |
| 67 | + | return cls | |
| 68 | + | } | |
| 69 | + | gobject.IncreaseRef(cret) | |
| 70 | + | cls = >k.Widget{} | |
| 71 | + | cls.Ptr = cret | |
| 72 | + | return cls | |
| 72 | 73 | } | |
| 73 | 74 | ||
| 74 | 75 | var xTabButtonGetView func(uintptr) uintptr | |
| 75 | 76 | ||
| 76 | 77 | // Gets the tab view @self displays. | |
| 77 | 78 | func (x *TabButton) GetView() *TabView { | |
| 79 | + | var cls *TabView | |
| 78 | 80 | ||
| 79 | - | GetViewPtr := xTabButtonGetView(x.GoPointer()) | |
| 80 | - | if GetViewPtr == 0 { | |
| 81 | - | return nil | |
| 82 | - | } | |
| 83 | - | ||
| 84 | - | gobject.IncreaseRef(GetViewPtr) | |
| 85 | - | ||
| 86 | - | GetViewCls := &TabView{} | |
| 87 | - | GetViewCls.Ptr = GetViewPtr | |
| 88 | - | return GetViewCls | |
| 81 | + | cret := xTabButtonGetView(x.GoPointer()) | |
| 89 | 82 | ||
| 83 | + | if cret == 0 { | |
| 84 | + | return cls | |
| 85 | + | } | |
| 86 | + | gobject.IncreaseRef(cret) | |
| 87 | + | cls = &TabView{} | |
| 88 | + | cls.Ptr = cret | |
| 89 | + | return cls | |
| 90 | 90 | } | |
| 91 | 91 | ||
| 92 | 92 | var xTabButtonSetView func(uintptr, uintptr) | |
| @@ -136,8 +136,8 @@ func (x *TabButton) ConnectClicked(cb func(TabButton)) { | |||
| 136 | 136 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 137 | 137 | func (x *TabButton) GetAccessibleRole() gtk.AccessibleRole { | |
| 138 | 138 | ||
| 139 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 140 | - | ||
| 139 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 140 | + | return cret | |
| 141 | 141 | } | |
| 142 | 142 | ||
| 143 | 143 | // Resets the accessible @property to its default value. | |
| @@ -269,15 +269,15 @@ func (x *TabButton) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVa | |||
| 269 | 269 | // Gets the action name for @actionable. | |
| 270 | 270 | func (x *TabButton) GetActionName() string { | |
| 271 | 271 | ||
| 272 | - | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 273 | - | ||
| 272 | + | cret := gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 273 | + | return cret | |
| 274 | 274 | } | |
| 275 | 275 | ||
| 276 | 276 | // Gets the current target value of @actionable. | |
| 277 | 277 | func (x *TabButton) GetActionTargetValue() *glib.Variant { | |
| 278 | 278 | ||
| 279 | - | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 280 | - | ||
| 279 | + | cret := gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 280 | + | return cret | |
| 281 | 281 | } | |
| 282 | 282 | ||
| 283 | 283 | // Specifies the name of the action with which this widget should be | |
| @@ -355,8 +355,8 @@ func (x *TabButton) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 355 | 355 | // of the <object> tag used to construct the @buildable. | |
| 356 | 356 | func (x *TabButton) GetBuildableId() string { | |
| 357 | 357 | ||
| 358 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 359 | - | ||
| 358 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 359 | + | return cret | |
| 360 | 360 | } | |
| 361 | 361 | ||
| 362 | 362 | func init() { | |
M v4/adw/adw-tab-overview.go +56 -58
| @@ -86,34 +86,34 @@ var xNewTabOverview func() uintptr | |||
| 86 | 86 | ||
| 87 | 87 | // Creates a new `AdwTabOverview`. | |
| 88 | 88 | func NewTabOverview() *gtk.Widget { | |
| 89 | - | NewTabOverviewPtr := xNewTabOverview() | |
| 90 | - | if NewTabOverviewPtr == 0 { | |
| 91 | - | return nil | |
| 92 | - | } | |
| 89 | + | var cls *gtk.Widget | |
| 93 | 90 | ||
| 94 | - | gobject.IncreaseRef(NewTabOverviewPtr) | |
| 91 | + | cret := xNewTabOverview() | |
| 95 | 92 | ||
| 96 | - | NewTabOverviewCls := >k.Widget{} | |
| 97 | - | NewTabOverviewCls.Ptr = NewTabOverviewPtr | |
| 98 | - | return NewTabOverviewCls | |
| 93 | + | if cret == 0 { | |
| 94 | + | return cls | |
| 95 | + | } | |
| 96 | + | gobject.IncreaseRef(cret) | |
| 97 | + | cls = >k.Widget{} | |
| 98 | + | cls.Ptr = cret | |
| 99 | + | return cls | |
| 99 | 100 | } | |
| 100 | 101 | ||
| 101 | 102 | var xTabOverviewGetChild func(uintptr) uintptr | |
| 102 | 103 | ||
| 103 | 104 | // Gets the child widget of @self. | |
| 104 | 105 | func (x *TabOverview) GetChild() *gtk.Widget { | |
| 106 | + | var cls *gtk.Widget | |
| 105 | 107 | ||
| 106 | - | GetChildPtr := xTabOverviewGetChild(x.GoPointer()) | |
| 107 | - | if GetChildPtr == 0 { | |
| 108 | - | return nil | |
| 109 | - | } | |
| 110 | - | ||
| 111 | - | gobject.IncreaseRef(GetChildPtr) | |
| 112 | - | ||
| 113 | - | GetChildCls := >k.Widget{} | |
| 114 | - | GetChildCls.Ptr = GetChildPtr | |
| 115 | - | return GetChildCls | |
| 108 | + | cret := xTabOverviewGetChild(x.GoPointer()) | |
| 116 | 109 | ||
| 110 | + | if cret == 0 { | |
| 111 | + | return cls | |
| 112 | + | } | |
| 113 | + | gobject.IncreaseRef(cret) | |
| 114 | + | cls = >k.Widget{} | |
| 115 | + | cls.Ptr = cret | |
| 116 | + | return cls | |
| 117 | 117 | } | |
| 118 | 118 | ||
| 119 | 119 | var xTabOverviewGetEnableNewTab func(uintptr) bool | |
| @@ -121,8 +121,8 @@ var xTabOverviewGetEnableNewTab func(uintptr) bool | |||
| 121 | 121 | // Gets whether to new tab button is enabled for @self. | |
| 122 | 122 | func (x *TabOverview) GetEnableNewTab() bool { | |
| 123 | 123 | ||
| 124 | - | return xTabOverviewGetEnableNewTab(x.GoPointer()) | |
| 125 | - | ||
| 124 | + | cret := xTabOverviewGetEnableNewTab(x.GoPointer()) | |
| 125 | + | return cret | |
| 126 | 126 | } | |
| 127 | 127 | ||
| 128 | 128 | var xTabOverviewGetEnableSearch func(uintptr) bool | |
| @@ -130,8 +130,8 @@ var xTabOverviewGetEnableSearch func(uintptr) bool | |||
| 130 | 130 | // Gets whether search in tabs is enabled for @self. | |
| 131 | 131 | func (x *TabOverview) GetEnableSearch() bool { | |
| 132 | 132 | ||
| 133 | - | return xTabOverviewGetEnableSearch(x.GoPointer()) | |
| 134 | - | ||
| 133 | + | cret := xTabOverviewGetEnableSearch(x.GoPointer()) | |
| 134 | + | return cret | |
| 135 | 135 | } | |
| 136 | 136 | ||
| 137 | 137 | var xTabOverviewGetExtraDragPreload func(uintptr) bool | |
| @@ -139,8 +139,8 @@ var xTabOverviewGetExtraDragPreload func(uintptr) bool | |||
| 139 | 139 | // Gets whether drop data should be preloaded on hover. | |
| 140 | 140 | func (x *TabOverview) GetExtraDragPreload() bool { | |
| 141 | 141 | ||
| 142 | - | return xTabOverviewGetExtraDragPreload(x.GoPointer()) | |
| 143 | - | ||
| 142 | + | cret := xTabOverviewGetExtraDragPreload(x.GoPointer()) | |
| 143 | + | return cret | |
| 144 | 144 | } | |
| 145 | 145 | ||
| 146 | 146 | var xTabOverviewGetInverted func(uintptr) bool | |
| @@ -148,8 +148,8 @@ var xTabOverviewGetInverted func(uintptr) bool | |||
| 148 | 148 | // Gets whether thumbnails use inverted layout. | |
| 149 | 149 | func (x *TabOverview) GetInverted() bool { | |
| 150 | 150 | ||
| 151 | - | return xTabOverviewGetInverted(x.GoPointer()) | |
| 152 | - | ||
| 151 | + | cret := xTabOverviewGetInverted(x.GoPointer()) | |
| 152 | + | return cret | |
| 153 | 153 | } | |
| 154 | 154 | ||
| 155 | 155 | var xTabOverviewGetOpen func(uintptr) bool | |
| @@ -157,8 +157,8 @@ var xTabOverviewGetOpen func(uintptr) bool | |||
| 157 | 157 | // Gets whether @self is open. | |
| 158 | 158 | func (x *TabOverview) GetOpen() bool { | |
| 159 | 159 | ||
| 160 | - | return xTabOverviewGetOpen(x.GoPointer()) | |
| 161 | - | ||
| 160 | + | cret := xTabOverviewGetOpen(x.GoPointer()) | |
| 161 | + | return cret | |
| 162 | 162 | } | |
| 163 | 163 | ||
| 164 | 164 | var xTabOverviewGetSearchActive func(uintptr) bool | |
| @@ -168,26 +168,25 @@ var xTabOverviewGetSearchActive func(uintptr) bool | |||
| 168 | 168 | // See [property@TabOverview:enable-search]. | |
| 169 | 169 | func (x *TabOverview) GetSearchActive() bool { | |
| 170 | 170 | ||
| 171 | - | return xTabOverviewGetSearchActive(x.GoPointer()) | |
| 172 | - | ||
| 171 | + | cret := xTabOverviewGetSearchActive(x.GoPointer()) | |
| 172 | + | return cret | |
| 173 | 173 | } | |
| 174 | 174 | ||
| 175 | 175 | var xTabOverviewGetSecondaryMenu func(uintptr) uintptr | |
| 176 | 176 | ||
| 177 | 177 | // Gets the secondary menu model for @self. | |
| 178 | 178 | func (x *TabOverview) GetSecondaryMenu() *gio.MenuModel { | |
| 179 | + | var cls *gio.MenuModel | |
| 179 | 180 | ||
| 180 | - | GetSecondaryMenuPtr := xTabOverviewGetSecondaryMenu(x.GoPointer()) | |
| 181 | - | if GetSecondaryMenuPtr == 0 { | |
| 182 | - | return nil | |
| 183 | - | } | |
| 184 | - | ||
| 185 | - | gobject.IncreaseRef(GetSecondaryMenuPtr) | |
| 186 | - | ||
| 187 | - | GetSecondaryMenuCls := &gio.MenuModel{} | |
| 188 | - | GetSecondaryMenuCls.Ptr = GetSecondaryMenuPtr | |
| 189 | - | return GetSecondaryMenuCls | |
| 181 | + | cret := xTabOverviewGetSecondaryMenu(x.GoPointer()) | |
| 190 | 182 | ||
| 183 | + | if cret == 0 { | |
| 184 | + | return cls | |
| 185 | + | } | |
| 186 | + | gobject.IncreaseRef(cret) | |
| 187 | + | cls = &gio.MenuModel{} | |
| 188 | + | cls.Ptr = cret | |
| 189 | + | return cls | |
| 191 | 190 | } | |
| 192 | 191 | ||
| 193 | 192 | var xTabOverviewGetShowEndTitleButtons func(uintptr) bool | |
| @@ -195,8 +194,8 @@ var xTabOverviewGetShowEndTitleButtons func(uintptr) bool | |||
| 195 | 194 | // Gets whether end title buttons are shown in @self's header bar. | |
| 196 | 195 | func (x *TabOverview) GetShowEndTitleButtons() bool { | |
| 197 | 196 | ||
| 198 | - | return xTabOverviewGetShowEndTitleButtons(x.GoPointer()) | |
| 199 | - | ||
| 197 | + | cret := xTabOverviewGetShowEndTitleButtons(x.GoPointer()) | |
| 198 | + | return cret | |
| 200 | 199 | } | |
| 201 | 200 | ||
| 202 | 201 | var xTabOverviewGetShowStartTitleButtons func(uintptr) bool | |
| @@ -204,26 +203,25 @@ var xTabOverviewGetShowStartTitleButtons func(uintptr) bool | |||
| 204 | 203 | // Gets whether start title buttons are shown in @self's header bar. | |
| 205 | 204 | func (x *TabOverview) GetShowStartTitleButtons() bool { | |
| 206 | 205 | ||
| 207 | - | return xTabOverviewGetShowStartTitleButtons(x.GoPointer()) | |
| 208 | - | ||
| 206 | + | cret := xTabOverviewGetShowStartTitleButtons(x.GoPointer()) | |
| 207 | + | return cret | |
| 209 | 208 | } | |
| 210 | 209 | ||
| 211 | 210 | var xTabOverviewGetView func(uintptr) uintptr | |
| 212 | 211 | ||
| 213 | 212 | // Gets the tab view @self controls. | |
| 214 | 213 | func (x *TabOverview) GetView() *TabView { | |
| 214 | + | var cls *TabView | |
| 215 | 215 | ||
| 216 | - | GetViewPtr := xTabOverviewGetView(x.GoPointer()) | |
| 217 | - | if GetViewPtr == 0 { | |
| 218 | - | return nil | |
| 219 | - | } | |
| 220 | - | ||
| 221 | - | gobject.IncreaseRef(GetViewPtr) | |
| 222 | - | ||
| 223 | - | GetViewCls := &TabView{} | |
| 224 | - | GetViewCls.Ptr = GetViewPtr | |
| 225 | - | return GetViewCls | |
| 216 | + | cret := xTabOverviewGetView(x.GoPointer()) | |
| 226 | 217 | ||
| 218 | + | if cret == 0 { | |
| 219 | + | return cls | |
| 220 | + | } | |
| 221 | + | gobject.IncreaseRef(cret) | |
| 222 | + | cls = &TabView{} | |
| 223 | + | cls.Ptr = cret | |
| 224 | + | return cls | |
| 227 | 225 | } | |
| 228 | 226 | ||
| 229 | 227 | var xTabOverviewSetChild func(uintptr, uintptr) | |
| @@ -427,8 +425,8 @@ func (x *TabOverview) ConnectExtraDragValue(cb func(TabOverview, uintptr, uintpt | |||
| 427 | 425 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 428 | 426 | func (x *TabOverview) GetAccessibleRole() gtk.AccessibleRole { | |
| 429 | 427 | ||
| 430 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 431 | - | ||
| 428 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 429 | + | return cret | |
| 432 | 430 | } | |
| 433 | 431 | ||
| 434 | 432 | // Resets the accessible @property to its default value. | |
| @@ -563,8 +561,8 @@ func (x *TabOverview) UpdateStateValue(NStatesVar int, StatesVar uintptr, Values | |||
| 563 | 561 | // of the <object> tag used to construct the @buildable. | |
| 564 | 562 | func (x *TabOverview) GetBuildableId() string { | |
| 565 | 563 | ||
| 566 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 567 | - | ||
| 564 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 565 | + | return cret | |
| 568 | 566 | } | |
| 569 | 567 | ||
| 570 | 568 | func init() { | |
M v4/adw/adw-tab-view.go +215 -230
| @@ -78,36 +78,34 @@ var xTabPageGetChild func(uintptr) uintptr | |||
| 78 | 78 | ||
| 79 | 79 | // Gets the child of @self. | |
| 80 | 80 | func (x *TabPage) GetChild() *gtk.Widget { | |
| 81 | + | var cls *gtk.Widget | |
| 81 | 82 | ||
| 82 | - | GetChildPtr := xTabPageGetChild(x.GoPointer()) | |
| 83 | - | if GetChildPtr == 0 { | |
| 84 | - | return nil | |
| 85 | - | } | |
| 86 | - | ||
| 87 | - | gobject.IncreaseRef(GetChildPtr) | |
| 88 | - | ||
| 89 | - | GetChildCls := >k.Widget{} | |
| 90 | - | GetChildCls.Ptr = GetChildPtr | |
| 91 | - | return GetChildCls | |
| 83 | + | cret := xTabPageGetChild(x.GoPointer()) | |
| 92 | 84 | ||
| 85 | + | if cret == 0 { | |
| 86 | + | return cls | |
| 87 | + | } | |
| 88 | + | gobject.IncreaseRef(cret) | |
| 89 | + | cls = >k.Widget{} | |
| 90 | + | cls.Ptr = cret | |
| 91 | + | return cls | |
| 93 | 92 | } | |
| 94 | 93 | ||
| 95 | 94 | var xTabPageGetIcon func(uintptr) uintptr | |
| 96 | 95 | ||
| 97 | 96 | // Gets the icon of @self. | |
| 98 | 97 | func (x *TabPage) GetIcon() *gio.IconBase { | |
| 98 | + | var cls *gio.IconBase | |
| 99 | 99 | ||
| 100 | - | GetIconPtr := xTabPageGetIcon(x.GoPointer()) | |
| 101 | - | if GetIconPtr == 0 { | |
| 102 | - | return nil | |
| 103 | - | } | |
| 104 | - | ||
| 105 | - | gobject.IncreaseRef(GetIconPtr) | |
| 106 | - | ||
| 107 | - | GetIconCls := &gio.IconBase{} | |
| 108 | - | GetIconCls.Ptr = GetIconPtr | |
| 109 | - | return GetIconCls | |
| 100 | + | cret := xTabPageGetIcon(x.GoPointer()) | |
| 110 | 101 | ||
| 102 | + | if cret == 0 { | |
| 103 | + | return cls | |
| 104 | + | } | |
| 105 | + | gobject.IncreaseRef(cret) | |
| 106 | + | cls = &gio.IconBase{} | |
| 107 | + | cls.Ptr = cret | |
| 108 | + | return cls | |
| 111 | 109 | } | |
| 112 | 110 | ||
| 113 | 111 | var xTabPageGetIndicatorActivatable func(uintptr) bool | |
| @@ -115,26 +113,25 @@ var xTabPageGetIndicatorActivatable func(uintptr) bool | |||
| 115 | 113 | // Gets whether the indicator of @self is activatable. | |
| 116 | 114 | func (x *TabPage) GetIndicatorActivatable() bool { | |
| 117 | 115 | ||
| 118 | - | return xTabPageGetIndicatorActivatable(x.GoPointer()) | |
| 119 | - | ||
| 116 | + | cret := xTabPageGetIndicatorActivatable(x.GoPointer()) | |
| 117 | + | return cret | |
| 120 | 118 | } | |
| 121 | 119 | ||
| 122 | 120 | var xTabPageGetIndicatorIcon func(uintptr) uintptr | |
| 123 | 121 | ||
| 124 | 122 | // Gets the indicator icon of @self. | |
| 125 | 123 | func (x *TabPage) GetIndicatorIcon() *gio.IconBase { | |
| 124 | + | var cls *gio.IconBase | |
| 126 | 125 | ||
| 127 | - | GetIndicatorIconPtr := xTabPageGetIndicatorIcon(x.GoPointer()) | |
| 128 | - | if GetIndicatorIconPtr == 0 { | |
| 129 | - | return nil | |
| 130 | - | } | |
| 131 | - | ||
| 132 | - | gobject.IncreaseRef(GetIndicatorIconPtr) | |
| 133 | - | ||
| 134 | - | GetIndicatorIconCls := &gio.IconBase{} | |
| 135 | - | GetIndicatorIconCls.Ptr = GetIndicatorIconPtr | |
| 136 | - | return GetIndicatorIconCls | |
| 126 | + | cret := xTabPageGetIndicatorIcon(x.GoPointer()) | |
| 137 | 127 | ||
| 128 | + | if cret == 0 { | |
| 129 | + | return cls | |
| 130 | + | } | |
| 131 | + | gobject.IncreaseRef(cret) | |
| 132 | + | cls = &gio.IconBase{} | |
| 133 | + | cls.Ptr = cret | |
| 134 | + | return cls | |
| 138 | 135 | } | |
| 139 | 136 | ||
| 140 | 137 | var xTabPageGetIndicatorTooltip func(uintptr) string | |
| @@ -142,8 +139,8 @@ var xTabPageGetIndicatorTooltip func(uintptr) string | |||
| 142 | 139 | // Gets the tooltip of the indicator icon of @self. | |
| 143 | 140 | func (x *TabPage) GetIndicatorTooltip() string { | |
| 144 | 141 | ||
| 145 | - | return xTabPageGetIndicatorTooltip(x.GoPointer()) | |
| 146 | - | ||
| 142 | + | cret := xTabPageGetIndicatorTooltip(x.GoPointer()) | |
| 143 | + | return cret | |
| 147 | 144 | } | |
| 148 | 145 | ||
| 149 | 146 | var xTabPageGetKeyword func(uintptr) string | |
| @@ -151,8 +148,8 @@ var xTabPageGetKeyword func(uintptr) string | |||
| 151 | 148 | // Gets the search keyword of @self. | |
| 152 | 149 | func (x *TabPage) GetKeyword() string { | |
| 153 | 150 | ||
| 154 | - | return xTabPageGetKeyword(x.GoPointer()) | |
| 155 | - | ||
| 151 | + | cret := xTabPageGetKeyword(x.GoPointer()) | |
| 152 | + | return cret | |
| 156 | 153 | } | |
| 157 | 154 | ||
| 158 | 155 | var xTabPageGetLiveThumbnail func(uintptr) bool | |
| @@ -160,8 +157,8 @@ var xTabPageGetLiveThumbnail func(uintptr) bool | |||
| 160 | 157 | // Gets whether to live thumbnail is enabled @self. | |
| 161 | 158 | func (x *TabPage) GetLiveThumbnail() bool { | |
| 162 | 159 | ||
| 163 | - | return xTabPageGetLiveThumbnail(x.GoPointer()) | |
| 164 | - | ||
| 160 | + | cret := xTabPageGetLiveThumbnail(x.GoPointer()) | |
| 161 | + | return cret | |
| 165 | 162 | } | |
| 166 | 163 | ||
| 167 | 164 | var xTabPageGetLoading func(uintptr) bool | |
| @@ -169,8 +166,8 @@ var xTabPageGetLoading func(uintptr) bool | |||
| 169 | 166 | // Gets whether @self is loading. | |
| 170 | 167 | func (x *TabPage) GetLoading() bool { | |
| 171 | 168 | ||
| 172 | - | return xTabPageGetLoading(x.GoPointer()) | |
| 173 | - | ||
| 169 | + | cret := xTabPageGetLoading(x.GoPointer()) | |
| 170 | + | return cret | |
| 174 | 171 | } | |
| 175 | 172 | ||
| 176 | 173 | var xTabPageGetNeedsAttention func(uintptr) bool | |
| @@ -178,8 +175,8 @@ var xTabPageGetNeedsAttention func(uintptr) bool | |||
| 178 | 175 | // Gets whether @self needs attention. | |
| 179 | 176 | func (x *TabPage) GetNeedsAttention() bool { | |
| 180 | 177 | ||
| 181 | - | return xTabPageGetNeedsAttention(x.GoPointer()) | |
| 182 | - | ||
| 178 | + | cret := xTabPageGetNeedsAttention(x.GoPointer()) | |
| 179 | + | return cret | |
| 183 | 180 | } | |
| 184 | 181 | ||
| 185 | 182 | var xTabPageGetParent func(uintptr) uintptr | |
| @@ -188,18 +185,17 @@ var xTabPageGetParent func(uintptr) uintptr | |||
| 188 | 185 | // | |
| 189 | 186 | // See [method@TabView.add_page] and [method@TabView.close_page]. | |
| 190 | 187 | func (x *TabPage) GetParent() *TabPage { | |
| 188 | + | var cls *TabPage | |
| 191 | 189 | ||
| 192 | - | GetParentPtr := xTabPageGetParent(x.GoPointer()) | |
| 193 | - | if GetParentPtr == 0 { | |
| 194 | - | return nil | |
| 195 | - | } | |
| 196 | - | ||
| 197 | - | gobject.IncreaseRef(GetParentPtr) | |
| 198 | - | ||
| 199 | - | GetParentCls := &TabPage{} | |
| 200 | - | GetParentCls.Ptr = GetParentPtr | |
| 201 | - | return GetParentCls | |
| 190 | + | cret := xTabPageGetParent(x.GoPointer()) | |
| 202 | 191 | ||
| 192 | + | if cret == 0 { | |
| 193 | + | return cls | |
| 194 | + | } | |
| 195 | + | gobject.IncreaseRef(cret) | |
| 196 | + | cls = &TabPage{} | |
| 197 | + | cls.Ptr = cret | |
| 198 | + | return cls | |
| 203 | 199 | } | |
| 204 | 200 | ||
| 205 | 201 | var xTabPageGetPinned func(uintptr) bool | |
| @@ -209,8 +205,8 @@ var xTabPageGetPinned func(uintptr) bool | |||
| 209 | 205 | // See [method@TabView.set_page_pinned]. | |
| 210 | 206 | func (x *TabPage) GetPinned() bool { | |
| 211 | 207 | ||
| 212 | - | return xTabPageGetPinned(x.GoPointer()) | |
| 213 | - | ||
| 208 | + | cret := xTabPageGetPinned(x.GoPointer()) | |
| 209 | + | return cret | |
| 214 | 210 | } | |
| 215 | 211 | ||
| 216 | 212 | var xTabPageGetSelected func(uintptr) bool | |
| @@ -218,8 +214,8 @@ var xTabPageGetSelected func(uintptr) bool | |||
| 218 | 214 | // Gets whether @self is selected. | |
| 219 | 215 | func (x *TabPage) GetSelected() bool { | |
| 220 | 216 | ||
| 221 | - | return xTabPageGetSelected(x.GoPointer()) | |
| 222 | - | ||
| 217 | + | cret := xTabPageGetSelected(x.GoPointer()) | |
| 218 | + | return cret | |
| 223 | 219 | } | |
| 224 | 220 | ||
| 225 | 221 | var xTabPageGetThumbnailXalign func(uintptr) float32 | |
| @@ -227,8 +223,8 @@ var xTabPageGetThumbnailXalign func(uintptr) float32 | |||
| 227 | 223 | // Gets the horizontal alignment of the thumbnail for @self. | |
| 228 | 224 | func (x *TabPage) GetThumbnailXalign() float32 { | |
| 229 | 225 | ||
| 230 | - | return xTabPageGetThumbnailXalign(x.GoPointer()) | |
| 231 | - | ||
| 226 | + | cret := xTabPageGetThumbnailXalign(x.GoPointer()) | |
| 227 | + | return cret | |
| 232 | 228 | } | |
| 233 | 229 | ||
| 234 | 230 | var xTabPageGetThumbnailYalign func(uintptr) float32 | |
| @@ -236,8 +232,8 @@ var xTabPageGetThumbnailYalign func(uintptr) float32 | |||
| 236 | 232 | // Gets the vertical alignment of the thumbnail for @self. | |
| 237 | 233 | func (x *TabPage) GetThumbnailYalign() float32 { | |
| 238 | 234 | ||
| 239 | - | return xTabPageGetThumbnailYalign(x.GoPointer()) | |
| 240 | - | ||
| 235 | + | cret := xTabPageGetThumbnailYalign(x.GoPointer()) | |
| 236 | + | return cret | |
| 241 | 237 | } | |
| 242 | 238 | ||
| 243 | 239 | var xTabPageGetTitle func(uintptr) string | |
| @@ -245,8 +241,8 @@ var xTabPageGetTitle func(uintptr) string | |||
| 245 | 241 | // Gets the title of @self. | |
| 246 | 242 | func (x *TabPage) GetTitle() string { | |
| 247 | 243 | ||
| 248 | - | return xTabPageGetTitle(x.GoPointer()) | |
| 249 | - | ||
| 244 | + | cret := xTabPageGetTitle(x.GoPointer()) | |
| 245 | + | return cret | |
| 250 | 246 | } | |
| 251 | 247 | ||
| 252 | 248 | var xTabPageGetTooltip func(uintptr) string | |
| @@ -254,8 +250,8 @@ var xTabPageGetTooltip func(uintptr) string | |||
| 254 | 250 | // Gets the tooltip of @self. | |
| 255 | 251 | func (x *TabPage) GetTooltip() string { | |
| 256 | 252 | ||
| 257 | - | return xTabPageGetTooltip(x.GoPointer()) | |
| 258 | - | ||
| 253 | + | cret := xTabPageGetTooltip(x.GoPointer()) | |
| 254 | + | return cret | |
| 259 | 255 | } | |
| 260 | 256 | ||
| 261 | 257 | var xTabPageInvalidateThumbnail func(uintptr) | |
| @@ -483,8 +479,8 @@ func (c *TabPage) SetGoPointer(ptr uintptr) { | |||
| 483 | 479 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 484 | 480 | func (x *TabPage) GetAccessibleRole() gtk.AccessibleRole { | |
| 485 | 481 | ||
| 486 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 487 | - | ||
| 482 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 483 | + | return cret | |
| 488 | 484 | } | |
| 489 | 485 | ||
| 490 | 486 | // Resets the accessible @property to its default value. | |
| @@ -670,16 +666,17 @@ var xNewTabView func() uintptr | |||
| 670 | 666 | ||
| 671 | 667 | // Creates a new `AdwTabView`. | |
| 672 | 668 | func NewTabView() *TabView { | |
| 673 | - | NewTabViewPtr := xNewTabView() | |
| 674 | - | if NewTabViewPtr == 0 { | |
| 675 | - | return nil | |
| 676 | - | } | |
| 669 | + | var cls *TabView | |
| 677 | 670 | ||
| 678 | - | gobject.IncreaseRef(NewTabViewPtr) | |
| 671 | + | cret := xNewTabView() | |
| 679 | 672 | ||
| 680 | - | NewTabViewCls := &TabView{} | |
| 681 | - | NewTabViewCls.Ptr = NewTabViewPtr | |
| 682 | - | return NewTabViewCls | |
| 673 | + | if cret == 0 { | |
| 674 | + | return cls | |
| 675 | + | } | |
| 676 | + | gobject.IncreaseRef(cret) | |
| 677 | + | cls = &TabView{} | |
| 678 | + | cls.Ptr = cret | |
| 679 | + | return cls | |
| 683 | 680 | } | |
| 684 | 681 | ||
| 685 | 682 | var xTabViewAddPage func(uintptr, uintptr, uintptr) uintptr | |
| @@ -692,18 +689,17 @@ var xTabViewAddPage func(uintptr, uintptr, uintptr) uintptr | |||
| 692 | 689 | // | |
| 693 | 690 | // If @parent is `NULL`, this function is equivalent to [method@TabView.append]. | |
| 694 | 691 | func (x *TabView) AddPage(ChildVar *gtk.Widget, ParentVar *TabPage) *TabPage { | |
| 692 | + | var cls *TabPage | |
| 695 | 693 | ||
| 696 | - | AddPagePtr := xTabViewAddPage(x.GoPointer(), ChildVar.GoPointer(), ParentVar.GoPointer()) | |
| 697 | - | if AddPagePtr == 0 { | |
| 698 | - | return nil | |
| 699 | - | } | |
| 700 | - | ||
| 701 | - | gobject.IncreaseRef(AddPagePtr) | |
| 702 | - | ||
| 703 | - | AddPageCls := &TabPage{} | |
| 704 | - | AddPageCls.Ptr = AddPagePtr | |
| 705 | - | return AddPageCls | |
| 694 | + | cret := xTabViewAddPage(x.GoPointer(), ChildVar.GoPointer(), ParentVar.GoPointer()) | |
| 706 | 695 | ||
| 696 | + | if cret == 0 { | |
| 697 | + | return cls | |
| 698 | + | } | |
| 699 | + | gobject.IncreaseRef(cret) | |
| 700 | + | cls = &TabPage{} | |
| 701 | + | cls.Ptr = cret | |
| 702 | + | return cls | |
| 707 | 703 | } | |
| 708 | 704 | ||
| 709 | 705 | var xTabViewAddShortcuts func(uintptr, TabViewShortcuts) | |
| @@ -721,36 +717,34 @@ var xTabViewAppend func(uintptr, uintptr) uintptr | |||
| 721 | 717 | ||
| 722 | 718 | // Inserts @child as the last non-pinned page. | |
| 723 | 719 | func (x *TabView) Append(ChildVar *gtk.Widget) *TabPage { | |
| 720 | + | var cls *TabPage | |
| 724 | 721 | ||
| 725 | - | AppendPtr := xTabViewAppend(x.GoPointer(), ChildVar.GoPointer()) | |
| 726 | - | if AppendPtr == 0 { | |
| 727 | - | return nil | |
| 728 | - | } | |
| 729 | - | ||
| 730 | - | gobject.IncreaseRef(AppendPtr) | |
| 731 | - | ||
| 732 | - | AppendCls := &TabPage{} | |
| 733 | - | AppendCls.Ptr = AppendPtr | |
| 734 | - | return AppendCls | |
| 722 | + | cret := xTabViewAppend(x.GoPointer(), ChildVar.GoPointer()) | |
| 735 | 723 | ||
| 724 | + | if cret == 0 { | |
| 725 | + | return cls | |
| 726 | + | } | |
| 727 | + | gobject.IncreaseRef(cret) | |
| 728 | + | cls = &TabPage{} | |
| 729 | + | cls.Ptr = cret | |
| 730 | + | return cls | |
| 736 | 731 | } | |
| 737 | 732 | ||
| 738 | 733 | var xTabViewAppendPinned func(uintptr, uintptr) uintptr | |
| 739 | 734 | ||
| 740 | 735 | // Inserts @child as the last pinned page. | |
| 741 | 736 | func (x *TabView) AppendPinned(ChildVar *gtk.Widget) *TabPage { | |
| 737 | + | var cls *TabPage | |
| 742 | 738 | ||
| 743 | - | AppendPinnedPtr := xTabViewAppendPinned(x.GoPointer(), ChildVar.GoPointer()) | |
| 744 | - | if AppendPinnedPtr == 0 { | |
| 745 | - | return nil | |
| 746 | - | } | |
| 747 | - | ||
| 748 | - | gobject.IncreaseRef(AppendPinnedPtr) | |
| 749 | - | ||
| 750 | - | AppendPinnedCls := &TabPage{} | |
| 751 | - | AppendPinnedCls.Ptr = AppendPinnedPtr | |
| 752 | - | return AppendPinnedCls | |
| 739 | + | cret := xTabViewAppendPinned(x.GoPointer(), ChildVar.GoPointer()) | |
| 753 | 740 | ||
| 741 | + | if cret == 0 { | |
| 742 | + | return cls | |
| 743 | + | } | |
| 744 | + | gobject.IncreaseRef(cret) | |
| 745 | + | cls = &TabPage{} | |
| 746 | + | cls.Ptr = cret | |
| 747 | + | return cls | |
| 754 | 748 | } | |
| 755 | 749 | ||
| 756 | 750 | var xTabViewCloseOtherPages func(uintptr, uintptr) | |
| @@ -830,18 +824,17 @@ var xTabViewGetDefaultIcon func(uintptr) uintptr | |||
| 830 | 824 | ||
| 831 | 825 | // Gets the default icon of @self. | |
| 832 | 826 | func (x *TabView) GetDefaultIcon() *gio.IconBase { | |
| 827 | + | var cls *gio.IconBase | |
| 833 | 828 | ||
| 834 | - | GetDefaultIconPtr := xTabViewGetDefaultIcon(x.GoPointer()) | |
| 835 | - | if GetDefaultIconPtr == 0 { | |
| 836 | - | return nil | |
| 837 | - | } | |
| 838 | - | ||
| 839 | - | gobject.IncreaseRef(GetDefaultIconPtr) | |
| 840 | - | ||
| 841 | - | GetDefaultIconCls := &gio.IconBase{} | |
| 842 | - | GetDefaultIconCls.Ptr = GetDefaultIconPtr | |
| 843 | - | return GetDefaultIconCls | |
| 829 | + | cret := xTabViewGetDefaultIcon(x.GoPointer()) | |
| 844 | 830 | ||
| 831 | + | if cret == 0 { | |
| 832 | + | return cls | |
| 833 | + | } | |
| 834 | + | gobject.IncreaseRef(cret) | |
| 835 | + | cls = &gio.IconBase{} | |
| 836 | + | cls.Ptr = cret | |
| 837 | + | return cls | |
| 845 | 838 | } | |
| 846 | 839 | ||
| 847 | 840 | var xTabViewGetIsTransferringPage func(uintptr) bool | |
| @@ -855,26 +848,25 @@ var xTabViewGetIsTransferringPage func(uintptr) bool | |||
| 855 | 848 | // be safely dropped on the tab view. | |
| 856 | 849 | func (x *TabView) GetIsTransferringPage() bool { | |
| 857 | 850 | ||
| 858 | - | return xTabViewGetIsTransferringPage(x.GoPointer()) | |
| 859 | - | ||
| 851 | + | cret := xTabViewGetIsTransferringPage(x.GoPointer()) | |
| 852 | + | return cret | |
| 860 | 853 | } | |
| 861 | 854 | ||
| 862 | 855 | var xTabViewGetMenuModel func(uintptr) uintptr | |
| 863 | 856 | ||
| 864 | 857 | // Gets the tab context menu model for @self. | |
| 865 | 858 | func (x *TabView) GetMenuModel() *gio.MenuModel { | |
| 859 | + | var cls *gio.MenuModel | |
| 866 | 860 | ||
| 867 | - | GetMenuModelPtr := xTabViewGetMenuModel(x.GoPointer()) | |
| 868 | - | if GetMenuModelPtr == 0 { | |
| 869 | - | return nil | |
| 870 | - | } | |
| 871 | - | ||
| 872 | - | gobject.IncreaseRef(GetMenuModelPtr) | |
| 873 | - | ||
| 874 | - | GetMenuModelCls := &gio.MenuModel{} | |
| 875 | - | GetMenuModelCls.Ptr = GetMenuModelPtr | |
| 876 | - | return GetMenuModelCls | |
| 861 | + | cret := xTabViewGetMenuModel(x.GoPointer()) | |
| 877 | 862 | ||
| 863 | + | if cret == 0 { | |
| 864 | + | return cls | |
| 865 | + | } | |
| 866 | + | gobject.IncreaseRef(cret) | |
| 867 | + | cls = &gio.MenuModel{} | |
| 868 | + | cls.Ptr = cret | |
| 869 | + | return cls | |
| 878 | 870 | } | |
| 879 | 871 | ||
| 880 | 872 | var xTabViewGetNPages func(uintptr) int | |
| @@ -882,8 +874,8 @@ var xTabViewGetNPages func(uintptr) int | |||
| 882 | 874 | // Gets the number of pages in @self. | |
| 883 | 875 | func (x *TabView) GetNPages() int { | |
| 884 | 876 | ||
| 885 | - | return xTabViewGetNPages(x.GoPointer()) | |
| 886 | - | ||
| 877 | + | cret := xTabViewGetNPages(x.GoPointer()) | |
| 878 | + | return cret | |
| 887 | 879 | } | |
| 888 | 880 | ||
| 889 | 881 | var xTabViewGetNPinnedPages func(uintptr) int | |
| @@ -893,44 +885,42 @@ var xTabViewGetNPinnedPages func(uintptr) int | |||
| 893 | 885 | // See [method@TabView.set_page_pinned]. | |
| 894 | 886 | func (x *TabView) GetNPinnedPages() int { | |
| 895 | 887 | ||
| 896 | - | return xTabViewGetNPinnedPages(x.GoPointer()) | |
| 897 | - | ||
| 888 | + | cret := xTabViewGetNPinnedPages(x.GoPointer()) | |
| 889 | + | return cret | |
| 898 | 890 | } | |
| 899 | 891 | ||
| 900 | 892 | var xTabViewGetNthPage func(uintptr, int) uintptr | |
| 901 | 893 | ||
| 902 | 894 | // Gets the [class@TabPage] representing the child at @position. | |
| 903 | 895 | func (x *TabView) GetNthPage(PositionVar int) *TabPage { | |
| 896 | + | var cls *TabPage | |
| 904 | 897 | ||
| 905 | - | GetNthPagePtr := xTabViewGetNthPage(x.GoPointer(), PositionVar) | |
| 906 | - | if GetNthPagePtr == 0 { | |
| 907 | - | return nil | |
| 908 | - | } | |
| 909 | - | ||
| 910 | - | gobject.IncreaseRef(GetNthPagePtr) | |
| 911 | - | ||
| 912 | - | GetNthPageCls := &TabPage{} | |
| 913 | - | GetNthPageCls.Ptr = GetNthPagePtr | |
| 914 | - | return GetNthPageCls | |
| 898 | + | cret := xTabViewGetNthPage(x.GoPointer(), PositionVar) | |
| 915 | 899 | ||
| 900 | + | if cret == 0 { | |
| 901 | + | return cls | |
| 902 | + | } | |
| 903 | + | gobject.IncreaseRef(cret) | |
| 904 | + | cls = &TabPage{} | |
| 905 | + | cls.Ptr = cret | |
| 906 | + | return cls | |
| 916 | 907 | } | |
| 917 | 908 | ||
| 918 | 909 | var xTabViewGetPage func(uintptr, uintptr) uintptr | |
| 919 | 910 | ||
| 920 | 911 | // Gets the [class@TabPage] object representing @child. | |
| 921 | 912 | func (x *TabView) GetPage(ChildVar *gtk.Widget) *TabPage { | |
| 913 | + | var cls *TabPage | |
| 922 | 914 | ||
| 923 | - | GetPagePtr := xTabViewGetPage(x.GoPointer(), ChildVar.GoPointer()) | |
| 924 | - | if GetPagePtr == 0 { | |
| 925 | - | return nil | |
| 926 | - | } | |
| 927 | - | ||
| 928 | - | gobject.IncreaseRef(GetPagePtr) | |
| 929 | - | ||
| 930 | - | GetPageCls := &TabPage{} | |
| 931 | - | GetPageCls.Ptr = GetPagePtr | |
| 932 | - | return GetPageCls | |
| 915 | + | cret := xTabViewGetPage(x.GoPointer(), ChildVar.GoPointer()) | |
| 933 | 916 | ||
| 917 | + | if cret == 0 { | |
| 918 | + | return cls | |
| 919 | + | } | |
| 920 | + | gobject.IncreaseRef(cret) | |
| 921 | + | cls = &TabPage{} | |
| 922 | + | cls.Ptr = cret | |
| 923 | + | return cls | |
| 934 | 924 | } | |
| 935 | 925 | ||
| 936 | 926 | var xTabViewGetPagePosition func(uintptr, uintptr) int | |
| @@ -938,8 +928,8 @@ var xTabViewGetPagePosition func(uintptr, uintptr) int | |||
| 938 | 928 | // Finds the position of @page in @self, starting from 0. | |
| 939 | 929 | func (x *TabView) GetPagePosition(PageVar *TabPage) int { | |
| 940 | 930 | ||
| 941 | - | return xTabViewGetPagePosition(x.GoPointer(), PageVar.GoPointer()) | |
| 942 | - | ||
| 931 | + | cret := xTabViewGetPagePosition(x.GoPointer(), PageVar.GoPointer()) | |
| 932 | + | return cret | |
| 943 | 933 | } | |
| 944 | 934 | ||
| 945 | 935 | var xTabViewGetPages func(uintptr) uintptr | |
| @@ -950,34 +940,33 @@ var xTabViewGetPages func(uintptr) uintptr | |||
| 950 | 940 | // [iface@Gtk.SelectionModel] and can be used to track and change the selected | |
| 951 | 941 | // page. | |
| 952 | 942 | func (x *TabView) GetPages() *gtk.SelectionModelBase { | |
| 943 | + | var cls *gtk.SelectionModelBase | |
| 953 | 944 | ||
| 954 | - | GetPagesPtr := xTabViewGetPages(x.GoPointer()) | |
| 955 | - | if GetPagesPtr == 0 { | |
| 956 | - | return nil | |
| 957 | - | } | |
| 958 | - | ||
| 959 | - | GetPagesCls := >k.SelectionModelBase{} | |
| 960 | - | GetPagesCls.Ptr = GetPagesPtr | |
| 961 | - | return GetPagesCls | |
| 945 | + | cret := xTabViewGetPages(x.GoPointer()) | |
| 962 | 946 | ||
| 947 | + | if cret == 0 { | |
| 948 | + | return cls | |
| 949 | + | } | |
| 950 | + | cls = >k.SelectionModelBase{} | |
| 951 | + | cls.Ptr = cret | |
| 952 | + | return cls | |
| 963 | 953 | } | |
| 964 | 954 | ||
| 965 | 955 | var xTabViewGetSelectedPage func(uintptr) uintptr | |
| 966 | 956 | ||
| 967 | 957 | // Gets the currently selected page in @self. | |
| 968 | 958 | func (x *TabView) GetSelectedPage() *TabPage { | |
| 959 | + | var cls *TabPage | |
| 969 | 960 | ||
| 970 | - | GetSelectedPagePtr := xTabViewGetSelectedPage(x.GoPointer()) | |
| 971 | - | if GetSelectedPagePtr == 0 { | |
| 972 | - | return nil | |
| 973 | - | } | |
| 974 | - | ||
| 975 | - | gobject.IncreaseRef(GetSelectedPagePtr) | |
| 976 | - | ||
| 977 | - | GetSelectedPageCls := &TabPage{} | |
| 978 | - | GetSelectedPageCls.Ptr = GetSelectedPagePtr | |
| 979 | - | return GetSelectedPageCls | |
| 961 | + | cret := xTabViewGetSelectedPage(x.GoPointer()) | |
| 980 | 962 | ||
| 963 | + | if cret == 0 { | |
| 964 | + | return cls | |
| 965 | + | } | |
| 966 | + | gobject.IncreaseRef(cret) | |
| 967 | + | cls = &TabPage{} | |
| 968 | + | cls.Ptr = cret | |
| 969 | + | return cls | |
| 981 | 970 | } | |
| 982 | 971 | ||
| 983 | 972 | var xTabViewGetShortcuts func(uintptr) TabViewShortcuts | |
| @@ -985,8 +974,8 @@ var xTabViewGetShortcuts func(uintptr) TabViewShortcuts | |||
| 985 | 974 | // Gets the enabled shortcuts for @self. | |
| 986 | 975 | func (x *TabView) GetShortcuts() TabViewShortcuts { | |
| 987 | 976 | ||
| 988 | - | return xTabViewGetShortcuts(x.GoPointer()) | |
| 989 | - | ||
| 977 | + | cret := xTabViewGetShortcuts(x.GoPointer()) | |
| 978 | + | return cret | |
| 990 | 979 | } | |
| 991 | 980 | ||
| 992 | 981 | var xTabViewInsert func(uintptr, uintptr, int) uintptr | |
| @@ -996,18 +985,17 @@ var xTabViewInsert func(uintptr, uintptr, int) uintptr | |||
| 996 | 985 | // It's an error to try to insert a page before a pinned page, in that case | |
| 997 | 986 | // [method@TabView.insert_pinned] should be used instead. | |
| 998 | 987 | func (x *TabView) Insert(ChildVar *gtk.Widget, PositionVar int) *TabPage { | |
| 988 | + | var cls *TabPage | |
| 999 | 989 | ||
| 1000 | - | InsertPtr := xTabViewInsert(x.GoPointer(), ChildVar.GoPointer(), PositionVar) | |
| 1001 | - | if InsertPtr == 0 { | |
| 1002 | - | return nil | |
| 1003 | - | } | |
| 1004 | - | ||
| 1005 | - | gobject.IncreaseRef(InsertPtr) | |
| 1006 | - | ||
| 1007 | - | InsertCls := &TabPage{} | |
| 1008 | - | InsertCls.Ptr = InsertPtr | |
| 1009 | - | return InsertCls | |
| 990 | + | cret := xTabViewInsert(x.GoPointer(), ChildVar.GoPointer(), PositionVar) | |
| 1010 | 991 | ||
| 992 | + | if cret == 0 { | |
| 993 | + | return cls | |
| 994 | + | } | |
| 995 | + | gobject.IncreaseRef(cret) | |
| 996 | + | cls = &TabPage{} | |
| 997 | + | cls.Ptr = cret | |
| 998 | + | return cls | |
| 1011 | 999 | } | |
| 1012 | 1000 | ||
| 1013 | 1001 | var xTabViewInsertPinned func(uintptr, uintptr, int) uintptr | |
| @@ -1017,18 +1005,17 @@ var xTabViewInsertPinned func(uintptr, uintptr, int) uintptr | |||
| 1017 | 1005 | // It's an error to try to insert a pinned page after a non-pinned page, in | |
| 1018 | 1006 | // that case [method@TabView.insert] should be used instead. | |
| 1019 | 1007 | func (x *TabView) InsertPinned(ChildVar *gtk.Widget, PositionVar int) *TabPage { | |
| 1008 | + | var cls *TabPage | |
| 1020 | 1009 | ||
| 1021 | - | InsertPinnedPtr := xTabViewInsertPinned(x.GoPointer(), ChildVar.GoPointer(), PositionVar) | |
| 1022 | - | if InsertPinnedPtr == 0 { | |
| 1023 | - | return nil | |
| 1024 | - | } | |
| 1025 | - | ||
| 1026 | - | gobject.IncreaseRef(InsertPinnedPtr) | |
| 1027 | - | ||
| 1028 | - | InsertPinnedCls := &TabPage{} | |
| 1029 | - | InsertPinnedCls.Ptr = InsertPinnedPtr | |
| 1030 | - | return InsertPinnedCls | |
| 1010 | + | cret := xTabViewInsertPinned(x.GoPointer(), ChildVar.GoPointer(), PositionVar) | |
| 1031 | 1011 | ||
| 1012 | + | if cret == 0 { | |
| 1013 | + | return cls | |
| 1014 | + | } | |
| 1015 | + | gobject.IncreaseRef(cret) | |
| 1016 | + | cls = &TabPage{} | |
| 1017 | + | cls.Ptr = cret | |
| 1018 | + | return cls | |
| 1032 | 1019 | } | |
| 1033 | 1020 | ||
| 1034 | 1021 | var xTabViewInvalidateThumbnails func(uintptr) | |
| @@ -1047,36 +1034,34 @@ var xTabViewPrepend func(uintptr, uintptr) uintptr | |||
| 1047 | 1034 | ||
| 1048 | 1035 | // Inserts @child as the first non-pinned page. | |
| 1049 | 1036 | func (x *TabView) Prepend(ChildVar *gtk.Widget) *TabPage { | |
| 1037 | + | var cls *TabPage | |
| 1050 | 1038 | ||
| 1051 | - | PrependPtr := xTabViewPrepend(x.GoPointer(), ChildVar.GoPointer()) | |
| 1052 | - | if PrependPtr == 0 { | |
| 1053 | - | return nil | |
| 1054 | - | } | |
| 1055 | - | ||
| 1056 | - | gobject.IncreaseRef(PrependPtr) | |
| 1057 | - | ||
| 1058 | - | PrependCls := &TabPage{} | |
| 1059 | - | PrependCls.Ptr = PrependPtr | |
| 1060 | - | return PrependCls | |
| 1039 | + | cret := xTabViewPrepend(x.GoPointer(), ChildVar.GoPointer()) | |
| 1061 | 1040 | ||
| 1041 | + | if cret == 0 { | |
| 1042 | + | return cls | |
| 1043 | + | } | |
| 1044 | + | gobject.IncreaseRef(cret) | |
| 1045 | + | cls = &TabPage{} | |
| 1046 | + | cls.Ptr = cret | |
| 1047 | + | return cls | |
| 1062 | 1048 | } | |
| 1063 | 1049 | ||
| 1064 | 1050 | var xTabViewPrependPinned func(uintptr, uintptr) uintptr | |
| 1065 | 1051 | ||
| 1066 | 1052 | // Inserts @child as the first pinned page. | |
| 1067 | 1053 | func (x *TabView) PrependPinned(ChildVar *gtk.Widget) *TabPage { | |
| 1054 | + | var cls *TabPage | |
| 1068 | 1055 | ||
| 1069 | - | PrependPinnedPtr := xTabViewPrependPinned(x.GoPointer(), ChildVar.GoPointer()) | |
| 1070 | - | if PrependPinnedPtr == 0 { | |
| 1071 | - | return nil | |
| 1072 | - | } | |
| 1073 | - | ||
| 1074 | - | gobject.IncreaseRef(PrependPinnedPtr) | |
| 1075 | - | ||
| 1076 | - | PrependPinnedCls := &TabPage{} | |
| 1077 | - | PrependPinnedCls.Ptr = PrependPinnedPtr | |
| 1078 | - | return PrependPinnedCls | |
| 1056 | + | cret := xTabViewPrependPinned(x.GoPointer(), ChildVar.GoPointer()) | |
| 1079 | 1057 | ||
| 1058 | + | if cret == 0 { | |
| 1059 | + | return cls | |
| 1060 | + | } | |
| 1061 | + | gobject.IncreaseRef(cret) | |
| 1062 | + | cls = &TabPage{} | |
| 1063 | + | cls.Ptr = cret | |
| 1064 | + | return cls | |
| 1080 | 1065 | } | |
| 1081 | 1066 | ||
| 1082 | 1067 | var xTabViewRemoveShortcuts func(uintptr, TabViewShortcuts) | |
| @@ -1095,8 +1080,8 @@ var xTabViewReorderBackward func(uintptr, uintptr) bool | |||
| 1095 | 1080 | // Reorders @page to before its previous page if possible. | |
| 1096 | 1081 | func (x *TabView) ReorderBackward(PageVar *TabPage) bool { | |
| 1097 | 1082 | ||
| 1098 | - | return xTabViewReorderBackward(x.GoPointer(), PageVar.GoPointer()) | |
| 1099 | - | ||
| 1083 | + | cret := xTabViewReorderBackward(x.GoPointer(), PageVar.GoPointer()) | |
| 1084 | + | return cret | |
| 1100 | 1085 | } | |
| 1101 | 1086 | ||
| 1102 | 1087 | var xTabViewReorderFirst func(uintptr, uintptr) bool | |
| @@ -1104,8 +1089,8 @@ var xTabViewReorderFirst func(uintptr, uintptr) bool | |||
| 1104 | 1089 | // Reorders @page to the first possible position. | |
| 1105 | 1090 | func (x *TabView) ReorderFirst(PageVar *TabPage) bool { | |
| 1106 | 1091 | ||
| 1107 | - | return xTabViewReorderFirst(x.GoPointer(), PageVar.GoPointer()) | |
| 1108 | - | ||
| 1092 | + | cret := xTabViewReorderFirst(x.GoPointer(), PageVar.GoPointer()) | |
| 1093 | + | return cret | |
| 1109 | 1094 | } | |
| 1110 | 1095 | ||
| 1111 | 1096 | var xTabViewReorderForward func(uintptr, uintptr) bool | |
| @@ -1113,8 +1098,8 @@ var xTabViewReorderForward func(uintptr, uintptr) bool | |||
| 1113 | 1098 | // Reorders @page to after its next page if possible. | |
| 1114 | 1099 | func (x *TabView) ReorderForward(PageVar *TabPage) bool { | |
| 1115 | 1100 | ||
| 1116 | - | return xTabViewReorderForward(x.GoPointer(), PageVar.GoPointer()) | |
| 1117 | - | ||
| 1101 | + | cret := xTabViewReorderForward(x.GoPointer(), PageVar.GoPointer()) | |
| 1102 | + | return cret | |
| 1118 | 1103 | } | |
| 1119 | 1104 | ||
| 1120 | 1105 | var xTabViewReorderLast func(uintptr, uintptr) bool | |
| @@ -1122,8 +1107,8 @@ var xTabViewReorderLast func(uintptr, uintptr) bool | |||
| 1122 | 1107 | // Reorders @page to the last possible position. | |
| 1123 | 1108 | func (x *TabView) ReorderLast(PageVar *TabPage) bool { | |
| 1124 | 1109 | ||
| 1125 | - | return xTabViewReorderLast(x.GoPointer(), PageVar.GoPointer()) | |
| 1126 | - | ||
| 1110 | + | cret := xTabViewReorderLast(x.GoPointer(), PageVar.GoPointer()) | |
| 1111 | + | return cret | |
| 1127 | 1112 | } | |
| 1128 | 1113 | ||
| 1129 | 1114 | var xTabViewReorderPage func(uintptr, uintptr, int) bool | |
| @@ -1134,8 +1119,8 @@ var xTabViewReorderPage func(uintptr, uintptr, int) bool | |||
| 1134 | 1119 | // one, or a non-pinned page before a pinned one. | |
| 1135 | 1120 | func (x *TabView) ReorderPage(PageVar *TabPage, PositionVar int) bool { | |
| 1136 | 1121 | ||
| 1137 | - | return xTabViewReorderPage(x.GoPointer(), PageVar.GoPointer(), PositionVar) | |
| 1138 | - | ||
| 1122 | + | cret := xTabViewReorderPage(x.GoPointer(), PageVar.GoPointer(), PositionVar) | |
| 1123 | + | return cret | |
| 1139 | 1124 | } | |
| 1140 | 1125 | ||
| 1141 | 1126 | var xTabViewSelectNextPage func(uintptr) bool | |
| @@ -1145,8 +1130,8 @@ var xTabViewSelectNextPage func(uintptr) bool | |||
| 1145 | 1130 | // If the last page was already selected, this function does nothing. | |
| 1146 | 1131 | func (x *TabView) SelectNextPage() bool { | |
| 1147 | 1132 | ||
| 1148 | - | return xTabViewSelectNextPage(x.GoPointer()) | |
| 1149 | - | ||
| 1133 | + | cret := xTabViewSelectNextPage(x.GoPointer()) | |
| 1134 | + | return cret | |
| 1150 | 1135 | } | |
| 1151 | 1136 | ||
| 1152 | 1137 | var xTabViewSelectPreviousPage func(uintptr) bool | |
| @@ -1156,8 +1141,8 @@ var xTabViewSelectPreviousPage func(uintptr) bool | |||
| 1156 | 1141 | // If the first page was already selected, this function does nothing. | |
| 1157 | 1142 | func (x *TabView) SelectPreviousPage() bool { | |
| 1158 | 1143 | ||
| 1159 | - | return xTabViewSelectPreviousPage(x.GoPointer()) | |
| 1160 | - | ||
| 1144 | + | cret := xTabViewSelectPreviousPage(x.GoPointer()) | |
| 1145 | + | return cret | |
| 1161 | 1146 | } | |
| 1162 | 1147 | ||
| 1163 | 1148 | var xTabViewSetDefaultIcon func(uintptr, uintptr) | |
| @@ -1416,8 +1401,8 @@ func (x *TabView) ConnectSetupMenu(cb func(TabView, uintptr)) { | |||
| 1416 | 1401 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 1417 | 1402 | func (x *TabView) GetAccessibleRole() gtk.AccessibleRole { | |
| 1418 | 1403 | ||
| 1419 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 1420 | - | ||
| 1404 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 1405 | + | return cret | |
| 1421 | 1406 | } | |
| 1422 | 1407 | ||
| 1423 | 1408 | // Resets the accessible @property to its default value. | |
| @@ -1552,8 +1537,8 @@ func (x *TabView) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVar | |||
| 1552 | 1537 | // of the <object> tag used to construct the @buildable. | |
| 1553 | 1538 | func (x *TabView) GetBuildableId() string { | |
| 1554 | 1539 | ||
| 1555 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 1556 | - | ||
| 1540 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 1541 | + | return cret | |
| 1557 | 1542 | } | |
| 1558 | 1543 | ||
| 1559 | 1544 | func init() { | |
M v4/adw/adw-timed-animation.go +23 -22
| @@ -42,16 +42,17 @@ var xNewTimedAnimation func(uintptr, float64, float64, uint, uintptr) uintptr | |||
| 42 | 42 | // Creates a new `AdwTimedAnimation` on @widget to animate @target from @from | |
| 43 | 43 | // to @to. | |
| 44 | 44 | func NewTimedAnimation(WidgetVar *gtk.Widget, FromVar float64, ToVar float64, DurationVar uint, TargetVar *AnimationTarget) *Animation { | |
| 45 | - | NewTimedAnimationPtr := xNewTimedAnimation(WidgetVar.GoPointer(), FromVar, ToVar, DurationVar, TargetVar.GoPointer()) | |
| 46 | - | if NewTimedAnimationPtr == 0 { | |
| 47 | - | return nil | |
| 48 | - | } | |
| 45 | + | var cls *Animation | |
| 49 | 46 | ||
| 50 | - | gobject.IncreaseRef(NewTimedAnimationPtr) | |
| 47 | + | cret := xNewTimedAnimation(WidgetVar.GoPointer(), FromVar, ToVar, DurationVar, TargetVar.GoPointer()) | |
| 51 | 48 | ||
| 52 | - | NewTimedAnimationCls := &Animation{} | |
| 53 | - | NewTimedAnimationCls.Ptr = NewTimedAnimationPtr | |
| 54 | - | return NewTimedAnimationCls | |
| 49 | + | if cret == 0 { | |
| 50 | + | return cls | |
| 51 | + | } | |
| 52 | + | gobject.IncreaseRef(cret) | |
| 53 | + | cls = &Animation{} | |
| 54 | + | cls.Ptr = cret | |
| 55 | + | return cls | |
| 55 | 56 | } | |
| 56 | 57 | ||
| 57 | 58 | var xTimedAnimationGetAlternate func(uintptr) bool | |
| @@ -59,8 +60,8 @@ var xTimedAnimationGetAlternate func(uintptr) bool | |||
| 59 | 60 | // Gets whether @self changes direction on every iteration. | |
| 60 | 61 | func (x *TimedAnimation) GetAlternate() bool { | |
| 61 | 62 | ||
| 62 | - | return xTimedAnimationGetAlternate(x.GoPointer()) | |
| 63 | - | ||
| 63 | + | cret := xTimedAnimationGetAlternate(x.GoPointer()) | |
| 64 | + | return cret | |
| 64 | 65 | } | |
| 65 | 66 | ||
| 66 | 67 | var xTimedAnimationGetDuration func(uintptr) uint | |
| @@ -68,8 +69,8 @@ var xTimedAnimationGetDuration func(uintptr) uint | |||
| 68 | 69 | // Gets the duration of @self. | |
| 69 | 70 | func (x *TimedAnimation) GetDuration() uint { | |
| 70 | 71 | ||
| 71 | - | return xTimedAnimationGetDuration(x.GoPointer()) | |
| 72 | - | ||
| 72 | + | cret := xTimedAnimationGetDuration(x.GoPointer()) | |
| 73 | + | return cret | |
| 73 | 74 | } | |
| 74 | 75 | ||
| 75 | 76 | var xTimedAnimationGetEasing func(uintptr) Easing | |
| @@ -77,8 +78,8 @@ var xTimedAnimationGetEasing func(uintptr) Easing | |||
| 77 | 78 | // Gets the easing function @self uses. | |
| 78 | 79 | func (x *TimedAnimation) GetEasing() Easing { | |
| 79 | 80 | ||
| 80 | - | return xTimedAnimationGetEasing(x.GoPointer()) | |
| 81 | - | ||
| 81 | + | cret := xTimedAnimationGetEasing(x.GoPointer()) | |
| 82 | + | return cret | |
| 82 | 83 | } | |
| 83 | 84 | ||
| 84 | 85 | var xTimedAnimationGetRepeatCount func(uintptr) uint | |
| @@ -86,8 +87,8 @@ var xTimedAnimationGetRepeatCount func(uintptr) uint | |||
| 86 | 87 | // Gets the number of times @self will play. | |
| 87 | 88 | func (x *TimedAnimation) GetRepeatCount() uint { | |
| 88 | 89 | ||
| 89 | - | return xTimedAnimationGetRepeatCount(x.GoPointer()) | |
| 90 | - | ||
| 90 | + | cret := xTimedAnimationGetRepeatCount(x.GoPointer()) | |
| 91 | + | return cret | |
| 91 | 92 | } | |
| 92 | 93 | ||
| 93 | 94 | var xTimedAnimationGetReverse func(uintptr) bool | |
| @@ -95,8 +96,8 @@ var xTimedAnimationGetReverse func(uintptr) bool | |||
| 95 | 96 | // Gets whether @self plays backwards. | |
| 96 | 97 | func (x *TimedAnimation) GetReverse() bool { | |
| 97 | 98 | ||
| 98 | - | return xTimedAnimationGetReverse(x.GoPointer()) | |
| 99 | - | ||
| 99 | + | cret := xTimedAnimationGetReverse(x.GoPointer()) | |
| 100 | + | return cret | |
| 100 | 101 | } | |
| 101 | 102 | ||
| 102 | 103 | var xTimedAnimationGetValueFrom func(uintptr) float64 | |
| @@ -104,8 +105,8 @@ var xTimedAnimationGetValueFrom func(uintptr) float64 | |||
| 104 | 105 | // Gets the value @self will animate from. | |
| 105 | 106 | func (x *TimedAnimation) GetValueFrom() float64 { | |
| 106 | 107 | ||
| 107 | - | return xTimedAnimationGetValueFrom(x.GoPointer()) | |
| 108 | - | ||
| 108 | + | cret := xTimedAnimationGetValueFrom(x.GoPointer()) | |
| 109 | + | return cret | |
| 109 | 110 | } | |
| 110 | 111 | ||
| 111 | 112 | var xTimedAnimationGetValueTo func(uintptr) float64 | |
| @@ -113,8 +114,8 @@ var xTimedAnimationGetValueTo func(uintptr) float64 | |||
| 113 | 114 | // Gets the value @self will animate to. | |
| 114 | 115 | func (x *TimedAnimation) GetValueTo() float64 { | |
| 115 | 116 | ||
| 116 | - | return xTimedAnimationGetValueTo(x.GoPointer()) | |
| 117 | - | ||
| 117 | + | cret := xTimedAnimationGetValueTo(x.GoPointer()) | |
| 118 | + | return cret | |
| 118 | 119 | } | |
| 119 | 120 | ||
| 120 | 121 | var xTimedAnimationSetAlternate func(uintptr, bool) | |
M v4/adw/adw-toast-overlay.go +22 -22
| @@ -69,16 +69,17 @@ var xNewToastOverlay func() uintptr | |||
| 69 | 69 | ||
| 70 | 70 | // Creates a new `AdwToastOverlay`. | |
| 71 | 71 | func NewToastOverlay() *gtk.Widget { | |
| 72 | - | NewToastOverlayPtr := xNewToastOverlay() | |
| 73 | - | if NewToastOverlayPtr == 0 { | |
| 74 | - | return nil | |
| 75 | - | } | |
| 72 | + | var cls *gtk.Widget | |
| 76 | 73 | ||
| 77 | - | gobject.IncreaseRef(NewToastOverlayPtr) | |
| 74 | + | cret := xNewToastOverlay() | |
| 78 | 75 | ||
| 79 | - | NewToastOverlayCls := >k.Widget{} | |
| 80 | - | NewToastOverlayCls.Ptr = NewToastOverlayPtr | |
| 81 | - | return NewToastOverlayCls | |
| 76 | + | if cret == 0 { | |
| 77 | + | return cls | |
| 78 | + | } | |
| 79 | + | gobject.IncreaseRef(cret) | |
| 80 | + | cls = >k.Widget{} | |
| 81 | + | cls.Ptr = cret | |
| 82 | + | return cls | |
| 82 | 83 | } | |
| 83 | 84 | ||
| 84 | 85 | var xToastOverlayAddToast func(uintptr, uintptr) | |
| @@ -103,18 +104,17 @@ var xToastOverlayGetChild func(uintptr) uintptr | |||
| 103 | 104 | ||
| 104 | 105 | // Gets the child widget of @self. | |
| 105 | 106 | func (x *ToastOverlay) GetChild() *gtk.Widget { | |
| 107 | + | var cls *gtk.Widget | |
| 106 | 108 | ||
| 107 | - | GetChildPtr := xToastOverlayGetChild(x.GoPointer()) | |
| 108 | - | if GetChildPtr == 0 { | |
| 109 | - | return nil | |
| 110 | - | } | |
| 111 | - | ||
| 112 | - | gobject.IncreaseRef(GetChildPtr) | |
| 113 | - | ||
| 114 | - | GetChildCls := >k.Widget{} | |
| 115 | - | GetChildCls.Ptr = GetChildPtr | |
| 116 | - | return GetChildCls | |
| 109 | + | cret := xToastOverlayGetChild(x.GoPointer()) | |
| 117 | 110 | ||
| 111 | + | if cret == 0 { | |
| 112 | + | return cls | |
| 113 | + | } | |
| 114 | + | gobject.IncreaseRef(cret) | |
| 115 | + | cls = >k.Widget{} | |
| 116 | + | cls.Ptr = cret | |
| 117 | + | return cls | |
| 118 | 118 | } | |
| 119 | 119 | ||
| 120 | 120 | var xToastOverlaySetChild func(uintptr, uintptr) | |
| @@ -137,8 +137,8 @@ func (c *ToastOverlay) SetGoPointer(ptr uintptr) { | |||
| 137 | 137 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 138 | 138 | func (x *ToastOverlay) GetAccessibleRole() gtk.AccessibleRole { | |
| 139 | 139 | ||
| 140 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 141 | - | ||
| 140 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 141 | + | return cret | |
| 142 | 142 | } | |
| 143 | 143 | ||
| 144 | 144 | // Resets the accessible @property to its default value. | |
| @@ -273,8 +273,8 @@ func (x *ToastOverlay) UpdateStateValue(NStatesVar int, StatesVar uintptr, Value | |||
| 273 | 273 | // of the <object> tag used to construct the @buildable. | |
| 274 | 274 | func (x *ToastOverlay) GetBuildableId() string { | |
| 275 | 275 | ||
| 276 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 277 | - | ||
| 276 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 277 | + | return cret | |
| 278 | 278 | } | |
| 279 | 279 | ||
| 280 | 280 | func init() { | |
M v4/adw/adw-toast.go +39 -36
| @@ -175,14 +175,16 @@ var xNewToast func(string) uintptr | |||
| 175 | 175 | // | |
| 176 | 176 | // @title can be marked up with the Pango text markup language. | |
| 177 | 177 | func NewToast(TitleVar string) *Toast { | |
| 178 | - | NewToastPtr := xNewToast(TitleVar) | |
| 179 | - | if NewToastPtr == 0 { | |
| 180 | - | return nil | |
| 181 | - | } | |
| 178 | + | var cls *Toast | |
| 179 | + | ||
| 180 | + | cret := xNewToast(TitleVar) | |
| 182 | 181 | ||
| 183 | - | NewToastCls := &Toast{} | |
| 184 | - | NewToastCls.Ptr = NewToastPtr | |
| 185 | - | return NewToastCls | |
| 182 | + | if cret == 0 { | |
| 183 | + | return cls | |
| 184 | + | } | |
| 185 | + | cls = &Toast{} | |
| 186 | + | cls.Ptr = cret | |
| 187 | + | return cls | |
| 186 | 188 | } | |
| 187 | 189 | ||
| 188 | 190 | var xNewFormatToast func(string, ...interface{}) uintptr | |
| @@ -193,14 +195,16 @@ var xNewFormatToast func(string, ...interface{}) uintptr | |||
| 193 | 195 | // | |
| 194 | 196 | // See also: [ctor@Toast.new] | |
| 195 | 197 | func NewFormatToast(FormatVar string, varArgs ...interface{}) *Toast { | |
| 196 | - | NewFormatToastPtr := xNewFormatToast(FormatVar, varArgs...) | |
| 197 | - | if NewFormatToastPtr == 0 { | |
| 198 | - | return nil | |
| 199 | - | } | |
| 198 | + | var cls *Toast | |
| 200 | 199 | ||
| 201 | - | NewFormatToastCls := &Toast{} | |
| 202 | - | NewFormatToastCls.Ptr = NewFormatToastPtr | |
| 203 | - | return NewFormatToastCls | |
| 200 | + | cret := xNewFormatToast(FormatVar, varArgs...) | |
| 201 | + | ||
| 202 | + | if cret == 0 { | |
| 203 | + | return cls | |
| 204 | + | } | |
| 205 | + | cls = &Toast{} | |
| 206 | + | cls.Ptr = cret | |
| 207 | + | return cls | |
| 204 | 208 | } | |
| 205 | 209 | ||
| 206 | 210 | var xToastDismiss func(uintptr) | |
| @@ -220,8 +224,8 @@ var xToastGetActionName func(uintptr) string | |||
| 220 | 224 | // Gets the name of the associated action. | |
| 221 | 225 | func (x *Toast) GetActionName() string { | |
| 222 | 226 | ||
| 223 | - | return xToastGetActionName(x.GoPointer()) | |
| 224 | - | ||
| 227 | + | cret := xToastGetActionName(x.GoPointer()) | |
| 228 | + | return cret | |
| 225 | 229 | } | |
| 226 | 230 | ||
| 227 | 231 | var xToastGetActionTargetValue func(uintptr) *glib.Variant | |
| @@ -229,8 +233,8 @@ var xToastGetActionTargetValue func(uintptr) *glib.Variant | |||
| 229 | 233 | // Gets the parameter for action invocations. | |
| 230 | 234 | func (x *Toast) GetActionTargetValue() *glib.Variant { | |
| 231 | 235 | ||
| 232 | - | return xToastGetActionTargetValue(x.GoPointer()) | |
| 233 | - | ||
| 236 | + | cret := xToastGetActionTargetValue(x.GoPointer()) | |
| 237 | + | return cret | |
| 234 | 238 | } | |
| 235 | 239 | ||
| 236 | 240 | var xToastGetButtonLabel func(uintptr) string | |
| @@ -238,26 +242,25 @@ var xToastGetButtonLabel func(uintptr) string | |||
| 238 | 242 | // Gets the label to show on the button. | |
| 239 | 243 | func (x *Toast) GetButtonLabel() string { | |
| 240 | 244 | ||
| 241 | - | return xToastGetButtonLabel(x.GoPointer()) | |
| 242 | - | ||
| 245 | + | cret := xToastGetButtonLabel(x.GoPointer()) | |
| 246 | + | return cret | |
| 243 | 247 | } | |
| 244 | 248 | ||
| 245 | 249 | var xToastGetCustomTitle func(uintptr) uintptr | |
| 246 | 250 | ||
| 247 | 251 | // Gets the custom title widget of @self. | |
| 248 | 252 | func (x *Toast) GetCustomTitle() *gtk.Widget { | |
| 253 | + | var cls *gtk.Widget | |
| 249 | 254 | ||
| 250 | - | GetCustomTitlePtr := xToastGetCustomTitle(x.GoPointer()) | |
| 251 | - | if GetCustomTitlePtr == 0 { | |
| 252 | - | return nil | |
| 253 | - | } | |
| 254 | - | ||
| 255 | - | gobject.IncreaseRef(GetCustomTitlePtr) | |
| 256 | - | ||
| 257 | - | GetCustomTitleCls := >k.Widget{} | |
| 258 | - | GetCustomTitleCls.Ptr = GetCustomTitlePtr | |
| 259 | - | return GetCustomTitleCls | |
| 255 | + | cret := xToastGetCustomTitle(x.GoPointer()) | |
| 260 | 256 | ||
| 257 | + | if cret == 0 { | |
| 258 | + | return cls | |
| 259 | + | } | |
| 260 | + | gobject.IncreaseRef(cret) | |
| 261 | + | cls = >k.Widget{} | |
| 262 | + | cls.Ptr = cret | |
| 263 | + | return cls | |
| 261 | 264 | } | |
| 262 | 265 | ||
| 263 | 266 | var xToastGetPriority func(uintptr) ToastPriority | |
| @@ -265,8 +268,8 @@ var xToastGetPriority func(uintptr) ToastPriority | |||
| 265 | 268 | // Gets priority for @self. | |
| 266 | 269 | func (x *Toast) GetPriority() ToastPriority { | |
| 267 | 270 | ||
| 268 | - | return xToastGetPriority(x.GoPointer()) | |
| 269 | - | ||
| 271 | + | cret := xToastGetPriority(x.GoPointer()) | |
| 272 | + | return cret | |
| 270 | 273 | } | |
| 271 | 274 | ||
| 272 | 275 | var xToastGetTimeout func(uintptr) uint | |
| @@ -274,8 +277,8 @@ var xToastGetTimeout func(uintptr) uint | |||
| 274 | 277 | // Gets timeout for @self. | |
| 275 | 278 | func (x *Toast) GetTimeout() uint { | |
| 276 | 279 | ||
| 277 | - | return xToastGetTimeout(x.GoPointer()) | |
| 278 | - | ||
| 280 | + | cret := xToastGetTimeout(x.GoPointer()) | |
| 281 | + | return cret | |
| 279 | 282 | } | |
| 280 | 283 | ||
| 281 | 284 | var xToastGetTitle func(uintptr) string | |
| @@ -286,8 +289,8 @@ var xToastGetTitle func(uintptr) string | |||
| 286 | 289 | // the return value will be %NULL. | |
| 287 | 290 | func (x *Toast) GetTitle() string { | |
| 288 | 291 | ||
| 289 | - | return xToastGetTitle(x.GoPointer()) | |
| 290 | - | ||
| 292 | + | cret := xToastGetTitle(x.GoPointer()) | |
| 293 | + | return cret | |
| 291 | 294 | } | |
| 292 | 295 | ||
| 293 | 296 | var xToastSetActionName func(uintptr, string) | |
M v4/adw/adw-version.go +6 -6
| @@ -18,8 +18,8 @@ var xGetMajorVersion func() uint | |||
| 18 | 18 | // included when compiling your code. | |
| 19 | 19 | func GetMajorVersion() uint { | |
| 20 | 20 | ||
| 21 | - | return xGetMajorVersion() | |
| 22 | - | ||
| 21 | + | cret := xGetMajorVersion() | |
| 22 | + | return cret | |
| 23 | 23 | } | |
| 24 | 24 | ||
| 25 | 25 | var xGetMicroVersion func() uint | |
| @@ -34,8 +34,8 @@ var xGetMicroVersion func() uint | |||
| 34 | 34 | // included when compiling your code. | |
| 35 | 35 | func GetMicroVersion() uint { | |
| 36 | 36 | ||
| 37 | - | return xGetMicroVersion() | |
| 38 | - | ||
| 37 | + | cret := xGetMicroVersion() | |
| 38 | + | return cret | |
| 39 | 39 | } | |
| 40 | 40 | ||
| 41 | 41 | var xGetMinorVersion func() uint | |
| @@ -50,8 +50,8 @@ var xGetMinorVersion func() uint | |||
| 50 | 50 | // included when compiling your code. | |
| 51 | 51 | func GetMinorVersion() uint { | |
| 52 | 52 | ||
| 53 | - | return xGetMinorVersion() | |
| 54 | - | ||
| 53 | + | cret := xGetMinorVersion() | |
| 54 | + | return cret | |
| 55 | 55 | } | |
| 56 | 56 | ||
| 57 | 57 | func init() { | |
M v4/adw/adw-view-stack.go +115 -122
| @@ -86,34 +86,34 @@ var xNewViewStack func() uintptr | |||
| 86 | 86 | ||
| 87 | 87 | // Creates a new `AdwViewStack`. | |
| 88 | 88 | func NewViewStack() *gtk.Widget { | |
| 89 | - | NewViewStackPtr := xNewViewStack() | |
| 90 | - | if NewViewStackPtr == 0 { | |
| 91 | - | return nil | |
| 92 | - | } | |
| 89 | + | var cls *gtk.Widget | |
| 93 | 90 | ||
| 94 | - | gobject.IncreaseRef(NewViewStackPtr) | |
| 91 | + | cret := xNewViewStack() | |
| 95 | 92 | ||
| 96 | - | NewViewStackCls := >k.Widget{} | |
| 97 | - | NewViewStackCls.Ptr = NewViewStackPtr | |
| 98 | - | return NewViewStackCls | |
| 93 | + | if cret == 0 { | |
| 94 | + | return cls | |
| 95 | + | } | |
| 96 | + | gobject.IncreaseRef(cret) | |
| 97 | + | cls = >k.Widget{} | |
| 98 | + | cls.Ptr = cret | |
| 99 | + | return cls | |
| 99 | 100 | } | |
| 100 | 101 | ||
| 101 | 102 | var xViewStackAdd func(uintptr, uintptr) uintptr | |
| 102 | 103 | ||
| 103 | 104 | // Adds a child to @self. | |
| 104 | 105 | func (x *ViewStack) Add(ChildVar *gtk.Widget) *ViewStackPage { | |
| 106 | + | var cls *ViewStackPage | |
| 105 | 107 | ||
| 106 | - | AddPtr := xViewStackAdd(x.GoPointer(), ChildVar.GoPointer()) | |
| 107 | - | if AddPtr == 0 { | |
| 108 | - | return nil | |
| 109 | - | } | |
| 110 | - | ||
| 111 | - | gobject.IncreaseRef(AddPtr) | |
| 112 | - | ||
| 113 | - | AddCls := &ViewStackPage{} | |
| 114 | - | AddCls.Ptr = AddPtr | |
| 115 | - | return AddCls | |
| 108 | + | cret := xViewStackAdd(x.GoPointer(), ChildVar.GoPointer()) | |
| 116 | 109 | ||
| 110 | + | if cret == 0 { | |
| 111 | + | return cls | |
| 112 | + | } | |
| 113 | + | gobject.IncreaseRef(cret) | |
| 114 | + | cls = &ViewStackPage{} | |
| 115 | + | cls.Ptr = cret | |
| 116 | + | return cls | |
| 117 | 117 | } | |
| 118 | 118 | ||
| 119 | 119 | var xViewStackAddNamed func(uintptr, uintptr, string) uintptr | |
| @@ -122,18 +122,17 @@ var xViewStackAddNamed func(uintptr, uintptr, string) uintptr | |||
| 122 | 122 | // | |
| 123 | 123 | // The child is identified by the @name. | |
| 124 | 124 | func (x *ViewStack) AddNamed(ChildVar *gtk.Widget, NameVar string) *ViewStackPage { | |
| 125 | + | var cls *ViewStackPage | |
| 125 | 126 | ||
| 126 | - | AddNamedPtr := xViewStackAddNamed(x.GoPointer(), ChildVar.GoPointer(), NameVar) | |
| 127 | - | if AddNamedPtr == 0 { | |
| 128 | - | return nil | |
| 129 | - | } | |
| 130 | - | ||
| 131 | - | gobject.IncreaseRef(AddNamedPtr) | |
| 132 | - | ||
| 133 | - | AddNamedCls := &ViewStackPage{} | |
| 134 | - | AddNamedCls.Ptr = AddNamedPtr | |
| 135 | - | return AddNamedCls | |
| 127 | + | cret := xViewStackAddNamed(x.GoPointer(), ChildVar.GoPointer(), NameVar) | |
| 136 | 128 | ||
| 129 | + | if cret == 0 { | |
| 130 | + | return cls | |
| 131 | + | } | |
| 132 | + | gobject.IncreaseRef(cret) | |
| 133 | + | cls = &ViewStackPage{} | |
| 134 | + | cls.Ptr = cret | |
| 135 | + | return cls | |
| 137 | 136 | } | |
| 138 | 137 | ||
| 139 | 138 | var xViewStackAddTitled func(uintptr, uintptr, string, string) uintptr | |
| @@ -143,18 +142,17 @@ var xViewStackAddTitled func(uintptr, uintptr, string, string) uintptr | |||
| 143 | 142 | // The child is identified by the @name. The @title will be used by | |
| 144 | 143 | // [class@ViewSwitcher] to represent @child, so it should be short. | |
| 145 | 144 | func (x *ViewStack) AddTitled(ChildVar *gtk.Widget, NameVar string, TitleVar string) *ViewStackPage { | |
| 145 | + | var cls *ViewStackPage | |
| 146 | 146 | ||
| 147 | - | AddTitledPtr := xViewStackAddTitled(x.GoPointer(), ChildVar.GoPointer(), NameVar, TitleVar) | |
| 148 | - | if AddTitledPtr == 0 { | |
| 149 | - | return nil | |
| 150 | - | } | |
| 151 | - | ||
| 152 | - | gobject.IncreaseRef(AddTitledPtr) | |
| 153 | - | ||
| 154 | - | AddTitledCls := &ViewStackPage{} | |
| 155 | - | AddTitledCls.Ptr = AddTitledPtr | |
| 156 | - | return AddTitledCls | |
| 147 | + | cret := xViewStackAddTitled(x.GoPointer(), ChildVar.GoPointer(), NameVar, TitleVar) | |
| 157 | 148 | ||
| 149 | + | if cret == 0 { | |
| 150 | + | return cls | |
| 151 | + | } | |
| 152 | + | gobject.IncreaseRef(cret) | |
| 153 | + | cls = &ViewStackPage{} | |
| 154 | + | cls.Ptr = cret | |
| 155 | + | return cls | |
| 158 | 156 | } | |
| 159 | 157 | ||
| 160 | 158 | var xViewStackAddTitledWithIcon func(uintptr, uintptr, string, string, string) uintptr | |
| @@ -164,36 +162,34 @@ var xViewStackAddTitledWithIcon func(uintptr, uintptr, string, string, string) u | |||
| 164 | 162 | // The child is identified by the @name. The @title and @icon_name will be used | |
| 165 | 163 | // by [class@ViewSwitcher] to represent @child. | |
| 166 | 164 | func (x *ViewStack) AddTitledWithIcon(ChildVar *gtk.Widget, NameVar string, TitleVar string, IconNameVar string) *ViewStackPage { | |
| 165 | + | var cls *ViewStackPage | |
| 167 | 166 | ||
| 168 | - | AddTitledWithIconPtr := xViewStackAddTitledWithIcon(x.GoPointer(), ChildVar.GoPointer(), NameVar, TitleVar, IconNameVar) | |
| 169 | - | if AddTitledWithIconPtr == 0 { | |
| 170 | - | return nil | |
| 171 | - | } | |
| 172 | - | ||
| 173 | - | gobject.IncreaseRef(AddTitledWithIconPtr) | |
| 174 | - | ||
| 175 | - | AddTitledWithIconCls := &ViewStackPage{} | |
| 176 | - | AddTitledWithIconCls.Ptr = AddTitledWithIconPtr | |
| 177 | - | return AddTitledWithIconCls | |
| 167 | + | cret := xViewStackAddTitledWithIcon(x.GoPointer(), ChildVar.GoPointer(), NameVar, TitleVar, IconNameVar) | |
| 178 | 168 | ||
| 169 | + | if cret == 0 { | |
| 170 | + | return cls | |
| 171 | + | } | |
| 172 | + | gobject.IncreaseRef(cret) | |
| 173 | + | cls = &ViewStackPage{} | |
| 174 | + | cls.Ptr = cret | |
| 175 | + | return cls | |
| 179 | 176 | } | |
| 180 | 177 | ||
| 181 | 178 | var xViewStackGetChildByName func(uintptr, string) uintptr | |
| 182 | 179 | ||
| 183 | 180 | // Finds the child with @name in @self. | |
| 184 | 181 | func (x *ViewStack) GetChildByName(NameVar string) *gtk.Widget { | |
| 182 | + | var cls *gtk.Widget | |
| 185 | 183 | ||
| 186 | - | GetChildByNamePtr := xViewStackGetChildByName(x.GoPointer(), NameVar) | |
| 187 | - | if GetChildByNamePtr == 0 { | |
| 188 | - | return nil | |
| 189 | - | } | |
| 190 | - | ||
| 191 | - | gobject.IncreaseRef(GetChildByNamePtr) | |
| 192 | - | ||
| 193 | - | GetChildByNameCls := >k.Widget{} | |
| 194 | - | GetChildByNameCls.Ptr = GetChildByNamePtr | |
| 195 | - | return GetChildByNameCls | |
| 184 | + | cret := xViewStackGetChildByName(x.GoPointer(), NameVar) | |
| 196 | 185 | ||
| 186 | + | if cret == 0 { | |
| 187 | + | return cls | |
| 188 | + | } | |
| 189 | + | gobject.IncreaseRef(cret) | |
| 190 | + | cls = >k.Widget{} | |
| 191 | + | cls.Ptr = cret | |
| 192 | + | return cls | |
| 197 | 193 | } | |
| 198 | 194 | ||
| 199 | 195 | var xViewStackGetHhomogeneous func(uintptr) bool | |
| @@ -201,26 +197,25 @@ var xViewStackGetHhomogeneous func(uintptr) bool | |||
| 201 | 197 | // Gets whether @self is horizontally homogeneous. | |
| 202 | 198 | func (x *ViewStack) GetHhomogeneous() bool { | |
| 203 | 199 | ||
| 204 | - | return xViewStackGetHhomogeneous(x.GoPointer()) | |
| 205 | - | ||
| 200 | + | cret := xViewStackGetHhomogeneous(x.GoPointer()) | |
| 201 | + | return cret | |
| 206 | 202 | } | |
| 207 | 203 | ||
| 208 | 204 | var xViewStackGetPage func(uintptr, uintptr) uintptr | |
| 209 | 205 | ||
| 210 | 206 | // Gets the [class@ViewStackPage] object for @child. | |
| 211 | 207 | func (x *ViewStack) GetPage(ChildVar *gtk.Widget) *ViewStackPage { | |
| 208 | + | var cls *ViewStackPage | |
| 212 | 209 | ||
| 213 | - | GetPagePtr := xViewStackGetPage(x.GoPointer(), ChildVar.GoPointer()) | |
| 214 | - | if GetPagePtr == 0 { | |
| 215 | - | return nil | |
| 216 | - | } | |
| 217 | - | ||
| 218 | - | gobject.IncreaseRef(GetPagePtr) | |
| 219 | - | ||
| 220 | - | GetPageCls := &ViewStackPage{} | |
| 221 | - | GetPageCls.Ptr = GetPagePtr | |
| 222 | - | return GetPageCls | |
| 210 | + | cret := xViewStackGetPage(x.GoPointer(), ChildVar.GoPointer()) | |
| 223 | 211 | ||
| 212 | + | if cret == 0 { | |
| 213 | + | return cls | |
| 214 | + | } | |
| 215 | + | gobject.IncreaseRef(cret) | |
| 216 | + | cls = &ViewStackPage{} | |
| 217 | + | cls.Ptr = cret | |
| 218 | + | return cls | |
| 224 | 219 | } | |
| 225 | 220 | ||
| 226 | 221 | var xViewStackGetPages func(uintptr) uintptr | |
| @@ -231,16 +226,16 @@ var xViewStackGetPages func(uintptr) uintptr | |||
| 231 | 226 | // [iface@Gtk.SelectionModel] and can be used to track and change the visible | |
| 232 | 227 | // page. | |
| 233 | 228 | func (x *ViewStack) GetPages() *gtk.SelectionModelBase { | |
| 229 | + | var cls *gtk.SelectionModelBase | |
| 234 | 230 | ||
| 235 | - | GetPagesPtr := xViewStackGetPages(x.GoPointer()) | |
| 236 | - | if GetPagesPtr == 0 { | |
| 237 | - | return nil | |
| 238 | - | } | |
| 239 | - | ||
| 240 | - | GetPagesCls := >k.SelectionModelBase{} | |
| 241 | - | GetPagesCls.Ptr = GetPagesPtr | |
| 242 | - | return GetPagesCls | |
| 231 | + | cret := xViewStackGetPages(x.GoPointer()) | |
| 243 | 232 | ||
| 233 | + | if cret == 0 { | |
| 234 | + | return cls | |
| 235 | + | } | |
| 236 | + | cls = >k.SelectionModelBase{} | |
| 237 | + | cls.Ptr = cret | |
| 238 | + | return cls | |
| 244 | 239 | } | |
| 245 | 240 | ||
| 246 | 241 | var xViewStackGetVhomogeneous func(uintptr) bool | |
| @@ -248,26 +243,25 @@ var xViewStackGetVhomogeneous func(uintptr) bool | |||
| 248 | 243 | // Gets whether @self is vertically homogeneous. | |
| 249 | 244 | func (x *ViewStack) GetVhomogeneous() bool { | |
| 250 | 245 | ||
| 251 | - | return xViewStackGetVhomogeneous(x.GoPointer()) | |
| 252 | - | ||
| 246 | + | cret := xViewStackGetVhomogeneous(x.GoPointer()) | |
| 247 | + | return cret | |
| 253 | 248 | } | |
| 254 | 249 | ||
| 255 | 250 | var xViewStackGetVisibleChild func(uintptr) uintptr | |
| 256 | 251 | ||
| 257 | 252 | // Gets the currently visible child of @self, . | |
| 258 | 253 | func (x *ViewStack) GetVisibleChild() *gtk.Widget { | |
| 254 | + | var cls *gtk.Widget | |
| 259 | 255 | ||
| 260 | - | GetVisibleChildPtr := xViewStackGetVisibleChild(x.GoPointer()) | |
| 261 | - | if GetVisibleChildPtr == 0 { | |
| 262 | - | return nil | |
| 263 | - | } | |
| 264 | - | ||
| 265 | - | gobject.IncreaseRef(GetVisibleChildPtr) | |
| 266 | - | ||
| 267 | - | GetVisibleChildCls := >k.Widget{} | |
| 268 | - | GetVisibleChildCls.Ptr = GetVisibleChildPtr | |
| 269 | - | return GetVisibleChildCls | |
| 256 | + | cret := xViewStackGetVisibleChild(x.GoPointer()) | |
| 270 | 257 | ||
| 258 | + | if cret == 0 { | |
| 259 | + | return cls | |
| 260 | + | } | |
| 261 | + | gobject.IncreaseRef(cret) | |
| 262 | + | cls = >k.Widget{} | |
| 263 | + | cls.Ptr = cret | |
| 264 | + | return cls | |
| 271 | 265 | } | |
| 272 | 266 | ||
| 273 | 267 | var xViewStackGetVisibleChildName func(uintptr) string | |
| @@ -275,8 +269,8 @@ var xViewStackGetVisibleChildName func(uintptr) string | |||
| 275 | 269 | // Returns the name of the currently visible child of @self. | |
| 276 | 270 | func (x *ViewStack) GetVisibleChildName() string { | |
| 277 | 271 | ||
| 278 | - | return xViewStackGetVisibleChildName(x.GoPointer()) | |
| 279 | - | ||
| 272 | + | cret := xViewStackGetVisibleChildName(x.GoPointer()) | |
| 273 | + | return cret | |
| 280 | 274 | } | |
| 281 | 275 | ||
| 282 | 276 | var xViewStackRemove func(uintptr, uintptr) | |
| @@ -349,8 +343,8 @@ func (c *ViewStack) SetGoPointer(ptr uintptr) { | |||
| 349 | 343 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 350 | 344 | func (x *ViewStack) GetAccessibleRole() gtk.AccessibleRole { | |
| 351 | 345 | ||
| 352 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 353 | - | ||
| 346 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 347 | + | return cret | |
| 354 | 348 | } | |
| 355 | 349 | ||
| 356 | 350 | // Resets the accessible @property to its default value. | |
| @@ -485,8 +479,8 @@ func (x *ViewStack) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVa | |||
| 485 | 479 | // of the <object> tag used to construct the @buildable. | |
| 486 | 480 | func (x *ViewStack) GetBuildableId() string { | |
| 487 | 481 | ||
| 488 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 489 | - | ||
| 482 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 483 | + | return cret | |
| 490 | 484 | } | |
| 491 | 485 | ||
| 492 | 486 | // An auxiliary class used by [class@ViewStack]. | |
| @@ -505,26 +499,25 @@ var xViewStackPageGetBadgeNumber func(uintptr) uint | |||
| 505 | 499 | // Gets the badge number for this page. | |
| 506 | 500 | func (x *ViewStackPage) GetBadgeNumber() uint { | |
| 507 | 501 | ||
| 508 | - | return xViewStackPageGetBadgeNumber(x.GoPointer()) | |
| 509 | - | ||
| 502 | + | cret := xViewStackPageGetBadgeNumber(x.GoPointer()) | |
| 503 | + | return cret | |
| 510 | 504 | } | |
| 511 | 505 | ||
| 512 | 506 | var xViewStackPageGetChild func(uintptr) uintptr | |
| 513 | 507 | ||
| 514 | 508 | // Gets the stack child to which @self belongs. | |
| 515 | 509 | func (x *ViewStackPage) GetChild() *gtk.Widget { | |
| 510 | + | var cls *gtk.Widget | |
| 516 | 511 | ||
| 517 | - | GetChildPtr := xViewStackPageGetChild(x.GoPointer()) | |
| 518 | - | if GetChildPtr == 0 { | |
| 519 | - | return nil | |
| 520 | - | } | |
| 521 | - | ||
| 522 | - | gobject.IncreaseRef(GetChildPtr) | |
| 523 | - | ||
| 524 | - | GetChildCls := >k.Widget{} | |
| 525 | - | GetChildCls.Ptr = GetChildPtr | |
| 526 | - | return GetChildCls | |
| 512 | + | cret := xViewStackPageGetChild(x.GoPointer()) | |
| 527 | 513 | ||
| 514 | + | if cret == 0 { | |
| 515 | + | return cls | |
| 516 | + | } | |
| 517 | + | gobject.IncreaseRef(cret) | |
| 518 | + | cls = >k.Widget{} | |
| 519 | + | cls.Ptr = cret | |
| 520 | + | return cls | |
| 528 | 521 | } | |
| 529 | 522 | ||
| 530 | 523 | var xViewStackPageGetIconName func(uintptr) string | |
| @@ -532,8 +525,8 @@ var xViewStackPageGetIconName func(uintptr) string | |||
| 532 | 525 | // Gets the icon name of the page. | |
| 533 | 526 | func (x *ViewStackPage) GetIconName() string { | |
| 534 | 527 | ||
| 535 | - | return xViewStackPageGetIconName(x.GoPointer()) | |
| 536 | - | ||
| 528 | + | cret := xViewStackPageGetIconName(x.GoPointer()) | |
| 529 | + | return cret | |
| 537 | 530 | } | |
| 538 | 531 | ||
| 539 | 532 | var xViewStackPageGetName func(uintptr) string | |
| @@ -541,8 +534,8 @@ var xViewStackPageGetName func(uintptr) string | |||
| 541 | 534 | // Gets the name of the page. | |
| 542 | 535 | func (x *ViewStackPage) GetName() string { | |
| 543 | 536 | ||
| 544 | - | return xViewStackPageGetName(x.GoPointer()) | |
| 545 | - | ||
| 537 | + | cret := xViewStackPageGetName(x.GoPointer()) | |
| 538 | + | return cret | |
| 546 | 539 | } | |
| 547 | 540 | ||
| 548 | 541 | var xViewStackPageGetNeedsAttention func(uintptr) bool | |
| @@ -550,8 +543,8 @@ var xViewStackPageGetNeedsAttention func(uintptr) bool | |||
| 550 | 543 | // Gets whether the page requires the user attention. | |
| 551 | 544 | func (x *ViewStackPage) GetNeedsAttention() bool { | |
| 552 | 545 | ||
| 553 | - | return xViewStackPageGetNeedsAttention(x.GoPointer()) | |
| 554 | - | ||
| 546 | + | cret := xViewStackPageGetNeedsAttention(x.GoPointer()) | |
| 547 | + | return cret | |
| 555 | 548 | } | |
| 556 | 549 | ||
| 557 | 550 | var xViewStackPageGetTitle func(uintptr) string | |
| @@ -559,8 +552,8 @@ var xViewStackPageGetTitle func(uintptr) string | |||
| 559 | 552 | // Gets the page title. | |
| 560 | 553 | func (x *ViewStackPage) GetTitle() string { | |
| 561 | 554 | ||
| 562 | - | return xViewStackPageGetTitle(x.GoPointer()) | |
| 563 | - | ||
| 555 | + | cret := xViewStackPageGetTitle(x.GoPointer()) | |
| 556 | + | return cret | |
| 564 | 557 | } | |
| 565 | 558 | ||
| 566 | 559 | var xViewStackPageGetUseUnderline func(uintptr) bool | |
| @@ -568,8 +561,8 @@ var xViewStackPageGetUseUnderline func(uintptr) bool | |||
| 568 | 561 | // Gets whether underlines in the page title indicate mnemonics. | |
| 569 | 562 | func (x *ViewStackPage) GetUseUnderline() bool { | |
| 570 | 563 | ||
| 571 | - | return xViewStackPageGetUseUnderline(x.GoPointer()) | |
| 572 | - | ||
| 564 | + | cret := xViewStackPageGetUseUnderline(x.GoPointer()) | |
| 565 | + | return cret | |
| 573 | 566 | } | |
| 574 | 567 | ||
| 575 | 568 | var xViewStackPageGetVisible func(uintptr) bool | |
| @@ -580,8 +573,8 @@ var xViewStackPageGetVisible func(uintptr) bool | |||
| 580 | 573 | // property of its widget. | |
| 581 | 574 | func (x *ViewStackPage) GetVisible() bool { | |
| 582 | 575 | ||
| 583 | - | return xViewStackPageGetVisible(x.GoPointer()) | |
| 584 | - | ||
| 576 | + | cret := xViewStackPageGetVisible(x.GoPointer()) | |
| 577 | + | return cret | |
| 585 | 578 | } | |
| 586 | 579 | ||
| 587 | 580 | var xViewStackPageSetBadgeNumber func(uintptr, uint) | |
| @@ -668,8 +661,8 @@ func (c *ViewStackPage) SetGoPointer(ptr uintptr) { | |||
| 668 | 661 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 669 | 662 | func (x *ViewStackPage) GetAccessibleRole() gtk.AccessibleRole { | |
| 670 | 663 | ||
| 671 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 672 | - | ||
| 664 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 665 | + | return cret | |
| 673 | 666 | } | |
| 674 | 667 | ||
| 675 | 668 | // Resets the accessible @property to its default value. | |
M v4/adw/adw-view-switcher-bar.go +24 -24
| @@ -84,16 +84,17 @@ var xNewViewSwitcherBar func() uintptr | |||
| 84 | 84 | ||
| 85 | 85 | // Creates a new `AdwViewSwitcherBar`. | |
| 86 | 86 | func NewViewSwitcherBar() *gtk.Widget { | |
| 87 | - | NewViewSwitcherBarPtr := xNewViewSwitcherBar() | |
| 88 | - | if NewViewSwitcherBarPtr == 0 { | |
| 89 | - | return nil | |
| 90 | - | } | |
| 87 | + | var cls *gtk.Widget | |
| 91 | 88 | ||
| 92 | - | gobject.IncreaseRef(NewViewSwitcherBarPtr) | |
| 89 | + | cret := xNewViewSwitcherBar() | |
| 93 | 90 | ||
| 94 | - | NewViewSwitcherBarCls := >k.Widget{} | |
| 95 | - | NewViewSwitcherBarCls.Ptr = NewViewSwitcherBarPtr | |
| 96 | - | return NewViewSwitcherBarCls | |
| 91 | + | if cret == 0 { | |
| 92 | + | return cls | |
| 93 | + | } | |
| 94 | + | gobject.IncreaseRef(cret) | |
| 95 | + | cls = >k.Widget{} | |
| 96 | + | cls.Ptr = cret | |
| 97 | + | return cls | |
| 97 | 98 | } | |
| 98 | 99 | ||
| 99 | 100 | var xViewSwitcherBarGetReveal func(uintptr) bool | |
| @@ -101,26 +102,25 @@ var xViewSwitcherBarGetReveal func(uintptr) bool | |||
| 101 | 102 | // Gets whether @self should be revealed or hidden. | |
| 102 | 103 | func (x *ViewSwitcherBar) GetReveal() bool { | |
| 103 | 104 | ||
| 104 | - | return xViewSwitcherBarGetReveal(x.GoPointer()) | |
| 105 | - | ||
| 105 | + | cret := xViewSwitcherBarGetReveal(x.GoPointer()) | |
| 106 | + | return cret | |
| 106 | 107 | } | |
| 107 | 108 | ||
| 108 | 109 | var xViewSwitcherBarGetStack func(uintptr) uintptr | |
| 109 | 110 | ||
| 110 | 111 | // Gets the stack controlled by @self. | |
| 111 | 112 | func (x *ViewSwitcherBar) GetStack() *ViewStack { | |
| 113 | + | var cls *ViewStack | |
| 112 | 114 | ||
| 113 | - | GetStackPtr := xViewSwitcherBarGetStack(x.GoPointer()) | |
| 114 | - | if GetStackPtr == 0 { | |
| 115 | - | return nil | |
| 116 | - | } | |
| 117 | - | ||
| 118 | - | gobject.IncreaseRef(GetStackPtr) | |
| 119 | - | ||
| 120 | - | GetStackCls := &ViewStack{} | |
| 121 | - | GetStackCls.Ptr = GetStackPtr | |
| 122 | - | return GetStackCls | |
| 115 | + | cret := xViewSwitcherBarGetStack(x.GoPointer()) | |
| 123 | 116 | ||
| 117 | + | if cret == 0 { | |
| 118 | + | return cls | |
| 119 | + | } | |
| 120 | + | gobject.IncreaseRef(cret) | |
| 121 | + | cls = &ViewStack{} | |
| 122 | + | cls.Ptr = cret | |
| 123 | + | return cls | |
| 124 | 124 | } | |
| 125 | 125 | ||
| 126 | 126 | var xViewSwitcherBarSetReveal func(uintptr, bool) | |
| @@ -152,8 +152,8 @@ func (c *ViewSwitcherBar) SetGoPointer(ptr uintptr) { | |||
| 152 | 152 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 153 | 153 | func (x *ViewSwitcherBar) GetAccessibleRole() gtk.AccessibleRole { | |
| 154 | 154 | ||
| 155 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 156 | - | ||
| 155 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 156 | + | return cret | |
| 157 | 157 | } | |
| 158 | 158 | ||
| 159 | 159 | // Resets the accessible @property to its default value. | |
| @@ -288,8 +288,8 @@ func (x *ViewSwitcherBar) UpdateStateValue(NStatesVar int, StatesVar uintptr, Va | |||
| 288 | 288 | // of the <object> tag used to construct the @buildable. | |
| 289 | 289 | func (x *ViewSwitcherBar) GetBuildableId() string { | |
| 290 | 290 | ||
| 291 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 292 | - | ||
| 291 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 292 | + | return cret | |
| 293 | 293 | } | |
| 294 | 294 | ||
| 295 | 295 | func init() { | |
M v4/adw/adw-view-switcher-title.go +30 -30
| @@ -90,34 +90,34 @@ var xNewViewSwitcherTitle func() uintptr | |||
| 90 | 90 | ||
| 91 | 91 | // Creates a new `AdwViewSwitcherTitle`. | |
| 92 | 92 | func NewViewSwitcherTitle() *gtk.Widget { | |
| 93 | - | NewViewSwitcherTitlePtr := xNewViewSwitcherTitle() | |
| 94 | - | if NewViewSwitcherTitlePtr == 0 { | |
| 95 | - | return nil | |
| 96 | - | } | |
| 93 | + | var cls *gtk.Widget | |
| 97 | 94 | ||
| 98 | - | gobject.IncreaseRef(NewViewSwitcherTitlePtr) | |
| 95 | + | cret := xNewViewSwitcherTitle() | |
| 99 | 96 | ||
| 100 | - | NewViewSwitcherTitleCls := >k.Widget{} | |
| 101 | - | NewViewSwitcherTitleCls.Ptr = NewViewSwitcherTitlePtr | |
| 102 | - | return NewViewSwitcherTitleCls | |
| 97 | + | if cret == 0 { | |
| 98 | + | return cls | |
| 99 | + | } | |
| 100 | + | gobject.IncreaseRef(cret) | |
| 101 | + | cls = >k.Widget{} | |
| 102 | + | cls.Ptr = cret | |
| 103 | + | return cls | |
| 103 | 104 | } | |
| 104 | 105 | ||
| 105 | 106 | var xViewSwitcherTitleGetStack func(uintptr) uintptr | |
| 106 | 107 | ||
| 107 | 108 | // Gets the stack controlled by @self. | |
| 108 | 109 | func (x *ViewSwitcherTitle) GetStack() *ViewStack { | |
| 110 | + | var cls *ViewStack | |
| 109 | 111 | ||
| 110 | - | GetStackPtr := xViewSwitcherTitleGetStack(x.GoPointer()) | |
| 111 | - | if GetStackPtr == 0 { | |
| 112 | - | return nil | |
| 113 | - | } | |
| 114 | - | ||
| 115 | - | gobject.IncreaseRef(GetStackPtr) | |
| 116 | - | ||
| 117 | - | GetStackCls := &ViewStack{} | |
| 118 | - | GetStackCls.Ptr = GetStackPtr | |
| 119 | - | return GetStackCls | |
| 112 | + | cret := xViewSwitcherTitleGetStack(x.GoPointer()) | |
| 120 | 113 | ||
| 114 | + | if cret == 0 { | |
| 115 | + | return cls | |
| 116 | + | } | |
| 117 | + | gobject.IncreaseRef(cret) | |
| 118 | + | cls = &ViewStack{} | |
| 119 | + | cls.Ptr = cret | |
| 120 | + | return cls | |
| 121 | 121 | } | |
| 122 | 122 | ||
| 123 | 123 | var xViewSwitcherTitleGetSubtitle func(uintptr) string | |
| @@ -125,8 +125,8 @@ var xViewSwitcherTitleGetSubtitle func(uintptr) string | |||
| 125 | 125 | // Gets the subtitle of @self. | |
| 126 | 126 | func (x *ViewSwitcherTitle) GetSubtitle() string { | |
| 127 | 127 | ||
| 128 | - | return xViewSwitcherTitleGetSubtitle(x.GoPointer()) | |
| 129 | - | ||
| 128 | + | cret := xViewSwitcherTitleGetSubtitle(x.GoPointer()) | |
| 129 | + | return cret | |
| 130 | 130 | } | |
| 131 | 131 | ||
| 132 | 132 | var xViewSwitcherTitleGetTitle func(uintptr) string | |
| @@ -134,8 +134,8 @@ var xViewSwitcherTitleGetTitle func(uintptr) string | |||
| 134 | 134 | // Gets the title of @self. | |
| 135 | 135 | func (x *ViewSwitcherTitle) GetTitle() string { | |
| 136 | 136 | ||
| 137 | - | return xViewSwitcherTitleGetTitle(x.GoPointer()) | |
| 138 | - | ||
| 137 | + | cret := xViewSwitcherTitleGetTitle(x.GoPointer()) | |
| 138 | + | return cret | |
| 139 | 139 | } | |
| 140 | 140 | ||
| 141 | 141 | var xViewSwitcherTitleGetTitleVisible func(uintptr) bool | |
| @@ -146,8 +146,8 @@ var xViewSwitcherTitleGetTitleVisible func(uintptr) bool | |||
| 146 | 146 | // wanted to show an alternative switcher, e.g. a [class@ViewSwitcherBar]. | |
| 147 | 147 | func (x *ViewSwitcherTitle) GetTitleVisible() bool { | |
| 148 | 148 | ||
| 149 | - | return xViewSwitcherTitleGetTitleVisible(x.GoPointer()) | |
| 150 | - | ||
| 149 | + | cret := xViewSwitcherTitleGetTitleVisible(x.GoPointer()) | |
| 150 | + | return cret | |
| 151 | 151 | } | |
| 152 | 152 | ||
| 153 | 153 | var xViewSwitcherTitleGetViewSwitcherEnabled func(uintptr) bool | |
| @@ -155,8 +155,8 @@ var xViewSwitcherTitleGetViewSwitcherEnabled func(uintptr) bool | |||
| 155 | 155 | // Gets whether @self's view switcher is enabled. | |
| 156 | 156 | func (x *ViewSwitcherTitle) GetViewSwitcherEnabled() bool { | |
| 157 | 157 | ||
| 158 | - | return xViewSwitcherTitleGetViewSwitcherEnabled(x.GoPointer()) | |
| 159 | - | ||
| 158 | + | cret := xViewSwitcherTitleGetViewSwitcherEnabled(x.GoPointer()) | |
| 159 | + | return cret | |
| 160 | 160 | } | |
| 161 | 161 | ||
| 162 | 162 | var xViewSwitcherTitleSetStack func(uintptr, uintptr) | |
| @@ -218,8 +218,8 @@ func (c *ViewSwitcherTitle) SetGoPointer(ptr uintptr) { | |||
| 218 | 218 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 219 | 219 | func (x *ViewSwitcherTitle) GetAccessibleRole() gtk.AccessibleRole { | |
| 220 | 220 | ||
| 221 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 222 | - | ||
| 221 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 222 | + | return cret | |
| 223 | 223 | } | |
| 224 | 224 | ||
| 225 | 225 | // Resets the accessible @property to its default value. | |
| @@ -354,8 +354,8 @@ func (x *ViewSwitcherTitle) UpdateStateValue(NStatesVar int, StatesVar uintptr, | |||
| 354 | 354 | // of the <object> tag used to construct the @buildable. | |
| 355 | 355 | func (x *ViewSwitcherTitle) GetBuildableId() string { | |
| 356 | 356 | ||
| 357 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 358 | - | ||
| 357 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 358 | + | return cret | |
| 359 | 359 | } | |
| 360 | 360 | ||
| 361 | 361 | func init() { | |
M v4/adw/adw-view-switcher.go +24 -24
| @@ -66,16 +66,17 @@ var xNewViewSwitcher func() uintptr | |||
| 66 | 66 | ||
| 67 | 67 | // Creates a new `AdwViewSwitcher`. | |
| 68 | 68 | func NewViewSwitcher() *gtk.Widget { | |
| 69 | - | NewViewSwitcherPtr := xNewViewSwitcher() | |
| 70 | - | if NewViewSwitcherPtr == 0 { | |
| 71 | - | return nil | |
| 72 | - | } | |
| 69 | + | var cls *gtk.Widget | |
| 73 | 70 | ||
| 74 | - | gobject.IncreaseRef(NewViewSwitcherPtr) | |
| 71 | + | cret := xNewViewSwitcher() | |
| 75 | 72 | ||
| 76 | - | NewViewSwitcherCls := >k.Widget{} | |
| 77 | - | NewViewSwitcherCls.Ptr = NewViewSwitcherPtr | |
| 78 | - | return NewViewSwitcherCls | |
| 73 | + | if cret == 0 { | |
| 74 | + | return cls | |
| 75 | + | } | |
| 76 | + | gobject.IncreaseRef(cret) | |
| 77 | + | cls = >k.Widget{} | |
| 78 | + | cls.Ptr = cret | |
| 79 | + | return cls | |
| 79 | 80 | } | |
| 80 | 81 | ||
| 81 | 82 | var xViewSwitcherGetPolicy func(uintptr) ViewSwitcherPolicy | |
| @@ -83,26 +84,25 @@ var xViewSwitcherGetPolicy func(uintptr) ViewSwitcherPolicy | |||
| 83 | 84 | // Gets the policy of @self. | |
| 84 | 85 | func (x *ViewSwitcher) GetPolicy() ViewSwitcherPolicy { | |
| 85 | 86 | ||
| 86 | - | return xViewSwitcherGetPolicy(x.GoPointer()) | |
| 87 | - | ||
| 87 | + | cret := xViewSwitcherGetPolicy(x.GoPointer()) | |
| 88 | + | return cret | |
| 88 | 89 | } | |
| 89 | 90 | ||
| 90 | 91 | var xViewSwitcherGetStack func(uintptr) uintptr | |
| 91 | 92 | ||
| 92 | 93 | // Gets the stack controlled by @self. | |
| 93 | 94 | func (x *ViewSwitcher) GetStack() *ViewStack { | |
| 95 | + | var cls *ViewStack | |
| 94 | 96 | ||
| 95 | - | GetStackPtr := xViewSwitcherGetStack(x.GoPointer()) | |
| 96 | - | if GetStackPtr == 0 { | |
| 97 | - | return nil | |
| 98 | - | } | |
| 99 | - | ||
| 100 | - | gobject.IncreaseRef(GetStackPtr) | |
| 101 | - | ||
| 102 | - | GetStackCls := &ViewStack{} | |
| 103 | - | GetStackCls.Ptr = GetStackPtr | |
| 104 | - | return GetStackCls | |
| 97 | + | cret := xViewSwitcherGetStack(x.GoPointer()) | |
| 105 | 98 | ||
| 99 | + | if cret == 0 { | |
| 100 | + | return cls | |
| 101 | + | } | |
| 102 | + | gobject.IncreaseRef(cret) | |
| 103 | + | cls = &ViewStack{} | |
| 104 | + | cls.Ptr = cret | |
| 105 | + | return cls | |
| 106 | 106 | } | |
| 107 | 107 | ||
| 108 | 108 | var xViewSwitcherSetPolicy func(uintptr, ViewSwitcherPolicy) | |
| @@ -134,8 +134,8 @@ func (c *ViewSwitcher) SetGoPointer(ptr uintptr) { | |||
| 134 | 134 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 135 | 135 | func (x *ViewSwitcher) GetAccessibleRole() gtk.AccessibleRole { | |
| 136 | 136 | ||
| 137 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 138 | - | ||
| 137 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 138 | + | return cret | |
| 139 | 139 | } | |
| 140 | 140 | ||
| 141 | 141 | // Resets the accessible @property to its default value. | |
| @@ -270,8 +270,8 @@ func (x *ViewSwitcher) UpdateStateValue(NStatesVar int, StatesVar uintptr, Value | |||
| 270 | 270 | // of the <object> tag used to construct the @buildable. | |
| 271 | 271 | func (x *ViewSwitcher) GetBuildableId() string { | |
| 272 | 272 | ||
| 273 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 274 | - | ||
| 273 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 274 | + | return cret | |
| 275 | 275 | } | |
| 276 | 276 | ||
| 277 | 277 | func init() { | |
M v4/adw/adw-window-title.go +17 -16
| @@ -41,16 +41,17 @@ var xNewWindowTitle func(string, string) uintptr | |||
| 41 | 41 | ||
| 42 | 42 | // Creates a new `AdwWindowTitle`. | |
| 43 | 43 | func NewWindowTitle(TitleVar string, SubtitleVar string) *gtk.Widget { | |
| 44 | - | NewWindowTitlePtr := xNewWindowTitle(TitleVar, SubtitleVar) | |
| 45 | - | if NewWindowTitlePtr == 0 { | |
| 46 | - | return nil | |
| 47 | - | } | |
| 44 | + | var cls *gtk.Widget | |
| 48 | 45 | ||
| 49 | - | gobject.IncreaseRef(NewWindowTitlePtr) | |
| 46 | + | cret := xNewWindowTitle(TitleVar, SubtitleVar) | |
| 50 | 47 | ||
| 51 | - | NewWindowTitleCls := >k.Widget{} | |
| 52 | - | NewWindowTitleCls.Ptr = NewWindowTitlePtr | |
| 53 | - | return NewWindowTitleCls | |
| 48 | + | if cret == 0 { | |
| 49 | + | return cls | |
| 50 | + | } | |
| 51 | + | gobject.IncreaseRef(cret) | |
| 52 | + | cls = >k.Widget{} | |
| 53 | + | cls.Ptr = cret | |
| 54 | + | return cls | |
| 54 | 55 | } | |
| 55 | 56 | ||
| 56 | 57 | var xWindowTitleGetSubtitle func(uintptr) string | |
| @@ -58,8 +59,8 @@ var xWindowTitleGetSubtitle func(uintptr) string | |||
| 58 | 59 | // Gets the subtitle of @self. | |
| 59 | 60 | func (x *WindowTitle) GetSubtitle() string { | |
| 60 | 61 | ||
| 61 | - | return xWindowTitleGetSubtitle(x.GoPointer()) | |
| 62 | - | ||
| 62 | + | cret := xWindowTitleGetSubtitle(x.GoPointer()) | |
| 63 | + | return cret | |
| 63 | 64 | } | |
| 64 | 65 | ||
| 65 | 66 | var xWindowTitleGetTitle func(uintptr) string | |
| @@ -67,8 +68,8 @@ var xWindowTitleGetTitle func(uintptr) string | |||
| 67 | 68 | // Gets the title of @self. | |
| 68 | 69 | func (x *WindowTitle) GetTitle() string { | |
| 69 | 70 | ||
| 70 | - | return xWindowTitleGetTitle(x.GoPointer()) | |
| 71 | - | ||
| 71 | + | cret := xWindowTitleGetTitle(x.GoPointer()) | |
| 72 | + | return cret | |
| 72 | 73 | } | |
| 73 | 74 | ||
| 74 | 75 | var xWindowTitleSetSubtitle func(uintptr, string) | |
| @@ -105,8 +106,8 @@ func (c *WindowTitle) SetGoPointer(ptr uintptr) { | |||
| 105 | 106 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 106 | 107 | func (x *WindowTitle) GetAccessibleRole() gtk.AccessibleRole { | |
| 107 | 108 | ||
| 108 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 109 | - | ||
| 109 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 110 | + | return cret | |
| 110 | 111 | } | |
| 111 | 112 | ||
| 112 | 113 | // Resets the accessible @property to its default value. | |
| @@ -241,8 +242,8 @@ func (x *WindowTitle) UpdateStateValue(NStatesVar int, StatesVar uintptr, Values | |||
| 241 | 242 | // of the <object> tag used to construct the @buildable. | |
| 242 | 243 | func (x *WindowTitle) GetBuildableId() string { | |
| 243 | 244 | ||
| 244 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 245 | - | ||
| 245 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 246 | + | return cret | |
| 246 | 247 | } | |
| 247 | 248 | ||
| 248 | 249 | func init() { | |
M v4/adw/adw-window.go +58 -62
| @@ -63,16 +63,17 @@ var xNewWindow func() uintptr | |||
| 63 | 63 | ||
| 64 | 64 | // Creates a new `AdwWindow`. | |
| 65 | 65 | func NewWindow() *gtk.Widget { | |
| 66 | - | NewWindowPtr := xNewWindow() | |
| 67 | - | if NewWindowPtr == 0 { | |
| 68 | - | return nil | |
| 69 | - | } | |
| 66 | + | var cls *gtk.Widget | |
| 70 | 67 | ||
| 71 | - | gobject.IncreaseRef(NewWindowPtr) | |
| 68 | + | cret := xNewWindow() | |
| 72 | 69 | ||
| 73 | - | NewWindowCls := >k.Widget{} | |
| 74 | - | NewWindowCls.Ptr = NewWindowPtr | |
| 75 | - | return NewWindowCls | |
| 70 | + | if cret == 0 { | |
| 71 | + | return cls | |
| 72 | + | } | |
| 73 | + | gobject.IncreaseRef(cret) | |
| 74 | + | cls = >k.Widget{} | |
| 75 | + | cls.Ptr = cret | |
| 76 | + | return cls | |
| 76 | 77 | } | |
| 77 | 78 | ||
| 78 | 79 | var xWindowGetContent func(uintptr) uintptr | |
| @@ -81,18 +82,17 @@ var xWindowGetContent func(uintptr) uintptr | |||
| 81 | 82 | // | |
| 82 | 83 | // This method should always be used instead of [method@Gtk.Window.get_child]. | |
| 83 | 84 | func (x *Window) GetContent() *gtk.Widget { | |
| 85 | + | var cls *gtk.Widget | |
| 84 | 86 | ||
| 85 | - | GetContentPtr := xWindowGetContent(x.GoPointer()) | |
| 86 | - | if GetContentPtr == 0 { | |
| 87 | - | return nil | |
| 88 | - | } | |
| 89 | - | ||
| 90 | - | gobject.IncreaseRef(GetContentPtr) | |
| 91 | - | ||
| 92 | - | GetContentCls := >k.Widget{} | |
| 93 | - | GetContentCls.Ptr = GetContentPtr | |
| 94 | - | return GetContentCls | |
| 87 | + | cret := xWindowGetContent(x.GoPointer()) | |
| 95 | 88 | ||
| 89 | + | if cret == 0 { | |
| 90 | + | return cls | |
| 91 | + | } | |
| 92 | + | gobject.IncreaseRef(cret) | |
| 93 | + | cls = >k.Widget{} | |
| 94 | + | cls.Ptr = cret | |
| 95 | + | return cls | |
| 96 | 96 | } | |
| 97 | 97 | ||
| 98 | 98 | var xWindowSetContent func(uintptr, uintptr) | |
| @@ -117,8 +117,8 @@ func (c *Window) SetGoPointer(ptr uintptr) { | |||
| 117 | 117 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 118 | 118 | func (x *Window) GetAccessibleRole() gtk.AccessibleRole { | |
| 119 | 119 | ||
| 120 | - | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 121 | - | ||
| 120 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 121 | + | return cret | |
| 122 | 122 | } | |
| 123 | 123 | ||
| 124 | 124 | // Resets the accessible @property to its default value. | |
| @@ -253,40 +253,38 @@ func (x *Window) UpdateStateValue(NStatesVar int, StatesVar uintptr, ValuesVar u | |||
| 253 | 253 | // of the <object> tag used to construct the @buildable. | |
| 254 | 254 | func (x *Window) GetBuildableId() string { | |
| 255 | 255 | ||
| 256 | - | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 257 | - | ||
| 256 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 257 | + | return cret | |
| 258 | 258 | } | |
| 259 | 259 | ||
| 260 | 260 | // Returns the renderer that is used for this `GtkNative`. | |
| 261 | 261 | func (x *Window) GetRenderer() *gsk.Renderer { | |
| 262 | + | var cls *gsk.Renderer | |
| 262 | 263 | ||
| 263 | - | GetRendererPtr := gtk.XGtkNativeGetRenderer(x.GoPointer()) | |
| 264 | - | if GetRendererPtr == 0 { | |
| 265 | - | return nil | |
| 266 | - | } | |
| 267 | - | ||
| 268 | - | gobject.IncreaseRef(GetRendererPtr) | |
| 269 | - | ||
| 270 | - | GetRendererCls := &gsk.Renderer{} | |
| 271 | - | GetRendererCls.Ptr = GetRendererPtr | |
| 272 | - | return GetRendererCls | |
| 264 | + | cret := gtk.XGtkNativeGetRenderer(x.GoPointer()) | |
| 273 | 265 | ||
| 266 | + | if cret == 0 { | |
| 267 | + | return cls | |
| 268 | + | } | |
| 269 | + | gobject.IncreaseRef(cret) | |
| 270 | + | cls = &gsk.Renderer{} | |
| 271 | + | cls.Ptr = cret | |
| 272 | + | return cls | |
| 274 | 273 | } | |
| 275 | 274 | ||
| 276 | 275 | // Returns the surface of this `GtkNative`. | |
| 277 | 276 | func (x *Window) GetSurface() *gdk.Surface { | |
| 277 | + | var cls *gdk.Surface | |
| 278 | 278 | ||
| 279 | - | GetSurfacePtr := gtk.XGtkNativeGetSurface(x.GoPointer()) | |
| 280 | - | if GetSurfacePtr == 0 { | |
| 281 | - | return nil | |
| 282 | - | } | |
| 283 | - | ||
| 284 | - | gobject.IncreaseRef(GetSurfacePtr) | |
| 285 | - | ||
| 286 | - | GetSurfaceCls := &gdk.Surface{} | |
| 287 | - | GetSurfaceCls.Ptr = GetSurfacePtr | |
| 288 | - | return GetSurfaceCls | |
| 279 | + | cret := gtk.XGtkNativeGetSurface(x.GoPointer()) | |
| 289 | 280 | ||
| 281 | + | if cret == 0 { | |
| 282 | + | return cls | |
| 283 | + | } | |
| 284 | + | gobject.IncreaseRef(cret) | |
| 285 | + | cls = &gdk.Surface{} | |
| 286 | + | cls.Ptr = cret | |
| 287 | + | return cls | |
| 290 | 288 | } | |
| 291 | 289 | ||
| 292 | 290 | // Retrieves the surface transform of @self. | |
| @@ -319,18 +317,17 @@ func (x *Window) Unrealize() { | |||
| 319 | 317 | ||
| 320 | 318 | // Returns the display that this `GtkRoot` is on. | |
| 321 | 319 | func (x *Window) GetDisplay() *gdk.Display { | |
| 320 | + | var cls *gdk.Display | |
| 322 | 321 | ||
| 323 | - | GetDisplayPtr := gtk.XGtkRootGetDisplay(x.GoPointer()) | |
| 324 | - | if GetDisplayPtr == 0 { | |
| 325 | - | return nil | |
| 326 | - | } | |
| 327 | - | ||
| 328 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 329 | - | ||
| 330 | - | GetDisplayCls := &gdk.Display{} | |
| 331 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 332 | - | return GetDisplayCls | |
| 322 | + | cret := gtk.XGtkRootGetDisplay(x.GoPointer()) | |
| 333 | 323 | ||
| 324 | + | if cret == 0 { | |
| 325 | + | return cls | |
| 326 | + | } | |
| 327 | + | gobject.IncreaseRef(cret) | |
| 328 | + | cls = &gdk.Display{} | |
| 329 | + | cls.Ptr = cret | |
| 330 | + | return cls | |
| 334 | 331 | } | |
| 335 | 332 | ||
| 336 | 333 | // Retrieves the current focused widget within the root. | |
| @@ -340,18 +337,17 @@ func (x *Window) GetDisplay() *gdk.Display { | |||
| 340 | 337 | // `gtk_widget_has_focus (widget)` will be %FALSE for the | |
| 341 | 338 | // widget. | |
| 342 | 339 | func (x *Window) GetFocus() *gtk.Widget { | |
| 340 | + | var cls *gtk.Widget | |
| 343 | 341 | ||
| 344 | - | GetFocusPtr := gtk.XGtkRootGetFocus(x.GoPointer()) | |
| 345 | - | if GetFocusPtr == 0 { | |
| 346 | - | return nil | |
| 347 | - | } | |
| 348 | - | ||
| 349 | - | gobject.IncreaseRef(GetFocusPtr) | |
| 350 | - | ||
| 351 | - | GetFocusCls := >k.Widget{} | |
| 352 | - | GetFocusCls.Ptr = GetFocusPtr | |
| 353 | - | return GetFocusCls | |
| 342 | + | cret := gtk.XGtkRootGetFocus(x.GoPointer()) | |
| 354 | 343 | ||
| 344 | + | if cret == 0 { | |
| 345 | + | return cls | |
| 346 | + | } | |
| 347 | + | gobject.IncreaseRef(cret) | |
| 348 | + | cls = >k.Widget{} | |
| 349 | + | cls.Ptr = cret | |
| 350 | + | return cls | |
| 355 | 351 | } | |
| 356 | 352 | ||
| 357 | 353 | // If @focus is not the current focus widget, and is focusable, sets | |
M v4/gdk/gdkapplaunchcontext.go +9 -10
| @@ -42,18 +42,17 @@ var xAppLaunchContextGetDisplay func(uintptr) uintptr | |||
| 42 | 42 | ||
| 43 | 43 | // Gets the `GdkDisplay` that @context is for. | |
| 44 | 44 | func (x *AppLaunchContext) GetDisplay() *Display { | |
| 45 | + | var cls *Display | |
| 45 | 46 | ||
| 46 | - | GetDisplayPtr := xAppLaunchContextGetDisplay(x.GoPointer()) | |
| 47 | - | if GetDisplayPtr == 0 { | |
| 48 | - | return nil | |
| 49 | - | } | |
| 50 | - | ||
| 51 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 52 | - | ||
| 53 | - | GetDisplayCls := &Display{} | |
| 54 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 55 | - | return GetDisplayCls | |
| 47 | + | cret := xAppLaunchContextGetDisplay(x.GoPointer()) | |
| 56 | 48 | ||
| 49 | + | if cret == 0 { | |
| 50 | + | return cls | |
| 51 | + | } | |
| 52 | + | gobject.IncreaseRef(cret) | |
| 53 | + | cls = &Display{} | |
| 54 | + | cls.Ptr = cret | |
| 55 | + | return cls | |
| 57 | 56 | } | |
| 58 | 57 | ||
| 59 | 58 | var xAppLaunchContextSetDesktop func(uintptr, int) | |
M v4/gdk/gdkcairo.go +2 -2
| @@ -61,8 +61,8 @@ var xCairoRegionCreateFromSurface func(*cairo.Surface) *cairo.Region | |||
| 61 | 61 | // set with cairo_surface_set_device_offset(). | |
| 62 | 62 | func CairoRegionCreateFromSurface(SurfaceVar *cairo.Surface) *cairo.Region { | |
| 63 | 63 | ||
| 64 | - | return xCairoRegionCreateFromSurface(SurfaceVar) | |
| 65 | - | ||
| 64 | + | cret := xCairoRegionCreateFromSurface(SurfaceVar) | |
| 65 | + | return cret | |
| 66 | 66 | } | |
| 67 | 67 | ||
| 68 | 68 | var xCairoSetSourcePixbuf func(*cairo.Context, uintptr, float64, float64) | |
M v4/gdk/gdkcairocontext.go +2 -2
| @@ -35,8 +35,8 @@ var xCairoContextCairoCreate func(uintptr) *cairo.Context | |||
| 35 | 35 | // [method@Gdk.DrawContext.end_frame] is called. | |
| 36 | 36 | func (x *CairoContext) CairoCreate() *cairo.Context { | |
| 37 | 37 | ||
| 38 | - | return xCairoContextCairoCreate(x.GoPointer()) | |
| 39 | - | ||
| 38 | + | cret := xCairoContextCairoCreate(x.GoPointer()) | |
| 39 | + | return cret | |
| 40 | 40 | } | |
| 41 | 41 | ||
| 42 | 42 | func (c *CairoContext) GoPointer() uintptr { | |
M v4/gdk/gdkclipboard.go +77 -53
| @@ -5,6 +5,7 @@ import ( | |||
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | 7 | "github.com/jwijenbergh/puregotk/v4/gio" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 8 | 9 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | 10 | ) | |
| 10 | 11 | ||
| @@ -42,36 +43,34 @@ var xClipboardGetContent func(uintptr) uintptr | |||
| 42 | 43 | // If the @clipboard is empty or its contents are not owned by the | |
| 43 | 44 | // current process, %NULL will be returned. | |
| 44 | 45 | func (x *Clipboard) GetContent() *ContentProvider { | |
| 46 | + | var cls *ContentProvider | |
| 45 | 47 | ||
| 46 | - | GetContentPtr := xClipboardGetContent(x.GoPointer()) | |
| 47 | - | if GetContentPtr == 0 { | |
| 48 | - | return nil | |
| 49 | - | } | |
| 50 | - | ||
| 51 | - | gobject.IncreaseRef(GetContentPtr) | |
| 52 | - | ||
| 53 | - | GetContentCls := &ContentProvider{} | |
| 54 | - | GetContentCls.Ptr = GetContentPtr | |
| 55 | - | return GetContentCls | |
| 48 | + | cret := xClipboardGetContent(x.GoPointer()) | |
| 56 | 49 | ||
| 50 | + | if cret == 0 { | |
| 51 | + | return cls | |
| 52 | + | } | |
| 53 | + | gobject.IncreaseRef(cret) | |
| 54 | + | cls = &ContentProvider{} | |
| 55 | + | cls.Ptr = cret | |
| 56 | + | return cls | |
| 57 | 57 | } | |
| 58 | 58 | ||
| 59 | 59 | var xClipboardGetDisplay func(uintptr) uintptr | |
| 60 | 60 | ||
| 61 | 61 | // Gets the `GdkDisplay` that the clipboard was created for. | |
| 62 | 62 | func (x *Clipboard) GetDisplay() *Display { | |
| 63 | + | var cls *Display | |
| 63 | 64 | ||
| 64 | - | GetDisplayPtr := xClipboardGetDisplay(x.GoPointer()) | |
| 65 | - | if GetDisplayPtr == 0 { | |
| 66 | - | return nil | |
| 67 | - | } | |
| 68 | - | ||
| 69 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 70 | - | ||
| 71 | - | GetDisplayCls := &Display{} | |
| 72 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 73 | - | return GetDisplayCls | |
| 65 | + | cret := xClipboardGetDisplay(x.GoPointer()) | |
| 74 | 66 | ||
| 67 | + | if cret == 0 { | |
| 68 | + | return cls | |
| 69 | + | } | |
| 70 | + | gobject.IncreaseRef(cret) | |
| 71 | + | cls = &Display{} | |
| 72 | + | cls.Ptr = cret | |
| 73 | + | return cls | |
| 75 | 74 | } | |
| 76 | 75 | ||
| 77 | 76 | var xClipboardGetFormats func(uintptr) *ContentFormats | |
| @@ -79,8 +78,8 @@ var xClipboardGetFormats func(uintptr) *ContentFormats | |||
| 79 | 78 | // Gets the formats that the clipboard can provide its current contents in. | |
| 80 | 79 | func (x *Clipboard) GetFormats() *ContentFormats { | |
| 81 | 80 | ||
| 82 | - | return xClipboardGetFormats(x.GoPointer()) | |
| 83 | - | ||
| 81 | + | cret := xClipboardGetFormats(x.GoPointer()) | |
| 82 | + | return cret | |
| 84 | 83 | } | |
| 85 | 84 | ||
| 86 | 85 | var xClipboardIsLocal func(uintptr) bool | |
| @@ -94,8 +93,8 @@ var xClipboardIsLocal func(uintptr) bool | |||
| 94 | 93 | // even on a local clipboard. In this case the clipboard is empty. | |
| 95 | 94 | func (x *Clipboard) IsLocal() bool { | |
| 96 | 95 | ||
| 97 | - | return xClipboardIsLocal(x.GoPointer()) | |
| 98 | - | ||
| 96 | + | cret := xClipboardIsLocal(x.GoPointer()) | |
| 97 | + | return cret | |
| 99 | 98 | } | |
| 100 | 99 | ||
| 101 | 100 | var xClipboardReadAsync func(uintptr, uintptr, int, uintptr, uintptr, uintptr) | |
| @@ -114,21 +113,26 @@ func (x *Clipboard) ReadAsync(MimeTypesVar uintptr, IoPriorityVar int, Cancellab | |||
| 114 | 113 | ||
| 115 | 114 | } | |
| 116 | 115 | ||
| 117 | - | var xClipboardReadFinish func(uintptr, uintptr, string) uintptr | |
| 116 | + | var xClipboardReadFinish func(uintptr, uintptr, string, **glib.Error) uintptr | |
| 118 | 117 | ||
| 119 | 118 | // Finishes an asynchronous clipboard read. | |
| 120 | 119 | // | |
| 121 | 120 | // See [method@Gdk.Clipboard.read_async]. | |
| 122 | - | func (x *Clipboard) ReadFinish(ResultVar gio.AsyncResult, OutMimeTypeVar string) *gio.InputStream { | |
| 121 | + | func (x *Clipboard) ReadFinish(ResultVar gio.AsyncResult, OutMimeTypeVar string) (*gio.InputStream, error) { | |
| 122 | + | var cls *gio.InputStream | |
| 123 | + | var cerr *glib.Error | |
| 123 | 124 | ||
| 124 | - | ReadFinishPtr := xClipboardReadFinish(x.GoPointer(), ResultVar.GoPointer(), OutMimeTypeVar) | |
| 125 | - | if ReadFinishPtr == 0 { | |
| 126 | - | return nil | |
| 127 | - | } | |
| 125 | + | cret := xClipboardReadFinish(x.GoPointer(), ResultVar.GoPointer(), OutMimeTypeVar, &cerr) | |
| 128 | 126 | ||
| 129 | - | ReadFinishCls := &gio.InputStream{} | |
| 130 | - | ReadFinishCls.Ptr = ReadFinishPtr | |
| 131 | - | return ReadFinishCls | |
| 127 | + | if cret == 0 { | |
| 128 | + | return cls, cerr | |
| 129 | + | } | |
| 130 | + | cls = &gio.InputStream{} | |
| 131 | + | cls.Ptr = cret | |
| 132 | + | if cerr == nil { | |
| 133 | + | return cls, nil | |
| 134 | + | } | |
| 135 | + | return cls, cerr | |
| 132 | 136 | ||
| 133 | 137 | } | |
| 134 | 138 | ||
| @@ -148,14 +152,19 @@ func (x *Clipboard) ReadTextAsync(CancellableVar *gio.Cancellable, CallbackVar g | |||
| 148 | 152 | ||
| 149 | 153 | } | |
| 150 | 154 | ||
| 151 | - | var xClipboardReadTextFinish func(uintptr, uintptr) string | |
| 155 | + | var xClipboardReadTextFinish func(uintptr, uintptr, **glib.Error) string | |
| 152 | 156 | ||
| 153 | 157 | // Finishes an asynchronous clipboard read. | |
| 154 | 158 | // | |
| 155 | 159 | // See [method@Gdk.Clipboard.read_text_async]. | |
| 156 | - | func (x *Clipboard) ReadTextFinish(ResultVar gio.AsyncResult) string { | |
| 160 | + | func (x *Clipboard) ReadTextFinish(ResultVar gio.AsyncResult) (string, error) { | |
| 161 | + | var cerr *glib.Error | |
| 157 | 162 | ||
| 158 | - | return xClipboardReadTextFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 163 | + | cret := xClipboardReadTextFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 164 | + | if cerr == nil { | |
| 165 | + | return cret, nil | |
| 166 | + | } | |
| 167 | + | return cret, cerr | |
| 159 | 168 | ||
| 160 | 169 | } | |
| 161 | 170 | ||
| @@ -175,21 +184,26 @@ func (x *Clipboard) ReadTextureAsync(CancellableVar *gio.Cancellable, CallbackVa | |||
| 175 | 184 | ||
| 176 | 185 | } | |
| 177 | 186 | ||
| 178 | - | var xClipboardReadTextureFinish func(uintptr, uintptr) uintptr | |
| 187 | + | var xClipboardReadTextureFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 179 | 188 | ||
| 180 | 189 | // Finishes an asynchronous clipboard read. | |
| 181 | 190 | // | |
| 182 | 191 | // See [method@Gdk.Clipboard.read_texture_async]. | |
| 183 | - | func (x *Clipboard) ReadTextureFinish(ResultVar gio.AsyncResult) *Texture { | |
| 192 | + | func (x *Clipboard) ReadTextureFinish(ResultVar gio.AsyncResult) (*Texture, error) { | |
| 193 | + | var cls *Texture | |
| 194 | + | var cerr *glib.Error | |
| 184 | 195 | ||
| 185 | - | ReadTextureFinishPtr := xClipboardReadTextureFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 186 | - | if ReadTextureFinishPtr == 0 { | |
| 187 | - | return nil | |
| 188 | - | } | |
| 196 | + | cret := xClipboardReadTextureFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 189 | 197 | ||
| 190 | - | ReadTextureFinishCls := &Texture{} | |
| 191 | - | ReadTextureFinishCls.Ptr = ReadTextureFinishPtr | |
| 192 | - | return ReadTextureFinishCls | |
| 198 | + | if cret == 0 { | |
| 199 | + | return cls, cerr | |
| 200 | + | } | |
| 201 | + | cls = &Texture{} | |
| 202 | + | cls.Ptr = cret | |
| 203 | + | if cerr == nil { | |
| 204 | + | return cls, nil | |
| 205 | + | } | |
| 206 | + | return cls, cerr | |
| 193 | 207 | ||
| 194 | 208 | } | |
| 195 | 209 | ||
| @@ -210,14 +224,19 @@ func (x *Clipboard) ReadValueAsync(TypeVar []interface{}, IoPriorityVar int, Can | |||
| 210 | 224 | ||
| 211 | 225 | } | |
| 212 | 226 | ||
| 213 | - | var xClipboardReadValueFinish func(uintptr, uintptr) *gobject.Value | |
| 227 | + | var xClipboardReadValueFinish func(uintptr, uintptr, **glib.Error) *gobject.Value | |
| 214 | 228 | ||
| 215 | 229 | // Finishes an asynchronous clipboard read. | |
| 216 | 230 | // | |
| 217 | 231 | // See [method@Gdk.Clipboard.read_value_async]. | |
| 218 | - | func (x *Clipboard) ReadValueFinish(ResultVar gio.AsyncResult) *gobject.Value { | |
| 232 | + | func (x *Clipboard) ReadValueFinish(ResultVar gio.AsyncResult) (*gobject.Value, error) { | |
| 233 | + | var cerr *glib.Error | |
| 219 | 234 | ||
| 220 | - | return xClipboardReadValueFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 235 | + | cret := xClipboardReadValueFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 236 | + | if cerr == nil { | |
| 237 | + | return cret, nil | |
| 238 | + | } | |
| 239 | + | return cret, cerr | |
| 221 | 240 | ||
| 222 | 241 | } | |
| 223 | 242 | ||
| @@ -256,8 +275,8 @@ var xClipboardSetContent func(uintptr, uintptr) bool | |||
| 256 | 275 | // transfer the contents and then request that format from @provider. | |
| 257 | 276 | func (x *Clipboard) SetContent(ProviderVar *ContentProvider) bool { | |
| 258 | 277 | ||
| 259 | - | return xClipboardSetContent(x.GoPointer(), ProviderVar.GoPointer()) | |
| 260 | - | ||
| 278 | + | cret := xClipboardSetContent(x.GoPointer(), ProviderVar.GoPointer()) | |
| 279 | + | return cret | |
| 261 | 280 | } | |
| 262 | 281 | ||
| 263 | 282 | var xClipboardSetText func(uintptr, string) | |
| @@ -317,14 +336,19 @@ func (x *Clipboard) StoreAsync(IoPriorityVar int, CancellableVar *gio.Cancellabl | |||
| 317 | 336 | ||
| 318 | 337 | } | |
| 319 | 338 | ||
| 320 | - | var xClipboardStoreFinish func(uintptr, uintptr) bool | |
| 339 | + | var xClipboardStoreFinish func(uintptr, uintptr, **glib.Error) bool | |
| 321 | 340 | ||
| 322 | 341 | // Finishes an asynchronous clipboard store. | |
| 323 | 342 | // | |
| 324 | 343 | // See [method@Gdk.Clipboard.store_async]. | |
| 325 | - | func (x *Clipboard) StoreFinish(ResultVar gio.AsyncResult) bool { | |
| 344 | + | func (x *Clipboard) StoreFinish(ResultVar gio.AsyncResult) (bool, error) { | |
| 345 | + | var cerr *glib.Error | |
| 326 | 346 | ||
| 327 | - | return xClipboardStoreFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 347 | + | cret := xClipboardStoreFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 348 | + | if cerr == nil { | |
| 349 | + | return cret, nil | |
| 350 | + | } | |
| 351 | + | return cret, cerr | |
| 328 | 352 | ||
| 329 | 353 | } | |
| 330 | 354 | ||
M v4/gdk/gdkcontentdeserializer.go +55 -47
| @@ -31,12 +31,17 @@ func ContentDeserializeAsync(StreamVar *gio.InputStream, MimeTypeVar string, Typ | |||
| 31 | 31 | ||
| 32 | 32 | } | |
| 33 | 33 | ||
| 34 | - | var xContentDeserializeFinish func(uintptr, *gobject.Value) bool | |
| 34 | + | var xContentDeserializeFinish func(uintptr, *gobject.Value, **glib.Error) bool | |
| 35 | 35 | ||
| 36 | 36 | // Finishes a content deserialization operation. | |
| 37 | - | func ContentDeserializeFinish(ResultVar gio.AsyncResult, ValueVar *gobject.Value) bool { | |
| 37 | + | func ContentDeserializeFinish(ResultVar gio.AsyncResult, ValueVar *gobject.Value) (bool, error) { | |
| 38 | + | var cerr *glib.Error | |
| 38 | 39 | ||
| 39 | - | return xContentDeserializeFinish(ResultVar.GoPointer(), ValueVar) | |
| 40 | + | cret := xContentDeserializeFinish(ResultVar.GoPointer(), ValueVar, &cerr) | |
| 41 | + | if cerr == nil { | |
| 42 | + | return cret, nil | |
| 43 | + | } | |
| 44 | + | return cret, cerr | |
| 40 | 45 | ||
| 41 | 46 | } | |
| 42 | 47 | ||
| @@ -76,18 +81,17 @@ var xContentDeserializerGetCancellable func(uintptr) uintptr | |||
| 76 | 81 | // | |
| 77 | 82 | // This is the `GCancellable` that was passed to [func@Gdk.content_deserialize_async]. | |
| 78 | 83 | func (x *ContentDeserializer) GetCancellable() *gio.Cancellable { | |
| 84 | + | var cls *gio.Cancellable | |
| 79 | 85 | ||
| 80 | - | GetCancellablePtr := xContentDeserializerGetCancellable(x.GoPointer()) | |
| 81 | - | if GetCancellablePtr == 0 { | |
| 82 | - | return nil | |
| 83 | - | } | |
| 84 | - | ||
| 85 | - | gobject.IncreaseRef(GetCancellablePtr) | |
| 86 | - | ||
| 87 | - | GetCancellableCls := &gio.Cancellable{} | |
| 88 | - | GetCancellableCls.Ptr = GetCancellablePtr | |
| 89 | - | return GetCancellableCls | |
| 86 | + | cret := xContentDeserializerGetCancellable(x.GoPointer()) | |
| 90 | 87 | ||
| 88 | + | if cret == 0 { | |
| 89 | + | return cls | |
| 90 | + | } | |
| 91 | + | gobject.IncreaseRef(cret) | |
| 92 | + | cls = &gio.Cancellable{} | |
| 93 | + | cls.Ptr = cret | |
| 94 | + | return cls | |
| 91 | 95 | } | |
| 92 | 96 | ||
| 93 | 97 | var xContentDeserializerGetGtype func(uintptr) []interface{} | |
| @@ -95,8 +99,8 @@ var xContentDeserializerGetGtype func(uintptr) []interface{} | |||
| 95 | 99 | // Gets the `GType` to create an instance of. | |
| 96 | 100 | func (x *ContentDeserializer) GetGtype() []interface{} { | |
| 97 | 101 | ||
| 98 | - | return xContentDeserializerGetGtype(x.GoPointer()) | |
| 99 | - | ||
| 102 | + | cret := xContentDeserializerGetGtype(x.GoPointer()) | |
| 103 | + | return cret | |
| 100 | 104 | } | |
| 101 | 105 | ||
| 102 | 106 | var xContentDeserializerGetInputStream func(uintptr) uintptr | |
| @@ -105,18 +109,17 @@ var xContentDeserializerGetInputStream func(uintptr) uintptr | |||
| 105 | 109 | // | |
| 106 | 110 | // This is the stream that was passed to [func@Gdk.content_deserialize_async]. | |
| 107 | 111 | func (x *ContentDeserializer) GetInputStream() *gio.InputStream { | |
| 112 | + | var cls *gio.InputStream | |
| 108 | 113 | ||
| 109 | - | GetInputStreamPtr := xContentDeserializerGetInputStream(x.GoPointer()) | |
| 110 | - | if GetInputStreamPtr == 0 { | |
| 111 | - | return nil | |
| 112 | - | } | |
| 113 | - | ||
| 114 | - | gobject.IncreaseRef(GetInputStreamPtr) | |
| 115 | - | ||
| 116 | - | GetInputStreamCls := &gio.InputStream{} | |
| 117 | - | GetInputStreamCls.Ptr = GetInputStreamPtr | |
| 118 | - | return GetInputStreamCls | |
| 114 | + | cret := xContentDeserializerGetInputStream(x.GoPointer()) | |
| 119 | 115 | ||
| 116 | + | if cret == 0 { | |
| 117 | + | return cls | |
| 118 | + | } | |
| 119 | + | gobject.IncreaseRef(cret) | |
| 120 | + | cls = &gio.InputStream{} | |
| 121 | + | cls.Ptr = cret | |
| 122 | + | return cls | |
| 120 | 123 | } | |
| 121 | 124 | ||
| 122 | 125 | var xContentDeserializerGetMimeType func(uintptr) string | |
| @@ -124,8 +127,8 @@ var xContentDeserializerGetMimeType func(uintptr) string | |||
| 124 | 127 | // Gets the mime type to deserialize from. | |
| 125 | 128 | func (x *ContentDeserializer) GetMimeType() string { | |
| 126 | 129 | ||
| 127 | - | return xContentDeserializerGetMimeType(x.GoPointer()) | |
| 128 | - | ||
| 130 | + | cret := xContentDeserializerGetMimeType(x.GoPointer()) | |
| 131 | + | return cret | |
| 129 | 132 | } | |
| 130 | 133 | ||
| 131 | 134 | var xContentDeserializerGetPriority func(uintptr) int | |
| @@ -135,8 +138,8 @@ var xContentDeserializerGetPriority func(uintptr) int | |||
| 135 | 138 | // This is the priority that was passed to [func@Gdk.content_deserialize_async]. | |
| 136 | 139 | func (x *ContentDeserializer) GetPriority() int { | |
| 137 | 140 | ||
| 138 | - | return xContentDeserializerGetPriority(x.GoPointer()) | |
| 139 | - | ||
| 141 | + | cret := xContentDeserializerGetPriority(x.GoPointer()) | |
| 142 | + | return cret | |
| 140 | 143 | } | |
| 141 | 144 | ||
| 142 | 145 | var xContentDeserializerGetTaskData func(uintptr) uintptr | |
| @@ -146,8 +149,8 @@ var xContentDeserializerGetTaskData func(uintptr) uintptr | |||
| 146 | 149 | // See [method@Gdk.ContentDeserializer.set_task_data]. | |
| 147 | 150 | func (x *ContentDeserializer) GetTaskData() uintptr { | |
| 148 | 151 | ||
| 149 | - | return xContentDeserializerGetTaskData(x.GoPointer()) | |
| 150 | - | ||
| 152 | + | cret := xContentDeserializerGetTaskData(x.GoPointer()) | |
| 153 | + | return cret | |
| 151 | 154 | } | |
| 152 | 155 | ||
| 153 | 156 | var xContentDeserializerGetUserData func(uintptr) uintptr | |
| @@ -155,8 +158,8 @@ var xContentDeserializerGetUserData func(uintptr) uintptr | |||
| 155 | 158 | // Gets the user data that was passed when the deserializer was registered. | |
| 156 | 159 | func (x *ContentDeserializer) GetUserData() uintptr { | |
| 157 | 160 | ||
| 158 | - | return xContentDeserializerGetUserData(x.GoPointer()) | |
| 159 | - | ||
| 161 | + | cret := xContentDeserializerGetUserData(x.GoPointer()) | |
| 162 | + | return cret | |
| 160 | 163 | } | |
| 161 | 164 | ||
| 162 | 165 | var xContentDeserializerGetValue func(uintptr) *gobject.Value | |
| @@ -164,8 +167,8 @@ var xContentDeserializerGetValue func(uintptr) *gobject.Value | |||
| 164 | 167 | // Gets the `GValue` to store the deserialized object in. | |
| 165 | 168 | func (x *ContentDeserializer) GetValue() *gobject.Value { | |
| 166 | 169 | ||
| 167 | - | return xContentDeserializerGetValue(x.GoPointer()) | |
| 168 | - | ||
| 170 | + | cret := xContentDeserializerGetValue(x.GoPointer()) | |
| 171 | + | return cret | |
| 169 | 172 | } | |
| 170 | 173 | ||
| 171 | 174 | var xContentDeserializerReturnError func(uintptr, *glib.Error) | |
| @@ -207,24 +210,24 @@ func (c *ContentDeserializer) SetGoPointer(ptr uintptr) { | |||
| 207 | 210 | ||
| 208 | 211 | // Gets the source object from a #GAsyncResult. | |
| 209 | 212 | func (x *ContentDeserializer) GetSourceObject() *gobject.Object { | |
| 213 | + | var cls *gobject.Object | |
| 210 | 214 | ||
| 211 | - | GetSourceObjectPtr := gio.XGAsyncResultGetSourceObject(x.GoPointer()) | |
| 212 | - | if GetSourceObjectPtr == 0 { | |
| 213 | - | return nil | |
| 214 | - | } | |
| 215 | - | ||
| 216 | - | GetSourceObjectCls := &gobject.Object{} | |
| 217 | - | GetSourceObjectCls.Ptr = GetSourceObjectPtr | |
| 218 | - | return GetSourceObjectCls | |
| 215 | + | cret := gio.XGAsyncResultGetSourceObject(x.GoPointer()) | |
| 219 | 216 | ||
| 217 | + | if cret == 0 { | |
| 218 | + | return cls | |
| 219 | + | } | |
| 220 | + | cls = &gobject.Object{} | |
| 221 | + | cls.Ptr = cret | |
| 222 | + | return cls | |
| 220 | 223 | } | |
| 221 | 224 | ||
| 222 | 225 | // Checks if @res has the given @source_tag (generally a function | |
| 223 | 226 | // pointer indicating the function @res was created by). | |
| 224 | 227 | func (x *ContentDeserializer) IsTagged(SourceTagVar uintptr) bool { | |
| 225 | 228 | ||
| 226 | - | return gio.XGAsyncResultIsTagged(x.GoPointer(), SourceTagVar) | |
| 227 | - | ||
| 229 | + | cret := gio.XGAsyncResultIsTagged(x.GoPointer(), SourceTagVar) | |
| 230 | + | return cret | |
| 228 | 231 | } | |
| 229 | 232 | ||
| 230 | 233 | // If @res is a #GSimpleAsyncResult, this is equivalent to | |
| @@ -237,9 +240,14 @@ func (x *ContentDeserializer) IsTagged(SourceTagVar uintptr) bool { | |||
| 237 | 240 | // This should not be used in new code; #GAsyncResult errors that are | |
| 238 | 241 | // set by virtual methods should also be extracted by virtual methods, | |
| 239 | 242 | // to enable subclasses to chain up correctly. | |
| 240 | - | func (x *ContentDeserializer) LegacyPropagateError() bool { | |
| 243 | + | func (x *ContentDeserializer) LegacyPropagateError() (bool, error) { | |
| 244 | + | var cerr *glib.Error | |
| 241 | 245 | ||
| 242 | - | return gio.XGAsyncResultLegacyPropagateError(x.GoPointer()) | |
| 246 | + | cret := gio.XGAsyncResultLegacyPropagateError(x.GoPointer()) | |
| 247 | + | if cerr == nil { | |
| 248 | + | return cret, nil | |
| 249 | + | } | |
| 250 | + | return cret, cerr | |
| 243 | 251 | ||
| 244 | 252 | } | |
| 245 | 253 | ||
M v4/gdk/gdkcontentformats.go +4 -4
| @@ -27,8 +27,8 @@ var xContentFormatsParse func(string) *ContentFormats | |||
| 27 | 27 | // is returned. | |
| 28 | 28 | func ContentFormatsParse(StringVar string) *ContentFormats { | |
| 29 | 29 | ||
| 30 | - | return xContentFormatsParse(StringVar) | |
| 31 | - | ||
| 30 | + | cret := xContentFormatsParse(StringVar) | |
| 31 | + | return cret | |
| 32 | 32 | } | |
| 33 | 33 | ||
| 34 | 34 | var xInternMimeType func(string) string | |
| @@ -39,8 +39,8 @@ var xInternMimeType func(string) string | |||
| 39 | 39 | // See RFC 2048 for the syntax if mime types. | |
| 40 | 40 | func InternMimeType(StringVar string) string { | |
| 41 | 41 | ||
| 42 | - | return xInternMimeType(StringVar) | |
| 43 | - | ||
| 42 | + | cret := xInternMimeType(StringVar) | |
| 43 | + | return cret | |
| 44 | 44 | } | |
| 45 | 45 | ||
| 46 | 46 | func init() { | |
M v4/gdk/gdkcontentprovider.go +56 -38
| @@ -40,28 +40,32 @@ var xNewForBytesContentProvider func(string, *glib.Bytes) uintptr | |||
| 40 | 40 | // Create a content provider that provides the given @bytes as data for | |
| 41 | 41 | // the given @mime_type. | |
| 42 | 42 | func NewForBytesContentProvider(MimeTypeVar string, BytesVar *glib.Bytes) *ContentProvider { | |
| 43 | - | NewForBytesContentProviderPtr := xNewForBytesContentProvider(MimeTypeVar, BytesVar) | |
| 44 | - | if NewForBytesContentProviderPtr == 0 { | |
| 45 | - | return nil | |
| 46 | - | } | |
| 43 | + | var cls *ContentProvider | |
| 44 | + | ||
| 45 | + | cret := xNewForBytesContentProvider(MimeTypeVar, BytesVar) | |
| 47 | 46 | ||
| 48 | - | NewForBytesContentProviderCls := &ContentProvider{} | |
| 49 | - | NewForBytesContentProviderCls.Ptr = NewForBytesContentProviderPtr | |
| 50 | - | return NewForBytesContentProviderCls | |
| 47 | + | if cret == 0 { | |
| 48 | + | return cls | |
| 49 | + | } | |
| 50 | + | cls = &ContentProvider{} | |
| 51 | + | cls.Ptr = cret | |
| 52 | + | return cls | |
| 51 | 53 | } | |
| 52 | 54 | ||
| 53 | 55 | var xNewForValueContentProvider func(*gobject.Value) uintptr | |
| 54 | 56 | ||
| 55 | 57 | // Create a content provider that provides the given @value. | |
| 56 | 58 | func NewForValueContentProvider(ValueVar *gobject.Value) *ContentProvider { | |
| 57 | - | NewForValueContentProviderPtr := xNewForValueContentProvider(ValueVar) | |
| 58 | - | if NewForValueContentProviderPtr == 0 { | |
| 59 | - | return nil | |
| 60 | - | } | |
| 59 | + | var cls *ContentProvider | |
| 61 | 60 | ||
| 62 | - | NewForValueContentProviderCls := &ContentProvider{} | |
| 63 | - | NewForValueContentProviderCls.Ptr = NewForValueContentProviderPtr | |
| 64 | - | return NewForValueContentProviderCls | |
| 61 | + | cret := xNewForValueContentProvider(ValueVar) | |
| 62 | + | ||
| 63 | + | if cret == 0 { | |
| 64 | + | return cls | |
| 65 | + | } | |
| 66 | + | cls = &ContentProvider{} | |
| 67 | + | cls.Ptr = cret | |
| 68 | + | return cls | |
| 65 | 69 | } | |
| 66 | 70 | ||
| 67 | 71 | var xNewTypedContentProvider func([]interface{}, ...interface{}) uintptr | |
| @@ -72,14 +76,16 @@ var xNewTypedContentProvider func([]interface{}, ...interface{}) uintptr | |||
| 72 | 76 | // The value is provided using G_VALUE_COLLECT(), so the same rules | |
| 73 | 77 | // apply as when calling g_object_new() or g_object_set(). | |
| 74 | 78 | func NewTypedContentProvider(TypeVar []interface{}, varArgs ...interface{}) *ContentProvider { | |
| 75 | - | NewTypedContentProviderPtr := xNewTypedContentProvider(TypeVar, varArgs...) | |
| 76 | - | if NewTypedContentProviderPtr == 0 { | |
| 77 | - | return nil | |
| 78 | - | } | |
| 79 | + | var cls *ContentProvider | |
| 80 | + | ||
| 81 | + | cret := xNewTypedContentProvider(TypeVar, varArgs...) | |
| 79 | 82 | ||
| 80 | - | NewTypedContentProviderCls := &ContentProvider{} | |
| 81 | - | NewTypedContentProviderCls.Ptr = NewTypedContentProviderPtr | |
| 82 | - | return NewTypedContentProviderCls | |
| 83 | + | if cret == 0 { | |
| 84 | + | return cls | |
| 85 | + | } | |
| 86 | + | cls = &ContentProvider{} | |
| 87 | + | cls.Ptr = cret | |
| 88 | + | return cls | |
| 83 | 89 | } | |
| 84 | 90 | ||
| 85 | 91 | var xNewUnionContentProvider func(uintptr, uint) uintptr | |
| @@ -102,14 +108,16 @@ var xNewUnionContentProvider func(uintptr, uint) uintptr | |||
| 102 | 108 | // | |
| 103 | 109 | // ``` | |
| 104 | 110 | func NewUnionContentProvider(ProvidersVar uintptr, NProvidersVar uint) *ContentProvider { | |
| 105 | - | NewUnionContentProviderPtr := xNewUnionContentProvider(ProvidersVar, NProvidersVar) | |
| 106 | - | if NewUnionContentProviderPtr == 0 { | |
| 107 | - | return nil | |
| 108 | - | } | |
| 111 | + | var cls *ContentProvider | |
| 109 | 112 | ||
| 110 | - | NewUnionContentProviderCls := &ContentProvider{} | |
| 111 | - | NewUnionContentProviderCls.Ptr = NewUnionContentProviderPtr | |
| 112 | - | return NewUnionContentProviderCls | |
| 113 | + | cret := xNewUnionContentProvider(ProvidersVar, NProvidersVar) | |
| 114 | + | ||
| 115 | + | if cret == 0 { | |
| 116 | + | return cls | |
| 117 | + | } | |
| 118 | + | cls = &ContentProvider{} | |
| 119 | + | cls.Ptr = cret | |
| 120 | + | return cls | |
| 113 | 121 | } | |
| 114 | 122 | ||
| 115 | 123 | var xContentProviderContentChanged func(uintptr) | |
| @@ -121,7 +129,7 @@ func (x *ContentProvider) ContentChanged() { | |||
| 121 | 129 | ||
| 122 | 130 | } | |
| 123 | 131 | ||
| 124 | - | var xContentProviderGetValue func(uintptr, *gobject.Value) bool | |
| 132 | + | var xContentProviderGetValue func(uintptr, *gobject.Value, **glib.Error) bool | |
| 125 | 133 | ||
| 126 | 134 | // Gets the contents of @provider stored in @value. | |
| 127 | 135 | // | |
| @@ -130,9 +138,14 @@ var xContentProviderGetValue func(uintptr, *gobject.Value) bool | |||
| 130 | 138 | // returned by [method@Gdk.ContentProvider.ref_formats]. However, if the | |
| 131 | 139 | // given `GType` is not supported, this operation can fail and | |
| 132 | 140 | // `G_IO_ERROR_NOT_SUPPORTED` will be reported. | |
| 133 | - | func (x *ContentProvider) GetValue(ValueVar *gobject.Value) bool { | |
| 141 | + | func (x *ContentProvider) GetValue(ValueVar *gobject.Value) (bool, error) { | |
| 142 | + | var cerr *glib.Error | |
| 134 | 143 | ||
| 135 | - | return xContentProviderGetValue(x.GoPointer(), ValueVar) | |
| 144 | + | cret := xContentProviderGetValue(x.GoPointer(), ValueVar, &cerr) | |
| 145 | + | if cerr == nil { | |
| 146 | + | return cret, nil | |
| 147 | + | } | |
| 148 | + | return cret, cerr | |
| 136 | 149 | ||
| 137 | 150 | } | |
| 138 | 151 | ||
| @@ -141,8 +154,8 @@ var xContentProviderRefFormats func(uintptr) *ContentFormats | |||
| 141 | 154 | // Gets the formats that the provider can provide its current contents in. | |
| 142 | 155 | func (x *ContentProvider) RefFormats() *ContentFormats { | |
| 143 | 156 | ||
| 144 | - | return xContentProviderRefFormats(x.GoPointer()) | |
| 145 | - | ||
| 157 | + | cret := xContentProviderRefFormats(x.GoPointer()) | |
| 158 | + | return cret | |
| 146 | 159 | } | |
| 147 | 160 | ||
| 148 | 161 | var xContentProviderRefStorableFormats func(uintptr) *ContentFormats | |
| @@ -155,8 +168,8 @@ var xContentProviderRefStorableFormats func(uintptr) *ContentFormats | |||
| 155 | 168 | // This can be assumed to be a subset of [method@Gdk.ContentProvider.ref_formats]. | |
| 156 | 169 | func (x *ContentProvider) RefStorableFormats() *ContentFormats { | |
| 157 | 170 | ||
| 158 | - | return xContentProviderRefStorableFormats(x.GoPointer()) | |
| 159 | - | ||
| 171 | + | cret := xContentProviderRefStorableFormats(x.GoPointer()) | |
| 172 | + | return cret | |
| 160 | 173 | } | |
| 161 | 174 | ||
| 162 | 175 | var xContentProviderWriteMimeTypeAsync func(uintptr, string, uintptr, int, uintptr, uintptr, uintptr) | |
| @@ -179,14 +192,19 @@ func (x *ContentProvider) WriteMimeTypeAsync(MimeTypeVar string, StreamVar *gio. | |||
| 179 | 192 | ||
| 180 | 193 | } | |
| 181 | 194 | ||
| 182 | - | var xContentProviderWriteMimeTypeFinish func(uintptr, uintptr) bool | |
| 195 | + | var xContentProviderWriteMimeTypeFinish func(uintptr, uintptr, **glib.Error) bool | |
| 183 | 196 | ||
| 184 | 197 | // Finishes an asynchronous write operation. | |
| 185 | 198 | // | |
| 186 | 199 | // See [method@Gdk.ContentProvider.write_mime_type_async]. | |
| 187 | - | func (x *ContentProvider) WriteMimeTypeFinish(ResultVar gio.AsyncResult) bool { | |
| 200 | + | func (x *ContentProvider) WriteMimeTypeFinish(ResultVar gio.AsyncResult) (bool, error) { | |
| 201 | + | var cerr *glib.Error | |
| 188 | 202 | ||
| 189 | - | return xContentProviderWriteMimeTypeFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 203 | + | cret := xContentProviderWriteMimeTypeFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 204 | + | if cerr == nil { | |
| 205 | + | return cret, nil | |
| 206 | + | } | |
| 207 | + | return cret, cerr | |
| 190 | 208 | ||
| 191 | 209 | } | |
| 192 | 210 | ||
M v4/gdk/gdkcontentserializer.go +55 -47
| @@ -40,12 +40,17 @@ func ContentSerializeAsync(StreamVar *gio.OutputStream, MimeTypeVar string, Valu | |||
| 40 | 40 | ||
| 41 | 41 | } | |
| 42 | 42 | ||
| 43 | - | var xContentSerializeFinish func(uintptr) bool | |
| 43 | + | var xContentSerializeFinish func(uintptr, **glib.Error) bool | |
| 44 | 44 | ||
| 45 | 45 | // Finishes a content serialization operation. | |
| 46 | - | func ContentSerializeFinish(ResultVar gio.AsyncResult) bool { | |
| 46 | + | func ContentSerializeFinish(ResultVar gio.AsyncResult) (bool, error) { | |
| 47 | + | var cerr *glib.Error | |
| 47 | 48 | ||
| 48 | - | return xContentSerializeFinish(ResultVar.GoPointer()) | |
| 49 | + | cret := xContentSerializeFinish(ResultVar.GoPointer(), &cerr) | |
| 50 | + | if cerr == nil { | |
| 51 | + | return cret, nil | |
| 52 | + | } | |
| 53 | + | return cret, cerr | |
| 49 | 54 | ||
| 50 | 55 | } | |
| 51 | 56 | ||
| @@ -77,18 +82,17 @@ var xContentSerializerGetCancellable func(uintptr) uintptr | |||
| 77 | 82 | // | |
| 78 | 83 | // This is the `GCancellable` that was passed to [func@content_serialize_async]. | |
| 79 | 84 | func (x *ContentSerializer) GetCancellable() *gio.Cancellable { | |
| 85 | + | var cls *gio.Cancellable | |
| 80 | 86 | ||
| 81 | - | GetCancellablePtr := xContentSerializerGetCancellable(x.GoPointer()) | |
| 82 | - | if GetCancellablePtr == 0 { | |
| 83 | - | return nil | |
| 84 | - | } | |
| 85 | - | ||
| 86 | - | gobject.IncreaseRef(GetCancellablePtr) | |
| 87 | - | ||
| 88 | - | GetCancellableCls := &gio.Cancellable{} | |
| 89 | - | GetCancellableCls.Ptr = GetCancellablePtr | |
| 90 | - | return GetCancellableCls | |
| 87 | + | cret := xContentSerializerGetCancellable(x.GoPointer()) | |
| 91 | 88 | ||
| 89 | + | if cret == 0 { | |
| 90 | + | return cls | |
| 91 | + | } | |
| 92 | + | gobject.IncreaseRef(cret) | |
| 93 | + | cls = &gio.Cancellable{} | |
| 94 | + | cls.Ptr = cret | |
| 95 | + | return cls | |
| 92 | 96 | } | |
| 93 | 97 | ||
| 94 | 98 | var xContentSerializerGetGtype func(uintptr) []interface{} | |
| @@ -96,8 +100,8 @@ var xContentSerializerGetGtype func(uintptr) []interface{} | |||
| 96 | 100 | // Gets the `GType` to of the object to serialize. | |
| 97 | 101 | func (x *ContentSerializer) GetGtype() []interface{} { | |
| 98 | 102 | ||
| 99 | - | return xContentSerializerGetGtype(x.GoPointer()) | |
| 100 | - | ||
| 103 | + | cret := xContentSerializerGetGtype(x.GoPointer()) | |
| 104 | + | return cret | |
| 101 | 105 | } | |
| 102 | 106 | ||
| 103 | 107 | var xContentSerializerGetMimeType func(uintptr) string | |
| @@ -105,8 +109,8 @@ var xContentSerializerGetMimeType func(uintptr) string | |||
| 105 | 109 | // Gets the mime type to serialize to. | |
| 106 | 110 | func (x *ContentSerializer) GetMimeType() string { | |
| 107 | 111 | ||
| 108 | - | return xContentSerializerGetMimeType(x.GoPointer()) | |
| 109 | - | ||
| 112 | + | cret := xContentSerializerGetMimeType(x.GoPointer()) | |
| 113 | + | return cret | |
| 110 | 114 | } | |
| 111 | 115 | ||
| 112 | 116 | var xContentSerializerGetOutputStream func(uintptr) uintptr | |
| @@ -115,18 +119,17 @@ var xContentSerializerGetOutputStream func(uintptr) uintptr | |||
| 115 | 119 | // | |
| 116 | 120 | // This is the stream that was passed to [func@content_serialize_async]. | |
| 117 | 121 | func (x *ContentSerializer) GetOutputStream() *gio.OutputStream { | |
| 122 | + | var cls *gio.OutputStream | |
| 118 | 123 | ||
| 119 | - | GetOutputStreamPtr := xContentSerializerGetOutputStream(x.GoPointer()) | |
| 120 | - | if GetOutputStreamPtr == 0 { | |
| 121 | - | return nil | |
| 122 | - | } | |
| 123 | - | ||
| 124 | - | gobject.IncreaseRef(GetOutputStreamPtr) | |
| 125 | - | ||
| 126 | - | GetOutputStreamCls := &gio.OutputStream{} | |
| 127 | - | GetOutputStreamCls.Ptr = GetOutputStreamPtr | |
| 128 | - | return GetOutputStreamCls | |
| 124 | + | cret := xContentSerializerGetOutputStream(x.GoPointer()) | |
| 129 | 125 | ||
| 126 | + | if cret == 0 { | |
| 127 | + | return cls | |
| 128 | + | } | |
| 129 | + | gobject.IncreaseRef(cret) | |
| 130 | + | cls = &gio.OutputStream{} | |
| 131 | + | cls.Ptr = cret | |
| 132 | + | return cls | |
| 130 | 133 | } | |
| 131 | 134 | ||
| 132 | 135 | var xContentSerializerGetPriority func(uintptr) int | |
| @@ -136,8 +139,8 @@ var xContentSerializerGetPriority func(uintptr) int | |||
| 136 | 139 | // This is the priority that was passed to [func@content_serialize_async]. | |
| 137 | 140 | func (x *ContentSerializer) GetPriority() int { | |
| 138 | 141 | ||
| 139 | - | return xContentSerializerGetPriority(x.GoPointer()) | |
| 140 | - | ||
| 142 | + | cret := xContentSerializerGetPriority(x.GoPointer()) | |
| 143 | + | return cret | |
| 141 | 144 | } | |
| 142 | 145 | ||
| 143 | 146 | var xContentSerializerGetTaskData func(uintptr) uintptr | |
| @@ -147,8 +150,8 @@ var xContentSerializerGetTaskData func(uintptr) uintptr | |||
| 147 | 150 | // See [method@Gdk.ContentSerializer.set_task_data]. | |
| 148 | 151 | func (x *ContentSerializer) GetTaskData() uintptr { | |
| 149 | 152 | ||
| 150 | - | return xContentSerializerGetTaskData(x.GoPointer()) | |
| 151 | - | ||
| 153 | + | cret := xContentSerializerGetTaskData(x.GoPointer()) | |
| 154 | + | return cret | |
| 152 | 155 | } | |
| 153 | 156 | ||
| 154 | 157 | var xContentSerializerGetUserData func(uintptr) uintptr | |
| @@ -156,8 +159,8 @@ var xContentSerializerGetUserData func(uintptr) uintptr | |||
| 156 | 159 | // Gets the user data that was passed when the serializer was registered. | |
| 157 | 160 | func (x *ContentSerializer) GetUserData() uintptr { | |
| 158 | 161 | ||
| 159 | - | return xContentSerializerGetUserData(x.GoPointer()) | |
| 160 | - | ||
| 162 | + | cret := xContentSerializerGetUserData(x.GoPointer()) | |
| 163 | + | return cret | |
| 161 | 164 | } | |
| 162 | 165 | ||
| 163 | 166 | var xContentSerializerGetValue func(uintptr) *gobject.Value | |
| @@ -165,8 +168,8 @@ var xContentSerializerGetValue func(uintptr) *gobject.Value | |||
| 165 | 168 | // Gets the `GValue` to read the object to serialize from. | |
| 166 | 169 | func (x *ContentSerializer) GetValue() *gobject.Value { | |
| 167 | 170 | ||
| 168 | - | return xContentSerializerGetValue(x.GoPointer()) | |
| 169 | - | ||
| 171 | + | cret := xContentSerializerGetValue(x.GoPointer()) | |
| 172 | + | return cret | |
| 170 | 173 | } | |
| 171 | 174 | ||
| 172 | 175 | var xContentSerializerReturnError func(uintptr, *glib.Error) | |
| @@ -208,24 +211,24 @@ func (c *ContentSerializer) SetGoPointer(ptr uintptr) { | |||
| 208 | 211 | ||
| 209 | 212 | // Gets the source object from a #GAsyncResult. | |
| 210 | 213 | func (x *ContentSerializer) GetSourceObject() *gobject.Object { | |
| 214 | + | var cls *gobject.Object | |
| 211 | 215 | ||
| 212 | - | GetSourceObjectPtr := gio.XGAsyncResultGetSourceObject(x.GoPointer()) | |
| 213 | - | if GetSourceObjectPtr == 0 { | |
| 214 | - | return nil | |
| 215 | - | } | |
| 216 | - | ||
| 217 | - | GetSourceObjectCls := &gobject.Object{} | |
| 218 | - | GetSourceObjectCls.Ptr = GetSourceObjectPtr | |
| 219 | - | return GetSourceObjectCls | |
| 216 | + | cret := gio.XGAsyncResultGetSourceObject(x.GoPointer()) | |
| 220 | 217 | ||
| 218 | + | if cret == 0 { | |
| 219 | + | return cls | |
| 220 | + | } | |
| 221 | + | cls = &gobject.Object{} | |
| 222 | + | cls.Ptr = cret | |
| 223 | + | return cls | |
| 221 | 224 | } | |
| 222 | 225 | ||
| 223 | 226 | // Checks if @res has the given @source_tag (generally a function | |
| 224 | 227 | // pointer indicating the function @res was created by). | |
| 225 | 228 | func (x *ContentSerializer) IsTagged(SourceTagVar uintptr) bool { | |
| 226 | 229 | ||
| 227 | - | return gio.XGAsyncResultIsTagged(x.GoPointer(), SourceTagVar) | |
| 228 | - | ||
| 230 | + | cret := gio.XGAsyncResultIsTagged(x.GoPointer(), SourceTagVar) | |
| 231 | + | return cret | |
| 229 | 232 | } | |
| 230 | 233 | ||
| 231 | 234 | // If @res is a #GSimpleAsyncResult, this is equivalent to | |
| @@ -238,9 +241,14 @@ func (x *ContentSerializer) IsTagged(SourceTagVar uintptr) bool { | |||
| 238 | 241 | // This should not be used in new code; #GAsyncResult errors that are | |
| 239 | 242 | // set by virtual methods should also be extracted by virtual methods, | |
| 240 | 243 | // to enable subclasses to chain up correctly. | |
| 241 | - | func (x *ContentSerializer) LegacyPropagateError() bool { | |
| 244 | + | func (x *ContentSerializer) LegacyPropagateError() (bool, error) { | |
| 245 | + | var cerr *glib.Error | |
| 242 | 246 | ||
| 243 | - | return gio.XGAsyncResultLegacyPropagateError(x.GoPointer()) | |
| 247 | + | cret := gio.XGAsyncResultLegacyPropagateError(x.GoPointer()) | |
| 248 | + | if cerr == nil { | |
| 249 | + | return cret, nil | |
| 250 | + | } | |
| 251 | + | return cret, cerr | |
| 244 | 252 | ||
| 245 | 253 | } | |
| 246 | 254 | ||
M v4/gdk/gdkcursor.go +42 -40
| @@ -70,28 +70,32 @@ var xNewFromNameCursor func(string, uintptr) uintptr | |||
| 70 | 70 | // |  "se-resize" |  "ew-resize" |  "ns-resize" |  "nesw-resize" | | |
| 71 | 71 | // |  "nwse-resize" |  "zoom-in" |  "zoom-out" | | | |
| 72 | 72 | func NewFromNameCursor(NameVar string, FallbackVar *Cursor) *Cursor { | |
| 73 | - | NewFromNameCursorPtr := xNewFromNameCursor(NameVar, FallbackVar.GoPointer()) | |
| 74 | - | if NewFromNameCursorPtr == 0 { | |
| 75 | - | return nil | |
| 76 | - | } | |
| 73 | + | var cls *Cursor | |
| 74 | + | ||
| 75 | + | cret := xNewFromNameCursor(NameVar, FallbackVar.GoPointer()) | |
| 77 | 76 | ||
| 78 | - | NewFromNameCursorCls := &Cursor{} | |
| 79 | - | NewFromNameCursorCls.Ptr = NewFromNameCursorPtr | |
| 80 | - | return NewFromNameCursorCls | |
| 77 | + | if cret == 0 { | |
| 78 | + | return cls | |
| 79 | + | } | |
| 80 | + | cls = &Cursor{} | |
| 81 | + | cls.Ptr = cret | |
| 82 | + | return cls | |
| 81 | 83 | } | |
| 82 | 84 | ||
| 83 | 85 | var xNewFromTextureCursor func(uintptr, int, int, uintptr) uintptr | |
| 84 | 86 | ||
| 85 | 87 | // Creates a new cursor from a `GdkTexture`. | |
| 86 | 88 | func NewFromTextureCursor(TextureVar *Texture, HotspotXVar int, HotspotYVar int, FallbackVar *Cursor) *Cursor { | |
| 87 | - | NewFromTextureCursorPtr := xNewFromTextureCursor(TextureVar.GoPointer(), HotspotXVar, HotspotYVar, FallbackVar.GoPointer()) | |
| 88 | - | if NewFromTextureCursorPtr == 0 { | |
| 89 | - | return nil | |
| 90 | - | } | |
| 89 | + | var cls *Cursor | |
| 90 | + | ||
| 91 | + | cret := xNewFromTextureCursor(TextureVar.GoPointer(), HotspotXVar, HotspotYVar, FallbackVar.GoPointer()) | |
| 91 | 92 | ||
| 92 | - | NewFromTextureCursorCls := &Cursor{} | |
| 93 | - | NewFromTextureCursorCls.Ptr = NewFromTextureCursorPtr | |
| 94 | - | return NewFromTextureCursorCls | |
| 93 | + | if cret == 0 { | |
| 94 | + | return cls | |
| 95 | + | } | |
| 96 | + | cls = &Cursor{} | |
| 97 | + | cls.Ptr = cret | |
| 98 | + | return cls | |
| 95 | 99 | } | |
| 96 | 100 | ||
| 97 | 101 | var xCursorGetFallback func(uintptr) uintptr | |
| @@ -104,18 +108,17 @@ var xCursorGetFallback func(uintptr) uintptr | |||
| 104 | 108 | // this can happen when the texture is too large or when the `GdkDisplay` | |
| 105 | 109 | // it is used on does not support textured cursors. | |
| 106 | 110 | func (x *Cursor) GetFallback() *Cursor { | |
| 111 | + | var cls *Cursor | |
| 107 | 112 | ||
| 108 | - | GetFallbackPtr := xCursorGetFallback(x.GoPointer()) | |
| 109 | - | if GetFallbackPtr == 0 { | |
| 110 | - | return nil | |
| 111 | - | } | |
| 112 | - | ||
| 113 | - | gobject.IncreaseRef(GetFallbackPtr) | |
| 114 | - | ||
| 115 | - | GetFallbackCls := &Cursor{} | |
| 116 | - | GetFallbackCls.Ptr = GetFallbackPtr | |
| 117 | - | return GetFallbackCls | |
| 113 | + | cret := xCursorGetFallback(x.GoPointer()) | |
| 118 | 114 | ||
| 115 | + | if cret == 0 { | |
| 116 | + | return cls | |
| 117 | + | } | |
| 118 | + | gobject.IncreaseRef(cret) | |
| 119 | + | cls = &Cursor{} | |
| 120 | + | cls.Ptr = cret | |
| 121 | + | return cls | |
| 119 | 122 | } | |
| 120 | 123 | ||
| 121 | 124 | var xCursorGetHotspotX func(uintptr) int | |
| @@ -129,8 +132,8 @@ var xCursorGetHotspotX func(uintptr) int | |||
| 129 | 132 | // [ctor@Gdk.Cursor.new_from_texture]. | |
| 130 | 133 | func (x *Cursor) GetHotspotX() int { | |
| 131 | 134 | ||
| 132 | - | return xCursorGetHotspotX(x.GoPointer()) | |
| 133 | - | ||
| 135 | + | cret := xCursorGetHotspotX(x.GoPointer()) | |
| 136 | + | return cret | |
| 134 | 137 | } | |
| 135 | 138 | ||
| 136 | 139 | var xCursorGetHotspotY func(uintptr) int | |
| @@ -144,8 +147,8 @@ var xCursorGetHotspotY func(uintptr) int | |||
| 144 | 147 | // [ctor@Gdk.Cursor.new_from_texture]. | |
| 145 | 148 | func (x *Cursor) GetHotspotY() int { | |
| 146 | 149 | ||
| 147 | - | return xCursorGetHotspotY(x.GoPointer()) | |
| 148 | - | ||
| 150 | + | cret := xCursorGetHotspotY(x.GoPointer()) | |
| 151 | + | return cret | |
| 149 | 152 | } | |
| 150 | 153 | ||
| 151 | 154 | var xCursorGetName func(uintptr) string | |
| @@ -155,8 +158,8 @@ var xCursorGetName func(uintptr) string | |||
| 155 | 158 | // If the cursor is not a named cursor, %NULL will be returned. | |
| 156 | 159 | func (x *Cursor) GetName() string { | |
| 157 | 160 | ||
| 158 | - | return xCursorGetName(x.GoPointer()) | |
| 159 | - | ||
| 161 | + | cret := xCursorGetName(x.GoPointer()) | |
| 162 | + | return cret | |
| 160 | 163 | } | |
| 161 | 164 | ||
| 162 | 165 | var xCursorGetTexture func(uintptr) uintptr | |
| @@ -165,18 +168,17 @@ var xCursorGetTexture func(uintptr) uintptr | |||
| 165 | 168 | // | |
| 166 | 169 | // If the cursor is a named cursor, %NULL will be returned. | |
| 167 | 170 | func (x *Cursor) GetTexture() *Texture { | |
| 171 | + | var cls *Texture | |
| 168 | 172 | ||
| 169 | - | GetTexturePtr := xCursorGetTexture(x.GoPointer()) | |
| 170 | - | if GetTexturePtr == 0 { | |
| 171 | - | return nil | |
| 172 | - | } | |
| 173 | - | ||
| 174 | - | gobject.IncreaseRef(GetTexturePtr) | |
| 175 | - | ||
| 176 | - | GetTextureCls := &Texture{} | |
| 177 | - | GetTextureCls.Ptr = GetTexturePtr | |
| 178 | - | return GetTextureCls | |
| 173 | + | cret := xCursorGetTexture(x.GoPointer()) | |
| 179 | 174 | ||
| 175 | + | if cret == 0 { | |
| 176 | + | return cls | |
| 177 | + | } | |
| 178 | + | gobject.IncreaseRef(cret) | |
| 179 | + | cls = &Texture{} | |
| 180 | + | cls.Ptr = cret | |
| 181 | + | return cls | |
| 180 | 182 | } | |
| 181 | 183 | ||
| 182 | 184 | func (c *Cursor) GoPointer() uintptr { | |
M v4/gdk/gdkdevice.go +62 -66
| @@ -69,26 +69,25 @@ var xDeviceGetCapsLockState func(uintptr) bool | |||
| 69 | 69 | // This is only relevant for keyboard devices. | |
| 70 | 70 | func (x *Device) GetCapsLockState() bool { | |
| 71 | 71 | ||
| 72 | - | return xDeviceGetCapsLockState(x.GoPointer()) | |
| 73 | - | ||
| 72 | + | cret := xDeviceGetCapsLockState(x.GoPointer()) | |
| 73 | + | return cret | |
| 74 | 74 | } | |
| 75 | 75 | ||
| 76 | 76 | var xDeviceGetDeviceTool func(uintptr) uintptr | |
| 77 | 77 | ||
| 78 | 78 | // Retrieves the current tool for @device. | |
| 79 | 79 | func (x *Device) GetDeviceTool() *DeviceTool { | |
| 80 | + | var cls *DeviceTool | |
| 80 | 81 | ||
| 81 | - | GetDeviceToolPtr := xDeviceGetDeviceTool(x.GoPointer()) | |
| 82 | - | if GetDeviceToolPtr == 0 { | |
| 83 | - | return nil | |
| 84 | - | } | |
| 85 | - | ||
| 86 | - | gobject.IncreaseRef(GetDeviceToolPtr) | |
| 87 | - | ||
| 88 | - | GetDeviceToolCls := &DeviceTool{} | |
| 89 | - | GetDeviceToolCls.Ptr = GetDeviceToolPtr | |
| 90 | - | return GetDeviceToolCls | |
| 82 | + | cret := xDeviceGetDeviceTool(x.GoPointer()) | |
| 91 | 83 | ||
| 84 | + | if cret == 0 { | |
| 85 | + | return cls | |
| 86 | + | } | |
| 87 | + | gobject.IncreaseRef(cret) | |
| 88 | + | cls = &DeviceTool{} | |
| 89 | + | cls.Ptr = cret | |
| 90 | + | return cls | |
| 92 | 91 | } | |
| 93 | 92 | ||
| 94 | 93 | var xDeviceGetDirection func(uintptr) pango.Direction | |
| @@ -101,26 +100,25 @@ var xDeviceGetDirection func(uintptr) pango.Direction | |||
| 101 | 100 | // of its symbols. See [func@Pango.unichar_direction]. | |
| 102 | 101 | func (x *Device) GetDirection() pango.Direction { | |
| 103 | 102 | ||
| 104 | - | return xDeviceGetDirection(x.GoPointer()) | |
| 105 | - | ||
| 103 | + | cret := xDeviceGetDirection(x.GoPointer()) | |
| 104 | + | return cret | |
| 106 | 105 | } | |
| 107 | 106 | ||
| 108 | 107 | var xDeviceGetDisplay func(uintptr) uintptr | |
| 109 | 108 | ||
| 110 | 109 | // Returns the `GdkDisplay` to which @device pertains. | |
| 111 | 110 | func (x *Device) GetDisplay() *Display { | |
| 111 | + | var cls *Display | |
| 112 | 112 | ||
| 113 | - | GetDisplayPtr := xDeviceGetDisplay(x.GoPointer()) | |
| 114 | - | if GetDisplayPtr == 0 { | |
| 115 | - | return nil | |
| 116 | - | } | |
| 117 | - | ||
| 118 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 119 | - | ||
| 120 | - | GetDisplayCls := &Display{} | |
| 121 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 122 | - | return GetDisplayCls | |
| 113 | + | cret := xDeviceGetDisplay(x.GoPointer()) | |
| 123 | 114 | ||
| 115 | + | if cret == 0 { | |
| 116 | + | return cls | |
| 117 | + | } | |
| 118 | + | gobject.IncreaseRef(cret) | |
| 119 | + | cls = &Display{} | |
| 120 | + | cls.Ptr = cret | |
| 121 | + | return cls | |
| 124 | 122 | } | |
| 125 | 123 | ||
| 126 | 124 | var xDeviceGetHasCursor func(uintptr) bool | |
| @@ -131,8 +129,8 @@ var xDeviceGetHasCursor func(uintptr) bool | |||
| 131 | 129 | // don't have a pointer. | |
| 132 | 130 | func (x *Device) GetHasCursor() bool { | |
| 133 | 131 | ||
| 134 | - | return xDeviceGetHasCursor(x.GoPointer()) | |
| 135 | - | ||
| 132 | + | cret := xDeviceGetHasCursor(x.GoPointer()) | |
| 133 | + | return cret | |
| 136 | 134 | } | |
| 137 | 135 | ||
| 138 | 136 | var xDeviceGetModifierState func(uintptr) ModifierType | |
| @@ -142,8 +140,8 @@ var xDeviceGetModifierState func(uintptr) ModifierType | |||
| 142 | 140 | // This is only relevant for keyboard devices. | |
| 143 | 141 | func (x *Device) GetModifierState() ModifierType { | |
| 144 | 142 | ||
| 145 | - | return xDeviceGetModifierState(x.GoPointer()) | |
| 146 | - | ||
| 143 | + | cret := xDeviceGetModifierState(x.GoPointer()) | |
| 144 | + | return cret | |
| 147 | 145 | } | |
| 148 | 146 | ||
| 149 | 147 | var xDeviceGetName func(uintptr) string | |
| @@ -151,8 +149,8 @@ var xDeviceGetName func(uintptr) string | |||
| 151 | 149 | // The name of the device, suitable for showing in a user interface. | |
| 152 | 150 | func (x *Device) GetName() string { | |
| 153 | 151 | ||
| 154 | - | return xDeviceGetName(x.GoPointer()) | |
| 155 | - | ||
| 152 | + | cret := xDeviceGetName(x.GoPointer()) | |
| 153 | + | return cret | |
| 156 | 154 | } | |
| 157 | 155 | ||
| 158 | 156 | var xDeviceGetNumLockState func(uintptr) bool | |
| @@ -162,8 +160,8 @@ var xDeviceGetNumLockState func(uintptr) bool | |||
| 162 | 160 | // This is only relevant for keyboard devices. | |
| 163 | 161 | func (x *Device) GetNumLockState() bool { | |
| 164 | 162 | ||
| 165 | - | return xDeviceGetNumLockState(x.GoPointer()) | |
| 166 | - | ||
| 163 | + | cret := xDeviceGetNumLockState(x.GoPointer()) | |
| 164 | + | return cret | |
| 167 | 165 | } | |
| 168 | 166 | ||
| 169 | 167 | var xDeviceGetNumTouches func(uintptr) uint | |
| @@ -171,8 +169,8 @@ var xDeviceGetNumTouches func(uintptr) uint | |||
| 171 | 169 | // Retrieves the number of touch points associated to @device. | |
| 172 | 170 | func (x *Device) GetNumTouches() uint { | |
| 173 | 171 | ||
| 174 | - | return xDeviceGetNumTouches(x.GoPointer()) | |
| 175 | - | ||
| 172 | + | cret := xDeviceGetNumTouches(x.GoPointer()) | |
| 173 | + | return cret | |
| 176 | 174 | } | |
| 177 | 175 | ||
| 178 | 176 | var xDeviceGetProductId func(uintptr) string | |
| @@ -183,8 +181,8 @@ var xDeviceGetProductId func(uintptr) string | |||
| 183 | 181 | // See [method@Gdk.Device.get_vendor_id] for more information. | |
| 184 | 182 | func (x *Device) GetProductId() string { | |
| 185 | 183 | ||
| 186 | - | return xDeviceGetProductId(x.GoPointer()) | |
| 187 | - | ||
| 184 | + | cret := xDeviceGetProductId(x.GoPointer()) | |
| 185 | + | return cret | |
| 188 | 186 | } | |
| 189 | 187 | ||
| 190 | 188 | var xDeviceGetScrollLockState func(uintptr) bool | |
| @@ -194,26 +192,25 @@ var xDeviceGetScrollLockState func(uintptr) bool | |||
| 194 | 192 | // This is only relevant for keyboard devices. | |
| 195 | 193 | func (x *Device) GetScrollLockState() bool { | |
| 196 | 194 | ||
| 197 | - | return xDeviceGetScrollLockState(x.GoPointer()) | |
| 198 | - | ||
| 195 | + | cret := xDeviceGetScrollLockState(x.GoPointer()) | |
| 196 | + | return cret | |
| 199 | 197 | } | |
| 200 | 198 | ||
| 201 | 199 | var xDeviceGetSeat func(uintptr) uintptr | |
| 202 | 200 | ||
| 203 | 201 | // Returns the `GdkSeat` the device belongs to. | |
| 204 | 202 | func (x *Device) GetSeat() *Seat { | |
| 203 | + | var cls *Seat | |
| 205 | 204 | ||
| 206 | - | GetSeatPtr := xDeviceGetSeat(x.GoPointer()) | |
| 207 | - | if GetSeatPtr == 0 { | |
| 208 | - | return nil | |
| 209 | - | } | |
| 210 | - | ||
| 211 | - | gobject.IncreaseRef(GetSeatPtr) | |
| 212 | - | ||
| 213 | - | GetSeatCls := &Seat{} | |
| 214 | - | GetSeatCls.Ptr = GetSeatPtr | |
| 215 | - | return GetSeatCls | |
| 205 | + | cret := xDeviceGetSeat(x.GoPointer()) | |
| 216 | 206 | ||
| 207 | + | if cret == 0 { | |
| 208 | + | return cls | |
| 209 | + | } | |
| 210 | + | gobject.IncreaseRef(cret) | |
| 211 | + | cls = &Seat{} | |
| 212 | + | cls.Ptr = cret | |
| 213 | + | return cls | |
| 217 | 214 | } | |
| 218 | 215 | ||
| 219 | 216 | var xDeviceGetSource func(uintptr) InputSource | |
| @@ -221,8 +218,8 @@ var xDeviceGetSource func(uintptr) InputSource | |||
| 221 | 218 | // Determines the type of the device. | |
| 222 | 219 | func (x *Device) GetSource() InputSource { | |
| 223 | 220 | ||
| 224 | - | return xDeviceGetSource(x.GoPointer()) | |
| 225 | - | ||
| 221 | + | cret := xDeviceGetSource(x.GoPointer()) | |
| 222 | + | return cret | |
| 226 | 223 | } | |
| 227 | 224 | ||
| 228 | 225 | var xDeviceGetSurfaceAtPosition func(uintptr, float64, float64) uintptr | |
| @@ -233,18 +230,17 @@ var xDeviceGetSurfaceAtPosition func(uintptr, float64, float64) uintptr | |||
| 233 | 230 | // Returns %NULL if the surface tree under @device is not known to GDK | |
| 234 | 231 | // (for example, belongs to another application). | |
| 235 | 232 | func (x *Device) GetSurfaceAtPosition(WinXVar float64, WinYVar float64) *Surface { | |
| 233 | + | var cls *Surface | |
| 236 | 234 | ||
| 237 | - | GetSurfaceAtPositionPtr := xDeviceGetSurfaceAtPosition(x.GoPointer(), WinXVar, WinYVar) | |
| 238 | - | if GetSurfaceAtPositionPtr == 0 { | |
| 239 | - | return nil | |
| 240 | - | } | |
| 241 | - | ||
| 242 | - | gobject.IncreaseRef(GetSurfaceAtPositionPtr) | |
| 243 | - | ||
| 244 | - | GetSurfaceAtPositionCls := &Surface{} | |
| 245 | - | GetSurfaceAtPositionCls.Ptr = GetSurfaceAtPositionPtr | |
| 246 | - | return GetSurfaceAtPositionCls | |
| 235 | + | cret := xDeviceGetSurfaceAtPosition(x.GoPointer(), WinXVar, WinYVar) | |
| 247 | 236 | ||
| 237 | + | if cret == 0 { | |
| 238 | + | return cls | |
| 239 | + | } | |
| 240 | + | gobject.IncreaseRef(cret) | |
| 241 | + | cls = &Surface{} | |
| 242 | + | cls.Ptr = cret | |
| 243 | + | return cls | |
| 248 | 244 | } | |
| 249 | 245 | ||
| 250 | 246 | var xDeviceGetTimestamp func(uintptr) uint32 | |
| @@ -257,8 +253,8 @@ var xDeviceGetTimestamp func(uintptr) uint32 | |||
| 257 | 253 | // update the timestamp). | |
| 258 | 254 | func (x *Device) GetTimestamp() uint32 { | |
| 259 | 255 | ||
| 260 | - | return xDeviceGetTimestamp(x.GoPointer()) | |
| 261 | - | ||
| 256 | + | cret := xDeviceGetTimestamp(x.GoPointer()) | |
| 257 | + | return cret | |
| 262 | 258 | } | |
| 263 | 259 | ||
| 264 | 260 | var xDeviceGetVendorId func(uintptr) string | |
| @@ -294,8 +290,8 @@ var xDeviceGetVendorId func(uintptr) string | |||
| 294 | 290 | // ``` | |
| 295 | 291 | func (x *Device) GetVendorId() string { | |
| 296 | 292 | ||
| 297 | - | return xDeviceGetVendorId(x.GoPointer()) | |
| 298 | - | ||
| 293 | + | cret := xDeviceGetVendorId(x.GoPointer()) | |
| 294 | + | return cret | |
| 299 | 295 | } | |
| 300 | 296 | ||
| 301 | 297 | var xDeviceHasBidiLayouts func(uintptr) bool | |
| @@ -306,8 +302,8 @@ var xDeviceHasBidiLayouts func(uintptr) bool | |||
| 306 | 302 | // This is only relevant for keyboard devices. | |
| 307 | 303 | func (x *Device) HasBidiLayouts() bool { | |
| 308 | 304 | ||
| 309 | - | return xDeviceHasBidiLayouts(x.GoPointer()) | |
| 310 | - | ||
| 305 | + | cret := xDeviceHasBidiLayouts(x.GoPointer()) | |
| 306 | + | return cret | |
| 311 | 307 | } | |
| 312 | 308 | ||
| 313 | 309 | func (c *Device) GoPointer() uintptr { | |
M v4/gdk/gdkdevicepad.go +8 -8
| @@ -51,22 +51,22 @@ func (x *DevicePadBase) SetGoPointer(ptr uintptr) { | |||
| 51 | 51 | // f the feature or index do not exist in @pad, -1 is returned. | |
| 52 | 52 | func (x *DevicePadBase) GetFeatureGroup(FeatureVar DevicePadFeature, FeatureIdxVar int) int { | |
| 53 | 53 | ||
| 54 | - | return XGdkDevicePadGetFeatureGroup(x.GoPointer(), FeatureVar, FeatureIdxVar) | |
| 55 | - | ||
| 54 | + | cret := XGdkDevicePadGetFeatureGroup(x.GoPointer(), FeatureVar, FeatureIdxVar) | |
| 55 | + | return cret | |
| 56 | 56 | } | |
| 57 | 57 | ||
| 58 | 58 | // Returns the number of modes that @group may have. | |
| 59 | 59 | func (x *DevicePadBase) GetGroupNModes(GroupIdxVar int) int { | |
| 60 | 60 | ||
| 61 | - | return XGdkDevicePadGetGroupNModes(x.GoPointer(), GroupIdxVar) | |
| 62 | - | ||
| 61 | + | cret := XGdkDevicePadGetGroupNModes(x.GoPointer(), GroupIdxVar) | |
| 62 | + | return cret | |
| 63 | 63 | } | |
| 64 | 64 | ||
| 65 | 65 | // Returns the number of features a tablet pad has. | |
| 66 | 66 | func (x *DevicePadBase) GetNFeatures(FeatureVar DevicePadFeature) int { | |
| 67 | 67 | ||
| 68 | - | return XGdkDevicePadGetNFeatures(x.GoPointer(), FeatureVar) | |
| 69 | - | ||
| 68 | + | cret := XGdkDevicePadGetNFeatures(x.GoPointer(), FeatureVar) | |
| 69 | + | return cret | |
| 70 | 70 | } | |
| 71 | 71 | ||
| 72 | 72 | // Returns the number of groups this pad device has. | |
| @@ -76,8 +76,8 @@ func (x *DevicePadBase) GetNFeatures(FeatureVar DevicePadFeature) int { | |||
| 76 | 76 | // current mode. | |
| 77 | 77 | func (x *DevicePadBase) GetNGroups() int { | |
| 78 | 78 | ||
| 79 | - | return XGdkDevicePadGetNGroups(x.GoPointer()) | |
| 80 | - | ||
| 79 | + | cret := XGdkDevicePadGetNGroups(x.GoPointer()) | |
| 80 | + | return cret | |
| 81 | 81 | } | |
| 82 | 82 | ||
| 83 | 83 | var XGdkDevicePadGetFeatureGroup func(uintptr, DevicePadFeature, int) int | |
M v4/gdk/gdkdevicetool.go +8 -8
| @@ -47,8 +47,8 @@ var xDeviceToolGetAxes func(uintptr) AxisFlags | |||
| 47 | 47 | // Gets the axes of the tool. | |
| 48 | 48 | func (x *DeviceTool) GetAxes() AxisFlags { | |
| 49 | 49 | ||
| 50 | - | return xDeviceToolGetAxes(x.GoPointer()) | |
| 51 | - | ||
| 50 | + | cret := xDeviceToolGetAxes(x.GoPointer()) | |
| 51 | + | return cret | |
| 52 | 52 | } | |
| 53 | 53 | ||
| 54 | 54 | var xDeviceToolGetHardwareId func(uintptr) uint64 | |
| @@ -66,8 +66,8 @@ var xDeviceToolGetHardwareId func(uintptr) uint64 | |||
| 66 | 66 | // `GdkDeviceToolType`, but different hardware identificators. | |
| 67 | 67 | func (x *DeviceTool) GetHardwareId() uint64 { | |
| 68 | 68 | ||
| 69 | - | return xDeviceToolGetHardwareId(x.GoPointer()) | |
| 70 | - | ||
| 69 | + | cret := xDeviceToolGetHardwareId(x.GoPointer()) | |
| 70 | + | return cret | |
| 71 | 71 | } | |
| 72 | 72 | ||
| 73 | 73 | var xDeviceToolGetSerial func(uintptr) uint64 | |
| @@ -78,8 +78,8 @@ var xDeviceToolGetSerial func(uintptr) uint64 | |||
| 78 | 78 | // (eg. a tablet pen) across program executions. | |
| 79 | 79 | func (x *DeviceTool) GetSerial() uint64 { | |
| 80 | 80 | ||
| 81 | - | return xDeviceToolGetSerial(x.GoPointer()) | |
| 82 | - | ||
| 81 | + | cret := xDeviceToolGetSerial(x.GoPointer()) | |
| 82 | + | return cret | |
| 83 | 83 | } | |
| 84 | 84 | ||
| 85 | 85 | var xDeviceToolGetToolType func(uintptr) DeviceToolType | |
| @@ -87,8 +87,8 @@ var xDeviceToolGetToolType func(uintptr) DeviceToolType | |||
| 87 | 87 | // Gets the `GdkDeviceToolType` of the tool. | |
| 88 | 88 | func (x *DeviceTool) GetToolType() DeviceToolType { | |
| 89 | 89 | ||
| 90 | - | return xDeviceToolGetToolType(x.GoPointer()) | |
| 91 | - | ||
| 90 | + | cret := xDeviceToolGetToolType(x.GoPointer()) | |
| 91 | + | return cret | |
| 92 | 92 | } | |
| 93 | 93 | ||
| 94 | 94 | func (c *DeviceTool) GoPointer() uintptr { | |
M v4/gdk/gdkdisplay.go +97 -92
| @@ -64,16 +64,21 @@ var xDisplayCreateGlContext func(uintptr) uintptr | |||
| 64 | 64 | // If the creation of the `GdkGLContext` failed, @error will be set. | |
| 65 | 65 | // Before using the returned `GdkGLContext`, you will need to | |
| 66 | 66 | // call [method@Gdk.GLContext.make_current] or [method@Gdk.GLContext.realize]. | |
| 67 | - | func (x *Display) CreateGlContext() *GLContext { | |
| 67 | + | func (x *Display) CreateGlContext() (*GLContext, error) { | |
| 68 | + | var cls *GLContext | |
| 69 | + | var cerr *glib.Error | |
| 68 | 70 | ||
| 69 | - | CreateGlContextPtr := xDisplayCreateGlContext(x.GoPointer()) | |
| 70 | - | if CreateGlContextPtr == 0 { | |
| 71 | - | return nil | |
| 72 | - | } | |
| 71 | + | cret := xDisplayCreateGlContext(x.GoPointer()) | |
| 73 | 72 | ||
| 74 | - | CreateGlContextCls := &GLContext{} | |
| 75 | - | CreateGlContextCls.Ptr = CreateGlContextPtr | |
| 76 | - | return CreateGlContextCls | |
| 73 | + | if cret == 0 { | |
| 74 | + | return cls, cerr | |
| 75 | + | } | |
| 76 | + | cls = &GLContext{} | |
| 77 | + | cls.Ptr = cret | |
| 78 | + | if cerr == nil { | |
| 79 | + | return cls, nil | |
| 80 | + | } | |
| 81 | + | return cls, cerr | |
| 77 | 82 | ||
| 78 | 83 | } | |
| 79 | 84 | ||
| @@ -82,8 +87,8 @@ var xDisplayDeviceIsGrabbed func(uintptr, uintptr) bool | |||
| 82 | 87 | // Returns %TRUE if there is an ongoing grab on @device for @display. | |
| 83 | 88 | func (x *Display) DeviceIsGrabbed(DeviceVar *Device) bool { | |
| 84 | 89 | ||
| 85 | - | return xDisplayDeviceIsGrabbed(x.GoPointer(), DeviceVar.GoPointer()) | |
| 86 | - | ||
| 90 | + | cret := xDisplayDeviceIsGrabbed(x.GoPointer(), DeviceVar.GoPointer()) | |
| 91 | + | return cret | |
| 87 | 92 | } | |
| 88 | 93 | ||
| 89 | 94 | var xDisplayFlush func(uintptr) | |
| @@ -109,34 +114,33 @@ var xDisplayGetAppLaunchContext func(uintptr) uintptr | |||
| 109 | 114 | // Returns a `GdkAppLaunchContext` suitable for launching | |
| 110 | 115 | // applications on the given display. | |
| 111 | 116 | func (x *Display) GetAppLaunchContext() *AppLaunchContext { | |
| 117 | + | var cls *AppLaunchContext | |
| 112 | 118 | ||
| 113 | - | GetAppLaunchContextPtr := xDisplayGetAppLaunchContext(x.GoPointer()) | |
| 114 | - | if GetAppLaunchContextPtr == 0 { | |
| 115 | - | return nil | |
| 116 | - | } | |
| 117 | - | ||
| 118 | - | GetAppLaunchContextCls := &AppLaunchContext{} | |
| 119 | - | GetAppLaunchContextCls.Ptr = GetAppLaunchContextPtr | |
| 120 | - | return GetAppLaunchContextCls | |
| 119 | + | cret := xDisplayGetAppLaunchContext(x.GoPointer()) | |
| 121 | 120 | ||
| 121 | + | if cret == 0 { | |
| 122 | + | return cls | |
| 123 | + | } | |
| 124 | + | cls = &AppLaunchContext{} | |
| 125 | + | cls.Ptr = cret | |
| 126 | + | return cls | |
| 122 | 127 | } | |
| 123 | 128 | ||
| 124 | 129 | var xDisplayGetClipboard func(uintptr) uintptr | |
| 125 | 130 | ||
| 126 | 131 | // Gets the clipboard used for copy/paste operations. | |
| 127 | 132 | func (x *Display) GetClipboard() *Clipboard { | |
| 133 | + | var cls *Clipboard | |
| 128 | 134 | ||
| 129 | - | GetClipboardPtr := xDisplayGetClipboard(x.GoPointer()) | |
| 130 | - | if GetClipboardPtr == 0 { | |
| 131 | - | return nil | |
| 132 | - | } | |
| 133 | - | ||
| 134 | - | gobject.IncreaseRef(GetClipboardPtr) | |
| 135 | - | ||
| 136 | - | GetClipboardCls := &Clipboard{} | |
| 137 | - | GetClipboardCls.Ptr = GetClipboardPtr | |
| 138 | - | return GetClipboardCls | |
| 135 | + | cret := xDisplayGetClipboard(x.GoPointer()) | |
| 139 | 136 | ||
| 137 | + | if cret == 0 { | |
| 138 | + | return cls | |
| 139 | + | } | |
| 140 | + | gobject.IncreaseRef(cret) | |
| 141 | + | cls = &Clipboard{} | |
| 142 | + | cls.Ptr = cret | |
| 143 | + | return cls | |
| 140 | 144 | } | |
| 141 | 145 | ||
| 142 | 146 | var xDisplayGetDefaultSeat func(uintptr) uintptr | |
| @@ -146,18 +150,17 @@ var xDisplayGetDefaultSeat func(uintptr) uintptr | |||
| 146 | 150 | // Note that a display may not have a seat. In this case, | |
| 147 | 151 | // this function will return %NULL. | |
| 148 | 152 | func (x *Display) GetDefaultSeat() *Seat { | |
| 153 | + | var cls *Seat | |
| 149 | 154 | ||
| 150 | - | GetDefaultSeatPtr := xDisplayGetDefaultSeat(x.GoPointer()) | |
| 151 | - | if GetDefaultSeatPtr == 0 { | |
| 152 | - | return nil | |
| 153 | - | } | |
| 154 | - | ||
| 155 | - | gobject.IncreaseRef(GetDefaultSeatPtr) | |
| 156 | - | ||
| 157 | - | GetDefaultSeatCls := &Seat{} | |
| 158 | - | GetDefaultSeatCls.Ptr = GetDefaultSeatPtr | |
| 159 | - | return GetDefaultSeatCls | |
| 155 | + | cret := xDisplayGetDefaultSeat(x.GoPointer()) | |
| 160 | 156 | ||
| 157 | + | if cret == 0 { | |
| 158 | + | return cls | |
| 159 | + | } | |
| 160 | + | gobject.IncreaseRef(cret) | |
| 161 | + | cls = &Seat{} | |
| 162 | + | cls.Ptr = cret | |
| 163 | + | return cls | |
| 161 | 164 | } | |
| 162 | 165 | ||
| 163 | 166 | var xDisplayGetMonitorAtSurface func(uintptr, uintptr) uintptr | |
| @@ -168,18 +171,17 @@ var xDisplayGetMonitorAtSurface func(uintptr, uintptr) uintptr | |||
| 168 | 171 | // Returns a monitor close to @surface if it is outside | |
| 169 | 172 | // of all monitors. | |
| 170 | 173 | func (x *Display) GetMonitorAtSurface(SurfaceVar *Surface) *Monitor { | |
| 174 | + | var cls *Monitor | |
| 171 | 175 | ||
| 172 | - | GetMonitorAtSurfacePtr := xDisplayGetMonitorAtSurface(x.GoPointer(), SurfaceVar.GoPointer()) | |
| 173 | - | if GetMonitorAtSurfacePtr == 0 { | |
| 174 | - | return nil | |
| 175 | - | } | |
| 176 | - | ||
| 177 | - | gobject.IncreaseRef(GetMonitorAtSurfacePtr) | |
| 178 | - | ||
| 179 | - | GetMonitorAtSurfaceCls := &Monitor{} | |
| 180 | - | GetMonitorAtSurfaceCls.Ptr = GetMonitorAtSurfacePtr | |
| 181 | - | return GetMonitorAtSurfaceCls | |
| 176 | + | cret := xDisplayGetMonitorAtSurface(x.GoPointer(), SurfaceVar.GoPointer()) | |
| 182 | 177 | ||
| 178 | + | if cret == 0 { | |
| 179 | + | return cls | |
| 180 | + | } | |
| 181 | + | gobject.IncreaseRef(cret) | |
| 182 | + | cls = &Monitor{} | |
| 183 | + | cls.Ptr = cret | |
| 184 | + | return cls | |
| 183 | 185 | } | |
| 184 | 186 | ||
| 185 | 187 | var xDisplayGetMonitors func(uintptr) uintptr | |
| @@ -192,18 +194,17 @@ var xDisplayGetMonitors func(uintptr) uintptr | |||
| 192 | 194 | // You can listen to the GListModel::items-changed signal on | |
| 193 | 195 | // this list to monitor changes to the monitor of this display. | |
| 194 | 196 | func (x *Display) GetMonitors() *gio.ListModelBase { | |
| 197 | + | var cls *gio.ListModelBase | |
| 195 | 198 | ||
| 196 | - | GetMonitorsPtr := xDisplayGetMonitors(x.GoPointer()) | |
| 197 | - | if GetMonitorsPtr == 0 { | |
| 198 | - | return nil | |
| 199 | - | } | |
| 200 | - | ||
| 201 | - | gobject.IncreaseRef(GetMonitorsPtr) | |
| 202 | - | ||
| 203 | - | GetMonitorsCls := &gio.ListModelBase{} | |
| 204 | - | GetMonitorsCls.Ptr = GetMonitorsPtr | |
| 205 | - | return GetMonitorsCls | |
| 199 | + | cret := xDisplayGetMonitors(x.GoPointer()) | |
| 206 | 200 | ||
| 201 | + | if cret == 0 { | |
| 202 | + | return cls | |
| 203 | + | } | |
| 204 | + | gobject.IncreaseRef(cret) | |
| 205 | + | cls = &gio.ListModelBase{} | |
| 206 | + | cls.Ptr = cret | |
| 207 | + | return cls | |
| 207 | 208 | } | |
| 208 | 209 | ||
| 209 | 210 | var xDisplayGetName func(uintptr) string | |
| @@ -211,8 +212,8 @@ var xDisplayGetName func(uintptr) string | |||
| 211 | 212 | // Gets the name of the display. | |
| 212 | 213 | func (x *Display) GetName() string { | |
| 213 | 214 | ||
| 214 | - | return xDisplayGetName(x.GoPointer()) | |
| 215 | - | ||
| 215 | + | cret := xDisplayGetName(x.GoPointer()) | |
| 216 | + | return cret | |
| 216 | 217 | } | |
| 217 | 218 | ||
| 218 | 219 | var xDisplayGetPrimaryClipboard func(uintptr) uintptr | |
| @@ -222,18 +223,17 @@ var xDisplayGetPrimaryClipboard func(uintptr) uintptr | |||
| 222 | 223 | // On backends where the primary clipboard is not supported natively, | |
| 223 | 224 | // GDK emulates this clipboard locally. | |
| 224 | 225 | func (x *Display) GetPrimaryClipboard() *Clipboard { | |
| 226 | + | var cls *Clipboard | |
| 225 | 227 | ||
| 226 | - | GetPrimaryClipboardPtr := xDisplayGetPrimaryClipboard(x.GoPointer()) | |
| 227 | - | if GetPrimaryClipboardPtr == 0 { | |
| 228 | - | return nil | |
| 229 | - | } | |
| 230 | - | ||
| 231 | - | gobject.IncreaseRef(GetPrimaryClipboardPtr) | |
| 232 | - | ||
| 233 | - | GetPrimaryClipboardCls := &Clipboard{} | |
| 234 | - | GetPrimaryClipboardCls.Ptr = GetPrimaryClipboardPtr | |
| 235 | - | return GetPrimaryClipboardCls | |
| 228 | + | cret := xDisplayGetPrimaryClipboard(x.GoPointer()) | |
| 236 | 229 | ||
| 230 | + | if cret == 0 { | |
| 231 | + | return cls | |
| 232 | + | } | |
| 233 | + | gobject.IncreaseRef(cret) | |
| 234 | + | cls = &Clipboard{} | |
| 235 | + | cls.Ptr = cret | |
| 236 | + | return cls | |
| 237 | 237 | } | |
| 238 | 238 | ||
| 239 | 239 | var xDisplayGetSetting func(uintptr, string, *gobject.Value) bool | |
| @@ -242,8 +242,8 @@ var xDisplayGetSetting func(uintptr, string, *gobject.Value) bool | |||
| 242 | 242 | // for the @display. | |
| 243 | 243 | func (x *Display) GetSetting(NameVar string, ValueVar *gobject.Value) bool { | |
| 244 | 244 | ||
| 245 | - | return xDisplayGetSetting(x.GoPointer(), NameVar, ValueVar) | |
| 246 | - | ||
| 245 | + | cret := xDisplayGetSetting(x.GoPointer(), NameVar, ValueVar) | |
| 246 | + | return cret | |
| 247 | 247 | } | |
| 248 | 248 | ||
| 249 | 249 | var xDisplayGetStartupNotificationId func(uintptr) string | |
| @@ -252,8 +252,8 @@ var xDisplayGetStartupNotificationId func(uintptr) string | |||
| 252 | 252 | // if no ID has been defined. | |
| 253 | 253 | func (x *Display) GetStartupNotificationId() string { | |
| 254 | 254 | ||
| 255 | - | return xDisplayGetStartupNotificationId(x.GoPointer()) | |
| 256 | - | ||
| 255 | + | cret := xDisplayGetStartupNotificationId(x.GoPointer()) | |
| 256 | + | return cret | |
| 257 | 257 | } | |
| 258 | 258 | ||
| 259 | 259 | var xDisplayIsClosed func(uintptr) bool | |
| @@ -261,8 +261,8 @@ var xDisplayIsClosed func(uintptr) bool | |||
| 261 | 261 | // Finds out if the display has been closed. | |
| 262 | 262 | func (x *Display) IsClosed() bool { | |
| 263 | 263 | ||
| 264 | - | return xDisplayIsClosed(x.GoPointer()) | |
| 265 | - | ||
| 264 | + | cret := xDisplayIsClosed(x.GoPointer()) | |
| 265 | + | return cret | |
| 266 | 266 | } | |
| 267 | 267 | ||
| 268 | 268 | var xDisplayIsComposited func(uintptr) bool | |
| @@ -279,8 +279,8 @@ var xDisplayIsComposited func(uintptr) bool | |||
| 279 | 279 | // On modern displays, this value is always %TRUE. | |
| 280 | 280 | func (x *Display) IsComposited() bool { | |
| 281 | 281 | ||
| 282 | - | return xDisplayIsComposited(x.GoPointer()) | |
| 283 | - | ||
| 282 | + | cret := xDisplayIsComposited(x.GoPointer()) | |
| 283 | + | return cret | |
| 284 | 284 | } | |
| 285 | 285 | ||
| 286 | 286 | var xDisplayIsRgba func(uintptr) bool | |
| @@ -298,8 +298,8 @@ var xDisplayIsRgba func(uintptr) bool | |||
| 298 | 298 | // On modern displays, this value is always %TRUE. | |
| 299 | 299 | func (x *Display) IsRgba() bool { | |
| 300 | 300 | ||
| 301 | - | return xDisplayIsRgba(x.GoPointer()) | |
| 302 | - | ||
| 301 | + | cret := xDisplayIsRgba(x.GoPointer()) | |
| 302 | + | return cret | |
| 303 | 303 | } | |
| 304 | 304 | ||
| 305 | 305 | var xDisplayListSeats func(uintptr) *glib.List | |
| @@ -307,8 +307,8 @@ var xDisplayListSeats func(uintptr) *glib.List | |||
| 307 | 307 | // Returns the list of seats known to @display. | |
| 308 | 308 | func (x *Display) ListSeats() *glib.List { | |
| 309 | 309 | ||
| 310 | - | return xDisplayListSeats(x.GoPointer()) | |
| 311 | - | ||
| 310 | + | cret := xDisplayListSeats(x.GoPointer()) | |
| 311 | + | return cret | |
| 312 | 312 | } | |
| 313 | 313 | ||
| 314 | 314 | var xDisplayMapKeycode func(uintptr, uint, uintptr, uintptr, int) bool | |
| @@ -324,8 +324,8 @@ var xDisplayMapKeycode func(uintptr, uint, uintptr, uintptr, int) bool | |||
| 324 | 324 | // Free the returned arrays with g_free(). | |
| 325 | 325 | func (x *Display) MapKeycode(KeycodeVar uint, KeysVar uintptr, KeyvalsVar uintptr, NEntriesVar int) bool { | |
| 326 | 326 | ||
| 327 | - | return xDisplayMapKeycode(x.GoPointer(), KeycodeVar, KeysVar, KeyvalsVar, NEntriesVar) | |
| 328 | - | ||
| 327 | + | cret := xDisplayMapKeycode(x.GoPointer(), KeycodeVar, KeysVar, KeyvalsVar, NEntriesVar) | |
| 328 | + | return cret | |
| 329 | 329 | } | |
| 330 | 330 | ||
| 331 | 331 | var xDisplayMapKeyval func(uintptr, uint, uintptr, int) bool | |
| @@ -347,8 +347,8 @@ var xDisplayMapKeyval func(uintptr, uint, uintptr, int) bool | |||
| 347 | 347 | // The returned array should be freed with g_free(). | |
| 348 | 348 | func (x *Display) MapKeyval(KeyvalVar uint, KeysVar uintptr, NKeysVar int) bool { | |
| 349 | 349 | ||
| 350 | - | return xDisplayMapKeyval(x.GoPointer(), KeyvalVar, KeysVar, NKeysVar) | |
| 351 | - | ||
| 350 | + | cret := xDisplayMapKeyval(x.GoPointer(), KeyvalVar, KeysVar, NKeysVar) | |
| 351 | + | return cret | |
| 352 | 352 | } | |
| 353 | 353 | ||
| 354 | 354 | var xDisplayNotifyStartupComplete func(uintptr, string) | |
| @@ -382,9 +382,14 @@ var xDisplayPrepareGl func(uintptr) bool | |||
| 382 | 382 | // You never need to call this function, GDK will call it automatically | |
| 383 | 383 | // as needed. But you can use it as a check when setting up code that | |
| 384 | 384 | // might make use of OpenGL. | |
| 385 | - | func (x *Display) PrepareGl() bool { | |
| 385 | + | func (x *Display) PrepareGl() (bool, error) { | |
| 386 | + | var cerr *glib.Error | |
| 386 | 387 | ||
| 387 | - | return xDisplayPrepareGl(x.GoPointer()) | |
| 388 | + | cret := xDisplayPrepareGl(x.GoPointer()) | |
| 389 | + | if cerr == nil { | |
| 390 | + | return cret, nil | |
| 391 | + | } | |
| 392 | + | return cret, cerr | |
| 388 | 393 | ||
| 389 | 394 | } | |
| 390 | 395 | ||
| @@ -411,8 +416,8 @@ var xDisplaySupportsInputShapes func(uintptr) bool | |||
| 411 | 416 | // On modern displays, this value is always %TRUE. | |
| 412 | 417 | func (x *Display) SupportsInputShapes() bool { | |
| 413 | 418 | ||
| 414 | - | return xDisplaySupportsInputShapes(x.GoPointer()) | |
| 415 | - | ||
| 419 | + | cret := xDisplaySupportsInputShapes(x.GoPointer()) | |
| 420 | + | return cret | |
| 416 | 421 | } | |
| 417 | 422 | ||
| 418 | 423 | var xDisplaySync func(uintptr) | |
| @@ -456,8 +461,8 @@ var xDisplayTranslateKey func(uintptr, uint, ModifierType, int, uint, int, int, | |||
| 456 | 461 | // virtualized test environments. | |
| 457 | 462 | func (x *Display) TranslateKey(KeycodeVar uint, StateVar ModifierType, GroupVar int, KeyvalVar uint, EffectiveGroupVar int, LevelVar int, ConsumedVar *ModifierType) bool { | |
| 458 | 463 | ||
| 459 | - | return xDisplayTranslateKey(x.GoPointer(), KeycodeVar, StateVar, GroupVar, KeyvalVar, EffectiveGroupVar, LevelVar, ConsumedVar) | |
| 460 | - | ||
| 464 | + | cret := xDisplayTranslateKey(x.GoPointer(), KeycodeVar, StateVar, GroupVar, KeyvalVar, EffectiveGroupVar, LevelVar, ConsumedVar) | |
| 465 | + | return cret | |
| 461 | 466 | } | |
| 462 | 467 | ||
| 463 | 468 | func (c *Display) GoPointer() uintptr { | |
M v4/gdk/gdkdisplaymanager.go +20 -22
| @@ -111,18 +111,17 @@ var xDisplayManagerGetDefaultDisplay func(uintptr) uintptr | |||
| 111 | 111 | ||
| 112 | 112 | // Gets the default `GdkDisplay`. | |
| 113 | 113 | func (x *DisplayManager) GetDefaultDisplay() *Display { | |
| 114 | + | var cls *Display | |
| 114 | 115 | ||
| 115 | - | GetDefaultDisplayPtr := xDisplayManagerGetDefaultDisplay(x.GoPointer()) | |
| 116 | - | if GetDefaultDisplayPtr == 0 { | |
| 117 | - | return nil | |
| 118 | - | } | |
| 119 | - | ||
| 120 | - | gobject.IncreaseRef(GetDefaultDisplayPtr) | |
| 121 | - | ||
| 122 | - | GetDefaultDisplayCls := &Display{} | |
| 123 | - | GetDefaultDisplayCls.Ptr = GetDefaultDisplayPtr | |
| 124 | - | return GetDefaultDisplayCls | |
| 116 | + | cret := xDisplayManagerGetDefaultDisplay(x.GoPointer()) | |
| 125 | 117 | ||
| 118 | + | if cret == 0 { | |
| 119 | + | return cls | |
| 120 | + | } | |
| 121 | + | gobject.IncreaseRef(cret) | |
| 122 | + | cls = &Display{} | |
| 123 | + | cls.Ptr = cret | |
| 124 | + | return cls | |
| 126 | 125 | } | |
| 127 | 126 | ||
| 128 | 127 | var xDisplayManagerListDisplays func(uintptr) *glib.SList | |
| @@ -130,26 +129,25 @@ var xDisplayManagerListDisplays func(uintptr) *glib.SList | |||
| 130 | 129 | // List all currently open displays. | |
| 131 | 130 | func (x *DisplayManager) ListDisplays() *glib.SList { | |
| 132 | 131 | ||
| 133 | - | return xDisplayManagerListDisplays(x.GoPointer()) | |
| 134 | - | ||
| 132 | + | cret := xDisplayManagerListDisplays(x.GoPointer()) | |
| 133 | + | return cret | |
| 135 | 134 | } | |
| 136 | 135 | ||
| 137 | 136 | var xDisplayManagerOpenDisplay func(uintptr, string) uintptr | |
| 138 | 137 | ||
| 139 | 138 | // Opens a display. | |
| 140 | 139 | func (x *DisplayManager) OpenDisplay(NameVar string) *Display { | |
| 140 | + | var cls *Display | |
| 141 | 141 | ||
| 142 | - | OpenDisplayPtr := xDisplayManagerOpenDisplay(x.GoPointer(), NameVar) | |
| 143 | - | if OpenDisplayPtr == 0 { | |
| 144 | - | return nil | |
| 145 | - | } | |
| 146 | - | ||
| 147 | - | gobject.IncreaseRef(OpenDisplayPtr) | |
| 148 | - | ||
| 149 | - | OpenDisplayCls := &Display{} | |
| 150 | - | OpenDisplayCls.Ptr = OpenDisplayPtr | |
| 151 | - | return OpenDisplayCls | |
| 142 | + | cret := xDisplayManagerOpenDisplay(x.GoPointer(), NameVar) | |
| 152 | 143 | ||
| 144 | + | if cret == 0 { | |
| 145 | + | return cls | |
| 146 | + | } | |
| 147 | + | gobject.IncreaseRef(cret) | |
| 148 | + | cls = &Display{} | |
| 149 | + | cls.Ptr = cret | |
| 150 | + | return cls | |
| 153 | 151 | } | |
| 154 | 152 | ||
| 155 | 153 | var xDisplayManagerSetDefaultDisplay func(uintptr, uintptr) | |
M v4/gdk/gdkdrag.go +53 -58
| @@ -29,8 +29,8 @@ var xDragActionIsUnique func(DragAction) bool | |||
| 29 | 29 | // is returned. | |
| 30 | 30 | func DragActionIsUnique(ActionVar DragAction) bool { | |
| 31 | 31 | ||
| 32 | - | return xDragActionIsUnique(ActionVar) | |
| 33 | - | ||
| 32 | + | cret := xDragActionIsUnique(ActionVar) | |
| 33 | + | return cret | |
| 34 | 34 | } | |
| 35 | 35 | ||
| 36 | 36 | // The `GdkDrag` object represents the source of an ongoing DND operation. | |
| @@ -77,62 +77,59 @@ var xDragGetActions func(uintptr) DragAction | |||
| 77 | 77 | // Determines the bitmask of possible actions proposed by the source. | |
| 78 | 78 | func (x *Drag) GetActions() DragAction { | |
| 79 | 79 | ||
| 80 | - | return xDragGetActions(x.GoPointer()) | |
| 81 | - | ||
| 80 | + | cret := xDragGetActions(x.GoPointer()) | |
| 81 | + | return cret | |
| 82 | 82 | } | |
| 83 | 83 | ||
| 84 | 84 | var xDragGetContent func(uintptr) uintptr | |
| 85 | 85 | ||
| 86 | 86 | // Returns the `GdkContentProvider` associated to the `GdkDrag` object. | |
| 87 | 87 | func (x *Drag) GetContent() *ContentProvider { | |
| 88 | + | var cls *ContentProvider | |
| 88 | 89 | ||
| 89 | - | GetContentPtr := xDragGetContent(x.GoPointer()) | |
| 90 | - | if GetContentPtr == 0 { | |
| 91 | - | return nil | |
| 92 | - | } | |
| 93 | - | ||
| 94 | - | gobject.IncreaseRef(GetContentPtr) | |
| 95 | - | ||
| 96 | - | GetContentCls := &ContentProvider{} | |
| 97 | - | GetContentCls.Ptr = GetContentPtr | |
| 98 | - | return GetContentCls | |
| 90 | + | cret := xDragGetContent(x.GoPointer()) | |
| 99 | 91 | ||
| 92 | + | if cret == 0 { | |
| 93 | + | return cls | |
| 94 | + | } | |
| 95 | + | gobject.IncreaseRef(cret) | |
| 96 | + | cls = &ContentProvider{} | |
| 97 | + | cls.Ptr = cret | |
| 98 | + | return cls | |
| 100 | 99 | } | |
| 101 | 100 | ||
| 102 | 101 | var xDragGetDevice func(uintptr) uintptr | |
| 103 | 102 | ||
| 104 | 103 | // Returns the `GdkDevice` associated to the `GdkDrag` object. | |
| 105 | 104 | func (x *Drag) GetDevice() *Device { | |
| 105 | + | var cls *Device | |
| 106 | 106 | ||
| 107 | - | GetDevicePtr := xDragGetDevice(x.GoPointer()) | |
| 108 | - | if GetDevicePtr == 0 { | |
| 109 | - | return nil | |
| 110 | - | } | |
| 111 | - | ||
| 112 | - | gobject.IncreaseRef(GetDevicePtr) | |
| 113 | - | ||
| 114 | - | GetDeviceCls := &Device{} | |
| 115 | - | GetDeviceCls.Ptr = GetDevicePtr | |
| 116 | - | return GetDeviceCls | |
| 107 | + | cret := xDragGetDevice(x.GoPointer()) | |
| 117 | 108 | ||
| 109 | + | if cret == 0 { | |
| 110 | + | return cls | |
| 111 | + | } | |
| 112 | + | gobject.IncreaseRef(cret) | |
| 113 | + | cls = &Device{} | |
| 114 | + | cls.Ptr = cret | |
| 115 | + | return cls | |
| 118 | 116 | } | |
| 119 | 117 | ||
| 120 | 118 | var xDragGetDisplay func(uintptr) uintptr | |
| 121 | 119 | ||
| 122 | 120 | // Gets the `GdkDisplay` that the drag object was created for. | |
| 123 | 121 | func (x *Drag) GetDisplay() *Display { | |
| 122 | + | var cls *Display | |
| 124 | 123 | ||
| 125 | - | GetDisplayPtr := xDragGetDisplay(x.GoPointer()) | |
| 126 | - | if GetDisplayPtr == 0 { | |
| 127 | - | return nil | |
| 128 | - | } | |
| 129 | - | ||
| 130 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 131 | - | ||
| 132 | - | GetDisplayCls := &Display{} | |
| 133 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 134 | - | return GetDisplayCls | |
| 124 | + | cret := xDragGetDisplay(x.GoPointer()) | |
| 135 | 125 | ||
| 126 | + | if cret == 0 { | |
| 127 | + | return cls | |
| 128 | + | } | |
| 129 | + | gobject.IncreaseRef(cret) | |
| 130 | + | cls = &Display{} | |
| 131 | + | cls.Ptr = cret | |
| 132 | + | return cls | |
| 136 | 133 | } | |
| 137 | 134 | ||
| 138 | 135 | var xDragGetDragSurface func(uintptr) uintptr | |
| @@ -145,18 +142,17 @@ var xDragGetDragSurface func(uintptr) uintptr | |||
| 145 | 142 | // drag operation. The surface is owned by @drag and will be destroyed | |
| 146 | 143 | // when the drag operation is over. | |
| 147 | 144 | func (x *Drag) GetDragSurface() *Surface { | |
| 145 | + | var cls *Surface | |
| 148 | 146 | ||
| 149 | - | GetDragSurfacePtr := xDragGetDragSurface(x.GoPointer()) | |
| 150 | - | if GetDragSurfacePtr == 0 { | |
| 151 | - | return nil | |
| 152 | - | } | |
| 153 | - | ||
| 154 | - | gobject.IncreaseRef(GetDragSurfacePtr) | |
| 155 | - | ||
| 156 | - | GetDragSurfaceCls := &Surface{} | |
| 157 | - | GetDragSurfaceCls.Ptr = GetDragSurfacePtr | |
| 158 | - | return GetDragSurfaceCls | |
| 147 | + | cret := xDragGetDragSurface(x.GoPointer()) | |
| 159 | 148 | ||
| 149 | + | if cret == 0 { | |
| 150 | + | return cls | |
| 151 | + | } | |
| 152 | + | gobject.IncreaseRef(cret) | |
| 153 | + | cls = &Surface{} | |
| 154 | + | cls.Ptr = cret | |
| 155 | + | return cls | |
| 160 | 156 | } | |
| 161 | 157 | ||
| 162 | 158 | var xDragGetFormats func(uintptr) *ContentFormats | |
| @@ -164,8 +160,8 @@ var xDragGetFormats func(uintptr) *ContentFormats | |||
| 164 | 160 | // Retrieves the formats supported by this `GdkDrag` object. | |
| 165 | 161 | func (x *Drag) GetFormats() *ContentFormats { | |
| 166 | 162 | ||
| 167 | - | return xDragGetFormats(x.GoPointer()) | |
| 168 | - | ||
| 163 | + | cret := xDragGetFormats(x.GoPointer()) | |
| 164 | + | return cret | |
| 169 | 165 | } | |
| 170 | 166 | ||
| 171 | 167 | var xDragGetSelectedAction func(uintptr) DragAction | |
| @@ -173,26 +169,25 @@ var xDragGetSelectedAction func(uintptr) DragAction | |||
| 173 | 169 | // Determines the action chosen by the drag destination. | |
| 174 | 170 | func (x *Drag) GetSelectedAction() DragAction { | |
| 175 | 171 | ||
| 176 | - | return xDragGetSelectedAction(x.GoPointer()) | |
| 177 | - | ||
| 172 | + | cret := xDragGetSelectedAction(x.GoPointer()) | |
| 173 | + | return cret | |
| 178 | 174 | } | |
| 179 | 175 | ||
| 180 | 176 | var xDragGetSurface func(uintptr) uintptr | |
| 181 | 177 | ||
| 182 | 178 | // Returns the `GdkSurface` where the drag originates. | |
| 183 | 179 | func (x *Drag) GetSurface() *Surface { | |
| 180 | + | var cls *Surface | |
| 184 | 181 | ||
| 185 | - | GetSurfacePtr := xDragGetSurface(x.GoPointer()) | |
| 186 | - | if GetSurfacePtr == 0 { | |
| 187 | - | return nil | |
| 188 | - | } | |
| 189 | - | ||
| 190 | - | gobject.IncreaseRef(GetSurfacePtr) | |
| 191 | - | ||
| 192 | - | GetSurfaceCls := &Surface{} | |
| 193 | - | GetSurfaceCls.Ptr = GetSurfacePtr | |
| 194 | - | return GetSurfaceCls | |
| 182 | + | cret := xDragGetSurface(x.GoPointer()) | |
| 195 | 183 | ||
| 184 | + | if cret == 0 { | |
| 185 | + | return cls | |
| 186 | + | } | |
| 187 | + | gobject.IncreaseRef(cret) | |
| 188 | + | cls = &Surface{} | |
| 189 | + | cls.Ptr = cret | |
| 190 | + | return cls | |
| 196 | 191 | } | |
| 197 | 192 | ||
| 198 | 193 | var xDragSetHotspot func(uintptr, int, int) | |
M v4/gdk/gdkdragsurface.go +2 -2
| @@ -31,8 +31,8 @@ func (x *DragSurfaceBase) SetGoPointer(ptr uintptr) { | |||
| 31 | 31 | // Present @drag_surface. | |
| 32 | 32 | func (x *DragSurfaceBase) Present(WidthVar int, HeightVar int) bool { | |
| 33 | 33 | ||
| 34 | - | return XGdkDragSurfacePresent(x.GoPointer(), WidthVar, HeightVar) | |
| 35 | - | ||
| 34 | + | cret := XGdkDragSurfacePresent(x.GoPointer(), WidthVar, HeightVar) | |
| 35 | + | return cret | |
| 36 | 36 | } | |
| 37 | 37 | ||
| 38 | 38 | var XGdkDragSurfacePresent func(uintptr, int, int) bool | |
M v4/gdk/gdkdrawcontext.go +22 -24
| @@ -79,18 +79,17 @@ var xDrawContextGetDisplay func(uintptr) uintptr | |||
| 79 | 79 | ||
| 80 | 80 | // Retrieves the `GdkDisplay` the @context is created for | |
| 81 | 81 | func (x *DrawContext) GetDisplay() *Display { | |
| 82 | + | var cls *Display | |
| 82 | 83 | ||
| 83 | - | GetDisplayPtr := xDrawContextGetDisplay(x.GoPointer()) | |
| 84 | - | if GetDisplayPtr == 0 { | |
| 85 | - | return nil | |
| 86 | - | } | |
| 87 | - | ||
| 88 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 89 | - | ||
| 90 | - | GetDisplayCls := &Display{} | |
| 91 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 92 | - | return GetDisplayCls | |
| 84 | + | cret := xDrawContextGetDisplay(x.GoPointer()) | |
| 93 | 85 | ||
| 86 | + | if cret == 0 { | |
| 87 | + | return cls | |
| 88 | + | } | |
| 89 | + | gobject.IncreaseRef(cret) | |
| 90 | + | cls = &Display{} | |
| 91 | + | cls.Ptr = cret | |
| 92 | + | return cls | |
| 94 | 93 | } | |
| 95 | 94 | ||
| 96 | 95 | var xDrawContextGetFrameRegion func(uintptr) *cairo.Region | |
| @@ -105,26 +104,25 @@ var xDrawContextGetFrameRegion func(uintptr) *cairo.Region | |||
| 105 | 104 | // and [method@Gdk.DrawContext.end_frame], %NULL will be returned. | |
| 106 | 105 | func (x *DrawContext) GetFrameRegion() *cairo.Region { | |
| 107 | 106 | ||
| 108 | - | return xDrawContextGetFrameRegion(x.GoPointer()) | |
| 109 | - | ||
| 107 | + | cret := xDrawContextGetFrameRegion(x.GoPointer()) | |
| 108 | + | return cret | |
| 110 | 109 | } | |
| 111 | 110 | ||
| 112 | 111 | var xDrawContextGetSurface func(uintptr) uintptr | |
| 113 | 112 | ||
| 114 | 113 | // Retrieves the surface that @context is bound to. | |
| 115 | 114 | func (x *DrawContext) GetSurface() *Surface { | |
| 115 | + | var cls *Surface | |
| 116 | 116 | ||
| 117 | - | GetSurfacePtr := xDrawContextGetSurface(x.GoPointer()) | |
| 118 | - | if GetSurfacePtr == 0 { | |
| 119 | - | return nil | |
| 120 | - | } | |
| 121 | - | ||
| 122 | - | gobject.IncreaseRef(GetSurfacePtr) | |
| 123 | - | ||
| 124 | - | GetSurfaceCls := &Surface{} | |
| 125 | - | GetSurfaceCls.Ptr = GetSurfacePtr | |
| 126 | - | return GetSurfaceCls | |
| 117 | + | cret := xDrawContextGetSurface(x.GoPointer()) | |
| 127 | 118 | ||
| 119 | + | if cret == 0 { | |
| 120 | + | return cls | |
| 121 | + | } | |
| 122 | + | gobject.IncreaseRef(cret) | |
| 123 | + | cls = &Surface{} | |
| 124 | + | cls.Ptr = cret | |
| 125 | + | return cls | |
| 128 | 126 | } | |
| 129 | 127 | ||
| 130 | 128 | var xDrawContextIsInFrame func(uintptr) bool | |
| @@ -136,8 +134,8 @@ var xDrawContextIsInFrame func(uintptr) bool | |||
| 136 | 134 | // may be effecting the contents of the @context's surface. | |
| 137 | 135 | func (x *DrawContext) IsInFrame() bool { | |
| 138 | 136 | ||
| 139 | - | return xDrawContextIsInFrame(x.GoPointer()) | |
| 140 | - | ||
| 137 | + | cret := xDrawContextIsInFrame(x.GoPointer()) | |
| 138 | + | return cret | |
| 141 | 139 | } | |
| 142 | 140 | ||
| 143 | 141 | func (c *DrawContext) GoPointer() uintptr { | |
M v4/gdk/gdkdrop.go +63 -56
| @@ -5,6 +5,7 @@ import ( | |||
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | 7 | "github.com/jwijenbergh/puregotk/v4/gio" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 8 | 9 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | 10 | ) | |
| 10 | 11 | ||
| @@ -62,44 +63,42 @@ var xDropGetActions func(uintptr) DragAction | |||
| 62 | 63 | // side will not change this value anymore once a drop has started. | |
| 63 | 64 | func (x *Drop) GetActions() DragAction { | |
| 64 | 65 | ||
| 65 | - | return xDropGetActions(x.GoPointer()) | |
| 66 | - | ||
| 66 | + | cret := xDropGetActions(x.GoPointer()) | |
| 67 | + | return cret | |
| 67 | 68 | } | |
| 68 | 69 | ||
| 69 | 70 | var xDropGetDevice func(uintptr) uintptr | |
| 70 | 71 | ||
| 71 | 72 | // Returns the `GdkDevice` performing the drop. | |
| 72 | 73 | func (x *Drop) GetDevice() *Device { | |
| 74 | + | var cls *Device | |
| 73 | 75 | ||
| 74 | - | GetDevicePtr := xDropGetDevice(x.GoPointer()) | |
| 75 | - | if GetDevicePtr == 0 { | |
| 76 | - | return nil | |
| 77 | - | } | |
| 78 | - | ||
| 79 | - | gobject.IncreaseRef(GetDevicePtr) | |
| 80 | - | ||
| 81 | - | GetDeviceCls := &Device{} | |
| 82 | - | GetDeviceCls.Ptr = GetDevicePtr | |
| 83 | - | return GetDeviceCls | |
| 76 | + | cret := xDropGetDevice(x.GoPointer()) | |
| 84 | 77 | ||
| 78 | + | if cret == 0 { | |
| 79 | + | return cls | |
| 80 | + | } | |
| 81 | + | gobject.IncreaseRef(cret) | |
| 82 | + | cls = &Device{} | |
| 83 | + | cls.Ptr = cret | |
| 84 | + | return cls | |
| 85 | 85 | } | |
| 86 | 86 | ||
| 87 | 87 | var xDropGetDisplay func(uintptr) uintptr | |
| 88 | 88 | ||
| 89 | 89 | // Gets the `GdkDisplay` that @self was created for. | |
| 90 | 90 | func (x *Drop) GetDisplay() *Display { | |
| 91 | + | var cls *Display | |
| 91 | 92 | ||
| 92 | - | GetDisplayPtr := xDropGetDisplay(x.GoPointer()) | |
| 93 | - | if GetDisplayPtr == 0 { | |
| 94 | - | return nil | |
| 95 | - | } | |
| 96 | - | ||
| 97 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 98 | - | ||
| 99 | - | GetDisplayCls := &Display{} | |
| 100 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 101 | - | return GetDisplayCls | |
| 93 | + | cret := xDropGetDisplay(x.GoPointer()) | |
| 102 | 94 | ||
| 95 | + | if cret == 0 { | |
| 96 | + | return cls | |
| 97 | + | } | |
| 98 | + | gobject.IncreaseRef(cret) | |
| 99 | + | cls = &Display{} | |
| 100 | + | cls.Ptr = cret | |
| 101 | + | return cls | |
| 103 | 102 | } | |
| 104 | 103 | ||
| 105 | 104 | var xDropGetDrag func(uintptr) uintptr | |
| @@ -109,18 +108,17 @@ var xDropGetDrag func(uintptr) uintptr | |||
| 109 | 108 | // | |
| 110 | 109 | // If it is not, %NULL is returned. | |
| 111 | 110 | func (x *Drop) GetDrag() *Drag { | |
| 111 | + | var cls *Drag | |
| 112 | 112 | ||
| 113 | - | GetDragPtr := xDropGetDrag(x.GoPointer()) | |
| 114 | - | if GetDragPtr == 0 { | |
| 115 | - | return nil | |
| 116 | - | } | |
| 117 | - | ||
| 118 | - | gobject.IncreaseRef(GetDragPtr) | |
| 119 | - | ||
| 120 | - | GetDragCls := &Drag{} | |
| 121 | - | GetDragCls.Ptr = GetDragPtr | |
| 122 | - | return GetDragCls | |
| 113 | + | cret := xDropGetDrag(x.GoPointer()) | |
| 123 | 114 | ||
| 115 | + | if cret == 0 { | |
| 116 | + | return cls | |
| 117 | + | } | |
| 118 | + | gobject.IncreaseRef(cret) | |
| 119 | + | cls = &Drag{} | |
| 120 | + | cls.Ptr = cret | |
| 121 | + | return cls | |
| 124 | 122 | } | |
| 125 | 123 | ||
| 126 | 124 | var xDropGetFormats func(uintptr) *ContentFormats | |
| @@ -129,26 +127,25 @@ var xDropGetFormats func(uintptr) *ContentFormats | |||
| 129 | 127 | // to be read in. | |
| 130 | 128 | func (x *Drop) GetFormats() *ContentFormats { | |
| 131 | 129 | ||
| 132 | - | return xDropGetFormats(x.GoPointer()) | |
| 133 | - | ||
| 130 | + | cret := xDropGetFormats(x.GoPointer()) | |
| 131 | + | return cret | |
| 134 | 132 | } | |
| 135 | 133 | ||
| 136 | 134 | var xDropGetSurface func(uintptr) uintptr | |
| 137 | 135 | ||
| 138 | 136 | // Returns the `GdkSurface` performing the drop. | |
| 139 | 137 | func (x *Drop) GetSurface() *Surface { | |
| 138 | + | var cls *Surface | |
| 140 | 139 | ||
| 141 | - | GetSurfacePtr := xDropGetSurface(x.GoPointer()) | |
| 142 | - | if GetSurfacePtr == 0 { | |
| 143 | - | return nil | |
| 144 | - | } | |
| 145 | - | ||
| 146 | - | gobject.IncreaseRef(GetSurfacePtr) | |
| 147 | - | ||
| 148 | - | GetSurfaceCls := &Surface{} | |
| 149 | - | GetSurfaceCls.Ptr = GetSurfacePtr | |
| 150 | - | return GetSurfaceCls | |
| 140 | + | cret := xDropGetSurface(x.GoPointer()) | |
| 151 | 141 | ||
| 142 | + | if cret == 0 { | |
| 143 | + | return cls | |
| 144 | + | } | |
| 145 | + | gobject.IncreaseRef(cret) | |
| 146 | + | cls = &Surface{} | |
| 147 | + | cls.Ptr = cret | |
| 148 | + | return cls | |
| 152 | 149 | } | |
| 153 | 150 | ||
| 154 | 151 | var xDropReadAsync func(uintptr, uintptr, int, uintptr, uintptr, uintptr) | |
| @@ -161,7 +158,7 @@ func (x *Drop) ReadAsync(MimeTypesVar uintptr, IoPriorityVar int, CancellableVar | |||
| 161 | 158 | ||
| 162 | 159 | } | |
| 163 | 160 | ||
| 164 | - | var xDropReadFinish func(uintptr, uintptr, string) uintptr | |
| 161 | + | var xDropReadFinish func(uintptr, uintptr, string, **glib.Error) uintptr | |
| 165 | 162 | ||
| 166 | 163 | // Finishes an async drop read operation. | |
| 167 | 164 | // | |
| @@ -171,16 +168,21 @@ var xDropReadFinish func(uintptr, uintptr, string) uintptr | |||
| 171 | 168 | // g_input_stream_read_bytes_async(). | |
| 172 | 169 | // | |
| 173 | 170 | // See [method@Gdk.Drop.read_async]. | |
| 174 | - | func (x *Drop) ReadFinish(ResultVar gio.AsyncResult, OutMimeTypeVar string) *gio.InputStream { | |
| 171 | + | func (x *Drop) ReadFinish(ResultVar gio.AsyncResult, OutMimeTypeVar string) (*gio.InputStream, error) { | |
| 172 | + | var cls *gio.InputStream | |
| 173 | + | var cerr *glib.Error | |
| 175 | 174 | ||
| 176 | - | ReadFinishPtr := xDropReadFinish(x.GoPointer(), ResultVar.GoPointer(), OutMimeTypeVar) | |
| 177 | - | if ReadFinishPtr == 0 { | |
| 178 | - | return nil | |
| 179 | - | } | |
| 175 | + | cret := xDropReadFinish(x.GoPointer(), ResultVar.GoPointer(), OutMimeTypeVar, &cerr) | |
| 180 | 176 | ||
| 181 | - | ReadFinishCls := &gio.InputStream{} | |
| 182 | - | ReadFinishCls.Ptr = ReadFinishPtr | |
| 183 | - | return ReadFinishCls | |
| 177 | + | if cret == 0 { | |
| 178 | + | return cls, cerr | |
| 179 | + | } | |
| 180 | + | cls = &gio.InputStream{} | |
| 181 | + | cls.Ptr = cret | |
| 182 | + | if cerr == nil { | |
| 183 | + | return cls, nil | |
| 184 | + | } | |
| 185 | + | return cls, cerr | |
| 184 | 186 | ||
| 185 | 187 | } | |
| 186 | 188 | ||
| @@ -202,14 +204,19 @@ func (x *Drop) ReadValueAsync(TypeVar []interface{}, IoPriorityVar int, Cancella | |||
| 202 | 204 | ||
| 203 | 205 | } | |
| 204 | 206 | ||
| 205 | - | var xDropReadValueFinish func(uintptr, uintptr) *gobject.Value | |
| 207 | + | var xDropReadValueFinish func(uintptr, uintptr, **glib.Error) *gobject.Value | |
| 206 | 208 | ||
| 207 | 209 | // Finishes an async drop read. | |
| 208 | 210 | // | |
| 209 | 211 | // See [method@Gdk.Drop.read_value_async]. | |
| 210 | - | func (x *Drop) ReadValueFinish(ResultVar gio.AsyncResult) *gobject.Value { | |
| 212 | + | func (x *Drop) ReadValueFinish(ResultVar gio.AsyncResult) (*gobject.Value, error) { | |
| 213 | + | var cerr *glib.Error | |
| 211 | 214 | ||
| 212 | - | return xDropReadValueFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 215 | + | cret := xDropReadValueFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 216 | + | if cerr == nil { | |
| 217 | + | return cret, nil | |
| 218 | + | } | |
| 219 | + | return cret, cerr | |
| 213 | 220 | ||
| 214 | 221 | } | |
| 215 | 222 | ||
M v4/gdk/gdkevents.go +149 -156
| @@ -253,8 +253,8 @@ var xEventsGetAngle func(uintptr, uintptr, float64) bool | |||
| 253 | 253 | // If not, this function returns %FALSE. | |
| 254 | 254 | func EventsGetAngle(Event1Var *Event, Event2Var *Event, AngleVar float64) bool { | |
| 255 | 255 | ||
| 256 | - | return xEventsGetAngle(Event1Var.GoPointer(), Event2Var.GoPointer(), AngleVar) | |
| 257 | - | ||
| 256 | + | cret := xEventsGetAngle(Event1Var.GoPointer(), Event2Var.GoPointer(), AngleVar) | |
| 257 | + | return cret | |
| 258 | 258 | } | |
| 259 | 259 | ||
| 260 | 260 | var xEventsGetCenter func(uintptr, uintptr, float64, float64) bool | |
| @@ -265,8 +265,8 @@ var xEventsGetCenter func(uintptr, uintptr, float64, float64) bool | |||
| 265 | 265 | // If not, this function returns %FALSE. | |
| 266 | 266 | func EventsGetCenter(Event1Var *Event, Event2Var *Event, XVar float64, YVar float64) bool { | |
| 267 | 267 | ||
| 268 | - | return xEventsGetCenter(Event1Var.GoPointer(), Event2Var.GoPointer(), XVar, YVar) | |
| 269 | - | ||
| 268 | + | cret := xEventsGetCenter(Event1Var.GoPointer(), Event2Var.GoPointer(), XVar, YVar) | |
| 269 | + | return cret | |
| 270 | 270 | } | |
| 271 | 271 | ||
| 272 | 272 | var xEventsGetDistance func(uintptr, uintptr, float64) bool | |
| @@ -277,8 +277,8 @@ var xEventsGetDistance func(uintptr, uintptr, float64) bool | |||
| 277 | 277 | // If not, this function returns %FALSE. | |
| 278 | 278 | func EventsGetDistance(Event1Var *Event, Event2Var *Event, DistanceVar float64) bool { | |
| 279 | 279 | ||
| 280 | - | return xEventsGetDistance(Event1Var.GoPointer(), Event2Var.GoPointer(), DistanceVar) | |
| 281 | - | ||
| 280 | + | cret := xEventsGetDistance(Event1Var.GoPointer(), Event2Var.GoPointer(), DistanceVar) | |
| 281 | + | return cret | |
| 282 | 282 | } | |
| 283 | 283 | ||
| 284 | 284 | // An event related to a button on a pointer device. | |
| @@ -297,8 +297,8 @@ var xButtonEventGetButton func(uintptr) uint | |||
| 297 | 297 | // Extract the button number from a button event. | |
| 298 | 298 | func (x *ButtonEvent) GetButton() uint { | |
| 299 | 299 | ||
| 300 | - | return xButtonEventGetButton(x.GoPointer()) | |
| 301 | - | ||
| 300 | + | cret := xButtonEventGetButton(x.GoPointer()) | |
| 301 | + | return cret | |
| 302 | 302 | } | |
| 303 | 303 | ||
| 304 | 304 | func (c *ButtonEvent) GoPointer() uintptr { | |
| @@ -325,8 +325,8 @@ var xCrossingEventGetDetail func(uintptr) NotifyType | |||
| 325 | 325 | // Extracts the notify detail from a crossing event. | |
| 326 | 326 | func (x *CrossingEvent) GetDetail() NotifyType { | |
| 327 | 327 | ||
| 328 | - | return xCrossingEventGetDetail(x.GoPointer()) | |
| 329 | - | ||
| 328 | + | cret := xCrossingEventGetDetail(x.GoPointer()) | |
| 329 | + | return cret | |
| 330 | 330 | } | |
| 331 | 331 | ||
| 332 | 332 | var xCrossingEventGetFocus func(uintptr) bool | |
| @@ -334,8 +334,8 @@ var xCrossingEventGetFocus func(uintptr) bool | |||
| 334 | 334 | // Checks if the @event surface is the focus surface. | |
| 335 | 335 | func (x *CrossingEvent) GetFocus() bool { | |
| 336 | 336 | ||
| 337 | - | return xCrossingEventGetFocus(x.GoPointer()) | |
| 338 | - | ||
| 337 | + | cret := xCrossingEventGetFocus(x.GoPointer()) | |
| 338 | + | return cret | |
| 339 | 339 | } | |
| 340 | 340 | ||
| 341 | 341 | var xCrossingEventGetMode func(uintptr) CrossingMode | |
| @@ -343,8 +343,8 @@ var xCrossingEventGetMode func(uintptr) CrossingMode | |||
| 343 | 343 | // Extracts the crossing mode from a crossing event. | |
| 344 | 344 | func (x *CrossingEvent) GetMode() CrossingMode { | |
| 345 | 345 | ||
| 346 | - | return xCrossingEventGetMode(x.GoPointer()) | |
| 347 | - | ||
| 346 | + | cret := xCrossingEventGetMode(x.GoPointer()) | |
| 347 | + | return cret | |
| 348 | 348 | } | |
| 349 | 349 | ||
| 350 | 350 | func (c *CrossingEvent) GoPointer() uintptr { | |
| @@ -370,18 +370,17 @@ var xDNDEventGetDrop func(uintptr) uintptr | |||
| 370 | 370 | ||
| 371 | 371 | // Gets the `GdkDrop` object from a DND event. | |
| 372 | 372 | func (x *DNDEvent) GetDrop() *Drop { | |
| 373 | + | var cls *Drop | |
| 373 | 374 | ||
| 374 | - | GetDropPtr := xDNDEventGetDrop(x.GoPointer()) | |
| 375 | - | if GetDropPtr == 0 { | |
| 376 | - | return nil | |
| 377 | - | } | |
| 378 | - | ||
| 379 | - | gobject.IncreaseRef(GetDropPtr) | |
| 380 | - | ||
| 381 | - | GetDropCls := &Drop{} | |
| 382 | - | GetDropCls.Ptr = GetDropPtr | |
| 383 | - | return GetDropCls | |
| 375 | + | cret := xDNDEventGetDrop(x.GoPointer()) | |
| 384 | 376 | ||
| 377 | + | if cret == 0 { | |
| 378 | + | return cls | |
| 379 | + | } | |
| 380 | + | gobject.IncreaseRef(cret) | |
| 381 | + | cls = &Drop{} | |
| 382 | + | cls.Ptr = cret | |
| 383 | + | return cls | |
| 385 | 384 | } | |
| 386 | 385 | ||
| 387 | 386 | func (c *DNDEvent) GoPointer() uintptr { | |
| @@ -439,8 +438,8 @@ var xEventGetAngle func(uintptr, uintptr, float64) bool | |||
| 439 | 438 | // If not, this function returns %FALSE. | |
| 440 | 439 | func (x *Event) GetAngle(Event2Var *Event, AngleVar float64) bool { | |
| 441 | 440 | ||
| 442 | - | return xEventGetAngle(x.GoPointer(), Event2Var.GoPointer(), AngleVar) | |
| 443 | - | ||
| 441 | + | cret := xEventGetAngle(x.GoPointer(), Event2Var.GoPointer(), AngleVar) | |
| 442 | + | return cret | |
| 444 | 443 | } | |
| 445 | 444 | ||
| 446 | 445 | var xEventGetCenter func(uintptr, uintptr, float64, float64) bool | |
| @@ -451,8 +450,8 @@ var xEventGetCenter func(uintptr, uintptr, float64, float64) bool | |||
| 451 | 450 | // If not, this function returns %FALSE. | |
| 452 | 451 | func (x *Event) GetCenter(Event2Var *Event, XVar float64, YVar float64) bool { | |
| 453 | 452 | ||
| 454 | - | return xEventGetCenter(x.GoPointer(), Event2Var.GoPointer(), XVar, YVar) | |
| 455 | - | ||
| 453 | + | cret := xEventGetCenter(x.GoPointer(), Event2Var.GoPointer(), XVar, YVar) | |
| 454 | + | return cret | |
| 456 | 455 | } | |
| 457 | 456 | ||
| 458 | 457 | var xEventGetDistance func(uintptr, uintptr, float64) bool | |
| @@ -463,8 +462,8 @@ var xEventGetDistance func(uintptr, uintptr, float64) bool | |||
| 463 | 462 | // If not, this function returns %FALSE. | |
| 464 | 463 | func (x *Event) GetDistance(Event2Var *Event, DistanceVar float64) bool { | |
| 465 | 464 | ||
| 466 | - | return xEventGetDistance(x.GoPointer(), Event2Var.GoPointer(), DistanceVar) | |
| 467 | - | ||
| 465 | + | cret := xEventGetDistance(x.GoPointer(), Event2Var.GoPointer(), DistanceVar) | |
| 466 | + | return cret | |
| 468 | 467 | } | |
| 469 | 468 | ||
| 470 | 469 | var xEventGetAxes func(uintptr, uintptr, uint) bool | |
| @@ -475,8 +474,8 @@ var xEventGetAxes func(uintptr, uintptr, uint) bool | |||
| 475 | 474 | // on the device tool returned by [method@Gdk.Event.get_device_tool]. | |
| 476 | 475 | func (x *Event) GetAxes(AxesVar uintptr, NAxesVar uint) bool { | |
| 477 | 476 | ||
| 478 | - | return xEventGetAxes(x.GoPointer(), AxesVar, NAxesVar) | |
| 479 | - | ||
| 477 | + | cret := xEventGetAxes(x.GoPointer(), AxesVar, NAxesVar) | |
| 478 | + | return cret | |
| 480 | 479 | } | |
| 481 | 480 | ||
| 482 | 481 | var xEventGetAxis func(uintptr, AxisUse, float64) bool | |
| @@ -488,26 +487,25 @@ var xEventGetAxis func(uintptr, AxisUse, float64) bool | |||
| 488 | 487 | // on the device tool returned by [method@Gdk.Event.get_device_tool]. | |
| 489 | 488 | func (x *Event) GetAxis(AxisUseVar AxisUse, ValueVar float64) bool { | |
| 490 | 489 | ||
| 491 | - | return xEventGetAxis(x.GoPointer(), AxisUseVar, ValueVar) | |
| 492 | - | ||
| 490 | + | cret := xEventGetAxis(x.GoPointer(), AxisUseVar, ValueVar) | |
| 491 | + | return cret | |
| 493 | 492 | } | |
| 494 | 493 | ||
| 495 | 494 | var xEventGetDevice func(uintptr) uintptr | |
| 496 | 495 | ||
| 497 | 496 | // Returns the device of an event. | |
| 498 | 497 | func (x *Event) GetDevice() *Device { | |
| 498 | + | var cls *Device | |
| 499 | 499 | ||
| 500 | - | GetDevicePtr := xEventGetDevice(x.GoPointer()) | |
| 501 | - | if GetDevicePtr == 0 { | |
| 502 | - | return nil | |
| 503 | - | } | |
| 504 | - | ||
| 505 | - | gobject.IncreaseRef(GetDevicePtr) | |
| 506 | - | ||
| 507 | - | GetDeviceCls := &Device{} | |
| 508 | - | GetDeviceCls.Ptr = GetDevicePtr | |
| 509 | - | return GetDeviceCls | |
| 500 | + | cret := xEventGetDevice(x.GoPointer()) | |
| 510 | 501 | ||
| 502 | + | if cret == 0 { | |
| 503 | + | return cls | |
| 504 | + | } | |
| 505 | + | gobject.IncreaseRef(cret) | |
| 506 | + | cls = &Device{} | |
| 507 | + | cls.Ptr = cret | |
| 508 | + | return cls | |
| 511 | 509 | } | |
| 512 | 510 | ||
| 513 | 511 | var xEventGetDeviceTool func(uintptr) uintptr | |
| @@ -523,36 +521,34 @@ var xEventGetDeviceTool func(uintptr) uintptr | |||
| 523 | 521 | // the application lifetime, if settings must be stored | |
| 524 | 522 | // persistently across runs, see [method@Gdk.DeviceTool.get_serial]. | |
| 525 | 523 | func (x *Event) GetDeviceTool() *DeviceTool { | |
| 524 | + | var cls *DeviceTool | |
| 526 | 525 | ||
| 527 | - | GetDeviceToolPtr := xEventGetDeviceTool(x.GoPointer()) | |
| 528 | - | if GetDeviceToolPtr == 0 { | |
| 529 | - | return nil | |
| 530 | - | } | |
| 531 | - | ||
| 532 | - | gobject.IncreaseRef(GetDeviceToolPtr) | |
| 533 | - | ||
| 534 | - | GetDeviceToolCls := &DeviceTool{} | |
| 535 | - | GetDeviceToolCls.Ptr = GetDeviceToolPtr | |
| 536 | - | return GetDeviceToolCls | |
| 526 | + | cret := xEventGetDeviceTool(x.GoPointer()) | |
| 537 | 527 | ||
| 528 | + | if cret == 0 { | |
| 529 | + | return cls | |
| 530 | + | } | |
| 531 | + | gobject.IncreaseRef(cret) | |
| 532 | + | cls = &DeviceTool{} | |
| 533 | + | cls.Ptr = cret | |
| 534 | + | return cls | |
| 538 | 535 | } | |
| 539 | 536 | ||
| 540 | 537 | var xEventGetDisplay func(uintptr) uintptr | |
| 541 | 538 | ||
| 542 | 539 | // Retrieves the display associated to the @event. | |
| 543 | 540 | func (x *Event) GetDisplay() *Display { | |
| 541 | + | var cls *Display | |
| 544 | 542 | ||
| 545 | - | GetDisplayPtr := xEventGetDisplay(x.GoPointer()) | |
| 546 | - | if GetDisplayPtr == 0 { | |
| 547 | - | return nil | |
| 548 | - | } | |
| 549 | - | ||
| 550 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 551 | - | ||
| 552 | - | GetDisplayCls := &Display{} | |
| 553 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 554 | - | return GetDisplayCls | |
| 543 | + | cret := xEventGetDisplay(x.GoPointer()) | |
| 555 | 544 | ||
| 545 | + | if cret == 0 { | |
| 546 | + | return cls | |
| 547 | + | } | |
| 548 | + | gobject.IncreaseRef(cret) | |
| 549 | + | cls = &Display{} | |
| 550 | + | cls.Ptr = cret | |
| 551 | + | return cls | |
| 556 | 552 | } | |
| 557 | 553 | ||
| 558 | 554 | var xEventGetEventSequence func(uintptr) *EventSequence | |
| @@ -563,8 +559,8 @@ var xEventGetEventSequence func(uintptr) *EventSequence | |||
| 563 | 559 | // events typically don't have event sequence information. | |
| 564 | 560 | func (x *Event) GetEventSequence() *EventSequence { | |
| 565 | 561 | ||
| 566 | - | return xEventGetEventSequence(x.GoPointer()) | |
| 567 | - | ||
| 562 | + | cret := xEventGetEventSequence(x.GoPointer()) | |
| 563 | + | return cret | |
| 568 | 564 | } | |
| 569 | 565 | ||
| 570 | 566 | var xEventGetEventType func(uintptr) EventType | |
| @@ -572,8 +568,8 @@ var xEventGetEventType func(uintptr) EventType | |||
| 572 | 568 | // Retrieves the type of the event. | |
| 573 | 569 | func (x *Event) GetEventType() EventType { | |
| 574 | 570 | ||
| 575 | - | return xEventGetEventType(x.GoPointer()) | |
| 576 | - | ||
| 571 | + | cret := xEventGetEventType(x.GoPointer()) | |
| 572 | + | return cret | |
| 577 | 573 | } | |
| 578 | 574 | ||
| 579 | 575 | var xEventGetHistory func(uintptr, uint) uintptr | |
| @@ -589,8 +585,8 @@ var xEventGetHistory func(uintptr, uint) uintptr | |||
| 589 | 585 | // has a tool. | |
| 590 | 586 | func (x *Event) GetHistory(OutNCoordsVar uint) uintptr { | |
| 591 | 587 | ||
| 592 | - | return xEventGetHistory(x.GoPointer(), OutNCoordsVar) | |
| 593 | - | ||
| 588 | + | cret := xEventGetHistory(x.GoPointer(), OutNCoordsVar) | |
| 589 | + | return cret | |
| 594 | 590 | } | |
| 595 | 591 | ||
| 596 | 592 | var xEventGetModifierState func(uintptr) ModifierType | |
| @@ -598,8 +594,8 @@ var xEventGetModifierState func(uintptr) ModifierType | |||
| 598 | 594 | // Returns the modifier state field of an event. | |
| 599 | 595 | func (x *Event) GetModifierState() ModifierType { | |
| 600 | 596 | ||
| 601 | - | return xEventGetModifierState(x.GoPointer()) | |
| 602 | - | ||
| 597 | + | cret := xEventGetModifierState(x.GoPointer()) | |
| 598 | + | return cret | |
| 603 | 599 | } | |
| 604 | 600 | ||
| 605 | 601 | var xEventGetPointerEmulated func(uintptr) bool | |
| @@ -609,8 +605,8 @@ var xEventGetPointerEmulated func(uintptr) bool | |||
| 609 | 605 | // Emulated pointer events typically originate from a touch events. | |
| 610 | 606 | func (x *Event) GetPointerEmulated() bool { | |
| 611 | 607 | ||
| 612 | - | return xEventGetPointerEmulated(x.GoPointer()) | |
| 613 | - | ||
| 608 | + | cret := xEventGetPointerEmulated(x.GoPointer()) | |
| 609 | + | return cret | |
| 614 | 610 | } | |
| 615 | 611 | ||
| 616 | 612 | var xEventGetPosition func(uintptr, float64, float64) bool | |
| @@ -618,44 +614,42 @@ var xEventGetPosition func(uintptr, float64, float64) bool | |||
| 618 | 614 | // Extract the event surface relative x/y coordinates from an event. | |
| 619 | 615 | func (x *Event) GetPosition(XVar float64, YVar float64) bool { | |
| 620 | 616 | ||
| 621 | - | return xEventGetPosition(x.GoPointer(), XVar, YVar) | |
| 622 | - | ||
| 617 | + | cret := xEventGetPosition(x.GoPointer(), XVar, YVar) | |
| 618 | + | return cret | |
| 623 | 619 | } | |
| 624 | 620 | ||
| 625 | 621 | var xEventGetSeat func(uintptr) uintptr | |
| 626 | 622 | ||
| 627 | 623 | // Returns the seat that originated the event. | |
| 628 | 624 | func (x *Event) GetSeat() *Seat { | |
| 625 | + | var cls *Seat | |
| 629 | 626 | ||
| 630 | - | GetSeatPtr := xEventGetSeat(x.GoPointer()) | |
| 631 | - | if GetSeatPtr == 0 { | |
| 632 | - | return nil | |
| 633 | - | } | |
| 634 | - | ||
| 635 | - | gobject.IncreaseRef(GetSeatPtr) | |
| 636 | - | ||
| 637 | - | GetSeatCls := &Seat{} | |
| 638 | - | GetSeatCls.Ptr = GetSeatPtr | |
| 639 | - | return GetSeatCls | |
| 627 | + | cret := xEventGetSeat(x.GoPointer()) | |
| 640 | 628 | ||
| 629 | + | if cret == 0 { | |
| 630 | + | return cls | |
| 631 | + | } | |
| 632 | + | gobject.IncreaseRef(cret) | |
| 633 | + | cls = &Seat{} | |
| 634 | + | cls.Ptr = cret | |
| 635 | + | return cls | |
| 641 | 636 | } | |
| 642 | 637 | ||
| 643 | 638 | var xEventGetSurface func(uintptr) uintptr | |
| 644 | 639 | ||
| 645 | 640 | // Extracts the surface associated with an event. | |
| 646 | 641 | func (x *Event) GetSurface() *Surface { | |
| 642 | + | var cls *Surface | |
| 647 | 643 | ||
| 648 | - | GetSurfacePtr := xEventGetSurface(x.GoPointer()) | |
| 649 | - | if GetSurfacePtr == 0 { | |
| 650 | - | return nil | |
| 651 | - | } | |
| 652 | - | ||
| 653 | - | gobject.IncreaseRef(GetSurfacePtr) | |
| 654 | - | ||
| 655 | - | GetSurfaceCls := &Surface{} | |
| 656 | - | GetSurfaceCls.Ptr = GetSurfacePtr | |
| 657 | - | return GetSurfaceCls | |
| 644 | + | cret := xEventGetSurface(x.GoPointer()) | |
| 658 | 645 | ||
| 646 | + | if cret == 0 { | |
| 647 | + | return cls | |
| 648 | + | } | |
| 649 | + | gobject.IncreaseRef(cret) | |
| 650 | + | cls = &Surface{} | |
| 651 | + | cls.Ptr = cret | |
| 652 | + | return cls | |
| 659 | 653 | } | |
| 660 | 654 | ||
| 661 | 655 | var xEventGetTime func(uintptr) uint32 | |
| @@ -666,24 +660,24 @@ var xEventGetTime func(uintptr) uint32 | |||
| 666 | 660 | // returns %GDK_CURRENT_TIME. | |
| 667 | 661 | func (x *Event) GetTime() uint32 { | |
| 668 | 662 | ||
| 669 | - | return xEventGetTime(x.GoPointer()) | |
| 670 | - | ||
| 663 | + | cret := xEventGetTime(x.GoPointer()) | |
| 664 | + | return cret | |
| 671 | 665 | } | |
| 672 | 666 | ||
| 673 | 667 | var xEventRef func(uintptr) uintptr | |
| 674 | 668 | ||
| 675 | 669 | // Increase the ref count of @event. | |
| 676 | 670 | func (x *Event) Ref() *Event { | |
| 671 | + | var cls *Event | |
| 677 | 672 | ||
| 678 | - | RefPtr := xEventRef(x.GoPointer()) | |
| 679 | - | if RefPtr == 0 { | |
| 680 | - | return nil | |
| 681 | - | } | |
| 682 | - | ||
| 683 | - | RefCls := &Event{} | |
| 684 | - | RefCls.Ptr = RefPtr | |
| 685 | - | return RefCls | |
| 673 | + | cret := xEventRef(x.GoPointer()) | |
| 686 | 674 | ||
| 675 | + | if cret == 0 { | |
| 676 | + | return cls | |
| 677 | + | } | |
| 678 | + | cls = &Event{} | |
| 679 | + | cls.Ptr = cret | |
| 680 | + | return cls | |
| 687 | 681 | } | |
| 688 | 682 | ||
| 689 | 683 | var xEventTriggersContextMenu func(uintptr) bool | |
| @@ -697,8 +691,8 @@ var xEventTriggersContextMenu func(uintptr) bool | |||
| 697 | 691 | // event->button == %GDK_BUTTON_SECONDARY. | |
| 698 | 692 | func (x *Event) TriggersContextMenu() bool { | |
| 699 | 693 | ||
| 700 | - | return xEventTriggersContextMenu(x.GoPointer()) | |
| 701 | - | ||
| 694 | + | cret := xEventTriggersContextMenu(x.GoPointer()) | |
| 695 | + | return cret | |
| 702 | 696 | } | |
| 703 | 697 | ||
| 704 | 698 | var xEventUnref func(uintptr) | |
| @@ -737,8 +731,8 @@ var xFocusEventGetIn func(uintptr) bool | |||
| 737 | 731 | // leaving the surface. | |
| 738 | 732 | func (x *FocusEvent) GetIn() bool { | |
| 739 | 733 | ||
| 740 | - | return xFocusEventGetIn(x.GoPointer()) | |
| 741 | - | ||
| 734 | + | cret := xFocusEventGetIn(x.GoPointer()) | |
| 735 | + | return cret | |
| 742 | 736 | } | |
| 743 | 737 | ||
| 744 | 738 | func (c *FocusEvent) GoPointer() uintptr { | |
| @@ -764,18 +758,17 @@ var xGrabBrokenEventGetGrabSurface func(uintptr) uintptr | |||
| 764 | 758 | ||
| 765 | 759 | // Extracts the grab surface from a grab broken event. | |
| 766 | 760 | func (x *GrabBrokenEvent) GetGrabSurface() *Surface { | |
| 761 | + | var cls *Surface | |
| 767 | 762 | ||
| 768 | - | GetGrabSurfacePtr := xGrabBrokenEventGetGrabSurface(x.GoPointer()) | |
| 769 | - | if GetGrabSurfacePtr == 0 { | |
| 770 | - | return nil | |
| 771 | - | } | |
| 772 | - | ||
| 773 | - | gobject.IncreaseRef(GetGrabSurfacePtr) | |
| 774 | - | ||
| 775 | - | GetGrabSurfaceCls := &Surface{} | |
| 776 | - | GetGrabSurfaceCls.Ptr = GetGrabSurfacePtr | |
| 777 | - | return GetGrabSurfaceCls | |
| 763 | + | cret := xGrabBrokenEventGetGrabSurface(x.GoPointer()) | |
| 778 | 764 | ||
| 765 | + | if cret == 0 { | |
| 766 | + | return cls | |
| 767 | + | } | |
| 768 | + | gobject.IncreaseRef(cret) | |
| 769 | + | cls = &Surface{} | |
| 770 | + | cls.Ptr = cret | |
| 771 | + | return cls | |
| 779 | 772 | } | |
| 780 | 773 | ||
| 781 | 774 | var xGrabBrokenEventGetImplicit func(uintptr) bool | |
| @@ -783,8 +776,8 @@ var xGrabBrokenEventGetImplicit func(uintptr) bool | |||
| 783 | 776 | // Checks whether the grab broken event is for an implicit grab. | |
| 784 | 777 | func (x *GrabBrokenEvent) GetImplicit() bool { | |
| 785 | 778 | ||
| 786 | - | return xGrabBrokenEventGetImplicit(x.GoPointer()) | |
| 787 | - | ||
| 779 | + | cret := xGrabBrokenEventGetImplicit(x.GoPointer()) | |
| 780 | + | return cret | |
| 788 | 781 | } | |
| 789 | 782 | ||
| 790 | 783 | func (c *GrabBrokenEvent) GoPointer() uintptr { | |
| @@ -811,8 +804,8 @@ var xKeyEventGetConsumedModifiers func(uintptr) ModifierType | |||
| 811 | 804 | // Extracts the consumed modifiers from a key event. | |
| 812 | 805 | func (x *KeyEvent) GetConsumedModifiers() ModifierType { | |
| 813 | 806 | ||
| 814 | - | return xKeyEventGetConsumedModifiers(x.GoPointer()) | |
| 815 | - | ||
| 807 | + | cret := xKeyEventGetConsumedModifiers(x.GoPointer()) | |
| 808 | + | return cret | |
| 816 | 809 | } | |
| 817 | 810 | ||
| 818 | 811 | var xKeyEventGetKeycode func(uintptr) uint | |
| @@ -820,8 +813,8 @@ var xKeyEventGetKeycode func(uintptr) uint | |||
| 820 | 813 | // Extracts the keycode from a key event. | |
| 821 | 814 | func (x *KeyEvent) GetKeycode() uint { | |
| 822 | 815 | ||
| 823 | - | return xKeyEventGetKeycode(x.GoPointer()) | |
| 824 | - | ||
| 816 | + | cret := xKeyEventGetKeycode(x.GoPointer()) | |
| 817 | + | return cret | |
| 825 | 818 | } | |
| 826 | 819 | ||
| 827 | 820 | var xKeyEventGetKeyval func(uintptr) uint | |
| @@ -829,8 +822,8 @@ var xKeyEventGetKeyval func(uintptr) uint | |||
| 829 | 822 | // Extracts the keyval from a key event. | |
| 830 | 823 | func (x *KeyEvent) GetKeyval() uint { | |
| 831 | 824 | ||
| 832 | - | return xKeyEventGetKeyval(x.GoPointer()) | |
| 833 | - | ||
| 825 | + | cret := xKeyEventGetKeyval(x.GoPointer()) | |
| 826 | + | return cret | |
| 834 | 827 | } | |
| 835 | 828 | ||
| 836 | 829 | var xKeyEventGetLayout func(uintptr) uint | |
| @@ -838,8 +831,8 @@ var xKeyEventGetLayout func(uintptr) uint | |||
| 838 | 831 | // Extracts the layout from a key event. | |
| 839 | 832 | func (x *KeyEvent) GetLayout() uint { | |
| 840 | 833 | ||
| 841 | - | return xKeyEventGetLayout(x.GoPointer()) | |
| 842 | - | ||
| 834 | + | cret := xKeyEventGetLayout(x.GoPointer()) | |
| 835 | + | return cret | |
| 843 | 836 | } | |
| 844 | 837 | ||
| 845 | 838 | var xKeyEventGetLevel func(uintptr) uint | |
| @@ -847,8 +840,8 @@ var xKeyEventGetLevel func(uintptr) uint | |||
| 847 | 840 | // Extracts the shift level from a key event. | |
| 848 | 841 | func (x *KeyEvent) GetLevel() uint { | |
| 849 | 842 | ||
| 850 | - | return xKeyEventGetLevel(x.GoPointer()) | |
| 851 | - | ||
| 843 | + | cret := xKeyEventGetLevel(x.GoPointer()) | |
| 844 | + | return cret | |
| 852 | 845 | } | |
| 853 | 846 | ||
| 854 | 847 | var xKeyEventGetMatch func(uintptr, uint, *ModifierType) bool | |
| @@ -859,8 +852,8 @@ var xKeyEventGetMatch func(uintptr, uint, *ModifierType) bool | |||
| 859 | 852 | // See [method@Gdk.KeyEvent.matches]. | |
| 860 | 853 | func (x *KeyEvent) GetMatch(KeyvalVar uint, ModifiersVar *ModifierType) bool { | |
| 861 | 854 | ||
| 862 | - | return xKeyEventGetMatch(x.GoPointer(), KeyvalVar, ModifiersVar) | |
| 863 | - | ||
| 855 | + | cret := xKeyEventGetMatch(x.GoPointer(), KeyvalVar, ModifiersVar) | |
| 856 | + | return cret | |
| 864 | 857 | } | |
| 865 | 858 | ||
| 866 | 859 | var xKeyEventIsModifier func(uintptr) bool | |
| @@ -868,8 +861,8 @@ var xKeyEventIsModifier func(uintptr) bool | |||
| 868 | 861 | // Extracts whether the key event is for a modifier key. | |
| 869 | 862 | func (x *KeyEvent) IsModifier() bool { | |
| 870 | 863 | ||
| 871 | - | return xKeyEventIsModifier(x.GoPointer()) | |
| 872 | - | ||
| 864 | + | cret := xKeyEventIsModifier(x.GoPointer()) | |
| 865 | + | return cret | |
| 873 | 866 | } | |
| 874 | 867 | ||
| 875 | 868 | var xKeyEventMatches func(uintptr, uint, ModifierType) KeyMatch | |
| @@ -884,8 +877,8 @@ var xKeyEventMatches func(uintptr, uint, ModifierType) KeyMatch | |||
| 884 | 877 | // Note that we ignore Caps Lock for matching. | |
| 885 | 878 | func (x *KeyEvent) Matches(KeyvalVar uint, ModifiersVar ModifierType) KeyMatch { | |
| 886 | 879 | ||
| 887 | - | return xKeyEventMatches(x.GoPointer(), KeyvalVar, ModifiersVar) | |
| 888 | - | ||
| 880 | + | cret := xKeyEventMatches(x.GoPointer(), KeyvalVar, ModifiersVar) | |
| 881 | + | return cret | |
| 889 | 882 | } | |
| 890 | 883 | ||
| 891 | 884 | func (c *KeyEvent) GoPointer() uintptr { | |
| @@ -941,8 +934,8 @@ var xPadEventGetButton func(uintptr) uint | |||
| 941 | 934 | // a pad event. | |
| 942 | 935 | func (x *PadEvent) GetButton() uint { | |
| 943 | 936 | ||
| 944 | - | return xPadEventGetButton(x.GoPointer()) | |
| 945 | - | ||
| 937 | + | cret := xPadEventGetButton(x.GoPointer()) | |
| 938 | + | return cret | |
| 946 | 939 | } | |
| 947 | 940 | ||
| 948 | 941 | var xPadEventGetGroupMode func(uintptr, uint, uint) | |
| @@ -1012,8 +1005,8 @@ var xScrollEventGetDirection func(uintptr) ScrollDirection | |||
| 1012 | 1005 | // Extracts the direction of a scroll event. | |
| 1013 | 1006 | func (x *ScrollEvent) GetDirection() ScrollDirection { | |
| 1014 | 1007 | ||
| 1015 | - | return xScrollEventGetDirection(x.GoPointer()) | |
| 1016 | - | ||
| 1008 | + | cret := xScrollEventGetDirection(x.GoPointer()) | |
| 1009 | + | return cret | |
| 1017 | 1010 | } | |
| 1018 | 1011 | ||
| 1019 | 1012 | var xScrollEventGetUnit func(uintptr) ScrollUnit | |
| @@ -1024,8 +1017,8 @@ var xScrollEventGetUnit func(uintptr) ScrollUnit | |||
| 1024 | 1017 | // %GDK_SCROLL_SMOOTH. | |
| 1025 | 1018 | func (x *ScrollEvent) GetUnit() ScrollUnit { | |
| 1026 | 1019 | ||
| 1027 | - | return xScrollEventGetUnit(x.GoPointer()) | |
| 1028 | - | ||
| 1020 | + | cret := xScrollEventGetUnit(x.GoPointer()) | |
| 1021 | + | return cret | |
| 1029 | 1022 | } | |
| 1030 | 1023 | ||
| 1031 | 1024 | var xScrollEventIsStop func(uintptr) bool | |
| @@ -1041,8 +1034,8 @@ var xScrollEventIsStop func(uintptr) bool | |||
| 1041 | 1034 | // Stop scroll events always have a delta of 0/0. | |
| 1042 | 1035 | func (x *ScrollEvent) IsStop() bool { | |
| 1043 | 1036 | ||
| 1044 | - | return xScrollEventIsStop(x.GoPointer()) | |
| 1045 | - | ||
| 1037 | + | cret := xScrollEventIsStop(x.GoPointer()) | |
| 1038 | + | return cret | |
| 1046 | 1039 | } | |
| 1047 | 1040 | ||
| 1048 | 1041 | func (c *ScrollEvent) GoPointer() uintptr { | |
| @@ -1069,8 +1062,8 @@ var xTouchEventGetEmulatingPointer func(uintptr) bool | |||
| 1069 | 1062 | // Extracts whether a touch event is emulating a pointer event. | |
| 1070 | 1063 | func (x *TouchEvent) GetEmulatingPointer() bool { | |
| 1071 | 1064 | ||
| 1072 | - | return xTouchEventGetEmulatingPointer(x.GoPointer()) | |
| 1073 | - | ||
| 1065 | + | cret := xTouchEventGetEmulatingPointer(x.GoPointer()) | |
| 1066 | + | return cret | |
| 1074 | 1067 | } | |
| 1075 | 1068 | ||
| 1076 | 1069 | func (c *TouchEvent) GoPointer() uintptr { | |
| @@ -1111,8 +1104,8 @@ var xTouchpadEventGetGesturePhase func(uintptr) TouchpadGesturePhase | |||
| 1111 | 1104 | // Extracts the touchpad gesture phase from a touchpad event. | |
| 1112 | 1105 | func (x *TouchpadEvent) GetGesturePhase() TouchpadGesturePhase { | |
| 1113 | 1106 | ||
| 1114 | - | return xTouchpadEventGetGesturePhase(x.GoPointer()) | |
| 1115 | - | ||
| 1107 | + | cret := xTouchpadEventGetGesturePhase(x.GoPointer()) | |
| 1108 | + | return cret | |
| 1116 | 1109 | } | |
| 1117 | 1110 | ||
| 1118 | 1111 | var xTouchpadEventGetNFingers func(uintptr) uint | |
| @@ -1120,8 +1113,8 @@ var xTouchpadEventGetNFingers func(uintptr) uint | |||
| 1120 | 1113 | // Extracts the number of fingers from a touchpad event. | |
| 1121 | 1114 | func (x *TouchpadEvent) GetNFingers() uint { | |
| 1122 | 1115 | ||
| 1123 | - | return xTouchpadEventGetNFingers(x.GoPointer()) | |
| 1124 | - | ||
| 1116 | + | cret := xTouchpadEventGetNFingers(x.GoPointer()) | |
| 1117 | + | return cret | |
| 1125 | 1118 | } | |
| 1126 | 1119 | ||
| 1127 | 1120 | var xTouchpadEventGetPinchAngleDelta func(uintptr) float64 | |
| @@ -1129,8 +1122,8 @@ var xTouchpadEventGetPinchAngleDelta func(uintptr) float64 | |||
| 1129 | 1122 | // Extracts the angle delta from a touchpad pinch event. | |
| 1130 | 1123 | func (x *TouchpadEvent) GetPinchAngleDelta() float64 { | |
| 1131 | 1124 | ||
| 1132 | - | return xTouchpadEventGetPinchAngleDelta(x.GoPointer()) | |
| 1133 | - | ||
| 1125 | + | cret := xTouchpadEventGetPinchAngleDelta(x.GoPointer()) | |
| 1126 | + | return cret | |
| 1134 | 1127 | } | |
| 1135 | 1128 | ||
| 1136 | 1129 | var xTouchpadEventGetPinchScale func(uintptr) float64 | |
| @@ -1138,8 +1131,8 @@ var xTouchpadEventGetPinchScale func(uintptr) float64 | |||
| 1138 | 1131 | // Extracts the scale from a touchpad pinch event. | |
| 1139 | 1132 | func (x *TouchpadEvent) GetPinchScale() float64 { | |
| 1140 | 1133 | ||
| 1141 | - | return xTouchpadEventGetPinchScale(x.GoPointer()) | |
| 1142 | - | ||
| 1134 | + | cret := xTouchpadEventGetPinchScale(x.GoPointer()) | |
| 1135 | + | return cret | |
| 1143 | 1136 | } | |
| 1144 | 1137 | ||
| 1145 | 1138 | func (c *TouchpadEvent) GoPointer() uintptr { | |
M v4/gdk/gdkframeclock.go +12 -12
| @@ -112,8 +112,8 @@ var xFrameClockGetCurrentTimings func(uintptr) *FrameTimings | |||
| 112 | 112 | // Gets the frame timings for the current frame. | |
| 113 | 113 | func (x *FrameClock) GetCurrentTimings() *FrameTimings { | |
| 114 | 114 | ||
| 115 | - | return xFrameClockGetCurrentTimings(x.GoPointer()) | |
| 116 | - | ||
| 115 | + | cret := xFrameClockGetCurrentTimings(x.GoPointer()) | |
| 116 | + | return cret | |
| 117 | 117 | } | |
| 118 | 118 | ||
| 119 | 119 | var xFrameClockGetFps func(uintptr) float64 | |
| @@ -122,8 +122,8 @@ var xFrameClockGetFps func(uintptr) float64 | |||
| 122 | 122 | // frame timings of @frame_clock. | |
| 123 | 123 | func (x *FrameClock) GetFps() float64 { | |
| 124 | 124 | ||
| 125 | - | return xFrameClockGetFps(x.GoPointer()) | |
| 126 | - | ||
| 125 | + | cret := xFrameClockGetFps(x.GoPointer()) | |
| 126 | + | return cret | |
| 127 | 127 | } | |
| 128 | 128 | ||
| 129 | 129 | var xFrameClockGetFrameCounter func(uintptr) int64 | |
| @@ -132,8 +132,8 @@ var xFrameClockGetFrameCounter func(uintptr) int64 | |||
| 132 | 132 | // each frame drawn. | |
| 133 | 133 | func (x *FrameClock) GetFrameCounter() int64 { | |
| 134 | 134 | ||
| 135 | - | return xFrameClockGetFrameCounter(x.GoPointer()) | |
| 136 | - | ||
| 135 | + | cret := xFrameClockGetFrameCounter(x.GoPointer()) | |
| 136 | + | return cret | |
| 137 | 137 | } | |
| 138 | 138 | ||
| 139 | 139 | var xFrameClockGetFrameTime func(uintptr) int64 | |
| @@ -147,8 +147,8 @@ var xFrameClockGetFrameTime func(uintptr) int64 | |||
| 147 | 147 | // time. | |
| 148 | 148 | func (x *FrameClock) GetFrameTime() int64 { | |
| 149 | 149 | ||
| 150 | - | return xFrameClockGetFrameTime(x.GoPointer()) | |
| 151 | - | ||
| 150 | + | cret := xFrameClockGetFrameTime(x.GoPointer()) | |
| 151 | + | return cret | |
| 152 | 152 | } | |
| 153 | 153 | ||
| 154 | 154 | var xFrameClockGetHistoryStart func(uintptr) int64 | |
| @@ -163,8 +163,8 @@ var xFrameClockGetHistoryStart func(uintptr) int64 | |||
| 163 | 163 | // [method@Gdk.FrameClock.get_frame_counter], inclusive. | |
| 164 | 164 | func (x *FrameClock) GetHistoryStart() int64 { | |
| 165 | 165 | ||
| 166 | - | return xFrameClockGetHistoryStart(x.GoPointer()) | |
| 167 | - | ||
| 166 | + | cret := xFrameClockGetHistoryStart(x.GoPointer()) | |
| 167 | + | return cret | |
| 168 | 168 | } | |
| 169 | 169 | ||
| 170 | 170 | var xFrameClockGetRefreshInfo func(uintptr, int64, int64, int64) | |
| @@ -192,8 +192,8 @@ var xFrameClockGetTimings func(uintptr, int64) *FrameTimings | |||
| 192 | 192 | // [method@Gdk.FrameClock.get_history_start]. | |
| 193 | 193 | func (x *FrameClock) GetTimings(FrameCounterVar int64) *FrameTimings { | |
| 194 | 194 | ||
| 195 | - | return xFrameClockGetTimings(x.GoPointer(), FrameCounterVar) | |
| 196 | - | ||
| 195 | + | cret := xFrameClockGetTimings(x.GoPointer(), FrameCounterVar) | |
| 196 | + | return cret | |
| 197 | 197 | } | |
| 198 | 198 | ||
| 199 | 199 | var xFrameClockRequestPhase func(uintptr, FrameClockPhase) | |
M v4/gdk/gdkglcontext.go +49 -46
| @@ -4,6 +4,7 @@ package gdk | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -82,8 +83,8 @@ var xGLContextGetAllowedApis func(uintptr) GLAPI | |||
| 82 | 83 | // Gets the allowed APIs set via gdk_gl_context_set_allowed_apis(). | |
| 83 | 84 | func (x *GLContext) GetAllowedApis() GLAPI { | |
| 84 | 85 | ||
| 85 | - | return xGLContextGetAllowedApis(x.GoPointer()) | |
| 86 | - | ||
| 86 | + | cret := xGLContextGetAllowedApis(x.GoPointer()) | |
| 87 | + | return cret | |
| 87 | 88 | } | |
| 88 | 89 | ||
| 89 | 90 | var xGLContextGetApi func(uintptr) GLAPI | |
| @@ -93,8 +94,8 @@ var xGLContextGetApi func(uintptr) GLAPI | |||
| 93 | 94 | // If the renderer has not been realized yet, 0 is returned. | |
| 94 | 95 | func (x *GLContext) GetApi() GLAPI { | |
| 95 | 96 | ||
| 96 | - | return xGLContextGetApi(x.GoPointer()) | |
| 97 | - | ||
| 97 | + | cret := xGLContextGetApi(x.GoPointer()) | |
| 98 | + | return cret | |
| 98 | 99 | } | |
| 99 | 100 | ||
| 100 | 101 | var xGLContextGetDebugEnabled func(uintptr) bool | |
| @@ -104,26 +105,25 @@ var xGLContextGetDebugEnabled func(uintptr) bool | |||
| 104 | 105 | // See [method@Gdk.GLContext.set_debug_enabled]. | |
| 105 | 106 | func (x *GLContext) GetDebugEnabled() bool { | |
| 106 | 107 | ||
| 107 | - | return xGLContextGetDebugEnabled(x.GoPointer()) | |
| 108 | - | ||
| 108 | + | cret := xGLContextGetDebugEnabled(x.GoPointer()) | |
| 109 | + | return cret | |
| 109 | 110 | } | |
| 110 | 111 | ||
| 111 | 112 | var xGLContextGetDisplay func(uintptr) uintptr | |
| 112 | 113 | ||
| 113 | 114 | // Retrieves the display the @context is created for | |
| 114 | 115 | func (x *GLContext) GetDisplay() *Display { | |
| 116 | + | var cls *Display | |
| 115 | 117 | ||
| 116 | - | GetDisplayPtr := xGLContextGetDisplay(x.GoPointer()) | |
| 117 | - | if GetDisplayPtr == 0 { | |
| 118 | - | return nil | |
| 119 | - | } | |
| 120 | - | ||
| 121 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 122 | - | ||
| 123 | - | GetDisplayCls := &Display{} | |
| 124 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 125 | - | return GetDisplayCls | |
| 118 | + | cret := xGLContextGetDisplay(x.GoPointer()) | |
| 126 | 119 | ||
| 120 | + | if cret == 0 { | |
| 121 | + | return cls | |
| 122 | + | } | |
| 123 | + | gobject.IncreaseRef(cret) | |
| 124 | + | cls = &Display{} | |
| 125 | + | cls.Ptr = cret | |
| 126 | + | return cls | |
| 127 | 127 | } | |
| 128 | 128 | ||
| 129 | 129 | var xGLContextGetForwardCompatible func(uintptr) bool | |
| @@ -133,8 +133,8 @@ var xGLContextGetForwardCompatible func(uintptr) bool | |||
| 133 | 133 | // See [method@Gdk.GLContext.set_forward_compatible]. | |
| 134 | 134 | func (x *GLContext) GetForwardCompatible() bool { | |
| 135 | 135 | ||
| 136 | - | return xGLContextGetForwardCompatible(x.GoPointer()) | |
| 137 | - | ||
| 136 | + | cret := xGLContextGetForwardCompatible(x.GoPointer()) | |
| 137 | + | return cret | |
| 138 | 138 | } | |
| 139 | 139 | ||
| 140 | 140 | var xGLContextGetRequiredVersion func(uintptr, int, int) | |
| @@ -158,36 +158,34 @@ var xGLContextGetSharedContext func(uintptr) uintptr | |||
| 158 | 158 | // As many contexts can share data now and no single shared context exists | |
| 159 | 159 | // anymore, this function has been deprecated and now always returns %NULL. | |
| 160 | 160 | func (x *GLContext) GetSharedContext() *GLContext { | |
| 161 | + | var cls *GLContext | |
| 161 | 162 | ||
| 162 | - | GetSharedContextPtr := xGLContextGetSharedContext(x.GoPointer()) | |
| 163 | - | if GetSharedContextPtr == 0 { | |
| 164 | - | return nil | |
| 165 | - | } | |
| 166 | - | ||
| 167 | - | gobject.IncreaseRef(GetSharedContextPtr) | |
| 168 | - | ||
| 169 | - | GetSharedContextCls := &GLContext{} | |
| 170 | - | GetSharedContextCls.Ptr = GetSharedContextPtr | |
| 171 | - | return GetSharedContextCls | |
| 163 | + | cret := xGLContextGetSharedContext(x.GoPointer()) | |
| 172 | 164 | ||
| 165 | + | if cret == 0 { | |
| 166 | + | return cls | |
| 167 | + | } | |
| 168 | + | gobject.IncreaseRef(cret) | |
| 169 | + | cls = &GLContext{} | |
| 170 | + | cls.Ptr = cret | |
| 171 | + | return cls | |
| 173 | 172 | } | |
| 174 | 173 | ||
| 175 | 174 | var xGLContextGetSurface func(uintptr) uintptr | |
| 176 | 175 | ||
| 177 | 176 | // Retrieves the surface used by the @context. | |
| 178 | 177 | func (x *GLContext) GetSurface() *Surface { | |
| 178 | + | var cls *Surface | |
| 179 | 179 | ||
| 180 | - | GetSurfacePtr := xGLContextGetSurface(x.GoPointer()) | |
| 181 | - | if GetSurfacePtr == 0 { | |
| 182 | - | return nil | |
| 183 | - | } | |
| 184 | - | ||
| 185 | - | gobject.IncreaseRef(GetSurfacePtr) | |
| 186 | - | ||
| 187 | - | GetSurfaceCls := &Surface{} | |
| 188 | - | GetSurfaceCls.Ptr = GetSurfacePtr | |
| 189 | - | return GetSurfaceCls | |
| 180 | + | cret := xGLContextGetSurface(x.GoPointer()) | |
| 190 | 181 | ||
| 182 | + | if cret == 0 { | |
| 183 | + | return cls | |
| 184 | + | } | |
| 185 | + | gobject.IncreaseRef(cret) | |
| 186 | + | cls = &Surface{} | |
| 187 | + | cls.Ptr = cret | |
| 188 | + | return cls | |
| 191 | 189 | } | |
| 192 | 190 | ||
| 193 | 191 | var xGLContextGetUseEs func(uintptr) bool | |
| @@ -195,8 +193,8 @@ var xGLContextGetUseEs func(uintptr) bool | |||
| 195 | 193 | // Checks whether the @context is using an OpenGL or OpenGL ES profile. | |
| 196 | 194 | func (x *GLContext) GetUseEs() bool { | |
| 197 | 195 | ||
| 198 | - | return xGLContextGetUseEs(x.GoPointer()) | |
| 199 | - | ||
| 196 | + | cret := xGLContextGetUseEs(x.GoPointer()) | |
| 197 | + | return cret | |
| 200 | 198 | } | |
| 201 | 199 | ||
| 202 | 200 | var xGLContextGetVersion func(uintptr, int, int) | |
| @@ -233,8 +231,8 @@ var xGLContextIsLegacy func(uintptr) bool | |||
| 233 | 231 | // kind of shader programs to load. | |
| 234 | 232 | func (x *GLContext) IsLegacy() bool { | |
| 235 | 233 | ||
| 236 | - | return xGLContextIsLegacy(x.GoPointer()) | |
| 237 | - | ||
| 234 | + | cret := xGLContextIsLegacy(x.GoPointer()) | |
| 235 | + | return cret | |
| 238 | 236 | } | |
| 239 | 237 | ||
| 240 | 238 | var xGLContextIsShared func(uintptr, uintptr) bool | |
| @@ -253,8 +251,8 @@ var xGLContextIsShared func(uintptr, uintptr) bool | |||
| 253 | 251 | // is not, this function will return %FALSE. | |
| 254 | 252 | func (x *GLContext) IsShared(OtherVar *GLContext) bool { | |
| 255 | 253 | ||
| 256 | - | return xGLContextIsShared(x.GoPointer(), OtherVar.GoPointer()) | |
| 257 | - | ||
| 254 | + | cret := xGLContextIsShared(x.GoPointer(), OtherVar.GoPointer()) | |
| 255 | + | return cret | |
| 258 | 256 | } | |
| 259 | 257 | ||
| 260 | 258 | var xGLContextMakeCurrent func(uintptr) | |
| @@ -271,9 +269,14 @@ var xGLContextRealize func(uintptr) bool | |||
| 271 | 269 | // Realizes the given `GdkGLContext`. | |
| 272 | 270 | // | |
| 273 | 271 | // It is safe to call this function on a realized `GdkGLContext`. | |
| 274 | - | func (x *GLContext) Realize() bool { | |
| 272 | + | func (x *GLContext) Realize() (bool, error) { | |
| 273 | + | var cerr *glib.Error | |
| 275 | 274 | ||
| 276 | - | return xGLContextRealize(x.GoPointer()) | |
| 275 | + | cret := xGLContextRealize(x.GoPointer()) | |
| 276 | + | if cerr == nil { | |
| 277 | + | return cret, nil | |
| 278 | + | } | |
| 279 | + | return cret, cerr | |
| 277 | 280 | ||
| 278 | 281 | } | |
| 279 | 282 | ||
M v4/gdk/gdkgltexture.go +57 -45
| @@ -30,14 +30,16 @@ var xNewGLTexture func(uintptr, uint, int, int, uintptr, uintptr) uintptr | |||
| 30 | 30 | // which will happen when the GdkTexture object is finalized, or due to | |
| 31 | 31 | // an explicit call of [method@Gdk.GLTexture.release]. | |
| 32 | 32 | func NewGLTexture(ContextVar *GLContext, IdVar uint, WidthVar int, HeightVar int, DestroyVar glib.DestroyNotify, DataVar uintptr) *GLTexture { | |
| 33 | - | NewGLTexturePtr := xNewGLTexture(ContextVar.GoPointer(), IdVar, WidthVar, HeightVar, purego.NewCallback(DestroyVar), DataVar) | |
| 34 | - | if NewGLTexturePtr == 0 { | |
| 35 | - | return nil | |
| 36 | - | } | |
| 33 | + | var cls *GLTexture | |
| 34 | + | ||
| 35 | + | cret := xNewGLTexture(ContextVar.GoPointer(), IdVar, WidthVar, HeightVar, purego.NewCallback(DestroyVar), DataVar) | |
| 37 | 36 | ||
| 38 | - | NewGLTextureCls := &GLTexture{} | |
| 39 | - | NewGLTextureCls.Ptr = NewGLTexturePtr | |
| 40 | - | return NewGLTextureCls | |
| 37 | + | if cret == 0 { | |
| 38 | + | return cls | |
| 39 | + | } | |
| 40 | + | cls = &GLTexture{} | |
| 41 | + | cls.Ptr = cret | |
| 42 | + | return cls | |
| 41 | 43 | } | |
| 42 | 44 | ||
| 43 | 45 | var xGLTextureRelease func(uintptr) | |
| @@ -84,16 +86,16 @@ func (x *GLTexture) ComputeConcreteSize(SpecifiedWidthVar float64, SpecifiedHeig | |||
| 84 | 86 | // | |
| 85 | 87 | // If the @paintable is already immutable, it will return itself. | |
| 86 | 88 | func (x *GLTexture) GetCurrentImage() *PaintableBase { | |
| 89 | + | var cls *PaintableBase | |
| 87 | 90 | ||
| 88 | - | GetCurrentImagePtr := XGdkPaintableGetCurrentImage(x.GoPointer()) | |
| 89 | - | if GetCurrentImagePtr == 0 { | |
| 90 | - | return nil | |
| 91 | - | } | |
| 92 | - | ||
| 93 | - | GetCurrentImageCls := &PaintableBase{} | |
| 94 | - | GetCurrentImageCls.Ptr = GetCurrentImagePtr | |
| 95 | - | return GetCurrentImageCls | |
| 91 | + | cret := XGdkPaintableGetCurrentImage(x.GoPointer()) | |
| 96 | 92 | ||
| 93 | + | if cret == 0 { | |
| 94 | + | return cls | |
| 95 | + | } | |
| 96 | + | cls = &PaintableBase{} | |
| 97 | + | cls.Ptr = cret | |
| 98 | + | return cls | |
| 97 | 99 | } | |
| 98 | 100 | ||
| 99 | 101 | // Get flags for the paintable. | |
| @@ -103,8 +105,8 @@ func (x *GLTexture) GetCurrentImage() *PaintableBase { | |||
| 103 | 105 | // See [flags@Gdk.PaintableFlags] for the flags and what they mean. | |
| 104 | 106 | func (x *GLTexture) GetFlags() PaintableFlags { | |
| 105 | 107 | ||
| 106 | - | return XGdkPaintableGetFlags(x.GoPointer()) | |
| 107 | - | ||
| 108 | + | cret := XGdkPaintableGetFlags(x.GoPointer()) | |
| 109 | + | return cret | |
| 108 | 110 | } | |
| 109 | 111 | ||
| 110 | 112 | // Gets the preferred aspect ratio the @paintable would like to be displayed at. | |
| @@ -126,8 +128,8 @@ func (x *GLTexture) GetFlags() PaintableFlags { | |||
| 126 | 128 | // it returns 0. Negative values are never returned. | |
| 127 | 129 | func (x *GLTexture) GetIntrinsicAspectRatio() float64 { | |
| 128 | 130 | ||
| 129 | - | return XGdkPaintableGetIntrinsicAspectRatio(x.GoPointer()) | |
| 130 | - | ||
| 131 | + | cret := XGdkPaintableGetIntrinsicAspectRatio(x.GoPointer()) | |
| 132 | + | return cret | |
| 131 | 133 | } | |
| 132 | 134 | ||
| 133 | 135 | // Gets the preferred height the @paintable would like to be displayed at. | |
| @@ -142,8 +144,8 @@ func (x *GLTexture) GetIntrinsicAspectRatio() float64 { | |||
| 142 | 144 | // Negative values are never returned. | |
| 143 | 145 | func (x *GLTexture) GetIntrinsicHeight() int { | |
| 144 | 146 | ||
| 145 | - | return XGdkPaintableGetIntrinsicHeight(x.GoPointer()) | |
| 146 | - | ||
| 147 | + | cret := XGdkPaintableGetIntrinsicHeight(x.GoPointer()) | |
| 148 | + | return cret | |
| 147 | 149 | } | |
| 148 | 150 | ||
| 149 | 151 | // Gets the preferred width the @paintable would like to be displayed at. | |
| @@ -158,8 +160,8 @@ func (x *GLTexture) GetIntrinsicHeight() int { | |||
| 158 | 160 | // Negative values are never returned. | |
| 159 | 161 | func (x *GLTexture) GetIntrinsicWidth() int { | |
| 160 | 162 | ||
| 161 | - | return XGdkPaintableGetIntrinsicWidth(x.GoPointer()) | |
| 162 | - | ||
| 163 | + | cret := XGdkPaintableGetIntrinsicWidth(x.GoPointer()) | |
| 164 | + | return cret | |
| 163 | 165 | } | |
| 164 | 166 | ||
| 165 | 167 | // Called by implementations of `GdkPaintable` to invalidate their contents. | |
| @@ -208,8 +210,8 @@ func (x *GLTexture) Snapshot(SnapshotVar *Snapshot, WidthVar float64, HeightVar | |||
| 208 | 210 | // Checks if two icons are equal. | |
| 209 | 211 | func (x *GLTexture) Equal(Icon2Var gio.Icon) bool { | |
| 210 | 212 | ||
| 211 | - | return gio.XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 212 | - | ||
| 213 | + | cret := gio.XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 214 | + | return cret | |
| 213 | 215 | } | |
| 214 | 216 | ||
| 215 | 217 | // Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved | |
| @@ -219,8 +221,8 @@ func (x *GLTexture) Equal(Icon2Var gio.Icon) bool { | |||
| 219 | 221 | // (as opposed to over the network), and within the same file system namespace. | |
| 220 | 222 | func (x *GLTexture) Serialize() *glib.Variant { | |
| 221 | 223 | ||
| 222 | - | return gio.XGIconSerialize(x.GoPointer()) | |
| 223 | - | ||
| 224 | + | cret := gio.XGIconSerialize(x.GoPointer()) | |
| 225 | + | return cret | |
| 224 | 226 | } | |
| 225 | 227 | ||
| 226 | 228 | // Generates a textual representation of @icon that can be used for | |
| @@ -241,22 +243,27 @@ func (x *GLTexture) Serialize() *glib.Variant { | |||
| 241 | 243 | // the encoding is simply the name (such as `network-server`). | |
| 242 | 244 | func (x *GLTexture) ToString() string { | |
| 243 | 245 | ||
| 244 | - | return gio.XGIconToString(x.GoPointer()) | |
| 245 | - | ||
| 246 | + | cret := gio.XGIconToString(x.GoPointer()) | |
| 247 | + | return cret | |
| 246 | 248 | } | |
| 247 | 249 | ||
| 248 | 250 | // Loads a loadable icon. For the asynchronous version of this function, | |
| 249 | 251 | // see g_loadable_icon_load_async(). | |
| 250 | - | func (x *GLTexture) Load(SizeVar int, TypeVar string, CancellableVar *gio.Cancellable) *gio.InputStream { | |
| 252 | + | func (x *GLTexture) Load(SizeVar int, TypeVar string, CancellableVar *gio.Cancellable) (*gio.InputStream, error) { | |
| 253 | + | var cls *gio.InputStream | |
| 254 | + | var cerr *glib.Error | |
| 251 | 255 | ||
| 252 | - | LoadPtr := gio.XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer()) | |
| 253 | - | if LoadPtr == 0 { | |
| 254 | - | return nil | |
| 255 | - | } | |
| 256 | + | cret := gio.XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 256 | 257 | ||
| 257 | - | LoadCls := &gio.InputStream{} | |
| 258 | - | LoadCls.Ptr = LoadPtr | |
| 259 | - | return LoadCls | |
| 258 | + | if cret == 0 { | |
| 259 | + | return cls, cerr | |
| 260 | + | } | |
| 261 | + | cls = &gio.InputStream{} | |
| 262 | + | cls.Ptr = cret | |
| 263 | + | if cerr == nil { | |
| 264 | + | return cls, nil | |
| 265 | + | } | |
| 266 | + | return cls, cerr | |
| 260 | 267 | ||
| 261 | 268 | } | |
| 262 | 269 | ||
| @@ -270,16 +277,21 @@ func (x *GLTexture) LoadAsync(SizeVar int, CancellableVar *gio.Cancellable, Call | |||
| 270 | 277 | } | |
| 271 | 278 | ||
| 272 | 279 | // Finishes an asynchronous icon load started in g_loadable_icon_load_async(). | |
| 273 | - | func (x *GLTexture) LoadFinish(ResVar gio.AsyncResult, TypeVar string) *gio.InputStream { | |
| 280 | + | func (x *GLTexture) LoadFinish(ResVar gio.AsyncResult, TypeVar string) (*gio.InputStream, error) { | |
| 281 | + | var cls *gio.InputStream | |
| 282 | + | var cerr *glib.Error | |
| 274 | 283 | ||
| 275 | - | LoadFinishPtr := gio.XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar) | |
| 276 | - | if LoadFinishPtr == 0 { | |
| 277 | - | return nil | |
| 278 | - | } | |
| 284 | + | cret := gio.XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar, &cerr) | |
| 279 | 285 | ||
| 280 | - | LoadFinishCls := &gio.InputStream{} | |
| 281 | - | LoadFinishCls.Ptr = LoadFinishPtr | |
| 282 | - | return LoadFinishCls | |
| 286 | + | if cret == 0 { | |
| 287 | + | return cls, cerr | |
| 288 | + | } | |
| 289 | + | cls = &gio.InputStream{} | |
| 290 | + | cls.Ptr = cret | |
| 291 | + | if cerr == nil { | |
| 292 | + | return cls, nil | |
| 293 | + | } | |
| 294 | + | return cls, cerr | |
| 283 | 295 | ||
| 284 | 296 | } | |
| 285 | 297 | ||
M v4/gdk/gdkkeys.go +16 -16
| @@ -26,8 +26,8 @@ var xKeyvalFromName func(string) uint | |||
| 26 | 26 | // but without the leading “GDK_KEY_”. | |
| 27 | 27 | func KeyvalFromName(KeyvalNameVar string) uint { | |
| 28 | 28 | ||
| 29 | - | return xKeyvalFromName(KeyvalNameVar) | |
| 30 | - | ||
| 29 | + | cret := xKeyvalFromName(KeyvalNameVar) | |
| 30 | + | return cret | |
| 31 | 31 | } | |
| 32 | 32 | ||
| 33 | 33 | var xKeyvalIsLower func(uint) bool | |
| @@ -35,8 +35,8 @@ var xKeyvalIsLower func(uint) bool | |||
| 35 | 35 | // Returns %TRUE if the given key value is in lower case. | |
| 36 | 36 | func KeyvalIsLower(KeyvalVar uint) bool { | |
| 37 | 37 | ||
| 38 | - | return xKeyvalIsLower(KeyvalVar) | |
| 39 | - | ||
| 38 | + | cret := xKeyvalIsLower(KeyvalVar) | |
| 39 | + | return cret | |
| 40 | 40 | } | |
| 41 | 41 | ||
| 42 | 42 | var xKeyvalIsUpper func(uint) bool | |
| @@ -44,8 +44,8 @@ var xKeyvalIsUpper func(uint) bool | |||
| 44 | 44 | // Returns %TRUE if the given key value is in upper case. | |
| 45 | 45 | func KeyvalIsUpper(KeyvalVar uint) bool { | |
| 46 | 46 | ||
| 47 | - | return xKeyvalIsUpper(KeyvalVar) | |
| 48 | - | ||
| 47 | + | cret := xKeyvalIsUpper(KeyvalVar) | |
| 48 | + | return cret | |
| 49 | 49 | } | |
| 50 | 50 | ||
| 51 | 51 | var xKeyvalName func(uint) string | |
| @@ -57,8 +57,8 @@ var xKeyvalName func(uint) string | |||
| 57 | 57 | // but without the leading “GDK_KEY_”. | |
| 58 | 58 | func KeyvalName(KeyvalVar uint) string { | |
| 59 | 59 | ||
| 60 | - | return xKeyvalName(KeyvalVar) | |
| 61 | - | ||
| 60 | + | cret := xKeyvalName(KeyvalVar) | |
| 61 | + | return cret | |
| 62 | 62 | } | |
| 63 | 63 | ||
| 64 | 64 | var xKeyvalToLower func(uint) uint | |
| @@ -66,8 +66,8 @@ var xKeyvalToLower func(uint) uint | |||
| 66 | 66 | // Converts a key value to lower case, if applicable. | |
| 67 | 67 | func KeyvalToLower(KeyvalVar uint) uint { | |
| 68 | 68 | ||
| 69 | - | return xKeyvalToLower(KeyvalVar) | |
| 70 | - | ||
| 69 | + | cret := xKeyvalToLower(KeyvalVar) | |
| 70 | + | return cret | |
| 71 | 71 | } | |
| 72 | 72 | ||
| 73 | 73 | var xKeyvalToUnicode func(uint) uint32 | |
| @@ -80,8 +80,8 @@ var xKeyvalToUnicode func(uint) uint32 | |||
| 80 | 80 | // keyvals, such as %GDK_KEY_KP_Decimal. | |
| 81 | 81 | func KeyvalToUnicode(KeyvalVar uint) uint32 { | |
| 82 | 82 | ||
| 83 | - | return xKeyvalToUnicode(KeyvalVar) | |
| 84 | - | ||
| 83 | + | cret := xKeyvalToUnicode(KeyvalVar) | |
| 84 | + | return cret | |
| 85 | 85 | } | |
| 86 | 86 | ||
| 87 | 87 | var xKeyvalToUpper func(uint) uint | |
| @@ -89,8 +89,8 @@ var xKeyvalToUpper func(uint) uint | |||
| 89 | 89 | // Converts a key value to upper case, if applicable. | |
| 90 | 90 | func KeyvalToUpper(KeyvalVar uint) uint { | |
| 91 | 91 | ||
| 92 | - | return xKeyvalToUpper(KeyvalVar) | |
| 93 | - | ||
| 92 | + | cret := xKeyvalToUpper(KeyvalVar) | |
| 93 | + | return cret | |
| 94 | 94 | } | |
| 95 | 95 | ||
| 96 | 96 | var xUnicodeToKeyval func(uint32) uint | |
| @@ -98,8 +98,8 @@ var xUnicodeToKeyval func(uint32) uint | |||
| 98 | 98 | // Convert from a Unicode character to a key symbol. | |
| 99 | 99 | func UnicodeToKeyval(WcVar uint32) uint { | |
| 100 | 100 | ||
| 101 | - | return xUnicodeToKeyval(WcVar) | |
| 102 | - | ||
| 101 | + | cret := xUnicodeToKeyval(WcVar) | |
| 102 | + | return cret | |
| 103 | 103 | } | |
| 104 | 104 | ||
| 105 | 105 | func init() { | |
M v4/gdk/gdkmemorytexture.go +57 -45
| @@ -29,14 +29,16 @@ var xNewMemoryTexture func(int, int, MemoryFormat, *glib.Bytes, uint) uintptr | |||
| 29 | 29 | // The `GBytes` must contain @stride × @height pixels | |
| 30 | 30 | // in the given format. | |
| 31 | 31 | func NewMemoryTexture(WidthVar int, HeightVar int, FormatVar MemoryFormat, BytesVar *glib.Bytes, StrideVar uint) *MemoryTexture { | |
| 32 | - | NewMemoryTexturePtr := xNewMemoryTexture(WidthVar, HeightVar, FormatVar, BytesVar, StrideVar) | |
| 33 | - | if NewMemoryTexturePtr == 0 { | |
| 34 | - | return nil | |
| 35 | - | } | |
| 32 | + | var cls *MemoryTexture | |
| 33 | + | ||
| 34 | + | cret := xNewMemoryTexture(WidthVar, HeightVar, FormatVar, BytesVar, StrideVar) | |
| 36 | 35 | ||
| 37 | - | NewMemoryTextureCls := &MemoryTexture{} | |
| 38 | - | NewMemoryTextureCls.Ptr = NewMemoryTexturePtr | |
| 39 | - | return NewMemoryTextureCls | |
| 36 | + | if cret == 0 { | |
| 37 | + | return cls | |
| 38 | + | } | |
| 39 | + | cls = &MemoryTexture{} | |
| 40 | + | cls.Ptr = cret | |
| 41 | + | return cls | |
| 40 | 42 | } | |
| 41 | 43 | ||
| 42 | 44 | func (c *MemoryTexture) GoPointer() uintptr { | |
| @@ -70,16 +72,16 @@ func (x *MemoryTexture) ComputeConcreteSize(SpecifiedWidthVar float64, Specified | |||
| 70 | 72 | // | |
| 71 | 73 | // If the @paintable is already immutable, it will return itself. | |
| 72 | 74 | func (x *MemoryTexture) GetCurrentImage() *PaintableBase { | |
| 75 | + | var cls *PaintableBase | |
| 73 | 76 | ||
| 74 | - | GetCurrentImagePtr := XGdkPaintableGetCurrentImage(x.GoPointer()) | |
| 75 | - | if GetCurrentImagePtr == 0 { | |
| 76 | - | return nil | |
| 77 | - | } | |
| 78 | - | ||
| 79 | - | GetCurrentImageCls := &PaintableBase{} | |
| 80 | - | GetCurrentImageCls.Ptr = GetCurrentImagePtr | |
| 81 | - | return GetCurrentImageCls | |
| 77 | + | cret := XGdkPaintableGetCurrentImage(x.GoPointer()) | |
| 82 | 78 | ||
| 79 | + | if cret == 0 { | |
| 80 | + | return cls | |
| 81 | + | } | |
| 82 | + | cls = &PaintableBase{} | |
| 83 | + | cls.Ptr = cret | |
| 84 | + | return cls | |
| 83 | 85 | } | |
| 84 | 86 | ||
| 85 | 87 | // Get flags for the paintable. | |
| @@ -89,8 +91,8 @@ func (x *MemoryTexture) GetCurrentImage() *PaintableBase { | |||
| 89 | 91 | // See [flags@Gdk.PaintableFlags] for the flags and what they mean. | |
| 90 | 92 | func (x *MemoryTexture) GetFlags() PaintableFlags { | |
| 91 | 93 | ||
| 92 | - | return XGdkPaintableGetFlags(x.GoPointer()) | |
| 93 | - | ||
| 94 | + | cret := XGdkPaintableGetFlags(x.GoPointer()) | |
| 95 | + | return cret | |
| 94 | 96 | } | |
| 95 | 97 | ||
| 96 | 98 | // Gets the preferred aspect ratio the @paintable would like to be displayed at. | |
| @@ -112,8 +114,8 @@ func (x *MemoryTexture) GetFlags() PaintableFlags { | |||
| 112 | 114 | // it returns 0. Negative values are never returned. | |
| 113 | 115 | func (x *MemoryTexture) GetIntrinsicAspectRatio() float64 { | |
| 114 | 116 | ||
| 115 | - | return XGdkPaintableGetIntrinsicAspectRatio(x.GoPointer()) | |
| 116 | - | ||
| 117 | + | cret := XGdkPaintableGetIntrinsicAspectRatio(x.GoPointer()) | |
| 118 | + | return cret | |
| 117 | 119 | } | |
| 118 | 120 | ||
| 119 | 121 | // Gets the preferred height the @paintable would like to be displayed at. | |
| @@ -128,8 +130,8 @@ func (x *MemoryTexture) GetIntrinsicAspectRatio() float64 { | |||
| 128 | 130 | // Negative values are never returned. | |
| 129 | 131 | func (x *MemoryTexture) GetIntrinsicHeight() int { | |
| 130 | 132 | ||
| 131 | - | return XGdkPaintableGetIntrinsicHeight(x.GoPointer()) | |
| 132 | - | ||
| 133 | + | cret := XGdkPaintableGetIntrinsicHeight(x.GoPointer()) | |
| 134 | + | return cret | |
| 133 | 135 | } | |
| 134 | 136 | ||
| 135 | 137 | // Gets the preferred width the @paintable would like to be displayed at. | |
| @@ -144,8 +146,8 @@ func (x *MemoryTexture) GetIntrinsicHeight() int { | |||
| 144 | 146 | // Negative values are never returned. | |
| 145 | 147 | func (x *MemoryTexture) GetIntrinsicWidth() int { | |
| 146 | 148 | ||
| 147 | - | return XGdkPaintableGetIntrinsicWidth(x.GoPointer()) | |
| 148 | - | ||
| 149 | + | cret := XGdkPaintableGetIntrinsicWidth(x.GoPointer()) | |
| 150 | + | return cret | |
| 149 | 151 | } | |
| 150 | 152 | ||
| 151 | 153 | // Called by implementations of `GdkPaintable` to invalidate their contents. | |
| @@ -194,8 +196,8 @@ func (x *MemoryTexture) Snapshot(SnapshotVar *Snapshot, WidthVar float64, Height | |||
| 194 | 196 | // Checks if two icons are equal. | |
| 195 | 197 | func (x *MemoryTexture) Equal(Icon2Var gio.Icon) bool { | |
| 196 | 198 | ||
| 197 | - | return gio.XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 198 | - | ||
| 199 | + | cret := gio.XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 200 | + | return cret | |
| 199 | 201 | } | |
| 200 | 202 | ||
| 201 | 203 | // Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved | |
| @@ -205,8 +207,8 @@ func (x *MemoryTexture) Equal(Icon2Var gio.Icon) bool { | |||
| 205 | 207 | // (as opposed to over the network), and within the same file system namespace. | |
| 206 | 208 | func (x *MemoryTexture) Serialize() *glib.Variant { | |
| 207 | 209 | ||
| 208 | - | return gio.XGIconSerialize(x.GoPointer()) | |
| 209 | - | ||
| 210 | + | cret := gio.XGIconSerialize(x.GoPointer()) | |
| 211 | + | return cret | |
| 210 | 212 | } | |
| 211 | 213 | ||
| 212 | 214 | // Generates a textual representation of @icon that can be used for | |
| @@ -227,22 +229,27 @@ func (x *MemoryTexture) Serialize() *glib.Variant { | |||
| 227 | 229 | // the encoding is simply the name (such as `network-server`). | |
| 228 | 230 | func (x *MemoryTexture) ToString() string { | |
| 229 | 231 | ||
| 230 | - | return gio.XGIconToString(x.GoPointer()) | |
| 231 | - | ||
| 232 | + | cret := gio.XGIconToString(x.GoPointer()) | |
| 233 | + | return cret | |
| 232 | 234 | } | |
| 233 | 235 | ||
| 234 | 236 | // Loads a loadable icon. For the asynchronous version of this function, | |
| 235 | 237 | // see g_loadable_icon_load_async(). | |
| 236 | - | func (x *MemoryTexture) Load(SizeVar int, TypeVar string, CancellableVar *gio.Cancellable) *gio.InputStream { | |
| 238 | + | func (x *MemoryTexture) Load(SizeVar int, TypeVar string, CancellableVar *gio.Cancellable) (*gio.InputStream, error) { | |
| 239 | + | var cls *gio.InputStream | |
| 240 | + | var cerr *glib.Error | |
| 237 | 241 | ||
| 238 | - | LoadPtr := gio.XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer()) | |
| 239 | - | if LoadPtr == 0 { | |
| 240 | - | return nil | |
| 241 | - | } | |
| 242 | + | cret := gio.XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 242 | 243 | ||
| 243 | - | LoadCls := &gio.InputStream{} | |
| 244 | - | LoadCls.Ptr = LoadPtr | |
| 245 | - | return LoadCls | |
| 244 | + | if cret == 0 { | |
| 245 | + | return cls, cerr | |
| 246 | + | } | |
| 247 | + | cls = &gio.InputStream{} | |
| 248 | + | cls.Ptr = cret | |
| 249 | + | if cerr == nil { | |
| 250 | + | return cls, nil | |
| 251 | + | } | |
| 252 | + | return cls, cerr | |
| 246 | 253 | ||
| 247 | 254 | } | |
| 248 | 255 | ||
| @@ -256,16 +263,21 @@ func (x *MemoryTexture) LoadAsync(SizeVar int, CancellableVar *gio.Cancellable, | |||
| 256 | 263 | } | |
| 257 | 264 | ||
| 258 | 265 | // Finishes an asynchronous icon load started in g_loadable_icon_load_async(). | |
| 259 | - | func (x *MemoryTexture) LoadFinish(ResVar gio.AsyncResult, TypeVar string) *gio.InputStream { | |
| 266 | + | func (x *MemoryTexture) LoadFinish(ResVar gio.AsyncResult, TypeVar string) (*gio.InputStream, error) { | |
| 267 | + | var cls *gio.InputStream | |
| 268 | + | var cerr *glib.Error | |
| 260 | 269 | ||
| 261 | - | LoadFinishPtr := gio.XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar) | |
| 262 | - | if LoadFinishPtr == 0 { | |
| 263 | - | return nil | |
| 264 | - | } | |
| 270 | + | cret := gio.XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar, &cerr) | |
| 265 | 271 | ||
| 266 | - | LoadFinishCls := &gio.InputStream{} | |
| 267 | - | LoadFinishCls.Ptr = LoadFinishPtr | |
| 268 | - | return LoadFinishCls | |
| 272 | + | if cret == 0 { | |
| 273 | + | return cls, cerr | |
| 274 | + | } | |
| 275 | + | cls = &gio.InputStream{} | |
| 276 | + | cls.Ptr = cret | |
| 277 | + | if cerr == nil { | |
| 278 | + | return cls, nil | |
| 279 | + | } | |
| 280 | + | return cls, cerr | |
| 269 | 281 | ||
| 270 | 282 | } | |
| 271 | 283 | ||
M v4/gdk/gdkmonitor.go +27 -28
| @@ -52,26 +52,25 @@ var xMonitorGetConnector func(uintptr) string | |||
| 52 | 52 | // Gets the name of the monitor's connector, if available. | |
| 53 | 53 | func (x *Monitor) GetConnector() string { | |
| 54 | 54 | ||
| 55 | - | return xMonitorGetConnector(x.GoPointer()) | |
| 56 | - | ||
| 55 | + | cret := xMonitorGetConnector(x.GoPointer()) | |
| 56 | + | return cret | |
| 57 | 57 | } | |
| 58 | 58 | ||
| 59 | 59 | var xMonitorGetDisplay func(uintptr) uintptr | |
| 60 | 60 | ||
| 61 | 61 | // Gets the display that this monitor belongs to. | |
| 62 | 62 | func (x *Monitor) GetDisplay() *Display { | |
| 63 | + | var cls *Display | |
| 63 | 64 | ||
| 64 | - | GetDisplayPtr := xMonitorGetDisplay(x.GoPointer()) | |
| 65 | - | if GetDisplayPtr == 0 { | |
| 66 | - | return nil | |
| 67 | - | } | |
| 68 | - | ||
| 69 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 70 | - | ||
| 71 | - | GetDisplayCls := &Display{} | |
| 72 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 73 | - | return GetDisplayCls | |
| 65 | + | cret := xMonitorGetDisplay(x.GoPointer()) | |
| 74 | 66 | ||
| 67 | + | if cret == 0 { | |
| 68 | + | return cls | |
| 69 | + | } | |
| 70 | + | gobject.IncreaseRef(cret) | |
| 71 | + | cls = &Display{} | |
| 72 | + | cls.Ptr = cret | |
| 73 | + | return cls | |
| 75 | 74 | } | |
| 76 | 75 | ||
| 77 | 76 | var xMonitorGetGeometry func(uintptr, *Rectangle) | |
| @@ -92,8 +91,8 @@ var xMonitorGetHeightMm func(uintptr) int | |||
| 92 | 91 | // Gets the height in millimeters of the monitor. | |
| 93 | 92 | func (x *Monitor) GetHeightMm() int { | |
| 94 | 93 | ||
| 95 | - | return xMonitorGetHeightMm(x.GoPointer()) | |
| 96 | - | ||
| 94 | + | cret := xMonitorGetHeightMm(x.GoPointer()) | |
| 95 | + | return cret | |
| 97 | 96 | } | |
| 98 | 97 | ||
| 99 | 98 | var xMonitorGetManufacturer func(uintptr) string | |
| @@ -107,8 +106,8 @@ var xMonitorGetManufacturer func(uintptr) string | |||
| 107 | 106 | // [https://uefi.org/pnp_id_list](https://uefi.org/pnp_id_list). | |
| 108 | 107 | func (x *Monitor) GetManufacturer() string { | |
| 109 | 108 | ||
| 110 | - | return xMonitorGetManufacturer(x.GoPointer()) | |
| 111 | - | ||
| 109 | + | cret := xMonitorGetManufacturer(x.GoPointer()) | |
| 110 | + | return cret | |
| 112 | 111 | } | |
| 113 | 112 | ||
| 114 | 113 | var xMonitorGetModel func(uintptr) string | |
| @@ -116,8 +115,8 @@ var xMonitorGetModel func(uintptr) string | |||
| 116 | 115 | // Gets the string identifying the monitor model, if available. | |
| 117 | 116 | func (x *Monitor) GetModel() string { | |
| 118 | 117 | ||
| 119 | - | return xMonitorGetModel(x.GoPointer()) | |
| 120 | - | ||
| 118 | + | cret := xMonitorGetModel(x.GoPointer()) | |
| 119 | + | return cret | |
| 121 | 120 | } | |
| 122 | 121 | ||
| 123 | 122 | var xMonitorGetRefreshRate func(uintptr) int | |
| @@ -128,8 +127,8 @@ var xMonitorGetRefreshRate func(uintptr) int | |||
| 128 | 127 | // is returned as 60000. | |
| 129 | 128 | func (x *Monitor) GetRefreshRate() int { | |
| 130 | 129 | ||
| 131 | - | return xMonitorGetRefreshRate(x.GoPointer()) | |
| 132 | - | ||
| 130 | + | cret := xMonitorGetRefreshRate(x.GoPointer()) | |
| 131 | + | return cret | |
| 133 | 132 | } | |
| 134 | 133 | ||
| 135 | 134 | var xMonitorGetScaleFactor func(uintptr) int | |
| @@ -145,8 +144,8 @@ var xMonitorGetScaleFactor func(uintptr) int | |||
| 145 | 144 | // where it is better to use [method@Gdk.Surface.get_scale_factor] instead. | |
| 146 | 145 | func (x *Monitor) GetScaleFactor() int { | |
| 147 | 146 | ||
| 148 | - | return xMonitorGetScaleFactor(x.GoPointer()) | |
| 149 | - | ||
| 147 | + | cret := xMonitorGetScaleFactor(x.GoPointer()) | |
| 148 | + | return cret | |
| 150 | 149 | } | |
| 151 | 150 | ||
| 152 | 151 | var xMonitorGetSubpixelLayout func(uintptr) SubpixelLayout | |
| @@ -155,8 +154,8 @@ var xMonitorGetSubpixelLayout func(uintptr) SubpixelLayout | |||
| 155 | 154 | // primaries for pixels. | |
| 156 | 155 | func (x *Monitor) GetSubpixelLayout() SubpixelLayout { | |
| 157 | 156 | ||
| 158 | - | return xMonitorGetSubpixelLayout(x.GoPointer()) | |
| 159 | - | ||
| 157 | + | cret := xMonitorGetSubpixelLayout(x.GoPointer()) | |
| 158 | + | return cret | |
| 160 | 159 | } | |
| 161 | 160 | ||
| 162 | 161 | var xMonitorGetWidthMm func(uintptr) int | |
| @@ -164,8 +163,8 @@ var xMonitorGetWidthMm func(uintptr) int | |||
| 164 | 163 | // Gets the width in millimeters of the monitor. | |
| 165 | 164 | func (x *Monitor) GetWidthMm() int { | |
| 166 | 165 | ||
| 167 | - | return xMonitorGetWidthMm(x.GoPointer()) | |
| 168 | - | ||
| 166 | + | cret := xMonitorGetWidthMm(x.GoPointer()) | |
| 167 | + | return cret | |
| 169 | 168 | } | |
| 170 | 169 | ||
| 171 | 170 | var xMonitorIsValid func(uintptr) bool | |
| @@ -177,8 +176,8 @@ var xMonitorIsValid func(uintptr) bool | |||
| 177 | 176 | // is unplugged or removed. | |
| 178 | 177 | func (x *Monitor) IsValid() bool { | |
| 179 | 178 | ||
| 180 | - | return xMonitorIsValid(x.GoPointer()) | |
| 181 | - | ||
| 179 | + | cret := xMonitorIsValid(x.GoPointer()) | |
| 180 | + | return cret | |
| 182 | 181 | } | |
| 183 | 182 | ||
| 184 | 183 | func (c *Monitor) GoPointer() uintptr { | |
M v4/gdk/gdkpaintable.go +24 -24
| @@ -112,16 +112,16 @@ func (x *PaintableBase) ComputeConcreteSize(SpecifiedWidthVar float64, Specified | |||
| 112 | 112 | // | |
| 113 | 113 | // If the @paintable is already immutable, it will return itself. | |
| 114 | 114 | func (x *PaintableBase) GetCurrentImage() *PaintableBase { | |
| 115 | + | var cls *PaintableBase | |
| 115 | 116 | ||
| 116 | - | GetCurrentImagePtr := XGdkPaintableGetCurrentImage(x.GoPointer()) | |
| 117 | - | if GetCurrentImagePtr == 0 { | |
| 118 | - | return nil | |
| 119 | - | } | |
| 120 | - | ||
| 121 | - | GetCurrentImageCls := &PaintableBase{} | |
| 122 | - | GetCurrentImageCls.Ptr = GetCurrentImagePtr | |
| 123 | - | return GetCurrentImageCls | |
| 117 | + | cret := XGdkPaintableGetCurrentImage(x.GoPointer()) | |
| 124 | 118 | ||
| 119 | + | if cret == 0 { | |
| 120 | + | return cls | |
| 121 | + | } | |
| 122 | + | cls = &PaintableBase{} | |
| 123 | + | cls.Ptr = cret | |
| 124 | + | return cls | |
| 125 | 125 | } | |
| 126 | 126 | ||
| 127 | 127 | // Get flags for the paintable. | |
| @@ -131,8 +131,8 @@ func (x *PaintableBase) GetCurrentImage() *PaintableBase { | |||
| 131 | 131 | // See [flags@Gdk.PaintableFlags] for the flags and what they mean. | |
| 132 | 132 | func (x *PaintableBase) GetFlags() PaintableFlags { | |
| 133 | 133 | ||
| 134 | - | return XGdkPaintableGetFlags(x.GoPointer()) | |
| 135 | - | ||
| 134 | + | cret := XGdkPaintableGetFlags(x.GoPointer()) | |
| 135 | + | return cret | |
| 136 | 136 | } | |
| 137 | 137 | ||
| 138 | 138 | // Gets the preferred aspect ratio the @paintable would like to be displayed at. | |
| @@ -154,8 +154,8 @@ func (x *PaintableBase) GetFlags() PaintableFlags { | |||
| 154 | 154 | // it returns 0. Negative values are never returned. | |
| 155 | 155 | func (x *PaintableBase) GetIntrinsicAspectRatio() float64 { | |
| 156 | 156 | ||
| 157 | - | return XGdkPaintableGetIntrinsicAspectRatio(x.GoPointer()) | |
| 158 | - | ||
| 157 | + | cret := XGdkPaintableGetIntrinsicAspectRatio(x.GoPointer()) | |
| 158 | + | return cret | |
| 159 | 159 | } | |
| 160 | 160 | ||
| 161 | 161 | // Gets the preferred height the @paintable would like to be displayed at. | |
| @@ -170,8 +170,8 @@ func (x *PaintableBase) GetIntrinsicAspectRatio() float64 { | |||
| 170 | 170 | // Negative values are never returned. | |
| 171 | 171 | func (x *PaintableBase) GetIntrinsicHeight() int { | |
| 172 | 172 | ||
| 173 | - | return XGdkPaintableGetIntrinsicHeight(x.GoPointer()) | |
| 174 | - | ||
| 173 | + | cret := XGdkPaintableGetIntrinsicHeight(x.GoPointer()) | |
| 174 | + | return cret | |
| 175 | 175 | } | |
| 176 | 176 | ||
| 177 | 177 | // Gets the preferred width the @paintable would like to be displayed at. | |
| @@ -186,8 +186,8 @@ func (x *PaintableBase) GetIntrinsicHeight() int { | |||
| 186 | 186 | // Negative values are never returned. | |
| 187 | 187 | func (x *PaintableBase) GetIntrinsicWidth() int { | |
| 188 | 188 | ||
| 189 | - | return XGdkPaintableGetIntrinsicWidth(x.GoPointer()) | |
| 190 | - | ||
| 189 | + | cret := XGdkPaintableGetIntrinsicWidth(x.GoPointer()) | |
| 190 | + | return cret | |
| 191 | 191 | } | |
| 192 | 192 | ||
| 193 | 193 | // Called by implementations of `GdkPaintable` to invalidate their contents. | |
| @@ -269,16 +269,16 @@ var xPaintableNewEmpty func(int, int) uintptr | |||
| 269 | 269 | // when the paintable is in an incomplete state (like a | |
| 270 | 270 | // [class@Gtk.MediaStream] before receiving the first frame). | |
| 271 | 271 | func PaintableNewEmpty(IntrinsicWidthVar int, IntrinsicHeightVar int) *PaintableBase { | |
| 272 | + | var cls *PaintableBase | |
| 272 | 273 | ||
| 273 | - | PaintableNewEmptyPtr := xPaintableNewEmpty(IntrinsicWidthVar, IntrinsicHeightVar) | |
| 274 | - | if PaintableNewEmptyPtr == 0 { | |
| 275 | - | return nil | |
| 276 | - | } | |
| 277 | - | ||
| 278 | - | PaintableNewEmptyCls := &PaintableBase{} | |
| 279 | - | PaintableNewEmptyCls.Ptr = PaintableNewEmptyPtr | |
| 280 | - | return PaintableNewEmptyCls | |
| 274 | + | cret := xPaintableNewEmpty(IntrinsicWidthVar, IntrinsicHeightVar) | |
| 281 | 275 | ||
| 276 | + | if cret == 0 { | |
| 277 | + | return cls | |
| 278 | + | } | |
| 279 | + | cls = &PaintableBase{} | |
| 280 | + | cls.Ptr = cret | |
| 281 | + | return cls | |
| 282 | 282 | } | |
| 283 | 283 | ||
| 284 | 284 | func init() { | |
M v4/gdk/gdkpango.go +4 -4
| @@ -22,8 +22,8 @@ var xPangoLayoutGetClipRegion func(uintptr, int, int, int, int) *cairo.Region | |||
| 22 | 22 | // of text, such as when text is selected. | |
| 23 | 23 | func PangoLayoutGetClipRegion(LayoutVar *pango.Layout, XOriginVar int, YOriginVar int, IndexRangesVar int, NRangesVar int) *cairo.Region { | |
| 24 | 24 | ||
| 25 | - | return xPangoLayoutGetClipRegion(LayoutVar.GoPointer(), XOriginVar, YOriginVar, IndexRangesVar, NRangesVar) | |
| 26 | - | ||
| 25 | + | cret := xPangoLayoutGetClipRegion(LayoutVar.GoPointer(), XOriginVar, YOriginVar, IndexRangesVar, NRangesVar) | |
| 26 | + | return cret | |
| 27 | 27 | } | |
| 28 | 28 | ||
| 29 | 29 | var xPangoLayoutLineGetClipRegion func(*pango.LayoutLine, int, int, uintptr, int) *cairo.Region | |
| @@ -45,8 +45,8 @@ var xPangoLayoutLineGetClipRegion func(*pango.LayoutLine, int, int, uintptr, int | |||
| 45 | 45 | // of text, such as when text is selected. | |
| 46 | 46 | func PangoLayoutLineGetClipRegion(LineVar *pango.LayoutLine, XOriginVar int, YOriginVar int, IndexRangesVar uintptr, NRangesVar int) *cairo.Region { | |
| 47 | 47 | ||
| 48 | - | return xPangoLayoutLineGetClipRegion(LineVar, XOriginVar, YOriginVar, IndexRangesVar, NRangesVar) | |
| 49 | - | ||
| 48 | + | cret := xPangoLayoutLineGetClipRegion(LineVar, XOriginVar, YOriginVar, IndexRangesVar, NRangesVar) | |
| 49 | + | return cret | |
| 50 | 50 | } | |
| 51 | 51 | ||
| 52 | 52 | func init() { | |
M v4/gdk/gdkpixbuf.go +16 -16
| @@ -18,16 +18,16 @@ var xPixbufGetFromSurface func(*cairo.Surface, int, int, int, int) uintptr | |||
| 18 | 18 | // This function will create an RGB pixbuf with 8 bits per channel. | |
| 19 | 19 | // The pixbuf will contain an alpha channel if the @surface contains one. | |
| 20 | 20 | func PixbufGetFromSurface(SurfaceVar *cairo.Surface, SrcXVar int, SrcYVar int, WidthVar int, HeightVar int) *gdkpixbuf.Pixbuf { | |
| 21 | + | var cls *gdkpixbuf.Pixbuf | |
| 21 | 22 | ||
| 22 | - | PixbufGetFromSurfacePtr := xPixbufGetFromSurface(SurfaceVar, SrcXVar, SrcYVar, WidthVar, HeightVar) | |
| 23 | - | if PixbufGetFromSurfacePtr == 0 { | |
| 24 | - | return nil | |
| 25 | - | } | |
| 26 | - | ||
| 27 | - | PixbufGetFromSurfaceCls := &gdkpixbuf.Pixbuf{} | |
| 28 | - | PixbufGetFromSurfaceCls.Ptr = PixbufGetFromSurfacePtr | |
| 29 | - | return PixbufGetFromSurfaceCls | |
| 23 | + | cret := xPixbufGetFromSurface(SurfaceVar, SrcXVar, SrcYVar, WidthVar, HeightVar) | |
| 30 | 24 | ||
| 25 | + | if cret == 0 { | |
| 26 | + | return cls | |
| 27 | + | } | |
| 28 | + | cls = &gdkpixbuf.Pixbuf{} | |
| 29 | + | cls.Ptr = cret | |
| 30 | + | return cls | |
| 31 | 31 | } | |
| 32 | 32 | ||
| 33 | 33 | var xPixbufGetFromTexture func(uintptr) uintptr | |
| @@ -38,16 +38,16 @@ var xPixbufGetFromTexture func(uintptr) uintptr | |||
| 38 | 38 | // stages will almost certainly convert the pixbuf back into a texture | |
| 39 | 39 | // to draw it on screen. | |
| 40 | 40 | func PixbufGetFromTexture(TextureVar *Texture) *gdkpixbuf.Pixbuf { | |
| 41 | + | var cls *gdkpixbuf.Pixbuf | |
| 41 | 42 | ||
| 42 | - | PixbufGetFromTexturePtr := xPixbufGetFromTexture(TextureVar.GoPointer()) | |
| 43 | - | if PixbufGetFromTexturePtr == 0 { | |
| 44 | - | return nil | |
| 45 | - | } | |
| 46 | - | ||
| 47 | - | PixbufGetFromTextureCls := &gdkpixbuf.Pixbuf{} | |
| 48 | - | PixbufGetFromTextureCls.Ptr = PixbufGetFromTexturePtr | |
| 49 | - | return PixbufGetFromTextureCls | |
| 43 | + | cret := xPixbufGetFromTexture(TextureVar.GoPointer()) | |
| 50 | 44 | ||
| 45 | + | if cret == 0 { | |
| 46 | + | return cls | |
| 47 | + | } | |
| 48 | + | cls = &gdkpixbuf.Pixbuf{} | |
| 49 | + | cls.Ptr = cret | |
| 50 | + | return cls | |
| 51 | 51 | } | |
| 52 | 52 | ||
| 53 | 53 | func init() { | |
M v4/gdk/gdkpopup.go +21 -22
| @@ -43,38 +43,37 @@ func (x *PopupBase) SetGoPointer(ptr uintptr) { | |||
| 43 | 43 | // Returns whether this popup is set to hide on outside clicks. | |
| 44 | 44 | func (x *PopupBase) GetAutohide() bool { | |
| 45 | 45 | ||
| 46 | - | return XGdkPopupGetAutohide(x.GoPointer()) | |
| 47 | - | ||
| 46 | + | cret := XGdkPopupGetAutohide(x.GoPointer()) | |
| 47 | + | return cret | |
| 48 | 48 | } | |
| 49 | 49 | ||
| 50 | 50 | // Returns the parent surface of a popup. | |
| 51 | 51 | func (x *PopupBase) GetParent() *Surface { | |
| 52 | + | var cls *Surface | |
| 52 | 53 | ||
| 53 | - | GetParentPtr := XGdkPopupGetParent(x.GoPointer()) | |
| 54 | - | if GetParentPtr == 0 { | |
| 55 | - | return nil | |
| 56 | - | } | |
| 57 | - | ||
| 58 | - | gobject.IncreaseRef(GetParentPtr) | |
| 59 | - | ||
| 60 | - | GetParentCls := &Surface{} | |
| 61 | - | GetParentCls.Ptr = GetParentPtr | |
| 62 | - | return GetParentCls | |
| 54 | + | cret := XGdkPopupGetParent(x.GoPointer()) | |
| 63 | 55 | ||
| 56 | + | if cret == 0 { | |
| 57 | + | return cls | |
| 58 | + | } | |
| 59 | + | gobject.IncreaseRef(cret) | |
| 60 | + | cls = &Surface{} | |
| 61 | + | cls.Ptr = cret | |
| 62 | + | return cls | |
| 64 | 63 | } | |
| 65 | 64 | ||
| 66 | 65 | // Obtains the position of the popup relative to its parent. | |
| 67 | 66 | func (x *PopupBase) GetPositionX() int { | |
| 68 | 67 | ||
| 69 | - | return XGdkPopupGetPositionX(x.GoPointer()) | |
| 70 | - | ||
| 68 | + | cret := XGdkPopupGetPositionX(x.GoPointer()) | |
| 69 | + | return cret | |
| 71 | 70 | } | |
| 72 | 71 | ||
| 73 | 72 | // Obtains the position of the popup relative to its parent. | |
| 74 | 73 | func (x *PopupBase) GetPositionY() int { | |
| 75 | 74 | ||
| 76 | - | return XGdkPopupGetPositionY(x.GoPointer()) | |
| 77 | - | ||
| 75 | + | cret := XGdkPopupGetPositionY(x.GoPointer()) | |
| 76 | + | return cret | |
| 78 | 77 | } | |
| 79 | 78 | ||
| 80 | 79 | // Gets the current popup rectangle anchor. | |
| @@ -83,8 +82,8 @@ func (x *PopupBase) GetPositionY() int { | |||
| 83 | 82 | // or after the [signal@Gdk.Surface::layout] signal is emitted. | |
| 84 | 83 | func (x *PopupBase) GetRectAnchor() Gravity { | |
| 85 | 84 | ||
| 86 | - | return XGdkPopupGetRectAnchor(x.GoPointer()) | |
| 87 | - | ||
| 85 | + | cret := XGdkPopupGetRectAnchor(x.GoPointer()) | |
| 86 | + | return cret | |
| 88 | 87 | } | |
| 89 | 88 | ||
| 90 | 89 | // Gets the current popup surface anchor. | |
| @@ -93,8 +92,8 @@ func (x *PopupBase) GetRectAnchor() Gravity { | |||
| 93 | 92 | // or after the [signal@Gdk.Surface::layout] signal is emitted. | |
| 94 | 93 | func (x *PopupBase) GetSurfaceAnchor() Gravity { | |
| 95 | 94 | ||
| 96 | - | return XGdkPopupGetSurfaceAnchor(x.GoPointer()) | |
| 97 | - | ||
| 95 | + | cret := XGdkPopupGetSurfaceAnchor(x.GoPointer()) | |
| 96 | + | return cret | |
| 98 | 97 | } | |
| 99 | 98 | ||
| 100 | 99 | // Present @popup after having processed the `GdkPopupLayout` rules. | |
| @@ -114,8 +113,8 @@ func (x *PopupBase) GetSurfaceAnchor() Gravity { | |||
| 114 | 113 | // the [signal@Gdk.Surface::layout] signal will not me emitted. | |
| 115 | 114 | func (x *PopupBase) Present(WidthVar int, HeightVar int, LayoutVar *PopupLayout) bool { | |
| 116 | 115 | ||
| 117 | - | return XGdkPopupPresent(x.GoPointer(), WidthVar, HeightVar, LayoutVar) | |
| 118 | - | ||
| 116 | + | cret := XGdkPopupPresent(x.GoPointer(), WidthVar, HeightVar, LayoutVar) | |
| 117 | + | return cret | |
| 119 | 118 | } | |
| 120 | 119 | ||
| 121 | 120 | var XGdkPopupGetAutohide func(uintptr) bool | |
M v4/gdk/gdkseat.go +33 -36
| @@ -48,8 +48,8 @@ var xSeatGetCapabilities func(uintptr) SeatCapabilities | |||
| 48 | 48 | // Returns the capabilities this `GdkSeat` currently has. | |
| 49 | 49 | func (x *Seat) GetCapabilities() SeatCapabilities { | |
| 50 | 50 | ||
| 51 | - | return xSeatGetCapabilities(x.GoPointer()) | |
| 52 | - | ||
| 51 | + | cret := xSeatGetCapabilities(x.GoPointer()) | |
| 52 | + | return cret | |
| 53 | 53 | } | |
| 54 | 54 | ||
| 55 | 55 | var xSeatGetDevices func(uintptr, SeatCapabilities) *glib.List | |
| @@ -57,62 +57,59 @@ var xSeatGetDevices func(uintptr, SeatCapabilities) *glib.List | |||
| 57 | 57 | // Returns the devices that match the given capabilities. | |
| 58 | 58 | func (x *Seat) GetDevices(CapabilitiesVar SeatCapabilities) *glib.List { | |
| 59 | 59 | ||
| 60 | - | return xSeatGetDevices(x.GoPointer(), CapabilitiesVar) | |
| 61 | - | ||
| 60 | + | cret := xSeatGetDevices(x.GoPointer(), CapabilitiesVar) | |
| 61 | + | return cret | |
| 62 | 62 | } | |
| 63 | 63 | ||
| 64 | 64 | var xSeatGetDisplay func(uintptr) uintptr | |
| 65 | 65 | ||
| 66 | 66 | // Returns the `GdkDisplay` this seat belongs to. | |
| 67 | 67 | func (x *Seat) GetDisplay() *Display { | |
| 68 | + | var cls *Display | |
| 68 | 69 | ||
| 69 | - | GetDisplayPtr := xSeatGetDisplay(x.GoPointer()) | |
| 70 | - | if GetDisplayPtr == 0 { | |
| 71 | - | return nil | |
| 72 | - | } | |
| 73 | - | ||
| 74 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 75 | - | ||
| 76 | - | GetDisplayCls := &Display{} | |
| 77 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 78 | - | return GetDisplayCls | |
| 70 | + | cret := xSeatGetDisplay(x.GoPointer()) | |
| 79 | 71 | ||
| 72 | + | if cret == 0 { | |
| 73 | + | return cls | |
| 74 | + | } | |
| 75 | + | gobject.IncreaseRef(cret) | |
| 76 | + | cls = &Display{} | |
| 77 | + | cls.Ptr = cret | |
| 78 | + | return cls | |
| 80 | 79 | } | |
| 81 | 80 | ||
| 82 | 81 | var xSeatGetKeyboard func(uintptr) uintptr | |
| 83 | 82 | ||
| 84 | 83 | // Returns the device that routes keyboard events. | |
| 85 | 84 | func (x *Seat) GetKeyboard() *Device { | |
| 85 | + | var cls *Device | |
| 86 | 86 | ||
| 87 | - | GetKeyboardPtr := xSeatGetKeyboard(x.GoPointer()) | |
| 88 | - | if GetKeyboardPtr == 0 { | |
| 89 | - | return nil | |
| 90 | - | } | |
| 91 | - | ||
| 92 | - | gobject.IncreaseRef(GetKeyboardPtr) | |
| 93 | - | ||
| 94 | - | GetKeyboardCls := &Device{} | |
| 95 | - | GetKeyboardCls.Ptr = GetKeyboardPtr | |
| 96 | - | return GetKeyboardCls | |
| 87 | + | cret := xSeatGetKeyboard(x.GoPointer()) | |
| 97 | 88 | ||
| 89 | + | if cret == 0 { | |
| 90 | + | return cls | |
| 91 | + | } | |
| 92 | + | gobject.IncreaseRef(cret) | |
| 93 | + | cls = &Device{} | |
| 94 | + | cls.Ptr = cret | |
| 95 | + | return cls | |
| 98 | 96 | } | |
| 99 | 97 | ||
| 100 | 98 | var xSeatGetPointer func(uintptr) uintptr | |
| 101 | 99 | ||
| 102 | 100 | // Returns the device that routes pointer events. | |
| 103 | 101 | func (x *Seat) GetPointer() *Device { | |
| 102 | + | var cls *Device | |
| 104 | 103 | ||
| 105 | - | GetPointerPtr := xSeatGetPointer(x.GoPointer()) | |
| 106 | - | if GetPointerPtr == 0 { | |
| 107 | - | return nil | |
| 108 | - | } | |
| 109 | - | ||
| 110 | - | gobject.IncreaseRef(GetPointerPtr) | |
| 111 | - | ||
| 112 | - | GetPointerCls := &Device{} | |
| 113 | - | GetPointerCls.Ptr = GetPointerPtr | |
| 114 | - | return GetPointerCls | |
| 104 | + | cret := xSeatGetPointer(x.GoPointer()) | |
| 115 | 105 | ||
| 106 | + | if cret == 0 { | |
| 107 | + | return cls | |
| 108 | + | } | |
| 109 | + | gobject.IncreaseRef(cret) | |
| 110 | + | cls = &Device{} | |
| 111 | + | cls.Ptr = cret | |
| 112 | + | return cls | |
| 116 | 113 | } | |
| 117 | 114 | ||
| 118 | 115 | var xSeatGetTools func(uintptr) *glib.List | |
| @@ -120,8 +117,8 @@ var xSeatGetTools func(uintptr) *glib.List | |||
| 120 | 117 | // Returns all `GdkDeviceTools` that are known to the application. | |
| 121 | 118 | func (x *Seat) GetTools() *glib.List { | |
| 122 | 119 | ||
| 123 | - | return xSeatGetTools(x.GoPointer()) | |
| 124 | - | ||
| 120 | + | cret := xSeatGetTools(x.GoPointer()) | |
| 121 | + | return cret | |
| 125 | 122 | } | |
| 126 | 123 | ||
| 127 | 124 | func (c *Seat) GoPointer() uintptr { | |
M v4/gdk/gdksurface.go +105 -94
| @@ -5,6 +5,7 @@ import ( | |||
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | 7 | "github.com/jwijenbergh/puregotk/v4/cairo" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 8 | 9 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | 10 | ) | |
| 10 | 11 | ||
| @@ -37,28 +38,32 @@ var xNewPopupSurface func(uintptr, bool) uintptr | |||
| 37 | 38 | // The surface will be attached to @parent and can be positioned | |
| 38 | 39 | // relative to it using [method@Gdk.Popup.present]. | |
| 39 | 40 | func NewPopupSurface(ParentVar *Surface, AutohideVar bool) *Surface { | |
| 40 | - | NewPopupSurfacePtr := xNewPopupSurface(ParentVar.GoPointer(), AutohideVar) | |
| 41 | - | if NewPopupSurfacePtr == 0 { | |
| 42 | - | return nil | |
| 43 | - | } | |
| 41 | + | var cls *Surface | |
| 42 | + | ||
| 43 | + | cret := xNewPopupSurface(ParentVar.GoPointer(), AutohideVar) | |
| 44 | 44 | ||
| 45 | - | NewPopupSurfaceCls := &Surface{} | |
| 46 | - | NewPopupSurfaceCls.Ptr = NewPopupSurfacePtr | |
| 47 | - | return NewPopupSurfaceCls | |
| 45 | + | if cret == 0 { | |
| 46 | + | return cls | |
| 47 | + | } | |
| 48 | + | cls = &Surface{} | |
| 49 | + | cls.Ptr = cret | |
| 50 | + | return cls | |
| 48 | 51 | } | |
| 49 | 52 | ||
| 50 | 53 | var xNewToplevelSurface func(uintptr) uintptr | |
| 51 | 54 | ||
| 52 | 55 | // Creates a new toplevel surface. | |
| 53 | 56 | func NewToplevelSurface(DisplayVar *Display) *Surface { | |
| 54 | - | NewToplevelSurfacePtr := xNewToplevelSurface(DisplayVar.GoPointer()) | |
| 55 | - | if NewToplevelSurfacePtr == 0 { | |
| 56 | - | return nil | |
| 57 | - | } | |
| 57 | + | var cls *Surface | |
| 58 | + | ||
| 59 | + | cret := xNewToplevelSurface(DisplayVar.GoPointer()) | |
| 58 | 60 | ||
| 59 | - | NewToplevelSurfaceCls := &Surface{} | |
| 60 | - | NewToplevelSurfaceCls.Ptr = NewToplevelSurfacePtr | |
| 61 | - | return NewToplevelSurfaceCls | |
| 61 | + | if cret == 0 { | |
| 62 | + | return cls | |
| 63 | + | } | |
| 64 | + | cls = &Surface{} | |
| 65 | + | cls.Ptr = cret | |
| 66 | + | return cls | |
| 62 | 67 | } | |
| 63 | 68 | ||
| 64 | 69 | var xSurfaceBeep func(uintptr) | |
| @@ -77,16 +82,16 @@ var xSurfaceCreateCairoContext func(uintptr) uintptr | |||
| 77 | 82 | ||
| 78 | 83 | // Creates a new `GdkCairoContext` for rendering on @surface. | |
| 79 | 84 | func (x *Surface) CreateCairoContext() *CairoContext { | |
| 85 | + | var cls *CairoContext | |
| 80 | 86 | ||
| 81 | - | CreateCairoContextPtr := xSurfaceCreateCairoContext(x.GoPointer()) | |
| 82 | - | if CreateCairoContextPtr == 0 { | |
| 83 | - | return nil | |
| 84 | - | } | |
| 85 | - | ||
| 86 | - | CreateCairoContextCls := &CairoContext{} | |
| 87 | - | CreateCairoContextCls.Ptr = CreateCairoContextPtr | |
| 88 | - | return CreateCairoContextCls | |
| 87 | + | cret := xSurfaceCreateCairoContext(x.GoPointer()) | |
| 89 | 88 | ||
| 89 | + | if cret == 0 { | |
| 90 | + | return cls | |
| 91 | + | } | |
| 92 | + | cls = &CairoContext{} | |
| 93 | + | cls.Ptr = cret | |
| 94 | + | return cls | |
| 90 | 95 | } | |
| 91 | 96 | ||
| 92 | 97 | var xSurfaceCreateGlContext func(uintptr) uintptr | |
| @@ -97,16 +102,21 @@ var xSurfaceCreateGlContext func(uintptr) uintptr | |||
| 97 | 102 | // If the creation of the `GdkGLContext` failed, @error will be set. | |
| 98 | 103 | // Before using the returned `GdkGLContext`, you will need to | |
| 99 | 104 | // call [method@Gdk.GLContext.make_current] or [method@Gdk.GLContext.realize]. | |
| 100 | - | func (x *Surface) CreateGlContext() *GLContext { | |
| 105 | + | func (x *Surface) CreateGlContext() (*GLContext, error) { | |
| 106 | + | var cls *GLContext | |
| 107 | + | var cerr *glib.Error | |
| 101 | 108 | ||
| 102 | - | CreateGlContextPtr := xSurfaceCreateGlContext(x.GoPointer()) | |
| 103 | - | if CreateGlContextPtr == 0 { | |
| 104 | - | return nil | |
| 105 | - | } | |
| 109 | + | cret := xSurfaceCreateGlContext(x.GoPointer()) | |
| 106 | 110 | ||
| 107 | - | CreateGlContextCls := &GLContext{} | |
| 108 | - | CreateGlContextCls.Ptr = CreateGlContextPtr | |
| 109 | - | return CreateGlContextCls | |
| 111 | + | if cret == 0 { | |
| 112 | + | return cls, cerr | |
| 113 | + | } | |
| 114 | + | cls = &GLContext{} | |
| 115 | + | cls.Ptr = cret | |
| 116 | + | if cerr == nil { | |
| 117 | + | return cls, nil | |
| 118 | + | } | |
| 119 | + | return cls, cerr | |
| 110 | 120 | ||
| 111 | 121 | } | |
| 112 | 122 | ||
| @@ -129,8 +139,8 @@ var xSurfaceCreateSimilarSurface func(uintptr, cairo.Content, int, int) *cairo.S | |||
| 129 | 139 | // or any other error occurs. | |
| 130 | 140 | func (x *Surface) CreateSimilarSurface(ContentVar cairo.Content, WidthVar int, HeightVar int) *cairo.Surface { | |
| 131 | 141 | ||
| 132 | - | return xSurfaceCreateSimilarSurface(x.GoPointer(), ContentVar, WidthVar, HeightVar) | |
| 133 | - | ||
| 142 | + | cret := xSurfaceCreateSimilarSurface(x.GoPointer(), ContentVar, WidthVar, HeightVar) | |
| 143 | + | return cret | |
| 134 | 144 | } | |
| 135 | 145 | ||
| 136 | 146 | var xSurfaceCreateVulkanContext func(uintptr) uintptr | |
| @@ -138,16 +148,21 @@ var xSurfaceCreateVulkanContext func(uintptr) uintptr | |||
| 138 | 148 | // Creates a new `GdkVulkanContext` for rendering on @surface. | |
| 139 | 149 | // | |
| 140 | 150 | // If the creation of the `GdkVulkanContext` failed, @error will be set. | |
| 141 | - | func (x *Surface) CreateVulkanContext() *VulkanContext { | |
| 151 | + | func (x *Surface) CreateVulkanContext() (*VulkanContext, error) { | |
| 152 | + | var cls *VulkanContext | |
| 153 | + | var cerr *glib.Error | |
| 142 | 154 | ||
| 143 | - | CreateVulkanContextPtr := xSurfaceCreateVulkanContext(x.GoPointer()) | |
| 144 | - | if CreateVulkanContextPtr == 0 { | |
| 145 | - | return nil | |
| 146 | - | } | |
| 155 | + | cret := xSurfaceCreateVulkanContext(x.GoPointer()) | |
| 147 | 156 | ||
| 148 | - | CreateVulkanContextCls := &VulkanContext{} | |
| 149 | - | CreateVulkanContextCls.Ptr = CreateVulkanContextPtr | |
| 150 | - | return CreateVulkanContextCls | |
| 157 | + | if cret == 0 { | |
| 158 | + | return cls, cerr | |
| 159 | + | } | |
| 160 | + | cls = &VulkanContext{} | |
| 161 | + | cls.Ptr = cret | |
| 162 | + | if cerr == nil { | |
| 163 | + | return cls, nil | |
| 164 | + | } | |
| 165 | + | return cls, cerr | |
| 151 | 166 | ||
| 152 | 167 | } | |
| 153 | 168 | ||
| @@ -178,18 +193,17 @@ var xSurfaceGetCursor func(uintptr) uintptr | |||
| 178 | 193 | // | |
| 179 | 194 | // Use [method@Gdk.Surface.set_cursor] to unset the cursor of the surface. | |
| 180 | 195 | func (x *Surface) GetCursor() *Cursor { | |
| 196 | + | var cls *Cursor | |
| 181 | 197 | ||
| 182 | - | GetCursorPtr := xSurfaceGetCursor(x.GoPointer()) | |
| 183 | - | if GetCursorPtr == 0 { | |
| 184 | - | return nil | |
| 185 | - | } | |
| 186 | - | ||
| 187 | - | gobject.IncreaseRef(GetCursorPtr) | |
| 188 | - | ||
| 189 | - | GetCursorCls := &Cursor{} | |
| 190 | - | GetCursorCls.Ptr = GetCursorPtr | |
| 191 | - | return GetCursorCls | |
| 198 | + | cret := xSurfaceGetCursor(x.GoPointer()) | |
| 192 | 199 | ||
| 200 | + | if cret == 0 { | |
| 201 | + | return cls | |
| 202 | + | } | |
| 203 | + | gobject.IncreaseRef(cret) | |
| 204 | + | cls = &Cursor{} | |
| 205 | + | cls.Ptr = cret | |
| 206 | + | return cls | |
| 193 | 207 | } | |
| 194 | 208 | ||
| 195 | 209 | var xSurfaceGetDeviceCursor func(uintptr, uintptr) uintptr | |
| @@ -202,18 +216,17 @@ var xSurfaceGetDeviceCursor func(uintptr, uintptr) uintptr | |||
| 202 | 216 | // | |
| 203 | 217 | // Use [method@Gdk.Surface.set_cursor] to unset the cursor of the surface. | |
| 204 | 218 | func (x *Surface) GetDeviceCursor(DeviceVar *Device) *Cursor { | |
| 219 | + | var cls *Cursor | |
| 205 | 220 | ||
| 206 | - | GetDeviceCursorPtr := xSurfaceGetDeviceCursor(x.GoPointer(), DeviceVar.GoPointer()) | |
| 207 | - | if GetDeviceCursorPtr == 0 { | |
| 208 | - | return nil | |
| 209 | - | } | |
| 210 | - | ||
| 211 | - | gobject.IncreaseRef(GetDeviceCursorPtr) | |
| 212 | - | ||
| 213 | - | GetDeviceCursorCls := &Cursor{} | |
| 214 | - | GetDeviceCursorCls.Ptr = GetDeviceCursorPtr | |
| 215 | - | return GetDeviceCursorCls | |
| 221 | + | cret := xSurfaceGetDeviceCursor(x.GoPointer(), DeviceVar.GoPointer()) | |
| 216 | 222 | ||
| 223 | + | if cret == 0 { | |
| 224 | + | return cls | |
| 225 | + | } | |
| 226 | + | gobject.IncreaseRef(cret) | |
| 227 | + | cls = &Cursor{} | |
| 228 | + | cls.Ptr = cret | |
| 229 | + | return cls | |
| 217 | 230 | } | |
| 218 | 231 | ||
| 219 | 232 | var xSurfaceGetDevicePosition func(uintptr, uintptr, float64, float64, *ModifierType) bool | |
| @@ -224,26 +237,25 @@ var xSurfaceGetDevicePosition func(uintptr, uintptr, float64, float64, *Modifier | |||
| 224 | 237 | // left corner of @surface. | |
| 225 | 238 | func (x *Surface) GetDevicePosition(DeviceVar *Device, XVar float64, YVar float64, MaskVar *ModifierType) bool { | |
| 226 | 239 | ||
| 227 | - | return xSurfaceGetDevicePosition(x.GoPointer(), DeviceVar.GoPointer(), XVar, YVar, MaskVar) | |
| 228 | - | ||
| 240 | + | cret := xSurfaceGetDevicePosition(x.GoPointer(), DeviceVar.GoPointer(), XVar, YVar, MaskVar) | |
| 241 | + | return cret | |
| 229 | 242 | } | |
| 230 | 243 | ||
| 231 | 244 | var xSurfaceGetDisplay func(uintptr) uintptr | |
| 232 | 245 | ||
| 233 | 246 | // Gets the `GdkDisplay` associated with a `GdkSurface`. | |
| 234 | 247 | func (x *Surface) GetDisplay() *Display { | |
| 248 | + | var cls *Display | |
| 235 | 249 | ||
| 236 | - | GetDisplayPtr := xSurfaceGetDisplay(x.GoPointer()) | |
| 237 | - | if GetDisplayPtr == 0 { | |
| 238 | - | return nil | |
| 239 | - | } | |
| 240 | - | ||
| 241 | - | gobject.IncreaseRef(GetDisplayPtr) | |
| 242 | - | ||
| 243 | - | GetDisplayCls := &Display{} | |
| 244 | - | GetDisplayCls.Ptr = GetDisplayPtr | |
| 245 | - | return GetDisplayCls | |
| 250 | + | cret := xSurfaceGetDisplay(x.GoPointer()) | |
| 246 | 251 | ||
| 252 | + | if cret == 0 { | |
| 253 | + | return cls | |
| 254 | + | } | |
| 255 | + | gobject.IncreaseRef(cret) | |
| 256 | + | cls = &Display{} | |
| 257 | + | cls.Ptr = cret | |
| 258 | + | return cls | |
| 247 | 259 | } | |
| 248 | 260 | ||
| 249 | 261 | var xSurfaceGetFrameClock func(uintptr) uintptr | |
| @@ -253,18 +265,17 @@ var xSurfaceGetFrameClock func(uintptr) uintptr | |||
| 253 | 265 | // The frame clock for a surface never changes unless the surface is | |
| 254 | 266 | // reparented to a new toplevel surface. | |
| 255 | 267 | func (x *Surface) GetFrameClock() *FrameClock { | |
| 268 | + | var cls *FrameClock | |
| 256 | 269 | ||
| 257 | - | GetFrameClockPtr := xSurfaceGetFrameClock(x.GoPointer()) | |
| 258 | - | if GetFrameClockPtr == 0 { | |
| 259 | - | return nil | |
| 260 | - | } | |
| 261 | - | ||
| 262 | - | gobject.IncreaseRef(GetFrameClockPtr) | |
| 263 | - | ||
| 264 | - | GetFrameClockCls := &FrameClock{} | |
| 265 | - | GetFrameClockCls.Ptr = GetFrameClockPtr | |
| 266 | - | return GetFrameClockCls | |
| 270 | + | cret := xSurfaceGetFrameClock(x.GoPointer()) | |
| 267 | 271 | ||
| 272 | + | if cret == 0 { | |
| 273 | + | return cls | |
| 274 | + | } | |
| 275 | + | gobject.IncreaseRef(cret) | |
| 276 | + | cls = &FrameClock{} | |
| 277 | + | cls.Ptr = cret | |
| 278 | + | return cls | |
| 268 | 279 | } | |
| 269 | 280 | ||
| 270 | 281 | var xSurfaceGetHeight func(uintptr) int | |
| @@ -275,8 +286,8 @@ var xSurfaceGetHeight func(uintptr) int | |||
| 275 | 286 | // ”device pixels” (see [method@Gdk.Surface.get_scale_factor]). | |
| 276 | 287 | func (x *Surface) GetHeight() int { | |
| 277 | 288 | ||
| 278 | - | return xSurfaceGetHeight(x.GoPointer()) | |
| 279 | - | ||
| 289 | + | cret := xSurfaceGetHeight(x.GoPointer()) | |
| 290 | + | return cret | |
| 280 | 291 | } | |
| 281 | 292 | ||
| 282 | 293 | var xSurfaceGetMapped func(uintptr) bool | |
| @@ -287,8 +298,8 @@ var xSurfaceGetMapped func(uintptr) bool | |||
| 287 | 298 | // or [method@Gdk.Popup.present]. | |
| 288 | 299 | func (x *Surface) GetMapped() bool { | |
| 289 | 300 | ||
| 290 | - | return xSurfaceGetMapped(x.GoPointer()) | |
| 291 | - | ||
| 301 | + | cret := xSurfaceGetMapped(x.GoPointer()) | |
| 302 | + | return cret | |
| 292 | 303 | } | |
| 293 | 304 | ||
| 294 | 305 | var xSurfaceGetScaleFactor func(uintptr) int | |
| @@ -306,8 +317,8 @@ var xSurfaceGetScaleFactor func(uintptr) int | |||
| 306 | 317 | // The scale of a surface may change during runtime. | |
| 307 | 318 | func (x *Surface) GetScaleFactor() int { | |
| 308 | 319 | ||
| 309 | - | return xSurfaceGetScaleFactor(x.GoPointer()) | |
| 310 | - | ||
| 320 | + | cret := xSurfaceGetScaleFactor(x.GoPointer()) | |
| 321 | + | return cret | |
| 311 | 322 | } | |
| 312 | 323 | ||
| 313 | 324 | var xSurfaceGetWidth func(uintptr) int | |
| @@ -318,8 +329,8 @@ var xSurfaceGetWidth func(uintptr) int | |||
| 318 | 329 | // ”device pixels” (see [method@Gdk.Surface.get_scale_factor]). | |
| 319 | 330 | func (x *Surface) GetWidth() int { | |
| 320 | 331 | ||
| 321 | - | return xSurfaceGetWidth(x.GoPointer()) | |
| 322 | - | ||
| 332 | + | cret := xSurfaceGetWidth(x.GoPointer()) | |
| 333 | + | return cret | |
| 323 | 334 | } | |
| 324 | 335 | ||
| 325 | 336 | var xSurfaceHide func(uintptr) | |
| @@ -341,8 +352,8 @@ var xSurfaceIsDestroyed func(uintptr) bool | |||
| 341 | 352 | // Check to see if a surface is destroyed. | |
| 342 | 353 | func (x *Surface) IsDestroyed() bool { | |
| 343 | 354 | ||
| 344 | - | return xSurfaceIsDestroyed(x.GoPointer()) | |
| 345 | - | ||
| 355 | + | cret := xSurfaceIsDestroyed(x.GoPointer()) | |
| 356 | + | return cret | |
| 346 | 357 | } | |
| 347 | 358 | ||
| 348 | 359 | var xSurfaceQueueRender func(uintptr) | |
| @@ -453,8 +464,8 @@ var xSurfaceTranslateCoordinates func(uintptr, uintptr, float64, float64) bool | |||
| 453 | 464 | // transient-for to the same toplevel (directly or indirectly). | |
| 454 | 465 | func (x *Surface) TranslateCoordinates(ToVar *Surface, XVar float64, YVar float64) bool { | |
| 455 | 466 | ||
| 456 | - | return xSurfaceTranslateCoordinates(x.GoPointer(), ToVar.GoPointer(), XVar, YVar) | |
| 457 | - | ||
| 467 | + | cret := xSurfaceTranslateCoordinates(x.GoPointer(), ToVar.GoPointer(), XVar, YVar) | |
| 468 | + | return cret | |
| 458 | 469 | } | |
| 459 | 470 | ||
| 460 | 471 | func (c *Surface) GoPointer() uintptr { | |
M v4/gdk/gdktexture.go +123 -88
| @@ -61,17 +61,19 @@ var xNewForPixbufTexture func(uintptr) uintptr | |||
| 61 | 61 | // and [method@Gio.Task.run_in_thread] to avoid blocking the main thread | |
| 62 | 62 | // while loading a big image. | |
| 63 | 63 | func NewForPixbufTexture(PixbufVar *gdkpixbuf.Pixbuf) *Texture { | |
| 64 | - | NewForPixbufTexturePtr := xNewForPixbufTexture(PixbufVar.GoPointer()) | |
| 65 | - | if NewForPixbufTexturePtr == 0 { | |
| 66 | - | return nil | |
| 67 | - | } | |
| 64 | + | var cls *Texture | |
| 65 | + | ||
| 66 | + | cret := xNewForPixbufTexture(PixbufVar.GoPointer()) | |
| 68 | 67 | ||
| 69 | - | NewForPixbufTextureCls := &Texture{} | |
| 70 | - | NewForPixbufTextureCls.Ptr = NewForPixbufTexturePtr | |
| 71 | - | return NewForPixbufTextureCls | |
| 68 | + | if cret == 0 { | |
| 69 | + | return cls | |
| 70 | + | } | |
| 71 | + | cls = &Texture{} | |
| 72 | + | cls.Ptr = cret | |
| 73 | + | return cls | |
| 72 | 74 | } | |
| 73 | 75 | ||
| 74 | - | var xNewFromBytesTexture func(*glib.Bytes) uintptr | |
| 76 | + | var xNewFromBytesTexture func(*glib.Bytes, **glib.Error) uintptr | |
| 75 | 77 | ||
| 76 | 78 | // Creates a new texture by loading an image from memory, | |
| 77 | 79 | // | |
| @@ -83,18 +85,25 @@ var xNewFromBytesTexture func(*glib.Bytes) uintptr | |||
| 83 | 85 | // This function is threadsafe, so that you can e.g. use GTask | |
| 84 | 86 | // and [method@Gio.Task.run_in_thread] to avoid blocking the main thread | |
| 85 | 87 | // while loading a big image. | |
| 86 | - | func NewFromBytesTexture(BytesVar *glib.Bytes) *Texture { | |
| 87 | - | NewFromBytesTexturePtr := xNewFromBytesTexture(BytesVar) | |
| 88 | - | if NewFromBytesTexturePtr == 0 { | |
| 89 | - | return nil | |
| 88 | + | func NewFromBytesTexture(BytesVar *glib.Bytes) (*Texture, error) { | |
| 89 | + | var cls *Texture | |
| 90 | + | var cerr *glib.Error | |
| 91 | + | ||
| 92 | + | cret := xNewFromBytesTexture(BytesVar, &cerr) | |
| 93 | + | ||
| 94 | + | if cret == 0 { | |
| 95 | + | return cls, cerr | |
| 96 | + | } | |
| 97 | + | cls = &Texture{} | |
| 98 | + | cls.Ptr = cret | |
| 99 | + | if cerr == nil { | |
| 100 | + | return cls, nil | |
| 90 | 101 | } | |
| 102 | + | return cls, cerr | |
| 91 | 103 | ||
| 92 | - | NewFromBytesTextureCls := &Texture{} | |
| 93 | - | NewFromBytesTextureCls.Ptr = NewFromBytesTexturePtr | |
| 94 | - | return NewFromBytesTextureCls | |
| 95 | 104 | } | |
| 96 | 105 | ||
| 97 | - | var xNewFromFileTexture func(uintptr) uintptr | |
| 106 | + | var xNewFromFileTexture func(uintptr, **glib.Error) uintptr | |
| 98 | 107 | ||
| 99 | 108 | // Creates a new texture by loading an image from a file. | |
| 100 | 109 | // | |
| @@ -106,18 +115,25 @@ var xNewFromFileTexture func(uintptr) uintptr | |||
| 106 | 115 | // This function is threadsafe, so that you can e.g. use GTask | |
| 107 | 116 | // and [method@Gio.Task.run_in_thread] to avoid blocking the main thread | |
| 108 | 117 | // while loading a big image. | |
| 109 | - | func NewFromFileTexture(FileVar gio.File) *Texture { | |
| 110 | - | NewFromFileTexturePtr := xNewFromFileTexture(FileVar.GoPointer()) | |
| 111 | - | if NewFromFileTexturePtr == 0 { | |
| 112 | - | return nil | |
| 118 | + | func NewFromFileTexture(FileVar gio.File) (*Texture, error) { | |
| 119 | + | var cls *Texture | |
| 120 | + | var cerr *glib.Error | |
| 121 | + | ||
| 122 | + | cret := xNewFromFileTexture(FileVar.GoPointer(), &cerr) | |
| 123 | + | ||
| 124 | + | if cret == 0 { | |
| 125 | + | return cls, cerr | |
| 126 | + | } | |
| 127 | + | cls = &Texture{} | |
| 128 | + | cls.Ptr = cret | |
| 129 | + | if cerr == nil { | |
| 130 | + | return cls, nil | |
| 113 | 131 | } | |
| 132 | + | return cls, cerr | |
| 114 | 133 | ||
| 115 | - | NewFromFileTextureCls := &Texture{} | |
| 116 | - | NewFromFileTextureCls.Ptr = NewFromFileTexturePtr | |
| 117 | - | return NewFromFileTextureCls | |
| 118 | 134 | } | |
| 119 | 135 | ||
| 120 | - | var xNewFromFilenameTexture func(string) uintptr | |
| 136 | + | var xNewFromFilenameTexture func(string, **glib.Error) uintptr | |
| 121 | 137 | ||
| 122 | 138 | // Creates a new texture by loading an image from a file. | |
| 123 | 139 | // | |
| @@ -129,15 +145,22 @@ var xNewFromFilenameTexture func(string) uintptr | |||
| 129 | 145 | // This function is threadsafe, so that you can e.g. use GTask | |
| 130 | 146 | // and [method@Gio.Task.run_in_thread] to avoid blocking the main thread | |
| 131 | 147 | // while loading a big image. | |
| 132 | - | func NewFromFilenameTexture(PathVar string) *Texture { | |
| 133 | - | NewFromFilenameTexturePtr := xNewFromFilenameTexture(PathVar) | |
| 134 | - | if NewFromFilenameTexturePtr == 0 { | |
| 135 | - | return nil | |
| 148 | + | func NewFromFilenameTexture(PathVar string) (*Texture, error) { | |
| 149 | + | var cls *Texture | |
| 150 | + | var cerr *glib.Error | |
| 151 | + | ||
| 152 | + | cret := xNewFromFilenameTexture(PathVar, &cerr) | |
| 153 | + | ||
| 154 | + | if cret == 0 { | |
| 155 | + | return cls, cerr | |
| 156 | + | } | |
| 157 | + | cls = &Texture{} | |
| 158 | + | cls.Ptr = cret | |
| 159 | + | if cerr == nil { | |
| 160 | + | return cls, nil | |
| 136 | 161 | } | |
| 162 | + | return cls, cerr | |
| 137 | 163 | ||
| 138 | - | NewFromFilenameTextureCls := &Texture{} | |
| 139 | - | NewFromFilenameTextureCls.Ptr = NewFromFilenameTexturePtr | |
| 140 | - | return NewFromFilenameTextureCls | |
| 141 | 164 | } | |
| 142 | 165 | ||
| 143 | 166 | var xNewFromResourceTexture func(string) uintptr | |
| @@ -156,14 +179,16 @@ var xNewFromResourceTexture func(string) uintptr | |||
| 156 | 179 | // and [method@Gio.Task.run_in_thread] to avoid blocking the main thread | |
| 157 | 180 | // while loading a big image. | |
| 158 | 181 | func NewFromResourceTexture(ResourcePathVar string) *Texture { | |
| 159 | - | NewFromResourceTexturePtr := xNewFromResourceTexture(ResourcePathVar) | |
| 160 | - | if NewFromResourceTexturePtr == 0 { | |
| 161 | - | return nil | |
| 162 | - | } | |
| 182 | + | var cls *Texture | |
| 183 | + | ||
| 184 | + | cret := xNewFromResourceTexture(ResourcePathVar) | |
| 163 | 185 | ||
| 164 | - | NewFromResourceTextureCls := &Texture{} | |
| 165 | - | NewFromResourceTextureCls.Ptr = NewFromResourceTexturePtr | |
| 166 | - | return NewFromResourceTextureCls | |
| 186 | + | if cret == 0 { | |
| 187 | + | return cls | |
| 188 | + | } | |
| 189 | + | cls = &Texture{} | |
| 190 | + | cls.Ptr = cret | |
| 191 | + | return cls | |
| 167 | 192 | } | |
| 168 | 193 | ||
| 169 | 194 | var xTextureDownload func(uintptr, uintptr, uint) | |
| @@ -202,8 +227,8 @@ var xTextureGetHeight func(uintptr) int | |||
| 202 | 227 | // Returns the height of the @texture, in pixels. | |
| 203 | 228 | func (x *Texture) GetHeight() int { | |
| 204 | 229 | ||
| 205 | - | return xTextureGetHeight(x.GoPointer()) | |
| 206 | - | ||
| 230 | + | cret := xTextureGetHeight(x.GoPointer()) | |
| 231 | + | return cret | |
| 207 | 232 | } | |
| 208 | 233 | ||
| 209 | 234 | var xTextureGetWidth func(uintptr) int | |
| @@ -211,8 +236,8 @@ var xTextureGetWidth func(uintptr) int | |||
| 211 | 236 | // Returns the width of @texture, in pixels. | |
| 212 | 237 | func (x *Texture) GetWidth() int { | |
| 213 | 238 | ||
| 214 | - | return xTextureGetWidth(x.GoPointer()) | |
| 215 | - | ||
| 239 | + | cret := xTextureGetWidth(x.GoPointer()) | |
| 240 | + | return cret | |
| 216 | 241 | } | |
| 217 | 242 | ||
| 218 | 243 | var xTextureSaveToPng func(uintptr, string) bool | |
| @@ -226,8 +251,8 @@ var xTextureSaveToPng func(uintptr, string) bool | |||
| 226 | 251 | // gdk-pixbuf library. | |
| 227 | 252 | func (x *Texture) SaveToPng(FilenameVar string) bool { | |
| 228 | 253 | ||
| 229 | - | return xTextureSaveToPng(x.GoPointer(), FilenameVar) | |
| 230 | - | ||
| 254 | + | cret := xTextureSaveToPng(x.GoPointer(), FilenameVar) | |
| 255 | + | return cret | |
| 231 | 256 | } | |
| 232 | 257 | ||
| 233 | 258 | var xTextureSaveToPngBytes func(uintptr) *glib.Bytes | |
| @@ -248,8 +273,8 @@ var xTextureSaveToPngBytes func(uintptr) *glib.Bytes | |||
| 248 | 273 | // instead. | |
| 249 | 274 | func (x *Texture) SaveToPngBytes() *glib.Bytes { | |
| 250 | 275 | ||
| 251 | - | return xTextureSaveToPngBytes(x.GoPointer()) | |
| 252 | - | ||
| 276 | + | cret := xTextureSaveToPngBytes(x.GoPointer()) | |
| 277 | + | return cret | |
| 253 | 278 | } | |
| 254 | 279 | ||
| 255 | 280 | var xTextureSaveToTiff func(uintptr, string) bool | |
| @@ -259,8 +284,8 @@ var xTextureSaveToTiff func(uintptr, string) bool | |||
| 259 | 284 | // GTK will attempt to store data without loss. | |
| 260 | 285 | func (x *Texture) SaveToTiff(FilenameVar string) bool { | |
| 261 | 286 | ||
| 262 | - | return xTextureSaveToTiff(x.GoPointer(), FilenameVar) | |
| 263 | - | ||
| 287 | + | cret := xTextureSaveToTiff(x.GoPointer(), FilenameVar) | |
| 288 | + | return cret | |
| 264 | 289 | } | |
| 265 | 290 | ||
| 266 | 291 | var xTextureSaveToTiffBytes func(uintptr) *glib.Bytes | |
| @@ -279,8 +304,8 @@ var xTextureSaveToTiffBytes func(uintptr) *glib.Bytes | |||
| 279 | 304 | // use [method@Gdk.Texture.save_to_png_bytes]. | |
| 280 | 305 | func (x *Texture) SaveToTiffBytes() *glib.Bytes { | |
| 281 | 306 | ||
| 282 | - | return xTextureSaveToTiffBytes(x.GoPointer()) | |
| 283 | - | ||
| 307 | + | cret := xTextureSaveToTiffBytes(x.GoPointer()) | |
| 308 | + | return cret | |
| 284 | 309 | } | |
| 285 | 310 | ||
| 286 | 311 | func (c *Texture) GoPointer() uintptr { | |
| @@ -314,16 +339,16 @@ func (x *Texture) ComputeConcreteSize(SpecifiedWidthVar float64, SpecifiedHeight | |||
| 314 | 339 | // | |
| 315 | 340 | // If the @paintable is already immutable, it will return itself. | |
| 316 | 341 | func (x *Texture) GetCurrentImage() *PaintableBase { | |
| 342 | + | var cls *PaintableBase | |
| 317 | 343 | ||
| 318 | - | GetCurrentImagePtr := XGdkPaintableGetCurrentImage(x.GoPointer()) | |
| 319 | - | if GetCurrentImagePtr == 0 { | |
| 320 | - | return nil | |
| 321 | - | } | |
| 322 | - | ||
| 323 | - | GetCurrentImageCls := &PaintableBase{} | |
| 324 | - | GetCurrentImageCls.Ptr = GetCurrentImagePtr | |
| 325 | - | return GetCurrentImageCls | |
| 344 | + | cret := XGdkPaintableGetCurrentImage(x.GoPointer()) | |
| 326 | 345 | ||
| 346 | + | if cret == 0 { | |
| 347 | + | return cls | |
| 348 | + | } | |
| 349 | + | cls = &PaintableBase{} | |
| 350 | + | cls.Ptr = cret | |
| 351 | + | return cls | |
| 327 | 352 | } | |
| 328 | 353 | ||
| 329 | 354 | // Get flags for the paintable. | |
| @@ -333,8 +358,8 @@ func (x *Texture) GetCurrentImage() *PaintableBase { | |||
| 333 | 358 | // See [flags@Gdk.PaintableFlags] for the flags and what they mean. | |
| 334 | 359 | func (x *Texture) GetFlags() PaintableFlags { | |
| 335 | 360 | ||
| 336 | - | return XGdkPaintableGetFlags(x.GoPointer()) | |
| 337 | - | ||
| 361 | + | cret := XGdkPaintableGetFlags(x.GoPointer()) | |
| 362 | + | return cret | |
| 338 | 363 | } | |
| 339 | 364 | ||
| 340 | 365 | // Gets the preferred aspect ratio the @paintable would like to be displayed at. | |
| @@ -356,8 +381,8 @@ func (x *Texture) GetFlags() PaintableFlags { | |||
| 356 | 381 | // it returns 0. Negative values are never returned. | |
| 357 | 382 | func (x *Texture) GetIntrinsicAspectRatio() float64 { | |
| 358 | 383 | ||
| 359 | - | return XGdkPaintableGetIntrinsicAspectRatio(x.GoPointer()) | |
| 360 | - | ||
| 384 | + | cret := XGdkPaintableGetIntrinsicAspectRatio(x.GoPointer()) | |
| 385 | + | return cret | |
| 361 | 386 | } | |
| 362 | 387 | ||
| 363 | 388 | // Gets the preferred height the @paintable would like to be displayed at. | |
| @@ -372,8 +397,8 @@ func (x *Texture) GetIntrinsicAspectRatio() float64 { | |||
| 372 | 397 | // Negative values are never returned. | |
| 373 | 398 | func (x *Texture) GetIntrinsicHeight() int { | |
| 374 | 399 | ||
| 375 | - | return XGdkPaintableGetIntrinsicHeight(x.GoPointer()) | |
| 376 | - | ||
| 400 | + | cret := XGdkPaintableGetIntrinsicHeight(x.GoPointer()) | |
| 401 | + | return cret | |
| 377 | 402 | } | |
| 378 | 403 | ||
| 379 | 404 | // Gets the preferred width the @paintable would like to be displayed at. | |
| @@ -388,8 +413,8 @@ func (x *Texture) GetIntrinsicHeight() int { | |||
| 388 | 413 | // Negative values are never returned. | |
| 389 | 414 | func (x *Texture) GetIntrinsicWidth() int { | |
| 390 | 415 | ||
| 391 | - | return XGdkPaintableGetIntrinsicWidth(x.GoPointer()) | |
| 392 | - | ||
| 416 | + | cret := XGdkPaintableGetIntrinsicWidth(x.GoPointer()) | |
| 417 | + | return cret | |
| 393 | 418 | } | |
| 394 | 419 | ||
| 395 | 420 | // Called by implementations of `GdkPaintable` to invalidate their contents. | |
| @@ -438,8 +463,8 @@ func (x *Texture) Snapshot(SnapshotVar *Snapshot, WidthVar float64, HeightVar fl | |||
| 438 | 463 | // Checks if two icons are equal. | |
| 439 | 464 | func (x *Texture) Equal(Icon2Var gio.Icon) bool { | |
| 440 | 465 | ||
| 441 | - | return gio.XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 442 | - | ||
| 466 | + | cret := gio.XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 467 | + | return cret | |
| 443 | 468 | } | |
| 444 | 469 | ||
| 445 | 470 | // Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved | |
| @@ -449,8 +474,8 @@ func (x *Texture) Equal(Icon2Var gio.Icon) bool { | |||
| 449 | 474 | // (as opposed to over the network), and within the same file system namespace. | |
| 450 | 475 | func (x *Texture) Serialize() *glib.Variant { | |
| 451 | 476 | ||
| 452 | - | return gio.XGIconSerialize(x.GoPointer()) | |
| 453 | - | ||
| 477 | + | cret := gio.XGIconSerialize(x.GoPointer()) | |
| 478 | + | return cret | |
| 454 | 479 | } | |
| 455 | 480 | ||
| 456 | 481 | // Generates a textual representation of @icon that can be used for | |
| @@ -471,22 +496,27 @@ func (x *Texture) Serialize() *glib.Variant { | |||
| 471 | 496 | // the encoding is simply the name (such as `network-server`). | |
| 472 | 497 | func (x *Texture) ToString() string { | |
| 473 | 498 | ||
| 474 | - | return gio.XGIconToString(x.GoPointer()) | |
| 475 | - | ||
| 499 | + | cret := gio.XGIconToString(x.GoPointer()) | |
| 500 | + | return cret | |
| 476 | 501 | } | |
| 477 | 502 | ||
| 478 | 503 | // Loads a loadable icon. For the asynchronous version of this function, | |
| 479 | 504 | // see g_loadable_icon_load_async(). | |
| 480 | - | func (x *Texture) Load(SizeVar int, TypeVar string, CancellableVar *gio.Cancellable) *gio.InputStream { | |
| 505 | + | func (x *Texture) Load(SizeVar int, TypeVar string, CancellableVar *gio.Cancellable) (*gio.InputStream, error) { | |
| 506 | + | var cls *gio.InputStream | |
| 507 | + | var cerr *glib.Error | |
| 481 | 508 | ||
| 482 | - | LoadPtr := gio.XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer()) | |
| 483 | - | if LoadPtr == 0 { | |
| 484 | - | return nil | |
| 485 | - | } | |
| 509 | + | cret := gio.XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 486 | 510 | ||
| 487 | - | LoadCls := &gio.InputStream{} | |
| 488 | - | LoadCls.Ptr = LoadPtr | |
| 489 | - | return LoadCls | |
| 511 | + | if cret == 0 { | |
| 512 | + | return cls, cerr | |
| 513 | + | } | |
| 514 | + | cls = &gio.InputStream{} | |
| 515 | + | cls.Ptr = cret | |
| 516 | + | if cerr == nil { | |
| 517 | + | return cls, nil | |
| 518 | + | } | |
| 519 | + | return cls, cerr | |
| 490 | 520 | ||
| 491 | 521 | } | |
| 492 | 522 | ||
| @@ -500,16 +530,21 @@ func (x *Texture) LoadAsync(SizeVar int, CancellableVar *gio.Cancellable, Callba | |||
| 500 | 530 | } | |
| 501 | 531 | ||
| 502 | 532 | // Finishes an asynchronous icon load started in g_loadable_icon_load_async(). | |
| 503 | - | func (x *Texture) LoadFinish(ResVar gio.AsyncResult, TypeVar string) *gio.InputStream { | |
| 533 | + | func (x *Texture) LoadFinish(ResVar gio.AsyncResult, TypeVar string) (*gio.InputStream, error) { | |
| 534 | + | var cls *gio.InputStream | |
| 535 | + | var cerr *glib.Error | |
| 504 | 536 | ||
| 505 | - | LoadFinishPtr := gio.XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar) | |
| 506 | - | if LoadFinishPtr == 0 { | |
| 507 | - | return nil | |
| 508 | - | } | |
| 537 | + | cret := gio.XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar, &cerr) | |
| 509 | 538 | ||
| 510 | - | LoadFinishCls := &gio.InputStream{} | |
| 511 | - | LoadFinishCls.Ptr = LoadFinishPtr | |
| 512 | - | return LoadFinishCls | |
| 539 | + | if cret == 0 { | |
| 540 | + | return cls, cerr | |
| 541 | + | } | |
| 542 | + | cls = &gio.InputStream{} | |
| 543 | + | cls.Ptr = cret | |
| 544 | + | if cerr == nil { | |
| 545 | + | return cls, nil | |
| 546 | + | } | |
| 547 | + | return cls, cerr | |
| 513 | 548 | ||
| 514 | 549 | } | |
| 515 | 550 | ||
M v4/gdk/gdktoplevel.go +12 -12
| @@ -82,8 +82,8 @@ func (x *ToplevelBase) Focus(TimestampVar uint32) { | |||
| 82 | 82 | // from the `GdkToplevelState` enumeration. | |
| 83 | 83 | func (x *ToplevelBase) GetState() ToplevelState { | |
| 84 | 84 | ||
| 85 | - | return XGdkToplevelGetState(x.GoPointer()) | |
| 86 | - | ||
| 85 | + | cret := XGdkToplevelGetState(x.GoPointer()) | |
| 86 | + | return cret | |
| 87 | 87 | } | |
| 88 | 88 | ||
| 89 | 89 | // Requests that the @toplevel inhibit the system shortcuts. | |
| @@ -118,8 +118,8 @@ func (x *ToplevelBase) InhibitSystemShortcuts(EventVar *Event) { | |||
| 118 | 118 | // The windowing system may choose to ignore the request. | |
| 119 | 119 | func (x *ToplevelBase) Lower() bool { | |
| 120 | 120 | ||
| 121 | - | return XGdkToplevelLower(x.GoPointer()) | |
| 122 | - | ||
| 121 | + | cret := XGdkToplevelLower(x.GoPointer()) | |
| 122 | + | return cret | |
| 123 | 123 | } | |
| 124 | 124 | ||
| 125 | 125 | // Asks to minimize the @toplevel. | |
| @@ -127,8 +127,8 @@ func (x *ToplevelBase) Lower() bool { | |||
| 127 | 127 | // The windowing system may choose to ignore the request. | |
| 128 | 128 | func (x *ToplevelBase) Minimize() bool { | |
| 129 | 129 | ||
| 130 | - | return XGdkToplevelMinimize(x.GoPointer()) | |
| 131 | - | ||
| 130 | + | cret := XGdkToplevelMinimize(x.GoPointer()) | |
| 131 | + | return cret | |
| 132 | 132 | } | |
| 133 | 133 | ||
| 134 | 134 | // Present @toplevel after having processed the `GdkToplevelLayout` rules. | |
| @@ -253,22 +253,22 @@ func (x *ToplevelBase) SetTransientFor(ParentVar *Surface) { | |||
| 253 | 253 | // right-click on the window decorations. | |
| 254 | 254 | func (x *ToplevelBase) ShowWindowMenu(EventVar *Event) bool { | |
| 255 | 255 | ||
| 256 | - | return XGdkToplevelShowWindowMenu(x.GoPointer(), EventVar.GoPointer()) | |
| 257 | - | ||
| 256 | + | cret := XGdkToplevelShowWindowMenu(x.GoPointer(), EventVar.GoPointer()) | |
| 257 | + | return cret | |
| 258 | 258 | } | |
| 259 | 259 | ||
| 260 | 260 | // Returns whether the desktop environment supports | |
| 261 | 261 | // tiled window states. | |
| 262 | 262 | func (x *ToplevelBase) SupportsEdgeConstraints() bool { | |
| 263 | 263 | ||
| 264 | - | return XGdkToplevelSupportsEdgeConstraints(x.GoPointer()) | |
| 265 | - | ||
| 264 | + | cret := XGdkToplevelSupportsEdgeConstraints(x.GoPointer()) | |
| 265 | + | return cret | |
| 266 | 266 | } | |
| 267 | 267 | ||
| 268 | 268 | func (x *ToplevelBase) TitlebarGesture(GestureVar TitlebarGesture) bool { | |
| 269 | 269 | ||
| 270 | - | return XGdkToplevelTitlebarGesture(x.GoPointer(), GestureVar) | |
| 271 | - | ||
| 270 | + | cret := XGdkToplevelTitlebarGesture(x.GoPointer(), GestureVar) | |
| 271 | + | return cret | |
| 272 | 272 | } | |
| 273 | 273 | ||
| 274 | 274 | var XGdkToplevelBeginMove func(uintptr, uintptr, int, float64, float64, uint32) | |
M v4/gdk/gdktoplevelsize.go +2 -2
| @@ -15,8 +15,8 @@ var xToplevelSizeGetType func() []interface{} | |||
| 15 | 15 | ||
| 16 | 16 | func ToplevelSizeGetType() []interface{} { | |
| 17 | 17 | ||
| 18 | - | return xToplevelSizeGetType() | |
| 19 | - | ||
| 18 | + | cret := xToplevelSizeGetType() | |
| 19 | + | return cret | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | 22 | func init() { | |
M v4/gdk/gdkvulkancontext.go +8 -2
| @@ -4,6 +4,7 @@ package gdk | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/v4/gio" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -87,8 +88,13 @@ func (x *VulkanContext) ConnectImagesUpdated(cb func(VulkanContext)) { | |||
| 87 | 88 | // In this pattern, a caller would expect to be able to call g_initable_init() | |
| 88 | 89 | // on the result of g_object_new(), regardless of whether it is in fact a new | |
| 89 | 90 | // instance. | |
| 90 | - | func (x *VulkanContext) Init(CancellableVar *gio.Cancellable) bool { | |
| 91 | + | func (x *VulkanContext) Init(CancellableVar *gio.Cancellable) (bool, error) { | |
| 92 | + | var cerr *glib.Error | |
| 91 | 93 | ||
| 92 | - | return gio.XGInitableInit(x.GoPointer(), CancellableVar.GoPointer()) | |
| 94 | + | cret := gio.XGInitableInit(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 95 | + | if cerr == nil { | |
| 96 | + | return cret, nil | |
| 97 | + | } | |
| 98 | + | return cret, cerr | |
| 93 | 99 | ||
| 94 | 100 | } | |
M v4/gdk/main.go +6 -6
| @@ -21,24 +21,24 @@ var xGlErrorQuark func() glib.Quark | |||
| 21 | 21 | ||
| 22 | 22 | func GlErrorQuark() glib.Quark { | |
| 23 | 23 | ||
| 24 | - | return xGlErrorQuark() | |
| 25 | - | ||
| 24 | + | cret := xGlErrorQuark() | |
| 25 | + | return cret | |
| 26 | 26 | } | |
| 27 | 27 | ||
| 28 | 28 | var xTextureErrorQuark func() glib.Quark | |
| 29 | 29 | ||
| 30 | 30 | func TextureErrorQuark() glib.Quark { | |
| 31 | 31 | ||
| 32 | - | return xTextureErrorQuark() | |
| 33 | - | ||
| 32 | + | cret := xTextureErrorQuark() | |
| 33 | + | return cret | |
| 34 | 34 | } | |
| 35 | 35 | ||
| 36 | 36 | var xVulkanErrorQuark func() glib.Quark | |
| 37 | 37 | ||
| 38 | 38 | func VulkanErrorQuark() glib.Quark { | |
| 39 | 39 | ||
| 40 | - | return xVulkanErrorQuark() | |
| 41 | - | ||
| 40 | + | cret := xVulkanErrorQuark() | |
| 41 | + | return cret | |
| 42 | 42 | } | |
| 43 | 43 | ||
| 44 | 44 | func init() { | |
M v4/gdkpixbuf/gdk-pixbuf-animation.go +106 -80
| @@ -46,7 +46,7 @@ func PixbufAnimationNewFromInternalPtr(ptr uintptr) *PixbufAnimation { | |||
| 46 | 46 | return cls | |
| 47 | 47 | } | |
| 48 | 48 | ||
| 49 | - | var xNewFromFilePixbufAnimation func(string) uintptr | |
| 49 | + | var xNewFromFilePixbufAnimation func(string, **glib.Error) uintptr | |
| 50 | 50 | ||
| 51 | 51 | // Creates a new animation by loading it from a file. | |
| 52 | 52 | // | |
| @@ -56,35 +56,49 @@ var xNewFromFilePixbufAnimation func(string) uintptr | |||
| 56 | 56 | // with a single frame will be created. | |
| 57 | 57 | // | |
| 58 | 58 | // Possible errors are in the `GDK_PIXBUF_ERROR` and `G_FILE_ERROR` domains. | |
| 59 | - | func NewFromFilePixbufAnimation(FilenameVar string) *PixbufAnimation { | |
| 60 | - | NewFromFilePixbufAnimationPtr := xNewFromFilePixbufAnimation(FilenameVar) | |
| 61 | - | if NewFromFilePixbufAnimationPtr == 0 { | |
| 62 | - | return nil | |
| 59 | + | func NewFromFilePixbufAnimation(FilenameVar string) (*PixbufAnimation, error) { | |
| 60 | + | var cls *PixbufAnimation | |
| 61 | + | var cerr *glib.Error | |
| 62 | + | ||
| 63 | + | cret := xNewFromFilePixbufAnimation(FilenameVar, &cerr) | |
| 64 | + | ||
| 65 | + | if cret == 0 { | |
| 66 | + | return cls, cerr | |
| 67 | + | } | |
| 68 | + | cls = &PixbufAnimation{} | |
| 69 | + | cls.Ptr = cret | |
| 70 | + | if cerr == nil { | |
| 71 | + | return cls, nil | |
| 63 | 72 | } | |
| 73 | + | return cls, cerr | |
| 64 | 74 | ||
| 65 | - | NewFromFilePixbufAnimationCls := &PixbufAnimation{} | |
| 66 | - | NewFromFilePixbufAnimationCls.Ptr = NewFromFilePixbufAnimationPtr | |
| 67 | - | return NewFromFilePixbufAnimationCls | |
| 68 | 75 | } | |
| 69 | 76 | ||
| 70 | - | var xNewFromResourcePixbufAnimation func(string) uintptr | |
| 77 | + | var xNewFromResourcePixbufAnimation func(string, **glib.Error) uintptr | |
| 71 | 78 | ||
| 72 | 79 | // Creates a new pixbuf animation by loading an image from an resource. | |
| 73 | 80 | // | |
| 74 | 81 | // The file format is detected automatically. If `NULL` is returned, then | |
| 75 | 82 | // @error will be set. | |
| 76 | - | func NewFromResourcePixbufAnimation(ResourcePathVar string) *PixbufAnimation { | |
| 77 | - | NewFromResourcePixbufAnimationPtr := xNewFromResourcePixbufAnimation(ResourcePathVar) | |
| 78 | - | if NewFromResourcePixbufAnimationPtr == 0 { | |
| 79 | - | return nil | |
| 83 | + | func NewFromResourcePixbufAnimation(ResourcePathVar string) (*PixbufAnimation, error) { | |
| 84 | + | var cls *PixbufAnimation | |
| 85 | + | var cerr *glib.Error | |
| 86 | + | ||
| 87 | + | cret := xNewFromResourcePixbufAnimation(ResourcePathVar, &cerr) | |
| 88 | + | ||
| 89 | + | if cret == 0 { | |
| 90 | + | return cls, cerr | |
| 80 | 91 | } | |
| 92 | + | cls = &PixbufAnimation{} | |
| 93 | + | cls.Ptr = cret | |
| 94 | + | if cerr == nil { | |
| 95 | + | return cls, nil | |
| 96 | + | } | |
| 97 | + | return cls, cerr | |
| 81 | 98 | ||
| 82 | - | NewFromResourcePixbufAnimationCls := &PixbufAnimation{} | |
| 83 | - | NewFromResourcePixbufAnimationCls.Ptr = NewFromResourcePixbufAnimationPtr | |
| 84 | - | return NewFromResourcePixbufAnimationCls | |
| 85 | 99 | } | |
| 86 | 100 | ||
| 87 | - | var xNewFromStreamPixbufAnimation func(uintptr, uintptr) uintptr | |
| 101 | + | var xNewFromStreamPixbufAnimation func(uintptr, uintptr, **glib.Error) uintptr | |
| 88 | 102 | ||
| 89 | 103 | // Creates a new animation by loading it from an input stream. | |
| 90 | 104 | // | |
| @@ -98,30 +112,44 @@ var xNewFromStreamPixbufAnimation func(uintptr, uintptr) uintptr | |||
| 98 | 112 | // `G_IO_ERROR` domains. | |
| 99 | 113 | // | |
| 100 | 114 | // The stream is not closed. | |
| 101 | - | func NewFromStreamPixbufAnimation(StreamVar *gio.InputStream, CancellableVar *gio.Cancellable) *PixbufAnimation { | |
| 102 | - | NewFromStreamPixbufAnimationPtr := xNewFromStreamPixbufAnimation(StreamVar.GoPointer(), CancellableVar.GoPointer()) | |
| 103 | - | if NewFromStreamPixbufAnimationPtr == 0 { | |
| 104 | - | return nil | |
| 115 | + | func NewFromStreamPixbufAnimation(StreamVar *gio.InputStream, CancellableVar *gio.Cancellable) (*PixbufAnimation, error) { | |
| 116 | + | var cls *PixbufAnimation | |
| 117 | + | var cerr *glib.Error | |
| 118 | + | ||
| 119 | + | cret := xNewFromStreamPixbufAnimation(StreamVar.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 120 | + | ||
| 121 | + | if cret == 0 { | |
| 122 | + | return cls, cerr | |
| 123 | + | } | |
| 124 | + | cls = &PixbufAnimation{} | |
| 125 | + | cls.Ptr = cret | |
| 126 | + | if cerr == nil { | |
| 127 | + | return cls, nil | |
| 105 | 128 | } | |
| 129 | + | return cls, cerr | |
| 106 | 130 | ||
| 107 | - | NewFromStreamPixbufAnimationCls := &PixbufAnimation{} | |
| 108 | - | NewFromStreamPixbufAnimationCls.Ptr = NewFromStreamPixbufAnimationPtr | |
| 109 | - | return NewFromStreamPixbufAnimationCls | |
| 110 | 131 | } | |
| 111 | 132 | ||
| 112 | - | var xNewFromStreamFinishPixbufAnimation func(uintptr) uintptr | |
| 133 | + | var xNewFromStreamFinishPixbufAnimation func(uintptr, **glib.Error) uintptr | |
| 113 | 134 | ||
| 114 | 135 | // Finishes an asynchronous pixbuf animation creation operation started with | |
| 115 | 136 | // [func@GdkPixbuf.PixbufAnimation.new_from_stream_async]. | |
| 116 | - | func NewFromStreamFinishPixbufAnimation(AsyncResultVar gio.AsyncResult) *PixbufAnimation { | |
| 117 | - | NewFromStreamFinishPixbufAnimationPtr := xNewFromStreamFinishPixbufAnimation(AsyncResultVar.GoPointer()) | |
| 118 | - | if NewFromStreamFinishPixbufAnimationPtr == 0 { | |
| 119 | - | return nil | |
| 137 | + | func NewFromStreamFinishPixbufAnimation(AsyncResultVar gio.AsyncResult) (*PixbufAnimation, error) { | |
| 138 | + | var cls *PixbufAnimation | |
| 139 | + | var cerr *glib.Error | |
| 140 | + | ||
| 141 | + | cret := xNewFromStreamFinishPixbufAnimation(AsyncResultVar.GoPointer(), &cerr) | |
| 142 | + | ||
| 143 | + | if cret == 0 { | |
| 144 | + | return cls, cerr | |
| 145 | + | } | |
| 146 | + | cls = &PixbufAnimation{} | |
| 147 | + | cls.Ptr = cret | |
| 148 | + | if cerr == nil { | |
| 149 | + | return cls, nil | |
| 120 | 150 | } | |
| 151 | + | return cls, cerr | |
| 121 | 152 | ||
| 122 | - | NewFromStreamFinishPixbufAnimationCls := &PixbufAnimation{} | |
| 123 | - | NewFromStreamFinishPixbufAnimationCls.Ptr = NewFromStreamFinishPixbufAnimationPtr | |
| 124 | - | return NewFromStreamFinishPixbufAnimationCls | |
| 125 | 153 | } | |
| 126 | 154 | ||
| 127 | 155 | var xPixbufAnimationGetHeight func(uintptr) int | |
| @@ -129,8 +157,8 @@ var xPixbufAnimationGetHeight func(uintptr) int | |||
| 129 | 157 | // Queries the height of the bounding box of a pixbuf animation. | |
| 130 | 158 | func (x *PixbufAnimation) GetHeight() int { | |
| 131 | 159 | ||
| 132 | - | return xPixbufAnimationGetHeight(x.GoPointer()) | |
| 133 | - | ||
| 160 | + | cret := xPixbufAnimationGetHeight(x.GoPointer()) | |
| 161 | + | return cret | |
| 134 | 162 | } | |
| 135 | 163 | ||
| 136 | 164 | var xPixbufAnimationGetIter func(uintptr, *glib.TimeVal) uintptr | |
| @@ -170,16 +198,16 @@ var xPixbufAnimationGetIter func(uintptr, *glib.TimeVal) uintptr | |||
| 170 | 198 | // | |
| 171 | 199 | // A delay time of -1 is possible, indicating "infinite". | |
| 172 | 200 | func (x *PixbufAnimation) GetIter(StartTimeVar *glib.TimeVal) *PixbufAnimationIter { | |
| 201 | + | var cls *PixbufAnimationIter | |
| 173 | 202 | ||
| 174 | - | GetIterPtr := xPixbufAnimationGetIter(x.GoPointer(), StartTimeVar) | |
| 175 | - | if GetIterPtr == 0 { | |
| 176 | - | return nil | |
| 177 | - | } | |
| 178 | - | ||
| 179 | - | GetIterCls := &PixbufAnimationIter{} | |
| 180 | - | GetIterCls.Ptr = GetIterPtr | |
| 181 | - | return GetIterCls | |
| 203 | + | cret := xPixbufAnimationGetIter(x.GoPointer(), StartTimeVar) | |
| 182 | 204 | ||
| 205 | + | if cret == 0 { | |
| 206 | + | return cls | |
| 207 | + | } | |
| 208 | + | cls = &PixbufAnimationIter{} | |
| 209 | + | cls.Ptr = cret | |
| 210 | + | return cls | |
| 183 | 211 | } | |
| 184 | 212 | ||
| 185 | 213 | var xPixbufAnimationGetStaticImage func(uintptr) uintptr | |
| @@ -196,18 +224,17 @@ var xPixbufAnimationGetStaticImage func(uintptr) uintptr | |||
| 196 | 224 | // If an animation hasn't loaded any frames yet, this function will | |
| 197 | 225 | // return `NULL`. | |
| 198 | 226 | func (x *PixbufAnimation) GetStaticImage() *Pixbuf { | |
| 227 | + | var cls *Pixbuf | |
| 199 | 228 | ||
| 200 | - | GetStaticImagePtr := xPixbufAnimationGetStaticImage(x.GoPointer()) | |
| 201 | - | if GetStaticImagePtr == 0 { | |
| 202 | - | return nil | |
| 203 | - | } | |
| 204 | - | ||
| 205 | - | gobject.IncreaseRef(GetStaticImagePtr) | |
| 206 | - | ||
| 207 | - | GetStaticImageCls := &Pixbuf{} | |
| 208 | - | GetStaticImageCls.Ptr = GetStaticImagePtr | |
| 209 | - | return GetStaticImageCls | |
| 229 | + | cret := xPixbufAnimationGetStaticImage(x.GoPointer()) | |
| 210 | 230 | ||
| 231 | + | if cret == 0 { | |
| 232 | + | return cls | |
| 233 | + | } | |
| 234 | + | gobject.IncreaseRef(cret) | |
| 235 | + | cls = &Pixbuf{} | |
| 236 | + | cls.Ptr = cret | |
| 237 | + | return cls | |
| 211 | 238 | } | |
| 212 | 239 | ||
| 213 | 240 | var xPixbufAnimationGetWidth func(uintptr) int | |
| @@ -215,8 +242,8 @@ var xPixbufAnimationGetWidth func(uintptr) int | |||
| 215 | 242 | // Queries the width of the bounding box of a pixbuf animation. | |
| 216 | 243 | func (x *PixbufAnimation) GetWidth() int { | |
| 217 | 244 | ||
| 218 | - | return xPixbufAnimationGetWidth(x.GoPointer()) | |
| 219 | - | ||
| 245 | + | cret := xPixbufAnimationGetWidth(x.GoPointer()) | |
| 246 | + | return cret | |
| 220 | 247 | } | |
| 221 | 248 | ||
| 222 | 249 | var xPixbufAnimationIsStaticImage func(uintptr) bool | |
| @@ -229,24 +256,24 @@ var xPixbufAnimationIsStaticImage func(uintptr) bool | |||
| 229 | 256 | // the image. | |
| 230 | 257 | func (x *PixbufAnimation) IsStaticImage() bool { | |
| 231 | 258 | ||
| 232 | - | return xPixbufAnimationIsStaticImage(x.GoPointer()) | |
| 233 | - | ||
| 259 | + | cret := xPixbufAnimationIsStaticImage(x.GoPointer()) | |
| 260 | + | return cret | |
| 234 | 261 | } | |
| 235 | 262 | ||
| 236 | 263 | var xPixbufAnimationRef func(uintptr) uintptr | |
| 237 | 264 | ||
| 238 | 265 | // Adds a reference to an animation. | |
| 239 | 266 | func (x *PixbufAnimation) Ref() *PixbufAnimation { | |
| 267 | + | var cls *PixbufAnimation | |
| 240 | 268 | ||
| 241 | - | RefPtr := xPixbufAnimationRef(x.GoPointer()) | |
| 242 | - | if RefPtr == 0 { | |
| 243 | - | return nil | |
| 244 | - | } | |
| 245 | - | ||
| 246 | - | RefCls := &PixbufAnimation{} | |
| 247 | - | RefCls.Ptr = RefPtr | |
| 248 | - | return RefCls | |
| 269 | + | cret := xPixbufAnimationRef(x.GoPointer()) | |
| 249 | 270 | ||
| 271 | + | if cret == 0 { | |
| 272 | + | return cls | |
| 273 | + | } | |
| 274 | + | cls = &PixbufAnimation{} | |
| 275 | + | cls.Ptr = cret | |
| 276 | + | return cls | |
| 250 | 277 | } | |
| 251 | 278 | ||
| 252 | 279 | var xPixbufAnimationUnref func(uintptr) | |
| @@ -303,8 +330,8 @@ var xPixbufAnimationIterAdvance func(uintptr, *glib.TimeVal) bool | |||
| 303 | 330 | // and update the display with the new pixbuf. | |
| 304 | 331 | func (x *PixbufAnimationIter) Advance(CurrentTimeVar *glib.TimeVal) bool { | |
| 305 | 332 | ||
| 306 | - | return xPixbufAnimationIterAdvance(x.GoPointer(), CurrentTimeVar) | |
| 307 | - | ||
| 333 | + | cret := xPixbufAnimationIterAdvance(x.GoPointer(), CurrentTimeVar) | |
| 334 | + | return cret | |
| 308 | 335 | } | |
| 309 | 336 | ||
| 310 | 337 | var xPixbufAnimationIterGetDelayTime func(uintptr) int | |
| @@ -320,8 +347,8 @@ var xPixbufAnimationIterGetDelayTime func(uintptr) int | |||
| 320 | 347 | // for GIF images is currently 20 milliseconds. | |
| 321 | 348 | func (x *PixbufAnimationIter) GetDelayTime() int { | |
| 322 | 349 | ||
| 323 | - | return xPixbufAnimationIterGetDelayTime(x.GoPointer()) | |
| 324 | - | ||
| 350 | + | cret := xPixbufAnimationIterGetDelayTime(x.GoPointer()) | |
| 351 | + | return cret | |
| 325 | 352 | } | |
| 326 | 353 | ||
| 327 | 354 | var xPixbufAnimationIterGetPixbuf func(uintptr) uintptr | |
| @@ -342,18 +369,17 @@ var xPixbufAnimationIterGetPixbuf func(uintptr) uintptr | |||
| 342 | 369 | // Copy the pixbuf to keep it (don't just add a reference), as it may get | |
| 343 | 370 | // recycled as you advance the iterator. | |
| 344 | 371 | func (x *PixbufAnimationIter) GetPixbuf() *Pixbuf { | |
| 372 | + | var cls *Pixbuf | |
| 345 | 373 | ||
| 346 | - | GetPixbufPtr := xPixbufAnimationIterGetPixbuf(x.GoPointer()) | |
| 347 | - | if GetPixbufPtr == 0 { | |
| 348 | - | return nil | |
| 349 | - | } | |
| 350 | - | ||
| 351 | - | gobject.IncreaseRef(GetPixbufPtr) | |
| 352 | - | ||
| 353 | - | GetPixbufCls := &Pixbuf{} | |
| 354 | - | GetPixbufCls.Ptr = GetPixbufPtr | |
| 355 | - | return GetPixbufCls | |
| 374 | + | cret := xPixbufAnimationIterGetPixbuf(x.GoPointer()) | |
| 356 | 375 | ||
| 376 | + | if cret == 0 { | |
| 377 | + | return cls | |
| 378 | + | } | |
| 379 | + | gobject.IncreaseRef(cret) | |
| 380 | + | cls = &Pixbuf{} | |
| 381 | + | cls.Ptr = cret | |
| 382 | + | return cls | |
| 357 | 383 | } | |
| 358 | 384 | ||
| 359 | 385 | var xPixbufAnimationIterOnCurrentlyLoadingFrame func(uintptr) bool | |
| @@ -366,8 +392,8 @@ var xPixbufAnimationIterOnCurrentlyLoadingFrame func(uintptr) bool | |||
| 366 | 392 | // you will need to redraw the screen for the updated area. | |
| 367 | 393 | func (x *PixbufAnimationIter) OnCurrentlyLoadingFrame() bool { | |
| 368 | 394 | ||
| 369 | - | return xPixbufAnimationIterOnCurrentlyLoadingFrame(x.GoPointer()) | |
| 370 | - | ||
| 395 | + | cret := xPixbufAnimationIterOnCurrentlyLoadingFrame(x.GoPointer()) | |
| 396 | + | return cret | |
| 371 | 397 | } | |
| 372 | 398 | ||
| 373 | 399 | func (c *PixbufAnimationIter) GoPointer() uintptr { | |
M v4/gdkpixbuf/gdk-pixbuf-io.go +19 -16
| @@ -1,7 +1,10 @@ | |||
| 1 | 1 | // Package gdkpixbuf was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | 2 | package gdkpixbuf | |
| 3 | 3 | ||
| 4 | - | import "github.com/jwijenbergh/puregotk/v4/gmodule" | |
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 6 | + | "github.com/jwijenbergh/puregotk/v4/gmodule" | |
| 7 | + | ) | |
| 5 | 8 | ||
| 6 | 9 | // Sets up the image loading state. | |
| 7 | 10 | // | |
| @@ -12,7 +15,7 @@ import "github.com/jwijenbergh/puregotk/v4/gmodule" | |||
| 12 | 15 | // from this function; the state object will then be updated from the | |
| 13 | 16 | // [callback@GdkPixbuf.PixbufModuleIncrementLoadFunc] callback, and will be freed | |
| 14 | 17 | // by [callback@GdkPixbuf.PixbufModuleStopLoadFunc] callback. | |
| 15 | - | type PixbufModuleBeginLoadFunc func(uintptr, uintptr, uintptr, uintptr) uintptr | |
| 18 | + | type PixbufModuleBeginLoadFunc func(uintptr, uintptr, uintptr, uintptr, **glib.Error) uintptr | |
| 16 | 19 | ||
| 17 | 20 | // Defines the type of the function used to fill a | |
| 18 | 21 | // #GdkPixbufFormat structure with information about a module. | |
| @@ -23,17 +26,17 @@ type PixbufModuleFillInfoFunc func(*PixbufFormat) | |||
| 23 | 26 | type PixbufModuleFillVtableFunc func(*PixbufModule) | |
| 24 | 27 | ||
| 25 | 28 | // Incrementally loads a buffer into the image data. | |
| 26 | - | type PixbufModuleIncrementLoadFunc func(uintptr, uintptr, uint) bool | |
| 29 | + | type PixbufModuleIncrementLoadFunc func(uintptr, uintptr, uint, **glib.Error) bool | |
| 27 | 30 | ||
| 28 | 31 | // Loads a file from a standard C file stream into a new `GdkPixbufAnimation`. | |
| 29 | 32 | // | |
| 30 | 33 | // In case of error, this function should return `NULL` and set the `error` argument. | |
| 31 | - | type PixbufModuleLoadAnimationFunc func(uintptr) uintptr | |
| 34 | + | type PixbufModuleLoadAnimationFunc func(uintptr, **glib.Error) uintptr | |
| 32 | 35 | ||
| 33 | 36 | // Loads a file from a standard C file stream into a new `GdkPixbuf`. | |
| 34 | 37 | // | |
| 35 | 38 | // In case of error, this function should return `NULL` and set the `error` argument. | |
| 36 | - | type PixbufModuleLoadFunc func(uintptr) uintptr | |
| 39 | + | type PixbufModuleLoadFunc func(uintptr, **glib.Error) uintptr | |
| 37 | 40 | ||
| 38 | 41 | // Loads XPM data into a new `GdkPixbuf`. | |
| 39 | 42 | type PixbufModuleLoadXpmDataFunc func(uintptr) uintptr | |
| @@ -51,14 +54,14 @@ type PixbufModulePreparedFunc func(uintptr, uintptr, uintptr) | |||
| 51 | 54 | // The optional `option_keys` and `option_values` arrays contain the keys and | |
| 52 | 55 | // values (in the same order) for attributes to be saved alongside the image | |
| 53 | 56 | // data. | |
| 54 | - | type PixbufModuleSaveCallbackFunc func(uintptr, uintptr, uintptr, uintptr, uintptr) bool | |
| 57 | + | type PixbufModuleSaveCallbackFunc func(uintptr, uintptr, uintptr, uintptr, uintptr, **glib.Error) bool | |
| 55 | 58 | ||
| 56 | 59 | // Saves a `GdkPixbuf` into a standard C file stream. | |
| 57 | 60 | // | |
| 58 | 61 | // The optional `param_keys` and `param_values` arrays contain the keys and | |
| 59 | 62 | // values (in the same order) for attributes to be saved alongside the image | |
| 60 | 63 | // data. | |
| 61 | - | type PixbufModuleSaveFunc func(uintptr, uintptr, uintptr, uintptr) bool | |
| 64 | + | type PixbufModuleSaveFunc func(uintptr, uintptr, uintptr, uintptr, **glib.Error) bool | |
| 62 | 65 | ||
| 63 | 66 | // Checks whether the given `option_key` is supported when saving. | |
| 64 | 67 | type PixbufModuleSaveOptionSupportedFunc func(string) bool | |
| @@ -81,7 +84,7 @@ type PixbufModuleSizeFunc func(int, int, uintptr) | |||
| 81 | 84 | // Finalizes the image loading state. | |
| 82 | 85 | // | |
| 83 | 86 | // This function is called on success and error states. | |
| 84 | - | type PixbufModuleStopLoadFunc func(uintptr) bool | |
| 87 | + | type PixbufModuleStopLoadFunc func(uintptr, **glib.Error) bool | |
| 85 | 88 | ||
| 86 | 89 | // Defines the type of the function that gets called every time a region | |
| 87 | 90 | // of @pixbuf is updated. | |
| @@ -97,13 +100,13 @@ type PixbufModuleUpdatedFunc func(uintptr, int, int, int, int, uintptr) | |||
| 97 | 100 | // Only modules should access the fields directly, applications should | |
| 98 | 101 | // use the `gdk_pixbuf_format_*` family of functions. | |
| 99 | 102 | type PixbufFormat struct { | |
| 100 | - | Name string | |
| 103 | + | Name uintptr | |
| 101 | 104 | ||
| 102 | 105 | Signature *PixbufModulePattern | |
| 103 | 106 | ||
| 104 | - | Domain string | |
| 107 | + | Domain uintptr | |
| 105 | 108 | ||
| 106 | - | Description string | |
| 109 | + | Description uintptr | |
| 107 | 110 | ||
| 108 | 111 | MimeTypes uintptr | |
| 109 | 112 | ||
| @@ -113,7 +116,7 @@ type PixbufFormat struct { | |||
| 113 | 116 | ||
| 114 | 117 | Disabled bool | |
| 115 | 118 | ||
| 116 | - | License string | |
| 119 | + | License uintptr | |
| 117 | 120 | } | |
| 118 | 121 | ||
| 119 | 122 | // A `GdkPixbufModule` contains the necessary functions to load and save | |
| @@ -162,9 +165,9 @@ type PixbufFormat struct { | |||
| 162 | 165 | // `$libdir/gdk-pixbuf-2.0/$version/loaders.cache`, unless overridden | |
| 163 | 166 | // by the environment variable `GDK_PIXBUF_MODULE_FILE`) | |
| 164 | 167 | type PixbufModule struct { | |
| 165 | - | ModuleName string | |
| 168 | + | ModuleName uintptr | |
| 166 | 169 | ||
| 167 | - | ModulePath string | |
| 170 | + | ModulePath uintptr | |
| 168 | 171 | ||
| 169 | 172 | Module *gmodule.Module | |
| 170 | 173 | ||
| @@ -222,9 +225,9 @@ type PixbufModule struct { | |||
| 222 | 225 | // In the example above, the signature matches e.g. "auud\0" with | |
| 223 | 226 | // relevance 100, and "blau" with relevance 90. | |
| 224 | 227 | type PixbufModulePattern struct { | |
| 225 | - | Prefix string | |
| 228 | + | Prefix uintptr | |
| 226 | 229 | ||
| 227 | - | Mask string | |
| 230 | + | Mask uintptr | |
| 228 | 231 | ||
| 229 | 232 | Relevance int | |
| 230 | 233 | } | |
M v4/gdkpixbuf/gdk-pixbuf-loader.go +82 -53
| @@ -71,17 +71,19 @@ var xNewPixbufLoader func() uintptr | |||
| 71 | 71 | ||
| 72 | 72 | // Creates a new pixbuf loader object. | |
| 73 | 73 | func NewPixbufLoader() *PixbufLoader { | |
| 74 | - | NewPixbufLoaderPtr := xNewPixbufLoader() | |
| 75 | - | if NewPixbufLoaderPtr == 0 { | |
| 76 | - | return nil | |
| 77 | - | } | |
| 74 | + | var cls *PixbufLoader | |
| 75 | + | ||
| 76 | + | cret := xNewPixbufLoader() | |
| 78 | 77 | ||
| 79 | - | NewPixbufLoaderCls := &PixbufLoader{} | |
| 80 | - | NewPixbufLoaderCls.Ptr = NewPixbufLoaderPtr | |
| 81 | - | return NewPixbufLoaderCls | |
| 78 | + | if cret == 0 { | |
| 79 | + | return cls | |
| 80 | + | } | |
| 81 | + | cls = &PixbufLoader{} | |
| 82 | + | cls.Ptr = cret | |
| 83 | + | return cls | |
| 82 | 84 | } | |
| 83 | 85 | ||
| 84 | - | var xNewWithMimeTypePixbufLoader func(string) uintptr | |
| 86 | + | var xNewWithMimeTypePixbufLoader func(string, **glib.Error) uintptr | |
| 85 | 87 | ||
| 86 | 88 | // Creates a new pixbuf loader object that always attempts to parse | |
| 87 | 89 | // image data as if it were an image of MIME type @mime_type, instead of | |
| @@ -98,18 +100,25 @@ var xNewWithMimeTypePixbufLoader func(string) uintptr | |||
| 98 | 100 | // To obtain the full list of supported mime types, call | |
| 99 | 101 | // gdk_pixbuf_format_get_mime_types() on each of the #GdkPixbufFormat | |
| 100 | 102 | // structs returned by gdk_pixbuf_get_formats(). | |
| 101 | - | func NewWithMimeTypePixbufLoader(MimeTypeVar string) *PixbufLoader { | |
| 102 | - | NewWithMimeTypePixbufLoaderPtr := xNewWithMimeTypePixbufLoader(MimeTypeVar) | |
| 103 | - | if NewWithMimeTypePixbufLoaderPtr == 0 { | |
| 104 | - | return nil | |
| 103 | + | func NewWithMimeTypePixbufLoader(MimeTypeVar string) (*PixbufLoader, error) { | |
| 104 | + | var cls *PixbufLoader | |
| 105 | + | var cerr *glib.Error | |
| 106 | + | ||
| 107 | + | cret := xNewWithMimeTypePixbufLoader(MimeTypeVar, &cerr) | |
| 108 | + | ||
| 109 | + | if cret == 0 { | |
| 110 | + | return cls, cerr | |
| 105 | 111 | } | |
| 112 | + | cls = &PixbufLoader{} | |
| 113 | + | cls.Ptr = cret | |
| 114 | + | if cerr == nil { | |
| 115 | + | return cls, nil | |
| 116 | + | } | |
| 117 | + | return cls, cerr | |
| 106 | 118 | ||
| 107 | - | NewWithMimeTypePixbufLoaderCls := &PixbufLoader{} | |
| 108 | - | NewWithMimeTypePixbufLoaderCls.Ptr = NewWithMimeTypePixbufLoaderPtr | |
| 109 | - | return NewWithMimeTypePixbufLoaderCls | |
| 110 | 119 | } | |
| 111 | 120 | ||
| 112 | - | var xNewWithTypePixbufLoader func(string) uintptr | |
| 121 | + | var xNewWithTypePixbufLoader func(string, **glib.Error) uintptr | |
| 113 | 122 | ||
| 114 | 123 | // Creates a new pixbuf loader object that always attempts to parse | |
| 115 | 124 | // image data as if it were an image of type @image_type, instead of | |
| @@ -125,15 +134,22 @@ var xNewWithTypePixbufLoader func(string) uintptr | |||
| 125 | 134 | // "xpm" are among the supported formats. To obtain the full list of | |
| 126 | 135 | // supported image formats, call gdk_pixbuf_format_get_name() on each | |
| 127 | 136 | // of the #GdkPixbufFormat structs returned by gdk_pixbuf_get_formats(). | |
| 128 | - | func NewWithTypePixbufLoader(ImageTypeVar string) *PixbufLoader { | |
| 129 | - | NewWithTypePixbufLoaderPtr := xNewWithTypePixbufLoader(ImageTypeVar) | |
| 130 | - | if NewWithTypePixbufLoaderPtr == 0 { | |
| 131 | - | return nil | |
| 137 | + | func NewWithTypePixbufLoader(ImageTypeVar string) (*PixbufLoader, error) { | |
| 138 | + | var cls *PixbufLoader | |
| 139 | + | var cerr *glib.Error | |
| 140 | + | ||
| 141 | + | cret := xNewWithTypePixbufLoader(ImageTypeVar, &cerr) | |
| 142 | + | ||
| 143 | + | if cret == 0 { | |
| 144 | + | return cls, cerr | |
| 132 | 145 | } | |
| 146 | + | cls = &PixbufLoader{} | |
| 147 | + | cls.Ptr = cret | |
| 148 | + | if cerr == nil { | |
| 149 | + | return cls, nil | |
| 150 | + | } | |
| 151 | + | return cls, cerr | |
| 133 | 152 | ||
| 134 | - | NewWithTypePixbufLoaderCls := &PixbufLoader{} | |
| 135 | - | NewWithTypePixbufLoaderCls.Ptr = NewWithTypePixbufLoaderPtr | |
| 136 | - | return NewWithTypePixbufLoaderCls | |
| 137 | 153 | } | |
| 138 | 154 | ||
| 139 | 155 | var xPixbufLoaderClose func(uintptr) bool | |
| @@ -153,9 +169,14 @@ var xPixbufLoaderClose func(uintptr) bool | |||
| 153 | 169 | // | |
| 154 | 170 | // Remember that this function does not release a reference on the loader, so | |
| 155 | 171 | // you will need to explicitly release any reference you hold. | |
| 156 | - | func (x *PixbufLoader) Close() bool { | |
| 172 | + | func (x *PixbufLoader) Close() (bool, error) { | |
| 173 | + | var cerr *glib.Error | |
| 157 | 174 | ||
| 158 | - | return xPixbufLoaderClose(x.GoPointer()) | |
| 175 | + | cret := xPixbufLoaderClose(x.GoPointer()) | |
| 176 | + | if cerr == nil { | |
| 177 | + | return cret, nil | |
| 178 | + | } | |
| 179 | + | return cret, cerr | |
| 159 | 180 | ||
| 160 | 181 | } | |
| 161 | 182 | ||
| @@ -170,18 +191,17 @@ var xPixbufLoaderGetAnimation func(uintptr) uintptr | |||
| 170 | 191 | // If the loader doesn't have enough bytes yet, and hasn't emitted the `area-prepared` | |
| 171 | 192 | // signal, this function will return `NULL`. | |
| 172 | 193 | func (x *PixbufLoader) GetAnimation() *PixbufAnimation { | |
| 194 | + | var cls *PixbufAnimation | |
| 173 | 195 | ||
| 174 | - | GetAnimationPtr := xPixbufLoaderGetAnimation(x.GoPointer()) | |
| 175 | - | if GetAnimationPtr == 0 { | |
| 176 | - | return nil | |
| 177 | - | } | |
| 178 | - | ||
| 179 | - | gobject.IncreaseRef(GetAnimationPtr) | |
| 180 | - | ||
| 181 | - | GetAnimationCls := &PixbufAnimation{} | |
| 182 | - | GetAnimationCls.Ptr = GetAnimationPtr | |
| 183 | - | return GetAnimationCls | |
| 196 | + | cret := xPixbufLoaderGetAnimation(x.GoPointer()) | |
| 184 | 197 | ||
| 198 | + | if cret == 0 { | |
| 199 | + | return cls | |
| 200 | + | } | |
| 201 | + | gobject.IncreaseRef(cret) | |
| 202 | + | cls = &PixbufAnimation{} | |
| 203 | + | cls.Ptr = cret | |
| 204 | + | return cls | |
| 185 | 205 | } | |
| 186 | 206 | ||
| 187 | 207 | var xPixbufLoaderGetFormat func(uintptr) *PixbufFormat | |
| @@ -190,8 +210,8 @@ var xPixbufLoaderGetFormat func(uintptr) *PixbufFormat | |||
| 190 | 210 | // currently loading image file. | |
| 191 | 211 | func (x *PixbufLoader) GetFormat() *PixbufFormat { | |
| 192 | 212 | ||
| 193 | - | return xPixbufLoaderGetFormat(x.GoPointer()) | |
| 194 | - | ||
| 213 | + | cret := xPixbufLoaderGetFormat(x.GoPointer()) | |
| 214 | + | return cret | |
| 195 | 215 | } | |
| 196 | 216 | ||
| 197 | 217 | var xPixbufLoaderGetPixbuf func(uintptr) uintptr | |
| @@ -212,18 +232,17 @@ var xPixbufLoaderGetPixbuf func(uintptr) uintptr | |||
| 212 | 232 | // Additionally, if the loader is an animation, it will return the "static | |
| 213 | 233 | // image" of the animation (see gdk_pixbuf_animation_get_static_image()). | |
| 214 | 234 | func (x *PixbufLoader) GetPixbuf() *Pixbuf { | |
| 235 | + | var cls *Pixbuf | |
| 215 | 236 | ||
| 216 | - | GetPixbufPtr := xPixbufLoaderGetPixbuf(x.GoPointer()) | |
| 217 | - | if GetPixbufPtr == 0 { | |
| 218 | - | return nil | |
| 219 | - | } | |
| 220 | - | ||
| 221 | - | gobject.IncreaseRef(GetPixbufPtr) | |
| 222 | - | ||
| 223 | - | GetPixbufCls := &Pixbuf{} | |
| 224 | - | GetPixbufCls.Ptr = GetPixbufPtr | |
| 225 | - | return GetPixbufCls | |
| 237 | + | cret := xPixbufLoaderGetPixbuf(x.GoPointer()) | |
| 226 | 238 | ||
| 239 | + | if cret == 0 { | |
| 240 | + | return cls | |
| 241 | + | } | |
| 242 | + | gobject.IncreaseRef(cret) | |
| 243 | + | cls = &Pixbuf{} | |
| 244 | + | cls.Ptr = cret | |
| 245 | + | return cls | |
| 227 | 246 | } | |
| 228 | 247 | ||
| 229 | 248 | var xPixbufLoaderSetSize func(uintptr, int, int) | |
| @@ -242,21 +261,31 @@ func (x *PixbufLoader) SetSize(WidthVar int, HeightVar int) { | |||
| 242 | 261 | ||
| 243 | 262 | } | |
| 244 | 263 | ||
| 245 | - | var xPixbufLoaderWrite func(uintptr, uintptr, uint) bool | |
| 264 | + | var xPixbufLoaderWrite func(uintptr, uintptr, uint, **glib.Error) bool | |
| 246 | 265 | ||
| 247 | 266 | // Parses the next `count` bytes in the given image buffer. | |
| 248 | - | func (x *PixbufLoader) Write(BufVar uintptr, CountVar uint) bool { | |
| 267 | + | func (x *PixbufLoader) Write(BufVar uintptr, CountVar uint) (bool, error) { | |
| 268 | + | var cerr *glib.Error | |
| 249 | 269 | ||
| 250 | - | return xPixbufLoaderWrite(x.GoPointer(), BufVar, CountVar) | |
| 270 | + | cret := xPixbufLoaderWrite(x.GoPointer(), BufVar, CountVar, &cerr) | |
| 271 | + | if cerr == nil { | |
| 272 | + | return cret, nil | |
| 273 | + | } | |
| 274 | + | return cret, cerr | |
| 251 | 275 | ||
| 252 | 276 | } | |
| 253 | 277 | ||
| 254 | - | var xPixbufLoaderWriteBytes func(uintptr, *glib.Bytes) bool | |
| 278 | + | var xPixbufLoaderWriteBytes func(uintptr, *glib.Bytes, **glib.Error) bool | |
| 255 | 279 | ||
| 256 | 280 | // Parses the next contents of the given image buffer. | |
| 257 | - | func (x *PixbufLoader) WriteBytes(BufferVar *glib.Bytes) bool { | |
| 281 | + | func (x *PixbufLoader) WriteBytes(BufferVar *glib.Bytes) (bool, error) { | |
| 282 | + | var cerr *glib.Error | |
| 258 | 283 | ||
| 259 | - | return xPixbufLoaderWriteBytes(x.GoPointer(), BufferVar) | |
| 284 | + | cret := xPixbufLoaderWriteBytes(x.GoPointer(), BufferVar, &cerr) | |
| 285 | + | if cerr == nil { | |
| 286 | + | return cret, nil | |
| 287 | + | } | |
| 288 | + | return cret, cerr | |
| 260 | 289 | ||
| 261 | 290 | } | |
| 262 | 291 | ||
M v4/gdkpixbuf/gdk-pixbuf-simple-anim.go +11 -9
| @@ -24,14 +24,16 @@ var xNewPixbufSimpleAnim func(int, int, float32) uintptr | |||
| 24 | 24 | ||
| 25 | 25 | // Creates a new, empty animation. | |
| 26 | 26 | func NewPixbufSimpleAnim(WidthVar int, HeightVar int, RateVar float32) *PixbufSimpleAnim { | |
| 27 | - | NewPixbufSimpleAnimPtr := xNewPixbufSimpleAnim(WidthVar, HeightVar, RateVar) | |
| 28 | - | if NewPixbufSimpleAnimPtr == 0 { | |
| 29 | - | return nil | |
| 30 | - | } | |
| 27 | + | var cls *PixbufSimpleAnim | |
| 28 | + | ||
| 29 | + | cret := xNewPixbufSimpleAnim(WidthVar, HeightVar, RateVar) | |
| 31 | 30 | ||
| 32 | - | NewPixbufSimpleAnimCls := &PixbufSimpleAnim{} | |
| 33 | - | NewPixbufSimpleAnimCls.Ptr = NewPixbufSimpleAnimPtr | |
| 34 | - | return NewPixbufSimpleAnimCls | |
| 31 | + | if cret == 0 { | |
| 32 | + | return cls | |
| 33 | + | } | |
| 34 | + | cls = &PixbufSimpleAnim{} | |
| 35 | + | cls.Ptr = cret | |
| 36 | + | return cls | |
| 35 | 37 | } | |
| 36 | 38 | ||
| 37 | 39 | var xPixbufSimpleAnimAddFrame func(uintptr, uintptr) | |
| @@ -50,8 +52,8 @@ var xPixbufSimpleAnimGetLoop func(uintptr) bool | |||
| 50 | 52 | // Gets whether @animation should loop indefinitely when it reaches the end. | |
| 51 | 53 | func (x *PixbufSimpleAnim) GetLoop() bool { | |
| 52 | 54 | ||
| 53 | - | return xPixbufSimpleAnimGetLoop(x.GoPointer()) | |
| 54 | - | ||
| 55 | + | cret := xPixbufSimpleAnimGetLoop(x.GoPointer()) | |
| 56 | + | return cret | |
| 55 | 57 | } | |
| 56 | 58 | ||
| 57 | 59 | var xPixbufSimpleAnimSetLoop func(uintptr, bool) | |
M v4/gdkpixbuf/gdk-pixbuf.go +349 -248
| @@ -166,14 +166,16 @@ var xNewPixbuf func(Colorspace, bool, int, int, int) uintptr | |||
| 166 | 166 | // The buffer has an optimal rowstride. Note that the buffer is not cleared; | |
| 167 | 167 | // you will have to fill it completely yourself. | |
| 168 | 168 | func NewPixbuf(ColorspaceVar Colorspace, HasAlphaVar bool, BitsPerSampleVar int, WidthVar int, HeightVar int) *Pixbuf { | |
| 169 | - | NewPixbufPtr := xNewPixbuf(ColorspaceVar, HasAlphaVar, BitsPerSampleVar, WidthVar, HeightVar) | |
| 170 | - | if NewPixbufPtr == 0 { | |
| 171 | - | return nil | |
| 172 | - | } | |
| 169 | + | var cls *Pixbuf | |
| 170 | + | ||
| 171 | + | cret := xNewPixbuf(ColorspaceVar, HasAlphaVar, BitsPerSampleVar, WidthVar, HeightVar) | |
| 173 | 172 | ||
| 174 | - | NewPixbufCls := &Pixbuf{} | |
| 175 | - | NewPixbufCls.Ptr = NewPixbufPtr | |
| 176 | - | return NewPixbufCls | |
| 173 | + | if cret == 0 { | |
| 174 | + | return cls | |
| 175 | + | } | |
| 176 | + | cls = &Pixbuf{} | |
| 177 | + | cls.Ptr = cret | |
| 178 | + | return cls | |
| 177 | 179 | } | |
| 178 | 180 | ||
| 179 | 181 | var xNewFromBytesPixbuf func(*glib.Bytes, Colorspace, bool, int, int, int, int) uintptr | |
| @@ -185,14 +187,16 @@ var xNewFromBytesPixbuf func(*glib.Bytes, Colorspace, bool, int, int, int, int) | |||
| 185 | 187 | // This is the `GBytes` variant of gdk_pixbuf_new_from_data(), useful | |
| 186 | 188 | // for language bindings. | |
| 187 | 189 | func NewFromBytesPixbuf(DataVar *glib.Bytes, ColorspaceVar Colorspace, HasAlphaVar bool, BitsPerSampleVar int, WidthVar int, HeightVar int, RowstrideVar int) *Pixbuf { | |
| 188 | - | NewFromBytesPixbufPtr := xNewFromBytesPixbuf(DataVar, ColorspaceVar, HasAlphaVar, BitsPerSampleVar, WidthVar, HeightVar, RowstrideVar) | |
| 189 | - | if NewFromBytesPixbufPtr == 0 { | |
| 190 | - | return nil | |
| 191 | - | } | |
| 190 | + | var cls *Pixbuf | |
| 191 | + | ||
| 192 | + | cret := xNewFromBytesPixbuf(DataVar, ColorspaceVar, HasAlphaVar, BitsPerSampleVar, WidthVar, HeightVar, RowstrideVar) | |
| 192 | 193 | ||
| 193 | - | NewFromBytesPixbufCls := &Pixbuf{} | |
| 194 | - | NewFromBytesPixbufCls.Ptr = NewFromBytesPixbufPtr | |
| 195 | - | return NewFromBytesPixbufCls | |
| 194 | + | if cret == 0 { | |
| 195 | + | return cls | |
| 196 | + | } | |
| 197 | + | cls = &Pixbuf{} | |
| 198 | + | cls.Ptr = cret | |
| 199 | + | return cls | |
| 196 | 200 | } | |
| 197 | 201 | ||
| 198 | 202 | var xNewFromDataPixbuf func(uintptr, Colorspace, bool, int, int, int, int, uintptr, uintptr) uintptr | |
| @@ -209,17 +213,19 @@ var xNewFromDataPixbuf func(uintptr, Colorspace, bool, int, int, int, int, uintp | |||
| 209 | 213 | // | |
| 210 | 214 | // See also: [ctor@GdkPixbuf.Pixbuf.new_from_bytes] | |
| 211 | 215 | func NewFromDataPixbuf(DataVar uintptr, ColorspaceVar Colorspace, HasAlphaVar bool, BitsPerSampleVar int, WidthVar int, HeightVar int, RowstrideVar int, DestroyFnVar PixbufDestroyNotify, DestroyFnDataVar uintptr) *Pixbuf { | |
| 212 | - | NewFromDataPixbufPtr := xNewFromDataPixbuf(DataVar, ColorspaceVar, HasAlphaVar, BitsPerSampleVar, WidthVar, HeightVar, RowstrideVar, purego.NewCallback(DestroyFnVar), DestroyFnDataVar) | |
| 213 | - | if NewFromDataPixbufPtr == 0 { | |
| 214 | - | return nil | |
| 215 | - | } | |
| 216 | + | var cls *Pixbuf | |
| 217 | + | ||
| 218 | + | cret := xNewFromDataPixbuf(DataVar, ColorspaceVar, HasAlphaVar, BitsPerSampleVar, WidthVar, HeightVar, RowstrideVar, purego.NewCallback(DestroyFnVar), DestroyFnDataVar) | |
| 216 | 219 | ||
| 217 | - | NewFromDataPixbufCls := &Pixbuf{} | |
| 218 | - | NewFromDataPixbufCls.Ptr = NewFromDataPixbufPtr | |
| 219 | - | return NewFromDataPixbufCls | |
| 220 | + | if cret == 0 { | |
| 221 | + | return cls | |
| 222 | + | } | |
| 223 | + | cls = &Pixbuf{} | |
| 224 | + | cls.Ptr = cret | |
| 225 | + | return cls | |
| 220 | 226 | } | |
| 221 | 227 | ||
| 222 | - | var xNewFromFilePixbuf func(string) uintptr | |
| 228 | + | var xNewFromFilePixbuf func(string, **glib.Error) uintptr | |
| 223 | 229 | ||
| 224 | 230 | // Creates a new pixbuf by loading an image from a file. | |
| 225 | 231 | // | |
| @@ -233,18 +239,25 @@ var xNewFromFilePixbuf func(string) uintptr | |||
| 233 | 239 | // - the image buffer contains invalid data | |
| 234 | 240 | // | |
| 235 | 241 | // The error domains are `GDK_PIXBUF_ERROR` and `G_FILE_ERROR`. | |
| 236 | - | func NewFromFilePixbuf(FilenameVar string) *Pixbuf { | |
| 237 | - | NewFromFilePixbufPtr := xNewFromFilePixbuf(FilenameVar) | |
| 238 | - | if NewFromFilePixbufPtr == 0 { | |
| 239 | - | return nil | |
| 242 | + | func NewFromFilePixbuf(FilenameVar string) (*Pixbuf, error) { | |
| 243 | + | var cls *Pixbuf | |
| 244 | + | var cerr *glib.Error | |
| 245 | + | ||
| 246 | + | cret := xNewFromFilePixbuf(FilenameVar, &cerr) | |
| 247 | + | ||
| 248 | + | if cret == 0 { | |
| 249 | + | return cls, cerr | |
| 250 | + | } | |
| 251 | + | cls = &Pixbuf{} | |
| 252 | + | cls.Ptr = cret | |
| 253 | + | if cerr == nil { | |
| 254 | + | return cls, nil | |
| 240 | 255 | } | |
| 256 | + | return cls, cerr | |
| 241 | 257 | ||
| 242 | - | NewFromFilePixbufCls := &Pixbuf{} | |
| 243 | - | NewFromFilePixbufCls.Ptr = NewFromFilePixbufPtr | |
| 244 | - | return NewFromFilePixbufCls | |
| 245 | 258 | } | |
| 246 | 259 | ||
| 247 | - | var xNewFromFileAtScalePixbuf func(string, int, int, bool) uintptr | |
| 260 | + | var xNewFromFileAtScalePixbuf func(string, int, int, bool, **glib.Error) uintptr | |
| 248 | 261 | ||
| 249 | 262 | // Creates a new pixbuf by loading an image from a file. | |
| 250 | 263 | // | |
| @@ -268,18 +281,25 @@ var xNewFromFileAtScalePixbuf func(string, int, int, bool) uintptr | |||
| 268 | 281 | // aspect ratio, a `width` or `height` of -1 means to not scale the image | |
| 269 | 282 | // at all in that dimension. Negative values for `width` and `height` are | |
| 270 | 283 | // allowed since 2.8. | |
| 271 | - | func NewFromFileAtScalePixbuf(FilenameVar string, WidthVar int, HeightVar int, PreserveAspectRatioVar bool) *Pixbuf { | |
| 272 | - | NewFromFileAtScalePixbufPtr := xNewFromFileAtScalePixbuf(FilenameVar, WidthVar, HeightVar, PreserveAspectRatioVar) | |
| 273 | - | if NewFromFileAtScalePixbufPtr == 0 { | |
| 274 | - | return nil | |
| 284 | + | func NewFromFileAtScalePixbuf(FilenameVar string, WidthVar int, HeightVar int, PreserveAspectRatioVar bool) (*Pixbuf, error) { | |
| 285 | + | var cls *Pixbuf | |
| 286 | + | var cerr *glib.Error | |
| 287 | + | ||
| 288 | + | cret := xNewFromFileAtScalePixbuf(FilenameVar, WidthVar, HeightVar, PreserveAspectRatioVar, &cerr) | |
| 289 | + | ||
| 290 | + | if cret == 0 { | |
| 291 | + | return cls, cerr | |
| 275 | 292 | } | |
| 293 | + | cls = &Pixbuf{} | |
| 294 | + | cls.Ptr = cret | |
| 295 | + | if cerr == nil { | |
| 296 | + | return cls, nil | |
| 297 | + | } | |
| 298 | + | return cls, cerr | |
| 276 | 299 | ||
| 277 | - | NewFromFileAtScalePixbufCls := &Pixbuf{} | |
| 278 | - | NewFromFileAtScalePixbufCls.Ptr = NewFromFileAtScalePixbufPtr | |
| 279 | - | return NewFromFileAtScalePixbufCls | |
| 280 | 300 | } | |
| 281 | 301 | ||
| 282 | - | var xNewFromFileAtSizePixbuf func(string, int, int) uintptr | |
| 302 | + | var xNewFromFileAtSizePixbuf func(string, int, int, **glib.Error) uintptr | |
| 283 | 303 | ||
| 284 | 304 | // Creates a new pixbuf by loading an image from a file. | |
| 285 | 305 | // | |
| @@ -299,18 +319,25 @@ var xNewFromFileAtSizePixbuf func(string, int, int) uintptr | |||
| 299 | 319 | // than `width` x `height`, if the aspect ratio requires it. To load | |
| 300 | 320 | // and image at the requested size, regardless of aspect ratio, use | |
| 301 | 321 | // [ctor@GdkPixbuf.Pixbuf.new_from_file_at_scale]. | |
| 302 | - | func NewFromFileAtSizePixbuf(FilenameVar string, WidthVar int, HeightVar int) *Pixbuf { | |
| 303 | - | NewFromFileAtSizePixbufPtr := xNewFromFileAtSizePixbuf(FilenameVar, WidthVar, HeightVar) | |
| 304 | - | if NewFromFileAtSizePixbufPtr == 0 { | |
| 305 | - | return nil | |
| 322 | + | func NewFromFileAtSizePixbuf(FilenameVar string, WidthVar int, HeightVar int) (*Pixbuf, error) { | |
| 323 | + | var cls *Pixbuf | |
| 324 | + | var cerr *glib.Error | |
| 325 | + | ||
| 326 | + | cret := xNewFromFileAtSizePixbuf(FilenameVar, WidthVar, HeightVar, &cerr) | |
| 327 | + | ||
| 328 | + | if cret == 0 { | |
| 329 | + | return cls, cerr | |
| 330 | + | } | |
| 331 | + | cls = &Pixbuf{} | |
| 332 | + | cls.Ptr = cret | |
| 333 | + | if cerr == nil { | |
| 334 | + | return cls, nil | |
| 306 | 335 | } | |
| 336 | + | return cls, cerr | |
| 307 | 337 | ||
| 308 | - | NewFromFileAtSizePixbufCls := &Pixbuf{} | |
| 309 | - | NewFromFileAtSizePixbufCls.Ptr = NewFromFileAtSizePixbufPtr | |
| 310 | - | return NewFromFileAtSizePixbufCls | |
| 311 | 338 | } | |
| 312 | 339 | ||
| 313 | - | var xNewFromInlinePixbuf func(int, uintptr, bool) uintptr | |
| 340 | + | var xNewFromInlinePixbuf func(int, uintptr, bool, **glib.Error) uintptr | |
| 314 | 341 | ||
| 315 | 342 | // Creates a `GdkPixbuf` from a flat representation that is suitable for | |
| 316 | 343 | // storing as inline data in a program. | |
| @@ -345,35 +372,49 @@ var xNewFromInlinePixbuf func(int, uintptr, bool) uintptr | |||
| 345 | 372 | // For non-const inline data, you could get out of memory. For untrusted | |
| 346 | 373 | // inline data located at runtime, you could have corrupt inline data in | |
| 347 | 374 | // addition. | |
| 348 | - | func NewFromInlinePixbuf(DataLengthVar int, DataVar uintptr, CopyPixelsVar bool) *Pixbuf { | |
| 349 | - | NewFromInlinePixbufPtr := xNewFromInlinePixbuf(DataLengthVar, DataVar, CopyPixelsVar) | |
| 350 | - | if NewFromInlinePixbufPtr == 0 { | |
| 351 | - | return nil | |
| 375 | + | func NewFromInlinePixbuf(DataLengthVar int, DataVar uintptr, CopyPixelsVar bool) (*Pixbuf, error) { | |
| 376 | + | var cls *Pixbuf | |
| 377 | + | var cerr *glib.Error | |
| 378 | + | ||
| 379 | + | cret := xNewFromInlinePixbuf(DataLengthVar, DataVar, CopyPixelsVar, &cerr) | |
| 380 | + | ||
| 381 | + | if cret == 0 { | |
| 382 | + | return cls, cerr | |
| 383 | + | } | |
| 384 | + | cls = &Pixbuf{} | |
| 385 | + | cls.Ptr = cret | |
| 386 | + | if cerr == nil { | |
| 387 | + | return cls, nil | |
| 352 | 388 | } | |
| 389 | + | return cls, cerr | |
| 353 | 390 | ||
| 354 | - | NewFromInlinePixbufCls := &Pixbuf{} | |
| 355 | - | NewFromInlinePixbufCls.Ptr = NewFromInlinePixbufPtr | |
| 356 | - | return NewFromInlinePixbufCls | |
| 357 | 391 | } | |
| 358 | 392 | ||
| 359 | - | var xNewFromResourcePixbuf func(string) uintptr | |
| 393 | + | var xNewFromResourcePixbuf func(string, **glib.Error) uintptr | |
| 360 | 394 | ||
| 361 | 395 | // Creates a new pixbuf by loading an image from an resource. | |
| 362 | 396 | // | |
| 363 | 397 | // The file format is detected automatically. If `NULL` is returned, then | |
| 364 | 398 | // @error will be set. | |
| 365 | - | func NewFromResourcePixbuf(ResourcePathVar string) *Pixbuf { | |
| 366 | - | NewFromResourcePixbufPtr := xNewFromResourcePixbuf(ResourcePathVar) | |
| 367 | - | if NewFromResourcePixbufPtr == 0 { | |
| 368 | - | return nil | |
| 399 | + | func NewFromResourcePixbuf(ResourcePathVar string) (*Pixbuf, error) { | |
| 400 | + | var cls *Pixbuf | |
| 401 | + | var cerr *glib.Error | |
| 402 | + | ||
| 403 | + | cret := xNewFromResourcePixbuf(ResourcePathVar, &cerr) | |
| 404 | + | ||
| 405 | + | if cret == 0 { | |
| 406 | + | return cls, cerr | |
| 369 | 407 | } | |
| 408 | + | cls = &Pixbuf{} | |
| 409 | + | cls.Ptr = cret | |
| 410 | + | if cerr == nil { | |
| 411 | + | return cls, nil | |
| 412 | + | } | |
| 413 | + | return cls, cerr | |
| 370 | 414 | ||
| 371 | - | NewFromResourcePixbufCls := &Pixbuf{} | |
| 372 | - | NewFromResourcePixbufCls.Ptr = NewFromResourcePixbufPtr | |
| 373 | - | return NewFromResourcePixbufCls | |
| 374 | 415 | } | |
| 375 | 416 | ||
| 376 | - | var xNewFromResourceAtScalePixbuf func(string, int, int, bool) uintptr | |
| 417 | + | var xNewFromResourceAtScalePixbuf func(string, int, int, bool, **glib.Error) uintptr | |
| 377 | 418 | ||
| 378 | 419 | // Creates a new pixbuf by loading an image from an resource. | |
| 379 | 420 | // | |
| @@ -388,18 +429,25 @@ var xNewFromResourceAtScalePixbuf func(string, int, int, bool) uintptr | |||
| 388 | 429 | // @height of -1 means to not scale the image at all in that dimension. | |
| 389 | 430 | // | |
| 390 | 431 | // The stream is not closed. | |
| 391 | - | func NewFromResourceAtScalePixbuf(ResourcePathVar string, WidthVar int, HeightVar int, PreserveAspectRatioVar bool) *Pixbuf { | |
| 392 | - | NewFromResourceAtScalePixbufPtr := xNewFromResourceAtScalePixbuf(ResourcePathVar, WidthVar, HeightVar, PreserveAspectRatioVar) | |
| 393 | - | if NewFromResourceAtScalePixbufPtr == 0 { | |
| 394 | - | return nil | |
| 432 | + | func NewFromResourceAtScalePixbuf(ResourcePathVar string, WidthVar int, HeightVar int, PreserveAspectRatioVar bool) (*Pixbuf, error) { | |
| 433 | + | var cls *Pixbuf | |
| 434 | + | var cerr *glib.Error | |
| 435 | + | ||
| 436 | + | cret := xNewFromResourceAtScalePixbuf(ResourcePathVar, WidthVar, HeightVar, PreserveAspectRatioVar, &cerr) | |
| 437 | + | ||
| 438 | + | if cret == 0 { | |
| 439 | + | return cls, cerr | |
| 395 | 440 | } | |
| 441 | + | cls = &Pixbuf{} | |
| 442 | + | cls.Ptr = cret | |
| 443 | + | if cerr == nil { | |
| 444 | + | return cls, nil | |
| 445 | + | } | |
| 446 | + | return cls, cerr | |
| 396 | 447 | ||
| 397 | - | NewFromResourceAtScalePixbufCls := &Pixbuf{} | |
| 398 | - | NewFromResourceAtScalePixbufCls.Ptr = NewFromResourceAtScalePixbufPtr | |
| 399 | - | return NewFromResourceAtScalePixbufCls | |
| 400 | 448 | } | |
| 401 | 449 | ||
| 402 | - | var xNewFromStreamPixbuf func(uintptr, uintptr) uintptr | |
| 450 | + | var xNewFromStreamPixbuf func(uintptr, uintptr, **glib.Error) uintptr | |
| 403 | 451 | ||
| 404 | 452 | // Creates a new pixbuf by loading an image from an input stream. | |
| 405 | 453 | // | |
| @@ -413,18 +461,25 @@ var xNewFromStreamPixbuf func(uintptr, uintptr) uintptr | |||
| 413 | 461 | // `G_IO_ERROR` domains. | |
| 414 | 462 | // | |
| 415 | 463 | // The stream is not closed. | |
| 416 | - | func NewFromStreamPixbuf(StreamVar *gio.InputStream, CancellableVar *gio.Cancellable) *Pixbuf { | |
| 417 | - | NewFromStreamPixbufPtr := xNewFromStreamPixbuf(StreamVar.GoPointer(), CancellableVar.GoPointer()) | |
| 418 | - | if NewFromStreamPixbufPtr == 0 { | |
| 419 | - | return nil | |
| 464 | + | func NewFromStreamPixbuf(StreamVar *gio.InputStream, CancellableVar *gio.Cancellable) (*Pixbuf, error) { | |
| 465 | + | var cls *Pixbuf | |
| 466 | + | var cerr *glib.Error | |
| 467 | + | ||
| 468 | + | cret := xNewFromStreamPixbuf(StreamVar.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 469 | + | ||
| 470 | + | if cret == 0 { | |
| 471 | + | return cls, cerr | |
| 472 | + | } | |
| 473 | + | cls = &Pixbuf{} | |
| 474 | + | cls.Ptr = cret | |
| 475 | + | if cerr == nil { | |
| 476 | + | return cls, nil | |
| 420 | 477 | } | |
| 478 | + | return cls, cerr | |
| 421 | 479 | ||
| 422 | - | NewFromStreamPixbufCls := &Pixbuf{} | |
| 423 | - | NewFromStreamPixbufCls.Ptr = NewFromStreamPixbufPtr | |
| 424 | - | return NewFromStreamPixbufCls | |
| 425 | 480 | } | |
| 426 | 481 | ||
| 427 | - | var xNewFromStreamAtScalePixbuf func(uintptr, int, int, bool, uintptr) uintptr | |
| 482 | + | var xNewFromStreamAtScalePixbuf func(uintptr, int, int, bool, uintptr, **glib.Error) uintptr | |
| 428 | 483 | ||
| 429 | 484 | // Creates a new pixbuf by loading an image from an input stream. | |
| 430 | 485 | // | |
| @@ -447,30 +502,44 @@ var xNewFromStreamAtScalePixbuf func(uintptr, int, int, bool, uintptr) uintptr | |||
| 447 | 502 | // scale the image at all in that dimension. | |
| 448 | 503 | // | |
| 449 | 504 | // The stream is not closed. | |
| 450 | - | func NewFromStreamAtScalePixbuf(StreamVar *gio.InputStream, WidthVar int, HeightVar int, PreserveAspectRatioVar bool, CancellableVar *gio.Cancellable) *Pixbuf { | |
| 451 | - | NewFromStreamAtScalePixbufPtr := xNewFromStreamAtScalePixbuf(StreamVar.GoPointer(), WidthVar, HeightVar, PreserveAspectRatioVar, CancellableVar.GoPointer()) | |
| 452 | - | if NewFromStreamAtScalePixbufPtr == 0 { | |
| 453 | - | return nil | |
| 505 | + | func NewFromStreamAtScalePixbuf(StreamVar *gio.InputStream, WidthVar int, HeightVar int, PreserveAspectRatioVar bool, CancellableVar *gio.Cancellable) (*Pixbuf, error) { | |
| 506 | + | var cls *Pixbuf | |
| 507 | + | var cerr *glib.Error | |
| 508 | + | ||
| 509 | + | cret := xNewFromStreamAtScalePixbuf(StreamVar.GoPointer(), WidthVar, HeightVar, PreserveAspectRatioVar, CancellableVar.GoPointer(), &cerr) | |
| 510 | + | ||
| 511 | + | if cret == 0 { | |
| 512 | + | return cls, cerr | |
| 513 | + | } | |
| 514 | + | cls = &Pixbuf{} | |
| 515 | + | cls.Ptr = cret | |
| 516 | + | if cerr == nil { | |
| 517 | + | return cls, nil | |
| 454 | 518 | } | |
| 519 | + | return cls, cerr | |
| 455 | 520 | ||
| 456 | - | NewFromStreamAtScalePixbufCls := &Pixbuf{} | |
| 457 | - | NewFromStreamAtScalePixbufCls.Ptr = NewFromStreamAtScalePixbufPtr | |
| 458 | - | return NewFromStreamAtScalePixbufCls | |
| 459 | 521 | } | |
| 460 | 522 | ||
| 461 | - | var xNewFromStreamFinishPixbuf func(uintptr) uintptr | |
| 523 | + | var xNewFromStreamFinishPixbuf func(uintptr, **glib.Error) uintptr | |
| 462 | 524 | ||
| 463 | 525 | // Finishes an asynchronous pixbuf creation operation started with | |
| 464 | 526 | // gdk_pixbuf_new_from_stream_async(). | |
| 465 | - | func NewFromStreamFinishPixbuf(AsyncResultVar gio.AsyncResult) *Pixbuf { | |
| 466 | - | NewFromStreamFinishPixbufPtr := xNewFromStreamFinishPixbuf(AsyncResultVar.GoPointer()) | |
| 467 | - | if NewFromStreamFinishPixbufPtr == 0 { | |
| 468 | - | return nil | |
| 527 | + | func NewFromStreamFinishPixbuf(AsyncResultVar gio.AsyncResult) (*Pixbuf, error) { | |
| 528 | + | var cls *Pixbuf | |
| 529 | + | var cerr *glib.Error | |
| 530 | + | ||
| 531 | + | cret := xNewFromStreamFinishPixbuf(AsyncResultVar.GoPointer(), &cerr) | |
| 532 | + | ||
| 533 | + | if cret == 0 { | |
| 534 | + | return cls, cerr | |
| 469 | 535 | } | |
| 536 | + | cls = &Pixbuf{} | |
| 537 | + | cls.Ptr = cret | |
| 538 | + | if cerr == nil { | |
| 539 | + | return cls, nil | |
| 540 | + | } | |
| 541 | + | return cls, cerr | |
| 470 | 542 | ||
| 471 | - | NewFromStreamFinishPixbufCls := &Pixbuf{} | |
| 472 | - | NewFromStreamFinishPixbufCls.Ptr = NewFromStreamFinishPixbufPtr | |
| 473 | - | return NewFromStreamFinishPixbufCls | |
| 474 | 543 | } | |
| 475 | 544 | ||
| 476 | 545 | var xNewFromXpmDataPixbuf func(uintptr) uintptr | |
| @@ -480,14 +549,16 @@ var xNewFromXpmDataPixbuf func(uintptr) uintptr | |||
| 480 | 549 | // This data is commonly the result of including an XPM file into a | |
| 481 | 550 | // program's C source. | |
| 482 | 551 | func NewFromXpmDataPixbuf(DataVar uintptr) *Pixbuf { | |
| 483 | - | NewFromXpmDataPixbufPtr := xNewFromXpmDataPixbuf(DataVar) | |
| 484 | - | if NewFromXpmDataPixbufPtr == 0 { | |
| 485 | - | return nil | |
| 486 | - | } | |
| 552 | + | var cls *Pixbuf | |
| 487 | 553 | ||
| 488 | - | NewFromXpmDataPixbufCls := &Pixbuf{} | |
| 489 | - | NewFromXpmDataPixbufCls.Ptr = NewFromXpmDataPixbufPtr | |
| 490 | - | return NewFromXpmDataPixbufCls | |
| 554 | + | cret := xNewFromXpmDataPixbuf(DataVar) | |
| 555 | + | ||
| 556 | + | if cret == 0 { | |
| 557 | + | return cls | |
| 558 | + | } | |
| 559 | + | cls = &Pixbuf{} | |
| 560 | + | cls.Ptr = cret | |
| 561 | + | return cls | |
| 491 | 562 | } | |
| 492 | 563 | ||
| 493 | 564 | var xPixbufAddAlpha func(uintptr, bool, byte, byte, byte) uintptr | |
| @@ -506,16 +577,16 @@ var xPixbufAddAlpha func(uintptr, bool, byte, byte, byte) uintptr | |||
| 506 | 577 | // If `substitute_color` is `FALSE`, then the (`r`, `g`, `b`) arguments | |
| 507 | 578 | // will be ignored. | |
| 508 | 579 | func (x *Pixbuf) AddAlpha(SubstituteColorVar bool, RVar byte, GVar byte, BVar byte) *Pixbuf { | |
| 580 | + | var cls *Pixbuf | |
| 509 | 581 | ||
| 510 | - | AddAlphaPtr := xPixbufAddAlpha(x.GoPointer(), SubstituteColorVar, RVar, GVar, BVar) | |
| 511 | - | if AddAlphaPtr == 0 { | |
| 512 | - | return nil | |
| 513 | - | } | |
| 514 | - | ||
| 515 | - | AddAlphaCls := &Pixbuf{} | |
| 516 | - | AddAlphaCls.Ptr = AddAlphaPtr | |
| 517 | - | return AddAlphaCls | |
| 582 | + | cret := xPixbufAddAlpha(x.GoPointer(), SubstituteColorVar, RVar, GVar, BVar) | |
| 518 | 583 | ||
| 584 | + | if cret == 0 { | |
| 585 | + | return cls | |
| 586 | + | } | |
| 587 | + | cls = &Pixbuf{} | |
| 588 | + | cls.Ptr = cret | |
| 589 | + | return cls | |
| 519 | 590 | } | |
| 520 | 591 | ||
| 521 | 592 | var xPixbufApplyEmbeddedOrientation func(uintptr) uintptr | |
| @@ -531,16 +602,16 @@ var xPixbufApplyEmbeddedOrientation func(uintptr) uintptr | |||
| 531 | 602 | // If an orientation option/tag is present, the appropriate transform | |
| 532 | 603 | // will be performed so that the pixbuf is oriented correctly. | |
| 533 | 604 | func (x *Pixbuf) ApplyEmbeddedOrientation() *Pixbuf { | |
| 605 | + | var cls *Pixbuf | |
| 534 | 606 | ||
| 535 | - | ApplyEmbeddedOrientationPtr := xPixbufApplyEmbeddedOrientation(x.GoPointer()) | |
| 536 | - | if ApplyEmbeddedOrientationPtr == 0 { | |
| 537 | - | return nil | |
| 538 | - | } | |
| 539 | - | ||
| 540 | - | ApplyEmbeddedOrientationCls := &Pixbuf{} | |
| 541 | - | ApplyEmbeddedOrientationCls.Ptr = ApplyEmbeddedOrientationPtr | |
| 542 | - | return ApplyEmbeddedOrientationCls | |
| 607 | + | cret := xPixbufApplyEmbeddedOrientation(x.GoPointer()) | |
| 543 | 608 | ||
| 609 | + | if cret == 0 { | |
| 610 | + | return cls | |
| 611 | + | } | |
| 612 | + | cls = &Pixbuf{} | |
| 613 | + | cls.Ptr = cret | |
| 614 | + | return cls | |
| 544 | 615 | } | |
| 545 | 616 | ||
| 546 | 617 | var xPixbufComposite func(uintptr, uintptr, int, int, int, int, float64, float64, float64, float64, InterpType, int) | |
| @@ -590,16 +661,16 @@ var xPixbufCompositeColorSimple func(uintptr, int, int, InterpType, int, int, ui | |||
| 590 | 661 | // and alpha blending the result with a checkboard of colors `color1` | |
| 591 | 662 | // and `color2`. | |
| 592 | 663 | func (x *Pixbuf) CompositeColorSimple(DestWidthVar int, DestHeightVar int, InterpTypeVar InterpType, OverallAlphaVar int, CheckSizeVar int, Color1Var uint32, Color2Var uint32) *Pixbuf { | |
| 664 | + | var cls *Pixbuf | |
| 593 | 665 | ||
| 594 | - | CompositeColorSimplePtr := xPixbufCompositeColorSimple(x.GoPointer(), DestWidthVar, DestHeightVar, InterpTypeVar, OverallAlphaVar, CheckSizeVar, Color1Var, Color2Var) | |
| 595 | - | if CompositeColorSimplePtr == 0 { | |
| 596 | - | return nil | |
| 597 | - | } | |
| 598 | - | ||
| 599 | - | CompositeColorSimpleCls := &Pixbuf{} | |
| 600 | - | CompositeColorSimpleCls.Ptr = CompositeColorSimplePtr | |
| 601 | - | return CompositeColorSimpleCls | |
| 666 | + | cret := xPixbufCompositeColorSimple(x.GoPointer(), DestWidthVar, DestHeightVar, InterpTypeVar, OverallAlphaVar, CheckSizeVar, Color1Var, Color2Var) | |
| 602 | 667 | ||
| 668 | + | if cret == 0 { | |
| 669 | + | return cls | |
| 670 | + | } | |
| 671 | + | cls = &Pixbuf{} | |
| 672 | + | cls.Ptr = cret | |
| 673 | + | return cls | |
| 603 | 674 | } | |
| 604 | 675 | ||
| 605 | 676 | var xPixbufCopy func(uintptr) uintptr | |
| @@ -610,16 +681,16 @@ var xPixbufCopy func(uintptr) uintptr | |||
| 610 | 681 | // Note that this does not copy the options set on the original `GdkPixbuf`, | |
| 611 | 682 | // use gdk_pixbuf_copy_options() for this. | |
| 612 | 683 | func (x *Pixbuf) Copy() *Pixbuf { | |
| 684 | + | var cls *Pixbuf | |
| 613 | 685 | ||
| 614 | - | CopyPtr := xPixbufCopy(x.GoPointer()) | |
| 615 | - | if CopyPtr == 0 { | |
| 616 | - | return nil | |
| 617 | - | } | |
| 618 | - | ||
| 619 | - | CopyCls := &Pixbuf{} | |
| 620 | - | CopyCls.Ptr = CopyPtr | |
| 621 | - | return CopyCls | |
| 686 | + | cret := xPixbufCopy(x.GoPointer()) | |
| 622 | 687 | ||
| 688 | + | if cret == 0 { | |
| 689 | + | return cls | |
| 690 | + | } | |
| 691 | + | cls = &Pixbuf{} | |
| 692 | + | cls.Ptr = cret | |
| 693 | + | return cls | |
| 623 | 694 | } | |
| 624 | 695 | ||
| 625 | 696 | var xPixbufCopyArea func(uintptr, int, int, int, int, uintptr, int, int) | |
| @@ -647,8 +718,8 @@ var xPixbufCopyOptions func(uintptr, uintptr) bool | |||
| 647 | 718 | // applied, such as the "orientation" option after rotating the image. | |
| 648 | 719 | func (x *Pixbuf) CopyOptions(DestPixbufVar *Pixbuf) bool { | |
| 649 | 720 | ||
| 650 | - | return xPixbufCopyOptions(x.GoPointer(), DestPixbufVar.GoPointer()) | |
| 651 | - | ||
| 721 | + | cret := xPixbufCopyOptions(x.GoPointer(), DestPixbufVar.GoPointer()) | |
| 722 | + | return cret | |
| 652 | 723 | } | |
| 653 | 724 | ||
| 654 | 725 | var xPixbufFill func(uintptr, uint32) | |
| @@ -669,16 +740,16 @@ var xPixbufFlip func(uintptr, bool) uintptr | |||
| 669 | 740 | // Flips a pixbuf horizontally or vertically and returns the | |
| 670 | 741 | // result in a new pixbuf. | |
| 671 | 742 | func (x *Pixbuf) Flip(HorizontalVar bool) *Pixbuf { | |
| 743 | + | var cls *Pixbuf | |
| 672 | 744 | ||
| 673 | - | FlipPtr := xPixbufFlip(x.GoPointer(), HorizontalVar) | |
| 674 | - | if FlipPtr == 0 { | |
| 675 | - | return nil | |
| 676 | - | } | |
| 677 | - | ||
| 678 | - | FlipCls := &Pixbuf{} | |
| 679 | - | FlipCls.Ptr = FlipPtr | |
| 680 | - | return FlipCls | |
| 745 | + | cret := xPixbufFlip(x.GoPointer(), HorizontalVar) | |
| 681 | 746 | ||
| 747 | + | if cret == 0 { | |
| 748 | + | return cls | |
| 749 | + | } | |
| 750 | + | cls = &Pixbuf{} | |
| 751 | + | cls.Ptr = cret | |
| 752 | + | return cls | |
| 682 | 753 | } | |
| 683 | 754 | ||
| 684 | 755 | var xPixbufGetBitsPerSample func(uintptr) int | |
| @@ -686,8 +757,8 @@ var xPixbufGetBitsPerSample func(uintptr) int | |||
| 686 | 757 | // Queries the number of bits per color sample in a pixbuf. | |
| 687 | 758 | func (x *Pixbuf) GetBitsPerSample() int { | |
| 688 | 759 | ||
| 689 | - | return xPixbufGetBitsPerSample(x.GoPointer()) | |
| 690 | - | ||
| 760 | + | cret := xPixbufGetBitsPerSample(x.GoPointer()) | |
| 761 | + | return cret | |
| 691 | 762 | } | |
| 692 | 763 | ||
| 693 | 764 | var xPixbufGetByteLength func(uintptr) uint | |
| @@ -695,8 +766,8 @@ var xPixbufGetByteLength func(uintptr) uint | |||
| 695 | 766 | // Returns the length of the pixel data, in bytes. | |
| 696 | 767 | func (x *Pixbuf) GetByteLength() uint { | |
| 697 | 768 | ||
| 698 | - | return xPixbufGetByteLength(x.GoPointer()) | |
| 699 | - | ||
| 769 | + | cret := xPixbufGetByteLength(x.GoPointer()) | |
| 770 | + | return cret | |
| 700 | 771 | } | |
| 701 | 772 | ||
| 702 | 773 | var xPixbufGetColorspace func(uintptr) Colorspace | |
| @@ -704,8 +775,8 @@ var xPixbufGetColorspace func(uintptr) Colorspace | |||
| 704 | 775 | // Queries the color space of a pixbuf. | |
| 705 | 776 | func (x *Pixbuf) GetColorspace() Colorspace { | |
| 706 | 777 | ||
| 707 | - | return xPixbufGetColorspace(x.GoPointer()) | |
| 708 | - | ||
| 778 | + | cret := xPixbufGetColorspace(x.GoPointer()) | |
| 779 | + | return cret | |
| 709 | 780 | } | |
| 710 | 781 | ||
| 711 | 782 | var xPixbufGetHasAlpha func(uintptr) bool | |
| @@ -713,8 +784,8 @@ var xPixbufGetHasAlpha func(uintptr) bool | |||
| 713 | 784 | // Queries whether a pixbuf has an alpha channel (opacity information). | |
| 714 | 785 | func (x *Pixbuf) GetHasAlpha() bool { | |
| 715 | 786 | ||
| 716 | - | return xPixbufGetHasAlpha(x.GoPointer()) | |
| 717 | - | ||
| 787 | + | cret := xPixbufGetHasAlpha(x.GoPointer()) | |
| 788 | + | return cret | |
| 718 | 789 | } | |
| 719 | 790 | ||
| 720 | 791 | var xPixbufGetHeight func(uintptr) int | |
| @@ -722,8 +793,8 @@ var xPixbufGetHeight func(uintptr) int | |||
| 722 | 793 | // Queries the height of a pixbuf. | |
| 723 | 794 | func (x *Pixbuf) GetHeight() int { | |
| 724 | 795 | ||
| 725 | - | return xPixbufGetHeight(x.GoPointer()) | |
| 726 | - | ||
| 796 | + | cret := xPixbufGetHeight(x.GoPointer()) | |
| 797 | + | return cret | |
| 727 | 798 | } | |
| 728 | 799 | ||
| 729 | 800 | var xPixbufGetNChannels func(uintptr) int | |
| @@ -731,8 +802,8 @@ var xPixbufGetNChannels func(uintptr) int | |||
| 731 | 802 | // Queries the number of channels of a pixbuf. | |
| 732 | 803 | func (x *Pixbuf) GetNChannels() int { | |
| 733 | 804 | ||
| 734 | - | return xPixbufGetNChannels(x.GoPointer()) | |
| 735 | - | ||
| 805 | + | cret := xPixbufGetNChannels(x.GoPointer()) | |
| 806 | + | return cret | |
| 736 | 807 | } | |
| 737 | 808 | ||
| 738 | 809 | var xPixbufGetOption func(uintptr, string) string | |
| @@ -754,8 +825,8 @@ var xPixbufGetOption func(uintptr, string) string | |||
| 754 | 825 | // EXIF tag. | |
| 755 | 826 | func (x *Pixbuf) GetOption(KeyVar string) string { | |
| 756 | 827 | ||
| 757 | - | return xPixbufGetOption(x.GoPointer(), KeyVar) | |
| 758 | - | ||
| 828 | + | cret := xPixbufGetOption(x.GoPointer(), KeyVar) | |
| 829 | + | return cret | |
| 759 | 830 | } | |
| 760 | 831 | ||
| 761 | 832 | var xPixbufGetOptions func(uintptr) *glib.HashTable | |
| @@ -765,8 +836,8 @@ var xPixbufGetOptions func(uintptr) *glib.HashTable | |||
| 765 | 836 | // attached by another function using [method@GdkPixbuf.Pixbuf.set_option]. | |
| 766 | 837 | func (x *Pixbuf) GetOptions() *glib.HashTable { | |
| 767 | 838 | ||
| 768 | - | return xPixbufGetOptions(x.GoPointer()) | |
| 769 | - | ||
| 839 | + | cret := xPixbufGetOptions(x.GoPointer()) | |
| 840 | + | return cret | |
| 770 | 841 | } | |
| 771 | 842 | ||
| 772 | 843 | var xPixbufGetPixels func(uintptr) uintptr | |
| @@ -780,8 +851,8 @@ var xPixbufGetPixels func(uintptr) uintptr | |||
| 780 | 851 | // about how the pixel data is stored in memory. | |
| 781 | 852 | func (x *Pixbuf) GetPixels() uintptr { | |
| 782 | 853 | ||
| 783 | - | return xPixbufGetPixels(x.GoPointer()) | |
| 784 | - | ||
| 854 | + | cret := xPixbufGetPixels(x.GoPointer()) | |
| 855 | + | return cret | |
| 785 | 856 | } | |
| 786 | 857 | ||
| 787 | 858 | var xPixbufGetPixelsWithLength func(uintptr, uint) uintptr | |
| @@ -795,8 +866,8 @@ var xPixbufGetPixelsWithLength func(uintptr, uint) uintptr | |||
| 795 | 866 | // about how the pixel data is stored in memory. | |
| 796 | 867 | func (x *Pixbuf) GetPixelsWithLength(LengthVar uint) uintptr { | |
| 797 | 868 | ||
| 798 | - | return xPixbufGetPixelsWithLength(x.GoPointer(), LengthVar) | |
| 799 | - | ||
| 869 | + | cret := xPixbufGetPixelsWithLength(x.GoPointer(), LengthVar) | |
| 870 | + | return cret | |
| 800 | 871 | } | |
| 801 | 872 | ||
| 802 | 873 | var xPixbufGetRowstride func(uintptr) int | |
| @@ -805,8 +876,8 @@ var xPixbufGetRowstride func(uintptr) int | |||
| 805 | 876 | // the start of a row and the start of the next row. | |
| 806 | 877 | func (x *Pixbuf) GetRowstride() int { | |
| 807 | 878 | ||
| 808 | - | return xPixbufGetRowstride(x.GoPointer()) | |
| 809 | - | ||
| 879 | + | cret := xPixbufGetRowstride(x.GoPointer()) | |
| 880 | + | return cret | |
| 810 | 881 | } | |
| 811 | 882 | ||
| 812 | 883 | var xPixbufGetWidth func(uintptr) int | |
| @@ -814,8 +885,8 @@ var xPixbufGetWidth func(uintptr) int | |||
| 814 | 885 | // Queries the width of a pixbuf. | |
| 815 | 886 | func (x *Pixbuf) GetWidth() int { | |
| 816 | 887 | ||
| 817 | - | return xPixbufGetWidth(x.GoPointer()) | |
| 818 | - | ||
| 888 | + | cret := xPixbufGetWidth(x.GoPointer()) | |
| 889 | + | return cret | |
| 819 | 890 | } | |
| 820 | 891 | ||
| 821 | 892 | var xPixbufNewSubpixbuf func(uintptr, int, int, int, int) uintptr | |
| @@ -830,16 +901,16 @@ var xPixbufNewSubpixbuf func(uintptr, int, int, int, int) uintptr | |||
| 830 | 901 | // Note that if `src_pixbuf` is read-only, this function will force it | |
| 831 | 902 | // to be mutable. | |
| 832 | 903 | func (x *Pixbuf) NewSubpixbuf(SrcXVar int, SrcYVar int, WidthVar int, HeightVar int) *Pixbuf { | |
| 904 | + | var cls *Pixbuf | |
| 833 | 905 | ||
| 834 | - | NewSubpixbufPtr := xPixbufNewSubpixbuf(x.GoPointer(), SrcXVar, SrcYVar, WidthVar, HeightVar) | |
| 835 | - | if NewSubpixbufPtr == 0 { | |
| 836 | - | return nil | |
| 837 | - | } | |
| 838 | - | ||
| 839 | - | NewSubpixbufCls := &Pixbuf{} | |
| 840 | - | NewSubpixbufCls.Ptr = NewSubpixbufPtr | |
| 841 | - | return NewSubpixbufCls | |
| 906 | + | cret := xPixbufNewSubpixbuf(x.GoPointer(), SrcXVar, SrcYVar, WidthVar, HeightVar) | |
| 842 | 907 | ||
| 908 | + | if cret == 0 { | |
| 909 | + | return cls | |
| 910 | + | } | |
| 911 | + | cls = &Pixbuf{} | |
| 912 | + | cls.Ptr = cret | |
| 913 | + | return cls | |
| 843 | 914 | } | |
| 844 | 915 | ||
| 845 | 916 | var xPixbufReadPixelBytes func(uintptr) *glib.Bytes | |
| @@ -851,8 +922,8 @@ var xPixbufReadPixelBytes func(uintptr) *glib.Bytes | |||
| 851 | 922 | // if gdk_pixbuf_get_pixels() is called on a read-only pixbuf. | |
| 852 | 923 | func (x *Pixbuf) ReadPixelBytes() *glib.Bytes { | |
| 853 | 924 | ||
| 854 | - | return xPixbufReadPixelBytes(x.GoPointer()) | |
| 855 | - | ||
| 925 | + | cret := xPixbufReadPixelBytes(x.GoPointer()) | |
| 926 | + | return cret | |
| 856 | 927 | } | |
| 857 | 928 | ||
| 858 | 929 | var xPixbufReadPixels func(uintptr) byte | |
| @@ -863,24 +934,24 @@ var xPixbufReadPixels func(uintptr) byte | |||
| 863 | 934 | // if gdk_pixbuf_get_pixels() is called on a read-only pixbuf. | |
| 864 | 935 | func (x *Pixbuf) ReadPixels() byte { | |
| 865 | 936 | ||
| 866 | - | return xPixbufReadPixels(x.GoPointer()) | |
| 867 | - | ||
| 937 | + | cret := xPixbufReadPixels(x.GoPointer()) | |
| 938 | + | return cret | |
| 868 | 939 | } | |
| 869 | 940 | ||
| 870 | 941 | var xPixbufRef func(uintptr) uintptr | |
| 871 | 942 | ||
| 872 | 943 | // Adds a reference to a pixbuf. | |
| 873 | 944 | func (x *Pixbuf) Ref() *Pixbuf { | |
| 945 | + | var cls *Pixbuf | |
| 874 | 946 | ||
| 875 | - | RefPtr := xPixbufRef(x.GoPointer()) | |
| 876 | - | if RefPtr == 0 { | |
| 877 | - | return nil | |
| 878 | - | } | |
| 879 | - | ||
| 880 | - | RefCls := &Pixbuf{} | |
| 881 | - | RefCls.Ptr = RefPtr | |
| 882 | - | return RefCls | |
| 947 | + | cret := xPixbufRef(x.GoPointer()) | |
| 883 | 948 | ||
| 949 | + | if cret == 0 { | |
| 950 | + | return cls | |
| 951 | + | } | |
| 952 | + | cls = &Pixbuf{} | |
| 953 | + | cls.Ptr = cret | |
| 954 | + | return cls | |
| 884 | 955 | } | |
| 885 | 956 | ||
| 886 | 957 | var xPixbufRemoveOption func(uintptr, string) bool | |
| @@ -888,8 +959,8 @@ var xPixbufRemoveOption func(uintptr, string) bool | |||
| 888 | 959 | // Removes the key/value pair option attached to a `GdkPixbuf`. | |
| 889 | 960 | func (x *Pixbuf) RemoveOption(KeyVar string) bool { | |
| 890 | 961 | ||
| 891 | - | return xPixbufRemoveOption(x.GoPointer(), KeyVar) | |
| 892 | - | ||
| 962 | + | cret := xPixbufRemoveOption(x.GoPointer(), KeyVar) | |
| 963 | + | return cret | |
| 893 | 964 | } | |
| 894 | 965 | ||
| 895 | 966 | var xPixbufRotateSimple func(uintptr, PixbufRotation) uintptr | |
| @@ -899,16 +970,16 @@ var xPixbufRotateSimple func(uintptr, PixbufRotation) uintptr | |||
| 899 | 970 | // | |
| 900 | 971 | // If `angle` is 0, this function will return a copy of `src`. | |
| 901 | 972 | func (x *Pixbuf) RotateSimple(AngleVar PixbufRotation) *Pixbuf { | |
| 973 | + | var cls *Pixbuf | |
| 902 | 974 | ||
| 903 | - | RotateSimplePtr := xPixbufRotateSimple(x.GoPointer(), AngleVar) | |
| 904 | - | if RotateSimplePtr == 0 { | |
| 905 | - | return nil | |
| 906 | - | } | |
| 907 | - | ||
| 908 | - | RotateSimpleCls := &Pixbuf{} | |
| 909 | - | RotateSimpleCls.Ptr = RotateSimplePtr | |
| 910 | - | return RotateSimpleCls | |
| 975 | + | cret := xPixbufRotateSimple(x.GoPointer(), AngleVar) | |
| 911 | 976 | ||
| 977 | + | if cret == 0 { | |
| 978 | + | return cls | |
| 979 | + | } | |
| 980 | + | cls = &Pixbuf{} | |
| 981 | + | cls.Ptr = cret | |
| 982 | + | return cls | |
| 912 | 983 | } | |
| 913 | 984 | ||
| 914 | 985 | var xPixbufSaturateAndPixelate func(uintptr, uintptr, float32, bool) | |
| @@ -1009,8 +1080,8 @@ var xPixbufSave func(uintptr, string, string, **glib.Error, ...interface{}) bool | |||
| 1009 | 1080 | // it produces a CUR instead of an ICO. | |
| 1010 | 1081 | func (x *Pixbuf) Save(FilenameVar string, TypeVar string, ErrorVar **glib.Error, varArgs ...interface{}) bool { | |
| 1011 | 1082 | ||
| 1012 | - | return xPixbufSave(x.GoPointer(), FilenameVar, TypeVar, ErrorVar, varArgs...) | |
| 1013 | - | ||
| 1083 | + | cret := xPixbufSave(x.GoPointer(), FilenameVar, TypeVar, ErrorVar, varArgs...) | |
| 1084 | + | return cret | |
| 1014 | 1085 | } | |
| 1015 | 1086 | ||
| 1016 | 1087 | var xPixbufSaveToBuffer func(uintptr, uintptr, uint, string, **glib.Error, ...interface{}) bool | |
| @@ -1031,11 +1102,11 @@ var xPixbufSaveToBuffer func(uintptr, uintptr, uint, string, **glib.Error, ...in | |||
| 1031 | 1102 | // See `gdk_pixbuf_save()` for more details. | |
| 1032 | 1103 | func (x *Pixbuf) SaveToBuffer(BufferVar uintptr, BufferSizeVar uint, TypeVar string, ErrorVar **glib.Error, varArgs ...interface{}) bool { | |
| 1033 | 1104 | ||
| 1034 | - | return xPixbufSaveToBuffer(x.GoPointer(), BufferVar, BufferSizeVar, TypeVar, ErrorVar, varArgs...) | |
| 1035 | - | ||
| 1105 | + | cret := xPixbufSaveToBuffer(x.GoPointer(), BufferVar, BufferSizeVar, TypeVar, ErrorVar, varArgs...) | |
| 1106 | + | return cret | |
| 1036 | 1107 | } | |
| 1037 | 1108 | ||
| 1038 | - | var xPixbufSaveToBufferv func(uintptr, uintptr, uint, string, []string, []string) bool | |
| 1109 | + | var xPixbufSaveToBufferv func(uintptr, uintptr, uint, string, []string, []string, **glib.Error) bool | |
| 1039 | 1110 | ||
| 1040 | 1111 | // Vector version of `gdk_pixbuf_save_to_buffer()`. | |
| 1041 | 1112 | // | |
| @@ -1043,9 +1114,14 @@ var xPixbufSaveToBufferv func(uintptr, uintptr, uint, string, []string, []string | |||
| 1043 | 1114 | // "tiff", "png", "ico" or "bmp". | |
| 1044 | 1115 | // | |
| 1045 | 1116 | // See [method@GdkPixbuf.Pixbuf.save_to_buffer] for more details. | |
| 1046 | - | func (x *Pixbuf) SaveToBufferv(BufferVar uintptr, BufferSizeVar uint, TypeVar string, OptionKeysVar []string, OptionValuesVar []string) bool { | |
| 1117 | + | func (x *Pixbuf) SaveToBufferv(BufferVar uintptr, BufferSizeVar uint, TypeVar string, OptionKeysVar []string, OptionValuesVar []string) (bool, error) { | |
| 1118 | + | var cerr *glib.Error | |
| 1047 | 1119 | ||
| 1048 | - | return xPixbufSaveToBufferv(x.GoPointer(), BufferVar, BufferSizeVar, TypeVar, OptionKeysVar, OptionValuesVar) | |
| 1120 | + | cret := xPixbufSaveToBufferv(x.GoPointer(), BufferVar, BufferSizeVar, TypeVar, OptionKeysVar, OptionValuesVar, &cerr) | |
| 1121 | + | if cerr == nil { | |
| 1122 | + | return cret, nil | |
| 1123 | + | } | |
| 1124 | + | return cret, cerr | |
| 1049 | 1125 | ||
| 1050 | 1126 | } | |
| 1051 | 1127 | ||
| @@ -1064,11 +1140,11 @@ var xPixbufSaveToCallback func(uintptr, uintptr, uintptr, string, **glib.Error, | |||
| 1064 | 1140 | // See [method@GdkPixbuf.Pixbuf.save] for more details. | |
| 1065 | 1141 | func (x *Pixbuf) SaveToCallback(SaveFuncVar PixbufSaveFunc, UserDataVar uintptr, TypeVar string, ErrorVar **glib.Error, varArgs ...interface{}) bool { | |
| 1066 | 1142 | ||
| 1067 | - | return xPixbufSaveToCallback(x.GoPointer(), purego.NewCallback(SaveFuncVar), UserDataVar, TypeVar, ErrorVar, varArgs...) | |
| 1068 | - | ||
| 1143 | + | cret := xPixbufSaveToCallback(x.GoPointer(), purego.NewCallback(SaveFuncVar), UserDataVar, TypeVar, ErrorVar, varArgs...) | |
| 1144 | + | return cret | |
| 1069 | 1145 | } | |
| 1070 | 1146 | ||
| 1071 | - | var xPixbufSaveToCallbackv func(uintptr, uintptr, uintptr, string, []string, []string) bool | |
| 1147 | + | var xPixbufSaveToCallbackv func(uintptr, uintptr, uintptr, string, []string, []string, **glib.Error) bool | |
| 1072 | 1148 | ||
| 1073 | 1149 | // Vector version of `gdk_pixbuf_save_to_callback()`. | |
| 1074 | 1150 | // | |
| @@ -1078,9 +1154,14 @@ var xPixbufSaveToCallbackv func(uintptr, uintptr, uintptr, string, []string, []s | |||
| 1078 | 1154 | // If @error is set, `FALSE` will be returned. | |
| 1079 | 1155 | // | |
| 1080 | 1156 | // See [method@GdkPixbuf.Pixbuf.save_to_callback] for more details. | |
| 1081 | - | func (x *Pixbuf) SaveToCallbackv(SaveFuncVar PixbufSaveFunc, UserDataVar uintptr, TypeVar string, OptionKeysVar []string, OptionValuesVar []string) bool { | |
| 1157 | + | func (x *Pixbuf) SaveToCallbackv(SaveFuncVar PixbufSaveFunc, UserDataVar uintptr, TypeVar string, OptionKeysVar []string, OptionValuesVar []string) (bool, error) { | |
| 1158 | + | var cerr *glib.Error | |
| 1082 | 1159 | ||
| 1083 | - | return xPixbufSaveToCallbackv(x.GoPointer(), purego.NewCallback(SaveFuncVar), UserDataVar, TypeVar, OptionKeysVar, OptionValuesVar) | |
| 1160 | + | cret := xPixbufSaveToCallbackv(x.GoPointer(), purego.NewCallback(SaveFuncVar), UserDataVar, TypeVar, OptionKeysVar, OptionValuesVar, &cerr) | |
| 1161 | + | if cerr == nil { | |
| 1162 | + | return cret, nil | |
| 1163 | + | } | |
| 1164 | + | return cret, cerr | |
| 1084 | 1165 | ||
| 1085 | 1166 | } | |
| 1086 | 1167 | ||
| @@ -1099,8 +1180,8 @@ var xPixbufSaveToStream func(uintptr, uintptr, string, uintptr, **glib.Error, .. | |||
| 1099 | 1180 | // The stream is not closed at the end of this call. | |
| 1100 | 1181 | func (x *Pixbuf) SaveToStream(StreamVar *gio.OutputStream, TypeVar string, CancellableVar *gio.Cancellable, ErrorVar **glib.Error, varArgs ...interface{}) bool { | |
| 1101 | 1182 | ||
| 1102 | - | return xPixbufSaveToStream(x.GoPointer(), StreamVar.GoPointer(), TypeVar, CancellableVar.GoPointer(), ErrorVar, varArgs...) | |
| 1103 | - | ||
| 1183 | + | cret := xPixbufSaveToStream(x.GoPointer(), StreamVar.GoPointer(), TypeVar, CancellableVar.GoPointer(), ErrorVar, varArgs...) | |
| 1184 | + | return cret | |
| 1104 | 1185 | } | |
| 1105 | 1186 | ||
| 1106 | 1187 | var xPixbufSaveToStreamAsync func(uintptr, uintptr, string, uintptr, uintptr, uintptr, ...interface{}) | |
| @@ -1120,7 +1201,7 @@ func (x *Pixbuf) SaveToStreamAsync(StreamVar *gio.OutputStream, TypeVar string, | |||
| 1120 | 1201 | ||
| 1121 | 1202 | } | |
| 1122 | 1203 | ||
| 1123 | - | var xPixbufSaveToStreamv func(uintptr, uintptr, string, []string, []string, uintptr) bool | |
| 1204 | + | var xPixbufSaveToStreamv func(uintptr, uintptr, string, []string, []string, uintptr, **glib.Error) bool | |
| 1124 | 1205 | ||
| 1125 | 1206 | // Saves `pixbuf` to an output stream. | |
| 1126 | 1207 | // | |
| @@ -1128,9 +1209,14 @@ var xPixbufSaveToStreamv func(uintptr, uintptr, string, []string, []string, uint | |||
| 1128 | 1209 | // "bmp". | |
| 1129 | 1210 | // | |
| 1130 | 1211 | // See [method@GdkPixbuf.Pixbuf.save_to_stream] for more details. | |
| 1131 | - | func (x *Pixbuf) SaveToStreamv(StreamVar *gio.OutputStream, TypeVar string, OptionKeysVar []string, OptionValuesVar []string, CancellableVar *gio.Cancellable) bool { | |
| 1212 | + | func (x *Pixbuf) SaveToStreamv(StreamVar *gio.OutputStream, TypeVar string, OptionKeysVar []string, OptionValuesVar []string, CancellableVar *gio.Cancellable) (bool, error) { | |
| 1213 | + | var cerr *glib.Error | |
| 1132 | 1214 | ||
| 1133 | - | return xPixbufSaveToStreamv(x.GoPointer(), StreamVar.GoPointer(), TypeVar, OptionKeysVar, OptionValuesVar, CancellableVar.GoPointer()) | |
| 1215 | + | cret := xPixbufSaveToStreamv(x.GoPointer(), StreamVar.GoPointer(), TypeVar, OptionKeysVar, OptionValuesVar, CancellableVar.GoPointer(), &cerr) | |
| 1216 | + | if cerr == nil { | |
| 1217 | + | return cret, nil | |
| 1218 | + | } | |
| 1219 | + | return cret, cerr | |
| 1134 | 1220 | ||
| 1135 | 1221 | } | |
| 1136 | 1222 | ||
| @@ -1151,7 +1237,7 @@ func (x *Pixbuf) SaveToStreamvAsync(StreamVar *gio.OutputStream, TypeVar string, | |||
| 1151 | 1237 | ||
| 1152 | 1238 | } | |
| 1153 | 1239 | ||
| 1154 | - | var xPixbufSavev func(uintptr, string, string, []string, []string) bool | |
| 1240 | + | var xPixbufSavev func(uintptr, string, string, []string, []string, **glib.Error) bool | |
| 1155 | 1241 | ||
| 1156 | 1242 | // Vector version of `gdk_pixbuf_save()`. | |
| 1157 | 1243 | // | |
| @@ -1160,9 +1246,14 @@ var xPixbufSavev func(uintptr, string, string, []string, []string) bool | |||
| 1160 | 1246 | // If @error is set, `FALSE` will be returned. | |
| 1161 | 1247 | // | |
| 1162 | 1248 | // See [method@GdkPixbuf.Pixbuf.save] for more details. | |
| 1163 | - | func (x *Pixbuf) Savev(FilenameVar string, TypeVar string, OptionKeysVar []string, OptionValuesVar []string) bool { | |
| 1249 | + | func (x *Pixbuf) Savev(FilenameVar string, TypeVar string, OptionKeysVar []string, OptionValuesVar []string) (bool, error) { | |
| 1250 | + | var cerr *glib.Error | |
| 1164 | 1251 | ||
| 1165 | - | return xPixbufSavev(x.GoPointer(), FilenameVar, TypeVar, OptionKeysVar, OptionValuesVar) | |
| 1252 | + | cret := xPixbufSavev(x.GoPointer(), FilenameVar, TypeVar, OptionKeysVar, OptionValuesVar, &cerr) | |
| 1253 | + | if cerr == nil { | |
| 1254 | + | return cret, nil | |
| 1255 | + | } | |
| 1256 | + | return cret, cerr | |
| 1166 | 1257 | ||
| 1167 | 1258 | } | |
| 1168 | 1259 | ||
| @@ -1208,16 +1299,16 @@ var xPixbufScaleSimple func(uintptr, int, int, InterpType) uintptr | |||
| 1208 | 1299 | // For more complicated scaling/alpha blending see [method@GdkPixbuf.Pixbuf.scale] | |
| 1209 | 1300 | // and [method@GdkPixbuf.Pixbuf.composite]. | |
| 1210 | 1301 | func (x *Pixbuf) ScaleSimple(DestWidthVar int, DestHeightVar int, InterpTypeVar InterpType) *Pixbuf { | |
| 1302 | + | var cls *Pixbuf | |
| 1211 | 1303 | ||
| 1212 | - | ScaleSimplePtr := xPixbufScaleSimple(x.GoPointer(), DestWidthVar, DestHeightVar, InterpTypeVar) | |
| 1213 | - | if ScaleSimplePtr == 0 { | |
| 1214 | - | return nil | |
| 1215 | - | } | |
| 1216 | - | ||
| 1217 | - | ScaleSimpleCls := &Pixbuf{} | |
| 1218 | - | ScaleSimpleCls.Ptr = ScaleSimplePtr | |
| 1219 | - | return ScaleSimpleCls | |
| 1304 | + | cret := xPixbufScaleSimple(x.GoPointer(), DestWidthVar, DestHeightVar, InterpTypeVar) | |
| 1220 | 1305 | ||
| 1306 | + | if cret == 0 { | |
| 1307 | + | return cls | |
| 1308 | + | } | |
| 1309 | + | cls = &Pixbuf{} | |
| 1310 | + | cls.Ptr = cret | |
| 1311 | + | return cls | |
| 1221 | 1312 | } | |
| 1222 | 1313 | ||
| 1223 | 1314 | var xPixbufSetOption func(uintptr, string, string) bool | |
| @@ -1228,8 +1319,8 @@ var xPixbufSetOption func(uintptr, string, string) bool | |||
| 1228 | 1319 | // the new value is ignored and `FALSE` is returned. | |
| 1229 | 1320 | func (x *Pixbuf) SetOption(KeyVar string, ValueVar string) bool { | |
| 1230 | 1321 | ||
| 1231 | - | return xPixbufSetOption(x.GoPointer(), KeyVar, ValueVar) | |
| 1232 | - | ||
| 1322 | + | cret := xPixbufSetOption(x.GoPointer(), KeyVar, ValueVar) | |
| 1323 | + | return cret | |
| 1233 | 1324 | } | |
| 1234 | 1325 | ||
| 1235 | 1326 | var xPixbufUnref func(uintptr) | |
| @@ -1252,8 +1343,8 @@ func (c *Pixbuf) SetGoPointer(ptr uintptr) { | |||
| 1252 | 1343 | // Checks if two icons are equal. | |
| 1253 | 1344 | func (x *Pixbuf) Equal(Icon2Var gio.Icon) bool { | |
| 1254 | 1345 | ||
| 1255 | - | return gio.XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 1256 | - | ||
| 1346 | + | cret := gio.XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 1347 | + | return cret | |
| 1257 | 1348 | } | |
| 1258 | 1349 | ||
| 1259 | 1350 | // Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved | |
| @@ -1263,8 +1354,8 @@ func (x *Pixbuf) Equal(Icon2Var gio.Icon) bool { | |||
| 1263 | 1354 | // (as opposed to over the network), and within the same file system namespace. | |
| 1264 | 1355 | func (x *Pixbuf) Serialize() *glib.Variant { | |
| 1265 | 1356 | ||
| 1266 | - | return gio.XGIconSerialize(x.GoPointer()) | |
| 1267 | - | ||
| 1357 | + | cret := gio.XGIconSerialize(x.GoPointer()) | |
| 1358 | + | return cret | |
| 1268 | 1359 | } | |
| 1269 | 1360 | ||
| 1270 | 1361 | // Generates a textual representation of @icon that can be used for | |
| @@ -1285,22 +1376,27 @@ func (x *Pixbuf) Serialize() *glib.Variant { | |||
| 1285 | 1376 | // the encoding is simply the name (such as `network-server`). | |
| 1286 | 1377 | func (x *Pixbuf) ToString() string { | |
| 1287 | 1378 | ||
| 1288 | - | return gio.XGIconToString(x.GoPointer()) | |
| 1289 | - | ||
| 1379 | + | cret := gio.XGIconToString(x.GoPointer()) | |
| 1380 | + | return cret | |
| 1290 | 1381 | } | |
| 1291 | 1382 | ||
| 1292 | 1383 | // Loads a loadable icon. For the asynchronous version of this function, | |
| 1293 | 1384 | // see g_loadable_icon_load_async(). | |
| 1294 | - | func (x *Pixbuf) Load(SizeVar int, TypeVar string, CancellableVar *gio.Cancellable) *gio.InputStream { | |
| 1385 | + | func (x *Pixbuf) Load(SizeVar int, TypeVar string, CancellableVar *gio.Cancellable) (*gio.InputStream, error) { | |
| 1386 | + | var cls *gio.InputStream | |
| 1387 | + | var cerr *glib.Error | |
| 1295 | 1388 | ||
| 1296 | - | LoadPtr := gio.XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer()) | |
| 1297 | - | if LoadPtr == 0 { | |
| 1298 | - | return nil | |
| 1299 | - | } | |
| 1389 | + | cret := gio.XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 1300 | 1390 | ||
| 1301 | - | LoadCls := &gio.InputStream{} | |
| 1302 | - | LoadCls.Ptr = LoadPtr | |
| 1303 | - | return LoadCls | |
| 1391 | + | if cret == 0 { | |
| 1392 | + | return cls, cerr | |
| 1393 | + | } | |
| 1394 | + | cls = &gio.InputStream{} | |
| 1395 | + | cls.Ptr = cret | |
| 1396 | + | if cerr == nil { | |
| 1397 | + | return cls, nil | |
| 1398 | + | } | |
| 1399 | + | return cls, cerr | |
| 1304 | 1400 | ||
| 1305 | 1401 | } | |
| 1306 | 1402 | ||
| @@ -1314,16 +1410,21 @@ func (x *Pixbuf) LoadAsync(SizeVar int, CancellableVar *gio.Cancellable, Callbac | |||
| 1314 | 1410 | } | |
| 1315 | 1411 | ||
| 1316 | 1412 | // Finishes an asynchronous icon load started in g_loadable_icon_load_async(). | |
| 1317 | - | func (x *Pixbuf) LoadFinish(ResVar gio.AsyncResult, TypeVar string) *gio.InputStream { | |
| 1413 | + | func (x *Pixbuf) LoadFinish(ResVar gio.AsyncResult, TypeVar string) (*gio.InputStream, error) { | |
| 1414 | + | var cls *gio.InputStream | |
| 1415 | + | var cerr *glib.Error | |
| 1318 | 1416 | ||
| 1319 | - | LoadFinishPtr := gio.XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar) | |
| 1320 | - | if LoadFinishPtr == 0 { | |
| 1321 | - | return nil | |
| 1322 | - | } | |
| 1417 | + | cret := gio.XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar, &cerr) | |
| 1323 | 1418 | ||
| 1324 | - | LoadFinishCls := &gio.InputStream{} | |
| 1325 | - | LoadFinishCls.Ptr = LoadFinishPtr | |
| 1326 | - | return LoadFinishCls | |
| 1419 | + | if cret == 0 { | |
| 1420 | + | return cls, cerr | |
| 1421 | + | } | |
| 1422 | + | cls = &gio.InputStream{} | |
| 1423 | + | cls.Ptr = cret | |
| 1424 | + | if cerr == nil { | |
| 1425 | + | return cls, nil | |
| 1426 | + | } | |
| 1427 | + | return cls, cerr | |
| 1327 | 1428 | ||
| 1328 | 1429 | } | |
| 1329 | 1430 | ||
M v4/gdkpixbuf/main.go +11 -9
| @@ -11,8 +11,8 @@ var xPixbufErrorQuark func() glib.Quark | |||
| 11 | 11 | ||
| 12 | 12 | func PixbufErrorQuark() glib.Quark { | |
| 13 | 13 | ||
| 14 | - | return xPixbufErrorQuark() | |
| 15 | - | ||
| 14 | + | cret := xPixbufErrorQuark() | |
| 15 | + | return cret | |
| 16 | 16 | } | |
| 17 | 17 | ||
| 18 | 18 | type PixbufNonAnim struct { | |
| @@ -28,14 +28,16 @@ func PixbufNonAnimNewFromInternalPtr(ptr uintptr) *PixbufNonAnim { | |||
| 28 | 28 | var xNewPixbufNonAnim func(uintptr) uintptr | |
| 29 | 29 | ||
| 30 | 30 | func NewPixbufNonAnim(PixbufVar *Pixbuf) *PixbufAnimation { | |
| 31 | - | NewPixbufNonAnimPtr := xNewPixbufNonAnim(PixbufVar.GoPointer()) | |
| 32 | - | if NewPixbufNonAnimPtr == 0 { | |
| 33 | - | return nil | |
| 34 | - | } | |
| 31 | + | var cls *PixbufAnimation | |
| 32 | + | ||
| 33 | + | cret := xNewPixbufNonAnim(PixbufVar.GoPointer()) | |
| 35 | 34 | ||
| 36 | - | NewPixbufNonAnimCls := &PixbufAnimation{} | |
| 37 | - | NewPixbufNonAnimCls.Ptr = NewPixbufNonAnimPtr | |
| 38 | - | return NewPixbufNonAnimCls | |
| 35 | + | if cret == 0 { | |
| 36 | + | return cls | |
| 37 | + | } | |
| 38 | + | cls = &PixbufAnimation{} | |
| 39 | + | cls.Ptr = cret | |
| 40 | + | return cls | |
| 39 | 41 | } | |
| 40 | 42 | ||
| 41 | 43 | func (c *PixbufNonAnim) GoPointer() uintptr { | |
M v4/gio/gaction.go +24 -19
| @@ -100,15 +100,15 @@ func (x *ActionBase) ChangeState(ValueVar *glib.Variant) { | |||
| 100 | 100 | // have its state changed from outside callers. | |
| 101 | 101 | func (x *ActionBase) GetEnabled() bool { | |
| 102 | 102 | ||
| 103 | - | return XGActionGetEnabled(x.GoPointer()) | |
| 104 | - | ||
| 103 | + | cret := XGActionGetEnabled(x.GoPointer()) | |
| 104 | + | return cret | |
| 105 | 105 | } | |
| 106 | 106 | ||
| 107 | 107 | // Queries the name of @action. | |
| 108 | 108 | func (x *ActionBase) GetName() string { | |
| 109 | 109 | ||
| 110 | - | return XGActionGetName(x.GoPointer()) | |
| 111 | - | ||
| 110 | + | cret := XGActionGetName(x.GoPointer()) | |
| 111 | + | return cret | |
| 112 | 112 | } | |
| 113 | 113 | ||
| 114 | 114 | // Queries the type of the parameter that must be given when activating | |
| @@ -121,8 +121,8 @@ func (x *ActionBase) GetName() string { | |||
| 121 | 121 | // #GVariant, but %NULL instead. | |
| 122 | 122 | func (x *ActionBase) GetParameterType() *glib.VariantType { | |
| 123 | 123 | ||
| 124 | - | return XGActionGetParameterType(x.GoPointer()) | |
| 125 | - | ||
| 124 | + | cret := XGActionGetParameterType(x.GoPointer()) | |
| 125 | + | return cret | |
| 126 | 126 | } | |
| 127 | 127 | ||
| 128 | 128 | // Queries the current state of @action. | |
| @@ -135,8 +135,8 @@ func (x *ActionBase) GetParameterType() *glib.VariantType { | |||
| 135 | 135 | // g_variant_unref() when it is no longer required. | |
| 136 | 136 | func (x *ActionBase) GetState() *glib.Variant { | |
| 137 | 137 | ||
| 138 | - | return XGActionGetState(x.GoPointer()) | |
| 139 | - | ||
| 138 | + | cret := XGActionGetState(x.GoPointer()) | |
| 139 | + | return cret | |
| 140 | 140 | } | |
| 141 | 141 | ||
| 142 | 142 | // Requests a hint about the valid range of values for the state of | |
| @@ -159,8 +159,8 @@ func (x *ActionBase) GetState() *glib.Variant { | |||
| 159 | 159 | // g_variant_unref() when it is no longer required. | |
| 160 | 160 | func (x *ActionBase) GetStateHint() *glib.Variant { | |
| 161 | 161 | ||
| 162 | - | return XGActionGetStateHint(x.GoPointer()) | |
| 163 | - | ||
| 162 | + | cret := XGActionGetStateHint(x.GoPointer()) | |
| 163 | + | return cret | |
| 164 | 164 | } | |
| 165 | 165 | ||
| 166 | 166 | // Queries the type of the state of @action. | |
| @@ -177,8 +177,8 @@ func (x *ActionBase) GetStateHint() *glib.Variant { | |||
| 177 | 177 | // will return %NULL and you must not call g_action_change_state(). | |
| 178 | 178 | func (x *ActionBase) GetStateType() *glib.VariantType { | |
| 179 | 179 | ||
| 180 | - | return XGActionGetStateType(x.GoPointer()) | |
| 181 | - | ||
| 180 | + | cret := XGActionGetStateType(x.GoPointer()) | |
| 181 | + | return cret | |
| 182 | 182 | } | |
| 183 | 183 | ||
| 184 | 184 | var XGActionActivate func(uintptr, *glib.Variant) | |
| @@ -201,11 +201,11 @@ var xActionNameIsValid func(string) bool | |||
| 201 | 201 | // @action_name must not be %NULL. | |
| 202 | 202 | func ActionNameIsValid(ActionNameVar string) bool { | |
| 203 | 203 | ||
| 204 | - | return xActionNameIsValid(ActionNameVar) | |
| 205 | - | ||
| 204 | + | cret := xActionNameIsValid(ActionNameVar) | |
| 205 | + | return cret | |
| 206 | 206 | } | |
| 207 | 207 | ||
| 208 | - | var xActionParseDetailedName func(string, string, **glib.Variant) bool | |
| 208 | + | var xActionParseDetailedName func(string, string, **glib.Variant, **glib.Error) bool | |
| 209 | 209 | ||
| 210 | 210 | // Parses a detailed action name into its separate name and target | |
| 211 | 211 | // components. | |
| @@ -231,9 +231,14 @@ var xActionParseDetailedName func(string, string, **glib.Variant) bool | |||
| 231 | 231 | // target can be specified this way as well: "app.action('target')". | |
| 232 | 232 | // For strings, this third format must be used if * target value is | |
| 233 | 233 | // empty or contains characters other than alphanumerics, '-' and '.'. | |
| 234 | - | func ActionParseDetailedName(DetailedNameVar string, ActionNameVar string, TargetValueVar **glib.Variant) bool { | |
| 234 | + | func ActionParseDetailedName(DetailedNameVar string, ActionNameVar string, TargetValueVar **glib.Variant) (bool, error) { | |
| 235 | + | var cerr *glib.Error | |
| 235 | 236 | ||
| 236 | - | return xActionParseDetailedName(DetailedNameVar, ActionNameVar, TargetValueVar) | |
| 237 | + | cret := xActionParseDetailedName(DetailedNameVar, ActionNameVar, TargetValueVar, &cerr) | |
| 238 | + | if cerr == nil { | |
| 239 | + | return cret, nil | |
| 240 | + | } | |
| 241 | + | return cret, cerr | |
| 237 | 242 | ||
| 238 | 243 | } | |
| 239 | 244 | ||
| @@ -251,8 +256,8 @@ var xActionPrintDetailedName func(string, *glib.Variant) string | |||
| 251 | 256 | // this function. | |
| 252 | 257 | func ActionPrintDetailedName(ActionNameVar string, TargetValueVar *glib.Variant) string { | |
| 253 | 258 | ||
| 254 | - | return xActionPrintDetailedName(ActionNameVar, TargetValueVar) | |
| 255 | - | ||
| 259 | + | cret := xActionPrintDetailedName(ActionNameVar, TargetValueVar) | |
| 260 | + | return cret | |
| 256 | 261 | } | |
| 257 | 262 | ||
| 258 | 263 | func init() { | |
M v4/gio/gactiongroup.go +16 -16
| @@ -185,8 +185,8 @@ func (x *ActionGroupBase) ChangeActionState(ActionNameVar string, ValueVar *glib | |||
| 185 | 185 | // have its state changed from outside callers. | |
| 186 | 186 | func (x *ActionGroupBase) GetActionEnabled(ActionNameVar string) bool { | |
| 187 | 187 | ||
| 188 | - | return XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar) | |
| 189 | - | ||
| 188 | + | cret := XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar) | |
| 189 | + | return cret | |
| 190 | 190 | } | |
| 191 | 191 | ||
| 192 | 192 | // Queries the type of the parameter that must be given when activating | |
| @@ -204,8 +204,8 @@ func (x *ActionGroupBase) GetActionEnabled(ActionNameVar string) bool { | |||
| 204 | 204 | // with the same name but a different parameter type. | |
| 205 | 205 | func (x *ActionGroupBase) GetActionParameterType(ActionNameVar string) *glib.VariantType { | |
| 206 | 206 | ||
| 207 | - | return XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar) | |
| 208 | - | ||
| 207 | + | cret := XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar) | |
| 208 | + | return cret | |
| 209 | 209 | } | |
| 210 | 210 | ||
| 211 | 211 | // Queries the current state of the named action within @action_group. | |
| @@ -218,8 +218,8 @@ func (x *ActionGroupBase) GetActionParameterType(ActionNameVar string) *glib.Var | |||
| 218 | 218 | // g_variant_unref() when it is no longer required. | |
| 219 | 219 | func (x *ActionGroupBase) GetActionState(ActionNameVar string) *glib.Variant { | |
| 220 | 220 | ||
| 221 | - | return XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| 222 | - | ||
| 221 | + | cret := XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| 222 | + | return cret | |
| 223 | 223 | } | |
| 224 | 224 | ||
| 225 | 225 | // Requests a hint about the valid range of values for the state of the | |
| @@ -242,8 +242,8 @@ func (x *ActionGroupBase) GetActionState(ActionNameVar string) *glib.Variant { | |||
| 242 | 242 | // g_variant_unref() when it is no longer required. | |
| 243 | 243 | func (x *ActionGroupBase) GetActionStateHint(ActionNameVar string) *glib.Variant { | |
| 244 | 244 | ||
| 245 | - | return XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| 246 | - | ||
| 245 | + | cret := XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| 246 | + | return cret | |
| 247 | 247 | } | |
| 248 | 248 | ||
| 249 | 249 | // Queries the type of the state of the named action within | |
| @@ -264,15 +264,15 @@ func (x *ActionGroupBase) GetActionStateHint(ActionNameVar string) *glib.Variant | |||
| 264 | 264 | // with the same name but a different state type. | |
| 265 | 265 | func (x *ActionGroupBase) GetActionStateType(ActionNameVar string) *glib.VariantType { | |
| 266 | 266 | ||
| 267 | - | return XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar) | |
| 268 | - | ||
| 267 | + | cret := XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar) | |
| 268 | + | return cret | |
| 269 | 269 | } | |
| 270 | 270 | ||
| 271 | 271 | // Checks if the named action exists within @action_group. | |
| 272 | 272 | func (x *ActionGroupBase) HasAction(ActionNameVar string) bool { | |
| 273 | 273 | ||
| 274 | - | return XGActionGroupHasAction(x.GoPointer(), ActionNameVar) | |
| 275 | - | ||
| 274 | + | cret := XGActionGroupHasAction(x.GoPointer(), ActionNameVar) | |
| 275 | + | return cret | |
| 276 | 276 | } | |
| 277 | 277 | ||
| 278 | 278 | // Lists the actions contained within @action_group. | |
| @@ -281,8 +281,8 @@ func (x *ActionGroupBase) HasAction(ActionNameVar string) bool { | |||
| 281 | 281 | // it is no longer required. | |
| 282 | 282 | func (x *ActionGroupBase) ListActions() uintptr { | |
| 283 | 283 | ||
| 284 | - | return XGActionGroupListActions(x.GoPointer()) | |
| 285 | - | ||
| 284 | + | cret := XGActionGroupListActions(x.GoPointer()) | |
| 285 | + | return cret | |
| 286 | 286 | } | |
| 287 | 287 | ||
| 288 | 288 | // Queries all aspects of the named action within an @action_group. | |
| @@ -314,8 +314,8 @@ func (x *ActionGroupBase) ListActions() uintptr { | |||
| 314 | 314 | // fields may or may not have been modified. | |
| 315 | 315 | func (x *ActionGroupBase) QueryAction(ActionNameVar string, EnabledVar bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool { | |
| 316 | 316 | ||
| 317 | - | return XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) | |
| 318 | - | ||
| 317 | + | cret := XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) | |
| 318 | + | return cret | |
| 319 | 319 | } | |
| 320 | 320 | ||
| 321 | 321 | var XGActionGroupActionAdded func(uintptr, string) | |
M v4/gio/gactionmap.go +12 -13
| @@ -18,11 +18,11 @@ import ( | |||
| 18 | 18 | // | |
| 19 | 19 | // See g_action_map_add_action_entries() for an example. | |
| 20 | 20 | type ActionEntry struct { | |
| 21 | - | Name string | |
| 21 | + | Name uintptr | |
| 22 | 22 | ||
| 23 | - | ParameterType string | |
| 23 | + | ParameterType uintptr | |
| 24 | 24 | ||
| 25 | - | State string | |
| 25 | + | State uintptr | |
| 26 | 26 | ||
| 27 | 27 | Padding uintptr | |
| 28 | 28 | } | |
| @@ -126,18 +126,17 @@ func (x *ActionMapBase) AddActionEntries(EntriesVar uintptr, NEntriesVar int, Us | |||
| 126 | 126 | // | |
| 127 | 127 | // If no such action exists, returns %NULL. | |
| 128 | 128 | func (x *ActionMapBase) LookupAction(ActionNameVar string) *ActionBase { | |
| 129 | + | var cls *ActionBase | |
| 129 | 130 | ||
| 130 | - | LookupActionPtr := XGActionMapLookupAction(x.GoPointer(), ActionNameVar) | |
| 131 | - | if LookupActionPtr == 0 { | |
| 132 | - | return nil | |
| 133 | - | } | |
| 134 | - | ||
| 135 | - | gobject.IncreaseRef(LookupActionPtr) | |
| 136 | - | ||
| 137 | - | LookupActionCls := &ActionBase{} | |
| 138 | - | LookupActionCls.Ptr = LookupActionPtr | |
| 139 | - | return LookupActionCls | |
| 131 | + | cret := XGActionMapLookupAction(x.GoPointer(), ActionNameVar) | |
| 140 | 132 | ||
| 133 | + | if cret == 0 { | |
| 134 | + | return cls | |
| 135 | + | } | |
| 136 | + | gobject.IncreaseRef(cret) | |
| 137 | + | cls = &ActionBase{} | |
| 138 | + | cls.Ptr = cret | |
| 139 | + | return cls | |
| 141 | 140 | } | |
| 142 | 141 | ||
| 143 | 142 | // Removes the named action from the action map. | |
M v4/gio/gappinfo.go +178 -122
| @@ -113,9 +113,14 @@ func (x *AppInfoBase) SetGoPointer(ptr uintptr) { | |||
| 113 | 113 | ||
| 114 | 114 | // Adds a content type to the application information to indicate the | |
| 115 | 115 | // application is capable of opening files with the given content type. | |
| 116 | - | func (x *AppInfoBase) AddSupportsType(ContentTypeVar string) bool { | |
| 116 | + | func (x *AppInfoBase) AddSupportsType(ContentTypeVar string) (bool, error) { | |
| 117 | + | var cerr *glib.Error | |
| 117 | 118 | ||
| 118 | - | return XGAppInfoAddSupportsType(x.GoPointer(), ContentTypeVar) | |
| 119 | + | cret := XGAppInfoAddSupportsType(x.GoPointer(), ContentTypeVar, &cerr) | |
| 120 | + | if cerr == nil { | |
| 121 | + | return cret, nil | |
| 122 | + | } | |
| 123 | + | return cret, cerr | |
| 119 | 124 | ||
| 120 | 125 | } | |
| 121 | 126 | ||
| @@ -123,15 +128,15 @@ func (x *AppInfoBase) AddSupportsType(ContentTypeVar string) bool { | |||
| 123 | 128 | // See g_app_info_delete(). | |
| 124 | 129 | func (x *AppInfoBase) CanDelete() bool { | |
| 125 | 130 | ||
| 126 | - | return XGAppInfoCanDelete(x.GoPointer()) | |
| 127 | - | ||
| 131 | + | cret := XGAppInfoCanDelete(x.GoPointer()) | |
| 132 | + | return cret | |
| 128 | 133 | } | |
| 129 | 134 | ||
| 130 | 135 | // Checks if a supported content type can be removed from an application. | |
| 131 | 136 | func (x *AppInfoBase) CanRemoveSupportsType() bool { | |
| 132 | 137 | ||
| 133 | - | return XGAppInfoCanRemoveSupportsType(x.GoPointer()) | |
| 134 | - | ||
| 138 | + | cret := XGAppInfoCanRemoveSupportsType(x.GoPointer()) | |
| 139 | + | return cret | |
| 135 | 140 | } | |
| 136 | 141 | ||
| 137 | 142 | // Tries to delete a #GAppInfo. | |
| @@ -141,22 +146,22 @@ func (x *AppInfoBase) CanRemoveSupportsType() bool { | |||
| 141 | 146 | // See g_app_info_can_delete(). | |
| 142 | 147 | func (x *AppInfoBase) Delete() bool { | |
| 143 | 148 | ||
| 144 | - | return XGAppInfoDelete(x.GoPointer()) | |
| 145 | - | ||
| 149 | + | cret := XGAppInfoDelete(x.GoPointer()) | |
| 150 | + | return cret | |
| 146 | 151 | } | |
| 147 | 152 | ||
| 148 | 153 | // Creates a duplicate of a #GAppInfo. | |
| 149 | 154 | func (x *AppInfoBase) Dup() *AppInfoBase { | |
| 155 | + | var cls *AppInfoBase | |
| 150 | 156 | ||
| 151 | - | DupPtr := XGAppInfoDup(x.GoPointer()) | |
| 152 | - | if DupPtr == 0 { | |
| 153 | - | return nil | |
| 154 | - | } | |
| 155 | - | ||
| 156 | - | DupCls := &AppInfoBase{} | |
| 157 | - | DupCls.Ptr = DupPtr | |
| 158 | - | return DupCls | |
| 157 | + | cret := XGAppInfoDup(x.GoPointer()) | |
| 159 | 158 | ||
| 159 | + | if cret == 0 { | |
| 160 | + | return cls | |
| 161 | + | } | |
| 162 | + | cls = &AppInfoBase{} | |
| 163 | + | cls.Ptr = cret | |
| 164 | + | return cls | |
| 160 | 165 | } | |
| 161 | 166 | ||
| 162 | 167 | // Checks if two #GAppInfos are equal. | |
| @@ -166,54 +171,53 @@ func (x *AppInfoBase) Dup() *AppInfoBase { | |||
| 166 | 171 | // contents is needed, program code must additionally compare relevant fields. | |
| 167 | 172 | func (x *AppInfoBase) Equal(Appinfo2Var AppInfo) bool { | |
| 168 | 173 | ||
| 169 | - | return XGAppInfoEqual(x.GoPointer(), Appinfo2Var.GoPointer()) | |
| 170 | - | ||
| 174 | + | cret := XGAppInfoEqual(x.GoPointer(), Appinfo2Var.GoPointer()) | |
| 175 | + | return cret | |
| 171 | 176 | } | |
| 172 | 177 | ||
| 173 | 178 | // Gets the commandline with which the application will be | |
| 174 | 179 | // started. | |
| 175 | 180 | func (x *AppInfoBase) GetCommandline() string { | |
| 176 | 181 | ||
| 177 | - | return XGAppInfoGetCommandline(x.GoPointer()) | |
| 178 | - | ||
| 182 | + | cret := XGAppInfoGetCommandline(x.GoPointer()) | |
| 183 | + | return cret | |
| 179 | 184 | } | |
| 180 | 185 | ||
| 181 | 186 | // Gets a human-readable description of an installed application. | |
| 182 | 187 | func (x *AppInfoBase) GetDescription() string { | |
| 183 | 188 | ||
| 184 | - | return XGAppInfoGetDescription(x.GoPointer()) | |
| 185 | - | ||
| 189 | + | cret := XGAppInfoGetDescription(x.GoPointer()) | |
| 190 | + | return cret | |
| 186 | 191 | } | |
| 187 | 192 | ||
| 188 | 193 | // Gets the display name of the application. The display name is often more | |
| 189 | 194 | // descriptive to the user than the name itself. | |
| 190 | 195 | func (x *AppInfoBase) GetDisplayName() string { | |
| 191 | 196 | ||
| 192 | - | return XGAppInfoGetDisplayName(x.GoPointer()) | |
| 193 | - | ||
| 197 | + | cret := XGAppInfoGetDisplayName(x.GoPointer()) | |
| 198 | + | return cret | |
| 194 | 199 | } | |
| 195 | 200 | ||
| 196 | 201 | // Gets the executable's name for the installed application. | |
| 197 | 202 | func (x *AppInfoBase) GetExecutable() string { | |
| 198 | 203 | ||
| 199 | - | return XGAppInfoGetExecutable(x.GoPointer()) | |
| 200 | - | ||
| 204 | + | cret := XGAppInfoGetExecutable(x.GoPointer()) | |
| 205 | + | return cret | |
| 201 | 206 | } | |
| 202 | 207 | ||
| 203 | 208 | // Gets the icon for the application. | |
| 204 | 209 | func (x *AppInfoBase) GetIcon() *IconBase { | |
| 210 | + | var cls *IconBase | |
| 205 | 211 | ||
| 206 | - | GetIconPtr := XGAppInfoGetIcon(x.GoPointer()) | |
| 207 | - | if GetIconPtr == 0 { | |
| 208 | - | return nil | |
| 209 | - | } | |
| 210 | - | ||
| 211 | - | gobject.IncreaseRef(GetIconPtr) | |
| 212 | - | ||
| 213 | - | GetIconCls := &IconBase{} | |
| 214 | - | GetIconCls.Ptr = GetIconPtr | |
| 215 | - | return GetIconCls | |
| 212 | + | cret := XGAppInfoGetIcon(x.GoPointer()) | |
| 216 | 213 | ||
| 214 | + | if cret == 0 { | |
| 215 | + | return cls | |
| 216 | + | } | |
| 217 | + | gobject.IncreaseRef(cret) | |
| 218 | + | cls = &IconBase{} | |
| 219 | + | cls.Ptr = cret | |
| 220 | + | return cls | |
| 217 | 221 | } | |
| 218 | 222 | ||
| 219 | 223 | // Gets the ID of an application. An id is a string that | |
| @@ -225,15 +229,15 @@ func (x *AppInfoBase) GetIcon() *IconBase { | |||
| 225 | 229 | // the @appinfo has been constructed. | |
| 226 | 230 | func (x *AppInfoBase) GetId() string { | |
| 227 | 231 | ||
| 228 | - | return XGAppInfoGetId(x.GoPointer()) | |
| 229 | - | ||
| 232 | + | cret := XGAppInfoGetId(x.GoPointer()) | |
| 233 | + | return cret | |
| 230 | 234 | } | |
| 231 | 235 | ||
| 232 | 236 | // Gets the installed name of the application. | |
| 233 | 237 | func (x *AppInfoBase) GetName() string { | |
| 234 | 238 | ||
| 235 | - | return XGAppInfoGetName(x.GoPointer()) | |
| 236 | - | ||
| 239 | + | cret := XGAppInfoGetName(x.GoPointer()) | |
| 240 | + | return cret | |
| 237 | 241 | } | |
| 238 | 242 | ||
| 239 | 243 | // Retrieves the list of content types that @app_info claims to support. | |
| @@ -244,8 +248,8 @@ func (x *AppInfoBase) GetName() string { | |||
| 244 | 248 | // the application. | |
| 245 | 249 | func (x *AppInfoBase) GetSupportedTypes() uintptr { | |
| 246 | 250 | ||
| 247 | - | return XGAppInfoGetSupportedTypes(x.GoPointer()) | |
| 248 | - | ||
| 251 | + | cret := XGAppInfoGetSupportedTypes(x.GoPointer()) | |
| 252 | + | return cret | |
| 249 | 253 | } | |
| 250 | 254 | ||
| 251 | 255 | // Launches the application. Passes @files to the launched application | |
| @@ -275,9 +279,14 @@ func (x *AppInfoBase) GetSupportedTypes() uintptr { | |||
| 275 | 279 | // should it be inherited by further processes. The `DISPLAY` and | |
| 276 | 280 | // `DESKTOP_STARTUP_ID` environment variables are also set, based | |
| 277 | 281 | // on information provided in @context. | |
| 278 | - | func (x *AppInfoBase) Launch(FilesVar *glib.List, ContextVar *AppLaunchContext) bool { | |
| 282 | + | func (x *AppInfoBase) Launch(FilesVar *glib.List, ContextVar *AppLaunchContext) (bool, error) { | |
| 283 | + | var cerr *glib.Error | |
| 279 | 284 | ||
| 280 | - | return XGAppInfoLaunch(x.GoPointer(), FilesVar, ContextVar.GoPointer()) | |
| 285 | + | cret := XGAppInfoLaunch(x.GoPointer(), FilesVar, ContextVar.GoPointer(), &cerr) | |
| 286 | + | if cerr == nil { | |
| 287 | + | return cret, nil | |
| 288 | + | } | |
| 289 | + | return cret, cerr | |
| 281 | 290 | ||
| 282 | 291 | } | |
| 283 | 292 | ||
| @@ -291,9 +300,14 @@ func (x *AppInfoBase) Launch(FilesVar *glib.List, ContextVar *AppLaunchContext) | |||
| 291 | 300 | // Note that even if the launch is successful the application launched | |
| 292 | 301 | // can fail to start if it runs into problems during startup. There is | |
| 293 | 302 | // no way to detect this. | |
| 294 | - | func (x *AppInfoBase) LaunchUris(UrisVar *glib.List, ContextVar *AppLaunchContext) bool { | |
| 303 | + | func (x *AppInfoBase) LaunchUris(UrisVar *glib.List, ContextVar *AppLaunchContext) (bool, error) { | |
| 304 | + | var cerr *glib.Error | |
| 295 | 305 | ||
| 296 | - | return XGAppInfoLaunchUris(x.GoPointer(), UrisVar, ContextVar.GoPointer()) | |
| 306 | + | cret := XGAppInfoLaunchUris(x.GoPointer(), UrisVar, ContextVar.GoPointer(), &cerr) | |
| 307 | + | if cerr == nil { | |
| 308 | + | return cret, nil | |
| 309 | + | } | |
| 310 | + | return cret, cerr | |
| 297 | 311 | ||
| 298 | 312 | } | |
| 299 | 313 | ||
| @@ -310,30 +324,50 @@ func (x *AppInfoBase) LaunchUrisAsync(UrisVar *glib.List, ContextVar *AppLaunchC | |||
| 310 | 324 | } | |
| 311 | 325 | ||
| 312 | 326 | // Finishes a g_app_info_launch_uris_async() operation. | |
| 313 | - | func (x *AppInfoBase) LaunchUrisFinish(ResultVar AsyncResult) bool { | |
| 327 | + | func (x *AppInfoBase) LaunchUrisFinish(ResultVar AsyncResult) (bool, error) { | |
| 328 | + | var cerr *glib.Error | |
| 314 | 329 | ||
| 315 | - | return XGAppInfoLaunchUrisFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 330 | + | cret := XGAppInfoLaunchUrisFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 331 | + | if cerr == nil { | |
| 332 | + | return cret, nil | |
| 333 | + | } | |
| 334 | + | return cret, cerr | |
| 316 | 335 | ||
| 317 | 336 | } | |
| 318 | 337 | ||
| 319 | 338 | // Removes a supported type from an application, if possible. | |
| 320 | - | func (x *AppInfoBase) RemoveSupportsType(ContentTypeVar string) bool { | |
| 339 | + | func (x *AppInfoBase) RemoveSupportsType(ContentTypeVar string) (bool, error) { | |
| 340 | + | var cerr *glib.Error | |
| 321 | 341 | ||
| 322 | - | return XGAppInfoRemoveSupportsType(x.GoPointer(), ContentTypeVar) | |
| 342 | + | cret := XGAppInfoRemoveSupportsType(x.GoPointer(), ContentTypeVar, &cerr) | |
| 343 | + | if cerr == nil { | |
| 344 | + | return cret, nil | |
| 345 | + | } | |
| 346 | + | return cret, cerr | |
| 323 | 347 | ||
| 324 | 348 | } | |
| 325 | 349 | ||
| 326 | 350 | // Sets the application as the default handler for the given file extension. | |
| 327 | - | func (x *AppInfoBase) SetAsDefaultForExtension(ExtensionVar string) bool { | |
| 351 | + | func (x *AppInfoBase) SetAsDefaultForExtension(ExtensionVar string) (bool, error) { | |
| 352 | + | var cerr *glib.Error | |
| 328 | 353 | ||
| 329 | - | return XGAppInfoSetAsDefaultForExtension(x.GoPointer(), ExtensionVar) | |
| 354 | + | cret := XGAppInfoSetAsDefaultForExtension(x.GoPointer(), ExtensionVar, &cerr) | |
| 355 | + | if cerr == nil { | |
| 356 | + | return cret, nil | |
| 357 | + | } | |
| 358 | + | return cret, cerr | |
| 330 | 359 | ||
| 331 | 360 | } | |
| 332 | 361 | ||
| 333 | 362 | // Sets the application as the default handler for a given type. | |
| 334 | - | func (x *AppInfoBase) SetAsDefaultForType(ContentTypeVar string) bool { | |
| 363 | + | func (x *AppInfoBase) SetAsDefaultForType(ContentTypeVar string) (bool, error) { | |
| 364 | + | var cerr *glib.Error | |
| 335 | 365 | ||
| 336 | - | return XGAppInfoSetAsDefaultForType(x.GoPointer(), ContentTypeVar) | |
| 366 | + | cret := XGAppInfoSetAsDefaultForType(x.GoPointer(), ContentTypeVar, &cerr) | |
| 367 | + | if cerr == nil { | |
| 368 | + | return cret, nil | |
| 369 | + | } | |
| 370 | + | return cret, cerr | |
| 337 | 371 | ||
| 338 | 372 | } | |
| 339 | 373 | ||
| @@ -341,9 +375,14 @@ func (x *AppInfoBase) SetAsDefaultForType(ContentTypeVar string) bool { | |||
| 341 | 375 | // This will make the application appear as first in the list returned | |
| 342 | 376 | // by g_app_info_get_recommended_for_type(), regardless of the default | |
| 343 | 377 | // application for that content type. | |
| 344 | - | func (x *AppInfoBase) SetAsLastUsedForType(ContentTypeVar string) bool { | |
| 378 | + | func (x *AppInfoBase) SetAsLastUsedForType(ContentTypeVar string) (bool, error) { | |
| 379 | + | var cerr *glib.Error | |
| 345 | 380 | ||
| 346 | - | return XGAppInfoSetAsLastUsedForType(x.GoPointer(), ContentTypeVar) | |
| 381 | + | cret := XGAppInfoSetAsLastUsedForType(x.GoPointer(), ContentTypeVar, &cerr) | |
| 382 | + | if cerr == nil { | |
| 383 | + | return cret, nil | |
| 384 | + | } | |
| 385 | + | return cret, cerr | |
| 347 | 386 | ||
| 348 | 387 | } | |
| 349 | 388 | ||
| @@ -351,25 +390,25 @@ func (x *AppInfoBase) SetAsLastUsedForType(ContentTypeVar string) bool { | |||
| 351 | 390 | // list available applications. | |
| 352 | 391 | func (x *AppInfoBase) ShouldShow() bool { | |
| 353 | 392 | ||
| 354 | - | return XGAppInfoShouldShow(x.GoPointer()) | |
| 355 | - | ||
| 393 | + | cret := XGAppInfoShouldShow(x.GoPointer()) | |
| 394 | + | return cret | |
| 356 | 395 | } | |
| 357 | 396 | ||
| 358 | 397 | // Checks if the application accepts files as arguments. | |
| 359 | 398 | func (x *AppInfoBase) SupportsFiles() bool { | |
| 360 | 399 | ||
| 361 | - | return XGAppInfoSupportsFiles(x.GoPointer()) | |
| 362 | - | ||
| 400 | + | cret := XGAppInfoSupportsFiles(x.GoPointer()) | |
| 401 | + | return cret | |
| 363 | 402 | } | |
| 364 | 403 | ||
| 365 | 404 | // Checks if the application supports reading files and directories from URIs. | |
| 366 | 405 | func (x *AppInfoBase) SupportsUris() bool { | |
| 367 | 406 | ||
| 368 | - | return XGAppInfoSupportsUris(x.GoPointer()) | |
| 369 | - | ||
| 407 | + | cret := XGAppInfoSupportsUris(x.GoPointer()) | |
| 408 | + | return cret | |
| 370 | 409 | } | |
| 371 | 410 | ||
| 372 | - | var XGAppInfoAddSupportsType func(uintptr, string) bool | |
| 411 | + | var XGAppInfoAddSupportsType func(uintptr, string, **glib.Error) bool | |
| 373 | 412 | var XGAppInfoCanDelete func(uintptr) bool | |
| 374 | 413 | var XGAppInfoCanRemoveSupportsType func(uintptr) bool | |
| 375 | 414 | var XGAppInfoDelete func(uintptr) bool | |
| @@ -383,19 +422,19 @@ var XGAppInfoGetIcon func(uintptr) uintptr | |||
| 383 | 422 | var XGAppInfoGetId func(uintptr) string | |
| 384 | 423 | var XGAppInfoGetName func(uintptr) string | |
| 385 | 424 | var XGAppInfoGetSupportedTypes func(uintptr) uintptr | |
| 386 | - | var XGAppInfoLaunch func(uintptr, *glib.List, uintptr) bool | |
| 387 | - | var XGAppInfoLaunchUris func(uintptr, *glib.List, uintptr) bool | |
| 425 | + | var XGAppInfoLaunch func(uintptr, *glib.List, uintptr, **glib.Error) bool | |
| 426 | + | var XGAppInfoLaunchUris func(uintptr, *glib.List, uintptr, **glib.Error) bool | |
| 388 | 427 | var XGAppInfoLaunchUrisAsync func(uintptr, *glib.List, uintptr, uintptr, uintptr, uintptr) | |
| 389 | - | var XGAppInfoLaunchUrisFinish func(uintptr, uintptr) bool | |
| 390 | - | var XGAppInfoRemoveSupportsType func(uintptr, string) bool | |
| 391 | - | var XGAppInfoSetAsDefaultForExtension func(uintptr, string) bool | |
| 392 | - | var XGAppInfoSetAsDefaultForType func(uintptr, string) bool | |
| 393 | - | var XGAppInfoSetAsLastUsedForType func(uintptr, string) bool | |
| 428 | + | var XGAppInfoLaunchUrisFinish func(uintptr, uintptr, **glib.Error) bool | |
| 429 | + | var XGAppInfoRemoveSupportsType func(uintptr, string, **glib.Error) bool | |
| 430 | + | var XGAppInfoSetAsDefaultForExtension func(uintptr, string, **glib.Error) bool | |
| 431 | + | var XGAppInfoSetAsDefaultForType func(uintptr, string, **glib.Error) bool | |
| 432 | + | var XGAppInfoSetAsLastUsedForType func(uintptr, string, **glib.Error) bool | |
| 394 | 433 | var XGAppInfoShouldShow func(uintptr) bool | |
| 395 | 434 | var XGAppInfoSupportsFiles func(uintptr) bool | |
| 396 | 435 | var XGAppInfoSupportsUris func(uintptr) bool | |
| 397 | 436 | ||
| 398 | - | var xAppInfoCreateFromCommandline func(string, string, AppInfoCreateFlags) uintptr | |
| 437 | + | var xAppInfoCreateFromCommandline func(string, string, AppInfoCreateFlags, **glib.Error) uintptr | |
| 399 | 438 | ||
| 400 | 439 | // Creates a new #GAppInfo from the given information. | |
| 401 | 440 | // | |
| @@ -404,16 +443,21 @@ var xAppInfoCreateFromCommandline func(string, string, AppInfoCreateFlags) uintp | |||
| 404 | 443 | // are applied. For example, if the @commandline contains | |
| 405 | 444 | // percent-encoded URIs, the percent-character must be doubled in order to prevent it from | |
| 406 | 445 | // being swallowed by Exec key unquoting. See the specification for exact quoting rules. | |
| 407 | - | func AppInfoCreateFromCommandline(CommandlineVar string, ApplicationNameVar string, FlagsVar AppInfoCreateFlags) *AppInfoBase { | |
| 446 | + | func AppInfoCreateFromCommandline(CommandlineVar string, ApplicationNameVar string, FlagsVar AppInfoCreateFlags) (*AppInfoBase, error) { | |
| 447 | + | var cls *AppInfoBase | |
| 448 | + | var cerr *glib.Error | |
| 408 | 449 | ||
| 409 | - | AppInfoCreateFromCommandlinePtr := xAppInfoCreateFromCommandline(CommandlineVar, ApplicationNameVar, FlagsVar) | |
| 410 | - | if AppInfoCreateFromCommandlinePtr == 0 { | |
| 411 | - | return nil | |
| 412 | - | } | |
| 450 | + | cret := xAppInfoCreateFromCommandline(CommandlineVar, ApplicationNameVar, FlagsVar, &cerr) | |
| 413 | 451 | ||
| 414 | - | AppInfoCreateFromCommandlineCls := &AppInfoBase{} | |
| 415 | - | AppInfoCreateFromCommandlineCls.Ptr = AppInfoCreateFromCommandlinePtr | |
| 416 | - | return AppInfoCreateFromCommandlineCls | |
| 452 | + | if cret == 0 { | |
| 453 | + | return cls, cerr | |
| 454 | + | } | |
| 455 | + | cls = &AppInfoBase{} | |
| 456 | + | cls.Ptr = cret | |
| 457 | + | if cerr == nil { | |
| 458 | + | return cls, nil | |
| 459 | + | } | |
| 460 | + | return cls, cerr | |
| 417 | 461 | ||
| 418 | 462 | } | |
| 419 | 463 | ||
| @@ -429,8 +473,8 @@ var xAppInfoGetAll func() *glib.List | |||
| 429 | 473 | // the `Hidden` key set. | |
| 430 | 474 | func AppInfoGetAll() *glib.List { | |
| 431 | 475 | ||
| 432 | - | return xAppInfoGetAll() | |
| 433 | - | ||
| 476 | + | cret := xAppInfoGetAll() | |
| 477 | + | return cret | |
| 434 | 478 | } | |
| 435 | 479 | ||
| 436 | 480 | var xAppInfoGetAllForType func(string) *glib.List | |
| @@ -441,24 +485,24 @@ var xAppInfoGetAllForType func(string) *glib.List | |||
| 441 | 485 | // g_app_info_get_fallback_for_type(). | |
| 442 | 486 | func AppInfoGetAllForType(ContentTypeVar string) *glib.List { | |
| 443 | 487 | ||
| 444 | - | return xAppInfoGetAllForType(ContentTypeVar) | |
| 445 | - | ||
| 488 | + | cret := xAppInfoGetAllForType(ContentTypeVar) | |
| 489 | + | return cret | |
| 446 | 490 | } | |
| 447 | 491 | ||
| 448 | 492 | var xAppInfoGetDefaultForType func(string, bool) uintptr | |
| 449 | 493 | ||
| 450 | 494 | // Gets the default #GAppInfo for a given content type. | |
| 451 | 495 | func AppInfoGetDefaultForType(ContentTypeVar string, MustSupportUrisVar bool) *AppInfoBase { | |
| 496 | + | var cls *AppInfoBase | |
| 452 | 497 | ||
| 453 | - | AppInfoGetDefaultForTypePtr := xAppInfoGetDefaultForType(ContentTypeVar, MustSupportUrisVar) | |
| 454 | - | if AppInfoGetDefaultForTypePtr == 0 { | |
| 455 | - | return nil | |
| 456 | - | } | |
| 457 | - | ||
| 458 | - | AppInfoGetDefaultForTypeCls := &AppInfoBase{} | |
| 459 | - | AppInfoGetDefaultForTypeCls.Ptr = AppInfoGetDefaultForTypePtr | |
| 460 | - | return AppInfoGetDefaultForTypeCls | |
| 498 | + | cret := xAppInfoGetDefaultForType(ContentTypeVar, MustSupportUrisVar) | |
| 461 | 499 | ||
| 500 | + | if cret == 0 { | |
| 501 | + | return cls | |
| 502 | + | } | |
| 503 | + | cls = &AppInfoBase{} | |
| 504 | + | cls.Ptr = cret | |
| 505 | + | return cls | |
| 462 | 506 | } | |
| 463 | 507 | ||
| 464 | 508 | var xAppInfoGetDefaultForUriScheme func(string) uintptr | |
| @@ -468,16 +512,16 @@ var xAppInfoGetDefaultForUriScheme func(string) uintptr | |||
| 468 | 512 | // of the URI, up to but not including the ':', e.g. "http", | |
| 469 | 513 | // "ftp" or "sip". | |
| 470 | 514 | func AppInfoGetDefaultForUriScheme(UriSchemeVar string) *AppInfoBase { | |
| 515 | + | var cls *AppInfoBase | |
| 471 | 516 | ||
| 472 | - | AppInfoGetDefaultForUriSchemePtr := xAppInfoGetDefaultForUriScheme(UriSchemeVar) | |
| 473 | - | if AppInfoGetDefaultForUriSchemePtr == 0 { | |
| 474 | - | return nil | |
| 475 | - | } | |
| 476 | - | ||
| 477 | - | AppInfoGetDefaultForUriSchemeCls := &AppInfoBase{} | |
| 478 | - | AppInfoGetDefaultForUriSchemeCls.Ptr = AppInfoGetDefaultForUriSchemePtr | |
| 479 | - | return AppInfoGetDefaultForUriSchemeCls | |
| 517 | + | cret := xAppInfoGetDefaultForUriScheme(UriSchemeVar) | |
| 480 | 518 | ||
| 519 | + | if cret == 0 { | |
| 520 | + | return cls | |
| 521 | + | } | |
| 522 | + | cls = &AppInfoBase{} | |
| 523 | + | cls.Ptr = cret | |
| 524 | + | return cls | |
| 481 | 525 | } | |
| 482 | 526 | ||
| 483 | 527 | var xAppInfoGetFallbackForType func(string) *glib.List | |
| @@ -487,8 +531,8 @@ var xAppInfoGetFallbackForType func(string) *glib.List | |||
| 487 | 531 | // by MIME type subclassing and not directly. | |
| 488 | 532 | func AppInfoGetFallbackForType(ContentTypeVar string) *glib.List { | |
| 489 | 533 | ||
| 490 | - | return xAppInfoGetFallbackForType(ContentTypeVar) | |
| 491 | - | ||
| 534 | + | cret := xAppInfoGetFallbackForType(ContentTypeVar) | |
| 535 | + | return cret | |
| 492 | 536 | } | |
| 493 | 537 | ||
| 494 | 538 | var xAppInfoGetRecommendedForType func(string) *glib.List | |
| @@ -501,11 +545,11 @@ var xAppInfoGetRecommendedForType func(string) *glib.List | |||
| 501 | 545 | // called. | |
| 502 | 546 | func AppInfoGetRecommendedForType(ContentTypeVar string) *glib.List { | |
| 503 | 547 | ||
| 504 | - | return xAppInfoGetRecommendedForType(ContentTypeVar) | |
| 505 | - | ||
| 548 | + | cret := xAppInfoGetRecommendedForType(ContentTypeVar) | |
| 549 | + | return cret | |
| 506 | 550 | } | |
| 507 | 551 | ||
| 508 | - | var xAppInfoLaunchDefaultForUri func(string, uintptr) bool | |
| 552 | + | var xAppInfoLaunchDefaultForUri func(string, uintptr, **glib.Error) bool | |
| 509 | 553 | ||
| 510 | 554 | // Utility function that launches the default application | |
| 511 | 555 | // registered to handle the specified uri. Synchronous I/O | |
| @@ -515,9 +559,14 @@ var xAppInfoLaunchDefaultForUri func(string, uintptr) bool | |||
| 515 | 559 | // The D-Bus–activated applications don't have to be started if your application | |
| 516 | 560 | // terminates too soon after this function. To prevent this, use | |
| 517 | 561 | // g_app_info_launch_default_for_uri_async() instead. | |
| 518 | - | func AppInfoLaunchDefaultForUri(UriVar string, ContextVar *AppLaunchContext) bool { | |
| 562 | + | func AppInfoLaunchDefaultForUri(UriVar string, ContextVar *AppLaunchContext) (bool, error) { | |
| 563 | + | var cerr *glib.Error | |
| 519 | 564 | ||
| 520 | - | return xAppInfoLaunchDefaultForUri(UriVar, ContextVar.GoPointer()) | |
| 565 | + | cret := xAppInfoLaunchDefaultForUri(UriVar, ContextVar.GoPointer(), &cerr) | |
| 566 | + | if cerr == nil { | |
| 567 | + | return cret, nil | |
| 568 | + | } | |
| 569 | + | return cret, cerr | |
| 521 | 570 | ||
| 522 | 571 | } | |
| 523 | 572 | ||
| @@ -539,12 +588,17 @@ func AppInfoLaunchDefaultForUriAsync(UriVar string, ContextVar *AppLaunchContext | |||
| 539 | 588 | ||
| 540 | 589 | } | |
| 541 | 590 | ||
| 542 | - | var xAppInfoLaunchDefaultForUriFinish func(uintptr) bool | |
| 591 | + | var xAppInfoLaunchDefaultForUriFinish func(uintptr, **glib.Error) bool | |
| 543 | 592 | ||
| 544 | 593 | // Finishes an asynchronous launch-default-for-uri operation. | |
| 545 | - | func AppInfoLaunchDefaultForUriFinish(ResultVar AsyncResult) bool { | |
| 594 | + | func AppInfoLaunchDefaultForUriFinish(ResultVar AsyncResult) (bool, error) { | |
| 595 | + | var cerr *glib.Error | |
| 546 | 596 | ||
| 547 | - | return xAppInfoLaunchDefaultForUriFinish(ResultVar.GoPointer()) | |
| 597 | + | cret := xAppInfoLaunchDefaultForUriFinish(ResultVar.GoPointer(), &cerr) | |
| 598 | + | if cerr == nil { | |
| 599 | + | return cret, nil | |
| 600 | + | } | |
| 601 | + | return cret, cerr | |
| 548 | 602 | ||
| 549 | 603 | } | |
| 550 | 604 | ||
| @@ -579,14 +633,16 @@ var xNewAppLaunchContext func() uintptr | |||
| 579 | 633 | // Creates a new application launch context. This is not normally used, | |
| 580 | 634 | // instead you instantiate a subclass of this, such as #GdkAppLaunchContext. | |
| 581 | 635 | func NewAppLaunchContext() *AppLaunchContext { | |
| 582 | - | NewAppLaunchContextPtr := xNewAppLaunchContext() | |
| 583 | - | if NewAppLaunchContextPtr == 0 { | |
| 584 | - | return nil | |
| 585 | - | } | |
| 636 | + | var cls *AppLaunchContext | |
| 586 | 637 | ||
| 587 | - | NewAppLaunchContextCls := &AppLaunchContext{} | |
| 588 | - | NewAppLaunchContextCls.Ptr = NewAppLaunchContextPtr | |
| 589 | - | return NewAppLaunchContextCls | |
| 638 | + | cret := xNewAppLaunchContext() | |
| 639 | + | ||
| 640 | + | if cret == 0 { | |
| 641 | + | return cls | |
| 642 | + | } | |
| 643 | + | cls = &AppLaunchContext{} | |
| 644 | + | cls.Ptr = cret | |
| 645 | + | return cls | |
| 590 | 646 | } | |
| 591 | 647 | ||
| 592 | 648 | var xAppLaunchContextGetDisplay func(uintptr, uintptr, *glib.List) string | |
| @@ -596,8 +652,8 @@ var xAppLaunchContextGetDisplay func(uintptr, uintptr, *glib.List) string | |||
| 596 | 652 | // application, by setting the `DISPLAY` environment variable. | |
| 597 | 653 | func (x *AppLaunchContext) GetDisplay(InfoVar AppInfo, FilesVar *glib.List) string { | |
| 598 | 654 | ||
| 599 | - | return xAppLaunchContextGetDisplay(x.GoPointer(), InfoVar.GoPointer(), FilesVar) | |
| 600 | - | ||
| 655 | + | cret := xAppLaunchContextGetDisplay(x.GoPointer(), InfoVar.GoPointer(), FilesVar) | |
| 656 | + | return cret | |
| 601 | 657 | } | |
| 602 | 658 | ||
| 603 | 659 | var xAppLaunchContextGetEnvironment func(uintptr) []string | |
| @@ -608,8 +664,8 @@ var xAppLaunchContextGetEnvironment func(uintptr) []string | |||
| 608 | 664 | // the form `KEY=VALUE`. | |
| 609 | 665 | func (x *AppLaunchContext) GetEnvironment() []string { | |
| 610 | 666 | ||
| 611 | - | return xAppLaunchContextGetEnvironment(x.GoPointer()) | |
| 612 | - | ||
| 667 | + | cret := xAppLaunchContextGetEnvironment(x.GoPointer()) | |
| 668 | + | return cret | |
| 613 | 669 | } | |
| 614 | 670 | ||
| 615 | 671 | var xAppLaunchContextGetStartupNotifyId func(uintptr, uintptr, *glib.List) string | |
| @@ -621,8 +677,8 @@ var xAppLaunchContextGetStartupNotifyId func(uintptr, uintptr, *glib.List) strin | |||
| 621 | 677 | // [FreeDesktop.Org Startup Notifications standard](http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt). | |
| 622 | 678 | func (x *AppLaunchContext) GetStartupNotifyId(InfoVar AppInfo, FilesVar *glib.List) string { | |
| 623 | 679 | ||
| 624 | - | return xAppLaunchContextGetStartupNotifyId(x.GoPointer(), InfoVar.GoPointer(), FilesVar) | |
| 625 | - | ||
| 680 | + | cret := xAppLaunchContextGetStartupNotifyId(x.GoPointer(), InfoVar.GoPointer(), FilesVar) | |
| 681 | + | return cret | |
| 626 | 682 | } | |
| 627 | 683 | ||
| 628 | 684 | var xAppLaunchContextLaunchFailed func(uintptr, string) | |
M v4/gio/gapplication.go +69 -64
| @@ -152,14 +152,16 @@ var xNewApplication func(string, ApplicationFlags) uintptr | |||
| 152 | 152 | // If no application ID is given then some features of #GApplication | |
| 153 | 153 | // (most notably application uniqueness) will be disabled. | |
| 154 | 154 | func NewApplication(ApplicationIdVar string, FlagsVar ApplicationFlags) *Application { | |
| 155 | - | NewApplicationPtr := xNewApplication(ApplicationIdVar, FlagsVar) | |
| 156 | - | if NewApplicationPtr == 0 { | |
| 157 | - | return nil | |
| 158 | - | } | |
| 155 | + | var cls *Application | |
| 156 | + | ||
| 157 | + | cret := xNewApplication(ApplicationIdVar, FlagsVar) | |
| 159 | 158 | ||
| 160 | - | NewApplicationCls := &Application{} | |
| 161 | - | NewApplicationCls.Ptr = NewApplicationPtr | |
| 162 | - | return NewApplicationCls | |
| 159 | + | if cret == 0 { | |
| 160 | + | return cls | |
| 161 | + | } | |
| 162 | + | cls = &Application{} | |
| 163 | + | cls.Ptr = cret | |
| 164 | + | return cls | |
| 163 | 165 | } | |
| 164 | 166 | ||
| 165 | 167 | var xApplicationActivate func(uintptr) | |
| @@ -311,8 +313,8 @@ var xApplicationGetApplicationId func(uintptr) string | |||
| 311 | 313 | // Gets the unique identifier for @application. | |
| 312 | 314 | func (x *Application) GetApplicationId() string { | |
| 313 | 315 | ||
| 314 | - | return xApplicationGetApplicationId(x.GoPointer()) | |
| 315 | - | ||
| 316 | + | cret := xApplicationGetApplicationId(x.GoPointer()) | |
| 317 | + | return cret | |
| 316 | 318 | } | |
| 317 | 319 | ||
| 318 | 320 | var xApplicationGetDbusConnection func(uintptr) uintptr | |
| @@ -331,18 +333,17 @@ var xApplicationGetDbusConnection func(uintptr) uintptr | |||
| 331 | 333 | // This function must not be called before the application has been | |
| 332 | 334 | // registered. See g_application_get_is_registered(). | |
| 333 | 335 | func (x *Application) GetDbusConnection() *DBusConnection { | |
| 336 | + | var cls *DBusConnection | |
| 334 | 337 | ||
| 335 | - | GetDbusConnectionPtr := xApplicationGetDbusConnection(x.GoPointer()) | |
| 336 | - | if GetDbusConnectionPtr == 0 { | |
| 337 | - | return nil | |
| 338 | - | } | |
| 339 | - | ||
| 340 | - | gobject.IncreaseRef(GetDbusConnectionPtr) | |
| 341 | - | ||
| 342 | - | GetDbusConnectionCls := &DBusConnection{} | |
| 343 | - | GetDbusConnectionCls.Ptr = GetDbusConnectionPtr | |
| 344 | - | return GetDbusConnectionCls | |
| 338 | + | cret := xApplicationGetDbusConnection(x.GoPointer()) | |
| 345 | 339 | ||
| 340 | + | if cret == 0 { | |
| 341 | + | return cls | |
| 342 | + | } | |
| 343 | + | gobject.IncreaseRef(cret) | |
| 344 | + | cls = &DBusConnection{} | |
| 345 | + | cls.Ptr = cret | |
| 346 | + | return cls | |
| 346 | 347 | } | |
| 347 | 348 | ||
| 348 | 349 | var xApplicationGetDbusObjectPath func(uintptr) string | |
| @@ -363,8 +364,8 @@ var xApplicationGetDbusObjectPath func(uintptr) string | |||
| 363 | 364 | // registered. See g_application_get_is_registered(). | |
| 364 | 365 | func (x *Application) GetDbusObjectPath() string { | |
| 365 | 366 | ||
| 366 | - | return xApplicationGetDbusObjectPath(x.GoPointer()) | |
| 367 | - | ||
| 367 | + | cret := xApplicationGetDbusObjectPath(x.GoPointer()) | |
| 368 | + | return cret | |
| 368 | 369 | } | |
| 369 | 370 | ||
| 370 | 371 | var xApplicationGetFlags func(uintptr) ApplicationFlags | |
| @@ -374,8 +375,8 @@ var xApplicationGetFlags func(uintptr) ApplicationFlags | |||
| 374 | 375 | // See #GApplicationFlags. | |
| 375 | 376 | func (x *Application) GetFlags() ApplicationFlags { | |
| 376 | 377 | ||
| 377 | - | return xApplicationGetFlags(x.GoPointer()) | |
| 378 | - | ||
| 378 | + | cret := xApplicationGetFlags(x.GoPointer()) | |
| 379 | + | return cret | |
| 379 | 380 | } | |
| 380 | 381 | ||
| 381 | 382 | var xApplicationGetInactivityTimeout func(uintptr) uint | |
| @@ -386,8 +387,8 @@ var xApplicationGetInactivityTimeout func(uintptr) uint | |||
| 386 | 387 | // g_application_release() before the application stops running. | |
| 387 | 388 | func (x *Application) GetInactivityTimeout() uint { | |
| 388 | 389 | ||
| 389 | - | return xApplicationGetInactivityTimeout(x.GoPointer()) | |
| 390 | - | ||
| 390 | + | cret := xApplicationGetInactivityTimeout(x.GoPointer()) | |
| 391 | + | return cret | |
| 391 | 392 | } | |
| 392 | 393 | ||
| 393 | 394 | var xApplicationGetIsBusy func(uintptr) bool | |
| @@ -396,8 +397,8 @@ var xApplicationGetIsBusy func(uintptr) bool | |||
| 396 | 397 | // g_application_mark_busy() or g_application_bind_busy_property(). | |
| 397 | 398 | func (x *Application) GetIsBusy() bool { | |
| 398 | 399 | ||
| 399 | - | return xApplicationGetIsBusy(x.GoPointer()) | |
| 400 | - | ||
| 400 | + | cret := xApplicationGetIsBusy(x.GoPointer()) | |
| 401 | + | return cret | |
| 401 | 402 | } | |
| 402 | 403 | ||
| 403 | 404 | var xApplicationGetIsRegistered func(uintptr) bool | |
| @@ -408,8 +409,8 @@ var xApplicationGetIsRegistered func(uintptr) bool | |||
| 408 | 409 | // successfully called. | |
| 409 | 410 | func (x *Application) GetIsRegistered() bool { | |
| 410 | 411 | ||
| 411 | - | return xApplicationGetIsRegistered(x.GoPointer()) | |
| 412 | - | ||
| 412 | + | cret := xApplicationGetIsRegistered(x.GoPointer()) | |
| 413 | + | return cret | |
| 413 | 414 | } | |
| 414 | 415 | ||
| 415 | 416 | var xApplicationGetIsRemote func(uintptr) bool | |
| @@ -426,8 +427,8 @@ var xApplicationGetIsRemote func(uintptr) bool | |||
| 426 | 427 | // g_application_get_is_registered(). | |
| 427 | 428 | func (x *Application) GetIsRemote() bool { | |
| 428 | 429 | ||
| 429 | - | return xApplicationGetIsRemote(x.GoPointer()) | |
| 430 | - | ||
| 430 | + | cret := xApplicationGetIsRemote(x.GoPointer()) | |
| 431 | + | return cret | |
| 431 | 432 | } | |
| 432 | 433 | ||
| 433 | 434 | var xApplicationGetResourceBasePath func(uintptr) string | |
| @@ -437,8 +438,8 @@ var xApplicationGetResourceBasePath func(uintptr) string | |||
| 437 | 438 | // See g_application_set_resource_base_path() for more information. | |
| 438 | 439 | func (x *Application) GetResourceBasePath() string { | |
| 439 | 440 | ||
| 440 | - | return xApplicationGetResourceBasePath(x.GoPointer()) | |
| 441 | - | ||
| 441 | + | cret := xApplicationGetResourceBasePath(x.GoPointer()) | |
| 442 | + | return cret | |
| 442 | 443 | } | |
| 443 | 444 | ||
| 444 | 445 | var xApplicationHold func(uintptr) | |
| @@ -519,7 +520,7 @@ func (x *Application) Quit() { | |||
| 519 | 520 | ||
| 520 | 521 | } | |
| 521 | 522 | ||
| 522 | - | var xApplicationRegister func(uintptr, uintptr) bool | |
| 523 | + | var xApplicationRegister func(uintptr, uintptr, **glib.Error) bool | |
| 523 | 524 | ||
| 524 | 525 | // Attempts registration of the application. | |
| 525 | 526 | // | |
| @@ -551,9 +552,14 @@ var xApplicationRegister func(uintptr, uintptr) bool | |||
| 551 | 552 | // Note: the return value of this function is not an indicator that this | |
| 552 | 553 | // instance is or is not the primary instance of the application. See | |
| 553 | 554 | // g_application_get_is_remote() for that. | |
| 554 | - | func (x *Application) Register(CancellableVar *Cancellable) bool { | |
| 555 | + | func (x *Application) Register(CancellableVar *Cancellable) (bool, error) { | |
| 556 | + | var cerr *glib.Error | |
| 555 | 557 | ||
| 556 | - | return xApplicationRegister(x.GoPointer(), CancellableVar.GoPointer()) | |
| 558 | + | cret := xApplicationRegister(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 559 | + | if cerr == nil { | |
| 560 | + | return cret, nil | |
| 561 | + | } | |
| 562 | + | return cret, cerr | |
| 557 | 563 | ||
| 558 | 564 | } | |
| 559 | 565 | ||
| @@ -650,8 +656,8 @@ var xApplicationRun func(uintptr, int, []string) int | |||
| 650 | 656 | // what their exit status will be. | |
| 651 | 657 | func (x *Application) Run(ArgcVar int, ArgvVar []string) int { | |
| 652 | 658 | ||
| 653 | - | return xApplicationRun(x.GoPointer(), ArgcVar, ArgvVar) | |
| 654 | - | ||
| 659 | + | cret := xApplicationRun(x.GoPointer(), ArgcVar, ArgvVar) | |
| 660 | + | return cret | |
| 655 | 661 | } | |
| 656 | 662 | ||
| 657 | 663 | var xApplicationSendNotification func(uintptr, string, uintptr) | |
| @@ -1121,8 +1127,8 @@ func (x *Application) ChangeActionState(ActionNameVar string, ValueVar *glib.Var | |||
| 1121 | 1127 | // have its state changed from outside callers. | |
| 1122 | 1128 | func (x *Application) GetActionEnabled(ActionNameVar string) bool { | |
| 1123 | 1129 | ||
| 1124 | - | return XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar) | |
| 1125 | - | ||
| 1130 | + | cret := XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar) | |
| 1131 | + | return cret | |
| 1126 | 1132 | } | |
| 1127 | 1133 | ||
| 1128 | 1134 | // Queries the type of the parameter that must be given when activating | |
| @@ -1140,8 +1146,8 @@ func (x *Application) GetActionEnabled(ActionNameVar string) bool { | |||
| 1140 | 1146 | // with the same name but a different parameter type. | |
| 1141 | 1147 | func (x *Application) GetActionParameterType(ActionNameVar string) *glib.VariantType { | |
| 1142 | 1148 | ||
| 1143 | - | return XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar) | |
| 1144 | - | ||
| 1149 | + | cret := XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar) | |
| 1150 | + | return cret | |
| 1145 | 1151 | } | |
| 1146 | 1152 | ||
| 1147 | 1153 | // Queries the current state of the named action within @action_group. | |
| @@ -1154,8 +1160,8 @@ func (x *Application) GetActionParameterType(ActionNameVar string) *glib.Variant | |||
| 1154 | 1160 | // g_variant_unref() when it is no longer required. | |
| 1155 | 1161 | func (x *Application) GetActionState(ActionNameVar string) *glib.Variant { | |
| 1156 | 1162 | ||
| 1157 | - | return XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| 1158 | - | ||
| 1163 | + | cret := XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| 1164 | + | return cret | |
| 1159 | 1165 | } | |
| 1160 | 1166 | ||
| 1161 | 1167 | // Requests a hint about the valid range of values for the state of the | |
| @@ -1178,8 +1184,8 @@ func (x *Application) GetActionState(ActionNameVar string) *glib.Variant { | |||
| 1178 | 1184 | // g_variant_unref() when it is no longer required. | |
| 1179 | 1185 | func (x *Application) GetActionStateHint(ActionNameVar string) *glib.Variant { | |
| 1180 | 1186 | ||
| 1181 | - | return XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| 1182 | - | ||
| 1187 | + | cret := XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| 1188 | + | return cret | |
| 1183 | 1189 | } | |
| 1184 | 1190 | ||
| 1185 | 1191 | // Queries the type of the state of the named action within | |
| @@ -1200,15 +1206,15 @@ func (x *Application) GetActionStateHint(ActionNameVar string) *glib.Variant { | |||
| 1200 | 1206 | // with the same name but a different state type. | |
| 1201 | 1207 | func (x *Application) GetActionStateType(ActionNameVar string) *glib.VariantType { | |
| 1202 | 1208 | ||
| 1203 | - | return XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar) | |
| 1204 | - | ||
| 1209 | + | cret := XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar) | |
| 1210 | + | return cret | |
| 1205 | 1211 | } | |
| 1206 | 1212 | ||
| 1207 | 1213 | // Checks if the named action exists within @action_group. | |
| 1208 | 1214 | func (x *Application) HasAction(ActionNameVar string) bool { | |
| 1209 | 1215 | ||
| 1210 | - | return XGActionGroupHasAction(x.GoPointer(), ActionNameVar) | |
| 1211 | - | ||
| 1216 | + | cret := XGActionGroupHasAction(x.GoPointer(), ActionNameVar) | |
| 1217 | + | return cret | |
| 1212 | 1218 | } | |
| 1213 | 1219 | ||
| 1214 | 1220 | // Lists the actions contained within @action_group. | |
| @@ -1217,8 +1223,8 @@ func (x *Application) HasAction(ActionNameVar string) bool { | |||
| 1217 | 1223 | // it is no longer required. | |
| 1218 | 1224 | func (x *Application) ListActions() uintptr { | |
| 1219 | 1225 | ||
| 1220 | - | return XGActionGroupListActions(x.GoPointer()) | |
| 1221 | - | ||
| 1226 | + | cret := XGActionGroupListActions(x.GoPointer()) | |
| 1227 | + | return cret | |
| 1222 | 1228 | } | |
| 1223 | 1229 | ||
| 1224 | 1230 | // Queries all aspects of the named action within an @action_group. | |
| @@ -1250,8 +1256,8 @@ func (x *Application) ListActions() uintptr { | |||
| 1250 | 1256 | // fields may or may not have been modified. | |
| 1251 | 1257 | func (x *Application) QueryAction(ActionNameVar string, EnabledVar bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool { | |
| 1252 | 1258 | ||
| 1253 | - | return XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) | |
| 1254 | - | ||
| 1259 | + | cret := XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) | |
| 1260 | + | return cret | |
| 1255 | 1261 | } | |
| 1256 | 1262 | ||
| 1257 | 1263 | // Adds an action to the @action_map. | |
| @@ -1319,18 +1325,17 @@ func (x *Application) AddActionEntries(EntriesVar uintptr, NEntriesVar int, User | |||
| 1319 | 1325 | // | |
| 1320 | 1326 | // If no such action exists, returns %NULL. | |
| 1321 | 1327 | func (x *Application) LookupAction(ActionNameVar string) *ActionBase { | |
| 1328 | + | var cls *ActionBase | |
| 1322 | 1329 | ||
| 1323 | - | LookupActionPtr := XGActionMapLookupAction(x.GoPointer(), ActionNameVar) | |
| 1324 | - | if LookupActionPtr == 0 { | |
| 1325 | - | return nil | |
| 1326 | - | } | |
| 1327 | - | ||
| 1328 | - | gobject.IncreaseRef(LookupActionPtr) | |
| 1329 | - | ||
| 1330 | - | LookupActionCls := &ActionBase{} | |
| 1331 | - | LookupActionCls.Ptr = LookupActionPtr | |
| 1332 | - | return LookupActionCls | |
| 1330 | + | cret := XGActionMapLookupAction(x.GoPointer(), ActionNameVar) | |
| 1333 | 1331 | ||
| 1332 | + | if cret == 0 { | |
| 1333 | + | return cls | |
| 1334 | + | } | |
| 1335 | + | gobject.IncreaseRef(cret) | |
| 1336 | + | cls = &ActionBase{} | |
| 1337 | + | cls.Ptr = cret | |
| 1338 | + | return cls | |
| 1334 | 1339 | } | |
| 1335 | 1340 | ||
| 1336 | 1341 | // Removes the named action from the action map. | |
M v4/gio/gapplicationcommandline.go +32 -32
| @@ -209,16 +209,16 @@ var xApplicationCommandLineCreateFileForArg func(uintptr, string) uintptr | |||
| 209 | 209 | // resolves relative pathnames using the current working directory of | |
| 210 | 210 | // the invoking process rather than the local process. | |
| 211 | 211 | func (x *ApplicationCommandLine) CreateFileForArg(ArgVar string) *FileBase { | |
| 212 | + | var cls *FileBase | |
| 212 | 213 | ||
| 213 | - | CreateFileForArgPtr := xApplicationCommandLineCreateFileForArg(x.GoPointer(), ArgVar) | |
| 214 | - | if CreateFileForArgPtr == 0 { | |
| 215 | - | return nil | |
| 216 | - | } | |
| 217 | - | ||
| 218 | - | CreateFileForArgCls := &FileBase{} | |
| 219 | - | CreateFileForArgCls.Ptr = CreateFileForArgPtr | |
| 220 | - | return CreateFileForArgCls | |
| 214 | + | cret := xApplicationCommandLineCreateFileForArg(x.GoPointer(), ArgVar) | |
| 221 | 215 | ||
| 216 | + | if cret == 0 { | |
| 217 | + | return cls | |
| 218 | + | } | |
| 219 | + | cls = &FileBase{} | |
| 220 | + | cls.Ptr = cret | |
| 221 | + | return cls | |
| 222 | 222 | } | |
| 223 | 223 | ||
| 224 | 224 | var xApplicationCommandLineGetArguments func(uintptr, int) uintptr | |
| @@ -236,8 +236,8 @@ var xApplicationCommandLineGetArguments func(uintptr, int) uintptr | |||
| 236 | 236 | // g_strfreev(). | |
| 237 | 237 | func (x *ApplicationCommandLine) GetArguments(ArgcVar int) uintptr { | |
| 238 | 238 | ||
| 239 | - | return xApplicationCommandLineGetArguments(x.GoPointer(), ArgcVar) | |
| 240 | - | ||
| 239 | + | cret := xApplicationCommandLineGetArguments(x.GoPointer(), ArgcVar) | |
| 240 | + | return cret | |
| 241 | 241 | } | |
| 242 | 242 | ||
| 243 | 243 | var xApplicationCommandLineGetCwd func(uintptr) string | |
| @@ -252,8 +252,8 @@ var xApplicationCommandLineGetCwd func(uintptr) string | |||
| 252 | 252 | // long as @cmdline exists. | |
| 253 | 253 | func (x *ApplicationCommandLine) GetCwd() string { | |
| 254 | 254 | ||
| 255 | - | return xApplicationCommandLineGetCwd(x.GoPointer()) | |
| 256 | - | ||
| 255 | + | cret := xApplicationCommandLineGetCwd(x.GoPointer()) | |
| 256 | + | return cret | |
| 257 | 257 | } | |
| 258 | 258 | ||
| 259 | 259 | var xApplicationCommandLineGetEnviron func(uintptr) uintptr | |
| @@ -275,8 +275,8 @@ var xApplicationCommandLineGetEnviron func(uintptr) uintptr | |||
| 275 | 275 | // in the value of a single environment variable. | |
| 276 | 276 | func (x *ApplicationCommandLine) GetEnviron() uintptr { | |
| 277 | 277 | ||
| 278 | - | return xApplicationCommandLineGetEnviron(x.GoPointer()) | |
| 279 | - | ||
| 278 | + | cret := xApplicationCommandLineGetEnviron(x.GoPointer()) | |
| 279 | + | return cret | |
| 280 | 280 | } | |
| 281 | 281 | ||
| 282 | 282 | var xApplicationCommandLineGetExitStatus func(uintptr) int | |
| @@ -285,8 +285,8 @@ var xApplicationCommandLineGetExitStatus func(uintptr) int | |||
| 285 | 285 | // g_application_command_line_set_exit_status() for more information. | |
| 286 | 286 | func (x *ApplicationCommandLine) GetExitStatus() int { | |
| 287 | 287 | ||
| 288 | - | return xApplicationCommandLineGetExitStatus(x.GoPointer()) | |
| 289 | - | ||
| 288 | + | cret := xApplicationCommandLineGetExitStatus(x.GoPointer()) | |
| 289 | + | return cret | |
| 290 | 290 | } | |
| 291 | 291 | ||
| 292 | 292 | var xApplicationCommandLineGetIsRemote func(uintptr) bool | |
| @@ -294,8 +294,8 @@ var xApplicationCommandLineGetIsRemote func(uintptr) bool | |||
| 294 | 294 | // Determines if @cmdline represents a remote invocation. | |
| 295 | 295 | func (x *ApplicationCommandLine) GetIsRemote() bool { | |
| 296 | 296 | ||
| 297 | - | return xApplicationCommandLineGetIsRemote(x.GoPointer()) | |
| 298 | - | ||
| 297 | + | cret := xApplicationCommandLineGetIsRemote(x.GoPointer()) | |
| 298 | + | return cret | |
| 299 | 299 | } | |
| 300 | 300 | ||
| 301 | 301 | var xApplicationCommandLineGetOptionsDict func(uintptr) *glib.VariantDict | |
| @@ -311,8 +311,8 @@ var xApplicationCommandLineGetOptionsDict func(uintptr) *glib.VariantDict | |||
| 311 | 311 | // you don't need to check for %NULL. | |
| 312 | 312 | func (x *ApplicationCommandLine) GetOptionsDict() *glib.VariantDict { | |
| 313 | 313 | ||
| 314 | - | return xApplicationCommandLineGetOptionsDict(x.GoPointer()) | |
| 315 | - | ||
| 314 | + | cret := xApplicationCommandLineGetOptionsDict(x.GoPointer()) | |
| 315 | + | return cret | |
| 316 | 316 | } | |
| 317 | 317 | ||
| 318 | 318 | var xApplicationCommandLineGetPlatformData func(uintptr) *glib.Variant | |
| @@ -327,8 +327,8 @@ var xApplicationCommandLineGetPlatformData func(uintptr) *glib.Variant | |||
| 327 | 327 | // For local invocation, it will be %NULL. | |
| 328 | 328 | func (x *ApplicationCommandLine) GetPlatformData() *glib.Variant { | |
| 329 | 329 | ||
| 330 | - | return xApplicationCommandLineGetPlatformData(x.GoPointer()) | |
| 331 | - | ||
| 330 | + | cret := xApplicationCommandLineGetPlatformData(x.GoPointer()) | |
| 331 | + | return cret | |
| 332 | 332 | } | |
| 333 | 333 | ||
| 334 | 334 | var xApplicationCommandLineGetStdin func(uintptr) uintptr | |
| @@ -344,16 +344,16 @@ var xApplicationCommandLineGetStdin func(uintptr) uintptr | |||
| 344 | 344 | // | |
| 345 | 345 | // You must only call this function once per commandline invocation. | |
| 346 | 346 | func (x *ApplicationCommandLine) GetStdin() *InputStream { | |
| 347 | + | var cls *InputStream | |
| 347 | 348 | ||
| 348 | - | GetStdinPtr := xApplicationCommandLineGetStdin(x.GoPointer()) | |
| 349 | - | if GetStdinPtr == 0 { | |
| 350 | - | return nil | |
| 351 | - | } | |
| 352 | - | ||
| 353 | - | GetStdinCls := &InputStream{} | |
| 354 | - | GetStdinCls.Ptr = GetStdinPtr | |
| 355 | - | return GetStdinCls | |
| 349 | + | cret := xApplicationCommandLineGetStdin(x.GoPointer()) | |
| 356 | 350 | ||
| 351 | + | if cret == 0 { | |
| 352 | + | return cls | |
| 353 | + | } | |
| 354 | + | cls = &InputStream{} | |
| 355 | + | cls.Ptr = cret | |
| 356 | + | return cls | |
| 357 | 357 | } | |
| 358 | 358 | ||
| 359 | 359 | var xApplicationCommandLineGetenv func(uintptr, string) string | |
| @@ -371,8 +371,8 @@ var xApplicationCommandLineGetenv func(uintptr, string) string | |||
| 371 | 371 | // long as @cmdline exists. | |
| 372 | 372 | func (x *ApplicationCommandLine) Getenv(NameVar string) string { | |
| 373 | 373 | ||
| 374 | - | return xApplicationCommandLineGetenv(x.GoPointer(), NameVar) | |
| 375 | - | ||
| 374 | + | cret := xApplicationCommandLineGetenv(x.GoPointer(), NameVar) | |
| 375 | + | return cret | |
| 376 | 376 | } | |
| 377 | 377 | ||
| 378 | 378 | var xApplicationCommandLinePrint func(uintptr, string, ...interface{}) | |
M v4/gio/gasyncinitable.go +23 -12
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -184,30 +185,40 @@ func (x *AsyncInitableBase) InitAsync(IoPriorityVar int, CancellableVar *Cancell | |||
| 184 | 185 | ||
| 185 | 186 | // Finishes asynchronous initialization and returns the result. | |
| 186 | 187 | // See g_async_initable_init_async(). | |
| 187 | - | func (x *AsyncInitableBase) InitFinish(ResVar AsyncResult) bool { | |
| 188 | + | func (x *AsyncInitableBase) InitFinish(ResVar AsyncResult) (bool, error) { | |
| 189 | + | var cerr *glib.Error | |
| 188 | 190 | ||
| 189 | - | return XGAsyncInitableInitFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 191 | + | cret := XGAsyncInitableInitFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 192 | + | if cerr == nil { | |
| 193 | + | return cret, nil | |
| 194 | + | } | |
| 195 | + | return cret, cerr | |
| 190 | 196 | ||
| 191 | 197 | } | |
| 192 | 198 | ||
| 193 | 199 | // Finishes the async construction for the various g_async_initable_new | |
| 194 | 200 | // calls, returning the created object or %NULL on error. | |
| 195 | - | func (x *AsyncInitableBase) NewFinish(ResVar AsyncResult) *gobject.Object { | |
| 201 | + | func (x *AsyncInitableBase) NewFinish(ResVar AsyncResult) (*gobject.Object, error) { | |
| 202 | + | var cls *gobject.Object | |
| 203 | + | var cerr *glib.Error | |
| 196 | 204 | ||
| 197 | - | NewFinishPtr := XGAsyncInitableNewFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 198 | - | if NewFinishPtr == 0 { | |
| 199 | - | return nil | |
| 200 | - | } | |
| 205 | + | cret := XGAsyncInitableNewFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 201 | 206 | ||
| 202 | - | NewFinishCls := &gobject.Object{} | |
| 203 | - | NewFinishCls.Ptr = NewFinishPtr | |
| 204 | - | return NewFinishCls | |
| 207 | + | if cret == 0 { | |
| 208 | + | return cls, cerr | |
| 209 | + | } | |
| 210 | + | cls = &gobject.Object{} | |
| 211 | + | cls.Ptr = cret | |
| 212 | + | if cerr == nil { | |
| 213 | + | return cls, nil | |
| 214 | + | } | |
| 215 | + | return cls, cerr | |
| 205 | 216 | ||
| 206 | 217 | } | |
| 207 | 218 | ||
| 208 | 219 | var XGAsyncInitableInitAsync func(uintptr, int, uintptr, uintptr, uintptr) | |
| 209 | - | var XGAsyncInitableInitFinish func(uintptr, uintptr) bool | |
| 210 | - | var XGAsyncInitableNewFinish func(uintptr, uintptr) uintptr | |
| 220 | + | var XGAsyncInitableInitFinish func(uintptr, uintptr, **glib.Error) bool | |
| 221 | + | var XGAsyncInitableNewFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 211 | 222 | ||
| 212 | 223 | var xAsyncInitableNewvAsync func([]interface{}, uint, *gobject.Parameter, int, uintptr, uintptr, uintptr) | |
| 213 | 224 | ||
M v4/gio/gasyncresult.go +20 -14
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -124,31 +125,31 @@ func (x *AsyncResultBase) SetGoPointer(ptr uintptr) { | |||
| 124 | 125 | ||
| 125 | 126 | // Gets the source object from a #GAsyncResult. | |
| 126 | 127 | func (x *AsyncResultBase) GetSourceObject() *gobject.Object { | |
| 128 | + | var cls *gobject.Object | |
| 127 | 129 | ||
| 128 | - | GetSourceObjectPtr := XGAsyncResultGetSourceObject(x.GoPointer()) | |
| 129 | - | if GetSourceObjectPtr == 0 { | |
| 130 | - | return nil | |
| 131 | - | } | |
| 132 | - | ||
| 133 | - | GetSourceObjectCls := &gobject.Object{} | |
| 134 | - | GetSourceObjectCls.Ptr = GetSourceObjectPtr | |
| 135 | - | return GetSourceObjectCls | |
| 130 | + | cret := XGAsyncResultGetSourceObject(x.GoPointer()) | |
| 136 | 131 | ||
| 132 | + | if cret == 0 { | |
| 133 | + | return cls | |
| 134 | + | } | |
| 135 | + | cls = &gobject.Object{} | |
| 136 | + | cls.Ptr = cret | |
| 137 | + | return cls | |
| 137 | 138 | } | |
| 138 | 139 | ||
| 139 | 140 | // Gets the user data from a #GAsyncResult. | |
| 140 | 141 | func (x *AsyncResultBase) GetUserData() uintptr { | |
| 141 | 142 | ||
| 142 | - | return XGAsyncResultGetUserData(x.GoPointer()) | |
| 143 | - | ||
| 143 | + | cret := XGAsyncResultGetUserData(x.GoPointer()) | |
| 144 | + | return cret | |
| 144 | 145 | } | |
| 145 | 146 | ||
| 146 | 147 | // Checks if @res has the given @source_tag (generally a function | |
| 147 | 148 | // pointer indicating the function @res was created by). | |
| 148 | 149 | func (x *AsyncResultBase) IsTagged(SourceTagVar uintptr) bool { | |
| 149 | 150 | ||
| 150 | - | return XGAsyncResultIsTagged(x.GoPointer(), SourceTagVar) | |
| 151 | - | ||
| 151 | + | cret := XGAsyncResultIsTagged(x.GoPointer(), SourceTagVar) | |
| 152 | + | return cret | |
| 152 | 153 | } | |
| 153 | 154 | ||
| 154 | 155 | // If @res is a #GSimpleAsyncResult, this is equivalent to | |
| @@ -161,9 +162,14 @@ func (x *AsyncResultBase) IsTagged(SourceTagVar uintptr) bool { | |||
| 161 | 162 | // This should not be used in new code; #GAsyncResult errors that are | |
| 162 | 163 | // set by virtual methods should also be extracted by virtual methods, | |
| 163 | 164 | // to enable subclasses to chain up correctly. | |
| 164 | - | func (x *AsyncResultBase) LegacyPropagateError() bool { | |
| 165 | + | func (x *AsyncResultBase) LegacyPropagateError() (bool, error) { | |
| 166 | + | var cerr *glib.Error | |
| 165 | 167 | ||
| 166 | - | return XGAsyncResultLegacyPropagateError(x.GoPointer()) | |
| 168 | + | cret := XGAsyncResultLegacyPropagateError(x.GoPointer()) | |
| 169 | + | if cerr == nil { | |
| 170 | + | return cret, nil | |
| 171 | + | } | |
| 172 | + | return cret, cerr | |
| 167 | 173 | ||
| 168 | 174 | } | |
| 169 | 175 | ||
M v4/gio/gbufferedinputstream.go +70 -41
| @@ -43,14 +43,16 @@ var xNewBufferedInputStream func(uintptr) uintptr | |||
| 43 | 43 | // Creates a new #GInputStream from the given @base_stream, with | |
| 44 | 44 | // a buffer set to the default size (4 kilobytes). | |
| 45 | 45 | func NewBufferedInputStream(BaseStreamVar *InputStream) *InputStream { | |
| 46 | - | NewBufferedInputStreamPtr := xNewBufferedInputStream(BaseStreamVar.GoPointer()) | |
| 47 | - | if NewBufferedInputStreamPtr == 0 { | |
| 48 | - | return nil | |
| 49 | - | } | |
| 46 | + | var cls *InputStream | |
| 47 | + | ||
| 48 | + | cret := xNewBufferedInputStream(BaseStreamVar.GoPointer()) | |
| 50 | 49 | ||
| 51 | - | NewBufferedInputStreamCls := &InputStream{} | |
| 52 | - | NewBufferedInputStreamCls.Ptr = NewBufferedInputStreamPtr | |
| 53 | - | return NewBufferedInputStreamCls | |
| 50 | + | if cret == 0 { | |
| 51 | + | return cls | |
| 52 | + | } | |
| 53 | + | cls = &InputStream{} | |
| 54 | + | cls.Ptr = cret | |
| 55 | + | return cls | |
| 54 | 56 | } | |
| 55 | 57 | ||
| 56 | 58 | var xNewSizedBufferedInputStream func(uintptr, uint) uintptr | |
| @@ -58,17 +60,19 @@ var xNewSizedBufferedInputStream func(uintptr, uint) uintptr | |||
| 58 | 60 | // Creates a new #GBufferedInputStream from the given @base_stream, | |
| 59 | 61 | // with a buffer set to @size. | |
| 60 | 62 | func NewSizedBufferedInputStream(BaseStreamVar *InputStream, SizeVar uint) *InputStream { | |
| 61 | - | NewSizedBufferedInputStreamPtr := xNewSizedBufferedInputStream(BaseStreamVar.GoPointer(), SizeVar) | |
| 62 | - | if NewSizedBufferedInputStreamPtr == 0 { | |
| 63 | - | return nil | |
| 64 | - | } | |
| 63 | + | var cls *InputStream | |
| 65 | 64 | ||
| 66 | - | NewSizedBufferedInputStreamCls := &InputStream{} | |
| 67 | - | NewSizedBufferedInputStreamCls.Ptr = NewSizedBufferedInputStreamPtr | |
| 68 | - | return NewSizedBufferedInputStreamCls | |
| 65 | + | cret := xNewSizedBufferedInputStream(BaseStreamVar.GoPointer(), SizeVar) | |
| 66 | + | ||
| 67 | + | if cret == 0 { | |
| 68 | + | return cls | |
| 69 | + | } | |
| 70 | + | cls = &InputStream{} | |
| 71 | + | cls.Ptr = cret | |
| 72 | + | return cls | |
| 69 | 73 | } | |
| 70 | 74 | ||
| 71 | - | var xBufferedInputStreamFill func(uintptr, int, uintptr) int | |
| 75 | + | var xBufferedInputStreamFill func(uintptr, int, uintptr, **glib.Error) int | |
| 72 | 76 | ||
| 73 | 77 | // Tries to read @count bytes from the stream into the buffer. | |
| 74 | 78 | // Will block during this read. | |
| @@ -94,9 +98,14 @@ var xBufferedInputStreamFill func(uintptr, int, uintptr) int | |||
| 94 | 98 | // | |
| 95 | 99 | // For the asynchronous, non-blocking, version of this function, see | |
| 96 | 100 | // g_buffered_input_stream_fill_async(). | |
| 97 | - | func (x *BufferedInputStream) Fill(CountVar int, CancellableVar *Cancellable) int { | |
| 101 | + | func (x *BufferedInputStream) Fill(CountVar int, CancellableVar *Cancellable) (int, error) { | |
| 102 | + | var cerr *glib.Error | |
| 98 | 103 | ||
| 99 | - | return xBufferedInputStreamFill(x.GoPointer(), CountVar, CancellableVar.GoPointer()) | |
| 104 | + | cret := xBufferedInputStreamFill(x.GoPointer(), CountVar, CancellableVar.GoPointer(), &cerr) | |
| 105 | + | if cerr == nil { | |
| 106 | + | return cret, nil | |
| 107 | + | } | |
| 108 | + | return cret, cerr | |
| 100 | 109 | ||
| 101 | 110 | } | |
| 102 | 111 | ||
| @@ -114,12 +123,17 @@ func (x *BufferedInputStream) FillAsync(CountVar int, IoPriorityVar int, Cancell | |||
| 114 | 123 | ||
| 115 | 124 | } | |
| 116 | 125 | ||
| 117 | - | var xBufferedInputStreamFillFinish func(uintptr, uintptr) int | |
| 126 | + | var xBufferedInputStreamFillFinish func(uintptr, uintptr, **glib.Error) int | |
| 118 | 127 | ||
| 119 | 128 | // Finishes an asynchronous read. | |
| 120 | - | func (x *BufferedInputStream) FillFinish(ResultVar AsyncResult) int { | |
| 129 | + | func (x *BufferedInputStream) FillFinish(ResultVar AsyncResult) (int, error) { | |
| 130 | + | var cerr *glib.Error | |
| 121 | 131 | ||
| 122 | - | return xBufferedInputStreamFillFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 132 | + | cret := xBufferedInputStreamFillFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 133 | + | if cerr == nil { | |
| 134 | + | return cret, nil | |
| 135 | + | } | |
| 136 | + | return cret, cerr | |
| 123 | 137 | ||
| 124 | 138 | } | |
| 125 | 139 | ||
| @@ -128,8 +142,8 @@ var xBufferedInputStreamGetAvailable func(uintptr) uint | |||
| 128 | 142 | // Gets the size of the available data within the stream. | |
| 129 | 143 | func (x *BufferedInputStream) GetAvailable() uint { | |
| 130 | 144 | ||
| 131 | - | return xBufferedInputStreamGetAvailable(x.GoPointer()) | |
| 132 | - | ||
| 145 | + | cret := xBufferedInputStreamGetAvailable(x.GoPointer()) | |
| 146 | + | return cret | |
| 133 | 147 | } | |
| 134 | 148 | ||
| 135 | 149 | var xBufferedInputStreamGetBufferSize func(uintptr) uint | |
| @@ -137,8 +151,8 @@ var xBufferedInputStreamGetBufferSize func(uintptr) uint | |||
| 137 | 151 | // Gets the size of the input buffer. | |
| 138 | 152 | func (x *BufferedInputStream) GetBufferSize() uint { | |
| 139 | 153 | ||
| 140 | - | return xBufferedInputStreamGetBufferSize(x.GoPointer()) | |
| 141 | - | ||
| 154 | + | cret := xBufferedInputStreamGetBufferSize(x.GoPointer()) | |
| 155 | + | return cret | |
| 142 | 156 | } | |
| 143 | 157 | ||
| 144 | 158 | var xBufferedInputStreamPeek func(uintptr, uintptr, uint, uint) uint | |
| @@ -147,8 +161,8 @@ var xBufferedInputStreamPeek func(uintptr, uintptr, uint, uint) uint | |||
| 147 | 161 | // offset @offset bytes. | |
| 148 | 162 | func (x *BufferedInputStream) Peek(BufferVar uintptr, OffsetVar uint, CountVar uint) uint { | |
| 149 | 163 | ||
| 150 | - | return xBufferedInputStreamPeek(x.GoPointer(), BufferVar, OffsetVar, CountVar) | |
| 151 | - | ||
| 164 | + | cret := xBufferedInputStreamPeek(x.GoPointer(), BufferVar, OffsetVar, CountVar) | |
| 165 | + | return cret | |
| 152 | 166 | } | |
| 153 | 167 | ||
| 154 | 168 | var xBufferedInputStreamPeekBuffer func(uintptr, uint) uintptr | |
| @@ -158,11 +172,11 @@ var xBufferedInputStreamPeekBuffer func(uintptr, uint) uintptr | |||
| 158 | 172 | // the stream or filling the buffer. | |
| 159 | 173 | func (x *BufferedInputStream) PeekBuffer(CountVar uint) uintptr { | |
| 160 | 174 | ||
| 161 | - | return xBufferedInputStreamPeekBuffer(x.GoPointer(), CountVar) | |
| 162 | - | ||
| 175 | + | cret := xBufferedInputStreamPeekBuffer(x.GoPointer(), CountVar) | |
| 176 | + | return cret | |
| 163 | 177 | } | |
| 164 | 178 | ||
| 165 | - | var xBufferedInputStreamReadByte func(uintptr, uintptr) int | |
| 179 | + | var xBufferedInputStreamReadByte func(uintptr, uintptr, **glib.Error) int | |
| 166 | 180 | ||
| 167 | 181 | // Tries to read a single byte from the stream or the buffer. Will block | |
| 168 | 182 | // during this read. | |
| @@ -177,9 +191,14 @@ var xBufferedInputStreamReadByte func(uintptr, uintptr) int | |||
| 177 | 191 | // partial result will be returned, without an error. | |
| 178 | 192 | // | |
| 179 | 193 | // On error -1 is returned and @error is set accordingly. | |
| 180 | - | func (x *BufferedInputStream) ReadByte(CancellableVar *Cancellable) int { | |
| 194 | + | func (x *BufferedInputStream) ReadByte(CancellableVar *Cancellable) (int, error) { | |
| 195 | + | var cerr *glib.Error | |
| 181 | 196 | ||
| 182 | - | return xBufferedInputStreamReadByte(x.GoPointer(), CancellableVar.GoPointer()) | |
| 197 | + | cret := xBufferedInputStreamReadByte(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 198 | + | if cerr == nil { | |
| 199 | + | return cret, nil | |
| 200 | + | } | |
| 201 | + | return cret, cerr | |
| 183 | 202 | ||
| 184 | 203 | } | |
| 185 | 204 | ||
| @@ -205,16 +224,16 @@ func (c *BufferedInputStream) SetGoPointer(ptr uintptr) { | |||
| 205 | 224 | // Tests if the stream supports the #GSeekableIface. | |
| 206 | 225 | func (x *BufferedInputStream) CanSeek() bool { | |
| 207 | 226 | ||
| 208 | - | return XGSeekableCanSeek(x.GoPointer()) | |
| 209 | - | ||
| 227 | + | cret := XGSeekableCanSeek(x.GoPointer()) | |
| 228 | + | return cret | |
| 210 | 229 | } | |
| 211 | 230 | ||
| 212 | 231 | // Tests if the length of the stream can be adjusted with | |
| 213 | 232 | // g_seekable_truncate(). | |
| 214 | 233 | func (x *BufferedInputStream) CanTruncate() bool { | |
| 215 | 234 | ||
| 216 | - | return XGSeekableCanTruncate(x.GoPointer()) | |
| 217 | - | ||
| 235 | + | cret := XGSeekableCanTruncate(x.GoPointer()) | |
| 236 | + | return cret | |
| 218 | 237 | } | |
| 219 | 238 | ||
| 220 | 239 | // Seeks in the stream by the given @offset, modified by @type. | |
| @@ -231,17 +250,22 @@ func (x *BufferedInputStream) CanTruncate() bool { | |||
| 231 | 250 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 232 | 251 | // triggering the cancellable object from another thread. If the operation | |
| 233 | 252 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 234 | - | func (x *BufferedInputStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) bool { | |
| 253 | + | func (x *BufferedInputStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) (bool, error) { | |
| 254 | + | var cerr *glib.Error | |
| 235 | 255 | ||
| 236 | - | return XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer()) | |
| 256 | + | cret := XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 257 | + | if cerr == nil { | |
| 258 | + | return cret, nil | |
| 259 | + | } | |
| 260 | + | return cret, cerr | |
| 237 | 261 | ||
| 238 | 262 | } | |
| 239 | 263 | ||
| 240 | 264 | // Tells the current position within the stream. | |
| 241 | 265 | func (x *BufferedInputStream) Tell() int64 { | |
| 242 | 266 | ||
| 243 | - | return XGSeekableTell(x.GoPointer()) | |
| 244 | - | ||
| 267 | + | cret := XGSeekableTell(x.GoPointer()) | |
| 268 | + | return cret | |
| 245 | 269 | } | |
| 246 | 270 | ||
| 247 | 271 | // Sets the length of the stream to @offset. If the stream was previously | |
| @@ -253,9 +277,14 @@ func (x *BufferedInputStream) Tell() int64 { | |||
| 253 | 277 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an | |
| 254 | 278 | // operation was partially finished when the operation was cancelled the | |
| 255 | 279 | // partial result will be returned, without an error. | |
| 256 | - | func (x *BufferedInputStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) bool { | |
| 280 | + | func (x *BufferedInputStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) (bool, error) { | |
| 281 | + | var cerr *glib.Error | |
| 257 | 282 | ||
| 258 | - | return XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer()) | |
| 283 | + | cret := XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer(), &cerr) | |
| 284 | + | if cerr == nil { | |
| 285 | + | return cret, nil | |
| 286 | + | } | |
| 287 | + | return cret, cerr | |
| 259 | 288 | ||
| 260 | 289 | } | |
| 261 | 290 | ||
M v4/gio/gbufferedoutputstream.go +42 -28
| @@ -42,28 +42,32 @@ var xNewBufferedOutputStream func(uintptr) uintptr | |||
| 42 | 42 | ||
| 43 | 43 | // Creates a new buffered output stream for a base stream. | |
| 44 | 44 | func NewBufferedOutputStream(BaseStreamVar *OutputStream) *OutputStream { | |
| 45 | - | NewBufferedOutputStreamPtr := xNewBufferedOutputStream(BaseStreamVar.GoPointer()) | |
| 46 | - | if NewBufferedOutputStreamPtr == 0 { | |
| 47 | - | return nil | |
| 48 | - | } | |
| 45 | + | var cls *OutputStream | |
| 46 | + | ||
| 47 | + | cret := xNewBufferedOutputStream(BaseStreamVar.GoPointer()) | |
| 49 | 48 | ||
| 50 | - | NewBufferedOutputStreamCls := &OutputStream{} | |
| 51 | - | NewBufferedOutputStreamCls.Ptr = NewBufferedOutputStreamPtr | |
| 52 | - | return NewBufferedOutputStreamCls | |
| 49 | + | if cret == 0 { | |
| 50 | + | return cls | |
| 51 | + | } | |
| 52 | + | cls = &OutputStream{} | |
| 53 | + | cls.Ptr = cret | |
| 54 | + | return cls | |
| 53 | 55 | } | |
| 54 | 56 | ||
| 55 | 57 | var xNewSizedBufferedOutputStream func(uintptr, uint) uintptr | |
| 56 | 58 | ||
| 57 | 59 | // Creates a new buffered output stream with a given buffer size. | |
| 58 | 60 | func NewSizedBufferedOutputStream(BaseStreamVar *OutputStream, SizeVar uint) *OutputStream { | |
| 59 | - | NewSizedBufferedOutputStreamPtr := xNewSizedBufferedOutputStream(BaseStreamVar.GoPointer(), SizeVar) | |
| 60 | - | if NewSizedBufferedOutputStreamPtr == 0 { | |
| 61 | - | return nil | |
| 62 | - | } | |
| 61 | + | var cls *OutputStream | |
| 62 | + | ||
| 63 | + | cret := xNewSizedBufferedOutputStream(BaseStreamVar.GoPointer(), SizeVar) | |
| 63 | 64 | ||
| 64 | - | NewSizedBufferedOutputStreamCls := &OutputStream{} | |
| 65 | - | NewSizedBufferedOutputStreamCls.Ptr = NewSizedBufferedOutputStreamPtr | |
| 66 | - | return NewSizedBufferedOutputStreamCls | |
| 65 | + | if cret == 0 { | |
| 66 | + | return cls | |
| 67 | + | } | |
| 68 | + | cls = &OutputStream{} | |
| 69 | + | cls.Ptr = cret | |
| 70 | + | return cls | |
| 67 | 71 | } | |
| 68 | 72 | ||
| 69 | 73 | var xBufferedOutputStreamGetAutoGrow func(uintptr) bool | |
| @@ -71,8 +75,8 @@ var xBufferedOutputStreamGetAutoGrow func(uintptr) bool | |||
| 71 | 75 | // Checks if the buffer automatically grows as data is added. | |
| 72 | 76 | func (x *BufferedOutputStream) GetAutoGrow() bool { | |
| 73 | 77 | ||
| 74 | - | return xBufferedOutputStreamGetAutoGrow(x.GoPointer()) | |
| 75 | - | ||
| 78 | + | cret := xBufferedOutputStreamGetAutoGrow(x.GoPointer()) | |
| 79 | + | return cret | |
| 76 | 80 | } | |
| 77 | 81 | ||
| 78 | 82 | var xBufferedOutputStreamGetBufferSize func(uintptr) uint | |
| @@ -80,8 +84,8 @@ var xBufferedOutputStreamGetBufferSize func(uintptr) uint | |||
| 80 | 84 | // Gets the size of the buffer in the @stream. | |
| 81 | 85 | func (x *BufferedOutputStream) GetBufferSize() uint { | |
| 82 | 86 | ||
| 83 | - | return xBufferedOutputStreamGetBufferSize(x.GoPointer()) | |
| 84 | - | ||
| 87 | + | cret := xBufferedOutputStreamGetBufferSize(x.GoPointer()) | |
| 88 | + | return cret | |
| 85 | 89 | } | |
| 86 | 90 | ||
| 87 | 91 | var xBufferedOutputStreamSetAutoGrow func(uintptr, bool) | |
| @@ -116,16 +120,16 @@ func (c *BufferedOutputStream) SetGoPointer(ptr uintptr) { | |||
| 116 | 120 | // Tests if the stream supports the #GSeekableIface. | |
| 117 | 121 | func (x *BufferedOutputStream) CanSeek() bool { | |
| 118 | 122 | ||
| 119 | - | return XGSeekableCanSeek(x.GoPointer()) | |
| 120 | - | ||
| 123 | + | cret := XGSeekableCanSeek(x.GoPointer()) | |
| 124 | + | return cret | |
| 121 | 125 | } | |
| 122 | 126 | ||
| 123 | 127 | // Tests if the length of the stream can be adjusted with | |
| 124 | 128 | // g_seekable_truncate(). | |
| 125 | 129 | func (x *BufferedOutputStream) CanTruncate() bool { | |
| 126 | 130 | ||
| 127 | - | return XGSeekableCanTruncate(x.GoPointer()) | |
| 128 | - | ||
| 131 | + | cret := XGSeekableCanTruncate(x.GoPointer()) | |
| 132 | + | return cret | |
| 129 | 133 | } | |
| 130 | 134 | ||
| 131 | 135 | // Seeks in the stream by the given @offset, modified by @type. | |
| @@ -142,17 +146,22 @@ func (x *BufferedOutputStream) CanTruncate() bool { | |||
| 142 | 146 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 143 | 147 | // triggering the cancellable object from another thread. If the operation | |
| 144 | 148 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 145 | - | func (x *BufferedOutputStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) bool { | |
| 149 | + | func (x *BufferedOutputStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) (bool, error) { | |
| 150 | + | var cerr *glib.Error | |
| 146 | 151 | ||
| 147 | - | return XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer()) | |
| 152 | + | cret := XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 153 | + | if cerr == nil { | |
| 154 | + | return cret, nil | |
| 155 | + | } | |
| 156 | + | return cret, cerr | |
| 148 | 157 | ||
| 149 | 158 | } | |
| 150 | 159 | ||
| 151 | 160 | // Tells the current position within the stream. | |
| 152 | 161 | func (x *BufferedOutputStream) Tell() int64 { | |
| 153 | 162 | ||
| 154 | - | return XGSeekableTell(x.GoPointer()) | |
| 155 | - | ||
| 163 | + | cret := XGSeekableTell(x.GoPointer()) | |
| 164 | + | return cret | |
| 156 | 165 | } | |
| 157 | 166 | ||
| 158 | 167 | // Sets the length of the stream to @offset. If the stream was previously | |
| @@ -164,9 +173,14 @@ func (x *BufferedOutputStream) Tell() int64 { | |||
| 164 | 173 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an | |
| 165 | 174 | // operation was partially finished when the operation was cancelled the | |
| 166 | 175 | // partial result will be returned, without an error. | |
| 167 | - | func (x *BufferedOutputStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) bool { | |
| 176 | + | func (x *BufferedOutputStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) (bool, error) { | |
| 177 | + | var cerr *glib.Error | |
| 168 | 178 | ||
| 169 | - | return XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer()) | |
| 179 | + | cret := XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer(), &cerr) | |
| 180 | + | if cerr == nil { | |
| 181 | + | return cret, nil | |
| 182 | + | } | |
| 183 | + | return cret, cerr | |
| 170 | 184 | ||
| 171 | 185 | } | |
| 172 | 186 | ||
M v4/gio/gcancellable.go +26 -19
| @@ -39,14 +39,16 @@ var xNewCancellable func() uintptr | |||
| 39 | 39 | // One #GCancellable can be used in multiple consecutive | |
| 40 | 40 | // operations or in multiple concurrent operations. | |
| 41 | 41 | func NewCancellable() *Cancellable { | |
| 42 | - | NewCancellablePtr := xNewCancellable() | |
| 43 | - | if NewCancellablePtr == 0 { | |
| 44 | - | return nil | |
| 45 | - | } | |
| 42 | + | var cls *Cancellable | |
| 43 | + | ||
| 44 | + | cret := xNewCancellable() | |
| 46 | 45 | ||
| 47 | - | NewCancellableCls := &Cancellable{} | |
| 48 | - | NewCancellableCls.Ptr = NewCancellablePtr | |
| 49 | - | return NewCancellableCls | |
| 46 | + | if cret == 0 { | |
| 47 | + | return cls | |
| 48 | + | } | |
| 49 | + | cls = &Cancellable{} | |
| 50 | + | cls.Ptr = cret | |
| 51 | + | return cls | |
| 50 | 52 | } | |
| 51 | 53 | ||
| 52 | 54 | var xCancellableCancel func(uintptr) | |
| @@ -95,8 +97,8 @@ var xCancellableConnect func(uintptr, uintptr, uintptr, uintptr) uint32 | |||
| 95 | 97 | // code that unconditionally invokes e.g. g_cancellable_cancel(). | |
| 96 | 98 | func (x *Cancellable) Connect(CallbackVar gobject.Callback, DataVar uintptr, DataDestroyFuncVar glib.DestroyNotify) uint32 { | |
| 97 | 99 | ||
| 98 | - | return xCancellableConnect(x.GoPointer(), purego.NewCallback(CallbackVar), DataVar, purego.NewCallback(DataDestroyFuncVar)) | |
| 99 | - | ||
| 100 | + | cret := xCancellableConnect(x.GoPointer(), purego.NewCallback(CallbackVar), DataVar, purego.NewCallback(DataDestroyFuncVar)) | |
| 101 | + | return cret | |
| 100 | 102 | } | |
| 101 | 103 | ||
| 102 | 104 | var xCancellableDisconnect func(uintptr, uint32) | |
| @@ -138,8 +140,8 @@ var xCancellableGetFd func(uintptr) int | |||
| 138 | 140 | // See also g_cancellable_make_pollfd(). | |
| 139 | 141 | func (x *Cancellable) GetFd() int { | |
| 140 | 142 | ||
| 141 | - | return xCancellableGetFd(x.GoPointer()) | |
| 142 | - | ||
| 143 | + | cret := xCancellableGetFd(x.GoPointer()) | |
| 144 | + | return cret | |
| 143 | 145 | } | |
| 144 | 146 | ||
| 145 | 147 | var xCancellableIsCancelled func(uintptr) bool | |
| @@ -147,8 +149,8 @@ var xCancellableIsCancelled func(uintptr) bool | |||
| 147 | 149 | // Checks if a cancellable job has been cancelled. | |
| 148 | 150 | func (x *Cancellable) IsCancelled() bool { | |
| 149 | 151 | ||
| 150 | - | return xCancellableIsCancelled(x.GoPointer()) | |
| 151 | - | ||
| 152 | + | cret := xCancellableIsCancelled(x.GoPointer()) | |
| 153 | + | return cret | |
| 152 | 154 | } | |
| 153 | 155 | ||
| 154 | 156 | var xCancellableMakePollfd func(uintptr, *glib.PollFD) bool | |
| @@ -173,8 +175,8 @@ var xCancellableMakePollfd func(uintptr, *glib.PollFD) bool | |||
| 173 | 175 | // with g_cancellable_reset(). | |
| 174 | 176 | func (x *Cancellable) MakePollfd(PollfdVar *glib.PollFD) bool { | |
| 175 | 177 | ||
| 176 | - | return xCancellableMakePollfd(x.GoPointer(), PollfdVar) | |
| 177 | - | ||
| 178 | + | cret := xCancellableMakePollfd(x.GoPointer(), PollfdVar) | |
| 179 | + | return cret | |
| 178 | 180 | } | |
| 179 | 181 | ||
| 180 | 182 | var xCancellablePopCurrent func(uintptr) | |
| @@ -243,9 +245,14 @@ var xCancellableSetErrorIfCancelled func(uintptr) bool | |||
| 243 | 245 | ||
| 244 | 246 | // If the @cancellable is cancelled, sets the error to notify | |
| 245 | 247 | // that the operation was cancelled. | |
| 246 | - | func (x *Cancellable) SetErrorIfCancelled() bool { | |
| 248 | + | func (x *Cancellable) SetErrorIfCancelled() (bool, error) { | |
| 249 | + | var cerr *glib.Error | |
| 247 | 250 | ||
| 248 | - | return xCancellableSetErrorIfCancelled(x.GoPointer()) | |
| 251 | + | cret := xCancellableSetErrorIfCancelled(x.GoPointer()) | |
| 252 | + | if cerr == nil { | |
| 253 | + | return cret, nil | |
| 254 | + | } | |
| 255 | + | return cret, cerr | |
| 249 | 256 | ||
| 250 | 257 | } | |
| 251 | 258 | ||
| @@ -262,8 +269,8 @@ var xCancellableSourceNew func(uintptr) *glib.Source | |||
| 262 | 269 | // The new #GSource will hold a reference to the #GCancellable. | |
| 263 | 270 | func (x *Cancellable) SourceNew() *glib.Source { | |
| 264 | 271 | ||
| 265 | - | return xCancellableSourceNew(x.GoPointer()) | |
| 266 | - | ||
| 272 | + | cret := xCancellableSourceNew(x.GoPointer()) | |
| 273 | + | return cret | |
| 267 | 274 | } | |
| 268 | 275 | ||
| 269 | 276 | func (c *Cancellable) GoPointer() uintptr { | |
M v4/gio/gcharsetconverter.go +34 -16
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -23,18 +24,25 @@ func CharsetConverterNewFromInternalPtr(ptr uintptr) *CharsetConverter { | |||
| 23 | 24 | return cls | |
| 24 | 25 | } | |
| 25 | 26 | ||
| 26 | - | var xNewCharsetConverter func(string, string) uintptr | |
| 27 | + | var xNewCharsetConverter func(string, string, **glib.Error) uintptr | |
| 27 | 28 | ||
| 28 | 29 | // Creates a new #GCharsetConverter. | |
| 29 | - | func NewCharsetConverter(ToCharsetVar string, FromCharsetVar string) *CharsetConverter { | |
| 30 | - | NewCharsetConverterPtr := xNewCharsetConverter(ToCharsetVar, FromCharsetVar) | |
| 31 | - | if NewCharsetConverterPtr == 0 { | |
| 32 | - | return nil | |
| 30 | + | func NewCharsetConverter(ToCharsetVar string, FromCharsetVar string) (*CharsetConverter, error) { | |
| 31 | + | var cls *CharsetConverter | |
| 32 | + | var cerr *glib.Error | |
| 33 | + | ||
| 34 | + | cret := xNewCharsetConverter(ToCharsetVar, FromCharsetVar, &cerr) | |
| 35 | + | ||
| 36 | + | if cret == 0 { | |
| 37 | + | return cls, cerr | |
| 33 | 38 | } | |
| 39 | + | cls = &CharsetConverter{} | |
| 40 | + | cls.Ptr = cret | |
| 41 | + | if cerr == nil { | |
| 42 | + | return cls, nil | |
| 43 | + | } | |
| 44 | + | return cls, cerr | |
| 34 | 45 | ||
| 35 | - | NewCharsetConverterCls := &CharsetConverter{} | |
| 36 | - | NewCharsetConverterCls.Ptr = NewCharsetConverterPtr | |
| 37 | - | return NewCharsetConverterCls | |
| 38 | 46 | } | |
| 39 | 47 | ||
| 40 | 48 | var xCharsetConverterGetNumFallbacks func(uintptr) uint | |
| @@ -42,8 +50,8 @@ var xCharsetConverterGetNumFallbacks func(uintptr) uint | |||
| 42 | 50 | // Gets the number of fallbacks that @converter has applied so far. | |
| 43 | 51 | func (x *CharsetConverter) GetNumFallbacks() uint { | |
| 44 | 52 | ||
| 45 | - | return xCharsetConverterGetNumFallbacks(x.GoPointer()) | |
| 46 | - | ||
| 53 | + | cret := xCharsetConverterGetNumFallbacks(x.GoPointer()) | |
| 54 | + | return cret | |
| 47 | 55 | } | |
| 48 | 56 | ||
| 49 | 57 | var xCharsetConverterGetUseFallback func(uintptr) bool | |
| @@ -51,8 +59,8 @@ var xCharsetConverterGetUseFallback func(uintptr) bool | |||
| 51 | 59 | // Gets the #GCharsetConverter:use-fallback property. | |
| 52 | 60 | func (x *CharsetConverter) GetUseFallback() bool { | |
| 53 | 61 | ||
| 54 | - | return xCharsetConverterGetUseFallback(x.GoPointer()) | |
| 55 | - | ||
| 62 | + | cret := xCharsetConverterGetUseFallback(x.GoPointer()) | |
| 63 | + | return cret | |
| 56 | 64 | } | |
| 57 | 65 | ||
| 58 | 66 | var xCharsetConverterSetUseFallback func(uintptr, bool) | |
| @@ -154,9 +162,14 @@ func (c *CharsetConverter) SetGoPointer(ptr uintptr) { | |||
| 154 | 162 | // at a partial multibyte sequence). Converters are supposed to try | |
| 155 | 163 | // to produce as much output as possible and then return an error | |
| 156 | 164 | // (typically %G_IO_ERROR_PARTIAL_INPUT). | |
| 157 | - | func (x *CharsetConverter) Convert(InbufVar uintptr, InbufSizeVar uint, OutbufVar uintptr, OutbufSizeVar uint, FlagsVar ConverterFlags, BytesReadVar uint, BytesWrittenVar uint) ConverterResult { | |
| 165 | + | func (x *CharsetConverter) Convert(InbufVar uintptr, InbufSizeVar uint, OutbufVar uintptr, OutbufSizeVar uint, FlagsVar ConverterFlags, BytesReadVar uint, BytesWrittenVar uint) (ConverterResult, error) { | |
| 166 | + | var cerr *glib.Error | |
| 158 | 167 | ||
| 159 | - | return XGConverterConvert(x.GoPointer(), InbufVar, InbufSizeVar, OutbufVar, OutbufSizeVar, FlagsVar, BytesReadVar, BytesWrittenVar) | |
| 168 | + | cret := XGConverterConvert(x.GoPointer(), InbufVar, InbufSizeVar, OutbufVar, OutbufSizeVar, FlagsVar, BytesReadVar, BytesWrittenVar, &cerr) | |
| 169 | + | if cerr == nil { | |
| 170 | + | return cret, nil | |
| 171 | + | } | |
| 172 | + | return cret, cerr | |
| 160 | 173 | ||
| 161 | 174 | } | |
| 162 | 175 | ||
| @@ -207,9 +220,14 @@ func (x *CharsetConverter) Reset() { | |||
| 207 | 220 | // In this pattern, a caller would expect to be able to call g_initable_init() | |
| 208 | 221 | // on the result of g_object_new(), regardless of whether it is in fact a new | |
| 209 | 222 | // instance. | |
| 210 | - | func (x *CharsetConverter) Init(CancellableVar *Cancellable) bool { | |
| 223 | + | func (x *CharsetConverter) Init(CancellableVar *Cancellable) (bool, error) { | |
| 224 | + | var cerr *glib.Error | |
| 211 | 225 | ||
| 212 | - | return XGInitableInit(x.GoPointer(), CancellableVar.GoPointer()) | |
| 226 | + | cret := XGInitableInit(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 227 | + | if cerr == nil { | |
| 228 | + | return cret, nil | |
| 229 | + | } | |
| 230 | + | return cret, cerr | |
| 213 | 231 | ||
| 214 | 232 | } | |
| 215 | 233 | ||
M v4/gio/gcontenttype.go +42 -42
| @@ -13,8 +13,8 @@ var xContentTypeCanBeExecutable func(string) bool | |||
| 13 | 13 | // things like text files can be executables (i.e. scripts and batch files). | |
| 14 | 14 | func ContentTypeCanBeExecutable(TypeVar string) bool { | |
| 15 | 15 | ||
| 16 | - | return xContentTypeCanBeExecutable(TypeVar) | |
| 17 | - | ||
| 16 | + | cret := xContentTypeCanBeExecutable(TypeVar) | |
| 17 | + | return cret | |
| 18 | 18 | } | |
| 19 | 19 | ||
| 20 | 20 | var xContentTypeEquals func(string, string) bool | |
| @@ -22,8 +22,8 @@ var xContentTypeEquals func(string, string) bool | |||
| 22 | 22 | // Compares two content types for equality. | |
| 23 | 23 | func ContentTypeEquals(Type1Var string, Type2Var string) bool { | |
| 24 | 24 | ||
| 25 | - | return xContentTypeEquals(Type1Var, Type2Var) | |
| 26 | - | ||
| 25 | + | cret := xContentTypeEquals(Type1Var, Type2Var) | |
| 26 | + | return cret | |
| 27 | 27 | } | |
| 28 | 28 | ||
| 29 | 29 | var xContentTypeFromMimeType func(string) string | |
| @@ -31,8 +31,8 @@ var xContentTypeFromMimeType func(string) string | |||
| 31 | 31 | // Tries to find a content type based on the mime type name. | |
| 32 | 32 | func ContentTypeFromMimeType(MimeTypeVar string) string { | |
| 33 | 33 | ||
| 34 | - | return xContentTypeFromMimeType(MimeTypeVar) | |
| 35 | - | ||
| 34 | + | cret := xContentTypeFromMimeType(MimeTypeVar) | |
| 35 | + | return cret | |
| 36 | 36 | } | |
| 37 | 37 | ||
| 38 | 38 | var xContentTypeGetDescription func(string) string | |
| @@ -40,8 +40,8 @@ var xContentTypeGetDescription func(string) string | |||
| 40 | 40 | // Gets the human readable description of the content type. | |
| 41 | 41 | func ContentTypeGetDescription(TypeVar string) string { | |
| 42 | 42 | ||
| 43 | - | return xContentTypeGetDescription(TypeVar) | |
| 44 | - | ||
| 43 | + | cret := xContentTypeGetDescription(TypeVar) | |
| 44 | + | return cret | |
| 45 | 45 | } | |
| 46 | 46 | ||
| 47 | 47 | var xContentTypeGetGenericIconName func(string) string | |
| @@ -53,24 +53,24 @@ var xContentTypeGetGenericIconName func(string) string | |||
| 53 | 53 | // specification for more on the generic icon name. | |
| 54 | 54 | func ContentTypeGetGenericIconName(TypeVar string) string { | |
| 55 | 55 | ||
| 56 | - | return xContentTypeGetGenericIconName(TypeVar) | |
| 57 | - | ||
| 56 | + | cret := xContentTypeGetGenericIconName(TypeVar) | |
| 57 | + | return cret | |
| 58 | 58 | } | |
| 59 | 59 | ||
| 60 | 60 | var xContentTypeGetIcon func(string) uintptr | |
| 61 | 61 | ||
| 62 | 62 | // Gets the icon for a content type. | |
| 63 | 63 | func ContentTypeGetIcon(TypeVar string) *IconBase { | |
| 64 | + | var cls *IconBase | |
| 64 | 65 | ||
| 65 | - | ContentTypeGetIconPtr := xContentTypeGetIcon(TypeVar) | |
| 66 | - | if ContentTypeGetIconPtr == 0 { | |
| 67 | - | return nil | |
| 68 | - | } | |
| 69 | - | ||
| 70 | - | ContentTypeGetIconCls := &IconBase{} | |
| 71 | - | ContentTypeGetIconCls.Ptr = ContentTypeGetIconPtr | |
| 72 | - | return ContentTypeGetIconCls | |
| 66 | + | cret := xContentTypeGetIcon(TypeVar) | |
| 73 | 67 | ||
| 68 | + | if cret == 0 { | |
| 69 | + | return cls | |
| 70 | + | } | |
| 71 | + | cls = &IconBase{} | |
| 72 | + | cls.Ptr = cret | |
| 73 | + | return cls | |
| 74 | 74 | } | |
| 75 | 75 | ||
| 76 | 76 | var xContentTypeGetMimeDirs func() uintptr | |
| @@ -79,8 +79,8 @@ var xContentTypeGetMimeDirs func() uintptr | |||
| 79 | 79 | // g_content_type_set_mime_dirs() for details. | |
| 80 | 80 | func ContentTypeGetMimeDirs() uintptr { | |
| 81 | 81 | ||
| 82 | - | return xContentTypeGetMimeDirs() | |
| 83 | - | ||
| 82 | + | cret := xContentTypeGetMimeDirs() | |
| 83 | + | return cret | |
| 84 | 84 | } | |
| 85 | 85 | ||
| 86 | 86 | var xContentTypeGetMimeType func(string) string | |
| @@ -88,24 +88,24 @@ var xContentTypeGetMimeType func(string) string | |||
| 88 | 88 | // Gets the mime type for the content type, if one is registered. | |
| 89 | 89 | func ContentTypeGetMimeType(TypeVar string) string { | |
| 90 | 90 | ||
| 91 | - | return xContentTypeGetMimeType(TypeVar) | |
| 92 | - | ||
| 91 | + | cret := xContentTypeGetMimeType(TypeVar) | |
| 92 | + | return cret | |
| 93 | 93 | } | |
| 94 | 94 | ||
| 95 | 95 | var xContentTypeGetSymbolicIcon func(string) uintptr | |
| 96 | 96 | ||
| 97 | 97 | // Gets the symbolic icon for a content type. | |
| 98 | 98 | func ContentTypeGetSymbolicIcon(TypeVar string) *IconBase { | |
| 99 | + | var cls *IconBase | |
| 99 | 100 | ||
| 100 | - | ContentTypeGetSymbolicIconPtr := xContentTypeGetSymbolicIcon(TypeVar) | |
| 101 | - | if ContentTypeGetSymbolicIconPtr == 0 { | |
| 102 | - | return nil | |
| 103 | - | } | |
| 104 | - | ||
| 105 | - | ContentTypeGetSymbolicIconCls := &IconBase{} | |
| 106 | - | ContentTypeGetSymbolicIconCls.Ptr = ContentTypeGetSymbolicIconPtr | |
| 107 | - | return ContentTypeGetSymbolicIconCls | |
| 101 | + | cret := xContentTypeGetSymbolicIcon(TypeVar) | |
| 108 | 102 | ||
| 103 | + | if cret == 0 { | |
| 104 | + | return cls | |
| 105 | + | } | |
| 106 | + | cls = &IconBase{} | |
| 107 | + | cls.Ptr = cret | |
| 108 | + | return cls | |
| 109 | 109 | } | |
| 110 | 110 | ||
| 111 | 111 | var xContentTypeGuess func(string, uintptr, uint, bool) string | |
| @@ -116,8 +116,8 @@ var xContentTypeGuess func(string, uintptr, uint, bool) string | |||
| 116 | 116 | // on the other argument. | |
| 117 | 117 | func ContentTypeGuess(FilenameVar string, DataVar uintptr, DataSizeVar uint, ResultUncertainVar bool) string { | |
| 118 | 118 | ||
| 119 | - | return xContentTypeGuess(FilenameVar, DataVar, DataSizeVar, ResultUncertainVar) | |
| 120 | - | ||
| 119 | + | cret := xContentTypeGuess(FilenameVar, DataVar, DataSizeVar, ResultUncertainVar) | |
| 120 | + | return cret | |
| 121 | 121 | } | |
| 122 | 122 | ||
| 123 | 123 | var xContentTypeGuessForTree func(uintptr) uintptr | |
| @@ -136,8 +136,8 @@ var xContentTypeGuessForTree func(uintptr) uintptr | |||
| 136 | 136 | // g_mount_guess_content_type(). | |
| 137 | 137 | func ContentTypeGuessForTree(RootVar File) uintptr { | |
| 138 | 138 | ||
| 139 | - | return xContentTypeGuessForTree(RootVar.GoPointer()) | |
| 140 | - | ||
| 139 | + | cret := xContentTypeGuessForTree(RootVar.GoPointer()) | |
| 140 | + | return cret | |
| 141 | 141 | } | |
| 142 | 142 | ||
| 143 | 143 | var xContentTypeIsA func(string, string) bool | |
| @@ -145,8 +145,8 @@ var xContentTypeIsA func(string, string) bool | |||
| 145 | 145 | // Determines if @type is a subset of @supertype. | |
| 146 | 146 | func ContentTypeIsA(TypeVar string, SupertypeVar string) bool { | |
| 147 | 147 | ||
| 148 | - | return xContentTypeIsA(TypeVar, SupertypeVar) | |
| 149 | - | ||
| 148 | + | cret := xContentTypeIsA(TypeVar, SupertypeVar) | |
| 149 | + | return cret | |
| 150 | 150 | } | |
| 151 | 151 | ||
| 152 | 152 | var xContentTypeIsMimeType func(string, string) bool | |
| @@ -155,8 +155,8 @@ var xContentTypeIsMimeType func(string, string) bool | |||
| 155 | 155 | // Convenience wrapper around g_content_type_is_a(). | |
| 156 | 156 | func ContentTypeIsMimeType(TypeVar string, MimeTypeVar string) bool { | |
| 157 | 157 | ||
| 158 | - | return xContentTypeIsMimeType(TypeVar, MimeTypeVar) | |
| 159 | - | ||
| 158 | + | cret := xContentTypeIsMimeType(TypeVar, MimeTypeVar) | |
| 159 | + | return cret | |
| 160 | 160 | } | |
| 161 | 161 | ||
| 162 | 162 | var xContentTypeIsUnknown func(string) bool | |
| @@ -167,8 +167,8 @@ var xContentTypeIsUnknown func(string) bool | |||
| 167 | 167 | // or octet-stream. | |
| 168 | 168 | func ContentTypeIsUnknown(TypeVar string) bool { | |
| 169 | 169 | ||
| 170 | - | return xContentTypeIsUnknown(TypeVar) | |
| 171 | - | ||
| 170 | + | cret := xContentTypeIsUnknown(TypeVar) | |
| 171 | + | return cret | |
| 172 | 172 | } | |
| 173 | 173 | ||
| 174 | 174 | var xContentTypeSetMimeDirs func(uintptr) | |
| @@ -211,8 +211,8 @@ var xContentTypesGetRegistered func() *glib.List | |||
| 211 | 211 | // `g_list_free_full (list, g_free)`. | |
| 212 | 212 | func ContentTypesGetRegistered() *glib.List { | |
| 213 | 213 | ||
| 214 | - | return xContentTypesGetRegistered() | |
| 215 | - | ||
| 214 | + | cret := xContentTypesGetRegistered() | |
| 215 | + | return cret | |
| 216 | 216 | } | |
| 217 | 217 | ||
| 218 | 218 | func init() { | |
M v4/gio/gconverter.go +9 -3
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | ) | |
| 8 | 9 | ||
| 9 | 10 | // Provides an interface for converting data from one type | |
| @@ -120,9 +121,14 @@ func (x *ConverterBase) SetGoPointer(ptr uintptr) { | |||
| 120 | 121 | // at a partial multibyte sequence). Converters are supposed to try | |
| 121 | 122 | // to produce as much output as possible and then return an error | |
| 122 | 123 | // (typically %G_IO_ERROR_PARTIAL_INPUT). | |
| 123 | - | func (x *ConverterBase) Convert(InbufVar uintptr, InbufSizeVar uint, OutbufVar uintptr, OutbufSizeVar uint, FlagsVar ConverterFlags, BytesReadVar uint, BytesWrittenVar uint) ConverterResult { | |
| 124 | + | func (x *ConverterBase) Convert(InbufVar uintptr, InbufSizeVar uint, OutbufVar uintptr, OutbufSizeVar uint, FlagsVar ConverterFlags, BytesReadVar uint, BytesWrittenVar uint) (ConverterResult, error) { | |
| 125 | + | var cerr *glib.Error | |
| 124 | 126 | ||
| 125 | - | return XGConverterConvert(x.GoPointer(), InbufVar, InbufSizeVar, OutbufVar, OutbufSizeVar, FlagsVar, BytesReadVar, BytesWrittenVar) | |
| 127 | + | cret := XGConverterConvert(x.GoPointer(), InbufVar, InbufSizeVar, OutbufVar, OutbufSizeVar, FlagsVar, BytesReadVar, BytesWrittenVar, &cerr) | |
| 128 | + | if cerr == nil { | |
| 129 | + | return cret, nil | |
| 130 | + | } | |
| 131 | + | return cret, cerr | |
| 126 | 132 | ||
| 127 | 133 | } | |
| 128 | 134 | ||
| @@ -135,7 +141,7 @@ func (x *ConverterBase) Reset() { | |||
| 135 | 141 | ||
| 136 | 142 | } | |
| 137 | 143 | ||
| 138 | - | var XGConverterConvert func(uintptr, uintptr, uint, uintptr, uint, ConverterFlags, uint, uint) ConverterResult | |
| 144 | + | var XGConverterConvert func(uintptr, uintptr, uint, uintptr, uint, ConverterFlags, uint, uint, **glib.Error) ConverterResult | |
| 139 | 145 | var XGConverterReset func(uintptr) | |
| 140 | 146 | ||
| 141 | 147 | func init() { | |
M v4/gio/gconverterinputstream.go +31 -25
| @@ -34,32 +34,33 @@ var xNewConverterInputStream func(uintptr, uintptr) uintptr | |||
| 34 | 34 | ||
| 35 | 35 | // Creates a new converter input stream for the @base_stream. | |
| 36 | 36 | func NewConverterInputStream(BaseStreamVar *InputStream, ConverterVar Converter) *InputStream { | |
| 37 | - | NewConverterInputStreamPtr := xNewConverterInputStream(BaseStreamVar.GoPointer(), ConverterVar.GoPointer()) | |
| 38 | - | if NewConverterInputStreamPtr == 0 { | |
| 39 | - | return nil | |
| 40 | - | } | |
| 37 | + | var cls *InputStream | |
| 38 | + | ||
| 39 | + | cret := xNewConverterInputStream(BaseStreamVar.GoPointer(), ConverterVar.GoPointer()) | |
| 41 | 40 | ||
| 42 | - | NewConverterInputStreamCls := &InputStream{} | |
| 43 | - | NewConverterInputStreamCls.Ptr = NewConverterInputStreamPtr | |
| 44 | - | return NewConverterInputStreamCls | |
| 41 | + | if cret == 0 { | |
| 42 | + | return cls | |
| 43 | + | } | |
| 44 | + | cls = &InputStream{} | |
| 45 | + | cls.Ptr = cret | |
| 46 | + | return cls | |
| 45 | 47 | } | |
| 46 | 48 | ||
| 47 | 49 | var xConverterInputStreamGetConverter func(uintptr) uintptr | |
| 48 | 50 | ||
| 49 | 51 | // Gets the #GConverter that is used by @converter_stream. | |
| 50 | 52 | func (x *ConverterInputStream) GetConverter() *ConverterBase { | |
| 53 | + | var cls *ConverterBase | |
| 51 | 54 | ||
| 52 | - | GetConverterPtr := xConverterInputStreamGetConverter(x.GoPointer()) | |
| 53 | - | if GetConverterPtr == 0 { | |
| 54 | - | return nil | |
| 55 | - | } | |
| 56 | - | ||
| 57 | - | gobject.IncreaseRef(GetConverterPtr) | |
| 58 | - | ||
| 59 | - | GetConverterCls := &ConverterBase{} | |
| 60 | - | GetConverterCls.Ptr = GetConverterPtr | |
| 61 | - | return GetConverterCls | |
| 55 | + | cret := xConverterInputStreamGetConverter(x.GoPointer()) | |
| 62 | 56 | ||
| 57 | + | if cret == 0 { | |
| 58 | + | return cls | |
| 59 | + | } | |
| 60 | + | gobject.IncreaseRef(cret) | |
| 61 | + | cls = &ConverterBase{} | |
| 62 | + | cls.Ptr = cret | |
| 63 | + | return cls | |
| 63 | 64 | } | |
| 64 | 65 | ||
| 65 | 66 | func (c *ConverterInputStream) GoPointer() uintptr { | |
| @@ -79,8 +80,8 @@ func (c *ConverterInputStream) SetGoPointer(ptr uintptr) { | |||
| 79 | 80 | // a stream cannot switch from pollable to non-pollable or vice versa. | |
| 80 | 81 | func (x *ConverterInputStream) CanPoll() bool { | |
| 81 | 82 | ||
| 82 | - | return XGPollableInputStreamCanPoll(x.GoPointer()) | |
| 83 | - | ||
| 83 | + | cret := XGPollableInputStreamCanPoll(x.GoPointer()) | |
| 84 | + | return cret | |
| 84 | 85 | } | |
| 85 | 86 | ||
| 86 | 87 | // Creates a #GSource that triggers when @stream can be read, or | |
| @@ -93,8 +94,8 @@ func (x *ConverterInputStream) CanPoll() bool { | |||
| 93 | 94 | // rather than g_input_stream_read() from the callback. | |
| 94 | 95 | func (x *ConverterInputStream) CreateSource(CancellableVar *Cancellable) *glib.Source { | |
| 95 | 96 | ||
| 96 | - | return XGPollableInputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer()) | |
| 97 | - | ||
| 97 | + | cret := XGPollableInputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer()) | |
| 98 | + | return cret | |
| 98 | 99 | } | |
| 99 | 100 | ||
| 100 | 101 | // Checks if @stream can be read. | |
| @@ -107,8 +108,8 @@ func (x *ConverterInputStream) CreateSource(CancellableVar *Cancellable) *glib.S | |||
| 107 | 108 | // %G_IO_ERROR_WOULD_BLOCK error rather than blocking. | |
| 108 | 109 | func (x *ConverterInputStream) IsReadable() bool { | |
| 109 | 110 | ||
| 110 | - | return XGPollableInputStreamIsReadable(x.GoPointer()) | |
| 111 | - | ||
| 111 | + | cret := XGPollableInputStreamIsReadable(x.GoPointer()) | |
| 112 | + | return cret | |
| 112 | 113 | } | |
| 113 | 114 | ||
| 114 | 115 | // Attempts to read up to @count bytes from @stream into @buffer, as | |
| @@ -122,9 +123,14 @@ func (x *ConverterInputStream) IsReadable() bool { | |||
| 122 | 123 | // if @cancellable has already been cancelled when you call, which | |
| 123 | 124 | // may happen if you call this method after a source triggers due | |
| 124 | 125 | // to having been cancelled. | |
| 125 | - | func (x *ConverterInputStream) ReadNonblocking(BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) int { | |
| 126 | + | func (x *ConverterInputStream) ReadNonblocking(BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) (int, error) { | |
| 127 | + | var cerr *glib.Error | |
| 126 | 128 | ||
| 127 | - | return XGPollableInputStreamReadNonblocking(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer()) | |
| 129 | + | cret := XGPollableInputStreamReadNonblocking(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer(), &cerr) | |
| 130 | + | if cerr == nil { | |
| 131 | + | return cret, nil | |
| 132 | + | } | |
| 133 | + | return cret, cerr | |
| 128 | 134 | ||
| 129 | 135 | } | |
| 130 | 136 | ||
M v4/gio/gconverteroutputstream.go +38 -27
| @@ -34,32 +34,33 @@ var xNewConverterOutputStream func(uintptr, uintptr) uintptr | |||
| 34 | 34 | ||
| 35 | 35 | // Creates a new converter output stream for the @base_stream. | |
| 36 | 36 | func NewConverterOutputStream(BaseStreamVar *OutputStream, ConverterVar Converter) *OutputStream { | |
| 37 | - | NewConverterOutputStreamPtr := xNewConverterOutputStream(BaseStreamVar.GoPointer(), ConverterVar.GoPointer()) | |
| 38 | - | if NewConverterOutputStreamPtr == 0 { | |
| 39 | - | return nil | |
| 40 | - | } | |
| 37 | + | var cls *OutputStream | |
| 38 | + | ||
| 39 | + | cret := xNewConverterOutputStream(BaseStreamVar.GoPointer(), ConverterVar.GoPointer()) | |
| 41 | 40 | ||
| 42 | - | NewConverterOutputStreamCls := &OutputStream{} | |
| 43 | - | NewConverterOutputStreamCls.Ptr = NewConverterOutputStreamPtr | |
| 44 | - | return NewConverterOutputStreamCls | |
| 41 | + | if cret == 0 { | |
| 42 | + | return cls | |
| 43 | + | } | |
| 44 | + | cls = &OutputStream{} | |
| 45 | + | cls.Ptr = cret | |
| 46 | + | return cls | |
| 45 | 47 | } | |
| 46 | 48 | ||
| 47 | 49 | var xConverterOutputStreamGetConverter func(uintptr) uintptr | |
| 48 | 50 | ||
| 49 | 51 | // Gets the #GConverter that is used by @converter_stream. | |
| 50 | 52 | func (x *ConverterOutputStream) GetConverter() *ConverterBase { | |
| 53 | + | var cls *ConverterBase | |
| 51 | 54 | ||
| 52 | - | GetConverterPtr := xConverterOutputStreamGetConverter(x.GoPointer()) | |
| 53 | - | if GetConverterPtr == 0 { | |
| 54 | - | return nil | |
| 55 | - | } | |
| 56 | - | ||
| 57 | - | gobject.IncreaseRef(GetConverterPtr) | |
| 58 | - | ||
| 59 | - | GetConverterCls := &ConverterBase{} | |
| 60 | - | GetConverterCls.Ptr = GetConverterPtr | |
| 61 | - | return GetConverterCls | |
| 55 | + | cret := xConverterOutputStreamGetConverter(x.GoPointer()) | |
| 62 | 56 | ||
| 57 | + | if cret == 0 { | |
| 58 | + | return cls | |
| 59 | + | } | |
| 60 | + | gobject.IncreaseRef(cret) | |
| 61 | + | cls = &ConverterBase{} | |
| 62 | + | cls.Ptr = cret | |
| 63 | + | return cls | |
| 63 | 64 | } | |
| 64 | 65 | ||
| 65 | 66 | func (c *ConverterOutputStream) GoPointer() uintptr { | |
| @@ -79,8 +80,8 @@ func (c *ConverterOutputStream) SetGoPointer(ptr uintptr) { | |||
| 79 | 80 | // a stream cannot switch from pollable to non-pollable or vice versa. | |
| 80 | 81 | func (x *ConverterOutputStream) CanPoll() bool { | |
| 81 | 82 | ||
| 82 | - | return XGPollableOutputStreamCanPoll(x.GoPointer()) | |
| 83 | - | ||
| 83 | + | cret := XGPollableOutputStreamCanPoll(x.GoPointer()) | |
| 84 | + | return cret | |
| 84 | 85 | } | |
| 85 | 86 | ||
| 86 | 87 | // Creates a #GSource that triggers when @stream can be written, or | |
| @@ -93,8 +94,8 @@ func (x *ConverterOutputStream) CanPoll() bool { | |||
| 93 | 94 | // rather than g_output_stream_write() from the callback. | |
| 94 | 95 | func (x *ConverterOutputStream) CreateSource(CancellableVar *Cancellable) *glib.Source { | |
| 95 | 96 | ||
| 96 | - | return XGPollableOutputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer()) | |
| 97 | - | ||
| 97 | + | cret := XGPollableOutputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer()) | |
| 98 | + | return cret | |
| 98 | 99 | } | |
| 99 | 100 | ||
| 100 | 101 | // Checks if @stream can be written. | |
| @@ -107,8 +108,8 @@ func (x *ConverterOutputStream) CreateSource(CancellableVar *Cancellable) *glib. | |||
| 107 | 108 | // %G_IO_ERROR_WOULD_BLOCK error rather than blocking. | |
| 108 | 109 | func (x *ConverterOutputStream) IsWritable() bool { | |
| 109 | 110 | ||
| 110 | - | return XGPollableOutputStreamIsWritable(x.GoPointer()) | |
| 111 | - | ||
| 111 | + | cret := XGPollableOutputStreamIsWritable(x.GoPointer()) | |
| 112 | + | return cret | |
| 112 | 113 | } | |
| 113 | 114 | ||
| 114 | 115 | // Attempts to write up to @count bytes from @buffer to @stream, as | |
| @@ -126,9 +127,14 @@ func (x *ConverterOutputStream) IsWritable() bool { | |||
| 126 | 127 | // Also note that if %G_IO_ERROR_WOULD_BLOCK is returned some underlying | |
| 127 | 128 | // transports like D/TLS require that you re-send the same @buffer and | |
| 128 | 129 | // @count in the next write call. | |
| 129 | - | func (x *ConverterOutputStream) WriteNonblocking(BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) int { | |
| 130 | + | func (x *ConverterOutputStream) WriteNonblocking(BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) (int, error) { | |
| 131 | + | var cerr *glib.Error | |
| 130 | 132 | ||
| 131 | - | return XGPollableOutputStreamWriteNonblocking(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer()) | |
| 133 | + | cret := XGPollableOutputStreamWriteNonblocking(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer(), &cerr) | |
| 134 | + | if cerr == nil { | |
| 135 | + | return cret, nil | |
| 136 | + | } | |
| 137 | + | return cret, cerr | |
| 132 | 138 | ||
| 133 | 139 | } | |
| 134 | 140 | ||
| @@ -148,9 +154,14 @@ func (x *ConverterOutputStream) WriteNonblocking(BufferVar uintptr, CountVar uin | |||
| 148 | 154 | // Also note that if %G_POLLABLE_RETURN_WOULD_BLOCK is returned some underlying | |
| 149 | 155 | // transports like D/TLS require that you re-send the same @vectors and | |
| 150 | 156 | // @n_vectors in the next write call. | |
| 151 | - | func (x *ConverterOutputStream) WritevNonblocking(VectorsVar uintptr, NVectorsVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) PollableReturn { | |
| 157 | + | func (x *ConverterOutputStream) WritevNonblocking(VectorsVar uintptr, NVectorsVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) (PollableReturn, error) { | |
| 158 | + | var cerr *glib.Error | |
| 152 | 159 | ||
| 153 | - | return XGPollableOutputStreamWritevNonblocking(x.GoPointer(), VectorsVar, NVectorsVar, BytesWrittenVar, CancellableVar.GoPointer()) | |
| 160 | + | cret := XGPollableOutputStreamWritevNonblocking(x.GoPointer(), VectorsVar, NVectorsVar, BytesWrittenVar, CancellableVar.GoPointer(), &cerr) | |
| 161 | + | if cerr == nil { | |
| 162 | + | return cret, nil | |
| 163 | + | } | |
| 164 | + | return cret, cerr | |
| 154 | 165 | ||
| 155 | 166 | } | |
| 156 | 167 | ||
M v4/gio/gcredentials.go +44 -21
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -63,14 +64,16 @@ var xNewCredentials func() uintptr | |||
| 63 | 64 | // Creates a new #GCredentials object with credentials matching the | |
| 64 | 65 | // the current process. | |
| 65 | 66 | func NewCredentials() *Credentials { | |
| 66 | - | NewCredentialsPtr := xNewCredentials() | |
| 67 | - | if NewCredentialsPtr == 0 { | |
| 68 | - | return nil | |
| 69 | - | } | |
| 67 | + | var cls *Credentials | |
| 68 | + | ||
| 69 | + | cret := xNewCredentials() | |
| 70 | 70 | ||
| 71 | - | NewCredentialsCls := &Credentials{} | |
| 72 | - | NewCredentialsCls.Ptr = NewCredentialsPtr | |
| 73 | - | return NewCredentialsCls | |
| 71 | + | if cret == 0 { | |
| 72 | + | return cls | |
| 73 | + | } | |
| 74 | + | cls = &Credentials{} | |
| 75 | + | cls.Ptr = cret | |
| 76 | + | return cls | |
| 74 | 77 | } | |
| 75 | 78 | ||
| 76 | 79 | var xCredentialsGetNative func(uintptr, CredentialsType) uintptr | |
| @@ -83,8 +86,8 @@ var xCredentialsGetNative func(uintptr, CredentialsType) uintptr | |||
| 83 | 86 | // the OS or if @native_type isn't supported by the OS. | |
| 84 | 87 | func (x *Credentials) GetNative(NativeTypeVar CredentialsType) uintptr { | |
| 85 | 88 | ||
| 86 | - | return xCredentialsGetNative(x.GoPointer(), NativeTypeVar) | |
| 87 | - | ||
| 89 | + | cret := xCredentialsGetNative(x.GoPointer(), NativeTypeVar) | |
| 90 | + | return cret | |
| 88 | 91 | } | |
| 89 | 92 | ||
| 90 | 93 | var xCredentialsGetUnixPid func(uintptr) int | |
| @@ -95,9 +98,14 @@ var xCredentialsGetUnixPid func(uintptr) int | |||
| 95 | 98 | // This operation can fail if #GCredentials is not supported on the | |
| 96 | 99 | // OS or if the native credentials type does not contain information | |
| 97 | 100 | // about the UNIX process ID. | |
| 98 | - | func (x *Credentials) GetUnixPid() int { | |
| 101 | + | func (x *Credentials) GetUnixPid() (int, error) { | |
| 102 | + | var cerr *glib.Error | |
| 99 | 103 | ||
| 100 | - | return xCredentialsGetUnixPid(x.GoPointer()) | |
| 104 | + | cret := xCredentialsGetUnixPid(x.GoPointer()) | |
| 105 | + | if cerr == nil { | |
| 106 | + | return cret, nil | |
| 107 | + | } | |
| 108 | + | return cret, cerr | |
| 101 | 109 | ||
| 102 | 110 | } | |
| 103 | 111 | ||
| @@ -109,21 +117,31 @@ var xCredentialsGetUnixUser func(uintptr) uint | |||
| 109 | 117 | // This operation can fail if #GCredentials is not supported on the | |
| 110 | 118 | // OS or if the native credentials type does not contain information | |
| 111 | 119 | // about the UNIX user. | |
| 112 | - | func (x *Credentials) GetUnixUser() uint { | |
| 120 | + | func (x *Credentials) GetUnixUser() (uint, error) { | |
| 121 | + | var cerr *glib.Error | |
| 113 | 122 | ||
| 114 | - | return xCredentialsGetUnixUser(x.GoPointer()) | |
| 123 | + | cret := xCredentialsGetUnixUser(x.GoPointer()) | |
| 124 | + | if cerr == nil { | |
| 125 | + | return cret, nil | |
| 126 | + | } | |
| 127 | + | return cret, cerr | |
| 115 | 128 | ||
| 116 | 129 | } | |
| 117 | 130 | ||
| 118 | - | var xCredentialsIsSameUser func(uintptr, uintptr) bool | |
| 131 | + | var xCredentialsIsSameUser func(uintptr, uintptr, **glib.Error) bool | |
| 119 | 132 | ||
| 120 | 133 | // Checks if @credentials and @other_credentials is the same user. | |
| 121 | 134 | // | |
| 122 | 135 | // This operation can fail if #GCredentials is not supported on the | |
| 123 | 136 | // the OS. | |
| 124 | - | func (x *Credentials) IsSameUser(OtherCredentialsVar *Credentials) bool { | |
| 137 | + | func (x *Credentials) IsSameUser(OtherCredentialsVar *Credentials) (bool, error) { | |
| 138 | + | var cerr *glib.Error | |
| 125 | 139 | ||
| 126 | - | return xCredentialsIsSameUser(x.GoPointer(), OtherCredentialsVar.GoPointer()) | |
| 140 | + | cret := xCredentialsIsSameUser(x.GoPointer(), OtherCredentialsVar.GoPointer(), &cerr) | |
| 141 | + | if cerr == nil { | |
| 142 | + | return cret, nil | |
| 143 | + | } | |
| 144 | + | return cret, cerr | |
| 127 | 145 | ||
| 128 | 146 | } | |
| 129 | 147 | ||
| @@ -141,7 +159,7 @@ func (x *Credentials) SetNative(NativeTypeVar CredentialsType, NativeVar uintptr | |||
| 141 | 159 | ||
| 142 | 160 | } | |
| 143 | 161 | ||
| 144 | - | var xCredentialsSetUnixUser func(uintptr, uint) bool | |
| 162 | + | var xCredentialsSetUnixUser func(uintptr, uint, **glib.Error) bool | |
| 145 | 163 | ||
| 146 | 164 | // Tries to set the UNIX user identifier on @credentials. This method | |
| 147 | 165 | // is only available on UNIX platforms. | |
| @@ -150,9 +168,14 @@ var xCredentialsSetUnixUser func(uintptr, uint) bool | |||
| 150 | 168 | // OS or if the native credentials type does not contain information | |
| 151 | 169 | // about the UNIX user. It can also fail if the OS does not allow the | |
| 152 | 170 | // use of "spoofed" credentials. | |
| 153 | - | func (x *Credentials) SetUnixUser(UidVar uint) bool { | |
| 171 | + | func (x *Credentials) SetUnixUser(UidVar uint) (bool, error) { | |
| 172 | + | var cerr *glib.Error | |
| 154 | 173 | ||
| 155 | - | return xCredentialsSetUnixUser(x.GoPointer(), UidVar) | |
| 174 | + | cret := xCredentialsSetUnixUser(x.GoPointer(), UidVar, &cerr) | |
| 175 | + | if cerr == nil { | |
| 176 | + | return cret, nil | |
| 177 | + | } | |
| 178 | + | return cret, cerr | |
| 156 | 179 | ||
| 157 | 180 | } | |
| 158 | 181 | ||
| @@ -163,8 +186,8 @@ var xCredentialsToString func(uintptr) string | |||
| 163 | 186 | // returned string may change in future GLib release. | |
| 164 | 187 | func (x *Credentials) ToString() string { | |
| 165 | 188 | ||
| 166 | - | return xCredentialsToString(x.GoPointer()) | |
| 167 | - | ||
| 189 | + | cret := xCredentialsToString(x.GoPointer()) | |
| 190 | + | return cret | |
| 168 | 191 | } | |
| 169 | 192 | ||
| 170 | 193 | func (c *Credentials) GoPointer() uintptr { | |
M v4/gio/gdatagrambased.go +28 -13
| @@ -122,8 +122,8 @@ func (x *DatagramBasedBase) SetGoPointer(ptr uintptr) { | |||
| 122 | 122 | // This call never blocks. | |
| 123 | 123 | func (x *DatagramBasedBase) ConditionCheck(ConditionVar glib.IOCondition) glib.IOCondition { | |
| 124 | 124 | ||
| 125 | - | return XGDatagramBasedConditionCheck(x.GoPointer(), ConditionVar) | |
| 126 | - | ||
| 125 | + | cret := XGDatagramBasedConditionCheck(x.GoPointer(), ConditionVar) | |
| 126 | + | return cret | |
| 127 | 127 | } | |
| 128 | 128 | ||
| 129 | 129 | // Waits for up to @timeout microseconds for condition to become true on | |
| @@ -132,9 +132,14 @@ func (x *DatagramBasedBase) ConditionCheck(ConditionVar glib.IOCondition) glib.I | |||
| 132 | 132 | // If @cancellable is cancelled before the condition is met, or if @timeout is | |
| 133 | 133 | // reached before the condition is met, then %FALSE is returned and @error is | |
| 134 | 134 | // set appropriately (%G_IO_ERROR_CANCELLED or %G_IO_ERROR_TIMED_OUT). | |
| 135 | - | func (x *DatagramBasedBase) ConditionWait(ConditionVar glib.IOCondition, TimeoutVar int64, CancellableVar *Cancellable) bool { | |
| 135 | + | func (x *DatagramBasedBase) ConditionWait(ConditionVar glib.IOCondition, TimeoutVar int64, CancellableVar *Cancellable) (bool, error) { | |
| 136 | + | var cerr *glib.Error | |
| 136 | 137 | ||
| 137 | - | return XGDatagramBasedConditionWait(x.GoPointer(), ConditionVar, TimeoutVar, CancellableVar.GoPointer()) | |
| 138 | + | cret := XGDatagramBasedConditionWait(x.GoPointer(), ConditionVar, TimeoutVar, CancellableVar.GoPointer(), &cerr) | |
| 139 | + | if cerr == nil { | |
| 140 | + | return cret, nil | |
| 141 | + | } | |
| 142 | + | return cret, cerr | |
| 138 | 143 | ||
| 139 | 144 | } | |
| 140 | 145 | ||
| @@ -154,8 +159,8 @@ func (x *DatagramBasedBase) ConditionWait(ConditionVar glib.IOCondition, Timeout | |||
| 154 | 159 | // g_cancellable_is_cancelled(). | |
| 155 | 160 | func (x *DatagramBasedBase) CreateSource(ConditionVar glib.IOCondition, CancellableVar *Cancellable) *glib.Source { | |
| 156 | 161 | ||
| 157 | - | return XGDatagramBasedCreateSource(x.GoPointer(), ConditionVar, CancellableVar.GoPointer()) | |
| 158 | - | ||
| 162 | + | cret := XGDatagramBasedCreateSource(x.GoPointer(), ConditionVar, CancellableVar.GoPointer()) | |
| 163 | + | return cret | |
| 159 | 164 | } | |
| 160 | 165 | ||
| 161 | 166 | // Receive one or more data messages from @datagram_based in one go. | |
| @@ -208,9 +213,14 @@ func (x *DatagramBasedBase) CreateSource(ConditionVar glib.IOCondition, Cancella | |||
| 208 | 213 | // messages successfully received before the error will be returned. If | |
| 209 | 214 | // @cancellable is cancelled, %G_IO_ERROR_CANCELLED is returned as with any | |
| 210 | 215 | // other error. | |
| 211 | - | func (x *DatagramBasedBase) ReceiveMessages(MessagesVar uintptr, NumMessagesVar uint, FlagsVar int, TimeoutVar int64, CancellableVar *Cancellable) int { | |
| 216 | + | func (x *DatagramBasedBase) ReceiveMessages(MessagesVar uintptr, NumMessagesVar uint, FlagsVar int, TimeoutVar int64, CancellableVar *Cancellable) (int, error) { | |
| 217 | + | var cerr *glib.Error | |
| 212 | 218 | ||
| 213 | - | return XGDatagramBasedReceiveMessages(x.GoPointer(), MessagesVar, NumMessagesVar, FlagsVar, TimeoutVar, CancellableVar.GoPointer()) | |
| 219 | + | cret := XGDatagramBasedReceiveMessages(x.GoPointer(), MessagesVar, NumMessagesVar, FlagsVar, TimeoutVar, CancellableVar.GoPointer(), &cerr) | |
| 220 | + | if cerr == nil { | |
| 221 | + | return cret, nil | |
| 222 | + | } | |
| 223 | + | return cret, cerr | |
| 214 | 224 | ||
| 215 | 225 | } | |
| 216 | 226 | ||
| @@ -255,17 +265,22 @@ func (x *DatagramBasedBase) ReceiveMessages(MessagesVar uintptr, NumMessagesVar | |||
| 255 | 265 | // be returned if zero messages could be sent; otherwise the number of messages | |
| 256 | 266 | // successfully sent before the error will be returned. If @cancellable is | |
| 257 | 267 | // cancelled, %G_IO_ERROR_CANCELLED is returned as with any other error. | |
| 258 | - | func (x *DatagramBasedBase) SendMessages(MessagesVar uintptr, NumMessagesVar uint, FlagsVar int, TimeoutVar int64, CancellableVar *Cancellable) int { | |
| 268 | + | func (x *DatagramBasedBase) SendMessages(MessagesVar uintptr, NumMessagesVar uint, FlagsVar int, TimeoutVar int64, CancellableVar *Cancellable) (int, error) { | |
| 269 | + | var cerr *glib.Error | |
| 259 | 270 | ||
| 260 | - | return XGDatagramBasedSendMessages(x.GoPointer(), MessagesVar, NumMessagesVar, FlagsVar, TimeoutVar, CancellableVar.GoPointer()) | |
| 271 | + | cret := XGDatagramBasedSendMessages(x.GoPointer(), MessagesVar, NumMessagesVar, FlagsVar, TimeoutVar, CancellableVar.GoPointer(), &cerr) | |
| 272 | + | if cerr == nil { | |
| 273 | + | return cret, nil | |
| 274 | + | } | |
| 275 | + | return cret, cerr | |
| 261 | 276 | ||
| 262 | 277 | } | |
| 263 | 278 | ||
| 264 | 279 | var XGDatagramBasedConditionCheck func(uintptr, glib.IOCondition) glib.IOCondition | |
| 265 | - | var XGDatagramBasedConditionWait func(uintptr, glib.IOCondition, int64, uintptr) bool | |
| 280 | + | var XGDatagramBasedConditionWait func(uintptr, glib.IOCondition, int64, uintptr, **glib.Error) bool | |
| 266 | 281 | var XGDatagramBasedCreateSource func(uintptr, glib.IOCondition, uintptr) *glib.Source | |
| 267 | - | var XGDatagramBasedReceiveMessages func(uintptr, uintptr, uint, int, int64, uintptr) int | |
| 268 | - | var XGDatagramBasedSendMessages func(uintptr, uintptr, uint, int, int64, uintptr) int | |
| 282 | + | var XGDatagramBasedReceiveMessages func(uintptr, uintptr, uint, int, int64, uintptr, **glib.Error) int | |
| 283 | + | var XGDatagramBasedSendMessages func(uintptr, uintptr, uint, int, int64, uintptr, **glib.Error) int | |
| 269 | 284 | ||
| 270 | 285 | func init() { | |
| 271 | 286 | lib, err := purego.Dlopen(core.GetPath("GIO"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
M v4/gio/gdatainputstream.go +153 -66
| @@ -30,14 +30,16 @@ var xNewDataInputStream func(uintptr) uintptr | |||
| 30 | 30 | ||
| 31 | 31 | // Creates a new data input stream for the @base_stream. | |
| 32 | 32 | func NewDataInputStream(BaseStreamVar *InputStream) *DataInputStream { | |
| 33 | - | NewDataInputStreamPtr := xNewDataInputStream(BaseStreamVar.GoPointer()) | |
| 34 | - | if NewDataInputStreamPtr == 0 { | |
| 35 | - | return nil | |
| 36 | - | } | |
| 33 | + | var cls *DataInputStream | |
| 34 | + | ||
| 35 | + | cret := xNewDataInputStream(BaseStreamVar.GoPointer()) | |
| 37 | 36 | ||
| 38 | - | NewDataInputStreamCls := &DataInputStream{} | |
| 39 | - | NewDataInputStreamCls.Ptr = NewDataInputStreamPtr | |
| 40 | - | return NewDataInputStreamCls | |
| 37 | + | if cret == 0 { | |
| 38 | + | return cls | |
| 39 | + | } | |
| 40 | + | cls = &DataInputStream{} | |
| 41 | + | cls.Ptr = cret | |
| 42 | + | return cls | |
| 41 | 43 | } | |
| 42 | 44 | ||
| 43 | 45 | var xDataInputStreamGetByteOrder func(uintptr) DataStreamByteOrder | |
| @@ -45,8 +47,8 @@ var xDataInputStreamGetByteOrder func(uintptr) DataStreamByteOrder | |||
| 45 | 47 | // Gets the byte order for the data input stream. | |
| 46 | 48 | func (x *DataInputStream) GetByteOrder() DataStreamByteOrder { | |
| 47 | 49 | ||
| 48 | - | return xDataInputStreamGetByteOrder(x.GoPointer()) | |
| 49 | - | ||
| 50 | + | cret := xDataInputStreamGetByteOrder(x.GoPointer()) | |
| 51 | + | return cret | |
| 50 | 52 | } | |
| 51 | 53 | ||
| 52 | 54 | var xDataInputStreamGetNewlineType func(uintptr) DataStreamNewlineType | |
| @@ -54,32 +56,42 @@ var xDataInputStreamGetNewlineType func(uintptr) DataStreamNewlineType | |||
| 54 | 56 | // Gets the current newline type for the @stream. | |
| 55 | 57 | func (x *DataInputStream) GetNewlineType() DataStreamNewlineType { | |
| 56 | 58 | ||
| 57 | - | return xDataInputStreamGetNewlineType(x.GoPointer()) | |
| 58 | - | ||
| 59 | + | cret := xDataInputStreamGetNewlineType(x.GoPointer()) | |
| 60 | + | return cret | |
| 59 | 61 | } | |
| 60 | 62 | ||
| 61 | - | var xDataInputStreamReadByte func(uintptr, uintptr) byte | |
| 63 | + | var xDataInputStreamReadByte func(uintptr, uintptr, **glib.Error) byte | |
| 62 | 64 | ||
| 63 | 65 | // Reads an unsigned 8-bit/1-byte value from @stream. | |
| 64 | - | func (x *DataInputStream) ReadByte(CancellableVar *Cancellable) byte { | |
| 66 | + | func (x *DataInputStream) ReadByte(CancellableVar *Cancellable) (byte, error) { | |
| 67 | + | var cerr *glib.Error | |
| 65 | 68 | ||
| 66 | - | return xDataInputStreamReadByte(x.GoPointer(), CancellableVar.GoPointer()) | |
| 69 | + | cret := xDataInputStreamReadByte(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 70 | + | if cerr == nil { | |
| 71 | + | return cret, nil | |
| 72 | + | } | |
| 73 | + | return cret, cerr | |
| 67 | 74 | ||
| 68 | 75 | } | |
| 69 | 76 | ||
| 70 | - | var xDataInputStreamReadInt16 func(uintptr, uintptr) int16 | |
| 77 | + | var xDataInputStreamReadInt16 func(uintptr, uintptr, **glib.Error) int16 | |
| 71 | 78 | ||
| 72 | 79 | // Reads a 16-bit/2-byte value from @stream. | |
| 73 | 80 | // | |
| 74 | 81 | // In order to get the correct byte order for this read operation, | |
| 75 | 82 | // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order(). | |
| 76 | - | func (x *DataInputStream) ReadInt16(CancellableVar *Cancellable) int16 { | |
| 83 | + | func (x *DataInputStream) ReadInt16(CancellableVar *Cancellable) (int16, error) { | |
| 84 | + | var cerr *glib.Error | |
| 77 | 85 | ||
| 78 | - | return xDataInputStreamReadInt16(x.GoPointer(), CancellableVar.GoPointer()) | |
| 86 | + | cret := xDataInputStreamReadInt16(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 87 | + | if cerr == nil { | |
| 88 | + | return cret, nil | |
| 89 | + | } | |
| 90 | + | return cret, cerr | |
| 79 | 91 | ||
| 80 | 92 | } | |
| 81 | 93 | ||
| 82 | - | var xDataInputStreamReadInt32 func(uintptr, uintptr) int32 | |
| 94 | + | var xDataInputStreamReadInt32 func(uintptr, uintptr, **glib.Error) int32 | |
| 83 | 95 | ||
| 84 | 96 | // Reads a signed 32-bit/4-byte value from @stream. | |
| 85 | 97 | // | |
| @@ -89,13 +101,18 @@ var xDataInputStreamReadInt32 func(uintptr, uintptr) int32 | |||
| 89 | 101 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 90 | 102 | // triggering the cancellable object from another thread. If the operation | |
| 91 | 103 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 92 | - | func (x *DataInputStream) ReadInt32(CancellableVar *Cancellable) int32 { | |
| 104 | + | func (x *DataInputStream) ReadInt32(CancellableVar *Cancellable) (int32, error) { | |
| 105 | + | var cerr *glib.Error | |
| 93 | 106 | ||
| 94 | - | return xDataInputStreamReadInt32(x.GoPointer(), CancellableVar.GoPointer()) | |
| 107 | + | cret := xDataInputStreamReadInt32(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 108 | + | if cerr == nil { | |
| 109 | + | return cret, nil | |
| 110 | + | } | |
| 111 | + | return cret, cerr | |
| 95 | 112 | ||
| 96 | 113 | } | |
| 97 | 114 | ||
| 98 | - | var xDataInputStreamReadInt64 func(uintptr, uintptr) int64 | |
| 115 | + | var xDataInputStreamReadInt64 func(uintptr, uintptr, **glib.Error) int64 | |
| 99 | 116 | ||
| 100 | 117 | // Reads a 64-bit/8-byte value from @stream. | |
| 101 | 118 | // | |
| @@ -105,13 +122,18 @@ var xDataInputStreamReadInt64 func(uintptr, uintptr) int64 | |||
| 105 | 122 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 106 | 123 | // triggering the cancellable object from another thread. If the operation | |
| 107 | 124 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 108 | - | func (x *DataInputStream) ReadInt64(CancellableVar *Cancellable) int64 { | |
| 125 | + | func (x *DataInputStream) ReadInt64(CancellableVar *Cancellable) (int64, error) { | |
| 126 | + | var cerr *glib.Error | |
| 109 | 127 | ||
| 110 | - | return xDataInputStreamReadInt64(x.GoPointer(), CancellableVar.GoPointer()) | |
| 128 | + | cret := xDataInputStreamReadInt64(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 129 | + | if cerr == nil { | |
| 130 | + | return cret, nil | |
| 131 | + | } | |
| 132 | + | return cret, cerr | |
| 111 | 133 | ||
| 112 | 134 | } | |
| 113 | 135 | ||
| 114 | - | var xDataInputStreamReadLine func(uintptr, uint, uintptr) uintptr | |
| 136 | + | var xDataInputStreamReadLine func(uintptr, uint, uintptr, **glib.Error) uintptr | |
| 115 | 137 | ||
| 116 | 138 | // Reads a line from the data input stream. Note that no encoding | |
| 117 | 139 | // checks or conversion is performed; the input is not guaranteed to | |
| @@ -120,9 +142,14 @@ var xDataInputStreamReadLine func(uintptr, uint, uintptr) uintptr | |||
| 120 | 142 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 121 | 143 | // triggering the cancellable object from another thread. If the operation | |
| 122 | 144 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 123 | - | func (x *DataInputStream) ReadLine(LengthVar uint, CancellableVar *Cancellable) uintptr { | |
| 145 | + | func (x *DataInputStream) ReadLine(LengthVar uint, CancellableVar *Cancellable) (uintptr, error) { | |
| 146 | + | var cerr *glib.Error | |
| 124 | 147 | ||
| 125 | - | return xDataInputStreamReadLine(x.GoPointer(), LengthVar, CancellableVar.GoPointer()) | |
| 148 | + | cret := xDataInputStreamReadLine(x.GoPointer(), LengthVar, CancellableVar.GoPointer(), &cerr) | |
| 149 | + | if cerr == nil { | |
| 150 | + | return cret, nil | |
| 151 | + | } | |
| 152 | + | return cret, cerr | |
| 126 | 153 | ||
| 127 | 154 | } | |
| 128 | 155 | ||
| @@ -140,54 +167,74 @@ func (x *DataInputStream) ReadLineAsync(IoPriorityVar int, CancellableVar *Cance | |||
| 140 | 167 | ||
| 141 | 168 | } | |
| 142 | 169 | ||
| 143 | - | var xDataInputStreamReadLineFinish func(uintptr, uintptr, uint) uintptr | |
| 170 | + | var xDataInputStreamReadLineFinish func(uintptr, uintptr, uint, **glib.Error) uintptr | |
| 144 | 171 | ||
| 145 | 172 | // Finish an asynchronous call started by | |
| 146 | 173 | // g_data_input_stream_read_line_async(). Note the warning about | |
| 147 | 174 | // string encoding in g_data_input_stream_read_line() applies here as | |
| 148 | 175 | // well. | |
| 149 | - | func (x *DataInputStream) ReadLineFinish(ResultVar AsyncResult, LengthVar uint) uintptr { | |
| 176 | + | func (x *DataInputStream) ReadLineFinish(ResultVar AsyncResult, LengthVar uint) (uintptr, error) { | |
| 177 | + | var cerr *glib.Error | |
| 150 | 178 | ||
| 151 | - | return xDataInputStreamReadLineFinish(x.GoPointer(), ResultVar.GoPointer(), LengthVar) | |
| 179 | + | cret := xDataInputStreamReadLineFinish(x.GoPointer(), ResultVar.GoPointer(), LengthVar, &cerr) | |
| 180 | + | if cerr == nil { | |
| 181 | + | return cret, nil | |
| 182 | + | } | |
| 183 | + | return cret, cerr | |
| 152 | 184 | ||
| 153 | 185 | } | |
| 154 | 186 | ||
| 155 | - | var xDataInputStreamReadLineFinishUtf8 func(uintptr, uintptr, uint) string | |
| 187 | + | var xDataInputStreamReadLineFinishUtf8 func(uintptr, uintptr, uint, **glib.Error) string | |
| 156 | 188 | ||
| 157 | 189 | // Finish an asynchronous call started by | |
| 158 | 190 | // g_data_input_stream_read_line_async(). | |
| 159 | - | func (x *DataInputStream) ReadLineFinishUtf8(ResultVar AsyncResult, LengthVar uint) string { | |
| 191 | + | func (x *DataInputStream) ReadLineFinishUtf8(ResultVar AsyncResult, LengthVar uint) (string, error) { | |
| 192 | + | var cerr *glib.Error | |
| 160 | 193 | ||
| 161 | - | return xDataInputStreamReadLineFinishUtf8(x.GoPointer(), ResultVar.GoPointer(), LengthVar) | |
| 194 | + | cret := xDataInputStreamReadLineFinishUtf8(x.GoPointer(), ResultVar.GoPointer(), LengthVar, &cerr) | |
| 195 | + | if cerr == nil { | |
| 196 | + | return cret, nil | |
| 197 | + | } | |
| 198 | + | return cret, cerr | |
| 162 | 199 | ||
| 163 | 200 | } | |
| 164 | 201 | ||
| 165 | - | var xDataInputStreamReadLineUtf8 func(uintptr, uint, uintptr) string | |
| 202 | + | var xDataInputStreamReadLineUtf8 func(uintptr, uint, uintptr, **glib.Error) string | |
| 166 | 203 | ||
| 167 | 204 | // Reads a UTF-8 encoded line from the data input stream. | |
| 168 | 205 | // | |
| 169 | 206 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 170 | 207 | // triggering the cancellable object from another thread. If the operation | |
| 171 | 208 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 172 | - | func (x *DataInputStream) ReadLineUtf8(LengthVar uint, CancellableVar *Cancellable) string { | |
| 209 | + | func (x *DataInputStream) ReadLineUtf8(LengthVar uint, CancellableVar *Cancellable) (string, error) { | |
| 210 | + | var cerr *glib.Error | |
| 173 | 211 | ||
| 174 | - | return xDataInputStreamReadLineUtf8(x.GoPointer(), LengthVar, CancellableVar.GoPointer()) | |
| 212 | + | cret := xDataInputStreamReadLineUtf8(x.GoPointer(), LengthVar, CancellableVar.GoPointer(), &cerr) | |
| 213 | + | if cerr == nil { | |
| 214 | + | return cret, nil | |
| 215 | + | } | |
| 216 | + | return cret, cerr | |
| 175 | 217 | ||
| 176 | 218 | } | |
| 177 | 219 | ||
| 178 | - | var xDataInputStreamReadUint16 func(uintptr, uintptr) uint16 | |
| 220 | + | var xDataInputStreamReadUint16 func(uintptr, uintptr, **glib.Error) uint16 | |
| 179 | 221 | ||
| 180 | 222 | // Reads an unsigned 16-bit/2-byte value from @stream. | |
| 181 | 223 | // | |
| 182 | 224 | // In order to get the correct byte order for this read operation, | |
| 183 | 225 | // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order(). | |
| 184 | - | func (x *DataInputStream) ReadUint16(CancellableVar *Cancellable) uint16 { | |
| 226 | + | func (x *DataInputStream) ReadUint16(CancellableVar *Cancellable) (uint16, error) { | |
| 227 | + | var cerr *glib.Error | |
| 185 | 228 | ||
| 186 | - | return xDataInputStreamReadUint16(x.GoPointer(), CancellableVar.GoPointer()) | |
| 229 | + | cret := xDataInputStreamReadUint16(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 230 | + | if cerr == nil { | |
| 231 | + | return cret, nil | |
| 232 | + | } | |
| 233 | + | return cret, cerr | |
| 187 | 234 | ||
| 188 | 235 | } | |
| 189 | 236 | ||
| 190 | - | var xDataInputStreamReadUint32 func(uintptr, uintptr) uint32 | |
| 237 | + | var xDataInputStreamReadUint32 func(uintptr, uintptr, **glib.Error) uint32 | |
| 191 | 238 | ||
| 192 | 239 | // Reads an unsigned 32-bit/4-byte value from @stream. | |
| 193 | 240 | // | |
| @@ -197,13 +244,18 @@ var xDataInputStreamReadUint32 func(uintptr, uintptr) uint32 | |||
| 197 | 244 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 198 | 245 | // triggering the cancellable object from another thread. If the operation | |
| 199 | 246 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 200 | - | func (x *DataInputStream) ReadUint32(CancellableVar *Cancellable) uint32 { | |
| 247 | + | func (x *DataInputStream) ReadUint32(CancellableVar *Cancellable) (uint32, error) { | |
| 248 | + | var cerr *glib.Error | |
| 201 | 249 | ||
| 202 | - | return xDataInputStreamReadUint32(x.GoPointer(), CancellableVar.GoPointer()) | |
| 250 | + | cret := xDataInputStreamReadUint32(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 251 | + | if cerr == nil { | |
| 252 | + | return cret, nil | |
| 253 | + | } | |
| 254 | + | return cret, cerr | |
| 203 | 255 | ||
| 204 | 256 | } | |
| 205 | 257 | ||
| 206 | - | var xDataInputStreamReadUint64 func(uintptr, uintptr) uint64 | |
| 258 | + | var xDataInputStreamReadUint64 func(uintptr, uintptr, **glib.Error) uint64 | |
| 207 | 259 | ||
| 208 | 260 | // Reads an unsigned 64-bit/8-byte value from @stream. | |
| 209 | 261 | // | |
| @@ -213,13 +265,18 @@ var xDataInputStreamReadUint64 func(uintptr, uintptr) uint64 | |||
| 213 | 265 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 214 | 266 | // triggering the cancellable object from another thread. If the operation | |
| 215 | 267 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 216 | - | func (x *DataInputStream) ReadUint64(CancellableVar *Cancellable) uint64 { | |
| 268 | + | func (x *DataInputStream) ReadUint64(CancellableVar *Cancellable) (uint64, error) { | |
| 269 | + | var cerr *glib.Error | |
| 217 | 270 | ||
| 218 | - | return xDataInputStreamReadUint64(x.GoPointer(), CancellableVar.GoPointer()) | |
| 271 | + | cret := xDataInputStreamReadUint64(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 272 | + | if cerr == nil { | |
| 273 | + | return cret, nil | |
| 274 | + | } | |
| 275 | + | return cret, cerr | |
| 219 | 276 | ||
| 220 | 277 | } | |
| 221 | 278 | ||
| 222 | - | var xDataInputStreamReadUntil func(uintptr, string, uint, uintptr) string | |
| 279 | + | var xDataInputStreamReadUntil func(uintptr, string, uint, uintptr, **glib.Error) string | |
| 223 | 280 | ||
| 224 | 281 | // Reads a string from the data input stream, up to the first | |
| 225 | 282 | // occurrence of any of the stop characters. | |
| @@ -232,9 +289,14 @@ var xDataInputStreamReadUntil func(uintptr, string, uint, uintptr) string | |||
| 232 | 289 | // functions will be marked as deprecated in a future release. Use | |
| 233 | 290 | // g_data_input_stream_read_upto() instead, but note that that function | |
| 234 | 291 | // does not consume the stop character. | |
| 235 | - | func (x *DataInputStream) ReadUntil(StopCharsVar string, LengthVar uint, CancellableVar *Cancellable) string { | |
| 292 | + | func (x *DataInputStream) ReadUntil(StopCharsVar string, LengthVar uint, CancellableVar *Cancellable) (string, error) { | |
| 293 | + | var cerr *glib.Error | |
| 236 | 294 | ||
| 237 | - | return xDataInputStreamReadUntil(x.GoPointer(), StopCharsVar, LengthVar, CancellableVar.GoPointer()) | |
| 295 | + | cret := xDataInputStreamReadUntil(x.GoPointer(), StopCharsVar, LengthVar, CancellableVar.GoPointer(), &cerr) | |
| 296 | + | if cerr == nil { | |
| 297 | + | return cret, nil | |
| 298 | + | } | |
| 299 | + | return cret, cerr | |
| 238 | 300 | ||
| 239 | 301 | } | |
| 240 | 302 | ||
| @@ -261,17 +323,22 @@ func (x *DataInputStream) ReadUntilAsync(StopCharsVar string, IoPriorityVar int, | |||
| 261 | 323 | ||
| 262 | 324 | } | |
| 263 | 325 | ||
| 264 | - | var xDataInputStreamReadUntilFinish func(uintptr, uintptr, uint) string | |
| 326 | + | var xDataInputStreamReadUntilFinish func(uintptr, uintptr, uint, **glib.Error) string | |
| 265 | 327 | ||
| 266 | 328 | // Finish an asynchronous call started by | |
| 267 | 329 | // g_data_input_stream_read_until_async(). | |
| 268 | - | func (x *DataInputStream) ReadUntilFinish(ResultVar AsyncResult, LengthVar uint) string { | |
| 330 | + | func (x *DataInputStream) ReadUntilFinish(ResultVar AsyncResult, LengthVar uint) (string, error) { | |
| 331 | + | var cerr *glib.Error | |
| 269 | 332 | ||
| 270 | - | return xDataInputStreamReadUntilFinish(x.GoPointer(), ResultVar.GoPointer(), LengthVar) | |
| 333 | + | cret := xDataInputStreamReadUntilFinish(x.GoPointer(), ResultVar.GoPointer(), LengthVar, &cerr) | |
| 334 | + | if cerr == nil { | |
| 335 | + | return cret, nil | |
| 336 | + | } | |
| 337 | + | return cret, cerr | |
| 271 | 338 | ||
| 272 | 339 | } | |
| 273 | 340 | ||
| 274 | - | var xDataInputStreamReadUpto func(uintptr, string, int, uint, uintptr) string | |
| 341 | + | var xDataInputStreamReadUpto func(uintptr, string, int, uint, uintptr, **glib.Error) string | |
| 275 | 342 | ||
| 276 | 343 | // Reads a string from the data input stream, up to the first | |
| 277 | 344 | // occurrence of any of the stop characters. | |
| @@ -285,9 +352,14 @@ var xDataInputStreamReadUpto func(uintptr, string, int, uint, uintptr) string | |||
| 285 | 352 | // specified. | |
| 286 | 353 | // | |
| 287 | 354 | // The returned string will always be nul-terminated on success. | |
| 288 | - | func (x *DataInputStream) ReadUpto(StopCharsVar string, StopCharsLenVar int, LengthVar uint, CancellableVar *Cancellable) string { | |
| 355 | + | func (x *DataInputStream) ReadUpto(StopCharsVar string, StopCharsLenVar int, LengthVar uint, CancellableVar *Cancellable) (string, error) { | |
| 356 | + | var cerr *glib.Error | |
| 289 | 357 | ||
| 290 | - | return xDataInputStreamReadUpto(x.GoPointer(), StopCharsVar, StopCharsLenVar, LengthVar, CancellableVar.GoPointer()) | |
| 358 | + | cret := xDataInputStreamReadUpto(x.GoPointer(), StopCharsVar, StopCharsLenVar, LengthVar, CancellableVar.GoPointer(), &cerr) | |
| 359 | + | if cerr == nil { | |
| 360 | + | return cret, nil | |
| 361 | + | } | |
| 362 | + | return cret, cerr | |
| 291 | 363 | ||
| 292 | 364 | } | |
| 293 | 365 | ||
| @@ -313,7 +385,7 @@ func (x *DataInputStream) ReadUptoAsync(StopCharsVar string, StopCharsLenVar int | |||
| 313 | 385 | ||
| 314 | 386 | } | |
| 315 | 387 | ||
| 316 | - | var xDataInputStreamReadUptoFinish func(uintptr, uintptr, uint) string | |
| 388 | + | var xDataInputStreamReadUptoFinish func(uintptr, uintptr, uint, **glib.Error) string | |
| 317 | 389 | ||
| 318 | 390 | // Finish an asynchronous call started by | |
| 319 | 391 | // g_data_input_stream_read_upto_async(). | |
| @@ -323,9 +395,14 @@ var xDataInputStreamReadUptoFinish func(uintptr, uintptr, uint) string | |||
| 323 | 395 | // g_data_input_stream_read_upto_async() again. | |
| 324 | 396 | // | |
| 325 | 397 | // The returned string will always be nul-terminated on success. | |
| 326 | - | func (x *DataInputStream) ReadUptoFinish(ResultVar AsyncResult, LengthVar uint) string { | |
| 398 | + | func (x *DataInputStream) ReadUptoFinish(ResultVar AsyncResult, LengthVar uint) (string, error) { | |
| 399 | + | var cerr *glib.Error | |
| 327 | 400 | ||
| 328 | - | return xDataInputStreamReadUptoFinish(x.GoPointer(), ResultVar.GoPointer(), LengthVar) | |
| 401 | + | cret := xDataInputStreamReadUptoFinish(x.GoPointer(), ResultVar.GoPointer(), LengthVar, &cerr) | |
| 402 | + | if cerr == nil { | |
| 403 | + | return cret, nil | |
| 404 | + | } | |
| 405 | + | return cret, cerr | |
| 329 | 406 | ||
| 330 | 407 | } | |
| 331 | 408 | ||
| @@ -363,16 +440,16 @@ func (c *DataInputStream) SetGoPointer(ptr uintptr) { | |||
| 363 | 440 | // Tests if the stream supports the #GSeekableIface. | |
| 364 | 441 | func (x *DataInputStream) CanSeek() bool { | |
| 365 | 442 | ||
| 366 | - | return XGSeekableCanSeek(x.GoPointer()) | |
| 367 | - | ||
| 443 | + | cret := XGSeekableCanSeek(x.GoPointer()) | |
| 444 | + | return cret | |
| 368 | 445 | } | |
| 369 | 446 | ||
| 370 | 447 | // Tests if the length of the stream can be adjusted with | |
| 371 | 448 | // g_seekable_truncate(). | |
| 372 | 449 | func (x *DataInputStream) CanTruncate() bool { | |
| 373 | 450 | ||
| 374 | - | return XGSeekableCanTruncate(x.GoPointer()) | |
| 375 | - | ||
| 451 | + | cret := XGSeekableCanTruncate(x.GoPointer()) | |
| 452 | + | return cret | |
| 376 | 453 | } | |
| 377 | 454 | ||
| 378 | 455 | // Seeks in the stream by the given @offset, modified by @type. | |
| @@ -389,17 +466,22 @@ func (x *DataInputStream) CanTruncate() bool { | |||
| 389 | 466 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 390 | 467 | // triggering the cancellable object from another thread. If the operation | |
| 391 | 468 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 392 | - | func (x *DataInputStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) bool { | |
| 469 | + | func (x *DataInputStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) (bool, error) { | |
| 470 | + | var cerr *glib.Error | |
| 393 | 471 | ||
| 394 | - | return XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer()) | |
| 472 | + | cret := XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 473 | + | if cerr == nil { | |
| 474 | + | return cret, nil | |
| 475 | + | } | |
| 476 | + | return cret, cerr | |
| 395 | 477 | ||
| 396 | 478 | } | |
| 397 | 479 | ||
| 398 | 480 | // Tells the current position within the stream. | |
| 399 | 481 | func (x *DataInputStream) Tell() int64 { | |
| 400 | 482 | ||
| 401 | - | return XGSeekableTell(x.GoPointer()) | |
| 402 | - | ||
| 483 | + | cret := XGSeekableTell(x.GoPointer()) | |
| 484 | + | return cret | |
| 403 | 485 | } | |
| 404 | 486 | ||
| 405 | 487 | // Sets the length of the stream to @offset. If the stream was previously | |
| @@ -411,9 +493,14 @@ func (x *DataInputStream) Tell() int64 { | |||
| 411 | 493 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an | |
| 412 | 494 | // operation was partially finished when the operation was cancelled the | |
| 413 | 495 | // partial result will be returned, without an error. | |
| 414 | - | func (x *DataInputStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) bool { | |
| 496 | + | func (x *DataInputStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) (bool, error) { | |
| 497 | + | var cerr *glib.Error | |
| 415 | 498 | ||
| 416 | - | return XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer()) | |
| 499 | + | cret := XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer(), &cerr) | |
| 500 | + | if cerr == nil { | |
| 501 | + | return cret, nil | |
| 502 | + | } | |
| 503 | + | return cret, cerr | |
| 417 | 504 | ||
| 418 | 505 | } | |
| 419 | 506 | ||
M v4/gio/gdataoutputstream.go +95 -43
| @@ -30,14 +30,16 @@ var xNewDataOutputStream func(uintptr) uintptr | |||
| 30 | 30 | ||
| 31 | 31 | // Creates a new data output stream for @base_stream. | |
| 32 | 32 | func NewDataOutputStream(BaseStreamVar *OutputStream) *DataOutputStream { | |
| 33 | - | NewDataOutputStreamPtr := xNewDataOutputStream(BaseStreamVar.GoPointer()) | |
| 34 | - | if NewDataOutputStreamPtr == 0 { | |
| 35 | - | return nil | |
| 36 | - | } | |
| 33 | + | var cls *DataOutputStream | |
| 34 | + | ||
| 35 | + | cret := xNewDataOutputStream(BaseStreamVar.GoPointer()) | |
| 37 | 36 | ||
| 38 | - | NewDataOutputStreamCls := &DataOutputStream{} | |
| 39 | - | NewDataOutputStreamCls.Ptr = NewDataOutputStreamPtr | |
| 40 | - | return NewDataOutputStreamCls | |
| 37 | + | if cret == 0 { | |
| 38 | + | return cls | |
| 39 | + | } | |
| 40 | + | cls = &DataOutputStream{} | |
| 41 | + | cls.Ptr = cret | |
| 42 | + | return cls | |
| 41 | 43 | } | |
| 42 | 44 | ||
| 43 | 45 | var xDataOutputStreamGetByteOrder func(uintptr) DataStreamByteOrder | |
| @@ -45,79 +47,119 @@ var xDataOutputStreamGetByteOrder func(uintptr) DataStreamByteOrder | |||
| 45 | 47 | // Gets the byte order for the stream. | |
| 46 | 48 | func (x *DataOutputStream) GetByteOrder() DataStreamByteOrder { | |
| 47 | 49 | ||
| 48 | - | return xDataOutputStreamGetByteOrder(x.GoPointer()) | |
| 49 | - | ||
| 50 | + | cret := xDataOutputStreamGetByteOrder(x.GoPointer()) | |
| 51 | + | return cret | |
| 50 | 52 | } | |
| 51 | 53 | ||
| 52 | - | var xDataOutputStreamPutByte func(uintptr, byte, uintptr) bool | |
| 54 | + | var xDataOutputStreamPutByte func(uintptr, byte, uintptr, **glib.Error) bool | |
| 53 | 55 | ||
| 54 | 56 | // Puts a byte into the output stream. | |
| 55 | - | func (x *DataOutputStream) PutByte(DataVar byte, CancellableVar *Cancellable) bool { | |
| 57 | + | func (x *DataOutputStream) PutByte(DataVar byte, CancellableVar *Cancellable) (bool, error) { | |
| 58 | + | var cerr *glib.Error | |
| 56 | 59 | ||
| 57 | - | return xDataOutputStreamPutByte(x.GoPointer(), DataVar, CancellableVar.GoPointer()) | |
| 60 | + | cret := xDataOutputStreamPutByte(x.GoPointer(), DataVar, CancellableVar.GoPointer(), &cerr) | |
| 61 | + | if cerr == nil { | |
| 62 | + | return cret, nil | |
| 63 | + | } | |
| 64 | + | return cret, cerr | |
| 58 | 65 | ||
| 59 | 66 | } | |
| 60 | 67 | ||
| 61 | - | var xDataOutputStreamPutInt16 func(uintptr, int16, uintptr) bool | |
| 68 | + | var xDataOutputStreamPutInt16 func(uintptr, int16, uintptr, **glib.Error) bool | |
| 62 | 69 | ||
| 63 | 70 | // Puts a signed 16-bit integer into the output stream. | |
| 64 | - | func (x *DataOutputStream) PutInt16(DataVar int16, CancellableVar *Cancellable) bool { | |
| 71 | + | func (x *DataOutputStream) PutInt16(DataVar int16, CancellableVar *Cancellable) (bool, error) { | |
| 72 | + | var cerr *glib.Error | |
| 65 | 73 | ||
| 66 | - | return xDataOutputStreamPutInt16(x.GoPointer(), DataVar, CancellableVar.GoPointer()) | |
| 74 | + | cret := xDataOutputStreamPutInt16(x.GoPointer(), DataVar, CancellableVar.GoPointer(), &cerr) | |
| 75 | + | if cerr == nil { | |
| 76 | + | return cret, nil | |
| 77 | + | } | |
| 78 | + | return cret, cerr | |
| 67 | 79 | ||
| 68 | 80 | } | |
| 69 | 81 | ||
| 70 | - | var xDataOutputStreamPutInt32 func(uintptr, int32, uintptr) bool | |
| 82 | + | var xDataOutputStreamPutInt32 func(uintptr, int32, uintptr, **glib.Error) bool | |
| 71 | 83 | ||
| 72 | 84 | // Puts a signed 32-bit integer into the output stream. | |
| 73 | - | func (x *DataOutputStream) PutInt32(DataVar int32, CancellableVar *Cancellable) bool { | |
| 85 | + | func (x *DataOutputStream) PutInt32(DataVar int32, CancellableVar *Cancellable) (bool, error) { | |
| 86 | + | var cerr *glib.Error | |
| 74 | 87 | ||
| 75 | - | return xDataOutputStreamPutInt32(x.GoPointer(), DataVar, CancellableVar.GoPointer()) | |
| 88 | + | cret := xDataOutputStreamPutInt32(x.GoPointer(), DataVar, CancellableVar.GoPointer(), &cerr) | |
| 89 | + | if cerr == nil { | |
| 90 | + | return cret, nil | |
| 91 | + | } | |
| 92 | + | return cret, cerr | |
| 76 | 93 | ||
| 77 | 94 | } | |
| 78 | 95 | ||
| 79 | - | var xDataOutputStreamPutInt64 func(uintptr, int64, uintptr) bool | |
| 96 | + | var xDataOutputStreamPutInt64 func(uintptr, int64, uintptr, **glib.Error) bool | |
| 80 | 97 | ||
| 81 | 98 | // Puts a signed 64-bit integer into the stream. | |
| 82 | - | func (x *DataOutputStream) PutInt64(DataVar int64, CancellableVar *Cancellable) bool { | |
| 99 | + | func (x *DataOutputStream) PutInt64(DataVar int64, CancellableVar *Cancellable) (bool, error) { | |
| 100 | + | var cerr *glib.Error | |
| 83 | 101 | ||
| 84 | - | return xDataOutputStreamPutInt64(x.GoPointer(), DataVar, CancellableVar.GoPointer()) | |
| 102 | + | cret := xDataOutputStreamPutInt64(x.GoPointer(), DataVar, CancellableVar.GoPointer(), &cerr) | |
| 103 | + | if cerr == nil { | |
| 104 | + | return cret, nil | |
| 105 | + | } | |
| 106 | + | return cret, cerr | |
| 85 | 107 | ||
| 86 | 108 | } | |
| 87 | 109 | ||
| 88 | - | var xDataOutputStreamPutString func(uintptr, string, uintptr) bool | |
| 110 | + | var xDataOutputStreamPutString func(uintptr, string, uintptr, **glib.Error) bool | |
| 89 | 111 | ||
| 90 | 112 | // Puts a string into the output stream. | |
| 91 | - | func (x *DataOutputStream) PutString(StrVar string, CancellableVar *Cancellable) bool { | |
| 113 | + | func (x *DataOutputStream) PutString(StrVar string, CancellableVar *Cancellable) (bool, error) { | |
| 114 | + | var cerr *glib.Error | |
| 92 | 115 | ||
| 93 | - | return xDataOutputStreamPutString(x.GoPointer(), StrVar, CancellableVar.GoPointer()) | |
| 116 | + | cret := xDataOutputStreamPutString(x.GoPointer(), StrVar, CancellableVar.GoPointer(), &cerr) | |
| 117 | + | if cerr == nil { | |
| 118 | + | return cret, nil | |
| 119 | + | } | |
| 120 | + | return cret, cerr | |
| 94 | 121 | ||
| 95 | 122 | } | |
| 96 | 123 | ||
| 97 | - | var xDataOutputStreamPutUint16 func(uintptr, uint16, uintptr) bool | |
| 124 | + | var xDataOutputStreamPutUint16 func(uintptr, uint16, uintptr, **glib.Error) bool | |
| 98 | 125 | ||
| 99 | 126 | // Puts an unsigned 16-bit integer into the output stream. | |
| 100 | - | func (x *DataOutputStream) PutUint16(DataVar uint16, CancellableVar *Cancellable) bool { | |
| 127 | + | func (x *DataOutputStream) PutUint16(DataVar uint16, CancellableVar *Cancellable) (bool, error) { | |
| 128 | + | var cerr *glib.Error | |
| 101 | 129 | ||
| 102 | - | return xDataOutputStreamPutUint16(x.GoPointer(), DataVar, CancellableVar.GoPointer()) | |
| 130 | + | cret := xDataOutputStreamPutUint16(x.GoPointer(), DataVar, CancellableVar.GoPointer(), &cerr) | |
| 131 | + | if cerr == nil { | |
| 132 | + | return cret, nil | |
| 133 | + | } | |
| 134 | + | return cret, cerr | |
| 103 | 135 | ||
| 104 | 136 | } | |
| 105 | 137 | ||
| 106 | - | var xDataOutputStreamPutUint32 func(uintptr, uint32, uintptr) bool | |
| 138 | + | var xDataOutputStreamPutUint32 func(uintptr, uint32, uintptr, **glib.Error) bool | |
| 107 | 139 | ||
| 108 | 140 | // Puts an unsigned 32-bit integer into the stream. | |
| 109 | - | func (x *DataOutputStream) PutUint32(DataVar uint32, CancellableVar *Cancellable) bool { | |
| 141 | + | func (x *DataOutputStream) PutUint32(DataVar uint32, CancellableVar *Cancellable) (bool, error) { | |
| 142 | + | var cerr *glib.Error | |
| 110 | 143 | ||
| 111 | - | return xDataOutputStreamPutUint32(x.GoPointer(), DataVar, CancellableVar.GoPointer()) | |
| 144 | + | cret := xDataOutputStreamPutUint32(x.GoPointer(), DataVar, CancellableVar.GoPointer(), &cerr) | |
| 145 | + | if cerr == nil { | |
| 146 | + | return cret, nil | |
| 147 | + | } | |
| 148 | + | return cret, cerr | |
| 112 | 149 | ||
| 113 | 150 | } | |
| 114 | 151 | ||
| 115 | - | var xDataOutputStreamPutUint64 func(uintptr, uint64, uintptr) bool | |
| 152 | + | var xDataOutputStreamPutUint64 func(uintptr, uint64, uintptr, **glib.Error) bool | |
| 116 | 153 | ||
| 117 | 154 | // Puts an unsigned 64-bit integer into the stream. | |
| 118 | - | func (x *DataOutputStream) PutUint64(DataVar uint64, CancellableVar *Cancellable) bool { | |
| 155 | + | func (x *DataOutputStream) PutUint64(DataVar uint64, CancellableVar *Cancellable) (bool, error) { | |
| 156 | + | var cerr *glib.Error | |
| 119 | 157 | ||
| 120 | - | return xDataOutputStreamPutUint64(x.GoPointer(), DataVar, CancellableVar.GoPointer()) | |
| 158 | + | cret := xDataOutputStreamPutUint64(x.GoPointer(), DataVar, CancellableVar.GoPointer(), &cerr) | |
| 159 | + | if cerr == nil { | |
| 160 | + | return cret, nil | |
| 161 | + | } | |
| 162 | + | return cret, cerr | |
| 121 | 163 | ||
| 122 | 164 | } | |
| 123 | 165 | ||
| @@ -141,16 +183,16 @@ func (c *DataOutputStream) SetGoPointer(ptr uintptr) { | |||
| 141 | 183 | // Tests if the stream supports the #GSeekableIface. | |
| 142 | 184 | func (x *DataOutputStream) CanSeek() bool { | |
| 143 | 185 | ||
| 144 | - | return XGSeekableCanSeek(x.GoPointer()) | |
| 145 | - | ||
| 186 | + | cret := XGSeekableCanSeek(x.GoPointer()) | |
| 187 | + | return cret | |
| 146 | 188 | } | |
| 147 | 189 | ||
| 148 | 190 | // Tests if the length of the stream can be adjusted with | |
| 149 | 191 | // g_seekable_truncate(). | |
| 150 | 192 | func (x *DataOutputStream) CanTruncate() bool { | |
| 151 | 193 | ||
| 152 | - | return XGSeekableCanTruncate(x.GoPointer()) | |
| 153 | - | ||
| 194 | + | cret := XGSeekableCanTruncate(x.GoPointer()) | |
| 195 | + | return cret | |
| 154 | 196 | } | |
| 155 | 197 | ||
| 156 | 198 | // Seeks in the stream by the given @offset, modified by @type. | |
| @@ -167,17 +209,22 @@ func (x *DataOutputStream) CanTruncate() bool { | |||
| 167 | 209 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 168 | 210 | // triggering the cancellable object from another thread. If the operation | |
| 169 | 211 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 170 | - | func (x *DataOutputStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) bool { | |
| 212 | + | func (x *DataOutputStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) (bool, error) { | |
| 213 | + | var cerr *glib.Error | |
| 171 | 214 | ||
| 172 | - | return XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer()) | |
| 215 | + | cret := XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 216 | + | if cerr == nil { | |
| 217 | + | return cret, nil | |
| 218 | + | } | |
| 219 | + | return cret, cerr | |
| 173 | 220 | ||
| 174 | 221 | } | |
| 175 | 222 | ||
| 176 | 223 | // Tells the current position within the stream. | |
| 177 | 224 | func (x *DataOutputStream) Tell() int64 { | |
| 178 | 225 | ||
| 179 | - | return XGSeekableTell(x.GoPointer()) | |
| 180 | - | ||
| 226 | + | cret := XGSeekableTell(x.GoPointer()) | |
| 227 | + | return cret | |
| 181 | 228 | } | |
| 182 | 229 | ||
| 183 | 230 | // Sets the length of the stream to @offset. If the stream was previously | |
| @@ -189,9 +236,14 @@ func (x *DataOutputStream) Tell() int64 { | |||
| 189 | 236 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an | |
| 190 | 237 | // operation was partially finished when the operation was cancelled the | |
| 191 | 238 | // partial result will be returned, without an error. | |
| 192 | - | func (x *DataOutputStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) bool { | |
| 239 | + | func (x *DataOutputStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) (bool, error) { | |
| 240 | + | var cerr *glib.Error | |
| 193 | 241 | ||
| 194 | - | return XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer()) | |
| 242 | + | cret := XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer(), &cerr) | |
| 243 | + | if cerr == nil { | |
| 244 | + | return cret, nil | |
| 245 | + | } | |
| 246 | + | return cret, cerr | |
| 195 | 247 | ||
| 196 | 248 | } | |
| 197 | 249 | ||
M v4/gio/gdbusaddress.go +49 -28
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | ) | |
| 8 | 9 | ||
| 9 | 10 | var xDbusAddressEscapeValue func(string) string | |
| @@ -17,11 +18,11 @@ var xDbusAddressEscapeValue func(string) string | |||
| 17 | 18 | // `unix:nonce-tcp:host=127.0.0.1,port=42,noncefile=/run/bus-for-%3A0`. | |
| 18 | 19 | func DbusAddressEscapeValue(StringVar string) string { | |
| 19 | 20 | ||
| 20 | - | return xDbusAddressEscapeValue(StringVar) | |
| 21 | - | ||
| 21 | + | cret := xDbusAddressEscapeValue(StringVar) | |
| 22 | + | return cret | |
| 22 | 23 | } | |
| 23 | 24 | ||
| 24 | - | var xDbusAddressGetForBusSync func(BusType, uintptr) string | |
| 25 | + | var xDbusAddressGetForBusSync func(BusType, uintptr, **glib.Error) string | |
| 25 | 26 | ||
| 26 | 27 | // Synchronously looks up the D-Bus address for the well-known message | |
| 27 | 28 | // bus instance specified by @bus_type. This may involve using various | |
| @@ -29,9 +30,14 @@ var xDbusAddressGetForBusSync func(BusType, uintptr) string | |||
| 29 | 30 | // | |
| 30 | 31 | // The returned address will be in the | |
| 31 | 32 | // [D-Bus address format](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses). | |
| 32 | - | func DbusAddressGetForBusSync(BusTypeVar BusType, CancellableVar *Cancellable) string { | |
| 33 | + | func DbusAddressGetForBusSync(BusTypeVar BusType, CancellableVar *Cancellable) (string, error) { | |
| 34 | + | var cerr *glib.Error | |
| 33 | 35 | ||
| 34 | - | return xDbusAddressGetForBusSync(BusTypeVar, CancellableVar.GoPointer()) | |
| 36 | + | cret := xDbusAddressGetForBusSync(BusTypeVar, CancellableVar.GoPointer(), &cerr) | |
| 37 | + | if cerr == nil { | |
| 38 | + | return cret, nil | |
| 39 | + | } | |
| 40 | + | return cret, cerr | |
| 35 | 41 | ||
| 36 | 42 | } | |
| 37 | 43 | ||
| @@ -54,26 +60,31 @@ func DbusAddressGetStream(AddressVar string, CancellableVar *Cancellable, Callba | |||
| 54 | 60 | ||
| 55 | 61 | } | |
| 56 | 62 | ||
| 57 | - | var xDbusAddressGetStreamFinish func(uintptr, string) uintptr | |
| 63 | + | var xDbusAddressGetStreamFinish func(uintptr, string, **glib.Error) uintptr | |
| 58 | 64 | ||
| 59 | 65 | // Finishes an operation started with g_dbus_address_get_stream(). | |
| 60 | 66 | // | |
| 61 | 67 | // A server is not required to set a GUID, so @out_guid may be set to %NULL | |
| 62 | 68 | // even on success. | |
| 63 | - | func DbusAddressGetStreamFinish(ResVar AsyncResult, OutGuidVar string) *IOStream { | |
| 69 | + | func DbusAddressGetStreamFinish(ResVar AsyncResult, OutGuidVar string) (*IOStream, error) { | |
| 70 | + | var cls *IOStream | |
| 71 | + | var cerr *glib.Error | |
| 64 | 72 | ||
| 65 | - | DbusAddressGetStreamFinishPtr := xDbusAddressGetStreamFinish(ResVar.GoPointer(), OutGuidVar) | |
| 66 | - | if DbusAddressGetStreamFinishPtr == 0 { | |
| 67 | - | return nil | |
| 68 | - | } | |
| 73 | + | cret := xDbusAddressGetStreamFinish(ResVar.GoPointer(), OutGuidVar, &cerr) | |
| 69 | 74 | ||
| 70 | - | DbusAddressGetStreamFinishCls := &IOStream{} | |
| 71 | - | DbusAddressGetStreamFinishCls.Ptr = DbusAddressGetStreamFinishPtr | |
| 72 | - | return DbusAddressGetStreamFinishCls | |
| 75 | + | if cret == 0 { | |
| 76 | + | return cls, cerr | |
| 77 | + | } | |
| 78 | + | cls = &IOStream{} | |
| 79 | + | cls.Ptr = cret | |
| 80 | + | if cerr == nil { | |
| 81 | + | return cls, nil | |
| 82 | + | } | |
| 83 | + | return cls, cerr | |
| 73 | 84 | ||
| 74 | 85 | } | |
| 75 | 86 | ||
| 76 | - | var xDbusAddressGetStreamSync func(string, string, uintptr) uintptr | |
| 87 | + | var xDbusAddressGetStreamSync func(string, string, uintptr, **glib.Error) uintptr | |
| 77 | 88 | ||
| 78 | 89 | // Synchronously connects to an endpoint specified by @address and | |
| 79 | 90 | // sets up the connection so it is in a state to run the client-side | |
| @@ -85,16 +96,21 @@ var xDbusAddressGetStreamSync func(string, string, uintptr) uintptr | |||
| 85 | 96 | // | |
| 86 | 97 | // This is a synchronous failable function. See | |
| 87 | 98 | // g_dbus_address_get_stream() for the asynchronous version. | |
| 88 | - | func DbusAddressGetStreamSync(AddressVar string, OutGuidVar string, CancellableVar *Cancellable) *IOStream { | |
| 99 | + | func DbusAddressGetStreamSync(AddressVar string, OutGuidVar string, CancellableVar *Cancellable) (*IOStream, error) { | |
| 100 | + | var cls *IOStream | |
| 101 | + | var cerr *glib.Error | |
| 89 | 102 | ||
| 90 | - | DbusAddressGetStreamSyncPtr := xDbusAddressGetStreamSync(AddressVar, OutGuidVar, CancellableVar.GoPointer()) | |
| 91 | - | if DbusAddressGetStreamSyncPtr == 0 { | |
| 92 | - | return nil | |
| 93 | - | } | |
| 103 | + | cret := xDbusAddressGetStreamSync(AddressVar, OutGuidVar, CancellableVar.GoPointer(), &cerr) | |
| 94 | 104 | ||
| 95 | - | DbusAddressGetStreamSyncCls := &IOStream{} | |
| 96 | - | DbusAddressGetStreamSyncCls.Ptr = DbusAddressGetStreamSyncPtr | |
| 97 | - | return DbusAddressGetStreamSyncCls | |
| 105 | + | if cret == 0 { | |
| 106 | + | return cls, cerr | |
| 107 | + | } | |
| 108 | + | cls = &IOStream{} | |
| 109 | + | cls.Ptr = cret | |
| 110 | + | if cerr == nil { | |
| 111 | + | return cls, nil | |
| 112 | + | } | |
| 113 | + | return cls, cerr | |
| 98 | 114 | ||
| 99 | 115 | } | |
| 100 | 116 | ||
| @@ -108,19 +124,24 @@ var xDbusIsAddress func(string) bool | |||
| 108 | 124 | // checks. | |
| 109 | 125 | func DbusIsAddress(StringVar string) bool { | |
| 110 | 126 | ||
| 111 | - | return xDbusIsAddress(StringVar) | |
| 112 | - | ||
| 127 | + | cret := xDbusIsAddress(StringVar) | |
| 128 | + | return cret | |
| 113 | 129 | } | |
| 114 | 130 | ||
| 115 | - | var xDbusIsSupportedAddress func(string) bool | |
| 131 | + | var xDbusIsSupportedAddress func(string, **glib.Error) bool | |
| 116 | 132 | ||
| 117 | 133 | // Like g_dbus_is_address() but also checks if the library supports the | |
| 118 | 134 | // transports in @string and that key/value pairs for each transport | |
| 119 | 135 | // are valid. See the specification of the | |
| 120 | 136 | // [D-Bus address format](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses). | |
| 121 | - | func DbusIsSupportedAddress(StringVar string) bool { | |
| 137 | + | func DbusIsSupportedAddress(StringVar string) (bool, error) { | |
| 138 | + | var cerr *glib.Error | |
| 122 | 139 | ||
| 123 | - | return xDbusIsSupportedAddress(StringVar) | |
| 140 | + | cret := xDbusIsSupportedAddress(StringVar, &cerr) | |
| 141 | + | if cerr == nil { | |
| 142 | + | return cret, nil | |
| 143 | + | } | |
| 144 | + | return cret, cerr | |
| 124 | 145 | ||
| 125 | 146 | } | |
| 126 | 147 | ||
M v4/gio/gdbusconnection.go +28 -18
| @@ -205,7 +205,7 @@ func BusGet(BusTypeVar BusType, CancellableVar *Cancellable, CallbackVar AsyncRe | |||
| 205 | 205 | ||
| 206 | 206 | } | |
| 207 | 207 | ||
| 208 | - | var xBusGetFinish func(uintptr) uintptr | |
| 208 | + | var xBusGetFinish func(uintptr, **glib.Error) uintptr | |
| 209 | 209 | ||
| 210 | 210 | // Finishes an operation started with g_bus_get(). | |
| 211 | 211 | // | |
| @@ -219,20 +219,25 @@ var xBusGetFinish func(uintptr) uintptr | |||
| 219 | 219 | // | |
| 220 | 220 | // Note that the returned #GDBusConnection object will (usually) have | |
| 221 | 221 | // the #GDBusConnection:exit-on-close property set to %TRUE. | |
| 222 | - | func BusGetFinish(ResVar AsyncResult) *DBusConnection { | |
| 222 | + | func BusGetFinish(ResVar AsyncResult) (*DBusConnection, error) { | |
| 223 | + | var cls *DBusConnection | |
| 224 | + | var cerr *glib.Error | |
| 223 | 225 | ||
| 224 | - | BusGetFinishPtr := xBusGetFinish(ResVar.GoPointer()) | |
| 225 | - | if BusGetFinishPtr == 0 { | |
| 226 | - | return nil | |
| 227 | - | } | |
| 226 | + | cret := xBusGetFinish(ResVar.GoPointer(), &cerr) | |
| 228 | 227 | ||
| 229 | - | BusGetFinishCls := &DBusConnection{} | |
| 230 | - | BusGetFinishCls.Ptr = BusGetFinishPtr | |
| 231 | - | return BusGetFinishCls | |
| 228 | + | if cret == 0 { | |
| 229 | + | return cls, cerr | |
| 230 | + | } | |
| 231 | + | cls = &DBusConnection{} | |
| 232 | + | cls.Ptr = cret | |
| 233 | + | if cerr == nil { | |
| 234 | + | return cls, nil | |
| 235 | + | } | |
| 236 | + | return cls, cerr | |
| 232 | 237 | ||
| 233 | 238 | } | |
| 234 | 239 | ||
| 235 | - | var xBusGetSync func(BusType, uintptr) uintptr | |
| 240 | + | var xBusGetSync func(BusType, uintptr, **glib.Error) uintptr | |
| 236 | 241 | ||
| 237 | 242 | // Synchronously connects to the message bus specified by @bus_type. | |
| 238 | 243 | // Note that the returned object may shared with other callers, | |
| @@ -252,16 +257,21 @@ var xBusGetSync func(BusType, uintptr) uintptr | |||
| 252 | 257 | // | |
| 253 | 258 | // Note that the returned #GDBusConnection object will (usually) have | |
| 254 | 259 | // the #GDBusConnection:exit-on-close property set to %TRUE. | |
| 255 | - | func BusGetSync(BusTypeVar BusType, CancellableVar *Cancellable) *DBusConnection { | |
| 260 | + | func BusGetSync(BusTypeVar BusType, CancellableVar *Cancellable) (*DBusConnection, error) { | |
| 261 | + | var cls *DBusConnection | |
| 262 | + | var cerr *glib.Error | |
| 256 | 263 | ||
| 257 | - | BusGetSyncPtr := xBusGetSync(BusTypeVar, CancellableVar.GoPointer()) | |
| 258 | - | if BusGetSyncPtr == 0 { | |
| 259 | - | return nil | |
| 260 | - | } | |
| 264 | + | cret := xBusGetSync(BusTypeVar, CancellableVar.GoPointer(), &cerr) | |
| 261 | 265 | ||
| 262 | - | BusGetSyncCls := &DBusConnection{} | |
| 263 | - | BusGetSyncCls.Ptr = BusGetSyncPtr | |
| 264 | - | return BusGetSyncCls | |
| 266 | + | if cret == 0 { | |
| 267 | + | return cls, cerr | |
| 268 | + | } | |
| 269 | + | cls = &DBusConnection{} | |
| 270 | + | cls.Ptr = cret | |
| 271 | + | if cerr == nil { | |
| 272 | + | return cls, nil | |
| 273 | + | } | |
| 274 | + | return cls, cerr | |
| 265 | 275 | ||
| 266 | 276 | } | |
| 267 | 277 | ||
M v4/gio/gdbuserror.go +15 -15
| @@ -11,7 +11,7 @@ import ( | |||
| 11 | 11 | type DBusErrorEntry struct { | |
| 12 | 12 | ErrorCode int32 | |
| 13 | 13 | ||
| 14 | - | DbusErrorName string | |
| 14 | + | DbusErrorName uintptr | |
| 15 | 15 | } | |
| 16 | 16 | ||
| 17 | 17 | var xDbusErrorEncodeGerror func(*glib.Error) string | |
| @@ -29,8 +29,8 @@ var xDbusErrorEncodeGerror func(*glib.Error) string | |||
| 29 | 29 | // #GError on the wire. Regular applications should not use it. | |
| 30 | 30 | func DbusErrorEncodeGerror(ErrorVar *glib.Error) string { | |
| 31 | 31 | ||
| 32 | - | return xDbusErrorEncodeGerror(ErrorVar) | |
| 33 | - | ||
| 32 | + | cret := xDbusErrorEncodeGerror(ErrorVar) | |
| 33 | + | return cret | |
| 34 | 34 | } | |
| 35 | 35 | ||
| 36 | 36 | var xDbusErrorGetRemoteError func(*glib.Error) string | |
| @@ -43,8 +43,8 @@ var xDbusErrorGetRemoteError func(*glib.Error) string | |||
| 43 | 43 | // g_dbus_error_strip_remote_error() has been used on @error. | |
| 44 | 44 | func DbusErrorGetRemoteError(ErrorVar *glib.Error) string { | |
| 45 | 45 | ||
| 46 | - | return xDbusErrorGetRemoteError(ErrorVar) | |
| 47 | - | ||
| 46 | + | cret := xDbusErrorGetRemoteError(ErrorVar) | |
| 47 | + | return cret | |
| 48 | 48 | } | |
| 49 | 49 | ||
| 50 | 50 | var xDbusErrorIsRemoteError func(*glib.Error) bool | |
| @@ -53,8 +53,8 @@ var xDbusErrorIsRemoteError func(*glib.Error) bool | |||
| 53 | 53 | // use g_dbus_error_get_remote_error() to get the name of the error. | |
| 54 | 54 | func DbusErrorIsRemoteError(ErrorVar *glib.Error) bool { | |
| 55 | 55 | ||
| 56 | - | return xDbusErrorIsRemoteError(ErrorVar) | |
| 57 | - | ||
| 56 | + | cret := xDbusErrorIsRemoteError(ErrorVar) | |
| 57 | + | return cret | |
| 58 | 58 | } | |
| 59 | 59 | ||
| 60 | 60 | var xDbusErrorNewForDbusError func(string, string) *glib.Error | |
| @@ -87,8 +87,8 @@ var xDbusErrorNewForDbusError func(string, string) *glib.Error | |||
| 87 | 87 | // it. | |
| 88 | 88 | func DbusErrorNewForDbusError(DbusErrorNameVar string, DbusErrorMessageVar string) *glib.Error { | |
| 89 | 89 | ||
| 90 | - | return xDbusErrorNewForDbusError(DbusErrorNameVar, DbusErrorMessageVar) | |
| 91 | - | ||
| 90 | + | cret := xDbusErrorNewForDbusError(DbusErrorNameVar, DbusErrorMessageVar) | |
| 91 | + | return cret | |
| 92 | 92 | } | |
| 93 | 93 | ||
| 94 | 94 | var xDbusErrorRegisterError func(glib.Quark, int, string) bool | |
| @@ -100,8 +100,8 @@ var xDbusErrorRegisterError func(glib.Quark, int, string) bool | |||
| 100 | 100 | // an error domain. | |
| 101 | 101 | func DbusErrorRegisterError(ErrorDomainVar glib.Quark, ErrorCodeVar int, DbusErrorNameVar string) bool { | |
| 102 | 102 | ||
| 103 | - | return xDbusErrorRegisterError(ErrorDomainVar, ErrorCodeVar, DbusErrorNameVar) | |
| 104 | - | ||
| 103 | + | cret := xDbusErrorRegisterError(ErrorDomainVar, ErrorCodeVar, DbusErrorNameVar) | |
| 104 | + | return cret | |
| 105 | 105 | } | |
| 106 | 106 | ||
| 107 | 107 | var xDbusErrorRegisterErrorDomain func(string, uint, uintptr, uint) | |
| @@ -126,8 +126,8 @@ var xDbusErrorStripRemoteError func(*glib.Error) bool | |||
| 126 | 126 | // This is typically used when presenting errors to the end user. | |
| 127 | 127 | func DbusErrorStripRemoteError(ErrorVar *glib.Error) bool { | |
| 128 | 128 | ||
| 129 | - | return xDbusErrorStripRemoteError(ErrorVar) | |
| 130 | - | ||
| 129 | + | cret := xDbusErrorStripRemoteError(ErrorVar) | |
| 130 | + | return cret | |
| 131 | 131 | } | |
| 132 | 132 | ||
| 133 | 133 | var xDbusErrorUnregisterError func(glib.Quark, int, string) bool | |
| @@ -135,8 +135,8 @@ var xDbusErrorUnregisterError func(glib.Quark, int, string) bool | |||
| 135 | 135 | // Destroys an association previously set up with g_dbus_error_register_error(). | |
| 136 | 136 | func DbusErrorUnregisterError(ErrorDomainVar glib.Quark, ErrorCodeVar int, DbusErrorNameVar string) bool { | |
| 137 | 137 | ||
| 138 | - | return xDbusErrorUnregisterError(ErrorDomainVar, ErrorCodeVar, DbusErrorNameVar) | |
| 139 | - | ||
| 138 | + | cret := xDbusErrorUnregisterError(ErrorDomainVar, ErrorCodeVar, DbusErrorNameVar) | |
| 139 | + | return cret | |
| 140 | 140 | } | |
| 141 | 141 | ||
| 142 | 142 | func init() { | |
M v4/gio/gdbusinterface.go +19 -20
| @@ -37,24 +37,24 @@ func (x *DBusInterfaceBase) SetGoPointer(ptr uintptr) { | |||
| 37 | 37 | ||
| 38 | 38 | // Gets the #GDBusObject that @interface_ belongs to, if any. | |
| 39 | 39 | func (x *DBusInterfaceBase) DupObject() *DBusObjectBase { | |
| 40 | + | var cls *DBusObjectBase | |
| 40 | 41 | ||
| 41 | - | DupObjectPtr := XGDbusInterfaceDupObject(x.GoPointer()) | |
| 42 | - | if DupObjectPtr == 0 { | |
| 43 | - | return nil | |
| 44 | - | } | |
| 45 | - | ||
| 46 | - | DupObjectCls := &DBusObjectBase{} | |
| 47 | - | DupObjectCls.Ptr = DupObjectPtr | |
| 48 | - | return DupObjectCls | |
| 42 | + | cret := XGDbusInterfaceDupObject(x.GoPointer()) | |
| 49 | 43 | ||
| 44 | + | if cret == 0 { | |
| 45 | + | return cls | |
| 46 | + | } | |
| 47 | + | cls = &DBusObjectBase{} | |
| 48 | + | cls.Ptr = cret | |
| 49 | + | return cls | |
| 50 | 50 | } | |
| 51 | 51 | ||
| 52 | 52 | // Gets D-Bus introspection information for the D-Bus interface | |
| 53 | 53 | // implemented by @interface_. | |
| 54 | 54 | func (x *DBusInterfaceBase) GetInfo() *DBusInterfaceInfo { | |
| 55 | 55 | ||
| 56 | - | return XGDbusInterfaceGetInfo(x.GoPointer()) | |
| 57 | - | ||
| 56 | + | cret := XGDbusInterfaceGetInfo(x.GoPointer()) | |
| 57 | + | return cret | |
| 58 | 58 | } | |
| 59 | 59 | ||
| 60 | 60 | // Gets the #GDBusObject that @interface_ belongs to, if any. | |
| @@ -63,18 +63,17 @@ func (x *DBusInterfaceBase) GetInfo() *DBusInterfaceInfo { | |||
| 63 | 63 | // the returned object is being used from other threads. See | |
| 64 | 64 | // g_dbus_interface_dup_object() for a thread-safe alternative. | |
| 65 | 65 | func (x *DBusInterfaceBase) GetObject() *DBusObjectBase { | |
| 66 | + | var cls *DBusObjectBase | |
| 66 | 67 | ||
| 67 | - | GetObjectPtr := XGDbusInterfaceGetObject(x.GoPointer()) | |
| 68 | - | if GetObjectPtr == 0 { | |
| 69 | - | return nil | |
| 70 | - | } | |
| 71 | - | ||
| 72 | - | gobject.IncreaseRef(GetObjectPtr) | |
| 73 | - | ||
| 74 | - | GetObjectCls := &DBusObjectBase{} | |
| 75 | - | GetObjectCls.Ptr = GetObjectPtr | |
| 76 | - | return GetObjectCls | |
| 68 | + | cret := XGDbusInterfaceGetObject(x.GoPointer()) | |
| 77 | 69 | ||
| 70 | + | if cret == 0 { | |
| 71 | + | return cls | |
| 72 | + | } | |
| 73 | + | gobject.IncreaseRef(cret) | |
| 74 | + | cls = &DBusObjectBase{} | |
| 75 | + | cls.Ptr = cret | |
| 76 | + | return cls | |
| 78 | 77 | } | |
| 79 | 78 | ||
| 80 | 79 | // Sets the #GDBusObject for @interface_ to @object. | |
M v4/gio/gdbusinterfaceskeleton.go +48 -45
| @@ -31,7 +31,7 @@ func DBusInterfaceSkeletonNewFromInternalPtr(ptr uintptr) *DBusInterfaceSkeleton | |||
| 31 | 31 | return cls | |
| 32 | 32 | } | |
| 33 | 33 | ||
| 34 | - | var xDBusInterfaceSkeletonExport func(uintptr, uintptr, string) bool | |
| 34 | + | var xDBusInterfaceSkeletonExport func(uintptr, uintptr, string, **glib.Error) bool | |
| 35 | 35 | ||
| 36 | 36 | // Exports @interface_ at @object_path on @connection. | |
| 37 | 37 | // | |
| @@ -40,9 +40,14 @@ var xDBusInterfaceSkeletonExport func(uintptr, uintptr, string) bool | |||
| 40 | 40 | // the same for all connections. | |
| 41 | 41 | // | |
| 42 | 42 | // Use g_dbus_interface_skeleton_unexport() to unexport the object. | |
| 43 | - | func (x *DBusInterfaceSkeleton) Export(ConnectionVar *DBusConnection, ObjectPathVar string) bool { | |
| 43 | + | func (x *DBusInterfaceSkeleton) Export(ConnectionVar *DBusConnection, ObjectPathVar string) (bool, error) { | |
| 44 | + | var cerr *glib.Error | |
| 44 | 45 | ||
| 45 | - | return xDBusInterfaceSkeletonExport(x.GoPointer(), ConnectionVar.GoPointer(), ObjectPathVar) | |
| 46 | + | cret := xDBusInterfaceSkeletonExport(x.GoPointer(), ConnectionVar.GoPointer(), ObjectPathVar, &cerr) | |
| 47 | + | if cerr == nil { | |
| 48 | + | return cret, nil | |
| 49 | + | } | |
| 50 | + | return cret, cerr | |
| 46 | 51 | ||
| 47 | 52 | } | |
| 48 | 53 | ||
| @@ -66,18 +71,17 @@ var xDBusInterfaceSkeletonGetConnection func(uintptr) uintptr | |||
| 66 | 71 | ||
| 67 | 72 | // Gets the first connection that @interface_ is exported on, if any. | |
| 68 | 73 | func (x *DBusInterfaceSkeleton) GetConnection() *DBusConnection { | |
| 74 | + | var cls *DBusConnection | |
| 69 | 75 | ||
| 70 | - | GetConnectionPtr := xDBusInterfaceSkeletonGetConnection(x.GoPointer()) | |
| 71 | - | if GetConnectionPtr == 0 { | |
| 72 | - | return nil | |
| 73 | - | } | |
| 74 | - | ||
| 75 | - | gobject.IncreaseRef(GetConnectionPtr) | |
| 76 | - | ||
| 77 | - | GetConnectionCls := &DBusConnection{} | |
| 78 | - | GetConnectionCls.Ptr = GetConnectionPtr | |
| 79 | - | return GetConnectionCls | |
| 76 | + | cret := xDBusInterfaceSkeletonGetConnection(x.GoPointer()) | |
| 80 | 77 | ||
| 78 | + | if cret == 0 { | |
| 79 | + | return cls | |
| 80 | + | } | |
| 81 | + | gobject.IncreaseRef(cret) | |
| 82 | + | cls = &DBusConnection{} | |
| 83 | + | cls.Ptr = cret | |
| 84 | + | return cls | |
| 81 | 85 | } | |
| 82 | 86 | ||
| 83 | 87 | var xDBusInterfaceSkeletonGetConnections func(uintptr) *glib.List | |
| @@ -85,8 +89,8 @@ var xDBusInterfaceSkeletonGetConnections func(uintptr) *glib.List | |||
| 85 | 89 | // Gets a list of the connections that @interface_ is exported on. | |
| 86 | 90 | func (x *DBusInterfaceSkeleton) GetConnections() *glib.List { | |
| 87 | 91 | ||
| 88 | - | return xDBusInterfaceSkeletonGetConnections(x.GoPointer()) | |
| 89 | - | ||
| 92 | + | cret := xDBusInterfaceSkeletonGetConnections(x.GoPointer()) | |
| 93 | + | return cret | |
| 90 | 94 | } | |
| 91 | 95 | ||
| 92 | 96 | var xDBusInterfaceSkeletonGetFlags func(uintptr) DBusInterfaceSkeletonFlags | |
| @@ -95,8 +99,8 @@ var xDBusInterfaceSkeletonGetFlags func(uintptr) DBusInterfaceSkeletonFlags | |||
| 95 | 99 | // of @interface_ | |
| 96 | 100 | func (x *DBusInterfaceSkeleton) GetFlags() DBusInterfaceSkeletonFlags { | |
| 97 | 101 | ||
| 98 | - | return xDBusInterfaceSkeletonGetFlags(x.GoPointer()) | |
| 99 | - | ||
| 102 | + | cret := xDBusInterfaceSkeletonGetFlags(x.GoPointer()) | |
| 103 | + | return cret | |
| 100 | 104 | } | |
| 101 | 105 | ||
| 102 | 106 | var xDBusInterfaceSkeletonGetInfo func(uintptr) *DBusInterfaceInfo | |
| @@ -105,8 +109,8 @@ var xDBusInterfaceSkeletonGetInfo func(uintptr) *DBusInterfaceInfo | |||
| 105 | 109 | // implemented by @interface_. | |
| 106 | 110 | func (x *DBusInterfaceSkeleton) GetInfo() *DBusInterfaceInfo { | |
| 107 | 111 | ||
| 108 | - | return xDBusInterfaceSkeletonGetInfo(x.GoPointer()) | |
| 109 | - | ||
| 112 | + | cret := xDBusInterfaceSkeletonGetInfo(x.GoPointer()) | |
| 113 | + | return cret | |
| 110 | 114 | } | |
| 111 | 115 | ||
| 112 | 116 | var xDBusInterfaceSkeletonGetObjectPath func(uintptr) string | |
| @@ -114,8 +118,8 @@ var xDBusInterfaceSkeletonGetObjectPath func(uintptr) string | |||
| 114 | 118 | // Gets the object path that @interface_ is exported on, if any. | |
| 115 | 119 | func (x *DBusInterfaceSkeleton) GetObjectPath() string { | |
| 116 | 120 | ||
| 117 | - | return xDBusInterfaceSkeletonGetObjectPath(x.GoPointer()) | |
| 118 | - | ||
| 121 | + | cret := xDBusInterfaceSkeletonGetObjectPath(x.GoPointer()) | |
| 122 | + | return cret | |
| 119 | 123 | } | |
| 120 | 124 | ||
| 121 | 125 | var xDBusInterfaceSkeletonGetProperties func(uintptr) *glib.Variant | |
| @@ -123,8 +127,8 @@ var xDBusInterfaceSkeletonGetProperties func(uintptr) *glib.Variant | |||
| 123 | 127 | // Gets all D-Bus properties for @interface_. | |
| 124 | 128 | func (x *DBusInterfaceSkeleton) GetProperties() *glib.Variant { | |
| 125 | 129 | ||
| 126 | - | return xDBusInterfaceSkeletonGetProperties(x.GoPointer()) | |
| 127 | - | ||
| 130 | + | cret := xDBusInterfaceSkeletonGetProperties(x.GoPointer()) | |
| 131 | + | return cret | |
| 128 | 132 | } | |
| 129 | 133 | ||
| 130 | 134 | var xDBusInterfaceSkeletonGetVtable func(uintptr) *DBusInterfaceVTable | |
| @@ -134,8 +138,8 @@ var xDBusInterfaceSkeletonGetVtable func(uintptr) *DBusInterfaceVTable | |||
| 134 | 138 | // itself to be passed as @user_data. | |
| 135 | 139 | func (x *DBusInterfaceSkeleton) GetVtable() *DBusInterfaceVTable { | |
| 136 | 140 | ||
| 137 | - | return xDBusInterfaceSkeletonGetVtable(x.GoPointer()) | |
| 138 | - | ||
| 141 | + | cret := xDBusInterfaceSkeletonGetVtable(x.GoPointer()) | |
| 142 | + | return cret | |
| 139 | 143 | } | |
| 140 | 144 | ||
| 141 | 145 | var xDBusInterfaceSkeletonHasConnection func(uintptr, uintptr) bool | |
| @@ -143,8 +147,8 @@ var xDBusInterfaceSkeletonHasConnection func(uintptr, uintptr) bool | |||
| 143 | 147 | // Checks if @interface_ is exported on @connection. | |
| 144 | 148 | func (x *DBusInterfaceSkeleton) HasConnection(ConnectionVar *DBusConnection) bool { | |
| 145 | 149 | ||
| 146 | - | return xDBusInterfaceSkeletonHasConnection(x.GoPointer(), ConnectionVar.GoPointer()) | |
| 147 | - | ||
| 150 | + | cret := xDBusInterfaceSkeletonHasConnection(x.GoPointer(), ConnectionVar.GoPointer()) | |
| 151 | + | return cret | |
| 148 | 152 | } | |
| 149 | 153 | ||
| 150 | 154 | var xDBusInterfaceSkeletonSetFlags func(uintptr, DBusInterfaceSkeletonFlags) | |
| @@ -234,16 +238,16 @@ func (x *DBusInterfaceSkeleton) ConnectGAuthorizeMethod(cb func(DBusInterfaceSke | |||
| 234 | 238 | ||
| 235 | 239 | // Gets the #GDBusObject that @interface_ belongs to, if any. | |
| 236 | 240 | func (x *DBusInterfaceSkeleton) DupObject() *DBusObjectBase { | |
| 241 | + | var cls *DBusObjectBase | |
| 237 | 242 | ||
| 238 | - | DupObjectPtr := XGDbusInterfaceDupObject(x.GoPointer()) | |
| 239 | - | if DupObjectPtr == 0 { | |
| 240 | - | return nil | |
| 241 | - | } | |
| 242 | - | ||
| 243 | - | DupObjectCls := &DBusObjectBase{} | |
| 244 | - | DupObjectCls.Ptr = DupObjectPtr | |
| 245 | - | return DupObjectCls | |
| 243 | + | cret := XGDbusInterfaceDupObject(x.GoPointer()) | |
| 246 | 244 | ||
| 245 | + | if cret == 0 { | |
| 246 | + | return cls | |
| 247 | + | } | |
| 248 | + | cls = &DBusObjectBase{} | |
| 249 | + | cls.Ptr = cret | |
| 250 | + | return cls | |
| 247 | 251 | } | |
| 248 | 252 | ||
| 249 | 253 | // Gets the #GDBusObject that @interface_ belongs to, if any. | |
| @@ -252,18 +256,17 @@ func (x *DBusInterfaceSkeleton) DupObject() *DBusObjectBase { | |||
| 252 | 256 | // the returned object is being used from other threads. See | |
| 253 | 257 | // g_dbus_interface_dup_object() for a thread-safe alternative. | |
| 254 | 258 | func (x *DBusInterfaceSkeleton) GetObject() *DBusObjectBase { | |
| 259 | + | var cls *DBusObjectBase | |
| 255 | 260 | ||
| 256 | - | GetObjectPtr := XGDbusInterfaceGetObject(x.GoPointer()) | |
| 257 | - | if GetObjectPtr == 0 { | |
| 258 | - | return nil | |
| 259 | - | } | |
| 260 | - | ||
| 261 | - | gobject.IncreaseRef(GetObjectPtr) | |
| 262 | - | ||
| 263 | - | GetObjectCls := &DBusObjectBase{} | |
| 264 | - | GetObjectCls.Ptr = GetObjectPtr | |
| 265 | - | return GetObjectCls | |
| 261 | + | cret := XGDbusInterfaceGetObject(x.GoPointer()) | |
| 266 | 262 | ||
| 263 | + | if cret == 0 { | |
| 264 | + | return cls | |
| 265 | + | } | |
| 266 | + | gobject.IncreaseRef(cret) | |
| 267 | + | cls = &DBusObjectBase{} | |
| 268 | + | cls.Ptr = cret | |
| 269 | + | return cls | |
| 267 | 270 | } | |
| 268 | 271 | ||
| 269 | 272 | // Sets the #GDBusObject for @interface_ to @object. | |
M v4/gio/gdbusintrospection.go +12 -12
| @@ -10,9 +10,9 @@ import ( | |||
| 10 | 10 | type DBusAnnotationInfo struct { | |
| 11 | 11 | RefCount int32 | |
| 12 | 12 | ||
| 13 | - | Key string | |
| 13 | + | Key uintptr | |
| 14 | 14 | ||
| 15 | - | Value string | |
| 15 | + | Value uintptr | |
| 16 | 16 | ||
| 17 | 17 | Annotations uintptr | |
| 18 | 18 | } | |
| @@ -21,9 +21,9 @@ type DBusAnnotationInfo struct { | |||
| 21 | 21 | type DBusArgInfo struct { | |
| 22 | 22 | RefCount int32 | |
| 23 | 23 | ||
| 24 | - | Name string | |
| 24 | + | Name uintptr | |
| 25 | 25 | ||
| 26 | - | Signature string | |
| 26 | + | Signature uintptr | |
| 27 | 27 | ||
| 28 | 28 | Annotations uintptr | |
| 29 | 29 | } | |
| @@ -32,7 +32,7 @@ type DBusArgInfo struct { | |||
| 32 | 32 | type DBusInterfaceInfo struct { | |
| 33 | 33 | RefCount int32 | |
| 34 | 34 | ||
| 35 | - | Name string | |
| 35 | + | Name uintptr | |
| 36 | 36 | ||
| 37 | 37 | Methods uintptr | |
| 38 | 38 | ||
| @@ -47,7 +47,7 @@ type DBusInterfaceInfo struct { | |||
| 47 | 47 | type DBusMethodInfo struct { | |
| 48 | 48 | RefCount int32 | |
| 49 | 49 | ||
| 50 | - | Name string | |
| 50 | + | Name uintptr | |
| 51 | 51 | ||
| 52 | 52 | InArgs uintptr | |
| 53 | 53 | ||
| @@ -60,7 +60,7 @@ type DBusMethodInfo struct { | |||
| 60 | 60 | type DBusNodeInfo struct { | |
| 61 | 61 | RefCount int32 | |
| 62 | 62 | ||
| 63 | - | Path string | |
| 63 | + | Path uintptr | |
| 64 | 64 | ||
| 65 | 65 | Interfaces uintptr | |
| 66 | 66 | ||
| @@ -73,9 +73,9 @@ type DBusNodeInfo struct { | |||
| 73 | 73 | type DBusPropertyInfo struct { | |
| 74 | 74 | RefCount int32 | |
| 75 | 75 | ||
| 76 | - | Name string | |
| 76 | + | Name uintptr | |
| 77 | 77 | ||
| 78 | - | Signature string | |
| 78 | + | Signature uintptr | |
| 79 | 79 | ||
| 80 | 80 | Flags DBusPropertyInfoFlags | |
| 81 | 81 | ||
| @@ -86,7 +86,7 @@ type DBusPropertyInfo struct { | |||
| 86 | 86 | type DBusSignalInfo struct { | |
| 87 | 87 | RefCount int32 | |
| 88 | 88 | ||
| 89 | - | Name string | |
| 89 | + | Name uintptr | |
| 90 | 90 | ||
| 91 | 91 | Args uintptr | |
| 92 | 92 | ||
| @@ -100,8 +100,8 @@ var xDbusAnnotationInfoLookup func(uintptr, string) string | |||
| 100 | 100 | // The cost of this function is O(n) in number of annotations. | |
| 101 | 101 | func DbusAnnotationInfoLookup(AnnotationsVar uintptr, NameVar string) string { | |
| 102 | 102 | ||
| 103 | - | return xDbusAnnotationInfoLookup(AnnotationsVar, NameVar) | |
| 104 | - | ||
| 103 | + | cret := xDbusAnnotationInfoLookup(AnnotationsVar, NameVar) | |
| 104 | + | return cret | |
| 105 | 105 | } | |
| 106 | 106 | ||
| 107 | 107 | func init() { | |
M v4/gio/gdbusnameowning.go +8 -8
| @@ -70,8 +70,8 @@ var xBusOwnName func(BusType, string, BusNameOwnerFlags, uintptr, uintptr, uintp | |||
| 70 | 70 | // unregister the objects (if any) in @name_lost_handler. | |
| 71 | 71 | func BusOwnName(BusTypeVar BusType, NameVar string, FlagsVar BusNameOwnerFlags, BusAcquiredHandlerVar BusAcquiredCallback, NameAcquiredHandlerVar BusNameAcquiredCallback, NameLostHandlerVar BusNameLostCallback, UserDataVar uintptr, UserDataFreeFuncVar glib.DestroyNotify) uint { | |
| 72 | 72 | ||
| 73 | - | return xBusOwnName(BusTypeVar, NameVar, FlagsVar, purego.NewCallback(BusAcquiredHandlerVar), purego.NewCallback(NameAcquiredHandlerVar), purego.NewCallback(NameLostHandlerVar), UserDataVar, purego.NewCallback(UserDataFreeFuncVar)) | |
| 74 | - | ||
| 73 | + | cret := xBusOwnName(BusTypeVar, NameVar, FlagsVar, purego.NewCallback(BusAcquiredHandlerVar), purego.NewCallback(NameAcquiredHandlerVar), purego.NewCallback(NameLostHandlerVar), UserDataVar, purego.NewCallback(UserDataFreeFuncVar)) | |
| 74 | + | return cret | |
| 75 | 75 | } | |
| 76 | 76 | ||
| 77 | 77 | var xBusOwnNameOnConnection func(uintptr, string, BusNameOwnerFlags, uintptr, uintptr, uintptr, uintptr) uint | |
| @@ -80,8 +80,8 @@ var xBusOwnNameOnConnection func(uintptr, string, BusNameOwnerFlags, uintptr, ui | |||
| 80 | 80 | // #GBusType. | |
| 81 | 81 | func BusOwnNameOnConnection(ConnectionVar *DBusConnection, NameVar string, FlagsVar BusNameOwnerFlags, NameAcquiredHandlerVar BusNameAcquiredCallback, NameLostHandlerVar BusNameLostCallback, UserDataVar uintptr, UserDataFreeFuncVar glib.DestroyNotify) uint { | |
| 82 | 82 | ||
| 83 | - | return xBusOwnNameOnConnection(ConnectionVar.GoPointer(), NameVar, FlagsVar, purego.NewCallback(NameAcquiredHandlerVar), purego.NewCallback(NameLostHandlerVar), UserDataVar, purego.NewCallback(UserDataFreeFuncVar)) | |
| 84 | - | ||
| 83 | + | cret := xBusOwnNameOnConnection(ConnectionVar.GoPointer(), NameVar, FlagsVar, purego.NewCallback(NameAcquiredHandlerVar), purego.NewCallback(NameLostHandlerVar), UserDataVar, purego.NewCallback(UserDataFreeFuncVar)) | |
| 84 | + | return cret | |
| 85 | 85 | } | |
| 86 | 86 | ||
| 87 | 87 | var xBusOwnNameOnConnectionWithClosures func(uintptr, string, BusNameOwnerFlags, *gobject.Closure, *gobject.Closure) uint | |
| @@ -90,8 +90,8 @@ var xBusOwnNameOnConnectionWithClosures func(uintptr, string, BusNameOwnerFlags, | |||
| 90 | 90 | // callbacks for easier binding in other languages. | |
| 91 | 91 | func BusOwnNameOnConnectionWithClosures(ConnectionVar *DBusConnection, NameVar string, FlagsVar BusNameOwnerFlags, NameAcquiredClosureVar *gobject.Closure, NameLostClosureVar *gobject.Closure) uint { | |
| 92 | 92 | ||
| 93 | - | return xBusOwnNameOnConnectionWithClosures(ConnectionVar.GoPointer(), NameVar, FlagsVar, NameAcquiredClosureVar, NameLostClosureVar) | |
| 94 | - | ||
| 93 | + | cret := xBusOwnNameOnConnectionWithClosures(ConnectionVar.GoPointer(), NameVar, FlagsVar, NameAcquiredClosureVar, NameLostClosureVar) | |
| 94 | + | return cret | |
| 95 | 95 | } | |
| 96 | 96 | ||
| 97 | 97 | var xBusOwnNameWithClosures func(BusType, string, BusNameOwnerFlags, *gobject.Closure, *gobject.Closure, *gobject.Closure) uint | |
| @@ -100,8 +100,8 @@ var xBusOwnNameWithClosures func(BusType, string, BusNameOwnerFlags, *gobject.Cl | |||
| 100 | 100 | // easier binding in other languages. | |
| 101 | 101 | func BusOwnNameWithClosures(BusTypeVar BusType, NameVar string, FlagsVar BusNameOwnerFlags, BusAcquiredClosureVar *gobject.Closure, NameAcquiredClosureVar *gobject.Closure, NameLostClosureVar *gobject.Closure) uint { | |
| 102 | 102 | ||
| 103 | - | return xBusOwnNameWithClosures(BusTypeVar, NameVar, FlagsVar, BusAcquiredClosureVar, NameAcquiredClosureVar, NameLostClosureVar) | |
| 104 | - | ||
| 103 | + | cret := xBusOwnNameWithClosures(BusTypeVar, NameVar, FlagsVar, BusAcquiredClosureVar, NameAcquiredClosureVar, NameLostClosureVar) | |
| 104 | + | return cret | |
| 105 | 105 | } | |
| 106 | 106 | ||
| 107 | 107 | var xBusUnownName func(uint) | |
M v4/gio/gdbusnamewatching.go +8 -8
| @@ -67,8 +67,8 @@ var xBusWatchName func(BusType, string, BusNameWatcherFlags, uintptr, uintptr, u | |||
| 67 | 67 | // @name_vanished_handler. | |
| 68 | 68 | func BusWatchName(BusTypeVar BusType, NameVar string, FlagsVar BusNameWatcherFlags, NameAppearedHandlerVar BusNameAppearedCallback, NameVanishedHandlerVar BusNameVanishedCallback, UserDataVar uintptr, UserDataFreeFuncVar glib.DestroyNotify) uint { | |
| 69 | 69 | ||
| 70 | - | return xBusWatchName(BusTypeVar, NameVar, FlagsVar, purego.NewCallback(NameAppearedHandlerVar), purego.NewCallback(NameVanishedHandlerVar), UserDataVar, purego.NewCallback(UserDataFreeFuncVar)) | |
| 71 | - | ||
| 70 | + | cret := xBusWatchName(BusTypeVar, NameVar, FlagsVar, purego.NewCallback(NameAppearedHandlerVar), purego.NewCallback(NameVanishedHandlerVar), UserDataVar, purego.NewCallback(UserDataFreeFuncVar)) | |
| 71 | + | return cret | |
| 72 | 72 | } | |
| 73 | 73 | ||
| 74 | 74 | var xBusWatchNameOnConnection func(uintptr, string, BusNameWatcherFlags, uintptr, uintptr, uintptr, uintptr) uint | |
| @@ -77,8 +77,8 @@ var xBusWatchNameOnConnection func(uintptr, string, BusNameWatcherFlags, uintptr | |||
| 77 | 77 | // #GBusType. | |
| 78 | 78 | func BusWatchNameOnConnection(ConnectionVar *DBusConnection, NameVar string, FlagsVar BusNameWatcherFlags, NameAppearedHandlerVar BusNameAppearedCallback, NameVanishedHandlerVar BusNameVanishedCallback, UserDataVar uintptr, UserDataFreeFuncVar glib.DestroyNotify) uint { | |
| 79 | 79 | ||
| 80 | - | return xBusWatchNameOnConnection(ConnectionVar.GoPointer(), NameVar, FlagsVar, purego.NewCallback(NameAppearedHandlerVar), purego.NewCallback(NameVanishedHandlerVar), UserDataVar, purego.NewCallback(UserDataFreeFuncVar)) | |
| 81 | - | ||
| 80 | + | cret := xBusWatchNameOnConnection(ConnectionVar.GoPointer(), NameVar, FlagsVar, purego.NewCallback(NameAppearedHandlerVar), purego.NewCallback(NameVanishedHandlerVar), UserDataVar, purego.NewCallback(UserDataFreeFuncVar)) | |
| 81 | + | return cret | |
| 82 | 82 | } | |
| 83 | 83 | ||
| 84 | 84 | var xBusWatchNameOnConnectionWithClosures func(uintptr, string, BusNameWatcherFlags, *gobject.Closure, *gobject.Closure) uint | |
| @@ -87,8 +87,8 @@ var xBusWatchNameOnConnectionWithClosures func(uintptr, string, BusNameWatcherFl | |||
| 87 | 87 | // easier binding in other languages. | |
| 88 | 88 | func BusWatchNameOnConnectionWithClosures(ConnectionVar *DBusConnection, NameVar string, FlagsVar BusNameWatcherFlags, NameAppearedClosureVar *gobject.Closure, NameVanishedClosureVar *gobject.Closure) uint { | |
| 89 | 89 | ||
| 90 | - | return xBusWatchNameOnConnectionWithClosures(ConnectionVar.GoPointer(), NameVar, FlagsVar, NameAppearedClosureVar, NameVanishedClosureVar) | |
| 91 | - | ||
| 90 | + | cret := xBusWatchNameOnConnectionWithClosures(ConnectionVar.GoPointer(), NameVar, FlagsVar, NameAppearedClosureVar, NameVanishedClosureVar) | |
| 91 | + | return cret | |
| 92 | 92 | } | |
| 93 | 93 | ||
| 94 | 94 | var xBusWatchNameWithClosures func(BusType, string, BusNameWatcherFlags, *gobject.Closure, *gobject.Closure) uint | |
| @@ -97,8 +97,8 @@ var xBusWatchNameWithClosures func(BusType, string, BusNameWatcherFlags, *gobjec | |||
| 97 | 97 | // easier binding in other languages. | |
| 98 | 98 | func BusWatchNameWithClosures(BusTypeVar BusType, NameVar string, FlagsVar BusNameWatcherFlags, NameAppearedClosureVar *gobject.Closure, NameVanishedClosureVar *gobject.Closure) uint { | |
| 99 | 99 | ||
| 100 | - | return xBusWatchNameWithClosures(BusTypeVar, NameVar, FlagsVar, NameAppearedClosureVar, NameVanishedClosureVar) | |
| 101 | - | ||
| 100 | + | cret := xBusWatchNameWithClosures(BusTypeVar, NameVar, FlagsVar, NameAppearedClosureVar, NameVanishedClosureVar) | |
| 101 | + | return cret | |
| 102 | 102 | } | |
| 103 | 103 | ||
| 104 | 104 | func init() { | |
M v4/gio/gdbusobject.go +12 -12
| @@ -38,30 +38,30 @@ func (x *DBusObjectBase) SetGoPointer(ptr uintptr) { | |||
| 38 | 38 | // Gets the D-Bus interface with name @interface_name associated with | |
| 39 | 39 | // @object, if any. | |
| 40 | 40 | func (x *DBusObjectBase) GetInterface(InterfaceNameVar string) *DBusInterfaceBase { | |
| 41 | + | var cls *DBusInterfaceBase | |
| 41 | 42 | ||
| 42 | - | GetInterfacePtr := XGDbusObjectGetInterface(x.GoPointer(), InterfaceNameVar) | |
| 43 | - | if GetInterfacePtr == 0 { | |
| 44 | - | return nil | |
| 45 | - | } | |
| 46 | - | ||
| 47 | - | GetInterfaceCls := &DBusInterfaceBase{} | |
| 48 | - | GetInterfaceCls.Ptr = GetInterfacePtr | |
| 49 | - | return GetInterfaceCls | |
| 43 | + | cret := XGDbusObjectGetInterface(x.GoPointer(), InterfaceNameVar) | |
| 50 | 44 | ||
| 45 | + | if cret == 0 { | |
| 46 | + | return cls | |
| 47 | + | } | |
| 48 | + | cls = &DBusInterfaceBase{} | |
| 49 | + | cls.Ptr = cret | |
| 50 | + | return cls | |
| 51 | 51 | } | |
| 52 | 52 | ||
| 53 | 53 | // Gets the D-Bus interfaces associated with @object. | |
| 54 | 54 | func (x *DBusObjectBase) GetInterfaces() *glib.List { | |
| 55 | 55 | ||
| 56 | - | return XGDbusObjectGetInterfaces(x.GoPointer()) | |
| 57 | - | ||
| 56 | + | cret := XGDbusObjectGetInterfaces(x.GoPointer()) | |
| 57 | + | return cret | |
| 58 | 58 | } | |
| 59 | 59 | ||
| 60 | 60 | // Gets the object path for @object. | |
| 61 | 61 | func (x *DBusObjectBase) GetObjectPath() string { | |
| 62 | 62 | ||
| 63 | - | return XGDbusObjectGetObjectPath(x.GoPointer()) | |
| 64 | - | ||
| 63 | + | cret := XGDbusObjectGetObjectPath(x.GoPointer()) | |
| 64 | + | return cret | |
| 65 | 65 | } | |
| 66 | 66 | ||
| 67 | 67 | var XGDbusObjectGetInterface func(uintptr, string) uintptr | |
M v4/gio/gdbusobjectmanager.go +20 -20
| @@ -42,44 +42,44 @@ func (x *DBusObjectManagerBase) SetGoPointer(ptr uintptr) { | |||
| 42 | 42 | // Gets the interface proxy for @interface_name at @object_path, if | |
| 43 | 43 | // any. | |
| 44 | 44 | func (x *DBusObjectManagerBase) GetInterface(ObjectPathVar string, InterfaceNameVar string) *DBusInterfaceBase { | |
| 45 | + | var cls *DBusInterfaceBase | |
| 45 | 46 | ||
| 46 | - | GetInterfacePtr := XGDbusObjectManagerGetInterface(x.GoPointer(), ObjectPathVar, InterfaceNameVar) | |
| 47 | - | if GetInterfacePtr == 0 { | |
| 48 | - | return nil | |
| 49 | - | } | |
| 50 | - | ||
| 51 | - | GetInterfaceCls := &DBusInterfaceBase{} | |
| 52 | - | GetInterfaceCls.Ptr = GetInterfacePtr | |
| 53 | - | return GetInterfaceCls | |
| 47 | + | cret := XGDbusObjectManagerGetInterface(x.GoPointer(), ObjectPathVar, InterfaceNameVar) | |
| 54 | 48 | ||
| 49 | + | if cret == 0 { | |
| 50 | + | return cls | |
| 51 | + | } | |
| 52 | + | cls = &DBusInterfaceBase{} | |
| 53 | + | cls.Ptr = cret | |
| 54 | + | return cls | |
| 55 | 55 | } | |
| 56 | 56 | ||
| 57 | 57 | // Gets the #GDBusObject at @object_path, if any. | |
| 58 | 58 | func (x *DBusObjectManagerBase) GetObject(ObjectPathVar string) *DBusObjectBase { | |
| 59 | + | var cls *DBusObjectBase | |
| 59 | 60 | ||
| 60 | - | GetObjectPtr := XGDbusObjectManagerGetObject(x.GoPointer(), ObjectPathVar) | |
| 61 | - | if GetObjectPtr == 0 { | |
| 62 | - | return nil | |
| 63 | - | } | |
| 64 | - | ||
| 65 | - | GetObjectCls := &DBusObjectBase{} | |
| 66 | - | GetObjectCls.Ptr = GetObjectPtr | |
| 67 | - | return GetObjectCls | |
| 61 | + | cret := XGDbusObjectManagerGetObject(x.GoPointer(), ObjectPathVar) | |
| 68 | 62 | ||
| 63 | + | if cret == 0 { | |
| 64 | + | return cls | |
| 65 | + | } | |
| 66 | + | cls = &DBusObjectBase{} | |
| 67 | + | cls.Ptr = cret | |
| 68 | + | return cls | |
| 69 | 69 | } | |
| 70 | 70 | ||
| 71 | 71 | // Gets the object path that @manager is for. | |
| 72 | 72 | func (x *DBusObjectManagerBase) GetObjectPath() string { | |
| 73 | 73 | ||
| 74 | - | return XGDbusObjectManagerGetObjectPath(x.GoPointer()) | |
| 75 | - | ||
| 74 | + | cret := XGDbusObjectManagerGetObjectPath(x.GoPointer()) | |
| 75 | + | return cret | |
| 76 | 76 | } | |
| 77 | 77 | ||
| 78 | 78 | // Gets all #GDBusObject objects known to @manager. | |
| 79 | 79 | func (x *DBusObjectManagerBase) GetObjects() *glib.List { | |
| 80 | 80 | ||
| 81 | - | return XGDbusObjectManagerGetObjects(x.GoPointer()) | |
| 82 | - | ||
| 81 | + | cret := XGDbusObjectManagerGetObjects(x.GoPointer()) | |
| 82 | + | return cret | |
| 83 | 83 | } | |
| 84 | 84 | ||
| 85 | 85 | var XGDbusObjectManagerGetInterface func(uintptr, string, string) uintptr | |
M v4/gio/gdbusobjectmanagerclient.go +122 -80
| @@ -103,35 +103,49 @@ func DBusObjectManagerClientNewFromInternalPtr(ptr uintptr) *DBusObjectManagerCl | |||
| 103 | 103 | return cls | |
| 104 | 104 | } | |
| 105 | 105 | ||
| 106 | - | var xNewFinishDBusObjectManagerClient func(uintptr) uintptr | |
| 106 | + | var xNewFinishDBusObjectManagerClient func(uintptr, **glib.Error) uintptr | |
| 107 | 107 | ||
| 108 | 108 | // Finishes an operation started with g_dbus_object_manager_client_new(). | |
| 109 | - | func NewFinishDBusObjectManagerClient(ResVar AsyncResult) *DBusObjectManagerClient { | |
| 110 | - | NewFinishDBusObjectManagerClientPtr := xNewFinishDBusObjectManagerClient(ResVar.GoPointer()) | |
| 111 | - | if NewFinishDBusObjectManagerClientPtr == 0 { | |
| 112 | - | return nil | |
| 109 | + | func NewFinishDBusObjectManagerClient(ResVar AsyncResult) (*DBusObjectManagerClient, error) { | |
| 110 | + | var cls *DBusObjectManagerClient | |
| 111 | + | var cerr *glib.Error | |
| 112 | + | ||
| 113 | + | cret := xNewFinishDBusObjectManagerClient(ResVar.GoPointer(), &cerr) | |
| 114 | + | ||
| 115 | + | if cret == 0 { | |
| 116 | + | return cls, cerr | |
| 117 | + | } | |
| 118 | + | cls = &DBusObjectManagerClient{} | |
| 119 | + | cls.Ptr = cret | |
| 120 | + | if cerr == nil { | |
| 121 | + | return cls, nil | |
| 113 | 122 | } | |
| 123 | + | return cls, cerr | |
| 114 | 124 | ||
| 115 | - | NewFinishDBusObjectManagerClientCls := &DBusObjectManagerClient{} | |
| 116 | - | NewFinishDBusObjectManagerClientCls.Ptr = NewFinishDBusObjectManagerClientPtr | |
| 117 | - | return NewFinishDBusObjectManagerClientCls | |
| 118 | 125 | } | |
| 119 | 126 | ||
| 120 | - | var xNewForBusFinishDBusObjectManagerClient func(uintptr) uintptr | |
| 127 | + | var xNewForBusFinishDBusObjectManagerClient func(uintptr, **glib.Error) uintptr | |
| 121 | 128 | ||
| 122 | 129 | // Finishes an operation started with g_dbus_object_manager_client_new_for_bus(). | |
| 123 | - | func NewForBusFinishDBusObjectManagerClient(ResVar AsyncResult) *DBusObjectManagerClient { | |
| 124 | - | NewForBusFinishDBusObjectManagerClientPtr := xNewForBusFinishDBusObjectManagerClient(ResVar.GoPointer()) | |
| 125 | - | if NewForBusFinishDBusObjectManagerClientPtr == 0 { | |
| 126 | - | return nil | |
| 130 | + | func NewForBusFinishDBusObjectManagerClient(ResVar AsyncResult) (*DBusObjectManagerClient, error) { | |
| 131 | + | var cls *DBusObjectManagerClient | |
| 132 | + | var cerr *glib.Error | |
| 133 | + | ||
| 134 | + | cret := xNewForBusFinishDBusObjectManagerClient(ResVar.GoPointer(), &cerr) | |
| 135 | + | ||
| 136 | + | if cret == 0 { | |
| 137 | + | return cls, cerr | |
| 127 | 138 | } | |
| 139 | + | cls = &DBusObjectManagerClient{} | |
| 140 | + | cls.Ptr = cret | |
| 141 | + | if cerr == nil { | |
| 142 | + | return cls, nil | |
| 143 | + | } | |
| 144 | + | return cls, cerr | |
| 128 | 145 | ||
| 129 | - | NewForBusFinishDBusObjectManagerClientCls := &DBusObjectManagerClient{} | |
| 130 | - | NewForBusFinishDBusObjectManagerClientCls.Ptr = NewForBusFinishDBusObjectManagerClientPtr | |
| 131 | - | return NewForBusFinishDBusObjectManagerClientCls | |
| 132 | 146 | } | |
| 133 | 147 | ||
| 134 | - | var xNewForBusSyncDBusObjectManagerClient func(BusType, DBusObjectManagerClientFlags, string, string, uintptr, uintptr, uintptr, uintptr) uintptr | |
| 148 | + | var xNewForBusSyncDBusObjectManagerClient func(BusType, DBusObjectManagerClientFlags, string, string, uintptr, uintptr, uintptr, uintptr, **glib.Error) uintptr | |
| 135 | 149 | ||
| 136 | 150 | // Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead | |
| 137 | 151 | // of a #GDBusConnection. | |
| @@ -139,51 +153,64 @@ var xNewForBusSyncDBusObjectManagerClient func(BusType, DBusObjectManagerClientF | |||
| 139 | 153 | // This is a synchronous failable constructor - the calling thread is | |
| 140 | 154 | // blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus() | |
| 141 | 155 | // for the asynchronous version. | |
| 142 | - | func NewForBusSyncDBusObjectManagerClient(BusTypeVar BusType, FlagsVar DBusObjectManagerClientFlags, NameVar string, ObjectPathVar string, GetProxyTypeFuncVar DBusProxyTypeFunc, GetProxyTypeUserDataVar uintptr, GetProxyTypeDestroyNotifyVar glib.DestroyNotify, CancellableVar *Cancellable) *DBusObjectManagerClient { | |
| 143 | - | NewForBusSyncDBusObjectManagerClientPtr := xNewForBusSyncDBusObjectManagerClient(BusTypeVar, FlagsVar, NameVar, ObjectPathVar, purego.NewCallback(GetProxyTypeFuncVar), GetProxyTypeUserDataVar, purego.NewCallback(GetProxyTypeDestroyNotifyVar), CancellableVar.GoPointer()) | |
| 144 | - | if NewForBusSyncDBusObjectManagerClientPtr == 0 { | |
| 145 | - | return nil | |
| 156 | + | func NewForBusSyncDBusObjectManagerClient(BusTypeVar BusType, FlagsVar DBusObjectManagerClientFlags, NameVar string, ObjectPathVar string, GetProxyTypeFuncVar DBusProxyTypeFunc, GetProxyTypeUserDataVar uintptr, GetProxyTypeDestroyNotifyVar glib.DestroyNotify, CancellableVar *Cancellable) (*DBusObjectManagerClient, error) { | |
| 157 | + | var cls *DBusObjectManagerClient | |
| 158 | + | var cerr *glib.Error | |
| 159 | + | ||
| 160 | + | cret := xNewForBusSyncDBusObjectManagerClient(BusTypeVar, FlagsVar, NameVar, ObjectPathVar, purego.NewCallback(GetProxyTypeFuncVar), GetProxyTypeUserDataVar, purego.NewCallback(GetProxyTypeDestroyNotifyVar), CancellableVar.GoPointer(), &cerr) | |
| 161 | + | ||
| 162 | + | if cret == 0 { | |
| 163 | + | return cls, cerr | |
| 164 | + | } | |
| 165 | + | cls = &DBusObjectManagerClient{} | |
| 166 | + | cls.Ptr = cret | |
| 167 | + | if cerr == nil { | |
| 168 | + | return cls, nil | |
| 146 | 169 | } | |
| 170 | + | return cls, cerr | |
| 147 | 171 | ||
| 148 | - | NewForBusSyncDBusObjectManagerClientCls := &DBusObjectManagerClient{} | |
| 149 | - | NewForBusSyncDBusObjectManagerClientCls.Ptr = NewForBusSyncDBusObjectManagerClientPtr | |
| 150 | - | return NewForBusSyncDBusObjectManagerClientCls | |
| 151 | 172 | } | |
| 152 | 173 | ||
| 153 | - | var xNewSyncDBusObjectManagerClient func(uintptr, DBusObjectManagerClientFlags, string, string, uintptr, uintptr, uintptr, uintptr) uintptr | |
| 174 | + | var xNewSyncDBusObjectManagerClient func(uintptr, DBusObjectManagerClientFlags, string, string, uintptr, uintptr, uintptr, uintptr, **glib.Error) uintptr | |
| 154 | 175 | ||
| 155 | 176 | // Creates a new #GDBusObjectManagerClient object. | |
| 156 | 177 | // | |
| 157 | 178 | // This is a synchronous failable constructor - the calling thread is | |
| 158 | 179 | // blocked until a reply is received. See g_dbus_object_manager_client_new() | |
| 159 | 180 | // for the asynchronous version. | |
| 160 | - | func NewSyncDBusObjectManagerClient(ConnectionVar *DBusConnection, FlagsVar DBusObjectManagerClientFlags, NameVar string, ObjectPathVar string, GetProxyTypeFuncVar DBusProxyTypeFunc, GetProxyTypeUserDataVar uintptr, GetProxyTypeDestroyNotifyVar glib.DestroyNotify, CancellableVar *Cancellable) *DBusObjectManagerClient { | |
| 161 | - | NewSyncDBusObjectManagerClientPtr := xNewSyncDBusObjectManagerClient(ConnectionVar.GoPointer(), FlagsVar, NameVar, ObjectPathVar, purego.NewCallback(GetProxyTypeFuncVar), GetProxyTypeUserDataVar, purego.NewCallback(GetProxyTypeDestroyNotifyVar), CancellableVar.GoPointer()) | |
| 162 | - | if NewSyncDBusObjectManagerClientPtr == 0 { | |
| 163 | - | return nil | |
| 181 | + | func NewSyncDBusObjectManagerClient(ConnectionVar *DBusConnection, FlagsVar DBusObjectManagerClientFlags, NameVar string, ObjectPathVar string, GetProxyTypeFuncVar DBusProxyTypeFunc, GetProxyTypeUserDataVar uintptr, GetProxyTypeDestroyNotifyVar glib.DestroyNotify, CancellableVar *Cancellable) (*DBusObjectManagerClient, error) { | |
| 182 | + | var cls *DBusObjectManagerClient | |
| 183 | + | var cerr *glib.Error | |
| 184 | + | ||
| 185 | + | cret := xNewSyncDBusObjectManagerClient(ConnectionVar.GoPointer(), FlagsVar, NameVar, ObjectPathVar, purego.NewCallback(GetProxyTypeFuncVar), GetProxyTypeUserDataVar, purego.NewCallback(GetProxyTypeDestroyNotifyVar), CancellableVar.GoPointer(), &cerr) | |
| 186 | + | ||
| 187 | + | if cret == 0 { | |
| 188 | + | return cls, cerr | |
| 189 | + | } | |
| 190 | + | cls = &DBusObjectManagerClient{} | |
| 191 | + | cls.Ptr = cret | |
| 192 | + | if cerr == nil { | |
| 193 | + | return cls, nil | |
| 164 | 194 | } | |
| 195 | + | return cls, cerr | |
| 165 | 196 | ||
| 166 | - | NewSyncDBusObjectManagerClientCls := &DBusObjectManagerClient{} | |
| 167 | - | NewSyncDBusObjectManagerClientCls.Ptr = NewSyncDBusObjectManagerClientPtr | |
| 168 | - | return NewSyncDBusObjectManagerClientCls | |
| 169 | 197 | } | |
| 170 | 198 | ||
| 171 | 199 | var xDBusObjectManagerClientGetConnection func(uintptr) uintptr | |
| 172 | 200 | ||
| 173 | 201 | // Gets the #GDBusConnection used by @manager. | |
| 174 | 202 | func (x *DBusObjectManagerClient) GetConnection() *DBusConnection { | |
| 203 | + | var cls *DBusConnection | |
| 175 | 204 | ||
| 176 | - | GetConnectionPtr := xDBusObjectManagerClientGetConnection(x.GoPointer()) | |
| 177 | - | if GetConnectionPtr == 0 { | |
| 178 | - | return nil | |
| 179 | - | } | |
| 180 | - | ||
| 181 | - | gobject.IncreaseRef(GetConnectionPtr) | |
| 182 | - | ||
| 183 | - | GetConnectionCls := &DBusConnection{} | |
| 184 | - | GetConnectionCls.Ptr = GetConnectionPtr | |
| 185 | - | return GetConnectionCls | |
| 205 | + | cret := xDBusObjectManagerClientGetConnection(x.GoPointer()) | |
| 186 | 206 | ||
| 207 | + | if cret == 0 { | |
| 208 | + | return cls | |
| 209 | + | } | |
| 210 | + | gobject.IncreaseRef(cret) | |
| 211 | + | cls = &DBusConnection{} | |
| 212 | + | cls.Ptr = cret | |
| 213 | + | return cls | |
| 187 | 214 | } | |
| 188 | 215 | ||
| 189 | 216 | var xDBusObjectManagerClientGetFlags func(uintptr) DBusObjectManagerClientFlags | |
| @@ -191,8 +218,8 @@ var xDBusObjectManagerClientGetFlags func(uintptr) DBusObjectManagerClientFlags | |||
| 191 | 218 | // Gets the flags that @manager was constructed with. | |
| 192 | 219 | func (x *DBusObjectManagerClient) GetFlags() DBusObjectManagerClientFlags { | |
| 193 | 220 | ||
| 194 | - | return xDBusObjectManagerClientGetFlags(x.GoPointer()) | |
| 195 | - | ||
| 221 | + | cret := xDBusObjectManagerClientGetFlags(x.GoPointer()) | |
| 222 | + | return cret | |
| 196 | 223 | } | |
| 197 | 224 | ||
| 198 | 225 | var xDBusObjectManagerClientGetName func(uintptr) string | |
| @@ -201,8 +228,8 @@ var xDBusObjectManagerClientGetName func(uintptr) string | |||
| 201 | 228 | // connection. | |
| 202 | 229 | func (x *DBusObjectManagerClient) GetName() string { | |
| 203 | 230 | ||
| 204 | - | return xDBusObjectManagerClientGetName(x.GoPointer()) | |
| 205 | - | ||
| 231 | + | cret := xDBusObjectManagerClientGetName(x.GoPointer()) | |
| 232 | + | return cret | |
| 206 | 233 | } | |
| 207 | 234 | ||
| 208 | 235 | var xDBusObjectManagerClientGetNameOwner func(uintptr) string | |
| @@ -213,8 +240,8 @@ var xDBusObjectManagerClientGetNameOwner func(uintptr) string | |||
| 213 | 240 | // #GDBusObjectManagerClient:name-owner property. | |
| 214 | 241 | func (x *DBusObjectManagerClient) GetNameOwner() string { | |
| 215 | 242 | ||
| 216 | - | return xDBusObjectManagerClientGetNameOwner(x.GoPointer()) | |
| 217 | - | ||
| 243 | + | cret := xDBusObjectManagerClientGetNameOwner(x.GoPointer()) | |
| 244 | + | return cret | |
| 218 | 245 | } | |
| 219 | 246 | ||
| 220 | 247 | func (c *DBusObjectManagerClient) GoPointer() uintptr { | |
| @@ -310,68 +337,78 @@ func (x *DBusObjectManagerClient) InitAsync(IoPriorityVar int, CancellableVar *C | |||
| 310 | 337 | ||
| 311 | 338 | // Finishes asynchronous initialization and returns the result. | |
| 312 | 339 | // See g_async_initable_init_async(). | |
| 313 | - | func (x *DBusObjectManagerClient) InitFinish(ResVar AsyncResult) bool { | |
| 340 | + | func (x *DBusObjectManagerClient) InitFinish(ResVar AsyncResult) (bool, error) { | |
| 341 | + | var cerr *glib.Error | |
| 314 | 342 | ||
| 315 | - | return XGAsyncInitableInitFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 343 | + | cret := XGAsyncInitableInitFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 344 | + | if cerr == nil { | |
| 345 | + | return cret, nil | |
| 346 | + | } | |
| 347 | + | return cret, cerr | |
| 316 | 348 | ||
| 317 | 349 | } | |
| 318 | 350 | ||
| 319 | 351 | // Finishes the async construction for the various g_async_initable_new | |
| 320 | 352 | // calls, returning the created object or %NULL on error. | |
| 321 | - | func (x *DBusObjectManagerClient) NewFinish(ResVar AsyncResult) *gobject.Object { | |
| 353 | + | func (x *DBusObjectManagerClient) NewFinish(ResVar AsyncResult) (*gobject.Object, error) { | |
| 354 | + | var cls *gobject.Object | |
| 355 | + | var cerr *glib.Error | |
| 322 | 356 | ||
| 323 | - | NewFinishPtr := XGAsyncInitableNewFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 324 | - | if NewFinishPtr == 0 { | |
| 325 | - | return nil | |
| 326 | - | } | |
| 357 | + | cret := XGAsyncInitableNewFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 327 | 358 | ||
| 328 | - | NewFinishCls := &gobject.Object{} | |
| 329 | - | NewFinishCls.Ptr = NewFinishPtr | |
| 330 | - | return NewFinishCls | |
| 359 | + | if cret == 0 { | |
| 360 | + | return cls, cerr | |
| 361 | + | } | |
| 362 | + | cls = &gobject.Object{} | |
| 363 | + | cls.Ptr = cret | |
| 364 | + | if cerr == nil { | |
| 365 | + | return cls, nil | |
| 366 | + | } | |
| 367 | + | return cls, cerr | |
| 331 | 368 | ||
| 332 | 369 | } | |
| 333 | 370 | ||
| 334 | 371 | // Gets the interface proxy for @interface_name at @object_path, if | |
| 335 | 372 | // any. | |
| 336 | 373 | func (x *DBusObjectManagerClient) GetInterface(ObjectPathVar string, InterfaceNameVar string) *DBusInterfaceBase { | |
| 374 | + | var cls *DBusInterfaceBase | |
| 337 | 375 | ||
| 338 | - | GetInterfacePtr := XGDbusObjectManagerGetInterface(x.GoPointer(), ObjectPathVar, InterfaceNameVar) | |
| 339 | - | if GetInterfacePtr == 0 { | |
| 340 | - | return nil | |
| 341 | - | } | |
| 342 | - | ||
| 343 | - | GetInterfaceCls := &DBusInterfaceBase{} | |
| 344 | - | GetInterfaceCls.Ptr = GetInterfacePtr | |
| 345 | - | return GetInterfaceCls | |
| 376 | + | cret := XGDbusObjectManagerGetInterface(x.GoPointer(), ObjectPathVar, InterfaceNameVar) | |
| 346 | 377 | ||
| 378 | + | if cret == 0 { | |
| 379 | + | return cls | |
| 380 | + | } | |
| 381 | + | cls = &DBusInterfaceBase{} | |
| 382 | + | cls.Ptr = cret | |
| 383 | + | return cls | |
| 347 | 384 | } | |
| 348 | 385 | ||
| 349 | 386 | // Gets the #GDBusObject at @object_path, if any. | |
| 350 | 387 | func (x *DBusObjectManagerClient) GetObject(ObjectPathVar string) *DBusObjectBase { | |
| 388 | + | var cls *DBusObjectBase | |
| 351 | 389 | ||
| 352 | - | GetObjectPtr := XGDbusObjectManagerGetObject(x.GoPointer(), ObjectPathVar) | |
| 353 | - | if GetObjectPtr == 0 { | |
| 354 | - | return nil | |
| 355 | - | } | |
| 356 | - | ||
| 357 | - | GetObjectCls := &DBusObjectBase{} | |
| 358 | - | GetObjectCls.Ptr = GetObjectPtr | |
| 359 | - | return GetObjectCls | |
| 390 | + | cret := XGDbusObjectManagerGetObject(x.GoPointer(), ObjectPathVar) | |
| 360 | 391 | ||
| 392 | + | if cret == 0 { | |
| 393 | + | return cls | |
| 394 | + | } | |
| 395 | + | cls = &DBusObjectBase{} | |
| 396 | + | cls.Ptr = cret | |
| 397 | + | return cls | |
| 361 | 398 | } | |
| 362 | 399 | ||
| 363 | 400 | // Gets the object path that @manager is for. | |
| 364 | 401 | func (x *DBusObjectManagerClient) GetObjectPath() string { | |
| 365 | 402 | ||
| 366 | - | return XGDbusObjectManagerGetObjectPath(x.GoPointer()) | |
| 367 | - | ||
| 403 | + | cret := XGDbusObjectManagerGetObjectPath(x.GoPointer()) | |
| 404 | + | return cret | |
| 368 | 405 | } | |
| 369 | 406 | ||
| 370 | 407 | // Gets all #GDBusObject objects known to @manager. | |
| 371 | 408 | func (x *DBusObjectManagerClient) GetObjects() *glib.List { | |
| 372 | 409 | ||
| 373 | - | return XGDbusObjectManagerGetObjects(x.GoPointer()) | |
| 374 | - | ||
| 410 | + | cret := XGDbusObjectManagerGetObjects(x.GoPointer()) | |
| 411 | + | return cret | |
| 375 | 412 | } | |
| 376 | 413 | ||
| 377 | 414 | // Initializes the object implementing the interface. | |
| @@ -412,9 +449,14 @@ func (x *DBusObjectManagerClient) GetObjects() *glib.List { | |||
| 412 | 449 | // In this pattern, a caller would expect to be able to call g_initable_init() | |
| 413 | 450 | // on the result of g_object_new(), regardless of whether it is in fact a new | |
| 414 | 451 | // instance. | |
| 415 | - | func (x *DBusObjectManagerClient) Init(CancellableVar *Cancellable) bool { | |
| 452 | + | func (x *DBusObjectManagerClient) Init(CancellableVar *Cancellable) (bool, error) { | |
| 453 | + | var cerr *glib.Error | |
| 416 | 454 | ||
| 417 | - | return XGInitableInit(x.GoPointer(), CancellableVar.GoPointer()) | |
| 455 | + | cret := XGInitableInit(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 456 | + | if cerr == nil { | |
| 457 | + | return cret, nil | |
| 458 | + | } | |
| 459 | + | return cret, cerr | |
| 418 | 460 | ||
| 419 | 461 | } | |
| 420 | 462 | ||
M v4/gio/gdbusobjectmanagerserver.go +41 -39
| @@ -60,14 +60,16 @@ var xNewDBusObjectManagerServer func(string) uintptr | |||
| 60 | 60 | // [InterfacesAdded](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager) | |
| 61 | 61 | // signals being emitted. | |
| 62 | 62 | func NewDBusObjectManagerServer(ObjectPathVar string) *DBusObjectManagerServer { | |
| 63 | - | NewDBusObjectManagerServerPtr := xNewDBusObjectManagerServer(ObjectPathVar) | |
| 64 | - | if NewDBusObjectManagerServerPtr == 0 { | |
| 65 | - | return nil | |
| 66 | - | } | |
| 63 | + | var cls *DBusObjectManagerServer | |
| 64 | + | ||
| 65 | + | cret := xNewDBusObjectManagerServer(ObjectPathVar) | |
| 67 | 66 | ||
| 68 | - | NewDBusObjectManagerServerCls := &DBusObjectManagerServer{} | |
| 69 | - | NewDBusObjectManagerServerCls.Ptr = NewDBusObjectManagerServerPtr | |
| 70 | - | return NewDBusObjectManagerServerCls | |
| 67 | + | if cret == 0 { | |
| 68 | + | return cls | |
| 69 | + | } | |
| 70 | + | cls = &DBusObjectManagerServer{} | |
| 71 | + | cls.Ptr = cret | |
| 72 | + | return cls | |
| 71 | 73 | } | |
| 72 | 74 | ||
| 73 | 75 | var xDBusObjectManagerServerExport func(uintptr, uintptr) | |
| @@ -104,16 +106,16 @@ var xDBusObjectManagerServerGetConnection func(uintptr) uintptr | |||
| 104 | 106 | ||
| 105 | 107 | // Gets the #GDBusConnection used by @manager. | |
| 106 | 108 | func (x *DBusObjectManagerServer) GetConnection() *DBusConnection { | |
| 109 | + | var cls *DBusConnection | |
| 107 | 110 | ||
| 108 | - | GetConnectionPtr := xDBusObjectManagerServerGetConnection(x.GoPointer()) | |
| 109 | - | if GetConnectionPtr == 0 { | |
| 110 | - | return nil | |
| 111 | - | } | |
| 112 | - | ||
| 113 | - | GetConnectionCls := &DBusConnection{} | |
| 114 | - | GetConnectionCls.Ptr = GetConnectionPtr | |
| 115 | - | return GetConnectionCls | |
| 111 | + | cret := xDBusObjectManagerServerGetConnection(x.GoPointer()) | |
| 116 | 112 | ||
| 113 | + | if cret == 0 { | |
| 114 | + | return cls | |
| 115 | + | } | |
| 116 | + | cls = &DBusConnection{} | |
| 117 | + | cls.Ptr = cret | |
| 118 | + | return cls | |
| 117 | 119 | } | |
| 118 | 120 | ||
| 119 | 121 | var xDBusObjectManagerServerIsExported func(uintptr, uintptr) bool | |
| @@ -121,8 +123,8 @@ var xDBusObjectManagerServerIsExported func(uintptr, uintptr) bool | |||
| 121 | 123 | // Returns whether @object is currently exported on @manager. | |
| 122 | 124 | func (x *DBusObjectManagerServer) IsExported(ObjectVar *DBusObjectSkeleton) bool { | |
| 123 | 125 | ||
| 124 | - | return xDBusObjectManagerServerIsExported(x.GoPointer(), ObjectVar.GoPointer()) | |
| 125 | - | ||
| 126 | + | cret := xDBusObjectManagerServerIsExported(x.GoPointer(), ObjectVar.GoPointer()) | |
| 127 | + | return cret | |
| 126 | 128 | } | |
| 127 | 129 | ||
| 128 | 130 | var xDBusObjectManagerServerSetConnection func(uintptr, uintptr) | |
| @@ -144,8 +146,8 @@ var xDBusObjectManagerServerUnexport func(uintptr, string) bool | |||
| 144 | 146 | // object path for @manager. | |
| 145 | 147 | func (x *DBusObjectManagerServer) Unexport(ObjectPathVar string) bool { | |
| 146 | 148 | ||
| 147 | - | return xDBusObjectManagerServerUnexport(x.GoPointer(), ObjectPathVar) | |
| 148 | - | ||
| 149 | + | cret := xDBusObjectManagerServerUnexport(x.GoPointer(), ObjectPathVar) | |
| 150 | + | return cret | |
| 149 | 151 | } | |
| 150 | 152 | ||
| 151 | 153 | func (c *DBusObjectManagerServer) GoPointer() uintptr { | |
| @@ -159,44 +161,44 @@ func (c *DBusObjectManagerServer) SetGoPointer(ptr uintptr) { | |||
| 159 | 161 | // Gets the interface proxy for @interface_name at @object_path, if | |
| 160 | 162 | // any. | |
| 161 | 163 | func (x *DBusObjectManagerServer) GetInterface(ObjectPathVar string, InterfaceNameVar string) *DBusInterfaceBase { | |
| 164 | + | var cls *DBusInterfaceBase | |
| 162 | 165 | ||
| 163 | - | GetInterfacePtr := XGDbusObjectManagerGetInterface(x.GoPointer(), ObjectPathVar, InterfaceNameVar) | |
| 164 | - | if GetInterfacePtr == 0 { | |
| 165 | - | return nil | |
| 166 | - | } | |
| 167 | - | ||
| 168 | - | GetInterfaceCls := &DBusInterfaceBase{} | |
| 169 | - | GetInterfaceCls.Ptr = GetInterfacePtr | |
| 170 | - | return GetInterfaceCls | |
| 166 | + | cret := XGDbusObjectManagerGetInterface(x.GoPointer(), ObjectPathVar, InterfaceNameVar) | |
| 171 | 167 | ||
| 168 | + | if cret == 0 { | |
| 169 | + | return cls | |
| 170 | + | } | |
| 171 | + | cls = &DBusInterfaceBase{} | |
| 172 | + | cls.Ptr = cret | |
| 173 | + | return cls | |
| 172 | 174 | } | |
| 173 | 175 | ||
| 174 | 176 | // Gets the #GDBusObject at @object_path, if any. | |
| 175 | 177 | func (x *DBusObjectManagerServer) GetObject(ObjectPathVar string) *DBusObjectBase { | |
| 178 | + | var cls *DBusObjectBase | |
| 176 | 179 | ||
| 177 | - | GetObjectPtr := XGDbusObjectManagerGetObject(x.GoPointer(), ObjectPathVar) | |
| 178 | - | if GetObjectPtr == 0 { | |
| 179 | - | return nil | |
| 180 | - | } | |
| 181 | - | ||
| 182 | - | GetObjectCls := &DBusObjectBase{} | |
| 183 | - | GetObjectCls.Ptr = GetObjectPtr | |
| 184 | - | return GetObjectCls | |
| 180 | + | cret := XGDbusObjectManagerGetObject(x.GoPointer(), ObjectPathVar) | |
| 185 | 181 | ||
| 182 | + | if cret == 0 { | |
| 183 | + | return cls | |
| 184 | + | } | |
| 185 | + | cls = &DBusObjectBase{} | |
| 186 | + | cls.Ptr = cret | |
| 187 | + | return cls | |
| 186 | 188 | } | |
| 187 | 189 | ||
| 188 | 190 | // Gets the object path that @manager is for. | |
| 189 | 191 | func (x *DBusObjectManagerServer) GetObjectPath() string { | |
| 190 | 192 | ||
| 191 | - | return XGDbusObjectManagerGetObjectPath(x.GoPointer()) | |
| 192 | - | ||
| 193 | + | cret := XGDbusObjectManagerGetObjectPath(x.GoPointer()) | |
| 194 | + | return cret | |
| 193 | 195 | } | |
| 194 | 196 | ||
| 195 | 197 | // Gets all #GDBusObject objects known to @manager. | |
| 196 | 198 | func (x *DBusObjectManagerServer) GetObjects() *glib.List { | |
| 197 | 199 | ||
| 198 | - | return XGDbusObjectManagerGetObjects(x.GoPointer()) | |
| 199 | - | ||
| 200 | + | cret := XGDbusObjectManagerGetObjects(x.GoPointer()) | |
| 201 | + | return cret | |
| 200 | 202 | } | |
| 201 | 203 | ||
| 202 | 204 | func init() { | |
M v4/gio/gdbusobjectproxy.go +30 -29
| @@ -37,32 +37,33 @@ var xNewDBusObjectProxy func(uintptr, string) uintptr | |||
| 37 | 37 | // Creates a new #GDBusObjectProxy for the given connection and | |
| 38 | 38 | // object path. | |
| 39 | 39 | func NewDBusObjectProxy(ConnectionVar *DBusConnection, ObjectPathVar string) *DBusObjectProxy { | |
| 40 | - | NewDBusObjectProxyPtr := xNewDBusObjectProxy(ConnectionVar.GoPointer(), ObjectPathVar) | |
| 41 | - | if NewDBusObjectProxyPtr == 0 { | |
| 42 | - | return nil | |
| 43 | - | } | |
| 40 | + | var cls *DBusObjectProxy | |
| 41 | + | ||
| 42 | + | cret := xNewDBusObjectProxy(ConnectionVar.GoPointer(), ObjectPathVar) | |
| 44 | 43 | ||
| 45 | - | NewDBusObjectProxyCls := &DBusObjectProxy{} | |
| 46 | - | NewDBusObjectProxyCls.Ptr = NewDBusObjectProxyPtr | |
| 47 | - | return NewDBusObjectProxyCls | |
| 44 | + | if cret == 0 { | |
| 45 | + | return cls | |
| 46 | + | } | |
| 47 | + | cls = &DBusObjectProxy{} | |
| 48 | + | cls.Ptr = cret | |
| 49 | + | return cls | |
| 48 | 50 | } | |
| 49 | 51 | ||
| 50 | 52 | var xDBusObjectProxyGetConnection func(uintptr) uintptr | |
| 51 | 53 | ||
| 52 | 54 | // Gets the connection that @proxy is for. | |
| 53 | 55 | func (x *DBusObjectProxy) GetConnection() *DBusConnection { | |
| 56 | + | var cls *DBusConnection | |
| 54 | 57 | ||
| 55 | - | GetConnectionPtr := xDBusObjectProxyGetConnection(x.GoPointer()) | |
| 56 | - | if GetConnectionPtr == 0 { | |
| 57 | - | return nil | |
| 58 | - | } | |
| 59 | - | ||
| 60 | - | gobject.IncreaseRef(GetConnectionPtr) | |
| 61 | - | ||
| 62 | - | GetConnectionCls := &DBusConnection{} | |
| 63 | - | GetConnectionCls.Ptr = GetConnectionPtr | |
| 64 | - | return GetConnectionCls | |
| 58 | + | cret := xDBusObjectProxyGetConnection(x.GoPointer()) | |
| 65 | 59 | ||
| 60 | + | if cret == 0 { | |
| 61 | + | return cls | |
| 62 | + | } | |
| 63 | + | gobject.IncreaseRef(cret) | |
| 64 | + | cls = &DBusConnection{} | |
| 65 | + | cls.Ptr = cret | |
| 66 | + | return cls | |
| 66 | 67 | } | |
| 67 | 68 | ||
| 68 | 69 | func (c *DBusObjectProxy) GoPointer() uintptr { | |
| @@ -76,30 +77,30 @@ func (c *DBusObjectProxy) SetGoPointer(ptr uintptr) { | |||
| 76 | 77 | // Gets the D-Bus interface with name @interface_name associated with | |
| 77 | 78 | // @object, if any. | |
| 78 | 79 | func (x *DBusObjectProxy) GetInterface(InterfaceNameVar string) *DBusInterfaceBase { | |
| 80 | + | var cls *DBusInterfaceBase | |
| 79 | 81 | ||
| 80 | - | GetInterfacePtr := XGDbusObjectGetInterface(x.GoPointer(), InterfaceNameVar) | |
| 81 | - | if GetInterfacePtr == 0 { | |
| 82 | - | return nil | |
| 83 | - | } | |
| 84 | - | ||
| 85 | - | GetInterfaceCls := &DBusInterfaceBase{} | |
| 86 | - | GetInterfaceCls.Ptr = GetInterfacePtr | |
| 87 | - | return GetInterfaceCls | |
| 82 | + | cret := XGDbusObjectGetInterface(x.GoPointer(), InterfaceNameVar) | |
| 88 | 83 | ||
| 84 | + | if cret == 0 { | |
| 85 | + | return cls | |
| 86 | + | } | |
| 87 | + | cls = &DBusInterfaceBase{} | |
| 88 | + | cls.Ptr = cret | |
| 89 | + | return cls | |
| 89 | 90 | } | |
| 90 | 91 | ||
| 91 | 92 | // Gets the D-Bus interfaces associated with @object. | |
| 92 | 93 | func (x *DBusObjectProxy) GetInterfaces() *glib.List { | |
| 93 | 94 | ||
| 94 | - | return XGDbusObjectGetInterfaces(x.GoPointer()) | |
| 95 | - | ||
| 95 | + | cret := XGDbusObjectGetInterfaces(x.GoPointer()) | |
| 96 | + | return cret | |
| 96 | 97 | } | |
| 97 | 98 | ||
| 98 | 99 | // Gets the object path for @object. | |
| 99 | 100 | func (x *DBusObjectProxy) GetObjectPath() string { | |
| 100 | 101 | ||
| 101 | - | return XGDbusObjectGetObjectPath(x.GoPointer()) | |
| 102 | - | ||
| 102 | + | cret := XGDbusObjectGetObjectPath(x.GoPointer()) | |
| 103 | + | return cret | |
| 103 | 104 | } | |
| 104 | 105 | ||
| 105 | 106 | func init() { | |
M v4/gio/gdbusobjectskeleton.go +21 -19
| @@ -37,14 +37,16 @@ var xNewDBusObjectSkeleton func(string) uintptr | |||
| 37 | 37 | ||
| 38 | 38 | // Creates a new #GDBusObjectSkeleton. | |
| 39 | 39 | func NewDBusObjectSkeleton(ObjectPathVar string) *DBusObjectSkeleton { | |
| 40 | - | NewDBusObjectSkeletonPtr := xNewDBusObjectSkeleton(ObjectPathVar) | |
| 41 | - | if NewDBusObjectSkeletonPtr == 0 { | |
| 42 | - | return nil | |
| 43 | - | } | |
| 40 | + | var cls *DBusObjectSkeleton | |
| 41 | + | ||
| 42 | + | cret := xNewDBusObjectSkeleton(ObjectPathVar) | |
| 44 | 43 | ||
| 45 | - | NewDBusObjectSkeletonCls := &DBusObjectSkeleton{} | |
| 46 | - | NewDBusObjectSkeletonCls.Ptr = NewDBusObjectSkeletonPtr | |
| 47 | - | return NewDBusObjectSkeletonCls | |
| 44 | + | if cret == 0 { | |
| 45 | + | return cls | |
| 46 | + | } | |
| 47 | + | cls = &DBusObjectSkeleton{} | |
| 48 | + | cls.Ptr = cret | |
| 49 | + | return cls | |
| 48 | 50 | } | |
| 49 | 51 | ||
| 50 | 52 | var xDBusObjectSkeletonAddInterface func(uintptr, uintptr) | |
| @@ -133,30 +135,30 @@ func (x *DBusObjectSkeleton) ConnectAuthorizeMethod(cb func(DBusObjectSkeleton, | |||
| 133 | 135 | // Gets the D-Bus interface with name @interface_name associated with | |
| 134 | 136 | // @object, if any. | |
| 135 | 137 | func (x *DBusObjectSkeleton) GetInterface(InterfaceNameVar string) *DBusInterfaceBase { | |
| 138 | + | var cls *DBusInterfaceBase | |
| 136 | 139 | ||
| 137 | - | GetInterfacePtr := XGDbusObjectGetInterface(x.GoPointer(), InterfaceNameVar) | |
| 138 | - | if GetInterfacePtr == 0 { | |
| 139 | - | return nil | |
| 140 | - | } | |
| 141 | - | ||
| 142 | - | GetInterfaceCls := &DBusInterfaceBase{} | |
| 143 | - | GetInterfaceCls.Ptr = GetInterfacePtr | |
| 144 | - | return GetInterfaceCls | |
| 140 | + | cret := XGDbusObjectGetInterface(x.GoPointer(), InterfaceNameVar) | |
| 145 | 141 | ||
| 142 | + | if cret == 0 { | |
| 143 | + | return cls | |
| 144 | + | } | |
| 145 | + | cls = &DBusInterfaceBase{} | |
| 146 | + | cls.Ptr = cret | |
| 147 | + | return cls | |
| 146 | 148 | } | |
| 147 | 149 | ||
| 148 | 150 | // Gets the D-Bus interfaces associated with @object. | |
| 149 | 151 | func (x *DBusObjectSkeleton) GetInterfaces() *glib.List { | |
| 150 | 152 | ||
| 151 | - | return XGDbusObjectGetInterfaces(x.GoPointer()) | |
| 152 | - | ||
| 153 | + | cret := XGDbusObjectGetInterfaces(x.GoPointer()) | |
| 154 | + | return cret | |
| 153 | 155 | } | |
| 154 | 156 | ||
| 155 | 157 | // Gets the object path for @object. | |
| 156 | 158 | func (x *DBusObjectSkeleton) GetObjectPath() string { | |
| 157 | 159 | ||
| 158 | - | return XGDbusObjectGetObjectPath(x.GoPointer()) | |
| 159 | - | ||
| 160 | + | cret := XGDbusObjectGetObjectPath(x.GoPointer()) | |
| 161 | + | return cret | |
| 160 | 162 | } | |
| 161 | 163 | ||
| 162 | 164 | func init() { | |
M v4/gio/gdbusproxy.go +165 -104
| @@ -72,51 +72,72 @@ func DBusProxyNewFromInternalPtr(ptr uintptr) *DBusProxy { | |||
| 72 | 72 | return cls | |
| 73 | 73 | } | |
| 74 | 74 | ||
| 75 | - | var xNewFinishDBusProxy func(uintptr) uintptr | |
| 75 | + | var xNewFinishDBusProxy func(uintptr, **glib.Error) uintptr | |
| 76 | 76 | ||
| 77 | 77 | // Finishes creating a #GDBusProxy. | |
| 78 | - | func NewFinishDBusProxy(ResVar AsyncResult) *DBusProxy { | |
| 79 | - | NewFinishDBusProxyPtr := xNewFinishDBusProxy(ResVar.GoPointer()) | |
| 80 | - | if NewFinishDBusProxyPtr == 0 { | |
| 81 | - | return nil | |
| 78 | + | func NewFinishDBusProxy(ResVar AsyncResult) (*DBusProxy, error) { | |
| 79 | + | var cls *DBusProxy | |
| 80 | + | var cerr *glib.Error | |
| 81 | + | ||
| 82 | + | cret := xNewFinishDBusProxy(ResVar.GoPointer(), &cerr) | |
| 83 | + | ||
| 84 | + | if cret == 0 { | |
| 85 | + | return cls, cerr | |
| 86 | + | } | |
| 87 | + | cls = &DBusProxy{} | |
| 88 | + | cls.Ptr = cret | |
| 89 | + | if cerr == nil { | |
| 90 | + | return cls, nil | |
| 82 | 91 | } | |
| 92 | + | return cls, cerr | |
| 83 | 93 | ||
| 84 | - | NewFinishDBusProxyCls := &DBusProxy{} | |
| 85 | - | NewFinishDBusProxyCls.Ptr = NewFinishDBusProxyPtr | |
| 86 | - | return NewFinishDBusProxyCls | |
| 87 | 94 | } | |
| 88 | 95 | ||
| 89 | - | var xNewForBusFinishDBusProxy func(uintptr) uintptr | |
| 96 | + | var xNewForBusFinishDBusProxy func(uintptr, **glib.Error) uintptr | |
| 90 | 97 | ||
| 91 | 98 | // Finishes creating a #GDBusProxy. | |
| 92 | - | func NewForBusFinishDBusProxy(ResVar AsyncResult) *DBusProxy { | |
| 93 | - | NewForBusFinishDBusProxyPtr := xNewForBusFinishDBusProxy(ResVar.GoPointer()) | |
| 94 | - | if NewForBusFinishDBusProxyPtr == 0 { | |
| 95 | - | return nil | |
| 99 | + | func NewForBusFinishDBusProxy(ResVar AsyncResult) (*DBusProxy, error) { | |
| 100 | + | var cls *DBusProxy | |
| 101 | + | var cerr *glib.Error | |
| 102 | + | ||
| 103 | + | cret := xNewForBusFinishDBusProxy(ResVar.GoPointer(), &cerr) | |
| 104 | + | ||
| 105 | + | if cret == 0 { | |
| 106 | + | return cls, cerr | |
| 107 | + | } | |
| 108 | + | cls = &DBusProxy{} | |
| 109 | + | cls.Ptr = cret | |
| 110 | + | if cerr == nil { | |
| 111 | + | return cls, nil | |
| 96 | 112 | } | |
| 113 | + | return cls, cerr | |
| 97 | 114 | ||
| 98 | - | NewForBusFinishDBusProxyCls := &DBusProxy{} | |
| 99 | - | NewForBusFinishDBusProxyCls.Ptr = NewForBusFinishDBusProxyPtr | |
| 100 | - | return NewForBusFinishDBusProxyCls | |
| 101 | 115 | } | |
| 102 | 116 | ||
| 103 | - | var xNewForBusSyncDBusProxy func(BusType, DBusProxyFlags, *DBusInterfaceInfo, string, string, string, uintptr) uintptr | |
| 117 | + | var xNewForBusSyncDBusProxy func(BusType, DBusProxyFlags, *DBusInterfaceInfo, string, string, string, uintptr, **glib.Error) uintptr | |
| 104 | 118 | ||
| 105 | 119 | // Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. | |
| 106 | 120 | // | |
| 107 | 121 | // #GDBusProxy is used in this [example][gdbus-wellknown-proxy]. | |
| 108 | - | func NewForBusSyncDBusProxy(BusTypeVar BusType, FlagsVar DBusProxyFlags, InfoVar *DBusInterfaceInfo, NameVar string, ObjectPathVar string, InterfaceNameVar string, CancellableVar *Cancellable) *DBusProxy { | |
| 109 | - | NewForBusSyncDBusProxyPtr := xNewForBusSyncDBusProxy(BusTypeVar, FlagsVar, InfoVar, NameVar, ObjectPathVar, InterfaceNameVar, CancellableVar.GoPointer()) | |
| 110 | - | if NewForBusSyncDBusProxyPtr == 0 { | |
| 111 | - | return nil | |
| 122 | + | func NewForBusSyncDBusProxy(BusTypeVar BusType, FlagsVar DBusProxyFlags, InfoVar *DBusInterfaceInfo, NameVar string, ObjectPathVar string, InterfaceNameVar string, CancellableVar *Cancellable) (*DBusProxy, error) { | |
| 123 | + | var cls *DBusProxy | |
| 124 | + | var cerr *glib.Error | |
| 125 | + | ||
| 126 | + | cret := xNewForBusSyncDBusProxy(BusTypeVar, FlagsVar, InfoVar, NameVar, ObjectPathVar, InterfaceNameVar, CancellableVar.GoPointer(), &cerr) | |
| 127 | + | ||
| 128 | + | if cret == 0 { | |
| 129 | + | return cls, cerr | |
| 130 | + | } | |
| 131 | + | cls = &DBusProxy{} | |
| 132 | + | cls.Ptr = cret | |
| 133 | + | if cerr == nil { | |
| 134 | + | return cls, nil | |
| 112 | 135 | } | |
| 136 | + | return cls, cerr | |
| 113 | 137 | ||
| 114 | - | NewForBusSyncDBusProxyCls := &DBusProxy{} | |
| 115 | - | NewForBusSyncDBusProxyCls.Ptr = NewForBusSyncDBusProxyPtr | |
| 116 | - | return NewForBusSyncDBusProxyCls | |
| 117 | 138 | } | |
| 118 | 139 | ||
| 119 | - | var xNewSyncDBusProxy func(uintptr, DBusProxyFlags, *DBusInterfaceInfo, string, string, string, uintptr) uintptr | |
| 140 | + | var xNewSyncDBusProxy func(uintptr, DBusProxyFlags, *DBusInterfaceInfo, string, string, string, uintptr, **glib.Error) uintptr | |
| 120 | 141 | ||
| 121 | 142 | // Creates a proxy for accessing @interface_name on the remote object | |
| 122 | 143 | // at @object_path owned by @name at @connection and synchronously | |
| @@ -140,15 +161,22 @@ var xNewSyncDBusProxy func(uintptr, DBusProxyFlags, *DBusInterfaceInfo, string, | |||
| 140 | 161 | // and g_dbus_proxy_new_finish() for the asynchronous version. | |
| 141 | 162 | // | |
| 142 | 163 | // #GDBusProxy is used in this [example][gdbus-wellknown-proxy]. | |
| 143 | - | func NewSyncDBusProxy(ConnectionVar *DBusConnection, FlagsVar DBusProxyFlags, InfoVar *DBusInterfaceInfo, NameVar string, ObjectPathVar string, InterfaceNameVar string, CancellableVar *Cancellable) *DBusProxy { | |
| 144 | - | NewSyncDBusProxyPtr := xNewSyncDBusProxy(ConnectionVar.GoPointer(), FlagsVar, InfoVar, NameVar, ObjectPathVar, InterfaceNameVar, CancellableVar.GoPointer()) | |
| 145 | - | if NewSyncDBusProxyPtr == 0 { | |
| 146 | - | return nil | |
| 164 | + | func NewSyncDBusProxy(ConnectionVar *DBusConnection, FlagsVar DBusProxyFlags, InfoVar *DBusInterfaceInfo, NameVar string, ObjectPathVar string, InterfaceNameVar string, CancellableVar *Cancellable) (*DBusProxy, error) { | |
| 165 | + | var cls *DBusProxy | |
| 166 | + | var cerr *glib.Error | |
| 167 | + | ||
| 168 | + | cret := xNewSyncDBusProxy(ConnectionVar.GoPointer(), FlagsVar, InfoVar, NameVar, ObjectPathVar, InterfaceNameVar, CancellableVar.GoPointer(), &cerr) | |
| 169 | + | ||
| 170 | + | if cret == 0 { | |
| 171 | + | return cls, cerr | |
| 172 | + | } | |
| 173 | + | cls = &DBusProxy{} | |
| 174 | + | cls.Ptr = cret | |
| 175 | + | if cerr == nil { | |
| 176 | + | return cls, nil | |
| 147 | 177 | } | |
| 178 | + | return cls, cerr | |
| 148 | 179 | ||
| 149 | - | NewSyncDBusProxyCls := &DBusProxy{} | |
| 150 | - | NewSyncDBusProxyCls.Ptr = NewSyncDBusProxyPtr | |
| 151 | - | return NewSyncDBusProxyCls | |
| 152 | 180 | } | |
| 153 | 181 | ||
| 154 | 182 | var xDBusProxyCall func(uintptr, string, *glib.Variant, DBusCallFlags, int, uintptr, uintptr, uintptr) | |
| @@ -203,16 +231,21 @@ func (x *DBusProxy) Call(MethodNameVar string, ParametersVar *glib.Variant, Flag | |||
| 203 | 231 | ||
| 204 | 232 | } | |
| 205 | 233 | ||
| 206 | - | var xDBusProxyCallFinish func(uintptr, uintptr) *glib.Variant | |
| 234 | + | var xDBusProxyCallFinish func(uintptr, uintptr, **glib.Error) *glib.Variant | |
| 207 | 235 | ||
| 208 | 236 | // Finishes an operation started with g_dbus_proxy_call(). | |
| 209 | - | func (x *DBusProxy) CallFinish(ResVar AsyncResult) *glib.Variant { | |
| 237 | + | func (x *DBusProxy) CallFinish(ResVar AsyncResult) (*glib.Variant, error) { | |
| 238 | + | var cerr *glib.Error | |
| 210 | 239 | ||
| 211 | - | return xDBusProxyCallFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 240 | + | cret := xDBusProxyCallFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 241 | + | if cerr == nil { | |
| 242 | + | return cret, nil | |
| 243 | + | } | |
| 244 | + | return cret, cerr | |
| 212 | 245 | ||
| 213 | 246 | } | |
| 214 | 247 | ||
| 215 | - | var xDBusProxyCallSync func(uintptr, string, *glib.Variant, DBusCallFlags, int, uintptr) *glib.Variant | |
| 248 | + | var xDBusProxyCallSync func(uintptr, string, *glib.Variant, DBusCallFlags, int, uintptr, **glib.Error) *glib.Variant | |
| 216 | 249 | ||
| 217 | 250 | // Synchronously invokes the @method_name method on @proxy. | |
| 218 | 251 | // | |
| @@ -250,9 +283,14 @@ var xDBusProxyCallSync func(uintptr, string, *glib.Variant, DBusCallFlags, int, | |||
| 250 | 283 | // If @proxy has an expected interface (see | |
| 251 | 284 | // #GDBusProxy:g-interface-info) and @method_name is referenced by it, | |
| 252 | 285 | // then the return value is checked against the return type. | |
| 253 | - | func (x *DBusProxy) CallSync(MethodNameVar string, ParametersVar *glib.Variant, FlagsVar DBusCallFlags, TimeoutMsecVar int, CancellableVar *Cancellable) *glib.Variant { | |
| 286 | + | func (x *DBusProxy) CallSync(MethodNameVar string, ParametersVar *glib.Variant, FlagsVar DBusCallFlags, TimeoutMsecVar int, CancellableVar *Cancellable) (*glib.Variant, error) { | |
| 287 | + | var cerr *glib.Error | |
| 254 | 288 | ||
| 255 | - | return xDBusProxyCallSync(x.GoPointer(), MethodNameVar, ParametersVar, FlagsVar, TimeoutMsecVar, CancellableVar.GoPointer()) | |
| 289 | + | cret := xDBusProxyCallSync(x.GoPointer(), MethodNameVar, ParametersVar, FlagsVar, TimeoutMsecVar, CancellableVar.GoPointer(), &cerr) | |
| 290 | + | if cerr == nil { | |
| 291 | + | return cret, nil | |
| 292 | + | } | |
| 293 | + | return cret, cerr | |
| 256 | 294 | ||
| 257 | 295 | } | |
| 258 | 296 | ||
| @@ -267,23 +305,33 @@ func (x *DBusProxy) CallWithUnixFdList(MethodNameVar string, ParametersVar *glib | |||
| 267 | 305 | ||
| 268 | 306 | } | |
| 269 | 307 | ||
| 270 | - | var xDBusProxyCallWithUnixFdListFinish func(uintptr, *uintptr, uintptr) *glib.Variant | |
| 308 | + | var xDBusProxyCallWithUnixFdListFinish func(uintptr, *uintptr, uintptr, **glib.Error) *glib.Variant | |
| 271 | 309 | ||
| 272 | 310 | // Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list(). | |
| 273 | - | func (x *DBusProxy) CallWithUnixFdListFinish(OutFdListVar **UnixFDList, ResVar AsyncResult) *glib.Variant { | |
| 311 | + | func (x *DBusProxy) CallWithUnixFdListFinish(OutFdListVar **UnixFDList, ResVar AsyncResult) (*glib.Variant, error) { | |
| 312 | + | var cerr *glib.Error | |
| 274 | 313 | ||
| 275 | - | return xDBusProxyCallWithUnixFdListFinish(x.GoPointer(), gobject.ConvertPtr(OutFdListVar), ResVar.GoPointer()) | |
| 314 | + | cret := xDBusProxyCallWithUnixFdListFinish(x.GoPointer(), gobject.ConvertPtr(OutFdListVar), ResVar.GoPointer(), &cerr) | |
| 315 | + | if cerr == nil { | |
| 316 | + | return cret, nil | |
| 317 | + | } | |
| 318 | + | return cret, cerr | |
| 276 | 319 | ||
| 277 | 320 | } | |
| 278 | 321 | ||
| 279 | - | var xDBusProxyCallWithUnixFdListSync func(uintptr, string, *glib.Variant, DBusCallFlags, int, uintptr, *uintptr, uintptr) *glib.Variant | |
| 322 | + | var xDBusProxyCallWithUnixFdListSync func(uintptr, string, *glib.Variant, DBusCallFlags, int, uintptr, *uintptr, uintptr, **glib.Error) *glib.Variant | |
| 280 | 323 | ||
| 281 | 324 | // Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects. | |
| 282 | 325 | // | |
| 283 | 326 | // This method is only available on UNIX. | |
| 284 | - | func (x *DBusProxy) CallWithUnixFdListSync(MethodNameVar string, ParametersVar *glib.Variant, FlagsVar DBusCallFlags, TimeoutMsecVar int, FdListVar *UnixFDList, OutFdListVar **UnixFDList, CancellableVar *Cancellable) *glib.Variant { | |
| 327 | + | func (x *DBusProxy) CallWithUnixFdListSync(MethodNameVar string, ParametersVar *glib.Variant, FlagsVar DBusCallFlags, TimeoutMsecVar int, FdListVar *UnixFDList, OutFdListVar **UnixFDList, CancellableVar *Cancellable) (*glib.Variant, error) { | |
| 328 | + | var cerr *glib.Error | |
| 285 | 329 | ||
| 286 | - | return xDBusProxyCallWithUnixFdListSync(x.GoPointer(), MethodNameVar, ParametersVar, FlagsVar, TimeoutMsecVar, FdListVar.GoPointer(), gobject.ConvertPtr(OutFdListVar), CancellableVar.GoPointer()) | |
| 330 | + | cret := xDBusProxyCallWithUnixFdListSync(x.GoPointer(), MethodNameVar, ParametersVar, FlagsVar, TimeoutMsecVar, FdListVar.GoPointer(), gobject.ConvertPtr(OutFdListVar), CancellableVar.GoPointer(), &cerr) | |
| 331 | + | if cerr == nil { | |
| 332 | + | return cret, nil | |
| 333 | + | } | |
| 334 | + | return cret, cerr | |
| 287 | 335 | ||
| 288 | 336 | } | |
| 289 | 337 | ||
| @@ -297,8 +345,8 @@ var xDBusProxyGetCachedProperty func(uintptr, string) *glib.Variant | |||
| 297 | 345 | // it, then @value is checked against the type of the property. | |
| 298 | 346 | func (x *DBusProxy) GetCachedProperty(PropertyNameVar string) *glib.Variant { | |
| 299 | 347 | ||
| 300 | - | return xDBusProxyGetCachedProperty(x.GoPointer(), PropertyNameVar) | |
| 301 | - | ||
| 348 | + | cret := xDBusProxyGetCachedProperty(x.GoPointer(), PropertyNameVar) | |
| 349 | + | return cret | |
| 302 | 350 | } | |
| 303 | 351 | ||
| 304 | 352 | var xDBusProxyGetCachedPropertyNames func(uintptr) uintptr | |
| @@ -306,26 +354,25 @@ var xDBusProxyGetCachedPropertyNames func(uintptr) uintptr | |||
| 306 | 354 | // Gets the names of all cached properties on @proxy. | |
| 307 | 355 | func (x *DBusProxy) GetCachedPropertyNames() uintptr { | |
| 308 | 356 | ||
| 309 | - | return xDBusProxyGetCachedPropertyNames(x.GoPointer()) | |
| 310 | - | ||
| 357 | + | cret := xDBusProxyGetCachedPropertyNames(x.GoPointer()) | |
| 358 | + | return cret | |
| 311 | 359 | } | |
| 312 | 360 | ||
| 313 | 361 | var xDBusProxyGetConnection func(uintptr) uintptr | |
| 314 | 362 | ||
| 315 | 363 | // Gets the connection @proxy is for. | |
| 316 | 364 | func (x *DBusProxy) GetConnection() *DBusConnection { | |
| 365 | + | var cls *DBusConnection | |
| 317 | 366 | ||
| 318 | - | GetConnectionPtr := xDBusProxyGetConnection(x.GoPointer()) | |
| 319 | - | if GetConnectionPtr == 0 { | |
| 320 | - | return nil | |
| 321 | - | } | |
| 322 | - | ||
| 323 | - | gobject.IncreaseRef(GetConnectionPtr) | |
| 324 | - | ||
| 325 | - | GetConnectionCls := &DBusConnection{} | |
| 326 | - | GetConnectionCls.Ptr = GetConnectionPtr | |
| 327 | - | return GetConnectionCls | |
| 367 | + | cret := xDBusProxyGetConnection(x.GoPointer()) | |
| 328 | 368 | ||
| 369 | + | if cret == 0 { | |
| 370 | + | return cls | |
| 371 | + | } | |
| 372 | + | gobject.IncreaseRef(cret) | |
| 373 | + | cls = &DBusConnection{} | |
| 374 | + | cls.Ptr = cret | |
| 375 | + | return cls | |
| 329 | 376 | } | |
| 330 | 377 | ||
| 331 | 378 | var xDBusProxyGetDefaultTimeout func(uintptr) int | |
| @@ -337,8 +384,8 @@ var xDBusProxyGetDefaultTimeout func(uintptr) int | |||
| 337 | 384 | // See the #GDBusProxy:g-default-timeout property for more details. | |
| 338 | 385 | func (x *DBusProxy) GetDefaultTimeout() int { | |
| 339 | 386 | ||
| 340 | - | return xDBusProxyGetDefaultTimeout(x.GoPointer()) | |
| 341 | - | ||
| 387 | + | cret := xDBusProxyGetDefaultTimeout(x.GoPointer()) | |
| 388 | + | return cret | |
| 342 | 389 | } | |
| 343 | 390 | ||
| 344 | 391 | var xDBusProxyGetFlags func(uintptr) DBusProxyFlags | |
| @@ -346,8 +393,8 @@ var xDBusProxyGetFlags func(uintptr) DBusProxyFlags | |||
| 346 | 393 | // Gets the flags that @proxy was constructed with. | |
| 347 | 394 | func (x *DBusProxy) GetFlags() DBusProxyFlags { | |
| 348 | 395 | ||
| 349 | - | return xDBusProxyGetFlags(x.GoPointer()) | |
| 350 | - | ||
| 396 | + | cret := xDBusProxyGetFlags(x.GoPointer()) | |
| 397 | + | return cret | |
| 351 | 398 | } | |
| 352 | 399 | ||
| 353 | 400 | var xDBusProxyGetInterfaceInfo func(uintptr) *DBusInterfaceInfo | |
| @@ -357,8 +404,8 @@ var xDBusProxyGetInterfaceInfo func(uintptr) *DBusInterfaceInfo | |||
| 357 | 404 | // property for more details. | |
| 358 | 405 | func (x *DBusProxy) GetInterfaceInfo() *DBusInterfaceInfo { | |
| 359 | 406 | ||
| 360 | - | return xDBusProxyGetInterfaceInfo(x.GoPointer()) | |
| 361 | - | ||
| 407 | + | cret := xDBusProxyGetInterfaceInfo(x.GoPointer()) | |
| 408 | + | return cret | |
| 362 | 409 | } | |
| 363 | 410 | ||
| 364 | 411 | var xDBusProxyGetInterfaceName func(uintptr) string | |
| @@ -366,8 +413,8 @@ var xDBusProxyGetInterfaceName func(uintptr) string | |||
| 366 | 413 | // Gets the D-Bus interface name @proxy is for. | |
| 367 | 414 | func (x *DBusProxy) GetInterfaceName() string { | |
| 368 | 415 | ||
| 369 | - | return xDBusProxyGetInterfaceName(x.GoPointer()) | |
| 370 | - | ||
| 416 | + | cret := xDBusProxyGetInterfaceName(x.GoPointer()) | |
| 417 | + | return cret | |
| 371 | 418 | } | |
| 372 | 419 | ||
| 373 | 420 | var xDBusProxyGetName func(uintptr) string | |
| @@ -379,8 +426,8 @@ var xDBusProxyGetName func(uintptr) string | |||
| 379 | 426 | // pattern. | |
| 380 | 427 | func (x *DBusProxy) GetName() string { | |
| 381 | 428 | ||
| 382 | - | return xDBusProxyGetName(x.GoPointer()) | |
| 383 | - | ||
| 429 | + | cret := xDBusProxyGetName(x.GoPointer()) | |
| 430 | + | return cret | |
| 384 | 431 | } | |
| 385 | 432 | ||
| 386 | 433 | var xDBusProxyGetNameOwner func(uintptr) string | |
| @@ -391,8 +438,8 @@ var xDBusProxyGetNameOwner func(uintptr) string | |||
| 391 | 438 | // #GDBusProxy:g-name-owner property. | |
| 392 | 439 | func (x *DBusProxy) GetNameOwner() string { | |
| 393 | 440 | ||
| 394 | - | return xDBusProxyGetNameOwner(x.GoPointer()) | |
| 395 | - | ||
| 441 | + | cret := xDBusProxyGetNameOwner(x.GoPointer()) | |
| 442 | + | return cret | |
| 396 | 443 | } | |
| 397 | 444 | ||
| 398 | 445 | var xDBusProxyGetObjectPath func(uintptr) string | |
| @@ -400,8 +447,8 @@ var xDBusProxyGetObjectPath func(uintptr) string | |||
| 400 | 447 | // Gets the object path @proxy is for. | |
| 401 | 448 | func (x *DBusProxy) GetObjectPath() string { | |
| 402 | 449 | ||
| 403 | - | return xDBusProxyGetObjectPath(x.GoPointer()) | |
| 404 | - | ||
| 450 | + | cret := xDBusProxyGetObjectPath(x.GoPointer()) | |
| 451 | + | return cret | |
| 405 | 452 | } | |
| 406 | 453 | ||
| 407 | 454 | var xDBusProxySetCachedProperty func(uintptr, string, *glib.Variant) | |
| @@ -562,47 +609,57 @@ func (x *DBusProxy) InitAsync(IoPriorityVar int, CancellableVar *Cancellable, Ca | |||
| 562 | 609 | ||
| 563 | 610 | // Finishes asynchronous initialization and returns the result. | |
| 564 | 611 | // See g_async_initable_init_async(). | |
| 565 | - | func (x *DBusProxy) InitFinish(ResVar AsyncResult) bool { | |
| 612 | + | func (x *DBusProxy) InitFinish(ResVar AsyncResult) (bool, error) { | |
| 613 | + | var cerr *glib.Error | |
| 566 | 614 | ||
| 567 | - | return XGAsyncInitableInitFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 615 | + | cret := XGAsyncInitableInitFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 616 | + | if cerr == nil { | |
| 617 | + | return cret, nil | |
| 618 | + | } | |
| 619 | + | return cret, cerr | |
| 568 | 620 | ||
| 569 | 621 | } | |
| 570 | 622 | ||
| 571 | 623 | // Finishes the async construction for the various g_async_initable_new | |
| 572 | 624 | // calls, returning the created object or %NULL on error. | |
| 573 | - | func (x *DBusProxy) NewFinish(ResVar AsyncResult) *gobject.Object { | |
| 625 | + | func (x *DBusProxy) NewFinish(ResVar AsyncResult) (*gobject.Object, error) { | |
| 626 | + | var cls *gobject.Object | |
| 627 | + | var cerr *glib.Error | |
| 574 | 628 | ||
| 575 | - | NewFinishPtr := XGAsyncInitableNewFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 576 | - | if NewFinishPtr == 0 { | |
| 577 | - | return nil | |
| 578 | - | } | |
| 629 | + | cret := XGAsyncInitableNewFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 579 | 630 | ||
| 580 | - | NewFinishCls := &gobject.Object{} | |
| 581 | - | NewFinishCls.Ptr = NewFinishPtr | |
| 582 | - | return NewFinishCls | |
| 631 | + | if cret == 0 { | |
| 632 | + | return cls, cerr | |
| 633 | + | } | |
| 634 | + | cls = &gobject.Object{} | |
| 635 | + | cls.Ptr = cret | |
| 636 | + | if cerr == nil { | |
| 637 | + | return cls, nil | |
| 638 | + | } | |
| 639 | + | return cls, cerr | |
| 583 | 640 | ||
| 584 | 641 | } | |
| 585 | 642 | ||
| 586 | 643 | // Gets the #GDBusObject that @interface_ belongs to, if any. | |
| 587 | 644 | func (x *DBusProxy) DupObject() *DBusObjectBase { | |
| 645 | + | var cls *DBusObjectBase | |
| 588 | 646 | ||
| 589 | - | DupObjectPtr := XGDbusInterfaceDupObject(x.GoPointer()) | |
| 590 | - | if DupObjectPtr == 0 { | |
| 591 | - | return nil | |
| 592 | - | } | |
| 593 | - | ||
| 594 | - | DupObjectCls := &DBusObjectBase{} | |
| 595 | - | DupObjectCls.Ptr = DupObjectPtr | |
| 596 | - | return DupObjectCls | |
| 647 | + | cret := XGDbusInterfaceDupObject(x.GoPointer()) | |
| 597 | 648 | ||
| 649 | + | if cret == 0 { | |
| 650 | + | return cls | |
| 651 | + | } | |
| 652 | + | cls = &DBusObjectBase{} | |
| 653 | + | cls.Ptr = cret | |
| 654 | + | return cls | |
| 598 | 655 | } | |
| 599 | 656 | ||
| 600 | 657 | // Gets D-Bus introspection information for the D-Bus interface | |
| 601 | 658 | // implemented by @interface_. | |
| 602 | 659 | func (x *DBusProxy) GetInfo() *DBusInterfaceInfo { | |
| 603 | 660 | ||
| 604 | - | return XGDbusInterfaceGetInfo(x.GoPointer()) | |
| 605 | - | ||
| 661 | + | cret := XGDbusInterfaceGetInfo(x.GoPointer()) | |
| 662 | + | return cret | |
| 606 | 663 | } | |
| 607 | 664 | ||
| 608 | 665 | // Gets the #GDBusObject that @interface_ belongs to, if any. | |
| @@ -611,18 +668,17 @@ func (x *DBusProxy) GetInfo() *DBusInterfaceInfo { | |||
| 611 | 668 | // the returned object is being used from other threads. See | |
| 612 | 669 | // g_dbus_interface_dup_object() for a thread-safe alternative. | |
| 613 | 670 | func (x *DBusProxy) GetObject() *DBusObjectBase { | |
| 671 | + | var cls *DBusObjectBase | |
| 614 | 672 | ||
| 615 | - | GetObjectPtr := XGDbusInterfaceGetObject(x.GoPointer()) | |
| 616 | - | if GetObjectPtr == 0 { | |
| 617 | - | return nil | |
| 618 | - | } | |
| 619 | - | ||
| 620 | - | gobject.IncreaseRef(GetObjectPtr) | |
| 621 | - | ||
| 622 | - | GetObjectCls := &DBusObjectBase{} | |
| 623 | - | GetObjectCls.Ptr = GetObjectPtr | |
| 624 | - | return GetObjectCls | |
| 673 | + | cret := XGDbusInterfaceGetObject(x.GoPointer()) | |
| 625 | 674 | ||
| 675 | + | if cret == 0 { | |
| 676 | + | return cls | |
| 677 | + | } | |
| 678 | + | gobject.IncreaseRef(cret) | |
| 679 | + | cls = &DBusObjectBase{} | |
| 680 | + | cls.Ptr = cret | |
| 681 | + | return cls | |
| 626 | 682 | } | |
| 627 | 683 | ||
| 628 | 684 | // Sets the #GDBusObject for @interface_ to @object. | |
| @@ -672,9 +728,14 @@ func (x *DBusProxy) SetObject(ObjectVar DBusObject) { | |||
| 672 | 728 | // In this pattern, a caller would expect to be able to call g_initable_init() | |
| 673 | 729 | // on the result of g_object_new(), regardless of whether it is in fact a new | |
| 674 | 730 | // instance. | |
| 675 | - | func (x *DBusProxy) Init(CancellableVar *Cancellable) bool { | |
| 731 | + | func (x *DBusProxy) Init(CancellableVar *Cancellable) (bool, error) { | |
| 732 | + | var cerr *glib.Error | |
| 676 | 733 | ||
| 677 | - | return XGInitableInit(x.GoPointer(), CancellableVar.GoPointer()) | |
| 734 | + | cret := XGInitableInit(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 735 | + | if cerr == nil { | |
| 736 | + | return cret, nil | |
| 737 | + | } | |
| 738 | + | return cret, cerr | |
| 678 | 739 | ||
| 679 | 740 | } | |
| 680 | 741 | ||
M v4/gio/gdbusutils.go +22 -22
| @@ -13,8 +13,8 @@ var xDbusEscapeObjectPath func(string) string | |||
| 13 | 13 | // This is a language binding friendly version of g_dbus_escape_object_path_bytestring(). | |
| 14 | 14 | func DbusEscapeObjectPath(SVar string) string { | |
| 15 | 15 | ||
| 16 | - | return xDbusEscapeObjectPath(SVar) | |
| 17 | - | ||
| 16 | + | cret := xDbusEscapeObjectPath(SVar) | |
| 17 | + | return cret | |
| 18 | 18 | } | |
| 19 | 19 | ||
| 20 | 20 | var xDbusEscapeObjectPathBytestring func(uintptr) string | |
| @@ -37,8 +37,8 @@ var xDbusEscapeObjectPathBytestring func(uintptr) string | |||
| 37 | 37 | // This can be reversed with g_dbus_unescape_object_path(). | |
| 38 | 38 | func DbusEscapeObjectPathBytestring(BytesVar uintptr) string { | |
| 39 | 39 | ||
| 40 | - | return xDbusEscapeObjectPathBytestring(BytesVar) | |
| 41 | - | ||
| 40 | + | cret := xDbusEscapeObjectPathBytestring(BytesVar) | |
| 41 | + | return cret | |
| 42 | 42 | } | |
| 43 | 43 | ||
| 44 | 44 | var xDbusGenerateGuid func() string | |
| @@ -56,8 +56,8 @@ var xDbusGenerateGuid func() string | |||
| 56 | 56 | // [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122). | |
| 57 | 57 | func DbusGenerateGuid() string { | |
| 58 | 58 | ||
| 59 | - | return xDbusGenerateGuid() | |
| 60 | - | ||
| 59 | + | cret := xDbusGenerateGuid() | |
| 60 | + | return cret | |
| 61 | 61 | } | |
| 62 | 62 | ||
| 63 | 63 | var xDbusGvalueToGvariant func(*gobject.Value, *glib.VariantType) *glib.Variant | |
| @@ -92,8 +92,8 @@ var xDbusGvalueToGvariant func(*gobject.Value, *glib.VariantType) *glib.Variant | |||
| 92 | 92 | // #GVariant to a #GValue. | |
| 93 | 93 | func DbusGvalueToGvariant(GvalueVar *gobject.Value, TypeVar *glib.VariantType) *glib.Variant { | |
| 94 | 94 | ||
| 95 | - | return xDbusGvalueToGvariant(GvalueVar, TypeVar) | |
| 96 | - | ||
| 95 | + | cret := xDbusGvalueToGvariant(GvalueVar, TypeVar) | |
| 96 | + | return cret | |
| 97 | 97 | } | |
| 98 | 98 | ||
| 99 | 99 | var xDbusGvariantToGvalue func(*glib.Variant, *gobject.Value) | |
| @@ -124,8 +124,8 @@ var xDbusIsErrorName func(string) bool | |||
| 124 | 124 | // same syntax as interface names. | |
| 125 | 125 | func DbusIsErrorName(StringVar string) bool { | |
| 126 | 126 | ||
| 127 | - | return xDbusIsErrorName(StringVar) | |
| 128 | - | ||
| 127 | + | cret := xDbusIsErrorName(StringVar) | |
| 128 | + | return cret | |
| 129 | 129 | } | |
| 130 | 130 | ||
| 131 | 131 | var xDbusIsGuid func(string) bool | |
| @@ -136,8 +136,8 @@ var xDbusIsGuid func(string) bool | |||
| 136 | 136 | // the format of a GUID. | |
| 137 | 137 | func DbusIsGuid(StringVar string) bool { | |
| 138 | 138 | ||
| 139 | - | return xDbusIsGuid(StringVar) | |
| 140 | - | ||
| 139 | + | cret := xDbusIsGuid(StringVar) | |
| 140 | + | return cret | |
| 141 | 141 | } | |
| 142 | 142 | ||
| 143 | 143 | var xDbusIsInterfaceName func(string) bool | |
| @@ -145,8 +145,8 @@ var xDbusIsInterfaceName func(string) bool | |||
| 145 | 145 | // Checks if @string is a valid D-Bus interface name. | |
| 146 | 146 | func DbusIsInterfaceName(StringVar string) bool { | |
| 147 | 147 | ||
| 148 | - | return xDbusIsInterfaceName(StringVar) | |
| 149 | - | ||
| 148 | + | cret := xDbusIsInterfaceName(StringVar) | |
| 149 | + | return cret | |
| 150 | 150 | } | |
| 151 | 151 | ||
| 152 | 152 | var xDbusIsMemberName func(string) bool | |
| @@ -154,8 +154,8 @@ var xDbusIsMemberName func(string) bool | |||
| 154 | 154 | // Checks if @string is a valid D-Bus member (e.g. signal or method) name. | |
| 155 | 155 | func DbusIsMemberName(StringVar string) bool { | |
| 156 | 156 | ||
| 157 | - | return xDbusIsMemberName(StringVar) | |
| 158 | - | ||
| 157 | + | cret := xDbusIsMemberName(StringVar) | |
| 158 | + | return cret | |
| 159 | 159 | } | |
| 160 | 160 | ||
| 161 | 161 | var xDbusIsName func(string) bool | |
| @@ -163,8 +163,8 @@ var xDbusIsName func(string) bool | |||
| 163 | 163 | // Checks if @string is a valid D-Bus bus name (either unique or well-known). | |
| 164 | 164 | func DbusIsName(StringVar string) bool { | |
| 165 | 165 | ||
| 166 | - | return xDbusIsName(StringVar) | |
| 167 | - | ||
| 166 | + | cret := xDbusIsName(StringVar) | |
| 167 | + | return cret | |
| 168 | 168 | } | |
| 169 | 169 | ||
| 170 | 170 | var xDbusIsUniqueName func(string) bool | |
| @@ -172,8 +172,8 @@ var xDbusIsUniqueName func(string) bool | |||
| 172 | 172 | // Checks if @string is a valid D-Bus unique bus name. | |
| 173 | 173 | func DbusIsUniqueName(StringVar string) bool { | |
| 174 | 174 | ||
| 175 | - | return xDbusIsUniqueName(StringVar) | |
| 176 | - | ||
| 175 | + | cret := xDbusIsUniqueName(StringVar) | |
| 176 | + | return cret | |
| 177 | 177 | } | |
| 178 | 178 | ||
| 179 | 179 | var xDbusUnescapeObjectPath func(string) uintptr | |
| @@ -188,8 +188,8 @@ var xDbusUnescapeObjectPath func(string) uintptr | |||
| 188 | 188 | // should contain `c` instead). | |
| 189 | 189 | func DbusUnescapeObjectPath(SVar string) uintptr { | |
| 190 | 190 | ||
| 191 | - | return xDbusUnescapeObjectPath(SVar) | |
| 192 | - | ||
| 191 | + | cret := xDbusUnescapeObjectPath(SVar) | |
| 192 | + | return cret | |
| 193 | 193 | } | |
| 194 | 194 | ||
| 195 | 195 | func init() { | |
M v4/gio/gdebugcontroller.go +2 -2
| @@ -47,8 +47,8 @@ func (x *DebugControllerBase) SetGoPointer(ptr uintptr) { | |||
| 47 | 47 | // Get the value of #GDebugController:debug-enabled. | |
| 48 | 48 | func (x *DebugControllerBase) GetDebugEnabled() bool { | |
| 49 | 49 | ||
| 50 | - | return XGDebugControllerGetDebugEnabled(x.GoPointer()) | |
| 51 | - | ||
| 50 | + | cret := XGDebugControllerGetDebugEnabled(x.GoPointer()) | |
| 51 | + | return cret | |
| 52 | 52 | } | |
| 53 | 53 | ||
| 54 | 54 | // Set the value of #GDebugController:debug-enabled. | |
M v4/gio/gdebugcontrollerdbus.go +25 -12
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -136,7 +137,7 @@ func DebugControllerDBusNewFromInternalPtr(ptr uintptr) *DebugControllerDBus { | |||
| 136 | 137 | return cls | |
| 137 | 138 | } | |
| 138 | 139 | ||
| 139 | - | var xNewDebugControllerDBus func(uintptr, uintptr) uintptr | |
| 140 | + | var xNewDebugControllerDBus func(uintptr, uintptr, **glib.Error) uintptr | |
| 140 | 141 | ||
| 141 | 142 | // Create a new #GDebugControllerDBus and synchronously initialize it. | |
| 142 | 143 | // | |
| @@ -145,15 +146,22 @@ var xNewDebugControllerDBus func(uintptr, uintptr) uintptr | |||
| 145 | 146 | // #GDebugControllerDBus is dropped. | |
| 146 | 147 | // | |
| 147 | 148 | // Initialization may fail if registering the object on @connection fails. | |
| 148 | - | func NewDebugControllerDBus(ConnectionVar *DBusConnection, CancellableVar *Cancellable) *DebugControllerDBus { | |
| 149 | - | NewDebugControllerDBusPtr := xNewDebugControllerDBus(ConnectionVar.GoPointer(), CancellableVar.GoPointer()) | |
| 150 | - | if NewDebugControllerDBusPtr == 0 { | |
| 151 | - | return nil | |
| 149 | + | func NewDebugControllerDBus(ConnectionVar *DBusConnection, CancellableVar *Cancellable) (*DebugControllerDBus, error) { | |
| 150 | + | var cls *DebugControllerDBus | |
| 151 | + | var cerr *glib.Error | |
| 152 | + | ||
| 153 | + | cret := xNewDebugControllerDBus(ConnectionVar.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 154 | + | ||
| 155 | + | if cret == 0 { | |
| 156 | + | return cls, cerr | |
| 157 | + | } | |
| 158 | + | cls = &DebugControllerDBus{} | |
| 159 | + | cls.Ptr = cret | |
| 160 | + | if cerr == nil { | |
| 161 | + | return cls, nil | |
| 152 | 162 | } | |
| 163 | + | return cls, cerr | |
| 153 | 164 | ||
| 154 | - | NewDebugControllerDBusCls := &DebugControllerDBus{} | |
| 155 | - | NewDebugControllerDBusCls.Ptr = NewDebugControllerDBusPtr | |
| 156 | - | return NewDebugControllerDBusCls | |
| 157 | 165 | } | |
| 158 | 166 | ||
| 159 | 167 | var xDebugControllerDBusStop func(uintptr) | |
| @@ -219,8 +227,8 @@ func (x *DebugControllerDBus) ConnectAuthorize(cb func(DebugControllerDBus, uint | |||
| 219 | 227 | // Get the value of #GDebugController:debug-enabled. | |
| 220 | 228 | func (x *DebugControllerDBus) GetDebugEnabled() bool { | |
| 221 | 229 | ||
| 222 | - | return XGDebugControllerGetDebugEnabled(x.GoPointer()) | |
| 223 | - | ||
| 230 | + | cret := XGDebugControllerGetDebugEnabled(x.GoPointer()) | |
| 231 | + | return cret | |
| 224 | 232 | } | |
| 225 | 233 | ||
| 226 | 234 | // Set the value of #GDebugController:debug-enabled. | |
| @@ -268,9 +276,14 @@ func (x *DebugControllerDBus) SetDebugEnabled(DebugEnabledVar bool) { | |||
| 268 | 276 | // In this pattern, a caller would expect to be able to call g_initable_init() | |
| 269 | 277 | // on the result of g_object_new(), regardless of whether it is in fact a new | |
| 270 | 278 | // instance. | |
| 271 | - | func (x *DebugControllerDBus) Init(CancellableVar *Cancellable) bool { | |
| 279 | + | func (x *DebugControllerDBus) Init(CancellableVar *Cancellable) (bool, error) { | |
| 280 | + | var cerr *glib.Error | |
| 272 | 281 | ||
| 273 | - | return XGInitableInit(x.GoPointer(), CancellableVar.GoPointer()) | |
| 282 | + | cret := XGInitableInit(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 283 | + | if cerr == nil { | |
| 284 | + | return cret, nil | |
| 285 | + | } | |
| 286 | + | return cret, cerr | |
| 274 | 287 | ||
| 275 | 288 | } | |
| 276 | 289 | ||
M v4/gio/gdesktopappinfo.go +182 -127
| @@ -51,16 +51,16 @@ func (x *DesktopAppInfoLookupBase) SetGoPointer(ptr uintptr) { | |||
| 51 | 51 | // in a GIO module. There is no reason for applications to use it | |
| 52 | 52 | // directly. Applications should use g_app_info_get_default_for_uri_scheme(). | |
| 53 | 53 | func (x *DesktopAppInfoLookupBase) GetDefaultForUriScheme(UriSchemeVar string) *AppInfoBase { | |
| 54 | + | var cls *AppInfoBase | |
| 54 | 55 | ||
| 55 | - | GetDefaultForUriSchemePtr := XGDesktopAppInfoLookupGetDefaultForUriScheme(x.GoPointer(), UriSchemeVar) | |
| 56 | - | if GetDefaultForUriSchemePtr == 0 { | |
| 57 | - | return nil | |
| 58 | - | } | |
| 59 | - | ||
| 60 | - | GetDefaultForUriSchemeCls := &AppInfoBase{} | |
| 61 | - | GetDefaultForUriSchemeCls.Ptr = GetDefaultForUriSchemePtr | |
| 62 | - | return GetDefaultForUriSchemeCls | |
| 56 | + | cret := XGDesktopAppInfoLookupGetDefaultForUriScheme(x.GoPointer(), UriSchemeVar) | |
| 63 | 57 | ||
| 58 | + | if cret == 0 { | |
| 59 | + | return cls | |
| 60 | + | } | |
| 61 | + | cls = &AppInfoBase{} | |
| 62 | + | cls.Ptr = cret | |
| 63 | + | return cls | |
| 64 | 64 | } | |
| 65 | 65 | ||
| 66 | 66 | var XGDesktopAppInfoLookupGetDefaultForUriScheme func(uintptr, string) uintptr | |
| @@ -95,42 +95,48 @@ var xNewDesktopAppInfo func(string) uintptr | |||
| 95 | 95 | // (i.e. a desktop id of kde-foo.desktop will match | |
| 96 | 96 | // `/usr/share/applications/kde/foo.desktop`). | |
| 97 | 97 | func NewDesktopAppInfo(DesktopIdVar string) *DesktopAppInfo { | |
| 98 | - | NewDesktopAppInfoPtr := xNewDesktopAppInfo(DesktopIdVar) | |
| 99 | - | if NewDesktopAppInfoPtr == 0 { | |
| 100 | - | return nil | |
| 101 | - | } | |
| 98 | + | var cls *DesktopAppInfo | |
| 99 | + | ||
| 100 | + | cret := xNewDesktopAppInfo(DesktopIdVar) | |
| 102 | 101 | ||
| 103 | - | NewDesktopAppInfoCls := &DesktopAppInfo{} | |
| 104 | - | NewDesktopAppInfoCls.Ptr = NewDesktopAppInfoPtr | |
| 105 | - | return NewDesktopAppInfoCls | |
| 102 | + | if cret == 0 { | |
| 103 | + | return cls | |
| 104 | + | } | |
| 105 | + | cls = &DesktopAppInfo{} | |
| 106 | + | cls.Ptr = cret | |
| 107 | + | return cls | |
| 106 | 108 | } | |
| 107 | 109 | ||
| 108 | 110 | var xNewFromFilenameDesktopAppInfo func(string) uintptr | |
| 109 | 111 | ||
| 110 | 112 | // Creates a new #GDesktopAppInfo. | |
| 111 | 113 | func NewFromFilenameDesktopAppInfo(FilenameVar string) *DesktopAppInfo { | |
| 112 | - | NewFromFilenameDesktopAppInfoPtr := xNewFromFilenameDesktopAppInfo(FilenameVar) | |
| 113 | - | if NewFromFilenameDesktopAppInfoPtr == 0 { | |
| 114 | - | return nil | |
| 115 | - | } | |
| 114 | + | var cls *DesktopAppInfo | |
| 115 | + | ||
| 116 | + | cret := xNewFromFilenameDesktopAppInfo(FilenameVar) | |
| 116 | 117 | ||
| 117 | - | NewFromFilenameDesktopAppInfoCls := &DesktopAppInfo{} | |
| 118 | - | NewFromFilenameDesktopAppInfoCls.Ptr = NewFromFilenameDesktopAppInfoPtr | |
| 119 | - | return NewFromFilenameDesktopAppInfoCls | |
| 118 | + | if cret == 0 { | |
| 119 | + | return cls | |
| 120 | + | } | |
| 121 | + | cls = &DesktopAppInfo{} | |
| 122 | + | cls.Ptr = cret | |
| 123 | + | return cls | |
| 120 | 124 | } | |
| 121 | 125 | ||
| 122 | 126 | var xNewFromKeyfileDesktopAppInfo func(*glib.KeyFile) uintptr | |
| 123 | 127 | ||
| 124 | 128 | // Creates a new #GDesktopAppInfo. | |
| 125 | 129 | func NewFromKeyfileDesktopAppInfo(KeyFileVar *glib.KeyFile) *DesktopAppInfo { | |
| 126 | - | NewFromKeyfileDesktopAppInfoPtr := xNewFromKeyfileDesktopAppInfo(KeyFileVar) | |
| 127 | - | if NewFromKeyfileDesktopAppInfoPtr == 0 { | |
| 128 | - | return nil | |
| 129 | - | } | |
| 130 | + | var cls *DesktopAppInfo | |
| 131 | + | ||
| 132 | + | cret := xNewFromKeyfileDesktopAppInfo(KeyFileVar) | |
| 130 | 133 | ||
| 131 | - | NewFromKeyfileDesktopAppInfoCls := &DesktopAppInfo{} | |
| 132 | - | NewFromKeyfileDesktopAppInfoCls.Ptr = NewFromKeyfileDesktopAppInfoPtr | |
| 133 | - | return NewFromKeyfileDesktopAppInfoCls | |
| 134 | + | if cret == 0 { | |
| 135 | + | return cls | |
| 136 | + | } | |
| 137 | + | cls = &DesktopAppInfo{} | |
| 138 | + | cls.Ptr = cret | |
| 139 | + | return cls | |
| 134 | 140 | } | |
| 135 | 141 | ||
| 136 | 142 | var xDesktopAppInfoGetActionName func(uintptr, string) string | |
| @@ -142,8 +148,8 @@ var xDesktopAppInfoGetActionName func(uintptr, string) string | |||
| 142 | 148 | // action. | |
| 143 | 149 | func (x *DesktopAppInfo) GetActionName(ActionNameVar string) string { | |
| 144 | 150 | ||
| 145 | - | return xDesktopAppInfoGetActionName(x.GoPointer(), ActionNameVar) | |
| 146 | - | ||
| 151 | + | cret := xDesktopAppInfoGetActionName(x.GoPointer(), ActionNameVar) | |
| 152 | + | return cret | |
| 147 | 153 | } | |
| 148 | 154 | ||
| 149 | 155 | var xDesktopAppInfoGetBoolean func(uintptr, string) bool | |
| @@ -153,8 +159,8 @@ var xDesktopAppInfoGetBoolean func(uintptr, string) bool | |||
| 153 | 159 | // The @key is looked up in the "Desktop Entry" group. | |
| 154 | 160 | func (x *DesktopAppInfo) GetBoolean(KeyVar string) bool { | |
| 155 | 161 | ||
| 156 | - | return xDesktopAppInfoGetBoolean(x.GoPointer(), KeyVar) | |
| 157 | - | ||
| 162 | + | cret := xDesktopAppInfoGetBoolean(x.GoPointer(), KeyVar) | |
| 163 | + | return cret | |
| 158 | 164 | } | |
| 159 | 165 | ||
| 160 | 166 | var xDesktopAppInfoGetCategories func(uintptr) string | |
| @@ -162,8 +168,8 @@ var xDesktopAppInfoGetCategories func(uintptr) string | |||
| 162 | 168 | // Gets the categories from the desktop file. | |
| 163 | 169 | func (x *DesktopAppInfo) GetCategories() string { | |
| 164 | 170 | ||
| 165 | - | return xDesktopAppInfoGetCategories(x.GoPointer()) | |
| 166 | - | ||
| 171 | + | cret := xDesktopAppInfoGetCategories(x.GoPointer()) | |
| 172 | + | return cret | |
| 167 | 173 | } | |
| 168 | 174 | ||
| 169 | 175 | var xDesktopAppInfoGetFilename func(uintptr) string | |
| @@ -173,8 +179,8 @@ var xDesktopAppInfoGetFilename func(uintptr) string | |||
| 173 | 179 | // g_desktop_app_info_new_from_keyfile(), this function will return %NULL. | |
| 174 | 180 | func (x *DesktopAppInfo) GetFilename() string { | |
| 175 | 181 | ||
| 176 | - | return xDesktopAppInfoGetFilename(x.GoPointer()) | |
| 177 | - | ||
| 182 | + | cret := xDesktopAppInfoGetFilename(x.GoPointer()) | |
| 183 | + | return cret | |
| 178 | 184 | } | |
| 179 | 185 | ||
| 180 | 186 | var xDesktopAppInfoGetGenericName func(uintptr) string | |
| @@ -182,8 +188,8 @@ var xDesktopAppInfoGetGenericName func(uintptr) string | |||
| 182 | 188 | // Gets the generic name from the desktop file. | |
| 183 | 189 | func (x *DesktopAppInfo) GetGenericName() string { | |
| 184 | 190 | ||
| 185 | - | return xDesktopAppInfoGetGenericName(x.GoPointer()) | |
| 186 | - | ||
| 191 | + | cret := xDesktopAppInfoGetGenericName(x.GoPointer()) | |
| 192 | + | return cret | |
| 187 | 193 | } | |
| 188 | 194 | ||
| 189 | 195 | var xDesktopAppInfoGetIsHidden func(uintptr) bool | |
| @@ -192,8 +198,8 @@ var xDesktopAppInfoGetIsHidden func(uintptr) bool | |||
| 192 | 198 | // set to True. | |
| 193 | 199 | func (x *DesktopAppInfo) GetIsHidden() bool { | |
| 194 | 200 | ||
| 195 | - | return xDesktopAppInfoGetIsHidden(x.GoPointer()) | |
| 196 | - | ||
| 201 | + | cret := xDesktopAppInfoGetIsHidden(x.GoPointer()) | |
| 202 | + | return cret | |
| 197 | 203 | } | |
| 198 | 204 | ||
| 199 | 205 | var xDesktopAppInfoGetKeywords func(uintptr) uintptr | |
| @@ -201,8 +207,8 @@ var xDesktopAppInfoGetKeywords func(uintptr) uintptr | |||
| 201 | 207 | // Gets the keywords from the desktop file. | |
| 202 | 208 | func (x *DesktopAppInfo) GetKeywords() uintptr { | |
| 203 | 209 | ||
| 204 | - | return xDesktopAppInfoGetKeywords(x.GoPointer()) | |
| 205 | - | ||
| 210 | + | cret := xDesktopAppInfoGetKeywords(x.GoPointer()) | |
| 211 | + | return cret | |
| 206 | 212 | } | |
| 207 | 213 | ||
| 208 | 214 | var xDesktopAppInfoGetLocaleString func(uintptr, string) string | |
| @@ -213,8 +219,8 @@ var xDesktopAppInfoGetLocaleString func(uintptr, string) string | |||
| 213 | 219 | // The @key is looked up in the "Desktop Entry" group. | |
| 214 | 220 | func (x *DesktopAppInfo) GetLocaleString(KeyVar string) string { | |
| 215 | 221 | ||
| 216 | - | return xDesktopAppInfoGetLocaleString(x.GoPointer(), KeyVar) | |
| 217 | - | ||
| 222 | + | cret := xDesktopAppInfoGetLocaleString(x.GoPointer(), KeyVar) | |
| 223 | + | return cret | |
| 218 | 224 | } | |
| 219 | 225 | ||
| 220 | 226 | var xDesktopAppInfoGetNodisplay func(uintptr) bool | |
| @@ -224,8 +230,8 @@ var xDesktopAppInfoGetNodisplay func(uintptr) bool | |||
| 224 | 230 | // %G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show(). | |
| 225 | 231 | func (x *DesktopAppInfo) GetNodisplay() bool { | |
| 226 | 232 | ||
| 227 | - | return xDesktopAppInfoGetNodisplay(x.GoPointer()) | |
| 228 | - | ||
| 233 | + | cret := xDesktopAppInfoGetNodisplay(x.GoPointer()) | |
| 234 | + | return cret | |
| 229 | 235 | } | |
| 230 | 236 | ||
| 231 | 237 | var xDesktopAppInfoGetShowIn func(uintptr, string) bool | |
| @@ -243,8 +249,8 @@ var xDesktopAppInfoGetShowIn func(uintptr, string) bool | |||
| 243 | 249 | // %NULL for @desktop_env) as well as additional checks. | |
| 244 | 250 | func (x *DesktopAppInfo) GetShowIn(DesktopEnvVar string) bool { | |
| 245 | 251 | ||
| 246 | - | return xDesktopAppInfoGetShowIn(x.GoPointer(), DesktopEnvVar) | |
| 247 | - | ||
| 252 | + | cret := xDesktopAppInfoGetShowIn(x.GoPointer(), DesktopEnvVar) | |
| 253 | + | return cret | |
| 248 | 254 | } | |
| 249 | 255 | ||
| 250 | 256 | var xDesktopAppInfoGetStartupWmClass func(uintptr) string | |
| @@ -254,8 +260,8 @@ var xDesktopAppInfoGetStartupWmClass func(uintptr) string | |||
| 254 | 260 | // through @info. | |
| 255 | 261 | func (x *DesktopAppInfo) GetStartupWmClass() string { | |
| 256 | 262 | ||
| 257 | - | return xDesktopAppInfoGetStartupWmClass(x.GoPointer()) | |
| 258 | - | ||
| 263 | + | cret := xDesktopAppInfoGetStartupWmClass(x.GoPointer()) | |
| 264 | + | return cret | |
| 259 | 265 | } | |
| 260 | 266 | ||
| 261 | 267 | var xDesktopAppInfoGetString func(uintptr, string) string | |
| @@ -265,8 +271,8 @@ var xDesktopAppInfoGetString func(uintptr, string) string | |||
| 265 | 271 | // The @key is looked up in the "Desktop Entry" group. | |
| 266 | 272 | func (x *DesktopAppInfo) GetString(KeyVar string) string { | |
| 267 | 273 | ||
| 268 | - | return xDesktopAppInfoGetString(x.GoPointer(), KeyVar) | |
| 269 | - | ||
| 274 | + | cret := xDesktopAppInfoGetString(x.GoPointer(), KeyVar) | |
| 275 | + | return cret | |
| 270 | 276 | } | |
| 271 | 277 | ||
| 272 | 278 | var xDesktopAppInfoGetStringList func(uintptr, string, uint) uintptr | |
| @@ -276,8 +282,8 @@ var xDesktopAppInfoGetStringList func(uintptr, string, uint) uintptr | |||
| 276 | 282 | // The @key is looked up in the "Desktop Entry" group. | |
| 277 | 283 | func (x *DesktopAppInfo) GetStringList(KeyVar string, LengthVar uint) uintptr { | |
| 278 | 284 | ||
| 279 | - | return xDesktopAppInfoGetStringList(x.GoPointer(), KeyVar, LengthVar) | |
| 280 | - | ||
| 285 | + | cret := xDesktopAppInfoGetStringList(x.GoPointer(), KeyVar, LengthVar) | |
| 286 | + | return cret | |
| 281 | 287 | } | |
| 282 | 288 | ||
| 283 | 289 | var xDesktopAppInfoHasKey func(uintptr, string) bool | |
| @@ -286,8 +292,8 @@ var xDesktopAppInfoHasKey func(uintptr, string) bool | |||
| 286 | 292 | // of the keyfile backing @info. | |
| 287 | 293 | func (x *DesktopAppInfo) HasKey(KeyVar string) bool { | |
| 288 | 294 | ||
| 289 | - | return xDesktopAppInfoHasKey(x.GoPointer(), KeyVar) | |
| 290 | - | ||
| 295 | + | cret := xDesktopAppInfoHasKey(x.GoPointer(), KeyVar) | |
| 296 | + | return cret | |
| 291 | 297 | } | |
| 292 | 298 | ||
| 293 | 299 | var xDesktopAppInfoLaunchAction func(uintptr, string, uintptr) | |
| @@ -313,7 +319,7 @@ func (x *DesktopAppInfo) LaunchAction(ActionNameVar string, LaunchContextVar *Ap | |||
| 313 | 319 | ||
| 314 | 320 | } | |
| 315 | 321 | ||
| 316 | - | var xDesktopAppInfoLaunchUrisAsManager func(uintptr, *glib.List, uintptr, glib.SpawnFlags, uintptr, uintptr, uintptr, uintptr) bool | |
| 322 | + | var xDesktopAppInfoLaunchUrisAsManager func(uintptr, *glib.List, uintptr, glib.SpawnFlags, uintptr, uintptr, uintptr, uintptr, **glib.Error) bool | |
| 317 | 323 | ||
| 318 | 324 | // This function performs the equivalent of g_app_info_launch_uris(), | |
| 319 | 325 | // but is intended primarily for operating system components that | |
| @@ -330,13 +336,18 @@ var xDesktopAppInfoLaunchUrisAsManager func(uintptr, *glib.List, uintptr, glib.S | |||
| 330 | 336 | // If application launching occurs via some other mechanism (eg: D-Bus | |
| 331 | 337 | // activation) then @spawn_flags, @user_setup, @user_setup_data, | |
| 332 | 338 | // @pid_callback and @pid_callback_data are ignored. | |
| 333 | - | func (x *DesktopAppInfo) LaunchUrisAsManager(UrisVar *glib.List, LaunchContextVar *AppLaunchContext, SpawnFlagsVar glib.SpawnFlags, UserSetupVar glib.SpawnChildSetupFunc, UserSetupDataVar uintptr, PidCallbackVar DesktopAppLaunchCallback, PidCallbackDataVar uintptr) bool { | |
| 339 | + | func (x *DesktopAppInfo) LaunchUrisAsManager(UrisVar *glib.List, LaunchContextVar *AppLaunchContext, SpawnFlagsVar glib.SpawnFlags, UserSetupVar glib.SpawnChildSetupFunc, UserSetupDataVar uintptr, PidCallbackVar DesktopAppLaunchCallback, PidCallbackDataVar uintptr) (bool, error) { | |
| 340 | + | var cerr *glib.Error | |
| 334 | 341 | ||
| 335 | - | return xDesktopAppInfoLaunchUrisAsManager(x.GoPointer(), UrisVar, LaunchContextVar.GoPointer(), SpawnFlagsVar, purego.NewCallback(UserSetupVar), UserSetupDataVar, purego.NewCallback(PidCallbackVar), PidCallbackDataVar) | |
| 342 | + | cret := xDesktopAppInfoLaunchUrisAsManager(x.GoPointer(), UrisVar, LaunchContextVar.GoPointer(), SpawnFlagsVar, purego.NewCallback(UserSetupVar), UserSetupDataVar, purego.NewCallback(PidCallbackVar), PidCallbackDataVar, &cerr) | |
| 343 | + | if cerr == nil { | |
| 344 | + | return cret, nil | |
| 345 | + | } | |
| 346 | + | return cret, cerr | |
| 336 | 347 | ||
| 337 | 348 | } | |
| 338 | 349 | ||
| 339 | - | var xDesktopAppInfoLaunchUrisAsManagerWithFds func(uintptr, *glib.List, uintptr, glib.SpawnFlags, uintptr, uintptr, uintptr, uintptr, int, int, int) bool | |
| 350 | + | var xDesktopAppInfoLaunchUrisAsManagerWithFds func(uintptr, *glib.List, uintptr, glib.SpawnFlags, uintptr, uintptr, uintptr, uintptr, int, int, int, **glib.Error) bool | |
| 340 | 351 | ||
| 341 | 352 | // Equivalent to g_desktop_app_info_launch_uris_as_manager() but allows | |
| 342 | 353 | // you to pass in file descriptors for the stdin, stdout and stderr streams | |
| @@ -344,9 +355,14 @@ var xDesktopAppInfoLaunchUrisAsManagerWithFds func(uintptr, *glib.List, uintptr, | |||
| 344 | 355 | // | |
| 345 | 356 | // If application launching occurs via some non-spawn mechanism (e.g. D-Bus | |
| 346 | 357 | // activation) then @stdin_fd, @stdout_fd and @stderr_fd are ignored. | |
| 347 | - | func (x *DesktopAppInfo) LaunchUrisAsManagerWithFds(UrisVar *glib.List, LaunchContextVar *AppLaunchContext, SpawnFlagsVar glib.SpawnFlags, UserSetupVar glib.SpawnChildSetupFunc, UserSetupDataVar uintptr, PidCallbackVar DesktopAppLaunchCallback, PidCallbackDataVar uintptr, StdinFdVar int, StdoutFdVar int, StderrFdVar int) bool { | |
| 358 | + | func (x *DesktopAppInfo) LaunchUrisAsManagerWithFds(UrisVar *glib.List, LaunchContextVar *AppLaunchContext, SpawnFlagsVar glib.SpawnFlags, UserSetupVar glib.SpawnChildSetupFunc, UserSetupDataVar uintptr, PidCallbackVar DesktopAppLaunchCallback, PidCallbackDataVar uintptr, StdinFdVar int, StdoutFdVar int, StderrFdVar int) (bool, error) { | |
| 359 | + | var cerr *glib.Error | |
| 348 | 360 | ||
| 349 | - | return xDesktopAppInfoLaunchUrisAsManagerWithFds(x.GoPointer(), UrisVar, LaunchContextVar.GoPointer(), SpawnFlagsVar, purego.NewCallback(UserSetupVar), UserSetupDataVar, purego.NewCallback(PidCallbackVar), PidCallbackDataVar, StdinFdVar, StdoutFdVar, StderrFdVar) | |
| 361 | + | cret := xDesktopAppInfoLaunchUrisAsManagerWithFds(x.GoPointer(), UrisVar, LaunchContextVar.GoPointer(), SpawnFlagsVar, purego.NewCallback(UserSetupVar), UserSetupDataVar, purego.NewCallback(PidCallbackVar), PidCallbackDataVar, StdinFdVar, StdoutFdVar, StderrFdVar, &cerr) | |
| 362 | + | if cerr == nil { | |
| 363 | + | return cret, nil | |
| 364 | + | } | |
| 365 | + | return cret, cerr | |
| 350 | 366 | ||
| 351 | 367 | } | |
| 352 | 368 | ||
| @@ -359,8 +375,8 @@ var xDesktopAppInfoListActions func(uintptr) uintptr | |||
| 359 | 375 | // explicitly listed in the "Actions" key of the [Desktop Entry] group. | |
| 360 | 376 | func (x *DesktopAppInfo) ListActions() uintptr { | |
| 361 | 377 | ||
| 362 | - | return xDesktopAppInfoListActions(x.GoPointer()) | |
| 363 | - | ||
| 378 | + | cret := xDesktopAppInfoListActions(x.GoPointer()) | |
| 379 | + | return cret | |
| 364 | 380 | } | |
| 365 | 381 | ||
| 366 | 382 | func (c *DesktopAppInfo) GoPointer() uintptr { | |
| @@ -373,9 +389,14 @@ func (c *DesktopAppInfo) SetGoPointer(ptr uintptr) { | |||
| 373 | 389 | ||
| 374 | 390 | // Adds a content type to the application information to indicate the | |
| 375 | 391 | // application is capable of opening files with the given content type. | |
| 376 | - | func (x *DesktopAppInfo) AddSupportsType(ContentTypeVar string) bool { | |
| 392 | + | func (x *DesktopAppInfo) AddSupportsType(ContentTypeVar string) (bool, error) { | |
| 393 | + | var cerr *glib.Error | |
| 377 | 394 | ||
| 378 | - | return XGAppInfoAddSupportsType(x.GoPointer(), ContentTypeVar) | |
| 395 | + | cret := XGAppInfoAddSupportsType(x.GoPointer(), ContentTypeVar, &cerr) | |
| 396 | + | if cerr == nil { | |
| 397 | + | return cret, nil | |
| 398 | + | } | |
| 399 | + | return cret, cerr | |
| 379 | 400 | ||
| 380 | 401 | } | |
| 381 | 402 | ||
| @@ -383,15 +404,15 @@ func (x *DesktopAppInfo) AddSupportsType(ContentTypeVar string) bool { | |||
| 383 | 404 | // See g_app_info_delete(). | |
| 384 | 405 | func (x *DesktopAppInfo) CanDelete() bool { | |
| 385 | 406 | ||
| 386 | - | return XGAppInfoCanDelete(x.GoPointer()) | |
| 387 | - | ||
| 407 | + | cret := XGAppInfoCanDelete(x.GoPointer()) | |
| 408 | + | return cret | |
| 388 | 409 | } | |
| 389 | 410 | ||
| 390 | 411 | // Checks if a supported content type can be removed from an application. | |
| 391 | 412 | func (x *DesktopAppInfo) CanRemoveSupportsType() bool { | |
| 392 | 413 | ||
| 393 | - | return XGAppInfoCanRemoveSupportsType(x.GoPointer()) | |
| 394 | - | ||
| 414 | + | cret := XGAppInfoCanRemoveSupportsType(x.GoPointer()) | |
| 415 | + | return cret | |
| 395 | 416 | } | |
| 396 | 417 | ||
| 397 | 418 | // Tries to delete a #GAppInfo. | |
| @@ -401,22 +422,22 @@ func (x *DesktopAppInfo) CanRemoveSupportsType() bool { | |||
| 401 | 422 | // See g_app_info_can_delete(). | |
| 402 | 423 | func (x *DesktopAppInfo) Delete() bool { | |
| 403 | 424 | ||
| 404 | - | return XGAppInfoDelete(x.GoPointer()) | |
| 405 | - | ||
| 425 | + | cret := XGAppInfoDelete(x.GoPointer()) | |
| 426 | + | return cret | |
| 406 | 427 | } | |
| 407 | 428 | ||
| 408 | 429 | // Creates a duplicate of a #GAppInfo. | |
| 409 | 430 | func (x *DesktopAppInfo) Dup() *AppInfoBase { | |
| 431 | + | var cls *AppInfoBase | |
| 410 | 432 | ||
| 411 | - | DupPtr := XGAppInfoDup(x.GoPointer()) | |
| 412 | - | if DupPtr == 0 { | |
| 413 | - | return nil | |
| 414 | - | } | |
| 415 | - | ||
| 416 | - | DupCls := &AppInfoBase{} | |
| 417 | - | DupCls.Ptr = DupPtr | |
| 418 | - | return DupCls | |
| 433 | + | cret := XGAppInfoDup(x.GoPointer()) | |
| 419 | 434 | ||
| 435 | + | if cret == 0 { | |
| 436 | + | return cls | |
| 437 | + | } | |
| 438 | + | cls = &AppInfoBase{} | |
| 439 | + | cls.Ptr = cret | |
| 440 | + | return cls | |
| 420 | 441 | } | |
| 421 | 442 | ||
| 422 | 443 | // Checks if two #GAppInfos are equal. | |
| @@ -426,54 +447,53 @@ func (x *DesktopAppInfo) Dup() *AppInfoBase { | |||
| 426 | 447 | // contents is needed, program code must additionally compare relevant fields. | |
| 427 | 448 | func (x *DesktopAppInfo) Equal(Appinfo2Var AppInfo) bool { | |
| 428 | 449 | ||
| 429 | - | return XGAppInfoEqual(x.GoPointer(), Appinfo2Var.GoPointer()) | |
| 430 | - | ||
| 450 | + | cret := XGAppInfoEqual(x.GoPointer(), Appinfo2Var.GoPointer()) | |
| 451 | + | return cret | |
| 431 | 452 | } | |
| 432 | 453 | ||
| 433 | 454 | // Gets the commandline with which the application will be | |
| 434 | 455 | // started. | |
| 435 | 456 | func (x *DesktopAppInfo) GetCommandline() string { | |
| 436 | 457 | ||
| 437 | - | return XGAppInfoGetCommandline(x.GoPointer()) | |
| 438 | - | ||
| 458 | + | cret := XGAppInfoGetCommandline(x.GoPointer()) | |
| 459 | + | return cret | |
| 439 | 460 | } | |
| 440 | 461 | ||
| 441 | 462 | // Gets a human-readable description of an installed application. | |
| 442 | 463 | func (x *DesktopAppInfo) GetDescription() string { | |
| 443 | 464 | ||
| 444 | - | return XGAppInfoGetDescription(x.GoPointer()) | |
| 445 | - | ||
| 465 | + | cret := XGAppInfoGetDescription(x.GoPointer()) | |
| 466 | + | return cret | |
| 446 | 467 | } | |
| 447 | 468 | ||
| 448 | 469 | // Gets the display name of the application. The display name is often more | |
| 449 | 470 | // descriptive to the user than the name itself. | |
| 450 | 471 | func (x *DesktopAppInfo) GetDisplayName() string { | |
| 451 | 472 | ||
| 452 | - | return XGAppInfoGetDisplayName(x.GoPointer()) | |
| 453 | - | ||
| 473 | + | cret := XGAppInfoGetDisplayName(x.GoPointer()) | |
| 474 | + | return cret | |
| 454 | 475 | } | |
| 455 | 476 | ||
| 456 | 477 | // Gets the executable's name for the installed application. | |
| 457 | 478 | func (x *DesktopAppInfo) GetExecutable() string { | |
| 458 | 479 | ||
| 459 | - | return XGAppInfoGetExecutable(x.GoPointer()) | |
| 460 | - | ||
| 480 | + | cret := XGAppInfoGetExecutable(x.GoPointer()) | |
| 481 | + | return cret | |
| 461 | 482 | } | |
| 462 | 483 | ||
| 463 | 484 | // Gets the icon for the application. | |
| 464 | 485 | func (x *DesktopAppInfo) GetIcon() *IconBase { | |
| 486 | + | var cls *IconBase | |
| 465 | 487 | ||
| 466 | - | GetIconPtr := XGAppInfoGetIcon(x.GoPointer()) | |
| 467 | - | if GetIconPtr == 0 { | |
| 468 | - | return nil | |
| 469 | - | } | |
| 470 | - | ||
| 471 | - | gobject.IncreaseRef(GetIconPtr) | |
| 472 | - | ||
| 473 | - | GetIconCls := &IconBase{} | |
| 474 | - | GetIconCls.Ptr = GetIconPtr | |
| 475 | - | return GetIconCls | |
| 488 | + | cret := XGAppInfoGetIcon(x.GoPointer()) | |
| 476 | 489 | ||
| 490 | + | if cret == 0 { | |
| 491 | + | return cls | |
| 492 | + | } | |
| 493 | + | gobject.IncreaseRef(cret) | |
| 494 | + | cls = &IconBase{} | |
| 495 | + | cls.Ptr = cret | |
| 496 | + | return cls | |
| 477 | 497 | } | |
| 478 | 498 | ||
| 479 | 499 | // Gets the ID of an application. An id is a string that | |
| @@ -485,15 +505,15 @@ func (x *DesktopAppInfo) GetIcon() *IconBase { | |||
| 485 | 505 | // the @appinfo has been constructed. | |
| 486 | 506 | func (x *DesktopAppInfo) GetId() string { | |
| 487 | 507 | ||
| 488 | - | return XGAppInfoGetId(x.GoPointer()) | |
| 489 | - | ||
| 508 | + | cret := XGAppInfoGetId(x.GoPointer()) | |
| 509 | + | return cret | |
| 490 | 510 | } | |
| 491 | 511 | ||
| 492 | 512 | // Gets the installed name of the application. | |
| 493 | 513 | func (x *DesktopAppInfo) GetName() string { | |
| 494 | 514 | ||
| 495 | - | return XGAppInfoGetName(x.GoPointer()) | |
| 496 | - | ||
| 515 | + | cret := XGAppInfoGetName(x.GoPointer()) | |
| 516 | + | return cret | |
| 497 | 517 | } | |
| 498 | 518 | ||
| 499 | 519 | // Retrieves the list of content types that @app_info claims to support. | |
| @@ -504,8 +524,8 @@ func (x *DesktopAppInfo) GetName() string { | |||
| 504 | 524 | // the application. | |
| 505 | 525 | func (x *DesktopAppInfo) GetSupportedTypes() uintptr { | |
| 506 | 526 | ||
| 507 | - | return XGAppInfoGetSupportedTypes(x.GoPointer()) | |
| 508 | - | ||
| 527 | + | cret := XGAppInfoGetSupportedTypes(x.GoPointer()) | |
| 528 | + | return cret | |
| 509 | 529 | } | |
| 510 | 530 | ||
| 511 | 531 | // Launches the application. Passes @files to the launched application | |
| @@ -535,9 +555,14 @@ func (x *DesktopAppInfo) GetSupportedTypes() uintptr { | |||
| 535 | 555 | // should it be inherited by further processes. The `DISPLAY` and | |
| 536 | 556 | // `DESKTOP_STARTUP_ID` environment variables are also set, based | |
| 537 | 557 | // on information provided in @context. | |
| 538 | - | func (x *DesktopAppInfo) Launch(FilesVar *glib.List, ContextVar *AppLaunchContext) bool { | |
| 558 | + | func (x *DesktopAppInfo) Launch(FilesVar *glib.List, ContextVar *AppLaunchContext) (bool, error) { | |
| 559 | + | var cerr *glib.Error | |
| 539 | 560 | ||
| 540 | - | return XGAppInfoLaunch(x.GoPointer(), FilesVar, ContextVar.GoPointer()) | |
| 561 | + | cret := XGAppInfoLaunch(x.GoPointer(), FilesVar, ContextVar.GoPointer(), &cerr) | |
| 562 | + | if cerr == nil { | |
| 563 | + | return cret, nil | |
| 564 | + | } | |
| 565 | + | return cret, cerr | |
| 541 | 566 | ||
| 542 | 567 | } | |
| 543 | 568 | ||
| @@ -551,9 +576,14 @@ func (x *DesktopAppInfo) Launch(FilesVar *glib.List, ContextVar *AppLaunchContex | |||
| 551 | 576 | // Note that even if the launch is successful the application launched | |
| 552 | 577 | // can fail to start if it runs into problems during startup. There is | |
| 553 | 578 | // no way to detect this. | |
| 554 | - | func (x *DesktopAppInfo) LaunchUris(UrisVar *glib.List, ContextVar *AppLaunchContext) bool { | |
| 579 | + | func (x *DesktopAppInfo) LaunchUris(UrisVar *glib.List, ContextVar *AppLaunchContext) (bool, error) { | |
| 580 | + | var cerr *glib.Error | |
| 555 | 581 | ||
| 556 | - | return XGAppInfoLaunchUris(x.GoPointer(), UrisVar, ContextVar.GoPointer()) | |
| 582 | + | cret := XGAppInfoLaunchUris(x.GoPointer(), UrisVar, ContextVar.GoPointer(), &cerr) | |
| 583 | + | if cerr == nil { | |
| 584 | + | return cret, nil | |
| 585 | + | } | |
| 586 | + | return cret, cerr | |
| 557 | 587 | ||
| 558 | 588 | } | |
| 559 | 589 | ||
| @@ -570,30 +600,50 @@ func (x *DesktopAppInfo) LaunchUrisAsync(UrisVar *glib.List, ContextVar *AppLaun | |||
| 570 | 600 | } | |
| 571 | 601 | ||
| 572 | 602 | // Finishes a g_app_info_launch_uris_async() operation. | |
| 573 | - | func (x *DesktopAppInfo) LaunchUrisFinish(ResultVar AsyncResult) bool { | |
| 603 | + | func (x *DesktopAppInfo) LaunchUrisFinish(ResultVar AsyncResult) (bool, error) { | |
| 604 | + | var cerr *glib.Error | |
| 574 | 605 | ||
| 575 | - | return XGAppInfoLaunchUrisFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 606 | + | cret := XGAppInfoLaunchUrisFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 607 | + | if cerr == nil { | |
| 608 | + | return cret, nil | |
| 609 | + | } | |
| 610 | + | return cret, cerr | |
| 576 | 611 | ||
| 577 | 612 | } | |
| 578 | 613 | ||
| 579 | 614 | // Removes a supported type from an application, if possible. | |
| 580 | - | func (x *DesktopAppInfo) RemoveSupportsType(ContentTypeVar string) bool { | |
| 615 | + | func (x *DesktopAppInfo) RemoveSupportsType(ContentTypeVar string) (bool, error) { | |
| 616 | + | var cerr *glib.Error | |
| 581 | 617 | ||
| 582 | - | return XGAppInfoRemoveSupportsType(x.GoPointer(), ContentTypeVar) | |
| 618 | + | cret := XGAppInfoRemoveSupportsType(x.GoPointer(), ContentTypeVar, &cerr) | |
| 619 | + | if cerr == nil { | |
| 620 | + | return cret, nil | |
| 621 | + | } | |
| 622 | + | return cret, cerr | |
| 583 | 623 | ||
| 584 | 624 | } | |
| 585 | 625 | ||
| 586 | 626 | // Sets the application as the default handler for the given file extension. | |
| 587 | - | func (x *DesktopAppInfo) SetAsDefaultForExtension(ExtensionVar string) bool { | |
| 627 | + | func (x *DesktopAppInfo) SetAsDefaultForExtension(ExtensionVar string) (bool, error) { | |
| 628 | + | var cerr *glib.Error | |
| 588 | 629 | ||
| 589 | - | return XGAppInfoSetAsDefaultForExtension(x.GoPointer(), ExtensionVar) | |
| 630 | + | cret := XGAppInfoSetAsDefaultForExtension(x.GoPointer(), ExtensionVar, &cerr) | |
| 631 | + | if cerr == nil { | |
| 632 | + | return cret, nil | |
| 633 | + | } | |
| 634 | + | return cret, cerr | |
| 590 | 635 | ||
| 591 | 636 | } | |
| 592 | 637 | ||
| 593 | 638 | // Sets the application as the default handler for a given type. | |
| 594 | - | func (x *DesktopAppInfo) SetAsDefaultForType(ContentTypeVar string) bool { | |
| 639 | + | func (x *DesktopAppInfo) SetAsDefaultForType(ContentTypeVar string) (bool, error) { | |
| 640 | + | var cerr *glib.Error | |
| 595 | 641 | ||
| 596 | - | return XGAppInfoSetAsDefaultForType(x.GoPointer(), ContentTypeVar) | |
| 642 | + | cret := XGAppInfoSetAsDefaultForType(x.GoPointer(), ContentTypeVar, &cerr) | |
| 643 | + | if cerr == nil { | |
| 644 | + | return cret, nil | |
| 645 | + | } | |
| 646 | + | return cret, cerr | |
| 597 | 647 | ||
| 598 | 648 | } | |
| 599 | 649 | ||
| @@ -601,9 +651,14 @@ func (x *DesktopAppInfo) SetAsDefaultForType(ContentTypeVar string) bool { | |||
| 601 | 651 | // This will make the application appear as first in the list returned | |
| 602 | 652 | // by g_app_info_get_recommended_for_type(), regardless of the default | |
| 603 | 653 | // application for that content type. | |
| 604 | - | func (x *DesktopAppInfo) SetAsLastUsedForType(ContentTypeVar string) bool { | |
| 654 | + | func (x *DesktopAppInfo) SetAsLastUsedForType(ContentTypeVar string) (bool, error) { | |
| 655 | + | var cerr *glib.Error | |
| 605 | 656 | ||
| 606 | - | return XGAppInfoSetAsLastUsedForType(x.GoPointer(), ContentTypeVar) | |
| 657 | + | cret := XGAppInfoSetAsLastUsedForType(x.GoPointer(), ContentTypeVar, &cerr) | |
| 658 | + | if cerr == nil { | |
| 659 | + | return cret, nil | |
| 660 | + | } | |
| 661 | + | return cret, cerr | |
| 607 | 662 | ||
| 608 | 663 | } | |
| 609 | 664 | ||
| @@ -611,22 +666,22 @@ func (x *DesktopAppInfo) SetAsLastUsedForType(ContentTypeVar string) bool { | |||
| 611 | 666 | // list available applications. | |
| 612 | 667 | func (x *DesktopAppInfo) ShouldShow() bool { | |
| 613 | 668 | ||
| 614 | - | return XGAppInfoShouldShow(x.GoPointer()) | |
| 615 | - | ||
| 669 | + | cret := XGAppInfoShouldShow(x.GoPointer()) | |
| 670 | + | return cret | |
| 616 | 671 | } | |
| 617 | 672 | ||
| 618 | 673 | // Checks if the application accepts files as arguments. | |
| 619 | 674 | func (x *DesktopAppInfo) SupportsFiles() bool { | |
| 620 | 675 | ||
| 621 | - | return XGAppInfoSupportsFiles(x.GoPointer()) | |
| 622 | - | ||
| 676 | + | cret := XGAppInfoSupportsFiles(x.GoPointer()) | |
| 677 | + | return cret | |
| 623 | 678 | } | |
| 624 | 679 | ||
| 625 | 680 | // Checks if the application supports reading files and directories from URIs. | |
| 626 | 681 | func (x *DesktopAppInfo) SupportsUris() bool { | |
| 627 | 682 | ||
| 628 | - | return XGAppInfoSupportsUris(x.GoPointer()) | |
| 629 | - | ||
| 683 | + | cret := XGAppInfoSupportsUris(x.GoPointer()) | |
| 684 | + | return cret | |
| 630 | 685 | } | |
| 631 | 686 | ||
| 632 | 687 | func init() { | |
M v4/gio/gdrive.go +88 -63
| @@ -85,36 +85,36 @@ func (x *DriveBase) SetGoPointer(ptr uintptr) { | |||
| 85 | 85 | // Checks if a drive can be ejected. | |
| 86 | 86 | func (x *DriveBase) CanEject() bool { | |
| 87 | 87 | ||
| 88 | - | return XGDriveCanEject(x.GoPointer()) | |
| 89 | - | ||
| 88 | + | cret := XGDriveCanEject(x.GoPointer()) | |
| 89 | + | return cret | |
| 90 | 90 | } | |
| 91 | 91 | ||
| 92 | 92 | // Checks if a drive can be polled for media changes. | |
| 93 | 93 | func (x *DriveBase) CanPollForMedia() bool { | |
| 94 | 94 | ||
| 95 | - | return XGDriveCanPollForMedia(x.GoPointer()) | |
| 96 | - | ||
| 95 | + | cret := XGDriveCanPollForMedia(x.GoPointer()) | |
| 96 | + | return cret | |
| 97 | 97 | } | |
| 98 | 98 | ||
| 99 | 99 | // Checks if a drive can be started. | |
| 100 | 100 | func (x *DriveBase) CanStart() bool { | |
| 101 | 101 | ||
| 102 | - | return XGDriveCanStart(x.GoPointer()) | |
| 103 | - | ||
| 102 | + | cret := XGDriveCanStart(x.GoPointer()) | |
| 103 | + | return cret | |
| 104 | 104 | } | |
| 105 | 105 | ||
| 106 | 106 | // Checks if a drive can be started degraded. | |
| 107 | 107 | func (x *DriveBase) CanStartDegraded() bool { | |
| 108 | 108 | ||
| 109 | - | return XGDriveCanStartDegraded(x.GoPointer()) | |
| 110 | - | ||
| 109 | + | cret := XGDriveCanStartDegraded(x.GoPointer()) | |
| 110 | + | return cret | |
| 111 | 111 | } | |
| 112 | 112 | ||
| 113 | 113 | // Checks if a drive can be stopped. | |
| 114 | 114 | func (x *DriveBase) CanStop() bool { | |
| 115 | 115 | ||
| 116 | - | return XGDriveCanStop(x.GoPointer()) | |
| 117 | - | ||
| 116 | + | cret := XGDriveCanStop(x.GoPointer()) | |
| 117 | + | return cret | |
| 118 | 118 | } | |
| 119 | 119 | ||
| 120 | 120 | // Asynchronously ejects a drive. | |
| @@ -129,9 +129,14 @@ func (x *DriveBase) Eject(FlagsVar MountUnmountFlags, CancellableVar *Cancellabl | |||
| 129 | 129 | } | |
| 130 | 130 | ||
| 131 | 131 | // Finishes ejecting a drive. | |
| 132 | - | func (x *DriveBase) EjectFinish(ResultVar AsyncResult) bool { | |
| 132 | + | func (x *DriveBase) EjectFinish(ResultVar AsyncResult) (bool, error) { | |
| 133 | + | var cerr *glib.Error | |
| 133 | 134 | ||
| 134 | - | return XGDriveEjectFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 135 | + | cret := XGDriveEjectFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 136 | + | if cerr == nil { | |
| 137 | + | return cret, nil | |
| 138 | + | } | |
| 139 | + | return cret, cerr | |
| 135 | 140 | ||
| 136 | 141 | } | |
| 137 | 142 | ||
| @@ -146,9 +151,14 @@ func (x *DriveBase) EjectWithOperation(FlagsVar MountUnmountFlags, MountOperatio | |||
| 146 | 151 | ||
| 147 | 152 | // Finishes ejecting a drive. If any errors occurred during the operation, | |
| 148 | 153 | // @error will be set to contain the errors and %FALSE will be returned. | |
| 149 | - | func (x *DriveBase) EjectWithOperationFinish(ResultVar AsyncResult) bool { | |
| 154 | + | func (x *DriveBase) EjectWithOperationFinish(ResultVar AsyncResult) (bool, error) { | |
| 155 | + | var cerr *glib.Error | |
| 150 | 156 | ||
| 151 | - | return XGDriveEjectWithOperationFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 157 | + | cret := XGDriveEjectWithOperationFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 158 | + | if cerr == nil { | |
| 159 | + | return cret, nil | |
| 160 | + | } | |
| 161 | + | return cret, cerr | |
| 152 | 162 | ||
| 153 | 163 | } | |
| 154 | 164 | ||
| @@ -157,22 +167,22 @@ func (x *DriveBase) EjectWithOperationFinish(ResultVar AsyncResult) bool { | |||
| 157 | 167 | // themselves. | |
| 158 | 168 | func (x *DriveBase) EnumerateIdentifiers() []string { | |
| 159 | 169 | ||
| 160 | - | return XGDriveEnumerateIdentifiers(x.GoPointer()) | |
| 161 | - | ||
| 170 | + | cret := XGDriveEnumerateIdentifiers(x.GoPointer()) | |
| 171 | + | return cret | |
| 162 | 172 | } | |
| 163 | 173 | ||
| 164 | 174 | // Gets the icon for @drive. | |
| 165 | 175 | func (x *DriveBase) GetIcon() *IconBase { | |
| 176 | + | var cls *IconBase | |
| 166 | 177 | ||
| 167 | - | GetIconPtr := XGDriveGetIcon(x.GoPointer()) | |
| 168 | - | if GetIconPtr == 0 { | |
| 169 | - | return nil | |
| 170 | - | } | |
| 171 | - | ||
| 172 | - | GetIconCls := &IconBase{} | |
| 173 | - | GetIconCls.Ptr = GetIconPtr | |
| 174 | - | return GetIconCls | |
| 178 | + | cret := XGDriveGetIcon(x.GoPointer()) | |
| 175 | 179 | ||
| 180 | + | if cret == 0 { | |
| 181 | + | return cls | |
| 182 | + | } | |
| 183 | + | cls = &IconBase{} | |
| 184 | + | cls.Ptr = cret | |
| 185 | + | return cls | |
| 176 | 186 | } | |
| 177 | 187 | ||
| 178 | 188 | // Gets the identifier of the given kind for @drive. The only | |
| @@ -180,43 +190,43 @@ func (x *DriveBase) GetIcon() *IconBase { | |||
| 180 | 190 | // %G_DRIVE_IDENTIFIER_KIND_UNIX_DEVICE. | |
| 181 | 191 | func (x *DriveBase) GetIdentifier(KindVar string) string { | |
| 182 | 192 | ||
| 183 | - | return XGDriveGetIdentifier(x.GoPointer(), KindVar) | |
| 184 | - | ||
| 193 | + | cret := XGDriveGetIdentifier(x.GoPointer(), KindVar) | |
| 194 | + | return cret | |
| 185 | 195 | } | |
| 186 | 196 | ||
| 187 | 197 | // Gets the name of @drive. | |
| 188 | 198 | func (x *DriveBase) GetName() string { | |
| 189 | 199 | ||
| 190 | - | return XGDriveGetName(x.GoPointer()) | |
| 191 | - | ||
| 200 | + | cret := XGDriveGetName(x.GoPointer()) | |
| 201 | + | return cret | |
| 192 | 202 | } | |
| 193 | 203 | ||
| 194 | 204 | // Gets the sort key for @drive, if any. | |
| 195 | 205 | func (x *DriveBase) GetSortKey() string { | |
| 196 | 206 | ||
| 197 | - | return XGDriveGetSortKey(x.GoPointer()) | |
| 198 | - | ||
| 207 | + | cret := XGDriveGetSortKey(x.GoPointer()) | |
| 208 | + | return cret | |
| 199 | 209 | } | |
| 200 | 210 | ||
| 201 | 211 | // Gets a hint about how a drive can be started/stopped. | |
| 202 | 212 | func (x *DriveBase) GetStartStopType() DriveStartStopType { | |
| 203 | 213 | ||
| 204 | - | return XGDriveGetStartStopType(x.GoPointer()) | |
| 205 | - | ||
| 214 | + | cret := XGDriveGetStartStopType(x.GoPointer()) | |
| 215 | + | return cret | |
| 206 | 216 | } | |
| 207 | 217 | ||
| 208 | 218 | // Gets the icon for @drive. | |
| 209 | 219 | func (x *DriveBase) GetSymbolicIcon() *IconBase { | |
| 220 | + | var cls *IconBase | |
| 210 | 221 | ||
| 211 | - | GetSymbolicIconPtr := XGDriveGetSymbolicIcon(x.GoPointer()) | |
| 212 | - | if GetSymbolicIconPtr == 0 { | |
| 213 | - | return nil | |
| 214 | - | } | |
| 215 | - | ||
| 216 | - | GetSymbolicIconCls := &IconBase{} | |
| 217 | - | GetSymbolicIconCls.Ptr = GetSymbolicIconPtr | |
| 218 | - | return GetSymbolicIconCls | |
| 222 | + | cret := XGDriveGetSymbolicIcon(x.GoPointer()) | |
| 219 | 223 | ||
| 224 | + | if cret == 0 { | |
| 225 | + | return cls | |
| 226 | + | } | |
| 227 | + | cls = &IconBase{} | |
| 228 | + | cls.Ptr = cret | |
| 229 | + | return cls | |
| 220 | 230 | } | |
| 221 | 231 | ||
| 222 | 232 | // Get a list of mountable volumes for @drive. | |
| @@ -225,8 +235,8 @@ func (x *DriveBase) GetSymbolicIcon() *IconBase { | |||
| 225 | 235 | // its elements have been unreffed with g_object_unref(). | |
| 226 | 236 | func (x *DriveBase) GetVolumes() *glib.List { | |
| 227 | 237 | ||
| 228 | - | return XGDriveGetVolumes(x.GoPointer()) | |
| 229 | - | ||
| 238 | + | cret := XGDriveGetVolumes(x.GoPointer()) | |
| 239 | + | return cret | |
| 230 | 240 | } | |
| 231 | 241 | ||
| 232 | 242 | // Checks if the @drive has media. Note that the OS may not be polling | |
| @@ -234,37 +244,37 @@ func (x *DriveBase) GetVolumes() *glib.List { | |||
| 234 | 244 | // for more details. | |
| 235 | 245 | func (x *DriveBase) HasMedia() bool { | |
| 236 | 246 | ||
| 237 | - | return XGDriveHasMedia(x.GoPointer()) | |
| 238 | - | ||
| 247 | + | cret := XGDriveHasMedia(x.GoPointer()) | |
| 248 | + | return cret | |
| 239 | 249 | } | |
| 240 | 250 | ||
| 241 | 251 | // Check if @drive has any mountable volumes. | |
| 242 | 252 | func (x *DriveBase) HasVolumes() bool { | |
| 243 | 253 | ||
| 244 | - | return XGDriveHasVolumes(x.GoPointer()) | |
| 245 | - | ||
| 254 | + | cret := XGDriveHasVolumes(x.GoPointer()) | |
| 255 | + | return cret | |
| 246 | 256 | } | |
| 247 | 257 | ||
| 248 | 258 | // Checks if @drive is capable of automatically detecting media changes. | |
| 249 | 259 | func (x *DriveBase) IsMediaCheckAutomatic() bool { | |
| 250 | 260 | ||
| 251 | - | return XGDriveIsMediaCheckAutomatic(x.GoPointer()) | |
| 252 | - | ||
| 261 | + | cret := XGDriveIsMediaCheckAutomatic(x.GoPointer()) | |
| 262 | + | return cret | |
| 253 | 263 | } | |
| 254 | 264 | ||
| 255 | 265 | // Checks if the @drive supports removable media. | |
| 256 | 266 | func (x *DriveBase) IsMediaRemovable() bool { | |
| 257 | 267 | ||
| 258 | - | return XGDriveIsMediaRemovable(x.GoPointer()) | |
| 259 | - | ||
| 268 | + | cret := XGDriveIsMediaRemovable(x.GoPointer()) | |
| 269 | + | return cret | |
| 260 | 270 | } | |
| 261 | 271 | ||
| 262 | 272 | // Checks if the #GDrive and/or its media is considered removable by the user. | |
| 263 | 273 | // See g_drive_is_media_removable(). | |
| 264 | 274 | func (x *DriveBase) IsRemovable() bool { | |
| 265 | 275 | ||
| 266 | - | return XGDriveIsRemovable(x.GoPointer()) | |
| 267 | - | ||
| 276 | + | cret := XGDriveIsRemovable(x.GoPointer()) | |
| 277 | + | return cret | |
| 268 | 278 | } | |
| 269 | 279 | ||
| 270 | 280 | // Asynchronously polls @drive to see if media has been inserted or removed. | |
| @@ -279,9 +289,14 @@ func (x *DriveBase) PollForMedia(CancellableVar *Cancellable, CallbackVar AsyncR | |||
| 279 | 289 | } | |
| 280 | 290 | ||
| 281 | 291 | // Finishes an operation started with g_drive_poll_for_media() on a drive. | |
| 282 | - | func (x *DriveBase) PollForMediaFinish(ResultVar AsyncResult) bool { | |
| 292 | + | func (x *DriveBase) PollForMediaFinish(ResultVar AsyncResult) (bool, error) { | |
| 293 | + | var cerr *glib.Error | |
| 283 | 294 | ||
| 284 | - | return XGDrivePollForMediaFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 295 | + | cret := XGDrivePollForMediaFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 296 | + | if cerr == nil { | |
| 297 | + | return cret, nil | |
| 298 | + | } | |
| 299 | + | return cret, cerr | |
| 285 | 300 | ||
| 286 | 301 | } | |
| 287 | 302 | ||
| @@ -297,9 +312,14 @@ func (x *DriveBase) Start(FlagsVar DriveStartFlags, MountOperationVar *MountOper | |||
| 297 | 312 | } | |
| 298 | 313 | ||
| 299 | 314 | // Finishes starting a drive. | |
| 300 | - | func (x *DriveBase) StartFinish(ResultVar AsyncResult) bool { | |
| 315 | + | func (x *DriveBase) StartFinish(ResultVar AsyncResult) (bool, error) { | |
| 316 | + | var cerr *glib.Error | |
| 301 | 317 | ||
| 302 | - | return XGDriveStartFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 318 | + | cret := XGDriveStartFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 319 | + | if cerr == nil { | |
| 320 | + | return cret, nil | |
| 321 | + | } | |
| 322 | + | return cret, cerr | |
| 303 | 323 | ||
| 304 | 324 | } | |
| 305 | 325 | ||
| @@ -315,9 +335,14 @@ func (x *DriveBase) Stop(FlagsVar MountUnmountFlags, MountOperationVar *MountOpe | |||
| 315 | 335 | } | |
| 316 | 336 | ||
| 317 | 337 | // Finishes stopping a drive. | |
| 318 | - | func (x *DriveBase) StopFinish(ResultVar AsyncResult) bool { | |
| 338 | + | func (x *DriveBase) StopFinish(ResultVar AsyncResult) (bool, error) { | |
| 339 | + | var cerr *glib.Error | |
| 319 | 340 | ||
| 320 | - | return XGDriveStopFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 341 | + | cret := XGDriveStopFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 342 | + | if cerr == nil { | |
| 343 | + | return cret, nil | |
| 344 | + | } | |
| 345 | + | return cret, cerr | |
| 321 | 346 | ||
| 322 | 347 | } | |
| 323 | 348 | ||
| @@ -327,9 +352,9 @@ var XGDriveCanStart func(uintptr) bool | |||
| 327 | 352 | var XGDriveCanStartDegraded func(uintptr) bool | |
| 328 | 353 | var XGDriveCanStop func(uintptr) bool | |
| 329 | 354 | var XGDriveEject func(uintptr, MountUnmountFlags, uintptr, uintptr, uintptr) | |
| 330 | - | var XGDriveEjectFinish func(uintptr, uintptr) bool | |
| 355 | + | var XGDriveEjectFinish func(uintptr, uintptr, **glib.Error) bool | |
| 331 | 356 | var XGDriveEjectWithOperation func(uintptr, MountUnmountFlags, uintptr, uintptr, uintptr, uintptr) | |
| 332 | - | var XGDriveEjectWithOperationFinish func(uintptr, uintptr) bool | |
| 357 | + | var XGDriveEjectWithOperationFinish func(uintptr, uintptr, **glib.Error) bool | |
| 333 | 358 | var XGDriveEnumerateIdentifiers func(uintptr) []string | |
| 334 | 359 | var XGDriveGetIcon func(uintptr) uintptr | |
| 335 | 360 | var XGDriveGetIdentifier func(uintptr, string) string | |
| @@ -344,11 +369,11 @@ var XGDriveIsMediaCheckAutomatic func(uintptr) bool | |||
| 344 | 369 | var XGDriveIsMediaRemovable func(uintptr) bool | |
| 345 | 370 | var XGDriveIsRemovable func(uintptr) bool | |
| 346 | 371 | var XGDrivePollForMedia func(uintptr, uintptr, uintptr, uintptr) | |
| 347 | - | var XGDrivePollForMediaFinish func(uintptr, uintptr) bool | |
| 372 | + | var XGDrivePollForMediaFinish func(uintptr, uintptr, **glib.Error) bool | |
| 348 | 373 | var XGDriveStart func(uintptr, DriveStartFlags, uintptr, uintptr, uintptr, uintptr) | |
| 349 | - | var XGDriveStartFinish func(uintptr, uintptr) bool | |
| 374 | + | var XGDriveStartFinish func(uintptr, uintptr, **glib.Error) bool | |
| 350 | 375 | var XGDriveStop func(uintptr, MountUnmountFlags, uintptr, uintptr, uintptr, uintptr) | |
| 351 | - | var XGDriveStopFinish func(uintptr, uintptr) bool | |
| 376 | + | var XGDriveStopFinish func(uintptr, uintptr, **glib.Error) bool | |
| 352 | 377 | ||
| 353 | 378 | func init() { | |
| 354 | 379 | lib, err := purego.Dlopen(core.GetPath("GIO"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
M v4/gio/gdtlsclientconnection.go +27 -23
| @@ -45,31 +45,30 @@ func (x *DtlsClientConnectionBase) SetGoPointer(ptr uintptr) { | |||
| 45 | 45 | // subject DN of the certificate authority. | |
| 46 | 46 | func (x *DtlsClientConnectionBase) GetAcceptedCas() *glib.List { | |
| 47 | 47 | ||
| 48 | - | return XGDtlsClientConnectionGetAcceptedCas(x.GoPointer()) | |
| 49 | - | ||
| 48 | + | cret := XGDtlsClientConnectionGetAcceptedCas(x.GoPointer()) | |
| 49 | + | return cret | |
| 50 | 50 | } | |
| 51 | 51 | ||
| 52 | 52 | // Gets @conn's expected server identity | |
| 53 | 53 | func (x *DtlsClientConnectionBase) GetServerIdentity() *SocketConnectableBase { | |
| 54 | + | var cls *SocketConnectableBase | |
| 54 | 55 | ||
| 55 | - | GetServerIdentityPtr := XGDtlsClientConnectionGetServerIdentity(x.GoPointer()) | |
| 56 | - | if GetServerIdentityPtr == 0 { | |
| 57 | - | return nil | |
| 58 | - | } | |
| 59 | - | ||
| 60 | - | gobject.IncreaseRef(GetServerIdentityPtr) | |
| 61 | - | ||
| 62 | - | GetServerIdentityCls := &SocketConnectableBase{} | |
| 63 | - | GetServerIdentityCls.Ptr = GetServerIdentityPtr | |
| 64 | - | return GetServerIdentityCls | |
| 56 | + | cret := XGDtlsClientConnectionGetServerIdentity(x.GoPointer()) | |
| 65 | 57 | ||
| 58 | + | if cret == 0 { | |
| 59 | + | return cls | |
| 60 | + | } | |
| 61 | + | gobject.IncreaseRef(cret) | |
| 62 | + | cls = &SocketConnectableBase{} | |
| 63 | + | cls.Ptr = cret | |
| 64 | + | return cls | |
| 66 | 65 | } | |
| 67 | 66 | ||
| 68 | 67 | // Gets @conn's validation flags | |
| 69 | 68 | func (x *DtlsClientConnectionBase) GetValidationFlags() TlsCertificateFlags { | |
| 70 | 69 | ||
| 71 | - | return XGDtlsClientConnectionGetValidationFlags(x.GoPointer()) | |
| 72 | - | ||
| 70 | + | cret := XGDtlsClientConnectionGetValidationFlags(x.GoPointer()) | |
| 71 | + | return cret | |
| 73 | 72 | } | |
| 74 | 73 | ||
| 75 | 74 | // Sets @conn's expected server identity, which is used both to tell | |
| @@ -97,20 +96,25 @@ var XGDtlsClientConnectionGetValidationFlags func(uintptr) TlsCertificateFlags | |||
| 97 | 96 | var XGDtlsClientConnectionSetServerIdentity func(uintptr, uintptr) | |
| 98 | 97 | var XGDtlsClientConnectionSetValidationFlags func(uintptr, TlsCertificateFlags) | |
| 99 | 98 | ||
| 100 | - | var xDtlsClientConnectionNew func(uintptr, uintptr) uintptr | |
| 99 | + | var xDtlsClientConnectionNew func(uintptr, uintptr, **glib.Error) uintptr | |
| 101 | 100 | ||
| 102 | 101 | // Creates a new #GDtlsClientConnection wrapping @base_socket which is | |
| 103 | 102 | // assumed to communicate with the server identified by @server_identity. | |
| 104 | - | func DtlsClientConnectionNew(BaseSocketVar DatagramBased, ServerIdentityVar SocketConnectable) *DtlsClientConnectionBase { | |
| 103 | + | func DtlsClientConnectionNew(BaseSocketVar DatagramBased, ServerIdentityVar SocketConnectable) (*DtlsClientConnectionBase, error) { | |
| 104 | + | var cls *DtlsClientConnectionBase | |
| 105 | + | var cerr *glib.Error | |
| 105 | 106 | ||
| 106 | - | DtlsClientConnectionNewPtr := xDtlsClientConnectionNew(BaseSocketVar.GoPointer(), ServerIdentityVar.GoPointer()) | |
| 107 | - | if DtlsClientConnectionNewPtr == 0 { | |
| 108 | - | return nil | |
| 109 | - | } | |
| 107 | + | cret := xDtlsClientConnectionNew(BaseSocketVar.GoPointer(), ServerIdentityVar.GoPointer(), &cerr) | |
| 110 | 108 | ||
| 111 | - | DtlsClientConnectionNewCls := &DtlsClientConnectionBase{} | |
| 112 | - | DtlsClientConnectionNewCls.Ptr = DtlsClientConnectionNewPtr | |
| 113 | - | return DtlsClientConnectionNewCls | |
| 109 | + | if cret == 0 { | |
| 110 | + | return cls, cerr | |
| 111 | + | } | |
| 112 | + | cls = &DtlsClientConnectionBase{} | |
| 113 | + | cls.Ptr = cret | |
| 114 | + | if cerr == nil { | |
| 115 | + | return cls, nil | |
| 116 | + | } | |
| 117 | + | return cls, cerr | |
| 114 | 118 | ||
| 115 | 119 | } | |
| 116 | 120 | ||
M v4/gio/gdtlsconnection.go +107 -75
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -93,9 +94,14 @@ func (x *DtlsConnectionBase) SetGoPointer(ptr uintptr) { | |||
| 93 | 94 | // If @cancellable is cancelled, the #GDtlsConnection may be left | |
| 94 | 95 | // partially-closed and any pending untransmitted data may be lost. Call | |
| 95 | 96 | // g_dtls_connection_close() again to complete closing the #GDtlsConnection. | |
| 96 | - | func (x *DtlsConnectionBase) Close(CancellableVar *Cancellable) bool { | |
| 97 | + | func (x *DtlsConnectionBase) Close(CancellableVar *Cancellable) (bool, error) { | |
| 98 | + | var cerr *glib.Error | |
| 97 | 99 | ||
| 98 | - | return XGDtlsConnectionClose(x.GoPointer(), CancellableVar.GoPointer()) | |
| 100 | + | cret := XGDtlsConnectionClose(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 101 | + | if cerr == nil { | |
| 102 | + | return cret, nil | |
| 103 | + | } | |
| 104 | + | return cret, cerr | |
| 99 | 105 | ||
| 100 | 106 | } | |
| 101 | 107 | ||
| @@ -109,9 +115,14 @@ func (x *DtlsConnectionBase) CloseAsync(IoPriorityVar int, CancellableVar *Cance | |||
| 109 | 115 | ||
| 110 | 116 | // Finish an asynchronous TLS close operation. See g_dtls_connection_close() | |
| 111 | 117 | // for more information. | |
| 112 | - | func (x *DtlsConnectionBase) CloseFinish(ResultVar AsyncResult) bool { | |
| 118 | + | func (x *DtlsConnectionBase) CloseFinish(ResultVar AsyncResult) (bool, error) { | |
| 119 | + | var cerr *glib.Error | |
| 113 | 120 | ||
| 114 | - | return XGDtlsConnectionCloseFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 121 | + | cret := XGDtlsConnectionCloseFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 122 | + | if cerr == nil { | |
| 123 | + | return cret, nil | |
| 124 | + | } | |
| 125 | + | return cret, cerr | |
| 115 | 126 | ||
| 116 | 127 | } | |
| 117 | 128 | ||
| @@ -119,25 +130,24 @@ func (x *DtlsConnectionBase) CloseFinish(ResultVar AsyncResult) bool { | |||
| 119 | 130 | // #GDtlsConnection::accept-certificate signal. | |
| 120 | 131 | func (x *DtlsConnectionBase) EmitAcceptCertificate(PeerCertVar *TlsCertificate, ErrorsVar TlsCertificateFlags) bool { | |
| 121 | 132 | ||
| 122 | - | return XGDtlsConnectionEmitAcceptCertificate(x.GoPointer(), PeerCertVar.GoPointer(), ErrorsVar) | |
| 123 | - | ||
| 133 | + | cret := XGDtlsConnectionEmitAcceptCertificate(x.GoPointer(), PeerCertVar.GoPointer(), ErrorsVar) | |
| 134 | + | return cret | |
| 124 | 135 | } | |
| 125 | 136 | ||
| 126 | 137 | // Gets @conn's certificate, as set by | |
| 127 | 138 | // g_dtls_connection_set_certificate(). | |
| 128 | 139 | func (x *DtlsConnectionBase) GetCertificate() *TlsCertificate { | |
| 140 | + | var cls *TlsCertificate | |
| 129 | 141 | ||
| 130 | - | GetCertificatePtr := XGDtlsConnectionGetCertificate(x.GoPointer()) | |
| 131 | - | if GetCertificatePtr == 0 { | |
| 132 | - | return nil | |
| 133 | - | } | |
| 134 | - | ||
| 135 | - | gobject.IncreaseRef(GetCertificatePtr) | |
| 136 | - | ||
| 137 | - | GetCertificateCls := &TlsCertificate{} | |
| 138 | - | GetCertificateCls.Ptr = GetCertificatePtr | |
| 139 | - | return GetCertificateCls | |
| 142 | + | cret := XGDtlsConnectionGetCertificate(x.GoPointer()) | |
| 140 | 143 | ||
| 144 | + | if cret == 0 { | |
| 145 | + | return cls | |
| 146 | + | } | |
| 147 | + | gobject.IncreaseRef(cret) | |
| 148 | + | cls = &TlsCertificate{} | |
| 149 | + | cls.Ptr = cret | |
| 150 | + | return cls | |
| 141 | 151 | } | |
| 142 | 152 | ||
| 143 | 153 | // Query the TLS backend for TLS channel binding data of @type for @conn. | |
| @@ -153,9 +163,14 @@ func (x *DtlsConnectionBase) GetCertificate() *TlsCertificate { | |||
| 153 | 163 | // will be available though. That could happen if TLS connection does not | |
| 154 | 164 | // support @type or the binding data is not available yet due to additional | |
| 155 | 165 | // negotiation or input required. | |
| 156 | - | func (x *DtlsConnectionBase) GetChannelBindingData(TypeVar TlsChannelBindingType, DataVar uintptr) bool { | |
| 166 | + | func (x *DtlsConnectionBase) GetChannelBindingData(TypeVar TlsChannelBindingType, DataVar uintptr) (bool, error) { | |
| 167 | + | var cerr *glib.Error | |
| 157 | 168 | ||
| 158 | - | return XGDtlsConnectionGetChannelBindingData(x.GoPointer(), TypeVar, DataVar) | |
| 169 | + | cret := XGDtlsConnectionGetChannelBindingData(x.GoPointer(), TypeVar, DataVar, &cerr) | |
| 170 | + | if cerr == nil { | |
| 171 | + | return cret, nil | |
| 172 | + | } | |
| 173 | + | return cret, cerr | |
| 159 | 174 | ||
| 160 | 175 | } | |
| 161 | 176 | ||
| @@ -169,43 +184,41 @@ func (x *DtlsConnectionBase) GetChannelBindingData(TypeVar TlsChannelBindingType | |||
| 169 | 184 | // is not recommended. | |
| 170 | 185 | func (x *DtlsConnectionBase) GetCiphersuiteName() string { | |
| 171 | 186 | ||
| 172 | - | return XGDtlsConnectionGetCiphersuiteName(x.GoPointer()) | |
| 173 | - | ||
| 187 | + | cret := XGDtlsConnectionGetCiphersuiteName(x.GoPointer()) | |
| 188 | + | return cret | |
| 174 | 189 | } | |
| 175 | 190 | ||
| 176 | 191 | // Gets the certificate database that @conn uses to verify | |
| 177 | 192 | // peer certificates. See g_dtls_connection_set_database(). | |
| 178 | 193 | func (x *DtlsConnectionBase) GetDatabase() *TlsDatabase { | |
| 194 | + | var cls *TlsDatabase | |
| 179 | 195 | ||
| 180 | - | GetDatabasePtr := XGDtlsConnectionGetDatabase(x.GoPointer()) | |
| 181 | - | if GetDatabasePtr == 0 { | |
| 182 | - | return nil | |
| 183 | - | } | |
| 184 | - | ||
| 185 | - | gobject.IncreaseRef(GetDatabasePtr) | |
| 186 | - | ||
| 187 | - | GetDatabaseCls := &TlsDatabase{} | |
| 188 | - | GetDatabaseCls.Ptr = GetDatabasePtr | |
| 189 | - | return GetDatabaseCls | |
| 196 | + | cret := XGDtlsConnectionGetDatabase(x.GoPointer()) | |
| 190 | 197 | ||
| 198 | + | if cret == 0 { | |
| 199 | + | return cls | |
| 200 | + | } | |
| 201 | + | gobject.IncreaseRef(cret) | |
| 202 | + | cls = &TlsDatabase{} | |
| 203 | + | cls.Ptr = cret | |
| 204 | + | return cls | |
| 191 | 205 | } | |
| 192 | 206 | ||
| 193 | 207 | // Get the object that will be used to interact with the user. It will be used | |
| 194 | 208 | // for things like prompting the user for passwords. If %NULL is returned, then | |
| 195 | 209 | // no user interaction will occur for this connection. | |
| 196 | 210 | func (x *DtlsConnectionBase) GetInteraction() *TlsInteraction { | |
| 211 | + | var cls *TlsInteraction | |
| 197 | 212 | ||
| 198 | - | GetInteractionPtr := XGDtlsConnectionGetInteraction(x.GoPointer()) | |
| 199 | - | if GetInteractionPtr == 0 { | |
| 200 | - | return nil | |
| 201 | - | } | |
| 202 | - | ||
| 203 | - | gobject.IncreaseRef(GetInteractionPtr) | |
| 204 | - | ||
| 205 | - | GetInteractionCls := &TlsInteraction{} | |
| 206 | - | GetInteractionCls.Ptr = GetInteractionPtr | |
| 207 | - | return GetInteractionCls | |
| 213 | + | cret := XGDtlsConnectionGetInteraction(x.GoPointer()) | |
| 208 | 214 | ||
| 215 | + | if cret == 0 { | |
| 216 | + | return cls | |
| 217 | + | } | |
| 218 | + | gobject.IncreaseRef(cret) | |
| 219 | + | cls = &TlsInteraction{} | |
| 220 | + | cls.Ptr = cret | |
| 221 | + | return cls | |
| 209 | 222 | } | |
| 210 | 223 | ||
| 211 | 224 | // Gets the name of the application-layer protocol negotiated during | |
| @@ -217,26 +230,25 @@ func (x *DtlsConnectionBase) GetInteraction() *TlsInteraction { | |||
| 217 | 230 | // g_dtls_connection_set_advertised_protocols(). | |
| 218 | 231 | func (x *DtlsConnectionBase) GetNegotiatedProtocol() string { | |
| 219 | 232 | ||
| 220 | - | return XGDtlsConnectionGetNegotiatedProtocol(x.GoPointer()) | |
| 221 | - | ||
| 233 | + | cret := XGDtlsConnectionGetNegotiatedProtocol(x.GoPointer()) | |
| 234 | + | return cret | |
| 222 | 235 | } | |
| 223 | 236 | ||
| 224 | 237 | // Gets @conn's peer's certificate after the handshake has completed | |
| 225 | 238 | // or failed. (It is not set during the emission of | |
| 226 | 239 | // #GDtlsConnection::accept-certificate.) | |
| 227 | 240 | func (x *DtlsConnectionBase) GetPeerCertificate() *TlsCertificate { | |
| 241 | + | var cls *TlsCertificate | |
| 228 | 242 | ||
| 229 | - | GetPeerCertificatePtr := XGDtlsConnectionGetPeerCertificate(x.GoPointer()) | |
| 230 | - | if GetPeerCertificatePtr == 0 { | |
| 231 | - | return nil | |
| 232 | - | } | |
| 233 | - | ||
| 234 | - | gobject.IncreaseRef(GetPeerCertificatePtr) | |
| 235 | - | ||
| 236 | - | GetPeerCertificateCls := &TlsCertificate{} | |
| 237 | - | GetPeerCertificateCls.Ptr = GetPeerCertificatePtr | |
| 238 | - | return GetPeerCertificateCls | |
| 243 | + | cret := XGDtlsConnectionGetPeerCertificate(x.GoPointer()) | |
| 239 | 244 | ||
| 245 | + | if cret == 0 { | |
| 246 | + | return cls | |
| 247 | + | } | |
| 248 | + | gobject.IncreaseRef(cret) | |
| 249 | + | cls = &TlsCertificate{} | |
| 250 | + | cls.Ptr = cret | |
| 251 | + | return cls | |
| 240 | 252 | } | |
| 241 | 253 | ||
| 242 | 254 | // Gets the errors associated with validating @conn's peer's | |
| @@ -244,8 +256,8 @@ func (x *DtlsConnectionBase) GetPeerCertificate() *TlsCertificate { | |||
| 244 | 256 | // not set during the emission of #GDtlsConnection::accept-certificate.) | |
| 245 | 257 | func (x *DtlsConnectionBase) GetPeerCertificateErrors() TlsCertificateFlags { | |
| 246 | 258 | ||
| 247 | - | return XGDtlsConnectionGetPeerCertificateErrors(x.GoPointer()) | |
| 248 | - | ||
| 259 | + | cret := XGDtlsConnectionGetPeerCertificateErrors(x.GoPointer()) | |
| 260 | + | return cret | |
| 249 | 261 | } | |
| 250 | 262 | ||
| 251 | 263 | // Returns the current DTLS protocol version, which may be | |
| @@ -254,16 +266,16 @@ func (x *DtlsConnectionBase) GetPeerCertificateErrors() TlsCertificateFlags { | |||
| 254 | 266 | // that is not a recognized #GTlsProtocolVersion. | |
| 255 | 267 | func (x *DtlsConnectionBase) GetProtocolVersion() TlsProtocolVersion { | |
| 256 | 268 | ||
| 257 | - | return XGDtlsConnectionGetProtocolVersion(x.GoPointer()) | |
| 258 | - | ||
| 269 | + | cret := XGDtlsConnectionGetProtocolVersion(x.GoPointer()) | |
| 270 | + | return cret | |
| 259 | 271 | } | |
| 260 | 272 | ||
| 261 | 273 | // Gets @conn rehandshaking mode. See | |
| 262 | 274 | // g_dtls_connection_set_rehandshake_mode() for details. | |
| 263 | 275 | func (x *DtlsConnectionBase) GetRehandshakeMode() TlsRehandshakeMode { | |
| 264 | 276 | ||
| 265 | - | return XGDtlsConnectionGetRehandshakeMode(x.GoPointer()) | |
| 266 | - | ||
| 277 | + | cret := XGDtlsConnectionGetRehandshakeMode(x.GoPointer()) | |
| 278 | + | return cret | |
| 267 | 279 | } | |
| 268 | 280 | ||
| 269 | 281 | // Tests whether or not @conn expects a proper TLS close notification | |
| @@ -271,8 +283,8 @@ func (x *DtlsConnectionBase) GetRehandshakeMode() TlsRehandshakeMode { | |||
| 271 | 283 | // g_dtls_connection_set_require_close_notify() for details. | |
| 272 | 284 | func (x *DtlsConnectionBase) GetRequireCloseNotify() bool { | |
| 273 | 285 | ||
| 274 | - | return XGDtlsConnectionGetRequireCloseNotify(x.GoPointer()) | |
| 275 | - | ||
| 286 | + | cret := XGDtlsConnectionGetRequireCloseNotify(x.GoPointer()) | |
| 287 | + | return cret | |
| 276 | 288 | } | |
| 277 | 289 | ||
| 278 | 290 | // Attempts a TLS handshake on @conn. | |
| @@ -301,9 +313,14 @@ func (x *DtlsConnectionBase) GetRequireCloseNotify() bool { | |||
| 301 | 313 | // | |
| 302 | 314 | // #GDtlsConnection::accept_certificate may be emitted during the | |
| 303 | 315 | // handshake. | |
| 304 | - | func (x *DtlsConnectionBase) Handshake(CancellableVar *Cancellable) bool { | |
| 316 | + | func (x *DtlsConnectionBase) Handshake(CancellableVar *Cancellable) (bool, error) { | |
| 317 | + | var cerr *glib.Error | |
| 305 | 318 | ||
| 306 | - | return XGDtlsConnectionHandshake(x.GoPointer(), CancellableVar.GoPointer()) | |
| 319 | + | cret := XGDtlsConnectionHandshake(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 320 | + | if cerr == nil { | |
| 321 | + | return cret, nil | |
| 322 | + | } | |
| 323 | + | return cret, cerr | |
| 307 | 324 | ||
| 308 | 325 | } | |
| 309 | 326 | ||
| @@ -317,9 +334,14 @@ func (x *DtlsConnectionBase) HandshakeAsync(IoPriorityVar int, CancellableVar *C | |||
| 317 | 334 | ||
| 318 | 335 | // Finish an asynchronous TLS handshake operation. See | |
| 319 | 336 | // g_dtls_connection_handshake() for more information. | |
| 320 | - | func (x *DtlsConnectionBase) HandshakeFinish(ResultVar AsyncResult) bool { | |
| 337 | + | func (x *DtlsConnectionBase) HandshakeFinish(ResultVar AsyncResult) (bool, error) { | |
| 338 | + | var cerr *glib.Error | |
| 321 | 339 | ||
| 322 | - | return XGDtlsConnectionHandshakeFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 340 | + | cret := XGDtlsConnectionHandshakeFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 341 | + | if cerr == nil { | |
| 342 | + | return cret, nil | |
| 343 | + | } | |
| 344 | + | return cret, cerr | |
| 323 | 345 | ||
| 324 | 346 | } | |
| 325 | 347 | ||
| @@ -449,9 +471,14 @@ func (x *DtlsConnectionBase) SetRequireCloseNotify(RequireCloseNotifyVar bool) { | |||
| 449 | 471 | // If @cancellable is cancelled, the #GDtlsConnection may be left | |
| 450 | 472 | // partially-closed and any pending untransmitted data may be lost. Call | |
| 451 | 473 | // g_dtls_connection_shutdown() again to complete closing the #GDtlsConnection. | |
| 452 | - | func (x *DtlsConnectionBase) Shutdown(ShutdownReadVar bool, ShutdownWriteVar bool, CancellableVar *Cancellable) bool { | |
| 474 | + | func (x *DtlsConnectionBase) Shutdown(ShutdownReadVar bool, ShutdownWriteVar bool, CancellableVar *Cancellable) (bool, error) { | |
| 475 | + | var cerr *glib.Error | |
| 453 | 476 | ||
| 454 | - | return XGDtlsConnectionShutdown(x.GoPointer(), ShutdownReadVar, ShutdownWriteVar, CancellableVar.GoPointer()) | |
| 477 | + | cret := XGDtlsConnectionShutdown(x.GoPointer(), ShutdownReadVar, ShutdownWriteVar, CancellableVar.GoPointer(), &cerr) | |
| 478 | + | if cerr == nil { | |
| 479 | + | return cret, nil | |
| 480 | + | } | |
| 481 | + | return cret, cerr | |
| 455 | 482 | ||
| 456 | 483 | } | |
| 457 | 484 | ||
| @@ -465,18 +492,23 @@ func (x *DtlsConnectionBase) ShutdownAsync(ShutdownReadVar bool, ShutdownWriteVa | |||
| 465 | 492 | ||
| 466 | 493 | // Finish an asynchronous TLS shutdown operation. See | |
| 467 | 494 | // g_dtls_connection_shutdown() for more information. | |
| 468 | - | func (x *DtlsConnectionBase) ShutdownFinish(ResultVar AsyncResult) bool { | |
| 495 | + | func (x *DtlsConnectionBase) ShutdownFinish(ResultVar AsyncResult) (bool, error) { | |
| 496 | + | var cerr *glib.Error | |
| 469 | 497 | ||
| 470 | - | return XGDtlsConnectionShutdownFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 498 | + | cret := XGDtlsConnectionShutdownFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 499 | + | if cerr == nil { | |
| 500 | + | return cret, nil | |
| 501 | + | } | |
| 502 | + | return cret, cerr | |
| 471 | 503 | ||
| 472 | 504 | } | |
| 473 | 505 | ||
| 474 | - | var XGDtlsConnectionClose func(uintptr, uintptr) bool | |
| 506 | + | var XGDtlsConnectionClose func(uintptr, uintptr, **glib.Error) bool | |
| 475 | 507 | var XGDtlsConnectionCloseAsync func(uintptr, int, uintptr, uintptr, uintptr) | |
| 476 | - | var XGDtlsConnectionCloseFinish func(uintptr, uintptr) bool | |
| 508 | + | var XGDtlsConnectionCloseFinish func(uintptr, uintptr, **glib.Error) bool | |
| 477 | 509 | var XGDtlsConnectionEmitAcceptCertificate func(uintptr, uintptr, TlsCertificateFlags) bool | |
| 478 | 510 | var XGDtlsConnectionGetCertificate func(uintptr) uintptr | |
| 479 | - | var XGDtlsConnectionGetChannelBindingData func(uintptr, TlsChannelBindingType, uintptr) bool | |
| 511 | + | var XGDtlsConnectionGetChannelBindingData func(uintptr, TlsChannelBindingType, uintptr, **glib.Error) bool | |
| 480 | 512 | var XGDtlsConnectionGetCiphersuiteName func(uintptr) string | |
| 481 | 513 | var XGDtlsConnectionGetDatabase func(uintptr) uintptr | |
| 482 | 514 | var XGDtlsConnectionGetInteraction func(uintptr) uintptr | |
| @@ -486,18 +518,18 @@ var XGDtlsConnectionGetPeerCertificateErrors func(uintptr) TlsCertificateFlags | |||
| 486 | 518 | var XGDtlsConnectionGetProtocolVersion func(uintptr) TlsProtocolVersion | |
| 487 | 519 | var XGDtlsConnectionGetRehandshakeMode func(uintptr) TlsRehandshakeMode | |
| 488 | 520 | var XGDtlsConnectionGetRequireCloseNotify func(uintptr) bool | |
| 489 | - | var XGDtlsConnectionHandshake func(uintptr, uintptr) bool | |
| 521 | + | var XGDtlsConnectionHandshake func(uintptr, uintptr, **glib.Error) bool | |
| 490 | 522 | var XGDtlsConnectionHandshakeAsync func(uintptr, int, uintptr, uintptr, uintptr) | |
| 491 | - | var XGDtlsConnectionHandshakeFinish func(uintptr, uintptr) bool | |
| 523 | + | var XGDtlsConnectionHandshakeFinish func(uintptr, uintptr, **glib.Error) bool | |
| 492 | 524 | var XGDtlsConnectionSetAdvertisedProtocols func(uintptr, uintptr) | |
| 493 | 525 | var XGDtlsConnectionSetCertificate func(uintptr, uintptr) | |
| 494 | 526 | var XGDtlsConnectionSetDatabase func(uintptr, uintptr) | |
| 495 | 527 | var XGDtlsConnectionSetInteraction func(uintptr, uintptr) | |
| 496 | 528 | var XGDtlsConnectionSetRehandshakeMode func(uintptr, TlsRehandshakeMode) | |
| 497 | 529 | var XGDtlsConnectionSetRequireCloseNotify func(uintptr, bool) | |
| 498 | - | var XGDtlsConnectionShutdown func(uintptr, bool, bool, uintptr) bool | |
| 530 | + | var XGDtlsConnectionShutdown func(uintptr, bool, bool, uintptr, **glib.Error) bool | |
| 499 | 531 | var XGDtlsConnectionShutdownAsync func(uintptr, bool, bool, int, uintptr, uintptr, uintptr) | |
| 500 | - | var XGDtlsConnectionShutdownFinish func(uintptr, uintptr) bool | |
| 532 | + | var XGDtlsConnectionShutdownFinish func(uintptr, uintptr, **glib.Error) bool | |
| 501 | 533 | ||
| 502 | 534 | func init() { | |
| 503 | 535 | lib, err := purego.Dlopen(core.GetPath("GIO"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
M v4/gio/gdtlsserverconnection.go +15 -9
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | ) | |
| 8 | 9 | ||
| 9 | 10 | // vtable for a #GDtlsServerConnection implementation. | |
| @@ -29,19 +30,24 @@ func (x *DtlsServerConnectionBase) SetGoPointer(ptr uintptr) { | |||
| 29 | 30 | x.Ptr = ptr | |
| 30 | 31 | } | |
| 31 | 32 | ||
| 32 | - | var xDtlsServerConnectionNew func(uintptr, uintptr) uintptr | |
| 33 | + | var xDtlsServerConnectionNew func(uintptr, uintptr, **glib.Error) uintptr | |
| 33 | 34 | ||
| 34 | 35 | // Creates a new #GDtlsServerConnection wrapping @base_socket. | |
| 35 | - | func DtlsServerConnectionNew(BaseSocketVar DatagramBased, CertificateVar *TlsCertificate) *DtlsServerConnectionBase { | |
| 36 | + | func DtlsServerConnectionNew(BaseSocketVar DatagramBased, CertificateVar *TlsCertificate) (*DtlsServerConnectionBase, error) { | |
| 37 | + | var cls *DtlsServerConnectionBase | |
| 38 | + | var cerr *glib.Error | |
| 36 | 39 | ||
| 37 | - | DtlsServerConnectionNewPtr := xDtlsServerConnectionNew(BaseSocketVar.GoPointer(), CertificateVar.GoPointer()) | |
| 38 | - | if DtlsServerConnectionNewPtr == 0 { | |
| 39 | - | return nil | |
| 40 | - | } | |
| 40 | + | cret := xDtlsServerConnectionNew(BaseSocketVar.GoPointer(), CertificateVar.GoPointer(), &cerr) | |
| 41 | 41 | ||
| 42 | - | DtlsServerConnectionNewCls := &DtlsServerConnectionBase{} | |
| 43 | - | DtlsServerConnectionNewCls.Ptr = DtlsServerConnectionNewPtr | |
| 44 | - | return DtlsServerConnectionNewCls | |
| 42 | + | if cret == 0 { | |
| 43 | + | return cls, cerr | |
| 44 | + | } | |
| 45 | + | cls = &DtlsServerConnectionBase{} | |
| 46 | + | cls.Ptr = cret | |
| 47 | + | if cerr == nil { | |
| 48 | + | return cls, nil | |
| 49 | + | } | |
| 50 | + | return cls, cerr | |
| 45 | 51 | ||
| 46 | 52 | } | |
| 47 | 53 | ||
M v4/gio/gemblem.go +35 -32
| @@ -31,46 +31,49 @@ var xNewEmblem func(uintptr) uintptr | |||
| 31 | 31 | ||
| 32 | 32 | // Creates a new emblem for @icon. | |
| 33 | 33 | func NewEmblem(IconVar Icon) *Emblem { | |
| 34 | - | NewEmblemPtr := xNewEmblem(IconVar.GoPointer()) | |
| 35 | - | if NewEmblemPtr == 0 { | |
| 36 | - | return nil | |
| 37 | - | } | |
| 34 | + | var cls *Emblem | |
| 35 | + | ||
| 36 | + | cret := xNewEmblem(IconVar.GoPointer()) | |
| 38 | 37 | ||
| 39 | - | NewEmblemCls := &Emblem{} | |
| 40 | - | NewEmblemCls.Ptr = NewEmblemPtr | |
| 41 | - | return NewEmblemCls | |
| 38 | + | if cret == 0 { | |
| 39 | + | return cls | |
| 40 | + | } | |
| 41 | + | cls = &Emblem{} | |
| 42 | + | cls.Ptr = cret | |
| 43 | + | return cls | |
| 42 | 44 | } | |
| 43 | 45 | ||
| 44 | 46 | var xNewWithOriginEmblem func(uintptr, EmblemOrigin) uintptr | |
| 45 | 47 | ||
| 46 | 48 | // Creates a new emblem for @icon. | |
| 47 | 49 | func NewWithOriginEmblem(IconVar Icon, OriginVar EmblemOrigin) *Emblem { | |
| 48 | - | NewWithOriginEmblemPtr := xNewWithOriginEmblem(IconVar.GoPointer(), OriginVar) | |
| 49 | - | if NewWithOriginEmblemPtr == 0 { | |
| 50 | - | return nil | |
| 51 | - | } | |
| 50 | + | var cls *Emblem | |
| 52 | 51 | ||
| 53 | - | NewWithOriginEmblemCls := &Emblem{} | |
| 54 | - | NewWithOriginEmblemCls.Ptr = NewWithOriginEmblemPtr | |
| 55 | - | return NewWithOriginEmblemCls | |
| 52 | + | cret := xNewWithOriginEmblem(IconVar.GoPointer(), OriginVar) | |
| 53 | + | ||
| 54 | + | if cret == 0 { | |
| 55 | + | return cls | |
| 56 | + | } | |
| 57 | + | cls = &Emblem{} | |
| 58 | + | cls.Ptr = cret | |
| 59 | + | return cls | |
| 56 | 60 | } | |
| 57 | 61 | ||
| 58 | 62 | var xEmblemGetIcon func(uintptr) uintptr | |
| 59 | 63 | ||
| 60 | 64 | // Gives back the icon from @emblem. | |
| 61 | 65 | func (x *Emblem) GetIcon() *IconBase { | |
| 66 | + | var cls *IconBase | |
| 62 | 67 | ||
| 63 | - | GetIconPtr := xEmblemGetIcon(x.GoPointer()) | |
| 64 | - | if GetIconPtr == 0 { | |
| 65 | - | return nil | |
| 66 | - | } | |
| 67 | - | ||
| 68 | - | gobject.IncreaseRef(GetIconPtr) | |
| 69 | - | ||
| 70 | - | GetIconCls := &IconBase{} | |
| 71 | - | GetIconCls.Ptr = GetIconPtr | |
| 72 | - | return GetIconCls | |
| 68 | + | cret := xEmblemGetIcon(x.GoPointer()) | |
| 73 | 69 | ||
| 70 | + | if cret == 0 { | |
| 71 | + | return cls | |
| 72 | + | } | |
| 73 | + | gobject.IncreaseRef(cret) | |
| 74 | + | cls = &IconBase{} | |
| 75 | + | cls.Ptr = cret | |
| 76 | + | return cls | |
| 74 | 77 | } | |
| 75 | 78 | ||
| 76 | 79 | var xEmblemGetOrigin func(uintptr) EmblemOrigin | |
| @@ -78,8 +81,8 @@ var xEmblemGetOrigin func(uintptr) EmblemOrigin | |||
| 78 | 81 | // Gets the origin of the emblem. | |
| 79 | 82 | func (x *Emblem) GetOrigin() EmblemOrigin { | |
| 80 | 83 | ||
| 81 | - | return xEmblemGetOrigin(x.GoPointer()) | |
| 82 | - | ||
| 84 | + | cret := xEmblemGetOrigin(x.GoPointer()) | |
| 85 | + | return cret | |
| 83 | 86 | } | |
| 84 | 87 | ||
| 85 | 88 | func (c *Emblem) GoPointer() uintptr { | |
| @@ -93,8 +96,8 @@ func (c *Emblem) SetGoPointer(ptr uintptr) { | |||
| 93 | 96 | // Checks if two icons are equal. | |
| 94 | 97 | func (x *Emblem) Equal(Icon2Var Icon) bool { | |
| 95 | 98 | ||
| 96 | - | return XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 97 | - | ||
| 99 | + | cret := XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 100 | + | return cret | |
| 98 | 101 | } | |
| 99 | 102 | ||
| 100 | 103 | // Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved | |
| @@ -104,8 +107,8 @@ func (x *Emblem) Equal(Icon2Var Icon) bool { | |||
| 104 | 107 | // (as opposed to over the network), and within the same file system namespace. | |
| 105 | 108 | func (x *Emblem) Serialize() *glib.Variant { | |
| 106 | 109 | ||
| 107 | - | return XGIconSerialize(x.GoPointer()) | |
| 108 | - | ||
| 110 | + | cret := XGIconSerialize(x.GoPointer()) | |
| 111 | + | return cret | |
| 109 | 112 | } | |
| 110 | 113 | ||
| 111 | 114 | // Generates a textual representation of @icon that can be used for | |
| @@ -126,8 +129,8 @@ func (x *Emblem) Serialize() *glib.Variant { | |||
| 126 | 129 | // the encoding is simply the name (such as `network-server`). | |
| 127 | 130 | func (x *Emblem) ToString() string { | |
| 128 | 131 | ||
| 129 | - | return XGIconToString(x.GoPointer()) | |
| 130 | - | ||
| 132 | + | cret := XGIconToString(x.GoPointer()) | |
| 133 | + | return cret | |
| 131 | 134 | } | |
| 132 | 135 | ||
| 133 | 136 | func init() { | |
M v4/gio/gemblemedicon.go +26 -25
| @@ -35,14 +35,16 @@ var xNewEmblemedIcon func(uintptr, uintptr) uintptr | |||
| 35 | 35 | ||
| 36 | 36 | // Creates a new emblemed icon for @icon with the emblem @emblem. | |
| 37 | 37 | func NewEmblemedIcon(IconVar Icon, EmblemVar *Emblem) *EmblemedIcon { | |
| 38 | - | NewEmblemedIconPtr := xNewEmblemedIcon(IconVar.GoPointer(), EmblemVar.GoPointer()) | |
| 39 | - | if NewEmblemedIconPtr == 0 { | |
| 40 | - | return nil | |
| 41 | - | } | |
| 38 | + | var cls *EmblemedIcon | |
| 39 | + | ||
| 40 | + | cret := xNewEmblemedIcon(IconVar.GoPointer(), EmblemVar.GoPointer()) | |
| 42 | 41 | ||
| 43 | - | NewEmblemedIconCls := &EmblemedIcon{} | |
| 44 | - | NewEmblemedIconCls.Ptr = NewEmblemedIconPtr | |
| 45 | - | return NewEmblemedIconCls | |
| 42 | + | if cret == 0 { | |
| 43 | + | return cls | |
| 44 | + | } | |
| 45 | + | cls = &EmblemedIcon{} | |
| 46 | + | cls.Ptr = cret | |
| 47 | + | return cls | |
| 46 | 48 | } | |
| 47 | 49 | ||
| 48 | 50 | var xEmblemedIconAddEmblem func(uintptr, uintptr) | |
| @@ -68,26 +70,25 @@ var xEmblemedIconGetEmblems func(uintptr) *glib.List | |||
| 68 | 70 | // Gets the list of emblems for the @icon. | |
| 69 | 71 | func (x *EmblemedIcon) GetEmblems() *glib.List { | |
| 70 | 72 | ||
| 71 | - | return xEmblemedIconGetEmblems(x.GoPointer()) | |
| 72 | - | ||
| 73 | + | cret := xEmblemedIconGetEmblems(x.GoPointer()) | |
| 74 | + | return cret | |
| 73 | 75 | } | |
| 74 | 76 | ||
| 75 | 77 | var xEmblemedIconGetIcon func(uintptr) uintptr | |
| 76 | 78 | ||
| 77 | 79 | // Gets the main icon for @emblemed. | |
| 78 | 80 | func (x *EmblemedIcon) GetIcon() *IconBase { | |
| 81 | + | var cls *IconBase | |
| 79 | 82 | ||
| 80 | - | GetIconPtr := xEmblemedIconGetIcon(x.GoPointer()) | |
| 81 | - | if GetIconPtr == 0 { | |
| 82 | - | return nil | |
| 83 | - | } | |
| 84 | - | ||
| 85 | - | gobject.IncreaseRef(GetIconPtr) | |
| 86 | - | ||
| 87 | - | GetIconCls := &IconBase{} | |
| 88 | - | GetIconCls.Ptr = GetIconPtr | |
| 89 | - | return GetIconCls | |
| 83 | + | cret := xEmblemedIconGetIcon(x.GoPointer()) | |
| 90 | 84 | ||
| 85 | + | if cret == 0 { | |
| 86 | + | return cls | |
| 87 | + | } | |
| 88 | + | gobject.IncreaseRef(cret) | |
| 89 | + | cls = &IconBase{} | |
| 90 | + | cls.Ptr = cret | |
| 91 | + | return cls | |
| 91 | 92 | } | |
| 92 | 93 | ||
| 93 | 94 | func (c *EmblemedIcon) GoPointer() uintptr { | |
| @@ -101,8 +102,8 @@ func (c *EmblemedIcon) SetGoPointer(ptr uintptr) { | |||
| 101 | 102 | // Checks if two icons are equal. | |
| 102 | 103 | func (x *EmblemedIcon) Equal(Icon2Var Icon) bool { | |
| 103 | 104 | ||
| 104 | - | return XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 105 | - | ||
| 105 | + | cret := XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 106 | + | return cret | |
| 106 | 107 | } | |
| 107 | 108 | ||
| 108 | 109 | // Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved | |
| @@ -112,8 +113,8 @@ func (x *EmblemedIcon) Equal(Icon2Var Icon) bool { | |||
| 112 | 113 | // (as opposed to over the network), and within the same file system namespace. | |
| 113 | 114 | func (x *EmblemedIcon) Serialize() *glib.Variant { | |
| 114 | 115 | ||
| 115 | - | return XGIconSerialize(x.GoPointer()) | |
| 116 | - | ||
| 116 | + | cret := XGIconSerialize(x.GoPointer()) | |
| 117 | + | return cret | |
| 117 | 118 | } | |
| 118 | 119 | ||
| 119 | 120 | // Generates a textual representation of @icon that can be used for | |
| @@ -134,8 +135,8 @@ func (x *EmblemedIcon) Serialize() *glib.Variant { | |||
| 134 | 135 | // the encoding is simply the name (such as `network-server`). | |
| 135 | 136 | func (x *EmblemedIcon) ToString() string { | |
| 136 | 137 | ||
| 137 | - | return XGIconToString(x.GoPointer()) | |
| 138 | - | ||
| 138 | + | cret := XGIconToString(x.GoPointer()) | |
| 139 | + | return cret | |
| 139 | 140 | } | |
| 140 | 141 | ||
| 141 | 142 | func init() { | |
M v4/gio/gfile.go +888 -518
| @@ -256,16 +256,21 @@ func (x *FileBase) SetGoPointer(ptr uintptr) { | |||
| 256 | 256 | // %G_IO_ERROR_INVALID_FILENAME error. If the file is a directory the | |
| 257 | 257 | // %G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are | |
| 258 | 258 | // possible too, and depend on what kind of filesystem the file is on. | |
| 259 | - | func (x *FileBase) AppendTo(FlagsVar FileCreateFlags, CancellableVar *Cancellable) *FileOutputStream { | |
| 259 | + | func (x *FileBase) AppendTo(FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileOutputStream, error) { | |
| 260 | + | var cls *FileOutputStream | |
| 261 | + | var cerr *glib.Error | |
| 260 | 262 | ||
| 261 | - | AppendToPtr := XGFileAppendTo(x.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 262 | - | if AppendToPtr == 0 { | |
| 263 | - | return nil | |
| 264 | - | } | |
| 263 | + | cret := XGFileAppendTo(x.GoPointer(), FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 265 | 264 | ||
| 266 | - | AppendToCls := &FileOutputStream{} | |
| 267 | - | AppendToCls.Ptr = AppendToPtr | |
| 268 | - | return AppendToCls | |
| 265 | + | if cret == 0 { | |
| 266 | + | return cls, cerr | |
| 267 | + | } | |
| 268 | + | cls = &FileOutputStream{} | |
| 269 | + | cls.Ptr = cret | |
| 270 | + | if cerr == nil { | |
| 271 | + | return cls, nil | |
| 272 | + | } | |
| 273 | + | return cls, cerr | |
| 269 | 274 | ||
| 270 | 275 | } | |
| 271 | 276 | ||
| @@ -285,16 +290,21 @@ func (x *FileBase) AppendToAsync(FlagsVar FileCreateFlags, IoPriorityVar int, Ca | |||
| 285 | 290 | ||
| 286 | 291 | // Finishes an asynchronous file append operation started with | |
| 287 | 292 | // g_file_append_to_async(). | |
| 288 | - | func (x *FileBase) AppendToFinish(ResVar AsyncResult) *FileOutputStream { | |
| 293 | + | func (x *FileBase) AppendToFinish(ResVar AsyncResult) (*FileOutputStream, error) { | |
| 294 | + | var cls *FileOutputStream | |
| 295 | + | var cerr *glib.Error | |
| 289 | 296 | ||
| 290 | - | AppendToFinishPtr := XGFileAppendToFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 291 | - | if AppendToFinishPtr == 0 { | |
| 292 | - | return nil | |
| 293 | - | } | |
| 297 | + | cret := XGFileAppendToFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 294 | 298 | ||
| 295 | - | AppendToFinishCls := &FileOutputStream{} | |
| 296 | - | AppendToFinishCls.Ptr = AppendToFinishPtr | |
| 297 | - | return AppendToFinishCls | |
| 299 | + | if cret == 0 { | |
| 300 | + | return cls, cerr | |
| 301 | + | } | |
| 302 | + | cls = &FileOutputStream{} | |
| 303 | + | cls.Ptr = cret | |
| 304 | + | if cerr == nil { | |
| 305 | + | return cls, nil | |
| 306 | + | } | |
| 307 | + | return cls, cerr | |
| 298 | 308 | ||
| 299 | 309 | } | |
| 300 | 310 | ||
| @@ -307,9 +317,14 @@ func (x *FileBase) AppendToFinish(ResVar AsyncResult) *FileOutputStream { | |||
| 307 | 317 | // implementation of g_file_copy_attributes() and is useful | |
| 308 | 318 | // when one needs to query and set the attributes in two | |
| 309 | 319 | // stages (e.g., for recursive move of a directory). | |
| 310 | - | func (x *FileBase) BuildAttributeListForCopy(FlagsVar FileCopyFlags, CancellableVar *Cancellable) string { | |
| 320 | + | func (x *FileBase) BuildAttributeListForCopy(FlagsVar FileCopyFlags, CancellableVar *Cancellable) (string, error) { | |
| 321 | + | var cerr *glib.Error | |
| 311 | 322 | ||
| 312 | - | return XGFileBuildAttributeListForCopy(x.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 323 | + | cret := XGFileBuildAttributeListForCopy(x.GoPointer(), FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 324 | + | if cerr == nil { | |
| 325 | + | return cret, nil | |
| 326 | + | } | |
| 327 | + | return cret, cerr | |
| 313 | 328 | ||
| 314 | 329 | } | |
| 315 | 330 | ||
| @@ -353,9 +368,14 @@ func (x *FileBase) BuildAttributeListForCopy(FlagsVar FileCopyFlags, Cancellable | |||
| 353 | 368 | // | |
| 354 | 369 | // If you are interested in copying the #GFile object itself (not the on-disk | |
| 355 | 370 | // file), see g_file_dup(). | |
| 356 | - | func (x *FileBase) Copy(DestinationVar File, FlagsVar FileCopyFlags, CancellableVar *Cancellable, ProgressCallbackVar FileProgressCallback, ProgressCallbackDataVar uintptr) bool { | |
| 371 | + | func (x *FileBase) Copy(DestinationVar File, FlagsVar FileCopyFlags, CancellableVar *Cancellable, ProgressCallbackVar FileProgressCallback, ProgressCallbackDataVar uintptr) (bool, error) { | |
| 372 | + | var cerr *glib.Error | |
| 357 | 373 | ||
| 358 | - | return XGFileCopy(x.GoPointer(), DestinationVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), purego.NewCallback(ProgressCallbackVar), ProgressCallbackDataVar) | |
| 374 | + | cret := XGFileCopy(x.GoPointer(), DestinationVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), purego.NewCallback(ProgressCallbackVar), ProgressCallbackDataVar, &cerr) | |
| 375 | + | if cerr == nil { | |
| 376 | + | return cret, nil | |
| 377 | + | } | |
| 378 | + | return cret, cerr | |
| 359 | 379 | ||
| 360 | 380 | } | |
| 361 | 381 | ||
| @@ -383,16 +403,26 @@ func (x *FileBase) CopyAsync(DestinationVar File, FlagsVar FileCopyFlags, IoPrio | |||
| 383 | 403 | // if %G_FILE_COPY_ALL_METADATA is specified in @flags, then | |
| 384 | 404 | // all the metadata that is possible to copy is copied. This | |
| 385 | 405 | // is useful when implementing move by copy + delete source. | |
| 386 | - | func (x *FileBase) CopyAttributes(DestinationVar File, FlagsVar FileCopyFlags, CancellableVar *Cancellable) bool { | |
| 406 | + | func (x *FileBase) CopyAttributes(DestinationVar File, FlagsVar FileCopyFlags, CancellableVar *Cancellable) (bool, error) { | |
| 407 | + | var cerr *glib.Error | |
| 387 | 408 | ||
| 388 | - | return XGFileCopyAttributes(x.GoPointer(), DestinationVar.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 409 | + | cret := XGFileCopyAttributes(x.GoPointer(), DestinationVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 410 | + | if cerr == nil { | |
| 411 | + | return cret, nil | |
| 412 | + | } | |
| 413 | + | return cret, cerr | |
| 389 | 414 | ||
| 390 | 415 | } | |
| 391 | 416 | ||
| 392 | 417 | // Finishes copying the file started with g_file_copy_async(). | |
| 393 | - | func (x *FileBase) CopyFinish(ResVar AsyncResult) bool { | |
| 418 | + | func (x *FileBase) CopyFinish(ResVar AsyncResult) (bool, error) { | |
| 419 | + | var cerr *glib.Error | |
| 394 | 420 | ||
| 395 | - | return XGFileCopyFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 421 | + | cret := XGFileCopyFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 422 | + | if cerr == nil { | |
| 423 | + | return cret, nil | |
| 424 | + | } | |
| 425 | + | return cret, cerr | |
| 396 | 426 | ||
| 397 | 427 | } | |
| 398 | 428 | ||
| @@ -415,16 +445,21 @@ func (x *FileBase) CopyFinish(ResVar AsyncResult) bool { | |||
| 415 | 445 | // error, and if the name is to long %G_IO_ERROR_FILENAME_TOO_LONG will | |
| 416 | 446 | // be returned. Other errors are possible too, and depend on what kind | |
| 417 | 447 | // of filesystem the file is on. | |
| 418 | - | func (x *FileBase) Create(FlagsVar FileCreateFlags, CancellableVar *Cancellable) *FileOutputStream { | |
| 448 | + | func (x *FileBase) Create(FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileOutputStream, error) { | |
| 449 | + | var cls *FileOutputStream | |
| 450 | + | var cerr *glib.Error | |
| 419 | 451 | ||
| 420 | - | CreatePtr := XGFileCreate(x.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 421 | - | if CreatePtr == 0 { | |
| 422 | - | return nil | |
| 423 | - | } | |
| 452 | + | cret := XGFileCreate(x.GoPointer(), FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 424 | 453 | ||
| 425 | - | CreateCls := &FileOutputStream{} | |
| 426 | - | CreateCls.Ptr = CreatePtr | |
| 427 | - | return CreateCls | |
| 454 | + | if cret == 0 { | |
| 455 | + | return cls, cerr | |
| 456 | + | } | |
| 457 | + | cls = &FileOutputStream{} | |
| 458 | + | cls.Ptr = cret | |
| 459 | + | if cerr == nil { | |
| 460 | + | return cls, nil | |
| 461 | + | } | |
| 462 | + | return cls, cerr | |
| 428 | 463 | ||
| 429 | 464 | } | |
| 430 | 465 | ||
| @@ -445,16 +480,21 @@ func (x *FileBase) CreateAsync(FlagsVar FileCreateFlags, IoPriorityVar int, Canc | |||
| 445 | 480 | ||
| 446 | 481 | // Finishes an asynchronous file create operation started with | |
| 447 | 482 | // g_file_create_async(). | |
| 448 | - | func (x *FileBase) CreateFinish(ResVar AsyncResult) *FileOutputStream { | |
| 483 | + | func (x *FileBase) CreateFinish(ResVar AsyncResult) (*FileOutputStream, error) { | |
| 484 | + | var cls *FileOutputStream | |
| 485 | + | var cerr *glib.Error | |
| 449 | 486 | ||
| 450 | - | CreateFinishPtr := XGFileCreateFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 451 | - | if CreateFinishPtr == 0 { | |
| 452 | - | return nil | |
| 453 | - | } | |
| 487 | + | cret := XGFileCreateFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 454 | 488 | ||
| 455 | - | CreateFinishCls := &FileOutputStream{} | |
| 456 | - | CreateFinishCls.Ptr = CreateFinishPtr | |
| 457 | - | return CreateFinishCls | |
| 489 | + | if cret == 0 { | |
| 490 | + | return cls, cerr | |
| 491 | + | } | |
| 492 | + | cls = &FileOutputStream{} | |
| 493 | + | cls.Ptr = cret | |
| 494 | + | if cerr == nil { | |
| 495 | + | return cls, nil | |
| 496 | + | } | |
| 497 | + | return cls, cerr | |
| 458 | 498 | ||
| 459 | 499 | } | |
| 460 | 500 | ||
| @@ -481,16 +521,21 @@ func (x *FileBase) CreateFinish(ResVar AsyncResult) *FileOutputStream { | |||
| 481 | 521 | // Note that in many non-local file cases read and write streams are | |
| 482 | 522 | // not supported, so make sure you really need to do read and write | |
| 483 | 523 | // streaming, rather than just opening for reading or writing. | |
| 484 | - | func (x *FileBase) CreateReadwrite(FlagsVar FileCreateFlags, CancellableVar *Cancellable) *FileIOStream { | |
| 524 | + | func (x *FileBase) CreateReadwrite(FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileIOStream, error) { | |
| 525 | + | var cls *FileIOStream | |
| 526 | + | var cerr *glib.Error | |
| 485 | 527 | ||
| 486 | - | CreateReadwritePtr := XGFileCreateReadwrite(x.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 487 | - | if CreateReadwritePtr == 0 { | |
| 488 | - | return nil | |
| 489 | - | } | |
| 528 | + | cret := XGFileCreateReadwrite(x.GoPointer(), FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 490 | 529 | ||
| 491 | - | CreateReadwriteCls := &FileIOStream{} | |
| 492 | - | CreateReadwriteCls.Ptr = CreateReadwritePtr | |
| 493 | - | return CreateReadwriteCls | |
| 530 | + | if cret == 0 { | |
| 531 | + | return cls, cerr | |
| 532 | + | } | |
| 533 | + | cls = &FileIOStream{} | |
| 534 | + | cls.Ptr = cret | |
| 535 | + | if cerr == nil { | |
| 536 | + | return cls, nil | |
| 537 | + | } | |
| 538 | + | return cls, cerr | |
| 494 | 539 | ||
| 495 | 540 | } | |
| 496 | 541 | ||
| @@ -511,16 +556,21 @@ func (x *FileBase) CreateReadwriteAsync(FlagsVar FileCreateFlags, IoPriorityVar | |||
| 511 | 556 | ||
| 512 | 557 | // Finishes an asynchronous file create operation started with | |
| 513 | 558 | // g_file_create_readwrite_async(). | |
| 514 | - | func (x *FileBase) CreateReadwriteFinish(ResVar AsyncResult) *FileIOStream { | |
| 559 | + | func (x *FileBase) CreateReadwriteFinish(ResVar AsyncResult) (*FileIOStream, error) { | |
| 560 | + | var cls *FileIOStream | |
| 561 | + | var cerr *glib.Error | |
| 515 | 562 | ||
| 516 | - | CreateReadwriteFinishPtr := XGFileCreateReadwriteFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 517 | - | if CreateReadwriteFinishPtr == 0 { | |
| 518 | - | return nil | |
| 519 | - | } | |
| 563 | + | cret := XGFileCreateReadwriteFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 520 | 564 | ||
| 521 | - | CreateReadwriteFinishCls := &FileIOStream{} | |
| 522 | - | CreateReadwriteFinishCls.Ptr = CreateReadwriteFinishPtr | |
| 523 | - | return CreateReadwriteFinishCls | |
| 565 | + | if cret == 0 { | |
| 566 | + | return cls, cerr | |
| 567 | + | } | |
| 568 | + | cls = &FileIOStream{} | |
| 569 | + | cls.Ptr = cret | |
| 570 | + | if cerr == nil { | |
| 571 | + | return cls, nil | |
| 572 | + | } | |
| 573 | + | return cls, cerr | |
| 524 | 574 | ||
| 525 | 575 | } | |
| 526 | 576 | ||
| @@ -547,9 +597,14 @@ func (x *FileBase) CreateReadwriteFinish(ResVar AsyncResult) *FileIOStream { | |||
| 547 | 597 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 548 | 598 | // triggering the cancellable object from another thread. If the operation | |
| 549 | 599 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 550 | - | func (x *FileBase) Delete(CancellableVar *Cancellable) bool { | |
| 600 | + | func (x *FileBase) Delete(CancellableVar *Cancellable) (bool, error) { | |
| 601 | + | var cerr *glib.Error | |
| 551 | 602 | ||
| 552 | - | return XGFileDelete(x.GoPointer(), CancellableVar.GoPointer()) | |
| 603 | + | cret := XGFileDelete(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 604 | + | if cerr == nil { | |
| 605 | + | return cret, nil | |
| 606 | + | } | |
| 607 | + | return cret, cerr | |
| 553 | 608 | ||
| 554 | 609 | } | |
| 555 | 610 | ||
| @@ -563,9 +618,14 @@ func (x *FileBase) DeleteAsync(IoPriorityVar int, CancellableVar *Cancellable, C | |||
| 563 | 618 | } | |
| 564 | 619 | ||
| 565 | 620 | // Finishes deleting a file started with g_file_delete_async(). | |
| 566 | - | func (x *FileBase) DeleteFinish(ResultVar AsyncResult) bool { | |
| 621 | + | func (x *FileBase) DeleteFinish(ResultVar AsyncResult) (bool, error) { | |
| 622 | + | var cerr *glib.Error | |
| 567 | 623 | ||
| 568 | - | return XGFileDeleteFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 624 | + | cret := XGFileDeleteFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 625 | + | if cerr == nil { | |
| 626 | + | return cret, nil | |
| 627 | + | } | |
| 628 | + | return cret, cerr | |
| 569 | 629 | ||
| 570 | 630 | } | |
| 571 | 631 | ||
| @@ -580,16 +640,16 @@ func (x *FileBase) DeleteFinish(ResultVar AsyncResult) bool { | |||
| 580 | 640 | // | |
| 581 | 641 | // This call does no blocking I/O. | |
| 582 | 642 | func (x *FileBase) Dup() *FileBase { | |
| 643 | + | var cls *FileBase | |
| 583 | 644 | ||
| 584 | - | DupPtr := XGFileDup(x.GoPointer()) | |
| 585 | - | if DupPtr == 0 { | |
| 586 | - | return nil | |
| 587 | - | } | |
| 588 | - | ||
| 589 | - | DupCls := &FileBase{} | |
| 590 | - | DupCls.Ptr = DupPtr | |
| 591 | - | return DupCls | |
| 645 | + | cret := XGFileDup(x.GoPointer()) | |
| 592 | 646 | ||
| 647 | + | if cret == 0 { | |
| 648 | + | return cls | |
| 649 | + | } | |
| 650 | + | cls = &FileBase{} | |
| 651 | + | cls.Ptr = cret | |
| 652 | + | return cls | |
| 593 | 653 | } | |
| 594 | 654 | ||
| 595 | 655 | // Starts an asynchronous eject on a mountable. | |
| @@ -608,9 +668,14 @@ func (x *FileBase) EjectMountable(FlagsVar MountUnmountFlags, CancellableVar *Ca | |||
| 608 | 668 | ||
| 609 | 669 | // Finishes an asynchronous eject operation started by | |
| 610 | 670 | // g_file_eject_mountable(). | |
| 611 | - | func (x *FileBase) EjectMountableFinish(ResultVar AsyncResult) bool { | |
| 671 | + | func (x *FileBase) EjectMountableFinish(ResultVar AsyncResult) (bool, error) { | |
| 672 | + | var cerr *glib.Error | |
| 612 | 673 | ||
| 613 | - | return XGFileEjectMountableFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 674 | + | cret := XGFileEjectMountableFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 675 | + | if cerr == nil { | |
| 676 | + | return cret, nil | |
| 677 | + | } | |
| 678 | + | return cret, cerr | |
| 614 | 679 | ||
| 615 | 680 | } | |
| 616 | 681 | ||
| @@ -630,9 +695,14 @@ func (x *FileBase) EjectMountableWithOperation(FlagsVar MountUnmountFlags, Mount | |||
| 630 | 695 | ||
| 631 | 696 | // Finishes an asynchronous eject operation started by | |
| 632 | 697 | // g_file_eject_mountable_with_operation(). | |
| 633 | - | func (x *FileBase) EjectMountableWithOperationFinish(ResultVar AsyncResult) bool { | |
| 698 | + | func (x *FileBase) EjectMountableWithOperationFinish(ResultVar AsyncResult) (bool, error) { | |
| 699 | + | var cerr *glib.Error | |
| 634 | 700 | ||
| 635 | - | return XGFileEjectMountableWithOperationFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 701 | + | cret := XGFileEjectMountableWithOperationFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 702 | + | if cerr == nil { | |
| 703 | + | return cret, nil | |
| 704 | + | } | |
| 705 | + | return cret, cerr | |
| 636 | 706 | ||
| 637 | 707 | } | |
| 638 | 708 | ||
| @@ -661,16 +731,21 @@ func (x *FileBase) EjectMountableWithOperationFinish(ResultVar AsyncResult) bool | |||
| 661 | 731 | // If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will | |
| 662 | 732 | // be returned. If the file is not a directory, the %G_IO_ERROR_NOT_DIRECTORY | |
| 663 | 733 | // error will be returned. Other errors are possible too. | |
| 664 | - | func (x *FileBase) EnumerateChildren(AttributesVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) *FileEnumerator { | |
| 734 | + | func (x *FileBase) EnumerateChildren(AttributesVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (*FileEnumerator, error) { | |
| 735 | + | var cls *FileEnumerator | |
| 736 | + | var cerr *glib.Error | |
| 665 | 737 | ||
| 666 | - | EnumerateChildrenPtr := XGFileEnumerateChildren(x.GoPointer(), AttributesVar, FlagsVar, CancellableVar.GoPointer()) | |
| 667 | - | if EnumerateChildrenPtr == 0 { | |
| 668 | - | return nil | |
| 669 | - | } | |
| 738 | + | cret := XGFileEnumerateChildren(x.GoPointer(), AttributesVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 670 | 739 | ||
| 671 | - | EnumerateChildrenCls := &FileEnumerator{} | |
| 672 | - | EnumerateChildrenCls.Ptr = EnumerateChildrenPtr | |
| 673 | - | return EnumerateChildrenCls | |
| 740 | + | if cret == 0 { | |
| 741 | + | return cls, cerr | |
| 742 | + | } | |
| 743 | + | cls = &FileEnumerator{} | |
| 744 | + | cls.Ptr = cret | |
| 745 | + | if cerr == nil { | |
| 746 | + | return cls, nil | |
| 747 | + | } | |
| 748 | + | return cls, cerr | |
| 674 | 749 | ||
| 675 | 750 | } | |
| 676 | 751 | ||
| @@ -692,16 +767,21 @@ func (x *FileBase) EnumerateChildrenAsync(AttributesVar string, FlagsVar FileQue | |||
| 692 | 767 | ||
| 693 | 768 | // Finishes an async enumerate children operation. | |
| 694 | 769 | // See g_file_enumerate_children_async(). | |
| 695 | - | func (x *FileBase) EnumerateChildrenFinish(ResVar AsyncResult) *FileEnumerator { | |
| 770 | + | func (x *FileBase) EnumerateChildrenFinish(ResVar AsyncResult) (*FileEnumerator, error) { | |
| 771 | + | var cls *FileEnumerator | |
| 772 | + | var cerr *glib.Error | |
| 696 | 773 | ||
| 697 | - | EnumerateChildrenFinishPtr := XGFileEnumerateChildrenFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 698 | - | if EnumerateChildrenFinishPtr == 0 { | |
| 699 | - | return nil | |
| 700 | - | } | |
| 774 | + | cret := XGFileEnumerateChildrenFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 701 | 775 | ||
| 702 | - | EnumerateChildrenFinishCls := &FileEnumerator{} | |
| 703 | - | EnumerateChildrenFinishCls.Ptr = EnumerateChildrenFinishPtr | |
| 704 | - | return EnumerateChildrenFinishCls | |
| 776 | + | if cret == 0 { | |
| 777 | + | return cls, cerr | |
| 778 | + | } | |
| 779 | + | cls = &FileEnumerator{} | |
| 780 | + | cls.Ptr = cret | |
| 781 | + | if cerr == nil { | |
| 782 | + | return cls, nil | |
| 783 | + | } | |
| 784 | + | return cls, cerr | |
| 705 | 785 | ||
| 706 | 786 | } | |
| 707 | 787 | ||
| @@ -714,8 +794,8 @@ func (x *FileBase) EnumerateChildrenFinish(ResVar AsyncResult) *FileEnumerator { | |||
| 714 | 794 | // This call does no blocking I/O. | |
| 715 | 795 | func (x *FileBase) Equal(File2Var File) bool { | |
| 716 | 796 | ||
| 717 | - | return XGFileEqual(x.GoPointer(), File2Var.GoPointer()) | |
| 718 | - | ||
| 797 | + | cret := XGFileEqual(x.GoPointer(), File2Var.GoPointer()) | |
| 798 | + | return cret | |
| 719 | 799 | } | |
| 720 | 800 | ||
| 721 | 801 | // Gets a #GMount for the #GFile. | |
| @@ -727,16 +807,21 @@ func (x *FileBase) Equal(File2Var File) bool { | |||
| 727 | 807 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 728 | 808 | // triggering the cancellable object from another thread. If the operation | |
| 729 | 809 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 730 | - | func (x *FileBase) FindEnclosingMount(CancellableVar *Cancellable) *MountBase { | |
| 810 | + | func (x *FileBase) FindEnclosingMount(CancellableVar *Cancellable) (*MountBase, error) { | |
| 811 | + | var cls *MountBase | |
| 812 | + | var cerr *glib.Error | |
| 731 | 813 | ||
| 732 | - | FindEnclosingMountPtr := XGFileFindEnclosingMount(x.GoPointer(), CancellableVar.GoPointer()) | |
| 733 | - | if FindEnclosingMountPtr == 0 { | |
| 734 | - | return nil | |
| 735 | - | } | |
| 814 | + | cret := XGFileFindEnclosingMount(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 736 | 815 | ||
| 737 | - | FindEnclosingMountCls := &MountBase{} | |
| 738 | - | FindEnclosingMountCls.Ptr = FindEnclosingMountPtr | |
| 739 | - | return FindEnclosingMountCls | |
| 816 | + | if cret == 0 { | |
| 817 | + | return cls, cerr | |
| 818 | + | } | |
| 819 | + | cls = &MountBase{} | |
| 820 | + | cls.Ptr = cret | |
| 821 | + | if cerr == nil { | |
| 822 | + | return cls, nil | |
| 823 | + | } | |
| 824 | + | return cls, cerr | |
| 740 | 825 | ||
| 741 | 826 | } | |
| 742 | 827 | ||
| @@ -756,16 +841,21 @@ func (x *FileBase) FindEnclosingMountAsync(IoPriorityVar int, CancellableVar *Ca | |||
| 756 | 841 | ||
| 757 | 842 | // Finishes an asynchronous find mount request. | |
| 758 | 843 | // See g_file_find_enclosing_mount_async(). | |
| 759 | - | func (x *FileBase) FindEnclosingMountFinish(ResVar AsyncResult) *MountBase { | |
| 844 | + | func (x *FileBase) FindEnclosingMountFinish(ResVar AsyncResult) (*MountBase, error) { | |
| 845 | + | var cls *MountBase | |
| 846 | + | var cerr *glib.Error | |
| 760 | 847 | ||
| 761 | - | FindEnclosingMountFinishPtr := XGFileFindEnclosingMountFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 762 | - | if FindEnclosingMountFinishPtr == 0 { | |
| 763 | - | return nil | |
| 764 | - | } | |
| 848 | + | cret := XGFileFindEnclosingMountFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 765 | 849 | ||
| 766 | - | FindEnclosingMountFinishCls := &MountBase{} | |
| 767 | - | FindEnclosingMountFinishCls.Ptr = FindEnclosingMountFinishPtr | |
| 768 | - | return FindEnclosingMountFinishCls | |
| 850 | + | if cret == 0 { | |
| 851 | + | return cls, cerr | |
| 852 | + | } | |
| 853 | + | cls = &MountBase{} | |
| 854 | + | cls.Ptr = cret | |
| 855 | + | if cerr == nil { | |
| 856 | + | return cls, nil | |
| 857 | + | } | |
| 858 | + | return cls, cerr | |
| 769 | 859 | ||
| 770 | 860 | } | |
| 771 | 861 | ||
| @@ -784,8 +874,8 @@ func (x *FileBase) FindEnclosingMountFinish(ResVar AsyncResult) *MountBase { | |||
| 784 | 874 | // This call does no blocking I/O. | |
| 785 | 875 | func (x *FileBase) GetBasename() string { | |
| 786 | 876 | ||
| 787 | - | return XGFileGetBasename(x.GoPointer()) | |
| 788 | - | ||
| 877 | + | cret := XGFileGetBasename(x.GoPointer()) | |
| 878 | + | return cret | |
| 789 | 879 | } | |
| 790 | 880 | ||
| 791 | 881 | // Gets a child of @file with basename equal to @name. | |
| @@ -796,16 +886,16 @@ func (x *FileBase) GetBasename() string { | |||
| 796 | 886 | // | |
| 797 | 887 | // This call does no blocking I/O. | |
| 798 | 888 | func (x *FileBase) GetChild(NameVar string) *FileBase { | |
| 889 | + | var cls *FileBase | |
| 799 | 890 | ||
| 800 | - | GetChildPtr := XGFileGetChild(x.GoPointer(), NameVar) | |
| 801 | - | if GetChildPtr == 0 { | |
| 802 | - | return nil | |
| 803 | - | } | |
| 804 | - | ||
| 805 | - | GetChildCls := &FileBase{} | |
| 806 | - | GetChildCls.Ptr = GetChildPtr | |
| 807 | - | return GetChildCls | |
| 891 | + | cret := XGFileGetChild(x.GoPointer(), NameVar) | |
| 808 | 892 | ||
| 893 | + | if cret == 0 { | |
| 894 | + | return cls | |
| 895 | + | } | |
| 896 | + | cls = &FileBase{} | |
| 897 | + | cls.Ptr = cret | |
| 898 | + | return cls | |
| 809 | 899 | } | |
| 810 | 900 | ||
| 811 | 901 | // Gets the child of @file for a given @display_name (i.e. a UTF-8 | |
| @@ -816,16 +906,21 @@ func (x *FileBase) GetChild(NameVar string) *FileBase { | |||
| 816 | 906 | // type a filename in the file selector. | |
| 817 | 907 | // | |
| 818 | 908 | // This call does no blocking I/O. | |
| 819 | - | func (x *FileBase) GetChildForDisplayName(DisplayNameVar string) *FileBase { | |
| 909 | + | func (x *FileBase) GetChildForDisplayName(DisplayNameVar string) (*FileBase, error) { | |
| 910 | + | var cls *FileBase | |
| 911 | + | var cerr *glib.Error | |
| 820 | 912 | ||
| 821 | - | GetChildForDisplayNamePtr := XGFileGetChildForDisplayName(x.GoPointer(), DisplayNameVar) | |
| 822 | - | if GetChildForDisplayNamePtr == 0 { | |
| 823 | - | return nil | |
| 824 | - | } | |
| 913 | + | cret := XGFileGetChildForDisplayName(x.GoPointer(), DisplayNameVar, &cerr) | |
| 825 | 914 | ||
| 826 | - | GetChildForDisplayNameCls := &FileBase{} | |
| 827 | - | GetChildForDisplayNameCls.Ptr = GetChildForDisplayNamePtr | |
| 828 | - | return GetChildForDisplayNameCls | |
| 915 | + | if cret == 0 { | |
| 916 | + | return cls, cerr | |
| 917 | + | } | |
| 918 | + | cls = &FileBase{} | |
| 919 | + | cls.Ptr = cret | |
| 920 | + | if cerr == nil { | |
| 921 | + | return cls, nil | |
| 922 | + | } | |
| 923 | + | return cls, cerr | |
| 829 | 924 | ||
| 830 | 925 | } | |
| 831 | 926 | ||
| @@ -835,16 +930,16 @@ func (x *FileBase) GetChildForDisplayName(DisplayNameVar string) *FileBase { | |||
| 835 | 930 | // | |
| 836 | 931 | // This call does no blocking I/O. | |
| 837 | 932 | func (x *FileBase) GetParent() *FileBase { | |
| 933 | + | var cls *FileBase | |
| 838 | 934 | ||
| 839 | - | GetParentPtr := XGFileGetParent(x.GoPointer()) | |
| 840 | - | if GetParentPtr == 0 { | |
| 841 | - | return nil | |
| 842 | - | } | |
| 843 | - | ||
| 844 | - | GetParentCls := &FileBase{} | |
| 845 | - | GetParentCls.Ptr = GetParentPtr | |
| 846 | - | return GetParentCls | |
| 935 | + | cret := XGFileGetParent(x.GoPointer()) | |
| 847 | 936 | ||
| 937 | + | if cret == 0 { | |
| 938 | + | return cls | |
| 939 | + | } | |
| 940 | + | cls = &FileBase{} | |
| 941 | + | cls.Ptr = cret | |
| 942 | + | return cls | |
| 848 | 943 | } | |
| 849 | 944 | ||
| 850 | 945 | // Gets the parse name of the @file. | |
| @@ -863,8 +958,8 @@ func (x *FileBase) GetParent() *FileBase { | |||
| 863 | 958 | // This call does no blocking I/O. | |
| 864 | 959 | func (x *FileBase) GetParseName() string { | |
| 865 | 960 | ||
| 866 | - | return XGFileGetParseName(x.GoPointer()) | |
| 867 | - | ||
| 961 | + | cret := XGFileGetParseName(x.GoPointer()) | |
| 962 | + | return cret | |
| 868 | 963 | } | |
| 869 | 964 | ||
| 870 | 965 | // Gets the local pathname for #GFile, if one exists. If non-%NULL, this is | |
| @@ -873,8 +968,8 @@ func (x *FileBase) GetParseName() string { | |||
| 873 | 968 | // This call does no blocking I/O. | |
| 874 | 969 | func (x *FileBase) GetPath() string { | |
| 875 | 970 | ||
| 876 | - | return XGFileGetPath(x.GoPointer()) | |
| 877 | - | ||
| 971 | + | cret := XGFileGetPath(x.GoPointer()) | |
| 972 | + | return cret | |
| 878 | 973 | } | |
| 879 | 974 | ||
| 880 | 975 | // Gets the path for @descendant relative to @parent. | |
| @@ -882,8 +977,8 @@ func (x *FileBase) GetPath() string { | |||
| 882 | 977 | // This call does no blocking I/O. | |
| 883 | 978 | func (x *FileBase) GetRelativePath(DescendantVar File) string { | |
| 884 | 979 | ||
| 885 | - | return XGFileGetRelativePath(x.GoPointer(), DescendantVar.GoPointer()) | |
| 886 | - | ||
| 980 | + | cret := XGFileGetRelativePath(x.GoPointer(), DescendantVar.GoPointer()) | |
| 981 | + | return cret | |
| 887 | 982 | } | |
| 888 | 983 | ||
| 889 | 984 | // Gets the URI for the @file. | |
| @@ -891,8 +986,8 @@ func (x *FileBase) GetRelativePath(DescendantVar File) string { | |||
| 891 | 986 | // This call does no blocking I/O. | |
| 892 | 987 | func (x *FileBase) GetUri() string { | |
| 893 | 988 | ||
| 894 | - | return XGFileGetUri(x.GoPointer()) | |
| 895 | - | ||
| 989 | + | cret := XGFileGetUri(x.GoPointer()) | |
| 990 | + | return cret | |
| 896 | 991 | } | |
| 897 | 992 | ||
| 898 | 993 | // Gets the URI scheme for a #GFile. | |
| @@ -908,8 +1003,8 @@ func (x *FileBase) GetUri() string { | |||
| 908 | 1003 | // This call does no blocking I/O. | |
| 909 | 1004 | func (x *FileBase) GetUriScheme() string { | |
| 910 | 1005 | ||
| 911 | - | return XGFileGetUriScheme(x.GoPointer()) | |
| 912 | - | ||
| 1006 | + | cret := XGFileGetUriScheme(x.GoPointer()) | |
| 1007 | + | return cret | |
| 913 | 1008 | } | |
| 914 | 1009 | ||
| 915 | 1010 | // Checks if @file has a parent, and optionally, if it is @parent. | |
| @@ -919,8 +1014,8 @@ func (x *FileBase) GetUriScheme() string { | |||
| 919 | 1014 | // if @file is an immediate child of @parent. | |
| 920 | 1015 | func (x *FileBase) HasParent(ParentVar File) bool { | |
| 921 | 1016 | ||
| 922 | - | return XGFileHasParent(x.GoPointer(), ParentVar.GoPointer()) | |
| 923 | - | ||
| 1017 | + | cret := XGFileHasParent(x.GoPointer(), ParentVar.GoPointer()) | |
| 1018 | + | return cret | |
| 924 | 1019 | } | |
| 925 | 1020 | ||
| 926 | 1021 | // Checks whether @file has the prefix specified by @prefix. | |
| @@ -939,8 +1034,8 @@ func (x *FileBase) HasParent(ParentVar File) bool { | |||
| 939 | 1034 | // of @prefix. | |
| 940 | 1035 | func (x *FileBase) HasPrefix(PrefixVar File) bool { | |
| 941 | 1036 | ||
| 942 | - | return XGFileHasPrefix(x.GoPointer(), PrefixVar.GoPointer()) | |
| 943 | - | ||
| 1037 | + | cret := XGFileHasPrefix(x.GoPointer(), PrefixVar.GoPointer()) | |
| 1038 | + | return cret | |
| 944 | 1039 | } | |
| 945 | 1040 | ||
| 946 | 1041 | // Checks to see if a #GFile has a given URI scheme. | |
| @@ -948,8 +1043,8 @@ func (x *FileBase) HasPrefix(PrefixVar File) bool { | |||
| 948 | 1043 | // This call does no blocking I/O. | |
| 949 | 1044 | func (x *FileBase) HasUriScheme(UriSchemeVar string) bool { | |
| 950 | 1045 | ||
| 951 | - | return XGFileHasUriScheme(x.GoPointer(), UriSchemeVar) | |
| 952 | - | ||
| 1046 | + | cret := XGFileHasUriScheme(x.GoPointer(), UriSchemeVar) | |
| 1047 | + | return cret | |
| 953 | 1048 | } | |
| 954 | 1049 | ||
| 955 | 1050 | // Creates a hash value for a #GFile. | |
| @@ -957,8 +1052,8 @@ func (x *FileBase) HasUriScheme(UriSchemeVar string) bool { | |||
| 957 | 1052 | // This call does no blocking I/O. | |
| 958 | 1053 | func (x *FileBase) Hash() uint { | |
| 959 | 1054 | ||
| 960 | - | return XGFileHash(x.GoPointer()) | |
| 961 | - | ||
| 1055 | + | cret := XGFileHash(x.GoPointer()) | |
| 1056 | + | return cret | |
| 962 | 1057 | } | |
| 963 | 1058 | ||
| 964 | 1059 | // Checks to see if a file is native to the platform. | |
| @@ -974,8 +1069,8 @@ func (x *FileBase) Hash() uint { | |||
| 974 | 1069 | // This call does no blocking I/O. | |
| 975 | 1070 | func (x *FileBase) IsNative() bool { | |
| 976 | 1071 | ||
| 977 | - | return XGFileIsNative(x.GoPointer()) | |
| 978 | - | ||
| 1072 | + | cret := XGFileIsNative(x.GoPointer()) | |
| 1073 | + | return cret | |
| 979 | 1074 | } | |
| 980 | 1075 | ||
| 981 | 1076 | // Loads the contents of @file and returns it as #GBytes. | |
| @@ -989,9 +1084,14 @@ func (x *FileBase) IsNative() bool { | |||
| 989 | 1084 | // The data contained in the resulting #GBytes is always zero-terminated, but | |
| 990 | 1085 | // this is not included in the #GBytes length. The resulting #GBytes should be | |
| 991 | 1086 | // freed with g_bytes_unref() when no longer in use. | |
| 992 | - | func (x *FileBase) LoadBytes(CancellableVar *Cancellable, EtagOutVar string) *glib.Bytes { | |
| 1087 | + | func (x *FileBase) LoadBytes(CancellableVar *Cancellable, EtagOutVar string) (*glib.Bytes, error) { | |
| 1088 | + | var cerr *glib.Error | |
| 993 | 1089 | ||
| 994 | - | return XGFileLoadBytes(x.GoPointer(), CancellableVar.GoPointer(), EtagOutVar) | |
| 1090 | + | cret := XGFileLoadBytes(x.GoPointer(), CancellableVar.GoPointer(), EtagOutVar, &cerr) | |
| 1091 | + | if cerr == nil { | |
| 1092 | + | return cret, nil | |
| 1093 | + | } | |
| 1094 | + | return cret, cerr | |
| 995 | 1095 | ||
| 996 | 1096 | } | |
| 997 | 1097 | ||
| @@ -1020,9 +1120,14 @@ func (x *FileBase) LoadBytesAsync(CancellableVar *Cancellable, CallbackVar Async | |||
| 1020 | 1120 | // freed with g_bytes_unref() when no longer in use. | |
| 1021 | 1121 | // | |
| 1022 | 1122 | // See g_file_load_bytes() for more information. | |
| 1023 | - | func (x *FileBase) LoadBytesFinish(ResultVar AsyncResult, EtagOutVar string) *glib.Bytes { | |
| 1123 | + | func (x *FileBase) LoadBytesFinish(ResultVar AsyncResult, EtagOutVar string) (*glib.Bytes, error) { | |
| 1124 | + | var cerr *glib.Error | |
| 1024 | 1125 | ||
| 1025 | - | return XGFileLoadBytesFinish(x.GoPointer(), ResultVar.GoPointer(), EtagOutVar) | |
| 1126 | + | cret := XGFileLoadBytesFinish(x.GoPointer(), ResultVar.GoPointer(), EtagOutVar, &cerr) | |
| 1127 | + | if cerr == nil { | |
| 1128 | + | return cret, nil | |
| 1129 | + | } | |
| 1130 | + | return cret, cerr | |
| 1026 | 1131 | ||
| 1027 | 1132 | } | |
| 1028 | 1133 | ||
| @@ -1034,9 +1139,14 @@ func (x *FileBase) LoadBytesFinish(ResultVar AsyncResult, EtagOutVar string) *gl | |||
| 1034 | 1139 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 1035 | 1140 | // triggering the cancellable object from another thread. If the operation | |
| 1036 | 1141 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 1037 | - | func (x *FileBase) LoadContents(CancellableVar *Cancellable, ContentsVar []string, LengthVar uint, EtagOutVar string) bool { | |
| 1142 | + | func (x *FileBase) LoadContents(CancellableVar *Cancellable, ContentsVar []string, LengthVar uint, EtagOutVar string) (bool, error) { | |
| 1143 | + | var cerr *glib.Error | |
| 1038 | 1144 | ||
| 1039 | - | return XGFileLoadContents(x.GoPointer(), CancellableVar.GoPointer(), ContentsVar, LengthVar, EtagOutVar) | |
| 1145 | + | cret := XGFileLoadContents(x.GoPointer(), CancellableVar.GoPointer(), ContentsVar, LengthVar, EtagOutVar, &cerr) | |
| 1146 | + | if cerr == nil { | |
| 1147 | + | return cret, nil | |
| 1148 | + | } | |
| 1149 | + | return cret, cerr | |
| 1040 | 1150 | ||
| 1041 | 1151 | } | |
| 1042 | 1152 | ||
| @@ -1064,9 +1174,14 @@ func (x *FileBase) LoadContentsAsync(CancellableVar *Cancellable, CallbackVar As | |||
| 1064 | 1174 | // size of the @contents string. The @contents should be freed with | |
| 1065 | 1175 | // g_free() when no longer needed. If @etag_out is present, it will be | |
| 1066 | 1176 | // set to the new entity tag for the @file. | |
| 1067 | - | func (x *FileBase) LoadContentsFinish(ResVar AsyncResult, ContentsVar []string, LengthVar uint, EtagOutVar string) bool { | |
| 1177 | + | func (x *FileBase) LoadContentsFinish(ResVar AsyncResult, ContentsVar []string, LengthVar uint, EtagOutVar string) (bool, error) { | |
| 1178 | + | var cerr *glib.Error | |
| 1068 | 1179 | ||
| 1069 | - | return XGFileLoadContentsFinish(x.GoPointer(), ResVar.GoPointer(), ContentsVar, LengthVar, EtagOutVar) | |
| 1180 | + | cret := XGFileLoadContentsFinish(x.GoPointer(), ResVar.GoPointer(), ContentsVar, LengthVar, EtagOutVar, &cerr) | |
| 1181 | + | if cerr == nil { | |
| 1182 | + | return cret, nil | |
| 1183 | + | } | |
| 1184 | + | return cret, cerr | |
| 1070 | 1185 | ||
| 1071 | 1186 | } | |
| 1072 | 1187 | ||
| @@ -1092,9 +1207,14 @@ func (x *FileBase) LoadPartialContentsAsync(CancellableVar *Cancellable, ReadMor | |||
| 1092 | 1207 | // zero-terminated, but this is not included in the resultant @length. | |
| 1093 | 1208 | // The returned @contents should be freed with g_free() when no longer | |
| 1094 | 1209 | // needed. | |
| 1095 | - | func (x *FileBase) LoadPartialContentsFinish(ResVar AsyncResult, ContentsVar []string, LengthVar uint, EtagOutVar string) bool { | |
| 1210 | + | func (x *FileBase) LoadPartialContentsFinish(ResVar AsyncResult, ContentsVar []string, LengthVar uint, EtagOutVar string) (bool, error) { | |
| 1211 | + | var cerr *glib.Error | |
| 1096 | 1212 | ||
| 1097 | - | return XGFileLoadPartialContentsFinish(x.GoPointer(), ResVar.GoPointer(), ContentsVar, LengthVar, EtagOutVar) | |
| 1213 | + | cret := XGFileLoadPartialContentsFinish(x.GoPointer(), ResVar.GoPointer(), ContentsVar, LengthVar, EtagOutVar, &cerr) | |
| 1214 | + | if cerr == nil { | |
| 1215 | + | return cret, nil | |
| 1216 | + | } | |
| 1217 | + | return cret, cerr | |
| 1098 | 1218 | ||
| 1099 | 1219 | } | |
| 1100 | 1220 | ||
| @@ -1112,9 +1232,14 @@ func (x *FileBase) LoadPartialContentsFinish(ResVar AsyncResult, ContentsVar []s | |||
| 1112 | 1232 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 1113 | 1233 | // triggering the cancellable object from another thread. If the operation | |
| 1114 | 1234 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 1115 | - | func (x *FileBase) MakeDirectory(CancellableVar *Cancellable) bool { | |
| 1235 | + | func (x *FileBase) MakeDirectory(CancellableVar *Cancellable) (bool, error) { | |
| 1236 | + | var cerr *glib.Error | |
| 1116 | 1237 | ||
| 1117 | - | return XGFileMakeDirectory(x.GoPointer(), CancellableVar.GoPointer()) | |
| 1238 | + | cret := XGFileMakeDirectory(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 1239 | + | if cerr == nil { | |
| 1240 | + | return cret, nil | |
| 1241 | + | } | |
| 1242 | + | return cret, cerr | |
| 1118 | 1243 | ||
| 1119 | 1244 | } | |
| 1120 | 1245 | ||
| @@ -1127,9 +1252,14 @@ func (x *FileBase) MakeDirectoryAsync(IoPriorityVar int, CancellableVar *Cancell | |||
| 1127 | 1252 | ||
| 1128 | 1253 | // Finishes an asynchronous directory creation, started with | |
| 1129 | 1254 | // g_file_make_directory_async(). | |
| 1130 | - | func (x *FileBase) MakeDirectoryFinish(ResultVar AsyncResult) bool { | |
| 1255 | + | func (x *FileBase) MakeDirectoryFinish(ResultVar AsyncResult) (bool, error) { | |
| 1256 | + | var cerr *glib.Error | |
| 1131 | 1257 | ||
| 1132 | - | return XGFileMakeDirectoryFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 1258 | + | cret := XGFileMakeDirectoryFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 1259 | + | if cerr == nil { | |
| 1260 | + | return cret, nil | |
| 1261 | + | } | |
| 1262 | + | return cret, cerr | |
| 1133 | 1263 | ||
| 1134 | 1264 | } | |
| 1135 | 1265 | ||
| @@ -1146,9 +1276,14 @@ func (x *FileBase) MakeDirectoryFinish(ResultVar AsyncResult) bool { | |||
| 1146 | 1276 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 1147 | 1277 | // triggering the cancellable object from another thread. If the operation | |
| 1148 | 1278 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 1149 | - | func (x *FileBase) MakeDirectoryWithParents(CancellableVar *Cancellable) bool { | |
| 1279 | + | func (x *FileBase) MakeDirectoryWithParents(CancellableVar *Cancellable) (bool, error) { | |
| 1280 | + | var cerr *glib.Error | |
| 1150 | 1281 | ||
| 1151 | - | return XGFileMakeDirectoryWithParents(x.GoPointer(), CancellableVar.GoPointer()) | |
| 1282 | + | cret := XGFileMakeDirectoryWithParents(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 1283 | + | if cerr == nil { | |
| 1284 | + | return cret, nil | |
| 1285 | + | } | |
| 1286 | + | return cret, cerr | |
| 1152 | 1287 | ||
| 1153 | 1288 | } | |
| 1154 | 1289 | ||
| @@ -1158,9 +1293,14 @@ func (x *FileBase) MakeDirectoryWithParents(CancellableVar *Cancellable) bool { | |||
| 1158 | 1293 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 1159 | 1294 | // triggering the cancellable object from another thread. If the operation | |
| 1160 | 1295 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 1161 | - | func (x *FileBase) MakeSymbolicLink(SymlinkValueVar string, CancellableVar *Cancellable) bool { | |
| 1296 | + | func (x *FileBase) MakeSymbolicLink(SymlinkValueVar string, CancellableVar *Cancellable) (bool, error) { | |
| 1297 | + | var cerr *glib.Error | |
| 1162 | 1298 | ||
| 1163 | - | return XGFileMakeSymbolicLink(x.GoPointer(), SymlinkValueVar, CancellableVar.GoPointer()) | |
| 1299 | + | cret := XGFileMakeSymbolicLink(x.GoPointer(), SymlinkValueVar, CancellableVar.GoPointer(), &cerr) | |
| 1300 | + | if cerr == nil { | |
| 1301 | + | return cret, nil | |
| 1302 | + | } | |
| 1303 | + | return cret, cerr | |
| 1164 | 1304 | ||
| 1165 | 1305 | } | |
| 1166 | 1306 | ||
| @@ -1182,9 +1322,14 @@ func (x *FileBase) MakeSymbolicLink(SymlinkValueVar string, CancellableVar *Canc | |||
| 1182 | 1322 | // periodic progress updates while scanning. See the documentation for | |
| 1183 | 1323 | // #GFileMeasureProgressCallback for information about when and how the | |
| 1184 | 1324 | // callback will be invoked. | |
| 1185 | - | func (x *FileBase) MeasureDiskUsage(FlagsVar FileMeasureFlags, CancellableVar *Cancellable, ProgressCallbackVar FileMeasureProgressCallback, ProgressDataVar uintptr, DiskUsageVar uint64, NumDirsVar uint64, NumFilesVar uint64) bool { | |
| 1325 | + | func (x *FileBase) MeasureDiskUsage(FlagsVar FileMeasureFlags, CancellableVar *Cancellable, ProgressCallbackVar FileMeasureProgressCallback, ProgressDataVar uintptr, DiskUsageVar uint64, NumDirsVar uint64, NumFilesVar uint64) (bool, error) { | |
| 1326 | + | var cerr *glib.Error | |
| 1186 | 1327 | ||
| 1187 | - | return XGFileMeasureDiskUsage(x.GoPointer(), FlagsVar, CancellableVar.GoPointer(), purego.NewCallback(ProgressCallbackVar), ProgressDataVar, DiskUsageVar, NumDirsVar, NumFilesVar) | |
| 1328 | + | cret := XGFileMeasureDiskUsage(x.GoPointer(), FlagsVar, CancellableVar.GoPointer(), purego.NewCallback(ProgressCallbackVar), ProgressDataVar, DiskUsageVar, NumDirsVar, NumFilesVar, &cerr) | |
| 1329 | + | if cerr == nil { | |
| 1330 | + | return cret, nil | |
| 1331 | + | } | |
| 1332 | + | return cret, cerr | |
| 1188 | 1333 | ||
| 1189 | 1334 | } | |
| 1190 | 1335 | ||
| @@ -1201,9 +1346,14 @@ func (x *FileBase) MeasureDiskUsageAsync(FlagsVar FileMeasureFlags, IoPriorityVa | |||
| 1201 | 1346 | // Collects the results from an earlier call to | |
| 1202 | 1347 | // g_file_measure_disk_usage_async(). See g_file_measure_disk_usage() for | |
| 1203 | 1348 | // more information. | |
| 1204 | - | func (x *FileBase) MeasureDiskUsageFinish(ResultVar AsyncResult, DiskUsageVar uint64, NumDirsVar uint64, NumFilesVar uint64) bool { | |
| 1349 | + | func (x *FileBase) MeasureDiskUsageFinish(ResultVar AsyncResult, DiskUsageVar uint64, NumDirsVar uint64, NumFilesVar uint64) (bool, error) { | |
| 1350 | + | var cerr *glib.Error | |
| 1205 | 1351 | ||
| 1206 | - | return XGFileMeasureDiskUsageFinish(x.GoPointer(), ResultVar.GoPointer(), DiskUsageVar, NumDirsVar, NumFilesVar) | |
| 1352 | + | cret := XGFileMeasureDiskUsageFinish(x.GoPointer(), ResultVar.GoPointer(), DiskUsageVar, NumDirsVar, NumFilesVar, &cerr) | |
| 1353 | + | if cerr == nil { | |
| 1354 | + | return cret, nil | |
| 1355 | + | } | |
| 1356 | + | return cret, cerr | |
| 1207 | 1357 | ||
| 1208 | 1358 | } | |
| 1209 | 1359 | ||
| @@ -1213,16 +1363,21 @@ func (x *FileBase) MeasureDiskUsageFinish(ResultVar AsyncResult, DiskUsageVar ui | |||
| 1213 | 1363 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 1214 | 1364 | // triggering the cancellable object from another thread. If the operation | |
| 1215 | 1365 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 1216 | - | func (x *FileBase) Monitor(FlagsVar FileMonitorFlags, CancellableVar *Cancellable) *FileMonitor { | |
| 1366 | + | func (x *FileBase) Monitor(FlagsVar FileMonitorFlags, CancellableVar *Cancellable) (*FileMonitor, error) { | |
| 1367 | + | var cls *FileMonitor | |
| 1368 | + | var cerr *glib.Error | |
| 1217 | 1369 | ||
| 1218 | - | MonitorPtr := XGFileMonitor(x.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 1219 | - | if MonitorPtr == 0 { | |
| 1220 | - | return nil | |
| 1221 | - | } | |
| 1370 | + | cret := XGFileMonitor(x.GoPointer(), FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 1222 | 1371 | ||
| 1223 | - | MonitorCls := &FileMonitor{} | |
| 1224 | - | MonitorCls.Ptr = MonitorPtr | |
| 1225 | - | return MonitorCls | |
| 1372 | + | if cret == 0 { | |
| 1373 | + | return cls, cerr | |
| 1374 | + | } | |
| 1375 | + | cls = &FileMonitor{} | |
| 1376 | + | cls.Ptr = cret | |
| 1377 | + | if cerr == nil { | |
| 1378 | + | return cls, nil | |
| 1379 | + | } | |
| 1380 | + | return cls, cerr | |
| 1226 | 1381 | ||
| 1227 | 1382 | } | |
| 1228 | 1383 | ||
| @@ -1238,16 +1393,21 @@ func (x *FileBase) Monitor(FlagsVar FileMonitorFlags, CancellableVar *Cancellabl | |||
| 1238 | 1393 | // directories. It is not possible to monitor all the files in a | |
| 1239 | 1394 | // directory for changes made via hard links; if you want to do this then | |
| 1240 | 1395 | // you must register individual watches with g_file_monitor(). | |
| 1241 | - | func (x *FileBase) MonitorDirectory(FlagsVar FileMonitorFlags, CancellableVar *Cancellable) *FileMonitor { | |
| 1396 | + | func (x *FileBase) MonitorDirectory(FlagsVar FileMonitorFlags, CancellableVar *Cancellable) (*FileMonitor, error) { | |
| 1397 | + | var cls *FileMonitor | |
| 1398 | + | var cerr *glib.Error | |
| 1242 | 1399 | ||
| 1243 | - | MonitorDirectoryPtr := XGFileMonitorDirectory(x.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 1244 | - | if MonitorDirectoryPtr == 0 { | |
| 1245 | - | return nil | |
| 1246 | - | } | |
| 1400 | + | cret := XGFileMonitorDirectory(x.GoPointer(), FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 1247 | 1401 | ||
| 1248 | - | MonitorDirectoryCls := &FileMonitor{} | |
| 1249 | - | MonitorDirectoryCls.Ptr = MonitorDirectoryPtr | |
| 1250 | - | return MonitorDirectoryCls | |
| 1402 | + | if cret == 0 { | |
| 1403 | + | return cls, cerr | |
| 1404 | + | } | |
| 1405 | + | cls = &FileMonitor{} | |
| 1406 | + | cls.Ptr = cret | |
| 1407 | + | if cerr == nil { | |
| 1408 | + | return cls, nil | |
| 1409 | + | } | |
| 1410 | + | return cls, cerr | |
| 1251 | 1411 | ||
| 1252 | 1412 | } | |
| 1253 | 1413 | ||
| @@ -1265,16 +1425,21 @@ func (x *FileBase) MonitorDirectory(FlagsVar FileMonitorFlags, CancellableVar *C | |||
| 1265 | 1425 | // reported. Using this flag may result in an increase in resource | |
| 1266 | 1426 | // usage, and may not have any effect depending on the #GFileMonitor | |
| 1267 | 1427 | // backend and/or filesystem type. | |
| 1268 | - | func (x *FileBase) MonitorFile(FlagsVar FileMonitorFlags, CancellableVar *Cancellable) *FileMonitor { | |
| 1428 | + | func (x *FileBase) MonitorFile(FlagsVar FileMonitorFlags, CancellableVar *Cancellable) (*FileMonitor, error) { | |
| 1429 | + | var cls *FileMonitor | |
| 1430 | + | var cerr *glib.Error | |
| 1269 | 1431 | ||
| 1270 | - | MonitorFilePtr := XGFileMonitorFile(x.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 1271 | - | if MonitorFilePtr == 0 { | |
| 1272 | - | return nil | |
| 1273 | - | } | |
| 1432 | + | cret := XGFileMonitorFile(x.GoPointer(), FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 1274 | 1433 | ||
| 1275 | - | MonitorFileCls := &FileMonitor{} | |
| 1276 | - | MonitorFileCls.Ptr = MonitorFilePtr | |
| 1277 | - | return MonitorFileCls | |
| 1434 | + | if cret == 0 { | |
| 1435 | + | return cls, cerr | |
| 1436 | + | } | |
| 1437 | + | cls = &FileMonitor{} | |
| 1438 | + | cls.Ptr = cret | |
| 1439 | + | if cerr == nil { | |
| 1440 | + | return cls, nil | |
| 1441 | + | } | |
| 1442 | + | return cls, cerr | |
| 1278 | 1443 | ||
| 1279 | 1444 | } | |
| 1280 | 1445 | ||
| @@ -1295,9 +1460,14 @@ func (x *FileBase) MountEnclosingVolume(FlagsVar MountMountFlags, MountOperation | |||
| 1295 | 1460 | } | |
| 1296 | 1461 | ||
| 1297 | 1462 | // Finishes a mount operation started by g_file_mount_enclosing_volume(). | |
| 1298 | - | func (x *FileBase) MountEnclosingVolumeFinish(ResultVar AsyncResult) bool { | |
| 1463 | + | func (x *FileBase) MountEnclosingVolumeFinish(ResultVar AsyncResult) (bool, error) { | |
| 1464 | + | var cerr *glib.Error | |
| 1299 | 1465 | ||
| 1300 | - | return XGFileMountEnclosingVolumeFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 1466 | + | cret := XGFileMountEnclosingVolumeFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 1467 | + | if cerr == nil { | |
| 1468 | + | return cret, nil | |
| 1469 | + | } | |
| 1470 | + | return cret, cerr | |
| 1301 | 1471 | ||
| 1302 | 1472 | } | |
| 1303 | 1473 | ||
| @@ -1322,16 +1492,21 @@ func (x *FileBase) MountMountable(FlagsVar MountMountFlags, MountOperationVar *M | |||
| 1322 | 1492 | // | |
| 1323 | 1493 | // Finish an asynchronous mount operation that was started | |
| 1324 | 1494 | // with g_file_mount_mountable(). | |
| 1325 | - | func (x *FileBase) MountMountableFinish(ResultVar AsyncResult) *FileBase { | |
| 1495 | + | func (x *FileBase) MountMountableFinish(ResultVar AsyncResult) (*FileBase, error) { | |
| 1496 | + | var cls *FileBase | |
| 1497 | + | var cerr *glib.Error | |
| 1326 | 1498 | ||
| 1327 | - | MountMountableFinishPtr := XGFileMountMountableFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 1328 | - | if MountMountableFinishPtr == 0 { | |
| 1329 | - | return nil | |
| 1330 | - | } | |
| 1499 | + | cret := XGFileMountMountableFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 1331 | 1500 | ||
| 1332 | - | MountMountableFinishCls := &FileBase{} | |
| 1333 | - | MountMountableFinishCls.Ptr = MountMountableFinishPtr | |
| 1334 | - | return MountMountableFinishCls | |
| 1501 | + | if cret == 0 { | |
| 1502 | + | return cls, cerr | |
| 1503 | + | } | |
| 1504 | + | cls = &FileBase{} | |
| 1505 | + | cls.Ptr = cret | |
| 1506 | + | if cerr == nil { | |
| 1507 | + | return cls, nil | |
| 1508 | + | } | |
| 1509 | + | return cls, cerr | |
| 1335 | 1510 | ||
| 1336 | 1511 | } | |
| 1337 | 1512 | ||
| @@ -1368,9 +1543,14 @@ func (x *FileBase) MountMountableFinish(ResultVar AsyncResult) *FileBase { | |||
| 1368 | 1543 | // %G_FILE_COPY_OVERWRITE is specified and the target is a file, then | |
| 1369 | 1544 | // the %G_IO_ERROR_WOULD_RECURSE error may be returned (if the native | |
| 1370 | 1545 | // move operation isn't available). | |
| 1371 | - | func (x *FileBase) Move(DestinationVar File, FlagsVar FileCopyFlags, CancellableVar *Cancellable, ProgressCallbackVar FileProgressCallback, ProgressCallbackDataVar uintptr) bool { | |
| 1546 | + | func (x *FileBase) Move(DestinationVar File, FlagsVar FileCopyFlags, CancellableVar *Cancellable, ProgressCallbackVar FileProgressCallback, ProgressCallbackDataVar uintptr) (bool, error) { | |
| 1547 | + | var cerr *glib.Error | |
| 1372 | 1548 | ||
| 1373 | - | return XGFileMove(x.GoPointer(), DestinationVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), purego.NewCallback(ProgressCallbackVar), ProgressCallbackDataVar) | |
| 1549 | + | cret := XGFileMove(x.GoPointer(), DestinationVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), purego.NewCallback(ProgressCallbackVar), ProgressCallbackDataVar, &cerr) | |
| 1550 | + | if cerr == nil { | |
| 1551 | + | return cret, nil | |
| 1552 | + | } | |
| 1553 | + | return cret, cerr | |
| 1374 | 1554 | ||
| 1375 | 1555 | } | |
| 1376 | 1556 | ||
| @@ -1391,9 +1571,14 @@ func (x *FileBase) MoveAsync(DestinationVar File, FlagsVar FileCopyFlags, IoPrio | |||
| 1391 | 1571 | ||
| 1392 | 1572 | // Finishes an asynchronous file movement, started with | |
| 1393 | 1573 | // g_file_move_async(). | |
| 1394 | - | func (x *FileBase) MoveFinish(ResultVar AsyncResult) bool { | |
| 1574 | + | func (x *FileBase) MoveFinish(ResultVar AsyncResult) (bool, error) { | |
| 1575 | + | var cerr *glib.Error | |
| 1395 | 1576 | ||
| 1396 | - | return XGFileMoveFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 1577 | + | cret := XGFileMoveFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 1578 | + | if cerr == nil { | |
| 1579 | + | return cret, nil | |
| 1580 | + | } | |
| 1581 | + | return cret, cerr | |
| 1397 | 1582 | ||
| 1398 | 1583 | } | |
| 1399 | 1584 | ||
| @@ -1413,16 +1598,21 @@ func (x *FileBase) MoveFinish(ResultVar AsyncResult) bool { | |||
| 1413 | 1598 | // file cases read and write streams are not supported, so make sure you | |
| 1414 | 1599 | // really need to do read and write streaming, rather than just opening | |
| 1415 | 1600 | // for reading or writing. | |
| 1416 | - | func (x *FileBase) OpenReadwrite(CancellableVar *Cancellable) *FileIOStream { | |
| 1601 | + | func (x *FileBase) OpenReadwrite(CancellableVar *Cancellable) (*FileIOStream, error) { | |
| 1602 | + | var cls *FileIOStream | |
| 1603 | + | var cerr *glib.Error | |
| 1417 | 1604 | ||
| 1418 | - | OpenReadwritePtr := XGFileOpenReadwrite(x.GoPointer(), CancellableVar.GoPointer()) | |
| 1419 | - | if OpenReadwritePtr == 0 { | |
| 1420 | - | return nil | |
| 1421 | - | } | |
| 1605 | + | cret := XGFileOpenReadwrite(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 1422 | 1606 | ||
| 1423 | - | OpenReadwriteCls := &FileIOStream{} | |
| 1424 | - | OpenReadwriteCls.Ptr = OpenReadwritePtr | |
| 1425 | - | return OpenReadwriteCls | |
| 1607 | + | if cret == 0 { | |
| 1608 | + | return cls, cerr | |
| 1609 | + | } | |
| 1610 | + | cls = &FileIOStream{} | |
| 1611 | + | cls.Ptr = cret | |
| 1612 | + | if cerr == nil { | |
| 1613 | + | return cls, nil | |
| 1614 | + | } | |
| 1615 | + | return cls, cerr | |
| 1426 | 1616 | ||
| 1427 | 1617 | } | |
| 1428 | 1618 | ||
| @@ -1442,16 +1632,21 @@ func (x *FileBase) OpenReadwriteAsync(IoPriorityVar int, CancellableVar *Cancell | |||
| 1442 | 1632 | ||
| 1443 | 1633 | // Finishes an asynchronous file read operation started with | |
| 1444 | 1634 | // g_file_open_readwrite_async(). | |
| 1445 | - | func (x *FileBase) OpenReadwriteFinish(ResVar AsyncResult) *FileIOStream { | |
| 1635 | + | func (x *FileBase) OpenReadwriteFinish(ResVar AsyncResult) (*FileIOStream, error) { | |
| 1636 | + | var cls *FileIOStream | |
| 1637 | + | var cerr *glib.Error | |
| 1446 | 1638 | ||
| 1447 | - | OpenReadwriteFinishPtr := XGFileOpenReadwriteFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 1448 | - | if OpenReadwriteFinishPtr == 0 { | |
| 1449 | - | return nil | |
| 1450 | - | } | |
| 1639 | + | cret := XGFileOpenReadwriteFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 1451 | 1640 | ||
| 1452 | - | OpenReadwriteFinishCls := &FileIOStream{} | |
| 1453 | - | OpenReadwriteFinishCls.Ptr = OpenReadwriteFinishPtr | |
| 1454 | - | return OpenReadwriteFinishCls | |
| 1641 | + | if cret == 0 { | |
| 1642 | + | return cls, cerr | |
| 1643 | + | } | |
| 1644 | + | cls = &FileIOStream{} | |
| 1645 | + | cls.Ptr = cret | |
| 1646 | + | if cerr == nil { | |
| 1647 | + | return cls, nil | |
| 1648 | + | } | |
| 1649 | + | return cls, cerr | |
| 1455 | 1650 | ||
| 1456 | 1651 | } | |
| 1457 | 1652 | ||
| @@ -1464,8 +1659,8 @@ func (x *FileBase) OpenReadwriteFinish(ResVar AsyncResult) *FileIOStream { | |||
| 1464 | 1659 | // This call does no blocking I/O. | |
| 1465 | 1660 | func (x *FileBase) PeekPath() string { | |
| 1466 | 1661 | ||
| 1467 | - | return XGFilePeekPath(x.GoPointer()) | |
| 1468 | - | ||
| 1662 | + | cret := XGFilePeekPath(x.GoPointer()) | |
| 1663 | + | return cret | |
| 1469 | 1664 | } | |
| 1470 | 1665 | ||
| 1471 | 1666 | // Polls a file of type %G_FILE_TYPE_MOUNTABLE. | |
| @@ -1487,9 +1682,14 @@ func (x *FileBase) PollMountable(CancellableVar *Cancellable, CallbackVar AsyncR | |||
| 1487 | 1682 | // | |
| 1488 | 1683 | // Finish an asynchronous poll operation that was polled | |
| 1489 | 1684 | // with g_file_poll_mountable(). | |
| 1490 | - | func (x *FileBase) PollMountableFinish(ResultVar AsyncResult) bool { | |
| 1685 | + | func (x *FileBase) PollMountableFinish(ResultVar AsyncResult) (bool, error) { | |
| 1686 | + | var cerr *glib.Error | |
| 1491 | 1687 | ||
| 1492 | - | return XGFilePollMountableFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 1688 | + | cret := XGFilePollMountableFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 1689 | + | if cerr == nil { | |
| 1690 | + | return cret, nil | |
| 1691 | + | } | |
| 1692 | + | return cret, cerr | |
| 1493 | 1693 | ||
| 1494 | 1694 | } | |
| 1495 | 1695 | ||
| @@ -1499,16 +1699,21 @@ func (x *FileBase) PollMountableFinish(ResultVar AsyncResult) bool { | |||
| 1499 | 1699 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 1500 | 1700 | // triggering the cancellable object from another thread. If the operation | |
| 1501 | 1701 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 1502 | - | func (x *FileBase) QueryDefaultHandler(CancellableVar *Cancellable) *AppInfoBase { | |
| 1702 | + | func (x *FileBase) QueryDefaultHandler(CancellableVar *Cancellable) (*AppInfoBase, error) { | |
| 1703 | + | var cls *AppInfoBase | |
| 1704 | + | var cerr *glib.Error | |
| 1503 | 1705 | ||
| 1504 | - | QueryDefaultHandlerPtr := XGFileQueryDefaultHandler(x.GoPointer(), CancellableVar.GoPointer()) | |
| 1505 | - | if QueryDefaultHandlerPtr == 0 { | |
| 1506 | - | return nil | |
| 1507 | - | } | |
| 1706 | + | cret := XGFileQueryDefaultHandler(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 1508 | 1707 | ||
| 1509 | - | QueryDefaultHandlerCls := &AppInfoBase{} | |
| 1510 | - | QueryDefaultHandlerCls.Ptr = QueryDefaultHandlerPtr | |
| 1511 | - | return QueryDefaultHandlerCls | |
| 1708 | + | if cret == 0 { | |
| 1709 | + | return cls, cerr | |
| 1710 | + | } | |
| 1711 | + | cls = &AppInfoBase{} | |
| 1712 | + | cls.Ptr = cret | |
| 1713 | + | if cerr == nil { | |
| 1714 | + | return cls, nil | |
| 1715 | + | } | |
| 1716 | + | return cls, cerr | |
| 1512 | 1717 | ||
| 1513 | 1718 | } | |
| 1514 | 1719 | ||
| @@ -1520,16 +1725,21 @@ func (x *FileBase) QueryDefaultHandlerAsync(IoPriorityVar int, CancellableVar *C | |||
| 1520 | 1725 | } | |
| 1521 | 1726 | ||
| 1522 | 1727 | // Finishes a g_file_query_default_handler_async() operation. | |
| 1523 | - | func (x *FileBase) QueryDefaultHandlerFinish(ResultVar AsyncResult) *AppInfoBase { | |
| 1728 | + | func (x *FileBase) QueryDefaultHandlerFinish(ResultVar AsyncResult) (*AppInfoBase, error) { | |
| 1729 | + | var cls *AppInfoBase | |
| 1730 | + | var cerr *glib.Error | |
| 1524 | 1731 | ||
| 1525 | - | QueryDefaultHandlerFinishPtr := XGFileQueryDefaultHandlerFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 1526 | - | if QueryDefaultHandlerFinishPtr == 0 { | |
| 1527 | - | return nil | |
| 1528 | - | } | |
| 1732 | + | cret := XGFileQueryDefaultHandlerFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 1529 | 1733 | ||
| 1530 | - | QueryDefaultHandlerFinishCls := &AppInfoBase{} | |
| 1531 | - | QueryDefaultHandlerFinishCls.Ptr = QueryDefaultHandlerFinishPtr | |
| 1532 | - | return QueryDefaultHandlerFinishCls | |
| 1734 | + | if cret == 0 { | |
| 1735 | + | return cls, cerr | |
| 1736 | + | } | |
| 1737 | + | cls = &AppInfoBase{} | |
| 1738 | + | cls.Ptr = cret | |
| 1739 | + | if cerr == nil { | |
| 1740 | + | return cls, nil | |
| 1741 | + | } | |
| 1742 | + | return cls, cerr | |
| 1533 | 1743 | ||
| 1534 | 1744 | } | |
| 1535 | 1745 | ||
| @@ -1557,8 +1767,8 @@ func (x *FileBase) QueryDefaultHandlerFinish(ResultVar AsyncResult) *AppInfoBase | |||
| 1557 | 1767 | // that can happen due to races when you execute the operation. | |
| 1558 | 1768 | func (x *FileBase) QueryExists(CancellableVar *Cancellable) bool { | |
| 1559 | 1769 | ||
| 1560 | - | return XGFileQueryExists(x.GoPointer(), CancellableVar.GoPointer()) | |
| 1561 | - | ||
| 1770 | + | cret := XGFileQueryExists(x.GoPointer(), CancellableVar.GoPointer()) | |
| 1771 | + | return cret | |
| 1562 | 1772 | } | |
| 1563 | 1773 | ||
| 1564 | 1774 | // Utility function to inspect the #GFileType of a file. This is | |
| @@ -1568,8 +1778,8 @@ func (x *FileBase) QueryExists(CancellableVar *Cancellable) bool { | |||
| 1568 | 1778 | // a regular file, directory, or symlink. | |
| 1569 | 1779 | func (x *FileBase) QueryFileType(FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) FileType { | |
| 1570 | 1780 | ||
| 1571 | - | return XGFileQueryFileType(x.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 1572 | - | ||
| 1781 | + | cret := XGFileQueryFileType(x.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 1782 | + | return cret | |
| 1573 | 1783 | } | |
| 1574 | 1784 | ||
| 1575 | 1785 | // Similar to g_file_query_info(), but obtains information | |
| @@ -1597,16 +1807,21 @@ func (x *FileBase) QueryFileType(FlagsVar FileQueryInfoFlags, CancellableVar *Ca | |||
| 1597 | 1807 | // If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will | |
| 1598 | 1808 | // be returned. Other errors are possible too, and depend on what | |
| 1599 | 1809 | // kind of filesystem the file is on. | |
| 1600 | - | func (x *FileBase) QueryFilesystemInfo(AttributesVar string, CancellableVar *Cancellable) *FileInfo { | |
| 1810 | + | func (x *FileBase) QueryFilesystemInfo(AttributesVar string, CancellableVar *Cancellable) (*FileInfo, error) { | |
| 1811 | + | var cls *FileInfo | |
| 1812 | + | var cerr *glib.Error | |
| 1601 | 1813 | ||
| 1602 | - | QueryFilesystemInfoPtr := XGFileQueryFilesystemInfo(x.GoPointer(), AttributesVar, CancellableVar.GoPointer()) | |
| 1603 | - | if QueryFilesystemInfoPtr == 0 { | |
| 1604 | - | return nil | |
| 1605 | - | } | |
| 1814 | + | cret := XGFileQueryFilesystemInfo(x.GoPointer(), AttributesVar, CancellableVar.GoPointer(), &cerr) | |
| 1606 | 1815 | ||
| 1607 | - | QueryFilesystemInfoCls := &FileInfo{} | |
| 1608 | - | QueryFilesystemInfoCls.Ptr = QueryFilesystemInfoPtr | |
| 1609 | - | return QueryFilesystemInfoCls | |
| 1816 | + | if cret == 0 { | |
| 1817 | + | return cls, cerr | |
| 1818 | + | } | |
| 1819 | + | cls = &FileInfo{} | |
| 1820 | + | cls.Ptr = cret | |
| 1821 | + | if cerr == nil { | |
| 1822 | + | return cls, nil | |
| 1823 | + | } | |
| 1824 | + | return cls, cerr | |
| 1610 | 1825 | ||
| 1611 | 1826 | } | |
| 1612 | 1827 | ||
| @@ -1629,16 +1844,21 @@ func (x *FileBase) QueryFilesystemInfoAsync(AttributesVar string, IoPriorityVar | |||
| 1629 | 1844 | ||
| 1630 | 1845 | // Finishes an asynchronous filesystem info query. | |
| 1631 | 1846 | // See g_file_query_filesystem_info_async(). | |
| 1632 | - | func (x *FileBase) QueryFilesystemInfoFinish(ResVar AsyncResult) *FileInfo { | |
| 1847 | + | func (x *FileBase) QueryFilesystemInfoFinish(ResVar AsyncResult) (*FileInfo, error) { | |
| 1848 | + | var cls *FileInfo | |
| 1849 | + | var cerr *glib.Error | |
| 1633 | 1850 | ||
| 1634 | - | QueryFilesystemInfoFinishPtr := XGFileQueryFilesystemInfoFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 1635 | - | if QueryFilesystemInfoFinishPtr == 0 { | |
| 1636 | - | return nil | |
| 1637 | - | } | |
| 1851 | + | cret := XGFileQueryFilesystemInfoFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 1638 | 1852 | ||
| 1639 | - | QueryFilesystemInfoFinishCls := &FileInfo{} | |
| 1640 | - | QueryFilesystemInfoFinishCls.Ptr = QueryFilesystemInfoFinishPtr | |
| 1641 | - | return QueryFilesystemInfoFinishCls | |
| 1853 | + | if cret == 0 { | |
| 1854 | + | return cls, cerr | |
| 1855 | + | } | |
| 1856 | + | cls = &FileInfo{} | |
| 1857 | + | cls.Ptr = cret | |
| 1858 | + | if cerr == nil { | |
| 1859 | + | return cls, nil | |
| 1860 | + | } | |
| 1861 | + | return cls, cerr | |
| 1642 | 1862 | ||
| 1643 | 1863 | } | |
| 1644 | 1864 | ||
| @@ -1672,16 +1892,21 @@ func (x *FileBase) QueryFilesystemInfoFinish(ResVar AsyncResult) *FileInfo { | |||
| 1672 | 1892 | // If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be | |
| 1673 | 1893 | // returned. Other errors are possible too, and depend on what kind of | |
| 1674 | 1894 | // filesystem the file is on. | |
| 1675 | - | func (x *FileBase) QueryInfo(AttributesVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) *FileInfo { | |
| 1895 | + | func (x *FileBase) QueryInfo(AttributesVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (*FileInfo, error) { | |
| 1896 | + | var cls *FileInfo | |
| 1897 | + | var cerr *glib.Error | |
| 1676 | 1898 | ||
| 1677 | - | QueryInfoPtr := XGFileQueryInfo(x.GoPointer(), AttributesVar, FlagsVar, CancellableVar.GoPointer()) | |
| 1678 | - | if QueryInfoPtr == 0 { | |
| 1679 | - | return nil | |
| 1680 | - | } | |
| 1899 | + | cret := XGFileQueryInfo(x.GoPointer(), AttributesVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 1681 | 1900 | ||
| 1682 | - | QueryInfoCls := &FileInfo{} | |
| 1683 | - | QueryInfoCls.Ptr = QueryInfoPtr | |
| 1684 | - | return QueryInfoCls | |
| 1901 | + | if cret == 0 { | |
| 1902 | + | return cls, cerr | |
| 1903 | + | } | |
| 1904 | + | cls = &FileInfo{} | |
| 1905 | + | cls.Ptr = cret | |
| 1906 | + | if cerr == nil { | |
| 1907 | + | return cls, nil | |
| 1908 | + | } | |
| 1909 | + | return cls, cerr | |
| 1685 | 1910 | ||
| 1686 | 1911 | } | |
| 1687 | 1912 | ||
| @@ -1702,16 +1927,21 @@ func (x *FileBase) QueryInfoAsync(AttributesVar string, FlagsVar FileQueryInfoFl | |||
| 1702 | 1927 | ||
| 1703 | 1928 | // Finishes an asynchronous file info query. | |
| 1704 | 1929 | // See g_file_query_info_async(). | |
| 1705 | - | func (x *FileBase) QueryInfoFinish(ResVar AsyncResult) *FileInfo { | |
| 1930 | + | func (x *FileBase) QueryInfoFinish(ResVar AsyncResult) (*FileInfo, error) { | |
| 1931 | + | var cls *FileInfo | |
| 1932 | + | var cerr *glib.Error | |
| 1706 | 1933 | ||
| 1707 | - | QueryInfoFinishPtr := XGFileQueryInfoFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 1708 | - | if QueryInfoFinishPtr == 0 { | |
| 1709 | - | return nil | |
| 1710 | - | } | |
| 1934 | + | cret := XGFileQueryInfoFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 1711 | 1935 | ||
| 1712 | - | QueryInfoFinishCls := &FileInfo{} | |
| 1713 | - | QueryInfoFinishCls.Ptr = QueryInfoFinishPtr | |
| 1714 | - | return QueryInfoFinishCls | |
| 1936 | + | if cret == 0 { | |
| 1937 | + | return cls, cerr | |
| 1938 | + | } | |
| 1939 | + | cls = &FileInfo{} | |
| 1940 | + | cls.Ptr = cret | |
| 1941 | + | if cerr == nil { | |
| 1942 | + | return cls, nil | |
| 1943 | + | } | |
| 1944 | + | return cls, cerr | |
| 1715 | 1945 | ||
| 1716 | 1946 | } | |
| 1717 | 1947 | ||
| @@ -1725,9 +1955,14 @@ func (x *FileBase) QueryInfoFinish(ResVar AsyncResult) *FileInfo { | |||
| 1725 | 1955 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 1726 | 1956 | // triggering the cancellable object from another thread. If the operation | |
| 1727 | 1957 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 1728 | - | func (x *FileBase) QuerySettableAttributes(CancellableVar *Cancellable) *FileAttributeInfoList { | |
| 1958 | + | func (x *FileBase) QuerySettableAttributes(CancellableVar *Cancellable) (*FileAttributeInfoList, error) { | |
| 1959 | + | var cerr *glib.Error | |
| 1729 | 1960 | ||
| 1730 | - | return XGFileQuerySettableAttributes(x.GoPointer(), CancellableVar.GoPointer()) | |
| 1961 | + | cret := XGFileQuerySettableAttributes(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 1962 | + | if cerr == nil { | |
| 1963 | + | return cret, nil | |
| 1964 | + | } | |
| 1965 | + | return cret, cerr | |
| 1731 | 1966 | ||
| 1732 | 1967 | } | |
| 1733 | 1968 | ||
| @@ -1738,9 +1973,14 @@ func (x *FileBase) QuerySettableAttributes(CancellableVar *Cancellable) *FileAtt | |||
| 1738 | 1973 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 1739 | 1974 | // triggering the cancellable object from another thread. If the operation | |
| 1740 | 1975 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 1741 | - | func (x *FileBase) QueryWritableNamespaces(CancellableVar *Cancellable) *FileAttributeInfoList { | |
| 1976 | + | func (x *FileBase) QueryWritableNamespaces(CancellableVar *Cancellable) (*FileAttributeInfoList, error) { | |
| 1977 | + | var cerr *glib.Error | |
| 1742 | 1978 | ||
| 1743 | - | return XGFileQueryWritableNamespaces(x.GoPointer(), CancellableVar.GoPointer()) | |
| 1979 | + | cret := XGFileQueryWritableNamespaces(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 1980 | + | if cerr == nil { | |
| 1981 | + | return cret, nil | |
| 1982 | + | } | |
| 1983 | + | return cret, cerr | |
| 1744 | 1984 | ||
| 1745 | 1985 | } | |
| 1746 | 1986 | ||
| @@ -1755,16 +1995,21 @@ func (x *FileBase) QueryWritableNamespaces(CancellableVar *Cancellable) *FileAtt | |||
| 1755 | 1995 | // returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY | |
| 1756 | 1996 | // error will be returned. Other errors are possible too, and depend | |
| 1757 | 1997 | // on what kind of filesystem the file is on. | |
| 1758 | - | func (x *FileBase) Read(CancellableVar *Cancellable) *FileInputStream { | |
| 1998 | + | func (x *FileBase) Read(CancellableVar *Cancellable) (*FileInputStream, error) { | |
| 1999 | + | var cls *FileInputStream | |
| 2000 | + | var cerr *glib.Error | |
| 1759 | 2001 | ||
| 1760 | - | ReadPtr := XGFileRead(x.GoPointer(), CancellableVar.GoPointer()) | |
| 1761 | - | if ReadPtr == 0 { | |
| 1762 | - | return nil | |
| 1763 | - | } | |
| 2002 | + | cret := XGFileRead(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 1764 | 2003 | ||
| 1765 | - | ReadCls := &FileInputStream{} | |
| 1766 | - | ReadCls.Ptr = ReadPtr | |
| 1767 | - | return ReadCls | |
| 2004 | + | if cret == 0 { | |
| 2005 | + | return cls, cerr | |
| 2006 | + | } | |
| 2007 | + | cls = &FileInputStream{} | |
| 2008 | + | cls.Ptr = cret | |
| 2009 | + | if cerr == nil { | |
| 2010 | + | return cls, nil | |
| 2011 | + | } | |
| 2012 | + | return cls, cerr | |
| 1768 | 2013 | ||
| 1769 | 2014 | } | |
| 1770 | 2015 | ||
| @@ -1784,16 +2029,21 @@ func (x *FileBase) ReadAsync(IoPriorityVar int, CancellableVar *Cancellable, Cal | |||
| 1784 | 2029 | ||
| 1785 | 2030 | // Finishes an asynchronous file read operation started with | |
| 1786 | 2031 | // g_file_read_async(). | |
| 1787 | - | func (x *FileBase) ReadFinish(ResVar AsyncResult) *FileInputStream { | |
| 2032 | + | func (x *FileBase) ReadFinish(ResVar AsyncResult) (*FileInputStream, error) { | |
| 2033 | + | var cls *FileInputStream | |
| 2034 | + | var cerr *glib.Error | |
| 1788 | 2035 | ||
| 1789 | - | ReadFinishPtr := XGFileReadFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 1790 | - | if ReadFinishPtr == 0 { | |
| 1791 | - | return nil | |
| 1792 | - | } | |
| 2036 | + | cret := XGFileReadFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 1793 | 2037 | ||
| 1794 | - | ReadFinishCls := &FileInputStream{} | |
| 1795 | - | ReadFinishCls.Ptr = ReadFinishPtr | |
| 1796 | - | return ReadFinishCls | |
| 2038 | + | if cret == 0 { | |
| 2039 | + | return cls, cerr | |
| 2040 | + | } | |
| 2041 | + | cls = &FileInputStream{} | |
| 2042 | + | cls.Ptr = cret | |
| 2043 | + | if cerr == nil { | |
| 2044 | + | return cls, nil | |
| 2045 | + | } | |
| 2046 | + | return cls, cerr | |
| 1797 | 2047 | ||
| 1798 | 2048 | } | |
| 1799 | 2049 | ||
| @@ -1838,16 +2088,21 @@ func (x *FileBase) ReadFinish(ResVar AsyncResult) *FileInputStream { | |||
| 1838 | 2088 | // %G_IO_ERROR_INVALID_FILENAME error, and if the name is to long | |
| 1839 | 2089 | // %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are | |
| 1840 | 2090 | // possible too, and depend on what kind of filesystem the file is on. | |
| 1841 | - | func (x *FileBase) Replace(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) *FileOutputStream { | |
| 2091 | + | func (x *FileBase) Replace(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileOutputStream, error) { | |
| 2092 | + | var cls *FileOutputStream | |
| 2093 | + | var cerr *glib.Error | |
| 1842 | 2094 | ||
| 1843 | - | ReplacePtr := XGFileReplace(x.GoPointer(), EtagVar, MakeBackupVar, FlagsVar, CancellableVar.GoPointer()) | |
| 1844 | - | if ReplacePtr == 0 { | |
| 1845 | - | return nil | |
| 1846 | - | } | |
| 2095 | + | cret := XGFileReplace(x.GoPointer(), EtagVar, MakeBackupVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 1847 | 2096 | ||
| 1848 | - | ReplaceCls := &FileOutputStream{} | |
| 1849 | - | ReplaceCls.Ptr = ReplacePtr | |
| 1850 | - | return ReplaceCls | |
| 2097 | + | if cret == 0 { | |
| 2098 | + | return cls, cerr | |
| 2099 | + | } | |
| 2100 | + | cls = &FileOutputStream{} | |
| 2101 | + | cls.Ptr = cret | |
| 2102 | + | if cerr == nil { | |
| 2103 | + | return cls, nil | |
| 2104 | + | } | |
| 2105 | + | return cls, cerr | |
| 1851 | 2106 | ||
| 1852 | 2107 | } | |
| 1853 | 2108 | ||
| @@ -1882,9 +2137,14 @@ func (x *FileBase) ReplaceAsync(EtagVar string, MakeBackupVar bool, FlagsVar Fil | |||
| 1882 | 2137 | // | |
| 1883 | 2138 | // The returned @new_etag can be used to verify that the file hasn't | |
| 1884 | 2139 | // changed the next time it is saved over. | |
| 1885 | - | func (x *FileBase) ReplaceContents(ContentsVar string, LengthVar uint, EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, NewEtagVar string, CancellableVar *Cancellable) bool { | |
| 2140 | + | func (x *FileBase) ReplaceContents(ContentsVar string, LengthVar uint, EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, NewEtagVar string, CancellableVar *Cancellable) (bool, error) { | |
| 2141 | + | var cerr *glib.Error | |
| 1886 | 2142 | ||
| 1887 | - | return XGFileReplaceContents(x.GoPointer(), ContentsVar, LengthVar, EtagVar, MakeBackupVar, FlagsVar, NewEtagVar, CancellableVar.GoPointer()) | |
| 2143 | + | cret := XGFileReplaceContents(x.GoPointer(), ContentsVar, LengthVar, EtagVar, MakeBackupVar, FlagsVar, NewEtagVar, CancellableVar.GoPointer(), &cerr) | |
| 2144 | + | if cerr == nil { | |
| 2145 | + | return cret, nil | |
| 2146 | + | } | |
| 2147 | + | return cret, cerr | |
| 1888 | 2148 | ||
| 1889 | 2149 | } | |
| 1890 | 2150 | ||
| @@ -1930,24 +2190,34 @@ func (x *FileBase) ReplaceContentsBytesAsync(ContentsVar *glib.Bytes, EtagVar st | |||
| 1930 | 2190 | // Finishes an asynchronous replace of the given @file. See | |
| 1931 | 2191 | // g_file_replace_contents_async(). Sets @new_etag to the new entity | |
| 1932 | 2192 | // tag for the document, if present. | |
| 1933 | - | func (x *FileBase) ReplaceContentsFinish(ResVar AsyncResult, NewEtagVar string) bool { | |
| 2193 | + | func (x *FileBase) ReplaceContentsFinish(ResVar AsyncResult, NewEtagVar string) (bool, error) { | |
| 2194 | + | var cerr *glib.Error | |
| 1934 | 2195 | ||
| 1935 | - | return XGFileReplaceContentsFinish(x.GoPointer(), ResVar.GoPointer(), NewEtagVar) | |
| 2196 | + | cret := XGFileReplaceContentsFinish(x.GoPointer(), ResVar.GoPointer(), NewEtagVar, &cerr) | |
| 2197 | + | if cerr == nil { | |
| 2198 | + | return cret, nil | |
| 2199 | + | } | |
| 2200 | + | return cret, cerr | |
| 1936 | 2201 | ||
| 1937 | 2202 | } | |
| 1938 | 2203 | ||
| 1939 | 2204 | // Finishes an asynchronous file replace operation started with | |
| 1940 | 2205 | // g_file_replace_async(). | |
| 1941 | - | func (x *FileBase) ReplaceFinish(ResVar AsyncResult) *FileOutputStream { | |
| 2206 | + | func (x *FileBase) ReplaceFinish(ResVar AsyncResult) (*FileOutputStream, error) { | |
| 2207 | + | var cls *FileOutputStream | |
| 2208 | + | var cerr *glib.Error | |
| 1942 | 2209 | ||
| 1943 | - | ReplaceFinishPtr := XGFileReplaceFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 1944 | - | if ReplaceFinishPtr == 0 { | |
| 1945 | - | return nil | |
| 1946 | - | } | |
| 2210 | + | cret := XGFileReplaceFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 1947 | 2211 | ||
| 1948 | - | ReplaceFinishCls := &FileOutputStream{} | |
| 1949 | - | ReplaceFinishCls.Ptr = ReplaceFinishPtr | |
| 1950 | - | return ReplaceFinishCls | |
| 2212 | + | if cret == 0 { | |
| 2213 | + | return cls, cerr | |
| 2214 | + | } | |
| 2215 | + | cls = &FileOutputStream{} | |
| 2216 | + | cls.Ptr = cret | |
| 2217 | + | if cerr == nil { | |
| 2218 | + | return cls, nil | |
| 2219 | + | } | |
| 2220 | + | return cls, cerr | |
| 1951 | 2221 | ||
| 1952 | 2222 | } | |
| 1953 | 2223 | ||
| @@ -1961,16 +2231,21 @@ func (x *FileBase) ReplaceFinish(ResVar AsyncResult) *FileOutputStream { | |||
| 1961 | 2231 | // Note that in many non-local file cases read and write streams are not | |
| 1962 | 2232 | // supported, so make sure you really need to do read and write streaming, | |
| 1963 | 2233 | // rather than just opening for reading or writing. | |
| 1964 | - | func (x *FileBase) ReplaceReadwrite(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) *FileIOStream { | |
| 2234 | + | func (x *FileBase) ReplaceReadwrite(EtagVar string, MakeBackupVar bool, FlagsVar FileCreateFlags, CancellableVar *Cancellable) (*FileIOStream, error) { | |
| 2235 | + | var cls *FileIOStream | |
| 2236 | + | var cerr *glib.Error | |
| 1965 | 2237 | ||
| 1966 | - | ReplaceReadwritePtr := XGFileReplaceReadwrite(x.GoPointer(), EtagVar, MakeBackupVar, FlagsVar, CancellableVar.GoPointer()) | |
| 1967 | - | if ReplaceReadwritePtr == 0 { | |
| 1968 | - | return nil | |
| 1969 | - | } | |
| 2238 | + | cret := XGFileReplaceReadwrite(x.GoPointer(), EtagVar, MakeBackupVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 1970 | 2239 | ||
| 1971 | - | ReplaceReadwriteCls := &FileIOStream{} | |
| 1972 | - | ReplaceReadwriteCls.Ptr = ReplaceReadwritePtr | |
| 1973 | - | return ReplaceReadwriteCls | |
| 2240 | + | if cret == 0 { | |
| 2241 | + | return cls, cerr | |
| 2242 | + | } | |
| 2243 | + | cls = &FileIOStream{} | |
| 2244 | + | cls.Ptr = cret | |
| 2245 | + | if cerr == nil { | |
| 2246 | + | return cls, nil | |
| 2247 | + | } | |
| 2248 | + | return cls, cerr | |
| 1974 | 2249 | ||
| 1975 | 2250 | } | |
| 1976 | 2251 | ||
| @@ -1992,16 +2267,21 @@ func (x *FileBase) ReplaceReadwriteAsync(EtagVar string, MakeBackupVar bool, Fla | |||
| 1992 | 2267 | ||
| 1993 | 2268 | // Finishes an asynchronous file replace operation started with | |
| 1994 | 2269 | // g_file_replace_readwrite_async(). | |
| 1995 | - | func (x *FileBase) ReplaceReadwriteFinish(ResVar AsyncResult) *FileIOStream { | |
| 2270 | + | func (x *FileBase) ReplaceReadwriteFinish(ResVar AsyncResult) (*FileIOStream, error) { | |
| 2271 | + | var cls *FileIOStream | |
| 2272 | + | var cerr *glib.Error | |
| 1996 | 2273 | ||
| 1997 | - | ReplaceReadwriteFinishPtr := XGFileReplaceReadwriteFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 1998 | - | if ReplaceReadwriteFinishPtr == 0 { | |
| 1999 | - | return nil | |
| 2000 | - | } | |
| 2274 | + | cret := XGFileReplaceReadwriteFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 2001 | 2275 | ||
| 2002 | - | ReplaceReadwriteFinishCls := &FileIOStream{} | |
| 2003 | - | ReplaceReadwriteFinishCls.Ptr = ReplaceReadwriteFinishPtr | |
| 2004 | - | return ReplaceReadwriteFinishCls | |
| 2276 | + | if cret == 0 { | |
| 2277 | + | return cls, cerr | |
| 2278 | + | } | |
| 2279 | + | cls = &FileIOStream{} | |
| 2280 | + | cls.Ptr = cret | |
| 2281 | + | if cerr == nil { | |
| 2282 | + | return cls, nil | |
| 2283 | + | } | |
| 2284 | + | return cls, cerr | |
| 2005 | 2285 | ||
| 2006 | 2286 | } | |
| 2007 | 2287 | ||
| @@ -2012,16 +2292,16 @@ func (x *FileBase) ReplaceReadwriteFinish(ResVar AsyncResult) *FileIOStream { | |||
| 2012 | 2292 | // If the @relative_path is an absolute path name, the resolution | |
| 2013 | 2293 | // is done absolutely (without taking @file path as base). | |
| 2014 | 2294 | func (x *FileBase) ResolveRelativePath(RelativePathVar string) *FileBase { | |
| 2295 | + | var cls *FileBase | |
| 2015 | 2296 | ||
| 2016 | - | ResolveRelativePathPtr := XGFileResolveRelativePath(x.GoPointer(), RelativePathVar) | |
| 2017 | - | if ResolveRelativePathPtr == 0 { | |
| 2018 | - | return nil | |
| 2019 | - | } | |
| 2020 | - | ||
| 2021 | - | ResolveRelativePathCls := &FileBase{} | |
| 2022 | - | ResolveRelativePathCls.Ptr = ResolveRelativePathPtr | |
| 2023 | - | return ResolveRelativePathCls | |
| 2297 | + | cret := XGFileResolveRelativePath(x.GoPointer(), RelativePathVar) | |
| 2024 | 2298 | ||
| 2299 | + | if cret == 0 { | |
| 2300 | + | return cls | |
| 2301 | + | } | |
| 2302 | + | cls = &FileBase{} | |
| 2303 | + | cls.Ptr = cret | |
| 2304 | + | return cls | |
| 2025 | 2305 | } | |
| 2026 | 2306 | ||
| 2027 | 2307 | // Sets an attribute in the file with attribute name @attribute to @value_p. | |
| @@ -2032,9 +2312,14 @@ func (x *FileBase) ResolveRelativePath(RelativePathVar string) *FileBase { | |||
| 2032 | 2312 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 2033 | 2313 | // triggering the cancellable object from another thread. If the operation | |
| 2034 | 2314 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 2035 | - | func (x *FileBase) SetAttribute(AttributeVar string, TypeVar FileAttributeType, ValuePVar uintptr, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool { | |
| 2315 | + | func (x *FileBase) SetAttribute(AttributeVar string, TypeVar FileAttributeType, ValuePVar uintptr, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) { | |
| 2316 | + | var cerr *glib.Error | |
| 2036 | 2317 | ||
| 2037 | - | return XGFileSetAttribute(x.GoPointer(), AttributeVar, TypeVar, ValuePVar, FlagsVar, CancellableVar.GoPointer()) | |
| 2318 | + | cret := XGFileSetAttribute(x.GoPointer(), AttributeVar, TypeVar, ValuePVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 2319 | + | if cerr == nil { | |
| 2320 | + | return cret, nil | |
| 2321 | + | } | |
| 2322 | + | return cret, cerr | |
| 2038 | 2323 | ||
| 2039 | 2324 | } | |
| 2040 | 2325 | ||
| @@ -2045,9 +2330,14 @@ func (x *FileBase) SetAttribute(AttributeVar string, TypeVar FileAttributeType, | |||
| 2045 | 2330 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 2046 | 2331 | // triggering the cancellable object from another thread. If the operation | |
| 2047 | 2332 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 2048 | - | func (x *FileBase) SetAttributeByteString(AttributeVar string, ValueVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool { | |
| 2333 | + | func (x *FileBase) SetAttributeByteString(AttributeVar string, ValueVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) { | |
| 2334 | + | var cerr *glib.Error | |
| 2049 | 2335 | ||
| 2050 | - | return XGFileSetAttributeByteString(x.GoPointer(), AttributeVar, ValueVar, FlagsVar, CancellableVar.GoPointer()) | |
| 2336 | + | cret := XGFileSetAttributeByteString(x.GoPointer(), AttributeVar, ValueVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 2337 | + | if cerr == nil { | |
| 2338 | + | return cret, nil | |
| 2339 | + | } | |
| 2340 | + | return cret, cerr | |
| 2051 | 2341 | ||
| 2052 | 2342 | } | |
| 2053 | 2343 | ||
| @@ -2057,9 +2347,14 @@ func (x *FileBase) SetAttributeByteString(AttributeVar string, ValueVar string, | |||
| 2057 | 2347 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 2058 | 2348 | // triggering the cancellable object from another thread. If the operation | |
| 2059 | 2349 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 2060 | - | func (x *FileBase) SetAttributeInt32(AttributeVar string, ValueVar int32, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool { | |
| 2350 | + | func (x *FileBase) SetAttributeInt32(AttributeVar string, ValueVar int32, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) { | |
| 2351 | + | var cerr *glib.Error | |
| 2061 | 2352 | ||
| 2062 | - | return XGFileSetAttributeInt32(x.GoPointer(), AttributeVar, ValueVar, FlagsVar, CancellableVar.GoPointer()) | |
| 2353 | + | cret := XGFileSetAttributeInt32(x.GoPointer(), AttributeVar, ValueVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 2354 | + | if cerr == nil { | |
| 2355 | + | return cret, nil | |
| 2356 | + | } | |
| 2357 | + | return cret, cerr | |
| 2063 | 2358 | ||
| 2064 | 2359 | } | |
| 2065 | 2360 | ||
| @@ -2069,9 +2364,14 @@ func (x *FileBase) SetAttributeInt32(AttributeVar string, ValueVar int32, FlagsV | |||
| 2069 | 2364 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 2070 | 2365 | // triggering the cancellable object from another thread. If the operation | |
| 2071 | 2366 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 2072 | - | func (x *FileBase) SetAttributeInt64(AttributeVar string, ValueVar int64, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool { | |
| 2367 | + | func (x *FileBase) SetAttributeInt64(AttributeVar string, ValueVar int64, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) { | |
| 2368 | + | var cerr *glib.Error | |
| 2073 | 2369 | ||
| 2074 | - | return XGFileSetAttributeInt64(x.GoPointer(), AttributeVar, ValueVar, FlagsVar, CancellableVar.GoPointer()) | |
| 2370 | + | cret := XGFileSetAttributeInt64(x.GoPointer(), AttributeVar, ValueVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 2371 | + | if cerr == nil { | |
| 2372 | + | return cret, nil | |
| 2373 | + | } | |
| 2374 | + | return cret, cerr | |
| 2075 | 2375 | ||
| 2076 | 2376 | } | |
| 2077 | 2377 | ||
| @@ -2081,9 +2381,14 @@ func (x *FileBase) SetAttributeInt64(AttributeVar string, ValueVar int64, FlagsV | |||
| 2081 | 2381 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 2082 | 2382 | // triggering the cancellable object from another thread. If the operation | |
| 2083 | 2383 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 2084 | - | func (x *FileBase) SetAttributeString(AttributeVar string, ValueVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool { | |
| 2384 | + | func (x *FileBase) SetAttributeString(AttributeVar string, ValueVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) { | |
| 2385 | + | var cerr *glib.Error | |
| 2085 | 2386 | ||
| 2086 | - | return XGFileSetAttributeString(x.GoPointer(), AttributeVar, ValueVar, FlagsVar, CancellableVar.GoPointer()) | |
| 2387 | + | cret := XGFileSetAttributeString(x.GoPointer(), AttributeVar, ValueVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 2388 | + | if cerr == nil { | |
| 2389 | + | return cret, nil | |
| 2390 | + | } | |
| 2391 | + | return cret, cerr | |
| 2087 | 2392 | ||
| 2088 | 2393 | } | |
| 2089 | 2394 | ||
| @@ -2093,9 +2398,14 @@ func (x *FileBase) SetAttributeString(AttributeVar string, ValueVar string, Flag | |||
| 2093 | 2398 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 2094 | 2399 | // triggering the cancellable object from another thread. If the operation | |
| 2095 | 2400 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 2096 | - | func (x *FileBase) SetAttributeUint32(AttributeVar string, ValueVar uint32, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool { | |
| 2401 | + | func (x *FileBase) SetAttributeUint32(AttributeVar string, ValueVar uint32, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) { | |
| 2402 | + | var cerr *glib.Error | |
| 2097 | 2403 | ||
| 2098 | - | return XGFileSetAttributeUint32(x.GoPointer(), AttributeVar, ValueVar, FlagsVar, CancellableVar.GoPointer()) | |
| 2404 | + | cret := XGFileSetAttributeUint32(x.GoPointer(), AttributeVar, ValueVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 2405 | + | if cerr == nil { | |
| 2406 | + | return cret, nil | |
| 2407 | + | } | |
| 2408 | + | return cret, cerr | |
| 2099 | 2409 | ||
| 2100 | 2410 | } | |
| 2101 | 2411 | ||
| @@ -2105,9 +2415,14 @@ func (x *FileBase) SetAttributeUint32(AttributeVar string, ValueVar uint32, Flag | |||
| 2105 | 2415 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 2106 | 2416 | // triggering the cancellable object from another thread. If the operation | |
| 2107 | 2417 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 2108 | - | func (x *FileBase) SetAttributeUint64(AttributeVar string, ValueVar uint64, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool { | |
| 2418 | + | func (x *FileBase) SetAttributeUint64(AttributeVar string, ValueVar uint64, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) { | |
| 2419 | + | var cerr *glib.Error | |
| 2109 | 2420 | ||
| 2110 | - | return XGFileSetAttributeUint64(x.GoPointer(), AttributeVar, ValueVar, FlagsVar, CancellableVar.GoPointer()) | |
| 2421 | + | cret := XGFileSetAttributeUint64(x.GoPointer(), AttributeVar, ValueVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 2422 | + | if cerr == nil { | |
| 2423 | + | return cret, nil | |
| 2424 | + | } | |
| 2425 | + | return cret, cerr | |
| 2111 | 2426 | ||
| 2112 | 2427 | } | |
| 2113 | 2428 | ||
| @@ -2126,9 +2441,14 @@ func (x *FileBase) SetAttributesAsync(InfoVar *FileInfo, FlagsVar FileQueryInfoF | |||
| 2126 | 2441 | } | |
| 2127 | 2442 | ||
| 2128 | 2443 | // Finishes setting an attribute started in g_file_set_attributes_async(). | |
| 2129 | - | func (x *FileBase) SetAttributesFinish(ResultVar AsyncResult, InfoVar **FileInfo) bool { | |
| 2444 | + | func (x *FileBase) SetAttributesFinish(ResultVar AsyncResult, InfoVar **FileInfo) (bool, error) { | |
| 2445 | + | var cerr *glib.Error | |
| 2130 | 2446 | ||
| 2131 | - | return XGFileSetAttributesFinish(x.GoPointer(), ResultVar.GoPointer(), gobject.ConvertPtr(InfoVar)) | |
| 2447 | + | cret := XGFileSetAttributesFinish(x.GoPointer(), ResultVar.GoPointer(), gobject.ConvertPtr(InfoVar), &cerr) | |
| 2448 | + | if cerr == nil { | |
| 2449 | + | return cret, nil | |
| 2450 | + | } | |
| 2451 | + | return cret, cerr | |
| 2132 | 2452 | ||
| 2133 | 2453 | } | |
| 2134 | 2454 | ||
| @@ -2144,9 +2464,14 @@ func (x *FileBase) SetAttributesFinish(ResultVar AsyncResult, InfoVar **FileInfo | |||
| 2144 | 2464 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 2145 | 2465 | // triggering the cancellable object from another thread. If the operation | |
| 2146 | 2466 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 2147 | - | func (x *FileBase) SetAttributesFromInfo(InfoVar *FileInfo, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) bool { | |
| 2467 | + | func (x *FileBase) SetAttributesFromInfo(InfoVar *FileInfo, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (bool, error) { | |
| 2468 | + | var cerr *glib.Error | |
| 2148 | 2469 | ||
| 2149 | - | return XGFileSetAttributesFromInfo(x.GoPointer(), InfoVar.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 2470 | + | cret := XGFileSetAttributesFromInfo(x.GoPointer(), InfoVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 2471 | + | if cerr == nil { | |
| 2472 | + | return cret, nil | |
| 2473 | + | } | |
| 2474 | + | return cret, cerr | |
| 2150 | 2475 | ||
| 2151 | 2476 | } | |
| 2152 | 2477 | ||
| @@ -2165,16 +2490,21 @@ func (x *FileBase) SetAttributesFromInfo(InfoVar *FileInfo, FlagsVar FileQueryIn | |||
| 2165 | 2490 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 2166 | 2491 | // triggering the cancellable object from another thread. If the operation | |
| 2167 | 2492 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 2168 | - | func (x *FileBase) SetDisplayName(DisplayNameVar string, CancellableVar *Cancellable) *FileBase { | |
| 2493 | + | func (x *FileBase) SetDisplayName(DisplayNameVar string, CancellableVar *Cancellable) (*FileBase, error) { | |
| 2494 | + | var cls *FileBase | |
| 2495 | + | var cerr *glib.Error | |
| 2169 | 2496 | ||
| 2170 | - | SetDisplayNamePtr := XGFileSetDisplayName(x.GoPointer(), DisplayNameVar, CancellableVar.GoPointer()) | |
| 2171 | - | if SetDisplayNamePtr == 0 { | |
| 2172 | - | return nil | |
| 2173 | - | } | |
| 2497 | + | cret := XGFileSetDisplayName(x.GoPointer(), DisplayNameVar, CancellableVar.GoPointer(), &cerr) | |
| 2174 | 2498 | ||
| 2175 | - | SetDisplayNameCls := &FileBase{} | |
| 2176 | - | SetDisplayNameCls.Ptr = SetDisplayNamePtr | |
| 2177 | - | return SetDisplayNameCls | |
| 2499 | + | if cret == 0 { | |
| 2500 | + | return cls, cerr | |
| 2501 | + | } | |
| 2502 | + | cls = &FileBase{} | |
| 2503 | + | cls.Ptr = cret | |
| 2504 | + | if cerr == nil { | |
| 2505 | + | return cls, nil | |
| 2506 | + | } | |
| 2507 | + | return cls, cerr | |
| 2178 | 2508 | ||
| 2179 | 2509 | } | |
| 2180 | 2510 | ||
| @@ -2194,16 +2524,21 @@ func (x *FileBase) SetDisplayNameAsync(DisplayNameVar string, IoPriorityVar int, | |||
| 2194 | 2524 | ||
| 2195 | 2525 | // Finishes setting a display name started with | |
| 2196 | 2526 | // g_file_set_display_name_async(). | |
| 2197 | - | func (x *FileBase) SetDisplayNameFinish(ResVar AsyncResult) *FileBase { | |
| 2527 | + | func (x *FileBase) SetDisplayNameFinish(ResVar AsyncResult) (*FileBase, error) { | |
| 2528 | + | var cls *FileBase | |
| 2529 | + | var cerr *glib.Error | |
| 2198 | 2530 | ||
| 2199 | - | SetDisplayNameFinishPtr := XGFileSetDisplayNameFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 2200 | - | if SetDisplayNameFinishPtr == 0 { | |
| 2201 | - | return nil | |
| 2202 | - | } | |
| 2531 | + | cret := XGFileSetDisplayNameFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 2203 | 2532 | ||
| 2204 | - | SetDisplayNameFinishCls := &FileBase{} | |
| 2205 | - | SetDisplayNameFinishCls.Ptr = SetDisplayNameFinishPtr | |
| 2206 | - | return SetDisplayNameFinishCls | |
| 2533 | + | if cret == 0 { | |
| 2534 | + | return cls, cerr | |
| 2535 | + | } | |
| 2536 | + | cls = &FileBase{} | |
| 2537 | + | cls.Ptr = cret | |
| 2538 | + | if cerr == nil { | |
| 2539 | + | return cls, nil | |
| 2540 | + | } | |
| 2541 | + | return cls, cerr | |
| 2207 | 2542 | ||
| 2208 | 2543 | } | |
| 2209 | 2544 | ||
| @@ -2228,9 +2563,14 @@ func (x *FileBase) StartMountable(FlagsVar DriveStartFlags, StartOperationVar *M | |||
| 2228 | 2563 | // | |
| 2229 | 2564 | // Finish an asynchronous start operation that was started | |
| 2230 | 2565 | // with g_file_start_mountable(). | |
| 2231 | - | func (x *FileBase) StartMountableFinish(ResultVar AsyncResult) bool { | |
| 2566 | + | func (x *FileBase) StartMountableFinish(ResultVar AsyncResult) (bool, error) { | |
| 2567 | + | var cerr *glib.Error | |
| 2232 | 2568 | ||
| 2233 | - | return XGFileStartMountableFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 2569 | + | cret := XGFileStartMountableFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 2570 | + | if cerr == nil { | |
| 2571 | + | return cret, nil | |
| 2572 | + | } | |
| 2573 | + | return cret, cerr | |
| 2234 | 2574 | ||
| 2235 | 2575 | } | |
| 2236 | 2576 | ||
| @@ -2253,9 +2593,14 @@ func (x *FileBase) StopMountable(FlagsVar MountUnmountFlags, MountOperationVar * | |||
| 2253 | 2593 | // | |
| 2254 | 2594 | // Finish an asynchronous stop operation that was started | |
| 2255 | 2595 | // with g_file_stop_mountable(). | |
| 2256 | - | func (x *FileBase) StopMountableFinish(ResultVar AsyncResult) bool { | |
| 2596 | + | func (x *FileBase) StopMountableFinish(ResultVar AsyncResult) (bool, error) { | |
| 2597 | + | var cerr *glib.Error | |
| 2257 | 2598 | ||
| 2258 | - | return XGFileStopMountableFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 2599 | + | cret := XGFileStopMountableFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 2600 | + | if cerr == nil { | |
| 2601 | + | return cret, nil | |
| 2602 | + | } | |
| 2603 | + | return cret, cerr | |
| 2259 | 2604 | ||
| 2260 | 2605 | } | |
| 2261 | 2606 | ||
| @@ -2265,8 +2610,8 @@ func (x *FileBase) StopMountableFinish(ResultVar AsyncResult) bool { | |||
| 2265 | 2610 | // @file in a thread that has a thread-default context. | |
| 2266 | 2611 | func (x *FileBase) SupportsThreadContexts() bool { | |
| 2267 | 2612 | ||
| 2268 | - | return XGFileSupportsThreadContexts(x.GoPointer()) | |
| 2269 | - | ||
| 2613 | + | cret := XGFileSupportsThreadContexts(x.GoPointer()) | |
| 2614 | + | return cret | |
| 2270 | 2615 | } | |
| 2271 | 2616 | ||
| 2272 | 2617 | // Sends @file to the "Trashcan", if possible. This is similar to | |
| @@ -2279,9 +2624,14 @@ func (x *FileBase) SupportsThreadContexts() bool { | |||
| 2279 | 2624 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 2280 | 2625 | // triggering the cancellable object from another thread. If the operation | |
| 2281 | 2626 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 2282 | - | func (x *FileBase) Trash(CancellableVar *Cancellable) bool { | |
| 2627 | + | func (x *FileBase) Trash(CancellableVar *Cancellable) (bool, error) { | |
| 2628 | + | var cerr *glib.Error | |
| 2283 | 2629 | ||
| 2284 | - | return XGFileTrash(x.GoPointer(), CancellableVar.GoPointer()) | |
| 2630 | + | cret := XGFileTrash(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 2631 | + | if cerr == nil { | |
| 2632 | + | return cret, nil | |
| 2633 | + | } | |
| 2634 | + | return cret, cerr | |
| 2285 | 2635 | ||
| 2286 | 2636 | } | |
| 2287 | 2637 | ||
| @@ -2294,9 +2644,14 @@ func (x *FileBase) TrashAsync(IoPriorityVar int, CancellableVar *Cancellable, Ca | |||
| 2294 | 2644 | ||
| 2295 | 2645 | // Finishes an asynchronous file trashing operation, started with | |
| 2296 | 2646 | // g_file_trash_async(). | |
| 2297 | - | func (x *FileBase) TrashFinish(ResultVar AsyncResult) bool { | |
| 2647 | + | func (x *FileBase) TrashFinish(ResultVar AsyncResult) (bool, error) { | |
| 2648 | + | var cerr *glib.Error | |
| 2298 | 2649 | ||
| 2299 | - | return XGFileTrashFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 2650 | + | cret := XGFileTrashFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 2651 | + | if cerr == nil { | |
| 2652 | + | return cret, nil | |
| 2653 | + | } | |
| 2654 | + | return cret, cerr | |
| 2300 | 2655 | ||
| 2301 | 2656 | } | |
| 2302 | 2657 | ||
| @@ -2319,9 +2674,14 @@ func (x *FileBase) UnmountMountable(FlagsVar MountUnmountFlags, CancellableVar * | |||
| 2319 | 2674 | // | |
| 2320 | 2675 | // Finish an asynchronous unmount operation that was started | |
| 2321 | 2676 | // with g_file_unmount_mountable(). | |
| 2322 | - | func (x *FileBase) UnmountMountableFinish(ResultVar AsyncResult) bool { | |
| 2677 | + | func (x *FileBase) UnmountMountableFinish(ResultVar AsyncResult) (bool, error) { | |
| 2678 | + | var cerr *glib.Error | |
| 2323 | 2679 | ||
| 2324 | - | return XGFileUnmountMountableFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 2680 | + | cret := XGFileUnmountMountableFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 2681 | + | if cerr == nil { | |
| 2682 | + | return cret, nil | |
| 2683 | + | } | |
| 2684 | + | return cret, cerr | |
| 2325 | 2685 | ||
| 2326 | 2686 | } | |
| 2327 | 2687 | ||
| @@ -2345,44 +2705,49 @@ func (x *FileBase) UnmountMountableWithOperation(FlagsVar MountUnmountFlags, Mou | |||
| 2345 | 2705 | // | |
| 2346 | 2706 | // Finish an asynchronous unmount operation that was started | |
| 2347 | 2707 | // with g_file_unmount_mountable_with_operation(). | |
| 2348 | - | func (x *FileBase) UnmountMountableWithOperationFinish(ResultVar AsyncResult) bool { | |
| 2708 | + | func (x *FileBase) UnmountMountableWithOperationFinish(ResultVar AsyncResult) (bool, error) { | |
| 2709 | + | var cerr *glib.Error | |
| 2349 | 2710 | ||
| 2350 | - | return XGFileUnmountMountableWithOperationFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 2711 | + | cret := XGFileUnmountMountableWithOperationFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 2712 | + | if cerr == nil { | |
| 2713 | + | return cret, nil | |
| 2714 | + | } | |
| 2715 | + | return cret, cerr | |
| 2351 | 2716 | ||
| 2352 | 2717 | } | |
| 2353 | 2718 | ||
| 2354 | - | var XGFileAppendTo func(uintptr, FileCreateFlags, uintptr) uintptr | |
| 2719 | + | var XGFileAppendTo func(uintptr, FileCreateFlags, uintptr, **glib.Error) uintptr | |
| 2355 | 2720 | var XGFileAppendToAsync func(uintptr, FileCreateFlags, int, uintptr, uintptr, uintptr) | |
| 2356 | - | var XGFileAppendToFinish func(uintptr, uintptr) uintptr | |
| 2357 | - | var XGFileBuildAttributeListForCopy func(uintptr, FileCopyFlags, uintptr) string | |
| 2358 | - | var XGFileCopy func(uintptr, uintptr, FileCopyFlags, uintptr, uintptr, uintptr) bool | |
| 2721 | + | var XGFileAppendToFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 2722 | + | var XGFileBuildAttributeListForCopy func(uintptr, FileCopyFlags, uintptr, **glib.Error) string | |
| 2723 | + | var XGFileCopy func(uintptr, uintptr, FileCopyFlags, uintptr, uintptr, uintptr, **glib.Error) bool | |
| 2359 | 2724 | var XGFileCopyAsync func(uintptr, uintptr, FileCopyFlags, int, uintptr, uintptr, uintptr, uintptr, uintptr) | |
| 2360 | - | var XGFileCopyAttributes func(uintptr, uintptr, FileCopyFlags, uintptr) bool | |
| 2361 | - | var XGFileCopyFinish func(uintptr, uintptr) bool | |
| 2362 | - | var XGFileCreate func(uintptr, FileCreateFlags, uintptr) uintptr | |
| 2725 | + | var XGFileCopyAttributes func(uintptr, uintptr, FileCopyFlags, uintptr, **glib.Error) bool | |
| 2726 | + | var XGFileCopyFinish func(uintptr, uintptr, **glib.Error) bool | |
| 2727 | + | var XGFileCreate func(uintptr, FileCreateFlags, uintptr, **glib.Error) uintptr | |
| 2363 | 2728 | var XGFileCreateAsync func(uintptr, FileCreateFlags, int, uintptr, uintptr, uintptr) | |
| 2364 | - | var XGFileCreateFinish func(uintptr, uintptr) uintptr | |
| 2365 | - | var XGFileCreateReadwrite func(uintptr, FileCreateFlags, uintptr) uintptr | |
| 2729 | + | var XGFileCreateFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 2730 | + | var XGFileCreateReadwrite func(uintptr, FileCreateFlags, uintptr, **glib.Error) uintptr | |
| 2366 | 2731 | var XGFileCreateReadwriteAsync func(uintptr, FileCreateFlags, int, uintptr, uintptr, uintptr) | |
| 2367 | - | var XGFileCreateReadwriteFinish func(uintptr, uintptr) uintptr | |
| 2368 | - | var XGFileDelete func(uintptr, uintptr) bool | |
| 2732 | + | var XGFileCreateReadwriteFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 2733 | + | var XGFileDelete func(uintptr, uintptr, **glib.Error) bool | |
| 2369 | 2734 | var XGFileDeleteAsync func(uintptr, int, uintptr, uintptr, uintptr) | |
| 2370 | - | var XGFileDeleteFinish func(uintptr, uintptr) bool | |
| 2735 | + | var XGFileDeleteFinish func(uintptr, uintptr, **glib.Error) bool | |
| 2371 | 2736 | var XGFileDup func(uintptr) uintptr | |
| 2372 | 2737 | var XGFileEjectMountable func(uintptr, MountUnmountFlags, uintptr, uintptr, uintptr) | |
| 2373 | - | var XGFileEjectMountableFinish func(uintptr, uintptr) bool | |
| 2738 | + | var XGFileEjectMountableFinish func(uintptr, uintptr, **glib.Error) bool | |
| 2374 | 2739 | var XGFileEjectMountableWithOperation func(uintptr, MountUnmountFlags, uintptr, uintptr, uintptr, uintptr) | |
| 2375 | - | var XGFileEjectMountableWithOperationFinish func(uintptr, uintptr) bool | |
| 2376 | - | var XGFileEnumerateChildren func(uintptr, string, FileQueryInfoFlags, uintptr) uintptr | |
| 2740 | + | var XGFileEjectMountableWithOperationFinish func(uintptr, uintptr, **glib.Error) bool | |
| 2741 | + | var XGFileEnumerateChildren func(uintptr, string, FileQueryInfoFlags, uintptr, **glib.Error) uintptr | |
| 2377 | 2742 | var XGFileEnumerateChildrenAsync func(uintptr, string, FileQueryInfoFlags, int, uintptr, uintptr, uintptr) | |
| 2378 | - | var XGFileEnumerateChildrenFinish func(uintptr, uintptr) uintptr | |
| 2743 | + | var XGFileEnumerateChildrenFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 2379 | 2744 | var XGFileEqual func(uintptr, uintptr) bool | |
| 2380 | - | var XGFileFindEnclosingMount func(uintptr, uintptr) uintptr | |
| 2745 | + | var XGFileFindEnclosingMount func(uintptr, uintptr, **glib.Error) uintptr | |
| 2381 | 2746 | var XGFileFindEnclosingMountAsync func(uintptr, int, uintptr, uintptr, uintptr) | |
| 2382 | - | var XGFileFindEnclosingMountFinish func(uintptr, uintptr) uintptr | |
| 2747 | + | var XGFileFindEnclosingMountFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 2383 | 2748 | var XGFileGetBasename func(uintptr) string | |
| 2384 | 2749 | var XGFileGetChild func(uintptr, string) uintptr | |
| 2385 | - | var XGFileGetChildForDisplayName func(uintptr, string) uintptr | |
| 2750 | + | var XGFileGetChildForDisplayName func(uintptr, string, **glib.Error) uintptr | |
| 2386 | 2751 | var XGFileGetParent func(uintptr) uintptr | |
| 2387 | 2752 | var XGFileGetParseName func(uintptr) string | |
| 2388 | 2753 | var XGFileGetPath func(uintptr) string | |
| @@ -2394,90 +2759,90 @@ var XGFileHasPrefix func(uintptr, uintptr) bool | |||
| 2394 | 2759 | var XGFileHasUriScheme func(uintptr, string) bool | |
| 2395 | 2760 | var XGFileHash func(uintptr) uint | |
| 2396 | 2761 | var XGFileIsNative func(uintptr) bool | |
| 2397 | - | var XGFileLoadBytes func(uintptr, uintptr, string) *glib.Bytes | |
| 2762 | + | var XGFileLoadBytes func(uintptr, uintptr, string, **glib.Error) *glib.Bytes | |
| 2398 | 2763 | var XGFileLoadBytesAsync func(uintptr, uintptr, uintptr, uintptr) | |
| 2399 | - | var XGFileLoadBytesFinish func(uintptr, uintptr, string) *glib.Bytes | |
| 2400 | - | var XGFileLoadContents func(uintptr, uintptr, []string, uint, string) bool | |
| 2764 | + | var XGFileLoadBytesFinish func(uintptr, uintptr, string, **glib.Error) *glib.Bytes | |
| 2765 | + | var XGFileLoadContents func(uintptr, uintptr, []string, uint, string, **glib.Error) bool | |
| 2401 | 2766 | var XGFileLoadContentsAsync func(uintptr, uintptr, uintptr, uintptr) | |
| 2402 | - | var XGFileLoadContentsFinish func(uintptr, uintptr, []string, uint, string) bool | |
| 2767 | + | var XGFileLoadContentsFinish func(uintptr, uintptr, []string, uint, string, **glib.Error) bool | |
| 2403 | 2768 | var XGFileLoadPartialContentsAsync func(uintptr, uintptr, uintptr, uintptr, uintptr) | |
| 2404 | - | var XGFileLoadPartialContentsFinish func(uintptr, uintptr, []string, uint, string) bool | |
| 2405 | - | var XGFileMakeDirectory func(uintptr, uintptr) bool | |
| 2769 | + | var XGFileLoadPartialContentsFinish func(uintptr, uintptr, []string, uint, string, **glib.Error) bool | |
| 2770 | + | var XGFileMakeDirectory func(uintptr, uintptr, **glib.Error) bool | |
| 2406 | 2771 | var XGFileMakeDirectoryAsync func(uintptr, int, uintptr, uintptr, uintptr) | |
| 2407 | - | var XGFileMakeDirectoryFinish func(uintptr, uintptr) bool | |
| 2408 | - | var XGFileMakeDirectoryWithParents func(uintptr, uintptr) bool | |
| 2409 | - | var XGFileMakeSymbolicLink func(uintptr, string, uintptr) bool | |
| 2410 | - | var XGFileMeasureDiskUsage func(uintptr, FileMeasureFlags, uintptr, uintptr, uintptr, uint64, uint64, uint64) bool | |
| 2772 | + | var XGFileMakeDirectoryFinish func(uintptr, uintptr, **glib.Error) bool | |
| 2773 | + | var XGFileMakeDirectoryWithParents func(uintptr, uintptr, **glib.Error) bool | |
| 2774 | + | var XGFileMakeSymbolicLink func(uintptr, string, uintptr, **glib.Error) bool | |
| 2775 | + | var XGFileMeasureDiskUsage func(uintptr, FileMeasureFlags, uintptr, uintptr, uintptr, uint64, uint64, uint64, **glib.Error) bool | |
| 2411 | 2776 | var XGFileMeasureDiskUsageAsync func(uintptr, FileMeasureFlags, int, uintptr, uintptr, uintptr, uintptr, uintptr) | |
| 2412 | - | var XGFileMeasureDiskUsageFinish func(uintptr, uintptr, uint64, uint64, uint64) bool | |
| 2413 | - | var XGFileMonitor func(uintptr, FileMonitorFlags, uintptr) uintptr | |
| 2414 | - | var XGFileMonitorDirectory func(uintptr, FileMonitorFlags, uintptr) uintptr | |
| 2415 | - | var XGFileMonitorFile func(uintptr, FileMonitorFlags, uintptr) uintptr | |
| 2777 | + | var XGFileMeasureDiskUsageFinish func(uintptr, uintptr, uint64, uint64, uint64, **glib.Error) bool | |
| 2778 | + | var XGFileMonitor func(uintptr, FileMonitorFlags, uintptr, **glib.Error) uintptr | |
| 2779 | + | var XGFileMonitorDirectory func(uintptr, FileMonitorFlags, uintptr, **glib.Error) uintptr | |
| 2780 | + | var XGFileMonitorFile func(uintptr, FileMonitorFlags, uintptr, **glib.Error) uintptr | |
| 2416 | 2781 | var XGFileMountEnclosingVolume func(uintptr, MountMountFlags, uintptr, uintptr, uintptr, uintptr) | |
| 2417 | - | var XGFileMountEnclosingVolumeFinish func(uintptr, uintptr) bool | |
| 2782 | + | var XGFileMountEnclosingVolumeFinish func(uintptr, uintptr, **glib.Error) bool | |
| 2418 | 2783 | var XGFileMountMountable func(uintptr, MountMountFlags, uintptr, uintptr, uintptr, uintptr) | |
| 2419 | - | var XGFileMountMountableFinish func(uintptr, uintptr) uintptr | |
| 2420 | - | var XGFileMove func(uintptr, uintptr, FileCopyFlags, uintptr, uintptr, uintptr) bool | |
| 2784 | + | var XGFileMountMountableFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 2785 | + | var XGFileMove func(uintptr, uintptr, FileCopyFlags, uintptr, uintptr, uintptr, **glib.Error) bool | |
| 2421 | 2786 | var XGFileMoveAsync func(uintptr, uintptr, FileCopyFlags, int, uintptr, uintptr, uintptr, uintptr, uintptr) | |
| 2422 | - | var XGFileMoveFinish func(uintptr, uintptr) bool | |
| 2423 | - | var XGFileOpenReadwrite func(uintptr, uintptr) uintptr | |
| 2787 | + | var XGFileMoveFinish func(uintptr, uintptr, **glib.Error) bool | |
| 2788 | + | var XGFileOpenReadwrite func(uintptr, uintptr, **glib.Error) uintptr | |
| 2424 | 2789 | var XGFileOpenReadwriteAsync func(uintptr, int, uintptr, uintptr, uintptr) | |
| 2425 | - | var XGFileOpenReadwriteFinish func(uintptr, uintptr) uintptr | |
| 2790 | + | var XGFileOpenReadwriteFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 2426 | 2791 | var XGFilePeekPath func(uintptr) string | |
| 2427 | 2792 | var XGFilePollMountable func(uintptr, uintptr, uintptr, uintptr) | |
| 2428 | - | var XGFilePollMountableFinish func(uintptr, uintptr) bool | |
| 2429 | - | var XGFileQueryDefaultHandler func(uintptr, uintptr) uintptr | |
| 2793 | + | var XGFilePollMountableFinish func(uintptr, uintptr, **glib.Error) bool | |
| 2794 | + | var XGFileQueryDefaultHandler func(uintptr, uintptr, **glib.Error) uintptr | |
| 2430 | 2795 | var XGFileQueryDefaultHandlerAsync func(uintptr, int, uintptr, uintptr, uintptr) | |
| 2431 | - | var XGFileQueryDefaultHandlerFinish func(uintptr, uintptr) uintptr | |
| 2796 | + | var XGFileQueryDefaultHandlerFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 2432 | 2797 | var XGFileQueryExists func(uintptr, uintptr) bool | |
| 2433 | 2798 | var XGFileQueryFileType func(uintptr, FileQueryInfoFlags, uintptr) FileType | |
| 2434 | - | var XGFileQueryFilesystemInfo func(uintptr, string, uintptr) uintptr | |
| 2799 | + | var XGFileQueryFilesystemInfo func(uintptr, string, uintptr, **glib.Error) uintptr | |
| 2435 | 2800 | var XGFileQueryFilesystemInfoAsync func(uintptr, string, int, uintptr, uintptr, uintptr) | |
| 2436 | - | var XGFileQueryFilesystemInfoFinish func(uintptr, uintptr) uintptr | |
| 2437 | - | var XGFileQueryInfo func(uintptr, string, FileQueryInfoFlags, uintptr) uintptr | |
| 2801 | + | var XGFileQueryFilesystemInfoFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 2802 | + | var XGFileQueryInfo func(uintptr, string, FileQueryInfoFlags, uintptr, **glib.Error) uintptr | |
| 2438 | 2803 | var XGFileQueryInfoAsync func(uintptr, string, FileQueryInfoFlags, int, uintptr, uintptr, uintptr) | |
| 2439 | - | var XGFileQueryInfoFinish func(uintptr, uintptr) uintptr | |
| 2440 | - | var XGFileQuerySettableAttributes func(uintptr, uintptr) *FileAttributeInfoList | |
| 2441 | - | var XGFileQueryWritableNamespaces func(uintptr, uintptr) *FileAttributeInfoList | |
| 2442 | - | var XGFileRead func(uintptr, uintptr) uintptr | |
| 2804 | + | var XGFileQueryInfoFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 2805 | + | var XGFileQuerySettableAttributes func(uintptr, uintptr, **glib.Error) *FileAttributeInfoList | |
| 2806 | + | var XGFileQueryWritableNamespaces func(uintptr, uintptr, **glib.Error) *FileAttributeInfoList | |
| 2807 | + | var XGFileRead func(uintptr, uintptr, **glib.Error) uintptr | |
| 2443 | 2808 | var XGFileReadAsync func(uintptr, int, uintptr, uintptr, uintptr) | |
| 2444 | - | var XGFileReadFinish func(uintptr, uintptr) uintptr | |
| 2445 | - | var XGFileReplace func(uintptr, string, bool, FileCreateFlags, uintptr) uintptr | |
| 2809 | + | var XGFileReadFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 2810 | + | var XGFileReplace func(uintptr, string, bool, FileCreateFlags, uintptr, **glib.Error) uintptr | |
| 2446 | 2811 | var XGFileReplaceAsync func(uintptr, string, bool, FileCreateFlags, int, uintptr, uintptr, uintptr) | |
| 2447 | - | var XGFileReplaceContents func(uintptr, string, uint, string, bool, FileCreateFlags, string, uintptr) bool | |
| 2812 | + | var XGFileReplaceContents func(uintptr, string, uint, string, bool, FileCreateFlags, string, uintptr, **glib.Error) bool | |
| 2448 | 2813 | var XGFileReplaceContentsAsync func(uintptr, string, uint, string, bool, FileCreateFlags, uintptr, uintptr, uintptr) | |
| 2449 | 2814 | var XGFileReplaceContentsBytesAsync func(uintptr, *glib.Bytes, string, bool, FileCreateFlags, uintptr, uintptr, uintptr) | |
| 2450 | - | var XGFileReplaceContentsFinish func(uintptr, uintptr, string) bool | |
| 2451 | - | var XGFileReplaceFinish func(uintptr, uintptr) uintptr | |
| 2452 | - | var XGFileReplaceReadwrite func(uintptr, string, bool, FileCreateFlags, uintptr) uintptr | |
| 2815 | + | var XGFileReplaceContentsFinish func(uintptr, uintptr, string, **glib.Error) bool | |
| 2816 | + | var XGFileReplaceFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 2817 | + | var XGFileReplaceReadwrite func(uintptr, string, bool, FileCreateFlags, uintptr, **glib.Error) uintptr | |
| 2453 | 2818 | var XGFileReplaceReadwriteAsync func(uintptr, string, bool, FileCreateFlags, int, uintptr, uintptr, uintptr) | |
| 2454 | - | var XGFileReplaceReadwriteFinish func(uintptr, uintptr) uintptr | |
| 2819 | + | var XGFileReplaceReadwriteFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 2455 | 2820 | var XGFileResolveRelativePath func(uintptr, string) uintptr | |
| 2456 | - | var XGFileSetAttribute func(uintptr, string, FileAttributeType, uintptr, FileQueryInfoFlags, uintptr) bool | |
| 2457 | - | var XGFileSetAttributeByteString func(uintptr, string, string, FileQueryInfoFlags, uintptr) bool | |
| 2458 | - | var XGFileSetAttributeInt32 func(uintptr, string, int32, FileQueryInfoFlags, uintptr) bool | |
| 2459 | - | var XGFileSetAttributeInt64 func(uintptr, string, int64, FileQueryInfoFlags, uintptr) bool | |
| 2460 | - | var XGFileSetAttributeString func(uintptr, string, string, FileQueryInfoFlags, uintptr) bool | |
| 2461 | - | var XGFileSetAttributeUint32 func(uintptr, string, uint32, FileQueryInfoFlags, uintptr) bool | |
| 2462 | - | var XGFileSetAttributeUint64 func(uintptr, string, uint64, FileQueryInfoFlags, uintptr) bool | |
| 2821 | + | var XGFileSetAttribute func(uintptr, string, FileAttributeType, uintptr, FileQueryInfoFlags, uintptr, **glib.Error) bool | |
| 2822 | + | var XGFileSetAttributeByteString func(uintptr, string, string, FileQueryInfoFlags, uintptr, **glib.Error) bool | |
| 2823 | + | var XGFileSetAttributeInt32 func(uintptr, string, int32, FileQueryInfoFlags, uintptr, **glib.Error) bool | |
| 2824 | + | var XGFileSetAttributeInt64 func(uintptr, string, int64, FileQueryInfoFlags, uintptr, **glib.Error) bool | |
| 2825 | + | var XGFileSetAttributeString func(uintptr, string, string, FileQueryInfoFlags, uintptr, **glib.Error) bool | |
| 2826 | + | var XGFileSetAttributeUint32 func(uintptr, string, uint32, FileQueryInfoFlags, uintptr, **glib.Error) bool | |
| 2827 | + | var XGFileSetAttributeUint64 func(uintptr, string, uint64, FileQueryInfoFlags, uintptr, **glib.Error) bool | |
| 2463 | 2828 | var XGFileSetAttributesAsync func(uintptr, uintptr, FileQueryInfoFlags, int, uintptr, uintptr, uintptr) | |
| 2464 | - | var XGFileSetAttributesFinish func(uintptr, uintptr, *uintptr) bool | |
| 2465 | - | var XGFileSetAttributesFromInfo func(uintptr, uintptr, FileQueryInfoFlags, uintptr) bool | |
| 2466 | - | var XGFileSetDisplayName func(uintptr, string, uintptr) uintptr | |
| 2829 | + | var XGFileSetAttributesFinish func(uintptr, uintptr, *uintptr, **glib.Error) bool | |
| 2830 | + | var XGFileSetAttributesFromInfo func(uintptr, uintptr, FileQueryInfoFlags, uintptr, **glib.Error) bool | |
| 2831 | + | var XGFileSetDisplayName func(uintptr, string, uintptr, **glib.Error) uintptr | |
| 2467 | 2832 | var XGFileSetDisplayNameAsync func(uintptr, string, int, uintptr, uintptr, uintptr) | |
| 2468 | - | var XGFileSetDisplayNameFinish func(uintptr, uintptr) uintptr | |
| 2833 | + | var XGFileSetDisplayNameFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 2469 | 2834 | var XGFileStartMountable func(uintptr, DriveStartFlags, uintptr, uintptr, uintptr, uintptr) | |
| 2470 | - | var XGFileStartMountableFinish func(uintptr, uintptr) bool | |
| 2835 | + | var XGFileStartMountableFinish func(uintptr, uintptr, **glib.Error) bool | |
| 2471 | 2836 | var XGFileStopMountable func(uintptr, MountUnmountFlags, uintptr, uintptr, uintptr, uintptr) | |
| 2472 | - | var XGFileStopMountableFinish func(uintptr, uintptr) bool | |
| 2837 | + | var XGFileStopMountableFinish func(uintptr, uintptr, **glib.Error) bool | |
| 2473 | 2838 | var XGFileSupportsThreadContexts func(uintptr) bool | |
| 2474 | - | var XGFileTrash func(uintptr, uintptr) bool | |
| 2839 | + | var XGFileTrash func(uintptr, uintptr, **glib.Error) bool | |
| 2475 | 2840 | var XGFileTrashAsync func(uintptr, int, uintptr, uintptr, uintptr) | |
| 2476 | - | var XGFileTrashFinish func(uintptr, uintptr) bool | |
| 2841 | + | var XGFileTrashFinish func(uintptr, uintptr, **glib.Error) bool | |
| 2477 | 2842 | var XGFileUnmountMountable func(uintptr, MountUnmountFlags, uintptr, uintptr, uintptr) | |
| 2478 | - | var XGFileUnmountMountableFinish func(uintptr, uintptr) bool | |
| 2843 | + | var XGFileUnmountMountableFinish func(uintptr, uintptr, **glib.Error) bool | |
| 2479 | 2844 | var XGFileUnmountMountableWithOperation func(uintptr, MountUnmountFlags, uintptr, uintptr, uintptr, uintptr) | |
| 2480 | - | var XGFileUnmountMountableWithOperationFinish func(uintptr, uintptr) bool | |
| 2845 | + | var XGFileUnmountMountableWithOperationFinish func(uintptr, uintptr, **glib.Error) bool | |
| 2481 | 2846 | ||
| 2482 | 2847 | var xFileNewForCommandlineArg func(string) uintptr | |
| 2483 | 2848 | ||
| @@ -2496,16 +2861,16 @@ var xFileNewForCommandlineArg func(string) uintptr | |||
| 2496 | 2861 | // for you there. It is also always possible to use this function with | |
| 2497 | 2862 | // #GOptionContext arguments of type %G_OPTION_ARG_FILENAME. | |
| 2498 | 2863 | func FileNewForCommandlineArg(ArgVar string) *FileBase { | |
| 2864 | + | var cls *FileBase | |
| 2499 | 2865 | ||
| 2500 | - | FileNewForCommandlineArgPtr := xFileNewForCommandlineArg(ArgVar) | |
| 2501 | - | if FileNewForCommandlineArgPtr == 0 { | |
| 2502 | - | return nil | |
| 2503 | - | } | |
| 2504 | - | ||
| 2505 | - | FileNewForCommandlineArgCls := &FileBase{} | |
| 2506 | - | FileNewForCommandlineArgCls.Ptr = FileNewForCommandlineArgPtr | |
| 2507 | - | return FileNewForCommandlineArgCls | |
| 2866 | + | cret := xFileNewForCommandlineArg(ArgVar) | |
| 2508 | 2867 | ||
| 2868 | + | if cret == 0 { | |
| 2869 | + | return cls | |
| 2870 | + | } | |
| 2871 | + | cls = &FileBase{} | |
| 2872 | + | cls.Ptr = cret | |
| 2873 | + | return cls | |
| 2509 | 2874 | } | |
| 2510 | 2875 | ||
| 2511 | 2876 | var xFileNewForCommandlineArgAndCwd func(string, string) uintptr | |
| @@ -2522,16 +2887,16 @@ var xFileNewForCommandlineArgAndCwd func(string, string) uintptr | |||
| 2522 | 2887 | // | |
| 2523 | 2888 | // See also g_application_command_line_create_file_for_arg(). | |
| 2524 | 2889 | func FileNewForCommandlineArgAndCwd(ArgVar string, CwdVar string) *FileBase { | |
| 2890 | + | var cls *FileBase | |
| 2525 | 2891 | ||
| 2526 | - | FileNewForCommandlineArgAndCwdPtr := xFileNewForCommandlineArgAndCwd(ArgVar, CwdVar) | |
| 2527 | - | if FileNewForCommandlineArgAndCwdPtr == 0 { | |
| 2528 | - | return nil | |
| 2529 | - | } | |
| 2530 | - | ||
| 2531 | - | FileNewForCommandlineArgAndCwdCls := &FileBase{} | |
| 2532 | - | FileNewForCommandlineArgAndCwdCls.Ptr = FileNewForCommandlineArgAndCwdPtr | |
| 2533 | - | return FileNewForCommandlineArgAndCwdCls | |
| 2892 | + | cret := xFileNewForCommandlineArgAndCwd(ArgVar, CwdVar) | |
| 2534 | 2893 | ||
| 2894 | + | if cret == 0 { | |
| 2895 | + | return cls | |
| 2896 | + | } | |
| 2897 | + | cls = &FileBase{} | |
| 2898 | + | cls.Ptr = cret | |
| 2899 | + | return cls | |
| 2535 | 2900 | } | |
| 2536 | 2901 | ||
| 2537 | 2902 | var xFileNewForPath func(string) uintptr | |
| @@ -2540,16 +2905,16 @@ var xFileNewForPath func(string) uintptr | |||
| 2540 | 2905 | // fails, but the returned object might not support any I/O | |
| 2541 | 2906 | // operation if @path is malformed. | |
| 2542 | 2907 | func FileNewForPath(PathVar string) *FileBase { | |
| 2908 | + | var cls *FileBase | |
| 2543 | 2909 | ||
| 2544 | - | FileNewForPathPtr := xFileNewForPath(PathVar) | |
| 2545 | - | if FileNewForPathPtr == 0 { | |
| 2546 | - | return nil | |
| 2547 | - | } | |
| 2548 | - | ||
| 2549 | - | FileNewForPathCls := &FileBase{} | |
| 2550 | - | FileNewForPathCls.Ptr = FileNewForPathPtr | |
| 2551 | - | return FileNewForPathCls | |
| 2910 | + | cret := xFileNewForPath(PathVar) | |
| 2552 | 2911 | ||
| 2912 | + | if cret == 0 { | |
| 2913 | + | return cls | |
| 2914 | + | } | |
| 2915 | + | cls = &FileBase{} | |
| 2916 | + | cls.Ptr = cret | |
| 2917 | + | return cls | |
| 2553 | 2918 | } | |
| 2554 | 2919 | ||
| 2555 | 2920 | var xFileNewForUri func(string) uintptr | |
| @@ -2559,19 +2924,19 @@ var xFileNewForUri func(string) uintptr | |||
| 2559 | 2924 | // operation if @uri is malformed or if the uri type is | |
| 2560 | 2925 | // not supported. | |
| 2561 | 2926 | func FileNewForUri(UriVar string) *FileBase { | |
| 2927 | + | var cls *FileBase | |
| 2562 | 2928 | ||
| 2563 | - | FileNewForUriPtr := xFileNewForUri(UriVar) | |
| 2564 | - | if FileNewForUriPtr == 0 { | |
| 2565 | - | return nil | |
| 2566 | - | } | |
| 2567 | - | ||
| 2568 | - | FileNewForUriCls := &FileBase{} | |
| 2569 | - | FileNewForUriCls.Ptr = FileNewForUriPtr | |
| 2570 | - | return FileNewForUriCls | |
| 2929 | + | cret := xFileNewForUri(UriVar) | |
| 2571 | 2930 | ||
| 2931 | + | if cret == 0 { | |
| 2932 | + | return cls | |
| 2933 | + | } | |
| 2934 | + | cls = &FileBase{} | |
| 2935 | + | cls.Ptr = cret | |
| 2936 | + | return cls | |
| 2572 | 2937 | } | |
| 2573 | 2938 | ||
| 2574 | - | var xFileNewTmp func(string, *uintptr) uintptr | |
| 2939 | + | var xFileNewTmp func(string, *uintptr, **glib.Error) uintptr | |
| 2575 | 2940 | ||
| 2576 | 2941 | // Opens a file in the preferred directory for temporary files (as | |
| 2577 | 2942 | // returned by g_get_tmp_dir()) and returns a #GFile and | |
| @@ -2583,16 +2948,21 @@ var xFileNewTmp func(string, *uintptr) uintptr | |||
| 2583 | 2948 | // | |
| 2584 | 2949 | // Unlike the other #GFile constructors, this will return %NULL if | |
| 2585 | 2950 | // a temporary file could not be created. | |
| 2586 | - | func FileNewTmp(TmplVar string, IostreamVar **FileIOStream) *FileBase { | |
| 2951 | + | func FileNewTmp(TmplVar string, IostreamVar **FileIOStream) (*FileBase, error) { | |
| 2952 | + | var cls *FileBase | |
| 2953 | + | var cerr *glib.Error | |
| 2587 | 2954 | ||
| 2588 | - | FileNewTmpPtr := xFileNewTmp(TmplVar, gobject.ConvertPtr(IostreamVar)) | |
| 2589 | - | if FileNewTmpPtr == 0 { | |
| 2590 | - | return nil | |
| 2591 | - | } | |
| 2955 | + | cret := xFileNewTmp(TmplVar, gobject.ConvertPtr(IostreamVar), &cerr) | |
| 2592 | 2956 | ||
| 2593 | - | FileNewTmpCls := &FileBase{} | |
| 2594 | - | FileNewTmpCls.Ptr = FileNewTmpPtr | |
| 2595 | - | return FileNewTmpCls | |
| 2957 | + | if cret == 0 { | |
| 2958 | + | return cls, cerr | |
| 2959 | + | } | |
| 2960 | + | cls = &FileBase{} | |
| 2961 | + | cls.Ptr = cret | |
| 2962 | + | if cerr == nil { | |
| 2963 | + | return cls, nil | |
| 2964 | + | } | |
| 2965 | + | return cls, cerr | |
| 2596 | 2966 | ||
| 2597 | 2967 | } | |
| 2598 | 2968 | ||
| @@ -2603,16 +2973,16 @@ var xFileParseName func(string) uintptr | |||
| 2603 | 2973 | // but the returned object might not support any I/O operation if | |
| 2604 | 2974 | // the @parse_name cannot be parsed. | |
| 2605 | 2975 | func FileParseName(ParseNameVar string) *FileBase { | |
| 2976 | + | var cls *FileBase | |
| 2606 | 2977 | ||
| 2607 | - | FileParseNamePtr := xFileParseName(ParseNameVar) | |
| 2608 | - | if FileParseNamePtr == 0 { | |
| 2609 | - | return nil | |
| 2610 | - | } | |
| 2611 | - | ||
| 2612 | - | FileParseNameCls := &FileBase{} | |
| 2613 | - | FileParseNameCls.Ptr = FileParseNamePtr | |
| 2614 | - | return FileParseNameCls | |
| 2978 | + | cret := xFileParseName(ParseNameVar) | |
| 2615 | 2979 | ||
| 2980 | + | if cret == 0 { | |
| 2981 | + | return cls | |
| 2982 | + | } | |
| 2983 | + | cls = &FileBase{} | |
| 2984 | + | cls.Ptr = cret | |
| 2985 | + | return cls | |
| 2616 | 2986 | } | |
| 2617 | 2987 | ||
| 2618 | 2988 | func init() { | |
M v4/gio/gfileattribute.go +1 -1
| @@ -3,7 +3,7 @@ package gio | |||
| 3 | 3 | ||
| 4 | 4 | // Information about a specific attribute. | |
| 5 | 5 | type FileAttributeInfo struct { | |
| 6 | - | Name string | |
| 6 | + | Name uintptr | |
| 7 | 7 | ||
| 8 | 8 | Type FileAttributeType | |
| 9 | 9 | ||
M v4/gio/gfiledescriptorbased.go +2 -2
| @@ -37,8 +37,8 @@ func (x *FileDescriptorBasedBase) SetGoPointer(ptr uintptr) { | |||
| 37 | 37 | // Gets the underlying file descriptor. | |
| 38 | 38 | func (x *FileDescriptorBasedBase) GetFd() int { | |
| 39 | 39 | ||
| 40 | - | return XGFileDescriptorBasedGetFd(x.GoPointer()) | |
| 41 | - | ||
| 40 | + | cret := XGFileDescriptorBasedGetFd(x.GoPointer()) | |
| 41 | + | return cret | |
| 42 | 42 | } | |
| 43 | 43 | ||
| 44 | 44 | var XGFileDescriptorBasedGetFd func(uintptr) int | |
M v4/gio/gfileenumerator.go +67 -43
| @@ -51,7 +51,7 @@ func FileEnumeratorNewFromInternalPtr(ptr uintptr) *FileEnumerator { | |||
| 51 | 51 | return cls | |
| 52 | 52 | } | |
| 53 | 53 | ||
| 54 | - | var xFileEnumeratorClose func(uintptr, uintptr) bool | |
| 54 | + | var xFileEnumeratorClose func(uintptr, uintptr, **glib.Error) bool | |
| 55 | 55 | ||
| 56 | 56 | // Releases all resources used by this enumerator, making the | |
| 57 | 57 | // enumerator return %G_IO_ERROR_CLOSED on all calls. | |
| @@ -59,9 +59,14 @@ var xFileEnumeratorClose func(uintptr, uintptr) bool | |||
| 59 | 59 | // This will be automatically called when the last reference | |
| 60 | 60 | // is dropped, but you might want to call this function to make | |
| 61 | 61 | // sure resources are released as early as possible. | |
| 62 | - | func (x *FileEnumerator) Close(CancellableVar *Cancellable) bool { | |
| 62 | + | func (x *FileEnumerator) Close(CancellableVar *Cancellable) (bool, error) { | |
| 63 | + | var cerr *glib.Error | |
| 63 | 64 | ||
| 64 | - | return xFileEnumeratorClose(x.GoPointer(), CancellableVar.GoPointer()) | |
| 65 | + | cret := xFileEnumeratorClose(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 66 | + | if cerr == nil { | |
| 67 | + | return cret, nil | |
| 68 | + | } | |
| 69 | + | return cret, cerr | |
| 65 | 70 | ||
| 66 | 71 | } | |
| 67 | 72 | ||
| @@ -79,7 +84,7 @@ func (x *FileEnumerator) CloseAsync(IoPriorityVar int, CancellableVar *Cancellab | |||
| 79 | 84 | ||
| 80 | 85 | } | |
| 81 | 86 | ||
| 82 | - | var xFileEnumeratorCloseFinish func(uintptr, uintptr) bool | |
| 87 | + | var xFileEnumeratorCloseFinish func(uintptr, uintptr, **glib.Error) bool | |
| 83 | 88 | ||
| 84 | 89 | // Finishes closing a file enumerator, started from g_file_enumerator_close_async(). | |
| 85 | 90 | // | |
| @@ -91,9 +96,14 @@ var xFileEnumeratorCloseFinish func(uintptr, uintptr) bool | |||
| 91 | 96 | // cancelled by triggering the cancellable object from another thread. If the operation | |
| 92 | 97 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be | |
| 93 | 98 | // returned. | |
| 94 | - | func (x *FileEnumerator) CloseFinish(ResultVar AsyncResult) bool { | |
| 99 | + | func (x *FileEnumerator) CloseFinish(ResultVar AsyncResult) (bool, error) { | |
| 100 | + | var cerr *glib.Error | |
| 95 | 101 | ||
| 96 | - | return xFileEnumeratorCloseFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 102 | + | cret := xFileEnumeratorCloseFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 103 | + | if cerr == nil { | |
| 104 | + | return cret, nil | |
| 105 | + | } | |
| 106 | + | return cret, cerr | |
| 97 | 107 | ||
| 98 | 108 | } | |
| 99 | 109 | ||
| @@ -115,34 +125,33 @@ var xFileEnumeratorGetChild func(uintptr, uintptr) uintptr | |||
| 115 | 125 | // | |
| 116 | 126 | // ]| | |
| 117 | 127 | func (x *FileEnumerator) GetChild(InfoVar *FileInfo) *FileBase { | |
| 128 | + | var cls *FileBase | |
| 118 | 129 | ||
| 119 | - | GetChildPtr := xFileEnumeratorGetChild(x.GoPointer(), InfoVar.GoPointer()) | |
| 120 | - | if GetChildPtr == 0 { | |
| 121 | - | return nil | |
| 122 | - | } | |
| 123 | - | ||
| 124 | - | GetChildCls := &FileBase{} | |
| 125 | - | GetChildCls.Ptr = GetChildPtr | |
| 126 | - | return GetChildCls | |
| 130 | + | cret := xFileEnumeratorGetChild(x.GoPointer(), InfoVar.GoPointer()) | |
| 127 | 131 | ||
| 132 | + | if cret == 0 { | |
| 133 | + | return cls | |
| 134 | + | } | |
| 135 | + | cls = &FileBase{} | |
| 136 | + | cls.Ptr = cret | |
| 137 | + | return cls | |
| 128 | 138 | } | |
| 129 | 139 | ||
| 130 | 140 | var xFileEnumeratorGetContainer func(uintptr) uintptr | |
| 131 | 141 | ||
| 132 | 142 | // Get the #GFile container which is being enumerated. | |
| 133 | 143 | func (x *FileEnumerator) GetContainer() *FileBase { | |
| 144 | + | var cls *FileBase | |
| 134 | 145 | ||
| 135 | - | GetContainerPtr := xFileEnumeratorGetContainer(x.GoPointer()) | |
| 136 | - | if GetContainerPtr == 0 { | |
| 137 | - | return nil | |
| 138 | - | } | |
| 139 | - | ||
| 140 | - | gobject.IncreaseRef(GetContainerPtr) | |
| 141 | - | ||
| 142 | - | GetContainerCls := &FileBase{} | |
| 143 | - | GetContainerCls.Ptr = GetContainerPtr | |
| 144 | - | return GetContainerCls | |
| 146 | + | cret := xFileEnumeratorGetContainer(x.GoPointer()) | |
| 145 | 147 | ||
| 148 | + | if cret == 0 { | |
| 149 | + | return cls | |
| 150 | + | } | |
| 151 | + | gobject.IncreaseRef(cret) | |
| 152 | + | cls = &FileBase{} | |
| 153 | + | cls.Ptr = cret | |
| 154 | + | return cls | |
| 146 | 155 | } | |
| 147 | 156 | ||
| 148 | 157 | var xFileEnumeratorHasPending func(uintptr) bool | |
| @@ -150,8 +159,8 @@ var xFileEnumeratorHasPending func(uintptr) bool | |||
| 150 | 159 | // Checks if the file enumerator has pending operations. | |
| 151 | 160 | func (x *FileEnumerator) HasPending() bool { | |
| 152 | 161 | ||
| 153 | - | return xFileEnumeratorHasPending(x.GoPointer()) | |
| 154 | - | ||
| 162 | + | cret := xFileEnumeratorHasPending(x.GoPointer()) | |
| 163 | + | return cret | |
| 155 | 164 | } | |
| 156 | 165 | ||
| 157 | 166 | var xFileEnumeratorIsClosed func(uintptr) bool | |
| @@ -159,11 +168,11 @@ var xFileEnumeratorIsClosed func(uintptr) bool | |||
| 159 | 168 | // Checks if the file enumerator has been closed. | |
| 160 | 169 | func (x *FileEnumerator) IsClosed() bool { | |
| 161 | 170 | ||
| 162 | - | return xFileEnumeratorIsClosed(x.GoPointer()) | |
| 163 | - | ||
| 171 | + | cret := xFileEnumeratorIsClosed(x.GoPointer()) | |
| 172 | + | return cret | |
| 164 | 173 | } | |
| 165 | 174 | ||
| 166 | - | var xFileEnumeratorIterate func(uintptr, *uintptr, *uintptr, uintptr) bool | |
| 175 | + | var xFileEnumeratorIterate func(uintptr, *uintptr, *uintptr, uintptr, **glib.Error) bool | |
| 167 | 176 | ||
| 168 | 177 | // This is a version of g_file_enumerator_next_file() that's easier to | |
| 169 | 178 | // use correctly from C programs. With g_file_enumerator_next_file(), | |
| @@ -206,13 +215,18 @@ var xFileEnumeratorIterate func(uintptr, *uintptr, *uintptr, uintptr) bool | |||
| 206 | 215 | // g_object_unref (direnum); // Note: frees the last @info | |
| 207 | 216 | // | |
| 208 | 217 | // ]| | |
| 209 | - | func (x *FileEnumerator) Iterate(OutInfoVar **FileInfo, OutChildVar *File, CancellableVar *Cancellable) bool { | |
| 218 | + | func (x *FileEnumerator) Iterate(OutInfoVar **FileInfo, OutChildVar *File, CancellableVar *Cancellable) (bool, error) { | |
| 219 | + | var cerr *glib.Error | |
| 210 | 220 | ||
| 211 | - | return xFileEnumeratorIterate(x.GoPointer(), gobject.ConvertPtr(OutInfoVar), gobject.ConvertPtr(OutChildVar), CancellableVar.GoPointer()) | |
| 221 | + | cret := xFileEnumeratorIterate(x.GoPointer(), gobject.ConvertPtr(OutInfoVar), gobject.ConvertPtr(OutChildVar), CancellableVar.GoPointer(), &cerr) | |
| 222 | + | if cerr == nil { | |
| 223 | + | return cret, nil | |
| 224 | + | } | |
| 225 | + | return cret, cerr | |
| 212 | 226 | ||
| 213 | 227 | } | |
| 214 | 228 | ||
| 215 | - | var xFileEnumeratorNextFile func(uintptr, uintptr) uintptr | |
| 229 | + | var xFileEnumeratorNextFile func(uintptr, uintptr, **glib.Error) uintptr | |
| 216 | 230 | ||
| 217 | 231 | // Returns information for the next file in the enumerated object. | |
| 218 | 232 | // Will block until the information is available. The #GFileInfo | |
| @@ -225,16 +239,21 @@ var xFileEnumeratorNextFile func(uintptr, uintptr) uintptr | |||
| 225 | 239 | // On error, returns %NULL and sets @error to the error. If the | |
| 226 | 240 | // enumerator is at the end, %NULL will be returned and @error will | |
| 227 | 241 | // be unset. | |
| 228 | - | func (x *FileEnumerator) NextFile(CancellableVar *Cancellable) *FileInfo { | |
| 242 | + | func (x *FileEnumerator) NextFile(CancellableVar *Cancellable) (*FileInfo, error) { | |
| 243 | + | var cls *FileInfo | |
| 244 | + | var cerr *glib.Error | |
| 229 | 245 | ||
| 230 | - | NextFilePtr := xFileEnumeratorNextFile(x.GoPointer(), CancellableVar.GoPointer()) | |
| 231 | - | if NextFilePtr == 0 { | |
| 232 | - | return nil | |
| 233 | - | } | |
| 246 | + | cret := xFileEnumeratorNextFile(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 234 | 247 | ||
| 235 | - | NextFileCls := &FileInfo{} | |
| 236 | - | NextFileCls.Ptr = NextFilePtr | |
| 237 | - | return NextFileCls | |
| 248 | + | if cret == 0 { | |
| 249 | + | return cls, cerr | |
| 250 | + | } | |
| 251 | + | cls = &FileInfo{} | |
| 252 | + | cls.Ptr = cret | |
| 253 | + | if cerr == nil { | |
| 254 | + | return cls, nil | |
| 255 | + | } | |
| 256 | + | return cls, cerr | |
| 238 | 257 | ||
| 239 | 258 | } | |
| 240 | 259 | ||
| @@ -265,12 +284,17 @@ func (x *FileEnumerator) NextFilesAsync(NumFilesVar int, IoPriorityVar int, Canc | |||
| 265 | 284 | ||
| 266 | 285 | } | |
| 267 | 286 | ||
| 268 | - | var xFileEnumeratorNextFilesFinish func(uintptr, uintptr) *glib.List | |
| 287 | + | var xFileEnumeratorNextFilesFinish func(uintptr, uintptr, **glib.Error) *glib.List | |
| 269 | 288 | ||
| 270 | 289 | // Finishes the asynchronous operation started with g_file_enumerator_next_files_async(). | |
| 271 | - | func (x *FileEnumerator) NextFilesFinish(ResultVar AsyncResult) *glib.List { | |
| 290 | + | func (x *FileEnumerator) NextFilesFinish(ResultVar AsyncResult) (*glib.List, error) { | |
| 291 | + | var cerr *glib.Error | |
| 272 | 292 | ||
| 273 | - | return xFileEnumeratorNextFilesFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 293 | + | cret := xFileEnumeratorNextFilesFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 294 | + | if cerr == nil { | |
| 295 | + | return cret, nil | |
| 296 | + | } | |
| 297 | + | return cret, cerr | |
| 274 | 298 | ||
| 275 | 299 | } | |
| 276 | 300 | ||
M v4/gio/gfileicon.go +50 -39
| @@ -27,32 +27,33 @@ var xNewFileIcon func(uintptr) uintptr | |||
| 27 | 27 | ||
| 28 | 28 | // Creates a new icon for a file. | |
| 29 | 29 | func NewFileIcon(FileVar File) *FileIcon { | |
| 30 | - | NewFileIconPtr := xNewFileIcon(FileVar.GoPointer()) | |
| 31 | - | if NewFileIconPtr == 0 { | |
| 32 | - | return nil | |
| 33 | - | } | |
| 30 | + | var cls *FileIcon | |
| 31 | + | ||
| 32 | + | cret := xNewFileIcon(FileVar.GoPointer()) | |
| 34 | 33 | ||
| 35 | - | NewFileIconCls := &FileIcon{} | |
| 36 | - | NewFileIconCls.Ptr = NewFileIconPtr | |
| 37 | - | return NewFileIconCls | |
| 34 | + | if cret == 0 { | |
| 35 | + | return cls | |
| 36 | + | } | |
| 37 | + | cls = &FileIcon{} | |
| 38 | + | cls.Ptr = cret | |
| 39 | + | return cls | |
| 38 | 40 | } | |
| 39 | 41 | ||
| 40 | 42 | var xFileIconGetFile func(uintptr) uintptr | |
| 41 | 43 | ||
| 42 | 44 | // Gets the #GFile associated with the given @icon. | |
| 43 | 45 | func (x *FileIcon) GetFile() *FileBase { | |
| 46 | + | var cls *FileBase | |
| 44 | 47 | ||
| 45 | - | GetFilePtr := xFileIconGetFile(x.GoPointer()) | |
| 46 | - | if GetFilePtr == 0 { | |
| 47 | - | return nil | |
| 48 | - | } | |
| 49 | - | ||
| 50 | - | gobject.IncreaseRef(GetFilePtr) | |
| 51 | - | ||
| 52 | - | GetFileCls := &FileBase{} | |
| 53 | - | GetFileCls.Ptr = GetFilePtr | |
| 54 | - | return GetFileCls | |
| 48 | + | cret := xFileIconGetFile(x.GoPointer()) | |
| 55 | 49 | ||
| 50 | + | if cret == 0 { | |
| 51 | + | return cls | |
| 52 | + | } | |
| 53 | + | gobject.IncreaseRef(cret) | |
| 54 | + | cls = &FileBase{} | |
| 55 | + | cls.Ptr = cret | |
| 56 | + | return cls | |
| 56 | 57 | } | |
| 57 | 58 | ||
| 58 | 59 | func (c *FileIcon) GoPointer() uintptr { | |
| @@ -66,8 +67,8 @@ func (c *FileIcon) SetGoPointer(ptr uintptr) { | |||
| 66 | 67 | // Checks if two icons are equal. | |
| 67 | 68 | func (x *FileIcon) Equal(Icon2Var Icon) bool { | |
| 68 | 69 | ||
| 69 | - | return XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 70 | - | ||
| 70 | + | cret := XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 71 | + | return cret | |
| 71 | 72 | } | |
| 72 | 73 | ||
| 73 | 74 | // Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved | |
| @@ -77,8 +78,8 @@ func (x *FileIcon) Equal(Icon2Var Icon) bool { | |||
| 77 | 78 | // (as opposed to over the network), and within the same file system namespace. | |
| 78 | 79 | func (x *FileIcon) Serialize() *glib.Variant { | |
| 79 | 80 | ||
| 80 | - | return XGIconSerialize(x.GoPointer()) | |
| 81 | - | ||
| 81 | + | cret := XGIconSerialize(x.GoPointer()) | |
| 82 | + | return cret | |
| 82 | 83 | } | |
| 83 | 84 | ||
| 84 | 85 | // Generates a textual representation of @icon that can be used for | |
| @@ -99,22 +100,27 @@ func (x *FileIcon) Serialize() *glib.Variant { | |||
| 99 | 100 | // the encoding is simply the name (such as `network-server`). | |
| 100 | 101 | func (x *FileIcon) ToString() string { | |
| 101 | 102 | ||
| 102 | - | return XGIconToString(x.GoPointer()) | |
| 103 | - | ||
| 103 | + | cret := XGIconToString(x.GoPointer()) | |
| 104 | + | return cret | |
| 104 | 105 | } | |
| 105 | 106 | ||
| 106 | 107 | // Loads a loadable icon. For the asynchronous version of this function, | |
| 107 | 108 | // see g_loadable_icon_load_async(). | |
| 108 | - | func (x *FileIcon) Load(SizeVar int, TypeVar string, CancellableVar *Cancellable) *InputStream { | |
| 109 | + | func (x *FileIcon) Load(SizeVar int, TypeVar string, CancellableVar *Cancellable) (*InputStream, error) { | |
| 110 | + | var cls *InputStream | |
| 111 | + | var cerr *glib.Error | |
| 109 | 112 | ||
| 110 | - | LoadPtr := XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer()) | |
| 111 | - | if LoadPtr == 0 { | |
| 112 | - | return nil | |
| 113 | - | } | |
| 113 | + | cret := XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 114 | 114 | ||
| 115 | - | LoadCls := &InputStream{} | |
| 116 | - | LoadCls.Ptr = LoadPtr | |
| 117 | - | return LoadCls | |
| 115 | + | if cret == 0 { | |
| 116 | + | return cls, cerr | |
| 117 | + | } | |
| 118 | + | cls = &InputStream{} | |
| 119 | + | cls.Ptr = cret | |
| 120 | + | if cerr == nil { | |
| 121 | + | return cls, nil | |
| 122 | + | } | |
| 123 | + | return cls, cerr | |
| 118 | 124 | ||
| 119 | 125 | } | |
| 120 | 126 | ||
| @@ -128,16 +134,21 @@ func (x *FileIcon) LoadAsync(SizeVar int, CancellableVar *Cancellable, CallbackV | |||
| 128 | 134 | } | |
| 129 | 135 | ||
| 130 | 136 | // Finishes an asynchronous icon load started in g_loadable_icon_load_async(). | |
| 131 | - | func (x *FileIcon) LoadFinish(ResVar AsyncResult, TypeVar string) *InputStream { | |
| 137 | + | func (x *FileIcon) LoadFinish(ResVar AsyncResult, TypeVar string) (*InputStream, error) { | |
| 138 | + | var cls *InputStream | |
| 139 | + | var cerr *glib.Error | |
| 132 | 140 | ||
| 133 | - | LoadFinishPtr := XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar) | |
| 134 | - | if LoadFinishPtr == 0 { | |
| 135 | - | return nil | |
| 136 | - | } | |
| 141 | + | cret := XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar, &cerr) | |
| 137 | 142 | ||
| 138 | - | LoadFinishCls := &InputStream{} | |
| 139 | - | LoadFinishCls.Ptr = LoadFinishPtr | |
| 140 | - | return LoadFinishCls | |
| 143 | + | if cret == 0 { | |
| 144 | + | return cls, cerr | |
| 145 | + | } | |
| 146 | + | cls = &InputStream{} | |
| 147 | + | cls.Ptr = cret | |
| 148 | + | if cerr == nil { | |
| 149 | + | return cls, nil | |
| 150 | + | } | |
| 151 | + | return cls, cerr | |
| 141 | 152 | ||
| 142 | 153 | } | |
| 143 | 154 | ||
M v4/gio/gfileinfo.go +108 -109
| @@ -54,14 +54,16 @@ var xNewFileInfo func() uintptr | |||
| 54 | 54 | ||
| 55 | 55 | // Creates a new file info structure. | |
| 56 | 56 | func NewFileInfo() *FileInfo { | |
| 57 | - | NewFileInfoPtr := xNewFileInfo() | |
| 58 | - | if NewFileInfoPtr == 0 { | |
| 59 | - | return nil | |
| 60 | - | } | |
| 57 | + | var cls *FileInfo | |
| 58 | + | ||
| 59 | + | cret := xNewFileInfo() | |
| 61 | 60 | ||
| 62 | - | NewFileInfoCls := &FileInfo{} | |
| 63 | - | NewFileInfoCls.Ptr = NewFileInfoPtr | |
| 64 | - | return NewFileInfoCls | |
| 61 | + | if cret == 0 { | |
| 62 | + | return cls | |
| 63 | + | } | |
| 64 | + | cls = &FileInfo{} | |
| 65 | + | cls.Ptr = cret | |
| 66 | + | return cls | |
| 65 | 67 | } | |
| 66 | 68 | ||
| 67 | 69 | var xFileInfoClearStatus func(uintptr) | |
| @@ -87,16 +89,16 @@ var xFileInfoDup func(uintptr) uintptr | |||
| 87 | 89 | ||
| 88 | 90 | // Duplicates a file info structure. | |
| 89 | 91 | func (x *FileInfo) Dup() *FileInfo { | |
| 92 | + | var cls *FileInfo | |
| 90 | 93 | ||
| 91 | - | DupPtr := xFileInfoDup(x.GoPointer()) | |
| 92 | - | if DupPtr == 0 { | |
| 93 | - | return nil | |
| 94 | - | } | |
| 95 | - | ||
| 96 | - | DupCls := &FileInfo{} | |
| 97 | - | DupCls.Ptr = DupPtr | |
| 98 | - | return DupCls | |
| 94 | + | cret := xFileInfoDup(x.GoPointer()) | |
| 99 | 95 | ||
| 96 | + | if cret == 0 { | |
| 97 | + | return cls | |
| 98 | + | } | |
| 99 | + | cls = &FileInfo{} | |
| 100 | + | cls.Ptr = cret | |
| 101 | + | return cls | |
| 100 | 102 | } | |
| 101 | 103 | ||
| 102 | 104 | var xFileInfoGetAccessDateTime func(uintptr) *glib.DateTime | |
| @@ -109,8 +111,8 @@ var xFileInfoGetAccessDateTime func(uintptr) *glib.DateTime | |||
| 109 | 111 | // will have microsecond precision. | |
| 110 | 112 | func (x *FileInfo) GetAccessDateTime() *glib.DateTime { | |
| 111 | 113 | ||
| 112 | - | return xFileInfoGetAccessDateTime(x.GoPointer()) | |
| 113 | - | ||
| 114 | + | cret := xFileInfoGetAccessDateTime(x.GoPointer()) | |
| 115 | + | return cret | |
| 114 | 116 | } | |
| 115 | 117 | ||
| 116 | 118 | var xFileInfoGetAttributeAsString func(uintptr, string) string | |
| @@ -120,8 +122,8 @@ var xFileInfoGetAttributeAsString func(uintptr, string) string | |||
| 120 | 122 | // UTF-8. | |
| 121 | 123 | func (x *FileInfo) GetAttributeAsString(AttributeVar string) string { | |
| 122 | 124 | ||
| 123 | - | return xFileInfoGetAttributeAsString(x.GoPointer(), AttributeVar) | |
| 124 | - | ||
| 125 | + | cret := xFileInfoGetAttributeAsString(x.GoPointer(), AttributeVar) | |
| 126 | + | return cret | |
| 125 | 127 | } | |
| 126 | 128 | ||
| 127 | 129 | var xFileInfoGetAttributeBoolean func(uintptr, string) bool | |
| @@ -130,8 +132,8 @@ var xFileInfoGetAttributeBoolean func(uintptr, string) bool | |||
| 130 | 132 | // contain a boolean value, %FALSE will be returned. | |
| 131 | 133 | func (x *FileInfo) GetAttributeBoolean(AttributeVar string) bool { | |
| 132 | 134 | ||
| 133 | - | return xFileInfoGetAttributeBoolean(x.GoPointer(), AttributeVar) | |
| 134 | - | ||
| 135 | + | cret := xFileInfoGetAttributeBoolean(x.GoPointer(), AttributeVar) | |
| 136 | + | return cret | |
| 135 | 137 | } | |
| 136 | 138 | ||
| 137 | 139 | var xFileInfoGetAttributeByteString func(uintptr, string) string | |
| @@ -140,8 +142,8 @@ var xFileInfoGetAttributeByteString func(uintptr, string) string | |||
| 140 | 142 | // not contain a byte string, %NULL will be returned. | |
| 141 | 143 | func (x *FileInfo) GetAttributeByteString(AttributeVar string) string { | |
| 142 | 144 | ||
| 143 | - | return xFileInfoGetAttributeByteString(x.GoPointer(), AttributeVar) | |
| 144 | - | ||
| 145 | + | cret := xFileInfoGetAttributeByteString(x.GoPointer(), AttributeVar) | |
| 146 | + | return cret | |
| 145 | 147 | } | |
| 146 | 148 | ||
| 147 | 149 | var xFileInfoGetAttributeData func(uintptr, string, *FileAttributeType, uintptr, *FileAttributeStatus) bool | |
| @@ -149,8 +151,8 @@ var xFileInfoGetAttributeData func(uintptr, string, *FileAttributeType, uintptr, | |||
| 149 | 151 | // Gets the attribute type, value and status for an attribute key. | |
| 150 | 152 | func (x *FileInfo) GetAttributeData(AttributeVar string, TypeVar *FileAttributeType, ValuePpVar uintptr, StatusVar *FileAttributeStatus) bool { | |
| 151 | 153 | ||
| 152 | - | return xFileInfoGetAttributeData(x.GoPointer(), AttributeVar, TypeVar, ValuePpVar, StatusVar) | |
| 153 | - | ||
| 154 | + | cret := xFileInfoGetAttributeData(x.GoPointer(), AttributeVar, TypeVar, ValuePpVar, StatusVar) | |
| 155 | + | return cret | |
| 154 | 156 | } | |
| 155 | 157 | ||
| 156 | 158 | var xFileInfoGetAttributeInt32 func(uintptr, string) int32 | |
| @@ -160,8 +162,8 @@ var xFileInfoGetAttributeInt32 func(uintptr, string) int32 | |||
| 160 | 162 | // 0 will be returned. | |
| 161 | 163 | func (x *FileInfo) GetAttributeInt32(AttributeVar string) int32 { | |
| 162 | 164 | ||
| 163 | - | return xFileInfoGetAttributeInt32(x.GoPointer(), AttributeVar) | |
| 164 | - | ||
| 165 | + | cret := xFileInfoGetAttributeInt32(x.GoPointer(), AttributeVar) | |
| 166 | + | return cret | |
| 165 | 167 | } | |
| 166 | 168 | ||
| 167 | 169 | var xFileInfoGetAttributeInt64 func(uintptr, string) int64 | |
| @@ -171,8 +173,8 @@ var xFileInfoGetAttributeInt64 func(uintptr, string) int64 | |||
| 171 | 173 | // 0 will be returned. | |
| 172 | 174 | func (x *FileInfo) GetAttributeInt64(AttributeVar string) int64 { | |
| 173 | 175 | ||
| 174 | - | return xFileInfoGetAttributeInt64(x.GoPointer(), AttributeVar) | |
| 175 | - | ||
| 176 | + | cret := xFileInfoGetAttributeInt64(x.GoPointer(), AttributeVar) | |
| 177 | + | return cret | |
| 176 | 178 | } | |
| 177 | 179 | ||
| 178 | 180 | var xFileInfoGetAttributeObject func(uintptr, string) uintptr | |
| @@ -180,18 +182,17 @@ var xFileInfoGetAttributeObject func(uintptr, string) uintptr | |||
| 180 | 182 | // Gets the value of a #GObject attribute. If the attribute does | |
| 181 | 183 | // not contain a #GObject, %NULL will be returned. | |
| 182 | 184 | func (x *FileInfo) GetAttributeObject(AttributeVar string) *gobject.Object { | |
| 185 | + | var cls *gobject.Object | |
| 183 | 186 | ||
| 184 | - | GetAttributeObjectPtr := xFileInfoGetAttributeObject(x.GoPointer(), AttributeVar) | |
| 185 | - | if GetAttributeObjectPtr == 0 { | |
| 186 | - | return nil | |
| 187 | - | } | |
| 188 | - | ||
| 189 | - | gobject.IncreaseRef(GetAttributeObjectPtr) | |
| 190 | - | ||
| 191 | - | GetAttributeObjectCls := &gobject.Object{} | |
| 192 | - | GetAttributeObjectCls.Ptr = GetAttributeObjectPtr | |
| 193 | - | return GetAttributeObjectCls | |
| 187 | + | cret := xFileInfoGetAttributeObject(x.GoPointer(), AttributeVar) | |
| 194 | 188 | ||
| 189 | + | if cret == 0 { | |
| 190 | + | return cls | |
| 191 | + | } | |
| 192 | + | gobject.IncreaseRef(cret) | |
| 193 | + | cls = &gobject.Object{} | |
| 194 | + | cls.Ptr = cret | |
| 195 | + | return cls | |
| 195 | 196 | } | |
| 196 | 197 | ||
| 197 | 198 | var xFileInfoGetAttributeStatus func(uintptr, string) FileAttributeStatus | |
| @@ -199,8 +200,8 @@ var xFileInfoGetAttributeStatus func(uintptr, string) FileAttributeStatus | |||
| 199 | 200 | // Gets the attribute status for an attribute key. | |
| 200 | 201 | func (x *FileInfo) GetAttributeStatus(AttributeVar string) FileAttributeStatus { | |
| 201 | 202 | ||
| 202 | - | return xFileInfoGetAttributeStatus(x.GoPointer(), AttributeVar) | |
| 203 | - | ||
| 203 | + | cret := xFileInfoGetAttributeStatus(x.GoPointer(), AttributeVar) | |
| 204 | + | return cret | |
| 204 | 205 | } | |
| 205 | 206 | ||
| 206 | 207 | var xFileInfoGetAttributeString func(uintptr, string) string | |
| @@ -209,8 +210,8 @@ var xFileInfoGetAttributeString func(uintptr, string) string | |||
| 209 | 210 | // not contain a string, %NULL will be returned. | |
| 210 | 211 | func (x *FileInfo) GetAttributeString(AttributeVar string) string { | |
| 211 | 212 | ||
| 212 | - | return xFileInfoGetAttributeString(x.GoPointer(), AttributeVar) | |
| 213 | - | ||
| 213 | + | cret := xFileInfoGetAttributeString(x.GoPointer(), AttributeVar) | |
| 214 | + | return cret | |
| 214 | 215 | } | |
| 215 | 216 | ||
| 216 | 217 | var xFileInfoGetAttributeStringv func(uintptr, string) []string | |
| @@ -219,8 +220,8 @@ var xFileInfoGetAttributeStringv func(uintptr, string) []string | |||
| 219 | 220 | // not contain a stringv, %NULL will be returned. | |
| 220 | 221 | func (x *FileInfo) GetAttributeStringv(AttributeVar string) []string { | |
| 221 | 222 | ||
| 222 | - | return xFileInfoGetAttributeStringv(x.GoPointer(), AttributeVar) | |
| 223 | - | ||
| 223 | + | cret := xFileInfoGetAttributeStringv(x.GoPointer(), AttributeVar) | |
| 224 | + | return cret | |
| 224 | 225 | } | |
| 225 | 226 | ||
| 226 | 227 | var xFileInfoGetAttributeType func(uintptr, string) FileAttributeType | |
| @@ -228,8 +229,8 @@ var xFileInfoGetAttributeType func(uintptr, string) FileAttributeType | |||
| 228 | 229 | // Gets the attribute type for an attribute key. | |
| 229 | 230 | func (x *FileInfo) GetAttributeType(AttributeVar string) FileAttributeType { | |
| 230 | 231 | ||
| 231 | - | return xFileInfoGetAttributeType(x.GoPointer(), AttributeVar) | |
| 232 | - | ||
| 232 | + | cret := xFileInfoGetAttributeType(x.GoPointer(), AttributeVar) | |
| 233 | + | return cret | |
| 233 | 234 | } | |
| 234 | 235 | ||
| 235 | 236 | var xFileInfoGetAttributeUint32 func(uintptr, string) uint32 | |
| @@ -239,8 +240,8 @@ var xFileInfoGetAttributeUint32 func(uintptr, string) uint32 | |||
| 239 | 240 | // 0 will be returned. | |
| 240 | 241 | func (x *FileInfo) GetAttributeUint32(AttributeVar string) uint32 { | |
| 241 | 242 | ||
| 242 | - | return xFileInfoGetAttributeUint32(x.GoPointer(), AttributeVar) | |
| 243 | - | ||
| 243 | + | cret := xFileInfoGetAttributeUint32(x.GoPointer(), AttributeVar) | |
| 244 | + | return cret | |
| 244 | 245 | } | |
| 245 | 246 | ||
| 246 | 247 | var xFileInfoGetAttributeUint64 func(uintptr, string) uint64 | |
| @@ -250,8 +251,8 @@ var xFileInfoGetAttributeUint64 func(uintptr, string) uint64 | |||
| 250 | 251 | // 0 will be returned. | |
| 251 | 252 | func (x *FileInfo) GetAttributeUint64(AttributeVar string) uint64 { | |
| 252 | 253 | ||
| 253 | - | return xFileInfoGetAttributeUint64(x.GoPointer(), AttributeVar) | |
| 254 | - | ||
| 254 | + | cret := xFileInfoGetAttributeUint64(x.GoPointer(), AttributeVar) | |
| 255 | + | return cret | |
| 255 | 256 | } | |
| 256 | 257 | ||
| 257 | 258 | var xFileInfoGetContentType func(uintptr) string | |
| @@ -259,8 +260,8 @@ var xFileInfoGetContentType func(uintptr) string | |||
| 259 | 260 | // Gets the file's content type. | |
| 260 | 261 | func (x *FileInfo) GetContentType() string { | |
| 261 | 262 | ||
| 262 | - | return xFileInfoGetContentType(x.GoPointer()) | |
| 263 | - | ||
| 263 | + | cret := xFileInfoGetContentType(x.GoPointer()) | |
| 264 | + | return cret | |
| 264 | 265 | } | |
| 265 | 266 | ||
| 266 | 267 | var xFileInfoGetCreationDateTime func(uintptr) *glib.DateTime | |
| @@ -273,8 +274,8 @@ var xFileInfoGetCreationDateTime func(uintptr) *glib.DateTime | |||
| 273 | 274 | // will have microsecond precision. | |
| 274 | 275 | func (x *FileInfo) GetCreationDateTime() *glib.DateTime { | |
| 275 | 276 | ||
| 276 | - | return xFileInfoGetCreationDateTime(x.GoPointer()) | |
| 277 | - | ||
| 277 | + | cret := xFileInfoGetCreationDateTime(x.GoPointer()) | |
| 278 | + | return cret | |
| 278 | 279 | } | |
| 279 | 280 | ||
| 280 | 281 | var xFileInfoGetDeletionDate func(uintptr) *glib.DateTime | |
| @@ -284,8 +285,8 @@ var xFileInfoGetDeletionDate func(uintptr) *glib.DateTime | |||
| 284 | 285 | // G_FILE_ATTRIBUTE_TRASH_DELETION_DATE attribute is unset, %NULL is returned. | |
| 285 | 286 | func (x *FileInfo) GetDeletionDate() *glib.DateTime { | |
| 286 | 287 | ||
| 287 | - | return xFileInfoGetDeletionDate(x.GoPointer()) | |
| 288 | - | ||
| 288 | + | cret := xFileInfoGetDeletionDate(x.GoPointer()) | |
| 289 | + | return cret | |
| 289 | 290 | } | |
| 290 | 291 | ||
| 291 | 292 | var xFileInfoGetDisplayName func(uintptr) string | |
| @@ -293,8 +294,8 @@ var xFileInfoGetDisplayName func(uintptr) string | |||
| 293 | 294 | // Gets a display name for a file. This is guaranteed to always be set. | |
| 294 | 295 | func (x *FileInfo) GetDisplayName() string { | |
| 295 | 296 | ||
| 296 | - | return xFileInfoGetDisplayName(x.GoPointer()) | |
| 297 | - | ||
| 297 | + | cret := xFileInfoGetDisplayName(x.GoPointer()) | |
| 298 | + | return cret | |
| 298 | 299 | } | |
| 299 | 300 | ||
| 300 | 301 | var xFileInfoGetEditName func(uintptr) string | |
| @@ -302,8 +303,8 @@ var xFileInfoGetEditName func(uintptr) string | |||
| 302 | 303 | // Gets the edit name for a file. | |
| 303 | 304 | func (x *FileInfo) GetEditName() string { | |
| 304 | 305 | ||
| 305 | - | return xFileInfoGetEditName(x.GoPointer()) | |
| 306 | - | ||
| 306 | + | cret := xFileInfoGetEditName(x.GoPointer()) | |
| 307 | + | return cret | |
| 307 | 308 | } | |
| 308 | 309 | ||
| 309 | 310 | var xFileInfoGetEtag func(uintptr) string | |
| @@ -312,8 +313,8 @@ var xFileInfoGetEtag func(uintptr) string | |||
| 312 | 313 | // #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE. | |
| 313 | 314 | func (x *FileInfo) GetEtag() string { | |
| 314 | 315 | ||
| 315 | - | return xFileInfoGetEtag(x.GoPointer()) | |
| 316 | - | ||
| 316 | + | cret := xFileInfoGetEtag(x.GoPointer()) | |
| 317 | + | return cret | |
| 317 | 318 | } | |
| 318 | 319 | ||
| 319 | 320 | var xFileInfoGetFileType func(uintptr) FileType | |
| @@ -322,26 +323,25 @@ var xFileInfoGetFileType func(uintptr) FileType | |||
| 322 | 323 | // This is different from the file's content type, see g_file_info_get_content_type(). | |
| 323 | 324 | func (x *FileInfo) GetFileType() FileType { | |
| 324 | 325 | ||
| 325 | - | return xFileInfoGetFileType(x.GoPointer()) | |
| 326 | - | ||
| 326 | + | cret := xFileInfoGetFileType(x.GoPointer()) | |
| 327 | + | return cret | |
| 327 | 328 | } | |
| 328 | 329 | ||
| 329 | 330 | var xFileInfoGetIcon func(uintptr) uintptr | |
| 330 | 331 | ||
| 331 | 332 | // Gets the icon for a file. | |
| 332 | 333 | func (x *FileInfo) GetIcon() *IconBase { | |
| 334 | + | var cls *IconBase | |
| 333 | 335 | ||
| 334 | - | GetIconPtr := xFileInfoGetIcon(x.GoPointer()) | |
| 335 | - | if GetIconPtr == 0 { | |
| 336 | - | return nil | |
| 337 | - | } | |
| 338 | - | ||
| 339 | - | gobject.IncreaseRef(GetIconPtr) | |
| 340 | - | ||
| 341 | - | GetIconCls := &IconBase{} | |
| 342 | - | GetIconCls.Ptr = GetIconPtr | |
| 343 | - | return GetIconCls | |
| 336 | + | cret := xFileInfoGetIcon(x.GoPointer()) | |
| 344 | 337 | ||
| 338 | + | if cret == 0 { | |
| 339 | + | return cls | |
| 340 | + | } | |
| 341 | + | gobject.IncreaseRef(cret) | |
| 342 | + | cls = &IconBase{} | |
| 343 | + | cls.Ptr = cret | |
| 344 | + | return cls | |
| 345 | 345 | } | |
| 346 | 346 | ||
| 347 | 347 | var xFileInfoGetIsBackup func(uintptr) bool | |
| @@ -349,8 +349,8 @@ var xFileInfoGetIsBackup func(uintptr) bool | |||
| 349 | 349 | // Checks if a file is a backup file. | |
| 350 | 350 | func (x *FileInfo) GetIsBackup() bool { | |
| 351 | 351 | ||
| 352 | - | return xFileInfoGetIsBackup(x.GoPointer()) | |
| 353 | - | ||
| 352 | + | cret := xFileInfoGetIsBackup(x.GoPointer()) | |
| 353 | + | return cret | |
| 354 | 354 | } | |
| 355 | 355 | ||
| 356 | 356 | var xFileInfoGetIsHidden func(uintptr) bool | |
| @@ -358,8 +358,8 @@ var xFileInfoGetIsHidden func(uintptr) bool | |||
| 358 | 358 | // Checks if a file is hidden. | |
| 359 | 359 | func (x *FileInfo) GetIsHidden() bool { | |
| 360 | 360 | ||
| 361 | - | return xFileInfoGetIsHidden(x.GoPointer()) | |
| 362 | - | ||
| 361 | + | cret := xFileInfoGetIsHidden(x.GoPointer()) | |
| 362 | + | return cret | |
| 363 | 363 | } | |
| 364 | 364 | ||
| 365 | 365 | var xFileInfoGetIsSymlink func(uintptr) bool | |
| @@ -367,8 +367,8 @@ var xFileInfoGetIsSymlink func(uintptr) bool | |||
| 367 | 367 | // Checks if a file is a symlink. | |
| 368 | 368 | func (x *FileInfo) GetIsSymlink() bool { | |
| 369 | 369 | ||
| 370 | - | return xFileInfoGetIsSymlink(x.GoPointer()) | |
| 371 | - | ||
| 370 | + | cret := xFileInfoGetIsSymlink(x.GoPointer()) | |
| 371 | + | return cret | |
| 372 | 372 | } | |
| 373 | 373 | ||
| 374 | 374 | var xFileInfoGetModificationDateTime func(uintptr) *glib.DateTime | |
| @@ -381,8 +381,8 @@ var xFileInfoGetModificationDateTime func(uintptr) *glib.DateTime | |||
| 381 | 381 | // will have microsecond precision. | |
| 382 | 382 | func (x *FileInfo) GetModificationDateTime() *glib.DateTime { | |
| 383 | 383 | ||
| 384 | - | return xFileInfoGetModificationDateTime(x.GoPointer()) | |
| 385 | - | ||
| 384 | + | cret := xFileInfoGetModificationDateTime(x.GoPointer()) | |
| 385 | + | return cret | |
| 386 | 386 | } | |
| 387 | 387 | ||
| 388 | 388 | var xFileInfoGetModificationTime func(uintptr, *glib.TimeVal) | |
| @@ -400,8 +400,8 @@ var xFileInfoGetName func(uintptr) string | |||
| 400 | 400 | // Gets the name for a file. This is guaranteed to always be set. | |
| 401 | 401 | func (x *FileInfo) GetName() string { | |
| 402 | 402 | ||
| 403 | - | return xFileInfoGetName(x.GoPointer()) | |
| 404 | - | ||
| 403 | + | cret := xFileInfoGetName(x.GoPointer()) | |
| 404 | + | return cret | |
| 405 | 405 | } | |
| 406 | 406 | ||
| 407 | 407 | var xFileInfoGetSize func(uintptr) int64 | |
| @@ -411,8 +411,8 @@ var xFileInfoGetSize func(uintptr) int64 | |||
| 411 | 411 | // from #guint64 to #goffset before returning the result. | |
| 412 | 412 | func (x *FileInfo) GetSize() int64 { | |
| 413 | 413 | ||
| 414 | - | return xFileInfoGetSize(x.GoPointer()) | |
| 415 | - | ||
| 414 | + | cret := xFileInfoGetSize(x.GoPointer()) | |
| 415 | + | return cret | |
| 416 | 416 | } | |
| 417 | 417 | ||
| 418 | 418 | var xFileInfoGetSortOrder func(uintptr) int32 | |
| @@ -421,26 +421,25 @@ var xFileInfoGetSortOrder func(uintptr) int32 | |||
| 421 | 421 | // See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER. | |
| 422 | 422 | func (x *FileInfo) GetSortOrder() int32 { | |
| 423 | 423 | ||
| 424 | - | return xFileInfoGetSortOrder(x.GoPointer()) | |
| 425 | - | ||
| 424 | + | cret := xFileInfoGetSortOrder(x.GoPointer()) | |
| 425 | + | return cret | |
| 426 | 426 | } | |
| 427 | 427 | ||
| 428 | 428 | var xFileInfoGetSymbolicIcon func(uintptr) uintptr | |
| 429 | 429 | ||
| 430 | 430 | // Gets the symbolic icon for a file. | |
| 431 | 431 | func (x *FileInfo) GetSymbolicIcon() *IconBase { | |
| 432 | + | var cls *IconBase | |
| 432 | 433 | ||
| 433 | - | GetSymbolicIconPtr := xFileInfoGetSymbolicIcon(x.GoPointer()) | |
| 434 | - | if GetSymbolicIconPtr == 0 { | |
| 435 | - | return nil | |
| 436 | - | } | |
| 437 | - | ||
| 438 | - | gobject.IncreaseRef(GetSymbolicIconPtr) | |
| 439 | - | ||
| 440 | - | GetSymbolicIconCls := &IconBase{} | |
| 441 | - | GetSymbolicIconCls.Ptr = GetSymbolicIconPtr | |
| 442 | - | return GetSymbolicIconCls | |
| 434 | + | cret := xFileInfoGetSymbolicIcon(x.GoPointer()) | |
| 443 | 435 | ||
| 436 | + | if cret == 0 { | |
| 437 | + | return cls | |
| 438 | + | } | |
| 439 | + | gobject.IncreaseRef(cret) | |
| 440 | + | cls = &IconBase{} | |
| 441 | + | cls.Ptr = cret | |
| 442 | + | return cls | |
| 444 | 443 | } | |
| 445 | 444 | ||
| 446 | 445 | var xFileInfoGetSymlinkTarget func(uintptr) string | |
| @@ -448,8 +447,8 @@ var xFileInfoGetSymlinkTarget func(uintptr) string | |||
| 448 | 447 | // Gets the symlink target for a given #GFileInfo. | |
| 449 | 448 | func (x *FileInfo) GetSymlinkTarget() string { | |
| 450 | 449 | ||
| 451 | - | return xFileInfoGetSymlinkTarget(x.GoPointer()) | |
| 452 | - | ||
| 450 | + | cret := xFileInfoGetSymlinkTarget(x.GoPointer()) | |
| 451 | + | return cret | |
| 453 | 452 | } | |
| 454 | 453 | ||
| 455 | 454 | var xFileInfoHasAttribute func(uintptr, string) bool | |
| @@ -457,8 +456,8 @@ var xFileInfoHasAttribute func(uintptr, string) bool | |||
| 457 | 456 | // Checks if a file info structure has an attribute named @attribute. | |
| 458 | 457 | func (x *FileInfo) HasAttribute(AttributeVar string) bool { | |
| 459 | 458 | ||
| 460 | - | return xFileInfoHasAttribute(x.GoPointer(), AttributeVar) | |
| 461 | - | ||
| 459 | + | cret := xFileInfoHasAttribute(x.GoPointer(), AttributeVar) | |
| 460 | + | return cret | |
| 462 | 461 | } | |
| 463 | 462 | ||
| 464 | 463 | var xFileInfoHasNamespace func(uintptr, string) bool | |
| @@ -467,8 +466,8 @@ var xFileInfoHasNamespace func(uintptr, string) bool | |||
| 467 | 466 | // specified @name_space. | |
| 468 | 467 | func (x *FileInfo) HasNamespace(NameSpaceVar string) bool { | |
| 469 | 468 | ||
| 470 | - | return xFileInfoHasNamespace(x.GoPointer(), NameSpaceVar) | |
| 471 | - | ||
| 469 | + | cret := xFileInfoHasNamespace(x.GoPointer(), NameSpaceVar) | |
| 470 | + | return cret | |
| 472 | 471 | } | |
| 473 | 472 | ||
| 474 | 473 | var xFileInfoListAttributes func(uintptr, string) []string | |
| @@ -476,8 +475,8 @@ var xFileInfoListAttributes func(uintptr, string) []string | |||
| 476 | 475 | // Lists the file info structure's attributes. | |
| 477 | 476 | func (x *FileInfo) ListAttributes(NameSpaceVar string) []string { | |
| 478 | 477 | ||
| 479 | - | return xFileInfoListAttributes(x.GoPointer(), NameSpaceVar) | |
| 480 | - | ||
| 478 | + | cret := xFileInfoListAttributes(x.GoPointer(), NameSpaceVar) | |
| 479 | + | return cret | |
| 481 | 480 | } | |
| 482 | 481 | ||
| 483 | 482 | var xFileInfoRemoveAttribute func(uintptr, string) | |
| @@ -579,8 +578,8 @@ var xFileInfoSetAttributeStatus func(uintptr, string, FileAttributeStatus) bool | |||
| 579 | 578 | // is returned and @info is unchanged. | |
| 580 | 579 | func (x *FileInfo) SetAttributeStatus(AttributeVar string, StatusVar FileAttributeStatus) bool { | |
| 581 | 580 | ||
| 582 | - | return xFileInfoSetAttributeStatus(x.GoPointer(), AttributeVar, StatusVar) | |
| 583 | - | ||
| 581 | + | cret := xFileInfoSetAttributeStatus(x.GoPointer(), AttributeVar, StatusVar) | |
| 582 | + | return cret | |
| 584 | 583 | } | |
| 585 | 584 | ||
| 586 | 585 | var xFileInfoSetAttributeString func(uintptr, string, string) | |
M v4/gio/gfileinputstream.go +48 -28
| @@ -33,23 +33,28 @@ func FileInputStreamNewFromInternalPtr(ptr uintptr) *FileInputStream { | |||
| 33 | 33 | return cls | |
| 34 | 34 | } | |
| 35 | 35 | ||
| 36 | - | var xFileInputStreamQueryInfo func(uintptr, string, uintptr) uintptr | |
| 36 | + | var xFileInputStreamQueryInfo func(uintptr, string, uintptr, **glib.Error) uintptr | |
| 37 | 37 | ||
| 38 | 38 | // Queries a file input stream the given @attributes. This function blocks | |
| 39 | 39 | // while querying the stream. For the asynchronous (non-blocking) version | |
| 40 | 40 | // of this function, see g_file_input_stream_query_info_async(). While the | |
| 41 | 41 | // stream is blocked, the stream will set the pending flag internally, and | |
| 42 | 42 | // any other operations on the stream will fail with %G_IO_ERROR_PENDING. | |
| 43 | - | func (x *FileInputStream) QueryInfo(AttributesVar string, CancellableVar *Cancellable) *FileInfo { | |
| 43 | + | func (x *FileInputStream) QueryInfo(AttributesVar string, CancellableVar *Cancellable) (*FileInfo, error) { | |
| 44 | + | var cls *FileInfo | |
| 45 | + | var cerr *glib.Error | |
| 44 | 46 | ||
| 45 | - | QueryInfoPtr := xFileInputStreamQueryInfo(x.GoPointer(), AttributesVar, CancellableVar.GoPointer()) | |
| 46 | - | if QueryInfoPtr == 0 { | |
| 47 | - | return nil | |
| 48 | - | } | |
| 47 | + | cret := xFileInputStreamQueryInfo(x.GoPointer(), AttributesVar, CancellableVar.GoPointer(), &cerr) | |
| 49 | 48 | ||
| 50 | - | QueryInfoCls := &FileInfo{} | |
| 51 | - | QueryInfoCls.Ptr = QueryInfoPtr | |
| 52 | - | return QueryInfoCls | |
| 49 | + | if cret == 0 { | |
| 50 | + | return cls, cerr | |
| 51 | + | } | |
| 52 | + | cls = &FileInfo{} | |
| 53 | + | cls.Ptr = cret | |
| 54 | + | if cerr == nil { | |
| 55 | + | return cls, nil | |
| 56 | + | } | |
| 57 | + | return cls, cerr | |
| 53 | 58 | ||
| 54 | 59 | } | |
| 55 | 60 | ||
| @@ -72,19 +77,24 @@ func (x *FileInputStream) QueryInfoAsync(AttributesVar string, IoPriorityVar int | |||
| 72 | 77 | ||
| 73 | 78 | } | |
| 74 | 79 | ||
| 75 | - | var xFileInputStreamQueryInfoFinish func(uintptr, uintptr) uintptr | |
| 80 | + | var xFileInputStreamQueryInfoFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 76 | 81 | ||
| 77 | 82 | // Finishes an asynchronous info query operation. | |
| 78 | - | func (x *FileInputStream) QueryInfoFinish(ResultVar AsyncResult) *FileInfo { | |
| 83 | + | func (x *FileInputStream) QueryInfoFinish(ResultVar AsyncResult) (*FileInfo, error) { | |
| 84 | + | var cls *FileInfo | |
| 85 | + | var cerr *glib.Error | |
| 79 | 86 | ||
| 80 | - | QueryInfoFinishPtr := xFileInputStreamQueryInfoFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 81 | - | if QueryInfoFinishPtr == 0 { | |
| 82 | - | return nil | |
| 83 | - | } | |
| 87 | + | cret := xFileInputStreamQueryInfoFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 84 | 88 | ||
| 85 | - | QueryInfoFinishCls := &FileInfo{} | |
| 86 | - | QueryInfoFinishCls.Ptr = QueryInfoFinishPtr | |
| 87 | - | return QueryInfoFinishCls | |
| 89 | + | if cret == 0 { | |
| 90 | + | return cls, cerr | |
| 91 | + | } | |
| 92 | + | cls = &FileInfo{} | |
| 93 | + | cls.Ptr = cret | |
| 94 | + | if cerr == nil { | |
| 95 | + | return cls, nil | |
| 96 | + | } | |
| 97 | + | return cls, cerr | |
| 88 | 98 | ||
| 89 | 99 | } | |
| 90 | 100 | ||
| @@ -99,16 +109,16 @@ func (c *FileInputStream) SetGoPointer(ptr uintptr) { | |||
| 99 | 109 | // Tests if the stream supports the #GSeekableIface. | |
| 100 | 110 | func (x *FileInputStream) CanSeek() bool { | |
| 101 | 111 | ||
| 102 | - | return XGSeekableCanSeek(x.GoPointer()) | |
| 103 | - | ||
| 112 | + | cret := XGSeekableCanSeek(x.GoPointer()) | |
| 113 | + | return cret | |
| 104 | 114 | } | |
| 105 | 115 | ||
| 106 | 116 | // Tests if the length of the stream can be adjusted with | |
| 107 | 117 | // g_seekable_truncate(). | |
| 108 | 118 | func (x *FileInputStream) CanTruncate() bool { | |
| 109 | 119 | ||
| 110 | - | return XGSeekableCanTruncate(x.GoPointer()) | |
| 111 | - | ||
| 120 | + | cret := XGSeekableCanTruncate(x.GoPointer()) | |
| 121 | + | return cret | |
| 112 | 122 | } | |
| 113 | 123 | ||
| 114 | 124 | // Seeks in the stream by the given @offset, modified by @type. | |
| @@ -125,17 +135,22 @@ func (x *FileInputStream) CanTruncate() bool { | |||
| 125 | 135 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 126 | 136 | // triggering the cancellable object from another thread. If the operation | |
| 127 | 137 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 128 | - | func (x *FileInputStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) bool { | |
| 138 | + | func (x *FileInputStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) (bool, error) { | |
| 139 | + | var cerr *glib.Error | |
| 129 | 140 | ||
| 130 | - | return XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer()) | |
| 141 | + | cret := XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 142 | + | if cerr == nil { | |
| 143 | + | return cret, nil | |
| 144 | + | } | |
| 145 | + | return cret, cerr | |
| 131 | 146 | ||
| 132 | 147 | } | |
| 133 | 148 | ||
| 134 | 149 | // Tells the current position within the stream. | |
| 135 | 150 | func (x *FileInputStream) Tell() int64 { | |
| 136 | 151 | ||
| 137 | - | return XGSeekableTell(x.GoPointer()) | |
| 138 | - | ||
| 152 | + | cret := XGSeekableTell(x.GoPointer()) | |
| 153 | + | return cret | |
| 139 | 154 | } | |
| 140 | 155 | ||
| 141 | 156 | // Sets the length of the stream to @offset. If the stream was previously | |
| @@ -147,9 +162,14 @@ func (x *FileInputStream) Tell() int64 { | |||
| 147 | 162 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an | |
| 148 | 163 | // operation was partially finished when the operation was cancelled the | |
| 149 | 164 | // partial result will be returned, without an error. | |
| 150 | - | func (x *FileInputStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) bool { | |
| 165 | + | func (x *FileInputStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) (bool, error) { | |
| 166 | + | var cerr *glib.Error | |
| 151 | 167 | ||
| 152 | - | return XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer()) | |
| 168 | + | cret := XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer(), &cerr) | |
| 169 | + | if cerr == nil { | |
| 170 | + | return cret, nil | |
| 171 | + | } | |
| 172 | + | return cret, cerr | |
| 153 | 173 | ||
| 154 | 174 | } | |
| 155 | 175 | ||
M v4/gio/gfileiostream.go +50 -30
| @@ -51,11 +51,11 @@ var xFileIOStreamGetEtag func(uintptr) string | |||
| 51 | 51 | // and closed, as the etag can change while writing. | |
| 52 | 52 | func (x *FileIOStream) GetEtag() string { | |
| 53 | 53 | ||
| 54 | - | return xFileIOStreamGetEtag(x.GoPointer()) | |
| 55 | - | ||
| 54 | + | cret := xFileIOStreamGetEtag(x.GoPointer()) | |
| 55 | + | return cret | |
| 56 | 56 | } | |
| 57 | 57 | ||
| 58 | - | var xFileIOStreamQueryInfo func(uintptr, string, uintptr) uintptr | |
| 58 | + | var xFileIOStreamQueryInfo func(uintptr, string, uintptr, **glib.Error) uintptr | |
| 59 | 59 | ||
| 60 | 60 | // Queries a file io stream for the given @attributes. | |
| 61 | 61 | // This function blocks while querying the stream. For the asynchronous | |
| @@ -74,16 +74,21 @@ var xFileIOStreamQueryInfo func(uintptr, string, uintptr) uintptr | |||
| 74 | 74 | // triggering the cancellable object from another thread. If the operation | |
| 75 | 75 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will | |
| 76 | 76 | // be returned. | |
| 77 | - | func (x *FileIOStream) QueryInfo(AttributesVar string, CancellableVar *Cancellable) *FileInfo { | |
| 77 | + | func (x *FileIOStream) QueryInfo(AttributesVar string, CancellableVar *Cancellable) (*FileInfo, error) { | |
| 78 | + | var cls *FileInfo | |
| 79 | + | var cerr *glib.Error | |
| 78 | 80 | ||
| 79 | - | QueryInfoPtr := xFileIOStreamQueryInfo(x.GoPointer(), AttributesVar, CancellableVar.GoPointer()) | |
| 80 | - | if QueryInfoPtr == 0 { | |
| 81 | - | return nil | |
| 82 | - | } | |
| 81 | + | cret := xFileIOStreamQueryInfo(x.GoPointer(), AttributesVar, CancellableVar.GoPointer(), &cerr) | |
| 83 | 82 | ||
| 84 | - | QueryInfoCls := &FileInfo{} | |
| 85 | - | QueryInfoCls.Ptr = QueryInfoPtr | |
| 86 | - | return QueryInfoCls | |
| 83 | + | if cret == 0 { | |
| 84 | + | return cls, cerr | |
| 85 | + | } | |
| 86 | + | cls = &FileInfo{} | |
| 87 | + | cls.Ptr = cret | |
| 88 | + | if cerr == nil { | |
| 89 | + | return cls, nil | |
| 90 | + | } | |
| 91 | + | return cls, cerr | |
| 87 | 92 | ||
| 88 | 93 | } | |
| 89 | 94 | ||
| @@ -101,20 +106,25 @@ func (x *FileIOStream) QueryInfoAsync(AttributesVar string, IoPriorityVar int, C | |||
| 101 | 106 | ||
| 102 | 107 | } | |
| 103 | 108 | ||
| 104 | - | var xFileIOStreamQueryInfoFinish func(uintptr, uintptr) uintptr | |
| 109 | + | var xFileIOStreamQueryInfoFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 105 | 110 | ||
| 106 | 111 | // Finalizes the asynchronous query started | |
| 107 | 112 | // by g_file_io_stream_query_info_async(). | |
| 108 | - | func (x *FileIOStream) QueryInfoFinish(ResultVar AsyncResult) *FileInfo { | |
| 113 | + | func (x *FileIOStream) QueryInfoFinish(ResultVar AsyncResult) (*FileInfo, error) { | |
| 114 | + | var cls *FileInfo | |
| 115 | + | var cerr *glib.Error | |
| 109 | 116 | ||
| 110 | - | QueryInfoFinishPtr := xFileIOStreamQueryInfoFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 111 | - | if QueryInfoFinishPtr == 0 { | |
| 112 | - | return nil | |
| 113 | - | } | |
| 117 | + | cret := xFileIOStreamQueryInfoFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 114 | 118 | ||
| 115 | - | QueryInfoFinishCls := &FileInfo{} | |
| 116 | - | QueryInfoFinishCls.Ptr = QueryInfoFinishPtr | |
| 117 | - | return QueryInfoFinishCls | |
| 119 | + | if cret == 0 { | |
| 120 | + | return cls, cerr | |
| 121 | + | } | |
| 122 | + | cls = &FileInfo{} | |
| 123 | + | cls.Ptr = cret | |
| 124 | + | if cerr == nil { | |
| 125 | + | return cls, nil | |
| 126 | + | } | |
| 127 | + | return cls, cerr | |
| 118 | 128 | ||
| 119 | 129 | } | |
| 120 | 130 | ||
| @@ -129,16 +139,16 @@ func (c *FileIOStream) SetGoPointer(ptr uintptr) { | |||
| 129 | 139 | // Tests if the stream supports the #GSeekableIface. | |
| 130 | 140 | func (x *FileIOStream) CanSeek() bool { | |
| 131 | 141 | ||
| 132 | - | return XGSeekableCanSeek(x.GoPointer()) | |
| 133 | - | ||
| 142 | + | cret := XGSeekableCanSeek(x.GoPointer()) | |
| 143 | + | return cret | |
| 134 | 144 | } | |
| 135 | 145 | ||
| 136 | 146 | // Tests if the length of the stream can be adjusted with | |
| 137 | 147 | // g_seekable_truncate(). | |
| 138 | 148 | func (x *FileIOStream) CanTruncate() bool { | |
| 139 | 149 | ||
| 140 | - | return XGSeekableCanTruncate(x.GoPointer()) | |
| 141 | - | ||
| 150 | + | cret := XGSeekableCanTruncate(x.GoPointer()) | |
| 151 | + | return cret | |
| 142 | 152 | } | |
| 143 | 153 | ||
| 144 | 154 | // Seeks in the stream by the given @offset, modified by @type. | |
| @@ -155,17 +165,22 @@ func (x *FileIOStream) CanTruncate() bool { | |||
| 155 | 165 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 156 | 166 | // triggering the cancellable object from another thread. If the operation | |
| 157 | 167 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 158 | - | func (x *FileIOStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) bool { | |
| 168 | + | func (x *FileIOStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) (bool, error) { | |
| 169 | + | var cerr *glib.Error | |
| 159 | 170 | ||
| 160 | - | return XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer()) | |
| 171 | + | cret := XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 172 | + | if cerr == nil { | |
| 173 | + | return cret, nil | |
| 174 | + | } | |
| 175 | + | return cret, cerr | |
| 161 | 176 | ||
| 162 | 177 | } | |
| 163 | 178 | ||
| 164 | 179 | // Tells the current position within the stream. | |
| 165 | 180 | func (x *FileIOStream) Tell() int64 { | |
| 166 | 181 | ||
| 167 | - | return XGSeekableTell(x.GoPointer()) | |
| 168 | - | ||
| 182 | + | cret := XGSeekableTell(x.GoPointer()) | |
| 183 | + | return cret | |
| 169 | 184 | } | |
| 170 | 185 | ||
| 171 | 186 | // Sets the length of the stream to @offset. If the stream was previously | |
| @@ -177,9 +192,14 @@ func (x *FileIOStream) Tell() int64 { | |||
| 177 | 192 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an | |
| 178 | 193 | // operation was partially finished when the operation was cancelled the | |
| 179 | 194 | // partial result will be returned, without an error. | |
| 180 | - | func (x *FileIOStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) bool { | |
| 195 | + | func (x *FileIOStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) (bool, error) { | |
| 196 | + | var cerr *glib.Error | |
| 181 | 197 | ||
| 182 | - | return XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer()) | |
| 198 | + | cret := XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer(), &cerr) | |
| 199 | + | if cerr == nil { | |
| 200 | + | return cret, nil | |
| 201 | + | } | |
| 202 | + | return cret, cerr | |
| 183 | 203 | ||
| 184 | 204 | } | |
| 185 | 205 | ||
M v4/gio/gfilemonitor.go +4 -4
| @@ -43,8 +43,8 @@ var xFileMonitorCancel func(uintptr) bool | |||
| 43 | 43 | // Cancels a file monitor. | |
| 44 | 44 | func (x *FileMonitor) Cancel() bool { | |
| 45 | 45 | ||
| 46 | - | return xFileMonitorCancel(x.GoPointer()) | |
| 47 | - | ||
| 46 | + | cret := xFileMonitorCancel(x.GoPointer()) | |
| 47 | + | return cret | |
| 48 | 48 | } | |
| 49 | 49 | ||
| 50 | 50 | var xFileMonitorEmitEvent func(uintptr, uintptr, uintptr, FileMonitorEvent) | |
| @@ -67,8 +67,8 @@ var xFileMonitorIsCancelled func(uintptr) bool | |||
| 67 | 67 | // Returns whether the monitor is canceled. | |
| 68 | 68 | func (x *FileMonitor) IsCancelled() bool { | |
| 69 | 69 | ||
| 70 | - | return xFileMonitorIsCancelled(x.GoPointer()) | |
| 71 | - | ||
| 70 | + | cret := xFileMonitorIsCancelled(x.GoPointer()) | |
| 71 | + | return cret | |
| 72 | 72 | } | |
| 73 | 73 | ||
| 74 | 74 | var xFileMonitorSetRateLimit func(uintptr, int) | |
M v4/gio/gfilenamecompleter.go +13 -11
| @@ -28,14 +28,16 @@ var xNewFilenameCompleter func() uintptr | |||
| 28 | 28 | ||
| 29 | 29 | // Creates a new filename completer. | |
| 30 | 30 | func NewFilenameCompleter() *FilenameCompleter { | |
| 31 | - | NewFilenameCompleterPtr := xNewFilenameCompleter() | |
| 32 | - | if NewFilenameCompleterPtr == 0 { | |
| 33 | - | return nil | |
| 34 | - | } | |
| 31 | + | var cls *FilenameCompleter | |
| 32 | + | ||
| 33 | + | cret := xNewFilenameCompleter() | |
| 35 | 34 | ||
| 36 | - | NewFilenameCompleterCls := &FilenameCompleter{} | |
| 37 | - | NewFilenameCompleterCls.Ptr = NewFilenameCompleterPtr | |
| 38 | - | return NewFilenameCompleterCls | |
| 35 | + | if cret == 0 { | |
| 36 | + | return cls | |
| 37 | + | } | |
| 38 | + | cls = &FilenameCompleter{} | |
| 39 | + | cls.Ptr = cret | |
| 40 | + | return cls | |
| 39 | 41 | } | |
| 40 | 42 | ||
| 41 | 43 | var xFilenameCompleterGetCompletionSuffix func(uintptr, string) string | |
| @@ -43,8 +45,8 @@ var xFilenameCompleterGetCompletionSuffix func(uintptr, string) string | |||
| 43 | 45 | // Obtains a completion for @initial_text from @completer. | |
| 44 | 46 | func (x *FilenameCompleter) GetCompletionSuffix(InitialTextVar string) string { | |
| 45 | 47 | ||
| 46 | - | return xFilenameCompleterGetCompletionSuffix(x.GoPointer(), InitialTextVar) | |
| 47 | - | ||
| 48 | + | cret := xFilenameCompleterGetCompletionSuffix(x.GoPointer(), InitialTextVar) | |
| 49 | + | return cret | |
| 48 | 50 | } | |
| 49 | 51 | ||
| 50 | 52 | var xFilenameCompleterGetCompletions func(uintptr, string) []string | |
| @@ -52,8 +54,8 @@ var xFilenameCompleterGetCompletions func(uintptr, string) []string | |||
| 52 | 54 | // Gets an array of completion strings for a given initial text. | |
| 53 | 55 | func (x *FilenameCompleter) GetCompletions(InitialTextVar string) []string { | |
| 54 | 56 | ||
| 55 | - | return xFilenameCompleterGetCompletions(x.GoPointer(), InitialTextVar) | |
| 56 | - | ||
| 57 | + | cret := xFilenameCompleterGetCompletions(x.GoPointer(), InitialTextVar) | |
| 58 | + | return cret | |
| 57 | 59 | } | |
| 58 | 60 | ||
| 59 | 61 | var xFilenameCompleterSetDirsOnly func(uintptr, bool) | |
M v4/gio/gfileoutputstream.go +50 -30
| @@ -45,11 +45,11 @@ var xFileOutputStreamGetEtag func(uintptr) string | |||
| 45 | 45 | // and closed, as the etag can change while writing. | |
| 46 | 46 | func (x *FileOutputStream) GetEtag() string { | |
| 47 | 47 | ||
| 48 | - | return xFileOutputStreamGetEtag(x.GoPointer()) | |
| 49 | - | ||
| 48 | + | cret := xFileOutputStreamGetEtag(x.GoPointer()) | |
| 49 | + | return cret | |
| 50 | 50 | } | |
| 51 | 51 | ||
| 52 | - | var xFileOutputStreamQueryInfo func(uintptr, string, uintptr) uintptr | |
| 52 | + | var xFileOutputStreamQueryInfo func(uintptr, string, uintptr, **glib.Error) uintptr | |
| 53 | 53 | ||
| 54 | 54 | // Queries a file output stream for the given @attributes. | |
| 55 | 55 | // This function blocks while querying the stream. For the asynchronous | |
| @@ -68,16 +68,21 @@ var xFileOutputStreamQueryInfo func(uintptr, string, uintptr) uintptr | |||
| 68 | 68 | // triggering the cancellable object from another thread. If the operation | |
| 69 | 69 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will | |
| 70 | 70 | // be returned. | |
| 71 | - | func (x *FileOutputStream) QueryInfo(AttributesVar string, CancellableVar *Cancellable) *FileInfo { | |
| 71 | + | func (x *FileOutputStream) QueryInfo(AttributesVar string, CancellableVar *Cancellable) (*FileInfo, error) { | |
| 72 | + | var cls *FileInfo | |
| 73 | + | var cerr *glib.Error | |
| 72 | 74 | ||
| 73 | - | QueryInfoPtr := xFileOutputStreamQueryInfo(x.GoPointer(), AttributesVar, CancellableVar.GoPointer()) | |
| 74 | - | if QueryInfoPtr == 0 { | |
| 75 | - | return nil | |
| 76 | - | } | |
| 75 | + | cret := xFileOutputStreamQueryInfo(x.GoPointer(), AttributesVar, CancellableVar.GoPointer(), &cerr) | |
| 77 | 76 | ||
| 78 | - | QueryInfoCls := &FileInfo{} | |
| 79 | - | QueryInfoCls.Ptr = QueryInfoPtr | |
| 80 | - | return QueryInfoCls | |
| 77 | + | if cret == 0 { | |
| 78 | + | return cls, cerr | |
| 79 | + | } | |
| 80 | + | cls = &FileInfo{} | |
| 81 | + | cls.Ptr = cret | |
| 82 | + | if cerr == nil { | |
| 83 | + | return cls, nil | |
| 84 | + | } | |
| 85 | + | return cls, cerr | |
| 81 | 86 | ||
| 82 | 87 | } | |
| 83 | 88 | ||
| @@ -95,20 +100,25 @@ func (x *FileOutputStream) QueryInfoAsync(AttributesVar string, IoPriorityVar in | |||
| 95 | 100 | ||
| 96 | 101 | } | |
| 97 | 102 | ||
| 98 | - | var xFileOutputStreamQueryInfoFinish func(uintptr, uintptr) uintptr | |
| 103 | + | var xFileOutputStreamQueryInfoFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 99 | 104 | ||
| 100 | 105 | // Finalizes the asynchronous query started | |
| 101 | 106 | // by g_file_output_stream_query_info_async(). | |
| 102 | - | func (x *FileOutputStream) QueryInfoFinish(ResultVar AsyncResult) *FileInfo { | |
| 107 | + | func (x *FileOutputStream) QueryInfoFinish(ResultVar AsyncResult) (*FileInfo, error) { | |
| 108 | + | var cls *FileInfo | |
| 109 | + | var cerr *glib.Error | |
| 103 | 110 | ||
| 104 | - | QueryInfoFinishPtr := xFileOutputStreamQueryInfoFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 105 | - | if QueryInfoFinishPtr == 0 { | |
| 106 | - | return nil | |
| 107 | - | } | |
| 111 | + | cret := xFileOutputStreamQueryInfoFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 108 | 112 | ||
| 109 | - | QueryInfoFinishCls := &FileInfo{} | |
| 110 | - | QueryInfoFinishCls.Ptr = QueryInfoFinishPtr | |
| 111 | - | return QueryInfoFinishCls | |
| 113 | + | if cret == 0 { | |
| 114 | + | return cls, cerr | |
| 115 | + | } | |
| 116 | + | cls = &FileInfo{} | |
| 117 | + | cls.Ptr = cret | |
| 118 | + | if cerr == nil { | |
| 119 | + | return cls, nil | |
| 120 | + | } | |
| 121 | + | return cls, cerr | |
| 112 | 122 | ||
| 113 | 123 | } | |
| 114 | 124 | ||
| @@ -123,16 +133,16 @@ func (c *FileOutputStream) SetGoPointer(ptr uintptr) { | |||
| 123 | 133 | // Tests if the stream supports the #GSeekableIface. | |
| 124 | 134 | func (x *FileOutputStream) CanSeek() bool { | |
| 125 | 135 | ||
| 126 | - | return XGSeekableCanSeek(x.GoPointer()) | |
| 127 | - | ||
| 136 | + | cret := XGSeekableCanSeek(x.GoPointer()) | |
| 137 | + | return cret | |
| 128 | 138 | } | |
| 129 | 139 | ||
| 130 | 140 | // Tests if the length of the stream can be adjusted with | |
| 131 | 141 | // g_seekable_truncate(). | |
| 132 | 142 | func (x *FileOutputStream) CanTruncate() bool { | |
| 133 | 143 | ||
| 134 | - | return XGSeekableCanTruncate(x.GoPointer()) | |
| 135 | - | ||
| 144 | + | cret := XGSeekableCanTruncate(x.GoPointer()) | |
| 145 | + | return cret | |
| 136 | 146 | } | |
| 137 | 147 | ||
| 138 | 148 | // Seeks in the stream by the given @offset, modified by @type. | |
| @@ -149,17 +159,22 @@ func (x *FileOutputStream) CanTruncate() bool { | |||
| 149 | 159 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 150 | 160 | // triggering the cancellable object from another thread. If the operation | |
| 151 | 161 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 152 | - | func (x *FileOutputStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) bool { | |
| 162 | + | func (x *FileOutputStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) (bool, error) { | |
| 163 | + | var cerr *glib.Error | |
| 153 | 164 | ||
| 154 | - | return XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer()) | |
| 165 | + | cret := XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 166 | + | if cerr == nil { | |
| 167 | + | return cret, nil | |
| 168 | + | } | |
| 169 | + | return cret, cerr | |
| 155 | 170 | ||
| 156 | 171 | } | |
| 157 | 172 | ||
| 158 | 173 | // Tells the current position within the stream. | |
| 159 | 174 | func (x *FileOutputStream) Tell() int64 { | |
| 160 | 175 | ||
| 161 | - | return XGSeekableTell(x.GoPointer()) | |
| 162 | - | ||
| 176 | + | cret := XGSeekableTell(x.GoPointer()) | |
| 177 | + | return cret | |
| 163 | 178 | } | |
| 164 | 179 | ||
| 165 | 180 | // Sets the length of the stream to @offset. If the stream was previously | |
| @@ -171,9 +186,14 @@ func (x *FileOutputStream) Tell() int64 { | |||
| 171 | 186 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an | |
| 172 | 187 | // operation was partially finished when the operation was cancelled the | |
| 173 | 188 | // partial result will be returned, without an error. | |
| 174 | - | func (x *FileOutputStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) bool { | |
| 189 | + | func (x *FileOutputStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) (bool, error) { | |
| 190 | + | var cerr *glib.Error | |
| 175 | 191 | ||
| 176 | - | return XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer()) | |
| 192 | + | cret := XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer(), &cerr) | |
| 193 | + | if cerr == nil { | |
| 194 | + | return cret, nil | |
| 195 | + | } | |
| 196 | + | return cret, cerr | |
| 177 | 197 | ||
| 178 | 198 | } | |
| 179 | 199 | ||
M v4/gio/gfilterinputstream.go +11 -12
| @@ -29,18 +29,17 @@ var xFilterInputStreamGetBaseStream func(uintptr) uintptr | |||
| 29 | 29 | ||
| 30 | 30 | // Gets the base stream for the filter stream. | |
| 31 | 31 | func (x *FilterInputStream) GetBaseStream() *InputStream { | |
| 32 | + | var cls *InputStream | |
| 32 | 33 | ||
| 33 | - | GetBaseStreamPtr := xFilterInputStreamGetBaseStream(x.GoPointer()) | |
| 34 | - | if GetBaseStreamPtr == 0 { | |
| 35 | - | return nil | |
| 36 | - | } | |
| 37 | - | ||
| 38 | - | gobject.IncreaseRef(GetBaseStreamPtr) | |
| 39 | - | ||
| 40 | - | GetBaseStreamCls := &InputStream{} | |
| 41 | - | GetBaseStreamCls.Ptr = GetBaseStreamPtr | |
| 42 | - | return GetBaseStreamCls | |
| 34 | + | cret := xFilterInputStreamGetBaseStream(x.GoPointer()) | |
| 43 | 35 | ||
| 36 | + | if cret == 0 { | |
| 37 | + | return cls | |
| 38 | + | } | |
| 39 | + | gobject.IncreaseRef(cret) | |
| 40 | + | cls = &InputStream{} | |
| 41 | + | cls.Ptr = cret | |
| 42 | + | return cls | |
| 44 | 43 | } | |
| 45 | 44 | ||
| 46 | 45 | var xFilterInputStreamGetCloseBaseStream func(uintptr) bool | |
| @@ -49,8 +48,8 @@ var xFilterInputStreamGetCloseBaseStream func(uintptr) bool | |||
| 49 | 48 | // closed. | |
| 50 | 49 | func (x *FilterInputStream) GetCloseBaseStream() bool { | |
| 51 | 50 | ||
| 52 | - | return xFilterInputStreamGetCloseBaseStream(x.GoPointer()) | |
| 53 | - | ||
| 51 | + | cret := xFilterInputStreamGetCloseBaseStream(x.GoPointer()) | |
| 52 | + | return cret | |
| 54 | 53 | } | |
| 55 | 54 | ||
| 56 | 55 | var xFilterInputStreamSetCloseBaseStream func(uintptr, bool) | |
M v4/gio/gfilteroutputstream.go +11 -12
| @@ -29,18 +29,17 @@ var xFilterOutputStreamGetBaseStream func(uintptr) uintptr | |||
| 29 | 29 | ||
| 30 | 30 | // Gets the base stream for the filter stream. | |
| 31 | 31 | func (x *FilterOutputStream) GetBaseStream() *OutputStream { | |
| 32 | + | var cls *OutputStream | |
| 32 | 33 | ||
| 33 | - | GetBaseStreamPtr := xFilterOutputStreamGetBaseStream(x.GoPointer()) | |
| 34 | - | if GetBaseStreamPtr == 0 { | |
| 35 | - | return nil | |
| 36 | - | } | |
| 37 | - | ||
| 38 | - | gobject.IncreaseRef(GetBaseStreamPtr) | |
| 39 | - | ||
| 40 | - | GetBaseStreamCls := &OutputStream{} | |
| 41 | - | GetBaseStreamCls.Ptr = GetBaseStreamPtr | |
| 42 | - | return GetBaseStreamCls | |
| 34 | + | cret := xFilterOutputStreamGetBaseStream(x.GoPointer()) | |
| 43 | 35 | ||
| 36 | + | if cret == 0 { | |
| 37 | + | return cls | |
| 38 | + | } | |
| 39 | + | gobject.IncreaseRef(cret) | |
| 40 | + | cls = &OutputStream{} | |
| 41 | + | cls.Ptr = cret | |
| 42 | + | return cls | |
| 44 | 43 | } | |
| 45 | 44 | ||
| 46 | 45 | var xFilterOutputStreamGetCloseBaseStream func(uintptr) bool | |
| @@ -49,8 +48,8 @@ var xFilterOutputStreamGetCloseBaseStream func(uintptr) bool | |||
| 49 | 48 | // closed. | |
| 50 | 49 | func (x *FilterOutputStream) GetCloseBaseStream() bool { | |
| 51 | 50 | ||
| 52 | - | return xFilterOutputStreamGetCloseBaseStream(x.GoPointer()) | |
| 53 | - | ||
| 51 | + | cret := xFilterOutputStreamGetCloseBaseStream(x.GoPointer()) | |
| 52 | + | return cret | |
| 54 | 53 | } | |
| 55 | 54 | ||
| 56 | 55 | var xFilterOutputStreamSetCloseBaseStream func(uintptr, bool) | |
M v4/gio/gicon.go +30 -25
| @@ -64,8 +64,8 @@ func (x *IconBase) SetGoPointer(ptr uintptr) { | |||
| 64 | 64 | // Checks if two icons are equal. | |
| 65 | 65 | func (x *IconBase) Equal(Icon2Var Icon) bool { | |
| 66 | 66 | ||
| 67 | - | return XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 68 | - | ||
| 67 | + | cret := XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 68 | + | return cret | |
| 69 | 69 | } | |
| 70 | 70 | ||
| 71 | 71 | // Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved | |
| @@ -75,8 +75,8 @@ func (x *IconBase) Equal(Icon2Var Icon) bool { | |||
| 75 | 75 | // (as opposed to over the network), and within the same file system namespace. | |
| 76 | 76 | func (x *IconBase) Serialize() *glib.Variant { | |
| 77 | 77 | ||
| 78 | - | return XGIconSerialize(x.GoPointer()) | |
| 79 | - | ||
| 78 | + | cret := XGIconSerialize(x.GoPointer()) | |
| 79 | + | return cret | |
| 80 | 80 | } | |
| 81 | 81 | ||
| 82 | 82 | // Generates a textual representation of @icon that can be used for | |
| @@ -97,8 +97,8 @@ func (x *IconBase) Serialize() *glib.Variant { | |||
| 97 | 97 | // the encoding is simply the name (such as `network-server`). | |
| 98 | 98 | func (x *IconBase) ToString() string { | |
| 99 | 99 | ||
| 100 | - | return XGIconToString(x.GoPointer()) | |
| 101 | - | ||
| 100 | + | cret := XGIconToString(x.GoPointer()) | |
| 101 | + | return cret | |
| 102 | 102 | } | |
| 103 | 103 | ||
| 104 | 104 | var XGIconEqual func(uintptr, uintptr) bool | |
| @@ -109,16 +109,16 @@ var xIconDeserialize func(*glib.Variant) uintptr | |||
| 109 | 109 | ||
| 110 | 110 | // Deserializes a #GIcon previously serialized using g_icon_serialize(). | |
| 111 | 111 | func IconDeserialize(ValueVar *glib.Variant) *IconBase { | |
| 112 | + | var cls *IconBase | |
| 112 | 113 | ||
| 113 | - | IconDeserializePtr := xIconDeserialize(ValueVar) | |
| 114 | - | if IconDeserializePtr == 0 { | |
| 115 | - | return nil | |
| 116 | - | } | |
| 117 | - | ||
| 118 | - | IconDeserializeCls := &IconBase{} | |
| 119 | - | IconDeserializeCls.Ptr = IconDeserializePtr | |
| 120 | - | return IconDeserializeCls | |
| 114 | + | cret := xIconDeserialize(ValueVar) | |
| 121 | 115 | ||
| 116 | + | if cret == 0 { | |
| 117 | + | return cls | |
| 118 | + | } | |
| 119 | + | cls = &IconBase{} | |
| 120 | + | cls.Ptr = cret | |
| 121 | + | return cls | |
| 122 | 122 | } | |
| 123 | 123 | ||
| 124 | 124 | var xIconHash func(uintptr) uint | |
| @@ -126,11 +126,11 @@ var xIconHash func(uintptr) uint | |||
| 126 | 126 | // Gets a hash for an icon. | |
| 127 | 127 | func IconHash(IconVar uintptr) uint { | |
| 128 | 128 | ||
| 129 | - | return xIconHash(IconVar) | |
| 130 | - | ||
| 129 | + | cret := xIconHash(IconVar) | |
| 130 | + | return cret | |
| 131 | 131 | } | |
| 132 | 132 | ||
| 133 | - | var xIconNewForString func(string) uintptr | |
| 133 | + | var xIconNewForString func(string, **glib.Error) uintptr | |
| 134 | 134 | ||
| 135 | 135 | // Generate a #GIcon instance from @str. This function can fail if | |
| 136 | 136 | // @str is not valid - see g_icon_to_string() for discussion. | |
| @@ -138,16 +138,21 @@ var xIconNewForString func(string) uintptr | |||
| 138 | 138 | // If your application or library provides one or more #GIcon | |
| 139 | 139 | // implementations you need to ensure that each #GType is registered | |
| 140 | 140 | // with the type system prior to calling g_icon_new_for_string(). | |
| 141 | - | func IconNewForString(StrVar string) *IconBase { | |
| 141 | + | func IconNewForString(StrVar string) (*IconBase, error) { | |
| 142 | + | var cls *IconBase | |
| 143 | + | var cerr *glib.Error | |
| 142 | 144 | ||
| 143 | - | IconNewForStringPtr := xIconNewForString(StrVar) | |
| 144 | - | if IconNewForStringPtr == 0 { | |
| 145 | - | return nil | |
| 146 | - | } | |
| 145 | + | cret := xIconNewForString(StrVar, &cerr) | |
| 147 | 146 | ||
| 148 | - | IconNewForStringCls := &IconBase{} | |
| 149 | - | IconNewForStringCls.Ptr = IconNewForStringPtr | |
| 150 | - | return IconNewForStringCls | |
| 147 | + | if cret == 0 { | |
| 148 | + | return cls, cerr | |
| 149 | + | } | |
| 150 | + | cls = &IconBase{} | |
| 151 | + | cls.Ptr = cret | |
| 152 | + | if cerr == nil { | |
| 153 | + | return cls, nil | |
| 154 | + | } | |
| 155 | + | return cls, cerr | |
| 151 | 156 | ||
| 152 | 157 | } | |
| 153 | 158 | ||
M v4/gio/ginetaddress.go +66 -58
| @@ -39,14 +39,16 @@ var xNewAnyInetAddress func(SocketFamily) uintptr | |||
| 39 | 39 | // Creates a #GInetAddress for the "any" address (unassigned/"don't | |
| 40 | 40 | // care") for @family. | |
| 41 | 41 | func NewAnyInetAddress(FamilyVar SocketFamily) *InetAddress { | |
| 42 | - | NewAnyInetAddressPtr := xNewAnyInetAddress(FamilyVar) | |
| 43 | - | if NewAnyInetAddressPtr == 0 { | |
| 44 | - | return nil | |
| 45 | - | } | |
| 42 | + | var cls *InetAddress | |
| 43 | + | ||
| 44 | + | cret := xNewAnyInetAddress(FamilyVar) | |
| 46 | 45 | ||
| 47 | - | NewAnyInetAddressCls := &InetAddress{} | |
| 48 | - | NewAnyInetAddressCls.Ptr = NewAnyInetAddressPtr | |
| 49 | - | return NewAnyInetAddressCls | |
| 46 | + | if cret == 0 { | |
| 47 | + | return cls | |
| 48 | + | } | |
| 49 | + | cls = &InetAddress{} | |
| 50 | + | cls.Ptr = cret | |
| 51 | + | return cls | |
| 50 | 52 | } | |
| 51 | 53 | ||
| 52 | 54 | var xNewFromBytesInetAddress func(uintptr, SocketFamily) uintptr | |
| @@ -55,42 +57,48 @@ var xNewFromBytesInetAddress func(uintptr, SocketFamily) uintptr | |||
| 55 | 57 | // @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for | |
| 56 | 58 | // %G_SOCKET_FAMILY_IPV6. | |
| 57 | 59 | func NewFromBytesInetAddress(BytesVar uintptr, FamilyVar SocketFamily) *InetAddress { | |
| 58 | - | NewFromBytesInetAddressPtr := xNewFromBytesInetAddress(BytesVar, FamilyVar) | |
| 59 | - | if NewFromBytesInetAddressPtr == 0 { | |
| 60 | - | return nil | |
| 61 | - | } | |
| 60 | + | var cls *InetAddress | |
| 61 | + | ||
| 62 | + | cret := xNewFromBytesInetAddress(BytesVar, FamilyVar) | |
| 62 | 63 | ||
| 63 | - | NewFromBytesInetAddressCls := &InetAddress{} | |
| 64 | - | NewFromBytesInetAddressCls.Ptr = NewFromBytesInetAddressPtr | |
| 65 | - | return NewFromBytesInetAddressCls | |
| 64 | + | if cret == 0 { | |
| 65 | + | return cls | |
| 66 | + | } | |
| 67 | + | cls = &InetAddress{} | |
| 68 | + | cls.Ptr = cret | |
| 69 | + | return cls | |
| 66 | 70 | } | |
| 67 | 71 | ||
| 68 | 72 | var xNewFromStringInetAddress func(string) uintptr | |
| 69 | 73 | ||
| 70 | 74 | // Parses @string as an IP address and creates a new #GInetAddress. | |
| 71 | 75 | func NewFromStringInetAddress(StringVar string) *InetAddress { | |
| 72 | - | NewFromStringInetAddressPtr := xNewFromStringInetAddress(StringVar) | |
| 73 | - | if NewFromStringInetAddressPtr == 0 { | |
| 74 | - | return nil | |
| 75 | - | } | |
| 76 | + | var cls *InetAddress | |
| 77 | + | ||
| 78 | + | cret := xNewFromStringInetAddress(StringVar) | |
| 76 | 79 | ||
| 77 | - | NewFromStringInetAddressCls := &InetAddress{} | |
| 78 | - | NewFromStringInetAddressCls.Ptr = NewFromStringInetAddressPtr | |
| 79 | - | return NewFromStringInetAddressCls | |
| 80 | + | if cret == 0 { | |
| 81 | + | return cls | |
| 82 | + | } | |
| 83 | + | cls = &InetAddress{} | |
| 84 | + | cls.Ptr = cret | |
| 85 | + | return cls | |
| 80 | 86 | } | |
| 81 | 87 | ||
| 82 | 88 | var xNewLoopbackInetAddress func(SocketFamily) uintptr | |
| 83 | 89 | ||
| 84 | 90 | // Creates a #GInetAddress for the loopback address for @family. | |
| 85 | 91 | func NewLoopbackInetAddress(FamilyVar SocketFamily) *InetAddress { | |
| 86 | - | NewLoopbackInetAddressPtr := xNewLoopbackInetAddress(FamilyVar) | |
| 87 | - | if NewLoopbackInetAddressPtr == 0 { | |
| 88 | - | return nil | |
| 89 | - | } | |
| 92 | + | var cls *InetAddress | |
| 93 | + | ||
| 94 | + | cret := xNewLoopbackInetAddress(FamilyVar) | |
| 90 | 95 | ||
| 91 | - | NewLoopbackInetAddressCls := &InetAddress{} | |
| 92 | - | NewLoopbackInetAddressCls.Ptr = NewLoopbackInetAddressPtr | |
| 93 | - | return NewLoopbackInetAddressCls | |
| 96 | + | if cret == 0 { | |
| 97 | + | return cls | |
| 98 | + | } | |
| 99 | + | cls = &InetAddress{} | |
| 100 | + | cls.Ptr = cret | |
| 101 | + | return cls | |
| 94 | 102 | } | |
| 95 | 103 | ||
| 96 | 104 | var xInetAddressEqual func(uintptr, uintptr) bool | |
| @@ -98,8 +106,8 @@ var xInetAddressEqual func(uintptr, uintptr) bool | |||
| 98 | 106 | // Checks if two #GInetAddress instances are equal, e.g. the same address. | |
| 99 | 107 | func (x *InetAddress) Equal(OtherAddressVar *InetAddress) bool { | |
| 100 | 108 | ||
| 101 | - | return xInetAddressEqual(x.GoPointer(), OtherAddressVar.GoPointer()) | |
| 102 | - | ||
| 109 | + | cret := xInetAddressEqual(x.GoPointer(), OtherAddressVar.GoPointer()) | |
| 110 | + | return cret | |
| 103 | 111 | } | |
| 104 | 112 | ||
| 105 | 113 | var xInetAddressGetFamily func(uintptr) SocketFamily | |
| @@ -107,8 +115,8 @@ var xInetAddressGetFamily func(uintptr) SocketFamily | |||
| 107 | 115 | // Gets @address's family | |
| 108 | 116 | func (x *InetAddress) GetFamily() SocketFamily { | |
| 109 | 117 | ||
| 110 | - | return xInetAddressGetFamily(x.GoPointer()) | |
| 111 | - | ||
| 118 | + | cret := xInetAddressGetFamily(x.GoPointer()) | |
| 119 | + | return cret | |
| 112 | 120 | } | |
| 113 | 121 | ||
| 114 | 122 | var xInetAddressGetIsAny func(uintptr) bool | |
| @@ -116,8 +124,8 @@ var xInetAddressGetIsAny func(uintptr) bool | |||
| 116 | 124 | // Tests whether @address is the "any" address for its family. | |
| 117 | 125 | func (x *InetAddress) GetIsAny() bool { | |
| 118 | 126 | ||
| 119 | - | return xInetAddressGetIsAny(x.GoPointer()) | |
| 120 | - | ||
| 127 | + | cret := xInetAddressGetIsAny(x.GoPointer()) | |
| 128 | + | return cret | |
| 121 | 129 | } | |
| 122 | 130 | ||
| 123 | 131 | var xInetAddressGetIsLinkLocal func(uintptr) bool | |
| @@ -127,8 +135,8 @@ var xInetAddressGetIsLinkLocal func(uintptr) bool | |||
| 127 | 135 | // Internet). | |
| 128 | 136 | func (x *InetAddress) GetIsLinkLocal() bool { | |
| 129 | 137 | ||
| 130 | - | return xInetAddressGetIsLinkLocal(x.GoPointer()) | |
| 131 | - | ||
| 138 | + | cret := xInetAddressGetIsLinkLocal(x.GoPointer()) | |
| 139 | + | return cret | |
| 132 | 140 | } | |
| 133 | 141 | ||
| 134 | 142 | var xInetAddressGetIsLoopback func(uintptr) bool | |
| @@ -136,8 +144,8 @@ var xInetAddressGetIsLoopback func(uintptr) bool | |||
| 136 | 144 | // Tests whether @address is the loopback address for its family. | |
| 137 | 145 | func (x *InetAddress) GetIsLoopback() bool { | |
| 138 | 146 | ||
| 139 | - | return xInetAddressGetIsLoopback(x.GoPointer()) | |
| 140 | - | ||
| 147 | + | cret := xInetAddressGetIsLoopback(x.GoPointer()) | |
| 148 | + | return cret | |
| 141 | 149 | } | |
| 142 | 150 | ||
| 143 | 151 | var xInetAddressGetIsMcGlobal func(uintptr) bool | |
| @@ -145,8 +153,8 @@ var xInetAddressGetIsMcGlobal func(uintptr) bool | |||
| 145 | 153 | // Tests whether @address is a global multicast address. | |
| 146 | 154 | func (x *InetAddress) GetIsMcGlobal() bool { | |
| 147 | 155 | ||
| 148 | - | return xInetAddressGetIsMcGlobal(x.GoPointer()) | |
| 149 | - | ||
| 156 | + | cret := xInetAddressGetIsMcGlobal(x.GoPointer()) | |
| 157 | + | return cret | |
| 150 | 158 | } | |
| 151 | 159 | ||
| 152 | 160 | var xInetAddressGetIsMcLinkLocal func(uintptr) bool | |
| @@ -154,8 +162,8 @@ var xInetAddressGetIsMcLinkLocal func(uintptr) bool | |||
| 154 | 162 | // Tests whether @address is a link-local multicast address. | |
| 155 | 163 | func (x *InetAddress) GetIsMcLinkLocal() bool { | |
| 156 | 164 | ||
| 157 | - | return xInetAddressGetIsMcLinkLocal(x.GoPointer()) | |
| 158 | - | ||
| 165 | + | cret := xInetAddressGetIsMcLinkLocal(x.GoPointer()) | |
| 166 | + | return cret | |
| 159 | 167 | } | |
| 160 | 168 | ||
| 161 | 169 | var xInetAddressGetIsMcNodeLocal func(uintptr) bool | |
| @@ -163,8 +171,8 @@ var xInetAddressGetIsMcNodeLocal func(uintptr) bool | |||
| 163 | 171 | // Tests whether @address is a node-local multicast address. | |
| 164 | 172 | func (x *InetAddress) GetIsMcNodeLocal() bool { | |
| 165 | 173 | ||
| 166 | - | return xInetAddressGetIsMcNodeLocal(x.GoPointer()) | |
| 167 | - | ||
| 174 | + | cret := xInetAddressGetIsMcNodeLocal(x.GoPointer()) | |
| 175 | + | return cret | |
| 168 | 176 | } | |
| 169 | 177 | ||
| 170 | 178 | var xInetAddressGetIsMcOrgLocal func(uintptr) bool | |
| @@ -172,8 +180,8 @@ var xInetAddressGetIsMcOrgLocal func(uintptr) bool | |||
| 172 | 180 | // Tests whether @address is an organization-local multicast address. | |
| 173 | 181 | func (x *InetAddress) GetIsMcOrgLocal() bool { | |
| 174 | 182 | ||
| 175 | - | return xInetAddressGetIsMcOrgLocal(x.GoPointer()) | |
| 176 | - | ||
| 183 | + | cret := xInetAddressGetIsMcOrgLocal(x.GoPointer()) | |
| 184 | + | return cret | |
| 177 | 185 | } | |
| 178 | 186 | ||
| 179 | 187 | var xInetAddressGetIsMcSiteLocal func(uintptr) bool | |
| @@ -181,8 +189,8 @@ var xInetAddressGetIsMcSiteLocal func(uintptr) bool | |||
| 181 | 189 | // Tests whether @address is a site-local multicast address. | |
| 182 | 190 | func (x *InetAddress) GetIsMcSiteLocal() bool { | |
| 183 | 191 | ||
| 184 | - | return xInetAddressGetIsMcSiteLocal(x.GoPointer()) | |
| 185 | - | ||
| 192 | + | cret := xInetAddressGetIsMcSiteLocal(x.GoPointer()) | |
| 193 | + | return cret | |
| 186 | 194 | } | |
| 187 | 195 | ||
| 188 | 196 | var xInetAddressGetIsMulticast func(uintptr) bool | |
| @@ -190,8 +198,8 @@ var xInetAddressGetIsMulticast func(uintptr) bool | |||
| 190 | 198 | // Tests whether @address is a multicast address. | |
| 191 | 199 | func (x *InetAddress) GetIsMulticast() bool { | |
| 192 | 200 | ||
| 193 | - | return xInetAddressGetIsMulticast(x.GoPointer()) | |
| 194 | - | ||
| 201 | + | cret := xInetAddressGetIsMulticast(x.GoPointer()) | |
| 202 | + | return cret | |
| 195 | 203 | } | |
| 196 | 204 | ||
| 197 | 205 | var xInetAddressGetIsSiteLocal func(uintptr) bool | |
| @@ -202,8 +210,8 @@ var xInetAddressGetIsSiteLocal func(uintptr) bool | |||
| 202 | 210 | // outgoing Internet connectivity via a NAT or firewall). | |
| 203 | 211 | func (x *InetAddress) GetIsSiteLocal() bool { | |
| 204 | 212 | ||
| 205 | - | return xInetAddressGetIsSiteLocal(x.GoPointer()) | |
| 206 | - | ||
| 213 | + | cret := xInetAddressGetIsSiteLocal(x.GoPointer()) | |
| 214 | + | return cret | |
| 207 | 215 | } | |
| 208 | 216 | ||
| 209 | 217 | var xInetAddressGetNativeSize func(uintptr) uint | |
| @@ -212,8 +220,8 @@ var xInetAddressGetNativeSize func(uintptr) uint | |||
| 212 | 220 | // is the size of the data that you get from g_inet_address_to_bytes(). | |
| 213 | 221 | func (x *InetAddress) GetNativeSize() uint { | |
| 214 | 222 | ||
| 215 | - | return xInetAddressGetNativeSize(x.GoPointer()) | |
| 216 | - | ||
| 223 | + | cret := xInetAddressGetNativeSize(x.GoPointer()) | |
| 224 | + | return cret | |
| 217 | 225 | } | |
| 218 | 226 | ||
| 219 | 227 | var xInetAddressToBytes func(uintptr) byte | |
| @@ -221,8 +229,8 @@ var xInetAddressToBytes func(uintptr) byte | |||
| 221 | 229 | // Gets the raw binary address data from @address. | |
| 222 | 230 | func (x *InetAddress) ToBytes() byte { | |
| 223 | 231 | ||
| 224 | - | return xInetAddressToBytes(x.GoPointer()) | |
| 225 | - | ||
| 232 | + | cret := xInetAddressToBytes(x.GoPointer()) | |
| 233 | + | return cret | |
| 226 | 234 | } | |
| 227 | 235 | ||
| 228 | 236 | var xInetAddressToString func(uintptr) string | |
| @@ -230,8 +238,8 @@ var xInetAddressToString func(uintptr) string | |||
| 230 | 238 | // Converts @address to string form. | |
| 231 | 239 | func (x *InetAddress) ToString() string { | |
| 232 | 240 | ||
| 233 | - | return xInetAddressToString(x.GoPointer()) | |
| 234 | - | ||
| 241 | + | cret := xInetAddressToString(x.GoPointer()) | |
| 242 | + | return cret | |
| 235 | 243 | } | |
| 236 | 244 | ||
| 237 | 245 | func (c *InetAddress) GoPointer() uintptr { | |
M v4/gio/ginetaddressmask.go +57 -38
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -28,36 +29,50 @@ func InetAddressMaskNewFromInternalPtr(ptr uintptr) *InetAddressMask { | |||
| 28 | 29 | return cls | |
| 29 | 30 | } | |
| 30 | 31 | ||
| 31 | - | var xNewInetAddressMask func(uintptr, uint) uintptr | |
| 32 | + | var xNewInetAddressMask func(uintptr, uint, **glib.Error) uintptr | |
| 32 | 33 | ||
| 33 | 34 | // Creates a new #GInetAddressMask representing all addresses whose | |
| 34 | 35 | // first @length bits match @addr. | |
| 35 | - | func NewInetAddressMask(AddrVar *InetAddress, LengthVar uint) *InetAddressMask { | |
| 36 | - | NewInetAddressMaskPtr := xNewInetAddressMask(AddrVar.GoPointer(), LengthVar) | |
| 37 | - | if NewInetAddressMaskPtr == 0 { | |
| 38 | - | return nil | |
| 36 | + | func NewInetAddressMask(AddrVar *InetAddress, LengthVar uint) (*InetAddressMask, error) { | |
| 37 | + | var cls *InetAddressMask | |
| 38 | + | var cerr *glib.Error | |
| 39 | + | ||
| 40 | + | cret := xNewInetAddressMask(AddrVar.GoPointer(), LengthVar, &cerr) | |
| 41 | + | ||
| 42 | + | if cret == 0 { | |
| 43 | + | return cls, cerr | |
| 44 | + | } | |
| 45 | + | cls = &InetAddressMask{} | |
| 46 | + | cls.Ptr = cret | |
| 47 | + | if cerr == nil { | |
| 48 | + | return cls, nil | |
| 39 | 49 | } | |
| 50 | + | return cls, cerr | |
| 40 | 51 | ||
| 41 | - | NewInetAddressMaskCls := &InetAddressMask{} | |
| 42 | - | NewInetAddressMaskCls.Ptr = NewInetAddressMaskPtr | |
| 43 | - | return NewInetAddressMaskCls | |
| 44 | 52 | } | |
| 45 | 53 | ||
| 46 | - | var xNewFromStringInetAddressMask func(string) uintptr | |
| 54 | + | var xNewFromStringInetAddressMask func(string, **glib.Error) uintptr | |
| 47 | 55 | ||
| 48 | 56 | // Parses @mask_string as an IP address and (optional) length, and | |
| 49 | 57 | // creates a new #GInetAddressMask. The length, if present, is | |
| 50 | 58 | // delimited by a "/". If it is not present, then the length is | |
| 51 | 59 | // assumed to be the full length of the address. | |
| 52 | - | func NewFromStringInetAddressMask(MaskStringVar string) *InetAddressMask { | |
| 53 | - | NewFromStringInetAddressMaskPtr := xNewFromStringInetAddressMask(MaskStringVar) | |
| 54 | - | if NewFromStringInetAddressMaskPtr == 0 { | |
| 55 | - | return nil | |
| 60 | + | func NewFromStringInetAddressMask(MaskStringVar string) (*InetAddressMask, error) { | |
| 61 | + | var cls *InetAddressMask | |
| 62 | + | var cerr *glib.Error | |
| 63 | + | ||
| 64 | + | cret := xNewFromStringInetAddressMask(MaskStringVar, &cerr) | |
| 65 | + | ||
| 66 | + | if cret == 0 { | |
| 67 | + | return cls, cerr | |
| 56 | 68 | } | |
| 69 | + | cls = &InetAddressMask{} | |
| 70 | + | cls.Ptr = cret | |
| 71 | + | if cerr == nil { | |
| 72 | + | return cls, nil | |
| 73 | + | } | |
| 74 | + | return cls, cerr | |
| 57 | 75 | ||
| 58 | - | NewFromStringInetAddressMaskCls := &InetAddressMask{} | |
| 59 | - | NewFromStringInetAddressMaskCls.Ptr = NewFromStringInetAddressMaskPtr | |
| 60 | - | return NewFromStringInetAddressMaskCls | |
| 61 | 76 | } | |
| 62 | 77 | ||
| 63 | 78 | var xInetAddressMaskEqual func(uintptr, uintptr) bool | |
| @@ -65,26 +80,25 @@ var xInetAddressMaskEqual func(uintptr, uintptr) bool | |||
| 65 | 80 | // Tests if @mask and @mask2 are the same mask. | |
| 66 | 81 | func (x *InetAddressMask) Equal(Mask2Var *InetAddressMask) bool { | |
| 67 | 82 | ||
| 68 | - | return xInetAddressMaskEqual(x.GoPointer(), Mask2Var.GoPointer()) | |
| 69 | - | ||
| 83 | + | cret := xInetAddressMaskEqual(x.GoPointer(), Mask2Var.GoPointer()) | |
| 84 | + | return cret | |
| 70 | 85 | } | |
| 71 | 86 | ||
| 72 | 87 | var xInetAddressMaskGetAddress func(uintptr) uintptr | |
| 73 | 88 | ||
| 74 | 89 | // Gets @mask's base address | |
| 75 | 90 | func (x *InetAddressMask) GetAddress() *InetAddress { | |
| 91 | + | var cls *InetAddress | |
| 76 | 92 | ||
| 77 | - | GetAddressPtr := xInetAddressMaskGetAddress(x.GoPointer()) | |
| 78 | - | if GetAddressPtr == 0 { | |
| 79 | - | return nil | |
| 80 | - | } | |
| 81 | - | ||
| 82 | - | gobject.IncreaseRef(GetAddressPtr) | |
| 83 | - | ||
| 84 | - | GetAddressCls := &InetAddress{} | |
| 85 | - | GetAddressCls.Ptr = GetAddressPtr | |
| 86 | - | return GetAddressCls | |
| 93 | + | cret := xInetAddressMaskGetAddress(x.GoPointer()) | |
| 87 | 94 | ||
| 95 | + | if cret == 0 { | |
| 96 | + | return cls | |
| 97 | + | } | |
| 98 | + | gobject.IncreaseRef(cret) | |
| 99 | + | cls = &InetAddress{} | |
| 100 | + | cls.Ptr = cret | |
| 101 | + | return cls | |
| 88 | 102 | } | |
| 89 | 103 | ||
| 90 | 104 | var xInetAddressMaskGetFamily func(uintptr) SocketFamily | |
| @@ -92,8 +106,8 @@ var xInetAddressMaskGetFamily func(uintptr) SocketFamily | |||
| 92 | 106 | // Gets the #GSocketFamily of @mask's address | |
| 93 | 107 | func (x *InetAddressMask) GetFamily() SocketFamily { | |
| 94 | 108 | ||
| 95 | - | return xInetAddressMaskGetFamily(x.GoPointer()) | |
| 96 | - | ||
| 109 | + | cret := xInetAddressMaskGetFamily(x.GoPointer()) | |
| 110 | + | return cret | |
| 97 | 111 | } | |
| 98 | 112 | ||
| 99 | 113 | var xInetAddressMaskGetLength func(uintptr) uint | |
| @@ -101,8 +115,8 @@ var xInetAddressMaskGetLength func(uintptr) uint | |||
| 101 | 115 | // Gets @mask's length | |
| 102 | 116 | func (x *InetAddressMask) GetLength() uint { | |
| 103 | 117 | ||
| 104 | - | return xInetAddressMaskGetLength(x.GoPointer()) | |
| 105 | - | ||
| 118 | + | cret := xInetAddressMaskGetLength(x.GoPointer()) | |
| 119 | + | return cret | |
| 106 | 120 | } | |
| 107 | 121 | ||
| 108 | 122 | var xInetAddressMaskMatches func(uintptr, uintptr) bool | |
| @@ -110,8 +124,8 @@ var xInetAddressMaskMatches func(uintptr, uintptr) bool | |||
| 110 | 124 | // Tests if @address falls within the range described by @mask. | |
| 111 | 125 | func (x *InetAddressMask) Matches(AddressVar *InetAddress) bool { | |
| 112 | 126 | ||
| 113 | - | return xInetAddressMaskMatches(x.GoPointer(), AddressVar.GoPointer()) | |
| 114 | - | ||
| 127 | + | cret := xInetAddressMaskMatches(x.GoPointer(), AddressVar.GoPointer()) | |
| 128 | + | return cret | |
| 115 | 129 | } | |
| 116 | 130 | ||
| 117 | 131 | var xInetAddressMaskToString func(uintptr) string | |
| @@ -119,8 +133,8 @@ var xInetAddressMaskToString func(uintptr) string | |||
| 119 | 133 | // Converts @mask back to its corresponding string form. | |
| 120 | 134 | func (x *InetAddressMask) ToString() string { | |
| 121 | 135 | ||
| 122 | - | return xInetAddressMaskToString(x.GoPointer()) | |
| 123 | - | ||
| 136 | + | cret := xInetAddressMaskToString(x.GoPointer()) | |
| 137 | + | return cret | |
| 124 | 138 | } | |
| 125 | 139 | ||
| 126 | 140 | func (c *InetAddressMask) GoPointer() uintptr { | |
| @@ -169,9 +183,14 @@ func (c *InetAddressMask) SetGoPointer(ptr uintptr) { | |||
| 169 | 183 | // In this pattern, a caller would expect to be able to call g_initable_init() | |
| 170 | 184 | // on the result of g_object_new(), regardless of whether it is in fact a new | |
| 171 | 185 | // instance. | |
| 172 | - | func (x *InetAddressMask) Init(CancellableVar *Cancellable) bool { | |
| 186 | + | func (x *InetAddressMask) Init(CancellableVar *Cancellable) (bool, error) { | |
| 187 | + | var cerr *glib.Error | |
| 173 | 188 | ||
| 174 | - | return XGInitableInit(x.GoPointer(), CancellableVar.GoPointer()) | |
| 189 | + | cret := XGInitableInit(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 190 | + | if cerr == nil { | |
| 191 | + | return cret, nil | |
| 192 | + | } | |
| 193 | + | return cret, cerr | |
| 175 | 194 | ||
| 176 | 195 | } | |
| 177 | 196 | ||
M v4/gio/ginetsocketaddress.go +51 -48
| @@ -30,14 +30,16 @@ var xNewInetSocketAddress func(uintptr, uint16) uintptr | |||
| 30 | 30 | ||
| 31 | 31 | // Creates a new #GInetSocketAddress for @address and @port. | |
| 32 | 32 | func NewInetSocketAddress(AddressVar *InetAddress, PortVar uint16) *SocketAddress { | |
| 33 | - | NewInetSocketAddressPtr := xNewInetSocketAddress(AddressVar.GoPointer(), PortVar) | |
| 34 | - | if NewInetSocketAddressPtr == 0 { | |
| 35 | - | return nil | |
| 36 | - | } | |
| 33 | + | var cls *SocketAddress | |
| 34 | + | ||
| 35 | + | cret := xNewInetSocketAddress(AddressVar.GoPointer(), PortVar) | |
| 37 | 36 | ||
| 38 | - | NewInetSocketAddressCls := &SocketAddress{} | |
| 39 | - | NewInetSocketAddressCls.Ptr = NewInetSocketAddressPtr | |
| 40 | - | return NewInetSocketAddressCls | |
| 37 | + | if cret == 0 { | |
| 38 | + | return cls | |
| 39 | + | } | |
| 40 | + | cls = &SocketAddress{} | |
| 41 | + | cls.Ptr = cret | |
| 42 | + | return cls | |
| 41 | 43 | } | |
| 42 | 44 | ||
| 43 | 45 | var xNewFromStringInetSocketAddress func(string, uint) uintptr | |
| @@ -47,32 +49,33 @@ var xNewFromStringInetSocketAddress func(string, uint) uintptr | |||
| 47 | 49 | // If @address is an IPv6 address, it can also contain a scope ID | |
| 48 | 50 | // (separated from the address by a `%`). | |
| 49 | 51 | func NewFromStringInetSocketAddress(AddressVar string, PortVar uint) *SocketAddress { | |
| 50 | - | NewFromStringInetSocketAddressPtr := xNewFromStringInetSocketAddress(AddressVar, PortVar) | |
| 51 | - | if NewFromStringInetSocketAddressPtr == 0 { | |
| 52 | - | return nil | |
| 53 | - | } | |
| 52 | + | var cls *SocketAddress | |
| 53 | + | ||
| 54 | + | cret := xNewFromStringInetSocketAddress(AddressVar, PortVar) | |
| 54 | 55 | ||
| 55 | - | NewFromStringInetSocketAddressCls := &SocketAddress{} | |
| 56 | - | NewFromStringInetSocketAddressCls.Ptr = NewFromStringInetSocketAddressPtr | |
| 57 | - | return NewFromStringInetSocketAddressCls | |
| 56 | + | if cret == 0 { | |
| 57 | + | return cls | |
| 58 | + | } | |
| 59 | + | cls = &SocketAddress{} | |
| 60 | + | cls.Ptr = cret | |
| 61 | + | return cls | |
| 58 | 62 | } | |
| 59 | 63 | ||
| 60 | 64 | var xInetSocketAddressGetAddress func(uintptr) uintptr | |
| 61 | 65 | ||
| 62 | 66 | // Gets @address's #GInetAddress. | |
| 63 | 67 | func (x *InetSocketAddress) GetAddress() *InetAddress { | |
| 68 | + | var cls *InetAddress | |
| 64 | 69 | ||
| 65 | - | GetAddressPtr := xInetSocketAddressGetAddress(x.GoPointer()) | |
| 66 | - | if GetAddressPtr == 0 { | |
| 67 | - | return nil | |
| 68 | - | } | |
| 69 | - | ||
| 70 | - | gobject.IncreaseRef(GetAddressPtr) | |
| 71 | - | ||
| 72 | - | GetAddressCls := &InetAddress{} | |
| 73 | - | GetAddressCls.Ptr = GetAddressPtr | |
| 74 | - | return GetAddressCls | |
| 70 | + | cret := xInetSocketAddressGetAddress(x.GoPointer()) | |
| 75 | 71 | ||
| 72 | + | if cret == 0 { | |
| 73 | + | return cls | |
| 74 | + | } | |
| 75 | + | gobject.IncreaseRef(cret) | |
| 76 | + | cls = &InetAddress{} | |
| 77 | + | cls.Ptr = cret | |
| 78 | + | return cls | |
| 76 | 79 | } | |
| 77 | 80 | ||
| 78 | 81 | var xInetSocketAddressGetFlowinfo func(uintptr) uint32 | |
| @@ -81,8 +84,8 @@ var xInetSocketAddressGetFlowinfo func(uintptr) uint32 | |||
| 81 | 84 | // which must be an IPv6 address. | |
| 82 | 85 | func (x *InetSocketAddress) GetFlowinfo() uint32 { | |
| 83 | 86 | ||
| 84 | - | return xInetSocketAddressGetFlowinfo(x.GoPointer()) | |
| 85 | - | ||
| 87 | + | cret := xInetSocketAddressGetFlowinfo(x.GoPointer()) | |
| 88 | + | return cret | |
| 86 | 89 | } | |
| 87 | 90 | ||
| 88 | 91 | var xInetSocketAddressGetPort func(uintptr) uint16 | |
| @@ -90,8 +93,8 @@ var xInetSocketAddressGetPort func(uintptr) uint16 | |||
| 90 | 93 | // Gets @address's port. | |
| 91 | 94 | func (x *InetSocketAddress) GetPort() uint16 { | |
| 92 | 95 | ||
| 93 | - | return xInetSocketAddressGetPort(x.GoPointer()) | |
| 94 | - | ||
| 96 | + | cret := xInetSocketAddressGetPort(x.GoPointer()) | |
| 97 | + | return cret | |
| 95 | 98 | } | |
| 96 | 99 | ||
| 97 | 100 | var xInetSocketAddressGetScopeId func(uintptr) uint32 | |
| @@ -100,8 +103,8 @@ var xInetSocketAddressGetScopeId func(uintptr) uint32 | |||
| 100 | 103 | // which must be an IPv6 address. | |
| 101 | 104 | func (x *InetSocketAddress) GetScopeId() uint32 { | |
| 102 | 105 | ||
| 103 | - | return xInetSocketAddressGetScopeId(x.GoPointer()) | |
| 104 | - | ||
| 106 | + | cret := xInetSocketAddressGetScopeId(x.GoPointer()) | |
| 107 | + | return cret | |
| 105 | 108 | } | |
| 106 | 109 | ||
| 107 | 110 | func (c *InetSocketAddress) GoPointer() uintptr { | |
| @@ -114,16 +117,16 @@ func (c *InetSocketAddress) SetGoPointer(ptr uintptr) { | |||
| 114 | 117 | ||
| 115 | 118 | // Creates a #GSocketAddressEnumerator for @connectable. | |
| 116 | 119 | func (x *InetSocketAddress) Enumerate() *SocketAddressEnumerator { | |
| 120 | + | var cls *SocketAddressEnumerator | |
| 117 | 121 | ||
| 118 | - | EnumeratePtr := XGSocketConnectableEnumerate(x.GoPointer()) | |
| 119 | - | if EnumeratePtr == 0 { | |
| 120 | - | return nil | |
| 121 | - | } | |
| 122 | - | ||
| 123 | - | EnumerateCls := &SocketAddressEnumerator{} | |
| 124 | - | EnumerateCls.Ptr = EnumeratePtr | |
| 125 | - | return EnumerateCls | |
| 122 | + | cret := XGSocketConnectableEnumerate(x.GoPointer()) | |
| 126 | 123 | ||
| 124 | + | if cret == 0 { | |
| 125 | + | return cls | |
| 126 | + | } | |
| 127 | + | cls = &SocketAddressEnumerator{} | |
| 128 | + | cls.Ptr = cret | |
| 129 | + | return cls | |
| 127 | 130 | } | |
| 128 | 131 | ||
| 129 | 132 | // Creates a #GSocketAddressEnumerator for @connectable that will | |
| @@ -134,16 +137,16 @@ func (x *InetSocketAddress) Enumerate() *SocketAddressEnumerator { | |||
| 134 | 137 | // g_socket_connectable_proxy_enumerate(), this will fall back to | |
| 135 | 138 | // calling g_socket_connectable_enumerate(). | |
| 136 | 139 | func (x *InetSocketAddress) ProxyEnumerate() *SocketAddressEnumerator { | |
| 140 | + | var cls *SocketAddressEnumerator | |
| 137 | 141 | ||
| 138 | - | ProxyEnumeratePtr := XGSocketConnectableProxyEnumerate(x.GoPointer()) | |
| 139 | - | if ProxyEnumeratePtr == 0 { | |
| 140 | - | return nil | |
| 141 | - | } | |
| 142 | - | ||
| 143 | - | ProxyEnumerateCls := &SocketAddressEnumerator{} | |
| 144 | - | ProxyEnumerateCls.Ptr = ProxyEnumeratePtr | |
| 145 | - | return ProxyEnumerateCls | |
| 142 | + | cret := XGSocketConnectableProxyEnumerate(x.GoPointer()) | |
| 146 | 143 | ||
| 144 | + | if cret == 0 { | |
| 145 | + | return cls | |
| 146 | + | } | |
| 147 | + | cls = &SocketAddressEnumerator{} | |
| 148 | + | cls.Ptr = cret | |
| 149 | + | return cls | |
| 147 | 150 | } | |
| 148 | 151 | ||
| 149 | 152 | // Format a #GSocketConnectable as a string. This is a human-readable format for | |
| @@ -155,8 +158,8 @@ func (x *InetSocketAddress) ProxyEnumerate() *SocketAddressEnumerator { | |||
| 155 | 158 | // the implementation’s type name will be returned as a fallback. | |
| 156 | 159 | func (x *InetSocketAddress) ToString() string { | |
| 157 | 160 | ||
| 158 | - | return XGSocketConnectableToString(x.GoPointer()) | |
| 159 | - | ||
| 161 | + | cret := XGSocketConnectableToString(x.GoPointer()) | |
| 162 | + | return cret | |
| 160 | 163 | } | |
| 161 | 164 | ||
| 162 | 165 | func init() { | |
M v4/gio/ginitable.go +23 -12
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -92,29 +93,39 @@ func (x *InitableBase) SetGoPointer(ptr uintptr) { | |||
| 92 | 93 | // In this pattern, a caller would expect to be able to call g_initable_init() | |
| 93 | 94 | // on the result of g_object_new(), regardless of whether it is in fact a new | |
| 94 | 95 | // instance. | |
| 95 | - | func (x *InitableBase) Init(CancellableVar *Cancellable) bool { | |
| 96 | + | func (x *InitableBase) Init(CancellableVar *Cancellable) (bool, error) { | |
| 97 | + | var cerr *glib.Error | |
| 96 | 98 | ||
| 97 | - | return XGInitableInit(x.GoPointer(), CancellableVar.GoPointer()) | |
| 99 | + | cret := XGInitableInit(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 100 | + | if cerr == nil { | |
| 101 | + | return cret, nil | |
| 102 | + | } | |
| 103 | + | return cret, cerr | |
| 98 | 104 | ||
| 99 | 105 | } | |
| 100 | 106 | ||
| 101 | - | var XGInitableInit func(uintptr, uintptr) bool | |
| 107 | + | var XGInitableInit func(uintptr, uintptr, **glib.Error) bool | |
| 102 | 108 | ||
| 103 | - | var xInitableNewv func([]interface{}, uint, uintptr, uintptr) uintptr | |
| 109 | + | var xInitableNewv func([]interface{}, uint, uintptr, uintptr, **glib.Error) uintptr | |
| 104 | 110 | ||
| 105 | 111 | // Helper function for constructing #GInitable object. This is | |
| 106 | 112 | // similar to g_object_newv() but also initializes the object | |
| 107 | 113 | // and returns %NULL, setting an error on failure. | |
| 108 | - | func InitableNewv(ObjectTypeVar []interface{}, NParametersVar uint, ParametersVar uintptr, CancellableVar *Cancellable) *gobject.Object { | |
| 114 | + | func InitableNewv(ObjectTypeVar []interface{}, NParametersVar uint, ParametersVar uintptr, CancellableVar *Cancellable) (*gobject.Object, error) { | |
| 115 | + | var cls *gobject.Object | |
| 116 | + | var cerr *glib.Error | |
| 109 | 117 | ||
| 110 | - | InitableNewvPtr := xInitableNewv(ObjectTypeVar, NParametersVar, ParametersVar, CancellableVar.GoPointer()) | |
| 111 | - | if InitableNewvPtr == 0 { | |
| 112 | - | return nil | |
| 113 | - | } | |
| 118 | + | cret := xInitableNewv(ObjectTypeVar, NParametersVar, ParametersVar, CancellableVar.GoPointer(), &cerr) | |
| 114 | 119 | ||
| 115 | - | InitableNewvCls := &gobject.Object{} | |
| 116 | - | InitableNewvCls.Ptr = InitableNewvPtr | |
| 117 | - | return InitableNewvCls | |
| 120 | + | if cret == 0 { | |
| 121 | + | return cls, cerr | |
| 122 | + | } | |
| 123 | + | cls = &gobject.Object{} | |
| 124 | + | cls.Ptr = cret | |
| 125 | + | if cerr == nil { | |
| 126 | + | return cls, nil | |
| 127 | + | } | |
| 128 | + | return cls, cerr | |
| 118 | 129 | ||
| 119 | 130 | } | |
| 120 | 131 | ||
M v4/gio/ginputstream.go +91 -36
| @@ -45,7 +45,7 @@ func (x *InputStream) ClearPending() { | |||
| 45 | 45 | ||
| 46 | 46 | } | |
| 47 | 47 | ||
| 48 | - | var xInputStreamClose func(uintptr, uintptr) bool | |
| 48 | + | var xInputStreamClose func(uintptr, uintptr, **glib.Error) bool | |
| 49 | 49 | ||
| 50 | 50 | // Closes the stream, releasing resources related to it. | |
| 51 | 51 | // | |
| @@ -70,9 +70,14 @@ var xInputStreamClose func(uintptr, uintptr) bool | |||
| 70 | 70 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 71 | 71 | // Cancelling a close will still leave the stream closed, but some streams | |
| 72 | 72 | // can use a faster close that doesn't block to e.g. check errors. | |
| 73 | - | func (x *InputStream) Close(CancellableVar *Cancellable) bool { | |
| 73 | + | func (x *InputStream) Close(CancellableVar *Cancellable) (bool, error) { | |
| 74 | + | var cerr *glib.Error | |
| 74 | 75 | ||
| 75 | - | return xInputStreamClose(x.GoPointer(), CancellableVar.GoPointer()) | |
| 76 | + | cret := xInputStreamClose(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 77 | + | if cerr == nil { | |
| 78 | + | return cret, nil | |
| 79 | + | } | |
| 80 | + | return cret, cerr | |
| 76 | 81 | ||
| 77 | 82 | } | |
| 78 | 83 | ||
| @@ -94,12 +99,17 @@ func (x *InputStream) CloseAsync(IoPriorityVar int, CancellableVar *Cancellable, | |||
| 94 | 99 | ||
| 95 | 100 | } | |
| 96 | 101 | ||
| 97 | - | var xInputStreamCloseFinish func(uintptr, uintptr) bool | |
| 102 | + | var xInputStreamCloseFinish func(uintptr, uintptr, **glib.Error) bool | |
| 98 | 103 | ||
| 99 | 104 | // Finishes closing a stream asynchronously, started from g_input_stream_close_async(). | |
| 100 | - | func (x *InputStream) CloseFinish(ResultVar AsyncResult) bool { | |
| 105 | + | func (x *InputStream) CloseFinish(ResultVar AsyncResult) (bool, error) { | |
| 106 | + | var cerr *glib.Error | |
| 101 | 107 | ||
| 102 | - | return xInputStreamCloseFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 108 | + | cret := xInputStreamCloseFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 109 | + | if cerr == nil { | |
| 110 | + | return cret, nil | |
| 111 | + | } | |
| 112 | + | return cret, cerr | |
| 103 | 113 | ||
| 104 | 114 | } | |
| 105 | 115 | ||
| @@ -108,8 +118,8 @@ var xInputStreamHasPending func(uintptr) bool | |||
| 108 | 118 | // Checks if an input stream has pending actions. | |
| 109 | 119 | func (x *InputStream) HasPending() bool { | |
| 110 | 120 | ||
| 111 | - | return xInputStreamHasPending(x.GoPointer()) | |
| 112 | - | ||
| 121 | + | cret := xInputStreamHasPending(x.GoPointer()) | |
| 122 | + | return cret | |
| 113 | 123 | } | |
| 114 | 124 | ||
| 115 | 125 | var xInputStreamIsClosed func(uintptr) bool | |
| @@ -117,11 +127,11 @@ var xInputStreamIsClosed func(uintptr) bool | |||
| 117 | 127 | // Checks if an input stream is closed. | |
| 118 | 128 | func (x *InputStream) IsClosed() bool { | |
| 119 | 129 | ||
| 120 | - | return xInputStreamIsClosed(x.GoPointer()) | |
| 121 | - | ||
| 130 | + | cret := xInputStreamIsClosed(x.GoPointer()) | |
| 131 | + | return cret | |
| 122 | 132 | } | |
| 123 | 133 | ||
| 124 | - | var xInputStreamRead func(uintptr, uintptr, uint, uintptr) int | |
| 134 | + | var xInputStreamRead func(uintptr, uintptr, uint, uintptr, **glib.Error) int | |
| 125 | 135 | ||
| 126 | 136 | // Tries to read @count bytes from the stream into the buffer starting at | |
| 127 | 137 | // @buffer. Will block during this read. | |
| @@ -144,13 +154,18 @@ var xInputStreamRead func(uintptr, uintptr, uint, uintptr) int | |||
| 144 | 154 | // partial result will be returned, without an error. | |
| 145 | 155 | // | |
| 146 | 156 | // On error -1 is returned and @error is set accordingly. | |
| 147 | - | func (x *InputStream) Read(BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) int { | |
| 157 | + | func (x *InputStream) Read(BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) (int, error) { | |
| 158 | + | var cerr *glib.Error | |
| 148 | 159 | ||
| 149 | - | return xInputStreamRead(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer()) | |
| 160 | + | cret := xInputStreamRead(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer(), &cerr) | |
| 161 | + | if cerr == nil { | |
| 162 | + | return cret, nil | |
| 163 | + | } | |
| 164 | + | return cret, cerr | |
| 150 | 165 | ||
| 151 | 166 | } | |
| 152 | 167 | ||
| 153 | - | var xInputStreamReadAll func(uintptr, uintptr, uint, uint, uintptr) bool | |
| 168 | + | var xInputStreamReadAll func(uintptr, uintptr, uint, uint, uintptr, **glib.Error) bool | |
| 154 | 169 | ||
| 155 | 170 | // Tries to read @count bytes from the stream into the buffer starting at | |
| 156 | 171 | // @buffer. Will block during this read. | |
| @@ -171,9 +186,14 @@ var xInputStreamReadAll func(uintptr, uintptr, uint, uint, uintptr) bool | |||
| 171 | 186 | // read before the error was encountered. This functionality is only | |
| 172 | 187 | // available from C. If you need it from another language then you must | |
| 173 | 188 | // write your own loop around g_input_stream_read(). | |
| 174 | - | func (x *InputStream) ReadAll(BufferVar uintptr, CountVar uint, BytesReadVar uint, CancellableVar *Cancellable) bool { | |
| 189 | + | func (x *InputStream) ReadAll(BufferVar uintptr, CountVar uint, BytesReadVar uint, CancellableVar *Cancellable) (bool, error) { | |
| 190 | + | var cerr *glib.Error | |
| 175 | 191 | ||
| 176 | - | return xInputStreamReadAll(x.GoPointer(), BufferVar, CountVar, BytesReadVar, CancellableVar.GoPointer()) | |
| 192 | + | cret := xInputStreamReadAll(x.GoPointer(), BufferVar, CountVar, BytesReadVar, CancellableVar.GoPointer(), &cerr) | |
| 193 | + | if cerr == nil { | |
| 194 | + | return cret, nil | |
| 195 | + | } | |
| 196 | + | return cret, cerr | |
| 177 | 197 | ||
| 178 | 198 | } | |
| 179 | 199 | ||
| @@ -195,7 +215,7 @@ func (x *InputStream) ReadAllAsync(BufferVar uintptr, CountVar uint, IoPriorityV | |||
| 195 | 215 | ||
| 196 | 216 | } | |
| 197 | 217 | ||
| 198 | - | var xInputStreamReadAllFinish func(uintptr, uintptr, uint) bool | |
| 218 | + | var xInputStreamReadAllFinish func(uintptr, uintptr, uint, **glib.Error) bool | |
| 199 | 219 | ||
| 200 | 220 | // Finishes an asynchronous stream read operation started with | |
| 201 | 221 | // g_input_stream_read_all_async(). | |
| @@ -206,9 +226,14 @@ var xInputStreamReadAllFinish func(uintptr, uintptr, uint) bool | |||
| 206 | 226 | // read before the error was encountered. This functionality is only | |
| 207 | 227 | // available from C. If you need it from another language then you must | |
| 208 | 228 | // write your own loop around g_input_stream_read_async(). | |
| 209 | - | func (x *InputStream) ReadAllFinish(ResultVar AsyncResult, BytesReadVar uint) bool { | |
| 229 | + | func (x *InputStream) ReadAllFinish(ResultVar AsyncResult, BytesReadVar uint) (bool, error) { | |
| 230 | + | var cerr *glib.Error | |
| 210 | 231 | ||
| 211 | - | return xInputStreamReadAllFinish(x.GoPointer(), ResultVar.GoPointer(), BytesReadVar) | |
| 232 | + | cret := xInputStreamReadAllFinish(x.GoPointer(), ResultVar.GoPointer(), BytesReadVar, &cerr) | |
| 233 | + | if cerr == nil { | |
| 234 | + | return cret, nil | |
| 235 | + | } | |
| 236 | + | return cret, cerr | |
| 212 | 237 | ||
| 213 | 238 | } | |
| 214 | 239 | ||
| @@ -243,7 +268,7 @@ func (x *InputStream) ReadAsync(BufferVar uintptr, CountVar uint, IoPriorityVar | |||
| 243 | 268 | ||
| 244 | 269 | } | |
| 245 | 270 | ||
| 246 | - | var xInputStreamReadBytes func(uintptr, uint, uintptr) *glib.Bytes | |
| 271 | + | var xInputStreamReadBytes func(uintptr, uint, uintptr, **glib.Error) *glib.Bytes | |
| 247 | 272 | ||
| 248 | 273 | // Like g_input_stream_read(), this tries to read @count bytes from | |
| 249 | 274 | // the stream in a blocking fashion. However, rather than reading into | |
| @@ -268,9 +293,14 @@ var xInputStreamReadBytes func(uintptr, uint, uintptr) *glib.Bytes | |||
| 268 | 293 | // partial result will be returned, without an error. | |
| 269 | 294 | // | |
| 270 | 295 | // On error %NULL is returned and @error is set accordingly. | |
| 271 | - | func (x *InputStream) ReadBytes(CountVar uint, CancellableVar *Cancellable) *glib.Bytes { | |
| 296 | + | func (x *InputStream) ReadBytes(CountVar uint, CancellableVar *Cancellable) (*glib.Bytes, error) { | |
| 297 | + | var cerr *glib.Error | |
| 272 | 298 | ||
| 273 | - | return xInputStreamReadBytes(x.GoPointer(), CountVar, CancellableVar.GoPointer()) | |
| 299 | + | cret := xInputStreamReadBytes(x.GoPointer(), CountVar, CancellableVar.GoPointer(), &cerr) | |
| 300 | + | if cerr == nil { | |
| 301 | + | return cret, nil | |
| 302 | + | } | |
| 303 | + | return cret, cerr | |
| 274 | 304 | ||
| 275 | 305 | } | |
| 276 | 306 | ||
| @@ -302,21 +332,31 @@ func (x *InputStream) ReadBytesAsync(CountVar uint, IoPriorityVar int, Cancellab | |||
| 302 | 332 | ||
| 303 | 333 | } | |
| 304 | 334 | ||
| 305 | - | var xInputStreamReadBytesFinish func(uintptr, uintptr) *glib.Bytes | |
| 335 | + | var xInputStreamReadBytesFinish func(uintptr, uintptr, **glib.Error) *glib.Bytes | |
| 306 | 336 | ||
| 307 | 337 | // Finishes an asynchronous stream read-into-#GBytes operation. | |
| 308 | - | func (x *InputStream) ReadBytesFinish(ResultVar AsyncResult) *glib.Bytes { | |
| 338 | + | func (x *InputStream) ReadBytesFinish(ResultVar AsyncResult) (*glib.Bytes, error) { | |
| 339 | + | var cerr *glib.Error | |
| 309 | 340 | ||
| 310 | - | return xInputStreamReadBytesFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 341 | + | cret := xInputStreamReadBytesFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 342 | + | if cerr == nil { | |
| 343 | + | return cret, nil | |
| 344 | + | } | |
| 345 | + | return cret, cerr | |
| 311 | 346 | ||
| 312 | 347 | } | |
| 313 | 348 | ||
| 314 | - | var xInputStreamReadFinish func(uintptr, uintptr) int | |
| 349 | + | var xInputStreamReadFinish func(uintptr, uintptr, **glib.Error) int | |
| 315 | 350 | ||
| 316 | 351 | // Finishes an asynchronous stream read operation. | |
| 317 | - | func (x *InputStream) ReadFinish(ResultVar AsyncResult) int { | |
| 352 | + | func (x *InputStream) ReadFinish(ResultVar AsyncResult) (int, error) { | |
| 353 | + | var cerr *glib.Error | |
| 318 | 354 | ||
| 319 | - | return xInputStreamReadFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 355 | + | cret := xInputStreamReadFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 356 | + | if cerr == nil { | |
| 357 | + | return cret, nil | |
| 358 | + | } | |
| 359 | + | return cret, cerr | |
| 320 | 360 | ||
| 321 | 361 | } | |
| 322 | 362 | ||
| @@ -325,13 +365,18 @@ var xInputStreamSetPending func(uintptr) bool | |||
| 325 | 365 | // Sets @stream to have actions pending. If the pending flag is | |
| 326 | 366 | // already set or @stream is closed, it will return %FALSE and set | |
| 327 | 367 | // @error. | |
| 328 | - | func (x *InputStream) SetPending() bool { | |
| 368 | + | func (x *InputStream) SetPending() (bool, error) { | |
| 369 | + | var cerr *glib.Error | |
| 329 | 370 | ||
| 330 | - | return xInputStreamSetPending(x.GoPointer()) | |
| 371 | + | cret := xInputStreamSetPending(x.GoPointer()) | |
| 372 | + | if cerr == nil { | |
| 373 | + | return cret, nil | |
| 374 | + | } | |
| 375 | + | return cret, cerr | |
| 331 | 376 | ||
| 332 | 377 | } | |
| 333 | 378 | ||
| 334 | - | var xInputStreamSkip func(uintptr, uint, uintptr) int | |
| 379 | + | var xInputStreamSkip func(uintptr, uint, uintptr, **glib.Error) int | |
| 335 | 380 | ||
| 336 | 381 | // Tries to skip @count bytes from the stream. Will block during the operation. | |
| 337 | 382 | // | |
| @@ -347,9 +392,14 @@ var xInputStreamSkip func(uintptr, uint, uintptr) int | |||
| 347 | 392 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an | |
| 348 | 393 | // operation was partially finished when the operation was cancelled the | |
| 349 | 394 | // partial result will be returned, without an error. | |
| 350 | - | func (x *InputStream) Skip(CountVar uint, CancellableVar *Cancellable) int { | |
| 395 | + | func (x *InputStream) Skip(CountVar uint, CancellableVar *Cancellable) (int, error) { | |
| 396 | + | var cerr *glib.Error | |
| 351 | 397 | ||
| 352 | - | return xInputStreamSkip(x.GoPointer(), CountVar, CancellableVar.GoPointer()) | |
| 398 | + | cret := xInputStreamSkip(x.GoPointer(), CountVar, CancellableVar.GoPointer(), &cerr) | |
| 399 | + | if cerr == nil { | |
| 400 | + | return cret, nil | |
| 401 | + | } | |
| 402 | + | return cret, cerr | |
| 353 | 403 | ||
| 354 | 404 | } | |
| 355 | 405 | ||
| @@ -384,12 +434,17 @@ func (x *InputStream) SkipAsync(CountVar uint, IoPriorityVar int, CancellableVar | |||
| 384 | 434 | ||
| 385 | 435 | } | |
| 386 | 436 | ||
| 387 | - | var xInputStreamSkipFinish func(uintptr, uintptr) int | |
| 437 | + | var xInputStreamSkipFinish func(uintptr, uintptr, **glib.Error) int | |
| 388 | 438 | ||
| 389 | 439 | // Finishes a stream skip operation. | |
| 390 | - | func (x *InputStream) SkipFinish(ResultVar AsyncResult) int { | |
| 440 | + | func (x *InputStream) SkipFinish(ResultVar AsyncResult) (int, error) { | |
| 441 | + | var cerr *glib.Error | |
| 391 | 442 | ||
| 392 | - | return xInputStreamSkipFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 443 | + | cret := xInputStreamSkipFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 444 | + | if cerr == nil { | |
| 445 | + | return cret, nil | |
| 446 | + | } | |
| 447 | + | return cret, cerr | |
| 393 | 448 | ||
| 394 | 449 | } | |
| 395 | 450 | ||
M v4/gio/gio-2.0.go +887 -628
| @@ -13,8 +13,8 @@ var xIoErrorQuark func() glib.Quark | |||
| 13 | 13 | // Gets the GIO Error Quark. | |
| 14 | 14 | func IoErrorQuark() glib.Quark { | |
| 15 | 15 | ||
| 16 | - | return xIoErrorQuark() | |
| 17 | - | ||
| 16 | + | cret := xIoErrorQuark() | |
| 17 | + | return cret | |
| 18 | 18 | } | |
| 19 | 19 | ||
| 20 | 20 | var xResolverErrorQuark func() glib.Quark | |
| @@ -22,8 +22,8 @@ var xResolverErrorQuark func() glib.Quark | |||
| 22 | 22 | // Gets the #GResolver Error Quark. | |
| 23 | 23 | func ResolverErrorQuark() glib.Quark { | |
| 24 | 24 | ||
| 25 | - | return xResolverErrorQuark() | |
| 26 | - | ||
| 25 | + | cret := xResolverErrorQuark() | |
| 26 | + | return cret | |
| 27 | 27 | } | |
| 28 | 28 | ||
| 29 | 29 | var xResourceErrorQuark func() glib.Quark | |
| @@ -31,8 +31,8 @@ var xResourceErrorQuark func() glib.Quark | |||
| 31 | 31 | // Gets the #GResource Error Quark. | |
| 32 | 32 | func ResourceErrorQuark() glib.Quark { | |
| 33 | 33 | ||
| 34 | - | return xResourceErrorQuark() | |
| 35 | - | ||
| 34 | + | cret := xResourceErrorQuark() | |
| 35 | + | return cret | |
| 36 | 36 | } | |
| 37 | 37 | ||
| 38 | 38 | var xTlsChannelBindingErrorQuark func() glib.Quark | |
| @@ -40,8 +40,8 @@ var xTlsChannelBindingErrorQuark func() glib.Quark | |||
| 40 | 40 | // Gets the TLS channel binding error quark. | |
| 41 | 41 | func TlsChannelBindingErrorQuark() glib.Quark { | |
| 42 | 42 | ||
| 43 | - | return xTlsChannelBindingErrorQuark() | |
| 44 | - | ||
| 43 | + | cret := xTlsChannelBindingErrorQuark() | |
| 44 | + | return cret | |
| 45 | 45 | } | |
| 46 | 46 | ||
| 47 | 47 | var xTlsErrorQuark func() glib.Quark | |
| @@ -49,8 +49,8 @@ var xTlsErrorQuark func() glib.Quark | |||
| 49 | 49 | // Gets the TLS error quark. | |
| 50 | 50 | func TlsErrorQuark() glib.Quark { | |
| 51 | 51 | ||
| 52 | - | return xTlsErrorQuark() | |
| 53 | - | ||
| 52 | + | cret := xTlsErrorQuark() | |
| 53 | + | return cret | |
| 54 | 54 | } | |
| 55 | 55 | ||
| 56 | 56 | // #GAppInfoMonitor is a very simple object used for monitoring the app | |
| @@ -120,14 +120,16 @@ var xNewBytesIcon func(*glib.Bytes) uintptr | |||
| 120 | 120 | // This cannot fail, but loading and interpreting the bytes may fail later on | |
| 121 | 121 | // (for example, if g_loadable_icon_load() is called) if the image is invalid. | |
| 122 | 122 | func NewBytesIcon(BytesVar *glib.Bytes) *BytesIcon { | |
| 123 | - | NewBytesIconPtr := xNewBytesIcon(BytesVar) | |
| 124 | - | if NewBytesIconPtr == 0 { | |
| 125 | - | return nil | |
| 126 | - | } | |
| 123 | + | var cls *BytesIcon | |
| 124 | + | ||
| 125 | + | cret := xNewBytesIcon(BytesVar) | |
| 127 | 126 | ||
| 128 | - | NewBytesIconCls := &BytesIcon{} | |
| 129 | - | NewBytesIconCls.Ptr = NewBytesIconPtr | |
| 130 | - | return NewBytesIconCls | |
| 127 | + | if cret == 0 { | |
| 128 | + | return cls | |
| 129 | + | } | |
| 130 | + | cls = &BytesIcon{} | |
| 131 | + | cls.Ptr = cret | |
| 132 | + | return cls | |
| 131 | 133 | } | |
| 132 | 134 | ||
| 133 | 135 | var xBytesIconGetBytes func(uintptr) *glib.Bytes | |
| @@ -135,8 +137,8 @@ var xBytesIconGetBytes func(uintptr) *glib.Bytes | |||
| 135 | 137 | // Gets the #GBytes associated with the given @icon. | |
| 136 | 138 | func (x *BytesIcon) GetBytes() *glib.Bytes { | |
| 137 | 139 | ||
| 138 | - | return xBytesIconGetBytes(x.GoPointer()) | |
| 139 | - | ||
| 140 | + | cret := xBytesIconGetBytes(x.GoPointer()) | |
| 141 | + | return cret | |
| 140 | 142 | } | |
| 141 | 143 | ||
| 142 | 144 | func (c *BytesIcon) GoPointer() uintptr { | |
| @@ -150,8 +152,8 @@ func (c *BytesIcon) SetGoPointer(ptr uintptr) { | |||
| 150 | 152 | // Checks if two icons are equal. | |
| 151 | 153 | func (x *BytesIcon) Equal(Icon2Var Icon) bool { | |
| 152 | 154 | ||
| 153 | - | return XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 154 | - | ||
| 155 | + | cret := XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 156 | + | return cret | |
| 155 | 157 | } | |
| 156 | 158 | ||
| 157 | 159 | // Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved | |
| @@ -161,8 +163,8 @@ func (x *BytesIcon) Equal(Icon2Var Icon) bool { | |||
| 161 | 163 | // (as opposed to over the network), and within the same file system namespace. | |
| 162 | 164 | func (x *BytesIcon) Serialize() *glib.Variant { | |
| 163 | 165 | ||
| 164 | - | return XGIconSerialize(x.GoPointer()) | |
| 165 | - | ||
| 166 | + | cret := XGIconSerialize(x.GoPointer()) | |
| 167 | + | return cret | |
| 166 | 168 | } | |
| 167 | 169 | ||
| 168 | 170 | // Generates a textual representation of @icon that can be used for | |
| @@ -183,22 +185,27 @@ func (x *BytesIcon) Serialize() *glib.Variant { | |||
| 183 | 185 | // the encoding is simply the name (such as `network-server`). | |
| 184 | 186 | func (x *BytesIcon) ToString() string { | |
| 185 | 187 | ||
| 186 | - | return XGIconToString(x.GoPointer()) | |
| 187 | - | ||
| 188 | + | cret := XGIconToString(x.GoPointer()) | |
| 189 | + | return cret | |
| 188 | 190 | } | |
| 189 | 191 | ||
| 190 | 192 | // Loads a loadable icon. For the asynchronous version of this function, | |
| 191 | 193 | // see g_loadable_icon_load_async(). | |
| 192 | - | func (x *BytesIcon) Load(SizeVar int, TypeVar string, CancellableVar *Cancellable) *InputStream { | |
| 194 | + | func (x *BytesIcon) Load(SizeVar int, TypeVar string, CancellableVar *Cancellable) (*InputStream, error) { | |
| 195 | + | var cls *InputStream | |
| 196 | + | var cerr *glib.Error | |
| 193 | 197 | ||
| 194 | - | LoadPtr := XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer()) | |
| 195 | - | if LoadPtr == 0 { | |
| 196 | - | return nil | |
| 197 | - | } | |
| 198 | + | cret := XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 198 | 199 | ||
| 199 | - | LoadCls := &InputStream{} | |
| 200 | - | LoadCls.Ptr = LoadPtr | |
| 201 | - | return LoadCls | |
| 200 | + | if cret == 0 { | |
| 201 | + | return cls, cerr | |
| 202 | + | } | |
| 203 | + | cls = &InputStream{} | |
| 204 | + | cls.Ptr = cret | |
| 205 | + | if cerr == nil { | |
| 206 | + | return cls, nil | |
| 207 | + | } | |
| 208 | + | return cls, cerr | |
| 202 | 209 | ||
| 203 | 210 | } | |
| 204 | 211 | ||
| @@ -212,16 +219,21 @@ func (x *BytesIcon) LoadAsync(SizeVar int, CancellableVar *Cancellable, Callback | |||
| 212 | 219 | } | |
| 213 | 220 | ||
| 214 | 221 | // Finishes an asynchronous icon load started in g_loadable_icon_load_async(). | |
| 215 | - | func (x *BytesIcon) LoadFinish(ResVar AsyncResult, TypeVar string) *InputStream { | |
| 222 | + | func (x *BytesIcon) LoadFinish(ResVar AsyncResult, TypeVar string) (*InputStream, error) { | |
| 223 | + | var cls *InputStream | |
| 224 | + | var cerr *glib.Error | |
| 216 | 225 | ||
| 217 | - | LoadFinishPtr := XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar) | |
| 218 | - | if LoadFinishPtr == 0 { | |
| 219 | - | return nil | |
| 220 | - | } | |
| 226 | + | cret := XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar, &cerr) | |
| 221 | 227 | ||
| 222 | - | LoadFinishCls := &InputStream{} | |
| 223 | - | LoadFinishCls.Ptr = LoadFinishPtr | |
| 224 | - | return LoadFinishCls | |
| 228 | + | if cret == 0 { | |
| 229 | + | return cls, cerr | |
| 230 | + | } | |
| 231 | + | cls = &InputStream{} | |
| 232 | + | cls.Ptr = cret | |
| 233 | + | if cerr == nil { | |
| 234 | + | return cls, nil | |
| 235 | + | } | |
| 236 | + | return cls, cerr | |
| 225 | 237 | ||
| 226 | 238 | } | |
| 227 | 239 | ||
| @@ -344,8 +356,8 @@ func (x *DBusActionGroup) ChangeActionState(ActionNameVar string, ValueVar *glib | |||
| 344 | 356 | // have its state changed from outside callers. | |
| 345 | 357 | func (x *DBusActionGroup) GetActionEnabled(ActionNameVar string) bool { | |
| 346 | 358 | ||
| 347 | - | return XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar) | |
| 348 | - | ||
| 359 | + | cret := XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar) | |
| 360 | + | return cret | |
| 349 | 361 | } | |
| 350 | 362 | ||
| 351 | 363 | // Queries the type of the parameter that must be given when activating | |
| @@ -363,8 +375,8 @@ func (x *DBusActionGroup) GetActionEnabled(ActionNameVar string) bool { | |||
| 363 | 375 | // with the same name but a different parameter type. | |
| 364 | 376 | func (x *DBusActionGroup) GetActionParameterType(ActionNameVar string) *glib.VariantType { | |
| 365 | 377 | ||
| 366 | - | return XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar) | |
| 367 | - | ||
| 378 | + | cret := XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar) | |
| 379 | + | return cret | |
| 368 | 380 | } | |
| 369 | 381 | ||
| 370 | 382 | // Queries the current state of the named action within @action_group. | |
| @@ -377,8 +389,8 @@ func (x *DBusActionGroup) GetActionParameterType(ActionNameVar string) *glib.Var | |||
| 377 | 389 | // g_variant_unref() when it is no longer required. | |
| 378 | 390 | func (x *DBusActionGroup) GetActionState(ActionNameVar string) *glib.Variant { | |
| 379 | 391 | ||
| 380 | - | return XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| 381 | - | ||
| 392 | + | cret := XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| 393 | + | return cret | |
| 382 | 394 | } | |
| 383 | 395 | ||
| 384 | 396 | // Requests a hint about the valid range of values for the state of the | |
| @@ -401,8 +413,8 @@ func (x *DBusActionGroup) GetActionState(ActionNameVar string) *glib.Variant { | |||
| 401 | 413 | // g_variant_unref() when it is no longer required. | |
| 402 | 414 | func (x *DBusActionGroup) GetActionStateHint(ActionNameVar string) *glib.Variant { | |
| 403 | 415 | ||
| 404 | - | return XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| 405 | - | ||
| 416 | + | cret := XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| 417 | + | return cret | |
| 406 | 418 | } | |
| 407 | 419 | ||
| 408 | 420 | // Queries the type of the state of the named action within | |
| @@ -423,15 +435,15 @@ func (x *DBusActionGroup) GetActionStateHint(ActionNameVar string) *glib.Variant | |||
| 423 | 435 | // with the same name but a different state type. | |
| 424 | 436 | func (x *DBusActionGroup) GetActionStateType(ActionNameVar string) *glib.VariantType { | |
| 425 | 437 | ||
| 426 | - | return XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar) | |
| 427 | - | ||
| 438 | + | cret := XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar) | |
| 439 | + | return cret | |
| 428 | 440 | } | |
| 429 | 441 | ||
| 430 | 442 | // Checks if the named action exists within @action_group. | |
| 431 | 443 | func (x *DBusActionGroup) HasAction(ActionNameVar string) bool { | |
| 432 | 444 | ||
| 433 | - | return XGActionGroupHasAction(x.GoPointer(), ActionNameVar) | |
| 434 | - | ||
| 445 | + | cret := XGActionGroupHasAction(x.GoPointer(), ActionNameVar) | |
| 446 | + | return cret | |
| 435 | 447 | } | |
| 436 | 448 | ||
| 437 | 449 | // Lists the actions contained within @action_group. | |
| @@ -440,8 +452,8 @@ func (x *DBusActionGroup) HasAction(ActionNameVar string) bool { | |||
| 440 | 452 | // it is no longer required. | |
| 441 | 453 | func (x *DBusActionGroup) ListActions() uintptr { | |
| 442 | 454 | ||
| 443 | - | return XGActionGroupListActions(x.GoPointer()) | |
| 444 | - | ||
| 455 | + | cret := XGActionGroupListActions(x.GoPointer()) | |
| 456 | + | return cret | |
| 445 | 457 | } | |
| 446 | 458 | ||
| 447 | 459 | // Queries all aspects of the named action within an @action_group. | |
| @@ -473,8 +485,8 @@ func (x *DBusActionGroup) ListActions() uintptr { | |||
| 473 | 485 | // fields may or may not have been modified. | |
| 474 | 486 | func (x *DBusActionGroup) QueryAction(ActionNameVar string, EnabledVar bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool { | |
| 475 | 487 | ||
| 476 | - | return XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) | |
| 477 | - | ||
| 488 | + | cret := XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) | |
| 489 | + | return cret | |
| 478 | 490 | } | |
| 479 | 491 | ||
| 480 | 492 | // Activates the remote action. | |
| @@ -589,14 +601,16 @@ var xNewDBusAuthObserver func() uintptr | |||
| 589 | 601 | ||
| 590 | 602 | // Creates a new #GDBusAuthObserver object. | |
| 591 | 603 | func NewDBusAuthObserver() *DBusAuthObserver { | |
| 592 | - | NewDBusAuthObserverPtr := xNewDBusAuthObserver() | |
| 593 | - | if NewDBusAuthObserverPtr == 0 { | |
| 594 | - | return nil | |
| 595 | - | } | |
| 604 | + | var cls *DBusAuthObserver | |
| 596 | 605 | ||
| 597 | - | NewDBusAuthObserverCls := &DBusAuthObserver{} | |
| 598 | - | NewDBusAuthObserverCls.Ptr = NewDBusAuthObserverPtr | |
| 599 | - | return NewDBusAuthObserverCls | |
| 606 | + | cret := xNewDBusAuthObserver() | |
| 607 | + | ||
| 608 | + | if cret == 0 { | |
| 609 | + | return cls | |
| 610 | + | } | |
| 611 | + | cls = &DBusAuthObserver{} | |
| 612 | + | cls.Ptr = cret | |
| 613 | + | return cls | |
| 600 | 614 | } | |
| 601 | 615 | ||
| 602 | 616 | var xDBusAuthObserverAllowMechanism func(uintptr, string) bool | |
| @@ -604,8 +618,8 @@ var xDBusAuthObserverAllowMechanism func(uintptr, string) bool | |||
| 604 | 618 | // Emits the #GDBusAuthObserver::allow-mechanism signal on @observer. | |
| 605 | 619 | func (x *DBusAuthObserver) AllowMechanism(MechanismVar string) bool { | |
| 606 | 620 | ||
| 607 | - | return xDBusAuthObserverAllowMechanism(x.GoPointer(), MechanismVar) | |
| 608 | - | ||
| 621 | + | cret := xDBusAuthObserverAllowMechanism(x.GoPointer(), MechanismVar) | |
| 622 | + | return cret | |
| 609 | 623 | } | |
| 610 | 624 | ||
| 611 | 625 | var xDBusAuthObserverAuthorizeAuthenticatedPeer func(uintptr, uintptr, uintptr) bool | |
| @@ -613,8 +627,8 @@ var xDBusAuthObserverAuthorizeAuthenticatedPeer func(uintptr, uintptr, uintptr) | |||
| 613 | 627 | // Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer. | |
| 614 | 628 | func (x *DBusAuthObserver) AuthorizeAuthenticatedPeer(StreamVar *IOStream, CredentialsVar *Credentials) bool { | |
| 615 | 629 | ||
| 616 | - | return xDBusAuthObserverAuthorizeAuthenticatedPeer(x.GoPointer(), StreamVar.GoPointer(), CredentialsVar.GoPointer()) | |
| 617 | - | ||
| 630 | + | cret := xDBusAuthObserverAuthorizeAuthenticatedPeer(x.GoPointer(), StreamVar.GoPointer(), CredentialsVar.GoPointer()) | |
| 631 | + | return cret | |
| 618 | 632 | } | |
| 619 | 633 | ||
| 620 | 634 | func (c *DBusAuthObserver) GoPointer() uintptr { | |
| @@ -709,35 +723,49 @@ func DBusConnectionNewFromInternalPtr(ptr uintptr) *DBusConnection { | |||
| 709 | 723 | return cls | |
| 710 | 724 | } | |
| 711 | 725 | ||
| 712 | - | var xNewFinishDBusConnection func(uintptr) uintptr | |
| 726 | + | var xNewFinishDBusConnection func(uintptr, **glib.Error) uintptr | |
| 713 | 727 | ||
| 714 | 728 | // Finishes an operation started with g_dbus_connection_new(). | |
| 715 | - | func NewFinishDBusConnection(ResVar AsyncResult) *DBusConnection { | |
| 716 | - | NewFinishDBusConnectionPtr := xNewFinishDBusConnection(ResVar.GoPointer()) | |
| 717 | - | if NewFinishDBusConnectionPtr == 0 { | |
| 718 | - | return nil | |
| 729 | + | func NewFinishDBusConnection(ResVar AsyncResult) (*DBusConnection, error) { | |
| 730 | + | var cls *DBusConnection | |
| 731 | + | var cerr *glib.Error | |
| 732 | + | ||
| 733 | + | cret := xNewFinishDBusConnection(ResVar.GoPointer(), &cerr) | |
| 734 | + | ||
| 735 | + | if cret == 0 { | |
| 736 | + | return cls, cerr | |
| 719 | 737 | } | |
| 738 | + | cls = &DBusConnection{} | |
| 739 | + | cls.Ptr = cret | |
| 740 | + | if cerr == nil { | |
| 741 | + | return cls, nil | |
| 742 | + | } | |
| 743 | + | return cls, cerr | |
| 720 | 744 | ||
| 721 | - | NewFinishDBusConnectionCls := &DBusConnection{} | |
| 722 | - | NewFinishDBusConnectionCls.Ptr = NewFinishDBusConnectionPtr | |
| 723 | - | return NewFinishDBusConnectionCls | |
| 724 | 745 | } | |
| 725 | 746 | ||
| 726 | - | var xNewForAddressFinishDBusConnection func(uintptr) uintptr | |
| 747 | + | var xNewForAddressFinishDBusConnection func(uintptr, **glib.Error) uintptr | |
| 727 | 748 | ||
| 728 | 749 | // Finishes an operation started with g_dbus_connection_new_for_address(). | |
| 729 | - | func NewForAddressFinishDBusConnection(ResVar AsyncResult) *DBusConnection { | |
| 730 | - | NewForAddressFinishDBusConnectionPtr := xNewForAddressFinishDBusConnection(ResVar.GoPointer()) | |
| 731 | - | if NewForAddressFinishDBusConnectionPtr == 0 { | |
| 732 | - | return nil | |
| 750 | + | func NewForAddressFinishDBusConnection(ResVar AsyncResult) (*DBusConnection, error) { | |
| 751 | + | var cls *DBusConnection | |
| 752 | + | var cerr *glib.Error | |
| 753 | + | ||
| 754 | + | cret := xNewForAddressFinishDBusConnection(ResVar.GoPointer(), &cerr) | |
| 755 | + | ||
| 756 | + | if cret == 0 { | |
| 757 | + | return cls, cerr | |
| 758 | + | } | |
| 759 | + | cls = &DBusConnection{} | |
| 760 | + | cls.Ptr = cret | |
| 761 | + | if cerr == nil { | |
| 762 | + | return cls, nil | |
| 733 | 763 | } | |
| 764 | + | return cls, cerr | |
| 734 | 765 | ||
| 735 | - | NewForAddressFinishDBusConnectionCls := &DBusConnection{} | |
| 736 | - | NewForAddressFinishDBusConnectionCls.Ptr = NewForAddressFinishDBusConnectionPtr | |
| 737 | - | return NewForAddressFinishDBusConnectionCls | |
| 738 | 766 | } | |
| 739 | 767 | ||
| 740 | - | var xNewForAddressSyncDBusConnection func(string, DBusConnectionFlags, uintptr, uintptr) uintptr | |
| 768 | + | var xNewForAddressSyncDBusConnection func(string, DBusConnectionFlags, uintptr, uintptr, **glib.Error) uintptr | |
| 741 | 769 | ||
| 742 | 770 | // Synchronously connects and sets up a D-Bus client connection for | |
| 743 | 771 | // exchanging D-Bus messages with an endpoint specified by @address | |
| @@ -756,18 +784,25 @@ var xNewForAddressSyncDBusConnection func(string, DBusConnectionFlags, uintptr, | |||
| 756 | 784 | // | |
| 757 | 785 | // If @observer is not %NULL it may be used to control the | |
| 758 | 786 | // authentication process. | |
| 759 | - | func NewForAddressSyncDBusConnection(AddressVar string, FlagsVar DBusConnectionFlags, ObserverVar *DBusAuthObserver, CancellableVar *Cancellable) *DBusConnection { | |
| 760 | - | NewForAddressSyncDBusConnectionPtr := xNewForAddressSyncDBusConnection(AddressVar, FlagsVar, ObserverVar.GoPointer(), CancellableVar.GoPointer()) | |
| 761 | - | if NewForAddressSyncDBusConnectionPtr == 0 { | |
| 762 | - | return nil | |
| 787 | + | func NewForAddressSyncDBusConnection(AddressVar string, FlagsVar DBusConnectionFlags, ObserverVar *DBusAuthObserver, CancellableVar *Cancellable) (*DBusConnection, error) { | |
| 788 | + | var cls *DBusConnection | |
| 789 | + | var cerr *glib.Error | |
| 790 | + | ||
| 791 | + | cret := xNewForAddressSyncDBusConnection(AddressVar, FlagsVar, ObserverVar.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 792 | + | ||
| 793 | + | if cret == 0 { | |
| 794 | + | return cls, cerr | |
| 795 | + | } | |
| 796 | + | cls = &DBusConnection{} | |
| 797 | + | cls.Ptr = cret | |
| 798 | + | if cerr == nil { | |
| 799 | + | return cls, nil | |
| 763 | 800 | } | |
| 801 | + | return cls, cerr | |
| 764 | 802 | ||
| 765 | - | NewForAddressSyncDBusConnectionCls := &DBusConnection{} | |
| 766 | - | NewForAddressSyncDBusConnectionCls.Ptr = NewForAddressSyncDBusConnectionPtr | |
| 767 | - | return NewForAddressSyncDBusConnectionCls | |
| 768 | 803 | } | |
| 769 | 804 | ||
| 770 | - | var xNewSyncDBusConnection func(uintptr, string, DBusConnectionFlags, uintptr, uintptr) uintptr | |
| 805 | + | var xNewSyncDBusConnection func(uintptr, string, DBusConnectionFlags, uintptr, uintptr, **glib.Error) uintptr | |
| 771 | 806 | ||
| 772 | 807 | // Synchronously sets up a D-Bus connection for exchanging D-Bus messages | |
| 773 | 808 | // with the end represented by @stream. | |
| @@ -784,15 +819,22 @@ var xNewSyncDBusConnection func(uintptr, string, DBusConnectionFlags, uintptr, u | |||
| 784 | 819 | // | |
| 785 | 820 | // This is a synchronous failable constructor. See | |
| 786 | 821 | // g_dbus_connection_new() for the asynchronous version. | |
| 787 | - | func NewSyncDBusConnection(StreamVar *IOStream, GuidVar string, FlagsVar DBusConnectionFlags, ObserverVar *DBusAuthObserver, CancellableVar *Cancellable) *DBusConnection { | |
| 788 | - | NewSyncDBusConnectionPtr := xNewSyncDBusConnection(StreamVar.GoPointer(), GuidVar, FlagsVar, ObserverVar.GoPointer(), CancellableVar.GoPointer()) | |
| 789 | - | if NewSyncDBusConnectionPtr == 0 { | |
| 790 | - | return nil | |
| 822 | + | func NewSyncDBusConnection(StreamVar *IOStream, GuidVar string, FlagsVar DBusConnectionFlags, ObserverVar *DBusAuthObserver, CancellableVar *Cancellable) (*DBusConnection, error) { | |
| 823 | + | var cls *DBusConnection | |
| 824 | + | var cerr *glib.Error | |
| 825 | + | ||
| 826 | + | cret := xNewSyncDBusConnection(StreamVar.GoPointer(), GuidVar, FlagsVar, ObserverVar.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 827 | + | ||
| 828 | + | if cret == 0 { | |
| 829 | + | return cls, cerr | |
| 830 | + | } | |
| 831 | + | cls = &DBusConnection{} | |
| 832 | + | cls.Ptr = cret | |
| 833 | + | if cerr == nil { | |
| 834 | + | return cls, nil | |
| 791 | 835 | } | |
| 836 | + | return cls, cerr | |
| 792 | 837 | ||
| 793 | - | NewSyncDBusConnectionCls := &DBusConnection{} | |
| 794 | - | NewSyncDBusConnectionCls.Ptr = NewSyncDBusConnectionPtr | |
| 795 | - | return NewSyncDBusConnectionCls | |
| 796 | 838 | } | |
| 797 | 839 | ||
| 798 | 840 | var xDBusConnectionAddFilter func(uintptr, uintptr, uintptr, uintptr) uint | |
| @@ -826,8 +868,8 @@ var xDBusConnectionAddFilter func(uintptr, uintptr, uintptr, uintptr) uint | |||
| 826 | 868 | // destroyed.) | |
| 827 | 869 | func (x *DBusConnection) AddFilter(FilterFunctionVar DBusMessageFilterFunction, UserDataVar uintptr, UserDataFreeFuncVar glib.DestroyNotify) uint { | |
| 828 | 870 | ||
| 829 | - | return xDBusConnectionAddFilter(x.GoPointer(), purego.NewCallback(FilterFunctionVar), UserDataVar, purego.NewCallback(UserDataFreeFuncVar)) | |
| 830 | - | ||
| 871 | + | cret := xDBusConnectionAddFilter(x.GoPointer(), purego.NewCallback(FilterFunctionVar), UserDataVar, purego.NewCallback(UserDataFreeFuncVar)) | |
| 872 | + | return cret | |
| 831 | 873 | } | |
| 832 | 874 | ||
| 833 | 875 | var xDBusConnectionCall func(uintptr, string, string, string, string, *glib.Variant, *glib.VariantType, DBusCallFlags, int, uintptr, uintptr, uintptr) | |
| @@ -885,16 +927,21 @@ func (x *DBusConnection) Call(BusNameVar string, ObjectPathVar string, Interface | |||
| 885 | 927 | ||
| 886 | 928 | } | |
| 887 | 929 | ||
| 888 | - | var xDBusConnectionCallFinish func(uintptr, uintptr) *glib.Variant | |
| 930 | + | var xDBusConnectionCallFinish func(uintptr, uintptr, **glib.Error) *glib.Variant | |
| 889 | 931 | ||
| 890 | 932 | // Finishes an operation started with g_dbus_connection_call(). | |
| 891 | - | func (x *DBusConnection) CallFinish(ResVar AsyncResult) *glib.Variant { | |
| 933 | + | func (x *DBusConnection) CallFinish(ResVar AsyncResult) (*glib.Variant, error) { | |
| 934 | + | var cerr *glib.Error | |
| 892 | 935 | ||
| 893 | - | return xDBusConnectionCallFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 936 | + | cret := xDBusConnectionCallFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 937 | + | if cerr == nil { | |
| 938 | + | return cret, nil | |
| 939 | + | } | |
| 940 | + | return cret, cerr | |
| 894 | 941 | ||
| 895 | 942 | } | |
| 896 | 943 | ||
| 897 | - | var xDBusConnectionCallSync func(uintptr, string, string, string, string, *glib.Variant, *glib.VariantType, DBusCallFlags, int, uintptr) *glib.Variant | |
| 944 | + | var xDBusConnectionCallSync func(uintptr, string, string, string, string, *glib.Variant, *glib.VariantType, DBusCallFlags, int, uintptr, **glib.Error) *glib.Variant | |
| 898 | 945 | ||
| 899 | 946 | // Synchronously invokes the @method_name method on the | |
| 900 | 947 | // @interface_name D-Bus interface on the remote object at | |
| @@ -934,9 +981,14 @@ var xDBusConnectionCallSync func(uintptr, string, string, string, string, *glib. | |||
| 934 | 981 | // The calling thread is blocked until a reply is received. See | |
| 935 | 982 | // g_dbus_connection_call() for the asynchronous version of | |
| 936 | 983 | // this method. | |
| 937 | - | 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 { | |
| 984 | + | 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) { | |
| 985 | + | var cerr *glib.Error | |
| 938 | 986 | ||
| 939 | - | return xDBusConnectionCallSync(x.GoPointer(), BusNameVar, ObjectPathVar, InterfaceNameVar, MethodNameVar, ParametersVar, ReplyTypeVar, FlagsVar, TimeoutMsecVar, CancellableVar.GoPointer()) | |
| 987 | + | cret := xDBusConnectionCallSync(x.GoPointer(), BusNameVar, ObjectPathVar, InterfaceNameVar, MethodNameVar, ParametersVar, ReplyTypeVar, FlagsVar, TimeoutMsecVar, CancellableVar.GoPointer(), &cerr) | |
| 988 | + | if cerr == nil { | |
| 989 | + | return cret, nil | |
| 990 | + | } | |
| 991 | + | return cret, cerr | |
| 940 | 992 | ||
| 941 | 993 | } | |
| 942 | 994 | ||
| @@ -963,7 +1015,7 @@ func (x *DBusConnection) CallWithUnixFdList(BusNameVar string, ObjectPathVar str | |||
| 963 | 1015 | ||
| 964 | 1016 | } | |
| 965 | 1017 | ||
| 966 | - | var xDBusConnectionCallWithUnixFdListFinish func(uintptr, *uintptr, uintptr) *glib.Variant | |
| 1018 | + | var xDBusConnectionCallWithUnixFdListFinish func(uintptr, *uintptr, uintptr, **glib.Error) *glib.Variant | |
| 967 | 1019 | ||
| 968 | 1020 | // Finishes an operation started with g_dbus_connection_call_with_unix_fd_list(). | |
| 969 | 1021 | // | |
| @@ -977,22 +1029,32 @@ var xDBusConnectionCallWithUnixFdListFinish func(uintptr, *uintptr, uintptr) *gl | |||
| 977 | 1029 | // please note that non-GDBus implementations of D-Bus can usually only | |
| 978 | 1030 | // access file descriptors if they are referenced in this way by a | |
| 979 | 1031 | // value of type %G_VARIANT_TYPE_HANDLE in the body of the message. | |
| 980 | - | func (x *DBusConnection) CallWithUnixFdListFinish(OutFdListVar **UnixFDList, ResVar AsyncResult) *glib.Variant { | |
| 1032 | + | func (x *DBusConnection) CallWithUnixFdListFinish(OutFdListVar **UnixFDList, ResVar AsyncResult) (*glib.Variant, error) { | |
| 1033 | + | var cerr *glib.Error | |
| 981 | 1034 | ||
| 982 | - | return xDBusConnectionCallWithUnixFdListFinish(x.GoPointer(), gobject.ConvertPtr(OutFdListVar), ResVar.GoPointer()) | |
| 1035 | + | cret := xDBusConnectionCallWithUnixFdListFinish(x.GoPointer(), gobject.ConvertPtr(OutFdListVar), ResVar.GoPointer(), &cerr) | |
| 1036 | + | if cerr == nil { | |
| 1037 | + | return cret, nil | |
| 1038 | + | } | |
| 1039 | + | return cret, cerr | |
| 983 | 1040 | ||
| 984 | 1041 | } | |
| 985 | 1042 | ||
| 986 | - | var xDBusConnectionCallWithUnixFdListSync func(uintptr, string, string, string, string, *glib.Variant, *glib.VariantType, DBusCallFlags, int, uintptr, *uintptr, uintptr) *glib.Variant | |
| 1043 | + | var xDBusConnectionCallWithUnixFdListSync func(uintptr, string, string, string, string, *glib.Variant, *glib.VariantType, DBusCallFlags, int, uintptr, *uintptr, uintptr, **glib.Error) *glib.Variant | |
| 987 | 1044 | ||
| 988 | 1045 | // Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects. | |
| 989 | 1046 | // See g_dbus_connection_call_with_unix_fd_list() and | |
| 990 | 1047 | // g_dbus_connection_call_with_unix_fd_list_finish() for more details. | |
| 991 | 1048 | // | |
| 992 | 1049 | // This method is only available on UNIX. | |
| 993 | - | 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 { | |
| 1050 | + | 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) { | |
| 1051 | + | var cerr *glib.Error | |
| 994 | 1052 | ||
| 995 | - | return xDBusConnectionCallWithUnixFdListSync(x.GoPointer(), BusNameVar, ObjectPathVar, InterfaceNameVar, MethodNameVar, ParametersVar, ReplyTypeVar, FlagsVar, TimeoutMsecVar, FdListVar.GoPointer(), gobject.ConvertPtr(OutFdListVar), CancellableVar.GoPointer()) | |
| 1053 | + | cret := xDBusConnectionCallWithUnixFdListSync(x.GoPointer(), BusNameVar, ObjectPathVar, InterfaceNameVar, MethodNameVar, ParametersVar, ReplyTypeVar, FlagsVar, TimeoutMsecVar, FdListVar.GoPointer(), gobject.ConvertPtr(OutFdListVar), CancellableVar.GoPointer(), &cerr) | |
| 1054 | + | if cerr == nil { | |
| 1055 | + | return cret, nil | |
| 1056 | + | } | |
| 1057 | + | return cret, cerr | |
| 996 | 1058 | ||
| 997 | 1059 | } | |
| 998 | 1060 | ||
| @@ -1028,28 +1090,38 @@ func (x *DBusConnection) Close(CancellableVar *Cancellable, CallbackVar AsyncRea | |||
| 1028 | 1090 | ||
| 1029 | 1091 | } | |
| 1030 | 1092 | ||
| 1031 | - | var xDBusConnectionCloseFinish func(uintptr, uintptr) bool | |
| 1093 | + | var xDBusConnectionCloseFinish func(uintptr, uintptr, **glib.Error) bool | |
| 1032 | 1094 | ||
| 1033 | 1095 | // Finishes an operation started with g_dbus_connection_close(). | |
| 1034 | - | func (x *DBusConnection) CloseFinish(ResVar AsyncResult) bool { | |
| 1096 | + | func (x *DBusConnection) CloseFinish(ResVar AsyncResult) (bool, error) { | |
| 1097 | + | var cerr *glib.Error | |
| 1035 | 1098 | ||
| 1036 | - | return xDBusConnectionCloseFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 1099 | + | cret := xDBusConnectionCloseFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 1100 | + | if cerr == nil { | |
| 1101 | + | return cret, nil | |
| 1102 | + | } | |
| 1103 | + | return cret, cerr | |
| 1037 | 1104 | ||
| 1038 | 1105 | } | |
| 1039 | 1106 | ||
| 1040 | - | var xDBusConnectionCloseSync func(uintptr, uintptr) bool | |
| 1107 | + | var xDBusConnectionCloseSync func(uintptr, uintptr, **glib.Error) bool | |
| 1041 | 1108 | ||
| 1042 | 1109 | // Synchronously closes @connection. The calling thread is blocked | |
| 1043 | 1110 | // until this is done. See g_dbus_connection_close() for the | |
| 1044 | 1111 | // asynchronous version of this method and more details about what it | |
| 1045 | 1112 | // does. | |
| 1046 | - | func (x *DBusConnection) CloseSync(CancellableVar *Cancellable) bool { | |
| 1113 | + | func (x *DBusConnection) CloseSync(CancellableVar *Cancellable) (bool, error) { | |
| 1114 | + | var cerr *glib.Error | |
| 1047 | 1115 | ||
| 1048 | - | return xDBusConnectionCloseSync(x.GoPointer(), CancellableVar.GoPointer()) | |
| 1116 | + | cret := xDBusConnectionCloseSync(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 1117 | + | if cerr == nil { | |
| 1118 | + | return cret, nil | |
| 1119 | + | } | |
| 1120 | + | return cret, cerr | |
| 1049 | 1121 | ||
| 1050 | 1122 | } | |
| 1051 | 1123 | ||
| 1052 | - | var xDBusConnectionEmitSignal func(uintptr, string, string, string, string, *glib.Variant) bool | |
| 1124 | + | var xDBusConnectionEmitSignal func(uintptr, string, string, string, string, *glib.Variant, **glib.Error) bool | |
| 1053 | 1125 | ||
| 1054 | 1126 | // Emits a signal. | |
| 1055 | 1127 | // | |
| @@ -1058,13 +1130,18 @@ var xDBusConnectionEmitSignal func(uintptr, string, string, string, string, *gli | |||
| 1058 | 1130 | // This can only fail if @parameters is not compatible with the D-Bus protocol | |
| 1059 | 1131 | // (%G_IO_ERROR_INVALID_ARGUMENT), or if @connection has been closed | |
| 1060 | 1132 | // (%G_IO_ERROR_CLOSED). | |
| 1061 | - | func (x *DBusConnection) EmitSignal(DestinationBusNameVar string, ObjectPathVar string, InterfaceNameVar string, SignalNameVar string, ParametersVar *glib.Variant) bool { | |
| 1133 | + | func (x *DBusConnection) EmitSignal(DestinationBusNameVar string, ObjectPathVar string, InterfaceNameVar string, SignalNameVar string, ParametersVar *glib.Variant) (bool, error) { | |
| 1134 | + | var cerr *glib.Error | |
| 1062 | 1135 | ||
| 1063 | - | return xDBusConnectionEmitSignal(x.GoPointer(), DestinationBusNameVar, ObjectPathVar, InterfaceNameVar, SignalNameVar, ParametersVar) | |
| 1136 | + | cret := xDBusConnectionEmitSignal(x.GoPointer(), DestinationBusNameVar, ObjectPathVar, InterfaceNameVar, SignalNameVar, ParametersVar, &cerr) | |
| 1137 | + | if cerr == nil { | |
| 1138 | + | return cret, nil | |
| 1139 | + | } | |
| 1140 | + | return cret, cerr | |
| 1064 | 1141 | ||
| 1065 | 1142 | } | |
| 1066 | 1143 | ||
| 1067 | - | var xDBusConnectionExportActionGroup func(uintptr, string, uintptr) uint | |
| 1144 | + | var xDBusConnectionExportActionGroup func(uintptr, string, uintptr, **glib.Error) uint | |
| 1068 | 1145 | ||
| 1069 | 1146 | // Exports @action_group on @connection at @object_path. | |
| 1070 | 1147 | // | |
| @@ -1087,13 +1164,18 @@ var xDBusConnectionExportActionGroup func(uintptr, string, uintptr) uint | |||
| 1087 | 1164 | // rather likely to cause changes on the action group, this effectively | |
| 1088 | 1165 | // limits a given action group to being exported from only one main | |
| 1089 | 1166 | // context. | |
| 1090 | - | func (x *DBusConnection) ExportActionGroup(ObjectPathVar string, ActionGroupVar ActionGroup) uint { | |
| 1167 | + | func (x *DBusConnection) ExportActionGroup(ObjectPathVar string, ActionGroupVar ActionGroup) (uint, error) { | |
| 1168 | + | var cerr *glib.Error | |
| 1091 | 1169 | ||
| 1092 | - | return xDBusConnectionExportActionGroup(x.GoPointer(), ObjectPathVar, ActionGroupVar.GoPointer()) | |
| 1170 | + | cret := xDBusConnectionExportActionGroup(x.GoPointer(), ObjectPathVar, ActionGroupVar.GoPointer(), &cerr) | |
| 1171 | + | if cerr == nil { | |
| 1172 | + | return cret, nil | |
| 1173 | + | } | |
| 1174 | + | return cret, cerr | |
| 1093 | 1175 | ||
| 1094 | 1176 | } | |
| 1095 | 1177 | ||
| 1096 | - | var xDBusConnectionExportMenuModel func(uintptr, string, uintptr) uint | |
| 1178 | + | var xDBusConnectionExportMenuModel func(uintptr, string, uintptr, **glib.Error) uint | |
| 1097 | 1179 | ||
| 1098 | 1180 | // Exports @menu on @connection at @object_path. | |
| 1099 | 1181 | // | |
| @@ -1107,9 +1189,14 @@ var xDBusConnectionExportMenuModel func(uintptr, string, uintptr) uint | |||
| 1107 | 1189 | // You can unexport the menu model using | |
| 1108 | 1190 | // g_dbus_connection_unexport_menu_model() with the return value of | |
| 1109 | 1191 | // this function. | |
| 1110 | - | func (x *DBusConnection) ExportMenuModel(ObjectPathVar string, MenuVar *MenuModel) uint { | |
| 1192 | + | func (x *DBusConnection) ExportMenuModel(ObjectPathVar string, MenuVar *MenuModel) (uint, error) { | |
| 1193 | + | var cerr *glib.Error | |
| 1111 | 1194 | ||
| 1112 | - | return xDBusConnectionExportMenuModel(x.GoPointer(), ObjectPathVar, MenuVar.GoPointer()) | |
| 1195 | + | cret := xDBusConnectionExportMenuModel(x.GoPointer(), ObjectPathVar, MenuVar.GoPointer(), &cerr) | |
| 1196 | + | if cerr == nil { | |
| 1197 | + | return cret, nil | |
| 1198 | + | } | |
| 1199 | + | return cret, cerr | |
| 1113 | 1200 | ||
| 1114 | 1201 | } | |
| 1115 | 1202 | ||
| @@ -1135,24 +1222,34 @@ func (x *DBusConnection) Flush(CancellableVar *Cancellable, CallbackVar AsyncRea | |||
| 1135 | 1222 | ||
| 1136 | 1223 | } | |
| 1137 | 1224 | ||
| 1138 | - | var xDBusConnectionFlushFinish func(uintptr, uintptr) bool | |
| 1225 | + | var xDBusConnectionFlushFinish func(uintptr, uintptr, **glib.Error) bool | |
| 1139 | 1226 | ||
| 1140 | 1227 | // Finishes an operation started with g_dbus_connection_flush(). | |
| 1141 | - | func (x *DBusConnection) FlushFinish(ResVar AsyncResult) bool { | |
| 1228 | + | func (x *DBusConnection) FlushFinish(ResVar AsyncResult) (bool, error) { | |
| 1229 | + | var cerr *glib.Error | |
| 1142 | 1230 | ||
| 1143 | - | return xDBusConnectionFlushFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 1231 | + | cret := xDBusConnectionFlushFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 1232 | + | if cerr == nil { | |
| 1233 | + | return cret, nil | |
| 1234 | + | } | |
| 1235 | + | return cret, cerr | |
| 1144 | 1236 | ||
| 1145 | 1237 | } | |
| 1146 | 1238 | ||
| 1147 | - | var xDBusConnectionFlushSync func(uintptr, uintptr) bool | |
| 1239 | + | var xDBusConnectionFlushSync func(uintptr, uintptr, **glib.Error) bool | |
| 1148 | 1240 | ||
| 1149 | 1241 | // Synchronously flushes @connection. The calling thread is blocked | |
| 1150 | 1242 | // until this is done. See g_dbus_connection_flush() for the | |
| 1151 | 1243 | // asynchronous version of this method and more details about what it | |
| 1152 | 1244 | // does. | |
| 1153 | - | func (x *DBusConnection) FlushSync(CancellableVar *Cancellable) bool { | |
| 1245 | + | func (x *DBusConnection) FlushSync(CancellableVar *Cancellable) (bool, error) { | |
| 1246 | + | var cerr *glib.Error | |
| 1154 | 1247 | ||
| 1155 | - | return xDBusConnectionFlushSync(x.GoPointer(), CancellableVar.GoPointer()) | |
| 1248 | + | cret := xDBusConnectionFlushSync(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 1249 | + | if cerr == nil { | |
| 1250 | + | return cret, nil | |
| 1251 | + | } | |
| 1252 | + | return cret, cerr | |
| 1156 | 1253 | ||
| 1157 | 1254 | } | |
| 1158 | 1255 | ||
| @@ -1161,8 +1258,8 @@ var xDBusConnectionGetCapabilities func(uintptr) DBusCapabilityFlags | |||
| 1161 | 1258 | // Gets the capabilities negotiated with the remote peer | |
| 1162 | 1259 | func (x *DBusConnection) GetCapabilities() DBusCapabilityFlags { | |
| 1163 | 1260 | ||
| 1164 | - | return xDBusConnectionGetCapabilities(x.GoPointer()) | |
| 1165 | - | ||
| 1261 | + | cret := xDBusConnectionGetCapabilities(x.GoPointer()) | |
| 1262 | + | return cret | |
| 1166 | 1263 | } | |
| 1167 | 1264 | ||
| 1168 | 1265 | var xDBusConnectionGetExitOnClose func(uintptr) bool | |
| @@ -1172,8 +1269,8 @@ var xDBusConnectionGetExitOnClose func(uintptr) bool | |||
| 1172 | 1269 | // #GDBusConnection:exit-on-close for more details. | |
| 1173 | 1270 | func (x *DBusConnection) GetExitOnClose() bool { | |
| 1174 | 1271 | ||
| 1175 | - | return xDBusConnectionGetExitOnClose(x.GoPointer()) | |
| 1176 | - | ||
| 1272 | + | cret := xDBusConnectionGetExitOnClose(x.GoPointer()) | |
| 1273 | + | return cret | |
| 1177 | 1274 | } | |
| 1178 | 1275 | ||
| 1179 | 1276 | var xDBusConnectionGetFlags func(uintptr) DBusConnectionFlags | |
| @@ -1181,8 +1278,8 @@ var xDBusConnectionGetFlags func(uintptr) DBusConnectionFlags | |||
| 1181 | 1278 | // Gets the flags used to construct this connection | |
| 1182 | 1279 | func (x *DBusConnection) GetFlags() DBusConnectionFlags { | |
| 1183 | 1280 | ||
| 1184 | - | return xDBusConnectionGetFlags(x.GoPointer()) | |
| 1185 | - | ||
| 1281 | + | cret := xDBusConnectionGetFlags(x.GoPointer()) | |
| 1282 | + | return cret | |
| 1186 | 1283 | } | |
| 1187 | 1284 | ||
| 1188 | 1285 | var xDBusConnectionGetGuid func(uintptr) string | |
| @@ -1191,8 +1288,8 @@ var xDBusConnectionGetGuid func(uintptr) string | |||
| 1191 | 1288 | // authenticating. See #GDBusConnection:guid for more details. | |
| 1192 | 1289 | func (x *DBusConnection) GetGuid() string { | |
| 1193 | 1290 | ||
| 1194 | - | return xDBusConnectionGetGuid(x.GoPointer()) | |
| 1195 | - | ||
| 1291 | + | cret := xDBusConnectionGetGuid(x.GoPointer()) | |
| 1292 | + | return cret | |
| 1196 | 1293 | } | |
| 1197 | 1294 | ||
| 1198 | 1295 | var xDBusConnectionGetLastSerial func(uintptr) uint32 | |
| @@ -1204,8 +1301,8 @@ var xDBusConnectionGetLastSerial func(uintptr) uint32 | |||
| 1204 | 1301 | // g_dbus_connection_call() or g_dbus_proxy_call(). | |
| 1205 | 1302 | func (x *DBusConnection) GetLastSerial() uint32 { | |
| 1206 | 1303 | ||
| 1207 | - | return xDBusConnectionGetLastSerial(x.GoPointer()) | |
| 1208 | - | ||
| 1304 | + | cret := xDBusConnectionGetLastSerial(x.GoPointer()) | |
| 1305 | + | return cret | |
| 1209 | 1306 | } | |
| 1210 | 1307 | ||
| 1211 | 1308 | var xDBusConnectionGetPeerCredentials func(uintptr) uintptr | |
| @@ -1220,18 +1317,17 @@ var xDBusConnectionGetPeerCredentials func(uintptr) uintptr | |||
| 1220 | 1317 | // each application is a client. So this method will always return | |
| 1221 | 1318 | // %NULL for message bus clients. | |
| 1222 | 1319 | func (x *DBusConnection) GetPeerCredentials() *Credentials { | |
| 1320 | + | var cls *Credentials | |
| 1223 | 1321 | ||
| 1224 | - | GetPeerCredentialsPtr := xDBusConnectionGetPeerCredentials(x.GoPointer()) | |
| 1225 | - | if GetPeerCredentialsPtr == 0 { | |
| 1226 | - | return nil | |
| 1227 | - | } | |
| 1228 | - | ||
| 1229 | - | gobject.IncreaseRef(GetPeerCredentialsPtr) | |
| 1230 | - | ||
| 1231 | - | GetPeerCredentialsCls := &Credentials{} | |
| 1232 | - | GetPeerCredentialsCls.Ptr = GetPeerCredentialsPtr | |
| 1233 | - | return GetPeerCredentialsCls | |
| 1322 | + | cret := xDBusConnectionGetPeerCredentials(x.GoPointer()) | |
| 1234 | 1323 | ||
| 1324 | + | if cret == 0 { | |
| 1325 | + | return cls | |
| 1326 | + | } | |
| 1327 | + | gobject.IncreaseRef(cret) | |
| 1328 | + | cls = &Credentials{} | |
| 1329 | + | cls.Ptr = cret | |
| 1330 | + | return cls | |
| 1235 | 1331 | } | |
| 1236 | 1332 | ||
| 1237 | 1333 | var xDBusConnectionGetStream func(uintptr) uintptr | |
| @@ -1242,18 +1338,17 @@ var xDBusConnectionGetStream func(uintptr) uintptr | |||
| 1242 | 1338 | // stream from a worker thread, so it is not safe to interact with | |
| 1243 | 1339 | // the stream directly. | |
| 1244 | 1340 | func (x *DBusConnection) GetStream() *IOStream { | |
| 1341 | + | var cls *IOStream | |
| 1245 | 1342 | ||
| 1246 | - | GetStreamPtr := xDBusConnectionGetStream(x.GoPointer()) | |
| 1247 | - | if GetStreamPtr == 0 { | |
| 1248 | - | return nil | |
| 1249 | - | } | |
| 1250 | - | ||
| 1251 | - | gobject.IncreaseRef(GetStreamPtr) | |
| 1252 | - | ||
| 1253 | - | GetStreamCls := &IOStream{} | |
| 1254 | - | GetStreamCls.Ptr = GetStreamPtr | |
| 1255 | - | return GetStreamCls | |
| 1343 | + | cret := xDBusConnectionGetStream(x.GoPointer()) | |
| 1256 | 1344 | ||
| 1345 | + | if cret == 0 { | |
| 1346 | + | return cls | |
| 1347 | + | } | |
| 1348 | + | gobject.IncreaseRef(cret) | |
| 1349 | + | cls = &IOStream{} | |
| 1350 | + | cls.Ptr = cret | |
| 1351 | + | return cls | |
| 1257 | 1352 | } | |
| 1258 | 1353 | ||
| 1259 | 1354 | var xDBusConnectionGetUniqueName func(uintptr) string | |
| @@ -1263,8 +1358,8 @@ var xDBusConnectionGetUniqueName func(uintptr) string | |||
| 1263 | 1358 | // message bus connection. | |
| 1264 | 1359 | func (x *DBusConnection) GetUniqueName() string { | |
| 1265 | 1360 | ||
| 1266 | - | return xDBusConnectionGetUniqueName(x.GoPointer()) | |
| 1267 | - | ||
| 1361 | + | cret := xDBusConnectionGetUniqueName(x.GoPointer()) | |
| 1362 | + | return cret | |
| 1268 | 1363 | } | |
| 1269 | 1364 | ||
| 1270 | 1365 | var xDBusConnectionIsClosed func(uintptr) bool | |
| @@ -1272,11 +1367,11 @@ var xDBusConnectionIsClosed func(uintptr) bool | |||
| 1272 | 1367 | // Gets whether @connection is closed. | |
| 1273 | 1368 | func (x *DBusConnection) IsClosed() bool { | |
| 1274 | 1369 | ||
| 1275 | - | return xDBusConnectionIsClosed(x.GoPointer()) | |
| 1276 | - | ||
| 1370 | + | cret := xDBusConnectionIsClosed(x.GoPointer()) | |
| 1371 | + | return cret | |
| 1277 | 1372 | } | |
| 1278 | 1373 | ||
| 1279 | - | var xDBusConnectionRegisterObject func(uintptr, string, *DBusInterfaceInfo, *DBusInterfaceVTable, uintptr, uintptr) uint | |
| 1374 | + | var xDBusConnectionRegisterObject func(uintptr, string, *DBusInterfaceInfo, *DBusInterfaceVTable, uintptr, uintptr, **glib.Error) uint | |
| 1280 | 1375 | ||
| 1281 | 1376 | // Registers callbacks for exported objects at @object_path with the | |
| 1282 | 1377 | // D-Bus interface that is described in @interface_info. | |
| @@ -1316,23 +1411,33 @@ var xDBusConnectionRegisterObject func(uintptr, string, *DBusInterfaceInfo, *DBu | |||
| 1316 | 1411 | // as the object is exported. Also note that @vtable will be copied. | |
| 1317 | 1412 | // | |
| 1318 | 1413 | // See this [server][gdbus-server] for an example of how to use this method. | |
| 1319 | - | func (x *DBusConnection) RegisterObject(ObjectPathVar string, InterfaceInfoVar *DBusInterfaceInfo, VtableVar *DBusInterfaceVTable, UserDataVar uintptr, UserDataFreeFuncVar glib.DestroyNotify) uint { | |
| 1414 | + | func (x *DBusConnection) RegisterObject(ObjectPathVar string, InterfaceInfoVar *DBusInterfaceInfo, VtableVar *DBusInterfaceVTable, UserDataVar uintptr, UserDataFreeFuncVar glib.DestroyNotify) (uint, error) { | |
| 1415 | + | var cerr *glib.Error | |
| 1320 | 1416 | ||
| 1321 | - | return xDBusConnectionRegisterObject(x.GoPointer(), ObjectPathVar, InterfaceInfoVar, VtableVar, UserDataVar, purego.NewCallback(UserDataFreeFuncVar)) | |
| 1417 | + | cret := xDBusConnectionRegisterObject(x.GoPointer(), ObjectPathVar, InterfaceInfoVar, VtableVar, UserDataVar, purego.NewCallback(UserDataFreeFuncVar), &cerr) | |
| 1418 | + | if cerr == nil { | |
| 1419 | + | return cret, nil | |
| 1420 | + | } | |
| 1421 | + | return cret, cerr | |
| 1322 | 1422 | ||
| 1323 | 1423 | } | |
| 1324 | 1424 | ||
| 1325 | - | var xDBusConnectionRegisterObjectWithClosures func(uintptr, string, *DBusInterfaceInfo, *gobject.Closure, *gobject.Closure, *gobject.Closure) uint | |
| 1425 | + | var xDBusConnectionRegisterObjectWithClosures func(uintptr, string, *DBusInterfaceInfo, *gobject.Closure, *gobject.Closure, *gobject.Closure, **glib.Error) uint | |
| 1326 | 1426 | ||
| 1327 | 1427 | // Version of g_dbus_connection_register_object() using closures instead of a | |
| 1328 | 1428 | // #GDBusInterfaceVTable for easier binding in other languages. | |
| 1329 | - | func (x *DBusConnection) RegisterObjectWithClosures(ObjectPathVar string, InterfaceInfoVar *DBusInterfaceInfo, MethodCallClosureVar *gobject.Closure, GetPropertyClosureVar *gobject.Closure, SetPropertyClosureVar *gobject.Closure) uint { | |
| 1429 | + | func (x *DBusConnection) RegisterObjectWithClosures(ObjectPathVar string, InterfaceInfoVar *DBusInterfaceInfo, MethodCallClosureVar *gobject.Closure, GetPropertyClosureVar *gobject.Closure, SetPropertyClosureVar *gobject.Closure) (uint, error) { | |
| 1430 | + | var cerr *glib.Error | |
| 1330 | 1431 | ||
| 1331 | - | return xDBusConnectionRegisterObjectWithClosures(x.GoPointer(), ObjectPathVar, InterfaceInfoVar, MethodCallClosureVar, GetPropertyClosureVar, SetPropertyClosureVar) | |
| 1432 | + | cret := xDBusConnectionRegisterObjectWithClosures(x.GoPointer(), ObjectPathVar, InterfaceInfoVar, MethodCallClosureVar, GetPropertyClosureVar, SetPropertyClosureVar, &cerr) | |
| 1433 | + | if cerr == nil { | |
| 1434 | + | return cret, nil | |
| 1435 | + | } | |
| 1436 | + | return cret, cerr | |
| 1332 | 1437 | ||
| 1333 | 1438 | } | |
| 1334 | 1439 | ||
| 1335 | - | var xDBusConnectionRegisterSubtree func(uintptr, string, *DBusSubtreeVTable, DBusSubtreeFlags, uintptr, uintptr) uint | |
| 1440 | + | var xDBusConnectionRegisterSubtree func(uintptr, string, *DBusSubtreeVTable, DBusSubtreeFlags, uintptr, uintptr, **glib.Error) uint | |
| 1336 | 1441 | ||
| 1337 | 1442 | // Registers a whole subtree of dynamic objects. | |
| 1338 | 1443 | // | |
| @@ -1368,9 +1473,14 @@ var xDBusConnectionRegisterSubtree func(uintptr, string, *DBusSubtreeVTable, DBu | |||
| 1368 | 1473 | // | |
| 1369 | 1474 | // See this [server][gdbus-subtree-server] for an example of how to use | |
| 1370 | 1475 | // this method. | |
| 1371 | - | func (x *DBusConnection) RegisterSubtree(ObjectPathVar string, VtableVar *DBusSubtreeVTable, FlagsVar DBusSubtreeFlags, UserDataVar uintptr, UserDataFreeFuncVar glib.DestroyNotify) uint { | |
| 1476 | + | func (x *DBusConnection) RegisterSubtree(ObjectPathVar string, VtableVar *DBusSubtreeVTable, FlagsVar DBusSubtreeFlags, UserDataVar uintptr, UserDataFreeFuncVar glib.DestroyNotify) (uint, error) { | |
| 1477 | + | var cerr *glib.Error | |
| 1372 | 1478 | ||
| 1373 | - | return xDBusConnectionRegisterSubtree(x.GoPointer(), ObjectPathVar, VtableVar, FlagsVar, UserDataVar, purego.NewCallback(UserDataFreeFuncVar)) | |
| 1479 | + | cret := xDBusConnectionRegisterSubtree(x.GoPointer(), ObjectPathVar, VtableVar, FlagsVar, UserDataVar, purego.NewCallback(UserDataFreeFuncVar), &cerr) | |
| 1480 | + | if cerr == nil { | |
| 1481 | + | return cret, nil | |
| 1482 | + | } | |
| 1483 | + | return cret, cerr | |
| 1374 | 1484 | ||
| 1375 | 1485 | } | |
| 1376 | 1486 | ||
| @@ -1390,7 +1500,7 @@ func (x *DBusConnection) RemoveFilter(FilterIdVar uint) { | |||
| 1390 | 1500 | ||
| 1391 | 1501 | } | |
| 1392 | 1502 | ||
| 1393 | - | var xDBusConnectionSendMessage func(uintptr, uintptr, DBusSendMessageFlags, uint32) bool | |
| 1503 | + | var xDBusConnectionSendMessage func(uintptr, uintptr, DBusSendMessageFlags, uint32, **glib.Error) bool | |
| 1394 | 1504 | ||
| 1395 | 1505 | // Asynchronously sends @message to the peer represented by @connection. | |
| 1396 | 1506 | // | |
| @@ -1413,9 +1523,14 @@ var xDBusConnectionSendMessage func(uintptr, uintptr, DBusSendMessageFlags, uint | |||
| 1413 | 1523 | // | |
| 1414 | 1524 | // Note that @message must be unlocked, unless @flags contain the | |
| 1415 | 1525 | // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag. | |
| 1416 | - | func (x *DBusConnection) SendMessage(MessageVar *DBusMessage, FlagsVar DBusSendMessageFlags, OutSerialVar uint32) bool { | |
| 1526 | + | func (x *DBusConnection) SendMessage(MessageVar *DBusMessage, FlagsVar DBusSendMessageFlags, OutSerialVar uint32) (bool, error) { | |
| 1527 | + | var cerr *glib.Error | |
| 1417 | 1528 | ||
| 1418 | - | return xDBusConnectionSendMessage(x.GoPointer(), MessageVar.GoPointer(), FlagsVar, OutSerialVar) | |
| 1529 | + | cret := xDBusConnectionSendMessage(x.GoPointer(), MessageVar.GoPointer(), FlagsVar, OutSerialVar, &cerr) | |
| 1530 | + | if cerr == nil { | |
| 1531 | + | return cret, nil | |
| 1532 | + | } | |
| 1533 | + | return cret, cerr | |
| 1419 | 1534 | ||
| 1420 | 1535 | } | |
| 1421 | 1536 | ||
| @@ -1456,7 +1571,7 @@ func (x *DBusConnection) SendMessageWithReply(MessageVar *DBusMessage, FlagsVar | |||
| 1456 | 1571 | ||
| 1457 | 1572 | } | |
| 1458 | 1573 | ||
| 1459 | - | var xDBusConnectionSendMessageWithReplyFinish func(uintptr, uintptr) uintptr | |
| 1574 | + | var xDBusConnectionSendMessageWithReplyFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 1460 | 1575 | ||
| 1461 | 1576 | // Finishes an operation started with g_dbus_connection_send_message_with_reply(). | |
| 1462 | 1577 | // | |
| @@ -1468,20 +1583,25 @@ var xDBusConnectionSendMessageWithReplyFinish func(uintptr, uintptr) uintptr | |||
| 1468 | 1583 | // See this [server][gdbus-server] and [client][gdbus-unix-fd-client] | |
| 1469 | 1584 | // for an example of how to use this low-level API to send and receive | |
| 1470 | 1585 | // UNIX file descriptors. | |
| 1471 | - | func (x *DBusConnection) SendMessageWithReplyFinish(ResVar AsyncResult) *DBusMessage { | |
| 1586 | + | func (x *DBusConnection) SendMessageWithReplyFinish(ResVar AsyncResult) (*DBusMessage, error) { | |
| 1587 | + | var cls *DBusMessage | |
| 1588 | + | var cerr *glib.Error | |
| 1472 | 1589 | ||
| 1473 | - | SendMessageWithReplyFinishPtr := xDBusConnectionSendMessageWithReplyFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 1474 | - | if SendMessageWithReplyFinishPtr == 0 { | |
| 1475 | - | return nil | |
| 1476 | - | } | |
| 1590 | + | cret := xDBusConnectionSendMessageWithReplyFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 1477 | 1591 | ||
| 1478 | - | SendMessageWithReplyFinishCls := &DBusMessage{} | |
| 1479 | - | SendMessageWithReplyFinishCls.Ptr = SendMessageWithReplyFinishPtr | |
| 1480 | - | return SendMessageWithReplyFinishCls | |
| 1592 | + | if cret == 0 { | |
| 1593 | + | return cls, cerr | |
| 1594 | + | } | |
| 1595 | + | cls = &DBusMessage{} | |
| 1596 | + | cls.Ptr = cret | |
| 1597 | + | if cerr == nil { | |
| 1598 | + | return cls, nil | |
| 1599 | + | } | |
| 1600 | + | return cls, cerr | |
| 1481 | 1601 | ||
| 1482 | 1602 | } | |
| 1483 | 1603 | ||
| 1484 | - | var xDBusConnectionSendMessageWithReplySync func(uintptr, uintptr, DBusSendMessageFlags, int, uint32, uintptr) uintptr | |
| 1604 | + | var xDBusConnectionSendMessageWithReplySync func(uintptr, uintptr, DBusSendMessageFlags, int, uint32, uintptr, **glib.Error) uintptr | |
| 1485 | 1605 | ||
| 1486 | 1606 | // Synchronously sends @message to the peer represented by @connection | |
| 1487 | 1607 | // and blocks the calling thread until a reply is received or the | |
| @@ -1513,16 +1633,21 @@ var xDBusConnectionSendMessageWithReplySync func(uintptr, uintptr, DBusSendMessa | |||
| 1513 | 1633 | // | |
| 1514 | 1634 | // Note that @message must be unlocked, unless @flags contain the | |
| 1515 | 1635 | // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag. | |
| 1516 | - | func (x *DBusConnection) SendMessageWithReplySync(MessageVar *DBusMessage, FlagsVar DBusSendMessageFlags, TimeoutMsecVar int, OutSerialVar uint32, CancellableVar *Cancellable) *DBusMessage { | |
| 1636 | + | func (x *DBusConnection) SendMessageWithReplySync(MessageVar *DBusMessage, FlagsVar DBusSendMessageFlags, TimeoutMsecVar int, OutSerialVar uint32, CancellableVar *Cancellable) (*DBusMessage, error) { | |
| 1637 | + | var cls *DBusMessage | |
| 1638 | + | var cerr *glib.Error | |
| 1517 | 1639 | ||
| 1518 | - | SendMessageWithReplySyncPtr := xDBusConnectionSendMessageWithReplySync(x.GoPointer(), MessageVar.GoPointer(), FlagsVar, TimeoutMsecVar, OutSerialVar, CancellableVar.GoPointer()) | |
| 1519 | - | if SendMessageWithReplySyncPtr == 0 { | |
| 1520 | - | return nil | |
| 1521 | - | } | |
| 1640 | + | cret := xDBusConnectionSendMessageWithReplySync(x.GoPointer(), MessageVar.GoPointer(), FlagsVar, TimeoutMsecVar, OutSerialVar, CancellableVar.GoPointer(), &cerr) | |
| 1522 | 1641 | ||
| 1523 | - | SendMessageWithReplySyncCls := &DBusMessage{} | |
| 1524 | - | SendMessageWithReplySyncCls.Ptr = SendMessageWithReplySyncPtr | |
| 1525 | - | return SendMessageWithReplySyncCls | |
| 1642 | + | if cret == 0 { | |
| 1643 | + | return cls, cerr | |
| 1644 | + | } | |
| 1645 | + | cls = &DBusMessage{} | |
| 1646 | + | cls.Ptr = cret | |
| 1647 | + | if cerr == nil { | |
| 1648 | + | return cls, nil | |
| 1649 | + | } | |
| 1650 | + | return cls, cerr | |
| 1526 | 1651 | ||
| 1527 | 1652 | } | |
| 1528 | 1653 | ||
| @@ -1597,8 +1722,8 @@ var xDBusConnectionSignalSubscribe func(uintptr, string, string, string, string, | |||
| 1597 | 1722 | // This function can never fail. | |
| 1598 | 1723 | func (x *DBusConnection) SignalSubscribe(SenderVar string, InterfaceNameVar string, MemberVar string, ObjectPathVar string, Arg0Var string, FlagsVar DBusSignalFlags, CallbackVar DBusSignalCallback, UserDataVar uintptr, UserDataFreeFuncVar glib.DestroyNotify) uint { | |
| 1599 | 1724 | ||
| 1600 | - | return xDBusConnectionSignalSubscribe(x.GoPointer(), SenderVar, InterfaceNameVar, MemberVar, ObjectPathVar, Arg0Var, FlagsVar, purego.NewCallback(CallbackVar), UserDataVar, purego.NewCallback(UserDataFreeFuncVar)) | |
| 1601 | - | ||
| 1725 | + | cret := xDBusConnectionSignalSubscribe(x.GoPointer(), SenderVar, InterfaceNameVar, MemberVar, ObjectPathVar, Arg0Var, FlagsVar, purego.NewCallback(CallbackVar), UserDataVar, purego.NewCallback(UserDataFreeFuncVar)) | |
| 1726 | + | return cret | |
| 1602 | 1727 | } | |
| 1603 | 1728 | ||
| 1604 | 1729 | var xDBusConnectionSignalUnsubscribe func(uintptr, uint) | |
| @@ -1666,8 +1791,8 @@ var xDBusConnectionUnregisterObject func(uintptr, uint) bool | |||
| 1666 | 1791 | // Unregisters an object. | |
| 1667 | 1792 | func (x *DBusConnection) UnregisterObject(RegistrationIdVar uint) bool { | |
| 1668 | 1793 | ||
| 1669 | - | return xDBusConnectionUnregisterObject(x.GoPointer(), RegistrationIdVar) | |
| 1670 | - | ||
| 1794 | + | cret := xDBusConnectionUnregisterObject(x.GoPointer(), RegistrationIdVar) | |
| 1795 | + | return cret | |
| 1671 | 1796 | } | |
| 1672 | 1797 | ||
| 1673 | 1798 | var xDBusConnectionUnregisterSubtree func(uintptr, uint) bool | |
| @@ -1675,8 +1800,8 @@ var xDBusConnectionUnregisterSubtree func(uintptr, uint) bool | |||
| 1675 | 1800 | // Unregisters a subtree. | |
| 1676 | 1801 | func (x *DBusConnection) UnregisterSubtree(RegistrationIdVar uint) bool { | |
| 1677 | 1802 | ||
| 1678 | - | return xDBusConnectionUnregisterSubtree(x.GoPointer(), RegistrationIdVar) | |
| 1679 | - | ||
| 1803 | + | cret := xDBusConnectionUnregisterSubtree(x.GoPointer(), RegistrationIdVar) | |
| 1804 | + | return cret | |
| 1680 | 1805 | } | |
| 1681 | 1806 | ||
| 1682 | 1807 | func (c *DBusConnection) GoPointer() uintptr { | |
| @@ -1758,24 +1883,34 @@ func (x *DBusConnection) InitAsync(IoPriorityVar int, CancellableVar *Cancellabl | |||
| 1758 | 1883 | ||
| 1759 | 1884 | // Finishes asynchronous initialization and returns the result. | |
| 1760 | 1885 | // See g_async_initable_init_async(). | |
| 1761 | - | func (x *DBusConnection) InitFinish(ResVar AsyncResult) bool { | |
| 1886 | + | func (x *DBusConnection) InitFinish(ResVar AsyncResult) (bool, error) { | |
| 1887 | + | var cerr *glib.Error | |
| 1762 | 1888 | ||
| 1763 | - | return XGAsyncInitableInitFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 1889 | + | cret := XGAsyncInitableInitFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 1890 | + | if cerr == nil { | |
| 1891 | + | return cret, nil | |
| 1892 | + | } | |
| 1893 | + | return cret, cerr | |
| 1764 | 1894 | ||
| 1765 | 1895 | } | |
| 1766 | 1896 | ||
| 1767 | 1897 | // Finishes the async construction for the various g_async_initable_new | |
| 1768 | 1898 | // calls, returning the created object or %NULL on error. | |
| 1769 | - | func (x *DBusConnection) NewFinish(ResVar AsyncResult) *gobject.Object { | |
| 1899 | + | func (x *DBusConnection) NewFinish(ResVar AsyncResult) (*gobject.Object, error) { | |
| 1900 | + | var cls *gobject.Object | |
| 1901 | + | var cerr *glib.Error | |
| 1770 | 1902 | ||
| 1771 | - | NewFinishPtr := XGAsyncInitableNewFinish(x.GoPointer(), ResVar.GoPointer()) | |
| 1772 | - | if NewFinishPtr == 0 { | |
| 1773 | - | return nil | |
| 1774 | - | } | |
| 1903 | + | cret := XGAsyncInitableNewFinish(x.GoPointer(), ResVar.GoPointer(), &cerr) | |
| 1775 | 1904 | ||
| 1776 | - | NewFinishCls := &gobject.Object{} | |
| 1777 | - | NewFinishCls.Ptr = NewFinishPtr | |
| 1778 | - | return NewFinishCls | |
| 1905 | + | if cret == 0 { | |
| 1906 | + | return cls, cerr | |
| 1907 | + | } | |
| 1908 | + | cls = &gobject.Object{} | |
| 1909 | + | cls.Ptr = cret | |
| 1910 | + | if cerr == nil { | |
| 1911 | + | return cls, nil | |
| 1912 | + | } | |
| 1913 | + | return cls, cerr | |
| 1779 | 1914 | ||
| 1780 | 1915 | } | |
| 1781 | 1916 | ||
| @@ -1817,9 +1952,14 @@ func (x *DBusConnection) NewFinish(ResVar AsyncResult) *gobject.Object { | |||
| 1817 | 1952 | // In this pattern, a caller would expect to be able to call g_initable_init() | |
| 1818 | 1953 | // on the result of g_object_new(), regardless of whether it is in fact a new | |
| 1819 | 1954 | // instance. | |
| 1820 | - | func (x *DBusConnection) Init(CancellableVar *Cancellable) bool { | |
| 1955 | + | func (x *DBusConnection) Init(CancellableVar *Cancellable) (bool, error) { | |
| 1956 | + | var cerr *glib.Error | |
| 1821 | 1957 | ||
| 1822 | - | return XGInitableInit(x.GoPointer(), CancellableVar.GoPointer()) | |
| 1958 | + | cret := XGInitableInit(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 1959 | + | if cerr == nil { | |
| 1960 | + | return cret, nil | |
| 1961 | + | } | |
| 1962 | + | return cret, cerr | |
| 1823 | 1963 | ||
| 1824 | 1964 | } | |
| 1825 | 1965 | ||
| @@ -1860,17 +2000,19 @@ var xNewDBusMessage func() uintptr | |||
| 1860 | 2000 | ||
| 1861 | 2001 | // Creates a new empty #GDBusMessage. | |
| 1862 | 2002 | func NewDBusMessage() *DBusMessage { | |
| 1863 | - | NewDBusMessagePtr := xNewDBusMessage() | |
| 1864 | - | if NewDBusMessagePtr == 0 { | |
| 1865 | - | return nil | |
| 1866 | - | } | |
| 2003 | + | var cls *DBusMessage | |
| 1867 | 2004 | ||
| 1868 | - | NewDBusMessageCls := &DBusMessage{} | |
| 1869 | - | NewDBusMessageCls.Ptr = NewDBusMessagePtr | |
| 1870 | - | return NewDBusMessageCls | |
| 2005 | + | cret := xNewDBusMessage() | |
| 2006 | + | ||
| 2007 | + | if cret == 0 { | |
| 2008 | + | return cls | |
| 2009 | + | } | |
| 2010 | + | cls = &DBusMessage{} | |
| 2011 | + | cls.Ptr = cret | |
| 2012 | + | return cls | |
| 1871 | 2013 | } | |
| 1872 | 2014 | ||
| 1873 | - | var xNewFromBlobDBusMessage func(uintptr, uint, DBusCapabilityFlags) uintptr | |
| 2015 | + | var xNewFromBlobDBusMessage func(uintptr, uint, DBusCapabilityFlags, **glib.Error) uintptr | |
| 1874 | 2016 | ||
| 1875 | 2017 | // Creates a new #GDBusMessage from the data stored at @blob. The byte | |
| 1876 | 2018 | // order that the message was in can be retrieved using | |
| @@ -1878,43 +2020,54 @@ var xNewFromBlobDBusMessage func(uintptr, uint, DBusCapabilityFlags) uintptr | |||
| 1878 | 2020 | // | |
| 1879 | 2021 | // If the @blob cannot be parsed, contains invalid fields, or contains invalid | |
| 1880 | 2022 | // headers, %G_IO_ERROR_INVALID_ARGUMENT will be returned. | |
| 1881 | - | func NewFromBlobDBusMessage(BlobVar uintptr, BlobLenVar uint, CapabilitiesVar DBusCapabilityFlags) *DBusMessage { | |
| 1882 | - | NewFromBlobDBusMessagePtr := xNewFromBlobDBusMessage(BlobVar, BlobLenVar, CapabilitiesVar) | |
| 1883 | - | if NewFromBlobDBusMessagePtr == 0 { | |
| 1884 | - | return nil | |
| 2023 | + | func NewFromBlobDBusMessage(BlobVar uintptr, BlobLenVar uint, CapabilitiesVar DBusCapabilityFlags) (*DBusMessage, error) { | |
| 2024 | + | var cls *DBusMessage | |
| 2025 | + | var cerr *glib.Error | |
| 2026 | + | ||
| 2027 | + | cret := xNewFromBlobDBusMessage(BlobVar, BlobLenVar, CapabilitiesVar, &cerr) | |
| 2028 | + | ||
| 2029 | + | if cret == 0 { | |
| 2030 | + | return cls, cerr | |
| 1885 | 2031 | } | |
| 2032 | + | cls = &DBusMessage{} | |
| 2033 | + | cls.Ptr = cret | |
| 2034 | + | if cerr == nil { | |
| 2035 | + | return cls, nil | |
| 2036 | + | } | |
| 2037 | + | return cls, cerr | |
| 1886 | 2038 | ||
| 1887 | - | NewFromBlobDBusMessageCls := &DBusMessage{} | |
| 1888 | - | NewFromBlobDBusMessageCls.Ptr = NewFromBlobDBusMessagePtr | |
| 1889 | - | return NewFromBlobDBusMessageCls | |
| 1890 | 2039 | } | |
| 1891 | 2040 | ||
| 1892 | 2041 | var xNewMethodCallDBusMessage func(string, string, string, string) uintptr | |
| 1893 | 2042 | ||
| 1894 | 2043 | // Creates a new #GDBusMessage for a method call. | |
| 1895 | 2044 | func NewMethodCallDBusMessage(NameVar string, PathVar string, InterfaceVar string, MethodVar string) *DBusMessage { | |
| 1896 | - | NewMethodCallDBusMessagePtr := xNewMethodCallDBusMessage(NameVar, PathVar, InterfaceVar, MethodVar) | |
| 1897 | - | if NewMethodCallDBusMessagePtr == 0 { | |
| 1898 | - | return nil | |
| 1899 | - | } | |
| 2045 | + | var cls *DBusMessage | |
| 1900 | 2046 | ||
| 1901 | - | NewMethodCallDBusMessageCls := &DBusMessage{} | |
| 1902 | - | NewMethodCallDBusMessageCls.Ptr = NewMethodCallDBusMessagePtr | |
| 1903 | - | return NewMethodCallDBusMessageCls | |
| 2047 | + | cret := xNewMethodCallDBusMessage(NameVar, PathVar, InterfaceVar, MethodVar) | |
| 2048 | + | ||
| 2049 | + | if cret == 0 { | |
| 2050 | + | return cls | |
| 2051 | + | } | |
| 2052 | + | cls = &DBusMessage{} | |
| 2053 | + | cls.Ptr = cret | |
| 2054 | + | return cls | |
| 1904 | 2055 | } | |
| 1905 | 2056 | ||
| 1906 | 2057 | var xNewSignalDBusMessage func(string, string, string) uintptr | |
| 1907 | 2058 | ||
| 1908 | 2059 | // Creates a new #GDBusMessage for a signal emission. | |
| 1909 | 2060 | func NewSignalDBusMessage(PathVar string, InterfaceVar string, SignalVar string) *DBusMessage { | |
| 1910 | - | NewSignalDBusMessagePtr := xNewSignalDBusMessage(PathVar, InterfaceVar, SignalVar) | |
| 1911 | - | if NewSignalDBusMessagePtr == 0 { | |
| 1912 | - | return nil | |
| 1913 | - | } | |
| 2061 | + | var cls *DBusMessage | |
| 2062 | + | ||
| 2063 | + | cret := xNewSignalDBusMessage(PathVar, InterfaceVar, SignalVar) | |
| 1914 | 2064 | ||
| 1915 | - | NewSignalDBusMessageCls := &DBusMessage{} | |
| 1916 | - | NewSignalDBusMessageCls.Ptr = NewSignalDBusMessagePtr | |
| 1917 | - | return NewSignalDBusMessageCls | |
| 2065 | + | if cret == 0 { | |
| 2066 | + | return cls | |
| 2067 | + | } | |
| 2068 | + | cls = &DBusMessage{} | |
| 2069 | + | cls.Ptr = cret | |
| 2070 | + | return cls | |
| 1918 | 2071 | } | |
| 1919 | 2072 | ||
| 1920 | 2073 | var xDBusMessageCopy func(uintptr) uintptr | |
| @@ -1925,16 +2078,21 @@ var xDBusMessageCopy func(uintptr) uintptr | |||
| 1925 | 2078 | // | |
| 1926 | 2079 | // This operation can fail if e.g. @message contains file descriptors | |
| 1927 | 2080 | // and the per-process or system-wide open files limit is reached. | |
| 1928 | - | func (x *DBusMessage) Copy() *DBusMessage { | |
| 2081 | + | func (x *DBusMessage) Copy() (*DBusMessage, error) { | |
| 2082 | + | var cls *DBusMessage | |
| 2083 | + | var cerr *glib.Error | |
| 1929 | 2084 | ||
| 1930 | - | CopyPtr := xDBusMessageCopy(x.GoPointer()) | |
| 1931 | - | if CopyPtr == 0 { | |
| 1932 | - | return nil | |
| 1933 | - | } | |
| 2085 | + | cret := xDBusMessageCopy(x.GoPointer()) | |
| 1934 | 2086 | ||
| 1935 | - | CopyCls := &DBusMessage{} | |
| 1936 | - | CopyCls.Ptr = CopyPtr | |
| 1937 | - | return CopyCls | |
| 2087 | + | if cret == 0 { | |
| 2088 | + | return cls, cerr | |
| 2089 | + | } | |
| 2090 | + | cls = &DBusMessage{} | |
| 2091 | + | cls.Ptr = cret | |
| 2092 | + | if cerr == nil { | |
| 2093 | + | return cls, nil | |
| 2094 | + | } | |
| 2095 | + | return cls, cerr | |
| 1938 | 2096 | ||
| 1939 | 2097 | } | |
| 1940 | 2098 | ||
| @@ -1943,8 +2101,8 @@ var xDBusMessageGetArg0 func(uintptr) string | |||
| 1943 | 2101 | // Convenience to get the first item in the body of @message. | |
| 1944 | 2102 | func (x *DBusMessage) GetArg0() string { | |
| 1945 | 2103 | ||
| 1946 | - | return xDBusMessageGetArg0(x.GoPointer()) | |
| 1947 | - | ||
| 2104 | + | cret := xDBusMessageGetArg0(x.GoPointer()) | |
| 2105 | + | return cret | |
| 1948 | 2106 | } | |
| 1949 | 2107 | ||
| 1950 | 2108 | var xDBusMessageGetBody func(uintptr) *glib.Variant | |
| @@ -1952,8 +2110,8 @@ var xDBusMessageGetBody func(uintptr) *glib.Variant | |||
| 1952 | 2110 | // Gets the body of a message. | |
| 1953 | 2111 | func (x *DBusMessage) GetBody() *glib.Variant { | |
| 1954 | 2112 | ||
| 1955 | - | return xDBusMessageGetBody(x.GoPointer()) | |
| 1956 | - | ||
| 2113 | + | cret := xDBusMessageGetBody(x.GoPointer()) | |
| 2114 | + | return cret | |
| 1957 | 2115 | } | |
| 1958 | 2116 | ||
| 1959 | 2117 | var xDBusMessageGetByteOrder func(uintptr) DBusMessageByteOrder | |
| @@ -1961,8 +2119,8 @@ var xDBusMessageGetByteOrder func(uintptr) DBusMessageByteOrder | |||
| 1961 | 2119 | // Gets the byte order of @message. | |
| 1962 | 2120 | func (x *DBusMessage) GetByteOrder() DBusMessageByteOrder { | |
| 1963 | 2121 | ||
| 1964 | - | return xDBusMessageGetByteOrder(x.GoPointer()) | |
| 1965 | - | ||
| 2122 | + | cret := xDBusMessageGetByteOrder(x.GoPointer()) | |
| 2123 | + | return cret | |
| 1966 | 2124 | } | |
| 1967 | 2125 | ||
| 1968 | 2126 | var xDBusMessageGetDestination func(uintptr) string | |
| @@ -1970,8 +2128,8 @@ var xDBusMessageGetDestination func(uintptr) string | |||
| 1970 | 2128 | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field. | |
| 1971 | 2129 | func (x *DBusMessage) GetDestination() string { | |
| 1972 | 2130 | ||
| 1973 | - | return xDBusMessageGetDestination(x.GoPointer()) | |
| 1974 | - | ||
| 2131 | + | cret := xDBusMessageGetDestination(x.GoPointer()) | |
| 2132 | + | return cret | |
| 1975 | 2133 | } | |
| 1976 | 2134 | ||
| 1977 | 2135 | var xDBusMessageGetErrorName func(uintptr) string | |
| @@ -1979,8 +2137,8 @@ var xDBusMessageGetErrorName func(uintptr) string | |||
| 1979 | 2137 | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field. | |
| 1980 | 2138 | func (x *DBusMessage) GetErrorName() string { | |
| 1981 | 2139 | ||
| 1982 | - | return xDBusMessageGetErrorName(x.GoPointer()) | |
| 1983 | - | ||
| 2140 | + | cret := xDBusMessageGetErrorName(x.GoPointer()) | |
| 2141 | + | return cret | |
| 1984 | 2142 | } | |
| 1985 | 2143 | ||
| 1986 | 2144 | var xDBusMessageGetFlags func(uintptr) DBusMessageFlags | |
| @@ -1988,8 +2146,8 @@ var xDBusMessageGetFlags func(uintptr) DBusMessageFlags | |||
| 1988 | 2146 | // Gets the flags for @message. | |
| 1989 | 2147 | func (x *DBusMessage) GetFlags() DBusMessageFlags { | |
| 1990 | 2148 | ||
| 1991 | - | return xDBusMessageGetFlags(x.GoPointer()) | |
| 1992 | - | ||
| 2149 | + | cret := xDBusMessageGetFlags(x.GoPointer()) | |
| 2150 | + | return cret | |
| 1993 | 2151 | } | |
| 1994 | 2152 | ||
| 1995 | 2153 | var xDBusMessageGetHeader func(uintptr, DBusMessageHeaderField) *glib.Variant | |
| @@ -2000,8 +2158,8 @@ var xDBusMessageGetHeader func(uintptr, DBusMessageHeaderField) *glib.Variant | |||
| 2000 | 2158 | // matches what is expected. | |
| 2001 | 2159 | func (x *DBusMessage) GetHeader(HeaderFieldVar DBusMessageHeaderField) *glib.Variant { | |
| 2002 | 2160 | ||
| 2003 | - | return xDBusMessageGetHeader(x.GoPointer(), HeaderFieldVar) | |
| 2004 | - | ||
| 2161 | + | cret := xDBusMessageGetHeader(x.GoPointer(), HeaderFieldVar) | |
| 2162 | + | return cret | |
| 2005 | 2163 | } | |
| 2006 | 2164 | ||
| 2007 | 2165 | var xDBusMessageGetHeaderFields func(uintptr) uintptr | |
| @@ -2009,8 +2167,8 @@ var xDBusMessageGetHeaderFields func(uintptr) uintptr | |||
| 2009 | 2167 | // Gets an array of all header fields on @message that are set. | |
| 2010 | 2168 | func (x *DBusMessage) GetHeaderFields() uintptr { | |
| 2011 | 2169 | ||
| 2012 | - | return xDBusMessageGetHeaderFields(x.GoPointer()) | |
| 2013 | - | ||
| 2170 | + | cret := xDBusMessageGetHeaderFields(x.GoPointer()) | |
| 2171 | + | return cret | |
| 2014 | 2172 | } | |
| 2015 | 2173 | ||
| 2016 | 2174 | var xDBusMessageGetInterface func(uintptr) string | |
| @@ -2018,8 +2176,8 @@ var xDBusMessageGetInterface func(uintptr) string | |||
| 2018 | 2176 | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field. | |
| 2019 | 2177 | func (x *DBusMessage) GetInterface() string { | |
| 2020 | 2178 | ||
| 2021 | - | return xDBusMessageGetInterface(x.GoPointer()) | |
| 2022 | - | ||
| 2179 | + | cret := xDBusMessageGetInterface(x.GoPointer()) | |
| 2180 | + | return cret | |
| 2023 | 2181 | } | |
| 2024 | 2182 | ||
| 2025 | 2183 | var xDBusMessageGetLocked func(uintptr) bool | |
| @@ -2029,8 +2187,8 @@ var xDBusMessageGetLocked func(uintptr) bool | |||
| 2029 | 2187 | // on the #GDBusMessage:locked property. | |
| 2030 | 2188 | func (x *DBusMessage) GetLocked() bool { | |
| 2031 | 2189 | ||
| 2032 | - | return xDBusMessageGetLocked(x.GoPointer()) | |
| 2033 | - | ||
| 2190 | + | cret := xDBusMessageGetLocked(x.GoPointer()) | |
| 2191 | + | return cret | |
| 2034 | 2192 | } | |
| 2035 | 2193 | ||
| 2036 | 2194 | var xDBusMessageGetMember func(uintptr) string | |
| @@ -2038,8 +2196,8 @@ var xDBusMessageGetMember func(uintptr) string | |||
| 2038 | 2196 | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field. | |
| 2039 | 2197 | func (x *DBusMessage) GetMember() string { | |
| 2040 | 2198 | ||
| 2041 | - | return xDBusMessageGetMember(x.GoPointer()) | |
| 2042 | - | ||
| 2199 | + | cret := xDBusMessageGetMember(x.GoPointer()) | |
| 2200 | + | return cret | |
| 2043 | 2201 | } | |
| 2044 | 2202 | ||
| 2045 | 2203 | var xDBusMessageGetMessageType func(uintptr) DBusMessageType | |
| @@ -2047,8 +2205,8 @@ var xDBusMessageGetMessageType func(uintptr) DBusMessageType | |||
| 2047 | 2205 | // Gets the type of @message. | |
| 2048 | 2206 | func (x *DBusMessage) GetMessageType() DBusMessageType { | |
| 2049 | 2207 | ||
| 2050 | - | return xDBusMessageGetMessageType(x.GoPointer()) | |
| 2051 | - | ||
| 2208 | + | cret := xDBusMessageGetMessageType(x.GoPointer()) | |
| 2209 | + | return cret | |
| 2052 | 2210 | } | |
| 2053 | 2211 | ||
| 2054 | 2212 | var xDBusMessageGetNumUnixFds func(uintptr) uint32 | |
| @@ -2056,8 +2214,8 @@ var xDBusMessageGetNumUnixFds func(uintptr) uint32 | |||
| 2056 | 2214 | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field. | |
| 2057 | 2215 | func (x *DBusMessage) GetNumUnixFds() uint32 { | |
| 2058 | 2216 | ||
| 2059 | - | return xDBusMessageGetNumUnixFds(x.GoPointer()) | |
| 2060 | - | ||
| 2217 | + | cret := xDBusMessageGetNumUnixFds(x.GoPointer()) | |
| 2218 | + | return cret | |
| 2061 | 2219 | } | |
| 2062 | 2220 | ||
| 2063 | 2221 | var xDBusMessageGetPath func(uintptr) string | |
| @@ -2065,8 +2223,8 @@ var xDBusMessageGetPath func(uintptr) string | |||
| 2065 | 2223 | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field. | |
| 2066 | 2224 | func (x *DBusMessage) GetPath() string { | |
| 2067 | 2225 | ||
| 2068 | - | return xDBusMessageGetPath(x.GoPointer()) | |
| 2069 | - | ||
| 2226 | + | cret := xDBusMessageGetPath(x.GoPointer()) | |
| 2227 | + | return cret | |
| 2070 | 2228 | } | |
| 2071 | 2229 | ||
| 2072 | 2230 | var xDBusMessageGetReplySerial func(uintptr) uint32 | |
| @@ -2074,8 +2232,8 @@ var xDBusMessageGetReplySerial func(uintptr) uint32 | |||
| 2074 | 2232 | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field. | |
| 2075 | 2233 | func (x *DBusMessage) GetReplySerial() uint32 { | |
| 2076 | 2234 | ||
| 2077 | - | return xDBusMessageGetReplySerial(x.GoPointer()) | |
| 2078 | - | ||
| 2235 | + | cret := xDBusMessageGetReplySerial(x.GoPointer()) | |
| 2236 | + | return cret | |
| 2079 | 2237 | } | |
| 2080 | 2238 | ||
| 2081 | 2239 | var xDBusMessageGetSender func(uintptr) string | |
| @@ -2083,8 +2241,8 @@ var xDBusMessageGetSender func(uintptr) string | |||
| 2083 | 2241 | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field. | |
| 2084 | 2242 | func (x *DBusMessage) GetSender() string { | |
| 2085 | 2243 | ||
| 2086 | - | return xDBusMessageGetSender(x.GoPointer()) | |
| 2087 | - | ||
| 2244 | + | cret := xDBusMessageGetSender(x.GoPointer()) | |
| 2245 | + | return cret | |
| 2088 | 2246 | } | |
| 2089 | 2247 | ||
| 2090 | 2248 | var xDBusMessageGetSerial func(uintptr) uint32 | |
| @@ -2092,8 +2250,8 @@ var xDBusMessageGetSerial func(uintptr) uint32 | |||
| 2092 | 2250 | // Gets the serial for @message. | |
| 2093 | 2251 | func (x *DBusMessage) GetSerial() uint32 { | |
| 2094 | 2252 | ||
| 2095 | - | return xDBusMessageGetSerial(x.GoPointer()) | |
| 2096 | - | ||
| 2253 | + | cret := xDBusMessageGetSerial(x.GoPointer()) | |
| 2254 | + | return cret | |
| 2097 | 2255 | } | |
| 2098 | 2256 | ||
| 2099 | 2257 | var xDBusMessageGetSignature func(uintptr) string | |
| @@ -2103,8 +2261,8 @@ var xDBusMessageGetSignature func(uintptr) string | |||
| 2103 | 2261 | // This will always be non-%NULL, but may be an empty string. | |
| 2104 | 2262 | func (x *DBusMessage) GetSignature() string { | |
| 2105 | 2263 | ||
| 2106 | - | return xDBusMessageGetSignature(x.GoPointer()) | |
| 2107 | - | ||
| 2264 | + | cret := xDBusMessageGetSignature(x.GoPointer()) | |
| 2265 | + | return cret | |
| 2108 | 2266 | } | |
| 2109 | 2267 | ||
| 2110 | 2268 | var xDBusMessageGetUnixFdList func(uintptr) uintptr | |
| @@ -2119,18 +2277,17 @@ var xDBusMessageGetUnixFdList func(uintptr) uintptr | |||
| 2119 | 2277 | // to the file descriptor that can be accessed by | |
| 2120 | 2278 | // `g_unix_fd_list_get (list, 5, ...)`. | |
| 2121 | 2279 | func (x *DBusMessage) GetUnixFdList() *UnixFDList { | |
| 2280 | + | var cls *UnixFDList | |
| 2122 | 2281 | ||
| 2123 | - | GetUnixFdListPtr := xDBusMessageGetUnixFdList(x.GoPointer()) | |
| 2124 | - | if GetUnixFdListPtr == 0 { | |
| 2125 | - | return nil | |
| 2126 | - | } | |
| 2127 | - | ||
| 2128 | - | gobject.IncreaseRef(GetUnixFdListPtr) | |
| 2129 | - | ||
| 2130 | - | GetUnixFdListCls := &UnixFDList{} | |
| 2131 | - | GetUnixFdListCls.Ptr = GetUnixFdListPtr | |
| 2132 | - | return GetUnixFdListCls | |
| 2282 | + | cret := xDBusMessageGetUnixFdList(x.GoPointer()) | |
| 2133 | 2283 | ||
| 2284 | + | if cret == 0 { | |
| 2285 | + | return cls | |
| 2286 | + | } | |
| 2287 | + | gobject.IncreaseRef(cret) | |
| 2288 | + | cls = &UnixFDList{} | |
| 2289 | + | cls.Ptr = cret | |
| 2290 | + | return cls | |
| 2134 | 2291 | } | |
| 2135 | 2292 | ||
| 2136 | 2293 | var xDBusMessageLock func(uintptr) | |
| @@ -2146,64 +2303,64 @@ var xDBusMessageNewMethodError func(uintptr, string, string, ...interface{}) uin | |||
| 2146 | 2303 | ||
| 2147 | 2304 | // Creates a new #GDBusMessage that is an error reply to @method_call_message. | |
| 2148 | 2305 | func (x *DBusMessage) NewMethodError(ErrorNameVar string, ErrorMessageFormatVar string, varArgs ...interface{}) *DBusMessage { | |
| 2306 | + | var cls *DBusMessage | |
| 2149 | 2307 | ||
| 2150 | - | NewMethodErrorPtr := xDBusMessageNewMethodError(x.GoPointer(), ErrorNameVar, ErrorMessageFormatVar, varArgs...) | |
| 2151 | - | if NewMethodErrorPtr == 0 { | |
| 2152 | - | return nil | |
| 2153 | - | } | |
| 2154 | - | ||
| 2155 | - | NewMethodErrorCls := &DBusMessage{} | |
| 2156 | - | NewMethodErrorCls.Ptr = NewMethodErrorPtr | |
| 2157 | - | return NewMethodErrorCls | |
| 2308 | + | cret := xDBusMessageNewMethodError(x.GoPointer(), ErrorNameVar, ErrorMessageFormatVar, varArgs...) | |
| 2158 | 2309 | ||
| 2310 | + | if cret == 0 { | |
| 2311 | + | return cls | |
| 2312 | + | } | |
| 2313 | + | cls = &DBusMessage{} | |
| 2314 | + | cls.Ptr = cret | |
| 2315 | + | return cls | |
| 2159 | 2316 | } | |
| 2160 | 2317 | ||
| 2161 | 2318 | var xDBusMessageNewMethodErrorLiteral func(uintptr, string, string) uintptr | |
| 2162 | 2319 | ||
| 2163 | 2320 | // Creates a new #GDBusMessage that is an error reply to @method_call_message. | |
| 2164 | 2321 | func (x *DBusMessage) NewMethodErrorLiteral(ErrorNameVar string, ErrorMessageVar string) *DBusMessage { | |
| 2322 | + | var cls *DBusMessage | |
| 2165 | 2323 | ||
| 2166 | - | NewMethodErrorLiteralPtr := xDBusMessageNewMethodErrorLiteral(x.GoPointer(), ErrorNameVar, ErrorMessageVar) | |
| 2167 | - | if NewMethodErrorLiteralPtr == 0 { | |
| 2168 | - | return nil | |
| 2169 | - | } | |
| 2170 | - | ||
| 2171 | - | NewMethodErrorLiteralCls := &DBusMessage{} | |
| 2172 | - | NewMethodErrorLiteralCls.Ptr = NewMethodErrorLiteralPtr | |
| 2173 | - | return NewMethodErrorLiteralCls | |
| 2324 | + | cret := xDBusMessageNewMethodErrorLiteral(x.GoPointer(), ErrorNameVar, ErrorMessageVar) | |
| 2174 | 2325 | ||
| 2326 | + | if cret == 0 { | |
| 2327 | + | return cls | |
| 2328 | + | } | |
| 2329 | + | cls = &DBusMessage{} | |
| 2330 | + | cls.Ptr = cret | |
| 2331 | + | return cls | |
| 2175 | 2332 | } | |
| 2176 | 2333 | ||
| 2177 | 2334 | var xDBusMessageNewMethodErrorValist func(uintptr, string, string, []interface{}) uintptr | |
| 2178 | 2335 | ||
| 2179 | 2336 | // Like g_dbus_message_new_method_error() but intended for language bindings. | |
| 2180 | 2337 | func (x *DBusMessage) NewMethodErrorValist(ErrorNameVar string, ErrorMessageFormatVar string, VarArgsVar []interface{}) *DBusMessage { | |
| 2338 | + | var cls *DBusMessage | |
| 2181 | 2339 | ||
| 2182 | - | NewMethodErrorValistPtr := xDBusMessageNewMethodErrorValist(x.GoPointer(), ErrorNameVar, ErrorMessageFormatVar, VarArgsVar) | |
| 2183 | - | if NewMethodErrorValistPtr == 0 { | |
| 2184 | - | return nil | |
| 2185 | - | } | |
| 2186 | - | ||
| 2187 | - | NewMethodErrorValistCls := &DBusMessage{} | |
| 2188 | - | NewMethodErrorValistCls.Ptr = NewMethodErrorValistPtr | |
| 2189 | - | return NewMethodErrorValistCls | |
| 2340 | + | cret := xDBusMessageNewMethodErrorValist(x.GoPointer(), ErrorNameVar, ErrorMessageFormatVar, VarArgsVar) | |
| 2190 | 2341 | ||
| 2342 | + | if cret == 0 { | |
| 2343 | + | return cls | |
| 2344 | + | } | |
| 2345 | + | cls = &DBusMessage{} | |
| 2346 | + | cls.Ptr = cret | |
| 2347 | + | return cls | |
| 2191 | 2348 | } | |
| 2192 | 2349 | ||
| 2193 | 2350 | var xDBusMessageNewMethodReply func(uintptr) uintptr | |
| 2194 | 2351 | ||
| 2195 | 2352 | // Creates a new #GDBusMessage that is a reply to @method_call_message. | |
| 2196 | 2353 | func (x *DBusMessage) NewMethodReply() *DBusMessage { | |
| 2354 | + | var cls *DBusMessage | |
| 2197 | 2355 | ||
| 2198 | - | NewMethodReplyPtr := xDBusMessageNewMethodReply(x.GoPointer()) | |
| 2199 | - | if NewMethodReplyPtr == 0 { | |
| 2200 | - | return nil | |
| 2201 | - | } | |
| 2202 | - | ||
| 2203 | - | NewMethodReplyCls := &DBusMessage{} | |
| 2204 | - | NewMethodReplyCls.Ptr = NewMethodReplyPtr | |
| 2205 | - | return NewMethodReplyCls | |
| 2356 | + | cret := xDBusMessageNewMethodReply(x.GoPointer()) | |
| 2206 | 2357 | ||
| 2358 | + | if cret == 0 { | |
| 2359 | + | return cls | |
| 2360 | + | } | |
| 2361 | + | cls = &DBusMessage{} | |
| 2362 | + | cls.Ptr = cret | |
| 2363 | + | return cls | |
| 2207 | 2364 | } | |
| 2208 | 2365 | ||
| 2209 | 2366 | var xDBusMessagePrint func(uintptr, uint) string | |
| @@ -2250,8 +2407,8 @@ var xDBusMessagePrint func(uintptr, uint) string | |||
| 2250 | 2407 | // ]| | |
| 2251 | 2408 | func (x *DBusMessage) Print(IndentVar uint) string { | |
| 2252 | 2409 | ||
| 2253 | - | return xDBusMessagePrint(x.GoPointer(), IndentVar) | |
| 2254 | - | ||
| 2410 | + | cret := xDBusMessagePrint(x.GoPointer(), IndentVar) | |
| 2411 | + | return cret | |
| 2255 | 2412 | } | |
| 2256 | 2413 | ||
| 2257 | 2414 | var xDBusMessageSetBody func(uintptr, *glib.Variant) | |
| @@ -2414,13 +2571,18 @@ func (x *DBusMessage) SetUnixFdList(FdListVar *UnixFDList) { | |||
| 2414 | 2571 | ||
| 2415 | 2572 | } | |
| 2416 | 2573 | ||
| 2417 | - | var xDBusMessageToBlob func(uintptr, uint, DBusCapabilityFlags) uintptr | |
| 2574 | + | var xDBusMessageToBlob func(uintptr, uint, DBusCapabilityFlags, **glib.Error) uintptr | |
| 2418 | 2575 | ||
| 2419 | 2576 | // Serializes @message to a blob. The byte order returned by | |
| 2420 | 2577 | // g_dbus_message_get_byte_order() will be used. | |
| 2421 | - | func (x *DBusMessage) ToBlob(OutSizeVar uint, CapabilitiesVar DBusCapabilityFlags) uintptr { | |
| 2578 | + | func (x *DBusMessage) ToBlob(OutSizeVar uint, CapabilitiesVar DBusCapabilityFlags) (uintptr, error) { | |
| 2579 | + | var cerr *glib.Error | |
| 2422 | 2580 | ||
| 2423 | - | return xDBusMessageToBlob(x.GoPointer(), OutSizeVar, CapabilitiesVar) | |
| 2581 | + | cret := xDBusMessageToBlob(x.GoPointer(), OutSizeVar, CapabilitiesVar, &cerr) | |
| 2582 | + | if cerr == nil { | |
| 2583 | + | return cret, nil | |
| 2584 | + | } | |
| 2585 | + | return cret, cerr | |
| 2424 | 2586 | ||
| 2425 | 2587 | } | |
| 2426 | 2588 | ||
| @@ -2433,9 +2595,14 @@ var xDBusMessageToGerror func(uintptr) bool | |||
| 2433 | 2595 | // using g_dbus_error_set_dbus_error() using the information in the | |
| 2434 | 2596 | // %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as | |
| 2435 | 2597 | // well as the first string item in @message's body. | |
| 2436 | - | func (x *DBusMessage) ToGerror() bool { | |
| 2598 | + | func (x *DBusMessage) ToGerror() (bool, error) { | |
| 2599 | + | var cerr *glib.Error | |
| 2437 | 2600 | ||
| 2438 | - | return xDBusMessageToGerror(x.GoPointer()) | |
| 2601 | + | cret := xDBusMessageToGerror(x.GoPointer()) | |
| 2602 | + | if cerr == nil { | |
| 2603 | + | return cret, nil | |
| 2604 | + | } | |
| 2605 | + | return cret, cerr | |
| 2439 | 2606 | ||
| 2440 | 2607 | } | |
| 2441 | 2608 | ||
| @@ -2468,18 +2635,17 @@ var xDBusMethodInvocationGetConnection func(uintptr) uintptr | |||
| 2468 | 2635 | ||
| 2469 | 2636 | // Gets the #GDBusConnection the method was invoked on. | |
| 2470 | 2637 | func (x *DBusMethodInvocation) GetConnection() *DBusConnection { | |
| 2638 | + | var cls *DBusConnection | |
| 2471 | 2639 | ||
| 2472 | - | GetConnectionPtr := xDBusMethodInvocationGetConnection(x.GoPointer()) | |
| 2473 | - | if GetConnectionPtr == 0 { | |
| 2474 | - | return nil | |
| 2475 | - | } | |
| 2476 | - | ||
| 2477 | - | gobject.IncreaseRef(GetConnectionPtr) | |
| 2478 | - | ||
| 2479 | - | GetConnectionCls := &DBusConnection{} | |
| 2480 | - | GetConnectionCls.Ptr = GetConnectionPtr | |
| 2481 | - | return GetConnectionCls | |
| 2640 | + | cret := xDBusMethodInvocationGetConnection(x.GoPointer()) | |
| 2482 | 2641 | ||
| 2642 | + | if cret == 0 { | |
| 2643 | + | return cls | |
| 2644 | + | } | |
| 2645 | + | gobject.IncreaseRef(cret) | |
| 2646 | + | cls = &DBusConnection{} | |
| 2647 | + | cls.Ptr = cret | |
| 2648 | + | return cls | |
| 2483 | 2649 | } | |
| 2484 | 2650 | ||
| 2485 | 2651 | var xDBusMethodInvocationGetInterfaceName func(uintptr) string | |
| @@ -2492,8 +2658,8 @@ var xDBusMethodInvocationGetInterfaceName func(uintptr) string | |||
| 2492 | 2658 | // #GDBusInterfaceVTable for more information. | |
| 2493 | 2659 | func (x *DBusMethodInvocation) GetInterfaceName() string { | |
| 2494 | 2660 | ||
| 2495 | - | return xDBusMethodInvocationGetInterfaceName(x.GoPointer()) | |
| 2496 | - | ||
| 2661 | + | cret := xDBusMethodInvocationGetInterfaceName(x.GoPointer()) | |
| 2662 | + | return cret | |
| 2497 | 2663 | } | |
| 2498 | 2664 | ||
| 2499 | 2665 | var xDBusMethodInvocationGetMessage func(uintptr) uintptr | |
| @@ -2507,18 +2673,17 @@ var xDBusMethodInvocationGetMessage func(uintptr) uintptr | |||
| 2507 | 2673 | // for an example of how to use this low-level API to send and receive | |
| 2508 | 2674 | // UNIX file descriptors. | |
| 2509 | 2675 | func (x *DBusMethodInvocation) GetMessage() *DBusMessage { | |
| 2676 | + | var cls *DBusMessage | |
| 2510 | 2677 | ||
| 2511 | - | GetMessagePtr := xDBusMethodInvocationGetMessage(x.GoPointer()) | |
| 2512 | - | if GetMessagePtr == 0 { | |
| 2513 | - | return nil | |
| 2514 | - | } | |
| 2515 | - | ||
| 2516 | - | gobject.IncreaseRef(GetMessagePtr) | |
| 2517 | - | ||
| 2518 | - | GetMessageCls := &DBusMessage{} | |
| 2519 | - | GetMessageCls.Ptr = GetMessagePtr | |
| 2520 | - | return GetMessageCls | |
| 2678 | + | cret := xDBusMethodInvocationGetMessage(x.GoPointer()) | |
| 2521 | 2679 | ||
| 2680 | + | if cret == 0 { | |
| 2681 | + | return cls | |
| 2682 | + | } | |
| 2683 | + | gobject.IncreaseRef(cret) | |
| 2684 | + | cls = &DBusMessage{} | |
| 2685 | + | cls.Ptr = cret | |
| 2686 | + | return cls | |
| 2522 | 2687 | } | |
| 2523 | 2688 | ||
| 2524 | 2689 | var xDBusMethodInvocationGetMethodInfo func(uintptr) *DBusMethodInfo | |
| @@ -2531,8 +2696,8 @@ var xDBusMethodInvocationGetMethodInfo func(uintptr) *DBusMethodInfo | |||
| 2531 | 2696 | // #GDBusInterfaceVTable for more information. | |
| 2532 | 2697 | func (x *DBusMethodInvocation) GetMethodInfo() *DBusMethodInfo { | |
| 2533 | 2698 | ||
| 2534 | - | return xDBusMethodInvocationGetMethodInfo(x.GoPointer()) | |
| 2535 | - | ||
| 2699 | + | cret := xDBusMethodInvocationGetMethodInfo(x.GoPointer()) | |
| 2700 | + | return cret | |
| 2536 | 2701 | } | |
| 2537 | 2702 | ||
| 2538 | 2703 | var xDBusMethodInvocationGetMethodName func(uintptr) string | |
| @@ -2540,8 +2705,8 @@ var xDBusMethodInvocationGetMethodName func(uintptr) string | |||
| 2540 | 2705 | // Gets the name of the method that was invoked. | |
| 2541 | 2706 | func (x *DBusMethodInvocation) GetMethodName() string { | |
| 2542 | 2707 | ||
| 2543 | - | return xDBusMethodInvocationGetMethodName(x.GoPointer()) | |
| 2544 | - | ||
| 2708 | + | cret := xDBusMethodInvocationGetMethodName(x.GoPointer()) | |
| 2709 | + | return cret | |
| 2545 | 2710 | } | |
| 2546 | 2711 | ||
| 2547 | 2712 | var xDBusMethodInvocationGetObjectPath func(uintptr) string | |
| @@ -2549,8 +2714,8 @@ var xDBusMethodInvocationGetObjectPath func(uintptr) string | |||
| 2549 | 2714 | // Gets the object path the method was invoked on. | |
| 2550 | 2715 | func (x *DBusMethodInvocation) GetObjectPath() string { | |
| 2551 | 2716 | ||
| 2552 | - | return xDBusMethodInvocationGetObjectPath(x.GoPointer()) | |
| 2553 | - | ||
| 2717 | + | cret := xDBusMethodInvocationGetObjectPath(x.GoPointer()) | |
| 2718 | + | return cret | |
| 2554 | 2719 | } | |
| 2555 | 2720 | ||
| 2556 | 2721 | var xDBusMethodInvocationGetParameters func(uintptr) *glib.Variant | |
| @@ -2559,8 +2724,8 @@ var xDBusMethodInvocationGetParameters func(uintptr) *glib.Variant | |||
| 2559 | 2724 | // parameters then this will return a GVariant with 0 children rather than NULL. | |
| 2560 | 2725 | func (x *DBusMethodInvocation) GetParameters() *glib.Variant { | |
| 2561 | 2726 | ||
| 2562 | - | return xDBusMethodInvocationGetParameters(x.GoPointer()) | |
| 2563 | - | ||
| 2727 | + | cret := xDBusMethodInvocationGetParameters(x.GoPointer()) | |
| 2728 | + | return cret | |
| 2564 | 2729 | } | |
| 2565 | 2730 | ||
| 2566 | 2731 | var xDBusMethodInvocationGetPropertyInfo func(uintptr) *DBusPropertyInfo | |
| @@ -2578,8 +2743,8 @@ var xDBusMethodInvocationGetPropertyInfo func(uintptr) *DBusPropertyInfo | |||
| 2578 | 2743 | // If the call was GetAll, %NULL will be returned. | |
| 2579 | 2744 | func (x *DBusMethodInvocation) GetPropertyInfo() *DBusPropertyInfo { | |
| 2580 | 2745 | ||
| 2581 | - | return xDBusMethodInvocationGetPropertyInfo(x.GoPointer()) | |
| 2582 | - | ||
| 2746 | + | cret := xDBusMethodInvocationGetPropertyInfo(x.GoPointer()) | |
| 2747 | + | return cret | |
| 2583 | 2748 | } | |
| 2584 | 2749 | ||
| 2585 | 2750 | var xDBusMethodInvocationGetSender func(uintptr) string | |
| @@ -2587,8 +2752,8 @@ var xDBusMethodInvocationGetSender func(uintptr) string | |||
| 2587 | 2752 | // Gets the bus name that invoked the method. | |
| 2588 | 2753 | func (x *DBusMethodInvocation) GetSender() string { | |
| 2589 | 2754 | ||
| 2590 | - | return xDBusMethodInvocationGetSender(x.GoPointer()) | |
| 2591 | - | ||
| 2755 | + | cret := xDBusMethodInvocationGetSender(x.GoPointer()) | |
| 2756 | + | return cret | |
| 2592 | 2757 | } | |
| 2593 | 2758 | ||
| 2594 | 2759 | var xDBusMethodInvocationGetUserData func(uintptr) uintptr | |
| @@ -2596,8 +2761,8 @@ var xDBusMethodInvocationGetUserData func(uintptr) uintptr | |||
| 2596 | 2761 | // Gets the @user_data #gpointer passed to g_dbus_connection_register_object(). | |
| 2597 | 2762 | func (x *DBusMethodInvocation) GetUserData() uintptr { | |
| 2598 | 2763 | ||
| 2599 | - | return xDBusMethodInvocationGetUserData(x.GoPointer()) | |
| 2600 | - | ||
| 2764 | + | cret := xDBusMethodInvocationGetUserData(x.GoPointer()) | |
| 2765 | + | return cret | |
| 2601 | 2766 | } | |
| 2602 | 2767 | ||
| 2603 | 2768 | var xDBusMethodInvocationReturnDbusError func(uintptr, string, string) | |
| @@ -2790,7 +2955,7 @@ func DBusServerNewFromInternalPtr(ptr uintptr) *DBusServer { | |||
| 2790 | 2955 | return cls | |
| 2791 | 2956 | } | |
| 2792 | 2957 | ||
| 2793 | - | var xNewSyncDBusServer func(string, DBusServerFlags, string, uintptr, uintptr) uintptr | |
| 2958 | + | var xNewSyncDBusServer func(string, DBusServerFlags, string, uintptr, uintptr, **glib.Error) uintptr | |
| 2794 | 2959 | ||
| 2795 | 2960 | // Creates a new D-Bus server that listens on the first address in | |
| 2796 | 2961 | // @address that works. | |
| @@ -2812,15 +2977,22 @@ var xNewSyncDBusServer func(string, DBusServerFlags, string, uintptr, uintptr) u | |||
| 2812 | 2977 | // | |
| 2813 | 2978 | // This is a synchronous failable constructor. There is currently no | |
| 2814 | 2979 | // asynchronous version. | |
| 2815 | - | func NewSyncDBusServer(AddressVar string, FlagsVar DBusServerFlags, GuidVar string, ObserverVar *DBusAuthObserver, CancellableVar *Cancellable) *DBusServer { | |
| 2816 | - | NewSyncDBusServerPtr := xNewSyncDBusServer(AddressVar, FlagsVar, GuidVar, ObserverVar.GoPointer(), CancellableVar.GoPointer()) | |
| 2817 | - | if NewSyncDBusServerPtr == 0 { | |
| 2818 | - | return nil | |
| 2980 | + | func NewSyncDBusServer(AddressVar string, FlagsVar DBusServerFlags, GuidVar string, ObserverVar *DBusAuthObserver, CancellableVar *Cancellable) (*DBusServer, error) { | |
| 2981 | + | var cls *DBusServer | |
| 2982 | + | var cerr *glib.Error | |
| 2983 | + | ||
| 2984 | + | cret := xNewSyncDBusServer(AddressVar, FlagsVar, GuidVar, ObserverVar.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 2985 | + | ||
| 2986 | + | if cret == 0 { | |
| 2987 | + | return cls, cerr | |
| 2819 | 2988 | } | |
| 2989 | + | cls = &DBusServer{} | |
| 2990 | + | cls.Ptr = cret | |
| 2991 | + | if cerr == nil { | |
| 2992 | + | return cls, nil | |
| 2993 | + | } | |
| 2994 | + | return cls, cerr | |
| 2820 | 2995 | ||
| 2821 | - | NewSyncDBusServerCls := &DBusServer{} | |
| 2822 | - | NewSyncDBusServerCls.Ptr = NewSyncDBusServerPtr | |
| 2823 | - | return NewSyncDBusServerCls | |
| 2824 | 2996 | } | |
| 2825 | 2997 | ||
| 2826 | 2998 | var xDBusServerGetClientAddress func(uintptr) string | |
| @@ -2832,8 +3004,8 @@ var xDBusServerGetClientAddress func(uintptr) string | |||
| 2832 | 3004 | // This is valid and non-empty if initializing the #GDBusServer succeeded. | |
| 2833 | 3005 | func (x *DBusServer) GetClientAddress() string { | |
| 2834 | 3006 | ||
| 2835 | - | return xDBusServerGetClientAddress(x.GoPointer()) | |
| 2836 | - | ||
| 3007 | + | cret := xDBusServerGetClientAddress(x.GoPointer()) | |
| 3008 | + | return cret | |
| 2837 | 3009 | } | |
| 2838 | 3010 | ||
| 2839 | 3011 | var xDBusServerGetFlags func(uintptr) DBusServerFlags | |
| @@ -2841,8 +3013,8 @@ var xDBusServerGetFlags func(uintptr) DBusServerFlags | |||
| 2841 | 3013 | // Gets the flags for @server. | |
| 2842 | 3014 | func (x *DBusServer) GetFlags() DBusServerFlags { | |
| 2843 | 3015 | ||
| 2844 | - | return xDBusServerGetFlags(x.GoPointer()) | |
| 2845 | - | ||
| 3016 | + | cret := xDBusServerGetFlags(x.GoPointer()) | |
| 3017 | + | return cret | |
| 2846 | 3018 | } | |
| 2847 | 3019 | ||
| 2848 | 3020 | var xDBusServerGetGuid func(uintptr) string | |
| @@ -2850,8 +3022,8 @@ var xDBusServerGetGuid func(uintptr) string | |||
| 2850 | 3022 | // Gets the GUID for @server, as provided to g_dbus_server_new_sync(). | |
| 2851 | 3023 | func (x *DBusServer) GetGuid() string { | |
| 2852 | 3024 | ||
| 2853 | - | return xDBusServerGetGuid(x.GoPointer()) | |
| 2854 | - | ||
| 3025 | + | cret := xDBusServerGetGuid(x.GoPointer()) | |
| 3026 | + | return cret | |
| 2855 | 3027 | } | |
| 2856 | 3028 | ||
| 2857 | 3029 | var xDBusServerIsActive func(uintptr) bool | |
| @@ -2859,8 +3031,8 @@ var xDBusServerIsActive func(uintptr) bool | |||
| 2859 | 3031 | // Gets whether @server is active. | |
| 2860 | 3032 | func (x *DBusServer) IsActive() bool { | |
| 2861 | 3033 | ||
| 2862 | - | return xDBusServerIsActive(x.GoPointer()) | |
| 2863 | - | ||
| 3034 | + | cret := xDBusServerIsActive(x.GoPointer()) | |
| 3035 | + | return cret | |
| 2864 | 3036 | } | |
| 2865 | 3037 | ||
| 2866 | 3038 | var xDBusServerStart func(uintptr) | |
| @@ -2959,9 +3131,14 @@ func (x *DBusServer) ConnectNewConnection(cb func(DBusServer, uintptr) bool) { | |||
| 2959 | 3131 | // In this pattern, a caller would expect to be able to call g_initable_init() | |
| 2960 | 3132 | // on the result of g_object_new(), regardless of whether it is in fact a new | |
| 2961 | 3133 | // instance. | |
| 2962 | - | func (x *DBusServer) Init(CancellableVar *Cancellable) bool { | |
| 3134 | + | func (x *DBusServer) Init(CancellableVar *Cancellable) (bool, error) { | |
| 3135 | + | var cerr *glib.Error | |
| 2963 | 3136 | ||
| 2964 | - | return XGInitableInit(x.GoPointer(), CancellableVar.GoPointer()) | |
| 3137 | + | cret := XGInitableInit(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 3138 | + | if cerr == nil { | |
| 3139 | + | return cret, nil | |
| 3140 | + | } | |
| 3141 | + | return cret, cerr | |
| 2965 | 3142 | ||
| 2966 | 3143 | } | |
| 2967 | 3144 | ||
| @@ -2989,14 +3166,16 @@ var xNewMenu func() uintptr | |||
| 2989 | 3166 | // | |
| 2990 | 3167 | // The new menu has no items. | |
| 2991 | 3168 | func NewMenu() *Menu { | |
| 2992 | - | NewMenuPtr := xNewMenu() | |
| 2993 | - | if NewMenuPtr == 0 { | |
| 2994 | - | return nil | |
| 2995 | - | } | |
| 3169 | + | var cls *Menu | |
| 2996 | 3170 | ||
| 2997 | - | NewMenuCls := &Menu{} | |
| 2998 | - | NewMenuCls.Ptr = NewMenuPtr | |
| 2999 | - | return NewMenuCls | |
| 3171 | + | cret := xNewMenu() | |
| 3172 | + | ||
| 3173 | + | if cret == 0 { | |
| 3174 | + | return cls | |
| 3175 | + | } | |
| 3176 | + | cls = &Menu{} | |
| 3177 | + | cls.Ptr = cret | |
| 3178 | + | return cls | |
| 3000 | 3179 | } | |
| 3001 | 3180 | ||
| 3002 | 3181 | var xMenuAppend func(uintptr, string, string) | |
| @@ -3219,14 +3398,16 @@ var xNewMenuItem func(string, string) uintptr | |||
| 3219 | 3398 | // possibly the "target" attribute of the new item. See | |
| 3220 | 3399 | // g_menu_item_set_detailed_action() for more information. | |
| 3221 | 3400 | func NewMenuItem(LabelVar string, DetailedActionVar string) *MenuItem { | |
| 3222 | - | NewMenuItemPtr := xNewMenuItem(LabelVar, DetailedActionVar) | |
| 3223 | - | if NewMenuItemPtr == 0 { | |
| 3224 | - | return nil | |
| 3225 | - | } | |
| 3401 | + | var cls *MenuItem | |
| 3226 | 3402 | ||
| 3227 | - | NewMenuItemCls := &MenuItem{} | |
| 3228 | - | NewMenuItemCls.Ptr = NewMenuItemPtr | |
| 3229 | - | return NewMenuItemCls | |
| 3403 | + | cret := xNewMenuItem(LabelVar, DetailedActionVar) | |
| 3404 | + | ||
| 3405 | + | if cret == 0 { | |
| 3406 | + | return cls | |
| 3407 | + | } | |
| 3408 | + | cls = &MenuItem{} | |
| 3409 | + | cls.Ptr = cret | |
| 3410 | + | return cls | |
| 3230 | 3411 | } | |
| 3231 | 3412 | ||
| 3232 | 3413 | var xNewFromModelMenuItem func(uintptr, int) uintptr | |
| @@ -3237,14 +3418,16 @@ var xNewFromModelMenuItem func(uintptr, int) uintptr | |||
| 3237 | 3418 | // @item_index must be valid (ie: be sure to call | |
| 3238 | 3419 | // g_menu_model_get_n_items() first). | |
| 3239 | 3420 | func NewFromModelMenuItem(ModelVar *MenuModel, ItemIndexVar int) *MenuItem { | |
| 3240 | - | NewFromModelMenuItemPtr := xNewFromModelMenuItem(ModelVar.GoPointer(), ItemIndexVar) | |
| 3241 | - | if NewFromModelMenuItemPtr == 0 { | |
| 3242 | - | return nil | |
| 3243 | - | } | |
| 3421 | + | var cls *MenuItem | |
| 3422 | + | ||
| 3423 | + | cret := xNewFromModelMenuItem(ModelVar.GoPointer(), ItemIndexVar) | |
| 3244 | 3424 | ||
| 3245 | - | NewFromModelMenuItemCls := &MenuItem{} | |
| 3246 | - | NewFromModelMenuItemCls.Ptr = NewFromModelMenuItemPtr | |
| 3247 | - | return NewFromModelMenuItemCls | |
| 3425 | + | if cret == 0 { | |
| 3426 | + | return cls | |
| 3427 | + | } | |
| 3428 | + | cls = &MenuItem{} | |
| 3429 | + | cls.Ptr = cret | |
| 3430 | + | return cls | |
| 3248 | 3431 | } | |
| 3249 | 3432 | ||
| 3250 | 3433 | var xNewSectionMenuItem func(string, uintptr) uintptr | |
| @@ -3314,14 +3497,16 @@ var xNewSectionMenuItem func(string, uintptr) uintptr | |||
| 3314 | 3497 | // </menu> | |
| 3315 | 3498 | // ]| | |
| 3316 | 3499 | func NewSectionMenuItem(LabelVar string, SectionVar *MenuModel) *MenuItem { | |
| 3317 | - | NewSectionMenuItemPtr := xNewSectionMenuItem(LabelVar, SectionVar.GoPointer()) | |
| 3318 | - | if NewSectionMenuItemPtr == 0 { | |
| 3319 | - | return nil | |
| 3320 | - | } | |
| 3500 | + | var cls *MenuItem | |
| 3501 | + | ||
| 3502 | + | cret := xNewSectionMenuItem(LabelVar, SectionVar.GoPointer()) | |
| 3321 | 3503 | ||
| 3322 | - | NewSectionMenuItemCls := &MenuItem{} | |
| 3323 | - | NewSectionMenuItemCls.Ptr = NewSectionMenuItemPtr | |
| 3324 | - | return NewSectionMenuItemCls | |
| 3504 | + | if cret == 0 { | |
| 3505 | + | return cls | |
| 3506 | + | } | |
| 3507 | + | cls = &MenuItem{} | |
| 3508 | + | cls.Ptr = cret | |
| 3509 | + | return cls | |
| 3325 | 3510 | } | |
| 3326 | 3511 | ||
| 3327 | 3512 | var xNewSubmenuMenuItem func(string, uintptr) uintptr | |
| @@ -3331,14 +3516,16 @@ var xNewSubmenuMenuItem func(string, uintptr) uintptr | |||
| 3331 | 3516 | // This is a convenience API around g_menu_item_new() and | |
| 3332 | 3517 | // g_menu_item_set_submenu(). | |
| 3333 | 3518 | func NewSubmenuMenuItem(LabelVar string, SubmenuVar *MenuModel) *MenuItem { | |
| 3334 | - | NewSubmenuMenuItemPtr := xNewSubmenuMenuItem(LabelVar, SubmenuVar.GoPointer()) | |
| 3335 | - | if NewSubmenuMenuItemPtr == 0 { | |
| 3336 | - | return nil | |
| 3337 | - | } | |
| 3519 | + | var cls *MenuItem | |
| 3338 | 3520 | ||
| 3339 | - | NewSubmenuMenuItemCls := &MenuItem{} | |
| 3340 | - | NewSubmenuMenuItemCls.Ptr = NewSubmenuMenuItemPtr | |
| 3341 | - | return NewSubmenuMenuItemCls | |
| 3521 | + | cret := xNewSubmenuMenuItem(LabelVar, SubmenuVar.GoPointer()) | |
| 3522 | + | ||
| 3523 | + | if cret == 0 { | |
| 3524 | + | return cls | |
| 3525 | + | } | |
| 3526 | + | cls = &MenuItem{} | |
| 3527 | + | cls.Ptr = cret | |
| 3528 | + | return cls | |
| 3342 | 3529 | } | |
| 3343 | 3530 | ||
| 3344 | 3531 | var xMenuItemGetAttribute func(uintptr, string, string, ...interface{}) bool | |
| @@ -3354,8 +3541,8 @@ var xMenuItemGetAttribute func(uintptr, string, string, ...interface{}) bool | |||
| 3354 | 3541 | // returned. | |
| 3355 | 3542 | func (x *MenuItem) GetAttribute(AttributeVar string, FormatStringVar string, varArgs ...interface{}) bool { | |
| 3356 | 3543 | ||
| 3357 | - | return xMenuItemGetAttribute(x.GoPointer(), AttributeVar, FormatStringVar, varArgs...) | |
| 3358 | - | ||
| 3544 | + | cret := xMenuItemGetAttribute(x.GoPointer(), AttributeVar, FormatStringVar, varArgs...) | |
| 3545 | + | return cret | |
| 3359 | 3546 | } | |
| 3360 | 3547 | ||
| 3361 | 3548 | var xMenuItemGetAttributeValue func(uintptr, string, *glib.VariantType) *glib.Variant | |
| @@ -3367,24 +3554,24 @@ var xMenuItemGetAttributeValue func(uintptr, string, *glib.VariantType) *glib.Va | |||
| 3367 | 3554 | // simply does not exist. | |
| 3368 | 3555 | func (x *MenuItem) GetAttributeValue(AttributeVar string, ExpectedTypeVar *glib.VariantType) *glib.Variant { | |
| 3369 | 3556 | ||
| 3370 | - | return xMenuItemGetAttributeValue(x.GoPointer(), AttributeVar, ExpectedTypeVar) | |
| 3371 | - | ||
| 3557 | + | cret := xMenuItemGetAttributeValue(x.GoPointer(), AttributeVar, ExpectedTypeVar) | |
| 3558 | + | return cret | |
| 3372 | 3559 | } | |
| 3373 | 3560 | ||
| 3374 | 3561 | var xMenuItemGetLink func(uintptr, string) uintptr | |
| 3375 | 3562 | ||
| 3376 | 3563 | // Queries the named @link on @menu_item. | |
| 3377 | 3564 | func (x *MenuItem) GetLink(LinkVar string) *MenuModel { | |
| 3565 | + | var cls *MenuModel | |
| 3378 | 3566 | ||
| 3379 | - | GetLinkPtr := xMenuItemGetLink(x.GoPointer(), LinkVar) | |
| 3380 | - | if GetLinkPtr == 0 { | |
| 3381 | - | return nil | |
| 3382 | - | } | |
| 3383 | - | ||
| 3384 | - | GetLinkCls := &MenuModel{} | |
| 3385 | - | GetLinkCls.Ptr = GetLinkPtr | |
| 3386 | - | return GetLinkCls | |
| 3567 | + | cret := xMenuItemGetLink(x.GoPointer(), LinkVar) | |
| 3387 | 3568 | ||
| 3569 | + | if cret == 0 { | |
| 3570 | + | return cls | |
| 3571 | + | } | |
| 3572 | + | cls = &MenuModel{} | |
| 3573 | + | cls.Ptr = cret | |
| 3574 | + | return cls | |
| 3388 | 3575 | } | |
| 3389 | 3576 | ||
| 3390 | 3577 | var xMenuItemSetActionAndTarget func(uintptr, string, string, ...interface{}) | |
| @@ -3682,14 +3869,16 @@ var xNewNotification func(string) uintptr | |||
| 3682 | 3869 | // any properties after this call will not have any effect until | |
| 3683 | 3870 | // resending @notification. | |
| 3684 | 3871 | func NewNotification(TitleVar string) *Notification { | |
| 3685 | - | NewNotificationPtr := xNewNotification(TitleVar) | |
| 3686 | - | if NewNotificationPtr == 0 { | |
| 3687 | - | return nil | |
| 3688 | - | } | |
| 3872 | + | var cls *Notification | |
| 3873 | + | ||
| 3874 | + | cret := xNewNotification(TitleVar) | |
| 3689 | 3875 | ||
| 3690 | - | NewNotificationCls := &Notification{} | |
| 3691 | - | NewNotificationCls.Ptr = NewNotificationPtr | |
| 3692 | - | return NewNotificationCls | |
| 3876 | + | if cret == 0 { | |
| 3877 | + | return cls | |
| 3878 | + | } | |
| 3879 | + | cls = &Notification{} | |
| 3880 | + | cls.Ptr = cret | |
| 3881 | + | return cls | |
| 3693 | 3882 | } | |
| 3694 | 3883 | ||
| 3695 | 3884 | var xNotificationAddButton func(uintptr, string, string) | |
| @@ -3931,14 +4120,16 @@ var xNewPropertyAction func(string, uintptr, string) uintptr | |||
| 3931 | 4120 | // This function takes a reference on @object and doesn't release it | |
| 3932 | 4121 | // until the action is destroyed. | |
| 3933 | 4122 | func NewPropertyAction(NameVar string, ObjectVar *gobject.Object, PropertyNameVar string) *PropertyAction { | |
| 3934 | - | NewPropertyActionPtr := xNewPropertyAction(NameVar, ObjectVar.GoPointer(), PropertyNameVar) | |
| 3935 | - | if NewPropertyActionPtr == 0 { | |
| 3936 | - | return nil | |
| 3937 | - | } | |
| 4123 | + | var cls *PropertyAction | |
| 3938 | 4124 | ||
| 3939 | - | NewPropertyActionCls := &PropertyAction{} | |
| 3940 | - | NewPropertyActionCls.Ptr = NewPropertyActionPtr | |
| 3941 | - | return NewPropertyActionCls | |
| 4125 | + | cret := xNewPropertyAction(NameVar, ObjectVar.GoPointer(), PropertyNameVar) | |
| 4126 | + | ||
| 4127 | + | if cret == 0 { | |
| 4128 | + | return cls | |
| 4129 | + | } | |
| 4130 | + | cls = &PropertyAction{} | |
| 4131 | + | cls.Ptr = cret | |
| 4132 | + | return cls | |
| 3942 | 4133 | } | |
| 3943 | 4134 | ||
| 3944 | 4135 | func (c *PropertyAction) GoPointer() uintptr { | |
| @@ -3984,15 +4175,15 @@ func (x *PropertyAction) ChangeState(ValueVar *glib.Variant) { | |||
| 3984 | 4175 | // have its state changed from outside callers. | |
| 3985 | 4176 | func (x *PropertyAction) GetEnabled() bool { | |
| 3986 | 4177 | ||
| 3987 | - | return XGActionGetEnabled(x.GoPointer()) | |
| 3988 | - | ||
| 4178 | + | cret := XGActionGetEnabled(x.GoPointer()) | |
| 4179 | + | return cret | |
| 3989 | 4180 | } | |
| 3990 | 4181 | ||
| 3991 | 4182 | // Queries the name of @action. | |
| 3992 | 4183 | func (x *PropertyAction) GetName() string { | |
| 3993 | 4184 | ||
| 3994 | - | return XGActionGetName(x.GoPointer()) | |
| 3995 | - | ||
| 4185 | + | cret := XGActionGetName(x.GoPointer()) | |
| 4186 | + | return cret | |
| 3996 | 4187 | } | |
| 3997 | 4188 | ||
| 3998 | 4189 | // Queries the type of the parameter that must be given when activating | |
| @@ -4005,8 +4196,8 @@ func (x *PropertyAction) GetName() string { | |||
| 4005 | 4196 | // #GVariant, but %NULL instead. | |
| 4006 | 4197 | func (x *PropertyAction) GetParameterType() *glib.VariantType { | |
| 4007 | 4198 | ||
| 4008 | - | return XGActionGetParameterType(x.GoPointer()) | |
| 4009 | - | ||
| 4199 | + | cret := XGActionGetParameterType(x.GoPointer()) | |
| 4200 | + | return cret | |
| 4010 | 4201 | } | |
| 4011 | 4202 | ||
| 4012 | 4203 | // Queries the current state of @action. | |
| @@ -4019,8 +4210,8 @@ func (x *PropertyAction) GetParameterType() *glib.VariantType { | |||
| 4019 | 4210 | // g_variant_unref() when it is no longer required. | |
| 4020 | 4211 | func (x *PropertyAction) GetState() *glib.Variant { | |
| 4021 | 4212 | ||
| 4022 | - | return XGActionGetState(x.GoPointer()) | |
| 4023 | - | ||
| 4213 | + | cret := XGActionGetState(x.GoPointer()) | |
| 4214 | + | return cret | |
| 4024 | 4215 | } | |
| 4025 | 4216 | ||
| 4026 | 4217 | // Requests a hint about the valid range of values for the state of | |
| @@ -4043,8 +4234,8 @@ func (x *PropertyAction) GetState() *glib.Variant { | |||
| 4043 | 4234 | // g_variant_unref() when it is no longer required. | |
| 4044 | 4235 | func (x *PropertyAction) GetStateHint() *glib.Variant { | |
| 4045 | 4236 | ||
| 4046 | - | return XGActionGetStateHint(x.GoPointer()) | |
| 4047 | - | ||
| 4237 | + | cret := XGActionGetStateHint(x.GoPointer()) | |
| 4238 | + | return cret | |
| 4048 | 4239 | } | |
| 4049 | 4240 | ||
| 4050 | 4241 | // Queries the type of the state of @action. | |
| @@ -4061,8 +4252,8 @@ func (x *PropertyAction) GetStateHint() *glib.Variant { | |||
| 4061 | 4252 | // will return %NULL and you must not call g_action_change_state(). | |
| 4062 | 4253 | func (x *PropertyAction) GetStateType() *glib.VariantType { | |
| 4063 | 4254 | ||
| 4064 | - | return XGActionGetStateType(x.GoPointer()) | |
| 4065 | - | ||
| 4255 | + | cret := XGActionGetStateType(x.GoPointer()) | |
| 4256 | + | return cret | |
| 4066 | 4257 | } | |
| 4067 | 4258 | ||
| 4068 | 4259 | // A #GSimpleAction is the obvious simple implementation of the #GAction | |
| @@ -4087,14 +4278,16 @@ var xNewSimpleAction func(string, *glib.VariantType) uintptr | |||
| 4087 | 4278 | // The created action is stateless. See g_simple_action_new_stateful() to create | |
| 4088 | 4279 | // an action that has state. | |
| 4089 | 4280 | func NewSimpleAction(NameVar string, ParameterTypeVar *glib.VariantType) *SimpleAction { | |
| 4090 | - | NewSimpleActionPtr := xNewSimpleAction(NameVar, ParameterTypeVar) | |
| 4091 | - | if NewSimpleActionPtr == 0 { | |
| 4092 | - | return nil | |
| 4093 | - | } | |
| 4281 | + | var cls *SimpleAction | |
| 4282 | + | ||
| 4283 | + | cret := xNewSimpleAction(NameVar, ParameterTypeVar) | |
| 4094 | 4284 | ||
| 4095 | - | NewSimpleActionCls := &SimpleAction{} | |
| 4096 | - | NewSimpleActionCls.Ptr = NewSimpleActionPtr | |
| 4097 | - | return NewSimpleActionCls | |
| 4285 | + | if cret == 0 { | |
| 4286 | + | return cls | |
| 4287 | + | } | |
| 4288 | + | cls = &SimpleAction{} | |
| 4289 | + | cls.Ptr = cret | |
| 4290 | + | return cls | |
| 4098 | 4291 | } | |
| 4099 | 4292 | ||
| 4100 | 4293 | var xNewStatefulSimpleAction func(string, *glib.VariantType, *glib.Variant) uintptr | |
| @@ -4106,14 +4299,16 @@ var xNewStatefulSimpleAction func(string, *glib.VariantType, *glib.Variant) uint | |||
| 4106 | 4299 | // | |
| 4107 | 4300 | // If the @state #GVariant is floating, it is consumed. | |
| 4108 | 4301 | func NewStatefulSimpleAction(NameVar string, ParameterTypeVar *glib.VariantType, StateVar *glib.Variant) *SimpleAction { | |
| 4109 | - | NewStatefulSimpleActionPtr := xNewStatefulSimpleAction(NameVar, ParameterTypeVar, StateVar) | |
| 4110 | - | if NewStatefulSimpleActionPtr == 0 { | |
| 4111 | - | return nil | |
| 4112 | - | } | |
| 4302 | + | var cls *SimpleAction | |
| 4303 | + | ||
| 4304 | + | cret := xNewStatefulSimpleAction(NameVar, ParameterTypeVar, StateVar) | |
| 4113 | 4305 | ||
| 4114 | - | NewStatefulSimpleActionCls := &SimpleAction{} | |
| 4115 | - | NewStatefulSimpleActionCls.Ptr = NewStatefulSimpleActionPtr | |
| 4116 | - | return NewStatefulSimpleActionCls | |
| 4306 | + | if cret == 0 { | |
| 4307 | + | return cls | |
| 4308 | + | } | |
| 4309 | + | cls = &SimpleAction{} | |
| 4310 | + | cls.Ptr = cret | |
| 4311 | + | return cls | |
| 4117 | 4312 | } | |
| 4118 | 4313 | ||
| 4119 | 4314 | var xSimpleActionSetEnabled func(uintptr, bool) | |
| @@ -4275,15 +4470,15 @@ func (x *SimpleAction) ChangeState(ValueVar *glib.Variant) { | |||
| 4275 | 4470 | // have its state changed from outside callers. | |
| 4276 | 4471 | func (x *SimpleAction) GetEnabled() bool { | |
| 4277 | 4472 | ||
| 4278 | - | return XGActionGetEnabled(x.GoPointer()) | |
| 4279 | - | ||
| 4473 | + | cret := XGActionGetEnabled(x.GoPointer()) | |
| 4474 | + | return cret | |
| 4280 | 4475 | } | |
| 4281 | 4476 | ||
| 4282 | 4477 | // Queries the name of @action. | |
| 4283 | 4478 | func (x *SimpleAction) GetName() string { | |
| 4284 | 4479 | ||
| 4285 | - | return XGActionGetName(x.GoPointer()) | |
| 4286 | - | ||
| 4480 | + | cret := XGActionGetName(x.GoPointer()) | |
| 4481 | + | return cret | |
| 4287 | 4482 | } | |
| 4288 | 4483 | ||
| 4289 | 4484 | // Queries the type of the parameter that must be given when activating | |
| @@ -4296,8 +4491,8 @@ func (x *SimpleAction) GetName() string { | |||
| 4296 | 4491 | // #GVariant, but %NULL instead. | |
| 4297 | 4492 | func (x *SimpleAction) GetParameterType() *glib.VariantType { | |
| 4298 | 4493 | ||
| 4299 | - | return XGActionGetParameterType(x.GoPointer()) | |
| 4300 | - | ||
| 4494 | + | cret := XGActionGetParameterType(x.GoPointer()) | |
| 4495 | + | return cret | |
| 4301 | 4496 | } | |
| 4302 | 4497 | ||
| 4303 | 4498 | // Queries the current state of @action. | |
| @@ -4310,8 +4505,8 @@ func (x *SimpleAction) GetParameterType() *glib.VariantType { | |||
| 4310 | 4505 | // g_variant_unref() when it is no longer required. | |
| 4311 | 4506 | func (x *SimpleAction) GetState() *glib.Variant { | |
| 4312 | 4507 | ||
| 4313 | - | return XGActionGetState(x.GoPointer()) | |
| 4314 | - | ||
| 4508 | + | cret := XGActionGetState(x.GoPointer()) | |
| 4509 | + | return cret | |
| 4315 | 4510 | } | |
| 4316 | 4511 | ||
| 4317 | 4512 | // Requests a hint about the valid range of values for the state of | |
| @@ -4334,8 +4529,8 @@ func (x *SimpleAction) GetState() *glib.Variant { | |||
| 4334 | 4529 | // g_variant_unref() when it is no longer required. | |
| 4335 | 4530 | func (x *SimpleAction) GetStateHint() *glib.Variant { | |
| 4336 | 4531 | ||
| 4337 | - | return XGActionGetStateHint(x.GoPointer()) | |
| 4338 | - | ||
| 4532 | + | cret := XGActionGetStateHint(x.GoPointer()) | |
| 4533 | + | return cret | |
| 4339 | 4534 | } | |
| 4340 | 4535 | ||
| 4341 | 4536 | // Queries the type of the state of @action. | |
| @@ -4352,8 +4547,8 @@ func (x *SimpleAction) GetStateHint() *glib.Variant { | |||
| 4352 | 4547 | // will return %NULL and you must not call g_action_change_state(). | |
| 4353 | 4548 | func (x *SimpleAction) GetStateType() *glib.VariantType { | |
| 4354 | 4549 | ||
| 4355 | - | return XGActionGetStateType(x.GoPointer()) | |
| 4356 | - | ||
| 4550 | + | cret := XGActionGetStateType(x.GoPointer()) | |
| 4551 | + | return cret | |
| 4357 | 4552 | } | |
| 4358 | 4553 | ||
| 4359 | 4554 | // GSimpleIOStream creates a #GIOStream from an arbitrary #GInputStream and | |
| @@ -4379,14 +4574,16 @@ var xNewSimpleIOStream func(uintptr, uintptr) uintptr | |||
| 4379 | 4574 | // Creates a new #GSimpleIOStream wrapping @input_stream and @output_stream. | |
| 4380 | 4575 | // See also #GIOStream. | |
| 4381 | 4576 | func NewSimpleIOStream(InputStreamVar *InputStream, OutputStreamVar *OutputStream) *IOStream { | |
| 4382 | - | NewSimpleIOStreamPtr := xNewSimpleIOStream(InputStreamVar.GoPointer(), OutputStreamVar.GoPointer()) | |
| 4383 | - | if NewSimpleIOStreamPtr == 0 { | |
| 4384 | - | return nil | |
| 4385 | - | } | |
| 4577 | + | var cls *IOStream | |
| 4578 | + | ||
| 4579 | + | cret := xNewSimpleIOStream(InputStreamVar.GoPointer(), OutputStreamVar.GoPointer()) | |
| 4386 | 4580 | ||
| 4387 | - | NewSimpleIOStreamCls := &IOStream{} | |
| 4388 | - | NewSimpleIOStreamCls.Ptr = NewSimpleIOStreamPtr | |
| 4389 | - | return NewSimpleIOStreamCls | |
| 4581 | + | if cret == 0 { | |
| 4582 | + | return cls | |
| 4583 | + | } | |
| 4584 | + | cls = &IOStream{} | |
| 4585 | + | cls.Ptr = cret | |
| 4586 | + | return cls | |
| 4390 | 4587 | } | |
| 4391 | 4588 | ||
| 4392 | 4589 | func (c *SimpleIOStream) GoPointer() uintptr { | |
| @@ -4417,14 +4614,16 @@ var xNewSimplePermission func(bool) uintptr | |||
| 4417 | 4614 | // Creates a new #GPermission instance that represents an action that is | |
| 4418 | 4615 | // either always or never allowed. | |
| 4419 | 4616 | func NewSimplePermission(AllowedVar bool) *Permission { | |
| 4420 | - | NewSimplePermissionPtr := xNewSimplePermission(AllowedVar) | |
| 4421 | - | if NewSimplePermissionPtr == 0 { | |
| 4422 | - | return nil | |
| 4423 | - | } | |
| 4617 | + | var cls *Permission | |
| 4424 | 4618 | ||
| 4425 | - | NewSimplePermissionCls := &Permission{} | |
| 4426 | - | NewSimplePermissionCls.Ptr = NewSimplePermissionPtr | |
| 4427 | - | return NewSimplePermissionCls | |
| 4619 | + | cret := xNewSimplePermission(AllowedVar) | |
| 4620 | + | ||
| 4621 | + | if cret == 0 { | |
| 4622 | + | return cls | |
| 4623 | + | } | |
| 4624 | + | cls = &Permission{} | |
| 4625 | + | cls.Ptr = cret | |
| 4626 | + | return cls | |
| 4428 | 4627 | } | |
| 4429 | 4628 | ||
| 4430 | 4629 | func (c *SimplePermission) GoPointer() uintptr { | |
| @@ -4512,33 +4711,42 @@ var xNewSubprocess func(SubprocessFlags, **glib.Error, string, ...interface{}) u | |||
| 4512 | 4711 | // | |
| 4513 | 4712 | // The argument list must be terminated with %NULL. | |
| 4514 | 4713 | func NewSubprocess(FlagsVar SubprocessFlags, ErrorVar **glib.Error, Argv0Var string, varArgs ...interface{}) *Subprocess { | |
| 4515 | - | NewSubprocessPtr := xNewSubprocess(FlagsVar, ErrorVar, Argv0Var, varArgs...) | |
| 4516 | - | if NewSubprocessPtr == 0 { | |
| 4517 | - | return nil | |
| 4518 | - | } | |
| 4714 | + | var cls *Subprocess | |
| 4519 | 4715 | ||
| 4520 | - | NewSubprocessCls := &Subprocess{} | |
| 4521 | - | NewSubprocessCls.Ptr = NewSubprocessPtr | |
| 4522 | - | return NewSubprocessCls | |
| 4716 | + | cret := xNewSubprocess(FlagsVar, ErrorVar, Argv0Var, varArgs...) | |
| 4717 | + | ||
| 4718 | + | if cret == 0 { | |
| 4719 | + | return cls | |
| 4720 | + | } | |
| 4721 | + | cls = &Subprocess{} | |
| 4722 | + | cls.Ptr = cret | |
| 4723 | + | return cls | |
| 4523 | 4724 | } | |
| 4524 | 4725 | ||
| 4525 | - | var xNewvSubprocess func(uintptr, SubprocessFlags) uintptr | |
| 4726 | + | var xNewvSubprocess func(uintptr, SubprocessFlags, **glib.Error) uintptr | |
| 4526 | 4727 | ||
| 4527 | 4728 | // Create a new process with the given flags and argument list. | |
| 4528 | 4729 | // | |
| 4529 | 4730 | // The argument list is expected to be %NULL-terminated. | |
| 4530 | - | func NewvSubprocess(ArgvVar uintptr, FlagsVar SubprocessFlags) *Subprocess { | |
| 4531 | - | NewvSubprocessPtr := xNewvSubprocess(ArgvVar, FlagsVar) | |
| 4532 | - | if NewvSubprocessPtr == 0 { | |
| 4533 | - | return nil | |
| 4731 | + | func NewvSubprocess(ArgvVar uintptr, FlagsVar SubprocessFlags) (*Subprocess, error) { | |
| 4732 | + | var cls *Subprocess | |
| 4733 | + | var cerr *glib.Error | |
| 4734 | + | ||
| 4735 | + | cret := xNewvSubprocess(ArgvVar, FlagsVar, &cerr) | |
| 4736 | + | ||
| 4737 | + | if cret == 0 { | |
| 4738 | + | return cls, cerr | |
| 4534 | 4739 | } | |
| 4740 | + | cls = &Subprocess{} | |
| 4741 | + | cls.Ptr = cret | |
| 4742 | + | if cerr == nil { | |
| 4743 | + | return cls, nil | |
| 4744 | + | } | |
| 4745 | + | return cls, cerr | |
| 4535 | 4746 | ||
| 4536 | - | NewvSubprocessCls := &Subprocess{} | |
| 4537 | - | NewvSubprocessCls.Ptr = NewvSubprocessPtr | |
| 4538 | - | return NewvSubprocessCls | |
| 4539 | 4747 | } | |
| 4540 | 4748 | ||
| 4541 | - | var xSubprocessCommunicate func(uintptr, *glib.Bytes, uintptr, **glib.Bytes, **glib.Bytes) bool | |
| 4749 | + | var xSubprocessCommunicate func(uintptr, *glib.Bytes, uintptr, **glib.Bytes, **glib.Bytes, **glib.Error) bool | |
| 4542 | 4750 | ||
| 4543 | 4751 | // Communicate with the subprocess until it terminates, and all input | |
| 4544 | 4752 | // and output has been completed. | |
| @@ -4581,9 +4789,14 @@ var xSubprocessCommunicate func(uintptr, *glib.Bytes, uintptr, **glib.Bytes, **g | |||
| 4581 | 4789 | // even if the operation was cancelled. You should especially not | |
| 4582 | 4790 | // attempt to interact with the pipes while the operation is in progress | |
| 4583 | 4791 | // (either from another thread or if using the asynchronous version). | |
| 4584 | - | func (x *Subprocess) Communicate(StdinBufVar *glib.Bytes, CancellableVar *Cancellable, StdoutBufVar **glib.Bytes, StderrBufVar **glib.Bytes) bool { | |
| 4792 | + | func (x *Subprocess) Communicate(StdinBufVar *glib.Bytes, CancellableVar *Cancellable, StdoutBufVar **glib.Bytes, StderrBufVar **glib.Bytes) (bool, error) { | |
| 4793 | + | var cerr *glib.Error | |
| 4585 | 4794 | ||
| 4586 | - | return xSubprocessCommunicate(x.GoPointer(), StdinBufVar, CancellableVar.GoPointer(), StdoutBufVar, StderrBufVar) | |
| 4795 | + | cret := xSubprocessCommunicate(x.GoPointer(), StdinBufVar, CancellableVar.GoPointer(), StdoutBufVar, StderrBufVar, &cerr) | |
| 4796 | + | if cerr == nil { | |
| 4797 | + | return cret, nil | |
| 4798 | + | } | |
| 4799 | + | return cret, cerr | |
| 4587 | 4800 | ||
| 4588 | 4801 | } | |
| 4589 | 4802 | ||
| @@ -4597,25 +4810,35 @@ func (x *Subprocess) CommunicateAsync(StdinBufVar *glib.Bytes, CancellableVar *C | |||
| 4597 | 4810 | ||
| 4598 | 4811 | } | |
| 4599 | 4812 | ||
| 4600 | - | var xSubprocessCommunicateFinish func(uintptr, uintptr, **glib.Bytes, **glib.Bytes) bool | |
| 4813 | + | var xSubprocessCommunicateFinish func(uintptr, uintptr, **glib.Bytes, **glib.Bytes, **glib.Error) bool | |
| 4601 | 4814 | ||
| 4602 | 4815 | // Complete an invocation of g_subprocess_communicate_async(). | |
| 4603 | - | func (x *Subprocess) CommunicateFinish(ResultVar AsyncResult, StdoutBufVar **glib.Bytes, StderrBufVar **glib.Bytes) bool { | |
| 4816 | + | func (x *Subprocess) CommunicateFinish(ResultVar AsyncResult, StdoutBufVar **glib.Bytes, StderrBufVar **glib.Bytes) (bool, error) { | |
| 4817 | + | var cerr *glib.Error | |
| 4604 | 4818 | ||
| 4605 | - | return xSubprocessCommunicateFinish(x.GoPointer(), ResultVar.GoPointer(), StdoutBufVar, StderrBufVar) | |
| 4819 | + | cret := xSubprocessCommunicateFinish(x.GoPointer(), ResultVar.GoPointer(), StdoutBufVar, StderrBufVar, &cerr) | |
| 4820 | + | if cerr == nil { | |
| 4821 | + | return cret, nil | |
| 4822 | + | } | |
| 4823 | + | return cret, cerr | |
| 4606 | 4824 | ||
| 4607 | 4825 | } | |
| 4608 | 4826 | ||
| 4609 | - | var xSubprocessCommunicateUtf8 func(uintptr, string, uintptr, string, string) bool | |
| 4827 | + | var xSubprocessCommunicateUtf8 func(uintptr, string, uintptr, string, string, **glib.Error) bool | |
| 4610 | 4828 | ||
| 4611 | 4829 | // Like g_subprocess_communicate(), but validates the output of the | |
| 4612 | 4830 | // process as UTF-8, and returns it as a regular NUL terminated string. | |
| 4613 | 4831 | // | |
| 4614 | 4832 | // On error, @stdout_buf and @stderr_buf will be set to undefined values and | |
| 4615 | 4833 | // should not be used. | |
| 4616 | - | func (x *Subprocess) CommunicateUtf8(StdinBufVar string, CancellableVar *Cancellable, StdoutBufVar string, StderrBufVar string) bool { | |
| 4834 | + | func (x *Subprocess) CommunicateUtf8(StdinBufVar string, CancellableVar *Cancellable, StdoutBufVar string, StderrBufVar string) (bool, error) { | |
| 4835 | + | var cerr *glib.Error | |
| 4617 | 4836 | ||
| 4618 | - | return xSubprocessCommunicateUtf8(x.GoPointer(), StdinBufVar, CancellableVar.GoPointer(), StdoutBufVar, StderrBufVar) | |
| 4837 | + | cret := xSubprocessCommunicateUtf8(x.GoPointer(), StdinBufVar, CancellableVar.GoPointer(), StdoutBufVar, StderrBufVar, &cerr) | |
| 4838 | + | if cerr == nil { | |
| 4839 | + | return cret, nil | |
| 4840 | + | } | |
| 4841 | + | return cret, cerr | |
| 4619 | 4842 | ||
| 4620 | 4843 | } | |
| 4621 | 4844 | ||
| @@ -4629,12 +4852,17 @@ func (x *Subprocess) CommunicateUtf8Async(StdinBufVar string, CancellableVar *Ca | |||
| 4629 | 4852 | ||
| 4630 | 4853 | } | |
| 4631 | 4854 | ||
| 4632 | - | var xSubprocessCommunicateUtf8Finish func(uintptr, uintptr, string, string) bool | |
| 4855 | + | var xSubprocessCommunicateUtf8Finish func(uintptr, uintptr, string, string, **glib.Error) bool | |
| 4633 | 4856 | ||
| 4634 | 4857 | // Complete an invocation of g_subprocess_communicate_utf8_async(). | |
| 4635 | - | func (x *Subprocess) CommunicateUtf8Finish(ResultVar AsyncResult, StdoutBufVar string, StderrBufVar string) bool { | |
| 4858 | + | func (x *Subprocess) CommunicateUtf8Finish(ResultVar AsyncResult, StdoutBufVar string, StderrBufVar string) (bool, error) { | |
| 4859 | + | var cerr *glib.Error | |
| 4636 | 4860 | ||
| 4637 | - | return xSubprocessCommunicateUtf8Finish(x.GoPointer(), ResultVar.GoPointer(), StdoutBufVar, StderrBufVar) | |
| 4861 | + | cret := xSubprocessCommunicateUtf8Finish(x.GoPointer(), ResultVar.GoPointer(), StdoutBufVar, StderrBufVar, &cerr) | |
| 4862 | + | if cerr == nil { | |
| 4863 | + | return cret, nil | |
| 4864 | + | } | |
| 4865 | + | return cret, cerr | |
| 4638 | 4866 | ||
| 4639 | 4867 | } | |
| 4640 | 4868 | ||
| @@ -4665,8 +4893,8 @@ var xSubprocessGetExitStatus func(uintptr) int | |||
| 4665 | 4893 | // unless g_subprocess_get_if_exited() returned %TRUE. | |
| 4666 | 4894 | func (x *Subprocess) GetExitStatus() int { | |
| 4667 | 4895 | ||
| 4668 | - | return xSubprocessGetExitStatus(x.GoPointer()) | |
| 4669 | - | ||
| 4896 | + | cret := xSubprocessGetExitStatus(x.GoPointer()) | |
| 4897 | + | return cret | |
| 4670 | 4898 | } | |
| 4671 | 4899 | ||
| 4672 | 4900 | var xSubprocessGetIdentifier func(uintptr) string | |
| @@ -4676,8 +4904,8 @@ var xSubprocessGetIdentifier func(uintptr) string | |||
| 4676 | 4904 | // If the subprocess has terminated, this will return %NULL. | |
| 4677 | 4905 | func (x *Subprocess) GetIdentifier() string { | |
| 4678 | 4906 | ||
| 4679 | - | return xSubprocessGetIdentifier(x.GoPointer()) | |
| 4680 | - | ||
| 4907 | + | cret := xSubprocessGetIdentifier(x.GoPointer()) | |
| 4908 | + | return cret | |
| 4681 | 4909 | } | |
| 4682 | 4910 | ||
| 4683 | 4911 | var xSubprocessGetIfExited func(uintptr) bool | |
| @@ -4691,8 +4919,8 @@ var xSubprocessGetIfExited func(uintptr) bool | |||
| 4691 | 4919 | // returned. | |
| 4692 | 4920 | func (x *Subprocess) GetIfExited() bool { | |
| 4693 | 4921 | ||
| 4694 | - | return xSubprocessGetIfExited(x.GoPointer()) | |
| 4695 | - | ||
| 4922 | + | cret := xSubprocessGetIfExited(x.GoPointer()) | |
| 4923 | + | return cret | |
| 4696 | 4924 | } | |
| 4697 | 4925 | ||
| 4698 | 4926 | var xSubprocessGetIfSignaled func(uintptr) bool | |
| @@ -4705,8 +4933,8 @@ var xSubprocessGetIfSignaled func(uintptr) bool | |||
| 4705 | 4933 | // returned. | |
| 4706 | 4934 | func (x *Subprocess) GetIfSignaled() bool { | |
| 4707 | 4935 | ||
| 4708 | - | return xSubprocessGetIfSignaled(x.GoPointer()) | |
| 4709 | - | ||
| 4936 | + | cret := xSubprocessGetIfSignaled(x.GoPointer()) | |
| 4937 | + | return cret | |
| 4710 | 4938 | } | |
| 4711 | 4939 | ||
| 4712 | 4940 | var xSubprocessGetStatus func(uintptr) int | |
| @@ -4724,8 +4952,8 @@ var xSubprocessGetStatus func(uintptr) int | |||
| 4724 | 4952 | // returned. | |
| 4725 | 4953 | func (x *Subprocess) GetStatus() int { | |
| 4726 | 4954 | ||
| 4727 | - | return xSubprocessGetStatus(x.GoPointer()) | |
| 4728 | - | ||
| 4955 | + | cret := xSubprocessGetStatus(x.GoPointer()) | |
| 4956 | + | return cret | |
| 4729 | 4957 | } | |
| 4730 | 4958 | ||
| 4731 | 4959 | var xSubprocessGetStderrPipe func(uintptr) uintptr | |
| @@ -4736,18 +4964,17 @@ var xSubprocessGetStderrPipe func(uintptr) uintptr | |||
| 4736 | 4964 | // The process must have been created with %G_SUBPROCESS_FLAGS_STDERR_PIPE, | |
| 4737 | 4965 | // otherwise %NULL will be returned. | |
| 4738 | 4966 | func (x *Subprocess) GetStderrPipe() *InputStream { | |
| 4967 | + | var cls *InputStream | |
| 4739 | 4968 | ||
| 4740 | - | GetStderrPipePtr := xSubprocessGetStderrPipe(x.GoPointer()) | |
| 4741 | - | if GetStderrPipePtr == 0 { | |
| 4742 | - | return nil | |
| 4743 | - | } | |
| 4744 | - | ||
| 4745 | - | gobject.IncreaseRef(GetStderrPipePtr) | |
| 4746 | - | ||
| 4747 | - | GetStderrPipeCls := &InputStream{} | |
| 4748 | - | GetStderrPipeCls.Ptr = GetStderrPipePtr | |
| 4749 | - | return GetStderrPipeCls | |
| 4969 | + | cret := xSubprocessGetStderrPipe(x.GoPointer()) | |
| 4750 | 4970 | ||
| 4971 | + | if cret == 0 { | |
| 4972 | + | return cls | |
| 4973 | + | } | |
| 4974 | + | gobject.IncreaseRef(cret) | |
| 4975 | + | cls = &InputStream{} | |
| 4976 | + | cls.Ptr = cret | |
| 4977 | + | return cls | |
| 4751 | 4978 | } | |
| 4752 | 4979 | ||
| 4753 | 4980 | var xSubprocessGetStdinPipe func(uintptr) uintptr | |
| @@ -4758,18 +4985,17 @@ var xSubprocessGetStdinPipe func(uintptr) uintptr | |||
| 4758 | 4985 | // The process must have been created with %G_SUBPROCESS_FLAGS_STDIN_PIPE and | |
| 4759 | 4986 | // not %G_SUBPROCESS_FLAGS_STDIN_INHERIT, otherwise %NULL will be returned. | |
| 4760 | 4987 | func (x *Subprocess) GetStdinPipe() *OutputStream { | |
| 4988 | + | var cls *OutputStream | |
| 4761 | 4989 | ||
| 4762 | - | GetStdinPipePtr := xSubprocessGetStdinPipe(x.GoPointer()) | |
| 4763 | - | if GetStdinPipePtr == 0 { | |
| 4764 | - | return nil | |
| 4765 | - | } | |
| 4766 | - | ||
| 4767 | - | gobject.IncreaseRef(GetStdinPipePtr) | |
| 4768 | - | ||
| 4769 | - | GetStdinPipeCls := &OutputStream{} | |
| 4770 | - | GetStdinPipeCls.Ptr = GetStdinPipePtr | |
| 4771 | - | return GetStdinPipeCls | |
| 4990 | + | cret := xSubprocessGetStdinPipe(x.GoPointer()) | |
| 4772 | 4991 | ||
| 4992 | + | if cret == 0 { | |
| 4993 | + | return cls | |
| 4994 | + | } | |
| 4995 | + | gobject.IncreaseRef(cret) | |
| 4996 | + | cls = &OutputStream{} | |
| 4997 | + | cls.Ptr = cret | |
| 4998 | + | return cls | |
| 4773 | 4999 | } | |
| 4774 | 5000 | ||
| 4775 | 5001 | var xSubprocessGetStdoutPipe func(uintptr) uintptr | |
| @@ -4780,18 +5006,17 @@ var xSubprocessGetStdoutPipe func(uintptr) uintptr | |||
| 4780 | 5006 | // The process must have been created with %G_SUBPROCESS_FLAGS_STDOUT_PIPE, | |
| 4781 | 5007 | // otherwise %NULL will be returned. | |
| 4782 | 5008 | func (x *Subprocess) GetStdoutPipe() *InputStream { | |
| 5009 | + | var cls *InputStream | |
| 4783 | 5010 | ||
| 4784 | - | GetStdoutPipePtr := xSubprocessGetStdoutPipe(x.GoPointer()) | |
| 4785 | - | if GetStdoutPipePtr == 0 { | |
| 4786 | - | return nil | |
| 4787 | - | } | |
| 4788 | - | ||
| 4789 | - | gobject.IncreaseRef(GetStdoutPipePtr) | |
| 4790 | - | ||
| 4791 | - | GetStdoutPipeCls := &InputStream{} | |
| 4792 | - | GetStdoutPipeCls.Ptr = GetStdoutPipePtr | |
| 4793 | - | return GetStdoutPipeCls | |
| 5011 | + | cret := xSubprocessGetStdoutPipe(x.GoPointer()) | |
| 4794 | 5012 | ||
| 5013 | + | if cret == 0 { | |
| 5014 | + | return cls | |
| 5015 | + | } | |
| 5016 | + | gobject.IncreaseRef(cret) | |
| 5017 | + | cls = &InputStream{} | |
| 5018 | + | cls.Ptr = cret | |
| 5019 | + | return cls | |
| 4795 | 5020 | } | |
| 4796 | 5021 | ||
| 4797 | 5022 | var xSubprocessGetSuccessful func(uintptr) bool | |
| @@ -4804,8 +5029,8 @@ var xSubprocessGetSuccessful func(uintptr) bool | |||
| 4804 | 5029 | // returned. | |
| 4805 | 5030 | func (x *Subprocess) GetSuccessful() bool { | |
| 4806 | 5031 | ||
| 4807 | - | return xSubprocessGetSuccessful(x.GoPointer()) | |
| 4808 | - | ||
| 5032 | + | cret := xSubprocessGetSuccessful(x.GoPointer()) | |
| 5033 | + | return cret | |
| 4809 | 5034 | } | |
| 4810 | 5035 | ||
| 4811 | 5036 | var xSubprocessGetTermSig func(uintptr) int | |
| @@ -4819,8 +5044,8 @@ var xSubprocessGetTermSig func(uintptr) int | |||
| 4819 | 5044 | // unless g_subprocess_get_if_signaled() returned %TRUE. | |
| 4820 | 5045 | func (x *Subprocess) GetTermSig() int { | |
| 4821 | 5046 | ||
| 4822 | - | return xSubprocessGetTermSig(x.GoPointer()) | |
| 4823 | - | ||
| 5047 | + | cret := xSubprocessGetTermSig(x.GoPointer()) | |
| 5048 | + | return cret | |
| 4824 | 5049 | } | |
| 4825 | 5050 | ||
| 4826 | 5051 | var xSubprocessSendSignal func(uintptr, int) | |
| @@ -4838,7 +5063,7 @@ func (x *Subprocess) SendSignal(SignalNumVar int) { | |||
| 4838 | 5063 | ||
| 4839 | 5064 | } | |
| 4840 | 5065 | ||
| 4841 | - | var xSubprocessWait func(uintptr, uintptr) bool | |
| 5066 | + | var xSubprocessWait func(uintptr, uintptr, **glib.Error) bool | |
| 4842 | 5067 | ||
| 4843 | 5068 | // Synchronously wait for the subprocess to terminate. | |
| 4844 | 5069 | // | |
| @@ -4851,9 +5076,14 @@ var xSubprocessWait func(uintptr, uintptr) bool | |||
| 4851 | 5076 | // | |
| 4852 | 5077 | // Cancelling @cancellable doesn't kill the subprocess. Call | |
| 4853 | 5078 | // g_subprocess_force_exit() if it is desirable. | |
| 4854 | - | func (x *Subprocess) Wait(CancellableVar *Cancellable) bool { | |
| 5079 | + | func (x *Subprocess) Wait(CancellableVar *Cancellable) (bool, error) { | |
| 5080 | + | var cerr *glib.Error | |
| 4855 | 5081 | ||
| 4856 | - | return xSubprocessWait(x.GoPointer(), CancellableVar.GoPointer()) | |
| 5082 | + | cret := xSubprocessWait(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 5083 | + | if cerr == nil { | |
| 5084 | + | return cret, nil | |
| 5085 | + | } | |
| 5086 | + | return cret, cerr | |
| 4857 | 5087 | ||
| 4858 | 5088 | } | |
| 4859 | 5089 | ||
| @@ -4868,12 +5098,17 @@ func (x *Subprocess) WaitAsync(CancellableVar *Cancellable, CallbackVar AsyncRea | |||
| 4868 | 5098 | ||
| 4869 | 5099 | } | |
| 4870 | 5100 | ||
| 4871 | - | var xSubprocessWaitCheck func(uintptr, uintptr) bool | |
| 5101 | + | var xSubprocessWaitCheck func(uintptr, uintptr, **glib.Error) bool | |
| 4872 | 5102 | ||
| 4873 | 5103 | // Combines g_subprocess_wait() with g_spawn_check_wait_status(). | |
| 4874 | - | func (x *Subprocess) WaitCheck(CancellableVar *Cancellable) bool { | |
| 5104 | + | func (x *Subprocess) WaitCheck(CancellableVar *Cancellable) (bool, error) { | |
| 5105 | + | var cerr *glib.Error | |
| 4875 | 5106 | ||
| 4876 | - | return xSubprocessWaitCheck(x.GoPointer(), CancellableVar.GoPointer()) | |
| 5107 | + | cret := xSubprocessWaitCheck(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 5108 | + | if cerr == nil { | |
| 5109 | + | return cret, nil | |
| 5110 | + | } | |
| 5111 | + | return cret, cerr | |
| 4877 | 5112 | ||
| 4878 | 5113 | } | |
| 4879 | 5114 | ||
| @@ -4888,23 +5123,33 @@ func (x *Subprocess) WaitCheckAsync(CancellableVar *Cancellable, CallbackVar Asy | |||
| 4888 | 5123 | ||
| 4889 | 5124 | } | |
| 4890 | 5125 | ||
| 4891 | - | var xSubprocessWaitCheckFinish func(uintptr, uintptr) bool | |
| 5126 | + | var xSubprocessWaitCheckFinish func(uintptr, uintptr, **glib.Error) bool | |
| 4892 | 5127 | ||
| 4893 | 5128 | // Collects the result of a previous call to | |
| 4894 | 5129 | // g_subprocess_wait_check_async(). | |
| 4895 | - | func (x *Subprocess) WaitCheckFinish(ResultVar AsyncResult) bool { | |
| 5130 | + | func (x *Subprocess) WaitCheckFinish(ResultVar AsyncResult) (bool, error) { | |
| 5131 | + | var cerr *glib.Error | |
| 4896 | 5132 | ||
| 4897 | - | return xSubprocessWaitCheckFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 5133 | + | cret := xSubprocessWaitCheckFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 5134 | + | if cerr == nil { | |
| 5135 | + | return cret, nil | |
| 5136 | + | } | |
| 5137 | + | return cret, cerr | |
| 4898 | 5138 | ||
| 4899 | 5139 | } | |
| 4900 | 5140 | ||
| 4901 | - | var xSubprocessWaitFinish func(uintptr, uintptr) bool | |
| 5141 | + | var xSubprocessWaitFinish func(uintptr, uintptr, **glib.Error) bool | |
| 4902 | 5142 | ||
| 4903 | 5143 | // Collects the result of a previous call to | |
| 4904 | 5144 | // g_subprocess_wait_async(). | |
| 4905 | - | func (x *Subprocess) WaitFinish(ResultVar AsyncResult) bool { | |
| 5145 | + | func (x *Subprocess) WaitFinish(ResultVar AsyncResult) (bool, error) { | |
| 5146 | + | var cerr *glib.Error | |
| 4906 | 5147 | ||
| 4907 | - | return xSubprocessWaitFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 5148 | + | cret := xSubprocessWaitFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 5149 | + | if cerr == nil { | |
| 5150 | + | return cret, nil | |
| 5151 | + | } | |
| 5152 | + | return cret, cerr | |
| 4908 | 5153 | ||
| 4909 | 5154 | } | |
| 4910 | 5155 | ||
| @@ -4954,9 +5199,14 @@ func (c *Subprocess) SetGoPointer(ptr uintptr) { | |||
| 4954 | 5199 | // In this pattern, a caller would expect to be able to call g_initable_init() | |
| 4955 | 5200 | // on the result of g_object_new(), regardless of whether it is in fact a new | |
| 4956 | 5201 | // instance. | |
| 4957 | - | func (x *Subprocess) Init(CancellableVar *Cancellable) bool { | |
| 5202 | + | func (x *Subprocess) Init(CancellableVar *Cancellable) (bool, error) { | |
| 5203 | + | var cerr *glib.Error | |
| 4958 | 5204 | ||
| 4959 | - | return XGInitableInit(x.GoPointer(), CancellableVar.GoPointer()) | |
| 5205 | + | cret := XGInitableInit(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 5206 | + | if cerr == nil { | |
| 5207 | + | return cret, nil | |
| 5208 | + | } | |
| 5209 | + | return cret, cerr | |
| 4960 | 5210 | ||
| 4961 | 5211 | } | |
| 4962 | 5212 | ||
| @@ -4986,14 +5236,16 @@ var xNewSubprocessLauncher func(SubprocessFlags) uintptr | |||
| 4986 | 5236 | // environment of the calling process is made at the time of this call | |
| 4987 | 5237 | // and will be used as the environment that the process is launched in. | |
| 4988 | 5238 | func NewSubprocessLauncher(FlagsVar SubprocessFlags) *SubprocessLauncher { | |
| 4989 | - | NewSubprocessLauncherPtr := xNewSubprocessLauncher(FlagsVar) | |
| 4990 | - | if NewSubprocessLauncherPtr == 0 { | |
| 4991 | - | return nil | |
| 4992 | - | } | |
| 5239 | + | var cls *SubprocessLauncher | |
| 5240 | + | ||
| 5241 | + | cret := xNewSubprocessLauncher(FlagsVar) | |
| 4993 | 5242 | ||
| 4994 | - | NewSubprocessLauncherCls := &SubprocessLauncher{} | |
| 4995 | - | NewSubprocessLauncherCls.Ptr = NewSubprocessLauncherPtr | |
| 4996 | - | return NewSubprocessLauncherCls | |
| 5243 | + | if cret == 0 { | |
| 5244 | + | return cls | |
| 5245 | + | } | |
| 5246 | + | cls = &SubprocessLauncher{} | |
| 5247 | + | cls.Ptr = cret | |
| 5248 | + | return cls | |
| 4997 | 5249 | } | |
| 4998 | 5250 | ||
| 4999 | 5251 | var xSubprocessLauncherClose func(uintptr) | |
| @@ -5023,8 +5275,8 @@ var xSubprocessLauncherGetenv func(uintptr, string) string | |||
| 5023 | 5275 | // On Windows, it will be UTF-8. | |
| 5024 | 5276 | func (x *SubprocessLauncher) Getenv(VariableVar string) string { | |
| 5025 | 5277 | ||
| 5026 | - | return xSubprocessLauncherGetenv(x.GoPointer(), VariableVar) | |
| 5027 | - | ||
| 5278 | + | cret := xSubprocessLauncherGetenv(x.GoPointer(), VariableVar) | |
| 5279 | + | return cret | |
| 5028 | 5280 | } | |
| 5029 | 5281 | ||
| 5030 | 5282 | var xSubprocessLauncherSetChildSetup func(uintptr, uintptr, uintptr, uintptr) | |
| @@ -5185,31 +5437,36 @@ var xSubprocessLauncherSpawn func(uintptr, **glib.Error, string, ...interface{}) | |||
| 5185 | 5437 | ||
| 5186 | 5438 | // Creates a #GSubprocess given a provided varargs list of arguments. | |
| 5187 | 5439 | func (x *SubprocessLauncher) Spawn(ErrorVar **glib.Error, Argv0Var string, varArgs ...interface{}) *Subprocess { | |
| 5440 | + | var cls *Subprocess | |
| 5188 | 5441 | ||
| 5189 | - | SpawnPtr := xSubprocessLauncherSpawn(x.GoPointer(), ErrorVar, Argv0Var, varArgs...) | |
| 5190 | - | if SpawnPtr == 0 { | |
| 5191 | - | return nil | |
| 5192 | - | } | |
| 5193 | - | ||
| 5194 | - | SpawnCls := &Subprocess{} | |
| 5195 | - | SpawnCls.Ptr = SpawnPtr | |
| 5196 | - | return SpawnCls | |
| 5442 | + | cret := xSubprocessLauncherSpawn(x.GoPointer(), ErrorVar, Argv0Var, varArgs...) | |
| 5197 | 5443 | ||
| 5444 | + | if cret == 0 { | |
| 5445 | + | return cls | |
| 5446 | + | } | |
| 5447 | + | cls = &Subprocess{} | |
| 5448 | + | cls.Ptr = cret | |
| 5449 | + | return cls | |
| 5198 | 5450 | } | |
| 5199 | 5451 | ||
| 5200 | - | var xSubprocessLauncherSpawnv func(uintptr, uintptr) uintptr | |
| 5452 | + | var xSubprocessLauncherSpawnv func(uintptr, uintptr, **glib.Error) uintptr | |
| 5201 | 5453 | ||
| 5202 | 5454 | // Creates a #GSubprocess given a provided array of arguments. | |
| 5203 | - | func (x *SubprocessLauncher) Spawnv(ArgvVar uintptr) *Subprocess { | |
| 5455 | + | func (x *SubprocessLauncher) Spawnv(ArgvVar uintptr) (*Subprocess, error) { | |
| 5456 | + | var cls *Subprocess | |
| 5457 | + | var cerr *glib.Error | |
| 5204 | 5458 | ||
| 5205 | - | SpawnvPtr := xSubprocessLauncherSpawnv(x.GoPointer(), ArgvVar) | |
| 5206 | - | if SpawnvPtr == 0 { | |
| 5207 | - | return nil | |
| 5208 | - | } | |
| 5459 | + | cret := xSubprocessLauncherSpawnv(x.GoPointer(), ArgvVar, &cerr) | |
| 5209 | 5460 | ||
| 5210 | - | SpawnvCls := &Subprocess{} | |
| 5211 | - | SpawnvCls.Ptr = SpawnvPtr | |
| 5212 | - | return SpawnvCls | |
| 5461 | + | if cret == 0 { | |
| 5462 | + | return cls, cerr | |
| 5463 | + | } | |
| 5464 | + | cls = &Subprocess{} | |
| 5465 | + | cls.Ptr = cret | |
| 5466 | + | if cerr == nil { | |
| 5467 | + | return cls, nil | |
| 5468 | + | } | |
| 5469 | + | return cls, cerr | |
| 5213 | 5470 | ||
| 5214 | 5471 | } | |
| 5215 | 5472 | ||
| @@ -5423,14 +5680,16 @@ var xNewTestDBus func(TestDBusFlags) uintptr | |||
| 5423 | 5680 | ||
| 5424 | 5681 | // Create a new #GTestDBus object. | |
| 5425 | 5682 | func NewTestDBus(FlagsVar TestDBusFlags) *TestDBus { | |
| 5426 | - | NewTestDBusPtr := xNewTestDBus(FlagsVar) | |
| 5427 | - | if NewTestDBusPtr == 0 { | |
| 5428 | - | return nil | |
| 5429 | - | } | |
| 5683 | + | var cls *TestDBus | |
| 5684 | + | ||
| 5685 | + | cret := xNewTestDBus(FlagsVar) | |
| 5430 | 5686 | ||
| 5431 | - | NewTestDBusCls := &TestDBus{} | |
| 5432 | - | NewTestDBusCls.Ptr = NewTestDBusPtr | |
| 5433 | - | return NewTestDBusCls | |
| 5687 | + | if cret == 0 { | |
| 5688 | + | return cls | |
| 5689 | + | } | |
| 5690 | + | cls = &TestDBus{} | |
| 5691 | + | cls.Ptr = cret | |
| 5692 | + | return cls | |
| 5434 | 5693 | } | |
| 5435 | 5694 | ||
| 5436 | 5695 | var xTestDBusAddServiceDir func(uintptr, string) | |
| @@ -5463,8 +5722,8 @@ var xTestDBusGetBusAddress func(uintptr) string | |||
| 5463 | 5722 | // g_dbus_connection_new_for_address(). | |
| 5464 | 5723 | func (x *TestDBus) GetBusAddress() string { | |
| 5465 | 5724 | ||
| 5466 | - | return xTestDBusGetBusAddress(x.GoPointer()) | |
| 5467 | - | ||
| 5725 | + | cret := xTestDBusGetBusAddress(x.GoPointer()) | |
| 5726 | + | return cret | |
| 5468 | 5727 | } | |
| 5469 | 5728 | ||
| 5470 | 5729 | var xTestDBusGetFlags func(uintptr) TestDBusFlags | |
| @@ -5472,8 +5731,8 @@ var xTestDBusGetFlags func(uintptr) TestDBusFlags | |||
| 5472 | 5731 | // Get the flags of the #GTestDBus object. | |
| 5473 | 5732 | func (x *TestDBus) GetFlags() TestDBusFlags { | |
| 5474 | 5733 | ||
| 5475 | - | return xTestDBusGetFlags(x.GoPointer()) | |
| 5476 | - | ||
| 5734 | + | cret := xTestDBusGetFlags(x.GoPointer()) | |
| 5735 | + | return cret | |
| 5477 | 5736 | } | |
| 5478 | 5737 | ||
| 5479 | 5738 | var xTestDBusStop func(uintptr) | |
M v4/gio/gioerror.go +2 -2
| @@ -17,8 +17,8 @@ var xIoErrorFromErrno func(int) IOErrorEnum | |||
| 17 | 17 | // calls, you should save its value as soon as the call which sets it | |
| 18 | 18 | func IoErrorFromErrno(ErrNoVar int) IOErrorEnum { | |
| 19 | 19 | ||
| 20 | - | return xIoErrorFromErrno(ErrNoVar) | |
| 21 | - | ||
| 20 | + | cret := xIoErrorFromErrno(ErrNoVar) | |
| 21 | + | return cret | |
| 22 | 22 | } | |
| 23 | 23 | ||
| 24 | 24 | func init() { | |
M v4/gio/giomodule.go +19 -17
| @@ -28,8 +28,8 @@ var xIoExtensionPointImplement func(string, []interface{}, string, int) *IOExten | |||
| 28 | 28 | // extension point, the existing #GIOExtension object is returned. | |
| 29 | 29 | func IoExtensionPointImplement(ExtensionPointNameVar string, TypeVar []interface{}, ExtensionNameVar string, PriorityVar int) *IOExtension { | |
| 30 | 30 | ||
| 31 | - | return xIoExtensionPointImplement(ExtensionPointNameVar, TypeVar, ExtensionNameVar, PriorityVar) | |
| 32 | - | ||
| 31 | + | cret := xIoExtensionPointImplement(ExtensionPointNameVar, TypeVar, ExtensionNameVar, PriorityVar) | |
| 32 | + | return cret | |
| 33 | 33 | } | |
| 34 | 34 | ||
| 35 | 35 | var xIoExtensionPointLookup func(string) *IOExtensionPoint | |
| @@ -37,8 +37,8 @@ var xIoExtensionPointLookup func(string) *IOExtensionPoint | |||
| 37 | 37 | // Looks up an existing extension point. | |
| 38 | 38 | func IoExtensionPointLookup(NameVar string) *IOExtensionPoint { | |
| 39 | 39 | ||
| 40 | - | return xIoExtensionPointLookup(NameVar) | |
| 41 | - | ||
| 40 | + | cret := xIoExtensionPointLookup(NameVar) | |
| 41 | + | return cret | |
| 42 | 42 | } | |
| 43 | 43 | ||
| 44 | 44 | var xIoExtensionPointRegister func(string) *IOExtensionPoint | |
| @@ -46,8 +46,8 @@ var xIoExtensionPointRegister func(string) *IOExtensionPoint | |||
| 46 | 46 | // Registers an extension point. | |
| 47 | 47 | func IoExtensionPointRegister(NameVar string) *IOExtensionPoint { | |
| 48 | 48 | ||
| 49 | - | return xIoExtensionPointRegister(NameVar) | |
| 50 | - | ||
| 49 | + | cret := xIoExtensionPointRegister(NameVar) | |
| 50 | + | return cret | |
| 51 | 51 | } | |
| 52 | 52 | ||
| 53 | 53 | var xIoModulesLoadAllInDirectory func(string) *glib.List | |
| @@ -59,8 +59,8 @@ var xIoModulesLoadAllInDirectory func(string) *glib.List | |||
| 59 | 59 | // which allows delayed/lazy loading of modules. | |
| 60 | 60 | func IoModulesLoadAllInDirectory(DirnameVar string) *glib.List { | |
| 61 | 61 | ||
| 62 | - | return xIoModulesLoadAllInDirectory(DirnameVar) | |
| 63 | - | ||
| 62 | + | cret := xIoModulesLoadAllInDirectory(DirnameVar) | |
| 63 | + | return cret | |
| 64 | 64 | } | |
| 65 | 65 | ||
| 66 | 66 | var xIoModulesLoadAllInDirectoryWithScope func(string, *IOModuleScope) *glib.List | |
| @@ -72,8 +72,8 @@ var xIoModulesLoadAllInDirectoryWithScope func(string, *IOModuleScope) *glib.Lis | |||
| 72 | 72 | // which allows delayed/lazy loading of modules. | |
| 73 | 73 | func IoModulesLoadAllInDirectoryWithScope(DirnameVar string, ScopeVar *IOModuleScope) *glib.List { | |
| 74 | 74 | ||
| 75 | - | return xIoModulesLoadAllInDirectoryWithScope(DirnameVar, ScopeVar) | |
| 76 | - | ||
| 75 | + | cret := xIoModulesLoadAllInDirectoryWithScope(DirnameVar, ScopeVar) | |
| 76 | + | return cret | |
| 77 | 77 | } | |
| 78 | 78 | ||
| 79 | 79 | var xIoModulesScanAllInDirectory func(string) | |
| @@ -132,14 +132,16 @@ var xNewIOModule func(string) uintptr | |||
| 132 | 132 | // Creates a new GIOModule that will load the specific | |
| 133 | 133 | // shared library when in use. | |
| 134 | 134 | func NewIOModule(FilenameVar string) *IOModule { | |
| 135 | - | NewIOModulePtr := xNewIOModule(FilenameVar) | |
| 136 | - | if NewIOModulePtr == 0 { | |
| 137 | - | return nil | |
| 138 | - | } | |
| 135 | + | var cls *IOModule | |
| 136 | + | ||
| 137 | + | cret := xNewIOModule(FilenameVar) | |
| 139 | 138 | ||
| 140 | - | NewIOModuleCls := &IOModule{} | |
| 141 | - | NewIOModuleCls.Ptr = NewIOModulePtr | |
| 142 | - | return NewIOModuleCls | |
| 139 | + | if cret == 0 { | |
| 140 | + | return cls | |
| 141 | + | } | |
| 142 | + | cls = &IOModule{} | |
| 143 | + | cls.Ptr = cret | |
| 144 | + | return cls | |
| 143 | 145 | } | |
| 144 | 146 | ||
| 145 | 147 | var xIOModuleLoad func(uintptr) | |
M v4/gio/giostream.go +46 -32
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -79,7 +80,7 @@ func (x *IOStream) ClearPending() { | |||
| 79 | 80 | ||
| 80 | 81 | } | |
| 81 | 82 | ||
| 82 | - | var xIOStreamClose func(uintptr, uintptr) bool | |
| 83 | + | var xIOStreamClose func(uintptr, uintptr, **glib.Error) bool | |
| 83 | 84 | ||
| 84 | 85 | // Closes the stream, releasing resources related to it. This will also | |
| 85 | 86 | // close the individual input and output streams, if they are not already | |
| @@ -114,9 +115,14 @@ var xIOStreamClose func(uintptr, uintptr) bool | |||
| 114 | 115 | // | |
| 115 | 116 | // The default implementation of this method just calls close on the | |
| 116 | 117 | // individual input/output streams. | |
| 117 | - | func (x *IOStream) Close(CancellableVar *Cancellable) bool { | |
| 118 | + | func (x *IOStream) Close(CancellableVar *Cancellable) (bool, error) { | |
| 119 | + | var cerr *glib.Error | |
| 118 | 120 | ||
| 119 | - | return xIOStreamClose(x.GoPointer(), CancellableVar.GoPointer()) | |
| 121 | + | cret := xIOStreamClose(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 122 | + | if cerr == nil { | |
| 123 | + | return cret, nil | |
| 124 | + | } | |
| 125 | + | return cret, cerr | |
| 120 | 126 | ||
| 121 | 127 | } | |
| 122 | 128 | ||
| @@ -138,12 +144,17 @@ func (x *IOStream) CloseAsync(IoPriorityVar int, CancellableVar *Cancellable, Ca | |||
| 138 | 144 | ||
| 139 | 145 | } | |
| 140 | 146 | ||
| 141 | - | var xIOStreamCloseFinish func(uintptr, uintptr) bool | |
| 147 | + | var xIOStreamCloseFinish func(uintptr, uintptr, **glib.Error) bool | |
| 142 | 148 | ||
| 143 | 149 | // Closes a stream. | |
| 144 | - | func (x *IOStream) CloseFinish(ResultVar AsyncResult) bool { | |
| 150 | + | func (x *IOStream) CloseFinish(ResultVar AsyncResult) (bool, error) { | |
| 151 | + | var cerr *glib.Error | |
| 145 | 152 | ||
| 146 | - | return xIOStreamCloseFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 153 | + | cret := xIOStreamCloseFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 154 | + | if cerr == nil { | |
| 155 | + | return cret, nil | |
| 156 | + | } | |
| 157 | + | return cret, cerr | |
| 147 | 158 | ||
| 148 | 159 | } | |
| 149 | 160 | ||
| @@ -152,18 +163,17 @@ var xIOStreamGetInputStream func(uintptr) uintptr | |||
| 152 | 163 | // Gets the input stream for this object. This is used | |
| 153 | 164 | // for reading. | |
| 154 | 165 | func (x *IOStream) GetInputStream() *InputStream { | |
| 166 | + | var cls *InputStream | |
| 155 | 167 | ||
| 156 | - | GetInputStreamPtr := xIOStreamGetInputStream(x.GoPointer()) | |
| 157 | - | if GetInputStreamPtr == 0 { | |
| 158 | - | return nil | |
| 159 | - | } | |
| 160 | - | ||
| 161 | - | gobject.IncreaseRef(GetInputStreamPtr) | |
| 162 | - | ||
| 163 | - | GetInputStreamCls := &InputStream{} | |
| 164 | - | GetInputStreamCls.Ptr = GetInputStreamPtr | |
| 165 | - | return GetInputStreamCls | |
| 168 | + | cret := xIOStreamGetInputStream(x.GoPointer()) | |
| 166 | 169 | ||
| 170 | + | if cret == 0 { | |
| 171 | + | return cls | |
| 172 | + | } | |
| 173 | + | gobject.IncreaseRef(cret) | |
| 174 | + | cls = &InputStream{} | |
| 175 | + | cls.Ptr = cret | |
| 176 | + | return cls | |
| 167 | 177 | } | |
| 168 | 178 | ||
| 169 | 179 | var xIOStreamGetOutputStream func(uintptr) uintptr | |
| @@ -171,18 +181,17 @@ var xIOStreamGetOutputStream func(uintptr) uintptr | |||
| 171 | 181 | // Gets the output stream for this object. This is used for | |
| 172 | 182 | // writing. | |
| 173 | 183 | func (x *IOStream) GetOutputStream() *OutputStream { | |
| 184 | + | var cls *OutputStream | |
| 174 | 185 | ||
| 175 | - | GetOutputStreamPtr := xIOStreamGetOutputStream(x.GoPointer()) | |
| 176 | - | if GetOutputStreamPtr == 0 { | |
| 177 | - | return nil | |
| 178 | - | } | |
| 179 | - | ||
| 180 | - | gobject.IncreaseRef(GetOutputStreamPtr) | |
| 181 | - | ||
| 182 | - | GetOutputStreamCls := &OutputStream{} | |
| 183 | - | GetOutputStreamCls.Ptr = GetOutputStreamPtr | |
| 184 | - | return GetOutputStreamCls | |
| 186 | + | cret := xIOStreamGetOutputStream(x.GoPointer()) | |
| 185 | 187 | ||
| 188 | + | if cret == 0 { | |
| 189 | + | return cls | |
| 190 | + | } | |
| 191 | + | gobject.IncreaseRef(cret) | |
| 192 | + | cls = &OutputStream{} | |
| 193 | + | cls.Ptr = cret | |
| 194 | + | return cls | |
| 186 | 195 | } | |
| 187 | 196 | ||
| 188 | 197 | var xIOStreamHasPending func(uintptr) bool | |
| @@ -190,8 +199,8 @@ var xIOStreamHasPending func(uintptr) bool | |||
| 190 | 199 | // Checks if a stream has pending actions. | |
| 191 | 200 | func (x *IOStream) HasPending() bool { | |
| 192 | 201 | ||
| 193 | - | return xIOStreamHasPending(x.GoPointer()) | |
| 194 | - | ||
| 202 | + | cret := xIOStreamHasPending(x.GoPointer()) | |
| 203 | + | return cret | |
| 195 | 204 | } | |
| 196 | 205 | ||
| 197 | 206 | var xIOStreamIsClosed func(uintptr) bool | |
| @@ -199,8 +208,8 @@ var xIOStreamIsClosed func(uintptr) bool | |||
| 199 | 208 | // Checks if a stream is closed. | |
| 200 | 209 | func (x *IOStream) IsClosed() bool { | |
| 201 | 210 | ||
| 202 | - | return xIOStreamIsClosed(x.GoPointer()) | |
| 203 | - | ||
| 211 | + | cret := xIOStreamIsClosed(x.GoPointer()) | |
| 212 | + | return cret | |
| 204 | 213 | } | |
| 205 | 214 | ||
| 206 | 215 | var xIOStreamSetPending func(uintptr) bool | |
| @@ -208,9 +217,14 @@ var xIOStreamSetPending func(uintptr) bool | |||
| 208 | 217 | // Sets @stream to have actions pending. If the pending flag is | |
| 209 | 218 | // already set or @stream is closed, it will return %FALSE and set | |
| 210 | 219 | // @error. | |
| 211 | - | func (x *IOStream) SetPending() bool { | |
| 220 | + | func (x *IOStream) SetPending() (bool, error) { | |
| 221 | + | var cerr *glib.Error | |
| 212 | 222 | ||
| 213 | - | return xIOStreamSetPending(x.GoPointer()) | |
| 223 | + | cret := xIOStreamSetPending(x.GoPointer()) | |
| 224 | + | if cerr == nil { | |
| 225 | + | return cret, nil | |
| 226 | + | } | |
| 227 | + | return cret, cerr | |
| 214 | 228 | ||
| 215 | 229 | } | |
| 216 | 230 | ||
M v4/gio/glistmodel.go +14 -14
| @@ -91,8 +91,8 @@ func (x *ListModelBase) SetGoPointer(ptr uintptr) { | |||
| 91 | 91 | // See also: g_list_model_get_n_items() | |
| 92 | 92 | func (x *ListModelBase) GetItem(PositionVar uint) uintptr { | |
| 93 | 93 | ||
| 94 | - | return XGListModelGetItem(x.GoPointer(), PositionVar) | |
| 95 | - | ||
| 94 | + | cret := XGListModelGetItem(x.GoPointer(), PositionVar) | |
| 95 | + | return cret | |
| 96 | 96 | } | |
| 97 | 97 | ||
| 98 | 98 | // Gets the type of the items in @list. | |
| @@ -105,8 +105,8 @@ func (x *ListModelBase) GetItem(PositionVar uint) uintptr { | |||
| 105 | 105 | // model. | |
| 106 | 106 | func (x *ListModelBase) GetItemType() []interface{} { | |
| 107 | 107 | ||
| 108 | - | return XGListModelGetItemType(x.GoPointer()) | |
| 109 | - | ||
| 108 | + | cret := XGListModelGetItemType(x.GoPointer()) | |
| 109 | + | return cret | |
| 110 | 110 | } | |
| 111 | 111 | ||
| 112 | 112 | // Gets the number of items in @list. | |
| @@ -116,8 +116,8 @@ func (x *ListModelBase) GetItemType() []interface{} { | |||
| 116 | 116 | // @position until g_list_model_get_item() returns %NULL. | |
| 117 | 117 | func (x *ListModelBase) GetNItems() uint { | |
| 118 | 118 | ||
| 119 | - | return XGListModelGetNItems(x.GoPointer()) | |
| 120 | - | ||
| 119 | + | cret := XGListModelGetNItems(x.GoPointer()) | |
| 120 | + | return cret | |
| 121 | 121 | } | |
| 122 | 122 | ||
| 123 | 123 | // Get the item at @position. | |
| @@ -133,16 +133,16 @@ func (x *ListModelBase) GetNItems() uint { | |||
| 133 | 133 | // | |
| 134 | 134 | // See also: g_list_model_get_n_items() | |
| 135 | 135 | func (x *ListModelBase) GetObject(PositionVar uint) *gobject.Object { | |
| 136 | + | var cls *gobject.Object | |
| 136 | 137 | ||
| 137 | - | GetObjectPtr := XGListModelGetObject(x.GoPointer(), PositionVar) | |
| 138 | - | if GetObjectPtr == 0 { | |
| 139 | - | return nil | |
| 140 | - | } | |
| 141 | - | ||
| 142 | - | GetObjectCls := &gobject.Object{} | |
| 143 | - | GetObjectCls.Ptr = GetObjectPtr | |
| 144 | - | return GetObjectCls | |
| 138 | + | cret := XGListModelGetObject(x.GoPointer(), PositionVar) | |
| 145 | 139 | ||
| 140 | + | if cret == 0 { | |
| 141 | + | return cls | |
| 142 | + | } | |
| 143 | + | cls = &gobject.Object{} | |
| 144 | + | cls.Ptr = cret | |
| 145 | + | return cls | |
| 146 | 146 | } | |
| 147 | 147 | ||
| 148 | 148 | // Emits the #GListModel::items-changed signal on @list. | |
M v4/gio/gliststore.go +29 -27
| @@ -32,14 +32,16 @@ var xNewListStore func([]interface{}) uintptr | |||
| 32 | 32 | // Creates a new #GListStore with items of type @item_type. @item_type | |
| 33 | 33 | // must be a subclass of #GObject. | |
| 34 | 34 | func NewListStore(ItemTypeVar []interface{}) *ListStore { | |
| 35 | - | NewListStorePtr := xNewListStore(ItemTypeVar) | |
| 36 | - | if NewListStorePtr == 0 { | |
| 37 | - | return nil | |
| 38 | - | } | |
| 35 | + | var cls *ListStore | |
| 36 | + | ||
| 37 | + | cret := xNewListStore(ItemTypeVar) | |
| 39 | 38 | ||
| 40 | - | NewListStoreCls := &ListStore{} | |
| 41 | - | NewListStoreCls.Ptr = NewListStorePtr | |
| 42 | - | return NewListStoreCls | |
| 39 | + | if cret == 0 { | |
| 40 | + | return cls | |
| 41 | + | } | |
| 42 | + | cls = &ListStore{} | |
| 43 | + | cls.Ptr = cret | |
| 44 | + | return cls | |
| 43 | 45 | } | |
| 44 | 46 | ||
| 45 | 47 | var xListStoreAppend func(uintptr, uintptr) | |
| @@ -66,8 +68,8 @@ var xListStoreFind func(uintptr, uintptr, uint) bool | |||
| 66 | 68 | // g_list_store_find_with_equal_func() with a custom #GEqualFunc instead. | |
| 67 | 69 | func (x *ListStore) Find(ItemVar *gobject.Object, PositionVar uint) bool { | |
| 68 | 70 | ||
| 69 | - | return xListStoreFind(x.GoPointer(), ItemVar.GoPointer(), PositionVar) | |
| 70 | - | ||
| 71 | + | cret := xListStoreFind(x.GoPointer(), ItemVar.GoPointer(), PositionVar) | |
| 72 | + | return cret | |
| 71 | 73 | } | |
| 72 | 74 | ||
| 73 | 75 | var xListStoreFindWithEqualFunc func(uintptr, uintptr, uintptr, uint) bool | |
| @@ -78,8 +80,8 @@ var xListStoreFindWithEqualFunc func(uintptr, uintptr, uintptr, uint) bool | |||
| 78 | 80 | // method will return %FALSE. | |
| 79 | 81 | func (x *ListStore) FindWithEqualFunc(ItemVar *gobject.Object, EqualFuncVar glib.EqualFunc, PositionVar uint) bool { | |
| 80 | 82 | ||
| 81 | - | return xListStoreFindWithEqualFunc(x.GoPointer(), ItemVar.GoPointer(), purego.NewCallback(EqualFuncVar), PositionVar) | |
| 82 | - | ||
| 83 | + | cret := xListStoreFindWithEqualFunc(x.GoPointer(), ItemVar.GoPointer(), purego.NewCallback(EqualFuncVar), PositionVar) | |
| 84 | + | return cret | |
| 83 | 85 | } | |
| 84 | 86 | ||
| 85 | 87 | var xListStoreInsert func(uintptr, uint, uintptr) | |
| @@ -110,8 +112,8 @@ var xListStoreInsertSorted func(uintptr, uintptr, uintptr, uintptr) uint | |||
| 110 | 112 | // This function takes a ref on @item. | |
| 111 | 113 | func (x *ListStore) InsertSorted(ItemVar *gobject.Object, CompareFuncVar glib.CompareDataFunc, UserDataVar uintptr) uint { | |
| 112 | 114 | ||
| 113 | - | return xListStoreInsertSorted(x.GoPointer(), ItemVar.GoPointer(), purego.NewCallback(CompareFuncVar), UserDataVar) | |
| 114 | - | ||
| 115 | + | cret := xListStoreInsertSorted(x.GoPointer(), ItemVar.GoPointer(), purego.NewCallback(CompareFuncVar), UserDataVar) | |
| 116 | + | return cret | |
| 115 | 117 | } | |
| 116 | 118 | ||
| 117 | 119 | var xListStoreRemove func(uintptr, uint) | |
| @@ -185,8 +187,8 @@ func (c *ListStore) SetGoPointer(ptr uintptr) { | |||
| 185 | 187 | // See also: g_list_model_get_n_items() | |
| 186 | 188 | func (x *ListStore) GetItem(PositionVar uint) uintptr { | |
| 187 | 189 | ||
| 188 | - | return XGListModelGetItem(x.GoPointer(), PositionVar) | |
| 189 | - | ||
| 190 | + | cret := XGListModelGetItem(x.GoPointer(), PositionVar) | |
| 191 | + | return cret | |
| 190 | 192 | } | |
| 191 | 193 | ||
| 192 | 194 | // Gets the type of the items in @list. | |
| @@ -199,8 +201,8 @@ func (x *ListStore) GetItem(PositionVar uint) uintptr { | |||
| 199 | 201 | // model. | |
| 200 | 202 | func (x *ListStore) GetItemType() []interface{} { | |
| 201 | 203 | ||
| 202 | - | return XGListModelGetItemType(x.GoPointer()) | |
| 203 | - | ||
| 204 | + | cret := XGListModelGetItemType(x.GoPointer()) | |
| 205 | + | return cret | |
| 204 | 206 | } | |
| 205 | 207 | ||
| 206 | 208 | // Gets the number of items in @list. | |
| @@ -210,8 +212,8 @@ func (x *ListStore) GetItemType() []interface{} { | |||
| 210 | 212 | // @position until g_list_model_get_item() returns %NULL. | |
| 211 | 213 | func (x *ListStore) GetNItems() uint { | |
| 212 | 214 | ||
| 213 | - | return XGListModelGetNItems(x.GoPointer()) | |
| 214 | - | ||
| 215 | + | cret := XGListModelGetNItems(x.GoPointer()) | |
| 216 | + | return cret | |
| 215 | 217 | } | |
| 216 | 218 | ||
| 217 | 219 | // Get the item at @position. | |
| @@ -227,16 +229,16 @@ func (x *ListStore) GetNItems() uint { | |||
| 227 | 229 | // | |
| 228 | 230 | // See also: g_list_model_get_n_items() | |
| 229 | 231 | func (x *ListStore) GetObject(PositionVar uint) *gobject.Object { | |
| 232 | + | var cls *gobject.Object | |
| 230 | 233 | ||
| 231 | - | GetObjectPtr := XGListModelGetObject(x.GoPointer(), PositionVar) | |
| 232 | - | if GetObjectPtr == 0 { | |
| 233 | - | return nil | |
| 234 | - | } | |
| 235 | - | ||
| 236 | - | GetObjectCls := &gobject.Object{} | |
| 237 | - | GetObjectCls.Ptr = GetObjectPtr | |
| 238 | - | return GetObjectCls | |
| 234 | + | cret := XGListModelGetObject(x.GoPointer(), PositionVar) | |
| 239 | 235 | ||
| 236 | + | if cret == 0 { | |
| 237 | + | return cls | |
| 238 | + | } | |
| 239 | + | cls = &gobject.Object{} | |
| 240 | + | cls.Ptr = cret | |
| 241 | + | return cls | |
| 240 | 242 | } | |
| 241 | 243 | ||
| 242 | 244 | // Emits the #GListModel::items-changed signal on @list. | |
M v4/gio/gloadableicon.go +29 -18
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | ) | |
| 8 | 9 | ||
| 9 | 10 | // Interface for icons that can be loaded as a stream. | |
| @@ -34,16 +35,21 @@ func (x *LoadableIconBase) SetGoPointer(ptr uintptr) { | |||
| 34 | 35 | ||
| 35 | 36 | // Loads a loadable icon. For the asynchronous version of this function, | |
| 36 | 37 | // see g_loadable_icon_load_async(). | |
| 37 | - | func (x *LoadableIconBase) Load(SizeVar int, TypeVar string, CancellableVar *Cancellable) *InputStream { | |
| 38 | + | func (x *LoadableIconBase) Load(SizeVar int, TypeVar string, CancellableVar *Cancellable) (*InputStream, error) { | |
| 39 | + | var cls *InputStream | |
| 40 | + | var cerr *glib.Error | |
| 38 | 41 | ||
| 39 | - | LoadPtr := XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer()) | |
| 40 | - | if LoadPtr == 0 { | |
| 41 | - | return nil | |
| 42 | - | } | |
| 42 | + | cret := XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 43 | 43 | ||
| 44 | - | LoadCls := &InputStream{} | |
| 45 | - | LoadCls.Ptr = LoadPtr | |
| 46 | - | return LoadCls | |
| 44 | + | if cret == 0 { | |
| 45 | + | return cls, cerr | |
| 46 | + | } | |
| 47 | + | cls = &InputStream{} | |
| 48 | + | cls.Ptr = cret | |
| 49 | + | if cerr == nil { | |
| 50 | + | return cls, nil | |
| 51 | + | } | |
| 52 | + | return cls, cerr | |
| 47 | 53 | ||
| 48 | 54 | } | |
| 49 | 55 | ||
| @@ -57,22 +63,27 @@ func (x *LoadableIconBase) LoadAsync(SizeVar int, CancellableVar *Cancellable, C | |||
| 57 | 63 | } | |
| 58 | 64 | ||
| 59 | 65 | // Finishes an asynchronous icon load started in g_loadable_icon_load_async(). | |
| 60 | - | func (x *LoadableIconBase) LoadFinish(ResVar AsyncResult, TypeVar string) *InputStream { | |
| 66 | + | func (x *LoadableIconBase) LoadFinish(ResVar AsyncResult, TypeVar string) (*InputStream, error) { | |
| 67 | + | var cls *InputStream | |
| 68 | + | var cerr *glib.Error | |
| 61 | 69 | ||
| 62 | - | LoadFinishPtr := XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar) | |
| 63 | - | if LoadFinishPtr == 0 { | |
| 64 | - | return nil | |
| 65 | - | } | |
| 70 | + | cret := XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar, &cerr) | |
| 66 | 71 | ||
| 67 | - | LoadFinishCls := &InputStream{} | |
| 68 | - | LoadFinishCls.Ptr = LoadFinishPtr | |
| 69 | - | return LoadFinishCls | |
| 72 | + | if cret == 0 { | |
| 73 | + | return cls, cerr | |
| 74 | + | } | |
| 75 | + | cls = &InputStream{} | |
| 76 | + | cls.Ptr = cret | |
| 77 | + | if cerr == nil { | |
| 78 | + | return cls, nil | |
| 79 | + | } | |
| 80 | + | return cls, cerr | |
| 70 | 81 | ||
| 71 | 82 | } | |
| 72 | 83 | ||
| 73 | - | var XGLoadableIconLoad func(uintptr, int, string, uintptr) uintptr | |
| 84 | + | var XGLoadableIconLoad func(uintptr, int, string, uintptr, **glib.Error) uintptr | |
| 74 | 85 | var XGLoadableIconLoadAsync func(uintptr, int, uintptr, uintptr, uintptr) | |
| 75 | - | var XGLoadableIconLoadFinish func(uintptr, uintptr, string) uintptr | |
| 86 | + | var XGLoadableIconLoadFinish func(uintptr, uintptr, string, **glib.Error) uintptr | |
| 76 | 87 | ||
| 77 | 88 | func init() { | |
| 78 | 89 | lib, err := purego.Dlopen(core.GetPath("GIO"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
M v4/gio/gmemoryinputstream.go +60 -39
| @@ -33,42 +33,48 @@ var xNewMemoryInputStream func() uintptr | |||
| 33 | 33 | ||
| 34 | 34 | // Creates a new empty #GMemoryInputStream. | |
| 35 | 35 | func NewMemoryInputStream() *InputStream { | |
| 36 | - | NewMemoryInputStreamPtr := xNewMemoryInputStream() | |
| 37 | - | if NewMemoryInputStreamPtr == 0 { | |
| 38 | - | return nil | |
| 39 | - | } | |
| 36 | + | var cls *InputStream | |
| 37 | + | ||
| 38 | + | cret := xNewMemoryInputStream() | |
| 40 | 39 | ||
| 41 | - | NewMemoryInputStreamCls := &InputStream{} | |
| 42 | - | NewMemoryInputStreamCls.Ptr = NewMemoryInputStreamPtr | |
| 43 | - | return NewMemoryInputStreamCls | |
| 40 | + | if cret == 0 { | |
| 41 | + | return cls | |
| 42 | + | } | |
| 43 | + | cls = &InputStream{} | |
| 44 | + | cls.Ptr = cret | |
| 45 | + | return cls | |
| 44 | 46 | } | |
| 45 | 47 | ||
| 46 | 48 | var xNewFromBytesMemoryInputStream func(*glib.Bytes) uintptr | |
| 47 | 49 | ||
| 48 | 50 | // Creates a new #GMemoryInputStream with data from the given @bytes. | |
| 49 | 51 | func NewFromBytesMemoryInputStream(BytesVar *glib.Bytes) *InputStream { | |
| 50 | - | NewFromBytesMemoryInputStreamPtr := xNewFromBytesMemoryInputStream(BytesVar) | |
| 51 | - | if NewFromBytesMemoryInputStreamPtr == 0 { | |
| 52 | - | return nil | |
| 53 | - | } | |
| 52 | + | var cls *InputStream | |
| 53 | + | ||
| 54 | + | cret := xNewFromBytesMemoryInputStream(BytesVar) | |
| 54 | 55 | ||
| 55 | - | NewFromBytesMemoryInputStreamCls := &InputStream{} | |
| 56 | - | NewFromBytesMemoryInputStreamCls.Ptr = NewFromBytesMemoryInputStreamPtr | |
| 57 | - | return NewFromBytesMemoryInputStreamCls | |
| 56 | + | if cret == 0 { | |
| 57 | + | return cls | |
| 58 | + | } | |
| 59 | + | cls = &InputStream{} | |
| 60 | + | cls.Ptr = cret | |
| 61 | + | return cls | |
| 58 | 62 | } | |
| 59 | 63 | ||
| 60 | 64 | var xNewFromDataMemoryInputStream func(uintptr, int, uintptr) uintptr | |
| 61 | 65 | ||
| 62 | 66 | // Creates a new #GMemoryInputStream with data in memory of a given size. | |
| 63 | 67 | func NewFromDataMemoryInputStream(DataVar uintptr, LenVar int, DestroyVar glib.DestroyNotify) *InputStream { | |
| 64 | - | NewFromDataMemoryInputStreamPtr := xNewFromDataMemoryInputStream(DataVar, LenVar, purego.NewCallback(DestroyVar)) | |
| 65 | - | if NewFromDataMemoryInputStreamPtr == 0 { | |
| 66 | - | return nil | |
| 67 | - | } | |
| 68 | + | var cls *InputStream | |
| 68 | 69 | ||
| 69 | - | NewFromDataMemoryInputStreamCls := &InputStream{} | |
| 70 | - | NewFromDataMemoryInputStreamCls.Ptr = NewFromDataMemoryInputStreamPtr | |
| 71 | - | return NewFromDataMemoryInputStreamCls | |
| 70 | + | cret := xNewFromDataMemoryInputStream(DataVar, LenVar, purego.NewCallback(DestroyVar)) | |
| 71 | + | ||
| 72 | + | if cret == 0 { | |
| 73 | + | return cls | |
| 74 | + | } | |
| 75 | + | cls = &InputStream{} | |
| 76 | + | cls.Ptr = cret | |
| 77 | + | return cls | |
| 72 | 78 | } | |
| 73 | 79 | ||
| 74 | 80 | var xMemoryInputStreamAddBytes func(uintptr, *glib.Bytes) | |
| @@ -106,8 +112,8 @@ func (c *MemoryInputStream) SetGoPointer(ptr uintptr) { | |||
| 106 | 112 | // a stream cannot switch from pollable to non-pollable or vice versa. | |
| 107 | 113 | func (x *MemoryInputStream) CanPoll() bool { | |
| 108 | 114 | ||
| 109 | - | return XGPollableInputStreamCanPoll(x.GoPointer()) | |
| 110 | - | ||
| 115 | + | cret := XGPollableInputStreamCanPoll(x.GoPointer()) | |
| 116 | + | return cret | |
| 111 | 117 | } | |
| 112 | 118 | ||
| 113 | 119 | // Creates a #GSource that triggers when @stream can be read, or | |
| @@ -120,8 +126,8 @@ func (x *MemoryInputStream) CanPoll() bool { | |||
| 120 | 126 | // rather than g_input_stream_read() from the callback. | |
| 121 | 127 | func (x *MemoryInputStream) CreateSource(CancellableVar *Cancellable) *glib.Source { | |
| 122 | 128 | ||
| 123 | - | return XGPollableInputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer()) | |
| 124 | - | ||
| 129 | + | cret := XGPollableInputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer()) | |
| 130 | + | return cret | |
| 125 | 131 | } | |
| 126 | 132 | ||
| 127 | 133 | // Checks if @stream can be read. | |
| @@ -134,8 +140,8 @@ func (x *MemoryInputStream) CreateSource(CancellableVar *Cancellable) *glib.Sour | |||
| 134 | 140 | // %G_IO_ERROR_WOULD_BLOCK error rather than blocking. | |
| 135 | 141 | func (x *MemoryInputStream) IsReadable() bool { | |
| 136 | 142 | ||
| 137 | - | return XGPollableInputStreamIsReadable(x.GoPointer()) | |
| 138 | - | ||
| 143 | + | cret := XGPollableInputStreamIsReadable(x.GoPointer()) | |
| 144 | + | return cret | |
| 139 | 145 | } | |
| 140 | 146 | ||
| 141 | 147 | // Attempts to read up to @count bytes from @stream into @buffer, as | |
| @@ -149,25 +155,30 @@ func (x *MemoryInputStream) IsReadable() bool { | |||
| 149 | 155 | // if @cancellable has already been cancelled when you call, which | |
| 150 | 156 | // may happen if you call this method after a source triggers due | |
| 151 | 157 | // to having been cancelled. | |
| 152 | - | func (x *MemoryInputStream) ReadNonblocking(BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) int { | |
| 158 | + | func (x *MemoryInputStream) ReadNonblocking(BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) (int, error) { | |
| 159 | + | var cerr *glib.Error | |
| 153 | 160 | ||
| 154 | - | return XGPollableInputStreamReadNonblocking(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer()) | |
| 161 | + | cret := XGPollableInputStreamReadNonblocking(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer(), &cerr) | |
| 162 | + | if cerr == nil { | |
| 163 | + | return cret, nil | |
| 164 | + | } | |
| 165 | + | return cret, cerr | |
| 155 | 166 | ||
| 156 | 167 | } | |
| 157 | 168 | ||
| 158 | 169 | // Tests if the stream supports the #GSeekableIface. | |
| 159 | 170 | func (x *MemoryInputStream) CanSeek() bool { | |
| 160 | 171 | ||
| 161 | - | return XGSeekableCanSeek(x.GoPointer()) | |
| 162 | - | ||
| 172 | + | cret := XGSeekableCanSeek(x.GoPointer()) | |
| 173 | + | return cret | |
| 163 | 174 | } | |
| 164 | 175 | ||
| 165 | 176 | // Tests if the length of the stream can be adjusted with | |
| 166 | 177 | // g_seekable_truncate(). | |
| 167 | 178 | func (x *MemoryInputStream) CanTruncate() bool { | |
| 168 | 179 | ||
| 169 | - | return XGSeekableCanTruncate(x.GoPointer()) | |
| 170 | - | ||
| 180 | + | cret := XGSeekableCanTruncate(x.GoPointer()) | |
| 181 | + | return cret | |
| 171 | 182 | } | |
| 172 | 183 | ||
| 173 | 184 | // Seeks in the stream by the given @offset, modified by @type. | |
| @@ -184,17 +195,22 @@ func (x *MemoryInputStream) CanTruncate() bool { | |||
| 184 | 195 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 185 | 196 | // triggering the cancellable object from another thread. If the operation | |
| 186 | 197 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 187 | - | func (x *MemoryInputStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) bool { | |
| 198 | + | func (x *MemoryInputStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) (bool, error) { | |
| 199 | + | var cerr *glib.Error | |
| 188 | 200 | ||
| 189 | - | return XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer()) | |
| 201 | + | cret := XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 202 | + | if cerr == nil { | |
| 203 | + | return cret, nil | |
| 204 | + | } | |
| 205 | + | return cret, cerr | |
| 190 | 206 | ||
| 191 | 207 | } | |
| 192 | 208 | ||
| 193 | 209 | // Tells the current position within the stream. | |
| 194 | 210 | func (x *MemoryInputStream) Tell() int64 { | |
| 195 | 211 | ||
| 196 | - | return XGSeekableTell(x.GoPointer()) | |
| 197 | - | ||
| 212 | + | cret := XGSeekableTell(x.GoPointer()) | |
| 213 | + | return cret | |
| 198 | 214 | } | |
| 199 | 215 | ||
| 200 | 216 | // Sets the length of the stream to @offset. If the stream was previously | |
| @@ -206,9 +222,14 @@ func (x *MemoryInputStream) Tell() int64 { | |||
| 206 | 222 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an | |
| 207 | 223 | // operation was partially finished when the operation was cancelled the | |
| 208 | 224 | // partial result will be returned, without an error. | |
| 209 | - | func (x *MemoryInputStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) bool { | |
| 225 | + | func (x *MemoryInputStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) (bool, error) { | |
| 226 | + | var cerr *glib.Error | |
| 210 | 227 | ||
| 211 | - | return XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer()) | |
| 228 | + | cret := XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer(), &cerr) | |
| 229 | + | if cerr == nil { | |
| 230 | + | return cret, nil | |
| 231 | + | } | |
| 232 | + | return cret, cerr | |
| 212 | 233 | ||
| 213 | 234 | } | |
| 214 | 235 | ||
M v4/gio/gmemorymonitor.go +8 -8
| @@ -80,16 +80,16 @@ var xMemoryMonitorDupDefault func() uintptr | |||
| 80 | 80 | ||
| 81 | 81 | // Gets a reference to the default #GMemoryMonitor for the system. | |
| 82 | 82 | func MemoryMonitorDupDefault() *MemoryMonitorBase { | |
| 83 | + | var cls *MemoryMonitorBase | |
| 83 | 84 | ||
| 84 | - | MemoryMonitorDupDefaultPtr := xMemoryMonitorDupDefault() | |
| 85 | - | if MemoryMonitorDupDefaultPtr == 0 { | |
| 86 | - | return nil | |
| 87 | - | } | |
| 88 | - | ||
| 89 | - | MemoryMonitorDupDefaultCls := &MemoryMonitorBase{} | |
| 90 | - | MemoryMonitorDupDefaultCls.Ptr = MemoryMonitorDupDefaultPtr | |
| 91 | - | return MemoryMonitorDupDefaultCls | |
| 85 | + | cret := xMemoryMonitorDupDefault() | |
| 92 | 86 | ||
| 87 | + | if cret == 0 { | |
| 88 | + | return cls | |
| 89 | + | } | |
| 90 | + | cls = &MemoryMonitorBase{} | |
| 91 | + | cls.Ptr = cret | |
| 92 | + | return cls | |
| 93 | 93 | } | |
| 94 | 94 | ||
| 95 | 95 | func init() { | |
M v4/gio/gmemoryoutputstream.go +68 -44
| @@ -79,14 +79,16 @@ var xNewMemoryOutputStream func(uintptr, uint, uintptr, uintptr) uintptr | |||
| 79 | 79 | // stream3 = g_memory_output_stream_new (data, 200, NULL, free); | |
| 80 | 80 | // ]| | |
| 81 | 81 | func NewMemoryOutputStream(DataVar uintptr, SizeVar uint, ReallocFunctionVar ReallocFunc, DestroyFunctionVar glib.DestroyNotify) *OutputStream { | |
| 82 | - | NewMemoryOutputStreamPtr := xNewMemoryOutputStream(DataVar, SizeVar, purego.NewCallback(ReallocFunctionVar), purego.NewCallback(DestroyFunctionVar)) | |
| 83 | - | if NewMemoryOutputStreamPtr == 0 { | |
| 84 | - | return nil | |
| 85 | - | } | |
| 82 | + | var cls *OutputStream | |
| 83 | + | ||
| 84 | + | cret := xNewMemoryOutputStream(DataVar, SizeVar, purego.NewCallback(ReallocFunctionVar), purego.NewCallback(DestroyFunctionVar)) | |
| 86 | 85 | ||
| 87 | - | NewMemoryOutputStreamCls := &OutputStream{} | |
| 88 | - | NewMemoryOutputStreamCls.Ptr = NewMemoryOutputStreamPtr | |
| 89 | - | return NewMemoryOutputStreamCls | |
| 86 | + | if cret == 0 { | |
| 87 | + | return cls | |
| 88 | + | } | |
| 89 | + | cls = &OutputStream{} | |
| 90 | + | cls.Ptr = cret | |
| 91 | + | return cls | |
| 90 | 92 | } | |
| 91 | 93 | ||
| 92 | 94 | var xNewResizableMemoryOutputStream func() uintptr | |
| @@ -94,14 +96,16 @@ var xNewResizableMemoryOutputStream func() uintptr | |||
| 94 | 96 | // Creates a new #GMemoryOutputStream, using g_realloc() and g_free() | |
| 95 | 97 | // for memory allocation. | |
| 96 | 98 | func NewResizableMemoryOutputStream() *OutputStream { | |
| 97 | - | NewResizableMemoryOutputStreamPtr := xNewResizableMemoryOutputStream() | |
| 98 | - | if NewResizableMemoryOutputStreamPtr == 0 { | |
| 99 | - | return nil | |
| 100 | - | } | |
| 99 | + | var cls *OutputStream | |
| 100 | + | ||
| 101 | + | cret := xNewResizableMemoryOutputStream() | |
| 101 | 102 | ||
| 102 | - | NewResizableMemoryOutputStreamCls := &OutputStream{} | |
| 103 | - | NewResizableMemoryOutputStreamCls.Ptr = NewResizableMemoryOutputStreamPtr | |
| 104 | - | return NewResizableMemoryOutputStreamCls | |
| 103 | + | if cret == 0 { | |
| 104 | + | return cls | |
| 105 | + | } | |
| 106 | + | cls = &OutputStream{} | |
| 107 | + | cls.Ptr = cret | |
| 108 | + | return cls | |
| 105 | 109 | } | |
| 106 | 110 | ||
| 107 | 111 | var xMemoryOutputStreamGetData func(uintptr) uintptr | |
| @@ -112,8 +116,8 @@ var xMemoryOutputStreamGetData func(uintptr) uintptr | |||
| 112 | 116 | // write or truncate operation on the stream. | |
| 113 | 117 | func (x *MemoryOutputStream) GetData() uintptr { | |
| 114 | 118 | ||
| 115 | - | return xMemoryOutputStreamGetData(x.GoPointer()) | |
| 116 | - | ||
| 119 | + | cret := xMemoryOutputStreamGetData(x.GoPointer()) | |
| 120 | + | return cret | |
| 117 | 121 | } | |
| 118 | 122 | ||
| 119 | 123 | var xMemoryOutputStreamGetDataSize func(uintptr) uint | |
| @@ -122,8 +126,8 @@ var xMemoryOutputStreamGetDataSize func(uintptr) uint | |||
| 122 | 126 | // byte written in the stream that has not been truncated away. | |
| 123 | 127 | func (x *MemoryOutputStream) GetDataSize() uint { | |
| 124 | 128 | ||
| 125 | - | return xMemoryOutputStreamGetDataSize(x.GoPointer()) | |
| 126 | - | ||
| 129 | + | cret := xMemoryOutputStreamGetDataSize(x.GoPointer()) | |
| 130 | + | return cret | |
| 127 | 131 | } | |
| 128 | 132 | ||
| 129 | 133 | var xMemoryOutputStreamGetSize func(uintptr) uint | |
| @@ -145,8 +149,8 @@ var xMemoryOutputStreamGetSize func(uintptr) uint | |||
| 145 | 149 | // stream, use g_memory_output_stream_get_data_size(). | |
| 146 | 150 | func (x *MemoryOutputStream) GetSize() uint { | |
| 147 | 151 | ||
| 148 | - | return xMemoryOutputStreamGetSize(x.GoPointer()) | |
| 149 | - | ||
| 152 | + | cret := xMemoryOutputStreamGetSize(x.GoPointer()) | |
| 153 | + | return cret | |
| 150 | 154 | } | |
| 151 | 155 | ||
| 152 | 156 | var xMemoryOutputStreamStealAsBytes func(uintptr) *glib.Bytes | |
| @@ -155,8 +159,8 @@ var xMemoryOutputStreamStealAsBytes func(uintptr) *glib.Bytes | |||
| 155 | 159 | // closed before calling this function. | |
| 156 | 160 | func (x *MemoryOutputStream) StealAsBytes() *glib.Bytes { | |
| 157 | 161 | ||
| 158 | - | return xMemoryOutputStreamStealAsBytes(x.GoPointer()) | |
| 159 | - | ||
| 162 | + | cret := xMemoryOutputStreamStealAsBytes(x.GoPointer()) | |
| 163 | + | return cret | |
| 160 | 164 | } | |
| 161 | 165 | ||
| 162 | 166 | var xMemoryOutputStreamStealData func(uintptr) uintptr | |
| @@ -169,8 +173,8 @@ var xMemoryOutputStreamStealData func(uintptr) uintptr | |||
| 169 | 173 | // @ostream must be closed before calling this function. | |
| 170 | 174 | func (x *MemoryOutputStream) StealData() uintptr { | |
| 171 | 175 | ||
| 172 | - | return xMemoryOutputStreamStealData(x.GoPointer()) | |
| 173 | - | ||
| 176 | + | cret := xMemoryOutputStreamStealData(x.GoPointer()) | |
| 177 | + | return cret | |
| 174 | 178 | } | |
| 175 | 179 | ||
| 176 | 180 | func (c *MemoryOutputStream) GoPointer() uintptr { | |
| @@ -190,8 +194,8 @@ func (c *MemoryOutputStream) SetGoPointer(ptr uintptr) { | |||
| 190 | 194 | // a stream cannot switch from pollable to non-pollable or vice versa. | |
| 191 | 195 | func (x *MemoryOutputStream) CanPoll() bool { | |
| 192 | 196 | ||
| 193 | - | return XGPollableOutputStreamCanPoll(x.GoPointer()) | |
| 194 | - | ||
| 197 | + | cret := XGPollableOutputStreamCanPoll(x.GoPointer()) | |
| 198 | + | return cret | |
| 195 | 199 | } | |
| 196 | 200 | ||
| 197 | 201 | // Creates a #GSource that triggers when @stream can be written, or | |
| @@ -204,8 +208,8 @@ func (x *MemoryOutputStream) CanPoll() bool { | |||
| 204 | 208 | // rather than g_output_stream_write() from the callback. | |
| 205 | 209 | func (x *MemoryOutputStream) CreateSource(CancellableVar *Cancellable) *glib.Source { | |
| 206 | 210 | ||
| 207 | - | return XGPollableOutputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer()) | |
| 208 | - | ||
| 211 | + | cret := XGPollableOutputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer()) | |
| 212 | + | return cret | |
| 209 | 213 | } | |
| 210 | 214 | ||
| 211 | 215 | // Checks if @stream can be written. | |
| @@ -218,8 +222,8 @@ func (x *MemoryOutputStream) CreateSource(CancellableVar *Cancellable) *glib.Sou | |||
| 218 | 222 | // %G_IO_ERROR_WOULD_BLOCK error rather than blocking. | |
| 219 | 223 | func (x *MemoryOutputStream) IsWritable() bool { | |
| 220 | 224 | ||
| 221 | - | return XGPollableOutputStreamIsWritable(x.GoPointer()) | |
| 222 | - | ||
| 225 | + | cret := XGPollableOutputStreamIsWritable(x.GoPointer()) | |
| 226 | + | return cret | |
| 223 | 227 | } | |
| 224 | 228 | ||
| 225 | 229 | // Attempts to write up to @count bytes from @buffer to @stream, as | |
| @@ -237,9 +241,14 @@ func (x *MemoryOutputStream) IsWritable() bool { | |||
| 237 | 241 | // Also note that if %G_IO_ERROR_WOULD_BLOCK is returned some underlying | |
| 238 | 242 | // transports like D/TLS require that you re-send the same @buffer and | |
| 239 | 243 | // @count in the next write call. | |
| 240 | - | func (x *MemoryOutputStream) WriteNonblocking(BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) int { | |
| 244 | + | func (x *MemoryOutputStream) WriteNonblocking(BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) (int, error) { | |
| 245 | + | var cerr *glib.Error | |
| 241 | 246 | ||
| 242 | - | return XGPollableOutputStreamWriteNonblocking(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer()) | |
| 247 | + | cret := XGPollableOutputStreamWriteNonblocking(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer(), &cerr) | |
| 248 | + | if cerr == nil { | |
| 249 | + | return cret, nil | |
| 250 | + | } | |
| 251 | + | return cret, cerr | |
| 243 | 252 | ||
| 244 | 253 | } | |
| 245 | 254 | ||
| @@ -259,25 +268,30 @@ func (x *MemoryOutputStream) WriteNonblocking(BufferVar uintptr, CountVar uint, | |||
| 259 | 268 | // Also note that if %G_POLLABLE_RETURN_WOULD_BLOCK is returned some underlying | |
| 260 | 269 | // transports like D/TLS require that you re-send the same @vectors and | |
| 261 | 270 | // @n_vectors in the next write call. | |
| 262 | - | func (x *MemoryOutputStream) WritevNonblocking(VectorsVar uintptr, NVectorsVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) PollableReturn { | |
| 271 | + | func (x *MemoryOutputStream) WritevNonblocking(VectorsVar uintptr, NVectorsVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) (PollableReturn, error) { | |
| 272 | + | var cerr *glib.Error | |
| 263 | 273 | ||
| 264 | - | return XGPollableOutputStreamWritevNonblocking(x.GoPointer(), VectorsVar, NVectorsVar, BytesWrittenVar, CancellableVar.GoPointer()) | |
| 274 | + | cret := XGPollableOutputStreamWritevNonblocking(x.GoPointer(), VectorsVar, NVectorsVar, BytesWrittenVar, CancellableVar.GoPointer(), &cerr) | |
| 275 | + | if cerr == nil { | |
| 276 | + | return cret, nil | |
| 277 | + | } | |
| 278 | + | return cret, cerr | |
| 265 | 279 | ||
| 266 | 280 | } | |
| 267 | 281 | ||
| 268 | 282 | // Tests if the stream supports the #GSeekableIface. | |
| 269 | 283 | func (x *MemoryOutputStream) CanSeek() bool { | |
| 270 | 284 | ||
| 271 | - | return XGSeekableCanSeek(x.GoPointer()) | |
| 272 | - | ||
| 285 | + | cret := XGSeekableCanSeek(x.GoPointer()) | |
| 286 | + | return cret | |
| 273 | 287 | } | |
| 274 | 288 | ||
| 275 | 289 | // Tests if the length of the stream can be adjusted with | |
| 276 | 290 | // g_seekable_truncate(). | |
| 277 | 291 | func (x *MemoryOutputStream) CanTruncate() bool { | |
| 278 | 292 | ||
| 279 | - | return XGSeekableCanTruncate(x.GoPointer()) | |
| 280 | - | ||
| 293 | + | cret := XGSeekableCanTruncate(x.GoPointer()) | |
| 294 | + | return cret | |
| 281 | 295 | } | |
| 282 | 296 | ||
| 283 | 297 | // Seeks in the stream by the given @offset, modified by @type. | |
| @@ -294,17 +308,22 @@ func (x *MemoryOutputStream) CanTruncate() bool { | |||
| 294 | 308 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 295 | 309 | // triggering the cancellable object from another thread. If the operation | |
| 296 | 310 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 297 | - | func (x *MemoryOutputStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) bool { | |
| 311 | + | func (x *MemoryOutputStream) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) (bool, error) { | |
| 312 | + | var cerr *glib.Error | |
| 298 | 313 | ||
| 299 | - | return XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer()) | |
| 314 | + | cret := XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 315 | + | if cerr == nil { | |
| 316 | + | return cret, nil | |
| 317 | + | } | |
| 318 | + | return cret, cerr | |
| 300 | 319 | ||
| 301 | 320 | } | |
| 302 | 321 | ||
| 303 | 322 | // Tells the current position within the stream. | |
| 304 | 323 | func (x *MemoryOutputStream) Tell() int64 { | |
| 305 | 324 | ||
| 306 | - | return XGSeekableTell(x.GoPointer()) | |
| 307 | - | ||
| 325 | + | cret := XGSeekableTell(x.GoPointer()) | |
| 326 | + | return cret | |
| 308 | 327 | } | |
| 309 | 328 | ||
| 310 | 329 | // Sets the length of the stream to @offset. If the stream was previously | |
| @@ -316,9 +335,14 @@ func (x *MemoryOutputStream) Tell() int64 { | |||
| 316 | 335 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an | |
| 317 | 336 | // operation was partially finished when the operation was cancelled the | |
| 318 | 337 | // partial result will be returned, without an error. | |
| 319 | - | func (x *MemoryOutputStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) bool { | |
| 338 | + | func (x *MemoryOutputStream) Truncate(OffsetVar int64, CancellableVar *Cancellable) (bool, error) { | |
| 339 | + | var cerr *glib.Error | |
| 320 | 340 | ||
| 321 | - | return XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer()) | |
| 341 | + | cret := XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer(), &cerr) | |
| 342 | + | if cerr == nil { | |
| 343 | + | return cret, nil | |
| 344 | + | } | |
| 345 | + | return cret, cerr | |
| 322 | 346 | ||
| 323 | 347 | } | |
| 324 | 348 | ||
M v4/gio/gmenumodel.go +54 -54
| @@ -49,8 +49,8 @@ var xMenuAttributeIterGetName func(uintptr) string | |||
| 49 | 49 | // The iterator is not advanced. | |
| 50 | 50 | func (x *MenuAttributeIter) GetName() string { | |
| 51 | 51 | ||
| 52 | - | return xMenuAttributeIterGetName(x.GoPointer()) | |
| 53 | - | ||
| 52 | + | cret := xMenuAttributeIterGetName(x.GoPointer()) | |
| 53 | + | return cret | |
| 54 | 54 | } | |
| 55 | 55 | ||
| 56 | 56 | var xMenuAttributeIterGetNext func(uintptr, string, **glib.Variant) bool | |
| @@ -72,8 +72,8 @@ var xMenuAttributeIterGetNext func(uintptr, string, **glib.Variant) bool | |||
| 72 | 72 | // be unreffed using g_variant_unref() when it is no longer in use. | |
| 73 | 73 | func (x *MenuAttributeIter) GetNext(OutNameVar string, ValueVar **glib.Variant) bool { | |
| 74 | 74 | ||
| 75 | - | return xMenuAttributeIterGetNext(x.GoPointer(), OutNameVar, ValueVar) | |
| 76 | - | ||
| 75 | + | cret := xMenuAttributeIterGetNext(x.GoPointer(), OutNameVar, ValueVar) | |
| 76 | + | return cret | |
| 77 | 77 | } | |
| 78 | 78 | ||
| 79 | 79 | var xMenuAttributeIterGetValue func(uintptr) *glib.Variant | |
| @@ -83,8 +83,8 @@ var xMenuAttributeIterGetValue func(uintptr) *glib.Variant | |||
| 83 | 83 | // The iterator is not advanced. | |
| 84 | 84 | func (x *MenuAttributeIter) GetValue() *glib.Variant { | |
| 85 | 85 | ||
| 86 | - | return xMenuAttributeIterGetValue(x.GoPointer()) | |
| 87 | - | ||
| 86 | + | cret := xMenuAttributeIterGetValue(x.GoPointer()) | |
| 87 | + | return cret | |
| 88 | 88 | } | |
| 89 | 89 | ||
| 90 | 90 | var xMenuAttributeIterNext func(uintptr) bool | |
| @@ -100,8 +100,8 @@ var xMenuAttributeIterNext func(uintptr) bool | |||
| 100 | 100 | // attribute exists at all). | |
| 101 | 101 | func (x *MenuAttributeIter) Next() bool { | |
| 102 | 102 | ||
| 103 | - | return xMenuAttributeIterNext(x.GoPointer()) | |
| 104 | - | ||
| 103 | + | cret := xMenuAttributeIterNext(x.GoPointer()) | |
| 104 | + | return cret | |
| 105 | 105 | } | |
| 106 | 106 | ||
| 107 | 107 | func (c *MenuAttributeIter) GoPointer() uintptr { | |
| @@ -131,8 +131,8 @@ var xMenuLinkIterGetName func(uintptr) string | |||
| 131 | 131 | // The iterator is not advanced. | |
| 132 | 132 | func (x *MenuLinkIter) GetName() string { | |
| 133 | 133 | ||
| 134 | - | return xMenuLinkIterGetName(x.GoPointer()) | |
| 135 | - | ||
| 134 | + | cret := xMenuLinkIterGetName(x.GoPointer()) | |
| 135 | + | return cret | |
| 136 | 136 | } | |
| 137 | 137 | ||
| 138 | 138 | var xMenuLinkIterGetNext func(uintptr, string, *uintptr) bool | |
| @@ -153,8 +153,8 @@ var xMenuLinkIterGetNext func(uintptr, string, *uintptr) bool | |||
| 153 | 153 | // be unreffed using g_object_unref() when it is no longer in use. | |
| 154 | 154 | func (x *MenuLinkIter) GetNext(OutLinkVar string, ValueVar **MenuModel) bool { | |
| 155 | 155 | ||
| 156 | - | return xMenuLinkIterGetNext(x.GoPointer(), OutLinkVar, gobject.ConvertPtr(ValueVar)) | |
| 157 | - | ||
| 156 | + | cret := xMenuLinkIterGetNext(x.GoPointer(), OutLinkVar, gobject.ConvertPtr(ValueVar)) | |
| 157 | + | return cret | |
| 158 | 158 | } | |
| 159 | 159 | ||
| 160 | 160 | var xMenuLinkIterGetValue func(uintptr) uintptr | |
| @@ -163,16 +163,16 @@ var xMenuLinkIterGetValue func(uintptr) uintptr | |||
| 163 | 163 | // | |
| 164 | 164 | // The iterator is not advanced. | |
| 165 | 165 | func (x *MenuLinkIter) GetValue() *MenuModel { | |
| 166 | + | var cls *MenuModel | |
| 166 | 167 | ||
| 167 | - | GetValuePtr := xMenuLinkIterGetValue(x.GoPointer()) | |
| 168 | - | if GetValuePtr == 0 { | |
| 169 | - | return nil | |
| 170 | - | } | |
| 171 | - | ||
| 172 | - | GetValueCls := &MenuModel{} | |
| 173 | - | GetValueCls.Ptr = GetValuePtr | |
| 174 | - | return GetValueCls | |
| 168 | + | cret := xMenuLinkIterGetValue(x.GoPointer()) | |
| 175 | 169 | ||
| 170 | + | if cret == 0 { | |
| 171 | + | return cls | |
| 172 | + | } | |
| 173 | + | cls = &MenuModel{} | |
| 174 | + | cls.Ptr = cret | |
| 175 | + | return cls | |
| 176 | 176 | } | |
| 177 | 177 | ||
| 178 | 178 | var xMenuLinkIterNext func(uintptr) bool | |
| @@ -187,8 +187,8 @@ var xMenuLinkIterNext func(uintptr) bool | |||
| 187 | 187 | // at all). | |
| 188 | 188 | func (x *MenuLinkIter) Next() bool { | |
| 189 | 189 | ||
| 190 | - | return xMenuLinkIterNext(x.GoPointer()) | |
| 191 | - | ||
| 190 | + | cret := xMenuLinkIterNext(x.GoPointer()) | |
| 191 | + | return cret | |
| 192 | 192 | } | |
| 193 | 193 | ||
| 194 | 194 | func (c *MenuLinkIter) GoPointer() uintptr { | |
| @@ -342,8 +342,8 @@ var xMenuModelGetItemAttribute func(uintptr, int, string, string, ...interface{} | |||
| 342 | 342 | // particular, no '&' characters are allowed in @format_string. | |
| 343 | 343 | func (x *MenuModel) GetItemAttribute(ItemIndexVar int, AttributeVar string, FormatStringVar string, varArgs ...interface{}) bool { | |
| 344 | 344 | ||
| 345 | - | return xMenuModelGetItemAttribute(x.GoPointer(), ItemIndexVar, AttributeVar, FormatStringVar, varArgs...) | |
| 346 | - | ||
| 345 | + | cret := xMenuModelGetItemAttribute(x.GoPointer(), ItemIndexVar, AttributeVar, FormatStringVar, varArgs...) | |
| 346 | + | return cret | |
| 347 | 347 | } | |
| 348 | 348 | ||
| 349 | 349 | var xMenuModelGetItemAttributeValue func(uintptr, int, string, *glib.VariantType) *glib.Variant | |
| @@ -361,8 +361,8 @@ var xMenuModelGetItemAttributeValue func(uintptr, int, string, *glib.VariantType | |||
| 361 | 361 | // then %NULL is returned. | |
| 362 | 362 | func (x *MenuModel) GetItemAttributeValue(ItemIndexVar int, AttributeVar string, ExpectedTypeVar *glib.VariantType) *glib.Variant { | |
| 363 | 363 | ||
| 364 | - | return xMenuModelGetItemAttributeValue(x.GoPointer(), ItemIndexVar, AttributeVar, ExpectedTypeVar) | |
| 365 | - | ||
| 364 | + | cret := xMenuModelGetItemAttributeValue(x.GoPointer(), ItemIndexVar, AttributeVar, ExpectedTypeVar) | |
| 365 | + | return cret | |
| 366 | 366 | } | |
| 367 | 367 | ||
| 368 | 368 | var xMenuModelGetItemLink func(uintptr, int, string) uintptr | |
| @@ -373,16 +373,16 @@ var xMenuModelGetItemLink func(uintptr, int, string) uintptr | |||
| 373 | 373 | // If the link exists, the linked #GMenuModel is returned. If the link | |
| 374 | 374 | // does not exist, %NULL is returned. | |
| 375 | 375 | func (x *MenuModel) GetItemLink(ItemIndexVar int, LinkVar string) *MenuModel { | |
| 376 | + | var cls *MenuModel | |
| 376 | 377 | ||
| 377 | - | GetItemLinkPtr := xMenuModelGetItemLink(x.GoPointer(), ItemIndexVar, LinkVar) | |
| 378 | - | if GetItemLinkPtr == 0 { | |
| 379 | - | return nil | |
| 380 | - | } | |
| 381 | - | ||
| 382 | - | GetItemLinkCls := &MenuModel{} | |
| 383 | - | GetItemLinkCls.Ptr = GetItemLinkPtr | |
| 384 | - | return GetItemLinkCls | |
| 378 | + | cret := xMenuModelGetItemLink(x.GoPointer(), ItemIndexVar, LinkVar) | |
| 385 | 379 | ||
| 380 | + | if cret == 0 { | |
| 381 | + | return cls | |
| 382 | + | } | |
| 383 | + | cls = &MenuModel{} | |
| 384 | + | cls.Ptr = cret | |
| 385 | + | return cls | |
| 386 | 386 | } | |
| 387 | 387 | ||
| 388 | 388 | var xMenuModelGetNItems func(uintptr) int | |
| @@ -390,8 +390,8 @@ var xMenuModelGetNItems func(uintptr) int | |||
| 390 | 390 | // Query the number of items in @model. | |
| 391 | 391 | func (x *MenuModel) GetNItems() int { | |
| 392 | 392 | ||
| 393 | - | return xMenuModelGetNItems(x.GoPointer()) | |
| 394 | - | ||
| 393 | + | cret := xMenuModelGetNItems(x.GoPointer()) | |
| 394 | + | return cret | |
| 395 | 395 | } | |
| 396 | 396 | ||
| 397 | 397 | var xMenuModelIsMutable func(uintptr) bool | |
| @@ -402,8 +402,8 @@ var xMenuModelIsMutable func(uintptr) bool | |||
| 402 | 402 | // signal. Consumers of the model may make optimisations accordingly. | |
| 403 | 403 | func (x *MenuModel) IsMutable() bool { | |
| 404 | 404 | ||
| 405 | - | return xMenuModelIsMutable(x.GoPointer()) | |
| 406 | - | ||
| 405 | + | cret := xMenuModelIsMutable(x.GoPointer()) | |
| 406 | + | return cret | |
| 407 | 407 | } | |
| 408 | 408 | ||
| 409 | 409 | var xMenuModelItemsChanged func(uintptr, int, int, int) | |
| @@ -436,16 +436,16 @@ var xMenuModelIterateItemAttributes func(uintptr, int) uintptr | |||
| 436 | 436 | // | |
| 437 | 437 | // You must free the iterator with g_object_unref() when you are done. | |
| 438 | 438 | func (x *MenuModel) IterateItemAttributes(ItemIndexVar int) *MenuAttributeIter { | |
| 439 | + | var cls *MenuAttributeIter | |
| 439 | 440 | ||
| 440 | - | IterateItemAttributesPtr := xMenuModelIterateItemAttributes(x.GoPointer(), ItemIndexVar) | |
| 441 | - | if IterateItemAttributesPtr == 0 { | |
| 442 | - | return nil | |
| 443 | - | } | |
| 444 | - | ||
| 445 | - | IterateItemAttributesCls := &MenuAttributeIter{} | |
| 446 | - | IterateItemAttributesCls.Ptr = IterateItemAttributesPtr | |
| 447 | - | return IterateItemAttributesCls | |
| 441 | + | cret := xMenuModelIterateItemAttributes(x.GoPointer(), ItemIndexVar) | |
| 448 | 442 | ||
| 443 | + | if cret == 0 { | |
| 444 | + | return cls | |
| 445 | + | } | |
| 446 | + | cls = &MenuAttributeIter{} | |
| 447 | + | cls.Ptr = cret | |
| 448 | + | return cls | |
| 449 | 449 | } | |
| 450 | 450 | ||
| 451 | 451 | var xMenuModelIterateItemLinks func(uintptr, int) uintptr | |
| @@ -455,16 +455,16 @@ var xMenuModelIterateItemLinks func(uintptr, int) uintptr | |||
| 455 | 455 | // | |
| 456 | 456 | // You must free the iterator with g_object_unref() when you are done. | |
| 457 | 457 | func (x *MenuModel) IterateItemLinks(ItemIndexVar int) *MenuLinkIter { | |
| 458 | + | var cls *MenuLinkIter | |
| 458 | 459 | ||
| 459 | - | IterateItemLinksPtr := xMenuModelIterateItemLinks(x.GoPointer(), ItemIndexVar) | |
| 460 | - | if IterateItemLinksPtr == 0 { | |
| 461 | - | return nil | |
| 462 | - | } | |
| 463 | - | ||
| 464 | - | IterateItemLinksCls := &MenuLinkIter{} | |
| 465 | - | IterateItemLinksCls.Ptr = IterateItemLinksPtr | |
| 466 | - | return IterateItemLinksCls | |
| 460 | + | cret := xMenuModelIterateItemLinks(x.GoPointer(), ItemIndexVar) | |
| 467 | 461 | ||
| 462 | + | if cret == 0 { | |
| 463 | + | return cls | |
| 464 | + | } | |
| 465 | + | cls = &MenuLinkIter{} | |
| 466 | + | cls.Ptr = cret | |
| 467 | + | return cls | |
| 468 | 468 | } | |
| 469 | 469 | ||
| 470 | 470 | func (c *MenuModel) GoPointer() uintptr { | |
M v4/gio/gmount.go +117 -81
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | ) | |
| 8 | 9 | ||
| 9 | 10 | // Interface for implementing operations for mounts. | |
| @@ -76,15 +77,15 @@ func (x *MountBase) SetGoPointer(ptr uintptr) { | |||
| 76 | 77 | // Checks if @mount can be ejected. | |
| 77 | 78 | func (x *MountBase) CanEject() bool { | |
| 78 | 79 | ||
| 79 | - | return XGMountCanEject(x.GoPointer()) | |
| 80 | - | ||
| 80 | + | cret := XGMountCanEject(x.GoPointer()) | |
| 81 | + | return cret | |
| 81 | 82 | } | |
| 82 | 83 | ||
| 83 | 84 | // Checks if @mount can be unmounted. | |
| 84 | 85 | func (x *MountBase) CanUnmount() bool { | |
| 85 | 86 | ||
| 86 | - | return XGMountCanUnmount(x.GoPointer()) | |
| 87 | - | ||
| 87 | + | cret := XGMountCanUnmount(x.GoPointer()) | |
| 88 | + | return cret | |
| 88 | 89 | } | |
| 89 | 90 | ||
| 90 | 91 | // Ejects a mount. This is an asynchronous operation, and is | |
| @@ -98,9 +99,14 @@ func (x *MountBase) Eject(FlagsVar MountUnmountFlags, CancellableVar *Cancellabl | |||
| 98 | 99 | ||
| 99 | 100 | // Finishes ejecting a mount. If any errors occurred during the operation, | |
| 100 | 101 | // @error will be set to contain the errors and %FALSE will be returned. | |
| 101 | - | func (x *MountBase) EjectFinish(ResultVar AsyncResult) bool { | |
| 102 | + | func (x *MountBase) EjectFinish(ResultVar AsyncResult) (bool, error) { | |
| 103 | + | var cerr *glib.Error | |
| 102 | 104 | ||
| 103 | - | return XGMountEjectFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 105 | + | cret := XGMountEjectFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 106 | + | if cerr == nil { | |
| 107 | + | return cret, nil | |
| 108 | + | } | |
| 109 | + | return cret, cerr | |
| 104 | 110 | ||
| 105 | 111 | } | |
| 106 | 112 | ||
| @@ -115,9 +121,14 @@ func (x *MountBase) EjectWithOperation(FlagsVar MountUnmountFlags, MountOperatio | |||
| 115 | 121 | ||
| 116 | 122 | // Finishes ejecting a mount. If any errors occurred during the operation, | |
| 117 | 123 | // @error will be set to contain the errors and %FALSE will be returned. | |
| 118 | - | func (x *MountBase) EjectWithOperationFinish(ResultVar AsyncResult) bool { | |
| 124 | + | func (x *MountBase) EjectWithOperationFinish(ResultVar AsyncResult) (bool, error) { | |
| 125 | + | var cerr *glib.Error | |
| 119 | 126 | ||
| 120 | - | return XGMountEjectWithOperationFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 127 | + | cret := XGMountEjectWithOperationFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 128 | + | if cerr == nil { | |
| 129 | + | return cret, nil | |
| 130 | + | } | |
| 131 | + | return cret, cerr | |
| 121 | 132 | ||
| 122 | 133 | } | |
| 123 | 134 | ||
| @@ -125,16 +136,16 @@ func (x *MountBase) EjectWithOperationFinish(ResultVar AsyncResult) bool { | |||
| 125 | 136 | // @mount is a path that reflects the main entry point for the user (e.g. | |
| 126 | 137 | // the home directory, or the root of the volume). | |
| 127 | 138 | func (x *MountBase) GetDefaultLocation() *FileBase { | |
| 139 | + | var cls *FileBase | |
| 128 | 140 | ||
| 129 | - | GetDefaultLocationPtr := XGMountGetDefaultLocation(x.GoPointer()) | |
| 130 | - | if GetDefaultLocationPtr == 0 { | |
| 131 | - | return nil | |
| 132 | - | } | |
| 133 | - | ||
| 134 | - | GetDefaultLocationCls := &FileBase{} | |
| 135 | - | GetDefaultLocationCls.Ptr = GetDefaultLocationPtr | |
| 136 | - | return GetDefaultLocationCls | |
| 141 | + | cret := XGMountGetDefaultLocation(x.GoPointer()) | |
| 137 | 142 | ||
| 143 | + | if cret == 0 { | |
| 144 | + | return cls | |
| 145 | + | } | |
| 146 | + | cls = &FileBase{} | |
| 147 | + | cls.Ptr = cret | |
| 148 | + | return cls | |
| 138 | 149 | } | |
| 139 | 150 | ||
| 140 | 151 | // Gets the drive for the @mount. | |
| @@ -142,72 +153,72 @@ func (x *MountBase) GetDefaultLocation() *FileBase { | |||
| 142 | 153 | // This is a convenience method for getting the #GVolume and then | |
| 143 | 154 | // using that object to get the #GDrive. | |
| 144 | 155 | func (x *MountBase) GetDrive() *DriveBase { | |
| 156 | + | var cls *DriveBase | |
| 145 | 157 | ||
| 146 | - | GetDrivePtr := XGMountGetDrive(x.GoPointer()) | |
| 147 | - | if GetDrivePtr == 0 { | |
| 148 | - | return nil | |
| 149 | - | } | |
| 150 | - | ||
| 151 | - | GetDriveCls := &DriveBase{} | |
| 152 | - | GetDriveCls.Ptr = GetDrivePtr | |
| 153 | - | return GetDriveCls | |
| 158 | + | cret := XGMountGetDrive(x.GoPointer()) | |
| 154 | 159 | ||
| 160 | + | if cret == 0 { | |
| 161 | + | return cls | |
| 162 | + | } | |
| 163 | + | cls = &DriveBase{} | |
| 164 | + | cls.Ptr = cret | |
| 165 | + | return cls | |
| 155 | 166 | } | |
| 156 | 167 | ||
| 157 | 168 | // Gets the icon for @mount. | |
| 158 | 169 | func (x *MountBase) GetIcon() *IconBase { | |
| 170 | + | var cls *IconBase | |
| 159 | 171 | ||
| 160 | - | GetIconPtr := XGMountGetIcon(x.GoPointer()) | |
| 161 | - | if GetIconPtr == 0 { | |
| 162 | - | return nil | |
| 163 | - | } | |
| 164 | - | ||
| 165 | - | GetIconCls := &IconBase{} | |
| 166 | - | GetIconCls.Ptr = GetIconPtr | |
| 167 | - | return GetIconCls | |
| 172 | + | cret := XGMountGetIcon(x.GoPointer()) | |
| 168 | 173 | ||
| 174 | + | if cret == 0 { | |
| 175 | + | return cls | |
| 176 | + | } | |
| 177 | + | cls = &IconBase{} | |
| 178 | + | cls.Ptr = cret | |
| 179 | + | return cls | |
| 169 | 180 | } | |
| 170 | 181 | ||
| 171 | 182 | // Gets the name of @mount. | |
| 172 | 183 | func (x *MountBase) GetName() string { | |
| 173 | 184 | ||
| 174 | - | return XGMountGetName(x.GoPointer()) | |
| 175 | - | ||
| 185 | + | cret := XGMountGetName(x.GoPointer()) | |
| 186 | + | return cret | |
| 176 | 187 | } | |
| 177 | 188 | ||
| 178 | 189 | // Gets the root directory on @mount. | |
| 179 | 190 | func (x *MountBase) GetRoot() *FileBase { | |
| 191 | + | var cls *FileBase | |
| 180 | 192 | ||
| 181 | - | GetRootPtr := XGMountGetRoot(x.GoPointer()) | |
| 182 | - | if GetRootPtr == 0 { | |
| 183 | - | return nil | |
| 184 | - | } | |
| 185 | - | ||
| 186 | - | GetRootCls := &FileBase{} | |
| 187 | - | GetRootCls.Ptr = GetRootPtr | |
| 188 | - | return GetRootCls | |
| 193 | + | cret := XGMountGetRoot(x.GoPointer()) | |
| 189 | 194 | ||
| 195 | + | if cret == 0 { | |
| 196 | + | return cls | |
| 197 | + | } | |
| 198 | + | cls = &FileBase{} | |
| 199 | + | cls.Ptr = cret | |
| 200 | + | return cls | |
| 190 | 201 | } | |
| 191 | 202 | ||
| 192 | 203 | // Gets the sort key for @mount, if any. | |
| 193 | 204 | func (x *MountBase) GetSortKey() string { | |
| 194 | 205 | ||
| 195 | - | return XGMountGetSortKey(x.GoPointer()) | |
| 196 | - | ||
| 206 | + | cret := XGMountGetSortKey(x.GoPointer()) | |
| 207 | + | return cret | |
| 197 | 208 | } | |
| 198 | 209 | ||
| 199 | 210 | // Gets the symbolic icon for @mount. | |
| 200 | 211 | func (x *MountBase) GetSymbolicIcon() *IconBase { | |
| 212 | + | var cls *IconBase | |
| 201 | 213 | ||
| 202 | - | GetSymbolicIconPtr := XGMountGetSymbolicIcon(x.GoPointer()) | |
| 203 | - | if GetSymbolicIconPtr == 0 { | |
| 204 | - | return nil | |
| 205 | - | } | |
| 206 | - | ||
| 207 | - | GetSymbolicIconCls := &IconBase{} | |
| 208 | - | GetSymbolicIconCls.Ptr = GetSymbolicIconPtr | |
| 209 | - | return GetSymbolicIconCls | |
| 214 | + | cret := XGMountGetSymbolicIcon(x.GoPointer()) | |
| 210 | 215 | ||
| 216 | + | if cret == 0 { | |
| 217 | + | return cls | |
| 218 | + | } | |
| 219 | + | cls = &IconBase{} | |
| 220 | + | cls.Ptr = cret | |
| 221 | + | return cls | |
| 211 | 222 | } | |
| 212 | 223 | ||
| 213 | 224 | // Gets the UUID for the @mount. The reference is typically based on | |
| @@ -216,22 +227,22 @@ func (x *MountBase) GetSymbolicIcon() *IconBase { | |||
| 216 | 227 | // available. | |
| 217 | 228 | func (x *MountBase) GetUuid() string { | |
| 218 | 229 | ||
| 219 | - | return XGMountGetUuid(x.GoPointer()) | |
| 220 | - | ||
| 230 | + | cret := XGMountGetUuid(x.GoPointer()) | |
| 231 | + | return cret | |
| 221 | 232 | } | |
| 222 | 233 | ||
| 223 | 234 | // Gets the volume for the @mount. | |
| 224 | 235 | func (x *MountBase) GetVolume() *VolumeBase { | |
| 236 | + | var cls *VolumeBase | |
| 225 | 237 | ||
| 226 | - | GetVolumePtr := XGMountGetVolume(x.GoPointer()) | |
| 227 | - | if GetVolumePtr == 0 { | |
| 228 | - | return nil | |
| 229 | - | } | |
| 230 | - | ||
| 231 | - | GetVolumeCls := &VolumeBase{} | |
| 232 | - | GetVolumeCls.Ptr = GetVolumePtr | |
| 233 | - | return GetVolumeCls | |
| 238 | + | cret := XGMountGetVolume(x.GoPointer()) | |
| 234 | 239 | ||
| 240 | + | if cret == 0 { | |
| 241 | + | return cls | |
| 242 | + | } | |
| 243 | + | cls = &VolumeBase{} | |
| 244 | + | cls.Ptr = cret | |
| 245 | + | return cls | |
| 235 | 246 | } | |
| 236 | 247 | ||
| 237 | 248 | // Tries to guess the type of content stored on @mount. Returns one or | |
| @@ -256,9 +267,14 @@ func (x *MountBase) GuessContentType(ForceRescanVar bool, CancellableVar *Cancel | |||
| 256 | 267 | // %FALSE will be returned. In particular, you may get an | |
| 257 | 268 | // %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content | |
| 258 | 269 | // guessing. | |
| 259 | - | func (x *MountBase) GuessContentTypeFinish(ResultVar AsyncResult) uintptr { | |
| 270 | + | func (x *MountBase) GuessContentTypeFinish(ResultVar AsyncResult) (uintptr, error) { | |
| 271 | + | var cerr *glib.Error | |
| 260 | 272 | ||
| 261 | - | return XGMountGuessContentTypeFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 273 | + | cret := XGMountGuessContentTypeFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 274 | + | if cerr == nil { | |
| 275 | + | return cret, nil | |
| 276 | + | } | |
| 277 | + | return cret, cerr | |
| 262 | 278 | ||
| 263 | 279 | } | |
| 264 | 280 | ||
| @@ -271,9 +287,14 @@ func (x *MountBase) GuessContentTypeFinish(ResultVar AsyncResult) uintptr { | |||
| 271 | 287 | // | |
| 272 | 288 | // This is a synchronous operation and as such may block doing IO; | |
| 273 | 289 | // see g_mount_guess_content_type() for the asynchronous version. | |
| 274 | - | func (x *MountBase) GuessContentTypeSync(ForceRescanVar bool, CancellableVar *Cancellable) uintptr { | |
| 290 | + | func (x *MountBase) GuessContentTypeSync(ForceRescanVar bool, CancellableVar *Cancellable) (uintptr, error) { | |
| 291 | + | var cerr *glib.Error | |
| 275 | 292 | ||
| 276 | - | return XGMountGuessContentTypeSync(x.GoPointer(), ForceRescanVar, CancellableVar.GoPointer()) | |
| 293 | + | cret := XGMountGuessContentTypeSync(x.GoPointer(), ForceRescanVar, CancellableVar.GoPointer(), &cerr) | |
| 294 | + | if cerr == nil { | |
| 295 | + | return cret, nil | |
| 296 | + | } | |
| 297 | + | return cret, cerr | |
| 277 | 298 | ||
| 278 | 299 | } | |
| 279 | 300 | ||
| @@ -302,8 +323,8 @@ func (x *MountBase) GuessContentTypeSync(ForceRescanVar bool, CancellableVar *Ca | |||
| 302 | 323 | // activation root on a #GVolume is set. | |
| 303 | 324 | func (x *MountBase) IsShadowed() bool { | |
| 304 | 325 | ||
| 305 | - | return XGMountIsShadowed(x.GoPointer()) | |
| 306 | - | ||
| 326 | + | cret := XGMountIsShadowed(x.GoPointer()) | |
| 327 | + | return cret | |
| 307 | 328 | } | |
| 308 | 329 | ||
| 309 | 330 | // Remounts a mount. This is an asynchronous operation, and is | |
| @@ -323,9 +344,14 @@ func (x *MountBase) Remount(FlagsVar MountMountFlags, MountOperationVar *MountOp | |||
| 323 | 344 | ||
| 324 | 345 | // Finishes remounting a mount. If any errors occurred during the operation, | |
| 325 | 346 | // @error will be set to contain the errors and %FALSE will be returned. | |
| 326 | - | func (x *MountBase) RemountFinish(ResultVar AsyncResult) bool { | |
| 347 | + | func (x *MountBase) RemountFinish(ResultVar AsyncResult) (bool, error) { | |
| 348 | + | var cerr *glib.Error | |
| 327 | 349 | ||
| 328 | - | return XGMountRemountFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 350 | + | cret := XGMountRemountFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 351 | + | if cerr == nil { | |
| 352 | + | return cret, nil | |
| 353 | + | } | |
| 354 | + | return cret, cerr | |
| 329 | 355 | ||
| 330 | 356 | } | |
| 331 | 357 | ||
| @@ -350,9 +376,14 @@ func (x *MountBase) Unmount(FlagsVar MountUnmountFlags, CancellableVar *Cancella | |||
| 350 | 376 | ||
| 351 | 377 | // Finishes unmounting a mount. If any errors occurred during the operation, | |
| 352 | 378 | // @error will be set to contain the errors and %FALSE will be returned. | |
| 353 | - | func (x *MountBase) UnmountFinish(ResultVar AsyncResult) bool { | |
| 379 | + | func (x *MountBase) UnmountFinish(ResultVar AsyncResult) (bool, error) { | |
| 380 | + | var cerr *glib.Error | |
| 354 | 381 | ||
| 355 | - | return XGMountUnmountFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 382 | + | cret := XGMountUnmountFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 383 | + | if cerr == nil { | |
| 384 | + | return cret, nil | |
| 385 | + | } | |
| 386 | + | return cret, cerr | |
| 356 | 387 | ||
| 357 | 388 | } | |
| 358 | 389 | ||
| @@ -367,9 +398,14 @@ func (x *MountBase) UnmountWithOperation(FlagsVar MountUnmountFlags, MountOperat | |||
| 367 | 398 | ||
| 368 | 399 | // Finishes unmounting a mount. If any errors occurred during the operation, | |
| 369 | 400 | // @error will be set to contain the errors and %FALSE will be returned. | |
| 370 | - | func (x *MountBase) UnmountWithOperationFinish(ResultVar AsyncResult) bool { | |
| 401 | + | func (x *MountBase) UnmountWithOperationFinish(ResultVar AsyncResult) (bool, error) { | |
| 402 | + | var cerr *glib.Error | |
| 371 | 403 | ||
| 372 | - | return XGMountUnmountWithOperationFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 404 | + | cret := XGMountUnmountWithOperationFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 405 | + | if cerr == nil { | |
| 406 | + | return cret, nil | |
| 407 | + | } | |
| 408 | + | return cret, cerr | |
| 373 | 409 | ||
| 374 | 410 | } | |
| 375 | 411 | ||
| @@ -386,9 +422,9 @@ func (x *MountBase) Unshadow() { | |||
| 386 | 422 | var XGMountCanEject func(uintptr) bool | |
| 387 | 423 | var XGMountCanUnmount func(uintptr) bool | |
| 388 | 424 | var XGMountEject func(uintptr, MountUnmountFlags, uintptr, uintptr, uintptr) | |
| 389 | - | var XGMountEjectFinish func(uintptr, uintptr) bool | |
| 425 | + | var XGMountEjectFinish func(uintptr, uintptr, **glib.Error) bool | |
| 390 | 426 | var XGMountEjectWithOperation func(uintptr, MountUnmountFlags, uintptr, uintptr, uintptr, uintptr) | |
| 391 | - | var XGMountEjectWithOperationFinish func(uintptr, uintptr) bool | |
| 427 | + | var XGMountEjectWithOperationFinish func(uintptr, uintptr, **glib.Error) bool | |
| 392 | 428 | var XGMountGetDefaultLocation func(uintptr) uintptr | |
| 393 | 429 | var XGMountGetDrive func(uintptr) uintptr | |
| 394 | 430 | var XGMountGetIcon func(uintptr) uintptr | |
| @@ -399,16 +435,16 @@ var XGMountGetSymbolicIcon func(uintptr) uintptr | |||
| 399 | 435 | var XGMountGetUuid func(uintptr) string | |
| 400 | 436 | var XGMountGetVolume func(uintptr) uintptr | |
| 401 | 437 | var XGMountGuessContentType func(uintptr, bool, uintptr, uintptr, uintptr) | |
| 402 | - | var XGMountGuessContentTypeFinish func(uintptr, uintptr) uintptr | |
| 403 | - | var XGMountGuessContentTypeSync func(uintptr, bool, uintptr) uintptr | |
| 438 | + | var XGMountGuessContentTypeFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 439 | + | var XGMountGuessContentTypeSync func(uintptr, bool, uintptr, **glib.Error) uintptr | |
| 404 | 440 | var XGMountIsShadowed func(uintptr) bool | |
| 405 | 441 | var XGMountRemount func(uintptr, MountMountFlags, uintptr, uintptr, uintptr, uintptr) | |
| 406 | - | var XGMountRemountFinish func(uintptr, uintptr) bool | |
| 442 | + | var XGMountRemountFinish func(uintptr, uintptr, **glib.Error) bool | |
| 407 | 443 | var XGMountShadow func(uintptr) | |
| 408 | 444 | var XGMountUnmount func(uintptr, MountUnmountFlags, uintptr, uintptr, uintptr) | |
| 409 | - | var XGMountUnmountFinish func(uintptr, uintptr) bool | |
| 445 | + | var XGMountUnmountFinish func(uintptr, uintptr, **glib.Error) bool | |
| 410 | 446 | var XGMountUnmountWithOperation func(uintptr, MountUnmountFlags, uintptr, uintptr, uintptr, uintptr) | |
| 411 | - | var XGMountUnmountWithOperationFinish func(uintptr, uintptr) bool | |
| 447 | + | var XGMountUnmountWithOperationFinish func(uintptr, uintptr, **glib.Error) bool | |
| 412 | 448 | var XGMountUnshadow func(uintptr) | |
| 413 | 449 | ||
| 414 | 450 | func init() { | |
M v4/gio/gmountoperation.go +27 -25
| @@ -49,14 +49,16 @@ var xNewMountOperation func() uintptr | |||
| 49 | 49 | ||
| 50 | 50 | // Creates a new mount operation. | |
| 51 | 51 | func NewMountOperation() *MountOperation { | |
| 52 | - | NewMountOperationPtr := xNewMountOperation() | |
| 53 | - | if NewMountOperationPtr == 0 { | |
| 54 | - | return nil | |
| 55 | - | } | |
| 52 | + | var cls *MountOperation | |
| 53 | + | ||
| 54 | + | cret := xNewMountOperation() | |
| 56 | 55 | ||
| 57 | - | NewMountOperationCls := &MountOperation{} | |
| 58 | - | NewMountOperationCls.Ptr = NewMountOperationPtr | |
| 59 | - | return NewMountOperationCls | |
| 56 | + | if cret == 0 { | |
| 57 | + | return cls | |
| 58 | + | } | |
| 59 | + | cls = &MountOperation{} | |
| 60 | + | cls.Ptr = cret | |
| 61 | + | return cls | |
| 60 | 62 | } | |
| 61 | 63 | ||
| 62 | 64 | var xMountOperationGetAnonymous func(uintptr) bool | |
| @@ -65,8 +67,8 @@ var xMountOperationGetAnonymous func(uintptr) bool | |||
| 65 | 67 | // for an anonymous user. | |
| 66 | 68 | func (x *MountOperation) GetAnonymous() bool { | |
| 67 | 69 | ||
| 68 | - | return xMountOperationGetAnonymous(x.GoPointer()) | |
| 69 | - | ||
| 70 | + | cret := xMountOperationGetAnonymous(x.GoPointer()) | |
| 71 | + | return cret | |
| 70 | 72 | } | |
| 71 | 73 | ||
| 72 | 74 | var xMountOperationGetChoice func(uintptr) int | |
| @@ -74,8 +76,8 @@ var xMountOperationGetChoice func(uintptr) int | |||
| 74 | 76 | // Gets a choice from the mount operation. | |
| 75 | 77 | func (x *MountOperation) GetChoice() int { | |
| 76 | 78 | ||
| 77 | - | return xMountOperationGetChoice(x.GoPointer()) | |
| 78 | - | ||
| 79 | + | cret := xMountOperationGetChoice(x.GoPointer()) | |
| 80 | + | return cret | |
| 79 | 81 | } | |
| 80 | 82 | ||
| 81 | 83 | var xMountOperationGetDomain func(uintptr) string | |
| @@ -83,8 +85,8 @@ var xMountOperationGetDomain func(uintptr) string | |||
| 83 | 85 | // Gets the domain of the mount operation. | |
| 84 | 86 | func (x *MountOperation) GetDomain() string { | |
| 85 | 87 | ||
| 86 | - | return xMountOperationGetDomain(x.GoPointer()) | |
| 87 | - | ||
| 88 | + | cret := xMountOperationGetDomain(x.GoPointer()) | |
| 89 | + | return cret | |
| 88 | 90 | } | |
| 89 | 91 | ||
| 90 | 92 | var xMountOperationGetIsTcryptHiddenVolume func(uintptr) bool | |
| @@ -93,8 +95,8 @@ var xMountOperationGetIsTcryptHiddenVolume func(uintptr) bool | |||
| 93 | 95 | // for a TCRYPT hidden volume. | |
| 94 | 96 | func (x *MountOperation) GetIsTcryptHiddenVolume() bool { | |
| 95 | 97 | ||
| 96 | - | return xMountOperationGetIsTcryptHiddenVolume(x.GoPointer()) | |
| 97 | - | ||
| 98 | + | cret := xMountOperationGetIsTcryptHiddenVolume(x.GoPointer()) | |
| 99 | + | return cret | |
| 98 | 100 | } | |
| 99 | 101 | ||
| 100 | 102 | var xMountOperationGetIsTcryptSystemVolume func(uintptr) bool | |
| @@ -103,8 +105,8 @@ var xMountOperationGetIsTcryptSystemVolume func(uintptr) bool | |||
| 103 | 105 | // for a TCRYPT system volume. | |
| 104 | 106 | func (x *MountOperation) GetIsTcryptSystemVolume() bool { | |
| 105 | 107 | ||
| 106 | - | return xMountOperationGetIsTcryptSystemVolume(x.GoPointer()) | |
| 107 | - | ||
| 108 | + | cret := xMountOperationGetIsTcryptSystemVolume(x.GoPointer()) | |
| 109 | + | return cret | |
| 108 | 110 | } | |
| 109 | 111 | ||
| 110 | 112 | var xMountOperationGetPassword func(uintptr) string | |
| @@ -112,8 +114,8 @@ var xMountOperationGetPassword func(uintptr) string | |||
| 112 | 114 | // Gets a password from the mount operation. | |
| 113 | 115 | func (x *MountOperation) GetPassword() string { | |
| 114 | 116 | ||
| 115 | - | return xMountOperationGetPassword(x.GoPointer()) | |
| 116 | - | ||
| 117 | + | cret := xMountOperationGetPassword(x.GoPointer()) | |
| 118 | + | return cret | |
| 117 | 119 | } | |
| 118 | 120 | ||
| 119 | 121 | var xMountOperationGetPasswordSave func(uintptr) PasswordSave | |
| @@ -121,8 +123,8 @@ var xMountOperationGetPasswordSave func(uintptr) PasswordSave | |||
| 121 | 123 | // Gets the state of saving passwords for the mount operation. | |
| 122 | 124 | func (x *MountOperation) GetPasswordSave() PasswordSave { | |
| 123 | 125 | ||
| 124 | - | return xMountOperationGetPasswordSave(x.GoPointer()) | |
| 125 | - | ||
| 126 | + | cret := xMountOperationGetPasswordSave(x.GoPointer()) | |
| 127 | + | return cret | |
| 126 | 128 | } | |
| 127 | 129 | ||
| 128 | 130 | var xMountOperationGetPim func(uintptr) uint | |
| @@ -130,8 +132,8 @@ var xMountOperationGetPim func(uintptr) uint | |||
| 130 | 132 | // Gets a PIM from the mount operation. | |
| 131 | 133 | func (x *MountOperation) GetPim() uint { | |
| 132 | 134 | ||
| 133 | - | return xMountOperationGetPim(x.GoPointer()) | |
| 134 | - | ||
| 135 | + | cret := xMountOperationGetPim(x.GoPointer()) | |
| 136 | + | return cret | |
| 135 | 137 | } | |
| 136 | 138 | ||
| 137 | 139 | var xMountOperationGetUsername func(uintptr) string | |
| @@ -139,8 +141,8 @@ var xMountOperationGetUsername func(uintptr) string | |||
| 139 | 141 | // Get the user name from the mount operation. | |
| 140 | 142 | func (x *MountOperation) GetUsername() string { | |
| 141 | 143 | ||
| 142 | - | return xMountOperationGetUsername(x.GoPointer()) | |
| 143 | - | ||
| 144 | + | cret := xMountOperationGetUsername(x.GoPointer()) | |
| 145 | + | return cret | |
| 144 | 146 | } | |
| 145 | 147 | ||
| 146 | 148 | var xMountOperationReply func(uintptr, MountOperationResult) | |
M v4/gio/gnativesocketaddress.go +27 -25
| @@ -28,14 +28,16 @@ var xNewNativeSocketAddress func(uintptr, uint) uintptr | |||
| 28 | 28 | ||
| 29 | 29 | // Creates a new #GNativeSocketAddress for @native and @len. | |
| 30 | 30 | func NewNativeSocketAddress(NativeVar uintptr, LenVar uint) *SocketAddress { | |
| 31 | - | NewNativeSocketAddressPtr := xNewNativeSocketAddress(NativeVar, LenVar) | |
| 32 | - | if NewNativeSocketAddressPtr == 0 { | |
| 33 | - | return nil | |
| 34 | - | } | |
| 31 | + | var cls *SocketAddress | |
| 32 | + | ||
| 33 | + | cret := xNewNativeSocketAddress(NativeVar, LenVar) | |
| 35 | 34 | ||
| 36 | - | NewNativeSocketAddressCls := &SocketAddress{} | |
| 37 | - | NewNativeSocketAddressCls.Ptr = NewNativeSocketAddressPtr | |
| 38 | - | return NewNativeSocketAddressCls | |
| 35 | + | if cret == 0 { | |
| 36 | + | return cls | |
| 37 | + | } | |
| 38 | + | cls = &SocketAddress{} | |
| 39 | + | cls.Ptr = cret | |
| 40 | + | return cls | |
| 39 | 41 | } | |
| 40 | 42 | ||
| 41 | 43 | func (c *NativeSocketAddress) GoPointer() uintptr { | |
| @@ -48,16 +50,16 @@ func (c *NativeSocketAddress) SetGoPointer(ptr uintptr) { | |||
| 48 | 50 | ||
| 49 | 51 | // Creates a #GSocketAddressEnumerator for @connectable. | |
| 50 | 52 | func (x *NativeSocketAddress) Enumerate() *SocketAddressEnumerator { | |
| 53 | + | var cls *SocketAddressEnumerator | |
| 51 | 54 | ||
| 52 | - | EnumeratePtr := XGSocketConnectableEnumerate(x.GoPointer()) | |
| 53 | - | if EnumeratePtr == 0 { | |
| 54 | - | return nil | |
| 55 | - | } | |
| 56 | - | ||
| 57 | - | EnumerateCls := &SocketAddressEnumerator{} | |
| 58 | - | EnumerateCls.Ptr = EnumeratePtr | |
| 59 | - | return EnumerateCls | |
| 55 | + | cret := XGSocketConnectableEnumerate(x.GoPointer()) | |
| 60 | 56 | ||
| 57 | + | if cret == 0 { | |
| 58 | + | return cls | |
| 59 | + | } | |
| 60 | + | cls = &SocketAddressEnumerator{} | |
| 61 | + | cls.Ptr = cret | |
| 62 | + | return cls | |
| 61 | 63 | } | |
| 62 | 64 | ||
| 63 | 65 | // Creates a #GSocketAddressEnumerator for @connectable that will | |
| @@ -68,16 +70,16 @@ func (x *NativeSocketAddress) Enumerate() *SocketAddressEnumerator { | |||
| 68 | 70 | // g_socket_connectable_proxy_enumerate(), this will fall back to | |
| 69 | 71 | // calling g_socket_connectable_enumerate(). | |
| 70 | 72 | func (x *NativeSocketAddress) ProxyEnumerate() *SocketAddressEnumerator { | |
| 73 | + | var cls *SocketAddressEnumerator | |
| 71 | 74 | ||
| 72 | - | ProxyEnumeratePtr := XGSocketConnectableProxyEnumerate(x.GoPointer()) | |
| 73 | - | if ProxyEnumeratePtr == 0 { | |
| 74 | - | return nil | |
| 75 | - | } | |
| 76 | - | ||
| 77 | - | ProxyEnumerateCls := &SocketAddressEnumerator{} | |
| 78 | - | ProxyEnumerateCls.Ptr = ProxyEnumeratePtr | |
| 79 | - | return ProxyEnumerateCls | |
| 75 | + | cret := XGSocketConnectableProxyEnumerate(x.GoPointer()) | |
| 80 | 76 | ||
| 77 | + | if cret == 0 { | |
| 78 | + | return cls | |
| 79 | + | } | |
| 80 | + | cls = &SocketAddressEnumerator{} | |
| 81 | + | cls.Ptr = cret | |
| 82 | + | return cls | |
| 81 | 83 | } | |
| 82 | 84 | ||
| 83 | 85 | // Format a #GSocketConnectable as a string. This is a human-readable format for | |
| @@ -89,8 +91,8 @@ func (x *NativeSocketAddress) ProxyEnumerate() *SocketAddressEnumerator { | |||
| 89 | 91 | // the implementation’s type name will be returned as a fallback. | |
| 90 | 92 | func (x *NativeSocketAddress) ToString() string { | |
| 91 | 93 | ||
| 92 | - | return XGSocketConnectableToString(x.GoPointer()) | |
| 93 | - | ||
| 94 | + | cret := XGSocketConnectableToString(x.GoPointer()) | |
| 95 | + | return cret | |
| 94 | 96 | } | |
| 95 | 97 | ||
| 96 | 98 | func init() { | |
M v4/gio/gnetworkaddress.go +42 -38
| @@ -45,14 +45,16 @@ var xNewNetworkAddress func(string, uint16) uintptr | |||
| 45 | 45 | // g_network_address_new_loopback() to create a #GNetworkAddress that | |
| 46 | 46 | // is guaranteed to resolve to both addresses. | |
| 47 | 47 | func NewNetworkAddress(HostnameVar string, PortVar uint16) *NetworkAddress { | |
| 48 | - | NewNetworkAddressPtr := xNewNetworkAddress(HostnameVar, PortVar) | |
| 49 | - | if NewNetworkAddressPtr == 0 { | |
| 50 | - | return nil | |
| 51 | - | } | |
| 48 | + | var cls *NetworkAddress | |
| 49 | + | ||
| 50 | + | cret := xNewNetworkAddress(HostnameVar, PortVar) | |
| 52 | 51 | ||
| 53 | - | NewNetworkAddressCls := &NetworkAddress{} | |
| 54 | - | NewNetworkAddressCls.Ptr = NewNetworkAddressPtr | |
| 55 | - | return NewNetworkAddressCls | |
| 52 | + | if cret == 0 { | |
| 53 | + | return cls | |
| 54 | + | } | |
| 55 | + | cls = &NetworkAddress{} | |
| 56 | + | cls.Ptr = cret | |
| 57 | + | return cls | |
| 56 | 58 | } | |
| 57 | 59 | ||
| 58 | 60 | var xNewLoopbackNetworkAddress func(uint16) uintptr | |
| @@ -70,14 +72,16 @@ var xNewLoopbackNetworkAddress func(uint16) uintptr | |||
| 70 | 72 | // g_network_address_get_hostname() will always return `localhost` for | |
| 71 | 73 | // a #GNetworkAddress created with this constructor. | |
| 72 | 74 | func NewLoopbackNetworkAddress(PortVar uint16) *NetworkAddress { | |
| 73 | - | NewLoopbackNetworkAddressPtr := xNewLoopbackNetworkAddress(PortVar) | |
| 74 | - | if NewLoopbackNetworkAddressPtr == 0 { | |
| 75 | - | return nil | |
| 76 | - | } | |
| 75 | + | var cls *NetworkAddress | |
| 77 | 76 | ||
| 78 | - | NewLoopbackNetworkAddressCls := &NetworkAddress{} | |
| 79 | - | NewLoopbackNetworkAddressCls.Ptr = NewLoopbackNetworkAddressPtr | |
| 80 | - | return NewLoopbackNetworkAddressCls | |
| 77 | + | cret := xNewLoopbackNetworkAddress(PortVar) | |
| 78 | + | ||
| 79 | + | if cret == 0 { | |
| 80 | + | return cls | |
| 81 | + | } | |
| 82 | + | cls = &NetworkAddress{} | |
| 83 | + | cls.Ptr = cret | |
| 84 | + | return cls | |
| 81 | 85 | } | |
| 82 | 86 | ||
| 83 | 87 | var xNetworkAddressGetHostname func(uintptr) string | |
| @@ -86,8 +90,8 @@ var xNetworkAddressGetHostname func(uintptr) string | |||
| 86 | 90 | // depending on what @addr was created with. | |
| 87 | 91 | func (x *NetworkAddress) GetHostname() string { | |
| 88 | 92 | ||
| 89 | - | return xNetworkAddressGetHostname(x.GoPointer()) | |
| 90 | - | ||
| 93 | + | cret := xNetworkAddressGetHostname(x.GoPointer()) | |
| 94 | + | return cret | |
| 91 | 95 | } | |
| 92 | 96 | ||
| 93 | 97 | var xNetworkAddressGetPort func(uintptr) uint16 | |
| @@ -95,8 +99,8 @@ var xNetworkAddressGetPort func(uintptr) uint16 | |||
| 95 | 99 | // Gets @addr's port number | |
| 96 | 100 | func (x *NetworkAddress) GetPort() uint16 { | |
| 97 | 101 | ||
| 98 | - | return xNetworkAddressGetPort(x.GoPointer()) | |
| 99 | - | ||
| 102 | + | cret := xNetworkAddressGetPort(x.GoPointer()) | |
| 103 | + | return cret | |
| 100 | 104 | } | |
| 101 | 105 | ||
| 102 | 106 | var xNetworkAddressGetScheme func(uintptr) string | |
| @@ -104,8 +108,8 @@ var xNetworkAddressGetScheme func(uintptr) string | |||
| 104 | 108 | // Gets @addr's scheme | |
| 105 | 109 | func (x *NetworkAddress) GetScheme() string { | |
| 106 | 110 | ||
| 107 | - | return xNetworkAddressGetScheme(x.GoPointer()) | |
| 108 | - | ||
| 111 | + | cret := xNetworkAddressGetScheme(x.GoPointer()) | |
| 112 | + | return cret | |
| 109 | 113 | } | |
| 110 | 114 | ||
| 111 | 115 | func (c *NetworkAddress) GoPointer() uintptr { | |
| @@ -118,16 +122,16 @@ func (c *NetworkAddress) SetGoPointer(ptr uintptr) { | |||
| 118 | 122 | ||
| 119 | 123 | // Creates a #GSocketAddressEnumerator for @connectable. | |
| 120 | 124 | func (x *NetworkAddress) Enumerate() *SocketAddressEnumerator { | |
| 125 | + | var cls *SocketAddressEnumerator | |
| 121 | 126 | ||
| 122 | - | EnumeratePtr := XGSocketConnectableEnumerate(x.GoPointer()) | |
| 123 | - | if EnumeratePtr == 0 { | |
| 124 | - | return nil | |
| 125 | - | } | |
| 126 | - | ||
| 127 | - | EnumerateCls := &SocketAddressEnumerator{} | |
| 128 | - | EnumerateCls.Ptr = EnumeratePtr | |
| 129 | - | return EnumerateCls | |
| 127 | + | cret := XGSocketConnectableEnumerate(x.GoPointer()) | |
| 130 | 128 | ||
| 129 | + | if cret == 0 { | |
| 130 | + | return cls | |
| 131 | + | } | |
| 132 | + | cls = &SocketAddressEnumerator{} | |
| 133 | + | cls.Ptr = cret | |
| 134 | + | return cls | |
| 131 | 135 | } | |
| 132 | 136 | ||
| 133 | 137 | // Creates a #GSocketAddressEnumerator for @connectable that will | |
| @@ -138,16 +142,16 @@ func (x *NetworkAddress) Enumerate() *SocketAddressEnumerator { | |||
| 138 | 142 | // g_socket_connectable_proxy_enumerate(), this will fall back to | |
| 139 | 143 | // calling g_socket_connectable_enumerate(). | |
| 140 | 144 | func (x *NetworkAddress) ProxyEnumerate() *SocketAddressEnumerator { | |
| 145 | + | var cls *SocketAddressEnumerator | |
| 141 | 146 | ||
| 142 | - | ProxyEnumeratePtr := XGSocketConnectableProxyEnumerate(x.GoPointer()) | |
| 143 | - | if ProxyEnumeratePtr == 0 { | |
| 144 | - | return nil | |
| 145 | - | } | |
| 146 | - | ||
| 147 | - | ProxyEnumerateCls := &SocketAddressEnumerator{} | |
| 148 | - | ProxyEnumerateCls.Ptr = ProxyEnumeratePtr | |
| 149 | - | return ProxyEnumerateCls | |
| 147 | + | cret := XGSocketConnectableProxyEnumerate(x.GoPointer()) | |
| 150 | 148 | ||
| 149 | + | if cret == 0 { | |
| 150 | + | return cls | |
| 151 | + | } | |
| 152 | + | cls = &SocketAddressEnumerator{} | |
| 153 | + | cls.Ptr = cret | |
| 154 | + | return cls | |
| 151 | 155 | } | |
| 152 | 156 | ||
| 153 | 157 | // Format a #GSocketConnectable as a string. This is a human-readable format for | |
| @@ -159,8 +163,8 @@ func (x *NetworkAddress) ProxyEnumerate() *SocketAddressEnumerator { | |||
| 159 | 163 | // the implementation’s type name will be returned as a fallback. | |
| 160 | 164 | func (x *NetworkAddress) ToString() string { | |
| 161 | 165 | ||
| 162 | - | return XGSocketConnectableToString(x.GoPointer()) | |
| 163 | - | ||
| 166 | + | cret := XGSocketConnectableToString(x.GoPointer()) | |
| 167 | + | return cret | |
| 164 | 168 | } | |
| 165 | 169 | ||
| 166 | 170 | func init() { | |
M v4/gio/gnetworkmonitor.go +32 -22
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -57,9 +58,14 @@ func (x *NetworkMonitorBase) SetGoPointer(ptr uintptr) { | |||
| 57 | 58 | // @connectable, it may still block for a brief period of time (eg, | |
| 58 | 59 | // trying to do multicast DNS on the local network), so if you do not | |
| 59 | 60 | // want to block, you should use g_network_monitor_can_reach_async(). | |
| 60 | - | func (x *NetworkMonitorBase) CanReach(ConnectableVar SocketConnectable, CancellableVar *Cancellable) bool { | |
| 61 | + | func (x *NetworkMonitorBase) CanReach(ConnectableVar SocketConnectable, CancellableVar *Cancellable) (bool, error) { | |
| 62 | + | var cerr *glib.Error | |
| 61 | 63 | ||
| 62 | - | return XGNetworkMonitorCanReach(x.GoPointer(), ConnectableVar.GoPointer(), CancellableVar.GoPointer()) | |
| 64 | + | cret := XGNetworkMonitorCanReach(x.GoPointer(), ConnectableVar.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 65 | + | if cerr == nil { | |
| 66 | + | return cret, nil | |
| 67 | + | } | |
| 68 | + | return cret, cerr | |
| 63 | 69 | ||
| 64 | 70 | } | |
| 65 | 71 | ||
| @@ -80,9 +86,14 @@ func (x *NetworkMonitorBase) CanReachAsync(ConnectableVar SocketConnectable, Can | |||
| 80 | 86 | ||
| 81 | 87 | // Finishes an async network connectivity test. | |
| 82 | 88 | // See g_network_monitor_can_reach_async(). | |
| 83 | - | func (x *NetworkMonitorBase) CanReachFinish(ResultVar AsyncResult) bool { | |
| 89 | + | func (x *NetworkMonitorBase) CanReachFinish(ResultVar AsyncResult) (bool, error) { | |
| 90 | + | var cerr *glib.Error | |
| 84 | 91 | ||
| 85 | - | return XGNetworkMonitorCanReachFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 92 | + | cret := XGNetworkMonitorCanReachFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 93 | + | if cerr == nil { | |
| 94 | + | return cret, nil | |
| 95 | + | } | |
| 96 | + | return cret, cerr | |
| 86 | 97 | ||
| 87 | 98 | } | |
| 88 | 99 | ||
| @@ -107,8 +118,8 @@ func (x *NetworkMonitorBase) CanReachFinish(ResultVar AsyncResult) bool { | |||
| 107 | 118 | // back to their "offline" behavior if the connection attempt fails. | |
| 108 | 119 | func (x *NetworkMonitorBase) GetConnectivity() NetworkConnectivity { | |
| 109 | 120 | ||
| 110 | - | return XGNetworkMonitorGetConnectivity(x.GoPointer()) | |
| 111 | - | ||
| 121 | + | cret := XGNetworkMonitorGetConnectivity(x.GoPointer()) | |
| 122 | + | return cret | |
| 112 | 123 | } | |
| 113 | 124 | ||
| 114 | 125 | // Checks if the network is available. "Available" here means that the | |
| @@ -117,21 +128,21 @@ func (x *NetworkMonitorBase) GetConnectivity() NetworkConnectivity { | |||
| 117 | 128 | // reachable. See #GNetworkMonitor:network-available for more details. | |
| 118 | 129 | func (x *NetworkMonitorBase) GetNetworkAvailable() bool { | |
| 119 | 130 | ||
| 120 | - | return XGNetworkMonitorGetNetworkAvailable(x.GoPointer()) | |
| 121 | - | ||
| 131 | + | cret := XGNetworkMonitorGetNetworkAvailable(x.GoPointer()) | |
| 132 | + | return cret | |
| 122 | 133 | } | |
| 123 | 134 | ||
| 124 | 135 | // Checks if the network is metered. | |
| 125 | 136 | // See #GNetworkMonitor:network-metered for more details. | |
| 126 | 137 | func (x *NetworkMonitorBase) GetNetworkMetered() bool { | |
| 127 | 138 | ||
| 128 | - | return XGNetworkMonitorGetNetworkMetered(x.GoPointer()) | |
| 129 | - | ||
| 139 | + | cret := XGNetworkMonitorGetNetworkMetered(x.GoPointer()) | |
| 140 | + | return cret | |
| 130 | 141 | } | |
| 131 | 142 | ||
| 132 | - | var XGNetworkMonitorCanReach func(uintptr, uintptr, uintptr) bool | |
| 143 | + | var XGNetworkMonitorCanReach func(uintptr, uintptr, uintptr, **glib.Error) bool | |
| 133 | 144 | var XGNetworkMonitorCanReachAsync func(uintptr, uintptr, uintptr, uintptr, uintptr) | |
| 134 | - | var XGNetworkMonitorCanReachFinish func(uintptr, uintptr) bool | |
| 145 | + | var XGNetworkMonitorCanReachFinish func(uintptr, uintptr, **glib.Error) bool | |
| 135 | 146 | var XGNetworkMonitorGetConnectivity func(uintptr) NetworkConnectivity | |
| 136 | 147 | var XGNetworkMonitorGetNetworkAvailable func(uintptr) bool | |
| 137 | 148 | var XGNetworkMonitorGetNetworkMetered func(uintptr) bool | |
| @@ -140,18 +151,17 @@ var xNetworkMonitorGetDefault func() uintptr | |||
| 140 | 151 | ||
| 141 | 152 | // Gets the default #GNetworkMonitor for the system. | |
| 142 | 153 | func NetworkMonitorGetDefault() *NetworkMonitorBase { | |
| 154 | + | var cls *NetworkMonitorBase | |
| 143 | 155 | ||
| 144 | - | NetworkMonitorGetDefaultPtr := xNetworkMonitorGetDefault() | |
| 145 | - | if NetworkMonitorGetDefaultPtr == 0 { | |
| 146 | - | return nil | |
| 147 | - | } | |
| 148 | - | ||
| 149 | - | gobject.IncreaseRef(NetworkMonitorGetDefaultPtr) | |
| 150 | - | ||
| 151 | - | NetworkMonitorGetDefaultCls := &NetworkMonitorBase{} | |
| 152 | - | NetworkMonitorGetDefaultCls.Ptr = NetworkMonitorGetDefaultPtr | |
| 153 | - | return NetworkMonitorGetDefaultCls | |
| 156 | + | cret := xNetworkMonitorGetDefault() | |
| 154 | 157 | ||
| 158 | + | if cret == 0 { | |
| 159 | + | return cls | |
| 160 | + | } | |
| 161 | + | gobject.IncreaseRef(cret) | |
| 162 | + | cls = &NetworkMonitorBase{} | |
| 163 | + | cls.Ptr = cret | |
| 164 | + | return cls | |
| 155 | 165 | } | |
| 156 | 166 | ||
| 157 | 167 | func init() { | |
M v4/gio/gnetworkservice.go +35 -33
| @@ -39,14 +39,16 @@ var xNewNetworkService func(string, string, string) uintptr | |||
| 39 | 39 | // @protocol, and @domain. This will initially be unresolved; use the | |
| 40 | 40 | // #GSocketConnectable interface to resolve it. | |
| 41 | 41 | func NewNetworkService(ServiceVar string, ProtocolVar string, DomainVar string) *NetworkService { | |
| 42 | - | NewNetworkServicePtr := xNewNetworkService(ServiceVar, ProtocolVar, DomainVar) | |
| 43 | - | if NewNetworkServicePtr == 0 { | |
| 44 | - | return nil | |
| 45 | - | } | |
| 42 | + | var cls *NetworkService | |
| 43 | + | ||
| 44 | + | cret := xNewNetworkService(ServiceVar, ProtocolVar, DomainVar) | |
| 46 | 45 | ||
| 47 | - | NewNetworkServiceCls := &NetworkService{} | |
| 48 | - | NewNetworkServiceCls.Ptr = NewNetworkServicePtr | |
| 49 | - | return NewNetworkServiceCls | |
| 46 | + | if cret == 0 { | |
| 47 | + | return cls | |
| 48 | + | } | |
| 49 | + | cls = &NetworkService{} | |
| 50 | + | cls.Ptr = cret | |
| 51 | + | return cls | |
| 50 | 52 | } | |
| 51 | 53 | ||
| 52 | 54 | var xNetworkServiceGetDomain func(uintptr) string | |
| @@ -55,8 +57,8 @@ var xNetworkServiceGetDomain func(uintptr) string | |||
| 55 | 57 | // ASCII-encoded, depending on what @srv was created with. | |
| 56 | 58 | func (x *NetworkService) GetDomain() string { | |
| 57 | 59 | ||
| 58 | - | return xNetworkServiceGetDomain(x.GoPointer()) | |
| 59 | - | ||
| 60 | + | cret := xNetworkServiceGetDomain(x.GoPointer()) | |
| 61 | + | return cret | |
| 60 | 62 | } | |
| 61 | 63 | ||
| 62 | 64 | var xNetworkServiceGetProtocol func(uintptr) string | |
| @@ -64,8 +66,8 @@ var xNetworkServiceGetProtocol func(uintptr) string | |||
| 64 | 66 | // Gets @srv's protocol name (eg, "tcp"). | |
| 65 | 67 | func (x *NetworkService) GetProtocol() string { | |
| 66 | 68 | ||
| 67 | - | return xNetworkServiceGetProtocol(x.GoPointer()) | |
| 68 | - | ||
| 69 | + | cret := xNetworkServiceGetProtocol(x.GoPointer()) | |
| 70 | + | return cret | |
| 69 | 71 | } | |
| 70 | 72 | ||
| 71 | 73 | var xNetworkServiceGetScheme func(uintptr) string | |
| @@ -74,8 +76,8 @@ var xNetworkServiceGetScheme func(uintptr) string | |||
| 74 | 76 | // is used as scheme. | |
| 75 | 77 | func (x *NetworkService) GetScheme() string { | |
| 76 | 78 | ||
| 77 | - | return xNetworkServiceGetScheme(x.GoPointer()) | |
| 78 | - | ||
| 79 | + | cret := xNetworkServiceGetScheme(x.GoPointer()) | |
| 80 | + | return cret | |
| 79 | 81 | } | |
| 80 | 82 | ||
| 81 | 83 | var xNetworkServiceGetService func(uintptr) string | |
| @@ -83,8 +85,8 @@ var xNetworkServiceGetService func(uintptr) string | |||
| 83 | 85 | // Gets @srv's service name (eg, "ldap"). | |
| 84 | 86 | func (x *NetworkService) GetService() string { | |
| 85 | 87 | ||
| 86 | - | return xNetworkServiceGetService(x.GoPointer()) | |
| 87 | - | ||
| 88 | + | cret := xNetworkServiceGetService(x.GoPointer()) | |
| 89 | + | return cret | |
| 88 | 90 | } | |
| 89 | 91 | ||
| 90 | 92 | var xNetworkServiceSetScheme func(uintptr, string) | |
| @@ -107,16 +109,16 @@ func (c *NetworkService) SetGoPointer(ptr uintptr) { | |||
| 107 | 109 | ||
| 108 | 110 | // Creates a #GSocketAddressEnumerator for @connectable. | |
| 109 | 111 | func (x *NetworkService) Enumerate() *SocketAddressEnumerator { | |
| 112 | + | var cls *SocketAddressEnumerator | |
| 110 | 113 | ||
| 111 | - | EnumeratePtr := XGSocketConnectableEnumerate(x.GoPointer()) | |
| 112 | - | if EnumeratePtr == 0 { | |
| 113 | - | return nil | |
| 114 | - | } | |
| 115 | - | ||
| 116 | - | EnumerateCls := &SocketAddressEnumerator{} | |
| 117 | - | EnumerateCls.Ptr = EnumeratePtr | |
| 118 | - | return EnumerateCls | |
| 114 | + | cret := XGSocketConnectableEnumerate(x.GoPointer()) | |
| 119 | 115 | ||
| 116 | + | if cret == 0 { | |
| 117 | + | return cls | |
| 118 | + | } | |
| 119 | + | cls = &SocketAddressEnumerator{} | |
| 120 | + | cls.Ptr = cret | |
| 121 | + | return cls | |
| 120 | 122 | } | |
| 121 | 123 | ||
| 122 | 124 | // Creates a #GSocketAddressEnumerator for @connectable that will | |
| @@ -127,16 +129,16 @@ func (x *NetworkService) Enumerate() *SocketAddressEnumerator { | |||
| 127 | 129 | // g_socket_connectable_proxy_enumerate(), this will fall back to | |
| 128 | 130 | // calling g_socket_connectable_enumerate(). | |
| 129 | 131 | func (x *NetworkService) ProxyEnumerate() *SocketAddressEnumerator { | |
| 132 | + | var cls *SocketAddressEnumerator | |
| 130 | 133 | ||
| 131 | - | ProxyEnumeratePtr := XGSocketConnectableProxyEnumerate(x.GoPointer()) | |
| 132 | - | if ProxyEnumeratePtr == 0 { | |
| 133 | - | return nil | |
| 134 | - | } | |
| 135 | - | ||
| 136 | - | ProxyEnumerateCls := &SocketAddressEnumerator{} | |
| 137 | - | ProxyEnumerateCls.Ptr = ProxyEnumeratePtr | |
| 138 | - | return ProxyEnumerateCls | |
| 134 | + | cret := XGSocketConnectableProxyEnumerate(x.GoPointer()) | |
| 139 | 135 | ||
| 136 | + | if cret == 0 { | |
| 137 | + | return cls | |
| 138 | + | } | |
| 139 | + | cls = &SocketAddressEnumerator{} | |
| 140 | + | cls.Ptr = cret | |
| 141 | + | return cls | |
| 140 | 142 | } | |
| 141 | 143 | ||
| 142 | 144 | // Format a #GSocketConnectable as a string. This is a human-readable format for | |
| @@ -148,8 +150,8 @@ func (x *NetworkService) ProxyEnumerate() *SocketAddressEnumerator { | |||
| 148 | 150 | // the implementation’s type name will be returned as a fallback. | |
| 149 | 151 | func (x *NetworkService) ToString() string { | |
| 150 | 152 | ||
| 151 | - | return XGSocketConnectableToString(x.GoPointer()) | |
| 152 | - | ||
| 153 | + | cret := XGSocketConnectableToString(x.GoPointer()) | |
| 154 | + | return cret | |
| 153 | 155 | } | |
| 154 | 156 | ||
| 155 | 157 | func init() { | |
M v4/gio/goutputstream.go +145 -60
| @@ -45,7 +45,7 @@ func (x *OutputStream) ClearPending() { | |||
| 45 | 45 | ||
| 46 | 46 | } | |
| 47 | 47 | ||
| 48 | - | var xOutputStreamClose func(uintptr, uintptr) bool | |
| 48 | + | var xOutputStreamClose func(uintptr, uintptr, **glib.Error) bool | |
| 49 | 49 | ||
| 50 | 50 | // Closes the stream, releasing resources related to it. | |
| 51 | 51 | // | |
| @@ -76,9 +76,14 @@ var xOutputStreamClose func(uintptr, uintptr) bool | |||
| 76 | 76 | // can use a faster close that doesn't block to e.g. check errors. On | |
| 77 | 77 | // cancellation (as with any error) there is no guarantee that all written | |
| 78 | 78 | // data will reach the target. | |
| 79 | - | func (x *OutputStream) Close(CancellableVar *Cancellable) bool { | |
| 79 | + | func (x *OutputStream) Close(CancellableVar *Cancellable) (bool, error) { | |
| 80 | + | var cerr *glib.Error | |
| 80 | 81 | ||
| 81 | - | return xOutputStreamClose(x.GoPointer(), CancellableVar.GoPointer()) | |
| 82 | + | cret := xOutputStreamClose(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 83 | + | if cerr == nil { | |
| 84 | + | return cret, nil | |
| 85 | + | } | |
| 86 | + | return cret, cerr | |
| 82 | 87 | ||
| 83 | 88 | } | |
| 84 | 89 | ||
| @@ -100,16 +105,21 @@ func (x *OutputStream) CloseAsync(IoPriorityVar int, CancellableVar *Cancellable | |||
| 100 | 105 | ||
| 101 | 106 | } | |
| 102 | 107 | ||
| 103 | - | var xOutputStreamCloseFinish func(uintptr, uintptr) bool | |
| 108 | + | var xOutputStreamCloseFinish func(uintptr, uintptr, **glib.Error) bool | |
| 104 | 109 | ||
| 105 | 110 | // Closes an output stream. | |
| 106 | - | func (x *OutputStream) CloseFinish(ResultVar AsyncResult) bool { | |
| 111 | + | func (x *OutputStream) CloseFinish(ResultVar AsyncResult) (bool, error) { | |
| 112 | + | var cerr *glib.Error | |
| 107 | 113 | ||
| 108 | - | return xOutputStreamCloseFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 114 | + | cret := xOutputStreamCloseFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 115 | + | if cerr == nil { | |
| 116 | + | return cret, nil | |
| 117 | + | } | |
| 118 | + | return cret, cerr | |
| 109 | 119 | ||
| 110 | 120 | } | |
| 111 | 121 | ||
| 112 | - | var xOutputStreamFlush func(uintptr, uintptr) bool | |
| 122 | + | var xOutputStreamFlush func(uintptr, uintptr, **glib.Error) bool | |
| 113 | 123 | ||
| 114 | 124 | // Forces a write of all user-space buffered data for the given | |
| 115 | 125 | // @stream. Will block during the operation. Closing the stream will | |
| @@ -120,9 +130,14 @@ var xOutputStreamFlush func(uintptr, uintptr) bool | |||
| 120 | 130 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 121 | 131 | // triggering the cancellable object from another thread. If the operation | |
| 122 | 132 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 123 | - | func (x *OutputStream) Flush(CancellableVar *Cancellable) bool { | |
| 133 | + | func (x *OutputStream) Flush(CancellableVar *Cancellable) (bool, error) { | |
| 134 | + | var cerr *glib.Error | |
| 124 | 135 | ||
| 125 | - | return xOutputStreamFlush(x.GoPointer(), CancellableVar.GoPointer()) | |
| 136 | + | cret := xOutputStreamFlush(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 137 | + | if cerr == nil { | |
| 138 | + | return cret, nil | |
| 139 | + | } | |
| 140 | + | return cret, cerr | |
| 126 | 141 | ||
| 127 | 142 | } | |
| 128 | 143 | ||
| @@ -141,12 +156,17 @@ func (x *OutputStream) FlushAsync(IoPriorityVar int, CancellableVar *Cancellable | |||
| 141 | 156 | ||
| 142 | 157 | } | |
| 143 | 158 | ||
| 144 | - | var xOutputStreamFlushFinish func(uintptr, uintptr) bool | |
| 159 | + | var xOutputStreamFlushFinish func(uintptr, uintptr, **glib.Error) bool | |
| 145 | 160 | ||
| 146 | 161 | // Finishes flushing an output stream. | |
| 147 | - | func (x *OutputStream) FlushFinish(ResultVar AsyncResult) bool { | |
| 162 | + | func (x *OutputStream) FlushFinish(ResultVar AsyncResult) (bool, error) { | |
| 163 | + | var cerr *glib.Error | |
| 148 | 164 | ||
| 149 | - | return xOutputStreamFlushFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 165 | + | cret := xOutputStreamFlushFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 166 | + | if cerr == nil { | |
| 167 | + | return cret, nil | |
| 168 | + | } | |
| 169 | + | return cret, cerr | |
| 150 | 170 | ||
| 151 | 171 | } | |
| 152 | 172 | ||
| @@ -155,8 +175,8 @@ var xOutputStreamHasPending func(uintptr) bool | |||
| 155 | 175 | // Checks if an output stream has pending actions. | |
| 156 | 176 | func (x *OutputStream) HasPending() bool { | |
| 157 | 177 | ||
| 158 | - | return xOutputStreamHasPending(x.GoPointer()) | |
| 159 | - | ||
| 178 | + | cret := xOutputStreamHasPending(x.GoPointer()) | |
| 179 | + | return cret | |
| 160 | 180 | } | |
| 161 | 181 | ||
| 162 | 182 | var xOutputStreamIsClosed func(uintptr) bool | |
| @@ -164,8 +184,8 @@ var xOutputStreamIsClosed func(uintptr) bool | |||
| 164 | 184 | // Checks if an output stream has already been closed. | |
| 165 | 185 | func (x *OutputStream) IsClosed() bool { | |
| 166 | 186 | ||
| 167 | - | return xOutputStreamIsClosed(x.GoPointer()) | |
| 168 | - | ||
| 187 | + | cret := xOutputStreamIsClosed(x.GoPointer()) | |
| 188 | + | return cret | |
| 169 | 189 | } | |
| 170 | 190 | ||
| 171 | 191 | var xOutputStreamIsClosing func(uintptr) bool | |
| @@ -176,8 +196,8 @@ var xOutputStreamIsClosing func(uintptr) bool | |||
| 176 | 196 | // the closing operation. | |
| 177 | 197 | func (x *OutputStream) IsClosing() bool { | |
| 178 | 198 | ||
| 179 | - | return xOutputStreamIsClosing(x.GoPointer()) | |
| 180 | - | ||
| 199 | + | cret := xOutputStreamIsClosing(x.GoPointer()) | |
| 200 | + | return cret | |
| 181 | 201 | } | |
| 182 | 202 | ||
| 183 | 203 | var xOutputStreamPrintf func(uintptr, uint, uintptr, **glib.Error, string, ...interface{}) bool | |
| @@ -196,8 +216,8 @@ var xOutputStreamPrintf func(uintptr, uint, uintptr, **glib.Error, string, ...in | |||
| 196 | 216 | // or g_output_stream_write_all(). | |
| 197 | 217 | func (x *OutputStream) Printf(BytesWrittenVar uint, CancellableVar *Cancellable, ErrorVar **glib.Error, FormatVar string, varArgs ...interface{}) bool { | |
| 198 | 218 | ||
| 199 | - | return xOutputStreamPrintf(x.GoPointer(), BytesWrittenVar, CancellableVar.GoPointer(), ErrorVar, FormatVar, varArgs...) | |
| 200 | - | ||
| 219 | + | cret := xOutputStreamPrintf(x.GoPointer(), BytesWrittenVar, CancellableVar.GoPointer(), ErrorVar, FormatVar, varArgs...) | |
| 220 | + | return cret | |
| 201 | 221 | } | |
| 202 | 222 | ||
| 203 | 223 | var xOutputStreamSetPending func(uintptr) bool | |
| @@ -205,18 +225,28 @@ var xOutputStreamSetPending func(uintptr) bool | |||
| 205 | 225 | // Sets @stream to have actions pending. If the pending flag is | |
| 206 | 226 | // already set or @stream is closed, it will return %FALSE and set | |
| 207 | 227 | // @error. | |
| 208 | - | func (x *OutputStream) SetPending() bool { | |
| 228 | + | func (x *OutputStream) SetPending() (bool, error) { | |
| 229 | + | var cerr *glib.Error | |
| 209 | 230 | ||
| 210 | - | return xOutputStreamSetPending(x.GoPointer()) | |
| 231 | + | cret := xOutputStreamSetPending(x.GoPointer()) | |
| 232 | + | if cerr == nil { | |
| 233 | + | return cret, nil | |
| 234 | + | } | |
| 235 | + | return cret, cerr | |
| 211 | 236 | ||
| 212 | 237 | } | |
| 213 | 238 | ||
| 214 | - | var xOutputStreamSplice func(uintptr, uintptr, OutputStreamSpliceFlags, uintptr) int | |
| 239 | + | var xOutputStreamSplice func(uintptr, uintptr, OutputStreamSpliceFlags, uintptr, **glib.Error) int | |
| 215 | 240 | ||
| 216 | 241 | // Splices an input stream into an output stream. | |
| 217 | - | func (x *OutputStream) Splice(SourceVar *InputStream, FlagsVar OutputStreamSpliceFlags, CancellableVar *Cancellable) int { | |
| 242 | + | func (x *OutputStream) Splice(SourceVar *InputStream, FlagsVar OutputStreamSpliceFlags, CancellableVar *Cancellable) (int, error) { | |
| 243 | + | var cerr *glib.Error | |
| 218 | 244 | ||
| 219 | - | return xOutputStreamSplice(x.GoPointer(), SourceVar.GoPointer(), FlagsVar, CancellableVar.GoPointer()) | |
| 245 | + | cret := xOutputStreamSplice(x.GoPointer(), SourceVar.GoPointer(), FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 246 | + | if cerr == nil { | |
| 247 | + | return cret, nil | |
| 248 | + | } | |
| 249 | + | return cret, cerr | |
| 220 | 250 | ||
| 221 | 251 | } | |
| 222 | 252 | ||
| @@ -235,12 +265,17 @@ func (x *OutputStream) SpliceAsync(SourceVar *InputStream, FlagsVar OutputStream | |||
| 235 | 265 | ||
| 236 | 266 | } | |
| 237 | 267 | ||
| 238 | - | var xOutputStreamSpliceFinish func(uintptr, uintptr) int | |
| 268 | + | var xOutputStreamSpliceFinish func(uintptr, uintptr, **glib.Error) int | |
| 239 | 269 | ||
| 240 | 270 | // Finishes an asynchronous stream splice operation. | |
| 241 | - | func (x *OutputStream) SpliceFinish(ResultVar AsyncResult) int { | |
| 271 | + | func (x *OutputStream) SpliceFinish(ResultVar AsyncResult) (int, error) { | |
| 272 | + | var cerr *glib.Error | |
| 242 | 273 | ||
| 243 | - | return xOutputStreamSpliceFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 274 | + | cret := xOutputStreamSpliceFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 275 | + | if cerr == nil { | |
| 276 | + | return cret, nil | |
| 277 | + | } | |
| 278 | + | return cret, cerr | |
| 244 | 279 | ||
| 245 | 280 | } | |
| 246 | 281 | ||
| @@ -260,11 +295,11 @@ var xOutputStreamVprintf func(uintptr, uint, uintptr, **glib.Error, string, []in | |||
| 260 | 295 | // or g_output_stream_write_all(). | |
| 261 | 296 | func (x *OutputStream) Vprintf(BytesWrittenVar uint, CancellableVar *Cancellable, ErrorVar **glib.Error, FormatVar string, ArgsVar []interface{}) bool { | |
| 262 | 297 | ||
| 263 | - | return xOutputStreamVprintf(x.GoPointer(), BytesWrittenVar, CancellableVar.GoPointer(), ErrorVar, FormatVar, ArgsVar) | |
| 264 | - | ||
| 298 | + | cret := xOutputStreamVprintf(x.GoPointer(), BytesWrittenVar, CancellableVar.GoPointer(), ErrorVar, FormatVar, ArgsVar) | |
| 299 | + | return cret | |
| 265 | 300 | } | |
| 266 | 301 | ||
| 267 | - | var xOutputStreamWrite func(uintptr, uintptr, uint, uintptr) int | |
| 302 | + | var xOutputStreamWrite func(uintptr, uintptr, uint, uintptr, **glib.Error) int | |
| 268 | 303 | ||
| 269 | 304 | // Tries to write @count bytes from @buffer into the stream. Will block | |
| 270 | 305 | // during the operation. | |
| @@ -286,13 +321,18 @@ var xOutputStreamWrite func(uintptr, uintptr, uint, uintptr) int | |||
| 286 | 321 | // partial result will be returned, without an error. | |
| 287 | 322 | // | |
| 288 | 323 | // On error -1 is returned and @error is set accordingly. | |
| 289 | - | func (x *OutputStream) Write(BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) int { | |
| 324 | + | func (x *OutputStream) Write(BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) (int, error) { | |
| 325 | + | var cerr *glib.Error | |
| 290 | 326 | ||
| 291 | - | return xOutputStreamWrite(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer()) | |
| 327 | + | cret := xOutputStreamWrite(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer(), &cerr) | |
| 328 | + | if cerr == nil { | |
| 329 | + | return cret, nil | |
| 330 | + | } | |
| 331 | + | return cret, cerr | |
| 292 | 332 | ||
| 293 | 333 | } | |
| 294 | 334 | ||
| 295 | - | var xOutputStreamWriteAll func(uintptr, uintptr, uint, uint, uintptr) bool | |
| 335 | + | var xOutputStreamWriteAll func(uintptr, uintptr, uint, uint, uintptr, **glib.Error) bool | |
| 296 | 336 | ||
| 297 | 337 | // Tries to write @count bytes from @buffer into the stream. Will block | |
| 298 | 338 | // during the operation. | |
| @@ -313,9 +353,14 @@ var xOutputStreamWriteAll func(uintptr, uintptr, uint, uint, uintptr) bool | |||
| 313 | 353 | // functionality is only available from C. If you need it from another | |
| 314 | 354 | // language then you must write your own loop around | |
| 315 | 355 | // g_output_stream_write(). | |
| 316 | - | func (x *OutputStream) WriteAll(BufferVar uintptr, CountVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) bool { | |
| 356 | + | func (x *OutputStream) WriteAll(BufferVar uintptr, CountVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) (bool, error) { | |
| 357 | + | var cerr *glib.Error | |
| 317 | 358 | ||
| 318 | - | return xOutputStreamWriteAll(x.GoPointer(), BufferVar, CountVar, BytesWrittenVar, CancellableVar.GoPointer()) | |
| 359 | + | cret := xOutputStreamWriteAll(x.GoPointer(), BufferVar, CountVar, BytesWrittenVar, CancellableVar.GoPointer(), &cerr) | |
| 360 | + | if cerr == nil { | |
| 361 | + | return cret, nil | |
| 362 | + | } | |
| 363 | + | return cret, cerr | |
| 319 | 364 | ||
| 320 | 365 | } | |
| 321 | 366 | ||
| @@ -342,7 +387,7 @@ func (x *OutputStream) WriteAllAsync(BufferVar uintptr, CountVar uint, IoPriorit | |||
| 342 | 387 | ||
| 343 | 388 | } | |
| 344 | 389 | ||
| 345 | - | var xOutputStreamWriteAllFinish func(uintptr, uintptr, uint) bool | |
| 390 | + | var xOutputStreamWriteAllFinish func(uintptr, uintptr, uint, **glib.Error) bool | |
| 346 | 391 | ||
| 347 | 392 | // Finishes an asynchronous stream write operation started with | |
| 348 | 393 | // g_output_stream_write_all_async(). | |
| @@ -354,9 +399,14 @@ var xOutputStreamWriteAllFinish func(uintptr, uintptr, uint) bool | |||
| 354 | 399 | // functionality is only available from C. If you need it from another | |
| 355 | 400 | // language then you must write your own loop around | |
| 356 | 401 | // g_output_stream_write_async(). | |
| 357 | - | func (x *OutputStream) WriteAllFinish(ResultVar AsyncResult, BytesWrittenVar uint) bool { | |
| 402 | + | func (x *OutputStream) WriteAllFinish(ResultVar AsyncResult, BytesWrittenVar uint) (bool, error) { | |
| 403 | + | var cerr *glib.Error | |
| 358 | 404 | ||
| 359 | - | return xOutputStreamWriteAllFinish(x.GoPointer(), ResultVar.GoPointer(), BytesWrittenVar) | |
| 405 | + | cret := xOutputStreamWriteAllFinish(x.GoPointer(), ResultVar.GoPointer(), BytesWrittenVar, &cerr) | |
| 406 | + | if cerr == nil { | |
| 407 | + | return cret, nil | |
| 408 | + | } | |
| 409 | + | return cret, cerr | |
| 360 | 410 | ||
| 361 | 411 | } | |
| 362 | 412 | ||
| @@ -403,7 +453,7 @@ func (x *OutputStream) WriteAsync(BufferVar uintptr, CountVar uint, IoPriorityVa | |||
| 403 | 453 | ||
| 404 | 454 | } | |
| 405 | 455 | ||
| 406 | - | var xOutputStreamWriteBytes func(uintptr, *glib.Bytes, uintptr) int | |
| 456 | + | var xOutputStreamWriteBytes func(uintptr, *glib.Bytes, uintptr, **glib.Error) int | |
| 407 | 457 | ||
| 408 | 458 | // A wrapper function for g_output_stream_write() which takes a | |
| 409 | 459 | // #GBytes as input. This can be more convenient for use by language | |
| @@ -416,9 +466,14 @@ var xOutputStreamWriteBytes func(uintptr, *glib.Bytes, uintptr) int | |||
| 416 | 466 | // remaining bytes, using g_bytes_new_from_bytes(). Passing the same | |
| 417 | 467 | // #GBytes instance multiple times potentially can result in duplicated | |
| 418 | 468 | // data in the output stream. | |
| 419 | - | func (x *OutputStream) WriteBytes(BytesVar *glib.Bytes, CancellableVar *Cancellable) int { | |
| 469 | + | func (x *OutputStream) WriteBytes(BytesVar *glib.Bytes, CancellableVar *Cancellable) (int, error) { | |
| 470 | + | var cerr *glib.Error | |
| 420 | 471 | ||
| 421 | - | return xOutputStreamWriteBytes(x.GoPointer(), BytesVar, CancellableVar.GoPointer()) | |
| 472 | + | cret := xOutputStreamWriteBytes(x.GoPointer(), BytesVar, CancellableVar.GoPointer(), &cerr) | |
| 473 | + | if cerr == nil { | |
| 474 | + | return cret, nil | |
| 475 | + | } | |
| 476 | + | return cret, cerr | |
| 422 | 477 | ||
| 423 | 478 | } | |
| 424 | 479 | ||
| @@ -443,25 +498,35 @@ func (x *OutputStream) WriteBytesAsync(BytesVar *glib.Bytes, IoPriorityVar int, | |||
| 443 | 498 | ||
| 444 | 499 | } | |
| 445 | 500 | ||
| 446 | - | var xOutputStreamWriteBytesFinish func(uintptr, uintptr) int | |
| 501 | + | var xOutputStreamWriteBytesFinish func(uintptr, uintptr, **glib.Error) int | |
| 447 | 502 | ||
| 448 | 503 | // Finishes a stream write-from-#GBytes operation. | |
| 449 | - | func (x *OutputStream) WriteBytesFinish(ResultVar AsyncResult) int { | |
| 504 | + | func (x *OutputStream) WriteBytesFinish(ResultVar AsyncResult) (int, error) { | |
| 505 | + | var cerr *glib.Error | |
| 450 | 506 | ||
| 451 | - | return xOutputStreamWriteBytesFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 507 | + | cret := xOutputStreamWriteBytesFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 508 | + | if cerr == nil { | |
| 509 | + | return cret, nil | |
| 510 | + | } | |
| 511 | + | return cret, cerr | |
| 452 | 512 | ||
| 453 | 513 | } | |
| 454 | 514 | ||
| 455 | - | var xOutputStreamWriteFinish func(uintptr, uintptr) int | |
| 515 | + | var xOutputStreamWriteFinish func(uintptr, uintptr, **glib.Error) int | |
| 456 | 516 | ||
| 457 | 517 | // Finishes a stream write operation. | |
| 458 | - | func (x *OutputStream) WriteFinish(ResultVar AsyncResult) int { | |
| 518 | + | func (x *OutputStream) WriteFinish(ResultVar AsyncResult) (int, error) { | |
| 519 | + | var cerr *glib.Error | |
| 459 | 520 | ||
| 460 | - | return xOutputStreamWriteFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 521 | + | cret := xOutputStreamWriteFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 522 | + | if cerr == nil { | |
| 523 | + | return cret, nil | |
| 524 | + | } | |
| 525 | + | return cret, cerr | |
| 461 | 526 | ||
| 462 | 527 | } | |
| 463 | 528 | ||
| 464 | - | var xOutputStreamWritev func(uintptr, uintptr, uint, uint, uintptr) bool | |
| 529 | + | var xOutputStreamWritev func(uintptr, uintptr, uint, uint, uintptr, **glib.Error) bool | |
| 465 | 530 | ||
| 466 | 531 | // Tries to write the bytes contained in the @n_vectors @vectors into the | |
| 467 | 532 | // stream. Will block during the operation. | |
| @@ -486,13 +551,18 @@ var xOutputStreamWritev func(uintptr, uintptr, uint, uint, uintptr) bool | |||
| 486 | 551 | // aggregate buffer size, and will return %G_IO_ERROR_INVALID_ARGUMENT if these | |
| 487 | 552 | // are exceeded. For example, when writing to a local file on UNIX platforms, | |
| 488 | 553 | // the aggregate buffer size must not exceed %G_MAXSSIZE bytes. | |
| 489 | - | func (x *OutputStream) Writev(VectorsVar uintptr, NVectorsVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) bool { | |
| 554 | + | func (x *OutputStream) Writev(VectorsVar uintptr, NVectorsVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) (bool, error) { | |
| 555 | + | var cerr *glib.Error | |
| 490 | 556 | ||
| 491 | - | return xOutputStreamWritev(x.GoPointer(), VectorsVar, NVectorsVar, BytesWrittenVar, CancellableVar.GoPointer()) | |
| 557 | + | cret := xOutputStreamWritev(x.GoPointer(), VectorsVar, NVectorsVar, BytesWrittenVar, CancellableVar.GoPointer(), &cerr) | |
| 558 | + | if cerr == nil { | |
| 559 | + | return cret, nil | |
| 560 | + | } | |
| 561 | + | return cret, cerr | |
| 492 | 562 | ||
| 493 | 563 | } | |
| 494 | 564 | ||
| 495 | - | var xOutputStreamWritevAll func(uintptr, uintptr, uint, uint, uintptr) bool | |
| 565 | + | var xOutputStreamWritevAll func(uintptr, uintptr, uint, uint, uintptr, **glib.Error) bool | |
| 496 | 566 | ||
| 497 | 567 | // Tries to write the bytes contained in the @n_vectors @vectors into the | |
| 498 | 568 | // stream. Will block during the operation. | |
| @@ -516,9 +586,14 @@ var xOutputStreamWritevAll func(uintptr, uintptr, uint, uint, uintptr) bool | |||
| 516 | 586 | // | |
| 517 | 587 | // The content of the individual elements of @vectors might be changed by this | |
| 518 | 588 | // function. | |
| 519 | - | func (x *OutputStream) WritevAll(VectorsVar uintptr, NVectorsVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) bool { | |
| 589 | + | func (x *OutputStream) WritevAll(VectorsVar uintptr, NVectorsVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) (bool, error) { | |
| 590 | + | var cerr *glib.Error | |
| 520 | 591 | ||
| 521 | - | return xOutputStreamWritevAll(x.GoPointer(), VectorsVar, NVectorsVar, BytesWrittenVar, CancellableVar.GoPointer()) | |
| 592 | + | cret := xOutputStreamWritevAll(x.GoPointer(), VectorsVar, NVectorsVar, BytesWrittenVar, CancellableVar.GoPointer(), &cerr) | |
| 593 | + | if cerr == nil { | |
| 594 | + | return cret, nil | |
| 595 | + | } | |
| 596 | + | return cret, cerr | |
| 522 | 597 | ||
| 523 | 598 | } | |
| 524 | 599 | ||
| @@ -546,7 +621,7 @@ func (x *OutputStream) WritevAllAsync(VectorsVar uintptr, NVectorsVar uint, IoPr | |||
| 546 | 621 | ||
| 547 | 622 | } | |
| 548 | 623 | ||
| 549 | - | var xOutputStreamWritevAllFinish func(uintptr, uintptr, uint) bool | |
| 624 | + | var xOutputStreamWritevAllFinish func(uintptr, uintptr, uint, **glib.Error) bool | |
| 550 | 625 | ||
| 551 | 626 | // Finishes an asynchronous stream write operation started with | |
| 552 | 627 | // g_output_stream_writev_all_async(). | |
| @@ -558,9 +633,14 @@ var xOutputStreamWritevAllFinish func(uintptr, uintptr, uint) bool | |||
| 558 | 633 | // functionality is only available from C. If you need it from another | |
| 559 | 634 | // language then you must write your own loop around | |
| 560 | 635 | // g_output_stream_writev_async(). | |
| 561 | - | func (x *OutputStream) WritevAllFinish(ResultVar AsyncResult, BytesWrittenVar uint) bool { | |
| 636 | + | func (x *OutputStream) WritevAllFinish(ResultVar AsyncResult, BytesWrittenVar uint) (bool, error) { | |
| 637 | + | var cerr *glib.Error | |
| 562 | 638 | ||
| 563 | - | return xOutputStreamWritevAllFinish(x.GoPointer(), ResultVar.GoPointer(), BytesWrittenVar) | |
| 639 | + | cret := xOutputStreamWritevAllFinish(x.GoPointer(), ResultVar.GoPointer(), BytesWrittenVar, &cerr) | |
| 640 | + | if cerr == nil { | |
| 641 | + | return cret, nil | |
| 642 | + | } | |
| 643 | + | return cret, cerr | |
| 564 | 644 | ||
| 565 | 645 | } | |
| 566 | 646 | ||
| @@ -602,12 +682,17 @@ func (x *OutputStream) WritevAsync(VectorsVar uintptr, NVectorsVar uint, IoPrior | |||
| 602 | 682 | ||
| 603 | 683 | } | |
| 604 | 684 | ||
| 605 | - | var xOutputStreamWritevFinish func(uintptr, uintptr, uint) bool | |
| 685 | + | var xOutputStreamWritevFinish func(uintptr, uintptr, uint, **glib.Error) bool | |
| 606 | 686 | ||
| 607 | 687 | // Finishes a stream writev operation. | |
| 608 | - | func (x *OutputStream) WritevFinish(ResultVar AsyncResult, BytesWrittenVar uint) bool { | |
| 688 | + | func (x *OutputStream) WritevFinish(ResultVar AsyncResult, BytesWrittenVar uint) (bool, error) { | |
| 689 | + | var cerr *glib.Error | |
| 609 | 690 | ||
| 610 | - | return xOutputStreamWritevFinish(x.GoPointer(), ResultVar.GoPointer(), BytesWrittenVar) | |
| 691 | + | cret := xOutputStreamWritevFinish(x.GoPointer(), ResultVar.GoPointer(), BytesWrittenVar, &cerr) | |
| 692 | + | if cerr == nil { | |
| 693 | + | return cret, nil | |
| 694 | + | } | |
| 695 | + | return cret, cerr | |
| 611 | 696 | ||
| 612 | 697 | } | |
| 613 | 698 | ||
M v4/gio/gpermission.go +39 -18
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -41,7 +42,7 @@ func PermissionNewFromInternalPtr(ptr uintptr) *Permission { | |||
| 41 | 42 | return cls | |
| 42 | 43 | } | |
| 43 | 44 | ||
| 44 | - | var xPermissionAcquire func(uintptr, uintptr) bool | |
| 45 | + | var xPermissionAcquire func(uintptr, uintptr, **glib.Error) bool | |
| 45 | 46 | ||
| 46 | 47 | // Attempts to acquire the permission represented by @permission. | |
| 47 | 48 | // | |
| @@ -58,9 +59,14 @@ var xPermissionAcquire func(uintptr, uintptr) bool | |||
| 58 | 59 | // This call is blocking, likely for a very long time (in the case that | |
| 59 | 60 | // user interaction is required). See g_permission_acquire_async() for | |
| 60 | 61 | // the non-blocking version. | |
| 61 | - | func (x *Permission) Acquire(CancellableVar *Cancellable) bool { | |
| 62 | + | func (x *Permission) Acquire(CancellableVar *Cancellable) (bool, error) { | |
| 63 | + | var cerr *glib.Error | |
| 62 | 64 | ||
| 63 | - | return xPermissionAcquire(x.GoPointer(), CancellableVar.GoPointer()) | |
| 65 | + | cret := xPermissionAcquire(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 66 | + | if cerr == nil { | |
| 67 | + | return cret, nil | |
| 68 | + | } | |
| 69 | + | return cret, cerr | |
| 64 | 70 | ||
| 65 | 71 | } | |
| 66 | 72 | ||
| @@ -76,16 +82,21 @@ func (x *Permission) AcquireAsync(CancellableVar *Cancellable, CallbackVar Async | |||
| 76 | 82 | ||
| 77 | 83 | } | |
| 78 | 84 | ||
| 79 | - | var xPermissionAcquireFinish func(uintptr, uintptr) bool | |
| 85 | + | var xPermissionAcquireFinish func(uintptr, uintptr, **glib.Error) bool | |
| 80 | 86 | ||
| 81 | 87 | // Collects the result of attempting to acquire the permission | |
| 82 | 88 | // represented by @permission. | |
| 83 | 89 | // | |
| 84 | 90 | // This is the second half of the asynchronous version of | |
| 85 | 91 | // g_permission_acquire(). | |
| 86 | - | func (x *Permission) AcquireFinish(ResultVar AsyncResult) bool { | |
| 92 | + | func (x *Permission) AcquireFinish(ResultVar AsyncResult) (bool, error) { | |
| 93 | + | var cerr *glib.Error | |
| 87 | 94 | ||
| 88 | - | return xPermissionAcquireFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 95 | + | cret := xPermissionAcquireFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 96 | + | if cerr == nil { | |
| 97 | + | return cret, nil | |
| 98 | + | } | |
| 99 | + | return cret, cerr | |
| 89 | 100 | ||
| 90 | 101 | } | |
| 91 | 102 | ||
| @@ -96,8 +107,8 @@ var xPermissionGetAllowed func(uintptr) bool | |||
| 96 | 107 | // @permission represents the permission to perform. | |
| 97 | 108 | func (x *Permission) GetAllowed() bool { | |
| 98 | 109 | ||
| 99 | - | return xPermissionGetAllowed(x.GoPointer()) | |
| 100 | - | ||
| 110 | + | cret := xPermissionGetAllowed(x.GoPointer()) | |
| 111 | + | return cret | |
| 101 | 112 | } | |
| 102 | 113 | ||
| 103 | 114 | var xPermissionGetCanAcquire func(uintptr) bool | |
| @@ -107,8 +118,8 @@ var xPermissionGetCanAcquire func(uintptr) bool | |||
| 107 | 118 | // g_permission_acquire(). | |
| 108 | 119 | func (x *Permission) GetCanAcquire() bool { | |
| 109 | 120 | ||
| 110 | - | return xPermissionGetCanAcquire(x.GoPointer()) | |
| 111 | - | ||
| 121 | + | cret := xPermissionGetCanAcquire(x.GoPointer()) | |
| 122 | + | return cret | |
| 112 | 123 | } | |
| 113 | 124 | ||
| 114 | 125 | var xPermissionGetCanRelease func(uintptr) bool | |
| @@ -118,8 +129,8 @@ var xPermissionGetCanRelease func(uintptr) bool | |||
| 118 | 129 | // g_permission_release(). | |
| 119 | 130 | func (x *Permission) GetCanRelease() bool { | |
| 120 | 131 | ||
| 121 | - | return xPermissionGetCanRelease(x.GoPointer()) | |
| 122 | - | ||
| 132 | + | cret := xPermissionGetCanRelease(x.GoPointer()) | |
| 133 | + | return cret | |
| 123 | 134 | } | |
| 124 | 135 | ||
| 125 | 136 | var xPermissionImplUpdate func(uintptr, bool, bool, bool) | |
| @@ -135,7 +146,7 @@ func (x *Permission) ImplUpdate(AllowedVar bool, CanAcquireVar bool, CanReleaseV | |||
| 135 | 146 | ||
| 136 | 147 | } | |
| 137 | 148 | ||
| 138 | - | var xPermissionRelease func(uintptr, uintptr) bool | |
| 149 | + | var xPermissionRelease func(uintptr, uintptr, **glib.Error) bool | |
| 139 | 150 | ||
| 140 | 151 | // Attempts to release the permission represented by @permission. | |
| 141 | 152 | // | |
| @@ -152,9 +163,14 @@ var xPermissionRelease func(uintptr, uintptr) bool | |||
| 152 | 163 | // This call is blocking, likely for a very long time (in the case that | |
| 153 | 164 | // user interaction is required). See g_permission_release_async() for | |
| 154 | 165 | // the non-blocking version. | |
| 155 | - | func (x *Permission) Release(CancellableVar *Cancellable) bool { | |
| 166 | + | func (x *Permission) Release(CancellableVar *Cancellable) (bool, error) { | |
| 167 | + | var cerr *glib.Error | |
| 156 | 168 | ||
| 157 | - | return xPermissionRelease(x.GoPointer(), CancellableVar.GoPointer()) | |
| 169 | + | cret := xPermissionRelease(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 170 | + | if cerr == nil { | |
| 171 | + | return cret, nil | |
| 172 | + | } | |
| 173 | + | return cret, cerr | |
| 158 | 174 | ||
| 159 | 175 | } | |
| 160 | 176 | ||
| @@ -170,16 +186,21 @@ func (x *Permission) ReleaseAsync(CancellableVar *Cancellable, CallbackVar Async | |||
| 170 | 186 | ||
| 171 | 187 | } | |
| 172 | 188 | ||
| 173 | - | var xPermissionReleaseFinish func(uintptr, uintptr) bool | |
| 189 | + | var xPermissionReleaseFinish func(uintptr, uintptr, **glib.Error) bool | |
| 174 | 190 | ||
| 175 | 191 | // Collects the result of attempting to release the permission | |
| 176 | 192 | // represented by @permission. | |
| 177 | 193 | // | |
| 178 | 194 | // This is the second half of the asynchronous version of | |
| 179 | 195 | // g_permission_release(). | |
| 180 | - | func (x *Permission) ReleaseFinish(ResultVar AsyncResult) bool { | |
| 196 | + | func (x *Permission) ReleaseFinish(ResultVar AsyncResult) (bool, error) { | |
| 197 | + | var cerr *glib.Error | |
| 181 | 198 | ||
| 182 | - | return xPermissionReleaseFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 199 | + | cret := xPermissionReleaseFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 200 | + | if cerr == nil { | |
| 201 | + | return cret, nil | |
| 202 | + | } | |
| 203 | + | return cret, cerr | |
| 183 | 204 | ||
| 184 | 205 | } | |
| 185 | 206 | ||
M v4/gio/gpollableinputstream.go +14 -9
| @@ -54,8 +54,8 @@ func (x *PollableInputStreamBase) SetGoPointer(ptr uintptr) { | |||
| 54 | 54 | // a stream cannot switch from pollable to non-pollable or vice versa. | |
| 55 | 55 | func (x *PollableInputStreamBase) CanPoll() bool { | |
| 56 | 56 | ||
| 57 | - | return XGPollableInputStreamCanPoll(x.GoPointer()) | |
| 58 | - | ||
| 57 | + | cret := XGPollableInputStreamCanPoll(x.GoPointer()) | |
| 58 | + | return cret | |
| 59 | 59 | } | |
| 60 | 60 | ||
| 61 | 61 | // Creates a #GSource that triggers when @stream can be read, or | |
| @@ -68,8 +68,8 @@ func (x *PollableInputStreamBase) CanPoll() bool { | |||
| 68 | 68 | // rather than g_input_stream_read() from the callback. | |
| 69 | 69 | func (x *PollableInputStreamBase) CreateSource(CancellableVar *Cancellable) *glib.Source { | |
| 70 | 70 | ||
| 71 | - | return XGPollableInputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer()) | |
| 72 | - | ||
| 71 | + | cret := XGPollableInputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer()) | |
| 72 | + | return cret | |
| 73 | 73 | } | |
| 74 | 74 | ||
| 75 | 75 | // Checks if @stream can be read. | |
| @@ -82,8 +82,8 @@ func (x *PollableInputStreamBase) CreateSource(CancellableVar *Cancellable) *gli | |||
| 82 | 82 | // %G_IO_ERROR_WOULD_BLOCK error rather than blocking. | |
| 83 | 83 | func (x *PollableInputStreamBase) IsReadable() bool { | |
| 84 | 84 | ||
| 85 | - | return XGPollableInputStreamIsReadable(x.GoPointer()) | |
| 86 | - | ||
| 85 | + | cret := XGPollableInputStreamIsReadable(x.GoPointer()) | |
| 86 | + | return cret | |
| 87 | 87 | } | |
| 88 | 88 | ||
| 89 | 89 | // Attempts to read up to @count bytes from @stream into @buffer, as | |
| @@ -97,16 +97,21 @@ func (x *PollableInputStreamBase) IsReadable() bool { | |||
| 97 | 97 | // if @cancellable has already been cancelled when you call, which | |
| 98 | 98 | // may happen if you call this method after a source triggers due | |
| 99 | 99 | // to having been cancelled. | |
| 100 | - | func (x *PollableInputStreamBase) ReadNonblocking(BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) int { | |
| 100 | + | func (x *PollableInputStreamBase) ReadNonblocking(BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) (int, error) { | |
| 101 | + | var cerr *glib.Error | |
| 101 | 102 | ||
| 102 | - | return XGPollableInputStreamReadNonblocking(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer()) | |
| 103 | + | cret := XGPollableInputStreamReadNonblocking(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer(), &cerr) | |
| 104 | + | if cerr == nil { | |
| 105 | + | return cret, nil | |
| 106 | + | } | |
| 107 | + | return cret, cerr | |
| 103 | 108 | ||
| 104 | 109 | } | |
| 105 | 110 | ||
| 106 | 111 | var XGPollableInputStreamCanPoll func(uintptr) bool | |
| 107 | 112 | var XGPollableInputStreamCreateSource func(uintptr, uintptr) *glib.Source | |
| 108 | 113 | var XGPollableInputStreamIsReadable func(uintptr) bool | |
| 109 | - | var XGPollableInputStreamReadNonblocking func(uintptr, uintptr, uint, uintptr) int | |
| 114 | + | var XGPollableInputStreamReadNonblocking func(uintptr, uintptr, uint, uintptr, **glib.Error) int | |
| 110 | 115 | ||
| 111 | 116 | func init() { | |
| 112 | 117 | lib, err := purego.Dlopen(core.GetPath("GIO"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
M v4/gio/gpollableoutputstream.go +22 -12
| @@ -61,8 +61,8 @@ func (x *PollableOutputStreamBase) SetGoPointer(ptr uintptr) { | |||
| 61 | 61 | // a stream cannot switch from pollable to non-pollable or vice versa. | |
| 62 | 62 | func (x *PollableOutputStreamBase) CanPoll() bool { | |
| 63 | 63 | ||
| 64 | - | return XGPollableOutputStreamCanPoll(x.GoPointer()) | |
| 65 | - | ||
| 64 | + | cret := XGPollableOutputStreamCanPoll(x.GoPointer()) | |
| 65 | + | return cret | |
| 66 | 66 | } | |
| 67 | 67 | ||
| 68 | 68 | // Creates a #GSource that triggers when @stream can be written, or | |
| @@ -75,8 +75,8 @@ func (x *PollableOutputStreamBase) CanPoll() bool { | |||
| 75 | 75 | // rather than g_output_stream_write() from the callback. | |
| 76 | 76 | func (x *PollableOutputStreamBase) CreateSource(CancellableVar *Cancellable) *glib.Source { | |
| 77 | 77 | ||
| 78 | - | return XGPollableOutputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer()) | |
| 79 | - | ||
| 78 | + | cret := XGPollableOutputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer()) | |
| 79 | + | return cret | |
| 80 | 80 | } | |
| 81 | 81 | ||
| 82 | 82 | // Checks if @stream can be written. | |
| @@ -89,8 +89,8 @@ func (x *PollableOutputStreamBase) CreateSource(CancellableVar *Cancellable) *gl | |||
| 89 | 89 | // %G_IO_ERROR_WOULD_BLOCK error rather than blocking. | |
| 90 | 90 | func (x *PollableOutputStreamBase) IsWritable() bool { | |
| 91 | 91 | ||
| 92 | - | return XGPollableOutputStreamIsWritable(x.GoPointer()) | |
| 93 | - | ||
| 92 | + | cret := XGPollableOutputStreamIsWritable(x.GoPointer()) | |
| 93 | + | return cret | |
| 94 | 94 | } | |
| 95 | 95 | ||
| 96 | 96 | // Attempts to write up to @count bytes from @buffer to @stream, as | |
| @@ -108,9 +108,14 @@ func (x *PollableOutputStreamBase) IsWritable() bool { | |||
| 108 | 108 | // Also note that if %G_IO_ERROR_WOULD_BLOCK is returned some underlying | |
| 109 | 109 | // transports like D/TLS require that you re-send the same @buffer and | |
| 110 | 110 | // @count in the next write call. | |
| 111 | - | func (x *PollableOutputStreamBase) WriteNonblocking(BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) int { | |
| 111 | + | func (x *PollableOutputStreamBase) WriteNonblocking(BufferVar uintptr, CountVar uint, CancellableVar *Cancellable) (int, error) { | |
| 112 | + | var cerr *glib.Error | |
| 112 | 113 | ||
| 113 | - | return XGPollableOutputStreamWriteNonblocking(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer()) | |
| 114 | + | cret := XGPollableOutputStreamWriteNonblocking(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer(), &cerr) | |
| 115 | + | if cerr == nil { | |
| 116 | + | return cret, nil | |
| 117 | + | } | |
| 118 | + | return cret, cerr | |
| 114 | 119 | ||
| 115 | 120 | } | |
| 116 | 121 | ||
| @@ -130,17 +135,22 @@ func (x *PollableOutputStreamBase) WriteNonblocking(BufferVar uintptr, CountVar | |||
| 130 | 135 | // Also note that if %G_POLLABLE_RETURN_WOULD_BLOCK is returned some underlying | |
| 131 | 136 | // transports like D/TLS require that you re-send the same @vectors and | |
| 132 | 137 | // @n_vectors in the next write call. | |
| 133 | - | func (x *PollableOutputStreamBase) WritevNonblocking(VectorsVar uintptr, NVectorsVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) PollableReturn { | |
| 138 | + | func (x *PollableOutputStreamBase) WritevNonblocking(VectorsVar uintptr, NVectorsVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) (PollableReturn, error) { | |
| 139 | + | var cerr *glib.Error | |
| 134 | 140 | ||
| 135 | - | return XGPollableOutputStreamWritevNonblocking(x.GoPointer(), VectorsVar, NVectorsVar, BytesWrittenVar, CancellableVar.GoPointer()) | |
| 141 | + | cret := XGPollableOutputStreamWritevNonblocking(x.GoPointer(), VectorsVar, NVectorsVar, BytesWrittenVar, CancellableVar.GoPointer(), &cerr) | |
| 142 | + | if cerr == nil { | |
| 143 | + | return cret, nil | |
| 144 | + | } | |
| 145 | + | return cret, cerr | |
| 136 | 146 | ||
| 137 | 147 | } | |
| 138 | 148 | ||
| 139 | 149 | var XGPollableOutputStreamCanPoll func(uintptr) bool | |
| 140 | 150 | var XGPollableOutputStreamCreateSource func(uintptr, uintptr) *glib.Source | |
| 141 | 151 | var XGPollableOutputStreamIsWritable func(uintptr) bool | |
| 142 | - | var XGPollableOutputStreamWriteNonblocking func(uintptr, uintptr, uint, uintptr) int | |
| 143 | - | var XGPollableOutputStreamWritevNonblocking func(uintptr, uintptr, uint, uint, uintptr) PollableReturn | |
| 152 | + | var XGPollableOutputStreamWriteNonblocking func(uintptr, uintptr, uint, uintptr, **glib.Error) int | |
| 153 | + | var XGPollableOutputStreamWritevNonblocking func(uintptr, uintptr, uint, uint, uintptr, **glib.Error) PollableReturn | |
| 144 | 154 | ||
| 145 | 155 | func init() { | |
| 146 | 156 | lib, err := purego.Dlopen(core.GetPath("GIO"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
M v4/gio/gpollableutils.go +28 -13
| @@ -17,8 +17,8 @@ var xPollableSourceNew func(uintptr) *glib.Source | |||
| 17 | 17 | // sources to it to cause it to trigger. | |
| 18 | 18 | func PollableSourceNew(PollableStreamVar *gobject.Object) *glib.Source { | |
| 19 | 19 | ||
| 20 | - | return xPollableSourceNew(PollableStreamVar.GoPointer()) | |
| 21 | - | ||
| 20 | + | cret := xPollableSourceNew(PollableStreamVar.GoPointer()) | |
| 21 | + | return cret | |
| 22 | 22 | } | |
| 23 | 23 | ||
| 24 | 24 | var xPollableSourceNewFull func(uintptr, *glib.Source, uintptr) *glib.Source | |
| @@ -29,11 +29,11 @@ var xPollableSourceNewFull func(uintptr, *glib.Source, uintptr) *glib.Source | |||
| 29 | 29 | // dummy callback), and @cancellable, if they are non-%NULL. | |
| 30 | 30 | func PollableSourceNewFull(PollableStreamVar *gobject.Object, ChildSourceVar *glib.Source, CancellableVar *Cancellable) *glib.Source { | |
| 31 | 31 | ||
| 32 | - | return xPollableSourceNewFull(PollableStreamVar.GoPointer(), ChildSourceVar, CancellableVar.GoPointer()) | |
| 33 | - | ||
| 32 | + | cret := xPollableSourceNewFull(PollableStreamVar.GoPointer(), ChildSourceVar, CancellableVar.GoPointer()) | |
| 33 | + | return cret | |
| 34 | 34 | } | |
| 35 | 35 | ||
| 36 | - | var xPollableStreamRead func(uintptr, uintptr, uint, bool, uintptr) int | |
| 36 | + | var xPollableStreamRead func(uintptr, uintptr, uint, bool, uintptr, **glib.Error) int | |
| 37 | 37 | ||
| 38 | 38 | // Tries to read from @stream, as with g_input_stream_read() (if | |
| 39 | 39 | // @blocking is %TRUE) or g_pollable_input_stream_read_nonblocking() | |
| @@ -44,13 +44,18 @@ var xPollableStreamRead func(uintptr, uintptr, uint, bool, uintptr) int | |||
| 44 | 44 | // #GPollableInputStream for which g_pollable_input_stream_can_poll() | |
| 45 | 45 | // returns %TRUE, or else the behavior is undefined. If @blocking is | |
| 46 | 46 | // %TRUE, then @stream does not need to be a #GPollableInputStream. | |
| 47 | - | func PollableStreamRead(StreamVar *InputStream, BufferVar uintptr, CountVar uint, BlockingVar bool, CancellableVar *Cancellable) int { | |
| 47 | + | func PollableStreamRead(StreamVar *InputStream, BufferVar uintptr, CountVar uint, BlockingVar bool, CancellableVar *Cancellable) (int, error) { | |
| 48 | + | var cerr *glib.Error | |
| 48 | 49 | ||
| 49 | - | return xPollableStreamRead(StreamVar.GoPointer(), BufferVar, CountVar, BlockingVar, CancellableVar.GoPointer()) | |
| 50 | + | cret := xPollableStreamRead(StreamVar.GoPointer(), BufferVar, CountVar, BlockingVar, CancellableVar.GoPointer(), &cerr) | |
| 51 | + | if cerr == nil { | |
| 52 | + | return cret, nil | |
| 53 | + | } | |
| 54 | + | return cret, cerr | |
| 50 | 55 | ||
| 51 | 56 | } | |
| 52 | 57 | ||
| 53 | - | var xPollableStreamWrite func(uintptr, uintptr, uint, bool, uintptr) int | |
| 58 | + | var xPollableStreamWrite func(uintptr, uintptr, uint, bool, uintptr, **glib.Error) int | |
| 54 | 59 | ||
| 55 | 60 | // Tries to write to @stream, as with g_output_stream_write() (if | |
| 56 | 61 | // @blocking is %TRUE) or g_pollable_output_stream_write_nonblocking() | |
| @@ -62,13 +67,18 @@ var xPollableStreamWrite func(uintptr, uintptr, uint, bool, uintptr) int | |||
| 62 | 67 | // g_pollable_output_stream_can_poll() returns %TRUE or else the | |
| 63 | 68 | // behavior is undefined. If @blocking is %TRUE, then @stream does not | |
| 64 | 69 | // need to be a #GPollableOutputStream. | |
| 65 | - | func PollableStreamWrite(StreamVar *OutputStream, BufferVar uintptr, CountVar uint, BlockingVar bool, CancellableVar *Cancellable) int { | |
| 70 | + | func PollableStreamWrite(StreamVar *OutputStream, BufferVar uintptr, CountVar uint, BlockingVar bool, CancellableVar *Cancellable) (int, error) { | |
| 71 | + | var cerr *glib.Error | |
| 66 | 72 | ||
| 67 | - | return xPollableStreamWrite(StreamVar.GoPointer(), BufferVar, CountVar, BlockingVar, CancellableVar.GoPointer()) | |
| 73 | + | cret := xPollableStreamWrite(StreamVar.GoPointer(), BufferVar, CountVar, BlockingVar, CancellableVar.GoPointer(), &cerr) | |
| 74 | + | if cerr == nil { | |
| 75 | + | return cret, nil | |
| 76 | + | } | |
| 77 | + | return cret, cerr | |
| 68 | 78 | ||
| 69 | 79 | } | |
| 70 | 80 | ||
| 71 | - | var xPollableStreamWriteAll func(uintptr, uintptr, uint, bool, uint, uintptr) bool | |
| 81 | + | var xPollableStreamWriteAll func(uintptr, uintptr, uint, bool, uint, uintptr, **glib.Error) bool | |
| 72 | 82 | ||
| 73 | 83 | // Tries to write @count bytes to @stream, as with | |
| 74 | 84 | // g_output_stream_write_all(), but using g_pollable_stream_write() | |
| @@ -88,9 +98,14 @@ var xPollableStreamWriteAll func(uintptr, uintptr, uint, bool, uint, uintptr) bo | |||
| 88 | 98 | // g_pollable_output_stream_can_poll() returns %TRUE or else the | |
| 89 | 99 | // behavior is undefined. If @blocking is %TRUE, then @stream does not | |
| 90 | 100 | // need to be a #GPollableOutputStream. | |
| 91 | - | func PollableStreamWriteAll(StreamVar *OutputStream, BufferVar uintptr, CountVar uint, BlockingVar bool, BytesWrittenVar uint, CancellableVar *Cancellable) bool { | |
| 101 | + | func PollableStreamWriteAll(StreamVar *OutputStream, BufferVar uintptr, CountVar uint, BlockingVar bool, BytesWrittenVar uint, CancellableVar *Cancellable) (bool, error) { | |
| 102 | + | var cerr *glib.Error | |
| 92 | 103 | ||
| 93 | - | return xPollableStreamWriteAll(StreamVar.GoPointer(), BufferVar, CountVar, BlockingVar, BytesWrittenVar, CancellableVar.GoPointer()) | |
| 104 | + | cret := xPollableStreamWriteAll(StreamVar.GoPointer(), BufferVar, CountVar, BlockingVar, BytesWrittenVar, CancellableVar.GoPointer(), &cerr) | |
| 105 | + | if cerr == nil { | |
| 106 | + | return cret, nil | |
| 107 | + | } | |
| 108 | + | return cret, cerr | |
| 94 | 109 | ||
| 95 | 110 | } | |
| 96 | 111 | ||
M v4/gio/gpowerprofilemonitor.go +10 -10
| @@ -57,8 +57,8 @@ func (x *PowerProfileMonitorBase) SetGoPointer(ptr uintptr) { | |||
| 57 | 57 | // changed. | |
| 58 | 58 | func (x *PowerProfileMonitorBase) GetPowerSaverEnabled() bool { | |
| 59 | 59 | ||
| 60 | - | return XGPowerProfileMonitorGetPowerSaverEnabled(x.GoPointer()) | |
| 61 | - | ||
| 60 | + | cret := XGPowerProfileMonitorGetPowerSaverEnabled(x.GoPointer()) | |
| 61 | + | return cret | |
| 62 | 62 | } | |
| 63 | 63 | ||
| 64 | 64 | var XGPowerProfileMonitorGetPowerSaverEnabled func(uintptr) bool | |
| @@ -67,16 +67,16 @@ var xPowerProfileMonitorDupDefault func() uintptr | |||
| 67 | 67 | ||
| 68 | 68 | // Gets a reference to the default #GPowerProfileMonitor for the system. | |
| 69 | 69 | func PowerProfileMonitorDupDefault() *PowerProfileMonitorBase { | |
| 70 | + | var cls *PowerProfileMonitorBase | |
| 70 | 71 | ||
| 71 | - | PowerProfileMonitorDupDefaultPtr := xPowerProfileMonitorDupDefault() | |
| 72 | - | if PowerProfileMonitorDupDefaultPtr == 0 { | |
| 73 | - | return nil | |
| 74 | - | } | |
| 75 | - | ||
| 76 | - | PowerProfileMonitorDupDefaultCls := &PowerProfileMonitorBase{} | |
| 77 | - | PowerProfileMonitorDupDefaultCls.Ptr = PowerProfileMonitorDupDefaultPtr | |
| 78 | - | return PowerProfileMonitorDupDefaultCls | |
| 72 | + | cret := xPowerProfileMonitorDupDefault() | |
| 79 | 73 | ||
| 74 | + | if cret == 0 { | |
| 75 | + | return cls | |
| 76 | + | } | |
| 77 | + | cls = &PowerProfileMonitorBase{} | |
| 78 | + | cls.Ptr = cret | |
| 79 | + | return cls | |
| 80 | 80 | } | |
| 81 | 81 | ||
| 82 | 82 | func init() { | |
M v4/gio/gproxy.go +39 -28
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | ) | |
| 8 | 9 | ||
| 9 | 10 | // Provides an interface for handling proxy connection and payload. | |
| @@ -41,16 +42,21 @@ func (x *ProxyBase) SetGoPointer(ptr uintptr) { | |||
| 41 | 42 | // #GSocketConnection that is connected to the proxy server), this | |
| 42 | 43 | // does the necessary handshake to connect to @proxy_address, and if | |
| 43 | 44 | // required, wraps the #GIOStream to handle proxy payload. | |
| 44 | - | func (x *ProxyBase) Connect(ConnectionVar *IOStream, ProxyAddressVar *ProxyAddress, CancellableVar *Cancellable) *IOStream { | |
| 45 | + | func (x *ProxyBase) Connect(ConnectionVar *IOStream, ProxyAddressVar *ProxyAddress, CancellableVar *Cancellable) (*IOStream, error) { | |
| 46 | + | var cls *IOStream | |
| 47 | + | var cerr *glib.Error | |
| 45 | 48 | ||
| 46 | - | ConnectPtr := XGProxyConnect(x.GoPointer(), ConnectionVar.GoPointer(), ProxyAddressVar.GoPointer(), CancellableVar.GoPointer()) | |
| 47 | - | if ConnectPtr == 0 { | |
| 48 | - | return nil | |
| 49 | - | } | |
| 49 | + | cret := XGProxyConnect(x.GoPointer(), ConnectionVar.GoPointer(), ProxyAddressVar.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 50 | 50 | ||
| 51 | - | ConnectCls := &IOStream{} | |
| 52 | - | ConnectCls.Ptr = ConnectPtr | |
| 53 | - | return ConnectCls | |
| 51 | + | if cret == 0 { | |
| 52 | + | return cls, cerr | |
| 53 | + | } | |
| 54 | + | cls = &IOStream{} | |
| 55 | + | cls.Ptr = cret | |
| 56 | + | if cerr == nil { | |
| 57 | + | return cls, nil | |
| 58 | + | } | |
| 59 | + | return cls, cerr | |
| 54 | 60 | ||
| 55 | 61 | } | |
| 56 | 62 | ||
| @@ -62,16 +68,21 @@ func (x *ProxyBase) ConnectAsync(ConnectionVar *IOStream, ProxyAddressVar *Proxy | |||
| 62 | 68 | } | |
| 63 | 69 | ||
| 64 | 70 | // See g_proxy_connect(). | |
| 65 | - | func (x *ProxyBase) ConnectFinish(ResultVar AsyncResult) *IOStream { | |
| 71 | + | func (x *ProxyBase) ConnectFinish(ResultVar AsyncResult) (*IOStream, error) { | |
| 72 | + | var cls *IOStream | |
| 73 | + | var cerr *glib.Error | |
| 66 | 74 | ||
| 67 | - | ConnectFinishPtr := XGProxyConnectFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 68 | - | if ConnectFinishPtr == 0 { | |
| 69 | - | return nil | |
| 70 | - | } | |
| 75 | + | cret := XGProxyConnectFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 71 | 76 | ||
| 72 | - | ConnectFinishCls := &IOStream{} | |
| 73 | - | ConnectFinishCls.Ptr = ConnectFinishPtr | |
| 74 | - | return ConnectFinishCls | |
| 77 | + | if cret == 0 { | |
| 78 | + | return cls, cerr | |
| 79 | + | } | |
| 80 | + | cls = &IOStream{} | |
| 81 | + | cls.Ptr = cret | |
| 82 | + | if cerr == nil { | |
| 83 | + | return cls, nil | |
| 84 | + | } | |
| 85 | + | return cls, cerr | |
| 75 | 86 | ||
| 76 | 87 | } | |
| 77 | 88 | ||
| @@ -84,13 +95,13 @@ func (x *ProxyBase) ConnectFinish(ResultVar AsyncResult) *IOStream { | |||
| 84 | 95 | // g_proxy_connect() or g_proxy_connect_async(). | |
| 85 | 96 | func (x *ProxyBase) SupportsHostname() bool { | |
| 86 | 97 | ||
| 87 | - | return XGProxySupportsHostname(x.GoPointer()) | |
| 88 | - | ||
| 98 | + | cret := XGProxySupportsHostname(x.GoPointer()) | |
| 99 | + | return cret | |
| 89 | 100 | } | |
| 90 | 101 | ||
| 91 | - | var XGProxyConnect func(uintptr, uintptr, uintptr, uintptr) uintptr | |
| 102 | + | var XGProxyConnect func(uintptr, uintptr, uintptr, uintptr, **glib.Error) uintptr | |
| 92 | 103 | var XGProxyConnectAsync func(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) | |
| 93 | - | var XGProxyConnectFinish func(uintptr, uintptr) uintptr | |
| 104 | + | var XGProxyConnectFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 94 | 105 | var XGProxySupportsHostname func(uintptr) bool | |
| 95 | 106 | ||
| 96 | 107 | var xProxyGetDefaultForProtocol func(string) uintptr | |
| @@ -98,16 +109,16 @@ var xProxyGetDefaultForProtocol func(string) uintptr | |||
| 98 | 109 | // Find the `gio-proxy` extension point for a proxy implementation that supports | |
| 99 | 110 | // the specified protocol. | |
| 100 | 111 | func ProxyGetDefaultForProtocol(ProtocolVar string) *ProxyBase { | |
| 112 | + | var cls *ProxyBase | |
| 101 | 113 | ||
| 102 | - | ProxyGetDefaultForProtocolPtr := xProxyGetDefaultForProtocol(ProtocolVar) | |
| 103 | - | if ProxyGetDefaultForProtocolPtr == 0 { | |
| 104 | - | return nil | |
| 105 | - | } | |
| 106 | - | ||
| 107 | - | ProxyGetDefaultForProtocolCls := &ProxyBase{} | |
| 108 | - | ProxyGetDefaultForProtocolCls.Ptr = ProxyGetDefaultForProtocolPtr | |
| 109 | - | return ProxyGetDefaultForProtocolCls | |
| 114 | + | cret := xProxyGetDefaultForProtocol(ProtocolVar) | |
| 110 | 115 | ||
| 116 | + | if cret == 0 { | |
| 117 | + | return cls | |
| 118 | + | } | |
| 119 | + | cls = &ProxyBase{} | |
| 120 | + | cls.Ptr = cret | |
| 121 | + | return cls | |
| 111 | 122 | } | |
| 112 | 123 | ||
| 113 | 124 | func init() { | |
M v4/gio/gproxyaddress.go +41 -39
| @@ -34,14 +34,16 @@ var xNewProxyAddress func(uintptr, uint16, string, string, uint16, string, strin | |||
| 34 | 34 | // #GProxyAddress:destination-protocol fields; use g_object_new() | |
| 35 | 35 | // directly if you want to set those.) | |
| 36 | 36 | func NewProxyAddress(InetaddrVar *InetAddress, PortVar uint16, ProtocolVar string, DestHostnameVar string, DestPortVar uint16, UsernameVar string, PasswordVar string) *SocketAddress { | |
| 37 | - | NewProxyAddressPtr := xNewProxyAddress(InetaddrVar.GoPointer(), PortVar, ProtocolVar, DestHostnameVar, DestPortVar, UsernameVar, PasswordVar) | |
| 38 | - | if NewProxyAddressPtr == 0 { | |
| 39 | - | return nil | |
| 40 | - | } | |
| 37 | + | var cls *SocketAddress | |
| 38 | + | ||
| 39 | + | cret := xNewProxyAddress(InetaddrVar.GoPointer(), PortVar, ProtocolVar, DestHostnameVar, DestPortVar, UsernameVar, PasswordVar) | |
| 41 | 40 | ||
| 42 | - | NewProxyAddressCls := &SocketAddress{} | |
| 43 | - | NewProxyAddressCls.Ptr = NewProxyAddressPtr | |
| 44 | - | return NewProxyAddressCls | |
| 41 | + | if cret == 0 { | |
| 42 | + | return cls | |
| 43 | + | } | |
| 44 | + | cls = &SocketAddress{} | |
| 45 | + | cls.Ptr = cret | |
| 46 | + | return cls | |
| 45 | 47 | } | |
| 46 | 48 | ||
| 47 | 49 | var xProxyAddressGetDestinationHostname func(uintptr) string | |
| @@ -51,8 +53,8 @@ var xProxyAddressGetDestinationHostname func(uintptr) string | |||
| 51 | 53 | // itself. | |
| 52 | 54 | func (x *ProxyAddress) GetDestinationHostname() string { | |
| 53 | 55 | ||
| 54 | - | return xProxyAddressGetDestinationHostname(x.GoPointer()) | |
| 55 | - | ||
| 56 | + | cret := xProxyAddressGetDestinationHostname(x.GoPointer()) | |
| 57 | + | return cret | |
| 56 | 58 | } | |
| 57 | 59 | ||
| 58 | 60 | var xProxyAddressGetDestinationPort func(uintptr) uint16 | |
| @@ -62,8 +64,8 @@ var xProxyAddressGetDestinationPort func(uintptr) uint16 | |||
| 62 | 64 | // port number of the proxy itself. | |
| 63 | 65 | func (x *ProxyAddress) GetDestinationPort() uint16 { | |
| 64 | 66 | ||
| 65 | - | return xProxyAddressGetDestinationPort(x.GoPointer()) | |
| 66 | - | ||
| 67 | + | cret := xProxyAddressGetDestinationPort(x.GoPointer()) | |
| 68 | + | return cret | |
| 67 | 69 | } | |
| 68 | 70 | ||
| 69 | 71 | var xProxyAddressGetDestinationProtocol func(uintptr) string | |
| @@ -72,8 +74,8 @@ var xProxyAddressGetDestinationProtocol func(uintptr) string | |||
| 72 | 74 | // server; eg, "http" or "ftp". | |
| 73 | 75 | func (x *ProxyAddress) GetDestinationProtocol() string { | |
| 74 | 76 | ||
| 75 | - | return xProxyAddressGetDestinationProtocol(x.GoPointer()) | |
| 76 | - | ||
| 77 | + | cret := xProxyAddressGetDestinationProtocol(x.GoPointer()) | |
| 78 | + | return cret | |
| 77 | 79 | } | |
| 78 | 80 | ||
| 79 | 81 | var xProxyAddressGetPassword func(uintptr) string | |
| @@ -81,8 +83,8 @@ var xProxyAddressGetPassword func(uintptr) string | |||
| 81 | 83 | // Gets @proxy's password. | |
| 82 | 84 | func (x *ProxyAddress) GetPassword() string { | |
| 83 | 85 | ||
| 84 | - | return xProxyAddressGetPassword(x.GoPointer()) | |
| 85 | - | ||
| 86 | + | cret := xProxyAddressGetPassword(x.GoPointer()) | |
| 87 | + | return cret | |
| 86 | 88 | } | |
| 87 | 89 | ||
| 88 | 90 | var xProxyAddressGetProtocol func(uintptr) string | |
| @@ -90,8 +92,8 @@ var xProxyAddressGetProtocol func(uintptr) string | |||
| 90 | 92 | // Gets @proxy's protocol. eg, "socks" or "http" | |
| 91 | 93 | func (x *ProxyAddress) GetProtocol() string { | |
| 92 | 94 | ||
| 93 | - | return xProxyAddressGetProtocol(x.GoPointer()) | |
| 94 | - | ||
| 95 | + | cret := xProxyAddressGetProtocol(x.GoPointer()) | |
| 96 | + | return cret | |
| 95 | 97 | } | |
| 96 | 98 | ||
| 97 | 99 | var xProxyAddressGetUri func(uintptr) string | |
| @@ -99,8 +101,8 @@ var xProxyAddressGetUri func(uintptr) string | |||
| 99 | 101 | // Gets the proxy URI that @proxy was constructed from. | |
| 100 | 102 | func (x *ProxyAddress) GetUri() string { | |
| 101 | 103 | ||
| 102 | - | return xProxyAddressGetUri(x.GoPointer()) | |
| 103 | - | ||
| 104 | + | cret := xProxyAddressGetUri(x.GoPointer()) | |
| 105 | + | return cret | |
| 104 | 106 | } | |
| 105 | 107 | ||
| 106 | 108 | var xProxyAddressGetUsername func(uintptr) string | |
| @@ -108,8 +110,8 @@ var xProxyAddressGetUsername func(uintptr) string | |||
| 108 | 110 | // Gets @proxy's username. | |
| 109 | 111 | func (x *ProxyAddress) GetUsername() string { | |
| 110 | 112 | ||
| 111 | - | return xProxyAddressGetUsername(x.GoPointer()) | |
| 112 | - | ||
| 113 | + | cret := xProxyAddressGetUsername(x.GoPointer()) | |
| 114 | + | return cret | |
| 113 | 115 | } | |
| 114 | 116 | ||
| 115 | 117 | func (c *ProxyAddress) GoPointer() uintptr { | |
| @@ -122,16 +124,16 @@ func (c *ProxyAddress) SetGoPointer(ptr uintptr) { | |||
| 122 | 124 | ||
| 123 | 125 | // Creates a #GSocketAddressEnumerator for @connectable. | |
| 124 | 126 | func (x *ProxyAddress) Enumerate() *SocketAddressEnumerator { | |
| 127 | + | var cls *SocketAddressEnumerator | |
| 125 | 128 | ||
| 126 | - | EnumeratePtr := XGSocketConnectableEnumerate(x.GoPointer()) | |
| 127 | - | if EnumeratePtr == 0 { | |
| 128 | - | return nil | |
| 129 | - | } | |
| 130 | - | ||
| 131 | - | EnumerateCls := &SocketAddressEnumerator{} | |
| 132 | - | EnumerateCls.Ptr = EnumeratePtr | |
| 133 | - | return EnumerateCls | |
| 129 | + | cret := XGSocketConnectableEnumerate(x.GoPointer()) | |
| 134 | 130 | ||
| 131 | + | if cret == 0 { | |
| 132 | + | return cls | |
| 133 | + | } | |
| 134 | + | cls = &SocketAddressEnumerator{} | |
| 135 | + | cls.Ptr = cret | |
| 136 | + | return cls | |
| 135 | 137 | } | |
| 136 | 138 | ||
| 137 | 139 | // Creates a #GSocketAddressEnumerator for @connectable that will | |
| @@ -142,16 +144,16 @@ func (x *ProxyAddress) Enumerate() *SocketAddressEnumerator { | |||
| 142 | 144 | // g_socket_connectable_proxy_enumerate(), this will fall back to | |
| 143 | 145 | // calling g_socket_connectable_enumerate(). | |
| 144 | 146 | func (x *ProxyAddress) ProxyEnumerate() *SocketAddressEnumerator { | |
| 147 | + | var cls *SocketAddressEnumerator | |
| 145 | 148 | ||
| 146 | - | ProxyEnumeratePtr := XGSocketConnectableProxyEnumerate(x.GoPointer()) | |
| 147 | - | if ProxyEnumeratePtr == 0 { | |
| 148 | - | return nil | |
| 149 | - | } | |
| 150 | - | ||
| 151 | - | ProxyEnumerateCls := &SocketAddressEnumerator{} | |
| 152 | - | ProxyEnumerateCls.Ptr = ProxyEnumeratePtr | |
| 153 | - | return ProxyEnumerateCls | |
| 149 | + | cret := XGSocketConnectableProxyEnumerate(x.GoPointer()) | |
| 154 | 150 | ||
| 151 | + | if cret == 0 { | |
| 152 | + | return cls | |
| 153 | + | } | |
| 154 | + | cls = &SocketAddressEnumerator{} | |
| 155 | + | cls.Ptr = cret | |
| 156 | + | return cls | |
| 155 | 157 | } | |
| 156 | 158 | ||
| 157 | 159 | // Format a #GSocketConnectable as a string. This is a human-readable format for | |
| @@ -163,8 +165,8 @@ func (x *ProxyAddress) ProxyEnumerate() *SocketAddressEnumerator { | |||
| 163 | 165 | // the implementation’s type name will be returned as a fallback. | |
| 164 | 166 | func (x *ProxyAddress) ToString() string { | |
| 165 | 167 | ||
| 166 | - | return XGSocketConnectableToString(x.GoPointer()) | |
| 167 | - | ||
| 168 | + | cret := XGSocketConnectableToString(x.GoPointer()) | |
| 169 | + | return cret | |
| 168 | 170 | } | |
| 169 | 171 | ||
| 170 | 172 | func init() { | |
M v4/gio/gproxyresolver.go +28 -18
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -44,8 +45,8 @@ func (x *ProxyResolverBase) SetGoPointer(ptr uintptr) { | |||
| 44 | 45 | // resolver that returns %TRUE for this method.) | |
| 45 | 46 | func (x *ProxyResolverBase) IsSupported() bool { | |
| 46 | 47 | ||
| 47 | - | return XGProxyResolverIsSupported(x.GoPointer()) | |
| 48 | - | ||
| 48 | + | cret := XGProxyResolverIsSupported(x.GoPointer()) | |
| 49 | + | return cret | |
| 49 | 50 | } | |
| 50 | 51 | ||
| 51 | 52 | // Looks into the system proxy configuration to determine what proxy, | |
| @@ -63,9 +64,14 @@ func (x *ProxyResolverBase) IsSupported() bool { | |||
| 63 | 64 | // `direct://` is used when no proxy is needed. | |
| 64 | 65 | // Direct connection should not be attempted unless it is part of the | |
| 65 | 66 | // returned array of proxies. | |
| 66 | - | func (x *ProxyResolverBase) Lookup(UriVar string, CancellableVar *Cancellable) uintptr { | |
| 67 | + | func (x *ProxyResolverBase) Lookup(UriVar string, CancellableVar *Cancellable) (uintptr, error) { | |
| 68 | + | var cerr *glib.Error | |
| 67 | 69 | ||
| 68 | - | return XGProxyResolverLookup(x.GoPointer(), UriVar, CancellableVar.GoPointer()) | |
| 70 | + | cret := XGProxyResolverLookup(x.GoPointer(), UriVar, CancellableVar.GoPointer(), &cerr) | |
| 71 | + | if cerr == nil { | |
| 72 | + | return cret, nil | |
| 73 | + | } | |
| 74 | + | return cret, cerr | |
| 69 | 75 | ||
| 70 | 76 | } | |
| 71 | 77 | ||
| @@ -80,33 +86,37 @@ func (x *ProxyResolverBase) LookupAsync(UriVar string, CancellableVar *Cancellab | |||
| 80 | 86 | // Call this function to obtain the array of proxy URIs when | |
| 81 | 87 | // g_proxy_resolver_lookup_async() is complete. See | |
| 82 | 88 | // g_proxy_resolver_lookup() for more details. | |
| 83 | - | func (x *ProxyResolverBase) LookupFinish(ResultVar AsyncResult) uintptr { | |
| 89 | + | func (x *ProxyResolverBase) LookupFinish(ResultVar AsyncResult) (uintptr, error) { | |
| 90 | + | var cerr *glib.Error | |
| 84 | 91 | ||
| 85 | - | return XGProxyResolverLookupFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 92 | + | cret := XGProxyResolverLookupFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 93 | + | if cerr == nil { | |
| 94 | + | return cret, nil | |
| 95 | + | } | |
| 96 | + | return cret, cerr | |
| 86 | 97 | ||
| 87 | 98 | } | |
| 88 | 99 | ||
| 89 | 100 | var XGProxyResolverIsSupported func(uintptr) bool | |
| 90 | - | var XGProxyResolverLookup func(uintptr, string, uintptr) uintptr | |
| 101 | + | var XGProxyResolverLookup func(uintptr, string, uintptr, **glib.Error) uintptr | |
| 91 | 102 | var XGProxyResolverLookupAsync func(uintptr, string, uintptr, uintptr, uintptr) | |
| 92 | - | var XGProxyResolverLookupFinish func(uintptr, uintptr) uintptr | |
| 103 | + | var XGProxyResolverLookupFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 93 | 104 | ||
| 94 | 105 | var xProxyResolverGetDefault func() uintptr | |
| 95 | 106 | ||
| 96 | 107 | // Gets the default #GProxyResolver for the system. | |
| 97 | 108 | func ProxyResolverGetDefault() *ProxyResolverBase { | |
| 109 | + | var cls *ProxyResolverBase | |
| 98 | 110 | ||
| 99 | - | ProxyResolverGetDefaultPtr := xProxyResolverGetDefault() | |
| 100 | - | if ProxyResolverGetDefaultPtr == 0 { | |
| 101 | - | return nil | |
| 102 | - | } | |
| 103 | - | ||
| 104 | - | gobject.IncreaseRef(ProxyResolverGetDefaultPtr) | |
| 105 | - | ||
| 106 | - | ProxyResolverGetDefaultCls := &ProxyResolverBase{} | |
| 107 | - | ProxyResolverGetDefaultCls.Ptr = ProxyResolverGetDefaultPtr | |
| 108 | - | return ProxyResolverGetDefaultCls | |
| 111 | + | cret := xProxyResolverGetDefault() | |
| 109 | 112 | ||
| 113 | + | if cret == 0 { | |
| 114 | + | return cls | |
| 115 | + | } | |
| 116 | + | gobject.IncreaseRef(cret) | |
| 117 | + | cls = &ProxyResolverBase{} | |
| 118 | + | cls.Ptr = cret | |
| 119 | + | return cls | |
| 110 | 120 | } | |
| 111 | 121 | ||
| 112 | 122 | func init() { | |
M v4/gio/gresolver.go +80 -30
| @@ -46,7 +46,7 @@ func ResolverNewFromInternalPtr(ptr uintptr) *Resolver { | |||
| 46 | 46 | return cls | |
| 47 | 47 | } | |
| 48 | 48 | ||
| 49 | - | var xResolverLookupByAddress func(uintptr, uintptr, uintptr) string | |
| 49 | + | var xResolverLookupByAddress func(uintptr, uintptr, uintptr, **glib.Error) string | |
| 50 | 50 | ||
| 51 | 51 | // Synchronously reverse-resolves @address to determine its | |
| 52 | 52 | // associated hostname. | |
| @@ -57,9 +57,14 @@ var xResolverLookupByAddress func(uintptr, uintptr, uintptr) string | |||
| 57 | 57 | // If @cancellable is non-%NULL, it can be used to cancel the | |
| 58 | 58 | // operation, in which case @error (if non-%NULL) will be set to | |
| 59 | 59 | // %G_IO_ERROR_CANCELLED. | |
| 60 | - | func (x *Resolver) LookupByAddress(AddressVar *InetAddress, CancellableVar *Cancellable) string { | |
| 60 | + | func (x *Resolver) LookupByAddress(AddressVar *InetAddress, CancellableVar *Cancellable) (string, error) { | |
| 61 | + | var cerr *glib.Error | |
| 61 | 62 | ||
| 62 | - | return xResolverLookupByAddress(x.GoPointer(), AddressVar.GoPointer(), CancellableVar.GoPointer()) | |
| 63 | + | cret := xResolverLookupByAddress(x.GoPointer(), AddressVar.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 64 | + | if cerr == nil { | |
| 65 | + | return cret, nil | |
| 66 | + | } | |
| 67 | + | return cret, cerr | |
| 63 | 68 | ||
| 64 | 69 | } | |
| 65 | 70 | ||
| @@ -74,7 +79,7 @@ func (x *Resolver) LookupByAddressAsync(AddressVar *InetAddress, CancellableVar | |||
| 74 | 79 | ||
| 75 | 80 | } | |
| 76 | 81 | ||
| 77 | - | var xResolverLookupByAddressFinish func(uintptr, uintptr) string | |
| 82 | + | var xResolverLookupByAddressFinish func(uintptr, uintptr, **glib.Error) string | |
| 78 | 83 | ||
| 79 | 84 | // Retrieves the result of a previous call to | |
| 80 | 85 | // g_resolver_lookup_by_address_async(). | |
| @@ -82,13 +87,18 @@ var xResolverLookupByAddressFinish func(uintptr, uintptr) string | |||
| 82 | 87 | // If the DNS resolution failed, @error (if non-%NULL) will be set to | |
| 83 | 88 | // a value from #GResolverError. If the operation was cancelled, | |
| 84 | 89 | // @error will be set to %G_IO_ERROR_CANCELLED. | |
| 85 | - | func (x *Resolver) LookupByAddressFinish(ResultVar AsyncResult) string { | |
| 90 | + | func (x *Resolver) LookupByAddressFinish(ResultVar AsyncResult) (string, error) { | |
| 91 | + | var cerr *glib.Error | |
| 86 | 92 | ||
| 87 | - | return xResolverLookupByAddressFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 93 | + | cret := xResolverLookupByAddressFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 94 | + | if cerr == nil { | |
| 95 | + | return cret, nil | |
| 96 | + | } | |
| 97 | + | return cret, cerr | |
| 88 | 98 | ||
| 89 | 99 | } | |
| 90 | 100 | ||
| 91 | - | var xResolverLookupByName func(uintptr, string, uintptr) *glib.List | |
| 101 | + | var xResolverLookupByName func(uintptr, string, uintptr, **glib.Error) *glib.List | |
| 92 | 102 | ||
| 93 | 103 | // Synchronously resolves @hostname to determine its associated IP | |
| 94 | 104 | // address(es). @hostname may be an ASCII-only or UTF-8 hostname, or | |
| @@ -113,9 +123,14 @@ var xResolverLookupByName func(uintptr, string, uintptr) *glib.List | |||
| 113 | 123 | // If you are planning to connect to a socket on the resolved IP | |
| 114 | 124 | // address, it may be easier to create a #GNetworkAddress and use its | |
| 115 | 125 | // #GSocketConnectable interface. | |
| 116 | - | func (x *Resolver) LookupByName(HostnameVar string, CancellableVar *Cancellable) *glib.List { | |
| 126 | + | func (x *Resolver) LookupByName(HostnameVar string, CancellableVar *Cancellable) (*glib.List, error) { | |
| 127 | + | var cerr *glib.Error | |
| 117 | 128 | ||
| 118 | - | return xResolverLookupByName(x.GoPointer(), HostnameVar, CancellableVar.GoPointer()) | |
| 129 | + | cret := xResolverLookupByName(x.GoPointer(), HostnameVar, CancellableVar.GoPointer(), &cerr) | |
| 130 | + | if cerr == nil { | |
| 131 | + | return cret, nil | |
| 132 | + | } | |
| 133 | + | return cret, cerr | |
| 119 | 134 | ||
| 120 | 135 | } | |
| 121 | 136 | ||
| @@ -131,7 +146,7 @@ func (x *Resolver) LookupByNameAsync(HostnameVar string, CancellableVar *Cancell | |||
| 131 | 146 | ||
| 132 | 147 | } | |
| 133 | 148 | ||
| 134 | - | var xResolverLookupByNameFinish func(uintptr, uintptr) *glib.List | |
| 149 | + | var xResolverLookupByNameFinish func(uintptr, uintptr, **glib.Error) *glib.List | |
| 135 | 150 | ||
| 136 | 151 | // Retrieves the result of a call to | |
| 137 | 152 | // g_resolver_lookup_by_name_async(). | |
| @@ -139,20 +154,30 @@ var xResolverLookupByNameFinish func(uintptr, uintptr) *glib.List | |||
| 139 | 154 | // If the DNS resolution failed, @error (if non-%NULL) will be set to | |
| 140 | 155 | // a value from #GResolverError. If the operation was cancelled, | |
| 141 | 156 | // @error will be set to %G_IO_ERROR_CANCELLED. | |
| 142 | - | func (x *Resolver) LookupByNameFinish(ResultVar AsyncResult) *glib.List { | |
| 157 | + | func (x *Resolver) LookupByNameFinish(ResultVar AsyncResult) (*glib.List, error) { | |
| 158 | + | var cerr *glib.Error | |
| 143 | 159 | ||
| 144 | - | return xResolverLookupByNameFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 160 | + | cret := xResolverLookupByNameFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 161 | + | if cerr == nil { | |
| 162 | + | return cret, nil | |
| 163 | + | } | |
| 164 | + | return cret, cerr | |
| 145 | 165 | ||
| 146 | 166 | } | |
| 147 | 167 | ||
| 148 | - | var xResolverLookupByNameWithFlags func(uintptr, string, ResolverNameLookupFlags, uintptr) *glib.List | |
| 168 | + | var xResolverLookupByNameWithFlags func(uintptr, string, ResolverNameLookupFlags, uintptr, **glib.Error) *glib.List | |
| 149 | 169 | ||
| 150 | 170 | // This differs from g_resolver_lookup_by_name() in that you can modify | |
| 151 | 171 | // the lookup behavior with @flags. For example this can be used to limit | |
| 152 | 172 | // results with %G_RESOLVER_NAME_LOOKUP_FLAGS_IPV4_ONLY. | |
| 153 | - | func (x *Resolver) LookupByNameWithFlags(HostnameVar string, FlagsVar ResolverNameLookupFlags, CancellableVar *Cancellable) *glib.List { | |
| 173 | + | func (x *Resolver) LookupByNameWithFlags(HostnameVar string, FlagsVar ResolverNameLookupFlags, CancellableVar *Cancellable) (*glib.List, error) { | |
| 174 | + | var cerr *glib.Error | |
| 154 | 175 | ||
| 155 | - | return xResolverLookupByNameWithFlags(x.GoPointer(), HostnameVar, FlagsVar, CancellableVar.GoPointer()) | |
| 176 | + | cret := xResolverLookupByNameWithFlags(x.GoPointer(), HostnameVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 177 | + | if cerr == nil { | |
| 178 | + | return cret, nil | |
| 179 | + | } | |
| 180 | + | return cret, cerr | |
| 156 | 181 | ||
| 157 | 182 | } | |
| 158 | 183 | ||
| @@ -168,7 +193,7 @@ func (x *Resolver) LookupByNameWithFlagsAsync(HostnameVar string, FlagsVar Resol | |||
| 168 | 193 | ||
| 169 | 194 | } | |
| 170 | 195 | ||
| 171 | - | var xResolverLookupByNameWithFlagsFinish func(uintptr, uintptr) *glib.List | |
| 196 | + | var xResolverLookupByNameWithFlagsFinish func(uintptr, uintptr, **glib.Error) *glib.List | |
| 172 | 197 | ||
| 173 | 198 | // Retrieves the result of a call to | |
| 174 | 199 | // g_resolver_lookup_by_name_with_flags_async(). | |
| @@ -176,13 +201,18 @@ var xResolverLookupByNameWithFlagsFinish func(uintptr, uintptr) *glib.List | |||
| 176 | 201 | // If the DNS resolution failed, @error (if non-%NULL) will be set to | |
| 177 | 202 | // a value from #GResolverError. If the operation was cancelled, | |
| 178 | 203 | // @error will be set to %G_IO_ERROR_CANCELLED. | |
| 179 | - | func (x *Resolver) LookupByNameWithFlagsFinish(ResultVar AsyncResult) *glib.List { | |
| 204 | + | func (x *Resolver) LookupByNameWithFlagsFinish(ResultVar AsyncResult) (*glib.List, error) { | |
| 205 | + | var cerr *glib.Error | |
| 180 | 206 | ||
| 181 | - | return xResolverLookupByNameWithFlagsFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 207 | + | cret := xResolverLookupByNameWithFlagsFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 208 | + | if cerr == nil { | |
| 209 | + | return cret, nil | |
| 210 | + | } | |
| 211 | + | return cret, cerr | |
| 182 | 212 | ||
| 183 | 213 | } | |
| 184 | 214 | ||
| 185 | - | var xResolverLookupRecords func(uintptr, string, ResolverRecordType, uintptr) *glib.List | |
| 215 | + | var xResolverLookupRecords func(uintptr, string, ResolverRecordType, uintptr, **glib.Error) *glib.List | |
| 186 | 216 | ||
| 187 | 217 | // Synchronously performs a DNS record lookup for the given @rrname and returns | |
| 188 | 218 | // a list of records as #GVariant tuples. See #GResolverRecordType for | |
| @@ -194,9 +224,14 @@ var xResolverLookupRecords func(uintptr, string, ResolverRecordType, uintptr) *g | |||
| 194 | 224 | // If @cancellable is non-%NULL, it can be used to cancel the | |
| 195 | 225 | // operation, in which case @error (if non-%NULL) will be set to | |
| 196 | 226 | // %G_IO_ERROR_CANCELLED. | |
| 197 | - | func (x *Resolver) LookupRecords(RrnameVar string, RecordTypeVar ResolverRecordType, CancellableVar *Cancellable) *glib.List { | |
| 227 | + | func (x *Resolver) LookupRecords(RrnameVar string, RecordTypeVar ResolverRecordType, CancellableVar *Cancellable) (*glib.List, error) { | |
| 228 | + | var cerr *glib.Error | |
| 198 | 229 | ||
| 199 | - | return xResolverLookupRecords(x.GoPointer(), RrnameVar, RecordTypeVar, CancellableVar.GoPointer()) | |
| 230 | + | cret := xResolverLookupRecords(x.GoPointer(), RrnameVar, RecordTypeVar, CancellableVar.GoPointer(), &cerr) | |
| 231 | + | if cerr == nil { | |
| 232 | + | return cret, nil | |
| 233 | + | } | |
| 234 | + | return cret, cerr | |
| 200 | 235 | ||
| 201 | 236 | } | |
| 202 | 237 | ||
| @@ -212,7 +247,7 @@ func (x *Resolver) LookupRecordsAsync(RrnameVar string, RecordTypeVar ResolverRe | |||
| 212 | 247 | ||
| 213 | 248 | } | |
| 214 | 249 | ||
| 215 | - | var xResolverLookupRecordsFinish func(uintptr, uintptr) *glib.List | |
| 250 | + | var xResolverLookupRecordsFinish func(uintptr, uintptr, **glib.Error) *glib.List | |
| 216 | 251 | ||
| 217 | 252 | // Retrieves the result of a previous call to | |
| 218 | 253 | // g_resolver_lookup_records_async(). Returns a non-empty list of records as | |
| @@ -222,13 +257,18 @@ var xResolverLookupRecordsFinish func(uintptr, uintptr) *glib.List | |||
| 222 | 257 | // If the DNS resolution failed, @error (if non-%NULL) will be set to | |
| 223 | 258 | // a value from #GResolverError. If the operation was cancelled, | |
| 224 | 259 | // @error will be set to %G_IO_ERROR_CANCELLED. | |
| 225 | - | func (x *Resolver) LookupRecordsFinish(ResultVar AsyncResult) *glib.List { | |
| 260 | + | func (x *Resolver) LookupRecordsFinish(ResultVar AsyncResult) (*glib.List, error) { | |
| 261 | + | var cerr *glib.Error | |
| 226 | 262 | ||
| 227 | - | return xResolverLookupRecordsFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 263 | + | cret := xResolverLookupRecordsFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 264 | + | if cerr == nil { | |
| 265 | + | return cret, nil | |
| 266 | + | } | |
| 267 | + | return cret, cerr | |
| 228 | 268 | ||
| 229 | 269 | } | |
| 230 | 270 | ||
| 231 | - | var xResolverLookupService func(uintptr, string, string, string, uintptr) *glib.List | |
| 271 | + | var xResolverLookupService func(uintptr, string, string, string, uintptr, **glib.Error) *glib.List | |
| 232 | 272 | ||
| 233 | 273 | // Synchronously performs a DNS SRV lookup for the given @service and | |
| 234 | 274 | // @protocol in the given @domain and returns an array of #GSrvTarget. | |
| @@ -251,9 +291,14 @@ var xResolverLookupService func(uintptr, string, string, string, uintptr) *glib. | |||
| 251 | 291 | // If you are planning to connect to the service, it is usually easier | |
| 252 | 292 | // to create a #GNetworkService and use its #GSocketConnectable | |
| 253 | 293 | // interface. | |
| 254 | - | func (x *Resolver) LookupService(ServiceVar string, ProtocolVar string, DomainVar string, CancellableVar *Cancellable) *glib.List { | |
| 294 | + | func (x *Resolver) LookupService(ServiceVar string, ProtocolVar string, DomainVar string, CancellableVar *Cancellable) (*glib.List, error) { | |
| 295 | + | var cerr *glib.Error | |
| 255 | 296 | ||
| 256 | - | return xResolverLookupService(x.GoPointer(), ServiceVar, ProtocolVar, DomainVar, CancellableVar.GoPointer()) | |
| 297 | + | cret := xResolverLookupService(x.GoPointer(), ServiceVar, ProtocolVar, DomainVar, CancellableVar.GoPointer(), &cerr) | |
| 298 | + | if cerr == nil { | |
| 299 | + | return cret, nil | |
| 300 | + | } | |
| 301 | + | return cret, cerr | |
| 257 | 302 | ||
| 258 | 303 | } | |
| 259 | 304 | ||
| @@ -270,7 +315,7 @@ func (x *Resolver) LookupServiceAsync(ServiceVar string, ProtocolVar string, Dom | |||
| 270 | 315 | ||
| 271 | 316 | } | |
| 272 | 317 | ||
| 273 | - | var xResolverLookupServiceFinish func(uintptr, uintptr) *glib.List | |
| 318 | + | var xResolverLookupServiceFinish func(uintptr, uintptr, **glib.Error) *glib.List | |
| 274 | 319 | ||
| 275 | 320 | // Retrieves the result of a previous call to | |
| 276 | 321 | // g_resolver_lookup_service_async(). | |
| @@ -278,9 +323,14 @@ var xResolverLookupServiceFinish func(uintptr, uintptr) *glib.List | |||
| 278 | 323 | // If the DNS resolution failed, @error (if non-%NULL) will be set to | |
| 279 | 324 | // a value from #GResolverError. If the operation was cancelled, | |
| 280 | 325 | // @error will be set to %G_IO_ERROR_CANCELLED. | |
| 281 | - | func (x *Resolver) LookupServiceFinish(ResultVar AsyncResult) *glib.List { | |
| 326 | + | func (x *Resolver) LookupServiceFinish(ResultVar AsyncResult) (*glib.List, error) { | |
| 327 | + | var cerr *glib.Error | |
| 282 | 328 | ||
| 283 | - | return xResolverLookupServiceFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 329 | + | cret := xResolverLookupServiceFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 330 | + | if cerr == nil { | |
| 331 | + | return cret, nil | |
| 332 | + | } | |
| 333 | + | return cret, cerr | |
| 284 | 334 | ||
| 285 | 335 | } | |
| 286 | 336 | ||
M v4/gio/gresource.go +46 -21
| @@ -21,7 +21,7 @@ type StaticResource struct { | |||
| 21 | 21 | Padding uintptr | |
| 22 | 22 | } | |
| 23 | 23 | ||
| 24 | - | var xResourceLoad func(string) *Resource | |
| 24 | + | var xResourceLoad func(string, **glib.Error) *Resource | |
| 25 | 25 | ||
| 26 | 26 | // Loads a binary resource bundle and creates a #GResource representation of it, allowing | |
| 27 | 27 | // you to query it for data. | |
| @@ -33,13 +33,18 @@ var xResourceLoad func(string) *Resource | |||
| 33 | 33 | // %G_RESOURCE_ERROR_INTERNAL will be returned. If @filename doesn’t exist, or | |
| 34 | 34 | // there is an error in reading it, an error from g_mapped_file_new() will be | |
| 35 | 35 | // returned. | |
| 36 | - | func ResourceLoad(FilenameVar string) *Resource { | |
| 36 | + | func ResourceLoad(FilenameVar string) (*Resource, error) { | |
| 37 | + | var cerr *glib.Error | |
| 37 | 38 | ||
| 38 | - | return xResourceLoad(FilenameVar) | |
| 39 | + | cret := xResourceLoad(FilenameVar, &cerr) | |
| 40 | + | if cerr == nil { | |
| 41 | + | return cret, nil | |
| 42 | + | } | |
| 43 | + | return cret, cerr | |
| 39 | 44 | ||
| 40 | 45 | } | |
| 41 | 46 | ||
| 42 | - | var xResourcesEnumerateChildren func(string, ResourceLookupFlags) []string | |
| 47 | + | var xResourcesEnumerateChildren func(string, ResourceLookupFlags, **glib.Error) []string | |
| 43 | 48 | ||
| 44 | 49 | // Returns all the names of children at the specified @path in the set of | |
| 45 | 50 | // globally registered resources. | |
| @@ -47,25 +52,35 @@ var xResourcesEnumerateChildren func(string, ResourceLookupFlags) []string | |||
| 47 | 52 | // be released with g_strfreev(). | |
| 48 | 53 | // | |
| 49 | 54 | // @lookup_flags controls the behaviour of the lookup. | |
| 50 | - | func ResourcesEnumerateChildren(PathVar string, LookupFlagsVar ResourceLookupFlags) []string { | |
| 55 | + | func ResourcesEnumerateChildren(PathVar string, LookupFlagsVar ResourceLookupFlags) ([]string, error) { | |
| 56 | + | var cerr *glib.Error | |
| 51 | 57 | ||
| 52 | - | return xResourcesEnumerateChildren(PathVar, LookupFlagsVar) | |
| 58 | + | cret := xResourcesEnumerateChildren(PathVar, LookupFlagsVar, &cerr) | |
| 59 | + | if cerr == nil { | |
| 60 | + | return cret, nil | |
| 61 | + | } | |
| 62 | + | return cret, cerr | |
| 53 | 63 | ||
| 54 | 64 | } | |
| 55 | 65 | ||
| 56 | - | var xResourcesGetInfo func(string, ResourceLookupFlags, uint, uint32) bool | |
| 66 | + | var xResourcesGetInfo func(string, ResourceLookupFlags, uint, uint32, **glib.Error) bool | |
| 57 | 67 | ||
| 58 | 68 | // Looks for a file at the specified @path in the set of | |
| 59 | 69 | // globally registered resources and if found returns information about it. | |
| 60 | 70 | // | |
| 61 | 71 | // @lookup_flags controls the behaviour of the lookup. | |
| 62 | - | func ResourcesGetInfo(PathVar string, LookupFlagsVar ResourceLookupFlags, SizeVar uint, FlagsVar uint32) bool { | |
| 72 | + | func ResourcesGetInfo(PathVar string, LookupFlagsVar ResourceLookupFlags, SizeVar uint, FlagsVar uint32) (bool, error) { | |
| 73 | + | var cerr *glib.Error | |
| 63 | 74 | ||
| 64 | - | return xResourcesGetInfo(PathVar, LookupFlagsVar, SizeVar, FlagsVar) | |
| 75 | + | cret := xResourcesGetInfo(PathVar, LookupFlagsVar, SizeVar, FlagsVar, &cerr) | |
| 76 | + | if cerr == nil { | |
| 77 | + | return cret, nil | |
| 78 | + | } | |
| 79 | + | return cret, cerr | |
| 65 | 80 | ||
| 66 | 81 | } | |
| 67 | 82 | ||
| 68 | - | var xResourcesLookupData func(string, ResourceLookupFlags) *glib.Bytes | |
| 83 | + | var xResourcesLookupData func(string, ResourceLookupFlags, **glib.Error) *glib.Bytes | |
| 69 | 84 | ||
| 70 | 85 | // Looks for a file at the specified @path in the set of | |
| 71 | 86 | // globally registered resources and returns a #GBytes that | |
| @@ -81,29 +96,39 @@ var xResourcesLookupData func(string, ResourceLookupFlags) *glib.Bytes | |||
| 81 | 96 | // the heap and automatically uncompress the data. | |
| 82 | 97 | // | |
| 83 | 98 | // @lookup_flags controls the behaviour of the lookup. | |
| 84 | - | func ResourcesLookupData(PathVar string, LookupFlagsVar ResourceLookupFlags) *glib.Bytes { | |
| 99 | + | func ResourcesLookupData(PathVar string, LookupFlagsVar ResourceLookupFlags) (*glib.Bytes, error) { | |
| 100 | + | var cerr *glib.Error | |
| 85 | 101 | ||
| 86 | - | return xResourcesLookupData(PathVar, LookupFlagsVar) | |
| 102 | + | cret := xResourcesLookupData(PathVar, LookupFlagsVar, &cerr) | |
| 103 | + | if cerr == nil { | |
| 104 | + | return cret, nil | |
| 105 | + | } | |
| 106 | + | return cret, cerr | |
| 87 | 107 | ||
| 88 | 108 | } | |
| 89 | 109 | ||
| 90 | - | var xResourcesOpenStream func(string, ResourceLookupFlags) uintptr | |
| 110 | + | var xResourcesOpenStream func(string, ResourceLookupFlags, **glib.Error) uintptr | |
| 91 | 111 | ||
| 92 | 112 | // Looks for a file at the specified @path in the set of | |
| 93 | 113 | // globally registered resources and returns a #GInputStream | |
| 94 | 114 | // that lets you read the data. | |
| 95 | 115 | // | |
| 96 | 116 | // @lookup_flags controls the behaviour of the lookup. | |
| 97 | - | func ResourcesOpenStream(PathVar string, LookupFlagsVar ResourceLookupFlags) *InputStream { | |
| 117 | + | func ResourcesOpenStream(PathVar string, LookupFlagsVar ResourceLookupFlags) (*InputStream, error) { | |
| 118 | + | var cls *InputStream | |
| 119 | + | var cerr *glib.Error | |
| 98 | 120 | ||
| 99 | - | ResourcesOpenStreamPtr := xResourcesOpenStream(PathVar, LookupFlagsVar) | |
| 100 | - | if ResourcesOpenStreamPtr == 0 { | |
| 101 | - | return nil | |
| 102 | - | } | |
| 121 | + | cret := xResourcesOpenStream(PathVar, LookupFlagsVar, &cerr) | |
| 103 | 122 | ||
| 104 | - | ResourcesOpenStreamCls := &InputStream{} | |
| 105 | - | ResourcesOpenStreamCls.Ptr = ResourcesOpenStreamPtr | |
| 106 | - | return ResourcesOpenStreamCls | |
| 123 | + | if cret == 0 { | |
| 124 | + | return cls, cerr | |
| 125 | + | } | |
| 126 | + | cls = &InputStream{} | |
| 127 | + | cls.Ptr = cret | |
| 128 | + | if cerr == nil { | |
| 129 | + | return cls, nil | |
| 130 | + | } | |
| 131 | + | return cls, cerr | |
| 107 | 132 | ||
| 108 | 133 | } | |
| 109 | 134 | ||
M v4/gio/gseekable.go +22 -12
| @@ -50,16 +50,16 @@ func (x *SeekableBase) SetGoPointer(ptr uintptr) { | |||
| 50 | 50 | // Tests if the stream supports the #GSeekableIface. | |
| 51 | 51 | func (x *SeekableBase) CanSeek() bool { | |
| 52 | 52 | ||
| 53 | - | return XGSeekableCanSeek(x.GoPointer()) | |
| 54 | - | ||
| 53 | + | cret := XGSeekableCanSeek(x.GoPointer()) | |
| 54 | + | return cret | |
| 55 | 55 | } | |
| 56 | 56 | ||
| 57 | 57 | // Tests if the length of the stream can be adjusted with | |
| 58 | 58 | // g_seekable_truncate(). | |
| 59 | 59 | func (x *SeekableBase) CanTruncate() bool { | |
| 60 | 60 | ||
| 61 | - | return XGSeekableCanTruncate(x.GoPointer()) | |
| 62 | - | ||
| 61 | + | cret := XGSeekableCanTruncate(x.GoPointer()) | |
| 62 | + | return cret | |
| 63 | 63 | } | |
| 64 | 64 | ||
| 65 | 65 | // Seeks in the stream by the given @offset, modified by @type. | |
| @@ -76,17 +76,22 @@ func (x *SeekableBase) CanTruncate() bool { | |||
| 76 | 76 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 77 | 77 | // triggering the cancellable object from another thread. If the operation | |
| 78 | 78 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 79 | - | func (x *SeekableBase) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) bool { | |
| 79 | + | func (x *SeekableBase) Seek(OffsetVar int64, TypeVar glib.SeekType, CancellableVar *Cancellable) (bool, error) { | |
| 80 | + | var cerr *glib.Error | |
| 80 | 81 | ||
| 81 | - | return XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer()) | |
| 82 | + | cret := XGSeekableSeek(x.GoPointer(), OffsetVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 83 | + | if cerr == nil { | |
| 84 | + | return cret, nil | |
| 85 | + | } | |
| 86 | + | return cret, cerr | |
| 82 | 87 | ||
| 83 | 88 | } | |
| 84 | 89 | ||
| 85 | 90 | // Tells the current position within the stream. | |
| 86 | 91 | func (x *SeekableBase) Tell() int64 { | |
| 87 | 92 | ||
| 88 | - | return XGSeekableTell(x.GoPointer()) | |
| 89 | - | ||
| 93 | + | cret := XGSeekableTell(x.GoPointer()) | |
| 94 | + | return cret | |
| 90 | 95 | } | |
| 91 | 96 | ||
| 92 | 97 | // Sets the length of the stream to @offset. If the stream was previously | |
| @@ -98,17 +103,22 @@ func (x *SeekableBase) Tell() int64 { | |||
| 98 | 103 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an | |
| 99 | 104 | // operation was partially finished when the operation was cancelled the | |
| 100 | 105 | // partial result will be returned, without an error. | |
| 101 | - | func (x *SeekableBase) Truncate(OffsetVar int64, CancellableVar *Cancellable) bool { | |
| 106 | + | func (x *SeekableBase) Truncate(OffsetVar int64, CancellableVar *Cancellable) (bool, error) { | |
| 107 | + | var cerr *glib.Error | |
| 102 | 108 | ||
| 103 | - | return XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer()) | |
| 109 | + | cret := XGSeekableTruncate(x.GoPointer(), OffsetVar, CancellableVar.GoPointer(), &cerr) | |
| 110 | + | if cerr == nil { | |
| 111 | + | return cret, nil | |
| 112 | + | } | |
| 113 | + | return cret, cerr | |
| 104 | 114 | ||
| 105 | 115 | } | |
| 106 | 116 | ||
| 107 | 117 | var XGSeekableCanSeek func(uintptr) bool | |
| 108 | 118 | var XGSeekableCanTruncate func(uintptr) bool | |
| 109 | - | var XGSeekableSeek func(uintptr, int64, glib.SeekType, uintptr) bool | |
| 119 | + | var XGSeekableSeek func(uintptr, int64, glib.SeekType, uintptr, **glib.Error) bool | |
| 110 | 120 | var XGSeekableTell func(uintptr) int64 | |
| 111 | - | var XGSeekableTruncate func(uintptr, int64, uintptr) bool | |
| 121 | + | var XGSeekableTruncate func(uintptr, int64, uintptr, **glib.Error) bool | |
| 112 | 122 | ||
| 113 | 123 | func init() { | |
| 114 | 124 | lib, err := purego.Dlopen(core.GetPath("GIO"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
M v4/gio/gsettings.go +125 -115
| @@ -386,14 +386,16 @@ var xNewSettings func(string) uintptr | |||
| 386 | 386 | // call to g_settings_new(). The new #GSettings will hold a reference | |
| 387 | 387 | // on the context. See g_main_context_push_thread_default(). | |
| 388 | 388 | func NewSettings(SchemaIdVar string) *Settings { | |
| 389 | - | NewSettingsPtr := xNewSettings(SchemaIdVar) | |
| 390 | - | if NewSettingsPtr == 0 { | |
| 391 | - | return nil | |
| 392 | - | } | |
| 389 | + | var cls *Settings | |
| 390 | + | ||
| 391 | + | cret := xNewSettings(SchemaIdVar) | |
| 393 | 392 | ||
| 394 | - | NewSettingsCls := &Settings{} | |
| 395 | - | NewSettingsCls.Ptr = NewSettingsPtr | |
| 396 | - | return NewSettingsCls | |
| 393 | + | if cret == 0 { | |
| 394 | + | return cls | |
| 395 | + | } | |
| 396 | + | cls = &Settings{} | |
| 397 | + | cls.Ptr = cret | |
| 398 | + | return cls | |
| 397 | 399 | } | |
| 398 | 400 | ||
| 399 | 401 | var xNewFullSettings func(*SettingsSchema, uintptr, string) uintptr | |
| @@ -422,14 +424,16 @@ var xNewFullSettings func(*SettingsSchema, uintptr, string) uintptr | |||
| 422 | 424 | // @path is non-%NULL and not equal to the path that the schema does | |
| 423 | 425 | // have. | |
| 424 | 426 | func NewFullSettings(SchemaVar *SettingsSchema, BackendVar *SettingsBackend, PathVar string) *Settings { | |
| 425 | - | NewFullSettingsPtr := xNewFullSettings(SchemaVar, BackendVar.GoPointer(), PathVar) | |
| 426 | - | if NewFullSettingsPtr == 0 { | |
| 427 | - | return nil | |
| 428 | - | } | |
| 427 | + | var cls *Settings | |
| 428 | + | ||
| 429 | + | cret := xNewFullSettings(SchemaVar, BackendVar.GoPointer(), PathVar) | |
| 429 | 430 | ||
| 430 | - | NewFullSettingsCls := &Settings{} | |
| 431 | - | NewFullSettingsCls.Ptr = NewFullSettingsPtr | |
| 432 | - | return NewFullSettingsCls | |
| 431 | + | if cret == 0 { | |
| 432 | + | return cls | |
| 433 | + | } | |
| 434 | + | cls = &Settings{} | |
| 435 | + | cls.Ptr = cret | |
| 436 | + | return cls | |
| 433 | 437 | } | |
| 434 | 438 | ||
| 435 | 439 | var xNewWithBackendSettings func(string, uintptr) uintptr | |
| @@ -443,14 +447,16 @@ var xNewWithBackendSettings func(string, uintptr) uintptr | |||
| 443 | 447 | // the system to get a settings object that modifies the system default | |
| 444 | 448 | // settings instead of the settings for this user. | |
| 445 | 449 | func NewWithBackendSettings(SchemaIdVar string, BackendVar *SettingsBackend) *Settings { | |
| 446 | - | NewWithBackendSettingsPtr := xNewWithBackendSettings(SchemaIdVar, BackendVar.GoPointer()) | |
| 447 | - | if NewWithBackendSettingsPtr == 0 { | |
| 448 | - | return nil | |
| 449 | - | } | |
| 450 | + | var cls *Settings | |
| 451 | + | ||
| 452 | + | cret := xNewWithBackendSettings(SchemaIdVar, BackendVar.GoPointer()) | |
| 450 | 453 | ||
| 451 | - | NewWithBackendSettingsCls := &Settings{} | |
| 452 | - | NewWithBackendSettingsCls.Ptr = NewWithBackendSettingsPtr | |
| 453 | - | return NewWithBackendSettingsCls | |
| 454 | + | if cret == 0 { | |
| 455 | + | return cls | |
| 456 | + | } | |
| 457 | + | cls = &Settings{} | |
| 458 | + | cls.Ptr = cret | |
| 459 | + | return cls | |
| 454 | 460 | } | |
| 455 | 461 | ||
| 456 | 462 | var xNewWithBackendAndPathSettings func(string, uintptr, string) uintptr | |
| @@ -461,14 +467,16 @@ var xNewWithBackendAndPathSettings func(string, uintptr, string) uintptr | |||
| 461 | 467 | // This is a mix of g_settings_new_with_backend() and | |
| 462 | 468 | // g_settings_new_with_path(). | |
| 463 | 469 | func NewWithBackendAndPathSettings(SchemaIdVar string, BackendVar *SettingsBackend, PathVar string) *Settings { | |
| 464 | - | NewWithBackendAndPathSettingsPtr := xNewWithBackendAndPathSettings(SchemaIdVar, BackendVar.GoPointer(), PathVar) | |
| 465 | - | if NewWithBackendAndPathSettingsPtr == 0 { | |
| 466 | - | return nil | |
| 467 | - | } | |
| 470 | + | var cls *Settings | |
| 471 | + | ||
| 472 | + | cret := xNewWithBackendAndPathSettings(SchemaIdVar, BackendVar.GoPointer(), PathVar) | |
| 468 | 473 | ||
| 469 | - | NewWithBackendAndPathSettingsCls := &Settings{} | |
| 470 | - | NewWithBackendAndPathSettingsCls.Ptr = NewWithBackendAndPathSettingsPtr | |
| 471 | - | return NewWithBackendAndPathSettingsCls | |
| 474 | + | if cret == 0 { | |
| 475 | + | return cls | |
| 476 | + | } | |
| 477 | + | cls = &Settings{} | |
| 478 | + | cls.Ptr = cret | |
| 479 | + | return cls | |
| 472 | 480 | } | |
| 473 | 481 | ||
| 474 | 482 | var xNewWithPathSettings func(string, string) uintptr | |
| @@ -487,14 +495,16 @@ var xNewWithPathSettings func(string, string) uintptr | |||
| 487 | 495 | // begins and ends with '/' and does not contain two consecutive '/' | |
| 488 | 496 | // characters. | |
| 489 | 497 | func NewWithPathSettings(SchemaIdVar string, PathVar string) *Settings { | |
| 490 | - | NewWithPathSettingsPtr := xNewWithPathSettings(SchemaIdVar, PathVar) | |
| 491 | - | if NewWithPathSettingsPtr == 0 { | |
| 492 | - | return nil | |
| 493 | - | } | |
| 498 | + | var cls *Settings | |
| 494 | 499 | ||
| 495 | - | NewWithPathSettingsCls := &Settings{} | |
| 496 | - | NewWithPathSettingsCls.Ptr = NewWithPathSettingsPtr | |
| 497 | - | return NewWithPathSettingsCls | |
| 500 | + | cret := xNewWithPathSettings(SchemaIdVar, PathVar) | |
| 501 | + | ||
| 502 | + | if cret == 0 { | |
| 503 | + | return cls | |
| 504 | + | } | |
| 505 | + | cls = &Settings{} | |
| 506 | + | cls.Ptr = cret | |
| 507 | + | return cls | |
| 498 | 508 | } | |
| 499 | 509 | ||
| 500 | 510 | var xSettingsApply func(uintptr) | |
| @@ -597,16 +607,16 @@ var xSettingsCreateAction func(uintptr, string) uintptr | |||
| 597 | 607 | // activations take the new value for the key (which must have the | |
| 598 | 608 | // correct type). | |
| 599 | 609 | func (x *Settings) CreateAction(KeyVar string) *ActionBase { | |
| 610 | + | var cls *ActionBase | |
| 600 | 611 | ||
| 601 | - | CreateActionPtr := xSettingsCreateAction(x.GoPointer(), KeyVar) | |
| 602 | - | if CreateActionPtr == 0 { | |
| 603 | - | return nil | |
| 604 | - | } | |
| 605 | - | ||
| 606 | - | CreateActionCls := &ActionBase{} | |
| 607 | - | CreateActionCls.Ptr = CreateActionPtr | |
| 608 | - | return CreateActionCls | |
| 612 | + | cret := xSettingsCreateAction(x.GoPointer(), KeyVar) | |
| 609 | 613 | ||
| 614 | + | if cret == 0 { | |
| 615 | + | return cls | |
| 616 | + | } | |
| 617 | + | cls = &ActionBase{} | |
| 618 | + | cls.Ptr = cret | |
| 619 | + | return cls | |
| 610 | 620 | } | |
| 611 | 621 | ||
| 612 | 622 | var xSettingsDelay func(uintptr) | |
| @@ -646,8 +656,8 @@ var xSettingsGetBoolean func(uintptr, string) bool | |||
| 646 | 656 | // having a boolean type in the schema for @settings. | |
| 647 | 657 | func (x *Settings) GetBoolean(KeyVar string) bool { | |
| 648 | 658 | ||
| 649 | - | return xSettingsGetBoolean(x.GoPointer(), KeyVar) | |
| 650 | - | ||
| 659 | + | cret := xSettingsGetBoolean(x.GoPointer(), KeyVar) | |
| 660 | + | return cret | |
| 651 | 661 | } | |
| 652 | 662 | ||
| 653 | 663 | var xSettingsGetChild func(uintptr, string) uintptr | |
| @@ -662,16 +672,16 @@ var xSettingsGetChild func(uintptr, string) uintptr | |||
| 662 | 672 | // The created child settings object will inherit the #GSettings:delay-apply | |
| 663 | 673 | // mode from @settings. | |
| 664 | 674 | func (x *Settings) GetChild(NameVar string) *Settings { | |
| 675 | + | var cls *Settings | |
| 665 | 676 | ||
| 666 | - | GetChildPtr := xSettingsGetChild(x.GoPointer(), NameVar) | |
| 667 | - | if GetChildPtr == 0 { | |
| 668 | - | return nil | |
| 669 | - | } | |
| 670 | - | ||
| 671 | - | GetChildCls := &Settings{} | |
| 672 | - | GetChildCls.Ptr = GetChildPtr | |
| 673 | - | return GetChildCls | |
| 677 | + | cret := xSettingsGetChild(x.GoPointer(), NameVar) | |
| 674 | 678 | ||
| 679 | + | if cret == 0 { | |
| 680 | + | return cls | |
| 681 | + | } | |
| 682 | + | cls = &Settings{} | |
| 683 | + | cls.Ptr = cret | |
| 684 | + | return cls | |
| 675 | 685 | } | |
| 676 | 686 | ||
| 677 | 687 | var xSettingsGetDefaultValue func(uintptr, string) *glib.Variant | |
| @@ -699,8 +709,8 @@ var xSettingsGetDefaultValue func(uintptr, string) *glib.Variant | |||
| 699 | 709 | // schema for @settings. | |
| 700 | 710 | func (x *Settings) GetDefaultValue(KeyVar string) *glib.Variant { | |
| 701 | 711 | ||
| 702 | - | return xSettingsGetDefaultValue(x.GoPointer(), KeyVar) | |
| 703 | - | ||
| 712 | + | cret := xSettingsGetDefaultValue(x.GoPointer(), KeyVar) | |
| 713 | + | return cret | |
| 704 | 714 | } | |
| 705 | 715 | ||
| 706 | 716 | var xSettingsGetDouble func(uintptr, string) float64 | |
| @@ -713,8 +723,8 @@ var xSettingsGetDouble func(uintptr, string) float64 | |||
| 713 | 723 | // having a 'double' type in the schema for @settings. | |
| 714 | 724 | func (x *Settings) GetDouble(KeyVar string) float64 { | |
| 715 | 725 | ||
| 716 | - | return xSettingsGetDouble(x.GoPointer(), KeyVar) | |
| 717 | - | ||
| 726 | + | cret := xSettingsGetDouble(x.GoPointer(), KeyVar) | |
| 727 | + | return cret | |
| 718 | 728 | } | |
| 719 | 729 | ||
| 720 | 730 | var xSettingsGetEnum func(uintptr, string) int | |
| @@ -733,8 +743,8 @@ var xSettingsGetEnum func(uintptr, string) int | |||
| 733 | 743 | // default value. | |
| 734 | 744 | func (x *Settings) GetEnum(KeyVar string) int { | |
| 735 | 745 | ||
| 736 | - | return xSettingsGetEnum(x.GoPointer(), KeyVar) | |
| 737 | - | ||
| 746 | + | cret := xSettingsGetEnum(x.GoPointer(), KeyVar) | |
| 747 | + | return cret | |
| 738 | 748 | } | |
| 739 | 749 | ||
| 740 | 750 | var xSettingsGetFlags func(uintptr, string) uint | |
| @@ -753,8 +763,8 @@ var xSettingsGetFlags func(uintptr, string) uint | |||
| 753 | 763 | // value. | |
| 754 | 764 | func (x *Settings) GetFlags(KeyVar string) uint { | |
| 755 | 765 | ||
| 756 | - | return xSettingsGetFlags(x.GoPointer(), KeyVar) | |
| 757 | - | ||
| 766 | + | cret := xSettingsGetFlags(x.GoPointer(), KeyVar) | |
| 767 | + | return cret | |
| 758 | 768 | } | |
| 759 | 769 | ||
| 760 | 770 | var xSettingsGetHasUnapplied func(uintptr) bool | |
| @@ -763,8 +773,8 @@ var xSettingsGetHasUnapplied func(uintptr) bool | |||
| 763 | 773 | // changes. This can only be the case if it is in 'delayed-apply' mode. | |
| 764 | 774 | func (x *Settings) GetHasUnapplied() bool { | |
| 765 | 775 | ||
| 766 | - | return xSettingsGetHasUnapplied(x.GoPointer()) | |
| 767 | - | ||
| 776 | + | cret := xSettingsGetHasUnapplied(x.GoPointer()) | |
| 777 | + | return cret | |
| 768 | 778 | } | |
| 769 | 779 | ||
| 770 | 780 | var xSettingsGetInt func(uintptr, string) int | |
| @@ -777,8 +787,8 @@ var xSettingsGetInt func(uintptr, string) int | |||
| 777 | 787 | // having a int32 type in the schema for @settings. | |
| 778 | 788 | func (x *Settings) GetInt(KeyVar string) int { | |
| 779 | 789 | ||
| 780 | - | return xSettingsGetInt(x.GoPointer(), KeyVar) | |
| 781 | - | ||
| 790 | + | cret := xSettingsGetInt(x.GoPointer(), KeyVar) | |
| 791 | + | return cret | |
| 782 | 792 | } | |
| 783 | 793 | ||
| 784 | 794 | var xSettingsGetInt64 func(uintptr, string) int64 | |
| @@ -791,8 +801,8 @@ var xSettingsGetInt64 func(uintptr, string) int64 | |||
| 791 | 801 | // having a int64 type in the schema for @settings. | |
| 792 | 802 | func (x *Settings) GetInt64(KeyVar string) int64 { | |
| 793 | 803 | ||
| 794 | - | return xSettingsGetInt64(x.GoPointer(), KeyVar) | |
| 795 | - | ||
| 804 | + | cret := xSettingsGetInt64(x.GoPointer(), KeyVar) | |
| 805 | + | return cret | |
| 796 | 806 | } | |
| 797 | 807 | ||
| 798 | 808 | var xSettingsGetMapped func(uintptr, string, uintptr, uintptr) uintptr | |
| @@ -826,8 +836,8 @@ var xSettingsGetMapped func(uintptr, string, uintptr, uintptr) uintptr | |||
| 826 | 836 | // just as any other value would be. | |
| 827 | 837 | func (x *Settings) GetMapped(KeyVar string, MappingVar SettingsGetMapping, UserDataVar uintptr) uintptr { | |
| 828 | 838 | ||
| 829 | - | return xSettingsGetMapped(x.GoPointer(), KeyVar, purego.NewCallback(MappingVar), UserDataVar) | |
| 830 | - | ||
| 839 | + | cret := xSettingsGetMapped(x.GoPointer(), KeyVar, purego.NewCallback(MappingVar), UserDataVar) | |
| 840 | + | return cret | |
| 831 | 841 | } | |
| 832 | 842 | ||
| 833 | 843 | var xSettingsGetRange func(uintptr, string) *glib.Variant | |
| @@ -835,8 +845,8 @@ var xSettingsGetRange func(uintptr, string) *glib.Variant | |||
| 835 | 845 | // Queries the range of a key. | |
| 836 | 846 | func (x *Settings) GetRange(KeyVar string) *glib.Variant { | |
| 837 | 847 | ||
| 838 | - | return xSettingsGetRange(x.GoPointer(), KeyVar) | |
| 839 | - | ||
| 848 | + | cret := xSettingsGetRange(x.GoPointer(), KeyVar) | |
| 849 | + | return cret | |
| 840 | 850 | } | |
| 841 | 851 | ||
| 842 | 852 | var xSettingsGetString func(uintptr, string) string | |
| @@ -849,8 +859,8 @@ var xSettingsGetString func(uintptr, string) string | |||
| 849 | 859 | // having a string type in the schema for @settings. | |
| 850 | 860 | func (x *Settings) GetString(KeyVar string) string { | |
| 851 | 861 | ||
| 852 | - | return xSettingsGetString(x.GoPointer(), KeyVar) | |
| 853 | - | ||
| 862 | + | cret := xSettingsGetString(x.GoPointer(), KeyVar) | |
| 863 | + | return cret | |
| 854 | 864 | } | |
| 855 | 865 | ||
| 856 | 866 | var xSettingsGetStrv func(uintptr, string) uintptr | |
| @@ -861,8 +871,8 @@ var xSettingsGetStrv func(uintptr, string) uintptr | |||
| 861 | 871 | // having an array of strings type in the schema for @settings. | |
| 862 | 872 | func (x *Settings) GetStrv(KeyVar string) uintptr { | |
| 863 | 873 | ||
| 864 | - | return xSettingsGetStrv(x.GoPointer(), KeyVar) | |
| 865 | - | ||
| 874 | + | cret := xSettingsGetStrv(x.GoPointer(), KeyVar) | |
| 875 | + | return cret | |
| 866 | 876 | } | |
| 867 | 877 | ||
| 868 | 878 | var xSettingsGetUint func(uintptr, string) uint | |
| @@ -876,8 +886,8 @@ var xSettingsGetUint func(uintptr, string) uint | |||
| 876 | 886 | // having a uint32 type in the schema for @settings. | |
| 877 | 887 | func (x *Settings) GetUint(KeyVar string) uint { | |
| 878 | 888 | ||
| 879 | - | return xSettingsGetUint(x.GoPointer(), KeyVar) | |
| 880 | - | ||
| 889 | + | cret := xSettingsGetUint(x.GoPointer(), KeyVar) | |
| 890 | + | return cret | |
| 881 | 891 | } | |
| 882 | 892 | ||
| 883 | 893 | var xSettingsGetUint64 func(uintptr, string) uint64 | |
| @@ -891,8 +901,8 @@ var xSettingsGetUint64 func(uintptr, string) uint64 | |||
| 891 | 901 | // having a uint64 type in the schema for @settings. | |
| 892 | 902 | func (x *Settings) GetUint64(KeyVar string) uint64 { | |
| 893 | 903 | ||
| 894 | - | return xSettingsGetUint64(x.GoPointer(), KeyVar) | |
| 895 | - | ||
| 904 | + | cret := xSettingsGetUint64(x.GoPointer(), KeyVar) | |
| 905 | + | return cret | |
| 896 | 906 | } | |
| 897 | 907 | ||
| 898 | 908 | var xSettingsGetUserValue func(uintptr, string) *glib.Variant | |
| @@ -917,8 +927,8 @@ var xSettingsGetUserValue func(uintptr, string) *glib.Variant | |||
| 917 | 927 | // schema for @settings. | |
| 918 | 928 | func (x *Settings) GetUserValue(KeyVar string) *glib.Variant { | |
| 919 | 929 | ||
| 920 | - | return xSettingsGetUserValue(x.GoPointer(), KeyVar) | |
| 921 | - | ||
| 930 | + | cret := xSettingsGetUserValue(x.GoPointer(), KeyVar) | |
| 931 | + | return cret | |
| 922 | 932 | } | |
| 923 | 933 | ||
| 924 | 934 | var xSettingsGetValue func(uintptr, string) *glib.Variant | |
| @@ -929,8 +939,8 @@ var xSettingsGetValue func(uintptr, string) *glib.Variant | |||
| 929 | 939 | // schema for @settings. | |
| 930 | 940 | func (x *Settings) GetValue(KeyVar string) *glib.Variant { | |
| 931 | 941 | ||
| 932 | - | return xSettingsGetValue(x.GoPointer(), KeyVar) | |
| 933 | - | ||
| 942 | + | cret := xSettingsGetValue(x.GoPointer(), KeyVar) | |
| 943 | + | return cret | |
| 934 | 944 | } | |
| 935 | 945 | ||
| 936 | 946 | var xSettingsIsWritable func(uintptr, string) bool | |
| @@ -938,8 +948,8 @@ var xSettingsIsWritable func(uintptr, string) bool | |||
| 938 | 948 | // Finds out if a key can be written or not | |
| 939 | 949 | func (x *Settings) IsWritable(NameVar string) bool { | |
| 940 | 950 | ||
| 941 | - | return xSettingsIsWritable(x.GoPointer(), NameVar) | |
| 942 | - | ||
| 951 | + | cret := xSettingsIsWritable(x.GoPointer(), NameVar) | |
| 952 | + | return cret | |
| 943 | 953 | } | |
| 944 | 954 | ||
| 945 | 955 | var xSettingsListChildren func(uintptr) uintptr | |
| @@ -957,8 +967,8 @@ var xSettingsListChildren func(uintptr) uintptr | |||
| 957 | 967 | // with it. | |
| 958 | 968 | func (x *Settings) ListChildren() uintptr { | |
| 959 | 969 | ||
| 960 | - | return xSettingsListChildren(x.GoPointer()) | |
| 961 | - | ||
| 970 | + | cret := xSettingsListChildren(x.GoPointer()) | |
| 971 | + | return cret | |
| 962 | 972 | } | |
| 963 | 973 | ||
| 964 | 974 | var xSettingsListKeys func(uintptr) uintptr | |
| @@ -973,8 +983,8 @@ var xSettingsListKeys func(uintptr) uintptr | |||
| 973 | 983 | // with it. | |
| 974 | 984 | func (x *Settings) ListKeys() uintptr { | |
| 975 | 985 | ||
| 976 | - | return xSettingsListKeys(x.GoPointer()) | |
| 977 | - | ||
| 986 | + | cret := xSettingsListKeys(x.GoPointer()) | |
| 987 | + | return cret | |
| 978 | 988 | } | |
| 979 | 989 | ||
| 980 | 990 | var xSettingsRangeCheck func(uintptr, string, *glib.Variant) bool | |
| @@ -983,8 +993,8 @@ var xSettingsRangeCheck func(uintptr, string, *glib.Variant) bool | |||
| 983 | 993 | // permitted range for @key. | |
| 984 | 994 | func (x *Settings) RangeCheck(KeyVar string, ValueVar *glib.Variant) bool { | |
| 985 | 995 | ||
| 986 | - | return xSettingsRangeCheck(x.GoPointer(), KeyVar, ValueVar) | |
| 987 | - | ||
| 996 | + | cret := xSettingsRangeCheck(x.GoPointer(), KeyVar, ValueVar) | |
| 997 | + | return cret | |
| 988 | 998 | } | |
| 989 | 999 | ||
| 990 | 1000 | var xSettingsReset func(uintptr, string) | |
| @@ -1026,8 +1036,8 @@ var xSettingsSet func(uintptr, string, string, ...interface{}) bool | |||
| 1026 | 1036 | // the type given in the schema. | |
| 1027 | 1037 | func (x *Settings) Set(KeyVar string, FormatVar string, varArgs ...interface{}) bool { | |
| 1028 | 1038 | ||
| 1029 | - | return xSettingsSet(x.GoPointer(), KeyVar, FormatVar, varArgs...) | |
| 1030 | - | ||
| 1039 | + | cret := xSettingsSet(x.GoPointer(), KeyVar, FormatVar, varArgs...) | |
| 1040 | + | return cret | |
| 1031 | 1041 | } | |
| 1032 | 1042 | ||
| 1033 | 1043 | var xSettingsSetBoolean func(uintptr, string, bool) bool | |
| @@ -1040,8 +1050,8 @@ var xSettingsSetBoolean func(uintptr, string, bool) bool | |||
| 1040 | 1050 | // having a boolean type in the schema for @settings. | |
| 1041 | 1051 | func (x *Settings) SetBoolean(KeyVar string, ValueVar bool) bool { | |
| 1042 | 1052 | ||
| 1043 | - | return xSettingsSetBoolean(x.GoPointer(), KeyVar, ValueVar) | |
| 1044 | - | ||
| 1053 | + | cret := xSettingsSetBoolean(x.GoPointer(), KeyVar, ValueVar) | |
| 1054 | + | return cret | |
| 1045 | 1055 | } | |
| 1046 | 1056 | ||
| 1047 | 1057 | var xSettingsSetDouble func(uintptr, string, float64) bool | |
| @@ -1054,8 +1064,8 @@ var xSettingsSetDouble func(uintptr, string, float64) bool | |||
| 1054 | 1064 | // having a 'double' type in the schema for @settings. | |
| 1055 | 1065 | func (x *Settings) SetDouble(KeyVar string, ValueVar float64) bool { | |
| 1056 | 1066 | ||
| 1057 | - | return xSettingsSetDouble(x.GoPointer(), KeyVar, ValueVar) | |
| 1058 | - | ||
| 1067 | + | cret := xSettingsSetDouble(x.GoPointer(), KeyVar, ValueVar) | |
| 1068 | + | return cret | |
| 1059 | 1069 | } | |
| 1060 | 1070 | ||
| 1061 | 1071 | var xSettingsSetEnum func(uintptr, string, int) bool | |
| @@ -1072,8 +1082,8 @@ var xSettingsSetEnum func(uintptr, string, int) bool | |||
| 1072 | 1082 | // @value. | |
| 1073 | 1083 | func (x *Settings) SetEnum(KeyVar string, ValueVar int) bool { | |
| 1074 | 1084 | ||
| 1075 | - | return xSettingsSetEnum(x.GoPointer(), KeyVar, ValueVar) | |
| 1076 | - | ||
| 1085 | + | cret := xSettingsSetEnum(x.GoPointer(), KeyVar, ValueVar) | |
| 1086 | + | return cret | |
| 1077 | 1087 | } | |
| 1078 | 1088 | ||
| 1079 | 1089 | var xSettingsSetFlags func(uintptr, string, uint) bool | |
| @@ -1091,8 +1101,8 @@ var xSettingsSetFlags func(uintptr, string, uint) bool | |||
| 1091 | 1101 | // bit in @value. | |
| 1092 | 1102 | func (x *Settings) SetFlags(KeyVar string, ValueVar uint) bool { | |
| 1093 | 1103 | ||
| 1094 | - | return xSettingsSetFlags(x.GoPointer(), KeyVar, ValueVar) | |
| 1095 | - | ||
| 1104 | + | cret := xSettingsSetFlags(x.GoPointer(), KeyVar, ValueVar) | |
| 1105 | + | return cret | |
| 1096 | 1106 | } | |
| 1097 | 1107 | ||
| 1098 | 1108 | var xSettingsSetInt func(uintptr, string, int) bool | |
| @@ -1105,8 +1115,8 @@ var xSettingsSetInt func(uintptr, string, int) bool | |||
| 1105 | 1115 | // having a int32 type in the schema for @settings. | |
| 1106 | 1116 | func (x *Settings) SetInt(KeyVar string, ValueVar int) bool { | |
| 1107 | 1117 | ||
| 1108 | - | return xSettingsSetInt(x.GoPointer(), KeyVar, ValueVar) | |
| 1109 | - | ||
| 1118 | + | cret := xSettingsSetInt(x.GoPointer(), KeyVar, ValueVar) | |
| 1119 | + | return cret | |
| 1110 | 1120 | } | |
| 1111 | 1121 | ||
| 1112 | 1122 | var xSettingsSetInt64 func(uintptr, string, int64) bool | |
| @@ -1119,8 +1129,8 @@ var xSettingsSetInt64 func(uintptr, string, int64) bool | |||
| 1119 | 1129 | // having a int64 type in the schema for @settings. | |
| 1120 | 1130 | func (x *Settings) SetInt64(KeyVar string, ValueVar int64) bool { | |
| 1121 | 1131 | ||
| 1122 | - | return xSettingsSetInt64(x.GoPointer(), KeyVar, ValueVar) | |
| 1123 | - | ||
| 1132 | + | cret := xSettingsSetInt64(x.GoPointer(), KeyVar, ValueVar) | |
| 1133 | + | return cret | |
| 1124 | 1134 | } | |
| 1125 | 1135 | ||
| 1126 | 1136 | var xSettingsSetString func(uintptr, string, string) bool | |
| @@ -1133,8 +1143,8 @@ var xSettingsSetString func(uintptr, string, string) bool | |||
| 1133 | 1143 | // having a string type in the schema for @settings. | |
| 1134 | 1144 | func (x *Settings) SetString(KeyVar string, ValueVar string) bool { | |
| 1135 | 1145 | ||
| 1136 | - | return xSettingsSetString(x.GoPointer(), KeyVar, ValueVar) | |
| 1137 | - | ||
| 1146 | + | cret := xSettingsSetString(x.GoPointer(), KeyVar, ValueVar) | |
| 1147 | + | return cret | |
| 1138 | 1148 | } | |
| 1139 | 1149 | ||
| 1140 | 1150 | var xSettingsSetStrv func(uintptr, string, uintptr) bool | |
| @@ -1148,8 +1158,8 @@ var xSettingsSetStrv func(uintptr, string, uintptr) bool | |||
| 1148 | 1158 | // having an array of strings type in the schema for @settings. | |
| 1149 | 1159 | func (x *Settings) SetStrv(KeyVar string, ValueVar uintptr) bool { | |
| 1150 | 1160 | ||
| 1151 | - | return xSettingsSetStrv(x.GoPointer(), KeyVar, ValueVar) | |
| 1152 | - | ||
| 1161 | + | cret := xSettingsSetStrv(x.GoPointer(), KeyVar, ValueVar) | |
| 1162 | + | return cret | |
| 1153 | 1163 | } | |
| 1154 | 1164 | ||
| 1155 | 1165 | var xSettingsSetUint func(uintptr, string, uint) bool | |
| @@ -1163,8 +1173,8 @@ var xSettingsSetUint func(uintptr, string, uint) bool | |||
| 1163 | 1173 | // having a uint32 type in the schema for @settings. | |
| 1164 | 1174 | func (x *Settings) SetUint(KeyVar string, ValueVar uint) bool { | |
| 1165 | 1175 | ||
| 1166 | - | return xSettingsSetUint(x.GoPointer(), KeyVar, ValueVar) | |
| 1167 | - | ||
| 1176 | + | cret := xSettingsSetUint(x.GoPointer(), KeyVar, ValueVar) | |
| 1177 | + | return cret | |
| 1168 | 1178 | } | |
| 1169 | 1179 | ||
| 1170 | 1180 | var xSettingsSetUint64 func(uintptr, string, uint64) bool | |
| @@ -1178,8 +1188,8 @@ var xSettingsSetUint64 func(uintptr, string, uint64) bool | |||
| 1178 | 1188 | // having a uint64 type in the schema for @settings. | |
| 1179 | 1189 | func (x *Settings) SetUint64(KeyVar string, ValueVar uint64) bool { | |
| 1180 | 1190 | ||
| 1181 | - | return xSettingsSetUint64(x.GoPointer(), KeyVar, ValueVar) | |
| 1182 | - | ||
| 1191 | + | cret := xSettingsSetUint64(x.GoPointer(), KeyVar, ValueVar) | |
| 1192 | + | return cret | |
| 1183 | 1193 | } | |
| 1184 | 1194 | ||
| 1185 | 1195 | var xSettingsSetValue func(uintptr, string, *glib.Variant) bool | |
| @@ -1193,8 +1203,8 @@ var xSettingsSetValue func(uintptr, string, *glib.Variant) bool | |||
| 1193 | 1203 | // If @value is floating then this function consumes the reference. | |
| 1194 | 1204 | func (x *Settings) SetValue(KeyVar string, ValueVar *glib.Variant) bool { | |
| 1195 | 1205 | ||
| 1196 | - | return xSettingsSetValue(x.GoPointer(), KeyVar, ValueVar) | |
| 1197 | - | ||
| 1206 | + | cret := xSettingsSetValue(x.GoPointer(), KeyVar, ValueVar) | |
| 1207 | + | return cret | |
| 1198 | 1208 | } | |
| 1199 | 1209 | ||
| 1200 | 1210 | func (c *Settings) GoPointer() uintptr { | |
M v4/gio/gsettingsbackend.go +24 -24
| @@ -74,16 +74,16 @@ var xKeyfileSettingsBackendNew func(string, string, string) uintptr | |||
| 74 | 74 | // and a list of locked keys from a text file with the name `locks` in | |
| 75 | 75 | // the same location. | |
| 76 | 76 | func KeyfileSettingsBackendNew(FilenameVar string, RootPathVar string, RootGroupVar string) *SettingsBackend { | |
| 77 | + | var cls *SettingsBackend | |
| 77 | 78 | ||
| 78 | - | KeyfileSettingsBackendNewPtr := xKeyfileSettingsBackendNew(FilenameVar, RootPathVar, RootGroupVar) | |
| 79 | - | if KeyfileSettingsBackendNewPtr == 0 { | |
| 80 | - | return nil | |
| 81 | - | } | |
| 82 | - | ||
| 83 | - | KeyfileSettingsBackendNewCls := &SettingsBackend{} | |
| 84 | - | KeyfileSettingsBackendNewCls.Ptr = KeyfileSettingsBackendNewPtr | |
| 85 | - | return KeyfileSettingsBackendNewCls | |
| 79 | + | cret := xKeyfileSettingsBackendNew(FilenameVar, RootPathVar, RootGroupVar) | |
| 86 | 80 | ||
| 81 | + | if cret == 0 { | |
| 82 | + | return cls | |
| 83 | + | } | |
| 84 | + | cls = &SettingsBackend{} | |
| 85 | + | cls.Ptr = cret | |
| 86 | + | return cls | |
| 87 | 87 | } | |
| 88 | 88 | ||
| 89 | 89 | var xMemorySettingsBackendNew func() uintptr | |
| @@ -94,16 +94,16 @@ var xMemorySettingsBackendNew func() uintptr | |||
| 94 | 94 | // to any backing storage, so the next time you run your application, | |
| 95 | 95 | // the memory backend will start out with the default values again. | |
| 96 | 96 | func MemorySettingsBackendNew() *SettingsBackend { | |
| 97 | + | var cls *SettingsBackend | |
| 97 | 98 | ||
| 98 | - | MemorySettingsBackendNewPtr := xMemorySettingsBackendNew() | |
| 99 | - | if MemorySettingsBackendNewPtr == 0 { | |
| 100 | - | return nil | |
| 101 | - | } | |
| 102 | - | ||
| 103 | - | MemorySettingsBackendNewCls := &SettingsBackend{} | |
| 104 | - | MemorySettingsBackendNewCls.Ptr = MemorySettingsBackendNewPtr | |
| 105 | - | return MemorySettingsBackendNewCls | |
| 99 | + | cret := xMemorySettingsBackendNew() | |
| 106 | 100 | ||
| 101 | + | if cret == 0 { | |
| 102 | + | return cls | |
| 103 | + | } | |
| 104 | + | cls = &SettingsBackend{} | |
| 105 | + | cls.Ptr = cret | |
| 106 | + | return cls | |
| 107 | 107 | } | |
| 108 | 108 | ||
| 109 | 109 | var xNullSettingsBackendNew func() uintptr | |
| @@ -113,16 +113,16 @@ var xNullSettingsBackendNew func() uintptr | |||
| 113 | 113 | // This backend does not allow changes to settings, so all settings | |
| 114 | 114 | // will always have their default values. | |
| 115 | 115 | func NullSettingsBackendNew() *SettingsBackend { | |
| 116 | + | var cls *SettingsBackend | |
| 116 | 117 | ||
| 117 | - | NullSettingsBackendNewPtr := xNullSettingsBackendNew() | |
| 118 | - | if NullSettingsBackendNewPtr == 0 { | |
| 119 | - | return nil | |
| 120 | - | } | |
| 121 | - | ||
| 122 | - | NullSettingsBackendNewCls := &SettingsBackend{} | |
| 123 | - | NullSettingsBackendNewCls.Ptr = NullSettingsBackendNewPtr | |
| 124 | - | return NullSettingsBackendNewCls | |
| 118 | + | cret := xNullSettingsBackendNew() | |
| 125 | 119 | ||
| 120 | + | if cret == 0 { | |
| 121 | + | return cls | |
| 122 | + | } | |
| 123 | + | cls = &SettingsBackend{} | |
| 124 | + | cls.Ptr = cret | |
| 125 | + | return cls | |
| 126 | 126 | } | |
| 127 | 127 | ||
| 128 | 128 | // The #GSettingsBackend interface defines a generic interface for | |
M v4/gio/gsettingsschema.go +2 -2
| @@ -132,8 +132,8 @@ var xSettingsSchemaSourceGetDefault func() *SettingsSchemaSource | |||
| 132 | 132 | // recursively. | |
| 133 | 133 | func SettingsSchemaSourceGetDefault() *SettingsSchemaSource { | |
| 134 | 134 | ||
| 135 | - | return xSettingsSchemaSourceGetDefault() | |
| 136 | - | ||
| 135 | + | cret := xSettingsSchemaSourceGetDefault() | |
| 136 | + | return cret | |
| 137 | 137 | } | |
| 138 | 138 | ||
| 139 | 139 | func init() { | |
M v4/gio/gsimpleactiongroup.go +43 -43
| @@ -33,14 +33,16 @@ var xNewSimpleActionGroup func() uintptr | |||
| 33 | 33 | ||
| 34 | 34 | // Creates a new, empty, #GSimpleActionGroup. | |
| 35 | 35 | func NewSimpleActionGroup() *SimpleActionGroup { | |
| 36 | - | NewSimpleActionGroupPtr := xNewSimpleActionGroup() | |
| 37 | - | if NewSimpleActionGroupPtr == 0 { | |
| 38 | - | return nil | |
| 39 | - | } | |
| 36 | + | var cls *SimpleActionGroup | |
| 37 | + | ||
| 38 | + | cret := xNewSimpleActionGroup() | |
| 40 | 39 | ||
| 41 | - | NewSimpleActionGroupCls := &SimpleActionGroup{} | |
| 42 | - | NewSimpleActionGroupCls.Ptr = NewSimpleActionGroupPtr | |
| 43 | - | return NewSimpleActionGroupCls | |
| 40 | + | if cret == 0 { | |
| 41 | + | return cls | |
| 42 | + | } | |
| 43 | + | cls = &SimpleActionGroup{} | |
| 44 | + | cls.Ptr = cret | |
| 45 | + | return cls | |
| 44 | 46 | } | |
| 45 | 47 | ||
| 46 | 48 | var xSimpleActionGroupAddEntries func(uintptr, uintptr, int, uintptr) | |
| @@ -73,18 +75,17 @@ var xSimpleActionGroupLookup func(uintptr, string) uintptr | |||
| 73 | 75 | // | |
| 74 | 76 | // If no such action exists, returns %NULL. | |
| 75 | 77 | func (x *SimpleActionGroup) Lookup(ActionNameVar string) *ActionBase { | |
| 78 | + | var cls *ActionBase | |
| 76 | 79 | ||
| 77 | - | LookupPtr := xSimpleActionGroupLookup(x.GoPointer(), ActionNameVar) | |
| 78 | - | if LookupPtr == 0 { | |
| 79 | - | return nil | |
| 80 | - | } | |
| 81 | - | ||
| 82 | - | gobject.IncreaseRef(LookupPtr) | |
| 83 | - | ||
| 84 | - | LookupCls := &ActionBase{} | |
| 85 | - | LookupCls.Ptr = LookupPtr | |
| 86 | - | return LookupCls | |
| 80 | + | cret := xSimpleActionGroupLookup(x.GoPointer(), ActionNameVar) | |
| 87 | 81 | ||
| 82 | + | if cret == 0 { | |
| 83 | + | return cls | |
| 84 | + | } | |
| 85 | + | gobject.IncreaseRef(cret) | |
| 86 | + | cls = &ActionBase{} | |
| 87 | + | cls.Ptr = cret | |
| 88 | + | return cls | |
| 88 | 89 | } | |
| 89 | 90 | ||
| 90 | 91 | var xSimpleActionGroupRemove func(uintptr, string) | |
| @@ -204,8 +205,8 @@ func (x *SimpleActionGroup) ChangeActionState(ActionNameVar string, ValueVar *gl | |||
| 204 | 205 | // have its state changed from outside callers. | |
| 205 | 206 | func (x *SimpleActionGroup) GetActionEnabled(ActionNameVar string) bool { | |
| 206 | 207 | ||
| 207 | - | return XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar) | |
| 208 | - | ||
| 208 | + | cret := XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar) | |
| 209 | + | return cret | |
| 209 | 210 | } | |
| 210 | 211 | ||
| 211 | 212 | // Queries the type of the parameter that must be given when activating | |
| @@ -223,8 +224,8 @@ func (x *SimpleActionGroup) GetActionEnabled(ActionNameVar string) bool { | |||
| 223 | 224 | // with the same name but a different parameter type. | |
| 224 | 225 | func (x *SimpleActionGroup) GetActionParameterType(ActionNameVar string) *glib.VariantType { | |
| 225 | 226 | ||
| 226 | - | return XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar) | |
| 227 | - | ||
| 227 | + | cret := XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar) | |
| 228 | + | return cret | |
| 228 | 229 | } | |
| 229 | 230 | ||
| 230 | 231 | // Queries the current state of the named action within @action_group. | |
| @@ -237,8 +238,8 @@ func (x *SimpleActionGroup) GetActionParameterType(ActionNameVar string) *glib.V | |||
| 237 | 238 | // g_variant_unref() when it is no longer required. | |
| 238 | 239 | func (x *SimpleActionGroup) GetActionState(ActionNameVar string) *glib.Variant { | |
| 239 | 240 | ||
| 240 | - | return XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| 241 | - | ||
| 241 | + | cret := XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| 242 | + | return cret | |
| 242 | 243 | } | |
| 243 | 244 | ||
| 244 | 245 | // Requests a hint about the valid range of values for the state of the | |
| @@ -261,8 +262,8 @@ func (x *SimpleActionGroup) GetActionState(ActionNameVar string) *glib.Variant { | |||
| 261 | 262 | // g_variant_unref() when it is no longer required. | |
| 262 | 263 | func (x *SimpleActionGroup) GetActionStateHint(ActionNameVar string) *glib.Variant { | |
| 263 | 264 | ||
| 264 | - | return XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| 265 | - | ||
| 265 | + | cret := XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| 266 | + | return cret | |
| 266 | 267 | } | |
| 267 | 268 | ||
| 268 | 269 | // Queries the type of the state of the named action within | |
| @@ -283,15 +284,15 @@ func (x *SimpleActionGroup) GetActionStateHint(ActionNameVar string) *glib.Varia | |||
| 283 | 284 | // with the same name but a different state type. | |
| 284 | 285 | func (x *SimpleActionGroup) GetActionStateType(ActionNameVar string) *glib.VariantType { | |
| 285 | 286 | ||
| 286 | - | return XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar) | |
| 287 | - | ||
| 287 | + | cret := XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar) | |
| 288 | + | return cret | |
| 288 | 289 | } | |
| 289 | 290 | ||
| 290 | 291 | // Checks if the named action exists within @action_group. | |
| 291 | 292 | func (x *SimpleActionGroup) HasAction(ActionNameVar string) bool { | |
| 292 | 293 | ||
| 293 | - | return XGActionGroupHasAction(x.GoPointer(), ActionNameVar) | |
| 294 | - | ||
| 294 | + | cret := XGActionGroupHasAction(x.GoPointer(), ActionNameVar) | |
| 295 | + | return cret | |
| 295 | 296 | } | |
| 296 | 297 | ||
| 297 | 298 | // Lists the actions contained within @action_group. | |
| @@ -300,8 +301,8 @@ func (x *SimpleActionGroup) HasAction(ActionNameVar string) bool { | |||
| 300 | 301 | // it is no longer required. | |
| 301 | 302 | func (x *SimpleActionGroup) ListActions() uintptr { | |
| 302 | 303 | ||
| 303 | - | return XGActionGroupListActions(x.GoPointer()) | |
| 304 | - | ||
| 304 | + | cret := XGActionGroupListActions(x.GoPointer()) | |
| 305 | + | return cret | |
| 305 | 306 | } | |
| 306 | 307 | ||
| 307 | 308 | // Queries all aspects of the named action within an @action_group. | |
| @@ -333,8 +334,8 @@ func (x *SimpleActionGroup) ListActions() uintptr { | |||
| 333 | 334 | // fields may or may not have been modified. | |
| 334 | 335 | func (x *SimpleActionGroup) QueryAction(ActionNameVar string, EnabledVar bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool { | |
| 335 | 336 | ||
| 336 | - | return XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) | |
| 337 | - | ||
| 337 | + | cret := XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) | |
| 338 | + | return cret | |
| 338 | 339 | } | |
| 339 | 340 | ||
| 340 | 341 | // Adds an action to the @action_map. | |
| @@ -402,18 +403,17 @@ func (x *SimpleActionGroup) AddActionEntries(EntriesVar uintptr, NEntriesVar int | |||
| 402 | 403 | // | |
| 403 | 404 | // If no such action exists, returns %NULL. | |
| 404 | 405 | func (x *SimpleActionGroup) LookupAction(ActionNameVar string) *ActionBase { | |
| 406 | + | var cls *ActionBase | |
| 405 | 407 | ||
| 406 | - | LookupActionPtr := XGActionMapLookupAction(x.GoPointer(), ActionNameVar) | |
| 407 | - | if LookupActionPtr == 0 { | |
| 408 | - | return nil | |
| 409 | - | } | |
| 410 | - | ||
| 411 | - | gobject.IncreaseRef(LookupActionPtr) | |
| 412 | - | ||
| 413 | - | LookupActionCls := &ActionBase{} | |
| 414 | - | LookupActionCls.Ptr = LookupActionPtr | |
| 415 | - | return LookupActionCls | |
| 408 | + | cret := XGActionMapLookupAction(x.GoPointer(), ActionNameVar) | |
| 416 | 409 | ||
| 410 | + | if cret == 0 { | |
| 411 | + | return cls | |
| 412 | + | } | |
| 413 | + | gobject.IncreaseRef(cret) | |
| 414 | + | cls = &ActionBase{} | |
| 415 | + | cls.Ptr = cret | |
| 416 | + | return cls | |
| 417 | 417 | } | |
| 418 | 418 | ||
| 419 | 419 | // Removes the named action from the action map. | |
M v4/gio/gsimpleasyncresult.go +70 -52
| @@ -239,42 +239,48 @@ var xNewSimpleAsyncResult func(uintptr, uintptr, uintptr, uintptr) uintptr | |||
| 239 | 239 | // g_simple_async_result_set_check_cancellable() immediately after | |
| 240 | 240 | // this function returns. | |
| 241 | 241 | func NewSimpleAsyncResult(SourceObjectVar *gobject.Object, CallbackVar AsyncReadyCallback, UserDataVar uintptr, SourceTagVar uintptr) *SimpleAsyncResult { | |
| 242 | - | NewSimpleAsyncResultPtr := xNewSimpleAsyncResult(SourceObjectVar.GoPointer(), purego.NewCallback(CallbackVar), UserDataVar, SourceTagVar) | |
| 243 | - | if NewSimpleAsyncResultPtr == 0 { | |
| 244 | - | return nil | |
| 245 | - | } | |
| 242 | + | var cls *SimpleAsyncResult | |
| 243 | + | ||
| 244 | + | cret := xNewSimpleAsyncResult(SourceObjectVar.GoPointer(), purego.NewCallback(CallbackVar), UserDataVar, SourceTagVar) | |
| 246 | 245 | ||
| 247 | - | NewSimpleAsyncResultCls := &SimpleAsyncResult{} | |
| 248 | - | NewSimpleAsyncResultCls.Ptr = NewSimpleAsyncResultPtr | |
| 249 | - | return NewSimpleAsyncResultCls | |
| 246 | + | if cret == 0 { | |
| 247 | + | return cls | |
| 248 | + | } | |
| 249 | + | cls = &SimpleAsyncResult{} | |
| 250 | + | cls.Ptr = cret | |
| 251 | + | return cls | |
| 250 | 252 | } | |
| 251 | 253 | ||
| 252 | 254 | var xNewErrorSimpleAsyncResult func(uintptr, uintptr, uintptr, glib.Quark, int, string, ...interface{}) uintptr | |
| 253 | 255 | ||
| 254 | 256 | // Creates a new #GSimpleAsyncResult with a set error. | |
| 255 | 257 | func NewErrorSimpleAsyncResult(SourceObjectVar *gobject.Object, CallbackVar AsyncReadyCallback, UserDataVar uintptr, DomainVar glib.Quark, CodeVar int, FormatVar string, varArgs ...interface{}) *SimpleAsyncResult { | |
| 256 | - | NewErrorSimpleAsyncResultPtr := xNewErrorSimpleAsyncResult(SourceObjectVar.GoPointer(), purego.NewCallback(CallbackVar), UserDataVar, DomainVar, CodeVar, FormatVar, varArgs...) | |
| 257 | - | if NewErrorSimpleAsyncResultPtr == 0 { | |
| 258 | - | return nil | |
| 259 | - | } | |
| 258 | + | var cls *SimpleAsyncResult | |
| 259 | + | ||
| 260 | + | cret := xNewErrorSimpleAsyncResult(SourceObjectVar.GoPointer(), purego.NewCallback(CallbackVar), UserDataVar, DomainVar, CodeVar, FormatVar, varArgs...) | |
| 260 | 261 | ||
| 261 | - | NewErrorSimpleAsyncResultCls := &SimpleAsyncResult{} | |
| 262 | - | NewErrorSimpleAsyncResultCls.Ptr = NewErrorSimpleAsyncResultPtr | |
| 263 | - | return NewErrorSimpleAsyncResultCls | |
| 262 | + | if cret == 0 { | |
| 263 | + | return cls | |
| 264 | + | } | |
| 265 | + | cls = &SimpleAsyncResult{} | |
| 266 | + | cls.Ptr = cret | |
| 267 | + | return cls | |
| 264 | 268 | } | |
| 265 | 269 | ||
| 266 | 270 | var xNewFromErrorSimpleAsyncResult func(uintptr, uintptr, uintptr, *glib.Error) uintptr | |
| 267 | 271 | ||
| 268 | 272 | // Creates a #GSimpleAsyncResult from an error condition. | |
| 269 | 273 | func NewFromErrorSimpleAsyncResult(SourceObjectVar *gobject.Object, CallbackVar AsyncReadyCallback, UserDataVar uintptr, ErrorVar *glib.Error) *SimpleAsyncResult { | |
| 270 | - | NewFromErrorSimpleAsyncResultPtr := xNewFromErrorSimpleAsyncResult(SourceObjectVar.GoPointer(), purego.NewCallback(CallbackVar), UserDataVar, ErrorVar) | |
| 271 | - | if NewFromErrorSimpleAsyncResultPtr == 0 { | |
| 272 | - | return nil | |
| 273 | - | } | |
| 274 | + | var cls *SimpleAsyncResult | |
| 274 | 275 | ||
| 275 | - | NewFromErrorSimpleAsyncResultCls := &SimpleAsyncResult{} | |
| 276 | - | NewFromErrorSimpleAsyncResultCls.Ptr = NewFromErrorSimpleAsyncResultPtr | |
| 277 | - | return NewFromErrorSimpleAsyncResultCls | |
| 276 | + | cret := xNewFromErrorSimpleAsyncResult(SourceObjectVar.GoPointer(), purego.NewCallback(CallbackVar), UserDataVar, ErrorVar) | |
| 277 | + | ||
| 278 | + | if cret == 0 { | |
| 279 | + | return cls | |
| 280 | + | } | |
| 281 | + | cls = &SimpleAsyncResult{} | |
| 282 | + | cls.Ptr = cret | |
| 283 | + | return cls | |
| 278 | 284 | } | |
| 279 | 285 | ||
| 280 | 286 | var xNewTakeErrorSimpleAsyncResult func(uintptr, uintptr, uintptr, *glib.Error) uintptr | |
| @@ -282,14 +288,16 @@ var xNewTakeErrorSimpleAsyncResult func(uintptr, uintptr, uintptr, *glib.Error) | |||
| 282 | 288 | // Creates a #GSimpleAsyncResult from an error condition, and takes over the | |
| 283 | 289 | // caller's ownership of @error, so the caller does not need to free it anymore. | |
| 284 | 290 | func NewTakeErrorSimpleAsyncResult(SourceObjectVar *gobject.Object, CallbackVar AsyncReadyCallback, UserDataVar uintptr, ErrorVar *glib.Error) *SimpleAsyncResult { | |
| 285 | - | NewTakeErrorSimpleAsyncResultPtr := xNewTakeErrorSimpleAsyncResult(SourceObjectVar.GoPointer(), purego.NewCallback(CallbackVar), UserDataVar, ErrorVar) | |
| 286 | - | if NewTakeErrorSimpleAsyncResultPtr == 0 { | |
| 287 | - | return nil | |
| 288 | - | } | |
| 291 | + | var cls *SimpleAsyncResult | |
| 292 | + | ||
| 293 | + | cret := xNewTakeErrorSimpleAsyncResult(SourceObjectVar.GoPointer(), purego.NewCallback(CallbackVar), UserDataVar, ErrorVar) | |
| 289 | 294 | ||
| 290 | - | NewTakeErrorSimpleAsyncResultCls := &SimpleAsyncResult{} | |
| 291 | - | NewTakeErrorSimpleAsyncResultCls.Ptr = NewTakeErrorSimpleAsyncResultPtr | |
| 292 | - | return NewTakeErrorSimpleAsyncResultCls | |
| 295 | + | if cret == 0 { | |
| 296 | + | return cls | |
| 297 | + | } | |
| 298 | + | cls = &SimpleAsyncResult{} | |
| 299 | + | cls.Ptr = cret | |
| 300 | + | return cls | |
| 293 | 301 | } | |
| 294 | 302 | ||
| 295 | 303 | var xSimpleAsyncResultComplete func(uintptr) | |
| @@ -327,8 +335,8 @@ var xSimpleAsyncResultGetOpResGboolean func(uintptr) bool | |||
| 327 | 335 | // Gets the operation result boolean from within the asynchronous result. | |
| 328 | 336 | func (x *SimpleAsyncResult) GetOpResGboolean() bool { | |
| 329 | 337 | ||
| 330 | - | return xSimpleAsyncResultGetOpResGboolean(x.GoPointer()) | |
| 331 | - | ||
| 338 | + | cret := xSimpleAsyncResultGetOpResGboolean(x.GoPointer()) | |
| 339 | + | return cret | |
| 332 | 340 | } | |
| 333 | 341 | ||
| 334 | 342 | var xSimpleAsyncResultGetOpResGpointer func(uintptr) uintptr | |
| @@ -336,8 +344,8 @@ var xSimpleAsyncResultGetOpResGpointer func(uintptr) uintptr | |||
| 336 | 344 | // Gets a pointer result as returned by the asynchronous function. | |
| 337 | 345 | func (x *SimpleAsyncResult) GetOpResGpointer() uintptr { | |
| 338 | 346 | ||
| 339 | - | return xSimpleAsyncResultGetOpResGpointer(x.GoPointer()) | |
| 340 | - | ||
| 347 | + | cret := xSimpleAsyncResultGetOpResGpointer(x.GoPointer()) | |
| 348 | + | return cret | |
| 341 | 349 | } | |
| 342 | 350 | ||
| 343 | 351 | var xSimpleAsyncResultGetOpResGssize func(uintptr) int | |
| @@ -345,8 +353,8 @@ var xSimpleAsyncResultGetOpResGssize func(uintptr) int | |||
| 345 | 353 | // Gets a gssize from the asynchronous result. | |
| 346 | 354 | func (x *SimpleAsyncResult) GetOpResGssize() int { | |
| 347 | 355 | ||
| 348 | - | return xSimpleAsyncResultGetOpResGssize(x.GoPointer()) | |
| 349 | - | ||
| 356 | + | cret := xSimpleAsyncResultGetOpResGssize(x.GoPointer()) | |
| 357 | + | return cret | |
| 350 | 358 | } | |
| 351 | 359 | ||
| 352 | 360 | var xSimpleAsyncResultGetSourceTag func(uintptr) uintptr | |
| @@ -354,8 +362,8 @@ var xSimpleAsyncResultGetSourceTag func(uintptr) uintptr | |||
| 354 | 362 | // Gets the source tag for the #GSimpleAsyncResult. | |
| 355 | 363 | func (x *SimpleAsyncResult) GetSourceTag() uintptr { | |
| 356 | 364 | ||
| 357 | - | return xSimpleAsyncResultGetSourceTag(x.GoPointer()) | |
| 358 | - | ||
| 365 | + | cret := xSimpleAsyncResultGetSourceTag(x.GoPointer()) | |
| 366 | + | return cret | |
| 359 | 367 | } | |
| 360 | 368 | ||
| 361 | 369 | var xSimpleAsyncResultPropagateError func(uintptr) bool | |
| @@ -366,9 +374,14 @@ var xSimpleAsyncResultPropagateError func(uintptr) bool | |||
| 366 | 374 | // If the #GCancellable given to a prior call to | |
| 367 | 375 | // g_simple_async_result_set_check_cancellable() is cancelled then this | |
| 368 | 376 | // function will return %TRUE with @dest set appropriately. | |
| 369 | - | func (x *SimpleAsyncResult) PropagateError() bool { | |
| 377 | + | func (x *SimpleAsyncResult) PropagateError() (bool, error) { | |
| 378 | + | var cerr *glib.Error | |
| 370 | 379 | ||
| 371 | - | return xSimpleAsyncResultPropagateError(x.GoPointer()) | |
| 380 | + | cret := xSimpleAsyncResultPropagateError(x.GoPointer()) | |
| 381 | + | if cerr == nil { | |
| 382 | + | return cret, nil | |
| 383 | + | } | |
| 384 | + | return cret, cerr | |
| 372 | 385 | ||
| 373 | 386 | } | |
| 374 | 387 | ||
| @@ -498,31 +511,31 @@ func (c *SimpleAsyncResult) SetGoPointer(ptr uintptr) { | |||
| 498 | 511 | ||
| 499 | 512 | // Gets the source object from a #GAsyncResult. | |
| 500 | 513 | func (x *SimpleAsyncResult) GetSourceObject() *gobject.Object { | |
| 514 | + | var cls *gobject.Object | |
| 501 | 515 | ||
| 502 | - | GetSourceObjectPtr := XGAsyncResultGetSourceObject(x.GoPointer()) | |
| 503 | - | if GetSourceObjectPtr == 0 { | |
| 504 | - | return nil | |
| 505 | - | } | |
| 506 | - | ||
| 507 | - | GetSourceObjectCls := &gobject.Object{} | |
| 508 | - | GetSourceObjectCls.Ptr = GetSourceObjectPtr | |
| 509 | - | return GetSourceObjectCls | |
| 516 | + | cret := XGAsyncResultGetSourceObject(x.GoPointer()) | |
| 510 | 517 | ||
| 518 | + | if cret == 0 { | |
| 519 | + | return cls | |
| 520 | + | } | |
| 521 | + | cls = &gobject.Object{} | |
| 522 | + | cls.Ptr = cret | |
| 523 | + | return cls | |
| 511 | 524 | } | |
| 512 | 525 | ||
| 513 | 526 | // Gets the user data from a #GAsyncResult. | |
| 514 | 527 | func (x *SimpleAsyncResult) GetUserData() uintptr { | |
| 515 | 528 | ||
| 516 | - | return XGAsyncResultGetUserData(x.GoPointer()) | |
| 517 | - | ||
| 529 | + | cret := XGAsyncResultGetUserData(x.GoPointer()) | |
| 530 | + | return cret | |
| 518 | 531 | } | |
| 519 | 532 | ||
| 520 | 533 | // Checks if @res has the given @source_tag (generally a function | |
| 521 | 534 | // pointer indicating the function @res was created by). | |
| 522 | 535 | func (x *SimpleAsyncResult) IsTagged(SourceTagVar uintptr) bool { | |
| 523 | 536 | ||
| 524 | - | return XGAsyncResultIsTagged(x.GoPointer(), SourceTagVar) | |
| 525 | - | ||
| 537 | + | cret := XGAsyncResultIsTagged(x.GoPointer(), SourceTagVar) | |
| 538 | + | return cret | |
| 526 | 539 | } | |
| 527 | 540 | ||
| 528 | 541 | // If @res is a #GSimpleAsyncResult, this is equivalent to | |
| @@ -535,9 +548,14 @@ func (x *SimpleAsyncResult) IsTagged(SourceTagVar uintptr) bool { | |||
| 535 | 548 | // This should not be used in new code; #GAsyncResult errors that are | |
| 536 | 549 | // set by virtual methods should also be extracted by virtual methods, | |
| 537 | 550 | // to enable subclasses to chain up correctly. | |
| 538 | - | func (x *SimpleAsyncResult) LegacyPropagateError() bool { | |
| 551 | + | func (x *SimpleAsyncResult) LegacyPropagateError() (bool, error) { | |
| 552 | + | var cerr *glib.Error | |
| 539 | 553 | ||
| 540 | - | return XGAsyncResultLegacyPropagateError(x.GoPointer()) | |
| 554 | + | cret := XGAsyncResultLegacyPropagateError(x.GoPointer()) | |
| 555 | + | if cerr == nil { | |
| 556 | + | return cret, nil | |
| 557 | + | } | |
| 558 | + | return cret, cerr | |
| 541 | 559 | ||
| 542 | 560 | } | |
| 543 | 561 | ||
M v4/gio/gsimpleproxyresolver.go +17 -6
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -88,8 +89,8 @@ func (c *SimpleProxyResolver) SetGoPointer(ptr uintptr) { | |||
| 88 | 89 | // resolver that returns %TRUE for this method.) | |
| 89 | 90 | func (x *SimpleProxyResolver) IsSupported() bool { | |
| 90 | 91 | ||
| 91 | - | return XGProxyResolverIsSupported(x.GoPointer()) | |
| 92 | - | ||
| 92 | + | cret := XGProxyResolverIsSupported(x.GoPointer()) | |
| 93 | + | return cret | |
| 93 | 94 | } | |
| 94 | 95 | ||
| 95 | 96 | // Looks into the system proxy configuration to determine what proxy, | |
| @@ -107,9 +108,14 @@ func (x *SimpleProxyResolver) IsSupported() bool { | |||
| 107 | 108 | // `direct://` is used when no proxy is needed. | |
| 108 | 109 | // Direct connection should not be attempted unless it is part of the | |
| 109 | 110 | // returned array of proxies. | |
| 110 | - | func (x *SimpleProxyResolver) Lookup(UriVar string, CancellableVar *Cancellable) uintptr { | |
| 111 | + | func (x *SimpleProxyResolver) Lookup(UriVar string, CancellableVar *Cancellable) (uintptr, error) { | |
| 112 | + | var cerr *glib.Error | |
| 111 | 113 | ||
| 112 | - | return XGProxyResolverLookup(x.GoPointer(), UriVar, CancellableVar.GoPointer()) | |
| 114 | + | cret := XGProxyResolverLookup(x.GoPointer(), UriVar, CancellableVar.GoPointer(), &cerr) | |
| 115 | + | if cerr == nil { | |
| 116 | + | return cret, nil | |
| 117 | + | } | |
| 118 | + | return cret, cerr | |
| 113 | 119 | ||
| 114 | 120 | } | |
| 115 | 121 | ||
| @@ -124,9 +130,14 @@ func (x *SimpleProxyResolver) LookupAsync(UriVar string, CancellableVar *Cancell | |||
| 124 | 130 | // Call this function to obtain the array of proxy URIs when | |
| 125 | 131 | // g_proxy_resolver_lookup_async() is complete. See | |
| 126 | 132 | // g_proxy_resolver_lookup() for more details. | |
| 127 | - | func (x *SimpleProxyResolver) LookupFinish(ResultVar AsyncResult) uintptr { | |
| 133 | + | func (x *SimpleProxyResolver) LookupFinish(ResultVar AsyncResult) (uintptr, error) { | |
| 134 | + | var cerr *glib.Error | |
| 128 | 135 | ||
| 129 | - | return XGProxyResolverLookupFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 136 | + | cret := XGProxyResolverLookupFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 137 | + | if cerr == nil { | |
| 138 | + | return cret, nil | |
| 139 | + | } | |
| 140 | + | return cret, cerr | |
| 130 | 141 | ||
| 131 | 142 | } | |
| 132 | 143 | ||
M v4/gio/gsocket.go +331 -167
| @@ -76,7 +76,7 @@ func SocketNewFromInternalPtr(ptr uintptr) *Socket { | |||
| 76 | 76 | return cls | |
| 77 | 77 | } | |
| 78 | 78 | ||
| 79 | - | var xNewSocket func(SocketFamily, SocketType, SocketProtocol) uintptr | |
| 79 | + | var xNewSocket func(SocketFamily, SocketType, SocketProtocol, **glib.Error) uintptr | |
| 80 | 80 | ||
| 81 | 81 | // Creates a new #GSocket with the defined family, type and protocol. | |
| 82 | 82 | // If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type | |
| @@ -91,18 +91,25 @@ var xNewSocket func(SocketFamily, SocketType, SocketProtocol) uintptr | |||
| 91 | 91 | // The protocol id is passed directly to the operating | |
| 92 | 92 | // system, so you can use protocols not listed in #GSocketProtocol if you | |
| 93 | 93 | // know the protocol number used for it. | |
| 94 | - | func NewSocket(FamilyVar SocketFamily, TypeVar SocketType, ProtocolVar SocketProtocol) *Socket { | |
| 95 | - | NewSocketPtr := xNewSocket(FamilyVar, TypeVar, ProtocolVar) | |
| 96 | - | if NewSocketPtr == 0 { | |
| 97 | - | return nil | |
| 94 | + | func NewSocket(FamilyVar SocketFamily, TypeVar SocketType, ProtocolVar SocketProtocol) (*Socket, error) { | |
| 95 | + | var cls *Socket | |
| 96 | + | var cerr *glib.Error | |
| 97 | + | ||
| 98 | + | cret := xNewSocket(FamilyVar, TypeVar, ProtocolVar, &cerr) | |
| 99 | + | ||
| 100 | + | if cret == 0 { | |
| 101 | + | return cls, cerr | |
| 102 | + | } | |
| 103 | + | cls = &Socket{} | |
| 104 | + | cls.Ptr = cret | |
| 105 | + | if cerr == nil { | |
| 106 | + | return cls, nil | |
| 98 | 107 | } | |
| 108 | + | return cls, cerr | |
| 99 | 109 | ||
| 100 | - | NewSocketCls := &Socket{} | |
| 101 | - | NewSocketCls.Ptr = NewSocketPtr | |
| 102 | - | return NewSocketCls | |
| 103 | 110 | } | |
| 104 | 111 | ||
| 105 | - | var xNewFromFdSocket func(int) uintptr | |
| 112 | + | var xNewFromFdSocket func(int, **glib.Error) uintptr | |
| 106 | 113 | ||
| 107 | 114 | // Creates a new #GSocket from a native file descriptor | |
| 108 | 115 | // or winsock SOCKET handle. | |
| @@ -117,18 +124,25 @@ var xNewFromFdSocket func(int) uintptr | |||
| 117 | 124 | // | |
| 118 | 125 | // Since GLib 2.46, it is no longer a fatal error to call this on a non-socket | |
| 119 | 126 | // descriptor. Instead, a GError will be set with code %G_IO_ERROR_FAILED | |
| 120 | - | func NewFromFdSocket(FdVar int) *Socket { | |
| 121 | - | NewFromFdSocketPtr := xNewFromFdSocket(FdVar) | |
| 122 | - | if NewFromFdSocketPtr == 0 { | |
| 123 | - | return nil | |
| 127 | + | func NewFromFdSocket(FdVar int) (*Socket, error) { | |
| 128 | + | var cls *Socket | |
| 129 | + | var cerr *glib.Error | |
| 130 | + | ||
| 131 | + | cret := xNewFromFdSocket(FdVar, &cerr) | |
| 132 | + | ||
| 133 | + | if cret == 0 { | |
| 134 | + | return cls, cerr | |
| 124 | 135 | } | |
| 136 | + | cls = &Socket{} | |
| 137 | + | cls.Ptr = cret | |
| 138 | + | if cerr == nil { | |
| 139 | + | return cls, nil | |
| 140 | + | } | |
| 141 | + | return cls, cerr | |
| 125 | 142 | ||
| 126 | - | NewFromFdSocketCls := &Socket{} | |
| 127 | - | NewFromFdSocketCls.Ptr = NewFromFdSocketPtr | |
| 128 | - | return NewFromFdSocketCls | |
| 129 | 143 | } | |
| 130 | 144 | ||
| 131 | - | var xSocketAccept func(uintptr, uintptr) uintptr | |
| 145 | + | var xSocketAccept func(uintptr, uintptr, **glib.Error) uintptr | |
| 132 | 146 | ||
| 133 | 147 | // Accept incoming connections on a connection-based socket. This removes | |
| 134 | 148 | // the first outstanding connection request from the listening socket and | |
| @@ -140,20 +154,25 @@ var xSocketAccept func(uintptr, uintptr) uintptr | |||
| 140 | 154 | // If there are no outstanding connections then the operation will block | |
| 141 | 155 | // or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled. | |
| 142 | 156 | // To be notified of an incoming connection, wait for the %G_IO_IN condition. | |
| 143 | - | func (x *Socket) Accept(CancellableVar *Cancellable) *Socket { | |
| 157 | + | func (x *Socket) Accept(CancellableVar *Cancellable) (*Socket, error) { | |
| 158 | + | var cls *Socket | |
| 159 | + | var cerr *glib.Error | |
| 144 | 160 | ||
| 145 | - | AcceptPtr := xSocketAccept(x.GoPointer(), CancellableVar.GoPointer()) | |
| 146 | - | if AcceptPtr == 0 { | |
| 147 | - | return nil | |
| 148 | - | } | |
| 161 | + | cret := xSocketAccept(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 149 | 162 | ||
| 150 | - | AcceptCls := &Socket{} | |
| 151 | - | AcceptCls.Ptr = AcceptPtr | |
| 152 | - | return AcceptCls | |
| 163 | + | if cret == 0 { | |
| 164 | + | return cls, cerr | |
| 165 | + | } | |
| 166 | + | cls = &Socket{} | |
| 167 | + | cls.Ptr = cret | |
| 168 | + | if cerr == nil { | |
| 169 | + | return cls, nil | |
| 170 | + | } | |
| 171 | + | return cls, cerr | |
| 153 | 172 | ||
| 154 | 173 | } | |
| 155 | 174 | ||
| 156 | - | var xSocketBind func(uintptr, uintptr, bool) bool | |
| 175 | + | var xSocketBind func(uintptr, uintptr, bool, **glib.Error) bool | |
| 157 | 176 | ||
| 158 | 177 | // When a socket is created it is attached to an address family, but it | |
| 159 | 178 | // doesn't have an address in this family. g_socket_bind() assigns the | |
| @@ -178,9 +197,14 @@ var xSocketBind func(uintptr, uintptr, bool) bool | |||
| 178 | 197 | // same address, and they will all receive all of the multicast and | |
| 179 | 198 | // broadcast packets sent to that address. (The behavior of unicast | |
| 180 | 199 | // UDP packets to an address with multiple listeners is not defined.) | |
| 181 | - | func (x *Socket) Bind(AddressVar *SocketAddress, AllowReuseVar bool) bool { | |
| 200 | + | func (x *Socket) Bind(AddressVar *SocketAddress, AllowReuseVar bool) (bool, error) { | |
| 201 | + | var cerr *glib.Error | |
| 182 | 202 | ||
| 183 | - | return xSocketBind(x.GoPointer(), AddressVar.GoPointer(), AllowReuseVar) | |
| 203 | + | cret := xSocketBind(x.GoPointer(), AddressVar.GoPointer(), AllowReuseVar, &cerr) | |
| 204 | + | if cerr == nil { | |
| 205 | + | return cret, nil | |
| 206 | + | } | |
| 207 | + | return cret, cerr | |
| 184 | 208 | ||
| 185 | 209 | } | |
| 186 | 210 | ||
| @@ -189,9 +213,14 @@ var xSocketCheckConnectResult func(uintptr) bool | |||
| 189 | 213 | // Checks and resets the pending connect error for the socket. | |
| 190 | 214 | // This is used to check for errors when g_socket_connect() is | |
| 191 | 215 | // used in non-blocking mode. | |
| 192 | - | func (x *Socket) CheckConnectResult() bool { | |
| 216 | + | func (x *Socket) CheckConnectResult() (bool, error) { | |
| 217 | + | var cerr *glib.Error | |
| 193 | 218 | ||
| 194 | - | return xSocketCheckConnectResult(x.GoPointer()) | |
| 219 | + | cret := xSocketCheckConnectResult(x.GoPointer()) | |
| 220 | + | if cerr == nil { | |
| 221 | + | return cret, nil | |
| 222 | + | } | |
| 223 | + | return cret, cerr | |
| 195 | 224 | ||
| 196 | 225 | } | |
| 197 | 226 | ||
| @@ -226,9 +255,14 @@ var xSocketClose func(uintptr) bool | |||
| 226 | 255 | // g_tcp_connection_set_graceful_disconnect(). But of course, this | |
| 227 | 256 | // only works if the client will close its connection after the server | |
| 228 | 257 | // does.) | |
| 229 | - | func (x *Socket) Close() bool { | |
| 258 | + | func (x *Socket) Close() (bool, error) { | |
| 259 | + | var cerr *glib.Error | |
| 230 | 260 | ||
| 231 | - | return xSocketClose(x.GoPointer()) | |
| 261 | + | cret := xSocketClose(x.GoPointer()) | |
| 262 | + | if cerr == nil { | |
| 263 | + | return cret, nil | |
| 264 | + | } | |
| 265 | + | return cret, cerr | |
| 232 | 266 | ||
| 233 | 267 | } | |
| 234 | 268 | ||
| @@ -253,11 +287,11 @@ var xSocketConditionCheck func(uintptr, glib.IOCondition) glib.IOCondition | |||
| 253 | 287 | // This call never blocks. | |
| 254 | 288 | func (x *Socket) ConditionCheck(ConditionVar glib.IOCondition) glib.IOCondition { | |
| 255 | 289 | ||
| 256 | - | return xSocketConditionCheck(x.GoPointer(), ConditionVar) | |
| 257 | - | ||
| 290 | + | cret := xSocketConditionCheck(x.GoPointer(), ConditionVar) | |
| 291 | + | return cret | |
| 258 | 292 | } | |
| 259 | 293 | ||
| 260 | - | var xSocketConditionTimedWait func(uintptr, glib.IOCondition, int64, uintptr) bool | |
| 294 | + | var xSocketConditionTimedWait func(uintptr, glib.IOCondition, int64, uintptr, **glib.Error) bool | |
| 261 | 295 | ||
| 262 | 296 | // Waits for up to @timeout_us microseconds for @condition to become true | |
| 263 | 297 | // on @socket. If the condition is met, %TRUE is returned. | |
| @@ -275,13 +309,18 @@ var xSocketConditionTimedWait func(uintptr, glib.IOCondition, int64, uintptr) bo | |||
| 275 | 309 | // other GLib APIs, this function actually only has millisecond | |
| 276 | 310 | // resolution, and the behavior is undefined if @timeout_us is not an | |
| 277 | 311 | // exact number of milliseconds. | |
| 278 | - | func (x *Socket) ConditionTimedWait(ConditionVar glib.IOCondition, TimeoutUsVar int64, CancellableVar *Cancellable) bool { | |
| 312 | + | func (x *Socket) ConditionTimedWait(ConditionVar glib.IOCondition, TimeoutUsVar int64, CancellableVar *Cancellable) (bool, error) { | |
| 313 | + | var cerr *glib.Error | |
| 279 | 314 | ||
| 280 | - | return xSocketConditionTimedWait(x.GoPointer(), ConditionVar, TimeoutUsVar, CancellableVar.GoPointer()) | |
| 315 | + | cret := xSocketConditionTimedWait(x.GoPointer(), ConditionVar, TimeoutUsVar, CancellableVar.GoPointer(), &cerr) | |
| 316 | + | if cerr == nil { | |
| 317 | + | return cret, nil | |
| 318 | + | } | |
| 319 | + | return cret, cerr | |
| 281 | 320 | ||
| 282 | 321 | } | |
| 283 | 322 | ||
| 284 | - | var xSocketConditionWait func(uintptr, glib.IOCondition, uintptr) bool | |
| 323 | + | var xSocketConditionWait func(uintptr, glib.IOCondition, uintptr, **glib.Error) bool | |
| 285 | 324 | ||
| 286 | 325 | // Waits for @condition to become true on @socket. When the condition | |
| 287 | 326 | // is met, %TRUE is returned. | |
| @@ -293,13 +332,18 @@ var xSocketConditionWait func(uintptr, glib.IOCondition, uintptr) bool | |||
| 293 | 332 | // %G_IO_ERROR_TIMED_OUT). | |
| 294 | 333 | // | |
| 295 | 334 | // See also g_socket_condition_timed_wait(). | |
| 296 | - | func (x *Socket) ConditionWait(ConditionVar glib.IOCondition, CancellableVar *Cancellable) bool { | |
| 335 | + | func (x *Socket) ConditionWait(ConditionVar glib.IOCondition, CancellableVar *Cancellable) (bool, error) { | |
| 336 | + | var cerr *glib.Error | |
| 297 | 337 | ||
| 298 | - | return xSocketConditionWait(x.GoPointer(), ConditionVar, CancellableVar.GoPointer()) | |
| 338 | + | cret := xSocketConditionWait(x.GoPointer(), ConditionVar, CancellableVar.GoPointer(), &cerr) | |
| 339 | + | if cerr == nil { | |
| 340 | + | return cret, nil | |
| 341 | + | } | |
| 342 | + | return cret, cerr | |
| 299 | 343 | ||
| 300 | 344 | } | |
| 301 | 345 | ||
| 302 | - | var xSocketConnect func(uintptr, uintptr, uintptr) bool | |
| 346 | + | var xSocketConnect func(uintptr, uintptr, uintptr, **glib.Error) bool | |
| 303 | 347 | ||
| 304 | 348 | // Connect the socket to the specified remote address. | |
| 305 | 349 | // | |
| @@ -317,9 +361,14 @@ var xSocketConnect func(uintptr, uintptr, uintptr) bool | |||
| 317 | 361 | // and the user can be notified of the connection finishing by waiting | |
| 318 | 362 | // for the G_IO_OUT condition. The result of the connection must then be | |
| 319 | 363 | // checked with g_socket_check_connect_result(). | |
| 320 | - | func (x *Socket) Connect(AddressVar *SocketAddress, CancellableVar *Cancellable) bool { | |
| 364 | + | func (x *Socket) Connect(AddressVar *SocketAddress, CancellableVar *Cancellable) (bool, error) { | |
| 365 | + | var cerr *glib.Error | |
| 321 | 366 | ||
| 322 | - | return xSocketConnect(x.GoPointer(), AddressVar.GoPointer(), CancellableVar.GoPointer()) | |
| 367 | + | cret := xSocketConnect(x.GoPointer(), AddressVar.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 368 | + | if cerr == nil { | |
| 369 | + | return cret, nil | |
| 370 | + | } | |
| 371 | + | return cret, cerr | |
| 323 | 372 | ||
| 324 | 373 | } | |
| 325 | 374 | ||
| @@ -328,16 +377,16 @@ var xSocketConnectionFactoryCreateConnection func(uintptr) uintptr | |||
| 328 | 377 | // Creates a #GSocketConnection subclass of the right type for | |
| 329 | 378 | // @socket. | |
| 330 | 379 | func (x *Socket) ConnectionFactoryCreateConnection() *SocketConnection { | |
| 380 | + | var cls *SocketConnection | |
| 331 | 381 | ||
| 332 | - | ConnectionFactoryCreateConnectionPtr := xSocketConnectionFactoryCreateConnection(x.GoPointer()) | |
| 333 | - | if ConnectionFactoryCreateConnectionPtr == 0 { | |
| 334 | - | return nil | |
| 335 | - | } | |
| 336 | - | ||
| 337 | - | ConnectionFactoryCreateConnectionCls := &SocketConnection{} | |
| 338 | - | ConnectionFactoryCreateConnectionCls.Ptr = ConnectionFactoryCreateConnectionPtr | |
| 339 | - | return ConnectionFactoryCreateConnectionCls | |
| 382 | + | cret := xSocketConnectionFactoryCreateConnection(x.GoPointer()) | |
| 340 | 383 | ||
| 384 | + | if cret == 0 { | |
| 385 | + | return cls | |
| 386 | + | } | |
| 387 | + | cls = &SocketConnection{} | |
| 388 | + | cls.Ptr = cret | |
| 389 | + | return cls | |
| 341 | 390 | } | |
| 342 | 391 | ||
| 343 | 392 | var xSocketCreateSource func(uintptr, glib.IOCondition, uintptr) *glib.Source | |
| @@ -364,8 +413,8 @@ var xSocketCreateSource func(uintptr, glib.IOCondition, uintptr) *glib.Source | |||
| 364 | 413 | // you call will then fail with a %G_IO_ERROR_TIMED_OUT. | |
| 365 | 414 | func (x *Socket) CreateSource(ConditionVar glib.IOCondition, CancellableVar *Cancellable) *glib.Source { | |
| 366 | 415 | ||
| 367 | - | return xSocketCreateSource(x.GoPointer(), ConditionVar, CancellableVar.GoPointer()) | |
| 368 | - | ||
| 416 | + | cret := xSocketCreateSource(x.GoPointer(), ConditionVar, CancellableVar.GoPointer()) | |
| 417 | + | return cret | |
| 369 | 418 | } | |
| 370 | 419 | ||
| 371 | 420 | var xSocketGetAvailableBytes func(uintptr) int | |
| @@ -384,8 +433,8 @@ var xSocketGetAvailableBytes func(uintptr) int | |||
| 384 | 433 | // exactly the right size. | |
| 385 | 434 | func (x *Socket) GetAvailableBytes() int { | |
| 386 | 435 | ||
| 387 | - | return xSocketGetAvailableBytes(x.GoPointer()) | |
| 388 | - | ||
| 436 | + | cret := xSocketGetAvailableBytes(x.GoPointer()) | |
| 437 | + | return cret | |
| 389 | 438 | } | |
| 390 | 439 | ||
| 391 | 440 | var xSocketGetBlocking func(uintptr) bool | |
| @@ -394,8 +443,8 @@ var xSocketGetBlocking func(uintptr) bool | |||
| 394 | 443 | // see g_socket_set_blocking(). | |
| 395 | 444 | func (x *Socket) GetBlocking() bool { | |
| 396 | 445 | ||
| 397 | - | return xSocketGetBlocking(x.GoPointer()) | |
| 398 | - | ||
| 446 | + | cret := xSocketGetBlocking(x.GoPointer()) | |
| 447 | + | return cret | |
| 399 | 448 | } | |
| 400 | 449 | ||
| 401 | 450 | var xSocketGetBroadcast func(uintptr) bool | |
| @@ -405,8 +454,8 @@ var xSocketGetBroadcast func(uintptr) bool | |||
| 405 | 454 | // addresses. | |
| 406 | 455 | func (x *Socket) GetBroadcast() bool { | |
| 407 | 456 | ||
| 408 | - | return xSocketGetBroadcast(x.GoPointer()) | |
| 409 | - | ||
| 457 | + | cret := xSocketGetBroadcast(x.GoPointer()) | |
| 458 | + | return cret | |
| 410 | 459 | } | |
| 411 | 460 | ||
| 412 | 461 | var xSocketGetCredentials func(uintptr) uintptr | |
| @@ -431,16 +480,21 @@ var xSocketGetCredentials func(uintptr) uintptr | |||
| 431 | 480 | // #GUnixCredentialsMessage type and | |
| 432 | 481 | // g_unix_connection_send_credentials() / | |
| 433 | 482 | // g_unix_connection_receive_credentials() functions. | |
| 434 | - | func (x *Socket) GetCredentials() *Credentials { | |
| 483 | + | func (x *Socket) GetCredentials() (*Credentials, error) { | |
| 484 | + | var cls *Credentials | |
| 485 | + | var cerr *glib.Error | |
| 435 | 486 | ||
| 436 | - | GetCredentialsPtr := xSocketGetCredentials(x.GoPointer()) | |
| 437 | - | if GetCredentialsPtr == 0 { | |
| 438 | - | return nil | |
| 439 | - | } | |
| 487 | + | cret := xSocketGetCredentials(x.GoPointer()) | |
| 440 | 488 | ||
| 441 | - | GetCredentialsCls := &Credentials{} | |
| 442 | - | GetCredentialsCls.Ptr = GetCredentialsPtr | |
| 443 | - | return GetCredentialsCls | |
| 489 | + | if cret == 0 { | |
| 490 | + | return cls, cerr | |
| 491 | + | } | |
| 492 | + | cls = &Credentials{} | |
| 493 | + | cls.Ptr = cret | |
| 494 | + | if cerr == nil { | |
| 495 | + | return cls, nil | |
| 496 | + | } | |
| 497 | + | return cls, cerr | |
| 444 | 498 | ||
| 445 | 499 | } | |
| 446 | 500 | ||
| @@ -449,8 +503,8 @@ var xSocketGetFamily func(uintptr) SocketFamily | |||
| 449 | 503 | // Gets the socket family of the socket. | |
| 450 | 504 | func (x *Socket) GetFamily() SocketFamily { | |
| 451 | 505 | ||
| 452 | - | return xSocketGetFamily(x.GoPointer()) | |
| 453 | - | ||
| 506 | + | cret := xSocketGetFamily(x.GoPointer()) | |
| 507 | + | return cret | |
| 454 | 508 | } | |
| 455 | 509 | ||
| 456 | 510 | var xSocketGetFd func(uintptr) int | |
| @@ -462,8 +516,8 @@ var xSocketGetFd func(uintptr) int | |||
| 462 | 516 | // on the socket. | |
| 463 | 517 | func (x *Socket) GetFd() int { | |
| 464 | 518 | ||
| 465 | - | return xSocketGetFd(x.GoPointer()) | |
| 466 | - | ||
| 519 | + | cret := xSocketGetFd(x.GoPointer()) | |
| 520 | + | return cret | |
| 467 | 521 | } | |
| 468 | 522 | ||
| 469 | 523 | var xSocketGetKeepalive func(uintptr) bool | |
| @@ -472,8 +526,8 @@ var xSocketGetKeepalive func(uintptr) bool | |||
| 472 | 526 | // see g_socket_set_keepalive(). | |
| 473 | 527 | func (x *Socket) GetKeepalive() bool { | |
| 474 | 528 | ||
| 475 | - | return xSocketGetKeepalive(x.GoPointer()) | |
| 476 | - | ||
| 529 | + | cret := xSocketGetKeepalive(x.GoPointer()) | |
| 530 | + | return cret | |
| 477 | 531 | } | |
| 478 | 532 | ||
| 479 | 533 | var xSocketGetListenBacklog func(uintptr) int | |
| @@ -482,8 +536,8 @@ var xSocketGetListenBacklog func(uintptr) int | |||
| 482 | 536 | // see g_socket_set_listen_backlog(). | |
| 483 | 537 | func (x *Socket) GetListenBacklog() int { | |
| 484 | 538 | ||
| 485 | - | return xSocketGetListenBacklog(x.GoPointer()) | |
| 486 | - | ||
| 539 | + | cret := xSocketGetListenBacklog(x.GoPointer()) | |
| 540 | + | return cret | |
| 487 | 541 | } | |
| 488 | 542 | ||
| 489 | 543 | var xSocketGetLocalAddress func(uintptr) uintptr | |
| @@ -491,16 +545,21 @@ var xSocketGetLocalAddress func(uintptr) uintptr | |||
| 491 | 545 | // Try to get the local address of a bound socket. This is only | |
| 492 | 546 | // useful if the socket has been bound to a local address, | |
| 493 | 547 | // either explicitly or implicitly when connecting. | |
| 494 | - | func (x *Socket) GetLocalAddress() *SocketAddress { | |
| 548 | + | func (x *Socket) GetLocalAddress() (*SocketAddress, error) { | |
| 549 | + | var cls *SocketAddress | |
| 550 | + | var cerr *glib.Error | |
| 495 | 551 | ||
| 496 | - | GetLocalAddressPtr := xSocketGetLocalAddress(x.GoPointer()) | |
| 497 | - | if GetLocalAddressPtr == 0 { | |
| 498 | - | return nil | |
| 499 | - | } | |
| 552 | + | cret := xSocketGetLocalAddress(x.GoPointer()) | |
| 500 | 553 | ||
| 501 | - | GetLocalAddressCls := &SocketAddress{} | |
| 502 | - | GetLocalAddressCls.Ptr = GetLocalAddressPtr | |
| 503 | - | return GetLocalAddressCls | |
| 554 | + | if cret == 0 { | |
| 555 | + | return cls, cerr | |
| 556 | + | } | |
| 557 | + | cls = &SocketAddress{} | |
| 558 | + | cls.Ptr = cret | |
| 559 | + | if cerr == nil { | |
| 560 | + | return cls, nil | |
| 561 | + | } | |
| 562 | + | return cls, cerr | |
| 504 | 563 | ||
| 505 | 564 | } | |
| 506 | 565 | ||
| @@ -511,8 +570,8 @@ var xSocketGetMulticastLoopback func(uintptr) bool | |||
| 511 | 570 | // multicast listeners on the same host. | |
| 512 | 571 | func (x *Socket) GetMulticastLoopback() bool { | |
| 513 | 572 | ||
| 514 | - | return xSocketGetMulticastLoopback(x.GoPointer()) | |
| 515 | - | ||
| 573 | + | cret := xSocketGetMulticastLoopback(x.GoPointer()) | |
| 574 | + | return cret | |
| 516 | 575 | } | |
| 517 | 576 | ||
| 518 | 577 | var xSocketGetMulticastTtl func(uintptr) uint | |
| @@ -521,11 +580,11 @@ var xSocketGetMulticastTtl func(uintptr) uint | |||
| 521 | 580 | // g_socket_set_multicast_ttl() for more details. | |
| 522 | 581 | func (x *Socket) GetMulticastTtl() uint { | |
| 523 | 582 | ||
| 524 | - | return xSocketGetMulticastTtl(x.GoPointer()) | |
| 525 | - | ||
| 583 | + | cret := xSocketGetMulticastTtl(x.GoPointer()) | |
| 584 | + | return cret | |
| 526 | 585 | } | |
| 527 | 586 | ||
| 528 | - | var xSocketGetOption func(uintptr, int, int, int) bool | |
| 587 | + | var xSocketGetOption func(uintptr, int, int, int, **glib.Error) bool | |
| 529 | 588 | ||
| 530 | 589 | // Gets the value of an integer-valued option on @socket, as with | |
| 531 | 590 | // getsockopt(). (If you need to fetch a non-integer-valued option, | |
| @@ -540,9 +599,14 @@ var xSocketGetOption func(uintptr, int, int, int) bool | |||
| 540 | 599 | // Note that even for socket options that are a single byte in size, | |
| 541 | 600 | // @value is still a pointer to a #gint variable, not a #guchar; | |
| 542 | 601 | // g_socket_get_option() will handle the conversion internally. | |
| 543 | - | func (x *Socket) GetOption(LevelVar int, OptnameVar int, ValueVar int) bool { | |
| 602 | + | func (x *Socket) GetOption(LevelVar int, OptnameVar int, ValueVar int) (bool, error) { | |
| 603 | + | var cerr *glib.Error | |
| 544 | 604 | ||
| 545 | - | return xSocketGetOption(x.GoPointer(), LevelVar, OptnameVar, ValueVar) | |
| 605 | + | cret := xSocketGetOption(x.GoPointer(), LevelVar, OptnameVar, ValueVar, &cerr) | |
| 606 | + | if cerr == nil { | |
| 607 | + | return cret, nil | |
| 608 | + | } | |
| 609 | + | return cret, cerr | |
| 546 | 610 | ||
| 547 | 611 | } | |
| 548 | 612 | ||
| @@ -552,24 +616,29 @@ var xSocketGetProtocol func(uintptr) SocketProtocol | |||
| 552 | 616 | // In case the protocol is unknown, -1 is returned. | |
| 553 | 617 | func (x *Socket) GetProtocol() SocketProtocol { | |
| 554 | 618 | ||
| 555 | - | return xSocketGetProtocol(x.GoPointer()) | |
| 556 | - | ||
| 619 | + | cret := xSocketGetProtocol(x.GoPointer()) | |
| 620 | + | return cret | |
| 557 | 621 | } | |
| 558 | 622 | ||
| 559 | 623 | var xSocketGetRemoteAddress func(uintptr) uintptr | |
| 560 | 624 | ||
| 561 | 625 | // Try to get the remote address of a connected socket. This is only | |
| 562 | 626 | // useful for connection oriented sockets that have been connected. | |
| 563 | - | func (x *Socket) GetRemoteAddress() *SocketAddress { | |
| 627 | + | func (x *Socket) GetRemoteAddress() (*SocketAddress, error) { | |
| 628 | + | var cls *SocketAddress | |
| 629 | + | var cerr *glib.Error | |
| 564 | 630 | ||
| 565 | - | GetRemoteAddressPtr := xSocketGetRemoteAddress(x.GoPointer()) | |
| 566 | - | if GetRemoteAddressPtr == 0 { | |
| 567 | - | return nil | |
| 568 | - | } | |
| 631 | + | cret := xSocketGetRemoteAddress(x.GoPointer()) | |
| 569 | 632 | ||
| 570 | - | GetRemoteAddressCls := &SocketAddress{} | |
| 571 | - | GetRemoteAddressCls.Ptr = GetRemoteAddressPtr | |
| 572 | - | return GetRemoteAddressCls | |
| 633 | + | if cret == 0 { | |
| 634 | + | return cls, cerr | |
| 635 | + | } | |
| 636 | + | cls = &SocketAddress{} | |
| 637 | + | cls.Ptr = cret | |
| 638 | + | if cerr == nil { | |
| 639 | + | return cls, nil | |
| 640 | + | } | |
| 641 | + | return cls, cerr | |
| 573 | 642 | ||
| 574 | 643 | } | |
| 575 | 644 | ||
| @@ -578,8 +647,8 @@ var xSocketGetSocketType func(uintptr) SocketType | |||
| 578 | 647 | // Gets the socket type of the socket. | |
| 579 | 648 | func (x *Socket) GetSocketType() SocketType { | |
| 580 | 649 | ||
| 581 | - | return xSocketGetSocketType(x.GoPointer()) | |
| 582 | - | ||
| 650 | + | cret := xSocketGetSocketType(x.GoPointer()) | |
| 651 | + | return cret | |
| 583 | 652 | } | |
| 584 | 653 | ||
| 585 | 654 | var xSocketGetTimeout func(uintptr) uint | |
| @@ -588,8 +657,8 @@ var xSocketGetTimeout func(uintptr) uint | |||
| 588 | 657 | // g_socket_set_timeout(). | |
| 589 | 658 | func (x *Socket) GetTimeout() uint { | |
| 590 | 659 | ||
| 591 | - | return xSocketGetTimeout(x.GoPointer()) | |
| 592 | - | ||
| 660 | + | cret := xSocketGetTimeout(x.GoPointer()) | |
| 661 | + | return cret | |
| 593 | 662 | } | |
| 594 | 663 | ||
| 595 | 664 | var xSocketGetTtl func(uintptr) uint | |
| @@ -598,8 +667,8 @@ var xSocketGetTtl func(uintptr) uint | |||
| 598 | 667 | // g_socket_set_ttl() for more details. | |
| 599 | 668 | func (x *Socket) GetTtl() uint { | |
| 600 | 669 | ||
| 601 | - | return xSocketGetTtl(x.GoPointer()) | |
| 602 | - | ||
| 670 | + | cret := xSocketGetTtl(x.GoPointer()) | |
| 671 | + | return cret | |
| 603 | 672 | } | |
| 604 | 673 | ||
| 605 | 674 | var xSocketIsClosed func(uintptr) bool | |
| @@ -607,8 +676,8 @@ var xSocketIsClosed func(uintptr) bool | |||
| 607 | 676 | // Checks whether a socket is closed. | |
| 608 | 677 | func (x *Socket) IsClosed() bool { | |
| 609 | 678 | ||
| 610 | - | return xSocketIsClosed(x.GoPointer()) | |
| 611 | - | ||
| 679 | + | cret := xSocketIsClosed(x.GoPointer()) | |
| 680 | + | return cret | |
| 612 | 681 | } | |
| 613 | 682 | ||
| 614 | 683 | var xSocketIsConnected func(uintptr) bool | |
| @@ -622,11 +691,11 @@ var xSocketIsConnected func(uintptr) bool | |||
| 622 | 691 | // g_socket_check_connect_result(). | |
| 623 | 692 | func (x *Socket) IsConnected() bool { | |
| 624 | 693 | ||
| 625 | - | return xSocketIsConnected(x.GoPointer()) | |
| 626 | - | ||
| 694 | + | cret := xSocketIsConnected(x.GoPointer()) | |
| 695 | + | return cret | |
| 627 | 696 | } | |
| 628 | 697 | ||
| 629 | - | var xSocketJoinMulticastGroup func(uintptr, uintptr, bool, string) bool | |
| 698 | + | var xSocketJoinMulticastGroup func(uintptr, uintptr, bool, string, **glib.Error) bool | |
| 630 | 699 | ||
| 631 | 700 | // Registers @socket to receive multicast messages sent to @group. | |
| 632 | 701 | // @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have | |
| @@ -642,13 +711,18 @@ var xSocketJoinMulticastGroup func(uintptr, uintptr, bool, string) bool | |||
| 642 | 711 | // | |
| 643 | 712 | // To bind to a given source-specific multicast address, use | |
| 644 | 713 | // g_socket_join_multicast_group_ssm() instead. | |
| 645 | - | func (x *Socket) JoinMulticastGroup(GroupVar *InetAddress, SourceSpecificVar bool, IfaceVar string) bool { | |
| 714 | + | func (x *Socket) JoinMulticastGroup(GroupVar *InetAddress, SourceSpecificVar bool, IfaceVar string) (bool, error) { | |
| 715 | + | var cerr *glib.Error | |
| 646 | 716 | ||
| 647 | - | return xSocketJoinMulticastGroup(x.GoPointer(), GroupVar.GoPointer(), SourceSpecificVar, IfaceVar) | |
| 717 | + | cret := xSocketJoinMulticastGroup(x.GoPointer(), GroupVar.GoPointer(), SourceSpecificVar, IfaceVar, &cerr) | |
| 718 | + | if cerr == nil { | |
| 719 | + | return cret, nil | |
| 720 | + | } | |
| 721 | + | return cret, cerr | |
| 648 | 722 | ||
| 649 | 723 | } | |
| 650 | 724 | ||
| 651 | - | var xSocketJoinMulticastGroupSsm func(uintptr, uintptr, uintptr, string) bool | |
| 725 | + | var xSocketJoinMulticastGroupSsm func(uintptr, uintptr, uintptr, string, **glib.Error) bool | |
| 652 | 726 | ||
| 653 | 727 | // Registers @socket to receive multicast messages sent to @group. | |
| 654 | 728 | // @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have | |
| @@ -665,13 +739,18 @@ var xSocketJoinMulticastGroupSsm func(uintptr, uintptr, uintptr, string) bool | |||
| 665 | 739 | // Note that this function can be called multiple times for the same | |
| 666 | 740 | // @group with different @source_specific in order to receive multicast | |
| 667 | 741 | // packets from more than one source. | |
| 668 | - | func (x *Socket) JoinMulticastGroupSsm(GroupVar *InetAddress, SourceSpecificVar *InetAddress, IfaceVar string) bool { | |
| 742 | + | func (x *Socket) JoinMulticastGroupSsm(GroupVar *InetAddress, SourceSpecificVar *InetAddress, IfaceVar string) (bool, error) { | |
| 743 | + | var cerr *glib.Error | |
| 669 | 744 | ||
| 670 | - | return xSocketJoinMulticastGroupSsm(x.GoPointer(), GroupVar.GoPointer(), SourceSpecificVar.GoPointer(), IfaceVar) | |
| 745 | + | cret := xSocketJoinMulticastGroupSsm(x.GoPointer(), GroupVar.GoPointer(), SourceSpecificVar.GoPointer(), IfaceVar, &cerr) | |
| 746 | + | if cerr == nil { | |
| 747 | + | return cret, nil | |
| 748 | + | } | |
| 749 | + | return cret, cerr | |
| 671 | 750 | ||
| 672 | 751 | } | |
| 673 | 752 | ||
| 674 | - | var xSocketLeaveMulticastGroup func(uintptr, uintptr, bool, string) bool | |
| 753 | + | var xSocketLeaveMulticastGroup func(uintptr, uintptr, bool, string, **glib.Error) bool | |
| 675 | 754 | ||
| 676 | 755 | // Removes @socket from the multicast group defined by @group, @iface, | |
| 677 | 756 | // and @source_specific (which must all have the same values they had | |
| @@ -682,13 +761,18 @@ var xSocketLeaveMulticastGroup func(uintptr, uintptr, bool, string) bool | |||
| 682 | 761 | // | |
| 683 | 762 | // To unbind to a given source-specific multicast address, use | |
| 684 | 763 | // g_socket_leave_multicast_group_ssm() instead. | |
| 685 | - | func (x *Socket) LeaveMulticastGroup(GroupVar *InetAddress, SourceSpecificVar bool, IfaceVar string) bool { | |
| 764 | + | func (x *Socket) LeaveMulticastGroup(GroupVar *InetAddress, SourceSpecificVar bool, IfaceVar string) (bool, error) { | |
| 765 | + | var cerr *glib.Error | |
| 686 | 766 | ||
| 687 | - | return xSocketLeaveMulticastGroup(x.GoPointer(), GroupVar.GoPointer(), SourceSpecificVar, IfaceVar) | |
| 767 | + | cret := xSocketLeaveMulticastGroup(x.GoPointer(), GroupVar.GoPointer(), SourceSpecificVar, IfaceVar, &cerr) | |
| 768 | + | if cerr == nil { | |
| 769 | + | return cret, nil | |
| 770 | + | } | |
| 771 | + | return cret, cerr | |
| 688 | 772 | ||
| 689 | 773 | } | |
| 690 | 774 | ||
| 691 | - | var xSocketLeaveMulticastGroupSsm func(uintptr, uintptr, uintptr, string) bool | |
| 775 | + | var xSocketLeaveMulticastGroupSsm func(uintptr, uintptr, uintptr, string, **glib.Error) bool | |
| 692 | 776 | ||
| 693 | 777 | // Removes @socket from the multicast group defined by @group, @iface, | |
| 694 | 778 | // and @source_specific (which must all have the same values they had | |
| @@ -696,9 +780,14 @@ var xSocketLeaveMulticastGroupSsm func(uintptr, uintptr, uintptr, string) bool | |||
| 696 | 780 | // | |
| 697 | 781 | // @socket remains bound to its address and port, and can still receive | |
| 698 | 782 | // unicast messages after calling this. | |
| 699 | - | func (x *Socket) LeaveMulticastGroupSsm(GroupVar *InetAddress, SourceSpecificVar *InetAddress, IfaceVar string) bool { | |
| 783 | + | func (x *Socket) LeaveMulticastGroupSsm(GroupVar *InetAddress, SourceSpecificVar *InetAddress, IfaceVar string) (bool, error) { | |
| 784 | + | var cerr *glib.Error | |
| 700 | 785 | ||
| 701 | - | return xSocketLeaveMulticastGroupSsm(x.GoPointer(), GroupVar.GoPointer(), SourceSpecificVar.GoPointer(), IfaceVar) | |
| 786 | + | cret := xSocketLeaveMulticastGroupSsm(x.GoPointer(), GroupVar.GoPointer(), SourceSpecificVar.GoPointer(), IfaceVar, &cerr) | |
| 787 | + | if cerr == nil { | |
| 788 | + | return cret, nil | |
| 789 | + | } | |
| 790 | + | return cret, cerr | |
| 702 | 791 | ||
| 703 | 792 | } | |
| 704 | 793 | ||
| @@ -712,13 +801,18 @@ var xSocketListen func(uintptr) bool | |||
| 712 | 801 | // | |
| 713 | 802 | // To set the maximum amount of outstanding clients, use | |
| 714 | 803 | // g_socket_set_listen_backlog(). | |
| 715 | - | func (x *Socket) Listen() bool { | |
| 804 | + | func (x *Socket) Listen() (bool, error) { | |
| 805 | + | var cerr *glib.Error | |
| 716 | 806 | ||
| 717 | - | return xSocketListen(x.GoPointer()) | |
| 807 | + | cret := xSocketListen(x.GoPointer()) | |
| 808 | + | if cerr == nil { | |
| 809 | + | return cret, nil | |
| 810 | + | } | |
| 811 | + | return cret, cerr | |
| 718 | 812 | ||
| 719 | 813 | } | |
| 720 | 814 | ||
| 721 | - | var xSocketReceive func(uintptr, uintptr, uint, uintptr) int | |
| 815 | + | var xSocketReceive func(uintptr, uintptr, uint, uintptr, **glib.Error) int | |
| 722 | 816 | ||
| 723 | 817 | // Receive data (up to @size bytes) from a socket. This is mainly used by | |
| 724 | 818 | // connection-oriented sockets; it is identical to g_socket_receive_from() | |
| @@ -743,13 +837,18 @@ var xSocketReceive func(uintptr, uintptr, uint, uintptr) int | |||
| 743 | 837 | // %G_IO_IN condition. | |
| 744 | 838 | // | |
| 745 | 839 | // On error -1 is returned and @error is set accordingly. | |
| 746 | - | func (x *Socket) Receive(BufferVar uintptr, SizeVar uint, CancellableVar *Cancellable) int { | |
| 840 | + | func (x *Socket) Receive(BufferVar uintptr, SizeVar uint, CancellableVar *Cancellable) (int, error) { | |
| 841 | + | var cerr *glib.Error | |
| 747 | 842 | ||
| 748 | - | return xSocketReceive(x.GoPointer(), BufferVar, SizeVar, CancellableVar.GoPointer()) | |
| 843 | + | cret := xSocketReceive(x.GoPointer(), BufferVar, SizeVar, CancellableVar.GoPointer(), &cerr) | |
| 844 | + | if cerr == nil { | |
| 845 | + | return cret, nil | |
| 846 | + | } | |
| 847 | + | return cret, cerr | |
| 749 | 848 | ||
| 750 | 849 | } | |
| 751 | 850 | ||
| 752 | - | var xSocketReceiveFrom func(uintptr, *uintptr, uintptr, uint, uintptr) int | |
| 851 | + | var xSocketReceiveFrom func(uintptr, *uintptr, uintptr, uint, uintptr, **glib.Error) int | |
| 753 | 852 | ||
| 754 | 853 | // Receive data (up to @size bytes) from a socket. | |
| 755 | 854 | // | |
| @@ -758,13 +857,18 @@ var xSocketReceiveFrom func(uintptr, *uintptr, uintptr, uint, uintptr) int | |||
| 758 | 857 | // @address is owned by the caller. | |
| 759 | 858 | // | |
| 760 | 859 | // See g_socket_receive() for additional information. | |
| 761 | - | func (x *Socket) ReceiveFrom(AddressVar **SocketAddress, BufferVar uintptr, SizeVar uint, CancellableVar *Cancellable) int { | |
| 860 | + | func (x *Socket) ReceiveFrom(AddressVar **SocketAddress, BufferVar uintptr, SizeVar uint, CancellableVar *Cancellable) (int, error) { | |
| 861 | + | var cerr *glib.Error | |
| 762 | 862 | ||
| 763 | - | return xSocketReceiveFrom(x.GoPointer(), gobject.ConvertPtr(AddressVar), BufferVar, SizeVar, CancellableVar.GoPointer()) | |
| 863 | + | cret := xSocketReceiveFrom(x.GoPointer(), gobject.ConvertPtr(AddressVar), BufferVar, SizeVar, CancellableVar.GoPointer(), &cerr) | |
| 864 | + | if cerr == nil { | |
| 865 | + | return cret, nil | |
| 866 | + | } | |
| 867 | + | return cret, cerr | |
| 764 | 868 | ||
| 765 | 869 | } | |
| 766 | 870 | ||
| 767 | - | var xSocketReceiveMessage func(uintptr, *uintptr, uintptr, int, uintptr, int, int, uintptr) int | |
| 871 | + | var xSocketReceiveMessage func(uintptr, *uintptr, uintptr, int, uintptr, int, int, uintptr, **glib.Error) int | |
| 768 | 872 | ||
| 769 | 873 | // Receive data from a socket. For receiving multiple messages, see | |
| 770 | 874 | // g_socket_receive_messages(); for easier use, see | |
| @@ -825,13 +929,18 @@ var xSocketReceiveMessage func(uintptr, *uintptr, uintptr, int, uintptr, int, in | |||
| 825 | 929 | // %G_IO_IN condition. | |
| 826 | 930 | // | |
| 827 | 931 | // On error -1 is returned and @error is set accordingly. | |
| 828 | - | func (x *Socket) ReceiveMessage(AddressVar **SocketAddress, VectorsVar uintptr, NumVectorsVar int, MessagesVar uintptr, NumMessagesVar int, FlagsVar int, CancellableVar *Cancellable) int { | |
| 932 | + | func (x *Socket) ReceiveMessage(AddressVar **SocketAddress, VectorsVar uintptr, NumVectorsVar int, MessagesVar uintptr, NumMessagesVar int, FlagsVar int, CancellableVar *Cancellable) (int, error) { | |
| 933 | + | var cerr *glib.Error | |
| 829 | 934 | ||
| 830 | - | return xSocketReceiveMessage(x.GoPointer(), gobject.ConvertPtr(AddressVar), VectorsVar, NumVectorsVar, MessagesVar, NumMessagesVar, FlagsVar, CancellableVar.GoPointer()) | |
| 935 | + | cret := xSocketReceiveMessage(x.GoPointer(), gobject.ConvertPtr(AddressVar), VectorsVar, NumVectorsVar, MessagesVar, NumMessagesVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 936 | + | if cerr == nil { | |
| 937 | + | return cret, nil | |
| 938 | + | } | |
| 939 | + | return cret, cerr | |
| 831 | 940 | ||
| 832 | 941 | } | |
| 833 | 942 | ||
| 834 | - | var xSocketReceiveMessages func(uintptr, uintptr, uint, int, uintptr) int | |
| 943 | + | var xSocketReceiveMessages func(uintptr, uintptr, uint, int, uintptr, **glib.Error) int | |
| 835 | 944 | ||
| 836 | 945 | // Receive multiple data messages from @socket in one go. This is the most | |
| 837 | 946 | // complicated and fully-featured version of this call. For easier use, see | |
| @@ -881,24 +990,34 @@ var xSocketReceiveMessages func(uintptr, uintptr, uint, int, uintptr) int | |||
| 881 | 990 | // On error -1 is returned and @error is set accordingly. An error will only | |
| 882 | 991 | // be returned if zero messages could be received; otherwise the number of | |
| 883 | 992 | // messages successfully received before the error will be returned. | |
| 884 | - | func (x *Socket) ReceiveMessages(MessagesVar uintptr, NumMessagesVar uint, FlagsVar int, CancellableVar *Cancellable) int { | |
| 993 | + | func (x *Socket) ReceiveMessages(MessagesVar uintptr, NumMessagesVar uint, FlagsVar int, CancellableVar *Cancellable) (int, error) { | |
| 994 | + | var cerr *glib.Error | |
| 885 | 995 | ||
| 886 | - | return xSocketReceiveMessages(x.GoPointer(), MessagesVar, NumMessagesVar, FlagsVar, CancellableVar.GoPointer()) | |
| 996 | + | cret := xSocketReceiveMessages(x.GoPointer(), MessagesVar, NumMessagesVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 997 | + | if cerr == nil { | |
| 998 | + | return cret, nil | |
| 999 | + | } | |
| 1000 | + | return cret, cerr | |
| 887 | 1001 | ||
| 888 | 1002 | } | |
| 889 | 1003 | ||
| 890 | - | var xSocketReceiveWithBlocking func(uintptr, uintptr, uint, bool, uintptr) int | |
| 1004 | + | var xSocketReceiveWithBlocking func(uintptr, uintptr, uint, bool, uintptr, **glib.Error) int | |
| 891 | 1005 | ||
| 892 | 1006 | // This behaves exactly the same as g_socket_receive(), except that | |
| 893 | 1007 | // the choice of blocking or non-blocking behavior is determined by | |
| 894 | 1008 | // the @blocking argument rather than by @socket's properties. | |
| 895 | - | func (x *Socket) ReceiveWithBlocking(BufferVar uintptr, SizeVar uint, BlockingVar bool, CancellableVar *Cancellable) int { | |
| 1009 | + | func (x *Socket) ReceiveWithBlocking(BufferVar uintptr, SizeVar uint, BlockingVar bool, CancellableVar *Cancellable) (int, error) { | |
| 1010 | + | var cerr *glib.Error | |
| 896 | 1011 | ||
| 897 | - | return xSocketReceiveWithBlocking(x.GoPointer(), BufferVar, SizeVar, BlockingVar, CancellableVar.GoPointer()) | |
| 1012 | + | cret := xSocketReceiveWithBlocking(x.GoPointer(), BufferVar, SizeVar, BlockingVar, CancellableVar.GoPointer(), &cerr) | |
| 1013 | + | if cerr == nil { | |
| 1014 | + | return cret, nil | |
| 1015 | + | } | |
| 1016 | + | return cret, cerr | |
| 898 | 1017 | ||
| 899 | 1018 | } | |
| 900 | 1019 | ||
| 901 | - | var xSocketSend func(uintptr, uintptr, uint, uintptr) int | |
| 1020 | + | var xSocketSend func(uintptr, uintptr, uint, uintptr, **glib.Error) int | |
| 902 | 1021 | ||
| 903 | 1022 | // Tries to send @size bytes from @buffer on the socket. This is | |
| 904 | 1023 | // mainly used by connection-oriented sockets; it is identical to | |
| @@ -914,13 +1033,18 @@ var xSocketSend func(uintptr, uintptr, uint, uintptr) int | |||
| 914 | 1033 | // very common due to the way the underlying APIs work.) | |
| 915 | 1034 | // | |
| 916 | 1035 | // On error -1 is returned and @error is set accordingly. | |
| 917 | - | func (x *Socket) Send(BufferVar uintptr, SizeVar uint, CancellableVar *Cancellable) int { | |
| 1036 | + | func (x *Socket) Send(BufferVar uintptr, SizeVar uint, CancellableVar *Cancellable) (int, error) { | |
| 1037 | + | var cerr *glib.Error | |
| 918 | 1038 | ||
| 919 | - | return xSocketSend(x.GoPointer(), BufferVar, SizeVar, CancellableVar.GoPointer()) | |
| 1039 | + | cret := xSocketSend(x.GoPointer(), BufferVar, SizeVar, CancellableVar.GoPointer(), &cerr) | |
| 1040 | + | if cerr == nil { | |
| 1041 | + | return cret, nil | |
| 1042 | + | } | |
| 1043 | + | return cret, cerr | |
| 920 | 1044 | ||
| 921 | 1045 | } | |
| 922 | 1046 | ||
| 923 | - | var xSocketSendMessage func(uintptr, uintptr, uintptr, int, uintptr, int, int, uintptr) int | |
| 1047 | + | var xSocketSendMessage func(uintptr, uintptr, uintptr, int, uintptr, int, int, uintptr, **glib.Error) int | |
| 924 | 1048 | ||
| 925 | 1049 | // Send data to @address on @socket. For sending multiple messages see | |
| 926 | 1050 | // g_socket_send_messages(); for easier use, see | |
| @@ -964,13 +1088,18 @@ var xSocketSendMessage func(uintptr, uintptr, uintptr, int, uintptr, int, int, u | |||
| 964 | 1088 | // function. | |
| 965 | 1089 | // | |
| 966 | 1090 | // On error -1 is returned and @error is set accordingly. | |
| 967 | - | func (x *Socket) SendMessage(AddressVar *SocketAddress, VectorsVar uintptr, NumVectorsVar int, MessagesVar uintptr, NumMessagesVar int, FlagsVar int, CancellableVar *Cancellable) int { | |
| 1091 | + | func (x *Socket) SendMessage(AddressVar *SocketAddress, VectorsVar uintptr, NumVectorsVar int, MessagesVar uintptr, NumMessagesVar int, FlagsVar int, CancellableVar *Cancellable) (int, error) { | |
| 1092 | + | var cerr *glib.Error | |
| 968 | 1093 | ||
| 969 | - | return xSocketSendMessage(x.GoPointer(), AddressVar.GoPointer(), VectorsVar, NumVectorsVar, MessagesVar, NumMessagesVar, FlagsVar, CancellableVar.GoPointer()) | |
| 1094 | + | cret := xSocketSendMessage(x.GoPointer(), AddressVar.GoPointer(), VectorsVar, NumVectorsVar, MessagesVar, NumMessagesVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 1095 | + | if cerr == nil { | |
| 1096 | + | return cret, nil | |
| 1097 | + | } | |
| 1098 | + | return cret, cerr | |
| 970 | 1099 | ||
| 971 | 1100 | } | |
| 972 | 1101 | ||
| 973 | - | var xSocketSendMessageWithTimeout func(uintptr, uintptr, uintptr, int, uintptr, int, int, int64, uint, uintptr) PollableReturn | |
| 1102 | + | var xSocketSendMessageWithTimeout func(uintptr, uintptr, uintptr, int, uintptr, int, int, int64, uint, uintptr, **glib.Error) PollableReturn | |
| 974 | 1103 | ||
| 975 | 1104 | // This behaves exactly the same as g_socket_send_message(), except that | |
| 976 | 1105 | // the choice of timeout behavior is determined by the @timeout_us argument | |
| @@ -979,13 +1108,18 @@ var xSocketSendMessageWithTimeout func(uintptr, uintptr, uintptr, int, uintptr, | |||
| 979 | 1108 | // On error %G_POLLABLE_RETURN_FAILED is returned and @error is set accordingly, or | |
| 980 | 1109 | // if the socket is currently not writable %G_POLLABLE_RETURN_WOULD_BLOCK is | |
| 981 | 1110 | // returned. @bytes_written will contain 0 in both cases. | |
| 982 | - | func (x *Socket) SendMessageWithTimeout(AddressVar *SocketAddress, VectorsVar uintptr, NumVectorsVar int, MessagesVar uintptr, NumMessagesVar int, FlagsVar int, TimeoutUsVar int64, BytesWrittenVar uint, CancellableVar *Cancellable) PollableReturn { | |
| 1111 | + | func (x *Socket) SendMessageWithTimeout(AddressVar *SocketAddress, VectorsVar uintptr, NumVectorsVar int, MessagesVar uintptr, NumMessagesVar int, FlagsVar int, TimeoutUsVar int64, BytesWrittenVar uint, CancellableVar *Cancellable) (PollableReturn, error) { | |
| 1112 | + | var cerr *glib.Error | |
| 983 | 1113 | ||
| 984 | - | return xSocketSendMessageWithTimeout(x.GoPointer(), AddressVar.GoPointer(), VectorsVar, NumVectorsVar, MessagesVar, NumMessagesVar, FlagsVar, TimeoutUsVar, BytesWrittenVar, CancellableVar.GoPointer()) | |
| 1114 | + | cret := xSocketSendMessageWithTimeout(x.GoPointer(), AddressVar.GoPointer(), VectorsVar, NumVectorsVar, MessagesVar, NumMessagesVar, FlagsVar, TimeoutUsVar, BytesWrittenVar, CancellableVar.GoPointer(), &cerr) | |
| 1115 | + | if cerr == nil { | |
| 1116 | + | return cret, nil | |
| 1117 | + | } | |
| 1118 | + | return cret, cerr | |
| 985 | 1119 | ||
| 986 | 1120 | } | |
| 987 | 1121 | ||
| 988 | - | var xSocketSendMessages func(uintptr, uintptr, uint, int, uintptr) int | |
| 1122 | + | var xSocketSendMessages func(uintptr, uintptr, uint, int, uintptr, **glib.Error) int | |
| 989 | 1123 | ||
| 990 | 1124 | // Send multiple data messages from @socket in one go. This is the most | |
| 991 | 1125 | // complicated and fully-featured version of this call. For easier use, see | |
| @@ -1021,33 +1155,48 @@ var xSocketSendMessages func(uintptr, uintptr, uint, int, uintptr) int | |||
| 1021 | 1155 | // On error -1 is returned and @error is set accordingly. An error will only | |
| 1022 | 1156 | // be returned if zero messages could be sent; otherwise the number of messages | |
| 1023 | 1157 | // successfully sent before the error will be returned. | |
| 1024 | - | func (x *Socket) SendMessages(MessagesVar uintptr, NumMessagesVar uint, FlagsVar int, CancellableVar *Cancellable) int { | |
| 1158 | + | func (x *Socket) SendMessages(MessagesVar uintptr, NumMessagesVar uint, FlagsVar int, CancellableVar *Cancellable) (int, error) { | |
| 1159 | + | var cerr *glib.Error | |
| 1025 | 1160 | ||
| 1026 | - | return xSocketSendMessages(x.GoPointer(), MessagesVar, NumMessagesVar, FlagsVar, CancellableVar.GoPointer()) | |
| 1161 | + | cret := xSocketSendMessages(x.GoPointer(), MessagesVar, NumMessagesVar, FlagsVar, CancellableVar.GoPointer(), &cerr) | |
| 1162 | + | if cerr == nil { | |
| 1163 | + | return cret, nil | |
| 1164 | + | } | |
| 1165 | + | return cret, cerr | |
| 1027 | 1166 | ||
| 1028 | 1167 | } | |
| 1029 | 1168 | ||
| 1030 | - | var xSocketSendTo func(uintptr, uintptr, uintptr, uint, uintptr) int | |
| 1169 | + | var xSocketSendTo func(uintptr, uintptr, uintptr, uint, uintptr, **glib.Error) int | |
| 1031 | 1170 | ||
| 1032 | 1171 | // Tries to send @size bytes from @buffer to @address. If @address is | |
| 1033 | 1172 | // %NULL then the message is sent to the default receiver (set by | |
| 1034 | 1173 | // g_socket_connect()). | |
| 1035 | 1174 | // | |
| 1036 | 1175 | // See g_socket_send() for additional information. | |
| 1037 | - | func (x *Socket) SendTo(AddressVar *SocketAddress, BufferVar uintptr, SizeVar uint, CancellableVar *Cancellable) int { | |
| 1176 | + | func (x *Socket) SendTo(AddressVar *SocketAddress, BufferVar uintptr, SizeVar uint, CancellableVar *Cancellable) (int, error) { | |
| 1177 | + | var cerr *glib.Error | |
| 1038 | 1178 | ||
| 1039 | - | return xSocketSendTo(x.GoPointer(), AddressVar.GoPointer(), BufferVar, SizeVar, CancellableVar.GoPointer()) | |
| 1179 | + | cret := xSocketSendTo(x.GoPointer(), AddressVar.GoPointer(), BufferVar, SizeVar, CancellableVar.GoPointer(), &cerr) | |
| 1180 | + | if cerr == nil { | |
| 1181 | + | return cret, nil | |
| 1182 | + | } | |
| 1183 | + | return cret, cerr | |
| 1040 | 1184 | ||
| 1041 | 1185 | } | |
| 1042 | 1186 | ||
| 1043 | - | var xSocketSendWithBlocking func(uintptr, uintptr, uint, bool, uintptr) int | |
| 1187 | + | var xSocketSendWithBlocking func(uintptr, uintptr, uint, bool, uintptr, **glib.Error) int | |
| 1044 | 1188 | ||
| 1045 | 1189 | // This behaves exactly the same as g_socket_send(), except that | |
| 1046 | 1190 | // the choice of blocking or non-blocking behavior is determined by | |
| 1047 | 1191 | // the @blocking argument rather than by @socket's properties. | |
| 1048 | - | func (x *Socket) SendWithBlocking(BufferVar uintptr, SizeVar uint, BlockingVar bool, CancellableVar *Cancellable) int { | |
| 1192 | + | func (x *Socket) SendWithBlocking(BufferVar uintptr, SizeVar uint, BlockingVar bool, CancellableVar *Cancellable) (int, error) { | |
| 1193 | + | var cerr *glib.Error | |
| 1049 | 1194 | ||
| 1050 | - | return xSocketSendWithBlocking(x.GoPointer(), BufferVar, SizeVar, BlockingVar, CancellableVar.GoPointer()) | |
| 1195 | + | cret := xSocketSendWithBlocking(x.GoPointer(), BufferVar, SizeVar, BlockingVar, CancellableVar.GoPointer(), &cerr) | |
| 1196 | + | if cerr == nil { | |
| 1197 | + | return cret, nil | |
| 1198 | + | } | |
| 1199 | + | return cret, cerr | |
| 1051 | 1200 | ||
| 1052 | 1201 | } | |
| 1053 | 1202 | ||
| @@ -1138,7 +1287,7 @@ func (x *Socket) SetMulticastTtl(TtlVar uint) { | |||
| 1138 | 1287 | ||
| 1139 | 1288 | } | |
| 1140 | 1289 | ||
| 1141 | - | var xSocketSetOption func(uintptr, int, int, int) bool | |
| 1290 | + | var xSocketSetOption func(uintptr, int, int, int, **glib.Error) bool | |
| 1142 | 1291 | ||
| 1143 | 1292 | // Sets the value of an integer-valued option on @socket, as with | |
| 1144 | 1293 | // setsockopt(). (If you need to set a non-integer-valued option, | |
| @@ -1149,9 +1298,14 @@ var xSocketSetOption func(uintptr, int, int, int) bool | |||
| 1149 | 1298 | // standard/portable socket options. For unusual socket protocols or | |
| 1150 | 1299 | // platform-dependent options, you may need to include additional | |
| 1151 | 1300 | // headers. | |
| 1152 | - | func (x *Socket) SetOption(LevelVar int, OptnameVar int, ValueVar int) bool { | |
| 1301 | + | func (x *Socket) SetOption(LevelVar int, OptnameVar int, ValueVar int) (bool, error) { | |
| 1302 | + | var cerr *glib.Error | |
| 1153 | 1303 | ||
| 1154 | - | return xSocketSetOption(x.GoPointer(), LevelVar, OptnameVar, ValueVar) | |
| 1304 | + | cret := xSocketSetOption(x.GoPointer(), LevelVar, OptnameVar, ValueVar, &cerr) | |
| 1305 | + | if cerr == nil { | |
| 1306 | + | return cret, nil | |
| 1307 | + | } | |
| 1308 | + | return cret, cerr | |
| 1155 | 1309 | ||
| 1156 | 1310 | } | |
| 1157 | 1311 | ||
| @@ -1193,7 +1347,7 @@ func (x *Socket) SetTtl(TtlVar uint) { | |||
| 1193 | 1347 | ||
| 1194 | 1348 | } | |
| 1195 | 1349 | ||
| 1196 | - | var xSocketShutdown func(uintptr, bool, bool) bool | |
| 1350 | + | var xSocketShutdown func(uintptr, bool, bool, **glib.Error) bool | |
| 1197 | 1351 | ||
| 1198 | 1352 | // Shut down part or all of a full-duplex connection. | |
| 1199 | 1353 | // | |
| @@ -1209,9 +1363,14 @@ var xSocketShutdown func(uintptr, bool, bool) bool | |||
| 1209 | 1363 | // graceful disconnect for TCP connections where you close the sending side, | |
| 1210 | 1364 | // then wait for the other side to close the connection, thus ensuring that the | |
| 1211 | 1365 | // other side saw all sent data. | |
| 1212 | - | func (x *Socket) Shutdown(ShutdownReadVar bool, ShutdownWriteVar bool) bool { | |
| 1366 | + | func (x *Socket) Shutdown(ShutdownReadVar bool, ShutdownWriteVar bool) (bool, error) { | |
| 1367 | + | var cerr *glib.Error | |
| 1213 | 1368 | ||
| 1214 | - | return xSocketShutdown(x.GoPointer(), ShutdownReadVar, ShutdownWriteVar) | |
| 1369 | + | cret := xSocketShutdown(x.GoPointer(), ShutdownReadVar, ShutdownWriteVar, &cerr) | |
| 1370 | + | if cerr == nil { | |
| 1371 | + | return cret, nil | |
| 1372 | + | } | |
| 1373 | + | return cret, cerr | |
| 1215 | 1374 | ||
| 1216 | 1375 | } | |
| 1217 | 1376 | ||
| @@ -1228,8 +1387,8 @@ var xSocketSpeaksIpv4 func(uintptr) bool | |||
| 1228 | 1387 | // of speaking IPv4. | |
| 1229 | 1388 | func (x *Socket) SpeaksIpv4() bool { | |
| 1230 | 1389 | ||
| 1231 | - | return xSocketSpeaksIpv4(x.GoPointer()) | |
| 1232 | - | ||
| 1390 | + | cret := xSocketSpeaksIpv4(x.GoPointer()) | |
| 1391 | + | return cret | |
| 1233 | 1392 | } | |
| 1234 | 1393 | ||
| 1235 | 1394 | func (c *Socket) GoPointer() uintptr { | |
| @@ -1278,9 +1437,14 @@ func (c *Socket) SetGoPointer(ptr uintptr) { | |||
| 1278 | 1437 | // In this pattern, a caller would expect to be able to call g_initable_init() | |
| 1279 | 1438 | // on the result of g_object_new(), regardless of whether it is in fact a new | |
| 1280 | 1439 | // instance. | |
| 1281 | - | func (x *Socket) Init(CancellableVar *Cancellable) bool { | |
| 1440 | + | func (x *Socket) Init(CancellableVar *Cancellable) (bool, error) { | |
| 1441 | + | var cerr *glib.Error | |
| 1282 | 1442 | ||
| 1283 | - | return XGInitableInit(x.GoPointer(), CancellableVar.GoPointer()) | |
| 1443 | + | cret := XGInitableInit(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 1444 | + | if cerr == nil { | |
| 1445 | + | return cret, nil | |
| 1446 | + | } | |
| 1447 | + | return cret, cerr | |
| 1284 | 1448 | ||
| 1285 | 1449 | } | |
| 1286 | 1450 | ||
M v4/gio/gsocketaddress.go +40 -32
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -29,14 +30,16 @@ var xNewFromNativeSocketAddress func(uintptr, uint) uintptr | |||
| 29 | 30 | // Creates a #GSocketAddress subclass corresponding to the native | |
| 30 | 31 | // struct sockaddr @native. | |
| 31 | 32 | func NewFromNativeSocketAddress(NativeVar uintptr, LenVar uint) *SocketAddress { | |
| 32 | - | NewFromNativeSocketAddressPtr := xNewFromNativeSocketAddress(NativeVar, LenVar) | |
| 33 | - | if NewFromNativeSocketAddressPtr == 0 { | |
| 34 | - | return nil | |
| 35 | - | } | |
| 33 | + | var cls *SocketAddress | |
| 34 | + | ||
| 35 | + | cret := xNewFromNativeSocketAddress(NativeVar, LenVar) | |
| 36 | 36 | ||
| 37 | - | NewFromNativeSocketAddressCls := &SocketAddress{} | |
| 38 | - | NewFromNativeSocketAddressCls.Ptr = NewFromNativeSocketAddressPtr | |
| 39 | - | return NewFromNativeSocketAddressCls | |
| 37 | + | if cret == 0 { | |
| 38 | + | return cls | |
| 39 | + | } | |
| 40 | + | cls = &SocketAddress{} | |
| 41 | + | cls.Ptr = cret | |
| 42 | + | return cls | |
| 40 | 43 | } | |
| 41 | 44 | ||
| 42 | 45 | var xSocketAddressGetFamily func(uintptr) SocketFamily | |
| @@ -44,8 +47,8 @@ var xSocketAddressGetFamily func(uintptr) SocketFamily | |||
| 44 | 47 | // Gets the socket family type of @address. | |
| 45 | 48 | func (x *SocketAddress) GetFamily() SocketFamily { | |
| 46 | 49 | ||
| 47 | - | return xSocketAddressGetFamily(x.GoPointer()) | |
| 48 | - | ||
| 50 | + | cret := xSocketAddressGetFamily(x.GoPointer()) | |
| 51 | + | return cret | |
| 49 | 52 | } | |
| 50 | 53 | ||
| 51 | 54 | var xSocketAddressGetNativeSize func(uintptr) int | |
| @@ -55,11 +58,11 @@ var xSocketAddressGetNativeSize func(uintptr) int | |||
| 55 | 58 | // g_socket_address_to_native(). | |
| 56 | 59 | func (x *SocketAddress) GetNativeSize() int { | |
| 57 | 60 | ||
| 58 | - | return xSocketAddressGetNativeSize(x.GoPointer()) | |
| 59 | - | ||
| 61 | + | cret := xSocketAddressGetNativeSize(x.GoPointer()) | |
| 62 | + | return cret | |
| 60 | 63 | } | |
| 61 | 64 | ||
| 62 | - | var xSocketAddressToNative func(uintptr, uintptr, uint) bool | |
| 65 | + | var xSocketAddressToNative func(uintptr, uintptr, uint, **glib.Error) bool | |
| 63 | 66 | ||
| 64 | 67 | // Converts a #GSocketAddress to a native struct sockaddr, which can | |
| 65 | 68 | // be passed to low-level functions like connect() or bind(). | |
| @@ -67,9 +70,14 @@ var xSocketAddressToNative func(uintptr, uintptr, uint) bool | |||
| 67 | 70 | // If not enough space is available, a %G_IO_ERROR_NO_SPACE error | |
| 68 | 71 | // is returned. If the address type is not known on the system | |
| 69 | 72 | // then a %G_IO_ERROR_NOT_SUPPORTED error is returned. | |
| 70 | - | func (x *SocketAddress) ToNative(DestVar uintptr, DestlenVar uint) bool { | |
| 73 | + | func (x *SocketAddress) ToNative(DestVar uintptr, DestlenVar uint) (bool, error) { | |
| 74 | + | var cerr *glib.Error | |
| 71 | 75 | ||
| 72 | - | return xSocketAddressToNative(x.GoPointer(), DestVar, DestlenVar) | |
| 76 | + | cret := xSocketAddressToNative(x.GoPointer(), DestVar, DestlenVar, &cerr) | |
| 77 | + | if cerr == nil { | |
| 78 | + | return cret, nil | |
| 79 | + | } | |
| 80 | + | return cret, cerr | |
| 73 | 81 | ||
| 74 | 82 | } | |
| 75 | 83 | ||
| @@ -83,16 +91,16 @@ func (c *SocketAddress) SetGoPointer(ptr uintptr) { | |||
| 83 | 91 | ||
| 84 | 92 | // Creates a #GSocketAddressEnumerator for @connectable. | |
| 85 | 93 | func (x *SocketAddress) Enumerate() *SocketAddressEnumerator { | |
| 94 | + | var cls *SocketAddressEnumerator | |
| 86 | 95 | ||
| 87 | - | EnumeratePtr := XGSocketConnectableEnumerate(x.GoPointer()) | |
| 88 | - | if EnumeratePtr == 0 { | |
| 89 | - | return nil | |
| 90 | - | } | |
| 91 | - | ||
| 92 | - | EnumerateCls := &SocketAddressEnumerator{} | |
| 93 | - | EnumerateCls.Ptr = EnumeratePtr | |
| 94 | - | return EnumerateCls | |
| 96 | + | cret := XGSocketConnectableEnumerate(x.GoPointer()) | |
| 95 | 97 | ||
| 98 | + | if cret == 0 { | |
| 99 | + | return cls | |
| 100 | + | } | |
| 101 | + | cls = &SocketAddressEnumerator{} | |
| 102 | + | cls.Ptr = cret | |
| 103 | + | return cls | |
| 96 | 104 | } | |
| 97 | 105 | ||
| 98 | 106 | // Creates a #GSocketAddressEnumerator for @connectable that will | |
| @@ -103,16 +111,16 @@ func (x *SocketAddress) Enumerate() *SocketAddressEnumerator { | |||
| 103 | 111 | // g_socket_connectable_proxy_enumerate(), this will fall back to | |
| 104 | 112 | // calling g_socket_connectable_enumerate(). | |
| 105 | 113 | func (x *SocketAddress) ProxyEnumerate() *SocketAddressEnumerator { | |
| 114 | + | var cls *SocketAddressEnumerator | |
| 106 | 115 | ||
| 107 | - | ProxyEnumeratePtr := XGSocketConnectableProxyEnumerate(x.GoPointer()) | |
| 108 | - | if ProxyEnumeratePtr == 0 { | |
| 109 | - | return nil | |
| 110 | - | } | |
| 111 | - | ||
| 112 | - | ProxyEnumerateCls := &SocketAddressEnumerator{} | |
| 113 | - | ProxyEnumerateCls.Ptr = ProxyEnumeratePtr | |
| 114 | - | return ProxyEnumerateCls | |
| 116 | + | cret := XGSocketConnectableProxyEnumerate(x.GoPointer()) | |
| 115 | 117 | ||
| 118 | + | if cret == 0 { | |
| 119 | + | return cls | |
| 120 | + | } | |
| 121 | + | cls = &SocketAddressEnumerator{} | |
| 122 | + | cls.Ptr = cret | |
| 123 | + | return cls | |
| 116 | 124 | } | |
| 117 | 125 | ||
| 118 | 126 | // Format a #GSocketConnectable as a string. This is a human-readable format for | |
| @@ -124,8 +132,8 @@ func (x *SocketAddress) ProxyEnumerate() *SocketAddressEnumerator { | |||
| 124 | 132 | // the implementation’s type name will be returned as a fallback. | |
| 125 | 133 | func (x *SocketAddress) ToString() string { | |
| 126 | 134 | ||
| 127 | - | return XGSocketConnectableToString(x.GoPointer()) | |
| 128 | - | ||
| 135 | + | cret := XGSocketConnectableToString(x.GoPointer()) | |
| 136 | + | return cret | |
| 129 | 137 | } | |
| 130 | 138 | ||
| 131 | 139 | func init() { | |
M v4/gio/gsocketaddressenumerator.go +29 -18
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -36,7 +37,7 @@ func SocketAddressEnumeratorNewFromInternalPtr(ptr uintptr) *SocketAddressEnumer | |||
| 36 | 37 | return cls | |
| 37 | 38 | } | |
| 38 | 39 | ||
| 39 | - | var xSocketAddressEnumeratorNext func(uintptr, uintptr) uintptr | |
| 40 | + | var xSocketAddressEnumeratorNext func(uintptr, uintptr, **glib.Error) uintptr | |
| 40 | 41 | ||
| 41 | 42 | // Retrieves the next #GSocketAddress from @enumerator. Note that this | |
| 42 | 43 | // may block for some amount of time. (Eg, a #GNetworkAddress may need | |
| @@ -51,16 +52,21 @@ var xSocketAddressEnumeratorNext func(uintptr, uintptr) uintptr | |||
| 51 | 52 | // g_socket_address_enumerator_next() succeeds, then any further | |
| 52 | 53 | // internal errors (other than @cancellable being triggered) will be | |
| 53 | 54 | // ignored. | |
| 54 | - | func (x *SocketAddressEnumerator) Next(CancellableVar *Cancellable) *SocketAddress { | |
| 55 | + | func (x *SocketAddressEnumerator) Next(CancellableVar *Cancellable) (*SocketAddress, error) { | |
| 56 | + | var cls *SocketAddress | |
| 57 | + | var cerr *glib.Error | |
| 55 | 58 | ||
| 56 | - | NextPtr := xSocketAddressEnumeratorNext(x.GoPointer(), CancellableVar.GoPointer()) | |
| 57 | - | if NextPtr == 0 { | |
| 58 | - | return nil | |
| 59 | - | } | |
| 59 | + | cret := xSocketAddressEnumeratorNext(x.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 60 | 60 | ||
| 61 | - | NextCls := &SocketAddress{} | |
| 62 | - | NextCls.Ptr = NextPtr | |
| 63 | - | return NextCls | |
| 61 | + | if cret == 0 { | |
| 62 | + | return cls, cerr | |
| 63 | + | } | |
| 64 | + | cls = &SocketAddress{} | |
| 65 | + | cls.Ptr = cret | |
| 66 | + | if cerr == nil { | |
| 67 | + | return cls, nil | |
| 68 | + | } | |
| 69 | + | return cls, cerr | |
| 64 | 70 | ||
| 65 | 71 | } | |
| 66 | 72 | ||
| @@ -77,22 +83,27 @@ func (x *SocketAddressEnumerator) NextAsync(CancellableVar *Cancellable, Callbac | |||
| 77 | 83 | ||
| 78 | 84 | } | |
| 79 | 85 | ||
| 80 | - | var xSocketAddressEnumeratorNextFinish func(uintptr, uintptr) uintptr | |
| 86 | + | var xSocketAddressEnumeratorNextFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 81 | 87 | ||
| 82 | 88 | // Retrieves the result of a completed call to | |
| 83 | 89 | // g_socket_address_enumerator_next_async(). See | |
| 84 | 90 | // g_socket_address_enumerator_next() for more information about | |
| 85 | 91 | // error handling. | |
| 86 | - | func (x *SocketAddressEnumerator) NextFinish(ResultVar AsyncResult) *SocketAddress { | |
| 92 | + | func (x *SocketAddressEnumerator) NextFinish(ResultVar AsyncResult) (*SocketAddress, error) { | |
| 93 | + | var cls *SocketAddress | |
| 94 | + | var cerr *glib.Error | |
| 87 | 95 | ||
| 88 | - | NextFinishPtr := xSocketAddressEnumeratorNextFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 89 | - | if NextFinishPtr == 0 { | |
| 90 | - | return nil | |
| 91 | - | } | |
| 96 | + | cret := xSocketAddressEnumeratorNextFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 92 | 97 | ||
| 93 | - | NextFinishCls := &SocketAddress{} | |
| 94 | - | NextFinishCls.Ptr = NextFinishPtr | |
| 95 | - | return NextFinishCls | |
| 98 | + | if cret == 0 { | |
| 99 | + | return cls, cerr | |
| 100 | + | } | |
| 101 | + | cls = &SocketAddress{} | |
| 102 | + | cls.Ptr = cret | |
| 103 | + | if cerr == nil { | |
| 104 | + | return cls, nil | |
| 105 | + | } | |
| 106 | + | return cls, cerr | |
| 96 | 107 | ||
| 97 | 108 | } | |
| 98 | 109 | ||
M v4/gio/gsocketclient.go +154 -113
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -41,14 +42,16 @@ var xNewSocketClient func() uintptr | |||
| 41 | 42 | ||
| 42 | 43 | // Creates a new #GSocketClient with the default options. | |
| 43 | 44 | func NewSocketClient() *SocketClient { | |
| 44 | - | NewSocketClientPtr := xNewSocketClient() | |
| 45 | - | if NewSocketClientPtr == 0 { | |
| 46 | - | return nil | |
| 47 | - | } | |
| 45 | + | var cls *SocketClient | |
| 46 | + | ||
| 47 | + | cret := xNewSocketClient() | |
| 48 | 48 | ||
| 49 | - | NewSocketClientCls := &SocketClient{} | |
| 50 | - | NewSocketClientCls.Ptr = NewSocketClientPtr | |
| 51 | - | return NewSocketClientCls | |
| 49 | + | if cret == 0 { | |
| 50 | + | return cls | |
| 51 | + | } | |
| 52 | + | cls = &SocketClient{} | |
| 53 | + | cls.Ptr = cret | |
| 54 | + | return cls | |
| 52 | 55 | } | |
| 53 | 56 | ||
| 54 | 57 | var xSocketClientAddApplicationProxy func(uintptr, string) | |
| @@ -78,7 +81,7 @@ func (x *SocketClient) AddApplicationProxy(ProtocolVar string) { | |||
| 78 | 81 | ||
| 79 | 82 | } | |
| 80 | 83 | ||
| 81 | - | var xSocketClientConnect func(uintptr, uintptr, uintptr) uintptr | |
| 84 | + | var xSocketClientConnect func(uintptr, uintptr, uintptr, **glib.Error) uintptr | |
| 82 | 85 | ||
| 83 | 86 | // Tries to resolve the @connectable and make a network connection to it. | |
| 84 | 87 | // | |
| @@ -98,16 +101,21 @@ var xSocketClientConnect func(uintptr, uintptr, uintptr) uintptr | |||
| 98 | 101 | // | |
| 99 | 102 | // If a local address is specified with g_socket_client_set_local_address() the | |
| 100 | 103 | // socket will be bound to this address before connecting. | |
| 101 | - | func (x *SocketClient) Connect(ConnectableVar SocketConnectable, CancellableVar *Cancellable) *SocketConnection { | |
| 104 | + | func (x *SocketClient) Connect(ConnectableVar SocketConnectable, CancellableVar *Cancellable) (*SocketConnection, error) { | |
| 105 | + | var cls *SocketConnection | |
| 106 | + | var cerr *glib.Error | |
| 102 | 107 | ||
| 103 | - | ConnectPtr := xSocketClientConnect(x.GoPointer(), ConnectableVar.GoPointer(), CancellableVar.GoPointer()) | |
| 104 | - | if ConnectPtr == 0 { | |
| 105 | - | return nil | |
| 106 | - | } | |
| 108 | + | cret := xSocketClientConnect(x.GoPointer(), ConnectableVar.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 107 | 109 | ||
| 108 | - | ConnectCls := &SocketConnection{} | |
| 109 | - | ConnectCls.Ptr = ConnectPtr | |
| 110 | - | return ConnectCls | |
| 110 | + | if cret == 0 { | |
| 111 | + | return cls, cerr | |
| 112 | + | } | |
| 113 | + | cls = &SocketConnection{} | |
| 114 | + | cls.Ptr = cret | |
| 115 | + | if cerr == nil { | |
| 116 | + | return cls, nil | |
| 117 | + | } | |
| 118 | + | return cls, cerr | |
| 111 | 119 | ||
| 112 | 120 | } | |
| 113 | 121 | ||
| @@ -133,23 +141,28 @@ func (x *SocketClient) ConnectAsync(ConnectableVar SocketConnectable, Cancellabl | |||
| 133 | 141 | ||
| 134 | 142 | } | |
| 135 | 143 | ||
| 136 | - | var xSocketClientConnectFinish func(uintptr, uintptr) uintptr | |
| 144 | + | var xSocketClientConnectFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 137 | 145 | ||
| 138 | 146 | // Finishes an async connect operation. See g_socket_client_connect_async() | |
| 139 | - | func (x *SocketClient) ConnectFinish(ResultVar AsyncResult) *SocketConnection { | |
| 147 | + | func (x *SocketClient) ConnectFinish(ResultVar AsyncResult) (*SocketConnection, error) { | |
| 148 | + | var cls *SocketConnection | |
| 149 | + | var cerr *glib.Error | |
| 140 | 150 | ||
| 141 | - | ConnectFinishPtr := xSocketClientConnectFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 142 | - | if ConnectFinishPtr == 0 { | |
| 143 | - | return nil | |
| 144 | - | } | |
| 151 | + | cret := xSocketClientConnectFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 145 | 152 | ||
| 146 | - | ConnectFinishCls := &SocketConnection{} | |
| 147 | - | ConnectFinishCls.Ptr = ConnectFinishPtr | |
| 148 | - | return ConnectFinishCls | |
| 153 | + | if cret == 0 { | |
| 154 | + | return cls, cerr | |
| 155 | + | } | |
| 156 | + | cls = &SocketConnection{} | |
| 157 | + | cls.Ptr = cret | |
| 158 | + | if cerr == nil { | |
| 159 | + | return cls, nil | |
| 160 | + | } | |
| 161 | + | return cls, cerr | |
| 149 | 162 | ||
| 150 | 163 | } | |
| 151 | 164 | ||
| 152 | - | var xSocketClientConnectToHost func(uintptr, string, uint16, uintptr) uintptr | |
| 165 | + | var xSocketClientConnectToHost func(uintptr, string, uint16, uintptr, **glib.Error) uintptr | |
| 153 | 166 | ||
| 154 | 167 | // This is a helper function for g_socket_client_connect(). | |
| 155 | 168 | // | |
| @@ -181,16 +194,21 @@ var xSocketClientConnectToHost func(uintptr, string, uint16, uintptr) uintptr | |||
| 181 | 194 | // In the event of any failure (DNS error, service not found, no hosts | |
| 182 | 195 | // connectable) %NULL is returned and @error (if non-%NULL) is set | |
| 183 | 196 | // accordingly. | |
| 184 | - | func (x *SocketClient) ConnectToHost(HostAndPortVar string, DefaultPortVar uint16, CancellableVar *Cancellable) *SocketConnection { | |
| 197 | + | func (x *SocketClient) ConnectToHost(HostAndPortVar string, DefaultPortVar uint16, CancellableVar *Cancellable) (*SocketConnection, error) { | |
| 198 | + | var cls *SocketConnection | |
| 199 | + | var cerr *glib.Error | |
| 185 | 200 | ||
| 186 | - | ConnectToHostPtr := xSocketClientConnectToHost(x.GoPointer(), HostAndPortVar, DefaultPortVar, CancellableVar.GoPointer()) | |
| 187 | - | if ConnectToHostPtr == 0 { | |
| 188 | - | return nil | |
| 189 | - | } | |
| 201 | + | cret := xSocketClientConnectToHost(x.GoPointer(), HostAndPortVar, DefaultPortVar, CancellableVar.GoPointer(), &cerr) | |
| 190 | 202 | ||
| 191 | - | ConnectToHostCls := &SocketConnection{} | |
| 192 | - | ConnectToHostCls.Ptr = ConnectToHostPtr | |
| 193 | - | return ConnectToHostCls | |
| 203 | + | if cret == 0 { | |
| 204 | + | return cls, cerr | |
| 205 | + | } | |
| 206 | + | cls = &SocketConnection{} | |
| 207 | + | cls.Ptr = cret | |
| 208 | + | if cerr == nil { | |
| 209 | + | return cls, nil | |
| 210 | + | } | |
| 211 | + | return cls, cerr | |
| 194 | 212 | ||
| 195 | 213 | } | |
| 196 | 214 | ||
| @@ -207,23 +225,28 @@ func (x *SocketClient) ConnectToHostAsync(HostAndPortVar string, DefaultPortVar | |||
| 207 | 225 | ||
| 208 | 226 | } | |
| 209 | 227 | ||
| 210 | - | var xSocketClientConnectToHostFinish func(uintptr, uintptr) uintptr | |
| 228 | + | var xSocketClientConnectToHostFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 211 | 229 | ||
| 212 | 230 | // Finishes an async connect operation. See g_socket_client_connect_to_host_async() | |
| 213 | - | func (x *SocketClient) ConnectToHostFinish(ResultVar AsyncResult) *SocketConnection { | |
| 231 | + | func (x *SocketClient) ConnectToHostFinish(ResultVar AsyncResult) (*SocketConnection, error) { | |
| 232 | + | var cls *SocketConnection | |
| 233 | + | var cerr *glib.Error | |
| 214 | 234 | ||
| 215 | - | ConnectToHostFinishPtr := xSocketClientConnectToHostFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 216 | - | if ConnectToHostFinishPtr == 0 { | |
| 217 | - | return nil | |
| 218 | - | } | |
| 235 | + | cret := xSocketClientConnectToHostFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 219 | 236 | ||
| 220 | - | ConnectToHostFinishCls := &SocketConnection{} | |
| 221 | - | ConnectToHostFinishCls.Ptr = ConnectToHostFinishPtr | |
| 222 | - | return ConnectToHostFinishCls | |
| 237 | + | if cret == 0 { | |
| 238 | + | return cls, cerr | |
| 239 | + | } | |
| 240 | + | cls = &SocketConnection{} | |
| 241 | + | cls.Ptr = cret | |
| 242 | + | if cerr == nil { | |
| 243 | + | return cls, nil | |
| 244 | + | } | |
| 245 | + | return cls, cerr | |
| 223 | 246 | ||
| 224 | 247 | } | |
| 225 | 248 | ||
| 226 | - | var xSocketClientConnectToService func(uintptr, string, string, uintptr) uintptr | |
| 249 | + | var xSocketClientConnectToService func(uintptr, string, string, uintptr, **glib.Error) uintptr | |
| 227 | 250 | ||
| 228 | 251 | // Attempts to create a TCP connection to a service. | |
| 229 | 252 | // | |
| @@ -239,16 +262,21 @@ var xSocketClientConnectToService func(uintptr, string, string, uintptr) uintptr | |||
| 239 | 262 | // In the event of any failure (DNS error, service not found, no hosts | |
| 240 | 263 | // connectable) %NULL is returned and @error (if non-%NULL) is set | |
| 241 | 264 | // accordingly. | |
| 242 | - | func (x *SocketClient) ConnectToService(DomainVar string, ServiceVar string, CancellableVar *Cancellable) *SocketConnection { | |
| 265 | + | func (x *SocketClient) ConnectToService(DomainVar string, ServiceVar string, CancellableVar *Cancellable) (*SocketConnection, error) { | |
| 266 | + | var cls *SocketConnection | |
| 267 | + | var cerr *glib.Error | |
| 243 | 268 | ||
| 244 | - | ConnectToServicePtr := xSocketClientConnectToService(x.GoPointer(), DomainVar, ServiceVar, CancellableVar.GoPointer()) | |
| 245 | - | if ConnectToServicePtr == 0 { | |
| 246 | - | return nil | |
| 247 | - | } | |
| 269 | + | cret := xSocketClientConnectToService(x.GoPointer(), DomainVar, ServiceVar, CancellableVar.GoPointer(), &cerr) | |
| 248 | 270 | ||
| 249 | - | ConnectToServiceCls := &SocketConnection{} | |
| 250 | - | ConnectToServiceCls.Ptr = ConnectToServicePtr | |
| 251 | - | return ConnectToServiceCls | |
| 271 | + | if cret == 0 { | |
| 272 | + | return cls, cerr | |
| 273 | + | } | |
| 274 | + | cls = &SocketConnection{} | |
| 275 | + | cls.Ptr = cret | |
| 276 | + | if cerr == nil { | |
| 277 | + | return cls, nil | |
| 278 | + | } | |
| 279 | + | return cls, cerr | |
| 252 | 280 | ||
| 253 | 281 | } | |
| 254 | 282 | ||
| @@ -262,23 +290,28 @@ func (x *SocketClient) ConnectToServiceAsync(DomainVar string, ServiceVar string | |||
| 262 | 290 | ||
| 263 | 291 | } | |
| 264 | 292 | ||
| 265 | - | var xSocketClientConnectToServiceFinish func(uintptr, uintptr) uintptr | |
| 293 | + | var xSocketClientConnectToServiceFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 266 | 294 | ||
| 267 | 295 | // Finishes an async connect operation. See g_socket_client_connect_to_service_async() | |
| 268 | - | func (x *SocketClient) ConnectToServiceFinish(ResultVar AsyncResult) *SocketConnection { | |
| 296 | + | func (x *SocketClient) ConnectToServiceFinish(ResultVar AsyncResult) (*SocketConnection, error) { | |
| 297 | + | var cls *SocketConnection | |
| 298 | + | var cerr *glib.Error | |
| 269 | 299 | ||
| 270 | - | ConnectToServiceFinishPtr := xSocketClientConnectToServiceFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 271 | - | if ConnectToServiceFinishPtr == 0 { | |
| 272 | - | return nil | |
| 273 | - | } | |
| 300 | + | cret := xSocketClientConnectToServiceFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 274 | 301 | ||
| 275 | - | ConnectToServiceFinishCls := &SocketConnection{} | |
| 276 | - | ConnectToServiceFinishCls.Ptr = ConnectToServiceFinishPtr | |
| 277 | - | return ConnectToServiceFinishCls | |
| 302 | + | if cret == 0 { | |
| 303 | + | return cls, cerr | |
| 304 | + | } | |
| 305 | + | cls = &SocketConnection{} | |
| 306 | + | cls.Ptr = cret | |
| 307 | + | if cerr == nil { | |
| 308 | + | return cls, nil | |
| 309 | + | } | |
| 310 | + | return cls, cerr | |
| 278 | 311 | ||
| 279 | 312 | } | |
| 280 | 313 | ||
| 281 | - | var xSocketClientConnectToUri func(uintptr, string, uint16, uintptr) uintptr | |
| 314 | + | var xSocketClientConnectToUri func(uintptr, string, uint16, uintptr, **glib.Error) uintptr | |
| 282 | 315 | ||
| 283 | 316 | // This is a helper function for g_socket_client_connect(). | |
| 284 | 317 | // | |
| @@ -301,16 +334,21 @@ var xSocketClientConnectToUri func(uintptr, string, uint16, uintptr) uintptr | |||
| 301 | 334 | // In the event of any failure (DNS error, service not found, no hosts | |
| 302 | 335 | // connectable) %NULL is returned and @error (if non-%NULL) is set | |
| 303 | 336 | // accordingly. | |
| 304 | - | func (x *SocketClient) ConnectToUri(UriVar string, DefaultPortVar uint16, CancellableVar *Cancellable) *SocketConnection { | |
| 337 | + | func (x *SocketClient) ConnectToUri(UriVar string, DefaultPortVar uint16, CancellableVar *Cancellable) (*SocketConnection, error) { | |
| 338 | + | var cls *SocketConnection | |
| 339 | + | var cerr *glib.Error | |
| 305 | 340 | ||
| 306 | - | ConnectToUriPtr := xSocketClientConnectToUri(x.GoPointer(), UriVar, DefaultPortVar, CancellableVar.GoPointer()) | |
| 307 | - | if ConnectToUriPtr == 0 { | |
| 308 | - | return nil | |
| 309 | - | } | |
| 341 | + | cret := xSocketClientConnectToUri(x.GoPointer(), UriVar, DefaultPortVar, CancellableVar.GoPointer(), &cerr) | |
| 310 | 342 | ||
| 311 | - | ConnectToUriCls := &SocketConnection{} | |
| 312 | - | ConnectToUriCls.Ptr = ConnectToUriPtr | |
| 313 | - | return ConnectToUriCls | |
| 343 | + | if cret == 0 { | |
| 344 | + | return cls, cerr | |
| 345 | + | } | |
| 346 | + | cls = &SocketConnection{} | |
| 347 | + | cls.Ptr = cret | |
| 348 | + | if cerr == nil { | |
| 349 | + | return cls, nil | |
| 350 | + | } | |
| 351 | + | return cls, cerr | |
| 314 | 352 | ||
| 315 | 353 | } | |
| 316 | 354 | ||
| @@ -327,19 +365,24 @@ func (x *SocketClient) ConnectToUriAsync(UriVar string, DefaultPortVar uint16, C | |||
| 327 | 365 | ||
| 328 | 366 | } | |
| 329 | 367 | ||
| 330 | - | var xSocketClientConnectToUriFinish func(uintptr, uintptr) uintptr | |
| 368 | + | var xSocketClientConnectToUriFinish func(uintptr, uintptr, **glib.Error) uintptr | |
| 331 | 369 | ||
| 332 | 370 | // Finishes an async connect operation. See g_socket_client_connect_to_uri_async() | |
| 333 | - | func (x *SocketClient) ConnectToUriFinish(ResultVar AsyncResult) *SocketConnection { | |
| 371 | + | func (x *SocketClient) ConnectToUriFinish(ResultVar AsyncResult) (*SocketConnection, error) { | |
| 372 | + | var cls *SocketConnection | |
| 373 | + | var cerr *glib.Error | |
| 334 | 374 | ||
| 335 | - | ConnectToUriFinishPtr := xSocketClientConnectToUriFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 336 | - | if ConnectToUriFinishPtr == 0 { | |
| 337 | - | return nil | |
| 338 | - | } | |
| 375 | + | cret := xSocketClientConnectToUriFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 339 | 376 | ||
| 340 | - | ConnectToUriFinishCls := &SocketConnection{} | |
| 341 | - | ConnectToUriFinishCls.Ptr = ConnectToUriFinishPtr | |
| 342 | - | return ConnectToUriFinishCls | |
| 377 | + | if cret == 0 { | |
| 378 | + | return cls, cerr | |
| 379 | + | } | |
| 380 | + | cls = &SocketConnection{} | |
| 381 | + | cls.Ptr = cret | |
| 382 | + | if cerr == nil { | |
| 383 | + | return cls, nil | |
| 384 | + | } | |
| 385 | + | return cls, cerr | |
| 343 | 386 | ||
| 344 | 387 | } | |
| 345 | 388 | ||
| @@ -348,8 +391,8 @@ var xSocketClientGetEnableProxy func(uintptr) bool | |||
| 348 | 391 | // Gets the proxy enable state; see g_socket_client_set_enable_proxy() | |
| 349 | 392 | func (x *SocketClient) GetEnableProxy() bool { | |
| 350 | 393 | ||
| 351 | - | return xSocketClientGetEnableProxy(x.GoPointer()) | |
| 352 | - | ||
| 394 | + | cret := xSocketClientGetEnableProxy(x.GoPointer()) | |
| 395 | + | return cret | |
| 353 | 396 | } | |
| 354 | 397 | ||
| 355 | 398 | var xSocketClientGetFamily func(uintptr) SocketFamily | |
| @@ -359,8 +402,8 @@ var xSocketClientGetFamily func(uintptr) SocketFamily | |||
| 359 | 402 | // See g_socket_client_set_family() for details. | |
| 360 | 403 | func (x *SocketClient) GetFamily() SocketFamily { | |
| 361 | 404 | ||
| 362 | - | return xSocketClientGetFamily(x.GoPointer()) | |
| 363 | - | ||
| 405 | + | cret := xSocketClientGetFamily(x.GoPointer()) | |
| 406 | + | return cret | |
| 364 | 407 | } | |
| 365 | 408 | ||
| 366 | 409 | var xSocketClientGetLocalAddress func(uintptr) uintptr | |
| @@ -369,18 +412,17 @@ var xSocketClientGetLocalAddress func(uintptr) uintptr | |||
| 369 | 412 | // | |
| 370 | 413 | // See g_socket_client_set_local_address() for details. | |
| 371 | 414 | func (x *SocketClient) GetLocalAddress() *SocketAddress { | |
| 415 | + | var cls *SocketAddress | |
| 372 | 416 | ||
| 373 | - | GetLocalAddressPtr := xSocketClientGetLocalAddress(x.GoPointer()) | |
| 374 | - | if GetLocalAddressPtr == 0 { | |
| 375 | - | return nil | |
| 376 | - | } | |
| 377 | - | ||
| 378 | - | gobject.IncreaseRef(GetLocalAddressPtr) | |
| 379 | - | ||
| 380 | - | GetLocalAddressCls := &SocketAddress{} | |
| 381 | - | GetLocalAddressCls.Ptr = GetLocalAddressPtr | |
| 382 | - | return GetLocalAddressCls | |
| 417 | + | cret := xSocketClientGetLocalAddress(x.GoPointer()) | |
| 383 | 418 | ||
| 419 | + | if cret == 0 { | |
| 420 | + | return cls | |
| 421 | + | } | |
| 422 | + | gobject.IncreaseRef(cret) | |
| 423 | + | cls = &SocketAddress{} | |
| 424 | + | cls.Ptr = cret | |
| 425 | + | return cls | |
| 384 | 426 | } | |
| 385 | 427 | ||
| 386 | 428 | var xSocketClientGetProtocol func(uintptr) SocketProtocol | |
| @@ -390,8 +432,8 @@ var xSocketClientGetProtocol func(uintptr) SocketProtocol | |||
| 390 | 432 | // See g_socket_client_set_protocol() for details. | |
| 391 | 433 | func (x *SocketClient) GetProtocol() SocketProtocol { | |
| 392 | 434 | ||
| 393 | - | return xSocketClientGetProtocol(x.GoPointer()) | |
| 394 | - | ||
| 435 | + | cret := xSocketClientGetProtocol(x.GoPointer()) | |
| 436 | + | return cret | |
| 395 | 437 | } | |
| 396 | 438 | ||
| 397 | 439 | var xSocketClientGetProxyResolver func(uintptr) uintptr | |
| @@ -400,18 +442,17 @@ var xSocketClientGetProxyResolver func(uintptr) uintptr | |||
| 400 | 442 | // be the resolver returned by g_proxy_resolver_get_default(), but you | |
| 401 | 443 | // can override it with g_socket_client_set_proxy_resolver(). | |
| 402 | 444 | func (x *SocketClient) GetProxyResolver() *ProxyResolverBase { | |
| 445 | + | var cls *ProxyResolverBase | |
| 403 | 446 | ||
| 404 | - | GetProxyResolverPtr := xSocketClientGetProxyResolver(x.GoPointer()) | |
| 405 | - | if GetProxyResolverPtr == 0 { | |
| 406 | - | return nil | |
| 407 | - | } | |
| 408 | - | ||
| 409 | - | gobject.IncreaseRef(GetProxyResolverPtr) | |
| 410 | - | ||
| 411 | - | GetProxyResolverCls := &ProxyResolverBase{} | |
| 412 | - | GetProxyResolverCls.Ptr = GetProxyResolverPtr | |
| 413 | - | return GetProxyResolverCls | |
| 447 | + | cret := xSocketClientGetProxyResolver(x.GoPointer()) | |
| 414 | 448 | ||
| 449 | + | if cret == 0 { | |
| 450 | + | return cls | |
| 451 | + | } | |
| 452 | + | gobject.IncreaseRef(cret) | |
| 453 | + | cls = &ProxyResolverBase{} | |
| 454 | + | cls.Ptr = cret | |
| 455 | + | return cls | |
| 415 | 456 | } | |
| 416 | 457 | ||
| 417 | 458 | var xSocketClientGetSocketType func(uintptr) SocketType | |
| @@ -421,8 +462,8 @@ var xSocketClientGetSocketType func(uintptr) SocketType | |||
| 421 | 462 | // See g_socket_client_set_socket_type() for details. | |
| 422 | 463 | func (x *SocketClient) GetSocketType() SocketType { | |
| 423 | 464 | ||
| 424 | - | return xSocketClientGetSocketType(x.GoPointer()) | |
| 425 | - | ||
| 465 | + | cret := xSocketClientGetSocketType(x.GoPointer()) | |
| 466 | + | return cret | |
| 426 | 467 | } | |
| 427 | 468 | ||
| 428 | 469 | var xSocketClientGetTimeout func(uintptr) uint | |
| @@ -432,8 +473,8 @@ var xSocketClientGetTimeout func(uintptr) uint | |||
| 432 | 473 | // See g_socket_client_set_timeout() for details. | |
| 433 | 474 | func (x *SocketClient) GetTimeout() uint { | |
| 434 | 475 | ||
| 435 | - | return xSocketClientGetTimeout(x.GoPointer()) | |
| 436 | - | ||
| 476 | + | cret := xSocketClientGetTimeout(x.GoPointer()) | |
| 477 | + | return cret | |
| 437 | 478 | } | |
| 438 | 479 | ||
| 439 | 480 | var xSocketClientGetTls func(uintptr) bool | |
| @@ -442,8 +483,8 @@ var xSocketClientGetTls func(uintptr) bool | |||
| 442 | 483 | // g_socket_client_set_tls() for details. | |
| 443 | 484 | func (x *SocketClient) GetTls() bool { | |
| 444 | 485 | ||
| 445 | - | return xSocketClientGetTls(x.GoPointer()) | |
| 446 | - | ||
| 486 | + | cret := xSocketClientGetTls(x.GoPointer()) | |
| 487 | + | return cret | |
| 447 | 488 | } | |
| 448 | 489 | ||
| 449 | 490 | var xSocketClientGetTlsValidationFlags func(uintptr) TlsCertificateFlags | |
| @@ -456,8 +497,8 @@ var xSocketClientGetTlsValidationFlags func(uintptr) TlsCertificateFlags | |||
| 456 | 497 | // information. | |
| 457 | 498 | func (x *SocketClient) GetTlsValidationFlags() TlsCertificateFlags { | |
| 458 | 499 | ||
| 459 | - | return xSocketClientGetTlsValidationFlags(x.GoPointer()) | |
| 460 | - | ||
| 500 | + | cret := xSocketClientGetTlsValidationFlags(x.GoPointer()) | |
| 501 | + | return cret | |
| 461 | 502 | } | |
| 462 | 503 | ||
| 463 | 504 | var xSocketClientSetEnableProxy func(uintptr, bool) | |
M v4/gio/gsocketconnectable.go +18 -18
| @@ -93,16 +93,16 @@ func (x *SocketConnectableBase) SetGoPointer(ptr uintptr) { | |||
| 93 | 93 | ||
| 94 | 94 | // Creates a #GSocketAddressEnumerator for @connectable. | |
| 95 | 95 | func (x *SocketConnectableBase) Enumerate() *SocketAddressEnumerator { | |
| 96 | + | var cls *SocketAddressEnumerator | |
| 96 | 97 | ||
| 97 | - | EnumeratePtr := XGSocketConnectableEnumerate(x.GoPointer()) | |
| 98 | - | if EnumeratePtr == 0 { | |
| 99 | - | return nil | |
| 100 | - | } | |
| 101 | - | ||
| 102 | - | EnumerateCls := &SocketAddressEnumerator{} | |
| 103 | - | EnumerateCls.Ptr = EnumeratePtr | |
| 104 | - | return EnumerateCls | |
| 98 | + | cret := XGSocketConnectableEnumerate(x.GoPointer()) | |
| 105 | 99 | ||
| 100 | + | if cret == 0 { | |
| 101 | + | return cls | |
| 102 | + | } | |
| 103 | + | cls = &SocketAddressEnumerator{} | |
| 104 | + | cls.Ptr = cret | |
| 105 | + | return cls | |
| 106 | 106 | } | |
| 107 | 107 | ||
| 108 | 108 | // Creates a #GSocketAddressEnumerator for @connectable that will | |
| @@ -113,16 +113,16 @@ func (x *SocketConnectableBase) Enumerate() *SocketAddressEnumerator { | |||
| 113 | 113 | // g_socket_connectable_proxy_enumerate(), this will fall back to | |
| 114 | 114 | // calling g_socket_connectable_enumerate(). | |
| 115 | 115 | func (x *SocketConnectableBase) ProxyEnumerate() *SocketAddressEnumerator { | |
| 116 | + | var cls *SocketAddressEnumerator | |
| 116 | 117 | ||
| 117 | - | ProxyEnumeratePtr := XGSocketConnectableProxyEnumerate(x.GoPointer()) | |
| 118 | - | if ProxyEnumeratePtr == 0 { | |
| 119 | - | return nil | |
| 120 | - | } | |
| 121 | - | ||
| 122 | - | ProxyEnumerateCls := &SocketAddressEnumerator{} | |
| 123 | - | ProxyEnumerateCls.Ptr = ProxyEnumeratePtr | |
| 124 | - | return ProxyEnumerateCls | |
| 118 | + | cret := XGSocketConnectableProxyEnumerate(x.GoPointer()) | |
| 125 | 119 | ||
| 120 | + | if cret == 0 { | |
| 121 | + | return cls | |
| 122 | + | } | |
| 123 | + | cls = &SocketAddressEnumerator{} | |
| 124 | + | cls.Ptr = cret | |
| 125 | + | return cls | |
| 126 | 126 | } | |
| 127 | 127 | ||
| 128 | 128 | // Format a #GSocketConnectable as a string. This is a human-readable format for | |
| @@ -134,8 +134,8 @@ func (x *SocketConnectableBase) ProxyEnumerate() *SocketAddressEnumerator { | |||
| 134 | 134 | // the implementation’s type name will be returned as a fallback. | |
| 135 | 135 | func (x *SocketConnectableBase) ToString() string { | |
| 136 | 136 | ||
| 137 | - | return XGSocketConnectableToString(x.GoPointer()) | |
| 138 | - | ||
| 137 | + | cret := XGSocketConnectableToString(x.GoPointer()) | |
| 138 | + | return cret | |
| 139 | 139 | } | |
| 140 | 140 | ||
| 141 | 141 | var XGSocketConnectableEnumerate func(uintptr) uintptr | |
M v4/gio/gsocketconnection.go +54 -34
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -40,12 +41,17 @@ func SocketConnectionNewFromInternalPtr(ptr uintptr) *SocketConnection { | |||
| 40 | 41 | return cls | |
| 41 | 42 | } | |
| 42 | 43 | ||
| 43 | - | var xSocketConnectionConnect func(uintptr, uintptr, uintptr) bool | |
| 44 | + | var xSocketConnectionConnect func(uintptr, uintptr, uintptr, **glib.Error) bool | |
| 44 | 45 | ||
| 45 | 46 | // Connect @connection to the specified remote address. | |
| 46 | - | func (x *SocketConnection) Connect(AddressVar *SocketAddress, CancellableVar *Cancellable) bool { | |
| 47 | + | func (x *SocketConnection) Connect(AddressVar *SocketAddress, CancellableVar *Cancellable) (bool, error) { | |
| 48 | + | var cerr *glib.Error | |
| 47 | 49 | ||
| 48 | - | return xSocketConnectionConnect(x.GoPointer(), AddressVar.GoPointer(), CancellableVar.GoPointer()) | |
| 50 | + | cret := xSocketConnectionConnect(x.GoPointer(), AddressVar.GoPointer(), CancellableVar.GoPointer(), &cerr) | |
| 51 | + | if cerr == nil { | |
| 52 | + | return cret, nil | |
| 53 | + | } | |
| 54 | + | return cret, cerr | |
| 49 | 55 | ||
| 50 | 56 | } | |
| 51 | 57 | ||
| @@ -63,28 +69,38 @@ func (x *SocketConnection) ConnectAsync(AddressVar *SocketAddress, CancellableVa | |||
| 63 | 69 | ||
| 64 | 70 | } | |
| 65 | 71 | ||
| 66 | - | var xSocketConnectionConnectFinish func(uintptr, uintptr) bool | |
| 72 | + | var xSocketConnectionConnectFinish func(uintptr, uintptr, **glib.Error) bool | |
| 67 | 73 | ||
| 68 | 74 | // Gets the result of a g_socket_connection_connect_async() call. | |
| 69 | - | func (x *SocketConnection) ConnectFinish(ResultVar AsyncResult) bool { | |
| 75 | + | func (x *SocketConnection) ConnectFinish(ResultVar AsyncResult) (bool, error) { | |
| 76 | + | var cerr *glib.Error | |
| 70 | 77 | ||
| 71 | - | return xSocketConnectionConnectFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 78 | + | cret := xSocketConnectionConnectFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| 79 | + | if cerr == nil { | |
| 80 | + | return cret, nil | |
| 81 | + | } | |
| 82 | + | return cret, cerr | |
| 72 | 83 | ||
| 73 | 84 | } | |
| 74 | 85 | ||
| 75 | 86 | var xSocketConnectionGetLocalAddress func(uintptr) uintptr | |
| 76 | 87 | ||
| 77 | 88 | // Try to get the local address of a socket connection. | |
| 78 | - | func (x *SocketConnection) GetLocalAddress() *SocketAddress { | |
| 89 | + | func (x *SocketConnection) GetLocalAddress() (*SocketAddress, error) { | |
| 90 | + | var cls *SocketAddress | |
| 91 | + | var cerr *glib.Error | |
| 79 | 92 | ||
| 80 | - | GetLocalAddressPtr := xSocketConnectionGetLocalAddress(x.GoPointer()) | |
| 81 | - | if GetLocalAddressPtr == 0 { | |
| 82 | - | return nil | |
| 83 | - | } | |
| 93 | + | cret := xSocketConnectionGetLocalAddress(x.GoPointer()) | |
| 84 | 94 | ||
| 85 | - | GetLocalAddressCls := &SocketAddress{} | |
| 86 | - | GetLocalAddressCls.Ptr = GetLocalAddressPtr | |
| 87 | - | return GetLocalAddressCls | |
| 95 | + | if cret == 0 { | |
| 96 | + | return cls, cerr | |
| 97 | + | } | |
| 98 | + | cls = &SocketAddress{} | |
| 99 | + | cls.Ptr = cret | |
| 100 | + | if cerr == nil { | |
| 101 | + | return cls, nil | |
| 102 | + | } | |
| 103 | + | return cls, cerr | |
| 88 | 104 | ||
| 89 | 105 | } | |
| 90 | 106 | ||
| @@ -98,16 +114,21 @@ var xSocketConnectionGetRemoteAddress func(uintptr) uintptr | |||
| 98 | 114 | // address that will be used for the connection. This allows | |
| 99 | 115 | // applications to print e.g. "Connecting to example.com | |
| 100 | 116 | // (10.42.77.3)...". | |
| 101 | - | func (x *SocketConnection) GetRemoteAddress() *SocketAddress { | |
| 117 | + | func (x *SocketConnection) GetRemoteAddress() (*SocketAddress, error) { | |
| 118 | + | var cls *SocketAddress | |
| 119 | + | var cerr *glib.Error | |
| 102 | 120 | ||
| 103 | - | GetRemoteAddressPtr := xSocketConnectionGetRemoteAddress(x.GoPointer()) | |
| 104 | - | if GetRemoteAddressPtr == 0 { | |
| 105 | - | return nil | |
| 106 | - | } | |
| 121 | + | cret := xSocketConnectionGetRemoteAddress(x.GoPointer()) | |
| 107 | 122 | ||
| 108 | - | GetRemoteAddressCls := &SocketAddress{} | |
| 109 | - | GetRemoteAddressCls.Ptr = GetRemoteAddressPtr | |
| 110 | - | return GetRemoteAddressCls | |
| 123 | + | if cret == 0 { | |
| 124 | + | return cls, cerr | |
| 125 | + | } | |
| 126 | + | cls = &SocketAddress{} | |
| 127 | + | cls.Ptr = cret | |
| 128 | + | if cerr == nil { | |
| 129 | + | return cls, nil | |
| 130 | + | } | |
| 131 | + | return cls, cerr | |
| 111 | 132 | ||
| 112 | 133 | } | |
| 113 | 134 | ||
| @@ -117,18 +138,17 @@ var xSocketConnectionGetSocket func(uintptr) uintptr | |||
| 117 | 138 | // This can be useful if you want to do something unusual on it | |
| 118 | 139 | // not supported by the #GSocketConnection APIs. | |
| 119 | 140 | func (x *SocketConnection) GetSocket() *Socket { | |
| 141 | + | var cls *Socket | |
| 120 | 142 | ||
| 121 | - | GetSocketPtr := xSocketConnectionGetSocket(x.GoPointer()) | |
| 122 | - | if GetSocketPtr == 0 { | |
| 123 | - | return nil | |
| 124 | - | } | |
| 125 | - | ||
| 126 | - | gobject.IncreaseRef(GetSocketPtr) | |
| 127 | - | ||
| 128 | - | GetSocketCls := &Socket{} | |
| 129 | - | GetSocketCls.Ptr = GetSocketPtr | |
| 130 | - | return GetSocketCls | |
| 143 | + | cret := xSocketConnectionGetSocket(x.GoPointer()) | |
| 131 | 144 | ||
| 145 | + | if cret == 0 { | |
| 146 | + | return cls | |
| 147 | + | } | |
| 148 | + | gobject.IncreaseRef(cret) | |
| 149 | + | cls = &Socket{} | |
| 150 | + | cls.Ptr = cret | |
| 151 | + | return cls | |
| 132 | 152 | } | |
| 133 | 153 | ||
| 134 | 154 | var xSocketConnectionIsConnected func(uintptr) bool | |
| @@ -137,8 +157,8 @@ var xSocketConnectionIsConnected func(uintptr) bool | |||
| 137 | 157 | // g_socket_is_connected() on @connection's underlying #GSocket. | |
| 138 | 158 | func (x *SocketConnection) IsConnected() bool { | |
| 139 | 159 | ||
| 140 | - | return xSocketConnectionIsConnected(x.GoPointer()) | |
| 141 | - | ||
| 160 | + | cret := xSocketConnectionIsConnected(x.GoPointer()) | |
| 161 | + | return cret | |
| 142 | 162 | } | |
| 143 | 163 | ||
| 144 | 164 | func (c *SocketConnection) GoPointer() uintptr { | |
M v4/gio/gsocketcontrolmessage.go +6 -6
| @@ -51,8 +51,8 @@ var xSocketControlMessageGetLevel func(uintptr) int | |||
| 51 | 51 | // This is often SOL_SOCKET. | |
| 52 | 52 | func (x *SocketControlMessage) GetLevel() int { | |
| 53 | 53 | ||
| 54 | - | return xSocketControlMessageGetLevel(x.GoPointer()) | |
| 55 | - | ||
| 54 | + | cret := xSocketControlMessageGetLevel(x.GoPointer()) | |
| 55 | + | return cret | |
| 56 | 56 | } | |
| 57 | 57 | ||
| 58 | 58 | var xSocketControlMessageGetMsgType func(uintptr) int | |
| @@ -61,8 +61,8 @@ var xSocketControlMessageGetMsgType func(uintptr) int | |||
| 61 | 61 | // For instance, for UNIX fd passing this would be SCM_RIGHTS. | |
| 62 | 62 | func (x *SocketControlMessage) GetMsgType() int { | |
| 63 | 63 | ||
| 64 | - | return xSocketControlMessageGetMsgType(x.GoPointer()) | |
| 65 | - | ||
| 64 | + | cret := xSocketControlMessageGetMsgType(x.GoPointer()) | |
| 65 | + | return cret | |
| 66 | 66 | } | |
| 67 | 67 | ||
| 68 | 68 | var xSocketControlMessageGetSize func(uintptr) uint | |
| @@ -71,8 +71,8 @@ var xSocketControlMessageGetSize func(uintptr) uint | |||
| 71 | 71 | // headers or alignment. | |
| 72 | 72 | func (x *SocketControlMessage) GetSize() uint { | |
| 73 | 73 | ||
| 74 | - | return xSocketControlMessageGetSize(x.GoPointer()) | |
| 75 | - | ||
| 74 | + | cret := xSocketControlMessageGetSize(x.GoPointer()) | |
| 75 | + | return cret | |
| 76 | 76 | } | |
| 77 | 77 | ||
| 78 | 78 | var xSocketControlMessageSerialize func(uintptr, uintptr) | |
M v4/gio/gsocketlistener.go +98 -55
| @@ -4,6 +4,7 @@ package gio | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -45,17 +46,19 @@ var xNewSocketListener func() uintptr | |||
| 45 | 46 | // New listeners can be added with e.g. g_socket_listener_add_address() | |
| 46 | 47 | // or g_socket_listener_add_inet_port(). | |
| 47 | 48 | func NewSocketListener() *SocketListener { | |
| 48 | - | NewSocketListenerPtr := xNewSocketListener() | |
| 49 | - | if NewSocketListenerPtr == 0 { | |
| 50 | - | return nil | |
| 51 | - | } | |
| 49 | + | var cls *SocketListener | |
| 50 | + | ||
| 51 | + | cret := xNewSocketListener() | |
| 52 | 52 | ||
| 53 | - | NewSocketListenerCls := &SocketListener{} | |
| 54 | - | NewSocketListenerCls.Ptr = NewSocketListenerPtr | |
| 55 | - | return NewSocketListenerCls | |
| 53 | + | if cret == 0 { | |
| 54 | + | return cls | |
| 55 | + | } | |
| 56 | + | cls = &SocketListener{} | |
| 57 | + | cls.Ptr = cret | |
| 58 | + | return cls | |
| 56 | 59 | } | |
| 57 | 60 | ||
| 58 | - | var xSocketListenerAccept func(uintptr, *uintptr, uintptr) uintptr | |
| 61 | + | var xSocketListenerAccept func(uintptr, *uintptr, uintptr, **glib.Error) uintptr | |
| 59 | 62 | ||
| 60 | 63 | // Blocks waiting for a client to connect to any of the sockets added | |
| 61 | 64 | // to the listener. Returns a #GSocketConnection for the socket that was | |
| @@ -68,16 +71,21 @@ var xSocketListenerAccept func(uintptr, *uintptr, uintptr) uintptr | |||
| 68 | 71 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 69 | 72 | // triggering the cancellable object from another thread. If the operation | |
| 70 | 73 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 71 | - | func (x *SocketListener) Accept(SourceObjectVar **gobject.Object, CancellableVar *Cancellable) *SocketConnection { | |
| 74 | + | func (x *SocketListener) Accept(SourceObjectVar **gobject.Object, CancellableVar *Cancellable) (*SocketConnection, error) { | |
| 75 | + | var cls *SocketConnection | |
| 76 | + | var cerr *glib.Error | |
| 72 | 77 | ||
| 73 | - | AcceptPtr := xSocketListenerAccept(x.GoPointer(), gobject.ConvertPtr(SourceObjectVar), CancellableVar.GoPointer()) | |
| 74 | - | if AcceptPtr == 0 { | |
| 75 | - | return nil | |
| 76 | - | } | |
| 78 | + | cret := xSocketListenerAccept(x.GoPointer(), gobject.ConvertPtr(SourceObjectVar), CancellableVar.GoPointer(), &cerr) | |
| 77 | 79 | ||
| 78 | - | AcceptCls := &SocketConnection{} | |
| 79 | - | AcceptCls.Ptr = AcceptPtr | |
| 80 | - | return AcceptCls | |
| 80 | + | if cret == 0 { | |
| 81 | + | return cls, cerr | |
| 82 | + | } | |
| 83 | + | cls = &SocketConnection{} | |
| 84 | + | cls.Ptr = cret | |
| 85 | + | if cerr == nil { | |
| 86 | + | return cls, nil | |
| 87 | + | } | |
| 88 | + | return cls, cerr | |
| 81 | 89 | ||
| 82 | 90 | } | |
| 83 | 91 | ||
| @@ -94,23 +102,28 @@ func (x *SocketListener) AcceptAsync(CancellableVar *Cancellable, CallbackVar As | |||
| 94 | 102 | ||
| 95 | 103 | } | |
| 96 | 104 | ||
| 97 | - | var xSocketListenerAcceptFinish func(uintptr, uintptr, *uintptr) uintptr | |
| 105 | + | var xSocketListenerAcceptFinish func(uintptr, uintptr, *uintptr, **glib.Error) uintptr | |
| 98 | 106 | ||
| 99 | 107 | // Finishes an async accept operation. See g_socket_listener_accept_async() | |
| 100 | - | func (x *SocketListener) AcceptFinish(ResultVar AsyncResult, SourceObjectVar **gobject.Object) *SocketConnection { | |
| 108 | + | func (x *SocketListener) AcceptFinish(ResultVar AsyncResult, SourceObjectVar **gobject.Object) (*SocketConnection, error) { | |
| 109 | + | var cls *SocketConnection | |
| 110 | + | var cerr *glib.Error | |
| 101 | 111 | ||
| 102 | - | AcceptFinishPtr := xSocketListenerAcceptFinish(x.GoPointer(), ResultVar.GoPointer(), gobject.ConvertPtr(SourceObjectVar)) | |
| 103 | - | if AcceptFinishPtr == 0 { | |
| 104 | - | return nil | |
| 105 | - | } | |
| 112 | + | cret := xSocketListenerAcceptFinish(x.GoPointer(), ResultVar.GoPointer(), gobject.ConvertPtr(SourceObjectVar), &cerr) | |
| 106 | 113 | ||
| 107 | - | AcceptFinishCls := &SocketConnection{} | |
| 108 | - | AcceptFinishCls.Ptr = AcceptFinishPtr | |
| 109 | - | return AcceptFinishCls | |
| 114 | + | if cret == 0 { | |
| 115 | + | return cls, cerr | |
| 116 | + | } | |
| 117 | + | cls = &SocketConnection{} | |
| 118 | + | cls.Ptr = cret | |
| 119 | + | if cerr == nil { | |
| 120 | + | return cls, nil | |
| 121 | + | } | |
| 122 | + | return cls, cerr | |
| 110 | 123 | ||
| 111 | 124 | } | |
| 112 | 125 | ||
| 113 | - | var xSocketListenerAcceptSocket func(uintptr, *uintptr, uintptr) uintptr | |
| 126 | + | var xSocketListenerAcceptSocket func(uintptr, *uintptr, uintptr, **glib.Error) uintptr | |
| 114 | 127 | ||
| 115 | 128 | // Blocks waiting for a client to connect to any of the sockets added | |
| 116 | 129 | // to the listener. Returns the #GSocket that was accepted. | |
| @@ -126,16 +139,21 @@ var xSocketListenerAcceptSocket func(uintptr, *uintptr, uintptr) uintptr | |||
| 126 | 139 | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 127 | 140 | // triggering the cancellable object from another thread. If the operation | |
| 128 | 141 | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. | |
| 129 | - | func (x *SocketListener) AcceptSocket(SourceObjectVar **gobject.Object, CancellableVar *Cancellable) *Socket { | |
| 142 | + | func (x *SocketListener) AcceptSocket(SourceObjectVar **gobject.Object, CancellableVar *Cancellable) (*Socket, error) { | |
| 143 | + | var cls *Socket | |
| 144 | + | var cerr *glib.Error | |
| 130 | 145 | ||
| 131 | - | AcceptSocketPtr := xSocketListenerAcceptSocket(x.GoPointer(), gobject.ConvertPtr(SourceObjectVar), CancellableVar.GoPointer()) | |
| 132 | - | if AcceptSocketPtr == 0 { | |
| 133 | - | return nil | |
| 134 | - | } | |
| 146 | + | cret := xSocketListenerAcceptSocket(x.GoPointer(), gobject.ConvertPtr(SourceObjectVar), CancellableVar.GoPointer(), &cerr) | |
| 135 | 147 | ||
| 136 | - | AcceptSocketCls := &Socket{} | |
| 137 | - | AcceptSocketCls.Ptr = AcceptSocketPtr | |
| 138 | - | return AcceptSocketCls | |
| 148 | + | if cret == 0 { | |
| 149 | + | return cls, cerr | |
| 150 | + | } | |
| 151 | + | cls = &Socket{} | |
| 152 | + | cls.Ptr = cret | |
| 153 | + | if cerr == nil { | |
| 154 | + | return cls, nil | |
| 155 | + | } | |
| 156 | + | return cls, cerr | |
| 139 | 157 | ||
| 140 | 158 | } | |
| 141 | 159 | ||
| @@ -152,23 +170,28 @@ func (x *SocketListener) AcceptSocketAsync(CancellableVar *Cancellable, Callback | |||
| 152 | 170 | ||
| 153 | 171 | } | |
| 154 | 172 | ||
| 155 | - | var xSocketListenerAcceptSocketFinish func(uintptr, uintptr, *uintptr) uintptr | |
| 173 | + | var xSocketListenerAcceptSocketFinish func(uintptr, uintptr, *uintptr, **glib.Error) uintptr | |
| 156 | 174 | ||
| 157 | 175 | // Finishes an async accept operation. See g_socket_listener_accept_socket_async() | |
| 158 | - | func (x *SocketListener) AcceptSocketFinish(ResultVar AsyncResult, SourceObjectVar **gobject.Object) *Socket { | |
| 176 | + | func (x *SocketListener) AcceptSocketFinish(ResultVar AsyncResult, SourceObjectVar **gobject.Object) (*Socket, error) { | |
| 177 | + | var cls *Socket | |
| 178 | + | var cerr *glib.Error | |
| 159 | 179 | ||
| 160 | - | AcceptSocketFinishPtr := xSocketListenerAcceptSocketFinish(x.GoPointer(), ResultVar.GoPointer(), gobject.ConvertPtr(SourceObjectVar)) | |
| 161 | - | if AcceptSocketFinishPtr == 0 { | |
| 162 | - | return nil | |
| 163 | - | } | |
| 180 | + | cret := xSocketListenerAcceptSocketFinish(x.GoPointer(), ResultVar.GoPointer(), gobject.ConvertPtr(SourceObjectVar), &cerr) | |
| 164 | 181 | ||
| 165 | - | AcceptSocketFinishCls := &Socket{} | |
| 166 | - | AcceptSocketFinishCls.Ptr = AcceptSocketFinishPtr | |
| 167 | - | return AcceptSocketFinishCls | |
| 182 | + | if cret == 0 { | |
| 183 | + | return cls, cerr | |
| 184 | + | } | |
| 185 | + | cls = &Socket{} | |
| 186 | + | cls.Ptr = cret | |
| 187 | + | if cerr == nil { | |
| 188 | + | return cls, nil | |
| 189 | + | } | |
| 190 | + | return cls, cerr | |
| 168 | 191 | ||
| 169 | 192 | } | |
| 170 | 193 | ||
| 171 | - | var xSocketListenerAddAddress func(uintptr, uintptr, SocketType, SocketProtocol, uintptr, *uintptr) bool | |
| 194 | + | var xSocketListenerAddAddress func(uintptr, uintptr, SocketType, SocketProtocol, uintptr, *uintptr, **glib.Error) bool | |
| 172 | 195 | ||
| 173 | 196 | // Creates a socket of type @type and protocol @protocol, binds | |
| 174 | 197 | // it to @address and adds it to the set of sockets we're accepting | |
| @@ -193,13 +216,18 @@ var xSocketListenerAddAddress func(uintptr, uintptr, SocketType, SocketProtocol, | |||
| 193 | 216 | // Call g_socket_listener_close() to stop listening on @address; this will not | |
| 194 | 217 | // be done automatically when you drop your final reference to @listener, as | |
| 195 | 218 | // references may be held internally. | |
| 196 | - | func (x *SocketListener) AddAddress(AddressVar *SocketAddress, TypeVar SocketType, ProtocolVar SocketProtocol, SourceObjectVar *gobject.Object, EffectiveAddressVar **SocketAddress) bool { | |
| 219 | + | func (x *SocketListener) AddAddress(AddressVar *SocketAddress, TypeVar SocketType, ProtocolVar SocketProtocol, SourceObjectVar *gobject.Object, EffectiveAddressVar **SocketAddress) (bool, error) { | |
| 220 | + | var cerr *glib.Error | |
| 197 | 221 | ||
| 198 | - | return xSocketListenerAddAddress(x.GoPointer(), AddressVar.GoPointer(), TypeVar, ProtocolVar, SourceObjectVar.GoPointer(), gobject.ConvertPtr(EffectiveAddressVar)) | |
| 222 | + | cret := xSocketListenerAddAddress(x.GoPointer(), AddressVar.GoPointer(), TypeVar, ProtocolVar, SourceObjectVar.GoPointer(), gobject.ConvertPtr(EffectiveAddressVar), &cerr) | |
| 223 | + | if cerr == nil { | |
| 224 | + | return cret, nil | |
| 225 | + | } | |
| 226 | + | return cret, cerr | |
| 199 | 227 | ||
| 200 | 228 | } | |
| 201 | 229 | ||
| 202 | - | var xSocketListenerAddAnyInetPort func(uintptr, uintptr) uint16 | |
| 230 | + | var xSocketListenerAddAnyInetPort func(uintptr, uintptr, **glib.Error) uint16 | |
| 203 | 231 | ||
| 204 | 232 | // Listens for TCP connections on any available port number for both | |
| 205 | 233 | // IPv6 and IPv4 (if each is available). | |
| @@ -211,13 +239,18 @@ var xSocketListenerAddAnyInetPort func(uintptr, uintptr) uint16 | |||
| 211 | 239 | // to accept to identify this particular source, which is | |
| 212 | 240 | // useful if you're listening on multiple addresses and do | |
| 213 | 241 | // different things depending on what address is connected to. | |
| 214 | - | func (x *SocketListener) AddAnyInetPort(SourceObjectVar *gobject.Object) uint16 { | |
| 242 | + | func (x *SocketListener) AddAnyInetPort(SourceObjectVar *gobject.Object) (uint16, error) { | |
| 243 | + | var cerr *glib.Error | |
| 215 | 244 | ||
| 216 | - | return xSocketListenerAddAnyInetPort(x.GoPointer(), SourceObjectVar.GoPointer()) | |
| 245 | + | cret := xSocketListenerAddAnyInetPort(x.GoPointer(), SourceObjectVar.GoPointer(), &cerr) | |
| 246 | + | if cerr == nil { | |
| 247 | + | return cret, nil | |
| 248 | + | } | |
| 249 | + | return cret, cerr | |
| 217 | 250 | ||
| 218 | 251 | } | |
| 219 | 252 | ||
| 220 | - | var xSocketListenerAddInetPort func(uintptr, uint16, uintptr) bool | |
| 253 | + | var xSocketListenerAddInetPort func(uintptr, uint16, uintptr, **glib.Error) bool | |
| 221 | 254 | ||
| 222 | 255 | // Helper function for g_socket_listener_add_address() that | |
| 223 | 256 | // creates a TCP/IP socket listening on IPv4 and IPv6 (if | |
| @@ -231,13 +264,18 @@ var xSocketListenerAddInetPort func(uintptr, uint16, uintptr) bool | |||
| 231 | 264 | // Call g_socket_listener_close() to stop listening on @port; this will not | |
| 232 | 265 | // be done automatically when you drop your final reference to @listener, as | |
| 233 | 266 | // references may be held internally. | |
| 234 | - | func (x *SocketListener) AddInetPort(PortVar uint16, SourceObjectVar *gobject.Object) bool { | |
| 267 | + | func (x *SocketListener) AddInetPort(PortVar uint16, SourceObjectVar *gobject.Object) (bool, error) { | |
| 268 | + | var cerr *glib.Error | |
| 235 | 269 | ||
| 236 | - | return xSocketListenerAddInetPort(x.GoPointer(), PortVar, SourceObjectVar.GoPointer()) | |
| 270 | + | cret := xSocketListenerAddInetPort(x.GoPointer(), PortVar, SourceObjectVar.GoPointer(), &cerr) | |
| 271 | + | if cerr == nil { | |
| 272 | + | return cret, nil | |
| 273 | + | } | |
| 274 | + | return cret, cerr | |
| 237 | 275 | ||
| 238 | 276 | } | |
| 239 | 277 | ||
| 240 | - | var xSocketListenerAddSocket func(uintptr, uintptr, uintptr) bool | |
| 278 | + | var xSocketListenerAddSocket func(uintptr, uintptr, uintptr, **glib.Error) bool | |
| 241 | 279 | ||
| 242 | 280 | // Adds @socket to the set of sockets that we try to accept | |
| 243 | 281 | // new clients from. The socket must be bound to a local | |
| @@ -252,9 +290,14 @@ var xSocketListenerAddSocket func(uintptr, uintptr, uintptr) bool | |||
| 252 | 290 | // unless the listener held the final reference to the socket. Before GLib 2.42, | |
| 253 | 291 | // the @socket was automatically closed on finalization of the @listener, even | |
| 254 | 292 | // if references to it were held elsewhere. | |
| 255 | - | func (x *SocketListener) AddSocket(SocketVar *Socket, SourceObjectVar *gobject.Object) bool { | |
| 293 | + | func (x *SocketListener) AddSocket(SocketVar *Socket, SourceObjectVar *gobject.Object) (bool, error) { | |
| 294 | + | var cerr *glib.Error | |
| 256 | 295 | ||
| 257 | - | return xSocketListenerAddSocket(x.GoPointer(), SocketVar.GoPointer(), SourceObjectVar.GoPointer()) | |
| 296 | + | cret := xSocketListenerAddSocket(x.GoPointer(), SocketVar.GoPointer(), SourceObjectVar.GoPointer(), &cerr) | |
| 297 | + | if cerr == nil { | |
| 298 | + | return cret, nil | |
| 299 | + | } | |
| 300 | + | return cret, cerr | |
| 258 | 301 | ||
| 259 | 302 | } | |
| 260 | 303 | ||
M v4/gio/gsocketservice.go +11 -9
| @@ -61,14 +61,16 @@ var xNewSocketService func() uintptr | |||
| 61 | 61 | // g_socket_service_start(), unless g_socket_service_stop() has been | |
| 62 | 62 | // called before. | |
| 63 | 63 | func NewSocketService() *SocketService { | |
| 64 | - | NewSocketServicePtr := xNewSocketService() | |
| 65 | - | if NewSocketServicePtr == 0 { | |
| 66 | - | return nil | |
| 67 | - | } | |
| 64 | + | var cls *SocketService | |
| 65 | + | ||
| 66 | + | cret := xNewSocketService() | |
| 68 | 67 | ||
| 69 | - | NewSocketServiceCls := &SocketService{} | |
| 70 | - | NewSocketServiceCls.Ptr = NewSocketServicePtr | |
| 71 | - | return NewSocketServiceCls | |
| 68 | + | if cret == 0 { | |
| 69 | + | return cls | |
| 70 | + | } | |
| 71 | + | cls = &SocketService{} | |
| 72 | + | cls.Ptr = cret | |
| 73 | + | return cls | |
| 72 | 74 | } | |
| 73 | 75 | ||
| 74 | 76 | var xSocketServiceIsActive func(uintptr) bool | |
| @@ -79,8 +81,8 @@ var xSocketServiceIsActive func(uintptr) bool | |||
| 79 | 81 | // up until the service is started. | |
| 80 | 82 | func (x *SocketService) IsActive() bool { | |
| 81 | 83 | ||
| 82 | - | return xSocketServiceIsActive(x.GoPointer()) | |
| 83 | - | ||
| 84 | + | cret := xSocketServiceIsActive(x.GoPointer()) | |
| 85 | + | return cret | |
| 84 | 86 | } | |
| 85 | 87 | ||
| 86 | 88 | var xSocketServiceStart func(uintptr) | |
M v4/gio/gsrvtarget.go +2 -2
| @@ -12,8 +12,8 @@ var xSrvTargetListSort func(*glib.List) *glib.List | |||
| 12 | 12 | // Sorts @targets in place according to the algorithm in RFC 2782. | |
| 13 | 13 | func SrvTargetListSort(TargetsVar *glib.List) *glib.List { | |
| 14 | 14 | ||
| 15 | - | return xSrvTargetListSort(TargetsVar) | |
| 16 | - | ||
| 15 | + | cret := xSrvTargetListSort(TargetsVar) | |
| 16 | + | return cret | |
| 17 | 17 | } | |
| 18 | 18 | ||
| 19 | 19 | func init() { | |
M v4/gio/gtask.go +89 -64
| @@ -564,14 +564,16 @@ var xNewTask func(uintptr, uintptr, uintptr, uintptr) uintptr | |||
| 564 | 564 | // do not want this behavior, you can use | |
| 565 | 565 | // g_task_set_check_cancellable() to change it. | |
| 566 | 566 | func NewTask(SourceObjectVar *gobject.Object, CancellableVar *Cancellable, CallbackVar AsyncReadyCallback, CallbackDataVar uintptr) *Task { | |
| 567 | - | NewTaskPtr := xNewTask(SourceObjectVar.GoPointer(), CancellableVar.GoPointer(), purego.NewCallback(CallbackVar), CallbackDataVar) | |
| 568 | - | if NewTaskPtr == 0 { | |
| 569 | - | return nil | |
| 570 | - | } | |
| 567 | + | var cls *Task | |
| 568 | + | ||
| 569 | + | cret := xNewTask(SourceObjectVar.GoPointer(), CancellableVar.GoPointer(), purego.NewCallback(CallbackVar), CallbackDataVar) | |
| 571 | 570 | ||
| 572 | - | NewTaskCls := &Task{} | |
| 573 | - | NewTaskCls.Ptr = NewTaskPtr | |
| 574 | - | return NewTaskCls | |
| 571 | + | if cret == 0 { | |
| 572 | + | return cls | |
| 573 | + | } | |
| 574 | + | cls = &Task{} | |
| 575 | + | cls.Ptr = cret | |
| 576 | + | return cls | |
| 575 | 577 | } | |
| 576 | 578 | ||
| 577 | 579 | var xTaskAttachSource func(uintptr, *glib.Source, uintptr) | |
| @@ -595,18 +597,17 @@ var xTaskGetCancellable func(uintptr) uintptr | |||
| 595 | 597 | ||
| 596 | 598 | // Gets @task's #GCancellable | |
| 597 | 599 | func (x *Task) GetCancellable() *Cancellable { | |
| 600 | + | var cls *Cancellable | |
| 598 | 601 | ||
| 599 | - | GetCancellablePtr := xTaskGetCancellable(x.GoPointer()) | |
| 600 | - | if GetCancellablePtr == 0 { | |
| 601 | - | return nil | |
| 602 | - | } | |
| 603 | - | ||
| 604 | - | gobject.IncreaseRef(GetCancellablePtr) | |
| 605 | - | ||
| 606 | - | GetCancellableCls := &Cancellable{} | |
| 607 | - | GetCancellableCls.Ptr = GetCancellablePtr | |
| 608 | - | return GetCancellableCls | |
| 602 | + | cret := xTaskGetCancellable(x.GoPointer()) | |
| 609 | 603 | ||
| 604 | + | if cret == 0 { | |
| 605 | + | return cls | |
| 606 | + | } | |
| 607 | + | gobject.IncreaseRef(cret) | |
| 608 | + | cls = &Cancellable{} | |
| 609 | + | cls.Ptr = cret | |
| 610 | + | return cls | |
| 610 | 611 | } | |
| 611 | 612 | ||
| 612 | 613 | var xTaskGetCheckCancellable func(uintptr) bool | |
| @@ -615,8 +616,8 @@ var xTaskGetCheckCancellable func(uintptr) bool | |||
| 615 | 616 | // g_task_set_check_cancellable() for more details. | |
| 616 | 617 | func (x *Task) GetCheckCancellable() bool { | |
| 617 | 618 | ||
| 618 | - | return xTaskGetCheckCancellable(x.GoPointer()) | |
| 619 | - | ||
| 619 | + | cret := xTaskGetCheckCancellable(x.GoPointer()) | |
| 620 | + | return cret | |
| 620 | 621 | } | |
| 621 | 622 | ||
| 622 | 623 | var xTaskGetCompleted func(uintptr) bool | |
| @@ -626,8 +627,8 @@ var xTaskGetCompleted func(uintptr) bool | |||
| 626 | 627 | // the callback. | |
| 627 | 628 | func (x *Task) GetCompleted() bool { | |
| 628 | 629 | ||
| 629 | - | return xTaskGetCompleted(x.GoPointer()) | |
| 630 | - | ||
| 630 | + | cret := xTaskGetCompleted(x.GoPointer()) | |
| 631 | + | return cret | |
| 631 | 632 | } | |
| 632 | 633 | ||
| 633 | 634 | var xTaskGetContext func(uintptr) *glib.MainContext | |
| @@ -641,8 +642,8 @@ var xTaskGetContext func(uintptr) *glib.MainContext | |||
| 641 | 642 | // context is the default #GMainContext. | |
| 642 | 643 | func (x *Task) GetContext() *glib.MainContext { | |
| 643 | 644 | ||
| 644 | - | return xTaskGetContext(x.GoPointer()) | |
| 645 | - | ||
| 645 | + | cret := xTaskGetContext(x.GoPointer()) | |
| 646 | + | return cret | |
| 646 | 647 | } | |
| 647 | 648 | ||
| 648 | 649 | var xTaskGetName func(uintptr) string | |
| @@ -650,8 +651,8 @@ var xTaskGetName func(uintptr) string | |||
| 650 | 651 | // Gets @task’s name. See g_task_set_name(). | |
| 651 | 652 | func (x *Task) GetName() string { | |
| 652 | 653 | ||
| 653 | - | return xTaskGetName(x.GoPointer()) | |
| 654 | - | ||
| 654 | + | cret := xTaskGetName(x.GoPointer()) | |
| 655 | + | return cret | |
| 655 | 656 | } | |
| 656 | 657 | ||
| 657 | 658 | var xTaskGetPriority func(uintptr) int | |
| @@ -659,8 +660,8 @@ var xTaskGetPriority func(uintptr) int | |||
| 659 | 660 | // Gets @task's priority | |
| 660 | 661 | func (x *Task) GetPriority() int { | |
| 661 | 662 | ||
| 662 | - | return xTaskGetPriority(x.GoPointer()) | |
| 663 | - | ||
| 663 | + | cret := xTaskGetPriority(x.GoPointer()) | |
| 664 | + | return cret | |
| 664 | 665 | } | |
| 665 | 666 | ||
| 666 | 667 | var xTaskGetReturnOnCancel func(uintptr) bool | |
| @@ -669,8 +670,8 @@ var xTaskGetReturnOnCancel func(uintptr) bool | |||
| 669 | 670 | // g_task_set_return_on_cancel() for more details. | |
| 670 | 671 | func (x *Task) GetReturnOnCancel() bool { | |
| 671 | 672 | ||
| 672 | - | return xTaskGetReturnOnCancel(x.GoPointer()) | |
| 673 | - | ||
| 673 | + | cret := xTaskGetReturnOnCancel(x.GoPointer()) | |
| 674 | + | return cret | |
| 674 | 675 | } | |
| 675 | 676 | ||
| 676 | 677 | var xTaskGetSourceObject func(uintptr) uintptr | |
| @@ -678,18 +679,17 @@ var xTaskGetSourceObject func(uintptr) uintptr | |||
| 678 | 679 | // Gets the source object from @task. Like | |
| 679 | 680 | // g_async_result_get_source_object(), but does not ref the object. | |
| 680 | 681 | func (x *Task) GetSourceObject() *gobject.Object { | |
| 682 | + | var cls *gobject.Object | |
| 681 | 683 | ||
| 682 | - | GetSourceObjectPtr := xTaskGetSourceObject(x.GoPointer()) | |
| 683 | - | if GetSourceObjectPtr == 0 { | |
| 684 | - | return nil | |
| 685 | - | } | |
| 686 | - | ||
| 687 | - | gobject.IncreaseRef(GetSourceObjectPtr) | |
| 688 | - | ||
| 689 | - | GetSourceObjectCls := &gobject.Object{} | |
| 690 | - | GetSourceObjectCls.Ptr = GetSourceObjectPtr | |
| 691 | - | return GetSourceObjectCls | |
| 684 | + | cret := xTaskGetSourceObject(x.GoPointer()) | |
| 692 | 685 | ||
| 686 | + | if cret == 0 { | |
| 687 | + | return cls | |
| 688 | + | } | |
| 689 | + | gobject.IncreaseRef(cret) | |
| 690 | + | cls = &gobject.Object{} | |
| 691 | + | cls.Ptr = cret | |
| 692 | + | return cls | |
| 693 | 693 | } | |
| 694 | 694 | ||
| 695 | 695 | var xTaskGetSourceTag func(uintptr) uintptr | |
| @@ -697,8 +697,8 @@ var xTaskGetSourceTag func(uintptr) uintptr | |||
| 697 | 697 | // Gets @task's source tag. See g_task_set_source_tag(). | |
| 698 | 698 | func (x *Task) GetSourceTag() uintptr { | |
| 699 | 699 | ||
| 700 | - | return xTaskGetSourceTag(x.GoPointer()) | |
| 701 | - | ||
| 700 | + | cret := xTaskGetSourceTag(x.GoPointer()) | |
| 701 | + | return cret | |
| 702 | 702 | } | |
| 703 | 703 | ||
| 704 | 704 | var xTaskGetTaskData func(uintptr) uintptr | |
| @@ -706,8 +706,8 @@ var xTaskGetTaskData func(uintptr) uintptr | |||
| 706 | 706 | // Gets @task's `task_data`. | |
| 707 | 707 | func (x *Task) GetTaskData() uintptr { | |
| 708 | 708 | ||
| 709 | - | return xTaskGetTaskData(x.GoPointer()) | |
| 710 | - | ||
| 709 | + | cret := xTaskGetTaskData(x.GoPointer()) | |
| 710 | + | return cret | |
| 711 | 711 | } | |
| 712 | 712 | ||
| 713 | 713 | var xTaskHadError func(uintptr) bool | |
| @@ -715,8 +715,8 @@ var xTaskHadError func(uintptr) bool | |||
| 715 | 715 | // Tests if @task resulted in an error. | |
| 716 | 716 | func (x *Task) HadError() bool { | |
| 717 | 717 | ||
| 718 | - | return xTaskHadError(x.GoPointer()) | |
| 719 | - | ||
| 718 | + | cret := xTaskHadError(x.GoPointer()) | |
| 719 | + | return cret | |
| 720 | 720 | } | |
| 721 | 721 | ||
| 722 | 722 | var xTaskPropagateBoolean func(uintptr) bool | |
| @@ -728,9 +728,14 @@ var xTaskPropagateBoolean func(uintptr) bool | |||
| 728 | 728 | // | |
| 729 | 729 | // Since this method transfers ownership of the return value (or | |
| 730 | 730 | // error) to the caller, you may only call it once. | |
| 731 | - | func (x *Task) PropagateBoolean() bool { | |
| 731 | + | func (x *Task) PropagateBoolean() (bool, error) { | |
| 732 | + | var cerr *glib.Error | |
| 732 | 733 | ||
| 733 | - | return xTaskPropagateBoolean(x.GoPointer()) | |
| 734 | + | cret := xTaskPropagateBoolean(x.GoPointer()) | |
| 735 | + | if cerr == nil { | |
| 736 | + | return cret, nil | |
| 737 | + | } | |
| 738 | + | return cret, cerr | |
| 734 | 739 | ||
| 735 | 740 | } | |
| 736 | 741 | ||
| @@ -743,9 +748,14 @@ var xTaskPropagateInt func(uintptr) int | |||
| 743 | 748 | // | |
| 744 | 749 | // Since this method transfers ownership of the return value (or | |
| 745 | 750 | // error) to the caller, you may only call it once. | |
| 746 | - | func (x *Task) PropagateInt() int { | |
| 751 | + | func (x *Task) PropagateInt() (int, error) { | |
| 752 | + | var cerr *glib.Error | |
| 747 | 753 | ||
| 748 | - | return xTaskPropagateInt(x.GoPointer()) | |
| 754 | + | cret := xTaskPropagateInt(x.GoPointer()) | |
| 755 | + | if cerr == nil { | |
| 756 | + | return cret, nil | |
| 757 | + | } | |
| 758 | + | return cret, cerr | |
| 749 | 759 | ||
| 750 | 760 | } | |
| 751 | 761 | ||
| @@ -759,13 +769,18 @@ var xTaskPropagatePointer func(uintptr) uintptr | |||
| 759 | 769 | // | |
| 760 | 770 | // Since this method transfers ownership of the return value (or | |
| 761 | 771 | // error) to the caller, you may only call it once. | |
| 762 | - | func (x *Task) PropagatePointer() uintptr { | |
| 772 | + | func (x *Task) PropagatePointer() (uintptr, error) { | |
| 773 | + | var cerr *glib.Error | |
| 763 | 774 | ||
| 764 | - | return xTaskPropagatePointer(x.GoPointer()) | |
| 775 | + | cret := xTaskPropagatePointer(x.GoPointer()) | |
| 776 | + | if cerr == nil { | |
| 777 | + | return cret, nil | |
| 778 | + | } | |
| 779 | + | return cret, cerr | |
| 765 | 780 | ||
| 766 | 781 | } | |
| 767 | 782 | ||
| 768 | - | var xTaskPropagateValue func(uintptr, *gobject.Value) bool | |
| 783 | + | var xTaskPropagateValue func(uintptr, *gobject.Value, **glib.Error) bool | |
| 769 | 784 | ||
| 770 | 785 | // Gets the result of @task as a #GValue, and transfers ownership of | |
| 771 | 786 | // that value to the caller. As with g_task_return_value(), this is | |
| @@ -777,9 +792,14 @@ var xTaskPropagateValue func(uintptr, *gobject.Value) bool | |||
| 777 | 792 | // | |
| 778 | 793 | // Since this method transfers ownership of the return value (or | |
| 779 | 794 | // error) to the caller, you may only call it once. | |
| 780 | - | func (x *Task) PropagateValue(ValueVar *gobject.Value) bool { | |
| 795 | + | func (x *Task) PropagateValue(ValueVar *gobject.Value) (bool, error) { | |
| 796 | + | var cerr *glib.Error | |
| 781 | 797 | ||
| 782 | - | return xTaskPropagateValue(x.GoPointer(), ValueVar) | |
| 798 | + | cret := xTaskPropagateValue(x.GoPointer(), ValueVar, &cerr) | |
| 799 | + | if cerr == nil { | |
| 800 | + | return cret, nil | |
| 801 | + | } | |
| 802 | + | return cret, cerr | |
| 783 | 803 | ||
| 784 | 804 | } | |
| 785 | 805 | ||
| @@ -821,8 +841,8 @@ var xTaskReturnErrorIfCancelled func(uintptr) bool | |||
| 821 | 841 | // means). | |
| 822 | 842 | func (x *Task) ReturnErrorIfCancelled() bool { | |
| 823 | 843 | ||
| 824 | - | return xTaskReturnErrorIfCancelled(x.GoPointer()) | |
| 825 | - | ||
| 844 | + | cret := xTaskReturnErrorIfCancelled(x.GoPointer()) | |
| 845 | + | return cret | |
| 826 | 846 | } | |
| 827 | 847 | ||
| 828 | 848 | var xTaskReturnInt func(uintptr, int) | |
| @@ -1023,8 +1043,8 @@ var xTaskSetReturnOnCancel func(uintptr, bool) bool | |||
| 1023 | 1043 | // will also be completed right away. | |
| 1024 | 1044 | func (x *Task) SetReturnOnCancel(ReturnOnCancelVar bool) bool { | |
| 1025 | 1045 | ||
| 1026 | - | return xTaskSetReturnOnCancel(x.GoPointer(), ReturnOnCancelVar) | |
| 1027 | - | ||
| 1046 | + | cret := xTaskSetReturnOnCancel(x.GoPointer(), ReturnOnCancelVar) | |
| 1047 | + | return cret | |
| 1028 | 1048 | } | |
| 1029 | 1049 | ||
| 1030 | 1050 | var xTaskSetSourceTag func(uintptr, uintptr) | |
| @@ -1067,16 +1087,16 @@ func (c *Task) SetGoPointer(ptr uintptr) { | |||
| 1067 | 1087 | // Gets the user data from a #GAsyncResult. | |
| 1068 | 1088 | func (x *Task) GetUserData() uintptr { | |
| 1069 | 1089 | ||
| 1070 | - | return XGAsyncResultGetUserData(x.GoPointer()) | |
| 1071 | - | ||
| 1090 | + | cret := XGAsyncResultGetUserData(x.GoPointer()) | |
| 1091 | + | return cret | |
| 1072 | 1092 | } | |
| 1073 | 1093 | ||
| 1074 | 1094 | // Checks if @res has the given @source_tag (generally a function | |
| 1075 | 1095 | // pointer indicating the function @res was created by). | |
| 1076 | 1096 | func (x *Task) IsTagged(SourceTagVar uintptr) bool { | |
| 1077 | 1097 | ||
| 1078 | - | return XGAsyncResultIsTagged(x.GoPointer(), SourceTagVar) | |
| 1079 | - | ||
| 1098 | + | cret := XGAsyncResultIsTagged(x.GoPointer(), SourceTagVar) | |
| 1099 | + | return cret | |
| 1080 | 1100 | } | |
| 1081 | 1101 | ||
| 1082 | 1102 | // If @res is a #GSimpleAsyncResult, this is equivalent to | |
| @@ -1089,9 +1109,14 @@ func (x *Task) IsTagged(SourceTagVar uintptr) bool { | |||
| 1089 | 1109 | // This should not be used in new code; #GAsyncResult errors that are | |
| 1090 | 1110 | // set by virtual methods should also be extracted by virtual methods, | |
| 1091 | 1111 | // to enable subclasses to chain up correctly. | |
| 1092 | - | func (x *Task) LegacyPropagateError() bool { | |
| 1112 | + | func (x *Task) LegacyPropagateError() (bool, error) { | |
| 1113 | + | var cerr *glib.Error | |
| 1093 | 1114 | ||
| 1094 | - | return XGAsyncResultLegacyPropagateError(x.GoPointer()) | |
| 1115 | + | cret := XGAsyncResultLegacyPropagateError(x.GoPointer()) | |
| 1116 | + | if cerr == nil { | |
| 1117 | + | return cret, nil | |
| 1118 | + | } | |
| 1119 | + | return cret, cerr | |
| 1095 | 1120 | ||
| 1096 | 1121 | } | |
| 1097 | 1122 | ||
M v4/gio/gtcpconnection.go +2 -2
| @@ -31,8 +31,8 @@ var xTcpConnectionGetGracefulDisconnect func(uintptr) bool | |||
| 31 | 31 | // g_tcp_connection_set_graceful_disconnect(). | |
| 32 | 32 | func (x *TcpConnection) GetGracefulDisconnect() bool { | |
| 33 | 33 | ||
| 34 | - | return xTcpConnectionGetGracefulDisconnect(x.GoPointer()) | |
| 35 | - | ||
| 34 | + | cret := xTcpConnectionGetGracefulDisconnect(x.GoPointer()) | |
| 35 | + | return cret | |
| 36 | 36 | } | |
| 37 | 37 | ||
| 38 | 38 | var xTcpConnectionSetGracefulDisconnect func(uintptr, bool) | |
M v4/gio/gtcpwrapperconnection.go +18 -17 collapsed to keep the page light
M v4/gio/gthemedicon.go +35 -29 collapsed to keep the page light
M v4/gio/gthreadedsocketservice.go +9 -7
| @@ -44,14 +44,16 @@ var xNewThreadedSocketService func(int) uintptr | |||
| 44 | 44 | // Creates a new #GThreadedSocketService with no listeners. Listeners | |
| 45 | 45 | // must be added with one of the #GSocketListener "add" methods. | |
| 46 | 46 | func NewThreadedSocketService(MaxThreadsVar int) *SocketService { | |
| 47 | - | NewThreadedSocketServicePtr := xNewThreadedSocketService(MaxThreadsVar) | |
| 48 | - | if NewThreadedSocketServicePtr == 0 { | |
| 49 | - | return nil | |
| 50 | - | } | |
| 47 | + | var cls *SocketService | |
| 48 | + | ||
| 49 | + | cret := xNewThreadedSocketService(MaxThreadsVar) | |
| 51 | 50 | ||
| 52 | - | NewThreadedSocketServiceCls := &SocketService{} | |
| 53 | - | NewThreadedSocketServiceCls.Ptr = NewThreadedSocketServicePtr | |
| 54 | - | return NewThreadedSocketServiceCls | |
| 51 | + | if cret == 0 { | |
| 52 | + | return cls | |
| 53 | + | } | |
| 54 | + | cls = &SocketService{} | |
| 55 | + | cls.Ptr = cret | |
| 56 | + | return cls | |
| 55 | 57 | } | |
| 56 | 58 | ||
| 57 | 59 | func (c *ThreadedSocketService) GoPointer() uintptr { | |
M v4/gio/gtlsbackend.go +33 -34 collapsed to keep the page light
M v4/gio/gtlscertificate.go +115 -74 collapsed to keep the page light
M v4/gio/gtlsclientconnection.go +29 -25 collapsed to keep the page light
M v4/gio/gtlsconnection.go +77 -65 collapsed to keep the page light
M v4/gio/gtlsdatabase.go +90 -50 collapsed to keep the page light
M v4/gio/gtlsfiledatabase.go +15 -9 collapsed to keep the page light
M v4/gio/gtlsinteraction.go +49 -18 collapsed to keep the page light
M v4/gio/gtlspassword.go +17 -15 collapsed to keep the page light
M v4/gio/gtlsserverconnection.go +15 -9 collapsed to keep the page light
M v4/gio/gunixconnection.go +61 -30 collapsed to keep the page light
M v4/gio/gunixcredentialsmessage.go +27 -24 collapsed to keep the page light
M v4/gio/gunixfdlist.go +41 -26 collapsed to keep the page light
M v4/gio/gunixfdmessage.go +38 -29 collapsed to keep the page light
M v4/gio/gunixinputstream.go +26 -19 collapsed to keep the page light
M v4/gio/gunixmounts.go +69 -67 collapsed to keep the page light
M v4/gio/gunixoutputstream.go +33 -21 collapsed to keep the page light
M v4/gio/gunixsocketaddress.go +53 -47 collapsed to keep the page light
M v4/gio/gvfs.go +32 -32 collapsed to keep the page light
M v4/gio/gvolume.go +81 -65 collapsed to keep the page light
M v4/gio/gvolumemonitor.go +22 -22 collapsed to keep the page light
M v4/gio/gzlibcompressor.go +26 -19 collapsed to keep the page light
M v4/gio/gzlibdecompressor.go +26 -19 collapsed to keep the page light
M v4/gio/main.go +2 -2 collapsed to keep the page light
M v4/glib/garray.go +15 -15 collapsed to keep the page light
M v4/glib/gatomic.go +28 -28 collapsed to keep the page light
M v4/glib/gbase64.go +12 -12 collapsed to keep the page light
M v4/glib/gbitlock.go +4 -4 collapsed to keep the page light
M v4/glib/gcharset.go +12 -12 collapsed to keep the page light
M v4/glib/gchecksum.go +8 -8 collapsed to keep the page light
M v4/glib/gconvert.go +84 -39 collapsed to keep the page light
M v4/glib/gdataset.go +16 -16 collapsed to keep the page light
M v4/glib/gdate.go +22 -22 collapsed to keep the page light
M v4/glib/genviron.go +14 -14 collapsed to keep the page light
M v4/glib/gerror.go +7 -2 collapsed to keep the page light
M v4/glib/gfileutils.go +86 -56 collapsed to keep the page light
M v4/glib/ggettext.go +12 -12 collapsed to keep the page light
M v4/glib/ghash.go +42 -42 collapsed to keep the page light
M v4/glib/ghmac.go +6 -6 collapsed to keep the page light
M v4/glib/ghook.go +2 -2 collapsed to keep the page light
M v4/glib/ghostutils.go +10 -10 collapsed to keep the page light
M v4/glib/giochannel.go +10 -10 collapsed to keep the page light
M v4/glib/glib-2.0.go +2 -2 collapsed to keep the page light
M v4/glib/glib-types.go +4 -4 collapsed to keep the page light
M v4/glib/glib-unix.go +36 -21 collapsed to keep the page light
M v4/glib/gmain.go +47 -47 collapsed to keep the page light
M v4/glib/gmarkup.go +8 -8 collapsed to keep the page light
M v4/glib/gmem.go +30 -30 collapsed to keep the page light
M v4/glib/gmessages.go +33 -33 collapsed to keep the page light
M v4/glib/goption.go +6 -6 collapsed to keep the page light
M v4/glib/gpattern.go +6 -6 collapsed to keep the page light
M v4/glib/gpoll.go +2 -2 collapsed to keep the page light
M v4/glib/gprimes.go +2 -2 collapsed to keep the page light
M v4/glib/gprintf.go +14 -14 collapsed to keep the page light
M v4/glib/gquark.go +12 -12 collapsed to keep the page light
M v4/glib/grand.go +8 -8 collapsed to keep the page light
M v4/glib/grcbox.go +20 -20 collapsed to keep the page light
M v4/glib/grefcount.go +8 -8 collapsed to keep the page light
M v4/glib/grefstring.go +10 -10 collapsed to keep the page light
M v4/glib/gregex.go +16 -11 collapsed to keep the page light
M v4/glib/gscanner.go +8 -8 collapsed to keep the page light
M v4/glib/gsequence.go +6 -6 collapsed to keep the page light
M v4/glib/gshell.go +18 -8 collapsed to keep the page light
M v4/glib/gslice.go +10 -10 collapsed to keep the page light
M v4/glib/gspawn.go +72 -27 collapsed to keep the page light
M v4/glib/gstdio.go +16 -11 collapsed to keep the page light
M v4/glib/gstrfuncs.go +126 -116 collapsed to keep the page light
M v4/glib/gstring.go +1 -1 collapsed to keep the page light
M v4/glib/gtestutils.go +45 -45 collapsed to keep the page light
M v4/glib/gthread.go +6 -6 collapsed to keep the page light
M v4/glib/gthreadpool.go +6 -6 collapsed to keep the page light
M v4/glib/gtimer.go +2 -2 collapsed to keep the page light
M v4/glib/gtrashstack.go +6 -6 collapsed to keep the page light
M v4/glib/gunicode.go +166 -136 collapsed to keep the page light
M v4/glib/guri.go +84 -44 collapsed to keep the page light
M v4/glib/gutils.go +53 -53 collapsed to keep the page light
M v4/glib/guuid.go +4 -4 collapsed to keep the page light
M v4/glib/gvariant.go +14 -9 collapsed to keep the page light
M v4/glib/gvarianttype.go +8 -8 collapsed to keep the page light
M v4/glib/gversion.go +2 -2 collapsed to keep the page light
M v4/glib/main.go +32 -32 collapsed to keep the page light
A v4/glib/more.go +15 -0 collapsed to keep the page light
M v4/gmodule/gmodule.go +6 -6 collapsed to keep the page light
M v4/gmodule/main.go +2 -2 collapsed to keep the page light
M v4/gobject/gboxed.go +4 -4 collapsed to keep the page light
M v4/gobject/gclosure.go +6 -6 collapsed to keep the page light
M v4/gobject/genums.go +24 -24 collapsed to keep the page light
M v4/gobject/gobject-2.0.go +75 -74 collapsed to keep the page light
M v4/gobject/gobject.go +122 -120 collapsed to keep the page light
M v4/gobject/gparam.go +50 -51 collapsed to keep the page light
M v4/gobject/gparamspecs.go +184 -184 collapsed to keep the page light
M v4/gobject/gsignal.go +45 -45 collapsed to keep the page light
M v4/gobject/gtype.go +103 -105 collapsed to keep the page light
M v4/gobject/gtypemodule.go +8 -8 collapsed to keep the page light
M v4/gobject/gvalue.go +4 -4 collapsed to keep the page light
M v4/gobject/gvaluetypes.go +6 -6 collapsed to keep the page light
M v4/graphene/graphene-box.go +12 -12 collapsed to keep the page light
M v4/graphene/graphene-point.go +2 -2 collapsed to keep the page light
M v4/graphene/graphene-point3d.go +2 -2 collapsed to keep the page light
M v4/graphene/graphene-rect.go +4 -4 collapsed to keep the page light
M v4/graphene/graphene-size.go +2 -2 collapsed to keep the page light
M v4/graphene/graphene-vec2.go +8 -8 collapsed to keep the page light
M v4/graphene/graphene-vec3.go +10 -10 collapsed to keep the page light
M v4/graphene/graphene-vec4.go +12 -12 collapsed to keep the page light
M v4/gsk/gskbroadwayrenderer.go +9 -7 collapsed to keep the page light
M v4/gsk/gskcairorenderer.go +9 -7 collapsed to keep the page light
M v4/gsk/gskglrenderer.go +9 -7 collapsed to keep the page light
M v4/gsk/gskglshader.go +56 -47 collapsed to keep the page light
M v4/gsk/gskrenderer.go +37 -30 collapsed to keep the page light
M v4/gsk/gskrendernode.go +37 -33 collapsed to keep the page light
M v4/gsk/gskrendernodeimpl.go +497 -465 collapsed to keep the page light
M v4/gsk/gsktransform.go +2 -2 collapsed to keep the page light
M v4/gsk/main.go +11 -9 collapsed to keep the page light
M v4/gtk/gtkaboutdialog.go +88 -92 collapsed to keep the page light
M v4/gtk/gtkaccelgroup.go +16 -16 collapsed to keep the page light
M v4/gtk/gtkaccessible.go +2 -2 collapsed to keep the page light
M v4/gtk/gtkactionable.go +4 -4 collapsed to keep the page light
M v4/gtk/gtkactionbar.go +24 -24 collapsed to keep the page light
M v4/gtk/gtkadjustment.go +23 -22 collapsed to keep the page light
M v4/gtk/gtkappchooser.go +10 -10 collapsed to keep the page light
M v4/gtk/gtkappchooserbutton.go +31 -30 collapsed to keep the page light
M v4/gtk/gtkappchooserdialog.go +79 -82 collapsed to keep the page light
M v4/gtk/gtkappchooserwidget.go +35 -34 collapsed to keep the page light
M v4/gtk/gtkapplication.go +80 -83 collapsed to keep the page light
M v4/gtk/gtkapplicationwindow.go +87 -92 collapsed to keep the page light
M v4/gtk/gtkaspectframe.go +30 -30 collapsed to keep the page light
M v4/gtk/gtkassistant.go +100 -106 collapsed to keep the page light
M v4/gtk/gtkatcontext.go +20 -19 collapsed to keep the page light
M v4/gtk/gtkbinlayout.go +9 -7 collapsed to keep the page light
M v4/gtk/gtkbitset.go +6 -6 collapsed to keep the page light
M v4/gtk/gtkbookmarklist.go +31 -29 collapsed to keep the page light
M v4/gtk/gtkboolfilter.go +20 -19 collapsed to keep the page light
M v4/gtk/gtkbox.go +21 -20 collapsed to keep the page light
M v4/gtk/gtkboxlayout.go +17 -15 collapsed to keep the page light
M v4/gtk/gtkbuildable.go +2 -2 collapsed to keep the page light
M v4/gtk/gtkbuilder.go +149 -94 collapsed to keep the page light
M v4/gtk/gtkbuilderlistitemfactory.go +31 -28 collapsed to keep the page light
M v4/gtk/gtkbuilderscope.go +11 -9 collapsed to keep the page light
M v4/gtk/gtkbutton.go +61 -58 collapsed to keep the page light
M v4/gtk/gtkcalendar.go +23 -22 collapsed to keep the page light
M v4/gtk/gtkcellarea.go +96 -102 collapsed to keep the page light
M v4/gtk/gtkcellareabox.go +26 -26 collapsed to keep the page light
M v4/gtk/gtkcellareacontext.go +9 -10 collapsed to keep the page light
M v4/gtk/gtkcelllayout.go +11 -12 collapsed to keep the page light
M v4/gtk/gtkcellrenderer.go +25 -26 collapsed to keep the page light
M v4/gtk/gtkcellrendereraccel.go +9 -8 collapsed to keep the page light
M v4/gtk/gtkcellrenderercombo.go +9 -8 collapsed to keep the page light
M v4/gtk/gtkcellrendererpixbuf.go +9 -8 collapsed to keep the page light
M v4/gtk/gtkcellrendererprogress.go +11 -10 collapsed to keep the page light
M v4/gtk/gtkcellrendererspin.go +9 -8 collapsed to keep the page light
M v4/gtk/gtkcellrendererspinner.go +9 -8 collapsed to keep the page light
M v4/gtk/gtkcellrenderertext.go +9 -8 collapsed to keep the page light
M v4/gtk/gtkcellrenderertoggle.go +15 -14 collapsed to keep the page light
M v4/gtk/gtkcellview.go +77 -74 collapsed to keep the page light
M v4/gtk/gtkcenterbox.go +44 -46 collapsed to keep the page light
M v4/gtk/gtkcenterlayout.go +40 -41 collapsed to keep the page light
M v4/gtk/gtkcheckbutton.go +52 -50 collapsed to keep the page light
M v4/gtk/gtkcolorbutton.go +28 -26 collapsed to keep the page light
M v4/gtk/gtkcolorchooser.go +2 -2 collapsed to keep the page light
M v4/gtk/gtkcolorchooserdialog.go +51 -54 collapsed to keep the page light
M v4/gtk/gtkcolorchooserwidget.go +15 -14 collapsed to keep the page light
M v4/gtk/gtkcolumnview.go +74 -78 collapsed to keep the page light
M v4/gtk/gtkcolumnviewcolumn.go +55 -57 collapsed to keep the page light
M v4/gtk/gtkcombobox.go +89 -88 collapsed to keep the page light
M v4/gtk/gtkcomboboxtext.go +35 -34 collapsed to keep the page light
M v4/gtk/gtkconstraint.go +54 -52 collapsed to keep the page light
M v4/gtk/gtkconstraintguide.go +13 -11 collapsed to keep the page light
M v4/gtk/gtkconstraintlayout.go +37 -30 collapsed to keep the page light
M v4/gtk/gtkcsserror.go +2 -2 collapsed to keep the page light
M v4/gtk/gtkcssprovider.go +11 -9 collapsed to keep the page light
M v4/gtk/gtkcustomfilter.go +9 -7 collapsed to keep the page light
M v4/gtk/gtkcustomlayout.go +9 -7 collapsed to keep the page light
M v4/gtk/gtkcustomsorter.go +9 -7 collapsed to keep the page light
M v4/gtk/gtkdebug.go +2 -2 collapsed to keep the page light
M v4/gtk/gtkdialog.go +96 -102 collapsed to keep the page light
M v4/gtk/gtkdirectorylist.go +42 -41 collapsed to keep the page light
M v4/gtk/gtkdragicon.go +49 -54 collapsed to keep the page light
M v4/gtk/gtkdragsource.go +29 -29 collapsed to keep the page light
M v4/gtk/gtkdrawingarea.go +17 -16 collapsed to keep the page light
M v4/gtk/gtkdropcontrollermotion.go +22 -21 collapsed to keep the page light
M v4/gtk/gtkdropdown.go +73 -76 collapsed to keep the page light
M v4/gtk/gtkdroptarget.go +37 -37 collapsed to keep the page light
M v4/gtk/gtkdroptargetasync.go +13 -11 collapsed to keep the page light
M v4/gtk/gtkeditable.go +33 -34 collapsed to keep the page light
M v4/gtk/gtkeditablelabel.go +42 -42 collapsed to keep the page light
M v4/gtk/gtkemojichooser.go +31 -32 collapsed to keep the page light
M v4/gtk/gtkentry.go +140 -144 collapsed to keep the page light
M v4/gtk/gtkentrybuffer.go +21 -19 collapsed to keep the page light
M v4/gtk/gtkentrycompletion.go +67 -66 collapsed to keep the page light
M v4/gtk/gtkenums.go +2 -2 collapsed to keep the page light
M v4/gtk/gtkeventcontroller.go +37 -40 collapsed to keep the page light
M v4/gtk/gtkeventcontrollerfocus.go +13 -11 collapsed to keep the page light
M v4/gtk/gtkeventcontrollerkey.go +22 -21 collapsed to keep the page light
M v4/gtk/gtkeventcontrollerlegacy.go +9 -7 collapsed to keep the page light
M v4/gtk/gtkeventcontrollermotion.go +13 -11 collapsed to keep the page light
M v4/gtk/gtkeventcontrollerscroll.go +13 -11 collapsed to keep the page light
M v4/gtk/gtkexpander.go +50 -50 collapsed to keep the page light
M v4/gtk/gtkexpression.go +135 -125 collapsed to keep the page light
M v4/gtk/gtkfilechooser.go +93 -74 collapsed to keep the page light
M v4/gtk/gtkfilechooserdialog.go +137 -120 collapsed to keep the page light
M v4/gtk/gtkfilechoosernative.go +101 -79 collapsed to keep the page light
M v4/gtk/gtkfilechooserwidget.go +101 -80 collapsed to keep the page light
M v4/gtk/gtkfilefilter.go +26 -22 collapsed to keep the page light
M v4/gtk/gtkfilter.go +4 -4 collapsed to keep the page light
M v4/gtk/gtkfilterlistmodel.go +45 -45 collapsed to keep the page light
M v4/gtk/gtkfixed.go +15 -14 collapsed to keep the page light
M v4/gtk/gtkfixedlayout.go +11 -9 collapsed to keep the page light
M v4/gtk/gtkflattenlistmodel.go +41 -41 collapsed to keep the page light
M v4/gtk/gtkflowbox.go +75 -76 collapsed to keep the page light
M v4/gtk/gtkfontbutton.go +72 -72 collapsed to keep the page light
M v4/gtk/gtkfontchooser.go +42 -44 collapsed to keep the page light
M v4/gtk/gtkfontchooserdialog.go +91 -96 collapsed to keep the page light
M v4/gtk/gtkfontchooserwidget.go +55 -56 collapsed to keep the page light
M v4/gtk/gtkframe.go +35 -36 collapsed to keep the page light
M v4/gtk/gtkgesture.go +44 -46 collapsed to keep the page light
M v4/gtk/gtkgestureclick.go +9 -7 collapsed to keep the page light
M v4/gtk/gtkgesturedrag.go +13 -11 collapsed to keep the page light
M v4/gtk/gtkgesturelongpress.go +11 -9 collapsed to keep the page light
M v4/gtk/gtkgesturepan.go +11 -9 collapsed to keep the page light
M v4/gtk/gtkgesturerotate.go +11 -9 collapsed to keep the page light
M v4/gtk/gtkgesturesingle.go +10 -10 collapsed to keep the page light
M v4/gtk/gtkgesturestylus.go +24 -23 collapsed to keep the page light
M v4/gtk/gtkgestureswipe.go +11 -9 collapsed to keep the page light
M v4/gtk/gtkgesturezoom.go +11 -9 collapsed to keep the page light
M v4/gtk/gtkglarea.go +32 -32 collapsed to keep the page light
M v4/gtk/gtkgrid.go +36 -36 collapsed to keep the page light
M v4/gtk/gtkgridlayout.go +29 -27 collapsed to keep the page light
M v4/gtk/gtkgridview.go +65 -68 collapsed to keep the page light
M v4/gtk/gtkheaderbar.go +26 -26 collapsed to keep the page light
M v4/gtk/gtkicontheme.go +85 -82 collapsed to keep the page light
M v4/gtk/gtkiconview.go +135 -136 collapsed to keep the page light
M v4/gtk/gtkimage.go +93 -88 collapsed to keep the page light
M v4/gtk/gtkimcontext.go +10 -10 collapsed to keep the page light
M v4/gtk/gtkimcontextsimple.go +9 -7 collapsed to keep the page light
M v4/gtk/gtkimmulticontext.go +11 -9 collapsed to keep the page light
M v4/gtk/gtkinfobar.go +37 -36 collapsed to keep the page light
M v4/gtk/gtkinscription.go +33 -32 collapsed to keep the page light
M v4/gtk/gtklabel.go +91 -92 collapsed to keep the page light
M v4/gtk/gtklayoutchild.go +18 -20 collapsed to keep the page light
M v4/gtk/gtklayoutmanager.go +20 -22 collapsed to keep the page light
M v4/gtk/gtklevelbar.go +36 -34 collapsed to keep the page light
M v4/gtk/gtklinkbutton.go +30 -28 collapsed to keep the page light
M v4/gtk/gtklistbase.go +30 -32 collapsed to keep the page light
M v4/gtk/gtklistbox.go +100 -104 collapsed to keep the page light
M v4/gtk/gtklistitem.go +26 -28 collapsed to keep the page light
M v4/gtk/gtkliststore.go +82 -78 collapsed to keep the page light
M v4/gtk/gtklistview.go +63 -66 collapsed to keep the page light
M v4/gtk/gtklockbutton.go +26 -26 collapsed to keep the page light
M v4/gtk/gtkmain.go +8 -8 collapsed to keep the page light
M v4/gtk/gtkmaplistmodel.go +34 -33 collapsed to keep the page light
M v4/gtk/gtkmediacontrols.go +22 -22 collapsed to keep the page light
M v4/gtk/gtkmediafile.go +79 -71 collapsed to keep the page light
M v4/gtk/gtkmediastream.go +42 -42 collapsed to keep the page light
M v4/gtk/gtkmenubutton.go +54 -56 collapsed to keep the page light
M v4/gtk/gtkmessagedialog.go +67 -70 collapsed to keep the page light
M v4/gtk/gtkmountoperation.go +29 -29 collapsed to keep the page light
M v4/gtk/gtkmultifilter.go +66 -62 collapsed to keep the page light
M v4/gtk/gtkmultiselection.go +52 -51 collapsed to keep the page light
M v4/gtk/gtkmultisorter.go +25 -23 collapsed to keep the page light
M v4/gtk/gtknative.go +27 -30 collapsed to keep the page light
M v4/gtk/gtknativedialog.go +15 -16 collapsed to keep the page light
M v4/gtk/gtknoselection.go +52 -51 collapsed to keep the page light
M v4/gtk/gtknotebook.go +111 -116 collapsed to keep the page light
M v4/gtk/gtknumericsorter.go +20 -19 collapsed to keep the page light
M v4/gtk/gtkorientable.go +2 -2 collapsed to keep the page light
M v4/gtk/gtkoverlay.go +26 -26 collapsed to keep the page light
M v4/gtk/gtkoverlaylayout.go +13 -11 collapsed to keep the page light
M v4/gtk/gtkpadcontroller.go +11 -9 collapsed to keep the page light
M v4/gtk/gtkpagesetup.go +102 -69 collapsed to keep the page light
M v4/gtk/gtkpagesetupunixdialog.go +67 -72 collapsed to keep the page light
M v4/gtk/gtkpaned.go +45 -46 collapsed to keep the page light
M v4/gtk/gtkpapersize.go +4 -4 collapsed to keep the page light
M v4/gtk/gtkpasswordentry.go +51 -52 collapsed to keep the page light
M v4/gtk/gtkpasswordentrybuffer.go +9 -7 collapsed to keep the page light
M v4/gtk/gtkpicture.go +84 -80 collapsed to keep the page light
M v4/gtk/gtkpopover.go +52 -54 collapsed to keep the page light
M v4/gtk/gtkpopovermenu.go +53 -54 collapsed to keep the page light
M v4/gtk/gtkpopovermenubar.go +26 -26 collapsed to keep the page light
M v4/gtk/gtkprintcontext.go +46 -48 collapsed to keep the page light
M v4/gtk/gtkprinter.go +57 -55 collapsed to keep the page light
M v4/gtk/gtkprintjob.go +76 -61 collapsed to keep the page light
M v4/gtk/gtkprintoperation.go +67 -57 collapsed to keep the page light
M v4/gtk/gtkprintoperationpreview.go +2 -2 collapsed to keep the page light
M v4/gtk/gtkprintsettings.go +150 -117 collapsed to keep the page light
M v4/gtk/gtkprintunixdialog.go +87 -92 collapsed to keep the page light
M v4/gtk/gtkprogressbar.go +27 -26 collapsed to keep the page light
M v4/gtk/gtkrange.go +31 -32 collapsed to keep the page light
M v4/gtk/gtkrecentmanager.go +53 -31 collapsed to keep the page light
M v4/gtk/gtkrevealer.go +30 -30 collapsed to keep the page light
M v4/gtk/gtkroot.go +18 -20 collapsed to keep the page light
M v4/gtk/gtkscale.go +41 -40 collapsed to keep the page light
M v4/gtk/gtkscalebutton.go +53 -56 collapsed to keep the page light
M v4/gtk/gtkscrollable.go +24 -26 collapsed to keep the page light
M v4/gtk/gtkscrollbar.go +24 -24 collapsed to keep the page light
M v4/gtk/gtkscrolledwindow.go +78 -82 collapsed to keep the page light
M v4/gtk/gtksearchbar.go +35 -36 collapsed to keep the page light
M v4/gtk/gtksearchentry.go +51 -52 collapsed to keep the page light
M v4/gtk/gtkselectionfiltermodel.go +32 -31 collapsed to keep the page light
M v4/gtk/gtkselectionmodel.go +20 -20 collapsed to keep the page light
M v4/gtk/gtkseparator.go +15 -14 collapsed to keep the page light
M v4/gtk/gtkshortcut.go +38 -36 collapsed to keep the page light
M v4/gtk/gtkshortcutaction.go +44 -36 collapsed to keep the page light
M v4/gtk/gtkshortcutcontroller.go +38 -34 collapsed to keep the page light
M v4/gtk/gtkshortcutlabel.go +17 -16 collapsed to keep the page light
M v4/gtk/gtkshortcutsgroup.go +6 -6 collapsed to keep the page light
M v4/gtk/gtkshortcutssection.go +6 -6
| @@ -54,8 +54,8 @@ func (x *ShortcutsSection) ConnectChangeCurrentPage(cb func(ShortcutsSection, in | |||
| 54 | 54 | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 55 | 55 | func (x *ShortcutsSection) GetAccessibleRole() AccessibleRole { | |
| 56 | 56 | ||
| 57 | - | return XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 58 | - | ||
| 57 | + | cret := XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 58 | + | return cret | |
| 59 | 59 | } | |
| 60 | 60 | ||
| 61 | 61 | // Resets the accessible @property to its default value. | |
| @@ -190,15 +190,15 @@ func (x *ShortcutsSection) UpdateStateValue(NStatesVar int, StatesVar uintptr, V | |||
| 190 | 190 | // of the <object> tag used to construct the @buildable. | |
| 191 | 191 | func (x *ShortcutsSection) GetBuildableId() string { | |
| 192 | 192 | ||
| 193 | - | return XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 194 | - | ||
| 193 | + | cret := XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 194 | + | return cret | |
| 195 | 195 | } | |
| 196 | 196 | ||
| 197 | 197 | // Retrieves the orientation of the @orientable. | |
| 198 | 198 | func (x *ShortcutsSection) GetOrientation() Orientation { | |
| 199 | 199 | ||
| 200 | - | return XGtkOrientableGetOrientation(x.GoPointer()) | |
| 201 | - | ||
| 200 | + | cret := XGtkOrientableGetOrientation(x.GoPointer()) | |
| 201 | + | return cret | |
| 202 | 202 | } | |
| 203 | 203 | ||
| 204 | 204 | // Sets the orientation of the @orientable. | |