-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVtIo.hpp
More file actions
76 lines (57 loc) · 2.22 KB
/
Copy pathVtIo.hpp
File metadata and controls
76 lines (57 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#pragma once
#include "..\inc\VtIoModes.hpp"
#include "..\inc\ITerminalOwner.hpp"
#include "..\renderer\vt\vtrenderer.hpp"
#include "VtInputThread.hpp"
#include "PtySignalInputThread.hpp"
class ConsoleArguments;
namespace Microsoft::Console::VirtualTerminal
{
class VtIo : public Microsoft::Console::ITerminalOwner
{
public:
VtIo();
virtual ~VtIo() override = default;
[[nodiscard]]
HRESULT Initialize(const ConsoleArguments* const pArgs);
[[nodiscard]]
HRESULT CreateAndStartSignalThread() noexcept;
[[nodiscard]]
HRESULT CreateIoHandlers() noexcept;
bool IsUsingVt() const;
[[nodiscard]]
HRESULT StartIfNeeded();
[[nodiscard]]
static HRESULT ParseIoMode(const std::wstring& VtMode, _Out_ VtIoMode& ioMode);
[[nodiscard]]
HRESULT SuppressResizeRepaint();
[[nodiscard]]
HRESULT SetCursorPosition(const COORD coordCursor);
void CloseInput() override;
void CloseOutput() override;
private:
// After CreateIoHandlers is called, these will be invalid.
wil::unique_hfile _hInput;
wil::unique_hfile _hOutput;
// After CreateAndStartSignalThread is called, this will be invalid.
wil::unique_hfile _hSignal;
VtIoMode _IoMode;
bool _initialized;
bool _objectsCreated;
bool _lookingForCursorPosition;
std::mutex _shutdownLock;
std::unique_ptr<Microsoft::Console::Render::VtEngine> _pVtRenderEngine;
std::unique_ptr<Microsoft::Console::VtInputThread> _pVtInputThread;
std::unique_ptr<Microsoft::Console::PtySignalInputThread> _pPtySignalInputThread;
[[nodiscard]]
HRESULT _Initialize(const HANDLE InHandle, const HANDLE OutHandle, const std::wstring& VtMode);
[[nodiscard]]
HRESULT _Initialize(const HANDLE InHandle, const HANDLE OutHandle, const std::wstring& VtMode, _In_opt_ HANDLE SignalHandle);
void _ShutdownIfNeeded();
#ifdef UNIT_TESTING
friend class VtIoTests;
#endif
};
}