Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/editor/common/viewModel/viewContext.ts
3294 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { IEditorConfiguration } from '../config/editorConfiguration.js';
7
import { ViewEventHandler } from '../viewEventHandler.js';
8
import { IViewLayout, IViewModel } from '../viewModel.js';
9
import { IColorTheme } from '../../../platform/theme/common/themeService.js';
10
import { EditorTheme } from '../editorTheme.js';
11
12
export class ViewContext {
13
14
public readonly configuration: IEditorConfiguration;
15
public readonly viewModel: IViewModel;
16
public readonly viewLayout: IViewLayout;
17
public readonly theme: EditorTheme;
18
19
constructor(
20
configuration: IEditorConfiguration,
21
theme: IColorTheme,
22
model: IViewModel
23
) {
24
this.configuration = configuration;
25
this.theme = new EditorTheme(theme);
26
this.viewModel = model;
27
this.viewLayout = model.viewLayout;
28
}
29
30
public addEventHandler(eventHandler: ViewEventHandler): void {
31
this.viewModel.addViewEventHandler(eventHandler);
32
}
33
34
public removeEventHandler(eventHandler: ViewEventHandler): void {
35
this.viewModel.removeViewEventHandler(eventHandler);
36
}
37
}
38
39