Ariver
2026-06-04 247c82b195be7cb7311ba6c5b9aca358fb91e0dc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import AppKit
import Foundation
 
public protocol SpaceEnumeratorProtocol {
    func displays() throws -> [AlignerDisplay]
}
 
public protocol SpaceEnumeratorDelegate: AnyObject {
    func spaceDidChange(to space: AlignerSpace, on display: AlignerDisplay)
    func displayConfigurationDidChange()
}
 
public protocol WindowServiceProtocol: AnyObject {
    var delegate: WindowServiceDelegate? { get set }
 
    func allWindows() throws -> [AlignerWindow]
    func windows(for space: AlignerSpace) throws -> [AlignerWindow]
    func refresh()
    func startObserving()
    func stopObserving()
}
 
public enum WindowChangeKind: Equatable, Sendable {
    case opened
    case closed
    case moved
    case resized
    case minimized
    case deminiaturized
    case hidden
    case unhidden
}
 
public struct WindowChange: Equatable, Sendable {
    public let kind: WindowChangeKind
    public let windowID: UInt32
 
    public init(kind: WindowChangeKind, windowID: UInt32) {
        self.kind = kind
        self.windowID = windowID
    }
}
 
public protocol WindowServiceDelegate: AnyObject {
    func windowServiceDidDetectWindowChange(_ change: WindowChange)
}
 
public enum WindowRestoreResult: Equatable, Sendable {
    case restored
    case windowNotFound
    case unsupported
    case activationFailed
}
 
public protocol WindowRestorationServiceProtocol: AnyObject {
    func restore(windowID: UInt32) throws -> WindowRestoreResult
}
 
public enum WindowActivationResult: Equatable, Sendable {
    case activated
    case restored
    case appActivatedOnly
    case windowNotFound
    case unsupported
    case activationFailed
    case failed(String)
}
 
public protocol WindowActivationServiceProtocol: AnyObject {
    func activate(window: AlignerWindow) throws -> WindowActivationResult
}
 
@MainActor
public protocol ScreenshotProviderProtocol {
    func screenshot(for window: AlignerWindow) async throws -> NSImage
    func resolvedScreenshot(for window: AlignerWindow, in session: ScreenshotCaptureSession) async -> ScreenshotResolution
}
 
@MainActor
public protocol SkeletonThumbnailProviderProtocol {
    func skeleton(for app: AlignerApp) -> NSImage
    func withOverlayTitle(_ title: String, for app: AlignerApp) -> NSImage
}
 
@MainActor
public protocol AppIconProviderProtocol {
    func icon(for app: AlignerApp) -> NSImage
    func fallbackIcon() -> NSImage
}