terminal/tools/ConsoleTypes.natvis
Leonard Hecker a8e4bedae3
Introduce til::rle - a run length encoded vector (#10099)
## Summary of the Pull Request

Introduces `til::rle`, a vector-like container which stores elements of
type T in a run length encoded format. This allows efficient compaction
of repeated elements within the vector.

## References

* #8000 - Supports buffer rewrite work. A re-use of `til::rle` will be
  useful as a column counter as we pursue NxM storage and presentation.
* #3075 - The new iterators allow skipping forward by multiple units,
  which wasn't possible under `TextBuffer-/OutputCellIterator`.
  Additionally it also allows a bulk insertions.
* #8787 and #410 - High probability this should be `pmr`-ified
  like `bitmap` for things like `chafa` and `cacafire`
  which are changing the run length frequently.

## PR Checklist

* [x] Closes #8741
* [x] I work here.
* [x] Tests added.
* [x] Tests passed.

## Validation Steps Performed

* [x] Ran `cacafire` in `OpenConsole.exe` and it looked beautiful
* [x] Ran new suite of `RunLengthEncodingTests.cpp`

Co-authored-by: Michael Niksa <miniksa@microsoft.com>
2021-05-20 17:27:50 +00:00

118 lines
5 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<!-- See https://docs.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects?view=vs-2017#BKMK_Syntax_reference for documentation -->
<Type Name="TextColor">
<DisplayString Condition="_meta==ColorType::IsIndex256">{{Index256:{_index}}}</DisplayString>
<DisplayString Condition="_meta==ColorType::IsIndex16">{{Index16:{_index}}}</DisplayString>
<DisplayString Condition="_meta==ColorType::IsDefault">{{Default}}</DisplayString>
<DisplayString Condition="_meta==ColorType::IsRgb">{{RGB:{_red},{_green},{_blue}}}</DisplayString>
<Expand></Expand>
</Type>
<Type Name="TextAttribute">
<!-- You can't do too much trickiness inside the DisplayString format
string, so we'd have to add entries for each flag if we really
wanted them to show up like that. -->
<DisplayString>{{FG: {_foreground}, BG: {_background}, Legacy: {_wAttrLegacy}, {_extendedAttrs}}</DisplayString>
<Expand>
<Item Name="Legacy">_wAttrLegacy</Item>
<Item Name="FG">_foreground</Item>
<Item Name="BG">_background</Item>
<Item Name="Extended">_extendedAttrs</Item>
</Expand>
</Type>
<Type Name="Microsoft::Console::Types::Viewport">
<!-- Can't call functions in here -->
<DisplayString>{{LT({_sr.Left}, {_sr.Top}) RB({_sr.Right}, {_sr.Bottom}) [{_sr.Right-_sr.Left+1} x { _sr.Bottom-_sr.Top+1}]}}</DisplayString>
<Expand>
<ExpandedItem>_sr</ExpandedItem>
</Expand>
</Type>
<Type Name="_COORD">
<DisplayString>{{{X},{Y}}}</DisplayString>
</Type>
<Type Name="_SMALL_RECT">
<DisplayString>{{LT({Left}, {Top}) RB({Right}, {Bottom}) In:[{Right-Left+1} x {Bottom-Top+1}] Ex:[{Right-Left} x {Bottom-Top}]}}</DisplayString>
</Type>
<Type Name="CharRowCell">
<DisplayString Condition="_attr._glyphStored">Stored Glyph, go to UnicodeStorage.</DisplayString>
<DisplayString Condition="_attr._attribute == 0">{_wch,X} Single</DisplayString>
<DisplayString Condition="_attr._attribute == 1">{_wch,X} Lead</DisplayString>
<DisplayString Condition="_attr._attribute == 2">{_wch,X} Trail</DisplayString>
</Type>
<Type Name="ATTR_ROW">
<Expand>
<ExpandedItem>_data</ExpandedItem>
</Expand>
</Type>
<Type Name="CharRow">
<DisplayString>{{ wrap={_wrapForced} padded={_doubleBytePadded} }}</DisplayString>
<Expand>
<ExpandedItem>_data</ExpandedItem>
</Expand>
</Type>
<Type Name="ROW">
<DisplayString>{{ id={_id} width={_rowWidth} }}</DisplayString>
<Expand>
<Item Name="_charRow">_charRow</Item>
<Item Name="_attrRow">_attrRow</Item>
</Expand>
</Type>
<Type Name="std::unique_ptr&lt;TextBuffer,std::default_delete&lt;TextBuffer&gt;&gt;">
<Expand>
<ExpandedItem>_Mypair._Myval2</ExpandedItem>
</Expand>
</Type>
<Type Name="KeyEvent">
<DisplayString Condition="_keyDown">{{↓ wch:{_charData} mod:{_activeModifierKeys} repeat:{_repeatCount} vk:{_virtualKeyCode} vsc:{_virtualScanCode}}</DisplayString>
<DisplayString Condition="!_keyDown">{{↑ wch:{_charData} mod:{_activeModifierKeys} repeat:{_repeatCount} vk:{_virtualKeyCode} vsc:{_virtualScanCode}}</DisplayString>
</Type>
<Type Name="til::size">
<DisplayString>{{W: {_width,d} x H: {_height,d} -> A: {_width * _height, d}}}</DisplayString>
</Type>
<Type Name="til::point">
<DisplayString>{{X: {_x,d}, Y: {_y,d}}}</DisplayString>
</Type>
<Type Name="til::rectangle">
<DisplayString>{{L: {_topLeft._x}, T: {_topLeft._y}, R: {_bottomRight._x} B: {_bottomRight._y} [W: {_bottomRight._x - _topLeft._x} x H: {_bottomRight._y - _topLeft._y} -> A: {(_bottomRight._x - _topLeft._x) * (_bottomRight._y - _topLeft._y)}]}}</DisplayString>
</Type>
<Type Name="til::color">
<DisplayString>{{RGB: {(int)r,d}, {(int)g,d}, {(int)b,d}; α: {(int)a,d}}}</DisplayString>
</Type>
<Type Name="til::rle&lt;*&gt;">
<DisplayString>{{Size: {_total_length,d}}}</DisplayString>
<Expand>
<Item Name="[size]">_total_length</Item>
<ExpandedItem>_runs</ExpandedItem>
</Expand>
</Type>
<Type Name="til::details::rle_const_iterator&lt;*&gt;">
<DisplayString>{{run of {_it->first,d} for {_it->second,d} at {_usage,d}}}</DisplayString>
</Type>
<Type Name="boost::container::small_vector&lt;*&gt;">
<Expand>
<Item Name="[size]">m_holder.m_size</Item>
<ArrayItems>
<Size>m_holder.m_size</Size>
<ValuePointer>m_holder.m_start</ValuePointer>
</ArrayItems>
</Expand>
</Type>
</AutoVisualizer>