This document summarizes common functionality used by SmallNote, SmallBarcoder, SmallColourSync, and other Small* apps, and suggests what could be extracted or refactored into a reusable core (e.g. inside SmallStep or a separate SmallCore).
- SSHostApplication + SSAppDelegate: Cross-platform app lifecycle; desktop apps call
[SSHostApplication runWithDelegate:myDelegate]. - SSFileSystem: Documents, cache, application support directories; read/write/list/delete files.
- SSMainMenu: Build a desktop main menu from an array of item descriptors + Quit.
- SSFileDialog: Open/save file dialogs (modal or completion handler).
- SSPlatform: Platform detection (macOS, iOS, Linux, Windows).
- SSWindowStyle, SSConcurrency, NSView+SSTag: Additional helpers.
- SmallBarcoder:
main.mcreatesNSApplication, setsAppDelegateasNSApplicationDelegate, runs. No SmallStep lifecycle. - SmallColourSync: Same:
AppControllerasNSApplicationDelegate. - SmallNote: Uses
[SSHostApplication runWithDelegate:SNAppDelegate](SmallStep pattern).
Recommendation: Prefer SSHostApplication + SSAppDelegate for new apps so lifecycle and “quit after last window” are consistent. Optionally refactor SmallBarcoder/SmallColourSync to use it.
- SmallBarcoder: Uses SSApplicationMenu (Barcode-specific: File, Decode, Encode, Symbologies, etc.).
- SmallColourSync: Custom or GORM; no SSMainMenu in the snippet seen.
- SmallNote: Uses SSMainMenu with generic items (New Note, Open Folder…, Delete, Toggle To-Do, Quit).
Recommendation: Use SSMainMenu for apps that need a simple app menu + Quit. Keep SSApplicationMenu (or app-specific menus) for domain-heavy menus.
- All use either SSFileSystem (SmallStep) or
NSSearchPathForDirectoriesInDomains/ platform paths. - SmallNote: Notes directory =
[SSFileSystem applicationSupportDirectory]/AppName/Notes.
Recommendation: Standardize on SSFileSystem for app support, documents, cache, and all file I/O so behaviour is consistent on Linux (XDG), macOS, and Windows.
- SmallBarcoder: ZBar, ZInt (optional; pkg-config, conditional compile).
- SmallColourSync: lcms2, OpenGL, Vulkan (optional).
- SmallNote: No extra libs; core logic is Foundation + SmallStep.
Recommendation: Keep optional libs behind HAVE_* and conditional linking; document in each app’s README. No need to put these in a “core”; they stay app-specific.
- All use
GNUSTEP_MAKEFILES,common.make,application.make(or framework for SmallStep). - SmallStep path: apps
-includethe sharedSmallStepLib/GNUmakefile.include(from an app dir:-include ../SmallStepLib/GNUmakefile.include; from aTests/dir:-include ../../SmallStepLib/GNUmakefile.include). It is location-independent and providesSMALLSTEP_INCLUDE_DIRS,SMALLSTEP_LIB_PATHandSMALLSTEP_LDFLAGS; each app then adds-lSmallStepto its ownADDITIONAL_LDFLAGS/TOOL_LIBS.
Recommendation: Done — the shared snippet is SmallStepLib/GNUmakefile.include; new Small* apps (and their test makefiles) just -include it and paste the three-line link block.
- App delegate template: Minimal
SSAppDelegateimplementation (menu build + main window) as a starting point. - Document/window pattern: “One main window, one document type” helper (e.g. list + editor) is currently app-specific; could stay that way or become an optional pattern doc.
- Settings/preferences: If several apps need the same “load/save plist in Application Support” behaviour, a thin SSPreferences or SSSettings in SmallStep could be added later.
No code need be moved immediately; this doc is a reference for consistent patterns and future refactors.
| Concern | Source | Reuse / recommendation |
|---|---|---|
| App lifecycle | SmallStep | Use SSHostApplication + SSAppDelegate |
| Paths & file I/O | SmallStep | Use SSFileSystem everywhere |
| Main menu | SmallStep | Use SSMainMenu for simple apps |
| File dialogs | SmallStep | Use SSFileDialog for open/save |
| Optional libs | Per-app | Keep optional; document; no core extraction |
| Build | Per-app | Share SmallStep link snippet in docs |
SmallNote follows these recommendations and uses SmallStep for as much as possible; core note and to-do logic is implemented with Foundation only and no extra FOSS libraries.