TextEditorViewRenderer
Namespace: Hex1b
Assembly: Hex1b.dll
Renders document content as plain text lines. This is the default editor view.
public sealed class TextEditorViewRenderer : IEditorViewRendererInheritance
Object → TextEditorViewRenderer
Implements
Properties
Instance
Shared singleton instance (renderer is stateless).
Returns: TextEditorViewRenderer
public static TextEditorViewRenderer Instance { get; }Methods
GetMaxLineWidth(IHex1bDocument, int, int, int)
Returns the maximum visual width (in columns) needed for any line. Used for horizontal scroll calculations. For text view, this is the longest line length. For hex view, this is the computed row width (always ≤ viewport, so no horizontal scroll).
Parameters:
document(IHex1bDocument):scrollOffset(Int32):viewportLines(Int32):viewportColumns(Int32):
Returns: Int32
public int GetMaxLineWidth(IHex1bDocument document, int scrollOffset, int viewportLines, int viewportColumns)GetTotalLines(IHex1bDocument, int)
Returns the total number of visual lines this renderer needs for the document. For text view, this equals the document line count. For hex view, this depends on bytes per row (which may adapt to viewport width).
Parameters:
document(IHex1bDocument): The document being rendered.viewportColumns(Int32): Available width in columns. Responsive renderers use this to adapt layout.
Returns: Int32
public int GetTotalLines(IHex1bDocument document, int viewportColumns)HitTest(int, int, EditorState, int, int, int, int)
Converts screen-local coordinates (relative to viewport origin) to a document offset. Returns null if the position doesn't map to a valid document location.
Parameters:
localX(Int32): X coordinate relative to viewport left edge.localY(Int32): Y coordinate relative to viewport top edge.state(EditorState): The editor state (document).viewportColumns(Int32): Number of visible columns.viewportLines(Int32): Number of visible lines.scrollOffset(Int32): First visible line (1-based).horizontalScrollOffset(Int32): First visible column (0-based).
Returns: Nullable<DocumentOffset>
public DocumentOffset? HitTest(int localX, int localY, EditorState state, int viewportColumns, int viewportLines, int scrollOffset, int horizontalScrollOffset)Render(Hex1bRenderContext, EditorState, Rect, int, int, bool, char?, IReadOnlyList<ITextDecorationProvider>?, IReadOnlyList<InlineHint>?, bool, IReadOnlyList<FoldingRegion>?)
Renders the document content into the given viewport area.
Parameters:
context(Hex1bRenderContext): The render context and theme.state(EditorState): The editor state (document, cursors, selections).viewport(Rect): The screen area to render into.scrollOffset(Int32): First visible line (1-based).horizontalScrollOffset(Int32): First visible column (0-based).isFocused(Boolean): Whether the editor is currently focused.pendingNibble(Nullable<Char>): For hex renderers, the first nibble of a partially-entered byte (null if none).decorationProviders(IReadOnlyList<ITextDecorationProvider>): Optional text decoration providers for syntax highlighting and diagnostics.inlineHints(IReadOnlyList<InlineHint>): Optional inline hints (virtual text) to render at document positions.wordWrap(Boolean): Whether soft line wrapping is enabled.foldingRegions(IReadOnlyList<FoldingRegion>): Optional folding regions for collapsible code sections.
public void Render(Hex1bRenderContext context, EditorState state, Rect viewport, int scrollOffset, int horizontalScrollOffset, bool isFocused, char? pendingNibble = null, IReadOnlyList<ITextDecorationProvider>? decorationProviders = null, IReadOnlyList<InlineHint>? inlineHints = null, bool wordWrap = false, IReadOnlyList<FoldingRegion>? foldingRegions = null)