How mbasaglia/glaxnimate works
Project Type and Purpose
• Glaxnimate is a desktop (and mobile) vector-graphics animation application written in C++ with Qt5, offering import/export via various formats, a plugin architecture, and Python scripting bindings. It also builds for Android and exposes a Python module.
File Structure
• Top-level: CMakeLists.txt (build), data/ (assets & built-in plugins), external/ (third-party libs), src/ (core engine, GUI, Python bindings, Android port), test/ (unit tests), deploy/ (release scripts), docs/ (documentation), .github/.gitlab-ci (CI pipelines).
• src/core: the engine (model, math, I/O formats, plugin API).
• src/gui: Qt-based UI (views, controllers, widgets, tools).
• src/python: Python extension module wrapping core.
• src/android: Android-specific UI and JNI glue atop core.
• data/plugins: built-in Python plugins (AnimatedRaster, HueShift, etc.).
• deploy & CI folders: packaging and multi-platform build automation.
README Insights
• Confirms C++17 + Qt5 GUI, Python3 integration, reliance on external libraries (Potrace, libav, libarchive, zlib), multi-platform builds (Linux, macOS, Windows, Android).
Diagramming the Architecture
a. Main Components
• Core Engine Layer
• Model (src/core/model)
• Math & Geometry (src/core/math)
• I/O Subsystem (src/core/io)
• Plugin API (src/core/plugin)
• UI Layer
• Desktop GUI (src/gui: graphics, tools, widgets, item models)
• Android Frontend (src/android, JNI glue)
• Scripting Layer
• Python Extension (src/python) exposing core/plugin interfaces
• Python-based plugins (data/plugins/*.py)
• Data & Assets
• Built-in assets, emoji, templates, palettes (data/)
• External Dependencies
• Qt5, Potrace, libav*, libarchive, zlib
• Third-party modules (external/)
• Build & CI
• CMake, deploy scripts, GitHub/GitLab pipelines
b. Relationships & Data Flows
• Desktop GUI ←→ Core Engine
• GUI invokes core operations (model updates, rendering, file I/O).
• Core sends updates/events to GUI’s view components.
• Android Frontend ←→ Core Engine
• JNI layer calls into core for rendering and I/O.
• Scripting & Plugins ←→ Core Engine
• Python module & plugin manager load/execute scripts using core/plugin API.
• Core Engine ←→ I/O Subsystem ←→ External Libraries
• Format readers/writers depend on libav, libarchive, potrace, zlib.
• Build System → All Components
• CMake orchestrates compilation and linking for each target.
• CI Pipelines → Build & Test → Deploy
• Automated workflows for packaging (flatpak, snap, AppImage, pip).
c. Architectural Patterns & Principles
• Layered Architecture: clear separation of engine, UI, scripting, deployment.
• Model–View–Controller (model in core, views/widgets in GUI, controllers in tools & commands).
• Plugin‐Service Pattern: core/plugin defines interfaces for extensibility.
• Single vs. Multi‐Platform Abstraction: core is platform-agnostic, frontends handle OS specifics.
d. Key Technologies & Frameworks
• Language: C++17, Python3.
• GUI: Qt5 (Widgets, QML not used here).
• Build: CMake ≥3.5.
• External: Potrace (vectorization), FFmpeg/libav (video), libarchive (bundles), zlib.
• Packaging: flatpak, snapcraft, AppImage, pip, platform-specific scripts.