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
| @@ -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" | |
| @@ -28,6 +27,7 @@ type ColorState struct { | |||
| 28 | 27 | var xColorStateGLibType func() types.GType | |
| 29 | 28 | ||
| 30 | 29 | func ColorStateGLibType() types.GType { | |
| 30 | + | core.LazyRegister(&xColorStateGLibType, "GDK", "gdk_color_state_get_type", false) | |
| 31 | 31 | return xColorStateGLibType() | |
| 32 | 32 | } | |
| 33 | 33 | ||
| @@ -51,6 +51,7 @@ var xColorStateCreateCicpParams func(uintptr) uintptr | |||
| 51 | 51 | // represented with Cicp parameters. If that is the case, | |
| 52 | 52 | // this function returns `NULL`. | |
| 53 | 53 | func (x *ColorState) CreateCicpParams() *CicpParams { | |
| 54 | + | core.LazyRegister(&xColorStateCreateCicpParams, "GDK", "gdk_color_state_create_cicp_params", false) | |
| 54 | 55 | var cls *CicpParams | |
| 55 | 56 | ||
| 56 | 57 | cret := xColorStateCreateCicpParams(x.GoPointer()) | |
| @@ -71,6 +72,8 @@ var xColorStateEqual func(uintptr, *ColorState) bool | |||
| 71 | 72 | // describing the same color state may compare not equal. However, different | |
| 72 | 73 | // color states will never compare equal. | |
| 73 | 74 | func (x *ColorState) Equal(OtherVar *ColorState) bool { | |
| 75 | + | core.LazyRegister(&xColorStateEqual, "GDK", "gdk_color_state_equal", false) | |
| 76 | + | ||
| 74 | 77 | cret := xColorStateEqual(x.GoPointer(), OtherVar) | |
| 75 | 78 | return cret | |
| 76 | 79 | } | |
| @@ -82,6 +85,8 @@ var xColorStateEquivalent func(uintptr, *ColorState) bool | |||
| 82 | 85 | // Two objects that represent the same color state should be equivalent, | |
| 83 | 86 | // even though they may not be equal in the sense of [method@Gdk.ColorState.equal]. | |
| 84 | 87 | func (x *ColorState) Equivalent(OtherVar *ColorState) bool { | |
| 88 | + | core.LazyRegister(&xColorStateEquivalent, "GDK", "gdk_color_state_equivalent", false) | |
| 89 | + | ||
| 85 | 90 | cret := xColorStateEquivalent(x.GoPointer(), OtherVar) | |
| 86 | 91 | return cret | |
| 87 | 92 | } | |
| @@ -90,6 +95,8 @@ var xColorStateRef func(uintptr) uintptr | |||
| 90 | 95 | ||
| 91 | 96 | // Increase the reference count of @self. | |
| 92 | 97 | func (x *ColorState) Ref() *ColorState { | |
| 98 | + | core.LazyRegister(&xColorStateRef, "GDK", "gdk_color_state_ref", false) | |
| 99 | + | ||
| 93 | 100 | cret := xColorStateRef(x.GoPointer()) | |
| 94 | 101 | if cret == 0 { | |
| 95 | 102 | return nil | |
| @@ -104,6 +111,8 @@ var xColorStateUnref func(uintptr) | |||
| 104 | 111 | // Unless @self is static, it will be freed | |
| 105 | 112 | // when the reference count reaches zero. | |
| 106 | 113 | func (x *ColorState) Unref() { | |
| 114 | + | core.LazyRegister(&xColorStateUnref, "GDK", "gdk_color_state_unref", false) | |
| 115 | + | ||
| 107 | 116 | xColorStateUnref(x.GoPointer()) | |
| 108 | 117 | } | |
| 109 | 118 | ||
| @@ -145,6 +154,7 @@ type ContentFormats struct { | |||
| 145 | 154 | var xContentFormatsGLibType func() types.GType | |
| 146 | 155 | ||
| 147 | 156 | func ContentFormatsGLibType() types.GType { | |
| 157 | + | core.LazyRegister(&xContentFormatsGLibType, "GDK", "gdk_content_formats_get_type", false) | |
| 148 | 158 | return xContentFormatsGLibType() | |
| 149 | 159 | } | |
| 150 | 160 | ||
| @@ -168,6 +178,8 @@ var xNewContentFormats func([]string, uint) uintptr | |||
| 168 | 178 | // behavior of the return value is undefined. If you cannot guarantee | |
| 169 | 179 | // this, use [struct@Gdk.ContentFormatsBuilder] instead. | |
| 170 | 180 | func NewContentFormats(MimeTypesVar []string, NMimeTypesVar uint) *ContentFormats { | |
| 181 | + | core.LazyRegister(&xNewContentFormats, "GDK", "gdk_content_formats_new", false) | |
| 182 | + | ||
| 171 | 183 | cret := xNewContentFormats(MimeTypesVar, NMimeTypesVar) | |
| 172 | 184 | if cret == 0 { | |
| 173 | 185 | return nil | |
| @@ -179,6 +191,8 @@ var xNewContentFormatsForGtype func(types.GType) uintptr | |||
| 179 | 191 | ||
| 180 | 192 | // Creates a new `GdkContentFormats` for a given `GType`. | |
| 181 | 193 | func NewContentFormatsForGtype(TypeVar types.GType) *ContentFormats { | |
| 194 | + | core.LazyRegister(&xNewContentFormatsForGtype, "GDK", "gdk_content_formats_new_for_gtype", false) | |
| 195 | + | ||
| 182 | 196 | cret := xNewContentFormatsForGtype(TypeVar) | |
| 183 | 197 | if cret == 0 { | |
| 184 | 198 | return nil | |
| @@ -190,6 +204,8 @@ var xContentFormatsContainGtype func(uintptr, types.GType) bool | |||
| 190 | 204 | ||
| 191 | 205 | // Checks if a given `GType` is part of the given @formats. | |
| 192 | 206 | func (x *ContentFormats) ContainGtype(TypeVar types.GType) bool { | |
| 207 | + | core.LazyRegister(&xContentFormatsContainGtype, "GDK", "gdk_content_formats_contain_gtype", false) | |
| 208 | + | ||
| 193 | 209 | cret := xContentFormatsContainGtype(x.GoPointer(), TypeVar) | |
| 194 | 210 | return cret | |
| 195 | 211 | } | |
| @@ -198,6 +214,8 @@ var xContentFormatsContainMimeType func(uintptr, string) bool | |||
| 198 | 214 | ||
| 199 | 215 | // Checks if a given mime type is part of the given @formats. | |
| 200 | 216 | func (x *ContentFormats) ContainMimeType(MimeTypeVar string) bool { | |
| 217 | + | core.LazyRegister(&xContentFormatsContainMimeType, "GDK", "gdk_content_formats_contain_mime_type", false) | |
| 218 | + | ||
| 201 | 219 | cret := xContentFormatsContainMimeType(x.GoPointer(), MimeTypeVar) | |
| 202 | 220 | return cret | |
| 203 | 221 | } | |
| @@ -209,6 +227,8 @@ var xContentFormatsGetGtypes func(uintptr, *uint) uintptr | |||
| 209 | 227 | // Note that @formats may not contain any `GType`s, in particular when | |
| 210 | 228 | // they are empty. In that case %NULL will be returned. | |
| 211 | 229 | func (x *ContentFormats) GetGtypes(NGtypesVar *uint) uintptr { | |
| 230 | + | core.LazyRegister(&xContentFormatsGetGtypes, "GDK", "gdk_content_formats_get_gtypes", false) | |
| 231 | + | ||
| 212 | 232 | cret := xContentFormatsGetGtypes(x.GoPointer(), NGtypesVar) | |
| 213 | 233 | return cret | |
| 214 | 234 | } | |
| @@ -220,6 +240,8 @@ var xContentFormatsGetMimeTypes func(uintptr, *uint) []string | |||
| 220 | 240 | // Note that @formats may not contain any mime types, in particular | |
| 221 | 241 | // when they are empty. In that case %NULL will be returned. | |
| 222 | 242 | func (x *ContentFormats) GetMimeTypes(NMimeTypesVar *uint) []string { | |
| 243 | + | core.LazyRegister(&xContentFormatsGetMimeTypes, "GDK", "gdk_content_formats_get_mime_types", false) | |
| 244 | + | ||
| 223 | 245 | cret := xContentFormatsGetMimeTypes(x.GoPointer(), NMimeTypesVar) | |
| 224 | 246 | return cret | |
| 225 | 247 | } | |
| @@ -228,6 +250,8 @@ var xContentFormatsIsEmpty func(uintptr) bool | |||
| 228 | 250 | ||
| 229 | 251 | // Returns whether the content formats contain any formats. | |
| 230 | 252 | func (x *ContentFormats) IsEmpty() bool { | |
| 253 | + | core.LazyRegister(&xContentFormatsIsEmpty, "GDK", "gdk_content_formats_is_empty", false) | |
| 254 | + | ||
| 231 | 255 | cret := xContentFormatsIsEmpty(x.GoPointer()) | |
| 232 | 256 | return cret | |
| 233 | 257 | } | |
| @@ -236,6 +260,8 @@ var xContentFormatsMatch func(uintptr, *ContentFormats) bool | |||
| 236 | 260 | ||
| 237 | 261 | // Checks if @first and @second have any matching formats. | |
| 238 | 262 | func (x *ContentFormats) Match(SecondVar *ContentFormats) bool { | |
| 263 | + | core.LazyRegister(&xContentFormatsMatch, "GDK", "gdk_content_formats_match", false) | |
| 264 | + | ||
| 239 | 265 | cret := xContentFormatsMatch(x.GoPointer(), SecondVar) | |
| 240 | 266 | return cret | |
| 241 | 267 | } | |
| @@ -247,6 +273,8 @@ var xContentFormatsMatchGtype func(uintptr, *ContentFormats) types.GType | |||
| 247 | 273 | // | |
| 248 | 274 | // If no matching `GType` is found, %G_TYPE_INVALID is returned. | |
| 249 | 275 | func (x *ContentFormats) MatchGtype(SecondVar *ContentFormats) types.GType { | |
| 276 | + | core.LazyRegister(&xContentFormatsMatchGtype, "GDK", "gdk_content_formats_match_gtype", false) | |
| 277 | + | ||
| 250 | 278 | cret := xContentFormatsMatchGtype(x.GoPointer(), SecondVar) | |
| 251 | 279 | return cret | |
| 252 | 280 | } | |
| @@ -258,6 +286,8 @@ var xContentFormatsMatchMimeType func(uintptr, *ContentFormats) string | |||
| 258 | 286 | // | |
| 259 | 287 | // If no matching mime type is found, %NULL is returned. | |
| 260 | 288 | func (x *ContentFormats) MatchMimeType(SecondVar *ContentFormats) string { | |
| 289 | + | core.LazyRegister(&xContentFormatsMatchMimeType, "GDK", "gdk_content_formats_match_mime_type", false) | |
| 290 | + | ||
| 261 | 291 | cret := xContentFormatsMatchMimeType(x.GoPointer(), SecondVar) | |
| 262 | 292 | return cret | |
| 263 | 293 | } | |
| @@ -269,6 +299,8 @@ var xContentFormatsPrint func(uintptr, *glib.String) | |||
| 269 | 299 | // The result of this function can later be parsed with | |
| 270 | 300 | // [func@Gdk.ContentFormats.parse]. | |
| 271 | 301 | func (x *ContentFormats) Print(StringVar *glib.String) { | |
| 302 | + | core.LazyRegister(&xContentFormatsPrint, "GDK", "gdk_content_formats_print", false) | |
| 303 | + | ||
| 272 | 304 | xContentFormatsPrint(x.GoPointer(), StringVar) | |
| 273 | 305 | } | |
| 274 | 306 | ||
| @@ -276,6 +308,8 @@ var xContentFormatsRef func(uintptr) uintptr | |||
| 276 | 308 | ||
| 277 | 309 | // Increases the reference count of a `GdkContentFormats` by one. | |
| 278 | 310 | func (x *ContentFormats) Ref() *ContentFormats { | |
| 311 | + | core.LazyRegister(&xContentFormatsRef, "GDK", "gdk_content_formats_ref", false) | |
| 312 | + | ||
| 279 | 313 | cret := xContentFormatsRef(x.GoPointer()) | |
| 280 | 314 | if cret == 0 { | |
| 281 | 315 | return nil | |
| @@ -292,6 +326,8 @@ var xContentFormatsToString func(uintptr) string | |||
| 292 | 326 | // This is a small wrapper around [method@Gdk.ContentFormats.print] | |
| 293 | 327 | // to help when debugging. | |
| 294 | 328 | func (x *ContentFormats) ToString() string { | |
| 329 | + | core.LazyRegister(&xContentFormatsToString, "GDK", "gdk_content_formats_to_string", false) | |
| 330 | + | ||
| 295 | 331 | cret := xContentFormatsToString(x.GoPointer()) | |
| 296 | 332 | return cret | |
| 297 | 333 | } | |
| @@ -301,6 +337,8 @@ var xContentFormatsUnion func(uintptr, *ContentFormats) uintptr | |||
| 301 | 337 | // Append all missing types from @second to @first, in the order | |
| 302 | 338 | // they had in @second. | |
| 303 | 339 | func (x *ContentFormats) Union(SecondVar *ContentFormats) *ContentFormats { | |
| 340 | + | core.LazyRegister(&xContentFormatsUnion, "GDK", "gdk_content_formats_union", false) | |
| 341 | + | ||
| 304 | 342 | cret := xContentFormatsUnion(x.GoPointer(), SecondVar) | |
| 305 | 343 | if cret == 0 { | |
| 306 | 344 | return nil | |
| @@ -313,6 +351,8 @@ var xContentFormatsUnionDeserializeGtypes func(uintptr) uintptr | |||
| 313 | 351 | // Add GTypes for mime types in @formats for which deserializers are | |
| 314 | 352 | // registered. | |
| 315 | 353 | func (x *ContentFormats) UnionDeserializeGtypes() *ContentFormats { | |
| 354 | + | core.LazyRegister(&xContentFormatsUnionDeserializeGtypes, "GDK", "gdk_content_formats_union_deserialize_gtypes", false) | |
| 355 | + | ||
| 316 | 356 | cret := xContentFormatsUnionDeserializeGtypes(x.GoPointer()) | |
| 317 | 357 | if cret == 0 { | |
| 318 | 358 | return nil | |
| @@ -325,6 +365,8 @@ var xContentFormatsUnionDeserializeMimeTypes func(uintptr) uintptr | |||
| 325 | 365 | // Add mime types for GTypes in @formats for which deserializers are | |
| 326 | 366 | // registered. | |
| 327 | 367 | func (x *ContentFormats) UnionDeserializeMimeTypes() *ContentFormats { | |
| 368 | + | core.LazyRegister(&xContentFormatsUnionDeserializeMimeTypes, "GDK", "gdk_content_formats_union_deserialize_mime_types", false) | |
| 369 | + | ||
| 328 | 370 | cret := xContentFormatsUnionDeserializeMimeTypes(x.GoPointer()) | |
| 329 | 371 | if cret == 0 { | |
| 330 | 372 | return nil | |
| @@ -337,6 +379,8 @@ var xContentFormatsUnionSerializeGtypes func(uintptr) uintptr | |||
| 337 | 379 | // Add GTypes for the mime types in @formats for which serializers are | |
| 338 | 380 | // registered. | |
| 339 | 381 | func (x *ContentFormats) UnionSerializeGtypes() *ContentFormats { | |
| 382 | + | core.LazyRegister(&xContentFormatsUnionSerializeGtypes, "GDK", "gdk_content_formats_union_serialize_gtypes", false) | |
| 383 | + | ||
| 340 | 384 | cret := xContentFormatsUnionSerializeGtypes(x.GoPointer()) | |
| 341 | 385 | if cret == 0 { | |
| 342 | 386 | return nil | |
| @@ -349,6 +393,8 @@ var xContentFormatsUnionSerializeMimeTypes func(uintptr) uintptr | |||
| 349 | 393 | // Add mime types for GTypes in @formats for which serializers are | |
| 350 | 394 | // registered. | |
| 351 | 395 | func (x *ContentFormats) UnionSerializeMimeTypes() *ContentFormats { | |
| 396 | + | core.LazyRegister(&xContentFormatsUnionSerializeMimeTypes, "GDK", "gdk_content_formats_union_serialize_mime_types", false) | |
| 397 | + | ||
| 352 | 398 | cret := xContentFormatsUnionSerializeMimeTypes(x.GoPointer()) | |
| 353 | 399 | if cret == 0 { | |
| 354 | 400 | return nil | |
| @@ -362,6 +408,8 @@ var xContentFormatsUnref func(uintptr) | |||
| 362 | 408 | // | |
| 363 | 409 | // If the resulting reference count is zero, frees the formats. | |
| 364 | 410 | func (x *ContentFormats) Unref() { | |
| 411 | + | core.LazyRegister(&xContentFormatsUnref, "GDK", "gdk_content_formats_unref", false) | |
| 412 | + | ||
| 365 | 413 | xContentFormatsUnref(x.GoPointer()) | |
| 366 | 414 | } | |
| 367 | 415 | ||
| @@ -391,6 +439,7 @@ type DmabufFormats struct { | |||
| 391 | 439 | var xDmabufFormatsGLibType func() types.GType | |
| 392 | 440 | ||
| 393 | 441 | func DmabufFormatsGLibType() types.GType { | |
| 442 | + | core.LazyRegister(&xDmabufFormatsGLibType, "GDK", "gdk_dmabuf_formats_get_type", false) | |
| 394 | 443 | return xDmabufFormatsGLibType() | |
| 395 | 444 | } | |
| 396 | 445 | ||
| @@ -410,6 +459,8 @@ var xDmabufFormatsContains func(uintptr, uint32, uint64) bool | |||
| 410 | 459 | ||
| 411 | 460 | // Returns whether a given format is contained in @formats. | |
| 412 | 461 | func (x *DmabufFormats) Contains(FourccVar uint32, ModifierVar uint64) bool { | |
| 462 | + | core.LazyRegister(&xDmabufFormatsContains, "GDK", "gdk_dmabuf_formats_contains", false) | |
| 463 | + | ||
| 413 | 464 | cret := xDmabufFormatsContains(x.GoPointer(), FourccVar, ModifierVar) | |
| 414 | 465 | return cret | |
| 415 | 466 | } | |
| @@ -419,6 +470,8 @@ var xDmabufFormatsEqual func(uintptr, *DmabufFormats) bool | |||
| 419 | 470 | // Returns whether @formats1 and @formats2 contain the | |
| 420 | 471 | // same dmabuf formats, in the same order. | |
| 421 | 472 | func (x *DmabufFormats) Equal(Formats2Var *DmabufFormats) bool { | |
| 473 | + | core.LazyRegister(&xDmabufFormatsEqual, "GDK", "gdk_dmabuf_formats_equal", false) | |
| 474 | + | ||
| 422 | 475 | cret := xDmabufFormatsEqual(x.GoPointer(), Formats2Var) | |
| 423 | 476 | return cret | |
| 424 | 477 | } | |
| @@ -428,6 +481,8 @@ var xDmabufFormatsGetFormat func(uintptr, uint, *uint32, *uint64) | |||
| 428 | 481 | // Gets the fourcc code and modifier for a format | |
| 429 | 482 | // that is contained in @formats. | |
| 430 | 483 | func (x *DmabufFormats) GetFormat(IdxVar uint, FourccVar *uint32, ModifierVar *uint64) { | |
| 484 | + | core.LazyRegister(&xDmabufFormatsGetFormat, "GDK", "gdk_dmabuf_formats_get_format", false) | |
| 485 | + | ||
| 431 | 486 | xDmabufFormatsGetFormat(x.GoPointer(), IdxVar, FourccVar, ModifierVar) | |
| 432 | 487 | } | |
| 433 | 488 | ||
| @@ -440,6 +495,8 @@ var xDmabufFormatsGetNFormats func(uintptr) uint | |||
| 440 | 495 | // platforms, [method@Gdk.DmabufFormats.get_n_formats] will | |
| 441 | 496 | // always return zero. | |
| 442 | 497 | func (x *DmabufFormats) GetNFormats() uint { | |
| 498 | + | core.LazyRegister(&xDmabufFormatsGetNFormats, "GDK", "gdk_dmabuf_formats_get_n_formats", false) | |
| 499 | + | ||
| 443 | 500 | cret := xDmabufFormatsGetNFormats(x.GoPointer()) | |
| 444 | 501 | return cret | |
| 445 | 502 | } | |
| @@ -448,6 +505,8 @@ var xDmabufFormatsRef func(uintptr) uintptr | |||
| 448 | 505 | ||
| 449 | 506 | // Increases the reference count of @formats. | |
| 450 | 507 | func (x *DmabufFormats) Ref() *DmabufFormats { | |
| 508 | + | core.LazyRegister(&xDmabufFormatsRef, "GDK", "gdk_dmabuf_formats_ref", false) | |
| 509 | + | ||
| 451 | 510 | cret := xDmabufFormatsRef(x.GoPointer()) | |
| 452 | 511 | if cret == 0 { | |
| 453 | 512 | return nil | |
| @@ -462,6 +521,8 @@ var xDmabufFormatsUnref func(uintptr) | |||
| 462 | 521 | // When the reference count reaches zero, | |
| 463 | 522 | // the object is freed. | |
| 464 | 523 | func (x *DmabufFormats) Unref() { | |
| 524 | + | core.LazyRegister(&xDmabufFormatsUnref, "GDK", "gdk_dmabuf_formats_unref", false) | |
| 525 | + | ||
| 465 | 526 | xDmabufFormatsUnref(x.GoPointer()) | |
| 466 | 527 | } | |
| 467 | 528 | ||
| @@ -518,6 +579,7 @@ type Rectangle struct { | |||
| 518 | 579 | var xRectangleGLibType func() types.GType | |
| 519 | 580 | ||
| 520 | 581 | func RectangleGLibType() types.GType { | |
| 582 | + | core.LazyRegister(&xRectangleGLibType, "GDK", "gdk_rectangle_get_type", false) | |
| 521 | 583 | return xRectangleGLibType() | |
| 522 | 584 | } | |
| 523 | 585 | ||
| @@ -537,6 +599,8 @@ var xRectangleContainsPoint func(uintptr, int, int) bool | |||
| 537 | 599 | ||
| 538 | 600 | // Returns %TRUE if @rect contains the point described by @x and @y. | |
| 539 | 601 | func (x *Rectangle) ContainsPoint(XVar int, YVar int) bool { | |
| 602 | + | core.LazyRegister(&xRectangleContainsPoint, "GDK", "gdk_rectangle_contains_point", false) | |
| 603 | + | ||
| 540 | 604 | cret := xRectangleContainsPoint(x.GoPointer(), XVar, YVar) | |
| 541 | 605 | return cret | |
| 542 | 606 | } | |
| @@ -545,6 +609,8 @@ var xRectangleEqual func(uintptr, *Rectangle) bool | |||
| 545 | 609 | ||
| 546 | 610 | // Checks if the two given rectangles are equal. | |
| 547 | 611 | func (x *Rectangle) Equal(Rect2Var *Rectangle) bool { | |
| 612 | + | core.LazyRegister(&xRectangleEqual, "GDK", "gdk_rectangle_equal", false) | |
| 613 | + | ||
| 548 | 614 | cret := xRectangleEqual(x.GoPointer(), Rect2Var) | |
| 549 | 615 | return cret | |
| 550 | 616 | } | |
| @@ -559,6 +625,8 @@ var xRectangleIntersect func(uintptr, *Rectangle, *Rectangle) bool | |||
| 559 | 625 | // in whether the rectangles intersect, but not in the intersecting area | |
| 560 | 626 | // itself, pass %NULL for @dest. | |
| 561 | 627 | func (x *Rectangle) Intersect(Src2Var *Rectangle, DestVar *Rectangle) bool { | |
| 628 | + | core.LazyRegister(&xRectangleIntersect, "GDK", "gdk_rectangle_intersect", false) | |
| 629 | + | ||
| 562 | 630 | cret := xRectangleIntersect(x.GoPointer(), Src2Var, DestVar) | |
| 563 | 631 | return cret | |
| 564 | 632 | } | |
| @@ -574,6 +642,8 @@ var xRectangleUnion func(uintptr, *Rectangle, *Rectangle) | |||
| 574 | 642 | // Note that this function does not ignore 'empty' rectangles (ie. with | |
| 575 | 643 | // zero width or height). | |
| 576 | 644 | func (x *Rectangle) Union(Src2Var *Rectangle, DestVar *Rectangle) { | |
| 645 | + | core.LazyRegister(&xRectangleUnion, "GDK", "gdk_rectangle_union", false) | |
| 646 | + | ||
| 577 | 647 | xRectangleUnion(x.GoPointer(), Src2Var, DestVar) | |
| 578 | 648 | } | |
| 579 | 649 | ||
| @@ -593,6 +663,7 @@ type TextureDownloader struct { | |||
| 593 | 663 | var xTextureDownloaderGLibType func() types.GType | |
| 594 | 664 | ||
| 595 | 665 | func TextureDownloaderGLibType() types.GType { | |
| 666 | + | core.LazyRegister(&xTextureDownloaderGLibType, "GDK", "gdk_texture_downloader_get_type", false) | |
| 596 | 667 | return xTextureDownloaderGLibType() | |
| 597 | 668 | } | |
| 598 | 669 | ||
| @@ -615,6 +686,8 @@ var xNewTextureDownloader func(uintptr) uintptr | |||
| 615 | 686 | // By default, the downloader will convert the data to | |
| 616 | 687 | // the default memory format, and to the sRGB color state. | |
| 617 | 688 | func NewTextureDownloader(TextureVar *Texture) *TextureDownloader { | |
| 689 | + | core.LazyRegister(&xNewTextureDownloader, "GDK", "gdk_texture_downloader_new", false) | |
| 690 | + | ||
| 618 | 691 | cret := xNewTextureDownloader(TextureVar.GoPointer()) | |
| 619 | 692 | if cret == 0 { | |
| 620 | 693 | return nil | |
| @@ -628,6 +701,8 @@ var xTextureDownloaderCopy func(uintptr) uintptr | |||
| 628 | 701 | // | |
| 629 | 702 | // This function is meant for language bindings. | |
| 630 | 703 | func (x *TextureDownloader) Copy() *TextureDownloader { | |
| 704 | + | core.LazyRegister(&xTextureDownloaderCopy, "GDK", "gdk_texture_downloader_copy", false) | |
| 705 | + | ||
| 631 | 706 | cret := xTextureDownloaderCopy(x.GoPointer()) | |
| 632 | 707 | if cret == 0 { | |
| 633 | 708 | return nil | |
| @@ -648,6 +723,8 @@ var xTextureDownloaderDownloadBytes func(uintptr, *uint) uintptr | |||
| 648 | 723 | // This function cannot be used with a multiplanar format. Use | |
| 649 | 724 | // [method@Gdk.TextureDownloader.download_bytes_with_planes] for that purpose. | |
| 650 | 725 | func (x *TextureDownloader) DownloadBytes(OutStrideVar *uint) *glib.Bytes { | |
| 726 | + | core.LazyRegister(&xTextureDownloaderDownloadBytes, "GDK", "gdk_texture_downloader_download_bytes", false) | |
| 727 | + | ||
| 651 | 728 | cret := xTextureDownloaderDownloadBytes(x.GoPointer(), OutStrideVar) | |
| 652 | 729 | if cret == 0 { | |
| 653 | 730 | return nil | |
| @@ -663,6 +740,8 @@ var xTextureDownloaderDownloadBytesWithPlanes func(uintptr, *[4]uint, *[4]uint) | |||
| 663 | 740 | // If the format does have less than 4 planes, the remaining offsets and strides will be | |
| 664 | 741 | // set to `0`. | |
| 665 | 742 | func (x *TextureDownloader) DownloadBytesWithPlanes(OutOffsetsVar *[4]uint, OutStridesVar *[4]uint) *glib.Bytes { | |
| 743 | + | core.LazyRegister(&xTextureDownloaderDownloadBytesWithPlanes, "GDK", "gdk_texture_downloader_download_bytes_with_planes", false) | |
| 744 | + | ||
| 666 | 745 | cret := xTextureDownloaderDownloadBytesWithPlanes(x.GoPointer(), OutOffsetsVar, OutStridesVar) | |
| 667 | 746 | if cret == 0 { | |
| 668 | 747 | return nil | |
| @@ -676,6 +755,8 @@ var xTextureDownloaderDownloadInto func(uintptr, []byte, uint) | |||
| 676 | 755 | // | |
| 677 | 756 | // This function cannot be used with a multiplanar format. | |
| 678 | 757 | func (x *TextureDownloader) DownloadInto(DataVar []byte, StrideVar uint) { | |
| 758 | + | core.LazyRegister(&xTextureDownloaderDownloadInto, "GDK", "gdk_texture_downloader_download_into", false) | |
| 759 | + | ||
| 679 | 760 | xTextureDownloaderDownloadInto(x.GoPointer(), DataVar, StrideVar) | |
| 680 | 761 | } | |
| 681 | 762 | ||
| @@ -683,6 +764,8 @@ var xTextureDownloaderFree func(uintptr) | |||
| 683 | 764 | ||
| 684 | 765 | // Frees the given downloader and all its associated resources. | |
| 685 | 766 | func (x *TextureDownloader) Free() { | |
| 767 | + | core.LazyRegister(&xTextureDownloaderFree, "GDK", "gdk_texture_downloader_free", false) | |
| 768 | + | ||
| 686 | 769 | xTextureDownloaderFree(x.GoPointer()) | |
| 687 | 770 | } | |
| 688 | 771 | ||
| @@ -690,6 +773,8 @@ var xTextureDownloaderGetColorState func(uintptr) uintptr | |||
| 690 | 773 | ||
| 691 | 774 | // Gets the color state that the data will be downloaded in. | |
| 692 | 775 | func (x *TextureDownloader) GetColorState() *ColorState { | |
| 776 | + | core.LazyRegister(&xTextureDownloaderGetColorState, "GDK", "gdk_texture_downloader_get_color_state", false) | |
| 777 | + | ||
| 693 | 778 | cret := xTextureDownloaderGetColorState(x.GoPointer()) | |
| 694 | 779 | if cret == 0 { | |
| 695 | 780 | return nil | |
| @@ -701,6 +786,8 @@ var xTextureDownloaderGetFormat func(uintptr) MemoryFormat | |||
| 701 | 786 | ||
| 702 | 787 | // Gets the format that the data will be downloaded in. | |
| 703 | 788 | func (x *TextureDownloader) GetFormat() MemoryFormat { | |
| 789 | + | core.LazyRegister(&xTextureDownloaderGetFormat, "GDK", "gdk_texture_downloader_get_format", false) | |
| 790 | + | ||
| 704 | 791 | cret := xTextureDownloaderGetFormat(x.GoPointer()) | |
| 705 | 792 | return cret | |
| 706 | 793 | } | |
| @@ -709,6 +796,7 @@ var xTextureDownloaderGetTexture func(uintptr) uintptr | |||
| 709 | 796 | ||
| 710 | 797 | // Gets the texture that the downloader will download. | |
| 711 | 798 | func (x *TextureDownloader) GetTexture() *Texture { | |
| 799 | + | core.LazyRegister(&xTextureDownloaderGetTexture, "GDK", "gdk_texture_downloader_get_texture", false) | |
| 712 | 800 | var cls *Texture | |
| 713 | 801 | ||
| 714 | 802 | cret := xTextureDownloaderGetTexture(x.GoPointer()) | |
| @@ -729,6 +817,8 @@ var xTextureDownloaderSetColorState func(uintptr, *ColorState) | |||
| 729 | 817 | // By default, the sRGB colorstate returned by [func@ColorState.get_srgb] | |
| 730 | 818 | // is used. | |
| 731 | 819 | func (x *TextureDownloader) SetColorState(ColorStateVar *ColorState) { | |
| 820 | + | core.LazyRegister(&xTextureDownloaderSetColorState, "GDK", "gdk_texture_downloader_set_color_state", false) | |
| 821 | + | ||
| 732 | 822 | xTextureDownloaderSetColorState(x.GoPointer(), ColorStateVar) | |
| 733 | 823 | } | |
| 734 | 824 | ||
| @@ -738,6 +828,8 @@ var xTextureDownloaderSetFormat func(uintptr, MemoryFormat) | |||
| 738 | 828 | // | |
| 739 | 829 | // By default, GDK_MEMORY_DEFAULT is set. | |
| 740 | 830 | func (x *TextureDownloader) SetFormat(FormatVar MemoryFormat) { | |
| 831 | + | core.LazyRegister(&xTextureDownloaderSetFormat, "GDK", "gdk_texture_downloader_set_format", false) | |
| 832 | + | ||
| 741 | 833 | xTextureDownloaderSetFormat(x.GoPointer(), FormatVar) | |
| 742 | 834 | } | |
| 743 | 835 | ||
| @@ -745,6 +837,8 @@ var xTextureDownloaderSetTexture func(uintptr, uintptr) | |||
| 745 | 837 | ||
| 746 | 838 | // Changes the texture the downloader will download. | |
| 747 | 839 | func (x *TextureDownloader) SetTexture(TextureVar *Texture) { | |
| 840 | + | core.LazyRegister(&xTextureDownloaderSetTexture, "GDK", "gdk_texture_downloader_set_texture", false) | |
| 841 | + | ||
| 748 | 842 | xTextureDownloaderSetTexture(x.GoPointer(), TextureVar.GoPointer()) | |
| 749 | 843 | } | |
| 750 | 844 | ||
| @@ -756,75 +850,4 @@ const ( | |||
| 756 | 850 | func init() { | |
| 757 | 851 | core.SetPackageName("GDK", "gtk4") | |
| 758 | 852 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | |
| 759 | - | var libs []uintptr | |
| 760 | - | for _, libPath := range core.GetPaths("GDK") { | |
| 761 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 762 | - | if err != nil { | |
| 763 | - | panic(err) | |
| 764 | - | } | |
| 765 | - | libs = append(libs, lib) | |
| 766 | - | } | |
| 767 | - | ||
| 768 | - | core.PuregoSafeRegister(&xColorStateGLibType, libs, "gdk_color_state_get_type") | |
| 769 | - | ||
| 770 | - | core.PuregoSafeRegister(&xColorStateCreateCicpParams, libs, "gdk_color_state_create_cicp_params") | |
| 771 | - | core.PuregoSafeRegister(&xColorStateEqual, libs, "gdk_color_state_equal") | |
| 772 | - | core.PuregoSafeRegister(&xColorStateEquivalent, libs, "gdk_color_state_equivalent") | |
| 773 | - | core.PuregoSafeRegister(&xColorStateRef, libs, "gdk_color_state_ref") | |
| 774 | - | core.PuregoSafeRegister(&xColorStateUnref, libs, "gdk_color_state_unref") | |
| 775 | - | ||
| 776 | - | core.PuregoSafeRegister(&xContentFormatsGLibType, libs, "gdk_content_formats_get_type") | |
| 777 | - | ||
| 778 | - | core.PuregoSafeRegister(&xNewContentFormats, libs, "gdk_content_formats_new") | |
| 779 | - | core.PuregoSafeRegister(&xNewContentFormatsForGtype, libs, "gdk_content_formats_new_for_gtype") | |
| 780 | - | ||
| 781 | - | core.PuregoSafeRegister(&xContentFormatsContainGtype, libs, "gdk_content_formats_contain_gtype") | |
| 782 | - | core.PuregoSafeRegister(&xContentFormatsContainMimeType, libs, "gdk_content_formats_contain_mime_type") | |
| 783 | - | core.PuregoSafeRegister(&xContentFormatsGetGtypes, libs, "gdk_content_formats_get_gtypes") | |
| 784 | - | core.PuregoSafeRegister(&xContentFormatsGetMimeTypes, libs, "gdk_content_formats_get_mime_types") | |
| 785 | - | core.PuregoSafeRegister(&xContentFormatsIsEmpty, libs, "gdk_content_formats_is_empty") | |
| 786 | - | core.PuregoSafeRegister(&xContentFormatsMatch, libs, "gdk_content_formats_match") | |
| 787 | - | core.PuregoSafeRegister(&xContentFormatsMatchGtype, libs, "gdk_content_formats_match_gtype") | |
| 788 | - | core.PuregoSafeRegister(&xContentFormatsMatchMimeType, libs, "gdk_content_formats_match_mime_type") | |
| 789 | - | core.PuregoSafeRegister(&xContentFormatsPrint, libs, "gdk_content_formats_print") | |
| 790 | - | core.PuregoSafeRegister(&xContentFormatsRef, libs, "gdk_content_formats_ref") | |
| 791 | - | core.PuregoSafeRegister(&xContentFormatsToString, libs, "gdk_content_formats_to_string") | |
| 792 | - | core.PuregoSafeRegister(&xContentFormatsUnion, libs, "gdk_content_formats_union") | |
| 793 | - | core.PuregoSafeRegister(&xContentFormatsUnionDeserializeGtypes, libs, "gdk_content_formats_union_deserialize_gtypes") | |
| 794 | - | core.PuregoSafeRegister(&xContentFormatsUnionDeserializeMimeTypes, libs, "gdk_content_formats_union_deserialize_mime_types") | |
| 795 | - | core.PuregoSafeRegister(&xContentFormatsUnionSerializeGtypes, libs, "gdk_content_formats_union_serialize_gtypes") | |
| 796 | - | core.PuregoSafeRegister(&xContentFormatsUnionSerializeMimeTypes, libs, "gdk_content_formats_union_serialize_mime_types") | |
| 797 | - | core.PuregoSafeRegister(&xContentFormatsUnref, libs, "gdk_content_formats_unref") | |
| 798 | - | ||
| 799 | - | core.PuregoSafeRegister(&xDmabufFormatsGLibType, libs, "gdk_dmabuf_formats_get_type") | |
| 800 | - | ||
| 801 | - | core.PuregoSafeRegister(&xDmabufFormatsContains, libs, "gdk_dmabuf_formats_contains") | |
| 802 | - | core.PuregoSafeRegister(&xDmabufFormatsEqual, libs, "gdk_dmabuf_formats_equal") | |
| 803 | - | core.PuregoSafeRegister(&xDmabufFormatsGetFormat, libs, "gdk_dmabuf_formats_get_format") | |
| 804 | - | core.PuregoSafeRegister(&xDmabufFormatsGetNFormats, libs, "gdk_dmabuf_formats_get_n_formats") | |
| 805 | - | core.PuregoSafeRegister(&xDmabufFormatsRef, libs, "gdk_dmabuf_formats_ref") | |
| 806 | - | core.PuregoSafeRegister(&xDmabufFormatsUnref, libs, "gdk_dmabuf_formats_unref") | |
| 807 | - | ||
| 808 | - | core.PuregoSafeRegister(&xRectangleGLibType, libs, "gdk_rectangle_get_type") | |
| 809 | - | ||
| 810 | - | core.PuregoSafeRegister(&xRectangleContainsPoint, libs, "gdk_rectangle_contains_point") | |
| 811 | - | core.PuregoSafeRegister(&xRectangleEqual, libs, "gdk_rectangle_equal") | |
| 812 | - | core.PuregoSafeRegister(&xRectangleIntersect, libs, "gdk_rectangle_intersect") | |
| 813 | - | core.PuregoSafeRegister(&xRectangleUnion, libs, "gdk_rectangle_union") | |
| 814 | - | ||
| 815 | - | core.PuregoSafeRegister(&xTextureDownloaderGLibType, libs, "gdk_texture_downloader_get_type") | |
| 816 | - | ||
| 817 | - | core.PuregoSafeRegister(&xNewTextureDownloader, libs, "gdk_texture_downloader_new") | |
| 818 | - | ||
| 819 | - | core.PuregoSafeRegister(&xTextureDownloaderCopy, libs, "gdk_texture_downloader_copy") | |
| 820 | - | core.PuregoSafeRegister(&xTextureDownloaderDownloadBytes, libs, "gdk_texture_downloader_download_bytes") | |
| 821 | - | core.PuregoSafeRegister(&xTextureDownloaderDownloadBytesWithPlanes, libs, "gdk_texture_downloader_download_bytes_with_planes") | |
| 822 | - | core.PuregoSafeRegister(&xTextureDownloaderDownloadInto, libs, "gdk_texture_downloader_download_into") | |
| 823 | - | core.PuregoSafeRegister(&xTextureDownloaderFree, libs, "gdk_texture_downloader_free") | |
| 824 | - | core.PuregoSafeRegister(&xTextureDownloaderGetColorState, libs, "gdk_texture_downloader_get_color_state") | |
| 825 | - | core.PuregoSafeRegister(&xTextureDownloaderGetFormat, libs, "gdk_texture_downloader_get_format") | |
| 826 | - | core.PuregoSafeRegister(&xTextureDownloaderGetTexture, libs, "gdk_texture_downloader_get_texture") | |
| 827 | - | core.PuregoSafeRegister(&xTextureDownloaderSetColorState, libs, "gdk_texture_downloader_set_color_state") | |
| 828 | - | core.PuregoSafeRegister(&xTextureDownloaderSetFormat, libs, "gdk_texture_downloader_set_format") | |
| 829 | - | core.PuregoSafeRegister(&xTextureDownloaderSetTexture, libs, "gdk_texture_downloader_set_texture") | |
| 830 | 853 | } | |
| @@ -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" | ||
| @@ -28,6 +27,7 @@ type ColorState struct { | |||||
| 28 | var xColorStateGLibType func() types.GType | 27 | var xColorStateGLibType func() types.GType | ||
| 29 | 28 | ||||
| 30 | func ColorStateGLibType() types.GType { | 29 | func ColorStateGLibType() types.GType { | ||
| 30 | + | core.LazyRegister(&xColorStateGLibType, "GDK", "gdk_color_state_get_type", false) | |||
| 31 | return xColorStateGLibType() | 31 | return xColorStateGLibType() | ||
| 32 | } | 32 | } | ||
| 33 | 33 | ||||
| @@ -51,6 +51,7 @@ var xColorStateCreateCicpParams func(uintptr) uintptr | |||||
| 51 | // represented with Cicp parameters. If that is the case, | 51 | // represented with Cicp parameters. If that is the case, | ||
| 52 | // this function returns `NULL`. | 52 | // this function returns `NULL`. | ||
| 53 | func (x *ColorState) CreateCicpParams() *CicpParams { | 53 | func (x *ColorState) CreateCicpParams() *CicpParams { | ||
| 54 | + | core.LazyRegister(&xColorStateCreateCicpParams, "GDK", "gdk_color_state_create_cicp_params", false) | |||
| 54 | var cls *CicpParams | 55 | var cls *CicpParams | ||
| 55 | 56 | ||||
| 56 | cret := xColorStateCreateCicpParams(x.GoPointer()) | 57 | cret := xColorStateCreateCicpParams(x.GoPointer()) | ||
| @@ -71,6 +72,8 @@ var xColorStateEqual func(uintptr, *ColorState) bool | |||||
| 71 | // describing the same color state may compare not equal. However, different | 72 | // describing the same color state may compare not equal. However, different | ||
| 72 | // color states will never compare equal. | 73 | // color states will never compare equal. | ||
| 73 | func (x *ColorState) Equal(OtherVar *ColorState) bool { | 74 | func (x *ColorState) Equal(OtherVar *ColorState) bool { | ||
| 75 | + | core.LazyRegister(&xColorStateEqual, "GDK", "gdk_color_state_equal", false) | |||
| 76 | + | ||||
| 74 | cret := xColorStateEqual(x.GoPointer(), OtherVar) | 77 | cret := xColorStateEqual(x.GoPointer(), OtherVar) | ||
| 75 | return cret | 78 | return cret | ||
| 76 | } | 79 | } | ||
| @@ -82,6 +85,8 @@ var xColorStateEquivalent func(uintptr, *ColorState) bool | |||||
| 82 | // Two objects that represent the same color state should be equivalent, | 85 | // Two objects that represent the same color state should be equivalent, | ||
| 83 | // even though they may not be equal in the sense of [method@Gdk.ColorState.equal]. | 86 | // even though they may not be equal in the sense of [method@Gdk.ColorState.equal]. | ||
| 84 | func (x *ColorState) Equivalent(OtherVar *ColorState) bool { | 87 | func (x *ColorState) Equivalent(OtherVar *ColorState) bool { | ||
| 88 | + | core.LazyRegister(&xColorStateEquivalent, "GDK", "gdk_color_state_equivalent", false) | |||
| 89 | + | ||||
| 85 | cret := xColorStateEquivalent(x.GoPointer(), OtherVar) | 90 | cret := xColorStateEquivalent(x.GoPointer(), OtherVar) | ||
| 86 | return cret | 91 | return cret | ||
| 87 | } | 92 | } | ||
| @@ -90,6 +95,8 @@ var xColorStateRef func(uintptr) uintptr | |||||
| 90 | 95 | ||||
| 91 | // Increase the reference count of @self. | 96 | // Increase the reference count of @self. | ||
| 92 | func (x *ColorState) Ref() *ColorState { | 97 | func (x *ColorState) Ref() *ColorState { | ||
| 98 | + | core.LazyRegister(&xColorStateRef, "GDK", "gdk_color_state_ref", false) | |||
| 99 | + | ||||
| 93 | cret := xColorStateRef(x.GoPointer()) | 100 | cret := xColorStateRef(x.GoPointer()) | ||
| 94 | if cret == 0 { | 101 | if cret == 0 { | ||
| 95 | return nil | 102 | return nil | ||
| @@ -104,6 +111,8 @@ var xColorStateUnref func(uintptr) | |||||
| 104 | // Unless @self is static, it will be freed | 111 | // Unless @self is static, it will be freed | ||
| 105 | // when the reference count reaches zero. | 112 | // when the reference count reaches zero. | ||
| 106 | func (x *ColorState) Unref() { | 113 | func (x *ColorState) Unref() { | ||
| 114 | + | core.LazyRegister(&xColorStateUnref, "GDK", "gdk_color_state_unref", false) | |||
| 115 | + | ||||
| 107 | xColorStateUnref(x.GoPointer()) | 116 | xColorStateUnref(x.GoPointer()) | ||
| 108 | } | 117 | } | ||
| 109 | 118 | ||||
| @@ -145,6 +154,7 @@ type ContentFormats struct { | |||||
| 145 | var xContentFormatsGLibType func() types.GType | 154 | var xContentFormatsGLibType func() types.GType | ||
| 146 | 155 | ||||
| 147 | func ContentFormatsGLibType() types.GType { | 156 | func ContentFormatsGLibType() types.GType { | ||
| 157 | + | core.LazyRegister(&xContentFormatsGLibType, "GDK", "gdk_content_formats_get_type", false) | |||
| 148 | return xContentFormatsGLibType() | 158 | return xContentFormatsGLibType() | ||
| 149 | } | 159 | } | ||
| 150 | 160 | ||||
| @@ -168,6 +178,8 @@ var xNewContentFormats func([]string, uint) uintptr | |||||
| 168 | // behavior of the return value is undefined. If you cannot guarantee | 178 | // behavior of the return value is undefined. If you cannot guarantee | ||
| 169 | // this, use [struct@Gdk.ContentFormatsBuilder] instead. | 179 | // this, use [struct@Gdk.ContentFormatsBuilder] instead. | ||
| 170 | func NewContentFormats(MimeTypesVar []string, NMimeTypesVar uint) *ContentFormats { | 180 | func NewContentFormats(MimeTypesVar []string, NMimeTypesVar uint) *ContentFormats { | ||
| 181 | + | core.LazyRegister(&xNewContentFormats, "GDK", "gdk_content_formats_new", false) | |||
| 182 | + | ||||
| 171 | cret := xNewContentFormats(MimeTypesVar, NMimeTypesVar) | 183 | cret := xNewContentFormats(MimeTypesVar, NMimeTypesVar) | ||
| 172 | if cret == 0 { | 184 | if cret == 0 { | ||
| 173 | return nil | 185 | return nil | ||
| @@ -179,6 +191,8 @@ var xNewContentFormatsForGtype func(types.GType) uintptr | |||||
| 179 | 191 | ||||
| 180 | // Creates a new `GdkContentFormats` for a given `GType`. | 192 | // Creates a new `GdkContentFormats` for a given `GType`. | ||
| 181 | func NewContentFormatsForGtype(TypeVar types.GType) *ContentFormats { | 193 | func NewContentFormatsForGtype(TypeVar types.GType) *ContentFormats { | ||
| 194 | + | core.LazyRegister(&xNewContentFormatsForGtype, "GDK", "gdk_content_formats_new_for_gtype", false) | |||
| 195 | + | ||||
| 182 | cret := xNewContentFormatsForGtype(TypeVar) | 196 | cret := xNewContentFormatsForGtype(TypeVar) | ||
| 183 | if cret == 0 { | 197 | if cret == 0 { | ||
| 184 | return nil | 198 | return nil | ||
| @@ -190,6 +204,8 @@ var xContentFormatsContainGtype func(uintptr, types.GType) bool | |||||
| 190 | 204 | ||||
| 191 | // Checks if a given `GType` is part of the given @formats. | 205 | // Checks if a given `GType` is part of the given @formats. | ||
| 192 | func (x *ContentFormats) ContainGtype(TypeVar types.GType) bool { | 206 | func (x *ContentFormats) ContainGtype(TypeVar types.GType) bool { | ||
| 207 | + | core.LazyRegister(&xContentFormatsContainGtype, "GDK", "gdk_content_formats_contain_gtype", false) | |||
| 208 | + | ||||
| 193 | cret := xContentFormatsContainGtype(x.GoPointer(), TypeVar) | 209 | cret := xContentFormatsContainGtype(x.GoPointer(), TypeVar) | ||
| 194 | return cret | 210 | return cret | ||
| 195 | } | 211 | } | ||
| @@ -198,6 +214,8 @@ var xContentFormatsContainMimeType func(uintptr, string) bool | |||||
| 198 | 214 | ||||
| 199 | // Checks if a given mime type is part of the given @formats. | 215 | // Checks if a given mime type is part of the given @formats. | ||
| 200 | func (x *ContentFormats) ContainMimeType(MimeTypeVar string) bool { | 216 | func (x *ContentFormats) ContainMimeType(MimeTypeVar string) bool { | ||
| 217 | + | core.LazyRegister(&xContentFormatsContainMimeType, "GDK", "gdk_content_formats_contain_mime_type", false) | |||
| 218 | + | ||||
| 201 | cret := xContentFormatsContainMimeType(x.GoPointer(), MimeTypeVar) | 219 | cret := xContentFormatsContainMimeType(x.GoPointer(), MimeTypeVar) | ||
| 202 | return cret | 220 | return cret | ||
| 203 | } | 221 | } | ||
| @@ -209,6 +227,8 @@ var xContentFormatsGetGtypes func(uintptr, *uint) uintptr | |||||
| 209 | // Note that @formats may not contain any `GType`s, in particular when | 227 | // Note that @formats may not contain any `GType`s, in particular when | ||
| 210 | // they are empty. In that case %NULL will be returned. | 228 | // they are empty. In that case %NULL will be returned. | ||
| 211 | func (x *ContentFormats) GetGtypes(NGtypesVar *uint) uintptr { | 229 | func (x *ContentFormats) GetGtypes(NGtypesVar *uint) uintptr { | ||
| 230 | + | core.LazyRegister(&xContentFormatsGetGtypes, "GDK", "gdk_content_formats_get_gtypes", false) | |||
| 231 | + | ||||
| 212 | cret := xContentFormatsGetGtypes(x.GoPointer(), NGtypesVar) | 232 | cret := xContentFormatsGetGtypes(x.GoPointer(), NGtypesVar) | ||
| 213 | return cret | 233 | return cret | ||
| 214 | } | 234 | } | ||
| @@ -220,6 +240,8 @@ var xContentFormatsGetMimeTypes func(uintptr, *uint) []string | |||||
| 220 | // Note that @formats may not contain any mime types, in particular | 240 | // Note that @formats may not contain any mime types, in particular | ||
| 221 | // when they are empty. In that case %NULL will be returned. | 241 | // when they are empty. In that case %NULL will be returned. | ||
| 222 | func (x *ContentFormats) GetMimeTypes(NMimeTypesVar *uint) []string { | 242 | func (x *ContentFormats) GetMimeTypes(NMimeTypesVar *uint) []string { | ||
| 243 | + | core.LazyRegister(&xContentFormatsGetMimeTypes, "GDK", "gdk_content_formats_get_mime_types", false) | |||
| 244 | + | ||||
| 223 | cret := xContentFormatsGetMimeTypes(x.GoPointer(), NMimeTypesVar) | 245 | cret := xContentFormatsGetMimeTypes(x.GoPointer(), NMimeTypesVar) | ||
| 224 | return cret | 246 | return cret | ||
| 225 | } | 247 | } | ||
| @@ -228,6 +250,8 @@ var xContentFormatsIsEmpty func(uintptr) bool | |||||
| 228 | 250 | ||||
| 229 | // Returns whether the content formats contain any formats. | 251 | // Returns whether the content formats contain any formats. | ||
| 230 | func (x *ContentFormats) IsEmpty() bool { | 252 | func (x *ContentFormats) IsEmpty() bool { | ||
| 253 | + | core.LazyRegister(&xContentFormatsIsEmpty, "GDK", "gdk_content_formats_is_empty", false) | |||
| 254 | + | ||||
| 231 | cret := xContentFormatsIsEmpty(x.GoPointer()) | 255 | cret := xContentFormatsIsEmpty(x.GoPointer()) | ||
| 232 | return cret | 256 | return cret | ||
| 233 | } | 257 | } | ||
| @@ -236,6 +260,8 @@ var xContentFormatsMatch func(uintptr, *ContentFormats) bool | |||||
| 236 | 260 | ||||
| 237 | // Checks if @first and @second have any matching formats. | 261 | // Checks if @first and @second have any matching formats. | ||
| 238 | func (x *ContentFormats) Match(SecondVar *ContentFormats) bool { | 262 | func (x *ContentFormats) Match(SecondVar *ContentFormats) bool { | ||
| 263 | + | core.LazyRegister(&xContentFormatsMatch, "GDK", "gdk_content_formats_match", false) | |||
| 264 | + | ||||
| 239 | cret := xContentFormatsMatch(x.GoPointer(), SecondVar) | 265 | cret := xContentFormatsMatch(x.GoPointer(), SecondVar) | ||
| 240 | return cret | 266 | return cret | ||
| 241 | } | 267 | } | ||
| @@ -247,6 +273,8 @@ var xContentFormatsMatchGtype func(uintptr, *ContentFormats) types.GType | |||||
| 247 | // | 273 | // | ||
| 248 | // If no matching `GType` is found, %G_TYPE_INVALID is returned. | 274 | // If no matching `GType` is found, %G_TYPE_INVALID is returned. | ||
| 249 | func (x *ContentFormats) MatchGtype(SecondVar *ContentFormats) types.GType { | 275 | func (x *ContentFormats) MatchGtype(SecondVar *ContentFormats) types.GType { | ||
| 276 | + | core.LazyRegister(&xContentFormatsMatchGtype, "GDK", "gdk_content_formats_match_gtype", false) | |||
| 277 | + | ||||
| 250 | cret := xContentFormatsMatchGtype(x.GoPointer(), SecondVar) | 278 | cret := xContentFormatsMatchGtype(x.GoPointer(), SecondVar) | ||
| 251 | return cret | 279 | return cret | ||
| 252 | } | 280 | } | ||
| @@ -258,6 +286,8 @@ var xContentFormatsMatchMimeType func(uintptr, *ContentFormats) string | |||||
| 258 | // | 286 | // | ||
| 259 | // If no matching mime type is found, %NULL is returned. | 287 | // If no matching mime type is found, %NULL is returned. | ||
| 260 | func (x *ContentFormats) MatchMimeType(SecondVar *ContentFormats) string { | 288 | func (x *ContentFormats) MatchMimeType(SecondVar *ContentFormats) string { | ||
| 289 | + | core.LazyRegister(&xContentFormatsMatchMimeType, "GDK", "gdk_content_formats_match_mime_type", false) | |||
| 290 | + | ||||
| 261 | cret := xContentFormatsMatchMimeType(x.GoPointer(), SecondVar) | 291 | cret := xContentFormatsMatchMimeType(x.GoPointer(), SecondVar) | ||
| 262 | return cret | 292 | return cret | ||
| 263 | } | 293 | } | ||
| @@ -269,6 +299,8 @@ var xContentFormatsPrint func(uintptr, *glib.String) | |||||
| 269 | // The result of this function can later be parsed with | 299 | // The result of this function can later be parsed with | ||
| 270 | // [func@Gdk.ContentFormats.parse]. | 300 | // [func@Gdk.ContentFormats.parse]. | ||
| 271 | func (x *ContentFormats) Print(StringVar *glib.String) { | 301 | func (x *ContentFormats) Print(StringVar *glib.String) { | ||
| 302 | + | core.LazyRegister(&xContentFormatsPrint, "GDK", "gdk_content_formats_print", false) | |||
| 303 | + | ||||
| 272 | xContentFormatsPrint(x.GoPointer(), StringVar) | 304 | xContentFormatsPrint(x.GoPointer(), StringVar) | ||
| 273 | } | 305 | } | ||
| 274 | 306 | ||||
| @@ -276,6 +308,8 @@ var xContentFormatsRef func(uintptr) uintptr | |||||
| 276 | 308 | ||||
| 277 | // Increases the reference count of a `GdkContentFormats` by one. | 309 | // Increases the reference count of a `GdkContentFormats` by one. | ||
| 278 | func (x *ContentFormats) Ref() *ContentFormats { | 310 | func (x *ContentFormats) Ref() *ContentFormats { | ||
| 311 | + | core.LazyRegister(&xContentFormatsRef, "GDK", "gdk_content_formats_ref", false) | |||
| 312 | + | ||||
| 279 | cret := xContentFormatsRef(x.GoPointer()) | 313 | cret := xContentFormatsRef(x.GoPointer()) | ||
| 280 | if cret == 0 { | 314 | if cret == 0 { | ||
| 281 | return nil | 315 | return nil | ||
| @@ -292,6 +326,8 @@ var xContentFormatsToString func(uintptr) string | |||||
| 292 | // This is a small wrapper around [method@Gdk.ContentFormats.print] | 326 | // This is a small wrapper around [method@Gdk.ContentFormats.print] | ||
| 293 | // to help when debugging. | 327 | // to help when debugging. | ||
| 294 | func (x *ContentFormats) ToString() string { | 328 | func (x *ContentFormats) ToString() string { | ||
| 329 | + | core.LazyRegister(&xContentFormatsToString, "GDK", "gdk_content_formats_to_string", false) | |||
| 330 | + | ||||
| 295 | cret := xContentFormatsToString(x.GoPointer()) | 331 | cret := xContentFormatsToString(x.GoPointer()) | ||
| 296 | return cret | 332 | return cret | ||
| 297 | } | 333 | } | ||
| @@ -301,6 +337,8 @@ var xContentFormatsUnion func(uintptr, *ContentFormats) uintptr | |||||
| 301 | // Append all missing types from @second to @first, in the order | 337 | // Append all missing types from @second to @first, in the order | ||
| 302 | // they had in @second. | 338 | // they had in @second. | ||
| 303 | func (x *ContentFormats) Union(SecondVar *ContentFormats) *ContentFormats { | 339 | func (x *ContentFormats) Union(SecondVar *ContentFormats) *ContentFormats { | ||
| 340 | + | core.LazyRegister(&xContentFormatsUnion, "GDK", "gdk_content_formats_union", false) | |||
| 341 | + | ||||
| 304 | cret := xContentFormatsUnion(x.GoPointer(), SecondVar) | 342 | cret := xContentFormatsUnion(x.GoPointer(), SecondVar) | ||
| 305 | if cret == 0 { | 343 | if cret == 0 { | ||
| 306 | return nil | 344 | return nil | ||
| @@ -313,6 +351,8 @@ var xContentFormatsUnionDeserializeGtypes func(uintptr) uintptr | |||||
| 313 | // Add GTypes for mime types in @formats for which deserializers are | 351 | // Add GTypes for mime types in @formats for which deserializers are | ||
| 314 | // registered. | 352 | // registered. | ||
| 315 | func (x *ContentFormats) UnionDeserializeGtypes() *ContentFormats { | 353 | func (x *ContentFormats) UnionDeserializeGtypes() *ContentFormats { | ||
| 354 | + | core.LazyRegister(&xContentFormatsUnionDeserializeGtypes, "GDK", "gdk_content_formats_union_deserialize_gtypes", false) | |||
| 355 | + | ||||
| 316 | cret := xContentFormatsUnionDeserializeGtypes(x.GoPointer()) | 356 | cret := xContentFormatsUnionDeserializeGtypes(x.GoPointer()) | ||
| 317 | if cret == 0 { | 357 | if cret == 0 { | ||
| 318 | return nil | 358 | return nil | ||
| @@ -325,6 +365,8 @@ var xContentFormatsUnionDeserializeMimeTypes func(uintptr) uintptr | |||||
| 325 | // Add mime types for GTypes in @formats for which deserializers are | 365 | // Add mime types for GTypes in @formats for which deserializers are | ||
| 326 | // registered. | 366 | // registered. | ||
| 327 | func (x *ContentFormats) UnionDeserializeMimeTypes() *ContentFormats { | 367 | func (x *ContentFormats) UnionDeserializeMimeTypes() *ContentFormats { | ||
| 368 | + | core.LazyRegister(&xContentFormatsUnionDeserializeMimeTypes, "GDK", "gdk_content_formats_union_deserialize_mime_types", false) | |||
| 369 | + | ||||
| 328 | cret := xContentFormatsUnionDeserializeMimeTypes(x.GoPointer()) | 370 | cret := xContentFormatsUnionDeserializeMimeTypes(x.GoPointer()) | ||
| 329 | if cret == 0 { | 371 | if cret == 0 { | ||
| 330 | return nil | 372 | return nil | ||
| @@ -337,6 +379,8 @@ var xContentFormatsUnionSerializeGtypes func(uintptr) uintptr | |||||
| 337 | // Add GTypes for the mime types in @formats for which serializers are | 379 | // Add GTypes for the mime types in @formats for which serializers are | ||
| 338 | // registered. | 380 | // registered. | ||
| 339 | func (x *ContentFormats) UnionSerializeGtypes() *ContentFormats { | 381 | func (x *ContentFormats) UnionSerializeGtypes() *ContentFormats { | ||
| 382 | + | core.LazyRegister(&xContentFormatsUnionSerializeGtypes, "GDK", "gdk_content_formats_union_serialize_gtypes", false) | |||
| 383 | + | ||||
| 340 | cret := xContentFormatsUnionSerializeGtypes(x.GoPointer()) | 384 | cret := xContentFormatsUnionSerializeGtypes(x.GoPointer()) | ||
| 341 | if cret == 0 { | 385 | if cret == 0 { | ||
| 342 | return nil | 386 | return nil | ||
| @@ -349,6 +393,8 @@ var xContentFormatsUnionSerializeMimeTypes func(uintptr) uintptr | |||||
| 349 | // Add mime types for GTypes in @formats for which serializers are | 393 | // Add mime types for GTypes in @formats for which serializers are | ||
| 350 | // registered. | 394 | // registered. | ||
| 351 | func (x *ContentFormats) UnionSerializeMimeTypes() *ContentFormats { | 395 | func (x *ContentFormats) UnionSerializeMimeTypes() *ContentFormats { | ||
| 396 | + | core.LazyRegister(&xContentFormatsUnionSerializeMimeTypes, "GDK", "gdk_content_formats_union_serialize_mime_types", false) | |||
| 397 | + | ||||
| 352 | cret := xContentFormatsUnionSerializeMimeTypes(x.GoPointer()) | 398 | cret := xContentFormatsUnionSerializeMimeTypes(x.GoPointer()) | ||
| 353 | if cret == 0 { | 399 | if cret == 0 { | ||
| 354 | return nil | 400 | return nil | ||
| @@ -362,6 +408,8 @@ var xContentFormatsUnref func(uintptr) | |||||
| 362 | // | 408 | // | ||
| 363 | // If the resulting reference count is zero, frees the formats. | 409 | // If the resulting reference count is zero, frees the formats. | ||
| 364 | func (x *ContentFormats) Unref() { | 410 | func (x *ContentFormats) Unref() { | ||
| 411 | + | core.LazyRegister(&xContentFormatsUnref, "GDK", "gdk_content_formats_unref", false) | |||
| 412 | + | ||||
| 365 | xContentFormatsUnref(x.GoPointer()) | 413 | xContentFormatsUnref(x.GoPointer()) | ||
| 366 | } | 414 | } | ||
| 367 | 415 | ||||
| @@ -391,6 +439,7 @@ type DmabufFormats struct { | |||||
| 391 | var xDmabufFormatsGLibType func() types.GType | 439 | var xDmabufFormatsGLibType func() types.GType | ||
| 392 | 440 | ||||
| 393 | func DmabufFormatsGLibType() types.GType { | 441 | func DmabufFormatsGLibType() types.GType { | ||
| 442 | + | core.LazyRegister(&xDmabufFormatsGLibType, "GDK", "gdk_dmabuf_formats_get_type", false) | |||
| 394 | return xDmabufFormatsGLibType() | 443 | return xDmabufFormatsGLibType() | ||
| 395 | } | 444 | } | ||
| 396 | 445 | ||||
| @@ -410,6 +459,8 @@ var xDmabufFormatsContains func(uintptr, uint32, uint64) bool | |||||
| 410 | 459 | ||||
| 411 | // Returns whether a given format is contained in @formats. | 460 | // Returns whether a given format is contained in @formats. | ||
| 412 | func (x *DmabufFormats) Contains(FourccVar uint32, ModifierVar uint64) bool { | 461 | func (x *DmabufFormats) Contains(FourccVar uint32, ModifierVar uint64) bool { | ||
| 462 | + | core.LazyRegister(&xDmabufFormatsContains, "GDK", "gdk_dmabuf_formats_contains", false) | |||
| 463 | + | ||||
| 413 | cret := xDmabufFormatsContains(x.GoPointer(), FourccVar, ModifierVar) | 464 | cret := xDmabufFormatsContains(x.GoPointer(), FourccVar, ModifierVar) | ||
| 414 | return cret | 465 | return cret | ||
| 415 | } | 466 | } | ||
| @@ -419,6 +470,8 @@ var xDmabufFormatsEqual func(uintptr, *DmabufFormats) bool | |||||
| 419 | // Returns whether @formats1 and @formats2 contain the | 470 | // Returns whether @formats1 and @formats2 contain the | ||
| 420 | // same dmabuf formats, in the same order. | 471 | // same dmabuf formats, in the same order. | ||
| 421 | func (x *DmabufFormats) Equal(Formats2Var *DmabufFormats) bool { | 472 | func (x *DmabufFormats) Equal(Formats2Var *DmabufFormats) bool { | ||
| 473 | + | core.LazyRegister(&xDmabufFormatsEqual, "GDK", "gdk_dmabuf_formats_equal", false) | |||
| 474 | + | ||||
| 422 | cret := xDmabufFormatsEqual(x.GoPointer(), Formats2Var) | 475 | cret := xDmabufFormatsEqual(x.GoPointer(), Formats2Var) | ||
| 423 | return cret | 476 | return cret | ||
| 424 | } | 477 | } | ||
| @@ -428,6 +481,8 @@ var xDmabufFormatsGetFormat func(uintptr, uint, *uint32, *uint64) | |||||
| 428 | // Gets the fourcc code and modifier for a format | 481 | // Gets the fourcc code and modifier for a format | ||
| 429 | // that is contained in @formats. | 482 | // that is contained in @formats. | ||
| 430 | func (x *DmabufFormats) GetFormat(IdxVar uint, FourccVar *uint32, ModifierVar *uint64) { | 483 | func (x *DmabufFormats) GetFormat(IdxVar uint, FourccVar *uint32, ModifierVar *uint64) { | ||
| 484 | + | core.LazyRegister(&xDmabufFormatsGetFormat, "GDK", "gdk_dmabuf_formats_get_format", false) | |||
| 485 | + | ||||
| 431 | xDmabufFormatsGetFormat(x.GoPointer(), IdxVar, FourccVar, ModifierVar) | 486 | xDmabufFormatsGetFormat(x.GoPointer(), IdxVar, FourccVar, ModifierVar) | ||
| 432 | } | 487 | } | ||
| 433 | 488 | ||||
| @@ -440,6 +495,8 @@ var xDmabufFormatsGetNFormats func(uintptr) uint | |||||
| 440 | // platforms, [method@Gdk.DmabufFormats.get_n_formats] will | 495 | // platforms, [method@Gdk.DmabufFormats.get_n_formats] will | ||
| 441 | // always return zero. | 496 | // always return zero. | ||
| 442 | func (x *DmabufFormats) GetNFormats() uint { | 497 | func (x *DmabufFormats) GetNFormats() uint { | ||
| 498 | + | core.LazyRegister(&xDmabufFormatsGetNFormats, "GDK", "gdk_dmabuf_formats_get_n_formats", false) | |||
| 499 | + | ||||
| 443 | cret := xDmabufFormatsGetNFormats(x.GoPointer()) | 500 | cret := xDmabufFormatsGetNFormats(x.GoPointer()) | ||
| 444 | return cret | 501 | return cret | ||
| 445 | } | 502 | } | ||
| @@ -448,6 +505,8 @@ var xDmabufFormatsRef func(uintptr) uintptr | |||||
| 448 | 505 | ||||
| 449 | // Increases the reference count of @formats. | 506 | // Increases the reference count of @formats. | ||
| 450 | func (x *DmabufFormats) Ref() *DmabufFormats { | 507 | func (x *DmabufFormats) Ref() *DmabufFormats { | ||
| 508 | + | core.LazyRegister(&xDmabufFormatsRef, "GDK", "gdk_dmabuf_formats_ref", false) | |||
| 509 | + | ||||
| 451 | cret := xDmabufFormatsRef(x.GoPointer()) | 510 | cret := xDmabufFormatsRef(x.GoPointer()) | ||
| 452 | if cret == 0 { | 511 | if cret == 0 { | ||
| 453 | return nil | 512 | return nil | ||
| @@ -462,6 +521,8 @@ var xDmabufFormatsUnref func(uintptr) | |||||
| 462 | // When the reference count reaches zero, | 521 | // When the reference count reaches zero, | ||
| 463 | // the object is freed. | 522 | // the object is freed. | ||
| 464 | func (x *DmabufFormats) Unref() { | 523 | func (x *DmabufFormats) Unref() { | ||
| 524 | + | core.LazyRegister(&xDmabufFormatsUnref, "GDK", "gdk_dmabuf_formats_unref", false) | |||
| 525 | + | ||||
| 465 | xDmabufFormatsUnref(x.GoPointer()) | 526 | xDmabufFormatsUnref(x.GoPointer()) | ||
| 466 | } | 527 | } | ||
| 467 | 528 | ||||
| @@ -518,6 +579,7 @@ type Rectangle struct { | |||||
| 518 | var xRectangleGLibType func() types.GType | 579 | var xRectangleGLibType func() types.GType | ||
| 519 | 580 | ||||
| 520 | func RectangleGLibType() types.GType { | 581 | func RectangleGLibType() types.GType { | ||
| 582 | + | core.LazyRegister(&xRectangleGLibType, "GDK", "gdk_rectangle_get_type", false) | |||
| 521 | return xRectangleGLibType() | 583 | return xRectangleGLibType() | ||
| 522 | } | 584 | } | ||
| 523 | 585 | ||||
| @@ -537,6 +599,8 @@ var xRectangleContainsPoint func(uintptr, int, int) bool | |||||
| 537 | 599 | ||||
| 538 | // Returns %TRUE if @rect contains the point described by @x and @y. | 600 | // Returns %TRUE if @rect contains the point described by @x and @y. | ||
| 539 | func (x *Rectangle) ContainsPoint(XVar int, YVar int) bool { | 601 | func (x *Rectangle) ContainsPoint(XVar int, YVar int) bool { | ||
| 602 | + | core.LazyRegister(&xRectangleContainsPoint, "GDK", "gdk_rectangle_contains_point", false) | |||
| 603 | + | ||||
| 540 | cret := xRectangleContainsPoint(x.GoPointer(), XVar, YVar) | 604 | cret := xRectangleContainsPoint(x.GoPointer(), XVar, YVar) | ||
| 541 | return cret | 605 | return cret | ||
| 542 | } | 606 | } | ||
| @@ -545,6 +609,8 @@ var xRectangleEqual func(uintptr, *Rectangle) bool | |||||
| 545 | 609 | ||||
| 546 | // Checks if the two given rectangles are equal. | 610 | // Checks if the two given rectangles are equal. | ||
| 547 | func (x *Rectangle) Equal(Rect2Var *Rectangle) bool { | 611 | func (x *Rectangle) Equal(Rect2Var *Rectangle) bool { | ||
| 612 | + | core.LazyRegister(&xRectangleEqual, "GDK", "gdk_rectangle_equal", false) | |||
| 613 | + | ||||
| 548 | cret := xRectangleEqual(x.GoPointer(), Rect2Var) | 614 | cret := xRectangleEqual(x.GoPointer(), Rect2Var) | ||
| 549 | return cret | 615 | return cret | ||
| 550 | } | 616 | } | ||
| @@ -559,6 +625,8 @@ var xRectangleIntersect func(uintptr, *Rectangle, *Rectangle) bool | |||||
| 559 | // in whether the rectangles intersect, but not in the intersecting area | 625 | // in whether the rectangles intersect, but not in the intersecting area | ||
| 560 | // itself, pass %NULL for @dest. | 626 | // itself, pass %NULL for @dest. | ||
| 561 | func (x *Rectangle) Intersect(Src2Var *Rectangle, DestVar *Rectangle) bool { | 627 | func (x *Rectangle) Intersect(Src2Var *Rectangle, DestVar *Rectangle) bool { | ||
| 628 | + | core.LazyRegister(&xRectangleIntersect, "GDK", "gdk_rectangle_intersect", false) | |||
| 629 | + | ||||
| 562 | cret := xRectangleIntersect(x.GoPointer(), Src2Var, DestVar) | 630 | cret := xRectangleIntersect(x.GoPointer(), Src2Var, DestVar) | ||
| 563 | return cret | 631 | return cret | ||
| 564 | } | 632 | } | ||
| @@ -574,6 +642,8 @@ var xRectangleUnion func(uintptr, *Rectangle, *Rectangle) | |||||
| 574 | // Note that this function does not ignore 'empty' rectangles (ie. with | 642 | // Note that this function does not ignore 'empty' rectangles (ie. with | ||
| 575 | // zero width or height). | 643 | // zero width or height). | ||
| 576 | func (x *Rectangle) Union(Src2Var *Rectangle, DestVar *Rectangle) { | 644 | func (x *Rectangle) Union(Src2Var *Rectangle, DestVar *Rectangle) { | ||
| 645 | + | core.LazyRegister(&xRectangleUnion, "GDK", "gdk_rectangle_union", false) | |||
| 646 | + | ||||
| 577 | xRectangleUnion(x.GoPointer(), Src2Var, DestVar) | 647 | xRectangleUnion(x.GoPointer(), Src2Var, DestVar) | ||
| 578 | } | 648 | } | ||
| 579 | 649 | ||||
| @@ -593,6 +663,7 @@ type TextureDownloader struct { | |||||
| 593 | var xTextureDownloaderGLibType func() types.GType | 663 | var xTextureDownloaderGLibType func() types.GType | ||
| 594 | 664 | ||||
| 595 | func TextureDownloaderGLibType() types.GType { | 665 | func TextureDownloaderGLibType() types.GType { | ||
| 666 | + | core.LazyRegister(&xTextureDownloaderGLibType, "GDK", "gdk_texture_downloader_get_type", false) | |||
| 596 | return xTextureDownloaderGLibType() | 667 | return xTextureDownloaderGLibType() | ||
| 597 | } | 668 | } | ||
| 598 | 669 | ||||
| @@ -615,6 +686,8 @@ var xNewTextureDownloader func(uintptr) uintptr | |||||
| 615 | // By default, the downloader will convert the data to | 686 | // By default, the downloader will convert the data to | ||
| 616 | // the default memory format, and to the sRGB color state. | 687 | // the default memory format, and to the sRGB color state. | ||
| 617 | func NewTextureDownloader(TextureVar *Texture) *TextureDownloader { | 688 | func NewTextureDownloader(TextureVar *Texture) *TextureDownloader { | ||
| 689 | + | core.LazyRegister(&xNewTextureDownloader, "GDK", "gdk_texture_downloader_new", false) | |||
| 690 | + | ||||
| 618 | cret := xNewTextureDownloader(TextureVar.GoPointer()) | 691 | cret := xNewTextureDownloader(TextureVar.GoPointer()) | ||
| 619 | if cret == 0 { | 692 | if cret == 0 { | ||
| 620 | return nil | 693 | return nil | ||
| @@ -628,6 +701,8 @@ var xTextureDownloaderCopy func(uintptr) uintptr | |||||
| 628 | // | 701 | // | ||
| 629 | // This function is meant for language bindings. | 702 | // This function is meant for language bindings. | ||
| 630 | func (x *TextureDownloader) Copy() *TextureDownloader { | 703 | func (x *TextureDownloader) Copy() *TextureDownloader { | ||
| 704 | + | core.LazyRegister(&xTextureDownloaderCopy, "GDK", "gdk_texture_downloader_copy", false) | |||
| 705 | + | ||||
| 631 | cret := xTextureDownloaderCopy(x.GoPointer()) | 706 | cret := xTextureDownloaderCopy(x.GoPointer()) | ||
| 632 | if cret == 0 { | 707 | if cret == 0 { | ||
| 633 | return nil | 708 | return nil | ||
| @@ -648,6 +723,8 @@ var xTextureDownloaderDownloadBytes func(uintptr, *uint) uintptr | |||||
| 648 | // This function cannot be used with a multiplanar format. Use | 723 | // This function cannot be used with a multiplanar format. Use | ||
| 649 | // [method@Gdk.TextureDownloader.download_bytes_with_planes] for that purpose. | 724 | // [method@Gdk.TextureDownloader.download_bytes_with_planes] for that purpose. | ||
| 650 | func (x *TextureDownloader) DownloadBytes(OutStrideVar *uint) *glib.Bytes { | 725 | func (x *TextureDownloader) DownloadBytes(OutStrideVar *uint) *glib.Bytes { | ||
| 726 | + | core.LazyRegister(&xTextureDownloaderDownloadBytes, "GDK", "gdk_texture_downloader_download_bytes", false) | |||
| 727 | + | ||||
| 651 | cret := xTextureDownloaderDownloadBytes(x.GoPointer(), OutStrideVar) | 728 | cret := xTextureDownloaderDownloadBytes(x.GoPointer(), OutStrideVar) | ||
| 652 | if cret == 0 { | 729 | if cret == 0 { | ||
| 653 | return nil | 730 | return nil | ||
| @@ -663,6 +740,8 @@ var xTextureDownloaderDownloadBytesWithPlanes func(uintptr, *[4]uint, *[4]uint) | |||||
| 663 | // If the format does have less than 4 planes, the remaining offsets and strides will be | 740 | // If the format does have less than 4 planes, the remaining offsets and strides will be | ||
| 664 | // set to `0`. | 741 | // set to `0`. | ||
| 665 | func (x *TextureDownloader) DownloadBytesWithPlanes(OutOffsetsVar *[4]uint, OutStridesVar *[4]uint) *glib.Bytes { | 742 | func (x *TextureDownloader) DownloadBytesWithPlanes(OutOffsetsVar *[4]uint, OutStridesVar *[4]uint) *glib.Bytes { | ||
| 743 | + | core.LazyRegister(&xTextureDownloaderDownloadBytesWithPlanes, "GDK", "gdk_texture_downloader_download_bytes_with_planes", false) | |||
| 744 | + | ||||
| 666 | cret := xTextureDownloaderDownloadBytesWithPlanes(x.GoPointer(), OutOffsetsVar, OutStridesVar) | 745 | cret := xTextureDownloaderDownloadBytesWithPlanes(x.GoPointer(), OutOffsetsVar, OutStridesVar) | ||
| 667 | if cret == 0 { | 746 | if cret == 0 { | ||
| 668 | return nil | 747 | return nil | ||
| @@ -676,6 +755,8 @@ var xTextureDownloaderDownloadInto func(uintptr, []byte, uint) | |||||
| 676 | // | 755 | // | ||
| 677 | // This function cannot be used with a multiplanar format. | 756 | // This function cannot be used with a multiplanar format. | ||
| 678 | func (x *TextureDownloader) DownloadInto(DataVar []byte, StrideVar uint) { | 757 | func (x *TextureDownloader) DownloadInto(DataVar []byte, StrideVar uint) { | ||
| 758 | + | core.LazyRegister(&xTextureDownloaderDownloadInto, "GDK", "gdk_texture_downloader_download_into", false) | |||
| 759 | + | ||||
| 679 | xTextureDownloaderDownloadInto(x.GoPointer(), DataVar, StrideVar) | 760 | xTextureDownloaderDownloadInto(x.GoPointer(), DataVar, StrideVar) | ||
| 680 | } | 761 | } | ||
| 681 | 762 | ||||
| @@ -683,6 +764,8 @@ var xTextureDownloaderFree func(uintptr) | |||||
| 683 | 764 | ||||
| 684 | // Frees the given downloader and all its associated resources. | 765 | // Frees the given downloader and all its associated resources. | ||
| 685 | func (x *TextureDownloader) Free() { | 766 | func (x *TextureDownloader) Free() { | ||
| 767 | + | core.LazyRegister(&xTextureDownloaderFree, "GDK", "gdk_texture_downloader_free", false) | |||
| 768 | + | ||||
| 686 | xTextureDownloaderFree(x.GoPointer()) | 769 | xTextureDownloaderFree(x.GoPointer()) | ||
| 687 | } | 770 | } | ||
| 688 | 771 | ||||
| @@ -690,6 +773,8 @@ var xTextureDownloaderGetColorState func(uintptr) uintptr | |||||
| 690 | 773 | ||||
| 691 | // Gets the color state that the data will be downloaded in. | 774 | // Gets the color state that the data will be downloaded in. | ||
| 692 | func (x *TextureDownloader) GetColorState() *ColorState { | 775 | func (x *TextureDownloader) GetColorState() *ColorState { | ||
| 776 | + | core.LazyRegister(&xTextureDownloaderGetColorState, "GDK", "gdk_texture_downloader_get_color_state", false) | |||
| 777 | + | ||||
| 693 | cret := xTextureDownloaderGetColorState(x.GoPointer()) | 778 | cret := xTextureDownloaderGetColorState(x.GoPointer()) | ||
| 694 | if cret == 0 { | 779 | if cret == 0 { | ||
| 695 | return nil | 780 | return nil | ||
| @@ -701,6 +786,8 @@ var xTextureDownloaderGetFormat func(uintptr) MemoryFormat | |||||
| 701 | 786 | ||||
| 702 | // Gets the format that the data will be downloaded in. | 787 | // Gets the format that the data will be downloaded in. | ||
| 703 | func (x *TextureDownloader) GetFormat() MemoryFormat { | 788 | func (x *TextureDownloader) GetFormat() MemoryFormat { | ||
| 789 | + | core.LazyRegister(&xTextureDownloaderGetFormat, "GDK", "gdk_texture_downloader_get_format", false) | |||
| 790 | + | ||||
| 704 | cret := xTextureDownloaderGetFormat(x.GoPointer()) | 791 | cret := xTextureDownloaderGetFormat(x.GoPointer()) | ||
| 705 | return cret | 792 | return cret | ||
| 706 | } | 793 | } | ||
| @@ -709,6 +796,7 @@ var xTextureDownloaderGetTexture func(uintptr) uintptr | |||||
| 709 | 796 | ||||
| 710 | // Gets the texture that the downloader will download. | 797 | // Gets the texture that the downloader will download. | ||
| 711 | func (x *TextureDownloader) GetTexture() *Texture { | 798 | func (x *TextureDownloader) GetTexture() *Texture { | ||
| 799 | + | core.LazyRegister(&xTextureDownloaderGetTexture, "GDK", "gdk_texture_downloader_get_texture", false) | |||
| 712 | var cls *Texture | 800 | var cls *Texture | ||
| 713 | 801 | ||||
| 714 | cret := xTextureDownloaderGetTexture(x.GoPointer()) | 802 | cret := xTextureDownloaderGetTexture(x.GoPointer()) | ||
| @@ -729,6 +817,8 @@ var xTextureDownloaderSetColorState func(uintptr, *ColorState) | |||||
| 729 | // By default, the sRGB colorstate returned by [func@ColorState.get_srgb] | 817 | // By default, the sRGB colorstate returned by [func@ColorState.get_srgb] | ||
| 730 | // is used. | 818 | // is used. | ||
| 731 | func (x *TextureDownloader) SetColorState(ColorStateVar *ColorState) { | 819 | func (x *TextureDownloader) SetColorState(ColorStateVar *ColorState) { | ||
| 820 | + | core.LazyRegister(&xTextureDownloaderSetColorState, "GDK", "gdk_texture_downloader_set_color_state", false) | |||
| 821 | + | ||||
| 732 | xTextureDownloaderSetColorState(x.GoPointer(), ColorStateVar) | 822 | xTextureDownloaderSetColorState(x.GoPointer(), ColorStateVar) | ||
| 733 | } | 823 | } | ||
| 734 | 824 | ||||
| @@ -738,6 +828,8 @@ var xTextureDownloaderSetFormat func(uintptr, MemoryFormat) | |||||
| 738 | // | 828 | // | ||
| 739 | // By default, GDK_MEMORY_DEFAULT is set. | 829 | // By default, GDK_MEMORY_DEFAULT is set. | ||
| 740 | func (x *TextureDownloader) SetFormat(FormatVar MemoryFormat) { | 830 | func (x *TextureDownloader) SetFormat(FormatVar MemoryFormat) { | ||
| 831 | + | core.LazyRegister(&xTextureDownloaderSetFormat, "GDK", "gdk_texture_downloader_set_format", false) | |||
| 832 | + | ||||
| 741 | xTextureDownloaderSetFormat(x.GoPointer(), FormatVar) | 833 | xTextureDownloaderSetFormat(x.GoPointer(), FormatVar) | ||
| 742 | } | 834 | } | ||
| 743 | 835 | ||||
| @@ -745,6 +837,8 @@ var xTextureDownloaderSetTexture func(uintptr, uintptr) | |||||
| 745 | 837 | ||||
| 746 | // Changes the texture the downloader will download. | 838 | // Changes the texture the downloader will download. | ||
| 747 | func (x *TextureDownloader) SetTexture(TextureVar *Texture) { | 839 | func (x *TextureDownloader) SetTexture(TextureVar *Texture) { | ||
| 840 | + | core.LazyRegister(&xTextureDownloaderSetTexture, "GDK", "gdk_texture_downloader_set_texture", false) | |||
| 841 | + | ||||
| 748 | xTextureDownloaderSetTexture(x.GoPointer(), TextureVar.GoPointer()) | 842 | xTextureDownloaderSetTexture(x.GoPointer(), TextureVar.GoPointer()) | ||
| 749 | } | 843 | } | ||
| 750 | 844 | ||||
| @@ -756,75 +850,4 @@ const ( | |||||
| 756 | func init() { | 850 | func init() { | ||
| 757 | core.SetPackageName("GDK", "gtk4") | 851 | core.SetPackageName("GDK", "gtk4") | ||
| 758 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | 852 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | ||
| 759 | - | var libs []uintptr | |||
| 760 | - | for _, libPath := range core.GetPaths("GDK") { | |||
| 761 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 762 | - | if err != nil { | |||
| 763 | - | panic(err) | |||
| 764 | - | } | |||
| 765 | - | libs = append(libs, lib) | |||
| 766 | - | } | |||
| 767 | - | ||||
| 768 | - | core.PuregoSafeRegister(&xColorStateGLibType, libs, "gdk_color_state_get_type") | |||
| 769 | - | ||||
| 770 | - | core.PuregoSafeRegister(&xColorStateCreateCicpParams, libs, "gdk_color_state_create_cicp_params") | |||
| 771 | - | core.PuregoSafeRegister(&xColorStateEqual, libs, "gdk_color_state_equal") | |||
| 772 | - | core.PuregoSafeRegister(&xColorStateEquivalent, libs, "gdk_color_state_equivalent") | |||
| 773 | - | core.PuregoSafeRegister(&xColorStateRef, libs, "gdk_color_state_ref") | |||
| 774 | - | core.PuregoSafeRegister(&xColorStateUnref, libs, "gdk_color_state_unref") | |||
| 775 | - | ||||
| 776 | - | core.PuregoSafeRegister(&xContentFormatsGLibType, libs, "gdk_content_formats_get_type") | |||
| 777 | - | ||||
| 778 | - | core.PuregoSafeRegister(&xNewContentFormats, libs, "gdk_content_formats_new") | |||
| 779 | - | core.PuregoSafeRegister(&xNewContentFormatsForGtype, libs, "gdk_content_formats_new_for_gtype") | |||
| 780 | - | ||||
| 781 | - | core.PuregoSafeRegister(&xContentFormatsContainGtype, libs, "gdk_content_formats_contain_gtype") | |||
| 782 | - | core.PuregoSafeRegister(&xContentFormatsContainMimeType, libs, "gdk_content_formats_contain_mime_type") | |||
| 783 | - | core.PuregoSafeRegister(&xContentFormatsGetGtypes, libs, "gdk_content_formats_get_gtypes") | |||
| 784 | - | core.PuregoSafeRegister(&xContentFormatsGetMimeTypes, libs, "gdk_content_formats_get_mime_types") | |||
| 785 | - | core.PuregoSafeRegister(&xContentFormatsIsEmpty, libs, "gdk_content_formats_is_empty") | |||
| 786 | - | core.PuregoSafeRegister(&xContentFormatsMatch, libs, "gdk_content_formats_match") | |||
| 787 | - | core.PuregoSafeRegister(&xContentFormatsMatchGtype, libs, "gdk_content_formats_match_gtype") | |||
| 788 | - | core.PuregoSafeRegister(&xContentFormatsMatchMimeType, libs, "gdk_content_formats_match_mime_type") | |||
| 789 | - | core.PuregoSafeRegister(&xContentFormatsPrint, libs, "gdk_content_formats_print") | |||
| 790 | - | core.PuregoSafeRegister(&xContentFormatsRef, libs, "gdk_content_formats_ref") | |||
| 791 | - | core.PuregoSafeRegister(&xContentFormatsToString, libs, "gdk_content_formats_to_string") | |||
| 792 | - | core.PuregoSafeRegister(&xContentFormatsUnion, libs, "gdk_content_formats_union") | |||
| 793 | - | core.PuregoSafeRegister(&xContentFormatsUnionDeserializeGtypes, libs, "gdk_content_formats_union_deserialize_gtypes") | |||
| 794 | - | core.PuregoSafeRegister(&xContentFormatsUnionDeserializeMimeTypes, libs, "gdk_content_formats_union_deserialize_mime_types") | |||
| 795 | - | core.PuregoSafeRegister(&xContentFormatsUnionSerializeGtypes, libs, "gdk_content_formats_union_serialize_gtypes") | |||
| 796 | - | core.PuregoSafeRegister(&xContentFormatsUnionSerializeMimeTypes, libs, "gdk_content_formats_union_serialize_mime_types") | |||
| 797 | - | core.PuregoSafeRegister(&xContentFormatsUnref, libs, "gdk_content_formats_unref") | |||
| 798 | - | ||||
| 799 | - | core.PuregoSafeRegister(&xDmabufFormatsGLibType, libs, "gdk_dmabuf_formats_get_type") | |||
| 800 | - | ||||
| 801 | - | core.PuregoSafeRegister(&xDmabufFormatsContains, libs, "gdk_dmabuf_formats_contains") | |||
| 802 | - | core.PuregoSafeRegister(&xDmabufFormatsEqual, libs, "gdk_dmabuf_formats_equal") | |||
| 803 | - | core.PuregoSafeRegister(&xDmabufFormatsGetFormat, libs, "gdk_dmabuf_formats_get_format") | |||
| 804 | - | core.PuregoSafeRegister(&xDmabufFormatsGetNFormats, libs, "gdk_dmabuf_formats_get_n_formats") | |||
| 805 | - | core.PuregoSafeRegister(&xDmabufFormatsRef, libs, "gdk_dmabuf_formats_ref") | |||
| 806 | - | core.PuregoSafeRegister(&xDmabufFormatsUnref, libs, "gdk_dmabuf_formats_unref") | |||
| 807 | - | ||||
| 808 | - | core.PuregoSafeRegister(&xRectangleGLibType, libs, "gdk_rectangle_get_type") | |||
| 809 | - | ||||
| 810 | - | core.PuregoSafeRegister(&xRectangleContainsPoint, libs, "gdk_rectangle_contains_point") | |||
| 811 | - | core.PuregoSafeRegister(&xRectangleEqual, libs, "gdk_rectangle_equal") | |||
| 812 | - | core.PuregoSafeRegister(&xRectangleIntersect, libs, "gdk_rectangle_intersect") | |||
| 813 | - | core.PuregoSafeRegister(&xRectangleUnion, libs, "gdk_rectangle_union") | |||
| 814 | - | ||||
| 815 | - | core.PuregoSafeRegister(&xTextureDownloaderGLibType, libs, "gdk_texture_downloader_get_type") | |||
| 816 | - | ||||
| 817 | - | core.PuregoSafeRegister(&xNewTextureDownloader, libs, "gdk_texture_downloader_new") | |||
| 818 | - | ||||
| 819 | - | core.PuregoSafeRegister(&xTextureDownloaderCopy, libs, "gdk_texture_downloader_copy") | |||
| 820 | - | core.PuregoSafeRegister(&xTextureDownloaderDownloadBytes, libs, "gdk_texture_downloader_download_bytes") | |||
| 821 | - | core.PuregoSafeRegister(&xTextureDownloaderDownloadBytesWithPlanes, libs, "gdk_texture_downloader_download_bytes_with_planes") | |||
| 822 | - | core.PuregoSafeRegister(&xTextureDownloaderDownloadInto, libs, "gdk_texture_downloader_download_into") | |||
| 823 | - | core.PuregoSafeRegister(&xTextureDownloaderFree, libs, "gdk_texture_downloader_free") | |||
| 824 | - | core.PuregoSafeRegister(&xTextureDownloaderGetColorState, libs, "gdk_texture_downloader_get_color_state") | |||
| 825 | - | core.PuregoSafeRegister(&xTextureDownloaderGetFormat, libs, "gdk_texture_downloader_get_format") | |||
| 826 | - | core.PuregoSafeRegister(&xTextureDownloaderGetTexture, libs, "gdk_texture_downloader_get_texture") | |||
| 827 | - | core.PuregoSafeRegister(&xTextureDownloaderSetColorState, libs, "gdk_texture_downloader_set_color_state") | |||
| 828 | - | core.PuregoSafeRegister(&xTextureDownloaderSetFormat, libs, "gdk_texture_downloader_set_format") | |||
| 829 | - | core.PuregoSafeRegister(&xTextureDownloaderSetTexture, libs, "gdk_texture_downloader_set_texture") | |||
| 830 | } | 853 | } | ||