Remove renderer circular dep on renderservice
Also fix super.dispose not being called correctly on RenderService
This commit is contained in:
@@ -15,13 +15,14 @@ import { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants';
|
|||||||
import { RenderModel, COMBINED_CHAR_BIT_MASK } from './RenderModel';
|
import { RenderModel, COMBINED_CHAR_BIT_MASK } from './RenderModel';
|
||||||
import { Disposable } from 'common/Lifecycle';
|
import { Disposable } from 'common/Lifecycle';
|
||||||
import { DEFAULT_COLOR, CHAR_DATA_CHAR_INDEX, CHAR_DATA_CODE_INDEX, NULL_CELL_CODE } from 'common/buffer/Constants';
|
import { DEFAULT_COLOR, CHAR_DATA_CHAR_INDEX, CHAR_DATA_CODE_INDEX, NULL_CELL_CODE } from 'common/buffer/Constants';
|
||||||
import { Terminal } from 'xterm';
|
import { Terminal, IEvent } from 'xterm';
|
||||||
import { getLuminance } from './ColorUtils';
|
import { getLuminance } from './ColorUtils';
|
||||||
import { IRenderLayer } from './renderLayer/Types';
|
import { IRenderLayer } from './renderLayer/Types';
|
||||||
import { IRenderDimensions, IRenderer } from 'browser/renderer/Types';
|
import { IRenderDimensions, IRenderer, IRequestRefreshRowsEvent } from 'browser/renderer/Types';
|
||||||
import { IColorSet } from 'browser/Types';
|
import { IColorSet } from 'browser/Types';
|
||||||
import { FLAGS } from './Constants';
|
import { FLAGS } from './Constants';
|
||||||
import { getCompatAttr } from './CharDataCompat';
|
import { getCompatAttr } from './CharDataCompat';
|
||||||
|
import { EventEmitter } from 'common/EventEmitter';
|
||||||
|
|
||||||
export const INDICIES_PER_CELL = 4;
|
export const INDICIES_PER_CELL = 4;
|
||||||
|
|
||||||
@@ -41,6 +42,9 @@ export class WebglRenderer extends Disposable implements IRenderer {
|
|||||||
|
|
||||||
private _core: ITerminal;
|
private _core: ITerminal;
|
||||||
|
|
||||||
|
private _onRequestRefreshRows = new EventEmitter<IRequestRefreshRowsEvent>();
|
||||||
|
public get onRequestRefreshRows(): IEvent<IRequestRefreshRowsEvent> { return this._onRequestRefreshRows.event; }
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private _terminal: Terminal,
|
private _terminal: Terminal,
|
||||||
private _colors: IColorSet,
|
private _colors: IColorSet,
|
||||||
@@ -54,7 +58,7 @@ export class WebglRenderer extends Disposable implements IRenderer {
|
|||||||
|
|
||||||
this._renderLayers = [
|
this._renderLayers = [
|
||||||
new LinkRenderLayer(this._core.screenElement, 2, this._colors, this._core),
|
new LinkRenderLayer(this._core.screenElement, 2, this._colors, this._core),
|
||||||
new CursorRenderLayer(this._core.screenElement, 3, this._colors)
|
new CursorRenderLayer(this._core.screenElement, 3, this._colors, this._onRequestRefreshRows)
|
||||||
];
|
];
|
||||||
this.dimensions = {
|
this.dimensions = {
|
||||||
scaledCharWidth: 0,
|
scaledCharWidth: 0,
|
||||||
@@ -186,7 +190,7 @@ export class WebglRenderer extends Disposable implements IRenderer {
|
|||||||
this._glyphRenderer.updateSelection(this._model, columnSelectMode);
|
this._glyphRenderer.updateSelection(this._model, columnSelectMode);
|
||||||
|
|
||||||
// TODO: #2102 Should this move to RenderCoordinator?
|
// TODO: #2102 Should this move to RenderCoordinator?
|
||||||
this._core.refresh(0, this._terminal.rows - 1);
|
this._onRequestRefreshRows.fire({ start: 0, end: this._terminal.rows - 1 });
|
||||||
}
|
}
|
||||||
|
|
||||||
public onCursorMove(): void {
|
public onCursorMove(): void {
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import { BaseRenderLayer } from './BaseRenderLayer';
|
|||||||
import { ICellData } from 'common/Types';
|
import { ICellData } from 'common/Types';
|
||||||
import { CellData } from 'common/buffer/CellData';
|
import { CellData } from 'common/buffer/CellData';
|
||||||
import { IColorSet } from 'browser/Types';
|
import { IColorSet } from 'browser/Types';
|
||||||
import { IRenderDimensions } from 'browser/renderer/Types';
|
import { IRenderDimensions, IRequestRefreshRowsEvent } from 'browser/renderer/Types';
|
||||||
|
import { IEventEmitter } from 'common/EventEmitter';
|
||||||
|
|
||||||
interface ICursorState {
|
interface ICursorState {
|
||||||
x: number;
|
x: number;
|
||||||
@@ -29,7 +30,12 @@ export class CursorRenderLayer extends BaseRenderLayer {
|
|||||||
private _cursorBlinkStateManager: CursorBlinkStateManager | undefined;
|
private _cursorBlinkStateManager: CursorBlinkStateManager | undefined;
|
||||||
private _cell: ICellData = new CellData();
|
private _cell: ICellData = new CellData();
|
||||||
|
|
||||||
constructor(container: HTMLElement, zIndex: number, colors: IColorSet) {
|
constructor(
|
||||||
|
container: HTMLElement,
|
||||||
|
zIndex: number,
|
||||||
|
colors: IColorSet,
|
||||||
|
private _onRequestRefreshRowsEvent: IEventEmitter<IRequestRefreshRowsEvent>
|
||||||
|
) {
|
||||||
super(container, 'cursor', zIndex, true, colors);
|
super(container, 'cursor', zIndex, true, colors);
|
||||||
this._state = {
|
this._state = {
|
||||||
x: 0,
|
x: 0,
|
||||||
@@ -70,14 +76,14 @@ export class CursorRenderLayer extends BaseRenderLayer {
|
|||||||
if (this._cursorBlinkStateManager) {
|
if (this._cursorBlinkStateManager) {
|
||||||
this._cursorBlinkStateManager.pause();
|
this._cursorBlinkStateManager.pause();
|
||||||
}
|
}
|
||||||
terminal.refresh(terminal.buffer.cursorY, terminal.buffer.cursorY);
|
this._onRequestRefreshRowsEvent.fire({ start: terminal.buffer.cursorY, end: terminal.buffer.cursorY });
|
||||||
}
|
}
|
||||||
|
|
||||||
public onFocus(terminal: Terminal): void {
|
public onFocus(terminal: Terminal): void {
|
||||||
if (this._cursorBlinkStateManager) {
|
if (this._cursorBlinkStateManager) {
|
||||||
this._cursorBlinkStateManager.resume(terminal);
|
this._cursorBlinkStateManager.resume(terminal);
|
||||||
} else {
|
} else {
|
||||||
terminal.refresh(terminal.buffer.cursorY, terminal.buffer.cursorY);
|
this._onRequestRefreshRowsEvent.fire({ start: terminal.buffer.cursorY, end: terminal.buffer.cursorY });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +101,7 @@ export class CursorRenderLayer extends BaseRenderLayer {
|
|||||||
}
|
}
|
||||||
// Request a refresh from the terminal as management of rendering is being
|
// Request a refresh from the terminal as management of rendering is being
|
||||||
// moved back to the terminal
|
// moved back to the terminal
|
||||||
terminal.refresh(terminal.buffer.cursorY, terminal.buffer.cursorY);
|
this._onRequestRefreshRowsEvent.fire({ start: terminal.buffer.cursorY, end: terminal.buffer.cursorY });
|
||||||
}
|
}
|
||||||
|
|
||||||
public onCursorMove(terminal: Terminal): void {
|
public onCursorMove(terminal: Terminal): void {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { IRenderer, IRenderDimensions, CharacterJoinerHandler } from 'browser/renderer/Types';
|
import { IRenderer, IRenderDimensions, CharacterJoinerHandler, IRequestRefreshRowsEvent } from 'browser/renderer/Types';
|
||||||
import { IInputHandlingTerminal, ICompositionHelper, ITerminal, IBrowser, ITerminalOptions } from './Types';
|
import { IInputHandlingTerminal, ICompositionHelper, ITerminal, IBrowser, ITerminalOptions } from './Types';
|
||||||
import { IBuffer, IBufferStringIterator, IBufferSet } from 'common/buffer/Types';
|
import { IBuffer, IBufferStringIterator, IBufferSet } from 'common/buffer/Types';
|
||||||
import { IBufferLine, ICellData, IAttributeData, ICircularList, XtermListener, ICharset, CoreMouseEventType } from 'common/Types';
|
import { IBufferLine, ICellData, IAttributeData, ICircularList, XtermListener, ICharset, CoreMouseEventType } from 'common/Types';
|
||||||
@@ -362,6 +362,7 @@ export class MockBuffer implements IBuffer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class MockRenderer implements IRenderer {
|
export class MockRenderer implements IRenderer {
|
||||||
|
onRequestRefreshRows: IEvent<IRequestRefreshRowsEvent>;
|
||||||
onCanvasResize: IEvent<{ width: number; height: number; }>;
|
onCanvasResize: IEvent<{ width: number; height: number; }>;
|
||||||
onRender: IEvent<{ start: number; end: number; }>;
|
onRender: IEvent<{ start: number; end: number; }>;
|
||||||
dispose(): void {
|
dispose(): void {
|
||||||
|
|||||||
Vendored
+8
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
import { IDisposable } from 'common/Types';
|
import { IDisposable } from 'common/Types';
|
||||||
import { IColorSet } from 'browser/Types';
|
import { IColorSet } from 'browser/Types';
|
||||||
|
import { IEvent } from 'common/EventEmitter';
|
||||||
|
|
||||||
export type CharacterJoinerHandler = (text: string) => [number, number][];
|
export type CharacterJoinerHandler = (text: string) => [number, number][];
|
||||||
|
|
||||||
@@ -23,6 +24,11 @@ export interface IRenderDimensions {
|
|||||||
actualCellHeight: number;
|
actualCellHeight: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IRequestRefreshRowsEvent {
|
||||||
|
start: number;
|
||||||
|
end: number;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Note that IRenderer implementations should emit the refresh event after
|
* Note that IRenderer implementations should emit the refresh event after
|
||||||
* rendering rows to the screen.
|
* rendering rows to the screen.
|
||||||
@@ -30,6 +36,8 @@ export interface IRenderDimensions {
|
|||||||
export interface IRenderer extends IDisposable {
|
export interface IRenderer extends IDisposable {
|
||||||
readonly dimensions: IRenderDimensions;
|
readonly dimensions: IRenderDimensions;
|
||||||
|
|
||||||
|
readonly onRequestRefreshRows: IEvent<IRequestRefreshRowsEvent>;
|
||||||
|
|
||||||
dispose(): void;
|
dispose(): void;
|
||||||
setColors(colors: IColorSet): void;
|
setColors(colors: IColorSet): void;
|
||||||
onDevicePixelRatioChange(): void;
|
onDevicePixelRatioChange(): void;
|
||||||
|
|||||||
@@ -3,13 +3,14 @@
|
|||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { IRenderer, IRenderDimensions, CharacterJoinerHandler } from 'browser/renderer/Types';
|
import { IRenderer, IRenderDimensions, CharacterJoinerHandler, IRequestRefreshRowsEvent } from 'browser/renderer/Types';
|
||||||
import { BOLD_CLASS, ITALIC_CLASS, CURSOR_CLASS, CURSOR_STYLE_BLOCK_CLASS, CURSOR_BLINK_CLASS, CURSOR_STYLE_BAR_CLASS, CURSOR_STYLE_UNDERLINE_CLASS, DomRendererRowFactory } from 'browser/renderer/dom/DomRendererRowFactory';
|
import { BOLD_CLASS, ITALIC_CLASS, CURSOR_CLASS, CURSOR_STYLE_BLOCK_CLASS, CURSOR_BLINK_CLASS, CURSOR_STYLE_BAR_CLASS, CURSOR_STYLE_UNDERLINE_CLASS, DomRendererRowFactory } from 'browser/renderer/dom/DomRendererRowFactory';
|
||||||
import { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants';
|
import { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants';
|
||||||
import { Disposable } from 'common/Lifecycle';
|
import { Disposable } from 'common/Lifecycle';
|
||||||
import { IColorSet, ILinkifierEvent, ILinkifier } from 'browser/Types';
|
import { IColorSet, ILinkifierEvent, ILinkifier } from 'browser/Types';
|
||||||
import { ICharSizeService, IRenderService } from 'browser/services/Services';
|
import { ICharSizeService } from 'browser/services/Services';
|
||||||
import { IOptionsService, IBufferService } from 'common/services/Services';
|
import { IOptionsService, IBufferService } from 'common/services/Services';
|
||||||
|
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||||
|
|
||||||
const TERMINAL_CLASS_PREFIX = 'xterm-dom-renderer-owner-';
|
const TERMINAL_CLASS_PREFIX = 'xterm-dom-renderer-owner-';
|
||||||
const ROW_CONTAINER_CLASS = 'xterm-rows';
|
const ROW_CONTAINER_CLASS = 'xterm-rows';
|
||||||
@@ -37,6 +38,9 @@ export class DomRenderer extends Disposable implements IRenderer {
|
|||||||
|
|
||||||
public dimensions: IRenderDimensions;
|
public dimensions: IRenderDimensions;
|
||||||
|
|
||||||
|
private _onRequestRefreshRows = new EventEmitter<IRequestRefreshRowsEvent>();
|
||||||
|
public get onRequestRefreshRows(): IEvent<IRequestRefreshRowsEvent> { return this._onRequestRefreshRows.event; }
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private _colors: IColorSet,
|
private _colors: IColorSet,
|
||||||
private readonly _element: HTMLElement,
|
private readonly _element: HTMLElement,
|
||||||
@@ -45,8 +49,7 @@ export class DomRenderer extends Disposable implements IRenderer {
|
|||||||
private readonly _linkifier: ILinkifier,
|
private readonly _linkifier: ILinkifier,
|
||||||
@ICharSizeService private readonly _charSizeService: ICharSizeService,
|
@ICharSizeService private readonly _charSizeService: ICharSizeService,
|
||||||
@IOptionsService private readonly _optionsService: IOptionsService,
|
@IOptionsService private readonly _optionsService: IOptionsService,
|
||||||
@IBufferService private readonly _bufferService: IBufferService,
|
@IBufferService private readonly _bufferService: IBufferService
|
||||||
@IRenderService private readonly _renderService: IRenderService
|
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
@@ -337,7 +340,7 @@ export class DomRenderer extends Disposable implements IRenderer {
|
|||||||
// Force a refresh
|
// Force a refresh
|
||||||
this._updateDimensions();
|
this._updateDimensions();
|
||||||
this._injectCss();
|
this._injectCss();
|
||||||
this._renderService.refreshRows(0, this._bufferService.rows - 1);
|
this._onRequestRefreshRows.fire({ start: 0, end: this._bufferService.rows - 1 });
|
||||||
}
|
}
|
||||||
|
|
||||||
public clear(): void {
|
public clear(): void {
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ export class RenderService extends Disposable implements IRenderService {
|
|||||||
this.register(optionsService.onOptionChange(() => this._renderer.onOptionsChanged()));
|
this.register(optionsService.onOptionChange(() => this._renderer.onOptionsChanged()));
|
||||||
this.register(charSizeService.onCharSizeChange(() => this.onCharSizeChanged()));
|
this.register(charSizeService.onCharSizeChange(() => this.onCharSizeChanged()));
|
||||||
|
|
||||||
|
// No need to register this as renderer is explicitly disposed in RenderService.dispose
|
||||||
|
this._renderer.onRequestRefreshRows(e => this.refreshRows(e.start, e.end));
|
||||||
|
|
||||||
// dprchange should handle this case, we need this as well for browsers that don't support the
|
// dprchange should handle this case, we need this as well for browsers that don't support the
|
||||||
// matchMedia query.
|
// matchMedia query.
|
||||||
this.register(addDisposableDomListener(window, 'resize', () => this.onDevicePixelRatioChange()));
|
this.register(addDisposableDomListener(window, 'resize', () => this.onDevicePixelRatioChange()));
|
||||||
@@ -105,12 +108,14 @@ export class RenderService extends Disposable implements IRenderService {
|
|||||||
|
|
||||||
public dispose(): void {
|
public dispose(): void {
|
||||||
this._renderer.dispose();
|
this._renderer.dispose();
|
||||||
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public setRenderer(renderer: IRenderer): void {
|
public setRenderer(renderer: IRenderer): void {
|
||||||
// TODO: RenderService should be the only one to dispose the renderer
|
// TODO: RenderService should be the only one to dispose the renderer
|
||||||
this._renderer.dispose();
|
this._renderer.dispose();
|
||||||
this._renderer = renderer;
|
this._renderer = renderer;
|
||||||
|
this._renderer.onRequestRefreshRows(e => this.refreshRows(e.start, e.end));
|
||||||
this.refreshRows(0, this._rowCount - 1);
|
this.refreshRows(0, this._rowCount - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,13 +3,14 @@
|
|||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { IRenderDimensions } from 'browser/renderer/Types';
|
import { IRenderDimensions, IRequestRefreshRowsEvent } from 'browser/renderer/Types';
|
||||||
import { BaseRenderLayer } from '../browser/renderer/BaseRenderLayer';
|
import { BaseRenderLayer } from '../browser/renderer/BaseRenderLayer';
|
||||||
import { ITerminal } from '../Types';
|
import { ITerminal } from '../Types';
|
||||||
import { ICellData } from 'common/Types';
|
import { ICellData } from 'common/Types';
|
||||||
import { CellData } from 'common/buffer/CellData';
|
import { CellData } from 'common/buffer/CellData';
|
||||||
import { IColorSet } from 'browser/Types';
|
import { IColorSet } from 'browser/Types';
|
||||||
import { IBufferService, IOptionsService } from 'common/services/Services';
|
import { IBufferService, IOptionsService } from 'common/services/Services';
|
||||||
|
import { IEventEmitter } from 'common/EventEmitter';
|
||||||
|
|
||||||
interface ICursorState {
|
interface ICursorState {
|
||||||
x: number;
|
x: number;
|
||||||
@@ -36,6 +37,7 @@ export class CursorRenderLayer extends BaseRenderLayer {
|
|||||||
colors: IColorSet,
|
colors: IColorSet,
|
||||||
private _terminal: ITerminal,
|
private _terminal: ITerminal,
|
||||||
rendererId: number,
|
rendererId: number,
|
||||||
|
private _onRequestRefreshRowsEvent: IEventEmitter<IRequestRefreshRowsEvent>,
|
||||||
readonly bufferService: IBufferService,
|
readonly bufferService: IBufferService,
|
||||||
readonly optionsService: IOptionsService
|
readonly optionsService: IOptionsService
|
||||||
) {
|
) {
|
||||||
@@ -80,14 +82,14 @@ export class CursorRenderLayer extends BaseRenderLayer {
|
|||||||
if (this._cursorBlinkStateManager) {
|
if (this._cursorBlinkStateManager) {
|
||||||
this._cursorBlinkStateManager.pause();
|
this._cursorBlinkStateManager.pause();
|
||||||
}
|
}
|
||||||
this._terminal.refresh(this._bufferService.buffer.y, this._bufferService.buffer.y);
|
this._onRequestRefreshRowsEvent.fire({ start: this._bufferService.buffer.y, end: this._bufferService.buffer.y });
|
||||||
}
|
}
|
||||||
|
|
||||||
public onFocus(): void {
|
public onFocus(): void {
|
||||||
if (this._cursorBlinkStateManager) {
|
if (this._cursorBlinkStateManager) {
|
||||||
this._cursorBlinkStateManager.resume();
|
this._cursorBlinkStateManager.resume();
|
||||||
} else {
|
} else {
|
||||||
this._terminal.refresh(this._bufferService.buffer.y, this._bufferService.buffer.y);
|
this._onRequestRefreshRowsEvent.fire({ start: this._bufferService.buffer.y, end: this._bufferService.buffer.y });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,7 +108,7 @@ export class CursorRenderLayer extends BaseRenderLayer {
|
|||||||
}
|
}
|
||||||
// Request a refresh from the terminal as management of rendering is being
|
// Request a refresh from the terminal as management of rendering is being
|
||||||
// moved back to the terminal
|
// moved back to the terminal
|
||||||
this._terminal.refresh(this._bufferService.buffer.y, this._bufferService.buffer.y);
|
this._onRequestRefreshRowsEvent.fire({ start: this._bufferService.buffer.y, end: this._bufferService.buffer.y });
|
||||||
}
|
}
|
||||||
|
|
||||||
public onCursorMove(): void {
|
public onCursorMove(): void {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
import { TextRenderLayer } from '../browser/renderer/TextRenderLayer';
|
import { TextRenderLayer } from '../browser/renderer/TextRenderLayer';
|
||||||
import { SelectionRenderLayer } from '../browser/renderer/SelectionRenderLayer';
|
import { SelectionRenderLayer } from '../browser/renderer/SelectionRenderLayer';
|
||||||
import { CursorRenderLayer } from './CursorRenderLayer';
|
import { CursorRenderLayer } from './CursorRenderLayer';
|
||||||
import { IRenderLayer, IRenderer, IRenderDimensions, CharacterJoinerHandler, ICharacterJoinerRegistry } from 'browser/renderer/Types';
|
import { IRenderLayer, IRenderer, IRenderDimensions, CharacterJoinerHandler, ICharacterJoinerRegistry, IRequestRefreshRowsEvent } from 'browser/renderer/Types';
|
||||||
import { ITerminal } from '../Types';
|
import { ITerminal } from '../Types';
|
||||||
import { LinkRenderLayer } from '../browser/renderer/LinkRenderLayer';
|
import { LinkRenderLayer } from '../browser/renderer/LinkRenderLayer';
|
||||||
import { CharacterJoinerRegistry } from 'browser/renderer/CharacterJoinerRegistry';
|
import { CharacterJoinerRegistry } from 'browser/renderer/CharacterJoinerRegistry';
|
||||||
@@ -15,6 +15,7 @@ import { IColorSet } from 'browser/Types';
|
|||||||
import { ICharSizeService } from 'browser/services/Services';
|
import { ICharSizeService } from 'browser/services/Services';
|
||||||
import { IBufferService, IOptionsService } from 'common/services/Services';
|
import { IBufferService, IOptionsService } from 'common/services/Services';
|
||||||
import { removeTerminalFromCache } from 'browser/renderer/atlas/CharAtlasCache';
|
import { removeTerminalFromCache } from 'browser/renderer/atlas/CharAtlasCache';
|
||||||
|
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||||
|
|
||||||
let nextRendererId = 1;
|
let nextRendererId = 1;
|
||||||
|
|
||||||
@@ -27,6 +28,9 @@ export class Renderer extends Disposable implements IRenderer {
|
|||||||
|
|
||||||
public dimensions: IRenderDimensions;
|
public dimensions: IRenderDimensions;
|
||||||
|
|
||||||
|
private _onRequestRefreshRows = new EventEmitter<IRequestRefreshRowsEvent>();
|
||||||
|
public get onRequestRefreshRows(): IEvent<IRequestRefreshRowsEvent> { return this._onRequestRefreshRows.event; }
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private _colors: IColorSet,
|
private _colors: IColorSet,
|
||||||
private readonly _terminal: ITerminal,
|
private readonly _terminal: ITerminal,
|
||||||
@@ -42,7 +46,7 @@ export class Renderer extends Disposable implements IRenderer {
|
|||||||
new TextRenderLayer(this._terminal.screenElement, 0, this._colors, this._characterJoinerRegistry, allowTransparency, this._id, this._bufferService, _optionsService),
|
new TextRenderLayer(this._terminal.screenElement, 0, this._colors, this._characterJoinerRegistry, allowTransparency, this._id, this._bufferService, _optionsService),
|
||||||
new SelectionRenderLayer(this._terminal.screenElement, 1, this._colors, this._id, this._bufferService, _optionsService),
|
new SelectionRenderLayer(this._terminal.screenElement, 1, this._colors, this._id, this._bufferService, _optionsService),
|
||||||
new LinkRenderLayer(this._terminal.screenElement, 2, this._colors, this._id, this._terminal.linkifier, this._bufferService, _optionsService),
|
new LinkRenderLayer(this._terminal.screenElement, 2, this._colors, this._id, this._terminal.linkifier, this._bufferService, _optionsService),
|
||||||
new CursorRenderLayer(this._terminal.screenElement, 3, this._colors, this._terminal, this._id, this._bufferService, _optionsService)
|
new CursorRenderLayer(this._terminal.screenElement, 3, this._colors, this._terminal, this._id, this._onRequestRefreshRows, this._bufferService, _optionsService)
|
||||||
];
|
];
|
||||||
this.dimensions = {
|
this.dimensions = {
|
||||||
scaledCharWidth: null,
|
scaledCharWidth: null,
|
||||||
|
|||||||
Reference in New Issue
Block a user