OpenShot is a macOS menu bar app built entirely with Apple frameworks. This document describes the high-level architecture, module responsibilities, and key design decisions.
┌─────────────────────────────────────────────────┐
│ App Shell │
│ Menu Bar Agent · Global Hotkeys │
│ Permissions · URL Scheme · Onboarding │
├──────────┬──────────┬──────────┬────────────────┤
│ Capture │Recording │Annotation│ Overlay │
│ │ │ │ │
│ Area │ MP4 │ 17 Tools │ Quick Access │
│ Window │ GIF │ Canvas │ Floating Pins │
│ Full │ Webcam │ Styles │ Drag Source │
│ Scroll │ Audio │ Smart │ │
│ Timer │ Viz │ Blur │ │
├──────────┴──────────┴──────────┴────────────────┤
│ OCR │ History │ Settings │ Utilities │
└───────┴───────────┴────────────┴────────────────┘
48 Swift files · ~11,000 LOC · Zero external dependencies
The entry point and shell. Manages:
- AppDelegate —
NSApplicationDelegate, configures the app as a menu bar agent (no dock icon) - StatusBarManager — Creates and manages the
NSStatusItemwith capture/recording menus - HotkeyBootstrap — Registers global keyboard shortcuts via
CGEventtap - PermissionManager — Checks and requests Screen Recording + Accessibility permissions
- URLSchemeHandler — Handles
openshot://deep links for automation - OnboardingWindow — First-run permission flow and shortcut overview
The core screenshot engine:
- CaptureEngine — Orchestrates all capture modes, manages
SCShareableContentandSCScreenshotManager - AreaSelector — Transparent fullscreen
NSWindowwith crosshair, magnifier loupe, and dimension labels - WindowSelector — Highlight-on-hover window picker using ScreenCaptureKit window list
- ScrollingCapture — Iterative scroll-and-capture with vertical image stitching
- SelfTimerCapture — Countdown overlay before delegating to selected capture mode
- FreezeScreen — Captures and displays a static fullscreen overlay for capturing transient UI
- AllInOnePanel — Floating
NSPanelshowing all capture modes in one UI - WindowBackgroundRenderer — Adds shadows, gradients, and solid backgrounds to window captures
Post-capture editing:
- AnnotationCanvas —
NSViewsubclass handling all drawing viaNSBezierPathandCoreImage - AnnotationTool (enum) — 17 tool types, each with its own rendering logic
- AnnotationToolbar — Scrollable tool picker with contextual property controls
- AnnotationEditorWindow — Hosts the canvas with Image menu (rotate/flip/resize)
- SmartBlur — Uses Vision framework to detect text regions, applies blur only to text
- HandDrawnRenderer — Adds jitter/roughness to shapes for sketch-style appearance
Screen recording engine:
- ScreenRecorder —
SCStream-based capture →AVAssetWriterfor MP4 output - GIFExporter — Real-time frame capture with
CGImageDestinationGIF encoding - WebcamOverlay — Circular
AVCaptureVideoPreviewLayerin a floating panel - ClickVisualizer — Monitors
CGEventfor mouse clicks, draws expanding circles - KeystrokeVisualizer — Floating pill overlay showing pressed key combinations
- RecordingControls — Pause/resume/restart/stop UI with elapsed time display
- MenuBarTimer — Shows MM:SS in the status bar during active recording
Post-capture UI:
- QuickAccessOverlay — Floating panel with copy/save/annotate/pin actions
- FloatingScreenshot — Always-on-top
NSPanelwith opacity, resize, and lock controls - DragSource —
NSPasteboardWritingimplementation for dragging captures to other apps
- TextRecognizer —
VNRecognizeTextRequestwith.accuratelevel, language correction, and line-break preservation
- CaptureRecord —
@Model(SwiftData) for persisting capture metadata - HistoryView — SwiftUI grid with type filters and thumbnail previews
- Preferences —
@Observablesingleton storing all user preferences - HotkeyManager — Global shortcut registration and conflict resolution
- SettingsWindow — 6-tab SwiftUI settings (General, Capture, Recording, Shortcuts, History, Advanced)
Shared helpers:
- NSImage+Extensions — Resize, crop, format conversion, thumbnail generation
- ScreenInfo — Multi-display geometry, cursor-to-display mapping
- SoundEffects — System sound playback for capture/recording events
- DesktopManager — Show/hide desktop icons via
NSWorkspace - ColorInspector — Pixel color sampling with HEX/RGB/OKLCH output and WCAG contrast
- FileNamer — Template-based file naming (
{date},{time},{mode},{counter}) - DNDManager — Do Not Disturb toggle during recording
Every feature is built on Apple frameworks only. This means:
- No CocoaPods, SPM packages, or Carthage
- No supply chain risk
- App size stays minimal
- No version conflicts or compatibility issues
The app runs as LSUIElement = true (no dock icon). Users interact via:
- Global keyboard shortcuts
- Menu bar status item
- URL scheme
- All UI and capture code runs on
@MainActor - Recording uses
SCStreamdelegate callbacks on a dedicated queue - Image processing (blur, pixelate, smart blur) uses
CIContexton background threads - SwiftData access is
@MainActorconfined
User Input (Hotkey / Menu / URL Scheme)
│
▼
CaptureEngine (orchestrates mode selection)
│
▼
Mode-specific capture (Area/Window/Full/Scroll/Timer/Freeze)
│
▼
NSImage result
│
├─▶ QuickAccessOverlay (copy/save/annotate/pin)
├─▶ AnnotationEditor (if user chooses to annotate)
├─▶ Clipboard (if auto-copy enabled)
├─▶ File system (if auto-save enabled)
└─▶ CaptureRecord (SwiftData history)
| Framework | Purpose |
|---|---|
| ScreenCaptureKit | Screen capture and recording streams |
| AVFoundation | Video encoding, webcam preview, audio capture |
| Vision | OCR text recognition, smart text-region detection |
| CoreImage | Gaussian blur, pixelation, image filtering |
| CoreGraphics | Annotation drawing, image composition, event taps |
| AppKit | Windows, panels, menus, status bar, pasteboard |
| SwiftUI | Settings UI, toolbar, overlay views, history grid |
| SwiftData | Capture history persistence |
| ServiceManagement | Launch at login via SMAppService |