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
| @@ -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/gdk" | |
| 11 | 10 | "github.com/bnema/puregotk/v4/gobject" | |
| @@ -37,6 +36,7 @@ type FlapFoldPolicy int | |||
| 37 | 36 | var xFlapFoldPolicyGLibType func() types.GType | |
| 38 | 37 | ||
| 39 | 38 | func FlapFoldPolicyGLibType() types.GType { | |
| 39 | + | core.LazyRegister(&xFlapFoldPolicyGLibType, "ADW", "adw_flap_fold_policy_get_type", false) | |
| 40 | 40 | return xFlapFoldPolicyGLibType() | |
| 41 | 41 | } | |
| 42 | 42 | ||
| @@ -62,6 +62,7 @@ type FlapTransitionType int | |||
| 62 | 62 | var xFlapTransitionTypeGLibType func() types.GType | |
| 63 | 63 | ||
| 64 | 64 | func FlapTransitionTypeGLibType() types.GType { | |
| 65 | + | core.LazyRegister(&xFlapTransitionTypeGLibType, "ADW", "adw_flap_transition_type_get_type", false) | |
| 65 | 66 | return xFlapTransitionTypeGLibType() | |
| 66 | 67 | } | |
| 67 | 68 | ||
| @@ -147,6 +148,7 @@ type Flap struct { | |||
| 147 | 148 | var xFlapGLibType func() types.GType | |
| 148 | 149 | ||
| 149 | 150 | func FlapGLibType() types.GType { | |
| 151 | + | core.LazyRegister(&xFlapGLibType, "ADW", "adw_flap_get_type", false) | |
| 150 | 152 | return xFlapGLibType() | |
| 151 | 153 | } | |
| 152 | 154 | ||
| @@ -160,6 +162,7 @@ var xNewFlap func() uintptr | |||
| 160 | 162 | ||
| 161 | 163 | // Creates a new `AdwFlap`. | |
| 162 | 164 | func NewFlap() *Flap { | |
| 165 | + | core.LazyRegister(&xNewFlap, "ADW", "adw_flap_new", false) | |
| 163 | 166 | var cls *Flap | |
| 164 | 167 | ||
| 165 | 168 | cret := xNewFlap() | |
| @@ -177,6 +180,7 @@ var xFlapGetContent func(uintptr) uintptr | |||
| 177 | 180 | ||
| 178 | 181 | // Gets the content widget for @self. | |
| 179 | 182 | func (x *Flap) GetContent() *gtk.Widget { | |
| 183 | + | core.LazyRegister(&xFlapGetContent, "ADW", "adw_flap_get_content", false) | |
| 180 | 184 | var cls *gtk.Widget | |
| 181 | 185 | ||
| 182 | 186 | cret := xFlapGetContent(x.GoPointer()) | |
| @@ -194,6 +198,7 @@ var xFlapGetFlap func(uintptr) uintptr | |||
| 194 | 198 | ||
| 195 | 199 | // Gets the flap widget for @self. | |
| 196 | 200 | func (x *Flap) GetFlap() *gtk.Widget { | |
| 201 | + | core.LazyRegister(&xFlapGetFlap, "ADW", "adw_flap_get_flap", false) | |
| 197 | 202 | var cls *gtk.Widget | |
| 198 | 203 | ||
| 199 | 204 | cret := xFlapGetFlap(x.GoPointer()) | |
| @@ -211,6 +216,8 @@ var xFlapGetFlapPosition func(uintptr) gtk.PackType | |||
| 211 | 216 | ||
| 212 | 217 | // Gets the flap position for @self. | |
| 213 | 218 | func (x *Flap) GetFlapPosition() gtk.PackType { | |
| 219 | + | core.LazyRegister(&xFlapGetFlapPosition, "ADW", "adw_flap_get_flap_position", false) | |
| 220 | + | ||
| 214 | 221 | cret := xFlapGetFlapPosition(x.GoPointer()) | |
| 215 | 222 | return cret | |
| 216 | 223 | } | |
| @@ -219,6 +226,8 @@ var xFlapGetFoldDuration func(uintptr) uint | |||
| 219 | 226 | ||
| 220 | 227 | // Gets the fold transition animation duration for @self, in milliseconds. | |
| 221 | 228 | func (x *Flap) GetFoldDuration() uint { | |
| 229 | + | core.LazyRegister(&xFlapGetFoldDuration, "ADW", "adw_flap_get_fold_duration", false) | |
| 230 | + | ||
| 222 | 231 | cret := xFlapGetFoldDuration(x.GoPointer()) | |
| 223 | 232 | return cret | |
| 224 | 233 | } | |
| @@ -227,6 +236,8 @@ var xFlapGetFoldPolicy func(uintptr) FlapFoldPolicy | |||
| 227 | 236 | ||
| 228 | 237 | // Gets the fold policy for @self. | |
| 229 | 238 | func (x *Flap) GetFoldPolicy() FlapFoldPolicy { | |
| 239 | + | core.LazyRegister(&xFlapGetFoldPolicy, "ADW", "adw_flap_get_fold_policy", false) | |
| 240 | + | ||
| 230 | 241 | cret := xFlapGetFoldPolicy(x.GoPointer()) | |
| 231 | 242 | return cret | |
| 232 | 243 | } | |
| @@ -235,6 +246,8 @@ var xFlapGetFoldThresholdPolicy func(uintptr) FoldThresholdPolicy | |||
| 235 | 246 | ||
| 236 | 247 | // Gets the fold threshold policy for @self. | |
| 237 | 248 | func (x *Flap) GetFoldThresholdPolicy() FoldThresholdPolicy { | |
| 249 | + | core.LazyRegister(&xFlapGetFoldThresholdPolicy, "ADW", "adw_flap_get_fold_threshold_policy", false) | |
| 250 | + | ||
| 238 | 251 | cret := xFlapGetFoldThresholdPolicy(x.GoPointer()) | |
| 239 | 252 | return cret | |
| 240 | 253 | } | |
| @@ -245,6 +258,8 @@ var xFlapGetFolded func(uintptr) bool | |||
| 245 | 258 | // | |
| 246 | 259 | // See [property@Flap:fold-policy]. | |
| 247 | 260 | func (x *Flap) GetFolded() bool { | |
| 261 | + | core.LazyRegister(&xFlapGetFolded, "ADW", "adw_flap_get_folded", false) | |
| 262 | + | ||
| 248 | 263 | cret := xFlapGetFolded(x.GoPointer()) | |
| 249 | 264 | return cret | |
| 250 | 265 | } | |
| @@ -253,6 +268,8 @@ var xFlapGetLocked func(uintptr) bool | |||
| 253 | 268 | ||
| 254 | 269 | // Gets whether @self is locked. | |
| 255 | 270 | func (x *Flap) GetLocked() bool { | |
| 271 | + | core.LazyRegister(&xFlapGetLocked, "ADW", "adw_flap_get_locked", false) | |
| 272 | + | ||
| 256 | 273 | cret := xFlapGetLocked(x.GoPointer()) | |
| 257 | 274 | return cret | |
| 258 | 275 | } | |
| @@ -261,6 +278,8 @@ var xFlapGetModal func(uintptr) bool | |||
| 261 | 278 | ||
| 262 | 279 | // Gets whether @self is modal. | |
| 263 | 280 | func (x *Flap) GetModal() bool { | |
| 281 | + | core.LazyRegister(&xFlapGetModal, "ADW", "adw_flap_get_modal", false) | |
| 282 | + | ||
| 264 | 283 | cret := xFlapGetModal(x.GoPointer()) | |
| 265 | 284 | return cret | |
| 266 | 285 | } | |
| @@ -269,6 +288,8 @@ var xFlapGetRevealFlap func(uintptr) bool | |||
| 269 | 288 | ||
| 270 | 289 | // Gets whether the flap widget is revealed for @self. | |
| 271 | 290 | func (x *Flap) GetRevealFlap() bool { | |
| 291 | + | core.LazyRegister(&xFlapGetRevealFlap, "ADW", "adw_flap_get_reveal_flap", false) | |
| 292 | + | ||
| 272 | 293 | cret := xFlapGetRevealFlap(x.GoPointer()) | |
| 273 | 294 | return cret | |
| 274 | 295 | } | |
| @@ -277,6 +298,8 @@ var xFlapGetRevealParams func(uintptr) uintptr | |||
| 277 | 298 | ||
| 278 | 299 | // Gets the reveal animation spring parameters for @self. | |
| 279 | 300 | func (x *Flap) GetRevealParams() *SpringParams { | |
| 301 | + | core.LazyRegister(&xFlapGetRevealParams, "ADW", "adw_flap_get_reveal_params", false) | |
| 302 | + | ||
| 280 | 303 | cret := xFlapGetRevealParams(x.GoPointer()) | |
| 281 | 304 | if cret == 0 { | |
| 282 | 305 | return nil | |
| @@ -292,6 +315,8 @@ var xFlapGetRevealProgress func(uintptr) float64 | |||
| 292 | 315 | // | |
| 293 | 316 | // See [property@Flap:reveal-flap]. | |
| 294 | 317 | func (x *Flap) GetRevealProgress() float64 { | |
| 318 | + | core.LazyRegister(&xFlapGetRevealProgress, "ADW", "adw_flap_get_reveal_progress", false) | |
| 319 | + | ||
| 295 | 320 | cret := xFlapGetRevealProgress(x.GoPointer()) | |
| 296 | 321 | return cret | |
| 297 | 322 | } | |
| @@ -300,6 +325,7 @@ var xFlapGetSeparator func(uintptr) uintptr | |||
| 300 | 325 | ||
| 301 | 326 | // Gets the separator widget for @self. | |
| 302 | 327 | func (x *Flap) GetSeparator() *gtk.Widget { | |
| 328 | + | core.LazyRegister(&xFlapGetSeparator, "ADW", "adw_flap_get_separator", false) | |
| 303 | 329 | var cls *gtk.Widget | |
| 304 | 330 | ||
| 305 | 331 | cret := xFlapGetSeparator(x.GoPointer()) | |
| @@ -317,6 +343,8 @@ var xFlapGetSwipeToClose func(uintptr) bool | |||
| 317 | 343 | ||
| 318 | 344 | // Gets whether @self can be closed with a swipe gesture. | |
| 319 | 345 | func (x *Flap) GetSwipeToClose() bool { | |
| 346 | + | core.LazyRegister(&xFlapGetSwipeToClose, "ADW", "adw_flap_get_swipe_to_close", false) | |
| 347 | + | ||
| 320 | 348 | cret := xFlapGetSwipeToClose(x.GoPointer()) | |
| 321 | 349 | return cret | |
| 322 | 350 | } | |
| @@ -325,6 +353,8 @@ var xFlapGetSwipeToOpen func(uintptr) bool | |||
| 325 | 353 | ||
| 326 | 354 | // Gets whether @self can be opened with a swipe gesture. | |
| 327 | 355 | func (x *Flap) GetSwipeToOpen() bool { | |
| 356 | + | core.LazyRegister(&xFlapGetSwipeToOpen, "ADW", "adw_flap_get_swipe_to_open", false) | |
| 357 | + | ||
| 328 | 358 | cret := xFlapGetSwipeToOpen(x.GoPointer()) | |
| 329 | 359 | return cret | |
| 330 | 360 | } | |
| @@ -333,6 +363,8 @@ var xFlapGetTransitionType func(uintptr) FlapTransitionType | |||
| 333 | 363 | ||
| 334 | 364 | // Gets the type of animation used for reveal and fold transitions in @self. | |
| 335 | 365 | func (x *Flap) GetTransitionType() FlapTransitionType { | |
| 366 | + | core.LazyRegister(&xFlapGetTransitionType, "ADW", "adw_flap_get_transition_type", false) | |
| 367 | + | ||
| 336 | 368 | cret := xFlapGetTransitionType(x.GoPointer()) | |
| 337 | 369 | return cret | |
| 338 | 370 | } | |
| @@ -343,6 +375,8 @@ var xFlapSetContent func(uintptr, uintptr) | |||
| 343 | 375 | // | |
| 344 | 376 | // It's always displayed when unfolded, and partially visible when folded. | |
| 345 | 377 | func (x *Flap) SetContent(ContentVar *gtk.Widget) { | |
| 378 | + | core.LazyRegister(&xFlapSetContent, "ADW", "adw_flap_set_content", false) | |
| 379 | + | ||
| 346 | 380 | xFlapSetContent(x.GoPointer(), ContentVar.GoPointer()) | |
| 347 | 381 | } | |
| 348 | 382 | ||
| @@ -352,6 +386,8 @@ var xFlapSetFlap func(uintptr, uintptr) | |||
| 352 | 386 | // | |
| 353 | 387 | // It's only visible when [property@Flap:reveal-progress] is greater than 0. | |
| 354 | 388 | func (x *Flap) SetFlap(FlapVar *gtk.Widget) { | |
| 389 | + | core.LazyRegister(&xFlapSetFlap, "ADW", "adw_flap_set_flap", false) | |
| 390 | + | ||
| 355 | 391 | xFlapSetFlap(x.GoPointer(), FlapVar.GoPointer()) | |
| 356 | 392 | } | |
| 357 | 393 | ||
| @@ -362,6 +398,8 @@ var xFlapSetFlapPosition func(uintptr, gtk.PackType) | |||
| 362 | 398 | // If it's set to [enum@Gtk.PackType.start], the flap is displayed before the | |
| 363 | 399 | // content, if [enum@Gtk.PackType.end], it's displayed after the content. | |
| 364 | 400 | func (x *Flap) SetFlapPosition(PositionVar gtk.PackType) { | |
| 401 | + | core.LazyRegister(&xFlapSetFlapPosition, "ADW", "adw_flap_set_flap_position", false) | |
| 402 | + | ||
| 365 | 403 | xFlapSetFlapPosition(x.GoPointer(), PositionVar) | |
| 366 | 404 | } | |
| 367 | 405 | ||
| @@ -369,6 +407,8 @@ var xFlapSetFoldDuration func(uintptr, uint) | |||
| 369 | 407 | ||
| 370 | 408 | // Sets the fold transition animation duration for @self, in milliseconds. | |
| 371 | 409 | func (x *Flap) SetFoldDuration(DurationVar uint) { | |
| 410 | + | core.LazyRegister(&xFlapSetFoldDuration, "ADW", "adw_flap_set_fold_duration", false) | |
| 411 | + | ||
| 372 | 412 | xFlapSetFoldDuration(x.GoPointer(), DurationVar) | |
| 373 | 413 | } | |
| 374 | 414 | ||
| @@ -376,6 +416,8 @@ var xFlapSetFoldPolicy func(uintptr, FlapFoldPolicy) | |||
| 376 | 416 | ||
| 377 | 417 | // Sets the fold policy for @self. | |
| 378 | 418 | func (x *Flap) SetFoldPolicy(PolicyVar FlapFoldPolicy) { | |
| 419 | + | core.LazyRegister(&xFlapSetFoldPolicy, "ADW", "adw_flap_set_fold_policy", false) | |
| 420 | + | ||
| 379 | 421 | xFlapSetFoldPolicy(x.GoPointer(), PolicyVar) | |
| 380 | 422 | } | |
| 381 | 423 | ||
| @@ -390,6 +432,8 @@ var xFlapSetFoldThresholdPolicy func(uintptr, FoldThresholdPolicy) | |||
| 390 | 432 | // This can be useful if you have a long ellipsizing label and want to let it | |
| 391 | 433 | // ellipsize instead of immediately folding. | |
| 392 | 434 | func (x *Flap) SetFoldThresholdPolicy(PolicyVar FoldThresholdPolicy) { | |
| 435 | + | core.LazyRegister(&xFlapSetFoldThresholdPolicy, "ADW", "adw_flap_set_fold_threshold_policy", false) | |
| 436 | + | ||
| 393 | 437 | xFlapSetFoldThresholdPolicy(x.GoPointer(), PolicyVar) | |
| 394 | 438 | } | |
| 395 | 439 | ||
| @@ -401,6 +445,8 @@ var xFlapSetLocked func(uintptr, bool) | |||
| 401 | 445 | // unfolding it when the flap is not revealed opens it. If `TRUE`, | |
| 402 | 446 | // [property@Flap:reveal-flap] value never changes on its own. | |
| 403 | 447 | func (x *Flap) SetLocked(LockedVar bool) { | |
| 448 | + | core.LazyRegister(&xFlapSetLocked, "ADW", "adw_flap_set_locked", false) | |
| 449 | + | ||
| 404 | 450 | xFlapSetLocked(x.GoPointer(), LockedVar) | |
| 405 | 451 | } | |
| 406 | 452 | ||
| @@ -412,6 +458,8 @@ var xFlapSetModal func(uintptr, bool) | |||
| 412 | 458 | // pressing the <kbd>Esc</kbd> key, will close the flap. If `FALSE`, clicks are | |
| 413 | 459 | // passed through to the content widget. | |
| 414 | 460 | func (x *Flap) SetModal(ModalVar bool) { | |
| 461 | + | core.LazyRegister(&xFlapSetModal, "ADW", "adw_flap_set_modal", false) | |
| 462 | + | ||
| 415 | 463 | xFlapSetModal(x.GoPointer(), ModalVar) | |
| 416 | 464 | } | |
| 417 | 465 | ||
| @@ -419,6 +467,8 @@ var xFlapSetRevealFlap func(uintptr, bool) | |||
| 419 | 467 | ||
| 420 | 468 | // Sets whether the flap widget is revealed for @self. | |
| 421 | 469 | func (x *Flap) SetRevealFlap(RevealFlapVar bool) { | |
| 470 | + | core.LazyRegister(&xFlapSetRevealFlap, "ADW", "adw_flap_set_reveal_flap", false) | |
| 471 | + | ||
| 422 | 472 | xFlapSetRevealFlap(x.GoPointer(), RevealFlapVar) | |
| 423 | 473 | } | |
| 424 | 474 | ||
| @@ -432,6 +482,8 @@ var xFlapSetRevealParams func(uintptr, *SpringParams) | |||
| 432 | 482 | // adw_spring_params_new (1, 0.5, 500) | |
| 433 | 483 | // ``` | |
| 434 | 484 | func (x *Flap) SetRevealParams(ParamsVar *SpringParams) { | |
| 485 | + | core.LazyRegister(&xFlapSetRevealParams, "ADW", "adw_flap_set_reveal_params", false) | |
| 486 | + | ||
| 435 | 487 | xFlapSetRevealParams(x.GoPointer(), ParamsVar) | |
| 436 | 488 | } | |
| 437 | 489 | ||
| @@ -443,6 +495,8 @@ var xFlapSetSeparator func(uintptr, uintptr) | |||
| 443 | 495 | // When exactly it's visible depends on the [property@Flap:transition-type] | |
| 444 | 496 | // value. | |
| 445 | 497 | func (x *Flap) SetSeparator(SeparatorVar *gtk.Widget) { | |
| 498 | + | core.LazyRegister(&xFlapSetSeparator, "ADW", "adw_flap_set_separator", false) | |
| 499 | + | ||
| 446 | 500 | xFlapSetSeparator(x.GoPointer(), SeparatorVar.GoPointer()) | |
| 447 | 501 | } | |
| 448 | 502 | ||
| @@ -453,6 +507,8 @@ var xFlapSetSwipeToClose func(uintptr, bool) | |||
| 453 | 507 | // The area that can be swiped depends on the [property@Flap:transition-type] | |
| 454 | 508 | // value. | |
| 455 | 509 | func (x *Flap) SetSwipeToClose(SwipeToCloseVar bool) { | |
| 510 | + | core.LazyRegister(&xFlapSetSwipeToClose, "ADW", "adw_flap_set_swipe_to_close", false) | |
| 511 | + | ||
| 456 | 512 | xFlapSetSwipeToClose(x.GoPointer(), SwipeToCloseVar) | |
| 457 | 513 | } | |
| 458 | 514 | ||
| @@ -463,6 +519,8 @@ var xFlapSetSwipeToOpen func(uintptr, bool) | |||
| 463 | 519 | // The area that can be swiped depends on the [property@Flap:transition-type] | |
| 464 | 520 | // value. | |
| 465 | 521 | func (x *Flap) SetSwipeToOpen(SwipeToOpenVar bool) { | |
| 522 | + | core.LazyRegister(&xFlapSetSwipeToOpen, "ADW", "adw_flap_set_swipe_to_open", false) | |
| 523 | + | ||
| 466 | 524 | xFlapSetSwipeToOpen(x.GoPointer(), SwipeToOpenVar) | |
| 467 | 525 | } | |
| 468 | 526 | ||
| @@ -475,6 +533,8 @@ var xFlapSetTransitionType func(uintptr, FlapTransitionType) | |||
| 475 | 533 | // the [`.background`](style-classes.html#background) style class to it if this | |
| 476 | 534 | // is unwanted. | |
| 477 | 535 | func (x *Flap) SetTransitionType(TransitionTypeVar FlapTransitionType) { | |
| 536 | + | core.LazyRegister(&xFlapSetTransitionType, "ADW", "adw_flap_set_transition_type", false) | |
| 537 | + | ||
| 478 | 538 | xFlapSetTransitionType(x.GoPointer(), TransitionTypeVar) | |
| 479 | 539 | } | |
| 480 | 540 | ||
| @@ -986,51 +1046,4 @@ func (x *Flap) SetOrientation(OrientationVar gtk.Orientation) { | |||
| 986 | 1046 | func init() { | |
| 987 | 1047 | core.SetPackageName("ADW", "libadwaita-1") | |
| 988 | 1048 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | |
| 989 | - | var libs []uintptr | |
| 990 | - | for _, libPath := range core.GetPaths("ADW") { | |
| 991 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 992 | - | if err != nil { | |
| 993 | - | panic(err) | |
| 994 | - | } | |
| 995 | - | libs = append(libs, lib) | |
| 996 | - | } | |
| 997 | - | ||
| 998 | - | core.PuregoSafeRegister(&xFlapFoldPolicyGLibType, libs, "adw_flap_fold_policy_get_type") | |
| 999 | - | ||
| 1000 | - | core.PuregoSafeRegister(&xFlapTransitionTypeGLibType, libs, "adw_flap_transition_type_get_type") | |
| 1001 | - | ||
| 1002 | - | core.PuregoSafeRegister(&xFlapGLibType, libs, "adw_flap_get_type") | |
| 1003 | - | ||
| 1004 | - | core.PuregoSafeRegister(&xNewFlap, libs, "adw_flap_new") | |
| 1005 | - | ||
| 1006 | - | core.PuregoSafeRegister(&xFlapGetContent, libs, "adw_flap_get_content") | |
| 1007 | - | core.PuregoSafeRegister(&xFlapGetFlap, libs, "adw_flap_get_flap") | |
| 1008 | - | core.PuregoSafeRegister(&xFlapGetFlapPosition, libs, "adw_flap_get_flap_position") | |
| 1009 | - | core.PuregoSafeRegister(&xFlapGetFoldDuration, libs, "adw_flap_get_fold_duration") | |
| 1010 | - | core.PuregoSafeRegister(&xFlapGetFoldPolicy, libs, "adw_flap_get_fold_policy") | |
| 1011 | - | core.PuregoSafeRegister(&xFlapGetFoldThresholdPolicy, libs, "adw_flap_get_fold_threshold_policy") | |
| 1012 | - | core.PuregoSafeRegister(&xFlapGetFolded, libs, "adw_flap_get_folded") | |
| 1013 | - | core.PuregoSafeRegister(&xFlapGetLocked, libs, "adw_flap_get_locked") | |
| 1014 | - | core.PuregoSafeRegister(&xFlapGetModal, libs, "adw_flap_get_modal") | |
| 1015 | - | core.PuregoSafeRegister(&xFlapGetRevealFlap, libs, "adw_flap_get_reveal_flap") | |
| 1016 | - | core.PuregoSafeRegister(&xFlapGetRevealParams, libs, "adw_flap_get_reveal_params") | |
| 1017 | - | core.PuregoSafeRegister(&xFlapGetRevealProgress, libs, "adw_flap_get_reveal_progress") | |
| 1018 | - | core.PuregoSafeRegister(&xFlapGetSeparator, libs, "adw_flap_get_separator") | |
| 1019 | - | core.PuregoSafeRegister(&xFlapGetSwipeToClose, libs, "adw_flap_get_swipe_to_close") | |
| 1020 | - | core.PuregoSafeRegister(&xFlapGetSwipeToOpen, libs, "adw_flap_get_swipe_to_open") | |
| 1021 | - | core.PuregoSafeRegister(&xFlapGetTransitionType, libs, "adw_flap_get_transition_type") | |
| 1022 | - | core.PuregoSafeRegister(&xFlapSetContent, libs, "adw_flap_set_content") | |
| 1023 | - | core.PuregoSafeRegister(&xFlapSetFlap, libs, "adw_flap_set_flap") | |
| 1024 | - | core.PuregoSafeRegister(&xFlapSetFlapPosition, libs, "adw_flap_set_flap_position") | |
| 1025 | - | core.PuregoSafeRegister(&xFlapSetFoldDuration, libs, "adw_flap_set_fold_duration") | |
| 1026 | - | core.PuregoSafeRegister(&xFlapSetFoldPolicy, libs, "adw_flap_set_fold_policy") | |
| 1027 | - | core.PuregoSafeRegister(&xFlapSetFoldThresholdPolicy, libs, "adw_flap_set_fold_threshold_policy") | |
| 1028 | - | core.PuregoSafeRegister(&xFlapSetLocked, libs, "adw_flap_set_locked") | |
| 1029 | - | core.PuregoSafeRegister(&xFlapSetModal, libs, "adw_flap_set_modal") | |
| 1030 | - | core.PuregoSafeRegister(&xFlapSetRevealFlap, libs, "adw_flap_set_reveal_flap") | |
| 1031 | - | core.PuregoSafeRegister(&xFlapSetRevealParams, libs, "adw_flap_set_reveal_params") | |
| 1032 | - | core.PuregoSafeRegister(&xFlapSetSeparator, libs, "adw_flap_set_separator") | |
| 1033 | - | core.PuregoSafeRegister(&xFlapSetSwipeToClose, libs, "adw_flap_set_swipe_to_close") | |
| 1034 | - | core.PuregoSafeRegister(&xFlapSetSwipeToOpen, libs, "adw_flap_set_swipe_to_open") | |
| 1035 | - | core.PuregoSafeRegister(&xFlapSetTransitionType, libs, "adw_flap_set_transition_type") | |
| 1036 | 1049 | } | |
| @@ -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/gdk" | 9 | "github.com/bnema/puregotk/v4/gdk" | ||
| 11 | "github.com/bnema/puregotk/v4/gobject" | 10 | "github.com/bnema/puregotk/v4/gobject" | ||
| @@ -37,6 +36,7 @@ type FlapFoldPolicy int | |||||
| 37 | var xFlapFoldPolicyGLibType func() types.GType | 36 | var xFlapFoldPolicyGLibType func() types.GType | ||
| 38 | 37 | ||||
| 39 | func FlapFoldPolicyGLibType() types.GType { | 38 | func FlapFoldPolicyGLibType() types.GType { | ||
| 39 | + | core.LazyRegister(&xFlapFoldPolicyGLibType, "ADW", "adw_flap_fold_policy_get_type", false) | |||
| 40 | return xFlapFoldPolicyGLibType() | 40 | return xFlapFoldPolicyGLibType() | ||
| 41 | } | 41 | } | ||
| 42 | 42 | ||||
| @@ -62,6 +62,7 @@ type FlapTransitionType int | |||||
| 62 | var xFlapTransitionTypeGLibType func() types.GType | 62 | var xFlapTransitionTypeGLibType func() types.GType | ||
| 63 | 63 | ||||
| 64 | func FlapTransitionTypeGLibType() types.GType { | 64 | func FlapTransitionTypeGLibType() types.GType { | ||
| 65 | + | core.LazyRegister(&xFlapTransitionTypeGLibType, "ADW", "adw_flap_transition_type_get_type", false) | |||
| 65 | return xFlapTransitionTypeGLibType() | 66 | return xFlapTransitionTypeGLibType() | ||
| 66 | } | 67 | } | ||
| 67 | 68 | ||||
| @@ -147,6 +148,7 @@ type Flap struct { | |||||
| 147 | var xFlapGLibType func() types.GType | 148 | var xFlapGLibType func() types.GType | ||
| 148 | 149 | ||||
| 149 | func FlapGLibType() types.GType { | 150 | func FlapGLibType() types.GType { | ||
| 151 | + | core.LazyRegister(&xFlapGLibType, "ADW", "adw_flap_get_type", false) | |||
| 150 | return xFlapGLibType() | 152 | return xFlapGLibType() | ||
| 151 | } | 153 | } | ||
| 152 | 154 | ||||
| @@ -160,6 +162,7 @@ var xNewFlap func() uintptr | |||||
| 160 | 162 | ||||
| 161 | // Creates a new `AdwFlap`. | 163 | // Creates a new `AdwFlap`. | ||
| 162 | func NewFlap() *Flap { | 164 | func NewFlap() *Flap { | ||
| 165 | + | core.LazyRegister(&xNewFlap, "ADW", "adw_flap_new", false) | |||
| 163 | var cls *Flap | 166 | var cls *Flap | ||
| 164 | 167 | ||||
| 165 | cret := xNewFlap() | 168 | cret := xNewFlap() | ||
| @@ -177,6 +180,7 @@ var xFlapGetContent func(uintptr) uintptr | |||||
| 177 | 180 | ||||
| 178 | // Gets the content widget for @self. | 181 | // Gets the content widget for @self. | ||
| 179 | func (x *Flap) GetContent() *gtk.Widget { | 182 | func (x *Flap) GetContent() *gtk.Widget { | ||
| 183 | + | core.LazyRegister(&xFlapGetContent, "ADW", "adw_flap_get_content", false) | |||
| 180 | var cls *gtk.Widget | 184 | var cls *gtk.Widget | ||
| 181 | 185 | ||||
| 182 | cret := xFlapGetContent(x.GoPointer()) | 186 | cret := xFlapGetContent(x.GoPointer()) | ||
| @@ -194,6 +198,7 @@ var xFlapGetFlap func(uintptr) uintptr | |||||
| 194 | 198 | ||||
| 195 | // Gets the flap widget for @self. | 199 | // Gets the flap widget for @self. | ||
| 196 | func (x *Flap) GetFlap() *gtk.Widget { | 200 | func (x *Flap) GetFlap() *gtk.Widget { | ||
| 201 | + | core.LazyRegister(&xFlapGetFlap, "ADW", "adw_flap_get_flap", false) | |||
| 197 | var cls *gtk.Widget | 202 | var cls *gtk.Widget | ||
| 198 | 203 | ||||
| 199 | cret := xFlapGetFlap(x.GoPointer()) | 204 | cret := xFlapGetFlap(x.GoPointer()) | ||
| @@ -211,6 +216,8 @@ var xFlapGetFlapPosition func(uintptr) gtk.PackType | |||||
| 211 | 216 | ||||
| 212 | // Gets the flap position for @self. | 217 | // Gets the flap position for @self. | ||
| 213 | func (x *Flap) GetFlapPosition() gtk.PackType { | 218 | func (x *Flap) GetFlapPosition() gtk.PackType { | ||
| 219 | + | core.LazyRegister(&xFlapGetFlapPosition, "ADW", "adw_flap_get_flap_position", false) | |||
| 220 | + | ||||
| 214 | cret := xFlapGetFlapPosition(x.GoPointer()) | 221 | cret := xFlapGetFlapPosition(x.GoPointer()) | ||
| 215 | return cret | 222 | return cret | ||
| 216 | } | 223 | } | ||
| @@ -219,6 +226,8 @@ var xFlapGetFoldDuration func(uintptr) uint | |||||
| 219 | 226 | ||||
| 220 | // Gets the fold transition animation duration for @self, in milliseconds. | 227 | // Gets the fold transition animation duration for @self, in milliseconds. | ||
| 221 | func (x *Flap) GetFoldDuration() uint { | 228 | func (x *Flap) GetFoldDuration() uint { | ||
| 229 | + | core.LazyRegister(&xFlapGetFoldDuration, "ADW", "adw_flap_get_fold_duration", false) | |||
| 230 | + | ||||
| 222 | cret := xFlapGetFoldDuration(x.GoPointer()) | 231 | cret := xFlapGetFoldDuration(x.GoPointer()) | ||
| 223 | return cret | 232 | return cret | ||
| 224 | } | 233 | } | ||
| @@ -227,6 +236,8 @@ var xFlapGetFoldPolicy func(uintptr) FlapFoldPolicy | |||||
| 227 | 236 | ||||
| 228 | // Gets the fold policy for @self. | 237 | // Gets the fold policy for @self. | ||
| 229 | func (x *Flap) GetFoldPolicy() FlapFoldPolicy { | 238 | func (x *Flap) GetFoldPolicy() FlapFoldPolicy { | ||
| 239 | + | core.LazyRegister(&xFlapGetFoldPolicy, "ADW", "adw_flap_get_fold_policy", false) | |||
| 240 | + | ||||
| 230 | cret := xFlapGetFoldPolicy(x.GoPointer()) | 241 | cret := xFlapGetFoldPolicy(x.GoPointer()) | ||
| 231 | return cret | 242 | return cret | ||
| 232 | } | 243 | } | ||
| @@ -235,6 +246,8 @@ var xFlapGetFoldThresholdPolicy func(uintptr) FoldThresholdPolicy | |||||
| 235 | 246 | ||||
| 236 | // Gets the fold threshold policy for @self. | 247 | // Gets the fold threshold policy for @self. | ||
| 237 | func (x *Flap) GetFoldThresholdPolicy() FoldThresholdPolicy { | 248 | func (x *Flap) GetFoldThresholdPolicy() FoldThresholdPolicy { | ||
| 249 | + | core.LazyRegister(&xFlapGetFoldThresholdPolicy, "ADW", "adw_flap_get_fold_threshold_policy", false) | |||
| 250 | + | ||||
| 238 | cret := xFlapGetFoldThresholdPolicy(x.GoPointer()) | 251 | cret := xFlapGetFoldThresholdPolicy(x.GoPointer()) | ||
| 239 | return cret | 252 | return cret | ||
| 240 | } | 253 | } | ||
| @@ -245,6 +258,8 @@ var xFlapGetFolded func(uintptr) bool | |||||
| 245 | // | 258 | // | ||
| 246 | // See [property@Flap:fold-policy]. | 259 | // See [property@Flap:fold-policy]. | ||
| 247 | func (x *Flap) GetFolded() bool { | 260 | func (x *Flap) GetFolded() bool { | ||
| 261 | + | core.LazyRegister(&xFlapGetFolded, "ADW", "adw_flap_get_folded", false) | |||
| 262 | + | ||||
| 248 | cret := xFlapGetFolded(x.GoPointer()) | 263 | cret := xFlapGetFolded(x.GoPointer()) | ||
| 249 | return cret | 264 | return cret | ||
| 250 | } | 265 | } | ||
| @@ -253,6 +268,8 @@ var xFlapGetLocked func(uintptr) bool | |||||
| 253 | 268 | ||||
| 254 | // Gets whether @self is locked. | 269 | // Gets whether @self is locked. | ||
| 255 | func (x *Flap) GetLocked() bool { | 270 | func (x *Flap) GetLocked() bool { | ||
| 271 | + | core.LazyRegister(&xFlapGetLocked, "ADW", "adw_flap_get_locked", false) | |||
| 272 | + | ||||
| 256 | cret := xFlapGetLocked(x.GoPointer()) | 273 | cret := xFlapGetLocked(x.GoPointer()) | ||
| 257 | return cret | 274 | return cret | ||
| 258 | } | 275 | } | ||
| @@ -261,6 +278,8 @@ var xFlapGetModal func(uintptr) bool | |||||
| 261 | 278 | ||||
| 262 | // Gets whether @self is modal. | 279 | // Gets whether @self is modal. | ||
| 263 | func (x *Flap) GetModal() bool { | 280 | func (x *Flap) GetModal() bool { | ||
| 281 | + | core.LazyRegister(&xFlapGetModal, "ADW", "adw_flap_get_modal", false) | |||
| 282 | + | ||||
| 264 | cret := xFlapGetModal(x.GoPointer()) | 283 | cret := xFlapGetModal(x.GoPointer()) | ||
| 265 | return cret | 284 | return cret | ||
| 266 | } | 285 | } | ||
| @@ -269,6 +288,8 @@ var xFlapGetRevealFlap func(uintptr) bool | |||||
| 269 | 288 | ||||
| 270 | // Gets whether the flap widget is revealed for @self. | 289 | // Gets whether the flap widget is revealed for @self. | ||
| 271 | func (x *Flap) GetRevealFlap() bool { | 290 | func (x *Flap) GetRevealFlap() bool { | ||
| 291 | + | core.LazyRegister(&xFlapGetRevealFlap, "ADW", "adw_flap_get_reveal_flap", false) | |||
| 292 | + | ||||
| 272 | cret := xFlapGetRevealFlap(x.GoPointer()) | 293 | cret := xFlapGetRevealFlap(x.GoPointer()) | ||
| 273 | return cret | 294 | return cret | ||
| 274 | } | 295 | } | ||
| @@ -277,6 +298,8 @@ var xFlapGetRevealParams func(uintptr) uintptr | |||||
| 277 | 298 | ||||
| 278 | // Gets the reveal animation spring parameters for @self. | 299 | // Gets the reveal animation spring parameters for @self. | ||
| 279 | func (x *Flap) GetRevealParams() *SpringParams { | 300 | func (x *Flap) GetRevealParams() *SpringParams { | ||
| 301 | + | core.LazyRegister(&xFlapGetRevealParams, "ADW", "adw_flap_get_reveal_params", false) | |||
| 302 | + | ||||
| 280 | cret := xFlapGetRevealParams(x.GoPointer()) | 303 | cret := xFlapGetRevealParams(x.GoPointer()) | ||
| 281 | if cret == 0 { | 304 | if cret == 0 { | ||
| 282 | return nil | 305 | return nil | ||
| @@ -292,6 +315,8 @@ var xFlapGetRevealProgress func(uintptr) float64 | |||||
| 292 | // | 315 | // | ||
| 293 | // See [property@Flap:reveal-flap]. | 316 | // See [property@Flap:reveal-flap]. | ||
| 294 | func (x *Flap) GetRevealProgress() float64 { | 317 | func (x *Flap) GetRevealProgress() float64 { | ||
| 318 | + | core.LazyRegister(&xFlapGetRevealProgress, "ADW", "adw_flap_get_reveal_progress", false) | |||
| 319 | + | ||||
| 295 | cret := xFlapGetRevealProgress(x.GoPointer()) | 320 | cret := xFlapGetRevealProgress(x.GoPointer()) | ||
| 296 | return cret | 321 | return cret | ||
| 297 | } | 322 | } | ||
| @@ -300,6 +325,7 @@ var xFlapGetSeparator func(uintptr) uintptr | |||||
| 300 | 325 | ||||
| 301 | // Gets the separator widget for @self. | 326 | // Gets the separator widget for @self. | ||
| 302 | func (x *Flap) GetSeparator() *gtk.Widget { | 327 | func (x *Flap) GetSeparator() *gtk.Widget { | ||
| 328 | + | core.LazyRegister(&xFlapGetSeparator, "ADW", "adw_flap_get_separator", false) | |||
| 303 | var cls *gtk.Widget | 329 | var cls *gtk.Widget | ||
| 304 | 330 | ||||
| 305 | cret := xFlapGetSeparator(x.GoPointer()) | 331 | cret := xFlapGetSeparator(x.GoPointer()) | ||
| @@ -317,6 +343,8 @@ var xFlapGetSwipeToClose func(uintptr) bool | |||||
| 317 | 343 | ||||
| 318 | // Gets whether @self can be closed with a swipe gesture. | 344 | // Gets whether @self can be closed with a swipe gesture. | ||
| 319 | func (x *Flap) GetSwipeToClose() bool { | 345 | func (x *Flap) GetSwipeToClose() bool { | ||
| 346 | + | core.LazyRegister(&xFlapGetSwipeToClose, "ADW", "adw_flap_get_swipe_to_close", false) | |||
| 347 | + | ||||
| 320 | cret := xFlapGetSwipeToClose(x.GoPointer()) | 348 | cret := xFlapGetSwipeToClose(x.GoPointer()) | ||
| 321 | return cret | 349 | return cret | ||
| 322 | } | 350 | } | ||
| @@ -325,6 +353,8 @@ var xFlapGetSwipeToOpen func(uintptr) bool | |||||
| 325 | 353 | ||||
| 326 | // Gets whether @self can be opened with a swipe gesture. | 354 | // Gets whether @self can be opened with a swipe gesture. | ||
| 327 | func (x *Flap) GetSwipeToOpen() bool { | 355 | func (x *Flap) GetSwipeToOpen() bool { | ||
| 356 | + | core.LazyRegister(&xFlapGetSwipeToOpen, "ADW", "adw_flap_get_swipe_to_open", false) | |||
| 357 | + | ||||
| 328 | cret := xFlapGetSwipeToOpen(x.GoPointer()) | 358 | cret := xFlapGetSwipeToOpen(x.GoPointer()) | ||
| 329 | return cret | 359 | return cret | ||
| 330 | } | 360 | } | ||
| @@ -333,6 +363,8 @@ var xFlapGetTransitionType func(uintptr) FlapTransitionType | |||||
| 333 | 363 | ||||
| 334 | // Gets the type of animation used for reveal and fold transitions in @self. | 364 | // Gets the type of animation used for reveal and fold transitions in @self. | ||
| 335 | func (x *Flap) GetTransitionType() FlapTransitionType { | 365 | func (x *Flap) GetTransitionType() FlapTransitionType { | ||
| 366 | + | core.LazyRegister(&xFlapGetTransitionType, "ADW", "adw_flap_get_transition_type", false) | |||
| 367 | + | ||||
| 336 | cret := xFlapGetTransitionType(x.GoPointer()) | 368 | cret := xFlapGetTransitionType(x.GoPointer()) | ||
| 337 | return cret | 369 | return cret | ||
| 338 | } | 370 | } | ||
| @@ -343,6 +375,8 @@ var xFlapSetContent func(uintptr, uintptr) | |||||
| 343 | // | 375 | // | ||
| 344 | // It's always displayed when unfolded, and partially visible when folded. | 376 | // It's always displayed when unfolded, and partially visible when folded. | ||
| 345 | func (x *Flap) SetContent(ContentVar *gtk.Widget) { | 377 | func (x *Flap) SetContent(ContentVar *gtk.Widget) { | ||
| 378 | + | core.LazyRegister(&xFlapSetContent, "ADW", "adw_flap_set_content", false) | |||
| 379 | + | ||||
| 346 | xFlapSetContent(x.GoPointer(), ContentVar.GoPointer()) | 380 | xFlapSetContent(x.GoPointer(), ContentVar.GoPointer()) | ||
| 347 | } | 381 | } | ||
| 348 | 382 | ||||
| @@ -352,6 +386,8 @@ var xFlapSetFlap func(uintptr, uintptr) | |||||
| 352 | // | 386 | // | ||
| 353 | // It's only visible when [property@Flap:reveal-progress] is greater than 0. | 387 | // It's only visible when [property@Flap:reveal-progress] is greater than 0. | ||
| 354 | func (x *Flap) SetFlap(FlapVar *gtk.Widget) { | 388 | func (x *Flap) SetFlap(FlapVar *gtk.Widget) { | ||
| 389 | + | core.LazyRegister(&xFlapSetFlap, "ADW", "adw_flap_set_flap", false) | |||
| 390 | + | ||||
| 355 | xFlapSetFlap(x.GoPointer(), FlapVar.GoPointer()) | 391 | xFlapSetFlap(x.GoPointer(), FlapVar.GoPointer()) | ||
| 356 | } | 392 | } | ||
| 357 | 393 | ||||
| @@ -362,6 +398,8 @@ var xFlapSetFlapPosition func(uintptr, gtk.PackType) | |||||
| 362 | // If it's set to [enum@Gtk.PackType.start], the flap is displayed before the | 398 | // If it's set to [enum@Gtk.PackType.start], the flap is displayed before the | ||
| 363 | // content, if [enum@Gtk.PackType.end], it's displayed after the content. | 399 | // content, if [enum@Gtk.PackType.end], it's displayed after the content. | ||
| 364 | func (x *Flap) SetFlapPosition(PositionVar gtk.PackType) { | 400 | func (x *Flap) SetFlapPosition(PositionVar gtk.PackType) { | ||
| 401 | + | core.LazyRegister(&xFlapSetFlapPosition, "ADW", "adw_flap_set_flap_position", false) | |||
| 402 | + | ||||
| 365 | xFlapSetFlapPosition(x.GoPointer(), PositionVar) | 403 | xFlapSetFlapPosition(x.GoPointer(), PositionVar) | ||
| 366 | } | 404 | } | ||
| 367 | 405 | ||||
| @@ -369,6 +407,8 @@ var xFlapSetFoldDuration func(uintptr, uint) | |||||
| 369 | 407 | ||||
| 370 | // Sets the fold transition animation duration for @self, in milliseconds. | 408 | // Sets the fold transition animation duration for @self, in milliseconds. | ||
| 371 | func (x *Flap) SetFoldDuration(DurationVar uint) { | 409 | func (x *Flap) SetFoldDuration(DurationVar uint) { | ||
| 410 | + | core.LazyRegister(&xFlapSetFoldDuration, "ADW", "adw_flap_set_fold_duration", false) | |||
| 411 | + | ||||
| 372 | xFlapSetFoldDuration(x.GoPointer(), DurationVar) | 412 | xFlapSetFoldDuration(x.GoPointer(), DurationVar) | ||
| 373 | } | 413 | } | ||
| 374 | 414 | ||||
| @@ -376,6 +416,8 @@ var xFlapSetFoldPolicy func(uintptr, FlapFoldPolicy) | |||||
| 376 | 416 | ||||
| 377 | // Sets the fold policy for @self. | 417 | // Sets the fold policy for @self. | ||
| 378 | func (x *Flap) SetFoldPolicy(PolicyVar FlapFoldPolicy) { | 418 | func (x *Flap) SetFoldPolicy(PolicyVar FlapFoldPolicy) { | ||
| 419 | + | core.LazyRegister(&xFlapSetFoldPolicy, "ADW", "adw_flap_set_fold_policy", false) | |||
| 420 | + | ||||
| 379 | xFlapSetFoldPolicy(x.GoPointer(), PolicyVar) | 421 | xFlapSetFoldPolicy(x.GoPointer(), PolicyVar) | ||
| 380 | } | 422 | } | ||
| 381 | 423 | ||||
| @@ -390,6 +432,8 @@ var xFlapSetFoldThresholdPolicy func(uintptr, FoldThresholdPolicy) | |||||
| 390 | // This can be useful if you have a long ellipsizing label and want to let it | 432 | // This can be useful if you have a long ellipsizing label and want to let it | ||
| 391 | // ellipsize instead of immediately folding. | 433 | // ellipsize instead of immediately folding. | ||
| 392 | func (x *Flap) SetFoldThresholdPolicy(PolicyVar FoldThresholdPolicy) { | 434 | func (x *Flap) SetFoldThresholdPolicy(PolicyVar FoldThresholdPolicy) { | ||
| 435 | + | core.LazyRegister(&xFlapSetFoldThresholdPolicy, "ADW", "adw_flap_set_fold_threshold_policy", false) | |||
| 436 | + | ||||
| 393 | xFlapSetFoldThresholdPolicy(x.GoPointer(), PolicyVar) | 437 | xFlapSetFoldThresholdPolicy(x.GoPointer(), PolicyVar) | ||
| 394 | } | 438 | } | ||
| 395 | 439 | ||||
| @@ -401,6 +445,8 @@ var xFlapSetLocked func(uintptr, bool) | |||||
| 401 | // unfolding it when the flap is not revealed opens it. If `TRUE`, | 445 | // unfolding it when the flap is not revealed opens it. If `TRUE`, | ||
| 402 | // [property@Flap:reveal-flap] value never changes on its own. | 446 | // [property@Flap:reveal-flap] value never changes on its own. | ||
| 403 | func (x *Flap) SetLocked(LockedVar bool) { | 447 | func (x *Flap) SetLocked(LockedVar bool) { | ||
| 448 | + | core.LazyRegister(&xFlapSetLocked, "ADW", "adw_flap_set_locked", false) | |||
| 449 | + | ||||
| 404 | xFlapSetLocked(x.GoPointer(), LockedVar) | 450 | xFlapSetLocked(x.GoPointer(), LockedVar) | ||
| 405 | } | 451 | } | ||
| 406 | 452 | ||||
| @@ -412,6 +458,8 @@ var xFlapSetModal func(uintptr, bool) | |||||
| 412 | // pressing the <kbd>Esc</kbd> key, will close the flap. If `FALSE`, clicks are | 458 | // pressing the <kbd>Esc</kbd> key, will close the flap. If `FALSE`, clicks are | ||
| 413 | // passed through to the content widget. | 459 | // passed through to the content widget. | ||
| 414 | func (x *Flap) SetModal(ModalVar bool) { | 460 | func (x *Flap) SetModal(ModalVar bool) { | ||
| 461 | + | core.LazyRegister(&xFlapSetModal, "ADW", "adw_flap_set_modal", false) | |||
| 462 | + | ||||
| 415 | xFlapSetModal(x.GoPointer(), ModalVar) | 463 | xFlapSetModal(x.GoPointer(), ModalVar) | ||
| 416 | } | 464 | } | ||
| 417 | 465 | ||||
| @@ -419,6 +467,8 @@ var xFlapSetRevealFlap func(uintptr, bool) | |||||
| 419 | 467 | ||||
| 420 | // Sets whether the flap widget is revealed for @self. | 468 | // Sets whether the flap widget is revealed for @self. | ||
| 421 | func (x *Flap) SetRevealFlap(RevealFlapVar bool) { | 469 | func (x *Flap) SetRevealFlap(RevealFlapVar bool) { | ||
| 470 | + | core.LazyRegister(&xFlapSetRevealFlap, "ADW", "adw_flap_set_reveal_flap", false) | |||
| 471 | + | ||||
| 422 | xFlapSetRevealFlap(x.GoPointer(), RevealFlapVar) | 472 | xFlapSetRevealFlap(x.GoPointer(), RevealFlapVar) | ||
| 423 | } | 473 | } | ||
| 424 | 474 | ||||
| @@ -432,6 +482,8 @@ var xFlapSetRevealParams func(uintptr, *SpringParams) | |||||
| 432 | // adw_spring_params_new (1, 0.5, 500) | 482 | // adw_spring_params_new (1, 0.5, 500) | ||
| 433 | // ``` | 483 | // ``` | ||
| 434 | func (x *Flap) SetRevealParams(ParamsVar *SpringParams) { | 484 | func (x *Flap) SetRevealParams(ParamsVar *SpringParams) { | ||
| 485 | + | core.LazyRegister(&xFlapSetRevealParams, "ADW", "adw_flap_set_reveal_params", false) | |||
| 486 | + | ||||
| 435 | xFlapSetRevealParams(x.GoPointer(), ParamsVar) | 487 | xFlapSetRevealParams(x.GoPointer(), ParamsVar) | ||
| 436 | } | 488 | } | ||
| 437 | 489 | ||||
| @@ -443,6 +495,8 @@ var xFlapSetSeparator func(uintptr, uintptr) | |||||
| 443 | // When exactly it's visible depends on the [property@Flap:transition-type] | 495 | // When exactly it's visible depends on the [property@Flap:transition-type] | ||
| 444 | // value. | 496 | // value. | ||
| 445 | func (x *Flap) SetSeparator(SeparatorVar *gtk.Widget) { | 497 | func (x *Flap) SetSeparator(SeparatorVar *gtk.Widget) { | ||
| 498 | + | core.LazyRegister(&xFlapSetSeparator, "ADW", "adw_flap_set_separator", false) | |||
| 499 | + | ||||
| 446 | xFlapSetSeparator(x.GoPointer(), SeparatorVar.GoPointer()) | 500 | xFlapSetSeparator(x.GoPointer(), SeparatorVar.GoPointer()) | ||
| 447 | } | 501 | } | ||
| 448 | 502 | ||||
| @@ -453,6 +507,8 @@ var xFlapSetSwipeToClose func(uintptr, bool) | |||||
| 453 | // The area that can be swiped depends on the [property@Flap:transition-type] | 507 | // The area that can be swiped depends on the [property@Flap:transition-type] | ||
| 454 | // value. | 508 | // value. | ||
| 455 | func (x *Flap) SetSwipeToClose(SwipeToCloseVar bool) { | 509 | func (x *Flap) SetSwipeToClose(SwipeToCloseVar bool) { | ||
| 510 | + | core.LazyRegister(&xFlapSetSwipeToClose, "ADW", "adw_flap_set_swipe_to_close", false) | |||
| 511 | + | ||||
| 456 | xFlapSetSwipeToClose(x.GoPointer(), SwipeToCloseVar) | 512 | xFlapSetSwipeToClose(x.GoPointer(), SwipeToCloseVar) | ||
| 457 | } | 513 | } | ||
| 458 | 514 | ||||
| @@ -463,6 +519,8 @@ var xFlapSetSwipeToOpen func(uintptr, bool) | |||||
| 463 | // The area that can be swiped depends on the [property@Flap:transition-type] | 519 | // The area that can be swiped depends on the [property@Flap:transition-type] | ||
| 464 | // value. | 520 | // value. | ||
| 465 | func (x *Flap) SetSwipeToOpen(SwipeToOpenVar bool) { | 521 | func (x *Flap) SetSwipeToOpen(SwipeToOpenVar bool) { | ||
| 522 | + | core.LazyRegister(&xFlapSetSwipeToOpen, "ADW", "adw_flap_set_swipe_to_open", false) | |||
| 523 | + | ||||
| 466 | xFlapSetSwipeToOpen(x.GoPointer(), SwipeToOpenVar) | 524 | xFlapSetSwipeToOpen(x.GoPointer(), SwipeToOpenVar) | ||
| 467 | } | 525 | } | ||
| 468 | 526 | ||||
| @@ -475,6 +533,8 @@ var xFlapSetTransitionType func(uintptr, FlapTransitionType) | |||||
| 475 | // the [`.background`](style-classes.html#background) style class to it if this | 533 | // the [`.background`](style-classes.html#background) style class to it if this | ||
| 476 | // is unwanted. | 534 | // is unwanted. | ||
| 477 | func (x *Flap) SetTransitionType(TransitionTypeVar FlapTransitionType) { | 535 | func (x *Flap) SetTransitionType(TransitionTypeVar FlapTransitionType) { | ||
| 536 | + | core.LazyRegister(&xFlapSetTransitionType, "ADW", "adw_flap_set_transition_type", false) | |||
| 537 | + | ||||
| 478 | xFlapSetTransitionType(x.GoPointer(), TransitionTypeVar) | 538 | xFlapSetTransitionType(x.GoPointer(), TransitionTypeVar) | ||
| 479 | } | 539 | } | ||
| 480 | 540 | ||||
| @@ -986,51 +1046,4 @@ func (x *Flap) SetOrientation(OrientationVar gtk.Orientation) { | |||||
| 986 | func init() { | 1046 | func init() { | ||
| 987 | core.SetPackageName("ADW", "libadwaita-1") | 1047 | core.SetPackageName("ADW", "libadwaita-1") | ||
| 988 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | 1048 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | ||
| 989 | - | var libs []uintptr | |||
| 990 | - | for _, libPath := range core.GetPaths("ADW") { | |||
| 991 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 992 | - | if err != nil { | |||
| 993 | - | panic(err) | |||
| 994 | - | } | |||
| 995 | - | libs = append(libs, lib) | |||
| 996 | - | } | |||
| 997 | - | ||||
| 998 | - | core.PuregoSafeRegister(&xFlapFoldPolicyGLibType, libs, "adw_flap_fold_policy_get_type") | |||
| 999 | - | ||||
| 1000 | - | core.PuregoSafeRegister(&xFlapTransitionTypeGLibType, libs, "adw_flap_transition_type_get_type") | |||
| 1001 | - | ||||
| 1002 | - | core.PuregoSafeRegister(&xFlapGLibType, libs, "adw_flap_get_type") | |||
| 1003 | - | ||||
| 1004 | - | core.PuregoSafeRegister(&xNewFlap, libs, "adw_flap_new") | |||
| 1005 | - | ||||
| 1006 | - | core.PuregoSafeRegister(&xFlapGetContent, libs, "adw_flap_get_content") | |||
| 1007 | - | core.PuregoSafeRegister(&xFlapGetFlap, libs, "adw_flap_get_flap") | |||
| 1008 | - | core.PuregoSafeRegister(&xFlapGetFlapPosition, libs, "adw_flap_get_flap_position") | |||
| 1009 | - | core.PuregoSafeRegister(&xFlapGetFoldDuration, libs, "adw_flap_get_fold_duration") | |||
| 1010 | - | core.PuregoSafeRegister(&xFlapGetFoldPolicy, libs, "adw_flap_get_fold_policy") | |||
| 1011 | - | core.PuregoSafeRegister(&xFlapGetFoldThresholdPolicy, libs, "adw_flap_get_fold_threshold_policy") | |||
| 1012 | - | core.PuregoSafeRegister(&xFlapGetFolded, libs, "adw_flap_get_folded") | |||
| 1013 | - | core.PuregoSafeRegister(&xFlapGetLocked, libs, "adw_flap_get_locked") | |||
| 1014 | - | core.PuregoSafeRegister(&xFlapGetModal, libs, "adw_flap_get_modal") | |||
| 1015 | - | core.PuregoSafeRegister(&xFlapGetRevealFlap, libs, "adw_flap_get_reveal_flap") | |||
| 1016 | - | core.PuregoSafeRegister(&xFlapGetRevealParams, libs, "adw_flap_get_reveal_params") | |||
| 1017 | - | core.PuregoSafeRegister(&xFlapGetRevealProgress, libs, "adw_flap_get_reveal_progress") | |||
| 1018 | - | core.PuregoSafeRegister(&xFlapGetSeparator, libs, "adw_flap_get_separator") | |||
| 1019 | - | core.PuregoSafeRegister(&xFlapGetSwipeToClose, libs, "adw_flap_get_swipe_to_close") | |||
| 1020 | - | core.PuregoSafeRegister(&xFlapGetSwipeToOpen, libs, "adw_flap_get_swipe_to_open") | |||
| 1021 | - | core.PuregoSafeRegister(&xFlapGetTransitionType, libs, "adw_flap_get_transition_type") | |||
| 1022 | - | core.PuregoSafeRegister(&xFlapSetContent, libs, "adw_flap_set_content") | |||
| 1023 | - | core.PuregoSafeRegister(&xFlapSetFlap, libs, "adw_flap_set_flap") | |||
| 1024 | - | core.PuregoSafeRegister(&xFlapSetFlapPosition, libs, "adw_flap_set_flap_position") | |||
| 1025 | - | core.PuregoSafeRegister(&xFlapSetFoldDuration, libs, "adw_flap_set_fold_duration") | |||
| 1026 | - | core.PuregoSafeRegister(&xFlapSetFoldPolicy, libs, "adw_flap_set_fold_policy") | |||
| 1027 | - | core.PuregoSafeRegister(&xFlapSetFoldThresholdPolicy, libs, "adw_flap_set_fold_threshold_policy") | |||
| 1028 | - | core.PuregoSafeRegister(&xFlapSetLocked, libs, "adw_flap_set_locked") | |||
| 1029 | - | core.PuregoSafeRegister(&xFlapSetModal, libs, "adw_flap_set_modal") | |||
| 1030 | - | core.PuregoSafeRegister(&xFlapSetRevealFlap, libs, "adw_flap_set_reveal_flap") | |||
| 1031 | - | core.PuregoSafeRegister(&xFlapSetRevealParams, libs, "adw_flap_set_reveal_params") | |||
| 1032 | - | core.PuregoSafeRegister(&xFlapSetSeparator, libs, "adw_flap_set_separator") | |||
| 1033 | - | core.PuregoSafeRegister(&xFlapSetSwipeToClose, libs, "adw_flap_set_swipe_to_close") | |||
| 1034 | - | core.PuregoSafeRegister(&xFlapSetSwipeToOpen, libs, "adw_flap_set_swipe_to_open") | |||
| 1035 | - | core.PuregoSafeRegister(&xFlapSetTransitionType, libs, "adw_flap_set_transition_type") | |||
| 1036 | } | 1049 | } | ||