forked from 1b-agent/opencadstudio-upstream
feat(plugin): add layer creation and modification host API
- Add LayerConfig struct and add_layer / modify_layer methods to HostApi trait - Implement IPC request/response serialization for AddLayer and ModifyLayer - Implement HostSession methods with CAD property defaults and selective modification - Refresh layer panel UI and invalidate scene layer dependencies upon layer changes - Add unit tests for add_layer with defaults and partial modify_layer
This commit is contained in:
1 parent
28e530470f
commit
929f185ba5
6 files changed
+298
No files matched your search
@@ -138,6 +138,10 @@ pub enum PluginRequest {
|
||||
GetTabId,
|
||||
/// V5: ask the host for the filesystem path of the document in `tab_id`.
|
||||
DocumentPath { tab_id: u64 },
|
||||
/// Add a layer to the active document with full initial properties.
|
||||
AddLayer(crate::host::LayerConfig),
|
||||
/// Modify specified properties of an existing layer in the active document.
|
||||
ModifyLayer(crate::host::LayerConfig),
|
||||
}
|
||||
|
||||
/// Responses the host sends back for `PluginRequest`.
|
||||
@@ -164,6 +168,8 @@ pub enum PluginResponse {
|
||||
TabId(u64),
|
||||
/// V5: filesystem path of the document in the requested tab, if any.
|
||||
DocumentPath(Option<std::ffi::OsString>),
|
||||
/// Optional entity handle (e.g. from AddLayer).
|
||||
OptHandle(Option<Handle>),
|
||||
}
|
||||
|
||||
/// Messages sent from the host to the plugin runner.
|
||||
|
||||
Reference in new issue
Block a user