terminal/src/inc
Michael Niksa f5ab042939
til::rectangle (#4912)
## Summary of the Pull Request
Introduces convenience type `til::rectangle` which automatically implements our best practices for rectangle-related types and provides automatic conversions in/out of the relevant types.

## PR Checklist
* [x] In support of Differential Rendering #778
* [X] I work here.
* [x] Tests added/passed
* [x] I'm a core contributor.

## Detailed Description of the Pull Request / Additional comments
- Automatically converts in from anything with a Left/Top/Right/Bottom or left/top/right/bottom (Win32 `RECT`)
- Automatically converts Console type `SMALL_RECT` and shifts it from **inclusive** to **exclusive** on instantiation
- Automatically converts out to `SMALL_RECT` (converting back to **inclusive**), `RECT`, or `D2D1_RECT_F`.
- Constructs from bare integers written into source file
- Constructs from a single `til::point` as a 1x1 size rectangle with top-left corner (origin) at that point
- Constructs from a single `til::size` as a WxH size rectangle with top-left corner (origin) at 0,0
- Constructs from a `til::point` and a `til::size` representing the top-left corner and the width by height.
- Constructs from a `til::point` and another `til::point` representing the top-left corner and the **exclusive** bottom-right corner.
- Default constructs to empty
- Uses Chromium numerics for all basic math operations (+, -, *, /)
- Provides equality tests
- Provides `operator bool` to know when it's valid (has an area > 0) and `empty()` to know the contrary
- Accessors for left/top/right/bottom
- Type converting accessors (that use safe conversions and throw) for left/top/right/bottom
- Convenience methods for finding width/height (with Chromium numerics operations) and type-converting templates (with Chromium numerics conversions).
- Accessors for origin (top-left point) and the size/dimensions (as a `til::size`).
- Intersect operation on `operator &` to find where two `til::rectangle`s overlap, returned as a `til::rectangle`.
- Union operation on `operator |` to find the total area covered by two `til::rectangles`, returned as a `til::rectangle`.
- Subtract operation on `operator -` to find the area remaining after one `til::rectangle` is removed from another, returned as a `til::some<til::rectangle, 4>`.
- TAEF/WEX Output and Comparators so they will print very nicely with `VERIFY` and `Log` macros in our testing suite.
- Additional comparators, TAEF/WEX output, and tests written on `til::some` to support the Subtract operation.
- A natvis

## Validation Steps Performed
- See automated tests of functionality.
2020-03-14 17:27:47 +00:00
..
CppCoreCheck Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
test Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
til til::rectangle (#4912) 2020-03-14 17:27:47 +00:00
argb.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
conattrs.hpp Add support for passing through extended text attributes, like… (#2917) 2019-10-04 15:53:54 -05:00
conime.h Replace macros with constexpr part 2 (#3416) 2019-11-04 07:37:47 -06:00
conint.h Merge remote-tracking branch 'origin/inbox' into HEAD 2020-02-03 15:16:52 -08:00
conpty-static.h Add support for "reflow"ing the Terminal buffer (#4741) 2020-03-12 17:43:37 -07:00
conpty.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
consoletaeftemplates.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
contsf.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
cpl_core.h Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
DefaultSettings.h Terminal uses system default for number of rows scrolled at a t… (#3575) 2020-01-06 09:39:02 -08:00
HostAndPropsheetIncludes.h Introduce UiaTextRangeBase::FindText() for Accessibility (#4373) 2020-01-31 23:26:19 +00:00
IDefaultColorProvider.hpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
ITerminalOutputConnection.hpp Apply audit mode to TerminalInput/Adapter/Parser libraries (#4005) 2020-01-03 14:25:21 +00:00
ITerminalOwner.hpp Revert locking changes (#3488) 2019-11-08 13:44:52 -08:00
LibraryIncludes.h add til::color, a universal-converting color type (#4108) 2020-03-10 00:17:24 +00:00
operators.hpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
til.h til::rectangle (#4912) 2020-03-14 17:27:47 +00:00
unicode.hpp The Azure cloud shell connector (#1808) 2019-07-25 13:31:41 -07:00
VtIoModes.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00