How processing/processing4 works
Major Components
• Core Engine (found under the “core” directory)
– Contains fundamental classes (such as PApplet, PGraphics, PImage, etc.) that form the rendering engine, input event loop, data structures, and overall sketch lifecycle.
• Application / IDE Layer (primarily in the “app” directory and parts of the “java” folder)
– Implements the Processing Development Environment (PDE) with UI components (editors, menus, toolbars, consoles) and user interaction management.
• Mode and Preprocessor Modules (located under “java/mode” and “java/preprocessor”)
– Provide code analysis, lexical parsing, preprocessing (e.g., transforming sketches into valid Java code), syntax highlighting, error detection, and code completion.
• Library Modules and Extensions (scattered in “java/libraries”, “core/library”, etc.)
– Include additional functionality (for example, handling PDFs, SVGs, networking, serial communication, IO, and other multimedia extensions) that enhance or extend the core engine.
• Build and Deployment Tools (directories such as “build”, “gradle”, “build.gradle.kts”, “ant”, etc.)
– These include scripts and configurations to compile and package the software for multiple platforms (macOS, Windows, Linux) as well as tools for signing, code formatting, and integration with continuous integration services.
• Testing and Examples (found in “app/test”, “core/test”, “java/test”)
– Provide unit, integration, and example sketches demonstrating usage and ensuring quality across the various modules.
Relationships and Data Flow
• The Application/IDE layer interacts with the Core Engine by calling its API functions (rendering, event-handling, etc.).
• The Mode and Preprocessor modules transform user sketches (source code) before these are compiled and run on top of the Core Engine.
• The Build and Deployment tools coordinate the compilation and packaging of the entire system across various platforms. Represent these as a “toolchain” that feeds into all modules.
Architectural Patterns and Technologies
• The project is modular and multi-layered. The separation between UI (IDE), business logic (core engine), and auxiliary components (modes, libraries, build scripts) is critical.
• Gradle is used for build automation and dependency management.
• The system leverages Java (and Kotlin for some build scripts) with object‐oriented design, along with some native interfaces (e.g., for platform-specific builds).
• Mention that preprocessor modules implement a transformation pipeline (similar to a compiler front-end) before compiling sketches.