forked from 1b-agent/opencadstudio-upstream
Add plugin host architecture and Storm Sewer add-on package
Generic plugin runtime (src/plugin/, HostSession, per-tab plugin_state, command router). QGIS-style add-on layout with plugin.toml and single PluginRegistration. Storm Sewer refactored as reference consumer with dispatch.rs, catchments, LandXML, headless tests (43 passing). Core update.rs decoupled from storm_sewer via CadCommand object-pick hooks. Docs: plugin-architecture.md, plugin-template, PR and issue-78 reply drafts.
This commit is contained in:
1 parent
1199895f0e
commit
e46701456f
66 files changed
+4538
-141
No files matched your search
@@ -0,0 +1,17 @@
|
||||
// Plugin traits — HostSession lives in `app::plugin_host` (same-crate field access).
|
||||
|
||||
pub(crate) use crate::app::plugin_host::HostSession;
|
||||
|
||||
use crate::modules::CadModule;
|
||||
|
||||
use super::manifest::PluginManifest;
|
||||
|
||||
/// Add-on package entry point (phase 1: in-tree, in-process).
|
||||
///
|
||||
/// One `PluginRegistration` per package — ribbon tab, manifest, and command
|
||||
/// dispatch are owned here. See `docs/plugin-architecture.md`.
|
||||
pub trait BuiltinPlugin: Send + Sync {
|
||||
fn manifest(&self) -> &'static PluginManifest;
|
||||
fn ribbon(&self) -> Box<dyn CadModule>;
|
||||
fn dispatch(&self, host: &mut HostSession<'_>, cmd: &str) -> bool;
|
||||
}
|
||||
Reference in new issue
Block a user