Scoop API

scoop:scoop.window:0.1.0

src/accessibility/hit.scoop

Selected production source · src/accessibility/hit.scoop

1package scoop.window.accessibility
3import scoop.window.accessibility.native.NativeSemanticHitTest
5/** One managed owner's native reference, independent of the published projection's reference. */
6internal class SemanticHitSnapshot(val native: NativeSemanticHitTest): Closeable {
7 private var closed = false
8 init {
9 @Unsafe
10 {
11 native.retain(native.context)
12 }
13 }
14 public override fun close() {
15 if (closed)
16 return
17 closed = true
18 @Unsafe
19 {
20 native.release(native.context)
21 }
22 }