Donner 0.8.0-pre
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
FocusView.h File Reference
#include <optional>
#include <span>
#include <vector>
#include "donner/svg/SVGDocument.h"
#include "donner/svg/SVGElement.h"
Include dependency graph for FocusView.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::editor::LineRange
 Half-open line range in zero-based editor line coordinates. More...
struct  donner::editor::SourcePoint
 Zero-based source coordinate in logical editor lines and columns. More...
 View-only connector from a source reference to the referenced source target. More...
struct  donner::editor::FocusPartition
 View-only source-pane partition for selected-element focus mode. More...
struct  donner::editor::StyleFocus
 Focus information for a stylesheet rule under the source cursor. More...
struct  donner::editor::ReferenceHighlightSummary
 Distinct same-document references related to the active selection. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Functions

FocusPartition donner::editor::ComputeFocusPartition (const svg::SVGDocument &document, const svg::SVGElement &selected)
 Compute the source-pane focus partition for selected.
FocusPartition donner::editor::ComputeFocusPartition (const svg::SVGDocument &document, std::span< const svg::SVGElement > selectedElements)
 Compute the source-pane focus partition for selectedElements.
std::optional< StyleFocusdonner::editor::ComputeStyleFocusAtSourceOffset (const svg::SVGDocument &document, std::size_t sourceOffset)
 Compute source-pane and canvas focus information for a stylesheet rule under sourceOffset.
std::optional< FocusPartitiondonner::editor::ComputeStyleFocusPartitionAtSourceOffset (const svg::SVGDocument &document, std::size_t sourceOffset)
 Compute a focus partition for a stylesheet rule under sourceOffset.
ReferenceHighlightSummary donner::editor::ComputeReferenceHighlightSummary (const svg::SVGDocument &document, std::span< const svg::SVGElement > selectedElements)
 Compute direct forward and reverse reference elements for selectedElements.

Function Documentation

◆ ComputeFocusPartition() [1/2]

FocusPartition donner::editor::ComputeFocusPartition ( const svg::SVGDocument & document,
const svg::SVGElement & selected )
nodiscard

Compute the source-pane focus partition for selected.

Parameters
documentSource-backed SVG document containing selected.
selectedElement whose source should remain fully visible.
Returns
Line partition for the source view, or an empty partition if source locations are absent.

◆ ComputeFocusPartition() [2/2]

FocusPartition donner::editor::ComputeFocusPartition ( const svg::SVGDocument & document,
std::span< const svg::SVGElement > selectedElements )
nodiscard

Compute the source-pane focus partition for selectedElements.

Parameters
documentSource-backed SVG document containing selectedElements.
selectedElementsElements whose source should remain fully visible.
Returns
Line partition for the source view, or an empty partition if source locations are absent.

◆ ComputeReferenceHighlightSummary()

ReferenceHighlightSummary donner::editor::ComputeReferenceHighlightSummary ( const svg::SVGDocument & document,
std::span< const svg::SVGElement > selectedElements )
nodiscard

Compute direct forward and reverse reference elements for selectedElements.

Forward references are same-document URL/href/CSS declaration refs from the selected elements. Reverse references are elements whose URL/href/CSS declaration refs point at a selected resource.

Parameters
documentSource-backed SVG document containing selectedElements.
selectedElementsElements whose related refs should be summarized.

◆ ComputeStyleFocusAtSourceOffset()

std::optional< StyleFocus > donner::editor::ComputeStyleFocusAtSourceOffset ( const svg::SVGDocument & document,
std::size_t sourceOffset )
nodiscard

Compute source-pane and canvas focus information for a stylesheet rule under sourceOffset.

Parameters
documentSource-backed SVG document to inspect.
sourceOffsetByte offset in document source.
Returns
Style focus information, or std::nullopt when sourceOffset is not inside a source-backed stylesheet rule.

◆ ComputeStyleFocusPartitionAtSourceOffset()

std::optional< FocusPartition > donner::editor::ComputeStyleFocusPartitionAtSourceOffset ( const svg::SVGDocument & document,
std::size_t sourceOffset )
nodiscard

Compute a focus partition for a stylesheet rule under sourceOffset.

When sourceOffset is inside an author <style> rule, the resulting focus set shows the matched rule, elements impacted by that selector, their ancestor context, and resources referenced by the rule. Returns std::nullopt when the offset is not inside a source-backed stylesheet rule.

Parameters
documentSource-backed SVG document to inspect.
sourceOffsetByte offset in document source.