Replace some macros with constexpr (#3362)
This commit is contained in:
parent
8c8672c87a
commit
86e0ea73e2
|
@ -19,14 +19,14 @@ Revision History:
|
|||
|
||||
#include "../inc/conattrs.hpp"
|
||||
|
||||
// the following values are used to create the textmode cursor.
|
||||
#define CURSOR_SMALL_SIZE 25 // large enough to be one pixel on a six pixel font
|
||||
class TextBuffer;
|
||||
|
||||
class Cursor final
|
||||
{
|
||||
public:
|
||||
static const unsigned int s_InvertCursorColor = INVALID_COLOR;
|
||||
// the following values are used to create the textmode cursor.
|
||||
static constexpr unsigned int CURSOR_SMALL_SIZE = 25; // large enough to be one pixel on a six pixel font
|
||||
|
||||
Cursor(const ULONG ulSize, TextBuffer& parentBuffer) noexcept;
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@ using Microsoft::Console::VirtualTerminal::StateMachine;
|
|||
// Used by WriteCharsLegacy.
|
||||
#define IS_GLYPH_CHAR(wch) (((wch) < L' ') || ((wch) == 0x007F))
|
||||
|
||||
constexpr unsigned int LOCAL_BUFFER_SIZE = 100;
|
||||
|
||||
// Routine Description:
|
||||
// - This routine updates the cursor position. Its input is the non-special
|
||||
// cased new location of the cursor. For example, if the cursor were being
|
||||
|
|
|
@ -40,8 +40,6 @@ Return Value:
|
|||
const BOOL fKeepCursorVisible,
|
||||
_Inout_opt_ PSHORT psScrollY);
|
||||
|
||||
#define LOCAL_BUFFER_SIZE 100
|
||||
|
||||
/*++
|
||||
Routine Description:
|
||||
This routine writes a string to the screen, processing any embedded
|
||||
|
|
|
@ -412,7 +412,7 @@ void SetCurrentCommandLine(COOKED_READ_DATA& cookedReadData, _In_ SHORT Index) /
|
|||
{
|
||||
if (cookedReadData.HasHistory() &&
|
||||
cookedReadData.History().GetNumberOfCommands() &&
|
||||
cookedReadData.ScreenInfo().GetBufferSize().Width() >= MINIMUM_COMMAND_PROMPT_SIZE + 2)
|
||||
cookedReadData.ScreenInfo().GetBufferSize().Width() >= Popup::MINIMUM_COMMAND_PROMPT_SIZE + 2)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -1223,7 +1223,7 @@ void EventsToUnicode(_Inout_ std::deque<std::unique_ptr<IInputEvent>>& inEvents,
|
|||
WindowSize,
|
||||
siExisting.GetAttributes(),
|
||||
siExisting.GetAttributes(),
|
||||
CURSOR_SMALL_SIZE,
|
||||
Cursor::CURSOR_SMALL_SIZE,
|
||||
&ScreenInfo);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
|
|
@ -24,13 +24,13 @@ Revision History:
|
|||
#include "screenInfo.hpp"
|
||||
#include "readDataCooked.hpp"
|
||||
|
||||
#define MINIMUM_COMMAND_PROMPT_SIZE 5
|
||||
|
||||
class CommandHistory;
|
||||
|
||||
class Popup
|
||||
{
|
||||
public:
|
||||
static constexpr unsigned int MINIMUM_COMMAND_PROMPT_SIZE = 5;
|
||||
|
||||
using UserInputFunction = std::function<NTSTATUS(COOKED_READ_DATA&, bool&, DWORD&, wchar_t&)>;
|
||||
|
||||
Popup(SCREEN_INFORMATION& screenInfo, const COORD proposedSize);
|
||||
|
|
|
@ -2032,7 +2032,7 @@ const SCREEN_INFORMATION& SCREEN_INFORMATION::GetMainBuffer() const
|
|||
WindowSize,
|
||||
GetAttributes(),
|
||||
*GetPopupAttributes(),
|
||||
CURSOR_SMALL_SIZE,
|
||||
Cursor::CURSOR_SMALL_SIZE,
|
||||
ppsiNewScreenBuffer);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@ Settings::Settings() :
|
|||
_uFontFamily(0),
|
||||
_uFontWeight(0),
|
||||
// FaceName initialized below
|
||||
_uCursorSize(CURSOR_SMALL_SIZE),
|
||||
_uCursorSize(Cursor::CURSOR_SMALL_SIZE),
|
||||
_bFullScreen(false),
|
||||
_bQuickEdit(true),
|
||||
_bInsertMode(true),
|
||||
|
|
|
@ -21,7 +21,7 @@ Revision History:
|
|||
#include "../buffer/out/TextAttribute.hpp"
|
||||
|
||||
// To prevent invisible windows, set a lower threshold on window alpha channel.
|
||||
#define MIN_WINDOW_OPACITY 0x4D // 0x4D is approximately 30% visible/opaque (70% transparent). Valid range is 0x00-0xff.
|
||||
constexpr unsigned short MIN_WINDOW_OPACITY = 0x4D; // 0x4D is approximately 30% visible/opaque (70% transparent). Valid range is 0x00-0xff.
|
||||
|
||||
#include "ConsoleArguments.hpp"
|
||||
#include "../inc/conattrs.hpp"
|
||||
|
|
|
@ -21,8 +21,6 @@ Author(s):
|
|||
#include "terminalOutput.hpp"
|
||||
#include <math.h>
|
||||
|
||||
#define XTERM_COLOR_TABLE_SIZE (256)
|
||||
|
||||
namespace Microsoft::Console::VirtualTerminal
|
||||
{
|
||||
class AdaptDispatch : public ITermDispatch
|
||||
|
|
Loading…
Reference in a new issue