-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconimeinfo.h
More file actions
92 lines (68 loc) · 3.25 KB
/
Copy pathconimeinfo.h
File metadata and controls
92 lines (68 loc) · 3.25 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Module Name:
- conimeinfo.h
Abstract:
- This module contains the structures for the console IME entrypoints
for overall control
Author:
- Michael Niksa (MiNiksa) 10-May-2018
Revision History:
- From pieces of convarea.cpp originally authored by KazuM
--*/
#pragma once
#include "../inc/conime.h"
#include "../buffer/out/OutputCell.hpp"
#include "../buffer/out/TextAttribute.hpp"
#include "../renderer/inc/FontInfo.hpp"
#include "../types/inc/viewport.hpp"
#include "conareainfo.h"
class SCREEN_INFORMATION;
class ConsoleImeInfo final
{
public:
// IME compositon string information
// There is one "composition string" per line that must be rendered on the screen
std::vector<ConversionAreaInfo> ConvAreaCompStr;
ConsoleImeInfo();
~ConsoleImeInfo() = default;
ConsoleImeInfo(const ConsoleImeInfo&) = delete;
ConsoleImeInfo(ConsoleImeInfo&&) = delete;
ConsoleImeInfo& operator=(const ConsoleImeInfo&) & = delete;
ConsoleImeInfo& operator=(ConsoleImeInfo&&) & = delete;
void RefreshAreaAttributes();
void ClearAllAreas();
[[nodiscard]]
HRESULT ResizeAllAreas(const COORD newSize);
void WriteCompMessage(const std::wstring_view text,
const std::basic_string_view<BYTE> attributes,
const std::basic_string_view<WORD> colorArray);
void WriteResultMessage(const std::wstring_view text);
void RedrawCompMessage();
private:
[[nodiscard]]
HRESULT _AddConversionArea();
void _ClearComposition();
void _WriteUndeterminedChars(const std::wstring_view text,
const std::basic_string_view<BYTE> attributes,
const std::basic_string_view<WORD> colorArray);
void _InsertConvertedString(const std::wstring_view text);
static TextAttribute s_RetrieveAttributeAt(const size_t pos,
const std::basic_string_view<BYTE> attributes,
const std::basic_string_view<WORD> colorArray);
static std::vector<OutputCell> s_ConvertToCells(const std::wstring_view text,
const std::basic_string_view<BYTE> attributes,
const std::basic_string_view<WORD> colorArray);
std::vector<OutputCell>::const_iterator _WriteConversionArea(const std::vector<OutputCell>::const_iterator begin,
const std::vector<OutputCell>::const_iterator end,
COORD& pos,
const Microsoft::Console::Types::Viewport view,
SCREEN_INFORMATION& screenInfo);
void _SaveCursorVisibility();
void _RestoreCursorVisibility();
bool _isSavedCursorVisible;
std::wstring _text;
std::basic_string<BYTE> _attributes;
std::basic_string<WORD> _colorArray;
};