Commit Graph

7763 Commits

Author SHA1 Message Date
Tig
c00de4a092 Makes Window default Arrangement not be movable/resizable (#3931)
* Window -> not sizeable/movable by default.
Window: Code cleanup.
Frameview: Code cleanup.

* View API docs updates

* View API docs updates
2025-02-27 12:24:31 -07:00
Tig
b62e826576 API doc updates (#3928) 2025-02-27 10:45:31 -07:00
Tonttu
255114f0f2 Reduce IntersectionType[] allocations (#3924)
* Eliminate LineCanvas.Has params array allocation

Inline ReadOnlySpan arguments do not incur heap allocation compared to regular arrays.

* Allocate once LineCanvas.Exactly corner intersection arrays

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
2025-02-27 10:44:39 -07:00
BDisp
e632a12049 Fixes #3881. PositionCursor broke with recent ConsoleDriver changes. (#3927) 2025-02-27 10:01:42 -07:00
Tig
aff7e2c6d5 Fixed nav (#3926) 2025-02-27 08:09:36 -07:00
Tig
f3697a99f4 Fixes #3839, #3922 - CM Glyphs not working (#3923)
* fixed

* Moved Glyphs to ThemeScope

* Removed test code
2025-02-26 15:24:58 -07:00
Tig
7ba6d638bc Fixes #3918 and #3913 - Accepting behavior (#3921)
* Fixed #3905, #3918

* Tweaked Generic

* Label code cleanup

* Clean up.

* Clean up.

* Clean up2.
2025-02-26 12:40:45 -07:00
Tonttu
35522cc517 Reduce func allocations (#3919)
* Replace Region.Contains LINQ lambdas with foreach loop

Removes the lambda func allocations caused by captured outer variables.

* Replace LineCanvas.Has LINQ lambda with foreach loop

* Fix LineCanvas.GetMap intersects array nullability

It should be enough to add null-forgiving operator somewhere in the LINQ query to make the final result non-null. No need to shove the nullability further down the line to complicate things. :)

* Replace LineCanvas.All LINQ lambda with foreach loop

* Replace Region.Intersect LINQ lambdas and list allocation with foreach loop and rented array

* Use stackalloc buffer in Region.Intersect when max 8 rectangles

* Fix LineCanvas.GetCellMap intersects array nullability

* Remove leftover LineCanvas.GetRuneForIntersects null-conditional operators

* Remove leftover IntersectionRuneResolver.GetRuneForIntersects null-conditional operators

* PosAlign.CalculateMinDimension: calculate sum during loop

No need to first put the dimensions in a list and then sum the list when you can just add to sum while looping through dimensions.

* PosAlign.CalculateMinDimension: Remove intermediate list and related filter func allocation

* TextFormatter.GetRuneWidth: Remove intermediate list and related sum func allocation

* ReadOnlySpan refactor preparation for GetCellMap rewrite

* LineCanvas.GetCellMap: Reuse intersection list outside nested loops

GetCellMap would not benefit much from array pool because IntersectionDefinition is not struct. This  change eliminates majority of the rest of Func<,> allocations. As a bonus IntersectionDefinition[] allocations dropped nicely.

* Refactor local method UseRounded

* Wrap too long list of method parameters

* Region: Consistent location for #nullable enable

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
2025-02-25 10:18:23 -07:00
Tonttu
e24bd67658 Rune extensions micro-optimizations (#3910)
* Add benchmarks for potentially optimizable RuneExtensions

* Add new RuneExtensions.DecodeSurrogatePair benchmark implementation

Avoids intermediate heap array allocations which is especially nice when the rune is not surrogate pair because then array heap allocations are completely avoided.

* Enable nullable reference types in RuneExtensions

* Make RuneExtensions.MaxUnicodeCodePoint readonly

Makes sure no one can accidentally change the value. Ideally would be const value.

* Optimize RuneExtensions.DecodeSurrogatePair

* Remove duplicate Rune.GetUnicodeCategory call

* Add new RuneExtensions.IsSurrogatePair benchmark implementation

Avoids intermediate heap allocations by using stack allocated buffer.

* Optimize RuneExtensions.IsSurrogatePair

* Add RuneExtensions.GetEncodingLength tests

* Optimize RuneExtensions.GetEncodingLength

* Optimize RuneExtensions.Encode

* Print encoding name in benchmark results

* Rename variable to better match return description

* Add RuneExtensions.EncodeSurrogatePair benchmark

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
2025-02-25 09:42:32 -07:00
Tig
ff353fc57c testing versions 2025-02-18 16:54:33 -07:00
Tig
e7a784b27c Moved scripts 2025-02-18 16:53:38 -07:00
Tig
dfb3e92be8 Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_develop 2025-02-18 16:31:20 -07:00
Tig
0330cda9ed Merge branch 'v2_develop' of tig:tig/Terminal.Gui into v2_develop 2025-02-18 16:30:46 -07:00
Tig
40be08beef Fixing versions 3 2025-02-18 16:30:26 -07:00
Tig
daf4f6ac8c Trying to fix versrions (#3912)
* Fixing versions

* Fixing versions 2
2025-02-18 16:13:02 -07:00
Tig
e6c8a58291 Merge branch 'v2_develop' into v2_develop 2025-02-18 15:12:44 -08:00
Tig
ac485498c2 Fixing versions 2 2025-02-18 16:11:40 -07:00
Tig
c0cb276361 Fixing versions 2025-02-18 16:07:37 -07:00
Tig
6fcd5efa6a Update GitVersion.yml (#3911) 2025-02-18 15:48:16 -07:00
Rishikeshan Sulochana/Lavakumar (Work)
dc004c4923 (Minor fix) Fix the link text, refer to the F# example too (#3901)
The sample code was removed and was replaced with a link; the markup was bleeding.

Co-authored-by: Tig <tig@users.noreply.github.com>
2025-02-05 10:03:35 -07:00
Rishikeshan Sulochana/Lavakumar (Work)
da2d20e488 Add Terminal.Gui Designer (#3902)
Terminal.Gui Designer is special in the sense it is also a good companion tool, especially for rapid prototyping and for beginners.
2025-02-05 10:02:51 -07:00
Thomas Nind
81ad695ef7 Fix foreach runes bug with unicode surrogate pairs (#3894) 2025-01-12 10:05:52 -07:00
Tig
7676f89e39 Merge pull request #3880 from tig/v2_3778-Command-Decoupling
Fixes #3778: Decouples `Command` from `KeyBindings`
v2.0.0-develop.1 v2.0.0-v2-develop.3000
2024-12-10 07:02:40 -08:00
Tig
63b3ebf2f4 Fixed RadioGroup unit test that was previosly bogus 2024-12-10 06:51:53 -08:00
Tig
ea74179833 Refactored RadioGroup to just use Commands 2024-12-09 22:56:19 -08:00
Tig
97d4c0a0d8 Refactored RadioGroup to just use Commands 2024-12-09 22:52:45 -08:00
Tig
9563ec9734 Key -> nullable enable 2024-12-09 22:29:09 -08:00
Tig
1180b2fe31 Code cleanup 2024-12-09 22:18:25 -08:00
Tig
2b8884a881 Finished integrated tznind's work. 2024-12-09 22:03:40 -08:00
Tig
23344baca7 Incorporated tznind's stuff 2024-12-09 16:53:58 -08:00
tznind
d15b3021d1 Equality comparer support 2024-12-09 20:49:01 +00:00
tznind
c18cff280e make keybindings share base 2024-12-09 20:43:32 +00:00
tznind
9002acf942 WIP move more to bind base class 2024-12-09 20:29:54 +00:00
tznind
bf8879537c Super rough sketch of what generics solution would look like 2024-12-09 16:59:17 +00:00
Tig
9f4d30db2b Unit test tweak 2024-12-08 18:34:39 -08:00
Tig
ed67edad41 Doc tweak 2024-12-08 18:30:03 -08:00
Tig
e6aeada480 Tweaked HexView 2024-12-08 17:37:28 -08:00
Tig
babc6fead9 Tweaked ColorPicker16 2024-12-08 17:10:08 -08:00
Tig
e502a13402 MouseBindings tests 2024-12-08 13:40:32 -08:00
Tig
98244b7131 KeyBindings cleanup 2024-12-08 07:23:38 -08:00
Tig
7e289f02e9 KeyBindings cleanup 2024-12-08 07:19:48 -08:00
Tig
921d125aa0 TOOD 2024-12-07 23:49:34 -08:00
Tig
0f137579c8 Combined KeyBinding classes 2024-12-07 23:42:38 -08:00
Tig
0b72db2785 Doc updates. 2024-12-07 22:22:17 -08:00
Tig
f673ef3b6c Doc updates. Code cleanup 2024-12-07 22:12:27 -08:00
Tig
5a0b3507a0 Merged v2_develop.
Code cleanup
2024-12-07 14:37:17 -08:00
Tig
3e6e758302 Merge branch 'v2_develop' into v2_3778-Command-Decoupling 2024-12-07 15:21:44 -07:00
Tig
3edcf643dc Fixed unit tests 2024-12-07 10:58:34 -08:00
Tig
62641c8f26 Merge pull request #3791 from tznind/ansi-parser
Fixes #3767 - Adds Ansi parser and scheduler.
2024-12-07 08:09:28 -07:00
Thomas Nind
903a886c38 Merge branch 'v2_develop' into ansi-parser 2024-12-07 10:06:29 +00:00