Scoop API

scoop:scoop.window:0.1.0

src/accessibility/native_text.scoop

Selected production source · src/accessibility/native_text.scoop

1package scoop.window.accessibility.native
3/** UTF-8 range query: 1 success, 0 unavailable, -1 invalid argument, -2 native failure. */
4@CLayout
5public struct NativeSemanticTextRange(val start: Long, val end: Long, val status: Int)
7/**
8 * Paired native queries matching the published text and accepted scene.
9 * Coordinates are window-logical. Functions and synchronous box visitors never enter Scoop.
10 * Affinity is 0 upstream or 1 downstream; units 0..3 are grapheme, word, visual and logical line.
11 */
12@CLayout
13public struct NativeSemanticTextGeometry(
14 val context: Ptr<Unit>,
15 val retain: FunPtr<(Ptr<Unit>) -> Unit>,
16 val release: FunPtr<(Ptr<Unit>) -> Unit>,
17 val range: FunPtr<(Ptr<Unit>, Long, Int, Int) -> NativeSemanticTextRange>,
18 val lineRange: FunPtr<(Ptr<Unit>, Long) -> NativeSemanticTextRange>,
19 /** Nonnegative line index; -1 unavailable, -2 invalid argument, -3 native failure. */
20 val lineIndex: FunPtr<(Ptr<Unit>, Long, Int) -> Long>,
21 val rangeAtPoint: FunPtr<(Ptr<Unit>, Double, Double) -> NativeSemanticTextRange>,
22 val boxes: FunPtr<
23 (
24 Ptr<Unit>,
25 Long,
26 Long,
27 Ptr<Unit>,
28 FunPtr<(Ptr<Unit>, Double, Double, Double, Double) -> Unit>
29 ) -> Int
30 >,
31 val visibleRange: FunPtr<(Ptr<Unit>) -> NativeSemanticTextRange>