-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconareainfo.h
More file actions
75 lines (59 loc) · 2.2 KB
/
Copy pathconareainfo.h
File metadata and controls
75 lines (59 loc) · 2.2 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
/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Module Name:
- conareainfo.h
Abstract:
- This module contains the structures for the console IME conversion area
- The conversion area is the overlay on the screen where a user attempts to form
a string that they would like to insert into the buffer.
Author:
- Michael Niksa (MiNiksa) 10-May-2018
Revision History:
- From pieces of convarea.cpp originally authored by KazuM
--*/
#pragma once
#include "../buffer/out/OutputCell.hpp"
#include "../buffer/out/TextAttribute.hpp"
#include "../renderer/inc/FontInfo.hpp"
class SCREEN_INFORMATION;
class TextBuffer;
// Internal structures and definitions used by the conversion area.
class ConversionAreaBufferInfo final
{
public:
COORD coordCaBuffer;
SMALL_RECT rcViewCaWindow;
COORD coordConView;
ConversionAreaBufferInfo(const COORD coordBufferSize);
};
class ConversionAreaInfo final
{
public:
ConversionAreaInfo(const COORD bufferSize,
const COORD windowSize,
const CHAR_INFO fill,
const CHAR_INFO popupFill,
const FontInfo fontInfo);
~ConversionAreaInfo() = default;
ConversionAreaInfo(const ConversionAreaInfo&) = delete;
ConversionAreaInfo(ConversionAreaInfo&& other);
ConversionAreaInfo& operator=(const ConversionAreaInfo&) & = delete;
ConversionAreaInfo& operator=(ConversionAreaInfo&&) & = delete;
bool IsHidden() const noexcept;
void SetHidden(const bool fIsHidden) noexcept;
void ClearArea() noexcept;
[[nodiscard]]
HRESULT Resize(const COORD newSize) noexcept;
void SetViewPos(const COORD pos) noexcept;
void SetWindowInfo(const SMALL_RECT view) noexcept;
void Paint() const noexcept;
void WriteText(const std::vector<OutputCell>& text, const SHORT column);
void SetAttributes(const TextAttribute& attr);
const TextBuffer& GetTextBuffer() const noexcept;
const ConversionAreaBufferInfo& GetAreaBufferInfo() const noexcept;
private:
ConversionAreaBufferInfo _caInfo;
std::unique_ptr<SCREEN_INFORMATION> _screenBuffer;
bool _isHidden;
};