Add node introspection API

Closes #1110

Test Plan: query the introspectNode Endpoint from js

Reviewers: 

Pull Request: https://github.com/GraphiteEditor/Graphite/pull/1183
This commit is contained in:
Dennis Kobert
2023-04-28 00:20:39 +02:00
committed by Keavon Chambers
parent 0af42ee6f9
commit bea7cc8dd0
6 changed files with 48 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ use document_legacy::layers::layer_info::LayerDataType;
use document_legacy::layers::style::RenderData;
use document_legacy::Operation as DocumentOperation;
use graph_craft::document::value::TaggedValue;
use graph_craft::document::NodeInput;
use graph_craft::document::{NodeId, NodeInput};
use graphene_core::raster::Image;
use graphene_core::text::Font;
@@ -606,6 +606,10 @@ impl MessageHandler<PortfolioMessage, (&InputPreprocessorMessageHandler, &Prefer
}
impl PortfolioMessageHandler {
pub fn introspect_node(&self, node_path: &[NodeId]) -> Option<String> {
self.executor.introspect_node(node_path)
}
pub fn document(&self, document_id: u64) -> Option<&DocumentMessageHandler> {
self.documents.get(&document_id)
}