forked from 1b-agent/opencadstudio-upstream
OpenCADStudio no longer bundles plugins — every add-on is an external cdylib loaded from the plugins folder or installed via the marketplace. - Remove the demo plugin and the in-tree ocs_example_plugin crate. - Remove the inventory-based built-in registration path (PluginRegistration, all_plugins, installed_manifests); registry now serves core ribbon tabs plus loaded external plugins, and try_dispatch routes only to externals. - Plugin Manager drops the 'compiled into this build' section; the enable/disable toggle moves onto loaded external cards. - Prune the now-dead HostSession/DocumentTab helpers and re-exports. Part of the #100 extensibility epic (phase 2). Co-Authored-By: Claude Opus 4.8 <[email protected]>
38 lines
1.6 KiB
Rust
38 lines
1.6 KiB
Rust
// Module system — CadModule, ToolDef, RibbonGroup.
|
|
//
|
|
// To add a **core** ribbon tab (Home, View, …):
|
|
// 1. Create `src/modules/my_name/` directory (no `plugin.toml`)
|
|
// 2. Add `src/modules/my_name/mod.rs` implementing `CadModule` as `MyNameModule`
|
|
// 3. Add `pub mod my_name;` below
|
|
// 4. `cargo build` — tab appears via build.rs registry
|
|
//
|
|
// To add an **add-on plugin** (Storm Sewer, …):
|
|
// See `docs/plugin-architecture.md` and copy `docs/plugin-template/`.
|
|
//
|
|
// Each module folder contains:
|
|
// - mod.rs : module definition (ribbon groups + tool layout)
|
|
// - <tool>.rs : one file per tool (ribbon def + future command logic)
|
|
|
|
// ── Ribbon vocabulary (CadModule, ToolDef, RibbonGroup, …) ─────────────────
|
|
//
|
|
// These types moved to the dependency-free `ocs_plugin_api` crate so add-ons
|
|
// can target a semver-stable contract. Re-exported here to keep the long-used
|
|
// `crate::modules::{CadModule, ToolDef, …}` paths stable across the codebase.
|
|
pub use ocs_plugin_api::ribbon::{
|
|
CadModule, IconKind, ModuleEvent, RibbonGroup, RibbonItem, StyleKey, ToolDef,
|
|
};
|
|
|
|
// ── Module declarations ───────────────────────────────────────────────────
|
|
|
|
pub mod annotate;
|
|
pub mod draw;
|
|
pub mod insert;
|
|
pub mod model;
|
|
pub mod layout;
|
|
pub mod manage;
|
|
pub mod view;
|
|
|
|
// ── Auto-generated module registry ───────────────────────────────────────
|
|
// build.rs writes this file; it contains only `all_modules()`.
|
|
pub mod registry;
|