Scoop API

scoop:scoop.window:0.1.0

src/native/abi.scoop

Selected production source · src/native/abi.scoop

1package scoop.window
3@CLayout
4internal struct NativeSnapshot(
5 val width: Double,
6 val height: Double,
7 val pixelWidth: Double,
8 val pixelHeight: Double,
9 val scale: Double,
10 val x: Double,
11 val y: Double,
12 val outerWidth: Double,
13 val outerHeight: Double,
14 val visible: Int,
15 val occluded: Int,
16 val focused: Int,
17 val minimized: Int,
18 val maximized: Int,
19 val fullscreen: Int,
20 val dark: Int
21) {
22 fun metrics(): WindowMetrics = WindowMetrics(
23 LogicalSize(width, height),
24 PhysicalSize(pixelWidth.toInt(), pixelHeight.toInt()),
25 scale
26 )
29@Extern(name = "scoop_window_application_create")
30internal fun nativeApplicationCreateResult(
31 callback: FunPtr<(Ptr<Unit>, Long, Int) -> Int>,
32 context: Ptr<Unit>,
33 policy: Int,
34 applicationId: Ptr<UInt8>,
35 length: Long
36): NativeCreateResult
38@Extern(name = "scoop_window_application_run")
39internal fun nativeApplicationRun(application: Ptr<Unit>): Int
41@Extern(name = "scoop_window_application_stop")
42internal fun nativeApplicationStop(application: Ptr<Unit>)
44@Extern(name = "scoop_window_application_destroy")
45internal fun nativeApplicationDestroy(application: Ptr<Unit>)
47@Extern(name = "scoop_window_create")
48internal fun nativeWindowCreateResult(
49 application: Ptr<Unit>,
50 identity: Long,
51 title: Ptr<UInt8>,
52 length: Long,
53 width: Double,
54 height: Double,
55 flags: Int,
56 owner: Ptr<Unit>?,
57 role: Int
58): NativeCreateResult
60@Extern(name = "scoop_window_snapshot")
61internal fun nativeWindowSnapshot(window: Ptr<Unit>): NativeSnapshot
63@Extern(name = "scoop_window_destroy")
64internal fun nativeWindowDestroy(window: Ptr<Unit>)
66@Extern(name = "scoop_window_title")
67internal fun nativeWindowTitle(window: Ptr<Unit>, text: Ptr<UInt8>, length: Long): Long
69@Extern(name = "scoop_window_size")
70internal fun nativeWindowSize(window: Ptr<Unit>, width: Double, height: Double): Long
72@Extern(name = "scoop_window_visible")
73internal fun nativeWindowVisible(window: Ptr<Unit>, visible: Int): Long
75@Extern(name = "scoop_window_focus")
76internal fun nativeWindowFocus(window: Ptr<Unit>): Long