| 1 | #nullable enable |
| 2 | using CascadeIDE.Cockpit.Graph; |
| 3 | using CascadeIDE.Cockpit.Graph.Layout; |
| 4 | using CascadeIDE.Models; |
| 5 | using CascadeIDE.Services.CodeNavigation; |
| 6 | using CascadeIDE.Services.SkiaInstruments; |
| 7 | using CascadeIDE.ViewModels; |
| 8 | |
| 9 | namespace CascadeIDE.Features.WorkspaceNavigation.Application; |
| 10 | |
| 11 | public interface ICodeNavigationMapCompositor |
| 12 | : ISkiaInstrumentCompositor<CodeNavigationMapCompositionIntent, CodeNavigationMapCompositionResult> |
| 13 | { |
| 14 | CodeNavigationMapCompositionResult Compose( |
| 15 | GraphDocument doc, |
| 16 | string mapLevel, |
| 17 | double availableWidth, |
| 18 | double availableHeight, |
| 19 | CodeNavigationMapDetailLevel detailLevel = CodeNavigationMapDetailLevel.Normal); |
| 20 | } |
| 21 | |
| 22 | public sealed record CodeNavigationMapCompositionResult( |
| 23 | GraphLayoutScene LayoutScene, |
| 24 | double PreferredHeight, |
| 25 | IReadOnlyList<CodeNavigationMapInstrumentBlockDescriptor> CodeNavigationMapInstrumentBlocks) |
| 26 | { |
| 27 | public CodeNavigationMapGraphSceneVm ToSceneVm( |
| 28 | double layoutViewportWidth, |
| 29 | double layoutViewportHeight, |
| 30 | CodeNavigationMapSettings? mapSettings = null, |
| 31 | string? solutionPath = null) => |
| 32 | CodeNavigationMapGraphSceneProjection.ToViewModel( |
| 33 | LayoutScene, layoutViewportWidth, layoutViewportHeight, mapSettings, solutionPath); |
| 34 | } |
| 35 | |
| 36 | public sealed record CodeNavigationMapCompositionIntent( |
| 37 | GraphDocument Subgraph, |
| 38 | string MapLevel, |
| 39 | CodeNavigationMapDetailLevel DetailLevel = CodeNavigationMapDetailLevel.Normal, |
| 40 | string RelatedGraphLayout = CodeNavigationMapRelatedGraphLayoutKind.Radial, |
| 41 | string ControlFlowMainAxis = CodeNavigationMapControlFlowMainAxisKind.Auto); |
| 42 | |