Merge pull request #344 from bnema/chore/upstream-foundations
chore(deps): integrate approved upstream foundations
921 files · +28709 -25527
M docs/first-presentation.md +5 -2
| @@ -46,5 +46,8 @@ labels. Set `DUMBER_MACHINE_GPU_PROFILE` to one of `generic-gpu`, | |||
| 46 | 46 | `integrated-gpu`, `discrete-gpu`, `hybrid-gpu`, `virtual-gpu`, or `unknown-gpu`; | |
| 47 | 47 | do not use a device model or other identifier. Publish only the seven reviewed | |
| 48 | 48 | JSON files to an external Gist. Raw logs and temporary XDG homes are removed and | |
| 49 | - | must not be published. A missing or incomplete timeline, non-DMABUF backend, or | |
| 50 | - | invalid run fails collection. | |
| 49 | + | must not be published. `metadata.json` derives the selected | |
| 50 | + | `github.com/bnema/purego-cef2gtk` pseudo-version and its full immutable Git | |
| 51 | + | origin hash from Go module metadata; branch selectors or missing origin metadata | |
| 52 | + | fail collection. A missing or incomplete timeline, non-DMABUF backend, or invalid | |
| 53 | + | run also fails collection. | |
| @@ -46,5 +46,8 @@ labels. Set `DUMBER_MACHINE_GPU_PROFILE` to one of `generic-gpu`, | |||||
| 46 | `integrated-gpu`, `discrete-gpu`, `hybrid-gpu`, `virtual-gpu`, or `unknown-gpu`; | 46 | `integrated-gpu`, `discrete-gpu`, `hybrid-gpu`, `virtual-gpu`, or `unknown-gpu`; | ||
| 47 | do not use a device model or other identifier. Publish only the seven reviewed | 47 | do not use a device model or other identifier. Publish only the seven reviewed | ||
| 48 | JSON files to an external Gist. Raw logs and temporary XDG homes are removed and | 48 | JSON files to an external Gist. Raw logs and temporary XDG homes are removed and | ||
| 49 | - | must not be published. A missing or incomplete timeline, non-DMABUF backend, or | 49 | + | must not be published. `metadata.json` derives the selected |
| 50 | - | invalid run fails collection. | 50 | + | `github.com/bnema/purego-cef2gtk` pseudo-version and its full immutable Git |
| 51 | + | origin hash from Go module metadata; branch selectors or missing origin metadata | |||
| 52 | + | fail collection. A missing or incomplete timeline, non-DMABUF backend, or invalid | |||
| 53 | + | run also fails collection. | |||
M go.mod +5 -5
| @@ -6,11 +6,11 @@ require ( | |||
| 6 | 6 | github.com/a-h/templ v0.3.1020 | |
| 7 | 7 | github.com/andybalholm/brotli v1.2.2 | |
| 8 | 8 | github.com/bnema/purego v0.11.0-bnema.4 | |
| 9 | - | github.com/bnema/purego-cef v0.13.3 | |
| 10 | - | github.com/bnema/purego-cef2gtk v0.8.4 | |
| 11 | - | github.com/bnema/purego-pipewire v0.1.4 | |
| 12 | - | github.com/bnema/purego-sqlite v0.1.3 | |
| 13 | - | github.com/bnema/puregotk v0.7.0 | |
| 9 | + | github.com/bnema/purego-cef v0.13.4-0.20260714140305-f0b7414af67e | |
| 10 | + | github.com/bnema/purego-cef2gtk v0.8.4-0.20260714160309-bbd397409ebe | |
| 11 | + | github.com/bnema/purego-pipewire v0.1.5-0.20260714124450-6504b9cdf02a | |
| 12 | + | github.com/bnema/purego-sqlite v0.1.4-0.20260714131321-3614fe683b9c | |
| 13 | + | github.com/bnema/puregotk v0.7.1-0.20260714170452-0b6b9b901234 | |
| 14 | 14 | github.com/charmbracelet/bubbles v1.0.0 | |
| 15 | 15 | github.com/charmbracelet/bubbletea v1.3.10 | |
| 16 | 16 | github.com/charmbracelet/lipgloss v1.1.0 | |
| @@ -6,11 +6,11 @@ require ( | |||||
| 6 | github.com/a-h/templ v0.3.1020 | 6 | github.com/a-h/templ v0.3.1020 | ||
| 7 | github.com/andybalholm/brotli v1.2.2 | 7 | github.com/andybalholm/brotli v1.2.2 | ||
| 8 | github.com/bnema/purego v0.11.0-bnema.4 | 8 | github.com/bnema/purego v0.11.0-bnema.4 | ||
| 9 | - | github.com/bnema/purego-cef v0.13.3 | 9 | + | github.com/bnema/purego-cef v0.13.4-0.20260714140305-f0b7414af67e |
| 10 | - | github.com/bnema/purego-cef2gtk v0.8.4 | 10 | + | github.com/bnema/purego-cef2gtk v0.8.4-0.20260714160309-bbd397409ebe |
| 11 | - | github.com/bnema/purego-pipewire v0.1.4 | 11 | + | github.com/bnema/purego-pipewire v0.1.5-0.20260714124450-6504b9cdf02a |
| 12 | - | github.com/bnema/purego-sqlite v0.1.3 | 12 | + | github.com/bnema/purego-sqlite v0.1.4-0.20260714131321-3614fe683b9c |
| 13 | - | github.com/bnema/puregotk v0.7.0 | 13 | + | github.com/bnema/puregotk v0.7.1-0.20260714170452-0b6b9b901234 |
| 14 | github.com/charmbracelet/bubbles v1.0.0 | 14 | github.com/charmbracelet/bubbles v1.0.0 | ||
| 15 | github.com/charmbracelet/bubbletea v1.3.10 | 15 | github.com/charmbracelet/bubbletea v1.3.10 | ||
| 16 | github.com/charmbracelet/lipgloss v1.1.0 | 16 | github.com/charmbracelet/lipgloss v1.1.0 | ||
M go.sum +12 -0 generated file: collapsed
A internal/infrastructure/persistence/sqlite/history_repo_benchmark_test.go +71 -0
| @@ -0,0 +1,71 @@ | |||
| 1 | + | package sqlite_test | |
| 2 | + | ||
| 3 | + | import ( | |
| 4 | + | "fmt" | |
| 5 | + | "path/filepath" | |
| 6 | + | "testing" | |
| 7 | + | ||
| 8 | + | "github.com/bnema/dumber/internal/domain/entity" | |
| 9 | + | "github.com/bnema/dumber/internal/domain/repository" | |
| 10 | + | "github.com/bnema/dumber/internal/infrastructure/persistence/sqlite" | |
| 11 | + | ) | |
| 12 | + | ||
| 13 | + | // newHistoryBenchmarkRepository creates a representative local history corpus | |
| 14 | + | // outside the measured operation. Sidebar reads use GetRecent and omnibox | |
| 15 | + | // history suggestions use Search. | |
| 16 | + | func newHistoryBenchmarkRepository(b *testing.B) (repository.HistoryRepository, func()) { | |
| 17 | + | b.Helper() | |
| 18 | + | ||
| 19 | + | ctx := historyTestCtx() | |
| 20 | + | db, err := sqlite.NewConnection(ctx, filepath.Join(b.TempDir(), "dumber.db")) | |
| 21 | + | if err != nil { | |
| 22 | + | b.Fatal(err) | |
| 23 | + | } | |
| 24 | + | ||
| 25 | + | b.Cleanup(func() { | |
| 26 | + | if err := db.Close(); err != nil { | |
| 27 | + | b.Errorf("close benchmark database: %v", err) | |
| 28 | + | } | |
| 29 | + | }) | |
| 30 | + | ||
| 31 | + | repo := sqlite.NewHistoryRepository(db) | |
| 32 | + | for i := range 200 { | |
| 33 | + | entry := &entity.HistoryEntry{ | |
| 34 | + | URL: fmt.Sprintf("https://example%d.test/dumber/history/%d", i%20, i), | |
| 35 | + | Title: fmt.Sprintf("Dumber history entry %d", i), | |
| 36 | + | } | |
| 37 | + | if err := repo.Save(ctx, entry); err != nil { | |
| 38 | + | b.Fatal(err) | |
| 39 | + | } | |
| 40 | + | } | |
| 41 | + | ||
| 42 | + | return repo, func() {} | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | func BenchmarkHistorySQLiteSidebarRecent(b *testing.B) { | |
| 46 | + | repo, closeDB := newHistoryBenchmarkRepository(b) | |
| 47 | + | defer closeDB() | |
| 48 | + | ctx := historyTestCtx() | |
| 49 | + | ||
| 50 | + | b.ReportAllocs() | |
| 51 | + | b.ResetTimer() | |
| 52 | + | for range b.N { | |
| 53 | + | if _, err := repo.GetRecent(ctx, 50, 0); err != nil { | |
| 54 | + | b.Fatal(err) | |
| 55 | + | } | |
| 56 | + | } | |
| 57 | + | } | |
| 58 | + | ||
| 59 | + | func BenchmarkHistorySQLiteOmniboxSearch(b *testing.B) { | |
| 60 | + | repo, closeDB := newHistoryBenchmarkRepository(b) | |
| 61 | + | defer closeDB() | |
| 62 | + | ctx := historyTestCtx() | |
| 63 | + | ||
| 64 | + | b.ReportAllocs() | |
| 65 | + | b.ResetTimer() | |
| 66 | + | for range b.N { | |
| 67 | + | if _, err := repo.Search(ctx, "dumber history", 10); err != nil { | |
| 68 | + | b.Fatal(err) | |
| 69 | + | } | |
| 70 | + | } | |
| 71 | + | } | |
| @@ -0,0 +1,71 @@ | |||||
| 1 | + | package sqlite_test | |||
| 2 | + | ||||
| 3 | + | import ( | |||
| 4 | + | "fmt" | |||
| 5 | + | "path/filepath" | |||
| 6 | + | "testing" | |||
| 7 | + | ||||
| 8 | + | "github.com/bnema/dumber/internal/domain/entity" | |||
| 9 | + | "github.com/bnema/dumber/internal/domain/repository" | |||
| 10 | + | "github.com/bnema/dumber/internal/infrastructure/persistence/sqlite" | |||
| 11 | + | ) | |||
| 12 | + | ||||
| 13 | + | // newHistoryBenchmarkRepository creates a representative local history corpus | |||
| 14 | + | // outside the measured operation. Sidebar reads use GetRecent and omnibox | |||
| 15 | + | // history suggestions use Search. | |||
| 16 | + | func newHistoryBenchmarkRepository(b *testing.B) (repository.HistoryRepository, func()) { | |||
| 17 | + | b.Helper() | |||
| 18 | + | ||||
| 19 | + | ctx := historyTestCtx() | |||
| 20 | + | db, err := sqlite.NewConnection(ctx, filepath.Join(b.TempDir(), "dumber.db")) | |||
| 21 | + | if err != nil { | |||
| 22 | + | b.Fatal(err) | |||
| 23 | + | } | |||
| 24 | + | ||||
| 25 | + | b.Cleanup(func() { | |||
| 26 | + | if err := db.Close(); err != nil { | |||
| 27 | + | b.Errorf("close benchmark database: %v", err) | |||
| 28 | + | } | |||
| 29 | + | }) | |||
| 30 | + | ||||
| 31 | + | repo := sqlite.NewHistoryRepository(db) | |||
| 32 | + | for i := range 200 { | |||
| 33 | + | entry := &entity.HistoryEntry{ | |||
| 34 | + | URL: fmt.Sprintf("https://example%d.test/dumber/history/%d", i%20, i), | |||
| 35 | + | Title: fmt.Sprintf("Dumber history entry %d", i), | |||
| 36 | + | } | |||
| 37 | + | if err := repo.Save(ctx, entry); err != nil { | |||
| 38 | + | b.Fatal(err) | |||
| 39 | + | } | |||
| 40 | + | } | |||
| 41 | + | ||||
| 42 | + | return repo, func() {} | |||
| 43 | + | } | |||
| 44 | + | ||||
| 45 | + | func BenchmarkHistorySQLiteSidebarRecent(b *testing.B) { | |||
| 46 | + | repo, closeDB := newHistoryBenchmarkRepository(b) | |||
| 47 | + | defer closeDB() | |||
| 48 | + | ctx := historyTestCtx() | |||
| 49 | + | ||||
| 50 | + | b.ReportAllocs() | |||
| 51 | + | b.ResetTimer() | |||
| 52 | + | for range b.N { | |||
| 53 | + | if _, err := repo.GetRecent(ctx, 50, 0); err != nil { | |||
| 54 | + | b.Fatal(err) | |||
| 55 | + | } | |||
| 56 | + | } | |||
| 57 | + | } | |||
| 58 | + | ||||
| 59 | + | func BenchmarkHistorySQLiteOmniboxSearch(b *testing.B) { | |||
| 60 | + | repo, closeDB := newHistoryBenchmarkRepository(b) | |||
| 61 | + | defer closeDB() | |||
| 62 | + | ctx := historyTestCtx() | |||
| 63 | + | ||||
| 64 | + | b.ReportAllocs() | |||
| 65 | + | b.ResetTimer() | |||
| 66 | + | for range b.N { | |||
| 67 | + | if _, err := repo.Search(ctx, "dumber history", 10); err != nil { | |||
| 68 | + | b.Fatal(err) | |||
| 69 | + | } | |||
| 70 | + | } | |||
| 71 | + | } | |||
M internal/logging/first_presentation_collector_test.go +132 -1
| @@ -2,6 +2,7 @@ package logging | |||
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "encoding/json" | |
| 5 | + | "fmt" | |
| 5 | 6 | "os" | |
| 6 | 7 | "os/exec" | |
| 7 | 8 | "path/filepath" | |
| @@ -143,8 +144,9 @@ func TestFirstPresentationCollectorSanitizesMachineLocalValues(t *testing.T) { | |||
| 143 | 144 | } | |
| 144 | 145 | for _, required := range []string{ | |
| 145 | 146 | `"measured_source_revision"`, | |
| 147 | + | `"version": "v0.8.4-0.20260714160309-bbd397409ebe"`, | |
| 146 | 148 | `"tag": "v0.8.4"`, | |
| 147 | - | `"revision": "f217ece342dea3ef2a3f98671fcd16a39ad0037d"`, | |
| 149 | + | `"revision": "bbd397409ebed75a5979c1e4566a2ef319f6a484"`, | |
| 148 | 150 | } { | |
| 149 | 151 | require.Contains(t, artifacts.String(), required) | |
| 150 | 152 | } | |
| @@ -166,6 +168,135 @@ func TestFirstPresentationCollectorSanitizesMachineLocalValues(t *testing.T) { | |||
| 166 | 168 | require.Equal(t, "integrated-gpu", metadata.Comparison.MachineGPUProfile) | |
| 167 | 169 | } | |
| 168 | 170 | ||
| 171 | + | func TestFirstPresentationCollectorDerivesSelectedImmutableModuleProvenance(t *testing.T) { | |
| 172 | + | repoRoot, err := filepath.Abs(filepath.Join("..", "..")) | |
| 173 | + | require.NoError(t, err) | |
| 174 | + | temp := t.TempDir() | |
| 175 | + | runtime := filepath.Join(temp, "cef-147-runtime") | |
| 176 | + | require.NoError(t, os.Mkdir(runtime, 0o755)) | |
| 177 | + | binary := filepath.Join(temp, "dumber") | |
| 178 | + | require.NoError(t, os.WriteFile(binary, collectorTestBinary(validFirstPresentationLog), 0o755)) | |
| 179 | + | ||
| 180 | + | // This exact pseudo-version is deliberately newer than the former v0.8.4 | |
| 181 | + | // hardcode; the collector must report what the selected module says. | |
| 182 | + | const version = "v0.8.5-0.20300102030405-bbd397409ebe" | |
| 183 | + | const revision = "bbd397409ebed75a5979c1e4566a2ef319f6a484" | |
| 184 | + | goBin := collectorProvenanceGo(t, temp, version, revision, "") | |
| 185 | + | output := filepath.Join(temp, "artifacts") | |
| 186 | + | cmd := exec.Command(filepath.Join(repoRoot, "scripts", "collect_first_presentation.sh")) | |
| 187 | + | cmd.Dir = repoRoot | |
| 188 | + | cmd.Env = append(os.Environ(), | |
| 189 | + | "DISPLAY=:test", | |
| 190 | + | "DUMBER_CEF_DIR="+runtime, | |
| 191 | + | "DUMBER_FIRST_PRESENTATION_BIN="+binary, | |
| 192 | + | "DUMBER_FIRST_PRESENTATION_OUTPUT="+output, | |
| 193 | + | "DUMBER_FIRST_PRESENTATION_TIMEOUT_SECONDS=1", | |
| 194 | + | "PATH="+filepath.Dir(goBin)+":"+os.Getenv("PATH"), | |
| 195 | + | ) | |
| 196 | + | result, err := cmd.CombinedOutput() | |
| 197 | + | require.NoErrorf(t, err, "collector failed: %s", result) | |
| 198 | + | ||
| 199 | + | var metadata struct { | |
| 200 | + | Upstream struct { | |
| 201 | + | Module string `json:"module"` | |
| 202 | + | Version string `json:"version"` | |
| 203 | + | Tag string `json:"tag"` | |
| 204 | + | Revision string `json:"revision"` | |
| 205 | + | } `json:"upstream"` | |
| 206 | + | } | |
| 207 | + | contents, err := os.ReadFile(filepath.Join(output, "metadata.json")) | |
| 208 | + | require.NoError(t, err) | |
| 209 | + | require.NoError(t, json.Unmarshal(contents, &metadata)) | |
| 210 | + | require.Equal(t, "github.com/bnema/purego-cef2gtk", metadata.Upstream.Module) | |
| 211 | + | require.Equal(t, version, metadata.Upstream.Version) | |
| 212 | + | require.Equal(t, "v0.8.5", metadata.Upstream.Tag) | |
| 213 | + | require.Equal(t, revision, metadata.Upstream.Revision) | |
| 214 | + | ||
| 215 | + | script, err := os.ReadFile(filepath.Join(repoRoot, "scripts", "collect_first_presentation.sh")) | |
| 216 | + | require.NoError(t, err) | |
| 217 | + | require.NotContains(t, string(script), "f217ece342dea3ef2a3f98671fcd16a39ad0037d") | |
| 218 | + | } | |
| 219 | + | ||
| 220 | + | func TestFirstPresentationCollectorRejectsNonImmutableModuleProvenanceWithoutLeaks(t *testing.T) { | |
| 221 | + | repoRoot, err := filepath.Abs(filepath.Join("..", "..")) | |
| 222 | + | require.NoError(t, err) | |
| 223 | + | ||
| 224 | + | for _, test := range []struct { | |
| 225 | + | name, version, revision, ref string | |
| 226 | + | }{ | |
| 227 | + | {name: "branch selector", version: "main", ref: "main"}, | |
| 228 | + | {name: "missing origin", version: "v0.8.5-0.20300102030405-bbd397409ebe"}, | |
| 229 | + | {name: "named origin ref", version: "v0.8.5-0.20300102030405-bbd397409ebe", revision: "bbd397409ebed75a5979c1e4566a2ef319f6a484", ref: "main"}, | |
| 230 | + | } { | |
| 231 | + | t.Run(test.name, func(t *testing.T) { | |
| 232 | + | temp := t.TempDir() | |
| 233 | + | runtime := filepath.Join(temp, "cef-147-runtime") | |
| 234 | + | require.NoError(t, os.Mkdir(runtime, 0o755)) | |
| 235 | + | binary := filepath.Join(temp, "dumber") | |
| 236 | + | require.NoError(t, os.WriteFile(binary, collectorTestBinary(validFirstPresentationLog), 0o755)) | |
| 237 | + | ||
| 238 | + | goBin := collectorProvenanceGo(t, temp, test.version, test.revision, test.ref) | |
| 239 | + | output := filepath.Join(temp, "artifacts") | |
| 240 | + | cmd := exec.Command(filepath.Join(repoRoot, "scripts", "collect_first_presentation.sh")) | |
| 241 | + | cmd.Dir = repoRoot | |
| 242 | + | cmd.Env = append(os.Environ(), | |
| 243 | + | "DISPLAY=:test", | |
| 244 | + | "DUMBER_CEF_DIR="+runtime, | |
| 245 | + | "DUMBER_FIRST_PRESENTATION_BIN="+binary, | |
| 246 | + | "DUMBER_FIRST_PRESENTATION_OUTPUT="+output, | |
| 247 | + | "PATH="+filepath.Dir(goBin)+":"+os.Getenv("PATH"), | |
| 248 | + | ) | |
| 249 | + | result, runErr := cmd.CombinedOutput() | |
| 250 | + | require.Errorf(t, runErr, "collector accepted nonimmutable module provenance: %s", result) | |
| 251 | + | require.Contains(t, string(result), "immutable module provenance is unavailable") | |
| 252 | + | require.NotContains(t, string(result), temp) | |
| 253 | + | require.NoFileExists(t, filepath.Join(output, "metadata.json")) | |
| 254 | + | for _, name := range runArtifactNames() { | |
| 255 | + | require.NoFileExists(t, filepath.Join(output, name)) | |
| 256 | + | } | |
| 257 | + | }) | |
| 258 | + | } | |
| 259 | + | } | |
| 260 | + | ||
| 261 | + | func collectorProvenanceGo(t *testing.T, temp, version, revision, ref string) string { | |
| 262 | + | t.Helper() | |
| 263 | + | infoPath := filepath.Join(temp, "module.info") | |
| 264 | + | info := map[string]any{"Version": version} | |
| 265 | + | if revision != "" { | |
| 266 | + | info["Origin"] = map[string]string{ | |
| 267 | + | "VCS": "git", "URL": "https://github.com/bnema/purego-cef2gtk", "Hash": revision, "Ref": ref, | |
| 268 | + | } | |
| 269 | + | } | |
| 270 | + | infoJSON, err := json.Marshal(info) | |
| 271 | + | require.NoError(t, err) | |
| 272 | + | require.NoError(t, os.WriteFile(infoPath, infoJSON, 0o600)) | |
| 273 | + | ||
| 274 | + | selectedJSON, err := json.Marshal(map[string]string{ | |
| 275 | + | "Path": "github.com/bnema/purego-cef2gtk", "Version": version, | |
| 276 | + | }) | |
| 277 | + | require.NoError(t, err) | |
| 278 | + | downloadedJSON, err := json.Marshal(map[string]string{ | |
| 279 | + | "Path": "github.com/bnema/purego-cef2gtk", "Version": version, "Info": infoPath, | |
| 280 | + | }) | |
| 281 | + | require.NoError(t, err) | |
| 282 | + | binDir := filepath.Join(temp, "bin") | |
| 283 | + | require.NoError(t, os.Mkdir(binDir, 0o755)) | |
| 284 | + | goBin := filepath.Join(binDir, "go") | |
| 285 | + | script := fmt.Sprintf(`#!/bin/sh | |
| 286 | + | if [ "$1" = "list" ] && [ "$2" = "-m" ] && [ "$3" = "-json" ] && [ "$4" = "github.com/bnema/purego-cef2gtk" ]; then | |
| 287 | + | printf '%%s\n' '%s' | |
| 288 | + | exit 0 | |
| 289 | + | fi | |
| 290 | + | if [ "$1" = "mod" ] && [ "$2" = "download" ] && [ "$3" = "-json" ] && [ "$4" = "github.com/bnema/purego-cef2gtk@%s" ]; then | |
| 291 | + | printf '%%s\n' '%s' | |
| 292 | + | exit 0 | |
| 293 | + | fi | |
| 294 | + | exit 1 | |
| 295 | + | `, selectedJSON, version, downloadedJSON) | |
| 296 | + | require.NoError(t, os.WriteFile(goBin, []byte(script), 0o755)) | |
| 297 | + | return goBin | |
| 298 | + | } | |
| 299 | + | ||
| 169 | 300 | func TestFirstPresentationCollectorDefaultsToXDGStateEvidenceDirectory(t *testing.T) { | |
| 170 | 301 | repoRoot, err := filepath.Abs(filepath.Join("..", "..")) | |
| 171 | 302 | require.NoError(t, err) | |
| @@ -2,6 +2,7 @@ package logging | |||||
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "encoding/json" | 4 | "encoding/json" | ||
| 5 | + | "fmt" | |||
| 5 | "os" | 6 | "os" | ||
| 6 | "os/exec" | 7 | "os/exec" | ||
| 7 | "path/filepath" | 8 | "path/filepath" | ||
| @@ -143,8 +144,9 @@ func TestFirstPresentationCollectorSanitizesMachineLocalValues(t *testing.T) { | |||||
| 143 | } | 144 | } | ||
| 144 | for _, required := range []string{ | 145 | for _, required := range []string{ | ||
| 145 | `"measured_source_revision"`, | 146 | `"measured_source_revision"`, | ||
| 147 | + | `"version": "v0.8.4-0.20260714160309-bbd397409ebe"`, | |||
| 146 | `"tag": "v0.8.4"`, | 148 | `"tag": "v0.8.4"`, | ||
| 147 | - | `"revision": "f217ece342dea3ef2a3f98671fcd16a39ad0037d"`, | 149 | + | `"revision": "bbd397409ebed75a5979c1e4566a2ef319f6a484"`, |
| 148 | } { | 150 | } { | ||
| 149 | require.Contains(t, artifacts.String(), required) | 151 | require.Contains(t, artifacts.String(), required) | ||
| 150 | } | 152 | } | ||
| @@ -166,6 +168,135 @@ func TestFirstPresentationCollectorSanitizesMachineLocalValues(t *testing.T) { | |||||
| 166 | require.Equal(t, "integrated-gpu", metadata.Comparison.MachineGPUProfile) | 168 | require.Equal(t, "integrated-gpu", metadata.Comparison.MachineGPUProfile) | ||
| 167 | } | 169 | } | ||
| 168 | 170 | ||||
| 171 | + | func TestFirstPresentationCollectorDerivesSelectedImmutableModuleProvenance(t *testing.T) { | |||
| 172 | + | repoRoot, err := filepath.Abs(filepath.Join("..", "..")) | |||
| 173 | + | require.NoError(t, err) | |||
| 174 | + | temp := t.TempDir() | |||
| 175 | + | runtime := filepath.Join(temp, "cef-147-runtime") | |||
| 176 | + | require.NoError(t, os.Mkdir(runtime, 0o755)) | |||
| 177 | + | binary := filepath.Join(temp, "dumber") | |||
| 178 | + | require.NoError(t, os.WriteFile(binary, collectorTestBinary(validFirstPresentationLog), 0o755)) | |||
| 179 | + | ||||
| 180 | + | // This exact pseudo-version is deliberately newer than the former v0.8.4 | |||
| 181 | + | // hardcode; the collector must report what the selected module says. | |||
| 182 | + | const version = "v0.8.5-0.20300102030405-bbd397409ebe" | |||
| 183 | + | const revision = "bbd397409ebed75a5979c1e4566a2ef319f6a484" | |||
| 184 | + | goBin := collectorProvenanceGo(t, temp, version, revision, "") | |||
| 185 | + | output := filepath.Join(temp, "artifacts") | |||
| 186 | + | cmd := exec.Command(filepath.Join(repoRoot, "scripts", "collect_first_presentation.sh")) | |||
| 187 | + | cmd.Dir = repoRoot | |||
| 188 | + | cmd.Env = append(os.Environ(), | |||
| 189 | + | "DISPLAY=:test", | |||
| 190 | + | "DUMBER_CEF_DIR="+runtime, | |||
| 191 | + | "DUMBER_FIRST_PRESENTATION_BIN="+binary, | |||
| 192 | + | "DUMBER_FIRST_PRESENTATION_OUTPUT="+output, | |||
| 193 | + | "DUMBER_FIRST_PRESENTATION_TIMEOUT_SECONDS=1", | |||
| 194 | + | "PATH="+filepath.Dir(goBin)+":"+os.Getenv("PATH"), | |||
| 195 | + | ) | |||
| 196 | + | result, err := cmd.CombinedOutput() | |||
| 197 | + | require.NoErrorf(t, err, "collector failed: %s", result) | |||
| 198 | + | ||||
| 199 | + | var metadata struct { | |||
| 200 | + | Upstream struct { | |||
| 201 | + | Module string `json:"module"` | |||
| 202 | + | Version string `json:"version"` | |||
| 203 | + | Tag string `json:"tag"` | |||
| 204 | + | Revision string `json:"revision"` | |||
| 205 | + | } `json:"upstream"` | |||
| 206 | + | } | |||
| 207 | + | contents, err := os.ReadFile(filepath.Join(output, "metadata.json")) | |||
| 208 | + | require.NoError(t, err) | |||
| 209 | + | require.NoError(t, json.Unmarshal(contents, &metadata)) | |||
| 210 | + | require.Equal(t, "github.com/bnema/purego-cef2gtk", metadata.Upstream.Module) | |||
| 211 | + | require.Equal(t, version, metadata.Upstream.Version) | |||
| 212 | + | require.Equal(t, "v0.8.5", metadata.Upstream.Tag) | |||
| 213 | + | require.Equal(t, revision, metadata.Upstream.Revision) | |||
| 214 | + | ||||
| 215 | + | script, err := os.ReadFile(filepath.Join(repoRoot, "scripts", "collect_first_presentation.sh")) | |||
| 216 | + | require.NoError(t, err) | |||
| 217 | + | require.NotContains(t, string(script), "f217ece342dea3ef2a3f98671fcd16a39ad0037d") | |||
| 218 | + | } | |||
| 219 | + | ||||
| 220 | + | func TestFirstPresentationCollectorRejectsNonImmutableModuleProvenanceWithoutLeaks(t *testing.T) { | |||
| 221 | + | repoRoot, err := filepath.Abs(filepath.Join("..", "..")) | |||
| 222 | + | require.NoError(t, err) | |||
| 223 | + | ||||
| 224 | + | for _, test := range []struct { | |||
| 225 | + | name, version, revision, ref string | |||
| 226 | + | }{ | |||
| 227 | + | {name: "branch selector", version: "main", ref: "main"}, | |||
| 228 | + | {name: "missing origin", version: "v0.8.5-0.20300102030405-bbd397409ebe"}, | |||
| 229 | + | {name: "named origin ref", version: "v0.8.5-0.20300102030405-bbd397409ebe", revision: "bbd397409ebed75a5979c1e4566a2ef319f6a484", ref: "main"}, | |||
| 230 | + | } { | |||
| 231 | + | t.Run(test.name, func(t *testing.T) { | |||
| 232 | + | temp := t.TempDir() | |||
| 233 | + | runtime := filepath.Join(temp, "cef-147-runtime") | |||
| 234 | + | require.NoError(t, os.Mkdir(runtime, 0o755)) | |||
| 235 | + | binary := filepath.Join(temp, "dumber") | |||
| 236 | + | require.NoError(t, os.WriteFile(binary, collectorTestBinary(validFirstPresentationLog), 0o755)) | |||
| 237 | + | ||||
| 238 | + | goBin := collectorProvenanceGo(t, temp, test.version, test.revision, test.ref) | |||
| 239 | + | output := filepath.Join(temp, "artifacts") | |||
| 240 | + | cmd := exec.Command(filepath.Join(repoRoot, "scripts", "collect_first_presentation.sh")) | |||
| 241 | + | cmd.Dir = repoRoot | |||
| 242 | + | cmd.Env = append(os.Environ(), | |||
| 243 | + | "DISPLAY=:test", | |||
| 244 | + | "DUMBER_CEF_DIR="+runtime, | |||
| 245 | + | "DUMBER_FIRST_PRESENTATION_BIN="+binary, | |||
| 246 | + | "DUMBER_FIRST_PRESENTATION_OUTPUT="+output, | |||
| 247 | + | "PATH="+filepath.Dir(goBin)+":"+os.Getenv("PATH"), | |||
| 248 | + | ) | |||
| 249 | + | result, runErr := cmd.CombinedOutput() | |||
| 250 | + | require.Errorf(t, runErr, "collector accepted nonimmutable module provenance: %s", result) | |||
| 251 | + | require.Contains(t, string(result), "immutable module provenance is unavailable") | |||
| 252 | + | require.NotContains(t, string(result), temp) | |||
| 253 | + | require.NoFileExists(t, filepath.Join(output, "metadata.json")) | |||
| 254 | + | for _, name := range runArtifactNames() { | |||
| 255 | + | require.NoFileExists(t, filepath.Join(output, name)) | |||
| 256 | + | } | |||
| 257 | + | }) | |||
| 258 | + | } | |||
| 259 | + | } | |||
| 260 | + | ||||
| 261 | + | func collectorProvenanceGo(t *testing.T, temp, version, revision, ref string) string { | |||
| 262 | + | t.Helper() | |||
| 263 | + | infoPath := filepath.Join(temp, "module.info") | |||
| 264 | + | info := map[string]any{"Version": version} | |||
| 265 | + | if revision != "" { | |||
| 266 | + | info["Origin"] = map[string]string{ | |||
| 267 | + | "VCS": "git", "URL": "https://github.com/bnema/purego-cef2gtk", "Hash": revision, "Ref": ref, | |||
| 268 | + | } | |||
| 269 | + | } | |||
| 270 | + | infoJSON, err := json.Marshal(info) | |||
| 271 | + | require.NoError(t, err) | |||
| 272 | + | require.NoError(t, os.WriteFile(infoPath, infoJSON, 0o600)) | |||
| 273 | + | ||||
| 274 | + | selectedJSON, err := json.Marshal(map[string]string{ | |||
| 275 | + | "Path": "github.com/bnema/purego-cef2gtk", "Version": version, | |||
| 276 | + | }) | |||
| 277 | + | require.NoError(t, err) | |||
| 278 | + | downloadedJSON, err := json.Marshal(map[string]string{ | |||
| 279 | + | "Path": "github.com/bnema/purego-cef2gtk", "Version": version, "Info": infoPath, | |||
| 280 | + | }) | |||
| 281 | + | require.NoError(t, err) | |||
| 282 | + | binDir := filepath.Join(temp, "bin") | |||
| 283 | + | require.NoError(t, os.Mkdir(binDir, 0o755)) | |||
| 284 | + | goBin := filepath.Join(binDir, "go") | |||
| 285 | + | script := fmt.Sprintf(`#!/bin/sh | |||
| 286 | + | if [ "$1" = "list" ] && [ "$2" = "-m" ] && [ "$3" = "-json" ] && [ "$4" = "github.com/bnema/purego-cef2gtk" ]; then | |||
| 287 | + | printf '%%s\n' '%s' | |||
| 288 | + | exit 0 | |||
| 289 | + | fi | |||
| 290 | + | if [ "$1" = "mod" ] && [ "$2" = "download" ] && [ "$3" = "-json" ] && [ "$4" = "github.com/bnema/purego-cef2gtk@%s" ]; then | |||
| 291 | + | printf '%%s\n' '%s' | |||
| 292 | + | exit 0 | |||
| 293 | + | fi | |||
| 294 | + | exit 1 | |||
| 295 | + | `, selectedJSON, version, downloadedJSON) | |||
| 296 | + | require.NoError(t, os.WriteFile(goBin, []byte(script), 0o755)) | |||
| 297 | + | return goBin | |||
| 298 | + | } | |||
| 299 | + | ||||
| 169 | func TestFirstPresentationCollectorDefaultsToXDGStateEvidenceDirectory(t *testing.T) { | 300 | func TestFirstPresentationCollectorDefaultsToXDGStateEvidenceDirectory(t *testing.T) { | ||
| 170 | repoRoot, err := filepath.Abs(filepath.Join("..", "..")) | 301 | repoRoot, err := filepath.Abs(filepath.Join("..", "..")) | ||
| 171 | require.NoError(t, err) | 302 | require.NoError(t, err) | ||
M scripts/collect_first_presentation.sh +78 -9
| @@ -31,8 +31,78 @@ else | |||
| 31 | 31 | fi | |
| 32 | 32 | readonly output | |
| 33 | 33 | readonly upstream_module="github.com/bnema/purego-cef2gtk" | |
| 34 | - | readonly upstream_tag="v0.8.4" | |
| 35 | - | readonly upstream_revision="f217ece342dea3ef2a3f98671fcd16a39ad0037d" | |
| 34 | + | ||
| 35 | + | # Resolve the version selected by this checkout, then obtain its immutable VCS | |
| 36 | + | # origin from Go's cached module metadata. Do not infer a revision from a tag, | |
| 37 | + | # a branch, or a truncated pseudo-version suffix. | |
| 38 | + | resolve_upstream_provenance() { | |
| 39 | + | local selected_metadata selected_version downloaded_metadata | |
| 40 | + | ||
| 41 | + | selected_metadata="$(go list -m -json "$upstream_module" 2>/dev/null)" || { | |
| 42 | + | echo "first-presentation: immutable module provenance is unavailable" >&2 | |
| 43 | + | exit 2 | |
| 44 | + | } | |
| 45 | + | selected_version="$(python3 - "$upstream_module" "$selected_metadata" <<'PY' | |
| 46 | + | import json, sys | |
| 47 | + | try: | |
| 48 | + | metadata = json.loads(sys.argv[2]) | |
| 49 | + | if metadata.get("Path") != sys.argv[1] or not isinstance(metadata.get("Version"), str): | |
| 50 | + | raise ValueError | |
| 51 | + | print(metadata["Version"]) | |
| 52 | + | except (AttributeError, TypeError, ValueError, json.JSONDecodeError): | |
| 53 | + | raise SystemExit("first-presentation: immutable module provenance is unavailable") | |
| 54 | + | PY | |
| 55 | + | )" || exit $? | |
| 56 | + | downloaded_metadata="$(go mod download -json "$upstream_module@$selected_version" 2>/dev/null)" || { | |
| 57 | + | echo "first-presentation: immutable module provenance is unavailable" >&2 | |
| 58 | + | exit 2 | |
| 59 | + | } | |
| 60 | + | ||
| 61 | + | python3 - "$upstream_module" "$selected_metadata" "$downloaded_metadata" <<'PY' | |
| 62 | + | import json, re, sys | |
| 63 | + | ||
| 64 | + | module, selected_raw, downloaded_raw = sys.argv[1:] | |
| 65 | + | ||
| 66 | + | def fail(): | |
| 67 | + | # Do not expose Go cache locations or other machine-local values. | |
| 68 | + | raise SystemExit("first-presentation: immutable module provenance is unavailable") | |
| 69 | + | ||
| 70 | + | try: | |
| 71 | + | selected = json.loads(selected_raw) | |
| 72 | + | downloaded = json.loads(downloaded_raw) | |
| 73 | + | version = selected["Version"] | |
| 74 | + | if selected.get("Path") != module or downloaded.get("Path") != module: | |
| 75 | + | fail() | |
| 76 | + | if downloaded.get("Version") != version: | |
| 77 | + | fail() | |
| 78 | + | # A selected pseudo-version is an exact immutable selector, never a branch. | |
| 79 | + | match = re.fullmatch(r"(v\d+\.\d+\.\d+)-0\.\d{14}-([0-9a-f]{12})", version) | |
| 80 | + | if not match: | |
| 81 | + | fail() | |
| 82 | + | info_path = downloaded.get("Info") | |
| 83 | + | if not isinstance(info_path, str) or not info_path: | |
| 84 | + | fail() | |
| 85 | + | with open(info_path, encoding="utf-8") as info_file: | |
| 86 | + | info = json.load(info_file) | |
| 87 | + | origin = info.get("Origin") or downloaded.get("Origin") | |
| 88 | + | if info.get("Version") != version or not isinstance(origin, dict): | |
| 89 | + | fail() | |
| 90 | + | revision = origin.get("Hash") | |
| 91 | + | if origin.get("VCS") != "git" or origin.get("URL") != "https://github.com/bnema/purego-cef2gtk": | |
| 92 | + | fail() | |
| 93 | + | if not isinstance(revision, str) or not re.fullmatch(r"[0-9a-f]{40}", revision): | |
| 94 | + | fail() | |
| 95 | + | if not revision.startswith(match.group(2)): | |
| 96 | + | fail() | |
| 97 | + | # A named ref can move. Only the immutable hash itself is acceptable. | |
| 98 | + | if origin.get("Ref") not in (None, "", revision): | |
| 99 | + | fail() | |
| 100 | + | except (AttributeError, KeyError, OSError, TypeError, ValueError, json.JSONDecodeError): | |
| 101 | + | fail() | |
| 102 | + | ||
| 103 | + | print("\t".join((version, match.group(1), revision))) | |
| 104 | + | PY | |
| 105 | + | } | |
| 36 | 106 | ||
| 37 | 107 | # The artifact destination is caller-controlled. Never empty or recursively | |
| 38 | 108 | # clear it: collection only writes to a newly-created directory whose parent is | |
| @@ -66,10 +136,9 @@ prepare_output | |||
| 66 | 136 | [[ -x "$binary" ]] || { echo "first-presentation: executable not found: $binary" >&2; exit 2; } | |
| 67 | 137 | [[ -d "$runtime" ]] || { echo "first-presentation: CEF runtime not found: $runtime" >&2; exit 2; } | |
| 68 | 138 | [[ -n "${WAYLAND_DISPLAY:-}${DISPLAY:-}" ]] || { echo "first-presentation: a current Wayland/X11 display is required" >&2; exit 2; } | |
| 69 | - | [[ "$(go list -m -f '{{.Version}}' "$upstream_module")" == "$upstream_tag" ]] || { | |
| 70 | - | echo "first-presentation: expected $upstream_module@$upstream_tag" >&2 | |
| 71 | - | exit 2 | |
| 72 | - | } | |
| 139 | + | upstream_provenance="$(resolve_upstream_provenance)" || exit $? | |
| 140 | + | IFS=$'\t' read -r upstream_version upstream_tag upstream_revision <<<"$upstream_provenance" | |
| 141 | + | readonly upstream_version upstream_tag upstream_revision | |
| 73 | 142 | ||
| 74 | 143 | # Raw logs and temporary XDG homes may contain machine-local paths. Keep them | |
| 75 | 144 | # outside the committed artifact directory and always remove them. | |
| @@ -80,9 +149,9 @@ cleanup_work_root() { | |||
| 80 | 149 | rm -rf -- "$work_root" | |
| 81 | 150 | } | |
| 82 | 151 | trap cleanup_work_root EXIT | |
| 83 | - | python3 - "$output/metadata.json" "$binary" "$timeout_seconds" "$upstream_module" "$upstream_tag" "$upstream_revision" <<'PY' | |
| 152 | + | python3 - "$output/metadata.json" "$binary" "$timeout_seconds" "$upstream_module" "$upstream_version" "$upstream_tag" "$upstream_revision" <<'PY' | |
| 84 | 153 | import hashlib, json, os, platform, subprocess, sys | |
| 85 | - | path, binary, timeout, upstream_module, upstream_tag, upstream_revision = sys.argv[1:] | |
| 154 | + | path, binary, timeout, upstream_module, upstream_version, upstream_tag, upstream_revision = sys.argv[1:] | |
| 86 | 155 | with open(binary, "rb") as candidate: | |
| 87 | 156 | binary_sha256 = hashlib.file_digest(candidate, "sha256").hexdigest() | |
| 88 | 157 | ||
| @@ -102,7 +171,7 @@ json.dump({ | |||
| 102 | 171 | "binary": {"label": "dumber", "sha256": binary_sha256}, | |
| 103 | 172 | "timeout_seconds": int(timeout), | |
| 104 | 173 | "measured_source_revision": subprocess.check_output(["git", "-c", f"safe.directory={os.getcwd()}", "rev-parse", "HEAD"], text=True).strip(), | |
| 105 | - | "upstream": {"module": upstream_module, "tag": upstream_tag, "revision": upstream_revision}, | |
| 174 | + | "upstream": {"module": upstream_module, "version": upstream_version, "tag": upstream_tag, "revision": upstream_revision}, | |
| 106 | 175 | "comparison": {"os": os_label, "architecture": architecture, "display_protocol": display_protocol, "machine_gpu_profile": gpu_profile}, | |
| 107 | 176 | "render_configuration": {"backend": "gdk-dmabuf", "buffer_sharing": "dmabuf", "renderer": "vulkan"} | |
| 108 | 177 | }, open(path, "w"), indent=2, sort_keys=True) | |
| @@ -31,8 +31,78 @@ else | |||||
| 31 | fi | 31 | fi | ||
| 32 | readonly output | 32 | readonly output | ||
| 33 | readonly upstream_module="github.com/bnema/purego-cef2gtk" | 33 | readonly upstream_module="github.com/bnema/purego-cef2gtk" | ||
| 34 | - | readonly upstream_tag="v0.8.4" | 34 | + | |
| 35 | - | readonly upstream_revision="f217ece342dea3ef2a3f98671fcd16a39ad0037d" | 35 | + | # Resolve the version selected by this checkout, then obtain its immutable VCS |
| 36 | + | # origin from Go's cached module metadata. Do not infer a revision from a tag, | |||
| 37 | + | # a branch, or a truncated pseudo-version suffix. | |||
| 38 | + | resolve_upstream_provenance() { | |||
| 39 | + | local selected_metadata selected_version downloaded_metadata | |||
| 40 | + | ||||
| 41 | + | selected_metadata="$(go list -m -json "$upstream_module" 2>/dev/null)" || { | |||
| 42 | + | echo "first-presentation: immutable module provenance is unavailable" >&2 | |||
| 43 | + | exit 2 | |||
| 44 | + | } | |||
| 45 | + | selected_version="$(python3 - "$upstream_module" "$selected_metadata" <<'PY' | |||
| 46 | + | import json, sys | |||
| 47 | + | try: | |||
| 48 | + | metadata = json.loads(sys.argv[2]) | |||
| 49 | + | if metadata.get("Path") != sys.argv[1] or not isinstance(metadata.get("Version"), str): | |||
| 50 | + | raise ValueError | |||
| 51 | + | print(metadata["Version"]) | |||
| 52 | + | except (AttributeError, TypeError, ValueError, json.JSONDecodeError): | |||
| 53 | + | raise SystemExit("first-presentation: immutable module provenance is unavailable") | |||
| 54 | + | PY | |||
| 55 | + | )" || exit $? | |||
| 56 | + | downloaded_metadata="$(go mod download -json "$upstream_module@$selected_version" 2>/dev/null)" || { | |||
| 57 | + | echo "first-presentation: immutable module provenance is unavailable" >&2 | |||
| 58 | + | exit 2 | |||
| 59 | + | } | |||
| 60 | + | ||||
| 61 | + | python3 - "$upstream_module" "$selected_metadata" "$downloaded_metadata" <<'PY' | |||
| 62 | + | import json, re, sys | |||
| 63 | + | ||||
| 64 | + | module, selected_raw, downloaded_raw = sys.argv[1:] | |||
| 65 | + | ||||
| 66 | + | def fail(): | |||
| 67 | + | # Do not expose Go cache locations or other machine-local values. | |||
| 68 | + | raise SystemExit("first-presentation: immutable module provenance is unavailable") | |||
| 69 | + | ||||
| 70 | + | try: | |||
| 71 | + | selected = json.loads(selected_raw) | |||
| 72 | + | downloaded = json.loads(downloaded_raw) | |||
| 73 | + | version = selected["Version"] | |||
| 74 | + | if selected.get("Path") != module or downloaded.get("Path") != module: | |||
| 75 | + | fail() | |||
| 76 | + | if downloaded.get("Version") != version: | |||
| 77 | + | fail() | |||
| 78 | + | # A selected pseudo-version is an exact immutable selector, never a branch. | |||
| 79 | + | match = re.fullmatch(r"(v\d+\.\d+\.\d+)-0\.\d{14}-([0-9a-f]{12})", version) | |||
| 80 | + | if not match: | |||
| 81 | + | fail() | |||
| 82 | + | info_path = downloaded.get("Info") | |||
| 83 | + | if not isinstance(info_path, str) or not info_path: | |||
| 84 | + | fail() | |||
| 85 | + | with open(info_path, encoding="utf-8") as info_file: | |||
| 86 | + | info = json.load(info_file) | |||
| 87 | + | origin = info.get("Origin") or downloaded.get("Origin") | |||
| 88 | + | if info.get("Version") != version or not isinstance(origin, dict): | |||
| 89 | + | fail() | |||
| 90 | + | revision = origin.get("Hash") | |||
| 91 | + | if origin.get("VCS") != "git" or origin.get("URL") != "https://github.com/bnema/purego-cef2gtk": | |||
| 92 | + | fail() | |||
| 93 | + | if not isinstance(revision, str) or not re.fullmatch(r"[0-9a-f]{40}", revision): | |||
| 94 | + | fail() | |||
| 95 | + | if not revision.startswith(match.group(2)): | |||
| 96 | + | fail() | |||
| 97 | + | # A named ref can move. Only the immutable hash itself is acceptable. | |||
| 98 | + | if origin.get("Ref") not in (None, "", revision): | |||
| 99 | + | fail() | |||
| 100 | + | except (AttributeError, KeyError, OSError, TypeError, ValueError, json.JSONDecodeError): | |||
| 101 | + | fail() | |||
| 102 | + | ||||
| 103 | + | print("\t".join((version, match.group(1), revision))) | |||
| 104 | + | PY | |||
| 105 | + | } | |||
| 36 | 106 | ||||
| 37 | # The artifact destination is caller-controlled. Never empty or recursively | 107 | # The artifact destination is caller-controlled. Never empty or recursively | ||
| 38 | # clear it: collection only writes to a newly-created directory whose parent is | 108 | # clear it: collection only writes to a newly-created directory whose parent is | ||
| @@ -66,10 +136,9 @@ prepare_output | |||||
| 66 | [[ -x "$binary" ]] || { echo "first-presentation: executable not found: $binary" >&2; exit 2; } | 136 | [[ -x "$binary" ]] || { echo "first-presentation: executable not found: $binary" >&2; exit 2; } | ||
| 67 | [[ -d "$runtime" ]] || { echo "first-presentation: CEF runtime not found: $runtime" >&2; exit 2; } | 137 | [[ -d "$runtime" ]] || { echo "first-presentation: CEF runtime not found: $runtime" >&2; exit 2; } | ||
| 68 | [[ -n "${WAYLAND_DISPLAY:-}${DISPLAY:-}" ]] || { echo "first-presentation: a current Wayland/X11 display is required" >&2; exit 2; } | 138 | [[ -n "${WAYLAND_DISPLAY:-}${DISPLAY:-}" ]] || { echo "first-presentation: a current Wayland/X11 display is required" >&2; exit 2; } | ||
| 69 | - | [[ "$(go list -m -f '{{.Version}}' "$upstream_module")" == "$upstream_tag" ]] || { | 139 | + | upstream_provenance="$(resolve_upstream_provenance)" || exit $? |
| 70 | - | echo "first-presentation: expected $upstream_module@$upstream_tag" >&2 | 140 | + | IFS=$'\t' read -r upstream_version upstream_tag upstream_revision <<<"$upstream_provenance" |
| 71 | - | exit 2 | 141 | + | readonly upstream_version upstream_tag upstream_revision |
| 72 | - | } | |||
| 73 | 142 | ||||
| 74 | # Raw logs and temporary XDG homes may contain machine-local paths. Keep them | 143 | # Raw logs and temporary XDG homes may contain machine-local paths. Keep them | ||
| 75 | # outside the committed artifact directory and always remove them. | 144 | # outside the committed artifact directory and always remove them. | ||
| @@ -80,9 +149,9 @@ cleanup_work_root() { | |||||
| 80 | rm -rf -- "$work_root" | 149 | rm -rf -- "$work_root" | ||
| 81 | } | 150 | } | ||
| 82 | trap cleanup_work_root EXIT | 151 | trap cleanup_work_root EXIT | ||
| 83 | - | python3 - "$output/metadata.json" "$binary" "$timeout_seconds" "$upstream_module" "$upstream_tag" "$upstream_revision" <<'PY' | 152 | + | python3 - "$output/metadata.json" "$binary" "$timeout_seconds" "$upstream_module" "$upstream_version" "$upstream_tag" "$upstream_revision" <<'PY' |
| 84 | import hashlib, json, os, platform, subprocess, sys | 153 | import hashlib, json, os, platform, subprocess, sys | ||
| 85 | - | path, binary, timeout, upstream_module, upstream_tag, upstream_revision = sys.argv[1:] | 154 | + | path, binary, timeout, upstream_module, upstream_version, upstream_tag, upstream_revision = sys.argv[1:] |
| 86 | with open(binary, "rb") as candidate: | 155 | with open(binary, "rb") as candidate: | ||
| 87 | binary_sha256 = hashlib.file_digest(candidate, "sha256").hexdigest() | 156 | binary_sha256 = hashlib.file_digest(candidate, "sha256").hexdigest() | ||
| 88 | 157 | ||||
| @@ -102,7 +171,7 @@ json.dump({ | |||||
| 102 | "binary": {"label": "dumber", "sha256": binary_sha256}, | 171 | "binary": {"label": "dumber", "sha256": binary_sha256}, | ||
| 103 | "timeout_seconds": int(timeout), | 172 | "timeout_seconds": int(timeout), | ||
| 104 | "measured_source_revision": subprocess.check_output(["git", "-c", f"safe.directory={os.getcwd()}", "rev-parse", "HEAD"], text=True).strip(), | 173 | "measured_source_revision": subprocess.check_output(["git", "-c", f"safe.directory={os.getcwd()}", "rev-parse", "HEAD"], text=True).strip(), | ||
| 105 | - | "upstream": {"module": upstream_module, "tag": upstream_tag, "revision": upstream_revision}, | 174 | + | "upstream": {"module": upstream_module, "version": upstream_version, "tag": upstream_tag, "revision": upstream_revision}, |
| 106 | "comparison": {"os": os_label, "architecture": architecture, "display_protocol": display_protocol, "machine_gpu_profile": gpu_profile}, | 175 | "comparison": {"os": os_label, "architecture": architecture, "display_protocol": display_protocol, "machine_gpu_profile": gpu_profile}, | ||
| 107 | "render_configuration": {"backend": "gdk-dmabuf", "buffer_sharing": "dmabuf", "renderer": "vulkan"} | 176 | "render_configuration": {"backend": "gdk-dmabuf", "buffer_sharing": "dmabuf", "renderer": "vulkan"} | ||
| 108 | }, open(path, "w"), indent=2, sort_keys=True) | 177 | }, open(path, "w"), indent=2, sort_keys=True) | ||
M vendor/github.com/bnema/purego-cef/cef/bridge.go +8 -13 generated file: collapsed
M vendor/github.com/bnema/purego-cef2gtk/internal/cefadapter/accelerated_paint.go +34 -37 generated file: collapsed
M vendor/github.com/bnema/purego-cef2gtk/internal/dmabuf/frame.go +38 -19 generated file: collapsed
M vendor/github.com/bnema/purego-cef2gtk/internal/gtkgdk/renderer.go +89 -69 generated file: collapsed
M vendor/github.com/bnema/purego-pipewire/internal/core/player.go +5 -0 generated file: collapsed
M vendor/github.com/bnema/purego-pipewire/internal/core/player_rt.go +10 -6 generated file: collapsed
M vendor/github.com/bnema/purego-pipewire/internal/core/pwbuffer.go +66 -32 generated file: collapsed
M vendor/github.com/bnema/purego-sqlite/driver/driver.go +268 -63 generated file: collapsed
M vendor/github.com/bnema/purego-sqlite/internal/core/db.go +8 -0 generated file: collapsed
M vendor/github.com/bnema/purego-sqlite/internal/core/rows.go +13 -0 generated file: collapsed
M vendor/github.com/bnema/purego-sqlite/internal/loader/loader.go +23 -5 generated file: collapsed
M vendor/github.com/bnema/purego-sqlite/internal/ports/in/ports_gen.go +3 -0 generated file: collapsed
M vendor/github.com/bnema/puregotk/internal/core/core.go +197 -4 generated file: collapsed
M vendor/github.com/bnema/puregotk/pkg/core/core.go +10 -0 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-about-dialog.go +99 -64 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-about-window.go +95 -62 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-accent-color.go +7 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-action-row.go +33 -29 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-alert-dialog.go +66 -47 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-animation-target.go +10 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-animation-util.go +4 -12 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-animation.go +24 -26 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-application-window.go +14 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-application.go +3 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-avatar.go +22 -25 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-banner.go +23 -26 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-bin.go +5 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-bottom-sheet.go +47 -38 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-breakpoint-bin.go +10 -19 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-breakpoint.go +33 -37 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-button-content.go +18 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-button-row.go +10 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-carousel-indicator-dots.go +5 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-carousel-indicator-lines.go +5 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-carousel.go +47 -37 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-clamp-layout.go +14 -20 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-clamp-scrollable.go +17 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-clamp.go +17 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-combo-row.go +34 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-dialog.go +45 -38 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-easing.go +3 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-entry-row.go +40 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-enum-list-model.go +13 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-expander-row.go +40 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-flap.go +61 -48 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-fold-threshold-policy.go +10 -1 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-header-bar.go +36 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-inline-view-switcher.go +18 -24 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-layout-slot.go +4 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-layout.go +7 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-leaflet.go +69 -56 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-length-unit.go +5 -14 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-main.go +5 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-message-dialog.go +63 -44 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-multi-layout-view.go +17 -23 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-navigation-direction.go +10 -1 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-navigation-split-view.go +36 -32 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-navigation-view.go +60 -49 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-overlay-split-view.go +48 -38 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-password-entry-row.go +2 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-dialog.go +23 -25 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-group.go +24 -26 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-page.go +38 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-row.go +18 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-window.go +31 -29 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-shortcut-label.go +10 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-shortcuts-dialog.go +4 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-shortcuts-item.go +23 -25 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-shortcuts-section.go +8 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-sidebar-item.go +45 -37 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-sidebar-section.go +24 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-sidebar.go +41 -39 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spin-row.go +40 -34 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spinner-paintable.go +5 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spinner.go +2 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-split-button.go +39 -34 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spring-animation.go +34 -30 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spring-params.go +17 -21 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-squeezer.go +49 -44 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-status-page.go +20 -24 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-style-manager.go +25 -28 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-swipe-tracker.go +33 -30 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-swipeable.go +33 -21 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-switch-row.go +6 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-tab-bar.go +35 -32 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-tab-button.go +5 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-tab-overview.go +45 -37 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-tab-view.go +123 -87 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-timed-animation.go +30 -28 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-toast-overlay.go +9 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-toast.go +41 -36 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-toggle-group.go +64 -51 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-toolbar-view.go +40 -35 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-version.go +7 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-stack.go +78 -62 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-switcher-bar.go +9 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-switcher-sidebar.go +15 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-switcher-title.go +19 -23 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-switcher.go +10 -20 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-window-title.go +10 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-window.go +14 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-wrap-box.go +66 -46 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-wrap-layout.go +57 -46 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/cairo/main.go +36 -79 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkapplaunchcontext.go +10 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcairo.go +12 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcairocontext.go +3 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcicpparams.go +20 -25 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkclipboard.go +34 -32 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcolorstate.go +12 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcontentdeserializer.go +26 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcontentformats.go +28 -31 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcontentprovider.go +23 -28 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcontentserializer.go +26 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcursor.go +12 -21 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdevice.go +36 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdevicepad.go +27 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdevicetool.go +10 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdisplay.go +51 -43 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdisplaymanager.go +10 -20 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdmabuftexture.go +3 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdmabuftexturebuilder.go +53 -41 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdrag.go +20 -28 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdragsurface.go +6 -14 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdragsurfacesize.go +3 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdrawcontext.go +11 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdrop.go +19 -24 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkenums.go +21 -1 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkevents.go +120 -118 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkframeclock.go +22 -24 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkframetimings.go +17 -20 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkglcontext.go +40 -36 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkgltexture.go +4 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkgltexturebuilder.go +41 -35 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkkeys.go +19 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkmemorytexture.go +2 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkmemorytexturebuilder.go +42 -35 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkmonitor.go +27 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkpaintable.go +63 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkpango.go +4 -12 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkpixbuf.go +2 -12 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkpopup.go +47 -26 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkpopuplayout.go +36 -32 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkrgba.go +19 -21 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkseat.go +11 -20 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdksnapshot.go +7 -0 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdksurface.go +46 -40 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdktexture.go +27 -31 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdktoplevel.go +157 -66 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdktoplevellayout.go +24 -25 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdktoplevelsize.go +9 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdktypes.go +95 -72 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkvulkancontext.go +3 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdkpixbuf/gdk-pixbuf-animation.go +26 -32 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdkpixbuf/gdk-pixbuf-core.go +9 -0 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdkpixbuf/gdk-pixbuf-io.go +25 -23 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdkpixbuf/gdk-pixbuf-loader.go +13 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdkpixbuf/gdk-pixbuf-simple-anim.go +8 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdkpixbuf/gdk-pixbuf-transform.go +11 -1 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdkpixbuf/gdk-pixbuf.go +102 -79 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdkpixbuf/main.go +5 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gaction.go +59 -31 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gactiongroup.go +96 -39 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gactionmap.go +33 -21 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gappinfo.go +244 -116 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gapplication.go +79 -55 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gapplicationcommandline.go +31 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gasyncinitable.go +25 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gasyncresult.go +26 -19 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gbufferedinputstream.go +26 -29 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gbufferedoutputstream.go +11 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gbytesicon.go +4 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gcancellable.go +26 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gcharsetconverter.go +8 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gcontenttype.go +30 -26 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gconverter.go +23 -20 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gconverterinputstream.go +3 -14 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gconverteroutputstream.go +3 -14 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gcredentials.go +12 -21 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdatagrambased.go +45 -30 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdatainputstream.go +31 -35 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdataoutputstream.go +14 -23 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusactiongroup.go +2 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusaddress.go +10 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusauthobserver.go +6 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusconnection.go +77 -66 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbuserror.go +16 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusinterface.go +26 -19 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusinterfaceskeleton.go +25 -24 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusintrospection.go +54 -56 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusmenumodel.go +2 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusmessage.go +88 -64 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusmethodinvocation.go +35 -30 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusnameowning.go +10 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusnamewatching.go +10 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusobject.go +19 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusobjectmanager.go +26 -19 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusobjectmanagerclient.go +16 -23 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusobjectmanagerserver.go +13 -20 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusobjectproxy.go +3 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusobjectskeleton.go +12 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusproxy.go +42 -38 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusserver.go +14 -20 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdbusutils.go +24 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdebugcontroller.go +12 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdebugcontrollerdbus.go +4 -14 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdrive.go +214 -82 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdtlsclientconnection.go +34 -24 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdtlsconnection.go +207 -80 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gdtlsserverconnection.go +2 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gemblem.go +6 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gemblemedicon.go +9 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gfile.go +1148 -450 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gfileattribute.go +13 -19 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gfileenumerator.go +34 -35 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gfileicon.go +3 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gfileinfo.go +138 -84 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gfileinputstream.go +17 -23 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gfileiostream.go +23 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gfilemonitor.go +9 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gfilenamecompleter.go +8 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gfileoutputstream.go +23 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gfilterinputstream.go +6 -14 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gfilteroutputstream.go +6 -14 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gicon.go +32 -25 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/ginetaddress.go +40 -34 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/ginetaddressmask.go +14 -21 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/ginetsocketaddress.go +10 -19 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/ginitable.go +11 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/ginputstream.go +52 -48 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gioenums.go +90 -1 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gioerror.go +6 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/giomodule.go +26 -29 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/gioscheduler.go +4 -12 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/giostream.go +25 -29 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gio/giotypes.go +70 -60
| @@ -5,7 +5,6 @@ import ( | |||
| 5 | 5 | "structs" | |
| 6 | 6 | "unsafe" | |
| 7 | 7 | ||
| 8 | - | "github.com/bnema/purego" | |
| 9 | 8 | "github.com/bnema/puregotk/pkg/core" | |
| 10 | 9 | "github.com/bnema/puregotk/v4/glib" | |
| 11 | 10 | "github.com/bnema/puregotk/v4/gobject" | |
| @@ -110,6 +109,7 @@ type FileAttributeMatcher struct { | |||
| 110 | 109 | var xFileAttributeMatcherGLibType func() types.GType | |
| 111 | 110 | ||
| 112 | 111 | func FileAttributeMatcherGLibType() types.GType { | |
| 112 | + | core.LazyRegister(&xFileAttributeMatcherGLibType, "GIO", "g_file_attribute_matcher_get_type", false) | |
| 113 | 113 | return xFileAttributeMatcherGLibType() | |
| 114 | 114 | } | |
| 115 | 115 | ||
| @@ -147,6 +147,8 @@ var xNewFileAttributeMatcher func(string) uintptr | |||
| 147 | 147 | // - `"standard::type,unix::*"`: matches the type key in the standard | |
| 148 | 148 | // namespace and all keys in the unix namespace. | |
| 149 | 149 | func NewFileAttributeMatcher(AttributesVar string) *FileAttributeMatcher { | |
| 150 | + | core.LazyRegister(&xNewFileAttributeMatcher, "GIO", "g_file_attribute_matcher_new", false) | |
| 151 | + | ||
| 150 | 152 | cret := xNewFileAttributeMatcher(AttributesVar) | |
| 151 | 153 | if cret == 0 { | |
| 152 | 154 | return nil | |
| @@ -163,6 +165,8 @@ var xFileAttributeMatcherEnumerateNamespace func(uintptr, string) bool | |||
| 163 | 165 | // | |
| 164 | 166 | // TODO: this is awkwardly worded. | |
| 165 | 167 | func (x *FileAttributeMatcher) EnumerateNamespace(NsVar string) bool { | |
| 168 | + | core.LazyRegister(&xFileAttributeMatcherEnumerateNamespace, "GIO", "g_file_attribute_matcher_enumerate_namespace", false) | |
| 169 | + | ||
| 166 | 170 | cret := xFileAttributeMatcherEnumerateNamespace(x.GoPointer(), NsVar) | |
| 167 | 171 | return cret | |
| 168 | 172 | } | |
| @@ -171,6 +175,8 @@ var xFileAttributeMatcherEnumerateNext func(uintptr) string | |||
| 171 | 175 | ||
| 172 | 176 | // Gets the next matched attribute from a #GFileAttributeMatcher. | |
| 173 | 177 | func (x *FileAttributeMatcher) EnumerateNext() string { | |
| 178 | + | core.LazyRegister(&xFileAttributeMatcherEnumerateNext, "GIO", "g_file_attribute_matcher_enumerate_next", false) | |
| 179 | + | ||
| 174 | 180 | cret := xFileAttributeMatcherEnumerateNext(x.GoPointer()) | |
| 175 | 181 | return cret | |
| 176 | 182 | } | |
| @@ -181,6 +187,8 @@ var xFileAttributeMatcherMatches func(uintptr, string) bool | |||
| 181 | 187 | // the matcher was created with the "*" matching string, this function | |
| 182 | 188 | // will always return %TRUE. | |
| 183 | 189 | func (x *FileAttributeMatcher) Matches(AttributeVar string) bool { | |
| 190 | + | core.LazyRegister(&xFileAttributeMatcherMatches, "GIO", "g_file_attribute_matcher_matches", false) | |
| 191 | + | ||
| 184 | 192 | cret := xFileAttributeMatcherMatches(x.GoPointer(), AttributeVar) | |
| 185 | 193 | return cret | |
| 186 | 194 | } | |
| @@ -190,6 +198,8 @@ var xFileAttributeMatcherMatchesOnly func(uintptr, string) bool | |||
| 190 | 198 | // Checks if an attribute matcher only matches a given attribute. Always | |
| 191 | 199 | // returns %FALSE if "*" was used when creating the matcher. | |
| 192 | 200 | func (x *FileAttributeMatcher) MatchesOnly(AttributeVar string) bool { | |
| 201 | + | core.LazyRegister(&xFileAttributeMatcherMatchesOnly, "GIO", "g_file_attribute_matcher_matches_only", false) | |
| 202 | + | ||
| 193 | 203 | cret := xFileAttributeMatcherMatchesOnly(x.GoPointer(), AttributeVar) | |
| 194 | 204 | return cret | |
| 195 | 205 | } | |
| @@ -198,6 +208,8 @@ var xFileAttributeMatcherRef func(uintptr) uintptr | |||
| 198 | 208 | ||
| 199 | 209 | // References a file attribute matcher. | |
| 200 | 210 | func (x *FileAttributeMatcher) Ref() *FileAttributeMatcher { | |
| 211 | + | core.LazyRegister(&xFileAttributeMatcherRef, "GIO", "g_file_attribute_matcher_ref", false) | |
| 212 | + | ||
| 201 | 213 | cret := xFileAttributeMatcherRef(x.GoPointer()) | |
| 202 | 214 | if cret == 0 { | |
| 203 | 215 | return nil | |
| @@ -216,6 +228,8 @@ var xFileAttributeMatcherSubtract func(uintptr, *FileAttributeMatcher) uintptr | |||
| 216 | 228 | // is a limitation of the current implementation, but may be fixed | |
| 217 | 229 | // in the future. | |
| 218 | 230 | func (x *FileAttributeMatcher) Subtract(SubtractVar *FileAttributeMatcher) *FileAttributeMatcher { | |
| 231 | + | core.LazyRegister(&xFileAttributeMatcherSubtract, "GIO", "g_file_attribute_matcher_subtract", false) | |
| 232 | + | ||
| 219 | 233 | cret := xFileAttributeMatcherSubtract(x.GoPointer(), SubtractVar) | |
| 220 | 234 | if cret == 0 { | |
| 221 | 235 | return nil | |
| @@ -230,6 +244,8 @@ var xFileAttributeMatcherToString func(uintptr) string | |||
| 230 | 244 | // The output however, might not be identical, as the matcher may | |
| 231 | 245 | // decide to use a different order or omit needless parts. | |
| 232 | 246 | func (x *FileAttributeMatcher) ToString() string { | |
| 247 | + | core.LazyRegister(&xFileAttributeMatcherToString, "GIO", "g_file_attribute_matcher_to_string", false) | |
| 248 | + | ||
| 233 | 249 | cret := xFileAttributeMatcherToString(x.GoPointer()) | |
| 234 | 250 | return cret | |
| 235 | 251 | } | |
| @@ -239,6 +255,8 @@ var xFileAttributeMatcherUnref func(uintptr) | |||
| 239 | 255 | // Unreferences @matcher. If the reference count falls below 1, | |
| 240 | 256 | // the @matcher is automatically freed. | |
| 241 | 257 | func (x *FileAttributeMatcher) Unref() { | |
| 258 | + | core.LazyRegister(&xFileAttributeMatcherUnref, "GIO", "g_file_attribute_matcher_unref", false) | |
| 259 | + | ||
| 242 | 260 | xFileAttributeMatcherUnref(x.GoPointer()) | |
| 243 | 261 | } | |
| 244 | 262 | ||
| @@ -267,6 +285,8 @@ var xIOExtensionGetName func(uintptr) string | |||
| 267 | 285 | // Note that the same type may be registered as extension | |
| 268 | 286 | // for multiple extension points, under different names. | |
| 269 | 287 | func (x *IOExtension) GetName() string { | |
| 288 | + | core.LazyRegister(&xIOExtensionGetName, "GIO", "g_io_extension_get_name", false) | |
| 289 | + | ||
| 270 | 290 | cret := xIOExtensionGetName(x.GoPointer()) | |
| 271 | 291 | return cret | |
| 272 | 292 | } | |
| @@ -275,6 +295,8 @@ var xIOExtensionGetPriority func(uintptr) int | |||
| 275 | 295 | ||
| 276 | 296 | // Gets the priority with which @extension was registered. | |
| 277 | 297 | func (x *IOExtension) GetPriority() int { | |
| 298 | + | core.LazyRegister(&xIOExtensionGetPriority, "GIO", "g_io_extension_get_priority", false) | |
| 299 | + | ||
| 278 | 300 | cret := xIOExtensionGetPriority(x.GoPointer()) | |
| 279 | 301 | return cret | |
| 280 | 302 | } | |
| @@ -283,6 +305,8 @@ var xIOExtensionGetType func(uintptr) types.GType | |||
| 283 | 305 | ||
| 284 | 306 | // Gets the type associated with @extension. | |
| 285 | 307 | func (x *IOExtension) GetType() types.GType { | |
| 308 | + | core.LazyRegister(&xIOExtensionGetType, "GIO", "g_io_extension_get_type", false) | |
| 309 | + | ||
| 286 | 310 | cret := xIOExtensionGetType(x.GoPointer()) | |
| 287 | 311 | return cret | |
| 288 | 312 | } | |
| @@ -292,6 +316,8 @@ var xIOExtensionRefClass func(uintptr) uintptr | |||
| 292 | 316 | // Gets a reference to the class for the type that is | |
| 293 | 317 | // associated with @extension. | |
| 294 | 318 | func (x *IOExtension) RefClass() *gobject.TypeClass { | |
| 319 | + | core.LazyRegister(&xIOExtensionRefClass, "GIO", "g_io_extension_ref_class", false) | |
| 320 | + | ||
| 295 | 321 | cret := xIOExtensionRefClass(x.GoPointer()) | |
| 296 | 322 | if cret == 0 { | |
| 297 | 323 | return nil | |
| @@ -372,6 +398,8 @@ var xIOExtensionPointGetExtensionByName func(uintptr, string) uintptr | |||
| 372 | 398 | ||
| 373 | 399 | // Finds a #GIOExtension for an extension point by name. | |
| 374 | 400 | func (x *IOExtensionPoint) GetExtensionByName(NameVar string) *IOExtension { | |
| 401 | + | core.LazyRegister(&xIOExtensionPointGetExtensionByName, "GIO", "g_io_extension_point_get_extension_by_name", false) | |
| 402 | + | ||
| 375 | 403 | cret := xIOExtensionPointGetExtensionByName(x.GoPointer(), NameVar) | |
| 376 | 404 | if cret == 0 { | |
| 377 | 405 | return nil | |
| @@ -384,6 +412,8 @@ var xIOExtensionPointGetExtensions func(uintptr) uintptr | |||
| 384 | 412 | // Gets a list of all extensions that implement this extension point. | |
| 385 | 413 | // The list is sorted by priority, beginning with the highest priority. | |
| 386 | 414 | func (x *IOExtensionPoint) GetExtensions() *glib.List { | |
| 415 | + | core.LazyRegister(&xIOExtensionPointGetExtensions, "GIO", "g_io_extension_point_get_extensions", false) | |
| 416 | + | ||
| 387 | 417 | cret := xIOExtensionPointGetExtensions(x.GoPointer()) | |
| 388 | 418 | if cret == 0 { | |
| 389 | 419 | return nil | |
| @@ -395,6 +425,8 @@ var xIOExtensionPointGetRequiredType func(uintptr) types.GType | |||
| 395 | 425 | ||
| 396 | 426 | // Gets the required type for @extension_point. | |
| 397 | 427 | func (x *IOExtensionPoint) GetRequiredType() types.GType { | |
| 428 | + | core.LazyRegister(&xIOExtensionPointGetRequiredType, "GIO", "g_io_extension_point_get_required_type", false) | |
| 429 | + | ||
| 398 | 430 | cret := xIOExtensionPointGetRequiredType(x.GoPointer()) | |
| 399 | 431 | return cret | |
| 400 | 432 | } | |
| @@ -404,6 +436,8 @@ var xIOExtensionPointSetRequiredType func(uintptr, types.GType) | |||
| 404 | 436 | // Sets the required type for @extension_point to @type. | |
| 405 | 437 | // All implementations must henceforth have this type. | |
| 406 | 438 | func (x *IOExtensionPoint) SetRequiredType(TypeVar types.GType) { | |
| 439 | + | core.LazyRegister(&xIOExtensionPointSetRequiredType, "GIO", "g_io_extension_point_set_required_type", false) | |
| 440 | + | ||
| 407 | 441 | xIOExtensionPointSetRequiredType(x.GoPointer(), TypeVar) | |
| 408 | 442 | } | |
| 409 | 443 | ||
| @@ -430,6 +464,8 @@ var xIOSchedulerJobSendToMainloop func(uintptr, uintptr, uintptr, uintptr) bool | |||
| 430 | 464 | // that the job was started from, waiting for the result (and thus | |
| 431 | 465 | // blocking the I/O job). | |
| 432 | 466 | func (x *IOSchedulerJob) SendToMainloop(FuncVar *glib.SourceFunc, UserDataVar uintptr, NotifyVar *glib.DestroyNotify) bool { | |
| 467 | + | core.LazyRegister(&xIOSchedulerJobSendToMainloop, "GIO", "g_io_scheduler_job_send_to_mainloop", false) | |
| 468 | + | ||
| 433 | 469 | cret := xIOSchedulerJobSendToMainloop(x.GoPointer(), glib.NewCallback(FuncVar), UserDataVar, glib.NewCallbackNullable(NotifyVar)) | |
| 434 | 470 | return cret | |
| 435 | 471 | } | |
| @@ -446,6 +482,8 @@ var xIOSchedulerJobSendToMainloopAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 446 | 482 | // @func is called, either by passing %NULL as @notify to | |
| 447 | 483 | // g_io_scheduler_push_job() or by using refcounting for @user_data. | |
| 448 | 484 | func (x *IOSchedulerJob) SendToMainloopAsync(FuncVar *glib.SourceFunc, UserDataVar uintptr, NotifyVar *glib.DestroyNotify) { | |
| 485 | + | core.LazyRegister(&xIOSchedulerJobSendToMainloopAsync, "GIO", "g_io_scheduler_job_send_to_mainloop_async", false) | |
| 486 | + | ||
| 449 | 487 | xIOSchedulerJobSendToMainloopAsync(x.GoPointer(), glib.NewCallback(FuncVar), UserDataVar, glib.NewCallbackNullable(NotifyVar)) | |
| 450 | 488 | } | |
| 451 | 489 | ||
| @@ -767,6 +805,7 @@ type Resource struct { | |||
| 767 | 805 | var xResourceGLibType func() types.GType | |
| 768 | 806 | ||
| 769 | 807 | func ResourceGLibType() types.GType { | |
| 808 | + | core.LazyRegister(&xResourceGLibType, "GIO", "g_resource_get_type", false) | |
| 770 | 809 | return xResourceGLibType() | |
| 771 | 810 | } | |
| 772 | 811 | ||
| @@ -798,6 +837,7 @@ var xNewResourceFromData func(*glib.Bytes, **glib.Error) uintptr | |||
| 798 | 837 | // | |
| 799 | 838 | // If @data is empty or corrupt, %G_RESOURCE_ERROR_INTERNAL will be returned. | |
| 800 | 839 | func NewResourceFromData(DataVar *glib.Bytes) (*Resource, error) { | |
| 840 | + | core.LazyRegister(&xNewResourceFromData, "GIO", "g_resource_new_from_data", false) | |
| 801 | 841 | var cerr *glib.Error | |
| 802 | 842 | ||
| 803 | 843 | cret := xNewResourceFromData(DataVar, &cerr) | |
| @@ -818,6 +858,8 @@ var xResourceRegister func(uintptr) | |||
| 818 | 858 | // with the global resource lookup functions like | |
| 819 | 859 | // [func@Gio.resources_lookup_data]. | |
| 820 | 860 | func (x *Resource) Register() { | |
| 861 | + | core.LazyRegister(&xResourceRegister, "GIO", "g_resources_register", false) | |
| 862 | + | ||
| 821 | 863 | xResourceRegister(x.GoPointer()) | |
| 822 | 864 | } | |
| 823 | 865 | ||
| @@ -825,6 +867,8 @@ var xResourceUnregister func(uintptr) | |||
| 825 | 867 | ||
| 826 | 868 | // Unregisters the resource from the process-global set of resources. | |
| 827 | 869 | func (x *Resource) Unregister() { | |
| 870 | + | core.LazyRegister(&xResourceUnregister, "GIO", "g_resources_unregister", false) | |
| 871 | + | ||
| 828 | 872 | xResourceUnregister(x.GoPointer()) | |
| 829 | 873 | } | |
| 830 | 874 | ||
| @@ -840,6 +884,7 @@ var xResourceEnumerateChildren func(uintptr, string, ResourceLookupFlags, **glib | |||
| 840 | 884 | // | |
| 841 | 885 | // @lookup_flags controls the behaviour of the lookup. | |
| 842 | 886 | func (x *Resource) EnumerateChildren(PathVar string, LookupFlagsVar ResourceLookupFlags) ([]string, error) { | |
| 887 | + | core.LazyRegister(&xResourceEnumerateChildren, "GIO", "g_resource_enumerate_children", false) | |
| 843 | 888 | var cerr *glib.Error | |
| 844 | 889 | ||
| 845 | 890 | cret := xResourceEnumerateChildren(x.GoPointer(), PathVar, LookupFlagsVar, &cerr) | |
| @@ -859,6 +904,7 @@ var xResourceGetInfo func(uintptr, string, ResourceLookupFlags, *uint, *uint32, | |||
| 859 | 904 | // The only error this can return is %G_RESOURCE_ERROR_NOT_FOUND, if @path was | |
| 860 | 905 | // not found in @resource. | |
| 861 | 906 | func (x *Resource) GetInfo(PathVar string, LookupFlagsVar ResourceLookupFlags, SizeVar *uint, FlagsVar *uint32) (bool, error) { | |
| 907 | + | core.LazyRegister(&xResourceGetInfo, "GIO", "g_resource_get_info", false) | |
| 862 | 908 | var cerr *glib.Error | |
| 863 | 909 | ||
| 864 | 910 | cret := xResourceGetInfo(x.GoPointer(), PathVar, LookupFlagsVar, SizeVar, FlagsVar, &cerr) | |
| @@ -873,6 +919,8 @@ var xResourceHasChildren func(uintptr, string) bool | |||
| 873 | 919 | // Returns whether the specified @path in the resource | |
| 874 | 920 | // has children. | |
| 875 | 921 | func (x *Resource) HasChildren(PathVar string) bool { | |
| 922 | + | core.LazyRegister(&xResourceHasChildren, "GIO", "g_resource_has_children", false) | |
| 923 | + | ||
| 876 | 924 | cret := xResourceHasChildren(x.GoPointer(), PathVar) | |
| 877 | 925 | return cret | |
| 878 | 926 | } | |
| @@ -898,6 +946,7 @@ var xResourceLookupData func(uintptr, string, ResourceLookupFlags, **glib.Error) | |||
| 898 | 946 | // @resource, or %G_RESOURCE_ERROR_INTERNAL if decompression of a compressed | |
| 899 | 947 | // resource failed. | |
| 900 | 948 | func (x *Resource) LookupData(PathVar string, LookupFlagsVar ResourceLookupFlags) (*glib.Bytes, error) { | |
| 949 | + | core.LazyRegister(&xResourceLookupData, "GIO", "g_resource_lookup_data", false) | |
| 901 | 950 | var cerr *glib.Error | |
| 902 | 951 | ||
| 903 | 952 | cret := xResourceLookupData(x.GoPointer(), PathVar, LookupFlagsVar, &cerr) | |
| @@ -920,6 +969,7 @@ var xResourceOpenStream func(uintptr, string, ResourceLookupFlags, **glib.Error) | |||
| 920 | 969 | // The only error this can return is %G_RESOURCE_ERROR_NOT_FOUND, if @path was | |
| 921 | 970 | // not found in @resource. | |
| 922 | 971 | func (x *Resource) OpenStream(PathVar string, LookupFlagsVar ResourceLookupFlags) (*InputStream, error) { | |
| 972 | + | core.LazyRegister(&xResourceOpenStream, "GIO", "g_resource_open_stream", false) | |
| 923 | 973 | var cls *InputStream | |
| 924 | 974 | var cerr *glib.Error | |
| 925 | 975 | ||
| @@ -942,6 +992,8 @@ var xResourceRef func(uintptr) uintptr | |||
| 942 | 992 | // | |
| 943 | 993 | // This function is threadsafe and may be called from any thread. | |
| 944 | 994 | func (x *Resource) Ref() *Resource { | |
| 995 | + | core.LazyRegister(&xResourceRef, "GIO", "g_resource_ref", false) | |
| 996 | + | ||
| 945 | 997 | cret := xResourceRef(x.GoPointer()) | |
| 946 | 998 | if cret == 0 { | |
| 947 | 999 | return nil | |
| @@ -957,6 +1009,8 @@ var xResourceUnref func(uintptr) | |||
| 957 | 1009 | // released. This function is threadsafe and may be called from any | |
| 958 | 1010 | // thread. | |
| 959 | 1011 | func (x *Resource) Unref() { | |
| 1012 | + | core.LazyRegister(&xResourceUnref, "GIO", "g_resource_unref", false) | |
| 1013 | + | ||
| 960 | 1014 | xResourceUnref(x.GoPointer()) | |
| 961 | 1015 | } | |
| 962 | 1016 | ||
| @@ -983,6 +1037,7 @@ type SrvTarget struct { | |||
| 983 | 1037 | var xSrvTargetGLibType func() types.GType | |
| 984 | 1038 | ||
| 985 | 1039 | func SrvTargetGLibType() types.GType { | |
| 1040 | + | core.LazyRegister(&xSrvTargetGLibType, "GIO", "g_srv_target_get_type", false) | |
| 986 | 1041 | return xSrvTargetGLibType() | |
| 987 | 1042 | } | |
| 988 | 1043 | ||
| @@ -1005,6 +1060,8 @@ var xNewSrvTarget func(string, uint16, uint16, uint16) uintptr | |||
| 1005 | 1060 | // You should not need to use this; normally #GSrvTargets are | |
| 1006 | 1061 | // created by #GResolver. | |
| 1007 | 1062 | func NewSrvTarget(HostnameVar string, PortVar uint16, PriorityVar uint16, WeightVar uint16) *SrvTarget { | |
| 1063 | + | core.LazyRegister(&xNewSrvTarget, "GIO", "g_srv_target_new", false) | |
| 1064 | + | ||
| 1008 | 1065 | cret := xNewSrvTarget(HostnameVar, PortVar, PriorityVar, WeightVar) | |
| 1009 | 1066 | if cret == 0 { | |
| 1010 | 1067 | return nil | |
| @@ -1016,6 +1073,8 @@ var xSrvTargetCopy func(uintptr) uintptr | |||
| 1016 | 1073 | ||
| 1017 | 1074 | // Copies @target | |
| 1018 | 1075 | func (x *SrvTarget) Copy() *SrvTarget { | |
| 1076 | + | core.LazyRegister(&xSrvTargetCopy, "GIO", "g_srv_target_copy", false) | |
| 1077 | + | ||
| 1019 | 1078 | cret := xSrvTargetCopy(x.GoPointer()) | |
| 1020 | 1079 | if cret == 0 { | |
| 1021 | 1080 | return nil | |
| @@ -1027,6 +1086,8 @@ var xSrvTargetFree func(uintptr) | |||
| 1027 | 1086 | ||
| 1028 | 1087 | // Frees @target | |
| 1029 | 1088 | func (x *SrvTarget) Free() { | |
| 1089 | + | core.LazyRegister(&xSrvTargetFree, "GIO", "g_srv_target_free", false) | |
| 1090 | + | ||
| 1030 | 1091 | xSrvTargetFree(x.GoPointer()) | |
| 1031 | 1092 | } | |
| 1032 | 1093 | ||
| @@ -1037,6 +1098,8 @@ var xSrvTargetGetHostname func(uintptr) string | |||
| 1037 | 1098 | // check if it contains encoded Unicode segments, and use | |
| 1038 | 1099 | // g_hostname_to_unicode() to convert it if it does.) | |
| 1039 | 1100 | func (x *SrvTarget) GetHostname() string { | |
| 1101 | + | core.LazyRegister(&xSrvTargetGetHostname, "GIO", "g_srv_target_get_hostname", false) | |
| 1102 | + | ||
| 1040 | 1103 | cret := xSrvTargetGetHostname(x.GoPointer()) | |
| 1041 | 1104 | return cret | |
| 1042 | 1105 | } | |
| @@ -1045,6 +1108,8 @@ var xSrvTargetGetPort func(uintptr) uint16 | |||
| 1045 | 1108 | ||
| 1046 | 1109 | // Gets @target's port | |
| 1047 | 1110 | func (x *SrvTarget) GetPort() uint16 { | |
| 1111 | + | core.LazyRegister(&xSrvTargetGetPort, "GIO", "g_srv_target_get_port", false) | |
| 1112 | + | ||
| 1048 | 1113 | cret := xSrvTargetGetPort(x.GoPointer()) | |
| 1049 | 1114 | return cret | |
| 1050 | 1115 | } | |
| @@ -1055,6 +1120,8 @@ var xSrvTargetGetPriority func(uintptr) uint16 | |||
| 1055 | 1120 | // #GResolver already sorts the targets according to the algorithm in | |
| 1056 | 1121 | // RFC 2782. | |
| 1057 | 1122 | func (x *SrvTarget) GetPriority() uint16 { | |
| 1123 | + | core.LazyRegister(&xSrvTargetGetPriority, "GIO", "g_srv_target_get_priority", false) | |
| 1124 | + | ||
| 1058 | 1125 | cret := xSrvTargetGetPriority(x.GoPointer()) | |
| 1059 | 1126 | return cret | |
| 1060 | 1127 | } | |
| @@ -1065,6 +1132,8 @@ var xSrvTargetGetWeight func(uintptr) uint16 | |||
| 1065 | 1132 | // #GResolver already sorts the targets according to the algorithm in | |
| 1066 | 1133 | // RFC 2782. | |
| 1067 | 1134 | func (x *SrvTarget) GetWeight() uint16 { | |
| 1135 | + | core.LazyRegister(&xSrvTargetGetWeight, "GIO", "g_srv_target_get_weight", false) | |
| 1136 | + | ||
| 1068 | 1137 | cret := xSrvTargetGetWeight(x.GoPointer()) | |
| 1069 | 1138 | return cret | |
| 1070 | 1139 | } | |
| @@ -1072,63 +1141,4 @@ func (x *SrvTarget) GetWeight() uint16 { | |||
| 1072 | 1141 | func init() { | |
| 1073 | 1142 | core.SetPackageName("GIO", "gio-2.0") | |
| 1074 | 1143 | core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0", "libgio-2.0.0.dylib"}) | |
| 1075 | - | var libs []uintptr | |
| 1076 | - | for _, libPath := range core.GetPaths("GIO") { | |
| 1077 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 1078 | - | if err != nil { | |
| 1079 | - | panic(err) | |
| 1080 | - | } | |
| 1081 | - | libs = append(libs, lib) | |
| 1082 | - | } | |
| 1083 | - | ||
| 1084 | - | core.PuregoSafeRegister(&xFileAttributeMatcherGLibType, libs, "g_file_attribute_matcher_get_type") | |
| 1085 | - | ||
| 1086 | - | core.PuregoSafeRegister(&xNewFileAttributeMatcher, libs, "g_file_attribute_matcher_new") | |
| 1087 | - | ||
| 1088 | - | core.PuregoSafeRegister(&xFileAttributeMatcherEnumerateNamespace, libs, "g_file_attribute_matcher_enumerate_namespace") | |
| 1089 | - | core.PuregoSafeRegister(&xFileAttributeMatcherEnumerateNext, libs, "g_file_attribute_matcher_enumerate_next") | |
| 1090 | - | core.PuregoSafeRegister(&xFileAttributeMatcherMatches, libs, "g_file_attribute_matcher_matches") | |
| 1091 | - | core.PuregoSafeRegister(&xFileAttributeMatcherMatchesOnly, libs, "g_file_attribute_matcher_matches_only") | |
| 1092 | - | core.PuregoSafeRegister(&xFileAttributeMatcherRef, libs, "g_file_attribute_matcher_ref") | |
| 1093 | - | core.PuregoSafeRegister(&xFileAttributeMatcherSubtract, libs, "g_file_attribute_matcher_subtract") | |
| 1094 | - | core.PuregoSafeRegister(&xFileAttributeMatcherToString, libs, "g_file_attribute_matcher_to_string") | |
| 1095 | - | core.PuregoSafeRegister(&xFileAttributeMatcherUnref, libs, "g_file_attribute_matcher_unref") | |
| 1096 | - | ||
| 1097 | - | core.PuregoSafeRegister(&xIOExtensionGetName, libs, "g_io_extension_get_name") | |
| 1098 | - | core.PuregoSafeRegister(&xIOExtensionGetPriority, libs, "g_io_extension_get_priority") | |
| 1099 | - | core.PuregoSafeRegister(&xIOExtensionGetType, libs, "g_io_extension_get_type") | |
| 1100 | - | core.PuregoSafeRegister(&xIOExtensionRefClass, libs, "g_io_extension_ref_class") | |
| 1101 | - | ||
| 1102 | - | core.PuregoSafeRegister(&xIOExtensionPointGetExtensionByName, libs, "g_io_extension_point_get_extension_by_name") | |
| 1103 | - | core.PuregoSafeRegister(&xIOExtensionPointGetExtensions, libs, "g_io_extension_point_get_extensions") | |
| 1104 | - | core.PuregoSafeRegister(&xIOExtensionPointGetRequiredType, libs, "g_io_extension_point_get_required_type") | |
| 1105 | - | core.PuregoSafeRegister(&xIOExtensionPointSetRequiredType, libs, "g_io_extension_point_set_required_type") | |
| 1106 | - | ||
| 1107 | - | core.PuregoSafeRegister(&xIOSchedulerJobSendToMainloop, libs, "g_io_scheduler_job_send_to_mainloop") | |
| 1108 | - | core.PuregoSafeRegister(&xIOSchedulerJobSendToMainloopAsync, libs, "g_io_scheduler_job_send_to_mainloop_async") | |
| 1109 | - | ||
| 1110 | - | core.PuregoSafeRegister(&xResourceGLibType, libs, "g_resource_get_type") | |
| 1111 | - | ||
| 1112 | - | core.PuregoSafeRegister(&xNewResourceFromData, libs, "g_resource_new_from_data") | |
| 1113 | - | ||
| 1114 | - | core.PuregoSafeRegister(&xResourceRegister, libs, "g_resources_register") | |
| 1115 | - | core.PuregoSafeRegister(&xResourceUnregister, libs, "g_resources_unregister") | |
| 1116 | - | core.PuregoSafeRegister(&xResourceEnumerateChildren, libs, "g_resource_enumerate_children") | |
| 1117 | - | core.PuregoSafeRegister(&xResourceGetInfo, libs, "g_resource_get_info") | |
| 1118 | - | core.PuregoSafeRegister(&xResourceHasChildren, libs, "g_resource_has_children") | |
| 1119 | - | core.PuregoSafeRegister(&xResourceLookupData, libs, "g_resource_lookup_data") | |
| 1120 | - | core.PuregoSafeRegister(&xResourceOpenStream, libs, "g_resource_open_stream") | |
| 1121 | - | core.PuregoSafeRegister(&xResourceRef, libs, "g_resource_ref") | |
| 1122 | - | core.PuregoSafeRegister(&xResourceUnref, libs, "g_resource_unref") | |
| 1123 | - | ||
| 1124 | - | core.PuregoSafeRegister(&xSrvTargetGLibType, libs, "g_srv_target_get_type") | |
| 1125 | - | ||
| 1126 | - | core.PuregoSafeRegister(&xNewSrvTarget, libs, "g_srv_target_new") | |
| 1127 | - | ||
| 1128 | - | core.PuregoSafeRegister(&xSrvTargetCopy, libs, "g_srv_target_copy") | |
| 1129 | - | core.PuregoSafeRegister(&xSrvTargetFree, libs, "g_srv_target_free") | |
| 1130 | - | core.PuregoSafeRegister(&xSrvTargetGetHostname, libs, "g_srv_target_get_hostname") | |
| 1131 | - | core.PuregoSafeRegister(&xSrvTargetGetPort, libs, "g_srv_target_get_port") | |
| 1132 | - | core.PuregoSafeRegister(&xSrvTargetGetPriority, libs, "g_srv_target_get_priority") | |
| 1133 | - | core.PuregoSafeRegister(&xSrvTargetGetWeight, libs, "g_srv_target_get_weight") | |
| 1134 | 1144 | } | |
| @@ -5,7 +5,6 @@ import ( | |||||
| 5 | "structs" | 5 | "structs" | ||
| 6 | "unsafe" | 6 | "unsafe" | ||
| 7 | 7 | ||||
| 8 | - | "github.com/bnema/purego" | |||
| 9 | "github.com/bnema/puregotk/pkg/core" | 8 | "github.com/bnema/puregotk/pkg/core" | ||
| 10 | "github.com/bnema/puregotk/v4/glib" | 9 | "github.com/bnema/puregotk/v4/glib" | ||
| 11 | "github.com/bnema/puregotk/v4/gobject" | 10 | "github.com/bnema/puregotk/v4/gobject" | ||
| @@ -110,6 +109,7 @@ type FileAttributeMatcher struct { | |||||
| 110 | var xFileAttributeMatcherGLibType func() types.GType | 109 | var xFileAttributeMatcherGLibType func() types.GType | ||
| 111 | 110 | ||||
| 112 | func FileAttributeMatcherGLibType() types.GType { | 111 | func FileAttributeMatcherGLibType() types.GType { | ||
| 112 | + | core.LazyRegister(&xFileAttributeMatcherGLibType, "GIO", "g_file_attribute_matcher_get_type", false) | |||
| 113 | return xFileAttributeMatcherGLibType() | 113 | return xFileAttributeMatcherGLibType() | ||
| 114 | } | 114 | } | ||
| 115 | 115 | ||||
| @@ -147,6 +147,8 @@ var xNewFileAttributeMatcher func(string) uintptr | |||||
| 147 | // - `"standard::type,unix::*"`: matches the type key in the standard | 147 | // - `"standard::type,unix::*"`: matches the type key in the standard | ||
| 148 | // namespace and all keys in the unix namespace. | 148 | // namespace and all keys in the unix namespace. | ||
| 149 | func NewFileAttributeMatcher(AttributesVar string) *FileAttributeMatcher { | 149 | func NewFileAttributeMatcher(AttributesVar string) *FileAttributeMatcher { | ||
| 150 | + | core.LazyRegister(&xNewFileAttributeMatcher, "GIO", "g_file_attribute_matcher_new", false) | |||
| 151 | + | ||||
| 150 | cret := xNewFileAttributeMatcher(AttributesVar) | 152 | cret := xNewFileAttributeMatcher(AttributesVar) | ||
| 151 | if cret == 0 { | 153 | if cret == 0 { | ||
| 152 | return nil | 154 | return nil | ||
| @@ -163,6 +165,8 @@ var xFileAttributeMatcherEnumerateNamespace func(uintptr, string) bool | |||||
| 163 | // | 165 | // | ||
| 164 | // TODO: this is awkwardly worded. | 166 | // TODO: this is awkwardly worded. | ||
| 165 | func (x *FileAttributeMatcher) EnumerateNamespace(NsVar string) bool { | 167 | func (x *FileAttributeMatcher) EnumerateNamespace(NsVar string) bool { | ||
| 168 | + | core.LazyRegister(&xFileAttributeMatcherEnumerateNamespace, "GIO", "g_file_attribute_matcher_enumerate_namespace", false) | |||
| 169 | + | ||||
| 166 | cret := xFileAttributeMatcherEnumerateNamespace(x.GoPointer(), NsVar) | 170 | cret := xFileAttributeMatcherEnumerateNamespace(x.GoPointer(), NsVar) | ||
| 167 | return cret | 171 | return cret | ||
| 168 | } | 172 | } | ||
| @@ -171,6 +175,8 @@ var xFileAttributeMatcherEnumerateNext func(uintptr) string | |||||
| 171 | 175 | ||||
| 172 | // Gets the next matched attribute from a #GFileAttributeMatcher. | 176 | // Gets the next matched attribute from a #GFileAttributeMatcher. | ||
| 173 | func (x *FileAttributeMatcher) EnumerateNext() string { | 177 | func (x *FileAttributeMatcher) EnumerateNext() string { | ||
| 178 | + | core.LazyRegister(&xFileAttributeMatcherEnumerateNext, "GIO", "g_file_attribute_matcher_enumerate_next", false) | |||
| 179 | + | ||||
| 174 | cret := xFileAttributeMatcherEnumerateNext(x.GoPointer()) | 180 | cret := xFileAttributeMatcherEnumerateNext(x.GoPointer()) | ||
| 175 | return cret | 181 | return cret | ||
| 176 | } | 182 | } | ||
| @@ -181,6 +187,8 @@ var xFileAttributeMatcherMatches func(uintptr, string) bool | |||||
| 181 | // the matcher was created with the "*" matching string, this function | 187 | // the matcher was created with the "*" matching string, this function | ||
| 182 | // will always return %TRUE. | 188 | // will always return %TRUE. | ||
| 183 | func (x *FileAttributeMatcher) Matches(AttributeVar string) bool { | 189 | func (x *FileAttributeMatcher) Matches(AttributeVar string) bool { | ||
| 190 | + | core.LazyRegister(&xFileAttributeMatcherMatches, "GIO", "g_file_attribute_matcher_matches", false) | |||
| 191 | + | ||||
| 184 | cret := xFileAttributeMatcherMatches(x.GoPointer(), AttributeVar) | 192 | cret := xFileAttributeMatcherMatches(x.GoPointer(), AttributeVar) | ||
| 185 | return cret | 193 | return cret | ||
| 186 | } | 194 | } | ||
| @@ -190,6 +198,8 @@ var xFileAttributeMatcherMatchesOnly func(uintptr, string) bool | |||||
| 190 | // Checks if an attribute matcher only matches a given attribute. Always | 198 | // Checks if an attribute matcher only matches a given attribute. Always | ||
| 191 | // returns %FALSE if "*" was used when creating the matcher. | 199 | // returns %FALSE if "*" was used when creating the matcher. | ||
| 192 | func (x *FileAttributeMatcher) MatchesOnly(AttributeVar string) bool { | 200 | func (x *FileAttributeMatcher) MatchesOnly(AttributeVar string) bool { | ||
| 201 | + | core.LazyRegister(&xFileAttributeMatcherMatchesOnly, "GIO", "g_file_attribute_matcher_matches_only", false) | |||
| 202 | + | ||||
| 193 | cret := xFileAttributeMatcherMatchesOnly(x.GoPointer(), AttributeVar) | 203 | cret := xFileAttributeMatcherMatchesOnly(x.GoPointer(), AttributeVar) | ||
| 194 | return cret | 204 | return cret | ||
| 195 | } | 205 | } | ||
| @@ -198,6 +208,8 @@ var xFileAttributeMatcherRef func(uintptr) uintptr | |||||
| 198 | 208 | ||||
| 199 | // References a file attribute matcher. | 209 | // References a file attribute matcher. | ||
| 200 | func (x *FileAttributeMatcher) Ref() *FileAttributeMatcher { | 210 | func (x *FileAttributeMatcher) Ref() *FileAttributeMatcher { | ||
| 211 | + | core.LazyRegister(&xFileAttributeMatcherRef, "GIO", "g_file_attribute_matcher_ref", false) | |||
| 212 | + | ||||
| 201 | cret := xFileAttributeMatcherRef(x.GoPointer()) | 213 | cret := xFileAttributeMatcherRef(x.GoPointer()) | ||
| 202 | if cret == 0 { | 214 | if cret == 0 { | ||
| 203 | return nil | 215 | return nil | ||
| @@ -216,6 +228,8 @@ var xFileAttributeMatcherSubtract func(uintptr, *FileAttributeMatcher) uintptr | |||||
| 216 | // is a limitation of the current implementation, but may be fixed | 228 | // is a limitation of the current implementation, but may be fixed | ||
| 217 | // in the future. | 229 | // in the future. | ||
| 218 | func (x *FileAttributeMatcher) Subtract(SubtractVar *FileAttributeMatcher) *FileAttributeMatcher { | 230 | func (x *FileAttributeMatcher) Subtract(SubtractVar *FileAttributeMatcher) *FileAttributeMatcher { | ||
| 231 | + | core.LazyRegister(&xFileAttributeMatcherSubtract, "GIO", "g_file_attribute_matcher_subtract", false) | |||
| 232 | + | ||||
| 219 | cret := xFileAttributeMatcherSubtract(x.GoPointer(), SubtractVar) | 233 | cret := xFileAttributeMatcherSubtract(x.GoPointer(), SubtractVar) | ||
| 220 | if cret == 0 { | 234 | if cret == 0 { | ||
| 221 | return nil | 235 | return nil | ||
| @@ -230,6 +244,8 @@ var xFileAttributeMatcherToString func(uintptr) string | |||||
| 230 | // The output however, might not be identical, as the matcher may | 244 | // The output however, might not be identical, as the matcher may | ||
| 231 | // decide to use a different order or omit needless parts. | 245 | // decide to use a different order or omit needless parts. | ||
| 232 | func (x *FileAttributeMatcher) ToString() string { | 246 | func (x *FileAttributeMatcher) ToString() string { | ||
| 247 | + | core.LazyRegister(&xFileAttributeMatcherToString, "GIO", "g_file_attribute_matcher_to_string", false) | |||
| 248 | + | ||||
| 233 | cret := xFileAttributeMatcherToString(x.GoPointer()) | 249 | cret := xFileAttributeMatcherToString(x.GoPointer()) | ||
| 234 | return cret | 250 | return cret | ||
| 235 | } | 251 | } | ||
| @@ -239,6 +255,8 @@ var xFileAttributeMatcherUnref func(uintptr) | |||||
| 239 | // Unreferences @matcher. If the reference count falls below 1, | 255 | // Unreferences @matcher. If the reference count falls below 1, | ||
| 240 | // the @matcher is automatically freed. | 256 | // the @matcher is automatically freed. | ||
| 241 | func (x *FileAttributeMatcher) Unref() { | 257 | func (x *FileAttributeMatcher) Unref() { | ||
| 258 | + | core.LazyRegister(&xFileAttributeMatcherUnref, "GIO", "g_file_attribute_matcher_unref", false) | |||
| 259 | + | ||||
| 242 | xFileAttributeMatcherUnref(x.GoPointer()) | 260 | xFileAttributeMatcherUnref(x.GoPointer()) | ||
| 243 | } | 261 | } | ||
| 244 | 262 | ||||
| @@ -267,6 +285,8 @@ var xIOExtensionGetName func(uintptr) string | |||||
| 267 | // Note that the same type may be registered as extension | 285 | // Note that the same type may be registered as extension | ||
| 268 | // for multiple extension points, under different names. | 286 | // for multiple extension points, under different names. | ||
| 269 | func (x *IOExtension) GetName() string { | 287 | func (x *IOExtension) GetName() string { | ||
| 288 | + | core.LazyRegister(&xIOExtensionGetName, "GIO", "g_io_extension_get_name", false) | |||
| 289 | + | ||||
| 270 | cret := xIOExtensionGetName(x.GoPointer()) | 290 | cret := xIOExtensionGetName(x.GoPointer()) | ||
| 271 | return cret | 291 | return cret | ||
| 272 | } | 292 | } | ||
| @@ -275,6 +295,8 @@ var xIOExtensionGetPriority func(uintptr) int | |||||
| 275 | 295 | ||||
| 276 | // Gets the priority with which @extension was registered. | 296 | // Gets the priority with which @extension was registered. | ||
| 277 | func (x *IOExtension) GetPriority() int { | 297 | func (x *IOExtension) GetPriority() int { | ||
| 298 | + | core.LazyRegister(&xIOExtensionGetPriority, "GIO", "g_io_extension_get_priority", false) | |||
| 299 | + | ||||
| 278 | cret := xIOExtensionGetPriority(x.GoPointer()) | 300 | cret := xIOExtensionGetPriority(x.GoPointer()) | ||
| 279 | return cret | 301 | return cret | ||
| 280 | } | 302 | } | ||
| @@ -283,6 +305,8 @@ var xIOExtensionGetType func(uintptr) types.GType | |||||
| 283 | 305 | ||||
| 284 | // Gets the type associated with @extension. | 306 | // Gets the type associated with @extension. | ||
| 285 | func (x *IOExtension) GetType() types.GType { | 307 | func (x *IOExtension) GetType() types.GType { | ||
| 308 | + | core.LazyRegister(&xIOExtensionGetType, "GIO", "g_io_extension_get_type", false) | |||
| 309 | + | ||||
| 286 | cret := xIOExtensionGetType(x.GoPointer()) | 310 | cret := xIOExtensionGetType(x.GoPointer()) | ||
| 287 | return cret | 311 | return cret | ||
| 288 | } | 312 | } | ||
| @@ -292,6 +316,8 @@ var xIOExtensionRefClass func(uintptr) uintptr | |||||
| 292 | // Gets a reference to the class for the type that is | 316 | // Gets a reference to the class for the type that is | ||
| 293 | // associated with @extension. | 317 | // associated with @extension. | ||
| 294 | func (x *IOExtension) RefClass() *gobject.TypeClass { | 318 | func (x *IOExtension) RefClass() *gobject.TypeClass { | ||
| 319 | + | core.LazyRegister(&xIOExtensionRefClass, "GIO", "g_io_extension_ref_class", false) | |||
| 320 | + | ||||
| 295 | cret := xIOExtensionRefClass(x.GoPointer()) | 321 | cret := xIOExtensionRefClass(x.GoPointer()) | ||
| 296 | if cret == 0 { | 322 | if cret == 0 { | ||
| 297 | return nil | 323 | return nil | ||
| @@ -372,6 +398,8 @@ var xIOExtensionPointGetExtensionByName func(uintptr, string) uintptr | |||||
| 372 | 398 | ||||
| 373 | // Finds a #GIOExtension for an extension point by name. | 399 | // Finds a #GIOExtension for an extension point by name. | ||
| 374 | func (x *IOExtensionPoint) GetExtensionByName(NameVar string) *IOExtension { | 400 | func (x *IOExtensionPoint) GetExtensionByName(NameVar string) *IOExtension { | ||
| 401 | + | core.LazyRegister(&xIOExtensionPointGetExtensionByName, "GIO", "g_io_extension_point_get_extension_by_name", false) | |||
| 402 | + | ||||
| 375 | cret := xIOExtensionPointGetExtensionByName(x.GoPointer(), NameVar) | 403 | cret := xIOExtensionPointGetExtensionByName(x.GoPointer(), NameVar) | ||
| 376 | if cret == 0 { | 404 | if cret == 0 { | ||
| 377 | return nil | 405 | return nil | ||
| @@ -384,6 +412,8 @@ var xIOExtensionPointGetExtensions func(uintptr) uintptr | |||||
| 384 | // Gets a list of all extensions that implement this extension point. | 412 | // Gets a list of all extensions that implement this extension point. | ||
| 385 | // The list is sorted by priority, beginning with the highest priority. | 413 | // The list is sorted by priority, beginning with the highest priority. | ||
| 386 | func (x *IOExtensionPoint) GetExtensions() *glib.List { | 414 | func (x *IOExtensionPoint) GetExtensions() *glib.List { | ||
| 415 | + | core.LazyRegister(&xIOExtensionPointGetExtensions, "GIO", "g_io_extension_point_get_extensions", false) | |||
| 416 | + | ||||
| 387 | cret := xIOExtensionPointGetExtensions(x.GoPointer()) | 417 | cret := xIOExtensionPointGetExtensions(x.GoPointer()) | ||
| 388 | if cret == 0 { | 418 | if cret == 0 { | ||
| 389 | return nil | 419 | return nil | ||
| @@ -395,6 +425,8 @@ var xIOExtensionPointGetRequiredType func(uintptr) types.GType | |||||
| 395 | 425 | ||||
| 396 | // Gets the required type for @extension_point. | 426 | // Gets the required type for @extension_point. | ||
| 397 | func (x *IOExtensionPoint) GetRequiredType() types.GType { | 427 | func (x *IOExtensionPoint) GetRequiredType() types.GType { | ||
| 428 | + | core.LazyRegister(&xIOExtensionPointGetRequiredType, "GIO", "g_io_extension_point_get_required_type", false) | |||
| 429 | + | ||||
| 398 | cret := xIOExtensionPointGetRequiredType(x.GoPointer()) | 430 | cret := xIOExtensionPointGetRequiredType(x.GoPointer()) | ||
| 399 | return cret | 431 | return cret | ||
| 400 | } | 432 | } | ||
| @@ -404,6 +436,8 @@ var xIOExtensionPointSetRequiredType func(uintptr, types.GType) | |||||
| 404 | // Sets the required type for @extension_point to @type. | 436 | // Sets the required type for @extension_point to @type. | ||
| 405 | // All implementations must henceforth have this type. | 437 | // All implementations must henceforth have this type. | ||
| 406 | func (x *IOExtensionPoint) SetRequiredType(TypeVar types.GType) { | 438 | func (x *IOExtensionPoint) SetRequiredType(TypeVar types.GType) { | ||
| 439 | + | core.LazyRegister(&xIOExtensionPointSetRequiredType, "GIO", "g_io_extension_point_set_required_type", false) | |||
| 440 | + | ||||
| 407 | xIOExtensionPointSetRequiredType(x.GoPointer(), TypeVar) | 441 | xIOExtensionPointSetRequiredType(x.GoPointer(), TypeVar) | ||
| 408 | } | 442 | } | ||
| 409 | 443 | ||||
| @@ -430,6 +464,8 @@ var xIOSchedulerJobSendToMainloop func(uintptr, uintptr, uintptr, uintptr) bool | |||||
| 430 | // that the job was started from, waiting for the result (and thus | 464 | // that the job was started from, waiting for the result (and thus | ||
| 431 | // blocking the I/O job). | 465 | // blocking the I/O job). | ||
| 432 | func (x *IOSchedulerJob) SendToMainloop(FuncVar *glib.SourceFunc, UserDataVar uintptr, NotifyVar *glib.DestroyNotify) bool { | 466 | func (x *IOSchedulerJob) SendToMainloop(FuncVar *glib.SourceFunc, UserDataVar uintptr, NotifyVar *glib.DestroyNotify) bool { | ||
| 467 | + | core.LazyRegister(&xIOSchedulerJobSendToMainloop, "GIO", "g_io_scheduler_job_send_to_mainloop", false) | |||
| 468 | + | ||||
| 433 | cret := xIOSchedulerJobSendToMainloop(x.GoPointer(), glib.NewCallback(FuncVar), UserDataVar, glib.NewCallbackNullable(NotifyVar)) | 469 | cret := xIOSchedulerJobSendToMainloop(x.GoPointer(), glib.NewCallback(FuncVar), UserDataVar, glib.NewCallbackNullable(NotifyVar)) | ||
| 434 | return cret | 470 | return cret | ||
| 435 | } | 471 | } | ||
| @@ -446,6 +482,8 @@ var xIOSchedulerJobSendToMainloopAsync func(uintptr, uintptr, uintptr, uintptr) | |||||
| 446 | // @func is called, either by passing %NULL as @notify to | 482 | // @func is called, either by passing %NULL as @notify to | ||
| 447 | // g_io_scheduler_push_job() or by using refcounting for @user_data. | 483 | // g_io_scheduler_push_job() or by using refcounting for @user_data. | ||
| 448 | func (x *IOSchedulerJob) SendToMainloopAsync(FuncVar *glib.SourceFunc, UserDataVar uintptr, NotifyVar *glib.DestroyNotify) { | 484 | func (x *IOSchedulerJob) SendToMainloopAsync(FuncVar *glib.SourceFunc, UserDataVar uintptr, NotifyVar *glib.DestroyNotify) { | ||
| 485 | + | core.LazyRegister(&xIOSchedulerJobSendToMainloopAsync, "GIO", "g_io_scheduler_job_send_to_mainloop_async", false) | |||
| 486 | + | ||||
| 449 | xIOSchedulerJobSendToMainloopAsync(x.GoPointer(), glib.NewCallback(FuncVar), UserDataVar, glib.NewCallbackNullable(NotifyVar)) | 487 | xIOSchedulerJobSendToMainloopAsync(x.GoPointer(), glib.NewCallback(FuncVar), UserDataVar, glib.NewCallbackNullable(NotifyVar)) | ||
| 450 | } | 488 | } | ||
| 451 | 489 | ||||
| @@ -767,6 +805,7 @@ type Resource struct { | |||||
| 767 | var xResourceGLibType func() types.GType | 805 | var xResourceGLibType func() types.GType | ||
| 768 | 806 | ||||
| 769 | func ResourceGLibType() types.GType { | 807 | func ResourceGLibType() types.GType { | ||
| 808 | + | core.LazyRegister(&xResourceGLibType, "GIO", "g_resource_get_type", false) | |||
| 770 | return xResourceGLibType() | 809 | return xResourceGLibType() | ||
| 771 | } | 810 | } | ||
| 772 | 811 | ||||
| @@ -798,6 +837,7 @@ var xNewResourceFromData func(*glib.Bytes, **glib.Error) uintptr | |||||
| 798 | // | 837 | // | ||
| 799 | // If @data is empty or corrupt, %G_RESOURCE_ERROR_INTERNAL will be returned. | 838 | // If @data is empty or corrupt, %G_RESOURCE_ERROR_INTERNAL will be returned. | ||
| 800 | func NewResourceFromData(DataVar *glib.Bytes) (*Resource, error) { | 839 | func NewResourceFromData(DataVar *glib.Bytes) (*Resource, error) { | ||
| 840 | + | core.LazyRegister(&xNewResourceFromData, "GIO", "g_resource_new_from_data", false) | |||
| 801 | var cerr *glib.Error | 841 | var cerr *glib.Error | ||
| 802 | 842 | ||||
| 803 | cret := xNewResourceFromData(DataVar, &cerr) | 843 | cret := xNewResourceFromData(DataVar, &cerr) | ||
| @@ -818,6 +858,8 @@ var xResourceRegister func(uintptr) | |||||
| 818 | // with the global resource lookup functions like | 858 | // with the global resource lookup functions like | ||
| 819 | // [func@Gio.resources_lookup_data]. | 859 | // [func@Gio.resources_lookup_data]. | ||
| 820 | func (x *Resource) Register() { | 860 | func (x *Resource) Register() { | ||
| 861 | + | core.LazyRegister(&xResourceRegister, "GIO", "g_resources_register", false) | |||
| 862 | + | ||||
| 821 | xResourceRegister(x.GoPointer()) | 863 | xResourceRegister(x.GoPointer()) | ||
| 822 | } | 864 | } | ||
| 823 | 865 | ||||
| @@ -825,6 +867,8 @@ var xResourceUnregister func(uintptr) | |||||
| 825 | 867 | ||||
| 826 | // Unregisters the resource from the process-global set of resources. | 868 | // Unregisters the resource from the process-global set of resources. | ||
| 827 | func (x *Resource) Unregister() { | 869 | func (x *Resource) Unregister() { | ||
| 870 | + | core.LazyRegister(&xResourceUnregister, "GIO", "g_resources_unregister", false) | |||
| 871 | + | ||||
| 828 | xResourceUnregister(x.GoPointer()) | 872 | xResourceUnregister(x.GoPointer()) | ||
| 829 | } | 873 | } | ||
| 830 | 874 | ||||
| @@ -840,6 +884,7 @@ var xResourceEnumerateChildren func(uintptr, string, ResourceLookupFlags, **glib | |||||
| 840 | // | 884 | // | ||
| 841 | // @lookup_flags controls the behaviour of the lookup. | 885 | // @lookup_flags controls the behaviour of the lookup. | ||
| 842 | func (x *Resource) EnumerateChildren(PathVar string, LookupFlagsVar ResourceLookupFlags) ([]string, error) { | 886 | func (x *Resource) EnumerateChildren(PathVar string, LookupFlagsVar ResourceLookupFlags) ([]string, error) { | ||
| 887 | + | core.LazyRegister(&xResourceEnumerateChildren, "GIO", "g_resource_enumerate_children", false) | |||
| 843 | var cerr *glib.Error | 888 | var cerr *glib.Error | ||
| 844 | 889 | ||||
| 845 | cret := xResourceEnumerateChildren(x.GoPointer(), PathVar, LookupFlagsVar, &cerr) | 890 | cret := xResourceEnumerateChildren(x.GoPointer(), PathVar, LookupFlagsVar, &cerr) | ||
| @@ -859,6 +904,7 @@ var xResourceGetInfo func(uintptr, string, ResourceLookupFlags, *uint, *uint32, | |||||
| 859 | // The only error this can return is %G_RESOURCE_ERROR_NOT_FOUND, if @path was | 904 | // The only error this can return is %G_RESOURCE_ERROR_NOT_FOUND, if @path was | ||
| 860 | // not found in @resource. | 905 | // not found in @resource. | ||
| 861 | func (x *Resource) GetInfo(PathVar string, LookupFlagsVar ResourceLookupFlags, SizeVar *uint, FlagsVar *uint32) (bool, error) { | 906 | func (x *Resource) GetInfo(PathVar string, LookupFlagsVar ResourceLookupFlags, SizeVar *uint, FlagsVar *uint32) (bool, error) { | ||
| 907 | + | core.LazyRegister(&xResourceGetInfo, "GIO", "g_resource_get_info", false) | |||
| 862 | var cerr *glib.Error | 908 | var cerr *glib.Error | ||
| 863 | 909 | ||||
| 864 | cret := xResourceGetInfo(x.GoPointer(), PathVar, LookupFlagsVar, SizeVar, FlagsVar, &cerr) | 910 | cret := xResourceGetInfo(x.GoPointer(), PathVar, LookupFlagsVar, SizeVar, FlagsVar, &cerr) | ||
| @@ -873,6 +919,8 @@ var xResourceHasChildren func(uintptr, string) bool | |||||
| 873 | // Returns whether the specified @path in the resource | 919 | // Returns whether the specified @path in the resource | ||
| 874 | // has children. | 920 | // has children. | ||
| 875 | func (x *Resource) HasChildren(PathVar string) bool { | 921 | func (x *Resource) HasChildren(PathVar string) bool { | ||
| 922 | + | core.LazyRegister(&xResourceHasChildren, "GIO", "g_resource_has_children", false) | |||
| 923 | + | ||||
| 876 | cret := xResourceHasChildren(x.GoPointer(), PathVar) | 924 | cret := xResourceHasChildren(x.GoPointer(), PathVar) | ||
| 877 | return cret | 925 | return cret | ||
| 878 | } | 926 | } | ||
| @@ -898,6 +946,7 @@ var xResourceLookupData func(uintptr, string, ResourceLookupFlags, **glib.Error) | |||||
| 898 | // @resource, or %G_RESOURCE_ERROR_INTERNAL if decompression of a compressed | 946 | // @resource, or %G_RESOURCE_ERROR_INTERNAL if decompression of a compressed | ||
| 899 | // resource failed. | 947 | // resource failed. | ||
| 900 | func (x *Resource) LookupData(PathVar string, LookupFlagsVar ResourceLookupFlags) (*glib.Bytes, error) { | 948 | func (x *Resource) LookupData(PathVar string, LookupFlagsVar ResourceLookupFlags) (*glib.Bytes, error) { | ||
| 949 | + | core.LazyRegister(&xResourceLookupData, "GIO", "g_resource_lookup_data", false) | |||
| 901 | var cerr *glib.Error | 950 | var cerr *glib.Error | ||
| 902 | 951 | ||||
| 903 | cret := xResourceLookupData(x.GoPointer(), PathVar, LookupFlagsVar, &cerr) | 952 | cret := xResourceLookupData(x.GoPointer(), PathVar, LookupFlagsVar, &cerr) | ||
| @@ -920,6 +969,7 @@ var xResourceOpenStream func(uintptr, string, ResourceLookupFlags, **glib.Error) | |||||
| 920 | // The only error this can return is %G_RESOURCE_ERROR_NOT_FOUND, if @path was | 969 | // The only error this can return is %G_RESOURCE_ERROR_NOT_FOUND, if @path was | ||
| 921 | // not found in @resource. | 970 | // not found in @resource. | ||
| 922 | func (x *Resource) OpenStream(PathVar string, LookupFlagsVar ResourceLookupFlags) (*InputStream, error) { | 971 | func (x *Resource) OpenStream(PathVar string, LookupFlagsVar ResourceLookupFlags) (*InputStream, error) { | ||
| 972 | + | core.LazyRegister(&xResourceOpenStream, "GIO", "g_resource_open_stream", false) | |||
| 923 | var cls *InputStream | 973 | var cls *InputStream | ||
| 924 | var cerr *glib.Error | 974 | var cerr *glib.Error | ||
| 925 | 975 | ||||
| @@ -942,6 +992,8 @@ var xResourceRef func(uintptr) uintptr | |||||
| 942 | // | 992 | // | ||
| 943 | // This function is threadsafe and may be called from any thread. | 993 | // This function is threadsafe and may be called from any thread. | ||
| 944 | func (x *Resource) Ref() *Resource { | 994 | func (x *Resource) Ref() *Resource { | ||
| 995 | + | core.LazyRegister(&xResourceRef, "GIO", "g_resource_ref", false) | |||
| 996 | + | ||||
| 945 | cret := xResourceRef(x.GoPointer()) | 997 | cret := xResourceRef(x.GoPointer()) | ||
| 946 | if cret == 0 { | 998 | if cret == 0 { | ||
| 947 | return nil | 999 | return nil | ||
| @@ -957,6 +1009,8 @@ var xResourceUnref func(uintptr) | |||||
| 957 | // released. This function is threadsafe and may be called from any | 1009 | // released. This function is threadsafe and may be called from any | ||
| 958 | // thread. | 1010 | // thread. | ||
| 959 | func (x *Resource) Unref() { | 1011 | func (x *Resource) Unref() { | ||
| 1012 | + | core.LazyRegister(&xResourceUnref, "GIO", "g_resource_unref", false) | |||
| 1013 | + | ||||
| 960 | xResourceUnref(x.GoPointer()) | 1014 | xResourceUnref(x.GoPointer()) | ||
| 961 | } | 1015 | } | ||
| 962 | 1016 | ||||
| @@ -983,6 +1037,7 @@ type SrvTarget struct { | |||||
| 983 | var xSrvTargetGLibType func() types.GType | 1037 | var xSrvTargetGLibType func() types.GType | ||
| 984 | 1038 | ||||
| 985 | func SrvTargetGLibType() types.GType { | 1039 | func SrvTargetGLibType() types.GType { | ||
| 1040 | + | core.LazyRegister(&xSrvTargetGLibType, "GIO", "g_srv_target_get_type", false) | |||
| 986 | return xSrvTargetGLibType() | 1041 | return xSrvTargetGLibType() | ||
| 987 | } | 1042 | } | ||
| 988 | 1043 | ||||
| @@ -1005,6 +1060,8 @@ var xNewSrvTarget func(string, uint16, uint16, uint16) uintptr | |||||
| 1005 | // You should not need to use this; normally #GSrvTargets are | 1060 | // You should not need to use this; normally #GSrvTargets are | ||
| 1006 | // created by #GResolver. | 1061 | // created by #GResolver. | ||
| 1007 | func NewSrvTarget(HostnameVar string, PortVar uint16, PriorityVar uint16, WeightVar uint16) *SrvTarget { | 1062 | func NewSrvTarget(HostnameVar string, PortVar uint16, PriorityVar uint16, WeightVar uint16) *SrvTarget { | ||
| 1063 | + | core.LazyRegister(&xNewSrvTarget, "GIO", "g_srv_target_new", false) | |||
| 1064 | + | ||||
| 1008 | cret := xNewSrvTarget(HostnameVar, PortVar, PriorityVar, WeightVar) | 1065 | cret := xNewSrvTarget(HostnameVar, PortVar, PriorityVar, WeightVar) | ||
| 1009 | if cret == 0 { | 1066 | if cret == 0 { | ||
| 1010 | return nil | 1067 | return nil | ||
| @@ -1016,6 +1073,8 @@ var xSrvTargetCopy func(uintptr) uintptr | |||||
| 1016 | 1073 | ||||
| 1017 | // Copies @target | 1074 | // Copies @target | ||
| 1018 | func (x *SrvTarget) Copy() *SrvTarget { | 1075 | func (x *SrvTarget) Copy() *SrvTarget { | ||
| 1076 | + | core.LazyRegister(&xSrvTargetCopy, "GIO", "g_srv_target_copy", false) | |||
| 1077 | + | ||||
| 1019 | cret := xSrvTargetCopy(x.GoPointer()) | 1078 | cret := xSrvTargetCopy(x.GoPointer()) | ||
| 1020 | if cret == 0 { | 1079 | if cret == 0 { | ||
| 1021 | return nil | 1080 | return nil | ||
| @@ -1027,6 +1086,8 @@ var xSrvTargetFree func(uintptr) | |||||
| 1027 | 1086 | ||||
| 1028 | // Frees @target | 1087 | // Frees @target | ||
| 1029 | func (x *SrvTarget) Free() { | 1088 | func (x *SrvTarget) Free() { | ||
| 1089 | + | core.LazyRegister(&xSrvTargetFree, "GIO", "g_srv_target_free", false) | |||
| 1090 | + | ||||
| 1030 | xSrvTargetFree(x.GoPointer()) | 1091 | xSrvTargetFree(x.GoPointer()) | ||
| 1031 | } | 1092 | } | ||
| 1032 | 1093 | ||||
| @@ -1037,6 +1098,8 @@ var xSrvTargetGetHostname func(uintptr) string | |||||
| 1037 | // check if it contains encoded Unicode segments, and use | 1098 | // check if it contains encoded Unicode segments, and use | ||
| 1038 | // g_hostname_to_unicode() to convert it if it does.) | 1099 | // g_hostname_to_unicode() to convert it if it does.) | ||
| 1039 | func (x *SrvTarget) GetHostname() string { | 1100 | func (x *SrvTarget) GetHostname() string { | ||
| 1101 | + | core.LazyRegister(&xSrvTargetGetHostname, "GIO", "g_srv_target_get_hostname", false) | |||
| 1102 | + | ||||
| 1040 | cret := xSrvTargetGetHostname(x.GoPointer()) | 1103 | cret := xSrvTargetGetHostname(x.GoPointer()) | ||
| 1041 | return cret | 1104 | return cret | ||
| 1042 | } | 1105 | } | ||
| @@ -1045,6 +1108,8 @@ var xSrvTargetGetPort func(uintptr) uint16 | |||||
| 1045 | 1108 | ||||
| 1046 | // Gets @target's port | 1109 | // Gets @target's port | ||
| 1047 | func (x *SrvTarget) GetPort() uint16 { | 1110 | func (x *SrvTarget) GetPort() uint16 { | ||
| 1111 | + | core.LazyRegister(&xSrvTargetGetPort, "GIO", "g_srv_target_get_port", false) | |||
| 1112 | + | ||||
| 1048 | cret := xSrvTargetGetPort(x.GoPointer()) | 1113 | cret := xSrvTargetGetPort(x.GoPointer()) | ||
| 1049 | return cret | 1114 | return cret | ||
| 1050 | } | 1115 | } | ||
| @@ -1055,6 +1120,8 @@ var xSrvTargetGetPriority func(uintptr) uint16 | |||||
| 1055 | // #GResolver already sorts the targets according to the algorithm in | 1120 | // #GResolver already sorts the targets according to the algorithm in | ||
| 1056 | // RFC 2782. | 1121 | // RFC 2782. | ||
| 1057 | func (x *SrvTarget) GetPriority() uint16 { | 1122 | func (x *SrvTarget) GetPriority() uint16 { | ||
| 1123 | + | core.LazyRegister(&xSrvTargetGetPriority, "GIO", "g_srv_target_get_priority", false) | |||
| 1124 | + | ||||
| 1058 | cret := xSrvTargetGetPriority(x.GoPointer()) | 1125 | cret := xSrvTargetGetPriority(x.GoPointer()) | ||
| 1059 | return cret | 1126 | return cret | ||
| 1060 | } | 1127 | } | ||
| @@ -1065,6 +1132,8 @@ var xSrvTargetGetWeight func(uintptr) uint16 | |||||
| 1065 | // #GResolver already sorts the targets according to the algorithm in | 1132 | // #GResolver already sorts the targets according to the algorithm in | ||
| 1066 | // RFC 2782. | 1133 | // RFC 2782. | ||
| 1067 | func (x *SrvTarget) GetWeight() uint16 { | 1134 | func (x *SrvTarget) GetWeight() uint16 { | ||
| 1135 | + | core.LazyRegister(&xSrvTargetGetWeight, "GIO", "g_srv_target_get_weight", false) | |||
| 1136 | + | ||||
| 1068 | cret := xSrvTargetGetWeight(x.GoPointer()) | 1137 | cret := xSrvTargetGetWeight(x.GoPointer()) | ||
| 1069 | return cret | 1138 | return cret | ||
| 1070 | } | 1139 | } | ||
| @@ -1072,63 +1141,4 @@ func (x *SrvTarget) GetWeight() uint16 { | |||||
| 1072 | func init() { | 1141 | func init() { | ||
| 1073 | core.SetPackageName("GIO", "gio-2.0") | 1142 | core.SetPackageName("GIO", "gio-2.0") | ||
| 1074 | core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0", "libgio-2.0.0.dylib"}) | 1143 | core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0", "libgio-2.0.0.dylib"}) | ||
| 1075 | - | var libs []uintptr | |||
| 1076 | - | for _, libPath := range core.GetPaths("GIO") { | |||
| 1077 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 1078 | - | if err != nil { | |||
| 1079 | - | panic(err) | |||
| 1080 | - | } | |||
| 1081 | - | libs = append(libs, lib) | |||
| 1082 | - | } | |||
| 1083 | - | ||||
| 1084 | - | core.PuregoSafeRegister(&xFileAttributeMatcherGLibType, libs, "g_file_attribute_matcher_get_type") | |||
| 1085 | - | ||||
| 1086 | - | core.PuregoSafeRegister(&xNewFileAttributeMatcher, libs, "g_file_attribute_matcher_new") | |||
| 1087 | - | ||||
| 1088 | - | core.PuregoSafeRegister(&xFileAttributeMatcherEnumerateNamespace, libs, "g_file_attribute_matcher_enumerate_namespace") | |||
| 1089 | - | core.PuregoSafeRegister(&xFileAttributeMatcherEnumerateNext, libs, "g_file_attribute_matcher_enumerate_next") | |||
| 1090 | - | core.PuregoSafeRegister(&xFileAttributeMatcherMatches, libs, "g_file_attribute_matcher_matches") | |||
| 1091 | - | core.PuregoSafeRegister(&xFileAttributeMatcherMatchesOnly, libs, "g_file_attribute_matcher_matches_only") | |||
| 1092 | - | core.PuregoSafeRegister(&xFileAttributeMatcherRef, libs, "g_file_attribute_matcher_ref") | |||
| 1093 | - | core.PuregoSafeRegister(&xFileAttributeMatcherSubtract, libs, "g_file_attribute_matcher_subtract") | |||
| 1094 | - | core.PuregoSafeRegister(&xFileAttributeMatcherToString, libs, "g_file_attribute_matcher_to_string") | |||
| 1095 | - | core.PuregoSafeRegister(&xFileAttributeMatcherUnref, libs, "g_file_attribute_matcher_unref") | |||
| 1096 | - | ||||
| 1097 | - | core.PuregoSafeRegister(&xIOExtensionGetName, libs, "g_io_extension_get_name") | |||
| 1098 | - | core.PuregoSafeRegister(&xIOExtensionGetPriority, libs, "g_io_extension_get_priority") | |||
| 1099 | - | core.PuregoSafeRegister(&xIOExtensionGetType, libs, "g_io_extension_get_type") | |||
| 1100 | - | core.PuregoSafeRegister(&xIOExtensionRefClass, libs, "g_io_extension_ref_class") | |||
| 1101 | - | ||||
| 1102 | - | core.PuregoSafeRegister(&xIOExtensionPointGetExtensionByName, libs, "g_io_extension_point_get_extension_by_name") | |||
| 1103 | - | core.PuregoSafeRegister(&xIOExtensionPointGetExtensions, libs, "g_io_extension_point_get_extensions") | |||
| 1104 | - | core.PuregoSafeRegister(&xIOExtensionPointGetRequiredType, libs, "g_io_extension_point_get_required_type") | |||
| 1105 | - | core.PuregoSafeRegister(&xIOExtensionPointSetRequiredType, libs, "g_io_extension_point_set_required_type") | |||
| 1106 | - | ||||
| 1107 | - | core.PuregoSafeRegister(&xIOSchedulerJobSendToMainloop, libs, "g_io_scheduler_job_send_to_mainloop") | |||
| 1108 | - | core.PuregoSafeRegister(&xIOSchedulerJobSendToMainloopAsync, libs, "g_io_scheduler_job_send_to_mainloop_async") | |||
| 1109 | - | ||||
| 1110 | - | core.PuregoSafeRegister(&xResourceGLibType, libs, "g_resource_get_type") | |||
| 1111 | - | ||||
| 1112 | - | core.PuregoSafeRegister(&xNewResourceFromData, libs, "g_resource_new_from_data") | |||
| 1113 | - | ||||
| 1114 | - | core.PuregoSafeRegister(&xResourceRegister, libs, "g_resources_register") | |||
| 1115 | - | core.PuregoSafeRegister(&xResourceUnregister, libs, "g_resources_unregister") | |||
| 1116 | - | core.PuregoSafeRegister(&xResourceEnumerateChildren, libs, "g_resource_enumerate_children") | |||
| 1117 | - | core.PuregoSafeRegister(&xResourceGetInfo, libs, "g_resource_get_info") | |||
| 1118 | - | core.PuregoSafeRegister(&xResourceHasChildren, libs, "g_resource_has_children") | |||
| 1119 | - | core.PuregoSafeRegister(&xResourceLookupData, libs, "g_resource_lookup_data") | |||
| 1120 | - | core.PuregoSafeRegister(&xResourceOpenStream, libs, "g_resource_open_stream") | |||
| 1121 | - | core.PuregoSafeRegister(&xResourceRef, libs, "g_resource_ref") | |||
| 1122 | - | core.PuregoSafeRegister(&xResourceUnref, libs, "g_resource_unref") | |||
| 1123 | - | ||||
| 1124 | - | core.PuregoSafeRegister(&xSrvTargetGLibType, libs, "g_srv_target_get_type") | |||
| 1125 | - | ||||
| 1126 | - | core.PuregoSafeRegister(&xNewSrvTarget, libs, "g_srv_target_new") | |||
| 1127 | - | ||||
| 1128 | - | core.PuregoSafeRegister(&xSrvTargetCopy, libs, "g_srv_target_copy") | |||
| 1129 | - | core.PuregoSafeRegister(&xSrvTargetFree, libs, "g_srv_target_free") | |||
| 1130 | - | core.PuregoSafeRegister(&xSrvTargetGetHostname, libs, "g_srv_target_get_hostname") | |||
| 1131 | - | core.PuregoSafeRegister(&xSrvTargetGetPort, libs, "g_srv_target_get_port") | |||
| 1132 | - | core.PuregoSafeRegister(&xSrvTargetGetPriority, libs, "g_srv_target_get_priority") | |||
| 1133 | - | core.PuregoSafeRegister(&xSrvTargetGetWeight, libs, "g_srv_target_get_weight") | |||
| 1134 | } | 1144 | } | ||