How johnfactotum/foliate works
Main Components
a. Frontend Layer:
• GTK4/Libadwaita UI Components (represented by the /src/ui directory)
• Main Application Window
• Book Viewer
• Library View
• Navigation Components
b. Core Application Layer:
• Book Processing Engine
• Annotation System
• Search functionality
• Text-to-Speech System
c. Backend Services:
• WebKit Engine Integration
• File System Integration
• Settings Management (GSettings)
• Optional Tracker Integration
User Interface Layer (Top)
• UI components connected to their respective controllers
• Main views: Library, Book Viewer, Image Viewer
• UI elements to their corresponding .ui files
Core Application Layer (Middle)
• Book Processing (src/reader/reader.js)
• Annotation Management (src/annotations.js)
• Navigation Controls (src/navbar.js)
• Search System (src/search.js)
Service Layer (Bottom)
• File System Integration
• WebKit Integration (src/webview.js)
• Database/Storage Services
• External Services (Speech Dispatcher, Tracker)
Specific Implementation Details
• Rectangles for UI components (blue)
• Hexagons for core services (green)
• Clouds for external services (purple)
Connection Flows
• Data flow between components
• Event handling paths
• Service dependencies
• File system interactions
Important Subsystems to Highlight
• OPDS Integration (src/opds)
• Selection Tools (src/selection-tools)
• Theme Management (src/themes.js)
• Internationalization System (po directory)
Technical Specifications to Note
• GJS Runtime Requirement (≥ 1.76)
• GTK4 (≥ 4.12)
• WebKitGTK 6.0 dependency
• Optional dependencies (hyphenation, speech-dispatcher)