03ea0f49ad
## Summary of the Pull Request This is a follow up to #9300. Now that we have names on our windows, it would be nice to see who is named what. So this adds two actions: * `identifyWindow`: This action will pop up a little toast (#8592) displaying the name and ID of the window, and is bound by default. ![identify-window-toast-000](https://user-images.githubusercontent.com/18356694/111529085-bf710580-872f-11eb-8880-b0b617596cfc.gif) * `identifyWindows`: This action will request that ALL windows pop up that toast. This is meant to feel like the "Identify" button on the Windows display settings. However, sometimes, it's wonky. ![teaching-tip-dismiss-001](https://user-images.githubusercontent.com/18356694/111529292-fe06c000-872f-11eb-8d4a-5688e4ce1175.gif) That's being tracked upstream on https://github.com/microsoft/microsoft-ui-xaml/issues/4382 Because it's so wonky, we won't bind that by default. Maybe if we get that fixed, then we'll change the default binding from `identifyWindow` to `identifyWindows` ## References ## PR Checklist * [x] Closes https://github.com/microsoft/terminal/projects/5#card-51431492 * [x] I work here * [x] Tests added/passed * [ ] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments You may note that there are some macros to make interacting with lots and lots of actions easier. There's a lot of boilerplate whenever you need to make a new action, so I thought: "Can we make that easier?" Turns out you can make it a _LOT_ easier, but that work is still behind another PR after this one. Get excited
36 lines
1.6 KiB
PowerShell
36 lines
1.6 KiB
PowerShell
# This script is used for taking a json file and stamping it into a header with
|
|
# the contents of that json files as a constexpr string_view in the header.
|
|
|
|
param (
|
|
[parameter(Mandatory=$true, Position=0)]
|
|
[string]$JsonFile,
|
|
|
|
[parameter(Mandatory=$true, Position=1)]
|
|
[string]$OutPath,
|
|
|
|
[parameter(Mandatory=$true, Position=2)]
|
|
[string]$VariableName
|
|
)
|
|
|
|
# Load the xml files.
|
|
$jsonData = Get-Content $JsonFile
|
|
|
|
Write-Output "// Copyright (c) Microsoft Corporation" | Out-File -FilePath $OutPath -Encoding ASCII
|
|
Write-Output "// Licensed under the MIT license." | Out-File -FilePath $OutPath -Encoding ASCII -Append
|
|
Write-Output "" | Out-File -FilePath $OutPath -Encoding ASCII -Append
|
|
Write-Output "// THIS IS AN AUTO-GENERATED FILE" | Out-File -FilePath $OutPath -Encoding ASCII -Append
|
|
Write-Output "// Generated from " | Out-File -FilePath $OutPath -Encoding ASCII -Append -NoNewline
|
|
$fullPath = Resolve-Path -Path $JsonFile
|
|
Write-Output $fullPath.Path | Out-File -FilePath $OutPath -Encoding ASCII -Append
|
|
Write-Output "constexpr std::string_view $($VariableName){ " | Out-File -FilePath $OutPath -Encoding ASCII -Append
|
|
|
|
# Write each line escaped on its own, as it's own literal. This file is _very
|
|
# big_, so big that it cannot fit in a single string literal :O The compiler is,
|
|
# however, smart enough to just concatenate all these literals into one big
|
|
# string.
|
|
$jsonData | foreach {
|
|
Write-Output "R`"($_`n)`"" | Out-File -FilePath $OutPath -Encoding ASCII -Append
|
|
}
|
|
Write-Output "};" | Out-File -FilePath $OutPath -Encoding ASCII -Append
|
|
|