2019-05-03 00:29:04 +02:00
|
|
|
/*++
|
|
|
|
Copyright (c) Microsoft Corporation
|
|
|
|
Licensed under the MIT license.
|
|
|
|
|
|
|
|
Module Name:
|
|
|
|
- getset.h
|
|
|
|
|
|
|
|
Abstract:
|
|
|
|
- This file implements the NT console server console state API.
|
|
|
|
|
|
|
|
Author:
|
|
|
|
- Therese Stowell (ThereseS) 5-Dec-1990
|
|
|
|
|
|
|
|
Revision History:
|
|
|
|
--*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "../inc/conattrs.hpp"
|
|
|
|
class SCREEN_INFORMATION;
|
|
|
|
|
|
|
|
void DoSrvPrivateSetLegacyAttributes(SCREEN_INFORMATION& screenInfo,
|
|
|
|
const WORD Attribute,
|
|
|
|
const bool fForeground,
|
|
|
|
const bool fBackground,
|
|
|
|
const bool fMeta);
|
|
|
|
|
|
|
|
void DoSrvPrivateSetDefaultAttributes(SCREEN_INFORMATION& screenInfo, const bool fForeground, const bool fBackground);
|
|
|
|
|
2019-06-11 22:27:09 +02:00
|
|
|
[[nodiscard]] NTSTATUS DoSrvPrivateSetCursorKeysMode(_In_ bool fApplicationMode);
|
|
|
|
[[nodiscard]] NTSTATUS DoSrvPrivateSetKeypadMode(_In_ bool fApplicationMode);
|
2019-05-03 00:29:04 +02:00
|
|
|
|
|
|
|
void DoSrvPrivateShowCursor(SCREEN_INFORMATION& screenInfo, const bool show) noexcept;
|
|
|
|
void DoSrvPrivateAllowCursorBlinking(SCREEN_INFORMATION& screenInfo, const bool fEnable);
|
|
|
|
|
2019-06-11 22:27:09 +02:00
|
|
|
[[nodiscard]] NTSTATUS DoSrvPrivateSetScrollingRegion(SCREEN_INFORMATION& screenInfo, const SMALL_RECT* const psrScrollMargins);
|
|
|
|
[[nodiscard]] NTSTATUS DoSrvPrivateReverseLineFeed(SCREEN_INFORMATION& screenInfo);
|
|
|
|
[[nodiscard]] HRESULT DoSrvMoveCursorVertically(SCREEN_INFORMATION& screenInfo, const short lines);
|
|
|
|
|
|
|
|
[[nodiscard]] NTSTATUS DoSrvPrivateUseAlternateScreenBuffer(SCREEN_INFORMATION& screenInfo);
|
|
|
|
void DoSrvPrivateUseMainScreenBuffer(SCREEN_INFORMATION& screenInfo);
|
|
|
|
|
|
|
|
[[nodiscard]] NTSTATUS DoSrvPrivateHorizontalTabSet();
|
|
|
|
[[nodiscard]] NTSTATUS DoSrvPrivateForwardTab(const SHORT sNumTabs);
|
|
|
|
[[nodiscard]] NTSTATUS DoSrvPrivateBackwardsTab(const SHORT sNumTabs);
|
2019-05-03 00:29:04 +02:00
|
|
|
void DoSrvPrivateTabClear(const bool fClearAll);
|
|
|
|
|
|
|
|
void DoSrvPrivateEnableVT200MouseMode(const bool fEnable);
|
|
|
|
void DoSrvPrivateEnableUTF8ExtendedMouseMode(const bool fEnable);
|
|
|
|
void DoSrvPrivateEnableSGRExtendedMouseMode(const bool fEnable);
|
|
|
|
void DoSrvPrivateEnableButtonEventMouseMode(const bool fEnable);
|
|
|
|
void DoSrvPrivateEnableAnyEventMouseMode(const bool fEnable);
|
|
|
|
void DoSrvPrivateEnableAlternateScroll(const bool fEnable);
|
|
|
|
|
|
|
|
void DoSrvPrivateSetConsoleXtermTextAttribute(SCREEN_INFORMATION& screenInfo,
|
|
|
|
const int iXtermTableEntry,
|
|
|
|
const bool fIsForeground);
|
|
|
|
void DoSrvPrivateSetConsoleRGBTextAttribute(SCREEN_INFORMATION& screenInfo,
|
|
|
|
const COLORREF rgbColor,
|
|
|
|
const bool fIsForeground);
|
|
|
|
|
|
|
|
void DoSrvPrivateBoldText(SCREEN_INFORMATION& screenInfo, const bool bolded);
|
|
|
|
|
Add support for passing through extended text attributes, like… (#2917)
## Summary of the Pull Request
Adds support for Italics, Blinking, Invisible, CrossedOut text, THROUGH CONPTY. This does **NOT** add support for those styles to conhost or the terminal.
We will store these "Extended Text Attributes" in a `TextAttribute`. When we go to render a line, we'll see if the state has changed from our previous state, and if so, we'll appropriately toggle that state with VT. Boldness has been moved from a `bool` to a single bit in these flags.
Technically, now that these are stored in the buffer, we only need to make changes to the renderers to be able to support them. That's not being done as a part of this PR however.
## References
See also #2915 and #2916, which are some follow-up tasks from this fix. I thought them too risky for 20H1.
## PR Checklist
* [x] Closes #2554
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated
<hr>
* store text with extended attributes too
* Plumb attributes through all the renderers
* parse extended attrs, though we're not renderering them right
* Render these states correctly
* Add a very extensive test
* Cleanup for PR
* a block of PR feedback
* add 512 test cases
* Fix the build
* Fix @carlos-zamora's suggestions
* @miniksa's PR feedback
2019-10-04 22:53:54 +02:00
|
|
|
ExtendedAttributes DoSrvPrivateGetExtendedTextAttributes(SCREEN_INFORMATION& screenInfo);
|
|
|
|
void DoSrvPrivateSetExtendedTextAttributes(SCREEN_INFORMATION& screenInfo, const ExtendedAttributes attrs);
|
|
|
|
|
2019-06-11 22:27:09 +02:00
|
|
|
[[nodiscard]] NTSTATUS DoSrvPrivateEraseAll(SCREEN_INFORMATION& screenInfo);
|
2019-05-03 00:29:04 +02:00
|
|
|
|
|
|
|
void DoSrvSetCursorStyle(SCREEN_INFORMATION& screenInfo,
|
|
|
|
const CursorType cursorType);
|
|
|
|
void DoSrvSetCursorColor(SCREEN_INFORMATION& screenInfo,
|
|
|
|
const COLORREF cursorColor);
|
|
|
|
|
2019-06-11 22:27:09 +02:00
|
|
|
[[nodiscard]] NTSTATUS DoSrvPrivateGetConsoleScreenBufferAttributes(const SCREEN_INFORMATION& screenInfo,
|
|
|
|
_Out_ WORD* const pwAttributes);
|
2019-05-03 00:29:04 +02:00
|
|
|
|
|
|
|
void DoSrvPrivateRefreshWindow(const SCREEN_INFORMATION& screenInfo);
|
|
|
|
|
|
|
|
void DoSrvGetConsoleOutputCodePage(_Out_ unsigned int* const pCodePage);
|
|
|
|
|
2019-06-11 22:27:09 +02:00
|
|
|
[[nodiscard]] NTSTATUS DoSrvPrivateSuppressResizeRepaint();
|
2019-05-03 00:29:04 +02:00
|
|
|
|
|
|
|
void DoSrvIsConsolePty(_Out_ bool* const pIsPty);
|
|
|
|
|
|
|
|
void DoSrvPrivateSetDefaultTabStops();
|
|
|
|
void DoSrvPrivateDeleteLines(const unsigned int count);
|
|
|
|
void DoSrvPrivateInsertLines(const unsigned int count);
|
|
|
|
|
|
|
|
void DoSrvPrivateMoveToBottom(SCREEN_INFORMATION& screenInfo);
|
|
|
|
|
2019-06-11 22:27:09 +02:00
|
|
|
[[nodiscard]] HRESULT DoSrvPrivateSetColorTableEntry(const short index, const COLORREF value) noexcept;
|
2019-05-24 18:53:00 +02:00
|
|
|
|
2019-06-11 22:27:09 +02:00
|
|
|
[[nodiscard]] HRESULT DoSrvPrivateSetDefaultForegroundColor(const COLORREF value) noexcept;
|
2019-05-24 18:53:00 +02:00
|
|
|
|
2019-06-11 22:27:09 +02:00
|
|
|
[[nodiscard]] HRESULT DoSrvPrivateSetDefaultBackgroundColor(const COLORREF value) noexcept;
|