1
0
Fork 0
Commit graph

7 commits

Author SHA1 Message Date
57ff84bce5 Re-point plugins and re-enable lint gate (E6/E7)
E6: remove build-tool plugin (architecturally incompatible with the
monorepo-only CLI); rewrite the command plugin as a thin pass-through to
swift-gtk-gen.

E7: add swift-format as a dependency, format generated output in-process
before writeIfChanged, re-enable swift format lint --strict in
compile-gate.sh. CamelCase renderer identifiers (enum/bitfield cases,
signal trampoline names, _sgtk_* helpers, __result/__ptr temporaries,
hardcoded G_TYPE_* GValue constants) and drop generated block comments to
reach zero lint findings across all 6 tiers.
2026-07-20 23:44:49 -04:00
c20015be48 Complete Phase E4 tier-5 Gtk pointer-hiding and smoke coverage
Hides pointer storage/init behind @_spi(SGTKInternal) across boxed records
and interface Ref wrappers, marks interface Ref classes @MainActor,
threads boxed-record hasCopyFunction through GValue ops, and qualifies
re-exported dependency imports @_spi(SGTKInternal). Adds the tier-5
GtkSmoke display-free runtime smoke suite.
2026-07-20 21:58:51 -04:00
5abb48e889 Fix Phase D signal/callback remediation defects
Destroy-notify ABI fixed to GClosureNotify's real 2-arg signature and
wired into every connect method (was leaking every _ClosureBox, and
UB on non-x86_64 with the wrong arg count). Trampolines restore
MainActor isolation via assumeIsolated, with narrowly-scoped
nonisolated(unsafe) shadow copies to satisfy Swift 6's sending
checker. Interface-signal rendering implemented and unit-tested.
Dead code removed (SignalHandlePlan), destroyTrampoline made
non-optional, D7 deferral documented in-code. CoverageStats gained
boundCallbacks/boundSignals counters. Added SignalGenerationTests,
InterfaceSignalGenerationTests, and CallbackGenerationTests (12 new
tests, 187/187 total). Fixed the dead nonDetailedSignal smoke test to
actually mutate a property and assert the closure fired.

Callback-param planner-side binding (D4.3) stays disabled: enabling
it trips a genuine Swift compiler crash on g_qsort_with_data's
GCompareDataFunc parameter. The renderer-side box setup/release logic
is implemented and unit-tested by constructing plans directly,
bypassing the blocked planner path.

Verified: swift test (187/187), compile-gate.sh 1 --fresh (PASS),
smoke-test.sh --fresh (18/18).
2026-07-18 20:45:56 -04:00
dd2cd7a689 Phase C review remediation — C5 conformance, C6 GValue setter leak, C4 double-free/crossed-pair, C1 integer widths, renderConstructor throws, +24 unit tests +3 smoke tests 2026-07-18 16:28:33 -04:00
f85af8e6ce Generate GObject properties as computed vars (C6)
Properties render as Swift computed `var`s. Each accessor is planned
independently as either a delegation to the GIR getter=/setter= method
or the uniform GValue machinery (g_object_get_property/_set_property).

Delegation is preferred and inherits the method's nullability and
ownership (e.g. Binding.source becomes Object? because get_source is
nullable, where the GValue path produced a trap-prone non-optional
Object). It is chosen only when it yields one consistent Swift type;
otherwise both accessors fall back to GValue. GValue is also the
fallback for pure-GObject properties with no dedicated C accessor.

Enum/flags GValue getters bridge gint/guint to the Swift raw value via
numericCast; a bare cast would fail to compile on any enum-bearing tier.
Construct-only properties render read-only. Interface properties become
{ get } / { get set } requirements. GObject's fundamental G_TYPE_*
constants are emitted into its support file.

Adds 17 PropertyGenerationTests (incl. 5 delegation cases) and 2 runtime
smoke tests exercising a GValue round-trip and delegated getFlags() /
nullable getSource() off a real GBinding.
2026-07-18 14:59:12 -04:00
16e5449cad Expand runtime smoke tests across binding categories
Add smoke tests exercising boxed-record lifetime (copy-on-borrow,
adopt-on-full, init(retaining:), isolated deinit over thousands of alloc/free
cycles), out-param tuple returns, enum returns, bitfield arguments, and GError
bridging on both the success and throwing paths — proving each marshalling
category reaches real GLib/GObject correctly at runtime.
2026-07-17 21:04:43 -04:00
144da7860e Generate class methods and constructors with runtime smoke tests 2026-07-17 15:43:30 -04:00