forked from 1b-agent/opencadstudio-upstream
Add demo_plugin and plugin host integration tests
Minimal in-tree add-on (DP_HELLO) validates registry, ribbon merge, and try_dispatch. Five new lib tests; EntryKind gains PartialEq for test helpers.
This commit is contained in:
1 parent
9f35456205
commit
82993bc1db
12 files changed
+214
-2
No files matched your search
@@ -0,0 +1,21 @@
|
||||
use crate::plugin::host::{BuiltinPlugin, HostSession};
|
||||
use crate::plugin::manifest::PluginManifest;
|
||||
|
||||
use super::dispatch;
|
||||
use super::manifest;
|
||||
|
||||
pub struct DemoPlugin;
|
||||
|
||||
impl BuiltinPlugin for DemoPlugin {
|
||||
fn manifest(&self) -> &'static PluginManifest {
|
||||
&manifest::MANIFEST
|
||||
}
|
||||
|
||||
fn ribbon(&self) -> Box<dyn crate::modules::CadModule> {
|
||||
Box::new(super::DemoPluginModule)
|
||||
}
|
||||
|
||||
fn dispatch(&self, host: &mut HostSession<'_>, cmd: &str) -> bool {
|
||||
dispatch::handle(host, cmd)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user