Add image editor with annotation tools

Integrates an editor accessible via "Letzte Aufnahme bearbeiten…" or
"Bild bearbeiten…" in the menu bar. Supports arrow, rectangle, ellipse,
and text annotations with color picker, line width, undo/redo, and
export to file or clipboard.

New files in Sources/Editor/:
- AnnotationItem/Document: data model and state management
- AnnotationCanvasView: NSView with CG rendering and mouse interaction
- AnnotationRenderer: shared rendering for canvas and image export
- EditorToolbarView: SwiftUI toolbar with tool selection and actions
- EditorWindowController: window lifecycle following SettingsWindowController pattern

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-01 17:44:20 +02:00
co-authored by Claude Opus 4.6
parent ecbae7cd21
commit 062285abbf
9 changed files with 841 additions and 6 deletions
+36
View File
@@ -0,0 +1,36 @@
import AppKit
import Foundation
enum AnnotationKind: String, CaseIterable, Codable {
case arrow
case rectangle
case ellipse
case text
}
struct AnnotationItem: Identifiable {
let id: UUID
var kind: AnnotationKind
var rect: CGRect
var color: NSColor
var lineWidth: CGFloat
var text: String?
var fontSize: CGFloat
init(
kind: AnnotationKind,
rect: CGRect,
color: NSColor = .systemRed,
lineWidth: CGFloat = 3,
text: String? = nil,
fontSize: CGFloat = 24
) {
self.id = UUID()
self.kind = kind
self.rect = rect
self.color = color
self.lineWidth = lineWidth
self.text = text
self.fontSize = fontSize
}
}