Class RenderCoordinator
- Namespace
- SharpConsoleUI.Rendering
- Assembly
- SharpConsoleUI.dll
Coordinates all rendering operations for the console window system. Handles window rendering, status bar display, caching, and performance metrics. Extracted from ConsoleWindowSystem as part of Phase 1.2 refactoring.
public class RenderCoordinator
- Inheritance
-
RenderCoordinator
- Inherited Members
- Extension Methods
Constructors
RenderCoordinator(IConsoleDriver, Renderer, WindowStateService, StatusBarStateService, ILogService, ConsoleWindowSystem, Func<ConsoleWindowSystemOptions>, PerformanceTracker)
Initializes a new instance of the RenderCoordinator class.
public RenderCoordinator(IConsoleDriver consoleDriver, Renderer renderer, WindowStateService windowStateService, StatusBarStateService statusBarStateService, ILogService logService, ConsoleWindowSystem windowSystemContext, Func<ConsoleWindowSystemOptions> getOptions, PerformanceTracker performanceTracker)
Parameters
consoleDriverIConsoleDriverConsole driver for low-level I/O.
rendererRendererRenderer for window and content rendering.
windowStateServiceWindowStateServiceService managing window state and Z-order.
statusBarStateServiceStatusBarStateServiceService managing status bar state and Start menu.
logServiceILogServiceService for debug logging.
windowSystemContextConsoleWindowSystemContext providing access to window system properties.
getOptionsFunc<ConsoleWindowSystemOptions>Getter for current configuration options (allows runtime changes).
performanceTrackerPerformanceTrackerPerformance metrics tracker.
Properties
BottomStatusBarBounds
Gets the bottom status bar bounds for mouse hit testing.
public Rectangle BottomStatusBarBounds { get; }
Property Value
DesktopNeedsRender
Gets or sets whether the desktop needs to render on the next frame. This forces UpdateDisplay() to run even when no windows are dirty. Automatically cleared after rendering.
public bool DesktopNeedsRender { get; set; }
Property Value
StartButtonBounds
Gets the start button bounds for mouse hit testing.
public Rectangle StartButtonBounds { get; }
Property Value
TopStatusBarBounds
Gets the top status bar bounds for mouse hit testing.
public Rectangle TopStatusBarBounds { get; }
Property Value
Methods
AddPendingDesktopClear(Rectangle)
Adds a desktop area to be cleared on the next render. Used for atomic clearing of old window positions.
public void AddPendingDesktopClear(Rectangle rect)
Parameters
rectRectangleThe rectangle to clear.
AddWindowNeedingRegionUpdate(Window)
Adds a window to the set of windows needing region update.
public void AddWindowNeedingRegionUpdate(Window window)
Parameters
windowWindowThe window needing a region update.
GetBottomStatusHeight()
Gets the height occupied by the bottom status bar (0 or 1). Accounts for both status text and Start button.
public int GetBottomStatusHeight()
Returns
GetTopStatusHeight()
Gets the height occupied by the top status bar (0 or 1). Accounts for both status text and performance metrics.
public int GetTopStatusHeight()
Returns
InvalidateAllWindows()
Invalidates all windows and status bars, forcing a complete redraw. Call this after theme changes, status bar visibility changes, or other global UI updates.
public void InvalidateAllWindows()
InvalidateStatusCache()
Invalidates all status bar caches, forcing them to be rebuilt on next render. Call this when window state, titles, or themes change.
public void InvalidateStatusCache()
IsStatusBarDirty()
Returns true if status bar content has changed since last render. Compares current state against cached values without triggering a render.
public bool IsStatusBarDirty()
Returns
RestorePortalRegions(DesktopPortal)
Restores screen regions that were covered by portal control bounds. Called by DesktopPortalService when portals are removed.
public void RestorePortalRegions(DesktopPortal portal)
Parameters
portalDesktopPortalThe portal being removed (provides bounds and control bounds).
UpdateDisplay()
Main rendering orchestrator. Renders all dirty windows, status bars, and flushes to console.
public void UpdateDisplay()
UpdateStatusBarBounds()
Updates the status bar bounds based on current screen size and configuration. Call this after screen resizes or configuration changes.
public void UpdateStatusBarBounds()