Path: blob/main/src/vs/editor/common/viewModel/viewContext.ts
3294 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { IEditorConfiguration } from '../config/editorConfiguration.js';6import { ViewEventHandler } from '../viewEventHandler.js';7import { IViewLayout, IViewModel } from '../viewModel.js';8import { IColorTheme } from '../../../platform/theme/common/themeService.js';9import { EditorTheme } from '../editorTheme.js';1011export class ViewContext {1213public readonly configuration: IEditorConfiguration;14public readonly viewModel: IViewModel;15public readonly viewLayout: IViewLayout;16public readonly theme: EditorTheme;1718constructor(19configuration: IEditorConfiguration,20theme: IColorTheme,21model: IViewModel22) {23this.configuration = configuration;24this.theme = new EditorTheme(theme);25this.viewModel = model;26this.viewLayout = model.viewLayout;27}2829public addEventHandler(eventHandler: ViewEventHandler): void {30this.viewModel.addViewEventHandler(eventHandler);31}3233public removeEventHandler(eventHandler: ViewEventHandler): void {34this.viewModel.removeViewEventHandler(eventHandler);35}36}373839