How sprang/inkpad works
Project Type and Purpose
• Inkpad is a native iPad vector‐illustration application written in Objective-C/Cocoa Touch.
• It follows an MVC paradigm, with a rich UI layer built in XIBs/Storyboard, a domain-specific “Core” library for drawing and data modeling, and integrations for export and cloud services (Dropbox, OpenClipArt).
File Structure Analysis
• Base.lproj & *.lproj folders → UI resources (XIB files, Storyboard, localized strings).
• Classes/ → AppDelegate, UIView subclasses, UIViewControllers, managers, and controllers that glue UI to core logic.
• Inkpad-Core/ → The heart of the drawing engine:
• Tools (pen, eraser, zoom, rotate, boolean ops)
• SVG parser & exporter
• Curve fitting, utilities, math libs (livarot)
• DropboxSDK.framework → Third-party SDK for Dropbox integration.
• Openclipart/ → Custom client for downloading and caching OpenClipArt assets.
• PLists/ → Configuration and defaults (blend modes, page sizes, import formats).
• CrashReports/ → Collected crash logs for debugging.
• Help/, Samples/, Images/ → Static assets.
• Inkpad.xcodeproj, *.plist → Build and entitlements.
Insights from README
• High-performance vector operations, SVG/PDF/PNG/JPEG export, Dropbox direct export.
• Emphasis on handling thousands of objects without lag.
• Modular design to allow future feature contributions.
Diagramming the System Architecture
a. Main Components
• UI Layer:
– Storyboard & XIBs (layout definitions)
– Views (custom UIView subclasses)
– Controllers (UIViewController subclasses in Classes/)
• Domain/Core Engine (Inkpad-Core):
– Model objects (WDPath, WDGroup, WDText, etc.)
– Tool modules (WD*Tool classes)
– SVG Parser/Serializer
– CurveFit & livarot math library
– Utilities (WDUtilities, WDGLUtilities)
• Services & Integrations:
– DropboxSDK (DBRestClient, DBSession)
– OpenClipArt downloader & cache
• Export & Persistence:
– ExportController (generates SVG, PDF, images)
– Email integration (WDEmail)
– Local file I/O (document management via WDDocument)
• Configuration & Assets:
b. Relationships & Data Flows
1. User interacts with UI → Controller (e.g., WDCanvasController)
2. Controller invokes Core Engine APIs (e.g., ToolManager selects a tool, DrawingManager applies changes to the Model)
3. Model emits change notifications → Controller updates Views
4. ExportController requests Model serialization → SVG/PDF generated
5. For Dropbox export: ExportController hands off serialized data to DropboxSDK REST client
6. OpenClipArtController requests assets → Downloader fetches via network → updates Model and View
c. Architectural Patterns
• MVC: clear separation of Views, Controllers, and Model
• Delegation & Observer: Core engine notifies controllers of model changes
• Plugin-style Tools: each drawing tool implements a common interface (WDTool)
• Layered design: UI → Domain → Service
d. Key Technologies & Frameworks
• Objective-C, Cocoa Touch, Xcode project
• Interface Builder (XIB, Storyboard)
• Property lists for configuration
• DropboxSDK for cloud integration
• NSURLSession/Network code in OpenClipArt client
• Custom math & graphics libs (livarot, GL utilities)